From: Sungguk Na Date: Tue, 28 Mar 2017 04:43:23 +0000 (+0900) Subject: Imported Upstream version 4.16 X-Git-Tag: upstream/4.16^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93f655442b696d93c4a0a9712e45618c4906aa40;p=platform%2Fupstream%2Fstrace.git Imported Upstream version 4.16 Change-Id: Ia4124c246d44d154296955d5f59d2ed5cb0a28eb --- diff --git a/.tarball-version b/.tarball-version index 86a9588a..e95590ca 100644 --- a/.tarball-version +++ b/.tarball-version @@ -1 +1 @@ -4.9 +4.16 diff --git a/.version b/.version index 86a9588a..e95590ca 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -4.9 +4.16 diff --git a/COPYING b/COPYING index e9078d3e..168a7155 100644 --- a/COPYING +++ b/COPYING @@ -4,6 +4,7 @@ Copyright (c) 1993 Ulrich Pegelow Copyright (c) 1995, 1996 Michael Elizabeth Chastain Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey Copyright (C) 1998-2001 Wichert Akkerman +Copyright (C) 2001-2017 The strace developers. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/CREDITS b/CREDITS index 80965df6..3bd4be91 100644 --- a/CREDITS +++ b/CREDITS @@ -14,12 +14,17 @@ strace-devel@lists.sourceforge.net mailing list. Aaron Ucko Adrien Kunysz + Alexey Neyman Ali Polatel + Anchit Jain Andi Kleen + Andre McCurdy Andreas Schwab Anton Blanchard Arkadiusz Miskiewicz + Aurelien Jacobs Bai Weidong + Bart Van Assche Ben Noordhuis Bernhard Reutner-Fischer Bo Kullmar @@ -41,44 +46,63 @@ strace-devel@lists.sourceforge.net mailing list. Denys Vlasenko Dmitry V. Levin Douglas Mencken - Dr. David Alan Gilbert + Dr. David Alan Gilbert Edgar E. Iglesias Elliott Hughes + Elvira Khabirova Erik Johansson + Etienne Gemsa + Eugene Syromyatnikov Ezequiel Garcia + Fabien Siron + Fei Jie + Felix Janda Fernando Luis Vazquez Cao Florian Lohoff Frederik Schüler Gabor Gombas + Gabriel Laskar Ganesan Rajagopal Gaël Roualland + Giedrius Statkevičius + Gleb Fotengauer-Malinovskiy Grant Edwards Greg Banks H.J. Lu Heiko Carstens + Helge Deller Henrik Storner Holger Hans Peter Freyther + Jacob Goense Jakub Bogusz Jakub Jelinek + James Clarke + James Cowgill James Hogan James Yang Jan Kratochvil + JayRJoshi Jeff Mahoney + Jian Zhen + JingPiao Chen Joe Ilacqua Johannes Stezenbach John Hughes John Spencer Ju"rgen Fluk Juergen Weigert + Katerina Koukiou + Keith Owens Keith Thompson - Kirill A. Shutemov Kirill A. Shutemov Kyle McMartin Lai JiangShan Leonard N. Zubkoff Linus Torvalds + Lubomir Rintel Luca Clementi Lupe Christoph + Maarten ter Huurne Mark Hills Mark Wielaard Marty Leisner @@ -90,21 +114,27 @@ strace-devel@lists.sourceforge.net mailing list. Maxin B. John Michael E Chastain Michael Holzheu + Michael Shigorin Michail Litvak Michal Ludvig Mike Frysinger Mike Stroyan + Mikulas Patocka Muttley Meen + Nahim El Atmani Namhyung Kim Nate Eldredge Nate Sammons Neil Campbell Paolo Bonzini + Patrik Jakobsson Paul Mundt Pavel Machek Peter Jones + Philippe De Muyter Philippe Ombredanne Pádraig Brady + Quentin Monnet Rajeev V. Pillai Ralf Baechle Randolph Chung @@ -112,11 +142,14 @@ strace-devel@lists.sourceforge.net mailing list. Richard Braakman Richard Henderson Richard Hirst + Richard W.M. Jones Roland Borde Roland McGrath Sami Farin Scott Tsai + Sean Stangl Sebastian Pipping + Seraphime Kirkovski Sergei Trofimovich Simon Murray Solar Designer @@ -125,15 +158,18 @@ strace-devel@lists.sourceforge.net mailing list. Stefan Sørensen Steve Bennett Steve McIntyre + Szabolcs Nagy Thanh Ma Thiemo Seufer Thomas Bogendoerfer + Thomas De Schampheleire Tim Yamin Timo Lindfors Tom Dyas Tommi Rantala Topi Miettinen Ulrich Drepper + Vicente Olivert Riera Vineet Gupta Wang Chao Wichert Akkerman diff --git a/ChangeLog b/ChangeLog index fd2faa49..d0bf7d5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23723 @@ +2017-02-14 Dmitry V. Levin + + Prepare for 4.16 release. + * NEWS: Update for 4.16 release. + +2017-02-13 Dmitry V. Levin + + .mailmap: add addresses of JingPiao Chen. + * .mailmap: Add both addresses of JingPiao Chen here to avoid + duplications in CREDITS file. + + tests: skip scno tampering tests on compat mips abi. + * tests/scno_tampering.sh: In case of mips abi, skip the test + unless it is the native abi. + +2017-02-12 Dmitry V. Levin + + Fix -Werror=duplicate-decl-specifier compilation issues. + capability.c:82:28: error: duplicate "const" declaration specifier + capability.c:110:33: error: duplicate "const" declaration specifier + rt_tgsigqueueinfo.c:42:61: error: duplicate "const" declaration specifier + utime.c:66:23: error: duplicate "const" declaration specifier + waitid.c:147:20: error: duplicate "const" declaration specifier + + * capability.c (cap_user_header_t, cap_user_data_t): Remove. + (get_cap_header): Change return type + to "const struct user_cap_header_struct *". + (print_cap_header, print_cap_data): Change the type of last argument + to "const struct user_cap_header_struct * const". + (SYS_FUNC(capget)): Change type of "h" variable + to "const struct user_cap_header_struct *". + (SYS_FUNC(capset)): Change type of "h" variable + to "const struct user_cap_header_struct * const". + * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Change the type of last + argument to "const void *const". + * tests/utime.c (main): Change the type of "tail_u" variable + to "const struct utimbuf *const". + * tests/waitid.c (do_waitid): Change the type of 3rd argument + to "const siginfo_t *const". + +2017-02-12 Dmitry V. Levin + + tests: rewrite pipe syscall decoding check from match_grep to match_diff + * configure.ac (AC_CHECK_FUNCS): Remove pipe2. + * tests/pipe.c: Include , skip the test if [!__NR_pipe] + instead of [!HAVE_PIPE2]. + (main): Do not call pipe2. + * tests/pipe.test: Skip the test if libc pipe wrapper does not use + pipe syscall, rewrite from match_grep to match_diff. + * tests/pipe.expected: Update expected output. + +2017-02-11 Dmitry V. Levin + + tests: rewrite pipe2 syscall decoding check from match_grep to match_diff + Unlike pipe.test that is based on match_grep, the new test + is based on match_diff and does more rigorous testing. + + * tests/pipe2.c: New file. + * tests/pipe2.test: New test. + * tests/.gitignore: Add pipe2. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add pipe2.test. + +2017-02-10 Dmitry V. Levin + + tests: rewrite mq.test from match_grep to match_diff. + Unlike the previous edition of the test that was based on match_grep, + the new one is match_diff based and does more rigorous testing. + + * tests/mq.c: Include . + (NAME): New macro. + (main): Use it. Print expected output. + * tests/mq.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove mq.expected. + * tests/mq.test: Use run_strace_match_diff. + +2017-02-09 Dmitry V. Levin + + Simplify struct inject_opts.rval semantics. + Drop use of INJECT_OPTS_RVAL_DISABLE special inject_opts.rval value, + INJECT_OPTS_RVAL_DEFAULT is enough. + + * defs.h (INJECT_OPTS_RVAL_DISABLE): Remove. + * qualify.c (qualify_inject_common): Do not replace + INJECT_OPTS_RVAL_DEFAULT with INJECT_OPTS_RVAL_DISABLE + in inject_opts.rval. + * syscall.c (tamper_with_syscall_entering): Check + for INJECT_OPTS_RVAL_DEFAULT instead of INJECT_OPTS_RVAL_DISABLE. + +2017-02-09 Dmitry V. Levin + + tests: check signal injection along with fault injection. + * tests/qual_inject-error-signal.c: New file. + * tests/qual_inject-error-signal.expected: Likewise. + * tests/qual_inject-error-signal.test: New test. + * tests/.gitignore: Add qual_inject-error-signal. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add qual_inject-error-signal.test. + (EXTRA_DIST): Add qual_inject-error-signal.expected. + + tests: simplify qual_inject-signal.test. + * tests/qual_inject-signal.test: Use $NAME instead of qual_inject-signal. + +2017-02-09 Dmitry V. Levin + + Make symbolic errno values match case-insensitive. + Follow the example of case-insensitive symbolic signal values in signal + and inject expressions and make symbolic errno values in inject + expressions case-insensitive. + + * qualify.c (find_errno_by_name): Use strcasecmp instead of strcmp + to match symbolic errno values. + * tests/qual_fault.c (main): Likewise. + * tests/qual_fault.test: Test case-insensitive symbolic errno match. + +2017-02-09 Dmitry V. Levin + + tests: check case-insensitive symbolic signal match. + * tests/qual_signal.test: Test case-insensitive symbolic signal match. + +2017-02-09 Eugene Syromyatnikov + + Update NEWS. + +2017-02-08 Dmitry V. Levin + + Update NEWS. + +2017-02-08 Dmitry V. Levin + + strace.spec.in: fix dist version checks. + * strace.spec.in: Fix libunwind availability check. + + Reported-by: Eugene Syromyatnikov + +2017-02-08 Dmitry V. Levin + + tests: update ipc_sem.test for new glibc. + Starting with commit glibc-2.24-553-g40c0a78, glibc may pass NULL + address to semctl like other libcs. + + * tests/ipc_sem.c (main) [__GLIBC__]: Remove. + +2017-02-08 Dmitry V. Levin + + tests: fix typo in bpf.test. + * tests/bpf.c (main): Add missing semicolon. + + Fixes: ad427721 ("tests: rewrite bpf.test from match_grep to match_diff") + +2017-02-08 Dmitry V. Levin + + tests: check signal injection. + * tests/qual_inject-signal.c: New file. + * tests/qual_inject-signal.expected: Likewise. + * tests/qual_inject-signal.test: New test. + * tests/.gitignore: Add qual_inject-signal. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add qual_inject-signal.test. + (EXTRA_DIST): Add qual_inject-signal.expected. + +2017-02-08 Dmitry V. Levin + + Implement -e inject= option. + Introduce -e inject= as a general injection option, + limit -e fault= option to syscall fault injection. + + Change default return code of syscall fault injection to ENOSYS. + + * qualify.c (parse_inject_token): Add fault_tokens_only argument, + do not accept retval= and signal= tokens when fault_tokens_only + is set to true. + (parse_inject_expression): Add fault_tokens_only argument, + forward it to parse_inject_token. + (qualify_inject_common): New function. + (qualify_fault): Use it. + (qualify_inject): New function. + (qual_options): New entry. + * strace.1: Describe -e inject= option. + * NEWS: Mention -e inject= option. + * tests/qual_fault-syntax.test: Test that -e fault= option does not + support retval=, signal=, and multiple error= tokens. + * tests/qual_fault.c (DEFAULT_ERRNO): Set to ENOSYS unconditionally. + * tests/qual_inject-retval.test: Replace -e fault= option + with -e inject= option. + * tests/qual_inject-syntax.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + +2017-02-08 Dmitry V. Levin + + tests: prepare for introduction of -e inject= option. + Rename files related to fault injection to avoid further confusion. + + * tests/fault_injection-exit_group.expected: Rename + to tests/qual_fault-exit_group.expected. + * tests/fault_injection-exit_group.test: Rename + to tests/qual_fault-exit_group.test. + * tests/fault_syntax.test: Rename to tests/qual_fault-syntax.test. + * tests/fault_injection.c: Rename to tests/qual_fault.c. + * tests/fault_injection.test: Rename to tests/qual_fault.test. + * tests/fault_injection-retval.c: Rename to tests/qual_inject-retval.c. + * tests/fault_injection-retval.test: Rename + to tests/qual_inject-retval.test. + * tests/fault_injection.sh: Rename to tests/scno_tampering.sh. + * tests/.gitignore: Update. + * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS, + EXTRA_DIST): Update. + +2017-02-08 Dmitry V. Levin + + Prepare for introduction of -e inject= option. + As -e fault= injection syntax has been extended to configure various + kinds of injections besides fault injection, the original option name + bacame too narrow. + + This change renames internal constants, types, and functions from + "fault" to more generic inject/tamper ones. + + * defs.h (fault_opts): Rename to inject_opts. + (FAULT_OPTS_RVAL_DEFAULT): Rename to INJECT_OPTS_RVAL_DEFAULT. + (FAULT_OPTS_RVAL_DISABLE): Rename to INJECT_OPTS_RVAL_DISABLE. + (struct tcb): Rename fault_vec field to inject_vec. + (TCB_FAULT_INJ): Rename to TCB_TAMPERED. + (QUAL_FAULT): Rename to QUAL_INJECT. + (fault_vec): Rename to inject_vec. + All users changed. + * qualify.c (fault_set): Rename to inject_set. + (parse_fault_token): Rename to parse_inject_token. + (parse_fault_expression): Rename to parse_inject_expression. + All callers changed. + * syscall.c (fault_vec): Rename to inject_vec. + (tcb_fault_opts): Rename to tcb_inject_opts. + (inject_syscall_fault_entering): Rename to tamper_with_syscall_entering. + (update_syscall_fault_exiting): Rename to tamper_with_syscall_exiting. + (syscall_fault_injected): Rename to syscall_tampered. + All callers changed. + +2017-02-07 Dmitry V. Levin + + tests: make Makefile.am lists sorted in C locale. + * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS, + EXTRA_DIST): Make sorted in C locale. + +2017-02-07 Dmitry V. Levin + + tests: use ARG_STR in msg_control.test. + Drop local VAL_STR macro in favour of ARG_STR macro from tests/tests.h. + + * tests/msg_control.c (VAL_STR): Remove. + (test_sol_socket, test_sol_ip): Replace VAL_STR with ARG_STR. + +2017-02-07 Dmitry V. Levin + + powerpc, powerpc64: wire up new syscalls. + * linux/powerpc/syscallent.h [382]: Add kexec_file_load entry. + * linux/powerpc64/syscallent.h [382]: Likewise. + + microblaze: wire up new syscalls. + * linux/microblaze/syscallent.h [392..397]: New entries. + + avr32: wire up new syscalls. + * linux/avr32/syscallent.h [328..330]: New entries. + +2017-02-06 Dmitry V. Levin + + Update IPV6_* constants. + * xlat/sockipv6options.in: Add IPV6_RECVFRAGSIZE introduced + by linux kernel commit v4.10-rc1~202^2~340^2~1. + + Update IP_* constants. + * xlat/sockipoptions.in: Add IP_RECVFRAGSIZE introduced + by linux kernel commit v4.10-rc1~202^2~340^2~2. + +2017-02-06 Jacob Goense + + or1k: fix build. + This fixes a typo in the arch_set_success for the or1k architecture. + + * linux/or1k/set_error.c (arch_setsuccess): Rename to arch_set_success. + + Fixes: 41d647c ("Implement success injection") + Closes: https://github.com/strace/strace/pull/6 + +2017-02-04 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux 4.10. + * linux/32/ioctls_inc_align16.h: Update from linux v4.10 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 4.10. + * maint/ioctls_sym.sh: Update workaround for linux/if_pppox.h file. + + maint: add workaround for m68k. + * maint/ioctls_sym.sh: Skip asm/amigayle.h. + +2017-01-31 Dmitry V. Levin + + tests: check decoding of bpf corner cases. + * tests/bpf.c (bogus_bpf): New function. + (BOGUS_BPF): New macro. + (main): Use them. + * tests/bpf.test: Add -a option. + +2017-01-29 Dmitry V. Levin + + tests: rewrite bpf.test from match_grep to match_diff. + * tests/bpf.c (errstr): New variable. + (sys_bpf): New function. + (map_create, map_any, prog_load, obj_manage, prog_cgroup): Use it. + (main): Update expected output. + * tests/bpf.test: Use run_strace_match_diff. + + bpf: move common code to a separate function. + * bpf.c (bpf_prog_attach_detach): New function. + (bpf_prog_attach, bpf_prog_detach): Use it. + +2017-01-29 Quentin Monnet + + Update bpf syscall decoding. + Implement decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH, + and BPF_PROG_DETACH commands. + + * bpf.c: Include "xlat/bpf_attach_type.h". + (bpf_obj_manage, bpf_prog_attach, bpf_prog_detach): New functions. + (SYS_FUNC(bpf)): Use them. + * configure.ac: Check for union bpf_attr.bpf_fd and union + bpf_attr.attach_type. + * xlat/bpf_attach_type.in: New file. + * xlat/bpf_commands.in: Update list of BPF_* command constants. + * xlat/bpf_map_types.in: Update list of BPF_MAP_TYPE_* constants. + * xlat/bpf_prog_types.in: Update list of BPF_PROG_TYPE_* constants. + * tests/bpf.c [HAVE_UNION_BPF_ATTR_BPF_FD] (obj_manage): New function. + [HAVE_UNION_BPF_ATTR_ATTACH_TYPE] (prog_cgroup): Likewise. + (main): Use them. + +2017-01-28 Elvira Khabirova + + tests: check success injection. + * tests/fault_injection-retval.c: New file. + * tests/fault_injection-retval.test: New test. + * tests/.gitignore: Add fault_injection-retval. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add fault_injection-retval.test. + +2017-01-28 Elvira Khabirova + + Implement success injection. + This extends fault injection syntax with :retval= option. + When :retval=VALUE is specified, the syscall number is replaced by -1 + and a bogus success VALUE is returned to the callee. + + * defs.h (fault_opts): Remove err field, add rval field. + (MAX_ERRNO_VALUE, FAULT_OPTS_RVAL_DEFAULT, FAULT_OPTS_RVAL_DISABLE): + New macros. + * qualify.c (parse_fault_token): Handle retval= token. + (qualify_fault): Update fault_opts initialization after the move + from struct fault_opts.err to struct fault_opts.rval. + * syscall.c (arch_set_success): New prototype. + (inject_syscall_fault_entering): Check opts->rval instead of opts->err. + (update_syscall_fault_exiting): Implement retval injection. + * strace.1: Update the section on fault injection. + * NEWS: Mention retval= option. + * linux/aarch64/set_error.c (arch_set_success): New function. + * linux/alpha/set_error.c: Likewise. + * linux/arc/set_error.c: Likewise. + * linux/arm/set_error.c: Likewise. + * linux/avr32/set_error.c: Likewise. + * linux/bfin/set_error.c: Likewise. + * linux/crisv10/set_error.c: Likewise. + * linux/hppa/set_error.c: Likewise. + * linux/i386/set_error.c: Likewise. + * linux/ia64/set_error.c: Likewise. + * linux/m68k/set_error.c: Likewise. + * linux/metag/set_error.c: Likewise. + * linux/microblaze/set_error.c: Likewise. + * linux/mips/set_error.c: Likewise. + * linux/nios2/set_error.c: Likewise. + * linux/or1k/set_error.c: Likewise. + * linux/powerpc/set_error.c: Likewise. + * linux/riscv/set_error.c: Likewise. + * linux/s390/set_error.c: Likewise. + * linux/sh/set_error.c: Likewise. + * linux/sh64/set_error.c: Likewise. + * linux/sparc/set_error.c: Likewise. + * linux/sparc64/set_error.c: Likewise. + * linux/tile/set_error.c: Likewise. + * linux/x86_64/set_error.c: Likewise. + * linux/xtensa/set_error.c: Likewise. + + Closes: https://github.com/strace/strace/issues/3 + +2017-01-26 Dmitry V. Levin + + mips: rewrite configure check without sgidefs.h. + Use builtin macros provided by gcc >= 3.4 instead of sgidefs.h macros. + + * configure.ac : Do not include , use _ABIO32 + instead of _MIPS_SIM_ABI32, _ABIN32 instead of _MIPS_SIM_NABI32, + and _ABI64 instead of _MIPS_SIM_ABI64. + +2017-01-20 Elvira Khabirova + + .gitignore: add missing files that should be ignored. + * .gitignore: Add /ioctl_iocdef.[ih]. + + Fixes: 5679fad ("ioctlsort: get ioctl definitions from host, not build") + +2017-01-20 Andre McCurdy + + mips: use + Build fix for MIPS with musl libc. + + The MIPS specific header is provided by glibc and uclibc + but not by musl. Regardless of the libc, the kernel headers provide + which provides the same definitions, so use that + instead. + + * configure.ac: Replace with . + +2017-01-20 JingPiao Chen + + Implement decoding of ustat syscall. + * configure.ac (AC_CHECK_HEADERS): Add ustat.h. + * ustat.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h: Remove sys_ustat. + * tests/ustat.c: New file. + * tests/ustat.test: New test. + * tests/.gitignore: Add ustat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ustat.test. + + Makefile.am: allow indented DEF_MPERS_TYPE includes. + * Makefile.am (m%_type_defs.h): Change sed regular expression to allow + arbitrary number of whitespace characters between "#" symbol + and "include" directive. + + strace.1: fix formatting. + * strace.1: Remove misplaced .TP macros. + +2017-01-13 Dmitry V. Levin + + tests: drop non-USE_ASM_STAT case support. + With the switch of fstatat family tests to USE_ASM_STAT variant, + there are no non-USE_ASM_STAT users left. Remove support of unused + non-USE_ASM_STAT case. + + * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_mtim.tv_nsec. + * tests/fstatat.c (USE_ASM_STAT): Remove. + * tests/fstatx.c: Likewise. + * tests/lstatx.c: Likewise. + * tests/xstatx.c: Assume USE_ASM_STAT. + [!USE_ASM_STAT]: Remove. + +2017-01-13 Dmitry V. Levin + + tests: call newfstatat and fstatat64 syscalls directly. + Do not use glibc wrappers to call newfstatat and fstatat64. + These wrappers have various problems, e.g. they segfault on sparc64 + and mips64 if BOGUS_STRUCT_STAT is not disabled, and they do wrong + conversion of timestamps on mips64. + + * tests/fstatat.c (TEST_SYSCALL_INVOKE): Invoke the relevant syscall + directly. + (USE_ASM_STAT): Define. + * tests/fstatat64.c (TEST_BOGUS_STRUCT_STAT): Remove. + (STRUCT_STAT, STRUCT_STAT_STR, STRUCT_STAT_IS_STAT64): Define. + + Based on patch by James Cowgill . + +2017-01-13 Dmitry V. Levin + + tests: remove redundant SAMPLE_SIZE definitions. + Remove all definitions of SAMPLE_SIZE that are identical to the fallback + definition in tests/xstatx.c. + + * tests/fstat64.c (SAMPLE_SIZE): Remove. + * tests/lstat64.c (SAMPLE_SIZE): Remove. + * tests/stat64.c (SAMPLE_SIZE): Remove. + +2017-01-13 Dmitry V. Levin + + tests: change SAMPLE_SIZE type to libc_off_t. + As ftruncate libc function and our create_sample function that calls + ftruncate both take size argument of type libc_off_t, change the type + of SAMPLE_SIZE constant to libc_off_t. + + * tests/fstat.c (SAMPLE_SIZE): Cast to libc_off_t. + * tests/lstat.c (SAMPLE_SIZE): Likewise. + * tests/oldfstat.c (SAMPLE_SIZE): Likewise. + * tests/oldlstat.c (SAMPLE_SIZE): Likewise. + * tests/oldstat.c (SAMPLE_SIZE): Likewise. + * tests/stat.c (SAMPLE_SIZE): Likewise. + * tests/xstatx.c (SAMPLE_SIZE): Likewise. + +2017-01-13 Alexey Neyman + + ioctlsort: get ioctl definitions from host, not build. + When cross-compiling, ioctlsort must obtain _IOC_* values from the + host, build's values may be incompatible. + + * ioctl_iocdef.c: New file. + * Makefile.am (EXTRA_DIST): Add it. + (ioctl_iocdef.i, ioctl_iocdef.h): New rules. + (ioctlsort%.o): Depend on ioctl_iocdef.h. + (CLEANFILES): Add ioctl_iocdef.h and ioctl_iocdef.i. + * ioctlsort.c: Include "ioctl_iocdef.h" instead of . + +2017-01-13 Dmitry V. Levin + + tests: treat struct stat mismatch as an error. + If the test detects struct stat mismatch, this is likely an error + in definitions of a stat structure that might affect strace as well. + Fail the test instead of skipping it to attract more attention. + + * tests/xstatx.c (main): Return 1 instead of 77 + in case of struct stat mismatch. + +2017-01-12 Dmitry V. Levin + + tests: rewrite diagnostics about struct stat mismatch. + * tests/xstatx.c (LOG_STAT_OFFSETOF_SIZEOF): New macro. + (main): Use it to print struct stat mismatch details. + + tests: fix typo in tests/xstatx.c. + * tests/xstatx.c [!IS_FSTAT]: Define IS_FSTAT instead of IS_STAT. + +2017-01-12 JingPiao Chen + + tests: fix typo in mlock.c. + * tests/mlock.c [!(__NR_mlock && __NR_munlock)]: Fix spelling + of SKIP_MAIN_UNDEFINED. + +2017-01-12 JingPiao Chen + + strace: move description of -k option to the appropriate place. + Follow the example of strace.1 and put the description of -k option + into the output format group. + + * strace.c (usage): Move description of -k option to the output + format group. + +2017-01-11 Dmitry V. Levin + + Remove redundant commas at the end of structure initializers. + Automatically remove redundant commas using the following + sed expression: + + git grep -El ',[[:space:]]+}' |xargs sed -ri 's/,([[:space:]]+\})/\1/' + + * linux/32/syscallent.h: Remove redundant commas at the end of structure + initializers. + * linux/64/syscallent.h: Likewise. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/microblaze/userent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * tests/kexec_file_load.c: Likewise. + + Reported-by: Eugene Syromyatnikov + +2017-01-10 Dmitry V. Levin + + tests: check decoding of scsi ioctl commands. + * tests/ioctl_scsi.c: New file. + * tests/ioctl_scsi.test: New test. + * tests/.gitignore: Add ioctl_scsi. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_scsi.test. + + scsi: implement decoding of all SG_* ioctl commands. + * print_sg_req_info.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/sg_scsi_reset.in: New file. + * scsi.c: Include "xlat/sg_scsi_reset.h". + (scsi_ioctl): Implement decoding of all SG_* ioctl commands. + + scsi: prepare for decoding of other SG_* ioctl commands. + * scsi.c (scsi_ioctl): Introduce a switch statement. + + tests: check decoding of ioctl SG_IO v3 commands. + * tests/ioctl_sg_io_v3.c: New file. + * tests/ioctl_sg_io_v3.test: New test. + * tests/.gitignore: Add ioctl_sg_io_v3. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_sg_io_v3.test. + + tests: check decoding of ioctl SG_IO v4 commands. + * tests/ioctl_sg_io_v4.c: New file. + * tests/ioctl_sg_io_v4.test: New test. + * tests/.gitignore: Add ioctl_sg_io_v4. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_sg_io_v4.test. + +2017-01-10 Dmitry V. Levin + + scsi: add fallback definitions for SG_* ioctl command constants. + Unfortunately, from libc does not provide all constants + recognized by the kernel. + + * xlat/scsi_sg_commands.in: New file. + * scsi.c: Include "xlat/scsi_sg_commands.h" instead of providing + a fallback definition of SG_IO. + +2017-01-10 Dmitry V. Levin + + xlat: provide fallback definitions for BSG_FLAG_* constants. + BSG_FLAG_* constants were introduced later than the header file where + they are defined. + + * xlat/bsg_flags.in: Add default values for constants. + +2017-01-10 Dmitry V. Levin + + xlat: provide fallback definitions for SG_FLAG_* constants. + Unfortunately, from libc does not provide all constants + recognized by the kernel. + + * xlat/sg_io_flags.in: Add default values for constants. + +2017-01-10 Dmitry V. Levin + + sg_io_v4: print din_resid and dout_resid fields as signed integers. + * sg_io_v4.c (decode_response): Print din_resid and dout_resid fields + using %d format. + +2017-01-10 Dmitry V. Levin + + sg_io: cleanup printing of sg_io buffers. + Turn print_sg_io_buffer into a universal sg_io buffer printer. + + * sg_io_v3.c (print_sg_io_buffer): Add iovec_count argument. + Call tprint_iov_upto when iovec_count is non-zero. + (decode_request, decode_response): Do not call tprint_iov_upto directly, + use print_sg_io_buffer instead. + * sg_io_v4.c: Likewise. + +2017-01-10 Dmitry V. Levin + + sg_io: decode structures on exiting syscall in case of syserror. + The SCSI driver, starting with kernel commit v2.6.25-rc1~1230^2~78, + translates its "struct request.errors" to ioctl errors after + filling in all the output members of the SG_IO header structure. + + As there is no easy way to tell SCSI layer errors from other syscall + errors, decode the structure on exiting syscall in case of syserror, + too. + + * scsi.c (scsi_ioctl): Do not call set_tcb_priv_ulong, use + get_tcb_priv_data instead of get_tcb_priv_ulong, call decode_sg_io + unconditionally. + * sg_io_v3.c (decode_request): Save a copy of struct_sg_io_hdr using + set_tcb_priv_data. + (decode_response): Restore it using get_tcb_priv_data. Print its i/o + fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto + unconditionally. + * sg_io_v4.c (decode_request): Save a copy of struct sg_io_v4 using + set_tcb_priv_data. + (decode_response): Restore it using get_tcb_priv_data. Print its i/o + fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto + unconditionally. + +2017-01-08 Dmitry V. Levin + + sg_io: reorder printing of fields to follow structure order. + * sg_io_v4.c (decode_request): Print timeout, flags, and usr_ptr fields + after dout_xferp field. + + sg_io_v3: print sg_io_hdr.duration field as unsigned integer. + * sg_io_v3.c (decode_response): Print duration field using %u format. + + sg_io_v3: print msg_status field. + * sg_io_v3.c (decode_response): Print msg_status field. + + sg_io: print names of array fields and corresponding length fields. + * sg_io_v3.c (decode_request): Print names of cmd_len, cmdp, + and dxferp fields. + (decode_response): Print names of dxferp, sb_len_wr, and sbp fields. + * sg_io_v4.c (decode_request): Print names of request_len, request, + dout_xfer_len, and dout_xferp fields. + (decode_response): Print names of response_len, response, + and din_xferp fields. + +2017-01-08 Dmitry V. Levin + + sg_io_v3: print status fields using %#x format specifier. + The formerly used format string %02x led to misleading output as there + was no clear indication sometimes whether the printed integer was + decimal or hexadecimal. + + * sg_io_v3.c (decode_response): Print status and masked_status fields + using %#x format specifier instead of %02x. + +2017-01-08 Dmitry V. Levin + + sg_io_v4: print status fields in a hexadecimal form. + The tradition is to print scsi status codes in a hexadecimal form. + + * sg_io_v4.c (decode_response): Print driver_status, transport_status, + and device_status fields using %#x format specifier instead of %u. + +2017-01-08 Dmitry V. Levin + + sg_io_v4: print request_tag and generated_tag fields in hex. + The tradition is to print scsi tags in a hexadecimal form. + + * sg_io_v4.c (decode_request): Print request_tag field + using ("%#" PRI__x64) format string. + (decode_response): Print generated_tag field using ("%#" PRI__x64) + format string. + +2017-01-08 Dmitry V. Levin + + sg_io_v4: print usr_ptr field in a hexadecimal form. + As the nature of this field is pointer-like, print it + in a hexadecimal form. + + * sg_io_v4.c (decode_request): Print usr_ptr field + using ("%#" PRI__x64) format string. + +2017-01-08 Dmitry V. Levin + + sg_io_v4: do not print spare_in and spare_out fields. + As the kernel does not touch these fields, there is no use + to print them. + + * sg_io_v4.c (decode_request): Do not print spare_in field. + (decode_response): Do not print spare_out field. + +2017-01-08 Dmitry V. Levin + + sg_io: decode struct sg_io_hdr.info and struct sg_io_v4.info. + Print struct sg_io_hdr.info and struct sg_io_v4.info using printflags. + + * xlat/sg_io_info.in: New file. + * defs.h (sg_io_info): New xlat prototype. + * sg_io_v3.c: Include "xlat/sg_io_info.h". + (decode_response): Print struct_sg_io_hdr.info using printflags. + * sg_io_v4.c: (decode_response): Print struct sg_io_v4.info + using printflags. + +2017-01-08 Dmitry V. Levin + + sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags. + Print struct sg_io_hdr.flags and struct sg_io_v4.flags using printflags. + + * xlat/sg_io_flags.in: New file. + * sg_io_v3.c: Include "xlat/sg_io_flags.h". + (decode_request): Print struct_sg_io_hdr.flags using printflags. + * xlat/bsg_flags.in: New file. + * sg_io_v4.c: Include "xlat/bsg_flags.h". + (decode_request): Print struct sg_io_v4.flags using printflags. + +2017-01-08 Dmitry V. Levin + + Mpersify struct sg_io_hdr. + struct sg_io_hdr contains pointers and therefore has to be mpersified. + + * defs.h (decode_sg_io_v3): Remove prototype. + * sg_io_v3.c (struct_sg_io_hdr): Typedef to struct sg_io_hdr. + Mpersify it. + (decode_sg_io_v3): Wrap into MPERS_PRINTER_DECL. + +2017-01-08 Dmitry V. Levin + + Split scsi.c. + Move decoders of SG_IO v3 and v4 APIs into separate files, + compile generic SG_IO decoder unconditionally. + + * sg_io_v3.c: New file. + * sg_io_v4.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * defs.h (decode_sg_io_v3, decode_sg_io_v4): New prototypes. + * ioctl.c (ioctl_decode): Remove [HAVE_SCSI_SG_H] condition. + * scsi.c: (print_sg_io_res): Remove. + (print_sg_io_req): Rename to decode_sg_io, replace print_sg_io_v3_req + with decode_sg_io_v3, replace print_sg_io_v4_req with decode_sg_io_v4, + compile uncoditionally. + (scsi_ioctl): Replace print_sg_io_req and print_sg_io_res + with decode_sg_io, compile uncoditionally. + Move [HAVE_SCSI_SG_H] code to sg_io_v3.c. + Move [HAVE_LINUX_BSG_H] code to sg_io_v4.c. + +2017-01-07 Dmitry V. Levin + + scsi: detect and print changes of interface id. + * scsi.c (print_sg_io_v3_res): Detect and print changes + of struct sg_io_hdr.interface_id field between entering and exiting + syscall. + (print_sg_io_v4_res): Detect and print changes of struct sg_io_v4.guard + field between entering and exiting syscall. + + scsi: print field names of all fields being printed. + * scsi.c (print_sg_io_v3_req): Always print the name + of struct sg_io_hdr.interface_id field. + (print_sg_io_v4_req): Always print the name of struct sg_io_v4.guard + field. + (print_sg_io_req): Print unknown interface id as an integer. + (scsi_ioctl): Save interface id on entering syscall and use it + on exiting syscall. + + scsi: print struct sg_io_hdr.dxfer_direction field name. + * scsi.c (print_sg_io_v3_req): Print struct sg_io_hdr.dxfer_direction + field name. + + scsi: print "protocol" and "subprotocol" field names of struct sg_io_v4. + * scsi.c (print_sg_io_v4_req): Print field names + of struct sg_io_v4.protocol and struct sg_io_v4.subprotocol. + +2017-01-07 Dmitry V. Levin + + Print hexadecimal integer in error diagnostics using %#x. + The formerly used format string %x led to misleading output as there was + no clear indication sometimes whether the printed integer was decimal or + hexadecimal. + + * aio.c (startup_child, test_ptrace_seize): Print status + using %#x format specifier instead of %x. + +2017-01-07 Dmitry V. Levin + + aio: print hexadecimal integer using %#x. + The formerly used format string %x led to misleading output as there was + no clear indication sometimes whether the printed integer was decimal or + hexadecimal. + + * aio.c (print_common_flags): Print struct iocb.aio_flags using %#x + format specifier instead of %x. + * tests/aio.c (main): Likewise. + +2017-01-06 Dmitry V. Levin + + scsi: rewrite print_sg_io_buffer using printstr_ex(QUOTE_FORCE_HEX) + As printstr_ex has got QUOTE_FORCE_HEX flag support, there is no need + to implement it manually any longer. + + * scsi.c (print_uchar): Remove. + (print_sg_io_buffer): Rewrite using printstr_ex(QUOTE_FORCE_HEX). + +2017-01-06 Eugene Syromyatnikov + + getrandom: print string as hex-escaped. + Since there is no reason to interpret the value returned by getrandom as + ASCII string, it makes sense to always print it as a hex-escaped string. + + * getrandom.c (SYS_FUNC(getrandom)): Use printstr_ex instead + of printstrn, set QUOTE_FORCE_HEX in user_style parameter in order + to force hex-escaped string formatting. + * tests/getrandom.test: Remove no longer needed -xx flag as the string + is always printed in hexadecimal format now. + + Suggested-by: JingPiao Chen + +2017-01-06 Eugene Syromyatnikov + + util: add support for forcing printing string as hex-escaped. + This could be useful in cases when some binary data should not be + interpreted as an ASCII string, but rather as an array of byte values. + + * defs.h (QUOTE_FORCE_HEX): New macro constant. + * util.c (quote_string): Enable use_hex when QUOTE_FORCE_HEX is set + in user_style parameter. + +2017-01-06 Eugene Syromyatnikov + + term: do not abort decoding in case of non-verbose output. + The case of unset verbose is handled by umoven_or_printaddr, moreover, + exiting at this point is plain wrong and leads to last argument not + being printed while it should be. + + * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, + decode_modem_flags): Do not check verbose flags explicitly and do not + exit early if it is not set. + +2017-01-05 Dmitry V. Levin + + tests: skip fault injection tests on hppa if the kernel is too old. + * tests/fault_injection.sh: Add the minimal kernel version for hppa. + +2017-01-05 Dmitry V. Levin + + tests: skip readahead.test on MIPS n64 when built with glibc < 2.25. + Due to a bug in glibc readahead syscall wrapper on MIPS n64, + this wrapper cannot be used in readahead.test. + + * tests/readahead.c [HAVE_READAHEAD && LINUX_MIPSN64 && glibc < 2.25]: + Undefine HAVE_READAHEAD. + + Reported-by: James Cowgill + +2017-01-05 Dmitry V. Levin + + tests: replace init_magic with fill_memory. + Use the same fill_memory/fill_memory_ex interface in all affected tests. + + * tests/ioctl_block.c (init_magic): Remove. + (main): Replace init_magic with fill_memory. + * tests/ioctl_evdev.c: Likewise. + * tests/ioctl_v4l2.c: Likewise. + * tests/ioctl_mtd.c (magic, init_magic): Remove. + (main): Replace init_magic with fill_memory. + * tests/ioctl_rtc.c: Likewise. + +2017-01-05 Dmitry V. Levin + + tests: rewrite ioctl_v4l2 test without reliance on init_magic. + * tests/ioctl_v4l2.c (cc0, cc1, cc2, cc3, fourcc): New macros. + (main): Use them. Rewrite expected output without assumptions + on any particular magic data. + +2017-01-04 Dmitry V. Levin + + tests: remove redundant casts in fill_memory{,_ex} invocations. + * tests/ioctl_loop.c (main): Remove redundant casts of fill_memory + first argument. + * tests/kexec_load.c (main): Likewise. + * tests/perf_event_open.c (main): Likewise. + * tests/quotactl.c (main): Likewise. + * tests/mq_sendrecv.c (main): Remove redundant casts of fill_memory_ex + first argument. + * tests/quotactl-xfs.c (main): Likewise. + +2017-01-04 Dmitry V. Levin + + tests: change the type of fill_memory{,_ex} first argument to void * + As these functions behave like memset, it's more convenient to have + the first argument of type void * like memset. + + * tests/fill_memory.c (fill_memory, fill_memory_ex): Change the type + of first argument from "char *" to "void *". + * tests/tests.h (fill_memory, fill_memory_ex): Likewise. + +2017-01-04 Eugene Syromyatnikov + + tests: check non-verbose decoding of LOOP_* ioctls. + * tests/ioctl_loop-nv.c: New file. + * tests/ioctl_loop-nv.test: New test. + * tests/ioctl_loop.c [!ABBREV] (ABBREV): Define to 0. + (print_loop_info, print_loop_info64): Handle [ABBREV != 0] case. + * tests/.gitignore: Add ioctl_loop-nv. + * tests/Makefile.am (check_PROGRAMS): Likewise. + + tests: add more checks of LOOP_* ioctls decoding. + * tests/ioctl_loop.c: Include . + (magic, lmagic): Move static constants ... + (main): ... here. Change types of magic constants to kernel_ulong_t. + Add more checks. + +2017-01-04 JingPiao Chen + Eugene Syromyatnikov + + tests: check decoding of LOOP_* ioctls. + * tests/ioctl_loop.c: New file. + * tests/ioctl_loop-v.c: Likewise. + * tests/ioctl_loop.test: New test. + * tests/ioctl_loop-v.test: Likewise. + * tests/.gitignore: Add ioctl_loop and ioctl_loop-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_loop.test and ioctl_loop-v.test. + +2017-01-04 Dmitry V. Levin + + Drop vsprintf.c. + Drop custom vfprintf implementation that was disabled by default. + Apparently nobody tests strace with this vfprintf enabled, otherwise + multiple uses of format specifiers not supported by this custom vfprintf + would not left unnoticed. + + The GNU C library is not the only libc available, so those who want + faster implementations of libc functions are encouraged to try building + strace with other libc implementations. + + * vsprintf.c: Remove. + * Makefile.am (strace_SOURCES): Remove vsprintf.c. + * defs.h (USE_CUSTOM_PRINTF, strace_vfprintf): Remove. + * strace.c (tprintf): Replace strace_vfprintf with vfprintf. + +2017-01-04 Eugene Syromyatnikov + + loop: remove unnecessary verbose check. + The verbose flag is responsible for dereferencing of addresses, and it + is perfectly handled by umove_or_printaddr; moreover, this early exit + leads to incorrect formatting of last argument. + + * loop.c (loop_ioctl): Do not check verbose flag explicitly and do not + exit early if it is not set. + +2017-01-04 Eugene Syromyatnikov + + loop: fix lo_encrypt_key field output. + lo_encrypt_key is a sized string with its size specified by + lo_encrypt_key_size field, so take lo_encrypt_key_size into account. + + * loop.c (decode_loop_info, decode_loop_info64): Use minimum of + LO_KEY_SIZE and lo_encrypt_key_size field value as lo_encrypt_key size. + +2017-01-04 Eugene Syromyatnikov + + loop: print lo_encrypt_key_size field of struct loop_info as unsigned. + It is converted to an unsigned value in kernel (see loop_info64_from_old + in drivers/block/loop.c), so let's print it that way despite its type. + + * loop.c (decode_loop_info): Print lo_encrypt_key_size as an uint32_t + value. + +2017-01-04 Eugene Syromyatnikov + + tests: add more checks of unknown ioctl command formatting. + * tests/ioctl.c (main): Additional check for unknown ioctl command + decoding. + * tests/ioctl_evdev.c (main): Likewise. + * tests/ioctl_dm.c: Include for _IOC_SIZE and _IOC_NR. + (main) : New constants. + Add more checks for unknown command formatting. + +2017-01-04 Eugene Syromyatnikov + + ioctl: do not print explicit 0x prefix and do not specify minimum width. + Specifying output width for size argument is rather misleading - it can + be up to 14 bits in size. The use of explicit "0x" prefix is + discouraged because 0x0 looks ugly. Usage of width specification along + with alternate form flag leads to inconsistent output for 0. + Let's use just plain %#x qualifiers instead. + + * ioctl.c (ioctl_print_code): Change printf qualifiers for ioctl command + type, number and size to "%#x". + * tests/ioctl.c (main): Update expected test output. + * tests/ioctl_dm.c (main): Likewise. + * tests/ioctl_evdev.c (main): Likewise. + +2017-01-04 Eugene Syromyatnikov + + loop: fix printing of the reserved field array items. + They are of char type, so "hh" length modifier should be used (otherwise + they are printed incorrectly as they are sign extended implicitly when + passed as printf arguments in case char is a signed type which is true + for most compilers). + + * loop.c (decode_loop_info): Change "%#x" printf qualifier to "%#hhx" + in printing routine for array elements of the "reserved" field of + loop_info structure. + +2017-01-04 Eugene Syromyatnikov + + tests: check ioctl(SIOCGIFCONF) decoding. + * tests/ioctl_sock_gifconf.c: New file. + * tests/ioctl_sock_gifconf.test: New test. + * tests/.gitignore: Add ioctl_sock_gifconf. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_sock_gifconf.test. + + dm.c: add copyright notice. + +2017-01-04 Dmitry V. Levin + + Add scno.h and syscallent.i to .gitignore files. + * .gitignore: Add /scno.h and /syscallent.i. + * tests/.gitignore: Add scno.h and syscallent.i. + +2017-01-04 JingPiao Chen + + tests/.gitignore: add generated files that should be ignored. + * tests/.gitignore: Replace addkey with add_key, add attach-f-p-cmd. + +2017-01-03 Dmitry V. Levin + + Remove checks of __NR_* availability from strace source code. + * strace.c: Remove __NR_tkill checks, assume it is always defined. + * util.c: Remove __NR_process_vm_readv checks and fallback definitions, + assume it is always defined. + + Include "scno.h" in files that check __NR_* constants. + * strace.c: Include "scno.h". + * util.c: Likewise. + + Generate scno.h for use during the build of strace itself. + * Makefile.am: Include scno.am. + ($(strace_OBJECTS)): New rule. + +2017-01-01 Dmitry V. Levin + + Generate scno.h without invoking a generated executable helper. + Generate scno.h using only those tools that are available for cross + build. This allows to use scno.h during the build of strace itself. + + * scno.am: New file. + * scno.head: New file. + * Makefile.am (EXTRA_DIST): Add it. + * tests/generate_scno.c: Remove. + * tests/.gitignore: Remove generate_scno. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (CLEANFILES): Remove scno.h. + (scno.h, $(scno_dependants)): Remove rules. + (scno_dependants): Remove. + ($(objects)): New rule. + Include ../scno.am. + +2017-01-01 Dmitry V. Levin + + Update all publicly shown copyright year number ranges. + * COPYING: Update copyright year number range. + * configure.ac: Likewise. + * strace.c: Likewise. + * tests/strace-V.test: Use the current year for the check. + +2016-12-31 Dmitry V. Levin + + defs.h: stop including + Limit the number of files where is included + to only those few that need it. + + * defs.h: Do not include . + * clone.c: Include . + * strace.c: Likewise. + * syscall.c: Likewise. + * util.c: Likewise. + +2016-12-30 Dmitry V. Levin + + tests: do not use BUILT_SOURCES. + * tests/Makefile.am (ksysent.$(OBJEXT)): New rule. + (BUILT_SOURCES): Remove. + +2016-12-30 Dmitry V. Levin + + Fix cross build. + This fixes cross build regression introduced by commit + v4.15-39-g605a705a63d533dceb3c2d489468fcd3aed3963c. + + * tests/Makefile.am (BUILT_SOURCES): Remove scno.h + (objects, scno_dependants): New variables. + ($(scno_dependants)): New rule. + + Reported-by: Joakim Bech + +2016-12-30 Dmitry V. Levin + + tests: do not use defs.h and syscall.h. + * tests/generate_scno.c: Include "tests.h", "sysent.h", , + , and instead of "defs.h" and "syscall.h". + * tests/ksysent.c: Likewise. + * tests/nsyscalls.c: Include "tests.h", "sysent.h", , + , and instead of "defs.h" and "syscall.h". + + Move definition of struct sysent and trace flags to a separate file. + * sysent.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h: Include it. + (struct sysent, TRACE_FILE, TRACE_IPC, TRACE_NETWORK, TRACE_PROCESS, + TRACE_SIGNAL, TRACE_DESC, TRACE_MEMORY, SYSCALL_NEVER_FAILS, + STACKTRACE_INVALIDATE_CACHE, STACKTRACE_CAPTURE_ON_ENTER, + TRACE_INDIRECT_SUBCALL, COMPAT_SYSCALL_TYPES): Remove. + +2016-12-29 Eugene Syromyatnikov + + Mpersify SIOC* ioctls. + struct ifreq and struct ifconf are ABI-dependent and should have been + mpersified. + + * defs.h (sock_ioctl): Remove prototype. + * sock.c (struct_ifconf, struct_ifreq): New typedefs. + (DEF_MPERS_TYPE(struct_ifconf), DEF_MPERS_TYPE(struct_ifreq), + MPERS_DEFS): New includes. + (print_ifreq, print_ifc_len, print_ifconf_ifreq): Replace struct ifreq + with struct_ifreq. + (decode_ifconf): Replace struct ifconf with struct_ifconf, struct ifreq + with struct_fireq. + (sock_ioctl): Wrap into MPERS_PRINTER_DECL. + +2016-12-29 Eugene Syromyatnikov + Dmitry V. Levin + + sock: rewrite decode_ifconf. + * sock.c (decode_ifconf): Rewrite. + +2016-12-29 Eugene Syromyatnikov + + xlat: update LOOP_* ioctl flags constants. + * configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_USE_AOPS + and LO_FLAGS_DIRECT_IO. + * xlat/loop_flags_options.in: Likewise. Add default values + for constants. + +2016-12-29 Eugene Syromyatnikov + + loop: add fallback definitions for LOOP_* ioctl command constants. + Since these are architecture-independent and have been added over the + kernel's lifetime, it makes sense to have these definitions in strace + itself. + + * xlat/loop_cmds.in: New file. + * loop.c: Include "xlat/loop_cmds.h". + (loop_ioctl): Eliminate conditional compilation based on availability + of LOOP_* constant definitions. + +2016-12-29 Dmitry V. Levin + + xlat: extend syntax. + * xlat/gen.sh: Implement #stop directive that stops preprocessor + at the line it has been encountered during the first pass. This could + be used, for example, to provide fallback definitions for constants + without defining xlat tables. + +2016-12-29 Eugene Syromyatnikov + Dmitry V. Levin + + loop: mpersify struct loop_info and loop_ioctl function. + struct loop_info contains fields of type long, so it definitely should + have been mpersified. + + * defs.h (loop_ioctl): Remove prototype. + * loop.c (struct_loop_info): New typedef. + Include DEF_MPERS_TYPE(struct_loop_info) and MPERS_DEFS. + (decode_loop_info): Replace struct loop_info with struct_loop_info. + Cast lo_inode, lo_init[0], and lo_init[1] to kernel_ulong_t and print + them using appropriate format specifiers. + (loop_ioctl): Wrap into MPERS_PRINTER_DECL. + +2016-12-29 Eugene Syromyatnikov + + loop: print lo_device and lo_rdevice fields using print_dev_t. + * loop.c (decode_loop_info, decode_loop_info64): Use print_dev_t + for printing lo_device and lo_rdevice fields. + +2016-12-29 Eugene Syromyatnikov + Dmitry V. Levin + + Move device number printing code into a separate routine. + * print_dev_t.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (print_dev_t): New prototype. + * dm.c: Do not include . + (dm_decode_device, dm_print_dev, dm_decode_dm_name_list): Use + print_dev_t function for printing device numbers. + * mknod.c: Do not include . + (decode_mknod): Use print_dev_t function for printing device number. + * print_struct_stat.c: Do not include . + (print_struct_stat): Use print_dev_t function for printing device + numbers. + +2016-12-28 Dmitry V. Levin + + tests: enhance invalid address decoding check in seccomp-strict.test. + * tests/seccomp-strict.c (main): Change the type of addr variable + containg the invalid address from unsigned long to kernel_ulong_t, + print it using %#llx format. + +2016-12-28 Eugene Syromyatnikov + + tests: check decoding of prctl PR_GET_TID_ADDRESS operation. + * tests/prctl-tid_address.c: New file. + * tests/prctl-tid_address.test: New test. + * tests/.gitignore: Add prctl-tid_address. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-tid_address.test. + +2016-12-28 Dmitry V. Levin + + Update the publicly shown copyright information. + Set the publicly shown copyright holder to "The strace developers.". + + * COPYING: Update copyright information. + * configure.ac: Add AC_COPYRIGHT. + * strace.c (print_version): New function. + (init): Use it. + * tests/strace-V.test: Update expected output. + +2016-12-28 Dmitry V. Levin + + configure: specify project URL. + * configure.ac (AC_INIT): Add URL. + +2016-12-28 Seraphime Kirkovski + + Document signal injection. + * strace.1: Describe :signal=SIG option of the fault injection syntax. + * NEWS: Mention signal injection. + +2016-12-28 Seraphime Kirkovski + + Implement signal injection. + This extends the fault injection capability with :signal=SIG option + which injects a signal on entering each syscall from the specified set. + + :signal and :error options are complementary, if they are both specified + the syscall will be fault injected as usual and the specified signal + will be delivered to the tracee. + + * defs.h (struct fault_opts): Change the type of err field to int16_t, + add signo field. + (trace_syscall): Add a pointer argument. + * qualify.c: Include "nsig.h". + (parse_fault_token): Handle signal= option. + (qualify_fault): Update default fault_opts. + * strace.c (trace): Forward signal number from trace_syscall + to ptrace_restart(PTRACE_SYSCALL). + * syscall.c (inject_syscall_fault_entering): Add pointer argument, + save there the signal number specified by fault options. Do not inject + a syscall fault unless instructed by fault options. + (update_syscall_fault_exiting): Update the error code injection check. + (trace_syscall_entering): Add pointer argument, forward it to + inject_syscall_fault_entering. + (trace_syscall): Add pointer argument, forward it to + trace_syscall_entering. + +2016-12-28 Dmitry V. Levin + + Update README.md. + * README.md: Update homepage URL, mention command-line interface + and tampering capabilities in the description. + +2016-12-28 Dmitry V. Levin + + tests: robustify prctl-arg2-intptr.test. + Robustify prctl-arg2-intptr.test against unrelated prctl invocations. + + * tests/prctl-arg2-intptr.test: Filter out unrelated PR_GET_* + and PR_SET_* prctl calls. + +2016-12-27 Dmitry V. Levin + + signal: remove redundant checks around NSIG. + * signal.c (struct old_sigaction, struct new_sigaction, + struct new_sigaction32): Remove safety checks for NSIG >= sizeof(long). + + Introduce NSIG_BYTES. + * nsig.h (NSIG_BYTES): New macro. + * desc.c: Use it in comments instead of NSIG. + * epoll.c: Likewise. + * poll.c: Likewise. + * signalfd.c: Likewise. + * signal.c: Likewise. + (sprintsigmask_n, print_sigset_addr_len_limit): Use it instead of NSIG. + * linux/alpha/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise. + * tests/pselect6.c (main): Likewise. + + Move NSIG ifdefery to a separate header file. + * nsig.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * signal.c: Include "nsig.h" instead of , remove + NSIG workarounds. + * sigreturn.c: Likewise. + * syscall.c: Likewise. + * tests/pselect6.c: Likewise. + + Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro. + * defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): New macro. + (truncate_klong_to_current_wordsize, + truncate_kulong_to_current_wordsize): Use it. + * mem.c (SYS_FUNC(old_mmap)): Likewise. + * util.c (umoven, umovestr, dumpiov_upto): Likewise. + * syscall.c (trace_syscall_exiting): Likewise. + + Simplify personality checks in msghdr.c and signal.c. + * msghdr.c: Check for [!current_wordsize] instead + of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]. + * signal.c: Likewise. + +2016-12-26 Dmitry V. Levin + + Replace widen_to_long with truncate_klong_to_current_wordsize. + * defs.h (widen_to_long): Remove. + (truncate_klong_to_current_wordsize): New static inline function. + * aio.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents): Use it + instead of widen_to_long. + * linux/sparc64/get_syscall_args.c (get_syscall_args): Update comment. + * linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise. + + Replace widen_to_ulong with truncate_kulong_to_current_wordsize. + * defs.h (widen_to_ulong): Remove. + (truncate_kulong_to_current_wordsize): New static inline function. + * io.c (do_preadv, do_pwritev): Use it instead of widen_to_ulong. + +2016-12-26 Dmitry V. Levin + + Simplify print_lld_from_low_high_val ifdefery. + The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler + implementation. + + * io.c (print_lld_from_low_high_val): Merge [SIZEOF_LONG > 4 + && SIZEOF_LONG == SIZEOF_LONG_LONG] + and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases + into a single [SIZEOF_KERNEL_LONG_T > 4] case. + [SIZEOF_KERNEL_LONG_T == 4]: Use direct casts to long long + instead of zero_extend_signed_to_ull. + +2016-12-26 Dmitry V. Levin + + Simplify getllval ifdefery. + The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler + implementation. + + * util.c (getllval): Merge [SIZEOF_LONG > 4 + && SIZEOF_LONG == SIZEOF_LONG_LONG] + and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases + into a single [SIZEOF_KERNEL_LONG_T > 4] case. + +2016-12-26 Eugene Syromyatnikov + + prctl: print pointer returned by PR_GET_TID_ADDRESS as kernel long. + Since there is no compat handler for x32/n32, kernel returns kernel's + long as a result of the call. + + Interesting, does any callee out there actually care to have enough room + allocated for kernel long? + + * prctl.c (SYS_FUNC(prctl)): Use printnum_kptr instead of printnum_ptr + to print the value stored at address pointed by addr2 argument + of PR_GET_TID_ADDRESS operation. + +2016-12-26 Eugene Syromyatnikov + + Add functions for printing pointers of kernel_ulong_t size. + In cases where no compat for x32/n32 is implemented, pointer is of + kernel's long size, so it should be printed appropriately. + + * defs.h [!current_klongsize] (printnum_addr_klong_int): New prototype. + (printnum_kptr): New macro. + * util.c [!current_klongsize] (printnum_addr_klong_int): New function. + +2016-12-26 Eugene Syromyatnikov + Dmitry V. Levin + + Print indirect pointers as pointers. + Originally, printnum_long_int was used, but it prints NULL incorrectly. + + * defs.h (DECL_PRINTNUM_ADDR): New macro. + (DECL_PRINTNUM_ADDR(int), DECL_PRINTNUM_ADDR(int64)): New prototypes. + [!current_wordsize] (printnum_addr_long_int): New prototype. + [!current_wordsize] (printnum_ptr): Use it. + [current_wordsize > 4] (printnum_ptr): Use printnum_addr_int64. + [current_wordsize == 4] (printnum_ptr) Use printnum_addr_int. + * util.c (DEF_PRINTNUM_ADDR): New macro. + (DEF_PRINTNUM_ADDR(int, unsigned int), + DEF_PRINTNUM_ADDR(int64, uint64_t)): New macro instantiations that + provide printnum_addr_int and printnum_addr_int64, accordingly. + [!current_wordsize] (printnum_addr_long_int): New function. + * xet_robust_list.c (sprintaddr): New function. + (main): Use it, update expected output. + * tests/ipc_sem.c (main): Update expected output. + +2016-12-26 Eugene Syromyatnikov + + ipc_sem: print 4th argument of semctl syscall as an address. + * ipc_sem.c (SYS_FUNC(semctl)): Print 4th argument using printaddr. + * tests/ipc_sem.c (cleanup): Update expected output. + +2016-12-26 Dmitry V. Levin + + Do not define printnum_long_int on systems with constant current_wordsize + * defs.h: Check [!current_wordsize] instead + of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to select + definitions of printnum_slong, printnum_ulong, and printnum_ptr. + * util.c: Check [!current_wordsize] instead + of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to decide + whether to compile printnum_long_int. + +2016-12-26 Dmitry V. Levin + + umoven: detect invalid addresses. + Do not silently truncate tracee addresses to current_wordsize. + After transition from long to kernel_ulong_t there should be no sign + extension issues with tracee addresses, and invalid addresses should + be printed properly. + + * util.c (umoven): Check [SIZEOF_KERNEL_LONG_T > 4] instead + of [SIZEOF_LONG > 4], reject addresses that do not fit into + current_wordsize. + * tests/umoven-illptr.c: New file. + * tests/umoven-illptr.test: New test. + * tests/.gitignore: Add umoven-illptr. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add umoven-illptr.test. + +2016-12-26 Dmitry V. Levin + + umovestr: detect invalid addresses. + Do not silently truncate tracee addresses to current_wordsize. + After transition from long to kernel_ulong_t there should be no sign + extension issues with tracee addresses, and invalid addresses should + be printed properly. + + * util.c (umovestr): Check [SIZEOF_KERNEL_LONG_T > 4] instead + of [SIZEOF_LONG > 4], reject addresses that do not fit into + current_wordsize. + * tests/umovestr-illptr.c: New file. + * tests/umovestr-illptr.test: New test. + * tests/.gitignore: Add umovestr-illptr. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add umovestr-illptr.test. + +2016-12-26 Dmitry V. Levin + + lseek: simplify _llseek syscall decoder. + After transition from long to kernel_ulong_t the implementation + could be made a bit simpler. + + * lseek.c (SYS_FUNC(llseek)): Use direct cast to long long instead + of zero_extend_signed_to_ull. + +2016-12-26 Dmitry V. Levin + + lseek: merge two different implementations of lseek syscall decoder. + After transition from long to kernel_ulong_t there are no mo + complications that required to keep a separate implementation + for x32 and mips n32. + + * lseek.c (SYS_FUNC(lseek)): Merge two different implementations + into a single one. + +2016-12-26 Dmitry V. Levin + + Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval. + After transition from long to kernel_ulong_t these fields + are no longer needed. + + * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Remove. + (struct tcb) [HAVE_STRUCT_TCB_EXT_ARG]: Remove. + [HAVE_STRUCT_TCB_EXT_ARG]: Remove. + (RVAL_MASK): Update. + * io.c (print_lld_from_low_high_val): Check + [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] + instead of [HAVE_STRUCT_TCB_EXT_ARG]. + Use u_arg instead of ext_arg. + * linux/mips/get_error.c (get_error) [LINUX_MIPSN32]: Remove. + * linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSN32]: + Remove. + [LINUX_MIPSN64]: Extend to [LINUX_MIPSN32]. + * linux/x86_64/get_error.c (get_error) [X32]: Remove. + * linux/x86_64/get_syscall_args.c (get_syscall_args) [X32]: Remove. + * lseek.c: Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] + instead of [HAVE_STRUCT_TCB_EXT_ARG]. + [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] (SYS_FUNC(lseek)): Use u_arg + instead of ext_arg. Use RVAL_UDECIMAL instead of RVAL_LUDECIMAL. + * mem.c (SYS_FUNC(mmap)): Pass offset syscall argument directly + to print_mmap. + * syscall.c (trace_syscall_exiting) [HAVE_STRUCT_TCB_EXT_ARG]: Remove. + * times.c (SYS_FUNC(times)): Use RVAL_UDECIMAL instead + of RVAL_LUDECIMAL. + * util.c (getllval): Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] + instead of [HAVE_STRUCT_TCB_EXT_ARG]. Use u_arg instead of ext_arg. + +2016-12-26 Dmitry V. Levin + + Remove getarg_klu. + After transition from long to kernel_ulong_t we no longer need + tcp->ext_arg, and therefore a function to access it is also no longer + needed. + + * defs.h (getarg_klu): Remove prototype. + * util.c (getarg_klu): Remove. + (printargs): Access tcp->u_arg directly + * bjm.c (SYS_FUNC(init_module)): Likewise. + * clone.c (SYS_FUNC(unshare)): Likewise. + * fadvise.c (SYS_FUNC(fadvise64)): Likewise. + * kcmp.c (SYS_FUNC(kcmp)): Likewise. + * kexec.c (SYS_FUNC(kexec_file_load)): Likewise. + * keyctl.c (SYS_FUNC(keyctl)): Likewise. + * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise. + * mem.c (do_mprotect): Likewise. + * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise. + * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise. + * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): + Likewise. + +2016-12-26 Dmitry V. Levin + + Remove printaddr_klu. + After transition from long to kernel_ulong_t we no longer need + two versions of printaddr function. + + * defs.h (printaddr): Remove. + (printaddr_klu): Rename to printaddr. + * util.c (printaddr_klu): Likewise. + * bjm.c (SYS_FUNC(init_module)): Replace printaddr_klu with printaddr. + * mem.c (do_mprotect): Likewise. + +2016-12-26 Eugene Syromyatnikov + + tests: check decoding of a subset of prctl operations. + Check decoding of prctl operations that take the second syscall argument + as a pointer to an integer. + + * tests/prctl-arg2-intptr.c: New file. + * tests/prctl-arg2-intptr.test: New test. + * tests/.gitignore: Add prctl-arg2-intptr. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-arg2-intptr.test. + +2016-12-26 Dmitry V. Levin + + Automatically replace PRI_kr[dux] with PRI_kl[dux] + Remove temporary macros created for transition from long + to kernel_ulong_t. + + Automatically replace PRI_kr[dux] with PRI_kl[dux] using + $ git grep -l 'PRI_kr[dux]' | xargs sed -ri 's/PRI_kr([dux])/PRI_kl\1/g' + + * defs.h (PRI_krd, PRI_kru, PRI_krx): Remove. All users updated. + +2016-12-26 Dmitry V. Levin + + Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t. + Remove temporary types created for transition from long + to kernel_ulong_t. + + Automatically replace kernel_scno_t and kernel_ureg_t with + kernel_ulong_t using + $ git grep -El 'kernel_(scno|ureg)_t' | + xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g' + + * kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove. + All users updated. + +2016-12-26 Dmitry V. Levin + + Redirect kernel_ureg_t and kernel_scno_t from unsigned long to kernel_ulong_t + * defs.h (struct tcb): Change u_rval type from long to kernel_long_t. + (PRI_krd, PRI_kru, PRI_krx): Redirect to PRI_kld, PRI_klu, and PRI_klx. + * kernel_types.h (kernel_scno_t, kernel_ureg_t): Redirect + to kernel_ulong_t. + +2016-12-26 Dmitry V. Levin + + Print kernel_ureg_t and kernel_scno_t using dedicated format strings. + Prepare for the change of kernel_ureg_t and kernel_scno_t from + unsigned long to kernel_ulong_t. + + * defs.h (PRI_krd, PRI_kru, PRI_krx): New temporary macros. + All users updated. + +2016-12-26 Dmitry V. Levin + + vm_read_mem: detect address truncation. + When sizeof(kernel_ureg_t) > sizeof(long), the tracee address passed + to vm_read_mem could be silently truncated. Detect this situation + and return EIO when the tracee address does not fit into unsigned long. + + * util.c (vm_read_mem): Save raddr argument into a temporary variable + truncated_raddr of type unsigned long. Set errno to EIO and return -1 + when truncated_raddr does not equal to raddr. + +2016-12-26 Dmitry V. Levin + + trace_syscall_exiting: prepare personality check for u_rval type change. + * syscall.c (trace_syscall_exiting): Check for sizeof(tcp->u_rval) + instead of sizeof(long) when deciding how to print tcp->u_rval. + +2016-12-26 Dmitry V. Levin + + Use ptr_to_kulong instead of explicit casts of pointers to kernel_ureg_t + Direct casts to kernel_ureg_t will not work after the change + of kernel_ureg_t from unsigned long to kernel_ulong_t. + + * defs.h (ptr_to_kulong): New macro. + * block.c (print_blkpg_req): Use it instead of explicit casts + to kernel_ureg_t. + * btrfs.c (btrfs_ioctl): Likewise. + * evdev.c (ff_effect_ioctl): Likewise. + * mmsghdr.c (dumpiov_in_mmsghdr): Likewise. + * msghdr.c (print_struct_msghdr, dumpiov_in_msghdr): Likewise. + * mtd.c (decode_mtd_oob_buf): Likewise. + * printsiginfo.c (printsigval, print_si_info): Likewise. + * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Likewise. + * sigaltstack.c (print_stack_t): Likewise. + * sock.c (decode_ifconf): Likewise. + * sysctl.c (SYS_FUNC(sysctl)): Likewise. + * util.c (dumpiov_upto): Likewise. + * v4l2.c (print_v4l2_framebuffer, print_v4l2_ext_control, + print_v4l2_ext_controls): Likewise. + +2016-12-26 Dmitry V. Levin + + umove*: remove redundant casts. + * util.c (umoven, umovestr): Remove casts from unsigned long to pointer. + + upoke: remove redundant casts. + * upoke.c (upoke): Remove casts from unsigned long to pointer. + +2016-12-25 Dmitry V. Levin + + signal: cleanup decoding of sa_handler and sa_restorer. + Change type of sa_handler and sa_restorer fields from function pointers + to unsigned long. This saves the code from a lot of casts between + pointers and integers. + + Rename __sa_handler to sa_handler__ as names starting with underscore + symbol are reserved and should not be used. + + * signal.c (old_sigaction): Rename __sa_handler to sa_handler__, + all users updated. Change the type of sa_handler__ and sa_restorer + from pointer to unsigned long. + (old_sigaction32): Rename __sa_handler to sa_handler__, all users + updated. + (decode_old_sigaction): Remove now redundant casts from + old_sigaction32.sa_handler__ to old_sigaction.sa_handler__, + from old_sigaction32.sa_restorer to old_sigaction.sa_restorer, + and from old_sigaction.sa_handler__ to unsigned long. Print + old_sigaction.sa_restorer using printaddr. + * signal.c (new_sigaction): Rename __sa_handler to sa_handler__, + all users updated. Change the type of sa_handler__ and sa_restorer + from pointer to unsigned long. + (new_sigaction32): Rename __sa_handler to sa_handler__, all users + updated. + (decode_new_sigaction): Remove now redundant casts from + new_sigaction32.sa_handler__ to new_sigaction.sa_handler__, + from new_sigaction32.sa_restorer to new_sigaction.sa_restorer, + and from new_sigaction.sa_handler__ to unsigned long. Print + new_sigaction.sa_restorer using printaddr. + +2016-12-25 Dmitry V. Levin + + signal: change signal handler address type from unsigned long to kernel_ureg_t + * signal.c (get_sa_handler_str, print_sa_handler): Change handler type + from unsigned long to kernel_ureg_t. + + quota: change address argument type from unsigned long to kernel_ureg_t. + * quota.c (decode_cmd_data): Change the type of data argument + from unsigned long to kernel_ureg_t. + + execve: prepare for handling big pointers. + * execve.c (printargv): Change cp.p64 type from unsigned long + to kernel_ulong_t so it could handle wordsize > sizeof(long) properly. + +2016-12-25 Dmitry V. Levin + + clone: print clone flags without truncation. + The flags argument is defined in kernel as unsigned long, + so change its decoding to avoid truncation. + + * clone.c (SYS_FUNC(clone)): Change flags type from unsigned long + to kernel_ureg_t, print it using printflags64 instead of printflags. + +2016-12-25 Dmitry V. Levin + + Use printxval64 instead of printxval_long. + After the change of tcb.u_arg type from long to kernel_ureg_t it is safe + to stop using printxval_long proxy and pass syscall arguments directly + to printxval64. + + * defs.h (printxval_long): Remove. + * fcntl.c (print_fcntl): Replace printxval_long with printxval64. + * mtd.c (mtd_ioctl): Likewise. + * numa.c (SYS_FUNC(mbind)): Likewise. + * or1k_atomic.c [OR1K] (SYS_FUNC(or1k_atomic)): Likewise. + * sysmips.c [MIPS] (SYS_FUNC(sysmips)): Likewise. + * term.c (term_ioctl): Likewise. + +2016-12-25 Dmitry V. Levin + + Use printflags64 instead of printflags_long. + After the change of tcb.u_arg type from long to kernel_ureg_t it is safe + to stop using printflags_long proxy and pass syscall arguments directly + to printflags64. + + * defs.h (printflags_long): Remove. + * fcntl.c (print_fcntl): Replace printflags_long with printflags64. + * numa.c (SYS_FUNC(get_mempolicy)): Likewise. + * perf.c (SYS_FUNC(perf_event_open)): Likewise. + * sram_alloc.c [BFIN] (SYS_FUNC(sram_alloc)): Likewise. + +2016-12-25 Dmitry V. Levin + + upeek, upoke: change argument types from long to unsigned long. + * defs.h (upeek, upoke): Change offset argument type from long + to unsigned long. Change res argument type from long to kernel_ureg_t. + * upeek.c (upeek): Likewise. + * upoke.c (upoke.c): Likewise. + * syscall.c (print_pc) [ARCH_PC_PEEK_ADDR]: Change pc type from long + to kernel_ureg_t. + * linux/aarch64/arch_regs.c (arm_sp_ptr): Remove redundant cast. + * linux/metag/get_syscall_args.c (get_syscall_args): Likewise. + * linux/sh/get_syscall_result.c (get_syscall_result_regs): Likewise. + * linux/sh64/get_syscall_result.c (get_syscall_result_regs): Likewise. + * linux/powerpc/getregs_old.c (getregs_old): Remove redundant casts. + * linux/alpha/arch_getrval2.c (getrval2): Change r20 type from long + to unsigned long. + * linux/alpha/arch_regs.c (alpha_r0, alpha_a3): Change type from long + to unsigned long. + * linux/bfin/arch_regs.c (bfin_r0): Likewise. + * linux/crisv10/arch_regs.c (cris_r10): Likewise. + * linux/hppa/arch_regs.c (hppa_r28): Likewise. + * linux/ia64/arch_regs.c (IA64_PSR_IS): Likewise. + * linux/microblaze/arch_regs.c (microblaze_r3): Likewise. + * linux/sh/arch_regs.c (sh_r0): Likewise. + * linux/sh64/arch_regs.c (sh64_r9): Likewise. + * linux/xtensa/arch_regs.c (xtensa_a2): Likewise. + * linux/alpha/arch_sigreturn.c (arch_sigreturn): Change addr type + from long to unsigned long. + * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/alpha/get_scno.c (arch_get_scno): Update for the change + of signedness. + * linux/arc/get_syscall_args.c (get_syscall_args): Change arc_args type + from pointer to long to pointer to unsigned long. + * linux/arm/arch_regs.c (arm_sp_ptr): Change type from pointer to long + to pointer to unsigned long. + * linux/arm/arch_regs.h (arm_sp_ptr): Likewise. + * linux/i386/arch_regs.c (i386_esp_ptr): Likewise. + * linux/i386/arch_regs.h (i386_esp_ptr): Likewise. + * linux/m68k/arch_regs.c (m68k_usp_ptr): Likewise. + * linux/m68k/arch_regs.h (m68k_usp_ptr): Likewise. + * linux/ia64/get_syscall_args.c (get_syscall_args): Use umove + instead of umoven. + * linux/sh/arch_getrval2.c (getrval2): Change val type from long + to unsigned long. + + arch_sigreturn: change tracee address type from long to unsigned long. + * linux/arm/arch_sigreturn.c (arch_sigreturn): Change addr variable + type from long to unsigned long. + * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Change the type + of addr and regs variables from long to unsigned long. + * linux/mips/arch_sigreturn.c (arch_sigreturn): Change addr variable + type from long to kernel_ureg_t. + * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Change the type + of offset and addr variables from long to kernel_ureg_t. + + kexec: change flags type from unsigned long to kernel_ureg_t. + * kexec.c (SYS_FUNC(kexec_load)): Change n variable type + from unsigned long to kernel_ureg_t. Use printxval64 instead + of printxval_long. Use printflags64 instead of printflags_long. + + kexec: change types of pointers and sizes to kernel_ureg_t. + * kexec.c (print_seg): Change the type of *seg and seg_buf variables + from unsigned long to kernel_ureg_t. + (print_kexec_segments): Change len argument type from unsigned long + to kernel_ureg_t. Change seg variable type from unsigned long + to kernel_ureg_t. + + printsiginfo: change len argument type from unsigned long to kernel_ureg_t + * printsiginfo.c (print_siginfo_array): Change len argument type + from unsigned long to kernel_ureg_t. + + signal: change address argument type from unsigned long to kernel_ureg_t + * signal.c (print_sigqueueinfo): Change address argument type + from unsigned long to kernel_ureg_t. + + statfs64: change size argument type from unsigned long to kernel_ureg_t. + * defs.h (print_struct_statfs64): Change size argument type + from unsigned long to kernel_ureg_t. + * print_statfs.c (print_struct_statfs64): Likewise. + * fetch_struct_statfs.c (fetch_struct_statfs64): Likewise. + * fstatfs64.c (SYS_FUNC(fstatfs64)): Pass size argument directly + to print_struct_statfs64. + * statfs64.c (SYS_FUNC(statfs64)): Likewise. + + Cast tcp->u_rval to kernel_ureg_t instead of unsigned long. + * fcntl.c (print_fcntl): Cast tcp->u_rval to kernel_ureg_t instead + of unsigned long. + * membarrier.c (SYS_FUNC(membarrier)): Likewise. + * prctl.c (SYS_FUNC(prctl)): Likewise. + * sched.c (SYS_FUNC(sched_getscheduler)): Likewise. + * time.c (do_adjtimex): Likewise. + + decode_sockbuf: change addrlen argument type from long to kernel_ureg_t. + * net.c (decode_sockbuf): Change addrlen argument type from long + to kernel_ureg_t. + + netlink: change size types from unsigned long to kernel_ureg_t. + * defs.h (decode_netlink): Change len argument type from unsigned long + to kernel_ureg_t. + * netlink.c (fetch_nlmsghdr): Likewise. + (decode_nlmsghdr_with_payload): Likewise. Change nlmsg_len variable + type from unsigned long to unsigned int. + (decode_netlink): Change the type of len argument and next_len variable + from unsigned long to kernel_ureg_t. Change nlmsg_len variable type + from unsigned long to unsigned int. + + ipc_msg: change size types from unsigned long to kernel_ureg_t. + * ipc_msg.c (tprint_msgsnd): Change count argument type + from unsigned long to kernel_ureg_t. Change flags argument type + from unsigned long to unsigned int. + (tprint_msgrcv): Change the type of count and msgtyp arguments + from unsigned long to kernel_ureg_t. + (fetch_msgrcv_args): Change *pair type from unsigned long + to kernel_ureg_t. + (SYS_FUNC(msgrcv)): Change pair type from unsigned long + to kernel_ureg_t. + * print_msgbuf.c (tprint_msgbuf): Change count argument type + from unsigned long to kernel_ureg_t. + + dumpiov_upto: change size types from unsigned long to kernel_ureg_t. + * defs.h (dumpiov_upto): Change data_size argument type + from unsigned long to kernel_ureg_t. + * util.c (dumpiov_upto): Change the type of data_size argument + and iov_len variable from unsigned long to kernel_ureg_t. + +2016-12-25 Dmitry V. Levin + + msghdr: change cmsghdr size types from size_t to unsigned int. + As the kernel does not accept control messages longer than the value + of int sysctl_optmem_max kernel variable exported as + /proc/sys/net/core/optmem_max, we do not print them either. + + Since unsigned int has enough room to contain any valid control message + size, change all internal cmsghdr size types from size_t + to unsigned int. + + * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security, + print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_uint8_t, + print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr, + cmsg_printer, print_cmsg_type_data): Change data_len argument type + from size_t to unsigned int. + (cmsg_socket_printers): Change min_len type from size_t to unsigned int. + (decode_msg_control): Change the type of in_control_len argument, + cmsg_len, and len variables from size_t to kernel_ureg_t. + Change the type of cmsg_size, control_len, and buf_len variables + from size_t to unsigned int. + +2016-12-25 Dmitry V. Levin + + msghdr: change register based size types from unsigned long to kernel_ureg_t + * defs.h (dumpiov_in_msghdr): Change data_size argument type + from unsigned long to kernel_ureg_t. + * msghdr.h (print_struct_msghdr): Likewise. + * msghdr.c (print_struct_msghdr): Likewise. Cast msghdr.msg_iovlen + and msghdr.msg_controllen to kernel_ureg_t instead of unsigned long. + (decode_msghdr, dumpiov_in_msghdr): Change data_size argument type + from unsigned long to kernel_ureg_t. + (SYS_FUNC(sendmsg)): Pass -1 instead of -1UL as data_size argument + to decode_msghdr. + * mmsghdr.c (print_struct_mmsghdr): Pass (kernel_ureg_t) -1 instead + of -1UL as data_size argument to print_struct_msghdr. + (dumpiov_in_mmsghdr): Cast msghdr.msg_iovlen to kernel_ureg_t instead + of unsigned long. + * syscall.c (dumpio): Pass -1 instead of -1UL as data_size argument + to dumpiov_in_msghdr + + mq: remove redundant u_rval check. + * mq.c (SYS_FUNC(mq_timedreceive)): Do not check for tcp->u_rval < 0, + syserror(tcp) is enough, and printstrn can handle len < 0 anyway. + + io: change size types from unsigned long to kernel_ureg_t. + * defs.h (tprint_iov_upto): Change the type of len and data_size + arguments from unsigned long to kernel_ureg_t. + (tprint_iov): Change the type of len argument from unsigned long + to kernel_ureg_t. + * io.c (print_iovec_config): Change data_size type from unsigned long + to kernel_ureg_t. + (print_iovec): Change the type of *iov, iov_buf, and len variables + from unsigned long to kernel_ureg_t. + (tprint_iov_upto): Change the type of len and data_size arguments, and + the type of iov variable from unsigned long to kernel_ureg_t. + + mount: change flags type from unsigned long to kernel_ureg_t. + * mount.c (SYS_FUNC(mount)): Change the type of flags from unsigned long + to kernel_ureg_t, use printflags64 instead of printflags_long + to print it. + + mem: change mmap arguments type from unsigned long to kernel_ureg_t. + * mem.c (print_mmap): Change the type of len, prot, and flags + from unsigned long to kernel_ureg_t. Use printflags64 instead + of printflags_long. Use printxval64 instead of printxval_long. + (SYS_FUNC(old_mmap)): Check for current_klongsize instead + of [AARCH64 || X86_64] to take X32 into account. + (SYS_FUNC(mremap)): Use printflags64 instead of printflags_long. + (SYS_FUNC(remap_file_pages)): Change the type of size, prot, pgoff, and + flags from unsigned long to kernel_ureg_t. Use printflags64 instead + of printflags_long. Use printxval64 instead of printxval_long. + [POWERPC] (SYS_FUNC(subpage_prot)): Change the type of len and nmemb + from unsigned long to kernel_ureg_t. + + numa: change size arguments type from unsigned long to kernel_ureg_t. + * numa.c (print_node, print_addr): Add kernel_ureg_t support. + (print_nodemask): Change type of maxnodes argument from unsigned long + to kernel_ureg_t. + (SYS_FUNC(move_pages)): Change npages type from unsigned long + to kernel_ureg_t. Change buf type from long to kernel_ureg_t. + + print_sigset_addr_len: change len argument type from long to kernel_ureg_t + * defs.h (print_sigset_addr_len): Change len argument type from long + to kernel_ureg_t. + * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len): Likewise. + + process_vm: change size arguments type from unsigned long to kernel_ureg_t + * process_vm.c (SYS_FUNC(process_vm_readv), + SYS_FUNC(process_vm_writev)): Change the type of local_iovcnt, + remote_iovcnt, and flags from unsigned long to kernel_ureg_t. + + printstr*: change len argument type from long to kernel_ureg_t. + * defs.h (printstr_ex, printstrn): Change len argument type from long + to kernel_ureg_t. + * util.c (printstr_ex): Likewise. + + xattr: change size arguments type from unsigned long to kernel_ureg_t. + * xattr.c (print_xattr_val): Change type of insize and size arguments + from unsigned long to kernel_ureg_t. + (print_xattr_list): Change type of size argument from unsigned long + to kernel_ureg_t. + +2016-12-25 Dmitry V. Levin + + printstr_ex: fix decoding of non-NUL-terminated strings when len == -1. + Do not treat len == -1 in any special way. All users who need the + string to be handled as a NUL-terminated string set QUOTE_0_TERMINATED + bit in user_style flags already. + + * util.c (printstr_ex): Remove (len == -1) check. + * tests/printstr.c: New file. + * tests/printstr.test: New test. + * tests/.gitignore: Add printstr. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add printstr.test. + +2016-12-25 Dmitry V. Levin + + Fix decoding of sethostname syscall. + The second argument of sethostname syscall is not an unsigned long but + unsigned int. The kernel does not look at the string argument when + the length argument is too long. + + * hostname.c [HAVE_LINUX_UTSNAME_H]: Include . + [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define. + (SYS_FUNC(sethostname)): Treat the second argument as unsigned int. + Print the first argument as a pointer when the second argument exceeds + __NEW_UTS_LEN. + * tests/sethostname.c [HAVE_LINUX_UTSNAME_H]: Include . + [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define. + (main): Use it. Check that the second argument of sethostname + is handled as unsigned int. Check that the first argument is printed + as a pointer when the second argument exceeds __NEW_UTS_LEN. + +2016-12-25 Dmitry V. Levin + + tests: add F8ILL_KULONG_* and f8ill_ptr_to_kulong to tests.h. + * tests/tests.h (F8ILL_KULONG_SUPPORTED, F8ILL_KULONG_MASK): New macros. + (f8ill_ptr_to_kulong): New static inline function. + +2016-12-25 Dmitry V. Levin + + printstr: rename to printstrn, add printstr as a thin wrapper. + As about half of all printstr uses cases are invocations with the last + argument set to -1, create a dedicated function for this use case. + + * defs.h (printstr): Rename to printstrn. All callers updated. + (printstr): New static inline function. All callers updated. + +2016-12-25 Dmitry V. Levin + + process: change ptrace arguments type from unsigned long to kernel_ureg_t + (SYS_FUNC(ptrace)): Change type of request and data arguments + from unsigned long to kernel_ureg_t. + + process: change tracee address type from unsigned long to kernel_ureg_t. + * process.c (print_user_offset_addr): Change address argument type + from unsigned long to kernel_ureg_t. + (SYS_FUNC(ptrace)): Change addr variable type from unsigned long + to kernel_ureg_t. + + net: change address argument type from long to kernel_ureg_t. + * net.c (decode_sockbuf, decode_pair_fd, print_linger, print_ucred, + print_tpacket_stats, print_icmp_filter, print_getsockopt, print_mreq, + print_mreq6, print_group_req, print_tpacket_req, print_packet_mreq, + print_setsockopt): Change address argument type from long + to kernel_ureg_t. + + print_mq_attr: change address argument type from long to kernel_ureg_t. + * print_mq_attr.c (printmqattr): Change address argument type from long + to kernel_ureg_t. + + ipc_*: change address argument type from long to kernel_ureg_t. + * ipc_msg.c (tprint_msgsnd, tprint_msgrcv, fetch_msgrcv_args): Change + address argument type from long to kernel_ureg_t. + * ipc_msgctl.c (print_msqid_ds): Likewise. + * ipc_sem.c (tprint_sembuf_array): Likewise. + * ipc_shmctl.c (print_shmid_ds): Likewise. + + print_msgbuf: change address argument type from long to kernel_ureg_t. + * print_msgbuf.c (tprint_msgbuf): Change address argument type + from long to kernel_ureg_t. + + desc: change tracee address type from long to kernel_ureg_t. + * desc.c (decode_select): Rename arg to addr, change its type + from long to kernel_ureg_t. + + uid: change address argument type from long to kernel_ureg_t. + * uid.c (get_print_uid): Change address argument type + from long to kernel_ureg_t. + + time: change address argument type from long to kernel_ureg_t. + * time.c (print_timezone, do_adjtimex): Change address argument type + from long to kernel_ureg_t. + + sched: change address argument type from long to kernel_ureg_t. + * sched.c (print_sched_attr): Change address argument type + from long to kernel_ureg_t. + + printsiginfo: change address argument type from long to kernel_ureg_t. + * printsiginfo.c (printsiginfo_at): Change address argument type + from long to kernel_ureg_t. + + print_timex: change address argument type from long to kernel_ureg_t. + * print_timex.c (print_timex): Change address argument type + from long to kernel_ureg_t. + + print_sigevent: change address argument type from long to kernel_ureg_t. + * print_sigevent.c (print_sigevent): Change address argument type + from long to kernel_ureg_t. + + poll: change address argument type from long to kernel_ureg_t. + * poll.c (decode_poll_exiting): Change tracee address argument type + from long to kernel_ureg_t. + + printrusage*: change tracee address argument type from long to kernel_ureg_t + * defs.h [ALPHA] (printrusage32): Change address argument type + from long to kernel_ureg_t. + * printrusage.c (printrusage): Likewise. + [ALPHA] (printrusage32): Likewise. + * wait.c (printwaitn): Change the type of tracee address argument + of print_rusage from long to kernel_ureg_t. + + print_time*: change tracee address argument type from long to kernel_ureg_t + * defs.h [ALPHA] (sprint_timeval32, print_timeval32, + print_timeval32_pair, print_itimerval32): Change address argument type + from long to kernel_ureg_t. + * desc.c (decode_select): Change the type of tracee address argument + of print_tv_ts and sprint_tv_ts from long to kernel_ureg_t. + * print_timespec.c (print_timespec, sprint_timespec, + print_timespec_utime_pair, print_itimerspec): Change address argument + type from long to kernel_ureg_t. + * print_timeval.c (print_timeval, print_timeval_pair, sprint_timeval, + print_itimerval, print_timeval32, print_timeval32_pair, + print_itimerval32, sprint_timeval32): Likewise. + + rtc: change type of ioctl 3rd argument from long to kernel_ureg_t. + * rtc.c (decode_rtc_time, decode_rtc_wkalrm, decode_rtc_pll_info): + Change addr type from long to kernel_ureg_t. + (rtc_ioctl): Change arg type from long to kernel_ureg_t. + + mtd: change type of ioctl 3rd argument from long to kernel_ureg_t. + * mtd.c (decode_erase_info_user, decode_erase_info_user64, + decode_mtd_oob_buf, decode_mtd_oob_buf64, decode_otp_info, + decode_otp_select, decode_mtd_write_req, decode_mtd_info_user, + decode_nand_oobinfo, decode_nand_ecclayout_user, decode_mtd_ecc_stats): + Change addr type from long to kernel_ureg_t. + (mtd_ioctl): Change arg type from long to kernel_ureg_t. + + hdio: change type of ioctl 3rd argument from long to kernel_ureg_t. + * hdio.c (hdio_ioctl): Change arg type from long to kernel_ureg_t. + + v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t. + * v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format, + print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer, + print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard, + print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl, + print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls, + print_v4l2_frmsizeenum, print_v4l2_frmivalenum, + print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long + to kernel_ureg_t. + + evdev: change type of ioctl 3rd argument from long to kernel_ureg_t. + * evdev.c (ff_effect_ioctl, abs_ioctl, keycode_ioctl, keycode_V2_ioctl, + getid_ioctl, decode_bitset, mtslots_ioctl, repeat_ioctl, bit_ioctl, + evdev_read_ioctl, evdev_write_ioctl, evdev_ioctl): Change arg type + from long to kernel_ureg_t. + + btrfs: change type of ioctl 3rd argument from long to kernel_ureg_t. + * btrfs.c (btrfs_print_balance, btrfs_ioctl): Change arg type from long + to kernel_ureg_t. + + block: change type of ioctl 3rd argument from long to kernel_ureg_t. + * block.c (block_ioctl): Change arg type from long to kernel_ureg_t. + + Change type of ioctl 3rd argument from long to kernel_ureg_t. + * defs.h (DECL_IOCTL): Change arg type from long to kernel_ureg_t. + * dm.c (dm_known_ioctl, dm_ioctl): Likewise. + * file_ioctl.c (file_ioctl): Likewise. + * fs_x_ioctl.c (fs_x_ioctl): Likewise. + * ioctl.c (ioctl_decode): Likewise. + * loop.c (decode_loop_info, decode_loop_info64): Change addr type + from long to kernel_ureg_t. + (loop_ioctl): Change arg type from long to kernel_ureg_t. + * ptp.c (ptp_ioctl): Likewise. + * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, + print_sg_io_v4_res, scsi_ioctl): Likewise. + * sock.c (print_ifreq, sock_ioctl): Likewise. + (decode_ifconf): Change addr type from long to kernel_ureg_t. + * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, + decode_modem_flags): Likewise. + (term_ioctl): Change arg type from long to kernel_ureg_t. + * ubi.c (ubi_ioctl): Likewise. + * userfaultfd.c (uffdio_ioctl): Likewise. + + ldt: change address argument type from long to kernel_ureg_t. + * defs.h [HAVE_STRUCT_USER_DESC] (print_user_desc): Change address + argument type from long to kernel_ureg_t. + * ldt.c [HAVE_STRUCT_USER_DESC] (print_user_desc): Likewise. + + fcntl: change address argument type from long to kernel_ureg_t. + * fcntl.c (printflock64, printflock, print_f_owner_ex): Change + address argument type from long to kernel_ureg_t. + + execve: change address argument type from long to kernel_ureg_t. + * execve.c (printargv, printargc): Change address argument type + from long to kernel_ureg_t. + + dirent: change address argument type from long to kernel_ureg_t. + * dirent.c (print_old_dirent): Change address argument type from long + to kernel_ureg_t. + + bpf: change address argument type from long to kernel_ureg_t. + * bpf.c (bpf_map_create, bpf_map_update_elem, bpf_map_delete_elem, + bpf_map_io, bpf_prog_load, SYS_FUNC(bpf)): Change address argument + type from long to kernel_ureg_t. + + dump*: change address argument type from long to kernel_ureg_t. + * defs.h (dumpiov_in_msghdr, dumpiov_in_mmsghdr, dumpiov_upto, dumpstr): + Change address argument type from long to kernel_ureg_t. + * mmsghdr.c (dumpiov_in_mmsghdr): Likewise. + * msghdr.c (fetch_msghdr_namelen, decode_msghdr, dumpiov_in_msghdr): + Likewise. + * util.c (dumpiov_upto, dumpstr): Likewise. + + print_sigset_addr_len: change address argument type from long to kernel_ureg_t + * defs.h (print_sigset_addr_len) Change address argument type from long + to kernel_ureg_t. + * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len, + decode_old_sigaction, decode_new_sigaction): Likewise. + + decode_sockaddr: change address argument type from long to kernel_ureg_t + * defs.h (decode_sockaddr) Change tracee address argument type from long + to kernel_ureg_t. + * sockaddr.c (decode_sockaddr): Likewise. + + print_struct_statfs*: change address argument type from long to kernel_ureg_t + * defs.h (print_struct_statfs, print_struct_statfs64): Change address + argument type from long to kernel_ureg_t. + * print_statfs.c (print_struct_statfs, print_struct_statfs64): Likewise. + * fetch_struct_statfs.c (fetch_struct_statfs, fetch_struct_statfs64): + Likewise. + + fetch_struct_flock: change address argument type from long to kernel_ureg_t + * fetch_struct_flock.c (fetch_struct_flock, fetch_struct_flock64): + Change address argument type from long to kernel_ureg_t. + + fetch_seccomp_fprog: change address argument type from long to kernel_ureg_t + * fetch_seccomp_fprog.c (fetch_seccomp_fprog): Change address argument + type from long to kernel_ureg_t. + + printnum_*, printpair_*: change address argument type from long to kernel_ureg_t + * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR, printnum_long_int): Change + address argument type from long to kernel_ureg_t. + * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise. + + printpath*: change address argument type from long to kernel_ureg_t. + * defs.h (printpath, printpathn): Change address argument type + from long to kernel_ureg_t. + * util.c (printpath, printpathn): Likewise. + + printstr*: change address argument type from long to kernel_ureg_t. + * defs.h (printstr_ex, printstr_ex): Change address argument type + from long to kernel_ureg_t. + * util.c (printstr_ex): Likewise. + + umove*: change tracee address argument type from long to kernel_ureg_t. + * defs.h (umovestr, umoven, umoven_or_printaddr, + umoven_or_printaddr_ignore_syserror): Change tracee address argument + type from long to kernel_ureg_t. + (print_array): Change the type of tracee address argument of umoven_func + from long to kernel_ureg_t. + * util.c (vm_read_mem, umovestr, umoven, umoven_or_printaddr, + umoven_or_printaddr_ignore_syserror): Change tracee address argument + type from long to kernel_ureg_t. + (print_array): Change the type of tracee address argument of umoven_func + from long to kernel_ureg_t. + * desc.c (umove_kulong_array_or_printaddr): Change tracee address + argument type from long to kernel_ureg_t. + * mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Likewise. + + futex: change address type from long to kernel_ureg_t. + * futex.c (SYS_FUNC(futex)): Change address type from long + to kernel_ureg_t. + + file_handle: change address type from long to kernel_ureg_t. + * file_handle.c (SYS_FUNC(name_to_handle_at), + SYS_FUNC(open_by_handle_at)): Change address type from long + to kernel_ureg_t. + + printsiginfo: cast pointers to kernel_ureg_t instead of unsigned long. + * printsiginfo.c (printsigval): Cast siginfo.si_ptr pointer + to kernel_ureg_t instead of unsigned long. + (print_si_info): Cast siginfo.si_addr and siginfo.si_call_addr pointers + to kernel_ureg_t instead of unsigned long. + + sigaltstack: cast pointers and sizes to kernel_ureg_t instead of unsigned long + * sigaltstack.c (print_stack_t): Cast sigaltstack.ss_sp pointer + and sigaltstack.ss_size to kernel_ureg_t instead of unsigned long. + + v4l2: cast pointers to kernel_ureg_t instead of long. + * v4l2.c (print_v4l2_ext_control): Cast v4l2_ext_control.string pointer + to kernel_ureg_t instead of long. + + v4l2: cast pointers to kernel_ureg_t instead of unsigned long. + * v4l2.c (print_v4l2_buffer): Remove redundant cast. + (print_v4l2_framebuffer): Cast v4l2_framebuffer.base pointer + to kernel_ureg_t instead of unsigned long. + (print_v4l2_ext_controls): Cast v4l2_ext_controls.controls pointer + to kernel_ureg_t instead of unsigned long. + +2016-12-24 Dmitry V. Levin + + sysctl: cast pointers to kernel_ureg_t instead of size_t. + * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldval and + __sysctl_args.newval pointers to kernel_ureg_t instead of size_t. + + sysctl: cast pointers to kernel_ureg_t instead of long. + * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldlenp pointer + to kernel_ureg_t instead of long. + + block: cast pointers to kernel_ureg_t instead of long. + * block.c (print_blkpg_req): Cast blkpg_ioctl_arg.data pointer + to kernel_ureg_t instead of long. + + dumpiov_upto: cast pointers to kernel_ureg_t instead of long. + * util.c (dumpiov_upto): Cast iovec.iov_base pointer to kernel_ureg_t + instead of long. + + msghdr: cast pointers to kernel_ureg_t instead of long. + * msghdr.c (print_struct_msghdr): Cast msghdr.msg_name pointer + to kernel_ureg_t instead of long. + (dumpiov_in_msghdr): Cast msghdr.msg_iov pointer to kernel_ureg_t + instead of long. + + mmsghdr: cast pointers to kernel_ureg_t instead of long. + * mmsghdr.c (dumpiov_in_mmsghdr): Cast msghdr.msg_iov pointer + to kernel_ureg_t instead of long. + + Remove redundant casts of ptrace arguments. + * strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument + from pointer to long type. + + ptrace_restart: cleanup. + * strace.c (ptrace_restart): Replace the sequence of "if" statements + with a "switch" statement. + + ptrace_restart: change types of integer arguments to unsigned. + * strace.c (ptrace_restart): Change types of "op" and "sig" + from int to unsigned int. + + process: remove redundant syserror checks. + * process.c (SYS_FUNC(ptrace)): Remove syserror checks as both + print_siginfo_array and print_seccomp_fprog do the right thing + by using umoven_or_printaddr. + + sparc64: remove redundant casts. + * linux/sparc64/get_syscall_args.c (get_syscall_args): Remove + redundant casts from uint32_t to long. + +2016-12-23 Dmitry V. Levin + + numa: change address argument type from unsigned long to kernel_ureg_t. + * numa.c (print_nodemask): Change address argument type from + unsigned long to kernel_ureg_t. + + net: change address argument type from unsigned long to kernel_ureg_t. + * net.c (fetch_socklen): Change address argument type from + unsigned long to kernel_ureg_t. + + mem: change tracee address type from unsigned long to kernel_ureg_t. + * mem.c (print_mmap, SYS_FUNC(remap_file_pages), + SYS_FUNC(subpage_prot)): Change the type of variables containing tracee + addresses from unsigned long to kernel_ureg_t. + + kexec: change address argument type from unsigned long to kernel_ureg_t. + * kexec.c (print_kexec_segments): Change address argument type + from unsigned long to kernel_ureg_t. + + poll: change counter type from unsigned long to unsigned int. + * poll.c (decode_poll_exiting): Change the type of printed and + max_printed counters from unsigned long to unsigned int. + + xattr: change address argument type from unsigned long to kernel_ureg_t. + * xattr.c (print_xattr_val, print_xattr_list): Change address + argument type from unsigned long to kernel_ureg_t. + + uid: change address argument type from unsigned long to kernel_ureg_t. + * uid.c (print_groups): Change address argument type + from unsigned long to kernel_ureg_t. + + stat64: change address argument type from unsigned long to kernel_ureg_t + * stat64.c (decode_struct_stat64): Change address argument type + from unsigned long to kernel_ureg_t. + + stat: change address argument type from unsigned long to kernel_ureg_t. + * stat.c (decode_struct_stat): Change address argument type + from unsigned long to kernel_ureg_t. + + sigaltstack: change address argument type from unsigned long to kernel_ureg_t + * sigaltstack.c (print_stack_t): Change address argument type + from unsigned long to kernel_ureg_t. + + resource: change address argument type from unsigned long to kernel_ureg_t + * resource.c (print_rlimit64, print_rlimit32, decode_rlimit): Change + address argument type from unsigned long to kernel_ureg_t. + + printsiginfo: change address argument type from unsigned long to kernel_ureg_t + * printsiginfo.c (print_siginfo_array): Change address argument type + from unsigned long to kernel_ureg_t. + + poll: change tracee address type from unsigned long to kernel_ureg_t. + * poll.c (decode_poll_entering, decode_poll_exiting): Change the type + all tracee address variables from unsigned long to kernel_ureg_t. + + perf: change address argument type from unsigned long to kernel_ureg_t. + * perf.c (fetch_perf_event_attr, print_perf_event_attr): Change + address argument type from unsigned long to kernel_ureg_t. + + pathtrace: change tracee address type from unsigned long to kernel_ureg_t + * pathtrace.c (upathmatch): Change address argument type + from unsigned long to kernel_ureg_t. + (pathtrace_match): Change the type of all tracee address variables + from unsigned long to kernel_ureg_t. + + scsi: change address argument type from unsigned long to kernel_ureg_t. + * scsi.c (print_sg_io_buffer): Change address argument type + from unsigned long to kernel_ureg_t. + + dm: change address argument type from unsigned long to kernel_ureg_t. + * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, + dm_decode_dm_name_list, dm_decode_dm_target_versions, + dm_decode_dm_target_msg, dm_decode_string): Change address argument type + from unsigned long to kernel_ureg_t. + + oldstat: change address argument type from unsigned long to kernel_ureg_t + * oldstat.c (print_old_kernel_stat): Change address argument type + from unsigned long to kernel_ureg_t. + + capability: change address argument type from unsigned long to kernel_ureg_t + * capability.c (get_cap_header, print_cap_header, print_cap_data): + Change address argument type from unsigned long to kernel_ureg_t. + + btrfs: change address argument type from unsigned long to kernel_ureg_t. + * btrfs.c (btrfs_print_qgroup_inherit): Change address argument type + from unsigned long to kernel_ureg_t. + + affinity: change address argument type from unsigned long to kernel_ureg_t + * affinity.c (print_affinitylist): Change address argument type from + unsigned long to kernel_ureg_t. + + aio: change address type from unsigned long to kernel_ureg_t. + * aio.c (print_iocb): Remove casts to unsigned long. + (print_iocbp, SYS_FUNC(io_submit)): Change address type + from unsigned long to kernel_ureg_t. + + mmsghdr: change address argument type from unsigned long to kernel_ureg_t + * mmsghdr.c (save_mmsgvec_namelen, decode_mmsgvec): Change + address argument type from unsigned long to kernel_ureg_t. + + msghdr: change address argument type from unsigned long to kernel_ureg_t + * msghdr.c (decode_msg_control): Change address argument type + from unsigned long to kernel_ureg_t. + + fetch_struct_stat64: change address argument type from unsigned long to kernel_ureg_t + * fetch_struct_stat64.c (fetch_struct_stat64): Change address argument + type from unsigned long to kernel_ureg_t. + + fetch_struct_stat: change address argument type from unsigned long to kernel_ureg_t + * fetch_struct_stat.c (fetch_struct_stat): Change address argument + type from unsigned long to kernel_ureg_t. + + fetch_struct_msghdr: change address argument type from unsigned long to kernel_ureg_t + * fetch_struct_msghdr.c (fetch_struct_msghdr): Change + address argument type from unsigned long to kernel_ureg_t. + + fetch_struct_mmsghdr: change address argument type from unsigned long to kernel_ureg_t + * fetch_struct_mmsghdr.c (fetch_struct_mmsghdr): Change + address argument type from unsigned long to kernel_ureg_t. + + decode_netlink: change address argument type from unsigned long to kernel_ureg_t + * defs.h (decode_netlink) Change address argument type + from unsigned long to kernel_ureg_t. + * netlink.c (fetch_nlmsghdr, decode_nlmsghdr_with_payload, + decode_netlink): Likewise. + + print_seccomp_*: change address argument type from unsigned long to kernel_ureg_t + * defs.h (print_seccomp_filter, print_seccomp_fprog): Change + address argument type from unsigned long to kernel_ureg_t. + * seccomp.c (print_seccomp_filter, print_seccomp_fprog, + decode_seccomp_set_mode_strict): Likewise. + + tprint_iov*: change address argument type from unsigned long to kernel_ureg_t + * defs.h (tprint_iov, tprint_iov_upto): Change address argument type + from unsigned long to kernel_ureg_t. + * io.c (tprint_iov, tprint_iov_upto): Likewise. + + print_array: change tracee address type from unsigned long to kernel_ureg_t + * defs.h (print_array): Change start_addr type from unsigned long + to kernel_ureg_t. + * util.c (print_array): Likewise. Change the type of all tracee + address variables from unsigned long to kernel_ureg_t. + +2016-12-23 Dmitry V. Levin + + Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long + In all places where LONG_LONG is used the destination already has type + unsigned long long, so it is quite natural to change LONG_LONG as well. + + * defs.h (LONG_LONG): Rename to ULONG_LONG, change return type + from long long to unsigned long long. All callers updated. + +2016-12-23 Dmitry V. Levin + + mem: remove redundant casts. + * mem.c (SYS_FUNC(old_mmap)): Remove redundant cast + from kernel_ureg_t to unsigned long. + [S390] (SYS_FUNC(old_mmap_pgoff)): Remove redundant cast + from unsigned int to unsigned long. + + desc: remove redundant casts. + * desc.c (umove_kulong_array_or_printaddr): Remove redundant cast + from uint32_t to kernel_ulong_t. + (SYS_FUNC(pselect6)): Remove redundant casts from kernel_ulong_t + to unsigned long. + +2016-12-22 Dmitry V. Levin + + print_sigevent: remove redundant cast. + * print_sigevent.c (print_sigevent): Remove redundant cast from + struct_sigevent.sigev_value.sival_ptr to unsigned long as the former + is not a pointer but an unsigned integer. + + tests: fix xattr.test for the case when listxattr returns a long list. + * tests/xattr.c (DEFAULT_STRLEN): New macro. + (main): Use it to limit the length passed to print_quoted_memory. + Print ellipsis when the list returned by listxattr is too long. + +2016-12-22 Gabriel Laskar + + tests: test for correct ellipsis with -s in xattr. + * tests/xattr-strings.c: New file. + * tests/xattr-strings.test: New test. + * tests/.gitignore: Add xattr-string. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add xattr-string.test. + +2016-12-22 Gabriel Laskar + + xattr: use printstr_ex instead of print_quoted_string. + This fixes the display when using `-s` to limit the string size + of the values displayed by {get,set}xattr. + + * xattr.c (print_xattr_val): Remove static buffer. Use printstr_ex + instead of print_quoted_string. + + Reported-by: Марк Коренберг + +2016-12-22 Eugene Syromyatnikov + + tests: use scno.h in finit_module, kcmp, renameat2 tests. + * tests/finit_module.c: Include "scno.h". + * tests/kcmp.c: Likewise. + * tests/renameat2.c: Likewise. + +2016-12-21 Dmitry V. Levin + + sock: cast pointers to kernel_ureg_t instead of unsigned long. + * sock.c (decode_ifconf): Cast ifconf.ifc_buf pointer to kernel_ureg_t + instead of unsigned long. + + scsi: cast pointers to kernel_ureg_t instead of unsigned long. + * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Cast sg_io_hdr.cmdp, + sg_io_hdr.dxferp, and sg_io_hdr.sbp pointers to kernel_ureg_t instead + of unsigned long. + + mtd: cast pointers to kernel_ureg_t instead of unsigned long. + * mtd.c (decode_mtd_oob_buf): Cast mtd_oob_buf.ptr pointer + to kernel_ureg_t instead of unsigned long. + + msghdr: cast pointers to kernel_ureg_t instead of unsigned long. + * msghdr.c (print_struct_msghdr): Cast msghdr.msg_iov and + msghdr.msg_control pointers to kernel_ureg_t instead of unsigned long. + + evdev: cast tcp->u_rval to kernel_ureg_t instead of unsigned long. + * evdev.c (decode_bitset): Cast tcp->u_rval to kernel_ureg_t + instead of unsigned long. + + evdev: cast pointers to kernel_ureg_t instead of unsigned long. + * evdev.c (ff_effect_ioctl): Cast ff_periodic_effect.custom_data + pointer to kernel_ureg_t instead of unsigned long. + + btrfs: cast pointers to kernel_ureg_t instead of unsigned long. + * btrfs.c (btrfs_ioctl): Cast btrfs_ioctl_send_args.clone_sources + and btrfs_ioctl_vol_args_v2.qgroup_inherit pointers to kernel_ureg_t + instead of unsigned long. + + Rework ifdefery around print_user_desc. + * configure.ac (AC_CHECK_TYPES): Check for struct user_desc + in . + * clone.c (print_tls_arg): New function. + (SYS_FUNC(clone)): Use it. + (print_user_desc): Move prototype ... + * defs.h [HAVE_STRUCT_USER_DESC]: ... here. + * ldt.c: Check for HAVE_STRUCT_USER_DESC instead of architectures. + * linux/dummy.h: Likewise. + + Introduce DECL_IOCTL macro to declare *_ioctl functions. + * defs.h (DECL_IOCTL): New macro. + (dm_ioctl, file_ioctl, fs_x_ioctl, loop_ioctl, ptp_ioctl, scsi_ioctl, + sock_ioctl, term_ioctl, ubi_ioctl, uffdio_ioctl): Rewrite prototypes + using DECL_IOCTL. + + Introduce DECL_PRINT* macros to declare printnum_* and printpair_* + * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR): New macros. + (printnum_short, printnum_int, printnum_int64): Rewrite prototypes + using DECL_PRINTNUM. + (printpair_int, printpair_int64): Rewrite prototypes + using DECL_PRINTPAIR. + + ioctl: use uintptr_t for casts between 32-bit integers and pointers. + * ioctl.c (compare): Cast pointer to uintptr_t before assigning + it to an integer. + (ioctl_lookup): Cast integer to uintptr_t before passing it + as a pointer. + + scsi: use umove_or_printaddr. + * scsi.c (scsi_ioctl): Use umove_or_printaddr. + + Remove dumpiov wrapper. + * defs.h (dumpiov): Remove. + * syscall.c (dumpio): Use dumpiov_upto instead of dumpiov. + + travis: fix enabling of gcc -Werror builds. + * travis-build.sh: Use DISTCHECK_CONFIGURE_FLAGS instead + of CHECK_CONFIGURE_FLAGS and ENABLE_GCC_WERROR. + [$CC == gcc]: Add --enable-gcc-Werror to DISTCHECK_CONFIGURE_FLAGS + instead of ENABLE_GCC_WERROR. + [$CHECK == coverage]: Add --enable-code-coverage + to DISTCHECK_CONFIGURE_FLAGS instead of CHECK_CONFIGURE_FLAGS. + + printaddr: change argument type to kernel_ureg_t. + * defs.h (printaddr): Change argument type from unsigned long + to kernel_ureg_t. + + tests: check decoding of unreadable ip_mreq and ipv6_mreq structures. + * tests/ip_mreq.c (main): Check short read. + + tests: rewrite ip_mreq.c using arrays and iterators. + * tests/ip_mreq.c (main): Create arrays of setsockopt arguments to test. + Iterate over these arrays invoking setsockopt and printing expected + output. + + tests: rewrite ip_mreq.c using tail_alloc. + * tests/ip_mreq.c (main): Allocate objects of struct ip_mreq + and struct ipv6_mreq using tail_alloc instead of using stack. + + tests: rewrite ip_mreq.c without asserts. + * tests/ip_mreq.c: Do not include . + (main): Do not use assert. Use sprintrc instead of errno2name. + +2016-12-20 Dmitry V. Levin + + Remove NEED_PTRACE_PROTOTYPE_WORKAROUND. + Remove the workaround for broken ptrace prototypes + that seems to be unneeded for quite a long time. + + * defs.h [NEED_PTRACE_PROTOTYPE_WORKAROUND]: Remove. + +2016-12-20 Dmitry V. Levin + + tests: use scno.h in tests of relatively new syscalls. + * tests/add_key.c: Include "scno.h" after . + * tests/copy_file_range.c: Likewise. + * tests/execveat.c: Likewise. + * tests/kexec_file_load.c: Likewise. + * tests/membarrier.c: Likewise. + * tests/memfd_create.c: Likewise. + * tests/mlock2.c: Likewise. + * tests/pkey_alloc.c: Likewise. + * tests/pkey_free.c: Likewise. + * tests/pkey_mprotect.c: Likewise. + * tests/preadv2-pwritev2.c: Likewise. + * tests/userfaultfd.c: Likewise. + +2016-12-20 Dmitry V. Levin + + tests: generate scno.h from syscallent.h for use by other tests. + Provide scno.h with fallback definitions of all __NR_* constants known + to strace for the personbality being tested. + + Some tests need just __NR_* constants without any kernel support. + Such tests can include "scno.h" after to get definitions + of these constants when system headers are too old. + + * tests/generate_scno.c: New file. + * tests/.gitignore: Add generate_scno. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (scno.h): New rule. + (BUILT_SOURCES, CLEANFILES): Add scno.h. + +2016-12-20 Dmitry V. Levin + + tests: fix potential errno clobbering in membarrier test. + * tests/membarrier.c (main): Save errno. + +2016-12-20 Dmitry V. Levin + + Do not use widen_to_ulong in kexec.c and process_vm.c. + Automatic argument truncation makes use of this function redundant. + + * kexec.c (SYS_FUNC(kexec_load)): Do not invoke widen_to_ulong. + * process_vm.c (SYS_FUNC(process_vm_readv), + SYS_FUNC(process_vm_writev)): Likewise. + +2016-12-20 Dmitry V. Levin + + x32: implement automatic argument truncation for compat syscalls. + x32 syscalls starting with number 512 are compat syscalls that operate + on compat types. Set COMPAT_SYSCALL_TYPES flag to these syscall entries + and make get_syscall_args truncate arguments of syscalls that have this + flag set, to avoid unpleasant alternative of adding multiple + widen_to_ulong invocations to individual syscall parsers. + + preadv, pwritev, preadv2, and pwritev2 are exceptions: while these + syscalls operate on compat types, the offset argument has a regular + 64-bit type, so the automatic argument truncation cannot be applied. + + * defs.h (COMPAT_SYSCALL_TYPES): New macro. + * syscall.c (CST): New macro, defined to COMPAT_SYSCALL_TYPES. + * linux/ia64/syscallent.h: Do not include "../i386/syscallent.h" + unless [CST > 0]. + * linux/x32/syscallent.h [512..533, 536..545]: Add CST flag. + * linux/x86_64/get_syscall_args.c (get_syscall_args): Truncate arguments + of compat syscalls to 32-bit values. + * tests/ksysent.c (CST): New macro, defined to 0. + * tests/nsyscalls.c (CST): Likewise. + +2016-12-20 Dmitry V. Levin + + x32: fix decoding of mprotect and pkey_mprotect syscall arguments. + As there are no compat versions of mprotect or pkey_mprotect syscalls + in x32 personality, "addr", "len", and "prot" syscall arguments have + kernel_ulong_t type and should be printed accordingly. + + * mem.c (do_mprotect): Retrieve 1st, 2nd and 3rd arguments using + getarg_klu, print them using printaddr_klu, PRI_klu format, + and printflags64, correspondingly. + +2016-12-20 Dmitry V. Levin + + Make tprint_iov function a static inline wrapper. + * io.c (tprint_iov): Move ... + * defs.h: ... here, add static inline keywords. + +2016-12-20 Eugene Syromyatnikov + + x32: fix decoding of 3rd argument of preadv* and pwritev* syscalls. + In x32 personality these syscalls use compat type for the 3rd argument, + therefore it has to be truncated there. + + * io.c (do_preadv, do_pwritev): Truncate tcp->u_arg[2] using + widen_to_ulong. + +2016-12-19 Eugene Syromyatnikov + + tests: fix preadv2-pwritev2 test on x32. + On x32 p(read|write)v(|2) syscalls are implemented via compat, which + truncates len argument to unsigned int. + + * tests/preadv2-pwritev2.c (main): Print vlen argument as unsigned long. + +2016-12-19 Eugene Syromyatnikov + + kexec: fix for the x32 ABI. + There is no compat (and no 32-bit version, ever) for x32 ABI, so + kernel's long type should be used for arguments' values. + + The only remaining thing is a pointer to cmdline string, but it is + currently broken on x32 anyway. + + * kexec.c (SYS_FUNC(kexec_file_load)): Print the cmdline_len argument + as kernel long, retrieve it via getarg_klu; use printflags64 for + printing the flags argument, retrieve it via getarg_klu. + +2016-12-19 Dmitry V. Levin + + Check for current_klongsize instead of current_personality where appropriate + current_klongsize checks are more universal, therefore they are usually + shorter and easier to comprehend. + + * desc.c (umove_kulong_array_or_printaddr): Check for current_klongsize + instead of current_personality and current_wordsize. + * io.c (print_lld_from_low_high_val): Likewise. + * lseek.c (SYS_FUNC(lseek)): Likewise. + * resource.c (decode_rlimit): Likewise. + * syscall.c (is_negated_errno): Likewise. + * util.c (getllval, getarg_klu): Likewise. + +2016-12-19 Dmitry V. Levin + + Use kernel_ulong_t instead of unsigned long long where appropriate. + * defs.h (printaddr_ull): Rename to printaddr_klu, change argument + type from unsigned long long to kernel_ulong_t. All callers updated. + (getarg_ull): Rename to getarg_klu, change return value type + from unsigned long long to kernel_ulong_t. All callers updated. + (PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros. + * bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using + PRI_klu format. + * desc.c (SYS_FUNC(pselect6)): Likewise. + * fadvise.c (SYS_FUNC(fadvise64)): Likewise. + * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise. + * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise. + * kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using + PRI_klx format. + * keyctl.c (SYS_FUNC(keyctl)): Likewise. + * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise. + * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): + Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format. + * util.c (printaddr_ull): Rename to printaddr_klu, change argument + type from unsigned long long to kernel_ulong_t, print it using + PRI_klx format. + (getarg_ull): Rename to getarg_klu, change return value type + from unsigned long long to kernel_ulong_t, print it using + PRI_klx format. + + fcntl.c: print 64-bit fields of struct_kernel_flock64 using PRId64 format + * fcntl.c (print_struct_flock64): Print l_start and l_len fields + of struct_kernel_flock64 using PRId64 format. + + v4l2.c: print v4l2_ext_control.value64 using PRId64 format. + * v4l2.c (print_v4l2_ext_control): Print value64 field + of struct_v4l2_ext_control using PRId64 format. + + perf.c: print perf_event_attr.__reserved_1 using PRIx64 format. + * perf.c (print_perf_event_attr): Print __reserved_1 field + of perf_event_attr using PRIx64 format. + + btrfs.c: print 64-bit fields of btrfs_ioctl_vol_args_v2 using PRIu64 format + * block.c (btrfs_ioctl): Print size and transid fields + of struct_btrfs_ioctl_vol_args_v2 using PRIu64 format. + + block.c: change type of long long fileds to int64_t. + * block.c (struct_blkpg_partition): Change type of start and length + fields from long long to int64_t. + (print_blkpg_req): Print them using PRId64 format. + +2016-12-19 Eugene Syromyatnikov + + Introduce current_klongsize in addition to current_wordsize. + Subsequent commits are going to use current_klongsize + as the tracee's size of kernel_ulong_t type. + + * defs.h (PERSONALITY0_KLONGSIZE): New macro. + [X86_64] (PERSONALITY2_KLONGSIZE): Likewise. + [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_KLONGSIZE): Likewise. + [SUPPORTED_PERSONALITIES == 1] (current_klongsize): Likewise. + [SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == + PERSONALITY1_KLONGSIZE] (current_klongsize): Likewise. + [SUPPORTED_PERSONALITIES != 1 && (SUPPORTED_PERSONALITIES != 2 || + PERSONALITY0_KLONGSIZE != PERSONALITY1_KLONGSIZE)] (current_klongsize): + New variable prototype. + * syscall.c [!current_klongsize] (current_klongsize): New variable. + [!current_klongsize] (personality_klongsize): New array. + (set_personality) [!current_klongsize]: Update current_klongsize + with the appropriate value from personality_klongsize. + +2016-12-19 Dmitry V. Levin + + configure: define SIZEOF_KERNEL_LONG_T macro. + Provide SIZEOF_KERNEL_LONG_T macro in addition to SIZEOF_LONG and + SIZEOF_LONG_LONG for checking of kernel_long_t and kernel_ulong_t + types at the time of preprocessing. + + * configure.ac (AC_CHECK_SIZEOF): Add kernel_long_t. + +2016-12-19 Dmitry V. Levin + + Remove getarg_ll. + This function has never been used in the code, and in perspective + the whole ext_arg thing will go away. + + * defs.h (getarg_ll): Remove prototype. + * util.c (getarg_ll): Remove. + +2016-12-19 Dmitry V. Levin + + struct tcb: make types of syscall arguments unsigned. + This is the first step in the direction of revisiting current practice + of indiscriminate use of signed types for syscall arguments and memory + addresses. + + * kernel_types.h (kernel_ureg_t): New type, typedef to unsigned long. + * defs.h (struct tcb): Change type of u_arg from long to kernel_ureg_t. + [HAVE_STRUCT_TCB_EXT_ARG]: Change type of ext_arg from long long + to unsigned long long. + * desc.c (decode_select): Change type of syscall arguments from long + to kernel_ureg_t. + (SYS_FUNC(oldselect)): Change type of select_args from long + to kernel_ureg_t. + * io.c (print_lld_from_low_high_val): Remove no longer needed cast + of syscall arguments to unsigned long. + * lseek.c (SYS_FUNC(lseek)): Cast syscall argument from unsigned long + to long. + * mem.c (print_mmap): Change type of syscall arguments from long + to kernel_ureg_t. + (SYS_FUNC(old_mmap), SYS_FUNC(old_mmap_pgoff)): Change type of u_arg + from long to kernel_ureg_t. + (SYS_FUNC(mmap), SYS_FUNC(mmap_pgoff), SYS_FUNC(mmap_pgoff)): Remove + no longer needed cast of syscall arguments to unsigned long. + * pathtrace.c (pathtrace_match): Change type of args and select_args + from long to kernel_ureg_t. + * util.c (getarg_ull): Remove no longer needed casts of syscall + arguments to unsigned types. + +2016-12-19 Dmitry V. Levin + + s390: fix decoding of mmap2 syscall when arguments are not available. + * mem.c [S390] (SYS_FUNC(old_mmap_pgoff)): Use umove_or_printaddr + instead of umoven to fetch mmap arguments, fix return value when this + fetch fails. + + Fix pathmatch of oldselect syscall on 64-bit architectures. + * pathtrace.c (pathtrace_match): Fix fetching of 32-bit oldselect + arguments on 64-bit architectures. + + Cleanup oldselect. + * desc.c (SYS_FUNC(oldselect)): Rewrite without use of macros. + +2016-12-18 Dmitry V. Levin + + Change scno type from long to unsigned long. + Use an unsigned type for syscall numbers as they are not intended + for signed arithmetics. Introduce kernel_scno_t as a typedef + to unsigned long, that could be changed later to kernel_ulong_t. + + * kernel_types.h (kernel_scno_t): New type, typedef to unsigned long. + * defs.h (struct tcb): Change type of scno field from long + to kernel_scno_t. + (syscall_name): Change argument type from long to kernel_scno_t. + (scno_in_range, scno_is_valid): Change argument type from unsigned long + to kernel_scno_t. + * linux/aarch64/set_scno.c (arch_set_scno): Change scno argument type + from long to kernel_scno_t. + * linux/alpha/set_scno.c (arch_set_scno): Likewise. + * linux/arc/set_scno.c (arch_set_scno): Likewise. + * linux/arm/set_scno.c (arch_set_scno): Likewise. + * linux/avr32/set_scno.c (arch_set_scno): Likewise. + * linux/bfin/set_scno.c (arch_set_scno): Likewise. + * linux/crisv10/set_scno.c (arch_set_scno): Likewise. + * linux/hppa/set_scno.c (arch_set_scno): Likewise. + * linux/i386/set_scno.c (arch_set_scno): Likewise. + * linux/ia64/set_scno.c (arch_set_scno): Likewise. + * linux/m68k/set_scno.c (arch_set_scno): Likewise. + * linux/metag/set_scno.c (arch_set_scno): Likewise. + * linux/microblaze/set_scno.c (arch_set_scno): Likewise. + * linux/mips/set_scno.c (arch_set_scno): Likewise. + * linux/nios2/set_scno.c (arch_set_scno): Likewise. + * linux/or1k/set_scno.c (arch_set_scno): Likewise. + * linux/powerpc/set_scno.c (arch_set_scno): Likewise. + * linux/riscv/set_scno.c (arch_set_scno): Likewise. + * linux/s390/set_scno.c (arch_set_scno): Likewise. + * linux/sh/set_scno.c (arch_set_scno): Likewise. + * linux/sh64/set_scno.c (arch_set_scno): Likewise. + * linux/sparc/set_scno.c (arch_set_scno): Likewise. + * linux/tile/set_scno.c (arch_set_scno): Likewise. + * linux/x86_64/set_scno.c (arch_set_scno): Likewise. + * linux/xtensa/set_scno.c (arch_set_scno): Likewise. + * linux/aarch64/get_scno.c (arch_get_scno): Change scno variable type + from long to kernel_scno_t. + * linux/alpha/get_scno.c (arch_get_scno): Likewise. + * linux/arm/get_scno.c (arch_get_scno): Likewise. + * linux/sh/get_scno.c (arch_get_scno): Likewise. + * linux/x86_64/get_scno.c (arch_get_scno): Likewise. + * syscall.c (arch_set_scno): Likewise. + (shuffle_scno): Change return type from long to kernel_scno_t. + (syscall_name): Change argument type from long to kernel_scno_t. + +2016-12-18 Dmitry V. Levin + + Lowercase SCNO_IN_RANGE and SCNO_IS_VALID. + * defs.h (SCNO_IN_RANGE): Rename to scno_in_range. All callers updated. + (SCNO_IS_VALID): Rename to scno_is_valid. All callers updated. + + Turn SCNO_IN_RANGE and SCNO_IS_VALID into static inline functions. + * defs.h (SCNO_IN_RANGE, SCNO_IS_VALID): Transform into static inline + functions. + + count.c: use syserror instead of direct u_error access. + * count.c (count_syscall): Use syserror instead of u_error. + + Replace "(unsigned long) -1L" with -1UL. + * defs.h (dumpiov): Replace "(unsigned long) -1L" with -1UL. + * io.c (print_iovec, tprint_iov): Likewise. + * msghdr.c (SYS_FUNC(sendmsg)): Likewise. + * syscall.c (dumpio): Likewise. + * poll.c (decode_poll_exiting): Replace "(unsigned int) -1" with -1U. + + Add toplevel recursive check-valgrind rule. + * Makefile.am (.PHONY): Add check-valgrind-local. + (check-valgrind): New rule. + * configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Add it. + + m4: fix check-valgrind-* rules generated by AX_VALGRIND_CHECK. + * m4/ax_valgrind_check.m4 (check-valgrind-$(1)): Depend + on $(BUILT_SOURCES), honor $(AM_MAKEFLAGS), build check-am + instead of check-TESTS. + + travis: do coverage using a dedicated build. + * .travis.yml (after_success): Remove. + (matrix): Create an entry for the regular x86_64 target. + * travis-success.sh: Merge into ... + * travis-build.sh: ... this file. Disable optimization + for coverage builds. + * travis-install.sh: Rename COVERAGE=true to CHECK=coverage. + +2016-12-17 Dmitry V. Levin + + mips n32: provide fallback definitions of kernel_long_t/kernel_ulong_t. + * kernel_types.h [!(HAVE___KERNEL_LONG_T && HAVE___KERNEL_ULONG_T) && + LINUX_MIPSN32] (kernel_long_t, kernel_ulong_t): Define to long long types. + +2016-12-17 Eugene Syromyatnikov + + util: simplify definitions of bit mask constants in umovestr. + * util.c (umovestr): Do not check for SIZEOF_LONG in definitions + of bit mask constants. + + tests: check decoding of prctl operations without arguments. + * tests/prctl-no-args.c: New file. + * tests/prctl-no-args.test: New test. + * tests/.gitignore: Add prctl-no-args. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-no-args.test. + + tests: check decoding of prctl PR_[GS]ET_SECUREBITS operations. + * tests/prctl-securebits.c: New file. + * tests/prctl-securebits.test: New test. + * tests/.gitignore: Add prctl-securebits. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-securebits.test. + + tests: check decoding of prctl PR_[GS]ET_DUMPABLE operations. + * tests/prctl-dumpable.c: New file. + * tests/prctl-dumpable.test: New test. + * tests/.gitignore: Add prctl-dumpable. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-dumpable.test. + + prctl: implement decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE + * xlat/pr_dumpable.in: New file. + * prctl.c: Include "xlat/pr_dumpable.h". + (SYS_FUNC(prctl)): Decode returned value of PR_GET_DUMPABLE operation + and the second syscall argument of PR_SET_DUMPABLE operation + as SUID_DUMP_* constants. + +2016-12-16 Dmitry V. Levin + + Include "kernel_types.h" in defs.h and tests/tests.h. + As kernel_ulong_t type is going to be used in the definition + of struct tcb and in many function prototypes, make it readily + available for every source file by including "kernel_types.h" + in defs.h and tests/tests.h files. + + * defs.h: Include "kernel_types.h". + * tests/tests.h: Likewise. + * desc.c: Do not include "kernel_types.h". + * dirent.c: Likewise. + * keyctl.c: Likewise. + * syscall.c: Likewise. + * linux/asm_stat.h: Likewise. + * tests/answer.c: Likewise. + * tests/epoll_pwait.c: Likewise. + * tests/fanotify_init.c: Likewise. + * tests/fanotify_mark.c: Likewise. + * tests/file_handle.c: Likewise. + * tests/ftruncate.c: Likewise. + * tests/getdents.c: Likewise. + * tests/init_delete_module.h: Likewise. + * tests/inotify.c: Likewise. + * tests/inotify_init1.c: Likewise. + * tests/ioprio.c: Likewise. + * tests/ipc_msgbuf.c: Likewise. + * tests/kcmp.c: Likewise. + * tests/kexec_file_load.c: Likewise. + * tests/kexec_load.c: Likewise. + * tests/keyctl.c: Likewise. + * tests/lookup_dcookie.c: Likewise. + * tests/lseek.c: Likewise. + * tests/mq_sendrecv.c: Likewise. + * tests/nsyscalls.c: Likewise. + * tests/pkey_alloc.c: Likewise. + * tests/pkey_free.c: Likewise. + * tests/pkey_mprotect.c: Likewise. + * tests/prctl-pdeathsig.c: Likewise. + * tests/prctl-tsc.c: Likewise. + * tests/preadv2-pwritev2.c: Likewise. + * tests/process_vm_readv_writev.c: Likewise. + * tests/read-write.c: Likewise. + * tests/setfsugid.c: Likewise. + * tests/setns.c: Likewise. + * tests/truncate.c: Likewise. + * tests/unshare.c: Likewise. + * tests/xgetrlimit.c: Likewise. + +2016-12-15 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.15-1. + * strace.spec.in: Likewise. + +2016-12-14 Dmitry V. Levin + + xlat: provide fallback definitions for NETLINK_* constants. + As new constants have been added gradually over kernel releases, define + all constant values to make newer constants decoded properly when strace + is built with older kernel headers. + + * xlat/netlink_protocols.in: Add default values for constants. + * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]: Remove. + * socketutils.c: Likewise. + +2016-12-14 Dmitry V. Levin + + tests: relax getaffinity return value check in tests/sched_xetaffinity.c + * tests/sched_xetaffinity.c (errstr): New variable. + (getaffinity, setaffinity): Initialize it. + (main): Use it. Allow getaffinity return value to be less than + its cpusetsize argument. + + tests: fix threads-execve.test for large pids. + * tests/threads-execve.c (main): Fix expected output for large pids. + +2016-12-13 Dmitry V. Levin + + Prepare for 4.15 release. + * NEWS: Update for 4.15 release. + + .mailmap: add addresses of Thomas De Schampheleire. + * .mailmap: Add both addresses of Thomas De Schampheleire here to avoid + duplications in CREDITS file. + + Sync strace.spec and debian/ with packages. + * debian/control: Add Vcs-* metadata from 4.13-0.1. + * debian/watch: Sync with 4.13-0.1. + * strace.spec.in: Sync with 4.14.0.100.622a-1. + +2016-12-13 Dmitry V. Levin + + tests: workaround a bug in GNU grep. + Workaround a bug introduced in GNU grep 2.27, for details see + https://lists.gnu.org/archive/html/bug-grep/2016-12/msg00011.html + + * tests/init.sh (grep_pid_status): New function. + * tests/detach-running.test: Use it instead of grep to search + in /proc/$pid/status. + * tests/detach-sleeping.test: Likewise. + * tests/detach-stopped.test: Likewise. + +2016-12-13 Eugene Syromyatnikov + + tests: fix typo in comment inside prctl-tsc.c. + +2016-12-13 Sean Stangl + Dmitry V. Levin + + Fix libunwind segfault when -p is passed before -k. + * strace.c (init) [USE_LIBUNWIND]: Call unwind_tcb_init after + unwind_init for all allocated tcb structures if stack trace is enabled. + * unwind.c (unwind_tcb_init): Skip if tcb is already initialized. + +2016-12-13 Eugene Syromyatnikov + Dmitry V. Levin + + Update NEWS. + +2016-12-07 Dmitry V. Levin + + tests: skip fault injection tests on unsupported platforms. + * tests/fault_injection.sh: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/fault_injection-exit_group.test: Use it. + * tests/fault_injection.test: Likewise. + + tests: introduce require_min_kernel_version_or_skip function. + * tests/init.sh (kernel_version_code, + require_min_kernel_version_or_skip): New functions. + * tests/threads-execve.test: Use require_min_kernel_version_or_skip. + +2016-12-07 Eugene Syromyatnikov + + tests: add descriptions to prctl-pdeathsig and prctl-tsc tests. + +2016-12-07 Dmitry V. Levin + + tests: robustify prctl-pdeathsig.test and prctl-tsc.test. + Rrobustify remaining prctl tests against unrelated prctl invocations + + * tests/prctl-pdeathsig.test: Filter out unrelated PR_GET_* and PR_SET_* + prctl calls. + * tests/prctl-tsc.test: Likewise. + +2016-12-07 Thomas De Schampheleire + + Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD. + Commit dc427d50d96b15c9a64d7e78d97ce4d194622a63 enabled a number of extra + warning flags through configure.ac. The configure script will determine + dynamically if CC supports these flags before adding them to WARN_CFLAGS. + + ioctlsort is compiled with CC_FOR_BUILD, rather than CC. Nevertheless, + the flags passed to this compilation also include WARN_CFLAGS (through + AM_CFLAGS). This is incorrect: in a cross-compilation use case, CC + and CC_FOR_BUILD are not the same. The former is the cross-compiler, + the latter is the host compiler. Both may be of different versions + and support different warning flags. + + In particular, this posed a problem when cross-compiling with a host + compiler gcc 4.1, which does not support all the new flags: + + /usr/bin/gcc -DHAVE_CONFIG_H -I./linux/arm -I./linux/arm -I./linux + -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body + -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op + -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration + -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 + -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o + ioctlsort0.o ./ioctlsort.c + cc1: error: unrecognized command line option "-Wempty-body" + cc1: error: unrecognized command line option "-Wignored-qualifiers" + cc1: error: unrecognized command line option "-Wlogical-op" + cc1: error: unrecognized command line option "-Wmissing-parameter-type" + cc1: error: unrecognized command line option "-Wold-style-declaration" + cc1: error: unrecognized command line option "-Wtype-limits" + make[2]: *** [ioctlsort0.o] Error 1 + + * Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New + variables. + (ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS. + (ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS. + (ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS. + * m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect + WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS, + substitute WARN_CFLAGS_FOR_BUILD. + +2016-12-07 Dmitry V. Levin + + m4: prepare gl_WARN_ADD for simultaneous use of multiple compilers. + * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Change gl_Flags to use + _AC_LANG_PREFIX[]FLAGS in unquoted form. Change gl_Warn to use gl_Flags + instead of _AC_LANG_ABBREV. Change notification message to mention + the variable name of the compiler. + (gl_UNKNOWN_WARNINGS_ARE_ERRORS): Do nothing if + gl_unknown_warnings_are_errors is set. + (gl_WARN_ADD): Change the use of gl_UNKNOWN_WARNINGS_ARE_ERRORS from + AC_REQUIRE to a regular call. + +2016-12-07 Dmitry V. Levin + + AX_PROG_CC_FOR_BUILD: redirect more variables related to C compiler. + Some of these variables cannot be redirected using traditional + pushdef/popdef mechanism because of complex constructions like + [ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu] employed by autoconf macros. + Use st_SAVE_VAR/st_RESTORE_VAR to workaround this issue. + + * m4/ax_prog_cc_for_build.m4: Redirect ac_cv_prog_cc_stdc, + ac_cv_prog_cc_c11, ac_cv_prog_cc_c99, ac_cv_prog_cc_c89, + am_cv_prog_cc_c_o, and am_cv_CC_dependencies_compiler_type using + pushdef/popdef. + Redirect ac_c_decl_warn_flag, ac_c_preproc_warn_flag, ac_c_werror_flag, + ac_compile, ac_compiler_gnu, ac_cpp, ac_cv_c_compiler_gnu, + ac_cv_c_decl_report, and ac_link using st_SAVE_VAR/st_RESTORE_VAR. + +2016-12-07 Dmitry V. Levin + + Move all gl_WARN_ADD calls to a separate m4 macro. + This is going to be needed for the upcoming AX_PROG_CC_FOR_BUILD + change. + + * configure.ac: Call st_WARN_CFLAGS before AX_PROG_CC_FOR_BUILD. + Move all gl_WARN_ADD calls ... + * m4/st_warn_cflags.m4: ... here. + +2016-12-07 Dmitry V. Levin + + m4: introduce st_SAVE_VAR and st_RESTORE_VAR macros. + These new macros are going to be needed for the upcoming + AX_PROG_CC_FOR_BUILD change. + + * m4/st_save_restore_var.m4: New file. + +2016-12-06 Dmitry V. Levin + + tests: add valgrind support to "make check" + * m4/ax_valgrind_check.m4: Import from the autoconf-archive package. + * configure.ac: Invoke AX_VALGRIND_CHECK. + * valgrind.supp: Move to tests/strace.supp. + * Makefile.am (EXTRA_DIST): Remove valgrind.supp. + * tests/Makefile.am: Add @VALGRIND_CHECK_RULES@. + (VALGRIND_FLAGS, VALGRIND_SUPPRESSIONS_FILES): New variables. + (EXTRA_DIST): Add strace.supp. + * tests/init.sh: Add valgrind command prefix to $STRACE when appropriate. + +2016-12-06 Dmitry V. Levin + + tests: robustify threads-execve.test against race conditions. + Due to probabilistic nature of the test, try it several times. + + * tests/threads-execve.c (NUMBER_OF_ITERATIONS): Change to 1. + * tests/threads-execve.test: Iterate up to 10 times. + +2016-12-06 Dmitry V. Levin + + tests: fix expected output in strace-ttt.test. + If strace -ttt is running too long, it might happen that time stamps + before and after its invocation differ for more than a second. + Adjust expected output to handle this rare but possible case. + + * tests/strace-ttt.test: Allow any time stamp between start and finish + of strace invocation. + +2016-12-06 Dmitry V. Levin + + tests: fix expected output in strace-tt.test. + If strace -tt is running too long, it might happen that time stamps + before and after its invocation differ for more than a second. + Adjust expected output to handle this rare but possible case. + + * tests/strace-tt.test: Allow any time stamp between start and finish + of strace invocation. + +2016-12-06 Dmitry V. Levin + + tests: robustify redirect.test against race conditions. + Introduce a synchronization mechanism between the tracee and its peer. + + * tests/redirect.test: Change timeout file to $OUT. Let the tracee + remove $LOG, wait for $LOG removal in its peer. + +2016-12-06 Dmitry V. Levin + + tests: robustify attach-f-p.test against race conditions. + Introduce a synchronization mechanism between attach-f-p and strace. + + * tests/attach-f-p-cmd.c: New file. + * tests/Makefile.am (check_PROGRAMS): Add attach-f-p-cmd. + * tests/attach-f-p.c: Include . + (main): Write to stdout instead of descriptor 3. Wait for the peer + writing to stdout. + * tests/attach-f-p.test: Assume that ./attach-f-p-cmd works. + Use $OUT for expected output. Use attach-f-p-cmd for unlocking $OUT. + +2016-12-06 Dmitry V. Levin + + tests: robustify attach-p-cmd.test against race conditions. + Introduce a synchronization mechanism between attach-p-cmd-p + and attach-p-cmd-cmd processes. + + * tests/attach-p-cmd-cmd.c: Include and . + (main): Wait for the lock directory creation by attach-p-cmd-p. + * tests/attach-p-cmd-p.c: Include and . + (main): Create a lock directory and wait for its removal + by attach-p-cmd-cmd. + * tests/attach-p-cmd.test: Assume that test programs work. + +2016-12-05 Dmitry V. Levin + + Rewrite remaining qual_* parsers using bit sets. + * defs.h (struct fault_opts): Replace forward declaration + with a definition. + (qualbits_t, qualify_read, qualify_write, qualify_signals): Remove. + (qual_flags): New function prototype. + (nsyscall_vec, sysent_vec, fault_vec): New variable prototypes. + * qualify.c (abbrev_set, fault_set, raw_set, trace_set, verbose_set): + New variables. + (qualify_read, qualify_write, qualify_signals): Add static qualifier. + (find_errno_by_name, lookup_class, parse_fault_expression, + parse_fault_token, qual_flags, qualify, qualify_abbrev, qualify_fault, + qualify_raw, qualify_syscall, qualify_syscall_class, + qualify_syscall_name, qualify_syscall_number, qualify_syscall_tokens, + qualify_trace, qualify_verbose, strip_prefix): New functions. + * syscall.c (nsyscall_vec, nsysent_vec): Remove static qualifier. + (MAX_NSYSCALLS1, MAX_NSYSCALLS2, MAX_NSYSCALLS, qual_vec, qual_flags, + qual_fault, qual_syscall, qual_options, fault_opts, qualify_one, + qualify_scno, lookup_class, qualify_syscall_class, qualify_syscall_name, + qual_syscall_ex, qual_syscall, strip_prefix, find_errno_by_name, + parse_fault_token, parse_fault_expression, qual_fault, qualify): Remove. + (decode_socket_subcall, decode_ipc_subcall, decode_mips_subcall, + get_scno): Update use of qual_flags. + (inject_syscall_fault_entering): Update per-personality allocation + of tcp->fault_vec. + * tests/fault_injection-exit_group.test: Check parsing of inversed + fault sets. + * tests/fault_injection.test: Check parsing of -efault=none. + * tests/options-syntax.test: Check parsing of invalid syscall numbers. + + Change qual_vec/qual_fault into static fixed size arrays. + * defs.h (qual_vec, num_quals): Remove. + (qual_flags): Move ... + * syscall.c: ... here. + (num_quals, num_faults, MIN_QUALS, reallocate_vec, reallocate_qual, + reallocate_fault): Remove. + (qual_vec, qual_fault): Change into static fixed size arrays. + (qualify_one): Remove reallocate_qual and reallocate_fault calls. + (qualify): Likewise. Replace num_quals and num_faults with + MAX_NSYSCALLS. + + Rewrite qual_signal using bit sets. + * defs.h (signal_set): New variable prototypes. + (qualify_signals): New function prototypes. + (QUAL_SIGNAL): Change to a value greater than 0xff. + (QUAL_FAULT): Change to a lower value. + * qualify.c (signal_set): New variable. + (sigstr_to_uint, qualify_signals): New functions. + * syscall.c (qual_signal): Remove. + (qual_options): Replace qual_signal with NULL. + (qualify): Use qualify_signals. + * strace.c (print_signalled, print_stopped): Use is_number_in_set + with signal_set argument. + +2016-12-05 Dmitry V. Levin + + Rewrite qual_desc using bit sets. + As a side effect, this also fixes support of negated sets + of descriptors. + + * defs.h (struct number_set): New forward declaration. + (read_set, write_set): New variable prototypes. + (is_number_in_set, qualify_read, qualify_write): New function + prototypes. + (QUAL_READ, QUAL_WRITE): Change to values greater than 0xff. + * qualify.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * syscall.c (qual_desc): Remove. + (qual_options): Replace qual_desc with NULL. + (qualify): Use qualify_read and qualify_write. + (dumpio): Use is_number_in_set. + * tests/options-syntax.test: Check invalid sets of descriptors. + * tests/readv.test: Check dumping of negated sets of descriptors. + +2016-12-05 Dmitry V. Levin + + tests: skip redirect-fds.test when strace is wrapped with valgrind. + valgrind is not as transparent as strace wrt standard descriptors, + so if strace is wrapped with valgrind, the test would check valgrind + transparency properties and fail imminently. + + * tests/redirect-fds.test: Skip the test when $STRACE shows a presence + of valgrind. + +2016-12-05 Dmitry V. Levin + + Add valgrind.supp. + As valgrind is not quite happy about the way how get_cpuset_size uses + sched_getaffinity, add a suppression file for this case. + + * valgrind.supp: New file. + * Makefile.am (EXTRA_DIST): Add it. + +2016-12-05 Dmitry V. Levin + + affinity: pass 0 as a pid to sched_getaffinity. + * affinity.c (get_cpuset_size): Pass 0 instead of getpid() + to sched_getaffinity. + + affinity: document the method of finding out the cpuset size. + * affinity.c (get_cpuset_size): Add a comment about sched_getaffinity. + +2016-12-05 Dmitry V. Levin + + tests: make options-syntax.test tolerant of strace wrappers. + Change the test to allow wrappers like STRACE="valgrind ./strace". + + * tests/options-syntax.test: Strip all words but last from $STRACE + variable in all contexts where the name of strace executable is expected + in its output. + +2016-12-04 Dmitry V. Levin + + Do not allocate memory for line buffered output. + libc is perfectly capable of allocating memory for its buffers, + so let it do its job. + + * strace.c (init): Do not allocate memory for setvbuf invocation. + +2016-12-04 Eugene Syromyatnikov + + Update NEWS. + + tests: use kernel_ulong_t as argument type in setfsuid/setfsgid tests. + * setfsugid.c: Include "kernel_types.h". + (main): Change type of entries of the "tests" array from long to + kernel_ulong_t. + +2016-12-04 Eugene Syromyatnikov + Elvira Khabirova + + uid: print size as signed in setgroups/getgroups. + As this is the type used in kernel. + + * uid.c (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Print size parameter + as "%d". + * tests/getgroups.c: Update expected output. + * tests/setgroups.c: Likewise. + +2016-12-04 Eugene Syromyatnikov + Elvira Khabirova + + uid: use printuid for printing UID/GID value. + * uid.c (setfsuid, get_print_uid, print_gid): Use printuid. + * tests/setfsugid.c (printuid): New function. + (main): Use it to print UID/GID values. + * tests/setgroups.c: Likewise. + * tests/setugid.c (ugid2int): Remove. + (printuid): New function. + (main): Use it to print UID/GID values. + +2016-12-01 Eugene Syromyatnikov + + tests: additional check for PTRACE_SETSIGINFO ptrace command. + * tests/ptrace.c (main): Add an additional PTRACE_SETSIGINFO check. + +2016-12-01 Dmitry V. Levin + + syscall_name: clear __X32_SYSCALL_BIT from syscall number on x32. + * linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): New macro. + * syscall.c (syscall_name) [X32_PERSONALITY_NUMBER && __X32_SYSCALL_BIT]: + Clear __X32_SYSCALL_BIT from scno on x32 personality. + +2016-12-01 Eugene Syromyatnikov + + Print syscall names only for defined syscalls. + The string literal "__NR_syscall_4294967295" is semantically incorrect + as there is no such constant defined. + + * syscall.c (syscall_name): Return NULL if there is no syscall + corresponding to the given number. + * defs.h (syscall_name): Document this behaviour. + * printsiginfo.c (print_si_info): Print syscall name with "__NR_" prefix + only if there is a syscall corresponding to si_syscall number; print + a plain syscall number otherwise. + * tests/ptrace.c (main): Update expected output. + +2016-12-01 Eugene Syromyatnikov + + affinity: print cpu set as an array. + * affinity.c: Add comma between elements of cpu set. + * tests/sched_xetaffinity.c (main): Update expected output. + + statfs: fix printing format of f_fsid field. + * print_statfs.c: Print f_fsid as a structure containing field "val" + which, in turn, is an array of two elements that used to be printed + as members of f_fsid structure. + * tests/statfs.expected: Update expected output. + * tests/xstatfsx.c (print_statfs): Likewise. + + swap: always print priority value. + * swapon.c (SYS_FUNC(swapon)): Do not check for non-zero the value + of the prio variable in order to print it. + * tests/swap.c (main): Update expected output. + +2016-12-01 Elvira Khabirova + + tests: show pattern line number in match_grep. + This makes debugging of failing test a bit easier. + + * tests/init.sh (match_grep): Add the cnt variable, increment it on every + pattern line read, print it as a prefix for non-matched pattern. + +2016-11-30 Eugene Syromyatnikov + Elvira Khabirova + + futex: make output of the val3 argument of the FUTEX_WAKE_OP command more structured + It is a number which consists of several xlat values, not a structure. + + * futex.c (SYS_FUNC(futex)): Modify output of the val3 argument + of the FUTEX_WAKE_OP futex syscall command. + * tests/futex.c (main): Update expected output. + +2016-11-30 Eugene Syromyatnikov + + tests: additional checks for prctl-* tests. + * tests/prctl-pdeathsig.c (main): Additional checks. + * tests/prctl-tsc.c (main): Likewise. + * tests/prctl-pdeathsig.test: Update value of -a argument. + * tests/prctl-tsc.test: Likewise. + +2016-11-30 JingPiao Chen + + tests: add prctl-pdeathsig.test and prctl-tsc.test. + * tests/prctl-pdeathsig.c: New file. + * tests/prctl-tsc.c: Likewise. + * tests/prctl-pdeathsig.test: New test. + * tests/prctl-tsc.test: Likewise. + * tests/.gitignore: Add prctl-pdeathsig and prctl-tsc. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-pdeathsig.test and prctl-tsc.test. + +2016-11-30 Dmitry V. Levin + + syscall: Simplify strip_prefix. + * syscall.c (strip_prefix): Use strncmp instead of strlen+memcmp. + + util: fix integer overflow check in string_to_uint_ex. + * util.c (string_to_uint_ex): Fix the check for integer overflow + on systems where LONG_MAX == INT_MAX. + + Check dumping of io syscalls when descriptor arguments are sensibly large + * tests/tests.h (pipe_maxfd): New prototype. + * tests/pipe_maxfd.c: New file. + * tests/print_maxfd.c: Likewise. + * tests/.gitignore: Add print_maxfd. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (libtests_a_SOURCES): Add pipe_maxfd.c. + * tests/readv.c (main): Use pipe_maxfd() instead of pipe(), + fds[0] instead of 0, fds[1] instead of 1. + * tests/readv.test: Use print_maxfd to specify dump descriptor numbers. + + dumpio: remove useless check. + * syscall.c (dumpio): Remove SEN_printargs check. Use tcp->s_ent->sen + directly. + +2016-11-29 Dmitry V. Levin + + Fix dumping of io syscalls when descriptor argument has unused bits set. + * syscall.c (dumpio): Explicitly cast the first argument of syscall + to "int", the same way as the kernel does. + * tests/read-write.c: Include and "kernel_types.h". + (k_read, k_write): New functions. + (test_dump, main): Use them. + + x32: fix preadv2-pwritev2.test. + * tests/preadv2-pwritev2.c: Include "kernel_types.h". + (main): Use kernel_ulong_t instead of unsigned long as types + of arguments of preadv2 and pwritev2 syscalls. + + x32: wire up preadv2 and pwritev2 syscalls. + * linux/x32/syscallent.h [546]: Add preadv2 entry. + [547]: Add pwritev2 entry. + +2016-11-29 Eugene Syromyatnikov + Elvira Khabirova + + signal: fix omission of field names in sigaction printers. + * signal.c (decode_old_sigaction, decode_new_sigaction): Add printing + of the field names. + * tests/sigaction.awk: Update expected output. + +2016-11-29 Elvira Khabirova + + Make date output format conform to ISO 8601. + * util.c (sprinttime): Make date output conform to ISO 8601. + * tests/utime.c (print_tm): Update expected output. + * tests/xstatx.c (print_time): Likewise. + +2016-11-29 Dmitry V. Levin + + tests: rewrite utime.test without relying on libc utime wrapper. + * tests/utime.c (k_utime): New function, a thin wrapper around + syscall(__NR_utime). + (main): Use it instead of utime. + * tests/utime.test: Update. + +2016-11-29 Dmitry V. Levin + + Fix meaning of negated sets in fault expressions. + Change the parser of fault expression to follow the POLA: + -e fault=!SET + means that all syscalls except those from SET are subject to fault + injection; + -e fault=!SET1:error=ERRNO1, -e fault=!SET2:error=ERRNO2 + means that all syscalls except those from SET2 are subject to fault + injection with error code ERRNO2, and all syscalls from SET2 that are + not in SET1 are subject to fault injection with error code ERRNO1. + + * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name): + Handle negated QUAL_FAULT case differently. + * tests/fault_syntax.test: Add checks of negated sets. + +2016-11-29 Eugene Syromyatnikov + + print_sigevent: fix field names of sigev_value structure. + * print_sigevent.c (print_sigevent): Change "int" to "sival_int", "ptr" + to "sival_ptr". + * tests/mq_sendrecv.c (main): Update expected output in accordance with + fixed field names. + * tests/timer_create.c (main): Likewise. + + tests: add more utime checks. + * tests/utime.c: Include and . + (main): Add checks for invalid pointers. + + utime: fix omission of field names in utimbuf structure printing. + * utime.c (SYS_FUNC(utime)): Print struct utimbuf as a structure, + not as an array (use curly brackets instead of square ones). + Add field names to the output. + * tests/utime.c (main): Update expected output. + + mem: print mincore output as an array. + * mem.c (SYS_FUNC(minore)): Print commas between elements. + * tests/mincore.c (print_mincore): Update expected output in accordance + with syscall decoder formatting change. + +2016-11-29 Eugene Syromyatnikov + + util: provide information whether xlat value has been found. + This is necessary for the upcoming change in the output format + of the val3 argument of the FUTEX_WAKE_OP futex command. + + * defs.h (printxvals, printxval_searchn): Change return type to int. + (printxval64, printxval, printxval_long): Likewise. Forward the value + returned by printxvals call. + * util.c (printxvals, printxval_searchn): Change return type to int, + return 1 if xlat value has been found, 0 otherwise. + +2016-11-29 Eugene Syromyatnikov + + util: check dflt argument for NULL in printxvals. + This is necessary for the upcoming change in the output format + of the val3 argument of the FUTEX_WAKE_OP futex command. + + * util.c (printxvals): Do not print dflt if it is NULL. + +2016-11-29 Eugene Syromyatnikov + + capability: fix omission of capability structure field names. + * capability.c (print_cap_header, print_cap_data): Add field names + to the output. + * tests/caps.awk: Update test output. + +2016-11-28 Dmitry V. Levin + + tests: fix "comparison between signed and unsigned" compilation warnings + * tests/readv.c (main): Cast r_len to int. + * tests/preadv2-pwritev2.c (dumpio): Likewise. + + aarch64, arm, sparc: add comments on fault injection support in kernel. + * linux/aarch64/set_scno.c: Note the kernel commit that introduced + NT_ARM_SYSTEM_CALL support. + * linux/arm/set_scno.c: Note the kernel commit that introduced + PTRACE_SET_SYSCALL support. + * linux/sparc/set_scno.c: Note the kernel commit that introduced + reloading from the syscall number register. + + tests: check -C option. + * tests/strace-C.expected: New file. + * tests/strace-C.test: New test. + * tests/Makefile.am (MISC_TESTS): Add strace-C.test. + (EXTRA_DIST): Add strace-C.expected. + + tests: check basic options syntax. + * tests/options-syntax.test: New file. + * tests/Makefile.am (MISC_TESTS): Add it. + +2016-11-28 Dmitry V. Levin + + Fix -r option syntax. + While -r option implies -t, it should not literally have the effect + of -t option, e.g. -rr should not increment tflag twice. + + * strace.c (init): In the getopt loop, do not increment tflag for each + occurrence of -r option. After the getopt loop, if rflag is set, set + tflag to 1. Issue a warning that -tt has no effect with -r. + +2016-11-28 Eugene Syromyatnikov + + Print timeval pair as an array of timeval entries. + * print_timeval.c (print_timeval_item): New function. + (print_timeval_pair): Use it as a print_function in print_array call. + * tests/futimesat.c (main): Update to test new behaviour. + * tests/utimes.c (main): Likewise. + + tests: treat tv_sec/tv_usec as signed types in futimesat and utimes tests + * tests/futimesat.c: Print tv_sec and tv_usec fields as signed types. + * tests/utimes.c: Likewise. + +2016-11-28 Dmitry V. Levin + + alpha: print struct timeval32 consistently. + * defs.h [ALPHA] (timeval32_t): New type. + [ALPHA] (print_timeval32_t): New prototype. + * print_timeval.c [ALPHA] (timeval32_t): Remove. + [ALPHA] (print_timeval32_t): Remove static keyword. + * printrusage.c [ALPHA] (printrusage32): Use timeval32_t instead + of local definition of struct timeval32. Use print_timeval32_t. + +2016-11-28 Dmitry V. Levin + + Print struct timeval consistently. + Use print_struct_timeval interface to print struct timeval. + + * print_timeval.c (print_struct_timeval): New mpers printer. + * print_timex.c (print_timex): Use it. + * printrusage.c (printrusage): Likewise. + * v4l2.c (print_v4l2_buffer): Likewise. + * tests/getrusage.c (main): Print tv_sec and tv_usec fields as signed. + * tests/waitid.c (sprint_rusage): Likewise. + + Suggested-by: Eugene Syromyatnikov + +2016-11-28 Dmitry V. Levin + + Split print_time.c. + After commit v4.14-136-g151d1d1 that removed the last object common + for timespec and timeval parsers there is no need to keep them all + in a single file. + + * print_timespec.c: New file. + * print_timeval.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * print_time.c: Move all timespec related code to print_timespec.c. + Move all timeval related code to print_timeval.c. + +2016-11-28 Dmitry V. Levin + + tests: check decoding of threads when a non-leader thread invokes execve + * tests/threads-execve.c: New file. + * tests/threads-execve.test: New test. + * tests/.gitignore: Add threads-execve. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (threads_execve_LDADD): New variable. + (MISC_TESTS): Add threads-execve.test. + +2016-11-27 Dmitry V. Levin + + tests: check decoding of fault injected exit_group syscall. + * tests/answer.c: New file. + * tests/fault_injection-exit_group.expected: Likewise. + * tests/fault_injection-exit_group.test: New test. + * tests/.gitignore: Add answer. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fault_injection-exit_group.test. + (EXTRA_DIST): Add fault_injection-exit_group.expected. + +2016-11-27 Dmitry V. Levin + + Set PTRACE_O_TRACEEXIT option and handle PTRACE_EVENT_EXIT events. + Do not assume that some syscalls do not generate syscall-exit-stops. + When syscalls fail for any reason they may generate syscall-exit-stops. + + The solution is to wait for an actual exit reported by PTRACE_EVENT_EXIT + and print the end of unfinished exiting syscall properly. + + * exit.c: Remove. + * Makefile.am (strace_SOURCES): Remove exit.c. + * linux/dummy.h (sys_exit): Alias to printargs_d. + * strace.c (ptrace_setoptions): Add PTRACE_O_TRACEEXIT bit. + (print_event_exit): New function. + (trace): Use it in case of PTRACE_EVENT_EXIT. + * syscall.c (trace_syscall_entering): Remove special handling + of SEN_exit. + +2016-11-27 Dmitry V. Levin + + Change printargs to return RVAL_DECODED. + As printargs is invoked as a generic syscall decoder only and + it is not supposed to print anything on exiting, change printargs + to return RVAL_DECODED so it would not be called on exiting at all. + + * util.c (printargs): Print args unconditionally, return RVAL_DECODED. + +2016-11-26 Dmitry V. Levin + + Enhance error diagnostics of exit/exit_group decoder. + * exit.c (SYS_FUNC(exit)): Print the name of syscall that has returned. + +2016-11-26 Dmitry V. Levin + + Restrain from fault injection while the trace executes strace code. + There is little use in injections of faults into syscalls made by strace. + + * syscall.c (trace_syscall_entering): Clear QUAL_FAULT bit from + tcp->qual_flg when tcp->flags has TCB_HIDE_LOG bit set. + +2016-11-26 Dmitry V. Levin + + Move two global flags to tracee scope. + A simultaneous use of -p option and tracing of a command available + since commit v4.11-183-gfa8c286 introduces a race condition because + the flags whether the first exec has happened are global. + + Fix the race by moving hide_log_until_execve and hide_log_until_execve + global variables to TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits + in struct tcb.flags, correspondingly. + + * defs.h (TCB_HIDE_LOG, TCB_SKIP_DETACH_ON_FIRST_EXEC, hide_log): + New macros. + (hide_log_until_execve): Remove prototype. + * strace.c (skip_one_b_execve, hide_log_until_execve): Remove. + (startup_child): Set TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits + in the allocated tcb structure. + (init): Remove initialization of hide_log_until_execve and + skip_one_b_execve. + (print_stopped): Use hide_log() instead of hide_log_until_execve. + (trace): Check and clear TCB_SKIP_DETACH_ON_FIRST_EXEC flag instead + of skip_one_b_execve. + * syscall.c (trace_syscall_entering): Clear TCB_HIDE_LOG flag instead of + hide_log_until_execve. + (trace_syscall_entering, trace_syscall_exiting): Check hide_log() + instead of hide_log_until_execve. + +2016-11-26 Dmitry V. Levin + + Treat execveat as an execve family syscall. + * syscall.c (trace_syscall_entering): Clear hide_log_until_execve flag + also when SEN_execveat is encountered. + +2016-11-25 Dmitry V. Levin + + Change parser of fault expressions to conform the documentation. + Make expressions like fault=SYSCALL1,SYSCALL2:error=EPERM work + as documented, i.e. fail both SYSCALL1 and SYSCALL2 with EPERM. + + * syscall.c (parse_fault_expression): Remove const qualifier from + "name" and "token: variables, as well as from the return value. + (qual_fault): Remove const qualifier from "name" variables. + Split "name" into comma delimited tokens and pass each token + to individual qual_syscall_ex call. + (qualify): For QUAL_FAULT options, pass the whole option value + to their qualify methods without prior splitting into comma + delimited tokens. + * tests/fault_injection.test: Check it. + * tests/fault_syntax.test: Check empty syscall sets. + +2016-11-24 Dmitry V. Levin + + Simplify parse_fault_expression. + * syscall.c (parse_fault_expression): Rewrite iterator over strtok_r + in a more concise way. + +2016-11-26 Eugene Syromyatnikov + + Fix omission of field names in printers of timeval structure. + * print_time.c (time_fmt): Remove. + (timeval_fmt): New constant. + (print_timeval_t, sprint_timeval, print_timeval32_t, sprint_timeval32): + Use it instead of time_fmt. + * print_timex.c (print_timex): Print field names of the time field. + * printrusage.c (printrusage, printrusage32): Print field names + of ru_utime and ru_stime fields. + * tests/adjtimex.c (main): Add field names to expected output. + * tests/clock_nanosleep.c (main): Likewise. + * tests/futimesat.c (main): Likewise. + * tests/getrusage.c (main): Likewise. + * tests/nanosleep.c (main): Likewise. + * tests/oldselect.expected: Likewise. + * tests/utimes.c (main): Likewise. + * tests/wait4.c (sprint_rusage): Likewise. + * tests/waitid.c (sprint_rusage): Likewise. + * tests/xetitimer.c (main): Likewise. + * tests/xettimeofday.c (main): Likewise. + * tests/xselect.c (main): Likewise. + + Fix omission of field names in printers of timespec structure. + * print_time.c (timespec_fmt): New constant. + (print_timespec_t, sprint_timespec): Use it instead of time_fmt. + * tests/aio.c: Add field names to expected output. + * tests/clock_nanosleep.c (main): Likewise. + * tests/clock_xettime.c (main): Likewise. + * tests/futex.c (main): Likewise. + * tests/mq_sendrecv.c (do_send, do_recv): Likewise. + * tests/nanosleep.c (main): Likewise. + * tests/ppoll-v.expected: Likewise. + * tests/ppoll.expected: Likewise. + * tests/pselect6.c (main): Likewise. + * tests/recvmmsg-timeout.c (main): Likewise. + * tests/restart_syscall.c (main): Likewise. + * tests/rt_sigtimedwait.c (iterate, main): Likewise. + * tests/sched_rr_get_interval.c (main): Likewise. + * tests/semop.c (main): Likewise. + * tests/strace-T.expected: Likewise. + * tests/timer_xettime.c (main): Likewise. + * tests/timerfd_xettime.c (main): Likewise. + * tests/utimensat.c (print_ts): Likewise. + +2016-11-26 Dmitry V. Levin + + tests: robustify prctl-name.test against unrelated prctl invocations. + * tests/prctl-name.test: Filter out unrelated PR_GET_* prctl calls. + +2016-11-22 Dmitry V. Levin + + tests: cleanup prctl-name.c. + * tests/prctl-name.c (main): Remove "len" variable, rename "len1" + to "len". Remove "name1" variable, use "name" instead. + + Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h. + * linux/32/ioctls_inc_align32.h: Regenerate. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/arm/ioctls_arch0.h: Likewise. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390/ioctls_arch0.h: Likewise. + * linux/s390x/ioctls_arch0.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + + maint: add more workarounds for alpha and powerpc. + * maint/ioctls_sym.sh: Skip asm/core_*.h. Filter out from + asm-generic/ioctls.h those macros that are defined using unavailable + struct termios2 on alpha and powerpc. + +2016-11-22 Andreas Schwab + + Add ioctl definitions for 16-bit alignment. + * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align16.h. + * linux/32/ioctls_inc_align16.h: New file. + * linux/32/ioctls_inc.h [M68K]: Include it. + +2016-11-22 Dmitry V. Levin + + maint: move KVM_* constants from ioctls_inc.h to ioctls_arch.h. + * maint/ioctls_gen.sh: Place constants defined in linux/kvm.h + into ioctls_arch.h instead of ioctls_inc.h. + +2016-11-21 Dmitry V. Levin + + maint: harmonize use of ioctls_sym.sh. + * maint/ioctls_gen.sh: Consistently specify INCLUDES for all + ioctls_sym.sh invocations. Use $mydir to specify ioctls_sym.sh + location. + + maint: rework workarounds for linux/kvm.h. + * maint/ioctls_sym.sh: Remove pre-include linux/kvm.h workarounds. + Skip linux/kvm.h on those architectures that have no asm/kvm.h file. + Introduce post-process workarounds, add post-process workarounds + for linux/kvm.h. + +2016-11-20 Elvira Khabirova + + Restructure strace.1. + * strace.1 (OPTIONS): Add subsections. + (PROBLEMS): Rename to REPORTING BUGS. + (SEE ALSO): Move to the bottom. + +2016-11-20 Eugene Syromyatnikov + + prctl: implement decoding of PR_SET_FP_MODE and PR_GET_FP_MODE options. + * xlat/pr_fp_mode.in: New file. + * prctl.c: Include "xlat/pr_fp_mode.h". + (SYS_FUNC(prctl)): Add handling for PR_SET_FP_MODE and PR_GET_FP_MODE + options. + + prctl: add braces for conditional blocks with else/else-if blocks having braces + +2016-11-20 Eugene Syromyatnikov + + prctl: cast arg2 to int in PR_SET_PTRACER handler. + Kernel code does this when compares it with -1 (apart from comparing it with + PR_SET_PTRACER_ANY, which is also -1) in security/yama/yama_lsm.c. + + * prctl.c (SYS_FUNC(prctl)) : Cast arg2 to int before + comparing it with -1. + +2016-11-20 Eugene Syromyatnikov + + prctl: use getarg_ull for option value retrieval. + The prctl syscall does not use compat on x32/n32, so argument types + are in fact kernel_ulong_t. + + * prctl.c (print_prctl_args): Use getarg_ull, print as "%#llx" instead + of "%#lx". + (SYS_FUNC(prctl)): Use getarg_ull to store call arguments in arg2, arg3, + arg4, arg5 variables of type unsigned long long. Use them in printing + routines. + (SYS_FUNC(arch_prctl)): Use getarg_ull to store call argument in addr + variable of type unsigned long long. Print it as "%#llx" instead of + "%#lx". + +2016-11-20 Eugene Syromyatnikov + + block: add some definitions from + This is done in order to fix build error on old distributions where + struct blkpg_ioctl_arg declaration is broken: + + In file included from block.c:35: + /usr/include/linux/blkpg.h:36: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token + block.c: In function 'print_blkpg_req': + block.c:113: error: 'struct_blkpg_ioctl_arg' has no member named 'data' + + (from SLE10) + + * block.c: Include instead of . + (BLKPG, BLKPG_DEVNAMELTH, BLKPG_VOLNAMELTH): New macros. + (struct_blkpg_ioctl_arg, struct_blkpg_partition): New definitions, + copied from blkpg_ioctl_arg and blkpg_partition structures defined + in . + +2016-11-20 Eugene Syromyatnikov + + xlat: add values to new ARCH_* constants. + Since UAPI header declares them under CONFIG_CHECKPOINT_RESTORE + and they would never be defined in user space. + + * xlat/archvals.in: Add numeric values to ARCH_MAP_VDSO_* constants. + +2016-11-20 Dmitry V. Levin + + prctl: include instead of + There are no users of prctl function in prctl.c, and all the rest + is provided by anyway. + + * prctl.c: Include instead of . + +2016-11-20 Dmitry V. Levin + + tests: check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. + * tests/prctl-name.c: New file. + * tests/prctl-name.test: New test. + * tests/.gitignore: Add prctl-name. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-name.test. + + prctl: fix printing of PR_SET_NAME's argument. + * prctl.c (SYS_FUNC(prctl)): Use printstr_ex with QUOTE_0_TERMINATED + instead of printstr to print the argument of PR_SET_NAME and PR_GET_NAME + operations. + + printstr_ex: fix handling of last byte when QUOTE_0_TERMINATED bit set. + * util.c (printstr_ex): Simplify handling of size == 0 case. + Do not artificially decrement size when QUOTE_0_TERMINATED bit is set. + Ensure that str[size] byte is non-zero if it hasn't been fetched. + +2016-11-19 Dmitry V. Levin + + printstr_ex: handle QUOTE_0_TERMINATED bit consistently. + When user_style has QUOTE_0_TERMINATED bit set, printstr_ex prints + the fetched string as a NUL-terminated. + After this change, the string is being fetched as a NUL-terminated, too. + + * util.c (printstr_ex): Use umovestr instead of umoven + if QUOTE_0_TERMINATED bit is set. + +2016-11-19 Dmitry V. Levin + + Cleanup fetch part of printstr_ex. + * util.c (printstr_ex): Initialize "style" early, unify error handling. + +2016-11-18 Dmitry V. Levin + + Update prctl ARCH_* constants. + * xlat/archvals.in: Add ARCH_MAP_VDSO_X32, ARCH_MAP_VDSO_32, and + ARCH_MAP_VDSO_64 introduced by linux kernel commit v4.9-rc1~155^2~6. + + Update V4L2_* constants. + * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_TOUCH introduced + by linux kernel commit v4.9-rc4~7^2~422. + * xlat/v4l2_input_types.in: Add V4L2_CAP_TOUCH introduced + by linux kernel commit v4.9-rc4~7^2~422. + + Update fs *_MAGIC constants. + * xlat/fsmagic.in: Add DAXFS_MAGIC introduced by linux kernel commit + v4.9-rc1~45^2^2~5. + + Update MS_* constants. + * xlat/mount_flags.in: Add MS_NOREMOTELOCK introduced + by linux kernel commit v4.9-rc1~57^2~1^2~7. + + Update FALLOC_* constants. + * xlat/falloc_flags.in: Add FALLOC_FL_UNSHARE_RANGE introduced + by linux kernel commit v4.9-rc1~31^2~69. + + Update BTRFS_* constants. + * xlat/btrfs_features_compat_ro.in: Add + BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID introduced + by linux kernel commit v4.9-rc1~7^2^2~4. + + Update BPF_* constants. + * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_PERF_EVENT introduced + by linux kernel commit v4.9-rc1~127^2~302^2~4. + +2016-11-18 Eugene Syromyatnikov + + make-dist: use HEAD for making distribution package. + * make-dist: Use HEAD commit instead of master branch by default. + +2016-11-18 Dmitry V. Levin + + tests: fix btrfs build error on some old systems. + Fix the following build error on SLE 11 SP4: + + btrfs.c: In function 'btrfs_test_dev_replace_ioctl': + btrfs.c:1570: error: unknown field 'start' specified in initializer + + * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Move initialization + of struct btrfs_ioctl_dev_replace_args.start.srcdevid out of the + designated initializer. + +2016-11-18 Dmitry V. Levin + + tests: check decoding of ERESTARTSYS error code. + * tests/erestartsys.c: New file. + * tests/erestartsys.test: New test. + * tests/.gitignore: Add erestartsys. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add erestartsys.test. + +2016-11-18 Dmitry V. Levin + + Fix signame usage in qual_signal. + Do not assume that the string returned by signame starts with "SIG" + prefix, this is not always the case. + + * syscall.c (qual_signal): Skip signame return value + when it does not have "SIG" prefix. + +2016-11-18 Dmitry V. Levin + + tests: check -e signal=set syntax. + * tests/qual_signal.c: New file. + * tests/qual_signal.test: New test. + * tests/.gitignore: Add qual_signal. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add qual_signal.test. + +2016-11-17 Dmitry V. Levin + + Make -e fault= expressions cumulative. + Change the way how subsequent -e fault= expressions are interpreted + to implement a cumulative behavior. For example, + -e fault=file:when=3+ -e fault=chdir + now specifies that all chdir syscalls and 3+ file related syscalls + except chdir are subject for fault injection. + + * syscall.c (qualify): Do not reset qual_vec for QUAL_FAULT. + * tests/fault_injection.test: Check it. + +2016-11-16 Dmitry V. Levin + + tests: check syscall fault injection. + * tests/fault_injection.c: New file. + * tests/fault_injection.test: New test. + * tests/fault_syntax.test: Likewise. + * tests/.gitignore: Add fault_injection. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add fault_injection.test and fault_syntax.test. + +2016-11-16 Dmitry V. Levin + + Implement syscall fault injection. + Introduce new -e fault=EXPR syntax that can be used to specify a subset + of syscalls that are subject of syscall fault injection, an error code + that has to be injected, and a frequency of injection. + + The expression specifying syscall fault injection has the following + format: SET[:error=ERRNO][:when=FIRST[+[STEP]]] + where only SET is a required part and all the rest is optional. + + The method used to implement syscall fault injection is the following: + on entering syscall the syscall number is substituted by an invalid + syscall number -1, and on exiting syscall the error code returned by + the kernel is substituted with the error code specified in the fault + expression. + + This implementaion is based on the prototype developed + by Nahim El Atmani as a part of his GSoC 2016 strace project. + + * defs.h (struct fault_opts): New forward declaration. + (struct tcb): Add fault_vec field. + (TCB_FAULT_INJ, QUAL_FAULT): New macros. + * strace.1: Document -e fault expression syntax. + * strace.c (usage): Mention -e fault expression. + (droptcb): Deallocate fault_vec member. + * syscall.c (qual_fault, arch_set_scno, arch_set_error): New prototypes. + (qual_options): Add "fault" option. + (struct fault_opts): New structure. + (num_faults): New variable. + (fault_vec): New array. + (syscall_fault_injected, tcb_fault_opts, reallocate_fault, + find_errno_by_name, qual_syscall_ex, strip_prefix, parse_fault_token, + parse_fault_expression, qual_fault, inject_syscall_fault_entering, + update_syscall_fault_exiting): New functions. + (qual_syscall): Use qual_syscall_ex. + (qualify_one): Add argument: a pointer to struct fault_opts, all callers + changed. Copy struct fault_opts from the pointer to fault_vec. + Use reallocate_fault. + (qualify_scno, qualify_syscall_class, qualify_syscall_name): Add + argument: a pointer to struct fault_opts. + (qualify): Use reallocate_fault. Do not check "all" class for + QUAL_FAULT qualifier. + (lookup_class): Check for "all" class. + (trace_syscall_entering): Use inject_syscall_fault_entering. + (trace_syscall_exiting): Use update_syscall_fault_exiting. Clear + TCB_FAULT_INJ flag along with TCB_INSYSCALL. Print " (INJECTED)" suffix + when the syscall has been injected successfully. + [ARCH_REGS_FOR_GETREGSET && !HAVE_GETREGS_OLD] + (ptrace_setregset): New function. + (ptrace_setregset_or_setregs): Define to ptrace_setregset. + [ARCH_REGS_FOR_GETREGS && !HAVE_GETREGS_OLD] + (ptrace_setregs): New function. + (ptrace_setregset_or_setregs): Define to ptrace_setregs. + [ptrace_setregset_or_setregs] (set_regs): New function. + Include "set_scno.c" and "set_error.c" + * NEWS: Mention this enhancement. + +2016-11-16 Dmitry V. Levin + + Implement arch specific methods of changing syscall number and error code + This introduces arch_set_error and arch_set_scno functions for each + supported architecture, needed to implement syscall fault injection. + + * linux/aarch64/set_error.c: New file. + * linux/aarch64/set_scno.c: Likewise. + * linux/alpha/set_error.c: Likewise. + * linux/alpha/set_scno.c: Likewise. + * linux/arc/set_error.c: Likewise. + * linux/arc/set_scno.c: Likewise. + * linux/arm/set_error.c: Likewise. + * linux/arm/set_scno.c: Likewise. + * linux/avr32/set_error.c: Likewise. + * linux/avr32/set_scno.c: Likewise. + * linux/bfin/set_error.c: Likewise. + * linux/bfin/set_scno.c: Likewise. + * linux/crisv10/set_error.c: Likewise. + * linux/crisv10/set_scno.c: Likewise. + * linux/crisv32/set_error.c: Likewise. + * linux/crisv32/set_scno.c: Likewise. + * linux/hppa/set_error.c: Likewise. + * linux/hppa/set_scno.c: Likewise. + * linux/i386/set_error.c: Likewise. + * linux/i386/set_scno.c: Likewise. + * linux/ia64/set_error.c: Likewise. + * linux/ia64/set_scno.c: Likewise. + * linux/m68k/set_error.c: Likewise. + * linux/m68k/set_scno.c: Likewise. + * linux/metag/set_error.c: Likewise. + * linux/metag/set_scno.c: Likewise. + * linux/microblaze/set_error.c: Likewise. + * linux/microblaze/set_scno.c: Likewise. + * linux/mips/set_error.c: Likewise. + * linux/mips/set_scno.c: Likewise. + * linux/nios2/set_error.c: Likewise. + * linux/nios2/set_scno.c: Likewise. + * linux/or1k/set_error.c: Likewise. + * linux/or1k/set_scno.c: Likewise. + * linux/powerpc/set_error.c: Likewise. + * linux/powerpc/set_scno.c: Likewise. + * linux/powerpc64/set_error.c: Likewise. + * linux/powerpc64/set_scno.c: Likewise. + * linux/riscv/set_error.c: Likewise. + * linux/riscv/set_scno.c: Likewise. + * linux/s390/set_error.c: Likewise. + * linux/s390/set_scno.c: Likewise. + * linux/s390x/set_error.c: Likewise. + * linux/s390x/set_scno.c: Likewise. + * linux/sh/set_error.c: Likewise. + * linux/sh/set_scno.c: Likewise. + * linux/sh64/set_error.c: Likewise. + * linux/sh64/set_scno.c: Likewise. + * linux/sparc/set_error.c: Likewise. + * linux/sparc/set_scno.c: Likewise. + * linux/sparc64/set_error.c: Likewise. + * linux/sparc64/set_scno.c: Likewise. + * linux/tile/set_error.c: Likewise. + * linux/tile/set_scno.c: Likewise. + * linux/x32/set_error.c: Likewise. + * linux/x32/set_scno.c: Likewise. + * linux/x86_64/set_error.c: Likewise. + * linux/x86_64/set_scno.c: Likewise. + * linux/xtensa/set_error.c: Likewise. + * linux/xtensa/set_scno.c: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + +2016-11-16 Dmitry V. Levin + + cris: add syscall tables. + The incomplete CRIS support introduced by commit v4.5.18-77-gea0e6e8 + should not have been merged because it lacks essential parts, e.g. + syscall tables. + + This change adds missing syscall tables for crisv10 and crisv32. + + * linux/crisv10/syscallent.h: New file. + * linux/crisv32/syscallent.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + +2016-11-16 Dmitry V. Levin + + Introduce string_to_uint_ex and string_to_uint_upto functions. + * defs.h (string_to_uint_ex): New prototype. + (string_to_uint_upto): New function, a thin wrapper around + string_to_uint_ex. + * util.c (string_to_uint_ex): New function. + (string_to_uint): Change into a thin wrapper around string_to_uint_upto. + * strace.c (init): Use string_to_uint_upto. + * syscall.c (qualify_scno, qual_signal, qual_desc): Use + string_to_uint_upto instead of string_to_uint. + +2016-11-16 Dmitry V. Levin + + Split qual_syscall into separate functions. + Split qual_syscall into qualify_scno, qualify_syscall_class, + and qualify_syscall_name. + This might be needed later to implement syscall fault injection. + + * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name): + New functions. + (qual_syscall): Use them. + +2016-11-15 Dmitry V. Levin + + xtensa: wire up new syscalls. + * linux/xtensa/syscallent.h [342..347]: New entries. + +2016-11-14 Dmitry V. Levin + + arc: wire up new syscalls. + * linux/arc/syscallent.h [247, 248]: New entries. + +2016-11-13 Dmitry V. Levin + + tests: fix potential compilation warning in ioctl_block.c. + ioctl_block.c:48: warning: 'init_magic' defined but not used + + * tests/ioctl_block.c (init_magic): Define only for + [BLKTRACESETUP && HAVE_STRUCT_BLK_USER_TRACE_SETUP]. + +2016-11-13 Eugene Syromyatnikov + + Add support for pkey_mprotect, pkey_alloc, pkey_free syscalls. + * linux/32/syscallent.h: Add syscall entries for pkey_* calls. + * linux/64/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * mem.c (do_mprotect): New function, common handler for mprotect and + pkey_mprotect. + (SYS_FUNC(mprotect)): Convert to wrapper around do_mprotect. + (SYS_FUNC(pkey_mprotect)): New function. + * xlat/pkey_access.in: New file. + * pkeys.c: New file containing implementation of pkey_alloc and + pkey_free. + * Makefile.am: Add it. + * NEWS: Mention this enhancement. + * tests/.gitignore: Add pkey_alloc, pkey_free, and pkey_mprotect. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add pkey_alloc.test, pkey_free.test, and + pkey_mprotect.test. + * tests/pkey_alloc.c: New file. + * tests/pkey_free.c: Likewise. + * tests/pkey_mprotect.c: Likewise. + * tests/pkey_alloc.test: New test. + * tests/pkey_free.test: Likewise. + * tests/pkey_mprotect.test: Likewise. + +2016-11-13 Eugene Syromyatnikov + + tests: fix "constant is too large" compilation warnings. + alarm.c: In function 'main': + alarm.c:41: warning: integer constant is too large for 'long' type + aio.c: In function 'main': + aio.c:162: warning: integer constant is too large for 'long' type + btrfs.c: In function 'btrfs_test_sync_ioctls': + btrfs.c:202: warning: integer constant is too large for 'long' type + btrfs.c: In function 'btrfs_test_subvol_ioctls': + btrfs.c:289: warning: integer constant is too large for 'long' type + btrfs.c:290: warning: integer constant is too large for 'long' type + dup2.c: In function 'main': + dup2.c:12: warning: integer constant is too large for 'long' type + dup2.c:13: warning: integer constant is too large for 'long' type + dup3.c: In function 'main': + dup3.c:13: warning: integer constant is too large for 'long' type + dup3.c:14: warning: integer constant is too large for 'long' type + epoll_create.c: In function 'main': + epoll_create.c:12: warning: integer constant is too large for 'long' type + epoll_ctl.c: In function 'invoke_syscall': + epoll_ctl.c:14: warning: integer constant is too large for 'long' type + faccessat.c: In function 'main': + faccessat.c:13: warning: integer constant is too large for 'long' type + fchdir.c: In function 'main': + fchdir.c:12: warning: integer constant is too large for 'long' type + struct_flock.c: In function 'invoke_test_syscall': + struct_flock.c:48: warning: integer constant is too large for 'long' type + struct_flock.c: In function 'test_flock_einval': + struct_flock.c:58: warning: integer constant is too large for 'long' type + struct_flock.c:59: warning: integer constant is too large for 'long' type + fcntl64.c: In function 'test_flock64_einval': + fcntl64.c:44: warning: integer constant is too large for 'long' type + fcntl64.c:45: warning: integer constant is too large for 'long' type + fcntl.c: In function 'test_flock64_einval': + fcntl.c:44: warning: integer constant is too large for 'long' type + fcntl.c:45: warning: integer constant is too large for 'long' type + fdatasync.c: In function 'main': + fdatasync.c:12: warning: integer constant is too large for 'long' type + flock.c: In function 'main': + flock.c:13: warning: integer constant is too large for 'long' type + xstatx.c: In function 'main': + xstatx.c:255: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:290: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatx.c:294: warning: integer constant is too large for 'long' type + xstatfsx.c: In function 'main': + xstatfsx.c:113: warning: integer constant is too large for 'long' type + fsync.c: In function 'main': + fsync.c:12: warning: integer constant is too large for 'long' type + ftruncate64.c: In function 'main': + ftruncate64.c:39: warning: integer constant is too large for 'long' type + futimesat.c: In function 'main': + futimesat.c:52: warning: integer constant is too large for 'long' type + futimesat.c:59: warning: integer constant is too large for 'long' type + get_mempolicy.c: In function 'main': + get_mempolicy.c:83: warning: integer constant is too large for 'long' type + get_mempolicy.c:84: warning: integer constant is too large for 'long' type + get_mempolicy.c:85: warning: integer constant is too large for 'long' type + get_mempolicy.c:86: warning: integer constant is too large for 'long' type + getdents.c: In function 'main': + getdents.c:109: warning: integer constant is too large for 'long' type + getdents.c:110: warning: integer constant is too large for 'long' type + getdents.c:114: warning: integer constant is too large for 'long' type + getdents64.c: In function 'main': + getdents64.c:114: warning: integer constant is too large for 'long' type + getdents64.c:115: warning: integer constant is too large for 'long' type + getdents64.c:119: warning: integer constant is too large for 'long' type + xgetrlimit.c: In function 'main': + xgetrlimit.c:71: warning: integer constant is too large for 'long' type + ioctl_block.c:44: warning: integer constant is too large for 'long' type + ioctl_block.c: In function 'main': + ioctl_block.c:136: warning: integer constant is too large for 'long' type + ioctl_block.c:137: warning: integer constant is too large for 'long' type + ioctl_block.c:161: warning: integer constant is too large for 'long' type + ioctl_block.c:170: warning: integer constant is too large for 'long' type + ioctl_block.c:171: warning: integer constant is too large for 'long' type + ioctl_evdev.c:42: warning: integer constant is too large for 'long' type + ioctl_mtd.c:46: warning: integer constant is too large for 'long' type + ioctl_rtc.c:40: warning: integer constant is too large for 'long' type + ioperm.c: In function 'main': + ioperm.c:12: warning: integer constant is too large for 'long' type + ioctl_v4l2.c: In function 'main': + ioctl_v4l2.c:409: warning: integer constant is too large for 'long' type + ipc.c: In function 'ipc_call': + ipc.c:52: warning: integer constant is too large for 'long' type + kill.c: In function 'main': + kill.c:59: warning: integer constant is too large for 'long' type + kill.c:62: warning: integer constant is too large for 'long' type + kill.c:63: warning: integer constant is too large for 'long' type + kill.c:68: warning: integer constant is too large for 'long' type + linkat.c: In function 'main': + linkat.c:14: warning: integer constant is too large for 'long' type + linkat.c:15: warning: integer constant is too large for 'long' type + mbind.c: In function 'main': + mbind.c:41: warning: integer constant is too large for 'long' type + mbind.c:43: warning: integer constant is too large for 'long' type + mbind.c:44: warning: integer constant is too large for 'long' type + migrate_pages.c: In function 'main': + migrate_pages.c:41: warning: integer constant is too large for 'long' type + In file included from mkdirat.c:10: + umode_t.c: In function 'test_syscall': + umode_t.c:47: warning: integer constant is too large for 'long' type + mknod.c: In function 'call_mknod': + mknod.c:16: warning: integer constant is too large for 'long' type + mknod.c: In function 'main': + mknod.c:23: warning: integer constant is too large for 'long' type + mknod.c:49: warning: integer constant is too large for 'long' type + mknod.c:56: warning: integer constant is too large for 'long' type + mknodat.c:12: warning: integer constant is too large for 'long' type + mknodat.c: In function 'call_mknodat': + mknodat.c:17: warning: integer constant is too large for 'long' type + mknodat.c: In function 'main': + mknodat.c:24: warning: integer constant is too large for 'long' type + mknodat.c:50: warning: integer constant is too large for 'long' type + mknodat.c:57: warning: integer constant is too large for 'long' type + mmap.c: In function 'main': + mmap.c:51: warning: integer constant is too large for 'long' type + move_pages.c: In function 'print_stat_pages': + move_pages.c:139: warning: integer constant is too large for 'long' type + move_pages.c: In function 'print_move_pages': + move_pages.c:166: warning: integer constant is too large for 'long' type + move_pages.c: In function 'main': + move_pages.c:188: warning: integer constant is too large for 'long' type + mq_sendrecv.c: In function 'main': + mq_sendrecv.c:238: warning: integer constant is too large for 'long' type + mq_sendrecv.c:401: warning: integer constant is too large for 'long' type + mq_sendrecv.c:403: warning: integer constant is too large for 'long' type + nsyscalls.c: In function 'test_syscall': + nsyscalls.c:64: warning: integer constant is too large for 'long' type + nsyscalls.c:65: warning: integer constant is too large for 'long' type + nsyscalls.c:66: warning: integer constant is too large for 'long' type + nsyscalls.c:67: warning: integer constant is too large for 'long' type + nsyscalls.c:68: warning: integer constant is too large for 'long' type + nsyscalls.c:69: warning: integer constant is too large for 'long' type + preadv-pwritev.c: In function 'main': + preadv-pwritev.c:162: warning: comparison between signed and unsigned + prlimit64.c: In function 'main': + prlimit64.c:65: warning: integer constant is too large for 'long' type + prlimit64.c:70: warning: integer constant is too large for 'long' type + remap_file_pages.c: In function 'main': + remap_file_pages.c:42: warning: integer constant is too large for 'long' type + remap_file_pages.c:43: warning: integer constant is too large for 'long' type + remap_file_pages.c:45: warning: integer constant is too large for 'long' type + renameat.c: In function 'main': + renameat.c:15: warning: integer constant is too large for 'long' type + renameat.c:16: warning: integer constant is too large for 'long' type + rt_sigqueueinfo.c: In function 'main': + rt_sigqueueinfo.c:41: warning: integer constant is too large for 'long' type + rt_tgsigqueueinfo.c: In function 'k_tgsigqueueinfo': + rt_tgsigqueueinfo.c:45: warning: integer constant is too large for 'long' type + rt_tgsigqueueinfo.c:46: warning: integer constant is too large for 'long' type + rt_tgsigqueueinfo.c:47: warning: integer constant is too large for 'long' type + rt_tgsigqueueinfo.c: In function 'main': + rt_tgsigqueueinfo.c:67: warning: integer constant is too large for 'long' type + sendfile.c: In function 'main': + sendfile.c:110: warning: integer constant is too large for 'long' type + sendfile64.c: In function 'main': + sendfile64.c:100: warning: integer constant is too large for 'long' type + set_mempolicy.c: In function 'main': + set_mempolicy.c:129: warning: integer constant is too large for 'long' type + set_mempolicy.c:130: warning: integer constant is too large for 'long' type + setrlimit.c: In function 'main': + setrlimit.c:44: warning: integer constant is too large for 'long' type + socketcall.c: In function 'test_socketcall': + socketcall.c:58: warning: integer constant is too large for 'long' type + splice.c: In function 'main': + splice.c:41: warning: integer constant is too large for 'long' type + splice.c:42: warning: integer constant is too large for 'long' type + splice.c:45: warning: integer constant is too large for 'long' type + splice.c:46: warning: integer constant is too large for 'long' type + symlinkat.c: In function 'main': + symlinkat.c:12: warning: integer constant is too large for 'long' type + sync_file_range.c: In function 'main': + sync_file_range.c:42: warning: integer constant is too large for 'long' type + sync_file_range.c:43: warning: integer constant is too large for 'long' type + syslog.c: In function 'main': + syslog.c:14: warning: integer constant is too large for 'long' type + tee.c: In function 'main': + tee.c:41: warning: integer constant is too large for 'long' type + tee.c:42: warning: integer constant is too large for 'long' type + timer_create.c: In function 'main': + timer_create.c:52: warning: integer constant is too large for 'long' type + timer_create.c:84: warning: integer constant is too large for 'long' type + timer_create.c:85: warning: integer constant is too large for 'long' type + truncate64.c: In function 'main': + truncate64.c:41: warning: integer constant is too large for 'long' type + xgetrlimit.c: In function 'main': + xgetrlimit.c:71: warning: integer constant is too large for 'long' type + umode_t.c: In function 'test_syscall': + umode_t.c:46: warning: integer constant is too large for 'long' type + unlinkat.c: In function 'main': + unlinkat.c:13: warning: integer constant is too large for 'long' type + waitpid.c: In function 'main': + waitpid.c:43: warning: integer constant is too large for 'long' type + waitid.c: In function 'poison': + waitid.c:141: warning: integer constant is too large for 'long' type + xetpriority.c: In function 'main': + xetpriority.c:15: warning: integer constant is too large for 'long' type + xetpriority.c:19: warning: integer constant is too large for 'long' type + xetpriority.c:20: warning: integer constant is too large for 'long' type + xetpgid.c: In function 'main': + xetpgid.c:43: warning: integer constant is too large for 'long' type + xetpgid.c:47: warning: integer constant is too large for 'long' type + xetpgid.c:48: warning: integer constant is too large for 'long' type + + (SLES 11SP4, i386) + + * tests/alarm.c (main): Add proper suffix to integer constant. + * tests/aio.c (main): Likewise. + * tests/btrfs.c (btrfs_test_sync_ioctls, btrfs_test_subvol_ioctls): Likewise. + * tests/dup2.c (main): Likewise. + * tests/dup3.c (main): Likewise. + * tests/epoll_create.c (main): Likewise. + * tests/epoll_ctl.c (invoke_syscall): Likewise. + * tests/faccessat.c (main): Likewise. + * tests/fchdir.c (main): Likewise. + * tests/fcntl.c (test_flock64_einval): Likewise. + * tests/fcntl64.c (test_flock64_einval): Likewise. + * tests/fdatasync.c (main): Likewise. + * tests/flock.c (main): Likewise. + * tests/fstat64.c (SAMPLE_SIZE): Likewise. + * tests/fstat.c (SAMPLE_SIZE): Likewise. + * tests/fsync.c (main): Likewise. + * tests/ftruncate64.c (main): Likewise. + * tests/futimesat.c (main): Likewise. + * tests/get_mempolicy.c (main): Likewise. + * tests/getdents.c (main): Likewise. + * tests/getdents64.c (main): Likewise. + * tests/ioctl_block.c (lmagic, main): Likewise. + * tests/ioctl_evdev.c (lmagic): Likewise. + * tests/ioctl_mtd.c (lmagic): Likewise. + * tests/ioctl_rtc.c (lmagic): Likewise. + * tests/ioctl_v4l2.c (main): Likewise. + * tests/ioperm.c (main): Likewise. + * tests/ipc.c (ipc_call): Likewise. + * tests/kill.c (main): Likewise. + * tests/linkat.c (main): Likewise. + * tests/lstat64.c (SAMPLE_SIZE): Likewise. + * tests/lstat.c (SAMPLE_SIZE): Likewise. + * tests/mbind.c (main): Likewise. + * tests/migrate_pages.c (main): Likewise. + * tests/mkdirat.c (TEST_SYSCALL_PREFIX_ARGS): Likewise. + * tests/mknod.c (call_mknod, main): Likewise. + * tests/mknodat.c (fd, call_mknodat, main): Likewise. + * tests/mmap.c (main): Likewise. + * tests/move_pages.c (print_stat_pages, print_move_pages): Likewise. + * tests/mq_sendrecv.c (main): Likewise. + * tests/nsyscalls.c (test_syscall): Likewise. + * tests/prlimit64.c (main): Likewise. + * tests/remap_file_pages.c (main): Likewise. + * tests/renameat.c (main): Likewise. + * tests/rt_sigqueueinfo.c (main): Likewise. + * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo, main): Likewise. + * tests/sendfile.c (main): Likewise. + * tests/sendfile64.c (main): Likewise. + * tests/set_mempolicy.c (main): Likewise. + * tests/setrlimit.c (main): Likewise. + * tests/socketcall.c (test_socketcall): Likewise. + * tests/splice.c (main): Likewise. + * tests/stat64.c (SAMPLE_SIZE): Likewise. + * tests/stat.c (SAMPLE_SIZE): Likewise. + * tests/struct_flock.c (invoke_test_syscall, test_flock_einval): Likewise. + * tests/symlinkat.c (main): Likewise. + * tests/sync_file_range.c (main): Likewise. + * tests/syslog.c (main): Likewise. + * tests/tee.c (main): Likewise. + * tests/timer_create.c (main): Likewise. + * tests/truncate64.c (main): Likewise. + * tests/umode_t.c (test_syscall): Likewise. + * tests/unlinkat.c (main): Likewise. + * tests/waitid.c (main): Likewise. + * tests/waitpid.c (main): Likewise. + * tests/xetpgid.c (main): Likewise. + * tests/xetpriority.c (main): Likewise. + * tests/xgetrlimit.c (main): Likewise. + * tests/xstatfsx.c (main) [CHECK_ODD_SIZE]: Likewise. + * tests/xstatx.c (main): Likewise. + +2016-11-13 Eugene Syromyatnikov + + tests: fix "comparison between signed and unsigned" compilation warnings + preadv-pwritev.c: In function 'main': + preadv-pwritev.c:162: warning: comparison between signed and unsigned + readv.c: In function 'main': + readv.c:148: warning: comparison between signed and unsigned + recvmsg.c: In function 'main': + recvmsg.c:148: warning: comparison between signed and unsigned + + * tests/preadv-pwritev.c (main): Cast r_len to int. + * tests/readv.c (main): Likewise. + * tests/recvmsg.c (main): Likewise. + +2016-11-13 Dmitry V. Levin + + syscall.c: refactor getregs_old fallback in get_regs. + This change moves remaining arch specific getregs_old code into + appropriate arch subdirectories and removes unnecessary code + duplication. + + * linux/getregs_old.h: New file. + * linux/powerpc/getregs_old.h: Likewise. + * linux/powerpc64/getregs_old.h: Likewise. + * linux/x86_64/getregs_old.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * syscall.c: Include "getregs_old.h". + [X86_64 || POWERPC]: Remove. + [ARCH_REGS_FOR_GETREGSET] (ptrace_getregset_or_getregs): Define + to ptrace_getregset. + [ARCH_REGS_FOR_GETREGS] (ptrace_getregset_or_getregs): Define + to ptrace_getregs. + (get_regs): Check for ptrace_getregset_or_getregs instead + of ARCH_REGS_FOR_GETREGSET and ARCH_REGS_FOR_GETREGS. Use + ptrace_getregset_or_getregs instead of ptrace_getregset and + ptrace_getregs. Check for HAVE_GETREGS_OLD instead of X86_64 + and POWERPC. Use use_getregs_old instead of getregset_support + and old_kernel. + +2016-11-13 Eugene Syromyatnikov + + Rename BUILD_BUG_ON_ZERO macro. + In order to avoid name clash on distributions which decide to include + kernel headers instead of UAPI ones. For example, on SLES 11SP4: + + gcc -DHAVE_CONFIG_H -I./linux/x86_64 -I./linux -I. -Wall -O2 -c net.c + In file included from /usr/include/linux/sysctl.h:25:0, + from /usr/include/linux/netfilter.h:6, + from /usr/include/linux/netfilter_arp.h:8, + from /usr/include/linux/netfilter_arp/arp_tables.h:14, + from net.c:60: + net.c: In function 'print_packet_mreq': + gcc_compat.h:59:27: error: negative width in bit-field '' + # define MUST_BE_ARRAY(a) BUILD_BUG_ON_ZERO(!SAME_TYPE((a), &(a)[0])) + ^ + defs.h:76:53: note: in expansion of macro 'MUST_BE_ARRAY' + #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + MUST_BE_ARRAY(a)) + ^ + net.c:747:22: note: in expansion of macro 'ARRAY_SIZE' + if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address)) + ^ + due to the fact BUILD_BUG_ON_ZERO is already defined in . + + * gcc_compat.h (BUILD_BUG_ON_ZERO): Rename to FAIL_BUILD_ON_ZERO. + (MUST_BE_ARRAY): Update usage. + +2016-11-12 Dmitry V. Levin + + syscall.c: factor out ptrace_getregs from get_regs. + Move the code that calls ptrace(PTRACE_GETREGS) to a separate function. + + * syscall.c (ptrace_getregs): New function. + (get_regs): Use it. + +2016-11-12 Dmitry V. Levin + + syscall.c: rename get_regset to ptrace_getregset. + * syscall.c (get_regset): Rename to ptrace_getregset. + (get_regs): Rename get_regset to ptrace_getregset. + +2016-11-12 Andreas Schwab + + m68k: switch to PTRACE_GETREGS. + * Makefile.am (EXTRA_DIST): Add linux/m68k/arch_regs.h, remove + linux/m68k/get_syscall_result.c. + * linux/m68k/arch_regs.c (m68k_d0, ARCH_PC_PEEK_ADDR): Don't + define. + (m68k_regs, m68k_usp_ptr, ARCH_PC_REG, ARCH_REGS_FOR_GETREGS): + Define. + * linux/m68k/arch_regs.h: New file. + * linux/m68k/arch_sigreturn.c (arch_sigreturn): Use m68k_usp_ptr. + * linux/m68k/get_error.c (get_error): Use m68k_regs.d0. + * linux/m68k/get_scno.c (arch_get_scno): Use m68k_regs.orig_d0. + * linux/m68k/get_syscall_args.c (get_syscall_args): Use m68k_regs. + * linux/m68k/get_syscall_result.c: Remove. + + tests: do not run old_mmap test on m68k. + * tests/old_mmap.c: Skip test on m68k. + +2016-11-12 Dmitry V. Levin + + syscall.c: introduce reallocate_vec function. + This might be needed later to implement syscall fault injection. + + * syscall.c (reallocate_vec): New function. + (reallocate_qual): Use it. + +2016-11-12 Dmitry V. Levin + + Fix prototypes of qual_desc, qual_signal, and qual_syscall functions. + * syscall.c (qual_desc, qual_signal, qual_syscall): Fix prototypes. + (struct qual_options): Fix type of "qualify" member. + +2016-11-12 Eugene Syromyatnikov + + linux/x32/syscallent.h: fix syscallent array initialisation on x32. + Why gcc didn't complain about it? It is definitely an index clash. + + * linux/x32/syscallent.h: Change initializer indices for empty records from + [327 ... 511] to [329 ... 511]. + +2016-11-11 Dmitry V. Levin + + Introduce upoke function. + This will be needed to implement fault injection on those architectures + that lack PTRACE_SETREGSET/PTRACE_SETREGS support. + + * defs.h (upoke): New prototype. + * upoke.c: New file. + * Makefile.am (libstrace_a_SOURCES): Add it. + +2016-11-11 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux 4.9. + * linux/32/ioctls_inc_align32.h: Update from linux v4.9 using ioctls_gen.sh. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * NEWS: Mention this. + +2016-11-10 Eugene Syromyatnikov + + Update NEWS. + +2016-11-10 Mikulas Patocka + Eugene Syromyatnikov + + Add support for decoding of DM_* ioctl commands. + * dm.c: New file. + * xlat/dm_flags.in: Likewise. + * Makefile.am (strace_SOURCES): Add dm.c. + * configure.ac (AC_CHECK_HEADERS): Add linux/dm-ioctl.h. + * defs.h (dm_ioctl): New prototype. + * ioctl.c (ioctl_decode) [HAVE_LINUX_DM_IOCTL_H]: Call dm_ioctl + for 0xfd ioctl type. + * tests/ioctl_dm.c: New file. + * tests/ioctl_dm-v.c: Likewise. + * tests/ioctl_dm.test: New test. + * tests/ioctl_dm-v.test: Likewise. + * tests/.gitignore: Add ioctl_dm and ioctl_dm-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_dm.test and ioctl_dm-v.test. + +2016-11-10 Dmitry V. Levin + + Introduce ALIGNOF macro. + * gcc_compat.h (ALIGNOF): New macro. + +2016-11-10 Eugene Syromyatnikov + + util: add support for QUOTE_0_TERMINATED in user_style to ptrintstr_ex. + This enables printing size-limited (expectedly) ASCIZ strings. + + This is done by increasing umoven size limit for sized strings by one + byte above max_strlen (enabling copying possible NUL byte in case len is + greater than max_strlen) and decreasing size after copying by one byte + in case QUOTE_0_TERMINATED is set (due to user_style or usage of len of + -1). As a result, there is one excess byte for string_quote in case + QUOTE_0_TERMINATED is set so string_quote can check for NUL termination + of strings up to size bytes in size (which is len or max_strlen, whatever + is greater). + + The catch here is that when string is not properly NUL-terminated and + QUOTE_0_TERMINATED is provided in user_style and len is less than + max_strlen then last non-NUL byte is not printed. But ellipsis is + printed instead, being indication that string is not terminated + properly. QUOTE_OMIT_TRAILING_0 should be used instead in case this + behaviour is not intended. + + * util.c (printstr_ex): Copy one excess byte in case of non-negative len + provided and it is more than max_strlen; handle case of max_strlen of 0 + in case QUOTE_0_TERMINATED is set separately; check for need of printing + ellipsis by checking resulting style against QUOTE_0_TERMINATED. + +2016-11-09 Eugene Syromyatnikov + + tests: check decoding of mq_{notify,open,timedreceive,timedsend,unlink} + * tests/mq_sendrecv.c: New file. + * tests/mq_sendrecv-read.c: Likewise. + * tests/mq_sendrecv-write.c: Likewise. + * tests/mq_sendrecv.test: New test. + * tests/mq_sendrecv-read.test: Likewise. + * tests/mq_sendrecv-write.test: Likewise. + * tests/.gitignore: Add mq_sendrecv, mq_sendrecv-read, + and mq_sendrecv-write. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (mq_sendrecv_LDADD, mq_sendrecv_read_LDADD, mq_sendrecv_write_LDADD): + New variables. + (DECODER_TESTS): Add mq_sendrecv.test, mq_sendrecv-read.test, + and mq_sendrecv-write.test. + +2016-11-08 Dmitry V. Levin + + tests: skip times.test if CLOCK_PROCESS_CPUTIME_ID does not work. + * tests/times.c (main): Skip if clock_gettime consistenly returns zero + for CLOCK_PROCESS_CPUTIME_ID timer. + +2016-10-31 Eugene Syromyatnikov + + tests: add tests for perf_event_attr structure decoding in perf_event_open + * configure.ac: Add checks for presence of various fields of struct + perf_event_attr defined in kernel headers. + * tests/perf_event_open.c: New file. + * tests/perf_event_open_unabbrev.c: Likewise. + * tests/perf_event_open.test: New test. + * tests/perf_event_open_unabbrev.test: Likewise. + * tests/.gitignore: Add perf_event_open, perf_event_open_unabbrev. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add perf_event_open.test, perf_event_open_unabbrev.test. + + Implement decoding of perf_event_attr structure in perf_event_open syscall + * linux/perf_event_struct.h: New file, definition of struct perf_event_attr + from Linux 4.8 + * Makefile.am (strace_SOURCES): Add it. + * xlat/hw_breakpoint_len.in: New file. + * xlat/hw_breakpoint_type.in: Likewise. + * xlat/perf_attr_size.in: Likewise. + * xlat/perf_branch_sample_type.in: Likewise. + * xlat/perf_event_read_format.in: Likewise. + * xlat/perf_event_sample_format.in: Likewise. + * xlat/perf_hw_cache_id.in: Likewise. + * xlat/perf_hw_cache_op_id.in: Likewise. + * xlat/perf_hw_cache_op_result_id.in: Likewise. + * xlat/perf_hw_id.in: Likewise. + * xlat/perf_sw_ids.in: Likewise. + * xlat/perf_type_id.in: Likewise. + * perf.c [HAVE_LINUX_PERF_EVENT_H]: Remove inclusion of + . + (PRINT_XLAT): New macro for simplifying printing values from + sorted xlat. + (printxlat_search): New function, wrapper for xlat_search with behaviour + similar to printval. + (print_perf_event_attr): New print_event_attr structure fetching and + printing function. + (SYS_FUNC(perf_event_open)): Use print_perf_event_attr for displaying + attr argument contents. + * tests/perf_event_open.c: Renamed to + tests/perf_event_open_nonverbose.c. + * tests/perf_event_open.test: add -e verbose=none in order to preserve + output format being checked (in case verbose output is enabled, + contents of attr arguments are shown now); rename to + tests/perf_event_open_nonverbose.test; add -e trace=perf_event_open. + + tests: fix name spelling. + +2016-10-30 Eugene Syromyatnikov + + tests: fix name spelling. + + Update NEWS. + + Fix typo in comment in tests/quotactl.h. + + tests: fix invalid pointer checks in quotactl test. + * tests/quotactl.h (bogus_special, bogus_addr): Move it... + * tests/quotactl.c (main): ... here; remove static and const qualifiers, + use memory after tail_alloc instead of magic numbers. + * tests/quotactl-xfs.c (main): Likewise. + + tests: fix invalid pointer checks in getcpu test. + * test/getcpu.c (main): Replace magic numbers deemed invalid pointers + with addresses after memory returned by tail_alloc. + + tests: fix invalid pointer checks in request_key test. + * test/request_key.c (main): Replace magic numbers deemed invalid pointers + with addresses after memory returned by tail_alloc. + + tests: fix invalid pointer checks in add_key test. + * test/add_key.c (main): Replace magic numbers deemed invalid pointers + with addresses after memory returned by tail_alloc. + + statfs: use printxval_search. + * print_statfs.c (print_statfs_type): Use printxval_search for printing + FS magic xlat value. + + util: add printing helper for sorted xlat arrays. + * util.c (printxval_searchn): New function. + * defs.h (printxval_searchn): New prototype. + (printxval_search): New helper macro useful in conjunction with static + xlat arrays. + + defs: add check for argument being array to ARRAY_SIZE macro. + * gcc_compat.h [GNUC_PREREQ(3, 0)] (BUILD_BUG_ON_ZERO): New macro. + (SAME_TYPE, MUST_BE_ARRAY): Likewise. + * defs.h (ARRAY_SIZE): Add MUST_BE_ARRAY for build-time type check. + + tests: check decoding of oldfstat, oldlstat, and oldstat syscalls. + * tests/oldfstat.c: New file. + * tests/oldlstat.c: Likewise. + * tests/oldstat.c: Likewise. + * tests/oldfstat.test: New test. + * tests/oldlstat.test: Likewise. + * tests/oldstat.test: Likewise. + * tests/xstatx.c [!OLD_STAT]: define OLD_STAT to 0. + (print_stat) [OLD_STAT]: Print predefined values for + st_blksize/st_blocks. + (print_stat): Check for !OLD_STAT in nanosecond precision checks. + (main) [OLD_STAT]: Ignore EOVERFLOW. + (main): Test for successful rc in returned size value check; + print address only on non-successful rc. + * tests/.gitignore: Add oldfstat, oldlstat, and oldstat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add oldfstat.test, oldlstat.test, and oldstat.test. + + tests: additional tests of stat decoders. + * tests/fstatx.c (IS_FSTAT): Define to 1. + * tests/fstatat64.c [__GLIBC__ && __sparc64__] (TEST_BOGUS_STRUCT_STAT): + Define to 0. + * tests/xstatx.c [!IS_STAT] (IS_STAT): Define to 0. + [!TEST_BOGUS_STRUCT_STAT] (TEST_BOGUS_STRUCT_STAT): Define to 1. + (main): Add a check for non-available pointer and a check + for block device file. + * tests/statx.sh: Add tracing of /dev/full file, specify alignment. + * tests/fstat.test: Specify alignment. + +2016-10-30 Eugene Syromyatnikov + + tests: prepare for additional tests of stat decoders. + PRINT_SYSCALL_HEADER/PRINT_SYSCALL_FOOTER now contain open/close brace + pair in order to save errno. PRINT_SYSCALL_FOOTER now uses sprintrc for + printing rc/errno. + + * tests/xstatx.c: Include . + (main): Update PRINT_SYSCALL_FOOTER call convention. + * tests/fstatat.c (PRINT_SYSCALL_HEADER): Add errno saving. + (PRINT_SYSCALL_FOOTER): Restore errno. + * tests/fstatx.c: Likewise. + * tests/lstatx.c: Likewise. + +2016-10-28 Dmitry V. Levin + + Provide a safe definition of O_ACCMODE. + Some libcs e.g. musl are guilty of messing up with O_ACCMODE. + + * open.c (O_ACCMODE): Redefine to 03. + +2016-10-28 Eugene Syromyatnikov + + Implement dumping of mq_timedsend and mq_timedreceive syscalls. + * syscall.c (dumpio): Add SEN_mq_timedreceive and SEN_mq_timedsend. + + mq: print msg_prio as a pointer, not as an immediate value. + * mq.c (SYS_FUNC(mq_timedreceive)): Use printnum_int for printing + msg_prio argument. + +2016-10-28 Eugene Syromyatnikov + + mq: print msg payload only in case of successful mq_timedreceive call. + Also, use u_rval for determining message size. + + * mq.c (SYS_FUNC(mq_timedreceive)): Check for syserror and non-negative + u_rval before calling printstr on msg_ptr argument, or use printaddr otherwise; + provide u_rval as string size. + +2016-10-28 Eugene Syromyatnikov + + mq: Print msg_prio parameter as unsigned int in mq_timedsend. + * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%ld" + to "%u", cast argument value to unsigned int. + +2016-10-28 Eugene Syromyatnikov + + mq: Properly print mq_flags field. + mq_flags field of struct mq_attr can contain only O_NONBLOCK flag (other + flags are treated as invalid by mq_getsetattr). Moreover, this field is + ignored by mq_open at all (O_NONBLOCK is set via oflag, not via attr + attribute). + + * xlat/mq_attr_flags.in: New file. + * print_mq_attr.c: Include xlat/mq_attr_flags.h. + (printmqattr): New parameter, bool decode_flags; cast members of struct + mq_attr to long long type; use mq_attr_flags xlat for printing mq_flags; + print mq_flags as flags only in case decode_flags parameter is set + to true. + * mq.c (SYS_FUNC(mq_open)): Specify value of false for decode_flags + parameter of printmqattr call. + (SYS_FUNC(mq_getsetattr)): Specify value of true for decode_flags + parameter of printmqattr call. + * tests/mq.expected: Update expected output. + +2016-10-28 Eugene Syromyatnikov + + mq: Print msg_len parameter as kernel_ulong_t. + * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%lu" + to "%llu", use getarg_ull for obtaining msg_len parameter. + (SYS_FUNC(mq_timedreceive)): Likewise. + + print_mq_attr: fix typo. + * print_mq_attr.c (printmqattr): Print field name "mq_curmsgs" + instead of "mq_curmsg". + * tests/mq.expected: Update expected output. + +2016-10-28 Eugene Syromyatnikov + + mq: print mqdes parameter as int. + It is defined as int in . + + * mq.c (SYS_FUNC(mq_timedsend)): Use "%d" conversion specifier instead + of "%ld" for printing mqdes (0th parameter), cast parameter value to + int. + (SYS_FUNC(mq_timedreceive)): Likewise. + (SYS_FUNC(mq_notify)): Likewise. + (SYS_FUNC(mq_getsetattr)): Likewise. + +2016-10-28 Eugene Syromyatnikov + + mq: curly brackets usage fix. + Use curly brackets for denoting blocks in both of if branches if they + are already used in at least one branch. + + tests: additional name_to_handle_at/open_by_handle_at checks. + * tests/file_handle.c: Additional name_to_handle_at/open_by_handle_at + checks. + + tests: require only presence of __NR_* macros for file_handle test. + * tests/file_handle.c: replace fcntl.h include with asm/unistd.h. + [MAX_HANDLE_SZ]: change to defined __NR_name_to_handle_at + && defined __NR_open_by_handle_at, add fcntl.h include + [!MAX_HANDLE_SZ]: Add definition of MAX_HANDLE_SZ and struct + file_handle. + (main): Change name_to_handle_at and open_by_handle_at calls to syscall. + + tests: proper type conversion in keyctl test. + * tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t + since kernel_ulong_t may be of different size. + +2016-10-28 Eugene Syromyatnikov + + file_handle: use separate xlat for name_ta_handle_at flags. + Since the only two flags supported are AT_SYMLINK_FOLLOW and + AT_EMPTY_PATH. + + * xlat/name_to_handle_at_flags.in: New file. + * file_handle.c (SYS_FUNC(name_to_handle_at)): Use name_to_handle_at_flags + for printing flags parameter. + +2016-10-28 Eugene Syromyatnikov + + tests: check decoding of kexec_file_load and kexec_load syscalls. + * tests/kexec_file_load.c: New file. + * tests/kexec_load.c: Likewise. + * tests/kexec_file_load.test: New test. + * tests/kexec_load.test: Likewise. + * tests/.gitignore: Add kexec_file_load and kexec_load. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add kexec_file_load.test and kexec_load.test. + +2016-10-28 Eugene Syromyatnikov + + kexec: use widen_to_ulong since kexec_load has compat on x32/n32. + Curiously, kexec_load uses compat on x32/n32, so its parameters should + be 4 bytes in size on these ABIs. + + * kexec.c (SYS_FUNC(kexec_load)): Use widen_to_ulong for casting + parameters to proper size on x32/n32. + +2016-10-28 Eugene Syromyatnikov + + kexec: fix zeroing of higher bits of flags parameter in kexec_load. + * kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before + negation in order to properly negate higher bits of KEXEC_ARCH_MASK. + + kexec: add printing of struct kexec_segment field names. + * kexec.c (print_seg): Print field names of the kexec_segment structure. + + tests: check decoding of unshare syscall. + * tests/unshare.c: New file. + * tests/unshare.test: New test. + * tests/.gitignore: Add unshare. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add unshare.test. + +2016-10-28 Eugene Syromyatnikov + + clone: use kernel_ulong_t as type of flags parameter of unshare call. + Kernel declares flags parameter as long and looks like x32 and n32 + implement no compat for this call. + + * clone.c (SYS_FUNC(unshare)): Use getarg_ull and printflags64 for + obtaining and parsing flags parameter. + +2016-10-28 Eugene Syromyatnikov + + clone: use separate flag list for unshare. + Not all clone flags could be passed to unshare (see check_unshare_flags + function in kernel/fork.c). + + * xlat/unshare_flags.in: New file. + * clone.c (SYS_FUNC(unshare)): Use unshare_flags for printing flags + parameter. + +2016-10-28 Eugene Syromyatnikov + + tests: check decoding of setns syscall. + * tests/setns.c: New file. + * tests/setns.test: New test. + * tests/.gitignore: Add setns. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setns.test. + +2016-10-28 Eugene Syromyatnikov + + clone: use separate xlat for nstype parameter of setns syscall. + nstype is not flag set but specific type value against which it is + compared in kernel (see kernel/nsproxy.c, SYSCALL_DEFINE2(setns, ...)). + + * xlat/setns_types.in: New file. + * clone.c: Use printxval and setns_types for nstype parameter. + +2016-10-28 Eugene Syromyatnikov + + tests: check non-verbose capget/capset output. + * tests/caps-abbrev.awk: New file. + * tests/caps-abbrev.c: Likewise. + * tests/caps-abbrev.test: New test. + * tests/.gitignore: Add caps-abbrev. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add caps-abbrev.test. + (EXTRA_DIST): Add caps-abbrev.awk. + + tests: additional capset decoder checks. + * tests/caps.awk: Add patterns for additional checks. + * tests/caps.c: Implement additional checks. + + tests: check decoding of fanotify_init syscall. + * tests/fanotify_init.c: New file. + * tests/fanotify_init.test: New test. + * tests/.gitignore: Add fanotify_init. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fanotify_init.test. + + tests: some additional checks for fanotify_mark. + * tests/fanotify_mark.c (do_call): New function. + (main): Use it. + + tests: use sprintrc in tests/fanotify_mark.c. + * tests/fanotify.c (main): Use sprintrc. + + tests: check decoding of {init,finit,delete}_module syscalls. + * tests/delete_module.c: New file. + * tests/finit_module.c: Likewise. + * tests/init_delete_module.h: Likewise. + * tests/init_module.c: Likewise. + * tests/delete_module.test: New test. + * tests/finit_module.test: Likewise. + * tests/init_module.test: Likewise. + * tests/.gitignore: Add delete_nodule, finit_module, and init_module. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add delete_module.test, finit_module.test, + and init_module.test. + (EXTRA_DIST): Add init_delete_module.h. + +2016-10-28 Eugene Syromyatnikov + + bjm: use getarg_ull for retrieving first two parameters of init_module syscall + As init_module has no compat wrapper, its first parameter is a pointer + and the second is length, they both have the same size as kernel_ulong_t + type. + + * bjm.c (SYS_FUNC(init_module)): Obtain first two parameters using + getarg_ull, print address argument using printaddr_ull, print length + argument using "%llu" conversion specifier. + +2016-10-28 Dmitry V. Levin + + Add printaddr_ull, change printaddr into a thin wrapper around it. + * defs.h (printaddr_ull): New prototype. + (printaddr): Change to a static inline wrapper around printaddr_ull. + * util.c (printaddr): Rename to printaddr_ull, change argument type + to unsigned long long, change print format to %#llx. + +2016-10-28 Eugene Syromyatnikov + + xlat: add values for MODULE_INIT_* constants. + * bjm.c (MODULE_INIT_IGNORE_MODVERSIONS, MODULE_INIT_IGNORE_VERMAGIC): + Remove. + * xlat/module_init_flags.in: Add values for + MODULE_INIT_IGNORE_MODVERSIONS and MODULE_INIT_IGNORE_VERMAGIC records. + +2016-10-28 Eugene Syromyatnikov + + Remove parser of create_module syscall. + Since create_module syscall is present only in kernels before Linux 2.6 + and strace does not support those kernels, there is no use to keep this + parser any longer. + + * bjm.c (SYS_FUNC(create_module)): Remove. + * linux/dummy.h (sys_create_module): Add stub alias. + +2016-10-28 Eugene Syromyatnikov + + tests: check decoding of process_vm_readv and process_vm_writev syscalls + * tests/process_vm_readv.c: New file. + * tests/process_vm_readv_writev.c: Likewise. + * tests/process_vm_writev.c: Likewise. + * tests/process_vm_readv.test: New test. + * tests/process_vm_writev.test: Likewise. + * tests/.gitignore: Add process_vm_readv and process_vm_writev. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add process_vm_readv.test and process_vm_writev.test. + (EXTRA_DIST): Add process_vm_readv_writev.c. + + process_vm: use widen_to_ulong for local_iovcnt, renote_iovcnt, and flags + * process_vm.c (SYS_FUNC(process_vm_readv), + SYS_FUNC(process_vm_writev)): Use widen_to_ulong for local_iovcnt, + renote_iovcnt, and flags parameters. + +2016-10-28 Eugene Syromyatnikov + + defs: add widen_to_ulong macro. + This is similar to widen_to_long, but for unsigned values. + + * defs.h (widen_to_ulong): New macro. + +2016-10-28 Eugene Syromyatnikov + + process_vm: print pid argument as int. + * process_vm.c (SYS_FUNC(process_vm_readv), + SYS_FUNC(process_vm_writev)): Change conversion specifier for pid + argument from "%ld" to "%d". + +2016-10-28 Eugene Syromyatnikov + + process_vm: remove syserror check for iovec printing. + This check had been done by print_array inside tprint_iov anyway. + + * process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for + printing local_iov; do not check for syserror, provide decode_iov + parameter to tprint_iov{,_upto} based on its value instead. + +2016-10-28 Eugene Syromyatnikov + + io: use umoven_or_printaddr_ignore_syserror as umove function in tprint_iov_upto + This enables printing of iovec arrays even in case of failed syscall + (failed syscall doesn't mean that iovec itself is inaccessible and + useless). One caveat here is that we should explicitly provide proper + IOV_DECODE_* value based on syserror value in case printing is performed + on exiting; we can't simply override it to IOV_DECODE_ADDR on exiting + when syserror is up, since this may be called by code which tries to + print iovec containing local data, which should be perfectly accessible + (on the other hand, there are no cases of such behaviour at the moment). + + Since iovecs themselves are printed even if syscall has failed now, + preadv test is updated to reflect this. It is notable, though, that this + is the only place where this case is checked. + + * io.c (tprint_iov_upto): Specify umoven_or_printaddr_ignore_syserror + instead of umoven_or_printaddr as umoven_func parameter. + (SYS_FUNC(readv), do_preadv): Specify decode_iov parameter value + based on syserror(tcp) value. + * scsi.c: (print_sg_io_v3_res, print_sg_io_v4_res): Likewise. + * tests/preadv.c: Update expected output for the case when preadv + with singe-item iovec failed. + +2016-10-28 Eugene Syromyatnikov + + Move umoven_or_printaddr_ignore_syserror to util.c. + * defs.h (umoven_or_printaddr_ignore_syserror): New prototype. + * v4l2.c (umoven_or_printaddr_ignore_syserror): Move ... + * util.c: ... here. + +2016-10-28 Eugene Syromyatnikov + + v4l2: check for verbose flag in umoven_or_printaddr_ignore_syserror. + This change makes behaviour of umoven_or_printaddr_ignore_syserror in + line with umoven_or_printaddr when verbose flag is disabled. + + * v4l2.c (umoven_or_printaddr_ignore_syserror): Simply call printaddr + when verbose flag is unset. + +2016-10-28 Eugene Syromyatnikov + + tests: check decoding of kcmp syscall. + * tests/kcmp.c: New file. + * tests/kcmp.test: New test. + * tests/.gitignore: Add kcmp. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add kcmp.test. + +2016-10-28 Dmitry V. Levin + + kcmp: print index parameters of unknown commands as kernel_ulong_t. + * lookup_dcookie.c (SYS_FUNC(kcmp)): Use getarg_ull to retrieve idx1 + and idx2, print them using %#llx format in case of unknown command. + +2016-10-27 Eugene Syromyatnikov + + tests: check decoding of inotify family syscalls. + * tests/inotify.c: New file. + * tests/inotify_init1.c: Likewise. + * tests/inotify.test: New test. + * tests/inotify_init1.test: Likewise. + * tests/.gitignore: Add inotify and inotify_init1. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add inotify.test and inotify_init1.test. + + xlat: use IN_* prefix for inotify_init1 flag constants. + * xlat/inotify_init_flags.in: Replace O_* prefix with IN_* prefix for + O_NONBLOCK and O_CLOEXEC constants, provide fallback definitions. + + tests: check decoding of lookup_dcookie syscall. + * tests/lookup_dcookie.c: New file. + * tests/lookup_dcookie.test: New test. + * tests/.gitignore: Add lookup_dcookie. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add lookup_dcookie.test. + +2016-10-27 Eugene Syromyatnikov + + lookup_dcookie: print len parameter as kernel_ulong_t. + It is size_t and without compat on x32/n32. + + * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Change conversion + specifier from "%lu" to "%llu", use getarg_ull for len argument + retrieval. + +2016-10-26 Eugene Syromyatnikov + + defs.h: add offsetofend macro. + Analogous to offsetof but returns structure offset after the specified + field. Useful for checking whether specific field is present in obtained + data or specifying amount of data to copy based on the (last) field needed. + + * defs.h (offsetofend): New macro. + +2016-10-26 Eugene Syromyatnikov + + tests: move ARG_STR and similar macros to tests.h. + * tests/add_key.c (_STR, ARG_STR): Move ... + * tests/tests.h: ... here. + (ARG_ULL_STR): New macro. + * tests/keyctl.c (ARG_STR): Remove. + * tests/quotactl.h (ARG_STR): Likewise. + * tests/request_key.c (ARG_STR): Likewise. + + tests: move LL_PAIR and LL_VAL_TO_PAIR macros to tests.h. + * tests/fadvise.h (LL_PAIR, LL_VAL_TO_PAIR): Move ... + * tests/tests.h: ... here. + + tests: check decoding of ioprio_get and ioprio_set syscalls. + * tests/ioprio.c: New file. + * tests/ioprio.test: New test. + * tests/.gitignore: Add ioprio. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioprio.test. + +2016-10-26 Eugene Syromyatnikov + + xlat: provide fallback definitions for CLOCK_* constants. + Since new values have been added gradually over various kernel versions, + it's better to define them explicitly in order to avoid situations when + strace built with older kernel headers cannot decode some recently + defined values. + + * xlat/clocknames.in: Add values for constants. + +2016-10-26 Eugene Syromyatnikov + + tests: move fill_memory and fill_memory_ex into a separate file. + * tests/fill_memory.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/quotactl.h (fill_memory, fill_memory_ex): Move to fill_memory.c. + * tests/tests.h (fill_memory, fill_memory_ex): New prototypes. + + tests: add period parameter to fill_memory_ex. + * tests/quotactl.h (fill_memory_ex): Add period parameter, + use it as a divisor in non-constant part of value. + (fill_memory): Specify period of 0x80 to fill_memory_ex call. + * tests/quotactl-xfs.c (main): Likewise. + +2016-10-05 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.14-1. + * strace.spec.in: Likewise. + +2016-10-04 Dmitry V. Levin + + Prepare for 4.14 release. + * NEWS: Update for 4.14 release. + + Generate SEN numbers in a locale independent order. + * generate_sen.sh: Sort SEN numbers using C collation rules. + +2016-10-04 Dmitry V. Levin + + Assume that offsetof is provided by stddef.h. + According to C89, shall define offsetof macro. + + * defs.h: Include unconditionally. + [!offsetof]: Remove. + +2016-10-03 Eugene Syromyatnikov + + tests: check decoding of add_key, keyctl, and request_key syscalls. + * tests/add_key.c: New file. + * tests/keyctl.c: Likewise. + * tests/request_key.c: Likewise. + * tests/add_key.test: New test. + * tests/keyctl.test: Likewise. + * tests/request_key.test: Likewise. + * tests/.gitignore: Add add_key, keyctl, and request_key. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add add_key.test, keyctl.test, and request_key.test. + +2016-10-03 Eugene Syromyatnikov + + keyctl: use kernel_ulong_t and getarg_ull instead of long. + This potentially fixes keyctl decoder for x32 personality. + + * keyctl.c (keyctl_update_key, keyctl_read_key, keyctl_instantiate_key, + keyctl_instantiate_key_iov, keyctl_dh_compute): Change addr and len + arguments to kernel_ulong_t. Print len using %llu format. + (keyctl_keyring_search): Change addr1 and addr2 arguments + to kernel_ulong_t. + (print_dh_params): Change addr argument to kernel_ulong_t. + (SYS_FUNC(keyctl)): Retrieve arguments via getarg_ull, pass them + to the appropriate handlers. + +2016-10-03 Eugene Syromyatnikov + + keyctl: fix parameter signedness. + * keyctl.c (keyctl_update_key): Change addr and len arguments + to unsigned. + (keyctl_read_key): Likewise. + (keyctl_instantiate_key): Likewise. + (keyctl_instantiate_key_iov): Likewise. + (keyctl_dh_compute): Likewise. + (keyctl_keyring_search): Change addr1 and addr2 arguments to unsigned. + (keyctl_chown_key): Change user and group arguments to unsigned. + (keyctl_get_persistent): Change uid argument to unsigned. + +2016-10-03 Eugene Syromyatnikov + + keyctl: use printstr_ex for printing out buffer. + keyctl_read_key had subtle bug by treating out buffer in KEYCTL_READ + as NUL-terminated, which is not true. We fix it by adding parameter to + keyctl_read_key signalising whether buffer is NUL-terminated and using + printstr_ex for printing (expectedly) NUL-terminated strings. + + * keyctl.c (keyctl_read_key): Add has_nul parameter. Do not use -1 as + string len. Use printstr_ex for buffer output with user style depending + on has_nul value. + (SYS_FUNC(keyctl)): Specify has_nul parameter to keyctl_read_key + by comparing cmd value with KEYCTL_READ. + +2016-10-03 Eugene Syromyatnikov + + Add printstr_ex which allows for providing user quotation style. + This is useful for providing QUOTE_OMIT_TRAILING_0 and maybe other + flags. + + * defs.h (printstr_ex): New prototype. + (printstr): Change to a wrapper around printstr_ex with zero user style. + * util.c (printstr): Rename to ... + (printstr_ex) ... new function, add user_style argument which is or'ed + with computed style. + +2016-10-03 Eugene Syromyatnikov + + util: add quote_string flag signalising that string is NUL-terminated. + It is useful in cases strings with size provided are expected to be + NUL-terminated but are not trustworthy enough to call just plain + printstr(str, -1). + + * defs.h (QUOTE_OMIT_TRAILING_0): New constant definition. + * util.c (string_quote): Swallow terminating NUL if + QUOTE_OMIT_TRAILING_0 is set. + +2016-10-03 Eugene Syromyatnikov + + keyctl: add support for KEYCTL_DH_COMPUTE. + * keyctl.c (struct keyctl_dh_params): New structure. + (print_dh_params, keyctl_dh_compute): New functions. + (SYS_FUNC(keyctl)): Add support for KEYCTL_DH_COMPUTE cmd value. + +2016-10-03 Dmitry V. Levin + + x86_64: fix is_negated_errno for x32 personality. + * syscall.c (is_negated_errno) [X86_64]: Do not truncate kernel_ulong_t + to uint32_t for x32 personality. + + tests: fix another regression in qual_syscall.test. + * tests/qual_syscall.test: Fix pattern_nonabbrev_verbose pattern. + (check_output_mismatch): Print the pattern that triggered match failure. + + Use err_name, print unrecognized errno values as numbers. + * syscall.c (trace_syscall_exiting): Use err_name() instead + of open-coding it. Print unrecognized errno values using %lu format + instead of ERRNO_%lu as the latter prodices an invalid constant. + +2016-10-03 Eugene Syromyatnikov + + keyctl: print errno name in KEYCTL_REJECT in case it is available. + * keyctl.c (keyctl_reject_key): Get errno string via err_name + and print it if it is not NULL. + + Add function for getting errno string. + * defs.h (err_name): New prototype. + * syscall.c (err_name): New function. + +2016-10-03 Dmitry V. Levin + + struct tcb: change the type of u_error field from int to unsigned long. + This is the type actually used for the error code on architectures + that use a dedicated register. + + * defs.h (struct tcb): Change the type of u_error to unsigned long. + * syscall.c (trace_syscall_exiting): Change the type of u_error variable + to unsigned long, print it using %lu format, drop no longer needed + explicit cast to unsigned long. + (saved_u_error): Change type to unsigned long. + +2016-10-02 Dmitry V. Levin + + Use tprints instead of tprintf in a few more places. + * btrfs.c (btrfs_print_qgroup_inherit, btrfs_print_tree_search, + btrfs_ioctl): Replace tprintf with tprints for printing strings without + format specifiers. + * net.c (print_group_req): Likewise. + * scsi.c (scsi_ioctl): Likewise. + * term.c (decode_termios, decode_termio): Likewise. + * userfaultfd.c (uffdio_ioctl): Likewise. + +2016-10-02 Eugene Syromyatnikov + + keyctl: do not print comma for KEYCTL_SESSION_TO_PARENT command. + Since this command doesn't have any additional arguments, the comma does + not needed. Since this is the only command which lacks additional + arguments, it's better to add special case for it rather than add + printing of comma to all other commands. + + * keyctl.c (SYS_FUNC(keyctl)): Add check for command not being + KEYCTL_SESSION_TO_PARENT when printing comma dividing cmd argument + from the rest. + +2016-10-02 Eugene Syromyatnikov + + keyctl: use getarg_ull for printing generic arguments. + Otherwise it is erroneous on x32, for example. + + * keyctl.c (SYS_FUNC(keyctl)): Use "%#llx" conversion specifier + and getarg_ull for fallback argument printing. + +2016-10-02 Eugene Syromyatnikov + + keyctl: use printuid for printing UID/GID. + UID/GID are unsigned except special -1 value (which is also special in + context of specific keyctl commands), so special printing function + should be used. + + * keyctl.c (keyctl_chown_key, keyctl_get_persistent): Use printuid + instead of printf with "%d" conversion for printing UID/GID. + +2016-10-02 Eugene Syromyatnikov + + io: handle data_size of -1 as unlimited data in print_iovec. + Otherwise it can be depleted and print_iovec starts printing empty + strings. + + * io.c (print_iovec): Interpret c->data_size of -1 as unlimited data + and do not decrease it in this case. + +2016-10-01 Dmitry V. Levin + + tests: fix typo in qual_syscall.test. + Fix test regression introduced by commit v4.13-225-g55334ef. + + * tests/qual_syscall.test: Fix typo. + +2016-09-30 Dmitry V. Levin + + Enhance -e abbrev=set, -e raw=set, and -e verbose=set. + Enhance abbrev=, raw=, and verbose= to accept the same syntax as trace=. + For example, this allows such syntax as -e verbose=file. + + * syscall.c (lookup_class): Define before qual_syscall. + (qualify): Move the loop based on lookup_class ... + (qual_syscall): ... here. + * tests/qual_syscall.test: Check it. + +2016-09-30 Dmitry V. Levin + + tests/qual_syscall.test: rewrite without ls. + * tests/qual_syscall.test: Invoke ./umovestr instead of ls. + Update expected output. + +2016-09-28 Eugene Syromyatnikov + + tests: check decoding of fadvise64 and fadvise64_64 syscalls. + * tests/fadvise.h: New file. + * tests/fadvise64.c: Likewise. + * tests/fadvise64_64.c: Likewise. + * tests/fadvise64.test: New test. + * tests/fadvise64_64.test: Likewise. + * tests/.gitignore: Add fadvise64 and fadvise64_64. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fadvise64.test, fadvise64_64.test. + (EXTRA_DIST): Add fadvise.h. + +2016-09-28 Dmitry V. Levin + + mips o32: implement fetching the 7th subcall argument. + * syscall.c [LINUX_MIPSO32] (decode_mips_subcall): Fetch the last + argument of 7-arg syscalls. + +2016-09-28 Eugene Syromyatnikov + + x32: use proper decoder for fadvise64 syscall. + fadvise_64_64 decoder used before this change prints different sign + of the "len" argument (loff_t vs size_t). + + * linux/x32/syscallent.h (fadvise64): Replace SEN(fadvise64_64) + with SEN(fadvise64). + +2016-09-28 Eugene Syromyatnikov + + fadvise: use getarg_ull for obtaining len argument of fadvise64 syscall. + Since its type is size_t, it is 64-bit wide on x32 and special care + should be taken in order to obtain it. + + * fadvise.c (SYS_FUNC(fadvise64)): Use getarg_ull for obtaining value + of "len" syscall argument. + +2016-09-28 Eugene Syromyatnikov + + util: add getarg_ll and getarg_ull functions. + These allow retrieving specific argument in full taking into account + peculiarities of runtimes which employ tcp->ext_arg (e.g. x32). + + * defs.h (getarg_ll, getarg_ull): New prototypes. + * util.c (getarg_ll, getarg_ull): New functions. + (printargs): Use getarg_ull. + +2016-09-28 Eugene Syromyatnikov + + fadvise: change printing of len argument to unsigned in fadvise64 syscall + The kernel declares fadvise64 as + long sys_fadvise64(int fd, loff_t offset, size_t len, int advice); + + * fadvise.c (SYS_FUNC(fadvise64)): Change conversion specifier from + "%ld" to "%lu" for printing len argument since kernel expects argument + of type size_t. + +2016-09-28 Dmitry V. Levin + + sh64, sparc64: use proper decoder for fadvise64_64 syscall. + This change is no-op yet, but things will change when decoder + of fadvise64 syscall get fixed. + + * linux/sh64/syscallent.h (fadvise64_64): Replace SEN(fadvise64) + with SEN(fadvise64_64). + * linux/sparc64/syscallent.h (fadvise64_64): Likewise. + +2016-09-28 Eugene Syromyatnikov + + tests: check decoding of fallocate syscall. + * configure.ac (AC_CHECK_FUNCS): Add fallocate. + * tests/fallocate.c: New file. + * tests/fallocate.test: New test. + * tests/.gitignore: Add fallocate. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fallocate.test. + +2016-09-27 Eugene Syromyatnikov + + fallocate: change print format of offset and len arguments to signed. + Since types of these arguments are off_t and kernel actually expects + signed values in order to fail when negative values are provided, + lets display these values as signed. + + * fallocate.c (SYS_FUNC(fallocate)): Change conversion specifier for + printing "offset" and "len" syscall arguments from %llu to %lld. + +2016-09-27 Eugene Syromyatnikov + + xlat: add default values for falloc_flags constants. + In order to avoid dependence of declared constants to headers available + on build system. + + * xlat/falloc_flags.in: Add default values for constants. + +2016-09-27 Eugene Syromyatnikov + + tests: check decoding of getcpu syscall. + * tests/getcpu.c: New file. + * tests/getcpu.test: New test. + * tests/.gitignore: Add getcpu. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getcpu.test. + + tests: make magic values in ioctl_block test distinctive. + * tests/ioctl.block (init_magic): Add iterator value to magic value + in order to enable detection of potential 4-byte aligned shifts. + + tests: additional getcwd decoding checks. + * tests/getcwd.c (main): Add more checks for getcwd arguments decoding. + + tests: check decoding of quotactl syscall. + * configure.ac (AC_CHECK_HEADERS): Add linux/dqblk_xfs.h, linux/quota.h, + and sys/quota.h. + * tests/.gitignore: Add quotactl, quotactl-v, quotactl-xfs, + and quotactl-xfs-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add quotactl.test, quotactl-v.test, + quotactl-xfs.test, and quotactl-xfs-v.test. + (EXTRA_DIST): Add quotactl.h + * quotactl.h: New file. + * quotactl.c: Likewise. + * quotactl-v.c: Likewise. + * quotactl-xfs.c: Likewise. + * quotactl-xfs-v.c: Likewise. + * quotactl.test: New test. + * quotactl-v.test: Likewise. + * quotactl-xfs.test: Likewise. + * quotactl-xfs-v.test: Likewise. + +2016-09-27 Dmitry V. Levin + + quota: ensure that names of structure fields are printed properly. + * quota.c (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): New macros. + (decode_cmd_data): Use them to print structure fields. + + Enhance zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros. + * defs.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll): + Add support of char types. + * tests/tests.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll): + Likewise. + + quota: move Q_QUOTAON handling to subcommand switch statement. + * quota.c (SYS_FUNC(quotactl)): Move handling of Q_QUOTAON subcommand ... + (decode_cmd_data): ... here. + +2016-09-27 Eugene Syromyatnikov + + quota: remove legacy subcommand decoding support code. + Support for these quota subcommands by linux kernels has been dropped + long time ago (between 2.5.16 and 2.5.17), so lets drop it in order + to minimize amount of code which should be subjected to testing and + structured conversion. + + * quota.c (struct v1_dqblk, struct v2_dqblk, struct v2_dqinfo, + struct v1_dqstats, struct v2_dqstats): Remove. + (decode_cmd_data): Remove handling of Q_V1_GETQUOTA, Q_V1_SETQUOTA, + Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_V2_GETINFO, Q_V2_SETINFO, Q_V1_GETSTATS, + and Q_V2_GETSTATS subcommands. + (SYS_FUNC(quotactl)): Remove handling of Q_V1_QUOTAON subcommand. + +2016-09-27 Eugene Syromyatnikov + + quota: add realtime block limits fields to XFS disk quota printing code. + * quota.c (decode_cmd_data): Add printing of d_rtb_hardlimit + and d_rtb_softlimit fields to struct xfs_dqblk printing code. + +2016-09-27 Eugene Syromyatnikov + + quota: add packed attribute to struct if_dqblk definition. + Since the only difference between 32-bit and 64-bit environments + regarding this structure is its padding, lets just add packed attribute + to its definition instead of going full mpers. + + * quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED. + +2016-09-27 Eugene Syromyatnikov + + quota: Add decoding for Q_XQUOTARM subcommand. + * quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand + switch. + +2016-09-27 Eugene Syromyatnikov + + quota: add dispatch of SYNC subcommands. + Q_XQUOTASYNC is no-op, but it does not require id/addr arguments anyway. + + * quota.c (decode_cmd_data): Add Q_SYNC and Q_XQUOTASYNC to subcommand + dispatch switch since id/addr arguments for these subcommands are known + to be ignored. + +2016-09-27 Eugene Syromyatnikov + + quota: add missing prefixes to struct field names. + * quota.c (decode_cmd_data): Print field names in accordance with + their definition. + + quota: fix indentation inside subcommand dispatching switch statement. + +2016-09-27 Eugene Syromyatnikov + + quota: avoid printing id argument for those commands that ignore it. + As id argument is not used for Q_QUOTAOFF, Q_GETFMT, Q_V2_GETINFO, + Q_GETINFO, Q_V2_SEETINFO, Q_SETINFO, Q_SYNC, Q_XQUOTAON, Q_XQUOTAOFF, + Q_XQUOTARM, Q_XGETQSTAT, Q_XGETQSTATV, Q_XQUOTASYNC, Q_V1_GETSTATS, and + Q_V2_GETSTATS subcommands, do not print it for these subcommands. + + * quota.c (decode_cmd_data): Add id argument parameter, add printing + of id argument for Q_GETQUOTA, Q_SETQUOTA, Q_GETNEXTQUOTA, + Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA, + Q_XGETQUOTA, Q_XGETNEXTQUOTA, Q_XSETQLIM, and unknown subcommands. + (SYS_FUNC(quotactl)): Remove printing of id argument, pass it + to decode_cmd_data. + +2016-09-27 Eugene Syromyatnikov + + quota: use printuid for id parameter printing. + * quota.c (SYS_FUNC(quotactl)): Since id call argument is used for + user/group/project ID which all have special semantics for -1, + print it the same way as UIDs are printed. + + quota: display quota subcommand as a macro. + * quota.c (SYS_FUNC(quotactl)): Replace disjunction of two xlat values + (which also lacks shift of the left part) with QCMD macro call. + +2016-09-26 Dmitry V. Levin + + tests: use VERBOSE macro in waitid and waitid-v tests. + * tests/waitid-v.c (VERBOSE_RUSAGE): Remove. + (VERBOSE): Define to 1. + * tests/waitid.c (sprint_rusage): Check VERBOSE instead + of VERBOSE_RUSAGE. + + tests: use VERBOSE macro in wait4 and wait4-v tests. + * tests/wait4-v.c (VERBOSE_RUSAGE): Remove. + (VERBOSE): Define to 1. + * tests/wait4.c (sprint_rusage): Check VERBOSE instead + of VERBOSE_RUSAGE. + + tests: use VERBOSE macro in msg_control and msg_control-v tests. + * tests/msg_control-v.c (VERBOSE_MSGHDR): Remove. + (VERBOSE): Define to 1. + * tests/msg_control.c (print_fds, print_ip_opts): Check VERBOSE instead + of VERBOSE_MSGHDR. + + tests: use VERBOSE macro in mmsg_name and mmsg_name-v tests. + * tests/mmsg_name-v.c (VERBOSE_MMSGHDR): Remove. + (VERBOSE): Define to 1. + * tests/mmsg_name.c (test_mmsg_name): Check VERBOSE instead + of VERBOSE_MMSGHDR. + + tests: use VERBOSE macro in ioctl_rtc and ioctl_rtc-v tests. + * tests/ioctl_rtc-v.c (VERBOSE_IOCTL): Remove. + (VERBOSE): Define to 1. + * tests/ioctl_rtc.c (print_rtc_time): Check VERBOSE instead + of VERBOSE_IOCTL. + + tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests. + * tests/ioctl_evdev-v.c (VERBOSE_IOCTL): Remove. + (VERBOSE): Define to 1. + * tests/ioctl_evdev.c: Check VERBOSE instead of VERBOSE_IOCTL. + + tests: use VERBOSE macro in execveat and execveat-v tests. + * tests/execveat-v.c (VERBOSE_EXECVEAT): Remove. + (VERBOSE): Define to 1. + * tests/execveat.c (main): Check VERBOSE instead of VERBOSE_EXECVEAT. + + tests: use VERBOSE macro in execve and execve-v tests. + * tests/execve-v.c (VERBOSE_EXECVE): Remove. + (VERBOSE): Define to 1. + * tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE. + +2016-09-26 Dmitry V. Levin + + tests: add VERBOSE macro. + Introduce VERBOSE macro (defaults to 0) that is expected to be defined + to 1 by code testing "strace -v" output. + + * tests/tests.h [!VERBOSE] (VERBOSE): New macro. + +2016-09-20 Dmitry V. Levin + + decode_open: print the mode argument when O_TMPFILE flag is set. + O_TMPFILE reqires the mode argument (just like O_CREAT), so print it. + + * open.c (STRACE_O_TMPFILE): New macro. + (decode_open): Print the mode argument when O_TMPFILE flag is set. + * tests/open.c (main): Check it. + Fixes RH#1377846. + +2016-09-20 Dmitry V. Levin + + tests: use sprintrc in tests/ptrace.c. + * tests/ptrace.c (errstr): New static variable. + (do_ptrace): Initialize it using sprintrc. + (test_peeksiginfo, main): Use errstr. + + tests: use sprintrc in tests/netlink_protocol.c. + * tests/netlink_protocol.c (main): Use sprintrc. + + tests: use sprintrc in tests/fchownat.c. + * tests/fchownat.c (main): Use sprintrc. + + tests: use sprintrc in tests/fchmodat.c. + * tests/fchmodat.c (main): Use sprintrc. Add more fchmodat decoding tests. + + tests: use sprintrc in tests/fchmod.c. + * tests/fchmod.c (main): Use sprintrc. Add more fchmod decoding tests. + * tests/fchmod.test: Update the value specified for strace -a parameter. + + tests: use sprintrc in tests/getgroups.c. + * tests/getgroups.c (main): Use sprintrc. + + tests: use sprintrc in tests/setgroups.c. + * tests/setgroups.c (main): Use sprintrc. + +2016-09-19 Dmitry V. Levin + + tests/utime.c: rewrite without assert. + * tests/utime.c: Do not include . + (main): Use sprintrc instead of assert. + + tests/xattr.c: rewrite without assert. + * tests/xattr.c: Do not include . + (main): Use sprintrc instead of assert. + + tests: use sprintrc in tests/xchownx.c. + * tests/xchownx.c (main): Do not include . Use sprintrc. + + tests/xstatfsx.c: fix potential errno clobbering. + * tests/xstatfsx.c (main): Use sprintrc. + +2016-09-19 Dmitry V. Levin + + Add more fs magic constants. + Add *_MAGIC constants defined for some relatively widespread + non-mainline filesystems. + + * xlat/fsmagic.in: Add AUFS_SUPER_MAGIC, GPFS_SUPER_MAGIC, + VZFS_SUPER_MAGIC, and ZFS_SUPER_MAGIC constants. + +2016-09-15 Eugene Syromyatnikov + + tests: fix whitespace for explicit type casts in futex test. + +2016-09-14 Dmitry V. Levin + + Add more fs magic constants. + Add *_MAGIC constants defined inside linux fs but not explicitly + exported via linux uapi. + + * xlat/fsmagic.in: Add HFS_SUPER_MAGIC, HFSPLUS_SUPER_MAGIC, + EXOFS_SUPER_MAGIC, CEPH_SUPER_MAGIC, UBIFS_SUPER_MAGIC, JFS_SUPER_MAGIC, + BEFS_SUPER_MAGIC, NTFS_SB_MAGIC, XFS_SB_MAGIC, CONFIGFS_MAGIC, + FUSE_CTL_SUPER_MAGIC, FUSE_SUPER_MAGIC, AFS_FS_MAGIC, OCFS2_SUPER_MAGIC, + VXFS_SUPER_MAGIC, LOGFS_MAGIC, SMB2_MAGIC_NUMBER, and CIFS_MAGIC_NUMBER + constants. + +2016-09-14 Dmitry V. Levin + + Update fs *_MAGIC constants. + Add fs *_MAGIC constants exported by linux uapi. + + * xlat/fsmagic.in: Add BFS_MAGIC, GFS2_MAGIC, and ROMFS_MAGIC constants + defined in linux/bfs_fs.h, linux/gfs2_ondisk.h, and linux/romfs_fs.h, + respectively. + +2016-09-13 Dmitry V. Levin + + tests: workaround limited semctl implementation in musl. + musl libc forwards semctl command argument for 8 known commands only, + for all the rest it passes 0 instead. + + * tests/ipc_sem.c (main): Update semctl expected output. + +2016-09-13 Eugene Syromyatnikov + + tests: add more IPC decoding checks. + * tests/ipc_msg.c: Additional msgget (parameter format) and msgctl + (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT + commands) checks. + * tests/ipc_sem.c: Additional semget and semctl checks. + * tests/ipc_shm.c: Additional shmget and shmctl checks. + * tests/semop.c: Additional semop checks. Add checks for semtimedop. + * tests/semop.test: Add explicit -e parameter in order to trace both + semop and semtimedop. + * tests/shmxt.c: Additional shmat and shmdt checks. + +2016-09-12 Dmitry V. Levin + + .mailmap: add addresses of Dr. David Alan Gilbert. + * .mailmap: Add both addresses of Dr. David Alan Gilbert here to avoid + duplications in CREDITS file. + +2016-09-12 Eugene Syromyatnikov + + .mailmap: add canonical name for Eugene Syromyatnikov. + This is needed due to apparent deviation in spelling of commit author + name in several commits. + + * .mailmap: Add canonical name for Eugene Syromyatnikov. + +2016-09-12 Dmitry V. Levin + + Update generic ioctl entries from linux 4.8. + * linux/64/ioctls_inc.h: Update from linux v4.8 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + +2016-09-12 Gleb Fotengauer-Malinovskiy + + x32: update ioctl entries from linux 4.8. + * linux/x32/ioctls_inc0.h: Update from linux v4.8 using ioctls_gen.sh. + + maint: update for linux 4.8. + * maint/ioctls_sym.sh: Add workarounds for linux/atm_zatm.h and + xen/evtchn.h files. + +2016-09-12 Dmitry V. Levin + + tests: use sprintrc_grep in tests/ipc_shm.c. + * tests/ipc_shm.c (main): Use sprintrc_grep. + + tests: use sprintrc_grep in tests/ipc_sem.c. + * tests/ipc_sem.c (main): Use sprintrc_grep. + +2016-09-11 Dmitry V. Levin + + tests: use sprintrc_grep in tests/ipc_msg.c. + * tests/ipc_msg.c (main): Use sprintrc_grep. + +2016-09-10 Dmitry V. Levin + + tests: use sprintrc in tests/chmod.c. + * tests/chmod.c (main): Use sprintrc. Add more chmod decoding tests. + +2016-09-09 Dmitry V. Levin + + ipc: fix printing of nsops argument of semop and semtimedop syscalls. + According to POSIX, nsops argument of semop syscall has type size_t, + but the kernel treats nsops argument of semop and semtimedop syscalls + as unsigned int. + + * ipc_sem.c (tprint_sembuf_array): Change type of "count" argument + from unsigned long to unsigned int, print it using %u format. + +2016-09-09 Eugene Syromyatnikov + + tests/aio.c: bring indentation in conformance with the rest of the file. + +2016-09-09 Eugene Syromyatnikov + + tests: use predefined constant in aio_context_t checks in aio test. + Also fix io_cancel and io_destroy checks which did not check correct + printing of context argument properly. + + * tests/aio.c (main): Update syscall checks in order to use newly + defined bogus_ctx constant. + +2016-09-09 Dmitry V. Levin + + Mark io_setup and io_destroy as memory mapping related syscalls. + As io_setup syscall allocates some memory using do_mmap_pgoff, and + io_destroy deallocates this memory using vm_munmap, set TRACE_MEMORY + flag for all sysentries of io_setup and io_destroy using the following + oneliner: + sed -ri '/io_setup|io_destroy/ s/0,/TM,/' linux/*/syscallent*.h + + * linux/*/syscallent*.h (io_setup, io_destroy): Change sys_flags to TM. + +2016-09-08 Dmitry V. Levin + + travis: add x86 musl. + * .travis.yml (matric): Add musl-gcc/x86. + * travis-build.sh [TARGET == x86]: Specify --target along with --build + to configure. + * travis-install.sh [CC == musl-gcc && TARGET == x32]: Add -mx32 to $CC. + [CC == musl-gcc && TARGET == x86]: Add -m32 to $CC. Specify --build + and --target to musl configure invocation. + +2016-09-08 Eugene Syromyatnikov + + tests: use PRI__*64 macros in aio test. + It was incorrectly assumed that __*64 types are long long on all + platforms, despite strace having specially crafted macros in order + to handle precisely this architecture discrepancy. + The commit fixes this oversight. + + * tests/aio.c (main): Use PRI__*64 macros for correct format conversion + specifiers for __*64-typed values. + +2016-09-08 Eugene Syromyatnikov + + ipc: fix printing of integer arguments. + * ipc_msgctl.c (SYS_FUNC(msgctl)): As msqid argument is treated as int + by the kernel, cast it to int and print it using %d format. + * ipc_sem.c (SYS_FUNC(semop), SYS_FUNC(semtimedop)): Likewise, + for semid argument. + (SYS_FUNC(semget)): Likewise, for nsems argument. + (SYS_FUNC(semctl)): Likewise, for semid and semnum arguments. + * ipc_shm.c (SYS_FUNC(shmat)): Likewise, for shmid argument. + * ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise. + +2016-09-08 Dmitry V. Levin + + ipc: fix printing key_t arguments of msgget, semget, and shmget syscalls + * ipc_msg.c (SYS_FUNC(msgget)): As key_t type in the kernel + is __kernel_key_t (i.e. int), cast key_t argument to int + and print it using %#x format. + * ipc_sem.c (SYS_FUNC(semget)): Likewise. + * ipc_shm.c (SYS_FUNC(shmget)): Likewise. + * tests/ipc_msg.c (main): Test it. + * tests/ipc_sem.c (main): Likewise. + * tests/ipc_shm.c (main): Likewise. + +2016-09-08 Eugene Syromyatnikov + + tests: add more sched_getattr and sched_setattr decoding checks. + * tests/sched_xetattr.c (main): Add more sched_getattr and sched_setattr + decoding checks. + +2016-09-08 Eugene Syromyatnikov + + tests: change type of sched_nice field to signed in sched_xetattr test. + Kernel headers declare this field as s32, and strace prints it with %d + specifier. + + * tests/sched_xetattr.c (main): Change type of sched_nice field of struct + sched_attr to int32_t, update format specifiers accordingly. + +2016-09-08 Eugene Syromyatnikov + + tests: add sprintrc_grep function to libtests. + New sprintrc_grep function is sprintrc function equivalent suitable for + tests where grep-base pattern matching is employed. + + * tests/tests.h (sprintrc_grep): New prototype. + * tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration. + (sprintrc_ex): New function, renamed from sprintrc and updated to + support different formats. + (sprintrc): Change to use sprintrc_ex with SPRINTRC_FMT_RAW. + (sprintrc_grep): New function, calls sprintrc_ex with SPRINTRC_FMT_GREP. + +2016-09-08 Eugene Syromyatnikov + + tests: perform more strict structure allocation in sched_xetattr test. + Use tail_alloc with precise size of the structure. + + * tests/sched_xetattr.c (main): Eliminate usage of anonymous union type. + Rename sched to sched_attr. Change type of sched_attr to struct + pointer. Use tail_alloc for sched_attr allocation, update printf + statements accrodingly. + +2016-09-08 Eugene Syromyatnikov + + tests: split long lines in sched_xetattr test. + * tests/sched_xetattr.c (main): Split long lines. + +2016-09-07 Dmitry V. Levin + + tests/aio.c: fix for x32 personality. + * tests/aio.c (main): Do not pass 64-bit aio_context_t to io_submit + and io_getevents until strace learns how to print 64-bit pointers on x32 + and on x86_64 for x32 personality. + +2016-09-07 Dmitry V. Levin + + aio: print aio_context_t as a pointer type. + As aio_context_t is treated by the kernel as a pointer, + print it using printaddr. + + * aio.c (SYS_FUNC(io_setup)): Print the pointer to aio_context_t + argument using printnum_ptr. + (SYS_FUNC(io_destroy), SYS_FUNC(io_submit), SYS_FUNC(io_cancel), + SYS_FUNC(io_getevents)): Print aio_context_t argument using printaddr. + * tests/aio.c (sprint_aio_context_t): Remove. + (main): Update expected output. + +2016-09-07 Dmitry V. Levin + + tests/aio.c: rewrite without assert. + * tests/aio.c: Do not include . + (main): Use sprintrc instead of assert. + +2016-09-06 Eugene Syromyatnikov + + tests: add more aio decoding checks. + * tests/aio.c (sprint_aio_context_t): New function. + (main): Use it; add more checks. + +2016-09-06 Eugene Syromyatnikov + + tests: add suffix and cast to 64-bit constants in aio test. + This helps to avoid warnings like + "integer constant is too large for ‘long’ type" + reported by some versions of gcc on 32-bit platforms. + + * tests/aio.c (main): Add ULL suffix to 64-bit constants + and cast them to unsigned long. + +2016-09-05 Eugene Syromyatnikov + + tests: check decoding of perf_event_open syscall. + * tests/perf_event_open.c: New file. + * tests/perf_event_open.test: New test. + * tests/.gitignore: Add perf_event_open. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add perf_event_open.test. + + Makefile.am: use pwd instead of realpath. + * Makefile.am (CODE_COVERAGE_GENHTML_OPTIONS): Use standard pwd(1) + instead of less widespread realpath(1) utility from GNU coreutils. + +2016-09-05 Dmitry V. Levin + + tests: use sprintrc in tests/xetpriority.c. + * tests/xetpriority.c (main): Use sprintrc. + + tests: use sprintrc in vhangup.test. + * tests/vhangup.c (main): Use sprintrc. + + tests: use sprintrc in tests/sockname.c. + * tests/sockname.c (test_sockname_syscall): Use sprintrc. + + tests: use sprintrc in signalfd4.test. + * tests/signalfd4.c (main): Use sprintrc. + + tests: use sprintrc in setrlimit.test. + * tests/setrlimit.c (main): Use sprintrc. + + tests: use sprintrc in set_mempolicy.test. + * tests/set_mempolicy.c (main, print_nodes): Use sprintrc. + + tests: use sprintrc in openat.test. + * tests/openat.c (main): Use sprintrc. + + tests: use sprintrc in open.test. + * tests/open.c (main): Use sprintrc. + + tests: use sprintrc in move_pages.test. + * tests/move_pages.c (print_stat_pages, print_move_pages): Use sprintrc. + + tests: use sprintrc in mlockall.test. + * tests/mlockall.c (main): Use sprintrc. + + tests: use sprintrc in mlock.test. + * tests/mlock.c (main): Use sprintrc. + + tests: use sprintrc in epoll_create1.test. + * tests/epoll_create1.c (main): Use sprintrc. + +2016-09-05 Eugene Syromyatnikov + + tests: fix printing of min_nr and nr arguments of io_getevents syscall. + * tests/aio.c (main): Change output format for min_nr and nr arguments + in io_getevents check to %ld, cast these arguments to long. + + tests: use sprintrc for return code output in aio test. + * tests/aio.c (main): Use sprintrc for return code output. + + tests: add more tests for ched_rr_get_interval decoding. + * tests/sched_rr_get_interval.c (main): Check decoding of invalid + timespec pointer and successful syscall invocation. + + tests: use sprintrc for return code output in sched_rr_get_interval test + * tests/sched_rr_get_interval.c (main): Use sprintrc for return code + output. + + tests: add more tests for sched_getscheduler and sched_xetscheduler. + * tests/sched_xetscheduler.c (main): Check for decoding of invalid PID + in sched_getscheduler and sched_setscheduler, invalid address + of sched_param structure, and invalid policy value. + + tests: use sprintrc for return code output in sched_xetscheduler test. + * tests/sched_xetscheduler.c (main): Use sprintrc for return code output. + +2016-09-05 Eugene Syromyatnikov + + aio: use printfd for fd printing. + struct iocb contains two fields with fd semantics: aio_fildes and + aio_resfd. It is quite reasonable to use the appropriate function for + printing them (apart from just "%d"). + + * aio.c (print_common_flags): Add struct tcb pointer to parameter list; + use printfd for printing aio_resfd field. + (print_iocb_header): Add struct tcb pointer to parameter list; + use printfd for printing aio_fildes field. + (print_iocb): Provide tcp argument to print_iocb_header + and print_common_flags. + (SYS_FUNC(io_cancel)): Likewise. + +2016-09-05 Dmitry V. Levin + + sh64: wire up new syscalls. + * linux/sh64/syscallent.h [380..393]: New entries. + +2016-09-02 Dmitry V. Levin + + sh: wire up new syscalls. + * linux/sh/syscallent.h [369..382]: New entries. + +2016-09-05 Dmitry V. Levin + + avr32: wire up preadv2 and pwritev2 syscalls. + * linux/avr32/syscallent.h [326]: Add preadv2 entry. + [327]: Add pwritev2 entry. + +2016-09-05 Eugene Syromyatnikov + + tests: check decoding of readahead syscall. + * configure.ac (AC_CHECK_FUNCS): Add readahead. + * tests/readahead.c: New file. + * tests/readahead.test: New test. + * tests/.gitignore: Add readahead. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add readahead.test. + +2016-09-02 Eugene Syromyatnikov + + tests: move sprintrc function to libtests. + * tests/tests.h (sprintrc): New prototype. + * tests/futex.c (sprintrc): Move to ... + * tests/sprintrc.c: ... new file. + * tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c. + + tests/futex: add support to sprintrc for return codes other than 0 and -1 + * tests/futex.c (sprintrc): Print the actual return code provided, + not just "0". Check snprintf return code. + + tests/futex: increase sprintrc static buffer size. + * tests/futex.c (sprintrc): Increase buffer size from 256 to 4096. + + tests/futex: rename retstr to sprintrc. + * tests/futex.c (retstr): Rename to sprintrc. + (main): Convert all retstr calls to sprintrc. + +2016-09-01 Eugene Syromyatnikov + + readahead: fix print format for the "count" argument. + According to documentation and kernel's syscalls.h, its type is size_t, + so "%lu" format should be used instead of "%ld". + + * readahead.c (SYS_FUNC(readahead)): Fix conversion specifier + for the "count" argument. + +2016-08-31 Dmitry V. Levin + + tests/xstatx.c: use zero_extend_signed_to_ull/sign_extend_unsigned_to_ll + Use zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros + instead of explicit casts with unpredictable sign extension semantics. + + * tests/xstatx.c (print_time, main): Use zero_extend_signed_to_ull + instead of explicit cast. + (print_stat): Use zero_extend_signed_to_ull and + sign_extend_unsigned_to_ll instead of explicit casts. + +2016-08-31 Dmitry V. Levin + + tests: add sign_extend_unsigned_to_ll macro. + * tests/tests.h (sign_extend_unsigned_to_ll): New macro from defs.h. + +2016-08-31 Eugene Syromiatnikov + + Refactor common sa_handler printing code. + * xlat/sa_handler_values.in: New file. + * signal.c: Include "xlat/sa_handler_values.h". + (get_sa_handler_str, print_sa_handler): New functions. + (SYS_FUNC(sigsetmask), SYS_FUNC(signal), decode_new_sigaction): Use them. + +2016-08-31 Dmitry V. Levin + + Update TCP* constants. + * xlat/socktcpoptions.in: Add TCP_REPAIR_WINDOW introduced by linux + kernel commit v4.8-rc1~140^2~226. + +2016-08-30 Dmitry V. Levin + + Update SCTP_* constants. + * xlat/socksctpoptions.in: Add SCTP_PR_SUPPORTED, SCTP_DEFAULT_PRINFO, + and SCTP_PR_ASSOC_STATUS introduced by linux kernel commits + v4.8-rc1~140^2~148^2~5, v4.8-rc1~140^2~148^2~4, and + v4.8-rc1~140^2~148^2~3, respectively. + + Update fs *_MAGIC constants. + * xlat/fsmagic.in: Add BALLOON_KVM_MAGIC and ZSMALLOC_MAGIC introduced + by linux kernel commits v4.8-rc1~147^2~82 and v4.8-rc1~147^2~74, + respectively. + + Update KEXEC_ARCH_* constants. + * xlat/kexec_arch_values.in: Add KEXEC_ARCH_AARCH64 introduced by linux + kernel commit v4.8-rc1~16^2~41. + + Update ETH_P_* constants. + * xlat/ethernet_protocols.in: Add ETH_P_NCSI introduced by linux kernel + commit v4.8-rc1~140^2~65^2~8. + + Update BPF_* constants. + * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_CGROUP_ARRAY introduced + by linux kernel commit v4.8-rc1~140^2~212^2~2. + * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_XDP introduced + by linux kernel commit v4.8-rc1~140^2~64^2~10. + +2016-08-30 Dmitry V. Levin + + Remove HAVE_SIGACTION checks. + The syscall parsers guarded by HAVE_SIGACTION check have to be compiled + regardless of libc sigaction function availability. + + * configure.ac (AC_CHECK_FUNCS): Remove sigaction. + * signal.c: Remove HAVE_SIGACTION checks. + +2016-08-30 Dmitry V. Levin + + Remove obsolescent autoconf macro AC_TYPE_SIGNAL. + All supported systems are expected to have C89 conforming sematics. + + * configure.ac (AC_TYPE_SIGNAL): Remove. + +2016-08-30 Dmitry V. Levin + + Remove obsolescent autoconf macro AC_C_CONST. + All supported systems are expected to have the 'const' keyword. + + * configure.ac (AC_C_CONST): Remove. + +2016-08-30 Eugene Syromiatnikov + + tests: check decoding of futex syscall. + * tests/futex.c: New file. + * tests/futex.test: New test. + * tests/.gitignore: Add futex. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add futex.test. + +2016-08-30 Eugene Syromyatnikov + + futex: do not pretend is included. + As configure.ac does not check for linux/futex.h, HAVE_LINUX_FUTEX_H is + never defined and therefore the inclusion of guarded by + HAVE_LINUX_FUTEX_H makes no sense. + + Moreover, used to have an incorrect definition + of FUTEX_WAIT_BITSET_PRIVATE and FUTEX_WAKE_BITSET_PRIVATE: + since kernel commit v2.6.24-6320-gcd68998 where these definitions + were initially introduced and up to v2.6.31-7082-gf8d1e54 where they + were finally fixed these macros had been incorrectly defined via + FUTEX_WAIT_BITS and FUTEX_WAKE_BITS instead of FUTEX_WAIT_BITSET + and FUTEX_WAKE_BITSET, and these incorrect definitions made their way + into some distributions still in use. + + * futex.c [HAVE_LINUX_FUTEX_H]: Remove. + +2016-08-30 Eugene Syromyatnikov + + futex: avoid printing val when it is not used by the futex command. + This is analogous to timeout argument omitting in FUTEX_WAKE_BITSET + command. + + * futex.c (SYS_FUNC(futex)): Remove common printing of val argument. + Add printing of val argument for all futex commands except + FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI. + +2016-08-30 Eugene Syromyatnikov + + xlat: add FUTEX_WAIT* commands with FUTEX_CLOCK_REALTIME bit set. + * xlat/futexops.in: Add FUTEX_WAIT|FUTEX_CLOCK_REALTIME and + FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME values supported by linux kernel + since commit v4.5-rc1~172^2. + +2016-08-30 Eugene Syromyatnikov + + futex: fix formatting of unknown command argument. + Use alternate form for printing hexadecimal numbers to avoid confusion. + Use printaddr to print uaddr as the latter is interpreted as a pointer + in all currently supported futex operations. + + * futex.c (SYS_FUNC(futex)): Fix formatting of unknown command + argument. + +2016-08-30 Eugene Syromyatnikov + + futex: add handling of FUTEX_FD command. + Since obsolete FUTEX_FD command is known and used to have some expected + argument format, print FUTEX_FD using that format. + + * futex.c (SYS_FUNC(futex)): Handle FUTEX_FD command. + +2016-08-30 Eugene Syromyatnikov + + futex: fix formatting of val3 hexadecimal argument. + * futex.c (SYS_FUNC(futex)): In FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET, + print hexadecimal val3 argument in alternate form to avoid confusion. + +2016-08-30 Eugene Syromyatnikov + + futex: fix FUTEX_WAKE_OP compare function mask. + According to the initial and current (v4.7) kernel implementations, + in FUTEX_WAKE_OP case the compare function does not have + FUTEX_OP_OPARG_SHIFT flag and occupies 4 bits starting with bit 24. + + * futex.c (SYS_FUNC(futex)): Do not print FUTEX_OP_OPARG_SHIFT + for 27th bit of val3 in FUTEX_WAKE_OP case. + +2016-08-30 Dmitry V. Levin + + tests: use correct m32/mx32 st_mtime_nsec checks in tests/xstatx.c. + * bootstrap: Add -DMPERS_IS_$(MPERS_NAME) to ARCH_MFLAGS. + * tests/xstatx.c [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]: + Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC + to HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC. + [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]: + Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC + to HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC. + [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]: + Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC + to HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC. + [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]: + Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC + to HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC. + + Based on patch by James Clarke . + +2016-08-30 Dmitry V. Levin + + Remove redundant check for PTRACE_LISTEN availability. + As ptrace.h already ensures that PTRACE_LISTEN is defined, + there is no need to check this fact in other places. + + * strace.c (ptrace_restart): Do not check that PTRACE_LISTEN is defined. + +2016-08-30 Dmitry V. Levin + + Remove unused autoconf macro AC_TYPE_GETGROUPS. + strace code does not use GETGROUPS_T. + + * configure.ac (AC_TYPE_GETGROUPS): Remove. + +2016-08-30 Dmitry V. Levin + + Remove unused autoconf macro AC_TYPE_MODE_T. + strace code already redefines mode_t. + + * configure.ac (AC_TYPE_MODE_T): Remove. + +2016-08-30 James Clarke + + Use PTRACE_SUNDETACH everywhere on SPARC and SPARC64. + SPARC has a different PTRACE_DETACH value correctly defined in + sys/ptrace.h, but linux/ptrace.h clobbers it with the standard one. + PTRACE_SUNDETACH is also defined to the correct value by sys/ptrace.h, + so use that instead. + + * strace.c (detach) [SPARC]: Move redefinition of PTRACE_DETACH + to PTRACE_SUNDETACH ... + * ptrace.h [SPARC || SPARC64]: ... here. + +2016-08-29 Dmitry V. Levin + + Remove obsolescent autoconf macro AC_HEADER_STDC. + All systems supported by strace are expected to have C89 conforming + header files. + + * configure.ac (AC_HEADER_STDC): Remove. + +2016-08-29 Dmitry V. Levin + + Remove unneeded autoconf macro AC_HEADER_DIRENT. + strace code already includes unconditionally. + + * configure.ac (AC_HEADER_DIRENT): Remove. + +2016-08-28 Dmitry V. Levin + + Remove unneeded autoconf macro AC_HEADER_STDBOOL. + strace code assumes C99. + + * configure.ac (AC_HEADER_STDBOOL): Remove. + * defs.h: Include unconditionally. + +2016-08-27 Dmitry V. Levin + + Remove obsolescent autoconf macro AC_HEADER_STAT. + No systems supported by strace are expected to have the bug workarounded + by AC_HEADER_STAT macro. + + * configure.ac (AC_HEADER_STAT): Remove. + +2016-08-29 Dmitry V. Levin + + Do not use AC_HEADER_MAJOR, include unconditionally. + glibc, starting with commit glibc-2.24-28-gdbab657, has deprecated + inclusion of by . The method used + for deprecation breaks AC_HEADER_MAJOR: this autoconf macro no longer + defines MAJOR_IN_SYSMACROS, which consequently breaks build. + + Let's assume that all systems supported by strace provide major, minor, + and makedev macros via . + + * configure.ac (AC_HEADER_MAJOR): Remove. + * mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove. + Include unconditionally. + * print_struct_stat.c: Likewise. + * tests/mknod.c: Likewise. + * tests/mknodat.c: Likewise. + * tests/xstatx.c: Likewise. + +2016-08-29 Dmitry V. Levin + + btrfs: mpersify struct btrfs_ioctl_vol_args_v2. + This complements commit v4.11-719-gfb0c609. + + * btrfs.c (struct_btrfs_ioctl_vol_args_v2): New type. Mpersify it. + (btrfs_print_qgroup_inherit): Change qgi_addr type to unsigned long. + (btrfs_ioctl): Replace struct btrfs_ioctl_vol_args_v2 with + struct_btrfs_ioctl_vol_args_v2. + +2016-08-29 Elvira Khabirova + + mpers.awk: relax union member name absence check. + This fixes mpersing of unions containing nameless members, + e.g. struct btrfs_ioctl_vol_args_v2. + + * mpers.awk (what_is): Print names of union_type members as is. + +2016-08-24 Dmitry V. Levin + + Revert "tests/xstatx.c: fix stat syscall tests on mips64" + Previous commit effectively changed types of st_atime, st_ctime, and + st_mtime members of struct stat and struct stat64 to signed integers, + making the mips64 workaround obsolete. + + This reverts commit 3fb84bfc79949c145197c61fbf04ce18464e9112. + + * tests/xstatx.c (create_sample) [__mips64]: Remove. + +2016-08-24 Dmitry V. Levin + + Mpersify parsers of struct stat and struct stat64. + On many architectures that support multiple personalities, + struct stat differ between personalities. While old code could handle + these differences, there are some architectures, e.g. sparc64, that also + have different struct stat64. Rewrite parsers using mpers functionality + to fix these issues. + + * fetch_struct_stat.c: New file. + * fetch_struct_stat64.c: Likewise. + * print_struct_stat.c: Likewise. + * oldstat.c: Likewise. + * stat.c: Likewise. + * stat.h: Likewise. + * stat64.c: Likewise. + * file.c: Remove. + * printstat.h: Likewise. + * linux/aarch64/stat32.h: Likewise. + * linux/powerpc64/stat32.h: Likewise. + * linux/riscv/stat32.h: Likewise. + * linux/sparc64/stat32.h: Likewise. + * linux/tile/stat32.h: Likewise. + * linux/x32/stat32.h: Likewise. + * linux/x86_64/stat32.h: Likewise. + * Makefile.am (strace_SOURCES): Add fetch_struct_stat.c, + fetch_struct_stat64.c, print_struct_stat.c, oldstat.c, stat.c, stat.h, + and stat64.c. Remove file.c, printstat.h, linux/aarch64/stat32.h, + linux/powerpc64/stat32.h, linux/riscv/stat32.h, linux/sparc64/stat32.h, + linux/tile/stat32.h, linux/x32/stat32.h, and linux/x86_64/stat32.h. + * configure.ac (AC_CHECK_MEMBERS): Add struct stat64.st_mtime_nsec. + * defs.h (struct strace_stat): New declaration. + (print_struct_stat): New prototype. + * linux/dummy.h (sys_fstatat64): Remove. + +2016-08-24 Dmitry V. Levin + + mpers.m4: check for struct stat64, struct stat, and their members. + * m4/mpers.m4 (st_MPERS_STRUCT_STAT): New macro. + (st_MPERS): Use it. + +2016-08-24 Dmitry V. Levin + + mpers: add MPERS_IS_* to CFLAGS passed to mpers.sh. + This allows testing of MPERS_IS_* macros in pre-MPERS_DEFS parts + of source code. + + * Makefile.am (mpers-m%.stamp): Add -DMPERS_IS_$(mpers_NAME) to CFLAGS + passed to mpers.sh. + * mpers_test.sh: Likewise. + +2016-08-24 Dmitry V. Levin + + Move redefinition of stat types to asm_stat.h. + * file.c: Move redefinition of types that might be used + to define struct stat ... + * linux/asm_stat.h: ... here. + * tests/xstatx.c: Remove redefinition of stat types. + +2016-08-24 Dmitry V. Levin + + x86_64: provide a replacement of for x32 personality. + For the reason described in commit v4.10-517-gcfde1e3, a correct + definition of struct stat for x32 personality is necessary to enable + "asm_stat.h" with -mx32 on x86_64. + + * linux/x32/asm_stat.h: Rename to ... + * linux/x86_64/asm_stat.h: ... new file. + * Makefile.am (strace_SOURCES): Add it. + * linux/x32/asm_stat.h: New file, include "x86_64/asm_stat.h". + +2016-08-24 Dmitry V. Levin + + x32/asm_stat.h: provide definitions for i386 personality. + This enables x32/asm_stat.h with -m32. + + * linux/x32/asm_stat.h [__x86_64__ && __ILP32__]: Redirect stat. + Include "linux/asm_stat.h". + (struct stat): Define for [__x86_64__ && __ILP32__] only. + (struct __old_kernel_stat): Remove. + +2016-08-23 Dmitry V. Levin + + Introduce a separate SEN entry for fstatat64 syscall. + * linux/dummy.h (sys_fstatat64): Redirect to sys_newfstatat. + * linux/32/syscallent.h: Replace SEN(newfstatat) with SEN(fstatat64). + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * pathtrace.c (pathtrace_match): Handle SEN_fstatat64. + +2016-08-23 Dmitry V. Levin + + Do not check for struct stat.st_{a,c}time_nsec. + Assume that the check for struct stat.st_mtime_nsec is enough. + Likewise, do not check for struct stat.st_{a,c}tim.tv_nsec. + + * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_atime_nsec, + struct stat.st_ctime_nsec, struct stat.st_atim.tv_nsec, + and struct stat.st_ctim.tv_nsec. + * file.c (HAVE_STRUCT_STAT_ST_ATIME_NSEC, + HAVE_STRUCT_STAT_ST_CTIME_NSEC): Remove. + * printstat.h (HAVE_STRUCT_STAT_ST_ATIME_NSEC, + HAVE_STRUCT_STAT_ST_CTIME_NSEC): Replace with + HAVE_STRUCT_STAT_ST_MTIME_NSEC. + * tests/xstatx.c: Likewise. + +2016-08-23 Dmitry V. Levin + + Add sign_extend_unsigned_to_ll macro. + * defs.h (sign_extend_unsigned_to_ll): New macro, mirrors + zero_extend_signed_to_ull. + + zero_extend_signed_to_ull: add short int support. + * defs.h (zero_extend_signed_to_ull): Add short int support. + * tests/tests.h: Likewise. + + Rename widen_to_ull to zero_extend_signed_to_ull. + * defs.h (widen_to_ull): Rename to zero_extend_signed_to_ull. + All callers changed. + * tests/tests.h: Likewise. + +2016-08-23 Dmitry V. Levin + + sparc, sparc64: remove obsolete code. + Remove remains of solaris personality support. + This complements commit v4.10-45-gdf4dd8b. + + * file.c [SPARC || SPARC64] (SYS_FUNC(xstat), SYS_FUNC(fxstat)): Remove. + +2016-08-22 Dmitry V. Levin + + sparc64: fix decoding of struct stat64 related syscalls. + For some reason, struct stat and struct stat64 are different on sparc64. + This change fixes decoding of struct stat64 related syscalls for sparc64 + personality, sparc32 personality on sparc64 needs more work. + + * file.c (printstat64) [SPARC64]: Do not use printstat. + (SYS_FUNC(newfstatat)): Likewise. + +2016-08-22 Eugene Syromyatnikov + + tests: fill old_value argument in timer{,fd}_xettime tests. + This is needed in order to differentiate it from the value returned + by the call. As a consequence, it enables revealing possible bugs + in syscall parsers, for example, when the value read on syscall + entering and not on syscall exiting, as it was the case with + timerfd_settime parser. + + * tests/timer_xettime.c (main): Fill old.its field with value different + from the expected one upon call return. + * tests/timerfd_xettime.c: Likewise. + +2016-08-22 Eugene Syromyatnikov + + Fix old_value argument retrieval in timerfd_settime parser. + This is done similar to timer_settime syscall parser. + + * time.c (SYS_FUNC(timerfd_settime)): Retrieve old_value argument + on exiting and not on entering. Return 0 instead of RVAL_DECODED + since the call hasn't been decoded in full on entering. + +2016-08-21 Richard W.M. Jones + + Add RISC-V architecture support. + The original port of strace was done by Palmer Dabbelt + (eecs.berkeley.edu), based on strace 4.9. + + * configure.ac: Define RISCV for riscv*. + * clone.c [RISCV]: Define ARG_* macros as for OR1K. + * defs.h [RISCV] (SUPPORTED_PERSONALITIES): Define to 2. + [RISCV] (NEED_UID16_PARSERS): Define to 1. + * linux/riscv/arch_regs.c: New file. + * linux/riscv/errnoent1.h: Likewise. + * linux/riscv/get_error.c: Likewise. + * linux/riscv/get_scno.c: Likewise. + * linux/riscv/get_syscall_args.c: Likewise. + * linux/riscv/ioctls_arch0.h: Likewise. + * linux/riscv/ioctls_arch1.h: Likewise. + * linux/riscv/ioctls_inc0.h: Likewise. + * linux/riscv/ioctls_inc1.h: Likewise. + * linux/riscv/signalent1.h: Likewise. + * linux/riscv/stat32.h: Likewise. + * linux/riscv/syscallent.h: Likewise. + * linux/riscv/syscallent1.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + +2016-08-21 Eugene Syromyatnikov + + Move SH-specific argument number calculation to getllval. + This change prevents scattering of ll-related hacks and simplifies + pread/pwrite syscalls parsers' logic a bit. + + * util.c (getllval): Add fixup for arg_no for SuperH when argument + number is equal to 3. + * io.c (PREAD_OFFSET_ARG): Remove. + (SYS_FUNC(pread)): Always use argument number 3 for "count" argument + printing. + (SYS_FUNC(pwrite)): Likewise. + +2016-08-21 Dmitry V. Levin + + sparc64: fix sigreturn decoding for sparc personality. + * linux/sparc/arch_sigreturn.c (arch_sigreturn): Parametrize + member types of struct signal_frame. + * linux/sparc64/arch_sigreturn.c (sparc64_arch_sigreturn, + sparc32_arch_sigreturn): New functions. + (arch_sigreturn): Use them. + +2016-08-20 Dmitry V. Levin + + Fix compat decoding of struct sigaction.sa_mask on big endian architectures + * signal.c (decode_new_sigaction) [SUPPORTED_PERSONALITIES > 1 && + SIZEOF_LONG > 4]: Use LONG_LONG to convert sa_mask from 32-bit + struct sigaction to 64-bit struct sigaction. + +2016-08-19 Dmitry V. Levin + + Fix decoding of indirect shmat's return code for non-native personalities + * ipc_shm.c (SYS_FUNC(shmat)): Fetch current_wordsize bytes of data + to obtain return code of indirect shmat subcall. + +2016-08-18 Dmitry V. Levin + + sparc64: fix sparc personality decoding of mmap64's offset argument. + * linux/sparc64/syscallent1.h: Remove redirection of sys_mmap_4koff. + +2016-08-19 Dmitry V. Levin + + sparc64: fix decoding of the forth argument of semctl syscall. + On sparc64, unlike all other architectures where semctl is an indirect + ipc subcall, the forth argument is passed directly. + + * ipc_sem.c (SYS_FUNC(semctl)) [SPARC64]: Print 4th argument without + indirection in case of native personality. + +2016-08-16 Dmitry V. Levin + + Add sparc64 specific ptrace constants. + * xlat/ptrace_cmds.in: Add PTRACE_GETREGS64, PTRACE_SETREGS64, + PTRACE_GETFPREGS64, and PTRACE_SETFPREGS64. + + sparc64: fix sign extension bug of syscall args for sparc personality. + * linux/sparc64/get_syscall_args.c (get_syscall_args): Zero-extend + syscall args from 32 bit for sparc personality. + +2016-08-16 Dmitry V. Levin + + sparc64: fix tty ioctl numbers. + The structures defined in asm/termbits.h have the same size + on sparc and sparc64. + + * linux/sparc64/ioctls_arch0.h (TCGETS, TCGETS2, TCSETS, TCSETS2, + TCSETSF, TCSETSF2, TCSETSW, TCSETSW2): Sync with + linux/sparc/ioctls_arch0.h + +2016-08-15 Dmitry V. Levin + + evdev.c: fix typo in comment. + +2016-08-15 Dmitry V. Levin + + Drop support of dummy members of struct stat. + As st_flags, st_fstype, and st_gen members of struct stat are not filled + by the kernel, there is no use supporting them. + + * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_flags, + struct stat.st_fstype, and struct stat.st_gen. + * file.c [STAT32_PERSONALITY, HAVE_STRUCT_STAT64]: Do not undefine + HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE, + and HAVE_STRUCT_STAT_ST_GEN. + * printstat.h (DO_PRINTSTAT): Do not check for + HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE, + and HAVE_STRUCT_STAT_ST_GEN. + +2016-08-15 Dmitry V. Levin + + Assume that struct stat contains st_blksize, st_blocks, and st_rdev. + Our test suite already assumes that struct stat contains st_blksize, + st_blocks, and st_rdev members, and there haven't been any complaints. + + * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_blksize, + struct stat.st_blocks, and struct stat.st_rdev. + * printstat.h (DO_PRINTSTAT): Do not check for + HAVE_STRUCT_STAT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_BLOCKS, + and HAVE_STRUCT_STAT_ST_RDEV. + +2016-08-15 Dmitry V. Levin + + tests: fix pause.test when pause syscall is not available. + * tests/pause.c (main): Fix expected output when pause syscall + is not available. + +2016-08-14 Dmitry V. Levin + + powerpc64, sparc64: fix redefinitions of ARCH_PC_REG. + This fixes compilation warning that ARCH_PC_REG is redefined. + + * linux/powerpc64/arch_regs.c (ARCH_PC_REG): Undefine before + the new definition. + * linux/sparc64/arch_regs.c (ARCH_PC_REG): Likewise. + +2016-08-14 Dmitry V. Levin + + s390x, x32: remove redundant definitions of ARCH_PC_REG. + * linux/s390x/arch_regs.c (ARCH_PC_REG): Remove, it is already defined + in just included linux/s390/arch_regs.c. + * linux/x32/arch_regs.c (ARCH_PC_REG): Remove, it is already defined + in just included linux/x86_64/arch_regs.c. + +2016-08-13 Dmitry V. Levin + + tests: check for leaks of placeholder descriptors. + * tests/redirect-fds.c: New file. + * tests/redirect-fds.test: New test. + * tests/.gitignore: Add redirect-fds. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add redirect-fds.test. + + tests/init.sh: print exit code of failed commands. + * init.sh (run_prog, run_prog_skip_if_failed): When the program fails, + add its exit code to the diagnostic message. + (run_strace): When strace fails, add its exit code to the diagnostic + message. + (run_strace_merge): When strace-log-merge fails, add its exit code + to the diagnostic message. + +2016-08-13 Dmitry V. Levin + + Fix leakage of placeholder descriptors to tracees. + As a side effect of commit v4.11-211-g0736d4e, strace used to leak + placeholders for standard descriptors to tracees thus affecting their + behaviour. Fix this by setting close-on-exec flag on placeholder + descriptors. + + * strace.c (open_dummy_desc): Set close-on-exec flag on the descriptor + that is going to be returned to the caller. + (fd_is_placeholder): New array. + (ensure_standard_fds_opened, redirect_standard_fds): New functions. + (startup_child): Use redirect_standard_fds. + (init): Use ensure_standard_fds_opened. + +2016-08-12 Dmitry V. Levin + + sparc64: fix decoding of uid and gid-related syscalls. + sparc64 has no native 16-bit uid/gid syscalls. + + * linux/sparc64/syscallent.h (chown, lchown, setuid, getuid, setgid, + getgid, geteuid, getegid, getgroups, setgroups, fchown, setreuid, + setregid, setfsuid, setfsgid): Change handlers from 16-bit to 32-bit. + +2016-08-12 Dmitry V. Levin + + tests: fix *stat64 tests on alpha. + On some architectures including alpha, provides a + definition of struct stat that has no st_atime_nsec, st_mtime_nsec, and + st_ctime_nsec fields. At the same time, struct stat64 always has these + fields. Fix tests to take this difference into account. + + * tests/fstat64.c (STRUCT_STAT_IS_STAT64): New macro, defined to 1. + * tests/lstat64.c (STRUCT_STAT_IS_STAT64): Likewise. + * tests/stat64.c (STRUCT_STAT_IS_STAT64): Likewise. + * tests/xstatx.c [!STRUCT_STAT] (STRUCT_STAT_IS_STAT64): New macro, + defined to 0. + [USE_ASM_STAT && STRUCT_STAT_IS_STAT64]: + (HAVE_STRUCT_STAT_ST_ATIME_NSEC, HAVE_STRUCT_STAT_ST_CTIME_NSEC, + HAVE_STRUCT_STAT_ST_MTIME_NSEC): Redefine to 1. + +2016-08-11 Dmitry V. Levin + + tests: skip rt_tgsigqueueinfo.test when the syscall is not available. + * tests/rt_tgsigqueueinfo.c (main): Skip the test when the syscall + is not available. + +2016-08-11 James Cowgill + + tests/fcntl.c: fix fcntl test on mips64. + On mips64 the F_GETLK and F_SETLKW64 constants have identical values which + causes the "wrong" constant to be printed by strace. + + tests/fcntl.c (test_flock64): Do not test F_SETLKW64 on mips64. + +2016-08-11 James Cowgill + + tests/nsyscalls.test: only trace the "syscall" syscall on mips o32. + The "syscall" syscall only exists on o32 and causes strace to error out on + 64-bit mips ABIs. Pass MIPS_ABI from the configure script through to + nsyscalls.test so the MIPS ABI can be checked. + + * configure.ac (MIPS_ABI): Substitute into output files. + * tests/Makefile.am (MIPS_ABI): Export via AM_TEST_LOG_FLAGS. + * tests/nsyscalls.test: Restrict special mips handling to mips o32. + +2016-08-11 James Cowgill + + tests/xstatx.c: fix stat syscall tests on mips64. + For historical reasons the kernel struct stat represents times as unsigned + 32-bit integers on mips64. Therefore, while it's possible to give a file a + timestamp before 1970 with futimens, reading the same timestamp through + struct stat will give a positive time (around 2106). + Workaround by using positive timestamps for testing on mips64. + + * tests/xstatx.c (create_sample): Use positive timestamps on mips64. + +2016-08-11 Dmitry V. Levin + + tests/mlock2.c: fix test failure on mips64. + * tests/mlock2.c (main): Pass unsigned long arguments to mlock2 syscall + explicitly, to avoid unwanted sign extension issues. + + Based on patch by James Cowgill + +2016-08-09 Dmitry V. Levin + + Use instead of + There are no users of SYS_* macros provided by , + and definitions of __NR_* macros could be obtained directly + from . + + * defs.h: Include instead of . + * test/seccomp.c: Likewise. + * test/threaded_execve.c: Likewise. + * test/x32_lseek.c: Likewise. + * test/x32_mmap.c: Likewise. + * tests/_newselect.c: Likewise. + * tests/access.c: Likewise. + * tests/acct.c: Likewise. + * tests/aio.c: Likewise. + * tests/alarm.c: Likewise. + * tests/attach-f-p.c: Likewise. + * tests/bpf.c: Likewise. + * tests/brk.c: Likewise. + * tests/chmod.c: Likewise. + * tests/chown.c: Likewise. + * tests/chown32.c: Likewise. + * tests/chroot.c: Likewise. + * tests/clock_adjtime.c: Likewise. + * tests/clock_nanosleep.c: Likewise. + * tests/clock_xettime.c: Likewise. + * tests/copy_file_range.c: Likewise. + * tests/creat.c: Likewise. + * tests/dup2.c: Likewise. + * tests/dup3.c: Likewise. + * tests/epoll_create.c: Likewise. + * tests/epoll_create1.c: Likewise. + * tests/epoll_ctl.c: Likewise. + * tests/epoll_pwait.c: Likewise. + * tests/epoll_wait.c: Likewise. + * tests/eventfd.c: Likewise. + * tests/execveat.c: Likewise. + * tests/faccessat.c: Likewise. + * tests/fchdir.c: Likewise. + * tests/fchmod.c: Likewise. + * tests/fchmodat.c: Likewise. + * tests/fchown.c: Likewise. + * tests/fchown32.c: Likewise. + * tests/fchownat.c: Likewise. + * tests/fcntl.c: Likewise. + * tests/fcntl64.c: Likewise. + * tests/fdatasync.c: Likewise. + * tests/flock.c: Likewise. + * tests/fstat.c: Likewise. + * tests/fstat64.c: Likewise. + * tests/fstatat64.c: Likewise. + * tests/fstatfs.c: Likewise. + * tests/fstatfs64.c: Likewise. + * tests/fsync.c: Likewise. + * tests/ftruncate.c: Likewise. + * tests/ftruncate64.c: Likewise. + * tests/futimesat.c: Likewise. + * tests/get_mempolicy.c: Likewise. + * tests/getcwd.c: Likewise. + * tests/getdents.c: Likewise. + * tests/getdents64.c: Likewise. + * tests/getegid.c: Likewise. + * tests/getegid32.c: Likewise. + * tests/geteuid.c: Likewise. + * tests/geteuid32.c: Likewise. + * tests/getgid.c: Likewise. + * tests/getgid32.c: Likewise. + * tests/getgroups.c: Likewise. + * tests/getgroups32.c: Likewise. + * tests/getpgrp.c: Likewise. + * tests/getrandom.c: Likewise. + * tests/getresgid.c: Likewise. + * tests/getresgid32.c: Likewise. + * tests/getresuid.c: Likewise. + * tests/getresuid32.c: Likewise. + * tests/getrlimit.c: Likewise. + * tests/getrusage.c: Likewise. + * tests/getuid.c: Likewise. + * tests/getuid32.c: Likewise. + * tests/getxxid.c: Likewise. + * tests/ioctl_uffdio.c: Likewise. + * tests/ioperm.c: Likewise. + * tests/iopl.c: Likewise. + * tests/ipc.c: Likewise. + * tests/kill.c: Likewise. + * tests/lchown.c: Likewise. + * tests/lchown32.c: Likewise. + * tests/libmmsg.c: Likewise. + * tests/libsocketcall.c: Likewise. + * tests/link.c: Likewise. + * tests/linkat.c: Likewise. + * tests/llseek.c: Likewise. + * tests/lseek.c: Likewise. + * tests/lstat.c: Likewise. + * tests/lstat64.c: Likewise. + * tests/mbind.c: Likewise. + * tests/membarrier.c: Likewise. + * tests/memfd_create.c: Likewise. + * tests/migrate_pages.c: Likewise. + * tests/mkdir.c: Likewise. + * tests/mkdirat.c: Likewise. + * tests/mknod.c: Likewise. + * tests/mknodat.c: Likewise. + * tests/mlock.c: Likewise. + * tests/mlock2.c: Likewise. + * tests/move_pages.c: Likewise. + * tests/newfstatat.c: Likewise. + * tests/nsyscalls.c: Likewise. + * tests/old_mmap.c: Likewise. + * tests/oldselect.c: Likewise. + * tests/open.c: Likewise. + * tests/openat.c: Likewise. + * tests/pause.c: Likewise. + * tests/poll.c: Likewise. + * tests/prctl-seccomp-filter-v.c: Likewise. + * tests/prctl-seccomp-strict.c: Likewise. + * tests/preadv2-pwritev2.c: Likewise. + * tests/prlimit64.c: Likewise. + * tests/pselect6.c: Likewise. + * tests/ptrace.c: Likewise. + * tests/readdir.c: Likewise. + * tests/readlink.c: Likewise. + * tests/readlinkat.c: Likewise. + * tests/reboot.c: Likewise. + * tests/remap_file_pages.c: Likewise. + * tests/rename.c: Likewise. + * tests/renameat.c: Likewise. + * tests/renameat2.c: Likewise. + * tests/rmdir.c: Likewise. + * tests/rt_sigpending.c: Likewise. + * tests/rt_sigprocmask.c: Likewise. + * tests/rt_sigsuspend.c: Likewise. + * tests/rt_sigtimedwait.c: Likewise. + * tests/rt_tgsigqueueinfo.c: Likewise. + * tests/sched_get_priority_mxx.c: Likewise. + * tests/sched_rr_get_interval.c: Likewise. + * tests/sched_xetaffinity.c: Likewise. + * tests/sched_xetattr.c: Likewise. + * tests/sched_xetparam.c: Likewise. + * tests/sched_xetscheduler.c: Likewise. + * tests/sched_yield.c: Likewise. + * tests/seccomp-filter-v.c: Likewise. + * tests/seccomp-filter.c: Likewise. + * tests/seccomp-strict.c: Likewise. + * tests/select.c: Likewise. + * tests/sendfile.c: Likewise. + * tests/sendfile64.c: Likewise. + * tests/set_mempolicy.c: Likewise. + * tests/setdomainname.c: Likewise. + * tests/setfsgid.c: Likewise. + * tests/setfsgid32.c: Likewise. + * tests/setfsuid.c: Likewise. + * tests/setfsuid32.c: Likewise. + * tests/setgid.c: Likewise. + * tests/setgid32.c: Likewise. + * tests/setgroups.c: Likewise. + * tests/setgroups32.c: Likewise. + * tests/sethostname.c: Likewise. + * tests/setregid.c: Likewise. + * tests/setregid32.c: Likewise. + * tests/setresgid.c: Likewise. + * tests/setresgid32.c: Likewise. + * tests/setresuid.c: Likewise. + * tests/setresuid32.c: Likewise. + * tests/setreuid.c: Likewise. + * tests/setreuid32.c: Likewise. + * tests/setrlimit.c: Likewise. + * tests/setuid.c: Likewise. + * tests/setuid32.c: Likewise. + * tests/signalfd4.c: Likewise. + * tests/socketcall.c: Likewise. + * tests/splice.c: Likewise. + * tests/stat.c: Likewise. + * tests/stat64.c: Likewise. + * tests/statfs.c: Likewise. + * tests/statfs64.c: Likewise. + * tests/swap.c: Likewise. + * tests/symlink.c: Likewise. + * tests/symlinkat.c: Likewise. + * tests/sync.c: Likewise. + * tests/sync_file_range.c: Likewise. + * tests/sync_file_range2.c: Likewise. + * tests/syslog.c: Likewise. + * tests/tee.c: Likewise. + * tests/time.c: Likewise. + * tests/timer_create.c: Likewise. + * tests/timer_xettime.c: Likewise. + * tests/timerfd_xettime.c: Likewise. + * tests/times-fail.c: Likewise. + * tests/times.c: Likewise. + * tests/truncate.c: Likewise. + * tests/truncate64.c: Likewise. + * tests/ugetrlimit.c: Likewise. + * tests/umount.c: Likewise. + * tests/umount2.c: Likewise. + * tests/uname.c: Likewise. + * tests/unix-pair-send-recv.c: Likewise. + * tests/unlink.c: Likewise. + * tests/unlinkat.c: Likewise. + * tests/userfaultfd.c: Likewise. + * tests/utimes.c: Likewise. + * tests/vhangup.c: Likewise. + * tests/vmsplice.c: Likewise. + * tests/waitid.c: Likewise. + * tests/waitpid.c: Likewise. + * tests/xet_robust_list.c: Likewise. + * tests/xetpgid.c: Likewise. + * tests/xetpriority.c: Likewise. + * tests/xettimeofday.c: Likewise. + +2016-08-09 Dmitry V. Levin + + ia64: replace SYS_clone2 with __NR_clone2. + Migrate to __NR_* the last user of SYS_* macros provided + by . + + * clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Replace + SYS_clone2 with __NR_clone2. + +2016-08-09 Dmitry V. Levin + + Make sure that tcp->s_ent and tcp->s_prev_ent do not point to freed memory + This complements commit v4.13-33-g60d7ec8. + + * syscall.c (sysent_buf): New structure. + (free_sysent_buf): New function. + (get_scno): Use them. + +2016-08-09 Dmitry V. Levin + + file.c: move definitions of struct stat32 to separate files. + * linux/aarch64/stat32.h: New file. + * linux/powerpc64/stat32.h: Likewise. + * linux/sparc64/stat32.h: Likewise. + * linux/tile/stat32.h: Likewise. + * linux/x32/stat32.h: Likewise. + * linux/x86_64/stat32.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * file.c [SUPPORTED_PERSONALITIES > 1]: Remove arch specific definitions + of struct stat32, include "stat32.h" instead. + +2016-08-09 Dmitry V. Levin + + sparc, sparc64: remove obsolete code. + Remove remains of solaris personality support. + This complements commit v4.10-45-gdf4dd8b. + + * file.c [SPARC || SPARC64]: Remove the code related to struct solstat. + (printstat, printoldstat) [SPARC || SPARC64]: Remove. + +2016-08-09 Dmitry V. Levin + + sparc64: fix decoding of stat family syscalls. + This complements commit v4.13-28-gaebfe83. + + * file.c [SPARC64]: Change STAT32_PERSONALITY to 1. + +2016-08-09 Dmitry V. Levin + + Fix decoding of invalid syscalls mapped to indirect subcalls. + When the syscall number returned by arch_get_scno is a mapped indirect + subcall (i.e. mapped subcall of socketcall or ipc syscall), do not + mistakenly treat it as a valid indirect subcall. + + * defs.h (SCNO_IS_VALID): Treat scno with TRACE_INDIRECT_SUBCALL flag + as invalid. + * syscall.c (syscall_name): Do no shuffle scno. + (trace_syscall_entering, trace_syscall_exiting): Use + tcp->s_ent->sys_name instead of syscall_name. + (get_scno): In case of invalid syscall, allocate a dynamic struct sysent + containing an appropriate .sys_name. + * tests/nsyscalls.c (main) [SYS_socket_subcall]: Check decoding + of direct syscall number SYS_socket_subcall+1. + (main) [SYS_ipc_subcall]: Check decoding of direct syscall number + SYS_ipc_subcall+1. + +2016-08-08 Dmitry V. Levin + + linux/subcall.h: remove redundant definitions. + * linux/subcall.h: Remove definitions of non-existent socket + and ipc subcalls. + + defs.h: simplify SUPPORTED_PERSONALITIES definition. + * defs.h: Group definition of SUPPORTED_PERSONALITIES by value. + +2016-08-08 Dmitry V. Levin + + defs.h: simplify PERSONALITY1_WORDSIZE definition. + Move definition of PERSONALITY1_WORDSIZE macro outside arch specific + ifdefs. + + * defs.h [SPARC64 || X86_64 || X32 || AARCH64 || POWERPC64 || TILE] + (PERSONALITY1_WORDSIZE): Remove. + [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_WORDSIZE): Define to 4 + unconditionally. + +2016-08-08 Dmitry V. Levin + + defs.h: simplify PERSONALITY0_WORDSIZE definition. + Move definition of PERSONALITY0_WORDSIZE macro outside arch specific + ifdefs. + + * defs.h (PERSONALITY0_WORDSIZE): Define to SIZEOF_LONG unconditionally. + +2016-08-08 Dmitry V. Levin + + sparc64: swap personality numbers. + Fix inconsistency between syscall and ioctl entries on sparc64. + Make layout of personalities on sparc64 the same as on other + architectures that support two personalities. + + * defs.h [SPARC64] (PERSONALITY0_WORDSIZE): Change to 8. + [SPARC64] (PERSONALITY1_WORDSIZE): Change to 4. + * linux/sparc64/get_scno.c (arch_get_scno): Swap personality numbers. + * linux/sparc64/ioctls_arch1.h: Rename to ioctls_arch0.h. + * linux/sparc64/ioctls_arch0.h: Rename to ioctls_arch1.h. + * linux/sparc64/ioctls_inc0.h: Rename to ioctls_inc1.h. + * linux/sparc64/ioctls_inc1.h: Rename to ioctls_inc0.h. + +2016-08-08 Dmitry V. Levin + + defs.h: cleanup personality specific macro definitions. + Move the code that defines PERSONALITY[12]_INCLUDE_FUNCS, + PERSONALITY[12]_INCLUDE_PRINTERS_DECLS, + PERSONALITY[12]_INCLUDE_PRINTERS_DEFS, and MPERS_{m,mx}32_IOCTL_MACROS + macros outside arch specific ifdefs. + + * defs.h [SPARC] (PERSONALITY0_WORDSIZE): Remove. + [SPARC64 && HAVE_M32_MPERS]: Remove. + [X86_64 && HAVE_M32_MPERS]: Remove. + [X86_64 && HAVE_MX32_MPERS]: Remove. + [X32 && HAVE_M32_MPERS]: Remove. + [AARCH64 && HAVE_M32_MPERS]: Remove. + [POWERPC64 && HAVE_M32_MPERS]: Remove. + [TILE && HAVE_M32_MPERS]: Remove. + (PERSONALITY0_INCLUDE_PRINTERS_DECLS, + PERSONALITY0_INCLUDE_PRINTERS_DEFS): Define unconditionally. + [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] + (PERSONALITY1_INCLUDE_PRINTERS_DECLS, + PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_FUNCS, + MPERS_m32_IOCTL_MACROS): Define for + [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] case. + (PERSONALITY2_INCLUDE_PRINTERS_DECLS, + PERSONALITY2_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_FUNCS, + MPERS_mx32_IOCTL_MACROS): Define for + [SUPPORTED_PERSONALITIES > 2 && HAVE_MX32_MPERS] case. + +2016-08-07 Dmitry V. Levin + + Change #include guard trailing part comments. + * defs.h: Change comment of the trailing part of #include guard. + * flock.h: Likewise. + * gcc_compat.h: Likewise. + * ipc_defs.h: Likewise. + * kernel_types.h: Likewise. + * mpers_type.h: Likewise. + * msghdr.h: Likewise. + * printsiginfo.h: Likewise. + * ptrace.h: Likewise. + * regs.h: Likewise. + * seccomp_fprog.h: Likewise. + * sigevent.h: Likewise. + * statfs.h: Likewise. + * xlat.h: Likewise. + +2016-08-08 Eugene Syromyatnikov + + Unify usage of #include guards. + This commit is an attempt to unify usage of include guards (in top-level + headers, at least). As a side note, different files with *.h extension + have different semantics: for example, printargs.h is included multiple + times in order to generate slightly varying code depending on values of + macro definitions - maybe it's better to change extension of such files + to something like *.inc. + + * defs.h: Add #include guard. + * flock.h: Likewise. + * ipc_defs.h: Likewise. + * mpers_type.h: Likewise. + * printsiginfo.h: Likewise. + * ptrace.h: Likewise. + * regs.h: Likewise. + * seccomp_fprog.h: Likewise. + * gcc_compat.h: Rename the macro used for #include guard. + * msghdr.h: Likewise. + * sigevent.h: Likewise. + * kernel_types.h: Comment the trailing part of #include guard. + * xlat.h: Add missing macro definition for #include guard. + +2016-08-06 Dmitry V. Levin + + tests: add #include guards. + * tests/tests.h: Add #include guard. + +2016-08-05 Dmitry V. Levin + + linux: add #include guards. + * linux/dummy.h: Add #include guard. + * linux/inet_diag.h: Likewise. + * linux/netlink_diag.h: Likewise. + * linux/sock_diag.h: Likewise. + * linux/syscall.h: Likewise. + * linux/unix_diag.h: Likewise. + +2016-08-04 Dmitry V. Levin + + tests/umode_t.c: guard against libc printf format errors. + * tests/umode_t.c (test_syscall): Use different printf format specifiers + to detect libc printf format errors. + +2016-08-04 Dmitry V. Levin + + travis: use a suitable musl revision. + There seems to be no readily available binary packages of musl that are + sufficiently up to date to be used to build and test strace, so prepare + a suitable musl from source. + + * travis-install.sh (musl-gcc): Do not add an extra repository, + do not install musl-tools and linux-musl-dev packages. + Download, build, and install a suitable musl revision instead. + +2016-08-03 Dmitry V. Levin + + Fix printing of mode_t, umode_t, and umask types. + Print numeric umode_t type using %#03ho format. + Print return value of umask syscall using %#03lo format. + When printing symbolic mode_t type, always print lower 9 bits, + and print the numeric part using %#03o format. + + * defs.h (sprintmode): Remove. + (print_symbolic_mode_t, print_numeric_umode_t, + print_numeric_long_umask): New prototypes. + * printmode.c (sprintmode): Remove. + (print_symbolic_mode_t, print_numeric_umode_t, + print_numeric_long_umask): New functions. + * chmod.c (decode_chmod): Use print_numeric_umode_t. + * ipc_msg.c (SYS_FUNC(msgget)): Likewise. + * ipc_msgctl.c (print_msqid_ds): Likewise. + * ipc_sem.c (SYS_FUNC(semget)): Likewise. + * ipc_shm.c (SYS_FUNC(shmget)): Likewise. + * ipc_shmctl.c (print_shmid_ds): Likewise. + * mq.c (SYS_FUNC(mq_open)): Likewise. + * open.c (decode_open, SYS_FUNC(creat)): Likewise. + * umask.c (SYS_FUNC(umask)): Likewise. + * mknod.c (decode_mknod): Use print_symbolic_mode_t. + * printstat.h (DO_PRINTSTAT): Likewise. + * syscall.c (trace_syscall_exiting): Use print_numeric_long_umask. + * tests/umode_t.c: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/creat.c: Rewrite as a thin wrapper around umode_t.c + * tests/mkdir.c: Likewise. + * tests/mkdirat.c: Likewise. + * tests/mknod.c: Extend test coverage of mknod syscall. + * tests/mknodat.c: Extend test coverage of mknodat syscall. + * tests/umask.c: Extend test coverage of umask syscall. + * tests/creat.test: Update the value specified for strace -a parameter. + * tests/mkdir.test: Likewise. + * tests/mkdirat.test: Likewise. + * tests/mknodat.test: Likewise. + +2016-08-02 Dmitry V. Levin + + tests: simplify attach-f-p.test. + * tests/attach-f-p.c Simplify communications between threads + by replacing per-thread timers with pipes. + * tests/attach-f-p.test: Do not ignore signals. + + tests: cleanup attach-p-cmd.test. + * tests/attach-p-cmd-cmd.c (main): Cleanup expected output. + * tests/attach-p-cmd-p.c (main): Print expected output. + * tests/attach-p-cmd.test: Do not print expected output. + + ip_mreq.test: rewrite from match_grep to match_diff. + * tests/ip_mreq.c (main): Print expected output. + * tests/ip_mreq.test: Use run_strace_match_diff. + * tests/ip_mreq.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove it. + + fanotify_mark.test: rewrite from match_grep to match_diff. + * tests/fanotify_mark.c (main): Print expected output. + * tests/fanotify_mark.test: Use run_strace_match_diff. + * tests/fanotify_mark.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove it. + + signalfd4.test: rewrite from match_grep to match_diff. + * tests/signalfd4.c (get_sigset_size): New function. + (main): Use it. Print expected output. + * tests/signalfd4.test: Use run_strace_match_diff. + * tests/signalfd4.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove it. + +2016-07-31 Dmitry V. Levin + + tests: rename signalfd.test to signalfd4.test. + * tests/signalfd.c: Rename to signalfd4.c. + * tests/signalfd.test: Rename to signalfd4.test. + * tests/signalfd.expected: Rename to signalfd4.expected. + * tests/.gitignore: Replace signalfd with signalfd4. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Replace signalfd.test with signalfd4.test. + (EXTRA_DIST): Replace signalfd.expected with signalfd4.expected. + +2016-07-30 Dmitry V. Levin + + memfd_create.test: rewrite from match_grep to match_diff. + * tests/memfd_create.c (main): Print expected output. + * tests/memfd_create.test: Use run_strace_match_diff. + * tests/memfd_create.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove it. + +2016-07-29 Dmitry V. Levin + + Set exit status to 1 if strace has not traced any processes. + * strace.c (main): Initialize exit_code with 1 when no processes + has been attached. + * strace.1: Document it. + * NEWS: Mention this change. + + Attach to the target process before attempting to attach to its siblings + * strace.c (attach_tcb): Attach to tcp->pid first. + + Report the name of ptrace command when ptrace_attach_or_seize fails. + * strace.c (ptrace_attach_cmd): New variable. + (ptrace_attach_or_seize): Save last ptrace command's name + to ptrace_attach_cmd. + (attach_tcb, startup_child): Use it in error diagnostics. + + strace.c: refactor startup_attach. + * strace.c (startup_attach): Move the inner part of the big loop + over tcbtab elements ... + (attach_tcb): ... to this new function. + + startup_attach: do not use atoi. + * strace.c (startup_attach): Replace atoi with string_to_uint. + +2016-07-28 Dmitry V. Levin + + Do not enable mpers runtime checks if mpers is not enabled. + * m4/mpers.m4 (HAVE_RUNTIME): Enable iff both mpers and runtime + work properly. + +2016-07-28 Dmitry V. Levin + + linux/dummy_check.sh: remove obsolete script. + Starting with commit v4.10-62-ga0bd374, function prototypes + of syscall parsers are generated at build time. + + * linux/dummy_check.sh: Remove. + +2016-07-28 Dmitry V. Levin + + generate_xlat_in.sh: remove obsolete script. + This script has been created by commit v4.8-180-g0ed617b + for the one-shot job of automatic convertion of xlat structures + from *.c files to xlat/*.in files. + + * generate_xlat_in.sh: Remove. + +2016-07-28 Dmitry V. Levin + + tests: use terse notation in designated initializers where appropriate. + * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Initialize + struct btrfs_ioctl_dev_replace_args using terse notation. + * tests/clock_nanosleep.c (main): Initialize struct timespec + using terse notation. + * tests/nanosleep.c (main): Likewise. + +2016-07-28 Dmitry V. Levin + + Consistently use extended regular expressions where appropriate. + When grep or sed is used with basic regular expressions containing + '(', ')', '{', '}', '|', '?', and '+' special characters, convert them + to extended regular expressions for better portability and readability. + + * generate_mpers_am.sh: Convert grep and sed BREs to EREs. + * Makefile.am (ioctl_redefs%.h, m%_type_defs.h, m%_funcs.h, + mpers_printer_decl_pattern, printers.h, %_printer_decls.h, + %_printer_defs.h): Convert sed BREs to EREs. + * generate_sen.sh: Likewise. + * linux/mips/genstub.sh: Likewise. + * make-dsc: Likewise. + * mpers.sh: Likewise. + * xlat/gen.sh: Likewise. + * tests/Makefile.am (ksysent.h): Likewise. + * tests/ksysent.sed: Likewise. + * tests/pc.test: Likewise. + * tests/strace-S.test: Likewise. + * tests/strace-V.test: Likewise. + * tests/strace-k.test: Likewise. + +2016-07-28 Dmitry V. Levin + + tests: fix extended regexps. + * tests/adjtimex.c (main): Consistently quote curly braces + in expected output. + * tests/uio.expected: Likewise. + +2016-07-27 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.13-1. + * strace.spec.in: Likewise. + +2016-07-26 Dmitry V. Levin + + Prepare for 4.13 release. + * NEWS: Update for 4.13 release. + + Fix one more code pattern that might break gcc strict aliasing rules. + * btrfs.c (btrfs_ioctl): Add one more expicit cast to "void *", + to avoid breaking strict-aliasing rules reported by some gcc compilers. + * syscall.c (decode_socket_subcall): Likewise. + * util.c (next_set_bit): Likewise. + * tests/btrfs.c (btrfs_test_send_ioctl): Likewise. + + Fix casts of ptrace's third argument. + * strace.c (maybe_allocate_tcb): Replace "(char *) 0" with NULL + as ptrace's third argument. + * linux/sparc64/get_scno.c (arch_get_scno): Cast third argument + of ptrace to "void *'. + * syscall.c (get_regs): Likewise. + * upeek.c (upeek): Likewise. + * util.c (umoven): Likewise. + + tests/btrfs.c: do not include the same header file twice. + * tests/btrfs.c: Do not include , is enough. + + tests: fix accept4.test on systems that lack SOCK_CLOEXEC definition. + * tests/accept4.c: Check that O_CLOEXEC is defined. Use O_CLOEXEC + instead of SOCK_CLOEXEC. + +2016-07-26 Dmitry V. Levin + + tests: fix vhangup.test. + * tests/vhangup.c (main): Fix expected output for the case when + the calling process has CAP_SYS_TTY_CONFIG capability. + + Reported-by: Yun-Chih Chen + +2016-07-26 Dmitry V. Levin + + tests: fix chown.test. + * tests/chown.test: Fix the value specified for strace -a parameter. + + Reported-by: Yun-Chih Chen + +2016-07-25 Dmitry V. Levin + + x32: fix syscall entries for x86_64 variants of io_setup and io_submit. + * linux/x32/syscallent.h (64:io_setup, 64:io_submit): Change handler + to printargs. + + tests/ipc.c: fix typo. + +2016-07-24 Dmitry V. Levin + + NEWS: Prepare for 4.13 release. + +2016-07-23 Dmitry V. Levin + + debian: add gcc-multilib to Build-Depends for relevant architectures. + * debian/control (Build-Depends) [amd64, ppc64, sparc64, x32]: + Add gcc-multilib to enable multiple personalities support. + +2016-07-22 Dmitry V. Levin + + tests: check decoding of ipc syscall. + * tests/ipc.c: New file. + * tests/ipc.test: New test. + * tests/.gitignore: Add ipc. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ipc.test. + + Fix corner cases of ipc syscall decoding. + * xlat/ipccalls.in: New file. + * ipc.c: New file. + * Makefile.am (libstrace_a_SOURCES): Add it. + * linux/dummy.h (sys_ipc): Remove stub alias. + * syscall.c (decode_ipc_subcall): Treat 1st argument of ipc syscall + as "unsigned int". + [S390 || S390X]: Skip ipc cubcalls that have non-zero version. + [SPARC64]: Likewise, for the native personality. + Save ipc cubcall version for later use by specific ipc parsers. + * ipc_msg.c (SYS_FUNC(msgrcv)): Handle non-zero ipc subcall version. + [SPARC64]: Handle non-ipc_kludge case for the native personality. + * linux/subcall.h (msgrcv): Change nargs from 4 to 5. + * linux/s390/syscallent.h (ipc): Change nargs from 6 to 5. + * linux/s390x/syscallent.h (ipc): Likewise. + +2016-07-21 Dmitry V. Levin + + tests: skip netlink_protocol.test on old systems. + * tests/netlink_protocol.c: Check that HAVE_SYS_XATTR_H is defined. + Include and . + (main): Check that system.sockprotoname attribute is supported. + + Do not print too many arguments of socketcall syscall. + * socketcall.c (SYS_FUNC(socketcall)): Print just "call" and "args" + syscall arguments. + * tests/socketcall.c (test_socketcall): Update expected output. + * tests/socketcall.test: Likewise. + +2016-07-20 Dmitry V. Levin + + tests/nsyscalls.c: change the type of syscall arguments to kernel_ulong_t + As most syscalls on x32 and mips n32 are actually 64-bit, + check that 64-bit syscall arguments are decoded properly. + + This also workarounds x32 gcc sign extension bug + reported by Eugene Syromyatnikov at + https://sourceforge.net/p/strace/mailman/message/35150860/ + + * tests/nsyscalls.c: Include "kernel_types.h". + (main): Change the type of syscall arguments to kernel_ulong_t. + +2016-07-20 Dmitry V. Levin + + x32, mips n32: make printargs print full 64-bit syscall arguments. + As most of x32 syscalls are regular x86_64 syscalls, they should be + printed by default as 64-bit syscalls, and syscall parsers at their + discretion might print syscalls differently. This is already + implemented in 64-bit strace tracing x32 personality processes, + and now x32 strace will also behave this way. + + Similar reasoning applies to mips n32. + + * util.c (printargs) [HAVE_STRUCT_TCB_EXT_ARG]: Print syscall arguments + from ext_arg array using %llx format. + +2016-07-20 Dmitry V. Levin + + tests: check decoding of socketcall syscall. + * tests/socketcall.c: New file. + * tests/socketcall.test: New test. + * tests/.gitignore: Add socketcall. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add socketcall.test. + + Fix corner cases of socketcall syscall. + * xlat/socketcalls.in: New file. + * socketcall.c: New file. + * Makefile.am (libstrace_a_SOURCES): Add it. + * linux/dummy.h (sys_socketcall): Remove stub alias. + * syscall.c (decode_socket_subcall): Treat 1st argument of socketcall + as "int". Do not substitute syscall until all socketcall arguments + have been fetched successfully. + +2016-07-19 Dmitry V. Levin + + tests: check decoding and dumping of send and recv syscalls. + * tests/unix-pair-send-recv.c: New file. + * tests/unix-pair-send-recv.expected: Likewise. + * tests/unix-pair-send-recv.test: New test. + * tests/.gitignore: Add unix-pair-send-recv. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add unix-pair-send-recv.test. + (EXTRA_DIST): Add unix-pair-send-recv.expected. + + tests: rename unix-pair-send-recv to unix-pair-sendto-recvfrom. + * dumpio.expected: Rename to unix-pair-sendto-recvfrom.expected. + * dumpio.test: Rename to unix-pair-sendto-recvfrom.test. + * unix-pair-send-recv.c: Rename to unix-pair-sendto-recvfrom.c + * .gitignore: Rename unix-pair-send-recv to unix-pair-sendto-recvfrom. + * Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add unix-pair-sendto-recvfrom.test. + (MISC_TESTS): Remove dumpio.test. + (EXTRA_DIST): Rename dumpio.expected + to unix-pair-sendto-recvfrom.expected. + + tests: check decoding of shutdown syscall. + * tests/shutdown.c: New file. + * tests/shutdown.test: New test. + * tests/.gitignore: Add shutdown. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add shutdown.test. + + xlat/shutdown_modes.in: convert to modern syntax. + * xlat/shutdown_modes.in: Replace open-coded xlat table with a list + of constants. + + tests: check silent decoding of sendmmsg and recvmmsg syscalls. + * tests/mmsg-silent.c: New file. + * tests/mmsg-silent.test: New test. + * tests/.gitignore: Add mmsg-silent. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mmsg-silent.test. + + Print unsent messages of failed sendmmsg syscall. + * mmsghdr.c (decode_mmsgvec): Clear syserror for the time of printing + struct mmsghdr array in !use_msg_len case. + (SYS_FUNC(sendmmsg)): As failed sendmmsg syscall does not + set msg_len fields, tell this to decode_mmsgvec. + * tests/mmsg_name.c (test_mmsg_name): Check it. + + Print unsent messages of sendmmsg syscall. + * defs.h (decode_mmsgvec): Add int argument. + * mmsghdr.c (print_struct_mmsghdr_config): Add msg_len_vlen field. + (print_struct_mmsghdr): Print struct mmsghdr.msg_len only for + msg_len_vlen first elements of struct mmsghdr array. + (decode_mmsgvec): Add msg_len_vlen argument. + (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Pass to decode_mmsgvec + the number of elements of struct mmsghdr array that contain meaningful + struct mmsghdr.msg_len. + * tests/mmsg_name.c (test_mmsg_name): Check it. + + tests: check verbose decoding of msg_name* fields of struct mmsghdr array + * tests/mmsg_name-v.c: New file. + * tests/mmsg_name-v.test: New test. + * tests/.gitignore: Add mmsg_name-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mmsg_name-v.test. + + tests: check decoding of msg_name* fields of struct mmsghdr array. + * tests/mmsg_name.c: New file. + * tests/mmsg_name.test: New test. + * tests/.gitignore: Add mmsg_name. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mmsg_name.test. + +2016-07-19 Dmitry V. Levin + + Fix decoding of msg_name* fields of recvmmsg syscall's msghdr array argument + As msg_namelen fields of recvmmsg syscall's struct msghdr array have + the same read-write semantics as struct msghdr argument of recvmsg + syscall, parser of recvmmsg syscall needs a similar fix. + + * mmsghdr.c (print_struct_mmsghdr): Increment p_user_msg_namelen field. + (mmsgvec_data): New structure. + (free_mmsgvec_data, save_mmsgvec_namelen): New functions. + (decode_mmsgvec): Take into account the data saved + by save_mmsgvec_namelen function. + (SYS_FUNC(recvmmsg)): Use save_mmsgvec_namelen. + +2016-07-19 Dmitry V. Levin + + mmsghdr.c: rewrite decode_mmsgvec using print_array. + * fetch_struct_mmsghdr.c (sizeof_struct_mmsghdr): New mpers printer. + * mmsghdr.c: Include . + (print_struct_mmsghdr_config): New structure. + (fetch_struct_mmsghdr_or_printaddr, print_struct_mmsghdr): New functions. + (decode_mmsgvec): Rewrite using them and print_array. + + tests: check decoding of timeout argument of recvmmsg syscall. + * tests/recvmmsg-timeout.c: New file. + * tests/recvmmsg-timeout.test: New test. + * tests/.gitignore: Add recvmmsg-timeout. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add recvmmsg-timeout.test. + + Fix printing of remaining timeout of recvmmsg syscall. + * mmsghdr.c (SYS_FUNC(recvmmsg)): Do not print remaining timeout + when the 5th syscall argument is NULL. + * tests/mmsg.c (main): Update expected output. + + Remove configure checks for recvmmsg and sendmmsg. + * configure.ac (AC_CHECK_FUNCS): Remove recvmmsg and sendmmsg. + + tests: add recv_mmsg and send_mmsg functions to libtests. + * tests/tests.h (recv_mmsg, send_mmsg): New prototype. + * tests/libmmsg.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/mmsg.c Do not check for __NR_sendmmsg, __NR_recvmmsg, + HAVE_SENDMMSG, and HAVE_RECVMMSG. Do not include unused headers. + (recv_mmsg, send_mmsg): Remove. + + tests: add socketcall function to libtests. + * tests/tests.h (socketcall): New prototype. + * tests/libsocketcall.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + +2016-07-18 Dmitry V. Levin + + Use IOV_MAX instead of UIO_MAXIOV. + IOV_MAX appears to be more portable than UIO_MAXIOV. + + * msghdr.c: Include . Remove fallback defintion of UIO_MAXIOV. + (get_optmem_max): Replace UIO_MAXIOV with IOV_MAX. + * tests/msg_control.c: Likewise. + +2016-07-18 Dmitry V. Levin + + Unabuse struct tcb.auxstr. + As we've got a proper mechanism that parsers can use for storing private + data between entering and exiting stages, all cases of struct tcb.auxstr + abuse should go. + + * btrfs.c (btrfs_ioctl): Use set_tcb_priv_ulong and get_tcb_priv_ulong + instead of abusing tcp->auxstr. + * file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise. + * msghdr.c (SYS_FUNC(recvmsg)): Likewise. + * net.c (decode_sockname, SYS_FUNC(recvfrom)): Likewise. + * v4l2.c (print_v4l2_queryctrl): Likewise. + +2016-07-18 Dmitry V. Levin + + Fix race condition in decoding timeout argument of recvmmsg syscall. + As the value returned by sprint_timespec points to a static area and may + be overwritten by subsequent calls to sprint_timespec, it is not safe to + save this value on entering syscall and use it later on exiting. + + * mmsghdr.c (SYS_FUNC(recvmmsg)): On entering syscall, copy the value + returned by sprint_timespec to a dynamically allocated memory, and save + the pointer using set_tcb_priv_data. On exiting, restore it using + get_tcb_priv_data. + +2016-07-18 Dmitry V. Levin + + Fix race condition in decoding rt_sigtimedwait's timeout argument. + As the value returned by sprint_timespec points to a static area and may + be overwritten by subsequent calls to sprint_timespec, it is not safe to + save this value on entering syscall and use it later on exiting. + + * signal.c (SYS_FUNC(rt_sigtimedwait)): On entering syscall, copy the + value returned by sprint_timespec to a dynamically allocated memory, + and save the pointer using set_tcb_priv_data. On exiting, restore it + using get_tcb_priv_data. + +2016-07-18 Patrik Jakobsson + + Add private data field to struct tcb. + We need to be able to store private data in the struct tcb across it's + lifetime. To ensure proper deallocation of this stored data a callback + must be provided along with the data. The callback is executed + automatically on exiting syscall, and when the life of the tcb ends. + + * defs.h (struct tcb): Add _priv_data and _free_priv_data fields. + (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data): + New prototypes. + (get_tcb_priv_ulong, set_tcb_priv_ulong): New static inline functions. + * strace.c (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data): + New functions. + (droptcb): Call free_tcb_priv_data. + * syscall.c (trace_syscall_exiting): Call free_tcb_priv_data + when clearing TCB_INSYSCALL flag. + +2016-07-18 Dmitry V. Levin + + net.c: move parsers of sendmsg and recvmsg syscalls to msghdr.c. + * defs.h (fetch_msghdr_namelen, decode_msghdr): Remove. + * net.c (SYS_FUNC(sendmsg), SYS_FUNC(recvmsg)): Move ... + * msghdr.c: ... here. + (fetch_msghdr_namelen, decode_msghdr): Add static qualifier. + + net.c: move parsers of sendmmsg and recvmmsg syscalls to mmsghdr.c. + * defs.h (decode_mmsgvec): Remove. + * net.c: Do not include "msghdr.h". + (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Move ... + * mmsghdr.c: ... here. + (decode_mmsgvec): Add static qualifier. + + msghdr.c: move all mmsghdr parsers to a separate file. + * msghdr.h (print_struct_msghdr): New prototype. + * msghdr.c (print_msghdr): Rename to print_struct_msghdr, remove + static qualifier, all callers changed. + (decode_mmsghdr, decode_mmsgvec, dumpiov_in_mmsghdr): Move to ... + * mmsghdr.c: ... new file. + * Makefile.am (strace_SOURCES): Add it. + +2016-07-14 Dmitry V. Levin + + tests: disable part of msg_name test on non-glibc systems. + Sadly, musl recvmsg wrapper blindly dereferences 2nd argument, + so limit the affected part of the test to glibc that doesn't. + + * tests/msg_name.c (test_msg_name) [!__GLIBC__]: Do not test + with inaccessible 2nd argument. + +2016-07-13 Dmitry V. Levin + + Print struct iovec as a regular structure. + * io.c (print_iovec): Print names of iov_base and iov_len fields. + * tests/aio.c (main): Update expected output. + * tests/inet-cmsg.c (main): Likewise. + * tests/mmsg.c (main): Likewise. + * tests/msg_name.c (test_msg_name): Likewise. + * tests/preadv-pwritev.c (main): Likewise. + * tests/preadv2-pwritev2.c (main): Likewise. + * tests/preadv.c (main): Likewise. + * tests/pwritev.c (main): Likewise. + * tests/readv.c (main): Likewise. + * tests/recvmsg.c (main): Likewise. + * tests/vmsplice.c (main): Likewise. + * tests/scm_rights-fd.test: Likewise. + * tests/uio.expected: Likewise. + + tests: check decoding of msghdr.msg_name* arguments of recvmsg syscall. + * tests/msg_name.c: New file. + * tests/msg_name.test: New test. + * tests/.gitignore: Add msg_name. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add msg_name.test. + +2016-07-13 Dmitry V. Levin + + Fix decoding of struct msghdr.msg_name* arguments of recvmsg syscall. + As the msghdr.msg_namelen argument of recvmsg syscall has the same + read-write semantics as the address length argument of recvfrom syscall, + parser of recvmsg syscall needs a similar fix. + + * defs.h (fetch_msghdr_namelen): New prototype. + (decode_msghdr): Add "int *" argument. + * msghdr.c (print_msghdr): Likewise. Treat it as a pointer to struct + msghdr.msg_namelen passed to the kernel. Pass to decode_sockaddr + the size of socket address actually returned by the kernel. + Print both user and kernel address lengths when the value changes. + (decode_msghdr, decode_mmsghdr): Add "int *" argument, + forward it to print_msghdr. + (decode_mmsgvec): Update decode_mmsghdr invocation. + (fetch_msghdr_namelen): New function. + * net.c (SYS_FUNC(sendmsg)): Update decode_msghdr invocation. + (SYS_FUNC(recvmsg)): Use fetch_msghdr_namelen on entering to save + struct msghdr.msg_namelen. On exiting, pass the saved value + to decode_msghdr. + +2016-07-12 Dmitry V. Levin + + Update generic ioctl entries from linux 4.7. + * linux/64/ioctls_inc.h: Update from linux v4.7 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + +2016-07-12 Gleb Fotengauer-Malinovskiy + + x32: update ioctl entries from linux 4.7. + * linux/x32/ioctls_inc0.h: Update from linux v4.7 using ioctls_gen.sh. + + maint: update for linux 4.7. + * maint/ioctls_sym.sh: Drop obsolete workarounds for linux/btrfs.h. + +2016-07-12 Dmitry V. Levin + + block.c: remove BLKDAXGET support. + BLKDAXGET was removed by linux kernel commit v4.7-rc1~78^2^2~4. + + * block.c: Do not define BLKDAXGET. + (block_ioctl): Remove BLKDAXGET support. + * tests/ioctl_block.c (main): Remove BLKDAXGET test. + +2016-07-12 Dmitry V. Levin + + Fix printing of socklen argument of bind and sendto syscalls. + * net.c (SYS_FUNC(bind)): Print 3rd syscall argument using %d format. + (SYS_FUNC(sendto)): Print 6th syscall argument using %d format. + + tests: check decoding of sockaddr related arguments of recvfrom syscall. + * configure.ac (AC_CHECK_FUNCS): Add recvfrom. + * tests/recvfrom.c: New file. + * tests/recvfrom.test: New test. + * tests/.gitignore: Add recvfrom. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add recvfrom.test. + + Fix decoding of sockaddr related arguments of recvfrom syscall. + * net.c (SYS_FUNC(recvfrom)): Use fetch_socklen. Save the address + length passed to the kernel and print it on error. Do not print more + bytes of the socket address than actually returned by the kernel. + Print both user and kernel address lengths when the returned address + is truncated. + + tests: check decoding of accept4 syscall. + * configure.ac (AC_CHECK_FUNCS): Add accept4. + * tests/accept4.c: New file. + * tests/accept4.test: New test. + * tests/.gitignore: Add accept4. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add accept4.test. + + tests: check decoding of accept syscall. + * tests/accept.c: New file. + * tests/accept.test: New test. + * tests/.gitignore: Add accept. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add accept.test. + + tests: check decoding of getpeername syscall. + * tests/getpeername.c: New file. + * tests/getpeername.test: New test. + * tests/.gitignore: Add getpeername. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getpeername.test. + + tests: check decoding of getsockname syscall. + * tests/getsockname.c: New file. + * tests/getsockname.test: New test. + * tests/sockname.c: New file. + * tests/.gitignore: Add getsockname. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getsockname.test. + (EXTRA_DIST): Add sockname.c. + + Print both values of changing address length in sockname family syscalls + * net.c (decode_sockname): Print both user and kernel address lengths + when the value changes. + * tests/net-y-unix.c (main): Update expected output. + * tests/net-yy-unix.c (main): Likewise. + * tests/net.expected: Likewise. + + Enhance diagnostics of address truncation in sockname family syscalls. + * net.c (decode_sockname): Print both user and kernel address lengths + when the returned address is truncated. + * tests/sun_path.expected: Update expected output. + + Fix decoding of getsockname, getpeername, accept, and accept4 syscalls. + * net.c (fetch_socklen): New function. + (decode_sockname): Use it. On entering syscall, decode early + and return RVAL_DECODED when possible. On error, print the address + length passed to the kernel. Do not print more bytes of the socket + address than actually returned by the kernel. + +2016-07-11 Dmitry V. Levin + + Prepare parsers of sockname family syscalls for the upcoming fix. + * net.c (do_sockname): Rename to decode_sockname, drop second argument, + do not print sock_type_flags, return RVAL_DECODED on exiting. + (SYS_FUNC(accept), SYS_FUNC(getsockname)): Use decode_sockname instead + of do_sockname, take its return code into account. + (SYS_FUNC(accept4)): Likewise. Print sock_type_flags when + decode_sockname returns RVAL_DECODED. + +2016-07-08 Dmitry V. Levin + + netlink: handle multipart netlink messages. + Handle multipart netlink messages made of multiple struct nlmsghdr + headers with associated payload in one byte stream. + + * netlink.c (fetch_nlmsghdr, print_nlmsghdr, + decode_nlmsghdr_with_payload): New functions. + (decode_netlink): Use them. + * tests/netlink_parsing.c (send_query): Check them. + +2016-07-07 Dmitry V. Levin + + tests: extend netlink protocol check. + * tests/netlink_protocol.c (send_query): Check that no part + of netlink message is fetched beyond the end of message. + Check decoding of zero address and zero length messages. + Check decoding of messages with nlmsg_len exceeding message length. + +2016-07-07 Fabien Siron + + tests: check decoding of netlink protocol. + * tests/netlink_protocol.test: New test. + * tests/netlink_protocol.c: New file. + * tests/.gitignore: Add netlink_protocol. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add netlink_protocol.test. + +2016-07-07 Fabien Siron + + Add a general netlink socket parser. + Introduce a general socket netlink parser which prints the header and + a string for the remaining part of the buffer. It doesn't handle all + the netlink flags and types yet because the parser needs more + information, this will be implemented later. + + * net.c (decode_sockbuf): New function. + (SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom)): + Use it instead of printstr. + * msghdr.c (print_msghdr): Pass IOV_DECODE_NETLINK to tprint_iov_upto() + for netlink sockets. + * netlink.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (decode_netlink, getfdproto): New prototypes. + (iov_decode): Add IOV_DECODER_NETLINK. + * io.c (print_iovec): Use decode_netlink(). + * util.c (getfdproto): Remove static keyword. + * xlat/netlink_flags.in: New file. + * xlat/netlink_types.in: New file. + +2016-07-07 Dmitry V. Levin + + Update sigaltstack SS_* constants. + * xlat/sigaltstack_flags.in: Add SS_AUTODISARM introduced + by linux kernel commit v4.7-rc1~195^2. + + Update fs *_MAGIC constants. + * xlat/fsmagic.in: Add NSFS_MAGIC, TRACEFS_MAGIC, BPF_FS_MAGIC, + and UDF_SUPER_MAGIC introduced by linux kernel commits + v3.19-rc1~53^2~7^2~1, v4.1-rc1~147^2~4, v4.4-rc1~141^2~17^2~1, + and v4.7-rc1~161^2, respectively. + +2016-07-05 Dmitry V. Levin + + Update KEYCTL_* constants. + * xlat/keyctl_commands.in: Add KEYCTL_DH_COMPUTE introduced + by linux kernel commit v4.7-rc1~124^2~2^2~2^2. + + Update input event constants. + * xlat/evdev_keycode.in: Add KEY_* constants introduced + by linux kernel commit v4.7-rc6~32^2~6^2. + +2016-07-04 Dmitry V. Levin + + Update RWF_* constants. + * xlat/rwf_flags.in: Add RWF_DSYNC and RWF_SYNC introduced + by linux kernel commit v4.7-rc1~158^2~1. + +2016-07-07 Dmitry V. Levin + + Update BPF_MAP_TYPE_* constants. + * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_TRACEPOINT introduced + by linux kernel commit v4.7-rc1~154^2~332^2~6. + +2016-07-03 Dmitry V. Levin + + msghdr.c: limit output when printing excessively large messages. + Limit output of struct msghdr.msg_control when + struct msghdr.msg_controllen is greater than the maximum ancillary + buffer size specified in /proc/sys/net/core/optmem_max file. + + * configure.ac (AC_CHECK_FUNCS): Add open64. + * defs.h (read_int_from_file): New prototype. + * util.c (read_int_from_file): New function. + * msghdr.c (get_optmem_max): New function based on read_int_from_file. + (decode_msg_control): Use it to check control_len argument. + * tests/msg_control.c (test_big_len): New function. + (main): Use it to test printing of excessively large messages. + +2016-07-03 Dmitry V. Levin + + tests: add read_int_from_file function to libtests. + * tests/overflowuid.c (read_int_from_file): New function. + (check_overflow_id): Use it. + * tests/tests.h (read_int_from_file): New prototype. + +2016-07-02 Dmitry V. Levin + + msghdr.c: limit IP_RECVOPTS/IP_RETOPTS output in abbrev mode. + * msghdr.c (print_cmsg_ip_opts): Do not print more than max_strlen + bytes of ip options in abbrev mode. + * tests/msg_control.c (print_ip_opts): Use DEFAULT_STRLEN. + (test_sol_ip): Test IP_RETOPTS output in abbrev mode. + + msghdr.c: limit SCM_RIGHTS output in abbrev mode. + * msghdr.c (print_scm_rights): Do not print more than max_strlen + descriptors in abbrev mode. + * tests/msg_control.c (DEFAULT_STRLEN): New macro. + (print_fds): Use it. + (test_scm_rights3): New function. + (main): Use it to test SCM_RIGHTS output in abbrev mode. + * tests/msg_control-v.c: New file. + * tests/msg_control-v.test: New test. + * tests/.gitignore: Add msg_control-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add msg_control-v.test. + +2016-07-01 Dmitry V. Levin + + tests: check decoding of struct msghdr ancillary data. + * tests/msg_control.c: New file. + * tests/msg_control.test: New test. + * tests/.gitignore: Add msg_control. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add msg_control.test. + +2016-06-30 Dmitry V. Levin + + msghdr.c: reorganize struct cmsghdr handler. + * msghdr.c (sock_ee): New structure. + (print_scm_rights, print_scm_creds, print_scm_security, + print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_ip_opts, + print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr): Remove data_len + argument validity check, don't print ", cmsg_data=" prefix here. + (print_cmsg_ip_tos): Likewise. Rename to print_cmsg_uint8_t. + (cmsg_printer): New type. + (cmsg_socket_printers, cmsg_ip_printers): New arrays. + (print_cmsg_type_data): Use them to handle struct cmsghdr + and its cmsg_data. + + msghdr.c: merge print_cmsg_ip_ttl and print_cmsg_ip_checksum. + * msghdr.c (print_cmsg_ip_ttl): Rename to print_cmsg_uint. + (print_cmsg_ip_checksum): Remove. + (print_cmsg_type_data): Replace print_cmsg_ip_ttl + and print_cmsg_ip_checksum with print_cmsg_uint. + + msghdr.c: enhance representation of unprintable part of msg_control array + * msghdr.c (decode_msg_control): When msg_control array has an + unprintable part, print its address. + + msghdr.c: apply a sane limit to the length of IP_ORIGDSTADDR address. + * msghdr.c (print_cmsg_ip_origdstaddr): Limit address length to the size + of struct sockaddr_storage. + + msghdr.c: fix printing SCM_RIGHTS array. + * msghdr.c (print_scm_rights): Do not print array elements outside + bounds defined by struct cmsghdr.cmsg_len. + + msghdr.c: print unrecognized struct cmsghdr.cmsg_type in hex. + * msghdr.c (print_cmsg_type_data): Use %#x format when printing + struct cmsghdr.cmsg_type as an integer. + + msghdr.c: fix printing of struct in_pktinfo. + * msghdr.c (print_cmsg_ip_pktinfo): Fix printing + of struct in_pktinfo.ipi_addr. + + msghdr.c: fix representation of struct cmsghdr.cmsg_data integer arrays. + * msghdr.c (print_cmsg_ip_opts): Print struct cmsghdr.cmsg_data + as an array of hexadecimal integers. + * tests/inet-cmsg.c (print_opts): Update expected output. + + msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values. + * msghdr.c (print_cmsg_ip_ttl, print_cmsg_ip_tos, + print_cmsg_ip_checksum): Print struct cmsghdr.cmsg_data value as an + array element. + * tests/inet-cmsg.c (print_ttl, print_tos): Update expected output. + + msghdr.c: when printing struct struct cmsghdr.cmsg_data, also print its name + * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security, + print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos, + print_cmsg_ip_checksum, print_cmsg_ip_opts, print_cmsg_ip_recverr, + print_cmsg_ip_origdstaddr): Print "cmsg_data=" before its contents. + * tests/inet-cmsg.c (print_pktinfo, print_ttl, print_tos, print_opts, + print_origdstaddr): Update expected output. + * tests/scm_rights-fd.test: Likewise. + +2016-06-27 Dmitry V. Levin + + msghdr.c: print struct mmsghdr as a regular structure. + * msghdr.c (decode_mmsghdr): Print names of msg_hdr and msg_len fields. + * tests/mmsg.c (main): Update expected output. + + net.c: move all msghdr and mmsghdr parsers to a separate file. + * defs.h (msg_flags, socketlayers, decode_msghdr, decode_mmsg): + New prototypes. + * msghdr.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * net.c: Move all msghdr and mmsghdr parsers to msghdr.c. + + Mpersify fetchers of struct msghdr and struct mmsghdr. + * fetch_struct_msghdr.c: New file. + * fetch_struct_mmsghdr.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * net.c (struct msghdr32, struct mmsghdr32, copy_from_msghdr32, + fetch_msghdr, fetch_mmsghdr): Remove. + (decode_msghdr, dumpiov_in_msghdr): Use fetch_struct_msghdr instead + of fetch_msghdr. + (decode_mmsghdr): Change msg_len argument to use_msg_len. + Use fetch_struct_mmsghdr instead of fetch_mmsghdr. + Return fetch_struct_mmsghdr's return code. + (decode_mmsg): Rename to decode_mmsgvec. Take addr and len arguments. + Do not print vlen and flags. Check decode_mmsghdr's return code. + Print mmsghdr array using square brackets. + (dumpiov_in_mmsghdr): Use fetch_struct_mmsghdr instead of fetch_mmsghdr. + (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Use decode_mmsgvec instead + of decode_mmsg. Print vlen and flags. + * tests/mmsg.c (main): Update expected output. + + net.c: move fallback definition of struct mmsghdr to a separate file. + * msghdr.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * net.c: Include it. Move fallback definition of struct mmsghdr there. + * tests/mmsg.c: Include "msghdr.h". Remove fallback definition + of struct mmsghdr. + +2016-06-26 Dmitry V. Levin + + net.c: print struct msghdr as a regular structure. + * net.c (print_msghdr): Print msg_name, msg_namelen, msg_iov, + and msg_iovlen fields like other regular fields. + * tests/inet-cmsg.c (main): Update expected output. + * tests/mmsg.c (main): Likewise. + * tests/recvmsg.c (main): Likewise. + * tests/scm_rights-fd.test: Likewise. + + net.c: rename some internal functions for consistency and readability. + * net.c (printcmsghdr): Rename to decode_msg_control. + (do_msghdr): Rename to print_msghdr. + (extractmsghdr): Rename to fetch_msghdr. + (extractmmsghdr): Rename to fetch_mmsghdr. + (printmsghdr): Rename to decode_msghdr. + (printmmsghdr): Rename to decode_mmsghdr. + All callers updated. + + net.c: when printing struct msghdr.msg_control, also print its name. + * net.c (printcmsghdr): Skip control messages of zero length. + Always print "msg_control=" before the control message. + (do_msghdr): Print control message before its length, not after. + * tests/inet-cmsg.c (main): Update expected output. + * tests/scm_rights-fd.test: Likewise. + + Assume that libc provides struct msghdr.msg_control. + * configure.ac (AC_CHECK_MEMBERS): Remove struct msghdr.msg_control. + * net.c (do_msghdr): Remove HAVE_STRUCT_MSGHDR_MSG_CONTROL check. + +2016-06-25 Dmitry V. Levin + + net.c: move all sockaddr parsers to a separate file. + * sockaddr_ll.c: Rename to sockaddr.c + (print_sockaddr_data_ll): Add static keyword. + * Makefile.am (strace_SOURCES): Likewise. + * defs.h (print_sockaddr_data_ll): Remove. + (addrfams): New prototype. + * net.c: Move all sockaddr parsers to sockaddr.c. + + net.c: rename printsock to decode_sockaddr. + * defs.h (printsock): Rename to decode_sockaddr. + * net.c (printsock): Likewise. + (do_msghdr, SYS_FUNC(bind), do_sockname, SYS_FUNC(sendto), + SYS_FUNC(recvfrom)): Replace printsock with decode_sockaddr. + + defs.h: remove unused prototype. + * defs.h (print_sock_optmgmt): Remove. + + tests: check decoding of sockaddr structures. + * tests/net-sockaddr.c: New file. + * tests/net-sockaddr.test: New test. + * tests/.gitignore: Add net-sockaddr. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add net-sockaddr.test. + +2016-06-24 Dmitry V. Levin + + net.c: fix printing AF_PACKET socket addresses. + * defs.h (print_ifindex, print_sockaddr_data_ll): New prototypes. + * net.c: Stop including "xlat/af_packet_types.h". + (print_ifindex): Remove static keyword. + (print_sockaddr_data_l): Remove. + * sockaddr_ll.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/arp_hardware_types.in: New file. + * xlat/ethernet_protocols.in: Likewise. + + net.c: skip details of too short socket addresses, part 2. + * net.c (sa_printers): Add minimal address length for each socket family. + (print_sockaddr): Call socket family specific sockaddr printer + only when socket address length is greater or equal + the minimal address length for the socket family. + + net.c: fix printing AF_BLUETOOTH socket addresses. + * xlat/hci_channels.in: New file. + * net.c (print_sockaddr_data_raw): New function. + (print_sockaddr): Use it. + [HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/hci_channels.h". + [HAVE_BLUETOOTH_BLUETOOTH_H] (print_sockaddr_data_bt): Fix printing + sockaddr_hci, sockaddr_sco, sockaddr_rc, and sockaddr_l2 structures. + + net.c: fix printing AF_IPX sockets addresses, part 2. + * net.c (print_sockaddr_data_ipx): Print sockaddr_ipx.sipx_network + using %#08x format. Print elements of sockaddr_ipx.sipx_node array + and sockaddr_ipx.sipx_type using %#02x format. + +2016-06-24 Dmitry V. Levin + + net.c: fix printing AF_UNIX abstract socket addresses. + AF_UNIX abstract socket address specified by sockaddr_un.sun_path + is not a NUL-terminated string. + + * net.c (SIZEOF_SA_FAMILY): New macro. + (print_sockaddr_data_un): Use it. Specify actual address length + in print_quoted_string calls. Do not set QUOTE_0_TERMINATED flag + when printing an abstract socket address. + +2016-06-24 Dmitry V. Levin + + net.c: fix printing field names of struct sockaddr_nl. + * net.c (print_sockaddr_data_nl): Change "pid" to "nl_pid", "groups" + to "nl_groups". Print sockaddr_nl.nl_groups using %#08x format. + * tests/net-yy-netlink.c (main): Update. + + net.c: fix printing struct sockaddr_in6.sin6_flowinfo. + * net.c (print_sockaddr_data_in6): Convert sockaddr_in6.sin6_flowinfo + from network order to host order before printing. + +2016-06-23 Dmitry V. Levin + + net.c: do not print sockaddr_in6.sin6_scope_id unnecessarily. + Prior to RFC2553, struct sockaddr_in6 had no sin6_scope_id field. + As the kernel still accepts RFC2133 editions of struct sockaddr_in6, + print sockaddr_in6.sin6_scope_id only when it is specified. + + * net.c (SIN6_MIN_LEN): New macro. + (print_sockaddr_data_in6): Print sockaddr_in6.sin6_scope_id only when + socket address length exceeds SIN6_MIN_LEN. + +2016-06-23 Dmitry V. Levin + + net.c: fix printing raw data of socket addresses. + * net.c (print_sockaddr): When printing socket address raw data, read + exactly the number of data bytes specified for the socket addess. + + net.c: skip details of too short socket addresses. + * net.c (print_sockaddr): Print socket address details only when + the address size is greater than sizeof(struct sockaddr.sa_family). + (print_sockaddr_data_un): Remove handling of addrlen == 2. + * tests/net-y-unix.c (main): Update expected pattern. + * tests/net-yy-unix.c (main): Likewise. + * tests/net.expected: Likewise. + +2016-06-22 Dmitry V. Levin + + Assume that libc provides struct sockaddr_in6.sin6_scope_id. + * configure.ac (AC_CHECK_MEMBERS): Remove + struct sockaddr_in6.sin6_scope_id. + * net.c (print_sockaddr_data_in6): Remove + HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID check. + + Split print_sockaddr. + * net.c (sockaddr_buf_t): Remove. + (sockaddr_printer): New type. + (sa_printers): New array of sockaddr_printer. + (print_sockaddr): Use it. Move printers of family specific + sockaddr data to separate funcions. + +2016-06-22 Fabien Siron + + Add a enum for decoding to tprint_iov() and tprint_iov_upto() + Introduce a new type iov_decode which will be used instead of the integer + "decode" as a parameter. + + * defs.h (iov_decode): New enum. + (tprint_iov, tprint_iov_upto): Change type of "decode_iov" to enum iov_decode. + * aio.c (print_iocb): Change type of "decode_iov" to enum iov_decode in + tprint_iov() call. + * keyctl.c (keyctl_instantiate_key_iov): Likewise. + * process.c (ptrace): Likewise. + * process_vm.c (process_vm_readv, process_vm_writev): Likewise. + * io.c (writev, do_pwritev, vmsplice): Likewise. + (print_iovec): Replace the condition with a switch. + (tprint_iov_upto): Change type of "decode_iov" to enum iov_decode. + (readv, do_preadv): Change type of "decode_iov" to enum iov_decode in + tprint_iov_upto() call. + * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, + print_sg_io_v4_res): Likewise. + * net.c (do_msghdr): Adapt call of tprint_iov_upto(). + +2016-06-22 Dmitry V. Levin + + printsock: fix zero padding of sockaddr buffer. + Before this change printsock used to erroneously clear the last byte + of sockaddr buffer. + + * net.c (printsock): Use struct sockaddr_storage as a sockaddr buffer. + Reserve additional byte after the sockaddr buffer for zero padding. + Do not clear memory that is going to be overwritten by umoven. + Clear the tail of sockaddr buffer that was not overwritten by umoven. + +2016-06-21 Fabien Siron + + Change printsock to return socket family. + * defs.h (printsock): Change return type to int. + * net.c (printsock): Likewise. Return socket family on success + and -1 in case of an error. + +2016-06-21 Dmitry V. Levin + + Unexport addrfams. + * defs.h (addrfams): Remove. + + sock.c: use print_sockaddr. + * sock.c (print_ifreq_addr): Remove. + (PRINT_IFREQ_ADDR): New macro. + (print_ifreq, decode_ifconf): Use it instead of print_ifreq_addr. + + Export print_sockaddr function. + * defs.h (print_sockaddr): New prototype. + * net.c (print_sockaddr): Remove static keyword. + Change type of address pointer to "const void *". + (print_cmsg_ip_recverr, print_group_req): Remove redundant casts + in print_sockaddr invocations. + + xlat/addrfams.in: provide fallback definitions. + * xlat/addrfams.in: add fallback definitions for constants. + + Update AF_* constants. + * xlat/addrfams.in: Add AF_QIPCRTR. + + Assume that libc provides inet_ntop and inet_pton. + * configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton. + * net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove + HAVE_INET_NTOP checks. + * tests/ip_mreq.c: Remove HAVE_INET_PTON check. + + net.c: use SO_LINGER unconditionally. + * net.c (print_linger, print_getsockopt, print_setsockopt): Do not check + for SO_LINGER availability. + + net.c: use AF_BLUETOOTH unconditionally. + * net.c (print_sockaddr, SYS_FUNC(socket)): Do not check + for AF_BLUETOOTH availability. + +2016-06-20 Dmitry V. Levin + + Consistently use AF_UNIX over AF_LOCAL. + As these constants have the same value 1, let's use and print only one + of them, e.g. AF_UNIX. + + * xlat/addrfams.in (AF_LOCAL): Remove. + * tests/net-accept-connect.c (main): Replace AF_LOCAL with AF_UNIX. + * tests/net-y-unix.c: Likewise. + * tests/net-yy-unix.c: Likewise. + * tests/netlink_unix_diag.c: Likewise. + +2016-06-19 Dmitry V. Levin + + net.c: fix printing AF_IPX sockets. + * net.c (print_sockaddr): Print sockaddr_ipx as a regular structure. + (SYS_FUNC(socket)): Remove special handling of AF_IPX. + + net.c: use AF_IPX unconditionally. + * net.c (sockaddr_buf_t, print_sockaddr, SYS_FUNC(socket)): Do not check + for AF_IPX availability. + + Cleanup netipx/ipx.h availability check. + * configure.ac (AC_CHECK_HEADERS): Add netipx/ipx.h. + * net.c: Check for HAVE_NETIPX_IPX_H instead of __GLIBC__. + +2016-06-19 Fabien Siron + + Make getfdproto return enum instead of string. + Introduce a new enum type sock_proto and use it instead of strings for socket + protocols identification. + + * defs.h (sock_proto): New enum. + (get_proto_by_name): New function. + * socketutils.c (protocols): New static table. + (print_sockaddr_by_inode): Use it. Change type of "proto" argument + to sock_proto. + (get_proto_by_name): New function. + * util.c (getfdproto): Use it. Change return type to sock_proto. + (printfd): Update. + +2016-06-18 Dmitry V. Levin + + Split travis-ci.sh. + * travis-ci.sh: Split into travis-build.sh, travis-install.sh, + and travis-success.sh files. + * .travis.yml (before_install, after_success, git): New mappings. + (script): Change to travis-build.sh. + (addons, install): Remove. + (env): Remove matrix. + (matrix): Replace exclude list with include list. + +2016-06-17 Dmitry V. Levin + + Introduce HAVE_STRUCT_TCB_EXT_ARG macro. + Check for "if HAVE_STRUCT_TCB_EXT_ARG" instead of + "if defined LINUX_MIPSN32 || defined X32". + + * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Define for LINUX_MIPSN32 || X32. + (struct tcb): Check it instead of LINUX_MIPSN32 || X32. + (RVAL_LUDECIMAL): Likewise. + * io.c (print_lld_from_low_high_val): Likewise. + * lseek.c (SYS_FUNC(lseek)): Likewise. + * mem.c (SYS_FUNC(mmap)): Likewise. + * syscall.c (trace_syscall_exiting): Likewise. + * util.c (getllval): Likewise. + +2016-06-17 Dmitry V. Levin + + btrfs: fix build with fresh linux/btrfs.h. + Fix build with fresh that provides a slightly different + definition of struct btrfs_ioctl_defrag_range_args. + + * btrfs.c (btrfs_ioctl): Cast "len" member of + struct btrfs_ioctl_defrag_range_args to uint64_t. + * tests/btrfs.c (btrfs_print_defrag_range_args): Cast "start" and "len" + members of struct btrfs_ioctl_defrag_range_args to uint64_t. + +2016-06-17 Dmitry V. Levin + + btrfs: provide fallback definitions for BTRFS_IOC_QUOTA_RESCAN* + was introduced in linux v3.9-rc1 while some + of btrfs ioctls were added later, e.g. BTRFS_IOC_QUOTA_RESCAN + and BTRFS_IOC_QUOTA_RESCAN_STATUS in v3.10-rc2, + or BTRFS_IOC_QUOTA_RESCAN_WAIT in v3.11-rc1. + + * btrfs.c [!BTRFS_IOC_QUOTA_RESCAN] + (struct btrfs_ioctl_quota_rescan_args): New structure. + (BTRFS_IOC_QUOTA_RESCAN, BTRFS_IOC_QUOTA_RESCAN_STATUS): New macros. + [!BTRFS_IOC_QUOTA_RESCAN_WAIT] (BTRFS_IOC_QUOTA_RESCAN_WAIT): New macro. + * tests/btrfs.c: Likewise. + + Reported-by: Li Er + +2016-06-17 Dmitry V. Levin + + configure.ac: fix checks for btrfs specific structures. + * configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for + struct btrfs_ioctl_defrag_range_args.start and + struct btrfs_ioctl_search_args_v2.buf_size. + +2016-06-16 Elvira Khabirova + + README: add system requirements and beautify the file. + +2016-06-16 Fei Jie + + tests: add signal_receive.test. + * tests/signal_receive.c: New file. + * tests/signal_receive.test: New test. + * tests/.gitignore: Add signal_receive. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add signal_receive.test. + + tests: add signal2name function to libtests. + * tests/tests.h (signal2name): New prototype. + * tests/signal2name.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + +2016-06-16 Dmitry V. Levin + + net.c: use AF_INET6 unconditionally. + * net.c (SYS_FUNC(socket)): Do not check for AF_INET6 availability. + +2016-06-16 Dmitry V. Levin + + configure.ac: do not check for linux/in6.h. + The last user of was removed by commit v4.9-252-gf362a33. + + * configure.ac (AC_CHECK_HEADERS): Remove linux/in6.h. + +2016-06-16 Dmitry V. Levin + + net.c: use AF_PACKET unconditionally. + * net.c: Do not check for AF_PACKET availability. + + net.c: include unconditionally. + * configure.ac (AC_CHECK_HEADERS): Remove linux/if_packet.h. + * net.c: Include unconditionally. + + net.c: use ICMP_FILTER unconditionally. + * net.c: Do not check for ICMP_FILTER availability. + + net.c: include unconditionally. + * configure.ac (AC_CHECK_HEADERS): Remove linux/icmp.h. + * net.c: Follow the example of tests/net-icmp_filter.c and include + unconditionally. + +2016-06-14 Dmitry V. Levin + + net.c: use AF_NETLINK unconditionally. + * net.c: Do not check for AF_NETLINK availability. + + net.c: include unconditionally. + * configure.ac (AC_CHECK_HEADERS): Remove linux/netlink.h. + * net.c: Follow the example of socketutils.c and include + unconditionally. + +2016-06-14 Elvira Khabirova + + Remove UNDEFINED_SCNO. + Since UNDEFINED_SCNO is set if and only if !SCNO_IS_VALID + and since tcp->s_ent can only be set to &sysent[tcp->scno] + (or to &unknown, but only when !SCNO_IS_VALID), there is no need + to check for UNDEFINED_SCNO before calling syscall_name(tcp->scno). + + * defs.h (UNDEFINED_SCNO): Remove. + * syscall.c (get_scno, trace_syscall_entering, trace_syscall_exiting): + Remove checks for UNDEFINED_SCNO. + +2016-06-14 Dmitry V. Levin + + tests/attach-f-p.c: fix typo in comment. + +2016-06-14 Elvira Khabirova + + strace.c: fix style in function definition. + * strace.c (kill_save_errno): Move the type of return value + to another line. + + Turn on more compiler warnings. + * configure.ac (gl_WARN_ADD): Add -Wempty-body, -Wformat-security, + -Wignored-qualifiers, -Winit-self, -Wlogical-op, + -Wmissing-parameter-type, -Wnested-externs, -Wold-style-declaration, + -Wold-style-definition, -Wtype-limits. + + strace.c: fix a warning reported by -Wold-style-definition. + * strace.c (usage): Add void to the list of function argments. + +2016-06-14 Dmitry V. Levin + + tests/ioctl_evdev.c: fix typo in comment. + +2016-06-14 Elvira Khabirova + + Move printargs* functions to util.c. + * syscall.c (printargs, printargs_u, printargs_d): Move ... + * util.c: ... here. + + tests/xgetrlimit.c: fix a warning reported by -Wtype-limits. + * tests/xgetrlimit.c (sprint_rlim): Explicitly cast constants + to the type of argument. + +2016-06-11 Dmitry V. Levin + + Consistently use printaddr for printing addresses. + * bjm.c (SYS_FUNC(init_module)): Use printaddr. + * clone.c (SYS_FUNC(clone)): Likewise. + * evdev.c (ff_effect_ioctl): Likewise. + * mtd.c (decode_mtd_oob_buf): Likewise. + * net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)): + Likewise. + * print_sigevent.c (print_sigevent): Likewise. + * printsiginfo.c (printsigval, print_si_info): Likewise. + * signal.c (decode_new_sigaction): Likewise. + * sysmips.c (SYS_FUNC(sysmips)): Likewise. + * util.c (printpathn, printstr, umoven_or_printaddr): Likewise. + * v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer, + umoven_or_printaddr_ignore_syserror): Likewise. + * tests/net-icmp_filter.c (main): Update. + + Based on patch by Eugene Syromyatnikov . + +2016-06-10 Dmitry V. Levin + + tests/attach-p-cmd-p.c: cleanup. + * attach-p-cmd-p.c (handler): Move code ... + (main): ... here. Unblock SIGALRM only. + Use alarm() instead of setitimer(). + Replace endless loop with a pause() call. + Check that chdir() returns ENOENT. + + tests: enhance test coverage of SIGCHLD siginfo_t. + * tests/siginfo.c: New file. + * tests/siginfo.test: New test. + * tests/wait.c: Remove. + * tests/wait.expected: Remove. + * tests/wait.test: Remove. + * tests/.gitignore: Add siginfo, remove wait. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add siginfo.test, remove wait.test. + (EXTRA_DIST): Remove wait.expected. + + tests: extend test coverage of waitid syscall. + * tests/waitid.c: New file. + * tests/waitid-v.c: Likewise. + * tests/waitid.test: New test. + * tests/waitid-v.test: Likewise. + * tests/.gitignore: Add waitid and waitid-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add waitid.test and waitid-v.test. + + tests: extend test coverage of wait4 syscall. + * tests/wait4.c: New file. + * tests/wait4-v.c: Likewise. + * tests/wait4.test: New test. + * tests/wait4-v.test: Likewise. + * tests/.gitignore: Add wait4 and wait4-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add wait4.test and wait4-v.test. + + tests: add widen_to_ull macro to tests.h. + * tests.h (widen_to_ull): New macro, copied from defs.h + + Fix sign extension issues in the parser of struct rusage. + * printrusage.c (printrusage): Do not cast members of struct rusage + to type long, use widen_to_ull instead. + +2016-06-09 Dmitry V. Levin + + tests: check decoding of waitpid syscall. + * tests/waitpid.c: New file. + * tests/waitpid.test: New test. + * tests/.gitignore: Add waitpid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add waitpid.test. + +2016-06-09 Fei Jie + + tests: add strace-E.test. + * tests/strace-E.expected: New file. + * tests/strace-E.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + (EXTRA_DIST): Add strace-E.expected. + +2016-06-08 Dmitry V. Levin + + strace.spec.in: enable libunwind on more platforms. + * strace.spec.in: Add libunwind-devel to BuildRequires for RHEL8 family. + +2016-06-08 Dmitry V. Levin + + make-dist: generate strace-*.tar.gz, strace.dsc, and strace.spec. + Change make-dist to generate strace-*.tar.gz, strace.dsc, + and strace.spec in addition to strace-*.tar.xz. + + * configure.ac (AM_INIT_AUTOMAKE): Remove no-dist-gzip. + * make-dsc: New file. + * make-dist: Use it. + * .gitignore: Add strace-*.tar.gz, strace.dsc, and strace.spec. + +2016-06-08 Dmitry V. Levin + + Parametrize debian/changelog. + * configure.ac (CHANGELOGTIME): Rename to RPM_CHANGELOGTIME. + (DEB_CHANGELOGTIME): New variable. + (AC_CONFIG_FILES): Add debian/changelog. + * strace.spec.in: Rename CHANGELOGTIME to RPM_CHANGELOGTIME. + * debian/changelog: Rename to ... + * debian/changelog.in: ... this file. Add parametrized entry. + * debian/.gitignore: New file. + + git-version-gen: replace '-' with '.' in generated version. + * git-version-gen: Replace '-' with '.' so version conforms to policies + * configure.ac (SPEC_VERSION): Remove. + * strace.spec.in: Replace SPEC_VERSION with PACKAGE_VERSION. + Remove %srcname. + +2016-06-07 Dmitry V. Levin + + Parametrize strace.spec. + * configure.ac (SPEC_VERSION, CHANGELOGTIME): Define. + (AC_CONFIG_FILES): Add strace.spec. + * strace.spec: Rename to ... + * strace.spec.in: ... this file. Parametrize Version, srcname, + and the last %changelog entry. Initialize .tarball-version file. + + strace.spec: adopt for OBS. + * strace.spec: Parametrize libunwind-devel BRs, BuildRoot, and %defattr. + +2016-06-07 Dmitry V. Levin + + tests: remove obsolete strace-f.test. + strace-f.test is too inexact while fork-f.test does the right thing. + + * tests/strace-f.test: Remove. + * tests/Makefile.am (MISC_TESTS): Remove it. + * strace.spec (BuildRequires): Remove time. + +2016-06-07 Dmitry V. Levin + + tests: always distribute strace-k.test. + Fix distribution of tests/strace-k.test file when configured + without libunwind. + + * tests/Makefile.am (EXTRA_DIST): Add strace-k.test. + +2016-06-07 Dmitry V. Levin + + make-dist: skip news-check for non-releases. + * make-dist: Run news-check only when the commit being built + matches a release tag. + +2016-06-06 Dmitry V. Levin + + tests: check decoding of setrlimit, getrlimit, and ugetrlimit syscalls. + * tests/getrlimit.c: New file. + * tests/setrlimit.c: Likewise. + * tests/ugetrlimit.c: Likewise. + * tests/xgetrlimit.c: Likewise. + * tests/getrlimit.test: New test. + * tests/setrlimit.test: Likewise. + * tests/ugetrlimit.test: Likewise. + * tests/.gitignore: Add getrlimit, setrlimit, and ugetrlimit. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getrlimit.test, setrlimit.test, + and ugetrlimit.test. + (EXTRA_DIST): Add xgetrlimit.c. + + tests: check decoding of prlimit64 syscall. + * tests/prlimit64.c: New file. + * tests/prlimit64.test: New test. + * tests/.gitignore: Add prlimit64. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prlimit64.test. + + Fix decoding of pid_t argument of prlimit64 syscall. + * resource.c (SYS_FUNC(prlimit64)): Print pid_t syscall + argument using %d format. + +2016-06-06 Dmitry V. Levin + + Do not check for old sysctl enums. + Assume that sysctl enums defined since linux v2.6 are always defined, + with a signle exception: check for CTL_PROC which definition was removed + in v2.6.18 and restored later in v2.6.23. + + * configure.ac (AC_CHECK_DECLS): Remove old constants. + * xlat/sysctl_kern.in: Mark constants older than KERN_PRINTK_RATELIMIT + as unconditional. + * xlat/sysctl_net.in: Mark constants older than NET_LLC + as unconditional. + * xlat/sysctl_net_core.in: Mark constants older than NET_CORE_BUDGET + as unconditional. + * xlat/sysctl_net_ipv4.in: Mark constants older than + NET_IPV4_IGMP_MAX_MSF as unconditional. + * xlat/sysctl_net_ipv4_conf.in: Mark constants older than + NET_IPV4_CONF_FORCE_IGMP_VERSION as unconditional. + * xlat/sysctl_net_ipv4_route.in: Mark constants older than + NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS as unconditional. + * xlat/sysctl_net_ipv6.in: Mark constants older than + NET_IPV6_MLD_MAX_MSF as unconditional. + * xlat/sysctl_net_ipv6_route.in: Mark constants older than + NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS as unconditional. + * xlat/sysctl_net_unix.in: Mark all constants as unconditional. + * xlat/sysctl_root.in: Mark constants older than CTL_ARLAN + as unconditional. + * xlat/sysctl_vm.in: Mark constants older than VM_MAX_MAP_COUNT + as unconditional. + +2016-06-06 Dmitry V. Levin + + xlat: extend syntax. + * xlat/gen.sh: Implement #conditional directive that turns on + preprocessor checks turned off earlier by #unconditional directive. + +2016-06-06 Elvira Khabirova + + mpers.awk: remove unnecessary type attribute retrieval. + * mpers.awk (what_is): Do not retrieve "type" attribute + for "enumeration_type". + + tests/ptrace.c: fix fork() return value check. + * tests/ptrace.c (test_peeksiginfo): Explicitly cast fork() return value + to pid_t. + + .gitignore: add missing files that should be ignored. + * .gitignore: Add ioctl_redefs[12].h and libstrace.a. + +2016-06-06 Dmitry V. Levin + + debian: sync with the package. + * debian/control (Build-Depends) [amd64]: Remove libunwind-dev. + * debian/changelog: Sync with 4.12-3. + * debian/rules: Likewise. + +2016-06-06 Dmitry V. Levin + + tests/strace-S.test: fix testing 64-bit strace using a 32-bit userspace. + * tests/strace-S.test: Measure wall clock time instead of system time. + Use local "./readv" instead of system "date" as a sample executable. + + Reported-by: Steve McIntyre + +2016-06-06 Dmitry V. Levin + + tests/strace-S.test: enhance error diagnostics. + * tests/strace-S.test: If strace output does not meet expectations, + print the output. + +2016-06-02 Dmitry V. Levin + + .gitignore: sort the list of ignored patterns. + * .gitignore: Sort. + +2016-06-01 Dmitry V. Levin + + maint: post-release administrivia. + * NEWS: Add header line for the next release. + +2016-05-31 Dmitry V. Levin + + Prepare for 4.12 release. + * NEWS: Update for 4.12 release. + * debian/changelog: 4.12-1. + * strace.spec: 4.12-1. + + Sync strace.spec and debian/changelog with packages. + * debian/changelog: Sync with 4.11-1. + * strace.spec: Sync with 4.11.0.163.9720-2. + +2016-05-30 Dmitry V. Levin + + Mpersify hdio.c. + * defs.h (hdio_ioctl): Remove. + * hdio.c: Mpersify struct hd_geometry. + (hdio_ioctl): Mpersify. + +2016-05-29 Dmitry V. Levin + + loop.c: decode LOOP_SET_DIRECT_IO. + * loop.c (loop_ioctl) [LOOP_SET_DIRECT_IO] : Handle LOOP_SET_DIRECT_IO. + + loop.c: fix printing of arrays. + * loop.c (decode_loop_info): Use square brackets to print + struct loop_info.lo_init and struct loop_info.reserved arrays. + (decode_loop_info64): Use square brackets to print + struct loop_info64.lo_init array. + + loop.c: fix printing of structure members' names. + * loop.c (decode_loop_info, decode_loop_info64): Do not strip "lo_" + prefix from printed names. + + loop.c: optimize decoding of paired ioctls. + * loop.c (loop_ioctl): Optimize decoding of LOOP_[GS]ET_STATUS + and LOOP_[GS]ET_STATUS64 ioctl pairs. + +2016-05-28 Dmitry V. Levin + + tests/ioctl_evdev.c: check EVIOCGUNIQ decoding. + * tests/ioctl_evdev.c (main): Check EVIOCGUNIQ(0) decoding. + + tests/ioctl_mtd.c: fix build with musl. + * tests/ioctl_mtd.c: Include . + + tests: check decoding of 'M' type ioctls. + * tests/ioctl_mtd.c: New file. + * tests/ioctl_mtd.test: New test. + * tests/.gitignore: Add ioctl_mtd. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_mtd.test. + + Mpersify mtd.c. + * defs.h (mtd_ioctl): Remove. + * mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers. + (mtd_ioctl): Mpersify. + + mtd.c: refactor. + * mtd.c (mtd_ioctl): Move parsers of structures to separate functions. + + Move parser of UBI_* ioctls to a separate file. + * mtd.c (ubi_ioctl): Move to ... + * ubi.c: ... new file. + * Makefile.am (strace_SOURCES): Add it. + + tests: check decoding of EVIOC* ioctls. + * tests/ioctl_evdev.c: New file. + * tests/ioctl_evdev-v.c: Likewise. + * tests/ioctl_evdev.test: New test. + * tests/ioctl_evdev-v.test: Likewise. + * tests/.gitignore: Add ioctl_evdev and ioctl_evdev-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_evdev.test and ioctl_evdev-v.test. + + Mpersify EVIOC* ioctl parser. + * defs.h (evdev_abs): New xlat prototype. + (evdev_ioctl): Remove. + * evdev.c: Do not include "xlat/evdev_abs.h". + Mpersify struct ff_effect and ioctl numbers. + (evdev_ioctl): Mpersify. + * NEWS: Mention this enhancement. + + evdev.c: fix printing of unrecognized event type passed to EVIOCGBIT. + * evdev.c (bit_ioctl): If event type is not unrecognized, + print the argument as an address. + + evdev.c: fix printing of EV_PWR's argument. + * evdev.c (bit_ioctl): Fix printing of comma before EV_PWR's argument. + + evdev.c: fix indentation. + * evdev.c: Fix indentation of print formats. + + evdev.c: fix decoding of EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ. + * evdev.c (evdev_read_ioctl): Fix printing of the string returned + in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests. + + evdev.c: fix EVIOCGVERSION decoding. + * evdev.c (evdev_read_ioctl): Print EVIOCGVERSION's argument + using #x format. + + evdev.c: fix EVIOCGMTSLOTS decoding. + * evdev.c (mtslots_ioctl): Use umove_or_printaddr. + + evdev.c: fix bitset decoding. + * evdev.c (decode_bitset): Use umove_or_printaddr. + + evdev.c: fix decoding of struct input_id. + * evdev.c (getid_ioctl): Use umove_or_printaddr. + + evdev.c: fix decoding of struct input_keymap_entry. + * evdev.c (keycode_V2_ioctl): Use umove_or_printaddr. + + evdev.c: fix decoding of EVIOCGKEYCODE/EVIOCSKEYCODE. + * evdev.c (keycode_ioctl): Use umove_or_printaddr. + + evdev.c: fix decoding of struct input_absinfo. + * evdev.c (abs_ioctl): Use umove_or_printaddr. + + evdev.c: fix decoding of struct ff_effect. + * evdev.c (ff_effect_ioctl): Use umove_or_printaddr. + Fix printing of struct ff_effect.u member names. + + evdev.c: fix printing of struct ff_envelope.fade_level. + * evdev.c (decode_envelope): Print struct ff_envelope.fade_level + using #x format. + + evdev.c: fix decoding of EVIOCGRAB and EVIOCREVOKE. + * evdev.c (evdev_write_ioctl): Print argument of EVIOCGRAB + and EVIOCREVOKE as unsigned long. + + evdev.c: fix EVIOCRMFF decoding. + * evdev.c (evdev_write_ioctl): Print EVIOCRMFF's argument as int. + + evdev.c: move handling of EVIOCGBIT to a separate function. + * evdev.c (evdev_read_ioctl): Move EVIOCGBIT handling to ... + (bit_ioctl): ... new function. + +2016-05-28 Dmitry V. Levin + + evdev.c: reorder ioctl command checks. + Change the order of ioctl command cheks to match the kernel: + 1st, check for fixed-number fixed-length commands, + 2nd, check for fixed-number variable-length commands, + 3rd, check for multi-number fixed-length commands, + 4thm check for multi-number variable-length commands. + + * evdev.c (evdev_read_ioctl, evdev_write_ioctl): Reorder + ioctl command checks. + +2016-05-28 Dmitry V. Levin + + evdev.c: decode all directions except _IOC_READ on entering syscall. + * evdev.c (evdev_write_ioctl): Remove exiting check. + (evdev_read_ioctl): Move entering check ... + (evdev_ioctl): ... here. Add RVAL_DECODED to return code in _IOC_WRITE + and default cases. + + evdev.c: fix indentation of preprocessor directives. + * evdev.c: Fix indentation of preprocessor directives. + Move inclusion of into [HAVE_LINUX_INPUT_H]. + +2016-05-28 Jeff Mahoney + + file_ioctl.c: print first two extents for FIDEDUPERANGE in abbrev mode. + * file_ioctl.c (file_ioctl, print_file_dedupe_range_info): Print first + two elements of info array in abbrev mode. + * tests/btrfs.c (btrfs_test_extent_same_ioctl): Handle newly + printed elements. + +2016-05-27 Dmitry V. Levin + + ioctl.c: fix typo in decoding of EVIOCSABS's parameter. + * ioctl.c (evdev_decode_number): Fix typo in printxval default value. + +2016-05-27 Jeff Mahoney + + tests: check decoding of btrfs RDWR ioctls returned data. + * tests/btrfs-vw.test: New file. + * tests/btrfs-w.test: New file. + * tests/Makefile.am (DECODER_TESTS): Add them. + + tests/btrfs.c: fix live btrfs_test_search_ioctls output. + * tests/btrfs.c (btrfs_test_search_ioctls): Use print_tree_search_buf + for BTRFS_IOC_TREE_SEARCH and fix missing whitespace. + + btrfs.c: don't use print_array in btrfs_print_tree_search. + * btrfs.c (btrfs_print_tree_search): Don't use print_array. The buffer + represents a series of variable sized records, not an array. + + btrfs.c: fix print_array usage in btrfs_print_logical_ino_container. + * btrfs.c: (btrfs_print_logical_ino_container) Fix the element count + to reflect the number of records rather than the number of items. + +2016-05-26 Jeff Mahoney + + tests/btrfs.c: fix btrfs-v for BTRFS_IOC_TREE_SEARCH. + * tests/btrfs.c (btrfs_test_send_ioctl): Assign key_reference + to search_args for BTRFS_IOC_TREE_SEARCH ioctl tests. + +2016-05-26 Fabien Siron + + Fix -yy documentation. + * strace.c (usage): Fix description of -yy option. + * strace.1: Likewise. + +2016-05-26 Dmitry V. Levin + + tests/ioctl_block.c: tweak magic constants to make the test more reliable + * tests/ioctl_block.c (main): Change bad pointer to make + its lower 32-bit part closer to -1U. + + tests/btrfs.c: check basic decoding of read-only ioctls. + * tests/btrfs.c (btrfs_test_read_ioctls): New function. + (main): Use it. + + tests: check decoding of BLK* ioctls. + * configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup. + * tests/ioctl_block.c: New file. + * tests/ioctl_block.test: New test. + * tests/.gitignore: Add ioctl_block. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_block.test. + + Mpersify BLK* ioctl parser. + * defs.h (block_ioctl): Remove. + * block.c: Mpersify struct blk_user_trace_setup, + struct blkpg_ioctl_arg, struct blkpg_partition, and ioctl numbers. + (block_ioctl): Mpersify. + * NEWS: Mention this enhancement. + + block.c: optimize decoding of paired ioctls. + * block.c (block_ioctl): Optimize decoding of commands that return + a signed int. + + block.c: fix printing of uint64_t pairs. + * block.c (block_ioctl): Print uint64_t values using PRIu64 format. + + block.c: fix printing of struct blk_user_trace_setup. + * block.c (block_ioctl): Fix printing of comma before + struct blk_user_trace_setup.name on exiting syscall. + + 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'. + + Move parser of HDIO_* ioctls to a separate file. + * hdio.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * block.c: Do not include . + (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. + + Fix explicit casts of signed integer types to unsigned long long. + * defs.h (widen_to_ull): New macro. + * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place + of explicit casts to unsigned long long. + * io.c (print_lld_from_low_high_val): Likewise. + * lseek.c (SYS_FUNC(llseek)): Likewise. + * printsiginfo.c (print_si_info): Likewise. + * printstat.h (DO_PRINTSTAT): Likewise. + * sysinfo.c (SYS_FUNC(sysinfo)): Likewise. + * times.c (SYS_FUNC(times)): Likewise. + * fetch_struct_statfs.c (ASSIGN_NUMBER): Remove. + (fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER + with widen_to_ull. + + scsi.c: print __u64 types using PRI__u64 format. + * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Remove explicit casts + to unsigned long long, print fields of type __u64 using PRI__u64 format. + +2016-05-25 Dmitry V. Levin + + tests: check decoding of RTC_* ioctls. + * configure.ac (AC_CHECK_FUNCS): Add ioctl_rtc. + * tests/ioctl_rtc.c: New file. + * tests/ioctl_rtc-v.c: Likewise. + * tests/ioctl_rtc.test: New test. + * tests/ioctl_rtc-v.test: Likewise. + * tests/.gitignore: Add ioctl_rtc and ioctl_rtc-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_rtc.test and ioctl_rtc-v.test. + + Mpersify RTC_* ioctl parser. + * defs.h (rtc_ioctl): Remove. + * rtc.c: Mpersify struct rtc_pll_info and ioctl numbers. + (rtc_ioctl): Mpersify. + * NEWS: Mention this enhancement. + + rtc.c: fix decoding of struct rtc_wkalrm. + * rtc.c (decode_rtc_wkalrm): Print field name of struct rtc_wkalrm.time. + + file_ioctl.c: print file descriptors using printfd. + * file_ioctl.c (print_file_dedupe_range_info): Print + struct file_dedupe_range_info.dest_fd using printfd. + (file_ioctl): Print struct file_clone_range.src_fd using printfd. + + rtc.c: do not print argument of ioctls that have no arguments. + * rtc.c (rtc_ioctl): Do not print argument of RTC_{A,U,P,W}IE_{ON,OFF} + and RTC_VL_CLR ioctls. + + rtc.c: decode RTC_PLL_GET and RTC_PLL_SET. + * rtc.c (rtc_ioctl): Decode RTC_PLL_GET and RTC_PLL_SET + + rtc.c: optimize decoding of paired ioctls. + * rtc.c (rtc_ioctl): Optimize decoding of RTC_ALM_READ/RTC_ALM_SET, + RTC_RD_TIME/RTC_SET_TIME, and RTC_WKALM_RD/RTC_WKALM_SET ioctl pairs. + + block.c: handle BLKDAXGET. + * block.c [!BLKDAXGET] (BLKDAXGET): Define. + (block_ioctl): Handle it. + + tests: check decoding of mount syscall. + * tests/mount.c: New file. + * tests/mount.test: New test. + * tests/.gitignore: Add mount. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mount. + +2016-05-24 Dmitry V. Levin + + tests/vhangup.c: diassociate from the controlling terminal first. + * tests/vhangup.c (main): Call setsid before vhangup. + +2016-05-24 Fei Jie + + tests: add vhangup.test. + * tests/vhangup.c: New file. + * tests/vhangup.test: New test. + * tests/.gitignore: Add vhangup. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add vhangup.test. + +2016-05-24 Dmitry V. Levin + + NEWS: Prepare for 4.12 release. + +2016-05-24 Gleb Fotengauer-Malinovskiy + + tests/btrfs.c: fix build on x32. + * tests/btrfs.c (btrfs_test_ino_path_ioctls): Fix printing of st_ino. + +2016-05-24 Dmitry V. Levin + + tests/btrfs.c: fix build with u64 based BTRFS_IOC_DEFAULT_SUBVOL. + * tests/btrfs.c: Fix build on systems where BTRFS_IOC_DEFAULT_SUBVOL + is defined using unexported type "u64". + + btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME. + * btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case + if this constant is not defined. + * tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part + of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined. + + tests/btrfs.c: fix printing struct btrfs_ioctl_clone_range_args. + * tests/btrfs.c (btrfs_test_clone_ioctls): Print __u64 members + of struct btrfs_ioctl_clone_range_args using PRI__u64 format. + + tests/btrfs.c: tweak magic constants to make the test more reliable. + * tests/btrfs.c (btrfs_test_sync_ioctls): Change u64val + to 0xdeadbeefbadc0ded. + (btrfs_test_subvol_ioctls): Likewise. Change bad_pointer + to make their lower 32-bit parts closer to -1U. + + btrfs.c: print file descriptors using printfd. + * btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_send_args.send_fd, + struct btrfs_ioctl_vol_args.fd, and struct btrfs_ioctl_vol_args_v2.fd + using printfd. + * tests/btrfs.c (btrfs_print_vol_args_v2, btrfs_test_subvol_ioctls, + btrfs_test_device_ioctls, btrfs_test_clone_ioctls, + btrfs_test_send_ioctl): Update. + + tests/btrfs.c: do not print errno in case of fs type mismatch. + * tests/btrfs.c (main): Use error_msg_and_fail instead of + perror_msg_and_fail when the fs type of the given directory + is not BTRFS_SUPER_MAGIC. + + tests/btrfs.c: fix indentation. + * tests/btrfs.c: Fix indentation of preprocessor directives + and function prototypes. + + tests/btrfs.c: sort included headers. + * tests/btrfs.c: Sort included headers. + + tests/btrfs.c: do not use alloca. + * tests/btrfs.c: Don't include . + (btrfs_test_subvol_ioctls): Allocate + struct btrfs_ioctl_vol_args_v2.qgroup_inherit using tail_alloc. + + tests/btrfs.c: fix build on systems without or + * tests/btrfs.c: Include "tests.h" first. + Skip the test if [!HAVE_LINUX_BTRFS_H]. Skip parts of the test + that use struct fiemap if [!HAVE_LINUX_FIEMAP_H]. + +2016-05-24 Jeff Mahoney + + tests: add testing for btrfs ioctls. + * tests/btrfs.c: New file. + * tests/btrfs.test: New test. + * tests/btrfs-v.test: Likewise. + * tests/.gitignore: Add btrfs. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add btrfs.test and btrfs-v.test. + +2016-05-24 Dmitry V. Levin + + tests/file_ioctl.c: use tail_alloc. + * tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc. + + tests/file_ioctl.c: fix build on systems without + * tests/file_ioctl.c: Include "tests.h" first. + Skip the test if [!HAVE_LINUX_FIEMAP_H]. + +2016-05-24 Jeff Mahoney + + tests: add testing for FS_IOC_FIEMAP. + This is limited to FIEMAP. FICLONE* and FIDEDUPERANGE originated in + btrfs and will be tested there. + + * tests/file_ioctl.c: New file. + * tests/file_ioctl.test: New test. + * tests/.gitignore: Add file_ioctl. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add file_ioctl.test. + +2016-05-24 Dmitry V. Levin + + Mpersify btrfs.c. + * btrfs.c: Mpersify 3 arch-specific structures + and corresponding ioctl numbers. + (btrfs_ioctl): Mpersify. + * defs.h (btrfs_ioctl): Remove. + + btrfs.c: use print_array. + * btrfs.c (print_btrfs_data_container_logical_ino, + print_btrfs_data_container_ino_path, print_uint64, + print_btrfs_ioctl_search_header, print_objectid_callback, + print_btrfs_ioctl_space_info): New functions. + (btrfs_print_logical_ino_container, btrfs_print_ino_path_container): + Rewrite printers of struct btrfs_data_container.val array + using print_array. + (btrfs_print_qgroup_inherit): Rewrite printer of + struct btrfs_qgroup_inherit.qgroups array using print_array. + (btrfs_print_tree_search): Rewrite printer of + struct btrfs_ioctl_search_header array using print_array. + (btrfs_ioctl): Rewrite printer of + struct btrfs_ioctl_send_args.clone_sources and + struct btrfs_ioctl_space_args.spaces using print_array. + + btrfs.c: simplify BTRFS_IOC_GET_FSLABEL parser. + * btrfs.c (btrfs_ioctl): Share code of parser of BTRFS_IOC_SET_FSLABEL + with parser of BTRFS_IOC_GET_FSLABEL only on BTRFS_IOC_GET_FSLABEL's + entering. + + btrfs.c: fix BTRFS_IOC_TREE_SEARCH_V2 output. + * btrfs.c (btrfs_ioctl): Fix BTRFS_IOC_TREE_SEARCH_V2 output + in case of EOVERFLOW and failed umove. + + btrfs.c: cleanup use of tcp->auxstr. + * btrfs.c (btrfs_ioctl): Reset tcp->auxstr only if it is set. + + btrfs.c: cleanup struct btrfs_ioctl_get_dev_stats.nr_items check. + * btrfs.c (btrfs_ioctl): Cleanup check of iterator of + btrfs_ioctl_get_dev_stats.values array. + + btrfs.c: do not use BTRFS_SUBVOL_NAME_MAX. + * btrfs.c [BTRFS_SUBVOL_NAME_MAX]: Remove. + (btrfs_ioctl): Use sizeof(struct btrfs_ioctl_vol_args_v2.name) + instead of BTRFS_SUBVOL_NAME_MAX + 1. + + btrfs.c: mark some function arguments as const. + * btrfs.c (btrfs_print_balance_args, btrfs_print_features, + btrfs_print_qgroup_limit, btrfs_print_data_container_header, + btrfs_print_logical_ino_container, btrfs_print_ino_path_container, + btrfs_print_qgroup_inherit): Mark some function arguments as const. + + btrfs.c: use umove instead of umoven. + * btrfs.c: Use umove instead of umoven and umove_or_printaddr + instead of umoven_or_printaddr. + + btrfs.c: remove unused variable. + * btrfs.c (btrfs_ioctl): Remove "ret" variable. + + btrfs.c: use printxval/printxval64 instead of printxvals. + * btrfs.c (btrfs_ioctl): Do not call printxvals directly, + use printxval/printxval64 wrappers that do the right thing. + + btrfs.c: fix indentation. + * btrfs.c: Fix indentation of preprocessor directives and print formats. + + xlat/btrfs_dev_stats_values.in: cleanup. + * xlat/btrfs_dev_stats_values.in: Remove HAVE_DECL_* defines, + use #unconditional instead. + + file_ioctl.c: use print_array. + * file_ioctl.c (file_ioctl): Rewrite printers of + struct file_dedupe_range_info and struct fiemap_extent arrays + using print_array. + + file_ioctl.c: fix indentation. + * file_ioctl.c: Fix indentation of preprocessor directives + and print formats. + +2016-05-24 Dmitry V. Levin + + file_ioctl.c: include instead of + Being a wrapper around , brings + no benefits for this parser. + + * file_ioctl.c: Include instead of . + +2016-05-24 Dmitry V. Levin + + file_ioctl.c: fix build on systems without + * configure.ac (AC_CHECK_HEADERS): Add linux/fiemap.h. + * file_ioctl.c: Do not include and xlat/fiemap_*.h + if [!HAVE_LINUX_FIEMAP_H]. + (file_ioctl): Do not parse FS_IOC_FIEMAP if [!HAVE_LINUX_FIEMAP_H]. + + ioctl.c: fix build. + * ioctl.c (ioctl_decode): Move definition of "ret" variable + to [ALPHA || POWERPC] case. + [ALPHA || POWERPC]: Fix syntax error. + +2016-05-24 Jeff Mahoney + + ioctl: add decoding for FS_IOC_FIEMAP. + * file_ioctl.c: Include , "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. + +2016-05-24 Dmitry V. Levin + + Add xlat/fiemap_flags.in and xlat/fiemap_extent_flags.in. + * xlat/fiemap_flags.in: New file. + * xlat/fiemap_extent_flags.in: Likewise. + +2016-05-24 Jeff Mahoney + + 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. + +2016-05-24 Gleb Fotengauer-Malinovskiy + + x32: update ioctl entries from linux 4.6. + * linux/x32/ioctls_inc0.h: Update from linux v4.6 using ioctls_gen.sh. + +2016-05-24 Dmitry V. Levin + + tests/attach-f-p.c: sleep a bit more to let the tracer catch up. + On noticeably lagging systems, the parent process may invoke its chdir + call before the tracer gets notified about completion of its last child + process. Add extra sleep in the parent process to win the race. + + * tests/attach-f-p.c (main): Change timerid into a static array. + Arm a timer in the parent process and wait for it. + +2016-05-23 Dmitry V. Levin + + tests/attach-p-cmd-cmd.c: fix potential errno clobbering. + * tests/attach-p-cmd-cmd.c (main): Call getpid before chdir. + + tests/net-yy-netlink.c: robustify against libc specific issues. + * tests/net-yy-netlink.c (main): Use getsockname instead of recvmsg + as the latter has notible implementation differences that make + the test unreliable. + + tests/net-yy-netlink.c: robustify against os specific issues. + * tests/net-yy-netlink.c (main): Pass a pointer to a real struct msghdr + as NULL doesn't work well on some systems. + + tests/net-yy-{inet,netlink}.test: cleanup. + * tests/net-yy-inet.test: Do not pass arguments to net-yy-inet + as the latter does not accept them. + * tests/net-yy-netlink.test: Do not pass arguments to net-yy-netlink + as the latter does not accept them. + +2016-05-22 Jeff Mahoney + + tests: define PRI__[dux]64 macros to print __s64 and __u64 values. + Rather than cast every __u64 or __s64 before printing, + define printing helpers for those types directly. + + This complements commit 1f3482bedad505a41caf1d61b3a4e7e09a2f4330. + + * tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros. + +2016-05-22 Dmitry V. Levin + + tests: remove manual creation of memory mapping holes. + We used to call tail_alloc(1) to create memory mapping holes around + regular tail_alloc allocations. This is no longer needed since regular + tail_alloc allocations create additional memory mapping holes. + + * tests/clock_adjtime.c (main): Remove creation of memory mapping holes + using tail_alloc(1). + * tests/futimesat.c (main): Likewise. + * tests/get_mempolicy.c (print_nodes, main): Likewise. + * tests/getgroups.c (main): Likewise. + * tests/getresugid.c (main): Likewise. + * tests/ioctl_uffdio.c (main): Likewise. + * tests/ioctl_v4l2.c (main): Likewise. + * tests/move_pages.c (main): Likewise. + * tests/net-icmp_filter.c (main): Likewise. + * tests/ptrace.c (test_peeksiginfo, main): Likewise. + * tests/pwritev.c (main): Likewise. + * tests/set_mempolicy.c (print_nodes): Likewise. + * tests/setgroups.c (main): Likewise. + * tests/umovestr3.c (main): Likewise. + * tests/utimes.c (main): Likewise. + * tests/xattr.c (main): Likewise. + +2016-05-22 Dmitry V. Levin + + tests: make tail_alloc create additional memory mapping holes. + * tests/tail_alloc.c (tail_alloc): Create additional memory mapping + holes before and after the allocated memory. + +2016-05-21 Dmitry V. Levin + + mpers: add support of conditionally compiled printers. + We used to declare and define all printers marked with + MPERS_PRINTER_DECL, including ifdef'ed ones. That approach left us + no way to conditionally compile mpersified printers, which was not + a problem until btrfs ioctls appeared on the horizon. + + With this change, those mpersified printers that are not going + to be compiled are also won't be declared and won't be added to + struct_printers. + + This is implemented by filtering all source files containing + MPERS_PRINTER_DECL markers through CPP. As a nice side effect, this + also lifts an ugly requirement of writing all MPERS_PRINTER_DECL + declarations in a single line. + + * README-mpers: Update description of MPERS_PRINTER_DECL syntax. + * defs.h [IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into + a recursive variadic macro. + [!IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into a variadic macro. + All callers changed. + * Makefile.am (mpers_preproc_files, mpers_printer_decl_pattern): + New variables. + (CLEANFILES): Add $(mpers_preproc_files). + (%.c.mpers.i): New rule. + (printers.h, %_printer_decls.h, %_printer_defs.h): Use + mpers_preproc_files instead of srcdir_mpers_source_files, + use mpers_printer_decl_pattern. + * .gitignore: Add /*.mpers.i. + +2016-05-20 Dmitry V. Levin + + Remove redundant declaration of v4l2_ioctl. + There is no need to declare mpers printers in defs.h because + they are already declared in printers.h or native_printer_decls.h. + + This complements commit 1e56814f77594a22a74ddee629639eb0bb7edf3a. + + * defs.h (v4l2_ioctl): Remove. + +2016-05-21 Dmitry V. Levin + + Fix one more code pattern that might break gcc strict aliasing rules. + * socketutils.c (receive_responses): Turn static buffer into a union + to avoid breaking of gcc strict aliasing rules. + * tests/netlink_inet_diag.c (check_responses): Likewise. + * tests/netlink_netlink_diag.c (check_responses): Likewise. + * tests/netlink_unix_diag.c (check_responses): Likewise. + +2016-05-21 Fabien Siron + + tests: add check for netlink protocol decoding with -yy option. + * tests/netlink_netlink_diag.c: New file. + * tests/net-yy-netlink.c: New file. + * tests/net-yy-netlink.test: New test. + * tests/.gitignore: Add net-yy-netlink and netlink_netlink_diag + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add net-yy-netlink.test. + +2016-05-18 Fabien Siron + + Add netlink domain sockets support to socketutils. + * linux/netlink_diag.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * socketutils.c: Include it and "xlat/netlink_protocols.h". + (netlink_send_query, netlink_parse_response, netlink_print): New + functions. + (print_sockaddr_by_inode): Hook up netlink_print. + +2016-05-18 Dmitry V. Levin + + tests/pread64-pwrite64.c: robustify against os specific issues. + Do not assume that pwrite64 syscall fails when only part of the + specified memory buffer is accessible. With some kernels, one + accessible byte at the end of page is enough for pwrite64 syscall + to return 1. + + * tests/pread64-pwrite64.c (main): Tweak the test that can lead + to a partial write. + +2016-05-18 Dmitry V. Levin + + tests/read-write.c: robustify against os specific issues. + Do not assume that write syscall fails when only part of the specified + memory buffer is accessible. With some kernels, one accessible byte + at the end of page is enough for write syscall to return 1. + + * tests/read-write.c (main): Tweak the test that can lead to a partial + write. + +2016-05-18 Dmitry V. Levin + + umovestr3.test: extend test coverage. + * tests/umovestr3.c: Include . + (main): Test with each number between PATH_MAX-1 and 0. + + tests/timer_create.c: robustify against os specific issues. + * tests/timer_create.c (main): Do not assume any specific error code + returned by timer_create, print whatever it is. + + Fix some compilation warnings on older systems. + * print_statfs.c (print_statfs_flags): Define only + for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS]. + * tests/inet-cmsg.c (print_origdstaddr): Define only + for [IP_ORIGDSTADDR]. + + Update generic ioctl entries from linux 4.6. + * linux/64/ioctls_inc.h: Update from linux v4.6 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 4.6. + * maint/ioctls_sym.sh: Update workarounds for linux/kvm.h. + + Update SOL_* constants. + * xlat/socketlayers.in: Add SOL_KCM. + + Update MSG_* constants. + * xlat/msg_flags.in: Add MSG_BATCH. + + Update AF_* constants. + * xlat/addrfams.in: Add AF_KCM. + +2016-05-17 Fei Jie + + tests: add brk.test. + * tests/brk.c: New file. + * tests/brk.test: New test. + * tests/.gitignore: Add brk. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add brk.test. + +2016-05-17 Dmitry V. Levin + + Fix printing of invalid arguments of term ioctls. + * term.c (term_ioctl): Print arguments of TCXONC and TCFLSH ioctls + using printxval_long. + + mips: fix printing of invalid operations argument of sysmips syscall. + * sysmips.c (SYS_FUNC(sysmips)): Print 1st argument of syscall using + printxval_long. + + bfin: fix printing of invalid flags argument of sram_alloc syscall. + * sram_alloc.c (SYS_FUNC(sram_alloc)): Print 2nd argument using + printflags_long. + +2016-05-16 Dmitry V. Levin + + Fix printing of invalid arguments of prctl syscall. + * prctl.c (SYS_FUNC(prctl)): Print 2nd syscall argument + of PR_CAPBSET_DROP, PR_CAPBSET_READ, PR_CAP_AMBIENT, PR_MCE_KILL, + and PR_SET_SECCOMP using printxval_long. + Print 2nd syscall argument of PR_SET_SECUREBITS using printflags_long. + Print 3rd syscall argument of PR_CAP_AMBIENT and PR_MCE_KILL using + printxval_long. + * tests/prctl-seccomp-strict.c (main): Update. + + Fix printing of invalid flags argument of perf_event_open syscall. + * numa.c (SYS_FUNC(perf_event_open)): Print 5th argument of syscall + using printflags_long. + + or1k: fix printing of invalid 1st argument of or1k_atomic syscall. + * or1k_atomic.c (SYS_FUNC(or1k_atomic)): Print 1st argument using + printxval_long. + + Fix printing of invalid flags argument of get_mempolicy syscall. + * numa.c (SYS_FUNC(get_mempolicy)): Print 5th argument of syscall + using printxval_long. + + Fix printing of invalid mode argument of mbind syscall. + * numa.c (SYS_FUNC(mbind)): Print 3rd argument of syscall + using printxval_long. + * tests/mbind.c (main): Update. + + Fix printing of invalid argument of MTDFILEMODE ioctl. + * mtd.c (mtd_ioctl): Print 3rd argument of MTDFILEMODE ioctl + using printflags_long. + + Fix printing of invalid flags argument of mount syscall. + * mount.c (SYS_FUNC(mount)): Print 1st argument using printflags_long. + + Fix printing of invalid arguments of memory mapping related syscalls. + * mem.c (print_mmap): Print 3rd and 4th arguments of syscall + using printflags_long. + (SYS_FUNC(mprotect)): Print 3rd argument of syscall using + printflags_long. + (SYS_FUNC(mremap)): Print 4th argument of syscall using printflags_long. + (SYS_FUNC(remap_file_pages)): Print 3rd and 4th arguments of syscall + using printflags_long. + * tests/remap_file_pages.c (main): Update. + + Fix printing of invalid flags argument of kexec_load and kexec_file_load + * kexec.c (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Print + flags argument using printflags_long. + + Fix printing of invalid 3rd argument of fcntl/fcntl64 syscall. + * fcntl.c (print_fcntl): Print 3rd argument of F_NOTIFY, F_SETLEASE, and + F_ADD_SEALS operations using printflags_long. + + Fix printing of invalid flags argument of unshare syscall. + * clone.c (SYS_FUNC(unshare)): Print 1st argument using printflags_long. + + Introduce printflags_long and printxval_long. + * defs.h (printflags_long, printxval_long): New static inline functions. + + Fix printing of invalid struct xfs_dqblk.d_flags. + * quota.c (decode_cmd_data): Explicitly cast struct xfs_dqblk.d_flags + to uint8_t to avoid potential sign-extension bug when printing + invalid struct xfs_dqblk.d_flags. + + Fix printing of invalid struct ubi_mkvol_req.vol_type. + * mtd.c (ubi_ioctl): Explicitly cast struct ubi_mkvol_req.vol_type + to unsigned short to avoid potential sign-extension bug when printing + invalid struct ubi_mkvol_req.vol_type. + +2016-05-16 Dmitry V. Levin + + Fix decoding of prctl/arch_prctl operation argument. + Consistently treat operation argument of prctl/arch_prctl syscalls + as int to match the kernel behaviour. + + * prctl.c (SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): Assign 1st argument + of syscalls to a variable of type unsigned int and use it in all + subsequent checks and lookups. + +2016-05-16 Dmitry V. Levin + + Fix printing of struct sched_attr.sched_flags. + * sched.c (print_sched_attr): Print sched_flags using printflags64. + + Fix printing of struct statfs.f_flags. + * print_statfs.c (print_statfs_flags): Print flags using printflags64. + + Fix printing of invalid struct ifreq.ifr_flags. + * sock.c (print_ifreq): Explicitly cast struct ifreq.ifr_flags + to unsigned short to avoid potential sign-extension bug when printing + invalid struct ifreq.ifr_flags. + + Fix printing of invalid struct pollfd.events. + * poll.c (print_pollfd): Explicitly cast struct pollfd.events + to unsigned short to avoid potential sign-extension bug when printing + invalid struct pollfd.events. + + Fix printing of invalid struct sembuf.sem_flg. + * ipc_sem.c (print_sembuf): Explicitly cast struct sembuf.sem_flg + to unsigned short to avoid potential sign-extension bug when printing + invalid struct sembuf.sem_flg. + + Fix printing of invalid l_type and l_whence in fcntl/fcntl64 syscalls. + * fcntl.c (print_struct_flock64): Explicitly cast l_type and l_whence + fields to unsigned short to avoid potential sign-extension bug when + printing invalid l_type or l_whence fields. + + Fix printing of fanotify_mark mask argument. + * fanotify.c (SYS_FUNC(fanotify_mark)): Print mask using printflags64. + +2016-05-16 Dmitry V. Levin + + Fix decoding of epoll_ctl operation argument. + Consistently treat operation argument of epoll_ctl syscall as int + to match the kernel behaviour. + + * epoll.c (SYS_FUNC(epoll_ctl)): Assign 2nd argument of syscall + to a variable of type unsigned int and use it in all subsequent + checks and lookups. + * tests/epoll_ctl.c (invoke_syscall): New function. + (main): Use it. + +2016-05-16 Dmitry V. Levin + + Fix printing of invalid d_type in getdents syscall. + * dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid + potential sign-extension bug when printing invalid d_type. + + bfin: fix decoding of cacheflush syscall. + * cacheflush.c (SYS_FUNC(cacheflush)): Print 2nd argument + using %lu format. Print 3rd argument as flags. + + Fix decoding of BPF_MAP_UPDATE_ELEM flags. + * bpf.c (bpf_map_update_elem): Print attr.flags using printxval64. + +2016-05-16 Dmitry V. Levin + + Fix decoding of fcntl/fcntl64 operation argument. + Consistently treat operation argument of fcntl/fcntl64 syscalls as int + to match the kernel behaviour. + + * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign + 2nd argument of syscall to a variable of type unsigned int + and use it in all subsequent checks and lookups. + * tests/struct_flock.c (invoke_test_syscall): New function. + (test_flock_einval, test_flock): Use it. + * tests/fcntl.c (test_flock64_einval): Use it. + * tests/fcntl64.c (test_flock64_einval, test_flock64): Use it. + +2016-05-15 Dmitry V. Levin + + Rename sprintflags64 to sprintflags. + * defs.h (sprintflags): Remove. + (sprintflags64): Rename to sprintflags. + * util.c (sprintflags64): Rename to sprintflags. + + Prepare for transition from sprintflags64 to sprintflags. + * fcntl.c (print_fcntl): Cast 3rd argument of sprintflags + to unsigned long. + * membarrier.c (SYS_FUNC(membarrier)): Likewise. + * prctl.c (SYS_FUNC(prctl)): Likewise. + * poll.c (decode_poll_exiting): Cast 3rd argument of sprintflags + to unsigned short. + +2016-05-14 Dmitry V. Levin + + Rename xlookup64 to xlookup. + * defs.h (xlookup): Remove. + (xlookup64): Rename to xlookup. + * util.c (xlookup64): Rename to xlookup. + + Prepare for transition from xlookup64 to xlookup. + * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): + Cast 2nd argument of xlookup to unsigned long. + * prctl.c (SYS_FUNC(prctl)): Likewise. + * sched.c (SYS_FUNC(sched_getscheduler)): Likewise. + * time.c (do_adjtimex): Likewise. + * ioprio.c (sprint_ioprio): Change type of the argument + and local variables from int to unsigned int. + * keyctl.c (print_keyring_serial_number): Cast 2nd argument + of xlookup to unsigned int. + * net.c (tprint_sock_type): Change type of the argument to unsigned int. + * printmode.c (sprintmode): Likewise. + * printsiginfo.c (printsigval): Change type of si_code argument + to unsigned int. + +2016-05-14 Dmitry V. Levin + + v4l2: fix build with old kernel headers. + Prior to v2.6.25-rc3, didn't include all + required headers, resulting to omission of V4L2_* constants. + + This issue doesn't arise in v4l2.c and tests/ioctl_v4l2.c files + because they already include all necessary headers themselves. + + * configure.ac (AC_CHECK_DECLS): Include , , + and before . + +2016-05-13 Dmitry V. Levin + + configure.ac: do not check for sys/ioctl.h and ioctls.h. + Since sys/ioctl.h is included unconditionally when needed + and ioctls.h doesn't exist, these checks are redundant. + + * configure.ac (AC_CHECK_HEADERS): Remove ioctls.h and sys/ioctl.h. + +2016-05-13 Dmitry V. Levin + + sock.c: include instead of or + Include for on alpha, sh, and sh64 + architectures because their use _IOR and _IOW macros + but don't include anything that would define these macros. + + Being a wrapper around , brings + no benefits in this case. simply doesn't exist. + + * sock.c [ALPHA || SH || SH64]: Include + instead of or . + +2016-05-13 Dmitry V. Levin + + v4l2: include instead of + Being a wrapper around , brings + no benefits for parser of VIDIOC_* ioctls. + + * v4l2.c: Include instead of . + +2016-05-13 Dmitry V. Levin + + printsiginfo: remove "verbose" argument. + Remove erroneous use of verbose(tcp) as a printing limit + for already fetched members of siginfo_t structure. + + * printsiginfo.h (printsiginfo): Remove boolean argument. + * printsiginfo.c (printsigval): Remove boolean argument, print + si_int and si_ptr members unconditionally. All callers changed. + (print_si_info): Remove boolean argument, print si_utime and si_stime + members unconditionally. All callers changed. + (printsiginfo): Remove boolean argument. All callers changed. + +2016-05-13 Dmitry V. Levin + + tests/ptrace.c: tweak magic constants to make the test more reliable. + * tests/ptrace.c (main): Change bad_request and bad_data to make they + lower 32-bit parts closer to -1U. + +2016-05-13 Dmitry V. Levin + + tests/ioctl_v4l2.c: fix build on older systems. + Fix build on systems without HAVE_DECL_V4L2_CTRL_TYPE_STRING or + V4L2_CTRL_CLASS_CAMERA. + + * tests/ioctl_v4l2.c (main) [VIDIOC_S_EXT_CTRLS]: Disable part of the + test if [!HAVE_DECL_V4L2_CTRL_TYPE_STRING]. + Replace V4L2_CTRL_CLASS_CAMERA with V4L2_CTRL_CLASS_USER. + +2016-05-13 Dmitry V. Levin + + Do not use htole32 function. + htole32 function is not portable enough. + + * v4l2.c (print_pixelformat): Rewrite initialization of pixel format + union without using of htole32. + * tests/ioctl_v4l2.c (main): Likewise. + +2016-05-13 Dmitry V. Levin + + tests/ioctl_v4l2.c: fix typo. + * tests/ioctl_v4l2.c (main) + [!HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE]: Fix typo in expected + output string. + + tests: check decoding of ptrace syscall. + * tests/ptrace.c: New file. + * tests/ptrace.test: New test. + * tests/.gitignore: Add ptrace. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ptrace. + +2016-05-13 Dmitry V. Levin + + ptrace: decode data argument of PTRACE_PEEKSIGINFO request. + The data argument of PTRACE_PEEKSIGINFO request is a pointer + to siginfo_t array. + + * printsiginfo.c (print_siginfo_t): New function. + (print_siginfo_array): New mpers printer. + * process.c (SYS_FUNC(ptrace)): Print data argument of + PTRACE_PEEKSIGINFO request using print_siginfo_array. + +2016-05-13 Dmitry V. Levin + + ptrace: decode data argument of PTRACE_SECCOMP_GET_FILTER request. + * process.c (SYS_FUNC(ptrace)): Print data argument of + PTRACE_SECCOMP_GET_FILTER request on exiting using print_seccomp_fprog. + + ptrace: decode argument of PTRACE_GETEVENTMSG request. + * process.c (SYS_FUNC(ptrace)): Print data argument of + PTRACE_GETEVENTMSG request on exiting using printnum_ulong. + + ptrace: decode arguments of PTRACE_[GS]ETSIGMASK requests. + * process.c (SYS_FUNC(ptrace)): Print arguments of PTRACE_GETSIGMASK + and PTRACE_SETSIGMASK requests using print_sigset_addr_len. + + ptrace: return RVAL_DECODED for requests decoded on entering. + * process.c (SYS_FUNC(ptrace)): Return RVAL_DECODED on entering for all + ptrace requests except those that are partially decoded in exiting, + +2016-05-12 Dmitry V. Levin + + ptrace: print PTRACE_O_* flags using printflags64. + As flags argument has a long integer type, print it using printflags64 + because printflags takes unsigned int argument. + + * process.c (SYS_FUNC(ptrace)): Print PTRACE_O_* flags + using printflags64. + +2016-05-12 Dmitry V. Levin + + ptrace: print data argument of PTRACE_SEIZE et al requests as flags. + * process.c (SYS_FUNC(ptrace)): Print data argument of + PTRACE_SEIZE and PTRACE_OLDSETOPTIONS as PTRACE_O_* flags. + + ptrace: print data argument of PTRACE_SINGLEBLOCK et al requests as signo + * process.c (SYS_FUNC(ptrace)): Print data argument of + PTRACE_SINGLEBLOCK, PTRACE_SYSEMU, and PTRACE_SYSEMU_SINGLESTEP requests + as a signal number. + +2016-05-12 Dmitry V. Levin + + ptrace: decode addr argument of PTRACE_PEEKSIGINFO request. + The addr argument of PTRACE_PEEKSIGINFO request is a pointer to + a struct ptrace_peeksiginfo_args. + + * process.c: Include "xlat/ptrace_peeksiginfo_flags.h". + (SYS_FUNC(ptrace)): Print addr argument of PTRACE_PEEKSIGINFO request + as a struct ptrace_peeksiginfo_args. + * xlat/ptrace_peeksiginfo_flags.in: New file. + +2016-05-12 Dmitry V. Levin + + ptrace: fix printing addr argument of PTRACE_GETSIGMASK et al requests. + For PTRACE_GETSIGMASK and PTRACE_SETSIGMASK requests, addr argument + contains the size of the buffer pointed to by data argument. + For PTRACE_SECCOMP_GET_FILTER request, addr argument contains + an offset counter. + + * process.c (SYS_FUNC(ptrace)): Print addr argument of + PTRACE_GETSIGMASK, PTRACE_SETSIGMASK, and PTRACE_SECCOMP_GET_FILTER + requests using %lu format. + +2016-05-12 Dmitry V. Levin + + ptrace: do not print data argument of some requests on sparc. + On sparc, kernel ignores data argument of PTRACE_GETREGS, + PTRACE_SETREGS, PTRACE_GETFPREGS, and PTRACE_SETFPREGS requests. + + * process.c (SYS_FUNC(ptrace)) [SPARC || SPARC64]: Return RVAL_DECODED + right after printing addr argument if request is one of PTRACE_GETREGS, + PTRACE_SETREGS, PTRACE_GETFPREGS, or PTRACE_SETFPREGS. + +2016-05-12 Dmitry V. Levin + + ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests + As kernel ignores addr and data arguments of PTRACE_ATTACH, + PTRACE_INTERRUPT, PTRACE_KILL, and PTRACE_LISTEN request, + we do not print them either. + + * process.c (SYS_FUNC(ptrace)): After printing pid argument, return + RVAL_DECODED if request is one of PTRACE_ATTACH, PTRACE_INTERRUPT, + PTRACE_KILL, or PTRACE_LISTEN. + +2016-05-12 Dmitry V. Levin + + ptrace: do not print arguments of PTRACE_TRACEME request. + As kernel ignores arguments of PTRACE_TRACEME request, + we do not print them either. + + * process.c (SYS_FUNC(ptrace)): If request is PTRACE_TRACEME, + return early with RVAL_DECODED. + +2016-05-12 Dmitry V. Levin + + ptrace: print request using printxval64. + As first argument of ptrace syscall has a long integer type, print + it using printxval64 because printxval takes unsigned int argument. + + * process.c (SYS_FUNC(ptrace)): Change type of "request" variable + from "long" to "unsigned long", print it using printxval64 instead + of printxval. + +2016-05-12 Dmitry V. Levin + + Do not sign-extend siginfo_t.si_syscall. + * printsiginfo.c (print_si_info): Explicitly cast si_syscall member + of siginfo_t that has type "int" to "unsigned int", to avoid sign + extension when passed to syscall_name function. + + Export print_seccomp_fprog for further use in parser of ptrace syscall. + * defs.h (print_seccomp_fprog): New prototype. + * seccomp.c (print_seccomp_fprog): Remove "static" keyword. + Move printing of struct seccomp_fprog fields ... + (print_seccomp_filter): ... here. + +2016-05-11 Fei Jie + + tests: add munlockall.test. + * tests/munlockall.c: New file. + * tests/munlockall.test: New test. + * tests/.gitignore: Add munlockall. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add munlockall.test. + + tests: add link.test. + * tests/link.c: New file. + * tests/link.test: New test. + * tests/.gitignore: Add link. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add link.test. + +2016-05-11 Dmitry V. Levin + + tests: check decoding and dumping of preadv2 and pwritev2 syscalls. + * tests/preadv2-pwritev2.c: New file. + * tests/preadv2-pwritev2.test: New test. + * tests/.gitignore: Add preadv2-pwritev2. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add preadv2-pwritev2. + + Implement decoding of preadv2 and pwritev2 syscalls. + * io.c: Include "xlat/rwf_flags.h". + (do_preadv, do_pwritev, SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): + New functions. + (SYS_FUNC(preadv)): Use do_preadv. + (SYS_FUNC(pwritev)): Use do_pwritev. + * linux/32/syscallent.h (preadv2, pwritev2): New entries. + * linux/64/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * syscall.c (dumpio): Handle SEN_preadv2 and SEN_pwritev2. + * xlat/rwf_flags.in: New file. + * NEWS: Mention parsers of new syscalls. + +2016-05-10 Dmitry V. Levin + + tests: extend test coverage of xattr family syscalls. + * tests/xattr.c: Check decoding of all xattr family syscalls. + * tests/xattr.test: Use run_strace_match_diff. + * tests/xattr.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove it. + + tests: add print_quoted_memory function to libtests. + * tests/print_quoted_string.c (print_quoted_memory): New function. + (print_quoted_string): Use it. + * tests/tests.h (print_quoted_memory): New prototype. + + Fix corner cases of xattr family syscalls decoding. + * xattr.c (print_xattr_val): Do not take insize into account, print it + as unsigned long. + Do not decode xattr values of size larger than XATTR_SIZE_MAX. + Use static buffer for fetching xattr values. + (print_xattr_list): Do not decode string when size is zero. + +2016-05-10 Dr. David Alan Gilbert + + userfaultfd: Add ioctl tests. + * tests/ioctl_uffdio.c: New file. + * tests/ioctl_uffdio.test: New test. + * tests/.gitignore: Add ioctl_uffdio. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_uffdio.test. + +2016-05-10 Dr. David Alan Gilbert + + 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. + +2016-05-10 Dmitry V. Levin + + Update AX_CODE_COVERAGE. + * m4/ax_code_coverage.m4: Update to serial 16. + * Makefile.am (CODE_COVERAGE_LCOV_OPTIONS): Remove. + (CODE_COVERAGE_GENHTML_OPTIONS): Update, add prefix. + (CODE_COVERAGE_BRANCH_COVERAGE): Set to 1. + + strace-ff.test: fix race condition. + * tests/strace-ff.test: Wait for completion of PR_SET_PTRACER command. + + tests/epoll_pwait.c: fix for x32. + * tests/epoll_pwait.c (main): Explicitly cast last syscall argument + to kernel_ulong_t. + + strace-S.test: check "-S name" + * tests/strace-S.test: Add a check for "-c -S name" output. + + Fix NULL dereference in "-S name" when syscall table has holes. + * count.c (syscall_cmp): Do not pass NULL to strcmp. + + strace-S.test: cleanup. + * tests/strace-S.test: Rewrite using sed. + +2016-05-09 Fei Jie + + tests: add strace-S.test. + * tests/strace-S.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + +2016-05-09 Dmitry V. Levin + + strace-ff.test: check that -ff does not create unexpected output files. + * tests/strace-ff.expected: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/strace-ff.test: Use it. Check that no other output files + have been created. + +2016-05-09 Fei Jie + + tests: add strace-ff.test. + * tests/strace-ff.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + +2016-05-09 Dmitry V. Levin + + strace-V.test: cleanup. + * tests/strace-V.test: Move config.h parser to a function. + Rename $OUT to $EXP, swap arguments passed to match_diff. + +2016-05-09 Fei Jie + + tests: add strace-V.test. + * tests/strace-V.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + +2016-05-09 Dmitry V. Levin + + tests: check decoding of epoll_pwait syscall. + * tests/epoll_pwait.c: New file. + * tests/epoll_pwait.test: New test. + * tests/.gitignore: Add epoll_pwait. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add epoll_pwait.test. + +2016-05-09 Dmitry V. Levin + + Assume that sys/epoll.h exists. + This header file was added in glibc-2.3.2, + so it's safe to assume its availability. + + * configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h. + * epoll.c: Include unconditionally. + Compile [HAVE_SYS_EPOLL_H] code unconditionally. + * tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H. + * tests/epoll_wait.c: Likewise. + +2016-05-08 Fabien Siron + + Factorize send_query functions. + * socketutils.c (send_query): New function. + (inet_send_query, unix_send_query): Use it. + +2016-05-08 Dmitry V. Levin + + tests: relax timings. + Allow nanosleep(2) to spend 10% more time to make the test suite + more reliable on slow systems. + + * tests/count.test: Treat 1.1 seconds as valid output. + * tests/strace-T.expected: Likewise. + * tests/strace-r.expected: Likewise. + +2016-05-07 Dmitry V. Levin + + tests/attach-f-p.c: increase timeouts. + Increase timeouts to make the test more reliable on slow systems. + + * tests/attach-f-p.c (its): Increase timeouts to 1, 2, and 3 seconds, + respectively. + +2016-05-07 Dmitry V. Levin + + Remove unused functions. + * defs.h (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr): + Remove. + * util.c (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr): + Likewise. + + v4l2.c: use print_array function. + * v4l2.c (print_v4l2_ext_control, umoven_or_printaddr_ignore_syserror): + New functions. + (print_v4l2_ext_controls): Use them via print_array. + + uid.c: use print_array function. + * uid.c (print_gid): New function. + (print_groups): Use it via print_array. + + seccomp.c: use print_array function. + * seccomp.c (decode_filter, decode_seccomp_fprog): Remove. + (print_bpf_filter): New function. + (print_seccomp_fprog): Use it via print_array. + * tests/seccomp-filter-v.c (main): Update. + + scsi.c: use print_array function. + * scsi.c (print_uchar): New function. + (print_sg_io_buffer): Use it via print_array. + + poll.c: use print_array function. + * poll.c (print_pollfd): Change for use as print_array callback. + (decode_poll_entering): Use print_array. + * tests/poll.c: Update. + * tests/poll.test: Update. + + numa.c: use print_array function. + * numa.c (print_node): New function. + (print_nodemask): Use it via print_array. + (print_page_array, print_int_array): Remove. + (print_addr): New function. + (print_status, print_int): Change for use as print_array callback. + (SYS_FUNC(move_pages)): Use print_addr, print_int, and print_status + via print_array. + * tests/move_pages.c: Update. + * tests/set_mempolicy.c: Likewise. + * tests/set_mempolicy.test: Likewise. + + mem.c: use print_array function. + * mem.c [POWERPC] (print_protmap_entry): New function. + [POWERPC] (SYS_FUNC(subpage_prot)): Use it via print_array. + + kexec.c: use print_array function. + * kexec.c (print_seg): Change for use as print_array callback. + (print_kexec_segments): Use print_array. + + ipc_sem.c: use print_array function. + * ipc_sem.c (tprint_sembuf): Rename to print_sembuf, change signature + for use as print_array callback. + (tprint_sembuf_array): Use print_array. + + io.c: use print_array function. + * io.c (print_iovec_config): New structure. + (print_iovec): New function. + (tprint_iov_upto): Use print_array. + * tests/preadv.c (main): Update. + * tests/pwritev.c (print_iovec, main): Likewise. + + epoll.c: use print_array function. + * epoll.c (print_epoll_event): Change signature for use as print_array + callback, all users updated. + (print_epoll_event_array): Remove. + (epoll_wait_common): Change to use print_array instead + of print_epoll_event_array. + + aio.c: use print_array function. + * aio.c (print_iocbp): New function. + (SYS_FUNC(io_submit)): Use it via print_array. Use widen_to_long + to process long int argument. + (print_io_event): Change to print struct io_event fetched elsewhere. + (SYS_FUNC(io_cancel)): Update use of print_io_event. + (SYS_FUNC(io_getevents)): Use print_io_event via print_array. + Use widen_to_long to print long int arguments. + * tests/aio.c (main): Check decoding of io_submit with negative "nr". + + Introduce print_array function for consistent decoding of arrays. + * defs.h (print_array): New prototype. + * util.c (print_array): New function. + +2016-05-06 Dmitry V. Levin + + Fix corner cases of ICMP_FILTER decoding. + * net.c (print_icmp_filter): Print icmp_filter for any positive length. + * tests/net-icmp_filter.c: New file. + * tests/net-icmp_filter.test: New test. + * tests/.gitignore: Add net-icmp_filter. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add net-icmp_filter.test. + +2016-05-05 Dmitry V. Levin + + xlat: do not strip "1<<" prefix from xlat strings. + * xlat/gen.sh (cond_xlat, gen_header): Do not strip "1<<" prefix + from xlat strings to fix incorrect output. + * tests/caps.awk: Update. + + Reported-by: Dr. David Alan Gilbert + +2016-05-05 Dmitry V. Levin + + tests/xstatfsx.c: fix mips o32 support. + mips o32 differs from all other 32-bit architectures by defining + __kernel_fsid_t structure as an array of long ints. + + * tests/xstatfsx.c (print_statfs): Explicitly cast elements + of PRINT_F_FSID array to unsigned int. + +2016-05-05 Dmitry V. Levin + + Mpersify VIDIOC_* ioctl parser. + * v4l2.c: Mpersify arch-specific structures. + (v4l2_ioctl): Mpersify. + * tests/ioctl_v4l2.c: New file. + * tests/ioctl_v4l2.test: New test. + * tests/.gitignore: Add ioctl_v4l2. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_v4l2.test. + +2016-05-05 Dmitry V. Levin + + Mpersify ioctl macros. + As values of some ioctl macros differ between personalities, these + personality specific ioctl macros should be properly defined for + mpersified code. Implement this by redefining personality specific + ioctl macros from ioctlent*.h for each file that includes MPERS_DEFS. + + * Makefile.am (ioctl_macros_h): New variable. + (ioctl_macros%.h): New rule. + (BUILT_SOURCES, CLEANFILES): Add $(ioctl_macros_h). + (m%_type_defs.h): #include MPERS_$(mpers_PREFIX)IOCTL_MACROS. + * defs.h [HAVE_M32_MPERS] (MPERS_m32_IOCTL_MACROS): New macro. + [HAVE_MX32_MPERS] (MPERS_mx32_IOCTL_MACROS): Likewise. + + Acked-by: Elvira Khabirova + +2016-05-05 Dmitry V. Levin + + Fix decoding of VIDIOC_* ioctls. + * v4l2.c: Fix numerous bugs in decoding of VIDIOC_* ioctls. + * tests/ioctl.c (main): Update. + +2016-05-05 Dmitry V. Levin + + nsyscalls.test: add mips o32 support. + Out-of-range syscalls looks differently on mips o32. + + * tests/nsyscalls.c (main): Handle LINUX_MIPSO32. + * tests/nsyscalls.test: Trace syscall called "syscall" on mips. + +2016-04-29 Dmitry V. Levin + + Remove initialization of big holes in syscallent.h files. + There is no need to explicitly initialize big holes after conversion + of syscallent.h files to use designated initializers. For architectures + that have some data at the end of syscallent.h this initialization of + big holes is no-op, for others it just inflates the table unnecessarily. + + * linux/arc/syscallent.h: Remove initialization of arch specific block + at the end of table. + * linux/metag/syscallent.h: Likewise. + * linux/nios2/syscallent.h: Likewise. + * linux/or1k/syscallent.h: Likewise. + * linux/tile/syscallent.h: Likewise. + * linux/tile/syscallent1.h: Likewise. + * linux/arm/syscallent.h: Remove explicit initialization of a big hole + before socket subcalls. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/mips/syscallent-compat.h: Remove explicit initialization + of big holes between different mips ABIs. + * linux/mips/syscallent-n64.h: Remove explicit initialization + of big holes before socket subcalls and between different mips ABIs. + * linux/mips/syscallent-o32.h: Likewise. + +2016-04-29 Dmitry V. Levin + + xlat: make "1< + +2016-04-29 Dmitry V. Levin + + Fix typo in XLAT_TYPE_PAIR. + * xlat.h (XLAT_TYPE_PAIR): Take "type" parameter. + + Reported-by: Dr. David Alan Gilbert + +2016-04-29 Dmitry V. Levin + + Fix decoding of move_pages syscall. + * numa.c (print_page_array, print_status, print_int, print_int_array): + New functions. + (SYS_FUNC(move_pages)): Rewrite using these functions. + * tests/move_pages.c: New file. + * tests/move_pages.test: New test. + * tests/.gitignore: Add move_pages. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add move_pages.test. + + tests: check decoding of mbind syscall. + * tests/mbind.c: New file. + * tests/mbind.test: New test. + * tests/.gitignore: Add mbind. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mbind.test. + +2016-04-29 Jeff Mahoney + + Change type of struct xlat.val to uint64_t. + Some ioctls have flags fields that are 64-bit. A 32-bit val means + these flags will never be matched or printed. + + * xlat.h: Include . + (struct xlat): Change type of val to uint64_t. + +2016-04-29 Dmitry V. Levin + + xlat: extend syntax with #val_type directive. + When #val_type directive is encountered, gen.sh starts using + XLAT_TYPE/XLAT_TYPE_PAIR macros instead of XLAT/XLAT_PAIR, + with #val_type's argument as a type. + + For example, "#val_type uint64_t" means values of type uint64_t. + + * xlat/gen.sh (gen_header, print_xlat, print_xlat_pair): + Add val_type support. + +2016-04-29 Dmitry V. Levin + + xlat/gen.sh: prepare for adding #val_type directive support. + This is essentially a no-op change that makes the following change + easier to read. + + * xlat/gen.sh (print_xlat, print_xlat_pair): New functions. + (cond_xlat, gen_header): Use them. + +2016-04-29 Dmitry V. Levin + + Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros. + * xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts + to the specified type instead of unsigned int. + (XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts + to the specified type instead of unsigned int. + +2016-04-29 Dmitry V. Levin + + xlat: generate xlat pairs using new XLAT_PAIR macro. + Before this change there were two forms of xlat entries: those that use XLAT + or XLAT_END macros, and others verbatim entries. This change converts + the latter to use new XLAT_PAIR macro. + + This is necessary for the upcoming change of xlat.val type. + + * xlat.h (XLAT_PAIR): New macro. + * xlat/gen.sh (cond_xlat, gen_header): Use it. + +2016-04-29 Dmitry V. Levin + + Explicitly cast argument of XLAT macro to unsigned int. + This is necessary for the upcoming change of xlat.val type. + + * xlat.h (XLAT): Cast the argument to unsigned int. + +2016-04-29 Dmitry V. Levin + + Change type of {s,t}print_open_modes's argument to unsigned. + As "flags" argument of sprint_open_modes and tprint_open_modes is + involved only in bit operations, change its type to unsigned. + + * defs.h.c (sprint_open_modes, tprint_open_modes): Change type + to unsigned int. + * open.c (sprint_open_modes, tprint_open_modes): Likewise. + +2016-04-28 Dmitry V. Levin + + tests/remap_file_pages.c: fix for the upcoming change of xlat.val type. + The "flags" argument of remap_file_page syscall has type "unsigned + long", so it is not correct to load most significant bits with garbage + ans assume they are going to be ignored. + + * tests/remap_file_pages.c (main): Remove artificial garbage from flags. + +2016-04-28 Dmitry V. Levin + + Introduce printflags64 function. + This is necessary for the upcoming change of xlat.val type. + + * defs.h (printflags): Rename to printflags64, change type of integer + argument to uint64_t. + (printflags): New static inline function. + * util.c (printflags): Rename to printflags64, change type of integer + argument to uint64_t. Print it using PRIx64 format. + Based on patch by Jeff Mahoney . + +2016-04-28 Dmitry V. Levin + + Introduce sprintflags64 function. + This is necessary for the upcoming change of xlat.val type. + + * defs.h (sprintflags): Rename to sprintflags64, change type of integer + argument to uint64_t. + (sprintflags): New static inline function. + * util.c (sprintflags): Rename to sprintflags64, change type of integer + argument to uint64_t. Print it using PRIx64 format. + Based on patch by Jeff Mahoney . + +2016-04-28 Dmitry V. Levin + + printxvals: change type of integer argument to uint64_t. + This is necessary for the upcoming change of xlat.val type. + All users of printxvals are already prepared for this change. + + * defs.h (printxvals): Change type of integer argument to uint64_t. + * util.c (printxvals): Likewise. Print it using PRIx64 format. + Patch by Jeff Mahoney . + +2016-04-28 Dmitry V. Levin + + xlat_search: change type of integer argument to uint64_t. + This is necessary for the upcoming change of xlat.val type. + All users of addflags are already prepared for this change. + + * defs.h (xlat_search): Change type of integer argument to uint64_t. + * util.c (xlat_search): Likewise. Pass it by pointer. + (xlat_bsearch_compare): Treat first argument as a pointer. + Patch by Jeff Mahoney . + +2016-04-28 Dmitry V. Levin + + Introduce xlookup64 function. + This is necessary for the upcoming change of xlat.val type. + + * defs.h (xlookup): Rename to xlookup64, change type of integer argument + to uint64_t. + (xlookup): New static inline function. + * util.c (xlookup): Rename to xlookup64, change type of integer + argument to uint64_t. + Based on patch by Jeff Mahoney . + +2016-04-28 Dmitry V. Levin + + addflags: change type of integer argument to uint64_t. + This is necessary for the upcoming change of xlat.val type. + All users of addflags are already prepared for this change. + + * defs.h (addflags): Change type of integer argument to uint64_t. + * util.c (addflags): Likewise. Print it using PRIx64 format. + Based on patch by Jeff Mahoney . + +2016-04-28 Dmitry V. Levin + + Introduce printxval64 wrapper. + This is necessary for the upcoming change of xlat.val type. + + * defs.h (printxval64): New static inline function. + +2016-04-28 Dmitry V. Levin + + Turn printxval macro into a static inline function. + This is necessary for the upcoming change of xlat.val type. + + * defs.h (printxval): Change to static inline function. + +2016-04-28 Dmitry V. Levin + + tests: check decoding of migrate_pages syscall. + * tests/migrate_pages.c: New file. + * tests/migrate_pages.test: New test. + * tests/.gitignore: Add migrate_pages. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add migrate_pages.test. + + Fix decoding of migrate_pages syscall. + * numa.c (SYS_FUNC(migrate_pages)): Print syscall arguments + in the right order. + + tests: check decoding of set_mempolicy syscall. + * tests/set_mempolicy.c: New file. + * tests/set_mempolicy.test: New test. + * tests/.gitignore: Add set_mempolicy. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add set_mempolicy.test. + + tests: check decoding of get_mempolicy syscall. + * tests/get_mempolicy.c: New file. + * tests/get_mempolicy.test: New test. + * tests/.gitignore: Add get_mempolicy. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add get_mempolicy.test. + + numa: fix decoding of nodemask arrays. + * numa.c (get_nodes): Rewrite an rename to print_nodemask. + All callers updated. + (SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), SYS_FUNC(get_mempolicy)): + Print a delimiter before nodemask argument. + +2016-04-27 Dmitry V. Levin + + Fix decoding of policy argument of get_mempolicy syscall. + * numa.c (SYS_FUNC(get_mempolicy)): Print policy argument in square + brackets to indicate indirect access. + + Fix decoding of pid_t argument of migrate_pages syscall. + * numa.c (SYS_FUNC(migrate_pages)): Print pid_t syscall + argument using %d format. + + tests: add printxval function to libtests. + * tests/tests.h (printxval): New prototype. + * tests/printxval.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + + tests: check decoding of remap_file_pages syscall. + * tests/remap_file_pages.c: New file. + * tests/remap_file_pages.test: New test. + * tests/.gitignore: Add remap_file_pages. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add remap_file_pages.test. + +2016-04-27 Fei Jie + + tests: add pause.test. + * tests/pause.c: New file. + * tests/pause.test: New test. + * tests/.gitignore: Add pause. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add pause.test. + + tests: add kill.test. + * tests/kill.c: New file. + * tests/kill.test: New test. + * tests/.gitignore: Add kill. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add kill.test. + +2016-04-27 Dmitry V. Levin + + Fix decoding of pid_t arguments of kill and tgkill syscalls. + * signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Print pid_t syscall + arguments using %d format. + +2016-04-27 Fei Jie + + tests: add mlock.test. + * tests/mlock.c: New file. + * tests/mlock.test: New test. + * tests/.gitignore: Add mlock. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mlock.test. + +2016-04-27 Dmitry V. Levin + + Move parsers of NUMA related syscalls to numa.c. + * mem.c (get_nodes, SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), + SYS_FUNC(get_mempolicy), SYS_FUNC(migrate_pages), SYS_FUNC(move_pages)): + Move ... + * numa.c: ... here. + * Makefile.am (strace_SOURCES): Add numa.c + + tests/umovestr3.c: robustify against os specific issues. + * tests/umovestr3.c (main): Create extra gap before unreadable page. + + tests: extend test coverage of umovestr short read condition. + * tests/umovestr3.c: New file. + * tests/umovestr3.test: New test. + * tests/.gitignore: Add umovestr3. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add umovestr3.test. + + tests: check decoding of out-of-range syscalls. + * tests/nsyscalls.c: New file. + * tests/nsyscalls.test: New test. + * tests/.gitignore: Add nsyscalls. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add nsyscalls.test. + +2016-04-26 Dmitry V. Levin + + Fix decoding of 3rd argument of getdents/getdents64 syscalls. + * dirent.c (SYS_FUNC(getdents)): Always print 3rd syscall argument + as unsigned int. + * dirent64.c (SYS_FUNC(getdents64)): Likewise. + * tests/getdents.c (main): Check it. + * tests/getdents64.c (main): Likewise. + + Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument. + * reboot.c (SYS_FUNC(reboot)): Cast numeric arguments to unsigned int. + +2016-04-26 Dmitry V. Levin + + .travis.yml: raise sleep delay. + Previous sleep delay value seems to be not enough nowadays. + + .travis.yml (SLEEP_A_BIT): Raise sleep delay. + +2016-04-26 Dmitry V. Levin + + Move definitions of MPOL_* constants to xlat files. + * mem.c (MPOL_DEFAULT, MPOL_PREFERRED, MPOL_BIND, MPOL_INTERLEAVE): + Move to xlat/policies.in. + (MPOL_F_NODE, MPOL_F_ADDR): Move to xlat/mempolicyflags.in. + (MPOL_MF_STRICT, MPOL_MF_MOVE, MPOL_MF_MOVE_ALL): Move + to xlat/mbindflags.in. + + tests: check decoding of renameat2 syscall. + * tests/renameat2.c: New file. + * tests/renameat2.test: New test. + * tests/.gitignore: Add renameat2. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add renameat2.test. + + Add default values for RENAME_* constants. + * xlat/rename_flags.in: Add default values. + + tests: check decoding of utimes syscall. + * tests/utimes.c: New file. + * tests/utimes.test: New test. + * tests/.gitignore: Add utimes. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add utimes.test. + + tests: check decoding of futimesat syscall. + * tests/futimesat.c: New file. + * tests/futimesat.test: New test. + * tests/.gitignore: Add futimesat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add futimesat.test. + + tests: extend test coverage of mknod syscall. + * mknod.c (main): Check more corner cases of mode_t parser. + * mknod.test: Update. + +2016-04-26 Fei Jie + + tests: add sched_yield.test. + * tests/sched_yield.c: New file. + * tests/sched_yield.test: New test. + * tests/.gitignore: Add sched_yield. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add sched_yield.test. + + tests: add sync.test. + * tests/sync.c: New file. + * tests/sync.test: New test. + * tests/.gitignore: Add sync. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add sync.test. + + tests: add mknodat.test. + * tests/mknodat.c: New file. + * tests/mknodat.test: New test. + * tests/.gitignore: Add mknodat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mknodat.test. + + tests: add unlink.test. + * tests/unlink.c: New file. + * tests/unlink.test: New test. + * tests/.gitignore: Add unlink. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add unlink.test. + + tests: add reboot.test. + * tests/reboot.c: New file. + * tests/reboot.test: New test. + * tests/.gitignore: Add reboot. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add reboot.test. + +2016-04-26 Dmitry V. Levin + + Fix decoding of statfs family syscalls. + Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls + by rewriting them using mpers infrastructure. + + * fetch_struct_statfs.c: New file. + * fstatfs.c: Likewise. + * fstatfs64.c: Likewise. + * print_statfs.c: Likewise. + * statfs.h: Likewise. + * statfs64.c: Likewise. + * statfs.c: Remove everything except SYS_FUNC(statfs). + * configure.ac: Remove the check for struct statfs64 in . + Add checks for struct statfs and struct statfs64 in . + Add checks for f_frsize and f_flags members of these structures. + * defs.h (struct strace_statfs): New forward declaration. + (print_struct_statfs, print_struct_statfs64): New prototypes. + * Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c, + statfs.c, and statfs64.c. + (strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c, + and statfs.h. + * NEWS: Mention this fix. + * tests/fstatfs.c: New file. + * tests/fstatfs64.c: Likewise. + * tests/statfs64.c: Likewise. + * tests/xstatfs.c: Likewise. + * tests/xstatfs64.c: Likewise. + * tests/xstatfsx.c: Likewise. + * tests/fstatfs.test: New test. + * tests/fstatfs64.test: Likewise. + * tests/statfs64.test: Likewise. + * tests/statfs.c: Rewrite using xstatfs.c. + * tests/statfs.test: Update. + * tests/.gitignore: Add fstatfs, fstatfs64, and statfs64. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fstatfs.test, fstatfs64.test, and statfs64.test. + (EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c. + +2016-04-26 Dmitry V. Levin + + tests: add printflags function to libtests. + * tests/printflags.c: New file. + * tests/tests.h (printflags): New prototype. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + +2016-04-26 Dmitry V. Levin + + Move definition of struct xlat to a separate header file. + Define struct xlat in a separate file so that it could be used later by + tests without inclusion of defs.h header file. + + * defs.h (struct xlat, XLAT, XLAT_END): Move ... + * xlat.h: ... here. + * Makefile.am (strace_SOURCES): Add xlat.h. + +2016-04-25 Dmitry V. Levin + + alpha: decode osf_statfs64 and osf_fstatfs64 syscalls. + * linux/alpha/syscallent.h (osf_statfs64, osf_fstatfs64): Set nargs + and handler. + +2016-04-25 Dmitry V. Levin + + alpha: fix decoding of osf_statfs and osf_fstatfs syscalls. + Do not attempt to print struct osf_statfs as if it was the same as + struct statfs. Since struct osf_statfs has never been decoded properly, + it is probably too late to implement a decoder, so let's just print the + pointer. + + * statfs.c [ALPHA] (SYS_FUNC(osf_statfs), SYS_FUNC(osf_fstatfs)): Move ... + * alpha.c: ... here. Replace printstatfs with printaddr. + +2016-04-25 Dmitry V. Levin + + statfs: print f_flags field only when ST_VALID flag is set. + * statfs.c (print_statfs_flags): New function. + (printstatfs, printstatfs64, printcompat_statfs64): Use it. + * xlat/statfs_flags.in (ST_VALID): Move to the head of the list. + * tests/statfs.expected: Update. + +2016-04-25 Fei Jie + + tests: add symlink.test. + * tests/symlink.c: New file. + * tests/symlink.test: New test. + * tests/.gitignore: Add symlink. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add symlink.test. + + tests: add rmdir.test. + * tests/rmdir.c: New file. + * tests/rmdir.test: New test. + * tests/.gitignore: Add rmdir. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add rmdir.test. + + tests: add setdomainname.test. + * tests/setdomainname.c: New file. + * tests/setdomainname.test: New test. + * tests/.gitignore: Add setdomainname. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setdomainname.test. + + tests: add sched_rr_get_interval.test. + * tests/sched_rr_get_interval.c: New file. + * tests/sched_rr_get_interval.test: New test. + * tests/.gitignore: Add sched_rr_get_interval. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add sched_rr_get_interval.test. + +2016-04-25 Dmitry V. Levin + + statfs: decode f_flags field of struct statfs. + * xlat/statfs_flags.in: New file. + * statfs.c: Include "xlat/statfs_flags.h". + (printstatfs) [_STATFS_F_FLAGS]: Print statbuf.f_flags as flags. + (printstatfs64) [_STATFS_F_FLAGS]: Likewise. + (printcompat_statfs64): Likewise. + * tests/statfs.expected: Update. + +2016-04-25 Zev Weiss + + statfs: don't quote f_type macro names. + * statfs.c (sprintfstype): Don't add double-quotes to fs magic macros. + * tests/statfs.expected: Remove double-quotes. + +2016-04-25 Dmitry V. Levin + + tests/shmxt.c: robustify against arch specific issues. + Do not treat failed shmat(SHM_RND) as a test failure. + This change partially reverts commit + bea707377d2ee3e1950bfa43537ef928163a5fa6. + + * tests/shmxt.c (main): Use SHM_RND in the second shmat call, + do not treat its potential error as a test failure. + +2016-04-23 Dmitry V. Levin + + Rename PRI__s64 to PRI__d64. + As PRI__*64 macros mirror PRI*64 macros from inttypes.h, follow the + principle of least astonishment and name these macros the same way. + + * defs.h (PRI__s64): Rename to PRI__d64. + +2016-04-23 Dmitry V. Levin + + Fix old_mmap output when mmap arguments are unfetchable. + * mem.c (SYS_FUNC(old_mmap)): Use umove_or_printaddr instead of umoven + to fetch mmap arguments, return RVAL_DECODED when umove_or_printaddr + fails. + * tests/old_mmap.c (main): Check it. + +2016-04-22 Dmitry V. Levin + + aarch64: fix old_mmap output for arm personality. + * mem.c (SYS_FUNC(old_mmap)) [AARCH64]: Fetch mmap arguments + as 32-bit integers. + + Define old_mmap parser only on architectures that use it. + * mem.c (SYS_FUNC(old_mmap)): Define only on AARCH64, ARM, I386, X86_64, + X32, M68K, S390, and S390X. + +2016-04-22 Dmitry V. Levin + + tests: extend test coverage of mmap syscall. + Check decoding of "old mmap" edition of mmap syscall + on those architectures that define it. + + * tests/old_mmap.c: New file. + * tests/old_mmap.test: New test. + * tests/.gitignore: Add old_mmap. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add old_mmap.test. + +2016-04-22 Dmitry V. Levin + + tests: extend test coverage of mincore syscall. + * tests/mincore.c (print_mincore): New function. + (test_mincore): Use it. Check mincore with invalid vec address. + Check mincore with length argument not a multiple of the page size. + (main): Check with DEFAULT_STRLEN pages. + +2016-04-22 Dmitry V. Levin + + Move parsers of sync_file_range and sync_file_range2 syscalls to libstrace + For each given architecture only one of these two syscalls has a + syscallent entry. When each parser is placed into a separate file, + moving to libstrace ensures that only one of them that is need + is linked into strace executable. + + * sync_file_range.c (SYS_FUNC(sync_file_range2)): Move ... + * sync_file_range2.c: ... here. + * Makefile.am (strace_SOURCES): Move sync_file_range.c ... + (libstrace_a_SOURCES): ... here. Add sync_file_range2.c. + (strace_SOURCES_c): Add filtered libstrace_a_SOURCES. + +2016-04-22 Dmitry V. Levin + + tests: check decoding of clock_adjtime syscall. + * tests/clock_adjtime.c: New file. + * tests/clock_adjtime.test: New test. + * tests/.gitignore: Add clock_adjtime. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add clock_adjtime.test. + +2016-04-21 Dmitry V. Levin + + tests: do not include unnecessarily. + Automatically change tests/*.c files using the following script: + + for f in tests/*.c; do + grep -q '\/d' "$f" + done + +2016-04-21 Dmitry V. Levin + + tests: do not include unnecessarily. + Automatically change tests/*.c files using the following script: + + for f in tests/*.c; do + grep -Fv errno.h "$f" | + grep -Ewq '(si_)?errno|SOCK_FILTER_DENY_SYSCALL' || + sed -i '/# *include */d' "$f" + done + +2016-04-21 Dmitry V. Levin + + tests/xetpriority.c: print syscall() result using %ld format. + + tests/xetpgid.c: print syscall() result using %ld format. + + tests/xchownx.c: use errno2name. + + tests/userfaultfd.c: stop using assert. + + tests/unlinkat.c: print syscall() result using %ld format. + + tests/umount.c: use errno2name. + + tests/truncate64.c: cleanup. + * tests/truncate64.c (main): Use errno2name, stop using assert. + + tests/truncate.c: cleanup. + * tests/truncate.c (main): Use errno2name, stop using assert. + + tests/tee.c: stop using assert. + + tests/syslog.c: use errno2name. + + tests/sync_file_range2.c: stop using assert. + + tests/sync_file_range.c: stop using assert. + + tests/symlinkat.c: cleanup. + + tests/swap.c: cleanup. + * tests/swap.c (error_msg): Remove. + (main): Use errno2name. + + tests/splice.c: stop using assert. + + tests/setugid.c: cleanup. + + tests/sethostname.c: use errno2name. + + tests/setgroups.c: use errno2name. + * tests/setgroups.c (errno2str): Remove. + (main): Use errno2name. + + tests/seccomp-strict.c: cleanup. + * tests/seccomp-strict.c (main): Use errno2name, stop using assert. + + tests/seccomp-filter.c: cleanup. + * tests/seccomp-filter.c (main): Use errno2name, stop using assert. + + tests/sched_xetscheduler.c: print syscall() result using %ld format. + + tests/sched_xetparam.c: print syscall() result using %ld format. + + tests/renameat.c: print syscall() result using %ld format. + + tests/rename.c: print syscall() result using %ld format. + + tests/readv.c: cleanup. + + tests/pwritev.c: use errno2name. + + tests/preadv-pwritev.c: cleanup. + + tests/prctl-seccomp-strict.c: cleanup. + * tests/prctl-seccomp-strict.c (main): Use errno2name, + stop using assert. + + tests/openat.c: use errno2name. + + tests/open.c: use errno2name. + + tests/mlockall.c: cleanup. + + tests/mlock2.c: stop using assert. + + tests/mknod.c: print syscall() result using %ld format. + + tests/mkdirat.c: print syscall() result using %ld format. + + tests/lseek.c: cleanup. + * tests/lseek.c (main): Use errno2name, stop using assert. + + tests/llseek.c: cleanup. + * tests/llseek.c (main): Use errno2name, stop using assert. + + tests/linkat.c: print syscall() result using %ld format. + + tests/iopl.c: use errno2name. + + tests/ioperm.c: use errno2name. + + tests/getgroups.c: use errno2name. + * tests/getgroups.c (errno2str): Remove. + (main): Use errno2name. + + tests/ftruncate64.c: cleanup. + * tests/ftruncate64.c (main): Use errno2name, stop using assert. + + tests/ftruncate.c: cleanup. + * tests/ftruncate.c (main): Use errno2name, stop using assert. + + tests/fsync.c: print syscall() result using %ld format. + + tests/flock.c: print syscall() result using %ld format. + + tests/file_handle.c: use errno2name. + + tests/fdatasync.c: print syscall() result using %ld format. + + tests/fchownat.c: use errno2name. + + tests/fchmodat.c: use errno2name. + + tests/fchmod.c: use errno2name. + + tests/faccessat.c: print syscall() result using %ld format. + + tests/epoll_wait.c: print syscall() result using %ld format. + + tests/epoll_ctl.c: print syscall() result using %ld format. + + tests/epoll_create1.c: cleanup. + * tests/epoll_create1.c (main): Use errno2name, stop using assert. + + tests/epoll_create.c: print syscall() result using %ld format. + + tests/dup3.c: print syscall() result using %ld format. + + tests/dup2.c: print syscall() result using %ld format. + + tests/dup.c: cleanup. + + tests/creat.c: stop using sys/stat.h. + + tests/copy_file_range.c: stop using assert. + + tests/chroot.c: use errno2name. + + tests/aio.c: use errno2name. + + tests: cleanup acct.test. + * tests/acct.c (main): Use errno2name, stop using assert, + change sample file name. + * tests/acct.test: Update. + + tests: use errno2name() + Automatically change tests/*.c files using the following sed regexp: + sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g' + + tests/dup.c: include "tests.h" + This is going to be necessary for the following commit. + +2016-04-21 Fei Jie + + tests: add getpgrp.test. + * tests/getpgrp.c: New file. + * tests/getpgrp.test: New test. + * tests/.gitignore: Add getpgrp. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getpgrp.test. + + tests: add access.test. + * tests/access.c: New file. + * tests/access.test: New test. + * tests/.gitignore: Add access. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add access.test. + + tests: add fchdir.test. + * tests/fchdir.c: New file. + * tests/fchdir.test: New test. + * tests/.gitignore: Add fchdir. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fchdir.test. + + tests: add mkdir.test. + * tests/mkdir.c: New file. + * tests/mkdir.test: New test. + * tests/.gitignore: Add mkdir. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mkdir.test. + + tests: add getsid.test. + * tests/getsid.c: New file. + * tests/getsid.test: New test. + * tests/.gitignore: Add getsid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getsid.test. + +2016-04-21 Dmitry V. Levin + + tests: add errno2name function to libtests. + Add a simple translator of errno to its name, so one could + simply use errno2name() instead of complex expressions like + errno == EINVAL ? "EINVAL" : "EFAULT". + + * tests.h (errno2name): New prototype. + * errno2name.c: New file. + * Makefile.am (libtests_a_SOURCES): Add it. + +2016-04-20 Dmitry V. Levin + + hppa: rename ECANCELLED to ECANCELED. + hppa seems to be the only architecture that defines ECANCELLED synonym + for ECANCELED constant, other architectures just define ECANCELED. + Change the way how this constant is printed on hppa to be in line + with other architectures. + + * linux/hppa/errnoent.h [253]: Rename ECANCELLED to ECANCELED. + +2016-04-20 Dmitry V. Levin + + Remove parser of unimplemented timerfd syscall. + timerfd syscall was introduced in v2.6.22-rc1, but in v2.6.25-rc1 + it was replaced by timerfd_* syscall family. + + * linux/avr32/syscallent.h (timerfd): Fix nargs. + * linux/dummy.h (sys_timerfd): Add stub alias. + * time.c (SYS_FUNC(timerfd)): Remove. + +2016-04-20 Dmitry V. Levin + + tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test + If kernel implementation of strict seccomp mode is buggy, test programs + will be killed by SIGKILL. This is a known problem at least on + x32 and mips. Skip affected tests if this is the case. + + This change partially revert commit 9c1a72cd3f3d52d573876ce474b620a5f141fb1b. + + * tests/seccomp-strict.c (main): Remove workaround for x32. + * tests/prctl-seccomp-strict.c: Likewise. + * tests/seccomp-strict.test: Skip the test if the test program + has been killed by SIGKILL. + * tests/prctl-seccomp-strict.test: Likewise. + +2016-04-20 Dmitry V. Levin + + tests/shmxt.c: do not use SHM_RND, it is unreliable. + * tests/shmxt.c (main): Do not set SHM_RND flag. + + tests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long) + * tests/rt_sigsuspend.c (iterate): Do not assume that size will be less + than sizeof(long) on the second iteration. + + prctl-seccomp-strict.test: robustify against unrelated prctl invocations + * tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls. + +2016-04-20 Dmitry V. Levin + + tests: adjust rt_sigpending to older kernels. + With linux kernels older than v3.9-rc1, compat rt_sigpending syscall + could fail with EFAULT in cases where on later kernels it succeeds. + Adjust the test to handle both cases properly. + + * tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending + failed with EFAULT. + +2016-04-20 Dmitry V. Levin + + tests: adjust readv/writev and preadv/pwritev tests to older kernels. + With linux kernels older than v3.16-rc1, iovec based compat syscalls may + return EINVAL in some cases where on later kernels they return EFAULT. + Adjust tests to handle both cases properly. + + * tests/preadv-pwritev.c: Include . + (main): Print either "EINVAL" or "EFAULT" depending on errno. + * tests/pwritev.c: Likewise. + * tests/readv.c: Likewise. + +2016-04-20 Dmitry V. Levin + + tests: remove obsolete non-strict uid tests. + Recently added strict tests for uid/gid related syscalls + made old uid tests obsolete. + + * tests/uid.awk: Remove. + * tests/uid.c: Remove. + * tests/uid.test: Remove. + * tests/uid16.c: Remove. + * tests/uid16.test: Remove. + * tests/uid32.c: Remove. + * tests/uid32.test: Remove. + * tests/.gitignore: Remove uid, uid16, and uid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Remove uid.test, uid16.test, and uid32.test. + (EXTRA_DIST): Remove uid.awk. + +2016-04-20 Dmitry V. Levin + + tests: extend test coverage of getuid/getgid family syscalls. + Add strict tests for getuid, getuid32, getgid, getgid32, geteuid, + geteuid32, getegid, and getegid32 syscalls. + + * tests/getegid.c: New file. + * tests/getegid.test: New test. + * tests/getegid32.c: New file. + * tests/getegid32.test: New test. + * tests/geteuid.c: New file. + * tests/geteuid.test: New test. + * tests/geteuid32.c: New file. + * tests/geteuid32.test: New test. + * tests/getgid.c: New file. + * tests/getgid.test: New test. + * tests/getgid32.c: New file. + * tests/getgid32.test: New test. + * tests/getuid.c: New file. + * tests/getuid.test: New test. + * tests/getuid32.c: New file. + * tests/getuid32.test: New test. + * tests/.gitignore: Add getuid, getuid32, getgid, getgid32, geteuid, + * geteuid32, getegid, and getegid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getegid.test, getegid32.test, geteuid.test, + geteuid32.test, getgid.test, getgid32.test, getuid.test, + and getuid32.test. + +2016-04-20 Dmitry V. Levin + + tests: extend test coverage of getresgid32 syscall. + * tests/getresgid32.c: New file. + * tests/getresgid32.test: New test. + * tests/.gitignore: Add getresgid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getresgid32.test. + + tests: extend test coverage of getresgid syscall. + * tests/getresgid.c: New file. + * tests/getresgid.test: New test. + * tests/.gitignore: Add getresgid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getresgid.test. + + tests: extend test coverage of getresuid32 syscall. + * tests/getresuid32.c: New file. + * tests/getresuid32.test: New test. + * tests/.gitignore: Add getresuid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getresuid32.test. + + tests: extend test coverage of getresuid syscall. + * tests/getresugid.c: New file. + * tests/getresuid.c: New file. + * tests/getresuid.test: New test. + * tests/.gitignore: Add getresuid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getresuid.test. + (EXTRA_DIST): Add getresugid.c. + +2016-04-20 Fei Jie + + tests: add symlinkat.test. + * tests/symlinkat.c: New file. + * tests/symlinkat.test: New test. + * tests/.gitignore: Add symlinkat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add symlinkat.test. + + tests: add iopl.test. + * tests/iopl.c: New file. + * tests/iopl.test: New test. + * tests/.gitignore: Add iopl. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add iopl.test. + +2016-04-20 Dmitry V. Levin + + mips o32, powerpc, powerpc64: fix decoding of iopl syscall. + * linux/mips/syscallent-o32.h (iopl): Fix nargs. + * linux/powerpc/syscallent.h (iopl): Fix nargs and sys_func. + * linux/powerpc64/syscallent.h (iopl): Likewise. + +2016-04-20 Fei Jie + + tests: add ioperm.test. + * tests/ioperm.c: New file. + * tests/ioperm.test: New test. + * tests/.gitignore: Add ioperm. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioperm.test. + +2016-04-20 Dmitry V. Levin + + Fix corner cases of getgroups and setgroups syscall decoders. + * uid.c (print_groups): New function. + (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it. + Print first syscall argument using %u format. + * tests/getgroups.c: New file. + * tests/getgroups.test: New test. + * tests/getgroups32.c: New file. + * tests/getgroups32.test: New test. + * tests/setgroups.c: New file. + * tests/setgroups.test: New test. + * tests/setgroups32.c: New file. + * tests/setgroups32.test: New test. + * tests/.gitignore: Add getgroups, getgroups32, setgroups, + and setgroups32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add getgroups.test, getgroups32.test, + setgroups.test, and setgroups32.test. + + Cleanup setfsuid syscall decoder. + * uid.c (SYS_FUNC(setfsuid)): Remove redundant check. + + tests: check decoding of setfsgid32 syscall. + * tests/setfsgid32.c: New file. + * tests/setfsgid32.test: New test. + * tests/.gitignore: Add setfsgid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setfsgid32.test. + + tests: check decoding of setfsgid syscall. + * tests/setfsugid.c: New file. + * tests/setfsgid.c: New file. + * tests/setfsgid.test: New test. + * tests/.gitignore: Add setfsgid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setfsgid.test. + (EXTRA_DIST): Add setfsugid.c. + + tests: check decoding of setfsuid32 syscall. + * tests/setfsuid32.c: New file. + * tests/setfsuid32.test: New test. + * tests/.gitignore: Add setfsuid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setfsuid32.test. + + tests: check decoding of setfsuid syscall. + * tests/setfsugid.c: New file. + * tests/setfsuid.c: New file. + * tests/setfsuid.test: New test. + * tests/.gitignore: Add setfsuid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setfsuid.test. + (EXTRA_DIST): Add setfsugid.c. + + tests: extend test coverage of setresgid32 syscall. + * tests/setresgid32.c: New file. + * tests/setresgid32.test: New test. + * tests/.gitignore: Add setresgid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setresgid32.test. + + tests: extend test coverage of setresgid syscall. + * tests/setresgid.c: New file. + * tests/setresgid.test: New test. + * tests/.gitignore: Add setresgid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setresgid.test. + + tests: extend test coverage of setresuid32 syscall. + * tests/setresuid32.c: New file. + * tests/setresuid32.test: New test. + * tests/.gitignore: Add setresuid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setresuid32.test. + + tests: extend test coverage of setresuid syscall. + * tests/setresugid.c: New file. + * tests/setresuid.c: New file. + * tests/setresuid.test: New test. + * tests/.gitignore: Add setresuid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setresuid.test. + (EXTRA_DIST): Add setresugid.c. + + tests: extend test coverage of setregid32 syscall. + * tests/setregid32.c: New file. + * tests/setregid32.test: New test. + * tests/.gitignore: Add setregid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setregid32.test. + + tests: extend test coverage of setregid syscall. + * tests/setregid.c: New file. + * tests/setregid.test: New test. + * tests/.gitignore: Add setregid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setregid.test. + + tests: extend test coverage of setreuid32 syscall. + * tests/setreuid32.c: New file. + * tests/setreuid32.test: New test. + * tests/.gitignore: Add setreuid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setreuid32.test. + + tests: extend test coverage of setreuid syscall. + * tests/setreugid.c: New file. + * tests/setreuid.c: New file. + * tests/setreuid.test: New test. + * tests/.gitignore: Add setreuid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setreuid.test. + (EXTRA_DIST): Add setreugid.c. + + tests: extend test coverage of setgid32 syscall. + * tests/setgid32.c: New file. + * tests/setgid32.test: New test. + * tests/.gitignore: Add setgid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setgid32.test. + + tests: extend test coverage of setgid syscall. + * tests/setgid.c: New file. + * tests/setgid.test: New test. + * tests/.gitignore: Add setgid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setgid.test. + + tests: extend test coverage of setuid32 syscall. + * tests/setuid32.c: New file. + * tests/setuid32.test: New test. + * tests/.gitignore: Add setuid32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setuid32.test. + + tests: extend test coverage of setuid syscall. + * tests/setugid.c: New file. + * tests/setuid.c: New file. + * tests/setuid.test: New test. + * tests/.gitignore: Add setuid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add setuid.test. + (EXTRA_DIST): Add setugid.c. + +2016-04-20 Fei Jie + + tests: add shmxt.test. + * tests/shmxt.c: New file. + * tests/shmxt.test: New test. + * tests/.gitignore: Add shmxt. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add shmxt.test. + +2016-04-20 Dmitry V. Levin + + alpha: fix decoding of shmat syscall. + On alpha, shmat syscall is known as osf_shmat. + + * linux/alpha/syscallent.h (osf_shmat): Fix sys_flags and sys_func. + +2016-04-20 Fei Jie + + tests: add semop.test. + * tests/semop.c: New file. + * tests/semop.test: New test. + * tests/.gitignore: Add semop. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add semop.test. + +2016-04-18 Dmitry V. Levin + + prctl-seccomp-filter-v.test: robustify against unrelated prctl invocations + * tests/prctl-seccomp-filter-v.test: Filter out PR_GET_* prctl calls. + + Reported-by: Steve McIntyre + +2016-04-18 Dmitry V. Levin + + tests/pselect6.c: fix potential output mismatch. + * tests/pselect6.c (main): In the last case of printing pselect6 + syscall, print the last argument the same way as in other cases. + + Reported-by: Steve McIntyre + +2016-04-18 Dmitry V. Levin + + tests: check decoding of fchown32 syscall. + * tests/fchown32.c: New file. + * tests/fchown32.test: New test. + * tests/.gitignore: Add fchown32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fchown32.test. + + tests: check decoding of fchown syscall. + * tests/fchown.c: New file. + * tests/fchown.test: New test. + * tests/.gitignore: Add fchown. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fchown.test. + + tests: check decoding of lchown32 syscall. + * tests/lchown32.c: New file. + * tests/lchown32.test: New test. + * tests/.gitignore: Add lchown32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add lchown32.test. + + tests: check decoding of lchown syscall. + * tests/lchown.c: New file. + * tests/lchown.test: New test. + * tests/.gitignore: Add lchown. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add lchown.test. + + tests: check decoding of chown32 syscall. + * tests/chown32.c: New file. + * tests/chown32.test: New test. + * tests/.gitignore: Add chown32. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add chown32.test. + + tests: check decoding of chown syscall. + * tests/chown.c: New file. + * tests/chown.test: New test. + * tests/xchownx.c: New file. + * tests/.gitignore: Add chown. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add chown.test. + (EXTRA_DIST): Add xchownx.c. + + Fix decoding of 16-bit uid_t/git_t. + * uid.c (printuid): Always cast value to uid_t. + +2016-04-18 Dmitry V. Levin + + tests: move kernel uid overflow check to libtests. + This code used in two different places, so move it to the library. + + * tests/overflowuid.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/tests.h (check_overflowuid, check_overflowgid): New prototypes. + * tests/uid.c (main): Use check_overflowuid. + * tests/uid16.c (main): Likewise. + +2016-04-12 Dmitry V. Levin + + tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32. + As x86_64 kernel does not support x32 syscall numbers in + SECCOMP_MODE_STRICT, skip affected tests on x32. + + * tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out + using error_msg_and_skip. + * tests/prctl-seccomp-strict.c: Likewise. + +2016-04-12 Dmitry V. Levin + + tests: add seccomp-filter.test. + * tests/seccomp-filter.c: New file. + * tests/seccomp-filter.test: New test. + * tests/.gitignore: Add seccomp-filter. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add seccomp-filter.test. + +2016-04-12 Dmitry V. Levin + + seccomp: fix decoding of sock_fprog and sock_filter structures. + Always print struct sock_fprog.len. + Fix printing of unfetchable elements in sock_filter array. + Fix printing of large sock_filter arrays. + + * seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and + print_seccomp_fprog. + (print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog. + * tests/prctl-seccomp-filter-v.c (main): Update. + * tests/seccomp-filter-v.c: New file. + * tests/seccomp-filter-v.test: New test. + * tests/.gitignore: Add seccomp-filter-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add seccomp-filter-v.test. + +2016-04-11 Dmitry V. Levin + + seccomp: print SECCOMP_* and BPF_* constants in a more compact way. + * seccomp.c (decode_bpf_code, decode_bpf_stmt): Replace " | " with "|". + * tests/prctl-seccomp-filter-v.c: Update. + + tests: rename seccomp.test to prctl-seccomp-filter-v.test. + * tests/.gitignore: Replace seccomp with prctl-seccomp-filter-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Replace seccomp.test with prctl-seccomp-filter-v.test. + * tests/seccomp.c: Rename to tests/prctl-seccomp-filter-v.c. + * tests/seccomp.test: Rename to tests/prctl-seccomp-filter-v.test. + + tests: add seccomp-strict.test. + * tests/seccomp-strict.c: New file. + * tests/seccomp-strict.test: New test. + * tests/.gitignore: Add seccomp-strict. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add seccomp-strict.test. + + tests: add prctl-seccomp-strict.test. + * tests/prctl-seccomp-strict.c: New file. + * tests/prctl-seccomp-strict.test: New test. + * tests/.gitignore: Add prctl-seccomp-strict. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add prctl-seccomp-strict.test. + + tests: bring lists back to the sorted order. + +2016-04-10 Dmitry V. Levin + + tests/epoll_create1.c: extend for the case of ENOSYS. + * epoll_create1.c: Make the test work in case of epoll_create1 + returning ENOSYS. + + tests/epoll_ctl.c: extend epoll_ctl coverage. + * tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding. Check + decoding of long int descriptors and NULL struct epoll_event pointer. + +2016-04-09 Dmitry V. Levin + + tests: add mlockall.test. + * tests/mlockall.c: New file. + * tests/mlockall.test: New test. + * tests/.gitignore: Add mlockall. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mlockall.test. + +2016-04-08 Fei Jie + + tests: add epoll_wait.test. + * tests/epoll_wait.c: New file. + * tests/epoll_wait.test: New test. + * tests/.gitignore: Add epoll_wait. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add epoll_wait.test. + + tests: add epoll_ctl.test. + * tests/epoll_ctl.c: New file. + * tests/epoll_ctl.test: New test. + * tests/.gitignore: Add epoll_ctl. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add epoll_ctl.test. + + tests: add epoll_create.test. + * tests/epoll_create.c: New file. + * tests/epoll_create.test: New test. + * tests/.gitignore: Add epoll_create. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add epoll_create.test. + +2016-04-08 Dmitry V. Levin + + tests/pread64-pwrite64.c: minor cleanup. + * tests/pread64-pwrite64.c: Do not include . + +2016-04-07 Dmitry V. Levin + + Fix decoding of swapon flags. + * swapon.c (SYS_FUNC(swapon)): Print priority regardless + of SWAP_FLAG_PREFER flag being set. + * tests/swap.c (error_msg): Handle EINVAL. + (main): Check decoding of swapon flags. + + tests/unlinkat.c: check AT_* decoding. + * tests/unlinkat.c (main): Check decoding of AT_* constants. + + tests/linkat.c: check AT_* decoding. + * tests/linkat.c (main): Check decoding of AT_* constants. + +2016-04-06 Elliott Hughes + + Improve decoding of Android's PR_SET_VMA prctl. + Before: + + prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096, + "atexit handlers") = 0 + + After: + + prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096, + "atexit handlers") = 0 + + * prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA. + * Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option. + * xlat/prctl_options.in: Add PR_SET_VMA. + +2016-04-06 Fei Jie + + tests: add mkdirat.test. + * tests/mkdirat.c: New file. + * tests/mkdirat.test: New test. + * tests/.gitignore: Add mkdirat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mkdirat.test. + + tests: add swap.test. + * tests/swap.c: New file. + * tests/swap.test: New test. + * tests/.gitignore: Add swap. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add swap.test. + + tests: add unlinkat.test. + * tests/unlinkat.c: New file. + * tests/unlinkat.test: New test. + * tests/.gitignore: Add unlinkat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add unlinkat.test. + + tests: add linkat.test. + * tests/linkat.c: New file. + * tests/linkat.test: New test. + * tests/.gitignore: Add linkat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add linkat.test. + +2016-04-06 Dmitry V. Levin + + tests: add sync_file_range.test and sync_file_range2.test. + * configure.ac (AC_CHECK_FUNCS): Add sync_file_range. + * tests/sync_file_range.c: New file. + * tests/sync_file_range2.c: Likewise. + * tests/sync_file_range.test: New test. + * tests/sync_file_range2.test: Likewise. + * tests/.gitignore: Add sync_file_range and sync_file_range2. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test. + +2016-04-05 Dmitry V. Levin + + Add default values for SYNC_FILE_RANGE_* constants. + * xlat/sync_file_range_flags.in: Add default values. + +2016-04-05 Elliott Hughes + + Fix sync_file_range2 output. + Before: + + sync_file_range2(3SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| + SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0, ) + + After: + + sync_file_range2(3, SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| + SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0) + + * sync_file_range.c (SYS_FUNC(sync_file_range2)): Output the ", " + in the right place. + +2016-04-04 Dmitry V. Levin + + Replace PF_* constants with AF_* + AF_* constants appear to be more standardized, and in practice there's + always a one to one relationship between AF_* and PF_*, so let's + use AF_* instead of PF_*. + + * xlat/domains.in: Remove. + * net.c: Do not define PF_UNSPEC. Stop including "xlat/domains.h". + Replace PF_* with AF_*. Replace domains with addrfams. + * tests/inet-cmsg.c: Replace PF_INET with AF_INET. + * tests/net-yy-inet.c: Likewise. + * tests/netlink_inet_diag.c: Likewise. + * tests/net-accept-connect.c: Replace PF_LOCAL with AF_LOCAL. + * tests/net-y-unix.c: Likewise. + * tests/net-yy-unix.c: Likewise. + * tests/netlink_unix_diag.c: Likewise. + * tests/net.expected: Replace PF_ with AF_. + +2016-04-03 Dmitry V. Levin + + tests: add read-write.test. + * tests/read-write.c: New file. + * tests/read-write.test: New test. + * tests/.gitignore: Add read-write. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add read-write.test. + +2016-04-02 Dmitry V. Levin + + tests/pread64-pwrite64.test: extend dumpio coverage. + * tests/pread64-pwrite64.c (dump_str, print_hex, test_dump): + New functions. + (main): Use them to test dumping of various data. + * tests/pread64-pwrite64.test: Update. + + tests: add hexdump_memdup function to libtests. + * tests/hexdump_strdup.c (hexdump_memdup): New function. + (hexdump_strdup): Use it. + * tests/tests.h (hexdump_memdup): New prototype. + + tests: add fchownat.test. + * tests/fchownat.c: New file. + * tests/fchownat.test: New test. + * tests/.gitignore: Add fchownat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fchownat.test. + + tests: add fchmodat.test. + * tests/fchmodat.c: New file. + * tests/fchmodat.test: New test. + * tests/.gitignore: Add fchmodat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fchmodat.test. + + Fix printing of negative offsets in pread64 and pwrite64 syscalls. + * io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Print offset + using %lld format string. + * tests/pread64-pwrite64.c: New file. + * tests/pread64-pwrite64.test: New test. + * tests/.gitignore: Add pread64-pwrite64. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (pread64_pwrite64_CPPFLAGS): New variable. + (DECODER_TESTS): Add pread64-pwrite64. + + tests/hexdump_strdup.c: add support for longer strings. + * tests/hexdump_strdup.c (hexdump_strdup): Output extra space character + before hexdumping of the 9th symbol. + + tests/preadv-pwritev.c: fix typo in error diagnostics. + * tests/preadv-pwritev.c (main): Fix typo in error message. + +2016-04-01 Fei Jie + + tests: add chroot.test. + * tests/chroot.c: New file. + * tests/chroot.test: New test. + * tests/.gitignore: Add chroot. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add chroot.test. + + tests: add fdatasync.test. + * tests/fdatasync.c: New file. + * tests/fdatasync.test: New test. + * tests/.gitignore: Add fdatasync. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fdatasync.test. + + tests: add fsync.test. + * tests/fsync.c: New file. + * tests/fsync.test: New test. + * tests/.gitignore: Add fsync. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add fsync.test. + + tests: add sethostname.test. + * tests/sethostname.c: New file. + * tests/sethostname.test: New test. + * tests/.gitignore: Add sethostname. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add sethostname.test. + +2016-04-01 Dmitry V. Levin + + Consistently handle unsigned arguments of mmap* and remap_file_pages. + Explicitly declare first 4 arguments of mmap* and all remap_file_pages + arguments as unsigned to avoid potential sign extension issues. + + * mem.c (print_mmap, SYS_FUNC(remap_file_pages)): Assign syscall + arguments to local variables of appropriate types. + +2016-04-01 Dmitry V. Levin + + Consistently handle 2nd and 3rd arguments of [gs]etsockopt as unsigned. + The second (level) and third (optname) arguments of getsockopt and + setsockopt syscalls are enums, so treat them consistently as enums: + use "unsigned int" type to avoid potential sign extension issues. + + * net.c (print_sockopt_fd_level_name, print_getsockopt, + print_setsockopt): Change type of "level" and "name" arguments + from "int" to "unsigned int". + +2016-04-01 Dmitry V. Levin + + Add sentinel attribute to printxvals. + * gcc_compat.h (ATTRIBUTE_SENTINEL): New macro. + * defs.h (printxvals): Add ATTRIBUTE_SENTINEL. + + Cleanup parser of ptrace syscall. + * process.c (print_user_offset_addr): New function for printing offset + address in the tracee's USER area. + (SYS_FUNC(ptrace)): Assign syscall arguments to local variables with + appropriate types. Print pid argument as int. Use switch statement + in the code that handles address argument. Use print_user_offset_addr + to print address in PTRACE_PEEKUSER and PTRACE_POKEUSER requests. + +2016-03-31 Jeff Mahoney + + Define PRI__[uxs]64 macros to print __s64 and __u64 values. + Rather than cast every __u64 or __s64 before printing, + define printing helpers for those types directly. + + * defs.h (PRI__s64, PRI__u64, PRI__x64): New macros. + +2016-03-31 Dmitry V. Levin + + Implement dumping of preadv and pwritev syscalls. + * syscall.c (dumpio): Add SEN_preadv and SEN_pwritev. + * NEWS: Mention this. + * tests/preadv-pwritev.c: New file. + * tests/preadv-pwritev.test: New test. + * tests/.gitignore: Add preadv-pwritev. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (preadv_pwritev_CPPFLAGS): New variable. + (DECODER_TESTS): Add preadv-pwritev. + +2016-03-30 Dmitry V. Levin + + Fix decoding of preadv syscall in case of short read. + * io.c (SYS_FUNC(preadv)): Call tprint_iov_upto instead + of tprint_iov and specify syscall return value as a data size limit. + * NEWS: Mention it. + * tests/preadv.c (main): Add a test case for preadv short read. + + Fix printing of negative offsets in preadv and pwritev syscalls. + * io.c (print_llu_from_low_high_val): Rename to + print_lld_from_low_high_val, all callers changed. + Print value as a signed integer. + * tests/preadv.c: New file. + * tests/preadv.test: New test. + * tests/pwritev.c: New file. + * tests/pwritev.test: New test. + * tests/.gitignore: Add preadv and pwritev. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (preadv_CPPFLAGS, pwritev_CPPFLAGS): New variables. + (DECODER_TESTS): Add preadv.test and pwritev.test. + + Fix printing of unreadable struct iovec. + * io.c (tprint_iov_upto): If the first element of iovec array is + unreadable, print its address without array markup. + * tests/readv.c (main): Check it. + + tests: factor out a part common to many simply organized test scripts. + * tests/init.sh (run_strace_match_diff): New function. + * tests/acct.test: Rewrite using run_strace_match_diff. + * tests/aio.test: Likewise. + * tests/alarm.test: Likewise. + * tests/chmod.test: Likewise. + * tests/clock_nanosleep.test: Likewise. + * tests/clock_xettime.test: Likewise. + * tests/copy_file_range.test: Likewise. + * tests/creat.test: Likewise. + * tests/dup.test: Likewise. + * tests/dup2.test: Likewise. + * tests/dup3.test: Likewise. + * tests/epoll_create1.test: Likewise. + * tests/execveat-v.test: Likewise. + * tests/execveat.test: Likewise. + * tests/fchmod.test: Likewise. + * tests/fcntl.test: Likewise. + * tests/file_handle.test: Likewise. + * tests/flock.test: Likewise. + * tests/fork-f.test: Likewise. + * tests/ftruncate.test: Likewise. + * tests/ftruncate64.test: Likewise. + * tests/getcwd.test: Likewise. + * tests/getdents.test: Likewise. + * tests/getdents64.test: Likewise. + * tests/getrandom.test: Likewise. + * tests/getrusage.test: Likewise. + * tests/getxxid.test: Likewise. + * tests/inet-cmsg.test: Likewise. + * tests/init.sh: Likewise. + * tests/membarrier.test: Likewise. + * tests/mincore.test: Likewise. + * tests/mknod.test: Likewise. + * tests/mlock2.test: Likewise. + * tests/mmsg.test: Likewise. + * tests/nanosleep.test: Likewise. + * tests/open.test: Likewise. + * tests/openat.test: Likewise. + * tests/pselect6.test: Likewise. + * tests/readdir.test: Likewise. + * tests/readlink.test: Likewise. + * tests/readv.test: Likewise. + * tests/recvmsg.test: Likewise. + * tests/rename.test: Likewise. + * tests/renameat.test: Likewise. + * tests/rt_sigpending.test: Likewise. + * tests/rt_sigprocmask.test: Likewise. + * tests/rt_sigqueueinfo.test: Likewise. + * tests/rt_sigsuspend.test: Likewise. + * tests/rt_sigtimedwait.test: Likewise. + * tests/rt_tgsigqueueinfo.test: Likewise. + * tests/sched_get_priority_mxx.test: Likewise. + * tests/sched_xetaffinity.test: Likewise. + * tests/sched_xetparam.test: Likewise. + * tests/sched_xetscheduler.test: Likewise. + * tests/seccomp.test: Likewise. + * tests/select.test: Likewise. + * tests/sendfile.test: Likewise. + * tests/sendfile64.test: Likewise. + * tests/splice.test: Likewise. + * tests/statx.sh: Likewise. + * tests/sysinfo.test: Likewise. + * tests/syslog.test: Likewise. + * tests/tee.test: Likewise. + * tests/time.test: Likewise. + * tests/timer_create.test: Likewise. + * tests/timer_xettime.test: Likewise. + * tests/timerfd_xettime.test: Likewise. + * tests/times-fail.test: Likewise. + * tests/times.test: Likewise. + * tests/truncate.test: Likewise. + * tests/truncate64.test: Likewise. + * tests/umask.test: Likewise. + * tests/umount.test: Likewise. + * tests/umount2.test: Likewise. + * tests/userfaultfd.test: Likewise. + * tests/vmsplice.test: Likewise. + * tests/xet_robust_list.test: Likewise. + * tests/xetitimer.test: Likewise. + * tests/xetpgid.test: Likewise. + * tests/xetpriority.test: Likewise. + * tests/xettimeofday.test: Likewise. + + tests: introduce $NAME. + * tests/init.sh (NAME): New variable, defined to ${ME_%.test}. + (run_prog, match_awk, match_diff, match_grep): Replace ${ME_%.test} + with $NAME. + * tests/fcntl.test: Likewise. + * tests/fstat.test: Likewise. + * tests/mmap.test: Likewise. + * tests/net-y-unix.test: Likewise. + * tests/net-yy-inet.test: Likewise. + * tests/net-yy-unix.test: Likewise. + * tests/open.test: Likewise. + * tests/openat.test: Likewise. + * tests/poll.test: Likewise. + * tests/ppoll.test: Likewise. + * tests/readlink.test: Likewise. + * tests/select.test: Likewise. + * tests/statx.sh: Likewise. + * tests/uname.test: Likewise. + +2016-03-30 Dmitry V. Levin + + tests: move definitions of $OUT and $ERR to init.sh. + As virtually every test defines either one or both of OUT and ERR + variables and these definitions are exactly the same, move definitions + of these variables from individual tests to init.sh. + + * tests/init.sh (OUT, ERR): New variables. + * tests/ipc.sh: Remove initialization of OUT variable. + * tests/statx.sh: Likewise. + * tests/*.test: Remove initialization of OUT and ERR variables. + +2016-03-29 Dmitry V. Levin + + tests: simplify sendfile.test and sendfile64.test. + Use the executable itself for input by default. + + * tests/sendfile.c (main): Use av[0] instead of av[1] for input. + * tests/sendfile64.c (main): Likewise. + * tests/sendfile.test: Invoke run_prog without arguments. + * tests/sendfile64.test: Likewise. + +2016-03-29 Dmitry V. Levin + + open.test, openat.test: lift /proc requirement. + While -P option needs /proc to match descriptors, it does not use + /proc to match pathnames. As these tests do not need descriptor + match, the /proc requirement can be safely lifted. + + * tests/open.test: Lift /proc/self/fd/ requirement. + * tests/openat.test: Likewise. + +2016-03-29 Dmitry V. Levin + + quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA. + * quota.c (if_nextdqblk): New structure. + (decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA. + + Update Q_* constants. + * xlat/quotacmds.in: Add Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA introduced + by linux kernel commits v4.6-rc1~65^2~9^2~5 and v4.6-rc1~65^2~9^2~6. + + Update CLONE_* constants. + * xlat/clone_flags.in: Rename CLONE_STOPPED to CLONE_NEWCGROUP. + The former was removed by linux kernel commit v2.6.38-rc1~217. + The latter was introduced by linux kernel commit v4.6-rc1~67^2~8. + + Update BPF_MAP_TYPE_* constants. + * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERCPU_HASH, + BPF_MAP_TYPE_PERCPU_ARRAY, and BPF_MAP_TYPE_STACK_TRACE introduced by + linux kernel commits v4.6-rc1~91^2~326^2~5, v4.6-rc1~91^2~326^2~4, and + v4.6-rc1~91^2~212^2~1, respectively. + + Update SO_* constants. + * xlat/sockoptions.in: Add SO_CNX_ADVICE introduced by linux kernel + commit v4.6-rc1~91^2~176. + + Update SEGV_* constants. + * xlat/sigsegv_codes.in: Add SEGV_PKUERR introduced by linux kernel + commit v4.6-rc1~68^2~23. + + avr32: wire up copy_file_range syscall. + * linux/avr32/syscallent.h [325]: Add copy_file_range entry. + +2016-03-28 JayRJoshi + + tests/uname.test: check abbreviated output, use print_quoted_string. + * tests/uname.c (main): Use print_quoted_string to print + utsname members. Add abbrev check. + * tests/uname.test: Add abbrev check. + +2016-03-28 Dmitry V. Levin + + faccessat.test: robustify against libcs invoking faccessat syscall on their own + * tests/faccessat.c (TMP_FILE): Rename to sample, change its value + to "faccessat.sample". + * tests/faccessat.test: Rewrite using openat.test. + + openat.test: robustify against libcs invoking openat syscall on their own + * tests/openat.c (main): Rename fname to sample, change its value + to "openat.sample". + * tests/openat.test: Use -P option to filter out openat syscalls + made by libc and dynamic linker. + + tests: add open.test. + * tests/open.c: New file. + * tests/open.test: New test. + * tests/.gitignore: Add open. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add open.test. + +2016-03-27 Dmitry V. Levin + + Update generic ioctl entries from linux 4.5. + * linux/64/ioctls_inc.h: Update from linux v4.5 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * NEWS: Mention this. + +2016-03-26 Dmitry V. Levin + + maint: update for linux 4.5. + * maint/ioctls_sym.sh: Update workarounds for drm/*_drm.h files. + Add workarounds for xen/gntdev.h and net/nfc/nci_core.h files. + Update path of saa6588.h and exynos-fimc.h files. + +2016-03-25 Dmitry V. Levin + + Fix decoding of device numbers in mknod and mknodat syscalls. + * mknod.c (decode_mknod): Treat device number argument as unsigned int. + * tests/mknod.c: Include or + for definition of makedev macro. + (main): Add a check for a character special file. + +2016-03-25 Dmitry V. Levin + + sparc64: fix decoding of mknod and mknodat syscalls for sparc personality + Remove remnants of solaris personality support in mknod parser + that resulted to sparc personality being decoded as old solaris + personality. This complements commit v4.10-45-gdf4dd8b and fixes + commit v4.10-46-g588a90f. + + * mknod.c (decode_mknod) [SPARC || SPARC64]: Remove. + +2016-03-25 Katerina Koukiou + + tests: add openat.test. + * tests/openat.c: New file. + * tests/openat.test: New test. + * tests/.gitignore: Add openat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add openat.test. + +2016-03-25 Fei Jie + + tests: add renameat.test. + * tests/renameat.c: New file. + * tests/renameat.test: New test. + * tests/.gitignore: Add renameat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add renameat.test. + + tests: add faccessat.test. + * tests/faccessat.c: New file. + * tests/faccessat.test: New test. + * tests/.gitignore: Add faccessat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add faccessat.test. + + tests: add creat.test. + * tests/creat.c: New file. + * tests/creat.test: New test. + * tests/.gitignore: Add creat. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add creat.test. + + tests: add mknod.test. + * tests/mknod.c: New file. + * tests/mknod.test: New test. + * tests/.gitignore: Add mknod. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add mknod.test. + + tests: add syslog.test. + * tests/syslog.c: New file. + * tests/syslog.test: New test. + * tests/.gitignore: Add syslog. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add syslog.test. + +2016-03-23 JayRJoshi + + tests/scm_rights-fd.test: fix pathname regex. + Pathname containing >, }, or non-printable characters was resulting + in failing of the test. + + * tests/scm_rights-fd.test: Fix pathname regex and simplify things. + +2016-03-24 Dmitry V. Levin + + tests: add strace-r.test. + * tests/strace-r.expected: New file. + * tests/strace-r.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + (EXTRA_DIST): Add strace-r.expected. + + tests: add strace-ttt.test. + * tests/strace-ttt.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + + tests: add strace-tt.test. + * tests/strace-tt.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + + tests: add strace-t.test. + * tests/strace-t.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + + tests: add strace-T.test. + * tests/strace-T.expected: New file. + * tests/strace-T.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + (EXTRA_DIST): Add strace-T.expected. + +2016-03-23 Dmitry V. Levin + + tests: split out tests of specific decoders. + Split TESTS into three groups: tests of specific decoders, libunwind + tests, and all other tests. + + * tests/Makefile.am (TESTS): Move attach-f-p.test, attach-p-cmd.test, + bexecve.test, count-f.test, count.test, detach-running.test, + detach-sleeping.test, detach-stopped.test, dumpio.test, + filter-unavailable.test, fork-f.test, ksysent.test, opipe.test, + pc.test, qual_syscall.test, redirect.test, restart_syscall.test, + strace-f.test, and vfork-f.test to MISC_TESTS. + Move remaining tests except $(LIBUNWIND_TESTS) to DECODER_TESTS. + Add $(DECODER_TESTS) and $(MISC_TESTS). + +2016-03-23 JayRJoshi + + tests: add getcwd.test. + * tests/getcwd.c: New file. + * tests/getcwd.test: New test. + * tests/.gitignore: Add getcwd. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add getcwd.test. + + tests: add print_quoted_string function to libtests. + * tests/tests.h (print_quoted_string): New prototype. + * tests/print_quoted_string.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + +2016-03-17 Fei Jie + + tests: add xetpriority.test. + * resource.c (SYS_FUNC(getpriority), SYS_FUNC(setpriority)): Print + the second syscall argument using %d format. + * tests/xetpriority.c: New file. + * tests/xetpriority.test: New test. + * tests/.gitignore: Add xetpriority. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add xetpriority.test. + +2016-03-15 Fei Jie + + tests: add flock.test. + * tests/flock.c: New file. + * tests/flock.test: New test. + * tests/.gitignore: Add flock. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add flock.test. + + tests: add sched_xetscheduler.test. + * tests/sched_xetscheduler.c: New file. + * tests/sched_xetscheduler.test: New test. + * tests/.gitignore: Add sched_xetscheduler. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add sched_xetscheduler.test. + +2016-03-15 Dmitry V. Levin + + alpha: fix SOCK_DIAG_BY_FAMILY tests. + This complements commit v4.9-368-g301c65c. + + * tests/netlink_inet_diag.c (check_responses): Align "buf" + on sizeof(long) boundary. + * tests/netlink_unix_diag.c (check_responses): Likewise. + +2016-03-14 Dmitry V. Levin + + Update EPOLL* constants. + * xlat/epollevents.in: Add EPOLLWAKEUP and EPOLLEXCLUSIVE. + +2016-03-12 Dmitry V. Levin + + tests: add count-f.test. + * tests/count-f.c: New file. + * tests/count-f.expected: Likewise. + * tests/count-f.test: New test. + * tests/.gitignore: Add count-f. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (count_f_LDADD): New variable. + (EXTRA_DIST): Add count-f.expected. + (TESTS): Add count-f.test. + +2016-02-21 Dmitry V. Levin + + hppa: wire up copy_file_range syscall. + * linux/hppa/syscallent.h [346]: Add copy_file_range entry. + +2016-03-11 Fei Jie + + tests: filter strace output in uname test. + * tests/uname.test: Use uniq to filter strace output. + +2016-03-10 Fei Jie + + tests: add sched_xetparam.test. + * tests/sched_xetparam.c: New file. + * tests/sched_xetparam.test: New test. + * tests/.gitignore: Add sched_xetparam. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add sched_xetparam.test. + + tests: add sched_get_priority_mxx.test. + * tests/sched_get_priority_mxx.c: New file. + * tests/sched_get_priority_mxx.test: New test. + * tests/.gitignore: Add sched_get_priority_mxx. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add sched_get_priority_mxx.test. + + tests: add dup.test, dup2.test, and dup3.test. + * tests/dup.c: New file. + * tests/dup.test: New test. + * tests/dup2.c: New file. + * tests/dup2.test: New test. + * tests/dup3.c: New file. + * tests/dup3.test: New test. + * tests/.gitignore: Add dup, dup2, and dup3. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add dup.test, dup2.test, and dup3.test. + +2016-03-10 Fabien Siron + + tests: add fchmod.test. + * tests/fchmod.c: New file. + * tests/fchmod.test: New test. + * tests/.gitignore: Add fchmod. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add fchmod.test. + +2016-03-09 Fei Jie + + tests: add acct.test. + * tests/acct.c: New file. + * tests/acct.test: New test. + * tests/.gitignore: Add acct. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add acct.test. + +2016-03-07 Anchit Jain + + tests: add chmod.test. + * tests/chmod.c: New file. + * tests/chmod.test: New test. + * tests/.gitignore: Add chmod. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add chmod.test. + +2016-03-05 Nahim El Atmani + + Reduce memory usage while managing tcbs allocation. + * strace.c (init): Remove initial memory allocation for tcbtab. + (expand_tcbtab): Do initial memory allocation when tcbtabsize == 0. + + Reviewed-By: Gabriel Laskar + Reported-by: haris iqbal + +2016-03-01 Fei Jie + + tests: add umask.test. + * tests/umask.c: New file. + * tests/umask.test: New test. + * tests/.gitignore: Add umask. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add umask.test. + + tests: add rename.test. + * tests/rename.c: New file. + * tests/rename.test: New test. + * tests/.gitignore: Add rename. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add rename.test. + + tests: add uname.test. + * tests/uname.c: New file. + * tests/uname.test: New test. + * tests/.gitignore: Add uname. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add uname.test. + +2016-02-20 Dmitry V. Levin + + mips: wire up copy_file_range syscall. + * linux/mips/syscallent-n32.h [6324]: Add copy_file_range entry. + * linux/mips/syscallent-n64.h [5320]: Likewise. + * linux/mips/syscallent-o32.h [4360]: Likewise. + +2016-02-19 Dmitry V. Levin + + tests: add rt_sigsuspend.test. + * tests/rt_sigsuspend.c: New file. + * tests/rt_sigsuspend.test: New test. + * tests/.gitignore: Add rt_sigsuspend. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add rt_sigsuspend.test. + + Print pid_t arguments of rt_sigqueueinfo and rt_tgsigqueueinfo as int. + * signal.c (SYS_FUNC(rt_sigqueueinfo)): Print first syscall argument + using %d format. + (SYS_FUNC(rt_tgsigqueueinfo)): Print first and second syscall arguments + using %d format. + * tests/rt_tgsigqueueinfo.c: New file. + * tests/rt_tgsigqueueinfo.test: New test. + * tests/.gitignore: Add rt_tgsigqueueinfo. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add rt_tgsigqueueinfo.test. + + getrusage.test: fix build on x32. + * tests/getrusage.c: Include + (main): Print members of struct timeval using %ju format. + +2016-02-19 Dmitry V. Levin + + getrusage.test: check that getrusage parser does not access extra memory + Place struct rusage at the end of an allocated memory page followed by + an inaccessible page. + + * tests/getrusage.c (main): Use tail_alloc. + +2016-02-19 Fei Jie + + tests: add getrusage.test. + * tests/getrusage.c: New file. + * tests/getrusage.test: New test. + * tests/.gitignore: Add getrusage. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add getrusage.test. + +2016-02-19 Dmitry V. Levin + + Print rt_sigtimedwait return value as a signal name. + * signal.c (SYS_FUNC(rt_sigtimedwait)): Decode return value. + * tests/rt_sigtimedwait.c: New file. + * tests/rt_sigtimedwait.test: New test. + * tests/.gitignore: Add rt_sigtimedwait. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add rt_sigtimedwait.test. + + tests: add rt_sigprocmask.test. + * tests/rt_sigprocmask.c: New file. + * tests/rt_sigprocmask.test: New test. + * tests/.gitignore: Add rt_sigprocmask. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add rt_sigprocmask.test. + + Fix corner cases of rt_sigpending syscall decoder. + * signal (print_sigset_addr_len_limit): New function, cloned from + print_sigset_addr_len with added minimal length argument. + Treat length less than minimal length or greater than NSIG/8 as invalid. + Do not align length to 4-byte boundary. Align destination buffer + to 4-byte boundary and initialize it with zeroes so that subsequent + call to sprintsigmask_n will not access uninitialized data. + (print_sigset_addr_len): Turn into a wrapper around + print_sigset_addr_len_limit with current_wordsize + as a minimal length argument. + (SYS_FUNC(rt_sigpending)): Call print_sigset_addr_len_limit + instead of print_sigset_addr_len with 1 as a minimal length argument. + * tests/rt_sigpending.c: New file. + * tests/rt_sigpending.test: New test. + * tests/.gitignore: Add rt_sigpending. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add rt_sigpending.test. + +2016-02-19 Dmitry V. Levin + + Change unix_diag requests back to use full dump instead of exact match. + Unfortunately, 64-bit linux kernel has a bug in matching inode numbers + greater than INT_MAX, so unix_diag exact match is not reliable. + + This partially reverts commit 69bfc89770152033d4aa0bc5673fc46e65d89838. + + * socketutils.c (unix_send_query): Add NLM_F_DUMP to nlmsg_flags, + remove initialization of udiag_cookie. + * tests/netlink_unix_diag.c (send_query): Remove "inode" argument, + add NLM_F_DUMP to nlmsg_flags, remove initialization of udiag_ino + and udiag_cookie. + (check_responses): Remove "inode" argument and its use. + (main): Remove invocation of inode_of_sockfd and passing of listening + socket inode to send_query and check_responses. + +2016-02-19 Michael Shigorin + + tests: avoid using cpp -dD. + -dD is less portable across some peculiar preprocessors. + + tests/Makefile.am (ksysent.h): Use cpp -dM instead of cpp -dD. + +2016-02-16 Dmitry V. Levin + + tests: add poll.test. + * tests/poll.c: New file. + * tests/poll.test: New test. + * tests/.gitignore: Add poll. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add poll.test. + + Fix abbreviated output of poll and ppoll decoders. + * poll.c (decode_poll_entering, decode_poll_exiting): Fix corner cases + of abbreviated output. + * tests/ppoll-v.expected: Update. + * tests/ppoll.expected: Update. + * tests/ppoll.test: Update. + + Print unfetchable address in poll and ppoll decoders. + * poll.c (decode_poll_entering): Replace umove call with + umove_or_printaddr. + (decode_poll_exiting): Print unfetchable address when umove call fails. + + Print offsets in lseek and _llseek syscalls as signed integers. + * lseek.c (SYS_FUNC(lseek)): Print offset using %lld format. + (SYS_FUNC(llseek)): Likewise. Treat high and low components of offset + as unsigned long integers. + * tests/llseek.c (main): Check that negative offset is printed properly. + * tests/lseek.c (main): Likewise. + +2016-02-14 Dmitry V. Levin + + tests: add xetpgid.test. + * tests/xetpgid.c: New file. + * tests/xetpgid.test: New test. + * tests/.gitignore: Add xetpgid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add xetpgid.test. + + tests: add alarm.test. + * tests/alarm.c: New file. + * tests/alarm.test: New test. + * tests/.gitignore: Add alarm. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add alarm.test. + + Replace printargs_lu and printargs_ld with printargs_u and printargs_d. + * defs.h (printargs_lu): Rename to printargs_u. + (printargs_ld): Rename to printargs_d. + * syscall.c (printargs_lu): Rename to printargs_u. Replace %lu with %u. + (printargs_ld): Rename to printargs_d. Replace %ld with %d. + * linux/dummy.h (sys_getpgrp): Change to printargs. + (sys_alarm): Change to printargs_u. + (sys_getpgid, sys_getsid, sys_nice, sys_setpgid, sys_setpgrp, + sys_timer_delete, sys_timer_getoverrun): Change to printargs_d. + + Change printargs_lu and printargs_ld to return RVAL_DECODED. + * syscall.c (printargs_lu, printargs_ld): Return RVAL_DECODED. + + redirect.test: fix the way how strace output is discarded. + * tests/redirect.test: Disable tracing of syscalls, signals, + and exit status instead of redirecting strace output to /dev/null. + + tests: extend coverage of struct iovec arrays. + * tests/readv.c (main): Check decoding of empty, inaccessible, + and partially inaccessible iovec arrays. + * tests/readv.test: Update. + + Implement dumping of vmsplice syscall. + * syscall.c (dumpio): Add SEN_vmsplice. + * NEWS: Mention this. + * tests/vmsplice.c: New file. + * tests/vmsplice.test: New test. + * tests/.gitignore: Add vmsplice. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add vmsplice.test. + + tests: add tee.test. + * tests/tee.c: New file. + * tests/tee.test: New test. + * tests/.gitignore: Add tee. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add tee.test. + + Fix printing of negative offsets in splice syscall. + * io.c (SYS_FUNC(splice)): Use PRId64 instead of PRIu64 for printing + offsets. + * tests/splice.c: New file. + * tests/splice.test: New test. + * tests/.gitignore: Add splice. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add splice.test. + + Implement copy_file_range syscall decoding. + * copy_file_range.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/32/syscallent.h (copy_file_range): New entry. + * linux/64/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * pathtrace.c (pathtrace_match): Add SEN_copy_file_range. + * NEWS: Mention new syscall parser. + * tests/copy_file_range.c: New file. + * tests/copy_file_range.test: New test. + * tests/.gitignore: Add copy_file_range. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add copy_file_range.test. + + Update fs *_MAGIC constants. + * xlat/fsmagic.in: Add CGROUP2_SUPER_MAGIC and OVERLAYFS_SUPER_MAGIC. + + Update IPV6_* constants. + * xlat/sockipv6options.in: Add IPV6_HDRINCL. + + Update SO_* constants. + * xlat/sockoptions.in: Add SO_ATTACH_REUSEPORT_CBPF + and SO_ATTACH_REUSEPORT_EBPF. + + Update MADV_* constants. + * xlat/madvise_cmds.in: Add MAD_FREE. + +2016-02-13 Dmitry V. Levin + + tests: robustify execve and execveat tests. + * tests/execve.c (main): Use one page gap between two mapped regions + for an address that is more likely to be not yet mapped. + * tests/execveat.c (main): Likewise. + + tests: simplify execve test. + * tests/execve.c (main): Simplify the test assuming that execve syscall + never returns ENOSYS. + +2016-02-13 Dmitry V. Levin + + Fix numbers of syscall arguments in syscall tables. + This semi-automatic change brings syscall tables in sync with kernel's + include/linux/syscalls.h file. + + * linux/aarch64/syscallent.h (recv): Fix nargs. + * linux/alpha/syscallent.h (sigaltstack, init_module, + sched_getscheduler, settimeofday): Likewise. + * linux/arm/syscallent.h (signal, pciconfig_iobase, msgrcv, msgctl, + shmat, shmdt, shmctl, semtimedop, get_mempolicy, set_mempolicy, + timerfd_create): Likewise. + * linux/bfin/syscallent.h (signal, delete_module): Likewise. + * linux/hppa/syscallent.h (init_module, munlockall, sched_getscheduler, + io_cancel, set_tid_address, listxattr, llistxattr, flistxattr, + removexattr, lremovexattr, fremovexattr): Likewise. + * linux/i386/syscallent.h (signal, mmap): Likewise. + * linux/ia64/syscallent.h (init_module, readv, writev, + sched_getscheduler): Likewise. + * linux/m68k/syscallent.h (signal, request_key): Likewise. + * linux/microblaze/syscallent.h (signal, clone, fstatfs64, vmsplice): + Likewise. + * linux/mips/syscallent-n32.h (getpgid, statfs, fstatfs, init_module, + delete_module): Likewise. + * linux/mips/syscallent-n64.h (getpgid, statfs, fstatfs, init_module, + delete_module): Likewise. + * linux/mips/syscallent-o32.h (signal, statfs, fstatfs, ioperm, + fstatfs64): Likewise. + * linux/powerpc/syscallent.h (signal, spu_run, spu_create): Likewise. + * linux/powerpc64/syscallent.h (signal, pread64, pwrite64, readahead, + fadvise64, lookup_dcookie, spu_run, spu_create, sync_file_range2, + fallocate, preadv, pwritev, fanotify_mark): Likewise. + * linux/s390/syscallent.h (signal, mmap, lookup_dcookie, ipc): Likewise. + * linux/s390x/syscallent.h (signal, ipc): Likewise. + * linux/sh/syscallent.h (signal, ipc, munlockall, fstatfs64, vmsplice): + Likewise. + * linux/sh64/syscallent.h (signal, ipc, msgrcv, msgctl, shmat, shmdt, + shmctl, fstatfs64, vmsplice): Likewise. + * linux/sparc/syscallent.h (ptrace, dup, signal, ipc): Likewise. + * linux/sparc64/syscallent.h (ptrace, dup, signal, pread64, pwrite64, + readahead, lookup_dcookie, fadvise64, fadvise64_64, ipc, + sync_file_range, fallocate, preadv, pwritev, fanotify_mark): Likewise. + * linux/x32/syscallent.h (64:recvmsg): Likewise. + * linux/xtensa/syscallent.h (mremap, futex, reboot, init_module, + delete_module, request_key, getcpu, ioprio_set, ioprio_get, utimensat, + futimesat, fchmodat, faccessat): Likewise. + * NEWS: Mention this fix. + +2016-02-13 Dmitry V. Levin + + s390: decode fadvise64 and fadvise64_64. + * linux/s390/syscallent.h (fadvise64): Set sys_func. + (fadvise64_64): Set nargs and sys_func. + + mips n64: use the most optimal parser for fadvise64 syscall. + * linux/mips/syscallent-n64.h (fadvise64): Replace SEN(fadvise64_64) + with SEN(fadvise64). + + ia64: decode fstatfs64 and statfs64. + * linux/ia64/syscallent.h (fstatfs64, statfs64): Set nargs and sys_func. + +2016-02-13 Dmitry V. Levin + + alpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments. + On alpha, ia64, mips, sh, sh64, sparc, and sparc64 architectures + pipe syscall does not take arguments. + + * linux/alpha/syscallent.h (pipe): Change nargs to 0. + * linux/ia64/syscallent.h (pipe): Likewise. + * linux/mips/syscallent-n32.h (pipe): Likewise. + * linux/mips/syscallent-n64.h (pipe): Likewise. + * linux/mips/syscallent-o32.h (pipe): Likewise. + * linux/sh/syscallent.h (pipe): Likewise. + * linux/sh64/syscallent.h (pipe): Likewise. + +2016-02-13 Dmitry V. Levin + + alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall. + * net.c (do_pipe) [HAVE_GETRVAL2]: Remove. + Always call decode_pair_fd on exiting. + (SYS_FUNC(pipe)) [HAVE_GETRVAL2]: Call printpair_fd instead of do_pipe. + + Fix pathtrace match for pipe2 syscall. + * pathtrace.c (pathtrace_match): As pipe2 syscall has no descriptors + or paths to test, move SEN_pipe2 to the appropriate category. + + avr32: wire up missing syscalls. + * linux/avr32/syscallent.h [322..324]: Add userfaultfd, membarrier, + and mlock2 entries. + +2016-02-12 Dmitry V. Levin + + tests: check decoding of madvise, mlockall, mremap, and msync syscalls. + * tests/mmap.c (main): Change output format from regexp to verbatim. + Add tests for madvise, mlockall, mremap, and msync syscalls. + * tests/mmap.test: Convert from match_grep to match_diff. + Add madvise, mlockall, mremap, and msync syscalls to syscall filter. + +2016-02-11 Dmitry V. Levin + + Simplify decoding of waitpid and wait4 syscalls. + * wait.c (printwaitn): Replace "n" and "bitness" integer arguments + with a single print_rusage function pointer. All callers updated. + + waitid: print pid argument as int. + * wait.c (SYS_FUNC(waitid)): As the type of second syscall argument + in the kernel is pid_t, print it as int. + + waitid: always print 5th argument. + * wait.c (SYS_FUNC(waitid)): Do not check for tcp->s_ent->nargs + as waitid syscall has 5 arguments. + + socketutils: add const qualifier to variables. + * socketutils.c (cache_and_print_inode_details): Make "details" + parameter const. + (print_sockaddr_by_inode_cached): Make "e" variable const. + (inet_send_query): Make struct nlmsghdr and struct inet_diag_req_v2 + members const. Make "msg" variable const. + (inet_parse_response): Make "data" parameter and diag_msg variable const. + (receive_responses): Make "h" and "rc" variables const. + (unix_send_query): Make struct nlmsghdr and struct unix_diag_req + members const. Make "msg" variable const. + (unix_print): Make all parameters const. + (print_sockaddr_by_inode): Make proto_name parameter const. + + print_sockaddr_by_inode: cleanup protocol lookup. + * socketutils.c (tcp_v4_print, udp_v4_print, tcp_v6_print, + udp_v6_print): New functions. + (print_sockaddr_by_inode): Make "protocols" array static, replace + "family" and "protocol" members with "print" in its underlying + structure. Iterate through protocols array when the protocol name + is specified. + +2016-02-09 Dmitry V. Levin + + tests: check that -f -p attaches to threads properly. + Check that -f -p attaches and follows all threads of the given pid. + + * tests/attach-f-p.c: New file. + * tests/attach-f-p.test: New test. + * tests/.gitignore: Add attach-f-p. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (attach_f_p_LDADD): New variable. + (TESTS): Add attach-f-p.test. + +2016-02-09 Dmitry V. Levin + + Introduce libstrace.a for potentially conditional compilation units. + Some files are used conditionally depending on architecture and + configuration. Create a library for the purpose of keeping such + compilation units. + + * Makefile.am (strace_LDADD, noinst_LIBRARIES): Add libstrace.a. + (libstrace_a_CPPFLAGS): New variable, set to $(strace_CPPFLAGS). + (libstrace_a_CFLAGS): New variable, set to $(strace_CFLAGS). + (libstrace_a_SOURCES): New variable, set to upeek.c. + * util.c (upeek): Move ... + * upeek.c: ... here. + +2016-02-08 Dmitry V. Levin + + travis-ci: pass more gcov arguments to codecov. + + tests: extend coverage of struct itimerspec. + * tests/timer_xettime.c (main): Check decoding of NULL struct itimerspec + pointer. + + tests: extend coverage of utimensat syscall. + * tests/utimensat.c (main): Check decoding of NULL struct timespec + pointer. + + tests: extend coverage of time syscall. + * tests/time.c (main): Check decoding of NULL time_t pointer. + + tests: extend coverage of struct sigevent. + * tests/timer_create.c (main): Check decoding of NULL struct sigevent + pointer. Check decoding of invalid sigev_notify value. + +2016-02-08 Dmitry V. Levin + + tests: extend coverage of execve and execveat syscalls. + Check decoding of inaccessible or partially inaccessible arrays. + + * tests/execve-v.c: New file. + * tests/execveat-v.c: Likewise. + * tests/execve-v.test: New test. + * tests/execveat-v.test: Likewise. + * tests/execve.c: Rewrite. + * tests/execveat.c: Likewise. + * tests/execve.test: Likewise. + * tests/execveat.test: Likewise. + * tests/execve.expected: Remove. + * tests/execve-v.expected: Likewise. + * tests/execveat.expected: Likewise. + * tests/execveat-v.expected: Likewise. + * tests/.gitignore: Add execve-v and execveat-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add execve-v.test and execveat-v.test. + (EXTRA_DIST): Remove execve.expected, execve-v.expected, + execveat.expected, and execveat-v.expected. + +2016-02-08 Dmitry V. Levin + + Fix decoding of execve and execveat syscalls with invalid input. + * execve.c (printargv): Fix decoding of inaccessible or partially + inaccessible array. + (printargc): Diagnose inaccessible or partially inaccessible array. + (decode_execve, SYS_FUNC(execv)): Update printargv and printargc callers. + + tests: extend coverage of capget syscall. + * tests/caps.c (main): Check decoding of inaccessible cap_user_header_t + and/or cap_user_data_t. + * tests/caps.awk: Update match patterns. + * tests/caps.test: Update. + + tests: extend coverage of sched_getaffinity syscall. + * tests/sched_xetaffinity.c (main): Check decoding of pointer + to inaccessible cpu_set_t. + + tests: extend coverage of utime syscall. + * tests/utime.c (main): Check decoding of NULL struct utimbuf pointer. + Check decoding of struct utimbuf located at the end of page boundary. + * tests/utime.test: Update. + + tests: extend coverage of sysinfo syscall. + * tests/sysinfo.c (main): Check decoding of NULL struct sysinfo pointer. + Check decoding of struct sysinfo located at the end of page boundary. + * tests/sysinfo.test: Update. + + tests: extend coverage of adjtimex syscall. + * tests/adjtimex.c (main): Check decoding of NULL struct timex pointer. + Check decoding of struct timex located at the end of page boundary. + * tests/adjtimex.test: Update. + + tests: check that strace does not retain stdin and stdout descriptors. + * tests/redirect.test: New test. + * tests/Makefile.am (TESTS): Add it. + + Create a dummy pipe descriptor instead of opening /dev/null. + * strace.c (open_dev_null): Rename to open_dummy_desc. All callers + changed. Create a pipe and return its first descriptor instead of + opening /dev/null. + +2016-02-08 Denys Vlasenko + + If stdin/stdout aren't open on startup, open them to /dev/null. + Otherwise, -oLOGFILE may end up using one of them. This conflicts + with the previous change, which closes stdin/out in strace. + + * strace.c (init): If fcntl(F_GETFD) fails on stdin or stdout, + sanitize them: open /dev/null and dup it until fds 0,1,2 + are all used up. + +2016-02-08 Denys Vlasenko + + Close stdin/out after child is forked. + Testcase: + + { sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9' + + The writer (head) will be able to perform writes to write end of the pipe. + With strace call removed, head will immediately get SIGPIPE. + + This change fixes this: now writer immediately gets SIGPIPE with strace too. + + * strace.c (startup_child): Close stdin/out and reopen them to /dev/null. + +2016-02-05 Dmitry V. Levin + + tests: add opipe.test. + Check that -o |pipe_command works. In particular, check that + strace waits for completion of piped command. + + * tests/opipe.test: New test. + * tests/Makefile.am (TESTS): Add it. + +2016-02-05 Keith Owens + + strace-graph: print the pid in the graph. + * strace-graph: Prefix each command with its pid. + + strace-graph: cope with clone immediately followed by exit. + * strace-graph: A clone() followed by exit() with no intervening fork + or execve resulted in the new pid having no seq key. That breaks when + trying to use seq as an array reference. Ensure that clone populates + the new pid with an empty seq entry. + + strace-graph: handle recent strace output. + * strace-graph: Fix regex for --SIG. Ignore '+++ exited with +++' + lines. Handle exit_group syscall as well as _exit. + + strace-graph: handle strace -T. + * strace-graph: Ignore extra ' ' field added by strace -T. + + strace-graph: use "strict" and "warnings" pragmas. + * strace-graph: Set "use strict" and "use warnings" options. Fix errors + detected by strict/warnings. $result is really a string, it can be "-1" + followed by an error text. + +2016-02-04 Dmitry V. Levin + + Add README.md file with links to build status and test coverage. + + travis-ci: prepare and submit test coverage report. + + tests: extend readlink and readlinkat coverage. + * tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros. + (main): Allocate memory for string and buffer passed to the syscall + being tested using tail_alloc mechanism. Create and cleanup test + symlink. Test syscall error path output. Print hexquoted strings + using hexquote_strndup. + * tests/readlinkat.c: Likewise. + * tests/readlink.test: Remove creation and cleanup of test symlinks. + + tests: add hexquote_strndup function to libtests. + * tests/tests.h (hexquote_strndup): New prototype. + * tests/hexquote_strndup.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + + readlinkat.test: use readlink.test. + * tests/readlink.test (syscall): Initialize from $0. + * tests/readlinkat.test: Source readlink.test. + +2016-02-04 Gabriel Laskar + + Add configure --enable-code-coverage option. + * m4/ax_code_coverage.m4: New file. + * configure.ac: Use AX_CODE_COVERAGE. + * Makefile.am: Add @CODE_COVERAGE_RULES@. + (CODE_COVERAGE_LCOV_OPTIONS, CODE_COVERAGE_GENHTML_OPTIONS, + CODE_COVERAGE_IGNORE_PATTERN): New variables. + (strace_CPPFLAGS): Add $(CODE_COVERAGE_CPPFLAGS). + (strace_CFLAGS): Add $(CODE_COVERAGE_CFLAGS). + (strace_LDADD): Add $(CODE_COVERAGE_LDFLAGS). + * .gitignore: Add *.gcda and *.gcno. + +2016-02-03 Dmitry V. Levin + + Makefile.am: introduce strace_CFLAGS and derivatives. + * Makefile.am (strace_CFLAGS): New variable, set to $(AM_CFLAGS). + (libmpers_CFLAGS): New variable, set to $(strace_CFLAGS). + (libmpers_m32_a_CFLAGS, libmpers_mx32_a_CFLAGS): New variables, + set to $(libmpers_CFLAGS). + + Makefile.am: use strace_CPPFLAGS consistently. + * Makefile.am (libmpers_CPPFLAGS): Replace $(AM_CPPFLAGS) + with $(strace_CPPFLAGS). + +2016-02-03 Dmitry V. Levin + + tests: replace net-fd.test with net-y-unix.test. + Unlike the former test that was based on match_grep, + the new one uses match_diff and does more rigorous testing. + + * tests/net-y-unix.c: New file. + * tests/net-y-unix.test: New test. + * tests/net-fd.test: Remove. + * tests/net-fd.expected: Remove. + * tests/.gitignore: Add net-y-unix. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Replace net-fd.test with net-y-unix.test. + (net-fd.log): Remove. + (EXTRA_DIST): Remove net-fd.expected. + +2016-02-03 Dmitry V. Levin + + Implement caching of print_sockaddr_by_inode. + As -yy parser, compared to -y, needs to do at least 5 extra syscalls + (getxattr, socket, sendmsg, recvmsg, close) to print socket details, + caching results of netlink conversations between strace and kernel + noticeably reduces amount of system time spent by strace. + + The caching is safe since sockets do not change their addresses after + successful bind or connect syscall. + + * defs.h (string_quote, print_sockaddr_by_inode_cached): New prototypes. + * socketutils.c (cache_entry): New type. + (CACHE_SIZE, CACHE_MASK): New macros. + (cache): New static array. + (cache_and_print_inode_details): New static function. + (print_sockaddr_by_inode_cached): New function. + (inet_parse_response, unix_parse_response): Use + cache_and_print_inode_details. + * util.c (printfd): Use string_quote and print_sockaddr_by_inode_cached. + (string_quote): Remove static qualifier. + * NEWS: Mention this improvement. + * tests/unix-yy.c (main): Update. + +2016-02-03 Dmitry V. Levin + + Change unix_diag requests to use exact match instead of full dump. + * socketutils.c (unix_send_query): Remove NLM_F_DUMP from nlmsg_flags, + initialize udiag_cookie. + * tests/netlink_unix_diag.c (send_query): Remove "family" and "proto" + arguments, add "inode" argument, remove NLM_F_DUMP from nlmsg_flags, + initialize udiag_ino and udiag_cookie. + (check_responses): Add "inode" argument, check inode match. + (main): Pass listening socket inode to send_query and check_responses. + + Robustify netlink response parsers. + * socketutils.c (inet_parse_response, unix_parse_response): Change + return type from bool to int, return -1 on all parse errors except + inode mismatch. + (receive_responses): Stop on the first nlmsg_type that is not + SOCK_DIAG_BY_FAMILY, also stop when the parser returns -1. + * tests/netlink_inet_diag.c (check_responses): Stop on short messages, + on first nlmsg_type that is not SOCK_DIAG_BY_FAMILY, print more verbose + diagnostics for NLMSG_ERROR. + * tests/netlink_unix_diag.c (check_responses): Likewise. + + inet_parse_response: add a safety check. + * socketutils.c (inet_parse_response): Check that netlink message + is large enough to contain a inet_diag_msg structure. + + receive_responses: avoid potential hangup. + * socketutils.c (receive_responses): Pass MSG_DONTWAIT to recvmsg after + the first recvmsg call to avoid potential hangup. + +2016-02-03 Dmitry V. Levin + + tests: replace net-yy.test with net-yy-inet.test. + Unlike the former test that was based on match_awk, + the new one uses match_diff and does more rigorous testing. + + * tests/net-yy-inet.c: New file. + * tests/net-yy-inet.test: New test. + * tests/net-yy.test: Remove. + * tests/net-yy-accept.awk: Remove. + * tests/net-yy-connect.awk: Remove. + * tests/inet-accept-connect-send-recv.c: Remove. + * tests/.gitignore: Replace inet-accept-connect-send-recv + with net-yy-inet. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Replace net-yy.test with net-yy-inet.test. + (EXTRA_DIST): Remove net-yy-accept.awk and net-yy-connect.awk. + +2016-02-03 Dmitry V. Levin + + tests: replace unix-yy.test with net-yy-unix.test. + Unlike the former test that was based on match_awk, + the new one uses match_diff and does more rigorous testing. + + * tests/net-yy-unix.c: New file. + * tests/net-yy-unix.test: New test. + * tests/unix-yy.test: Remove. + * tests/unix-yy-accept.awk: Remove. + * tests/unix-yy-connect.awk: Remove. + * tests/.gitignore: Add net-yy-unix. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Replace unix-yy.test with net-yy-unix.test. + (EXTRA_DIST): Remove unix-yy-accept.awk and unix-yy-connect.awk. + +2016-02-02 Dmitry V. Levin + + tests: add inode_of_sockfd function to libtests. + * tests/tests.h (inode_of_sockfd): New prototype. + * tests/inode_of_sockfd.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + + unix_parse_response: add a safety check. + * socketutils.c (unix_parse_response): Check that netlink message + is large enough to contain a unix_diag_msg structure. + +2016-01-29 Dmitry V. Levin + + Fixed decoding of mincore syscall's last argument. + * mem.c (SYS_FUNC(mincore)): Print only those bytes of the vector + that were written by the kernel. + * NEWS: Mention this fix. + * tests/mincore.c: New file. + * tests/mincore.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add mincore. + (TESTS): Add mincore.test. + * tests/.gitignore: Add mincore. + +2016-01-23 Dmitry V. Levin + + Move fallback -yy socket print from printfd to print_sockaddr_by_inode. + * util.c (printfd): In -yy mode, move fallback print of proto:[inode] ... + * socketutils.c (to print_sockaddr_by_inode): ... here. + +2016-01-22 Dmitry V. Levin + + Implement simultaneous use of -p option and tracing of a command. + * strace.c (init): Allow -p option along with a command. + (startup_child): In -D mode, record the parent of the tracer process + as strace_child. + (startup_attach): Save trace_tracer_pid before -D mode fork. + When tracing a command in -f mode, do not check for the command's + threads as it has no threads at this moment. + Never attach to the tracer process. + In -D mode, never attach to the parent of the tracer process, + terminate that process only once at the end of startup_attach, + and reset strace_child. + * strace.1: Document that -p option can be used along with tracing + of a command. + * NEWS: Mention it. + * tests/attach-p-cmd-cmd.c: New file. + * tests/attach-p-cmd-p.c: Likewise. + * tests/attach-p-cmd.test: New test. + * tests/.gitignore: Add attach-p-cmd-cmd and attach-p-cmd-p. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (TESTS): Add attach-p-cmd.test. + + This fixes Debian bug #549942. + +2016-01-22 Dmitry V. Levin + + strace.1: fix format of -P description. + * strace.1 (-P): Write trailing using regular font. + +2016-01-21 Dmitry V. Levin + + tests: use local nanosleep based sleep utility replacement. + * tests/sleep.c: New file. + * tests/.gitignore: Add sleep. + * tests/Makefile.am (check_PROGRAMS): Likewise. + * tests/count.test: Use it instead of system sleep utility. + + tests: add error_msg_and_fail function to libtests. + * tests/tests.h (error_msg_and_fail): New prototype. + * tests/error_msg.c (error_msg_and_fail): New function. + +2016-01-20 Dmitry V. Levin + + Fix dumping of recvmmsg syscall in case of short read. + * net.c (dumpiov_in_mmsghdr): Call dumpiov_upto instead of dumpiov, + pass data size limit to dumpiov_upto. + * NEWS: Mention this fix. + * tests/mmsg.c (main): Update. + + Fix dumping of recvmsg syscall in case of short read. + * defs.h (dumpiov_in_msghdr): Add unsigned long argument. + * net.c (dumpiov_in_msghdr): Add data_size argument. Call dumpiov_upto + instead of dumpiov, pass data_size to dumpiov_upto. + * syscall.c (dumpio): Pass data size limit to dumpiov_in_msghdr. + * NEWS: Mention this fix. + * tests/recvmsg.c: New file. + * tests/recvmsg.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add recvmsg. + (TESTS): Add recvmsg.test. + * tests/.gitignore: Add recvmsg. + + Fix decoding and dumping of readv syscall in case of short read. + * defs.h (dumpiov_upto): New prototype. + (dumpiov): Change to a wrapper around dumpiov_upto. + * util.c (dumpiov): Rename to dumpiov_upto, add and check data_size + argument. + * io.c (SYS_FUNC(readv)): Call tprint_iov_upto instead + of tprint_iov and specify syscall return value as a data size limit. + * syscall.c (dumpio): In case of SEN_readv, call dumpiov_upto instead + of dumpiov and specify syscall return value as a data size limit. + * NEWS: Mention this fix. + * tests/readv.c: New file. + * tests/readv.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add readv. + (TESTS): Add readv.test. + * tests/.gitignore: Add readv. + + tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros. + * tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros. + * tests/aio.c (ARRAY_SIZE): Remove. + * tests/mmsg.c (LENGTH_OF): Remove. + + tests: add hexdump_strdup function to libtests. + * tests/tests.h (hexdump_strdup): New prototype. + * tests/hexdump_strdup.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + + tests: add tprintf function to libtests. + * tests/tests.h (tprintf): New prototype. + * tests/tprintf.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/mmsg.c: Use tprintf. + +2016-01-19 Dmitry V. Levin + + quotactl: add Q_XGETQSTATV command decoding. + * quota.c (fs_qfilestatv, fs_quota_statv): New structures. + (decode_cmd_data): Handle Q_XGETQSTATV case. + + quotactl: add decoding of if_dqinfo.dqi_flags constants. + * xlat/if_dqinfo_flags.in: New file. + * quota.c: Include "xlat/if_dqinfo_flags.h". + (decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags. + + quotactl: consistenly decode all write and unknown commands on entering. + * quota.c (decode_cmd_data): Change return type to int. + Return 0 on entering Q_GETQUOTA, Q_V1_GETQUOTA, Q_V2_GETQUOTA, + Q_XGETQUOTA, Q_GETFMT, Q_GETINFO, Q_V2_GETINFO, Q_V1_GETSTATS, + Q_V2_GETSTATS, and Q_XGETQSTAT commands, return RVAL_DECODED + for any other command. + (SYS_FUNC(quotactl)): On entering, print third argument of any command. + For any command except Q_QUOTAON and Q_V1_QUOTAON, call decode_cmd_data + and forward its return value. + + quotactl: fix Q_QUOTAON command decoding. + * quota.c (SYS_FUNC(quotactl)): Print Q_QUOTAON 4th argument as a path. + + quotactl: print third argument as unsigned int. + * quota.c (SYS_FUNC(quotactl)): Consistently print the third + argument using "%u" format. + + quotactl: fix Q_XQUOTAOFF command decoding. + * quota.c (decode_cmd_data): Print xfs quota flags argument. + + quotactl: fix Q_GETFMT and Q_XQUOTAON commands decoding. + * quota.c (decode_cmd_data): As quota format value and xfs quota flags + are in-memory constants, print it like an array of one element instead + of a structure. + +2016-01-17 Dmitry V. Levin + + Update quotactl constants. + * xlat/quota_formats.in: Add QFMT_OCFS2 and QFMT_VFS_V1. + * xlat/quotacmds.in: Add Q_XGETQSTATV. + * xlat/quotatypes.in: Add PRJQUOTA. + * xlat/xfs_quota_flags.in: Add FS_QUOTA_PDQ_ACCT and FS_QUOTA_PDQ_ENFD. + +2016-01-19 Dmitry V. Levin + + Replace u_int{8,16,32,64} with uint{8,16,32,64} + * util.c: Replace u_int{32,64} with uint{32,64}. + * quota.c: Replace u_int{8,16,32,64} with uint{8,16,32,64}. + + Move definitions of quotactl constants to xlat files. + * quota.c (Q_*): Move to xlat/quotacmds.in. + (USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in. + (QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in. + (XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in. + (XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in. + (QIF_*): Move to xlat/if_dqblk_valid.in. + (IIF_*): Move to xlat/if_dqinfo_valid.in. + +2016-01-15 Dmitry V. Levin + + llseek.test: robustify against libcs invoking _llseek syscall on their own + * tests/llseek.test: Filter out _llseek calls made with non-negative + descriptor arguments. + + lseek.test: robustify against libcs invoking lseek syscall on their own. + * tests/lseek.test: Filter out lseek calls made with non-negative + descriptor arguments. + +2016-01-14 Dmitry V. Levin + + mmsg.test: fix regression introduced by commit v4.11-138-g6e815ce. + This fixes the test on platforms where both __NR_sendmmsg and + HAVE_SENDMMSG are defined but the former is not implemented by the + kernel and the second is implemented as an indirect syscall. + + * tests/mmsg.c (LENGTH_OF): New macro. + (send_mmsg, recv_mmsg): Print expected output in case of ENOSYS. + (main): Redirect stdout to a new descriptor. Use LENGTH_OF. + Print expected output. + * tests/mmsg.test: Update. + * tests/mmsg.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove mmsg.expected. + +2016-01-13 Dmitry V. Levin + + aio.test: check memory access by aio decoders. + * tests/aio.c (main): Place all objects passed to io_* syscalls + at the end of memory pages followed by inaccessible pages. + +2016-01-13 Dmitry V. Levin + + s390, s390x: fix printing of syscalls unknown to the kernel. + On s390/s390x, syscalls with NR up to 255 can be implemented + directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used. + The latter method is allowed for NR < 256, too. + + When the syscall number specified directly or indirectly is recognized + by the kernel, i.e. it is less than its NR_syscalls value, it is stored + in %r2 and is available to arch_get_scno via s390_regset.gprs[2]. + For syscall numbers >= NR_syscalls this register is set to 0, + but %r1 remains unchanged and could be used by arch_get_scno + via s390_regset.gprs[1] to decide what the syscall number is. + + * linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero, + take syscall number from s390_regset.gprs[1]. + * NEWS: Mention this fix. + + This fixes Debian bug #485979 and Fedora bug #1298294. + +2016-01-13 Dmitry V. Levin + + s390, s390x: print all syscall arguments for syscall number 0. + * linux/s390/syscallent.h [0]: Set nargs to MA. + * linux/s390x/syscallent.h: Likewise. + + mips o32: alias sys_syscall to printargs. + * linux/dummy.h (sys_syscall): Alias to printargs. + * syscall.c [LINUX_MIPSO32] (SYS_FUNC(syscall)): Remove. + +2016-01-13 Dmitry V. Levin + + travis-ci: update build matrix. + Add clang-3.6/x86_64, clang-3.6/x86, and musl-gcc/x86_64 to the matrix. + + * .travis.yml (compiler): Add gcc, clang-3.6, and musl-gcc. + (env): Add matrix, remove global ENABLE_GCC_WERROR. + (matrix): Add exclude, remove include. + * travis-ci.sh: Add support for clang and musl-gcc. + Use --enable-gcc-Werror for gcc build unconditionally. + +2016-01-13 Dmitry V. Levin + + mpers.awk: add support for DWARF files generated by clang. + * mpers.awk: Define default_pointer_size. Initialize byte_size + for DW_TAG_pointer_type to default_pointer_size. Set parent + for DW_TAG_member only. Handle DW_AT_count as an alternative + to DW_AT_upper_bound. + +2016-01-12 Dmitry V. Levin + + configure.ac: reorder some statements for better readability. + * configure.ac: Sort and group together AC_PROG_*, AC_C_*, AC_TYPE_*, + AC_HEADER_*, AC_CHECK_FUNCS, AC_CHECK_TYPES, AC_CHECK_MEMBERS, + and AC_CHECK_HEADERS. + + scm_rights-fd.test: rewrite without fork. + * tests/scm_rights.c (main): Rewrite without fork. + Place all objects passed to sendmsg and recvmsg at the end + of memory pages followed by inaccessible pages. + * tests/scm_rights-fd.test: Update. + + tests: fix clang "duplicate 'const' declaration specifier" warnings. + * tests/ksysent.c (pstr_t): Remove second const specifier. + * tests/mmsg.c (main): Remove second const specifier from one[], two[], + and three[]. + + tests/times.c: fix clang compilation warning. + * tests/times.c (main): Initialize dummy variable. + +2016-01-12 Dmitry V. Levin + + tests/mmsg.c: fix build on rhel6/ppc. + There are weird platforms that define __NR_sendmmsg but at the same time + do not define __NR_recvmmsg. Add a workaround for them. + + * configure.ac (AC_CHECK_FUNCS): Add recvmmsg. + * tests/mmsg.c: Check for __NR_recvmmsg || HAVE_RECVMMSG. + +2016-01-12 Dmitry V. Levin + + s390: fix sigreturn decoding on recent kernels. + Linux kernel commit v4.3-rc1-50-g8d4bd0e corrected uc_sigmask + of the compat signal frame, so remove the old workaround. + + * linux/s390/arch_sigreturn.c (arch_sigreturn) [S390]: Remove. + +2016-01-12 Dmitry V. Levin + + Update PTRACE_* constants. + * ptrace.h (PTRACE_SECCOMP_GET_FILTER): Define. + * xlat/ptrace_cmds.in: Add PTRACE_SECCOMP_GET_FILTER. + +2016-01-12 Dmitry V. Levin + + Fix struct sigevent decoding for musl. + Do not rely on "struct sigevent.__pad" being located at the same address + as "struct sigevent.sigev_notify_thread_id", it's not the case with musl + libc. Do not rely on struct sigevent definition at all to access + sigev_notify_thread_id. + + * configure.ac (AC_CHECK_MEMBERS): Remove struct sigevent._sigev_un._pad + and struct sigevent.__pad. + * sigevent.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * print_sigevent.c: Include it. + * print_sigevent.c (struct_sigevent): Remove. + (print_sigevent): Update all struct_sigevent users. + * tests/timer_create.c: Include "sigevent.h". + (main): Use struct_sigevent instead of struct sigevent, + all struct sigevent clients changed. + +2016-01-12 Dmitry V. Levin + + syscall.c: include + All users of NSIG macro must include . + This complements commit v4.10-184-g0e946ab. + + * syscall.c: Include . + +2016-01-12 Dmitry V. Levin + + signal.c: fix musl libc compilation warning. + musl libc defines SIGRTMAX to a function that returns signed int, + which obviously makes gcc -Wsign-compare unhappy. + + * signal.c (signame): Cast ASM_SIGRTMAX to unsigned int. + +2016-01-12 Dmitry V. Levin + + tests: fix TEST_SYSCALL_{NR,STR} and STRUCT_STAT_STR macros for musl. + The contents of TEST_SYSCALL_NAME and STRUCT_STAT macros was subject + to macro expansion when used in definitions of TEST_SYSCALL_NR, + TEST_SYSCALL_STR, and STRUCT_STAT_STR macros. + + As some libcs, e.g. musl libc, define lfs64 names as macros + (stat64 as stat, lstat64 as lstat, etc.), this might result to incorrect + expansion of TEST_SYSCALL_NR, TEST_SYSCALL_STR, and STRUCT_STAT_STR + macros. To avoid this problem, define these macros directly and remove + TEST_SYSCALL_NAME macro. + + * tests/_newselect.c (TEST_SYSCALL_NAME): Remove. + (TEST_SYSCALL_NR, TEST_SYSCALL_STR): New macros. + * tests/fcntl.c: Likewise. + * tests/fcntl64.c: Likewise. + * tests/fstat.c: Likewise. + * tests/fstatat64.c: Likewise. + * tests/lstat.c: Likewise. + * tests/newfstatat.c: Likewise. + * tests/select.c: Likewise. + * tests/stat.c: Likewise. + * tests/fstat64.c (TEST_SYSCALL_NAME): Remove. + (TEST_SYSCALL_NR, TEST_SYSCALL_STR, STRUCT_STAT_STR): New macros. + * tests/lstat64.c: Likewise. + * tests/stat64.c: Likewise. + * tests/fstatx.c (TEST_SYSCALL_NR, nrify, nrify_): Remove. + * tests/lstatx.c: Likewise. + * tests/struct_flock.c (TEST_SYSCALL_NR, TEST_SYSCALL_STR, nrify, + nrify_, stringify, stringify_): Remove. + * tests/xselect.c: Likewise. + * tests/xstatx.c: Check TEST_SYSCALL_STR instead of TEST_SYSCALL_NAME. + (STRUCT_STAT_STR, TEST_SYSCALL_STR, stringify, stringify_): Remove. + [!STRUCT_STAT] (STRUCT_STAT_STR): New macro. + +2016-01-12 Dmitry V. Levin + + tests/struct_flock.c: fix musl libc compilation warnings. + The size of off_t is not something one can rely upon. For example, + musl libc unconditionally defines it as an int64_t type on x86. + A cast to the target type helps to avoid these libc differences. + + * configure.ac: Call AC_C_TYPEOF. + * tests/struct_flock.c (TYPEOF_FLOCK_OFF_T): New macro. + (test_flock_einval): Use it instead of off_t. + +2016-01-12 Dmitry V. Levin + + tests/inet-cmsg.c: fix musl libc compilation warnings. + The types that are used to define msg_namelen member of struct msghdr + and cmsg_len member of struct cmsghdr differ between libcs. + For example, glibc defines them as size_t, while musl libc - as type + socklen_t. Print these fields using %lu format to avoid issues caused + by libc differences. + + * tests/inet-cmsg.c (main): Cast mh.msg_controllen and c->cmsg_len + to unsigned long and print them using %lu format. + +2016-01-11 Dmitry V. Levin + + aio.test: include instead of + * tests/aio.c: Include instead of . + + mmsg.test: check memory access by sendmmsg and recvmmsg decoders. + * tests/tests.h (tail_memdup): New prototype. + * tests/tail_alloc.c (tail_memdup): New function. + * tests/mmsg.c (main): Place all objects passed to sendmmsg and recvmmsg + at the end of memory pages followed by inaccessible pages. + + mmsg.test: check decoding of flags passed to sendmmsg and recvmmsg. + * tests/mmsg.c (main): Pass MSG_DONTROUTE|MSG_NOSIGNAL to sendmmsg. + Pass MSG_DONTWAIT to recvmmsg. + * tests/mmsg.expected: Update. + +2016-01-11 Dmitry V. Levin + + mmsg.test: prefer direct sendmmsg/recvmmsg syscalls to libc wrappers. + * tests/mmsg.c: Include . + Check for __NR_sendmmsg as an alternative to HAVE_SENDMMSG. + [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define. + (send_mmsg, recv_mmsg): New functions. + (main): Use them instead of sendmmsg and recvmmsg. + + Reported-by: Szabolcs Nagy + +2016-01-10 Dmitry V. Levin + + sigreturn.test: use RT_5 signal number instead of RT_2. + Make the test compatible with musl libc that uses RT_2 internally. + + * tests/sigreturn.c (main): Replace RT_2 with RT_5. + * tests/sigreturn.test: Likewise. + + Reported-by: Szabolcs Nagy + +2016-01-10 Dmitry V. Levin + + avr32: wire up accept4 syscall. + * linux/avr32/syscallent.h [321]: Add accept4 entry. + +2016-01-09 Dmitry V. Levin + + sparc64: fix names of {s,g}etres{u,g}id syscalls. + * linux/sparc64/syscallent.h [108 ... 111]: Use sparc64 syscall names. + + sparc64: remove sparc32 syscall entries. + * linux/sparc64/syscallent.h [31, 32, 35, 44, 53, 56, 69, 70, 72, 77, + 82, 84, 87, 89, 91, 94, 112, 115, 155, 231]: Unassign. + + sparc: remove sparc64 syscall entries. + * linux/sparc/syscallent.h [52, 163]: Unassign. + + sparc64: clone syscallent.h from sparc. + * linux/sparc64/syscallent.h: Clone from linux/sparc/syscallent.h. + + sparc: fix mlock2 sysentry, wire up bind, listen, and setsockopt syscalls + * linux/sparc/syscallent.h [353]: Move mlock2 entry to 356. + [353, 354, 355]: Add bind, listen, and setsockopt entries. + * NEWS: Mention this. + +2016-01-09 Dmitry V. Levin + + tests: do not use settimeofday wrapper provided by libc. + Workaround limitations of settimeofday wrapper provided by musl libc. + + * tests/xettimeofday.c (main): Call settimeofday using syscall(). + + Reported-by: Szabolcs Nagy + +2016-01-09 Dmitry V. Levin + + ioctl.test: robustify against libcs invoking ioctl syscall on their own. + * tests/ioctl.test: Filter out from the log ioctl calls with standard + descriptor arguments. + + Reported-by: Szabolcs Nagy + +2016-01-09 Dmitry V. Levin + + alpha: enhance decoding of getxpid, getxuid, and getxgid syscalls. + Print the second return value of getxpid, getxuid, and getxgid syscalls + that return a pair of values using the same mechanism as pipe syscall. + + * alpha.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/alpha/syscallent.h [20]: Change SEN(getpid) to SEN(getxpid). + [24]: Change SEN(getuid) to SEN(getxuid). + [47]: Change SEN(getgid) to SEN(getxgid). + * NEWS: Mention this enhancement. + * tests/uid.awk: Update for getxgid output change. + * tests/uid.test: Cleanup. + * tests/getxxid.c: New file. + * tests/getxxid.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add getxxid. + (TESTS): Add getxxid.test. + * tests/.gitignore: Add getxxid. + +2016-01-08 Dmitry V. Levin + + Cleanup parser of getpagesize syscall. + * mem.c (SYS_FUNC(getpagesize)): Decode on entering syscall. + + alpha: alias getdtablesize to printargs. + * linux/dummy.h [ALPHA] (sys_getdtablesize): Alias to printargs. + * desc.c [ALPHA] (SYS_FUNC(getdtablesize)): Remove. + +2016-01-08 Dmitry V. Levin + + tests: change text marker in fork-f and vfork-f tests. + Use chdir syscalls instead of pwrite64 syscalls as a method of inserting + text markers into strace output because the former are more portable. + + * tests/fork-f.c (logit): Rename to logit_. Use chdir instead of pwrite. + (logit): New macro wrapper around logit_. + (main): Update expected output. + * tests/vfork-f.c: Likewise. + * tests/fork-f.test: Update. + +2016-01-07 Dmitry V. Levin + + Fix printing of 32-bit times syscall return value on 64-bit architectures + This change complements commit v4.9-359-gd93d9f8 by fixing + RVAL_UDECIMAL case. + The only syscall that appears to be affected is the times syscall. + + * syscall.c (trace_syscall_exiting): In case of RVAL_UDECIMAL, + when current personality is 32-bit, print 32-bit return code. + * NEWS: Mention this fix. + + Reported-by: Steve McIntyre + +2016-01-07 Dmitry V. Levin + + tests/vfork-f.c: support platforms without vfork. + On some platforms, e.g. hppa glibc, vfork() is implemented using fork + syscall, so the test cannot rely on the parent process remaining blocked + until the child process either terminates or calls execve. + + * tests/vfork-f.c (main): Explicitly block the parent until the child + either terminates or calls execve. + +2016-01-07 Dmitry V. Levin + + Fix and enhance decoding of sched_[gs]etaffinity syscalls. + Print cpu_set_t as a set of integers, similar to the way + fd_set is printed as a set of descriptors. + + * affinity.c: Include . + (get_cpuset_size): New function. + (print_affinitylist): Rewrite using get_cpuset_size and next_set_bit. + (sched_getaffinity, sched_setaffinity): Print first two args as ints. + * NEWS: Mention this enhancement. + * tests/sched_xetaffinity.c: New file. + * tests/sched_xetaffinity.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add sched_xetaffinity. + (TESTS): Add sched_xetaffinity.test. + * tests/.gitignore: Add sched_xetaffinity. + + Reported-by: Joe Korty + +2016-01-06 Dmitry V. Levin + + tests: convert epoll_create1.test from match_grep to match_diff. + * tests/epoll_create1.c (main): Print expected output. + * tests/epoll_create1.test: Use match_diff instead of match_grep. + * tests/epoll_create1.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove epoll_create1.expected. + + tests/struct_flock.c: use libtests. + * tests/struct_flock.c (create_sample): Return void, + all callers changed. Use perror_msg_and_fail. + * tests/fcntl.c: Use SKIP_MAIN_UNDEFINED. + * tests/fcntl64.c: Likewise. + + tests/file_handle.c: use libtests. + * tests/file_handle.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/uid32.c: use libtests. + * tests/uid32.c: Use SKIP_MAIN_UNDEFINED. + + tests/uid16.c: use libtests. + * tests/uid16.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/uid.c: use libtests. + * tests/uid.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/netlink_unix_diag.c: use libtests. + * tests/netlink_unix_diag.c (send_query, check_responses, main): + Use perror_msg_and_skip. + + tests/netlink_inet_diag.c: use libtests. + * tests/netlink_inet_diag.c (send_query, check_responses, main): + Use perror_msg_and_skip. + + tests/readdir.c: use libtests. + * tests/readdir.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/getdents64.c: use libtests. + * tests/getdents64.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/getdents.c: use libtests. + * tests/getdents.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/ipc_shm.c: use libtests. + * tests/ipc_shm.c (cleanup): New function. + (main): Use it and perror_msg_and_skip. + + tests/ipc_sem.c: use libtests. + * tests/ipc_sem.c (cleanup): New function. + (main): Use it and perror_msg_and_skip. + + tests/ipc_msg.c: use libtests. + * tests/ipc_msg.c (cleanup): New function. + (main): Use it and perror_msg_and_skip. + + tests/ipc_msgbuf.c: use libtests. + * tests/ipc_msgbuf.c (cleanup): New function. + (main): Use it and perror_msg_and_skip. + + tests/mq.c: use libtests. + * tests/mq.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/utimensat.c: use libtests. + * tests/utimensat.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/ppoll.c: use libtests. + * tests/ppoll.c (main): Use assert, perror_msg_and_skip, + and perror_msg_and_fail. + + tests/mmsg.c: use libtests. + * tests/mmsg.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/ip_mreq.c: use libtests. + * tests/ip_mreq.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/ioctl.c: use libtests. + * tests/ioctl.c: Use SKIP_MAIN_UNDEFINED. + (main): Use %m printf format specifier. + + tests/pipe.c: use libtests. + * tests/pipe.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_fail and perror_msg_and_skip. + + tests/getrandom.c: use libtests. + * tests/getrandom.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/signalfd.c: use libtests. + * tests/signalfd.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/pc.c: use libtests. + * tests/pc.c (main): Use assert, get_page_size, perror_msg_and_fail, + and perror_msg_and_skip. + + tests/uio.c: use libtests. + * tests/uio.c: Use SKIP_MAIN_UNDEFINED. + + tests/bpf.c: use libtests. + * tests/bpf.c: Use SKIP_MAIN_UNDEFINED. + (main) Use perror_msg_and_skip. + + tests/aio.c: use libtests. + * tests/aio.c: Use SKIP_MAIN_UNDEFINED. + (main) Use perror_msg_and_skip. + + tests/sched_xetattr.c: use libtests. + * tests/sched_xetattr.c: Use SKIP_MAIN_UNDEFINED. + (main) Use perror_msg_and_skip. + + tests/wait.c: use libtests. + * tests/wait.c (main): Use perror_msg_and_fail. + + tests/vfork-f.c: use libtests. + * tests/vfork-f.c (main): Use assert and perror_msg_and_fail. + + tests/fork-f.c: use libtests. + * tests/fork-f.c (main): Use assert and perror_msg_and_fail. + + tests/userfaultfd.c: use libtests. + * tests/userfaultfd.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert. + + tests/mlock2.c: use libtests. + * tests/mlock2.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert. + + tests/membarrier.c: use libtests. + * tests/membarrier.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert. + + tests/nanosleep.c: use libtests. + * tests/nanosleep.c (main): Use assert, perror_msg_and_fail, + and perror_msg_and_skip. + + tests/timerfd_xettime.c: use libtests. + * tests/timerfd_xettime.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/timer_xettime.c: use libtests. + * tests/timer_xettime.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/timer_create.c: use libtests. + * tests/timer_create.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/clock_xettime.c: use libtests. + * tests/clock_xettime.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/clock_nanosleep.c: use libtests. + * tests/clock_nanosleep.c (main): Use assert and perror_msg_and_skip. + + tests/truncate64.c: use libtests. + * tests/truncate64.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/truncate.c: use libtests. + * tests/truncate.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/ftruncate64.c: use libtests. + * tests/ftruncate64.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/ftruncate.c: use libtests. + * tests/ftruncate.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + +2016-01-05 Dmitry V. Levin + + tests/llseek.c: use libtests. + * tests/llseek.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/lseek.c: use libtests. + * tests/lseek.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/readlinkat.c: use libtests. + * tests/readlinkat.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/readlink.c: use libtests. + * tests/readlink.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/xattr.c: use libtests. + * tests/xattr.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/seccomp.c: use libtests. + * tests/seccomp.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_fail and perror_msg_and_skip. + + tests/restart_syscall.c: use libtests. + * tests/restart_syscall.c (main): Use assert, perror_msg_and_fail, + and perror_msg_and_skip. + + tests/inet-cmsg.c: use libtests. + * tests/inet-cmsg.c (main): Use perror_msg_and_skip. + + tests/eventfd.c: use libtests. + * tests/eventfd.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip. + + tests/epoll_create1.c: use libtests. + * tests/epoll_create1.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert and perror_msg_and_skip. + + tests/mmap.c: use libtests. + * tests/mmap.c (main): Use get_page_size and perror_msg_and_fail. + + tests/fanotify_mark.c: use libtests. + * tests/fanotify_mark.c: Use SKIP_MAIN_UNDEFINED. + + tests/inet-accept-connect-send-recv.c: use libtests. + * tests/inet-accept-connect-send-recv.c (main): Use perror_msg_and_skip + and perror_msg_and_fail. + + tests/net-accept-connect.c: use libtests. + * tests/net-accept-connect.c (main): Use perror_msg_and_skip + and perror_msg_and_fail. + + tests/unix-pair-send-recv.c: use libtests. + * tests/unix-pair-send-recv.c (main): Use perror_msg_and_skip + and perror_msg_and_fail. + +2016-01-06 Dmitry V. Levin + + tests/xselect.c: use libtests. + * tests/xselect.c (main): Use assert, perror_msg_and_fail, + and perror_msg_and_skip. + + tests/pselect6.c: use libtests. + * tests/pselect6.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert, perror_msg_and_fail, and perror_msg_and_skip. + +2016-01-05 Dmitry V. Levin + + tests/oldselect.c: use libtests. + * tests/oldselect.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_fail and perror_msg_and_skip. + + tests/select.c: use libtests. + * tests/select.c: Use SKIP_MAIN_UNDEFINED. + + tests/_newselect.c: use libtests. + * tests/_newselect.c: Use SKIP_MAIN_UNDEFINED. + + tests/fstatat.c: use libtests. + * tests/fstatat.c: Use SKIP_MAIN_UNDEFINED. + + tests/newfstatat.c: use libtests. + * tests/newfstatat.c: Use SKIP_MAIN_UNDEFINED. + + tests/fstatat64.c: use libtests. + * tests/fstatat64.c: Use SKIP_MAIN_UNDEFINED. + + tests/xstatx.c: use libtests. + * tests/xstatx.c: Use SKIP_MAIN_UNDEFINED. + + tests/stat64.c: use libtests. + * tests/stat64.c: Use SKIP_MAIN_UNDEFINED. + + tests/stat.c: use libtests. + * tests/stat.c: Use SKIP_MAIN_UNDEFINED. + + tests/lstat64.c: use libtests. + * tests/lstat64.c: Use SKIP_MAIN_UNDEFINED. + + tests/lstat.c: use libtests. + * tests/lstat.c: Use SKIP_MAIN_UNDEFINED. + + tests/fstat64.c: use libtests. + * tests/fstat64.c: Use SKIP_MAIN_UNDEFINED. + + tests/fstat.c: use libtests. + * tests/fstat.c: Use SKIP_MAIN_UNDEFINED. + + tests/statfs.c: use libtests. + * tests/statfs.c (main): Use perror_msg_and_fail. + +2016-01-06 Dmitry V. Levin + + tests/xettimeofday.c: use libtests. + * tests/xettimeofday.c (main): Use assert and perror_msg_and_skip. + + tests/utime.c: use libtests. + * tests/utime.c (main): Use assert and perror_msg_and_skip. + + tests/filter-unavailable.c: use libtests. + * tests/filter-unavailable.c (main): Use perror_msg_and_fail. + + tests/scm_rights.c: use libtests. + * tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip. + + tests/caps.c: use libtests. + * tests/caps.c (main): Use perror_msg_and_skip. + + tests/rt_sigqueueinfo.c: use libtests. + * tests/rt_sigqueueinfo.c (main): Use assert and perror_msg_and_skip. + + tests/umount.c: use libtests. + * tests/umount.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_fail. + + tests/umount2.c: use libtests. + * tests/umount2.c (main): Use perror_msg_and_fail. + +2016-01-05 Dmitry V. Levin + + tests/times.c: use libtests. + * tests/times.c (main): Use perror_msg_and_fail and perror_msg_and_skip. + +2016-01-04 Dmitry V. Levin + + tests/times-fail.c: use assert. + * tests/times-fail.c (main): Use assert. + + tests/memfd_create.c: use libtests. + * tests/memfd_create.c: Use SKIP_MAIN_UNDEFINED. + + tests/execveat.c: use libtests. + * tests/execveat.c: Use SKIP_MAIN_UNDEFINED. + + tests/xetitimer.c: use libtests. + * tests/xetitimer.c (main): Use perror_msg_and_skip. + +2016-01-05 Dmitry V. Levin + + tests/sysinfo.c: use libtests. + * tests/sysinfo.c (main): Use perror_msg_and_skip. + + tests/sigaltstack.c: use libtests. + * tests/sigaltstack.c (main): Use perror_msg_and_skip. + + tests/adjtimex.c: use libtests. + * tests/adjtimex.c (main): Use perror_msg_and_skip. + + tests/xet_robust_list.c: use libtests. + * tests/xet_robust_list.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip and tail_alloc. + + tests/umovestr2.c: use libtests. + * tests/umovestr2.c (main): Use get_page_size and tail_alloc. + + tests/umovestr.c: use libtests. + * tests/umovestr.c (main): Use perror_msg_and_skip and tail_alloc. + + tests/time.c: use libtests. + * tests/time.c: Use SKIP_MAIN_UNDEFINED. + (main): Use perror_msg_and_skip and tail_alloc. + + tests/sendfile64.c: use libtests. + * tests/sendfile64.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert, perror_msg_and_fail, perror_msg_and_skip, + and tail_alloc. + + tests/sendfile.c: use libtests. + * tests/sendfile.c: Use SKIP_MAIN_UNDEFINED. + (main): Use assert, perror_msg_and_fail, perror_msg_and_skip, + and tail_alloc. + +2016-01-05 Dmitry V. Levin + + tests: include tests.h instead of config.h. + Automatically edit tests/*.c files using the following perl one-liner: + + perl -0777 -pi -e \ + 's/#ifdef HAVE_CONFIG_H\n# include "config\.h"\n#endif\n*/#include "tests.h"\n/' \ + tests/*.c + +2016-01-05 Dmitry V. Levin + + tests: introduce libtests. + Introduce tests/libtests.a with common functions for use in tests. + + * tests/tests.h: New file. + * tests/error_msg.c: Likewise. + * tests/tail_alloc.c: Likewise. + * tests/get_page_size.c: Likewise. + * tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS, + check_LIBRARIES, LDADD): New variables. + (clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD, + pc_LDADD, times_LDADD): Add $(LDADD). + * tests/.gitignore: Add libtests.a. + +2016-01-01 Dmitry V. Levin + + tests: enable strace-k.test only for --with-libunwind configurations. + Also, since -k option does not support multiple personalities, + add strace-k.test to XFAIL_TESTS when running mpers tests. + + * tests/Makefile.am (MPERS_NAME, LIBUNWIND_TESTS, XFAIL_TESTS_, + XFAIL_TESTS_m32, XFAIL_TESTS_mx32, XFAIL_TESTS): New variables. + [USE_LIBUNWIND] (LIBUNWIND_TESTS): Add strace-k.test. + (TESTS): Replace strace-k.test with $(LIBUNWIND_TESTS). + * bootstrap: Substitute MPERS_NAME variable in tests-*/Makefile.am. + * tests/strace-k.test: Do not check for -k option availability. + +2016-01-02 Dmitry V. Levin + + Move gcc compat macros to gcc_compat.h. + * defs.h: Include "gcc_compat.h". + (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT, + ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC, + ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ... + * gcc_compat.h: ... here. + * Makefile.am (strace_SOURCES): Add gcc_compat.h. + +2015-12-31 Dmitry V. Levin + + Move defs.h from noinst_HEADERS to strace_SOURCES. + * Makefile.am (noinst_HEADERS): Move defs.h ... + (strace_SOURCES): ... here. + +2015-12-30 Dmitry V. Levin + + test: remove fork.c and vfork.c. + These manual tests are obsoleted by fork-f.test and vfork-f.test. + + * test/fork.c: Remove. + * test/vfork.c: Remove. + * test/Makefile (PROGS): Remove fork and vfork. + * test/.gitignore: Remove fork and vfork. + +2015-12-30 Dmitry V. Levin + + tests: add fork-f.test and vfork-f.test. + Check how strace -f follows fork and vfork syscalls. + + * tests/fork-f.c: New file. + * tests/fork-f.test: New test. + * tests/vfork-f.c: New file. + * tests/vfork-f.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add fork-f and vfork-f. + (TESTS): Add fork-f.test and vfork-f.test. + * tests/.gitignore: Add fork-f and vfork-f. + +2015-12-29 Dmitry V. Levin + + Set SYSCALL_NEVER_FAILS flag for getpid, getppid and gettid syscall. + * linux/*/syscallent*.h (getpid, getppid, gettid): Set NF flag. + +2015-12-29 Dmitry V. Levin + + Set SYSCALL_NEVER_FAILS flag for umask syscall. + Linux kernel always ANDs umask argument with 0700 and therefore + this syscall never fails. + + * linux/*/syscallent*.h (umask): Set NF flag. + +2015-12-27 Dmitry V. Levin + + alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error + On architectures that use dedicated registers to report syscall errors, + check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag + in the syscall entry. On architectures that use negated errno + semantics, there is no way to distinguish a syscall error from a valid + return code that looks like a syscall error, and the check for + SYSCALL_NEVER_FAILS flag remains the only way to tell one case + from another. + + * linux/alpha/get_error.c (get_error): Ignore check_errno. + * linux/ia64/get_error.c: Likewise. + * linux/mips/get_error.c: Likewise. + * linux/nios2/get_error.c: Likewise. + * linux/powerpc/get_error.c: Likewise. + * linux/sparc/get_error.c: Likewise. + * linux/sparc64/get_error.c: Likewise. + +2015-12-27 Dmitry V. Levin + + Handle unlikely errors from personality syscall. + Despite being marked as SYSCALL_NEVER_FAILS, personality syscall still + might report a failure on some architectures due to obscure kernel + bugs. Check for this unlikely case and let users know that their + kernel has gone bananas. + + * personality.c (SYS_FUNC(personality)): Do not parse syscall return + value in case of syserror. + +2015-12-27 Dmitry V. Levin + + Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls. + This should not be a user visible change unless the kernel does + something completely unexpected. In the latter case, let user see + what is going on. + + * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate + tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED. + +2015-12-26 Dmitry V. Levin + + Enhance personality syscall decoding. + * xlat/personality_options.in: Split into ... + * xlat/personality_types.in: ... personality types and ... + * xlat/personality_flags.in: ... personality flags. + * personality.c: Include "xlat/personality_types.h" + and "xlat/personality_flags.h" instead of "xlat/personality_options.h". + (SYS_FUNC(personality)): Print PER_MASK part of personality as + a symbolic value, and the rest of personality as a set of flags. + * tests/personality.c (main): Add more test cases. + * tests/personality.test: Update. + +2015-12-25 Dmitry V. Levin + + sh, sh64: fix syscall flags in several syscall entries. + * linux/sh/syscallent.h (geteuid32, getegid32, setfsuid32, setfsgid32): + Set SYSCALL_NEVER_FAILS flag. + (fchown32): Set TRACE_DESC flag. + * linux/sh64/syscallent.h: Likewise. + +2015-12-25 Dmitry V. Levin + + Print personality value 0xffffffff properly. + Value 0xffffffff of personality syscall first argument has a special + meaning, it is not a set of personality flags. + + * personality.c (SYS_FUNC(personality)): If personality equals + to 0xffffffff, print it verbatim. + * tests/personality.c (main): Test it. + +2015-12-25 Dmitry V. Levin + + tests: add personality.test. + * tests/personality.c: New file. + * tests/personality.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add personality. + (TESTS): Add personality.test. + * tests/.gitignore: Add personality. + + Enhance personality syscall decoding. + * personality.c (SYS_FUNC(personality)): On entering syscall, + print first argument not as a hex value but as a set of flags. + On exiting syscall, print return code as a set of flags. + * NEWS: Mention this enhancement. + +2015-12-25 Dmitry V. Levin + + Set SYSCALL_NEVER_FAILS flag for personality syscall. + Starting with commit + v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, personality + syscall never fails to set the personality, but before commit + v2.6.35-rc1-372-g485d527 it still could return an error. + Starting with that commit, personality syscall never returns an error. + + * linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag in personality + syscall entries. + +2015-12-24 Dmitry V. Levin + + Add personality emulation flags. + * xlat/personality_options.in: Add UNAME26, ADDR_NO_RANDOMIZE, + FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, ADDR_COMPAT_LAYOUT, READ_IMPLIES_EXEC, + ADDR_LIMIT_32BIT, SHORT_INODE, WHOLE_SECONDS, STICKY_TIMEOUTS, + and ADDR_LIMIT_3GB. + +2015-12-24 Dmitry V. Levin + + arc, metag, nios2, or1k, tile: fix build. + Fix build regression introduced by commit + 34683e3926d8c2daa368afb805da422ee7043396. + + * linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap. + * linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff. + * linux/nios2/syscallent.h: Likewise. + * linux/or1k/syscallent.h: Likewise. + * linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff. + * pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap. + * NEWS: Mention this build fix. + + Reported-by: Alexey Brodkin + +2015-12-24 Dmitry V. Levin + + packages: remove acl development library from build dependencies. + Starting with commit v4.9-46-g681452b that removed all references + to acl.h, we no longer use acl development library. + + * .travis.yml (addons.apt.packages): Remove libacl1-dev. + * strace.spec (BuildRequires): Remove libacl-devel. + +2015-12-23 Dmitry V. Levin + + packages/x86_64: enable experimental -k option. + * debian/control (Build-Depends) [amd64]: Add libunwind-dev. + * strace.spec (BuildRequires) [x86_64]: Add libunwind-devel. + + maint: post-release administrivia. + * NEWS: Add header line for the next release. + +2015-12-21 Dmitry V. Levin + + Prepare for 4.11 release. + * NEWS: Update for 4.11 release. + * debian/changelog: 4.11-1. + * strace.spec: 4.11-1. + +2015-12-20 Dmitry V. Levin + + Sync strace.spec and debian/ with packages. + * debian/changelog: Sync with 4.10-3. + * debian/control: Likewise. + * debian/rules: Likewise. + * strace.spec: Sync with 4.10-3. + + .mailmap: add addresses of Kirill A. Shutemov. + * .mailmap: Add both addresses of Kirill A. Shutemov here + to avoid duplications in CREDITS file. + +2015-12-19 Dmitry V. Levin + + NEWS: Prepare for 4.11 release. + +2015-12-18 Dmitry V. Levin + + ia64: wire up mlock2 syscall. + * linux/ia64/syscallent.h [1346]: Add mlock2 entry. + +2015-12-17 Dmitry V. Levin + + Add copyright headers to some files which lack them. + Before this change, all files that exist since 20th century had + copyright headers, while most files that appeared later didn't. This + change fixes the inconsistency by adding missing copyright headers. + + It doesn't mean that copyright headers became maintained. In my view, + git history provides much better information on this subject and is much + more accurate than copyright headers. + +2015-12-16 Dmitry V. Levin + + tests/aio.c: include + * tests/aio.c: Include for struct timespec. + + Reported-by: Szabolcs Nagy + +2015-12-16 Dmitry V. Levin + + mpers.sh: switch to DWARF version 2 format for better portability. + * mpers.sh (CFLAGS): Replace -gdwarf-4 with -gdwarf-2. + + mpers.awk: add support for DWARF version 2 format. + * mpers.awk: Handle DW_AT_data_member_location in DWARF v2 format. + +2015-12-16 Dmitry V. Levin + + Replace %Ld/%Lu printf format specifiers with %lld/%llu. + As %Ld and %Lu printf format specifiers are not quite portable, + replace them with %lld and %llu, respectively. + + * desc.c (SYS_FUNC(pselect6)): Replace %Lu with %llu. + * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Likewise. + * times.c (SYS_FUNC(times)): Likewise. + * fcntl.c (print_struct_flock64): Replace %Ld with %lld. + * tests/ftruncate.c (main): Replace %Lu with %llu. + * tests/ftruncate64.c (main): Likewise. + * tests/getdents.c (print_dirent): Likewise. + * tests/llseek.c (main): Likewise. + * tests/lseek.c (main): Likewise. + * tests/truncate.c (main): Likewise. + * tests/truncate64.c (main): Likewise. + * tests/xstatx.c (main): Likewise. + * tests/pselect6.c (main): Replace %Ld with %lld. + * tests/xselect.c(main): Likewise. + + Reported-by: Szabolcs Nagy + +2015-12-16 Szabolcs Nagy + + Fix SYS_FUNC and SEN macros for musl. + The syscall_name argument was subject to macro expansion because + it was passed down to other macros before it was prefixed. + + musl libc defines lfs64 names as macros (e.g. fstat64 as fstat) + so SYS_FUNC(fstat64) was expanded to sys_fstat. + + This change adds the prefix before the name is passed to other macros, + i.e. the argument of SYS_FUNC_NAME is already prefixed with sys_. + + * defs.h (SYS_FUNC): Add sys_ prefix to SYS_FUNC_NAME's argument. + (SYS_FUNC_NAME): Do not add sys_ prefix to MPERS_FUNC_NAME's argument. + * linux/ia64/syscallent.h (SYS_FUNC_NAME): Do not add sys_ prefix + to MPERS_FUNC_NAME's argument. + * syscall.c (SEN_NAME): Remove. + (SEN): Replace SEN_NAME call with its definition. Add sys_ prefix + to SYS_FUNC_NAME's argument. + +2015-12-15 Dmitry V. Levin + + tests/times.test: workaround libc bug on x32. + As glibc times wrapper on x32 is known to wrongly truncate and then sign + extend the syscall return value, invoke the syscall directly on x32. + + * tests/times.c (main) [__NR_times && __x86_64__ && __ILP32__]: + Invoke times syscall using inline asm. + +2015-12-15 Dmitry V. Levin + + mpers.awk: make fillers added to the output structure more predictable. + * mpers.awk (array_seq): New function. + (what_is): Use it for printing filler names. Tweak return types. + * mpers_test.sh: Use a more complicated sample type to test mpers + machinery. + +2015-12-15 Dmitry V. Levin + + Robustify mpers.awk against input containing index loops. + Make mpers.awk check for potential index loops. Such loops should not + normally happen, but mpers.awk will not go into infinite recursion if + they do. + + * mpers.awk (enter, leave): New functions. + (what_is): Use them. + +2015-12-15 Dmitry V. Levin + + Robustify mpers.awk against invalid input. + Make mpers.awk check that accessed elements of the main array that + are expected to have non-empty values really meet this requirement. + + * mpers.awk (array_get): New function. + (what_is, END): Use it. + * mpers_test.sh: Use a more complicated type to test mpers machinery. + + Reported-by: Mike Frysinger + +2015-12-14 Dmitry V. Levin + + Replace HAVE_LITTLE_ENDIAN_LONG_LONG with WORDS_BIGENDIAN. + * defs.h: Use WORDS_BIGENDIAN instead of HAVE_LITTLE_ENDIAN_LONG_LONG. + * configure.ac (AC_LITTLE_ENDIAN_LONG_LONG): Remove. + * m4/long_long.m4: Remove. + +2015-12-14 Dmitry V. Levin + + Remove unused parser of xmknod syscall. + The last reference to this parser was removed by commit + v4.10-45-gdf4dd8b. + + * mknod.c [SPARC || SPARC64] (SYS_FUNC(xmknod)): Remove. + +2015-12-13 Dmitry V. Levin + + tests/restart_syscall: add a workaround for old arm kernels. + As arm kernels used to overwrite ARM_r0 with -EINTR after + ERESTART_RESTARTBLOCK, update regexp to workaround this. + + * tests/restart_syscall.c (main) [__arm__]: Add 0xfffffffc as a valid + alternative value for the first argument of restarted nanosleep syscall. + +2015-12-12 Dmitry V. Levin + + tests/.gitignore: add ksysent.h. + tests/ksysent.h is a generated file listed in CLEANFILES. + This change complements commit v4.10-566-gbab4ef4. + + * tests/.gitignore: Add ksysent.h. + +2015-12-11 Dmitry V. Levin + + aarch64: make arm registers unsigned. + Follow the x86_64 example and define registers in arm_pt_regs + as unsigned, to avoid potential sign extension bugs. + + This also fixes --enable-gcc-Werror build. + + * linux/aarch64/arch_regs.c (arm_pt_regs): Change uregs's type + from int to uint32_t. + + Reported-by: Sergey Bolshakov + +2015-12-10 Dmitry V. Levin + + tests: add ksysent.test. + Check that syscall names and numbers defined in syscallent files + match kernel __NR_* constants defined by . + + Tested on various platforms, including the following combinations + of architectures and kernel headers: + + x86_64: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.12, 3.11, + 3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel + i386: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.11, + 3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel + aarch64: 4.4-rc + alpha: 4.3 + arm eabi: 4.4-rc, 4.2, 4.1 + hppa: 3.18 + ia64: 3.18 + mips o32: 4.1 + ppc: 3.18 + ppc64: 3.10-rhel, 2.6.32-rhel + s390: 3.18 + s390x: 3.18 + sparc: 4.1 + sparc: 3.18 + x32: 3.19 + + The only platform which is known at this moment to fail the test + is CentOS-5 provided by OBS. On x86_64 instance it fails with + error: "prlimit64" syscall #300 is "fanotify_init" in syscallent.h + and on i586 it similarly fails with + error: "prlimit64" syscall #338 is "fanotify_init" in syscallent.h + So this is a real platform bug that is not likely to be worked around + on the strace side. + + * tests/ksysent.c: New file. + * tests/ksysent.sed: Likewise. + * tests/ksysent.test: New test. + * tests/Makefile.am (AM_CPPFLAGS): Add -I$(builddir). + (check_PROGRAMS): Add ksysent. + (TESTS): Add ksysent.test. + (EXTRA_DIST): Add ksysent.sed. + (ksysent.h): New rule. + (BUILT_SOURCES, CLEANFILES): Add ksysent.h. + * tests/.gitignore: Add ksysent. + +2015-12-09 Dmitry V. Levin + + Document that syscall names match kernel __NR_* constants. + * strace.1: Note syscall naming difference between architectures + and the rule of choosing the right syscall name in each case. + +2015-12-09 Dmitry V. Levin + + ia64: print all ia32 syscalls using printargs. + Printing of ia32 syscalls on ia64 must have been broken for a long time. + Do not pretend that it works, print ia32 syscalls using printargs + instead. + + * linux/ia64/syscallent.h: Remove all redefinitions of sys_* macros. + Stop including"../dummy.h". Include "../i386/syscallent.h" with + SYS_FUNC_NAME macro temporarily redirected to printargs. + +2015-12-09 Dmitry V. Levin + + Fix build on architectures for which arch_sigreturn is not implemented. + This complements commit 527b42ff8da3f52fa7c48eb766b2b57fb0f0b977. + + * linux/arch_sigreturn.c (arch_sigreturn): Define. + +2015-12-09 Dmitry V. Levin + + aarch64: swap 64-bit and 32-bit personalities. + Let native 64-bit personality be personality 0, and 32-bit personality + be personality 1, to follow the traditional layout used for other + architectures. + + * defs.h [AARCH64]: Swap PERSONALITY0_WORDSIZE and + PERSONALITY1_WORDSIZE, remove DEFAULT_PERSONALITY. + [AARCH64 && HAVE_M32_MPERS]: Rename PERSONALITY1_* to PERSONALITY0_*. + * file.c [AARCH64 || defined X86_64 || defined X32]: Define + STAT32_PERSONALITY for AARCH64 as well. + * syscall.c (update_personality) [AARCH64]: Adjust PERSONALITY_NAMES. + * linux/aarch64/errnoent1.h: Adjust comment. + * linux/aarch64/get_error.c (get_error): Adjust tcp->currpers check. + * linux/aarch64/get_syscall_args.c (get_syscall_args): Likewise. + * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Likewise. + * linux/aarch64/get_scno.c (arch_get_scno): Adjust update_personality + invocations. + * linux/aarch64/ioctls_arch0.h: Swap with ... + * linux/aarch64/ioctls_arch1.h: ... this file. + * linux/aarch64/ioctls_inc0.h: Swap with ... + * linux/aarch64/ioctls_inc1.h: ... this file. + * linux/aarch64/syscallent.h: Swap with ... + * linux/aarch64/syscallent1.h: ... this file. + +2015-12-08 Dmitry V. Levin + + mips: fix fadvise64 syscall entries. + * linux/mips/syscallent-n32.h [6216]: Change syscall handler + from fadvise64 to fadvise64_64. + * linux/mips/syscallent-n64.h [5215]: Rename from "fadvise64_64" + to "fadvise64" + * linux/mips/syscallent-o32.h [4254]: Likewise. + + xtensa: wire up syncfs syscall. + * linux/xtensa/syscallent.h [179]: Add syncfs entry. + + sh, sh64: fix syscall entries. + * linux/sh/syscallent.h [322]: Fix timerfd_create entry. + * linux/sh64/syscallent.h [350]: Likewise. + [0]: Fix restart_syscall entry. + + powerpc, powerpc64: wire up mlock2 syscall. + * linux/powerpc/syscallent.h [378]: Add mlock2 entry. + * linux/powerpc64/syscallent.h: Likewise. + + hppa: fix syscall entries. + * linux/hppa/syscallent.h: Swap [343] and [344] entries. + + avr32: update syscall entries. + * linux/avr32/syscallent.h [0]: Rename from setup to restart_syscall. + [284 ... 320]: New entries. + + m68k: fix syscall names. + * linux/m68k/syscallent.h [335]: Rename "atomic_comxchg_32" + to "atomic_cmpxchg_32". + + sparc: update syscall names. + * linux/sparc/syscallent.h [160]: Rename "sched_setaffinity" + to "sched_set_affinity". + [161]: Rename "sched_getaffinity" to "sched_get_affinity". + + powerpc, powerpc64: update syscall names. + * linux/powerpc/syscallent.h [201]: Rename "MOL" to "multiplexer". + [225]: Rename "tux" to "tuxcall". + [256]: Rename "debug_setcontext" to "sys_debug_setcontext". + * linux/powerpc64/syscallent.h: Likewise. + + alpha: update syscall entries. + * linux/alpha/syscallent.h [224 ... 228]: Add stub entries. + [100]: Rename "osf_getpriority" to "getpriority". + [255]: Rename "osf_subsysinfo" to "osf_subsys_info". + [303]: Rename "adjtimex32" to "old_adjtimex". + [319]: Rename "sysctl" to "_sysctl". + [320]: Remove. + +2015-12-08 Dmitry V. Levin + + Fix mmap syscall entries. + Change syscall names to match kernel __NR_* constants. + + * linux/avr32/syscallent.h [90]: Rename "mmap" to "mmap2". + * linux/bfin/syscallent.h [90]: Rename "old_mmap" to "mmap". + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * tests/mmap.c (main): Remove old_mmap from expected output. + * tests/mmap.test: Remove old_mmap from the list of mmap syscalls. + +2015-12-08 Dmitry V. Levin + + Fix select and _newselect syscall entries. + Change syscall names to match kernel __NR_* constants. + This reverts commit ddcf54969d253582ab2cfdcab8ede9cdae3fb171. + + * linux/arm/syscallent.h [82]: Rename "oldselect" to "select". + [142]: Rename "select" to "_newselect". + * linux/bfin/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/powerpc/syscallent.h [82]: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/hppa/syscallent.h [142]: Rename "select" to "_newselect". + * linux/mips/syscallent-n32.h [6022]: Rename "select" to "_newselect". + * linux/mips/syscallent-n64.h [5022]: Likewise. + * linux/mips/syscallent-o32.h [4142]: Likewise. + * linux/s390/syscallent.h [142]: Rename "select" to "_newselect". + * linux/sparc/syscallent.h [230]: Rename "select" to "_newselect". + * tests/oldselect.test: Rename oldselect to select. Convert + from match_grep to match_diff. + * tests/oldselect.expected: Likewise. + * xselect.c: New file, based on select.c. + * tests/_newselect.c: New file. + * tests/select.c: Replace with a wrapper around xselect.c. + * tests/select.test: Parametrize. + * tests/_newselect.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add _newselect. + (TESTS): Add _newselect.test. + (EXTRA_DIST): Add xselect.c. + * tests/.gitignore: Add _newselect. + +2015-12-08 Dmitry V. Levin + + Fix exit syscall entries. + Change syscall names to match kernel __NR_* constants. + + * linux/avr32/syscallent.h [1]: Rename "_exit" to "exit". + * linux/bfin/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/x32/syscallent.h [60]: Rename "_exit" to "exit". + * linux/x86_64/syscallent.h: Likewise. + +2015-12-08 Dmitry V. Levin + + Fix pread64 and pwrite64 syscall entries. + Change syscall names to match kernel __NR_* constants. + + * linux/alpha/syscallent.h [349]: Rename "pread" to "pread64". + [350]: Rename "pwrite" to "pwrite64". + * linux/ia64/syscallent.h [1148]: Rename "pread" to "pread64". + [1149]: Rename "pwrite" to "pwrite64". + * linux/sh/syscallent.h [180]: Rename "pread" to "pread64". + [181]: Rename "pwrite" to "pwrite64". + * linux/sh64/syscallent.h: Likewise. + * linux/x32/syscallent.h [17]: Rename "pread" to "pread64". + [18]: Rename "pwrite" to "pwrite64". + * linux/x86_64/syscallent.h: Likewise. + +2015-12-08 Dmitry V. Levin + + tests: sort the list of tests. + * tests/Makefile.am (TESTS): Sort the list of regular tests. + * tests/.gitignore: Sort. + + ia64: fix remap_file_pages syscall entry. + * linux/ia64/syscallent.h (1125): Set to remap_file_pages. + + bfin, i386: remove sysentry for nonexistent security syscall. + * linux/bfin/syscallent.h (223): Remove. + * linux/i386/syscallent.h: Likewise. + + build: add -D_FILE_OFFSET_BITS=64 to _CPPFLAGS instead of _CFLAGS. + * tests/Makefile.am (fstat64_CFLAGS): Rename to fstat64_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (fstatat64_CFLAGS): Rename to fstatat64_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (ftruncate64_CFLAGS): Rename to ftruncate64_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (lstat64_CFLAGS): Rename to lstat64_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (mmap64_CFLAGS): Rename to mmap64_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (newfstatat_CFLAGS): Rename to newfstatat_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (stat64_CFLAGS): Rename to stat64_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (statfs_CFLAGS): Rename to statfs_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (truncate64_CFLAGS): Rename to truncate64_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + (uio_CFLAGS): Rename to uio_CPPFLAGS, + replace $(AM_CFLAGS) with $(AM_CPPFLAGS). + +2015-12-08 Dmitry V. Levin + + Move x32 replacement to x32 specific directory. + As tests-m*32/Makefile.am files now refer to proper arch specific + directories, it's possible to relocate x32 replacement + to its arch specific directory. + + * linux/x86_64/asm_stat.h: Move ... + * linux/x32/asm_stat.h: ... here, remove x32 guard. + * Makefile.am (strace_SOURCES): Remove linux/x86_64/asm_stat.h. + +2015-12-08 Dmitry V. Levin + + build: set arch specific -m switches in tests-m*32/Makefile.am files properly + * tests/Makefile.am (ARCH_MFLAGS, AM_LDFLAGS): New variables. + (AM_CPPFLAGS): Use ARCH_MFLAGS. + * bootstrap: In tests-m32/Makefile.am and tests-mx32/Makefile.am, + add -m32 and -mx32, respectively, to ARCH_MFLAGS instead of AM_CFLAGS. + + build: initialize ARCH variable in tests-m*32/Makefile.am files properly + * configure.ac (arch_m32): Set to sparc on sparc64, powerpc on + powerpc64, arm on aarch64, i386 on x86_64 and x32, $arch in other cases. + (arch_mx32): Set to x32 on x86_64, $arch in other cases. + (AC_SUBST): Add arch_m32 and arch_mx32. + * bootstrap: Substitute @arch@ with @arch_m32@ in tests-m32/Makefile.am. + Substitute @arch@ with @arch_mx32@ in tests-mx32/Makefile.am. + +2015-12-07 Dmitry V. Levin + + tests: add umount.test and umount2.test. + * tests/umount.c: New file. + * tests/umount2.c: Likewise. + * tests/umount.test: New test. + * tests/umount2.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add umount and umount2. + (TESTS): Add umount.test and umount2.test. + * tests/.gitignore: Add umount and umount2. + + avr32: fix umount2 syscall entry. + * linux/avr32/syscallent.h: Rename umount to umount2. + + Update umount2 flags. + * umount.c (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): Move definitions ... + * xlat/umount_flags.in: ... here. Add UMOUNT_NOFOLLOW. + +2015-12-07 Dmitry V. Levin + + Print the first argument of umount2 syscall as a path. + * umount.c (SYS_FUNC(umount2)): Use printpath instead of printstr. + + This fixes Debian bug #785050. + +2015-12-06 Dmitry V. Levin + + prctl: add PR_CAP_AMBIENT parser. + * xlat/pr_cap_ambient.in: New file. + * prctl.c: Include "xlat/pr_cap_ambient.h". + (SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT. + + prctl: finish decoding of several commands on entering syscall. + * prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of + PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, + PR_GET_TIMING, and PR_CAPBSET_READ commands. + + Fix build on systems that lack EM_FRV definition. + * xlat/audit_arch.in: Guard AUDIT_ARCH_FRV with EM_FRV check. + + times.test: workaround buggy libc. + * tests/times.c: Include . + (main): On systems where user's and kernel's long types are the same, + prefer direct times syscall over libc's times function because + the latter is more prone to return value truncation. + + times.test: reduce cpu time consumption, increase struct tms diversity. + * tests/times.c (main): Reduce cpu time consumption fourfold, + make the parent process consume less cpu time than the child process + so that members of the structure returned by times syscall would be + more likely to contain different values. + +2015-12-06 Dmitry V. Levin + + mips n32, x32: fix printing of times syscall return value. + As times syscall returns kernel's long value, it has to be printed as + RVAL_LUDECIMAL on systems where long type is less than kernel's long. + + * times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]: + Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL. + +2015-12-06 Dmitry V. Levin + + unix-yy.test: fix portability issue. + * tests/unix-yy-connect.awk (r_close_listen): Quote square brackets + that are not part of a bracket expression. + + inet-cmsg.test: skip the test when the network is not functional. + * tests/inet-cmsg.c (main): Return 77 if inet datagram socket + cannot be bound to INADDR_LOOPBACK. + +2015-12-05 Dmitry V. Levin + + fcntl: skip F_GETLK64, F_SETLK64, and F_SETLKW64 in fcntl syscall parser + As the kernel recognizes F_GETLK64, F_SETLK64, and F_SETLKW64 commands + in fcntl64 syscall only, do not parse their structures in fcntl parser. + + * xlat/fcntlcmds.in: Move F_GETLK64, F_SETLK64, and F_SETLKW64 ... + * xlat/fcntl64cmds.in: ... here. + * fcntl.c: Include "xlat/fcntl64cmds.h". + (print_fcntl): Move printing of first two syscall arguments + and handling of F_GETLK64, F_SETLK64, and F_SETLKW64 commands ... + (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): ... here. + * tests/fcntl.c: New file, based on struct_flock.c. + * tests/fcntl64.c: Likewise. + * tests/struct_flock.c (test_flock_einval, create_sample): New functions. + (test_flock): Use test_flock_einval. + (test_flock64, main): Remove. + * tests/fcntl.test: New test. + * tests/fcntl64.test: Likewise. + * tests/struct_flock.test: Remove. + * tests/Makefile.am (check_PROGRAMS): Add fcntl and fcntl64, + remove struct_flock. + (TESTS): Add fcntl.test and fcntl64.test, remove struct_flock.test. + (EXTRA_DIST) Add struct_flock.c. + * tests/.gitignore: Add fcntl and fcntl64, remove struct_flock. + +2015-12-05 Dmitry V. Levin + + print_fcntl: finish with unrecognized commands on entering syscall. + * fcntl.c (print_fcntl): Merge two switch statements. + +2015-12-04 Elvira Khabirova + + fcntl: create a separate parser for fcntl64 syscall. + * fcntl.c(print_fcntl): New function, made from SYS_FUNC(fcntl). + (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use it. + * linux/32/syscallent.h: Change parser of fcntl64 to SEN(fcntl64). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + +2015-12-05 Dmitry V. Levin + + travis-ci: add build matrix. + + tests: replace old stat tests with stat.test and stat64.test. + * tests/stat.c: Replace with a wrapper around lstatx.c + * tests/stat.test: Replace with a wrapper around statx.sh. + * tests/stat32-v.test: Remove. + * tests/stat32.c: Remove. + * tests/stat64-v.test: Remove. + * tests/stat64.c: New file. + * tests/stat64.test: New test. + * tests/Makefile.am (check_PROGRAMS): Replace stat32 with stat64. + (stat_CFLAGS): Rename to stat64_CFLAGS. + (TESTS): Replace stat32-v.test and stat64-v.test with stat64.test. + * tests/.gitignore: Replace stat32 with stat64. + + tests: add lstat.test and lstat64.test. + * tests/lstat.c: New file. + * tests/lstat64.c: Likewise. + * tests/lstatx.c: Likewise. + * tests/lstat.test: New test. + * tests/lstat64.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add lstat and lstat64. + (lstat64_CFLAGS): Define. + (TESTS): Add lstat.test and lstat64.test. + (EXTRA_DIST): Add lstatx.c. + * tests/.gitignore: Add lstat and lstat64. + + tests: add fstat.test and fstat64.test. + * tests/fstat.c: New file. + * tests/fstat64.c: Likewise. + * tests/fstatx.c: Likewise. + * tests/fstat.test: New test. + * tests/fstat64.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add fstat and fstat64. + (fstat64_CFLAGS): Define. + (TESTS): Add fstat.test and fstat64.test. + (EXTRA_DIST): Add fstatx.c. + * tests/.gitignore: Add fstat and fstat64. + +2015-12-05 Dmitry V. Levin + + tests: prepare for detailed testing of stat family syscalls. + Parametrize code from fstatat.c to support + as an alternative to and move it to a separate file. + + * tests/statx.sh: New file, based on fstatat64.test. + * tests/fstatat64.test: Use it. + * tests/newfstatat.test: Likewise. + * tests/xstatx.c: New file, based on fstatat.c. + * tests/fstatat.c: Use it. + * tests/Makefile.am (EXTRA_DIST): Add statx.sh and xstatx.c. + * tests/fstatat64.c (FSTATAT_NAME): Change to TEST_SYSCALL_NAME. + * tests/newfstatat.c: Likewise. + +2015-12-04 Gabriel Laskar + + 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 + +2015-12-04 Dmitry V. Levin + + tests: skip restart_syscall.test on x32. + The syscall number of restart_syscall returned by the kernel in case + of ERESTART_RESTARTBLOCK is broken on x32 from the beginning, see + https://lkml.org/lkml/2015/11/30/790 + + Until that improves, skip the test on x32. + + * tests/restart_syscall.c (main) [__x86_64__ && __ILP32__]: Return 77. + +2015-12-04 Dmitry V. Levin + + x32: fix decoding of i386 personality lseek syscall. + On x32, tcp->ext_arg is not initialized for i386 personality, + so tcp->u_arg has to be used instead. + + * lseek.c (SYS_FUNC(lseek)) [X32]: Handle "current_personality == 1" case. + +2015-12-04 Dmitry V. Levin + + x86_64, x32: add a replacement for + Some old kernel headers, Ubuntu 14.04 in particular, provide + editions that are completely wrong for x32. + Workaround this issue by providing a replacement. + + * linux/x86_64/asm_stat.h: New file. + * linux/x32/asm_stat.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + +2015-12-04 Dmitry V. Levin + + Add a wrapper around + * linux/asm_stat.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Use it. + + kernel_types.h: protect from double inclusion. + * kernel_types.h: Add #include guard. + +2015-12-03 Dmitry V. Levin + + fstatat64.test: lift /proc requirement. + While -P option needs /proc to match descriptors, it does not use + /proc to match pathnames. As this test does not need descriptor + match, the /proc requirement can be safely lifted. + + * tests/fstatat64.test: Lift /proc/self/fd/ requirement. + +2015-12-02 Dmitry V. Levin + + tests: add fstatat64.test and newfstatat.test. + * configure.ac (AC_CHECK_FUNCS): Add fstatat, ftruncate, and futimens. + * tests/fstatat.c: New file. + * tests/fstatat64.c: Likewise. + * tests/newfstatat.c: Likewise. + * tests/fstatat64.test: New test. + * tests/newfstatat.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add fstatat64 and newfstatat. + (fstatat64_CFLAGS, newstatat_CFLAGS): Define. + (TESTS): Add fstatat64.test and newfstatat.test. + (EXTRA_DIST): Add fstatat.c. + * tests/.gitignore: Add fstatat64 and newfstatat. + +2015-12-01 Dmitry V. Levin + + alpha, ppc, sh, sh64: fix fstatat64 syscall entries. + * linux/alpha/syscallent.h (newfstatat): Change sys_name to fstatat64. + * linux/powerpc/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + + ppc64: clone syscallent.h from ppc. + * linux/powerpc64/syscallent.h: Clone from linux/powerpc/syscallent.h + with entries for numbers 192..197, 204, 226, and 254 unassigned. + + tests: add lseek.test and llseek.test. + * tests/llseek.c: New file. + * tests/lseek.c: Likewise. + * tests/llseek.test: New test. + * tests/lseek.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add llseek and lseek. + (TESTS): Add llseek.test and lseek.test. + * tests/.gitignore: Add llseek and lseek. + + tests: add ftruncate64.test and truncate64.test. + * tests/ftruncate64.c: New file. + * tests/truncate64.c: Likewise. + * tests/ftruncate64.test: New test. + * tests/truncate64.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add ftruncate64 and truncate64. + (ftruncate64_CFLAGS, truncate64_CFLAGS): Define. + (TESTS): Add ftruncate64.test and truncate64.test. + * tests/.gitignore: Add ftruncate64 and truncate64. + + tests: add ftruncate.test and truncate.test. + * tests/ftruncate.c: New file. + * tests/truncate.c: Likewise. + * tests/ftruncate.test: New test. + * tests/truncate.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add ftruncate and truncate. + (TESTS): Add ftruncate.test and truncate.test. + * tests/.gitignore: Add ftruncate and truncate. + +2015-11-30 Dmitry V. Levin + + build: robustify linux/fcntl.h check. + * configure.ac (AC_CHECK_TYPES): Support older linux kernel headers + by including before . + +2015-11-30 Dmitry V. Levin + + syscall.c: move inclusion of arch specific files to the end of file. + Move inclusion of arch specific files that define static functions to + the end of syscall.c. + + * syscall.c (get_syscall_result_regs, get_error, getregs_old): + New forward declarations. + (arch_get_scno): Move forward. + Move inclusion of "get_scno.c", "get_syscall_args.c", + "get_syscall_result.c", "get_error.c", and "getregs_old.c" + to the end of file. + +2015-11-30 Dmitry V. Levin + + x86_64: change getregs_old to forward ptrace return code. + * linux/x86_64/getregs_old.c (getregs_old): Change to return ptrace + return code. + * syscall.c (get_regs) [ARCH_REGS_FOR_GETREGSET && X86_64]: Use + getregs_old return code. + +2015-11-30 Dmitry V. Levin + + Cleanup print_pc. + Apparently, there are only two types of instruction pointer printers + depending on the architecture: those that print a register that was + fetched earlier, and those that fetch a register themselves using upeek. + With this change, architectures of the first type have ARCH_PC_REG + defined in their arch_regs.c file, architectures of the first type + have ARCH_PC_PEEK_ADDR defined there, and the common code in syscall.c + uses these macros to print the instruction pointer. + + * Makefile.am (EXTRA_DIST): Remove linux/*/print_pc.c. + * linux/*/print_pc.c: Remove. + * linux/aarch64/arch_regs.c(ARCH_PC_REG): Define macro. + * linux/arc/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/arm/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/avr32/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/i386/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/ia64/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/metag/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/mips/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/nios2/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/or1k/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/powerpc64/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/powerpc/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/s390/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/s390x/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/sparc64/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/sparc/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/tile/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/x32/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/x86_64/arch_regs.c(ARCH_PC_REG): Likewise. + * linux/alpha/arch_regs.c(ARCH_PC_PEEK_ADDR): Define macro. + * linux/bfin/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/crisv10/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/crisv32/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/hppa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/m68k/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/microblaze/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/sh64/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/sh/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * linux/xtensa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. + * syscall.c (print_pc): Stop including "print_pc.c". + Use ARCH_PC_REG or ARCH_PC_PEEK_ADDR. + +2015-11-30 Dmitry V. Levin + + cleanup: make get_scno.c files more readable. + Make get_scno.c files more self-contained. While they are still + being included by syscall.c, the latter no longer provides + a function framework for them. + + * linux/aarch64/get_scno.c (arch_get_scno): Define. + * linux/alpha/get_scno.c: Likewise. + * linux/arc/get_scno.c: Likewise. + * linux/arm/get_scno.c: Likewise. + * linux/avr32/get_scno.c: Likewise. + * linux/bfin/get_scno.c: Likewise. + * linux/crisv10/get_scno.c: Likewise. + * linux/hppa/get_scno.c: Likewise. + * linux/i386/get_scno.c: Likewise. + * linux/ia64/get_scno.c: Likewise. + * linux/m68k/get_scno.c: Likewise. + * linux/metag/get_scno.c: Likewise. + * linux/microblaze/get_scno.c: Likewise. + * linux/mips/get_scno.c: Likewise. + * linux/nios2/get_scno.c: Likewise. + * linux/or1k/get_scno.c: Likewise. + * linux/powerpc/get_scno.c: Likewise. + * linux/powerpc64/get_scno.c: Likewise. + * linux/s390/get_scno.c: Likewise. + * linux/sh/get_scno.c: Likewise. + * linux/sh64/get_scno.c: Likewise. + * linux/sparc/get_scno.c: Likewise. + * linux/sparc64/get_scno.c: Likewise. + * linux/tile/get_scno.c: Likewise. + * linux/x86_64/get_scno.c: Likewise. + * linux/xtensa/get_scno.c: Likewise. + * syscall.c (arch_get_scno): New declaration. + Include "get_scno.c" in file scope. + (get_scno): Use arch_get_scno. + + Requested-by: Denys Vlasenko + +2015-11-30 Dmitry V. Levin + + cleanup: make get_syscall_args.c files more readable. + Make get_syscall_args.c files more self-contained. While they are + still being included by syscall.c, the latter no longer defines + get_syscall_args function. + + * linux/aarch64/get_syscall_args.c: Include "arm/get_syscall_args.c" + with get_syscall_args temporarily defined to arm_get_syscall_args. + (get_syscall_args): Define. + * linux/alpha/get_syscall_args.c (get_syscall_args): Define. + * linux/arc/get_syscall_args.c: Likewise. + * linux/arm/get_syscall_args.c: Likewise. + * linux/avr32/get_syscall_args.c: Likewise. + * linux/bfin/get_syscall_args.c: Likewise. + * linux/crisv10/get_syscall_args.c: Likewise. + * linux/hppa/get_syscall_args.c: Likewise. + * linux/i386/get_syscall_args.c: Likewise. + * linux/ia64/get_syscall_args.c: Likewise. + * linux/m68k/get_syscall_args.c: Likewise. + * linux/metag/get_syscall_args.c: Likewise. + * linux/microblaze/get_syscall_args.c: Likewise. + * linux/mips/get_syscall_args.c: Likewise. + * linux/nios2/get_syscall_args.c: Likewise. + * linux/or1k/get_syscall_args.c: Likewise. + * linux/powerpc/get_syscall_args.c: Likewise. + * linux/s390/get_syscall_args.c: Likewise. + * linux/sh/get_syscall_args.c: Likewise. + * linux/sh64/get_syscall_args.c: Likewise. + * linux/sparc/get_syscall_args.c: Likewise. + * linux/tile/get_syscall_args.c: Likewise. + * linux/x86_64/get_syscall_args.c: Likewise. + * linux/xtensa/get_syscall_args.c: Likewise. + * syscall.c (get_syscall_args): Remove. + Include "get_syscall_args.c" in file scope. + + Requested-by: Denys Vlasenko + +2015-11-30 Dmitry V. Levin + + cleanup: make get_syscall_result.c files more readable. + Make get_syscall_result.c files more self-contained. While they are + still being included by syscall.c, the latter no longer provides + a function framework for them. + + * linux/alpha/get_syscall_result.c (get_syscall_result_regs): Define. + * linux/bfin/get_syscall_result.c: Likewise. + * linux/crisv10/get_syscall_result.c: Likewise. + * linux/hppa/get_syscall_result.c: Likewise. + * linux/m68k/get_syscall_result.c: Likewise. + * linux/microblaze/get_syscall_result.c: Likewise. + * linux/sh/get_syscall_result.c: Likewise. + * linux/sh64/get_syscall_result.c: Likewise. + * linux/xtensa/get_syscall_result.c: Likewise. + * syscall.c [!ARCH_REGS_FOR_GETREGSET && !ARCH_REGS_FOR_GETREGS]: + Define USE_GET_SYSCALL_RESULT_REGS macro. + [USE_GET_SYSCALL_RESULT_REGS]: Include "get_syscall_result.c". + (get_syscall_result) [USE_GET_SYSCALL_RESULT_REGS]: Stop including + "get_syscall_result.c". Call get_syscall_result_regs. + + Requested-by: Denys Vlasenko + +2015-11-29 Dmitry V. Levin + + cleanup: make get_error.c files more readable. + Make get_error.c files more self-sustained. While they are still being + included by syscall.c, the latter no longer defines get_error function. + + * linux/aarch64/get_error.c: Include "arm/get_error.c" with get_error + temporarily defined to arm_get_error. + (get_error): Define. + * linux/alpha/get_error.c (get_error): Define. + * linux/arc/get_error.c: Likewise. + * linux/arm/get_error.c: Likewise. + * linux/avr32/get_error.c: Likewise. + * linux/bfin/get_error.c: Likewise. + * linux/crisv10/get_error.c: Likewise. + * linux/hppa/get_error.c: Likewise. + * linux/i386/get_error.c: Likewise. + * linux/ia64/get_error.c: Likewise. + * linux/m68k/get_error.c: Likewise. + * linux/metag/get_error.c: Likewise. + * linux/microblaze/get_error.c: Likewise. + * linux/mips/get_error.c: Likewise. + * linux/nios2/get_error.c: Likewise. + * linux/or1k/get_error.c: Likewise. + * linux/powerpc/get_error.c: Likewise. + * linux/s390/get_error.c: Likewise. + * linux/sh/get_error.c: Likewise. + * linux/sh64/get_error.c: Likewise. + * linux/sparc/get_error.c: Likewise. + * linux/sparc64/get_error.c: Likewise. + * linux/tile/get_error.c: Likewise. + * linux/x86_64/get_error.c: Likewise. + * linux/xtensa/get_error.c: Likewise. + * syscall.c: Include "get_error.c" in file scope. + (get_error): Remove. Move arch independent code ... + (get_syscall_result): ... here. Update get_error invocation. + + Requested-by: Denys Vlasenko + +2015-11-28 Dmitry V. Levin + + cleanup: make arch_sigreturn.c files more readable. + Make arch_sigreturn.c files more self-sustained. While they are + still being included by sigreturn.c, the latter no longer defines + arch_sigreturn function. + + * linux/alpha/arch_sigreturn.c (arch_sigreturn): Define. + * linux/arm/arch_sigreturn.c: Likewise. + * linux/crisv10/arch_sigreturn.c: Likewise. + * linux/i386/arch_sigreturn.c: Likewise. + * linux/ia64/arch_sigreturn.c: Likewise. + * linux/m68k/arch_sigreturn.c: Likewise. + * linux/microblaze/arch_sigreturn.c: Likewise. + * linux/mips/arch_sigreturn.c: Likewise. + * linux/powerpc/arch_sigreturn.c: Likewise. + * linux/s390/arch_sigreturn.c: Likewise. + * linux/sparc/arch_sigreturn.c: Likewise. + * linux/tile/arch_sigreturn.c: Likewise. + * linux/x32/arch_sigreturn.c: Remove code. + Include "x86_64/arch_sigreturn.c". + * linux/x86_64/arch_sigreturn.c: Stop including "x32/arch_sigreturn.c". + Include "i386/arch_sigreturn.c" with arch_sigreturn temporarily defined + to i386_arch_sigreturn. + (arch_sigreturn): Define. Add x32 personality support there. + * sigreturn.c: Remove arch_sigreturn header and footer. + + Requested-by: Denys Vlasenko + +2015-11-26 Dmitry V. Levin + + Add initial Travis CI support. + * .travis.yml: New file. + * travis-ci.sh: Likewise. + +2015-11-27 Dmitry V. Levin + + tests: remove temporary files left after two tests. + * tests/net-yy.test: Remove "$LOG"-connect and "$LOG"-accept. + * tests/unix-yy.test: Likewise. + +2015-11-27 Dmitry V. Levin + + tests: skip stat32-v.test on x32. + Explicitly skip 32-bit stat test on x32 even if libc pretends + to support it. + + * tests/stat.c (main) [__x86_64__ && __ILP32__]: Skip. + +2015-11-27 Dmitry V. Levin + + tests: fix ipc_msgbuf.test on x32. + * tests/ipc_msgbuf.c: Include "config.h" and "kernel_types.h". + (main): Replace "long" with "kernel_long_t" in struct msgbuf. + + x32: fix pselect6 decoding. + * desc.c: Include "kernel_types.h". + (umove_kulong_array_or_printaddr): New function. + (SYS_FUNC(pselect6)): Use it. + + x32: fix sigreturn decoding. + * linux/x32/arch_sigreturn.c: Implement x32_rt_sigreturn decoding. + * linux/x86_64/arch_sigreturn.c: Handle (current_personality == 0) + case only. + Include "x32/arch_sigreturn.c" instead of "i386/arch_sigreturn.c". + + x32: fix struct dirent decoding. + * kernel_types.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * configure.ac (AC_CHECK_TYPES): Check for __kernel_long_t + and __kernel_ulong_t in . + * dirent.c: Stop including . + (kernel_dirent): Remove. + Include "kernel_types.h". + (print_old_dirent, SYS_FUNC(getdents)): Print variables + of kernel_ulong_t type using %Lu format. + * syscall.c (kernel_long_t, kernel_ulong_t): Remove. + Include "kernel_types.h". + * tests/getdents.c (kernel_dirent): Remove. + Include "kernel_types.h". + (print_dirent): Print variables of kernel_ulong_t type using %Lu format. + +2015-11-26 Elvira Khabirova + + Refer to -h on incorrect usage. + * defs.h (error_msg_and_help): New prototype. + * strace.c (error_msg_and_help): New function. + (error_opt_arg, init): Use it. + (usage): Remove unnecessary arguments. + * count.c: Use the new function. + + Rearrange flags descriptions in the usage text. + * strace.c (usage): Rearrange descriptions. + * tests/strace-k.test: Change the option detecting regexp accordingly. + +2015-11-26 Dmitry V. Levin + + tests: run in "set -x" mode if VERBOSE variable is non-null. + * tests/init.sh: Enter "set -x" mode if $VERBOSE is non-null. + +2015-11-26 Dmitry V. Levin + + tests: fix match_diff usage. + Fix argument order in match_diff invocations: + the first argument has to be actual output, + the second argument has to be expected output. + + * tests/aio.test: Swap match_diff arguments. + * tests/clock_nanosleep.test: Likewise. + * tests/clock_xettime.test: Likewise. + * tests/file_handle.test: Likewise. + * tests/getdents.test: Likewise. + * tests/getdents64.test: Likewise. + * tests/getrandom.test: Likewise. + * tests/inet-cmsg.test: Likewise. + * tests/ioctl.test: Likewise. + * tests/membarrier.test: Likewise. + * tests/mlock2.test: Likewise. + * tests/nanosleep.test: Likewise. + * tests/pselect6.test: Likewise. + * tests/readdir.test: Likewise. + * tests/readlink.test: Likewise. + * tests/readlinkat.test: Likewise. + * tests/rt_sigqueueinfo.test: Likewise. + * tests/seccomp.test: Likewise. + * tests/select.test: Likewise. + * tests/sendfile.test: Likewise. + * tests/sendfile64.test: Likewise. + * tests/struct_flock.test: Likewise. + * tests/sysinfo.test: Likewise. + * tests/time.test: Likewise. + * tests/timer_create.test: Likewise. + * tests/timer_xettime.test: Likewise. + * tests/timerfd_xettime.test: Likewise. + * tests/times-fail.test: Likewise. + * tests/times.test: Likewise. + * tests/umovestr2.test: Likewise. + * tests/userfaultfd.test: Likewise. + * tests/utime.test: Likewise. + * tests/utimensat.test: Likewise. + * tests/xet_robust_list.test: Likewise. + * tests/xetitimer.test: Likewise. + * tests/xettimeofday.test: Likewise. + +2015-11-26 Dmitry V. Levin + + x86_64: fix x32 personality support in print_llu_from_low_high_val. + x86 is the only personality supported on x86_64 + that has 32-bit syscall arguments. + + * io.c (print_llu_from_low_high_val) [X86_64]: Fix + current_personality == 2 case. + +2015-11-26 Dmitry V. Levin + + x86_64: fix x32 personality support in getllval. + x86 is the only personality supported on x86_64 + that has 32-bit syscall arguments. + + * util.c (getllval) [X86_64]: Fix current_personality == 2 case. + +2015-11-26 Dmitry V. Levin + + tests/file_handle: fix expected output. + * tests/file_handle.c (main): Parametrize handle_type + in open_by_handle_at parser output. + + startup_attach: fix compilation warning. + * strace.c (startup_attach): Split single error_msg statement with + variable number of arguments to silence a compilation warning. + +2015-11-26 Dmitry V. Levin + + .gitignore: add mpers_xlat.h. + Ignore mpers_xlat.h generated since commit v4.10-454-g5cb45b2. + + * .gitignore: Add /mpers_xlat.h. + + Reported-by: Elvira Khabirova + +2015-11-26 Dmitry V. Levin + + tests: add struct_flock.test. + * tests/struct_flock.c: New file. + * tests/struct_flock.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add struct_flock. + (TESTS): Add struct_flock.test. + * tests/.gitignore: Add struct_flock. + + Convert parsers of flock structures to new mpers infrastructure. + * fetch_struct_flock.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * fcntl.c (print_struct_flock64): New function. + (printflock64): Use fetch_struct_flock64 and print_struct_flock64. + (printflock): Use fetch_struct_flock and print_struct_flock64. + + fcntl.c: implement decoding for all known operations. + * xlat/f_owner_types.in: New file. + * xlat/f_seals.in: Likewise. + * fcntl.c: Include "xlat/f_owner_types.h" and "xlat/f_seals.h". + (print_f_owner_ex): New function. + (SYS_FUNC(fcntl)): Use it. + Handle F_SETPIPE_SZ, F_GETPIPE_SZ, F_OFD_SETLKW, + F_OFD_SETLK, F_SETOWN_EX, F_ADD_SEALS, F_SETSIG, + F_OFD_GETLK, F_GETOWN_EX, F_GET_SEALS, F_GETSIG. + + fcntl.c: mark F_DUPFD and F_DUPFD_CLOEXEC return code with RVAL_FD flag. + * fcntl.c (SYS_FUNC(fcntl)): Set RVAL_FD flag in the return code + for F_DUPFD and F_DUPFD_CLOEXEC operations. + + fcntl.c: remove redundant ifdefs. + * fcntl.c (USE_PRINTFLOCK64): Remove macro. + (printflock64): Define unconditionally. + (SYS_FUNC(fcntl)): Do not check for USE_PRINTFLOCK64, + F_DUPFD_CLOEXEC, F_NOTIFY, F_SETLEASE, and F_GETLEASE macros. + + Update F_* constants. + * xlat/fcntlcmds.in: Add F_SETOWN_EX, F_GETOWN_EX, F_GETOWNER_UIDS, + F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, and F_CANCELLK. + Remove F_ALLOCSP, F_BLKSIZE, F_BLOCKS, F_CHKFL, F_CNVT, F_DUP2FD, + F_ISSTREAM, F_NPRIV, F_PRIV, F_QUOTACL, F_REVOKE, F_RGETLK, F_RSETLK, + F_RSETLKW, F_SHARE, and F_UNSHARE. + Add default values. + + Update LOCK_* constants. + * xlat/flockcmds.in: Add LOCK_MAND, LOCK_READ, LOCK_WRITE, and LOCK_RW. + Add default values. + +2015-11-26 Dmitry V. Levin + + fcntl.c: use instead of + Include for proper definitions of F_* constants + and flock structures. + + * configure.ac (AC_CHECK_TYPES): Check for struct flock, struct flock64, + struct __kernel_flock, and struct __kernel_flock64 in . + * flock.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * fcntl.c: Include it instead of . + (struct flock64): Remove. + (printflock): Use struct_kernel_flock instead of struct flock. + (printflock64): Use struct_kernel_flock64 instead of struct flock64. + +2015-11-26 Elvira Khabirova + + mpers: fix compound types with arbitrary member alignments. + * mpers.sh: Compound types are now represented as packed + with character arrays as explicit fillers inbetween members + and at the end. + +2015-11-26 Mike Frysinger + + Support C libraries without System V shared memory/ipc. + Some systems (like Bionic) omit support for SysV related code. That + means no C library headers for strace to include. Add configure tests + to probe the headers from the kernel and use them when they are + available. + + It might make more sense to never rely on the C library's headers as + there is no guarantee or requirement that the structure layout between + apps and the C library match that what is passed to the kernel. + + * configure.ac (AC_CHECK_HEADERS): Check for linux/ipc.h, + linux/mqueue.h, linux/msg.h, linux/sem.h, linux/shm.h, + sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h. + * ipc_defs.h: Include or depending + on what is available. + * ipc_msg.c: Replace with "ipc_defs.h". + Fallback to when available. + * ipc_msgctl.c: Include , , or + based on what is available. Note missing support for old ipc structs. + * ipc_sem.c: Include or depending + on what is available. Only decode sembuf when available. + * ipc_shm.c: Fallback to when available. + * ipc_shmctl.c: Include , , or + based on what is available. Note missing support for old ipc structs. + * print_mq_attr.c: Fallback to when available. + +2015-11-25 Dmitry V. Levin + + CREDITS.in: add Jian Zhen. + Thanks to Jian Zhen for donation of https://github.com/strace/ and + strace.io. + + * CREDITS.in: Add Jian Zhen. + +2015-11-24 Dmitry V. Levin + + Fix syscall entries of unimplemented getpmsg and putpmsg syscalls. + * linux/ia64/syscallent.h (getpmsg): Change SEN(printargs) + to SEN(getpmsg). + (putpmsg): Change SEN(printargs) to SEN(putpmsg). + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/arm/syscallent.h (getpmsg, putpmsg): Set sys_flags to TN. + * linux/bfin/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/hppa/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/i386/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/m68k/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/microblaze/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/powerpc/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/s390/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/s390x/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/x32/syscallent.h (getpmsg, putpmsg): Likewise. + * linux/x86_64/syscallent.h (getpmsg, putpmsg): Likewise. + +2015-11-24 Dmitry V. Levin + + Remove parsers of getpmsg and putpmsg syscalls. + These system calls are not implemented in the Linux kernel. + + * linux/dummy.h(getpmsg, putpmsg): Move to the list of deprecated + syscalls. + * Makefile.am (strace_SOURCES): Remove stream.c. + * stream.c: Remove. + * xlat/pmsgflags.in: Remove. + +2015-11-24 Dmitry V. Levin + + Remove parser of query_module syscall. + Since query_module syscall is present only in kernels before Linux 2.6 + and strace does not support those kernels, there is no use to keep this + parser any longer. + + * bjm.c: Do not include , "xlat/qm_which.h", + and "xlat/modflags.h". + (MOD_*, QM_*, module_symbol, module_info, SYS_FUNC(query_module)): + Remove. + * linux/dummy.h (sys_query_module): Add stub alias. + * xlat/modflags.in: Remove. + * xlat/qm_which.in: Remove. + +2015-11-24 Dmitry V. Levin + + Fix syscall entries of deprecated sysfs syscall. + * linux/alpha/syscallent.h (sysfs): Change nargs from 5 to 3. + * linux/hppa/syscallent.h (sysfs): Likewise. + * linux/mips/syscallent-n32.h (sysfs): Likewise. + * linux/mips/syscallent-n64.h (sysfs): Likewise. + + Move sysfs syscall to deprecated category. + * linux/dummy.h (sys_sysfs): Move to the list of deprecated syscalls. + + Fix syscall entries of deprecated bdflush syscall. + * linux/alpha/syscallent.h (bdflush): Change nargs from 0 to 2. + * linux/arm/syscallent.h (bdflush): Likewise. + * linux/avr32/syscallent.h (bdflush): Likewise. + * linux/bfin/syscallent.h (bdflush): Likewise. + * linux/hppa/syscallent.h (bdflush): Likewise. + * linux/i386/syscallent.h (bdflush): Likewise. + * linux/ia64/syscallent.h (bdflush): Likewise. + * linux/m68k/syscallent.h (bdflush): Likewise. + * linux/microblaze/syscallent.h (bdflush): Likewise. + * linux/powerpc/syscallent.h (bdflush): Likewise. + * linux/s390/syscallent.h (bdflush): Likewise. + * linux/s390x/syscallent.h (bdflush): Likewise. + * linux/sh/syscallent.h (bdflush): Likewise. + * linux/sh64/syscallent.h (bdflush): Likewise. + * linux/sparc/syscallent.h (bdflush): Likewise. + +2015-11-22 Dmitry V. Levin + + Implement name_to_handle_at and open_by_handle_at syscalls decoding. + * file_handle.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_name_to_handle_at, sys_open_by_handle_at): + Remove stub aliases. + * pathtrace.c (pathtrace_match): Add SEN_name_to_handle_at. + * tests/file_handle.c: New file. + * tests/file_handle.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add file_handle. + (TESTS): Add file_handle.test. + * tests/.gitignore: Add file_handle. + + Implement lookup_dcookie syscall decoding. + * lookup_dcookie.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_lookup_dcookie): Remove stub alias. + + Implement kexec_file_load syscall decoding. + * xlat/kexec_file_load_flags.in: New file. + * kexec.c: Include "xlat/kexec_file_load_flags.h". + (SYS_FUNC(kexec_file_load)): New function. + * linux/dummy.h (sys_kexec_file_load): Remove stub alias. + * pathtrace.c (pathtrace_match): Add SEN_kexec_file_load. + + Implement kcmp syscall decoding. + * kcmp.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_kcmp): Remove stub alias. + * xlat/kcmp_types.in: New file. + + Implement iopl syscall decoding. + * iopl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_iopl): Remove stub alias. + + Implement ioperm syscall decoding. + * ioperm.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_ioperm): Remove stub alias. + + net: fix printing of IP_RECVOPTS/IP_RETOPTS cmsg options. + * net.c (print_cmsg_ip_opts): Print each byte as unsigned char. + + userfaultfd: fix pathtrace support. + * pathtrace.c (pathtrace_match): Add SEN_userfaultfd. + +2015-11-22 Dmitry V. Levin + + Implement IPPROTO_IP control messages decoding. + * net.c: Include "xlat/ip_cmsg_types.h". + (print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos, + print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_checksum, + print_cmsg_ip_origdstaddr): New functions. + (print_cmsg_type_data): Add generic SOL_IP level decoding. + Use these functions for decoding of IP_PKTINFO, IP_TTL, IP_TOS, + IP_RECVOPTS, IP_RETOPTS, IP_RECVERR, IP_ORIGDSTADDR, IP_CHECKSUM, + and SCM_SECURITY type messages. + * xlat/ip_cmsg_types.in: New file. + * xlat/sockipoptions.in: Move IP_RETOPTS before IP_RECVRETOPTS. + * tests/inet-cmsg.c: New file. + * tests/inet-cmsg.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add inet-cmsg. + (TESTS): Add inet-cmsg.test. + * tests/.gitignore: Add inet-cmsg. + + Suggested-by: Orion Poplawski + +2015-11-22 Dmitry V. Levin + + Simplify control messages printers. + Do not pass sizeof(struct cmsghdr) to every cmsg printer. + + * net.c (printcmsghdr): Pass pointer to cmsg_data and length + of cmsg_data to print_cmsg_type_data. + (print_cmsg_type_data): Update prototype. Pass pointer to cmsg_data + and length of cmsg_data to cmsg printers. + (print_scm_rights, print_scm_creds, print_scm_security): Update. + +2015-11-21 Dmitry V. Levin + + net: factor out address printing code to a separate function. + * net.c (sockaddr_buf_t): New type. + (print_sockaddr): New function. + (printsock, print_group_req): Use it. + +2015-11-20 Dmitry V. Levin + + mpers: skip xlat struct definitions in mpers mode. + Avoid duplicate definitions of xlat structures in files + compiled in mpers mode. + + Each xlat file defines the corresponding xlat struct with + either global or local visibility using the following rules: + + - if xlat struct declaration is available in defs.h, + a global definition is provided in regular mode, + and nothing is provided in mpers mode; + - otherwise, if xlat file is included by a mpers source file, + a global definition is provided in regular mode + (unless no mpers mode is supported on this architecture, + in that case, a local definition is provided instead), + and a declaration is provided in mpers mode; + - otherwise, a local definition is provided in regular mode, + and an error message is printed in mpers mode. + + Fallback definitions of constants provided by xlat files + remain available in all modes. + + * bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh. + * defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove. + * generate_mpers_am.sh: Generate mpers_xlat.h. + * Makefile.am (EXTRA_DIST): Add mpers_xlat.h. + * print_sigevent.c: Include "xlat/sigev_value.h" unconditionally. + * print_timex.c: Include "xlat/adjtimex_modes.h" and + "xlat/adjtimex_status.h" unconditionally. + * xlat/gen.sh (cond_xlat): Move printing of fallback definitions ... + (cond_def): ... here. + (gen_header): Check also mpers_xlat.h for global declarations + of xlat structures. + Process input file twice, first time print directives + only, second time print everything. + Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif. + * xlat/getrandom_flags.in: Cleanup. + +2015-11-20 Dmitry V. Levin + + tests: rewrite getdents test in C for better coverage. + * tests/getdents.awk: Remove. + * tests/getdents.out: Remove. + * tests/getdents.c: New file. + * tests/getdents.test: Rewrite. + * tests/getdents64.c: New file. + * tests/getdents64.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add getdents and getdents64. + (TESTS): Add getdents64.test. + (EXTRA_DIST): Remove getdents.awk and getdents.out. + * tests/.gitignore: Add getdents and getdents64. + +2015-11-19 Dmitry V. Levin + + tests: add readdir.test. + * tests/readdir.c: New file. + * tests/readdir.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add readdir. + (TESTS): Add readdir.test. + * tests/.gitignore: Add readdir. + + Mpersify parsers of readdir and getdents syscalls. + * defs.h (dirent_types): New xlat prototype. + * dirent.c: Stop including "xlat/direnttypes.h". + (kernel_dirent): New typedef. Mpersify it. + (print_old_dirent): Use it instead of old_dirent_t. + (SYS_FUNC(getdents)): Use it instead of struct kernel_dirent. + Rename direnttypes to dirent_types. + (SYS_FUNC(getdents64)): Move ... + * dirent64.c: ... here. Rename direnttypes to dirent_types. + Include "xlat/dirent_types.h". + * Makefile.am (strace_SOURCES): Add dirent64.c. + * xlat/direnttypes.in: Rename to xlat/dirent_types.in. + +2015-11-19 Gabriel Laskar + + getdents: fix typos in array output. + Array should be enclosed by square brakets, and elements should be + separated by commas. + + * dirent.c (SYS_FUNC(getdents), SYS_FUNC(getdents64)): Fix typos + in array output. + * tests/getdents.awk: Update regexps to match fixed output. + * tests/getdents.out: Update output. + +2015-11-19 Dmitry V. Levin + + printcmsghdr: move type and data decoders to a separate function. + * net.c (print_scm_rights, print_scm_creds, print_scm_security): Change + to return void. Move printing of struct cmsghdr closing '}' ... + (printcmsghdr): ... here. Move type and data decoders to ... + (print_cmsg_type_data): ... new function. + +2015-11-18 Dmitry V. Levin + + Assume that libc provides sendmsg. + Starting with commit v4.6-281-g7af9f35, we implicitly assume that + HAVE_SENDMSG is always defined. Therefore, the check for sendmsg + availability is redundant and could be safely removed. + + * configure.ac (AC_CHECK_FUNCS): Remove sendmsg. + * linux/dummy.h [!HAVE_SENDMSG] (sys_recvmsg, sys_sendmsg): Remove + stub aliases. + * net.c [HAVE_SENDMSG]: Define unconditionally. + * syscall.c (dumpio) [HAVE_SENDMSG]: Likewise. + +2015-11-18 Dmitry V. Levin + + net.c: move fallback definition of SCM_SECURITY to xlat/ + * net.c: Move fallback definition of SCM_SECURITY ... + * xlat/scmvals.in: ... here. + +2015-11-17 Dmitry V. Levin + + Implement mlock2 syscall decoding. + * mem.c: Include "xlat/mlock_flags.h". + (SYS_FUNC(mlock2)): New function. + * xlat/mlock_flags.in: New file. + * xlat/mlockall_flags.in: Add MCL_ONFAULT, add default values. + * linux/dummy.h (mlock2): Remove. + * tests/mlock2.c: New file. + * tests/mlock2.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add mlock2. + (TESTS): Add mlock2.test. + * tests/.gitignore Add mlock2. + + Implement membarrier syscall decoding. + * membarrier.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/membarrier_cmds.in: New file. + * linux/dummy.h (membarrier): Remove. + * tests/membarrier.c: New file. + * tests/membarrier.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add membarrier. + (TESTS): Add membarrier.test. + * tests/.gitignore: Add membarrier. + + Implement userfaultfd syscall decoding. + * userfaultfd.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/uffd_flags.in: New file. + * linux/dummy.h (userfaultfd): Remove. + * tests/userfaultfd.c: New file. + * tests/userfaultfd.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add userfaultfd. + (TESTS): Add userfaultfd.test. + * tests/.gitignore: Add userfaultfd. + +2015-11-17 Dmitry V. Levin + + ia64: wire up kcmp syscall. + ia64 has kcmp syscall starting with linux kernel commit + v4.3-rc7-1-gd305c47. + + * linux/ia64/syscallent.h (kcmp): New entry. + +2015-11-17 Dmitry V. Levin + + powerpc: wire up direct sysv ipc syscalls. + Starting with linux commit v4.3-rc3-33-ga342361, powerpc has + direct sysv ipc syscalls in addition to traditional ipc syscall. + + * linux/powerpc/syscallent.h (semop, semget, semctl, semtimedop, msgsnd, + msgrcv, msgget, msgctl, shmat, shmdt, shmget, shmctl): New entries. + +2015-11-17 Dmitry V. Levin + + Wire up userfaultfd, membarrier, and mlock2 syscalls. + * linux/dummy.h (membarrier, mlock2, userfaultfd): New stub aliases. + * linux/32/syscallent.h (userfaultfd, membarrier, mlock2): New entries. + * linux/64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/arm/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/hppa/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/i386/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/ia64/syscallent.h (userfaultfd, membarrier): Likewise. + * linux/m68k/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/microblaze/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/mips/syscallent-n32.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/mips/syscallent-n64.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/mips/syscallent-o32.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/powerpc/syscallent.h (userfaultfd, membarrier): Likewise. + * linux/s390/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/s390x/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/sparc/syscallent.h (membarrier, userfaultfd, mlock2): Likewise. + * linux/x32/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + * linux/x86_64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. + +2015-11-16 Dmitry V. Levin + + sprintflags: skip zero flags. + Tweak sprintflags behaviour to match printflags. + + * util.c (sprintflags): Skip zero flags unless the value passed + to sprintflags is also zero. + +2015-11-16 Mike Frysinger + + printflags: handle empty xlats. + If the set of headers are unable to produce a valid list, printflags + will try to pass NULL to tprints which crashes. Add a sanity check + for this edge case. + + * util.c (printflags): Check xlat->str is not NULL. + +2015-11-16 Dmitry V. Levin + + mpers: forward mpers_DEFS to mpers.sh. + mpers_DEFS has to be forwarded to mpers.sh so that config.h would be + properly included by defs.h at preprocessor stage. + + * Makefile.am (mpers-m%.stamp): Add the whole $(mpers_sh_opts) set of + options to mpers.sh's CPPFLAGS. + +2015-11-16 Dmitry V. Levin + + tests/ioctl: workaround glibc ioctl wrapper on powerpc. + * tests/ioctl.c (main) [POWERPC] Disable TCGETS test. + +2015-11-15 Dmitry V. Levin + + powerpc: wire up switch_endian syscall. + powerpc has switch_endian syscall starting with linux commit + v4.0-rc4-67-g529d235. + + * linux/powerpc/syscallent.h (switch_endian): New entry. + +2015-11-15 Dmitry V. Levin + + sparc: reserve more space for new syscalls. + Move socket subcalls further down the table to make room + for new syscalls. + + * linux/sparc/syscallent.h (SYS_socket_subcall): Raise from 353 to 400. + +2015-11-15 Dmitry V. Levin + + m68k: wire up direct socket syscalls. + Starting with linux commit v4.3-rc3-1-g5b3f33e, m68k has direct + socket syscalls in addition to traditional socketcall syscall. + + * linux/m68k/syscallent.h (socket, socketpair, bind, connect, listen, + accept4, getsockopt, setsockopt, getsockname, getpeername, sendto, + sendmsg, recvfrom, recvmsg, shutdown, recvmmsg, sendmmsg): New entries. + +2015-11-15 Dmitry V. Levin + + i386: wire up direct socket syscalls. + Starting with linux commit v4.2-rc1-64-g9dea5dc, x86 has direct + socket syscalls in addition to traditional socketcall syscall. + + * linux/i386/syscallent.h (socket, socketpair, bind, connect, listen, + accept4, getsockopt, setsockopt, getsockname, getpeername, sendto, + sendmsg, recvfrom, recvmsg, shutdown): New entries. + +2015-11-11 Heiko Carstens + + s390, s390x: update syscall tables. + * linux/s390/syscallent.h: Add new syscalls available with kernel 4.3.0. + * linux/s390x/syscallent.h: Likewise. + +2015-11-07 Dmitry V. Levin + + Fix *_printer_defs.h rules ambiguousness. + There is an ambiguousness in *_printer_defs.h rules definition: + + $ grep '^[^ ]*_defs\.h: ' Makefile.am + m%_defs.h: $(srcdir_mpers_source_files) + %_printer_defs.h: $(srcdir_mpers_source_files) + + While it appears to work with GNU make, it has to be fixed nevertheless. + + * Makefile.am (m%_defs.h): Rename to m%_type_defs.h. + (mpers_m32_targets): Rename m32_defs.h to m32_type_defs.h. + (mpers_mx32_targets): Rename mx32_defs.h to mx32_type_defs.h. + * mpers_type.h: Rename m32_defs.h to m32_type_defs.h, + mx32_defs.h to mx32_type_defs.h. + * .gitignore: Likewise. + + Reported-by: Elliott Hughes + +2015-10-09 Dmitry V. Levin + + fcntl.c: make use of RVAL_DECODED. + * fcntl.c (SYS_FUNC(fcntl)): Return RVAL_DECODED for write-only operations. + +2015-10-08 Dmitry V. Levin + + desc.c: move parser of fcntl syscall to a separate file. + * fcntl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * desc.c (printflock64, printflock, SYS_FUNC(fcntl)): Move to fcntl.c. + + desc.c: move parser of flock syscall to a separate file. + * flock.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * desc.c (SYS_FUNC(flock)): Move to flock.c. + +2015-10-08 Dmitry V. Levin + + tests: fix false uio.test failures. + * tests/uio.c (main): Use descriptor number 0 in pread/pwrite + and preadv/pwritev syscalls. + * tests/uio.expected: Update regexps. + + Reported-by: Lennart Sorensen + +2015-10-01 Gabriel Laskar + + Fix make -j builds. + In files generated by mpers scripts, includes directives are taken from + original files where the type definition was done. This causes to + include defs.h in multiple files. defs.h includes printers.h header, + which is a generated header. + + This patch add an explicit dependency to printers.h for the mpers + scripts. + + * Makefile.am (mpers-m%.stamp): Add printers.h to order-only + prerequisites. + +2015-09-29 Mike Frysinger + + mpers: fix shell code to conform better to POSIX. + The `echo -n` behavior is non-portable, so use printf instead. + + * generate_mpers_am.sh: Change `echo -n` to `printf`. + +2015-09-23 Gabriel Laskar + + 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. + +2015-09-23 Dmitry V. Levin + + tests: convert ioctl.test from match_grep to match_diff. + * tests/ioctl.c (main): Print expected output. + * tests/ioctl.test: Use match_diff instead of match_grep. + * tests/ioctl.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove ioctl.expected. + +2015-09-20 Dmitry V. Levin + + Convert parser of seccomp filter program to new mpers infrastructure. + * seccomp_fprog.h: New file. + * fetch_seccomp_fprog.c: New file. + * Makefile.am (strace_SOURCES): Add them. + * seccomp.c: Include "seccomp_fprog.h". + (print_seccomp_filter): Use fetch_seccomp_fprog. + +2015-09-19 Dmitry V. Levin + + tests/init.sh: enhance match_grep error diagnostics. + * tests/init.sh (match_grep): Check patterns one by one, + output only those patterns that didn't match. + + tests/init.sh: fix comment. + * tests/init.sh (match_awk): Fix usage description. + + tests: add one more case to select.test. + * tests/select.c (main): Check how timeout is printed + on exiting syscall. + + tests: uncouple pselect6 from select.test. + * tests/select.c Do not include . + Include . + [!__NR_select]: Skip the test. + (main): Remove pselect6 support, test just select syscall. + * tests/select.test: Remove all pselect6 checks, test just + select syscall. + + tests: robustify select test. + * tests/select.c: Do not include . + (main): Skip the test instead of assertions. + Add some padding to the timeval structure. + + tests: add one more case to pselect6.test. + * tests/pselect6.c (main): Check how timeout is printed + on exiting syscall. + + tests: robustify pselect6 test. + * tests/pselect6.c: Do not include and . + Include . + [!__NR_pselect6]: Skip the test. + (main): Skip the test instead of assertions. + Add some padding to the timespec structure. + + Convert another parser of struct timeval to new mpers infrastructure. + * print_time.c (sprint_timeval): New mpers printer. + [ALPHA] (sprint_timeval32): New function. + * defs.h [ALPHA] (sprint_timeval32): New prototype. + (bitness_t, TIMEVAL_TEXT_BUFSIZE, printtv_bitness, sprinttv): Remove. + * desc.c (decode_select): Replace bitness parameter with two printers. + Use them instead of printtv_bitness and sprinttv. + (sys_oldselect, sys_select): Pass print_timeval and sprint_timeval + to decode_select. + [ALPHA] (sys_osf_select): Pass print_timeval32 and sprint_timeval32 + to decode_select. + (pselect6): Pass print_timespec and sprint_timespec to decode_select. + * time.c (UTIME_NOW, UTIME_OMIT, current_time_t_is_compat, + struct timeval32, printtv_bitness, do_sprinttv, sprinttv): Remove. + + Convert another parser of struct timespec to new mpers infrastructure. + * print_time.c (sprint_timespec): New mpers printer. + * defs.h (TIMESPEC_TEXT_BUFSIZE): Update. + (sprint_timespec): Remove. + * time.c (sprint_timespec): Remove. + * net.c (sys_recvmmsg): Update callers. + * poll.c (decode_poll_exiting): Likewise. + + tests: add another case to pselect6 test. + * tests/pselect6.c: Include . + (handler): New function. + (main): Install an interval timer. + Use it to check how ERESTARTNOHAND is printed. + + Fix decoding of gettimeofday and settimeofday. + * time.c (print_timezone): new function. + (sys_gettimeofday, sys_settimeofday): Use it instead of print_timeval + to print struct timezone. + [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): Use it + instead of print_timeval32 to print struct timezone. + * tests/xettimeofday.c: New file. + * tests/xettimeofday.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add xettimeofday. + (TESTS): Add xettimeofday. + * tests/.gitignore: Add xettimeofday. + + Convert parser of struct timeval to new mpers infrastructure. + * defs.h (printtv, printtv_special): Remove. + [ALPHA] (print_timeval32, print_timeval32_pair): New prototypes. + * print_time.c (print_timeval): New mpers printer. + [ALPHA] (print_timeval32, print_timeval32_pair): New functions. + * time.c (sys_gettimeofday, sys_settimeofday): Use print_timeval + instead of printtv. + [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): + Use print_timeval32 instead of printtv_bitness. + * utimes.c [ALPHA] (sys_osf_utimes): Use print_timeval32_pair + instead of printtv_bitness. + + Convert parser of struct timespec to new mpers infrastructure. + * defs.h (print_timespec): Remove. + * print_time.c (print_timespec): New mpers printer. + * futex.c (sys_futex): Use print_timespec instead of printtv. + * ipc_sem.c (sys_semtimedop): Likewise. + * mq.c (sys_mq_timedsend, sys_mq_timedreceive): Likewise. + * time.c (clock_settime, clock_gettime, clock_nanosleep): Likewise. + (print_timespec): Remove. + + Remove unused parser of adjtime syscall. + * time.c (sys_adjtime): Remove. + + Fix decoding of clock_nanosleep. + * time.c (sys_clock_nanosleep): Use is_erestart, + temporarily_clear_syserror, and restore_cleared_syserror. + * tests/clock_nanosleep.c: New file. + * tests/clock_nanosleep.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add clock_nanosleep. + (TESTS): Add clock_nanosleep.test. + * tests/.gitignore: Add clock_nanosleep. + + Add is_erestart helper function. + * defs.h (is_erestart): New prototype. + * syscall.c (is_erestart): New function. + * time.c (sys_nanosleep): Use is_erestart, + temporarily_clear_syserror, and restore_cleared_syserror. + + Add helper functions to clear/restore syserror. + * defs.h (temporarily_clear_syserror, restore_cleared_syserror): + New prototypes. + * syscall.c (saved_u_error): New variable. + (temporarily_clear_syserror, restore_cleared_syserror): New functions. + * aio.c (sys_io_getevents): Use temporarily_clear_syserror + and restore_cleared_syserror. + * mq.c (sys_mq_timedreceive): Likewise. + * signal.c (sys_rt_sigtimedwait): Likewise. + + tests: add nanosleep.test. + * tests/nanosleep.c: New file. + * tests/nanosleep.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add nanosleep. + (TESTS): Add nanosleep.test. + * tests/.gitignore: Add nanosleep. + + tests: rewrite restart_syscall in C. + * tests/restart_syscall.c: New file. + * tests/restart_syscall.expected: Remove. + * tests/restart_syscall_unknown.expected: Remove. + * tests/restart_syscall.test: Update to use restart_syscall. + * tests/Makefile.am (check_PROGRAMS): Add restart_syscall. + (EXTRA_DIST): Remove restart_syscall.expected + and restart_syscall_unknown.expected. + * tests/.gitignore: Add restart_syscall. + + Properly initialize siginfo_t object passed to print_stopped function. + * strace.c (trace): Clear the whole siginfo_t variable before passing it + to ptrace(PTRACE_GETSIGINFO) because the latter may initialize only a + part of the structure. + + tests: add clock_xettime.test. + * tests/clock_xettime.c: New file. + * tests/clock_xettime.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add clock_xettime. + (TESTS): Add clock_xettime.test. + * tests/.gitignore: Add clock_xettime. + + Convert parser of struct itimerval to new mpers infrastructure. + * defs.h [ALPHA] (print_itimerval32): New prototype. + * print_time.c (print_itimerval): New mpers printer. + [ALPHA] (timeval32_t): New typedef. + [ALPHA] (print_timeval32_t, print_itimerval32): New functions. + * time.c (sys_getitimer, sys_setitimer): Use print_itimerval instead + of printitv. + [ALPHA] (sys_osf_getitimer, sys_osf_setitimer): Use print_itimerval32 + instead of printitv_bitness. + (tprint_timeval32, tprint_timeval, printitv_bitness, printitv): Remove. + + tests: add xetitimer.test. + * tests/xetitimer.c: New file. + * tests/xetitimer.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add xetitimer. + (TESTS): Add xetitimer.test. + * tests/.gitignore: Add xetitimer. + + Convert parser of struct itimerspec to new mpers infrastructure. + * print_time.c (print_itimerspec): New mpers printer. + * time.c (sys_timer_settime, sys_timer_gettime, sys_timerfd, + sys_timerfd_settime, sys_timerfd_gettime): Use it instead of printitv. + +2015-09-17 Dmitry V. Levin + + print_time.c: introduce print_timespec_t helper. + * print_time.c (time_fmt): New constant string. + (print_timeval_t): Use it. + (print_timespec_t): New function. + (print_timespec_t_utime): Use it. + + tests: add timerfd_xettime.test. + * tests/timerfd_xettime.c: New file. + * tests/timerfd_xettime.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add timerfd_xettime. + (TESTS): Add timerfd_xettime.test. + * tests/.gitignore: Add timerfd_xettime. + + tests: add timer_xettime.test. + * tests/timer_xettime.c: New file. + * tests/timer_xettime.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add timer_xettime. + (TESTS): Add timer_xettime.test. + * tests/.gitignore: Add timer_xettime. + + time.c: move parser of time syscall to print_time.c. + * time.c (current_time_t_is_int32): Remove. + (sys_time): Move ... + * print_time.c: ... here. Mpersify time_t. + + print_time.c: remove unused function parameters. + * print_time.c (print_timespec_t_utime, print_timeval_t): Remove + "struct tcb *" parameter. + (print_timespec_utime_pair, print_timeval_pair): Update callers. + + Add struct timex.tai support. + * configure.ac (AC_CHECK_MEMBERS): Add struct timex.tai. + * print_timex.c (print_timex) [HAVE_STRUCT_TIMEX_TAI]: Print tai field. + * tests/adjtimex.c (main) [HAVE_STRUCT_TIMEX_TAI]: Likewise. + + Convert parser of struct timex to new mpers infrastructure. + * defs.h (adjtimex_modes, adjtimex_status): New xlat prototypes. + * print_timex.c (struct_timex): New typedef. Mpersify it. + [IN_MPERS]: Do not include "xlat/adjtimex_modes.h" + and "xlat/adjtimex_status.h". + [SUPPORTED_PERSONALITIES > 1]: Remove. + (tprint_timeval): Remove. + (tprint_timex): Rename to print_timex. Mpersify it. + * time.c (do_adjtimex): Rename tprint_timex to print_timex. + * tests/adjtimex.c: New file. + * tests/adjtimex.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add adjtimex. + (TESTS): Add adjtimex.test. + * tests/.gitignore: Add adjtimex. + + Move parser of struct timex to a separate file. + * print_timex.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * time.c (tprint_timex32, tprint_timex): Move to print_timex.c. + + Enhance parser of struct sigevent. + * print_sigevent.c (print_sigevent): Always print names + of struct_sigevent fields along with their values. + Print signal name of sigev_signo for those sigev_notify values + that require valid signal numbers. + * tests/timer_create.c: New file. + * tests/timer_create.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add timer_create. + (TESTS): Add timer_create.test. + * tests/.gitignore: Add timer_create. + +2015-09-16 Dmitry V. Levin + + Convert parser of struct sigevent to new mpers infrastructure. + * defs.h (sigev_value): New prototype. + (printsigevent): Remove. + * print_sigevent.c (struct_sigevent): New typedef. Mpersify it. + [IN_MPERS]: Do not include "xlat/sigev_value.h". + (printsigevent32): Remove. + (printsigevent): Rename to print_sigevent. Mpersify it. + * mq.c (sys_mq_notify): Rename printsigevent to print_sigevent. + * time.c (sys_timer_create): Likewise. + + Move parser of struct sigevent to a separate file. + * print_sigevent.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * time.c (printsigevent32, printsigevent): Move to print_sigevent.c. + + time.c: move fallback definitions of SIGEV_* values to xlat/ + * time.c: Move fallback definitions of SIGEV_* values ... + * xlat/sigev_value.in: ... here. + + Simplify use of mpers printers. + * native_defs.h: New file. + * syscall.c: Include it. + * mpers_type.h [!IN_MPERS] (MPERS_DEFS): Change to "native_defs.h". + * defs.h (MPERS_PRINTER_NAME): Remove. + [SUPPORTED_PERSONALITIES > 1] (MPERS_PRINTER_NAME, printers): Move ... + * Makefile.am (printers.h): ... here. + Add macro definitions for mpers printers. + (m%_defs.h): Add redefinition of MPERS_PRINTER_NAME and inclusion + of "$(mpers_PREFIX)printer_decls.h". + (strace_SOURCES): Add native_defs.h. + * README-mpers: Update instructions for using mpers printers. + * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Call tprint_msgbuf directly. + * mq.c (sys_mq_open, mq_getsetattr): Call printmqattr directly. + * process.c (sys_ptrace): Call printsiginfo_at directly. + * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Likewise. + * resource.c (sys_getrusage): Call printrusage directly. + * utimes.c (sys_utimensat): Call print_timespec_utime_pair directly. + (sys_utimes, sys_futimesat): Call print_timeval_pair directly. + * wait.c (printwaitn): Call printrusage directly. + (sys_waitid): Call printrusage and printsiginfo_at directly. + +2015-09-15 Dmitry V. Levin + + Add a new helper function umove_ulong_array_or_printaddr. + * defs.h (umove_ulong_array_or_printaddr): New prototype. + * util.c (umove_ulong_array_or_printaddr): New function. + * desc.c (sys_pselect6): Use it instead of open-coding + a proxy struct parser for different personalities. + * io.c (tprint_iov_upto): Use it instead of open-coding + a struct iovec parser for different personalities. + * kexec.c (print_kexec_segments): Use it instead of open-coding + a struct kexec_segment parser for different personalities. + (print_seg): Pass arguments using an array. + + tests: add pselect6.test. + * tests/pselect6.c: New file. + * tests/pselect6.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add pselect6. + (TESTS): Add pselect6.test. + * tests/.gitignore: Add pselect6. + +2015-09-14 Dmitry V. Levin + + Rename umove_long_or_printaddr to umove_ulong_or_printaddr. + Rename the recently added function to reflect what kind of data type + it actually deals with: unsigned long int, without sign extension. + + * defs.h (umove_long_or_printaddr): Rename to umove_ulong_or_printaddr, + chage 3rd argument to unsigned long *. + * util.c (umove_long_or_printaddr): Likewise. + * aio.c (sys_io_submit): Update callers. + +2015-09-14 Dmitry V. Levin + + aarch64, ppc64, sparc64, tile: hook up mpers printers. + * defs.h [AARCH64 && HAVE_M32_MPERS]: Define PERSONALITY0_INCLUDE_FUNCS, + PERSONALITY0_INCLUDE_PRINTERS_DECLS, + and PERSONALITY0_INCLUDE_PRINTERS_DEFS. + [POWERPC64 && HAVE_M32_MPERS]: Define PERSONALITY1_INCLUDE_FUNCS, + PERSONALITY1_INCLUDE_PRINTERS_DECLS, + and PERSONALITY1_INCLUDE_PRINTERS_DEFS. + [SPARC64 && HAVE_M32_MPERS]: Likewise. + [TILE && HAVE_M32_MPERS]: Likewise. + +2015-09-14 Anton Blanchard + + Add PowerPC specific ptrace constants. + * xlat/ptrace_cmds.in: Add PowerPC specific ptrace constants. + +2015-09-14 Dmitry V. Levin + + Update SCTP_* constants. + * xlat/socksctpoptions.in: Add SCTP_GET_ASSOC_ID_LIST, SCTP_AUTO_ASCONF, + SCTP_PEER_ADDR_THLDS, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO, + SCTP_DEFAULT_SNDINFO, SCTP_SOCKOPT_CONNECTX, SCTP_SOCKOPT_CONNECTX3, + and SCTP_GET_ASSOC_STATS. + + Update F_* constants. + * xlat/fcntlcmds.in: Add F_SETPIPE_SZ, F_GETPIPE_SZ, F_ADD_SEALS, + and F_GET_SEALS. + + Update RENAME_* constants. + * xlat/rename_flags.in: Add RENAME_WHITEOUT. + + Update SO_* constants. + * xlat/sockoptions.in: Add SO_ATTACH_BPF, SO_BPF_EXTENSIONS, + SO_BUSY_POLL, SO_DETACH_BPF, SO_GET_FILTER, SO_INCOMING_CPU, + SO_LOCK_FILTER, SO_MAX_PACING_RATE, SO_PEEK_OFF, SO_RXQ_OVFL, + SO_SELECT_ERR_QUEUE, and SO_WIFI_STATUS. + + Update INPUT_PROP_* constants. + * xlat/evdev_prop.in: Add INPUT_PROP_ACCELEROMETER. + + Update KEY_* constants. + * xlat/evdev_keycode.in: Add KEY_ROTATE_DISPLAY, KEY_NUMERIC_A, + KEY_NUMERIC_B, KEY_NUMERIC_C, and KEY_NUMERIC_D. + + Update FALLOC_FL_* constants. + * xlat/falloc_flags.in: Add FALLOC_FL_INSERT_RANGE. + + Update AF_* and PF_* constants. + * xlat/addrfams.in: Add AF_IB and AF_MPLS. + * xlat/domains.in: Add PF_IB and PF_MPLS. + + Update TCP_* constants. + * xlat/socktcpoptions.in: Add TCP_NOTSENT_LOWAT, TCP_CC_INFO, + TCP_SAVE_SYN, and TCP_SAVED_SYN. + + Update PACKET_* constants. + * xlat/sockpacketoptions.in: Add PACKET_VNET_HDR, PACKET_TX_TIMESTAMP, + PACKET_TIMESTAMP, PACKET_FANOUT, PACKET_TX_HAS_OFF, PACKET_QDISC_BYPASS, + PACKET_ROLLOVER_STATS, and PACKET_FANOUT_DATA. + + Update BPF_MAP_TYPE_* constants. + * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERF_EVENT_ARRAY. + + Update IPPROTO_* constants. + * xlat/inet_protocols.in: Add IPPROTO_MPLS. + + Update IP_* constants. + * xlat/sockipoptions.in: Add IP_CHECKSUM and IP_BIND_ADDRESS_NO_PORT. + + Update PTRACE_O_* constants. + * ptrace.h: Define PTRACE_O_SUSPEND_SECCOMP. + * xlat/ptrace_setoptions_flags.in: Add it. + + Update PR_* constants. + * xlat/prctl_options.in: Add PR_SET_FP_MODE, PR_GET_FP_MODE, + and PR_CAP_AMBIENT. + + Update SECBIT_* constants. + * xlat/secbits.in: Add SECBIT_NO_CAP_AMBIENT_RAISE + and SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED. + +2015-08-28 Dmitry V. Levin + + mpers.m4: workaround missing gnu/stubs-*.h files. + On some systems missing gnu/stubs-*.h files make -m32/-mx32 compilation + checks fail. As we want to support multiple personalities despite of + this limitation, workaround the check by creating empty gnu stub files + if necessary. + + * m4/mpers.m4 (st_MPERS): Check for the gnu stub file. Create an empty + gnu stub file if the system one is missing. + * Makefile.am (DISTCLEANFILES): Add gnu/stubs-32.h and gnu/stubs-x32.h. + +2015-08-28 Elvira Khabirova + + tests: add times-fail.test. + * tests/times-fail.c: New file. + * tests/times-fail.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add times-fail. + (TESTS): Add times-fail.test. + * tests/.gitignore: Add times-fail. + +2015-08-28 Eugene Syromyatnikov + + tests: add times.test. + * tests/times.c: New file. + * tests/times.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add times. + (TESTS): Add times.test. + (times_LDADD): Define. + * tests/.gitignore: Add times. + +2015-08-28 Elvira Khabirova + + Mpersify parser of times syscall. + Fix multiple personalities support in parser of times syscall by + mpersifying struct tms. + + * times.c (tms_t): New typedef. Mpersify it. + (sys_times): Use it instead of struct tms. + +2015-08-28 Elvira Khabirova + + tests: add sysinfo.test. + * tests/sysinfo.c: New file. + * tests/sysinfo.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add sysinfo. + (TESTS): Add sysinfo.test. + * tests/.gitignore: Add sysinfo. + +2015-08-28 Elvira Khabirova + + Mpersify parser of sysinfo syscall. + Fix multiple personalities support in parser of sysinfo syscall by + mpersifying struct sysinfo. + + * sysinfo.c (sysinfo_t): New typedef. Mpersify it. + (sys_sysinfo): Use it instead of struct sysinfo. + +2015-08-28 Elvira Khabirova + + Enhance msgctl syscall decoding. + Make parser of msgctl syscall print struct msqid_ds. + + * ipc_msgctl.c (msqid_ds_t): New typedef. Mpersify it. + (print_msqid_ds): New function. Use msqid_ds_t. + (sys_msgctl): Use print_msqid_ds. + * tests/ipc_msg.c: Update for struct msqid_ds support. + +2015-08-28 Elvira Khabirova + + Enhance shmctl syscall decoding. + Make parser of shmctl syscall print struct shmid_ds. + + * ipc_shmctl.c (shmid_ds_t): New typedef. Mpersify it. + (print_shmid_ds): New function. Use shmid_ds_t. + (sys_shmctl): Use print_shmid_ds. + * tests/ipc_shm.c: Update for struct shmid_ds support. + +2015-08-28 Elvira Khabirova + + tests: add ipc_msgbuf.test. + * tests/ipc_msgbuf.c: New file. + * tests/ipc_msgbuf.expected: Likewise. + * tests/ipc_msgbuf.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add ipc_msgbuf. + (TESTS): Add ipc_msgbuf.test. + (EXTRA_DIST): Add ipc_msgbuf.expected. + * tests/.gitignore: Add ipc_msgbuf. + +2015-08-28 Elvira Khabirova + + Mpersify tprint_msgsnd and tprint_msgrcv. + Fix multiple personalities support in tprint_msgsnd and tprint_msgrcv + by converting tprint_msgbuf into a mpersified printer. + + * print_msgbuf.c (msgbuf_t): New typedef. Mpersify it. + (tprint_msgbuf): Use it instead of long. + Wrap function name into MPERS_PRINTER_DECL. + * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Use mpersified + tprint_msgbuf. + +2015-08-28 Elvira Khabirova + + tests: add mq.test. + * tests/mq.c: New file. + * tests/mq.expected: Likewise. + * tests/mq.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add mq. + (TESTS): Add mq.test. + (EXTRA_DIST): Add mq.expected. + (mq_LDADD): Add -lrt. + * tests/.gitignore: Add mq. + +2015-08-28 Elvira Khabirova + + Mpersify parsers of mq_open and mq_getsetattr syscalls. + Fix multiple personalities support in parsers of mq_open and + mq_getsetattr by converting printmqattr into a mpersified printer. + + * print_mq_attr.c (mq_attr_t): New typedef. Mpersify it. + (printmqattr): Use it instead of struct mq_attr. Wrap function name + into MPERS_PRINTER_DECL. + * mq.c (mq_open, mq_getsetattr): Use mpersified printmqattr. + +2015-08-28 Dmitry V. Levin + + tests: add wait.test. + * tests/wait.c: New file. + * tests/wait.expected: Likewise. + * tests/wait.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add wait. + (TESTS): Add wait.test. + (EXTRA_DIST): Add wait.expected. + * tests/.gitignore: Add wait. + +2015-08-28 Dmitry V. Levin + + Mpersify parsers of getrusage, waitpid, wait4, and waitid syscalls. + Fix multiple personalities support in parsers of getrusage, waitpid, + wait4, and waitid syscalls by converting printrusage into a mpersified + printer. + + * defs.h (printrusage): Remove. + * printrusage.c (rusage_t): New typedef. Mpersify it. + (printrusage): Use it instead of struct rusage. + Wrap function name into MPERS_PRINTER_DECL. + * resource.c (sys_getrusage): Use mpersified printrusage. + * wait.c (printwaitn, sys_waitid): Likewise. + +2015-08-28 Elvira Khabirova + + tests: add rt_sigqueueinfo.test. + * tests/rt_sigqueueinfo.c: New file. + * tests/rt_sigqueueinfo.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add rt_sigqueueinfo. + (TESTS): Add rt_sigqueueinfo.test. + * tests/.gitignore: Add rt_sigqueueinfo. + +2015-08-28 Elvira Khabirova + + Mpersify printsiginfo_at printer. + Fix multiple personalities support in parsers of ptrace, + rt_sigqueueinfo, rt_tgsigqueueinfo, rt_sigtimedwait and waitid syscalls + by converting printsiginfo_at into a mpersified printer. + + * printsiginfo.c (siginfo_t): Mpersify. + (printsiginfo_at): Wrap function name into MPERS_PRINTER_DECL. + * defs.h (printsiginfo_at): Remove. + * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Use mpersified + printsiginfo_at. + * process.c (sys_ptrace): Likewise. + * wait.c (sys_waitid): Likewise. + +2015-08-28 Elvira Khabirova + + Mpersify parser of sigaltstack syscall. + Fix multiple personalities support in parser of sigaltstack syscall by + mpersifying stack_t typedef. + + * sigaltstack.c (stack_t): Mpersify. + (print_stack_t): Use it. + +2015-08-28 Elvira Khabirova + + Mpersify parser of utime syscall. + Fix multiple personalities support in parser of utime syscall by using + mpersified utimbuf_t typedef. + + * utime.c (utimbuf_t): New typedef. Mpersify it. + (sys_utime): Use it instead of a locally defined union. + +2015-08-28 Dmitry V. Levin + + tests: add utimensat.test. + * tests/utimensat.c: New file. + * tests/utimensat.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add utimensat. + (TESTS): Add utimensat.test. + * configure.ac (AC_CHECK_FUNCS): Add utimensat. + * tests/.gitignore: Add utimensat. + +2015-08-28 Dmitry V. Levin + + Mpersify parsers of utimes, futimesat, and utimensat syscalls. + Fix multiple personalities support in parsers of utimes, futimesat, + and utimensat syscalls by introducing two mpersified printers: + print_timeval_pair and print_timespec_utime_pair. + + * print_time.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * utimes.c (decode_utimes): Remove. + (sys_utimes, sys_futimesat): Use print_timeval_pair instead + of decode_utimes. + (sys_utimensat): Use print_timespec_utime_pair instead of decode_utimes. + +2015-08-28 Elvira Khabirova + + Add mpers support. + Add a subsystem for semi-automatical definition of how parsers should + work with personality-dependent (mpers) types of tracee's data. Create + auxiliary libraries containing mpers syscall parsers and printer + functions, one library for each possible nonnative target personality. + + Currently some parsers do not handle differences in definitions of data + types between personalities, namely LP64 and ILP32. When + this is the case, long integers, pointers, and all compound + types containing long and pointer members may be printed incorrectly, + because of differences in sizes, offsets and alignments. + + Since in most cases these are the only differences in desired behaviour + of parsers and printers for different personalities, a correct way + would be to compile one source code into multiple parsers, differing + only in definitions of mpers types. + + To get a definition of a given type for nonnative personality + a very basic .c file containing a declaration of a variable of this type + is being compiled for this personality (using -m32 or -mx32 compiler + flag). Information about the type is then being extracted from + this binary's DWARF debug info with an awk script and put + into a corresponding header file. Resulting headers are being used to + compile mpers variations of syscall parsers and printer functions. + + In addition to syscall parsers, there can occur a need to create mpers + printing functions, which then can be called from many places + in the code (for example, printsiginfo_at). Such functions (printers) + are marked in a special manner. + + For each possible nonnative target personality a library is being + created, containing mpers variations of syscall parsers and printers. + Only syscall parsers from files marked in a special manner and specially + marked functions from such files are being recompiled and included + in these libraries. + + generate_mpers_am.sh is called by bootstrap to find the files + from strace_SOURCES which include MPERS_DEFS. During compilation, + these files are being inspected for inclusions of DEF_MPERS_TYPE, + and nonnative variations of each included type are being generated + by an awk script. + + Mpers parser names are being modified during inclusions of syscallent + headers for nonnative personalities. Pointers to printers are + being stored in structs struct_printers, and a master + pointer printers is being updated on every set_personality. + + * README-mpers: New README explaining how to use mpers support. + * empty.h: New empty file. + * generate_mpers_am.sh: New file. + * mpers.awk: Likewise. + * mpers.sh: Likewise. + * mpers_test.sh: Likewise. + * mpers_type.h: Likewise. + * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. + (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning + of the file. + (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. + (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. + (BUILT_SOURCES, CLEANFILES): Add new generated files: + native_printer_decls.h, native_printer_defs.h, printers.h, + [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] + $(mpers_mx32_targets). + (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, + mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, + libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. + (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, + %_printer_decls.h, %_printer_defs.h, clean-local, + native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): + New targets. + * bootstrap: Add generate_mpers_am.sh. + * configure.ac: Add AC_PROG_RANLIB. + * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. + * defs.h: Include mpers_type.h. + Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. + Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. + [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, + PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS + for X86_64, X32. + [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, + PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS + for X86_64. + Add fallback definitions of + PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, + PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, + PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, + PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. + * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, + PERSONALITY2_INCLUDE_FUNCS, + PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, + PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, + PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. + (printers): New struct. Update it when needed. + * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, + m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, + mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, + mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, + native_printer_decls.h, native_printer_defs.h, and printers.h. + +2015-08-28 Dmitry V. Levin + + tests: convert readlink.test and readlinkat.test from match_awk to match_diff + * tests/readlink.c (main): Print expected output. + * tests/readlinkat.c (main): Likewise. + * tests/readlink.test: Use match_diff instead of match_awk. + * tests/readlinkat.test: Likewise. + * tests/readlink.awk: Remove. + * tests/readlinkat.awk: Likewise. + * tests/Makefile.am (EXTRA_DIST): Remove readlink.awk and readlinkat.awk. + + tests: convert getrandom.test from match_awk to match_diff. + * tests/getrandom.c (main): Print expected output. + * tests/getrandom.test: Use match_diff instead of match_awk. + * tests/getrandom.awk: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove getrandom.awk. + +2015-08-27 Dmitry V. Levin + + tests: convert select.test from match_awk to match_diff. + * tests/select.c (main): Print expected output. + * tests/select.test: Use match_diff instead of match_awk. + * tests/select.awk: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove select.awk. + + tests: convert several tests from match_grep to match_diff. + * tests/sendfile.test: Use match_diff instead of match_grep. + * tests/sendfile64.test: Likewise. + * tests/time.test: Likewise. + * tests/utime.test: Likewise. + * tests/xet_robust_list.test: Likewise. + * tests/sendfile.c (main): Update match patterns for match_diff. + * tests/sendfile64.c (main): Likewise. + * tests/time.c (main): Likewise. + * tests/utime.c (main): Likewise. + * tests/xet_robust_list.c (main): Likewise. + +2015-08-27 Dmitry V. Levin + + tests: fix match_diff usage. + The first argument of match_diff should be the file with expected + output, the second argument - the file with actual output. + + * tests/aio.test: Swap match_diff arguments. + * tests/restart_syscall.test: Likewise. + * tests/seccomp.test: Likewise. + * tests/umovestr2.test: Likewise. + +2015-08-27 Dmitry V. Levin + + build: fix -I options. + * configure.ac (AM_INIT_AUTOMAKE): Add nostdinc. + * Makefile.am (AM_CPPFLAGS): Append -I$(builddir) and -I$(srcdir). + * tests/Makefile.am (AM_CPPFLAGS): Likewise. + +2015-08-26 Dmitry V. Levin + + aio: rewrite from libaio.h to linux/aio_abi.h. + * configure.ac (AC_CHECK_HEADERS): Remove libaio.h. + * aio.c: Assume that is available, + include it instead of . + [!IOCB_RESFD]: Remove. + (enum iocb_sub): Remove SUB_POLL. + (tprint_lio_opcode): Update. + (print_common_flags): Use IOCB_FLAG_RESFD instead of IOCB_RESFD, + rename fields of struct iocb. + (iocb_is_valid, print_iocb_header, print_iocb): New functions. + (sys_io_submit): Use print_iocb. + (print_io_event): Fix struct io_event decoding. + (sys_io_cancel): Use print_iocb_header. + * strace.spec (BuildRequires): Remove libaio-devel. + * tests/aio.c (main): Test IOCB_CMD_PREADV, io_cancel, + and struct io_event decoding. + * tests/aio.test (syscalls): Add io_cancel. + +2015-08-26 Dmitry V. Levin + + Fix multiple personalities support in parser of io_submit syscall. + Introduce a new helper function to fetch tracee's long integers + and use it to fix multiple personalities support in io_submit parser. + + * defs.h (umove_long_or_printaddr): New prototype. + * util.c (umove_long_or_printaddr): New function. + * aio.c (sys_io_submit): Use it to fetch tracee's pointers. + * tests/aio.c: New file. + * tests/aio.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add aio. + (TESTS): Add aio.test. + * tests/.gitignore: Add aio. + +2015-08-26 Dmitry V. Levin + + tests: fix build on systems that lack O_CLOEXEC definition. + * tests/epoll_create1.c (main): Check that O_CLOEXEC is defined. + * tests/eventfd.c (main): Likewise. + * tests/signalfd.c (main): Likewise. + + tests: fix build on systems that lack AT_FDCWD definition. + * tests/readlinkat.c: Stop including . + (main): Replace AT_FDCWD with -100. + + Fix printing of io_getevents first argument. + * aio.c (sys_io_getevents): Print first argument using "%lu" format. + +2015-08-26 Mike Frysinger + + decode extend getsockopt/setsockopt options. + Currently the code assumes the set of valid options between getsockopt + and setsockopt are exactly the same and thus maintains one list. The + kernel unfortunately does not do this -- it allows for different opts + between the get and set functions. See the {g,s}et_opt{min,max} fields + in the various netfilter subcores. + + To support this, extend the printxval function to take multiple sets of + xlats as varargs. Then we add the new get/set lists, and pass them down + in the net code when decoding things. + + A simple example is iptables; before: + getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0 + getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0 + after: + getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0 + getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0 + + If these were setsockopt calls, then 0x40 & 0x41 would be + IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS. + + * configure.ac: Check for netfilter headers. + * defs.h (printxvals): New prototype. + (printxval): Change to a define. + * net.c: Include netfilter headers and new sockopts headers. + (print_sockopt_fd_level_name): Add a is_getsockopt argument. Change SOL_IP + and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more + xlats down. + (getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true. + (setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false. + * util.c (printxval): Rename to ... + (printxvals): ... this. Rewrite to be varargs based. + * xlat/getsockipoptions.in: New xlat list. + * xlat/getsockipv6options.in, xlat/setsockipoptions.in, + xlat/setsockipv6options.in: Likewise. + +2015-08-26 Dmitry V. Levin + + Fix build on systems that lack VIDIOC_CREATE_BUFS definition. + * v4l2.c (v4l2_ioctl): Check that v4l2_ioctl is defined. + + Fix build on systems that lack EM_ARM/EM_OPENRISC definitions. + * xlat/audit_arch.in: Guard AUDIT_ARCH_ARM and AUDIT_ARCH_ARMEB + with EM_ARM check. Guard AUDIT_ARCH_OPENRISC with EM_OPENRISC check. + +2015-08-25 Dmitry V. Levin + + Fix build on systems that lack UBI_IOCVOLCRBLK/UBI_IOCVOLRMBLK definitions + * mtd.c (ubi_ioctl): Check that UBI_IOCVOLCRBLK and UBI_IOCVOLRMBLK + are defined. + + Fix build on systems that lack O_CLOEXEC definition. + * xlat/efd_flags.in: Check that O_CLOEXEC is defined. + * xlat/epollflags.in: Likewise. + * xlat/sfd_flags.in: Likewise. + * xlat/timerfdflags.in: Fix O_CLOEXEC check. + +2015-08-21 Elvira Khabirova + + printsiginfo.c: fix integer conversions. + * printsiginfo.c (printsigsource): Print si_pid and si_uid as unsigned + integers. + (printsigval): Print si_int as signed int. + +2015-08-20 Dmitry V. Levin + + Fix decoding of times syscall return value. + Always print return value of successful times syscall + as unsigned long integer. + + * times.c (sys_times): Return RVAL_UDECIMAL unless syserror. + +2015-08-20 Elvira Khabirova + + mq.c: remove repeated code. + * mq.c (sys_mq_open): Use printmqattr instead of implementing it again. + [HAVE_MQUEUE_H]: Remove. + +2015-08-20 Elvira Khabirova + + ipc_msg.c: fix multiple personalities support in msgrcv ipc subcall. + When msgrcv syscall is an ipc subcall, msgp (pointer to struct msgbuf) + and msgtyp (message type) syscall arguments are passed via proxy + structure which definition significantly depends on tracee's + wordsize. + + * ipc_msg.c (fetch_msgrcv_args): New function. + (sys_msgrcv): Use it. + +2015-08-20 Elvira Khabirova + + ipc.c: split into separate files. + In preparation for upcoming mpers-related changes, + split ipc.c into independent groups of parsers. + + * ipc_defs.h: New file. + * ipc_msg.c: Likewise. + * ipc_msgctl.c: Likewise. + * ipc_sem.c: Likewise. + * ipc_shm.c: Likewise. + * ipc_shmctl.c: Likewise. + * mq.c: Likewise. + * print_mq_attr.c: Likewise. + * print_msgbuf.c: Likewise. + * ipc.c: Remove. + (sys_mq_open, sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, + sys_mq_getsetattr): Move to mq.c. + (sys_msgget, tprint_msgsnd, sys_msgsnd, tprint_msgrcv, sys_msgrcv): Move + to ipc_msg.c. + (sys_msgctl): Move to ipc_msgctl.c. + (tprint_sembuf, tprint_sembuf_array, sys_semop, sys_semtimedop, + sys_semget, syssemctl): Move to ipc_sem.c. + (sys_shmget, sys_shmat, sys_shmdt): Move to ipc_shm.c. + (sys_shmctl): Move to ipc_shmctl.c. + (printmqattr): Move to print_mq_attr.c. + (tprint_msgbuf): Move to print_msgbuf.c. + (IPC_64, PRINTCTL): Move to ipc_defs.h. + * defs.h (struct xlat resource_flags): New prototype. + * Makefile.am (strace_SOURCES): Remove ipc.c. Add ipc_defs.h, mq.c, + ipc_msg.c, ipc_msgctl.c, ipc_sem.c, ipc_shm.c, ipc_shmctl.c, + print_mq_attr.c, and print_msgbuf.c. + +2015-08-20 Elvira Khabirova + + .gitignore: add sen.h and sys_func.h. + +2015-08-19 Dmitry V. Levin + + tests: add sendfile.test and sendfile64.test. + * tests/sendfile.c: New file. + * tests/sendfile64.c: New file. + * tests/sendfile.test: New test. + * tests/sendfile64.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add sendfile and sendfile64. + (TESTS): Add sendfile.test and sendfile64.test. + * tests/.gitignore: Add sendfile and sendfile64. + +2015-08-19 Dmitry V. Levin + + sendfile: decode file offset both on entering and exiting syscall. + When sendfile is called with a valid pointer to a file offset variable, + kernel updates this variable on successfull exit from syscall. + + * sendfile.c (sys_sendfile, sys_sendfile64): Print tcp->u_arg[2] + on exiting syscall as well as on entering. + +2015-08-19 Dmitry V. Levin + + io.c: move sendfile parsers to a separate file. + * sendfile.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * io.c (sys_sendfile, sys_sendfile64): Move to sendfile.c + +2015-08-19 Dmitry V. Levin + + Make printnum_* functions return boolean status. + With this change, printnum_* functions return true iff they + successfully fetched necessary data from tracee's memory. + + * defs.h (printnum_short, printnum_int, printnum_int64, + printnum_long_int, printpair_int, printpair_int64): Return bool. + * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise. + +2015-08-19 Dmitry V. Levin + + mips: print _MIPS_SIM in configure.ac for debug purposes. + * configure.ac [MIPS]: Print _MIPS_SIM. + + xtensa: fix several syscall entries. + * linux/xtensa/syscallent.h: Fix nargs in splice, tee, vmsplice, + pselect6, ppoll, epoll_pwait, and set_robust_list syscall entries. + + ia64: fix syscall numbers for set_robust_list, get_robust_list, and splice syscalls + * linux/ia64/syscallent.h: Place syscall entries for set_robust_list, + get_robust_list, and splice in correct order. + +2015-08-18 Dmitry V. Levin + + tests: add a test for get_robust_list and set_robust_list decoding. + * tests/xet_robust_list.c: New file. + * tests/xet_robust_list.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add xet_robust_list. + (TESTS): Add xet_robust_list.test. + * tests/.gitignore: Add xet_robust_list. + + Simplify printing of get_robust_list first argument. + * get_robust_list.c (sys_get_robust_list): Print first argument + using "%d" format. + +2015-08-18 Elvira Khabirova + + Fix io_setup first argument printing. + * aio.c (sys_io_setup): Print first argument using "%u" format. + +2015-08-18 Dmitry V. Levin + + Fix printing tracee's long integers. + Replace ambiguous printnum_long that used to fetch native long integers + from tracee's memory with printnum_ptr, printnum_slong, and printnum_ulong + that fetch tracee's pointer, signed long, and unsigned long integers. + + * defs.h (printnum_long, printpair_long): Remove prototypes. + (printnum_int64, printpair_int64): Remove macros, declare functions + unconditionally. + [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int): + New prototype. + (printnum_ptr, printnum_slong, printnum_ulong): New macros. + * aio.c (sys_io_setup): Use printnum_ulong. + * block.c (block_ioctl): Use printnum_slong and printnum_ulong. + * get_robust_list.c (sys_get_robust_list): Use printnum_ptr + and printnum_ulong. + * io.c (print_off_t): Remove. + (sys_sendfile): Use printnum_ulong. + * ipc.c (sys_semctl): Use printnum_ptr. + * prctl.c (sys_prctl): Likewise. + * process.c (sys_ptrace): Likewise. + * rtc.c (rtc_ioctl): Use printnum_ulong. + * util.c (printnum_long, printpair_long): Remove. + (printnum_int64, printpair_int64): Define unconditionally. + [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int): + New function. + +2015-08-18 Dmitry V. Levin + + Fix time syscall decoding for some personalities. + * time.c (current_time_t_is_int32): Define. + (sys_time): Use it, printnum_int, and printnum_int64 instead + of printnum_long. + * tests/time.c: New file. + * tests/time.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add time. + (TESTS): Add time.test. + * tests/.gitignore: Add time. + +2015-08-18 Mike Frysinger + + signal: SIGSYS: decode si_syscall & si_arch fields. + When receiving SIGSYS, the si_syscall & si_arch fields are set to known + values, so make sure we decode their values into the symbol settings. + This makes stracing seccomp failures much easier. + + * defs.h (syscall_name): New prototype. + * printsiginfo.c: Include linux/audit.h and xlat/audit_arch.h. + (print_si_info): Decode si_syscall & si_arch for SIGSYS. + * syscall.c (undefined_scno_name): Delete. + (syscall_name): New function. + (trace_syscall_entering): Change undefined_scno_name to syscall_name. + (trace_syscall_exiting): Likewise. + * xlat/audit_arch.in: New file. + +2015-08-18 Elvira Khabirova + + ipc.c: remove unnecesarry #ifdef IPC_64. + * ipc.c (PRINTCTL): Remove #ifdef IPC_64 check as IPC_64 is always + defined at this point. + +2015-08-16 Elvira Khabirova + + resource.c: move times parser to a separate file. + * times.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * resource.c (sys_times): Move to times.c. + +2015-08-16 Elvira Khabirova + + sysctl.c: remove KERN_JAVA_* defines handling. + This has been obsoleted by binfmt_misc since Linux 2.1.43. + + * sysctl.c (sys_sysctl): Remove KERN_JAVA_INTERPRETER + and KERN_JAVA_APPLETVIEWER. + +2015-08-16 Elvira Khabirova + + sysinfo.c: remove obsolete code. + struct sysinfo members totalhigh, freehigh and mem_unit are present + since Linux 2.3.48. + + * configure.ac (AC_CHECK_MEMBERS): Remove struct sysinfo checks. + * sysinfo.c (sys_sysinfo): Remove HAVE_STRUCT_SYSINFO_* checks. + +2015-08-15 Gleb Fotengauer-Malinovskiy + + tests: add readlink.test and readlinkat.test. + * tests/readlink.c: New file. + * tests/readlink.awk: Likewise. + * tests/readlinkat.c: Likewise. + * tests/readlinkat.awk: Likewise. + * tests/readlink.test: New test. + * tests/readlinkat.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add readlink and readlinkat. + (TESTS): Add readlink.test and readlinkat.test. + (EXTRA_DIST): Add readlink.awk and readlinkat.awk. + * tests/.gitignore: Add readlink and readlinkat. + +2015-08-09 Dmitry V. Levin + + Print nanoseconds along with seconds in stat family syscalls. + * configure.ac (AC_CHECK_MEMBERS): Add stat.st_atim.tv_nsec, + stat.st_ctim.tv_nsec, stat.st_mtim.tv_nsec, stat.st_atime_nsec, + stat.st_atime_csec, and stat.st_mtime_nsec. + * file.c: Explicitly define HAVE_STRUCT_STAT_ST_ATIME_NSEC, + HAVE_STRUCT_STAT_ST_CTIME_NSEC and HAVE_STRUCT_STAT_ST_MTIME_NSEC + for locally defined types. + * printstat.h (DO_PRINTSTAT): Print st_atime_nsec, st_ctime_nsec, + and st_mtime_nsec members. + * tests/stat.c [_FILE_OFFSET_BITS == 64]: Use st_atime_nsec, + st_ctime_nsec, and st_mtime_nsec via st_atim.tv_nsec, st_ctim.tv_nsec, + and st_mtim.tv_nsec. + (main): Print st_atime_nsec, st_ctime_nsec, and st_mtime_nsec members. + + This fixes Fedora bug #1251176. + +2015-08-03 Dmitry V. Levin + + signalfd4: fix flags decoding. + * configure.ac (AC_CHECK_FUNCS): Add eventfd. + (AC_CHECK_HEADERS): Add sys/signalfd.h. + * signalfd.c: Include . + [HAVE_SYS_SIGNALFD_H] Include . + Include "xlat/sfd_flags.h". + (do_signalfd): Use sfd_flags for flags decoding. + * xlat/sfd_flags.in: New file. + * tests/signalfd.c: Likewise. + * tests/signalfd.expected: Likewise. + * tests/signalfd.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add signalfd. + (TESTS): Add signalfd.test. + (EXTRA_DIST): Add signalfd.expected. + * tests/.gitignore: Add signalfd. + + signalfd, signalfd4: mark return code with RVAL_FD flag. + * signalfd.c (do_signalfd): Set RVAL_FD flag in the return code. + + signal.c: move signalfd parsers to a separate file. + * signalfd.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * signal.c (do_signalfd, sys_signalfd, sys_signalfd4): Move to signalfd.c + + perf_event_open: mark return code with RVAL_FD flag. + * perf.c (sys_perf_event_open): Set RVAL_FD flag in the return code. + + pipe, pipe2, socketpair: print returned descriptors using printfd. + * net.c (printpair_fd, decode_pair_fd): New functions. + (do_pipe, sys_socketpair): Use them. + + socket: mark return code with RVAL_FD flag. + * net.c (sys_socket): Set RVAL_FD flag in the return code. + * tests/net-yy-accept.awk: Update socket and bind regexps. + * tests/unix-yy-accept.awk: Likewise. + * tests/net-yy-connect.awk: Update socket and connect regexps. + * tests/unix-yy-connect.awk: Likewise. + + timerfd, timerfd_create: mark return code with RVAL_FD flag. + * time.c (sys_timerfd, sys_timerfd_create): Set RVAL_FD flag + in the return code. + +2015-08-02 Dmitry V. Levin + + inotify_init1: mark return code with RVAL_FD flag. + * inotify.c (sys_inotify_init1): Set RVAL_FD flag in the return code. + + fanotify_init: mark return code with RVAL_FD flag. + * fanotify.c (sys_fanotify_init): Set RVAL_FD flag in the return code. + + Fix epoll_create syscall decoding. + * epoll.c (sys_epoll_create): New function. + * linux/dummy.h (sys_epoll_create): Remove. + + epoll_create1: mark return code with RVAL_FD flag. + * epoll.c (sys_epoll_create1): Set RVAL_FD flag in the return code. + + epoll_create1: fix pathtrace support. + * pathtrace.c (pathtrace_match): Add SEN_epoll_create1. + + epoll_create1: fix flags decoding. + * xlat/epollflags.in: Remove EPOLL_NONBLOCK, provide fallback definition + for EPOLL_CLOEXEC. + * tests/epoll_create1.c: New file. + * tests/epoll_create1.expected: Likewise. + * tests/epoll_create1.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add epoll_create1. + (TESTS): Add epoll_create1.test. + (EXTRA_DIST): Add epoll_create1.expected. + * tests/.gitignore: Add epoll_create1. + +2015-08-01 Dmitry V. Levin + + desc.c: move epoll parsers to a separate file. + * epoll.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * desc.c (sys_epoll_create1, print_epoll_event, sys_epoll_ctl, + print_epoll_event_array, epoll_wait_common, epoll_wait, epoll_pwait): + Move to epoll.c. + + eventfd2: fix flags decoding. + * configure.ac (AC_CHECK_HEADERS): Add sys/eventfd.h. + * eventfd.c: Include . + [HAVE_SYS_EVENTFD_H] Include . + Include "xlat/efd_flags.h". + (do_eventfd): Use efd_flags for flags decoding. + * xlat/efd_flags.in: New file. + * tests/eventfd.c: New file. + * tests/eventfd.expected: Likewise. + * tests/eventfd.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add eventfd. + (TESTS): Add eventfd.test. + (EXTRA_DIST): Add eventfd.expected. + * tests/.gitignore: Add eventfd. + + eventfd: print first argument as unsigned int. + * eventfd.c (do_eventfd): Explicitly cast initial value to unsigned int. + + Mark eventfd return code with RVAL_FD flag. + * eventfd.c (do_eventfd): Set RVAL_FD flag in the return code. + + desc.c: move eventfd parsers to a separate file. + * eventfd.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * desc.c (do_eventfd, sys_eventfd, sys_eventfd2): Move to eventfd.c. + + Update PERF_FLAG_* constants. + * xlat/perf_event_open_flags.in: Add PERF_FLAG_FD_CLOEXEC, + provide fallback definitions. + + desc.c: move perf_event_open parser to a separate file. + * perf.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * desc.c (sys_perf_event_open): Move to perf.c. + +2015-08-01 Elvira Khabirova + + time.c: remove obsolete code from adjtimex parser. + Linux versions 1.3.28 and below are not supported. + + * time.c (tprint_timex) [LINUX_VERSION_CODE < 66332]: Remove. + +2015-08-01 Elvira Khabirova + + ipc.c: move fallback definitions of msg, sem, and shm constants to xlat/ + * ipc.c: Move MSG_STAT and MSG_INFO definitions to xlat/msgctl_flags.in. + Move SHM_STAT and SHM_INFO definitions to xlat/shmctl_flags.in. + Move SEM_STAT and SEM_INFO definitions to xlat/semctl_flags.in. + +2015-08-01 Dmitry V. Levin + + tests/ppoll: replace SIGABRT with SIGHUP. + Use SIGHUP instead of SIGABRT, the number of the former + is more portable across architectures. + + * tests/ppoll.c (test2): Replace SIGABRT with SIGHUP. + * tests/ppoll.expected: Update regexp. + * tests/ppoll-v.expected: Likewise. + +2015-08-01 Dmitry V. Levin + + decode_poll_exiting: reserve more space in output buffer. + * poll.c (decode_poll_exiting): Reserve more space in output buffer. + +2015-07-30 Dmitry V. Levin + + Cleanup poll/ppoll decoders. + * poll.c (decode_poll): Split into print_pollfd, decode_poll_entering, + and decode_poll_exiting. + (sys_poll, sys_ppoll): Update callers. + * tests/ppoll.c: New file. + * tests/ppoll.expected: Likewise. + * tests/ppoll-v.expected: Likewise. + * tests/ppoll.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add ppoll. + (TESTS): Add ppoll.test. + (EXTRA_DIST): Add ppoll.expected and ppoll-v.expected. + * tests/.gitignore: Add ppoll. + + poll: print timeout argument as int. + * poll.c (sys_poll): Explicitly cast timeout argument to int. + + stream.c: move poll and ppoll parsers to a separate file. + * poll.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * stream.c (decode_poll, sys_poll, sys_ppoll): Move to poll.c. + + Assume that is available. + * configure.ac (AC_CHECK_HEADERS): Remove poll.h and sys/poll.h. + * pathtrace.c: Include unconditionally. + * stream.c: Likewise. + [HAVE_SYS_POLL_H]: Compile unconditionally. + [!HAVE_SYS_POLL_H]: Remove. + + tests: add oldselect.test. + * tests/oldselect.c: New file. + * tests/oldselect.expected: Likewise. + * tests/oldselect.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add oldselect. + (TESTS): Add oldselect.test. + (EXTRA_DIST): Add oldselect.expected. + * tests/.gitignore: Add oldselect. + +2015-07-30 Elvira Khabirova + + Fix oldselect decoding on 64-bit architectures. + As struct sel_arg_struct is an array of 32-bit values, + fetch it using an intermediate array on 64-bit architectures. + + * desc.c (sys_oldselect): Rename args to long_args. + [SIZEOF_LONG == 4] Alias oldselect_args to long_args. + [SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args. + * linux/sh64/syscallent.h (oldselect): Remove. + +2015-07-30 Dmitry V. Levin + + net.c: use printaddr. + * net.c (printsock, sys_recvfrom): Use printaddr. + +2015-07-30 Denys Vlasenko + + net.c: recvfrom fixes. + This change fixes these three problems (before/after is shown): + + On interrupted syscall, flags are not decoded: + + -recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS + +recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS + + If peer address is unavalable (example: anon sockets from socketpair()), + kernel returns socklen of 0, but we ignore that and show bogus sockaddr data: + + -recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10 + +recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10 + + SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock(): + + - printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]); + + printsock(tcp, tcp->u_arg[4], fromlen); + +2015-07-29 Elliott Hughes + + prctl: decode Android-specific PR_SET_VMA. + Android kernels have a prctl to name VMAs. + + * prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA. + +2015-07-29 Dmitry V. Levin + + mips: fix stub files. + This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc. + + * linux/mips/genstub.sh: Output SEN(printargs) instead of printargs. + + Reported-by: Elliott Hughes + +2015-07-29 Dmitry V. Levin + + tests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc. + * configure.ac: Check how union bpf_attr.log_buf initialization works. + * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_LOG_BUF. + + Implement sched_getattr and sched_setattr syscalls decoding. + * xlat/sched_flags.in: New file. + * sched.c: Include "xlat/sched_flags.h". + (print_sched_attr, sys_sched_setattr, sys_sched_getattr): New functions. + * linux/dummy.h (sys_sched_getattr, sys_sched_setattr): Remove. + * tests/sched_xetattr.c: New file. + * tests/sched_xetattr.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add sched_xetattr. + (TESTS): Add sched_xetattr.test. + * tests/.gitignore: Add sched_xetattr. + + Implement memfd_create syscall decoding. + * memfd_create.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_memfd_create): Remove. + * pathtrace.c (pathtrace_match): Add SEN_memfd_create. + * xlat/memfd_create_flags.in: New file. + * tests/memfd_create.c: New file. + * tests/memfd_create.expected: Likewise. + * tests/memfd_create.test: New test. + * tests/Makefile.am: (check_PROGRAMS): Add memfd_create. + (TESTS): Add memfd_create.test. + (EXTRA_DIST): Add memfd_create.expected. + * tests/.gitignore: Add memfd_create. + +2015-07-28 Elliott Hughes + + Fix builds where HAVE_MQUEUE_H isn't defined. + Android doesn't have . + + * ipc.c (sys_mq_open) [!HAVE_MQUEUE_H]: Fix printaddr invocation. + +2015-07-27 Dmitry V. Levin + + tests/restart_syscall: skip if nanosleep looks uninterrupted. + * tests/restart_syscall.test: Skip if restart_syscall is not detected + and nanosleep syscall looks uninterrupted. + + Implement execveat syscall decoding. + * execve.c (decode_execve): New function. + (sys_execve): Use it. + (sys_execveat): New function. + * linux/dummy.h (sys_execveat): Remove. + * tests/execveat.c: New file. + * tests/execveat.expected: Likewise. + * tests/execveat-v.expected: Likewise. + * tests/execveat.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add execveat. + (TESTS): Add execveat.test. + (EXTRA_DIST): Add execveat.expected and execveat-v.expected. + * tests/.gitignore: Add execveat. + + execve: fix support of personalities with different word size. + * execve.c (printargc): Do not assume that host and target pointers have + the same size. + * tests/execve.c: New file. + * tests/execve.expected: Likewise. + * tests/execve-v.expected: Likewise. + * tests/execve.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add execve. + (TESTS): Add execve.test. + (EXTRA_DIST): Add execve.expected and execve-v.expected. + * tests/.gitignore: Add execve. + + Implement bpf syscall decoding. + * bpf.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * configure.ac (AC_CHECK_HEADERS): Add linux/bpf.h. + * linux/dummy.h (sys_bpf): Remove. + * pathtrace.c (pathtrace_match): Add SEN_bpf. + * xlat/bpf_commands.in: New file. + * xlat/bpf_map_types.in: New file. + * xlat/bpf_map_update_elem_flags.in: New file. + * xlat/bpf_prog_types.in: New file. + * tests/bpf.c: New file. + * tests/bpf.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add bpf. + (TESTS): Add bpf.test. + * tests/.gitignore: Add bpf. + +2015-07-25 Dmitry V. Levin + + prctl: fix decoding of unrecognized commands. + The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong: + when the first argument is already printed, printargs cannot be called. + + * prctl.c (print_prctl_args): New function. + (sys_prctl): Use it. + +2015-07-23 Dmitry V. Levin + + Macroize -m32/-mx32 configure checks. + Prepare for additional configure checks that would be needed + for new multiple personalities support. + + * m4/mpers.m4: New file. + * configure.ac: Use it. + +2015-07-22 Dmitry V. Levin + + tests/uid: import uid overflow check from tests/uid16. + * tests/uid.c (main): Skip if the uid returned by getuid matches + /proc/sys/kernel/overflowuid. + +2015-07-21 Dmitry V. Levin + + sh64: fix inotify_{add,rm}_watch syscall entries. + * linux/sh64/syscallent.h (inotify_add_watch, inotify_rm_watch): + Set sys_func. + + microblaze: fix several syscall entries. + * linux/microblaze/syscallent.h (signalfd4, eventfd2, epoll_create1, + dup3, pipe2, inotify_init1, recvmmsg): Set sys_func. + + hppa: fix several syscall entries. + * linux/hppa/syscallent.h (remap_file_pages, mq_open, mq_unlink, + mq_timedsend, mq_timedreceive, mq_notify, mq_getsetattr, + clock_nanosleep, signalfd, timerfd): Set sys_func. + + ia64: fix getpagesize syscall entry. + * linux/ia64/syscallent.h (getpagesize): Fux nargs. + + avr32: fix fstatat64 syscall entry. + * linux/avr32/syscallent.h (fstatat64): Set sys_func. + + alpha: fix 2 dummy osf syscall entries. + * linux/alpha/syscallent.h (osf_set_program_attributes): Fix nargs. + (osf_sigstack): Fix nargs and sys_name. + + alpha, arm, ia64, mips, sh64: fix semop syscall entries. + * linux/alpha/syscallent.h (semop): Fix nargs, set sys_func. + * linux/ia64/syscallent.h (semop): Set sys_func. + * linux/mips/syscallent-n32.h (semop): Likewise. + * linux/mips/syscallent-n64.h (semop): Likewise. + * linux/arm/syscallent.h (semop): Fix nargs. + * linux/sh64/syscallent.h (semop): Likewise. + + m68k: fix getpagesize decoding. + * linux/m68k/syscallent.h (getpagesize): Set sys_func. + * mem.c [M68K] (sys_getpagesize): Define. + + tests/ip_mreq: skip if basic setsockopt operations fail. + * tests/ip_mreq.c (main): Return 77 if basic + IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP options cannot be set. + +2015-07-21 Dmitry V. Levin + + tests: use -lpthread instead of -pthread. + On some obscure systems, -lpthread is more likely to work than -pthread. + + * tests/Makefile.am (filter_unavailable_LDFLAGS): Rename to + filter_unavailable_LDADD and change to -lpthread. + +2015-07-21 Dmitry V. Levin + + mips o32: fix utimensat syscall entry. + * linux/mips/syscallent-o32.h (utimensat): set sys_flags and sys_func. + +2015-07-21 Dmitry V. Levin + + linux/mips/syscallent-compat.h: use designated initializers. + Change linux/mips/syscallent-compat.h to use designated initializers + like normal syscallent.h files. + + * linux/mips/syscallent-compat.h: Use designated initializers. + +2015-07-21 Dmitry V. Levin + + linux/mips/syscallent-compat.h: fix initalization of empty entries. + This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc. + + * linux/mips/syscallent-compat.h: Fix initalization of empty entries. + +2015-07-20 Dmitry V. Levin + + Remove unused parsers of getmsg and putmsg. + * stream.c [SPARC || SPARC64] (sys_putmsg, sys_getmsg): Remove. + Stop including "xlat/msgflags.h". + * xlat/msgflags.in: Remove. + + sigreturn: make use of RVAL_DECODED. + * sigreturn.c (arch_sigreturn): New function. + (sys_sigreturn): Use it. Return RVAL_DECODED. + * linux/alpha/arch_sigreturn.c: Update. + * linux/crisv10/arch_sigreturn.c: Likewise. + * linux/m68k/arch_sigreturn.c: Likewise. + * linux/microblaze/arch_sigreturn.c: Likewise. + * linux/x86_64/arch_sigreturn.c: Likewise. + + or1k_atomic.c: make use of RVAL_DECODED. + * or1k_atomic.c (sys_or1k_atomic): Update for RVAL_DECODED. + + Update openat parser for the RVAL_DECODED change. + * open.c (sys_openat): Update for RVAL_DECODED. + + bjm.c: make use of RVAL_DECODED. + * bjm.c (sys_create_module, sys_delete_module, sys_init_module, + sys_finit_module): Update for RVAL_DECODED. + + access.c: make use of RVAL_DECODED. + * access.c (decode_access, sys_faccessat): Update for RVAL_DECODED. + + affinity.c: make use of RVAL_DECODED. + * affinity.c (sys_sched_setaffinity): Update for RVAL_DECODED. + + affinity.c: use printaddr and umove_or_printaddr. + * affinity.c (print_affinitylist): Use printaddr and umove_or_printaddr. + (sys_sched_getaffinity): Remove redundant u_rval check. + + aio.c: enhance io_* syscalls decoding. + * aio.c (sys_io_setup): Use printnum_int64 and printnum_long. + (sys_io_destroy, sys_io_submit): Update for RVAL_DECODED. + (sys_io_submit): Use umove_or_printaddr and printaddr. + Enclose iocb array in square brackets. + Change to traditional structure output format. + (print_io_event): New function. + (sys_io_cancel, sys_io_getevents): Use it. + (sys_io_cancel): Use umove_or_printaddr and printaddr. + (sys_io_getevents): Use printaddr. + + cacheflush.c: make use of RVAL_DECODED. + * cacheflush.c (sys_cacheflush): Update for RVAL_DECODED. + + cacheflush.c: use printaddr. + * cacheflush.c (sys_cacheflush): Use printaddr. + + capability.c: make use of RVAL_DECODED. + * capability.c (sys_capset): Update for RVAL_DECODED. + + capability.c: use printaddr and umove_or_printaddr. + * capability.c (get_cap_header): Use printaddr. + (print_cap_data): Use printaddr and umove_or_printaddr. + + chdir.c: make use of RVAL_DECODED. + * chdir.c (sys_chdir): Update for RVAL_DECODED. + + chmod.c: make use of RVAL_DECODED. + * chmod.c (decode_chmod): Change to return void. + (sys_chmod, sys_fchmodat): Update callers. Update for RVAL_DECODED. + (sys_fchmod): Update for RVAL_DECODED. + + clone.c: make use of RVAL_DECODED. + * clone.c (sys_setns, sys_unshare, sys_fork): Update for RVAL_DECODED. + + Alias sys_epoll_create to printargs_ld. + * desc.c (sys_epoll_create): Remove. + * linux/dummy.h (sys_epoll_create): Alias to printargs_ld. + + desc.c: make use of RVAL_DECODED. + * desc.c (sys_flock, sys_close, sys_dup, do_dup2, sys_epoll_create1, + sys_epoll_ctl, do_eventfd, sys_perf_event_open): Update + for RVAL_DECODED. + + desc.c: do not use xmalloc, use umove_or_printaddr and printaddr. + * desc.c (printflock64, printflock): Use umove_or_printaddr. + (decode_select): Do not use xmalloc. Use umoven_or_printaddr + and printaddr. + (sys_oldselect): Use printaddr. + (sys_epoll_ctl): Use umoven_or_printaddr and printaddr. + (print_epoll_event_array): New function. + (sys_epoll_wait_common): Use it. + (sys_pselect6): Use umove_or_printaddr. + (sys_eventfd2): Use printaddr. + + xlat/epollctls.in: add default values. + * xlat/epollctls.in (EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD): Add + default values. + + dirent.c: do not use xmalloc. + * dirent.c (print_old_dirent): Use umove_or_printaddr. + (sys_readdir): Use printaddr. + (sys_getdents, sys_getdents64): Do not use xmalloc for dirents, + treat malloc failure the same way as umoven failure. Use printaddr. + + execve.c: make use of RVAL_DECODED. + * execve.c (sys_execve, sys_execv): Update for RVAL_DECODED. + + execve.c: use printaddr and umove_or_printaddr. + * execve.c (printargv): Use umoven_or_printaddr. + (sys_execve, sys_execv): Use printaddr. + + fadvise.c: make use of RVAL_DECODED. + * fadvise.c (sys_fadvise64, sys_fadvise64_64): Update for RVAL_DECODED. + + fallocate.c: make use of RVAL_DECODED. + * fallocate.c (sys_fallocate): Update for RVAL_DECODED. + + fanotify.c: make use of RVAL_DECODED. + * fanotify.c (sys_fanotify_init, sys_fanotify_mark): Update + for RVAL_DECODED. + + fchownat.c: make use of RVAL_DECODED. + * fchownat.c (sys_fchownat): Update for RVAL_DECODED. + + file.c: use umove_or_printaddr. + * file.c (printstat32, printstatsol): Remove. + (printstat, printstat64, printoldstat): Use umove_or_printaddr. + + futex.c: enhance futex syscall decoding. + * futex.c (sys_futex): Use switch statement. Use printaddr. + Print uint32_t syscall arguments using %u format. + Update for RVAL_DECODED. + + get_robust_list.c: use printnum_long. + * get_robust_list.c (sys_get_robust_list): Use printnum_long. + + getcpu.c: use printnum_int and printaddr. + * getcpu.c (sys_getcpu): Use printnum_int and printaddr. + + getcwd.c: use printaddr. + * getcwd.c (sys_getcwd): Use printaddr. + + getrandom.c: use printaddr. + * getrandom.c (sys_getrandom): Use printaddr. + + hostname.c: make use of RVAL_DECODED. + * hostname.c (sys_sethostname): Update for RVAL_DECODED. + + hostname.c: use printaddr. + * hostname.c (sys_gethostname): Use printaddr. + + inotify.c: make use of RVAL_DECODED. + * inotify.c (sys_inotify_add_watch, sys_inotify_rm_watch, + sys_inotify_init1): Update for RVAL_DECODED. + + io.c: make use of RVAL_DECODED. + * io.c (sys_write, sys_writev, sys_pwrite, sys_pwritev, sys_sendfile, + sys_sendfile64, sys_tee, sys_splice, sys_vmsplice): Update + for RVAL_DECODED. + + Use printnum_int64 instead of print_loff_t. + * defs.h (print_loff_t): Remove. + * io.c (print_loff_t): Remove. + (sys_sendfile64, sys_splice): Use printnum_int64 instead of print_loff_t. + * mtd.c (mtd_ioctl): Likewise. + + io.c: use printaddr and umove_or_printaddr. + * io.c (sys_read, sys_pread): Use printaddr. + (tprint_iov_upto): Do not fetch data in case of syserror. + Use printaddr. + (sys_readv, sys_preadv): Remove redundant check for syserror. + (print_off_t): Use printnum_int and printnum_long. + (print_loff_t): Use umove_or_printaddr. + + ioprio.c: make use of RVAL_DECODED. + * ioprio.c (sys_ioprio_set): Update for RVAL_DECODED. + + ipc.c: use printaddr and umove_or_printaddr. + * ipc.c (sys_msgctl): Use printaddr. + (tprint_msgbuf): New function. + (tprint_msgsnd, tprint_msgrcv): Use it. + (sys_msgrcv): Use umove_or_printaddr. + (tprint_sembuf): Rename to tprint_sembuf_array. + (tprint_sembuf): New function. + (tprint_sembuf_array): Use it. + (sys_semop, sys_semtimedop): Update callers. + (sys_shmctl, sys_shmat, sys_shmdt): Use printaddr. + (sys_mq_open, printmqattr): Use printaddr and umove_or_printaddr. + * tests/ipc_msg.c (main): Update msgctl IPC_RMID regexp. + * tests/ipc_shm.c (main): Update shmctl IPC_RMID regexp. + + kexec.c: use printaddr and umove_or_printaddr. + * kexec.c (print_seg): New function. + (print_kexec_segments): Use it. Use printaddr and umove_or_printaddr. + (kexec_load): Use printaddr. Update for RVAL_DECODED. + + keyctl.c: make use of RVAL_DECODED. + * keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED. + (keyctl_join_session_keyring, keyctl_handle_key, + keyctl_set_reqkey_keyring): Remove. + (keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key, + keyctl_read_key, keyctl_keyring_search, keyctl_chown_key, + keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key, + keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent, + keyctl_setperm_key): Change to return void. + Update for RVAL_DECODED. + (sys_keyctl): Update callers. Update for RVAL_DECODED. + + keyctl.c: use printaddr. + * keyctl.c (keyctl_read_key): Use printaddr. + + ldt.c: make use of RVAL_DECODED. + * ldt.c (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): + Update for RVAL_DECODED. + + ldt.c: use printaddr and umove_or_printaddr. + * ldt.c [I386 || X86_64 || X32] (print_user_desc): + Use umove_or_printaddr. + [I386 || X86_64 || X32] (sys_modify_ldt): Use printaddr. + [(M68K || MIPS] (set_thread_area): Likewise. + [I386 || X86_64 || X32] (set_thread_area): Do not fetch data + if !verbose. + [I386 || X86_64 || X32] (get_thread_area): Remove redundant check + for syserror. + + link.c: make use of RVAL_DECODED. + * link.c (sys_link, sys_linkat, sys_unlinkat, sys_symlinkat): Update + for RVAL_DECODED. + + lseek.c: make use of RVAL_DECODED. + * lseek.c (sys_lseek): Update for RVAL_DECODED. + + lseek.c: use printnum_int64. + * lseek.c (sys_llseek): Use printnum_int64. + + mem.c: make use of RVAL_DECODED. + * mem.c (print_mmap): Change to return void. + Update for RVAL_DECODED. + (sys_old_mmap, sys_old_mmap_pgoff, sys_mmap, sys_mmap_pgoff, + sys_mmap_4koff): Update callers. Update for RVAL_DECODED. + (sys_brk, sys_munmap, sys_mprotect, sys_mremap, sys_madvise, + sys_mlockall, sys_msync, sys_remap_file_pages, sys_mbind, + sys_set_mempolicy, sys_migrate_pages, [POWERPC] subpage_prot): + Update for RVAL_DECODED. + + mem.c: use printaddr and umove_or_printaddr. + * mem.c (sys_brk, print_mmap, sys_munmap, sys_mprotect, sys_mremap, + sys_madvise, sys_msync, sys_mincore, sys_remap_file_pages, get_nodes, + sys_mbind, [POWERPC] sys_subpage_prot): Use printaddr. + (sys_get_mempolicy): Use printaddr and umove_or_printaddr. + + mknod.c: make use of RVAL_DECODED. + * mknod.c (decode_mknod): Change to return void. + Update for RVAL_DECODED. + (sys_mknod, sys_mknodat): Update callers. Update for RVAL_DECODED. + [SPARC || SPARC64] (xmknod): Update for RVAL_DECODED. + + mount.c: make use of RVAL_DECODED. + * mount.c (sys_mount): Update for RVAL_DECODED. + + mount.c: use printaddr. + * mount.c (sys_mount): Use printaddr. + + Alias sys_connect to sys_bind. + * linux/dummy.h (sys_connect): Alias to sys_bind. + * net.c (sys_connect): Remove. + + net.c: make use of RVAL_DECODED. + * net.c (sys_socket, sys_bind, sys_listen, sys_send, sys_sendto, + sys_sendmsg, sys_shutdown, sys_setsockopt): Update for RVAL_DECODED. + + net.c: use printaddr and umove_or_printaddr. + * net.c (printsock): Use printaddr and umove_or_printaddr. + (printcmsghdr, printmsghdr, printmmsghdr, decode_mmsg, do_sockname, + sys_recv, sys_recvfrom, sys_recvmsg, do_pipe, print_linger, print_ucred, + print_tpacket_stats, print_icmp_filter, print_getsockopt, + print_group_req, print_tpacket_req, print_packet_mreq, + print_setsockopt): Use printaddr. + (print_mreq, print_mreq6): Use umove_or_printaddr. + +2015-07-18 Elvira Khabirova + + tests: add sigaltstack.test. + * tests/sigaltstack.c: New file. + * tests/sigaltstack.expected: Likewise. + * tests/sigaltstack.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add sigaltstack. + (TESTS): Add sigaltstack.test. + (EXTRA_DIST): sigaltstack.expected. + * tests/.gitignore: Add sigaltstack. + + bootstrap: delete personality test directories beforehand. + * bootstrap: Delete tests-m32 and tests-mx32 directories + before creating them. + +2015-07-18 Dmitry V. Levin + + defs.h: do not include + * printsiginfo.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h: Do not include . + (printsiginfo): Remove. + * printsiginfo.c: Include and "printsiginfo.h". + * strace.c: Likewise. + * sigaltstack.c: Include . + * signal.c: Likewise. + * sigreturn.c: Likewise. + * time.c: Likewise. + + resource.c: move printrusage and printrusage32 to a separate file. + * printrusage.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * resource.c (printrusage, [ALPHA] printrusage32): Move + to printrusage.c. + + open.c: make use of RVAL_DECODED. + * open.c (decode_open, sys_creat): Update for RVAL_DECODED. + + personality.c: make use of RVAL_DECODED. + * personality.c (sys_personality): Update for RVAL_DECODED. + + printsiginfo.c: use umove_or_printaddr. + * printsiginfo.c (printsiginfo_at): Use umove_or_printaddr. + + prctl.c: make use of RVAL_DECODED. + * prctl.c (prctl_enter, prctl_exit): Merge into sys_prctl. + (sys_prctl, sys_arch_prctl): Update for RVAL_DECODED. + + prctl.c: use printaddr and umove_or_printaddr. + * prctl.c (prctl_exit): Use printaddr and umove_or_printaddr. + + process.c: use printaddr. + * process.c (sys_ptrace): Use printaddr. + + process_vm.c: make use of RVAL_DECODED. + * process_vm.c (sys_process_vm_writev): Update for RVAL_DECODED. + + process_vm.c: use printaddr. + * process_vm.c (sys_process_vm_readv): Use printaddr. + + reboot.c: make use of RVAL_DECODED. + * reboot.c (sys_reboot): Update for RVAL_DECODED. + + Enhance quotactl decoding. + * quota.c (decode_cmd_data): Use umove_or_printaddr. + (sys_quotactl): Do not disable the parser in verbose mode. + Decode all "set" commands on entering syscall. + + readahead.c: make use of RVAL_DECODED. + * readahead.c (sys_readahead.c): Update for RVAL_DECODED. + + readlink.c: use printaddr. + * readlink.c (decode_readlink): Use printaddr. + + renameat.c: make use of RVAL_DECODED. + * renameat.c (sys_renameat, sys_renameat2): Update for RVAL_DECODED. + + resource.c: make use of RVAL_DECODED. + * resource.c (sys_setrlimit, sys_getpriority, sys_setpriority): + Update for RVAL_DECODED. + + resource.c: use umove_or_printaddr. + * resource.c (print_rlimit64, print_rlimit32, printrusage32, + printrusage, sys_times): Use umove_or_printaddr. + (decode_rlimit64): Remove. + (decode_rlimit): Remove redundant checks. + [defined(current_wordsize) && current_wordsize != 4] (decode_rlimit): + Define to print_rlimit64. + (sys_prlimit64): Replace decode_rlimit64 with print_rlimit64. + + sched.c: make use of RVAL_DECODED. + * sched.c (sys_sched_setscheduler, sys_sched_setparam, + sys_sched_get_priority_min): Update for RVAL_DECODED. + + sched.c: use printnum_int and printaddr. + * sched.c (sys_sched_setscheduler, sys_sched_getparam, + sys_sched_setparam): Use printnum_int for sched_param decoding. + (sched_rr_get_interval): Use printaddr. + + scsi.c: use printaddr. + * scsi.c (print_sg_io_buffer): Use printaddr. + +2015-07-17 Dmitry V. Levin + + seccomp.c: make use of RVAL_DECODED. + * seccomp.c (sys_seccomp): Update for RVAL_DECODED. + + seccomp.c: use printaddr and umove_or_printaddr. + * seccomp.c (decode_fprog, decode_seccomp_set_mode_strict): + Use printaddr. + (print_seccomp_filter): Use umove_or_printaddr. + + sigaltstack.c: use printaddr and umove_or_printaddr. + * sigaltstack.c (print_stack_t): Use umove_or_printaddr and printaddr. + + signal.c: make use of RVAL_DECODED. + * signal.c (sys_sigsuspend, sys_kill, sys_tgkill, sys_rt_sigsuspend, + sys_rt_sigqueueinfo, sys_rt_tgsigqueueinfo, sys_restart_syscall, + do_signalfd): Update for RVAL_DECODED. + + signal.c: use printaddr and umove_or_printaddr. + * signal.c (print_sigset_addr_len, decode_old_sigaction): + Use printaddr and umove_or_printaddr. + (sys_signal): Use printaddr. + (sys_sigprocmask, sys_sigpending, sys_rt_sigprocmask, + sys_rt_sigpending): Remove redundant checks for syserror. + (decode_new_sigaction): Use umove_or_printaddr. + +2015-07-16 Dmitry V. Levin + + sram_alloc.c: make use of RVAL_DECODED. + * sram_alloc.c [BFIN] (sys_sram_alloc): Update for RVAL_DECODED. + + statfs.c: use umove_or_printaddr. + * statfs.c (printstatfs, printstatfs64, printcompat_statfs64): + Use umove_or_printaddr. + + swapon.c: make use of RVAL_DECODED. + * swapon.c (sys_swapon): Update for RVAL_DECODED. + + swapon.c: move fallback definitions of swap options to xlat/ + * swapon.c: Move definitions of SWAP_FLAG_* flags ... + * xlat/swap_flags.in: ... here. + + sync_file_range2: fix typo in flags decoding. + * sync_file_range.c (sys_sync_file_range2): Fix typo in flags decoding. + + sync_file_range.c: make use of RVAL_DECODED. + * sync_file_range.c (sys_sync_file_range, sys_sync_file_range2): Update + for RVAL_DECODED. + + syslog.c: use umove_or_printaddr and RVAL_DECODED. + * sysctl.c (sys_sysctl): Use umove_or_printaddr and RVAL_DECODED. + + sysinfo.c: use umove_or_printaddr. + * sysinfo.c (sys_sysinfo): Use umove_or_printaddr. + + syslog.c: make use of RVAL_DECODED. + * syslog.c (sys_syslog): Update for RVAL_DECODED. + + syslog.c: use printaddr. + * syslog.c (sys_syslog): Use printaddr. + + sysmips.c: cleanup. + * sysmips.c [MIPS] (sys_sysmips): Use switch statement. Use printaddr. + Fix misprinted ", " delimiter. + + sysmips.c: make use of RVAL_DECODED. + * sysmips.c [MIPS] (sys_sysmips): Update for RVAL_DECODED. + + time.c: make use of RVAL_DECODED. + * time.c (sys_settimeofday, sys_osf_settimeofday, sys_clock_settime, + sys_timerfd, sys_timerfd_create, sys_timerfd_settime): Update + for RVAL_DECODED. + (timerfd_gettime): Decode struct itimerspec argument on exiting syscall. + + time.c: use printaddr, printnum_int, and umoven_or_printaddr. + * time.c (sys_nanosleep): Use printaddr. + (printitv_bitness, tprint_timex32, tprint_timex, printsigevent32, + printsigevent): Use umoven_or_printaddr. + (sys_timer_create): Use printnum_int. + (sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer, + do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove + redundant checks for syserror. + + sprinttv: do not fetch data in case of syserror. + * time.c (sprinttv): Do not fetch data in case syserror. + Print address instead of {...} in case of umove failure. + (sys_gettimeofday, sys_osf_gettimeofday, sys_adjtime, sys_clock_gettime, + clock_nanosleep): Remove now redundant checks for syserror. + + truncate.c: make use of RVAL_DECODED. + * truncate.c (sys_truncate, sys_truncate64, sys_ftruncate, + sys_ftruncate64): Update for RVAL_DECODED. + + umask.c: make use of RVAL_DECODED. + * umask.c (sys_umask): Update for RVAL_DECODED. + + umount.c: make use of RVAL_DECODED. + * umount.c (sys_umount2): Update for RVAL_DECODED. + + utimes.c: make use of RVAL_DECODED. + * utimes.c (decode_utimes): Change to return void. + Update for RVAL_DECODED. + (sys_utimes, sys_futimesat, sys_utimensat, sys_osf_utimes): + Update callers. Update for RVAL_DECODED. + +2015-07-16 Dmitry V. Levin + + tests/uid.test: adopt for alpha. + Make the test work on alpha that has getxuid syscall instead of getuid. + + * tests/uid.awk (BEGIN): Update getuid regexp to match both getuid + and getxuid syscalls. + * tests/uid.c (main): Allow __NR_getxuid as an alternative + to __NR_getuid. + * tests/uid.test: If getuid syscall is not available, probe for + getxuid syscall. + +2015-07-16 Dmitry V. Levin + + uid.c: make use of RVAL_DECODED. + * uid.c (sys_setuid, sys_setreuid, sys_setresuid, sys_chown, sys_fchown, + sys_setgroups): Update for RVAL_DECODED. + + uid.c: use printaddr and umoven_or_printaddr. + * uid.c (get_print_uid): Use umoven_or_printaddr. + (sys_getresuid): Do not check for syserror, get_print_uid now does + the right thing. + (sys_setgroups, sys_getgroups): Add const qualifier to local variables + that are assigned once. Use printaddr. + + ia64: wire up utimensat syscall. + * linux/ia64/syscallent.h (utimensat): New entry. + + decode_utimes: enclose timespec array in square brackets. + * utimes.c (decode_utimes): enclose timespec array in square brackets + instead of curly brackets. + + uname.c: use umove_or_printaddr. + * uname.c (sys_uname): Use umove_or_printaddr. + + tests: add utime.test. + * tests/utime.c: New file. + * tests/utime.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add utime. + (TESTS): Add utime.test. + * tests/.gitignore: Add utime. + + utime.c: make use of RVAL_DECODED. + * utime.c (sys_utime): Update for RVAL_DECODED. + + utime.c: use umoven_or_printaddr. + * utime.c (sys_utime): Use umoven_or_printaddr. + +2015-07-15 Dmitry V. Levin + + wait.c: use printaddr and umove_or_printaddr. + * wait.c (waitid): Do not check for NULL the address passed + to printrusage. + (printwaitn): Likewise. + Use printaddr and umove_or_printaddr for fetching wait status. + + wait: move fallback definitions of wait options to xlat/ + * wait.c: Move definitions of __W* flags ... + * xlat/wait4_options.in: ... here. + + tests: add xattr.test. + * tests/xattr.c: New file. + * tests/xattr.expected: Likewise. + * tests/xattr.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add xattr. + (TESTS): Add xattr.test. + (EXTRA_DIST): Add xattr.expected. + * tests/.gitignore: Add xattr. + +2015-07-14 Dmitry V. Levin + + xattr.c: make use of RVAL_DECODED. + * xattr.c (sys_setxattr, sys_fsetxattr, sys_removexattr, + sys_fremovexattr): Update for RVAL_DECODED. + + print_xattr_val: do not fetch data in case of !verbose || syserror. + * xattr.c (print_xattr_val): Do not fetch data in case + of !verbose || syserror. Use printaddr. + + print_xattr_list: use printaddr. + * xattr.c (print_xattr_list): Use printaddr. + + print_xattr_val: remove unused argument. + * xattr.c (print_xattr_val): Remove unused "failed" argument. + (sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr): Update + all callers. + + print_xattr_list: remove redundant address check. + * xattr.c (print_xattr_list): Do not check for NULL the address passed + to printstr. + + ipc.c: make use of RVAL_DECODED. + * ipc.c (sys_mq_notify, sys_mq_open, sys_mq_timedreceive, + sys_mq_timedsend, sys_msgctl, sys_msgget, sys_msgsnd, sys_semctl, + sys_semget, sys_semop, sys_semtimedop, sys_shmctl, sys_shmdt, + sys_shmget): Update for RVAL_DECODED. + (sys_shmat): Decode all arguments on entering syscall. + +2015-07-14 Dmitry V. Levin + + umoven_or_printaddr: do not fetch data if not in verbose mode. + After this change, umoven_or_printaddr and its callers, including + printnum_* and printpair_*, will not fetch data in !verbose mode. + + * util.c (umoven_or_printaddr): Do not call umoven if !verbose. + +2015-07-14 Dmitry V. Levin + + Change printnum_* printers to honor syserror. + With this change, printnum_* printers will not attempt to fetch data + in case of exiting(tcp) && syserror(tcp). + All "at exiting" decoders that call these printers have been made + ready for this change in previous commits. + + * util.c (DEF_PRINTNUM, DEF_PRINTPAIR): Use umove_or_printaddr. + * prctl.c (prctl_exit): Use printnum_int and printnum_long. + (sys_arch_prctl): Do not check for syserror. + +2015-07-13 Dmitry V. Levin + + term.c: enhance tty ioctl parser. + Decode as much data on entering syscall as possible. + + * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, + decode_modem_flags): New functions. + (term_ioctl): Use them. Update for RVAL_DECODED. + +2015-07-12 Elvira Khabirova + + Change comparisons with function pointers to comparisons with SENs. + * pathtrace.c (pathtrace_match): Change all comparisons with function + pointers to a single SEN based switch. + * syscall.c (dumpio, trace_syscall_entering): Change all comparisons + with function pointers to comparisons with SENs. + * ipc.c (sys_ipc): Remove. + * sock.c (sys_socketcall): Likewise. + * linux/dummy.h (sys_ipc, sys_socketcall): New aliases. + + Add unique syscall entry numbers (SENs) + * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sen.h. + (syscallent_names, syscallent_patterns, syscallent_files): New variables. + (sen.h): New rule. + * defs.h (struct sysent): Add sen field. + * generate_sen.sh: New file. + * linux/syscall.h: Include "sen.h". + * syscall.c (SEN_NAME): New temporary macro. + (SEN): Use it to prepend syscall entry number. + + Introduce SEN macro. + * syscall.c (SEN): New temporary macro. + * linux/dummy.h (sys_printargs): New macro. + * linux/subcall.h: Wrap all sys_func entries using SEN. + * linux/*/syscallent*.h: Likewise. + +2015-07-10 Dmitry V. Levin + + scsi.c: enhance SG_IO ioctl parser. + Fix SG_IO ioctl output in case of failed umove + + * scsi.c: Include instead of . + Update for RVAL_DECODED. + (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, + print_sg_io_v4_res): Do not print address in case of failed umove. + (scsi_ioctl): Use printaddr. + +2015-07-10 Dmitry V. Levin + + ptp.c: enhance ptp ioctl parser. + * ptp.c: Include instead of . + Update for RVAL_DECODED. + (ptp_ioctl): Use umove_or_printaddr. + +2015-07-10 Dmitry V. Levin + + mtd.c: enhance mtd and ubi ioctl parsers. + Decode as much data on entering syscall as possible. + + * xlat/mtd_file_mode_options.in: New file. + * mtd.c: Include instead of . + Include "xlat/mtd_file_mode_options.h". + Update for RVAL_DECODED. + (mtd_ioctl, ubi_ioctl): Use printnum_int and umove_or_printaddr. + +2015-07-10 Dmitry V. Levin + + sock.c: enhance socket ioctl parser. + Decode as much data on entering syscall as possible. + + * sock.c: Update for RVAL_DECODED. + (print_addr): Remove. + (print_ifreq_addr, print_ifreq, print_ifc_len, decode_ifconf): New + functions. + (sock_ioctl) Use them. Use umove_or_printaddr. + +2015-07-10 Dmitry V. Levin + + block.c: enhance block ioctl parser. + * block.c: Update for RVAL_DECODED. + Define BLKROTATIONAL and BLKZEROOUT. + (block_ioctl): Decode them. Use printnum_short, printnum_int, + printnum_long, printpair_int64, and umove_or_printaddr. + (print_blkpg_req, block_ioctl): Use umove_or_printaddr. + +2015-07-09 Dmitry V. Levin + + blkpg_ops: add BLKPG_RESIZE_PARTITION constant. + * xlat/blkpg_ops.in: Add BLKPG_RESIZE_PARTITION. + + Reported-by: Christian Neukirchen + +2015-07-09 Dmitry V. Levin + + loop.c: enhance loop ioctl parser. + Decode as much data on entering syscall as possible. + + * loop.c: Include instead of . + Update for RVAL_DECODED. + (decode_loop_info, decode_loop_info64): New functions. + (loop_ioctl): Use them. Decode LOOP_SET_STATUS, LOOP_SET_STATUS64, + LOOP_SET_FD, LOOP_CHANGE_FD, LOOP_CTL_ADD and LOOP_CTL_REMOVE on + entering syscall. + Print LOOP_SET_FD and LOOP_CHANGE_FD arguments using printfd. + +2015-07-09 Dmitry V. Levin + + rtc.c: enhance rtc ioctl parser. + * rtc.c: Update for RVAL_DECODED. + (print_rtc): Rename to print_rtc_time. + (decode_rtc_time, decode_rtc_wkalrm): New functions. + (rtc_ioctl): Use them. + [RTC_VL_READ]: Decode RTC_VL_READ. + Use printnum_long for RTC_IRQP_READ and RTC_EPOCH_READ decoding. + + Use printpair_int. + * evdev.c (repeat_ioctl): Use printpair_int. + * net.c (do_pipe, sys_socketpair): Likewise. + +2015-07-09 Dmitry V. Levin + + Add several generic integer pairs printing functions. + Add functions to fetch and print pairs of integer types. + Note that these printers do not attempt to fetch data + in case of exiting(tcp) && syserror(tcp). + + printnum_* printers will follow as soon as all callers are made ready + for this change. + + * defs.h (printpair_int, printpair_long, printpair_int64): New + prototypes. + * util.c (DEF_PRINTPAIR): New macro. + (printpair_int, printpair_long, printpair_int64): New functions. + +2015-07-09 Dmitry V. Levin + + Add two generic integer printing functions. + Add printnum_short and printnum_int64 in addition to already existing + printnum_int and printnum_long. + + * defs.h (printnum_short, printnum_int64): New prototypes. + * util.c (DEF_PRINTNUM): New macro. + (printnum_int, printnum_long): Use DEF_PRINTNUM. + (printnum_short, printnum_int64): New functions. + +2015-07-09 Dmitry V. Levin + + Add address printing functions. + printaddr is a simple function implementing "print NULL or address" + idiom. + umoven_or_printaddr is a wrapper around umoven that has the same return + value semantics as umoven but also prints the address when the data + is not going to be fetched (in case of exiting(tcp) && syserror(tcp)) + or cannot be fetched (umoven fails). + umove_or_printaddr is a macro wrapper around umoven_or_printaddr that + mirrors umove wrapper around umoven. + + * defs.h (printaddr, umoven_or_printaddr): New prototypes. + (umove_or_printaddr): New macro. + * util.c (printaddr, umoven_or_printaddr): New functions. + +2015-07-09 Dmitry V. Levin + + 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. + +2015-07-05 Dmitry V. Levin + + time.c: move rtc ioctl parser to a separate file. + * rtc.c: new file + * Makefile.am (strace_SOURCES): Add it. + * time.c (print_rtc, rtc_ioctl): Move to rtc.c. + + term.c: fix typo. + * term.c: Rename TCLFLSH to TCFLSH. + + Do not include sys/filio.h. + * configure.ac (AC_CHECK_HEADERS): Remove sys/filio.h. + * term.c: Do not include . + +2015-07-02 Dmitry V. Levin + + 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. + + ioctl: simplify ioctl_decode signature. + * ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters. + (sys_ioctl): Update callers. + + 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". + + 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. + + ioctl: remove obsolete registry of ioctl characters. + * ioctl.c: Remove registry of ioctl characters. + +2015-06-30 Dmitry V. Levin + + Fix filtering of syscalls. + * syscall.c (trace_syscall_exiting): Skip filtered syscalls also in case + of get_regs or get_syscall_result failure. + * tests/filter-unavailable.c: New file. + * tests/filter-unavailable.expected: Likewise. + * tests/filter-unavailable.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add filter-unavailable. + (filter_unavailable_LDFLAGS): Add -pthread. + (TESTS): Add filter-unavailable.test. + (EXTRA_DIST): Add filter-unavailable.expected. + * tests/.gitignore: Add filter-unavailable. + + Reported-by: Bryan Matsuo + +2015-06-30 Dmitry V. Levin + + Fix -qq option in conjunction with -o option. + This change makes -qq option work in conjunction with -o option, + thus complementing commit v4.7-222-g01997cf. + + * strace.c (init): Do not reset qflag. + +2015-06-30 Dmitry V. Levin + + xtensa: wire up new syscalls. + * linux/xtensa/syscallent.h (bpf, execveat): New entries. + + bfin: wire up new syscalls. + * linux/bfin/syscallent.h (kcmp, finit_module, sched_setattr, + sched_getattr, renameat2, seccomp, getrandom, memfd_create, + bpf, execveat): New entries. + + alpha: wire up new syscalls. + * linux/alpha/syscallent.h (getrandom, memfd_create, execveat): + New entries. + +2015-06-17 Dmitry V. Levin + + tests: skip stat32 test if struct stat is defined incorrectly. + If stat.st_mode returned by syscall is 0, it means that the definition + of struct stat in is incorrect. This is the case e.g. on + mips n32 where the only available stat syscall is 64-bit but at the same + time struct stat defined by is 32-bit. + + * tests/stat.c (main) [NR_stat]: Return 77 if st_mode is 0. + +2015-06-17 Dmitry V. Levin + + Consistenly use #ifdef to check for AC_DEFINE'd macros. + * aio.c (print_common_flags): Use #ifdef in the check for + HAVE_STRUCT_IOCB_U_C_FLAGS. + * defs.h: Use #ifdef in the check for HAVE_LITTLE_ENDIAN_LONG_LONG. + * net.c: Use #ifdef in the check for HAVE_SENDMSG. + * syscall.c (dumpio): Likewise. + * printstat.h (DO_PRINTSTAT): Use #ifdef in checks for + HAVE_STRUCT_STAT_ST_* macros. + * util.c: Use #ifdef in checks for HAVE_SYS_XATTR_H. + + xattr: move fallback definitions of xattr flags to xlat/ + * xattr.c: Include insread of . + Move definitions of XATTR_* flags ... + * xlat/xattrflags.in: ... here. + + link: move fallback definitions of AT_* constants to xlat/ + * link.c: Move definitions of AT_* constants ... + * xlat/at_flags.in: ... here. + + net: move fallback definitions of SOL_* constants to xlat/ + * net.c: Move definitions of SOL_* constants ... + * xlat/socketlayers.in: ... here. + + futex: move fallback definitions of futex constants to xlat/ + * futex.c: Move definitions of FUTEX_OP_CMP_* constants ... + * xlat/futexwakecmps.in: ... here. + * futex.c: Move definitions of other FUTEX_OP_* constants ... + * xlat/futexwakeops.in: ... here. + * futex.c: Move definitions of remaining FUTEX_* constants except + FUTEX_PRIVATE_FLAG and FUTEX_CLOCK_REALTIME flags ... + * xlat/futexops.in: ... here. + + clone: move definitions of cloning flags to xlat/ + * clone.c: Include . Move definitions of CLONE_* flags ... + * xlat/clone_flags.in: ... here. + +2015-06-16 Dmitry V. Levin + + Update mount flags constants. + * mount.c: Remove definitions of mount flags constants. + * xlat/mount_flags.in: Update from linux v4.0, add default values. + + mount: update parser to match kernel behaviour. + * mount.c (sys_mount): Do not decode type and data strings for + MS_SHARED, MS_PRIVATE, MS_SLAVE, and MS_UNBINDABLE mount flags + that do not imply valid strings. + + mount: robustify MS_MGC_VAL decoding. + * mount.c (sys_mount): When printing mount flags, do not assume that + (flags & MS_MGC_MSK) == MS_MGC_VAL. + +2015-06-08 Dmitry V. Levin + + net: decode setsockopt() multicast arguments. + * configure.ac (AC_CHECK_FUNCS): Add inet_pton. + * net.c (print_mreq, print_mreq6): New functions. + (print_setsockopt): Use them to decode IP_ADD_MEMBERSHIP, + IP_DROP_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, + IPV6_JOIN_ANYCAST, and IPV6_LEAVE_ANYCAST. + * tests/ip_mreq.c: New file. + * tests/ip_mreq.expected: Likewise. + * tests/ip_mreq.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add ip_mreq. + (TESTS): Add ip_mreq.test. + (EXTRA_DIST): ip_mreq.expected. + * tests/.gitignore: Add ip_mreq. + + Based on patch by Ben Noordhuis . + +2015-06-08 Dmitry V. Levin + + Update IPV6 socket options constants. + * xlat/sockipv6options.in: Update from linux v4.0. + +2015-06-05 Dmitry V. Levin + + net: factor out interface index printing code. + * net.c (print_ifindex): New function. + (printsock) [HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID]: Use it. + +2015-05-25 Dmitry V. Levin + + Consistently use error_msg instead of fprintf(stderr) + * linux/alpha/get_scno.c: Use error_msg. + * linux/arm/get_scno.c: Likewise. + * linux/mips/get_scno.c: Likewise. + * linux/sh/get_scno.c: Likewise. + * linux/x86_64/get_scno.c: Likewise. + * exit.c (sys_exit): Likewise. + * pathtrace.c (pathtrace_select, pathtrace_match): Likewise. + * strace.c (alloctcb, droptcb, detach, startup_attach, + test_ptrace_seize, init, cleanup, print_debug_info, + maybe_allocate_tcb, startup_tcb, trace): Likewise. + * syscall.c (update_personality, trace_syscall_exiting, + get_scno): Likewise. + * unwind.c (DPRINTF): Likewise. + * tests/bexecve.test: Update patterns. + * tests/detach-stopped.test: Likewise. + + Consistently print OOM diagnostic messages. + * bjm.c (sys_query_module): Use error_msg to print OOM diagnostics. + * util.c (dumpiov, dumpstr): Likewise. + +2015-05-25 Dmitry V. Levin + + Introduce memory allocation wrappers. + Introduce wrappers to the following functions that do memory allocation: + malloc, calloc, realloc, strdup. + + This commit is a follow-up to the related discussions in strace-devel ML: + http://sourceforge.net/p/strace/mailman/message/33618180/ + http://sourceforge.net/p/strace/mailman/message/33733470/ + + * defs.h (xmalloc, xcalloc, xreallocarray, xstrdup): New prototypes. + * xmalloc.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * count.c (count_syscall, call_summary_pers): Use xcalloc. + * desc.c (decode_select): Use xmalloc. + * dirent.c (sys_getdents, sys_getdents64): Likewise. + * net.c (sys_recvmmsg): Use xstrdup. + * pathtrace.c (storepath): Use xreallocarray. + (pathtrace_match): Use xmalloc. + * strace.c (die_out_of_memory): Move to xmalloc.c. + (expand_tcbtab): Use xcalloc and xreallocarray. + (startup_child): Use xstrdup. + (init): Use xmalloc, xcalloc, and xstrdup. + * syscall.c (reallocate_qual): Use xreallocarray. + (qualify): Use xstrdup. + * unwind.c (unwind_tcb_init): Use xmalloc. + (build_mmap_cache): Use xcalloc, xreallocarray, and xstrdup. + (get_symbol_name): Use xreallocarray. + (stacktrace_walk, queue_put): Use xmalloc. + * util.c (printstr): Use xmalloc. + * vsprintf.c (strace_vfprintf): Likewise. + +2015-05-21 Dmitry V. Levin + + Fix ioctl entries on 32-bit architectures with 64-bit aligned structures + Some ioctl constants are defined to different values on those 32-bit + architectures where structures containing a 64-bit field are aligned on + a 8-byte boundary and have a size multiple of 8 bytes, and on other + 32-bit architectures. + + * configure.ac: Check the size of a structure containing a 64-bit field. + * linux/32/ioctls_inc.h: Rename to ... + * linux/32/ioctls_inc_align32.h: ... this. + * linux/32/ioctls_inc_align64.h: New file. + * linux/32/ioctls_inc.h: Include either 32/ioctls_inc_align32.h + or ioctls_inc_align64.h depending on SIZEOF_STRUCT_I64_I32. + * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align32.h and + * linux/32/ioctls_inc_align64.h. + * tests/ioctl.c (main): Test for VIDIOC_ENUMINPUT. + * tests/ioctl.expected: Check VIDIOC_ENUMINPUT decoding. + + Reported-by: Philippe De Muyter + +2015-05-21 Dmitry V. Levin + + maint: make linux/kvm.h parseable on arm. + * maint/ioctls_sym.sh [AARCH64 || ARM]: Add missing definitions for + structures referenced from linux/kvm.h. + +2015-05-21 Philippe De Muyter + + v4l2: add decoding for VIDIOC_S_CROP's arg. + * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_S_CROP's arg. + +2015-05-19 Ezequiel Garcia + + Add support for Altera's Nios-II softcore architecture. + This commit adds strace support for Altera's Nios-II. The architecture + is supported by Linux since v3.19, and it implements the generic syscall + ABI. + + * configure.ac: Add nios2 support. + * cacheflush.c [NIOS2] (sys_cacheflush): New function. + * linux/nios2/*: New Nios-II specific files. + * Makefile.am (EXTRA_DIST): Add them. + +2015-05-19 Philippe De Muyter + + v4l2: VIDIOC_CROPCAP: add missing braces around arg printout. + * v4l2.c (v4l2_ioctl): case VIDIOC_CROPCAP: add missing braces around arg + printout. + +2015-05-19 Dmitry V. Levin + + maint: avoid effects of locale when sorting files. + * maint/ioctls_gen.sh: Invoke sort with LC_COLLATE=C. + * maint/ioctls_hex.sh: Likewise. + * maint/ioctls_sym.sh: Likewise. + + Reported-by: Philippe De Muyter + +2015-04-18 Philippe De Muyter + + v4l2: add decoding for VIDIOC_CREATE_BUFS's arg. + * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_CREATE_BUFS's arg. + +2015-04-17 Dmitry V. Levin + + mips o32: decode indirect syscall. + Implement decoding of MIPS O32 specific indirect syscall. + + * syscall.c [LINUX_MIPSO32] (decode_mips_subcall, sys_syscall): + New functions. + (trace_syscall_entering) [LINUX_MIPSO32]: Use decode_mips_subcall. + * linux/mips/syscallent-o32.h (4000): Change sys_func to sys_syscall. + + Reported-and-tested-by: Arturo Borrero Gonzalez + +2015-04-14 Dmitry V. Levin + + debian: add gawk to Build-Depends. + * debian/control (Build-Depends): Add gawk. + Patch by Reiner Herrmann . + + This fixes Debian bug #780992. + +2015-04-14 Dmitry V. Levin + + tests: fix bexecve.test for the case of mixed personalities. + Fix bexecve.test when the executable being run does not match the + native architecture. + + * tests/bexecve.test: Use "set_ptracer_any" instead of "sh". + Allow for a personality switch notification in the strace output. + +2015-04-07 Dmitry V. Levin + + tests: add a test for "resuming interrupted nanosleep" + * tests/restart_syscall.test: New test. + * tests/restart_syscall.expected: New file. + * tests/restart_syscall_unknown.expected: Likewise. + * tests/Makefile.am (TESTS): Add restart_syscall.test. + (EXTRA_DIST): Add restart_syscall.expected + (TEST_LOG_COMPILER): Change to "env". + (OS, ARCH, AM_TEST_LOG_FLAGS): Define. + and restart_syscall_unknown.expected. + + tests: strip executable bit from *.expected files. + +2015-04-07 Dmitry V. Levin + + Declare syscall parsers using SYS_FUNC macro. + Introduce SYS_FUNC macro to declare and define all syscall parsers. + + * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h. + (sys_func.h): New rule. + * defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros. + * linux/syscall.h: Include "sys_func.h". + [NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers. + Remove other declarations. + * linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs + and osf_fstatfs syscall parsers. + * *.c: Use SYS_FUNC to define syscall parsers. + +2015-04-07 Denys Vlasenko + + Fix confusing "resuming interrupted unknown" message. + Dmitry reported seeing the following: + + $ sleep 2 & sleep 1; ./strace -erestart_syscall -p $! + [1] 12345 + Process 12345 attached + restart_syscall(<... resuming interrupted unknown ...>) = 0 + + Fixing it by replacing "unknown" with "system call". + +2015-04-07 Dmitry V. Levin + + tests: workaround old gawk versions that do not provide @include support + Some of our tests use GNU awk @include extension, but not all currently + used versions of GNU awk support it. Skip these tests if gawk does not + provide @include support. + + * tests/init.sh (check_gawk): New function. + (match_awk): Use it. + +2015-04-06 Dmitry V. Levin + + tests: rewrite umovestr2.test without using grep. + The regular expression generated by umovestr2.c on systems with large + page size is too big for GNU grep. Rewrite the test to use diff + instead of grep. + + * tests/umovestr2.test: Use match_diff instead of match_grep. + * tests/umovestr2.c (main): Convert output from regexp to plain text. + +2015-03-31 Dmitry V. Levin + + Cleanup process_vm_writev syscall decoding. + * process_vm.c (sys_process_vm_writev): Do not check for syserror, + it is not applicable on entering syscall. + + umovestr: read chunks of memory up to pagesize at a time. + * defs.h (get_pagesize): New prototype. + * mem.c (get_pagesize) Make global. + * util.c (PAGMASK): Remove. + (vm_read_mem): New process_vm_readv proxy function. + (umoven, umovestr): Use it. + (umovestr): Read chunks up to pagesize at a time. + +2015-03-31 Dmitry V. Levin + + umovestr: fix short read bug. + * util.c (umovestr): Check the right address. + * tests/umovestr.c: New file. + * tests/umovestr2.c: Likewise. + * tests/umovestr.expected: Likewise. + * tests/umovestr.test: New test. + * tests/umovestr2.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add umovestr and umovestr2. + (TESTS): Add umovestr.test and umovestr2.test. + (EXTRA_DIST): Add umovestr.expected. + * tests/.gitignore: Add umovestr and umovestr2. + + Reported-by: Josef T. Burger + +2015-03-31 Dmitry V. Levin + + When process_vm_readv fails with EPERM, try PTRACE_PEEKDATA. + process_vm_readv() and ptrace(PTRACE_PEEKDATA) have inconsistent access + control rules wrt traced processes: process_vm_readv() is more likely to + fail with EPERM than ptrace(PTRACE_PEEKDATA) when tracing a process that + has execve'd a privileged executable. + + * util.c (umoven, umovestr): If process_vm_readv returned EPERM, + fall back to ptrace(PTRACE_PEEKDATA). + + Reported-by: Andrew Guertin + +2015-03-30 Dmitry V. Levin + + Use macros for gcc attributes. + * defs.h (error_msg, perror_msg, error_msg_and_die, perror_msg_and_die, + die_out_of_memory, printllval, printnum_int, printnum_long, tprintf): + Use ATTRIBUTE_* macros for gcc attributes. + * file.c (struct stat64): Likewise. + * statfs.c (struct compat_statfs64): Likewise. + * strace.c (die, exec_or_die, init): Likewise. + * linux/sparc/arch_sigreturn.c: Likewise. + * linux/ubi-user.h: Likewise. + +2015-03-30 Dmitry V. Levin + + Introduce macros for gcc attributes. + Define macros for gcc attributes that are already in use + or going to be used soon. + + * defs.h (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT, + ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC, + ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): New macros. + +2015-03-28 Felix Janda + + Include for _IOC_* macros. + Fix a compilation failure with musl libc. + + * evdev.c: Include . + * ioctl.c: Include instead of . + * ioctlsort.c: Likewise. + + Reported-by: Dima Krasner + Acked-by: Mike Frysinger + +2015-03-28 Felix Janda + + Include for S_I* macros. + Fix a compilation failure with musl libc. + + * mknod.c: Include . + * printmode.c: Likewise. + + Reported-by: Dima Krasner + Acked-by: Mike Frysinger + +2015-03-27 Dmitry V. Levin + + signal.c: move siginfo_t parsers to a separate file. + * printsiginfo.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (printsiginfo): Change second argument's type from int to bool. + * signal.c: Stop defining siginfo_t related constants. + Move inclusion of xlat/sig*_codes.h files to printsiginfo.c + (printsigsource, printsigval, printsiginfo_at): Move to printsiginfo.c. + (printsiginfo): Change second argument's type from int to bool, + split, and move to printsiginfo.c. + + Update siginfo_t constants. + * xlat/sigbus_codes.in: Add BUS_MCEERR_AR and BUS_MCEERR_AO, + add default values. + * xlat/sigtrap_codes.in: Add TRAP_BRANCH and TRAP_HWBKPT, + add default values. + * xlat/sigsegv_codes.in: Add SEGV_BNDERR, add default values. + * xlat/sigchld_codes.in: Add default values. + * xlat/sigemt_codes.in: Likewise. + * xlat/sigfpe_codes.in: Likewise. + * xlat/sigill_codes.in: Likewise. + * xlat/siginfo_codes.in: Likewise. + * xlat/sigpoll_codes.in: Likewise. + * xlat/sigsys_codes.in: Likewise. + +2015-03-26 Dmitry V. Levin + + signal.c: move sigaltstack parser to a separate file. + * sigaltstack.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * signal.c (print_stack_t, sys_sigaltstack): Move to sigaltstack.c. + * xlat/sigaltstack_flags.in: Add default values. + +2015-03-25 Denys Vlasenko + + Move sparc64 get_scno() code where it belongs. + + sparc: rename personality 2 files to personality 1. + Run-tested in qemu 32-bit sparc. + +2015-03-25 Denys Vlasenko + + sparc: delete personality 1. + Personality 1 for sparc and sparc64 appears to be an old attempt + to support stracing Solaris binaries. + + It stalled after the only syscall, solaris_open, was covered: + all other solaris_foo's are printargs. + + This change deletes personality 1. Now sparc is an one-personality + arch, and sparc64 is a two-personality one. + + For clarity, pure renaming of personality 2 files to personality 1 for sparc64 + is performed in the next commit - this prevents a state where syscallent1.h + seems to indergo a lot of changes, where in fact in is deleted, and then + replaced by syscallent2.h + + Therefore, tree at this commit will not build. + +2015-03-24 Denys Vlasenko + + qemu_multiarch_testing/*: make it easier to do debug in sandboxes. + +2015-03-24 Denys Vlasenko + + sparc: fix v4.10-25-g8497b62 fallout. + Before: + + $ sleep 3 & ./strace -p $! + Process 8703 attached + syscall: unknown syscall trap 1a800003 00025d58 + syscall_516(0, 0x40080000, 0, 0xfc000f00, 0x28, 0xefc03b18) = 0 + exit_group(0) = ? + +++ exited with 0 +++ + + After: + + $ sleep 3 & ./strace -p $! + Process 8725 attached + restart_syscall(<... resuming interrupted nanosleep ...>) = 0 + exit_group(0) = ? + +++ exited with 0 +++ + +2015-03-24 Dmitry V. Levin + + get_scno: add diagnostics for invalid syscall numbers. + * syscall.c (get_scno): Print a debug level message + for !SCNO_IS_VALID syscall numbers. + +2015-03-24 Dmitry V. Levin + + arm: fix v4.10-25-g8497b62 fallout. + Starting with commit v4.10-25-g8497b62, + + arm$ ./strace true + pid 1234 stray syscall exit + Segmentation fault + + Fix this by updating ARM syscall sanity check. + In particular, get_scno() should not set TCB_INSYSCALL flag because + other code assumes that s_ent is properly initialized when this flag + is set. + + * linux/arm/get_scno.c: Check syscall number after fetching. + Do not apply the check to SCNO_IN_RANGE syscalls. + Do not set TCB_INSYSCALL flag. + Extend diagnostics and move it to debug level. + +2015-03-24 Dmitry V. Levin + + mips: fix pipe syscall decoding. + * linux/mips/arch_getrval2.c: New file. + * Makefile.am (EXTRA_DIST): Add it. + * defs.h [MIPS] (HAVE_GETRVAL2): Define. + +2015-03-23 Dmitry V. Levin + + sigreturn.c: split arch specific code into separate arch files. + Split code that use arch-specific registers to separate arch files. + + * sigreturn.c (sys_sigreturn): Move arch-specific code + to linux/*/arch_sigreturn.c, include "arch_sigreturn.c". + * linux/arch_sigreturn.c: New file. + * Makefile.am (EXTRA_DIST): Add linux/arch_sigreturn.c + and linux/*/arch_sigreturn.c files. + +2015-03-23 Dmitry V. Levin + + syscall.c: split arch specific code into separate arch files. + Split code that use arch-specific registers to separate arch files. + + * syscall.c: Move definitions of variables containing fetched registers + to linux/*/arch_regs.c files. + [HAVE_GETRVAL2] (getrval2): Move arch-specific code + to linux/*/arch_getrval2.c, include "arch_getrval2.c". + (print_pc): Move arch-specific code to linux/*/print_pc.c files, + include "print_pc.c". + [X86_64] (x86_64_getregs_old): Rename to getregs_old, move to + linux/x86_64/getregs_old.c, include "getregs_old.c". + [POWERPC] (powerpc_getregs_old): Rename to getregs_old, move to + linux/powerpc/getregs_old.c, include "getregs_old.c". + (get_regs) [X86_64, POWERPC]: Update callers. + (get_scno): Move arch-specific code to linux/*/get_scno.c, + include "get_scno.c". + (get_syscall_args): Move arch-specific code + to linux/*/get_syscall_args.c, include "get_syscall_args.c". + (get_error): Move arch-specific code to linux/*/get_error.c, + include "get_error.c". + (get_syscall_result): Move arch-specific code + to linux/*/get_syscall_result.c, include "get_syscall_result.c". + * Makefile.am (EXTRA_DIST): Add new linux/*/*.c files. + +2015-03-23 Dmitry V. Levin + + syscall.c: prepare for the split. + Move functions that use arch-specific registers to the end of file. + +2015-03-23 Dmitry V. Levin + + Move get_regs error check from trace_syscall_entering to get_scno. + Starting with commit v4.10-25-g8497b62, get_scno() can be called outside + trace_syscall_entering(), so move the get_regs_error check from + trace_syscall_entering() to get_scno(). + + * syscall.c (trace_syscall_entering): Move get_regs_error check ... + (get_scno): ... here. + +2015-03-23 Dmitry V. Levin + + alpha, ia64, sh, sparc, sparc64: fix pipe and pipe2 syscalls decoding. + Fix pipe syscall decoding on alpha. + Fix pipe2 syscall decoding on ia64, sh, sparc, and sparc64. + + * configure.ac (AC_CHECK_FUNCS): Add pipe2. + * defs.h [ALPHA || IA64 || SH || SPARC || SPARC64] (HAVE_GETRVAL2): + Define. + * net.c (do_pipe): Check HAVE_GETRVAL2 instead of architecture macros. + Do not use getrval2 for pipe2 decoding. + Print address if umove call fails. + * syscall.c (getrval2): Check HAVE_GETRVAL2 instead of architecture + macros. Implement for [ALPHA]. + * tests/pipe.c: New file. + * tests/pipe.expected: New file. + * tests/pipe.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add pipe. + (TESTS): Add pipe.test. + (EXTRA_DIST): Add pipe.expected. + * tests/.gitignore: Add pipe. + +2015-03-22 Dmitry V. Levin + + decode_socket_subcall: fetch all arguments with a single umoven call. + * syscall.c (decode_socket_subcall): Replace umoven fetch loop + with a single umoven call. + +2015-03-21 Denys Vlasenko + + New test: test/many_looping_threads.c. + + test/.gitignore: add missing test targets. + + Trivial optimization in sys_sigreturn() + + Change last parameter of umoven() from char* to void* + Saves tons of casts. + + Remove unused struct tcb::inst field. + It is unused since we dropped support for kernels without PTRACE_SETOPTIONS. + + test/Makefile: add missing test targets. + + Move the comment about termination logic where it belongs. + + startup_tcb() never fails, remove code which checks for failures. + +2015-03-21 Denys Vlasenko + + Show the syscall name in "resuming interrupted call" message. + When signal is received, or if we have attached to a process, + current syscall (if process is in one) gets restarted. + + Some syscalls are restarted via "restart_syscall()" mechanism. + On such sycalls, we don't show _which_ syscall gets restarted. + + IOW: users want to see "resuming interrupted nanosleep" + instead of "resuming interrupted call" when they attach to "sleep 999". + + Kernel does expose this information. The only thing we need is + to fetch syscall# on attach, and save it. + + This patch does this. It adds tcp->s_prev_ent, which is + a pointer to struct_sysent of the previous syscall of this tracee. + It can be NULL. + + sys_restart_syscall() is made to use it when the message is generated. + + To similarly handle restart_syscall() *after signals*, not just + on attach, on each syscall exit patch saves exited syscall's data + in the same member (tcp->s_prev_ent). + + Example: + + $ sleep 3 & strace -p $! + Process 8728 attached + restart_syscall(<... resuming interrupted nanosleep ...>) = 0 + _exit(0) = ? + +++ exited with 0 +++ + +2015-03-20 Dmitry V. Levin + + tests: add a test for mmap/mprotect/munmap decoding. + * tests/mmap.c: New file. + * tests/mmap64.c: New file. + * tests/mmap.test: New test. + * tests/mmap64.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add mmap and mmap64. + (mmap64_CFLAGS): Define. + (TESTS): Add mmap.test and mmap64.test. + * tests/.gitignore: Add mmap and mmap64. + + sparc, sparc64: fix decoding of mmap2. + * linux/sparc/syscallent.h (mmap2): Decode with sys_mmap_4koff, + not sys_mmap. + * linux/sparc64/syscallent2.h (mmap2): Decode with sys_mmap_pgoff, + not sys_mmap. + +2015-03-19 Dmitry V. Levin + + tests: add a test for SECCOMP_MODE_FILTER decoding. + * tests/seccomp.c: New file. + * tests/seccomp.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add seccomp. + (TESTS): Add seccomp.test. + * tests/.gitignore: Add seccomp. + +2015-03-18 Dmitry V. Levin + + tests: factor out common awk code. + Factor out awk code used in several tests to match.awk. + + * tests/match.awk: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/caps.awk: Use it. + * tests/getdents.awk: Likewise. + * tests/getrandom.awk: Likewise. + * tests/select.awk: Likewise. + * tests/sigaction.awk: Likewise. + * tests/init.sh (match_awk): Use gawk not awk. Define AWKPATH. + * tests/getdents.test: Likewise. + +2015-03-18 Dmitry V. Levin + + tests: skip netlink based tests when resources are not available. + * tests/netlink_inet_diag.c (main): Return 77 if socket, bind, + or listen syscall fail. + * tests/netlink_unix_diag.c (main): Likewise. + +2015-03-18 Dmitry V. Levin + + aarch64, arm: decode extra padded compat struct statfs64. + According to arch/arm/kernel/sys_oabi-compat.c, + struct statfs64 has extra padding with EABI. + + * statfs.c [AARCH64 || defined ARM] (COMPAT_STATFS64_PADDED_SIZE): + Define. + (do_statfs64_fstatfs64): New function, factored out from sys_statfs64. + [COMPAT_STATFS64_PADDED_SIZE]: Check it in addition to + sizeof(struct compat_statfs64). + (sys_statfs64, sys_fstatfs64): Use do_statfs64_fstatfs64. + + Reported-and-tested-by: Elliott Hughes + +2015-03-18 Dmitry V. Levin + + tests: factor out common shell code to functions. + Factor out shell code used in several tests to common functions. + + * tests/fanotify_mark.expected: New file. + * tests/ioctl.expected: New file. + * tests/net-fd.expected: New file. + * tests/net.expected: New file. + * tests/statfs.expected: New file. + * tests/sun_path.expected: New file. + * tests/uio.expected: New file. + * tests/ipc.sh: New file. + * tests/Makefile.am (EXTRA_DIST): Add them. + * tests/init.sh (dump_log_and_fail_with, run_prog, + run_prog_skip_if_failed, run_strace, run_strace_merge, + match_awk, match_diff, match_grep): New functions. + * tests/*.test: Use them. + +2015-03-18 Elliott Hughes + + Show f_flags field in printstatfs. + printstatfs64 was right, but printstatfs was missing f_flags. + Noticed on aarch64. + + * statfs.c (printstatfs) [_STATFS_F_FLAGS]: Print statfs.f_flags. + +2015-03-16 Dmitry V. Levin + + tests/uid*: use fchown* instead of chown* + Newer architectures have no chown syscall, so use fchown* syscalls + for testing printuid. + + * tests/uid.test: Use fchown instead of chown. + * tests/uid.c: Test __NR_fchown instead of __NR_chown. + (main): Use __NR_fchown instead of __NR_chown. + * tests/uid32.c: Test __NR_fchown32 instead of __NR_chown32. + (main): Use __NR_fchown32 instead of __NR_chown32. + * tests/uid16.c: Test __NR_fchown and __NR_fchown32 instead + of __NR_chown and __NR_chown32. + (main): Use __NR_fchown instead of __NR_chown. + * tests/uid.awk: Update regexp. + +2015-03-16 Dmitry V. Levin + + stat64-v.test: add newfstatat syscall support. + Newer architectures have no stat syscall, so stat() is implemented there + using newfstatat syscall. + + * tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX. Update callers. + [_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support. + (main) [!NR_stat]: Add newfstatat support. + + Reported-by: Andreas Schwab + +2015-03-16 Andreas Schwab + + aarch64: properly decode generic syscalls. + * linux/aarch64/syscallent1.h: Don't override entries 277 to 1023. + + tests: verify that all patterns match. + * tests/ipc_msg.test: Count matches to verify that all patterns match. + * tests/ipc_sem.test: Likewise. + * tests/ipc_shm.test: Likewise. + * tests/stat32-v.test: Likewise. + * tests/stat64-v.test: Likewise. + +2015-03-16 Dmitry V. Levin + + Fix stat64 st_[acm]time decoding for personalities with 32-bit time_t. + STRUCT_STAT.st_[acm]time are declared as unsigned int for some + personalities, while time_t is signed. + + * printstat.h (DO_PRINTSTAT): If st_[acm]time have the same size as int, + explicitly cast them to int. + * tests/stat64-v.test: Test that negative time_t is decoded properly. + + Reported-by: Andreas Schwab + +2015-03-16 Dmitry V. Levin + + semctl: fix indirect syscall decoding. + On architectures where the semctl call is implemented by the ipc syscall + the 4th argument is passed by reference. + + * ipc.c (sys_semctl): Handle the indirect ipc subcall case. + * tests/ipc_sem.c (main): Optionally match indirection + in the 4th argument of semctl calls. + + Reported-by: Andreas Schwab + +2015-03-16 Andreas Schwab + + tests/ipc_*: match IPC_64 flag. + * tests/ipc_msg.c (main): Optionally match "IPC_64|" in the third + argument of the ipc call. + * tests/ipc_sem.c (main): Likewise. + * tests/ipc_shm.c (main): Likewise. + +2015-03-16 Andreas Schwab + + Fix crash in ipc_sem test. + Properly use union semun as argument of semctl. + + * tests/ipc_sem.c (main): Properly use union semun as argument of + semctl. Don't handle EFAULT specially. + * tests/ipc_sem.test: Revert last change. + +2015-03-16 Andreas Schwab + + m68k: fix sigreturn decoding. + * sigreturn.c (sys_sigreturn) [M68K]: Fetch the words of the + signal mask from the proper place. + + aarch64: fix ioctl decoding. + * linux/aarch64/ioctls_inc0.h: Rename from ioctls_inc1.h. + * linux/aarch64/ioctls_inc1.h: Rename from ioctls_inc0.h. + * linux/aarch64/ioctls_arch0.h: Rename from ioctls_arch1.h. + * linux/aarch64/ioctls_arch1.h: Rename from ioctls_arch0.h. + +2015-03-12 Andreas Schwab + + tests/select.test: handle architectures using pselect6 syscall. + * tests/select.awk (BEGIN): Update regexps to match both select + and pselect6 syscalls. + * tests/select.test: Probe for both select and pselect6 syscall. + + Distribute linux/aarch64/arch_regs.h. + * Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h. + + Fix decoding of mmap2 for arm. + * syscallent.h (mmap2): Decode with sys_mmap_4koff, not + sys_mmap_pgoff. + +2015-03-12 Andreas Schwab + + m68k: define HAVE_SA_RESTORER. + On m68k the kernel sigaction structure has the sa_restorer member for + historical reasons. + + * signal.c (HAVE_SA_RESTORER): Define for M68K. + +2015-03-11 Dmitry V. Levin + + aarch64: fix rt_sigreturn decoding. + * sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check. + +2015-03-09 Dmitry V. Levin + + maint: post-release administrivia. + * NEWS: Add header line for next release. + +2015-03-06 Dmitry V. Levin + + Prepare for 4.10 release. + * NEWS: Update for 4.10 release. + * debian/changelog: 4.10-1. + * strace.spec: 4.10-1. + + Move sigreturn/rt_sigreturn parser to a separate file. + * sigreturn.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (sprintsigmask_n): New prototype. + (tprintsigmask_addr): New macro. + * signal.c (sprintsigmask_n): Make global. + (tprintsigmask_addr): Remove. + (sys_sigreturn): Move to sigreturn.c. + +2015-03-05 Dmitry V. Levin + + ia64: use PTRACE_GETREGS to fetch registers. + * linux/ia64/arch_regs.h: Stop including . + (ia64_frame_ptr): New declaration. + * signal.c (sys_sigreturn) [IA64]: Use ia64_frame_ptr. + * syscall.c [IA64]: Include . + [IA64] (ia64_regs, ia64_frame_ptr): New variable. + [IA64] (ARCH_REGS_FOR_GETREGS): New macro. + [IA64] (ia64_ia32mode): Convert to macro. + [IA64] (ia64_r8, ia64_r10): Remove. + (getrval2, print_pc, get_scno, get_syscall_args, get_error) [IA64]: + Use ia64_regs. + (get_syscall_result) [IA64]: Remove. + + s390, s390x: use PTRACE_GETREGSET to fetch registers. + * linux/s390/arch_regs.h: New file. + * linux/s390x/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add them. + * signal.c (sys_sigreturn) [S390 || S390X]: Use s390_frame_ptr. + * syscall.c [S390 || S390X] (s390_regset, s390_frame_ptr): New variable. + [S390 || S390X] (ARCH_REGS_FOR_GETREGSET): New macro. + (print_pc) [S390 || S390X]: Use s390_regset. + (get_scno) [S390 || S390X]: Likewise. + (get_syscall_args) [S390 || S390X]: Likewise. + (get_error) [S390 || S390X]: Likewise. + (get_syscall_result) [S390 || S390X]: Remove. + + qemu_multiarch_testing: update. + * qemu_multiarch_testing/README: Update statistics. + +2015-03-05 Dmitry V. Levin + + tests: robustify unix-yy.test. + Implement additional synchronization between parent and child processes + to guarantee that the child starts closing connected socket only after + exiting of the parent's accept() syscall. + This guarantee seems to be necessary to reliably receive UNIX_DIAG_PEER + messages from NETLINK_SOCK_DIAG interface. + + * tests/net-accept-connect.c: Implement additional synchronization + between parent and child processes. + * tests/unix-yy-connect.awk: Update. + +2015-03-05 Dmitry V. Levin + + Use SIGRTMIN from kernel headers. + * configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from . + * signal.c: Use ASM_SIGRTMIN instead of constants provided by libc. + * tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value. + Use lower RT_* numbers to support pre-3.18 hppa kernels. + * tests/sigreturn.test: Update regexp. + +2015-03-05 Dmitry V. Levin + + ppc64: fix compilation warning. + Fix compilation warning introduced by commit + 577be2593d4895ef941e1c4e5e1608f7dd13610d + + * signal.c (sys_sigreturn) [POWERPC64]: Fix initialization of signal + mask on 32bit personality. + +2015-03-05 Dmitry V. Levin + + aarch64: fix compilation warnings. + Fix compilation warnings introduced by commit + 5b9b7e1d347eb4556084cdccad75e8247c535ed5: + + signal.c:702:45: warning: signed and unsigned type in conditional expression [-Wsign-compare] + syscall.c:746:34: warning: initialization from incompatible pointer type [enabled by default] + + * syscall.c [AARCH64] (aarch64_sp_ptr): Add explicit cast. + [AARCH64] (arm_sp_ptr): Change pointer type to unsigned. + * linux/aarch64/arch_regs.h (arm_sp_ptr): Update. + + Reported-by: Mike Frysinger + +2015-03-05 Dmitry V. Levin + + i386: simplify sigreturn decoding. + * signal.c (sys_sigreturn) [X86_64 || X32 || I386]: Do not define + i386_sigcontext_struct and i386_fpstate structures. + +2015-03-05 Dmitry V. Levin + + tests: add a test for sigreturn/rt_sigreturn decoding. + Convert test/sigreturn.c into a regular test. + + * test/Makefile (PROGS): Remove sigreturn. + * test/.gitignore: Likewise. + * test/sigreturn.c: Rewrite to ... + * tests/sigreturn.c: ... new file. + * tests/sigreturn.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add sigreturn. + (TESTS): Add sigreturn.test. + * tests/.gitignore: Add sigreturn. + +2015-03-04 Dmitry V. Levin + + sigreturn: print signal mask as a syscall argument. + Although sigreturn takes signal mask via frame pointer, + it's more convenient to display signal mask as a syscall argument + rather than an outstanding object of unknown nature: + + Before this change: + sigreturn() (mask [USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]) = 0 + + After this change: + sigreturn({mask=[USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]}) = 0 + + * signal.c (sys_sigreturn): Display signal mask as a syscall argument. + +2015-03-04 Dmitry V. Levin + + aarch64: implement rt_sigreturn decoding. + * linux/64/syscallent.h (139): Use sys_sigreturn for rt_sigreturn + decoding. + * syscall.c [ARM] (arm_regs): Make static. + [ARM] (arm_sp_ptr): New variable. + [AARCH64] (aarch64_sp_ptr, arm_sp_ptr): New variables. + * linux/aarch64/arch_regs.h: New file. + * linux/arm/arch_regs.h (arm_regs): Remove. + (arm_sp_ptr): New declaration. + * signal.c (sys_sigreturn) [ARM]: Use arm_sp_ptr. + [AARCH64]: Print signal mask. + + arm: simplify sigreturn decoding. + * signal.c (sys_sigreturn) [ARM]: Do not define sigcontext and ucontext + structures, fetch signal mask only, use print_sigset_addr_len. + + s390: fix sigreturn decoding. + * signal.c (sys_sigreturn) [S390]: Fix signal mask decoding. + + mips o32: fix sigreturn decoding. + * signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask. + [MIPS] Use print_sigset_addr_len to print signal mask. + + x86_64, x32: implement rt_sigreturn decoding. + * syscall.c [X86_64 || X32] (x86_64_rsp_ptr): New variable. + * linux/x86_64/arch_regs.h (x86_64_rsp_ptr): New declaration. + * linux/x86_64/syscallent.h (15): Use sys_sigreturn for rt_sigreturn + decoding. + * linux/x32/syscallent.h (513): Likewise. + * signal.c (sys_sigreturn) [X86_64 || X32]: Print signal mask + for non-i386 personalities. + + sparc, sparc64: fix sigreturn decoding. + * linux/sparc/arch_regs.h (U_REG_FP): New macro. + * signal.c (sys_sigreturn) [SPARC || SPARC64]: Fix decoding + of upper 32 bits of the sigmask. + + ppc, ppc64: fix sigreturn decoding. + * signal.c (sys_sigreturn) [POWERPC]: Fix decoding of upper 32 bits + of the sigmask. + + sigreturn: issue a less innocuous warning. + * signal.c (sys_sigreturn): Issue a less innocuous warning on + architectures for which signal mask decoding is not implemented yet. + +2015-03-04 Dmitry V. Levin + + bootstrap: do not link Makefile* files. + * bootstrap: Do not symlink any Makefile* files, not just Makefile.am + and Makefile.in. + + Reported-by: Christopher Covington + +2015-03-04 Dmitry V. Levin + + ia64: fix sigreturn decoding. + * signal.c (sys_sigreturn) [IA64]: Fix the address of signal mask. + Use print_sigset_addr_len to print signal mask. + +2015-03-04 Dmitry V. Levin + + ia64: use generic signalent. + This complements commit v4.9-321-gfcf7f8d. + + * linux/ia64/signalent.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + +2015-03-04 Giedrius Statkevičius + + Document that -k is available only with libunwind. + Without this users might get confused why `man strace` describes + an option that doesn't work. + + * strace.1: Note that -k is available only if strace is built + with libunwind. + +2015-03-03 Dmitry V. Levin + + debian: update control file. + * debian/control (strace, strace-udeb): Add mips64 and mips64el + to architecture list. + Patch by James Cowgill + + This fixes Debian bug #773375. + +2015-03-03 Dmitry V. Levin + + debian: sync with 4.9-2 package. + * debian/changelog: Sync with 4.9-2. + * debian/control: Likewise. + +2015-03-03 Dmitry V. Levin + + Add arch-specific PTRACE_* constants. + * xlat/ptrace_cmds.in: Add arch-specific ptrace commands. + * xlat/ptrace_events.in: Add PTRACE_EVENT_MIGRATE for tile. + * xlat/ptrace_setoptions_flags.in: Add PTRACE_O_TRACEMIGRATE for tile. + + This fixes Debian bug #734554. + +2015-03-03 Mike Frysinger + + Clarify bootstrap-vs-autoreconf usage. + * README-hacking: Tell people to run ./bootstrap. + +2015-03-03 Dmitry V. Levin + + mips n32: fix preadv/pwritev offset decoding. + In mips n32 abi, like in most of 32-bit architectures, offset + is passed to preadv/pwritev syscalls using two syscall arguments. + + * io.c (print_llu_from_low_high_val) [LINUX_MIPSN32]: Remove. + +2015-03-03 Mike Frysinger + + tests: skip ipc_sem.test on broken kernels. + Rather than trigger an ERROR which fails `make check`, go with SKIP + instead. We don't want the testsuite failing due to kernel bugs. + + * tests/ipc_sem.c (main): Change 99 to 77. + +2015-03-03 Mike Frysinger + + tests: skip pc.test on s390. + The s390 hardware can't support an exact si_addr, and the current kernels + don't handle text addresses correctly at all. Until that improves, skip + the test on s390. + + * tests/pc.c (main): Return 77 on s390 systems. + +2015-03-03 Mike Frysinger + + tests: note the kernel configs for -yy options. + * tests/net-yy.test: Note CONFIG_INET_TCP_DIAG. + * tests/unix-yy.test: Note CONFIG_UNIX_DIAG. + +2015-03-02 Dmitry V. Levin + + alpha: fix -yy decoding. + * socketutils.c (receive_responses): Align buffer on a sizeof(long) boundary. + + Reported-and-tested-by: Mike Frysinger + +2015-03-02 Dmitry V. Levin + + aarch64, x32: fix decoding of compat personality statfs64/fstatfs64. + * statfs.c (struct compat_statfs64) [AARCH64 || X32]: Apply the same + attributes as on X86_64. + + mips: fix compilation warning. + * syscall.c (get_scno) [MIPS]: Fix harmless compilation warning + about comparison between signed and unsigned integer expressions. + + x32: fix compilation warnings. + * sysinfo.c (sys_sysinfo): Use ll length format modifier + instead of l and cast kernel ulong types to unsigned long long. + + aarch64: add -i option support. + * syscall.c (print_pc): Add aarch64 support. + +2015-03-02 Dmitry V. Levin + + ioctl: use x32 specific ioctl entries on x32 personality. + As ioctls_inc.h generated natively on x32 differs both from 32/ioctls_inc.h + (by 45 entries) and from linux/64/ioctls_inc.h (by 322 entries), use x32 + specific ioctl entries on x32 personality. + + * linux/x32/ioctls_inc0.h: Generate from linux v3.19 using ioctls_gen.sh. + * linux/x86_64/ioctlent2.h: Remove. + * linux/x86_64/ioctls_arch2.h: New file. + * linux/x86_64/ioctls_inc2.h: New file. + * Makefile.am (EXTRA_DIST): Remove linux/x86_64/ioctlent2.h, add + linux/x86_64/ioctls_arch2.h and linux/x86_64/ioctls_inc2.h. + +2015-03-02 Dmitry V. Levin + + tests/uid16: skip if real uid is larger than 16bit. + * tests/uid16.c (main): Skip if the uid returned by getuid matches + /proc/sys/kernel/overflowuid. + +2015-03-02 Dmitry V. Levin + + tests: fix uid tests on big endian architectures. + * tests/uid.c (main): Ignore uids returned by getresuid to avoid + 16bit vs 32bit issues on big endian architectures. + Change real UID instead of effective UID in setresuid test. + * tests/uid16.c (main): Likewise. + * tests/uid32.c (main): Change real UID instead of effective UID + in setresuid test to match uid.c + * tests/uid.awk: Update setresuid regexp. + + Reported-by: Mike Frysinger + +2015-03-01 Mike Frysinger + + tests/getdents: handle older getdents calls. + If the tools we use call older getdents syscalls where d_type isn't + passed back, or the arch is old (like Alpha) and can't pass back in + either version, make sure we don't fail. + + * tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN. + +2015-02-28 Dmitry V. Levin + + Fix multiple personalities support in decoding syscall return values. + * syscall.c (trace_syscall_exiting): When current personality is 32bit, + print 32bit return code. + + Update generic 64-bit ioctlent from linux v3.19. + * linux/64/ioctls_inc.h: Update from linux v3.19 using ioctls_gen.sh. + +2015-02-28 Dmitry V. Levin + + sparc, sparc64: fix rt_sigaction decoding. + Fix regression introduced by commit v4.9-9-gc3a5c01. + + * signal.c (HAVE_SA_RESTORER): New macro. + [HPPA || IA64]: Do not undefine SA_RESTORER. + (old_sigaction, old_sigaction32, new_sigaction): Use HAVE_SA_RESTORER + instead of SA_RESTORER to check whether to define sa_restorer. + (decode_old_sigaction, decode_new_sigaction): Use HAVE_SA_RESTORER in + addition to SA_RESTORER to check whether to use sa_restorer. + +2015-02-28 Dmitry V. Levin + + Fix stack buffer overflow when specified command is too long. + * strace.c (startup_child): Check that the length of the command strace + is going to execute does not exceed PATH_MAX limit. + + Reported-by: Cheolung Lee + +2015-02-28 Dmitry V. Levin + + build: include ptrace.h after regs.h. + Restore the order of including and + headers that was inadvertently changed by commit v4.9-280-g5503dd2. + + This should fix build on platforms like m68k where some constants + are defined simultaneously as enums by and as macros + by . + + * process.c: Include "ptrace.h" after "regs.h". + * signal.c: Likewise. + * syscall.c: Likewise. + * util.c: Likewise. + +2015-02-28 Dmitry V. Levin + + x32: fix decoding of timeval, timespec, and timex structures. + As time_t is a 64-bit type in x32 personality, it is not correct to + treat it as a long int type. + + * time.c (current_time_t_is_compat): New macro. + (sprinttv, sprint_timespec, printitv_bitness, tprint_timex): Use it. + (tprint_timeval, do_sprinttv, sprint_timespec): Use j and uintmax_t + when printing tv_sec/tv_usec. + (tprint_timex): Use j and intmax_t/uintmax_t when printing struct timex + members of type kernel_long_t. + +2015-02-28 Mike Frysinger + + tests/ipc_sem: detect broken kernels. + When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc + logic wrongly returns errors. Detect that and throw an error. + + * tests/ipc_sem.c: Return 99 when errno is EFAULT. + * tests/ipc_sem.test: Save output to $OUT and show it when failing. + Handle exit status 99 to throw an ERROR. + +2015-02-27 Dmitry V. Levin + + build: do not link strace with -ldl. + * configure.ac: Fix dladdr check. + +2015-02-27 Mike Frysinger + + Handle broken PTRACE_EVENT_STOP values. + For a few linux releases (3.1 through 3.3), this define in the exported + headers were broken. Redefine if that's the case. + + * ptrace.h [PTRACE_EVENT_STOP]: Redefine if PTRACE_EVENT_STOP is 7. + +2015-02-27 Mike Frysinger + + bootstrap: always set up test dirs. + When files get updated, the bootstrap script should make sure the + parallel dirs are kept in sync. + + * bootstrap: Always generate the test$m. Clean up symlinks first. + Don't link in Makefile.in files. + +2015-02-27 Mike Frysinger + + Fix cross-compiling of ioctlsort. + Use the AX_PROG_CC_FOR_BUILD helper to set up build settings when cross + compiling. This way ioctlsort uses the build tools all the time. + + * configure.ac: Call AX_PROG_CC_FOR_BUILD. + * Makefile.am (ioctlsort_CC): Set to CC_FOR_BUILD. + (ioctlsort_CPPFLAGS): Change CPPFLAGS to CPPFLAGS_FOR_BUILD. + (ioctlsort_CFLAGS): Change CFLAGS to CFLAGS_FOR_BUILD. + (ioctlsort_LDFLAGS): Change LDFLAGS to LDFLAGS_FOR_BUILD. + (ioctlsort_LD): Delete. + (ioctlsort%): Change to ioctlsort%$(BUILD_EXEEXT). Use ioctlsort_CFLAGS. + * m4/ax_prog_cc_for_build.m4: Import from the autoconf-archive package. + +2015-02-27 Dmitry V. Levin + + tests: robustify pc.test. + * configure.ac: Check for dladdr in -ldl. + * tests/Makefile.am (pc_LDADD): Adde $(dl_LIBS). + * tests/pc.c: Include "config.h" and . + (main): Use dladdr to find the address to unmap. + +2015-02-27 Dmitry V. Levin + + tests: drop support for alternative names of select syscall. + This mostly reverts commit 4a00fc4867bde7a4c333f238851e5cb03f02c824. + + * tests/select.awk: Drop _newselect support. + * tests/select.test: Skip if select syscall is not supported. + +2015-02-27 Dmitry V. Levin + + Rename _newselect to select. + As an exception to the general rules that syscall names should match + __NR_* constants defined in kernel headers, show select as "select" + and old select as "oldselect". + + * linux/arm/syscallent.h (82): Change name to oldselect. + * linux/hppa/syscallent.h (142): Change name to select. + * linux/mips/syscallent-n32.h (6022): Likewise. + * linux/mips/syscallent-n64.h (5022): Likewise. + * linux/mips/syscallent-o32.h (4142): Likewise. + * linux/sparc/syscallent.h (230): Likewise. + +2015-02-27 Dmitry V. Levin + + sparc: sync syscall entries with kernel headers. + * linux/sparc/syscallent.h: Fix syscall entries for vmsplice, + inotify_init, inotify_add_watch, inotify_rm_watch, inotify_rm_watch, + ioprio_set, ioprio_get, splice, sync_file_range, sched_getaffinity, and + sched_setaffinity. + (67, 68, 202, 230): Change syscall names to match __NR_* constants + defined in arch/sparc/include/uapi/asm/unistd.h. + +2015-02-26 Dmitry V. Levin + + s390, s390x: sync syscall entry names with kernel headers. + * linux/s390/syscallent.h (1, 180, 181): Change syscall names to match + __NR_* constants defined in arch/s390/include/uapi/asm/unistd.h. + * linux/s390x/syscallent.h: Likewise. + +2015-02-26 Mike Frysinger + + xlat: avoid fork bombing the build system. + When there were fewer xlat headers, this didn't matter as much. + But now with >200, trying to run them all in parallel can easily + fork bomb smaller systems. + + * xlat/gen.sh (main): Do not more jobs than # of cpus. + +2015-02-26 Dmitry V. Levin + + arm: sync syscall entry names with kernel. + * linux/arm/syscallent.h (82, 90, 180, 181, 327): + Change syscall names to match __NR_* constants defined + in arch/arm/include/uapi/asm/unistd.h. + + arm: fix get_mempolicy, set_mempolicy, and timerfd_create syscall entries + * linux/arm/syscallent.h (320, 321, 350): Fix names and handlers. + + hppa: sync syscall entry names with kernel. + * linux/hppa/syscallent.h (18, 28, 59, 84, 108, 109, 280): + Change syscall names to match __NR_* constants defined in + arch/parisc/include/uapi/asm/unistd.h. + + subcall.h: add sendmmsg entry. + * linux/subcall.h: Add sys_sendmmsg entry. + (SYS_socket_nsubcalls): Update. + + arm: simplify ARM_FIRST_SHUFFLED_SYSCALL definition. + * linux/arm/syscallent.h (ARM_FIRST_SHUFFLED_SYSCALL): Use SYS_ipc_subcall. + + ia64: parametrize i386 syscallent size check. + * linux/ia64/syscallent.h: Use (SYS_ipc_subcall + SYS_ipc_nsubcalls) + instead of numeric constant. + + Cleanup linux/subcall.h. + * linux/subcall.h: Use SYS_ipc_subcall. + + alpha: fix statfs decoding. + * statfs.c (printstatfs) [ALPHA]: Remove faulty code. + + x32: fix build regression. + * linux/x32/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + +2015-02-26 Mike Frysinger + + hppa: fix fanotify_mark decoding. + The parisc kernel has some legacy baggage here and decodes the 64bit + field in the reverse order. Handle it in strace too. + + * fanotify.c [HPPA] (sys_fanotify_mark): Reverse the mask bits. + +2015-02-26 Mike Frysinger + + ia64: fix decoding of getresuid/getresgid/setresgid. + Looks like the similarity of these names caused confusion when generating + the syscall table. getresgid was wired to the wrong output while the other + two were wired up to printargs instead of the real printer. + + * linux/ia64/syscallent.h: Connect getresuid to sys_getresuid, getresgid to + sys_getresgid, and setresgid to sys_setresgid. + +2015-02-26 Mike Frysinger + + ia64: fix up builds after 16bit uid support. + The ia64 port pulls in the i386 syscall table so it can decode + 32bit apps, so we need to enable the 16bit uid parsers for it. + + * defs.h (NEED_UID16_PARSERS): Define to 1 for IA64. + * linux/ia64/syscallent.h: Undefine sys_stime to avoid redefine warnings. + +2015-02-26 Mike Frysinger + + v4l2: use uintmax_t for times. + There is no guarantee that the backing value for the various time fields + are ints or longs which makes printfs annoying. Lets cast them to the + uintmax_t type so we can use the j flag and not worry about truncation. + + * v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec. + +2015-02-26 Mike Frysinger + + ignore core/compile files. + Newer autotools includes a compile helper script. + + * .gitignore: Add /compile and core. + +2015-02-24 Dmitry V. Levin + + NEWS: Prepare for 4.10 release. + +2015-02-24 Dmitry V. Levin + + Remove support for systems without PTRACE_SETOPTIONS. + Assume that the kernel is v2.5.46 or newer, i.e. PTRACE_SETOPTIONS + and PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC|PTRACE_O_TRACECLONE + are universally available. + + This change removes all code that implemented post-execve SIGTRAP + handling and fork/vfork/clone->CLONE_PTRACE substitution. + + * defs.h (TCB_BPTSET, TCB_WAITEXECVE): Remove macros. + (need_fork_exec_workarounds, setbpt, clearbpt): Remove declarations. + * strace.c (need_fork_exec_workarounds, + test_ptrace_setoptions_followfork, test_ptrace_setoptions_for_all): + Remove. + (syscall_trap_sig): Set to (SIGTRAP | 0x80). + (ptrace_setoptions): Set to (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC). + (detach): Do not test for TCB_BPTSET. + (init): Do not call test_ptrace_setoptions_followfork and + test_ptrace_setoptions_for_all. Do not test for TCB_BPTSET. + * syscall.c (syscall_fixup_on_sysenter, internal_fork, internal_exec, + syscall_fixup_for_fork_exec, syscall_fixup_on_sysexit): Remove. + (trace_syscall_entering): Do not test for TCB_WAITEXECVE. Do not call + syscall_fixup_on_sysenter and syscall_fixup_for_fork_exec. + (trace_syscall_exiting): Do not call syscall_fixup_on_sysexit and + syscall_fixup_for_fork_exec. + [IA64] (ia64_ia32mode): Make static. + * linux/ia64/arch_regs.h (ia64_ia32mode): Remove declaration. + * util.c: Do not include "syscall.h". + (arg_setup, get_arg0, get_arg1, set_arg0, set_arg1, restore_arg0, + restore_arg1, arg_finish_change, change_syscall, setbpt, clearbpt): + Remove. + * tests/ptrace_setoptions.test: Remove. + * tests/Makefile.am (TESTS): Remove it. + +2015-02-24 Dmitry V. Levin + + tests: robustify pc.test. + * tests/pc.c (main): Unmap larger memory region. + Dump process map for debug purposes. + * tests/pc.test: Update regexps to take CLD_DUMPED child process + into account. + +2015-02-23 Dmitry V. Levin + + tests: fix "make dist" regression. + * tests/Makefile.am (EXTRA_DIST): Add getrandom.awk. + + tests: workaround broken awk. + * tests/getdents.out: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/getdents.test: Check whether awk is capable of matching long + regular expressions. + +2015-02-23 Dmitry V. Levin + + Fix compilation warnings about incompatible print formats. + On some platforms printing of __s64 types with "%lld" format, + or __u64 types with "%llu" or "%llx" formats causes a warning + that __s64/__u64 type is not compatible with long long format. + From my PoV, this is nonsense, but the workaround costs nothing. + + * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Cast __u64 types + to (unsigned long long). + * v4l2.c (v4l2_ioctl): Likewise. Cast __s64 type to (long long). + +2015-02-23 Dmitry V. Levin + + powerpc64: fix build regression. + * linux/powerpc64/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + + signalent: update from linux v3.19. + * linux/alpha/signalent.h: Update from linux v3.19 signalent.sh. + * linux/hppa/signalent.h: Likewise. + * linux/mips/signalent.h: Likewise. + * linux/sparc/signalent.h: Likewise. + + Cleanup auxiliary signalent files. + * linux/aarch64/signalent1.h: Include "signalent.h". + * linux/powerpc64/signalent1.h: Likewise. + * linux/sparc64/signalent2.h: Likewise. + * linux/tile/signalent1.h: Likewise. + * linux/x32/signalent1.h: Likewise. + * linux/x86_64/signalent1.h: Likewise. + * linux/x86_64/signalent2.h: Likewise. + * linux/sparc64/signalent.h: Include "sparc/signalent.h". + * linux/sparc64/signalent1.h: Include "sparc/signalent1.h". + * linux/x32/signalent.h: Remove. + * Makefile.am (EXTRA_DIST): Remove linux/x32/signalent.h. + +2015-02-23 Dmitry V. Levin + + x86_64, x32: fix sys_sigreturn. + On x86_64/x32, sys_sigreturn is defined only for i386 personality. + + * signal.c (sys_sigreturn): Define for X32. + (sys_sigreturn) [X86_64 || X32]: Implement for i386 personality only. + +2015-02-23 Dmitry V. Levin + + sparc, x32: fix build regression. + * syscall.c (print_pc): Use current_wordsize iff it is defined. + + Change errnoent.h files to use designated initializers. + * signal.c (printsiginfo): Allow elements of errnoent array to be zero. + * syscall.c (trace_syscall_exiting): Likewise. + * errnoent.sh: Output designated initializers. + * linux/errnoent.h: Regenerated. + * linux/alpha/errnoent.h: Regenerated. + * linux/hppa/errnoent.h: Regenerated. + * linux/mips/errnoent.h: Regenerated. + * linux/sparc/errnoent.h: Regenerated. + * linux/sparc/errnoent1.h: Regenerated. + * linux/powerpc/errnoent.h: New file. + * linux/powerpc64/errnoent.h: Include "powerpc/errnoent.h". + * Makefile.am (EXTRA_DIST): Add linux/powerpc/errnoent.h + and linux/powerpc64/errnoent.h. + + errnoent: update from linux v3.19. + * linux/errnoent.h: Update from linux v3.19 using errnoent.sh. + * linux/alpha/errnoent.h: Likewise. + * linux/hppa/errnoent.h: Likewise. + * linux/mips/errnoent.h: Likewise. + * linux/sparc/errnoent.h: Likewise. + + Cleanup auxiliary errnoent files. + * linux/aarch64/errnoent1.h: Include "errnoent.h". + * linux/powerpc64/errnoent1.h: Likewise. + * linux/sparc64/errnoent2.h: Likewise. + * linux/tile/errnoent1.h: Likewise. + * linux/x32/errnoent1.h: Likewise. + * linux/x86_64/errnoent1.h: Likewise. + * linux/x86_64/errnoent2.h: Likewise. + * linux/sparc64/errnoent.h: Include "sparc/errnoent.h". + * linux/sparc64/errnoent1.h: Include "sparc/errnoent1.h". + * linux/x32/errnoent.h: Remove. + * Makefile.am (EXTRA_DIST): Remove linux/x32/errnoent.h. + +2015-02-22 Dmitry V. Levin + + evdev: update constants from linux v3.19. + * xlat/evdev_keycode.in: Update from linux v3.19. + * xlat/evdev_prop.in: Likewise. + + evdev: decode keycode value in EVIOC[GS]KEYCODE_V2 commands. + * evdev.c (keycode_V2_ioctl): Use evdev_keycode to print + input_keymap_entry.keycode. + + evdev: fix build with old kernel headers. + * configure.ac: Check whether struct input_absinfo.resolution is defined + in . + * evdev.c (SYN_MAX): Add fallback definition. + (abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check. + (keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks. + (evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW, + EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW. + (evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP, + EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE. + +2015-02-22 Etienne Gemsa + + 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. + +2015-02-22 Dmitry V. Levin + + Fix build with old kernel headers. + * strace.c (print_debug_info, maybe_allocate_tcb, print_signalled, + print_exited): Remove "const" qualifier from status variable to + workaround some old implementations of WIFSIGNALED/WIFSTOPPED/WIFEXITED + macros. + * v4l2.c: Include . + (v4l2_ioctl): Check that V4L2_CTRL_FLAG_NEXT_CTRL and VIDIOC_S_EXT_CTRLS + macros are defined. + * tests/Makefile.am (AM_CPPFLAGS): Define. + + Fix "make dist" regression. + * Makefile.am (EXTRA_DIST): Remove README-linux. + +2015-02-20 Elliott Hughes + + test/sfd.c: add missing includes. + +2015-02-19 Dmitry V. Levin + + Remove linux/fanotify.h. + * linux/fanotify.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * fanotify.c: Do not include . + * xlat/fan_classes.in: Add default values. + * xlat/fan_event_flags.in: Likewise. + * xlat/fan_init_flags.in: Likewise. + * xlat/fan_mark_flags.in: Likewise. + + Remove linux/keyctl.h. + * linux/keyctl.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * keyctl.c: Do not include . + * xlat/key_perms.in: Add default values. + * xlat/key_reqkeys.in: Likewise. + * xlat/key_spec.in: Likewise. + * xlat/keyctl_commands.in: Likewise. + + Remove linux/kexec.h. + * linux/kexec.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * kexec.c: Do not include . + * xlat/kexec_arch_values.in: Add default values. + * xlat/kexec_flags.in: Rename to kexec_load_flags.in, add default + values. + + Remove linux/inotify.h. + * linux/inotify.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * inotify.c: Do not include . + * xlat/inotify_flags.in: Add default values. + + Remove linux/reboot.h. + * linux/reboot.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * reboot.c: Do not include . + * xlat/bootflags1.in: Add default values. + * xlat/bootflags2.in: Likewise. + * xlat/bootflags3.in: Likewise. + + seccomp: fix fallback definitions of some SECCOMP_* constants. + * seccomp.c (SECCOMP_SET_MODE_STRICT, SECCOMP_SET_MODE_FILTER, + SECCOMP_FILTER_FLAG_TSYNC): Remove fallback definitions. + * xlat/seccomp_filter_flags.in: Add default value. + * xlat/seccomp_ops.in: Add default values. + +2015-02-19 Dmitry V. Levin + + is_negated_errno: sync MAX_ERRNO with the kernel. + Linux kernel used to guarantee that the largest errno value will not + exceed 4095, but SECCOMP_RET_ERRNO support introduced by kernel commit + v3.4-rc2-13-gacf3b2c71ed20c53dc69826683417703c2a88059 inadvertently + broke it. The guarantee is back with kernel commit + v3.19-8275-g580c57f1076872ebc2427f898b927944ce170f2d. + + * syscall.c (is_negated_errno): Set maximum errno value to 4095. + +2015-02-19 Mike Frysinger + + README-linux: punt. + Considering we're requiring linux-2.6 era kernels, the discussion of + header troubles that plagued 2.2 and 2.4 are no longer relevant. + + * README-linux: Delete. + +2015-02-19 Dmitry V. Levin + + Improve prctl decoding. + * configure.ac (AC_CHECK_HEADERS): Add linux/securebits.h. + * prctl.c (sys_prctl): Implement full decoding of all PR_* constants + as defined in linux v3.19. + (sys_arch_prctl): Fix decoding of unknown commands. + * xlat/cap.in: New file. + * xlat/pr_mce_kill.in: New file. + * xlat/pr_mce_kill_policy.in: New file. + * xlat/pr_set_mm.in: New file. + * xlat/pr_tsc.in: New file. + * xlat/pr_unalign_flags.in: New file. + * xlat/secbits.in: New file. + * xlat/prctl_options.in: Remove non-linux constants, add fallback + definitions. + * xlat/seccomp_mode.in: Add fallback definitions. + + xlat: extend syntax. + * xlat/gen.sh (gen_header): If the name of constant is specified with a + value, generate a default definition for the constant using this value. + * xlat/timerfdflags.in: Use extended syntax. + + Move CAP_* definitions out to header files. + * Makefile.am (strace_SOURCES): Add caps0.h and caps1.h. + * caps0.h: New file. + * caps1.h: New file. + * capability.c: Remove CAP_* definitions, include "caps0.h" + and "caps1.h" instead. + Include "xlat/cap_mask0.h" instead of "xlat/capabilities.h". + Include "xlat/cap_mask1.h" instead of "xlat/capabilities1.h". + (print_cap_bits): Update callers. + * xlat/capabilities.in: Rename to xlat/cap_mask0.in. + * xlat/capabilities1.in: Rename to xlat/cap_mask1.in. + +2015-02-18 Dmitry V. Levin + + Declare all format printers with printf format attribute. + * defs.h (printllval, printnum_int, printnum_long): Mark with + format(printf) attribute. + * sock.c (sock_ioctl): Fix format string. + +2015-02-17 Dmitry V. Levin + + Rename printnum to printnum_long to avoid confusion. + * defs.h (printnum): Rename to printnum_long. + * util.c (printnum): Likewise. + * process.c (sys_ptrace): Likewise. + * time.c (sys_time): Likewise. + + Use printnum_int consistently. + * sock.c (sock_ioctl): Use printnum_int instead of printnum to print + integer type. + * stream.c (sys_getpmsg): Likewise. + +2015-02-16 Dmitry V. Levin + + print_pc: fix multiple personalities support. + * syscall.c (print_pc): Choose instruction pointer format depending + on current_wordsize, not the size of long integer type. + * tests/pc.c: New file. + * tests/pc.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add pc. + (TESTS): Add pc.test. + * tests/.gitignore: Add pc. + + mips: use PTRACE_GETREGS to fetch all registers. + * linux/mips/arch_regs.h (struct mips_regs): New structure. + (mips_REG_*): New macros. + * signal.c (sys_sigreturn) [MIPS]: Use mips_REG_SP. + * syscall.c [MIPS] (struct mips_regs): New variable. + [MIPS] (ARCH_REGS_FOR_GETREGS): New macro. + (mips_a3, mips_r2): Remove. + (print_pc) [MIPS]: Use mips_REG_EPC. + (get_scno) [MIPS]: Use mips_REG_V0 and mips_REG_A3. + (get_syscall_args) [MIPS]: Use mips_REG_A[0-5]. + (get_syscall_result) [MIPS]: Remove. + (get_error) [MIPS]: Use mips_REG_A3 and mips_REG_V0. + + mips: move ABI check to configure.ac. + * configure.ac [MIPS]: Check for MIPS ABI. + * defs.h [MIPS]: Remove MIPS ABI check. + * ioctlsort.c: Likewise. + + tests: support alternative names of select syscall. + * tests/select.awk: Recognize "_newselect" as another name of "select". + * tests/select.test: Try alternative names of select syscall. + +2015-02-15 Dmitry V. Levin + + i386: fix compilation warning. + Some gcc versions complain about assigning long* to uint32_t* on i386. + + * syscall.c [I386] (i386_esp_ptr): Change type from uint32_t* to long*. + * linux/i386/arch_regs.h (i386_esp_ptr): Likewise. + * linux/x86_64/arch_regs.h: Do not include "i386/arch_regs.h". + (i386_esp_ptr): New prototype. + +2015-02-14 Dmitry V. Levin + + Do not reset get_regs_error unnecessarily. + As get_regs() is now guaranteed to set get_regs_error, + there is no need to reset get_regs_error before get_regs() call. + + * strace.c (trace): Call clear_regs() iff !WIFSTOPPED. + +2015-02-14 Dmitry V. Levin + + get_syscall_result: remove redundant ifdefs. + As get_regs() is now guaranteed to fetch registers when either + ARCH_REGS_FOR_GETREGSET or ARCH_REGS_FOR_GETREGS is defined, we can + safely replace all checks for architectures where these macros are defined + with a single check for these macros. + + * syscall.c (get_syscall_result): Check for [ARCH_REGS_FOR_GETREGSET || + ARCH_REGS_FOR_GETREGS]. Remove all checks for architectures where + nothing has to be done after get_regs(). + +2015-02-14 Dmitry V. Levin + + get_regs: define for all architectures. + * defs.h (get_regs_error): Remove. + (clear_regs): Update prototype, declare unconditionally. + (get_regs): Declare unconditionally. + * syscall.c (clear_regs): New function. + (get_regs): Define unconditionally. + (get_regs_error): Define unconditionally, change scope to static. + + get_regs: unify code for architectures that use PTRACE_GETREGS. + * syscall.c [I386, POWERPC, ARM, AVR32, SPARC, SPARC64, TILE] + (ARCH_REGS_FOR_GETREGS): New macro. + (get_regs): Unify code for ARCH_REGS_FOR_GETREGS architectures. + + get_regset: define iff PTRACE_GETREGSET is used. + * syscall.c [AARCH64, X86_64, X32] (ARCH_REGS_FOR_GETREGSET, + ARCH_IOVEC_FOR_GETREGSET): New macros. + (get_regset): Define iff ARCH_REGS_FOR_GETREGSET is defined; change + return type to long, return ptrace() return code instead of assigning it + to get_regs_error; do not list individual architectures, implement + constant and variable iovec cases depending on ARCH_IOVEC_FOR_GETREGSET. + (get_regs): Assign get_regset() return code to get_regs_error. + +2015-02-14 Dmitry V. Levin + + arm, i386: switch back to use PTRACE_GETREGS. + PTRACE_GETREGSET and PTRACE_GETREGS methods are equally good on arm and + i386 architectures, but PTRACE_GETREGSET with fallback to PTRACE_GETREGS + is a bit more costly, so choose the method that costs less. + This partially reverts commit v4.7-149-gfaa177e. + + * syscall.c [ARM, I386] (ARCH_REGS_FOR_GETREGSET): Remove. + (get_regset) [ARM || I386]: Remove. + (get_regs) [ARM || I386]: Use PTRACE_GETREGS unconditionally. + +2015-02-14 Dmitry V. Levin + + syscall.c: remove obsolete ifdefs. + * syscall.c (get_regset, get_regs): Do not check for availability + of PTRACE_GETREGSET and NT_PRSTATUS macros. + + syscall.c: ensure that NT_PRSTATUS is defined. + * syscall.c: Do not include . + (NT_PRSTATUS): New macro. + +2015-02-13 Dmitry V. Levin + + Move regs-related macros and declarations from defs.h to regs.h. + * regs.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/arch_regs.h: New file. + * linux/alpha/arch_regs.h: Likewise. + * linux/arm/arch_regs.h: Likewise. + * linux/hppa/arch_regs.h: Likewise. + * linux/i386/arch_regs.h: Likewise. + * linux/ia64/arch_regs.h: Likewise. + * linux/mips/arch_regs.h: Likewise. + * linux/powerpc/arch_regs.h: Likewise. + * linux/sh64/arch_regs.h: Likewise. + * linux/sparc/arch_regs.h: Likewise. + * linux/sparc64/arch_regs.h: Likewise. + * linux/tile/arch_regs.h: Likewise. + * linux/x86_64/arch_regs.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * defs.h: Remove definitions of PTRACE_*, REG_*, PT_*, U_REG_*, + and ARM_* macros. + Remove declarations of struct pt_regs variables. + [SPARC]: Do not include . + [SPARC64]: Do not include . + * bjm.c: Do not include . + * process.c: Include "regs.h". + Do not include and . + [IA64]: Do not include and . + * util.c: Likewise. + * syscall.c: Likewise. + [AARCH64]: Define struct arm_pt_regs and ARM_* macros. + [SPARC]: Include . + [SPARC64]: Include . + * signal.c: Include "regs.h". + Do not include and . + [IA64]: Do not include . + * strace.c [IA64]: Do not include . + + Move all ptrace-related macros and declarations from defs.h to ptrace.h. + * ptrace.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * configure.ac (AC_CHECK_HEADERS): Remove linux/ptrace.h and sys/ptrace.h. + * defs.h: Do not include and . + Remove definitions of PTRACE_* macros. + * process.c: Remove workarounds, include "ptrace.h". + * signal.c: Likewise. + * syscall.c: Likewise. + * util.c: Likewise. + * strace.c: Include "ptrace.h". + * wait.c: Likewise. + +2015-02-12 Dmitry V. Levin + + Enhance wait status decoding. + * xlat/ptrace_events.in: New file. + * wait.c: Include "xlat/ptrace_events.h". + (printstatus): In case of WIFSTOPPED, print 0x80 flag separately from + the stop signal name. + [WIFCONTINUED]: Add WIFCONTINUED support. + Decode PTRACE_EVENT_* events. + +2015-02-08 Bart Van Assche + + scsi: add bsg support. + The Linux kernel supports two different versions of the SG_IO API, + namely v3 and v4. This patch adds support for version 4 of this API. + At least the sg3_utils package supports version 4 of this API. Version + 4 of this API is used if /dev/bsg/H:C:I:L is used as device name. + + This patch has been tested by inspecting the output of the following + commands: + + modprobe scsi_debug dev_size_mb=16 delay=0 + dev=$(lsscsi | sed -n '/ scsi_debug /s,^[^/]*,,p') + ./strace -eioctl -s256 sg_inq $dev + echo 'Test XDWRITEREAD(10)' + bsg=/dev/bsg/$(lsscsi | sed -n '/ scsi_debug /s,^\[\([^]]\+\)\].*,\1,p') + dd if=/dev/zero bs=512 count=1 | + ./strace -eioctl -s256 sg_raw -s 512 -r 1024 $bsg 53 00 00 00 00 01 00 00 01 00 + + * configure.ac (AC_CHECK_HEADERS): Add linux/bsg.h. + * xlat/bsg_protocol.in: New file. + * xlat/bsg_subprotocol.in: Likewise. + * scsi.c: Include them and . + (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, + print_sg_io_v4_res): New functions. + (print_sg_io_req, print_sg_io_res): Use them. + (scsi_ioctl): Update callers. + +2015-02-08 Bart Van Assche + + scsi: Add iovec support. + * scsi.c (print_sg_io_req, print_sg_io_res): Add support for decoding + iovecs passed via the SG I/O v3 interface. Decode the "data in" and + "data out" buffers in hex instead of in ASCII. + + scsi: on exit, print only initialized part of the buffer. + * scsi.c (print_sg_io_res): Only print that part of the data in buffer + that has been initialized by the SCSI LLD driver. + + scsi: make print_sg_io_buffer() print square brackets instead of its callers + * scsi.c (print_sg_io_buffer): Print square brackets in this function. + (print_sg_io_req, print_sg_io_res): Update callers. + +2015-02-08 Bart Van Assche + + scsi: improve consistency with other decoding functions. + Pass pointers to tracee's memory as integers instead of pointers. + + * scsi.c (print_sg_io_buffer): Change second argument's type to + unsigned long. + (print_sg_io_req, print_sg_io_res): Update callers. + +2015-02-08 Dmitry V. Levin + + tests: extend getdents to support all filesystems regardless of file order + * tests/getdents.awk: Include all 6 possible permutations of 3 + direntries to regexps. + +2015-02-08 Dmitry V. Levin + + print_setsockopt: fix fall-through bug in SOL_IP switch case. + This fixes the bug introduced by commit v4.9-250-ga0a4909. + + * net.c (print_setsockopt): Separate SOL_IP case from SOL_PACKET. + + Reported-by: Ben Noordhuis + +2015-02-07 Dmitry V. Levin + + Do not watch for post-execve SIGTRAP if PTRACE_O_TRACEEXEC is enabled. + If PTRACE_O_TRACEEXEC option is enabled, then post-execve SIGTRAPs are + suppressed and we can safely skip -ENOSYS heuristics. This partially + reverts commits v4.9-258-g8e398b6 and v4.9-261-gd70c41d. + + * syscall.c (syscall_fixup_on_sysenter): Skip if PTRACE_O_TRACEEXEC + flag is set in ptrace_setoptions. Remove all SECCOMP_RET_ERRNO + workarounds as they are not needed when PTRACE_O_TRACEEXEC is not + supported by the kernel. + +2015-02-07 Dmitry V. Levin + + When the process stared by strace exits/terminates, forget its pid. + The process stared by strace can exit/terminate only once. When this + happens, forget its pid, so that any other event or action related to a + process with the same pid as the pid of that first process would not be + confused with that first process. + + * strace.c (print_signalled, print_exited): Clear strace_child when it + equals to the given pid. + +2015-02-07 Dmitry V. Levin + + -b execve: avoid misleading warning about unknown pid. + * strace.c (maybe_allocate_tcb): If detach_on_execve is set, do not warn + about !WIFSTOPPED process with pid == strace_child. + * tests/bexecve.test: New test. + * tests/Makefile.am (TESTS): Add it. + + -b execve: do not use struct tcb after detach. + * strace.c (trace): Do not proceed after detach. + +2015-02-07 Dmitry V. Levin + + trace: split into several functions. + This change moves the main loop back to main() and splits trace() + into several functions. There are no algorithmic changes. + + * strace.c (print_debug_info, maybe_allocate_tcb, maybe_switch_tcbs, + print_signalled, print_exited, print_stopped, startup_tcb): New + functions. + (trace) Use them. Move the main loop ... + (main): ... here. + +2015-02-07 Dmitry V. Levin + + printsiginfo: constify the first argument. + * signal.c (printsiginfo): Make the first argument a pointer to a const type. + * defs.h (printsiginfo): Likewise. + (printsiginfo, printsiginfo_at): Always define these prototypes. + * configure.ac (AC_CHECK_TYPES): Remove siginfo_t, as HAVE_SIGINFO_T + is no longer used. + +2015-02-06 Dmitry V. Levin + + test: add a manual test for seccomp decoding. + * test/.gitignore: Add seccomp. + * test/Makefile (PROGS): Likewise. + * test/seccomp.c: New file. + * test/README: Mention ../tests/. + + Implement seccomp decoding. + * configure.ac (AC_CHECK_HEADERS): Add linux/filter.h + and linux/seccomp.h. + * defs.h (print_seccomp_filter): New prototype. + * linux/dummy.h (sys_seccomp): Remove. + * linux/syscall.h (sys_seccomp): New prototype. + * prctl.c: Include . + (sys_prctl): Decode PR_SET_SECCOMP. + * seccomp.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/bpf_class.in: New file. + * xlat/bpf_miscop.in: Likewise. + * xlat/bpf_mode.in: Likewise. + * xlat/bpf_op_alu.in: Likewise. + * xlat/bpf_op_jmp.in: Likewise. + * xlat/bpf_rval.in: Likewise. + * xlat/bpf_size.in: Likewise. + * xlat/bpf_src.in: Likewise. + * xlat/seccomp_filter_flags.in: Likewise. + * xlat/seccomp_mode.in: Likewise. + * xlat/seccomp_ops.in: Likewise. + * xlat/seccomp_ret_action.in: Likewise. + +2015-02-06 Dmitry V. Levin + + is_negated_errno: support large errno values. + Thanks to SECCOMP_RET_DATA == 0xffff, abnormally large errno + values could be easily seen when a seccomp filter is used, e.g. + BPF_STMT(BPF_RET, SECCOMP_RET_ERRNO | SECCOMP_RET_DATA) + + * syscall.c (is_negated_errno): Allow errno values as large as 0xffff. + +2015-02-06 Dmitry V. Levin + + x86, x32, x86_64: print SECCOMP_RET_ERRNO filtered syscalls. + This is required to process SECCOMP_RET_ERRNO filtered syscalls on + systems where linux kernel does not change the syscall number to -1. + + * syscall.c (is_negated_errno): Move before syscall_fixup_on_sysenter. + (syscall_fixup_on_sysenter) [I386 || X32 || X86_64] : Use it to check + AX register. + +2015-02-06 Dmitry V. Levin + + is_negated_errno: merge x86_64 and x32 definitions. + * syscall.c (kernel_long_t, kernel_ulong_t): New types. + (is_negated_errno): Merge [X32] and [!X32] definitions. + (get_error): Merge [X86_64] and [X32] code. + +2015-02-06 Dmitry V. Levin + + x32: rename is_negated_errno_x32 to is_negated_errno. + Use the same function name on all architectures. + + * syscall.c [X32] (is_negated_errno_x32): Rename to is_negated_errno. + (get_error) [X32]: Update callers. + +2015-02-06 Dmitry V. Levin + + x86, x32, x86_64: do not skip syscall number -1. + Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering. + + * syscall.c (syscall_fixup_on_sysenter) [I386 || X32 || X86_64]: + Do not skip syscalls that have number -1. + +2015-02-06 Dmitry V. Levin + + x86_64: do not interpet syscall number -1 as a x32 personality syscall. + Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering. + + * syscall.c (get_scno) [X86_64]: Handle the case of scno == -1. + +2015-02-05 Dmitry V. Levin + + Implement getrandom syscall decoding. + * getrandom.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_getrandom): Remove. + * linux/syscall.h (sys_getrandom): New prototype. + * xlat/getrandom_flags.in: New file. + * tests/getrandom.c: New file. + * tests/getrandom.awk: New file. + * tests/getrandom.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add getrandom. + (TESTS): Add getrandom.test. + (EXTRA_DIST): Add getrandom.awk. + * tests/.gitignore: Add getrandom. + +2015-02-04 Dmitry V. Levin + + tests: add a test for select syscall decoding. + Convert test/select.c into a regular test. + + * test/Makefile (PROGS): Remove select. + * test/.gitignore: Likewise. + * test/select.c: Rewrite to ... + * tests/select.c: ... new file. + * tests/select.awk: New file. + * tests/select.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add select. + (TESTS): Add select.test. + (EXTRA_DIST): Add select.awk. + * tests/.gitignore: Add select. + +2015-02-01 Dmitry V. Levin + + tests: add a test for the latest dumpio fix. + * tests/dumpio.expected: New file. + * tests/unix-pair-send-recv.c: New file. + * tests/dumpio.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add unix-pair-send-recv. + (TESTS): Add dumpio.test. + (EXTRA_DIST): Add dumpio.expected. + * tests/.gitignore: Add unix-pair-send-recv. + +2015-02-01 Aurelien Jacobs + + Fix simultaneous -e read and -e write usage. + This allows using both -e read=FD and -e write=FD at the same time + with the same FD. + Without this patch, the -e write=FD is ignored if -e read=FD is used + at the same time. + +2015-01-31 Dmitry V. Levin + + net.c: remove unused HAVE_SIN6_SCOPE_ID_LINUX-based code. + The AC_SIN6_SCOPE_ID autoconf macro that was able to define + HAVE_SIN6_SCOPE_ID_LINUX was removed by commit v4.4-98-g64f793a. + + * net.c [HAVE_SIN6_SCOPE_ID_LINUX]: Remove. + +2015-01-30 Dmitry V. Levin + + printsock: do not fetch sockaddr.sa_data twice. + * net.c (printsock): Print addrbuf.sa.sa_data using print_quoted_string. + + setsockopt: add decoding of MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP. + * net.c (print_group_req): New function. + (print_setsockopt): Use it. + +2015-01-29 Dmitry V. Levin + + tests: add a test for sockaddr_un.sun_path decoding. + * tests/net-accept-connect.c: Allow long socket addresses. + * tests/sun_path.test: New test. + * tests/Makefile.am (TESTS): Add it. + + printsock: print the whole sockaddr_un.sun_path. + * net.c (printsock): If sockaddr_un.sun_path is not NUL-terminated, + do not omit the last byte of sockaddr_un.sun_path array. + + printsock: do not fetch sockaddr_un.sun_path twice. + * net.c (printsock): Print addrbuf.sau.sun_path using + print_quoted_string. + +2015-01-29 Dmitry V. Levin + + net: define all SOL_* constants. + Ensure that all known SOL_* constants are defined. + Sync the list of known SOL_* constants with linux/socket.h. + + * net.c: Provide definitions for all SOL_* constants. + Remove all SOL_* preprocessor conditionals. + (socketlayers): Disconnect from inet_protocols. + * xlat/socketlayers.in: Remove SOL_ICMP, add SOL_ALG and SOL_NFC. + +2015-01-29 Dmitry V. Levin + + setsockopt: decode PACKET_ADD_MEMBERSHIP. + * xlat/packet_mreq_type.in: New file. + * net.c: Include "xlat/packet_mreq_type.h". + (print_packet_mreq): New function. + (print_setsockopt): Use it. + +2015-01-29 Dmitry V. Levin + + getsockopt, setsockopt: do not decode structures in non-verbose mode. + Move the code that is common between getsockopt and setsockopt parsers + to a separate function. + Move printers specific to getsockopt and setsockopt to separate + functions, choose appropriate parsers depending on verbose mode. + Move parsers of specific socket options to separate functions. + + * net.c (printicmpfilter): Rename to print_icmp_filter. + (printsockopt): Remove. + (print_sockopt_fd_level_name, print_linger, print_ucred, + print_tpacket_stats, print_getsockopt, print_tpacket_req, + print_packet_mreq, print_setsockopt): New functions. + (sys_getsockopt, sys_setsockopt): Use them. + +2015-01-28 Dmitry V. Levin + + sendmsg: do not decode msghdr in non-verbose mode. + * net.c (printmsghdr): Do not decode struct msghdr in non-verbose mode. + + decode_select: do not allocate unused memory. + * desc.c (decode_select): On entering syscall, do not allocate memory + in non-verbose mode. + +2015-01-26 Dmitry V. Levin + + xattr: quote using print_quoted_string. + * xattr.c (print_xattr_val): Drop local quoting code, use + print_quoted_string. + + v4l2: quote pixelformat. + * v4l2.c (print_pixelformat): Output in quoted v4l2_fourcc() format. + + v4l2: quote strings. + * v4l2.c (v4l2_ioctl): Print strings using print_quoted_string. + + mips: quote sysmips nodename. + * sysmips.c (sys_sysmips): Print nodename using print_quoted_string. + + block_ioctl: quote strings. + * block.c (print_blkpg_req): Print blkpg_partition.devname and + blkpg_partition.volname using print_quoted_string. + (block_ioctl): Print blk_user_trace_setup.name using print_quoted_string. + + sys_uname: quote struct utsname members. + * uname.c (PRINT_UTS_MEMBER): New macro. + (sys_uname): Use them. + + sock_ioctl: quote network interface names. + * sock.c (print_ifname): New function. + (sock_ioctl): Use it to quote ifr_name, ifru_newname, and ifru_slave. + + printsock: quote network interface names. + * net.c (printsock): Print network interface names returned by + if_indextoname() using print_quoted_string. + + getdents, getdents64: quote filenames. + * dirent.c (print_old_dirent): Fix quoting. + (sys_getdents): Print d_name using print_quoted_string. + (sys_getdents64): Likewise. + * tests/getdents.test: Test it. + * tests/getdents.awk: Update. + +2015-01-26 Dmitry V. Levin + + printfd: quote pathnames. + Change printfd() behaviour in show_fd_path mode to quote pathnames + the same way printpathn() does. + + * util.c (printfd): Print non-socket paths using print_quoted_string. + * tests/scm_rights-fd.test: Test it. + * tests/scm_rights.c: Update. + +2015-01-26 Dmitry V. Levin + + Rework string_quote API. + string_quote() has proven to be too hard to use, replace it with + print_quoted_string() that does memory allocation and prints the result. + + * defs.h (string_quote): Remove. + (QUOTE_0_TERMINATED, QUOTE_OMIT_LEADING_TRAILING_QUOTES): New macros. + (print_quoted_string): New prototype. + * util.c (string_quote): Make static; take "style" flags instead + of "len", treat QUOTE_0_TERMINATED style flag as former (len == -1); + add QUOTE_OMIT_LEADING_TRAILING_QUOTES style flag support. + (ALLOCA_CUTOFF, use_alloca): New macros. + (print_quoted_string): New function. + (printpathn, printstr): Update to new API. + * loop.c (loop_ioctl): Likewise. + * mtd.c (ubi_ioctl): Likewise. + * net.c (print_scm_security): Likewise. + * socketutils.c (unix_parse_response): Likewise. + +2015-01-24 Dmitry V. Levin + + avr32: fix typo in sys_timerfd syscall entry. + * linux/avr32/syscallent.h (timerfd): Change sys_name to "timerfd". + + hppa: fix typos in getresuid and getresgid syscall entries. + * linux/hppa/syscallent.h (getresuid): Change sys_func to sys_getresuid. + (getresgid): Change sys_func to sys_getresgid. + +2015-01-24 Helge Deller + + hppa: fix typo in getpeername syscall entry. + This fixes an obvious typo which prints "lock" instead of "getpeername" + for the getpeername syscall. + + * linux/hppa/syscallent.h (getpeername): Change sys_name to "getpeername". + +2015-01-24 Dmitry V. Levin + + Impove struct cmsghdr decoding. + Print all cmsghdr structures in msg_control array, + not just the first one. + Change output format to be consistent with other parts of strace + where structures and arrays are printed. + Implement decoder for SCM_SECURITY message type. + + * net.c (print_scm_rights, print_scm_creds, print_scm_security): + New functions. + (printcmsghdr): Use them. Iterate over all members of the array. + * xlat/scmvals.in: Add SCM_SECURITY. + * tests/scm_rights.c (main): Pass one more descriptor to the receiver. + Set SO_PASSCRED on the receiver part. Reserve enough space to receive + SCM_CREDENTIALS and SCM_RIGHTS. + * tests/scm_rights-fd.test: Update. + +2015-01-24 Dmitry V. Levin + + Update SO_* constants. + * xlat/sockoptions.in: Add SO_DOMAIN, SO_MARK, SO_NOFCS, SO_PASSSEC, + SO_PROTOCOL, SO_RCVBUFFORCE, SO_SNDBUFFORCE, SO_TIMESTAMPING, + and SO_TIMESTAMPNS. + +2015-01-24 Dmitry V. Levin + + tests: run tests for each supported personality. + When strace supports more than one personality, run test suite + for each personality supported by the host system. + + * bootstrap: Create tests-m32 and tests-mx32 subtrees from tests. + * configure.ac: Check for -m32 and -mx32 runtime support. + (AC_CONFIG_FILES): Add tests-m32/Makefile and tests-mx32/Makefile. + * Makefile.am [HAVE_M32_RUNTIME] (TESTS_M32): Define. + [HAVE_MX32_RUNTIME] (TESTS_MX32): Define. + (SUBDIRS): Add $(TESTS_M32) $(TESTS_MX32). + * .gitignore: Add /tests-m32 and /tests-mx32. + +2015-01-24 Dmitry V. Levin + + Fix ILP32 personality struct cmsghdr decoding on LP64 architectures. + * net.c (union_cmsghdr): New union. + [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (cmsghdr32): New structure. + (printcmsghdr): Properly handle the case of current_wordsize < sizeof(long). + + Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures + * io.c (print_llu_from_low_high_val) [SIZEOF_LONG == SIZEOF_LONG_LONG + && SUPPORTED_PERSONALITIES > 1]: Properly handle the case of + current_wordsize < sizeof(long). + +2015-01-22 Dmitry V. Levin + + 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. + +2015-01-21 Gabriel Laskar + + 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. + +2015-01-21 Dmitry V. Levin + + Update auxiliary maintainer mode build tools. + * git-set-file-times: Update from rsync. + * git-version-gen: Update from gnulib. + * gitlog-to-changelog: Likewise. + + Update warnings.m4. + * m4/warnings.m4: Update from gnulib. + +2015-01-21 Dmitry V. Levin + + powerpc64: maintain own linux/powerpc64 subdirectory. + Most architectures supported by strace have their own subdirectory in + linux directory, but powerpc64 didn't, causing inconveniences. + + * configure.ac (arch): Define to "powerpc64" on powerpc64. + * linux/powerpc/errnoent1.h: Move to linux/powerpc64/. + * linux/powerpc/ioctlent1.h: Likewise. + * linux/powerpc/signalent1.h: Likewise. + * linux/powerpc/syscallent1.h: Likewise. + * linux/powerpc64/ioctlent.h: New file. + * linux/powerpc64/syscallent.h: Likewise. + * linux/powerpc64/userent.h: Likewise. + * Makefile.am (EXTRA_DIST): Remove linux/powerpc/ioctlent1.h, + linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h, and + linux/powerpc/signalent1.h; added linux/powerpc64/errnoent1.h, + linux/powerpc64/ioctlent.h, linux/powerpc64/ioctlent1.h, + linux/powerpc64/signalent1.h, linux/powerpc64/syscallent.h, + linux/powerpc64/syscallent1.h, and linux/powerpc64/userent.h. + +2015-01-21 Dmitry V. Levin + + configure.ac: remove unused AC_INCLUDEDIR. + * configure.ac (AC_INCLUDEDIR): Remove. + * m4/includedir.m4: Remove. + + 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. + +2015-01-20 Dmitry V. Levin + + 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. + +2015-01-16 Dmitry V. Levin + + ioctlent.sh: cleanup regexps that are used to fetch bases. + + ioctlent.sh: sync lookup regexps that are used in grep and sed. + ioctlent.sh looks for ioctl command names using grep, and fetches them + with their definitions using sed. Historically, lookup regexps used in + grep and sed are slightly different, which makes the script more + complicated than necessary. + + qemu_multiarch_testing: update. + * qemu_multiarch_testing/.gitignore: New file. + * qemu_multiarch_testing/README: Update statistics. + * qemu_multiarch_testing/hdc.dir/init2: Run "make check". + * qemu_multiarch_testing/make-hdc-img.sh: Robustify, + automatically calculate hdc image size. + * qemu_multiarch_testing/parallel-build-hdc-img.sh: Reduce + hdb image size. Report completion of each parallelized task. + +2015-01-14 Dmitry V. Levin + + tests: add IPC_STAT to ipc tests, workaround limitiations of old kernels + * tests/ipc_msg.c: Include . + (main): Add a test call with IPC_STAT, handle old kernels MSG_STAT behaviour. + * tests/ipc_sem.c: Include . + (main): Add a test call with IPC_STAT, handle old kernels SEM_STAT behaviour. + * tests/ipc_shm.c: Include . + (main): Add a test call with IPC_STAT, handle old kernels SHM_STAT behaviour. + + Change length type of umoven and umovestr to unsigned. + * defs.h (umoven, umovestr): Change type of 3rd argument from "int" + to "unsigned int". + * util.c (umoven, umovestr): Likewise. Adjust the code appropriately. + + tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel + * tests/mmsg.c: #include + (main): Return 77 if sendmmsg failed with ENOSYS. + + tests: skip ip network tests when the network is not functional. + * tests/inet-accept-connect-send-recv.c (main): Return 77 if inet stream + socket cannot be created or it cannot be bound to INADDR_LOOPBACK. + * tests/net-yy.test: Skip the test if inet-accept-connect-send-recv + returns 77. + + tests: handle the case when all 64 process capability bits are set. + * tests/caps.awk: Handle the case when all bits of 64-bit capability + word are set. + + tests: explicitly request gawk when using gawk features. + * tests/uid.test: Check for gawk availability and invoke gawk instead of + plain awk because the test uses gawk's match() feature. + + tests: skip detach tests if kill does not work. + * tests/detach-running.test: Skip if "kill -0" does not work. + * tests/detach-sleeping.test: Likewise. + * tests/detach-stopped.test: Likewise. + + ARM OABI: fix potential compilation warning. + * syscall.c (get_scno) [!__ARM_EABI__ || ENABLE_ARM_OABI]: Fix + "comparison between signed and unsigned" warning reported by some + gcc versions. + + powerpc: fix potential compilation warning. + * mem.c [POWERPC] (sys_subpage_prot): Fix "comparison between signed + and unsigned" warning reported by some gcc versions. + +2015-01-13 Dmitry V. Levin + + sparc, sparc64: remove ioctl header file names from solaris ioctl entries + Starting with commit v4.9-27-g3e252ca, header file names should not be + part of ioctlent files included by syscall.c + + * linux/sparc/ioctlent1.h: Remove ioctl header file names. + * linux/sparc64/ioctlent2.h: Remove all entries, include "ioctlent.h". + +2015-01-13 Dmitry V. Levin + + mips: enable indirect ipc subcall support. + * linux/mips/syscallent-n32.h [LINUX_MIPSN32]: Define SYS_socket_subcall, + include "subcall.h". + * linux/mips/syscallent-n64.h [LINUX_MIPSN64]: Likewise. + * linux/mips/syscallent-o32.h [LINUX_MIPSO32]: Likewise. + + mips: remove stub entries from syscallent files, generate stubs at build time + * linux/mips/genstub.sh: New file. + * Makefile.am (EXTRA_DIST): Add it. + * configure.ac [MIPS]: Use it to generate syscallent stubs. + * linux/mips/.gitignore: Add syscallent stubs. + * linux/mips/syscallent-n32.h: Remove stub entries, include + the stub file instead. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + + build: add $(builddir)/$(OS)/$(ARCH) to the headers search list. + * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS)/$(ARCH) before + -I$(srcdir)/$(OS)/$(ARCH). + + build: fix build if siginfo_t lacks si_timerid/si_overrun. + * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_timerid and + siginfo_t.si_overrun. + * signal.c (printsiginfo) [SI_TIMER]: Check HAVE_SIGINFO_T_SI_TIMERID + and HAVE_SIGINFO_T_SI_OVERRUN. + + configure.ac: remove unused AM_CONDITIONAL expressions. + * configure.ac (AM_CONDITIONAL): Remove I386, X86_64, X32. + + tests: portability fixes. + * tests/stat.test: dd obs= is not portable, use bs= instead. + * tests/stat32-v.test: Likewise. + * tests/stat64-v.test: Likewise. + * tests/net.test: Use $* instead of $@ in the quoted string. + * tests/net-fd.test: Likewise. + * tests/statfs.test: Quote { and } in regexps. + * tests/caps.awk: Likewise. + * tests/getdents.awk: Likewise. + * tests/net-yy-accept.awk: Likewise. + * tests/net-yy-connect.awk: Likewise. + * tests/sigaction.awk: Likewise. + * tests/unix-yy-accept.awk: Likewise. + * tests/unix-yy-connect.awk: Likewise. + +2015-01-12 Dmitry V. Levin + + Wire up new syscalls. + * linux/dummy.h (sys_bpf, sys_execveat, sys_getrandom, + sys_kexec_file_load, sys_memfd_create, sys_seccomp): New stub aliases. + * linux/32/syscallent.h (seccomp, getrandom, memfd_create, bpf, + execveat): New entries. + * linux/64/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/ia64/syscallent.h (getrandom, memfd_create, bpf, execveat): + New entries. + * linux/m68k/syscallent.h: Likewise. + * linux/s390/syscallent.h: (seccomp, getrandom, memfd_create, bpf, + s390_pci_mmio_write, s390_pci_mmio_read, execveat): New entries. + * linux/s390x/syscallent.h: Likewise. + * linux/x86_64/syscallent.h (seccomp, getrandom, memfd_create, + kexec_file_load, bpf, execveat): New entries. + * linux/x32/syscallent.h: Likewise. + * linux/xtensa/syscallent.h (seccomp, getrandom, memfd_create): + New entries. + +2015-01-12 Dmitry V. Levin + + s390x: adjust some syscall entries. + According to linux/arch/s390/include/uapi/asm/unistd.h, readdir is + defined both on s390 and s390x, while getrlimit, _llseek, sendfile64, + and fadvise64_64 are defined on s390 only. + + * linux/s390x/syscallent.h (readdir): Add. + (getrlimit, _llseek, sendfile64, fadvise64_64): Remove. + +2015-01-12 Dmitry V. Levin + + Change syscallent.h files to use designated initializers. + Automatically convert all linux syscallent.h files to a form that uses + designated initializers, with subsequent correction of whitespace + indentation. + + * linux/alpha/syscallent.h: Use designated initializers. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + +2015-01-12 Dmitry V. Levin + + Create generic 32-bit syscallent.h. + Since arc/syscallent.h, metag/syscallent.h, or1k/syscallent.h, and + tile/syscallent1.h share a lot of identical syscall entries described in + , move these entries to a new file 32/syscallent.h + using the following automated conversion with subsequent correction of + whitespace indentation: + + sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^[[:space:]]*\[[[:space:]]*2\(4[4-9]\|5[0-9]\)/d' linux/arc/syscallent.h + + * linux/32/syscallent.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/arc/syscallent.h: Include "32/syscallent.h", + remove generic 32-bit syscall entries, use designated initializers. + * linux/metag/syscallent.h: Likewise. + * linux/or1k/syscallent.h: Likewise. + * linux/tile/syscallent1.h: Likewise. + +2015-01-12 Dmitry V. Levin + + tile: fix syscall entries. + * linux/tile/syscallent1.h (truncate64, ftruncate64): Change nargs to 3. + (pread64, pwrite64): Change nargs to 5. + (llseek): Change sys_name to _llseek. + + s390: fix fadvise64 and fadvise64_64 syscall entries. + * linux/s390/syscallent.h (fadvise64, fadvise64_64): Change sys_func to + printargs until special parsers for 31-bit 31 s390 emulation wrappers + are written. + + alpha: fix fadvise64 syscall entry. + * linux/alpha/syscallent.h (fadvise64): Change sys_name to fadvise64. + + tile: fix fadvise64_64 syscall entry. + * linux/tile/syscallent1.h (fadvise64_64): Fix nargs, sys_func, + and sys_name. + + Fix getrlimit and ugetrlimit syscall entries. + * linux/arm/syscallent.h (getrlimit, ugetrlimit): Fix sys_name. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/avr32/syscallent.h (getrlimit): Fix sys_name. + * linux/or1k/syscallent.h: Likewise. + * linux/s390/syscallent.h (ugetrlimit): Fix sys_name. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + + Fix umount and umount2 syscall entries. + * linux/aarch64/syscallent1.h (umount): Change nargs to 1. + * linux/avr32/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/ia64/syscallent.h (umount2): Change nargs to 2. + * linux/arm/syscallent.h (umount, umount2): Fix sys_name. + * linux/bfin/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/metag/syscallent.h: (umount2): Fix sys_name. + * linux/or1k/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + + Fix sendfile64 syscall entries. + * linux/arc/syscallent.h (sendfile64): Change sys_name to sendfile64. + * linux/metag/syscallent.h: Likewise. + * linux/or1k/syscallent.h: Likewise. + + Fix number of arguments in ipc family syscall entries. + * linux/64/syscallent.h (msgget, semget, semtimedop, semop, shmget, + shmctl, shmat, shmdt): Fix nargs for direct ipc syscalls. + * linux/alpha/syscallent.h (msgctl, msgget, msgrcv, semget, shmctl, + shmdt, shmget, semtimedop): Likewise. + * linux/avr32/syscallent.h (msgget, semget, semop, semtimedop, shmat, + shmget, shmdt, shmctl): Likewise. + * linux/bfin/syscallent.h (semget, semop, msgctl, msgget, msgrcv, shmat, + * shmctl, shmdt, shmget, semtimedop): Likewise. + * linux/hppa/syscallent.h (semop, semget, msgrcv, msgget, msgctl, + semtimedop): Likewise. + * linux/microblaze/syscallent.h (semtimedop, semget, semop, msgctl, + msgget, msgrcv, shmat, shmctl, shmdt, shmget): Likewise. + * linux/ia64/syscallent.h (semtimedop): Likewise. + * linux/mips/syscallent-n32.h (semtimedop): Likewise. + * linux/mips/syscallent-n64.h (semtimedop): Likewise. + * linux/or1k/syscallent.h (msgget, msgctl, msgrcv, semget, semtimedop, + semop, shmget, shmctl, shmat, shmdt): Likewise. + * linux/sh64/syscallent.h (semget, msgget, shmget): Likewise. + * linux/tile/syscallent1.h (msgget, semget, semtimedop, semop, shmget, + shmctl, shmat, shmdt): Likewise. + * linux/x32/syscallent.h (shmget, shmat, shmctl, semget, semop, shmdt, + msgget, semtimedop): Likewise. + * linux/x86_64/syscallent.h (shmget, shmat, shmctl, semget, semop, + shmdt, msgget, semtimedop): Likewise. + * linux/xtensa/syscallent.h (shmget, shmat, shmctl, shmdt, semtimedop, + semget, semop, msgget, msgrcv, msgctl): Likewise. + +2015-01-12 Dmitry V. Levin + + Create generic 64-bit syscallent.h. + Since aarch64/syscallent1.h and tile/syscallent.h share a lot of + identical syscall entries described in , move + these entries to a new file 64/syscallent.h using the following + automated conversion with subsequent correction of whitespace + indentation: + + sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^\[[[:space:]]*2\(4[4-9]\|5[0-9]\)\]/d' linux/tile/syscallent.h + + * linux/64/syscallent.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/aarch64/syscallent1.h: Include "64/syscallent.h", + remove generic 64-bit syscall entries, use designated initializers. + * linux/tile/syscallent.h: Likewise. + +2015-01-12 Dmitry V. Levin + + Fix nfsservctl syscall entries. + * linux/arc/syscallent.h (nfsservctl): Set nargs, sys_func, and sys_name. + * linux/metag/syscallent.h: Likewise. + + Add missing syscall entries for sched_[gs]etattr and renameat2. + * linux/alpha/syscallent.h (sched_setattr, sched_getattr, renameat2): + New syscall entries. + * linux/arc/syscallent.h: Likewise. + * linux/metag/syscallent.h: Likewise. + * linux/or1k/syscallent.h: Likewise. + * linux/tile/syscallent.h: Likewise. + * linux/tile/syscallent1.h: Likewise. + + Fix NUMA related syscall entries. + * linux/alpha/syscallent.h (mbind, get_mempolicy, set_mempolicy): + Set sys_func. + * linux/hppa/syscallent.h (mbind, get_mempolicy, set_mempolicy): + Fix nargs, set sys_func. + * linux/microblaze/syscallent.h (mbind): Fix nargs. + * linux/mips/syscallent-n32.h (move_pages): Set sys_func. + * linux/mips/syscallent-n64.h (move_pages): Likewise. + * linux/mips/syscallent-o32.h (mbind): Fix nargs. + * linux/or1k/syscallent.h (migrate_pages): Likewise. + * linux/powerpc/syscallent.h (migrate_pages): Likewise. + * linux/sh/syscallent.h (mbind): Likewise. + * linux/sh64/syscallent.h (mbind): Likewise. + + xtensa: fix syscall entries. + * linux/xtensa/syscallent.h (sendmmsg): Fix sys_func and sys_name. + (restart_syscall, io_setup, io_destroy, io_submit, io_getevents, + io_cancel, add_key, request_key, keyctl): Set sys_func. + (migrate_pages, mbind, get_mempolicy, set_mempolicy, move_pages, + fstatat64): Fix nargs. + (renameat2): New entry. + + Fix sched_setparam syscall entries. + * linux/aarch64/syscallent1.h (sched_setparam): Change nargs to 2. + * linux/arm/syscallent.h (sched_setparam): Likewise. + * linux/avr32/syscallent.h (sched_setparam): Likewise. + * linux/bfin/syscallent.h (sched_setparam): Likewise. + * linux/i386/syscallent.h (sched_setparam): Likewise. + * linux/m68k/syscallent.h (sched_setparam): Likewise. + * linux/microblaze/syscallent.h (sched_setparam): Likewise. + * linux/s390/syscallent.h (sched_setparam): Likewise. + * linux/s390x/syscallent.h (sched_setparam): Likewise. + * linux/sh/syscallent.h (sched_setparam): Likewise. + * linux/sh64/syscallent.h (sched_setparam): Likewise. + * linux/tile/syscallent.h (sched_setparam): Likewise. + * linux/tile/syscallent1.h (sched_setparam): Likewise. + * linux/x32/syscallent.h (sched_setparam): Likewise. + * linux/x86_64/syscallent.h (sched_setparam): Likewise. + + arc: fix fanotify_mark syscall entry. + * linux/arc/syscallent.h (fanotify_mark): Change nargs to 6. + + ia64: add fallocate syscall entry. + * linux/ia64/syscallent.h (fallocate): Add syscall entry. + + Fix lookup_dcookie syscall entries. + * linux/s390/syscallent.h (lookup_dcookie): Add syscall entry. + * linux/s390x/syscallent.h (lookup_dcookie): Likewise. + * linux/tile/syscallent.h (lookup_dcookie): Change nargs to 3. + * linux/x32/syscallent.h (lookup_dcookie): Likewise. + + aarch64: fix syscall names for statfs, fstatfs, truncate, and ftruncate. + * linux/aarch64/syscallent1.h (statfs, fstatfs, truncate, ftruncate): + Use correct syscall names. + + aarch64: fix mlock syscall entry. + * linux/aarch64/syscallent1.h (mlock): Change to mlock entry. + + sh, sh64: fix mlock syscall entry. + * linux/sh/syscallent.h (mlock): Change nargs to 2. + * linux/sh64/syscallent.h (mlock): Likewise. + + tile: fix swapon syscall entries. + * linux/tile/syscallent.h (swapon): Change nargs to 2. + * linux/tile/syscallent1.h (swapon): Likewise. + +2015-01-12 Dmitry V. Levin + + ARM EABI: reserve some space for new syscalls. + Reserve the same space for new syscalls on EABI as it is already + reserved on OABI. + + * linux/arm/syscallent.h [__ARM_EABI__] (ARM_FIRST_SHUFFLED_SYSCALL): + Raise to 400. + +2015-01-12 Dmitry V. Levin + + arm: rewrite shuffle_scno in a bit more readable way. + * linux/arm/syscallent.h: Define ARM_FIRST_SHUFFLED_SYSCALL instead of + ARM_LAST_ORDINARY_SYSCALL. + * syscall.c [ARM || AARCH64] (shuffle_scno): Update. + + tests: add tests for ipc syscalls decoding. + * tests/ipc_msg.c: New file. + * tests/ipc_sem.c: Likewise. + * tests/ipc_shm.c: Likewise. + * tests/ipc_msg.test: New test. + * tests/ipc_sem.test: Likewise. + * tests/ipc_shm.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add ipc_msg, ipc_sem, and ipc_shm. + (TESTS): Add ipc_msg.test, ipc_sem.test, and ipc_shm.test. + * tests/.gitignore: Add ipc_msg, ipc_sem, and ipc_shm. + +2015-01-12 Dmitry V. Levin + + Fix indirect ipc subcall handling. + indirect_ipccall used to guess whether currently decoded ipc syscall is + an indirect subcall or not based on generic knowledge, while there is a + robust method to identify indirect ipc subcalls. + + * defs.h (TRACE_INDIRECT_SUBCALL): New flag. + * ipc.c (indirect_ipccall): Check it. + * linux/subcall.h: Set it. + +2015-01-12 Dmitry V. Levin + + Move socket and ipc subcall entries to subcall.h. + Syscall entries for socket and ipc subcalls are the same on all + architectures, or at least they should be the same, so move them + to the single file. + + * linux/subcall.h: Add syscall entries for socket and ipc subcalls. + * linux/arm/syscallent.h: Remove entries for socket and ipc subcalls. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + +2015-01-12 Dmitry V. Levin + + sh: fix typo introduced by commit v4.9-121-gd535b8b. + * linux/sh/syscallent.h (getresgid32): Fix typo in sys_func and sys_name. + +2015-01-10 Dmitry V. Levin + + Fix fanotify_mark decoding on 32-bit architectures. + The fanotify_mark syscall takes a 64-bit mask, and on 32-bit + architectures it is split up into two syscall arguments. + + * configure.ac (AC_CHECK_FUNCS): Add fanotify_mark. + (AC_CHECK_HEADERS): Add sys/fanotify.h. + * defs.h (getllval): New prototype. + * util.c (getllval): New function based on printllval. + (printllval): Use getllval. + * fanotify.c (sys_fanotify_mark): Use getllval to properly decode + 64-bit mask and two syscall arguments followed by it. + * tests/fanotify_mark.c: New file. + * tests/fanotify_mark.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add fanotify_mark. + (TESTS): Add fanotify_mark.test. + * tests/.gitignore: Add fanotify_mark. + +2015-01-09 Dmitry V. Levin + + v4l2: fix build on systems with older kernel headers. + * v4l2.c (print_v4l2_format_fmt): Do not use + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY unless it is defined. + (v4l2_ioctl): Do not use VIDIOC_ENUM_FRAMESIZES and + VIDIOC_ENUM_FRAMEINTERVALS unless they are defined. + +2015-01-09 Dmitry V. Levin + + tests: fix build with awk that does not support switch-case. + The switch-case statement is a gawk-specific feature which is not + necessarily available, let's use traditional if-else statements instead. + + * tests/uid.awk: Rewrite without switch-case statements. + +2015-01-09 Dmitry V. Levin + + Fix build on systems that lack O_CLOEXEC definition. + * xlat/timerfdflags.in [!TFD_CLOEXEC]: Check that O_CLOEXEC is defined. + +2015-01-09 Dmitry V. Levin + + Fix build on systems that lack NETLINK_SOCK_DIAG definition. + NETLINK_INET_DIAG was introduced in linux v2.6.14, + NETLINK_SOCK_DIAG was added much later in linux v3.3. + + * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG] + (NETLINK_SOCK_DIAG): Define. + * socketutils.c: Likewise. + * tests/netlink_unix_diag.c: Likewise. + +2015-01-09 Dmitry V. Levin + + Cleanup local copy of linux/fanotify.h. + * linux/fanotify.h: Remove macros and structures not used by + fanotify_init and fanotify_mark parsers. + + Fix "make dist" regression introduced by commit v4.9-125-g120e5db. + * Makefile.am (EXTRA_DIST): Add linux/unix_diag.h. + +2015-01-08 Dmitry V. Levin + + tests: fix build with fresh glibc. + * tests/netlink_unix_diag.c: Include . + +2015-01-08 Dmitry V. Levin + + ioctlent.sh: handle linux/aufs_type.h properly. + Before this change, ioctlent.sh could not recognize unusual constants + defined by linux/aufs_type.h, resulting to ioctls.h with references to + these constants without appropriate definitions in ioctldefs.h. + + * linux/ioctlent.sh: Update the regexp that is used to lookup constants + referenced by generated ioctls.h. + +2015-01-08 Dmitry V. Levin + + tests: fix distcheck. + * tests/stat32-v.test: Remove work files if the test is skipped. + + Fix printing of time_t values set in the distant future. + * util.c (sprinttime): Increase buffer size. + * tests/stat64-v.test: Try to set modification time of the sample file + to a value set in the distant future. + + Use AC_CHECK_TYPES to check for struct statfs64. + * m4/statfs.m4: Remove. + * configure.ac (AC_STATFS64): Remove. + (AC_CHECK_TYPES): Add struct statfs64. + * statfs.c: Replace HAVE_STATFS64 with HAVE_STRUCT_STATFS64. + + Use AC_CHECK_TYPES to check for struct stat64. + * m4/stat.m4: Remove. + * configure.ac (AC_STAT64): Remove. + (AC_CHECK_TYPES): Add struct stat64. + * file.c: Replace HAVE_STAT64 with HAVE_STRUCT_STAT64. + + file.c: fix 32-bit stat decoding on 64-bit architectures. + * file.c [SPARC || SPARC64] (struct stat): Remove, use generic + definition from . + [SPARC64] (struct stat_sparc64, printstat_sparc64): Remove. + [AARCH64 || X86_64 || X32 || POWERPC64 || SPARC64] (struct stat32, + STAT32_PERSONALITY): Define. + [STAT32_PERSONALITY] (struct stat_powerpc32): Rename to struct stat32. + [STAT32_PERSONALITY] (printstat_powerpc32): Rename to printstat32. + (printstat) [STAT32_PERSONALITY]: Call printstat32 when + current_personality == STAT32_PERSONALITY. + [HAVE_STAT64] (printstat64) [STAT32_PERSONALITY]: Call printstat when + current_personality != STAT32_PERSONALITY. + [!HAVE_STAT64] (sys_stat64): Fallback to sys_stat. + [!HAVE_STAT64] (sys_fstat64): Fallback to sys_fstat. + + sparc: reuse struct stat parser code for struct solstat decoding. + * printstat.h: Parametrize major() and minor(). + * file.c [SPARC || SPARC64]: Define do_printstat_sol by instantiating + printstat.h template. + [SPARC || SPARC64] (printstatsol): Use do_printstat_sol. + + ppc64: reuse struct stat parser code for struct stat_powerpc32 decoding. + * file.c [POWERPC64]: Define do_printstat32 by instantiating printstat.h + template. + [POWERPC64] (printstat_powerpc32): Use do_printstat32. + + file.c: group related parsers together. + * file.c (sys_stat, sys_fstat): Collect in one place right before + the definition of printstat64. + (sys_stat64, sys_fstat64): Collect in one place right after the + definition of printstat64. + + file.c: collect scattered __old_kernel_stat related code. + * file.c [HAVE_STRUCT___OLD_KERNEL_STAT] (convertoldstat, printoldstat, + sys_oldstat, sys_oldfstat): Collect functions in one place. + + Use the same source code for struct stat/stat64 decoding. + * file.c: Define do_printstat64 by instantiating printstat.h template. + (printstat64): Use do_printstat64. + + x32: use generic printstat/printstat64 parsers. + * file.c (printstat) [X32]: Define. + (printstat64) [X32]: Use "struct stat64" instead of "struct stat". + Use printstat for x32 personality processes. + (printstat64_x32): Remove. + (sys_stat64, sys_fstat64) [X32]: Use printstat64 instead of + printstat64_x32. + + x32: remove redundant definitions. + * file.c [X32]: Do not define "struct stat" and "struct + __old_kernel_stat" locally, use definitions provided by . + Do not define "struct stat64" exclusively, reuse another definition + added earlier for X86_64. + + Convert do_printstat to a template function. + * printstat.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Include "printstat.h". + (do_printstat): Move to printstat.h, parametrize its name + and struct stat. + + file.c: prepare realprintstat for parametrization. + * file.c (realprintstat): Adjust format strings so that all 64-bit + integer fields are printed with %llu format, and %u format is used for + all the rest. Rename to do_printstat. + (printstat, printoldstat): Update callers. + + tests: cleanup stat.test. + * tests/stat.test: Rewrite in a more readable way. + + tests: check verbose decoding of 32-bit and 64-bit struct stat. + * tests/stat.c: New file. + * tests/stat32.c: Likewise. + * tests/stat32-v.test: New file. + * tests/stat64-v.test: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add stat and stat32. + (stat_CFLAGS): Define. + (TESTS): Add stat32-v.test and stat64-v.test. + * tests/.gitignore: Add stat and stat32. + +2015-01-07 Dmitry V. Levin + + Cleanup struct stat.st_flags decoding. + There are no symbolic constants defined for struct stat.st_flags, + so decode this rare field as unsigned int. + + * xlat/fileflags.in: Remove. + * file.c (realprintstat, printstat64) [HAVE_STRUCT_STAT_ST_FLAGS]: + Decode struct stat.st_flags as unsigned int. + +2015-01-07 Dmitry V. Levin + + Drop struct stat.st_aclcnt and stat.st_level support. + Remove the code that supports struct stat.st_aclcnt and stat.st_level + decoding -- these fields are not defined in system headers. + + * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_aclcnt and + struct stat.st_level. + * file.c (realprintstat, printstat64) + [HAVE_STRUCT_STAT_ST_ACLCNT || HAVE_STRUCT_STAT_ST_LEVEL]: Remove. + +2015-01-07 Dmitry V. Levin + + tests: fix race condition in net-accept-connect based tests. + Change all net-accept-connect based tests to use different unix domain + socket addresses, so that these tests could be safely run in parallel. + + * tests/net-accept-connect.c: Parametrize unix domain socket address. + * tests/net-fd.test: Pass socket address to net-accept-connect. + * tests/net.test: Likewise. + * tests/unix-yy.test: Likewise. + * tests/unix-yy-accept.awk: Update regexps. + * tests/unix-yy-connect.awk: Likewise. + +2014-12-31 Mike Frysinger + + timerfd: update flags decoding. + The current code only decodes TFD_TIMER_ABSTIME when the kernel has + a bunch of newer flags. We have to handle fallbacks for all of them + since the kernel doesn't currently export things to userspace. + + * time.c: Include fcntl.h for O_* defines. + (TFD_TIMER_ABSTIME): Move to xlat/timerfdflags.in. + * xlat/timerfdflags.in: Add more definitions. + +2014-12-29 Dmitry V. Levin + + sparc: fix fxstat decoding. + * file.c [SPARC || SPARC64] (sys_fxstat): Print file descriptor + using printfd. + +2014-12-29 Dmitry V. Levin + + sparc: drop _STAT64_VER support. + Starting with commit v4.6-240-g5afdf12, nobody compiles this + non-Linux code. + + * file.c [SPARC || SPARC64] (sys_xstat, sys_fxstat): Remove + _STAT64_VER code. + +2014-12-29 Dmitry V. Levin + + sparc: remove redundant sys_lxstat. + * file.c [SPARC || SPARC64] (sys_lxstat): Remove. + * linux/sparc/dummy2.h (solaris_lxstat): Alias to sys_xstat. + * linux/sparc64/dummy2.h (solaris_lxstat): Likewise. + +2014-12-28 Dmitry V. Levin + + file.c: do not include unused headers. + * file.c: Do not include . + +2014-12-27 Dmitry V. Levin + + Cleanup UTIME_NOW/UTIME_OMIT decoding. + Move the code that's present in two copies from sprinttv() + to a new helper function. + + * time.c (do_sprinttv): New function. + (sprinttv): Use it. + +2014-12-27 Elliott Hughes + + Fix UTIME_NOW/UTIME_OMIT decoding. + The kernel doesn't actually care what tv_sec is set to --- it only checks + tv_nsec when looking for the special values. + +2014-12-26 Dmitry V. Levin + + Make -yy output for inet sockets consistent with unix domain sockets. + Prepend -yy output generated for INET/INET6 TCP/UDP sockets with their + protocol name obtained using getxattr. + + * socketutils.c (inet_parse_response): Add proto_name argument. + Print proto_name for connected and unconnected sockets. + (receive_responses): Add proto_name argument, pass it to the parser. + (inet_print): Add proto_name argument, pass it to receive_responses. + (unix_parse_response): Add proto_name argument. + (print_sockaddr_by_inode): Pass protocol name to inet_print calls. + * tests/net-yy-accept.awk: Update to match new output format. + * tests/net-yy-connect.awk: Likewise. + +2014-12-25 Dmitry V. Levin + + tests: robustify unix domain socket decoding test. + Unix domain socket address family name is not universally decoded as + AF_LOCAL, other names like AF_UNIX and AF_FILE are valid synonyms. + Similarly, PF_UNIX and PF_FILE are valid synonyms for PF_LOCAL. + + Some test regexps have to be properly initialized before they could + be used, so make sure they are initialized before use. + +2014-12-25 Dmitry V. Levin + + tests: fix unix domain socket decoding availability test. + Since inet_diag and unix_diag interfaces are implemented by different + kernel modules, they have to be tested separately. + + * tests/netlink_unix_diag.c: New file. + * tests/unix-yy.test: Use it. + * tests/Makefile.am (check_PROGRAMS): Add it. + * tests/.gitignore: Likewise. + +2014-12-25 Masatake YAMATO + + tests: add a test for decoding unix domain socket addresses. + * tests/unix-yy-accept.awk: New file. + * tests/unix-yy-connect.awk: New file. + * tests/unix-yy.test: New test. + * tests/Makefile.am (TESTS): Add it. + (EXTRA_DIST): Add unix-yy-accept.awk and unix-yy-connect.awk. + +2014-12-25 Masatake YAMATO + + Support unix domain sockets in -yy option. + This change extends -yy option to handle unix domain sockets: + their peer addresses will be printed, similar to inet sockets. + + For a listening socket, its socket inode and socket path are printed. + For an accepted socket, its socket inode, the peer inode, and the + socket path are printed. + For a client socket, its socket inode and the peer inode are printed. + + An example of a server side communication using netcat: + + $ ./strace -yy -e network nc -l -U /tmp/example.sock + socket(PF_LOCAL, SOCK_STREAM, 0) = 3 + setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 + bind(3, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0 + listen(3, 10) = 0 + accept(3, {sa_family=AF_LOCAL, NULL}, [2]) = 414727245,"/tmp/example.sock"]> + recvfrom(414727245,"/tmp/example.sock"]>, "INPUT\n", 8192, 0, NULL, NULL) = 6 + INPUT + + An example of a client side communication using netcat: + + $ ./strace -yy -e network nc -U /tmp/example.sock + socket(PF_LOCAL, SOCK_STREAM, 0) = 3 + connect(3, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0 + getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 + INPUT + ... + sendto(314727246]>, "INPUT\n", 6, 0, NULL, 0) = 6 + + * linux/unix_diag.h: New file. + * socketutils.c (send_query): Rename to inet_send_query. + (parse_response): Rename to inet_parse_response. + (unix_print, unix_send_query, unix_parse_response): New functions. + (receive_responses): Add a new argument named parser: a function for + handling protocol specific data parts of diag messages. + (print_sockaddr_by_inode): Call unix_print. + Replace NETLINK_INET_DIAG with NETLINK_SOCK_DIAG, they are equal + but NETLINK_SOCK_DIAG looks more generic. + +2014-12-16 Masatake YAMATO + + Use the protocol name of a socket as a hint for peer address resolution. + To resolve the peer address of socket, all combinations of families + (AF_INET, AF_INET6) and protocols(IPPROTO_TCP, IPPROTO_UDP) were tried. + This change utilizes the protocol name obtained via getxattr to specify + the right combination. + + * socketutils.c (inet_print): New helper function. + (print_sockaddr_by_inode): Use it. Utilize the protocol name + associated with the given inode for resolving the peer socket + address. If the protocol name is NULL, resolve the address + by trying combinations of families and protocols as before. + * defs.h (print_sockaddr_by_inode): Update prototype. + * util.c (printfd): Pass the protocol name associated with + the given path to print_sockaddr_by_inode as the 2nd argument. + +2014-12-16 Dmitry V. Levin + + Fix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls + Convert parsers of these syscalls to the same scheme as were applied to + parsers of other uid/gid related syscalls. + That is, define two sets of parsers on architectures that support + (either directly or via multiarch) 16-bit and 32-bit gid getgroups + and setgroups syscalls simultaneously, and reuse essentially the same + code by parametrizing uid_t and names of parser functions. + + * groups.c: Remove. + (sys_getgroups, sys_setgroups): Move ... + * uid.c: ... here and parametrize their names. + * Makefile.am (strace_SOURCES): Remove groups.c. + * linux/syscall.h (sys_getgroups32, sys_setgroups32): Remove. + [NEED_UID16_PARSERS] (sys_getgroups16, sys_setgroups16): New prototypes. + * linux/arm/syscallent.h: Rename sys_[gs]etgroups to sys_[gs]etgroups16, + rename sys_[gs]etgroups32 to sys_[gs]etgroups. + * linux/bfin/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * tests/uid.c: Test for getgroups. + * tests/uid16.c: Likewise. + * tests/uid32.c: Test for getgroups32. + * tests/uid.awk: Test for getgroups/getgroups32 decoding. + * tests/uid.test: Trace getgroups/getgroups32 syscalls. + +2014-12-16 Dmitry V. Levin + + Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls. + Define two sets of parsers on architectures that support (either + directly or via multiarch) 16-bit and 32-bit uid/gid syscalls + simultaneously. Since the code in these two sets is essentially + the same and the key difference between them is the size of uid_t, + implement it by parametrizing uid_t and names of parser functions. + + * defs.h (NEED_UID16_PARSERS): New macro. + * linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16, + sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16, + sys_setreuid16, sys_setuid16): New prototypes. + * linux/dummy.h (sys_geteuid16): Alias to sys_getuid16. + (sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16, + sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding + sys_*uid16 functions. + * uid.c: Stop including . + Parametrize uid_t and names of all exported functions. + (get_print_uid): New function. + (sys_getresuid): Use it. + (printuid): Check for (uid_t) -1. + * uid16.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16, + sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16, + sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16, + sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16, + and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries. + * linux/bfin/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * tests/uid16.c: New file. + * tests/uid16.test: New test. + * tests/Makefile.am (CHECK_PROGRAMS): Add uid16. + (TESTS): Add uid16.test. + * tests/.gitignore: Add uid16. + +2014-12-16 Dmitry V. Levin + + sh, sh64: fix uid/gid syscall entries. + * linux/sh/syscallent.h: Replace printargs with real syscall + parsers in *chown32 and [gs]et*[gu]id32 syscall entries. + * linux/sh64/syscallent.h: Likewise. + + s390: fix uid/gid syscall entries. + * linux/s390/syscallent.h: Add "32" suffix to names of *chown32 + and [gs]et*[gu]id32 syscalls #198..216. + + sparc: fix uid/gid syscall entries. + * linux/sparc/syscallent.h: Add "32" suffix to names + of [gs]etres[gu]id32 syscalls #108..112. + Fix entry for syscall #112 from setresgid32 to setregid32. + +2014-12-15 Dmitry V. Levin + + chown.c: split into separate files. + This will make further uid/gid fixes simpler. + + * fchownat.c: New file. + * chown.c (sys_fchownat: Move to fchownat.c. + (sys_chown, sys_fchown): Move to uid.c. + * Makefile.am (strace_SOURCES): Remove chown.c, add fchownat.c. + +2014-12-15 Dmitry V. Levin + + util.c: move printuid to uid.c. + This will make further uid/gid fixes simpler. + + * util.c (printuid): Move + * uid.c: ... here. + +2014-12-15 Dmitry V. Levin + + tests/uid.awk: rewrite in a more maintainable style. + Since the test is virtually a FSM, rewrite it as a FSM. + +2014-12-14 Dmitry V. Levin + + printuid: fix uid_t decoding on 64-bit architectures. + It was not a good idea to treat uid_t as a long int type because + the latter is twice larger than uid_t on 64-bit architectures. + + * defs.h (printuid): Change uid argument type from "unsigned long" + to "unsigned int". + * util.c (printuid): Likewise. When uid equals to -1, print "-1". + * tests/uid.awk: New file. + * tests/uid.c: New file. + * tests/uid32.c: Likewise. + * tests/uid.test: New test. + * tests/uid32.test: Likewise. + * tests/Makefile.am (CHECK_PROGRAMS): Add uid and uid32. + (TESTS): Add uid.test and uid32.test. + (EXTRA_DIST): Add uid.awk. + * tests/.gitignore: Add uid and uid32. + +2014-12-13 Dmitry V. Levin + + Update PTRACE_* constants. + * xlat/ptrace_cmds.in: Add PTRACE_PEEKSIGINFO, PTRACE_GETSIGMASK, + and PTRACE_SETSIGMASK. + + Update SWAP_FLAG_* constants. + * swapon.c: Ensure that SWAP_FLAG_DISCARD_ONCE and + SWAP_FLAG_DISCARD_PAGES are defined. + * xlat/swap_flags.in: Add SWAP_FLAG_DISCARD_ONCE and + SWAP_FLAG_DISCARD_PAGES. + +2014-12-11 Dmitry V. Levin + + Update SCHED_* constants. + * xlat/schedulers.in: Add SCHED_BATCH, SCHED_ISO, SCHED_IDLE, and + SCHED_DEADLINE. + + Update prctl PR_* constants. + * xlat/prctl_options.in: Add PR_SET_THP_DISABLE, PR_GET_THP_DISABLE, + PR_MPX_ENABLE_MANAGEMENT, and PR_MPX_DISABLE_MANAGEMENT. + +2014-12-11 Dmitry V. Levin + + Always compile sys_prctl parser. + Since sys_prctl is referenced by syscallent files unconditionally, + conditional compilation of sys_prctl depending on prctl availability is + pointless. + + * prctl.c (unalignctl_string, sys_prctl): Compile unconditionally. + +2014-12-11 Dmitry V. Levin + + process.c: split struct_user_offsets into architecture-specific include files + * Makefile.am (EXTRA_DIST): Add linux/alpha/userent.h, + linux/arm/userent.h, linux/avr32/userent.h, linux/bfin/userent.h, + linux/crisv10/userent.h, linux/crisv32/userent.h, + linux/i386/userent.h, linux/i386/userent0.h, linux/ia64/userent.h, + linux/m68k/userent.h, linux/microblaze/userent.h, + linux/mips/userent.h, linux/or1k/userent.h, linux/powerpc/userent.h, + linux/s390/userent.h, linux/s390/userent0.h, linux/s390/userent1.h, + linux/s390x/userent.h, linux/sh/userent.h, linux/sh/userent0.h, + linux/sh64/userent.h, linux/sparc/userent.h, linux/sparc64/userent.h, + linux/tile/userent.h, linux/userent.h, linux/userent0.h, + linux/x32/userent.h, linux/x86_64/userent.h, and + linux/xtensa/userent.h. + * process.c (struct_user_offsets): Split into architecture-specific + include files, inculde userent.h. + + process.c: include less headers. + * process.c: Do not include and . + Reorder inclusion of xlat header files. + + Unexport struct_user_offsets. + * defs.h (struct_user_offsets): Remove. + * process.c (struct_user_offsets): Make static. + +2014-12-11 Dmitry V. Levin + + process.c: introduce XLAT_UOFF macro. + Introduce XLAT_UOFF macro and use it to automatically transform + struct_user_offsets array into a more readable and compact form. + + for n in $(sed -n 's/^[[:space:]]*{[[:space:]]*uoff(\([a-z_0-9]\+\)),.*/\1/p' process.c |sort -u); do + sed -i 's/^\([[:space:]]*\){[[:space:]]*uoff('"$n"'),[[:space:]]*"offsetof(struct user,[[:space:]]*'"$n"')"[[:space:]]*},$/\1XLAT_UOFF('"$n"'),/' process.c + done + + * process.c (XLAT_UOFF): New macro. + (struct_user_offsets): Use it. + +2014-12-11 Dmitry V. Levin + + process.c: move sethostname and gethostname parsers to a separate file. + * hostname.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_sethostname, sys_gethostname): Move to hostname.c. + + process.c: move exit parser to a separate file. + * exit.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_exit): Move to exit.c. + + process.c: move clone, setns, unshare, and fork parsers to a separate file + * clone.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c: Move sys_clone, sys_setns, sys_unshare, sys_fork, and + related code to clone.c. + + process.c: move get*uid and set*uid parsers to a separate file. + * uid.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_getuid, sys_setfsuid, sys_setuid, sys_getresuid, + sys_setreuid, sys_setresuid): Move to uid.c. + + process.c: move getgroups* and setgroups* parsers to a separate file. + * groups.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c: Move sys_setgroups, sys_getgroups, sys_setgroups32, + sys_getgroups32, and related code to groups.c. + + process.c: move execve and execv parsers to a separate file. + * execve.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c: Move sys_execve, sys_execv, and related code to execve.c. + + process.c: move waitpid, wait4, osf_wait4, and waitid parsers to a separate file + * wait.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c: Move sys_waitpid, sys_wait4, sys_osf_wait4, sys_waitid and + related code to wait.c. + + process.c: move uname parser to a separate file. + * uname.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_uname): Move to uname.c. + + process.c: move futex parser to a separate file. + * futex.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c: Move sys_futex and related code to futex.c. + + process.c: move get_robust_list parser to a separate file. + * get_robust_list.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_get_robust_list): Move to get_robust_list.c. + + process.c: move sched_* parsers to a separate file. + * sched.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c: Move sys_sched_getscheduler, sys_sched_setscheduler, + sys_sched_getparam, sys_sched_setparam, sys_sched_get_priority_min, + sys_sched_rr_get_interval, and related code to sched.c. + + process.c: move sched_setaffinity and sched_getaffinity parsers to a separate file + * affinity.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_sched_setaffinity, sys_sched_getaffinity): Move + to affinity.c. + + process.c: move prctl and arch_prctl parsers to a separate file. + * prctl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c: Move sys_prctl, sys_arch_prctl, and related code to prctl.c. + + process.c: move getcpu parser to a separate file. + * getcpu.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_getcpu): Move to getcpu.c. + + process.c: move process_vm_readv and process_vm_writev parsers to a separate file + * process_vm.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * process.c (sys_process_vm_readv, sys_process_vm_writev): Move + to process_vm.c. + + Implement decoding of fallocate FALLOC_FL_* flags. + * xlat/falloc_flags.in: New file. + * configure.ac (AC_CHECK_HEADERS): Add linux/falloc.h. + * fallocate.c [HAVE_LINUX_FALLOC_H]: Include . + Include xlat/falloc_flags.h. + (sys_fallocate): Decode flags. + + Fix decoding of renameat2 RENAME_* flags. + * renameat.c: Include where RENAME_NOREPLACE, + RENAME_EXCHANGE, and RENAME_WHITEOUT are usually defined. + + file.c: move open, openat, and creat parsers to a separate file. + * open.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_open, sys_openat, sys_creat, and related code + to open.c. + + file.c: move access and faccessat parsers to a separate file. + * access.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_access, sys_faccessat and related code to access.c. + + file.c: move umask parser to a separate file. + * umask.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_umask): Move to umask.c. + + file.c: move lseek and llseek parsers to a separate file. + * lseek.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_lseek, sys_llseek, and related code to lseek.c. + + file.c: move readahead parser to a separate file. + * readahead.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_readahead): Move to readahead.c. + + file.c: move truncate, truncate64, ftruncate, and ftruncate64 parsers to a separate file + * truncate.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_truncate, sys_truncate64, sys_ftruncate, sys_ftruncate64): + Move to truncate.c. + + file.c: move chdir parser to a separate file. + * chdir.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_chdir): Move to chdir.c. + + file.c: move link, linkat, unlinkat, and symlinkat parsers to a separate file + * link.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_link, sys_linkat, sys_unlinkat, sys_symlinkat, and + related code to link.c. + + file.c: move readlink and readlinkat parsers to a separate file. + * readlink.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (decode_readlink, sys_readlink, sys_readlinkat): Move + to readlink.c. + + file.c: move renameat and renameat2 parsers to a separate file. + * renameat.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_renameat, sys_renameat2, and related code + to renameat.c. + + file.c: move chown, fchown, and fchownat parsers to a separate file. + * chown.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_chown, sys_fchownat, sys_fchown): Move to chown.c. + + Export at_flags. + * defs.h (at_flags): New prototype. + + file.c: move chmod, fchmod, and fchmodat parsers to a separate file. + * chmod.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_chmod, sys_fchmodat, sys_fchmod): Move to chmod.c. + + file.c: move utimes, futimesat, utimensat, and osf_utimes parsers to a separate file + * utimes.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (decode_utimes, sys_utimes, sys_futimesat, sys_utimensat, + sys_osf_utimes): Move to utimes.c. + + file.c: move utime parser to a separate file. + * utime.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_utime): Move to utime.c. + + Export sprinttime. + * defs.h (sprinttime): New prototype. + * file.c (sprinttime): Make global and move to util.c. + + file.c: move mknod, mknodat, and xmknod parsers to a separate file. + * mknod.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_mknod, sys_mknodat, sys_xmknod, and related code + to mknod.c. + + file.c: export sprintmode and move it to a separate file. + * printmode.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (sprintmode): New prototype. + * file.c (sprintmode): Make global and move to printmode.c. + + file.c: move getcwd parser to a separate file. + * getcwd.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_getcwd): Move to getcwd.c. + + file.c: move *xattr parsers to a separate file. + * xattr.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr, + sys_listxattr, sys_flistxattr, sys_removexattr, sys_fremovexattr, + and related code to xattr.c. + + file.c: move fadvise64 and fadvise64_64 parsers to a separate file. + * fadvise.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_fadvise64, sys_fadvise64_64, and related code + to fadvise.c. + + file.c: move sync_file_range and sync_file_range2 parsers to a separate file + * sync_file_range.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_sync_file_range, sys_sync_file_range2, and related + code to sync_file_range.c. + + file.c: move fallocate parser to a separate file. + * fallocate.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sys_fallocate): Move to fallocate.c. + + file.c: move swapon parser to a separate file. + * swapon.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c: Move sys_swapon and related code to swapon.c. + +2014-12-06 Dmitry V. Levin + + Implement full decoding of 64-bit capabilities. + Unlike v1 capabilities which are 32-bit, v2 and v3 are 64-bit, but + before this change only lower 32 capability bits were decoded for + v2 and v3. + + * xlat/capabilities1.in: New file. + * capability.c: Define v2/v3 CAP_* constants. + Include xlat/capabilities1.h. + (get_cap_header): New function. + (print_cap_header): Update to use get_cap_header result. + (print_cap_data): Decoder higher capability bits for v2 and v3. + (sys_capget, sys_capset): Use get_cap_header, update print_cap_header + and print_cap_data calls. + * tests/caps.c: New file. + * tests/caps.awk: New file. + * tests/caps.test: New test. + * tests/Makefile.am (CHECK_PROGRAMS): Add caps. + (TESTS): Add caps.test. + (EXTRA_DIST): Add caps.awk. + +2014-12-06 Dmitry V. Levin + + Make parsers of capget and capset syscalls self-contained. + Various versions of used to require different + workarounds to avoid conflicts with types defined by libc headers. + Define all required types and constants locally to fix this issue. + + * configure.ac (AC_CHECK_HEADERS): Remove linux/capability.h. + * capability.c: Do not include , remove workarounds + for problematic versions of file. + Define CAP_* and _LINUX_CAPABILITY_VERSION_* constants as enums. + (struct __user_cap_header_struct, struct __user_cap_data_struct): Define. + * xlat/cap_version.in: Add #unconditional. + * xlat/capabilities.in: Likewise. + +2014-12-04 Dmitry V. Levin + + Remove system.c. + All disjoint parts of system.c have been moved to separate files. + + * system.c: Remove. + * Makefile.am (strace_SOURCES): Remove it. + +2014-12-04 Dmitry V. Levin + + Move mount parser to a separate file. + * mount.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Move sys_mount and related code to mount.c. + + Move umount2 parser to a separate file. + * umount.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Move sys_umount2 and related code to umount.c. + + Move personality parser to a separate file. + * personality.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Move sys_personality and related code to personality.c. + + Move syslog parser to a separate file. + * syslog.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Move sys_syslog and related code to syslog.c. + + Move cacheflush parser to a separate file. + * cacheflush.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Move inclusion of to cacheflush.c. + [M68K, BFIN, SH]: Move to cacheflush.c. + + bfin: move sram_alloc parser to a separate file. + * sram_alloc.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c [BFIN]: Move sys_sram_alloc and related code to sram_alloc.c. + + Move capget and capset parsers to a separate file. + * capability.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Move inclusion of headers and macro definitions related + to capget and capset decoding to capability.c. + (print_cap_header, print_cap_data, sys_capget, sys_capset): Move + to capability.c. + +2014-12-03 Dmitry V. Levin + + Move sysctl parser to a separate file. + * sysctl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Move sys_sysctl and related code to sysctl.c. + + mips: move sysmips parser to a separate file. + * sysmips.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c: Fix typo in the check for . + Move inclusions of and to sysmips.c. + [MIPS]: Likewise. + + or1k: move or1k_atomic parser to a separate file. + * or1k_atomic.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * system.c [OR1K]: Move to or1k_atomic.c. + +2014-12-02 Dmitry V. Levin + + Alias sys_setdomainname to sys_sethostname. + Since parsers for setdomainname and sethostname syscalls are identical, + replace sys_setdomainname with an alias to sys_sethostname. + + * linux/dummy.h (sys_setdomainname): Alias to sys_sethostname. + * linux/syscall.h (sys_setdomainname): Remove. + * process.c (sys_setdomainname): Remove. + +2014-12-02 Dmitry V. Levin + + Alias sys_getpeername to sys_getsockname. + Since parsers for getpeername and getsockname syscalls are identical, + replace sys_getpeername with an alias to sys_getsockname. + + * linux/dummy.h (sys_getpeername): Alias to sys_getsockname. + * linux/syscall.h (sys_getpeername): Remove. + * net.c (sys_getpeername): Remove. + +2014-12-02 Dmitry V. Levin + + Alias sys_stime to sys_time. + Since parsers for stime and time syscalls are identical, + replace sys_stime with an alias to sys_time. + + * linux/dummy.h (sys_stime): Alias to sys_time. + * linux/syscall.h (sys_stime): Remove. + * time.c (sys_stime): Remove. + +2014-12-02 Dmitry V. Levin + + Remove unused sys_mctl. + Starting with commit v4.6-240-g5afdf12, nobody compiles this + non-Linux code. + + * mem.c [MC_SYNC]: Remove. + * xlat/mctl_funcs.in: Remove. + * xlat/mctl_lockas.in: Remove. + +2014-12-01 Dmitry V. Levin + + Alias sys_mkdir and sys_mkdirat to sys_chmod and sys_fchmodat. + Special parsers for mkdir and mkdirat are redundant because + sys_chmod and sys_fchmodat implement the same decoding. + + * file.c (decode_mkdir, sys_mkdir, sys_mkdirat): Remove. + * linux/dummy.h (sys_mkdir): Alias to sys_chmod. + (sys_mkdirat): Alias to sys_fchmodat. + * linux/syscall.h (sys_mkdir, sys_mkdirat): Remove. + * pathtrace.c (pathtrace_match): Do not check for sys_mkdirat. + +2014-12-01 Dmitry V. Levin + + Remove unused based code. + Starting with commit v4.6-240-g5afdf12, nobody compiles this + non-Linux code. + + * configure.ac (AC_CHECK_HEADERS): Remove sys/acl.h. + * file.c [HAVE_SYS_ACL_H]: Remove. + * xlat/aclcmds.in: Remove. + +2014-12-01 Dmitry V. Levin + + Remove unused based code. + Starting with commit v4.6-240-g5afdf12, nobody compiles this + non-Linux code. + + * configure.ac (AC_CHECK_HEADERS): Remove sys/asynch.h. + * file.c [HAVE_SYS_ASYNCH_H]: Remove. + +2014-11-27 Masatake YAMATO + + Print protocol name of socket descriptors with -yy option. + For those socket descriptors that have no associated ip:port pairs + (or when this information is not available), -yy option prints + the same information as -y option, e.g. + + $ strace -e sendto -yy ip l > /dev/null + sendto(3, ... + + This change makes -yy output more informative: instead of just + printing "socket", the name of protocol behind the socket descriptor + will be printed, e.g. + + sendto(3, ... + + * configure.ac (AC_CHECK_HEADERS): Add sys/xattr.h. + * tests/net-yy-accept.awk: Update to support protocol names. + * tests/net-yy-connect.awk: Likewise. + * util.c [HAVE_SYS_XATTR_H]: Include . + (getfdproto): New function. + (printfd): Use it. + +2014-11-21 Dmitry V. Levin + + Replace MAXPATHLEN with PATH_MAX. + MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter. + + * strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX. + * util.c (printpathn, printpath): Likewise. + +2014-11-21 Mike Frysinger + + 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. + +2014-11-21 Dmitry V. Levin + + Include unconditionally. + Since is standardized by POSIX and is present in all + available versions of glibc, it's safe to assume that any usable + libc implementation provides this header file. + + * configure.ac (AC_CHECK_HEADERS): Remove sys/uio.h. + * io.c: Include unconditionally. + (tprint_iov_upto, tprint_iov, sys_readv, sys_writev, + print_llu_from_low_high_val, sys_preadv, sys_pwritev): Define + unconditionally. + * net.c: Include unconditionally. + * util.c: Include unconditionally. + (dumpiov): Define unconditionally. + +2014-11-21 Dmitry V. Levin + + Consistently use C99 designated initializers in the new netlink code. + * socketutils.c (send_query, receive_responses): Use designated + initializers for sockaddr_nl, nlmsghdr, and inet_diag_req_v2 structures. + * tests/netlink_inet_diag.c (send_query, check_responses): Likewise. + +2014-11-20 Mike Frysinger + + Decode open's O_TMPFILE. + * xlat/open_mode_flags.in: Add O_TMPFILE definition. + +2014-11-11 Helge Deller + + hppa: update error codes and signal numbers. + There are two important changes in here: + + 1. EWOULDBLOCK has been up to kernel 3.14 errorcode #246. Since hppa + folks had problems with EWOULDBLOCK != EAGAIN, this was changed in + kernel 3.14. + + 2. Starting with kernel 3.18, hppa folks changed some signal numbers in + such a way that we end up with SIGRTMIN == 32, which brings hppa in sync + with other linux ports. + + Both were incompatible changes which basically broke hppa ABI, but since + they have been merged into the kernel, we have to follow. + +2014-11-11 Thomas De Schampheleire + + stack trace support: fix check on symbol name presence. + The output format of the stack trace is supposed to be different + depending on whether symbol names are available in the build. + + However, the check only verified the validity of the pointer, not of the + string pointed to (which could be empty). + + This commit fixes the check so that the original output: + + mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000 + > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38] + > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574] + > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c] + > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac] + > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c] + > /bin/busybox(+0x0) [0x62c60] + > /bin/busybox(+0x0) [0x4940] + > /bin/busybox(+0x0) [0x499c] + > /bin/busybox(+0x0) [0x4e08] + > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c] + > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8] + + becomes: + + mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000 + > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38] + > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574] + > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c] + > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac] + > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c] + > /bin/busybox() [0x62c60] + > /bin/busybox() [0x4940] + > /bin/busybox() [0x499c] + > /bin/busybox() [0x4e08] + > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c] + > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8] + + Acked-by: Masatake YAMATO + +2014-11-11 Masatake YAMATO + + tests: add a test for decoding and dumping of recvmmsg/sendmmsg. + * configure (AC_CHECK_FUNCS): Add sendmmsg. + * tests/mmsg.c: New file. + * tests/mmsg.expected: New file. + * tests/mmsg.test: New test. + * tests/.gitignore: Add mmsg. + * tests/Makefile.am (CHECK_PROGRAMS): Add mmsg. + (TESTS): Add mmsg.test. + (EXTRA_DIST): Add mmsg.expected. + +2014-11-11 Masatake YAMATO + + Add functions for dumping iovecs in mmsghdr used in sendmmsg and recvmmsg + This patch is similar to what I did in commit + 02f9f6b386741a52f58e1b31ad4e7fff60781ef8. + That commit was for sendmsg and recvmsg system calls. + This one is for sendmmsg and recvmmsg system calls. + + * defs.h (dumpiov_in_mmsghdr): New declaration. + * net.c (extractmmsghdr): New function derived from printmmsghdr. + (printmmsghdr): Use it. + (dumpiov_in_mmsghdr): New function. + * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_mmsghdr + for recvmmsg and sendmmsg syscalls. + +2014-11-11 Masatake YAMATO + + Use the definition of struct mmsghdr if it is defined in build environment + mmsghrd structure type is defined locally in printmmsghdr function. + + However, more functions will refer the definition in modifications for + supporting "-e write=set" and "-e read=set" option for sendmmsg and + recvmmsg system calls. + + After this change, the system definition of struct mmsghdr will be used + if configure reports it is available, falling back to the old local + definition. + + * configure.ac (AC_CHECK_TYPES): Add struct mmsghdr. + * net.c [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define. + (printmmsghdr): Use previously defined struct mmsghdr. + +2014-11-11 Masatake YAMATO + + Introduce a separate function to copy from msghdr32 to msghdr. + This patch is an initial step for supporting "-e write=set" and + "-e read=set" option for sendmmsg and recvmmsg system calls. + + Coverting a data of msghdr32 to msghdr is needed both for + {send,recv}msg and {send,recv}mmsg to decode parameters. + To share the copying code in both decoders, a separate + function named copy_from_msghdr32 is introduced. + + * net.c [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] + (copy_from_msghdr32): New function. + (extractmsghdr) [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]: Use it. + +2014-11-11 Dmitry V. Levin + + ioctlsort: rewrite build rules using noinst_PROGRAMS. + * linux/ioctlsort.c: Rename to ioctlsort.c + * Makefile.am (EXTRA_DIST): Rename linux/ioctlsort.c to ioctlsort.c. + [MAINTAINER_MODE] (noinst_PROGRAMS): Add ioctlsort. + (ioctlsort_SOURCES): Add ioctlsort.c. + (nodist_ioctlsort_SOURCES): Add ioctls.h and ioctldefs.h. + (CLEANFILES): Add $(nodist_ioctlsort_SOURCES). + (ioctlsort.$(OBJEXT)): Likewise. + (ioctlsort): Remove. + +2014-11-11 Lubomir Rintel + + Makefile.am: look for ioctl definitions in the kernel build tree by default + While most of ioctl-related kernel headers are now exported by kernel's + headers_install, some are still modules_install only. The kernel's + headers installed into /usr/include/ are usually headers_install'ed and + therefore don't contain some internal headers we need. The solution is + to look for modules_install'ed headers for the running kernel, and fall + back to old behavior if they aren't found. + +2014-11-04 Lubomir Rintel + + Dump details for Bluetooth socket operations. + * configure.ac (AC_CHECK_HEADERS): Add bluetooth/bluetooth.h. + * xlat/bt_protocols.in: New file. + * net.c [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include bluetooth + headers. + [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h". + (printsock) [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Dump details + for AF_BLUETOOTH sockets. + (sys_socket) [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Decode + protocol for PF_BLUETOOTH sockets. + +2014-11-04 Philippe De Muyter + + 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 , found at + https://gist.githubusercontent.com/whitequark/1263207/raw/strace-4.6-v4l2-ioctls.patch + - previous work by William Manley , found at + http://marc.info/?l=strace&m=139395588520675 + - forward port, additions and fixes by Philippe De Muyter + + 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. + + Cc: Peter Zotov + Cc: William Manley + +2014-11-04 Dmitry V. Levin + + Update ioctl entries. + * linux/ioctlent.h.in: Regenerate from v3.17 headers. + + Remove ioctl header file names from the executable. + * defs.h (struct ioctlent): Remove "doth" field. + * Makefile.am ($(ioctlent_h)): Remove 1st field. + +2014-11-04 Dmitry V. Levin + + Filter out redundant ioctl entries early. + For two ioctl entries with the same code, if one's name is a prefix + to another's name, keep the entry with a shorter name. Filter out + redundant ioctl entries at ioctlsort stage so that distributed + ioctlent.h.in files will be already filtered. + + * linux/ioctlsort.c (is_not_prefix): New function. + (main): Use it. + * linux/ioctlent-filter.awk: Remove. + * Makefile.am (EXTRA_DIST): Remove linux/ioctlent-filter.awk. + ($(ioctlent_h)): Don't use linux/ioctlent-filter.awk. + +2014-11-03 Dmitry V. Levin + + ioctlent.sh: update the list of directories exported by headers_install. + * linux/ioctlent.sh: Add drm, mtd, rdma, video, and xen directories. + +2014-11-01 Masatake YAMATO + + Add a function for dumping iovec in msghdr used in sendmsg and recvmsg. + Here is an example session: + + $ ./strace -e write=all ip link change dev enp0s25 mtu 1501 > /dev/null + sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"(... + * 40 bytes in buffer 0 + | 00000 28 00 00 00 10 00 05 00 d0 d9 aa 53 00 00 00 00 (..........S.... | + | 00010 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................ | + | 00020 08 00 04 00 dd 05 00 00 ........ | + ... + + $ ./strace -e read=all ip link show > /dev/null + recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"... + * 8192 bytes in buffer 0 + | 00000 34 00 00 00 02 00 00 00 00 00 00 00 ff 23 00 00 4............#.. | + | 00010 ff ff ff ff 20 00 00 00 10 00 05 00 00 00 00 00 .... ........... | + ... + + * defs.h (dumpiov_in_msghdr): New prototype. + * net.c (extractmsghdr): New function derived from printmsghdr. + (printmsghdr): Use extractmsghdr. + (dumpiov_in_msghdr): New function. + * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_msghdr for recvmsg + and sendmsg syscalls. + +2014-10-31 Maarten ter Huurne + + Include regardless of existence. + This fixes compilation with musl libc. + This approach was already used in process.c, so I assume it is safe. + + * signal.c: Move [HAVE_LINUX_PTRACE_H] code out of [HAVE_SYS_REG_H] check. + * syscall.c: Likewise. + * util.c: Likewise. + +2014-10-31 Dmitry V. Levin + + sock: decode SIOCSIFNAME on entering syscall. + * sock.c (sock_ioctl): Handle SIOCSIFNAME on entering syscall. + +2014-10-31 Mike Frysinger + + sock: fix decoding of SIOCSIFNAME. + The decoding of SIOCSIFNAME is incorrect. It does not use + the ifr_index field to look things up, but ifr_newname. + + * sock.c (sock_ioctl): Split out SIOCSIFNAME from SIOCGIFNAME and + display ifr_newname. + +2014-10-31 Mike Frysinger + + sock: fix decoding of struct ifreq.ifr_name. + The ifr name fields of the ifreq structure might not be NUL terminated. + If the user makes an ioctl call where they aren't, then strace ends up + reading random content from its own stack. Limit the printf lengths. + + * sock.c (sock_ioctl): Add explicit length limits to ifr_name printfs. + +2014-10-03 Elliott Hughes + + Don't risk truncating open flags by using mode_t. + On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short) + as their mode_t. The open(2) flags are actually an int, so high ones + like O_CLOEXEC get truncated if you coerce them to mode_t. + + * defs.h (tprint_open_modes, sprint_open_modes): Change argument type + from mode_t to int. + * file.c (tprint_open_modes, sprint_open_modes): Likewise. + +2014-09-29 Dmitry V. Levin + + Enhance sysinfo decoding. + * configure.ac (AC_CHECK_MEMBERS): Check for struct sysinfo.totalhigh, + struct sysinfo.freehigh, and struct sysinfo.mem_unit. + * sysinfo.c (sys_sysinfo): Treat failed umove() call as syserror(). + Print totalhigh, freehigh, and mem_unit members when struct sysinfo + supports them. + + Move sysinfo parser to a separate file. + * sysinfo.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * resource.c (sys_sysinfo): Move to sysinfo.c. + +2014-09-29 Dmitry V. Levin + + Fix build with musl libc. + * resource.c: Include for struct sysinfo definition. + + Reported-by: Steven Honeyman + +2014-09-23 Dmitry V. Levin + + tests: cleanup checks for basic programs. + * tests/init.sh: Check for cat and rm. + * tests/getdents.test: Check for awk. + * tests/ptrace_setoptions.test: Check for grep. + * tests/net-fd.test: Do not check for rm. + * tests/net.test: Likewise. + * tests/scm_rights-fd.test: Likewise. + * tests/stat.test: Likewise. + * tests/uio.test: Likewise. + + tests: add a test for -yy option. + * tests/net-yy.test: New test. + * tests/inet-accept-connect-send-recv.c: New file. + * tests/netlink_inet_diag.c: Likewise. + * tests/net-yy-accept.awk: Likewise. + * tests/net-yy-connect.awk: Likewise. + * tests/.gitignore: Add inet-accept-connect-send-recv, + netlink_inet_diag, *.tmp-*, and *.tmp.*. + * tests/Makefile.am (check_PROGRAMS): Add inet-accept-connect-send-recv + and netlink_inet_diag. + (TESTS): Add net-yy.test. + (EXTRA_DIST): Add net-yy-accept.awk and net-yy-connect.awk. + +2014-09-22 Dmitry V. Levin + + Move statfs related parsers to a separate file. + * statfs.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (sprintfstype, printstatfs, sys_statfs, sys_fstatfs): Move + to statfs.c. + [HAVE_STATFS64] (printstatfs64, printcompat_statfs64, sys_statfs64, + sys_fstatfs64): Likewise. + [ALPHA] (osf_statfs, osf_fstatfs): Likewise. + + fsmagic: sort array by value and use bsearch for faster lookup. + * defs.h (xlat_search): New prototype. + * util.c (xlat_bsearch_compare, xlat_search): New functions. + * file.c (sprintfstype): Use xlat_search for fsmagic lookup. + * xlat/fsmagic.in: Sort by value and mark as not NULL-terminated. + * tests/statfs.c: New file. + * tests/statfs.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add statfs. + (statfs_CFLAGS): Define. + (TESTS): Add statfs.test. + * tests/.gitignore: Add statfs. + +2014-09-21 Dmitry V. Levin + + fsmagic: update from + * xlat/fsmagic.in: Add new constants from . + Reported by Elliott Hughes. + +2014-09-17 Dmitry V. Levin + + Add -yy option: print ip and port associated with socket descriptors. + When two ore more -y options are given, print local and remote ip:port + pairs associated with socket descriptors. This implementation uses + NETLINK_INET_DIAG for sockaddr lookup; it's based on the patch + prepared by Zubin Mithra as a part of his GSoC 2014 strace project. + + * Makefile.am (strace_SOURCES): Add socketutils.c + (EXTRA_DIST): Add linux/inet_diag.h and linux/sock_diag.h. + * defs.h (print_sockaddr_by_inode): New prototype. + * linux/inet_diag.h: New file. + * linux/sock_diag.h: Likewise. + * socketutils.c: Likewise. + * strace.1: Document -yy option. + * strace.c (usage): Likewise. + * util.c (printfd): Use print_sockaddr_by_inode. + +2014-09-17 Vicente Olivert Riera + + sigaction: wrap sa_restorer in #ifdef SA_RESTORER consistently. + Wrap sa_restorer member definitions in #ifdef SA_RESTORER to be + consistent with their use. + If an architecture does not provide sa_restorer members but still + defines SA_RESTORER macro, the latter has to be explicitly undefined. + + This change fixes compilation failures like this one: + signal.c: In function 'decode_old_sigaction': + signal.c:631:21: error: 'struct old_sigaction' has no member named 'sa_restorer' + signal.c: In function 'decode_new_sigaction': + signal.c:1224:21: error: 'struct new_sigaction' has no member named 'sa_restorer' + + * signal.c (struct old_sigaction, struct old_sigaction32, + struct new_sigaction, struct new_sigaction32): + Wrap sa_restorer member in #ifdef SA_RESTORER. + (decode_old_sigaction, decode_new_sigaction): + Wrap use of sa32.sa_restorer in #ifdef SA_RESTORER. + +2014-09-17 Dmitry V. Levin + + 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. + +2014-09-11 Dmitry V. Levin + + Move dirent related parsers to a separate file. + * dirent.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * file.c (print_old_dirent, sys_readdir, sys_getdents, sys_getdents64): + Move to dirent.c. + + getdents, getdents64: fix potential out-of-bounds read issues. + * file.c (sys_getdents): Check for invalid d_reclen. + Avoid reading from uninitialized memory. + (sys_getdents64): Likewise. + * tests/getdents.awk: New file. + * tests/getdents.test: New test. + * tests/Makefile.am (TESTS): Add it. + (EXTRA_DIST): Add getdents.awk. + +2014-09-10 Dmitry V. Levin + + tprint_sock_type: remove unused parameter. + * net.c (tprint_sock_type): Remove unused parameter 'tcp'. + (sys_socket, sys_socketpair): Update callers. + + printsock: fix decoding of unrecognized AF_PACKET packet types. + * net.c (printsock): Fix fallback string for AF_PACKET packet types. + +2014-09-09 Dmitry V. Levin + + decode_select: fix potential use of an uninitialized variable. + A pointer to fd_set was used uninitialized when nfds == 0. + + * desc.c (decode_select): Initialize fds. + + Reported-by: Zubin Mithra + +2014-09-08 Dmitry V. Levin + + Use external libaio.h. + Stop using an outdated partial copy of libaio.h, switch back to external + libaio.h from libaio. + This partially reverts commit 2df03c494eb3c36c4178eba35c374831031d1a58. + + * aio.c: Drop a partial copy of libaio.h, include instead. + (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS. + (sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and + HAVE_DECL_IO_CMD_PWRITEV. + * configure.ac: Check for libaio.h and declaration it provides. + +2014-08-19 Dmitry V. Levin + + maint: post-release administrivia. + * NEWS: Add header line for next release. + 2014-08-15 Dmitry V. Levin Prepare for 4.9 release. @@ -56,6 +23776,8 @@ * Makefile.am ($(srcdir)/CREDITS): Change {...} to (...). +2014-08-14 Mike Frysinger + ia64: add missing syscalls. When the preadv/pwritev syscalls were added, the ones before it in the ia64 list were missed, so all the syscalls there and later were not in @@ -66,6 +23788,8 @@ * linux/ia64/syscallent.h: Add syscalls 1310 through 1318. +2014-08-14 Mike Frysinger + ia64: fix sigaction decoding. Looks like ia64 doesn't have sa_restorer either, yet still defines SA_RESTORER. Deploy the same trick that HPPA is using to make the @@ -100,11 +23824,15 @@ (main): Check for HAVE_PREADV and HAVE_PWRITEV. * tests/uio.test: Check exit status of uio helper. +2014-08-11 Mike Frysinger + tests: ignore *.tmp files. The tests like to generate random .tmp files, so ignore them. * tests/.gitignore: Add *.tmp. +2014-08-11 Mike Frysinger + tests: fix shell errors in detach tests. The current detach test code does: set -e @@ -130,6 +23858,8 @@ * tests/detach-sleeping.test (cleanup): Likewise. * tests/detach-stopped.test (cleanup): Likewise. +2014-08-11 Mike Frysinger + set_ptracer_any: add a little documentation. This way I don't have to keep reading up on these options and wondering why the code isn't aborting when the call fails. @@ -155,12 +23885,16 @@ * tests/sigaction.awk: Support no SA_RESTORER and swapped args. +2014-08-09 Mike Frysinger + alpha/sparc: fix arg count for rt_sigaction. Both these arches have a rt_sigaction syscall that takes 5 args, not 4. * linux/alpha/syscallent.h (rt_sigaction): Change nargs to 5. * linux/sparc/syscallent.h (rt_sigaction): Change nargs to 5. +2014-08-09 Mike Frysinger + hppa: fix sigaction decoding. Since the rt_sigaction syscall on hppa doesn't have a sa_restorer, do not include it in the kernel struct. @@ -172,6 +23906,8 @@ * signal.c (SA_RESTORER): Undefine when HPPA is defined. (struct new_sigaction): Disable sa_restorer on hppa. +2014-08-09 Mike Frysinger + alpha: fix sigaction decoding. Since the rt_sigaction syscall on alpha doesn't have a sa_restorer, do not include it in the kernel struct. @@ -193,6 +23929,8 @@ * io.c (print_llu_from_low_high_val) [SIZEOF_LONG != SIZEOF_LONG_LONG]: Cast argument to unsigned long before casting it to unsigned long long. +2014-08-07 Dmitry V. Levin + Fix preadv/pwritev offset decoding on bigendian architectures. This partially reverts commit 7845a42b39e59e904d01e75e21f7bc7eb6462560. @@ -248,6 +23986,8 @@ * strace.1: Likewise. * NEWS: Likewise. +2014-06-18 Dmitry V. Levin + tests: robustify -k test. Split stack-fcall.c into several compilation units so that intermediate function calls would not be optimized out by compiler. @@ -265,6 +24005,8 @@ (f1, f2): New functions. * tests/strace-k.test: Update. +2014-06-13 Dmitry V. Levin + unwind: ignore memory mappings that have no PROT_EXEC bit set. * unwind.c (build_mmap_cache): For each memory mapping being scanned, save its PROT_EXEC bit and skip the mapping if it is not set. @@ -312,6 +24054,8 @@ [_LARGEFILE64_SOURCE && HAVE_FOPEN64], otherwise define it to fopen. (build_mmap_cache): Use fopen_for_input instead of fopen. +2014-06-05 Dmitry V. Levin + unwind: fix build on 32-bit architectures. Fix compilation warnings in unwind.c on 32-bit architectures. On some architectures getuid is actually getuid32, so change the test @@ -323,6 +24067,8 @@ * tests/stack-fcall.c (f1): Use getpid instead of getuid. * tests/strace-k.test: Likewise. +2014-06-05 Dmitry V. Levin + tests: robustify -w option test. * tests/count.test: Allow nanosleep to spend a bit less time than 1 second. @@ -360,6 +24106,8 @@ and enable maximum hardening as for programs that handle untrusted data. Patch by Markus . +2014-06-03 Dmitry V. Levin + debian: update control file. * debian/control (strace64): Fix a typo in package description. Patch by Pascal De Vuyst . @@ -373,6 +24121,8 @@ This fixes Debian bugs: #697625, #727018, #742235, #749956. +2014-06-03 Dmitry V. Levin + manpage: minor corrections. $ groff -ww -mandoc -z strace.1 strace.1:65: warning: macro `IX' not defined @@ -393,6 +24143,8 @@ (TESTS): Add strace-k.test. * tests/.gitignore: Add stack-fcall. +2014-05-30 Masatake YAMATO + unwind: move stacktrace capturing and mmap cache invalidating to trace_syscall_entering Instead of handling stacktrace capturing and mmap cache invalidating in sys_* functions, handle them uniformly in trace_syscall_entering using @@ -432,6 +24184,8 @@ The names of macros are suggested by Dmitry Levin. +2014-05-30 Masatake YAMATO + unwind: enable dwarf cache of libunwind. Here is the benchmark of the dwarf cache. @@ -462,6 +24216,8 @@ user 0m5.218s sys 0m16.952s +2014-05-30 Masatake YAMATO + unwind: report expected backtracing error. When a file mmap'ed to the target process is unlink'ed, backtracing the stack would fail. Current implementation reports it as @@ -512,6 +24268,8 @@ and just switch the error message. Inspired by the review comment from Dmitry Levin. +2014-05-30 Masatake YAMATO + unwind: call unwind_tcb_fin before printing detached message. captured stacktrace is printed in unwind_tcb_fin if tcp->queue is not empty. This should happen before printing detached message, so @@ -519,6 +24277,8 @@ This is implicitly suggested by Dmitry Levin in patch review process. +2014-05-30 Masatake YAMATO + unwind: implement automatic mmap cache invalidation. A mmap cache belonging to a tcb was updated when a system call which changed the memory mapping was called. This implementation was assumed @@ -539,6 +24299,8 @@ which don't share the memory mapping, rebuilding mmap cache of a tcb triggered by another tcb's mmap system call is not necessary. +2014-05-30 Masatake YAMATO + unwind: introduce queue_t for capturing stacktrace. This is the second step for splitting capturing from printing. @@ -582,10 +24344,14 @@ In this version they are replaced with asprintf. Suggested by Dmitry Levin. +2014-05-30 Masatake YAMATO + unwind: introduce own debug macro. * unwind.c (DPRINTF): New macro, to be utilized in debugging cache management code. +2014-05-30 Masatake YAMATO + unwind: introduce stacktrace_walker. In current implementation, the stack trace is captured and printed at the same time, in trace_syscall_exiting. This approach cannot @@ -598,6 +24364,8 @@ capturing in trace_syscall_entering and printing in trace_syscall_exiting. +2014-05-30 Masatake YAMATO + unwind: give all exported functions "unwind_" prefix. * unwind.c (init_unwind_addr_space): Rename to unwind_init. (init_libunwind_ui): Rename to unwind_tcb_init. @@ -610,6 +24378,8 @@ * strace.c: Likewise. * syscall.c: Likewise. +2014-05-30 Masatake YAMATO + unwind: delete mmap cache in free_libunwind_ui. free_libunwind_ui is expected to release all unwind related resources attached to tcp. @@ -617,6 +24387,8 @@ * strace.c (droptcb): Move delete_mmap_cache call ... * unwind.c (free_libunwind_ui): ... to here. +2014-05-30 Masatake YAMATO + unwind: make alloc_mmap_cache function local. * defs.h (alloc_mmap_cache): Remove. * unwind.c (alloc_mmap_cache): Add static qualifier. @@ -684,6 +24456,8 @@ Implement #unconditional directive that turns off preprocessor checks. Implement #unterminated directive that turns off adding XLAT_END. +2014-05-30 Dmitry V. Levin + Use bootstrap script consistently. Now that ./xlat/gen.sh has to be run before autoreconf, replace all autoreconf calls with ./bootstrap call. @@ -806,11 +24580,15 @@ Reported-by: Марк Коренберг +2014-04-17 Dmitry V. Levin + Update CLOCK_* constants. * time.c (clocknames): Add CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM, CLOCK_BOOTTIME_ALARM, CLOCK_SGI_CYCLE, and CLOCK_TAI. Fixes RH#1088455. +2014-04-17 Dmitry V. Levin + Fix preadv/pwritev offset decoding. * util.c (printllval): Add align argument. * defs.h (printllval): Update prototype. @@ -947,6 +24725,8 @@ * net.c (sys_socketpair): Remove support for PF_INET and PF_IPX domains, print the protocol argument as is. +2014-03-11 Dmitry V. Levin + printsiginfo: add SIGSYS decoding. * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_syscall. * signal.c (SYS_SECCOMP): Define if not yet defined. @@ -1016,6 +24796,8 @@ [HAVE_SIGACTION] (decode_old_sigaction): Decode 32-bit struct old_sigaction on a 64-bit host. +2014-02-28 Elliott Hughes + Fix decoding of arm struct stat64 by aarch64 strace. aarch64's uapi header files have a struct stat but no struct stat64. To correctly decode a 32-bit process' s struct stat64 we need @@ -1046,6 +24828,8 @@ Reported-by: Elliott Hughes +2014-02-27 Dmitry V. Levin + Rewrite signal mask decoding without sigset_t. The sigset_t provided by libc is not quite convenient. In glibc, sigset_t is an array with space for 1024 bits, which is much @@ -1124,6 +24908,8 @@ tests: tighten sigaction check. * tests/sigaction.awk: Check that input conatins all expected lines. +2014-02-08 Dmitry V. Levin + Fix sigaction reporting on non-x86 architectures. If SA_RESTORER is not defined by libc headers but defined by kernel headers, use the definition provided by kernel headers for proper @@ -1132,6 +24918,8 @@ * signal.c [!SA_RESTORER]: Define to ASM_SA_RESTORER if the latter is defined, regardless of architecure. +2014-02-08 Dmitry V. Levin + Check for SA_RESTORER definition in Kernel header cannot be included from regular code because it conflicts with libc headers, but SA_RESTORER is needed in @@ -1275,6 +25063,8 @@ using the following sed regexp: s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/ +2014-02-05 Dmitry V. Levin + Introduce XLAT macro to ease maintenance of xlat structures. * defs.h (XLAT): New macro. @@ -1370,6 +25160,8 @@ (decode_new_sigaction): New function. (sys_rt_sigaction): Use it. +2014-01-08 Dmitry V. Levin + tests: add a test for rt_sigaction output. Since "struct sigaction" varies between architectures, rt_sigaction decoding sometimes produces incorrect output. This test is expected @@ -1404,6 +25196,8 @@ * syscall.c: Delete PTRACE_PEEKUSR define. * util.c: Likewise. +2013-12-31 Mike Frysinger + Decode the O_PATH flag. * file.c (open_mode_flags): Add O_PATH. @@ -1413,6 +25207,8 @@ * configure.ac (AC_CHECK_FUNCS): Remove _sys_siglist and sys_siglist. (AC_CHECK_DECLS): Likewise. +2013-11-13 Dmitry V. Levin + Assume that provides a valid ptrace prototype. We used to explicitly list architectures where from glibc is known to provide a valid prototype for ptrace, and use a homegrown @@ -1436,6 +25232,8 @@ * defs.h (_LFS64_LARGEFILE): Remove. * strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE. +2013-11-12 Dmitry V. Levin + Define truncate64, ftruncate64, and getdents64 decoders unconditionally. These decoders are referenced by most architectures, there were no undefined references so far because _LFS64_LARGEFILE appears to be @@ -1444,6 +25242,8 @@ * file.c (sys_truncate64, sys_ftruncate64, sys_getdents64): Define unconditionally. +2013-11-12 Dmitry V. Levin + Define printflock64 only if it is referenced by other code. * configure.ac (AC_CHECK_TYPES): Add struct flock64. * desc.c (HAVE_F_SETLK64, HAVE_F_SETLKW64, HAVE_F_GETLK64): New macros. @@ -1452,6 +25252,8 @@ (sys_fcntl): Handle F_FREESP64, F_SETLK64, F_SETLKW64, and F_GETLK64 iff these constants are defined and differ from their non-64bit versions. +2013-11-12 Dmitry V. Levin + Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specific. * configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and PTRACE_POKEUSER. @@ -1460,6 +25262,8 @@ Reported by John Spencer. +2013-11-12 Dmitry V. Levin + Remove unneeded redefinitions of IPPROTO_* macros. IPPROTO_* macros are defined by , no need to redefine them. @@ -1469,6 +25273,8 @@ Reported by John Spencer. +2013-11-12 Dmitry V. Levin + Remove unused AC_OFF_T_IS_LONG_LONG configure check. * configure.ac: Remove AC_OFF_T_IS_LONG_LONG. * m4/long_long.m4: Likewise. @@ -1478,6 +25284,8 @@ struct t_opthdr. * net.c (print_sock_optmgmt): Remove. +2013-11-12 Dmitry V. Levin + Use struct sigcontext instead of struct sigcontext_struct. * configure.ac (AC_CHECK_TYPES): Remove struct sigcontext_struct. * signal.c (sys_sigreturn) [S390 || S390X || POWERPC || ALPHA): Replace @@ -1485,6 +25293,8 @@ Reported by John Spencer. +2013-11-12 Dmitry V. Levin + Use standard names of sched_param structure members. * process.c (sys_sched_setscheduler, sys_sched_getparam, sys_sched_setparam): Use portable struct sched_param member name @@ -1492,6 +25302,8 @@ Reported by John Spencer. +2013-11-12 Dmitry V. Levin + Make SIGEV_THREAD_ID decoding less glibc specific. SIGEV_THREAD_ID decoding requires access to an internal member of struct sigevent. There seems to be no portable way to do it besides @@ -1510,6 +25322,8 @@ * configure.ac (AC_CHECK_MEMBERS): Remove T_conn_res.QUEUE_ptr, T_conn_res.ACCEPTOR_id, dqblk.dqb_curblocks, sigcontext.sc_hi2. +2013-11-11 Dmitry V. Levin + Assume "long long" availability. Most of the code already uses long long types unconditionally. @@ -1517,6 +25331,8 @@ * file.c (printstat64): Remove HAVE_LONG_LONG checks, use %llu format string unconditionally. +2013-11-11 Dmitry V. Levin + Include only if there is no * pathtrace.c: Do not include if is available. * stream.c: Likewise. @@ -1541,6 +25357,8 @@ _without seeing libaio structs_ is hard/more bug prone. A smaller benefit is that we don't need libaio installed. +2013-11-11 Denys Vlasenko + sys_io_submit: simplify iocb_cmd_lookup() helper. This helper returns two values (a string and an enum). The caller prints the string. It's simpler to just print @@ -1551,6 +25369,8 @@ Since function of the helper is different now, it is renamed to tprint_lio_opcode(). +2013-11-11 Denys Vlasenko + sys_io_submit: stop traversing iocb vector after first failure. The program may use a very large nr but supply either outright invalid iocbpp[], or one with far fewer elements than nr. @@ -1589,6 +25409,8 @@ * desc.c (fd_isset): New function. (decode_select): Use it instead of FD_ISSET. +2013-11-05 Dmitry V. Levin + More select decoding fixes. * desc.c (decode_select): Actually print arg[0] as int on entering syscall. When arg[0] is negative, do not attempt to fetch and decode @@ -1711,6 +25533,8 @@ TILE: uc.uc_sigmask is a sigset_t on kernel side, memcpy(&sigm, &uc.uc_sigmask, NSIG / 8) copies all 64 signals. +2013-07-18 Denys Vlasenko + Convert some uses of long_to_sigmask+printsigmask to sprintsigmask_long. This allows to drop long_to_sigmask function, and a whole bunch of sigset_t variables. @@ -1723,6 +25547,8 @@ &i386_regs.esp is a pointer to long, not unsigned long. It needs a cast. +2013-07-18 Denys Vlasenko + Fix sigset printing via print_sigset(). Replace print_sigset() with print_sigset_addr_len(), which takes not only addr, but also len parameter. @@ -1754,6 +25580,8 @@ sigset_size == NSIG / 8 (== sizeof(kernel_sigset_t)), and where it allows word-sized sigset_size ([rt_]sigpending). +2013-07-18 Denys Vlasenko + sys_rt_sigaction: fix sigset copying. In practice, we always copy as many bytes as syscall param says (8, or 16 on mips). However, malicious program can call sigaction @@ -1763,6 +25591,8 @@ Now we always copy NSIG / 8 bytes (which is 8 bytes, or 16 on mips). +2013-07-18 Denys Vlasenko + ARM: remove wrong NSIG = 32 define. ARM in fact has 64 signals (1..64), and NSIG should be 65 (as usual, rememebr that NSIG_libc == NSIG_kernel+1). @@ -1798,6 +25628,8 @@ Group USE_CUSTOM_PRINTF define with other tweakables. No code changes. +2013-07-16 Denys Vlasenko + Improve sigreturn decoding on x86 to show RT signal bits too. This includes decoding of 32-bit sigreturn by 64-bit strace, which previously wasn't done. @@ -1813,6 +25645,8 @@ * configure.ac (powerpc*): Similar to x86, use a runtime test to determine if we are 32 or 64bit. +2013-07-12 Anton Blanchard + powerpc: fix some compiler warnings. Fix a number of differing signedness warnings when building on powerpc. @@ -1884,6 +25718,8 @@ [wait(0x80057f) = 29492] WIFSTOPPED,sig=SIGTRAP,EVENT_STOP (128) ^^ +2013-07-02 Denys Vlasenko + Replace suspicious popen_pid assignment with an obviously correct one. popen_pid = vfork() does work correctly, but for a subtle reason that wrong assignment of 0 happens in the child _first_, @@ -1941,6 +25777,8 @@ * syscall.c (powerpc_getreg, powerpc_getregs_old): New functions. (get_regs): Call powerpc_getregs_old if PTRACE_GETREGS is not supported. +2013-06-26 Anton Blanchard + powerpc: Use PTRACE_GETREGS to fetch all registers. * defs.h: declare ppc_regs and get_regs_error. * signal.c (sys_sigreturn): Use ppc_regs instead of upeek. @@ -1960,6 +25798,8 @@ In -f mode, do not assume that new pid is stopped - handle exits too. +2013-06-26 Denys Vlasenko + Set strace_child only in the right branch. "strace_child = pid" assignment was racing in NOMMU case because of vfork (no way to know which process would win). @@ -1967,6 +25807,8 @@ After this change, strace_child is set to nonzero only in one process after [v]fork. +2013-06-26 Denys Vlasenko + Get rid of TCB_INUSE and TCB_STRACE_CHILD. We can use tcb::pid == 0 as an indicator of free tcb, and we already have strace_child variable which holds @@ -1978,11 +25820,15 @@ Show PTRACE_EVENT_STOP correctly in debug output. +2013-06-21 Denys Vlasenko + Panic a bit less when we see an unknown pid. I stumbeld over this case when I used "exec stace ...". * strace.c (trace): Do not exit if we see an unknown pid in wait4. +2013-06-21 Denys Vlasenko + detach(): Reorganize code. Logic is the same. * strace.c (detach): Use goto's instead of excessive nesting. Drop sigstop_expected and interrupt_done variables. @@ -2003,6 +25849,8 @@ * strace.c (detach): Change return type from int to void. Improve error meesages: show PID, tell exactly which operation fails. +2013-06-20 Denys Vlasenko + Remove workarounds for ancient kernels lacking __WALL. __WALL is available and working at least since 2.4 kernels: 10 years ago. @@ -2011,6 +25859,8 @@ (trace): Remove workarounds for ancient kernels lacking __WALL. Remove redundant double error printout. +2013-06-20 Denys Vlasenko + USE_SEIZE: fix detaching from stopped processes. V3: split SEIZE/!SEIZE code paths to reduce confusion. Extensively comment every possible case. @@ -2065,6 +25915,8 @@ (TESTS): Add detach-sleeping and detach-stopped. * tests/.gitignore: Add set_ptracer_any. +2013-06-18 Dmitry V. Levin + tests: enhance timeout checks. Run each test using a wrapper that does all necessary timeout checks. @@ -2078,6 +25930,8 @@ * tests/stat: Likewise. * tests/strace-f: Likewise. +2013-06-18 Dmitry V. Levin + tests: enable parallel-tests support. * configure.ac (AM_INIT_AUTOMAKE): Add parallel-tests. @@ -2196,6 +26050,8 @@ * strace.c (init) [NOMMU_SYSTEM]: Do not set hide_log_until_execve unless in -D mode. +2013-05-14 Dmitry V. Levin + Make -D mode work when the Yama LSM is enabled. * strace.c [HAVE_PRCTL]: Include sys/prctl.h. (startup_child) [HAVE_PRCTL && PR_SET_PTRACER && PR_SET_PTRACER_ANY]: @@ -2353,6 +26209,8 @@ Suggested by Mike Frysinger and Chris Metcalf. +2013-05-07 Dmitry V. Levin + sparc: remove some unused declarations and macros. * linux/syscall.h [SPARC || SPARC64] (sys_msgsys, sys_semsys, sys_shmsys): Remove declarations. @@ -2379,6 +26237,8 @@ * linux/metag/syscallent.h: Rename llseek syscall to _llseek. +2013-05-07 James Hogan + metag: disable socket and ipc subcall support. The metag architecture also uses dedicated syscalls and doesn't need to multiplex ipc and socket subcalls. @@ -2406,6 +26266,8 @@ * linux/or1k/syscallent.h: Change the number of pread and pwrite arguments to 5. +2013-05-07 Dmitry V. Levin + preadv, pwritev: fix number of syscall arguments. The number of preadv and pwritev arguments depends on architecture and personality. For 64bit and ilp32 it equals to 4, for unaligned 32bit @@ -2427,6 +26289,8 @@ * linux/sh/syscallent.h: Likewise. * linux/xtensa/syscallent.h: Likewise. +2013-05-07 Dmitry V. Levin + ftruncate64, truncate64: fix number of syscall arguments. The number of ftruncate64/truncate64 arguments depends on architecture and personality. For 64bit and ilp32 it equals to 2, for unaligned @@ -2441,6 +26305,8 @@ * linux/xtensa/syscallent.h: Change the number of ftruncate64 and truncate64 arguments to 4. +2013-05-07 Dmitry V. Levin + fallocate: fix number of syscall arguments. The number of fallocate arguments depends on architecture and personality. For 64bit and ilp32 it equals to 4, @@ -2458,6 +26324,8 @@ * linux/x86_64/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Set fallocate handler and flags. +2013-05-07 Dmitry V. Levin + fadvise64, fadvise64_64: fix handlers and number of syscall arguments. The number of fadvise64 arguments depends on architecture and personality. For 64bit and ilp32 it equals to 4, for unaligned @@ -2486,11 +26354,15 @@ change numbers of their arguments to 5 and 6. * linux/x86_64/syscallent.h: Change fadvise64 handler. +2013-05-07 Dmitry V. Levin + mips o32: raise the max number of syscall arguments to 7. On mips o32, fadvise64_64 takes 7 arguments. * defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7. +2013-05-07 Dmitry V. Levin + mips: split syscallent.h. linux/mips/syscallent.h consisted of several parts that had little in common. Split them into separate files to ease maintenance. @@ -2502,6 +26374,8 @@ * linux/mips/syscallent.h: Include them. * Makefile.am (EXTRA_DIST): Add them. +2013-05-07 Dmitry V. Levin + readahead: fix number of syscall arguments. The number of readahead arguments depends on architecture and personality. For 64bit and ilp32 it equals to 3, for unaligned 32bit it @@ -2647,6 +26521,8 @@ s390: fix # of args truncate64/ftruncate64 takes. * linux/s390/syscallent.h: Change nargs to 3 for truncate64/ftruncate64. +2013-05-05 Mike Frysinger + mtd: clamp ubi name strings. Since the length fields with the ubi volnames are signed 16bit values, make sure we clamp that number to the size of the buffer we've allocated @@ -2700,6 +26576,8 @@ (ubi_ioctl): Define. * linux/ubi-user.h: Import from linux 3.8. +2013-05-02 Mike Frysinger + test: add mtd/ubi test helpers. I used these to develop the mtd/ubi ioctl decoders. @@ -2711,6 +26589,8 @@ * test/mtd.c: New file. * test/ubi.c: Likewise. +2013-05-02 Mike Frysinger + test: include headers for used funcs. These funcs use things like wait/write/read/strcmp but sometimes don't include the right header for them. @@ -2791,6 +26671,8 @@ * test/threaded_execve.c [__metag__]: Define clone2 differently to avoid a segfault at runtime. +2013-05-01 James Hogan + test/skodic: make a bit more portable. * test/skodic.c (main): Don't use MAP_FIXED since valid virtual addresses vary between architectures (as far as I can tell the use of MAP_FIXED is @@ -2810,6 +26692,8 @@ * util.c (printllval): Handle S390X define. +2013-05-01 Mike Frysinger + Stop using old AM_CONFIG_HEADER macro. Building with automake-1.13 throws an error: configure.ac:6: error: 'AM_CONFIG_HEADER': this macro is obsolete. @@ -2870,6 +26754,8 @@ * linux/x86_64/ioctlent1.h: Likewise. * linux/x86_64/ioctlent2.h: Likewise. +2013-03-30 Andreas Schwab + AArch64: Fix printing of long long value. * util.c (printllval): Fix printing of long long values on AArch64. @@ -2921,6 +26807,8 @@ [!SH64]: Decode using an open-coded struct with 32-bit d_ino and d_off. (sys_readdir): Update. +2013-03-20 Dmitry V. Levin + Do not use off_t in sendfile decoding. sendfile parser used to decode off_t* parameter as a pointer to host off_t type. With this change, it is decoded as a pointer to target long @@ -3051,6 +26939,8 @@ and we don't link in ctype tables (beneficial for static builds). +2013-03-06 Denys Vlasenko + Makefile: add commented-out tweak to generate link map. Stop using a large static buffer in getfdpath. @@ -3088,6 +26978,8 @@ Remove variable tracing_paths and check in pathtrace_match. +2013-03-05 Denys Vlasenko + Use dynamically-sized selected[] array for -P PATH. While at it, added a small optimization of not remembering the path twice if it happens to be the same. @@ -3096,6 +26988,8 @@ 245111 680 10860 256651 3ea8b strace_old 245075 680 9804 255559 3e647 strace +2013-03-05 Denys Vlasenko + metag,or1k: whitesace style fix. no code changes. Assorted fixes to syscallent.h. @@ -3183,11 +27077,15 @@ * util.c (umoven, umovestr): Cleanup handling of errors coming from process_vm_readv and PTRACE_PEEKDATA. +2013-02-26 Dmitry V. Levin + pathtrace: fix umovestr return code check. * pathtrace.c (upathmatch): Only NUL-terminated strings can be path-matched, so fix the umovestr return code check to filter out unsuitable strings. +2013-02-26 Dmitry V. Levin + Fix compilation errors uncovered by -Werror=enum-compare. This fixes regression introduced by commit v4.7-111-g9cbc15b. @@ -3230,6 +27128,8 @@ Fix test_ptrace_FOO shortcuts on NOMMU to always assume success and _properly_ set all variables. +2013-02-26 Denys Vlasenko + Shorten help text - no need to show deprecated option -F. 2013-02-23 Denys Vlasenko @@ -3244,6 +27144,8 @@ BTW, the new code from prev commit is 5 times faster than old one :) +2013-02-22 Denys Vlasenko + Fix a bug in dumpstr (no null termination). Essentially rewrote dumpstr. This is a 14 year old bug (!). @@ -3260,6 +27162,8 @@ * util.c (dumpstr): Rewrite to be faster and smaller. +2013-02-22 Denys Vlasenko + Eliminate MAX_QUALS, make qualifier array dynamic. MAX_QUALS was 2048, even though most arches used less than 500 entries in it. MAX_QUALS had to be maintained by hand to be higher than syscall @@ -3280,6 +27184,8 @@ 244471 700 12928 258099 3f033 strace.t7/strace 244627 680 10860 256167 3e8a7 strace.t8/strace +2013-02-22 Denys Vlasenko + Create and use struct_sysent and struct_ioctlent typedefs. This is a preparatory mass replace patch with no code changes. @@ -3287,6 +27193,8 @@ which results in compile failures when "struct sysent" string gets mangled into "struct sysent0". +2013-02-22 Denys Vlasenko + Use tcp->qual_flg instead of qual_flags[] in verbose() and abbrev() We have hundreds of uses of these macros. Result is more efficient and 1.1 kbyte shorter code: @@ -3299,6 +27207,8 @@ Remove unused QUAL_FAULT code (was used by non-Linux code only). +2013-02-21 Denys Vlasenko + Use uint8_t for qual_flags[] instead of ints. Resulting bss reduction is ~6kbytes: @@ -3306,6 +27216,8 @@ 245703 700 19072 265475 40d03 strace.t4/strace 245687 700 12928 259315 3f4f3 strace.t5/strace +2013-02-21 Denys Vlasenko + Eliminate many SCNO_IS_VALID checks. By adding tcp->s_ent pointer tot syscall table entry, we can replace sysent[tcp->scno] references by tcp->s_ent. @@ -3355,6 +27267,8 @@ (trace_syscall_exiting): Likewise. * util.c (setbpt): Use tcp->s_ent instead of sysent[tcp->scno]. +2013-02-21 Denys Vlasenko + ARM: make it one-personality arch. ARM in fact _is_ one personality. @@ -3409,8 +27323,12 @@ Make such places conditional on SIZEOF_LONG > 4. +2013-02-19 Denys Vlasenko + Improve comment text. No code changes. +2013-02-19 Denys Vlasenko + Fix NOMMU + daemonized tracer SEGV. pathname[] was getting destroyed, execve of garbage pathname failing, and to top it off, the tracer's stack was also @@ -3421,10 +27339,14 @@ make a malloced copy instead. Explain "NOMMU + -D bug" and how we work around it. +2013-02-19 Denys Vlasenko + Make it possible to to do test builds for NOMMU architectures. And while using it, I discovered that -D doesn't work too well on NOMMU. Added a comment about it. +2013-02-19 Denys Vlasenko + Clean up mmap decoding. Previous code merges too many similar, but different ways of decoding mmap. For example, sys_old_mmap is "params in memory" @@ -3479,6 +27401,8 @@ * mem.c (sys_mmap64): Remove this function. +2013-02-18 Denys Vlasenko + Remove code which supports systems with long long off_t. While looking at mmap mess, did experimenting in order to figure out what gets used when. @@ -3516,6 +27440,8 @@ (sys_lstat): Likewise. * desc.c (printflock): Likewise. +2013-02-18 Denys Vlasenko + Fixes in "new" mmap. * mem.c (sys_mmap): Ensure unsigned expansion of tcp->u_arg[5]. Add page shift of offset for I386. @@ -3545,6 +27471,8 @@ if branch. Explain places where we deliberately use mismatched types for printf formats. +2013-02-17 Denys Vlasenko + Use explicit long type instead of off_t. * file.c (sys_lseek): Use long instead of off_t. @@ -3555,6 +27483,8 @@ * file.c: Make whence_codes[] non-static. Add SEEK_DATA and SEEK_HOLE to them. +2013-02-17 Denys Vlasenko + Remove wrong x32-specific lseek. Testing confirmed what I suspected: x32 lseek uses kernel-sized (i.e. wide) long for offset parameter. @@ -3564,6 +27494,8 @@ * linux/x32/syscallent1.h: Likewise. * test/x32_lseek.c: New file. +2013-02-17 Denys Vlasenko + Fix SEGV in lseek. I found hard way why the code was using "_whence" name. @@ -3571,6 +27503,8 @@ (sys_lseek): Fix printxval() to use whence_codes[]. (sys_lseek32): Likewise. +2013-02-17 Denys Vlasenko + Comment inner workings of sys_[l]lseek. The code doesn't look fully correct to me, but I need to experiment on actual x32 machine before I start "fixing" things. @@ -3581,6 +27515,8 @@ (sys_lseek32): Likewise. (sys_llseek): Likewise. +2013-02-17 Denys Vlasenko + Cosmetic fixes to syscall tables, no code changes. 2013-02-16 Denys Vlasenko @@ -3616,6 +27552,8 @@ it is never true on Tile, and stopped compiling when TCB_WAITEXECVE define was removed for Tile. +2013-02-15 Denys Vlasenko + x86: zero-extend 32-bit args in syscall entry instead of sign-extension. Zero-extension is slightly more common that sign-extension: all pointers are zero-extended, and some other params are unsigned. @@ -3627,12 +27565,16 @@ * syscall.c (get_syscall_args): [X86] Zero-extend 32-bit args instead of sign-extension. +2013-02-15 Denys Vlasenko + Macroize conditional signed widening operation. * defs.h: Define widen_to_long() macro. * signal.c (sys_kill): Use it instead of open-coding it. (sys_tgkill): Use widen_to_long() on pids. * resource.c (decode_rlimit): Formatting fix. +2013-02-15 Denys Vlasenko + A better handling of current_wordsize. On x86_64: text data bss dec hex filename @@ -3649,6 +27591,8 @@ Declare current_wordsize as a variable if needed. (set_personality): Set current_wordsize only if non-constant. +2013-02-15 Denys Vlasenko + Remove unnecessary "return 0" statements. * util.c (change_syscall): Remove dummy "return 0"s. @@ -3714,6 +27658,8 @@ (get_syscall_result): Likewise. (get_error): Likewise. +2013-02-13 Denys Vlasenko + Factor out code to check addr, fetch and print siginfo. * defs.h: Declare new function printsiginfo_at(tcp, addr). * process.c (sys_waitid): Use printsiginfo_at(). @@ -3740,18 +27686,24 @@ with dummy "return 0" and a comment explaining why that is ok for this architecture. +2013-02-12 Denys Vlasenko + Remove stray syscall result reading code on syscall entry for s390. This is a leftover from sysenter/sysexit split. I can't run-test it, but from code inspection it seems to be correct. * syscall.c (get_scno): Remove stray syscall result reading for s390[x]. +2013-02-12 Denys Vlasenko + Deobfuscate definitions of struct user offsets. The maze of ifdefs/ifndefs was scaring new contributors. Format it so that every arch has its own ifdef block. * process.c: Deobfuscate definitions of struct user offsets. +2013-02-12 Denys Vlasenko + Remove hacks for old kernels for architectures which require new kernels * defs.h: Do not define TCB_WAITEXECVE for AARCH64. * util.c (change_syscall): For AARCH64 and X32, replace code @@ -3769,6 +27721,8 @@ read 32-bit struct msghdr and expand it into a native one before using it. (printmmsghdr): Likewise for struct mmsghdr. +2013-02-12 Denys Vlasenko + Fix is_negated_errno() check for X32. X32's return value is 64-bit. We were truncating it to 32-bit long before checking for -errno. @@ -3776,6 +27730,8 @@ * syscall.c (is_negated_errno_x32): New function. (get_error): Use is_negated_errno_x32 for X32 architecture. +2013-02-12 Denys Vlasenko + Remove unused / ambiguously used defines. We sometimes use LINUXSPARC and sometimes (more often) use "defined(SPARC) || defined(SPARC64)". Better to use @@ -3848,6 +27804,8 @@ * signal.c: Remove code which is compiled only for glibc < 2.1. * util.c: Likewise. +2013-02-08 Denys Vlasenko + S390: stop using needlessly static long pc variable. * syscall.c: Remove "static long pc" variable. (get_scno): Use an automatic long variable instead of a static. @@ -3863,6 +27821,8 @@ (sys_sigaction): Use __sa_handler instead of SA_HANDLER macro. (sys_rt_sigaction): Likewise. +2013-02-08 Denys Vlasenko + Optimize AArch64 handling of 32-bit personality. By putting aarch64_regs and arm_regs into a union, register copying is eliminated. @@ -3908,11 +27868,15 @@ (get_error): Likewise. * signal.c (sys_sigreturn): Likewise. +2013-02-06 Denys Vlasenko + Stop needlessly using static variable. * syscall.c: Remove static long psr. (get_scno): Use local psr variable. (get_syscall_result): Likewise. +2013-02-06 Denys Vlasenko + Shortcut tests for fork/exec syscalls. This change should speed up strace by a tiny bit. @@ -4016,6 +27980,8 @@ * syscall.c (getrval2): Do not compile it for architetures where it isn't ever used. +2013-02-05 Denys Vlasenko + Optimize out PTRACE_PEEKUSER with -i. strace -i was fetching PC with a separate PEEKUSER despite having GETREGS data: @@ -4174,6 +28140,8 @@ * linux/aarch64/syscallent.h: New file, based on linux 3.7 version of asm-generic/unistd.h. +2012-10-26 Steve McIntyre + linux: add new errno values for EPROBE_DEFER and EOPENSTALE. New definitions match updates in Linux 3.4 and Linux 3.5 respectively. @@ -4237,6 +28205,8 @@ * syscall.c (trace_syscall_entering): Ignore fflush(3) return value. +2012-09-28 Dmitry V. Levin + Use perror_msg instead of perror. * signal.c (sys_sigreturn): Use perror_msg instead of perror. * strace.c (tprintf, tprints, detach, startup_attach): Likewise. @@ -4330,6 +28300,8 @@ to reading into it - we want to have deterministic result if read fails. +2012-05-16 Denys Vlasenko + Stop using non-standard %Zu and %Zd formats for size_t printing. The documented formats are %zu and %zd, but since our (normally disabled) "fast" printf code doesn't support those too, I convert them to %lu and %ld. @@ -4346,6 +28318,8 @@ * strace.c (trace): Remove outdated comment. +2012-05-15 Denys Vlasenko + Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches On 64bit systems with a single personality, they used to be sizeof(long), which has type "long", not "int", which complicates printf formats. @@ -4428,6 +28402,8 @@ * .mailmap: Merge email addresses. * CREDITS.in: Remove a duplicate name. +2012-05-01 Dmitry V. Levin + tests: raise strace check timeout to 60 seconds. * tests/init.sh (check_timeout): New variable. * tests/ptrace_setoptions: Use it. @@ -4435,6 +28411,8 @@ Reported-by: Mike Frysinger +2012-05-01 Dmitry V. Levin + Update STA_* constants. * time.c (adjtimex_status): Add STA_NANO, STA_MODE, and STA_CLK. * NEWS (Improvements): Mention it. @@ -4450,6 +28428,8 @@ * process.c (sys_uname): Print utsname.domainname when the field is available. +2012-05-01 Dmitry V. Levin + Fix recvmmsg decode: do not show more data than actually returned. This change complements recent fix for recvmsg decoding. @@ -4459,6 +28439,8 @@ (sys_sendmmsg): Call decode_mmsg with msg_len == (unsigned long) -1L. (sys_recvmmsg): Call decode_mmsg with msg_len == 0. +2012-05-01 Dmitry V. Levin + Remove recently introduced use of ULONG_MAX. * io.c: Remove limits.h inclusion. (tprint_iov): Use "(unsigned long) -1L" instead of "ULONG_MAX". @@ -4471,6 +28453,8 @@ Enable printing of uts.domainname in uname syscall. * process.c (sys_uname): Enable printing of uts.domainname +2012-04-28 Denys Vlasenko + Fix printstr's len parameter width. We often pass syscall params and other long-sized values as printstr(len). Truncating them to int may be a bad thing. @@ -4480,6 +28464,8 @@ * util.c (string_quote): Special-case only len==-1, not all len<0. (printstr): Likewise. +2012-04-28 Denys Vlasenko + Fix recvmsg decode: do not show more data than actually returned. I noticed that "hostname -d" talks over netlink and gets 20 bytes of response, but we show entire 1024 bytes of iov. @@ -4503,6 +28489,8 @@ NEWS: clarify & fix typo. +2012-04-27 Mike Frysinger + Cast current_wordsize to an int. On 64bit systems with a single personality, we see: count.c: In function 'call_summary': @@ -4581,6 +28569,8 @@ * strace.c (tprintf): Call strace_vfprintf instead of vfprintf. * vsprintf.c: New file, implements strace_vfprintf. +2012-04-16 Denys Vlasenko + Stop using %h[h]u format specifiers. This is needed for simplified printf, and reduces code size a bit. @@ -4589,6 +28579,8 @@ * desc.c (sys_io_cancel): Likewise. * resource.c (sys_sysinfo): Likewise. +2012-04-16 Denys Vlasenko + Trivial speed optimization. * strace.c (tprints): Use fputs_unlocked instead of fputs. @@ -4597,6 +28589,8 @@ Fix a problem with sys_lseek on x32. * file.c (sys_lseek): Use MIPS-n32 variant also for x32 +2012-04-16 H.J. Lu + Add x32 support to strace. X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with 32bit pointers. At system call level, x32 is also identical to x86-64, @@ -4656,6 +28650,8 @@ * linux/x86_64/signalent2.h: Likewise. * linux/x86_64/syscallent2.h: Likewise. +2012-04-16 H.J. Lu + Restore tcb::u_lrval; fix lseek on MIPS-n32. Linux kernel v3.4 adds x32 support. Both x32 and n32 use 64bit offset for lseek parameter and return value. We need u_lrval to handle it @@ -4717,6 +28713,8 @@ Reported-by: Fr. Br. George +2012-03-26 Dmitry V. Levin + strace-log-merge: fix file suffix calculation. * strace-log-merge: Quote file prefix to fix file suffix calculation. @@ -4783,6 +28781,8 @@ (qual_signal): Open-code isdigit. Remove string copying which was done for no apparent reason. +2012-03-23 Denys Vlasenko + Reorder declarations in defs.h. No code changes. * defs.h: Reorder declarations (such as: keep all printing functions together). @@ -4819,6 +28819,8 @@ (cleanup): Likewise. (trace): Simplify current tcp switching and current column handling. +2012-03-22 Denys Vlasenko + Make threaded execve handling code more reabable and somewhat simpler. * strace.c (droptcb): Remove outfname check in "outfname && followfork >= 2" - with recent changes, followfork >= 2 check guarantees that outfile @@ -4842,6 +28844,8 @@ Slight tweak to qemu_multiarch_testing scripts. +2012-03-21 Denys Vlasenko + Replace reprinting decision logic. After this change, we no longer need to decide when we need to set TCB_REPRINT, and when we don't: it's never needed :) @@ -4858,6 +28862,8 @@ (trace_syscall_exiting): Replace reprinting decision logic. Remove call to printargs(): it is known to just return 0 here. +2012-03-21 Denys Vlasenko + Report some ptrace failures; nuke tcp->ptrace_errno. Report some (not all) ptrace errors, namely, errors on ptrace restart operations. @@ -4920,6 +28926,8 @@ * ioctl.c (compare): Partially revert last change - the new comparison logic was buggy. +2012-03-20 Denys Vlasenko + Simplify search in ioctl table. text data bss dec hex filename 236973 704 18944 256621 3ea6d strace.before @@ -4933,6 +28941,8 @@ Update qemu build script: now tries to upload result back to host. +2012-03-19 Denys Vlasenko + Shrink space needed by undefined syscalls in syscall tables. Undefined syscall looked like this before this change: { 5, 0, printargs, "SYS_53" }, @@ -4954,6 +28964,8 @@ * linux/*/syscallent.h: Replace 'printargs, "SYS_nnn"' with 'NULL, NULL'. +2012-03-19 Denys Vlasenko + Optimize code if we have only one personality. On i386: text data bss dec hex filename @@ -4994,8 +29006,12 @@ * linux/mips/syscallent.h: s/sys_pwrite64/sys_pwrite/ +2012-03-18 Denys Vlasenko + qemu_multiarch_testing/: a directory with scripts for build testing. +2012-03-18 Denys Vlasenko + Make internal_fork and internal_exec static. text data bss dec hex filename 237917 672 18980 257569 3ee21 strace @@ -5007,6 +29023,8 @@ (internal_syscall): Return void instead of int. We were always returning zero, and callers weren't checking it anyway. +2012-03-18 Denys Vlasenko + Remove code which is not used on Linux. Compile tested in qemu on armv4l,armv4tl,armv5l,armv6l,i686, mipsel,mips,x86_64 @@ -5016,6 +29034,8 @@ Remove RVAL_Lfoo constants which signify return of "long" result - they are never used. +2012-03-18 Denys Vlasenko + Remove unused version of sys_lseek. It is buggy: it returns RVAL_LUDECIMAL, which means the return value is in tcp->u_lrval. But tcp->u_lrval is never set @@ -5030,6 +29050,8 @@ Revert "Remove underscores from a few syscall names which have them" This reverts commit 31972d52b1059d8faca1c5f417c2db1a90b868ae. +2012-03-17 Denys Vlasenko + Simplify sys_lseek64 conditional compilation. It looks like sys_lseek64() is never used. For one, it is buggy (always shows 0 return value), and no one complains. @@ -5053,6 +29075,8 @@ if _LFS64_LARGEFILE but !HAVE_LONG_LONG_OFF_T since in this case it is never used. +2012-03-17 Denys Vlasenko + Remove underscores from a few syscall names which have them. Affected names are "_newselect", "_llseek", "_sysctl". I see no apparent reason why they have leading underscores. @@ -5070,6 +29094,8 @@ * linux/*/syscallent.h: Remove underscores from displayed syscall names for _newselect, _llseek, _sysctl. +2012-03-17 Denys Vlasenko + Remove unused struct tcb::baddr field. * defs.h: Remove unused struct tcb::baddr field. @@ -5129,6 +29155,8 @@ (startup_child): Call newoutf(tcp) after successful attach. (trace): Call newoutf(tcp) when we picked up already attached child. +2012-03-16 Denys Vlasenko + Make alloc_tcb and droptcb static. No code changes. The change is trivial. Diff is large because it is confused by function definitions being moved around. @@ -5137,6 +29165,8 @@ * strace.c: Make alloc_tcb and droptcb static. Shuffle functions around to make compiler happy. +2012-03-16 Denys Vlasenko + Tidy up includes and copyright notices, fix indentation. The files not mentioned in changelog below had only copyright notices fixes and indentation fixes. @@ -5181,6 +29211,8 @@ compiler to optimize out unreachable code that is not expected to work on platforms where sizeof(long) <= 4. +2012-03-15 Dmitry V. Levin + tests: robustify again buggy shells. * tests/init.sh (check_strace): Use "${parameter:-word}" shell syntax instead of "${parameter-word}". @@ -5197,6 +29229,8 @@ * syscall.c (decode_subcall): Wrap in SYS_socket_subcall and SYS_ipc_subcall define checks. +2012-03-15 Mike Frysinger + alpha: fix decode of osf_sigprocmask. The alpha sigprocmask syscall is special in that it comes from OSF rather than the style that everyone else uses. @@ -5229,6 +29263,8 @@ Fix array size calculation in previous commit. * pathtrace.c (getfdpath): Fix array size calculation. +2012-03-15 Denys Vlasenko + pathtrace_select() is never called with NULL, remove dead code. pathtrace_select() is only called for -P FILE options, and FILE is never a NULL pointer. @@ -5244,6 +29280,8 @@ (pathmatch): Use strcmp() == 0 idiom for string equality test. (pathtrace_match): Likewise. +2012-03-15 Denys Vlasenko + manpage: remove bugs which are fixed. "A traced process ignores SIGSTOP" - fixed, expected to be in linux-3.4.x. "A traced process which tries to block SIGTRAP will be sent a SIGSTOP @@ -5270,6 +29308,8 @@ Clean up defs.h order. No code changes. * defs.h: Group together related declarations. No code changes. +2012-03-15 Denys Vlasenko + Fix lame kernel version checking code. The code "os_release[0] >= '3'" is not good for any finer-grained checks such as "kernel >= 3.2.1". @@ -5280,6 +29320,8 @@ representation. (init): Convert kernel version check to KERNEL_VERSION. +2012-03-15 Denys Vlasenko + Experimental support for "detach on execve" feature. * strace.c: Define new detach_on_execve, skip_startup_execve bool variables. (init): Set detach_on_execve on -b, set skip_startup_execve if @@ -5307,6 +29349,8 @@ * system.c: Likewise. * util.c: Likewise. +2012-03-15 Denys Vlasenko + Tidy up order of includes; make bool variables explicit. Bool variables are more compact in data and (on x86) on code too: @@ -5344,6 +29388,8 @@ Reported-by: Mike Frysinger +2012-03-15 Dmitry V. Levin + Ensure that SWAP_FLAG_* constants are defined. * file.c: Define those of SWAP_FLAG_* constants which are not yet provided by . @@ -5371,6 +29417,8 @@ (sys_newfstatat, sys_linkat, sys_unlinkat, sys_fchownat, sys_utimensat): Use at_flags. +2012-03-13 Dmitry V. Levin + Fix linkat flags decoding. * file.c (linkat_flags): New xlat structure. (sys_linkat): Decode flags using linkat_flags. @@ -5396,6 +29444,8 @@ Make manpage mention that -p "`pidof PROG`" works. +2012-03-13 Denys Vlasenko + Fix logging for "strace -o FILE -ff test/threaded_execve" test case. Our logic which was deciding whether to print "" thingy wasn't working properly for -ff case. @@ -5432,6 +29482,8 @@ Style fix. No code changes. * strace.c (process_opt_p_list): Style fix. +2012-03-12 Denys Vlasenko + Reduce stack usage by ~0.5k. main() uses ~0.5k of stack for local variables and such. When we enter main tracing loop, most of these variables are no longer used. @@ -5443,6 +29495,8 @@ main is now living here. (main): Call init() to do initialization. +2012-03-12 Denys Vlasenko + Preparatory cosmetic changes for the next commit. * strace.c (tprintf): Move function up in the source file. No code changes. (tprints): Likewise. @@ -5554,6 +29608,8 @@ Trivial simplification. * strace.c (detach): Use waitpid instead of wait4. +2012-03-09 Denys Vlasenko + Don't consider PROG to be our child in "strace -D PROG" case. TCB_STRACE_CHILD is used for the case when "strace PROG" is ^C-ed or something like that. strace should not just exit - it should @@ -5568,6 +29624,8 @@ * strace.c (startup_attach): Don't set TCB_STRACE_CHILD if -D. (trace): Print "" on error regardless of TCB_STRACE_CHILD. +2012-03-09 Denys Vlasenko + Fix the case where we try to detach unattached processes. Before this change: $ strace -D -p1 @@ -5587,6 +29645,8 @@ (cleanup): Check TCB_STRACE_CHILD instead of TCB_ATTACHED. (trace): Likewise. +2012-03-09 Denys Vlasenko + Call PTRACE_CONT with addr=0. * strace.c (trace): Call PTRACE_CONT with addr=0. @@ -5594,6 +29654,8 @@ strace_log_merge: new file. Helper to merge timestamped strace -ff logs. +2012-03-09 Denys Vlasenko + Fix PID prefix printing in "strace -oLOG -ff -p1 -p2 -p3" case. In this case we were printing PIDs to LOG.* files even though it is not necessary. @@ -5606,6 +29668,8 @@ Set print_pid_pfx before entering main tracing loop. (printleader): Use print_pid_pfx to decide whether to print pid prefix. +2012-03-09 Denys Vlasenko + Allow -p PID to take comma or whitespace-separated list of PIDs. * defs.h: Clarify meaning of TCB_ATTACHED. No code changes. * strace.c (process_opt_p_list): New function. @@ -5631,6 +29695,8 @@ (upeek): Use ptrace() instead of do_ptrace(). * defs.h: Remove do_ptrace() declaration. +2012-03-08 Denys Vlasenko + Trivial tweaks to error messages. * strace.c (test_ptrace_setoptions_followfork): Use kill_save_errno instead of kill. @@ -5661,6 +29727,8 @@ * linux/x86_64/syscallent.h: Likewise. * linux/avr32/syscallent.h: Likewise. +2012-02-27 Denys Vlasenko + Assorted trivial optimizations. text data bss dec hex filename 236448 672 19044 256164 3e8a4 strace.before @@ -5680,6 +29748,8 @@ * strace.c (strerror): Use smaller static buffer. (strsignal): Likewise. +2012-02-27 Denys Vlasenko + Alias a few more syscall printing functions. text data bss dec hex filename 237384 672 19044 257100 3ec4c strace.before @@ -5708,6 +29778,8 @@ * syscall.c (printargs_lu): New function. (printargs_ld): New function. +2012-02-27 Denys Vlasenko + Style fixes, no code changes. * desc.c (sys_io_getevents): Indentation fix. * file.c (sys_xstat): Remove space after function name. @@ -5723,6 +29795,8 @@ This change was made by filtering every source code file through "cat -s". +2012-02-25 Dmitry V. Levin + Remove parts of automake machinery which are not needed on Linux. This change is a verbatim part of Dmitry's changes to remove support for non-Linux architectures. @@ -5734,6 +29808,8 @@ * m4/stat.m4: Remove 'ifdef LINUX' check. * m4/statfs.m4: Likewise. +2012-02-25 Dmitry V. Levin + Remove and update documentation. This change is a verbatim part of Dmitry's changes to remove support for non-Linux architectures. @@ -5759,6 +29835,8 @@ * stream.c: Likewise. * file.c: Remove excessive empty lines. +2012-02-25 Denys Vlasenko + Build fixes after non-Linux code removal. * configure.ac: Remove calls to proc-based ptrace checks. * proc.c: Remove, it's empty now. @@ -5798,6 +29876,8 @@ When if directive has them as subexpressions, it can be simplified. Another trivial changes here are fixes for directive indentation. +2012-02-25 Denys Vlasenko + Manual removal of non-Linux source, documentation, etc. Remove non-Linux source directories: freebsd/, svr4/, sunos4/, svr4/. Remove README-freebsd, README-sunos4, README-svr4, m4/procfs.m4. @@ -5811,6 +29891,8 @@ configure.ac: Remove a few tests which make no sense on Linux. Man page: remove non-Linux quirks information. +2012-02-25 Denys Vlasenko + Automated removal of non-Linux code. This change is generated by running every source through the following command: @@ -5876,6 +29958,8 @@ * syscall.c (trace_syscall_entering): Use sys_func to check for ipc and socket subcalls. +2012-02-20 Dmitry V. Levin + Remove initialization of native_scno field for most of syscalls. The native_scno field is not so much used in the code than before. In many cases sys_func is checked instead, and for most of syscall @@ -5920,9 +30004,13 @@ * defs.h (SCNO_IN_RANGE): Also check the sys_func field. +2012-02-06 H.J. Lu + Define RLIM64_INFINITY only if not defined. * resource.c (RLIM64_INFINITY): Define only if it isn't defined. +2012-02-06 H.J. Lu + Cast to long for %l in printf. Cast a value to long for %l in printf to avoid compiler warning on systems where it may be long long. @@ -5933,6 +30021,8 @@ * resource.c (sys_sysinfo): Likewise. * time.c (tprint_timex): Likewise. +2012-02-06 H.J. Lu + Check HAVE_LONG_LONG_OFF_T when printing offset. When HAVE_LONG_LONG_OFF_T is defined, we need to use %llu to print offset. @@ -5940,6 +30030,8 @@ * io.c (sys_sendfile): Check HAVE_LONG_LONG_OFF_T when printing offset. +2012-02-06 H.J. Lu + Define old stat functions only if needed. When HAVE_LONG_LONG_OFF_T is defined, those old stat functions aren't used and strace won't link since they use realprintstat which isn't @@ -5948,6 +30040,8 @@ * file.c (convertoldstat, sys_oldstat, sys_oldfstat, sys_oldlstat): Define only if HAVE_LONG_LONG_OFF_T isn't defined. +2012-02-06 H.J. Lu + Print NULL for zero address in sys_mmap64. * mem.c (sys_mmap64): Print NULL for zero address so that it is consistent with sys_mmap. @@ -5986,9 +30080,13 @@ * strace.c (startup_child): Don't strchr() for ':' twice in a row. * util.c (sprintflags): Exit loop early if possible. +2012-01-29 Denys Vlasenko + Trivial optimization. * strace.c (cleanup): Read 'interrupted' volatile variable only once. +2012-01-29 Denys Vlasenko + Make interactive-ness directly controllable via command line option. Defaults are often ok, but when they are not, people get confused. "Why can't I kill strace?" and "Why strace dies on ^C when I want @@ -6001,6 +30099,8 @@ (main): Parse -I n option, modify signal handling to accomidate new -I 1 and -I 4 modes. +2012-01-29 Denys Vlasenko + Suppress compiler warning. * strace.c (trace): Frame potentially unused label with ifdef/endif. @@ -6008,6 +30108,8 @@ * strace.c (interrupt): Remember signal number. (cleanup): If we exiting due to signal, send that signal to child tracee. +2012-01-29 Denys Vlasenko + Add experimental code to use PTRACE_SEIZE, disabled by default. All new code is predicated on "ifdef USE_SEIZE". If it is not defined, behavior is not changed. @@ -6049,6 +30151,8 @@ * time.c (sys_nanosleep): Fix bug - inverted is_restart_error() check. * syscall.c (is_restart_error): Remove redundant check. +2012-01-28 Denys Vlasenko + Use process_vm_readv instead of PTRACE_PEEKDATA to read data blocks. Currently, we use PTRACE_PEEKDATA to read things like filenames and data passed by I/O syscalls. @@ -6077,6 +30181,8 @@ * linux/x86_64/syscallent.h: Likewise. * linux/powerpc/syscallent.h: Likewise. +2012-01-28 Denys Vlasenko + Fix a case of broken output if last seen syscall was exit. * defs.h: Rename tcp_last to printing_tcp. Explain what it means. Remove printtrailer() function. @@ -6091,6 +30197,8 @@ (trace_syscall_entering): Don't set printing_tcp, printleader call now does it. (trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL". +2012-01-28 Denys Vlasenko + Fix handling of test/threaded_execve.c testcase. Since 3.0, Linux has a way to identify which thread execve'ed. This patch makes use of it in order to properly dispose @@ -6137,6 +30245,8 @@ More robust error check for vasprintf. * strace.c (verror_msg): More robust error check for vasprintf. +2012-01-24 Denys Vlasenko + Slightly more compact handling of argv[] text data bss dec hex filename 238274 672 20484 259430 3f566 strace.before @@ -6144,10 +30254,14 @@ * strace.c (main): Slightly more compact handling of argv[] +2012-01-24 Denys Vlasenko + Trivial optimization. * strace.c: Set default interactive = 1 statically instead of doing it in main(). +2012-01-24 Denys Vlasenko + Allocate -o OUTFILE buffer only if needed. text data bss dec hex filename 238258 668 28676 267602 41552 strace.before @@ -6156,6 +30270,8 @@ * strace.c (main): Allocate -o OUTFILE buffer only if needed: unused buffer in bss is not entirely free. +2012-01-24 Denys Vlasenko + Use single fprintf in verror_msg() This change partially reverts commit 44d0532. @@ -6196,6 +30312,8 @@ it may have no terminating NUL. (sys_sysmips): Likewise. +2012-01-20 Denys Vlasenko + Eliminate code duplication in time printing, reduce a few static buffers text data bss dec hex filename 238454 664 28772 267890 41672 strace.before @@ -6280,6 +30398,8 @@ (sys_signal): Likewise. * strace.c (trace): Remove code which executes if TCB_SIGTRAPPED is set. +2012-01-18 Denys Vlasenko + When we write log, flush output buffers in a few more cases. I observed a case when signal delivery message was buffered by stdio until it was flushed along with the next syscall @@ -6287,6 +30407,8 @@ * strace.c (trace): Flush output buffers in a few more cases. +2012-01-18 Denys Vlasenko + Fix old sigaction display. * signal.c (sys_sigaction): Fix display of sigaction with SIG_DFL/SIG_IGN handlers. @@ -6339,6 +30461,8 @@ * linux/sparc/syscallent.h: Likewise. * linux/tile/syscallent.h: Likewise. +2012-01-10 Denys Vlasenko + Display mask on enter to sigreturn, not on exit. sys_sigreturn() performs ugly manipulations in order to show signal mask which is restored by this syscall: on syscall entry, @@ -6395,6 +30519,8 @@ * strace (trace): Do not detach from tracee which experienced ptrace error. +2012-01-04 Denys Vlasenko + Remove sig parameter from detach() * strace.c (detach): Drop sig parameter - it is zero in all calls. (cleanup): Don't pass sig = 0 to detach() call. @@ -6716,17 +30842,23 @@ * linux/syscall.h (sys_tee, sys_splice, sys_vmsplice): Declare them. * linux/*/syscallent.h: Use them. +2011-10-11 Dmitry V. Levin + Fix epoll_wait and epoll_pwait decoding. * desc.c (epoll_wait_common): Print "maxevents" and "timeout" arguments as integers. Reported-by: Марк Коренберг +2011-10-11 Dmitry V. Levin + Decode EPOLLRDHUP. * desc.c (epollevents): Add EPOLLRDHUP. Reported-by: Марк Коренберг +2011-10-11 Dmitry V. Levin + Remove unreachable code in umoven() and umovestr(). * util.c (umoven, umovestr): Remove unreachable code. @@ -6756,11 +30888,15 @@ Clear TCB_STARTUP and initialize tracee on the very first tracee stop. Clear TCB_IGNORE_ONE_SIGSTOP when SIGSTOP is seen. +2011-09-05 Denys Vlasenko + Get rid of TCB_ATTACH_DONE. * defs.h: Remove TCB_ATTACH_DONE constant. * strace.c (startup_attach): Use TCB_STARTUP instead of TCB_ATTACH_DONE to distinquish attached from not-yet-attached threads. +2011-09-05 Denys Vlasenko + Set TCB_STARTUP only _after_ we attached. This fixes logic in detach() which thinks that TCB_STARTUP means that we are already attached, but did not see SIGSTOP yet. @@ -6789,6 +30925,8 @@ Fix compile failure introduced by last commit. * desc.c (decode_select): Fix double definition of nfds. +2011-09-01 Denys Vlasenko + Roll back "die on malloc failure" behaviour a bit. After recent change, select(2^31-1, NULL, NULL, NULL) would make strace exit. This change caps fdsize so that @@ -6804,6 +30942,8 @@ elements. Don't die on malloc failure. (dumpstr): Don't die on malloc failure. +2011-09-01 Denys Vlasenko + Add stpcpy to autoconf machinery. * configure.ac: Add stpcpy to AC_CHECK_FUNCS. * defs.h: Frame stpcpy with "if !defined HAVE_STPCPY". @@ -6814,11 +30954,15 @@ * desc.c (decode_select): Set tcp->auxstr as late as possible. +2011-09-01 Denys Vlasenko + Reformat setuid-ing code in startup_child() New code does the same as old one, but is more readable (I hope). * strace.c (startup_child): Reformat setuid-ing code. +2011-09-01 Denys Vlasenko + Minor tweaks in startup_child(). Logic isn't changed (but code is) * strace.c (startup_attach): Tweak comment. (startup_child): Move common code out of ifdef. @@ -6869,6 +31013,8 @@ but got no reply. To avoid losing the document, let it live in strace tree for now. +2011-08-31 Denys Vlasenko + Make out-of-memory handling more uniform. This fixes one real bug in dumpstr(). @@ -6892,6 +31038,8 @@ (fixvfork): Likewise. * mem.c (sys_mincore): Don't check free() parameter for NULL. +2011-08-31 Denys Vlasenko + Optimization: eliminate all remaining usages of strcat() After this change, we don't use strcat() anywhere. @@ -6902,6 +31050,8 @@ Also reduce usage of strlen(). * stream.c (decode_poll): Likewise. +2011-08-31 Denys Vlasenko + Optimize string_quote() for speed. * util.c (string_quote): Speed up check for terminating NUL. Replace strintf() with open-coded binary to hex/oct conversions - @@ -6922,6 +31072,8 @@ * syscall.c (syscall_enter): Optimize tcp->u_arg[i] setting from regs.FOO for AVR32. +2011-08-30 Denys Vlasenko + On X86_64 and I386, use PTRACE_GETREGS to fetch all registers. Before this change, registers were read with PTRACE_PEEKUSER ptrace operation, one per register. This is slower than @@ -6942,6 +31094,8 @@ * strace.c: Do not include explicitly, it is already included implicitly by . +2011-08-30 Dmitry V. Levin + Include to get PATH_MAX definition. * pathtrace.c: Include instead of to get PATH_MAX definition. @@ -7001,8 +31155,12 @@ (printleader): Call tabto() with no parameters. (tabto): Use simpler method to print lots of spaces. +2011-08-24 Denys Vlasenko + * syscall.c (sys_indir): Use %ld for printing long, not %u. +2011-08-24 Denys Vlasenko + Opotimize "scno >= 0 && scno < nsyscalls" check. gcc can't figure out on its own that this check can be done with single compare, and does two compares. We can help it by casting @@ -7022,6 +31180,8 @@ (get_error): Likewise. (trace_syscall_exiting): Likewise. +2011-08-24 Denys Vlasenko + Remove scno_good logic in syscall exit. * syscall.c (trace_syscall_exiting): Remove scno_good logic, it can't trigger in syscall exit. @@ -7033,6 +31193,8 @@ Group int-sized fields together in struct tcb. * defs.h: Group int-sized fields together in struct tcb. +2011-08-24 Denys Vlasenko + Reorder functions in syscall.c. No code changes. Old order (basically "in no particular order"): dumpio @@ -7079,6 +31241,8 @@ * syscall.c: Reorder functions so that related ones are closer in the source. +2011-08-24 Denys Vlasenko + Rename some functions, delete unused one. No code changes. * defs.h: Rename get_scno_on_sysenter() to get_scno(); delete force_result() declaration. @@ -7087,6 +31251,8 @@ Rename get_scno_on_sysexit() to get_syscall_result(). Delete unused force_result(). +2011-08-24 Denys Vlasenko + Unify per-architecture post-execve SIGTRAP check. Move post-execve SIGTRAP check from get_scno_on_sysenter (multitude of places on many architectures) to a single location @@ -7101,6 +31267,8 @@ (syscall_fixup): Likewise. (trace_syscall_exiting): Likewise. +2011-08-24 Denys Vlasenko + Speed up x86 by avoiding EAX read on syscall entry. on x86, EAX read on syscall entry is not necessary if we know that post-execve SIGTRAP is disabled by PTRACE_O_TRACEEXEC ptrace option. @@ -7113,6 +31281,8 @@ (syscall_fixup): On I386 and X86_64, read eax/rax only on syscall enter and only if PTRACE_O_TRACEEXEC is not in effect. +2011-08-24 Denys Vlasenko + Do not read syscall no in get_scno_on_sysexit. * syscall.c (get_scno_on_sysexit): Remove scno retrieval code, since we don't save it anyway. This is the first real logic change @@ -7125,6 +31295,8 @@ (get_scno_on_sysexit): Remove "if (entering(tcp))" code, make "if (exiting(tcp))" code unconditional. +2011-08-24 Denys Vlasenko + get_scno is an unholy mess, make it less horrible. Currently, get_scno does *much* more than "get syscall no". It checks for post-execve SIGTRAP. It checks for changes @@ -7175,6 +31347,8 @@ * mem.c (sys_mmap64): Fix a bug where we used tcp->u_args[i] instead of argument values copied from memory. +2011-08-23 Denys Vlasenko + Cache tcp->u_nargs in a local variable for for() loops. Loops of the form "for (i = 0; i < tcp->u_nargs; i++) ..." need to fetch tcp->u_nargs from memory on every iteration @@ -7187,12 +31361,16 @@ as for() loop limit value. (syscall_enter): Likewise. +2011-08-23 Denys Vlasenko + Drop checks for sysent[i].nargs == -1. * defs.h: Declare nsyscalls, nerrnos, nioctlents, nsignals as unsigned. * syscall.c: Define nsyscalls, nerrnos, nioctlents, nsignals as unsigned. (decode_subcall): Drop checks for sysent[i].nargs == -1. (syscall_enter): Likewise. +2011-08-23 Denys Vlasenko + Stop using nargs == -1 in syscallent tables. Usage -1 as argument count in syscallent tables necessitates the check for it, a-la: @@ -7213,12 +31391,16 @@ * syscall.c: Add define MA MAX_ARGS / undef MA around includes of syscallent[N].h. +2011-08-23 Denys Vlasenko + Move trace_syscall_exiting below trace_syscall_entering. No code changes. Syscall enter happens before syscall exit. Having functions in opposite order in the source is confusing. * syscall.c: Move trace_syscall_exiting below trace_syscall_entering. +2011-08-23 Denys Vlasenko + Fix -z display. Before this patch, the following: open("qwerty", O_RDONLY) = -1 ENOENT @@ -7236,6 +31418,8 @@ (trace_syscall_entering): Use common TCB_INSYSCALL setting via "goto ret". +2011-08-23 Denys Vlasenko + Straighten up confused comments/messages about post-execve SIGTRAP handling * defs.h: Explain TCB_INSYSCALL and TCB_WAITEXECVE bits in detail. * strace.c (choose_pfd): Use entering/exiting macros instead of direct check @@ -7307,6 +31491,8 @@ Convert ioctl_next_match() to new-style C function definition. * ioctl.c (ioctl_next_match): Convert to new-style C function definition. +2011-08-23 Denys Vlasenko + 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 @@ -7322,6 +31508,8 @@ * syscall.c: Move above definitions to this file. Make them static const or enums if suitable. +2011-08-23 Denys Vlasenko + Don't return int from set_personality(), no one checks it. * defs.h (set_personality): Change return type to void. * syscall.c (set_personality): Change return type to void. @@ -7358,6 +31546,8 @@ * defs.h (addflags): Change return type from int to void. * util.c (addflags): Change return type from int to void. +2011-08-23 Denys Vlasenko + Set saner MAX_ARGS (6 or 8) for X86_64 and I386. I noticed that tcp->u_args[MAX_ARGS] array is way larger than I'd expect: for all arches except HPPA it has 32 (!) elements. @@ -7397,6 +31587,8 @@ * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. +2011-08-23 Denys Vlasenko + Optimize sys_old_mmap. * mem.c (sys_old_mmap): For Ia64 and 32-bit personality of x86-64, copy narrow parameters from userspace by single umove, not by six @@ -7406,6 +31598,8 @@ differently for no apparent reason. * test/mmap_offset_decode.c: New test program, illustrates FIXME. +2011-08-23 Denys Vlasenko + Untangle ifdef forest in sys_mmap64. No code changes. After careful analysis, it looks like !LINUX and ALPHA pass all seven parameters in registers; and in all other cases @@ -7419,6 +31613,8 @@ * mem.c (sys_mmap64): Rewrite ifdefs in a much simpler way. Add comments about apparent bugs. +2011-08-23 Denys Vlasenko + Style and comment fixes, no code changes. * mem.c: Indent includes to show nesting better. (addtileflags): Fix style of this function definition; @@ -7491,6 +31687,8 @@ (trace): Set ptrace options on new tracees unconditionally, not only when tcp->parent == NULL. +2011-08-17 Denys Vlasenko + Remove TCB_SUSPENDED constant and related code. Since we no longer suspend waitpid'ing tracees, we have only one case when we suspend tracee: when we pick up a new tracee created by clone/fork/vfork. @@ -7526,6 +31724,8 @@ (trace): Do not suspend new child; remove all handling of now impossible TCB_SUSPENDED condition. +2011-08-17 Denys Vlasenko + Do not detach when we think tracee is going to die. Current code plays some ungodly tricks, trying to not detach thread group leader until all threads exit. @@ -7649,6 +31849,8 @@ [SH64]: Make register no array "const". [X86_64]: Make register no array "const", pre-multiply it by 8. +2011-06-23 Denys Vlasenko + Deindent syscall_enter by removing unnecessary braces. No code changes. syscall_enter has many long (>80 columns) lines. It is aggravated by the fact that it has a lot of {} blocks @@ -7661,6 +31863,8 @@ * syscall.c (syscall_enter): Remove unnecessary {} blocks. +2011-06-23 Denys Vlasenko + Remove dead "ifndef CLONE_PTRACE" branch. process.c defines CLONE_PTRACE for Linux, so it can't be undefined. Therefore ifndef CLONE_PTRACE code is dead (since at least 2004). @@ -7669,12 +31873,16 @@ * process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not the code inside) and entire ifndef CLONE_PTRACE/endif block. +2011-06-23 Denys Vlasenko + Add a comment about setbpt. No code changes. * defs.h: Add a comment about setbpt(). Untangle a particularly badly obfuscated bit of code. No logic changes. * util.c (setbpt): Calculate new arg0 in more readable way. +2011-06-23 Denys Vlasenko + Remove TCB_FOLLOWFORK. TCB_FOLLOWFORK flag seems to be unnecessary, because we either follow all [v]forks/clones or don't follow any, therefore global variable @@ -7699,6 +31907,8 @@ Make initial tcb allocation more readable. No logic changes. * strace.c (main): Make initial tcb allocation more readable. +2011-06-23 Denys Vlasenko + Do not allocate tiny cap_user_header/data structures, place them on stack. This allows us to avoid having code to malloc them, and code to check for malloc failure. Resulting code decrease: @@ -7712,6 +31922,8 @@ for them. (sys_capset): Likewise. +2011-06-23 Denys Vlasenko + Use [p]error_msg[_and_die] where appropriate. No logic changes. Resulting size changes: text data bss dec hex filename @@ -7738,6 +31950,8 @@ * syscall.c: Likewise. * time.c: Likewise. +2011-06-22 Denys Vlasenko + Make strace_fopen abort on error. Error from strace_fopen in main results in call to exit(1). Error from strace_fopen in newoutf is propagated to newoutf @@ -7756,6 +31970,8 @@ (startup_attach): Remove error check on newoutf return value. (main): Remove error check on strace_fopen return value. +2011-06-22 Denys Vlasenko + Make set_cloexec_flag abort on error. set_cloexec_flag() may fail only if we pass it a bad fd, such as -1 or non-opened one. If we do, we have a bug @@ -7768,6 +31984,8 @@ (proc_open): Likewise. (proc_poll_open): Likewise. +2011-06-22 Denys Vlasenko + Make strace_popen abort on error. It makes no sense to postpone abort on strace_popen error unti it returns. Moreover, out-of-memory error was exiting @@ -7780,6 +31998,8 @@ abort with good error message instead. (main): Remove NULL check of strace_popen result. +2011-06-22 Denys Vlasenko + Delete fork_tcb() Get rid of fork_tcb() function. It used to do what the comment above it says, but now it doesn't do much: @@ -7800,6 +32020,8 @@ nprocs and tcbtabsize static. (expand_tcbtab): Make it static. +2011-06-22 Denys Vlasenko + Simplify expand_tcbtab and alloc_tcb. Get rid of a few intermediate variables, simplifies a few expressions, and uses error_msg_and_die instead of more verbose @@ -7827,6 +32049,8 @@ Reported-by: Denys Vlasenko +2011-06-21 Dmitry V. Levin + tests: finish ptrace_setoptions_* merge. * tests/Makefile.am (TESTS): Merge ptrace_setoptions_*. * tests/ptrace_setoptions: Check for Linux kernel > 2.6. @@ -7848,6 +32072,8 @@ * strace.c (droptcb): Remove "tcp->parent->nzombies++". (alloc_tcb): Remove "tcp->nzombies = 0". +2011-06-21 Denys Vlasenko + Fix regression introduced by "Properly handle real SIGTRAPs" change. Commit 3454e4b463e6c22c7ea8c5461ef5a077f4650a54 introduced a bug: sometimes, TRACECLONE/TRACE[V]FORK opts were not set. @@ -7938,6 +32164,8 @@ tests: update test for linux kernel version. * tests/ptrace_setoptions_followfork: Check for Linux kernel > 2.6. +2011-06-09 Dmitry V. Levin + Update ptrace_setoptions test. The test have to be adjusted after commit v4.6-5-g3454e4b. @@ -7946,8 +32174,12 @@ * tests/Makefile.am (TESTS): Rename ptrace_setoptions to ptrace_setoptions_followfork. +2011-06-09 Dmitry V. Levin + * strace.c (verror_msg): Rewrite without use of heap memory allocation. +2011-06-09 Dmitry V. Levin + Fix MIPS syscall entries. * linux/mips/syscallent.h: Remove duplicate entries for 4336, 4337, and 4338 syscall numbers. @@ -7984,6 +32216,8 @@ Convert old-style C function definitions to a "modern" form. This does not change any actual code. +2011-06-08 Denys Vlasenko + Fix sigreturn decoding on MIPS. The "return 0" line was accidentally deleted circa 2007, which made sigreturn on MIPS always display "= 0" return @@ -7991,6 +32225,8 @@ * strace.c (sys_sigreturn): Add wrongly deleted "return 0" line +2011-06-08 Denys Vlasenko + Print at least one space between SYSCALL(ARGS) and = RESULT if tracee is killed We already do it in the normal case, but in rare code path where tracee is gone (SIGKILLed?) sometimes we were printing this: @@ -7999,6 +32235,8 @@ * strace.c (printleader): add a space after ")" in " )" +2011-06-08 Denys Vlasenko + Add fflush after printf in test/sigkill_rain.c. Update test/* directory, it seem to be a bit bit-rotted. @@ -8143,6 +32381,8 @@ * linux/bfin/syscallent.h: Add name_to_handle_at, open_by_handle_at, clock_adjtime, and syncfs syscalls. +2011-04-24 Mike Frysinger + linux: add new EHWPOISON errno. * linux/errnoent.h: Change ERRNO_133 to EHWPOISON. @@ -8422,6 +32662,8 @@ * linux/ioctlsort.c (main): Output ioctl codes zero padded. * linux/ioctlent.h: Regenerated. +2011-02-22 Mike Frysinger + Update mount flags to latest linux. * system.c (MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION, MS_STRICTATIME, MS_BORN): Define. @@ -8489,12 +32731,16 @@ linux/sparc64/syscall.h. * linux/sparc/syscall.h, linux/sparc64/syscall.h: Deleted. +2011-02-19 Mike Frysinger + sparc: add new funcs to syscall.h. Sync missing defs from the common syscall.h here. * linux/sparc/syscall.h: Add sys_setfsuid, sys_pread64, and sys_pwrite64 prototypes. +2011-02-19 Mike Frysinger + sparc: punt unused syscall.h.2. I can't find any mention of this header actually being used. Seems to be a really old copy of the common syscall.h. @@ -8717,6 +32963,8 @@ call the new function to handle PTRACE_EVENT_* status, and set PTRACE_SETOPTIONS when we see the initial stop of tracee. +2010-11-30 Wang Chao + Test how PTRACE_SETOPTIONS support works. Currently test fork related options only. Fork a child that uses PTRACE_TRACEME at startup and then does a fork so strace can test @@ -8788,6 +33036,8 @@ * m4/long_long.m4 (AC_OFF_T_IS_LONG_LONG, AC_RLIM_T_IS_LONG_LONG): Convert from AC_RUN_IFELSE to AC_COMPILE_IFELSE. +2010-09-15 Mike Frysinger + Fix long long little endian detection when cross-compiling. The long long endian detection code does an AC_TRY_RUN() and since that doesn't work when cross-compiling, it sets a fallback value. However, @@ -8801,6 +33051,8 @@ * m4/long_long.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Set cross-compiling logic based on ac_cv_c_bigendian. +2010-09-15 Mike Frysinger + Blackfin: decode new syscalls. * linux/bfin/syscallent.h: Add fanotify/prlimit/cacheflush syscalls. * linux/syscall.h: Add sys_cacheflush() decl. @@ -8915,6 +33167,8 @@ * process.c (internal_wait): Processes counted in tcp->nclone_threads are tcp's threads, rather than tcp's children. +2010-08-09 Wang Chao + Forbid using mutually exclusive options -D and -p together. If we use -D and -p option together to trace a multi-thread program, in addition to the main thread, other threads could not be traced even if we @@ -9569,6 +33823,8 @@ (SYS_socket_nsubcalls): Update. * linux/syscall.h: Likewise. +2009-09-01 Paolo Bonzini + Replace x86-64 paccept with accept4. This patch changes the paccept syscall to accept4 for x86-64, since the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826. diff --git a/Makefile.am b/Makefile.am index a30ac1c0..9b00481d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,40 @@ # Automake input for strace. +# +# Copyright (c) 2002-2009 Roland McGrath +# Copyright (c) 2006-2016 Dmitry V. Levin +# Copyright (c) 2008-2015 Mike Frysinger +# Copyright (c) 2015 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -SUBDIRS = tests +if HAVE_M32_RUNTIME +TESTS_M32 = tests-m32 +endif +if HAVE_MX32_RUNTIME +TESTS_MX32 = tests-mx32 +endif +SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32) bin_PROGRAMS = strace man_MANS = strace.1 @@ -12,60 +46,239 @@ ARCH = @arch@ ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = $(WARN_CFLAGS) -AM_CPPFLAGS = -I$(srcdir)/$(OS)/$(ARCH) -I$(srcdir)/$(OS) -I$(builddir)/$(OS) +AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \ + -I$(srcdir)/$(OS)/$(ARCH) \ + -I$(builddir)/$(OS) \ + -I$(srcdir)/$(OS) \ + -I$(builddir) \ + -I$(srcdir) + +AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD) +AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS) include xlat/Makemodule.am +strace_CPPFLAGS = $(AM_CPPFLAGS) +strace_CFLAGS = $(AM_CFLAGS) +strace_LDFLAGS = +strace_LDADD = libstrace.a +noinst_LIBRARIES = libstrace.a + +libstrace_a_CPPFLAGS = $(strace_CPPFLAGS) +libstrace_a_CFLAGS = $(strace_CFLAGS) +libstrace_a_SOURCES = \ + fstatfs.c \ + fstatfs64.c \ + ipc.c \ + socketcall.c \ + statfs.c \ + statfs64.c \ + sync_file_range.c \ + sync_file_range2.c \ + upeek.c \ + upoke.c \ + # end of libstrace_a_SOURCES + strace_SOURCES = \ + access.c \ + affinity.c \ aio.c \ + alpha.c \ bjm.c \ block.c \ + bpf.c \ + btrfs.c \ + cacheflush.c \ + capability.c \ + caps0.h \ + caps1.h \ + chdir.c \ + chmod.c \ + clone.c \ + copy_file_range.c \ count.c \ + defs.h \ desc.c \ + dirent.c \ + dirent64.c \ + dm.c \ + empty.h \ + epoll.c \ + evdev.c \ + eventfd.c \ + execve.c \ + fadvise.c \ + fallocate.c \ fanotify.c \ - file.c \ + fchownat.c \ + fcntl.c \ + fetch_seccomp_fprog.c \ + fetch_struct_flock.c \ + fetch_struct_mmsghdr.c \ + fetch_struct_msghdr.c \ + fetch_struct_stat.c \ + fetch_struct_stat64.c \ + fetch_struct_statfs.c \ + file_handle.c \ + file_ioctl.c \ + fs_x_ioctl.c \ + flock.c \ + flock.h \ + futex.c \ + gcc_compat.h \ + get_robust_list.c \ + getcpu.c \ + getcwd.c \ + getrandom.c \ + hdio.c \ + hostname.c \ inotify.c \ io.c \ ioctl.c \ + ioperm.c \ + iopl.c \ ioprio.c \ - ipc.c \ + ipc_defs.h \ + ipc_msg.c \ + ipc_msgctl.c \ + ipc_sem.c \ + ipc_shm.c \ + ipc_shmctl.c \ + kcmp.c \ + kernel_types.h \ kexec.c \ keyctl.c \ ldt.c \ + link.c \ + linux/asm_stat.h \ + linux/x32/asm_stat.h \ + linux/x86_64/asm_stat.h \ + lookup_dcookie.c \ loop.c \ + lseek.c \ mem.c \ + membarrier.c \ + memfd_create.c \ + mknod.c \ + mmsghdr.c \ + mount.c \ + mpers_type.h \ + mq.c \ + msghdr.c \ + msghdr.h \ mtd.c \ + native_defs.h \ net.c \ + netlink.c \ + nsig.h \ + numa.c \ + oldstat.c \ + open.c \ + or1k_atomic.c \ pathtrace.c \ + perf.c \ + perf_event_struct.h \ + personality.c \ + pkeys.c \ + poll.c \ + prctl.c \ + print_dev_t.c \ + print_mq_attr.c \ + print_msgbuf.c \ + print_sg_req_info.c \ + print_sigevent.c \ + print_statfs.c \ + print_struct_stat.c \ + print_time.c \ + print_timespec.c \ + print_timeval.c \ + print_timex.c \ + printmode.c \ + printrusage.c \ + printsiginfo.c \ + printsiginfo.h \ process.c \ + process_vm.c \ ptp.c \ + ptrace.h \ + qualify.c \ quota.c \ + readahead.c \ + readlink.c \ reboot.c \ + regs.h \ + renameat.c \ resource.c \ + rtc.c \ + sched.c \ scsi.c \ + seccomp.c \ + seccomp_fprog.h \ + sendfile.c \ + sg_io_v3.c \ + sg_io_v4.c \ + sigaltstack.c \ + sigevent.h \ signal.c \ + signalfd.c \ + sigreturn.c \ sock.c \ + sockaddr.c \ + socketutils.c \ + sram_alloc.c \ + stat.c \ + stat.h \ + stat64.c \ + statfs.c \ + statfs.h \ strace.c \ - stream.c \ + swapon.c \ syscall.c \ - system.c \ + sysctl.c \ + sysent.h \ + sysinfo.c \ + syslog.c \ + sysmips.c \ term.c \ time.c \ + times.c \ + truncate.c \ + ubi.c \ + uid.c \ + uid16.c \ + umask.c \ + umount.c \ + uname.c \ + userfaultfd.c \ + ustat.c \ util.c \ - vsprintf.c + utime.c \ + utimes.c \ + v4l2.c \ + wait.c \ + xattr.c \ + xlat.h \ + xmalloc.c \ + # end of strace_SOURCES if USE_LIBUNWIND strace_SOURCES += unwind.c -strace_CPPFLAGS = $(AM_CPPFLAGS) $(libunwind_CPPFLAGS) -strace_LDFLAGS = $(libunwind_LDFLAGS) -strace_LDADD = $(libunwind_LIBS) -else -strace_CPPFLAGS = $(AM_CPPFLAGS) +strace_CPPFLAGS += $(libunwind_CPPFLAGS) +strace_LDFLAGS += $(libunwind_LDFLAGS) +strace_LDADD += $(libunwind_LIBS) endif -noinst_HEADERS = defs.h +@CODE_COVERAGE_RULES@ +CODE_COVERAGE_BRANCH_COVERAGE = 1 +CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \ + --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .) +CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*' +strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS) +strace_CFLAGS += $(CODE_COVERAGE_CFLAGS) +strace_LDADD += $(CODE_COVERAGE_LDFLAGS) + # Enable this to get link map generated -#strace_CFLAGS = $(AM_CFLAGS) -Wl,-Map=strace.mapfile +#strace_LDFLAGS += -Wl,-Map=strace.mapfile EXTRA_DIST = \ $(man_MANS) \ @@ -74,7 +287,6 @@ EXTRA_DIST = \ CREDITS \ ChangeLog \ ChangeLog-CVS \ - README-linux \ README-linux-ptrace \ debian/changelog \ debian/compat \ @@ -91,134 +303,454 @@ EXTRA_DIST = \ debian/strace64.manpages \ debian/watch \ errnoent.sh \ + generate_sen.sh \ + ioctl_iocdef.c \ + ioctlsort.c \ + linux/32/ioctls_inc.h \ + linux/32/ioctls_inc_align16.h \ + linux/32/ioctls_inc_align32.h \ + linux/32/ioctls_inc_align64.h \ + linux/32/syscallent.h \ + linux/64/ioctls_inc.h \ + linux/64/syscallent.h \ + linux/aarch64/arch_regs.c \ + linux/aarch64/arch_regs.h \ + linux/aarch64/arch_sigreturn.c \ linux/aarch64/errnoent1.h \ - linux/aarch64/ioctlent.h.in \ - linux/aarch64/ioctlent1.h \ + linux/aarch64/get_error.c \ + linux/aarch64/get_scno.c \ + linux/aarch64/get_syscall_args.c\ + linux/aarch64/ioctls_arch0.h \ + linux/aarch64/ioctls_arch1.h \ + linux/aarch64/ioctls_inc0.h \ + linux/aarch64/ioctls_inc1.h \ + linux/aarch64/set_error.c \ + linux/aarch64/set_scno.c \ linux/aarch64/signalent1.h \ linux/aarch64/syscallent.h \ linux/aarch64/syscallent1.h \ + linux/alpha/arch_getrval2.c \ + linux/alpha/arch_regs.c \ + linux/alpha/arch_regs.h \ + linux/alpha/arch_sigreturn.c \ linux/alpha/errnoent.h \ - linux/alpha/ioctlent.h.in \ + linux/alpha/get_error.c \ + linux/alpha/get_scno.c \ + linux/alpha/get_syscall_args.c \ + linux/alpha/get_syscall_result.c\ + linux/alpha/ioctls_arch0.h \ + linux/alpha/ioctls_inc0.h \ + linux/alpha/set_error.c \ + linux/alpha/set_scno.c \ linux/alpha/signalent.h \ linux/alpha/syscallent.h \ - linux/arc/ioctlent.h.in \ + linux/alpha/userent.h \ + linux/arc/arch_regs.c \ + linux/arc/get_error.c \ + linux/arc/get_scno.c \ + linux/arc/get_syscall_args.c \ + linux/arc/ioctls_arch0.h \ + linux/arc/ioctls_inc0.h \ + linux/arc/set_error.c \ + linux/arc/set_scno.c \ linux/arc/syscallent.h \ - linux/arm/ioctlent.h.in \ + linux/arch_regs.h \ + linux/arch_sigreturn.c \ + linux/arm/arch_regs.c \ + linux/arm/arch_regs.h \ + linux/arm/arch_sigreturn.c \ + linux/arm/get_error.c \ + linux/arm/get_scno.c \ + linux/arm/get_syscall_args.c \ + linux/arm/ioctls_arch0.h \ + linux/arm/ioctls_inc0.h \ + linux/arm/set_error.c \ + linux/arm/set_scno.c \ linux/arm/syscallent.h \ - linux/avr32/ioctlent.h.in \ + linux/arm/userent.h \ + linux/avr32/arch_regs.c \ + linux/avr32/get_error.c \ + linux/avr32/get_scno.c \ + linux/avr32/get_syscall_args.c \ + linux/avr32/ioctls_arch0.h \ + linux/avr32/ioctls_inc0.h \ + linux/avr32/set_error.c \ + linux/avr32/set_scno.c \ linux/avr32/syscallent.h \ - linux/bfin/ioctlent.h.in \ + linux/avr32/userent.h \ + linux/bfin/arch_regs.c \ + linux/bfin/get_error.c \ + linux/bfin/get_scno.c \ + linux/bfin/get_syscall_args.c \ + linux/bfin/get_syscall_result.c \ + linux/bfin/ioctls_arch0.h \ + linux/bfin/ioctls_inc0.h \ + linux/bfin/set_error.c \ + linux/bfin/set_scno.c \ linux/bfin/syscallent.h \ + linux/bfin/userent.h \ + linux/crisv10/arch_regs.c \ + linux/crisv10/arch_sigreturn.c \ + linux/crisv10/get_error.c \ + linux/crisv10/get_scno.c \ + linux/crisv10/get_syscall_args.c \ + linux/crisv10/get_syscall_result.c \ + linux/crisv10/set_error.c \ + linux/crisv10/set_scno.c \ + linux/crisv10/syscallent.h \ + linux/crisv10/userent.h \ + linux/crisv32/arch_regs.c \ + linux/crisv32/arch_sigreturn.c \ + linux/crisv32/get_error.c \ + linux/crisv32/get_scno.c \ + linux/crisv32/get_syscall_args.c \ + linux/crisv32/get_syscall_result.c \ + linux/crisv32/set_error.c \ + linux/crisv32/set_scno.c \ + linux/crisv32/syscallent.h \ + linux/crisv32/userent.h \ linux/dummy.h \ linux/errnoent.h \ - linux/fanotify.h \ + linux/getregs_old.h \ + linux/hppa/arch_regs.c \ + linux/hppa/arch_regs.h \ linux/hppa/errnoent.h \ - linux/hppa/ioctlent.h.in \ + linux/hppa/get_error.c \ + linux/hppa/get_scno.c \ + linux/hppa/get_syscall_args.c \ + linux/hppa/get_syscall_result.c \ + linux/hppa/ioctls_arch0.h \ + linux/hppa/ioctls_inc0.h \ + linux/hppa/set_error.c \ + linux/hppa/set_scno.c \ linux/hppa/signalent.h \ linux/hppa/syscallent.h \ - linux/i386/ioctlent.h.in \ + linux/i386/arch_regs.c \ + linux/i386/arch_regs.h \ + linux/i386/arch_sigreturn.c \ + linux/i386/get_error.c \ + linux/i386/get_scno.c \ + linux/i386/get_syscall_args.c \ + linux/i386/ioctls_arch0.h \ + linux/i386/ioctls_inc0.h \ + linux/i386/set_error.c \ + linux/i386/set_scno.c \ linux/i386/syscallent.h \ - linux/ia64/ioctlent.h.in \ - linux/ia64/signalent.h \ + linux/i386/userent.h \ + linux/i386/userent0.h \ + linux/ia64/arch_getrval2.c \ + linux/ia64/arch_regs.c \ + linux/ia64/arch_regs.h \ + linux/ia64/arch_sigreturn.c \ + linux/ia64/get_error.c \ + linux/ia64/get_scno.c \ + linux/ia64/get_syscall_args.c \ + linux/ia64/ioctls_arch0.h \ + linux/ia64/ioctls_inc0.h \ + linux/ia64/set_error.c \ + linux/ia64/set_scno.c \ linux/ia64/syscallent.h \ - linux/inotify.h \ - linux/ioctlent-filter.awk \ - linux/ioctlent.h.in \ - linux/ioctlent.sh \ - linux/ioctlsort.c \ - linux/kexec.h \ - linux/keyctl.h \ - linux/m68k/ioctlent.h.in \ + linux/ia64/userent.h \ + linux/inet_diag.h \ + linux/m68k/arch_regs.c \ + linux/m68k/arch_regs.h \ + linux/m68k/arch_sigreturn.c \ + linux/m68k/get_error.c \ + linux/m68k/get_scno.c \ + linux/m68k/get_syscall_args.c \ + linux/m68k/ioctls_arch0.h \ + linux/m68k/ioctls_inc0.h \ + linux/m68k/set_error.c \ + linux/m68k/set_scno.c \ linux/m68k/syscallent.h \ - linux/metag/ioctlent.h.in \ + linux/m68k/userent.h \ + linux/metag/arch_regs.c \ + linux/metag/get_error.c \ + linux/metag/get_scno.c \ + linux/metag/get_syscall_args.c \ + linux/metag/ioctls_arch0.h \ + linux/metag/ioctls_inc0.h \ + linux/metag/set_error.c \ + linux/metag/set_scno.c \ linux/metag/syscallent.h \ - linux/microblaze/ioctlent.h.in \ + linux/microblaze/arch_regs.c \ + linux/microblaze/arch_sigreturn.c \ + linux/microblaze/get_error.c \ + linux/microblaze/get_scno.c \ + linux/microblaze/get_syscall_args.c \ + linux/microblaze/get_syscall_result.c \ + linux/microblaze/ioctls_arch0.h \ + linux/microblaze/ioctls_inc0.h \ + linux/microblaze/set_error.c \ + linux/microblaze/set_scno.c \ linux/microblaze/syscallent.h \ + linux/microblaze/userent.h \ + linux/mips/arch_getrval2.c \ + linux/mips/arch_regs.c \ + linux/mips/arch_regs.h \ + linux/mips/arch_sigreturn.c \ linux/mips/errnoent.h \ - linux/mips/ioctlent.h.in \ - linux/mips/ioctlent.sh \ + linux/mips/genstub.sh \ + linux/mips/get_error.c \ + linux/mips/get_scno.c \ + linux/mips/get_syscall_args.c \ + linux/mips/ioctls_arch0.h \ + linux/mips/ioctls_inc0.h \ + linux/mips/set_error.c \ + linux/mips/set_scno.c \ linux/mips/signalent.h \ linux/mips/syscallent-compat.h \ linux/mips/syscallent-n32.h \ linux/mips/syscallent-n64.h \ linux/mips/syscallent-o32.h \ linux/mips/syscallent.h \ + linux/mips/userent.h \ linux/mtd-abi.h \ - linux/or1k/ioctlent.h.in \ + linux/netlink_diag.h \ + linux/nios2/arch_regs.c \ + linux/nios2/get_error.c \ + linux/nios2/get_scno.c \ + linux/nios2/get_syscall_args.c \ + linux/nios2/ioctls_arch0.h \ + linux/nios2/ioctls_inc0.h \ + linux/nios2/set_error.c \ + linux/nios2/set_scno.c \ + linux/nios2/syscallent.h \ + linux/or1k/arch_regs.c \ + linux/or1k/get_error.c \ + linux/or1k/get_scno.c \ + linux/or1k/get_syscall_args.c \ + linux/or1k/ioctls_arch0.h \ + linux/or1k/ioctls_inc0.h \ + linux/or1k/set_error.c \ + linux/or1k/set_scno.c \ linux/or1k/syscallent.h \ + linux/or1k/userent.h \ linux/personality.h \ - linux/powerpc/errnoent1.h \ - linux/powerpc/ioctlent.h.in \ - linux/powerpc/ioctlent1.h \ - linux/powerpc/signalent1.h \ + linux/powerpc/arch_regs.c \ + linux/powerpc/arch_regs.h \ + linux/powerpc/arch_sigreturn.c \ + linux/powerpc/errnoent.h \ + linux/powerpc/get_error.c \ + linux/powerpc/get_scno.c \ + linux/powerpc/get_syscall_args.c \ + linux/powerpc/getregs_old.c \ + linux/powerpc/getregs_old.h \ + linux/powerpc/ioctls_arch0.h \ + linux/powerpc/ioctls_inc0.h \ + linux/powerpc/set_error.c \ + linux/powerpc/set_scno.c \ linux/powerpc/syscallent.h \ - linux/powerpc/syscallent1.h \ + linux/powerpc/userent.h \ + linux/powerpc64/arch_regs.c \ + linux/powerpc64/arch_regs.h \ + linux/powerpc64/arch_sigreturn.c \ + linux/powerpc64/errnoent.h \ + linux/powerpc64/errnoent1.h \ + linux/powerpc64/get_error.c \ + linux/powerpc64/get_scno.c \ + linux/powerpc64/get_syscall_args.c \ + linux/powerpc64/getregs_old.c \ + linux/powerpc64/getregs_old.h \ + linux/powerpc64/ioctls_arch0.h \ + linux/powerpc64/ioctls_arch1.h \ + linux/powerpc64/ioctls_inc0.h \ + linux/powerpc64/ioctls_inc1.h \ + linux/powerpc64/set_error.c \ + linux/powerpc64/set_scno.c \ + linux/powerpc64/signalent1.h \ + linux/powerpc64/syscallent.h \ + linux/powerpc64/syscallent1.h \ + linux/powerpc64/userent.h \ linux/ptp_clock.h \ - linux/reboot.h \ - linux/s390/ioctlent.h.in \ + linux/riscv/arch_regs.c \ + linux/riscv/errnoent1.h \ + linux/riscv/get_error.c \ + linux/riscv/get_scno.c \ + linux/riscv/get_syscall_args.c \ + linux/riscv/ioctls_arch0.h \ + linux/riscv/ioctls_arch1.h \ + linux/riscv/ioctls_inc0.h \ + linux/riscv/ioctls_inc1.h \ + linux/riscv/set_error.c \ + linux/riscv/set_scno.c \ + linux/riscv/signalent1.h \ + linux/riscv/syscallent.h \ + linux/riscv/syscallent1.h \ + linux/s390/arch_regs.c \ + linux/s390/arch_regs.h \ + linux/s390/arch_sigreturn.c \ + linux/s390/get_error.c \ + linux/s390/get_scno.c \ + linux/s390/get_syscall_args.c \ + linux/s390/ioctls_arch0.h \ + linux/s390/ioctls_inc0.h \ + linux/s390/set_error.c \ + linux/s390/set_scno.c \ linux/s390/syscallent.h \ - linux/s390x/ioctlent.h.in \ + linux/s390/userent.h \ + linux/s390/userent0.h \ + linux/s390/userent1.h \ + linux/s390x/arch_regs.c \ + linux/s390x/arch_regs.h \ + linux/s390x/arch_sigreturn.c \ + linux/s390x/get_error.c \ + linux/s390x/get_scno.c \ + linux/s390x/get_syscall_args.c \ + linux/s390x/ioctls_arch0.h \ + linux/s390x/ioctls_inc0.h \ + linux/s390x/set_error.c \ + linux/s390x/set_scno.c \ linux/s390x/syscallent.h \ - linux/sh/ioctlent.h.in \ + linux/s390x/userent.h \ + linux/sh/arch_getrval2.c \ + linux/sh/arch_regs.c \ + linux/sh/get_error.c \ + linux/sh/get_scno.c \ + linux/sh/get_syscall_args.c \ + linux/sh/get_syscall_result.c \ + linux/sh/ioctls_arch0.h \ + linux/sh/ioctls_inc0.h \ + linux/sh/set_error.c \ + linux/sh/set_scno.c \ linux/sh/syscallent.h \ - linux/sh64/ioctlent.h.in \ + linux/sh/userent.h \ + linux/sh/userent0.h \ + linux/sh64/arch_regs.c \ + linux/sh64/arch_regs.h \ + linux/sh64/get_error.c \ + linux/sh64/get_scno.c \ + linux/sh64/get_syscall_args.c \ + linux/sh64/get_syscall_result.c \ + linux/sh64/ioctls_arch0.h \ + linux/sh64/ioctls_inc0.h \ + linux/sh64/set_error.c \ + linux/sh64/set_scno.c \ linux/sh64/syscallent.h \ + linux/sh64/userent.h \ linux/signalent.h \ - linux/sparc/dummy2.h \ + linux/sock_diag.h \ + linux/sparc/arch_getrval2.c \ + linux/sparc/arch_regs.c \ + linux/sparc/arch_regs.h \ + linux/sparc/arch_sigreturn.c \ linux/sparc/errnoent.h \ - linux/sparc/errnoent1.h \ linux/sparc/gen.pl \ - linux/sparc/ioctlent.h.in \ - linux/sparc/ioctlent1.h \ + linux/sparc/get_error.c \ + linux/sparc/get_scno.c \ + linux/sparc/get_syscall_args.c \ + linux/sparc/ioctls_arch0.h \ + linux/sparc/ioctls_inc0.h \ + linux/sparc/set_error.c \ + linux/sparc/set_scno.c \ linux/sparc/signalent.h \ - linux/sparc/signalent1.h \ - linux/sparc/syscall1.h \ linux/sparc/syscallent.h \ - linux/sparc/syscallent1.h \ - linux/sparc64/dummy2.h \ + linux/sparc/userent.h \ + linux/sparc64/arch_getrval2.c \ + linux/sparc64/arch_regs.c \ + linux/sparc64/arch_regs.h \ + linux/sparc64/arch_sigreturn.c \ linux/sparc64/errnoent.h \ linux/sparc64/errnoent1.h \ - linux/sparc64/errnoent2.h \ - linux/sparc64/ioctlent.h.in \ - linux/sparc64/ioctlent1.h \ - linux/sparc64/ioctlent2.h \ + linux/sparc64/get_error.c \ + linux/sparc64/get_scno.c \ + linux/sparc64/get_syscall_args.c\ + linux/sparc64/ioctls_arch0.h \ + linux/sparc64/ioctls_arch1.h \ + linux/sparc64/ioctls_inc0.h \ + linux/sparc64/ioctls_inc1.h \ + linux/sparc64/set_error.c \ + linux/sparc64/set_scno.c \ linux/sparc64/signalent.h \ linux/sparc64/signalent1.h \ - linux/sparc64/signalent2.h \ - linux/sparc64/syscall1.h \ linux/sparc64/syscallent.h \ linux/sparc64/syscallent1.h \ - linux/sparc64/syscallent2.h \ + linux/sparc64/userent.h \ linux/subcall.h \ linux/syscall.h \ + linux/tile/arch_regs.c \ + linux/tile/arch_regs.h \ + linux/tile/arch_sigreturn.c \ linux/tile/errnoent1.h \ - linux/tile/ioctlent.h.in \ - linux/tile/ioctlent1.h \ + linux/tile/get_error.c \ + linux/tile/get_scno.c \ + linux/tile/get_syscall_args.c \ + linux/tile/ioctls_arch0.h \ + linux/tile/ioctls_arch1.h \ + linux/tile/ioctls_inc0.h \ + linux/tile/ioctls_inc1.h \ + linux/tile/set_error.c \ + linux/tile/set_scno.c \ linux/tile/signalent1.h \ linux/tile/syscallent.h \ linux/tile/syscallent1.h \ + linux/tile/userent.h \ linux/ubi-user.h \ - linux/x32/errnoent.h \ + linux/unix_diag.h \ + linux/userent.h \ + linux/userent0.h \ + linux/x32/arch_regs.c \ + linux/x32/arch_regs.h \ + linux/x32/arch_sigreturn.c \ linux/x32/errnoent1.h \ - linux/x32/ioctlent.h.in \ - linux/x32/ioctlent1.h \ - linux/x32/signalent.h \ + linux/x32/get_error.c \ + linux/x32/get_scno.c \ + linux/x32/get_syscall_args.c \ + linux/x32/ioctls_arch0.h \ + linux/x32/ioctls_arch1.h \ + linux/x32/ioctls_inc0.h \ + linux/x32/ioctls_inc1.h \ + linux/x32/set_error.c \ + linux/x32/set_scno.c \ linux/x32/signalent1.h \ linux/x32/syscallent.h \ linux/x32/syscallent1.h \ + linux/x32/userent.h \ + linux/x86_64/arch_regs.c \ + linux/x86_64/arch_regs.h \ + linux/x86_64/arch_sigreturn.c \ linux/x86_64/errnoent1.h \ linux/x86_64/errnoent2.h \ linux/x86_64/gentab.pl \ - linux/x86_64/ioctlent.h.in \ - linux/x86_64/ioctlent1.h \ - linux/x86_64/ioctlent2.h \ + linux/x86_64/get_error.c \ + linux/x86_64/get_scno.c \ + linux/x86_64/get_syscall_args.c \ + linux/x86_64/getregs_old.c \ + linux/x86_64/getregs_old.h \ + linux/x86_64/ioctls_arch0.h \ + linux/x86_64/ioctls_arch1.h \ + linux/x86_64/ioctls_arch2.h \ + linux/x86_64/ioctls_inc0.h \ + linux/x86_64/ioctls_inc1.h \ + linux/x86_64/ioctls_inc2.h \ + linux/x86_64/set_error.c \ + linux/x86_64/set_scno.c \ linux/x86_64/signalent1.h \ linux/x86_64/signalent2.h \ linux/x86_64/syscallent.h \ linux/x86_64/syscallent1.h \ linux/x86_64/syscallent2.h \ - linux/xtensa/ioctlent.h.in \ + linux/x86_64/userent.h \ + linux/xtensa/arch_regs.c \ + linux/xtensa/get_error.c \ + linux/xtensa/get_scno.c \ + linux/xtensa/get_syscall_args.c \ + linux/xtensa/get_syscall_result.c \ + linux/xtensa/ioctls_arch0.h \ + linux/xtensa/ioctls_inc0.h \ + linux/xtensa/set_error.c \ + linux/xtensa/set_scno.c \ linux/xtensa/syscallent.h \ + linux/xtensa/userent.h \ + maint/ioctls_gen.sh \ + maint/ioctls_hex.sh \ + maint/ioctls_sym.sh \ + maint/print_ioctlent.c \ + mpers.awk \ + mpers.sh \ + mpers_test.sh \ + mpers_xlat.h \ + scno.head \ signalent.sh \ strace-graph \ strace-log-merge \ @@ -229,15 +761,33 @@ EXTRA_DIST = \ xlat/gen.sh \ xlate.el +.PHONY: check-valgrind-local +check-valgrind-local: + .PHONY: srpm srpm: dist-xz rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz -BUILT_SOURCES = .version - $(srcdir)/.version: $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ +strace_SOURCES_c = \ + $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES)) + +sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c)) + for f in $^; do \ + sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \ + done | sort -u > $@ + +syscallent_names = subcall.h syscallent.h syscallent1.h \ + syscallent-n32.h syscallent-n64.h syscallent-o32.h +syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names)) +syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST)) + +sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files)) + for f in $^; do cat -- $$f; done | \ + $(srcdir)/generate_sen.sh > $@ + dist-hook: $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version @@ -254,6 +804,170 @@ news-check: NEWS exit 1; \ fi +ioctlsort_CC = $(CC_FOR_BUILD) +ioctlsort_DEFS = $(DEFS) +ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES) +ioctlsort_CPPFLAGS = $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) +ioctlsort_CFLAGS = $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) +ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) + +ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h) +ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h)) +ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h))) + +ioctl_redefs%.h: ioctlent%.h ioctlent0.h + sort $< > $<-t + sort ioctlent0.h | comm -23 $<-t - | \ + sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \ + > $@-t + rm -f $<-t + mv $@-t $@ + +ioctlent%.h: ioctlsort% + ./$< > $@ + +# Need to pick up definitions *for host* while compiling +# ioctlsort *for build*, hence this magic. +ioctl_iocdef.i: $(srcdir)/ioctl_iocdef.c + $(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(strace_CPPFLAGS) $(CPPFLAGS) $< -o $@ + +ioctl_iocdef.h: ioctl_iocdef.i + sed -n 's/^DEFINE HOST/#define /p' $< > $@ + +ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o + $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@ + +ioctlsort%.o: ioctls_all%.h ioctl_iocdef.h $(srcdir)/ioctlsort.c + $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c + +ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h + cat $^ > $@ + +BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \ + native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version +CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \ + ioctl_iocdef.h ioctl_iocdef.i \ + native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h +DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h + +include scno.am + +$(strace_OBJECTS): scno.h + +# defines mpers_source_files +include mpers.am +srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files)) +mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i) + +mpers_NAME = +mpers_PREFIX = $(mpers_NAME)_ +mpers_DEFS = $(DEFS) +mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES) +mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS) +mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS) +libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS +libmpers_CFLAGS = $(strace_CFLAGS) + +# mpers targets + +mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h + for f in $^; do \ + CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \ + CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \ + $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \ + done + > $@ + +m%_type_defs.h: $(srcdir_mpers_source_files) + for f in $^; do \ + sed -r -n 's/^#[[:space:]]*include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \ + done > $@-t + echo '#undef MPERS_PRINTER_NAME' >> $@-t + echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t + echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t + echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t + mv $@-t $@ + +m%_funcs.h: $(srcdir_mpers_source_files) + for f in $^; do \ + sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \ + done > $@-t && \ + echo '#include "sys_func.h"' >> $@-t + mv $@-t $@ + +# printers + +%.c.mpers.i: $(srcdir)/%.c + $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@ + +mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$ + +printers.h: $(mpers_preproc_files) + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + echo 'typedef struct {' >> $@-t + for f in $^; do \ + sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \ + || exit; \ + done >> $@-t + echo '} struct_printers;' >> $@-t + echo 'extern const struct_printers *printers;' >> $@-t + echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t + mv $@-t $@ + +%_printer_decls.h: $(mpers_preproc_files) + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + for f in $^; do \ + sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \ + || exit; \ + done >> $@-t + mv $@-t $@ + +%_printer_defs.h: $(mpers_preproc_files) + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + for f in $^; do \ + sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \ + || exit; \ + done >> $@-t + mv $@-t $@ + +native_printer_decls.h native_printer_defs.h: mpers_PREFIX = + +if HAVE_M32_MPERS + +strace_LDADD += libmpers-m32.a +noinst_LIBRARIES += libmpers-m32.a +libmpers_m32_a_SOURCES = $(mpers_source_files) +libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32 +libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS) +mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h + +BUILT_SOURCES += $(mpers_m32_targets) +CLEANFILES += $(mpers_m32_targets) + +$(mpers_m32_targets): mpers_NAME = m32 + +endif # HAVE_M32_MPERS + +if HAVE_MX32_MPERS + +strace_LDADD += libmpers-mx32.a +noinst_LIBRARIES += libmpers-mx32.a +libmpers_mx32_a_SOURCES = $(mpers_source_files) +libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32 +libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS) +mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h + +BUILT_SOURCES += $(mpers_mx32_targets) +CLEANFILES += $(mpers_mx32_targets) + +$(mpers_mx32_targets): mpers_NAME = mx32 + +endif # HAVE_MX32_MPERS + +clean-local: + -rm -rf mpers-m32 mpers-mx32 + if MAINTAINER_MODE gen_changelog_start_date = 2009-07-08 20:00 @@ -274,7 +988,7 @@ $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \ ( \ cd $(srcdir); \ sed '/^##/,$$d' CREDITS.in; \ - { sed -n '1,/^##>/d; s/ \+/\t/; s/^./&/p' CREDITS.in; \ + { sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \ git log --pretty=format:'%aN %aE'; \ } | LC_ALL=C sort -u \ | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \ @@ -282,33 +996,4 @@ $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX -IOCTLDIR = /usr/include -IOCTLASM = asm -IOCTLSORT_INCLUDEDIR = $(IOCTLDIR) - -ioctlent_h_in = linux/ioctlent.h.in - -BUILT_SOURCES += $(ioctlent_h_in) - -$(srcdir)/$(ioctlent_h_in): ioctlsort - $( $@ -ioctlsort: $(srcdir)/linux/ioctlsort.c ioctls.h ioctldefs.h - $(filter-out -I%,$(LINK.c)) -I. -I$(IOCTLSORT_INCLUDEDIR) \ - $(filter -I%,$(LINK.c)) \ - -o $@ $< -ioctls.h: $(srcdir)/linux/ioctlent.sh - $(SHELL) $< $(IOCTLDIR) $(IOCTLASM) -ioctldefs.h: ioctls.h ; - endif - -ioctlent_h = $(builddir)/$(OS)/ioctlent.h -BUILT_SOURCES += $(ioctlent_h) -CLEANFILES = $(ioctlent_h) -ioctlent_h_deps = $(srcdir)/$(OS)/ioctlent.h.in $(srcdir)/$(OS)/$(ARCH)/ioctlent.h.in -$(ioctlent_h): $(top_builddir)/config.status $(ioctlent_h_deps) - $(MKDIR_P) $(builddir)/$(OS) - cat $(ioctlent_h_deps) | \ - $(COMPILE) -E -P - | \ - LC_ALL=C sort -u -k3,3 -k2,2 | \ - awk -f $(srcdir)/linux/ioctlent-filter.awk > $@ diff --git a/Makefile.in b/Makefile.in index adf05fd8..d0a31adc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,6 +15,61 @@ @SET_MAKE@ # Automake input for strace. +# +# Copyright (c) 2002-2009 Roland McGrath +# Copyright (c) 2006-2016 Dmitry V. Levin +# Copyright (c) 2008-2015 Mike Frysinger +# Copyright (c) 2015 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# scno.h make rules for strace. +# +# Copyright (c) 2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -83,59 +138,273 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = strace$(EXEEXT) -DIST_COMMON = $(srcdir)/xlat/Makemodule.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(srcdir)/config.h.in depcomp \ - $(noinst_HEADERS) AUTHORS COPYING INSTALL NEWS README compile \ - config.guess config.sub install-sh missing +DIST_COMMON = $(srcdir)/xlat/Makemodule.am $(srcdir)/scno.am \ + $(srcdir)/mpers.am $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in $(srcdir)/strace.spec.in \ + $(top_srcdir)/debian/changelog.in depcomp AUTHORS COPYING \ + INSTALL NEWS README compile config.guess config.sub install-sh \ + missing @USE_LIBUNWIND_TRUE@am__append_1 = unwind.c -@MAINTAINER_MODE_TRUE@am__append_2 = $(ioctlent_h_in) +@USE_LIBUNWIND_TRUE@am__append_2 = $(libunwind_CPPFLAGS) +@USE_LIBUNWIND_TRUE@am__append_3 = $(libunwind_LDFLAGS) +@USE_LIBUNWIND_TRUE@am__append_4 = $(libunwind_LIBS) +@HAVE_M32_MPERS_TRUE@am__append_5 = libmpers-m32.a +@HAVE_M32_MPERS_TRUE@am__append_6 = libmpers-m32.a +@HAVE_M32_MPERS_TRUE@am__append_7 = $(mpers_m32_targets) +@HAVE_M32_MPERS_TRUE@am__append_8 = $(mpers_m32_targets) +@HAVE_MX32_MPERS_TRUE@am__append_9 = libmpers-mx32.a +@HAVE_MX32_MPERS_TRUE@am__append_10 = libmpers-mx32.a +@HAVE_MX32_MPERS_TRUE@am__append_11 = $(mpers_mx32_targets) +@HAVE_MX32_MPERS_TRUE@am__append_12 = $(mpers_mx32_targets) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/includedir.m4 \ - $(top_srcdir)/m4/long_long.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/statfs.m4 $(top_srcdir)/m4/warnings.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_valgrind_check.m4 \ + $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_warn_cflags.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = strace.spec debian/changelog CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libmpers_m32_a_AR = $(AR) $(ARFLAGS) +libmpers_m32_a_LIBADD = +am__libmpers_m32_a_SOURCES_DIST = block.c btrfs.c dirent.c evdev.c \ + fetch_seccomp_fprog.c fetch_struct_flock.c \ + fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ + fetch_struct_stat.c fetch_struct_stat64.c \ + fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c \ + mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ + print_sigevent.c print_time.c print_timespec.c print_timeval.c \ + print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c \ + sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c +am__objects_1 = libmpers_m32_a-block.$(OBJEXT) \ + libmpers_m32_a-btrfs.$(OBJEXT) libmpers_m32_a-dirent.$(OBJEXT) \ + libmpers_m32_a-evdev.$(OBJEXT) \ + libmpers_m32_a-fetch_seccomp_fprog.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_flock.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_mmsghdr.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_msghdr.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_stat.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_stat64.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_statfs.$(OBJEXT) \ + libmpers_m32_a-hdio.$(OBJEXT) \ + libmpers_m32_a-ipc_msgctl.$(OBJEXT) \ + libmpers_m32_a-ipc_shmctl.$(OBJEXT) \ + libmpers_m32_a-loop.$(OBJEXT) libmpers_m32_a-mtd.$(OBJEXT) \ + libmpers_m32_a-print_mq_attr.$(OBJEXT) \ + libmpers_m32_a-print_msgbuf.$(OBJEXT) \ + libmpers_m32_a-print_sg_req_info.$(OBJEXT) \ + libmpers_m32_a-print_sigevent.$(OBJEXT) \ + libmpers_m32_a-print_time.$(OBJEXT) \ + libmpers_m32_a-print_timespec.$(OBJEXT) \ + libmpers_m32_a-print_timeval.$(OBJEXT) \ + libmpers_m32_a-print_timex.$(OBJEXT) \ + libmpers_m32_a-printrusage.$(OBJEXT) \ + libmpers_m32_a-printsiginfo.$(OBJEXT) \ + libmpers_m32_a-rtc.$(OBJEXT) libmpers_m32_a-sg_io_v3.$(OBJEXT) \ + libmpers_m32_a-sigaltstack.$(OBJEXT) \ + libmpers_m32_a-sock.$(OBJEXT) libmpers_m32_a-sysinfo.$(OBJEXT) \ + libmpers_m32_a-times.$(OBJEXT) libmpers_m32_a-ustat.$(OBJEXT) \ + libmpers_m32_a-utime.$(OBJEXT) libmpers_m32_a-v4l2.$(OBJEXT) +@HAVE_M32_MPERS_TRUE@am_libmpers_m32_a_OBJECTS = $(am__objects_1) +libmpers_m32_a_OBJECTS = $(am_libmpers_m32_a_OBJECTS) +libmpers_mx32_a_AR = $(AR) $(ARFLAGS) +libmpers_mx32_a_LIBADD = +am__libmpers_mx32_a_SOURCES_DIST = block.c btrfs.c dirent.c evdev.c \ + fetch_seccomp_fprog.c fetch_struct_flock.c \ + fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ + fetch_struct_stat.c fetch_struct_stat64.c \ + fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c \ + mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ + print_sigevent.c print_time.c print_timespec.c print_timeval.c \ + print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c \ + sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c +am__objects_2 = libmpers_mx32_a-block.$(OBJEXT) \ + libmpers_mx32_a-btrfs.$(OBJEXT) \ + libmpers_mx32_a-dirent.$(OBJEXT) \ + libmpers_mx32_a-evdev.$(OBJEXT) \ + libmpers_mx32_a-fetch_seccomp_fprog.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_flock.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_mmsghdr.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_msghdr.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_stat.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_stat64.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_statfs.$(OBJEXT) \ + libmpers_mx32_a-hdio.$(OBJEXT) \ + libmpers_mx32_a-ipc_msgctl.$(OBJEXT) \ + libmpers_mx32_a-ipc_shmctl.$(OBJEXT) \ + libmpers_mx32_a-loop.$(OBJEXT) libmpers_mx32_a-mtd.$(OBJEXT) \ + libmpers_mx32_a-print_mq_attr.$(OBJEXT) \ + libmpers_mx32_a-print_msgbuf.$(OBJEXT) \ + libmpers_mx32_a-print_sg_req_info.$(OBJEXT) \ + libmpers_mx32_a-print_sigevent.$(OBJEXT) \ + libmpers_mx32_a-print_time.$(OBJEXT) \ + libmpers_mx32_a-print_timespec.$(OBJEXT) \ + libmpers_mx32_a-print_timeval.$(OBJEXT) \ + libmpers_mx32_a-print_timex.$(OBJEXT) \ + libmpers_mx32_a-printrusage.$(OBJEXT) \ + libmpers_mx32_a-printsiginfo.$(OBJEXT) \ + libmpers_mx32_a-rtc.$(OBJEXT) \ + libmpers_mx32_a-sg_io_v3.$(OBJEXT) \ + libmpers_mx32_a-sigaltstack.$(OBJEXT) \ + libmpers_mx32_a-sock.$(OBJEXT) \ + libmpers_mx32_a-sysinfo.$(OBJEXT) \ + libmpers_mx32_a-times.$(OBJEXT) \ + libmpers_mx32_a-ustat.$(OBJEXT) \ + libmpers_mx32_a-utime.$(OBJEXT) libmpers_mx32_a-v4l2.$(OBJEXT) +@HAVE_MX32_MPERS_TRUE@am_libmpers_mx32_a_OBJECTS = $(am__objects_2) +libmpers_mx32_a_OBJECTS = $(am_libmpers_mx32_a_OBJECTS) +libstrace_a_AR = $(AR) $(ARFLAGS) +libstrace_a_LIBADD = +am_libstrace_a_OBJECTS = libstrace_a-fstatfs.$(OBJEXT) \ + libstrace_a-fstatfs64.$(OBJEXT) libstrace_a-ipc.$(OBJEXT) \ + libstrace_a-socketcall.$(OBJEXT) libstrace_a-statfs.$(OBJEXT) \ + libstrace_a-statfs64.$(OBJEXT) \ + libstrace_a-sync_file_range.$(OBJEXT) \ + libstrace_a-sync_file_range2.$(OBJEXT) \ + libstrace_a-upeek.$(OBJEXT) libstrace_a-upoke.$(OBJEXT) +libstrace_a_OBJECTS = $(am_libstrace_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) -am__strace_SOURCES_DIST = aio.c bjm.c block.c count.c desc.c \ - fanotify.c file.c inotify.c io.c ioctl.c ioprio.c ipc.c \ - kexec.c keyctl.c ldt.c loop.c mem.c mtd.c net.c pathtrace.c \ - process.c ptp.c quota.c reboot.c resource.c scsi.c signal.c \ - sock.c strace.c stream.c syscall.c system.c term.c time.c \ - util.c vsprintf.c unwind.c -@USE_LIBUNWIND_TRUE@am__objects_1 = strace-unwind.$(OBJEXT) -am_strace_OBJECTS = strace-aio.$(OBJEXT) strace-bjm.$(OBJEXT) \ - strace-block.$(OBJEXT) strace-count.$(OBJEXT) \ - strace-desc.$(OBJEXT) strace-fanotify.$(OBJEXT) \ - strace-file.$(OBJEXT) strace-inotify.$(OBJEXT) \ +am__strace_SOURCES_DIST = access.c affinity.c aio.c alpha.c bjm.c \ + block.c bpf.c btrfs.c cacheflush.c capability.c caps0.h \ + caps1.h chdir.c chmod.c clone.c copy_file_range.c count.c \ + defs.h desc.c dirent.c dirent64.c dm.c empty.h epoll.c evdev.c \ + eventfd.c execve.c fadvise.c fallocate.c fanotify.c fchownat.c \ + fcntl.c fetch_seccomp_fprog.c fetch_struct_flock.c \ + fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ + fetch_struct_stat.c fetch_struct_stat64.c \ + fetch_struct_statfs.c file_handle.c file_ioctl.c fs_x_ioctl.c \ + flock.c flock.h futex.c gcc_compat.h get_robust_list.c \ + getcpu.c getcwd.c getrandom.c hdio.c hostname.c inotify.c io.c \ + ioctl.c ioperm.c iopl.c ioprio.c ipc_defs.h ipc_msg.c \ + ipc_msgctl.c ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c \ + kernel_types.h kexec.c keyctl.c ldt.c link.c linux/asm_stat.h \ + linux/x32/asm_stat.h linux/x86_64/asm_stat.h lookup_dcookie.c \ + loop.c lseek.c mem.c membarrier.c memfd_create.c mknod.c \ + mmsghdr.c mount.c mpers_type.h mq.c msghdr.c msghdr.h mtd.c \ + native_defs.h net.c netlink.c nsig.h numa.c oldstat.c open.c \ + or1k_atomic.c pathtrace.c perf.c perf_event_struct.h \ + personality.c pkeys.c poll.c prctl.c print_dev_t.c \ + print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ + print_sigevent.c print_statfs.c print_struct_stat.c \ + print_time.c print_timespec.c print_timeval.c print_timex.c \ + printmode.c printrusage.c printsiginfo.c printsiginfo.h \ + process.c process_vm.c ptp.c ptrace.h qualify.c quota.c \ + readahead.c readlink.c reboot.c regs.h renameat.c resource.c \ + rtc.c sched.c scsi.c seccomp.c seccomp_fprog.h sendfile.c \ + sg_io_v3.c sg_io_v4.c sigaltstack.c sigevent.h signal.c \ + signalfd.c sigreturn.c sock.c sockaddr.c socketutils.c \ + sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h strace.c \ + swapon.c syscall.c sysctl.c sysent.h sysinfo.c syslog.c \ + sysmips.c term.c time.c times.c truncate.c ubi.c uid.c uid16.c \ + umask.c umount.c uname.c userfaultfd.c ustat.c util.c utime.c \ + utimes.c v4l2.c wait.c xattr.c xlat.h xmalloc.c unwind.c +@USE_LIBUNWIND_TRUE@am__objects_3 = strace-unwind.$(OBJEXT) +am_strace_OBJECTS = strace-access.$(OBJEXT) strace-affinity.$(OBJEXT) \ + strace-aio.$(OBJEXT) strace-alpha.$(OBJEXT) \ + strace-bjm.$(OBJEXT) strace-block.$(OBJEXT) \ + strace-bpf.$(OBJEXT) strace-btrfs.$(OBJEXT) \ + strace-cacheflush.$(OBJEXT) strace-capability.$(OBJEXT) \ + strace-chdir.$(OBJEXT) strace-chmod.$(OBJEXT) \ + strace-clone.$(OBJEXT) strace-copy_file_range.$(OBJEXT) \ + strace-count.$(OBJEXT) strace-desc.$(OBJEXT) \ + strace-dirent.$(OBJEXT) strace-dirent64.$(OBJEXT) \ + strace-dm.$(OBJEXT) strace-epoll.$(OBJEXT) \ + strace-evdev.$(OBJEXT) strace-eventfd.$(OBJEXT) \ + strace-execve.$(OBJEXT) strace-fadvise.$(OBJEXT) \ + strace-fallocate.$(OBJEXT) strace-fanotify.$(OBJEXT) \ + strace-fchownat.$(OBJEXT) strace-fcntl.$(OBJEXT) \ + strace-fetch_seccomp_fprog.$(OBJEXT) \ + strace-fetch_struct_flock.$(OBJEXT) \ + strace-fetch_struct_mmsghdr.$(OBJEXT) \ + strace-fetch_struct_msghdr.$(OBJEXT) \ + strace-fetch_struct_stat.$(OBJEXT) \ + strace-fetch_struct_stat64.$(OBJEXT) \ + strace-fetch_struct_statfs.$(OBJEXT) \ + strace-file_handle.$(OBJEXT) strace-file_ioctl.$(OBJEXT) \ + strace-fs_x_ioctl.$(OBJEXT) strace-flock.$(OBJEXT) \ + strace-futex.$(OBJEXT) strace-get_robust_list.$(OBJEXT) \ + strace-getcpu.$(OBJEXT) strace-getcwd.$(OBJEXT) \ + strace-getrandom.$(OBJEXT) strace-hdio.$(OBJEXT) \ + strace-hostname.$(OBJEXT) strace-inotify.$(OBJEXT) \ strace-io.$(OBJEXT) strace-ioctl.$(OBJEXT) \ - strace-ioprio.$(OBJEXT) strace-ipc.$(OBJEXT) \ - strace-kexec.$(OBJEXT) strace-keyctl.$(OBJEXT) \ - strace-ldt.$(OBJEXT) strace-loop.$(OBJEXT) \ - strace-mem.$(OBJEXT) strace-mtd.$(OBJEXT) strace-net.$(OBJEXT) \ - strace-pathtrace.$(OBJEXT) strace-process.$(OBJEXT) \ - strace-ptp.$(OBJEXT) strace-quota.$(OBJEXT) \ - strace-reboot.$(OBJEXT) strace-resource.$(OBJEXT) \ - strace-scsi.$(OBJEXT) strace-signal.$(OBJEXT) \ - strace-sock.$(OBJEXT) strace-strace.$(OBJEXT) \ - strace-stream.$(OBJEXT) strace-syscall.$(OBJEXT) \ - strace-system.$(OBJEXT) strace-term.$(OBJEXT) \ - strace-time.$(OBJEXT) strace-util.$(OBJEXT) \ - strace-vsprintf.$(OBJEXT) $(am__objects_1) + strace-ioperm.$(OBJEXT) strace-iopl.$(OBJEXT) \ + strace-ioprio.$(OBJEXT) strace-ipc_msg.$(OBJEXT) \ + strace-ipc_msgctl.$(OBJEXT) strace-ipc_sem.$(OBJEXT) \ + strace-ipc_shm.$(OBJEXT) strace-ipc_shmctl.$(OBJEXT) \ + strace-kcmp.$(OBJEXT) strace-kexec.$(OBJEXT) \ + strace-keyctl.$(OBJEXT) strace-ldt.$(OBJEXT) \ + strace-link.$(OBJEXT) strace-lookup_dcookie.$(OBJEXT) \ + strace-loop.$(OBJEXT) strace-lseek.$(OBJEXT) \ + strace-mem.$(OBJEXT) strace-membarrier.$(OBJEXT) \ + strace-memfd_create.$(OBJEXT) strace-mknod.$(OBJEXT) \ + strace-mmsghdr.$(OBJEXT) strace-mount.$(OBJEXT) \ + strace-mq.$(OBJEXT) strace-msghdr.$(OBJEXT) \ + strace-mtd.$(OBJEXT) strace-net.$(OBJEXT) \ + strace-netlink.$(OBJEXT) strace-numa.$(OBJEXT) \ + strace-oldstat.$(OBJEXT) strace-open.$(OBJEXT) \ + strace-or1k_atomic.$(OBJEXT) strace-pathtrace.$(OBJEXT) \ + strace-perf.$(OBJEXT) strace-personality.$(OBJEXT) \ + strace-pkeys.$(OBJEXT) strace-poll.$(OBJEXT) \ + strace-prctl.$(OBJEXT) strace-print_dev_t.$(OBJEXT) \ + strace-print_mq_attr.$(OBJEXT) strace-print_msgbuf.$(OBJEXT) \ + strace-print_sg_req_info.$(OBJEXT) \ + strace-print_sigevent.$(OBJEXT) strace-print_statfs.$(OBJEXT) \ + strace-print_struct_stat.$(OBJEXT) strace-print_time.$(OBJEXT) \ + strace-print_timespec.$(OBJEXT) strace-print_timeval.$(OBJEXT) \ + strace-print_timex.$(OBJEXT) strace-printmode.$(OBJEXT) \ + strace-printrusage.$(OBJEXT) strace-printsiginfo.$(OBJEXT) \ + strace-process.$(OBJEXT) strace-process_vm.$(OBJEXT) \ + strace-ptp.$(OBJEXT) strace-qualify.$(OBJEXT) \ + strace-quota.$(OBJEXT) strace-readahead.$(OBJEXT) \ + strace-readlink.$(OBJEXT) strace-reboot.$(OBJEXT) \ + strace-renameat.$(OBJEXT) strace-resource.$(OBJEXT) \ + strace-rtc.$(OBJEXT) strace-sched.$(OBJEXT) \ + strace-scsi.$(OBJEXT) strace-seccomp.$(OBJEXT) \ + strace-sendfile.$(OBJEXT) strace-sg_io_v3.$(OBJEXT) \ + strace-sg_io_v4.$(OBJEXT) strace-sigaltstack.$(OBJEXT) \ + strace-signal.$(OBJEXT) strace-signalfd.$(OBJEXT) \ + strace-sigreturn.$(OBJEXT) strace-sock.$(OBJEXT) \ + strace-sockaddr.$(OBJEXT) strace-socketutils.$(OBJEXT) \ + strace-sram_alloc.$(OBJEXT) strace-stat.$(OBJEXT) \ + strace-stat64.$(OBJEXT) strace-statfs.$(OBJEXT) \ + strace-strace.$(OBJEXT) strace-swapon.$(OBJEXT) \ + strace-syscall.$(OBJEXT) strace-sysctl.$(OBJEXT) \ + strace-sysinfo.$(OBJEXT) strace-syslog.$(OBJEXT) \ + strace-sysmips.$(OBJEXT) strace-term.$(OBJEXT) \ + strace-time.$(OBJEXT) strace-times.$(OBJEXT) \ + strace-truncate.$(OBJEXT) strace-ubi.$(OBJEXT) \ + strace-uid.$(OBJEXT) strace-uid16.$(OBJEXT) \ + strace-umask.$(OBJEXT) strace-umount.$(OBJEXT) \ + strace-uname.$(OBJEXT) strace-userfaultfd.$(OBJEXT) \ + strace-ustat.$(OBJEXT) strace-util.$(OBJEXT) \ + strace-utime.$(OBJEXT) strace-utimes.$(OBJEXT) \ + strace-v4l2.$(OBJEXT) strace-wait.$(OBJEXT) \ + strace-xattr.$(OBJEXT) strace-xmalloc.$(OBJEXT) \ + $(am__objects_3) strace_OBJECTS = $(am_strace_OBJECTS) am__DEPENDENCIES_1 = -@USE_LIBUNWIND_TRUE@strace_DEPENDENCIES = $(am__DEPENDENCIES_1) -strace_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(strace_LDFLAGS) \ +@USE_LIBUNWIND_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +strace_DEPENDENCIES = libstrace.a $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__append_5) $(am__append_9) +strace_LINK = $(CCLD) $(strace_CFLAGS) $(CFLAGS) $(strace_LDFLAGS) \ $(LDFLAGS) -o $@ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -177,7 +446,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ +DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -197,8 +466,11 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(strace_SOURCES) -DIST_SOURCES = $(am__strace_SOURCES_DIST) +SOURCES = $(libmpers_m32_a_SOURCES) $(libmpers_mx32_a_SOURCES) \ + $(libstrace_a_SOURCES) $(strace_SOURCES) +DIST_SOURCES = $(am__libmpers_m32_a_SOURCES_DIST) \ + $(am__libmpers_mx32_a_SOURCES_DIST) $(libstrace_a_SOURCES) \ + $(am__strace_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -215,7 +487,6 @@ am__can_run_installinfo = \ man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) -HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -224,6 +495,7 @@ am__recursive_targets = \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck +am__extra_recursive_targets = check-valgrind-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -245,7 +517,7 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = tests tests-m32 tests-mx32 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -281,9 +553,9 @@ am__relativize = \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz GZIP_ENV = --best -DIST_ARCHIVES = $(distdir).tar.xz -DIST_TARGETS = dist-xz +DIST_TARGETS = dist-xz dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -295,31 +567,52 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ CYGPATH_W = @CYGPATH_W@ +DEB_CHANGELOGTIME = @DEB_CHANGELOGTIME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ EXEEXT = @EXEEXT@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MIPS_ABI = @MIPS_ABI@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -331,22 +624,31 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +RANLIB = @RANLIB@ +RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ arch = @arch@ +arch_m32 = @arch_m32@ +arch_mx32 = @arch_mx32@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -356,6 +658,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +dl_LIBS = @dl_LIBS@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -390,7 +693,11 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = tests +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +@HAVE_M32_RUNTIME_TRUE@TESTS_M32 = tests-m32 +@HAVE_MX32_RUNTIME_TRUE@TESTS_MX32 = tests-mx32 +SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32) man_MANS = strace.1 bin_SCRIPTS = strace-graph strace-log-merge OS = linux @@ -398,52 +705,117 @@ OS = linux ARCH = @arch@ ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = $(WARN_CFLAGS) -AM_CPPFLAGS = -I$(srcdir)/$(OS)/$(ARCH) -I$(srcdir)/$(OS) -I$(builddir)/$(OS) -XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclcmds.in xlat/aclipc.in \ +AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \ + -I$(srcdir)/$(OS)/$(ARCH) \ + -I$(builddir)/$(OS) \ + -I$(srcdir)/$(OS) \ + -I$(builddir) \ + -I$(srcdir) + +AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD) +AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS) +XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclipc.in \ xlat/addrfams.in xlat/adjtimex_modes.in xlat/adjtimex_state.in \ xlat/adjtimex_status.in xlat/advise.in xlat/af_packet_types.in \ - xlat/archvals.in xlat/at_flags.in xlat/atomic_ops.in \ - xlat/baud_options.in xlat/blkpg_ops.in xlat/bootflags1.in \ - xlat/bootflags2.in xlat/bootflags3.in xlat/cacheflush_scope.in \ - xlat/cap_version.in xlat/capabilities.in xlat/clockflags.in \ + xlat/archvals.in xlat/arp_hardware_types.in xlat/at_flags.in \ + xlat/atomic_ops.in xlat/audit_arch.in xlat/baud_options.in \ + xlat/blkpg_ops.in xlat/bootflags1.in xlat/bootflags2.in \ + xlat/bootflags3.in xlat/bpf_attach_type.in xlat/bpf_class.in \ + xlat/bpf_commands.in xlat/bpf_map_types.in \ + xlat/bpf_map_update_elem_flags.in xlat/bpf_miscop.in \ + xlat/bpf_mode.in xlat/bpf_op_alu.in xlat/bpf_op_jmp.in \ + xlat/bpf_prog_types.in xlat/bpf_rval.in xlat/bpf_size.in \ + xlat/bpf_src.in xlat/bsg_flags.in xlat/bsg_protocol.in \ + xlat/bsg_subprotocol.in xlat/bt_protocols.in \ + xlat/btrfs_balance_args.in xlat/btrfs_balance_ctl_cmds.in \ + xlat/btrfs_balance_flags.in xlat/btrfs_balance_state.in \ + xlat/btrfs_compress_types.in xlat/btrfs_defrag_flags.in \ + xlat/btrfs_dev_replace_cmds.in \ + xlat/btrfs_dev_replace_results.in \ + xlat/btrfs_dev_replace_state.in xlat/btrfs_dev_stats_flags.in \ + xlat/btrfs_dev_stats_values.in xlat/btrfs_features_compat.in \ + xlat/btrfs_features_compat_ro.in \ + xlat/btrfs_features_incompat.in xlat/btrfs_key_types.in \ + xlat/btrfs_qgroup_ctl_cmds.in \ + xlat/btrfs_qgroup_inherit_flags.in \ + xlat/btrfs_qgroup_limit_flags.in \ + xlat/btrfs_qgroup_status_flags.in xlat/btrfs_scrub_flags.in \ + xlat/btrfs_send_flags.in xlat/btrfs_snap_flags_v2.in \ + xlat/btrfs_space_info_flags.in xlat/btrfs_tree_objectids.in \ + xlat/cacheflush_scope.in xlat/cap.in xlat/cap_mask0.in \ + xlat/cap_mask1.in xlat/cap_version.in xlat/clockflags.in \ xlat/clocknames.in xlat/clone_flags.in xlat/cpuclocknames.in \ - xlat/delete_module_flags.in xlat/direnttypes.in \ - xlat/domains.in xlat/epollctls.in xlat/epollevents.in \ - xlat/epollflags.in xlat/fan_classes.in xlat/fan_event_flags.in \ - xlat/fan_init_flags.in xlat/fan_mark_flags.in \ - xlat/fcntlcmds.in xlat/fdflags.in xlat/fileflags.in \ - xlat/flockcmds.in xlat/fsmagic.in xlat/futexops.in \ - xlat/futexwakecmps.in xlat/futexwakeops.in \ + xlat/delete_module_flags.in xlat/dirent_types.in \ + xlat/dm_flags.in xlat/efd_flags.in xlat/epollctls.in \ + xlat/epollevents.in xlat/epollflags.in \ + xlat/ethernet_protocols.in xlat/evdev_abs.in \ + xlat/evdev_autorepeat.in xlat/evdev_ev.in \ + xlat/evdev_ff_status.in xlat/evdev_ff_types.in \ + xlat/evdev_keycode.in xlat/evdev_leds.in xlat/evdev_misc.in \ + xlat/evdev_mtslots.in xlat/evdev_prop.in \ + xlat/evdev_relative_axes.in xlat/evdev_snd.in \ + xlat/evdev_switch.in xlat/evdev_sync.in xlat/f_owner_types.in \ + xlat/f_seals.in xlat/falloc_flags.in xlat/fan_classes.in \ + xlat/fan_event_flags.in xlat/fan_init_flags.in \ + xlat/fan_mark_flags.in xlat/fcntl64cmds.in xlat/fcntlcmds.in \ + xlat/fdflags.in xlat/fiemap_extent_flags.in \ + xlat/fiemap_flags.in xlat/flockcmds.in xlat/fsmagic.in \ + xlat/futexops.in xlat/futexwakecmps.in xlat/futexwakeops.in \ + xlat/getrandom_flags.in xlat/getsockipoptions.in \ + xlat/getsockipv6options.in xlat/hci_channels.in \ + xlat/hw_breakpoint_len.in xlat/hw_breakpoint_type.in \ xlat/icmpfilterflags.in xlat/if_dqblk_valid.in \ - xlat/if_dqinfo_valid.in xlat/iffflags.in \ - xlat/inet_protocols.in xlat/inotify_flags.in \ - xlat/inotify_init_flags.in xlat/ioprio_class.in \ - xlat/ioprio_who.in xlat/ipc_msg_flags.in xlat/itimer_which.in \ - xlat/kexec_arch_values.in xlat/kexec_flags.in \ + xlat/if_dqinfo_flags.in xlat/if_dqinfo_valid.in \ + xlat/iffflags.in xlat/inet_protocols.in xlat/inotify_flags.in \ + xlat/inotify_init_flags.in xlat/ioctl_dirs.in \ + xlat/ioprio_class.in xlat/ioprio_who.in xlat/ip_cmsg_types.in \ + xlat/ipc_msg_flags.in xlat/ipccalls.in xlat/itimer_which.in \ + xlat/kcmp_types.in xlat/kexec_arch_values.in \ + xlat/kexec_file_load_flags.in xlat/kexec_load_flags.in \ xlat/key_perms.in xlat/key_reqkeys.in xlat/key_spec.in \ - xlat/keyctl_commands.in xlat/lockfcmds.in \ + xlat/keyctl_commands.in xlat/lockfcmds.in xlat/loop_cmds.in \ xlat/loop_crypt_type_options.in xlat/loop_flags_options.in \ - xlat/madvise_cmds.in xlat/mbindflags.in xlat/mctl_funcs.in \ - xlat/mctl_lockas.in xlat/mctl_sync.in xlat/mempolicyflags.in \ + xlat/madvise_cmds.in xlat/mbindflags.in xlat/mctl_sync.in \ + xlat/membarrier_cmds.in xlat/memfd_create_flags.in \ + xlat/mempolicyflags.in xlat/mlock_flags.in \ xlat/mlockall_flags.in xlat/mmap_flags.in xlat/mmap_prot.in \ - xlat/modem_flags.in xlat/modetypes.in xlat/modflags.in \ + xlat/modem_flags.in xlat/modetypes.in \ xlat/module_init_flags.in xlat/mount_flags.in \ - xlat/move_pages_flags.in xlat/mremap_flags.in \ - xlat/msg_flags.in xlat/msgctl_flags.in xlat/msgflags.in \ - xlat/mtd_flags_options.in xlat/mtd_mode_options.in \ - xlat/mtd_nandecc_options.in xlat/mtd_otp_options.in \ - xlat/mtd_type_options.in xlat/netlink_protocols.in \ + xlat/move_pages_flags.in xlat/mq_attr_flags.in \ + xlat/mremap_flags.in xlat/msg_flags.in xlat/msgctl_flags.in \ + xlat/mtd_file_mode_options.in xlat/mtd_flags_options.in \ + xlat/mtd_mode_options.in xlat/mtd_nandecc_options.in \ + xlat/mtd_otp_options.in xlat/mtd_type_options.in \ + xlat/name_to_handle_at_flags.in xlat/netlink_flags.in \ + xlat/netlink_protocols.in xlat/netlink_types.in \ xlat/notifyflags.in xlat/nt_descriptor_types.in \ xlat/open_access_modes.in xlat/open_mode_flags.in \ - xlat/openmodessol.in xlat/perf_event_open_flags.in \ - xlat/personality_options.in xlat/pmsgflags.in xlat/policies.in \ - xlat/pollflags.in xlat/prctl_options.in xlat/priorities.in \ + xlat/openmodessol.in xlat/packet_mreq_type.in \ + xlat/perf_attr_size.in xlat/perf_branch_sample_type.in \ + xlat/perf_event_open_flags.in xlat/perf_event_read_format.in \ + xlat/perf_event_sample_format.in xlat/perf_hw_cache_id.in \ + xlat/perf_hw_cache_op_id.in xlat/perf_hw_cache_op_result_id.in \ + xlat/perf_hw_id.in xlat/perf_sw_ids.in xlat/perf_type_id.in \ + xlat/personality_flags.in xlat/personality_types.in \ + xlat/pkey_access.in xlat/policies.in xlat/pollflags.in \ + xlat/pr_cap_ambient.in xlat/pr_dumpable.in xlat/pr_fp_mode.in \ + xlat/pr_mce_kill.in xlat/pr_mce_kill_policy.in \ + xlat/pr_set_mm.in xlat/pr_tsc.in xlat/pr_unalign_flags.in \ + xlat/prctl_options.in xlat/priorities.in \ xlat/ptp_flags_options.in xlat/ptrace_cmds.in \ - xlat/ptrace_setoptions_flags.in xlat/qm_which.in \ - xlat/quota_formats.in xlat/quotacmds.in xlat/quotatypes.in \ - xlat/rename_flags.in xlat/resource_flags.in xlat/resources.in \ - xlat/schedulers.in xlat/scmvals.in xlat/semctl_flags.in \ - xlat/semop_flags.in xlat/sg_io_dxfer_direction.in \ + xlat/ptrace_events.in xlat/ptrace_peeksiginfo_flags.in \ + xlat/ptrace_setoptions_flags.in xlat/quota_formats.in \ + xlat/quotacmds.in xlat/quotatypes.in xlat/rename_flags.in \ + xlat/resource_flags.in xlat/resources.in xlat/rwf_flags.in \ + xlat/sa_handler_values.in xlat/sched_flags.in \ + xlat/schedulers.in xlat/scmvals.in xlat/scsi_sg_commands.in \ + xlat/secbits.in xlat/seccomp_filter_flags.in \ + xlat/seccomp_mode.in xlat/seccomp_ops.in \ + xlat/seccomp_ret_action.in xlat/semctl_flags.in \ + xlat/semop_flags.in xlat/setns_types.in \ + xlat/setsockipoptions.in xlat/setsockipv6options.in \ + xlat/sfd_flags.in xlat/sg_io_dxfer_direction.in \ + xlat/sg_io_flags.in xlat/sg_io_info.in xlat/sg_scsi_reset.in \ xlat/shm_flags.in xlat/shm_resource_flags.in \ xlat/shmctl_flags.in xlat/shutdown_modes.in \ xlat/sigact_flags.in xlat/sigaltstack_flags.in \ @@ -453,15 +825,15 @@ XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclcmds.in xlat/aclipc.in \ xlat/sigpoll_codes.in xlat/sigprocmaskcmds.in \ xlat/sigprof_codes.in xlat/sigsegv_codes.in \ xlat/sigsys_codes.in xlat/sigtrap_codes.in \ - xlat/sock_type_flags.in xlat/socketlayers.in \ - xlat/sockipoptions.in xlat/sockipv6options.in \ - xlat/sockipxoptions.in xlat/sockoptions.in \ - xlat/sockpacketoptions.in xlat/sockrawoptions.in \ - xlat/socksctpoptions.in xlat/socktcpoptions.in \ - xlat/socktypes.in xlat/splice_flags.in \ - xlat/sram_alloc_flags.in xlat/swap_flags.in \ - xlat/sync_file_range_flags.in xlat/sysctl_kern.in \ - xlat/sysctl_net.in xlat/sysctl_net_core.in \ + xlat/sock_type_flags.in xlat/socketcalls.in \ + xlat/socketlayers.in xlat/sockipoptions.in \ + xlat/sockipv6options.in xlat/sockipxoptions.in \ + xlat/sockoptions.in xlat/sockpacketoptions.in \ + xlat/sockrawoptions.in xlat/socksctpoptions.in \ + xlat/socktcpoptions.in xlat/socktypes.in xlat/splice_flags.in \ + xlat/sram_alloc_flags.in xlat/statfs_flags.in \ + xlat/swap_flags.in xlat/sync_file_range_flags.in \ + xlat/sysctl_kern.in xlat/sysctl_net.in xlat/sysctl_net_core.in \ xlat/sysctl_net_ipv4.in xlat/sysctl_net_ipv4_conf.in \ xlat/sysctl_net_ipv4_route.in xlat/sysctl_net_ipv6.in \ xlat/sysctl_net_ipv6_route.in xlat/sysctl_net_unix.in \ @@ -469,53 +841,117 @@ XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclcmds.in xlat/aclipc.in \ xlat/syslog_action_type.in xlat/sysmips_operations.in \ xlat/tcflsh_options.in xlat/tcxonc_options.in \ xlat/timerfdflags.in xlat/ubi_volume_props.in \ - xlat/ubi_volume_types.in xlat/umount_flags.in xlat/usagewho.in \ - xlat/wait4_options.in xlat/waitid_types.in \ - xlat/whence_codes.in xlat/xattrflags.in \ + xlat/ubi_volume_types.in xlat/uffd_api_flags.in \ + xlat/uffd_copy_flags.in xlat/uffd_flags.in \ + xlat/uffd_register_ioctl_flags.in \ + xlat/uffd_register_mode_flags.in xlat/uffd_zeropage_flags.in \ + xlat/umount_flags.in xlat/unshare_flags.in xlat/usagewho.in \ + xlat/v4l2_buf_flags.in xlat/v4l2_buf_types.in \ + xlat/v4l2_capture_modes.in xlat/v4l2_colorspaces.in \ + xlat/v4l2_control_classes.in xlat/v4l2_control_flags.in \ + xlat/v4l2_control_ids.in xlat/v4l2_control_types.in \ + xlat/v4l2_device_capabilities_flags.in xlat/v4l2_fields.in \ + xlat/v4l2_format_description_flags.in \ + xlat/v4l2_frameinterval_types.in xlat/v4l2_framesize_types.in \ + xlat/v4l2_input_types.in xlat/v4l2_memories.in \ + xlat/v4l2_streaming_capabilities.in xlat/wait4_options.in \ + xlat/waitid_types.in xlat/whence_codes.in xlat/xattrflags.in \ xlat/xfs_dqblk_flags.in xlat/xfs_quota_flags.in -XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclcmds.h xlat/aclipc.h \ - xlat/addrfams.h xlat/adjtimex_modes.h xlat/adjtimex_state.h \ +XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclipc.h xlat/addrfams.h \ + xlat/adjtimex_modes.h xlat/adjtimex_state.h \ xlat/adjtimex_status.h xlat/advise.h xlat/af_packet_types.h \ - xlat/archvals.h xlat/at_flags.h xlat/atomic_ops.h \ - xlat/baud_options.h xlat/blkpg_ops.h xlat/bootflags1.h \ - xlat/bootflags2.h xlat/bootflags3.h xlat/cacheflush_scope.h \ - xlat/cap_version.h xlat/capabilities.h xlat/clockflags.h \ + xlat/archvals.h xlat/arp_hardware_types.h xlat/at_flags.h \ + xlat/atomic_ops.h xlat/audit_arch.h xlat/baud_options.h \ + xlat/blkpg_ops.h xlat/bootflags1.h xlat/bootflags2.h \ + xlat/bootflags3.h xlat/bpf_attach_type.h xlat/bpf_class.h \ + xlat/bpf_commands.h xlat/bpf_map_types.h \ + xlat/bpf_map_update_elem_flags.h xlat/bpf_miscop.h \ + xlat/bpf_mode.h xlat/bpf_op_alu.h xlat/bpf_op_jmp.h \ + xlat/bpf_prog_types.h xlat/bpf_rval.h xlat/bpf_size.h \ + xlat/bpf_src.h xlat/bsg_flags.h xlat/bsg_protocol.h \ + xlat/bsg_subprotocol.h xlat/bt_protocols.h \ + xlat/btrfs_balance_args.h xlat/btrfs_balance_ctl_cmds.h \ + xlat/btrfs_balance_flags.h xlat/btrfs_balance_state.h \ + xlat/btrfs_compress_types.h xlat/btrfs_defrag_flags.h \ + xlat/btrfs_dev_replace_cmds.h xlat/btrfs_dev_replace_results.h \ + xlat/btrfs_dev_replace_state.h xlat/btrfs_dev_stats_flags.h \ + xlat/btrfs_dev_stats_values.h xlat/btrfs_features_compat.h \ + xlat/btrfs_features_compat_ro.h xlat/btrfs_features_incompat.h \ + xlat/btrfs_key_types.h xlat/btrfs_qgroup_ctl_cmds.h \ + xlat/btrfs_qgroup_inherit_flags.h \ + xlat/btrfs_qgroup_limit_flags.h \ + xlat/btrfs_qgroup_status_flags.h xlat/btrfs_scrub_flags.h \ + xlat/btrfs_send_flags.h xlat/btrfs_snap_flags_v2.h \ + xlat/btrfs_space_info_flags.h xlat/btrfs_tree_objectids.h \ + xlat/cacheflush_scope.h xlat/cap.h xlat/cap_mask0.h \ + xlat/cap_mask1.h xlat/cap_version.h xlat/clockflags.h \ xlat/clocknames.h xlat/clone_flags.h xlat/cpuclocknames.h \ - xlat/delete_module_flags.h xlat/direnttypes.h xlat/domains.h \ - xlat/epollctls.h xlat/epollevents.h xlat/epollflags.h \ - xlat/fan_classes.h xlat/fan_event_flags.h \ - xlat/fan_init_flags.h xlat/fan_mark_flags.h xlat/fcntlcmds.h \ - xlat/fdflags.h xlat/fileflags.h xlat/flockcmds.h \ - xlat/fsmagic.h xlat/futexops.h xlat/futexwakecmps.h \ - xlat/futexwakeops.h xlat/icmpfilterflags.h \ - xlat/if_dqblk_valid.h xlat/if_dqinfo_valid.h xlat/iffflags.h \ + xlat/delete_module_flags.h xlat/dirent_types.h xlat/dm_flags.h \ + xlat/efd_flags.h xlat/epollctls.h xlat/epollevents.h \ + xlat/epollflags.h xlat/ethernet_protocols.h xlat/evdev_abs.h \ + xlat/evdev_autorepeat.h xlat/evdev_ev.h xlat/evdev_ff_status.h \ + xlat/evdev_ff_types.h xlat/evdev_keycode.h xlat/evdev_leds.h \ + xlat/evdev_misc.h xlat/evdev_mtslots.h xlat/evdev_prop.h \ + xlat/evdev_relative_axes.h xlat/evdev_snd.h \ + xlat/evdev_switch.h xlat/evdev_sync.h xlat/f_owner_types.h \ + xlat/f_seals.h xlat/falloc_flags.h xlat/fan_classes.h \ + xlat/fan_event_flags.h xlat/fan_init_flags.h \ + xlat/fan_mark_flags.h xlat/fcntl64cmds.h xlat/fcntlcmds.h \ + xlat/fdflags.h xlat/fiemap_extent_flags.h xlat/fiemap_flags.h \ + xlat/flockcmds.h xlat/fsmagic.h xlat/futexops.h \ + xlat/futexwakecmps.h xlat/futexwakeops.h \ + xlat/getrandom_flags.h xlat/getsockipoptions.h \ + xlat/getsockipv6options.h xlat/hci_channels.h \ + xlat/hw_breakpoint_len.h xlat/hw_breakpoint_type.h \ + xlat/icmpfilterflags.h xlat/if_dqblk_valid.h \ + xlat/if_dqinfo_flags.h xlat/if_dqinfo_valid.h xlat/iffflags.h \ xlat/inet_protocols.h xlat/inotify_flags.h \ - xlat/inotify_init_flags.h xlat/ioprio_class.h \ - xlat/ioprio_who.h xlat/ipc_msg_flags.h xlat/itimer_which.h \ - xlat/kexec_arch_values.h xlat/kexec_flags.h xlat/key_perms.h \ - xlat/key_reqkeys.h xlat/key_spec.h xlat/keyctl_commands.h \ - xlat/lockfcmds.h xlat/loop_crypt_type_options.h \ - xlat/loop_flags_options.h xlat/madvise_cmds.h \ - xlat/mbindflags.h xlat/mctl_funcs.h xlat/mctl_lockas.h \ - xlat/mctl_sync.h xlat/mempolicyflags.h xlat/mlockall_flags.h \ + xlat/inotify_init_flags.h xlat/ioctl_dirs.h \ + xlat/ioprio_class.h xlat/ioprio_who.h xlat/ip_cmsg_types.h \ + xlat/ipc_msg_flags.h xlat/ipccalls.h xlat/itimer_which.h \ + xlat/kcmp_types.h xlat/kexec_arch_values.h \ + xlat/kexec_file_load_flags.h xlat/kexec_load_flags.h \ + xlat/key_perms.h xlat/key_reqkeys.h xlat/key_spec.h \ + xlat/keyctl_commands.h xlat/lockfcmds.h xlat/loop_cmds.h \ + xlat/loop_crypt_type_options.h xlat/loop_flags_options.h \ + xlat/madvise_cmds.h xlat/mbindflags.h xlat/mctl_sync.h \ + xlat/membarrier_cmds.h xlat/memfd_create_flags.h \ + xlat/mempolicyflags.h xlat/mlock_flags.h xlat/mlockall_flags.h \ xlat/mmap_flags.h xlat/mmap_prot.h xlat/modem_flags.h \ - xlat/modetypes.h xlat/modflags.h xlat/module_init_flags.h \ - xlat/mount_flags.h xlat/move_pages_flags.h xlat/mremap_flags.h \ - xlat/msg_flags.h xlat/msgctl_flags.h xlat/msgflags.h \ - xlat/mtd_flags_options.h xlat/mtd_mode_options.h \ - xlat/mtd_nandecc_options.h xlat/mtd_otp_options.h \ - xlat/mtd_type_options.h xlat/netlink_protocols.h \ + xlat/modetypes.h xlat/module_init_flags.h xlat/mount_flags.h \ + xlat/move_pages_flags.h xlat/mq_attr_flags.h \ + xlat/mremap_flags.h xlat/msg_flags.h xlat/msgctl_flags.h \ + xlat/mtd_file_mode_options.h xlat/mtd_flags_options.h \ + xlat/mtd_mode_options.h xlat/mtd_nandecc_options.h \ + xlat/mtd_otp_options.h xlat/mtd_type_options.h \ + xlat/name_to_handle_at_flags.h xlat/netlink_flags.h \ + xlat/netlink_protocols.h xlat/netlink_types.h \ xlat/notifyflags.h xlat/nt_descriptor_types.h \ xlat/open_access_modes.h xlat/open_mode_flags.h \ - xlat/openmodessol.h xlat/perf_event_open_flags.h \ - xlat/personality_options.h xlat/pmsgflags.h xlat/policies.h \ - xlat/pollflags.h xlat/prctl_options.h xlat/priorities.h \ - xlat/ptp_flags_options.h xlat/ptrace_cmds.h \ - xlat/ptrace_setoptions_flags.h xlat/qm_which.h \ - xlat/quota_formats.h xlat/quotacmds.h xlat/quotatypes.h \ - xlat/rename_flags.h xlat/resource_flags.h xlat/resources.h \ - xlat/schedulers.h xlat/scmvals.h xlat/semctl_flags.h \ - xlat/semop_flags.h xlat/sg_io_dxfer_direction.h \ + xlat/openmodessol.h xlat/packet_mreq_type.h \ + xlat/perf_attr_size.h xlat/perf_branch_sample_type.h \ + xlat/perf_event_open_flags.h xlat/perf_event_read_format.h \ + xlat/perf_event_sample_format.h xlat/perf_hw_cache_id.h \ + xlat/perf_hw_cache_op_id.h xlat/perf_hw_cache_op_result_id.h \ + xlat/perf_hw_id.h xlat/perf_sw_ids.h xlat/perf_type_id.h \ + xlat/personality_flags.h xlat/personality_types.h \ + xlat/pkey_access.h xlat/policies.h xlat/pollflags.h \ + xlat/pr_cap_ambient.h xlat/pr_dumpable.h xlat/pr_fp_mode.h \ + xlat/pr_mce_kill.h xlat/pr_mce_kill_policy.h xlat/pr_set_mm.h \ + xlat/pr_tsc.h xlat/pr_unalign_flags.h xlat/prctl_options.h \ + xlat/priorities.h xlat/ptp_flags_options.h xlat/ptrace_cmds.h \ + xlat/ptrace_events.h xlat/ptrace_peeksiginfo_flags.h \ + xlat/ptrace_setoptions_flags.h xlat/quota_formats.h \ + xlat/quotacmds.h xlat/quotatypes.h xlat/rename_flags.h \ + xlat/resource_flags.h xlat/resources.h xlat/rwf_flags.h \ + xlat/sa_handler_values.h xlat/sched_flags.h xlat/schedulers.h \ + xlat/scmvals.h xlat/scsi_sg_commands.h xlat/secbits.h \ + xlat/seccomp_filter_flags.h xlat/seccomp_mode.h \ + xlat/seccomp_ops.h xlat/seccomp_ret_action.h \ + xlat/semctl_flags.h xlat/semop_flags.h xlat/setns_types.h \ + xlat/setsockipoptions.h xlat/setsockipv6options.h \ + xlat/sfd_flags.h xlat/sg_io_dxfer_direction.h \ + xlat/sg_io_flags.h xlat/sg_io_info.h xlat/sg_scsi_reset.h \ xlat/shm_flags.h xlat/shm_resource_flags.h xlat/shmctl_flags.h \ xlat/shutdown_modes.h xlat/sigact_flags.h \ xlat/sigaltstack_flags.h xlat/sigbus_codes.h \ @@ -523,13 +959,13 @@ XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclcmds.h xlat/aclipc.h \ xlat/sigfpe_codes.h xlat/sigill_codes.h xlat/siginfo_codes.h \ xlat/sigpoll_codes.h xlat/sigprocmaskcmds.h \ xlat/sigprof_codes.h xlat/sigsegv_codes.h xlat/sigsys_codes.h \ - xlat/sigtrap_codes.h xlat/sock_type_flags.h \ + xlat/sigtrap_codes.h xlat/sock_type_flags.h xlat/socketcalls.h \ xlat/socketlayers.h xlat/sockipoptions.h \ xlat/sockipv6options.h xlat/sockipxoptions.h \ xlat/sockoptions.h xlat/sockpacketoptions.h \ xlat/sockrawoptions.h xlat/socksctpoptions.h \ xlat/socktcpoptions.h xlat/socktypes.h xlat/splice_flags.h \ - xlat/sram_alloc_flags.h xlat/swap_flags.h \ + xlat/sram_alloc_flags.h xlat/statfs_flags.h xlat/swap_flags.h \ xlat/sync_file_range_flags.h xlat/sysctl_kern.h \ xlat/sysctl_net.h xlat/sysctl_net_core.h \ xlat/sysctl_net_ipv4.h xlat/sysctl_net_ipv4_conf.h \ @@ -539,22 +975,86 @@ XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclcmds.h xlat/aclipc.h \ xlat/sysmips_operations.h xlat/tcflsh_options.h \ xlat/tcxonc_options.h xlat/timerfdflags.h \ xlat/ubi_volume_props.h xlat/ubi_volume_types.h \ - xlat/umount_flags.h xlat/usagewho.h xlat/wait4_options.h \ + xlat/uffd_api_flags.h xlat/uffd_copy_flags.h xlat/uffd_flags.h \ + xlat/uffd_register_ioctl_flags.h \ + xlat/uffd_register_mode_flags.h xlat/uffd_zeropage_flags.h \ + xlat/umount_flags.h xlat/unshare_flags.h xlat/usagewho.h \ + xlat/v4l2_buf_flags.h xlat/v4l2_buf_types.h \ + xlat/v4l2_capture_modes.h xlat/v4l2_colorspaces.h \ + xlat/v4l2_control_classes.h xlat/v4l2_control_flags.h \ + xlat/v4l2_control_ids.h xlat/v4l2_control_types.h \ + xlat/v4l2_device_capabilities_flags.h xlat/v4l2_fields.h \ + xlat/v4l2_format_description_flags.h \ + xlat/v4l2_frameinterval_types.h xlat/v4l2_framesize_types.h \ + xlat/v4l2_input_types.h xlat/v4l2_memories.h \ + xlat/v4l2_streaming_capabilities.h xlat/wait4_options.h \ xlat/waitid_types.h xlat/whence_codes.h xlat/xattrflags.h \ xlat/xfs_dqblk_flags.h xlat/xfs_quota_flags.h -strace_SOURCES = aio.c bjm.c block.c count.c desc.c fanotify.c file.c \ - inotify.c io.c ioctl.c ioprio.c ipc.c kexec.c keyctl.c ldt.c \ - loop.c mem.c mtd.c net.c pathtrace.c process.c ptp.c quota.c \ - reboot.c resource.c scsi.c signal.c sock.c strace.c stream.c \ - syscall.c system.c term.c time.c util.c vsprintf.c \ +strace_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_2) \ + $(CODE_COVERAGE_CPPFLAGS) +strace_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS) +strace_LDFLAGS = $(am__append_3) +strace_LDADD = libstrace.a $(am__append_4) $(CODE_COVERAGE_LDFLAGS) \ + $(am__append_5) $(am__append_9) +noinst_LIBRARIES = libstrace.a $(am__append_6) $(am__append_10) +libstrace_a_CPPFLAGS = $(strace_CPPFLAGS) +libstrace_a_CFLAGS = $(strace_CFLAGS) +libstrace_a_SOURCES = \ + fstatfs.c \ + fstatfs64.c \ + ipc.c \ + socketcall.c \ + statfs.c \ + statfs64.c \ + sync_file_range.c \ + sync_file_range2.c \ + upeek.c \ + upoke.c \ + # end of libstrace_a_SOURCES + +strace_SOURCES = access.c affinity.c aio.c alpha.c bjm.c block.c bpf.c \ + btrfs.c cacheflush.c capability.c caps0.h caps1.h chdir.c \ + chmod.c clone.c copy_file_range.c count.c defs.h desc.c \ + dirent.c dirent64.c dm.c empty.h epoll.c evdev.c eventfd.c \ + execve.c fadvise.c fallocate.c fanotify.c fchownat.c fcntl.c \ + fetch_seccomp_fprog.c fetch_struct_flock.c \ + fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ + fetch_struct_stat.c fetch_struct_stat64.c \ + fetch_struct_statfs.c file_handle.c file_ioctl.c fs_x_ioctl.c \ + flock.c flock.h futex.c gcc_compat.h get_robust_list.c \ + getcpu.c getcwd.c getrandom.c hdio.c hostname.c inotify.c io.c \ + ioctl.c ioperm.c iopl.c ioprio.c ipc_defs.h ipc_msg.c \ + ipc_msgctl.c ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c \ + kernel_types.h kexec.c keyctl.c ldt.c link.c linux/asm_stat.h \ + linux/x32/asm_stat.h linux/x86_64/asm_stat.h lookup_dcookie.c \ + loop.c lseek.c mem.c membarrier.c memfd_create.c mknod.c \ + mmsghdr.c mount.c mpers_type.h mq.c msghdr.c msghdr.h mtd.c \ + native_defs.h net.c netlink.c nsig.h numa.c oldstat.c open.c \ + or1k_atomic.c pathtrace.c perf.c perf_event_struct.h \ + personality.c pkeys.c poll.c prctl.c print_dev_t.c \ + print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ + print_sigevent.c print_statfs.c print_struct_stat.c \ + print_time.c print_timespec.c print_timeval.c print_timex.c \ + printmode.c printrusage.c printsiginfo.c printsiginfo.h \ + process.c process_vm.c ptp.c ptrace.h qualify.c quota.c \ + readahead.c readlink.c reboot.c regs.h renameat.c resource.c \ + rtc.c sched.c scsi.c seccomp.c seccomp_fprog.h sendfile.c \ + sg_io_v3.c sg_io_v4.c sigaltstack.c sigevent.h signal.c \ + signalfd.c sigreturn.c sock.c sockaddr.c socketutils.c \ + sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h strace.c \ + swapon.c syscall.c sysctl.c sysent.h sysinfo.c syslog.c \ + sysmips.c term.c time.c times.c truncate.c ubi.c uid.c uid16.c \ + umask.c umount.c uname.c userfaultfd.c ustat.c util.c utime.c \ + utimes.c v4l2.c wait.c xattr.c xlat.h xmalloc.c \ $(am__append_1) -@USE_LIBUNWIND_FALSE@strace_CPPFLAGS = $(AM_CPPFLAGS) -@USE_LIBUNWIND_TRUE@strace_CPPFLAGS = $(AM_CPPFLAGS) $(libunwind_CPPFLAGS) -@USE_LIBUNWIND_TRUE@strace_LDFLAGS = $(libunwind_LDFLAGS) -@USE_LIBUNWIND_TRUE@strace_LDADD = $(libunwind_LIBS) -noinst_HEADERS = defs.h +CODE_COVERAGE_BRANCH_COVERAGE = 1 +CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \ + --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .) + +CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*' + # Enable this to get link map generated -#strace_CFLAGS = $(AM_CFLAGS) -Wl,-Map=strace.mapfile +#strace_LDFLAGS += -Wl,-Map=strace.mapfile EXTRA_DIST = \ $(man_MANS) \ .version \ @@ -562,7 +1062,6 @@ EXTRA_DIST = \ CREDITS \ ChangeLog \ ChangeLog-CVS \ - README-linux \ README-linux-ptrace \ debian/changelog \ debian/compat \ @@ -579,134 +1078,454 @@ EXTRA_DIST = \ debian/strace64.manpages \ debian/watch \ errnoent.sh \ + generate_sen.sh \ + ioctl_iocdef.c \ + ioctlsort.c \ + linux/32/ioctls_inc.h \ + linux/32/ioctls_inc_align16.h \ + linux/32/ioctls_inc_align32.h \ + linux/32/ioctls_inc_align64.h \ + linux/32/syscallent.h \ + linux/64/ioctls_inc.h \ + linux/64/syscallent.h \ + linux/aarch64/arch_regs.c \ + linux/aarch64/arch_regs.h \ + linux/aarch64/arch_sigreturn.c \ linux/aarch64/errnoent1.h \ - linux/aarch64/ioctlent.h.in \ - linux/aarch64/ioctlent1.h \ + linux/aarch64/get_error.c \ + linux/aarch64/get_scno.c \ + linux/aarch64/get_syscall_args.c\ + linux/aarch64/ioctls_arch0.h \ + linux/aarch64/ioctls_arch1.h \ + linux/aarch64/ioctls_inc0.h \ + linux/aarch64/ioctls_inc1.h \ + linux/aarch64/set_error.c \ + linux/aarch64/set_scno.c \ linux/aarch64/signalent1.h \ linux/aarch64/syscallent.h \ linux/aarch64/syscallent1.h \ + linux/alpha/arch_getrval2.c \ + linux/alpha/arch_regs.c \ + linux/alpha/arch_regs.h \ + linux/alpha/arch_sigreturn.c \ linux/alpha/errnoent.h \ - linux/alpha/ioctlent.h.in \ + linux/alpha/get_error.c \ + linux/alpha/get_scno.c \ + linux/alpha/get_syscall_args.c \ + linux/alpha/get_syscall_result.c\ + linux/alpha/ioctls_arch0.h \ + linux/alpha/ioctls_inc0.h \ + linux/alpha/set_error.c \ + linux/alpha/set_scno.c \ linux/alpha/signalent.h \ linux/alpha/syscallent.h \ - linux/arc/ioctlent.h.in \ + linux/alpha/userent.h \ + linux/arc/arch_regs.c \ + linux/arc/get_error.c \ + linux/arc/get_scno.c \ + linux/arc/get_syscall_args.c \ + linux/arc/ioctls_arch0.h \ + linux/arc/ioctls_inc0.h \ + linux/arc/set_error.c \ + linux/arc/set_scno.c \ linux/arc/syscallent.h \ - linux/arm/ioctlent.h.in \ + linux/arch_regs.h \ + linux/arch_sigreturn.c \ + linux/arm/arch_regs.c \ + linux/arm/arch_regs.h \ + linux/arm/arch_sigreturn.c \ + linux/arm/get_error.c \ + linux/arm/get_scno.c \ + linux/arm/get_syscall_args.c \ + linux/arm/ioctls_arch0.h \ + linux/arm/ioctls_inc0.h \ + linux/arm/set_error.c \ + linux/arm/set_scno.c \ linux/arm/syscallent.h \ - linux/avr32/ioctlent.h.in \ + linux/arm/userent.h \ + linux/avr32/arch_regs.c \ + linux/avr32/get_error.c \ + linux/avr32/get_scno.c \ + linux/avr32/get_syscall_args.c \ + linux/avr32/ioctls_arch0.h \ + linux/avr32/ioctls_inc0.h \ + linux/avr32/set_error.c \ + linux/avr32/set_scno.c \ linux/avr32/syscallent.h \ - linux/bfin/ioctlent.h.in \ + linux/avr32/userent.h \ + linux/bfin/arch_regs.c \ + linux/bfin/get_error.c \ + linux/bfin/get_scno.c \ + linux/bfin/get_syscall_args.c \ + linux/bfin/get_syscall_result.c \ + linux/bfin/ioctls_arch0.h \ + linux/bfin/ioctls_inc0.h \ + linux/bfin/set_error.c \ + linux/bfin/set_scno.c \ linux/bfin/syscallent.h \ + linux/bfin/userent.h \ + linux/crisv10/arch_regs.c \ + linux/crisv10/arch_sigreturn.c \ + linux/crisv10/get_error.c \ + linux/crisv10/get_scno.c \ + linux/crisv10/get_syscall_args.c \ + linux/crisv10/get_syscall_result.c \ + linux/crisv10/set_error.c \ + linux/crisv10/set_scno.c \ + linux/crisv10/syscallent.h \ + linux/crisv10/userent.h \ + linux/crisv32/arch_regs.c \ + linux/crisv32/arch_sigreturn.c \ + linux/crisv32/get_error.c \ + linux/crisv32/get_scno.c \ + linux/crisv32/get_syscall_args.c \ + linux/crisv32/get_syscall_result.c \ + linux/crisv32/set_error.c \ + linux/crisv32/set_scno.c \ + linux/crisv32/syscallent.h \ + linux/crisv32/userent.h \ linux/dummy.h \ linux/errnoent.h \ - linux/fanotify.h \ + linux/getregs_old.h \ + linux/hppa/arch_regs.c \ + linux/hppa/arch_regs.h \ linux/hppa/errnoent.h \ - linux/hppa/ioctlent.h.in \ + linux/hppa/get_error.c \ + linux/hppa/get_scno.c \ + linux/hppa/get_syscall_args.c \ + linux/hppa/get_syscall_result.c \ + linux/hppa/ioctls_arch0.h \ + linux/hppa/ioctls_inc0.h \ + linux/hppa/set_error.c \ + linux/hppa/set_scno.c \ linux/hppa/signalent.h \ linux/hppa/syscallent.h \ - linux/i386/ioctlent.h.in \ + linux/i386/arch_regs.c \ + linux/i386/arch_regs.h \ + linux/i386/arch_sigreturn.c \ + linux/i386/get_error.c \ + linux/i386/get_scno.c \ + linux/i386/get_syscall_args.c \ + linux/i386/ioctls_arch0.h \ + linux/i386/ioctls_inc0.h \ + linux/i386/set_error.c \ + linux/i386/set_scno.c \ linux/i386/syscallent.h \ - linux/ia64/ioctlent.h.in \ - linux/ia64/signalent.h \ + linux/i386/userent.h \ + linux/i386/userent0.h \ + linux/ia64/arch_getrval2.c \ + linux/ia64/arch_regs.c \ + linux/ia64/arch_regs.h \ + linux/ia64/arch_sigreturn.c \ + linux/ia64/get_error.c \ + linux/ia64/get_scno.c \ + linux/ia64/get_syscall_args.c \ + linux/ia64/ioctls_arch0.h \ + linux/ia64/ioctls_inc0.h \ + linux/ia64/set_error.c \ + linux/ia64/set_scno.c \ linux/ia64/syscallent.h \ - linux/inotify.h \ - linux/ioctlent-filter.awk \ - linux/ioctlent.h.in \ - linux/ioctlent.sh \ - linux/ioctlsort.c \ - linux/kexec.h \ - linux/keyctl.h \ - linux/m68k/ioctlent.h.in \ + linux/ia64/userent.h \ + linux/inet_diag.h \ + linux/m68k/arch_regs.c \ + linux/m68k/arch_regs.h \ + linux/m68k/arch_sigreturn.c \ + linux/m68k/get_error.c \ + linux/m68k/get_scno.c \ + linux/m68k/get_syscall_args.c \ + linux/m68k/ioctls_arch0.h \ + linux/m68k/ioctls_inc0.h \ + linux/m68k/set_error.c \ + linux/m68k/set_scno.c \ linux/m68k/syscallent.h \ - linux/metag/ioctlent.h.in \ + linux/m68k/userent.h \ + linux/metag/arch_regs.c \ + linux/metag/get_error.c \ + linux/metag/get_scno.c \ + linux/metag/get_syscall_args.c \ + linux/metag/ioctls_arch0.h \ + linux/metag/ioctls_inc0.h \ + linux/metag/set_error.c \ + linux/metag/set_scno.c \ linux/metag/syscallent.h \ - linux/microblaze/ioctlent.h.in \ + linux/microblaze/arch_regs.c \ + linux/microblaze/arch_sigreturn.c \ + linux/microblaze/get_error.c \ + linux/microblaze/get_scno.c \ + linux/microblaze/get_syscall_args.c \ + linux/microblaze/get_syscall_result.c \ + linux/microblaze/ioctls_arch0.h \ + linux/microblaze/ioctls_inc0.h \ + linux/microblaze/set_error.c \ + linux/microblaze/set_scno.c \ linux/microblaze/syscallent.h \ + linux/microblaze/userent.h \ + linux/mips/arch_getrval2.c \ + linux/mips/arch_regs.c \ + linux/mips/arch_regs.h \ + linux/mips/arch_sigreturn.c \ linux/mips/errnoent.h \ - linux/mips/ioctlent.h.in \ - linux/mips/ioctlent.sh \ + linux/mips/genstub.sh \ + linux/mips/get_error.c \ + linux/mips/get_scno.c \ + linux/mips/get_syscall_args.c \ + linux/mips/ioctls_arch0.h \ + linux/mips/ioctls_inc0.h \ + linux/mips/set_error.c \ + linux/mips/set_scno.c \ linux/mips/signalent.h \ linux/mips/syscallent-compat.h \ linux/mips/syscallent-n32.h \ linux/mips/syscallent-n64.h \ linux/mips/syscallent-o32.h \ linux/mips/syscallent.h \ + linux/mips/userent.h \ linux/mtd-abi.h \ - linux/or1k/ioctlent.h.in \ + linux/netlink_diag.h \ + linux/nios2/arch_regs.c \ + linux/nios2/get_error.c \ + linux/nios2/get_scno.c \ + linux/nios2/get_syscall_args.c \ + linux/nios2/ioctls_arch0.h \ + linux/nios2/ioctls_inc0.h \ + linux/nios2/set_error.c \ + linux/nios2/set_scno.c \ + linux/nios2/syscallent.h \ + linux/or1k/arch_regs.c \ + linux/or1k/get_error.c \ + linux/or1k/get_scno.c \ + linux/or1k/get_syscall_args.c \ + linux/or1k/ioctls_arch0.h \ + linux/or1k/ioctls_inc0.h \ + linux/or1k/set_error.c \ + linux/or1k/set_scno.c \ linux/or1k/syscallent.h \ + linux/or1k/userent.h \ linux/personality.h \ - linux/powerpc/errnoent1.h \ - linux/powerpc/ioctlent.h.in \ - linux/powerpc/ioctlent1.h \ - linux/powerpc/signalent1.h \ + linux/powerpc/arch_regs.c \ + linux/powerpc/arch_regs.h \ + linux/powerpc/arch_sigreturn.c \ + linux/powerpc/errnoent.h \ + linux/powerpc/get_error.c \ + linux/powerpc/get_scno.c \ + linux/powerpc/get_syscall_args.c \ + linux/powerpc/getregs_old.c \ + linux/powerpc/getregs_old.h \ + linux/powerpc/ioctls_arch0.h \ + linux/powerpc/ioctls_inc0.h \ + linux/powerpc/set_error.c \ + linux/powerpc/set_scno.c \ linux/powerpc/syscallent.h \ - linux/powerpc/syscallent1.h \ + linux/powerpc/userent.h \ + linux/powerpc64/arch_regs.c \ + linux/powerpc64/arch_regs.h \ + linux/powerpc64/arch_sigreturn.c \ + linux/powerpc64/errnoent.h \ + linux/powerpc64/errnoent1.h \ + linux/powerpc64/get_error.c \ + linux/powerpc64/get_scno.c \ + linux/powerpc64/get_syscall_args.c \ + linux/powerpc64/getregs_old.c \ + linux/powerpc64/getregs_old.h \ + linux/powerpc64/ioctls_arch0.h \ + linux/powerpc64/ioctls_arch1.h \ + linux/powerpc64/ioctls_inc0.h \ + linux/powerpc64/ioctls_inc1.h \ + linux/powerpc64/set_error.c \ + linux/powerpc64/set_scno.c \ + linux/powerpc64/signalent1.h \ + linux/powerpc64/syscallent.h \ + linux/powerpc64/syscallent1.h \ + linux/powerpc64/userent.h \ linux/ptp_clock.h \ - linux/reboot.h \ - linux/s390/ioctlent.h.in \ + linux/riscv/arch_regs.c \ + linux/riscv/errnoent1.h \ + linux/riscv/get_error.c \ + linux/riscv/get_scno.c \ + linux/riscv/get_syscall_args.c \ + linux/riscv/ioctls_arch0.h \ + linux/riscv/ioctls_arch1.h \ + linux/riscv/ioctls_inc0.h \ + linux/riscv/ioctls_inc1.h \ + linux/riscv/set_error.c \ + linux/riscv/set_scno.c \ + linux/riscv/signalent1.h \ + linux/riscv/syscallent.h \ + linux/riscv/syscallent1.h \ + linux/s390/arch_regs.c \ + linux/s390/arch_regs.h \ + linux/s390/arch_sigreturn.c \ + linux/s390/get_error.c \ + linux/s390/get_scno.c \ + linux/s390/get_syscall_args.c \ + linux/s390/ioctls_arch0.h \ + linux/s390/ioctls_inc0.h \ + linux/s390/set_error.c \ + linux/s390/set_scno.c \ linux/s390/syscallent.h \ - linux/s390x/ioctlent.h.in \ + linux/s390/userent.h \ + linux/s390/userent0.h \ + linux/s390/userent1.h \ + linux/s390x/arch_regs.c \ + linux/s390x/arch_regs.h \ + linux/s390x/arch_sigreturn.c \ + linux/s390x/get_error.c \ + linux/s390x/get_scno.c \ + linux/s390x/get_syscall_args.c \ + linux/s390x/ioctls_arch0.h \ + linux/s390x/ioctls_inc0.h \ + linux/s390x/set_error.c \ + linux/s390x/set_scno.c \ linux/s390x/syscallent.h \ - linux/sh/ioctlent.h.in \ + linux/s390x/userent.h \ + linux/sh/arch_getrval2.c \ + linux/sh/arch_regs.c \ + linux/sh/get_error.c \ + linux/sh/get_scno.c \ + linux/sh/get_syscall_args.c \ + linux/sh/get_syscall_result.c \ + linux/sh/ioctls_arch0.h \ + linux/sh/ioctls_inc0.h \ + linux/sh/set_error.c \ + linux/sh/set_scno.c \ linux/sh/syscallent.h \ - linux/sh64/ioctlent.h.in \ + linux/sh/userent.h \ + linux/sh/userent0.h \ + linux/sh64/arch_regs.c \ + linux/sh64/arch_regs.h \ + linux/sh64/get_error.c \ + linux/sh64/get_scno.c \ + linux/sh64/get_syscall_args.c \ + linux/sh64/get_syscall_result.c \ + linux/sh64/ioctls_arch0.h \ + linux/sh64/ioctls_inc0.h \ + linux/sh64/set_error.c \ + linux/sh64/set_scno.c \ linux/sh64/syscallent.h \ + linux/sh64/userent.h \ linux/signalent.h \ - linux/sparc/dummy2.h \ + linux/sock_diag.h \ + linux/sparc/arch_getrval2.c \ + linux/sparc/arch_regs.c \ + linux/sparc/arch_regs.h \ + linux/sparc/arch_sigreturn.c \ linux/sparc/errnoent.h \ - linux/sparc/errnoent1.h \ linux/sparc/gen.pl \ - linux/sparc/ioctlent.h.in \ - linux/sparc/ioctlent1.h \ + linux/sparc/get_error.c \ + linux/sparc/get_scno.c \ + linux/sparc/get_syscall_args.c \ + linux/sparc/ioctls_arch0.h \ + linux/sparc/ioctls_inc0.h \ + linux/sparc/set_error.c \ + linux/sparc/set_scno.c \ linux/sparc/signalent.h \ - linux/sparc/signalent1.h \ - linux/sparc/syscall1.h \ linux/sparc/syscallent.h \ - linux/sparc/syscallent1.h \ - linux/sparc64/dummy2.h \ + linux/sparc/userent.h \ + linux/sparc64/arch_getrval2.c \ + linux/sparc64/arch_regs.c \ + linux/sparc64/arch_regs.h \ + linux/sparc64/arch_sigreturn.c \ linux/sparc64/errnoent.h \ linux/sparc64/errnoent1.h \ - linux/sparc64/errnoent2.h \ - linux/sparc64/ioctlent.h.in \ - linux/sparc64/ioctlent1.h \ - linux/sparc64/ioctlent2.h \ + linux/sparc64/get_error.c \ + linux/sparc64/get_scno.c \ + linux/sparc64/get_syscall_args.c\ + linux/sparc64/ioctls_arch0.h \ + linux/sparc64/ioctls_arch1.h \ + linux/sparc64/ioctls_inc0.h \ + linux/sparc64/ioctls_inc1.h \ + linux/sparc64/set_error.c \ + linux/sparc64/set_scno.c \ linux/sparc64/signalent.h \ linux/sparc64/signalent1.h \ - linux/sparc64/signalent2.h \ - linux/sparc64/syscall1.h \ linux/sparc64/syscallent.h \ linux/sparc64/syscallent1.h \ - linux/sparc64/syscallent2.h \ + linux/sparc64/userent.h \ linux/subcall.h \ linux/syscall.h \ + linux/tile/arch_regs.c \ + linux/tile/arch_regs.h \ + linux/tile/arch_sigreturn.c \ linux/tile/errnoent1.h \ - linux/tile/ioctlent.h.in \ - linux/tile/ioctlent1.h \ + linux/tile/get_error.c \ + linux/tile/get_scno.c \ + linux/tile/get_syscall_args.c \ + linux/tile/ioctls_arch0.h \ + linux/tile/ioctls_arch1.h \ + linux/tile/ioctls_inc0.h \ + linux/tile/ioctls_inc1.h \ + linux/tile/set_error.c \ + linux/tile/set_scno.c \ linux/tile/signalent1.h \ linux/tile/syscallent.h \ linux/tile/syscallent1.h \ + linux/tile/userent.h \ linux/ubi-user.h \ - linux/x32/errnoent.h \ + linux/unix_diag.h \ + linux/userent.h \ + linux/userent0.h \ + linux/x32/arch_regs.c \ + linux/x32/arch_regs.h \ + linux/x32/arch_sigreturn.c \ linux/x32/errnoent1.h \ - linux/x32/ioctlent.h.in \ - linux/x32/ioctlent1.h \ - linux/x32/signalent.h \ + linux/x32/get_error.c \ + linux/x32/get_scno.c \ + linux/x32/get_syscall_args.c \ + linux/x32/ioctls_arch0.h \ + linux/x32/ioctls_arch1.h \ + linux/x32/ioctls_inc0.h \ + linux/x32/ioctls_inc1.h \ + linux/x32/set_error.c \ + linux/x32/set_scno.c \ linux/x32/signalent1.h \ linux/x32/syscallent.h \ linux/x32/syscallent1.h \ + linux/x32/userent.h \ + linux/x86_64/arch_regs.c \ + linux/x86_64/arch_regs.h \ + linux/x86_64/arch_sigreturn.c \ linux/x86_64/errnoent1.h \ linux/x86_64/errnoent2.h \ linux/x86_64/gentab.pl \ - linux/x86_64/ioctlent.h.in \ - linux/x86_64/ioctlent1.h \ - linux/x86_64/ioctlent2.h \ + linux/x86_64/get_error.c \ + linux/x86_64/get_scno.c \ + linux/x86_64/get_syscall_args.c \ + linux/x86_64/getregs_old.c \ + linux/x86_64/getregs_old.h \ + linux/x86_64/ioctls_arch0.h \ + linux/x86_64/ioctls_arch1.h \ + linux/x86_64/ioctls_arch2.h \ + linux/x86_64/ioctls_inc0.h \ + linux/x86_64/ioctls_inc1.h \ + linux/x86_64/ioctls_inc2.h \ + linux/x86_64/set_error.c \ + linux/x86_64/set_scno.c \ linux/x86_64/signalent1.h \ linux/x86_64/signalent2.h \ linux/x86_64/syscallent.h \ linux/x86_64/syscallent1.h \ linux/x86_64/syscallent2.h \ - linux/xtensa/ioctlent.h.in \ + linux/x86_64/userent.h \ + linux/xtensa/arch_regs.c \ + linux/xtensa/get_error.c \ + linux/xtensa/get_scno.c \ + linux/xtensa/get_syscall_args.c \ + linux/xtensa/get_syscall_result.c \ + linux/xtensa/ioctls_arch0.h \ + linux/xtensa/ioctls_inc0.h \ + linux/xtensa/set_error.c \ + linux/xtensa/set_scno.c \ linux/xtensa/syscallent.h \ + linux/xtensa/userent.h \ + maint/ioctls_gen.sh \ + maint/ioctls_hex.sh \ + maint/ioctls_sym.sh \ + maint/print_ioctlent.c \ + mpers.awk \ + mpers.sh \ + mpers_test.sh \ + mpers_xlat.h \ + scno.head \ signalent.sh \ strace-graph \ strace-log-merge \ @@ -717,18 +1536,65 @@ EXTRA_DIST = \ xlat/gen.sh \ xlate.el -BUILT_SOURCES = .version $(am__append_2) $(ioctlent_h) +strace_SOURCES_c = \ + $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES)) + +syscallent_names = subcall.h syscallent.h syscallent1.h \ + syscallent-n32.h syscallent-n64.h syscallent-o32.h + +syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names)) +syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST)) today = $(shell date +%Y-%m-%d) version_regexp = $(subst .,\.,$(VERSION)) news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))' +ioctlsort_CC = $(CC_FOR_BUILD) +ioctlsort_DEFS = $(DEFS) +ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES) +ioctlsort_CPPFLAGS = $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) +ioctlsort_CFLAGS = $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) +ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) +ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h) +ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h)) +ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h))) +BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) native_printer_decls.h \ + native_printer_defs.h printers.h sen.h sys_func.h .version \ + $(am__append_7) $(am__append_11) +CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \ + ioctl_iocdef.h ioctl_iocdef.i native_printer_decls.h \ + native_printer_defs.h printers.h sen.h sys_func.h syscallent.i \ + scno.h $(am__append_8) $(am__append_12) +DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h +SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) + +digits = [[:digit:]][[:digit:]]* +al_nums = [[:alnum:]_][[:alnum:]_]* +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p + +# Generated by ./generate_mpers_am.sh; do not edit. +mpers_source_files = block.c btrfs.c dirent.c evdev.c fetch_seccomp_fprog.c fetch_struct_flock.c fetch_struct_mmsghdr.c fetch_struct_msghdr.c fetch_struct_stat.c fetch_struct_stat64.c fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c print_sigevent.c print_time.c print_timespec.c print_timeval.c print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c + +# defines mpers_source_files +srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files)) +mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i) +mpers_NAME = +mpers_PREFIX = $(mpers_NAME)_ +mpers_DEFS = $(DEFS) +mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES) +mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS) +mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS) +libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS +libmpers_CFLAGS = $(strace_CFLAGS) +mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$ +@HAVE_M32_MPERS_TRUE@libmpers_m32_a_SOURCES = $(mpers_source_files) +@HAVE_M32_MPERS_TRUE@libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32 +@HAVE_M32_MPERS_TRUE@libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS) +@HAVE_M32_MPERS_TRUE@mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h +@HAVE_MX32_MPERS_TRUE@libmpers_mx32_a_SOURCES = $(mpers_source_files) +@HAVE_MX32_MPERS_TRUE@libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32 +@HAVE_MX32_MPERS_TRUE@libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS) +@HAVE_MX32_MPERS_TRUE@mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h @MAINTAINER_MODE_TRUE@gen_changelog_start_date = 2009-07-08 20:00 -@MAINTAINER_MODE_TRUE@IOCTLDIR = /usr/include -@MAINTAINER_MODE_TRUE@IOCTLASM = asm -@MAINTAINER_MODE_TRUE@IOCTLSORT_INCLUDEDIR = $(IOCTLDIR) -@MAINTAINER_MODE_TRUE@ioctlent_h_in = linux/ioctlent.h.in -ioctlent_h = $(builddir)/$(OS)/ioctlent.h -CLEANFILES = $(ioctlent_h) -ioctlent_h_deps = $(srcdir)/$(OS)/ioctlent.h.in $(srcdir)/$(OS)/$(ARCH)/ioctlent.h.in all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -736,7 +1602,7 @@ all: $(BUILT_SOURCES) config.h .SUFFIXES: .c .o .obj am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/xlat/Makemodule.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/xlat/Makemodule.am $(srcdir)/scno.am $(srcdir)/mpers.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -759,7 +1625,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/xlat/Makemodule.am: +$(srcdir)/xlat/Makemodule.am $(srcdir)/scno.am $(srcdir)/mpers.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -784,6 +1650,28 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 +strace.spec: $(top_builddir)/config.status $(srcdir)/strace.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +debian/changelog: $(top_builddir)/config.status $(top_srcdir)/debian/changelog.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +libmpers-m32.a: $(libmpers_m32_a_OBJECTS) $(libmpers_m32_a_DEPENDENCIES) $(EXTRA_libmpers_m32_a_DEPENDENCIES) + $(AM_V_at)-rm -f libmpers-m32.a + $(AM_V_AR)$(libmpers_m32_a_AR) libmpers-m32.a $(libmpers_m32_a_OBJECTS) $(libmpers_m32_a_LIBADD) + $(AM_V_at)$(RANLIB) libmpers-m32.a + +libmpers-mx32.a: $(libmpers_mx32_a_OBJECTS) $(libmpers_mx32_a_DEPENDENCIES) $(EXTRA_libmpers_mx32_a_DEPENDENCIES) + $(AM_V_at)-rm -f libmpers-mx32.a + $(AM_V_AR)$(libmpers_mx32_a_AR) libmpers-mx32.a $(libmpers_mx32_a_OBJECTS) $(libmpers_mx32_a_LIBADD) + $(AM_V_at)$(RANLIB) libmpers-mx32.a + +libstrace.a: $(libstrace_a_OBJECTS) $(libstrace_a_DEPENDENCIES) $(EXTRA_libstrace_a_DEPENDENCIES) + $(AM_V_at)-rm -f libstrace.a + $(AM_V_AR)$(libstrace_a_AR) libstrace.a $(libstrace_a_OBJECTS) $(libstrace_a_LIBADD) + $(AM_V_at)$(RANLIB) libstrace.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -872,43 +1760,241 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-block.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-btrfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-dirent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-evdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-hdio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-mtd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_mq_attr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_msgbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_sigevent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timespec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timeval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-printrusage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-printsiginfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-rtc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sg_io_v3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sigaltstack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sysinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-times.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ustat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-utime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-v4l2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-block.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-btrfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-dirent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-evdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-hdio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-mtd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_sigevent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timespec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timeval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-printrusage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-printsiginfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-rtc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sigaltstack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sysinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-times.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ustat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-utime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-v4l2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-socketcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-statfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sync_file_range.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sync_file_range2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-upeek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-upoke.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-access.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-affinity.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-aio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-alpha.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bjm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-block.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bpf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-btrfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-cacheflush.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-capability.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-chdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-chmod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-clone.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-copy_file_range.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-count.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-desc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dirent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dirent64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-epoll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-evdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-eventfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-execve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fadvise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fallocate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fanotify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fchownat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fcntl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_seccomp_fprog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_flock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_mmsghdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_msghdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_stat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-file_handle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-file_ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-flock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fs_x_ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-futex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-get_robust_list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getcpu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getcwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getrandom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-hdio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-hostname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-inotify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioperm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-iopl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioprio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_msgctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_sem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_shm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_shmctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kexec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-keyctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ldt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-link.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-lookup_dcookie.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-lseek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-membarrier.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-memfd_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mknod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mmsghdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-msghdr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mtd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-net.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-numa.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-oldstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-or1k_atomic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-pathtrace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-perf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-personality.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-pkeys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-poll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-prctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_dev_t.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_mq_attr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_msgbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_sg_req_info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_sigevent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_struct_stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timespec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timeval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printmode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printrusage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printsiginfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-process.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-process_vm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ptp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-qualify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-quota.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-readahead.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-readlink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-reboot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-renameat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-resource.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sched.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-scsi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-seccomp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sendfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sg_io_v3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sg_io_v4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sigaltstack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-signalfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sigreturn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sockaddr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-socketutils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sram_alloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-stat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-statfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-strace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-swapon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-syscall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-system.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-syslog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysmips.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-term.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-times.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-truncate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ubi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uid16.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-umask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-umount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-unwind.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-userfaultfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ustat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-vsprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-utime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-utimes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-v4l2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-wait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-xattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-xmalloc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -924,523 +2010,3295 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -strace-aio.o: aio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-aio.o -MD -MP -MF $(DEPDIR)/strace-aio.Tpo -c -o strace-aio.o `test -f 'aio.c' || echo '$(srcdir)/'`aio.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-aio.Tpo $(DEPDIR)/strace-aio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aio.c' object='strace-aio.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-block.o: block.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-block.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-block.Tpo -c -o libmpers_m32_a-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-block.Tpo $(DEPDIR)/libmpers_m32_a-block.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='libmpers_m32_a-block.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-aio.o `test -f 'aio.c' || echo '$(srcdir)/'`aio.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c -strace-aio.obj: aio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-aio.obj -MD -MP -MF $(DEPDIR)/strace-aio.Tpo -c -o strace-aio.obj `if test -f 'aio.c'; then $(CYGPATH_W) 'aio.c'; else $(CYGPATH_W) '$(srcdir)/aio.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-aio.Tpo $(DEPDIR)/strace-aio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aio.c' object='strace-aio.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-block.obj: block.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-block.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-block.Tpo -c -o libmpers_m32_a-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-block.Tpo $(DEPDIR)/libmpers_m32_a-block.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='libmpers_m32_a-block.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-aio.obj `if test -f 'aio.c'; then $(CYGPATH_W) 'aio.c'; else $(CYGPATH_W) '$(srcdir)/aio.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` -strace-bjm.o: bjm.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-bjm.o -MD -MP -MF $(DEPDIR)/strace-bjm.Tpo -c -o strace-bjm.o `test -f 'bjm.c' || echo '$(srcdir)/'`bjm.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bjm.Tpo $(DEPDIR)/strace-bjm.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bjm.c' object='strace-bjm.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-btrfs.o: btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-btrfs.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-btrfs.Tpo -c -o libmpers_m32_a-btrfs.o `test -f 'btrfs.c' || echo '$(srcdir)/'`btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-btrfs.Tpo $(DEPDIR)/libmpers_m32_a-btrfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btrfs.c' object='libmpers_m32_a-btrfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-bjm.o `test -f 'bjm.c' || echo '$(srcdir)/'`bjm.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-btrfs.o `test -f 'btrfs.c' || echo '$(srcdir)/'`btrfs.c -strace-bjm.obj: bjm.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-bjm.obj -MD -MP -MF $(DEPDIR)/strace-bjm.Tpo -c -o strace-bjm.obj `if test -f 'bjm.c'; then $(CYGPATH_W) 'bjm.c'; else $(CYGPATH_W) '$(srcdir)/bjm.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bjm.Tpo $(DEPDIR)/strace-bjm.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bjm.c' object='strace-bjm.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-btrfs.obj: btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-btrfs.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-btrfs.Tpo -c -o libmpers_m32_a-btrfs.obj `if test -f 'btrfs.c'; then $(CYGPATH_W) 'btrfs.c'; else $(CYGPATH_W) '$(srcdir)/btrfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-btrfs.Tpo $(DEPDIR)/libmpers_m32_a-btrfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btrfs.c' object='libmpers_m32_a-btrfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-bjm.obj `if test -f 'bjm.c'; then $(CYGPATH_W) 'bjm.c'; else $(CYGPATH_W) '$(srcdir)/bjm.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-btrfs.obj `if test -f 'btrfs.c'; then $(CYGPATH_W) 'btrfs.c'; else $(CYGPATH_W) '$(srcdir)/btrfs.c'; fi` -strace-block.o: block.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-block.o -MD -MP -MF $(DEPDIR)/strace-block.Tpo -c -o strace-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-block.Tpo $(DEPDIR)/strace-block.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='strace-block.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-dirent.o: dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-dirent.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-dirent.Tpo -c -o libmpers_m32_a-dirent.o `test -f 'dirent.c' || echo '$(srcdir)/'`dirent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-dirent.Tpo $(DEPDIR)/libmpers_m32_a-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent.c' object='libmpers_m32_a-dirent.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-dirent.o `test -f 'dirent.c' || echo '$(srcdir)/'`dirent.c -strace-block.obj: block.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-block.obj -MD -MP -MF $(DEPDIR)/strace-block.Tpo -c -o strace-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-block.Tpo $(DEPDIR)/strace-block.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='strace-block.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-dirent.obj: dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-dirent.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-dirent.Tpo -c -o libmpers_m32_a-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-dirent.Tpo $(DEPDIR)/libmpers_m32_a-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent.c' object='libmpers_m32_a-dirent.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` -strace-count.o: count.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-count.o -MD -MP -MF $(DEPDIR)/strace-count.Tpo -c -o strace-count.o `test -f 'count.c' || echo '$(srcdir)/'`count.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-count.Tpo $(DEPDIR)/strace-count.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='count.c' object='strace-count.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-evdev.o: evdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-evdev.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-evdev.Tpo -c -o libmpers_m32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-evdev.Tpo $(DEPDIR)/libmpers_m32_a-evdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_m32_a-evdev.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-count.o `test -f 'count.c' || echo '$(srcdir)/'`count.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c -strace-count.obj: count.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-count.obj -MD -MP -MF $(DEPDIR)/strace-count.Tpo -c -o strace-count.obj `if test -f 'count.c'; then $(CYGPATH_W) 'count.c'; else $(CYGPATH_W) '$(srcdir)/count.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-count.Tpo $(DEPDIR)/strace-count.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='count.c' object='strace-count.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-evdev.obj: evdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-evdev.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-evdev.Tpo -c -o libmpers_m32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-evdev.Tpo $(DEPDIR)/libmpers_m32_a-evdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_m32_a-evdev.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-count.obj `if test -f 'count.c'; then $(CYGPATH_W) 'count.c'; else $(CYGPATH_W) '$(srcdir)/count.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` -strace-desc.o: desc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-desc.o -MD -MP -MF $(DEPDIR)/strace-desc.Tpo -c -o strace-desc.o `test -f 'desc.c' || echo '$(srcdir)/'`desc.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-desc.Tpo $(DEPDIR)/strace-desc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desc.c' object='strace-desc.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_seccomp_fprog.o: fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_seccomp_fprog.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_m32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_m32_a-fetch_seccomp_fprog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-desc.o `test -f 'desc.c' || echo '$(srcdir)/'`desc.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c -strace-desc.obj: desc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-desc.obj -MD -MP -MF $(DEPDIR)/strace-desc.Tpo -c -o strace-desc.obj `if test -f 'desc.c'; then $(CYGPATH_W) 'desc.c'; else $(CYGPATH_W) '$(srcdir)/desc.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-desc.Tpo $(DEPDIR)/strace-desc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desc.c' object='strace-desc.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_seccomp_fprog.obj: fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_seccomp_fprog.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_m32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_m32_a-fetch_seccomp_fprog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-desc.obj `if test -f 'desc.c'; then $(CYGPATH_W) 'desc.c'; else $(CYGPATH_W) '$(srcdir)/desc.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` -strace-fanotify.o: fanotify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-fanotify.o -MD -MP -MF $(DEPDIR)/strace-fanotify.Tpo -c -o strace-fanotify.o `test -f 'fanotify.c' || echo '$(srcdir)/'`fanotify.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fanotify.Tpo $(DEPDIR)/strace-fanotify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fanotify.c' object='strace-fanotify.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_flock.o: fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_flock.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Tpo -c -o libmpers_m32_a-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_flock.c' object='libmpers_m32_a-fetch_struct_flock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-fanotify.o `test -f 'fanotify.c' || echo '$(srcdir)/'`fanotify.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c -strace-fanotify.obj: fanotify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-fanotify.obj -MD -MP -MF $(DEPDIR)/strace-fanotify.Tpo -c -o strace-fanotify.obj `if test -f 'fanotify.c'; then $(CYGPATH_W) 'fanotify.c'; else $(CYGPATH_W) '$(srcdir)/fanotify.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fanotify.Tpo $(DEPDIR)/strace-fanotify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fanotify.c' object='strace-fanotify.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_flock.obj: fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_flock.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Tpo -c -o libmpers_m32_a-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_flock.c' object='libmpers_m32_a-fetch_struct_flock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-fanotify.obj `if test -f 'fanotify.c'; then $(CYGPATH_W) 'fanotify.c'; else $(CYGPATH_W) '$(srcdir)/fanotify.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` -strace-file.o: file.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-file.o -MD -MP -MF $(DEPDIR)/strace-file.Tpo -c -o strace-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-file.Tpo $(DEPDIR)/strace-file.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file.c' object='strace-file.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_mmsghdr.o: fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_mmsghdr.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Tpo -c -o libmpers_m32_a-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_mmsghdr.c' object='libmpers_m32_a-fetch_struct_mmsghdr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c -strace-file.obj: file.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-file.obj -MD -MP -MF $(DEPDIR)/strace-file.Tpo -c -o strace-file.obj `if test -f 'file.c'; then $(CYGPATH_W) 'file.c'; else $(CYGPATH_W) '$(srcdir)/file.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-file.Tpo $(DEPDIR)/strace-file.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file.c' object='strace-file.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_mmsghdr.obj: fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_mmsghdr.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Tpo -c -o libmpers_m32_a-fetch_struct_mmsghdr.obj `if test -f 'fetch_struct_mmsghdr.c'; then $(CYGPATH_W) 'fetch_struct_mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_mmsghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_mmsghdr.c' object='libmpers_m32_a-fetch_struct_mmsghdr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-file.obj `if test -f 'file.c'; then $(CYGPATH_W) 'file.c'; else $(CYGPATH_W) '$(srcdir)/file.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_mmsghdr.obj `if test -f 'fetch_struct_mmsghdr.c'; then $(CYGPATH_W) 'fetch_struct_mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_mmsghdr.c'; fi` -strace-inotify.o: inotify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-inotify.o -MD -MP -MF $(DEPDIR)/strace-inotify.Tpo -c -o strace-inotify.o `test -f 'inotify.c' || echo '$(srcdir)/'`inotify.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-inotify.Tpo $(DEPDIR)/strace-inotify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inotify.c' object='strace-inotify.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_msghdr.o: fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_msghdr.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Tpo -c -o libmpers_m32_a-fetch_struct_msghdr.o `test -f 'fetch_struct_msghdr.c' || echo '$(srcdir)/'`fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_msghdr.c' object='libmpers_m32_a-fetch_struct_msghdr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-inotify.o `test -f 'inotify.c' || echo '$(srcdir)/'`inotify.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_msghdr.o `test -f 'fetch_struct_msghdr.c' || echo '$(srcdir)/'`fetch_struct_msghdr.c -strace-inotify.obj: inotify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-inotify.obj -MD -MP -MF $(DEPDIR)/strace-inotify.Tpo -c -o strace-inotify.obj `if test -f 'inotify.c'; then $(CYGPATH_W) 'inotify.c'; else $(CYGPATH_W) '$(srcdir)/inotify.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-inotify.Tpo $(DEPDIR)/strace-inotify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inotify.c' object='strace-inotify.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_msghdr.obj: fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_msghdr.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Tpo -c -o libmpers_m32_a-fetch_struct_msghdr.obj `if test -f 'fetch_struct_msghdr.c'; then $(CYGPATH_W) 'fetch_struct_msghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_msghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_msghdr.c' object='libmpers_m32_a-fetch_struct_msghdr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-inotify.obj `if test -f 'inotify.c'; then $(CYGPATH_W) 'inotify.c'; else $(CYGPATH_W) '$(srcdir)/inotify.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_msghdr.obj `if test -f 'fetch_struct_msghdr.c'; then $(CYGPATH_W) 'fetch_struct_msghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_msghdr.c'; fi` -strace-io.o: io.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-io.o -MD -MP -MF $(DEPDIR)/strace-io.Tpo -c -o strace-io.o `test -f 'io.c' || echo '$(srcdir)/'`io.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-io.Tpo $(DEPDIR)/strace-io.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io.c' object='strace-io.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_stat.o: fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_stat.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Tpo -c -o libmpers_m32_a-fetch_struct_stat.o `test -f 'fetch_struct_stat.c' || echo '$(srcdir)/'`fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat.c' object='libmpers_m32_a-fetch_struct_stat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-io.o `test -f 'io.c' || echo '$(srcdir)/'`io.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_stat.o `test -f 'fetch_struct_stat.c' || echo '$(srcdir)/'`fetch_struct_stat.c -strace-io.obj: io.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-io.obj -MD -MP -MF $(DEPDIR)/strace-io.Tpo -c -o strace-io.obj `if test -f 'io.c'; then $(CYGPATH_W) 'io.c'; else $(CYGPATH_W) '$(srcdir)/io.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-io.Tpo $(DEPDIR)/strace-io.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io.c' object='strace-io.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_stat.obj: fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_stat.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Tpo -c -o libmpers_m32_a-fetch_struct_stat.obj `if test -f 'fetch_struct_stat.c'; then $(CYGPATH_W) 'fetch_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat.c' object='libmpers_m32_a-fetch_struct_stat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-io.obj `if test -f 'io.c'; then $(CYGPATH_W) 'io.c'; else $(CYGPATH_W) '$(srcdir)/io.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_stat.obj `if test -f 'fetch_struct_stat.c'; then $(CYGPATH_W) 'fetch_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat.c'; fi` -strace-ioctl.o: ioctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ioctl.o -MD -MP -MF $(DEPDIR)/strace-ioctl.Tpo -c -o strace-ioctl.o `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioctl.Tpo $(DEPDIR)/strace-ioctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioctl.c' object='strace-ioctl.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_stat64.o: fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_stat64.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Tpo -c -o libmpers_m32_a-fetch_struct_stat64.o `test -f 'fetch_struct_stat64.c' || echo '$(srcdir)/'`fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat64.c' object='libmpers_m32_a-fetch_struct_stat64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ioctl.o `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_stat64.o `test -f 'fetch_struct_stat64.c' || echo '$(srcdir)/'`fetch_struct_stat64.c -strace-ioctl.obj: ioctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ioctl.obj -MD -MP -MF $(DEPDIR)/strace-ioctl.Tpo -c -o strace-ioctl.obj `if test -f 'ioctl.c'; then $(CYGPATH_W) 'ioctl.c'; else $(CYGPATH_W) '$(srcdir)/ioctl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioctl.Tpo $(DEPDIR)/strace-ioctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioctl.c' object='strace-ioctl.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_stat64.obj: fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_stat64.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Tpo -c -o libmpers_m32_a-fetch_struct_stat64.obj `if test -f 'fetch_struct_stat64.c'; then $(CYGPATH_W) 'fetch_struct_stat64.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat64.c' object='libmpers_m32_a-fetch_struct_stat64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ioctl.obj `if test -f 'ioctl.c'; then $(CYGPATH_W) 'ioctl.c'; else $(CYGPATH_W) '$(srcdir)/ioctl.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_stat64.obj `if test -f 'fetch_struct_stat64.c'; then $(CYGPATH_W) 'fetch_struct_stat64.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat64.c'; fi` -strace-ioprio.o: ioprio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ioprio.o -MD -MP -MF $(DEPDIR)/strace-ioprio.Tpo -c -o strace-ioprio.o `test -f 'ioprio.c' || echo '$(srcdir)/'`ioprio.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioprio.Tpo $(DEPDIR)/strace-ioprio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioprio.c' object='strace-ioprio.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_statfs.o: fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_statfs.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Tpo -c -o libmpers_m32_a-fetch_struct_statfs.o `test -f 'fetch_struct_statfs.c' || echo '$(srcdir)/'`fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_statfs.c' object='libmpers_m32_a-fetch_struct_statfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ioprio.o `test -f 'ioprio.c' || echo '$(srcdir)/'`ioprio.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_statfs.o `test -f 'fetch_struct_statfs.c' || echo '$(srcdir)/'`fetch_struct_statfs.c -strace-ioprio.obj: ioprio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ioprio.obj -MD -MP -MF $(DEPDIR)/strace-ioprio.Tpo -c -o strace-ioprio.obj `if test -f 'ioprio.c'; then $(CYGPATH_W) 'ioprio.c'; else $(CYGPATH_W) '$(srcdir)/ioprio.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioprio.Tpo $(DEPDIR)/strace-ioprio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioprio.c' object='strace-ioprio.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_struct_statfs.obj: fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_statfs.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Tpo -c -o libmpers_m32_a-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_statfs.c' object='libmpers_m32_a-fetch_struct_statfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ioprio.obj `if test -f 'ioprio.c'; then $(CYGPATH_W) 'ioprio.c'; else $(CYGPATH_W) '$(srcdir)/ioprio.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` -strace-ipc.o: ipc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ipc.o -MD -MP -MF $(DEPDIR)/strace-ipc.Tpo -c -o strace-ipc.o `test -f 'ipc.c' || echo '$(srcdir)/'`ipc.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc.Tpo $(DEPDIR)/strace-ipc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc.c' object='strace-ipc.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-hdio.o: hdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-hdio.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-hdio.Tpo -c -o libmpers_m32_a-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-hdio.Tpo $(DEPDIR)/libmpers_m32_a-hdio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdio.c' object='libmpers_m32_a-hdio.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ipc.o `test -f 'ipc.c' || echo '$(srcdir)/'`ipc.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c -strace-ipc.obj: ipc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ipc.obj -MD -MP -MF $(DEPDIR)/strace-ipc.Tpo -c -o strace-ipc.obj `if test -f 'ipc.c'; then $(CYGPATH_W) 'ipc.c'; else $(CYGPATH_W) '$(srcdir)/ipc.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc.Tpo $(DEPDIR)/strace-ipc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc.c' object='strace-ipc.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-hdio.obj: hdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-hdio.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-hdio.Tpo -c -o libmpers_m32_a-hdio.obj `if test -f 'hdio.c'; then $(CYGPATH_W) 'hdio.c'; else $(CYGPATH_W) '$(srcdir)/hdio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-hdio.Tpo $(DEPDIR)/libmpers_m32_a-hdio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdio.c' object='libmpers_m32_a-hdio.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ipc.obj `if test -f 'ipc.c'; then $(CYGPATH_W) 'ipc.c'; else $(CYGPATH_W) '$(srcdir)/ipc.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-hdio.obj `if test -f 'hdio.c'; then $(CYGPATH_W) 'hdio.c'; else $(CYGPATH_W) '$(srcdir)/hdio.c'; fi` -strace-kexec.o: kexec.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-kexec.o -MD -MP -MF $(DEPDIR)/strace-kexec.Tpo -c -o strace-kexec.o `test -f 'kexec.c' || echo '$(srcdir)/'`kexec.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kexec.Tpo $(DEPDIR)/strace-kexec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kexec.c' object='strace-kexec.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-ipc_msgctl.o: ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-ipc_msgctl.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-ipc_msgctl.Tpo -c -o libmpers_m32_a-ipc_msgctl.o `test -f 'ipc_msgctl.c' || echo '$(srcdir)/'`ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-ipc_msgctl.Tpo $(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msgctl.c' object='libmpers_m32_a-ipc_msgctl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-kexec.o `test -f 'kexec.c' || echo '$(srcdir)/'`kexec.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-ipc_msgctl.o `test -f 'ipc_msgctl.c' || echo '$(srcdir)/'`ipc_msgctl.c -strace-kexec.obj: kexec.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-kexec.obj -MD -MP -MF $(DEPDIR)/strace-kexec.Tpo -c -o strace-kexec.obj `if test -f 'kexec.c'; then $(CYGPATH_W) 'kexec.c'; else $(CYGPATH_W) '$(srcdir)/kexec.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kexec.Tpo $(DEPDIR)/strace-kexec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kexec.c' object='strace-kexec.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-ipc_msgctl.obj: ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-ipc_msgctl.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-ipc_msgctl.Tpo -c -o libmpers_m32_a-ipc_msgctl.obj `if test -f 'ipc_msgctl.c'; then $(CYGPATH_W) 'ipc_msgctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msgctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-ipc_msgctl.Tpo $(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msgctl.c' object='libmpers_m32_a-ipc_msgctl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-kexec.obj `if test -f 'kexec.c'; then $(CYGPATH_W) 'kexec.c'; else $(CYGPATH_W) '$(srcdir)/kexec.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-ipc_msgctl.obj `if test -f 'ipc_msgctl.c'; then $(CYGPATH_W) 'ipc_msgctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msgctl.c'; fi` -strace-keyctl.o: keyctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-keyctl.o -MD -MP -MF $(DEPDIR)/strace-keyctl.Tpo -c -o strace-keyctl.o `test -f 'keyctl.c' || echo '$(srcdir)/'`keyctl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-keyctl.Tpo $(DEPDIR)/strace-keyctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyctl.c' object='strace-keyctl.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-ipc_shmctl.o: ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-ipc_shmctl.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-ipc_shmctl.Tpo -c -o libmpers_m32_a-ipc_shmctl.o `test -f 'ipc_shmctl.c' || echo '$(srcdir)/'`ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-ipc_shmctl.Tpo $(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shmctl.c' object='libmpers_m32_a-ipc_shmctl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-keyctl.o `test -f 'keyctl.c' || echo '$(srcdir)/'`keyctl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-ipc_shmctl.o `test -f 'ipc_shmctl.c' || echo '$(srcdir)/'`ipc_shmctl.c -strace-keyctl.obj: keyctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-keyctl.obj -MD -MP -MF $(DEPDIR)/strace-keyctl.Tpo -c -o strace-keyctl.obj `if test -f 'keyctl.c'; then $(CYGPATH_W) 'keyctl.c'; else $(CYGPATH_W) '$(srcdir)/keyctl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-keyctl.Tpo $(DEPDIR)/strace-keyctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyctl.c' object='strace-keyctl.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-ipc_shmctl.obj: ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-ipc_shmctl.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-ipc_shmctl.Tpo -c -o libmpers_m32_a-ipc_shmctl.obj `if test -f 'ipc_shmctl.c'; then $(CYGPATH_W) 'ipc_shmctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shmctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-ipc_shmctl.Tpo $(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shmctl.c' object='libmpers_m32_a-ipc_shmctl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-keyctl.obj `if test -f 'keyctl.c'; then $(CYGPATH_W) 'keyctl.c'; else $(CYGPATH_W) '$(srcdir)/keyctl.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-ipc_shmctl.obj `if test -f 'ipc_shmctl.c'; then $(CYGPATH_W) 'ipc_shmctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shmctl.c'; fi` -strace-ldt.o: ldt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ldt.o -MD -MP -MF $(DEPDIR)/strace-ldt.Tpo -c -o strace-ldt.o `test -f 'ldt.c' || echo '$(srcdir)/'`ldt.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ldt.Tpo $(DEPDIR)/strace-ldt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldt.c' object='strace-ldt.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-loop.o: loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-loop.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-loop.Tpo -c -o libmpers_m32_a-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-loop.Tpo $(DEPDIR)/libmpers_m32_a-loop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='libmpers_m32_a-loop.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ldt.o `test -f 'ldt.c' || echo '$(srcdir)/'`ldt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c -strace-ldt.obj: ldt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ldt.obj -MD -MP -MF $(DEPDIR)/strace-ldt.Tpo -c -o strace-ldt.obj `if test -f 'ldt.c'; then $(CYGPATH_W) 'ldt.c'; else $(CYGPATH_W) '$(srcdir)/ldt.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ldt.Tpo $(DEPDIR)/strace-ldt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldt.c' object='strace-ldt.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-loop.obj: loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-loop.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-loop.Tpo -c -o libmpers_m32_a-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-loop.Tpo $(DEPDIR)/libmpers_m32_a-loop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='libmpers_m32_a-loop.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ldt.obj `if test -f 'ldt.c'; then $(CYGPATH_W) 'ldt.c'; else $(CYGPATH_W) '$(srcdir)/ldt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` -strace-loop.o: loop.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-loop.o -MD -MP -MF $(DEPDIR)/strace-loop.Tpo -c -o strace-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-loop.Tpo $(DEPDIR)/strace-loop.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='strace-loop.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-mtd.o: mtd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-mtd.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-mtd.Tpo -c -o libmpers_m32_a-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-mtd.Tpo $(DEPDIR)/libmpers_m32_a-mtd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='libmpers_m32_a-mtd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c -strace-loop.obj: loop.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-loop.obj -MD -MP -MF $(DEPDIR)/strace-loop.Tpo -c -o strace-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-loop.Tpo $(DEPDIR)/strace-loop.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='strace-loop.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-mtd.obj: mtd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-mtd.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-mtd.Tpo -c -o libmpers_m32_a-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-mtd.Tpo $(DEPDIR)/libmpers_m32_a-mtd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='libmpers_m32_a-mtd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` -strace-mem.o: mem.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-mem.o -MD -MP -MF $(DEPDIR)/strace-mem.Tpo -c -o strace-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mem.Tpo $(DEPDIR)/strace-mem.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mem.c' object='strace-mem.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_mq_attr.o: print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_mq_attr.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_mq_attr.Tpo -c -o libmpers_m32_a-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_mq_attr.Tpo $(DEPDIR)/libmpers_m32_a-print_mq_attr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mq_attr.c' object='libmpers_m32_a-print_mq_attr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c -strace-mem.obj: mem.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-mem.obj -MD -MP -MF $(DEPDIR)/strace-mem.Tpo -c -o strace-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mem.Tpo $(DEPDIR)/strace-mem.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mem.c' object='strace-mem.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_mq_attr.obj: print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_mq_attr.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_mq_attr.Tpo -c -o libmpers_m32_a-print_mq_attr.obj `if test -f 'print_mq_attr.c'; then $(CYGPATH_W) 'print_mq_attr.c'; else $(CYGPATH_W) '$(srcdir)/print_mq_attr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_mq_attr.Tpo $(DEPDIR)/libmpers_m32_a-print_mq_attr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mq_attr.c' object='libmpers_m32_a-print_mq_attr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_mq_attr.obj `if test -f 'print_mq_attr.c'; then $(CYGPATH_W) 'print_mq_attr.c'; else $(CYGPATH_W) '$(srcdir)/print_mq_attr.c'; fi` -strace-mtd.o: mtd.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-mtd.o -MD -MP -MF $(DEPDIR)/strace-mtd.Tpo -c -o strace-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mtd.Tpo $(DEPDIR)/strace-mtd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='strace-mtd.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_msgbuf.o: print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_msgbuf.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_msgbuf.Tpo -c -o libmpers_m32_a-print_msgbuf.o `test -f 'print_msgbuf.c' || echo '$(srcdir)/'`print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_msgbuf.Tpo $(DEPDIR)/libmpers_m32_a-print_msgbuf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_msgbuf.c' object='libmpers_m32_a-print_msgbuf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_msgbuf.o `test -f 'print_msgbuf.c' || echo '$(srcdir)/'`print_msgbuf.c -strace-mtd.obj: mtd.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-mtd.obj -MD -MP -MF $(DEPDIR)/strace-mtd.Tpo -c -o strace-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mtd.Tpo $(DEPDIR)/strace-mtd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='strace-mtd.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_msgbuf.obj: print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_msgbuf.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_msgbuf.Tpo -c -o libmpers_m32_a-print_msgbuf.obj `if test -f 'print_msgbuf.c'; then $(CYGPATH_W) 'print_msgbuf.c'; else $(CYGPATH_W) '$(srcdir)/print_msgbuf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_msgbuf.Tpo $(DEPDIR)/libmpers_m32_a-print_msgbuf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_msgbuf.c' object='libmpers_m32_a-print_msgbuf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_msgbuf.obj `if test -f 'print_msgbuf.c'; then $(CYGPATH_W) 'print_msgbuf.c'; else $(CYGPATH_W) '$(srcdir)/print_msgbuf.c'; fi` -strace-net.o: net.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-net.o -MD -MP -MF $(DEPDIR)/strace-net.Tpo -c -o strace-net.o `test -f 'net.c' || echo '$(srcdir)/'`net.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-net.Tpo $(DEPDIR)/strace-net.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='net.c' object='strace-net.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_sg_req_info.o: print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_sg_req_info.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_sg_req_info.Tpo -c -o libmpers_m32_a-print_sg_req_info.o `test -f 'print_sg_req_info.c' || echo '$(srcdir)/'`print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_sg_req_info.Tpo $(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sg_req_info.c' object='libmpers_m32_a-print_sg_req_info.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-net.o `test -f 'net.c' || echo '$(srcdir)/'`net.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_sg_req_info.o `test -f 'print_sg_req_info.c' || echo '$(srcdir)/'`print_sg_req_info.c -strace-net.obj: net.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-net.obj -MD -MP -MF $(DEPDIR)/strace-net.Tpo -c -o strace-net.obj `if test -f 'net.c'; then $(CYGPATH_W) 'net.c'; else $(CYGPATH_W) '$(srcdir)/net.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-net.Tpo $(DEPDIR)/strace-net.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='net.c' object='strace-net.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_sg_req_info.obj: print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_sg_req_info.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_sg_req_info.Tpo -c -o libmpers_m32_a-print_sg_req_info.obj `if test -f 'print_sg_req_info.c'; then $(CYGPATH_W) 'print_sg_req_info.c'; else $(CYGPATH_W) '$(srcdir)/print_sg_req_info.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_sg_req_info.Tpo $(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sg_req_info.c' object='libmpers_m32_a-print_sg_req_info.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-net.obj `if test -f 'net.c'; then $(CYGPATH_W) 'net.c'; else $(CYGPATH_W) '$(srcdir)/net.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_sg_req_info.obj `if test -f 'print_sg_req_info.c'; then $(CYGPATH_W) 'print_sg_req_info.c'; else $(CYGPATH_W) '$(srcdir)/print_sg_req_info.c'; fi` -strace-pathtrace.o: pathtrace.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-pathtrace.o -MD -MP -MF $(DEPDIR)/strace-pathtrace.Tpo -c -o strace-pathtrace.o `test -f 'pathtrace.c' || echo '$(srcdir)/'`pathtrace.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-pathtrace.Tpo $(DEPDIR)/strace-pathtrace.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pathtrace.c' object='strace-pathtrace.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_sigevent.o: print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_sigevent.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_sigevent.Tpo -c -o libmpers_m32_a-print_sigevent.o `test -f 'print_sigevent.c' || echo '$(srcdir)/'`print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_sigevent.Tpo $(DEPDIR)/libmpers_m32_a-print_sigevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sigevent.c' object='libmpers_m32_a-print_sigevent.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-pathtrace.o `test -f 'pathtrace.c' || echo '$(srcdir)/'`pathtrace.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_sigevent.o `test -f 'print_sigevent.c' || echo '$(srcdir)/'`print_sigevent.c -strace-pathtrace.obj: pathtrace.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-pathtrace.obj -MD -MP -MF $(DEPDIR)/strace-pathtrace.Tpo -c -o strace-pathtrace.obj `if test -f 'pathtrace.c'; then $(CYGPATH_W) 'pathtrace.c'; else $(CYGPATH_W) '$(srcdir)/pathtrace.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-pathtrace.Tpo $(DEPDIR)/strace-pathtrace.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pathtrace.c' object='strace-pathtrace.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_sigevent.obj: print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_sigevent.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_sigevent.Tpo -c -o libmpers_m32_a-print_sigevent.obj `if test -f 'print_sigevent.c'; then $(CYGPATH_W) 'print_sigevent.c'; else $(CYGPATH_W) '$(srcdir)/print_sigevent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_sigevent.Tpo $(DEPDIR)/libmpers_m32_a-print_sigevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sigevent.c' object='libmpers_m32_a-print_sigevent.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-pathtrace.obj `if test -f 'pathtrace.c'; then $(CYGPATH_W) 'pathtrace.c'; else $(CYGPATH_W) '$(srcdir)/pathtrace.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_sigevent.obj `if test -f 'print_sigevent.c'; then $(CYGPATH_W) 'print_sigevent.c'; else $(CYGPATH_W) '$(srcdir)/print_sigevent.c'; fi` -strace-process.o: process.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-process.o -MD -MP -MF $(DEPDIR)/strace-process.Tpo -c -o strace-process.o `test -f 'process.c' || echo '$(srcdir)/'`process.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-process.Tpo $(DEPDIR)/strace-process.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='process.c' object='strace-process.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_time.o: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_time.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_time.Tpo -c -o libmpers_m32_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_time.Tpo $(DEPDIR)/libmpers_m32_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libmpers_m32_a-print_time.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-process.o `test -f 'process.c' || echo '$(srcdir)/'`process.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c -strace-process.obj: process.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-process.obj -MD -MP -MF $(DEPDIR)/strace-process.Tpo -c -o strace-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-process.Tpo $(DEPDIR)/strace-process.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='process.c' object='strace-process.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_time.obj: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_time.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_time.Tpo -c -o libmpers_m32_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_time.Tpo $(DEPDIR)/libmpers_m32_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libmpers_m32_a-print_time.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` -strace-ptp.o: ptp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ptp.o -MD -MP -MF $(DEPDIR)/strace-ptp.Tpo -c -o strace-ptp.o `test -f 'ptp.c' || echo '$(srcdir)/'`ptp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ptp.Tpo $(DEPDIR)/strace-ptp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ptp.c' object='strace-ptp.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_timespec.o: print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timespec.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timespec.Tpo -c -o libmpers_m32_a-print_timespec.o `test -f 'print_timespec.c' || echo '$(srcdir)/'`print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timespec.Tpo $(DEPDIR)/libmpers_m32_a-print_timespec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec.c' object='libmpers_m32_a-print_timespec.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ptp.o `test -f 'ptp.c' || echo '$(srcdir)/'`ptp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timespec.o `test -f 'print_timespec.c' || echo '$(srcdir)/'`print_timespec.c -strace-ptp.obj: ptp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-ptp.obj -MD -MP -MF $(DEPDIR)/strace-ptp.Tpo -c -o strace-ptp.obj `if test -f 'ptp.c'; then $(CYGPATH_W) 'ptp.c'; else $(CYGPATH_W) '$(srcdir)/ptp.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ptp.Tpo $(DEPDIR)/strace-ptp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ptp.c' object='strace-ptp.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_timespec.obj: print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timespec.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timespec.Tpo -c -o libmpers_m32_a-print_timespec.obj `if test -f 'print_timespec.c'; then $(CYGPATH_W) 'print_timespec.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timespec.Tpo $(DEPDIR)/libmpers_m32_a-print_timespec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec.c' object='libmpers_m32_a-print_timespec.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-ptp.obj `if test -f 'ptp.c'; then $(CYGPATH_W) 'ptp.c'; else $(CYGPATH_W) '$(srcdir)/ptp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timespec.obj `if test -f 'print_timespec.c'; then $(CYGPATH_W) 'print_timespec.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec.c'; fi` -strace-quota.o: quota.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-quota.o -MD -MP -MF $(DEPDIR)/strace-quota.Tpo -c -o strace-quota.o `test -f 'quota.c' || echo '$(srcdir)/'`quota.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-quota.Tpo $(DEPDIR)/strace-quota.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quota.c' object='strace-quota.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_timeval.o: print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timeval.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timeval.Tpo -c -o libmpers_m32_a-print_timeval.o `test -f 'print_timeval.c' || echo '$(srcdir)/'`print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timeval.Tpo $(DEPDIR)/libmpers_m32_a-print_timeval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval.c' object='libmpers_m32_a-print_timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-quota.o `test -f 'quota.c' || echo '$(srcdir)/'`quota.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timeval.o `test -f 'print_timeval.c' || echo '$(srcdir)/'`print_timeval.c -strace-quota.obj: quota.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-quota.obj -MD -MP -MF $(DEPDIR)/strace-quota.Tpo -c -o strace-quota.obj `if test -f 'quota.c'; then $(CYGPATH_W) 'quota.c'; else $(CYGPATH_W) '$(srcdir)/quota.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-quota.Tpo $(DEPDIR)/strace-quota.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quota.c' object='strace-quota.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_timeval.obj: print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timeval.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timeval.Tpo -c -o libmpers_m32_a-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timeval.Tpo $(DEPDIR)/libmpers_m32_a-print_timeval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval.c' object='libmpers_m32_a-print_timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-quota.obj `if test -f 'quota.c'; then $(CYGPATH_W) 'quota.c'; else $(CYGPATH_W) '$(srcdir)/quota.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` -strace-reboot.o: reboot.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-reboot.o -MD -MP -MF $(DEPDIR)/strace-reboot.Tpo -c -o strace-reboot.o `test -f 'reboot.c' || echo '$(srcdir)/'`reboot.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-reboot.Tpo $(DEPDIR)/strace-reboot.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reboot.c' object='strace-reboot.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_timex.o: print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timex.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timex.Tpo -c -o libmpers_m32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timex.Tpo $(DEPDIR)/libmpers_m32_a-print_timex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_m32_a-print_timex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-reboot.o `test -f 'reboot.c' || echo '$(srcdir)/'`reboot.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c -strace-reboot.obj: reboot.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-reboot.obj -MD -MP -MF $(DEPDIR)/strace-reboot.Tpo -c -o strace-reboot.obj `if test -f 'reboot.c'; then $(CYGPATH_W) 'reboot.c'; else $(CYGPATH_W) '$(srcdir)/reboot.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-reboot.Tpo $(DEPDIR)/strace-reboot.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reboot.c' object='strace-reboot.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-print_timex.obj: print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timex.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timex.Tpo -c -o libmpers_m32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timex.Tpo $(DEPDIR)/libmpers_m32_a-print_timex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_m32_a-print_timex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-reboot.obj `if test -f 'reboot.c'; then $(CYGPATH_W) 'reboot.c'; else $(CYGPATH_W) '$(srcdir)/reboot.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` -strace-resource.o: resource.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-resource.o -MD -MP -MF $(DEPDIR)/strace-resource.Tpo -c -o strace-resource.o `test -f 'resource.c' || echo '$(srcdir)/'`resource.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-resource.Tpo $(DEPDIR)/strace-resource.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='resource.c' object='strace-resource.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-printrusage.o: printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-printrusage.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-printrusage.Tpo -c -o libmpers_m32_a-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-printrusage.Tpo $(DEPDIR)/libmpers_m32_a-printrusage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printrusage.c' object='libmpers_m32_a-printrusage.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-resource.o `test -f 'resource.c' || echo '$(srcdir)/'`resource.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c -strace-resource.obj: resource.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-resource.obj -MD -MP -MF $(DEPDIR)/strace-resource.Tpo -c -o strace-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-resource.Tpo $(DEPDIR)/strace-resource.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='resource.c' object='strace-resource.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-printrusage.obj: printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-printrusage.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-printrusage.Tpo -c -o libmpers_m32_a-printrusage.obj `if test -f 'printrusage.c'; then $(CYGPATH_W) 'printrusage.c'; else $(CYGPATH_W) '$(srcdir)/printrusage.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-printrusage.Tpo $(DEPDIR)/libmpers_m32_a-printrusage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printrusage.c' object='libmpers_m32_a-printrusage.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-printrusage.obj `if test -f 'printrusage.c'; then $(CYGPATH_W) 'printrusage.c'; else $(CYGPATH_W) '$(srcdir)/printrusage.c'; fi` -strace-scsi.o: scsi.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-scsi.o -MD -MP -MF $(DEPDIR)/strace-scsi.Tpo -c -o strace-scsi.o `test -f 'scsi.c' || echo '$(srcdir)/'`scsi.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-scsi.Tpo $(DEPDIR)/strace-scsi.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scsi.c' object='strace-scsi.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-printsiginfo.o: printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-printsiginfo.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-printsiginfo.Tpo -c -o libmpers_m32_a-printsiginfo.o `test -f 'printsiginfo.c' || echo '$(srcdir)/'`printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-printsiginfo.Tpo $(DEPDIR)/libmpers_m32_a-printsiginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printsiginfo.c' object='libmpers_m32_a-printsiginfo.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-scsi.o `test -f 'scsi.c' || echo '$(srcdir)/'`scsi.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-printsiginfo.o `test -f 'printsiginfo.c' || echo '$(srcdir)/'`printsiginfo.c -strace-scsi.obj: scsi.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-scsi.obj -MD -MP -MF $(DEPDIR)/strace-scsi.Tpo -c -o strace-scsi.obj `if test -f 'scsi.c'; then $(CYGPATH_W) 'scsi.c'; else $(CYGPATH_W) '$(srcdir)/scsi.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-scsi.Tpo $(DEPDIR)/strace-scsi.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scsi.c' object='strace-scsi.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-printsiginfo.obj: printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-printsiginfo.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-printsiginfo.Tpo -c -o libmpers_m32_a-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-printsiginfo.Tpo $(DEPDIR)/libmpers_m32_a-printsiginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printsiginfo.c' object='libmpers_m32_a-printsiginfo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-scsi.obj `if test -f 'scsi.c'; then $(CYGPATH_W) 'scsi.c'; else $(CYGPATH_W) '$(srcdir)/scsi.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` -strace-signal.o: signal.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-signal.o -MD -MP -MF $(DEPDIR)/strace-signal.Tpo -c -o strace-signal.o `test -f 'signal.c' || echo '$(srcdir)/'`signal.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-signal.Tpo $(DEPDIR)/strace-signal.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal.c' object='strace-signal.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-rtc.o: rtc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-rtc.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-rtc.Tpo -c -o libmpers_m32_a-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-rtc.Tpo $(DEPDIR)/libmpers_m32_a-rtc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtc.c' object='libmpers_m32_a-rtc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c + +libmpers_m32_a-rtc.obj: rtc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-rtc.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-rtc.Tpo -c -o libmpers_m32_a-rtc.obj `if test -f 'rtc.c'; then $(CYGPATH_W) 'rtc.c'; else $(CYGPATH_W) '$(srcdir)/rtc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-rtc.Tpo $(DEPDIR)/libmpers_m32_a-rtc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtc.c' object='libmpers_m32_a-rtc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-rtc.obj `if test -f 'rtc.c'; then $(CYGPATH_W) 'rtc.c'; else $(CYGPATH_W) '$(srcdir)/rtc.c'; fi` + +libmpers_m32_a-sg_io_v3.o: sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sg_io_v3.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sg_io_v3.Tpo -c -o libmpers_m32_a-sg_io_v3.o `test -f 'sg_io_v3.c' || echo '$(srcdir)/'`sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sg_io_v3.Tpo $(DEPDIR)/libmpers_m32_a-sg_io_v3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v3.c' object='libmpers_m32_a-sg_io_v3.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sg_io_v3.o `test -f 'sg_io_v3.c' || echo '$(srcdir)/'`sg_io_v3.c + +libmpers_m32_a-sg_io_v3.obj: sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sg_io_v3.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sg_io_v3.Tpo -c -o libmpers_m32_a-sg_io_v3.obj `if test -f 'sg_io_v3.c'; then $(CYGPATH_W) 'sg_io_v3.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v3.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sg_io_v3.Tpo $(DEPDIR)/libmpers_m32_a-sg_io_v3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v3.c' object='libmpers_m32_a-sg_io_v3.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sg_io_v3.obj `if test -f 'sg_io_v3.c'; then $(CYGPATH_W) 'sg_io_v3.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v3.c'; fi` + +libmpers_m32_a-sigaltstack.o: sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sigaltstack.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sigaltstack.Tpo -c -o libmpers_m32_a-sigaltstack.o `test -f 'sigaltstack.c' || echo '$(srcdir)/'`sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sigaltstack.Tpo $(DEPDIR)/libmpers_m32_a-sigaltstack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigaltstack.c' object='libmpers_m32_a-sigaltstack.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sigaltstack.o `test -f 'sigaltstack.c' || echo '$(srcdir)/'`sigaltstack.c + +libmpers_m32_a-sigaltstack.obj: sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sigaltstack.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sigaltstack.Tpo -c -o libmpers_m32_a-sigaltstack.obj `if test -f 'sigaltstack.c'; then $(CYGPATH_W) 'sigaltstack.c'; else $(CYGPATH_W) '$(srcdir)/sigaltstack.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sigaltstack.Tpo $(DEPDIR)/libmpers_m32_a-sigaltstack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigaltstack.c' object='libmpers_m32_a-sigaltstack.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sigaltstack.obj `if test -f 'sigaltstack.c'; then $(CYGPATH_W) 'sigaltstack.c'; else $(CYGPATH_W) '$(srcdir)/sigaltstack.c'; fi` + +libmpers_m32_a-sock.o: sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sock.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sock.Tpo -c -o libmpers_m32_a-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sock.Tpo $(DEPDIR)/libmpers_m32_a-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='libmpers_m32_a-sock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c + +libmpers_m32_a-sock.obj: sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sock.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sock.Tpo -c -o libmpers_m32_a-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sock.Tpo $(DEPDIR)/libmpers_m32_a-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='libmpers_m32_a-sock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` + +libmpers_m32_a-sysinfo.o: sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sysinfo.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sysinfo.Tpo -c -o libmpers_m32_a-sysinfo.o `test -f 'sysinfo.c' || echo '$(srcdir)/'`sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sysinfo.Tpo $(DEPDIR)/libmpers_m32_a-sysinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysinfo.c' object='libmpers_m32_a-sysinfo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sysinfo.o `test -f 'sysinfo.c' || echo '$(srcdir)/'`sysinfo.c + +libmpers_m32_a-sysinfo.obj: sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-sysinfo.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-sysinfo.Tpo -c -o libmpers_m32_a-sysinfo.obj `if test -f 'sysinfo.c'; then $(CYGPATH_W) 'sysinfo.c'; else $(CYGPATH_W) '$(srcdir)/sysinfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-sysinfo.Tpo $(DEPDIR)/libmpers_m32_a-sysinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysinfo.c' object='libmpers_m32_a-sysinfo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-sysinfo.obj `if test -f 'sysinfo.c'; then $(CYGPATH_W) 'sysinfo.c'; else $(CYGPATH_W) '$(srcdir)/sysinfo.c'; fi` + +libmpers_m32_a-times.o: times.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-times.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-times.Tpo -c -o libmpers_m32_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-times.Tpo $(DEPDIR)/libmpers_m32_a-times.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='times.c' object='libmpers_m32_a-times.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c + +libmpers_m32_a-times.obj: times.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-times.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-times.Tpo -c -o libmpers_m32_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-times.Tpo $(DEPDIR)/libmpers_m32_a-times.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='times.c' object='libmpers_m32_a-times.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi` + +libmpers_m32_a-ustat.o: ustat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-ustat.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-ustat.Tpo -c -o libmpers_m32_a-ustat.o `test -f 'ustat.c' || echo '$(srcdir)/'`ustat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-ustat.Tpo $(DEPDIR)/libmpers_m32_a-ustat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ustat.c' object='libmpers_m32_a-ustat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-ustat.o `test -f 'ustat.c' || echo '$(srcdir)/'`ustat.c + +libmpers_m32_a-ustat.obj: ustat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-ustat.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-ustat.Tpo -c -o libmpers_m32_a-ustat.obj `if test -f 'ustat.c'; then $(CYGPATH_W) 'ustat.c'; else $(CYGPATH_W) '$(srcdir)/ustat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-ustat.Tpo $(DEPDIR)/libmpers_m32_a-ustat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ustat.c' object='libmpers_m32_a-ustat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-ustat.obj `if test -f 'ustat.c'; then $(CYGPATH_W) 'ustat.c'; else $(CYGPATH_W) '$(srcdir)/ustat.c'; fi` + +libmpers_m32_a-utime.o: utime.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-utime.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-utime.Tpo -c -o libmpers_m32_a-utime.o `test -f 'utime.c' || echo '$(srcdir)/'`utime.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-utime.Tpo $(DEPDIR)/libmpers_m32_a-utime.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utime.c' object='libmpers_m32_a-utime.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-utime.o `test -f 'utime.c' || echo '$(srcdir)/'`utime.c + +libmpers_m32_a-utime.obj: utime.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-utime.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-utime.Tpo -c -o libmpers_m32_a-utime.obj `if test -f 'utime.c'; then $(CYGPATH_W) 'utime.c'; else $(CYGPATH_W) '$(srcdir)/utime.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-utime.Tpo $(DEPDIR)/libmpers_m32_a-utime.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utime.c' object='libmpers_m32_a-utime.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-utime.obj `if test -f 'utime.c'; then $(CYGPATH_W) 'utime.c'; else $(CYGPATH_W) '$(srcdir)/utime.c'; fi` + +libmpers_m32_a-v4l2.o: v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-v4l2.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-v4l2.Tpo -c -o libmpers_m32_a-v4l2.o `test -f 'v4l2.c' || echo '$(srcdir)/'`v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-v4l2.Tpo $(DEPDIR)/libmpers_m32_a-v4l2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='v4l2.c' object='libmpers_m32_a-v4l2.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-v4l2.o `test -f 'v4l2.c' || echo '$(srcdir)/'`v4l2.c + +libmpers_m32_a-v4l2.obj: v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-v4l2.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-v4l2.Tpo -c -o libmpers_m32_a-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-v4l2.Tpo $(DEPDIR)/libmpers_m32_a-v4l2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='v4l2.c' object='libmpers_m32_a-v4l2.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi` + +libmpers_mx32_a-block.o: block.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-block.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-block.Tpo -c -o libmpers_mx32_a-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-block.Tpo $(DEPDIR)/libmpers_mx32_a-block.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='libmpers_mx32_a-block.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c + +libmpers_mx32_a-block.obj: block.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-block.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-block.Tpo -c -o libmpers_mx32_a-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-block.Tpo $(DEPDIR)/libmpers_mx32_a-block.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='libmpers_mx32_a-block.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` + +libmpers_mx32_a-btrfs.o: btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-btrfs.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-btrfs.Tpo -c -o libmpers_mx32_a-btrfs.o `test -f 'btrfs.c' || echo '$(srcdir)/'`btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-btrfs.Tpo $(DEPDIR)/libmpers_mx32_a-btrfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btrfs.c' object='libmpers_mx32_a-btrfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-btrfs.o `test -f 'btrfs.c' || echo '$(srcdir)/'`btrfs.c + +libmpers_mx32_a-btrfs.obj: btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-btrfs.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-btrfs.Tpo -c -o libmpers_mx32_a-btrfs.obj `if test -f 'btrfs.c'; then $(CYGPATH_W) 'btrfs.c'; else $(CYGPATH_W) '$(srcdir)/btrfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-btrfs.Tpo $(DEPDIR)/libmpers_mx32_a-btrfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btrfs.c' object='libmpers_mx32_a-btrfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-btrfs.obj `if test -f 'btrfs.c'; then $(CYGPATH_W) 'btrfs.c'; else $(CYGPATH_W) '$(srcdir)/btrfs.c'; fi` + +libmpers_mx32_a-dirent.o: dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-dirent.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-dirent.Tpo -c -o libmpers_mx32_a-dirent.o `test -f 'dirent.c' || echo '$(srcdir)/'`dirent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-dirent.Tpo $(DEPDIR)/libmpers_mx32_a-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent.c' object='libmpers_mx32_a-dirent.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-dirent.o `test -f 'dirent.c' || echo '$(srcdir)/'`dirent.c + +libmpers_mx32_a-dirent.obj: dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-dirent.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-dirent.Tpo -c -o libmpers_mx32_a-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-dirent.Tpo $(DEPDIR)/libmpers_mx32_a-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent.c' object='libmpers_mx32_a-dirent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` + +libmpers_mx32_a-evdev.o: evdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-evdev.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-evdev.Tpo -c -o libmpers_mx32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-evdev.Tpo $(DEPDIR)/libmpers_mx32_a-evdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_mx32_a-evdev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c + +libmpers_mx32_a-evdev.obj: evdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-evdev.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-evdev.Tpo -c -o libmpers_mx32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-evdev.Tpo $(DEPDIR)/libmpers_mx32_a-evdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_mx32_a-evdev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` + +libmpers_mx32_a-fetch_seccomp_fprog.o: fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_seccomp_fprog.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_mx32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_mx32_a-fetch_seccomp_fprog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c + +libmpers_mx32_a-fetch_seccomp_fprog.obj: fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_seccomp_fprog.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_mx32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_mx32_a-fetch_seccomp_fprog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` + +libmpers_mx32_a-fetch_struct_flock.o: fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_flock.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Tpo -c -o libmpers_mx32_a-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_flock.c' object='libmpers_mx32_a-fetch_struct_flock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c + +libmpers_mx32_a-fetch_struct_flock.obj: fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_flock.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Tpo -c -o libmpers_mx32_a-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_flock.c' object='libmpers_mx32_a-fetch_struct_flock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` + +libmpers_mx32_a-fetch_struct_mmsghdr.o: fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_mmsghdr.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Tpo -c -o libmpers_mx32_a-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_mmsghdr.c' object='libmpers_mx32_a-fetch_struct_mmsghdr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c + +libmpers_mx32_a-fetch_struct_mmsghdr.obj: fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_mmsghdr.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Tpo -c -o libmpers_mx32_a-fetch_struct_mmsghdr.obj `if test -f 'fetch_struct_mmsghdr.c'; then $(CYGPATH_W) 'fetch_struct_mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_mmsghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_mmsghdr.c' object='libmpers_mx32_a-fetch_struct_mmsghdr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_mmsghdr.obj `if test -f 'fetch_struct_mmsghdr.c'; then $(CYGPATH_W) 'fetch_struct_mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_mmsghdr.c'; fi` + +libmpers_mx32_a-fetch_struct_msghdr.o: fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_msghdr.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Tpo -c -o libmpers_mx32_a-fetch_struct_msghdr.o `test -f 'fetch_struct_msghdr.c' || echo '$(srcdir)/'`fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_msghdr.c' object='libmpers_mx32_a-fetch_struct_msghdr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_msghdr.o `test -f 'fetch_struct_msghdr.c' || echo '$(srcdir)/'`fetch_struct_msghdr.c + +libmpers_mx32_a-fetch_struct_msghdr.obj: fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_msghdr.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Tpo -c -o libmpers_mx32_a-fetch_struct_msghdr.obj `if test -f 'fetch_struct_msghdr.c'; then $(CYGPATH_W) 'fetch_struct_msghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_msghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_msghdr.c' object='libmpers_mx32_a-fetch_struct_msghdr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_msghdr.obj `if test -f 'fetch_struct_msghdr.c'; then $(CYGPATH_W) 'fetch_struct_msghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_msghdr.c'; fi` + +libmpers_mx32_a-fetch_struct_stat.o: fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_stat.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Tpo -c -o libmpers_mx32_a-fetch_struct_stat.o `test -f 'fetch_struct_stat.c' || echo '$(srcdir)/'`fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat.c' object='libmpers_mx32_a-fetch_struct_stat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_stat.o `test -f 'fetch_struct_stat.c' || echo '$(srcdir)/'`fetch_struct_stat.c + +libmpers_mx32_a-fetch_struct_stat.obj: fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_stat.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Tpo -c -o libmpers_mx32_a-fetch_struct_stat.obj `if test -f 'fetch_struct_stat.c'; then $(CYGPATH_W) 'fetch_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat.c' object='libmpers_mx32_a-fetch_struct_stat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_stat.obj `if test -f 'fetch_struct_stat.c'; then $(CYGPATH_W) 'fetch_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat.c'; fi` + +libmpers_mx32_a-fetch_struct_stat64.o: fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_stat64.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Tpo -c -o libmpers_mx32_a-fetch_struct_stat64.o `test -f 'fetch_struct_stat64.c' || echo '$(srcdir)/'`fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat64.c' object='libmpers_mx32_a-fetch_struct_stat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_stat64.o `test -f 'fetch_struct_stat64.c' || echo '$(srcdir)/'`fetch_struct_stat64.c + +libmpers_mx32_a-fetch_struct_stat64.obj: fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_stat64.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Tpo -c -o libmpers_mx32_a-fetch_struct_stat64.obj `if test -f 'fetch_struct_stat64.c'; then $(CYGPATH_W) 'fetch_struct_stat64.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat64.c' object='libmpers_mx32_a-fetch_struct_stat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_stat64.obj `if test -f 'fetch_struct_stat64.c'; then $(CYGPATH_W) 'fetch_struct_stat64.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat64.c'; fi` + +libmpers_mx32_a-fetch_struct_statfs.o: fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_statfs.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Tpo -c -o libmpers_mx32_a-fetch_struct_statfs.o `test -f 'fetch_struct_statfs.c' || echo '$(srcdir)/'`fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_statfs.c' object='libmpers_mx32_a-fetch_struct_statfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_statfs.o `test -f 'fetch_struct_statfs.c' || echo '$(srcdir)/'`fetch_struct_statfs.c + +libmpers_mx32_a-fetch_struct_statfs.obj: fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_statfs.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Tpo -c -o libmpers_mx32_a-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_statfs.c' object='libmpers_mx32_a-fetch_struct_statfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` + +libmpers_mx32_a-hdio.o: hdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-hdio.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-hdio.Tpo -c -o libmpers_mx32_a-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-hdio.Tpo $(DEPDIR)/libmpers_mx32_a-hdio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdio.c' object='libmpers_mx32_a-hdio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c + +libmpers_mx32_a-hdio.obj: hdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-hdio.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-hdio.Tpo -c -o libmpers_mx32_a-hdio.obj `if test -f 'hdio.c'; then $(CYGPATH_W) 'hdio.c'; else $(CYGPATH_W) '$(srcdir)/hdio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-hdio.Tpo $(DEPDIR)/libmpers_mx32_a-hdio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdio.c' object='libmpers_mx32_a-hdio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-hdio.obj `if test -f 'hdio.c'; then $(CYGPATH_W) 'hdio.c'; else $(CYGPATH_W) '$(srcdir)/hdio.c'; fi` + +libmpers_mx32_a-ipc_msgctl.o: ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-ipc_msgctl.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Tpo -c -o libmpers_mx32_a-ipc_msgctl.o `test -f 'ipc_msgctl.c' || echo '$(srcdir)/'`ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Tpo $(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msgctl.c' object='libmpers_mx32_a-ipc_msgctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-ipc_msgctl.o `test -f 'ipc_msgctl.c' || echo '$(srcdir)/'`ipc_msgctl.c + +libmpers_mx32_a-ipc_msgctl.obj: ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-ipc_msgctl.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Tpo -c -o libmpers_mx32_a-ipc_msgctl.obj `if test -f 'ipc_msgctl.c'; then $(CYGPATH_W) 'ipc_msgctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msgctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Tpo $(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msgctl.c' object='libmpers_mx32_a-ipc_msgctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-ipc_msgctl.obj `if test -f 'ipc_msgctl.c'; then $(CYGPATH_W) 'ipc_msgctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msgctl.c'; fi` + +libmpers_mx32_a-ipc_shmctl.o: ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-ipc_shmctl.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Tpo -c -o libmpers_mx32_a-ipc_shmctl.o `test -f 'ipc_shmctl.c' || echo '$(srcdir)/'`ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Tpo $(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shmctl.c' object='libmpers_mx32_a-ipc_shmctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-ipc_shmctl.o `test -f 'ipc_shmctl.c' || echo '$(srcdir)/'`ipc_shmctl.c + +libmpers_mx32_a-ipc_shmctl.obj: ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-ipc_shmctl.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Tpo -c -o libmpers_mx32_a-ipc_shmctl.obj `if test -f 'ipc_shmctl.c'; then $(CYGPATH_W) 'ipc_shmctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shmctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Tpo $(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shmctl.c' object='libmpers_mx32_a-ipc_shmctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-ipc_shmctl.obj `if test -f 'ipc_shmctl.c'; then $(CYGPATH_W) 'ipc_shmctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shmctl.c'; fi` + +libmpers_mx32_a-loop.o: loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-loop.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-loop.Tpo -c -o libmpers_mx32_a-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-loop.Tpo $(DEPDIR)/libmpers_mx32_a-loop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='libmpers_mx32_a-loop.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c + +libmpers_mx32_a-loop.obj: loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-loop.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-loop.Tpo -c -o libmpers_mx32_a-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-loop.Tpo $(DEPDIR)/libmpers_mx32_a-loop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='libmpers_mx32_a-loop.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` + +libmpers_mx32_a-mtd.o: mtd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-mtd.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-mtd.Tpo -c -o libmpers_mx32_a-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-mtd.Tpo $(DEPDIR)/libmpers_mx32_a-mtd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='libmpers_mx32_a-mtd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c + +libmpers_mx32_a-mtd.obj: mtd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-mtd.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-mtd.Tpo -c -o libmpers_mx32_a-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-mtd.Tpo $(DEPDIR)/libmpers_mx32_a-mtd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='libmpers_mx32_a-mtd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` + +libmpers_mx32_a-print_mq_attr.o: print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_mq_attr.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Tpo -c -o libmpers_mx32_a-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Tpo $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mq_attr.c' object='libmpers_mx32_a-print_mq_attr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c + +libmpers_mx32_a-print_mq_attr.obj: print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_mq_attr.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Tpo -c -o libmpers_mx32_a-print_mq_attr.obj `if test -f 'print_mq_attr.c'; then $(CYGPATH_W) 'print_mq_attr.c'; else $(CYGPATH_W) '$(srcdir)/print_mq_attr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Tpo $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mq_attr.c' object='libmpers_mx32_a-print_mq_attr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_mq_attr.obj `if test -f 'print_mq_attr.c'; then $(CYGPATH_W) 'print_mq_attr.c'; else $(CYGPATH_W) '$(srcdir)/print_mq_attr.c'; fi` + +libmpers_mx32_a-print_msgbuf.o: print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_msgbuf.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_msgbuf.Tpo -c -o libmpers_mx32_a-print_msgbuf.o `test -f 'print_msgbuf.c' || echo '$(srcdir)/'`print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_msgbuf.Tpo $(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_msgbuf.c' object='libmpers_mx32_a-print_msgbuf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_msgbuf.o `test -f 'print_msgbuf.c' || echo '$(srcdir)/'`print_msgbuf.c + +libmpers_mx32_a-print_msgbuf.obj: print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_msgbuf.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_msgbuf.Tpo -c -o libmpers_mx32_a-print_msgbuf.obj `if test -f 'print_msgbuf.c'; then $(CYGPATH_W) 'print_msgbuf.c'; else $(CYGPATH_W) '$(srcdir)/print_msgbuf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_msgbuf.Tpo $(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_msgbuf.c' object='libmpers_mx32_a-print_msgbuf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_msgbuf.obj `if test -f 'print_msgbuf.c'; then $(CYGPATH_W) 'print_msgbuf.c'; else $(CYGPATH_W) '$(srcdir)/print_msgbuf.c'; fi` + +libmpers_mx32_a-print_sg_req_info.o: print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_sg_req_info.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Tpo -c -o libmpers_mx32_a-print_sg_req_info.o `test -f 'print_sg_req_info.c' || echo '$(srcdir)/'`print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Tpo $(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sg_req_info.c' object='libmpers_mx32_a-print_sg_req_info.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_sg_req_info.o `test -f 'print_sg_req_info.c' || echo '$(srcdir)/'`print_sg_req_info.c + +libmpers_mx32_a-print_sg_req_info.obj: print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_sg_req_info.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Tpo -c -o libmpers_mx32_a-print_sg_req_info.obj `if test -f 'print_sg_req_info.c'; then $(CYGPATH_W) 'print_sg_req_info.c'; else $(CYGPATH_W) '$(srcdir)/print_sg_req_info.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Tpo $(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sg_req_info.c' object='libmpers_mx32_a-print_sg_req_info.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_sg_req_info.obj `if test -f 'print_sg_req_info.c'; then $(CYGPATH_W) 'print_sg_req_info.c'; else $(CYGPATH_W) '$(srcdir)/print_sg_req_info.c'; fi` + +libmpers_mx32_a-print_sigevent.o: print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_sigevent.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_sigevent.Tpo -c -o libmpers_mx32_a-print_sigevent.o `test -f 'print_sigevent.c' || echo '$(srcdir)/'`print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_sigevent.Tpo $(DEPDIR)/libmpers_mx32_a-print_sigevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sigevent.c' object='libmpers_mx32_a-print_sigevent.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_sigevent.o `test -f 'print_sigevent.c' || echo '$(srcdir)/'`print_sigevent.c + +libmpers_mx32_a-print_sigevent.obj: print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_sigevent.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_sigevent.Tpo -c -o libmpers_mx32_a-print_sigevent.obj `if test -f 'print_sigevent.c'; then $(CYGPATH_W) 'print_sigevent.c'; else $(CYGPATH_W) '$(srcdir)/print_sigevent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_sigevent.Tpo $(DEPDIR)/libmpers_mx32_a-print_sigevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sigevent.c' object='libmpers_mx32_a-print_sigevent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_sigevent.obj `if test -f 'print_sigevent.c'; then $(CYGPATH_W) 'print_sigevent.c'; else $(CYGPATH_W) '$(srcdir)/print_sigevent.c'; fi` + +libmpers_mx32_a-print_time.o: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_time.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_time.Tpo -c -o libmpers_mx32_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_time.Tpo $(DEPDIR)/libmpers_mx32_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libmpers_mx32_a-print_time.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c + +libmpers_mx32_a-print_time.obj: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_time.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_time.Tpo -c -o libmpers_mx32_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_time.Tpo $(DEPDIR)/libmpers_mx32_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libmpers_mx32_a-print_time.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` + +libmpers_mx32_a-print_timespec.o: print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timespec.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timespec.Tpo -c -o libmpers_mx32_a-print_timespec.o `test -f 'print_timespec.c' || echo '$(srcdir)/'`print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timespec.Tpo $(DEPDIR)/libmpers_mx32_a-print_timespec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec.c' object='libmpers_mx32_a-print_timespec.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timespec.o `test -f 'print_timespec.c' || echo '$(srcdir)/'`print_timespec.c + +libmpers_mx32_a-print_timespec.obj: print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timespec.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timespec.Tpo -c -o libmpers_mx32_a-print_timespec.obj `if test -f 'print_timespec.c'; then $(CYGPATH_W) 'print_timespec.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timespec.Tpo $(DEPDIR)/libmpers_mx32_a-print_timespec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec.c' object='libmpers_mx32_a-print_timespec.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timespec.obj `if test -f 'print_timespec.c'; then $(CYGPATH_W) 'print_timespec.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec.c'; fi` + +libmpers_mx32_a-print_timeval.o: print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timeval.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timeval.Tpo -c -o libmpers_mx32_a-print_timeval.o `test -f 'print_timeval.c' || echo '$(srcdir)/'`print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timeval.Tpo $(DEPDIR)/libmpers_mx32_a-print_timeval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval.c' object='libmpers_mx32_a-print_timeval.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timeval.o `test -f 'print_timeval.c' || echo '$(srcdir)/'`print_timeval.c + +libmpers_mx32_a-print_timeval.obj: print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timeval.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timeval.Tpo -c -o libmpers_mx32_a-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timeval.Tpo $(DEPDIR)/libmpers_mx32_a-print_timeval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval.c' object='libmpers_mx32_a-print_timeval.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` + +libmpers_mx32_a-print_timex.o: print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timex.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo -c -o libmpers_mx32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo $(DEPDIR)/libmpers_mx32_a-print_timex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_mx32_a-print_timex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c + +libmpers_mx32_a-print_timex.obj: print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timex.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo -c -o libmpers_mx32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo $(DEPDIR)/libmpers_mx32_a-print_timex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_mx32_a-print_timex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` + +libmpers_mx32_a-printrusage.o: printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-printrusage.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-printrusage.Tpo -c -o libmpers_mx32_a-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-printrusage.Tpo $(DEPDIR)/libmpers_mx32_a-printrusage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printrusage.c' object='libmpers_mx32_a-printrusage.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c + +libmpers_mx32_a-printrusage.obj: printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-printrusage.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-printrusage.Tpo -c -o libmpers_mx32_a-printrusage.obj `if test -f 'printrusage.c'; then $(CYGPATH_W) 'printrusage.c'; else $(CYGPATH_W) '$(srcdir)/printrusage.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-printrusage.Tpo $(DEPDIR)/libmpers_mx32_a-printrusage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printrusage.c' object='libmpers_mx32_a-printrusage.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-printrusage.obj `if test -f 'printrusage.c'; then $(CYGPATH_W) 'printrusage.c'; else $(CYGPATH_W) '$(srcdir)/printrusage.c'; fi` + +libmpers_mx32_a-printsiginfo.o: printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-printsiginfo.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-printsiginfo.Tpo -c -o libmpers_mx32_a-printsiginfo.o `test -f 'printsiginfo.c' || echo '$(srcdir)/'`printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-printsiginfo.Tpo $(DEPDIR)/libmpers_mx32_a-printsiginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printsiginfo.c' object='libmpers_mx32_a-printsiginfo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-printsiginfo.o `test -f 'printsiginfo.c' || echo '$(srcdir)/'`printsiginfo.c + +libmpers_mx32_a-printsiginfo.obj: printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-printsiginfo.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-printsiginfo.Tpo -c -o libmpers_mx32_a-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-printsiginfo.Tpo $(DEPDIR)/libmpers_mx32_a-printsiginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printsiginfo.c' object='libmpers_mx32_a-printsiginfo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` + +libmpers_mx32_a-rtc.o: rtc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-rtc.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-rtc.Tpo -c -o libmpers_mx32_a-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-rtc.Tpo $(DEPDIR)/libmpers_mx32_a-rtc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtc.c' object='libmpers_mx32_a-rtc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c + +libmpers_mx32_a-rtc.obj: rtc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-rtc.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-rtc.Tpo -c -o libmpers_mx32_a-rtc.obj `if test -f 'rtc.c'; then $(CYGPATH_W) 'rtc.c'; else $(CYGPATH_W) '$(srcdir)/rtc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-rtc.Tpo $(DEPDIR)/libmpers_mx32_a-rtc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtc.c' object='libmpers_mx32_a-rtc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-rtc.obj `if test -f 'rtc.c'; then $(CYGPATH_W) 'rtc.c'; else $(CYGPATH_W) '$(srcdir)/rtc.c'; fi` + +libmpers_mx32_a-sg_io_v3.o: sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sg_io_v3.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sg_io_v3.Tpo -c -o libmpers_mx32_a-sg_io_v3.o `test -f 'sg_io_v3.c' || echo '$(srcdir)/'`sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sg_io_v3.Tpo $(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v3.c' object='libmpers_mx32_a-sg_io_v3.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sg_io_v3.o `test -f 'sg_io_v3.c' || echo '$(srcdir)/'`sg_io_v3.c + +libmpers_mx32_a-sg_io_v3.obj: sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sg_io_v3.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sg_io_v3.Tpo -c -o libmpers_mx32_a-sg_io_v3.obj `if test -f 'sg_io_v3.c'; then $(CYGPATH_W) 'sg_io_v3.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v3.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sg_io_v3.Tpo $(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v3.c' object='libmpers_mx32_a-sg_io_v3.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sg_io_v3.obj `if test -f 'sg_io_v3.c'; then $(CYGPATH_W) 'sg_io_v3.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v3.c'; fi` + +libmpers_mx32_a-sigaltstack.o: sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sigaltstack.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sigaltstack.Tpo -c -o libmpers_mx32_a-sigaltstack.o `test -f 'sigaltstack.c' || echo '$(srcdir)/'`sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sigaltstack.Tpo $(DEPDIR)/libmpers_mx32_a-sigaltstack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigaltstack.c' object='libmpers_mx32_a-sigaltstack.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sigaltstack.o `test -f 'sigaltstack.c' || echo '$(srcdir)/'`sigaltstack.c + +libmpers_mx32_a-sigaltstack.obj: sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sigaltstack.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sigaltstack.Tpo -c -o libmpers_mx32_a-sigaltstack.obj `if test -f 'sigaltstack.c'; then $(CYGPATH_W) 'sigaltstack.c'; else $(CYGPATH_W) '$(srcdir)/sigaltstack.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sigaltstack.Tpo $(DEPDIR)/libmpers_mx32_a-sigaltstack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigaltstack.c' object='libmpers_mx32_a-sigaltstack.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sigaltstack.obj `if test -f 'sigaltstack.c'; then $(CYGPATH_W) 'sigaltstack.c'; else $(CYGPATH_W) '$(srcdir)/sigaltstack.c'; fi` + +libmpers_mx32_a-sock.o: sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sock.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sock.Tpo -c -o libmpers_mx32_a-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sock.Tpo $(DEPDIR)/libmpers_mx32_a-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='libmpers_mx32_a-sock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c + +libmpers_mx32_a-sock.obj: sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sock.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sock.Tpo -c -o libmpers_mx32_a-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sock.Tpo $(DEPDIR)/libmpers_mx32_a-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='libmpers_mx32_a-sock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` + +libmpers_mx32_a-sysinfo.o: sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sysinfo.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sysinfo.Tpo -c -o libmpers_mx32_a-sysinfo.o `test -f 'sysinfo.c' || echo '$(srcdir)/'`sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sysinfo.Tpo $(DEPDIR)/libmpers_mx32_a-sysinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysinfo.c' object='libmpers_mx32_a-sysinfo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sysinfo.o `test -f 'sysinfo.c' || echo '$(srcdir)/'`sysinfo.c + +libmpers_mx32_a-sysinfo.obj: sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-sysinfo.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-sysinfo.Tpo -c -o libmpers_mx32_a-sysinfo.obj `if test -f 'sysinfo.c'; then $(CYGPATH_W) 'sysinfo.c'; else $(CYGPATH_W) '$(srcdir)/sysinfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-sysinfo.Tpo $(DEPDIR)/libmpers_mx32_a-sysinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysinfo.c' object='libmpers_mx32_a-sysinfo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-sysinfo.obj `if test -f 'sysinfo.c'; then $(CYGPATH_W) 'sysinfo.c'; else $(CYGPATH_W) '$(srcdir)/sysinfo.c'; fi` + +libmpers_mx32_a-times.o: times.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-times.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-times.Tpo -c -o libmpers_mx32_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-times.Tpo $(DEPDIR)/libmpers_mx32_a-times.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='times.c' object='libmpers_mx32_a-times.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c + +libmpers_mx32_a-times.obj: times.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-times.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-times.Tpo -c -o libmpers_mx32_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-times.Tpo $(DEPDIR)/libmpers_mx32_a-times.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='times.c' object='libmpers_mx32_a-times.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi` + +libmpers_mx32_a-ustat.o: ustat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-ustat.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-ustat.Tpo -c -o libmpers_mx32_a-ustat.o `test -f 'ustat.c' || echo '$(srcdir)/'`ustat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-ustat.Tpo $(DEPDIR)/libmpers_mx32_a-ustat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ustat.c' object='libmpers_mx32_a-ustat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-ustat.o `test -f 'ustat.c' || echo '$(srcdir)/'`ustat.c + +libmpers_mx32_a-ustat.obj: ustat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-ustat.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-ustat.Tpo -c -o libmpers_mx32_a-ustat.obj `if test -f 'ustat.c'; then $(CYGPATH_W) 'ustat.c'; else $(CYGPATH_W) '$(srcdir)/ustat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-ustat.Tpo $(DEPDIR)/libmpers_mx32_a-ustat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ustat.c' object='libmpers_mx32_a-ustat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-ustat.obj `if test -f 'ustat.c'; then $(CYGPATH_W) 'ustat.c'; else $(CYGPATH_W) '$(srcdir)/ustat.c'; fi` + +libmpers_mx32_a-utime.o: utime.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-utime.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-utime.Tpo -c -o libmpers_mx32_a-utime.o `test -f 'utime.c' || echo '$(srcdir)/'`utime.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-utime.Tpo $(DEPDIR)/libmpers_mx32_a-utime.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utime.c' object='libmpers_mx32_a-utime.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-utime.o `test -f 'utime.c' || echo '$(srcdir)/'`utime.c + +libmpers_mx32_a-utime.obj: utime.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-utime.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-utime.Tpo -c -o libmpers_mx32_a-utime.obj `if test -f 'utime.c'; then $(CYGPATH_W) 'utime.c'; else $(CYGPATH_W) '$(srcdir)/utime.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-utime.Tpo $(DEPDIR)/libmpers_mx32_a-utime.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utime.c' object='libmpers_mx32_a-utime.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-utime.obj `if test -f 'utime.c'; then $(CYGPATH_W) 'utime.c'; else $(CYGPATH_W) '$(srcdir)/utime.c'; fi` + +libmpers_mx32_a-v4l2.o: v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-v4l2.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-v4l2.Tpo -c -o libmpers_mx32_a-v4l2.o `test -f 'v4l2.c' || echo '$(srcdir)/'`v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-v4l2.Tpo $(DEPDIR)/libmpers_mx32_a-v4l2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='v4l2.c' object='libmpers_mx32_a-v4l2.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-v4l2.o `test -f 'v4l2.c' || echo '$(srcdir)/'`v4l2.c + +libmpers_mx32_a-v4l2.obj: v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-v4l2.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-v4l2.Tpo -c -o libmpers_mx32_a-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-v4l2.Tpo $(DEPDIR)/libmpers_mx32_a-v4l2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='v4l2.c' object='libmpers_mx32_a-v4l2.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi` + +libstrace_a-fstatfs.o: fstatfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fstatfs.o -MD -MP -MF $(DEPDIR)/libstrace_a-fstatfs.Tpo -c -o libstrace_a-fstatfs.o `test -f 'fstatfs.c' || echo '$(srcdir)/'`fstatfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fstatfs.Tpo $(DEPDIR)/libstrace_a-fstatfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatfs.c' object='libstrace_a-fstatfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fstatfs.o `test -f 'fstatfs.c' || echo '$(srcdir)/'`fstatfs.c + +libstrace_a-fstatfs.obj: fstatfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fstatfs.obj -MD -MP -MF $(DEPDIR)/libstrace_a-fstatfs.Tpo -c -o libstrace_a-fstatfs.obj `if test -f 'fstatfs.c'; then $(CYGPATH_W) 'fstatfs.c'; else $(CYGPATH_W) '$(srcdir)/fstatfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fstatfs.Tpo $(DEPDIR)/libstrace_a-fstatfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatfs.c' object='libstrace_a-fstatfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fstatfs.obj `if test -f 'fstatfs.c'; then $(CYGPATH_W) 'fstatfs.c'; else $(CYGPATH_W) '$(srcdir)/fstatfs.c'; fi` + +libstrace_a-fstatfs64.o: fstatfs64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fstatfs64.o -MD -MP -MF $(DEPDIR)/libstrace_a-fstatfs64.Tpo -c -o libstrace_a-fstatfs64.o `test -f 'fstatfs64.c' || echo '$(srcdir)/'`fstatfs64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fstatfs64.Tpo $(DEPDIR)/libstrace_a-fstatfs64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatfs64.c' object='libstrace_a-fstatfs64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fstatfs64.o `test -f 'fstatfs64.c' || echo '$(srcdir)/'`fstatfs64.c + +libstrace_a-fstatfs64.obj: fstatfs64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fstatfs64.obj -MD -MP -MF $(DEPDIR)/libstrace_a-fstatfs64.Tpo -c -o libstrace_a-fstatfs64.obj `if test -f 'fstatfs64.c'; then $(CYGPATH_W) 'fstatfs64.c'; else $(CYGPATH_W) '$(srcdir)/fstatfs64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fstatfs64.Tpo $(DEPDIR)/libstrace_a-fstatfs64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatfs64.c' object='libstrace_a-fstatfs64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fstatfs64.obj `if test -f 'fstatfs64.c'; then $(CYGPATH_W) 'fstatfs64.c'; else $(CYGPATH_W) '$(srcdir)/fstatfs64.c'; fi` + +libstrace_a-ipc.o: ipc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-ipc.o -MD -MP -MF $(DEPDIR)/libstrace_a-ipc.Tpo -c -o libstrace_a-ipc.o `test -f 'ipc.c' || echo '$(srcdir)/'`ipc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-ipc.Tpo $(DEPDIR)/libstrace_a-ipc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc.c' object='libstrace_a-ipc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-ipc.o `test -f 'ipc.c' || echo '$(srcdir)/'`ipc.c + +libstrace_a-ipc.obj: ipc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-ipc.obj -MD -MP -MF $(DEPDIR)/libstrace_a-ipc.Tpo -c -o libstrace_a-ipc.obj `if test -f 'ipc.c'; then $(CYGPATH_W) 'ipc.c'; else $(CYGPATH_W) '$(srcdir)/ipc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-ipc.Tpo $(DEPDIR)/libstrace_a-ipc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc.c' object='libstrace_a-ipc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-ipc.obj `if test -f 'ipc.c'; then $(CYGPATH_W) 'ipc.c'; else $(CYGPATH_W) '$(srcdir)/ipc.c'; fi` + +libstrace_a-socketcall.o: socketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-socketcall.o -MD -MP -MF $(DEPDIR)/libstrace_a-socketcall.Tpo -c -o libstrace_a-socketcall.o `test -f 'socketcall.c' || echo '$(srcdir)/'`socketcall.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-socketcall.Tpo $(DEPDIR)/libstrace_a-socketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socketcall.c' object='libstrace_a-socketcall.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-socketcall.o `test -f 'socketcall.c' || echo '$(srcdir)/'`socketcall.c + +libstrace_a-socketcall.obj: socketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-socketcall.obj -MD -MP -MF $(DEPDIR)/libstrace_a-socketcall.Tpo -c -o libstrace_a-socketcall.obj `if test -f 'socketcall.c'; then $(CYGPATH_W) 'socketcall.c'; else $(CYGPATH_W) '$(srcdir)/socketcall.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-socketcall.Tpo $(DEPDIR)/libstrace_a-socketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socketcall.c' object='libstrace_a-socketcall.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-socketcall.obj `if test -f 'socketcall.c'; then $(CYGPATH_W) 'socketcall.c'; else $(CYGPATH_W) '$(srcdir)/socketcall.c'; fi` + +libstrace_a-statfs.o: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-statfs.o -MD -MP -MF $(DEPDIR)/libstrace_a-statfs.Tpo -c -o libstrace_a-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-statfs.Tpo $(DEPDIR)/libstrace_a-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='libstrace_a-statfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c + +libstrace_a-statfs.obj: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-statfs.obj -MD -MP -MF $(DEPDIR)/libstrace_a-statfs.Tpo -c -o libstrace_a-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-statfs.Tpo $(DEPDIR)/libstrace_a-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='libstrace_a-statfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` + +libstrace_a-statfs64.o: statfs64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-statfs64.o -MD -MP -MF $(DEPDIR)/libstrace_a-statfs64.Tpo -c -o libstrace_a-statfs64.o `test -f 'statfs64.c' || echo '$(srcdir)/'`statfs64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-statfs64.Tpo $(DEPDIR)/libstrace_a-statfs64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs64.c' object='libstrace_a-statfs64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-statfs64.o `test -f 'statfs64.c' || echo '$(srcdir)/'`statfs64.c + +libstrace_a-statfs64.obj: statfs64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-statfs64.obj -MD -MP -MF $(DEPDIR)/libstrace_a-statfs64.Tpo -c -o libstrace_a-statfs64.obj `if test -f 'statfs64.c'; then $(CYGPATH_W) 'statfs64.c'; else $(CYGPATH_W) '$(srcdir)/statfs64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-statfs64.Tpo $(DEPDIR)/libstrace_a-statfs64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs64.c' object='libstrace_a-statfs64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-statfs64.obj `if test -f 'statfs64.c'; then $(CYGPATH_W) 'statfs64.c'; else $(CYGPATH_W) '$(srcdir)/statfs64.c'; fi` + +libstrace_a-sync_file_range.o: sync_file_range.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sync_file_range.o -MD -MP -MF $(DEPDIR)/libstrace_a-sync_file_range.Tpo -c -o libstrace_a-sync_file_range.o `test -f 'sync_file_range.c' || echo '$(srcdir)/'`sync_file_range.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sync_file_range.Tpo $(DEPDIR)/libstrace_a-sync_file_range.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync_file_range.c' object='libstrace_a-sync_file_range.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sync_file_range.o `test -f 'sync_file_range.c' || echo '$(srcdir)/'`sync_file_range.c + +libstrace_a-sync_file_range.obj: sync_file_range.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sync_file_range.obj -MD -MP -MF $(DEPDIR)/libstrace_a-sync_file_range.Tpo -c -o libstrace_a-sync_file_range.obj `if test -f 'sync_file_range.c'; then $(CYGPATH_W) 'sync_file_range.c'; else $(CYGPATH_W) '$(srcdir)/sync_file_range.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sync_file_range.Tpo $(DEPDIR)/libstrace_a-sync_file_range.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync_file_range.c' object='libstrace_a-sync_file_range.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sync_file_range.obj `if test -f 'sync_file_range.c'; then $(CYGPATH_W) 'sync_file_range.c'; else $(CYGPATH_W) '$(srcdir)/sync_file_range.c'; fi` + +libstrace_a-sync_file_range2.o: sync_file_range2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sync_file_range2.o -MD -MP -MF $(DEPDIR)/libstrace_a-sync_file_range2.Tpo -c -o libstrace_a-sync_file_range2.o `test -f 'sync_file_range2.c' || echo '$(srcdir)/'`sync_file_range2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sync_file_range2.Tpo $(DEPDIR)/libstrace_a-sync_file_range2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync_file_range2.c' object='libstrace_a-sync_file_range2.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sync_file_range2.o `test -f 'sync_file_range2.c' || echo '$(srcdir)/'`sync_file_range2.c + +libstrace_a-sync_file_range2.obj: sync_file_range2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sync_file_range2.obj -MD -MP -MF $(DEPDIR)/libstrace_a-sync_file_range2.Tpo -c -o libstrace_a-sync_file_range2.obj `if test -f 'sync_file_range2.c'; then $(CYGPATH_W) 'sync_file_range2.c'; else $(CYGPATH_W) '$(srcdir)/sync_file_range2.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sync_file_range2.Tpo $(DEPDIR)/libstrace_a-sync_file_range2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync_file_range2.c' object='libstrace_a-sync_file_range2.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sync_file_range2.obj `if test -f 'sync_file_range2.c'; then $(CYGPATH_W) 'sync_file_range2.c'; else $(CYGPATH_W) '$(srcdir)/sync_file_range2.c'; fi` + +libstrace_a-upeek.o: upeek.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-upeek.o -MD -MP -MF $(DEPDIR)/libstrace_a-upeek.Tpo -c -o libstrace_a-upeek.o `test -f 'upeek.c' || echo '$(srcdir)/'`upeek.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-upeek.Tpo $(DEPDIR)/libstrace_a-upeek.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upeek.c' object='libstrace_a-upeek.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-upeek.o `test -f 'upeek.c' || echo '$(srcdir)/'`upeek.c + +libstrace_a-upeek.obj: upeek.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-upeek.obj -MD -MP -MF $(DEPDIR)/libstrace_a-upeek.Tpo -c -o libstrace_a-upeek.obj `if test -f 'upeek.c'; then $(CYGPATH_W) 'upeek.c'; else $(CYGPATH_W) '$(srcdir)/upeek.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-upeek.Tpo $(DEPDIR)/libstrace_a-upeek.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upeek.c' object='libstrace_a-upeek.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-upeek.obj `if test -f 'upeek.c'; then $(CYGPATH_W) 'upeek.c'; else $(CYGPATH_W) '$(srcdir)/upeek.c'; fi` + +libstrace_a-upoke.o: upoke.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-upoke.o -MD -MP -MF $(DEPDIR)/libstrace_a-upoke.Tpo -c -o libstrace_a-upoke.o `test -f 'upoke.c' || echo '$(srcdir)/'`upoke.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-upoke.Tpo $(DEPDIR)/libstrace_a-upoke.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upoke.c' object='libstrace_a-upoke.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-upoke.o `test -f 'upoke.c' || echo '$(srcdir)/'`upoke.c + +libstrace_a-upoke.obj: upoke.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-upoke.obj -MD -MP -MF $(DEPDIR)/libstrace_a-upoke.Tpo -c -o libstrace_a-upoke.obj `if test -f 'upoke.c'; then $(CYGPATH_W) 'upoke.c'; else $(CYGPATH_W) '$(srcdir)/upoke.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-upoke.Tpo $(DEPDIR)/libstrace_a-upoke.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upoke.c' object='libstrace_a-upoke.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-upoke.obj `if test -f 'upoke.c'; then $(CYGPATH_W) 'upoke.c'; else $(CYGPATH_W) '$(srcdir)/upoke.c'; fi` + +strace-access.o: access.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-access.o -MD -MP -MF $(DEPDIR)/strace-access.Tpo -c -o strace-access.o `test -f 'access.c' || echo '$(srcdir)/'`access.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-access.Tpo $(DEPDIR)/strace-access.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='access.c' object='strace-access.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-access.o `test -f 'access.c' || echo '$(srcdir)/'`access.c + +strace-access.obj: access.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-access.obj -MD -MP -MF $(DEPDIR)/strace-access.Tpo -c -o strace-access.obj `if test -f 'access.c'; then $(CYGPATH_W) 'access.c'; else $(CYGPATH_W) '$(srcdir)/access.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-access.Tpo $(DEPDIR)/strace-access.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='access.c' object='strace-access.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-access.obj `if test -f 'access.c'; then $(CYGPATH_W) 'access.c'; else $(CYGPATH_W) '$(srcdir)/access.c'; fi` + +strace-affinity.o: affinity.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-affinity.o -MD -MP -MF $(DEPDIR)/strace-affinity.Tpo -c -o strace-affinity.o `test -f 'affinity.c' || echo '$(srcdir)/'`affinity.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-affinity.Tpo $(DEPDIR)/strace-affinity.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='affinity.c' object='strace-affinity.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-affinity.o `test -f 'affinity.c' || echo '$(srcdir)/'`affinity.c + +strace-affinity.obj: affinity.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-affinity.obj -MD -MP -MF $(DEPDIR)/strace-affinity.Tpo -c -o strace-affinity.obj `if test -f 'affinity.c'; then $(CYGPATH_W) 'affinity.c'; else $(CYGPATH_W) '$(srcdir)/affinity.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-affinity.Tpo $(DEPDIR)/strace-affinity.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='affinity.c' object='strace-affinity.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-affinity.obj `if test -f 'affinity.c'; then $(CYGPATH_W) 'affinity.c'; else $(CYGPATH_W) '$(srcdir)/affinity.c'; fi` + +strace-aio.o: aio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-aio.o -MD -MP -MF $(DEPDIR)/strace-aio.Tpo -c -o strace-aio.o `test -f 'aio.c' || echo '$(srcdir)/'`aio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-aio.Tpo $(DEPDIR)/strace-aio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aio.c' object='strace-aio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-aio.o `test -f 'aio.c' || echo '$(srcdir)/'`aio.c + +strace-aio.obj: aio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-aio.obj -MD -MP -MF $(DEPDIR)/strace-aio.Tpo -c -o strace-aio.obj `if test -f 'aio.c'; then $(CYGPATH_W) 'aio.c'; else $(CYGPATH_W) '$(srcdir)/aio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-aio.Tpo $(DEPDIR)/strace-aio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aio.c' object='strace-aio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-aio.obj `if test -f 'aio.c'; then $(CYGPATH_W) 'aio.c'; else $(CYGPATH_W) '$(srcdir)/aio.c'; fi` + +strace-alpha.o: alpha.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-alpha.o -MD -MP -MF $(DEPDIR)/strace-alpha.Tpo -c -o strace-alpha.o `test -f 'alpha.c' || echo '$(srcdir)/'`alpha.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-alpha.Tpo $(DEPDIR)/strace-alpha.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='alpha.c' object='strace-alpha.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-alpha.o `test -f 'alpha.c' || echo '$(srcdir)/'`alpha.c + +strace-alpha.obj: alpha.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-alpha.obj -MD -MP -MF $(DEPDIR)/strace-alpha.Tpo -c -o strace-alpha.obj `if test -f 'alpha.c'; then $(CYGPATH_W) 'alpha.c'; else $(CYGPATH_W) '$(srcdir)/alpha.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-alpha.Tpo $(DEPDIR)/strace-alpha.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='alpha.c' object='strace-alpha.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-alpha.obj `if test -f 'alpha.c'; then $(CYGPATH_W) 'alpha.c'; else $(CYGPATH_W) '$(srcdir)/alpha.c'; fi` + +strace-bjm.o: bjm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bjm.o -MD -MP -MF $(DEPDIR)/strace-bjm.Tpo -c -o strace-bjm.o `test -f 'bjm.c' || echo '$(srcdir)/'`bjm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bjm.Tpo $(DEPDIR)/strace-bjm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bjm.c' object='strace-bjm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bjm.o `test -f 'bjm.c' || echo '$(srcdir)/'`bjm.c + +strace-bjm.obj: bjm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bjm.obj -MD -MP -MF $(DEPDIR)/strace-bjm.Tpo -c -o strace-bjm.obj `if test -f 'bjm.c'; then $(CYGPATH_W) 'bjm.c'; else $(CYGPATH_W) '$(srcdir)/bjm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bjm.Tpo $(DEPDIR)/strace-bjm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bjm.c' object='strace-bjm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bjm.obj `if test -f 'bjm.c'; then $(CYGPATH_W) 'bjm.c'; else $(CYGPATH_W) '$(srcdir)/bjm.c'; fi` + +strace-block.o: block.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-block.o -MD -MP -MF $(DEPDIR)/strace-block.Tpo -c -o strace-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-block.Tpo $(DEPDIR)/strace-block.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='strace-block.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c + +strace-block.obj: block.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-block.obj -MD -MP -MF $(DEPDIR)/strace-block.Tpo -c -o strace-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-block.Tpo $(DEPDIR)/strace-block.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='block.c' object='strace-block.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi` + +strace-bpf.o: bpf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf.o -MD -MP -MF $(DEPDIR)/strace-bpf.Tpo -c -o strace-bpf.o `test -f 'bpf.c' || echo '$(srcdir)/'`bpf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf.Tpo $(DEPDIR)/strace-bpf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf.c' object='strace-bpf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf.o `test -f 'bpf.c' || echo '$(srcdir)/'`bpf.c + +strace-bpf.obj: bpf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf.obj -MD -MP -MF $(DEPDIR)/strace-bpf.Tpo -c -o strace-bpf.obj `if test -f 'bpf.c'; then $(CYGPATH_W) 'bpf.c'; else $(CYGPATH_W) '$(srcdir)/bpf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf.Tpo $(DEPDIR)/strace-bpf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf.c' object='strace-bpf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf.obj `if test -f 'bpf.c'; then $(CYGPATH_W) 'bpf.c'; else $(CYGPATH_W) '$(srcdir)/bpf.c'; fi` + +strace-btrfs.o: btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-btrfs.o -MD -MP -MF $(DEPDIR)/strace-btrfs.Tpo -c -o strace-btrfs.o `test -f 'btrfs.c' || echo '$(srcdir)/'`btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-btrfs.Tpo $(DEPDIR)/strace-btrfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btrfs.c' object='strace-btrfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-btrfs.o `test -f 'btrfs.c' || echo '$(srcdir)/'`btrfs.c + +strace-btrfs.obj: btrfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-btrfs.obj -MD -MP -MF $(DEPDIR)/strace-btrfs.Tpo -c -o strace-btrfs.obj `if test -f 'btrfs.c'; then $(CYGPATH_W) 'btrfs.c'; else $(CYGPATH_W) '$(srcdir)/btrfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-btrfs.Tpo $(DEPDIR)/strace-btrfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btrfs.c' object='strace-btrfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-btrfs.obj `if test -f 'btrfs.c'; then $(CYGPATH_W) 'btrfs.c'; else $(CYGPATH_W) '$(srcdir)/btrfs.c'; fi` + +strace-cacheflush.o: cacheflush.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-cacheflush.o -MD -MP -MF $(DEPDIR)/strace-cacheflush.Tpo -c -o strace-cacheflush.o `test -f 'cacheflush.c' || echo '$(srcdir)/'`cacheflush.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-cacheflush.Tpo $(DEPDIR)/strace-cacheflush.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cacheflush.c' object='strace-cacheflush.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-cacheflush.o `test -f 'cacheflush.c' || echo '$(srcdir)/'`cacheflush.c + +strace-cacheflush.obj: cacheflush.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-cacheflush.obj -MD -MP -MF $(DEPDIR)/strace-cacheflush.Tpo -c -o strace-cacheflush.obj `if test -f 'cacheflush.c'; then $(CYGPATH_W) 'cacheflush.c'; else $(CYGPATH_W) '$(srcdir)/cacheflush.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-cacheflush.Tpo $(DEPDIR)/strace-cacheflush.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cacheflush.c' object='strace-cacheflush.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-cacheflush.obj `if test -f 'cacheflush.c'; then $(CYGPATH_W) 'cacheflush.c'; else $(CYGPATH_W) '$(srcdir)/cacheflush.c'; fi` + +strace-capability.o: capability.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-capability.o -MD -MP -MF $(DEPDIR)/strace-capability.Tpo -c -o strace-capability.o `test -f 'capability.c' || echo '$(srcdir)/'`capability.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-capability.Tpo $(DEPDIR)/strace-capability.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='capability.c' object='strace-capability.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-capability.o `test -f 'capability.c' || echo '$(srcdir)/'`capability.c + +strace-capability.obj: capability.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-capability.obj -MD -MP -MF $(DEPDIR)/strace-capability.Tpo -c -o strace-capability.obj `if test -f 'capability.c'; then $(CYGPATH_W) 'capability.c'; else $(CYGPATH_W) '$(srcdir)/capability.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-capability.Tpo $(DEPDIR)/strace-capability.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='capability.c' object='strace-capability.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-capability.obj `if test -f 'capability.c'; then $(CYGPATH_W) 'capability.c'; else $(CYGPATH_W) '$(srcdir)/capability.c'; fi` + +strace-chdir.o: chdir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-chdir.o -MD -MP -MF $(DEPDIR)/strace-chdir.Tpo -c -o strace-chdir.o `test -f 'chdir.c' || echo '$(srcdir)/'`chdir.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-chdir.Tpo $(DEPDIR)/strace-chdir.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chdir.c' object='strace-chdir.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-chdir.o `test -f 'chdir.c' || echo '$(srcdir)/'`chdir.c + +strace-chdir.obj: chdir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-chdir.obj -MD -MP -MF $(DEPDIR)/strace-chdir.Tpo -c -o strace-chdir.obj `if test -f 'chdir.c'; then $(CYGPATH_W) 'chdir.c'; else $(CYGPATH_W) '$(srcdir)/chdir.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-chdir.Tpo $(DEPDIR)/strace-chdir.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chdir.c' object='strace-chdir.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-chdir.obj `if test -f 'chdir.c'; then $(CYGPATH_W) 'chdir.c'; else $(CYGPATH_W) '$(srcdir)/chdir.c'; fi` + +strace-chmod.o: chmod.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-chmod.o -MD -MP -MF $(DEPDIR)/strace-chmod.Tpo -c -o strace-chmod.o `test -f 'chmod.c' || echo '$(srcdir)/'`chmod.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-chmod.Tpo $(DEPDIR)/strace-chmod.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chmod.c' object='strace-chmod.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-chmod.o `test -f 'chmod.c' || echo '$(srcdir)/'`chmod.c + +strace-chmod.obj: chmod.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-chmod.obj -MD -MP -MF $(DEPDIR)/strace-chmod.Tpo -c -o strace-chmod.obj `if test -f 'chmod.c'; then $(CYGPATH_W) 'chmod.c'; else $(CYGPATH_W) '$(srcdir)/chmod.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-chmod.Tpo $(DEPDIR)/strace-chmod.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chmod.c' object='strace-chmod.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-chmod.obj `if test -f 'chmod.c'; then $(CYGPATH_W) 'chmod.c'; else $(CYGPATH_W) '$(srcdir)/chmod.c'; fi` + +strace-clone.o: clone.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-clone.o -MD -MP -MF $(DEPDIR)/strace-clone.Tpo -c -o strace-clone.o `test -f 'clone.c' || echo '$(srcdir)/'`clone.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-clone.Tpo $(DEPDIR)/strace-clone.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clone.c' object='strace-clone.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-clone.o `test -f 'clone.c' || echo '$(srcdir)/'`clone.c + +strace-clone.obj: clone.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-clone.obj -MD -MP -MF $(DEPDIR)/strace-clone.Tpo -c -o strace-clone.obj `if test -f 'clone.c'; then $(CYGPATH_W) 'clone.c'; else $(CYGPATH_W) '$(srcdir)/clone.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-clone.Tpo $(DEPDIR)/strace-clone.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clone.c' object='strace-clone.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-clone.obj `if test -f 'clone.c'; then $(CYGPATH_W) 'clone.c'; else $(CYGPATH_W) '$(srcdir)/clone.c'; fi` + +strace-copy_file_range.o: copy_file_range.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-copy_file_range.o -MD -MP -MF $(DEPDIR)/strace-copy_file_range.Tpo -c -o strace-copy_file_range.o `test -f 'copy_file_range.c' || echo '$(srcdir)/'`copy_file_range.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-copy_file_range.Tpo $(DEPDIR)/strace-copy_file_range.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='copy_file_range.c' object='strace-copy_file_range.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-copy_file_range.o `test -f 'copy_file_range.c' || echo '$(srcdir)/'`copy_file_range.c + +strace-copy_file_range.obj: copy_file_range.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-copy_file_range.obj -MD -MP -MF $(DEPDIR)/strace-copy_file_range.Tpo -c -o strace-copy_file_range.obj `if test -f 'copy_file_range.c'; then $(CYGPATH_W) 'copy_file_range.c'; else $(CYGPATH_W) '$(srcdir)/copy_file_range.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-copy_file_range.Tpo $(DEPDIR)/strace-copy_file_range.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='copy_file_range.c' object='strace-copy_file_range.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-copy_file_range.obj `if test -f 'copy_file_range.c'; then $(CYGPATH_W) 'copy_file_range.c'; else $(CYGPATH_W) '$(srcdir)/copy_file_range.c'; fi` + +strace-count.o: count.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-count.o -MD -MP -MF $(DEPDIR)/strace-count.Tpo -c -o strace-count.o `test -f 'count.c' || echo '$(srcdir)/'`count.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-count.Tpo $(DEPDIR)/strace-count.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='count.c' object='strace-count.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-count.o `test -f 'count.c' || echo '$(srcdir)/'`count.c + +strace-count.obj: count.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-count.obj -MD -MP -MF $(DEPDIR)/strace-count.Tpo -c -o strace-count.obj `if test -f 'count.c'; then $(CYGPATH_W) 'count.c'; else $(CYGPATH_W) '$(srcdir)/count.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-count.Tpo $(DEPDIR)/strace-count.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='count.c' object='strace-count.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-count.obj `if test -f 'count.c'; then $(CYGPATH_W) 'count.c'; else $(CYGPATH_W) '$(srcdir)/count.c'; fi` + +strace-desc.o: desc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-desc.o -MD -MP -MF $(DEPDIR)/strace-desc.Tpo -c -o strace-desc.o `test -f 'desc.c' || echo '$(srcdir)/'`desc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-desc.Tpo $(DEPDIR)/strace-desc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desc.c' object='strace-desc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-desc.o `test -f 'desc.c' || echo '$(srcdir)/'`desc.c + +strace-desc.obj: desc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-desc.obj -MD -MP -MF $(DEPDIR)/strace-desc.Tpo -c -o strace-desc.obj `if test -f 'desc.c'; then $(CYGPATH_W) 'desc.c'; else $(CYGPATH_W) '$(srcdir)/desc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-desc.Tpo $(DEPDIR)/strace-desc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desc.c' object='strace-desc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-desc.obj `if test -f 'desc.c'; then $(CYGPATH_W) 'desc.c'; else $(CYGPATH_W) '$(srcdir)/desc.c'; fi` + +strace-dirent.o: dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dirent.o -MD -MP -MF $(DEPDIR)/strace-dirent.Tpo -c -o strace-dirent.o `test -f 'dirent.c' || echo '$(srcdir)/'`dirent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dirent.Tpo $(DEPDIR)/strace-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent.c' object='strace-dirent.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dirent.o `test -f 'dirent.c' || echo '$(srcdir)/'`dirent.c + +strace-dirent.obj: dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dirent.obj -MD -MP -MF $(DEPDIR)/strace-dirent.Tpo -c -o strace-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dirent.Tpo $(DEPDIR)/strace-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent.c' object='strace-dirent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` + +strace-dirent64.o: dirent64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dirent64.o -MD -MP -MF $(DEPDIR)/strace-dirent64.Tpo -c -o strace-dirent64.o `test -f 'dirent64.c' || echo '$(srcdir)/'`dirent64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dirent64.Tpo $(DEPDIR)/strace-dirent64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent64.c' object='strace-dirent64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dirent64.o `test -f 'dirent64.c' || echo '$(srcdir)/'`dirent64.c + +strace-dirent64.obj: dirent64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dirent64.obj -MD -MP -MF $(DEPDIR)/strace-dirent64.Tpo -c -o strace-dirent64.obj `if test -f 'dirent64.c'; then $(CYGPATH_W) 'dirent64.c'; else $(CYGPATH_W) '$(srcdir)/dirent64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dirent64.Tpo $(DEPDIR)/strace-dirent64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirent64.c' object='strace-dirent64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dirent64.obj `if test -f 'dirent64.c'; then $(CYGPATH_W) 'dirent64.c'; else $(CYGPATH_W) '$(srcdir)/dirent64.c'; fi` + +strace-dm.o: dm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dm.o -MD -MP -MF $(DEPDIR)/strace-dm.Tpo -c -o strace-dm.o `test -f 'dm.c' || echo '$(srcdir)/'`dm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dm.Tpo $(DEPDIR)/strace-dm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dm.c' object='strace-dm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dm.o `test -f 'dm.c' || echo '$(srcdir)/'`dm.c + +strace-dm.obj: dm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dm.obj -MD -MP -MF $(DEPDIR)/strace-dm.Tpo -c -o strace-dm.obj `if test -f 'dm.c'; then $(CYGPATH_W) 'dm.c'; else $(CYGPATH_W) '$(srcdir)/dm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dm.Tpo $(DEPDIR)/strace-dm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dm.c' object='strace-dm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dm.obj `if test -f 'dm.c'; then $(CYGPATH_W) 'dm.c'; else $(CYGPATH_W) '$(srcdir)/dm.c'; fi` + +strace-epoll.o: epoll.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-epoll.o -MD -MP -MF $(DEPDIR)/strace-epoll.Tpo -c -o strace-epoll.o `test -f 'epoll.c' || echo '$(srcdir)/'`epoll.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-epoll.Tpo $(DEPDIR)/strace-epoll.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='epoll.c' object='strace-epoll.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-epoll.o `test -f 'epoll.c' || echo '$(srcdir)/'`epoll.c + +strace-epoll.obj: epoll.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-epoll.obj -MD -MP -MF $(DEPDIR)/strace-epoll.Tpo -c -o strace-epoll.obj `if test -f 'epoll.c'; then $(CYGPATH_W) 'epoll.c'; else $(CYGPATH_W) '$(srcdir)/epoll.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-epoll.Tpo $(DEPDIR)/strace-epoll.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='epoll.c' object='strace-epoll.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-epoll.obj `if test -f 'epoll.c'; then $(CYGPATH_W) 'epoll.c'; else $(CYGPATH_W) '$(srcdir)/epoll.c'; fi` + +strace-evdev.o: evdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-evdev.o -MD -MP -MF $(DEPDIR)/strace-evdev.Tpo -c -o strace-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-evdev.Tpo $(DEPDIR)/strace-evdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='strace-evdev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c + +strace-evdev.obj: evdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-evdev.obj -MD -MP -MF $(DEPDIR)/strace-evdev.Tpo -c -o strace-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-evdev.Tpo $(DEPDIR)/strace-evdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='strace-evdev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` + +strace-eventfd.o: eventfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-eventfd.o -MD -MP -MF $(DEPDIR)/strace-eventfd.Tpo -c -o strace-eventfd.o `test -f 'eventfd.c' || echo '$(srcdir)/'`eventfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-eventfd.Tpo $(DEPDIR)/strace-eventfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='eventfd.c' object='strace-eventfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-eventfd.o `test -f 'eventfd.c' || echo '$(srcdir)/'`eventfd.c + +strace-eventfd.obj: eventfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-eventfd.obj -MD -MP -MF $(DEPDIR)/strace-eventfd.Tpo -c -o strace-eventfd.obj `if test -f 'eventfd.c'; then $(CYGPATH_W) 'eventfd.c'; else $(CYGPATH_W) '$(srcdir)/eventfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-eventfd.Tpo $(DEPDIR)/strace-eventfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='eventfd.c' object='strace-eventfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-eventfd.obj `if test -f 'eventfd.c'; then $(CYGPATH_W) 'eventfd.c'; else $(CYGPATH_W) '$(srcdir)/eventfd.c'; fi` + +strace-execve.o: execve.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-execve.o -MD -MP -MF $(DEPDIR)/strace-execve.Tpo -c -o strace-execve.o `test -f 'execve.c' || echo '$(srcdir)/'`execve.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-execve.Tpo $(DEPDIR)/strace-execve.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='execve.c' object='strace-execve.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-execve.o `test -f 'execve.c' || echo '$(srcdir)/'`execve.c + +strace-execve.obj: execve.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-execve.obj -MD -MP -MF $(DEPDIR)/strace-execve.Tpo -c -o strace-execve.obj `if test -f 'execve.c'; then $(CYGPATH_W) 'execve.c'; else $(CYGPATH_W) '$(srcdir)/execve.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-execve.Tpo $(DEPDIR)/strace-execve.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='execve.c' object='strace-execve.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-execve.obj `if test -f 'execve.c'; then $(CYGPATH_W) 'execve.c'; else $(CYGPATH_W) '$(srcdir)/execve.c'; fi` + +strace-fadvise.o: fadvise.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fadvise.o -MD -MP -MF $(DEPDIR)/strace-fadvise.Tpo -c -o strace-fadvise.o `test -f 'fadvise.c' || echo '$(srcdir)/'`fadvise.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fadvise.Tpo $(DEPDIR)/strace-fadvise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fadvise.c' object='strace-fadvise.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fadvise.o `test -f 'fadvise.c' || echo '$(srcdir)/'`fadvise.c + +strace-fadvise.obj: fadvise.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fadvise.obj -MD -MP -MF $(DEPDIR)/strace-fadvise.Tpo -c -o strace-fadvise.obj `if test -f 'fadvise.c'; then $(CYGPATH_W) 'fadvise.c'; else $(CYGPATH_W) '$(srcdir)/fadvise.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fadvise.Tpo $(DEPDIR)/strace-fadvise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fadvise.c' object='strace-fadvise.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fadvise.obj `if test -f 'fadvise.c'; then $(CYGPATH_W) 'fadvise.c'; else $(CYGPATH_W) '$(srcdir)/fadvise.c'; fi` + +strace-fallocate.o: fallocate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fallocate.o -MD -MP -MF $(DEPDIR)/strace-fallocate.Tpo -c -o strace-fallocate.o `test -f 'fallocate.c' || echo '$(srcdir)/'`fallocate.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fallocate.Tpo $(DEPDIR)/strace-fallocate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fallocate.c' object='strace-fallocate.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fallocate.o `test -f 'fallocate.c' || echo '$(srcdir)/'`fallocate.c + +strace-fallocate.obj: fallocate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fallocate.obj -MD -MP -MF $(DEPDIR)/strace-fallocate.Tpo -c -o strace-fallocate.obj `if test -f 'fallocate.c'; then $(CYGPATH_W) 'fallocate.c'; else $(CYGPATH_W) '$(srcdir)/fallocate.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fallocate.Tpo $(DEPDIR)/strace-fallocate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fallocate.c' object='strace-fallocate.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fallocate.obj `if test -f 'fallocate.c'; then $(CYGPATH_W) 'fallocate.c'; else $(CYGPATH_W) '$(srcdir)/fallocate.c'; fi` + +strace-fanotify.o: fanotify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fanotify.o -MD -MP -MF $(DEPDIR)/strace-fanotify.Tpo -c -o strace-fanotify.o `test -f 'fanotify.c' || echo '$(srcdir)/'`fanotify.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fanotify.Tpo $(DEPDIR)/strace-fanotify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fanotify.c' object='strace-fanotify.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fanotify.o `test -f 'fanotify.c' || echo '$(srcdir)/'`fanotify.c + +strace-fanotify.obj: fanotify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fanotify.obj -MD -MP -MF $(DEPDIR)/strace-fanotify.Tpo -c -o strace-fanotify.obj `if test -f 'fanotify.c'; then $(CYGPATH_W) 'fanotify.c'; else $(CYGPATH_W) '$(srcdir)/fanotify.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fanotify.Tpo $(DEPDIR)/strace-fanotify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fanotify.c' object='strace-fanotify.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fanotify.obj `if test -f 'fanotify.c'; then $(CYGPATH_W) 'fanotify.c'; else $(CYGPATH_W) '$(srcdir)/fanotify.c'; fi` + +strace-fchownat.o: fchownat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fchownat.o -MD -MP -MF $(DEPDIR)/strace-fchownat.Tpo -c -o strace-fchownat.o `test -f 'fchownat.c' || echo '$(srcdir)/'`fchownat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fchownat.Tpo $(DEPDIR)/strace-fchownat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fchownat.c' object='strace-fchownat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fchownat.o `test -f 'fchownat.c' || echo '$(srcdir)/'`fchownat.c + +strace-fchownat.obj: fchownat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fchownat.obj -MD -MP -MF $(DEPDIR)/strace-fchownat.Tpo -c -o strace-fchownat.obj `if test -f 'fchownat.c'; then $(CYGPATH_W) 'fchownat.c'; else $(CYGPATH_W) '$(srcdir)/fchownat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fchownat.Tpo $(DEPDIR)/strace-fchownat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fchownat.c' object='strace-fchownat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fchownat.obj `if test -f 'fchownat.c'; then $(CYGPATH_W) 'fchownat.c'; else $(CYGPATH_W) '$(srcdir)/fchownat.c'; fi` + +strace-fcntl.o: fcntl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fcntl.o -MD -MP -MF $(DEPDIR)/strace-fcntl.Tpo -c -o strace-fcntl.o `test -f 'fcntl.c' || echo '$(srcdir)/'`fcntl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fcntl.Tpo $(DEPDIR)/strace-fcntl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fcntl.c' object='strace-fcntl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fcntl.o `test -f 'fcntl.c' || echo '$(srcdir)/'`fcntl.c + +strace-fcntl.obj: fcntl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fcntl.obj -MD -MP -MF $(DEPDIR)/strace-fcntl.Tpo -c -o strace-fcntl.obj `if test -f 'fcntl.c'; then $(CYGPATH_W) 'fcntl.c'; else $(CYGPATH_W) '$(srcdir)/fcntl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fcntl.Tpo $(DEPDIR)/strace-fcntl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fcntl.c' object='strace-fcntl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fcntl.obj `if test -f 'fcntl.c'; then $(CYGPATH_W) 'fcntl.c'; else $(CYGPATH_W) '$(srcdir)/fcntl.c'; fi` + +strace-fetch_seccomp_fprog.o: fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_seccomp_fprog.o -MD -MP -MF $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo -c -o strace-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo $(DEPDIR)/strace-fetch_seccomp_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='strace-fetch_seccomp_fprog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c + +strace-fetch_seccomp_fprog.obj: fetch_seccomp_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_seccomp_fprog.obj -MD -MP -MF $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo -c -o strace-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo $(DEPDIR)/strace-fetch_seccomp_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='strace-fetch_seccomp_fprog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` + +strace-fetch_struct_flock.o: fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_flock.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_flock.Tpo -c -o strace-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_flock.Tpo $(DEPDIR)/strace-fetch_struct_flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_flock.c' object='strace-fetch_struct_flock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c + +strace-fetch_struct_flock.obj: fetch_struct_flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_flock.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_flock.Tpo -c -o strace-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_flock.Tpo $(DEPDIR)/strace-fetch_struct_flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_flock.c' object='strace-fetch_struct_flock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` + +strace-fetch_struct_mmsghdr.o: fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_mmsghdr.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_mmsghdr.Tpo -c -o strace-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_mmsghdr.Tpo $(DEPDIR)/strace-fetch_struct_mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_mmsghdr.c' object='strace-fetch_struct_mmsghdr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c + +strace-fetch_struct_mmsghdr.obj: fetch_struct_mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_mmsghdr.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_mmsghdr.Tpo -c -o strace-fetch_struct_mmsghdr.obj `if test -f 'fetch_struct_mmsghdr.c'; then $(CYGPATH_W) 'fetch_struct_mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_mmsghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_mmsghdr.Tpo $(DEPDIR)/strace-fetch_struct_mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_mmsghdr.c' object='strace-fetch_struct_mmsghdr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_mmsghdr.obj `if test -f 'fetch_struct_mmsghdr.c'; then $(CYGPATH_W) 'fetch_struct_mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_mmsghdr.c'; fi` + +strace-fetch_struct_msghdr.o: fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_msghdr.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_msghdr.Tpo -c -o strace-fetch_struct_msghdr.o `test -f 'fetch_struct_msghdr.c' || echo '$(srcdir)/'`fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_msghdr.Tpo $(DEPDIR)/strace-fetch_struct_msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_msghdr.c' object='strace-fetch_struct_msghdr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_msghdr.o `test -f 'fetch_struct_msghdr.c' || echo '$(srcdir)/'`fetch_struct_msghdr.c + +strace-fetch_struct_msghdr.obj: fetch_struct_msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_msghdr.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_msghdr.Tpo -c -o strace-fetch_struct_msghdr.obj `if test -f 'fetch_struct_msghdr.c'; then $(CYGPATH_W) 'fetch_struct_msghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_msghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_msghdr.Tpo $(DEPDIR)/strace-fetch_struct_msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_msghdr.c' object='strace-fetch_struct_msghdr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_msghdr.obj `if test -f 'fetch_struct_msghdr.c'; then $(CYGPATH_W) 'fetch_struct_msghdr.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_msghdr.c'; fi` + +strace-fetch_struct_stat.o: fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_stat.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_stat.Tpo -c -o strace-fetch_struct_stat.o `test -f 'fetch_struct_stat.c' || echo '$(srcdir)/'`fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_stat.Tpo $(DEPDIR)/strace-fetch_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat.c' object='strace-fetch_struct_stat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_stat.o `test -f 'fetch_struct_stat.c' || echo '$(srcdir)/'`fetch_struct_stat.c + +strace-fetch_struct_stat.obj: fetch_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_stat.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_stat.Tpo -c -o strace-fetch_struct_stat.obj `if test -f 'fetch_struct_stat.c'; then $(CYGPATH_W) 'fetch_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_stat.Tpo $(DEPDIR)/strace-fetch_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat.c' object='strace-fetch_struct_stat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_stat.obj `if test -f 'fetch_struct_stat.c'; then $(CYGPATH_W) 'fetch_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat.c'; fi` + +strace-fetch_struct_stat64.o: fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_stat64.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_stat64.Tpo -c -o strace-fetch_struct_stat64.o `test -f 'fetch_struct_stat64.c' || echo '$(srcdir)/'`fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_stat64.Tpo $(DEPDIR)/strace-fetch_struct_stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat64.c' object='strace-fetch_struct_stat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_stat64.o `test -f 'fetch_struct_stat64.c' || echo '$(srcdir)/'`fetch_struct_stat64.c + +strace-fetch_struct_stat64.obj: fetch_struct_stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_stat64.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_stat64.Tpo -c -o strace-fetch_struct_stat64.obj `if test -f 'fetch_struct_stat64.c'; then $(CYGPATH_W) 'fetch_struct_stat64.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_stat64.Tpo $(DEPDIR)/strace-fetch_struct_stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_stat64.c' object='strace-fetch_struct_stat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_stat64.obj `if test -f 'fetch_struct_stat64.c'; then $(CYGPATH_W) 'fetch_struct_stat64.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_stat64.c'; fi` + +strace-fetch_struct_statfs.o: fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_statfs.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_statfs.Tpo -c -o strace-fetch_struct_statfs.o `test -f 'fetch_struct_statfs.c' || echo '$(srcdir)/'`fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_statfs.Tpo $(DEPDIR)/strace-fetch_struct_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_statfs.c' object='strace-fetch_struct_statfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_statfs.o `test -f 'fetch_struct_statfs.c' || echo '$(srcdir)/'`fetch_struct_statfs.c + +strace-fetch_struct_statfs.obj: fetch_struct_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_statfs.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_statfs.Tpo -c -o strace-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_statfs.Tpo $(DEPDIR)/strace-fetch_struct_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_statfs.c' object='strace-fetch_struct_statfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` + +strace-file_handle.o: file_handle.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-file_handle.o -MD -MP -MF $(DEPDIR)/strace-file_handle.Tpo -c -o strace-file_handle.o `test -f 'file_handle.c' || echo '$(srcdir)/'`file_handle.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-file_handle.Tpo $(DEPDIR)/strace-file_handle.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_handle.c' object='strace-file_handle.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-file_handle.o `test -f 'file_handle.c' || echo '$(srcdir)/'`file_handle.c + +strace-file_handle.obj: file_handle.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-file_handle.obj -MD -MP -MF $(DEPDIR)/strace-file_handle.Tpo -c -o strace-file_handle.obj `if test -f 'file_handle.c'; then $(CYGPATH_W) 'file_handle.c'; else $(CYGPATH_W) '$(srcdir)/file_handle.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-file_handle.Tpo $(DEPDIR)/strace-file_handle.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_handle.c' object='strace-file_handle.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-file_handle.obj `if test -f 'file_handle.c'; then $(CYGPATH_W) 'file_handle.c'; else $(CYGPATH_W) '$(srcdir)/file_handle.c'; fi` + +strace-file_ioctl.o: file_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-file_ioctl.o -MD -MP -MF $(DEPDIR)/strace-file_ioctl.Tpo -c -o strace-file_ioctl.o `test -f 'file_ioctl.c' || echo '$(srcdir)/'`file_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-file_ioctl.Tpo $(DEPDIR)/strace-file_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_ioctl.c' object='strace-file_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-file_ioctl.o `test -f 'file_ioctl.c' || echo '$(srcdir)/'`file_ioctl.c + +strace-file_ioctl.obj: file_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-file_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-file_ioctl.Tpo -c -o strace-file_ioctl.obj `if test -f 'file_ioctl.c'; then $(CYGPATH_W) 'file_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/file_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-file_ioctl.Tpo $(DEPDIR)/strace-file_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_ioctl.c' object='strace-file_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-file_ioctl.obj `if test -f 'file_ioctl.c'; then $(CYGPATH_W) 'file_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/file_ioctl.c'; fi` + +strace-fs_x_ioctl.o: fs_x_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fs_x_ioctl.o -MD -MP -MF $(DEPDIR)/strace-fs_x_ioctl.Tpo -c -o strace-fs_x_ioctl.o `test -f 'fs_x_ioctl.c' || echo '$(srcdir)/'`fs_x_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fs_x_ioctl.Tpo $(DEPDIR)/strace-fs_x_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_x_ioctl.c' object='strace-fs_x_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fs_x_ioctl.o `test -f 'fs_x_ioctl.c' || echo '$(srcdir)/'`fs_x_ioctl.c + +strace-fs_x_ioctl.obj: fs_x_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fs_x_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-fs_x_ioctl.Tpo -c -o strace-fs_x_ioctl.obj `if test -f 'fs_x_ioctl.c'; then $(CYGPATH_W) 'fs_x_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/fs_x_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fs_x_ioctl.Tpo $(DEPDIR)/strace-fs_x_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_x_ioctl.c' object='strace-fs_x_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fs_x_ioctl.obj `if test -f 'fs_x_ioctl.c'; then $(CYGPATH_W) 'fs_x_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/fs_x_ioctl.c'; fi` + +strace-flock.o: flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-flock.o -MD -MP -MF $(DEPDIR)/strace-flock.Tpo -c -o strace-flock.o `test -f 'flock.c' || echo '$(srcdir)/'`flock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-flock.Tpo $(DEPDIR)/strace-flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flock.c' object='strace-flock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-flock.o `test -f 'flock.c' || echo '$(srcdir)/'`flock.c + +strace-flock.obj: flock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-flock.obj -MD -MP -MF $(DEPDIR)/strace-flock.Tpo -c -o strace-flock.obj `if test -f 'flock.c'; then $(CYGPATH_W) 'flock.c'; else $(CYGPATH_W) '$(srcdir)/flock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-flock.Tpo $(DEPDIR)/strace-flock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flock.c' object='strace-flock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-flock.obj `if test -f 'flock.c'; then $(CYGPATH_W) 'flock.c'; else $(CYGPATH_W) '$(srcdir)/flock.c'; fi` + +strace-futex.o: futex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-futex.o -MD -MP -MF $(DEPDIR)/strace-futex.Tpo -c -o strace-futex.o `test -f 'futex.c' || echo '$(srcdir)/'`futex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-futex.Tpo $(DEPDIR)/strace-futex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='futex.c' object='strace-futex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-futex.o `test -f 'futex.c' || echo '$(srcdir)/'`futex.c + +strace-futex.obj: futex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-futex.obj -MD -MP -MF $(DEPDIR)/strace-futex.Tpo -c -o strace-futex.obj `if test -f 'futex.c'; then $(CYGPATH_W) 'futex.c'; else $(CYGPATH_W) '$(srcdir)/futex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-futex.Tpo $(DEPDIR)/strace-futex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='futex.c' object='strace-futex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-futex.obj `if test -f 'futex.c'; then $(CYGPATH_W) 'futex.c'; else $(CYGPATH_W) '$(srcdir)/futex.c'; fi` + +strace-get_robust_list.o: get_robust_list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-get_robust_list.o -MD -MP -MF $(DEPDIR)/strace-get_robust_list.Tpo -c -o strace-get_robust_list.o `test -f 'get_robust_list.c' || echo '$(srcdir)/'`get_robust_list.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-get_robust_list.Tpo $(DEPDIR)/strace-get_robust_list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_robust_list.c' object='strace-get_robust_list.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-get_robust_list.o `test -f 'get_robust_list.c' || echo '$(srcdir)/'`get_robust_list.c + +strace-get_robust_list.obj: get_robust_list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-get_robust_list.obj -MD -MP -MF $(DEPDIR)/strace-get_robust_list.Tpo -c -o strace-get_robust_list.obj `if test -f 'get_robust_list.c'; then $(CYGPATH_W) 'get_robust_list.c'; else $(CYGPATH_W) '$(srcdir)/get_robust_list.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-get_robust_list.Tpo $(DEPDIR)/strace-get_robust_list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_robust_list.c' object='strace-get_robust_list.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-get_robust_list.obj `if test -f 'get_robust_list.c'; then $(CYGPATH_W) 'get_robust_list.c'; else $(CYGPATH_W) '$(srcdir)/get_robust_list.c'; fi` + +strace-getcpu.o: getcpu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-getcpu.o -MD -MP -MF $(DEPDIR)/strace-getcpu.Tpo -c -o strace-getcpu.o `test -f 'getcpu.c' || echo '$(srcdir)/'`getcpu.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-getcpu.Tpo $(DEPDIR)/strace-getcpu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getcpu.c' object='strace-getcpu.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-getcpu.o `test -f 'getcpu.c' || echo '$(srcdir)/'`getcpu.c + +strace-getcpu.obj: getcpu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-getcpu.obj -MD -MP -MF $(DEPDIR)/strace-getcpu.Tpo -c -o strace-getcpu.obj `if test -f 'getcpu.c'; then $(CYGPATH_W) 'getcpu.c'; else $(CYGPATH_W) '$(srcdir)/getcpu.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-getcpu.Tpo $(DEPDIR)/strace-getcpu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getcpu.c' object='strace-getcpu.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-getcpu.obj `if test -f 'getcpu.c'; then $(CYGPATH_W) 'getcpu.c'; else $(CYGPATH_W) '$(srcdir)/getcpu.c'; fi` + +strace-getcwd.o: getcwd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-getcwd.o -MD -MP -MF $(DEPDIR)/strace-getcwd.Tpo -c -o strace-getcwd.o `test -f 'getcwd.c' || echo '$(srcdir)/'`getcwd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-getcwd.Tpo $(DEPDIR)/strace-getcwd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getcwd.c' object='strace-getcwd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-getcwd.o `test -f 'getcwd.c' || echo '$(srcdir)/'`getcwd.c + +strace-getcwd.obj: getcwd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-getcwd.obj -MD -MP -MF $(DEPDIR)/strace-getcwd.Tpo -c -o strace-getcwd.obj `if test -f 'getcwd.c'; then $(CYGPATH_W) 'getcwd.c'; else $(CYGPATH_W) '$(srcdir)/getcwd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-getcwd.Tpo $(DEPDIR)/strace-getcwd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getcwd.c' object='strace-getcwd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-getcwd.obj `if test -f 'getcwd.c'; then $(CYGPATH_W) 'getcwd.c'; else $(CYGPATH_W) '$(srcdir)/getcwd.c'; fi` + +strace-getrandom.o: getrandom.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-getrandom.o -MD -MP -MF $(DEPDIR)/strace-getrandom.Tpo -c -o strace-getrandom.o `test -f 'getrandom.c' || echo '$(srcdir)/'`getrandom.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-getrandom.Tpo $(DEPDIR)/strace-getrandom.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getrandom.c' object='strace-getrandom.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-getrandom.o `test -f 'getrandom.c' || echo '$(srcdir)/'`getrandom.c + +strace-getrandom.obj: getrandom.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-getrandom.obj -MD -MP -MF $(DEPDIR)/strace-getrandom.Tpo -c -o strace-getrandom.obj `if test -f 'getrandom.c'; then $(CYGPATH_W) 'getrandom.c'; else $(CYGPATH_W) '$(srcdir)/getrandom.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-getrandom.Tpo $(DEPDIR)/strace-getrandom.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getrandom.c' object='strace-getrandom.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-getrandom.obj `if test -f 'getrandom.c'; then $(CYGPATH_W) 'getrandom.c'; else $(CYGPATH_W) '$(srcdir)/getrandom.c'; fi` + +strace-hdio.o: hdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-hdio.o -MD -MP -MF $(DEPDIR)/strace-hdio.Tpo -c -o strace-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-hdio.Tpo $(DEPDIR)/strace-hdio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdio.c' object='strace-hdio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c + +strace-hdio.obj: hdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-hdio.obj -MD -MP -MF $(DEPDIR)/strace-hdio.Tpo -c -o strace-hdio.obj `if test -f 'hdio.c'; then $(CYGPATH_W) 'hdio.c'; else $(CYGPATH_W) '$(srcdir)/hdio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-hdio.Tpo $(DEPDIR)/strace-hdio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdio.c' object='strace-hdio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-hdio.obj `if test -f 'hdio.c'; then $(CYGPATH_W) 'hdio.c'; else $(CYGPATH_W) '$(srcdir)/hdio.c'; fi` + +strace-hostname.o: hostname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-hostname.o -MD -MP -MF $(DEPDIR)/strace-hostname.Tpo -c -o strace-hostname.o `test -f 'hostname.c' || echo '$(srcdir)/'`hostname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-hostname.Tpo $(DEPDIR)/strace-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostname.c' object='strace-hostname.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-hostname.o `test -f 'hostname.c' || echo '$(srcdir)/'`hostname.c + +strace-hostname.obj: hostname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-hostname.obj -MD -MP -MF $(DEPDIR)/strace-hostname.Tpo -c -o strace-hostname.obj `if test -f 'hostname.c'; then $(CYGPATH_W) 'hostname.c'; else $(CYGPATH_W) '$(srcdir)/hostname.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-hostname.Tpo $(DEPDIR)/strace-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostname.c' object='strace-hostname.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-hostname.obj `if test -f 'hostname.c'; then $(CYGPATH_W) 'hostname.c'; else $(CYGPATH_W) '$(srcdir)/hostname.c'; fi` + +strace-inotify.o: inotify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-inotify.o -MD -MP -MF $(DEPDIR)/strace-inotify.Tpo -c -o strace-inotify.o `test -f 'inotify.c' || echo '$(srcdir)/'`inotify.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-inotify.Tpo $(DEPDIR)/strace-inotify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inotify.c' object='strace-inotify.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-inotify.o `test -f 'inotify.c' || echo '$(srcdir)/'`inotify.c + +strace-inotify.obj: inotify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-inotify.obj -MD -MP -MF $(DEPDIR)/strace-inotify.Tpo -c -o strace-inotify.obj `if test -f 'inotify.c'; then $(CYGPATH_W) 'inotify.c'; else $(CYGPATH_W) '$(srcdir)/inotify.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-inotify.Tpo $(DEPDIR)/strace-inotify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inotify.c' object='strace-inotify.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-inotify.obj `if test -f 'inotify.c'; then $(CYGPATH_W) 'inotify.c'; else $(CYGPATH_W) '$(srcdir)/inotify.c'; fi` + +strace-io.o: io.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-io.o -MD -MP -MF $(DEPDIR)/strace-io.Tpo -c -o strace-io.o `test -f 'io.c' || echo '$(srcdir)/'`io.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-io.Tpo $(DEPDIR)/strace-io.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io.c' object='strace-io.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-io.o `test -f 'io.c' || echo '$(srcdir)/'`io.c + +strace-io.obj: io.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-io.obj -MD -MP -MF $(DEPDIR)/strace-io.Tpo -c -o strace-io.obj `if test -f 'io.c'; then $(CYGPATH_W) 'io.c'; else $(CYGPATH_W) '$(srcdir)/io.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-io.Tpo $(DEPDIR)/strace-io.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io.c' object='strace-io.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-io.obj `if test -f 'io.c'; then $(CYGPATH_W) 'io.c'; else $(CYGPATH_W) '$(srcdir)/io.c'; fi` + +strace-ioctl.o: ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ioctl.o -MD -MP -MF $(DEPDIR)/strace-ioctl.Tpo -c -o strace-ioctl.o `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioctl.Tpo $(DEPDIR)/strace-ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioctl.c' object='strace-ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ioctl.o `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c + +strace-ioctl.obj: ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ioctl.obj -MD -MP -MF $(DEPDIR)/strace-ioctl.Tpo -c -o strace-ioctl.obj `if test -f 'ioctl.c'; then $(CYGPATH_W) 'ioctl.c'; else $(CYGPATH_W) '$(srcdir)/ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioctl.Tpo $(DEPDIR)/strace-ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioctl.c' object='strace-ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ioctl.obj `if test -f 'ioctl.c'; then $(CYGPATH_W) 'ioctl.c'; else $(CYGPATH_W) '$(srcdir)/ioctl.c'; fi` + +strace-ioperm.o: ioperm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ioperm.o -MD -MP -MF $(DEPDIR)/strace-ioperm.Tpo -c -o strace-ioperm.o `test -f 'ioperm.c' || echo '$(srcdir)/'`ioperm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioperm.Tpo $(DEPDIR)/strace-ioperm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioperm.c' object='strace-ioperm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ioperm.o `test -f 'ioperm.c' || echo '$(srcdir)/'`ioperm.c + +strace-ioperm.obj: ioperm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ioperm.obj -MD -MP -MF $(DEPDIR)/strace-ioperm.Tpo -c -o strace-ioperm.obj `if test -f 'ioperm.c'; then $(CYGPATH_W) 'ioperm.c'; else $(CYGPATH_W) '$(srcdir)/ioperm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioperm.Tpo $(DEPDIR)/strace-ioperm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioperm.c' object='strace-ioperm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ioperm.obj `if test -f 'ioperm.c'; then $(CYGPATH_W) 'ioperm.c'; else $(CYGPATH_W) '$(srcdir)/ioperm.c'; fi` + +strace-iopl.o: iopl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-iopl.o -MD -MP -MF $(DEPDIR)/strace-iopl.Tpo -c -o strace-iopl.o `test -f 'iopl.c' || echo '$(srcdir)/'`iopl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-iopl.Tpo $(DEPDIR)/strace-iopl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iopl.c' object='strace-iopl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-iopl.o `test -f 'iopl.c' || echo '$(srcdir)/'`iopl.c + +strace-iopl.obj: iopl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-iopl.obj -MD -MP -MF $(DEPDIR)/strace-iopl.Tpo -c -o strace-iopl.obj `if test -f 'iopl.c'; then $(CYGPATH_W) 'iopl.c'; else $(CYGPATH_W) '$(srcdir)/iopl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-iopl.Tpo $(DEPDIR)/strace-iopl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iopl.c' object='strace-iopl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-iopl.obj `if test -f 'iopl.c'; then $(CYGPATH_W) 'iopl.c'; else $(CYGPATH_W) '$(srcdir)/iopl.c'; fi` + +strace-ioprio.o: ioprio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ioprio.o -MD -MP -MF $(DEPDIR)/strace-ioprio.Tpo -c -o strace-ioprio.o `test -f 'ioprio.c' || echo '$(srcdir)/'`ioprio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioprio.Tpo $(DEPDIR)/strace-ioprio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioprio.c' object='strace-ioprio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ioprio.o `test -f 'ioprio.c' || echo '$(srcdir)/'`ioprio.c + +strace-ioprio.obj: ioprio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ioprio.obj -MD -MP -MF $(DEPDIR)/strace-ioprio.Tpo -c -o strace-ioprio.obj `if test -f 'ioprio.c'; then $(CYGPATH_W) 'ioprio.c'; else $(CYGPATH_W) '$(srcdir)/ioprio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioprio.Tpo $(DEPDIR)/strace-ioprio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioprio.c' object='strace-ioprio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ioprio.obj `if test -f 'ioprio.c'; then $(CYGPATH_W) 'ioprio.c'; else $(CYGPATH_W) '$(srcdir)/ioprio.c'; fi` + +strace-ipc_msg.o: ipc_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_msg.o -MD -MP -MF $(DEPDIR)/strace-ipc_msg.Tpo -c -o strace-ipc_msg.o `test -f 'ipc_msg.c' || echo '$(srcdir)/'`ipc_msg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_msg.Tpo $(DEPDIR)/strace-ipc_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msg.c' object='strace-ipc_msg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_msg.o `test -f 'ipc_msg.c' || echo '$(srcdir)/'`ipc_msg.c + +strace-ipc_msg.obj: ipc_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_msg.obj -MD -MP -MF $(DEPDIR)/strace-ipc_msg.Tpo -c -o strace-ipc_msg.obj `if test -f 'ipc_msg.c'; then $(CYGPATH_W) 'ipc_msg.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_msg.Tpo $(DEPDIR)/strace-ipc_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msg.c' object='strace-ipc_msg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_msg.obj `if test -f 'ipc_msg.c'; then $(CYGPATH_W) 'ipc_msg.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msg.c'; fi` + +strace-ipc_msgctl.o: ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_msgctl.o -MD -MP -MF $(DEPDIR)/strace-ipc_msgctl.Tpo -c -o strace-ipc_msgctl.o `test -f 'ipc_msgctl.c' || echo '$(srcdir)/'`ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_msgctl.Tpo $(DEPDIR)/strace-ipc_msgctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msgctl.c' object='strace-ipc_msgctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_msgctl.o `test -f 'ipc_msgctl.c' || echo '$(srcdir)/'`ipc_msgctl.c + +strace-ipc_msgctl.obj: ipc_msgctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_msgctl.obj -MD -MP -MF $(DEPDIR)/strace-ipc_msgctl.Tpo -c -o strace-ipc_msgctl.obj `if test -f 'ipc_msgctl.c'; then $(CYGPATH_W) 'ipc_msgctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msgctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_msgctl.Tpo $(DEPDIR)/strace-ipc_msgctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_msgctl.c' object='strace-ipc_msgctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_msgctl.obj `if test -f 'ipc_msgctl.c'; then $(CYGPATH_W) 'ipc_msgctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_msgctl.c'; fi` + +strace-ipc_sem.o: ipc_sem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_sem.o -MD -MP -MF $(DEPDIR)/strace-ipc_sem.Tpo -c -o strace-ipc_sem.o `test -f 'ipc_sem.c' || echo '$(srcdir)/'`ipc_sem.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_sem.Tpo $(DEPDIR)/strace-ipc_sem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_sem.c' object='strace-ipc_sem.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_sem.o `test -f 'ipc_sem.c' || echo '$(srcdir)/'`ipc_sem.c + +strace-ipc_sem.obj: ipc_sem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_sem.obj -MD -MP -MF $(DEPDIR)/strace-ipc_sem.Tpo -c -o strace-ipc_sem.obj `if test -f 'ipc_sem.c'; then $(CYGPATH_W) 'ipc_sem.c'; else $(CYGPATH_W) '$(srcdir)/ipc_sem.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_sem.Tpo $(DEPDIR)/strace-ipc_sem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_sem.c' object='strace-ipc_sem.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_sem.obj `if test -f 'ipc_sem.c'; then $(CYGPATH_W) 'ipc_sem.c'; else $(CYGPATH_W) '$(srcdir)/ipc_sem.c'; fi` + +strace-ipc_shm.o: ipc_shm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_shm.o -MD -MP -MF $(DEPDIR)/strace-ipc_shm.Tpo -c -o strace-ipc_shm.o `test -f 'ipc_shm.c' || echo '$(srcdir)/'`ipc_shm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_shm.Tpo $(DEPDIR)/strace-ipc_shm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shm.c' object='strace-ipc_shm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_shm.o `test -f 'ipc_shm.c' || echo '$(srcdir)/'`ipc_shm.c + +strace-ipc_shm.obj: ipc_shm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_shm.obj -MD -MP -MF $(DEPDIR)/strace-ipc_shm.Tpo -c -o strace-ipc_shm.obj `if test -f 'ipc_shm.c'; then $(CYGPATH_W) 'ipc_shm.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_shm.Tpo $(DEPDIR)/strace-ipc_shm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shm.c' object='strace-ipc_shm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_shm.obj `if test -f 'ipc_shm.c'; then $(CYGPATH_W) 'ipc_shm.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shm.c'; fi` + +strace-ipc_shmctl.o: ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_shmctl.o -MD -MP -MF $(DEPDIR)/strace-ipc_shmctl.Tpo -c -o strace-ipc_shmctl.o `test -f 'ipc_shmctl.c' || echo '$(srcdir)/'`ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_shmctl.Tpo $(DEPDIR)/strace-ipc_shmctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shmctl.c' object='strace-ipc_shmctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_shmctl.o `test -f 'ipc_shmctl.c' || echo '$(srcdir)/'`ipc_shmctl.c + +strace-ipc_shmctl.obj: ipc_shmctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ipc_shmctl.obj -MD -MP -MF $(DEPDIR)/strace-ipc_shmctl.Tpo -c -o strace-ipc_shmctl.obj `if test -f 'ipc_shmctl.c'; then $(CYGPATH_W) 'ipc_shmctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shmctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ipc_shmctl.Tpo $(DEPDIR)/strace-ipc_shmctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipc_shmctl.c' object='strace-ipc_shmctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ipc_shmctl.obj `if test -f 'ipc_shmctl.c'; then $(CYGPATH_W) 'ipc_shmctl.c'; else $(CYGPATH_W) '$(srcdir)/ipc_shmctl.c'; fi` + +strace-kcmp.o: kcmp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kcmp.o -MD -MP -MF $(DEPDIR)/strace-kcmp.Tpo -c -o strace-kcmp.o `test -f 'kcmp.c' || echo '$(srcdir)/'`kcmp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kcmp.Tpo $(DEPDIR)/strace-kcmp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kcmp.c' object='strace-kcmp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kcmp.o `test -f 'kcmp.c' || echo '$(srcdir)/'`kcmp.c + +strace-kcmp.obj: kcmp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kcmp.obj -MD -MP -MF $(DEPDIR)/strace-kcmp.Tpo -c -o strace-kcmp.obj `if test -f 'kcmp.c'; then $(CYGPATH_W) 'kcmp.c'; else $(CYGPATH_W) '$(srcdir)/kcmp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kcmp.Tpo $(DEPDIR)/strace-kcmp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kcmp.c' object='strace-kcmp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kcmp.obj `if test -f 'kcmp.c'; then $(CYGPATH_W) 'kcmp.c'; else $(CYGPATH_W) '$(srcdir)/kcmp.c'; fi` + +strace-kexec.o: kexec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kexec.o -MD -MP -MF $(DEPDIR)/strace-kexec.Tpo -c -o strace-kexec.o `test -f 'kexec.c' || echo '$(srcdir)/'`kexec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kexec.Tpo $(DEPDIR)/strace-kexec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kexec.c' object='strace-kexec.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kexec.o `test -f 'kexec.c' || echo '$(srcdir)/'`kexec.c + +strace-kexec.obj: kexec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kexec.obj -MD -MP -MF $(DEPDIR)/strace-kexec.Tpo -c -o strace-kexec.obj `if test -f 'kexec.c'; then $(CYGPATH_W) 'kexec.c'; else $(CYGPATH_W) '$(srcdir)/kexec.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kexec.Tpo $(DEPDIR)/strace-kexec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kexec.c' object='strace-kexec.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kexec.obj `if test -f 'kexec.c'; then $(CYGPATH_W) 'kexec.c'; else $(CYGPATH_W) '$(srcdir)/kexec.c'; fi` + +strace-keyctl.o: keyctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-keyctl.o -MD -MP -MF $(DEPDIR)/strace-keyctl.Tpo -c -o strace-keyctl.o `test -f 'keyctl.c' || echo '$(srcdir)/'`keyctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-keyctl.Tpo $(DEPDIR)/strace-keyctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyctl.c' object='strace-keyctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-keyctl.o `test -f 'keyctl.c' || echo '$(srcdir)/'`keyctl.c + +strace-keyctl.obj: keyctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-keyctl.obj -MD -MP -MF $(DEPDIR)/strace-keyctl.Tpo -c -o strace-keyctl.obj `if test -f 'keyctl.c'; then $(CYGPATH_W) 'keyctl.c'; else $(CYGPATH_W) '$(srcdir)/keyctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-keyctl.Tpo $(DEPDIR)/strace-keyctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyctl.c' object='strace-keyctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-keyctl.obj `if test -f 'keyctl.c'; then $(CYGPATH_W) 'keyctl.c'; else $(CYGPATH_W) '$(srcdir)/keyctl.c'; fi` + +strace-ldt.o: ldt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ldt.o -MD -MP -MF $(DEPDIR)/strace-ldt.Tpo -c -o strace-ldt.o `test -f 'ldt.c' || echo '$(srcdir)/'`ldt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ldt.Tpo $(DEPDIR)/strace-ldt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldt.c' object='strace-ldt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ldt.o `test -f 'ldt.c' || echo '$(srcdir)/'`ldt.c + +strace-ldt.obj: ldt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ldt.obj -MD -MP -MF $(DEPDIR)/strace-ldt.Tpo -c -o strace-ldt.obj `if test -f 'ldt.c'; then $(CYGPATH_W) 'ldt.c'; else $(CYGPATH_W) '$(srcdir)/ldt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ldt.Tpo $(DEPDIR)/strace-ldt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldt.c' object='strace-ldt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ldt.obj `if test -f 'ldt.c'; then $(CYGPATH_W) 'ldt.c'; else $(CYGPATH_W) '$(srcdir)/ldt.c'; fi` + +strace-link.o: link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-link.o -MD -MP -MF $(DEPDIR)/strace-link.Tpo -c -o strace-link.o `test -f 'link.c' || echo '$(srcdir)/'`link.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-link.Tpo $(DEPDIR)/strace-link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='link.c' object='strace-link.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-link.o `test -f 'link.c' || echo '$(srcdir)/'`link.c + +strace-link.obj: link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-link.obj -MD -MP -MF $(DEPDIR)/strace-link.Tpo -c -o strace-link.obj `if test -f 'link.c'; then $(CYGPATH_W) 'link.c'; else $(CYGPATH_W) '$(srcdir)/link.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-link.Tpo $(DEPDIR)/strace-link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='link.c' object='strace-link.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-link.obj `if test -f 'link.c'; then $(CYGPATH_W) 'link.c'; else $(CYGPATH_W) '$(srcdir)/link.c'; fi` + +strace-lookup_dcookie.o: lookup_dcookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-lookup_dcookie.o -MD -MP -MF $(DEPDIR)/strace-lookup_dcookie.Tpo -c -o strace-lookup_dcookie.o `test -f 'lookup_dcookie.c' || echo '$(srcdir)/'`lookup_dcookie.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-lookup_dcookie.Tpo $(DEPDIR)/strace-lookup_dcookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lookup_dcookie.c' object='strace-lookup_dcookie.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-lookup_dcookie.o `test -f 'lookup_dcookie.c' || echo '$(srcdir)/'`lookup_dcookie.c + +strace-lookup_dcookie.obj: lookup_dcookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-lookup_dcookie.obj -MD -MP -MF $(DEPDIR)/strace-lookup_dcookie.Tpo -c -o strace-lookup_dcookie.obj `if test -f 'lookup_dcookie.c'; then $(CYGPATH_W) 'lookup_dcookie.c'; else $(CYGPATH_W) '$(srcdir)/lookup_dcookie.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-lookup_dcookie.Tpo $(DEPDIR)/strace-lookup_dcookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lookup_dcookie.c' object='strace-lookup_dcookie.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-lookup_dcookie.obj `if test -f 'lookup_dcookie.c'; then $(CYGPATH_W) 'lookup_dcookie.c'; else $(CYGPATH_W) '$(srcdir)/lookup_dcookie.c'; fi` + +strace-loop.o: loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-loop.o -MD -MP -MF $(DEPDIR)/strace-loop.Tpo -c -o strace-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-loop.Tpo $(DEPDIR)/strace-loop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='strace-loop.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-loop.o `test -f 'loop.c' || echo '$(srcdir)/'`loop.c + +strace-loop.obj: loop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-loop.obj -MD -MP -MF $(DEPDIR)/strace-loop.Tpo -c -o strace-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-loop.Tpo $(DEPDIR)/strace-loop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loop.c' object='strace-loop.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-loop.obj `if test -f 'loop.c'; then $(CYGPATH_W) 'loop.c'; else $(CYGPATH_W) '$(srcdir)/loop.c'; fi` + +strace-lseek.o: lseek.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-lseek.o -MD -MP -MF $(DEPDIR)/strace-lseek.Tpo -c -o strace-lseek.o `test -f 'lseek.c' || echo '$(srcdir)/'`lseek.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-lseek.Tpo $(DEPDIR)/strace-lseek.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lseek.c' object='strace-lseek.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-lseek.o `test -f 'lseek.c' || echo '$(srcdir)/'`lseek.c + +strace-lseek.obj: lseek.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-lseek.obj -MD -MP -MF $(DEPDIR)/strace-lseek.Tpo -c -o strace-lseek.obj `if test -f 'lseek.c'; then $(CYGPATH_W) 'lseek.c'; else $(CYGPATH_W) '$(srcdir)/lseek.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-lseek.Tpo $(DEPDIR)/strace-lseek.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lseek.c' object='strace-lseek.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-lseek.obj `if test -f 'lseek.c'; then $(CYGPATH_W) 'lseek.c'; else $(CYGPATH_W) '$(srcdir)/lseek.c'; fi` + +strace-mem.o: mem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mem.o -MD -MP -MF $(DEPDIR)/strace-mem.Tpo -c -o strace-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mem.Tpo $(DEPDIR)/strace-mem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mem.c' object='strace-mem.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c + +strace-mem.obj: mem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mem.obj -MD -MP -MF $(DEPDIR)/strace-mem.Tpo -c -o strace-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mem.Tpo $(DEPDIR)/strace-mem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mem.c' object='strace-mem.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` + +strace-membarrier.o: membarrier.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-membarrier.o -MD -MP -MF $(DEPDIR)/strace-membarrier.Tpo -c -o strace-membarrier.o `test -f 'membarrier.c' || echo '$(srcdir)/'`membarrier.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-membarrier.Tpo $(DEPDIR)/strace-membarrier.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='membarrier.c' object='strace-membarrier.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-membarrier.o `test -f 'membarrier.c' || echo '$(srcdir)/'`membarrier.c + +strace-membarrier.obj: membarrier.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-membarrier.obj -MD -MP -MF $(DEPDIR)/strace-membarrier.Tpo -c -o strace-membarrier.obj `if test -f 'membarrier.c'; then $(CYGPATH_W) 'membarrier.c'; else $(CYGPATH_W) '$(srcdir)/membarrier.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-membarrier.Tpo $(DEPDIR)/strace-membarrier.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='membarrier.c' object='strace-membarrier.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-membarrier.obj `if test -f 'membarrier.c'; then $(CYGPATH_W) 'membarrier.c'; else $(CYGPATH_W) '$(srcdir)/membarrier.c'; fi` + +strace-memfd_create.o: memfd_create.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-memfd_create.o -MD -MP -MF $(DEPDIR)/strace-memfd_create.Tpo -c -o strace-memfd_create.o `test -f 'memfd_create.c' || echo '$(srcdir)/'`memfd_create.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-memfd_create.Tpo $(DEPDIR)/strace-memfd_create.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memfd_create.c' object='strace-memfd_create.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-memfd_create.o `test -f 'memfd_create.c' || echo '$(srcdir)/'`memfd_create.c + +strace-memfd_create.obj: memfd_create.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-memfd_create.obj -MD -MP -MF $(DEPDIR)/strace-memfd_create.Tpo -c -o strace-memfd_create.obj `if test -f 'memfd_create.c'; then $(CYGPATH_W) 'memfd_create.c'; else $(CYGPATH_W) '$(srcdir)/memfd_create.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-memfd_create.Tpo $(DEPDIR)/strace-memfd_create.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memfd_create.c' object='strace-memfd_create.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-memfd_create.obj `if test -f 'memfd_create.c'; then $(CYGPATH_W) 'memfd_create.c'; else $(CYGPATH_W) '$(srcdir)/memfd_create.c'; fi` + +strace-mknod.o: mknod.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mknod.o -MD -MP -MF $(DEPDIR)/strace-mknod.Tpo -c -o strace-mknod.o `test -f 'mknod.c' || echo '$(srcdir)/'`mknod.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mknod.Tpo $(DEPDIR)/strace-mknod.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mknod.c' object='strace-mknod.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mknod.o `test -f 'mknod.c' || echo '$(srcdir)/'`mknod.c + +strace-mknod.obj: mknod.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mknod.obj -MD -MP -MF $(DEPDIR)/strace-mknod.Tpo -c -o strace-mknod.obj `if test -f 'mknod.c'; then $(CYGPATH_W) 'mknod.c'; else $(CYGPATH_W) '$(srcdir)/mknod.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mknod.Tpo $(DEPDIR)/strace-mknod.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mknod.c' object='strace-mknod.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mknod.obj `if test -f 'mknod.c'; then $(CYGPATH_W) 'mknod.c'; else $(CYGPATH_W) '$(srcdir)/mknod.c'; fi` + +strace-mmsghdr.o: mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mmsghdr.o -MD -MP -MF $(DEPDIR)/strace-mmsghdr.Tpo -c -o strace-mmsghdr.o `test -f 'mmsghdr.c' || echo '$(srcdir)/'`mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mmsghdr.Tpo $(DEPDIR)/strace-mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmsghdr.c' object='strace-mmsghdr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mmsghdr.o `test -f 'mmsghdr.c' || echo '$(srcdir)/'`mmsghdr.c + +strace-mmsghdr.obj: mmsghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mmsghdr.obj -MD -MP -MF $(DEPDIR)/strace-mmsghdr.Tpo -c -o strace-mmsghdr.obj `if test -f 'mmsghdr.c'; then $(CYGPATH_W) 'mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/mmsghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mmsghdr.Tpo $(DEPDIR)/strace-mmsghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmsghdr.c' object='strace-mmsghdr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mmsghdr.obj `if test -f 'mmsghdr.c'; then $(CYGPATH_W) 'mmsghdr.c'; else $(CYGPATH_W) '$(srcdir)/mmsghdr.c'; fi` + +strace-mount.o: mount.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mount.o -MD -MP -MF $(DEPDIR)/strace-mount.Tpo -c -o strace-mount.o `test -f 'mount.c' || echo '$(srcdir)/'`mount.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mount.Tpo $(DEPDIR)/strace-mount.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mount.c' object='strace-mount.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mount.o `test -f 'mount.c' || echo '$(srcdir)/'`mount.c + +strace-mount.obj: mount.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mount.obj -MD -MP -MF $(DEPDIR)/strace-mount.Tpo -c -o strace-mount.obj `if test -f 'mount.c'; then $(CYGPATH_W) 'mount.c'; else $(CYGPATH_W) '$(srcdir)/mount.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mount.Tpo $(DEPDIR)/strace-mount.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mount.c' object='strace-mount.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mount.obj `if test -f 'mount.c'; then $(CYGPATH_W) 'mount.c'; else $(CYGPATH_W) '$(srcdir)/mount.c'; fi` + +strace-mq.o: mq.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mq.o -MD -MP -MF $(DEPDIR)/strace-mq.Tpo -c -o strace-mq.o `test -f 'mq.c' || echo '$(srcdir)/'`mq.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mq.Tpo $(DEPDIR)/strace-mq.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mq.c' object='strace-mq.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mq.o `test -f 'mq.c' || echo '$(srcdir)/'`mq.c + +strace-mq.obj: mq.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mq.obj -MD -MP -MF $(DEPDIR)/strace-mq.Tpo -c -o strace-mq.obj `if test -f 'mq.c'; then $(CYGPATH_W) 'mq.c'; else $(CYGPATH_W) '$(srcdir)/mq.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mq.Tpo $(DEPDIR)/strace-mq.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mq.c' object='strace-mq.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mq.obj `if test -f 'mq.c'; then $(CYGPATH_W) 'mq.c'; else $(CYGPATH_W) '$(srcdir)/mq.c'; fi` + +strace-msghdr.o: msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-msghdr.o -MD -MP -MF $(DEPDIR)/strace-msghdr.Tpo -c -o strace-msghdr.o `test -f 'msghdr.c' || echo '$(srcdir)/'`msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-msghdr.Tpo $(DEPDIR)/strace-msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msghdr.c' object='strace-msghdr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-msghdr.o `test -f 'msghdr.c' || echo '$(srcdir)/'`msghdr.c + +strace-msghdr.obj: msghdr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-msghdr.obj -MD -MP -MF $(DEPDIR)/strace-msghdr.Tpo -c -o strace-msghdr.obj `if test -f 'msghdr.c'; then $(CYGPATH_W) 'msghdr.c'; else $(CYGPATH_W) '$(srcdir)/msghdr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-msghdr.Tpo $(DEPDIR)/strace-msghdr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msghdr.c' object='strace-msghdr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-msghdr.obj `if test -f 'msghdr.c'; then $(CYGPATH_W) 'msghdr.c'; else $(CYGPATH_W) '$(srcdir)/msghdr.c'; fi` + +strace-mtd.o: mtd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mtd.o -MD -MP -MF $(DEPDIR)/strace-mtd.Tpo -c -o strace-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mtd.Tpo $(DEPDIR)/strace-mtd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='strace-mtd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mtd.o `test -f 'mtd.c' || echo '$(srcdir)/'`mtd.c + +strace-mtd.obj: mtd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mtd.obj -MD -MP -MF $(DEPDIR)/strace-mtd.Tpo -c -o strace-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mtd.Tpo $(DEPDIR)/strace-mtd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtd.c' object='strace-mtd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` + +strace-net.o: net.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-net.o -MD -MP -MF $(DEPDIR)/strace-net.Tpo -c -o strace-net.o `test -f 'net.c' || echo '$(srcdir)/'`net.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-net.Tpo $(DEPDIR)/strace-net.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='net.c' object='strace-net.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-net.o `test -f 'net.c' || echo '$(srcdir)/'`net.c + +strace-net.obj: net.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-net.obj -MD -MP -MF $(DEPDIR)/strace-net.Tpo -c -o strace-net.obj `if test -f 'net.c'; then $(CYGPATH_W) 'net.c'; else $(CYGPATH_W) '$(srcdir)/net.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-net.Tpo $(DEPDIR)/strace-net.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='net.c' object='strace-net.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-net.obj `if test -f 'net.c'; then $(CYGPATH_W) 'net.c'; else $(CYGPATH_W) '$(srcdir)/net.c'; fi` + +strace-netlink.o: netlink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink.o -MD -MP -MF $(DEPDIR)/strace-netlink.Tpo -c -o strace-netlink.o `test -f 'netlink.c' || echo '$(srcdir)/'`netlink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink.Tpo $(DEPDIR)/strace-netlink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink.c' object='strace-netlink.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink.o `test -f 'netlink.c' || echo '$(srcdir)/'`netlink.c + +strace-netlink.obj: netlink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink.obj -MD -MP -MF $(DEPDIR)/strace-netlink.Tpo -c -o strace-netlink.obj `if test -f 'netlink.c'; then $(CYGPATH_W) 'netlink.c'; else $(CYGPATH_W) '$(srcdir)/netlink.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink.Tpo $(DEPDIR)/strace-netlink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink.c' object='strace-netlink.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink.obj `if test -f 'netlink.c'; then $(CYGPATH_W) 'netlink.c'; else $(CYGPATH_W) '$(srcdir)/netlink.c'; fi` + +strace-numa.o: numa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-numa.o -MD -MP -MF $(DEPDIR)/strace-numa.Tpo -c -o strace-numa.o `test -f 'numa.c' || echo '$(srcdir)/'`numa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-numa.Tpo $(DEPDIR)/strace-numa.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numa.c' object='strace-numa.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-numa.o `test -f 'numa.c' || echo '$(srcdir)/'`numa.c + +strace-numa.obj: numa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-numa.obj -MD -MP -MF $(DEPDIR)/strace-numa.Tpo -c -o strace-numa.obj `if test -f 'numa.c'; then $(CYGPATH_W) 'numa.c'; else $(CYGPATH_W) '$(srcdir)/numa.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-numa.Tpo $(DEPDIR)/strace-numa.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numa.c' object='strace-numa.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-numa.obj `if test -f 'numa.c'; then $(CYGPATH_W) 'numa.c'; else $(CYGPATH_W) '$(srcdir)/numa.c'; fi` + +strace-oldstat.o: oldstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-oldstat.o -MD -MP -MF $(DEPDIR)/strace-oldstat.Tpo -c -o strace-oldstat.o `test -f 'oldstat.c' || echo '$(srcdir)/'`oldstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-oldstat.Tpo $(DEPDIR)/strace-oldstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oldstat.c' object='strace-oldstat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-oldstat.o `test -f 'oldstat.c' || echo '$(srcdir)/'`oldstat.c + +strace-oldstat.obj: oldstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-oldstat.obj -MD -MP -MF $(DEPDIR)/strace-oldstat.Tpo -c -o strace-oldstat.obj `if test -f 'oldstat.c'; then $(CYGPATH_W) 'oldstat.c'; else $(CYGPATH_W) '$(srcdir)/oldstat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-oldstat.Tpo $(DEPDIR)/strace-oldstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oldstat.c' object='strace-oldstat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-oldstat.obj `if test -f 'oldstat.c'; then $(CYGPATH_W) 'oldstat.c'; else $(CYGPATH_W) '$(srcdir)/oldstat.c'; fi` + +strace-open.o: open.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-open.o -MD -MP -MF $(DEPDIR)/strace-open.Tpo -c -o strace-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-open.Tpo $(DEPDIR)/strace-open.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='open.c' object='strace-open.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c + +strace-open.obj: open.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-open.obj -MD -MP -MF $(DEPDIR)/strace-open.Tpo -c -o strace-open.obj `if test -f 'open.c'; then $(CYGPATH_W) 'open.c'; else $(CYGPATH_W) '$(srcdir)/open.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-open.Tpo $(DEPDIR)/strace-open.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='open.c' object='strace-open.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-open.obj `if test -f 'open.c'; then $(CYGPATH_W) 'open.c'; else $(CYGPATH_W) '$(srcdir)/open.c'; fi` + +strace-or1k_atomic.o: or1k_atomic.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-or1k_atomic.o -MD -MP -MF $(DEPDIR)/strace-or1k_atomic.Tpo -c -o strace-or1k_atomic.o `test -f 'or1k_atomic.c' || echo '$(srcdir)/'`or1k_atomic.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-or1k_atomic.Tpo $(DEPDIR)/strace-or1k_atomic.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='or1k_atomic.c' object='strace-or1k_atomic.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-or1k_atomic.o `test -f 'or1k_atomic.c' || echo '$(srcdir)/'`or1k_atomic.c + +strace-or1k_atomic.obj: or1k_atomic.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-or1k_atomic.obj -MD -MP -MF $(DEPDIR)/strace-or1k_atomic.Tpo -c -o strace-or1k_atomic.obj `if test -f 'or1k_atomic.c'; then $(CYGPATH_W) 'or1k_atomic.c'; else $(CYGPATH_W) '$(srcdir)/or1k_atomic.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-or1k_atomic.Tpo $(DEPDIR)/strace-or1k_atomic.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='or1k_atomic.c' object='strace-or1k_atomic.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-or1k_atomic.obj `if test -f 'or1k_atomic.c'; then $(CYGPATH_W) 'or1k_atomic.c'; else $(CYGPATH_W) '$(srcdir)/or1k_atomic.c'; fi` + +strace-pathtrace.o: pathtrace.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-pathtrace.o -MD -MP -MF $(DEPDIR)/strace-pathtrace.Tpo -c -o strace-pathtrace.o `test -f 'pathtrace.c' || echo '$(srcdir)/'`pathtrace.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-pathtrace.Tpo $(DEPDIR)/strace-pathtrace.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pathtrace.c' object='strace-pathtrace.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-pathtrace.o `test -f 'pathtrace.c' || echo '$(srcdir)/'`pathtrace.c + +strace-pathtrace.obj: pathtrace.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-pathtrace.obj -MD -MP -MF $(DEPDIR)/strace-pathtrace.Tpo -c -o strace-pathtrace.obj `if test -f 'pathtrace.c'; then $(CYGPATH_W) 'pathtrace.c'; else $(CYGPATH_W) '$(srcdir)/pathtrace.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-pathtrace.Tpo $(DEPDIR)/strace-pathtrace.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pathtrace.c' object='strace-pathtrace.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-pathtrace.obj `if test -f 'pathtrace.c'; then $(CYGPATH_W) 'pathtrace.c'; else $(CYGPATH_W) '$(srcdir)/pathtrace.c'; fi` + +strace-perf.o: perf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-perf.o -MD -MP -MF $(DEPDIR)/strace-perf.Tpo -c -o strace-perf.o `test -f 'perf.c' || echo '$(srcdir)/'`perf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-perf.Tpo $(DEPDIR)/strace-perf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf.c' object='strace-perf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-perf.o `test -f 'perf.c' || echo '$(srcdir)/'`perf.c + +strace-perf.obj: perf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-perf.obj -MD -MP -MF $(DEPDIR)/strace-perf.Tpo -c -o strace-perf.obj `if test -f 'perf.c'; then $(CYGPATH_W) 'perf.c'; else $(CYGPATH_W) '$(srcdir)/perf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-perf.Tpo $(DEPDIR)/strace-perf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf.c' object='strace-perf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-perf.obj `if test -f 'perf.c'; then $(CYGPATH_W) 'perf.c'; else $(CYGPATH_W) '$(srcdir)/perf.c'; fi` + +strace-personality.o: personality.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-personality.o -MD -MP -MF $(DEPDIR)/strace-personality.Tpo -c -o strace-personality.o `test -f 'personality.c' || echo '$(srcdir)/'`personality.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-personality.Tpo $(DEPDIR)/strace-personality.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='personality.c' object='strace-personality.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-personality.o `test -f 'personality.c' || echo '$(srcdir)/'`personality.c + +strace-personality.obj: personality.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-personality.obj -MD -MP -MF $(DEPDIR)/strace-personality.Tpo -c -o strace-personality.obj `if test -f 'personality.c'; then $(CYGPATH_W) 'personality.c'; else $(CYGPATH_W) '$(srcdir)/personality.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-personality.Tpo $(DEPDIR)/strace-personality.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='personality.c' object='strace-personality.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-personality.obj `if test -f 'personality.c'; then $(CYGPATH_W) 'personality.c'; else $(CYGPATH_W) '$(srcdir)/personality.c'; fi` + +strace-pkeys.o: pkeys.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-pkeys.o -MD -MP -MF $(DEPDIR)/strace-pkeys.Tpo -c -o strace-pkeys.o `test -f 'pkeys.c' || echo '$(srcdir)/'`pkeys.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-pkeys.Tpo $(DEPDIR)/strace-pkeys.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkeys.c' object='strace-pkeys.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-pkeys.o `test -f 'pkeys.c' || echo '$(srcdir)/'`pkeys.c + +strace-pkeys.obj: pkeys.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-pkeys.obj -MD -MP -MF $(DEPDIR)/strace-pkeys.Tpo -c -o strace-pkeys.obj `if test -f 'pkeys.c'; then $(CYGPATH_W) 'pkeys.c'; else $(CYGPATH_W) '$(srcdir)/pkeys.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-pkeys.Tpo $(DEPDIR)/strace-pkeys.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkeys.c' object='strace-pkeys.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-pkeys.obj `if test -f 'pkeys.c'; then $(CYGPATH_W) 'pkeys.c'; else $(CYGPATH_W) '$(srcdir)/pkeys.c'; fi` + +strace-poll.o: poll.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-poll.o -MD -MP -MF $(DEPDIR)/strace-poll.Tpo -c -o strace-poll.o `test -f 'poll.c' || echo '$(srcdir)/'`poll.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-poll.Tpo $(DEPDIR)/strace-poll.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='poll.c' object='strace-poll.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-poll.o `test -f 'poll.c' || echo '$(srcdir)/'`poll.c + +strace-poll.obj: poll.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-poll.obj -MD -MP -MF $(DEPDIR)/strace-poll.Tpo -c -o strace-poll.obj `if test -f 'poll.c'; then $(CYGPATH_W) 'poll.c'; else $(CYGPATH_W) '$(srcdir)/poll.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-poll.Tpo $(DEPDIR)/strace-poll.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='poll.c' object='strace-poll.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-poll.obj `if test -f 'poll.c'; then $(CYGPATH_W) 'poll.c'; else $(CYGPATH_W) '$(srcdir)/poll.c'; fi` + +strace-prctl.o: prctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-prctl.o -MD -MP -MF $(DEPDIR)/strace-prctl.Tpo -c -o strace-prctl.o `test -f 'prctl.c' || echo '$(srcdir)/'`prctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-prctl.Tpo $(DEPDIR)/strace-prctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prctl.c' object='strace-prctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-prctl.o `test -f 'prctl.c' || echo '$(srcdir)/'`prctl.c + +strace-prctl.obj: prctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-prctl.obj -MD -MP -MF $(DEPDIR)/strace-prctl.Tpo -c -o strace-prctl.obj `if test -f 'prctl.c'; then $(CYGPATH_W) 'prctl.c'; else $(CYGPATH_W) '$(srcdir)/prctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-prctl.Tpo $(DEPDIR)/strace-prctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prctl.c' object='strace-prctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-prctl.obj `if test -f 'prctl.c'; then $(CYGPATH_W) 'prctl.c'; else $(CYGPATH_W) '$(srcdir)/prctl.c'; fi` + +strace-print_dev_t.o: print_dev_t.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_dev_t.o -MD -MP -MF $(DEPDIR)/strace-print_dev_t.Tpo -c -o strace-print_dev_t.o `test -f 'print_dev_t.c' || echo '$(srcdir)/'`print_dev_t.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_dev_t.Tpo $(DEPDIR)/strace-print_dev_t.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_dev_t.c' object='strace-print_dev_t.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_dev_t.o `test -f 'print_dev_t.c' || echo '$(srcdir)/'`print_dev_t.c + +strace-print_dev_t.obj: print_dev_t.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_dev_t.obj -MD -MP -MF $(DEPDIR)/strace-print_dev_t.Tpo -c -o strace-print_dev_t.obj `if test -f 'print_dev_t.c'; then $(CYGPATH_W) 'print_dev_t.c'; else $(CYGPATH_W) '$(srcdir)/print_dev_t.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_dev_t.Tpo $(DEPDIR)/strace-print_dev_t.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_dev_t.c' object='strace-print_dev_t.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_dev_t.obj `if test -f 'print_dev_t.c'; then $(CYGPATH_W) 'print_dev_t.c'; else $(CYGPATH_W) '$(srcdir)/print_dev_t.c'; fi` + +strace-print_mq_attr.o: print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_mq_attr.o -MD -MP -MF $(DEPDIR)/strace-print_mq_attr.Tpo -c -o strace-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_mq_attr.Tpo $(DEPDIR)/strace-print_mq_attr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mq_attr.c' object='strace-print_mq_attr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c + +strace-print_mq_attr.obj: print_mq_attr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_mq_attr.obj -MD -MP -MF $(DEPDIR)/strace-print_mq_attr.Tpo -c -o strace-print_mq_attr.obj `if test -f 'print_mq_attr.c'; then $(CYGPATH_W) 'print_mq_attr.c'; else $(CYGPATH_W) '$(srcdir)/print_mq_attr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_mq_attr.Tpo $(DEPDIR)/strace-print_mq_attr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mq_attr.c' object='strace-print_mq_attr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_mq_attr.obj `if test -f 'print_mq_attr.c'; then $(CYGPATH_W) 'print_mq_attr.c'; else $(CYGPATH_W) '$(srcdir)/print_mq_attr.c'; fi` + +strace-print_msgbuf.o: print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_msgbuf.o -MD -MP -MF $(DEPDIR)/strace-print_msgbuf.Tpo -c -o strace-print_msgbuf.o `test -f 'print_msgbuf.c' || echo '$(srcdir)/'`print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_msgbuf.Tpo $(DEPDIR)/strace-print_msgbuf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_msgbuf.c' object='strace-print_msgbuf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_msgbuf.o `test -f 'print_msgbuf.c' || echo '$(srcdir)/'`print_msgbuf.c + +strace-print_msgbuf.obj: print_msgbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_msgbuf.obj -MD -MP -MF $(DEPDIR)/strace-print_msgbuf.Tpo -c -o strace-print_msgbuf.obj `if test -f 'print_msgbuf.c'; then $(CYGPATH_W) 'print_msgbuf.c'; else $(CYGPATH_W) '$(srcdir)/print_msgbuf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_msgbuf.Tpo $(DEPDIR)/strace-print_msgbuf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_msgbuf.c' object='strace-print_msgbuf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_msgbuf.obj `if test -f 'print_msgbuf.c'; then $(CYGPATH_W) 'print_msgbuf.c'; else $(CYGPATH_W) '$(srcdir)/print_msgbuf.c'; fi` + +strace-print_sg_req_info.o: print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_sg_req_info.o -MD -MP -MF $(DEPDIR)/strace-print_sg_req_info.Tpo -c -o strace-print_sg_req_info.o `test -f 'print_sg_req_info.c' || echo '$(srcdir)/'`print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_sg_req_info.Tpo $(DEPDIR)/strace-print_sg_req_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sg_req_info.c' object='strace-print_sg_req_info.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_sg_req_info.o `test -f 'print_sg_req_info.c' || echo '$(srcdir)/'`print_sg_req_info.c + +strace-print_sg_req_info.obj: print_sg_req_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_sg_req_info.obj -MD -MP -MF $(DEPDIR)/strace-print_sg_req_info.Tpo -c -o strace-print_sg_req_info.obj `if test -f 'print_sg_req_info.c'; then $(CYGPATH_W) 'print_sg_req_info.c'; else $(CYGPATH_W) '$(srcdir)/print_sg_req_info.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_sg_req_info.Tpo $(DEPDIR)/strace-print_sg_req_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sg_req_info.c' object='strace-print_sg_req_info.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_sg_req_info.obj `if test -f 'print_sg_req_info.c'; then $(CYGPATH_W) 'print_sg_req_info.c'; else $(CYGPATH_W) '$(srcdir)/print_sg_req_info.c'; fi` + +strace-print_sigevent.o: print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_sigevent.o -MD -MP -MF $(DEPDIR)/strace-print_sigevent.Tpo -c -o strace-print_sigevent.o `test -f 'print_sigevent.c' || echo '$(srcdir)/'`print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_sigevent.Tpo $(DEPDIR)/strace-print_sigevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sigevent.c' object='strace-print_sigevent.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_sigevent.o `test -f 'print_sigevent.c' || echo '$(srcdir)/'`print_sigevent.c + +strace-print_sigevent.obj: print_sigevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_sigevent.obj -MD -MP -MF $(DEPDIR)/strace-print_sigevent.Tpo -c -o strace-print_sigevent.obj `if test -f 'print_sigevent.c'; then $(CYGPATH_W) 'print_sigevent.c'; else $(CYGPATH_W) '$(srcdir)/print_sigevent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_sigevent.Tpo $(DEPDIR)/strace-print_sigevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_sigevent.c' object='strace-print_sigevent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_sigevent.obj `if test -f 'print_sigevent.c'; then $(CYGPATH_W) 'print_sigevent.c'; else $(CYGPATH_W) '$(srcdir)/print_sigevent.c'; fi` + +strace-print_statfs.o: print_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_statfs.o -MD -MP -MF $(DEPDIR)/strace-print_statfs.Tpo -c -o strace-print_statfs.o `test -f 'print_statfs.c' || echo '$(srcdir)/'`print_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_statfs.Tpo $(DEPDIR)/strace-print_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_statfs.c' object='strace-print_statfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_statfs.o `test -f 'print_statfs.c' || echo '$(srcdir)/'`print_statfs.c + +strace-print_statfs.obj: print_statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_statfs.obj -MD -MP -MF $(DEPDIR)/strace-print_statfs.Tpo -c -o strace-print_statfs.obj `if test -f 'print_statfs.c'; then $(CYGPATH_W) 'print_statfs.c'; else $(CYGPATH_W) '$(srcdir)/print_statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_statfs.Tpo $(DEPDIR)/strace-print_statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_statfs.c' object='strace-print_statfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_statfs.obj `if test -f 'print_statfs.c'; then $(CYGPATH_W) 'print_statfs.c'; else $(CYGPATH_W) '$(srcdir)/print_statfs.c'; fi` + +strace-print_struct_stat.o: print_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_struct_stat.o -MD -MP -MF $(DEPDIR)/strace-print_struct_stat.Tpo -c -o strace-print_struct_stat.o `test -f 'print_struct_stat.c' || echo '$(srcdir)/'`print_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_struct_stat.Tpo $(DEPDIR)/strace-print_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_struct_stat.c' object='strace-print_struct_stat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_struct_stat.o `test -f 'print_struct_stat.c' || echo '$(srcdir)/'`print_struct_stat.c + +strace-print_struct_stat.obj: print_struct_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_struct_stat.obj -MD -MP -MF $(DEPDIR)/strace-print_struct_stat.Tpo -c -o strace-print_struct_stat.obj `if test -f 'print_struct_stat.c'; then $(CYGPATH_W) 'print_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/print_struct_stat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_struct_stat.Tpo $(DEPDIR)/strace-print_struct_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_struct_stat.c' object='strace-print_struct_stat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_struct_stat.obj `if test -f 'print_struct_stat.c'; then $(CYGPATH_W) 'print_struct_stat.c'; else $(CYGPATH_W) '$(srcdir)/print_struct_stat.c'; fi` + +strace-print_time.o: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_time.o -MD -MP -MF $(DEPDIR)/strace-print_time.Tpo -c -o strace-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_time.Tpo $(DEPDIR)/strace-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='strace-print_time.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c + +strace-print_time.obj: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_time.obj -MD -MP -MF $(DEPDIR)/strace-print_time.Tpo -c -o strace-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_time.Tpo $(DEPDIR)/strace-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='strace-print_time.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` + +strace-print_timespec.o: print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timespec.o -MD -MP -MF $(DEPDIR)/strace-print_timespec.Tpo -c -o strace-print_timespec.o `test -f 'print_timespec.c' || echo '$(srcdir)/'`print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timespec.Tpo $(DEPDIR)/strace-print_timespec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec.c' object='strace-print_timespec.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timespec.o `test -f 'print_timespec.c' || echo '$(srcdir)/'`print_timespec.c + +strace-print_timespec.obj: print_timespec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timespec.obj -MD -MP -MF $(DEPDIR)/strace-print_timespec.Tpo -c -o strace-print_timespec.obj `if test -f 'print_timespec.c'; then $(CYGPATH_W) 'print_timespec.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timespec.Tpo $(DEPDIR)/strace-print_timespec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec.c' object='strace-print_timespec.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timespec.obj `if test -f 'print_timespec.c'; then $(CYGPATH_W) 'print_timespec.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec.c'; fi` + +strace-print_timeval.o: print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timeval.o -MD -MP -MF $(DEPDIR)/strace-print_timeval.Tpo -c -o strace-print_timeval.o `test -f 'print_timeval.c' || echo '$(srcdir)/'`print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timeval.Tpo $(DEPDIR)/strace-print_timeval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval.c' object='strace-print_timeval.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timeval.o `test -f 'print_timeval.c' || echo '$(srcdir)/'`print_timeval.c + +strace-print_timeval.obj: print_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timeval.obj -MD -MP -MF $(DEPDIR)/strace-print_timeval.Tpo -c -o strace-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timeval.Tpo $(DEPDIR)/strace-print_timeval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval.c' object='strace-print_timeval.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` + +strace-print_timex.o: print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timex.o -MD -MP -MF $(DEPDIR)/strace-print_timex.Tpo -c -o strace-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timex.Tpo $(DEPDIR)/strace-print_timex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='strace-print_timex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c + +strace-print_timex.obj: print_timex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timex.obj -MD -MP -MF $(DEPDIR)/strace-print_timex.Tpo -c -o strace-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timex.Tpo $(DEPDIR)/strace-print_timex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='strace-print_timex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` + +strace-printmode.o: printmode.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-printmode.o -MD -MP -MF $(DEPDIR)/strace-printmode.Tpo -c -o strace-printmode.o `test -f 'printmode.c' || echo '$(srcdir)/'`printmode.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-printmode.Tpo $(DEPDIR)/strace-printmode.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printmode.c' object='strace-printmode.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-printmode.o `test -f 'printmode.c' || echo '$(srcdir)/'`printmode.c + +strace-printmode.obj: printmode.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-printmode.obj -MD -MP -MF $(DEPDIR)/strace-printmode.Tpo -c -o strace-printmode.obj `if test -f 'printmode.c'; then $(CYGPATH_W) 'printmode.c'; else $(CYGPATH_W) '$(srcdir)/printmode.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-printmode.Tpo $(DEPDIR)/strace-printmode.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printmode.c' object='strace-printmode.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-printmode.obj `if test -f 'printmode.c'; then $(CYGPATH_W) 'printmode.c'; else $(CYGPATH_W) '$(srcdir)/printmode.c'; fi` + +strace-printrusage.o: printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-printrusage.o -MD -MP -MF $(DEPDIR)/strace-printrusage.Tpo -c -o strace-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-printrusage.Tpo $(DEPDIR)/strace-printrusage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printrusage.c' object='strace-printrusage.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c + +strace-printrusage.obj: printrusage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-printrusage.obj -MD -MP -MF $(DEPDIR)/strace-printrusage.Tpo -c -o strace-printrusage.obj `if test -f 'printrusage.c'; then $(CYGPATH_W) 'printrusage.c'; else $(CYGPATH_W) '$(srcdir)/printrusage.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-printrusage.Tpo $(DEPDIR)/strace-printrusage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printrusage.c' object='strace-printrusage.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-printrusage.obj `if test -f 'printrusage.c'; then $(CYGPATH_W) 'printrusage.c'; else $(CYGPATH_W) '$(srcdir)/printrusage.c'; fi` + +strace-printsiginfo.o: printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-printsiginfo.o -MD -MP -MF $(DEPDIR)/strace-printsiginfo.Tpo -c -o strace-printsiginfo.o `test -f 'printsiginfo.c' || echo '$(srcdir)/'`printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-printsiginfo.Tpo $(DEPDIR)/strace-printsiginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printsiginfo.c' object='strace-printsiginfo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-printsiginfo.o `test -f 'printsiginfo.c' || echo '$(srcdir)/'`printsiginfo.c + +strace-printsiginfo.obj: printsiginfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-printsiginfo.obj -MD -MP -MF $(DEPDIR)/strace-printsiginfo.Tpo -c -o strace-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-printsiginfo.Tpo $(DEPDIR)/strace-printsiginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printsiginfo.c' object='strace-printsiginfo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` + +strace-process.o: process.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-process.o -MD -MP -MF $(DEPDIR)/strace-process.Tpo -c -o strace-process.o `test -f 'process.c' || echo '$(srcdir)/'`process.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-process.Tpo $(DEPDIR)/strace-process.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='process.c' object='strace-process.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-process.o `test -f 'process.c' || echo '$(srcdir)/'`process.c + +strace-process.obj: process.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-process.obj -MD -MP -MF $(DEPDIR)/strace-process.Tpo -c -o strace-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-process.Tpo $(DEPDIR)/strace-process.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='process.c' object='strace-process.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi` + +strace-process_vm.o: process_vm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-process_vm.o -MD -MP -MF $(DEPDIR)/strace-process_vm.Tpo -c -o strace-process_vm.o `test -f 'process_vm.c' || echo '$(srcdir)/'`process_vm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-process_vm.Tpo $(DEPDIR)/strace-process_vm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='process_vm.c' object='strace-process_vm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-process_vm.o `test -f 'process_vm.c' || echo '$(srcdir)/'`process_vm.c + +strace-process_vm.obj: process_vm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-process_vm.obj -MD -MP -MF $(DEPDIR)/strace-process_vm.Tpo -c -o strace-process_vm.obj `if test -f 'process_vm.c'; then $(CYGPATH_W) 'process_vm.c'; else $(CYGPATH_W) '$(srcdir)/process_vm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-process_vm.Tpo $(DEPDIR)/strace-process_vm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='process_vm.c' object='strace-process_vm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-process_vm.obj `if test -f 'process_vm.c'; then $(CYGPATH_W) 'process_vm.c'; else $(CYGPATH_W) '$(srcdir)/process_vm.c'; fi` + +strace-ptp.o: ptp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ptp.o -MD -MP -MF $(DEPDIR)/strace-ptp.Tpo -c -o strace-ptp.o `test -f 'ptp.c' || echo '$(srcdir)/'`ptp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ptp.Tpo $(DEPDIR)/strace-ptp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ptp.c' object='strace-ptp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ptp.o `test -f 'ptp.c' || echo '$(srcdir)/'`ptp.c + +strace-ptp.obj: ptp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ptp.obj -MD -MP -MF $(DEPDIR)/strace-ptp.Tpo -c -o strace-ptp.obj `if test -f 'ptp.c'; then $(CYGPATH_W) 'ptp.c'; else $(CYGPATH_W) '$(srcdir)/ptp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ptp.Tpo $(DEPDIR)/strace-ptp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ptp.c' object='strace-ptp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ptp.obj `if test -f 'ptp.c'; then $(CYGPATH_W) 'ptp.c'; else $(CYGPATH_W) '$(srcdir)/ptp.c'; fi` + +strace-qualify.o: qualify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-qualify.o -MD -MP -MF $(DEPDIR)/strace-qualify.Tpo -c -o strace-qualify.o `test -f 'qualify.c' || echo '$(srcdir)/'`qualify.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-qualify.Tpo $(DEPDIR)/strace-qualify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qualify.c' object='strace-qualify.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-qualify.o `test -f 'qualify.c' || echo '$(srcdir)/'`qualify.c + +strace-qualify.obj: qualify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-qualify.obj -MD -MP -MF $(DEPDIR)/strace-qualify.Tpo -c -o strace-qualify.obj `if test -f 'qualify.c'; then $(CYGPATH_W) 'qualify.c'; else $(CYGPATH_W) '$(srcdir)/qualify.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-qualify.Tpo $(DEPDIR)/strace-qualify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qualify.c' object='strace-qualify.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-qualify.obj `if test -f 'qualify.c'; then $(CYGPATH_W) 'qualify.c'; else $(CYGPATH_W) '$(srcdir)/qualify.c'; fi` + +strace-quota.o: quota.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-quota.o -MD -MP -MF $(DEPDIR)/strace-quota.Tpo -c -o strace-quota.o `test -f 'quota.c' || echo '$(srcdir)/'`quota.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-quota.Tpo $(DEPDIR)/strace-quota.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quota.c' object='strace-quota.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-quota.o `test -f 'quota.c' || echo '$(srcdir)/'`quota.c + +strace-quota.obj: quota.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-quota.obj -MD -MP -MF $(DEPDIR)/strace-quota.Tpo -c -o strace-quota.obj `if test -f 'quota.c'; then $(CYGPATH_W) 'quota.c'; else $(CYGPATH_W) '$(srcdir)/quota.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-quota.Tpo $(DEPDIR)/strace-quota.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quota.c' object='strace-quota.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-quota.obj `if test -f 'quota.c'; then $(CYGPATH_W) 'quota.c'; else $(CYGPATH_W) '$(srcdir)/quota.c'; fi` + +strace-readahead.o: readahead.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-readahead.o -MD -MP -MF $(DEPDIR)/strace-readahead.Tpo -c -o strace-readahead.o `test -f 'readahead.c' || echo '$(srcdir)/'`readahead.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-readahead.Tpo $(DEPDIR)/strace-readahead.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readahead.c' object='strace-readahead.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-readahead.o `test -f 'readahead.c' || echo '$(srcdir)/'`readahead.c + +strace-readahead.obj: readahead.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-readahead.obj -MD -MP -MF $(DEPDIR)/strace-readahead.Tpo -c -o strace-readahead.obj `if test -f 'readahead.c'; then $(CYGPATH_W) 'readahead.c'; else $(CYGPATH_W) '$(srcdir)/readahead.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-readahead.Tpo $(DEPDIR)/strace-readahead.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readahead.c' object='strace-readahead.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-readahead.obj `if test -f 'readahead.c'; then $(CYGPATH_W) 'readahead.c'; else $(CYGPATH_W) '$(srcdir)/readahead.c'; fi` + +strace-readlink.o: readlink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-readlink.o -MD -MP -MF $(DEPDIR)/strace-readlink.Tpo -c -o strace-readlink.o `test -f 'readlink.c' || echo '$(srcdir)/'`readlink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-readlink.Tpo $(DEPDIR)/strace-readlink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readlink.c' object='strace-readlink.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-readlink.o `test -f 'readlink.c' || echo '$(srcdir)/'`readlink.c + +strace-readlink.obj: readlink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-readlink.obj -MD -MP -MF $(DEPDIR)/strace-readlink.Tpo -c -o strace-readlink.obj `if test -f 'readlink.c'; then $(CYGPATH_W) 'readlink.c'; else $(CYGPATH_W) '$(srcdir)/readlink.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-readlink.Tpo $(DEPDIR)/strace-readlink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readlink.c' object='strace-readlink.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-readlink.obj `if test -f 'readlink.c'; then $(CYGPATH_W) 'readlink.c'; else $(CYGPATH_W) '$(srcdir)/readlink.c'; fi` + +strace-reboot.o: reboot.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-reboot.o -MD -MP -MF $(DEPDIR)/strace-reboot.Tpo -c -o strace-reboot.o `test -f 'reboot.c' || echo '$(srcdir)/'`reboot.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-reboot.Tpo $(DEPDIR)/strace-reboot.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reboot.c' object='strace-reboot.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-reboot.o `test -f 'reboot.c' || echo '$(srcdir)/'`reboot.c + +strace-reboot.obj: reboot.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-reboot.obj -MD -MP -MF $(DEPDIR)/strace-reboot.Tpo -c -o strace-reboot.obj `if test -f 'reboot.c'; then $(CYGPATH_W) 'reboot.c'; else $(CYGPATH_W) '$(srcdir)/reboot.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-reboot.Tpo $(DEPDIR)/strace-reboot.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reboot.c' object='strace-reboot.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-reboot.obj `if test -f 'reboot.c'; then $(CYGPATH_W) 'reboot.c'; else $(CYGPATH_W) '$(srcdir)/reboot.c'; fi` + +strace-renameat.o: renameat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-renameat.o -MD -MP -MF $(DEPDIR)/strace-renameat.Tpo -c -o strace-renameat.o `test -f 'renameat.c' || echo '$(srcdir)/'`renameat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-renameat.Tpo $(DEPDIR)/strace-renameat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='renameat.c' object='strace-renameat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-renameat.o `test -f 'renameat.c' || echo '$(srcdir)/'`renameat.c + +strace-renameat.obj: renameat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-renameat.obj -MD -MP -MF $(DEPDIR)/strace-renameat.Tpo -c -o strace-renameat.obj `if test -f 'renameat.c'; then $(CYGPATH_W) 'renameat.c'; else $(CYGPATH_W) '$(srcdir)/renameat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-renameat.Tpo $(DEPDIR)/strace-renameat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='renameat.c' object='strace-renameat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-renameat.obj `if test -f 'renameat.c'; then $(CYGPATH_W) 'renameat.c'; else $(CYGPATH_W) '$(srcdir)/renameat.c'; fi` + +strace-resource.o: resource.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-resource.o -MD -MP -MF $(DEPDIR)/strace-resource.Tpo -c -o strace-resource.o `test -f 'resource.c' || echo '$(srcdir)/'`resource.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-resource.Tpo $(DEPDIR)/strace-resource.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='resource.c' object='strace-resource.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-resource.o `test -f 'resource.c' || echo '$(srcdir)/'`resource.c + +strace-resource.obj: resource.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-resource.obj -MD -MP -MF $(DEPDIR)/strace-resource.Tpo -c -o strace-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-resource.Tpo $(DEPDIR)/strace-resource.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='resource.c' object='strace-resource.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi` + +strace-rtc.o: rtc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtc.o -MD -MP -MF $(DEPDIR)/strace-rtc.Tpo -c -o strace-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtc.Tpo $(DEPDIR)/strace-rtc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtc.c' object='strace-rtc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c + +strace-rtc.obj: rtc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtc.obj -MD -MP -MF $(DEPDIR)/strace-rtc.Tpo -c -o strace-rtc.obj `if test -f 'rtc.c'; then $(CYGPATH_W) 'rtc.c'; else $(CYGPATH_W) '$(srcdir)/rtc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtc.Tpo $(DEPDIR)/strace-rtc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtc.c' object='strace-rtc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtc.obj `if test -f 'rtc.c'; then $(CYGPATH_W) 'rtc.c'; else $(CYGPATH_W) '$(srcdir)/rtc.c'; fi` + +strace-sched.o: sched.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sched.o -MD -MP -MF $(DEPDIR)/strace-sched.Tpo -c -o strace-sched.o `test -f 'sched.c' || echo '$(srcdir)/'`sched.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sched.Tpo $(DEPDIR)/strace-sched.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sched.c' object='strace-sched.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sched.o `test -f 'sched.c' || echo '$(srcdir)/'`sched.c + +strace-sched.obj: sched.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sched.obj -MD -MP -MF $(DEPDIR)/strace-sched.Tpo -c -o strace-sched.obj `if test -f 'sched.c'; then $(CYGPATH_W) 'sched.c'; else $(CYGPATH_W) '$(srcdir)/sched.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sched.Tpo $(DEPDIR)/strace-sched.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sched.c' object='strace-sched.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sched.obj `if test -f 'sched.c'; then $(CYGPATH_W) 'sched.c'; else $(CYGPATH_W) '$(srcdir)/sched.c'; fi` + +strace-scsi.o: scsi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-scsi.o -MD -MP -MF $(DEPDIR)/strace-scsi.Tpo -c -o strace-scsi.o `test -f 'scsi.c' || echo '$(srcdir)/'`scsi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-scsi.Tpo $(DEPDIR)/strace-scsi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scsi.c' object='strace-scsi.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-scsi.o `test -f 'scsi.c' || echo '$(srcdir)/'`scsi.c + +strace-scsi.obj: scsi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-scsi.obj -MD -MP -MF $(DEPDIR)/strace-scsi.Tpo -c -o strace-scsi.obj `if test -f 'scsi.c'; then $(CYGPATH_W) 'scsi.c'; else $(CYGPATH_W) '$(srcdir)/scsi.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-scsi.Tpo $(DEPDIR)/strace-scsi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scsi.c' object='strace-scsi.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-scsi.obj `if test -f 'scsi.c'; then $(CYGPATH_W) 'scsi.c'; else $(CYGPATH_W) '$(srcdir)/scsi.c'; fi` + +strace-seccomp.o: seccomp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-seccomp.o -MD -MP -MF $(DEPDIR)/strace-seccomp.Tpo -c -o strace-seccomp.o `test -f 'seccomp.c' || echo '$(srcdir)/'`seccomp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-seccomp.Tpo $(DEPDIR)/strace-seccomp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='seccomp.c' object='strace-seccomp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-seccomp.o `test -f 'seccomp.c' || echo '$(srcdir)/'`seccomp.c + +strace-seccomp.obj: seccomp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-seccomp.obj -MD -MP -MF $(DEPDIR)/strace-seccomp.Tpo -c -o strace-seccomp.obj `if test -f 'seccomp.c'; then $(CYGPATH_W) 'seccomp.c'; else $(CYGPATH_W) '$(srcdir)/seccomp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-seccomp.Tpo $(DEPDIR)/strace-seccomp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='seccomp.c' object='strace-seccomp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-seccomp.obj `if test -f 'seccomp.c'; then $(CYGPATH_W) 'seccomp.c'; else $(CYGPATH_W) '$(srcdir)/seccomp.c'; fi` + +strace-sendfile.o: sendfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sendfile.o -MD -MP -MF $(DEPDIR)/strace-sendfile.Tpo -c -o strace-sendfile.o `test -f 'sendfile.c' || echo '$(srcdir)/'`sendfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sendfile.Tpo $(DEPDIR)/strace-sendfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sendfile.c' object='strace-sendfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sendfile.o `test -f 'sendfile.c' || echo '$(srcdir)/'`sendfile.c + +strace-sendfile.obj: sendfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sendfile.obj -MD -MP -MF $(DEPDIR)/strace-sendfile.Tpo -c -o strace-sendfile.obj `if test -f 'sendfile.c'; then $(CYGPATH_W) 'sendfile.c'; else $(CYGPATH_W) '$(srcdir)/sendfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sendfile.Tpo $(DEPDIR)/strace-sendfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sendfile.c' object='strace-sendfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sendfile.obj `if test -f 'sendfile.c'; then $(CYGPATH_W) 'sendfile.c'; else $(CYGPATH_W) '$(srcdir)/sendfile.c'; fi` + +strace-sg_io_v3.o: sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sg_io_v3.o -MD -MP -MF $(DEPDIR)/strace-sg_io_v3.Tpo -c -o strace-sg_io_v3.o `test -f 'sg_io_v3.c' || echo '$(srcdir)/'`sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sg_io_v3.Tpo $(DEPDIR)/strace-sg_io_v3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v3.c' object='strace-sg_io_v3.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sg_io_v3.o `test -f 'sg_io_v3.c' || echo '$(srcdir)/'`sg_io_v3.c + +strace-sg_io_v3.obj: sg_io_v3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sg_io_v3.obj -MD -MP -MF $(DEPDIR)/strace-sg_io_v3.Tpo -c -o strace-sg_io_v3.obj `if test -f 'sg_io_v3.c'; then $(CYGPATH_W) 'sg_io_v3.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v3.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sg_io_v3.Tpo $(DEPDIR)/strace-sg_io_v3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v3.c' object='strace-sg_io_v3.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sg_io_v3.obj `if test -f 'sg_io_v3.c'; then $(CYGPATH_W) 'sg_io_v3.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v3.c'; fi` + +strace-sg_io_v4.o: sg_io_v4.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sg_io_v4.o -MD -MP -MF $(DEPDIR)/strace-sg_io_v4.Tpo -c -o strace-sg_io_v4.o `test -f 'sg_io_v4.c' || echo '$(srcdir)/'`sg_io_v4.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sg_io_v4.Tpo $(DEPDIR)/strace-sg_io_v4.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v4.c' object='strace-sg_io_v4.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sg_io_v4.o `test -f 'sg_io_v4.c' || echo '$(srcdir)/'`sg_io_v4.c + +strace-sg_io_v4.obj: sg_io_v4.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sg_io_v4.obj -MD -MP -MF $(DEPDIR)/strace-sg_io_v4.Tpo -c -o strace-sg_io_v4.obj `if test -f 'sg_io_v4.c'; then $(CYGPATH_W) 'sg_io_v4.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v4.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sg_io_v4.Tpo $(DEPDIR)/strace-sg_io_v4.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sg_io_v4.c' object='strace-sg_io_v4.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sg_io_v4.obj `if test -f 'sg_io_v4.c'; then $(CYGPATH_W) 'sg_io_v4.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v4.c'; fi` + +strace-sigaltstack.o: sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sigaltstack.o -MD -MP -MF $(DEPDIR)/strace-sigaltstack.Tpo -c -o strace-sigaltstack.o `test -f 'sigaltstack.c' || echo '$(srcdir)/'`sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sigaltstack.Tpo $(DEPDIR)/strace-sigaltstack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigaltstack.c' object='strace-sigaltstack.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sigaltstack.o `test -f 'sigaltstack.c' || echo '$(srcdir)/'`sigaltstack.c + +strace-sigaltstack.obj: sigaltstack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sigaltstack.obj -MD -MP -MF $(DEPDIR)/strace-sigaltstack.Tpo -c -o strace-sigaltstack.obj `if test -f 'sigaltstack.c'; then $(CYGPATH_W) 'sigaltstack.c'; else $(CYGPATH_W) '$(srcdir)/sigaltstack.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sigaltstack.Tpo $(DEPDIR)/strace-sigaltstack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigaltstack.c' object='strace-sigaltstack.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sigaltstack.obj `if test -f 'sigaltstack.c'; then $(CYGPATH_W) 'sigaltstack.c'; else $(CYGPATH_W) '$(srcdir)/sigaltstack.c'; fi` + +strace-signal.o: signal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-signal.o -MD -MP -MF $(DEPDIR)/strace-signal.Tpo -c -o strace-signal.o `test -f 'signal.c' || echo '$(srcdir)/'`signal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-signal.Tpo $(DEPDIR)/strace-signal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal.c' object='strace-signal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-signal.o `test -f 'signal.c' || echo '$(srcdir)/'`signal.c + +strace-signal.obj: signal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-signal.obj -MD -MP -MF $(DEPDIR)/strace-signal.Tpo -c -o strace-signal.obj `if test -f 'signal.c'; then $(CYGPATH_W) 'signal.c'; else $(CYGPATH_W) '$(srcdir)/signal.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-signal.Tpo $(DEPDIR)/strace-signal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal.c' object='strace-signal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-signal.obj `if test -f 'signal.c'; then $(CYGPATH_W) 'signal.c'; else $(CYGPATH_W) '$(srcdir)/signal.c'; fi` + +strace-signalfd.o: signalfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-signalfd.o -MD -MP -MF $(DEPDIR)/strace-signalfd.Tpo -c -o strace-signalfd.o `test -f 'signalfd.c' || echo '$(srcdir)/'`signalfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-signalfd.Tpo $(DEPDIR)/strace-signalfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signalfd.c' object='strace-signalfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-signalfd.o `test -f 'signalfd.c' || echo '$(srcdir)/'`signalfd.c + +strace-signalfd.obj: signalfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-signalfd.obj -MD -MP -MF $(DEPDIR)/strace-signalfd.Tpo -c -o strace-signalfd.obj `if test -f 'signalfd.c'; then $(CYGPATH_W) 'signalfd.c'; else $(CYGPATH_W) '$(srcdir)/signalfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-signalfd.Tpo $(DEPDIR)/strace-signalfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signalfd.c' object='strace-signalfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-signalfd.obj `if test -f 'signalfd.c'; then $(CYGPATH_W) 'signalfd.c'; else $(CYGPATH_W) '$(srcdir)/signalfd.c'; fi` + +strace-sigreturn.o: sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sigreturn.o -MD -MP -MF $(DEPDIR)/strace-sigreturn.Tpo -c -o strace-sigreturn.o `test -f 'sigreturn.c' || echo '$(srcdir)/'`sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sigreturn.Tpo $(DEPDIR)/strace-sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigreturn.c' object='strace-sigreturn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sigreturn.o `test -f 'sigreturn.c' || echo '$(srcdir)/'`sigreturn.c + +strace-sigreturn.obj: sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sigreturn.obj -MD -MP -MF $(DEPDIR)/strace-sigreturn.Tpo -c -o strace-sigreturn.obj `if test -f 'sigreturn.c'; then $(CYGPATH_W) 'sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/sigreturn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sigreturn.Tpo $(DEPDIR)/strace-sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigreturn.c' object='strace-sigreturn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sigreturn.obj `if test -f 'sigreturn.c'; then $(CYGPATH_W) 'sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/sigreturn.c'; fi` + +strace-sock.o: sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sock.o -MD -MP -MF $(DEPDIR)/strace-sock.Tpo -c -o strace-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sock.Tpo $(DEPDIR)/strace-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='strace-sock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c + +strace-sock.obj: sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sock.obj -MD -MP -MF $(DEPDIR)/strace-sock.Tpo -c -o strace-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sock.Tpo $(DEPDIR)/strace-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='strace-sock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` + +strace-sockaddr.o: sockaddr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sockaddr.o -MD -MP -MF $(DEPDIR)/strace-sockaddr.Tpo -c -o strace-sockaddr.o `test -f 'sockaddr.c' || echo '$(srcdir)/'`sockaddr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sockaddr.Tpo $(DEPDIR)/strace-sockaddr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockaddr.c' object='strace-sockaddr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sockaddr.o `test -f 'sockaddr.c' || echo '$(srcdir)/'`sockaddr.c + +strace-sockaddr.obj: sockaddr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sockaddr.obj -MD -MP -MF $(DEPDIR)/strace-sockaddr.Tpo -c -o strace-sockaddr.obj `if test -f 'sockaddr.c'; then $(CYGPATH_W) 'sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/sockaddr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sockaddr.Tpo $(DEPDIR)/strace-sockaddr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockaddr.c' object='strace-sockaddr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sockaddr.obj `if test -f 'sockaddr.c'; then $(CYGPATH_W) 'sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/sockaddr.c'; fi` + +strace-socketutils.o: socketutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-socketutils.o -MD -MP -MF $(DEPDIR)/strace-socketutils.Tpo -c -o strace-socketutils.o `test -f 'socketutils.c' || echo '$(srcdir)/'`socketutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-socketutils.Tpo $(DEPDIR)/strace-socketutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socketutils.c' object='strace-socketutils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-socketutils.o `test -f 'socketutils.c' || echo '$(srcdir)/'`socketutils.c + +strace-socketutils.obj: socketutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-socketutils.obj -MD -MP -MF $(DEPDIR)/strace-socketutils.Tpo -c -o strace-socketutils.obj `if test -f 'socketutils.c'; then $(CYGPATH_W) 'socketutils.c'; else $(CYGPATH_W) '$(srcdir)/socketutils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-socketutils.Tpo $(DEPDIR)/strace-socketutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socketutils.c' object='strace-socketutils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-socketutils.obj `if test -f 'socketutils.c'; then $(CYGPATH_W) 'socketutils.c'; else $(CYGPATH_W) '$(srcdir)/socketutils.c'; fi` + +strace-sram_alloc.o: sram_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sram_alloc.o -MD -MP -MF $(DEPDIR)/strace-sram_alloc.Tpo -c -o strace-sram_alloc.o `test -f 'sram_alloc.c' || echo '$(srcdir)/'`sram_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sram_alloc.Tpo $(DEPDIR)/strace-sram_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sram_alloc.c' object='strace-sram_alloc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sram_alloc.o `test -f 'sram_alloc.c' || echo '$(srcdir)/'`sram_alloc.c + +strace-sram_alloc.obj: sram_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sram_alloc.obj -MD -MP -MF $(DEPDIR)/strace-sram_alloc.Tpo -c -o strace-sram_alloc.obj `if test -f 'sram_alloc.c'; then $(CYGPATH_W) 'sram_alloc.c'; else $(CYGPATH_W) '$(srcdir)/sram_alloc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sram_alloc.Tpo $(DEPDIR)/strace-sram_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sram_alloc.c' object='strace-sram_alloc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sram_alloc.obj `if test -f 'sram_alloc.c'; then $(CYGPATH_W) 'sram_alloc.c'; else $(CYGPATH_W) '$(srcdir)/sram_alloc.c'; fi` + +strace-stat.o: stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-stat.o -MD -MP -MF $(DEPDIR)/strace-stat.Tpo -c -o strace-stat.o `test -f 'stat.c' || echo '$(srcdir)/'`stat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-stat.Tpo $(DEPDIR)/strace-stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat.c' object='strace-stat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-stat.o `test -f 'stat.c' || echo '$(srcdir)/'`stat.c + +strace-stat.obj: stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-stat.obj -MD -MP -MF $(DEPDIR)/strace-stat.Tpo -c -o strace-stat.obj `if test -f 'stat.c'; then $(CYGPATH_W) 'stat.c'; else $(CYGPATH_W) '$(srcdir)/stat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-stat.Tpo $(DEPDIR)/strace-stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat.c' object='strace-stat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-stat.obj `if test -f 'stat.c'; then $(CYGPATH_W) 'stat.c'; else $(CYGPATH_W) '$(srcdir)/stat.c'; fi` + +strace-stat64.o: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-stat64.o -MD -MP -MF $(DEPDIR)/strace-stat64.Tpo -c -o strace-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-stat64.Tpo $(DEPDIR)/strace-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='strace-stat64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-signal.o `test -f 'signal.c' || echo '$(srcdir)/'`signal.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c -strace-signal.obj: signal.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-signal.obj -MD -MP -MF $(DEPDIR)/strace-signal.Tpo -c -o strace-signal.obj `if test -f 'signal.c'; then $(CYGPATH_W) 'signal.c'; else $(CYGPATH_W) '$(srcdir)/signal.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-signal.Tpo $(DEPDIR)/strace-signal.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal.c' object='strace-signal.obj' libtool=no @AMDEPBACKSLASH@ +strace-stat64.obj: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-stat64.obj -MD -MP -MF $(DEPDIR)/strace-stat64.Tpo -c -o strace-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-stat64.Tpo $(DEPDIR)/strace-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='strace-stat64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-signal.obj `if test -f 'signal.c'; then $(CYGPATH_W) 'signal.c'; else $(CYGPATH_W) '$(srcdir)/signal.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` -strace-sock.o: sock.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-sock.o -MD -MP -MF $(DEPDIR)/strace-sock.Tpo -c -o strace-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sock.Tpo $(DEPDIR)/strace-sock.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='strace-sock.o' libtool=no @AMDEPBACKSLASH@ +strace-statfs.o: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-statfs.o -MD -MP -MF $(DEPDIR)/strace-statfs.Tpo -c -o strace-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-statfs.Tpo $(DEPDIR)/strace-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='strace-statfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c -strace-sock.obj: sock.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-sock.obj -MD -MP -MF $(DEPDIR)/strace-sock.Tpo -c -o strace-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sock.Tpo $(DEPDIR)/strace-sock.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sock.c' object='strace-sock.obj' libtool=no @AMDEPBACKSLASH@ +strace-statfs.obj: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-statfs.obj -MD -MP -MF $(DEPDIR)/strace-statfs.Tpo -c -o strace-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-statfs.Tpo $(DEPDIR)/strace-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='strace-statfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-sock.obj `if test -f 'sock.c'; then $(CYGPATH_W) 'sock.c'; else $(CYGPATH_W) '$(srcdir)/sock.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` strace-strace.o: strace.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-strace.o -MD -MP -MF $(DEPDIR)/strace-strace.Tpo -c -o strace-strace.o `test -f 'strace.c' || echo '$(srcdir)/'`strace.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-strace.o -MD -MP -MF $(DEPDIR)/strace-strace.Tpo -c -o strace-strace.o `test -f 'strace.c' || echo '$(srcdir)/'`strace.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-strace.Tpo $(DEPDIR)/strace-strace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strace.c' object='strace-strace.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-strace.o `test -f 'strace.c' || echo '$(srcdir)/'`strace.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-strace.o `test -f 'strace.c' || echo '$(srcdir)/'`strace.c strace-strace.obj: strace.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-strace.obj -MD -MP -MF $(DEPDIR)/strace-strace.Tpo -c -o strace-strace.obj `if test -f 'strace.c'; then $(CYGPATH_W) 'strace.c'; else $(CYGPATH_W) '$(srcdir)/strace.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-strace.obj -MD -MP -MF $(DEPDIR)/strace-strace.Tpo -c -o strace-strace.obj `if test -f 'strace.c'; then $(CYGPATH_W) 'strace.c'; else $(CYGPATH_W) '$(srcdir)/strace.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-strace.Tpo $(DEPDIR)/strace-strace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strace.c' object='strace-strace.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-strace.obj `if test -f 'strace.c'; then $(CYGPATH_W) 'strace.c'; else $(CYGPATH_W) '$(srcdir)/strace.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-strace.obj `if test -f 'strace.c'; then $(CYGPATH_W) 'strace.c'; else $(CYGPATH_W) '$(srcdir)/strace.c'; fi` -strace-stream.o: stream.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-stream.o -MD -MP -MF $(DEPDIR)/strace-stream.Tpo -c -o strace-stream.o `test -f 'stream.c' || echo '$(srcdir)/'`stream.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-stream.Tpo $(DEPDIR)/strace-stream.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stream.c' object='strace-stream.o' libtool=no @AMDEPBACKSLASH@ +strace-swapon.o: swapon.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-swapon.o -MD -MP -MF $(DEPDIR)/strace-swapon.Tpo -c -o strace-swapon.o `test -f 'swapon.c' || echo '$(srcdir)/'`swapon.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-swapon.Tpo $(DEPDIR)/strace-swapon.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='swapon.c' object='strace-swapon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-stream.o `test -f 'stream.c' || echo '$(srcdir)/'`stream.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-swapon.o `test -f 'swapon.c' || echo '$(srcdir)/'`swapon.c -strace-stream.obj: stream.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-stream.obj -MD -MP -MF $(DEPDIR)/strace-stream.Tpo -c -o strace-stream.obj `if test -f 'stream.c'; then $(CYGPATH_W) 'stream.c'; else $(CYGPATH_W) '$(srcdir)/stream.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-stream.Tpo $(DEPDIR)/strace-stream.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stream.c' object='strace-stream.obj' libtool=no @AMDEPBACKSLASH@ +strace-swapon.obj: swapon.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-swapon.obj -MD -MP -MF $(DEPDIR)/strace-swapon.Tpo -c -o strace-swapon.obj `if test -f 'swapon.c'; then $(CYGPATH_W) 'swapon.c'; else $(CYGPATH_W) '$(srcdir)/swapon.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-swapon.Tpo $(DEPDIR)/strace-swapon.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='swapon.c' object='strace-swapon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-stream.obj `if test -f 'stream.c'; then $(CYGPATH_W) 'stream.c'; else $(CYGPATH_W) '$(srcdir)/stream.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-swapon.obj `if test -f 'swapon.c'; then $(CYGPATH_W) 'swapon.c'; else $(CYGPATH_W) '$(srcdir)/swapon.c'; fi` strace-syscall.o: syscall.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-syscall.o -MD -MP -MF $(DEPDIR)/strace-syscall.Tpo -c -o strace-syscall.o `test -f 'syscall.c' || echo '$(srcdir)/'`syscall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-syscall.o -MD -MP -MF $(DEPDIR)/strace-syscall.Tpo -c -o strace-syscall.o `test -f 'syscall.c' || echo '$(srcdir)/'`syscall.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-syscall.Tpo $(DEPDIR)/strace-syscall.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syscall.c' object='strace-syscall.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-syscall.o `test -f 'syscall.c' || echo '$(srcdir)/'`syscall.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-syscall.o `test -f 'syscall.c' || echo '$(srcdir)/'`syscall.c strace-syscall.obj: syscall.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-syscall.obj -MD -MP -MF $(DEPDIR)/strace-syscall.Tpo -c -o strace-syscall.obj `if test -f 'syscall.c'; then $(CYGPATH_W) 'syscall.c'; else $(CYGPATH_W) '$(srcdir)/syscall.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-syscall.obj -MD -MP -MF $(DEPDIR)/strace-syscall.Tpo -c -o strace-syscall.obj `if test -f 'syscall.c'; then $(CYGPATH_W) 'syscall.c'; else $(CYGPATH_W) '$(srcdir)/syscall.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-syscall.Tpo $(DEPDIR)/strace-syscall.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syscall.c' object='strace-syscall.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-syscall.obj `if test -f 'syscall.c'; then $(CYGPATH_W) 'syscall.c'; else $(CYGPATH_W) '$(srcdir)/syscall.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-syscall.obj `if test -f 'syscall.c'; then $(CYGPATH_W) 'syscall.c'; else $(CYGPATH_W) '$(srcdir)/syscall.c'; fi` + +strace-sysctl.o: sysctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sysctl.o -MD -MP -MF $(DEPDIR)/strace-sysctl.Tpo -c -o strace-sysctl.o `test -f 'sysctl.c' || echo '$(srcdir)/'`sysctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sysctl.Tpo $(DEPDIR)/strace-sysctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysctl.c' object='strace-sysctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sysctl.o `test -f 'sysctl.c' || echo '$(srcdir)/'`sysctl.c + +strace-sysctl.obj: sysctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sysctl.obj -MD -MP -MF $(DEPDIR)/strace-sysctl.Tpo -c -o strace-sysctl.obj `if test -f 'sysctl.c'; then $(CYGPATH_W) 'sysctl.c'; else $(CYGPATH_W) '$(srcdir)/sysctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sysctl.Tpo $(DEPDIR)/strace-sysctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysctl.c' object='strace-sysctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sysctl.obj `if test -f 'sysctl.c'; then $(CYGPATH_W) 'sysctl.c'; else $(CYGPATH_W) '$(srcdir)/sysctl.c'; fi` + +strace-sysinfo.o: sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sysinfo.o -MD -MP -MF $(DEPDIR)/strace-sysinfo.Tpo -c -o strace-sysinfo.o `test -f 'sysinfo.c' || echo '$(srcdir)/'`sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sysinfo.Tpo $(DEPDIR)/strace-sysinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysinfo.c' object='strace-sysinfo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sysinfo.o `test -f 'sysinfo.c' || echo '$(srcdir)/'`sysinfo.c -strace-system.o: system.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-system.o -MD -MP -MF $(DEPDIR)/strace-system.Tpo -c -o strace-system.o `test -f 'system.c' || echo '$(srcdir)/'`system.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-system.Tpo $(DEPDIR)/strace-system.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='system.c' object='strace-system.o' libtool=no @AMDEPBACKSLASH@ +strace-sysinfo.obj: sysinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sysinfo.obj -MD -MP -MF $(DEPDIR)/strace-sysinfo.Tpo -c -o strace-sysinfo.obj `if test -f 'sysinfo.c'; then $(CYGPATH_W) 'sysinfo.c'; else $(CYGPATH_W) '$(srcdir)/sysinfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sysinfo.Tpo $(DEPDIR)/strace-sysinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysinfo.c' object='strace-sysinfo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-system.o `test -f 'system.c' || echo '$(srcdir)/'`system.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sysinfo.obj `if test -f 'sysinfo.c'; then $(CYGPATH_W) 'sysinfo.c'; else $(CYGPATH_W) '$(srcdir)/sysinfo.c'; fi` -strace-system.obj: system.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-system.obj -MD -MP -MF $(DEPDIR)/strace-system.Tpo -c -o strace-system.obj `if test -f 'system.c'; then $(CYGPATH_W) 'system.c'; else $(CYGPATH_W) '$(srcdir)/system.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-system.Tpo $(DEPDIR)/strace-system.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='system.c' object='strace-system.obj' libtool=no @AMDEPBACKSLASH@ +strace-syslog.o: syslog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-syslog.o -MD -MP -MF $(DEPDIR)/strace-syslog.Tpo -c -o strace-syslog.o `test -f 'syslog.c' || echo '$(srcdir)/'`syslog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-syslog.Tpo $(DEPDIR)/strace-syslog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syslog.c' object='strace-syslog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-system.obj `if test -f 'system.c'; then $(CYGPATH_W) 'system.c'; else $(CYGPATH_W) '$(srcdir)/system.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-syslog.o `test -f 'syslog.c' || echo '$(srcdir)/'`syslog.c + +strace-syslog.obj: syslog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-syslog.obj -MD -MP -MF $(DEPDIR)/strace-syslog.Tpo -c -o strace-syslog.obj `if test -f 'syslog.c'; then $(CYGPATH_W) 'syslog.c'; else $(CYGPATH_W) '$(srcdir)/syslog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-syslog.Tpo $(DEPDIR)/strace-syslog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syslog.c' object='strace-syslog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-syslog.obj `if test -f 'syslog.c'; then $(CYGPATH_W) 'syslog.c'; else $(CYGPATH_W) '$(srcdir)/syslog.c'; fi` + +strace-sysmips.o: sysmips.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sysmips.o -MD -MP -MF $(DEPDIR)/strace-sysmips.Tpo -c -o strace-sysmips.o `test -f 'sysmips.c' || echo '$(srcdir)/'`sysmips.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sysmips.Tpo $(DEPDIR)/strace-sysmips.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysmips.c' object='strace-sysmips.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sysmips.o `test -f 'sysmips.c' || echo '$(srcdir)/'`sysmips.c + +strace-sysmips.obj: sysmips.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sysmips.obj -MD -MP -MF $(DEPDIR)/strace-sysmips.Tpo -c -o strace-sysmips.obj `if test -f 'sysmips.c'; then $(CYGPATH_W) 'sysmips.c'; else $(CYGPATH_W) '$(srcdir)/sysmips.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sysmips.Tpo $(DEPDIR)/strace-sysmips.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sysmips.c' object='strace-sysmips.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sysmips.obj `if test -f 'sysmips.c'; then $(CYGPATH_W) 'sysmips.c'; else $(CYGPATH_W) '$(srcdir)/sysmips.c'; fi` strace-term.o: term.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-term.o -MD -MP -MF $(DEPDIR)/strace-term.Tpo -c -o strace-term.o `test -f 'term.c' || echo '$(srcdir)/'`term.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-term.o -MD -MP -MF $(DEPDIR)/strace-term.Tpo -c -o strace-term.o `test -f 'term.c' || echo '$(srcdir)/'`term.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-term.Tpo $(DEPDIR)/strace-term.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='term.c' object='strace-term.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-term.o `test -f 'term.c' || echo '$(srcdir)/'`term.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-term.o `test -f 'term.c' || echo '$(srcdir)/'`term.c strace-term.obj: term.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-term.obj -MD -MP -MF $(DEPDIR)/strace-term.Tpo -c -o strace-term.obj `if test -f 'term.c'; then $(CYGPATH_W) 'term.c'; else $(CYGPATH_W) '$(srcdir)/term.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-term.obj -MD -MP -MF $(DEPDIR)/strace-term.Tpo -c -o strace-term.obj `if test -f 'term.c'; then $(CYGPATH_W) 'term.c'; else $(CYGPATH_W) '$(srcdir)/term.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-term.Tpo $(DEPDIR)/strace-term.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='term.c' object='strace-term.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-term.obj `if test -f 'term.c'; then $(CYGPATH_W) 'term.c'; else $(CYGPATH_W) '$(srcdir)/term.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-term.obj `if test -f 'term.c'; then $(CYGPATH_W) 'term.c'; else $(CYGPATH_W) '$(srcdir)/term.c'; fi` strace-time.o: time.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-time.o -MD -MP -MF $(DEPDIR)/strace-time.Tpo -c -o strace-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-time.o -MD -MP -MF $(DEPDIR)/strace-time.Tpo -c -o strace-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-time.Tpo $(DEPDIR)/strace-time.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='time.c' object='strace-time.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c strace-time.obj: time.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-time.obj -MD -MP -MF $(DEPDIR)/strace-time.Tpo -c -o strace-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-time.obj -MD -MP -MF $(DEPDIR)/strace-time.Tpo -c -o strace-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-time.Tpo $(DEPDIR)/strace-time.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='time.c' object='strace-time.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi` + +strace-times.o: times.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-times.o -MD -MP -MF $(DEPDIR)/strace-times.Tpo -c -o strace-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-times.Tpo $(DEPDIR)/strace-times.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='times.c' object='strace-times.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c + +strace-times.obj: times.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-times.obj -MD -MP -MF $(DEPDIR)/strace-times.Tpo -c -o strace-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-times.Tpo $(DEPDIR)/strace-times.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='times.c' object='strace-times.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi` + +strace-truncate.o: truncate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-truncate.o -MD -MP -MF $(DEPDIR)/strace-truncate.Tpo -c -o strace-truncate.o `test -f 'truncate.c' || echo '$(srcdir)/'`truncate.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-truncate.Tpo $(DEPDIR)/strace-truncate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate.c' object='strace-truncate.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-truncate.o `test -f 'truncate.c' || echo '$(srcdir)/'`truncate.c + +strace-truncate.obj: truncate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-truncate.obj -MD -MP -MF $(DEPDIR)/strace-truncate.Tpo -c -o strace-truncate.obj `if test -f 'truncate.c'; then $(CYGPATH_W) 'truncate.c'; else $(CYGPATH_W) '$(srcdir)/truncate.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-truncate.Tpo $(DEPDIR)/strace-truncate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate.c' object='strace-truncate.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-truncate.obj `if test -f 'truncate.c'; then $(CYGPATH_W) 'truncate.c'; else $(CYGPATH_W) '$(srcdir)/truncate.c'; fi` + +strace-ubi.o: ubi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ubi.o -MD -MP -MF $(DEPDIR)/strace-ubi.Tpo -c -o strace-ubi.o `test -f 'ubi.c' || echo '$(srcdir)/'`ubi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ubi.Tpo $(DEPDIR)/strace-ubi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ubi.c' object='strace-ubi.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ubi.o `test -f 'ubi.c' || echo '$(srcdir)/'`ubi.c + +strace-ubi.obj: ubi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ubi.obj -MD -MP -MF $(DEPDIR)/strace-ubi.Tpo -c -o strace-ubi.obj `if test -f 'ubi.c'; then $(CYGPATH_W) 'ubi.c'; else $(CYGPATH_W) '$(srcdir)/ubi.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ubi.Tpo $(DEPDIR)/strace-ubi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ubi.c' object='strace-ubi.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ubi.obj `if test -f 'ubi.c'; then $(CYGPATH_W) 'ubi.c'; else $(CYGPATH_W) '$(srcdir)/ubi.c'; fi` + +strace-uid.o: uid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-uid.o -MD -MP -MF $(DEPDIR)/strace-uid.Tpo -c -o strace-uid.o `test -f 'uid.c' || echo '$(srcdir)/'`uid.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-uid.Tpo $(DEPDIR)/strace-uid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uid.c' object='strace-uid.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-uid.o `test -f 'uid.c' || echo '$(srcdir)/'`uid.c + +strace-uid.obj: uid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-uid.obj -MD -MP -MF $(DEPDIR)/strace-uid.Tpo -c -o strace-uid.obj `if test -f 'uid.c'; then $(CYGPATH_W) 'uid.c'; else $(CYGPATH_W) '$(srcdir)/uid.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-uid.Tpo $(DEPDIR)/strace-uid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uid.c' object='strace-uid.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-uid.obj `if test -f 'uid.c'; then $(CYGPATH_W) 'uid.c'; else $(CYGPATH_W) '$(srcdir)/uid.c'; fi` + +strace-uid16.o: uid16.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-uid16.o -MD -MP -MF $(DEPDIR)/strace-uid16.Tpo -c -o strace-uid16.o `test -f 'uid16.c' || echo '$(srcdir)/'`uid16.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-uid16.Tpo $(DEPDIR)/strace-uid16.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uid16.c' object='strace-uid16.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-uid16.o `test -f 'uid16.c' || echo '$(srcdir)/'`uid16.c + +strace-uid16.obj: uid16.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-uid16.obj -MD -MP -MF $(DEPDIR)/strace-uid16.Tpo -c -o strace-uid16.obj `if test -f 'uid16.c'; then $(CYGPATH_W) 'uid16.c'; else $(CYGPATH_W) '$(srcdir)/uid16.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-uid16.Tpo $(DEPDIR)/strace-uid16.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uid16.c' object='strace-uid16.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-uid16.obj `if test -f 'uid16.c'; then $(CYGPATH_W) 'uid16.c'; else $(CYGPATH_W) '$(srcdir)/uid16.c'; fi` + +strace-umask.o: umask.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-umask.o -MD -MP -MF $(DEPDIR)/strace-umask.Tpo -c -o strace-umask.o `test -f 'umask.c' || echo '$(srcdir)/'`umask.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-umask.Tpo $(DEPDIR)/strace-umask.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='umask.c' object='strace-umask.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-umask.o `test -f 'umask.c' || echo '$(srcdir)/'`umask.c + +strace-umask.obj: umask.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-umask.obj -MD -MP -MF $(DEPDIR)/strace-umask.Tpo -c -o strace-umask.obj `if test -f 'umask.c'; then $(CYGPATH_W) 'umask.c'; else $(CYGPATH_W) '$(srcdir)/umask.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-umask.Tpo $(DEPDIR)/strace-umask.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='umask.c' object='strace-umask.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-umask.obj `if test -f 'umask.c'; then $(CYGPATH_W) 'umask.c'; else $(CYGPATH_W) '$(srcdir)/umask.c'; fi` + +strace-umount.o: umount.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-umount.o -MD -MP -MF $(DEPDIR)/strace-umount.Tpo -c -o strace-umount.o `test -f 'umount.c' || echo '$(srcdir)/'`umount.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-umount.Tpo $(DEPDIR)/strace-umount.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='umount.c' object='strace-umount.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-umount.o `test -f 'umount.c' || echo '$(srcdir)/'`umount.c + +strace-umount.obj: umount.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-umount.obj -MD -MP -MF $(DEPDIR)/strace-umount.Tpo -c -o strace-umount.obj `if test -f 'umount.c'; then $(CYGPATH_W) 'umount.c'; else $(CYGPATH_W) '$(srcdir)/umount.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-umount.Tpo $(DEPDIR)/strace-umount.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='umount.c' object='strace-umount.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-umount.obj `if test -f 'umount.c'; then $(CYGPATH_W) 'umount.c'; else $(CYGPATH_W) '$(srcdir)/umount.c'; fi` + +strace-uname.o: uname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-uname.o -MD -MP -MF $(DEPDIR)/strace-uname.Tpo -c -o strace-uname.o `test -f 'uname.c' || echo '$(srcdir)/'`uname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-uname.Tpo $(DEPDIR)/strace-uname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uname.c' object='strace-uname.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-uname.o `test -f 'uname.c' || echo '$(srcdir)/'`uname.c + +strace-uname.obj: uname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-uname.obj -MD -MP -MF $(DEPDIR)/strace-uname.Tpo -c -o strace-uname.obj `if test -f 'uname.c'; then $(CYGPATH_W) 'uname.c'; else $(CYGPATH_W) '$(srcdir)/uname.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-uname.Tpo $(DEPDIR)/strace-uname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uname.c' object='strace-uname.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-uname.obj `if test -f 'uname.c'; then $(CYGPATH_W) 'uname.c'; else $(CYGPATH_W) '$(srcdir)/uname.c'; fi` + +strace-userfaultfd.o: userfaultfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-userfaultfd.o -MD -MP -MF $(DEPDIR)/strace-userfaultfd.Tpo -c -o strace-userfaultfd.o `test -f 'userfaultfd.c' || echo '$(srcdir)/'`userfaultfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-userfaultfd.Tpo $(DEPDIR)/strace-userfaultfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='userfaultfd.c' object='strace-userfaultfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-userfaultfd.o `test -f 'userfaultfd.c' || echo '$(srcdir)/'`userfaultfd.c + +strace-userfaultfd.obj: userfaultfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-userfaultfd.obj -MD -MP -MF $(DEPDIR)/strace-userfaultfd.Tpo -c -o strace-userfaultfd.obj `if test -f 'userfaultfd.c'; then $(CYGPATH_W) 'userfaultfd.c'; else $(CYGPATH_W) '$(srcdir)/userfaultfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-userfaultfd.Tpo $(DEPDIR)/strace-userfaultfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='userfaultfd.c' object='strace-userfaultfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-userfaultfd.obj `if test -f 'userfaultfd.c'; then $(CYGPATH_W) 'userfaultfd.c'; else $(CYGPATH_W) '$(srcdir)/userfaultfd.c'; fi` + +strace-ustat.o: ustat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ustat.o -MD -MP -MF $(DEPDIR)/strace-ustat.Tpo -c -o strace-ustat.o `test -f 'ustat.c' || echo '$(srcdir)/'`ustat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ustat.Tpo $(DEPDIR)/strace-ustat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ustat.c' object='strace-ustat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ustat.o `test -f 'ustat.c' || echo '$(srcdir)/'`ustat.c + +strace-ustat.obj: ustat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ustat.obj -MD -MP -MF $(DEPDIR)/strace-ustat.Tpo -c -o strace-ustat.obj `if test -f 'ustat.c'; then $(CYGPATH_W) 'ustat.c'; else $(CYGPATH_W) '$(srcdir)/ustat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ustat.Tpo $(DEPDIR)/strace-ustat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ustat.c' object='strace-ustat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ustat.obj `if test -f 'ustat.c'; then $(CYGPATH_W) 'ustat.c'; else $(CYGPATH_W) '$(srcdir)/ustat.c'; fi` strace-util.o: util.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-util.o -MD -MP -MF $(DEPDIR)/strace-util.Tpo -c -o strace-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-util.o -MD -MP -MF $(DEPDIR)/strace-util.Tpo -c -o strace-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-util.Tpo $(DEPDIR)/strace-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='strace-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c strace-util.obj: util.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-util.obj -MD -MP -MF $(DEPDIR)/strace-util.Tpo -c -o strace-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-util.obj -MD -MP -MF $(DEPDIR)/strace-util.Tpo -c -o strace-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-util.Tpo $(DEPDIR)/strace-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='strace-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +strace-utime.o: utime.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-utime.o -MD -MP -MF $(DEPDIR)/strace-utime.Tpo -c -o strace-utime.o `test -f 'utime.c' || echo '$(srcdir)/'`utime.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-utime.Tpo $(DEPDIR)/strace-utime.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utime.c' object='strace-utime.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-utime.o `test -f 'utime.c' || echo '$(srcdir)/'`utime.c -strace-vsprintf.o: vsprintf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-vsprintf.o -MD -MP -MF $(DEPDIR)/strace-vsprintf.Tpo -c -o strace-vsprintf.o `test -f 'vsprintf.c' || echo '$(srcdir)/'`vsprintf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-vsprintf.Tpo $(DEPDIR)/strace-vsprintf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vsprintf.c' object='strace-vsprintf.o' libtool=no @AMDEPBACKSLASH@ +strace-utime.obj: utime.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-utime.obj -MD -MP -MF $(DEPDIR)/strace-utime.Tpo -c -o strace-utime.obj `if test -f 'utime.c'; then $(CYGPATH_W) 'utime.c'; else $(CYGPATH_W) '$(srcdir)/utime.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-utime.Tpo $(DEPDIR)/strace-utime.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utime.c' object='strace-utime.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-vsprintf.o `test -f 'vsprintf.c' || echo '$(srcdir)/'`vsprintf.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-utime.obj `if test -f 'utime.c'; then $(CYGPATH_W) 'utime.c'; else $(CYGPATH_W) '$(srcdir)/utime.c'; fi` -strace-vsprintf.obj: vsprintf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-vsprintf.obj -MD -MP -MF $(DEPDIR)/strace-vsprintf.Tpo -c -o strace-vsprintf.obj `if test -f 'vsprintf.c'; then $(CYGPATH_W) 'vsprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsprintf.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-vsprintf.Tpo $(DEPDIR)/strace-vsprintf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vsprintf.c' object='strace-vsprintf.obj' libtool=no @AMDEPBACKSLASH@ +strace-utimes.o: utimes.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-utimes.o -MD -MP -MF $(DEPDIR)/strace-utimes.Tpo -c -o strace-utimes.o `test -f 'utimes.c' || echo '$(srcdir)/'`utimes.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-utimes.Tpo $(DEPDIR)/strace-utimes.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utimes.c' object='strace-utimes.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-vsprintf.obj `if test -f 'vsprintf.c'; then $(CYGPATH_W) 'vsprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsprintf.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-utimes.o `test -f 'utimes.c' || echo '$(srcdir)/'`utimes.c + +strace-utimes.obj: utimes.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-utimes.obj -MD -MP -MF $(DEPDIR)/strace-utimes.Tpo -c -o strace-utimes.obj `if test -f 'utimes.c'; then $(CYGPATH_W) 'utimes.c'; else $(CYGPATH_W) '$(srcdir)/utimes.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-utimes.Tpo $(DEPDIR)/strace-utimes.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utimes.c' object='strace-utimes.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-utimes.obj `if test -f 'utimes.c'; then $(CYGPATH_W) 'utimes.c'; else $(CYGPATH_W) '$(srcdir)/utimes.c'; fi` + +strace-v4l2.o: v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-v4l2.o -MD -MP -MF $(DEPDIR)/strace-v4l2.Tpo -c -o strace-v4l2.o `test -f 'v4l2.c' || echo '$(srcdir)/'`v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-v4l2.Tpo $(DEPDIR)/strace-v4l2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='v4l2.c' object='strace-v4l2.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-v4l2.o `test -f 'v4l2.c' || echo '$(srcdir)/'`v4l2.c + +strace-v4l2.obj: v4l2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-v4l2.obj -MD -MP -MF $(DEPDIR)/strace-v4l2.Tpo -c -o strace-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-v4l2.Tpo $(DEPDIR)/strace-v4l2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='v4l2.c' object='strace-v4l2.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi` + +strace-wait.o: wait.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-wait.o -MD -MP -MF $(DEPDIR)/strace-wait.Tpo -c -o strace-wait.o `test -f 'wait.c' || echo '$(srcdir)/'`wait.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-wait.Tpo $(DEPDIR)/strace-wait.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wait.c' object='strace-wait.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-wait.o `test -f 'wait.c' || echo '$(srcdir)/'`wait.c + +strace-wait.obj: wait.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-wait.obj -MD -MP -MF $(DEPDIR)/strace-wait.Tpo -c -o strace-wait.obj `if test -f 'wait.c'; then $(CYGPATH_W) 'wait.c'; else $(CYGPATH_W) '$(srcdir)/wait.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-wait.Tpo $(DEPDIR)/strace-wait.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wait.c' object='strace-wait.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-wait.obj `if test -f 'wait.c'; then $(CYGPATH_W) 'wait.c'; else $(CYGPATH_W) '$(srcdir)/wait.c'; fi` + +strace-xattr.o: xattr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-xattr.o -MD -MP -MF $(DEPDIR)/strace-xattr.Tpo -c -o strace-xattr.o `test -f 'xattr.c' || echo '$(srcdir)/'`xattr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-xattr.Tpo $(DEPDIR)/strace-xattr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xattr.c' object='strace-xattr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xattr.o `test -f 'xattr.c' || echo '$(srcdir)/'`xattr.c + +strace-xattr.obj: xattr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-xattr.obj -MD -MP -MF $(DEPDIR)/strace-xattr.Tpo -c -o strace-xattr.obj `if test -f 'xattr.c'; then $(CYGPATH_W) 'xattr.c'; else $(CYGPATH_W) '$(srcdir)/xattr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-xattr.Tpo $(DEPDIR)/strace-xattr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xattr.c' object='strace-xattr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xattr.obj `if test -f 'xattr.c'; then $(CYGPATH_W) 'xattr.c'; else $(CYGPATH_W) '$(srcdir)/xattr.c'; fi` + +strace-xmalloc.o: xmalloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-xmalloc.o -MD -MP -MF $(DEPDIR)/strace-xmalloc.Tpo -c -o strace-xmalloc.o `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-xmalloc.Tpo $(DEPDIR)/strace-xmalloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmalloc.c' object='strace-xmalloc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xmalloc.o `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c + +strace-xmalloc.obj: xmalloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-xmalloc.obj -MD -MP -MF $(DEPDIR)/strace-xmalloc.Tpo -c -o strace-xmalloc.obj `if test -f 'xmalloc.c'; then $(CYGPATH_W) 'xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/xmalloc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-xmalloc.Tpo $(DEPDIR)/strace-xmalloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmalloc.c' object='strace-xmalloc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xmalloc.obj `if test -f 'xmalloc.c'; then $(CYGPATH_W) 'xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/xmalloc.c'; fi` strace-unwind.o: unwind.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-unwind.o -MD -MP -MF $(DEPDIR)/strace-unwind.Tpo -c -o strace-unwind.o `test -f 'unwind.c' || echo '$(srcdir)/'`unwind.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-unwind.o -MD -MP -MF $(DEPDIR)/strace-unwind.Tpo -c -o strace-unwind.o `test -f 'unwind.c' || echo '$(srcdir)/'`unwind.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-unwind.Tpo $(DEPDIR)/strace-unwind.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unwind.c' object='strace-unwind.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-unwind.o `test -f 'unwind.c' || echo '$(srcdir)/'`unwind.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-unwind.o `test -f 'unwind.c' || echo '$(srcdir)/'`unwind.c strace-unwind.obj: unwind.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strace-unwind.obj -MD -MP -MF $(DEPDIR)/strace-unwind.Tpo -c -o strace-unwind.obj `if test -f 'unwind.c'; then $(CYGPATH_W) 'unwind.c'; else $(CYGPATH_W) '$(srcdir)/unwind.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-unwind.obj -MD -MP -MF $(DEPDIR)/strace-unwind.Tpo -c -o strace-unwind.obj `if test -f 'unwind.c'; then $(CYGPATH_W) 'unwind.c'; else $(CYGPATH_W) '$(srcdir)/unwind.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-unwind.Tpo $(DEPDIR)/strace-unwind.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unwind.c' object='strace-unwind.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strace-unwind.obj `if test -f 'unwind.c'; then $(CYGPATH_W) 'unwind.c'; else $(CYGPATH_W) '$(srcdir)/unwind.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-unwind.obj `if test -f 'unwind.c'; then $(CYGPATH_W) 'unwind.c'; else $(CYGPATH_W) '$(srcdir)/unwind.c'; fi` install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ @@ -1518,6 +5376,7 @@ $(am__recursive_targets): if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" +check-valgrind-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -1784,7 +5643,7 @@ distcleancheck: distclean check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(HEADERS) config.h +all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ @@ -1818,14 +5677,20 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + clean: clean-recursive -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-local \ + clean-noinstLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) @@ -1901,28 +5766,28 @@ uninstall-man: uninstall-man1 install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-binPROGRAMS \ - clean-cscope clean-generic cscope cscopelist-am ctags ctags-am \ - dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzip \ - dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ - distclean-compile distclean-generic distclean-hdr \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-binSCRIPTS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-binSCRIPTS uninstall-man uninstall-man1 + am--refresh check check-am check-valgrind-am \ + check-valgrind-local clean clean-binPROGRAMS clean-cscope \ + clean-generic clean-local clean-noinstLIBRARIES cscope \ + cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-binPROGRAMS \ + install-binSCRIPTS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-man uninstall-man1 $(top_srcdir)/xlat/access_flags.h: $(top_srcdir)/xlat/access_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/aclcmds.h: $(top_srcdir)/xlat/aclcmds.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/aclipc.h: $(top_srcdir)/xlat/aclipc.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/addrfams.h: $(top_srcdir)/xlat/addrfams.in $(top_srcdir)/xlat/gen.sh @@ -1939,10 +5804,14 @@ $(top_srcdir)/xlat/af_packet_types.h: $(top_srcdir)/xlat/af_packet_types.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/archvals.h: $(top_srcdir)/xlat/archvals.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/arp_hardware_types.h: $(top_srcdir)/xlat/arp_hardware_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/at_flags.h: $(top_srcdir)/xlat/at_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/atomic_ops.h: $(top_srcdir)/xlat/atomic_ops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/audit_arch.h: $(top_srcdir)/xlat/audit_arch.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/baud_options.h: $(top_srcdir)/xlat/baud_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/blkpg_ops.h: $(top_srcdir)/xlat/blkpg_ops.in $(top_srcdir)/xlat/gen.sh @@ -1953,11 +5822,97 @@ $(top_srcdir)/xlat/bootflags2.h: $(top_srcdir)/xlat/bootflags2.in $(top_srcdir)/ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags3.h: $(top_srcdir)/xlat/bootflags3.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_attach_type.h: $(top_srcdir)/xlat/bpf_attach_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_class.h: $(top_srcdir)/xlat/bpf_class.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_commands.h: $(top_srcdir)/xlat/bpf_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_map_types.h: $(top_srcdir)/xlat/bpf_map_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_map_update_elem_flags.h: $(top_srcdir)/xlat/bpf_map_update_elem_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_miscop.h: $(top_srcdir)/xlat/bpf_miscop.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_mode.h: $(top_srcdir)/xlat/bpf_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_op_alu.h: $(top_srcdir)/xlat/bpf_op_alu.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_op_jmp.h: $(top_srcdir)/xlat/bpf_op_jmp.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_prog_types.h: $(top_srcdir)/xlat/bpf_prog_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_rval.h: $(top_srcdir)/xlat/bpf_rval.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_size.h: $(top_srcdir)/xlat/bpf_size.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_src.h: $(top_srcdir)/xlat/bpf_src.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bsg_flags.h: $(top_srcdir)/xlat/bsg_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bsg_protocol.h: $(top_srcdir)/xlat/bsg_protocol.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bsg_subprotocol.h: $(top_srcdir)/xlat/bsg_subprotocol.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bt_protocols.h: $(top_srcdir)/xlat/bt_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_args.h: $(top_srcdir)/xlat/btrfs_balance_args.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_ctl_cmds.h: $(top_srcdir)/xlat/btrfs_balance_ctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_flags.h: $(top_srcdir)/xlat/btrfs_balance_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_state.h: $(top_srcdir)/xlat/btrfs_balance_state.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_compress_types.h: $(top_srcdir)/xlat/btrfs_compress_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_defrag_flags.h: $(top_srcdir)/xlat/btrfs_defrag_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_replace_cmds.h: $(top_srcdir)/xlat/btrfs_dev_replace_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_replace_results.h: $(top_srcdir)/xlat/btrfs_dev_replace_results.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_replace_state.h: $(top_srcdir)/xlat/btrfs_dev_replace_state.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_stats_flags.h: $(top_srcdir)/xlat/btrfs_dev_stats_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_stats_values.h: $(top_srcdir)/xlat/btrfs_dev_stats_values.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_features_compat.h: $(top_srcdir)/xlat/btrfs_features_compat.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_features_compat_ro.h: $(top_srcdir)/xlat/btrfs_features_compat_ro.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_features_incompat.h: $(top_srcdir)/xlat/btrfs_features_incompat.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_key_types.h: $(top_srcdir)/xlat/btrfs_key_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.h: $(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_limit_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_limit_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_status_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_status_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_scrub_flags.h: $(top_srcdir)/xlat/btrfs_scrub_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_send_flags.h: $(top_srcdir)/xlat/btrfs_send_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_snap_flags_v2.h: $(top_srcdir)/xlat/btrfs_snap_flags_v2.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_space_info_flags.h: $(top_srcdir)/xlat/btrfs_space_info_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_tree_objectids.h: $(top_srcdir)/xlat/btrfs_tree_objectids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cacheflush_scope.h: $(top_srcdir)/xlat/cacheflush_scope.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/cap_version.h: $(top_srcdir)/xlat/cap_version.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/cap.h: $(top_srcdir)/xlat/cap.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/cap_mask0.h: $(top_srcdir)/xlat/cap_mask0.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/capabilities.h: $(top_srcdir)/xlat/capabilities.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/cap_mask1.h: $(top_srcdir)/xlat/cap_mask1.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/cap_version.h: $(top_srcdir)/xlat/cap_version.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/clockflags.h: $(top_srcdir)/xlat/clockflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -1969,9 +5924,11 @@ $(top_srcdir)/xlat/cpuclocknames.h: $(top_srcdir)/xlat/cpuclocknames.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/delete_module_flags.h: $(top_srcdir)/xlat/delete_module_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/direnttypes.h: $(top_srcdir)/xlat/direnttypes.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/dirent_types.h: $(top_srcdir)/xlat/dirent_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/domains.h: $(top_srcdir)/xlat/domains.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/dm_flags.h: $(top_srcdir)/xlat/dm_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/efd_flags.h: $(top_srcdir)/xlat/efd_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/epollctls.h: $(top_srcdir)/xlat/epollctls.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -1979,6 +5936,42 @@ $(top_srcdir)/xlat/epollevents.h: $(top_srcdir)/xlat/epollevents.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/epollflags.h: $(top_srcdir)/xlat/epollflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ethernet_protocols.h: $(top_srcdir)/xlat/ethernet_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_abs.h: $(top_srcdir)/xlat/evdev_abs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_autorepeat.h: $(top_srcdir)/xlat/evdev_autorepeat.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_ev.h: $(top_srcdir)/xlat/evdev_ev.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_ff_status.h: $(top_srcdir)/xlat/evdev_ff_status.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_ff_types.h: $(top_srcdir)/xlat/evdev_ff_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_keycode.h: $(top_srcdir)/xlat/evdev_keycode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_leds.h: $(top_srcdir)/xlat/evdev_leds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_misc.h: $(top_srcdir)/xlat/evdev_misc.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_mtslots.h: $(top_srcdir)/xlat/evdev_mtslots.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_prop.h: $(top_srcdir)/xlat/evdev_prop.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_relative_axes.h: $(top_srcdir)/xlat/evdev_relative_axes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_snd.h: $(top_srcdir)/xlat/evdev_snd.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_switch.h: $(top_srcdir)/xlat/evdev_switch.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_sync.h: $(top_srcdir)/xlat/evdev_sync.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/f_owner_types.h: $(top_srcdir)/xlat/f_owner_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/f_seals.h: $(top_srcdir)/xlat/f_seals.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/falloc_flags.h: $(top_srcdir)/xlat/falloc_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_classes.h: $(top_srcdir)/xlat/fan_classes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_event_flags.h: $(top_srcdir)/xlat/fan_event_flags.in $(top_srcdir)/xlat/gen.sh @@ -1987,11 +5980,15 @@ $(top_srcdir)/xlat/fan_init_flags.h: $(top_srcdir)/xlat/fan_init_flags.in $(top_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_mark_flags.h: $(top_srcdir)/xlat/fan_mark_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fcntl64cmds.h: $(top_srcdir)/xlat/fcntl64cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fcntlcmds.h: $(top_srcdir)/xlat/fcntlcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fdflags.h: $(top_srcdir)/xlat/fdflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/fileflags.h: $(top_srcdir)/xlat/fileflags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/fiemap_extent_flags.h: $(top_srcdir)/xlat/fiemap_extent_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fiemap_flags.h: $(top_srcdir)/xlat/fiemap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/flockcmds.h: $(top_srcdir)/xlat/flockcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -2003,10 +6000,24 @@ $(top_srcdir)/xlat/futexwakecmps.h: $(top_srcdir)/xlat/futexwakecmps.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/futexwakeops.h: $(top_srcdir)/xlat/futexwakeops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getrandom_flags.h: $(top_srcdir)/xlat/getrandom_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getsockipoptions.h: $(top_srcdir)/xlat/getsockipoptions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getsockipv6options.h: $(top_srcdir)/xlat/getsockipv6options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/hci_channels.h: $(top_srcdir)/xlat/hci_channels.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/hw_breakpoint_len.h: $(top_srcdir)/xlat/hw_breakpoint_len.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/hw_breakpoint_type.h: $(top_srcdir)/xlat/hw_breakpoint_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/icmpfilterflags.h: $(top_srcdir)/xlat/icmpfilterflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/if_dqblk_valid.h: $(top_srcdir)/xlat/if_dqblk_valid.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/if_dqinfo_flags.h: $(top_srcdir)/xlat/if_dqinfo_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/if_dqinfo_valid.h: $(top_srcdir)/xlat/if_dqinfo_valid.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/iffflags.h: $(top_srcdir)/xlat/iffflags.in $(top_srcdir)/xlat/gen.sh @@ -2017,17 +6028,27 @@ $(top_srcdir)/xlat/inotify_flags.h: $(top_srcdir)/xlat/inotify_flags.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/inotify_init_flags.h: $(top_srcdir)/xlat/inotify_init_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ioctl_dirs.h: $(top_srcdir)/xlat/ioctl_dirs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ioprio_class.h: $(top_srcdir)/xlat/ioprio_class.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ioprio_who.h: $(top_srcdir)/xlat/ioprio_who.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ip_cmsg_types.h: $(top_srcdir)/xlat/ip_cmsg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ipc_msg_flags.h: $(top_srcdir)/xlat/ipc_msg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ipccalls.h: $(top_srcdir)/xlat/ipccalls.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/itimer_which.h: $(top_srcdir)/xlat/itimer_which.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kcmp_types.h: $(top_srcdir)/xlat/kcmp_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/kexec_arch_values.h: $(top_srcdir)/xlat/kexec_arch_values.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/kexec_flags.h: $(top_srcdir)/xlat/kexec_flags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/kexec_file_load_flags.h: $(top_srcdir)/xlat/kexec_file_load_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kexec_load_flags.h: $(top_srcdir)/xlat/kexec_load_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/key_perms.h: $(top_srcdir)/xlat/key_perms.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -2039,6 +6060,8 @@ $(top_srcdir)/xlat/keyctl_commands.h: $(top_srcdir)/xlat/keyctl_commands.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/lockfcmds.h: $(top_srcdir)/xlat/lockfcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/loop_cmds.h: $(top_srcdir)/xlat/loop_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_crypt_type_options.h: $(top_srcdir)/xlat/loop_crypt_type_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_flags_options.h: $(top_srcdir)/xlat/loop_flags_options.in $(top_srcdir)/xlat/gen.sh @@ -2047,14 +6070,16 @@ $(top_srcdir)/xlat/madvise_cmds.h: $(top_srcdir)/xlat/madvise_cmds.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mbindflags.h: $(top_srcdir)/xlat/mbindflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/mctl_funcs.h: $(top_srcdir)/xlat/mctl_funcs.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/mctl_sync.h: $(top_srcdir)/xlat/mctl_sync.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/mctl_lockas.h: $(top_srcdir)/xlat/mctl_lockas.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/membarrier_cmds.h: $(top_srcdir)/xlat/membarrier_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/mctl_sync.h: $(top_srcdir)/xlat/mctl_sync.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/memfd_create_flags.h: $(top_srcdir)/xlat/memfd_create_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mempolicyflags.h: $(top_srcdir)/xlat/mempolicyflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mlock_flags.h: $(top_srcdir)/xlat/mlock_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mlockall_flags.h: $(top_srcdir)/xlat/mlockall_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mmap_flags.h: $(top_srcdir)/xlat/mmap_flags.in $(top_srcdir)/xlat/gen.sh @@ -2065,21 +6090,21 @@ $(top_srcdir)/xlat/modem_flags.h: $(top_srcdir)/xlat/modem_flags.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/modetypes.h: $(top_srcdir)/xlat/modetypes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/modflags.h: $(top_srcdir)/xlat/modflags.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/module_init_flags.h: $(top_srcdir)/xlat/module_init_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mount_flags.h: $(top_srcdir)/xlat/mount_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/move_pages_flags.h: $(top_srcdir)/xlat/move_pages_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mq_attr_flags.h: $(top_srcdir)/xlat/mq_attr_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mremap_flags.h: $(top_srcdir)/xlat/mremap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/msg_flags.h: $(top_srcdir)/xlat/msg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/msgctl_flags.h: $(top_srcdir)/xlat/msgctl_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/msgflags.h: $(top_srcdir)/xlat/msgflags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/mtd_file_mode_options.h: $(top_srcdir)/xlat/mtd_file_mode_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mtd_flags_options.h: $(top_srcdir)/xlat/mtd_flags_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -2091,8 +6116,14 @@ $(top_srcdir)/xlat/mtd_otp_options.h: $(top_srcdir)/xlat/mtd_otp_options.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mtd_type_options.h: $(top_srcdir)/xlat/mtd_type_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/name_to_handle_at_flags.h: $(top_srcdir)/xlat/name_to_handle_at_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_flags.h: $(top_srcdir)/xlat/netlink_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_protocols.h: $(top_srcdir)/xlat/netlink_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_types.h: $(top_srcdir)/xlat/netlink_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/notifyflags.h: $(top_srcdir)/xlat/notifyflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/nt_descriptor_types.h: $(top_srcdir)/xlat/nt_descriptor_types.in $(top_srcdir)/xlat/gen.sh @@ -2103,16 +6134,56 @@ $(top_srcdir)/xlat/open_mode_flags.h: $(top_srcdir)/xlat/open_mode_flags.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/openmodessol.h: $(top_srcdir)/xlat/openmodessol.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/packet_mreq_type.h: $(top_srcdir)/xlat/packet_mreq_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_attr_size.h: $(top_srcdir)/xlat/perf_attr_size.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_branch_sample_type.h: $(top_srcdir)/xlat/perf_branch_sample_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_event_open_flags.h: $(top_srcdir)/xlat/perf_event_open_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/personality_options.h: $(top_srcdir)/xlat/personality_options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/perf_event_read_format.h: $(top_srcdir)/xlat/perf_event_read_format.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_event_sample_format.h: $(top_srcdir)/xlat/perf_event_sample_format.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_hw_cache_id.h: $(top_srcdir)/xlat/perf_hw_cache_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_hw_cache_op_id.h: $(top_srcdir)/xlat/perf_hw_cache_op_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_hw_cache_op_result_id.h: $(top_srcdir)/xlat/perf_hw_cache_op_result_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_hw_id.h: $(top_srcdir)/xlat/perf_hw_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_sw_ids.h: $(top_srcdir)/xlat/perf_sw_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_type_id.h: $(top_srcdir)/xlat/perf_type_id.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/pmsgflags.h: $(top_srcdir)/xlat/pmsgflags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/personality_flags.h: $(top_srcdir)/xlat/personality_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/personality_types.h: $(top_srcdir)/xlat/personality_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pkey_access.h: $(top_srcdir)/xlat/pkey_access.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/policies.h: $(top_srcdir)/xlat/policies.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pollflags.h: $(top_srcdir)/xlat/pollflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_cap_ambient.h: $(top_srcdir)/xlat/pr_cap_ambient.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_dumpable.h: $(top_srcdir)/xlat/pr_dumpable.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_fp_mode.h: $(top_srcdir)/xlat/pr_fp_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_mce_kill.h: $(top_srcdir)/xlat/pr_mce_kill.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_mce_kill_policy.h: $(top_srcdir)/xlat/pr_mce_kill_policy.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_set_mm.h: $(top_srcdir)/xlat/pr_set_mm.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_tsc.h: $(top_srcdir)/xlat/pr_tsc.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_unalign_flags.h: $(top_srcdir)/xlat/pr_unalign_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/prctl_options.h: $(top_srcdir)/xlat/prctl_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/priorities.h: $(top_srcdir)/xlat/priorities.in $(top_srcdir)/xlat/gen.sh @@ -2121,9 +6192,11 @@ $(top_srcdir)/xlat/ptp_flags_options.h: $(top_srcdir)/xlat/ptp_flags_options.in $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ptrace_cmds.h: $(top_srcdir)/xlat/ptrace_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/ptrace_setoptions_flags.h: $(top_srcdir)/xlat/ptrace_setoptions_flags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/ptrace_events.h: $(top_srcdir)/xlat/ptrace_events.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ptrace_peeksiginfo_flags.h: $(top_srcdir)/xlat/ptrace_peeksiginfo_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/qm_which.h: $(top_srcdir)/xlat/qm_which.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/ptrace_setoptions_flags.h: $(top_srcdir)/xlat/ptrace_setoptions_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quota_formats.h: $(top_srcdir)/xlat/quota_formats.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -2137,16 +6210,48 @@ $(top_srcdir)/xlat/resource_flags.h: $(top_srcdir)/xlat/resource_flags.in $(top_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/resources.h: $(top_srcdir)/xlat/resources.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rwf_flags.h: $(top_srcdir)/xlat/rwf_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sa_handler_values.h: $(top_srcdir)/xlat/sa_handler_values.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sched_flags.h: $(top_srcdir)/xlat/sched_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/schedulers.h: $(top_srcdir)/xlat/schedulers.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/scmvals.h: $(top_srcdir)/xlat/scmvals.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/scsi_sg_commands.h: $(top_srcdir)/xlat/scsi_sg_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/secbits.h: $(top_srcdir)/xlat/secbits.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_filter_flags.h: $(top_srcdir)/xlat/seccomp_filter_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_mode.h: $(top_srcdir)/xlat/seccomp_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_ops.h: $(top_srcdir)/xlat/seccomp_ops.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_ret_action.h: $(top_srcdir)/xlat/seccomp_ret_action.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/semctl_flags.h: $(top_srcdir)/xlat/semctl_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/semop_flags.h: $(top_srcdir)/xlat/semop_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setns_types.h: $(top_srcdir)/xlat/setns_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setsockipoptions.h: $(top_srcdir)/xlat/setsockipoptions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setsockipv6options.h: $(top_srcdir)/xlat/setsockipv6options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sfd_flags.h: $(top_srcdir)/xlat/sfd_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sg_io_dxfer_direction.h: $(top_srcdir)/xlat/sg_io_dxfer_direction.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sg_io_flags.h: $(top_srcdir)/xlat/sg_io_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sg_io_info.h: $(top_srcdir)/xlat/sg_io_info.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sg_scsi_reset.h: $(top_srcdir)/xlat/sg_scsi_reset.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/shm_flags.h: $(top_srcdir)/xlat/shm_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/shm_resource_flags.h: $(top_srcdir)/xlat/shm_resource_flags.in $(top_srcdir)/xlat/gen.sh @@ -2187,6 +6292,8 @@ $(top_srcdir)/xlat/sigtrap_codes.h: $(top_srcdir)/xlat/sigtrap_codes.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sock_type_flags.h: $(top_srcdir)/xlat/sock_type_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/socketcalls.h: $(top_srcdir)/xlat/socketcalls.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/socketlayers.h: $(top_srcdir)/xlat/socketlayers.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sockipoptions.h: $(top_srcdir)/xlat/sockipoptions.in $(top_srcdir)/xlat/gen.sh @@ -2211,6 +6318,8 @@ $(top_srcdir)/xlat/splice_flags.h: $(top_srcdir)/xlat/splice_flags.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sram_alloc_flags.h: $(top_srcdir)/xlat/sram_alloc_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/statfs_flags.h: $(top_srcdir)/xlat/statfs_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/swap_flags.h: $(top_srcdir)/xlat/swap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sync_file_range_flags.h: $(top_srcdir)/xlat/sync_file_range_flags.in $(top_srcdir)/xlat/gen.sh @@ -2251,10 +6360,56 @@ $(top_srcdir)/xlat/ubi_volume_props.h: $(top_srcdir)/xlat/ubi_volume_props.in $( $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ubi_volume_types.h: $(top_srcdir)/xlat/ubi_volume_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_api_flags.h: $(top_srcdir)/xlat/uffd_api_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_copy_flags.h: $(top_srcdir)/xlat/uffd_copy_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_flags.h: $(top_srcdir)/xlat/uffd_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_register_ioctl_flags.h: $(top_srcdir)/xlat/uffd_register_ioctl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_register_mode_flags.h: $(top_srcdir)/xlat/uffd_register_mode_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_zeropage_flags.h: $(top_srcdir)/xlat/uffd_zeropage_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/umount_flags.h: $(top_srcdir)/xlat/umount_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/unshare_flags.h: $(top_srcdir)/xlat/unshare_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/usagewho.h: $(top_srcdir)/xlat/usagewho.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_buf_flags.h: $(top_srcdir)/xlat/v4l2_buf_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_buf_types.h: $(top_srcdir)/xlat/v4l2_buf_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_capture_modes.h: $(top_srcdir)/xlat/v4l2_capture_modes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_colorspaces.h: $(top_srcdir)/xlat/v4l2_colorspaces.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_classes.h: $(top_srcdir)/xlat/v4l2_control_classes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_flags.h: $(top_srcdir)/xlat/v4l2_control_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_ids.h: $(top_srcdir)/xlat/v4l2_control_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_types.h: $(top_srcdir)/xlat/v4l2_control_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_device_capabilities_flags.h: $(top_srcdir)/xlat/v4l2_device_capabilities_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_fields.h: $(top_srcdir)/xlat/v4l2_fields.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_format_description_flags.h: $(top_srcdir)/xlat/v4l2_format_description_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_frameinterval_types.h: $(top_srcdir)/xlat/v4l2_frameinterval_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_framesize_types.h: $(top_srcdir)/xlat/v4l2_framesize_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_input_types.h: $(top_srcdir)/xlat/v4l2_input_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_memories.h: $(top_srcdir)/xlat/v4l2_memories.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_streaming_capabilities.h: $(top_srcdir)/xlat/v4l2_streaming_capabilities.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/wait4_options.h: $(top_srcdir)/xlat/wait4_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/waitid_types.h: $(top_srcdir)/xlat/waitid_types.in $(top_srcdir)/xlat/gen.sh @@ -2268,6 +6423,11 @@ $(top_srcdir)/xlat/xfs_dqblk_flags.h: $(top_srcdir)/xlat/xfs_dqblk_flags.in $(to $(top_srcdir)/xlat/xfs_quota_flags.h: $(top_srcdir)/xlat/xfs_quota_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +@CODE_COVERAGE_RULES@ + +.PHONY: check-valgrind-local +check-valgrind-local: + .PHONY: srpm srpm: dist-xz rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz @@ -2275,6 +6435,15 @@ srpm: dist-xz $(srcdir)/.version: $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ +sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c)) + for f in $^; do \ + sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \ + done | sort -u > $@ + +sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files)) + for f in $^; do cat -- $$f; done | \ + $(srcdir)/generate_sen.sh > $@ + dist-hook: $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version @@ -2286,6 +6455,115 @@ news-check: NEWS echo >&2 '$<: check failed'; \ exit 1; \ fi + +ioctl_redefs%.h: ioctlent%.h ioctlent0.h + sort $< > $<-t + sort ioctlent0.h | comm -23 $<-t - | \ + sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \ + > $@-t + rm -f $<-t + mv $@-t $@ + +ioctlent%.h: ioctlsort% + ./$< > $@ + +# Need to pick up definitions *for host* while compiling +# ioctlsort *for build*, hence this magic. +ioctl_iocdef.i: $(srcdir)/ioctl_iocdef.c + $(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(strace_CPPFLAGS) $(CPPFLAGS) $< -o $@ + +ioctl_iocdef.h: ioctl_iocdef.i + sed -n 's/^DEFINE HOST/#define /p' $< > $@ + +ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o + $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@ + +ioctlsort%.o: ioctls_all%.h ioctl_iocdef.h $(srcdir)/ioctlsort.c + $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c + +ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h + cat $^ > $@ + +syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ + +scno.h: $(top_srcdir)/scno.head syscallent.i + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + cat $< >> $@-t + LC_ALL=C sed -n '$(SCNO_SED)' $(filter-out $<,$^) >> $@-t + mv $@-t $@ + +$(strace_OBJECTS): scno.h + +# mpers targets + +mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h + for f in $^; do \ + CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \ + CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \ + $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \ + done + > $@ + +m%_type_defs.h: $(srcdir_mpers_source_files) + for f in $^; do \ + sed -r -n 's/^#[[:space:]]*include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \ + done > $@-t + echo '#undef MPERS_PRINTER_NAME' >> $@-t + echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t + echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t + echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t + mv $@-t $@ + +m%_funcs.h: $(srcdir_mpers_source_files) + for f in $^; do \ + sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \ + done > $@-t && \ + echo '#include "sys_func.h"' >> $@-t + mv $@-t $@ + +# printers + +%.c.mpers.i: $(srcdir)/%.c + $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@ + +printers.h: $(mpers_preproc_files) + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + echo 'typedef struct {' >> $@-t + for f in $^; do \ + sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \ + || exit; \ + done >> $@-t + echo '} struct_printers;' >> $@-t + echo 'extern const struct_printers *printers;' >> $@-t + echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t + mv $@-t $@ + +%_printer_decls.h: $(mpers_preproc_files) + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + for f in $^; do \ + sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \ + || exit; \ + done >> $@-t + mv $@-t $@ + +%_printer_defs.h: $(mpers_preproc_files) + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + for f in $^; do \ + sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \ + || exit; \ + done >> $@-t + mv $@-t $@ + +native_printer_decls.h native_printer_defs.h: mpers_PREFIX = + +@HAVE_M32_MPERS_TRUE@$(mpers_m32_targets): mpers_NAME = m32 + +@HAVE_MX32_MPERS_TRUE@$(mpers_mx32_targets): mpers_NAME = mx32 + +clean-local: + -rm -rf mpers-m32 mpers-mx32 @MAINTAINER_MODE_TRUE@$(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \ @MAINTAINER_MODE_TRUE@ $(srcdir)/.version @MAINTAINER_MODE_TRUE@ @rm -f $@.new @@ -2303,7 +6581,7 @@ news-check: NEWS @MAINTAINER_MODE_TRUE@ ( \ @MAINTAINER_MODE_TRUE@ cd $(srcdir); \ @MAINTAINER_MODE_TRUE@ sed '/^##/,$$d' CREDITS.in; \ -@MAINTAINER_MODE_TRUE@ { sed -n '1,/^##>/d; s/ \+/\t/; s/^./&/p' CREDITS.in; \ +@MAINTAINER_MODE_TRUE@ { sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \ @MAINTAINER_MODE_TRUE@ git log --pretty=format:'%aN %aE'; \ @MAINTAINER_MODE_TRUE@ } | LC_ALL=C sort -u \ @MAINTAINER_MODE_TRUE@ | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \ @@ -2311,22 +6589,6 @@ news-check: NEWS @MAINTAINER_MODE_TRUE@export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX -@MAINTAINER_MODE_TRUE@$(srcdir)/$(ioctlent_h_in): ioctlsort -@MAINTAINER_MODE_TRUE@ $( $@ -@MAINTAINER_MODE_TRUE@ioctlsort: $(srcdir)/linux/ioctlsort.c ioctls.h ioctldefs.h -@MAINTAINER_MODE_TRUE@ $(filter-out -I%,$(LINK.c)) -I. -I$(IOCTLSORT_INCLUDEDIR) \ -@MAINTAINER_MODE_TRUE@ $(filter -I%,$(LINK.c)) \ -@MAINTAINER_MODE_TRUE@ -o $@ $< -@MAINTAINER_MODE_TRUE@ioctls.h: $(srcdir)/linux/ioctlent.sh -@MAINTAINER_MODE_TRUE@ $(SHELL) $< $(IOCTLDIR) $(IOCTLASM) -@MAINTAINER_MODE_TRUE@ioctldefs.h: ioctls.h ; -$(ioctlent_h): $(top_builddir)/config.status $(ioctlent_h_deps) - $(MKDIR_P) $(builddir)/$(OS) - cat $(ioctlent_h_deps) | \ - $(COMPILE) -E -P - | \ - LC_ALL=C sort -u -k3,3 -k2,2 | \ - awk -f $(srcdir)/linux/ioctlent-filter.awk > $@ - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/NEWS b/NEWS index 373d36f0..e5d01a36 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,336 @@ +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. + +Noteworthy changes in release 4.14 (2016-10-04) +=============================================== + +* Changes in behavior + * When using -p option without a command and no processes has been attached, + strace exits with exit status 1. + +* Improvements + * Added printing of the mode argument of open and openat syscalls + when O_TMPFILE flag is set. (Addresses Fedora bug #1377846). + * Enhanced -e abbrev=set, -e raw=set, and -e verbose=set. + * Enhanced decoding of futex, keyctl, quotactl, timerfd_settime, + and aio family syscalls. + * Implemented fetching of the 7th subcall argument on mips o32. + * Updated lists of BPF_*, ETH_P_*, KEXEC_ARCH_*, SCTP_*, TCP_*, and *_MAGIC + constants. + * Updated lists of ioctl commands from Linux 4.8. + * Added decoding of new syscalls on sh and sh64. + * Added RISC-V architecture support. + +* Bug fixes + * Marked io_setup and io_destroy as memory mapping related syscalls. + * Fixed leakage of placeholder descriptors to tracees. + * Fixed printing of mode_t, umode_t, and umask types. + * Fixed decoding of iovec arrays without a limit on total data size. + * Fixed decoding of fadvise64, fallocate, futex, keyctl, quotactl, readahead, + and ipc family syscalls. + * Fixed decoding of invalid syscalls mapped to indirect subcalls. + * Fixed decoding of struct btrfs_ioctl_vol_args_v2 on non-native + personalities. + * Fixed decoding of PTRACE_DETACH on sparc and sparc64. + * Fixed decoding of struct stat64 on sparc64. + * Fixed decoding of uid and gid-related syscalls on sparc64. + * Fixed decoding of the forth argument of semctl syscall on sparc64. + * Fixed values of tty ioctl constants on sparc64. + * Fixed sparc personality support on sparc64. + +Noteworthy changes in release 4.13 (2016-07-26) +=============================================== + +* Improvements + * Implemented a general netlink socket parser. + * Enhanced decoding of socket addresses. + * Enhanced decoding of cmsghdr, msghdr, and mmsghdr structures. + * Enhanced decoding of accept, accept4, bind, getpeername, getsockname, + ipc, recvfrom, recvmsg, recvmmsg, sendto, sendmmsg, and socketcall syscalls. + * Updated lists of AF_*, BPF_MAP_TYPE_*, KEY_*, KEYCTL_*, RWF_*, SS_*, + and *_MAGIC constants. + * Updated lists of ioctl commands from Linux 4.7. + +* Bug fixes + * Fixed decoding of pid_t argument of prlimit64 syscall. + * Fixed sign extension issues in the parser of struct rusage. + * Fixed race condition in decoding of timeout argument of recvmmsg and + rt_sigtimedwait syscalls. + * Fixed build with fresh linux kernel headers. + +Noteworthy changes in release 4.12 (2016-05-31) +=============================================== + +* Improvements + * Implemented simultaneous use of -p option and tracing of a command. + (addresses Debian bug #549942). + * Implemented caching of netlink conversations to reduce amount of time + spent in decoding socket details in -yy mode. + * Implemented -yy mode decoding of protocol:portid pairs associated with + netlink socket descriptors. + * Implemented decoding of copy_file_range, preadv2, and pwritev2 syscalls. + * Implemented dumping of preadv, preadv2, pwritev, pwritev2, and vmsplice + syscalls. + * Implemented decoding of BTRFS_* and UFFDIO_* ioctl commands. + * Enhanced decoding of BLK*, EVIOC*, RTC_*, and VIDIOC_* ioctl commands. + * Enhanced decoding of fstatfs, fstatfs64, get_mempolicy, getdents, + getdents64, getgroups, getpriority, kill, mbind, migrate_pages, mknod, + mknodat, personality, poll, ppoll, quotactl, rt_sigpending, + rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo, sched_getaffinity, + sched_setaffinity, seccomp, set_mempolicy, setgroups, setpriority, statfs, + statfs64, tgkill, waitid, and xattr family syscalls. + * Enhanced decoding of getxpid, getxuid, and getxgid syscalls on alpha. + * Enhanced decoding of pipe syscall on alpha, ia64, mips, sh, and sparc. + * Added decoding of bind, listen, and setsockopt direct syscalls on sparc. + * Added decoding of osf_statfs64 and osf_fstatfs64 syscalls on alpha. + * Added decoding of fadvise64 and fadvise64_64 on s390. + * Updated lists of AF_*, BPF_MAP_TYPE_*, CLONE_*, EPOLL*, IPV6_*, MADV_*, + MSG_*, PTRACE_*, SEGV_*, SO_*, SOL_*, *_MAGIC, and quotactl constants. + * Updated lists of ioctl commands from Linux 4.6. + +* Bug fixes + * Fixed build on arc, metag, nios2, or1k, and tile architectures. + * Fixed decoding of 32-bit times syscall return value on 64-bit architectures. + * Fixed decoding of mlock2 syscall on sparc. + * Fixed decoding of osf_shmat syscall on alpha. + * Fixed decoding of syscalls unknown to the kernel on s390/s390x. + (addresses Debian bug #485979 and Fedora bug #1298294). + * Fixed decoding of preadv syscall in case of short read. + * Fixed decoding and dumping of readv syscall in case of short read. + * Fixed dumping of recvmsg and recvmmsg syscalls in case of short read. + * Fixed decoding of mincore syscall's last argument. + * Fixed remaining errors in mapping between syscall numbers and numbers + of syscall arguments. + * Applied various fixes to strace-graph script. + +Noteworthy changes in release 4.11 (2015-12-21) +=============================================== + +* Changes in behavior + * Some syscalls have different names depending on architecture and + personality. In these cases, syscall filtering and printing now + consistently uses the names that match corresponding __NR_* kernel + macros of the tracee's architecture and personality. + * Added strace prefix to all diagnostic messages. + +* Improvements + * Enhanced and extended test suite. + * Implemented reliable tracing of processes whose personality differs + from the personality of strace, fixed decoding of 32-bit personality + syscalls on 64-bit architectures. + * When some data referenced by syscall arguments is irrelevant or cannot + be read from tracee's memory, strace now prints its address consistently. + * When a syscall is restarted using restart_syscall mechanism, strace now + shows the syscall name on architectures that expose this information. + * Print values returned by epoll_create1, eventfd, eventfd2, fanotify_init, + inotify_init1, perf_event_open, pipe, pipe2, signalfd, signalfd4, socket, + socketpair, timerfd, and timerfd_create syscalls, as well as F_DUPFD and + F_DUPFD_CLOEXEC fcntl commands, as file descriptors. + * Optimized decoding of indirect socket syscalls. + * Implemented decoding of nanoseconds along with seconds in stat family + syscalls (addresses Fedora bug #1251176). + * Implemented decoding of struct statfs.f_flags in statfs syscall. + * Implemented decoding of siginfo_t.si_syscall and siginfo_t.si_arch + in SIGSYS signal. + * Implemented decoding of indirect syscall on mips o32. + * Implemented decoding of IPPROTO_IP control messages. + * Implemented decoding of setsockopt syscall multicast arguments. + * Enhanced decoding of struct sigevent. + * Enhanced decoding of block, loop, mtd, ptp, rtc, SG_IO, socket, tty, + and v4l2 ioctl syscall arguments. + * Enhanced decoding of epoll_create, fcntl, fcntl64, futex, getdents, + getdents64, getsockopt, io_*, mount, msgctl, prctl, quotactl, recvfrom, + sendfile, setsockopt, and shmctl syscalls. + * Implemented decoding of bpf, execveat, ioperm, iopl, kcmp, kexec_file_load, + lookup_dcookie, membarrier, memfd_create, mlock2, name_to_handle_at, + open_by_handle_at, sched_getattr, sched_setattr, and userfaultfd syscalls. + * Updated lists of AF_*, EPOLL_*, FALLOC_FL_*, F_*, INPUT_PROP_*, IPPROTO_*, + IPV6_*, IP_*, KEY_*, LOCK_*, MNT_*, MS_*, PACKET_*, PERF_FLAG_*, PF_*, + PR_*, PTRACE_O_*, RENAME_*, SCTP_*, SECBIT_*, SO_*, TCP_*, and siginfo_t + constants. + * Added Nios II architecture support. + * Added new syscall entries to match Linux 4.4. + +* Bug fixes + * Fixed potential short read of strings from tracee's memory. + * Fixed -qq option in conjunction with -o option. + * Fixed filtering of syscalls. + * Fixed decoding of ioctl syscall command on aarch64 and 32-bit architectures + with 64-bit aligned structures. + * Fixed decoding of eventfd2, epoll_create1, signalfd4, and sync_file_range2 + syscall flags arguments. + * Fixed decoding of 4th argument of clock_nanosleep syscall. + * Fixed decoding of getpagesize syscall on m68k. + * Fixed decoding of getrandom and seccomp syscalls on aarch64. + * Fixed decoding of timezone argument of gettimeofday and settimeofday + * syscalls. + * Fixed decoding of offset argument of mmap2 syscall on arm, sparc, + and sparc64. + * Fixed decoding of pipe syscall on alpha and mips. + * Fixed decoding of pipe2 syscall on ia64, sh, sparc, and sparc64. + * Fixed decoding of signal mask argument of pselect6 syscall on x32. + * Fixed decoding of signal mask of rt_sigreturn syscall on aarch64, m68k, + and x32. + * Fixed decoding of 4th argument of semctl indirect syscall. + * Fixed decoding of sa_restorer and sa_mask of sigaction syscall on m68k. + * Fixed decoding of statfs64 and fstatfs64 syscalls on arm eabi. + * Fixed decoding of struct dirent on x32. + * Fixed decoding of times syscall return value on mips n32 and x32. + * Fixed decoding of path argument of umount2 syscall + (addresses Debian bug #785050). + * Worked around a kernel bug in tracing privileged executables. + * Fixed various errors in mapping between syscall numbers and associated + information like the number of syscall arguments, the name of syscall, + and syscall decoder. + +Noteworthy changes in release 4.10 (2015-03-06) +=============================================== + +* Improvements + * Added -yy option to print protocol and address information associated with + socket descriptors. + * Extended "-e read=set" and "-e write=set" options to cover sendmsg, + recvmsg, sendmmsg, and recvmmsg syscalls. + * Implemented full 32-bit decoding of ioctl commands + (addresses Debian bug #692913 and Fedora bug #902788). + * Implemented PTRACE_GETREGS API support on ia64. + * Implemented PTRACE_GETREGS API support on mips. + * Implemented PTRACE_GETREGSET API support on s390/s390x. + * Implemented decoding of getrandom and seccomp syscalls. + * Implemented full decoding of 64-bit capability sets. + * Implemented decoding of all prctl commands. + * Implemented decoding of parametrized ioctl commands. + * Implemented decoding of evdev ioctl commands. + * Implemented decoding of v4l ioctl commands. + * Implemented decoding of SG_IO v4 ioctl commands. + * Implemented decoding of FIFREEZE/FITHAW/FITRIM ioctl commands. + * Implemented decoding of FALLOC_FL_* fallocate flags. + * Implemented decoding of rt_sigreturn signal mask on aarch64, + x32, and x86_64. + * Enhanced socket decoder to support bluetooth sockets. + * Enhanced decoding of unlisted ioctl commands. + * Enhanced decoding of getsockopt and setsockopt syscall. + * Enhanced decoding of sysinfo syscall. + * Enhanced decoding of struct cmsghdr. + * Enhanced decoding of wait status. + * Enhanced aio support on non-x86 architectures by using external libaio.h. + * Added O_TMPFILE to the list of recognized open mode flags. + * Updated the list of filesystem type constants that is used in decoding + statfs family syscalls. + * Updated lists of CAP_*, PR_*, PTRACE_*, SCHED_*, SO_*, SOL_*, SWAP_FLAG_*, + and TFD_* constants. + * Updated lists of signal constants from Linux 3.19. + * Updated lists of errno constants from Linux 3.19. + * Updated lists of ioctl commands from Linux 3.9. + * Added new syscall entries to match Linux 3.19. + +* Bug fixes + * Fixed various errors in mapping between syscall numbers and associated + information like the number of syscall arguments, the name of syscall, + and syscall decoder. + * Fixed quoting issues in printing descriptors, filenames, network interface + names, struct utsname members, device/volume names of BLK* ioctl commands. + * Fixed uid_t/git_t decoding. + * Fixed potential out-of-bounds read issues in getdents/getdents64 decoders. + * Fixed potential open flags truncation on some architectures. + * Fixed decoding of struct ifreq.ifr_name. + * Fixed decoding of SIOCSIFNAME ioctl command. + * Fixed decoding of RENAME_* renameat2 flags. + * Fixed decoding of UTIME_NOW/UTIME_OMIT timeval structures. + * Fixed decoding of indirect ipc subcalls on some architectures. + * Fixed decoding of fanotify_mark syscall on 32-bit architectures. + * Fixed decoding of 32-bit stat structures on 64-bit architectures. + * Fixed decoding of 32-bit struct cmsghdr on 64-bit architectures. + * Fixed decoding of 32-bit preadv/pwritev offset on 64-bit architectures. + * Fixed decoding of sigreturn/rt_sigreturn signal mask on ia64, ppc, ppc64, + sparc, sparc64, mips, and s390. + * Fixed instruction pointer output (-i option) on architectures that support + several personalities. + * Fixed behaviour of "-e read=set" and "-e write=set" when read and write + sets intersect. + * Fixed build on systems where struct sigaction has no sa_restorer member. + * Fixed build with uclibc and musl libc. + +* Portability + * Linux kernel >= 2.5.46 is required. + Older versions without a decent PTRACE_SETOPTIONS support will not work. + * On mips, linux kernel >= 2.6.15 is required. + Older versions without a decent PTRACE_GETREGS support will not work. + * On s390 and s390x, linux kernel >= 2.6.27 is required. + Older versions without a decent PTRACE_GETREGSET support will not work. + Noteworthy changes in release 4.9 (2014-08-15) ============================================== diff --git a/README b/README index 4ef0834a..ae808005 100644 --- a/README +++ b/README @@ -1,17 +1,24 @@ This is strace, a system call tracer for Linux. strace is released under a Berkeley-style license at the request -of Paul Kranenburg; see the file COPYING for details. +of Paul Kranenburg. See the file CREDITS for a list of authors and other contributors. - See the file INSTALL for compilation and installation instructions. +See the file NEWS for information on what has changed in recent versions. -See the file NEWS for information on what has changed in recent -versions. +The project's homepage is at + https://sourceforge.net/projects/strace/ -You can get the latest version of strace from its homepage at -http://sourceforge.net/projects/strace/ . +strace has a mailing list: + strace-devel@lists.sourceforge.net. -Please send bug reports and enhancements to the strace -mailinglist at strace-devel@lists.sourceforge.net. +System requirements: + * Linux kernel >= 2.6.18 is recommended. Older versions might still work + but they haven't been thoroughly tested with this release. + * Linux kernel >= 2.5.46 is required. + Older versions without a decent PTRACE_SETOPTIONS support will not work. + * On mips, linux kernel >= 2.6.15 is required. + Older versions without a decent PTRACE_GETREGS support will not work. + * On s390 and s390x, linux kernel >= 2.6.27 is required. + Older versions without a decent PTRACE_GETREGSET support will not work. diff --git a/README-linux b/README-linux deleted file mode 100644 index 62df2585..00000000 --- a/README-linux +++ /dev/null @@ -1,31 +0,0 @@ - -Strace has been ported by Branko Lankester -to run on Linux systems. Since then it has been greatly modified -by various other people. - -If you want to compile strace on a Linux system please make sure that -you use recent kernel headers. Strace needs those to get the proper data -structures and constatns used by the kernel, since these can be -different from the structures that the C library uses. Currently you -will need at least a 2.2.7 or newer kernel. - -To complicate things a bit further strace might not compile if you are -using development kernels. These tend to have headers that conflict with -the headers from libc which makes it impossible to use them. - -There are three ways to compile strace with other kernel headers: -* Specify the location in CFLAGS when running configure - - CFLAGS=-I/usr/src/linux/include ./configure - -* you can tell make where your kernel sources are. For example if you - have your kernelsource in /usr/src/linux, you can invoke make like - this: - - make CFLAGS="\$CFLAGS -I/usr/src/linux/include" - - (the extra \$CFLAGS is there to make sure we don't override any CFLAGS - settings that configure has found). - -* you can link /usr/include/linux and /usr/include/asm to the - corresponding directories in your kernel source-tree. diff --git a/access.c b/access.c new file mode 100644 index 00000000..a9663dc1 --- /dev/null +++ b/access.c @@ -0,0 +1,26 @@ +#include "defs.h" + +#include + +#include "xlat/access_flags.h" + +static int +decode_access(struct tcb *tcp, int offset) +{ + printpath(tcp, tcp->u_arg[offset]); + tprints(", "); + printflags(access_flags, tcp->u_arg[offset + 1], "?_OK"); + + return RVAL_DECODED; +} + +SYS_FUNC(access) +{ + return decode_access(tcp, 0); +} + +SYS_FUNC(faccessat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + return decode_access(tcp, 1); +} diff --git a/aclocal.m4 b/aclocal.m4 index 7f5f826b..cca8cf2a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -407,6 +407,23 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) +# AM_EXTRA_RECURSIVE_TARGETS -*- Autoconf -*- + +# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_EXTRA_RECURSIVE_TARGETS +# -------------------------- +# Define the list of user recursive targets. This macro exists only to +# be traced by Automake, which will ensure that a proper definition of +# user-defined recursive targets (and associated rules) is propagated +# into all the generated Makefiles. +# TODO: We should really reject non-literal arguments here... +AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], []) + # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -1183,8 +1200,10 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/includedir.m4]) -m4_include([m4/long_long.m4]) -m4_include([m4/stat.m4]) -m4_include([m4/statfs.m4]) +m4_include([m4/ax_code_coverage.m4]) +m4_include([m4/ax_prog_cc_for_build.m4]) +m4_include([m4/ax_valgrind_check.m4]) +m4_include([m4/mpers.m4]) +m4_include([m4/st_save_restore_var.m4]) +m4_include([m4/st_warn_cflags.m4]) m4_include([m4/warnings.m4]) diff --git a/affinity.c b/affinity.c new file mode 100644 index 00000000..0eb10940 --- /dev/null +++ b/affinity.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2002-2004 Roland McGrath + * Copyright (c) 2009-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +static unsigned int +get_cpuset_size(void) +{ + static unsigned int cpuset_size; + + if (!cpuset_size) { + /* + * If the cpuset size passed to sched_getaffinity is less + * than necessary to store the bitmask, the kernel does not + * look at the mask pointer and fails with EINVAL. + * + * If the cpuset size is large enough, the kernel fails with + * EFAULT on inaccessible mask pointers. + * + * This undocumented kernel feature can be used to probe + * the kernel and find out the minimal valid cpuset size + * without allocating any memory for the CPU affinity mask. + */ + cpuset_size = 128; + while (cpuset_size && + sched_getaffinity(0, cpuset_size, NULL) == -1 && + EINVAL == errno) { + cpuset_size <<= 1; + } + if (!cpuset_size) + cpuset_size = 128; + } + + return cpuset_size; +} + +static void +print_affinitylist(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int len) +{ + const unsigned int max_size = get_cpuset_size(); + const unsigned int umove_size = len < max_size ? len : max_size; + const unsigned int size = + (umove_size + current_wordsize - 1) & -current_wordsize; + const unsigned int ncpu = size * 8; + void *cpu; + + if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || + !addr || !len || !(cpu = calloc(size, 1))) { + printaddr(addr); + return; + } + + if (!umoven_or_printaddr(tcp, addr, umove_size, cpu)) { + int i = 0; + const char *sep = ""; + + tprints("["); + for (;; i++) { + i = next_set_bit(cpu, i, ncpu); + if (i < 0) + break; + tprintf("%s%d", sep, i); + sep = ", "; + } + if (size < len) + tprintf("%s...", sep); + tprints("]"); + } + + free(cpu); +} + +SYS_FUNC(sched_setaffinity) +{ + const int pid = tcp->u_arg[0]; + const unsigned int len = tcp->u_arg[1]; + + tprintf("%d, %u, ", pid, len); + print_affinitylist(tcp, tcp->u_arg[2], len); + + return RVAL_DECODED; +} + +SYS_FUNC(sched_getaffinity) +{ + const int pid = tcp->u_arg[0]; + const unsigned int len = tcp->u_arg[1]; + + if (entering(tcp)) { + tprintf("%d, %u, ", pid, len); + } else { + print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval); + } + return 0; +} diff --git a/aio.c b/aio.c index 6bf8f828..e246b353 100644 --- a/aio.c +++ b/aio.c @@ -29,160 +29,26 @@ */ #include "defs.h" +#include -/* --- Copied from libaio-0.3.109/src/libaio.h --- - * Why keep a copy instead of using external libaio.h? - * Because we want to properly decode 32-bit aio calls - * by 64-bit strace. For that, we need more definitions than - * libaio.h provides. (TODO). - * Keeping our local 32-bit compat defs in sync with libaio.h - * _without seeing libaio structs_ is hard/more bug-prone. - * A smaller benefit is that we don't need libaio installed. - */ -#define HAVE_LIBAIO_H 1 -typedef enum io_iocb_cmd { - IO_CMD_PREAD = 0, - IO_CMD_PWRITE = 1, - - IO_CMD_FSYNC = 2, - IO_CMD_FDSYNC = 3, - - IO_CMD_POLL = 5, /* Never implemented in mainline, see io_prep_poll */ - IO_CMD_NOOP = 6, - IO_CMD_PREADV = 7, - IO_CMD_PWRITEV = 8, -} io_iocb_cmd_t; - -#if defined(__i386__) /* little endian, 32 bits */ -#define PADDED(x, y) x; unsigned y -#define PADDEDptr(x, y) x; unsigned y -#define PADDEDul(x, y) unsigned long x; unsigned y -#elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) -#define PADDED(x, y) x, y -#define PADDEDptr(x, y) x -#define PADDEDul(x, y) unsigned long x -#elif defined(__powerpc64__) /* big endian, 64 bits */ -#define PADDED(x, y) unsigned y; x -#define PADDEDptr(x,y) x -#define PADDEDul(x, y) unsigned long x -#elif defined(__PPC__) /* big endian, 32 bits */ -#define PADDED(x, y) unsigned y; x -#define PADDEDptr(x, y) unsigned y; x -#define PADDEDul(x, y) unsigned y; unsigned long x -#elif defined(__s390x__) /* big endian, 64 bits */ -#define PADDED(x, y) unsigned y; x -#define PADDEDptr(x,y) x -#define PADDEDul(x, y) unsigned long x -#elif defined(__s390__) /* big endian, 32 bits */ -#define PADDED(x, y) unsigned y; x -#define PADDEDptr(x, y) unsigned y; x -#define PADDEDul(x, y) unsigned y; unsigned long x -#elif defined(__arm__) -# if defined (__ARMEB__) /* big endian, 32 bits */ -#define PADDED(x, y) unsigned y; x -#define PADDEDptr(x, y) unsigned y; x -#define PADDEDul(x, y) unsigned y; unsigned long x -# else /* little endian, 32 bits */ -#define PADDED(x, y) x; unsigned y -#define PADDEDptr(x, y) x; unsigned y -#define PADDEDul(x, y) unsigned long x; unsigned y -# endif -#else -# warning No AIO definitions for this architecture => no io_submit decoding -# undef HAVE_LIBAIO_H -#endif - -#ifdef HAVE_LIBAIO_H -struct io_iocb_poll { - PADDED(int events, __pad1); -}; /* result code is the set of result flags or -'ve errno */ - -struct io_iocb_sockaddr { - struct sockaddr *addr; - int len; -}; /* result code is the length of the sockaddr, or -'ve errno */ - -struct io_iocb_common { - PADDEDptr(void *buf, __pad1); - PADDEDul(nbytes, __pad2); - long long offset; - long long __pad3; - unsigned flags; - unsigned resfd; -}; /* result code is the amount read or -'ve errno */ - -struct io_iocb_vector { - const struct iovec *vec; - int nr; - long long offset; -}; /* result code is the amount read or -'ve errno */ - -struct iocb { - PADDEDptr(void *data, __pad1); /* Return in the io completion event */ - PADDED(unsigned key, __pad2); /* For use in identifying io requests */ - - short aio_lio_opcode; - short aio_reqprio; - int aio_fildes; - - union { - struct io_iocb_common c; - struct io_iocb_vector v; - struct io_iocb_poll poll; - struct io_iocb_sockaddr saddr; - } u; -}; - -struct io_event { - PADDEDptr(void *data, __pad1); - PADDEDptr(struct iocb *obj, __pad2); - PADDEDul(res, __pad3); - PADDEDul(res2, __pad4); -}; - -#undef PADDED -#undef PADDEDptr -#undef PADDEDul - -#endif /* HAVE_LIBAIO_H */ - -/* --- End of a chunk of libaio.h --- */ -/* Not defined in libaio.h */ -#ifndef IOCB_RESFD -# define IOCB_RESFD (1 << 0) -#endif - -int -sys_io_setup(struct tcb *tcp) +SYS_FUNC(io_setup) { if (entering(tcp)) - tprintf("%ld, ", tcp->u_arg[0]); - else { - if (syserror(tcp)) - tprintf("0x%0lx", tcp->u_arg[1]); - else { - unsigned long user_id; - if (umove(tcp, tcp->u_arg[1], &user_id) == 0) - tprintf("{%lu}", user_id); - else - tprints("{...}"); - } - } + tprintf("%u, ", (unsigned int) tcp->u_arg[0]); + else + printnum_ptr(tcp, tcp->u_arg[1]); return 0; } -int -sys_io_destroy(struct tcb *tcp) +SYS_FUNC(io_destroy) { - if (entering(tcp)) - tprintf("%lu", tcp->u_arg[0]); - return 0; -} + printaddr(tcp->u_arg[0]); -#ifdef HAVE_LIBAIO_H + return RVAL_DECODED; +} enum iocb_sub { - SUB_NONE, SUB_COMMON, SUB_POLL, SUB_VECTOR + SUB_NONE, SUB_COMMON, SUB_VECTOR }; static enum iocb_sub @@ -196,8 +62,8 @@ tprint_lio_opcode(unsigned cmd) { "pwrite", SUB_COMMON }, { "fsync", SUB_NONE }, { "fdsync", SUB_NONE }, - { "op4", SUB_NONE }, - { "poll", SUB_POLL }, + { "preadx", SUB_NONE }, + { "poll", SUB_NONE }, { "noop", SUB_NONE }, { "preadv", SUB_VECTOR }, { "pwritev", SUB_VECTOR }, @@ -212,165 +78,181 @@ tprint_lio_opcode(unsigned cmd) } static void -print_common_flags(struct iocb *iocb) +print_common_flags(struct tcb *tcp, const struct iocb *cb) { - if (iocb->u.c.flags & IOCB_RESFD) - tprintf(", resfd=%d", iocb->u.c.resfd); - if (iocb->u.c.flags & ~IOCB_RESFD) - tprintf(", flags=%x", iocb->u.c.flags); +/* IOCB_FLAG_RESFD is available since v2.6.22-rc1~47 */ +#ifdef IOCB_FLAG_RESFD + if (cb->aio_flags & IOCB_FLAG_RESFD) { + tprints(", resfd="); + printfd(tcp, cb->aio_resfd); + } + if (cb->aio_flags & ~IOCB_FLAG_RESFD) + tprintf(", flags=%#x", cb->aio_flags); +#endif } -#endif /* HAVE_LIBAIO_H */ +static bool +iocb_is_valid(const struct iocb *cb) +{ + return cb->aio_buf == (unsigned long) cb->aio_buf && + cb->aio_nbytes == (size_t) cb->aio_nbytes && + (ssize_t) cb->aio_nbytes >= 0; +} -int -sys_io_submit(struct tcb *tcp) +static enum iocb_sub +print_iocb_header(struct tcb *tcp, const struct iocb *cb) { - if (entering(tcp)) { -#ifdef HAVE_LIBAIO_H - long nr = tcp->u_arg[1]; - /* if nr <= 0, we end up printing just "{}" */ - tprintf("%lu, %ld, {", tcp->u_arg[0], tcp->u_arg[1]); - { - long i; - struct iocb **iocbs = (void *)tcp->u_arg[2]; -//FIXME: decoding of 32-bit call by 64-bit strace - - for (i = 0; i < nr; i++, iocbs++) { - enum iocb_sub sub; - struct iocb *iocbp; - struct iocb iocb; - if (i) - tprints(", "); - - if (umove(tcp, (unsigned long)iocbs, &iocbp)) { - tprintf("%#lx", (unsigned long)iocbs); - /* No point in trying to read iocbs+1 etc */ - /* (nr can be ridiculously large): */ - break; - } - if (umove(tcp, (unsigned long)iocbp, &iocb)) { - tprintf("{%#lx}", (unsigned long)iocbp); - continue; - } - tprints("{"); - if (iocb.data) - tprintf("data:%p, ", iocb.data); - if (iocb.key) - tprintf("key:%u, ", iocb.key); - sub = tprint_lio_opcode(iocb.aio_lio_opcode); - if (iocb.aio_reqprio) - tprintf(", reqprio:%d", iocb.aio_reqprio); - tprintf(", filedes:%d", iocb.aio_fildes); - switch (sub) { - case SUB_COMMON: - if (iocb.aio_lio_opcode == IO_CMD_PWRITE) { - tprints(", str:"); - printstr(tcp, (unsigned long)iocb.u.c.buf, - iocb.u.c.nbytes); - } else - tprintf(", buf:%p", iocb.u.c.buf); - tprintf(", nbytes:%lu, offset:%lld", - iocb.u.c.nbytes, - iocb.u.c.offset); - print_common_flags(&iocb); - break; - case SUB_VECTOR: - tprintf(", %lld", iocb.u.v.offset); - print_common_flags(&iocb); - tprints(", "); - tprint_iov(tcp, iocb.u.v.nr, - (unsigned long)iocb.u.v.vec, - iocb.aio_lio_opcode == IO_CMD_PWRITEV - ); - break; - case SUB_POLL: - tprintf(", %x", iocb.u.poll.events); - break; - case SUB_NONE: - break; - } - tprints("}"); - } + enum iocb_sub sub; + + if (cb->aio_data) + tprintf("data=%#" PRIx64 ", ", + (uint64_t) cb->aio_data); + + if (cb->aio_key) + tprintf("key=%u, ", cb->aio_key); + + sub = tprint_lio_opcode(cb->aio_lio_opcode); + if (cb->aio_reqprio) + tprintf(", reqprio=%hd", cb->aio_reqprio); + + tprints(", fildes="); + printfd(tcp, cb->aio_fildes); + + return sub; +} + +static void +print_iocb(struct tcb *tcp, const struct iocb *cb) +{ + enum iocb_sub sub = print_iocb_header(tcp, cb); + + switch (sub) { + case SUB_COMMON: + if (cb->aio_lio_opcode == 1 && iocb_is_valid(cb)) { + tprints(", str="); + printstrn(tcp, cb->aio_buf, cb->aio_nbytes); + } else { + tprintf(", buf=%#" PRIx64, (uint64_t) cb->aio_buf); } - tprints("}"); -#else - tprintf("%lu, %ld, %#lx", tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]); -#endif + tprintf(", nbytes=%" PRIu64 ", offset=%" PRId64, + (uint64_t) cb->aio_nbytes, (int64_t) cb->aio_offset); + print_common_flags(tcp, cb); + break; + case SUB_VECTOR: + if (iocb_is_valid(cb)) { + tprints(", iovec="); + tprint_iov(tcp, cb->aio_nbytes, cb->aio_buf, + cb->aio_lio_opcode == 8 + ? IOV_DECODE_STR + : IOV_DECODE_ADDR); + } else { + tprintf(", buf=%#" PRIx64 ", nbytes=%" PRIu64, + (uint64_t) cb->aio_buf, + (uint64_t) cb->aio_nbytes); + } + tprintf(", offset=%" PRId64, (int64_t) cb->aio_offset); + print_common_flags(tcp, cb); + break; + case SUB_NONE: + break; } - return 0; } -int -sys_io_cancel(struct tcb *tcp) +static bool +print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - if (entering(tcp)) { -#ifdef HAVE_LIBAIO_H - struct iocb iocb; -#endif - tprintf("%lu, ", tcp->u_arg[0]); -#ifdef HAVE_LIBAIO_H - if (umove(tcp, tcp->u_arg[1], &iocb) == 0) { - tprintf("{%p, %u, %u, %u, %d}, ", - iocb.data, iocb.key, - (unsigned)iocb.aio_lio_opcode, - (unsigned)iocb.aio_reqprio, iocb.aio_fildes); - } else -#endif - tprints("{...}, "); + kernel_ulong_t addr; + struct iocb cb; + + if (elem_size < sizeof(kernel_ulong_t)) { + addr = * (unsigned int *) elem_buf; } else { - if (tcp->u_rval < 0) - tprints("{...}"); - else { -#ifdef HAVE_LIBAIO_H - struct io_event event; - if (umove(tcp, tcp->u_arg[2], &event) == 0) - tprintf("{%p, %p, %ld, %ld}", - event.data, event.obj, - event.res, event.res2); - else -#endif - tprints("{...}"); + addr = * (kernel_ulong_t *) elem_buf; + } + + tprints("{"); + if (!umove_or_printaddr(tcp, addr, &cb)) + print_iocb(tcp, &cb); + tprints("}"); + + return true; +} + +SYS_FUNC(io_submit) +{ + const kernel_long_t nr = + truncate_klong_to_current_wordsize(tcp->u_arg[1]); + const kernel_ulong_t addr = tcp->u_arg[2]; + kernel_ulong_t iocbp; + + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_kld ", ", nr); + + if (nr < 0) + printaddr(addr); + else + print_array(tcp, addr, nr, &iocbp, current_wordsize, + umoven_or_printaddr, print_iocbp, 0); + + return RVAL_DECODED; +} + +static bool +print_io_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + struct io_event *event = elem_buf; + + tprintf("{data=%#" PRIx64 ", obj=%#" PRIx64 + ", res=%" PRId64 ", res2=%" PRId64 "}", + (uint64_t) event->data, (uint64_t) event->obj, + (int64_t) event->res, (int64_t) event->res2); + + return true; +} + +SYS_FUNC(io_cancel) +{ + if (entering(tcp)) { + printaddr(tcp->u_arg[0]); + tprints(", "); + + struct iocb cb; + + if (!umove_or_printaddr(tcp, tcp->u_arg[1], &cb)) { + tprints("{"); + print_iocb_header(tcp, &cb); + tprints("}"); } + tprints(", "); + } else { + struct io_event event; + + if (!umove_or_printaddr(tcp, tcp->u_arg[2], &event)) + print_io_event(tcp, &event, sizeof(event), 0); } return 0; } -int -sys_io_getevents(struct tcb *tcp) +SYS_FUNC(io_getevents) { if (entering(tcp)) { - tprintf("%ld, %ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1], - tcp->u_arg[2]); + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_kld ", %" PRI_kld ", ", + truncate_klong_to_current_wordsize(tcp->u_arg[1]), + truncate_klong_to_current_wordsize(tcp->u_arg[2])); } else { - if (tcp->u_rval == 0) { - tprints("{}"); - } else { -#ifdef HAVE_LIBAIO_H - struct io_event *events = (void *)tcp->u_arg[3]; - long i, nr = tcp->u_rval; - - for (i = 0; i < nr; i++, events++) { - struct io_event event; - - if (i == 0) - tprints("{"); - else - tprints(", "); - - if (umove(tcp, (unsigned long)events, &event) != 0) { - tprints("{...}"); - continue; - } - tprintf("{%p, %p, %ld, %ld}", event.data, - event.obj, event.res, event.res2); - } - tprints("}, "); -#else - tprints("{...}"); -#endif - } - + struct io_event buf; + print_array(tcp, tcp->u_arg[3], tcp->u_rval, &buf, sizeof(buf), + umoven_or_printaddr, print_io_event, 0); + tprints(", "); + /* + * Since the timeout parameter is read by the kernel + * on entering syscall, it has to be decoded the same way + * whether the syscall has failed or not. + */ + temporarily_clear_syserror(tcp); print_timespec(tcp, tcp->u_arg[4]); + restore_cleared_syserror(tcp); } return 0; } diff --git a/alpha.c b/alpha.c new file mode 100644 index 00000000..70d4ca5a --- /dev/null +++ b/alpha.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef ALPHA + +static int +decode_getxxid(struct tcb *tcp, const char *what) +{ + if (entering(tcp)) + return 0; + + long rval = getrval2(tcp); + if (rval == -1) + return 0; + static const char const fmt[] = "%s %ld"; + static char outstr[sizeof(fmt) + 3 * sizeof(rval)]; + snprintf(outstr, sizeof(outstr), fmt, what, rval); + tcp->auxstr = outstr; + return RVAL_STR; +} + +SYS_FUNC(getxpid) +{ + return decode_getxxid(tcp, "ppid"); +} + +SYS_FUNC(getxuid) +{ + return decode_getxxid(tcp, "euid"); +} + +SYS_FUNC(getxgid) +{ + return decode_getxxid(tcp, "egid"); +} + +SYS_FUNC(osf_statfs) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + printaddr(tcp->u_arg[1]); + tprints(", "); + tprintf("%lu", tcp->u_arg[2]); + return RVAL_DECODED; +} + +SYS_FUNC(osf_fstatfs) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printaddr(tcp->u_arg[1]); + tprints(", "); + tprintf("%lu", tcp->u_arg[2]); + return RVAL_DECODED; +} + +#endif /* ALPHA */ diff --git a/bjm.c b/bjm.c index b34c6ed7..926add3c 100644 --- a/bjm.c +++ b/bjm.c @@ -30,190 +30,39 @@ #include "defs.h" #include -#include -#include -#include -#include -#include -/* Bits of module.flags. */ - -#define MOD_UNINITIALIZED 0 -#define MOD_RUNNING 1 -#define MOD_DELETED 2 -#define MOD_AUTOCLEAN 4 -#define MOD_VISITED 8 -#define MOD_USED_ONCE 16 -#define MOD_JUST_FREED 32 -#define MOD_INITIALIZING 64 - -/* Values for query_module's which. */ - -#define QM_MODULES 1 -#define QM_DEPS 2 -#define QM_REFS 3 -#define QM_SYMBOLS 4 -#define QM_INFO 5 - -struct module_symbol -{ - unsigned long value; - const char *name; -}; - -struct module_info -{ - unsigned long addr; - unsigned long size; - unsigned long flags; - long usecount; -}; - -#include "xlat/qm_which.h" -#include "xlat/modflags.h" #include "xlat/delete_module_flags.h" -int -sys_query_module(struct tcb *tcp) +SYS_FUNC(delete_module) { - if (entering(tcp)) { - printstr(tcp, tcp->u_arg[0], -1); - tprints(", "); - printxval(qm_which, tcp->u_arg[1], "QM_???"); - tprints(", "); - } else { - size_t ret; - - if (!verbose(tcp) || syserror(tcp) || - umove(tcp, tcp->u_arg[4], &ret) < 0) { - tprintf("%#lx, %lu, %#lx", tcp->u_arg[2], - tcp->u_arg[3], tcp->u_arg[4]); - } else if (tcp->u_arg[1]==QM_INFO) { - struct module_info mi; - if (umove(tcp, tcp->u_arg[2], &mi) < 0) { - tprintf("%#lx, ", tcp->u_arg[2]); - } else { - tprintf("{address=%#lx, size=%lu, flags=", - mi.addr, mi.size); - printflags(modflags, mi.flags, "MOD_???"); - tprintf(", usecount=%lu}, ", mi.usecount); - } - tprintf("%lu", (unsigned long)ret); - } else if ((tcp->u_arg[1]==QM_MODULES) || - (tcp->u_arg[1]==QM_DEPS) || - (tcp->u_arg[1]==QM_REFS)) { - tprints("{"); - if (!abbrev(tcp)) { - char* data = malloc(tcp->u_arg[3]); - char* mod = data; - size_t idx; - - if (!data) { - fprintf(stderr, "out of memory\n"); - tprintf(" /* %lu entries */ ", (unsigned long)ret); - } else { - if (umoven(tcp, tcp->u_arg[2], - tcp->u_arg[3], data) < 0) { - tprintf(" /* %lu entries */ ", (unsigned long)ret); - } else { - for (idx = 0; idx < ret; idx++) { - tprintf("%s%s", - (idx ? ", " : ""), - mod); - mod += strlen(mod)+1; - } - } - free(data); - } - } else - tprintf(" /* %lu entries */ ", (unsigned long)ret); - tprintf("}, %lu", (unsigned long)ret); - } else if (tcp->u_arg[1]==QM_SYMBOLS) { - tprints("{"); - if (!abbrev(tcp)) { - char* data = malloc(tcp->u_arg[3]); - struct module_symbol* sym = (struct module_symbol*)data; - size_t idx; + printstr(tcp, tcp->u_arg[0]); + tprints(", "); + printflags(delete_module_flags, tcp->u_arg[1], "O_???"); - if (!data) { - fprintf(stderr, "out of memory\n"); - tprintf(" /* %lu entries */ ", (unsigned long)ret); - } else { - if (umoven(tcp, tcp->u_arg[2], - tcp->u_arg[3], data) < 0) { - tprintf(" /* %lu entries */ ", (unsigned long)ret); - } else { - for (idx = 0; idx < ret; idx++) { - tprintf("%s{name=%s, value=%lu}", - (idx ? " " : ""), - data+(long)sym->name, - sym->value); - sym++; - } - } - free(data); - } - } else - tprintf(" /* %lu entries */ ", (unsigned long)ret); - tprintf("}, %ld", (unsigned long)ret); - } else { - printstr(tcp, tcp->u_arg[2], tcp->u_arg[3]); - tprintf(", %#lx", tcp->u_arg[4]); - } - } - return 0; + return RVAL_DECODED; } -int -sys_create_module(struct tcb *tcp) +SYS_FUNC(init_module) { - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprintf(", %lu", tcp->u_arg[1]); - } - return RVAL_HEX; -} + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + printstr(tcp, tcp->u_arg[2]); -int -sys_delete_module(struct tcb *tcp) -{ - if (entering(tcp)) { - printstr(tcp, tcp->u_arg[0], -1); - tprints(", "); - printflags(delete_module_flags, tcp->u_arg[1], "O_???"); - } - return 0; + return RVAL_DECODED; } -int -sys_init_module(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - printstr(tcp, tcp->u_arg[2], -1); - } - return 0; -} - -#define MODULE_INIT_IGNORE_MODVERSIONS 1 -#define MODULE_INIT_IGNORE_VERMAGIC 2 - #include "xlat/module_init_flags.h" -int -sys_finit_module(struct tcb *tcp) +SYS_FUNC(finit_module) { - if (exiting(tcp)) - return 0; - /* file descriptor */ printfd(tcp, tcp->u_arg[0]); tprints(", "); /* param_values */ - printstr(tcp, tcp->u_arg[1], -1); + printstr(tcp, tcp->u_arg[1]); tprints(", "); /* flags */ printflags(module_init_flags, tcp->u_arg[2], "MODULE_INIT_???"); - return 0; + return RVAL_DECODED; } diff --git a/block.c b/block.c index b281b1af..4d1a965b 100644 --- a/block.c +++ b/block.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2009, 2010 Jeff Mahoney + * Copyright (c) 2011-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,16 +27,34 @@ */ #include "defs.h" -#include + +#include DEF_MPERS_TYPE(struct_blk_user_trace_setup) +#include DEF_MPERS_TYPE(struct_blkpg_ioctl_arg) +#include DEF_MPERS_TYPE(struct_blkpg_partition) + +#include #include -#include -/* ioctls <= 114 are present in Linux 2.4. The following ones have been - * added since then and headers containing them may not be available on - * every system. */ +typedef struct { + int op; + int flags; + int datalen; + void *data; +} struct_blkpg_ioctl_arg; + +#define BLKPG_DEVNAMELTH 64 +#define BLKPG_VOLNAMELTH 64 +typedef struct { + int64_t start; /* starting offset in bytes */ + int64_t length; /* length in bytes */ + int pno; /* partition number */ + char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2, + to be used in kernel messages */ + char volname[BLKPG_VOLNAMELTH]; /* volume label */ +} struct_blkpg_partition; #define BLKTRACE_BDEV_SIZE 32 -struct blk_user_trace_setup { +typedef struct blk_user_trace_setup { char name[BLKTRACE_BDEV_SIZE]; /* output */ uint16_t act_mask; /* input */ uint32_t buf_size; /* input */ @@ -43,97 +62,104 @@ struct blk_user_trace_setup { uint64_t start_lba; uint64_t end_lba; uint32_t pid; -}; +} struct_blk_user_trace_setup; + +#include MPERS_DEFS + +#ifndef BLKPG +# define BLKPG _IO(0x12,105) +#endif + +/* + * ioctl numbers <= 114 are present in Linux 2.4. The following ones have been + * added since then and headers containing them may not be available on every + * system. + */ #ifndef BLKTRACESETUP -#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup) +# define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup) #endif #ifndef BLKTRACESTART -#define BLKTRACESTART _IO(0x12,116) +# define BLKTRACESTART _IO(0x12,116) #endif #ifndef BLKTRACESTOP -#define BLKTRACESTOP _IO(0x12,117) +# define BLKTRACESTOP _IO(0x12,117) #endif #ifndef BLKTRACETEARDOWN -#define BLKTRACETEARDOWN _IO(0x12,118) +# define BLKTRACETEARDOWN _IO(0x12,118) #endif #ifndef BLKDISCARD -#define BLKDISCARD _IO(0x12,119) +# define BLKDISCARD _IO(0x12,119) #endif #ifndef BLKIOMIN -#define BLKIOMIN _IO(0x12,120) +# define BLKIOMIN _IO(0x12,120) #endif #ifndef BLKIOOPT -#define BLKIOOPT _IO(0x12,121) +# define BLKIOOPT _IO(0x12,121) #endif #ifndef BLKALIGNOFF -#define BLKALIGNOFF _IO(0x12,122) +# define BLKALIGNOFF _IO(0x12,122) #endif #ifndef BLKPBSZGET -#define BLKPBSZGET _IO(0x12,123) +# define BLKPBSZGET _IO(0x12,123) #endif #ifndef BLKDISCARDZEROES -#define BLKDISCARDZEROES _IO(0x12,124) +# define BLKDISCARDZEROES _IO(0x12,124) #endif #ifndef BLKSECDISCARD -#define BLKSECDISCARD _IO(0x12,125) +# define BLKSECDISCARD _IO(0x12,125) +#endif +#ifndef BLKROTATIONAL +# define BLKROTATIONAL _IO(0x12,126) +#endif +#ifndef BLKZEROOUT +# define BLKZEROOUT _IO(0x12,127) #endif #include "xlat/blkpg_ops.h" static void -print_blkpg_req(struct tcb *tcp, struct blkpg_ioctl_arg *blkpg) +print_blkpg_req(struct tcb *tcp, const struct_blkpg_ioctl_arg *blkpg) { - struct blkpg_partition p; + struct_blkpg_partition p; tprints("{"); printxval(blkpg_ops, blkpg->op, "BLKPG_???"); - tprintf(", flags=%d, datalen=%d, ", + tprintf(", flags=%d, datalen=%d, data=", blkpg->flags, blkpg->datalen); - if (umove(tcp, (long) blkpg->data, &p) < 0) - tprintf("%#lx}", (long) blkpg->data); - else - tprintf("{start=%lld, length=%lld, pno=%d, " - "devname=\"%.*s\", volname=\"%.*s\"}}", - p.start, p.length, p.pno, - (int) sizeof(p.devname), p.devname, - (int) sizeof(p.volname), p.volname); + if (!umove_or_printaddr(tcp, ptr_to_kulong(blkpg->data), &p)) { + tprintf("{start=%" PRId64 ", length=%" PRId64 + ", pno=%d, devname=", + p.start, p.length, p.pno); + print_quoted_string(p.devname, sizeof(p.devname), + QUOTE_0_TERMINATED); + tprints(", volname="); + print_quoted_string(p.volname, sizeof(p.volname), + QUOTE_0_TERMINATED); + tprints("}"); + } + tprints("}"); } -int -block_ioctl(struct tcb *tcp, long code, long arg) +MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) { switch (code) { /* take arg as a value, not as a pointer */ case BLKRASET: case BLKFRASET: - if (entering(tcp)) - tprintf(", %ld", arg); - break; - - /* take a signed int */ - case BLKROSET: - case BLKBSZSET: - if (entering(tcp)) { - int val; - if (umove(tcp, arg, &val) < 0) - tprintf(", %#lx", arg); - else - tprintf(", %d", val); - } + tprintf(", %" PRI_klu, arg); break; - /* returns an unsigned short */ + /* return an unsigned short */ case BLKSECTGET: - if (exiting(tcp)) { - unsigned short val; - if (syserror(tcp) || umove(tcp, arg, &val) < 0) - tprintf(", %#lx", arg); - else - tprintf(", %u", (unsigned)val); - } + case BLKROTATIONAL: + if (entering(tcp)) + return 0; + tprints(", "); + printnum_short(tcp, arg, "%hu"); break; /* return a signed int */ @@ -141,13 +167,14 @@ block_ioctl(struct tcb *tcp, long code, long arg) case BLKBSZGET: case BLKSSZGET: case BLKALIGNOFF: - if (exiting(tcp)) { - int val; - if (syserror(tcp) || umove(tcp, arg, &val) < 0) - tprintf(", %#lx", arg); - else - tprintf(", %d", val); - } + if (entering(tcp)) + return 0; + /* fall through */ + /* take a signed int */ + case BLKROSET: + case BLKBSZSET: + tprints(", "); + printnum_int(tcp, arg, "%d"); break; /* return an unsigned int */ @@ -155,125 +182,93 @@ block_ioctl(struct tcb *tcp, long code, long arg) case BLKIOMIN: case BLKIOOPT: case BLKDISCARDZEROES: - if (exiting(tcp)) { - unsigned int val; - if (syserror(tcp) || umove(tcp, arg, &val) < 0) - tprintf(", %#lx", arg); - else - tprintf(", %u", val); - } + if (entering(tcp)) + return 0; + tprints(", "); + printnum_int(tcp, arg, "%u"); break; /* return a signed long */ case BLKRAGET: case BLKFRAGET: - if (exiting(tcp)) { - long val; - if (syserror(tcp) || umove(tcp, arg, &val) < 0) - tprintf(", %#lx", arg); - else - tprintf(", %ld", val); - } + if (entering(tcp)) + return 0; + tprints(", "); + printnum_slong(tcp, arg); break; /* returns an unsigned long */ case BLKGETSIZE: - if (exiting(tcp)) { - unsigned long val; - if (syserror(tcp) || umove(tcp, arg, &val) < 0) - tprintf(", %#lx", arg); - else - tprintf(", %lu", val); - } + if (entering(tcp)) + return 0; + tprints(", "); + printnum_ulong(tcp, arg); break; #ifdef HAVE_BLKGETSIZE64 - /* return an uint64_t */ + /* returns an uint64_t */ case BLKGETSIZE64: - if (exiting(tcp)) { - uint64_t val; - if (syserror(tcp) || umove(tcp, arg, &val) < 0) - tprintf(", %#lx", arg); - else - tprintf(", %" PRIu64, val); - } + if (entering(tcp)) + return 0; + tprints(", "); + printnum_int64(tcp, arg, "%" PRIu64); break; #endif - /* More complex types */ + /* takes a pair of uint64_t */ case BLKDISCARD: case BLKSECDISCARD: - if (entering(tcp)) { - uint64_t range[2]; - if (umove(tcp, arg, range) < 0) - tprintf(", %#lx", arg); - else - tprintf(", {%" PRIx64 ", %" PRIx64 "}", - range[0], range[1]); - } + case BLKZEROOUT: + tprints(", "); + printpair_int64(tcp, arg, "%" PRIu64); break; - case HDIO_GETGEO: - if (exiting(tcp)) { - struct hd_geometry geo; - if (syserror(tcp) || umove(tcp, arg, &geo) < 0) - tprintf(", %#lx", arg); - else - tprintf(", {heads=%u, sectors=%u, " - "cylinders=%u, start=%lu}", - (unsigned)geo.heads, - (unsigned)geo.sectors, - (unsigned)geo.cylinders, - geo.start); - } - break; + /* More complex types */ + case BLKPG: { + struct_blkpg_ioctl_arg blkpg; - case BLKPG: - if (entering(tcp)) { - struct blkpg_ioctl_arg blkpg; - if (umove(tcp, arg, &blkpg) < 0) - tprintf(", %#lx", arg); - else { - tprints(", "); - print_blkpg_req(tcp, &blkpg); - } - } + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &blkpg)) + print_blkpg_req(tcp, &blkpg); break; + } case BLKTRACESETUP: if (entering(tcp)) { - struct blk_user_trace_setup buts; - if (umove(tcp, arg, &buts) < 0) - tprintf(", %#lx", arg); - else - tprintf(", {act_mask=%u, buf_size=%u, " - "buf_nr=%u, start_lba=%" PRIu64 ", " - "end_lba=%" PRIu64 ", pid=%u}", - (unsigned)buts.act_mask, buts.buf_size, - buts.buf_nr, buts.start_lba, - buts.end_lba, buts.pid); - } - if (exiting(tcp)) { - struct blk_user_trace_setup buts; - if (syserror(tcp) || umove(tcp, arg, &buts) < 0) - tprintf(", %#lx", arg); - else - tprintf(", {name=\"%.*s\"}", - (int) sizeof(buts.name), buts.name); + struct_blk_user_trace_setup buts; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &buts)) + break; + tprintf("{act_mask=%u, buf_size=%u, " + "buf_nr=%u, start_lba=%" PRIu64 ", " + "end_lba=%" PRIu64 ", pid=%u", + (unsigned)buts.act_mask, buts.buf_size, + buts.buf_nr, buts.start_lba, + buts.end_lba, buts.pid); + return 1; + } else { + struct_blk_user_trace_setup buts; + + if (!syserror(tcp) && !umove(tcp, arg, &buts)) { + tprints(", name="); + print_quoted_string(buts.name, sizeof(buts.name), + QUOTE_0_TERMINATED); + } + tprints("}"); + break; } - break; - /* No arguments or unhandled */ + /* No arguments */ + case BLKRRPART: + case BLKFLSBUF: case BLKTRACESTART: case BLKTRACESTOP: case BLKTRACETEARDOWN: - case BLKFLSBUF: /* Requires driver knowlege */ - case BLKRRPART: /* No args */ - default: - if (entering(tcp)) - tprintf(", %#lx", arg); break; + default: + return RVAL_DECODED; + } - }; - return 1; + return RVAL_DECODED | 1; } diff --git a/bpf.c b/bpf.c new file mode 100644 index 00000000..99410183 --- /dev/null +++ b/bpf.c @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2017 Quentin Monnet + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_BPF_H +# include +#endif + +#include "xlat/bpf_commands.h" +#include "xlat/bpf_map_types.h" +#include "xlat/bpf_prog_types.h" +#include "xlat/bpf_map_update_elem_flags.h" +#include "xlat/bpf_attach_type.h" + +static int +bpf_map_create(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + struct { + uint32_t map_type, key_size, value_size, max_entries; + } attr = {}; + + if (!size) { + printaddr(addr); + return RVAL_DECODED | RVAL_FD; + } + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return RVAL_DECODED | RVAL_FD; + + tprints("{map_type="); + printxval(bpf_map_types, attr.map_type, "BPF_MAP_TYPE_???"); + tprintf(", key_size=%u, value_size=%u, max_entries=%u}", + attr.key_size, attr.value_size, attr.max_entries); + + return RVAL_DECODED | RVAL_FD; +} + +static void +bpf_map_update_elem(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + struct { + uint32_t map_fd; + uint64_t ATTRIBUTE_ALIGNED(8) key; + uint64_t ATTRIBUTE_ALIGNED(8) value; + uint64_t flags; + } attr = {}; + + if (!size) { + printaddr(addr); + return; + } + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return; + + tprints("{map_fd="); + printfd(tcp, attr.map_fd); + tprintf(", key=%#" PRIx64 ", value=%#" PRIx64 ", flags=", + attr.key, attr.value); + printxval64(bpf_map_update_elem_flags, attr.flags, "BPF_???"); + tprints("}"); +} + +static void +bpf_map_delete_elem(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + struct { + uint32_t map_fd; + uint64_t ATTRIBUTE_ALIGNED(8) key; + } attr = {}; + + if (!size) { + printaddr(addr); + return; + } + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return; + + tprints("{map_fd="); + printfd(tcp, attr.map_fd); + tprintf(", key=%#" PRIx64 "}", attr.key); +} + +static int +bpf_map_io(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size, + const char *const text) +{ + struct bpf_io_elem_struct { + uint32_t map_fd; + uint64_t ATTRIBUTE_ALIGNED(8) key; + uint64_t ATTRIBUTE_ALIGNED(8) value; + } attr = {}; + + if (exiting(tcp)) { + if (!syserror(tcp) && !umove_or_printaddr(tcp, addr, &attr)) + tprintf(", %s=%#" PRIx64, text, attr.value); + tprints("}"); + return RVAL_DECODED; + } + + if (!size) { + printaddr(addr); + return RVAL_DECODED; + } + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return RVAL_DECODED; + + tprints("{map_fd="); + printfd(tcp, attr.map_fd); + tprintf(", key=%#" PRIx64, attr.key); + + return 0; +} + +static int +bpf_prog_load(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + struct { + uint32_t prog_type, insn_cnt; + uint64_t ATTRIBUTE_ALIGNED(8) insns, license; + uint32_t log_level, log_size; + uint64_t ATTRIBUTE_ALIGNED(8) log_buf; + uint32_t kern_version; + } attr = {}; + + if (!size) { + printaddr(addr); + return RVAL_DECODED | RVAL_FD; + } + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return RVAL_DECODED | RVAL_FD; + + tprints("{prog_type="); + printxval(bpf_prog_types, attr.prog_type, "BPF_PROG_TYPE_???"); + tprintf(", insn_cnt=%u, insns=%#" PRIx64 ", license=", + attr.insn_cnt, attr.insns); + printstr(tcp, attr.license); + tprintf(", log_level=%u, log_size=%u, log_buf=%#" PRIx64 ", kern_version=%u}", + attr.log_level, attr.log_size, attr.log_buf, attr.kern_version); + + return RVAL_DECODED | RVAL_FD; +} + +static int +bpf_obj_manage(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + struct { + uint64_t ATTRIBUTE_ALIGNED(8) pathname; + uint32_t bpf_fd; + } attr = {}; + + if (!size) { + printaddr(addr); + return RVAL_DECODED | RVAL_FD; + } + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return RVAL_DECODED | RVAL_FD; + + tprintf("{pathname="); + printpath(tcp, attr.pathname); + tprints(", bpf_fd="); + printfd(tcp, attr.bpf_fd); + tprintf("}"); + + return RVAL_DECODED | RVAL_FD; +} + +static int +bpf_prog_attach_detach(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size, bool print_attach_bpf_fd) +{ + struct { + uint32_t target_fd, attach_bpf_fd, attach_type; + } attr = {}; + + if (!size) { + printaddr(addr); + return RVAL_DECODED; + } + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return RVAL_DECODED; + + tprintf("{target_fd="); + printfd(tcp, attr.target_fd); + if (print_attach_bpf_fd) { + tprintf(", attach_bpf_fd="); + printfd(tcp, attr.attach_bpf_fd); + } + tprintf(", attach_type="); + printxval(bpf_attach_type, attr.attach_type, "BPF_???"); + tprintf("}"); + + return RVAL_DECODED; +} + +static int +bpf_prog_attach(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + return bpf_prog_attach_detach(tcp, addr, size, true); +} + +static int +bpf_prog_detach(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + return bpf_prog_attach_detach(tcp, addr, size, false); +} + +SYS_FUNC(bpf) +{ + const unsigned int cmd = tcp->u_arg[0]; + const kernel_ulong_t addr = tcp->u_arg[1]; + const unsigned int size = tcp->u_arg[2]; + int rc = RVAL_DECODED; + + if (entering(tcp)) { + printxval(bpf_commands, cmd, "BPF_???"); + tprints(", "); + } + + switch (cmd) { + case BPF_MAP_CREATE: + rc = bpf_map_create(tcp, addr, size); + break; + case BPF_MAP_LOOKUP_ELEM: + rc = bpf_map_io(tcp, addr, size, "value"); + break; + case BPF_MAP_UPDATE_ELEM: + bpf_map_update_elem(tcp, addr, size); + break; + case BPF_MAP_DELETE_ELEM: + bpf_map_delete_elem(tcp, addr, size); + break; + case BPF_MAP_GET_NEXT_KEY: + rc = bpf_map_io(tcp, addr, size, "next_key"); + break; + case BPF_PROG_LOAD: + rc = bpf_prog_load(tcp, addr, size); + break; + case BPF_OBJ_PIN: + rc = bpf_obj_manage(tcp, addr, size); + break; + case BPF_OBJ_GET: + rc = bpf_obj_manage(tcp, addr, size); + break; + case BPF_PROG_ATTACH: + rc = bpf_prog_attach(tcp, addr, size); + break; + case BPF_PROG_DETACH: + rc = bpf_prog_detach(tcp, addr, size); + break; + default: + printaddr(addr); + break; + } + + if (rc & RVAL_DECODED) + tprintf(", %u", size); + + return rc; +} diff --git a/btrfs.c b/btrfs.c new file mode 100644 index 00000000..e007040f --- /dev/null +++ b/btrfs.c @@ -0,0 +1,1368 @@ +/* + * Copyright (c) 2016 Jeff Mahoney + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_BTRFS_H + +#include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args) +#include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args) +#include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args) +#include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2) + +# include + +typedef struct btrfs_ioctl_dev_replace_args + struct_btrfs_ioctl_dev_replace_args; +typedef struct btrfs_ioctl_send_args + struct_btrfs_ioctl_send_args; +typedef struct btrfs_ioctl_received_subvol_args + struct_btrfs_ioctl_received_subvol_args; +typedef struct btrfs_ioctl_vol_args_v2 + struct_btrfs_ioctl_vol_args_v2; + +#endif /* HAVE_LINUX_BTRFS_H */ + +#include MPERS_DEFS + +#ifdef HAVE_LINUX_BTRFS_H + +#include + +/* + * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in + * its definition, which isn't exported by the kernel. + */ +typedef __u64 u64; + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +struct btrfs_ioctl_feature_flags { + uint64_t compat_flags; + uint64_t compat_ro_flags; + uint64_t incompat_flags; +}; +#endif + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +struct btrfs_ioctl_defrag_range_args { + uint64_t start; + uint64_t len; + uint64_t flags; + uint32_t extent_thresh; + uint32_t compress_type; + uint32_t unused[4]; +}; +#endif + +#ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +#endif + +#ifndef BTRFS_FIRST_FREE_OBJECTID +# define BTRFS_FIRST_FREE_OBJECTID 256ULL +#endif + +#ifndef BTRFS_IOC_QUOTA_RESCAN +struct btrfs_ioctl_quota_rescan_args { + uint64_t flags, progress, reserved[6]; +}; +# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ + struct btrfs_ioctl_quota_rescan_args) +# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ + struct btrfs_ioctl_quota_rescan_args) +#endif + +#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +#endif + +#ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags) +# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[2]) +# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[3]) +#endif + +#ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ + struct btrfs_ioctl_search_args_v2) +struct btrfs_ioctl_search_args_v2 { + struct btrfs_ioctl_search_key key; /* in/out - search parameters */ + uint64_t buf_size; /* in - size of buffer + * out - on EOVERFLOW: needed size + * to store item */ + uint64_t buf[0]; /* out - found items */ +}; +#endif + +#include "xlat/btrfs_balance_args.h" +#include "xlat/btrfs_balance_ctl_cmds.h" +#include "xlat/btrfs_balance_flags.h" +#include "xlat/btrfs_balance_state.h" +#include "xlat/btrfs_compress_types.h" +#include "xlat/btrfs_defrag_flags.h" +#include "xlat/btrfs_dev_replace_cmds.h" +#include "xlat/btrfs_dev_replace_results.h" +#include "xlat/btrfs_dev_replace_state.h" +#include "xlat/btrfs_dev_stats_flags.h" +#include "xlat/btrfs_dev_stats_values.h" +#include "xlat/btrfs_features_compat.h" +#include "xlat/btrfs_features_compat_ro.h" +#include "xlat/btrfs_features_incompat.h" +#include "xlat/btrfs_key_types.h" +#include "xlat/btrfs_qgroup_ctl_cmds.h" +#include "xlat/btrfs_qgroup_inherit_flags.h" +#include "xlat/btrfs_qgroup_limit_flags.h" +#include "xlat/btrfs_qgroup_status_flags.h" +#include "xlat/btrfs_scrub_flags.h" +#include "xlat/btrfs_send_flags.h" +#include "xlat/btrfs_snap_flags_v2.h" +#include "xlat/btrfs_space_info_flags.h" +#include "xlat/btrfs_tree_objectids.h" + +static inline char +prnibble(char v) +{ + if (v >= 10) + return 'a' + (v - 10); + return '0' + v; +} + +/* 8-4-4-4-12 = 36 characters */ +#define UUID_STRING_SIZE 36 + +/* Formats uuid, returns 0 if it's all zeroes */ +static int +btrfs_unparse_uuid(unsigned char *uuid, char *out) +{ + int i; + int ret = 0; + for (i = 0; i < BTRFS_UUID_SIZE; i++) { + if (i == 4 || i == 6 || i == 8 || i == 10) + *out++ = '-'; + *out++ = prnibble(uuid[i] >> 4); + *out++ = prnibble(uuid[i] & 0xf); + if (uuid[i]) + ret = 1; + } + *out = '\0'; + return ret; +} + +static void +print_u64(const char *name, uint64_t value) +{ + tprintf(", %s=%" PRIu64, name, value); + if (value == UINT64_MAX) + tprints(" /* UINT64_MAX */"); +} + +#define print_member_u64(obj, name) print_u64(#name, obj->name) + +static void +btrfs_print_balance_args(const char *name, const struct btrfs_balance_args *bba) +{ + tprintf(", %s={profiles=", name); + printflags64(btrfs_space_info_flags, bba->profiles, + "BTRFS_BLOCK_GROUP_???"); + print_member_u64(bba, usage); + print_member_u64(bba, devid); + print_member_u64(bba, pstart); + print_member_u64(bba, pend); + print_member_u64(bba, vstart); + print_member_u64(bba, vend); + print_member_u64(bba, target); + tprints(", flags="); + printflags64(btrfs_balance_args, bba->flags, "BTRFS_BALANCE_ARGS_???"); + tprints("}"); +} + +static void +btrfs_print_balance(struct tcb *const tcp, const kernel_ulong_t arg, bool out) +{ + struct btrfs_ioctl_balance_args balance_args; + + if (umove_or_printaddr(tcp, arg, &balance_args)) + return; + + tprints("{flags="); + printflags64(btrfs_balance_flags, balance_args.flags, + "BTRFS_BALANCE_???"); + if (out) { + tprints(", state="); + printflags64(btrfs_balance_state, balance_args.state, + "BTRFS_BALANCE_STATE_???"); + } + + if (balance_args.flags & BTRFS_BALANCE_DATA) + btrfs_print_balance_args("data", &balance_args.data); + if (balance_args.flags & BTRFS_BALANCE_METADATA) + btrfs_print_balance_args("meta", &balance_args.meta); + if (balance_args.flags & BTRFS_BALANCE_SYSTEM) + btrfs_print_balance_args("sys", &balance_args.sys); + tprints("}"); +} + +static void +btrfs_print_features(const struct btrfs_ioctl_feature_flags *flags) +{ + tprints("{compat_flags="); + printflags64(btrfs_features_compat, flags->compat_flags, + "BTRFS_FEATURE_COMPAT_???"); + + tprints(", compat_ro_flags="); + printflags64(btrfs_features_compat_ro, flags->compat_ro_flags, + "BTRFS_FEATURE_COMPAT_RO_???"); + + tprints(", incompat_flags="); + printflags64(btrfs_features_incompat, flags->incompat_flags, + "BTRFS_FEATURE_INCOMPAT_???"); + tprints("}"); +} + +static void +btrfs_print_qgroup_limit(const struct btrfs_qgroup_limit *lim) +{ + tprints("{flags="); + printflags64(btrfs_qgroup_limit_flags, lim->flags, + "BTRFS_QGROUP_LIMIT_???"); + tprintf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 + ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 "}", + lim->max_rfer, lim->max_excl, + lim->rsv_rfer, lim->rsv_excl); +} + +static void +btrfs_print_key_type(uint32_t type) +{ + const char *str = xlookup(btrfs_key_types, type); + tprintf("%u", type); + if (str) + tprintf(" /* %s */", str); +} + +static void +btrfs_print_objectid(uint64_t objectid) +{ + const char *str = xlookup(btrfs_tree_objectids, objectid); + tprintf("%" PRIu64, objectid); + if (str) + tprintf(" /* %s */", str); +} + +static void +btrfs_print_data_container_header(const struct btrfs_data_container *container) +{ + tprintf("{bytes_left=%u, bytes_missing=%u" + ", elem_cnt=%u, elem_missed=%u, val=", + container->bytes_left, container->bytes_missing, + container->elem_cnt, container->elem_missed); +} + +static void +btrfs_print_data_container_footer(void) +{ + tprints("}"); +} + +static bool +print_btrfs_data_container_logical_ino(struct tcb *tcp, void *elem_buf, + size_t elem_size, void *data) +{ + const uint64_t *const record = elem_buf; + + tprintf("{inum=%" PRIu64 ", offset=%" PRIu64 ", root=%" PRIu64 "}", + record[0], record[1], record[2]); + + return true; +} + +static void +btrfs_print_logical_ino_container(struct tcb *tcp, + const uint64_t inodes_addr) +{ + struct btrfs_data_container container; + + if (umove_or_printaddr(tcp, inodes_addr, &container)) + return; + + btrfs_print_data_container_header(&container); + + if (abbrev(tcp)) { + tprints("..."); + } else { + const uint64_t val_addr = + inodes_addr + offsetof(typeof(container), val); + uint64_t record[3]; + print_array(tcp, val_addr, container.elem_cnt / 3, + record, sizeof(record), + umoven_or_printaddr, + print_btrfs_data_container_logical_ino, 0); + } + + btrfs_print_data_container_footer(); +} + +static bool +print_btrfs_data_container_ino_path(struct tcb *tcp, void *elem_buf, + size_t elem_size, void *data) +{ + const uint64_t *const offset = elem_buf; + const uint64_t *const val_addr = data; + + printpath(tcp, *val_addr + *offset); + + return true; +} + +static void +btrfs_print_ino_path_container(struct tcb *tcp, + const uint64_t fspath_addr) +{ + struct btrfs_data_container container; + + if (umove_or_printaddr(tcp, fspath_addr, &container)) + return; + + btrfs_print_data_container_header(&container); + + if (abbrev(tcp)) { + tprints("..."); + } else { + uint64_t val_addr = + fspath_addr + offsetof(typeof(container), val); + uint64_t offset; + print_array(tcp, val_addr, container.elem_cnt, + &offset, sizeof(offset), + umoven_or_printaddr, + print_btrfs_data_container_ino_path, &val_addr); + } + + btrfs_print_data_container_footer(); +} + +static bool +print_uint64(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + tprintf("%" PRIu64, * (uint64_t *) elem_buf); + + return true; +} + +static void +btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr) +{ + struct btrfs_qgroup_inherit inherit; + + if (umove_or_printaddr(tcp, qgi_addr, &inherit)) + return; + + tprints("{flags="); + printflags64(btrfs_qgroup_inherit_flags, inherit.flags, + "BTRFS_QGROUP_INHERIT_???"); + tprintf(", num_qgroups=%" PRI__u64 ", num_ref_copies=%" PRI__u64 + ", num_excl_copies=%" PRI__u64 ", lim=", + inherit.num_qgroups, inherit.num_ref_copies, + inherit.num_excl_copies); + + btrfs_print_qgroup_limit(&inherit.lim); + + tprints(", qgroups="); + + if (abbrev(tcp)) { + tprints("..."); + } else { + uint64_t record; + print_array(tcp, qgi_addr + offsetof(typeof(inherit), qgroups), + inherit.num_qgroups, &record, sizeof(record), + umoven_or_printaddr, print_uint64, 0); + } + tprints("}"); +} + +static void +print_key_value_internal(struct tcb *tcp, const char *name, uint64_t value) +{ + if (value) { + tprintf(", %s=%" PRIu64, name, value); + if (value == UINT64_MAX) + tprints(" /* UINT64_MAX */"); + } +} +#define print_key_value(tcp, key, name) \ + print_key_value_internal((tcp), #name, (key)->name) + +static void +btrfs_print_tree_search(struct tcb *tcp, struct btrfs_ioctl_search_key *key, + uint64_t buf_addr, uint64_t buf_size, bool print_size) +{ + if (entering(tcp)) { + tprints("{key={tree_id="); + btrfs_print_objectid(key->tree_id); + + if (key->min_objectid != BTRFS_FIRST_FREE_OBJECTID || + !abbrev(tcp)) { + tprints(", min_objectid="); + btrfs_print_objectid(key->min_objectid); + } + + if (key->max_objectid != BTRFS_LAST_FREE_OBJECTID || + !abbrev(tcp)) { + tprints(", max_objectid="); + btrfs_print_objectid(key->max_objectid); + } + + print_key_value(tcp, key, min_offset); + print_key_value(tcp, key, max_offset); + print_key_value(tcp, key, min_transid); + print_key_value(tcp, key, max_transid); + + tprints(", min_type="); + btrfs_print_key_type(key->min_type); + tprints(", max_type="); + btrfs_print_key_type(key->max_type); + tprintf(", nr_items=%u}", key->nr_items); + if (print_size) + tprintf(", buf_size=%" PRIu64, buf_size); + tprints("}"); + } else { + tprintf("{key={nr_items=%u}", key->nr_items); + if (print_size) + tprintf(", buf_size=%" PRIu64, buf_size); + tprints(", buf="); + if (abbrev(tcp)) + tprints("..."); + else { + uint64_t i; + uint64_t off = 0; + tprints("["); + for (i = 0; i < key->nr_items; i++) { + struct btrfs_ioctl_search_header sh; + uint64_t addr = buf_addr + off; + if (i) + tprints(", "); + if (i > max_strlen || + umove(tcp, addr, &sh)) { + tprints("..."); + break; + } + tprintf("{transid=%" PRI__u64 ", objectid=", + sh.transid); + btrfs_print_objectid(sh.objectid); + tprintf(", offset=%" PRI__u64 ", type=", sh.offset); + btrfs_print_key_type(sh.type); + tprintf(", len=%u}", sh.len); + off += sizeof(sh) + sh.len; + + } + tprints("]"); + } + tprints("}"); + } +} + +static bool +print_objectid_callback(struct tcb *tcp, void *elem_buf, + size_t elem_size, void *data) +{ + btrfs_print_objectid(* (uint64_t *) elem_buf); + + return true; +} + +static bool +print_btrfs_ioctl_space_info(struct tcb *tcp, void *elem_buf, + size_t elem_size, void *data) +{ + const struct btrfs_ioctl_space_info *info = elem_buf; + + tprints("{flags="); + printflags64(btrfs_space_info_flags, info->flags, + "BTRFS_SPACE_INFO_???"); + tprintf(", total_bytes=%" PRI__u64 ", used_bytes=%" PRI__u64 "}", + info->total_bytes, info->used_bytes); + + return true; +} + +MPERS_PRINTER_DECL(int, btrfs_ioctl, + struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { + /* Take no arguments; command only. */ + case BTRFS_IOC_TRANS_START: + case BTRFS_IOC_TRANS_END: + case BTRFS_IOC_SYNC: + case BTRFS_IOC_SCRUB_CANCEL: + case BTRFS_IOC_QUOTA_RESCAN_WAIT: + /* + * The codes for these ioctls are based on each accepting a + * vol_args but none of them actually consume an argument. + */ + case BTRFS_IOC_DEFRAG: + case BTRFS_IOC_BALANCE: + break; + + /* takes a signed int */ + case BTRFS_IOC_BALANCE_CTL: + tprints(", "); + printxval(btrfs_balance_ctl_cmds, arg, "BTRFS_BALANCE_CTL_???"); + break; + + /* returns a 64 */ + case BTRFS_IOC_START_SYNC: /* R */ + if (entering(tcp)) + return 0; + /* fall through */ + /* takes a u64 */ + case BTRFS_IOC_DEFAULT_SUBVOL: /* W */ + case BTRFS_IOC_WAIT_SYNC: /* W */ + tprints(", "); + printnum_int64(tcp, arg, "%" PRIu64); + break; + + /* u64 but describe a flags bitfield; we can make that symbolic */ + case BTRFS_IOC_SUBVOL_GETFLAGS: { /* R */ + uint64_t flags; + + if (entering(tcp)) + return 0; + + tprints(", "); + + if (umove_or_printaddr(tcp, arg, &flags)) + break; + + printflags64(btrfs_snap_flags_v2, flags, "BTRFS_SUBVOL_???"); + break; + } + + case BTRFS_IOC_SUBVOL_SETFLAGS: { /* W */ + uint64_t flags; + + tprints(", "); + + if (umove_or_printaddr(tcp, arg, &flags)) + break; + + printflags64(btrfs_snap_flags_v2, flags, "BTRFS_SUBVOL_???"); + break; + } + + /* More complex types */ + case BTRFS_IOC_BALANCE_V2: /* RW */ + if (entering(tcp)) { + tprints(", "); + btrfs_print_balance(tcp, arg, false); + return 0; + } + + if (syserror(tcp)) + break; + + tprints(" => "); + btrfs_print_balance(tcp, arg, true); + break; + case BTRFS_IOC_BALANCE_PROGRESS: /* R */ + if (entering(tcp)) + return 0; + + tprints(", "); + btrfs_print_balance(tcp, arg, true); + break; + + case BTRFS_IOC_DEFRAG_RANGE: { /* W */ + struct btrfs_ioctl_defrag_range_args args; + + tprints(", "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprintf("{start=%" PRIu64 ", len=", (uint64_t)args.start); + + tprintf("%" PRIu64, (uint64_t) args.len); + if (args.len == UINT64_MAX) + tprints(" /* UINT64_MAX */"); + + tprints(", flags="); + printflags64(btrfs_defrag_flags, args.flags, + "BTRFS_DEFRAG_RANGE_???"); + tprintf(", extent_thresh=%u, compress_type=", + args.extent_thresh); + printxval(btrfs_compress_types, args.compress_type, + "BTRFS_COMPRESS_???"); + tprints("}"); + break; + } + + case BTRFS_IOC_DEV_INFO: { /* RW */ + struct btrfs_ioctl_dev_info_args args; + char uuid[UUID_STRING_SIZE+1]; + int valid; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + tprints("{"); + + valid = btrfs_unparse_uuid(args.uuid, uuid); + if (entering(tcp)) { + tprintf("devid=%" PRI__u64, args.devid); + if (valid) + tprintf(", uuid=%s", uuid); + tprints("}"); + return 0; + } + if (valid) + tprintf("uuid=%s, ", uuid); + tprintf("bytes_used=%" PRI__u64 + ", total_bytes=%" PRI__u64 ", path=", + args.bytes_used, args.total_bytes); + print_quoted_string((const char *)args.path, sizeof(args.path), + QUOTE_0_TERMINATED); + tprints("}"); + break; + } + + case BTRFS_IOC_DEV_REPLACE: { /* RW */ + struct_btrfs_ioctl_dev_replace_args args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + if (entering(tcp)) { + tprints("{cmd="); + printxval64(btrfs_dev_replace_cmds, args.cmd, + "BTRFS_IOCTL_DEV_REPLACE_CMD_???"); + if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_START) { + const char *str; + tprintf(", start={srcdevid=%" PRIu64 + ", cont_reading_from_srcdev_mode=%" PRIu64 + ", srcdev_name=", + (uint64_t) args.start.srcdevid, + (uint64_t) args.start.cont_reading_from_srcdev_mode); + + str = (const char*) args.start.srcdev_name; + print_quoted_string(str, + sizeof(args.start.srcdev_name), + QUOTE_0_TERMINATED); + tprints(", tgtdev_name="); + str = (const char*) args.start.tgtdev_name; + print_quoted_string(str, + sizeof(args.start.tgtdev_name), + QUOTE_0_TERMINATED); + tprints("}"); + + } + tprints("}"); + return 0; + } + + tprints("{result="); + printxval64(btrfs_dev_replace_results, args.result, + "BTRFS_IOCTL_DEV_REPLACE_RESULT_???"); + if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS) { + char buf[sizeof("HH:MM:SS") + 1]; + time_t time; + tprints(", "); + printxval64(btrfs_dev_replace_state, + args.status.replace_state, + "BTRFS_IOCTL_DEV_REPLACE_STATE_???"); + tprintf(", progress_1000=%" PRIu64 " /* ", + (uint64_t) args.status.progress_1000); + if (args.status.progress_1000 <= 1000) + tprintf("%" PRIu64 ".%.2" PRIu64 "%%", + (uint64_t) args.status.progress_1000 / 10, + (uint64_t) args.status.progress_1000 % 10); + else + tprints("???"); + tprints(" */ ,"); + + time = args.status.time_started; + strftime(buf, sizeof(buf), "%T", + localtime(&time)); + tprintf("time_started=%" PRIu64" /* %s */, ", + (uint64_t) args.status.time_started, buf); + + time = args.status.time_stopped; + strftime(buf, sizeof(buf), "%T", + localtime(&time)); + tprintf("time_stopped=%" PRIu64" /* %s */, ", + (uint64_t) args.status.time_stopped, buf); + + tprintf("num_write_errors=%" PRIu64 + ", num_uncorrectable_read_errors=%" PRIu64, + (uint64_t) args.status.num_write_errors, + (uint64_t) args.status.num_uncorrectable_read_errors); + } + tprints("}"); + break; + } + + case BTRFS_IOC_GET_FEATURES: { /* R */ + struct btrfs_ioctl_feature_flags flags; + + if (entering(tcp)) + return 0; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &flags)) + break; + + btrfs_print_features(&flags); + break; + } + + case BTRFS_IOC_SET_FEATURES: { /* W */ + struct btrfs_ioctl_feature_flags flarg[2]; + + tprints(", "); + + if (umove_or_printaddr(tcp, arg, &flarg)) + break; + + tprints("["); + btrfs_print_features(&flarg[0]); + tprints(", "); + btrfs_print_features(&flarg[1]); + tprints("]"); + break; + } + + case BTRFS_IOC_GET_SUPPORTED_FEATURES: { /* R */ + struct btrfs_ioctl_feature_flags flarg[3]; + + if (entering(tcp)) + return 0; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &flarg)) + break; + + tprints("[ /* supported */ "); + btrfs_print_features(&flarg[0]); + + tprints(", /* safe to set */ "); + btrfs_print_features(&flarg[1]); + + tprints(", /* safe to clear */ "); + btrfs_print_features(&flarg[2]); + tprints("]"); + + break; + } + + case BTRFS_IOC_FS_INFO: { /* R */ + struct btrfs_ioctl_fs_info_args args; + char uuid[UUID_STRING_SIZE+1]; + uint32_t nodesize, sectorsize, clone_alignment; +#ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE + __u32 *reserved32; +#endif + + if (entering(tcp)) + return 0; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + +#ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE + nodesize = args.nodesize, + sectorsize = args.sectorsize, + clone_alignment = args.clone_alignment; +#else + reserved32 = (__u32 *) (void *) args.reserved; + nodesize = reserved32[0]; + sectorsize = reserved32[1]; + clone_alignment = reserved32[2]; +#endif + btrfs_unparse_uuid(args.fsid, uuid); + + tprints("{"); + tprintf("max_id=%" PRI__u64 ", num_devices=%" PRI__u64 + ", fsid=%s, nodesize=%u, sectorsize=%u" + ", clone_alignment=%u", + args.max_id, args.num_devices, uuid, + nodesize, sectorsize, clone_alignment); + tprints("}"); + break; + } + + case BTRFS_IOC_GET_DEV_STATS: { /* RW */ + struct btrfs_ioctl_get_dev_stats args; + uint64_t i; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{"); + + if (entering(tcp)) + tprintf("devid=%" PRI__u64 ", ", args.devid); + + tprintf("nr_items=%" PRI__u64 ", flags=", args.nr_items); + printflags64(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + + if (entering(tcp)) { + tprints("}"); + return 0; + } + + /* + * The structure has a 1k limit; Let's make sure we don't + * go off into the middle of nowhere with a bad nr_items + * value. + */ + tprints(", ["); + for (i = 0; i < args.nr_items; i++) { + if (i) + tprints(", "); + if (i >= ARRAY_SIZE(args.values)) { + tprints("..."); + break; + } + const char *name = xlookup(btrfs_dev_stats_values, i); + if (name) + tprintf("/* %s */ ", name); + tprintf("%" PRI__u64, args.values[i]); + } + tprints("]}"); + break; + } + + case BTRFS_IOC_INO_LOOKUP: { /* RW */ + struct btrfs_ioctl_ino_lookup_args args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + if (entering(tcp)) { + /* Use subvolume id of the containing root */ + if (args.treeid == 0) + set_tcb_priv_ulong(tcp, 1); + + tprints("{treeid="); + btrfs_print_objectid(args.treeid); + tprints(", objectid="); + btrfs_print_objectid(args.objectid); + tprints("}"); + return 0; + } + + tprints("{"); + if (get_tcb_priv_ulong(tcp)) { + tprints("treeid="); + btrfs_print_objectid(args.treeid); + tprints(", "); + } + + tprints("name="); + print_quoted_string(args.name, sizeof(args.name), + QUOTE_0_TERMINATED); + tprints("}"); + break; + } + + case BTRFS_IOC_INO_PATHS: { /* RW */ + struct btrfs_ioctl_ino_path_args args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{"); + + if (entering(tcp)) { + tprintf("inum=%" PRI__u64 ", size=%" PRI__u64, + args.inum, args.size); + tprintf(", fspath=0x%" PRI__x64 "}", args.fspath); + return 0; + } + + tprints("fspath="); + btrfs_print_ino_path_container(tcp, args.fspath); + + tprints("}"); + break; + } + + case BTRFS_IOC_LOGICAL_INO: { /* RW */ + struct btrfs_ioctl_logical_ino_args args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{"); + + if (entering(tcp)) { + tprintf("logical=%" PRI__u64 ", size=%" PRI__u64, + args.logical, args.size); + tprintf(", inodes=0x%" PRI__x64 "}", args.inodes); + return 0; + } + + tprints("inodes="); + btrfs_print_logical_ino_container(tcp, args.inodes); + + tprints("}"); + break; + } + + case BTRFS_IOC_QGROUP_ASSIGN: { /* W */ + struct btrfs_ioctl_qgroup_assign_args args; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprintf("{assign=%" PRI__u64 ", src=%" PRI__u64 + ", dst=%" PRI__u64 "}", + args.assign, args.src, args.dst); + break; + } + + case BTRFS_IOC_QGROUP_CREATE: { /* W */ + struct btrfs_ioctl_qgroup_create_args args; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprintf("{create=%" PRI__u64 ", qgroupid=%" PRI__u64 "}", + args.create, args.qgroupid); + break; + } + + case BTRFS_IOC_QGROUP_LIMIT: { /* R */ + struct btrfs_ioctl_qgroup_limit_args args; + + if (entering(tcp)) + return 0; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprintf("{qgroupid=%" PRI__u64 ", lim=", args.qgroupid); + btrfs_print_qgroup_limit(&args.lim); + tprints("}"); + break; + } + + case BTRFS_IOC_QUOTA_CTL: { /* W */ + struct btrfs_ioctl_quota_ctl_args args; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + printxval64(btrfs_qgroup_ctl_cmds, args.cmd, + "BTRFS_QUOTA_CTL_???"); + tprints("}"); + + break; + } + + case BTRFS_IOC_QUOTA_RESCAN: { /* W */ + struct btrfs_ioctl_quota_rescan_args args; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprintf("{flags=%" PRIu64 "}", (uint64_t) args.flags); + break; + } + + case BTRFS_IOC_QUOTA_RESCAN_STATUS: { /* R */ + struct btrfs_ioctl_quota_rescan_args args; + + if (entering(tcp)) + return 0; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprintf("{flags=%" PRIu64 ", progress=", (uint64_t) args.flags); + btrfs_print_objectid(args.progress); + tprints("}"); + break; + } + + case BTRFS_IOC_SET_RECEIVED_SUBVOL: { /* RW */ + struct_btrfs_ioctl_received_subvol_args args; + char uuid[UUID_STRING_SIZE+1]; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + if (entering(tcp)) { + btrfs_unparse_uuid((unsigned char *)args.uuid, uuid); + tprintf("{uuid=%s, stransid=%" PRIu64 + ", stime=%" PRIu64 ".%u, flags=%" PRIu64 + "}", uuid, (uint64_t) args.stransid, + (uint64_t) args.stime.sec, args.stime.nsec, + (uint64_t) args.flags); + return 0; + } + tprintf("{rtransid=%" PRIu64 ", rtime=%" PRIu64 ".%u}", + (uint64_t) args.rtransid, (uint64_t) args.rtime.sec, + args.rtime.nsec); + break; + } + + case BTRFS_IOC_SCRUB: /* RW */ + case BTRFS_IOC_SCRUB_PROGRESS: { /* RW */ + struct btrfs_ioctl_scrub_args args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + if (entering(tcp)) { + tprintf("{devid=%" PRI__u64, args.devid); + if (code == BTRFS_IOC_SCRUB) { + tprintf(", start=%" PRI__u64 ", end=", + args.start); + tprintf("%" PRI__u64, args.end); + if (args.end == UINT64_MAX) + tprints(" /* UINT64_MAX */"); + tprints(", flags="); + printflags64(btrfs_scrub_flags, args.flags, + "BTRFS_SCRUB_???"); + } + tprints("}"); + return 0; + } + tprintf("{data_extents_scrubbed=%" PRI__u64 + ", tree_extents_scrubbed=%" PRI__u64 + ", data_bytes_scrubbed=%" PRI__u64 + ", tree_bytes_scrubbed=%" PRI__u64 + ", read_errors=%" PRI__u64 + ", csum_errors=%" PRI__u64 + ", verify_errors=%" PRI__u64 + ", no_csum=%" PRI__u64 + ", csum_discards=%" PRI__u64 + ", super_errors=%" PRI__u64 + ", malloc_errors=%" PRI__u64 + ", uncorrectable_errors=%" PRI__u64 + ", corrected_errors=%" PRI__u64 + ", last_physical=%" PRI__u64 + ", unverified_errors=%" PRI__u64 "}", + args.progress.data_extents_scrubbed, + args.progress.tree_extents_scrubbed, + args.progress.data_bytes_scrubbed, + args.progress.tree_bytes_scrubbed, + args.progress.read_errors, + args.progress.csum_errors, + args.progress.verify_errors, + args.progress.no_csum, + args.progress.csum_discards, + args.progress.super_errors, + args.progress.malloc_errors, + args.progress.uncorrectable_errors, + args.progress.corrected_errors, + args.progress.last_physical, + args.progress.unverified_errors); + break; + } + + case BTRFS_IOC_TREE_SEARCH: { /* RW */ + struct btrfs_ioctl_search_args args; + uint64_t buf_offset; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + buf_offset = offsetof(struct btrfs_ioctl_search_args, buf); + btrfs_print_tree_search(tcp, &args.key, arg + buf_offset, + sizeof(args.buf), false); + if (entering(tcp)) + return 0; + break; + } + + case BTRFS_IOC_TREE_SEARCH_V2: { /* RW */ + struct btrfs_ioctl_search_args_v2 args; + uint64_t buf_offset; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) { + if (tcp->u_error == EOVERFLOW) { + tprints(" => "); + tcp->u_error = 0; + if (!umove_or_printaddr(tcp, arg, &args)) + tprintf("{buf_size=%" PRIu64 "}", + (uint64_t)args.buf_size); + tcp->u_error = EOVERFLOW; + } + break; + } else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + buf_offset = offsetof(struct btrfs_ioctl_search_args_v2, buf); + btrfs_print_tree_search(tcp, &args.key, arg + buf_offset, + args.buf_size, true); + if (entering(tcp)) + return 0; + break; + } + + case BTRFS_IOC_SEND: { /* W */ + struct_btrfs_ioctl_send_args args; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{send_fd="); + printfd(tcp, args.send_fd); + tprintf(", clone_sources_count=%" PRIu64 ", clone_sources=", + (uint64_t) args.clone_sources_count); + + if (abbrev(tcp)) + tprints("..."); + else { + uint64_t record; + print_array(tcp, ptr_to_kulong(args.clone_sources), + args.clone_sources_count, + &record, sizeof(record), + umoven_or_printaddr, + print_objectid_callback, 0); + } + tprints(", parent_root="); + btrfs_print_objectid(args.parent_root); + tprints(", flags="); + printflags64(btrfs_send_flags, args.flags, + "BTRFS_SEND_FLAGS_???"); + tprints("}"); + break; + } + + case BTRFS_IOC_SPACE_INFO: { /* RW */ + struct btrfs_ioctl_space_args args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{"); + if (entering(tcp)) { + tprintf("space_slots=%" PRI__u64 "}", args.space_slots); + return 0; + } + + tprintf("total_spaces=%" PRI__u64, args.total_spaces); + + if (args.space_slots == 0 && args.total_spaces) { + tprints("}"); + break; + } + + tprints(", spaces="); + + if (abbrev(tcp)) + tprints("..."); + else { + struct btrfs_ioctl_space_info info; + print_array(tcp, arg + offsetof(typeof(args), spaces), + args.total_spaces, + &info, sizeof(info), umoven_or_printaddr, + print_btrfs_ioctl_space_info, 0); + } + tprints("}"); + break; + } + + case BTRFS_IOC_SNAP_CREATE: + case BTRFS_IOC_RESIZE: + case BTRFS_IOC_SCAN_DEV: + case BTRFS_IOC_ADD_DEV: + case BTRFS_IOC_RM_DEV: + case BTRFS_IOC_SUBVOL_CREATE: + case BTRFS_IOC_SNAP_DESTROY: + case BTRFS_IOC_DEVICES_READY: { /* W */ + struct btrfs_ioctl_vol_args args; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{fd="); + printfd(tcp, args.fd); + tprints(", name="); + print_quoted_string(args.name, sizeof(args.name), + QUOTE_0_TERMINATED); + tprints("}"); + break; + } + + case BTRFS_IOC_SNAP_CREATE_V2: + case BTRFS_IOC_SUBVOL_CREATE_V2: { /* code is W, but is actually RW */ + struct_btrfs_ioctl_vol_args_v2 args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + if (entering(tcp)) { + tprints("{fd="); + printfd(tcp, args.fd); + tprints(", flags="); + printflags64(btrfs_snap_flags_v2, args.flags, + "BTRFS_SUBVOL_???"); + if (args.flags & BTRFS_SUBVOL_QGROUP_INHERIT) { + tprintf(", size=%" PRIu64 ", qgroup_inherit=", + (uint64_t) args.size); + + btrfs_print_qgroup_inherit(tcp, + ptr_to_kulong(args.qgroup_inherit)); + } + tprints(", name="); + print_quoted_string(args.name, sizeof(args.name), + QUOTE_0_TERMINATED); + tprints("}"); + return 0; + } + tprintf("{transid=%" PRIu64 "}", (uint64_t) args.transid); + break; + } + + case BTRFS_IOC_GET_FSLABEL: /* R */ + if (entering(tcp)) + return 0; + /* fall through */ + case BTRFS_IOC_SET_FSLABEL: { /* W */ + char label[BTRFS_LABEL_SIZE]; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &label)) + break; + print_quoted_string(label, sizeof(label), QUOTE_0_TERMINATED); + break; + } + + case BTRFS_IOC_CLONE: /* FICLONE */ + case BTRFS_IOC_CLONE_RANGE: /* FICLONERANGE */ +#ifdef BTRFS_IOC_FILE_EXTENT_SAME + case BTRFS_IOC_FILE_EXTENT_SAME: /* FIDEDUPERANGE */ +#endif + /* + * FICLONE, FICLONERANGE, and FIDEDUPERANGE started out as + * btrfs ioctls and the code was kept for the generic + * implementations. We use the BTRFS_* names here because + * they will be available on older systems. + */ + return file_ioctl(tcp, code, arg); + + default: + return RVAL_DECODED; + }; + return RVAL_DECODED | 1; +} +#endif /* HAVE_LINUX_BTRFS_H */ diff --git a/cacheflush.c b/cacheflush.c new file mode 100644 index 00000000..8c2c05c3 --- /dev/null +++ b/cacheflush.c @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1999 Andreas Schwab + * Copyright (c) 2010 Mike Frysinger + * Copyright (c) 2010 Carmelo Amoroso + * Copyright (c) 2015 Ezequiel Garcia + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_ASM_CACHECTL_H +# include +#endif + +#ifdef M68K +# include "xlat/cacheflush_scope.h" + +static const struct xlat cacheflush_flags[] = { +#ifdef FLUSH_CACHE_BOTH + XLAT(FLUSH_CACHE_BOTH), +#endif +#ifdef FLUSH_CACHE_DATA + XLAT(FLUSH_CACHE_DATA), +#endif +#ifdef FLUSH_CACHE_INSN + XLAT(FLUSH_CACHE_INSN), +#endif + XLAT_END +}; + +SYS_FUNC(cacheflush) +{ + /* addr */ + printaddr(tcp->u_arg[0]); + tprints(", "); + /* scope */ + printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???"); + tprints(", "); + /* flags */ + printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???"); + /* len */ + tprintf(", %lu", tcp->u_arg[3]); + + return RVAL_DECODED; +} +#endif /* M68K */ + +#ifdef BFIN +static const struct xlat cacheflush_flags[] = { + XLAT(ICACHE), + XLAT(DCACHE), + XLAT(BCACHE), + XLAT_END +}; + +SYS_FUNC(cacheflush) +{ + /* start addr */ + printaddr(tcp->u_arg[0]); + /* length */ + tprintf(", %lu, ", tcp->u_arg[1]); + /* flags */ + printxval(cacheflush_flags, tcp->u_arg[2], "?CACHE"); + + return RVAL_DECODED; +} +#endif /* BFIN */ + +#ifdef SH +static const struct xlat cacheflush_flags[] = { +#ifdef CACHEFLUSH_D_INVAL + XLAT(CACHEFLUSH_D_INVAL), +#endif +#ifdef CACHEFLUSH_D_WB + XLAT(CACHEFLUSH_D_WB), +#endif +#ifdef CACHEFLUSH_D_PURGE + XLAT(CACHEFLUSH_D_PURGE), +#endif +#ifdef CACHEFLUSH_I + XLAT(CACHEFLUSH_I), +#endif + XLAT_END +}; + +SYS_FUNC(cacheflush) +{ + /* addr */ + printaddr(tcp->u_arg[0]); + /* len */ + tprintf(", %lu, ", tcp->u_arg[1]); + /* flags */ + printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???"); + + return RVAL_DECODED; +} +#endif /* SH */ + +#ifdef NIOS2 +SYS_FUNC(cacheflush) +{ + /* addr */ + printaddr(tcp->u_arg[0]); + /* len */ + tprintf(", %lu, ", tcp->u_arg[3]); + /* scope and flags (cache type) are currently ignored */ + + return RVAL_DECODED; +} +#endif /* NIOS2 */ diff --git a/capability.c b/capability.c new file mode 100644 index 00000000..a3f06ea3 --- /dev/null +++ b/capability.c @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2000 Wichert Akkerman + * Copyright (c) 2011 Denys Vlasenko + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +/* these constants are the same as in */ +enum { +#include "caps0.h" +}; + +#include "xlat/cap_mask0.h" + +/* these constants are CAP_TO_INDEX'ed constants from */ +enum { +#include "caps1.h" +}; + +#include "xlat/cap_mask1.h" + +/* these constants are the same as in */ +enum { + _LINUX_CAPABILITY_VERSION_1 = 0x19980330, + _LINUX_CAPABILITY_VERSION_2 = 0x20071026, + _LINUX_CAPABILITY_VERSION_3 = 0x20080522 +}; + +#include "xlat/cap_version.h" + +struct user_cap_header_struct { + uint32_t version; + int pid; +}; + +struct user_cap_data_struct { + uint32_t effective; + uint32_t permitted; + uint32_t inheritable; +}; + +static const struct user_cap_header_struct * +get_cap_header(struct tcb *const tcp, const kernel_ulong_t addr) +{ + static struct user_cap_header_struct header; + + if (!addr || !verbose(tcp)) + return NULL; + + if (umove(tcp, addr, &header) < 0) + return NULL; + + return &header; +} + +static void +print_cap_header(struct tcb *const tcp, const kernel_ulong_t addr, + const struct user_cap_header_struct *const h) +{ + if (!addr || !h) { + printaddr(addr); + return; + } + + tprints("{version="); + printxval(cap_version, h->version, + "_LINUX_CAPABILITY_VERSION_???"); + tprintf(", pid=%d}", h->pid); +} + +static void +print_cap_bits(const uint32_t lo, const uint32_t hi) +{ + if (lo || !hi) + printflags(cap_mask0, lo, "CAP_???"); + + if (hi) { + if (lo) + tprints("|"); + printflags(cap_mask1, hi, "CAP_???"); + } +} + +static void +print_cap_data(struct tcb *const tcp, const kernel_ulong_t addr, + const struct user_cap_header_struct *const h) +{ + struct user_cap_data_struct data[2]; + unsigned int len; + + if (!addr || !h) { + printaddr(addr); + return; + } + + if (_LINUX_CAPABILITY_VERSION_2 == h->version || + _LINUX_CAPABILITY_VERSION_3 == h->version) + len = 2; + else + len = 1; + + if (umoven_or_printaddr(tcp, addr, len * sizeof(data[0]), data)) + return; + + tprints("{effective="); + print_cap_bits(data[0].effective, len > 1 ? data[1].effective : 0); + tprints(", permitted="); + print_cap_bits(data[0].permitted, len > 1 ? data[1].permitted : 0); + tprints(", inheritable="); + print_cap_bits(data[0].inheritable, len > 1 ? data[1].inheritable : 0); + tprints("}"); +} + +SYS_FUNC(capget) +{ + const struct user_cap_header_struct *h; + + if (entering(tcp)) { + h = get_cap_header(tcp, tcp->u_arg[0]); + print_cap_header(tcp, tcp->u_arg[0], h); + tprints(", "); + } else { + h = syserror(tcp) ? NULL : get_cap_header(tcp, tcp->u_arg[0]); + print_cap_data(tcp, tcp->u_arg[1], h); + } + return 0; +} + +SYS_FUNC(capset) +{ + const struct user_cap_header_struct *const h = + get_cap_header(tcp, tcp->u_arg[0]); + print_cap_header(tcp, tcp->u_arg[0], h); + tprints(", "); + print_cap_data(tcp, tcp->u_arg[1], h); + + return RVAL_DECODED; +} diff --git a/caps0.h b/caps0.h new file mode 100644 index 00000000..ad206ffa --- /dev/null +++ b/caps0.h @@ -0,0 +1,32 @@ +CAP_CHOWN, +CAP_DAC_OVERRIDE, +CAP_DAC_READ_SEARCH, +CAP_FOWNER, +CAP_FSETID, +CAP_KILL, +CAP_SETGID, +CAP_SETUID, +CAP_SETPCAP, +CAP_LINUX_IMMUTABLE, +CAP_NET_BIND_SERVICE, +CAP_NET_BROADCAST, +CAP_NET_ADMIN, +CAP_NET_RAW, +CAP_IPC_LOCK, +CAP_IPC_OWNER, +CAP_SYS_MODULE, +CAP_SYS_RAWIO, +CAP_SYS_CHROOT, +CAP_SYS_PTRACE, +CAP_SYS_PACCT, +CAP_SYS_ADMIN, +CAP_SYS_BOOT, +CAP_SYS_NICE, +CAP_SYS_RESOURCE, +CAP_SYS_TIME, +CAP_SYS_TTY_CONFIG, +CAP_MKNOD, +CAP_LEASE, +CAP_AUDIT_WRITE, +CAP_AUDIT_CONTROL, +CAP_SETFCAP, diff --git a/caps1.h b/caps1.h new file mode 100644 index 00000000..d8fa6f47 --- /dev/null +++ b/caps1.h @@ -0,0 +1,6 @@ +CAP_MAC_OVERRIDE, +CAP_MAC_ADMIN, +CAP_SYSLOG, +CAP_WAKE_ALARM, +CAP_BLOCK_SUSPEND, +CAP_AUDIT_READ, diff --git a/chdir.c b/chdir.c new file mode 100644 index 00000000..e8ac2858 --- /dev/null +++ b/chdir.c @@ -0,0 +1,8 @@ +#include "defs.h" + +SYS_FUNC(chdir) +{ + printpath(tcp, tcp->u_arg[0]); + + return RVAL_DECODED; +} diff --git a/chmod.c b/chmod.c new file mode 100644 index 00000000..fd76490c --- /dev/null +++ b/chmod.c @@ -0,0 +1,33 @@ +#include "defs.h" + +static void +decode_chmod(struct tcb *tcp, const int offset) +{ + printpath(tcp, tcp->u_arg[offset]); + tprints(", "); + print_numeric_umode_t(tcp->u_arg[offset + 1]); +} + +SYS_FUNC(chmod) +{ + decode_chmod(tcp, 0); + + return RVAL_DECODED; +} + +SYS_FUNC(fchmodat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + decode_chmod(tcp, 1); + + return RVAL_DECODED; +} + +SYS_FUNC(fchmod) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + print_numeric_umode_t(tcp->u_arg[1]); + + return RVAL_DECODED; +} diff --git a/clone.c b/clone.c new file mode 100644 index 00000000..5c60fbe4 --- /dev/null +++ b/clone.c @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1999-2000 Wichert Akkerman + * Copyright (c) 2002-2005 Roland McGrath + * Copyright (c) 2008 Jan Kratochvil + * Copyright (c) 2009-2013 Denys Vlasenko + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include + +#ifndef CSIGNAL +# define CSIGNAL 0x000000ff +#endif + +#include "xlat/clone_flags.h" +#include "xlat/setns_types.h" +#include "xlat/unshare_flags.h" + +#if defined IA64 +# define ARG_FLAGS 0 +# define ARG_STACK 1 +# define ARG_STACKSIZE (tcp->scno == __NR_clone2 ? 2 : -1) +# define ARG_PTID (tcp->scno == __NR_clone2 ? 3 : 2) +# define ARG_CTID (tcp->scno == __NR_clone2 ? 4 : 3) +# define ARG_TLS (tcp->scno == __NR_clone2 ? 5 : 4) +#elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32 +# define ARG_STACK 0 +# define ARG_FLAGS 1 +# define ARG_PTID 2 +# define ARG_CTID 3 +# define ARG_TLS 4 +#elif defined X86_64 || defined X32 +/* x86 personality processes have the last two arguments flipped. */ +# define ARG_FLAGS 0 +# define ARG_STACK 1 +# define ARG_PTID 2 +# define ARG_CTID ((current_personality != 1) ? 3 : 4) +# define ARG_TLS ((current_personality != 1) ? 4 : 3) +#elif defined ALPHA || defined TILE || defined OR1K || defined RISCV +# define ARG_FLAGS 0 +# define ARG_STACK 1 +# define ARG_PTID 2 +# define ARG_CTID 3 +# define ARG_TLS 4 +#else +# define ARG_FLAGS 0 +# define ARG_STACK 1 +# define ARG_PTID 2 +# define ARG_TLS 3 +# define ARG_CTID 4 +#endif + +static void +print_tls_arg(struct tcb *const tcp, const kernel_ulong_t addr) +{ +#ifdef HAVE_STRUCT_USER_DESC +# if SUPPORTED_PERSONALITIES > 1 + if (current_personality == 1) +# endif + { + print_user_desc(tcp, tcp->u_arg[ARG_TLS]); + } +# if SUPPORTED_PERSONALITIES > 1 + else +# endif +#endif /* HAVE_STRUCT_USER_DESC */ + { + printaddr(tcp->u_arg[ARG_TLS]); + } +} + +SYS_FUNC(clone) +{ + if (exiting(tcp)) { + const char *sep = "|"; + kernel_ulong_t flags = tcp->u_arg[ARG_FLAGS]; + tprints("child_stack="); + printaddr(tcp->u_arg[ARG_STACK]); + tprints(", "); +#ifdef ARG_STACKSIZE + if (ARG_STACKSIZE != -1) + tprintf("stack_size=%#" PRI_klx ", ", + tcp->u_arg[ARG_STACKSIZE]); +#endif + tprints("flags="); + if (!printflags64(clone_flags, flags &~ CSIGNAL, NULL)) + sep = ""; + if ((flags & CSIGNAL) != 0) + tprintf("%s%s", sep, signame(flags & CSIGNAL)); + if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID + |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0) + return 0; + if (flags & CLONE_PARENT_SETTID) { + tprints(", parent_tidptr="); + printaddr(tcp->u_arg[ARG_PTID]); + } + if (flags & CLONE_SETTLS) { + tprints(", tls="); + print_tls_arg(tcp, tcp->u_arg[ARG_TLS]); + } + if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID)) { + tprints(", child_tidptr="); + printaddr(tcp->u_arg[ARG_CTID]); + } + } + /* TODO on syscall entry: + * We can clear CLONE_PTRACE here since it is an ancient hack + * to allow us to catch children, and we use another hack for that. + * But CLONE_PTRACE can conceivably be used by malicious programs + * to subvert us. By clearing this bit, we can defend against it: + * in untraced execution, CLONE_PTRACE should have no effect. + * + * We can also clear CLONE_UNTRACED, since it allows to start + * children outside of our control. At the moment + * I'm trying to figure out whether there is a *legitimate* + * use of this flag which we should respect. + */ + return 0; +} + +SYS_FUNC(setns) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printxval(setns_types, tcp->u_arg[1], "CLONE_NEW???"); + + return RVAL_DECODED; +} + +SYS_FUNC(unshare) +{ + printflags64(unshare_flags, tcp->u_arg[0], "CLONE_???"); + return RVAL_DECODED; +} + +SYS_FUNC(fork) +{ + return RVAL_DECODED | RVAL_UDECIMAL; +} diff --git a/config.guess b/config.guess index 72625d40..3c022c5b 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-02-12' +timestamp='2015-09-14' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2014-02-12' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -235,6 +249,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -579,8 +596,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +844,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -932,6 +950,9 @@ EOF crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -944,6 +965,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -969,10 +993,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1020,7 +1044,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} diff --git a/config.h.in b/config.h.in index f8b62665..8b335f8b 100644 --- a/config.h.in +++ b/config.h.in @@ -18,6 +18,9 @@ /* SA_RESTORER defined in */ #undef ASM_SA_RESTORER +/* SIGRTMIN defined in */ +#undef ASM_SIGRTMIN + /* Define for the AVR32 architecture. */ #undef AVR32 @@ -33,9 +36,8 @@ /* Define to 1 if you want OABI support on ARM EABI. */ #undef ENABLE_ARM_OABI -/* Define to the type of elements in the array set by `getgroups'. Usually - this is either `int' or `gid_t'. */ -#undef GETGROUPS_T +/* Define to 1 if you have the `accept4' function. */ +#undef HAVE_ACCEPT4 /* Define to 1 if you have the header file. */ #undef HAVE_ASM_CACHECTL_H @@ -49,46 +51,29 @@ /* Define to 1 if you have BLKGETSIZE64. */ #undef HAVE_BLKGETSIZE64 -/* Define to 1 if you have the declaration of `CTL_ABI', and to 0 if you - don't. */ -#undef HAVE_DECL_CTL_ABI - -/* Define to 1 if you have the declaration of `CTL_ARLAN', and to 0 if you - don't. */ -#undef HAVE_DECL_CTL_ARLAN +/* Define to 1 if you have the header file. */ +#undef HAVE_BLUETOOTH_BLUETOOTH_H -/* Define to 1 if you have the declaration of `CTL_BUS', and to 0 if you - don't. */ -#undef HAVE_DECL_CTL_BUS +/* Define to 1 if you have the declaration of `BTRFS_COMPRESS_LZO', and to 0 + if you don't. */ +#undef HAVE_DECL_BTRFS_COMPRESS_LZO -/* Define to 1 if you have the declaration of `CTL_CPU', and to 0 if you - don't. */ -#undef HAVE_DECL_CTL_CPU +/* Define to 1 if you have the declaration of `BTRFS_COMPRESS_NONE', and to 0 + if you don't. */ +#undef HAVE_DECL_BTRFS_COMPRESS_NONE -/* Define to 1 if you have the declaration of `CTL_DEBUG', and to 0 if you - don't. */ -#undef HAVE_DECL_CTL_DEBUG +/* Define to 1 if you have the declaration of `BTRFS_COMPRESS_ZLIB', and to 0 + if you don't. */ +#undef HAVE_DECL_BTRFS_COMPRESS_ZLIB -/* Define to 1 if you have the declaration of `CTL_DEV', and to 0 if you +/* Define to 1 if you have the declaration of `CTL_ARLAN', and to 0 if you don't. */ -#undef HAVE_DECL_CTL_DEV +#undef HAVE_DECL_CTL_ARLAN /* Define to 1 if you have the declaration of `CTL_FRV', and to 0 if you don't. */ #undef HAVE_DECL_CTL_FRV -/* Define to 1 if you have the declaration of `CTL_FS', and to 0 if you don't. - */ -#undef HAVE_DECL_CTL_FS - -/* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you - don't. */ -#undef HAVE_DECL_CTL_KERN - -/* Define to 1 if you have the declaration of `CTL_NET', and to 0 if you - don't. */ -#undef HAVE_DECL_CTL_NET - /* Define to 1 if you have the declaration of `CTL_PM', and to 0 if you don't. */ #undef HAVE_DECL_CTL_PM @@ -105,14 +90,6 @@ don't. */ #undef HAVE_DECL_CTL_SUNRPC -/* Define to 1 if you have the declaration of `CTL_VM', and to 0 if you don't. - */ -#undef HAVE_DECL_CTL_VM - -/* Define to 1 if you have the declaration of `KERN_ACCT', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_ACCT - /* Define to 1 if you have the declaration of `KERN_ACPI_VIDEO_FLAGS', and to 0 if you don't. */ #undef HAVE_DECL_KERN_ACPI_VIDEO_FLAGS @@ -121,42 +98,10 @@ if you don't. */ #undef HAVE_DECL_KERN_BOOTLOADER_TYPE -/* Define to 1 if you have the declaration of `KERN_CADPID', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_CADPID - /* Define to 1 if you have the declaration of `KERN_COMPAT_LOG', and to 0 if you don't. */ #undef HAVE_DECL_KERN_COMPAT_LOG -/* Define to 1 if you have the declaration of `KERN_CORE_PATTERN', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_CORE_PATTERN - -/* Define to 1 if you have the declaration of `KERN_CORE_USES_PID', and to 0 - if you don't. */ -#undef HAVE_DECL_KERN_CORE_USES_PID - -/* Define to 1 if you have the declaration of `KERN_CTLALTDEL', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_CTLALTDEL - -/* Define to 1 if you have the declaration of `KERN_DOMAINNAME', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_DOMAINNAME - -/* Define to 1 if you have the declaration of `KERN_HOTPLUG', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_HOTPLUG - -/* Define to 1 if you have the declaration of `KERN_HPPA_PWRSW', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_HPPA_PWRSW - -/* Define to 1 if you have the declaration of `KERN_HPPA_UNALIGNED', and to 0 - if you don't. */ -#undef HAVE_DECL_KERN_HPPA_UNALIGNED - /* Define to 1 if you have the declaration of `KERN_HZ_TIMER', and to 0 if you don't. */ #undef HAVE_DECL_KERN_HZ_TIMER @@ -165,42 +110,10 @@ if you don't. */ #undef HAVE_DECL_KERN_IA64_UNALIGNED -/* Define to 1 if you have the declaration of `KERN_IEEE_EMULATION_WARNINGS', - and to 0 if you don't. */ -#undef HAVE_DECL_KERN_IEEE_EMULATION_WARNINGS - /* Define to 1 if you have the declaration of `KERN_MAX_LOCK_DEPTH', and to 0 if you don't. */ #undef HAVE_DECL_KERN_MAX_LOCK_DEPTH -/* Define to 1 if you have the declaration of `KERN_MAX_THREADS', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_MAX_THREADS - -/* Define to 1 if you have the declaration of `KERN_MODPROBE', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_MODPROBE - -/* Define to 1 if you have the declaration of `KERN_MSGMAX', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_MSGMAX - -/* Define to 1 if you have the declaration of `KERN_MSGMNB', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_MSGMNB - -/* Define to 1 if you have the declaration of `KERN_MSGMNI', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_MSGMNI - -/* Define to 1 if you have the declaration of `KERN_MSGPOOL', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_MSGPOOL - -/* Define to 1 if you have the declaration of `KERN_NAMETRANS', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_NAMETRANS - /* Define to 1 if you have the declaration of `KERN_NGROUPS_MAX', and to 0 if you don't. */ #undef HAVE_DECL_KERN_NGROUPS_MAX @@ -209,66 +122,10 @@ you don't. */ #undef HAVE_DECL_KERN_NMI_WATCHDOG -/* Define to 1 if you have the declaration of `KERN_NODENAME', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_NODENAME - -/* Define to 1 if you have the declaration of `KERN_OSRELEASE', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_OSRELEASE - -/* Define to 1 if you have the declaration of `KERN_OSREV', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_OSREV - -/* Define to 1 if you have the declaration of `KERN_OSTYPE', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_OSTYPE - -/* Define to 1 if you have the declaration of `KERN_OVERFLOWGID', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_OVERFLOWGID - -/* Define to 1 if you have the declaration of `KERN_OVERFLOWUID', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_OVERFLOWUID - -/* Define to 1 if you have the declaration of `KERN_PANIC', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_PANIC - /* Define to 1 if you have the declaration of `KERN_PANIC_ON_NMI', and to 0 if you don't. */ #undef HAVE_DECL_KERN_PANIC_ON_NMI -/* Define to 1 if you have the declaration of `KERN_PANIC_ON_OOPS', and to 0 - if you don't. */ -#undef HAVE_DECL_KERN_PANIC_ON_OOPS - -/* Define to 1 if you have the declaration of `KERN_PIDMAX', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_PIDMAX - -/* Define to 1 if you have the declaration of `KERN_PPC_HTABRECLAIM', and to 0 - if you don't. */ -#undef HAVE_DECL_KERN_PPC_HTABRECLAIM - -/* Define to 1 if you have the declaration of `KERN_PPC_L2CR', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_PPC_L2CR - -/* Define to 1 if you have the declaration of `KERN_PPC_POWERSAVE_NAP', and to - 0 if you don't. */ -#undef HAVE_DECL_KERN_PPC_POWERSAVE_NAP - -/* Define to 1 if you have the declaration of `KERN_PPC_ZEROPAGED', and to 0 - if you don't. */ -#undef HAVE_DECL_KERN_PPC_ZEROPAGED - -/* Define to 1 if you have the declaration of `KERN_PRINTK', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_PRINTK - /* Define to 1 if you have the declaration of `KERN_PRINTK_RATELIMIT', and to 0 if you don't. */ #undef HAVE_DECL_KERN_PRINTK_RATELIMIT @@ -277,106 +134,38 @@ and to 0 if you don't. */ #undef HAVE_DECL_KERN_PRINTK_RATELIMIT_BURST -/* Define to 1 if you have the declaration of `KERN_PROF', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_PROF - /* Define to 1 if you have the declaration of `KERN_PTY', and to 0 if you don't. */ #undef HAVE_DECL_KERN_PTY -/* Define to 1 if you have the declaration of `KERN_RANDOM', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_RANDOM - /* Define to 1 if you have the declaration of `KERN_RANDOMIZE', and to 0 if you don't. */ #undef HAVE_DECL_KERN_RANDOMIZE -/* Define to 1 if you have the declaration of `KERN_REALROOTDEV', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_REALROOTDEV - -/* Define to 1 if you have the declaration of `KERN_RTSIGMAX', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_RTSIGMAX - -/* Define to 1 if you have the declaration of `KERN_RTSIGNR', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_RTSIGNR - -/* Define to 1 if you have the declaration of `KERN_S390_USER_DEBUG_LOGGING', - and to 0 if you don't. */ -#undef HAVE_DECL_KERN_S390_USER_DEBUG_LOGGING - -/* Define to 1 if you have the declaration of `KERN_SECUREMASK', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_SECUREMASK - -/* Define to 1 if you have the declaration of `KERN_SEM', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_SEM - /* Define to 1 if you have the declaration of `KERN_SETUID_DUMPABLE', and to 0 if you don't. */ #undef HAVE_DECL_KERN_SETUID_DUMPABLE -/* Define to 1 if you have the declaration of `KERN_SG_BIG_BUFF', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_SG_BIG_BUFF - -/* Define to 1 if you have the declaration of `KERN_SHMALL', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_SHMALL - -/* Define to 1 if you have the declaration of `KERN_SHMMAX', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_SHMMAX - -/* Define to 1 if you have the declaration of `KERN_SHMMNI', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_SHMMNI - -/* Define to 1 if you have the declaration of `KERN_SHMPATH', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_SHMPATH - -/* Define to 1 if you have the declaration of `KERN_SPARC_REBOOT', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_SPARC_REBOOT - /* Define to 1 if you have the declaration of `KERN_SPARC_SCONS_PWROFF', and to 0 if you don't. */ #undef HAVE_DECL_KERN_SPARC_SCONS_PWROFF -/* Define to 1 if you have the declaration of `KERN_SPARC_STOP_A', and to 0 if - you don't. */ -#undef HAVE_DECL_KERN_SPARC_STOP_A - /* Define to 1 if you have the declaration of `KERN_SPIN_RETRY', and to 0 if you don't. */ #undef HAVE_DECL_KERN_SPIN_RETRY -/* Define to 1 if you have the declaration of `KERN_SYSRQ', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_SYSRQ - -/* Define to 1 if you have the declaration of `KERN_TAINTED', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_TAINTED - /* Define to 1 if you have the declaration of `KERN_UNKNOWN_NMI_PANIC', and to 0 if you don't. */ #undef HAVE_DECL_KERN_UNKNOWN_NMI_PANIC -/* Define to 1 if you have the declaration of `KERN_VERSION', and to 0 if you - don't. */ -#undef HAVE_DECL_KERN_VERSION - /* Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR', and to 0 if you don't. */ #undef HAVE_DECL_LO_FLAGS_AUTOCLEAR +/* Define to 1 if you have the declaration of `LO_FLAGS_DIRECT_IO', and to 0 + if you don't. */ +#undef HAVE_DECL_LO_FLAGS_DIRECT_IO + /* Define to 1 if you have the declaration of `LO_FLAGS_PARTSCAN', and to 0 if you don't. */ #undef HAVE_DECL_LO_FLAGS_PARTSCAN @@ -385,21 +174,9 @@ if you don't. */ #undef HAVE_DECL_LO_FLAGS_READ_ONLY -/* Define to 1 if you have the declaration of `NET_802', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_802 - -/* Define to 1 if you have the declaration of `NET_ATALK', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_ATALK - -/* Define to 1 if you have the declaration of `NET_AX25', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_AX25 - -/* Define to 1 if you have the declaration of `NET_BRIDGE', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_BRIDGE +/* Define to 1 if you have the declaration of `LO_FLAGS_USE_AOPS', and to 0 if + you don't. */ +#undef HAVE_DECL_LO_FLAGS_USE_AOPS /* Define to 1 if you have the declaration of `NET_CIPSOV4_CACHE_BUCKET_SIZE', and to 0 if you don't. */ @@ -417,10 +194,6 @@ and to 0 if you don't. */ #undef HAVE_DECL_NET_CIPSOV4_RBM_STRICTVALID -/* Define to 1 if you have the declaration of `NET_CORE', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_CORE - /* Define to 1 if you have the declaration of `NET_CORE_AEVENT_ETIME', and to 0 if you don't. */ #undef HAVE_DECL_NET_CORE_AEVENT_ETIME @@ -437,122 +210,14 @@ 0 if you don't. */ #undef HAVE_DECL_NET_CORE_DESTROY_DELAY -/* Define to 1 if you have the declaration of `NET_CORE_DEV_WEIGHT', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_CORE_DEV_WEIGHT - -/* Define to 1 if you have the declaration of `NET_CORE_DIVERT_VERSION', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_CORE_DIVERT_VERSION - -/* Define to 1 if you have the declaration of `NET_CORE_FASTROUTE', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_CORE_FASTROUTE - -/* Define to 1 if you have the declaration of `NET_CORE_HOT_LIST_LENGTH', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_CORE_HOT_LIST_LENGTH - -/* Define to 1 if you have the declaration of `NET_CORE_LO_CONG', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_CORE_LO_CONG - -/* Define to 1 if you have the declaration of `NET_CORE_MAX_BACKLOG', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_CORE_MAX_BACKLOG - -/* Define to 1 if you have the declaration of `NET_CORE_MOD_CONG', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_CORE_MOD_CONG - -/* Define to 1 if you have the declaration of `NET_CORE_MSG_BURST', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_CORE_MSG_BURST - -/* Define to 1 if you have the declaration of `NET_CORE_MSG_COST', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_CORE_MSG_COST - -/* Define to 1 if you have the declaration of `NET_CORE_NO_CONG', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_CORE_NO_CONG - -/* Define to 1 if you have the declaration of `NET_CORE_NO_CONG_THRESH', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_CORE_NO_CONG_THRESH - -/* Define to 1 if you have the declaration of `NET_CORE_OPTMEM_MAX', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_CORE_OPTMEM_MAX - -/* Define to 1 if you have the declaration of `NET_CORE_RMEM_DEFAULT', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_CORE_RMEM_DEFAULT - -/* Define to 1 if you have the declaration of `NET_CORE_RMEM_MAX', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_CORE_RMEM_MAX - -/* Define to 1 if you have the declaration of `NET_CORE_SOMAXCONN', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_CORE_SOMAXCONN - /* Define to 1 if you have the declaration of `NET_CORE_WARNINGS', and to 0 if you don't. */ #undef HAVE_DECL_NET_CORE_WARNINGS -/* Define to 1 if you have the declaration of `NET_CORE_WMEM_DEFAULT', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_CORE_WMEM_DEFAULT - -/* Define to 1 if you have the declaration of `NET_CORE_WMEM_MAX', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_CORE_WMEM_MAX - /* Define to 1 if you have the declaration of `NET_DCCP', and to 0 if you don't. */ #undef HAVE_DECL_NET_DCCP -/* Define to 1 if you have the declaration of `NET_DECNET', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_DECNET - -/* Define to 1 if you have the declaration of `NET_ECONET', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_ECONET - -/* Define to 1 if you have the declaration of `NET_ETHER', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_ETHER - -/* Define to 1 if you have the declaration of `NET_IPV4', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_IPV4 - -/* Define to 1 if you have the declaration of `NET_IPV4_ALWAYS_DEFRAG', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ALWAYS_DEFRAG - -/* Define to 1 if you have the declaration of `NET_IPV4_AUTOCONFIG', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV4_AUTOCONFIG - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_IPV4_CONF - -/* Define to 1 if you have the declaration of - `NET_IPV4_CONF_ACCEPT_REDIRECTS', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_ACCEPT_REDIRECTS - -/* Define to 1 if you have the declaration of - `NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_ARPFILTER', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_ARPFILTER - /* Define to 1 if you have the declaration of `NET_IPV4_CONF_ARP_ACCEPT', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_CONF_ARP_ACCEPT @@ -569,418 +234,42 @@ to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_CONF_ARP_NOTIFY -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_BOOTP_RELAY', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_BOOTP_RELAY - /* Define to 1 if you have the declaration of `NET_IPV4_CONF_FORCE_IGMP_VERSION', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_CONF_FORCE_IGMP_VERSION -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_FORWARDING', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_FORWARDING - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_LOG_MARTIANS', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_LOG_MARTIANS - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_MC_FORWARDING', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_MC_FORWARDING - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_MEDIUM_ID', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_MEDIUM_ID - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_NOPOLICY', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_NOPOLICY - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_NOXFRM', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_NOXFRM - /* Define to 1 if you have the declaration of `NET_IPV4_CONF_PROMOTE_SECONDARIES', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_CONF_PROMOTE_SECONDARIES -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_PROXY_ARP', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_PROXY_ARP - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_RP_FILTER', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_RP_FILTER - -/* Define to 1 if you have the declaration of - `NET_IPV4_CONF_SECURE_REDIRECTS', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_SECURE_REDIRECTS - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_SEND_REDIRECTS', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_SEND_REDIRECTS - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_SHARED_MEDIA', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_SHARED_MEDIA - -/* Define to 1 if you have the declaration of `NET_IPV4_CONF_TAG', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV4_CONF_TAG - -/* Define to 1 if you have the declaration of `NET_IPV4_DEFAULT_TTL', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV4_DEFAULT_TTL - -/* Define to 1 if you have the declaration of `NET_IPV4_DYNADDR', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV4_DYNADDR - -/* Define to 1 if you have the declaration of `NET_IPV4_FIB_HASH', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV4_FIB_HASH - -/* Define to 1 if you have the declaration of `NET_IPV4_FORWARD', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV4_FORWARD - -/* Define to 1 if you have the declaration of - `NET_IPV4_ICMP_DESTUNREACH_RATE', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_DESTUNREACH_RATE - -/* Define to 1 if you have the declaration of `NET_IPV4_ICMP_ECHOREPLY_RATE', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_ECHOREPLY_RATE - -/* Define to 1 if you have the declaration of `NET_IPV4_ICMP_ECHO_IGNORE_ALL', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_ALL - -/* Define to 1 if you have the declaration of - `NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS - /* Define to 1 if you have the declaration of `NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR -/* Define to 1 if you have the declaration of - `NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES - -/* Define to 1 if you have the declaration of `NET_IPV4_ICMP_PARAMPROB_RATE', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_PARAMPROB_RATE - -/* Define to 1 if you have the declaration of `NET_IPV4_ICMP_RATELIMIT', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_RATELIMIT - -/* Define to 1 if you have the declaration of `NET_IPV4_ICMP_RATEMASK', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_RATEMASK - -/* Define to 1 if you have the declaration of - `NET_IPV4_ICMP_SOURCEQUENCH_RATE', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_SOURCEQUENCH_RATE - -/* Define to 1 if you have the declaration of `NET_IPV4_ICMP_TIMEEXCEED_RATE', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ICMP_TIMEEXCEED_RATE - -/* Define to 1 if you have the declaration of `NET_IPV4_IGMP_MAX_MEMBERSHIPS', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_IGMP_MAX_MEMBERSHIPS - /* Define to 1 if you have the declaration of `NET_IPV4_IGMP_MAX_MSF', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_IGMP_MAX_MSF -/* Define to 1 if you have the declaration of `NET_IPV4_INET_PEER_GC_MAXTIME', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_INET_PEER_GC_MAXTIME - -/* Define to 1 if you have the declaration of `NET_IPV4_INET_PEER_GC_MINTIME', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_INET_PEER_GC_MINTIME - -/* Define to 1 if you have the declaration of `NET_IPV4_INET_PEER_MAXTTL', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_INET_PEER_MAXTTL - -/* Define to 1 if you have the declaration of `NET_IPV4_INET_PEER_MINTTL', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_INET_PEER_MINTTL - -/* Define to 1 if you have the declaration of `NET_IPV4_INET_PEER_THRESHOLD', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_INET_PEER_THRESHOLD - -/* Define to 1 if you have the declaration of `NET_IPV4_IPFRAG_HIGH_THRESH', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_IPFRAG_HIGH_THRESH - -/* Define to 1 if you have the declaration of `NET_IPV4_IPFRAG_LOW_THRESH', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_IPFRAG_LOW_THRESH - /* Define to 1 if you have the declaration of `NET_IPV4_IPFRAG_MAX_DIST', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_IPFRAG_MAX_DIST -/* Define to 1 if you have the declaration of - `NET_IPV4_IPFRAG_SECRET_INTERVAL', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_IPFRAG_SECRET_INTERVAL - -/* Define to 1 if you have the declaration of `NET_IPV4_IPFRAG_TIME', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV4_IPFRAG_TIME - -/* Define to 1 if you have the declaration of `NET_IPV4_IP_MASQ_DEBUG', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_IP_MASQ_DEBUG - -/* Define to 1 if you have the declaration of `NET_IPV4_LOCAL_PORT_RANGE', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_LOCAL_PORT_RANGE - -/* Define to 1 if you have the declaration of `NET_IPV4_NEIGH', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV4_NEIGH - -/* Define to 1 if you have the declaration of `NET_IPV4_NETFILTER', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV4_NETFILTER - -/* Define to 1 if you have the declaration of `NET_IPV4_NONLOCAL_BIND', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_NONLOCAL_BIND - -/* Define to 1 if you have the declaration of `NET_IPV4_NO_PMTU_DISC', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_NO_PMTU_DISC - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_ERROR_BURST', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_ERROR_BURST - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_ERROR_COST', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_ERROR_COST - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_FLUSH', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_FLUSH - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_GC_ELASTICITY', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_GC_ELASTICITY - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_GC_INTERVAL', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_GC_INTERVAL - -/* Define to 1 if you have the declaration of - `NET_IPV4_ROUTE_GC_MIN_INTERVAL', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL - /* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_GC_THRESH', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_GC_THRESH - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_GC_TIMEOUT', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_GC_TIMEOUT - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_MAX_DELAY', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_MAX_DELAY - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_MAX_SIZE', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_MAX_SIZE - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_MIN_ADVMSS', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_MIN_ADVMSS - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_MIN_DELAY', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_MIN_DELAY - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_MIN_PMTU', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_MIN_PMTU - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_MTU_EXPIRES', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_MTU_EXPIRES - -/* Define to 1 if you have the declaration of `NET_IPV4_ROUTE_REDIRECT_LOAD', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_LOAD - -/* Define to 1 if you have the declaration of - `NET_IPV4_ROUTE_REDIRECT_NUMBER', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_NUMBER - -/* Define to 1 if you have the declaration of - `NET_IPV4_ROUTE_REDIRECT_SILENCE', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_SILENCE - -/* Define to 1 if you have the declaration of - `NET_IPV4_ROUTE_SECRET_INTERVAL', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_ROUTE_SECRET_INTERVAL - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_FIN_TIMEOUT', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_FIN_TIMEOUT - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_KEEPALIVE_INTVL', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_INTVL - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_KEEPALIVE_PROBES', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_PROBES - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_KEEPALIVE_TIME', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_TIME - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_MAX_KA_PROBES', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_MAX_KA_PROBES - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_RETRANS_COLLAPSE', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_RETRANS_COLLAPSE - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_RETRIES1', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_RETRIES1 - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_RETRIES2', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_RETRIES2 - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_SACK', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_SACK - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_SYN_RETRIES', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_SYN_RETRIES - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_TIMESTAMPS', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_TIMESTAMPS - -/* Define to 1 if you have the declaration of `NET_IPV4_TCP_WINDOW_SCALING', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV4_TCP_WINDOW_SCALING - /* Define to 1 if you have the declaration of `NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS -/* Define to 1 if you have the declaration of `NET_IPV6', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_IPV6 - -/* Define to 1 if you have the declaration of `NET_IPV6_BINDV6ONLY', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV6_BINDV6ONLY - -/* Define to 1 if you have the declaration of `NET_IPV6_CONF', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_IPV6_CONF - -/* Define to 1 if you have the declaration of `NET_IPV6_ICMP', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_IPV6_ICMP - -/* Define to 1 if you have the declaration of `NET_IPV6_IP6FRAG_HIGH_THRESH', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_IP6FRAG_HIGH_THRESH - -/* Define to 1 if you have the declaration of `NET_IPV6_IP6FRAG_LOW_THRESH', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_IP6FRAG_LOW_THRESH - -/* Define to 1 if you have the declaration of - `NET_IPV6_IP6FRAG_SECRET_INTERVAL', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_IP6FRAG_SECRET_INTERVAL - -/* Define to 1 if you have the declaration of `NET_IPV6_IP6FRAG_TIME', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_IP6FRAG_TIME - /* Define to 1 if you have the declaration of `NET_IPV6_MLD_MAX_MSF', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV6_MLD_MAX_MSF -/* Define to 1 if you have the declaration of `NET_IPV6_NEIGH', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV6_NEIGH - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_FLUSH', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_FLUSH - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_GC_ELASTICITY', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_GC_ELASTICITY - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_GC_INTERVAL', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_GC_INTERVAL - -/* Define to 1 if you have the declaration of - `NET_IPV6_ROUTE_GC_MIN_INTERVAL', and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL - /* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS', and to 0 if you don't. */ #undef HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_GC_THRESH', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_GC_THRESH - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_GC_TIMEOUT', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_GC_TIMEOUT - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_MAX_SIZE', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_MAX_SIZE - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_MIN_ADVMSS', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_MIN_ADVMSS - -/* Define to 1 if you have the declaration of `NET_IPV6_ROUTE_MTU_EXPIRES', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_IPV6_ROUTE_MTU_EXPIRES - -/* Define to 1 if you have the declaration of `NET_IPX', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_IPX - /* Define to 1 if you have the declaration of `NET_IRDA', and to 0 if you don't. */ #undef HAVE_DECL_NET_IRDA @@ -993,38 +282,14 @@ don't. */ #undef HAVE_DECL_NET_NETFILTER -/* Define to 1 if you have the declaration of `NET_NETROM', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_NETROM - -/* Define to 1 if you have the declaration of `NET_ROSE', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_ROSE - -/* Define to 1 if you have the declaration of `NET_SCTP', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_SCTP - /* Define to 1 if you have the declaration of `NET_TCP_ABC', and to 0 if you don't. */ #undef HAVE_DECL_NET_TCP_ABC -/* Define to 1 if you have the declaration of `NET_TCP_ABORT_ON_OVERFLOW', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_ABORT_ON_OVERFLOW - -/* Define to 1 if you have the declaration of `NET_TCP_ADV_WIN_SCALE', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_ADV_WIN_SCALE - /* Define to 1 if you have the declaration of `NET_TCP_ALLOWED_CONG_CONTROL', and to 0 if you don't. */ #undef HAVE_DECL_NET_TCP_ALLOWED_CONG_CONTROL -/* Define to 1 if you have the declaration of `NET_TCP_APP_WIN', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_TCP_APP_WIN - /* Define to 1 if you have the declaration of `NET_TCP_AVAIL_CONG_CONTROL', and to 0 if you don't. */ #undef HAVE_DECL_NET_TCP_AVAIL_CONG_CONTROL @@ -1045,197 +310,37 @@ to 0 if you don't. */ #undef HAVE_DECL_NET_TCP_DEFAULT_WIN_SCALE -/* Define to 1 if you have the declaration of `NET_TCP_DMA_COPYBREAK', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_DMA_COPYBREAK - -/* Define to 1 if you have the declaration of `NET_TCP_DSACK', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_TCP_DSACK - -/* Define to 1 if you have the declaration of `NET_TCP_ECN', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_TCP_ECN - -/* Define to 1 if you have the declaration of `NET_TCP_FACK', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_TCP_FACK - -/* Define to 1 if you have the declaration of `NET_TCP_FRTO', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_TCP_FRTO - -/* Define to 1 if you have the declaration of `NET_TCP_FRTO_RESPONSE', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_FRTO_RESPONSE - -/* Define to 1 if you have the declaration of `NET_TCP_LOW_LATENCY', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_LOW_LATENCY - -/* Define to 1 if you have the declaration of `NET_TCP_MAX_ORPHANS', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_MAX_ORPHANS - -/* Define to 1 if you have the declaration of `NET_TCP_MAX_SSTHRESH', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_MAX_SSTHRESH - -/* Define to 1 if you have the declaration of `NET_TCP_MAX_SYN_BACKLOG', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_MAX_SYN_BACKLOG - -/* Define to 1 if you have the declaration of `NET_TCP_MAX_TW_BUCKETS', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_MAX_TW_BUCKETS - -/* Define to 1 if you have the declaration of `NET_TCP_MEM', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_TCP_MEM - -/* Define to 1 if you have the declaration of `NET_TCP_MODERATE_RCVBUF', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_MODERATE_RCVBUF - -/* Define to 1 if you have the declaration of `NET_TCP_MTU_PROBING', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_MTU_PROBING - -/* Define to 1 if you have the declaration of `NET_TCP_NO_METRICS_SAVE', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_NO_METRICS_SAVE - -/* Define to 1 if you have the declaration of `NET_TCP_ORPHAN_RETRIES', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_ORPHAN_RETRIES - -/* Define to 1 if you have the declaration of `NET_TCP_REORDERING', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_REORDERING - -/* Define to 1 if you have the declaration of `NET_TCP_RFC1337', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_TCP_RFC1337 - -/* Define to 1 if you have the declaration of `NET_TCP_RMEM', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_TCP_RMEM - -/* Define to 1 if you have the declaration of `NET_TCP_SLOW_START_AFTER_IDLE', - and to 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE - -/* Define to 1 if you have the declaration of `NET_TCP_STDURG', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_TCP_STDURG - -/* Define to 1 if you have the declaration of `NET_TCP_SYNACK_RETRIES', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_SYNACK_RETRIES - -/* Define to 1 if you have the declaration of `NET_TCP_SYNCOOKIES', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_SYNCOOKIES - -/* Define to 1 if you have the declaration of `NET_TCP_SYN_TAILDROP', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_SYN_TAILDROP - -/* Define to 1 if you have the declaration of `NET_TCP_TSO_WIN_DIVISOR', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR - -/* Define to 1 if you have the declaration of `NET_TCP_TW_RECYCLE', and to 0 - if you don't. */ -#undef HAVE_DECL_NET_TCP_TW_RECYCLE - -/* Define to 1 if you have the declaration of `NET_TCP_TW_REUSE', and to 0 if - you don't. */ -#undef HAVE_DECL_NET_TCP_TW_REUSE - -/* Define to 1 if you have the declaration of `NET_TCP_WMEM', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_TCP_WMEM - -/* Define to 1 if you have the declaration of `NET_TR', and to 0 if you don't. - */ -#undef HAVE_DECL_NET_TR - -/* Define to 1 if you have the declaration of `NET_UNIX', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_UNIX - -/* Define to 1 if you have the declaration of `NET_UNIX_DELETE_DELAY', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_UNIX_DELETE_DELAY - -/* Define to 1 if you have the declaration of `NET_UNIX_DESTROY_DELAY', and to - 0 if you don't. */ -#undef HAVE_DECL_NET_UNIX_DESTROY_DELAY - -/* Define to 1 if you have the declaration of `NET_UNIX_MAX_DGRAM_QLEN', and - to 0 if you don't. */ -#undef HAVE_DECL_NET_UNIX_MAX_DGRAM_QLEN - -/* Define to 1 if you have the declaration of `NET_X25', and to 0 if you - don't. */ -#undef HAVE_DECL_NET_X25 - -/* Define to 1 if you have the declaration of `PTRACE_EVENT_CLONE', and to 0 - if you don't. */ -#undef HAVE_DECL_PTRACE_EVENT_CLONE - -/* Define to 1 if you have the declaration of `PTRACE_EVENT_EXEC', and to 0 if - you don't. */ -#undef HAVE_DECL_PTRACE_EVENT_EXEC - -/* Define to 1 if you have the declaration of `PTRACE_EVENT_EXIT', and to 0 if - you don't. */ -#undef HAVE_DECL_PTRACE_EVENT_EXIT - -/* Define to 1 if you have the declaration of `PTRACE_EVENT_FORK', and to 0 if - you don't. */ -#undef HAVE_DECL_PTRACE_EVENT_FORK - -/* Define to 1 if you have the declaration of `PTRACE_EVENT_VFORK', and to 0 - if you don't. */ -#undef HAVE_DECL_PTRACE_EVENT_VFORK - -/* Define to 1 if you have the declaration of `PTRACE_EVENT_VFORK_DONE', and - to 0 if you don't. */ -#undef HAVE_DECL_PTRACE_EVENT_VFORK_DONE - -/* Define to 1 if you have the declaration of `PTRACE_GETEVENTMSG', and to 0 - if you don't. */ -#undef HAVE_DECL_PTRACE_GETEVENTMSG +/* Define to 1 if you have the declaration of `NET_TCP_DMA_COPYBREAK', and to + 0 if you don't. */ +#undef HAVE_DECL_NET_TCP_DMA_COPYBREAK -/* Define to 1 if you have the declaration of `PTRACE_GETSIGINFO', and to 0 if - you don't. */ -#undef HAVE_DECL_PTRACE_GETSIGINFO +/* Define to 1 if you have the declaration of `NET_TCP_FRTO_RESPONSE', and to + 0 if you don't. */ +#undef HAVE_DECL_NET_TCP_FRTO_RESPONSE -/* Define to 1 if you have the declaration of `PTRACE_O_TRACECLONE', and to 0 +/* Define to 1 if you have the declaration of `NET_TCP_MAX_SSTHRESH', and to 0 if you don't. */ -#undef HAVE_DECL_PTRACE_O_TRACECLONE +#undef HAVE_DECL_NET_TCP_MAX_SSTHRESH -/* Define to 1 if you have the declaration of `PTRACE_O_TRACEEXEC', and to 0 - if you don't. */ -#undef HAVE_DECL_PTRACE_O_TRACEEXEC +/* Define to 1 if you have the declaration of `NET_TCP_MODERATE_RCVBUF', and + to 0 if you don't. */ +#undef HAVE_DECL_NET_TCP_MODERATE_RCVBUF -/* Define to 1 if you have the declaration of `PTRACE_O_TRACEEXIT', and to 0 +/* Define to 1 if you have the declaration of `NET_TCP_MTU_PROBING', and to 0 if you don't. */ -#undef HAVE_DECL_PTRACE_O_TRACEEXIT +#undef HAVE_DECL_NET_TCP_MTU_PROBING -/* Define to 1 if you have the declaration of `PTRACE_O_TRACEFORK', and to 0 - if you don't. */ -#undef HAVE_DECL_PTRACE_O_TRACEFORK +/* Define to 1 if you have the declaration of `NET_TCP_NO_METRICS_SAVE', and + to 0 if you don't. */ +#undef HAVE_DECL_NET_TCP_NO_METRICS_SAVE -/* Define to 1 if you have the declaration of `PTRACE_O_TRACESYSGOOD', and to - 0 if you don't. */ -#undef HAVE_DECL_PTRACE_O_TRACESYSGOOD +/* Define to 1 if you have the declaration of `NET_TCP_SLOW_START_AFTER_IDLE', + and to 0 if you don't. */ +#undef HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE -/* Define to 1 if you have the declaration of `PTRACE_O_TRACEVFORK', and to 0 - if you don't. */ -#undef HAVE_DECL_PTRACE_O_TRACEVFORK +/* Define to 1 if you have the declaration of `NET_TCP_TSO_WIN_DIVISOR', and + to 0 if you don't. */ +#undef HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR /* Define to 1 if you have the declaration of `PTRACE_PEEKUSER', and to 0 if you don't. */ @@ -1245,10 +350,6 @@ you don't. */ #undef HAVE_DECL_PTRACE_POKEUSER -/* Define to 1 if you have the declaration of `PTRACE_SETOPTIONS', and to 0 if - you don't. */ -#undef HAVE_DECL_PTRACE_SETOPTIONS - /* Define to 1 if you have the declaration of `P_ALL', and to 0 if you don't. */ #undef HAVE_DECL_P_ALL @@ -1289,77 +390,241 @@ don't. */ #undef HAVE_DECL_SYS_ERRLIST -/* Define to 1 if you have the declaration of `VM_BLOCK_DUMP', and to 0 if you - don't. */ -#undef HAVE_DECL_VM_BLOCK_DUMP +/* Define to 1 if you have the declaration of + `V4L2_BUF_TYPE_SLICED_VBI_CAPTURE', and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + +/* Define to 1 if you have the declaration of + `V4L2_BUF_TYPE_SLICED_VBI_OUTPUT', and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT + +/* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_VBI_CAPTURE', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VBI_CAPTURE + +/* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_VBI_OUTPUT', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VBI_OUTPUT + +/* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_VIDEO_CAPTURE', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE + +/* Define to 1 if you have the declaration of + `V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE', and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + +/* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_VIDEO_OUTPUT', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT + +/* Define to 1 if you have the declaration of + `V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE', and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE + +/* Define to 1 if you have the declaration of + `V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY', and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + +/* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_VIDEO_OVERLAY', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OVERLAY + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_470_SYSTEM_BG', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_BG + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_470_SYSTEM_M', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_M + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_BT878', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_BT878 + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_JPEG', and to 0 + if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_JPEG + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_REC709', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_REC709 + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_SMPTE170M', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_SMPTE170M + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_SMPTE240M', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_SMPTE240M + +/* Define to 1 if you have the declaration of `V4L2_COLORSPACE_SRGB', and to 0 + if you don't. */ +#undef HAVE_DECL_V4L2_COLORSPACE_SRGB + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_BITMASK', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_BITMASK + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_BOOLEAN', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_BOOLEAN + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_BUTTON', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_BUTTON + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_CTRL_CLASS', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_CTRL_CLASS + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_INTEGER', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_INTEGER + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_INTEGER64', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_INTEGER64 + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_INTEGER_MENU', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_INTEGER_MENU -/* Define to 1 if you have the declaration of `VM_DIRTY_BACKGROUND', and to 0 +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_MENU', and to 0 if you don't. */ -#undef HAVE_DECL_VM_DIRTY_BACKGROUND +#undef HAVE_DECL_V4L2_CTRL_TYPE_MENU + +/* Define to 1 if you have the declaration of `V4L2_CTRL_TYPE_STRING', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_CTRL_TYPE_STRING -/* Define to 1 if you have the declaration of `VM_DIRTY_EXPIRE_CS', and to 0 +/* Define to 1 if you have the declaration of `V4L2_FIELD_ALTERNATE', and to 0 if you don't. */ -#undef HAVE_DECL_VM_DIRTY_EXPIRE_CS +#undef HAVE_DECL_V4L2_FIELD_ALTERNATE -/* Define to 1 if you have the declaration of `VM_DIRTY_RATIO', and to 0 if +/* Define to 1 if you have the declaration of `V4L2_FIELD_ANY', and to 0 if you don't. */ -#undef HAVE_DECL_VM_DIRTY_RATIO +#undef HAVE_DECL_V4L2_FIELD_ANY -/* Define to 1 if you have the declaration of `VM_DIRTY_WB_CS', and to 0 if +/* Define to 1 if you have the declaration of `V4L2_FIELD_BOTTOM', and to 0 if you don't. */ -#undef HAVE_DECL_VM_DIRTY_WB_CS +#undef HAVE_DECL_V4L2_FIELD_BOTTOM -/* Define to 1 if you have the declaration of `VM_HUGETLB_GROUP', and to 0 if +/* Define to 1 if you have the declaration of `V4L2_FIELD_INTERLACED', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_FIELD_INTERLACED + +/* Define to 1 if you have the declaration of `V4L2_FIELD_INTERLACED_BT', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FIELD_INTERLACED_BT + +/* Define to 1 if you have the declaration of `V4L2_FIELD_INTERLACED_TB', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FIELD_INTERLACED_TB + +/* Define to 1 if you have the declaration of `V4L2_FIELD_NONE', and to 0 if you don't. */ -#undef HAVE_DECL_VM_HUGETLB_GROUP +#undef HAVE_DECL_V4L2_FIELD_NONE -/* Define to 1 if you have the declaration of `VM_HUGETLB_PAGES', and to 0 if +/* Define to 1 if you have the declaration of `V4L2_FIELD_SEQ_BT', and to 0 if you don't. */ -#undef HAVE_DECL_VM_HUGETLB_PAGES +#undef HAVE_DECL_V4L2_FIELD_SEQ_BT -/* Define to 1 if you have the declaration of `VM_LAPTOP_MODE', and to 0 if +/* Define to 1 if you have the declaration of `V4L2_FIELD_SEQ_TB', and to 0 if you don't. */ -#undef HAVE_DECL_VM_LAPTOP_MODE +#undef HAVE_DECL_V4L2_FIELD_SEQ_TB -/* Define to 1 if you have the declaration of `VM_LEGACY_VA_LAYOUT', and to 0 - if you don't. */ -#undef HAVE_DECL_VM_LEGACY_VA_LAYOUT +/* Define to 1 if you have the declaration of `V4L2_FIELD_TOP', and to 0 if + you don't. */ +#undef HAVE_DECL_V4L2_FIELD_TOP -/* Define to 1 if you have the declaration of `VM_LOWMEM_RESERVE_RATIO', and - to 0 if you don't. */ -#undef HAVE_DECL_VM_LOWMEM_RESERVE_RATIO +/* Define to 1 if you have the declaration of `V4L2_FRMIVAL_TYPE_CONTINUOUS', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FRMIVAL_TYPE_CONTINUOUS -/* Define to 1 if you have the declaration of `VM_MAX_MAP_COUNT', and to 0 if +/* Define to 1 if you have the declaration of `V4L2_FRMIVAL_TYPE_DISCRETE', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FRMIVAL_TYPE_DISCRETE + +/* Define to 1 if you have the declaration of `V4L2_FRMIVAL_TYPE_STEPWISE', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FRMIVAL_TYPE_STEPWISE + +/* Define to 1 if you have the declaration of `V4L2_FRMSIZE_TYPE_CONTINUOUS', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FRMSIZE_TYPE_CONTINUOUS + +/* Define to 1 if you have the declaration of `V4L2_FRMSIZE_TYPE_DISCRETE', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FRMSIZE_TYPE_DISCRETE + +/* Define to 1 if you have the declaration of `V4L2_FRMSIZE_TYPE_STEPWISE', + and to 0 if you don't. */ +#undef HAVE_DECL_V4L2_FRMSIZE_TYPE_STEPWISE + +/* Define to 1 if you have the declaration of `V4L2_MEMORY_DMABUF', and to 0 + if you don't. */ +#undef HAVE_DECL_V4L2_MEMORY_DMABUF + +/* Define to 1 if you have the declaration of `V4L2_MEMORY_MMAP', and to 0 if you don't. */ -#undef HAVE_DECL_VM_MAX_MAP_COUNT +#undef HAVE_DECL_V4L2_MEMORY_MMAP -/* Define to 1 if you have the declaration of `VM_MIN_FREE_KBYTES', and to 0 +/* Define to 1 if you have the declaration of `V4L2_MEMORY_OVERLAY', and to 0 if you don't. */ -#undef HAVE_DECL_VM_MIN_FREE_KBYTES +#undef HAVE_DECL_V4L2_MEMORY_OVERLAY -/* Define to 1 if you have the declaration of `VM_NR_PDFLUSH_THREADS', and to - 0 if you don't. */ -#undef HAVE_DECL_VM_NR_PDFLUSH_THREADS +/* Define to 1 if you have the declaration of `V4L2_MEMORY_USERPTR', and to 0 + if you don't. */ +#undef HAVE_DECL_V4L2_MEMORY_USERPTR + +/* Define to 1 if you have the declaration of `V4L2_PRIORITY_BACKGROUND', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_PRIORITY_BACKGROUND + +/* Define to 1 if you have the declaration of `V4L2_PRIORITY_INTERACTIVE', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_PRIORITY_INTERACTIVE -/* Define to 1 if you have the declaration of `VM_OVERCOMMIT_MEMORY', and to 0 +/* Define to 1 if you have the declaration of `V4L2_PRIORITY_RECORD', and to 0 if you don't. */ -#undef HAVE_DECL_VM_OVERCOMMIT_MEMORY +#undef HAVE_DECL_V4L2_PRIORITY_RECORD -/* Define to 1 if you have the declaration of `VM_OVERCOMMIT_RATIO', and to 0 +/* Define to 1 if you have the declaration of `V4L2_PRIORITY_UNSET', and to 0 if you don't. */ -#undef HAVE_DECL_VM_OVERCOMMIT_RATIO +#undef HAVE_DECL_V4L2_PRIORITY_UNSET -/* Define to 1 if you have the declaration of `VM_PAGEBUF', and to 0 if you - don't. */ -#undef HAVE_DECL_VM_PAGEBUF +/* Define to 1 if you have the declaration of `V4L2_TUNER_ANALOG_TV', and to 0 + if you don't. */ +#undef HAVE_DECL_V4L2_TUNER_ANALOG_TV + +/* Define to 1 if you have the declaration of `V4L2_TUNER_DIGITAL_TV', and to + 0 if you don't. */ +#undef HAVE_DECL_V4L2_TUNER_DIGITAL_TV -/* Define to 1 if you have the declaration of `VM_PAGE_CLUSTER', and to 0 if +/* Define to 1 if you have the declaration of `V4L2_TUNER_RADIO', and to 0 if you don't. */ -#undef HAVE_DECL_VM_PAGE_CLUSTER +#undef HAVE_DECL_V4L2_TUNER_RADIO -/* Define to 1 if you have the declaration of `VM_SWAPPINESS', and to 0 if you +/* Define to 1 if you have the declaration of `VM_BLOCK_DUMP', and to 0 if you don't. */ -#undef HAVE_DECL_VM_SWAPPINESS +#undef HAVE_DECL_VM_BLOCK_DUMP + +/* Define to 1 if you have the declaration of `VM_HUGETLB_GROUP', and to 0 if + you don't. */ +#undef HAVE_DECL_VM_HUGETLB_GROUP + +/* Define to 1 if you have the declaration of `VM_LAPTOP_MODE', and to 0 if + you don't. */ +#undef HAVE_DECL_VM_LAPTOP_MODE + +/* Define to 1 if you have the declaration of `VM_LEGACY_VA_LAYOUT', and to 0 + if you don't. */ +#undef HAVE_DECL_VM_LEGACY_VA_LAYOUT + +/* Define to 1 if you have the declaration of `VM_MAX_MAP_COUNT', and to 0 if + you don't. */ +#undef HAVE_DECL_VM_MAX_MAP_COUNT /* Define to 1 if you have the declaration of `VM_SWAP_TOKEN_TIMEOUT', and to 0 if you don't. */ @@ -1369,13 +634,18 @@ 0 if you don't. */ #undef HAVE_DECL_VM_VFS_CACHE_PRESSURE -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H +/* Define to 1 if the system provides dladdr */ +#undef HAVE_DLADDR /* Define to 1 if you have the header file. */ #undef HAVE_ELF_H +/* Define to 1 if you have the `fallocate' function. */ +#undef HAVE_FALLOCATE + +/* Define to 1 if you have the `fanotify_mark' function. */ +#undef HAVE_FANOTIFY_MARK + /* Define to 1 if you have the `fopen64' function. */ #undef HAVE_FOPEN64 @@ -1385,47 +655,133 @@ /* Define to 1 if you have the `fputs_unlocked' function. */ #undef HAVE_FPUTS_UNLOCKED +/* Define to 1 if you have the `fstatat' function. */ +#undef HAVE_FSTATAT + +/* Define to 1 if you have the `ftruncate' function. */ +#undef HAVE_FTRUNCATE + +/* Define to 1 if you have the `futimens' function. */ +#undef HAVE_FUTIMENS + +/* Define to 1 if you have the header file. */ +#undef HAVE_GNU_STUBS + +/* Define to 1 if you have the header file. */ +#undef HAVE_GNU_STUBS_32_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GNU_STUBS_X32_H + /* Define to 1 if you have the `if_indextoname' function. */ #undef HAVE_IF_INDEXTONAME -/* Define to 1 if you have the `inet_ntop' function. */ -#undef HAVE_INET_NTOP - /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_IOCTLS_H - /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_PTRACE_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_CAPABILITY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_BPF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_BSG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_BTRFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_DM_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_DQBLK_XFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_FALLOC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_FIEMAP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_FILTER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_HIDDEV_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_ICMP_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_INPUT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IF_PACKET_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IPC_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IN6_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IP_VS_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_NETLINK_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_MMTIMER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_MQUEUE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_MSG_H + +/* Define to 1 if you have the header file. + */ +#undef HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H + +/* Define to 1 if you have the header file. + */ +#undef HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_PERF_EVENT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_PTRACE_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_QUOTA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_SECCOMP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_SECUREBITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_SEM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_SHM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_USERFAULTFD_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_UTSNAME_H -/* Define if long long is little-endian. */ -#undef HAVE_LITTLE_ENDIAN_LONG_LONG +/* Define to 1 if you have CFLAG mpers support */ +#undef HAVE_M32_MPERS + +/* Define to 1 if MPERS_NAME has the type 'struct stat'. */ +#undef HAVE_M32_STRUCT_STAT + +/* Define to 1 if MPERS_NAME has the type 'struct stat64'. */ +#undef HAVE_M32_STRUCT_STAT64 + +/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat64'. + */ +#undef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC + +/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat'. */ +#undef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -1433,8 +789,21 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MQUEUE_H -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H +/* Define to 1 if you have CFLAG mpers support */ +#undef HAVE_MX32_MPERS + +/* Define to 1 if MPERS_NAME has the type 'struct stat'. */ +#undef HAVE_MX32_STRUCT_STAT + +/* Define to 1 if MPERS_NAME has the type 'struct stat64'. */ +#undef HAVE_MX32_STRUCT_STAT64 + +/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat64'. + */ +#undef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC + +/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat'. */ +#undef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_SCTP_H @@ -1445,8 +814,11 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_UDP_H -/* Define to 1 if you have the header file. */ -#undef HAVE_POLL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NETIPX_IPX_H + +/* Define to 1 if you have the `open64' function. */ +#undef HAVE_OPEN64 /* Define to 1 if you have the `prctl' function. */ #undef HAVE_PRCTL @@ -1460,32 +832,26 @@ /* Define to 1 if you have the `pwritev' function. */ #undef HAVE_PWRITEV +/* Define to 1 if you have the `readahead' function. */ +#undef HAVE_READAHEAD + /* Define to 1 if you have the header file. */ #undef HAVE_SCSI_SG_H -/* Define to 1 if you have the `sendmsg' function. */ -#undef HAVE_SENDMSG - -/* Define to 1 if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define to 1 if the system has the type `siginfo_t'. */ -#undef HAVE_SIGINFO_T +/* Define to 1 if `si_overrun' is a member of `siginfo_t'. */ +#undef HAVE_SIGINFO_T_SI_OVERRUN /* Define to 1 if `si_syscall' is a member of `siginfo_t'. */ #undef HAVE_SIGINFO_T_SI_SYSCALL -/* Define to 1 if the system has the type `sig_atomic_t'. */ -#undef HAVE_SIG_ATOMIC_T - -/* Define if stat64 is available in asm/stat.h. */ -#undef HAVE_STAT64 +/* Define to 1 if `si_timerid' is a member of `siginfo_t'. */ +#undef HAVE_SIGINFO_T_SI_TIMERID -/* Define if statfs64 is available in sys/vfs.h. */ -#undef HAVE_STATFS64 +/* Define to 1 if you have the `signalfd' function. */ +#undef HAVE_SIGNALFD -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H +/* Define to 1 if the system has the type `sig_atomic_t'. */ +#undef HAVE_SIG_ATOMIC_T /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -1511,14 +877,109 @@ /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL +/* Define to 1 if the system has the type `struct blk_user_trace_setup'. */ +#undef HAVE_STRUCT_BLK_USER_TRACE_SETUP + +/* Define to 1 if `start' is a member of `struct + btrfs_ioctl_defrag_range_args'. */ +#undef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START + +/* Define to 1 if `compat_flags' is a member of `struct + btrfs_ioctl_feature_flags'. */ +#undef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS + +/* Define to 1 if `nodesize' is a member of `struct btrfs_ioctl_fs_info_args'. + */ +#undef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE + +/* Define to 1 if `buf_size' is a member of `struct + btrfs_ioctl_search_args_v2'. */ +#undef HAVE_STRUCT_BTRFS_IOCTL_SEARCH_ARGS_V2_BUF_SIZE + +/* Define to 1 if the system has the type `struct flock'. */ +#undef HAVE_STRUCT_FLOCK + /* Define to 1 if the system has the type `struct flock64'. */ #undef HAVE_STRUCT_FLOCK64 /* Define to 1 if the system has the type `struct ia64_fpreg'. */ #undef HAVE_STRUCT_IA64_FPREG -/* Define to 1 if `msg_control' is a member of `struct msghdr'. */ -#undef HAVE_STRUCT_MSGHDR_MSG_CONTROL +/* Define to 1 if `resolution' is a member of `struct input_absinfo'. */ +#undef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION + +/* Define to 1 if the system has the type `struct mmsghdr'. */ +#undef HAVE_STRUCT_MMSGHDR + +/* Define to 1 if `aux_watermark' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK + +/* Define to 1 if `bp_type' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_BP_TYPE + +/* Define to 1 if `branch_sample_type' is a member of `struct + perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_BRANCH_SAMPLE_TYPE + +/* Define to 1 if `comm_exec' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC + +/* Define to 1 if `config1' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 + +/* Define to 1 if `config2' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 + +/* Define to 1 if `context_switch' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH + +/* Define to 1 if `exclude_callchain_kernel' is a member of `struct + perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL + +/* Define to 1 if `exclude_callchain_user' is a member of `struct + perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER + +/* Define to 1 if `exclude_guest' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST + +/* Define to 1 if `exclude_host' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST + +/* Define to 1 if `mmap2' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 + +/* Define to 1 if `mmap_data' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA + +/* Define to 1 if `precise_ip' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP + +/* Define to 1 if `sample_id_all' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL + +/* Define to 1 if `sample_max_stack' is a member of `struct perf_event_attr'. + */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK + +/* Define to 1 if `sample_regs_intr' is a member of `struct perf_event_attr'. + */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR + +/* Define to 1 if `sample_regs_user' is a member of `struct perf_event_attr'. + */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER + +/* Define to 1 if `sample_stack_user' is a member of `struct perf_event_attr'. + */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER + +/* Define to 1 if `use_clockid' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID + +/* Define to 1 if `write_backward' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD /* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */ #undef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS @@ -1529,101 +990,135 @@ /* Define to 1 if the system has the type `struct sigcontext'. */ #undef HAVE_STRUCT_SIGCONTEXT -/* Define to 1 if `_sigev_un._pad' is a member of `struct sigevent'. */ -#undef HAVE_STRUCT_SIGEVENT__SIGEV_UN__PAD +/* Define to 1 if the system has the type `struct stat64'. */ +#undef HAVE_STRUCT_STAT64 + +/* Define to 1 if `st_mtime_nsec' is a member of `struct stat64'. */ +#undef HAVE_STRUCT_STAT64_ST_MTIME_NSEC + +/* Define to 1 if the system has the type `struct statfs'. */ +#undef HAVE_STRUCT_STATFS + +/* Define to 1 if the system has the type `struct statfs64'. */ +#undef HAVE_STRUCT_STATFS64 -/* Define to 1 if `__pad' is a member of `struct sigevent'. */ -#undef HAVE_STRUCT_SIGEVENT___PAD +/* Define to 1 if `f_flags' is a member of `struct statfs64'. */ +#undef HAVE_STRUCT_STATFS64_F_FLAGS -/* Define to 1 if `sin6_scope_id' is a member of `struct sockaddr_in6'. */ -#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID +/* Define to 1 if `f_frsize' is a member of `struct statfs64'. */ +#undef HAVE_STRUCT_STATFS64_F_FRSIZE -/* Define to 1 if `st_aclcnt' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_ACLCNT +/* Define to 1 if `f_fsid.val' is a member of `struct statfs64'. */ +#undef HAVE_STRUCT_STATFS64_F_FSID_VAL -/* Define to 1 if `st_blksize' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BLKSIZE +/* Define to 1 if `f_fsid.__val' is a member of `struct statfs64'. */ +#undef HAVE_STRUCT_STATFS64_F_FSID___VAL -/* Define to 1 if `st_blocks' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BLOCKS +/* Define to 1 if `f_flags' is a member of `struct statfs'. */ +#undef HAVE_STRUCT_STATFS_F_FLAGS -/* Define to 1 if `st_flags' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_FLAGS +/* Define to 1 if `f_frsize' is a member of `struct statfs'. */ +#undef HAVE_STRUCT_STATFS_F_FRSIZE -/* Define to 1 if `st_fstype' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_FSTYPE +/* Define to 1 if `f_fsid.val' is a member of `struct statfs'. */ +#undef HAVE_STRUCT_STATFS_F_FSID_VAL -/* Define to 1 if `st_gen' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_GEN +/* Define to 1 if `f_fsid.__val' is a member of `struct statfs'. */ +#undef HAVE_STRUCT_STATFS_F_FSID___VAL -/* Define to 1 if `st_level' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_LEVEL +/* Define to 1 if `st_mtime_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_MTIME_NSEC -/* Define to 1 if `st_rdev' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_RDEV +/* Define to 1 if `tai' is a member of `struct timex'. */ +#undef HAVE_STRUCT_TIMEX_TAI + +/* Define to 1 if the system has the type `struct user_desc'. */ +#undef HAVE_STRUCT_USER_DESC /* Define to 1 if `domainname' is a member of `struct utsname'. */ #undef HAVE_STRUCT_UTSNAME_DOMAINNAME +/* Define to 1 if the system has the type `struct __kernel_flock'. */ +#undef HAVE_STRUCT___KERNEL_FLOCK + +/* Define to 1 if the system has the type `struct __kernel_flock64'. */ +#undef HAVE_STRUCT___KERNEL_FLOCK64 + /* Define to 1 if the system has the type `struct __old_kernel_stat'. */ #undef HAVE_STRUCT___OLD_KERNEL_STAT -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ACL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ASYNCH_H +/* Define to 1 if you have the `sync_file_range' function. */ +#undef HAVE_SYNC_FILE_RANGE /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CONF_H -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_EPOLL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_EVENTFD_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_FILIO_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FANOTIFY_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IPC_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_POLL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MSG_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PTRACE_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_QUOTA_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_REG_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SEM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SHM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNALFD_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UIO_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_XATTR_H + +/* Define to 1 if typeof works with your compiler. */ +#undef HAVE_TYPEOF -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_VFS_H +/* Define to 1 if union bpf_attr.attach_type initialization works */ +#undef HAVE_UNION_BPF_ATTR_ATTACH_TYPE + +/* Define to 1 if union bpf_attr.bpf_fd initialization works */ +#undef HAVE_UNION_BPF_ATTR_BPF_FD + +/* Define to 1 if union bpf_attr.log_buf initialization works */ +#undef HAVE_UNION_BPF_ATTR_LOG_BUF /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL +/* Define to 1 if you have the header file. */ +#undef HAVE_USTAT_H + +/* Define to 1 if you have the `utimensat' function. */ +#undef HAVE_UTIMENSAT /* Define to 1 if the system provides __builtin_popcount function */ #undef HAVE___BUILTIN_POPCOUNT +/* Define to 1 if the system has the type `__kernel_long_t'. */ +#undef HAVE___KERNEL_LONG_T + +/* Define to 1 if the system has the type `__kernel_ulong_t'. */ +#undef HAVE___KERNEL_ULONG_T + /* Define for the HPPA architecture. */ #undef HPPA @@ -1633,16 +1128,17 @@ /* Define for the IA64 architecture. */ #undef IA64 -/* Define for the m68k architecture. */ -#undef M68K +/* Define for _ABIN32. */ +#undef LINUX_MIPSN32 -/* Define to 1 if `major', `minor', and `makedev' are declared in . - */ -#undef MAJOR_IN_MKDEV +/* Define for _ABI64. */ +#undef LINUX_MIPSN64 -/* Define to 1 if `major', `minor', and `makedev' are declared in - . */ -#undef MAJOR_IN_SYSMACROS +/* Define for _ABIO32. */ +#undef LINUX_MIPSO32 + +/* Define for the m68k architecture. */ +#undef M68K /* Define for the Meta architecture. */ #undef METAG @@ -1653,6 +1149,9 @@ /* Define for the MIPS architecture. */ #undef MIPS +/* Define for the Nios-II architecture. */ +#undef NIOS2 + /* Define for the OpenRISC 1000 architecture. */ #undef OR1K @@ -1683,8 +1182,8 @@ /* Define for the PowerPC64 architecture. */ #undef POWERPC64 -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE +/* Define for the RISC-V architecture */ +#undef RISCV /* Define for the S390 architecture. */ #undef S390 @@ -1698,6 +1197,9 @@ /* Define for the SH64 architecture. */ #undef SH64 +/* The size of `kernel_long_t', as computed by sizeof. */ +#undef SIZEOF_KERNEL_LONG_T + /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG @@ -1707,15 +1209,15 @@ /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T +/* The size of `struct i64_i32', as computed by sizeof. */ +#undef SIZEOF_STRUCT_I64_I32 + /* Define for the SPARC architecture. */ #undef SPARC /* Define for the SPARC64 architecture. */ #undef SPARC64 -/* Define to 1 if the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -1781,14 +1283,11 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - /* Define to `int' if doesn't define. */ #undef gid_t -/* Define to `int' if does not define. */ -#undef mode_t +/* Define to __typeof__ if your compiler spells it that way. */ +#undef typeof /* Define to `int' if doesn't define. */ #undef uid_t diff --git a/config.sub b/config.sub index c3e202d9..7a8ce3e6 100755 --- a/config.sub +++ b/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-01-01' +timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ timestamp='2014-01-01' # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +117,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,12 +255,13 @@ case $basic_machine in | arc | arceb \ | arm | armh | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -283,8 +284,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -296,14 +299,14 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -311,6 +314,7 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -325,6 +329,9 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -370,12 +377,13 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armh-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -402,8 +410,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -415,16 +425,18 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -432,6 +444,7 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -508,6 +521,9 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -769,6 +785,9 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -824,6 +843,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1356,7 +1379,7 @@ case $os in | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1369,14 +1392,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1594,9 +1617,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff --git a/configure b/configure index 67f5e9ce..36905ea1 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for strace 4.9. +# Generated by GNU Autoconf 2.69 for strace 4.16. # # Report bugs to . # @@ -10,6 +10,8 @@ # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +# +# Copyright (C) 1999-2017 The strace developers. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -580,10 +582,10 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='strace' PACKAGE_TARNAME='strace' -PACKAGE_VERSION='4.9' -PACKAGE_STRING='strace 4.9' +PACKAGE_VERSION='4.16' +PACKAGE_STRING='strace 4.16' PACKAGE_BUGREPORT='strace-devel@lists.sourceforge.net' -PACKAGE_URL='' +PACKAGE_URL='https://strace.io' ac_unique_file="strace.c" # Factoring default headers for most tests. @@ -626,22 +628,61 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +VALGRIND_CHECK_RULES +valgrind_enabled_tools +valgrind_tools +ENABLE_VALGRIND_sgcheck +ENABLE_VALGRIND_drd +ENABLE_VALGRIND_helgrind +ENABLE_VALGRIND_memcheck +VALGRIND_ENABLED +VALGRIND_ENABLED_FALSE +VALGRIND_ENABLED_TRUE +VALGRIND +HAVE_MX32_MPERS_FALSE +HAVE_MX32_MPERS_TRUE +HAVE_MX32_RUNTIME_FALSE +HAVE_MX32_RUNTIME_TRUE +HAVE_M32_MPERS_FALSE +HAVE_M32_MPERS_TRUE +HAVE_M32_RUNTIME_FALSE +HAVE_M32_RUNTIME_TRUE USE_LIBUNWIND_FALSE USE_LIBUNWIND_TRUE libunwind_CPPFLAGS libunwind_LDFLAGS libunwind_LIBS PERL -WARN_CFLAGS -X32_FALSE -X32_TRUE -X86_64_FALSE -X86_64_TRUE -I386_FALSE -I386_TRUE +dl_LIBS +MIPS_ABI +arch_mx32 +arch_m32 arch +CODE_COVERAGE_RULES +CODE_COVERAGE_LDFLAGS +CODE_COVERAGE_CXXFLAGS +CODE_COVERAGE_CFLAGS +CODE_COVERAGE_CPPFLAGS +GENHTML +LCOV +GCOV +CODE_COVERAGE_ENABLED +CODE_COVERAGE_ENABLED_FALSE +CODE_COVERAGE_ENABLED_TRUE +SED EGREP GREP +RANLIB +WARN_CFLAGS_FOR_BUILD +LDFLAGS_FOR_BUILD +CPPFLAGS_FOR_BUILD +CFLAGS_FOR_BUILD +BUILD_OBJEXT +BUILD_EXEEXT +CPP_FOR_BUILD +ac_ct_CC_FOR_BUILD +CC_FOR_BUILD +WARN_CFLAGS CPP am__fastdepCC_FALSE am__fastdepCC_TRUE @@ -660,6 +701,8 @@ CPPFLAGS LDFLAGS CFLAGS CC +DEB_CHANGELOGTIME +RPM_CHANGELOGTIME host_os host_vendor host_cpu @@ -742,9 +785,16 @@ enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking -enable_arm_oabi enable_gcc_Werror +with_gcov +enable_code_coverage +enable_arm_oabi with_libunwind +enable_valgrind +enable_valgrind_memcheck +enable_valgrind_helgrind +enable_valgrind_drd +enable_valgrind_sgcheck ' ac_precious_vars='build_alias host_alias @@ -1295,7 +1345,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures strace 4.9 to adapt to many kinds of systems. +\`configure' configures strace 4.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1365,7 +1415,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of strace 4.9:";; + short | recursive ) echo "Configuration of strace 4.16:";; esac cat <<\_ACEOF @@ -1382,12 +1432,22 @@ Optional Features: do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build - --enable-arm-oabi enable OABI support on ARM EABI --enable-gcc-Werror turn on gcc's -Werror option + --enable-code-coverage Whether to enable code coverage support + --enable-arm-oabi enable OABI support on ARM EABI + --enable-valgrind Whether to enable Valgrind on the unit tests + --disable-valgrind-memcheck + Whether to skip memcheck during the Valgrind tests + --disable-valgrind-helgrind + Whether to skip helgrind during the Valgrind tests + --disable-valgrind-drd Whether to skip drd during the Valgrind tests + --enable-valgrind-sgcheck + Whether to use sgcheck during the Valgrind tests Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). --with-libunwind use libunwind to implement stack tracing support Some influential environment variables: @@ -1404,6 +1464,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . +strace home page: . _ACEOF ac_status=$? fi @@ -1466,12 +1527,14 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -strace configure 4.9 +strace configure 4.16 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. + +Copyright (C) 1999-2017 The strace developers. _ACEOF exit fi @@ -1555,6 +1618,52 @@ fi } # ac_fn_c_try_cpp +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -1719,200 +1828,226 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_header_compile -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { -if (sizeof ($2)) - return 0; +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { -if (sizeof (($2))) - return 0; +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - + ac_hi=$ac_mid; break else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 + done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$5 +$4 int main () { -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$5 +$4 int main () { -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" + ac_lo=$ac_mid; break else - eval "$4=no" + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* Tell GNU C headers to include stubs. */ -#define __need_GNU_STUBS_H - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* Tell GNU C headers to include stubs. */ +#define __need_GNU_STUBS_H + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus extern "C" #endif char $2 (); @@ -1972,42 +2107,50 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else + eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - +if (sizeof ($2)) + return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + else - eval "$3=no" + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -2016,61 +2159,78 @@ eval ac_res=\$$3 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_c_check_type -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$4 +$5 int main () { -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; - +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$4 +$5 int main () { -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break + eval "$4=yes" else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val + eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -2078,133 +2238,36 @@ $4 int main () { -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid + eval "$3=yes" else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val + eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 &5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_c_compute_int +} # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by strace $as_me 4.9, which was +It was created by strace $as_me 4.16, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2555,6 +2618,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_aux_dir= for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then @@ -3072,7 +3136,7 @@ fi # Define the identity of the package. PACKAGE='strace' - VERSION='4.9' + VERSION='4.16' cat >>confdefs.h <<_ACEOF @@ -3165,6 +3229,7 @@ END fi fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. @@ -3259,6 +3324,11 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')" + +DEB_CHANGELOGTIME="$(LC_TIME=C date -R)" + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4298,7 +4368,6 @@ else fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4437,147 +4506,94 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - ac_cv_path_GREP=$GREP + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wall" >&5 +$as_echo_n "checking whether $CC handles -Wall... " >&6; } +if ${gl_cv_warn_CFLAGS__Wall+:} false; then : $as_echo_n "(cached) " >&6 else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wall" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wall=yes else - ac_cv_path_EGREP=$EGREP + gl_cv_warn_CFLAGS__Wall=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wall" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wall" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wall" = xyes; then : + as_fn_append WARN_CFLAGS " -Wall" +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include int main () @@ -4587,147 +4603,229 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - ac_cv_header_stdc=no + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_cv_header_stdc=no + gl_unknown_warnings_are_errors= fi -rm -f conftest* + fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wempty-body" >&5 +$as_echo_n "checking whether $CC handles -Wempty-body... " >&6; } +if ${gl_cv_warn_CFLAGS__Wempty_body+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wempty-body" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wempty_body=yes else - ac_cv_header_stdc=no + gl_cv_warn_CFLAGS__Wempty_body=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wempty_body" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wempty_body" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wempty_body" = xyes; then : + as_fn_append WARN_CFLAGS " -Wempty-body" +fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : + +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; + + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wformat-security" >&5 +$as_echo_n "checking whether $CC handles -Wformat-security... " >&6; } +if ${gl_cv_warn_CFLAGS__Wformat_security+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-security" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wformat_security=yes +else + gl_cv_warn_CFLAGS__Wformat_security=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wformat_security" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wformat_security" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wformat_security" = xyes; then : + as_fn_append WARN_CFLAGS " -Wformat-security" +fi -done +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - MINIX= + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi - if test "$MINIX" = yes; then -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wignored-qualifiers" >&5 +$as_echo_n "checking whether $CC handles -Wignored-qualifiers... " >&6; } +if ${gl_cv_warn_CFLAGS__Wignored_qualifiers+:} false; then : + $as_echo_n "(cached) " >&6 +else -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wignored-qualifiers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ -$as_echo "#define _MINIX 1" >>confdefs.h + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wignored_qualifiers=yes +else + gl_cv_warn_CFLAGS__Wignored_qualifiers=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wignored_qualifiers" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wignored_qualifiers" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wignored_qualifiers" = xyes; then : + as_fn_append WARN_CFLAGS " -Wignored-qualifiers" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# define __EXTENSIONS__ 1 - $ac_includes_default int main () { @@ -4736,95 +4834,152 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - ac_cv_safe_to_define___extensions__=no + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h +fi - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Winit-self" >&5 +$as_echo_n "checking whether $CC handles -Winit-self... " >&6; } +if ${gl_cv_warn_CFLAGS__Winit_self+:} false; then : + $as_echo_n "(cached) " >&6 +else - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Winit-self" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Winit_self=yes +else + gl_cv_warn_CFLAGS__Winit_self=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported architecture" >&5 -$as_echo_n "checking for supported architecture... " >&6; } -case "$host_cpu" in -bfin) - arch=bfin +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Winit_self" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Winit_self" >&6; } +if test "x$gl_cv_warn_CFLAGS__Winit_self" = xyes; then : + as_fn_append WARN_CFLAGS " -Winit-self" +fi -$as_echo "#define BFIN 1" >>confdefs.h - ;; -i[3456]86|pentium) - arch=i386 +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else -$as_echo "#define I386 1" >>confdefs.h + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ;; -ia64) - arch=ia64 +int +main () +{ -$as_echo "#define IA64 1" >>confdefs.h + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" - ;; -m68k) - arch=m68k +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi -$as_echo "#define M68K 1" >>confdefs.h - ;; -sparc64*) - arch=sparc64 +fi -$as_echo "#define SPARC64 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wlogical-op" >&5 +$as_echo_n "checking whether $CC handles -Wlogical-op... " >&6; } +if ${gl_cv_warn_CFLAGS__Wlogical_op+:} false; then : + $as_echo_n "(cached) " >&6 +else - ;; -sparc*) - arch=sparc + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -$as_echo "#define SPARC 1" >>confdefs.h +int +main () +{ - ;; -metag*) - arch=metag - -$as_echo "#define METAG 1" >>confdefs.h - - ;; -mips*) - arch=mips - -$as_echo "#define MIPS 1" >>confdefs.h - - ;; -alpha*) - arch=alpha + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wlogical_op=yes +else + gl_cv_warn_CFLAGS__Wlogical_op=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" -$as_echo "#define ALPHA 1" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wlogical_op" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wlogical_op" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wlogical_op" = xyes; then : + as_fn_append WARN_CFLAGS " -Wlogical-op" +fi - ;; -powerpc*) - arch=powerpc -$as_echo "#define POWERPC 1" >>confdefs.h +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __LP64__ -# error 32 bit -#endif + int main () { @@ -4833,78 +4988,38 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ppc_bits=64 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - ppc_bits=32 + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$ppc_bits" = "64"; then - -$as_echo "#define POWERPC64 1" >>confdefs.h - - fi - ;; -arm*) - arch=arm - -$as_echo "#define ARM 1" >>confdefs.h - - ;; -aarch64*) - arch=aarch64 - -$as_echo "#define AARCH64 1" >>confdefs.h - - ;; -avr32*) - arch=avr32 - -$as_echo "#define AVR32 1" >>confdefs.h - - ;; -arc*) - arch=arc - -$as_echo "#define ARC 1" >>confdefs.h - - ;; -s390) - arch=s390 - -$as_echo "#define S390 1" >>confdefs.h - - ;; -s390x) - arch=s390x - -$as_echo "#define S390X 1" >>confdefs.h - - ;; -hppa*|parisc*) - arch=hppa - -$as_echo "#define HPPA 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" - ;; -sh64*) - arch=sh64 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi -$as_echo "#define SH64 1" >>confdefs.h - ;; -sh*) - arch=sh +fi -$as_echo "#define SH 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wmissing-parameter-type" >&5 +$as_echo_n "checking whether $CC handles -Wmissing-parameter-type... " >&6; } +if ${gl_cv_warn_CFLAGS__Wmissing_parameter_type+:} false; then : + $as_echo_n "(cached) " >&6 +else - ;; -x86?64*) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-parameter-type" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __ILP32__ -# error not x32 -#endif + int main () { @@ -4913,145 +5028,109 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - arch=x32 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wmissing_parameter_type=yes else - arch=x86_64 + gl_cv_warn_CFLAGS__Wmissing_parameter_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$arch" = "x86_64"; then - -$as_echo "#define X86_64 1" >>confdefs.h - - else - -$as_echo "#define X32 1" >>confdefs.h - - fi - ;; -cris|crisv10) - arch=crisv10 - -$as_echo "#define CRISV10 1" >>confdefs.h - - ;; -crisv32) - arch=crisv32 - -$as_echo "#define CRISV32 1" >>confdefs.h - - ;; -tile*) - arch=tile - -$as_echo "#define TILE 1" >>confdefs.h - - ;; -microblaze*) - arch=microblaze - -$as_echo "#define MICROBLAZE 1" >>confdefs.h - - ;; -or1k*) - arch=or1k - -$as_echo "#define OR1K 1" >>confdefs.h - - ;; - -xtensa*) - arch=xtensa +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" -$as_echo "#define XTENSA 1" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wmissing_parameter_type" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wmissing_parameter_type" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wmissing_parameter_type" = xyes; then : + as_fn_append WARN_CFLAGS " -Wmissing-parameter-type" +fi - ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: NO!" >&5 -$as_echo "NO!" >&6; } - as_fn_error $? "architecture $host_cpu is not supported by strace" "$LINENO" 5 - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $arch" >&5 -$as_echo "$arch" >&6; } +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ - if test x$arch = xi386; then - I386_TRUE= - I386_FALSE='#' + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - I386_TRUE='#' - I386_FALSE= + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" - if test x$arch = xx86_64; then - X86_64_TRUE= - X86_64_FALSE='#' -else - X86_64_TRUE='#' - X86_64_FALSE= fi - - if test x$arch = xx32; then - X32_TRUE= - X32_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - X32_TRUE='#' - X32_FALSE= + gl_unknown_warnings_are_errors= fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for primary include directory" >&5 -$as_echo_n "checking for primary include directory... " >&6; } -includedir=/usr/include -if test -n "$GCC" -then - >conftest.c - new_includedir=` - $CC -v -E conftest.c 2>&1 | $AWK ' - /^End of search list/ { print last; exit } - { last = $1 } - ' - ` - rm -f conftest.c - if test -n "$new_includedir" && test -d "$new_includedir" - then - includedir=$new_includedir - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $includedir" >&5 -$as_echo "$includedir" >&6; } - -# Check whether --enable-arm-oabi was given. -if test "${enable_arm_oabi+set}" = set; then : - enableval=$enable_arm_oabi; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wnested-externs" >&5 +$as_echo_n "checking whether $CC handles -Wnested-externs... " >&6; } +if ${gl_cv_warn_CFLAGS__Wnested_externs+:} false; then : + $as_echo_n "(cached) " >&6 else - enable_arm_oabi=no -fi -case "$enable_arm_oabi" in - yes) enable_arm_oabi=1 ;; - no) enable_arm_oabi=0 ;; - *) as_fn_error $? "bad value $enable_arm_oabi for arm-oabi option" "$LINENO" 5 ;; -esac + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wnested-externs" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define ENABLE_ARM_OABI $enable_arm_oabi +int +main () +{ + + ; + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wnested_externs=yes +else + gl_cv_warn_CFLAGS__Wnested_externs=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wnested_externs" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wnested_externs" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wnested_externs" = xyes; then : + as_fn_append WARN_CFLAGS " -Wnested-externs" +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wall" >&5 -$as_echo_n "checking whether compiler handles -Wall... " >&6; } -if ${gl_cv_warn__Wall+:} false; then : +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="${CPPFLAGS} -Wall" + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5063,29 +5142,35 @@ main () return 0; } _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - gl_cv_warn__Wall=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - gl_cv_warn__Wall=no + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f conftest.err conftest.i conftest.$ac_ext - CPPFLAGS="$save_CPPFLAGS" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wall" >&5 -$as_echo "$gl_cv_warn__Wall" >&6; } -if test "x$gl_cv_warn__Wall" = xyes; then : - as_fn_append WARN_CFLAGS " -Wall" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wwrite-strings" >&5 -$as_echo_n "checking whether compiler handles -Wwrite-strings... " >&6; } -if ${gl_cv_warn__Wwrite_strings+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wold-style-declaration" >&5 +$as_echo_n "checking whether $CC handles -Wold-style-declaration... " >&6; } +if ${gl_cv_warn_CFLAGS__Wold_style_declaration+:} false; then : $as_echo_n "(cached) " >&6 else - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="${CPPFLAGS} -Wwrite-strings" + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wold-style-declaration" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5097,32 +5182,32 @@ main () return 0; } _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - gl_cv_warn__Wwrite_strings=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wold_style_declaration=yes else - gl_cv_warn__Wwrite_strings=no + gl_cv_warn_CFLAGS__Wold_style_declaration=no fi -rm -f conftest.err conftest.i conftest.$ac_ext - CPPFLAGS="$save_CPPFLAGS" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wwrite_strings" >&5 -$as_echo "$gl_cv_warn__Wwrite_strings" >&6; } -if test "x$gl_cv_warn__Wwrite_strings" = xyes; then : - as_fn_append WARN_CFLAGS " -Wwrite-strings" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wold_style_declaration" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wold_style_declaration" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wold_style_declaration" = xyes; then : + as_fn_append WARN_CFLAGS " -Wold-style-declaration" fi -# Check whether --enable-gcc-Werror was given. -if test "${enable_gcc_Werror+set}" = set; then : - enableval=$enable_gcc_Werror; case $enableval in - yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Werror" >&5 -$as_echo_n "checking whether compiler handles -Werror... " >&6; } -if ${gl_cv_warn__Werror+:} false; then : + +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="${CPPFLAGS} -Werror" + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5134,172 +5219,112 @@ main () return 0; } _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - gl_cv_warn__Werror=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - gl_cv_warn__Werror=no + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f conftest.err conftest.i conftest.$ac_ext - CPPFLAGS="$save_CPPFLAGS" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Werror" >&5 -$as_echo "$gl_cv_warn__Werror" >&6; } -if test "x$gl_cv_warn__Werror" = xyes; then : - as_fn_append WARN_CFLAGS " -Werror" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= fi - ;; - no) ;; - *) as_fn_error $? "bad value $enableval for gcc-Werror option" "$LINENO" 5 ;; - esac + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wold-style-definition" >&5 +$as_echo_n "checking whether $CC handles -Wold-style-definition... " >&6; } +if ${gl_cv_warn_CFLAGS__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wold-style-definition" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext +int +main () +{ - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wold_style_definition=yes else - # Passes both tests. -ac_preproc_ok=: -break + gl_cv_warn_CFLAGS__Wold_style_definition=no fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wold_style_definition" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wold_style_definition" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wold_style_definition" = xyes; then : + as_fn_append WARN_CFLAGS " -Wold-style-definition" fi - done - ac_cv_prog_CPP=$CPP -fi - CPP=$ac_cv_prog_CPP +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext +int +main () +{ - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - # Passes both tests. -ac_preproc_ok=: -break + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + gl_unknown_warnings_are_errors= fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wsign-compare" >&5 +$as_echo_n "checking whether $CC handles -Wsign-compare... " >&6; } +if ${gl_cv_warn_CFLAGS__Wsign_compare+:} false; then : $as_echo_n "(cached) " >&6 else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5307,310 +5332,195 @@ int main () { -#ifndef __cplusplus - /* Ultrix mips cc rejects this sort of thing. */ - typedef int charset[2]; - const charset cs = { 0, 0 }; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this sort of thing. */ - char tx; - char *t = &tx; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; } bx; - struct s *b = &bx; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wsign_compare=yes else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + gl_cv_warn_CFLAGS__Wsign_compare=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wsign_compare" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wsign_compare" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wsign_compare" = xyes; then : + as_fn_append WARN_CFLAGS " -Wsign-compare" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : + +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wtype-limits" >&5 +$as_echo_n "checking whether $CC handles -Wtype-limits... " >&6; } +if ${gl_cv_warn_CFLAGS__Wtype_limits+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtype-limits" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wtype_limits=yes else - ac_cv_c_bigendian=no + gl_cv_warn_CFLAGS__Wtype_limits=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wtype_limits" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wtype_limits" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wtype_limits" = xyes; then : + as_fn_append WARN_CFLAGS " -Wtype-limits" +fi + + +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include int main () { -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - ac_cv_c_bigendian=no + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wwrite-strings" >&5 +$as_echo_n "checking whether $CC handles -Wwrite-strings... " >&6; } +if ${gl_cv_warn_CFLAGS__Wwrite_strings+:} false; then : + $as_echo_n "(cached) " >&6 else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wwrite-strings" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wwrite_strings=yes else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + gl_cv_warn_CFLAGS__Wwrite_strings=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wwrite_strings" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wwrite_strings" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wwrite_strings" = xyes; then : + as_fn_append WARN_CFLAGS " -Wwrite-strings" +fi - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +# Check whether --enable-gcc-Werror was given. +if test "${enable_gcc_Werror+set}" = set; then : + enableval=$enable_gcc_Werror; case $enableval in + yes) if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include int main () @@ -5620,5388 +5530,8042 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes else - ac_cv_header_stdc=no + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_cv_header_stdc=no + gl_unknown_warnings_are_errors= fi -rm -f conftest* + fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror" >&5 +$as_echo_n "checking whether $CC handles -Werror... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror+:} false; then : + $as_echo_n "(cached) " >&6 else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; + + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror=yes else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + gl_cv_warn_CFLAGS__Werror=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror" = xyes; then : + as_fn_append WARN_CFLAGS " -Werror" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + ;; + no) ;; + *) as_fn_error $? "bad value $enableval for gcc-Werror option" "$LINENO" 5 ;; + esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if ${ac_cv_header_stdbool_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; -int -main () -{ - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdbool_h=yes -else - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF +if test -n "${ac_c_decl_warn_flag+set}"; then : + st_saved_ac_c_decl_warn_flag="${ac_c_decl_warn_flag}"; unset ac_c_decl_warn_flag +fi +if test -n "${ac_c_preproc_warn_flag+set}"; then : + st_saved_ac_c_preproc_warn_flag="${ac_c_preproc_warn_flag}"; unset ac_c_preproc_warn_flag +fi +if test -n "${ac_c_werror_flag+set}"; then : + st_saved_ac_c_werror_flag="${ac_c_werror_flag}"; unset ac_c_werror_flag fi +if test -n "${ac_compile+set}"; then : + st_saved_ac_compile="${ac_compile}"; unset ac_compile +fi -if test $ac_cv_header_stdbool_h = yes; then +if test -n "${ac_compiler_gnu+set}"; then : + st_saved_ac_compiler_gnu="${ac_compiler_gnu}"; unset ac_compiler_gnu +fi -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h +if test -n "${ac_cpp+set}"; then : + st_saved_ac_cpp="${ac_cpp}"; unset ac_cpp +fi +if test -n "${ac_cv_c_compiler_gnu+set}"; then : + st_saved_ac_cv_c_compiler_gnu="${ac_cv_c_compiler_gnu}"; unset ac_cv_c_compiler_gnu fi -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> +if test -n "${ac_cv_c_decl_report+set}"; then : + st_saved_ac_cv_c_decl_report="${ac_cv_c_decl_report}"; unset ac_cv_c_decl_report +fi -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" +if test -n "${ac_link+set}"; then : + st_saved_ac_link="${ac_link}"; unset ac_link fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test -n "${ac_tool_prefix+set}"; then : + st_saved_ac_tool_prefix="${ac_tool_prefix}"; unset ac_tool_prefix fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF -ac_header_dirent=$ac_hdr; break +if test -n "${cross_compiling+set}"; then : + st_saved_cross_compiling="${cross_compiling}"; unset cross_compiling fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : +cross_compiling=no + +{ $as_echo "$as_me:${as_lineno-$LINENO}: looking for a C compiler that generates native executables" >&5 +$as_echo "$as_me: looking for a C compiler that generates native executables" >&6;} +ac_ext=c +ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi done -if ${ac_cv_search_opendir+:} false; then : + done +IFS=$as_save_IFS -else - ac_cv_search_opendir=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : + +fi +if test -z "$ac_cv_prog_CC_FOR_BUILD"; then + ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC_FOR_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" + if test -n "$ac_ct_CC_FOR_BUILD"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi done -if ${ac_cv_search_opendir+:} false; then : + done +IFS=$as_save_IFS -else - ac_cv_search_opendir=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - +ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD +if test -n "$ac_ct_CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 +$as_echo "$ac_ct_CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "x$ac_ct_CC_FOR_BUILD" = x; then + CC_FOR_BUILD="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD + fi +else + CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 -$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } -if ${ac_cv_header_stat_broken+:} false; then : +if test -z "$CC_FOR_BUILD"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -#if defined S_ISBLK && defined S_IFDIR -extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; -#endif - -#if defined S_ISBLK && defined S_IFCHR -extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; -#endif - -#if defined S_ISLNK && defined S_IFREG -extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; -#endif - -#if defined S_ISSOCK && defined S_IFREG -extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stat_broken=no + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else - ac_cv_header_stat_broken=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 -$as_echo "$ac_cv_header_stat_broken" >&6; } -if test $ac_cv_header_stat_broken = yes; then - -$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - -ac_fn_c_check_member "$LINENO" "struct stat" "st_aclcnt" "ac_cv_member_struct_stat_st_aclcnt" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_aclcnt" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_ACLCNT 1 -_ACEOF - - fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -_ACEOF - - +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLOCKS 1 -_ACEOF + fi fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_FLAGS 1 -_ACEOF - +if test -z "$CC_FOR_BUILD"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC_FOR_BUILD="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC_FOR_BUILD + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC_FOR_BUILD to just the basename; use the full file name. + shift + ac_cv_prog_CC_FOR_BUILD="$as_dir/$ac_word${1+' '}$@" + fi fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_fstype" "ac_cv_member_struct_stat_st_fstype" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_fstype" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_FSTYPE 1 -_ACEOF - - fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_gen" "ac_cv_member_struct_stat_st_gen" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_GEN 1 -_ACEOF - - fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_level" "ac_cv_member_struct_stat_st_level" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_level" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_LEVEL 1 -_ACEOF - - +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_RDEV 1 -_ACEOF fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stat64 in (asm|sys)/stat.h" >&5 -$as_echo_n "checking for stat64 in (asm|sys)/stat.h... " >&6; } -if ${ac_cv_type_stat64+:} false; then : +if test -z "$CC_FOR_BUILD"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include - -int -main () -{ -struct stat64 st; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_stat64=yes + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else - ac_cv_type_stat64=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_BUILD="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_stat64" >&5 -$as_echo "$ac_cv_type_stat64" >&6; } -if test "$ac_cv_type_stat64" = yes -then - -$as_echo "#define HAVE_STAT64 1" >>confdefs.h + test -n "$CC_FOR_BUILD" && break + done fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs64 in sys/vfs.h" >&5 -$as_echo_n "checking for statfs64 in sys/vfs.h... " >&6; } -if ${ac_cv_type_statfs64+:} false; then : +if test -z "$CC_FOR_BUILD"; then + ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC_FOR_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -struct statfs64 st; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_statfs64=yes + if test -n "$ac_ct_CC_FOR_BUILD"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else - ac_cv_type_statfs64=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD +if test -n "$ac_ct_CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 +$as_echo "$ac_ct_CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_statfs64" >&5 -$as_echo "$ac_cv_type_statfs64" >&6; } -if test "$ac_cv_type_statfs64" = yes -then -$as_echo "#define HAVE_STATFS64 1" >>confdefs.h + test -n "$ac_ct_CC_FOR_BUILD" && break +done + + if test "x$ac_ct_CC_FOR_BUILD" = x; then + CC_FOR_BUILD="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD + fi +fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : +test -z "$CC_FOR_BUILD" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include int main () { -return *(signal (0, 0)) (0) == 1; +#ifndef __GNUC__ + choke me +#endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int + ac_compiler_gnu=yes else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_compiler_gnu=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS_FOR_BUILD+set} +ac_save_CFLAGS=$CFLAGS_FOR_BUILD +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD accepts -g" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD accepts -g... " >&6; } +if ${ac_cv_build_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_build_prog_cc_g=no + CFLAGS_FOR_BUILD="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +int +main () +{ + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : - ac_cv_type_uid_t=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_build_prog_cc_g=yes else - ac_cv_type_uid_t=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then - -$as_echo "#define uid_t int" >>confdefs.h - - -$as_echo "#define gid_t int" >>confdefs.h - -fi - -ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : + CFLAGS_FOR_BUILD="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -else +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define mode_t int + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5 -$as_echo_n "checking type of array argument to getgroups... " >&6; } -if ${ac_cv_type_getgroups+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_type_getgroups=cross else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS_FOR_BUILD="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Thanks to Mike Rendell for this test. */ -$ac_includes_default -#define NGID 256 -#undef MAX -#define MAX(x, y) ((x) > (y) ? (x) : (y)) int main () { - gid_t gidset[NGID]; - int i, n; - union { gid_t gval; long int lval; } val; - - val.lval = -1; - for (i = 0; i < NGID; i++) - gidset[i] = val.gval; - n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, - gidset); - /* Exit non-zero if getgroups seems to require an array of ints. This - happens when gid_t is short int but getgroups modifies an array - of ints. */ - return n > 0 && gidset[n] != val.gval; + + ; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_type_getgroups=gid_t -else - ac_cv_type_getgroups=int +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_build_prog_cc_g=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext fi - -if test $ac_cv_type_getgroups = cross; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then : - ac_cv_type_getgroups=gid_t -else - ac_cv_type_getgroups=int +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 +$as_echo "$ac_cv_build_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS_FOR_BUILD=$ac_save_CFLAGS +elif test $ac_cv_build_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS_FOR_BUILD="-g -O2" + else + CFLAGS_FOR_BUILD="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS_FOR_BUILD="-O2" + else + CFLAGS_FOR_BUILD= + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5 -$as_echo "$ac_cv_type_getgroups" >&6; } - -cat >>confdefs.h <<_ACEOF -#define GETGROUPS_T $ac_cv_type_getgroups -_ACEOF - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5 -$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } -if ${ac_cv_header_sys_types_h_makedev+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to accept ISO C89" >&5 +$as_echo_n "checking for $CC_FOR_BUILD option to accept ISO C89... " >&6; } +if ${ac_cv_build_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_build_prog_cc_c89=no +ac_save_CC=$CC_FOR_BUILD +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -return makedev(0, 0); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_header_sys_types_h_makedev=yes -else - ac_cv_header_sys_types_h_makedev=no +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC_FOR_BUILD="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_build_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_build_objext + test "x$ac_cv_build_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC_FOR_BUILD=$ac_save_CC fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5 -$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } - -if test $ac_cv_header_sys_types_h_makedev = no; then -ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : - -$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h +# AC_CACHE_VAL +case "x$ac_cv_build_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c89" >&5 +$as_echo "$ac_cv_build_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_build_prog_cc_c89" != xno; then : fi +ac_ext=c +ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD understands -c and -o together" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD understands -c and -o together... " >&6; } +if ${am_cv_build_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test $ac_cv_header_sys_mkdev_h = no; then - ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : - -$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h - -fi - +int +main () +{ - fi + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_build_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext" >&5 + ($CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_build_objext; then + : OK + else + am_cv_build_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_build_prog_cc_c_o" >&5 +$as_echo "$am_cv_build_prog_cc_c_o" >&6; } +if test "$am_cv_build_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC_FOR_BUILD="$am_aux_dir/compile $CC_FOR_BUILD" fi +ac_ext=c +ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include -" -if test "x$ac_cv_type_sig_atomic_t" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_SIG_ATOMIC_T 1 -_ACEOF +depcc="$CC_FOR_BUILD" am_compiler_list= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_build_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -fi -ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" "#include -" -if test "x$ac_cv_type_siginfo_t" = xyes; then : + am_cv_build_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T 1 -_ACEOF + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_build_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + cd .. + rm -rf conftest.dir +else + am_cv_build_CC_dependencies_compiler_type=none fi -ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "#include -#include -#include -" -if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_build_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_build_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_build_CC_dependencies_compiler_type -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1 -_ACEOF + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_build_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi +ac_ext=c +ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then + CPP_FOR_BUILD= fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for little endian long long" >&5 -$as_echo_n "checking for little endian long long... " >&6; } -if ${ac_cv_have_little_endian_long_long+:} false; then : +if test -z "$CPP_FOR_BUILD"; then + if ${ac_cv_build_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + # Double quotes because CPP needs to be expanded + for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : -if test "x$ac_cv_c_bigendian" = "xyes"; then - ac_cv_have_little_endian_long_long=no else - ac_cv_have_little_endian_long_long=yes + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext -else + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int main () { - union { - long long ll; - int l [2]; - } u; - u.ll = 0x12345678; - if (u.l[0] == 0x12345678) - return 0; - return 1; -} - +#include _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_have_little_endian_long_long=yes +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - ac_cv_have_little_endian_long_long=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_little_endian_long_long" >&5 -$as_echo "$ac_cv_have_little_endian_long_long" >&6; } -if test "$ac_cv_have_little_endian_long_long" = yes -then - -$as_echo "#define HAVE_LITTLE_ENDIAN_LONG_LONG 1" >>confdefs.h + done + ac_cv_build_prog_CPP=$CPP_FOR_BUILD fi - - -for ac_func in fopen64 fork fputs_unlocked if_indextoname inet_ntop prctl preadv process_vm_readv pwritev sendmsg sigaction stpcpy strerror strsignal -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - + CPP_FOR_BUILD=$ac_cv_build_prog_CPP +else + ac_cv_build_prog_CPP=$CPP_FOR_BUILD fi -done - -for ac_header in asm/cachectl.h asm/sysmips.h elf.h inttypes.h ioctls.h linux/capability.h linux/perf_event.h linux/ptrace.h linux/utsname.h mqueue.h netinet/sctp.h poll.h scsi/sg.h stropts.h sys/acl.h sys/asynch.h sys/conf.h sys/epoll.h sys/filio.h sys/ioctl.h sys/poll.h sys/ptrace.h sys/reg.h sys/uio.h sys/vfs.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP_FOR_BUILD" >&5 +$as_echo "$CPP_FOR_BUILD" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext -done - -for ac_header in linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include -#include -#include -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include _ACEOF - +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : -for ac_header in asm/sigcontext.h -do : - ac_fn_c_check_header_compile "$LINENO" "asm/sigcontext.h" "ac_cv_header_asm_sigcontext_h" "#include -" -if test "x$ac_cv_header_asm_sigcontext_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ASM_SIGCONTEXT_H 1 -_ACEOF - +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi -done +ac_ext=c +ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_fn_c_check_type "$LINENO" "struct sigcontext" "ac_cv_type_struct_sigcontext" "#include -" -if test "x$ac_cv_type_struct_sigcontext" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SIGCONTEXT 1 -_ACEOF +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else -fi + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -for ac_header in netinet/tcp.h netinet/udp.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -done - - -ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" "#include -" -if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_MSGHDR_MSG_CONTROL 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_build_unknown_warnings_are_errors= +fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wall" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wall... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wall+:} false; then : + $as_echo_n "(cached) " >&6 +else -ac_fn_c_check_type "$LINENO" "struct __old_kernel_stat" "ac_cv_type_struct___old_kernel_stat" "#include -" -if test "x$ac_cv_type_struct___old_kernel_stat" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT___OLD_KERNEL_STAT 1 -_ACEOF + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wall" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wall=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Wall=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wall" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wall" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wall" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wall" +fi -ac_fn_c_check_type "$LINENO" "struct pt_all_user_regs" "ac_cv_type_struct_pt_all_user_regs" "#include -" -if test "x$ac_cv_type_struct_pt_all_user_regs" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_PT_ALL_USER_REGS 1 -_ACEOF +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -ac_fn_c_check_type "$LINENO" "struct ia64_fpreg" "ac_cv_type_struct_ia64_fpreg" "#include -" -if test "x$ac_cv_type_struct_ia64_fpreg" = xyes; then : +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_IA64_FPREG 1 + ; + return 0; +} _ACEOF - - +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi -ac_fn_c_check_type "$LINENO" "struct ptrace_peeksiginfo_args" "ac_cv_type_struct_ptrace_peeksiginfo_args" "#include -" -if test "x$ac_cv_type_struct_ptrace_peeksiginfo_args" = xyes; then : +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_build_unknown_warnings_are_errors= +fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wempty-body" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wempty-body... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wempty_body+:} false; then : + $as_echo_n "(cached) " >&6 +else -ac_fn_c_check_member "$LINENO" "struct utsname" "domainname" "ac_cv_member_struct_utsname_domainname" "#include -" -if test "x$ac_cv_member_struct_utsname_domainname" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_UTSNAME_DOMAINNAME 1 -_ACEOF + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wempty-body" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wempty_body=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Wempty_body=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wempty_body" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wempty_body" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wempty_body" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wempty-body" +fi -ac_fn_c_check_member "$LINENO" "struct sigevent" "_sigev_un._pad" "ac_cv_member_struct_sigevent__sigev_un__pad" "#include -" -if test "x$ac_cv_member_struct_sigevent__sigev_un__pad" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SIGEVENT__SIGEV_UN__PAD 1 -_ACEOF +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -ac_fn_c_check_member "$LINENO" "struct sigevent" "__pad" "ac_cv_member_struct_sigevent___pad" "#include -" -if test "x$ac_cv_member_struct_sigevent___pad" = xyes; then : +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SIGEVENT___PAD 1 + ; + return 0; +} _ACEOF - - +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi -ac_fn_c_check_member "$LINENO" "siginfo_t" "si_syscall" "ac_cv_member_siginfo_t_si_syscall" "#include -" -if test "x$ac_cv_member_siginfo_t_si_syscall" = xyes; then : +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T_SI_SYSCALL 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_build_unknown_warnings_are_errors= +fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wformat-security" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wformat-security... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wformat_security+:} false; then : + $as_echo_n "(cached) " >&6 +else -ac_fn_c_check_type "$LINENO" "struct flock64" "ac_cv_type_struct_flock64" "#include -" -if test "x$ac_cv_type_struct_flock64" = xyes; then : + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wformat-security" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_FLOCK64 1 -_ACEOF +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wformat_security=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Wformat_security=no +fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wformat_security" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wformat_security" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wformat_security" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wformat-security" +fi -ac_fn_c_check_decl "$LINENO" "sys_errlist" "ac_cv_have_decl_sys_errlist" "$ac_includes_default" -if test "x$ac_cv_have_decl_sys_errlist" = xyes; then : - ac_have_decl=1 +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_ERRLIST $ac_have_decl -_ACEOF + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -ac_fn_c_check_decl "$LINENO" "PTRACE_EVENT_CLONE" "ac_cv_have_decl_PTRACE_EVENT_CLONE" "#include -" -if test "x$ac_cv_have_decl_PTRACE_EVENT_CLONE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_EVENT_CLONE $ac_have_decl + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_EVENT_EXEC" "ac_cv_have_decl_PTRACE_EVENT_EXEC" "#include -" -if test "x$ac_cv_have_decl_PTRACE_EVENT_EXEC" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_EVENT_EXEC $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_EVENT_EXIT" "ac_cv_have_decl_PTRACE_EVENT_EXIT" "#include -" -if test "x$ac_cv_have_decl_PTRACE_EVENT_EXIT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_EVENT_EXIT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_EVENT_FORK" "ac_cv_have_decl_PTRACE_EVENT_FORK" "#include -" -if test "x$ac_cv_have_decl_PTRACE_EVENT_FORK" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_EVENT_FORK $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_EVENT_VFORK" "ac_cv_have_decl_PTRACE_EVENT_VFORK" "#include -" -if test "x$ac_cv_have_decl_PTRACE_EVENT_VFORK" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_EVENT_VFORK $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_EVENT_VFORK_DONE" "ac_cv_have_decl_PTRACE_EVENT_VFORK_DONE" "#include -" -if test "x$ac_cv_have_decl_PTRACE_EVENT_VFORK_DONE" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wignored-qualifiers" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wignored-qualifiers... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wignored_qualifiers+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_EVENT_VFORK_DONE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_GETEVENTMSG" "ac_cv_have_decl_PTRACE_GETEVENTMSG" "#include -" -if test "x$ac_cv_have_decl_PTRACE_GETEVENTMSG" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wignored-qualifiers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_GETEVENTMSG $ac_have_decl +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_GETSIGINFO" "ac_cv_have_decl_PTRACE_GETSIGINFO" "#include -" -if test "x$ac_cv_have_decl_PTRACE_GETSIGINFO" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wignored_qualifiers=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wignored_qualifiers=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_GETSIGINFO $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_O_TRACECLONE" "ac_cv_have_decl_PTRACE_O_TRACECLONE" "#include -" -if test "x$ac_cv_have_decl_PTRACE_O_TRACECLONE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wignored_qualifiers" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wignored_qualifiers" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wignored_qualifiers" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wignored-qualifiers" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_O_TRACECLONE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_O_TRACEEXEC" "ac_cv_have_decl_PTRACE_O_TRACEEXEC" "#include -" -if test "x$ac_cv_have_decl_PTRACE_O_TRACEEXEC" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_O_TRACEEXEC $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_O_TRACEEXIT" "ac_cv_have_decl_PTRACE_O_TRACEEXIT" "#include -" -if test "x$ac_cv_have_decl_PTRACE_O_TRACEEXIT" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_O_TRACEEXIT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_O_TRACEFORK" "ac_cv_have_decl_PTRACE_O_TRACEFORK" "#include -" -if test "x$ac_cv_have_decl_PTRACE_O_TRACEFORK" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_O_TRACEFORK $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_O_TRACESYSGOOD" "ac_cv_have_decl_PTRACE_O_TRACESYSGOOD" "#include -" -if test "x$ac_cv_have_decl_PTRACE_O_TRACESYSGOOD" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_O_TRACESYSGOOD $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_O_TRACEVFORK" "ac_cv_have_decl_PTRACE_O_TRACEVFORK" "#include -" -if test "x$ac_cv_have_decl_PTRACE_O_TRACEVFORK" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Winit-self" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Winit-self... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_O_TRACEVFORK $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Winit-self" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_PEEKUSER" "ac_cv_have_decl_PTRACE_PEEKUSER" "#include -" -if test "x$ac_cv_have_decl_PTRACE_PEEKUSER" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_PEEKUSER $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_POKEUSER" "ac_cv_have_decl_PTRACE_POKEUSER" "#include -" -if test "x$ac_cv_have_decl_PTRACE_POKEUSER" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Winit-self" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_POKEUSER $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_SETOPTIONS" "ac_cv_have_decl_PTRACE_SETOPTIONS" "#include -" -if test "x$ac_cv_have_decl_PTRACE_SETOPTIONS" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_SETOPTIONS $ac_have_decl -_ACEOF + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ -ac_fn_c_check_decl "$LINENO" "P_PID" "ac_cv_have_decl_P_PID" "#include -" -if test "x$ac_cv_have_decl_P_PID" = xyes; then : - ac_have_decl=1 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_PID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "P_PPID" "ac_cv_have_decl_P_PPID" "#include -" -if test "x$ac_cv_have_decl_P_PPID" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_PPID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "P_PGID" "ac_cv_have_decl_P_PGID" "#include -" -if test "x$ac_cv_have_decl_P_PGID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_PGID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "P_SID" "ac_cv_have_decl_P_SID" "#include -" -if test "x$ac_cv_have_decl_P_SID" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wlogical-op" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wlogical-op... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_SID $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "P_CID" "ac_cv_have_decl_P_CID" "#include -" -if test "x$ac_cv_have_decl_P_CID" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_CID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "P_UID" "ac_cv_have_decl_P_UID" "#include -" -if test "x$ac_cv_have_decl_P_UID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wlogical-op" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_UID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "P_GID" "ac_cv_have_decl_P_GID" "#include -" -if test "x$ac_cv_have_decl_P_GID" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_GID $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "P_ALL" "ac_cv_have_decl_P_ALL" "#include -" -if test "x$ac_cv_have_decl_P_ALL" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_ALL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "P_LWPID" "ac_cv_have_decl_P_LWPID" "#include -" -if test "x$ac_cv_have_decl_P_LWPID" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_LWPID $ac_have_decl -_ACEOF +fi -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_READ_ONLY" "ac_cv_have_decl_LO_FLAGS_READ_ONLY" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_READ_ONLY" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wmissing-parameter-type" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wmissing-parameter-type... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_READ_ONLY $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wmissing-parameter-type" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_AUTOCLEAR" "ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_AUTOCLEAR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_PARTSCAN" "ac_cv_have_decl_LO_FLAGS_PARTSCAN" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_PARTSCAN" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_PARTSCAN $ac_have_decl -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wmissing-parameter-type" +fi -ac_fn_c_check_decl "$LINENO" "CTL_KERN" "ac_cv_have_decl_CTL_KERN" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_KERN" = xyes; then : - ac_have_decl=1 +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_KERN $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_VM" "ac_cv_have_decl_CTL_VM" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_VM" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_VM $ac_have_decl +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_NET" "ac_cv_have_decl_CTL_NET" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_NET" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_NET $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_PROC" "ac_cv_have_decl_CTL_PROC" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_PROC" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_PROC $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_FS" "ac_cv_have_decl_CTL_FS" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_FS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_FS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_DEBUG" "ac_cv_have_decl_CTL_DEBUG" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_DEBUG" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wnested-externs" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wnested-externs... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wnested_externs+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_DEBUG $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wnested-externs" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_DEV" "ac_cv_have_decl_CTL_DEV" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_DEV" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wnested_externs=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wnested_externs=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_DEV $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_BUS" "ac_cv_have_decl_CTL_BUS" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_BUS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wnested_externs" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wnested_externs" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wnested_externs" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wnested-externs" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_BUS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_ABI" "ac_cv_have_decl_CTL_ABI" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_ABI" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_ABI $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_CPU" "ac_cv_have_decl_CTL_CPU" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_CPU" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_CPU $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_ARLAN" "ac_cv_have_decl_CTL_ARLAN" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_ARLAN" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_ARLAN $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_S390DBF" "ac_cv_have_decl_CTL_S390DBF" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_S390DBF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_S390DBF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_SUNRPC" "ac_cv_have_decl_CTL_SUNRPC" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_SUNRPC" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wold-style-declaration" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wold-style-declaration... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_declaration+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_SUNRPC $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wold-style-declaration" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_PM" "ac_cv_have_decl_CTL_PM" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_PM" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_declaration=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_declaration=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_PM $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_FRV" "ac_cv_have_decl_CTL_FRV" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_FRV" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_declaration" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_declaration" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_declaration" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wold-style-declaration" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_FRV $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_OSTYPE" "ac_cv_have_decl_KERN_OSTYPE" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_OSTYPE" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_OSTYPE $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_OSRELEASE" "ac_cv_have_decl_KERN_OSRELEASE" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_OSRELEASE" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_OSRELEASE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_OSREV" "ac_cv_have_decl_KERN_OSREV" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_OSREV" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_OSREV $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_VERSION" "ac_cv_have_decl_KERN_VERSION" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_VERSION" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_VERSION $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SECUREMASK" "ac_cv_have_decl_KERN_SECUREMASK" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SECUREMASK" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wold-style-definition" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wold-style-definition... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SECUREMASK $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wold-style-definition" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PROF" "ac_cv_have_decl_KERN_PROF" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PROF" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_definition=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_definition=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PROF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_NODENAME" "ac_cv_have_decl_KERN_NODENAME" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_NODENAME" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_definition" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_definition" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wold_style_definition" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wold-style-definition" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_NODENAME $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_DOMAINNAME" "ac_cv_have_decl_KERN_DOMAINNAME" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_DOMAINNAME" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_DOMAINNAME $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PANIC" "ac_cv_have_decl_KERN_PANIC" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PANIC" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PANIC $ac_have_decl +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_REALROOTDEV" "ac_cv_have_decl_KERN_REALROOTDEV" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_REALROOTDEV" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_REALROOTDEV $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SPARC_REBOOT" "ac_cv_have_decl_KERN_SPARC_REBOOT" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SPARC_REBOOT" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SPARC_REBOOT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_CTLALTDEL" "ac_cv_have_decl_KERN_CTLALTDEL" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_CTLALTDEL" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_CTLALTDEL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PRINTK" "ac_cv_have_decl_KERN_PRINTK" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PRINTK" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wsign-compare" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wsign-compare... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wsign_compare+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PRINTK $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_NAMETRANS" "ac_cv_have_decl_KERN_NAMETRANS" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_NAMETRANS" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wsign_compare=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wsign_compare=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_NAMETRANS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PPC_HTABRECLAIM" "ac_cv_have_decl_KERN_PPC_HTABRECLAIM" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PPC_HTABRECLAIM" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wsign_compare" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wsign_compare" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wsign_compare" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wsign-compare" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PPC_HTABRECLAIM $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PPC_ZEROPAGED" "ac_cv_have_decl_KERN_PPC_ZEROPAGED" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PPC_ZEROPAGED" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PPC_ZEROPAGED $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PPC_POWERSAVE_NAP" "ac_cv_have_decl_KERN_PPC_POWERSAVE_NAP" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PPC_POWERSAVE_NAP" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PPC_POWERSAVE_NAP $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MODPROBE" "ac_cv_have_decl_KERN_MODPROBE" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_MODPROBE" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MODPROBE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SG_BIG_BUFF" "ac_cv_have_decl_KERN_SG_BIG_BUFF" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SG_BIG_BUFF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SG_BIG_BUFF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_ACCT" "ac_cv_have_decl_KERN_ACCT" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_ACCT" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wtype-limits" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wtype-limits... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wtype_limits+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_ACCT $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wtype-limits" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PPC_L2CR" "ac_cv_have_decl_KERN_PPC_L2CR" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PPC_L2CR" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wtype_limits=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wtype_limits=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PPC_L2CR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_RTSIGNR" "ac_cv_have_decl_KERN_RTSIGNR" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_RTSIGNR" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wtype_limits" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wtype_limits" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wtype_limits" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wtype-limits" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_RTSIGNR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_RTSIGMAX" "ac_cv_have_decl_KERN_RTSIGMAX" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_RTSIGMAX" = xyes; then : - ac_have_decl=1 + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_RTSIGMAX $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SHMMAX" "ac_cv_have_decl_KERN_SHMMAX" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SHMMAX" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SHMMAX $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MSGMAX" "ac_cv_have_decl_KERN_MSGMAX" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_MSGMAX" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MSGMAX $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MSGMNB" "ac_cv_have_decl_KERN_MSGMNB" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_MSGMNB" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MSGMNB $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MSGPOOL" "ac_cv_have_decl_KERN_MSGPOOL" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_MSGPOOL" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wwrite-strings" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wwrite-strings... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wwrite_strings+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MSGPOOL $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wwrite-strings" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SYSRQ" "ac_cv_have_decl_KERN_SYSRQ" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SYSRQ" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wwrite_strings=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Wwrite_strings=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SYSRQ $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MAX_THREADS" "ac_cv_have_decl_KERN_MAX_THREADS" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_MAX_THREADS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wwrite_strings" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wwrite_strings" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wwrite_strings" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wwrite-strings" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MAX_THREADS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_RANDOM" "ac_cv_have_decl_KERN_RANDOM" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_RANDOM" = xyes; then : - ac_have_decl=1 + +# Check whether --enable-gcc-Werror was given. +if test "${enable_gcc_Werror+set}" = set; then : + enableval=$enable_gcc_Werror; case $enableval in + yes) if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_RANDOM $ac_have_decl + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SHMALL" "ac_cv_have_decl_KERN_SHMALL" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SHMALL" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SHMALL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MSGMNI" "ac_cv_have_decl_KERN_MSGMNI" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_MSGMNI" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' else - ac_have_decl=0 + gl_build_unknown_warnings_are_errors= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MSGMNI $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SEM" "ac_cv_have_decl_KERN_SEM" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SEM" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SEM $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SPARC_STOP_A" "ac_cv_have_decl_KERN_SPARC_STOP_A" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SPARC_STOP_A" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SPARC_STOP_A $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SHMMNI" "ac_cv_have_decl_KERN_SHMMNI" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SHMMNI" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SHMMNI $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_OVERFLOWUID" "ac_cv_have_decl_KERN_OVERFLOWUID" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_OVERFLOWUID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_OVERFLOWUID $ac_have_decl + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_OVERFLOWGID" "ac_cv_have_decl_KERN_OVERFLOWGID" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_OVERFLOWGID" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror=yes else - ac_have_decl=0 + gl_cv_warn_CFLAGS_FOR_BUILD__Werror=no fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_OVERFLOWGID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SHMPATH" "ac_cv_have_decl_KERN_SHMPATH" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SHMPATH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SHMPATH $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_HOTPLUG" "ac_cv_have_decl_KERN_HOTPLUG" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_HOTPLUG" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Werror" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_HOTPLUG $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_IEEE_EMULATION_WARNINGS" "ac_cv_have_decl_KERN_IEEE_EMULATION_WARNINGS" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_IEEE_EMULATION_WARNINGS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + ;; + no) ;; + *) as_fn_error $? "bad value $enableval for gcc-Werror option" "$LINENO" 5 ;; + esac + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_IEEE_EMULATION_WARNINGS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_S390_USER_DEBUG_LOGGING" "ac_cv_have_decl_KERN_S390_USER_DEBUG_LOGGING" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_S390_USER_DEBUG_LOGGING" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + +if test -n "${st_saved_cross_compiling+set}"; then : + cross_compiling="${st_saved_cross_compiling}"; unset st_saved_cross_compiling fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_S390_USER_DEBUG_LOGGING $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_CORE_USES_PID" "ac_cv_have_decl_KERN_CORE_USES_PID" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_CORE_USES_PID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_tool_prefix+set}"; then : + ac_tool_prefix="${st_saved_ac_tool_prefix}"; unset st_saved_ac_tool_prefix fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_CORE_USES_PID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_TAINTED" "ac_cv_have_decl_KERN_TAINTED" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_TAINTED" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_link+set}"; then : + ac_link="${st_saved_ac_link}"; unset st_saved_ac_link fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_TAINTED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_CADPID" "ac_cv_have_decl_KERN_CADPID" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_CADPID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_cv_c_decl_report+set}"; then : + ac_cv_c_decl_report="${st_saved_ac_cv_c_decl_report}"; unset st_saved_ac_cv_c_decl_report fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_CADPID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PIDMAX" "ac_cv_have_decl_KERN_PIDMAX" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PIDMAX" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_cv_c_compiler_gnu+set}"; then : + ac_cv_c_compiler_gnu="${st_saved_ac_cv_c_compiler_gnu}"; unset st_saved_ac_cv_c_compiler_gnu fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PIDMAX $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_CORE_PATTERN" "ac_cv_have_decl_KERN_CORE_PATTERN" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_CORE_PATTERN" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_cpp+set}"; then : + ac_cpp="${st_saved_ac_cpp}"; unset st_saved_ac_cpp fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_CORE_PATTERN $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PANIC_ON_OOPS" "ac_cv_have_decl_KERN_PANIC_ON_OOPS" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PANIC_ON_OOPS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_compiler_gnu+set}"; then : + ac_compiler_gnu="${st_saved_ac_compiler_gnu}"; unset st_saved_ac_compiler_gnu fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PANIC_ON_OOPS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_HPPA_PWRSW" "ac_cv_have_decl_KERN_HPPA_PWRSW" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_HPPA_PWRSW" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_compile+set}"; then : + ac_compile="${st_saved_ac_compile}"; unset st_saved_ac_compile fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_HPPA_PWRSW $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_HPPA_UNALIGNED" "ac_cv_have_decl_KERN_HPPA_UNALIGNED" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_HPPA_UNALIGNED" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_c_werror_flag+set}"; then : + ac_c_werror_flag="${st_saved_ac_c_werror_flag}"; unset st_saved_ac_c_werror_flag fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_HPPA_UNALIGNED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_c_preproc_warn_flag+set}"; then : + ac_c_preproc_warn_flag="${st_saved_ac_c_preproc_warn_flag}"; unset st_saved_ac_c_preproc_warn_flag fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PRINTK_RATELIMIT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT_BURST" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test -n "${st_saved_ac_c_decl_warn_flag+set}"; then : + ac_c_decl_warn_flag="${st_saved_ac_c_decl_warn_flag}"; unset st_saved_ac_c_decl_warn_flag fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PRINTK_RATELIMIT_BURST $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PTY" "ac_cv_have_decl_KERN_PTY" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PTY" = xyes; then : - ac_have_decl=1 + + +BUILD_EXEEXT=$ac_build_exeext +BUILD_OBJEXT=$ac_build_objext + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PTY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_NGROUPS_MAX" "ac_cv_have_decl_KERN_NGROUPS_MAX" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_NGROUPS_MAX" = xyes; then : - ac_have_decl=1 +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - ac_have_decl=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_NGROUPS_MAX $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SPARC_SCONS_PWROFF" "ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SPARC_SCONS_PWROFF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_HZ_TIMER" "ac_cv_have_decl_KERN_HZ_TIMER" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_HZ_TIMER" = xyes; then : - ac_have_decl=1 +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - ac_have_decl=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_HZ_TIMER $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_UNKNOWN_NMI_PANIC" "ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" = xyes; then : - ac_have_decl=1 + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else - ac_have_decl=0 + RANLIB="$ac_cv_prog_RANLIB" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_UNKNOWN_NMI_PANIC $ac_have_decl + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + + + # allow to override gcov location + +# Check whether --with-gcov was given. +if test "${with_gcov+set}" = set; then : + withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov +else + _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 +$as_echo_n "checking whether to build with code coverage support... " >&6; } + # Check whether --enable-code-coverage was given. +if test "${enable_code_coverage+set}" = set; then : + enableval=$enable_code_coverage; +else + enable_code_coverage=no +fi + + + if test x$enable_code_coverage = xyes; then + CODE_COVERAGE_ENABLED_TRUE= + CODE_COVERAGE_ENABLED_FALSE='#' +else + CODE_COVERAGE_ENABLED_TRUE='#' + CODE_COVERAGE_ENABLED_FALSE= +fi + + CODE_COVERAGE_ENABLED=$enable_code_coverage + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 +$as_echo "$enable_code_coverage" >&6; } + + if test "$enable_code_coverage" = "yes" ; then : + + # check for gcov + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GCOV"; then + ac_cv_prog_GCOV="$GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GCOV=$ac_cv_prog_GCOV +if test -n "$GCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 +$as_echo "$GCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_GCOV"; then + ac_ct_GCOV=$GCOV + # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_GCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_GCOV"; then + ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV +if test -n "$ac_ct_GCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 +$as_echo "$ac_ct_GCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_GCOV" = x; then + GCOV=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + GCOV=$ac_ct_GCOV + fi +else + GCOV="$ac_cv_prog_GCOV" +fi + + if test "X$GCOV" = "X:"; then : + as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 +fi + + + if test "$GCC" = "no" ; then : + + as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 + +fi + + # List of supported lcov versions. + lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" + + # Extract the first word of "lcov", so it can be a program name with args. +set dummy lcov; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LCOV"; then + ac_cv_prog_LCOV="$LCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LCOV="lcov" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LCOV=$ac_cv_prog_LCOV +if test -n "$LCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 +$as_echo "$LCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "genhtml", so it can be a program name with args. +set dummy genhtml; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GENHTML+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GENHTML"; then + ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GENHTML="genhtml" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GENHTML=$ac_cv_prog_GENHTML +if test -n "$GENHTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 +$as_echo "$GENHTML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + if test "$LCOV" ; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lcov version" >&5 +$as_echo_n "checking for lcov version... " >&6; } +if ${ax_cv_lcov_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_cv_lcov_version=invalid + lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` + for lcov_check_version in $lcov_version_list; do + if test "$lcov_version" = "$lcov_check_version"; then + ax_cv_lcov_version="$lcov_check_version (ok)" + fi + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lcov_version" >&5 +$as_echo "$ax_cv_lcov_version" >&6; } + +else + + lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" + as_fn_error $? "$lcov_msg" "$LINENO" 5 + +fi + + case $ax_cv_lcov_version in + ""|invalid) + lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." + as_fn_error $? "$lcov_msg" "$LINENO" 5 + LCOV="exit 0;" + ;; + esac + + if test -z "$GENHTML" ; then : + + as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 + +fi + + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_LDFLAGS="-lgcov" + + + + + + +fi + +CODE_COVERAGE_RULES=' +# Code coverage +# +# Optional: +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. +# Multiple directories may be specified, separated by whitespace. +# (Default: $(top_builddir)) +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated +# by lcov for code coverage. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage +# reports to be created. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, +# set to 0 to disable it and leave empty to stay with the default. +# (Default: empty) +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering +# lcov instance. (Default: empty) +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore +# +# The generated report will be titled using the $(PACKAGE_NAME) and +# $(PACKAGE_VERSION). In order to add the current git hash to the title, +# use the git-version-gen script, available online. + +# Optional variables +CODE_COVERAGE_DIRECTORY ?= $(top_builddir) +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage +CODE_COVERAGE_BRANCH_COVERAGE ?= +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) +CODE_COVERAGE_IGNORE_PATTERN ?= + +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ + $(CODE_COVERAGE_OUTPUT_FILE); +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ + $(CODE_COVERAGE_IGNORE_PATTERN); +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); +code_coverage_quiet = $(code_coverage_quiet_$(V)) +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +code_coverage_quiet_0 = --quiet + +# sanitizes the test-name: replaces with underscores: dashes and dots +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) + +# Use recursive makes in order to ignore errors during check +check-code-coverage: +ifeq ($(CODE_COVERAGE_ENABLED),yes) + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +else + @echo "Need to reconfigure with --enable-code-coverage" +endif + +# Capture code coverage data +code-coverage-capture: code-coverage-capture-hook +ifeq ($(CODE_COVERAGE_ENABLED),yes) + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +else + @echo "Need to reconfigure with --enable-code-coverage" +endif + +# Hook rule executed before code-coverage-capture, overridable by the user +code-coverage-capture-hook: + +ifeq ($(CODE_COVERAGE_ENABLED),yes) +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +endif + +GITIGNOREFILES ?= +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) + +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage + +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean +' + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported architecture" >&5 +$as_echo_n "checking for supported architecture... " >&6; } +arch_m32= +arch_mx32= +case "$host_cpu" in +bfin) + arch=bfin + +$as_echo "#define BFIN 1" >>confdefs.h + + ;; +i[3456]86|pentium) + arch=i386 + +$as_echo "#define I386 1" >>confdefs.h + + ;; +ia64) + arch=ia64 + +$as_echo "#define IA64 1" >>confdefs.h + + ;; +m68k) + arch=m68k + +$as_echo "#define M68K 1" >>confdefs.h + + ;; +sparc64*) + arch=sparc64 + arch_m32=sparc + +$as_echo "#define SPARC64 1" >>confdefs.h + + ;; +sparc*) + arch=sparc + +$as_echo "#define SPARC 1" >>confdefs.h + + ;; +metag*) + arch=metag + +$as_echo "#define METAG 1" >>confdefs.h + + ;; +mips*) + arch=mips + +$as_echo "#define MIPS 1" >>confdefs.h + + ;; +alpha*) + arch=alpha + +$as_echo "#define ALPHA 1" >>confdefs.h + + ;; +powerpc*) + +$as_echo "#define POWERPC 1" >>confdefs.h + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __LP64__ +# error 32 bit +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + arch=powerpc64 +else + arch=powerpc +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$arch" = "powerpc64"; then + arch_m32=powerpc + +$as_echo "#define POWERPC64 1" >>confdefs.h + + fi + ;; +arm*) + arch=arm + +$as_echo "#define ARM 1" >>confdefs.h + + ;; +aarch64*) + arch=aarch64 + arch_m32=arm + +$as_echo "#define AARCH64 1" >>confdefs.h + + ;; +avr32*) + arch=avr32 + +$as_echo "#define AVR32 1" >>confdefs.h + + ;; +arc*) + arch=arc + +$as_echo "#define ARC 1" >>confdefs.h + + ;; +s390) + arch=s390 + +$as_echo "#define S390 1" >>confdefs.h + + ;; +s390x) + arch=s390x + +$as_echo "#define S390X 1" >>confdefs.h + + ;; +hppa*|parisc*) + arch=hppa + +$as_echo "#define HPPA 1" >>confdefs.h + + ;; +sh64*) + arch=sh64 + +$as_echo "#define SH64 1" >>confdefs.h + + ;; +sh*) + arch=sh + +$as_echo "#define SH 1" >>confdefs.h + + ;; +x86?64*) + arch_m32=i386 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __ILP32__ +# error not x32 +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + arch=x32 +else + arch=x86_64 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$arch" = "x86_64"; then + arch_mx32=x32 + +$as_echo "#define X86_64 1" >>confdefs.h + + else + +$as_echo "#define X32 1" >>confdefs.h + + fi + ;; +cris|crisv10) + arch=crisv10 + +$as_echo "#define CRISV10 1" >>confdefs.h + + ;; +crisv32) + arch=crisv32 + +$as_echo "#define CRISV32 1" >>confdefs.h + + ;; +tile*) + arch=tile + +$as_echo "#define TILE 1" >>confdefs.h + + ;; +microblaze*) + arch=microblaze + +$as_echo "#define MICROBLAZE 1" >>confdefs.h + + ;; +nios2*) + arch=nios2 + +$as_echo "#define NIOS2 1" >>confdefs.h + + ;; + +or1k*) + arch=or1k + +$as_echo "#define OR1K 1" >>confdefs.h + + ;; + +xtensa*) + arch=xtensa + +$as_echo "#define XTENSA 1" >>confdefs.h + + ;; + +riscv*) + arch=riscv + +$as_echo "#define RISCV 1" >>confdefs.h + + ;; + +*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: NO!" >&5 +$as_echo "NO!" >&6; } + as_fn_error $? "architecture $host_cpu is not supported by strace" "$LINENO" 5 + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $arch" >&5 +$as_echo "$arch" >&6; } + +test -n "$arch_m32" || + arch_m32=$arch +test -n "$arch_mx32" || + arch_mx32=$arch + + + + +MIPS_ABI= +if test "$arch" = mips; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _MIPS_SIM" >&5 +$as_echo_n "checking for _MIPS_SIM... " >&6; } +if ${st_cv__MIPS_SIM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "_MIPS_SIM" "st_cv__MIPS_SIM" ""; then : + +else + as_fn_error $? "_MIPS_SIM cannot be determined" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv__MIPS_SIM" >&5 +$as_echo "$st_cv__MIPS_SIM" >&6; } + + # requires GCC >= 3.4 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MIPS ABI" >&5 +$as_echo_n "checking for MIPS ABI... " >&6; } +if ${st_cv_mips_abi+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int i[_MIPS_SIM == _ABIO32 ? 1 : - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_mips_abi=o32 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int i[_MIPS_SIM == _ABIN32 ? 1 : - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_mips_abi=n32 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int i[_MIPS_SIM == _ABI64 ? 1 : - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_mips_abi=n64 +else + st_cv_mips_abi=unknown +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mips_abi" >&5 +$as_echo "$st_cv_mips_abi" >&6; } + + case "$st_cv_mips_abi" in + o32) +$as_echo "#define LINUX_MIPSO32 1" >>confdefs.h +;; + n32) +$as_echo "#define LINUX_MIPSN32 1" >>confdefs.h +;; + n64) +$as_echo "#define LINUX_MIPSN64 1" >>confdefs.h +;; + *) as_fn_error $? "Unsupported _MIPS_SIM" "$LINENO" 5;; + esac + MIPS_ABI="$st_cv_mips_abi" +fi + + +# Check whether --enable-arm-oabi was given. +if test "${enable_arm_oabi+set}" = set; then : + enableval=$enable_arm_oabi; +else + enable_arm_oabi=no +fi + +case "$enable_arm_oabi" in + yes) enable_arm_oabi=1 ;; + no) enable_arm_oabi=0 ;; + *) as_fn_error $? "bad value $enable_arm_oabi for arm-oabi option" "$LINENO" 5 ;; +esac + +cat >>confdefs.h <<_ACEOF +#define ENABLE_ARM_OABI $enable_arm_oabi +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeof syntax and keyword spelling" >&5 +$as_echo_n "checking for typeof syntax and keyword spelling... " >&6; } +if ${ac_cv_c_typeof+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_typeof=no + for ac_kw in typeof __typeof__ no; do + test $ac_kw = no && break + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + int value; + typedef struct { + char a [1 + + ! (($ac_kw (value)) + (($ac_kw (value)) 0 < ($ac_kw (value)) -1 + ? ($ac_kw (value)) - 1 + : ~ (~ ($ac_kw (value)) 0 + << sizeof ($ac_kw (value)))))]; } + ac__typeof_type_; + return + (! ((void) ((ac__typeof_type_ *) 0), 0)); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_typeof=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test $ac_cv_c_typeof != no && break + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_typeof" >&5 +$as_echo "$ac_cv_c_typeof" >&6; } + if test $ac_cv_c_typeof != no; then + +$as_echo "#define HAVE_TYPEOF 1" >>confdefs.h + + if test $ac_cv_c_typeof != typeof; then + +cat >>confdefs.h <<_ACEOF +#define typeof $ac_cv_c_typeof +_ACEOF + + fi + fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + + +for ac_func in accept4 fallocate fanotify_mark fopen64 fork fputs_unlocked fstatat ftruncate futimens if_indextoname open64 prctl preadv process_vm_readv pwritev readahead signalfd stpcpy strerror strsignal sync_file_range utimensat +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include +" +if test "x$ac_cv_type_sig_atomic_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIG_ATOMIC_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct sigcontext" "ac_cv_type_struct_sigcontext" "#include +" +if test "x$ac_cv_type_struct_sigcontext" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGCONTEXT 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "struct mmsghdr" "ac_cv_type_struct_mmsghdr" "#include +" +if test "x$ac_cv_type_struct_mmsghdr" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_MMSGHDR 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "__kernel_long_t" "ac_cv_type___kernel_long_t" "#include +" +if test "x$ac_cv_type___kernel_long_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE___KERNEL_LONG_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "__kernel_ulong_t" "ac_cv_type___kernel_ulong_t" "#include +" +if test "x$ac_cv_type___kernel_ulong_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE___KERNEL_ULONG_T 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "#include +#include +" +if test "x$ac_cv_type_struct_stat64" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct __old_kernel_stat" "ac_cv_type_struct___old_kernel_stat" "#include +#include +" +if test "x$ac_cv_type_struct___old_kernel_stat" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT___OLD_KERNEL_STAT 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "struct user_desc" "ac_cv_type_struct_user_desc" "#include +" +if test "x$ac_cv_type_struct_user_desc" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_USER_DESC 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_mtime_nsec" "ac_cv_member_struct_stat_st_mtime_nsec" "#include +#include +" +if test "x$ac_cv_member_struct_stat_st_mtime_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat64" "st_mtime_nsec" "ac_cv_member_struct_stat64_st_mtime_nsec" "#include +#include +" +if test "x$ac_cv_member_struct_stat64_st_mtime_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT64_ST_MTIME_NSEC 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "struct pt_all_user_regs" "ac_cv_type_struct_pt_all_user_regs" "#include +" +if test "x$ac_cv_type_struct_pt_all_user_regs" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PT_ALL_USER_REGS 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct ia64_fpreg" "ac_cv_type_struct_ia64_fpreg" "#include +" +if test "x$ac_cv_type_struct_ia64_fpreg" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_IA64_FPREG 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct ptrace_peeksiginfo_args" "ac_cv_type_struct_ptrace_peeksiginfo_args" "#include +" +if test "x$ac_cv_type_struct_ptrace_peeksiginfo_args" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "struct flock" "ac_cv_type_struct_flock" "#include +#include +" +if test "x$ac_cv_type_struct_flock" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_FLOCK 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct flock64" "ac_cv_type_struct_flock64" "#include +#include +" +if test "x$ac_cv_type_struct_flock64" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_FLOCK64 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct __kernel_flock" "ac_cv_type_struct___kernel_flock" "#include +#include +" +if test "x$ac_cv_type_struct___kernel_flock" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT___KERNEL_FLOCK 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct __kernel_flock64" "ac_cv_type_struct___kernel_flock64" "#include +#include +" +if test "x$ac_cv_type_struct___kernel_flock64" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT___KERNEL_FLOCK64 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct timex" "tai" "ac_cv_member_struct_timex_tai" "#include +" +if test "x$ac_cv_member_struct_timex_tai" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TIMEX_TAI 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct utsname" "domainname" "ac_cv_member_struct_utsname_domainname" "#include +" +if test "x$ac_cv_member_struct_utsname_domainname" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_UTSNAME_DOMAINNAME 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "siginfo_t" "si_syscall" "ac_cv_member_siginfo_t_si_syscall" "#include +" +if test "x$ac_cv_member_siginfo_t_si_syscall" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T_SI_SYSCALL 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "siginfo_t" "si_timerid" "ac_cv_member_siginfo_t_si_timerid" "#include +" +if test "x$ac_cv_member_siginfo_t_si_timerid" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T_SI_TIMERID 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "siginfo_t" "si_overrun" "ac_cv_member_siginfo_t_si_overrun" "#include +" +if test "x$ac_cv_member_siginfo_t_si_overrun" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T_SI_OVERRUN 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "precise_ip" "ac_cv_member_struct_perf_event_attr_precise_ip" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_precise_ip" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "mmap_data" "ac_cv_member_struct_perf_event_attr_mmap_data" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_mmap_data" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "sample_id_all" "ac_cv_member_struct_perf_event_attr_sample_id_all" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_sample_id_all" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "exclude_host" "ac_cv_member_struct_perf_event_attr_exclude_host" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_exclude_host" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "exclude_guest" "ac_cv_member_struct_perf_event_attr_exclude_guest" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_exclude_guest" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "exclude_callchain_kernel" "ac_cv_member_struct_perf_event_attr_exclude_callchain_kernel" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_exclude_callchain_kernel" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "exclude_callchain_user" "ac_cv_member_struct_perf_event_attr_exclude_callchain_user" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_exclude_callchain_user" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "mmap2" "ac_cv_member_struct_perf_event_attr_mmap2" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_mmap2" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "comm_exec" "ac_cv_member_struct_perf_event_attr_comm_exec" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_comm_exec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "use_clockid" "ac_cv_member_struct_perf_event_attr_use_clockid" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_use_clockid" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "context_switch" "ac_cv_member_struct_perf_event_attr_context_switch" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_context_switch" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "write_backward" "ac_cv_member_struct_perf_event_attr_write_backward" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_write_backward" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "bp_type" "ac_cv_member_struct_perf_event_attr_bp_type" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_bp_type" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_BP_TYPE 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "config1" "ac_cv_member_struct_perf_event_attr_config1" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_config1" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "config2" "ac_cv_member_struct_perf_event_attr_config2" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_config2" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "branch_sample_type" "ac_cv_member_struct_perf_event_attr_branch_sample_type" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_branch_sample_type" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_BRANCH_SAMPLE_TYPE 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "sample_regs_user" "ac_cv_member_struct_perf_event_attr_sample_regs_user" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_sample_regs_user" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "sample_stack_user" "ac_cv_member_struct_perf_event_attr_sample_stack_user" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_sample_stack_user" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "sample_regs_intr" "ac_cv_member_struct_perf_event_attr_sample_regs_intr" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_sample_regs_intr" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "aux_watermark" "ac_cv_member_struct_perf_event_attr_aux_watermark" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_aux_watermark" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "sample_max_stack" "ac_cv_member_struct_perf_event_attr_sample_max_stack" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_sample_max_stack" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_BOOTLOADER_TYPE" "ac_cv_have_decl_KERN_BOOTLOADER_TYPE" "#include -#include + + +fi + + +for ac_header in asm/cachectl.h asm/sysmips.h bluetooth/bluetooth.h elf.h inttypes.h linux/bsg.h linux/dm-ioctl.h linux/dqblk_xfs.h linux/falloc.h linux/fiemap.h linux/filter.h linux/hiddev.h linux/ip_vs.h linux/ipc.h linux/mmtimer.h linux/msg.h linux/perf_event.h linux/quota.h linux/seccomp.h linux/securebits.h linux/sem.h linux/shm.h linux/userfaultfd.h linux/utsname.h mqueue.h netinet/sctp.h netipx/ipx.h scsi/sg.h stropts.h sys/conf.h sys/eventfd.h sys/fanotify.h sys/ipc.h sys/msg.h sys/quota.h sys/reg.h sys/sem.h sys/shm.h sys/signalfd.h sys/xattr.h ustat.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in asm/sigcontext.h +do : + ac_fn_c_check_header_compile "$LINENO" "asm/sigcontext.h" "ac_cv_header_asm_sigcontext_h" "#include " -if test "x$ac_cv_have_decl_KERN_BOOTLOADER_TYPE" = xyes; then : - ac_have_decl=1 +if test "x$ac_cv_header_asm_sigcontext_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ASM_SIGCONTEXT_H 1 +_ACEOF + +fi + +done + + +for ac_header in netinet/tcp.h netinet/udp.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in linux/mqueue.h +do : + ac_fn_c_check_header_compile "$LINENO" "linux/mqueue.h" "ac_cv_header_linux_mqueue_h" "#include +" +if test "x$ac_cv_header_linux_mqueue_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_MQUEUE_H 1 +_ACEOF + +fi + +done + + +for ac_header in linux/netfilter_arp/arp_tables.h linux/netfilter_bridge/ebtables.h linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include +#include +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in linux/input.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_input_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_INPUT_H 1 +_ACEOF + + ac_fn_c_check_member "$LINENO" "struct input_absinfo" "resolution" "ac_cv_member_struct_input_absinfo_resolution" "#include +" +if test "x$ac_cv_member_struct_input_absinfo_resolution" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION 1 +_ACEOF + + +fi + + +fi + +done + + +for ac_header in linux/bpf.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/bpf.h" "ac_cv_header_linux_bpf_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_bpf_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_BPF_H 1 +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.log_buf initialization works" >&5 +$as_echo_n "checking whether union bpf_attr.log_buf initialization works... " >&6; } +if ${st_cv_have_union_bpf_attr_log_buf+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +union bpf_attr a = { .log_buf = 0 }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_have_union_bpf_attr_log_buf=yes +else + st_cv_have_union_bpf_attr_log_buf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_union_bpf_attr_log_buf" >&5 +$as_echo "$st_cv_have_union_bpf_attr_log_buf" >&6; } + if test $st_cv_have_union_bpf_attr_log_buf = yes; then + +$as_echo "#define HAVE_UNION_BPF_ATTR_LOG_BUF 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.bpf_fd initialization works" >&5 +$as_echo_n "checking whether union bpf_attr.bpf_fd initialization works... " >&6; } +if ${st_cv_have_union_bpf_attr_bpf_fd+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +union bpf_attr a = { .bpf_fd = 0 }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_have_union_bpf_attr_bpf_fd=yes +else + st_cv_have_union_bpf_attr_bpf_fd=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_union_bpf_attr_bpf_fd" >&5 +$as_echo "$st_cv_have_union_bpf_attr_bpf_fd" >&6; } + if test $st_cv_have_union_bpf_attr_bpf_fd = yes; then + +$as_echo "#define HAVE_UNION_BPF_ATTR_BPF_FD 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.attach_type initialization works" >&5 +$as_echo_n "checking whether union bpf_attr.attach_type initialization works... " >&6; } +if ${st_cv_have_union_bpf_attr_attach_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +union bpf_attr a = { .attach_type = 0 }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_have_union_bpf_attr_attach_type=yes +else + st_cv_have_union_bpf_attr_attach_type=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_union_bpf_attr_attach_type" >&5 +$as_echo "$st_cv_have_union_bpf_attr_attach_type" >&6; } + if test $st_cv_have_union_bpf_attr_attach_type = yes; then + +$as_echo "#define HAVE_UNION_BPF_ATTR_ATTACH_TYPE 1" >>confdefs.h + + fi + fi +done + + +ac_fn_c_check_type "$LINENO" "struct statfs" "ac_cv_type_struct_statfs" "#include +#include +" +if test "x$ac_cv_type_struct_statfs" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_BOOTLOADER_TYPE $ac_have_decl +#define HAVE_STRUCT_STATFS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_RANDOMIZE" "ac_cv_have_decl_KERN_RANDOMIZE" "#include -#include + + + ac_fn_c_check_member "$LINENO" "struct statfs" "f_frsize" "ac_cv_member_struct_statfs_f_frsize" "#include +#include " -if test "x$ac_cv_have_decl_KERN_RANDOMIZE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_struct_statfs_f_frsize" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS_F_FRSIZE 1 +_ACEOF + + fi + ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" "ac_cv_member_struct_statfs_f_flags" "#include +#include +" +if test "x$ac_cv_member_struct_statfs_f_flags" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_RANDOMIZE $ac_have_decl +#define HAVE_STRUCT_STATFS_F_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SETUID_DUMPABLE" "ac_cv_have_decl_KERN_SETUID_DUMPABLE" "#include -#include + + +fi + + ac_fn_c_check_member "$LINENO" "struct statfs" "f_fsid.val" "ac_cv_member_struct_statfs_f_fsid_val" "#include +#include " -if test "x$ac_cv_have_decl_KERN_SETUID_DUMPABLE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_struct_statfs_f_fsid_val" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS_F_FSID_VAL 1 +_ACEOF + + +fi + + ac_fn_c_check_member "$LINENO" "struct statfs" "f_fsid.__val" "ac_cv_member_struct_statfs_f_fsid___val" "#include +#include +" +if test "x$ac_cv_member_struct_statfs_f_fsid___val" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS_F_FSID___VAL 1 +_ACEOF + + +fi + + +fi + + +ac_fn_c_check_type "$LINENO" "struct statfs64" "ac_cv_type_struct_statfs64" "#include +#include +" +if test "x$ac_cv_type_struct_statfs64" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS64 1 +_ACEOF + + + ac_fn_c_check_member "$LINENO" "struct statfs64" "f_frsize" "ac_cv_member_struct_statfs64_f_frsize" "#include +#include +" +if test "x$ac_cv_member_struct_statfs64_f_frsize" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS64_F_FRSIZE 1 +_ACEOF + + +fi + + ac_fn_c_check_member "$LINENO" "struct statfs64" "f_flags" "ac_cv_member_struct_statfs64_f_flags" "#include +#include +" +if test "x$ac_cv_member_struct_statfs64_f_flags" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS64_F_FLAGS 1 +_ACEOF + + +fi + + ac_fn_c_check_member "$LINENO" "struct statfs64" "f_fsid.val" "ac_cv_member_struct_statfs64_f_fsid_val" "#include +#include +" +if test "x$ac_cv_member_struct_statfs64_f_fsid_val" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS64_F_FSID_VAL 1 +_ACEOF + + +fi + + ac_fn_c_check_member "$LINENO" "struct statfs64" "f_fsid.__val" "ac_cv_member_struct_statfs64_f_fsid___val" "#include +#include +" +if test "x$ac_cv_member_struct_statfs64_f_fsid___val" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS64_F_FSID___VAL 1 +_ACEOF + + +fi + + +fi + + +ac_fn_c_check_type "$LINENO" "struct blk_user_trace_setup" "ac_cv_type_struct_blk_user_trace_setup" "#include +" +if test "x$ac_cv_type_struct_blk_user_trace_setup" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BLK_USER_TRACE_SETUP 1 +_ACEOF + + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SETUID_DUMPABLE $ac_have_decl + +for ac_header in linux/btrfs.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/btrfs.h" "ac_cv_header_linux_btrfs_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_btrfs_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_BTRFS_H 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SPIN_RETRY" "ac_cv_have_decl_KERN_SPIN_RETRY" "#include -#include + + ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_feature_flags" "compat_flags" "ac_cv_member_struct_btrfs_ioctl_feature_flags_compat_flags" " #include +#include " -if test "x$ac_cv_have_decl_KERN_SPIN_RETRY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_member_struct_btrfs_ioctl_feature_flags_compat_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SPIN_RETRY $ac_have_decl +#define HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_ACPI_VIDEO_FLAGS" "ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_fs_info_args" "nodesize" "ac_cv_member_struct_btrfs_ioctl_fs_info_args_nodesize" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_fs_info_args_nodesize" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_ACPI_VIDEO_FLAGS $ac_have_decl +#define HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_IA64_UNALIGNED" "ac_cv_have_decl_KERN_IA64_UNALIGNED" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_IA64_UNALIGNED" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_defrag_range_args" "start" "ac_cv_member_struct_btrfs_ioctl_defrag_range_args_start" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_defrag_range_args_start" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_IA64_UNALIGNED $ac_have_decl +#define HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_COMPAT_LOG" "ac_cv_have_decl_KERN_COMPAT_LOG" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_COMPAT_LOG" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_search_args_v2" "buf_size" "ac_cv_member_struct_btrfs_ioctl_search_args_v2_buf_size" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_search_args_v2_buf_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_COMPAT_LOG $ac_have_decl +#define HAVE_STRUCT_BTRFS_IOCTL_SEARCH_ARGS_V2_BUF_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MAX_LOCK_DEPTH" "ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" "#include -#include + + +fi + + ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_NONE" "ac_cv_have_decl_BTRFS_COMPRESS_NONE" " #include +#include " -if test "x$ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" = xyes; then : +if test "x$ac_cv_have_decl_BTRFS_COMPRESS_NONE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MAX_LOCK_DEPTH $ac_have_decl +#define HAVE_DECL_BTRFS_COMPRESS_NONE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_NMI_WATCHDOG" "ac_cv_have_decl_KERN_NMI_WATCHDOG" "#include -#include +ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_ZLIB" "ac_cv_have_decl_BTRFS_COMPRESS_ZLIB" " #include +#include " -if test "x$ac_cv_have_decl_KERN_NMI_WATCHDOG" = xyes; then : +if test "x$ac_cv_have_decl_BTRFS_COMPRESS_ZLIB" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_NMI_WATCHDOG $ac_have_decl +#define HAVE_DECL_BTRFS_COMPRESS_ZLIB $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PANIC_ON_NMI" "ac_cv_have_decl_KERN_PANIC_ON_NMI" "#include -#include +ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_LZO" "ac_cv_have_decl_BTRFS_COMPRESS_LZO" " #include +#include " -if test "x$ac_cv_have_decl_KERN_PANIC_ON_NMI" = xyes; then : +if test "x$ac_cv_have_decl_BTRFS_COMPRESS_LZO" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PANIC_ON_NMI $ac_have_decl +#define HAVE_DECL_BTRFS_COMPRESS_LZO $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE" "ac_cv_have_decl_NET_CORE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CORE" = xyes; then : + +fi + +done + + +ac_fn_c_check_decl "$LINENO" "sys_errlist" "ac_cv_have_decl_sys_errlist" "$ac_includes_default" +if test "x$ac_cv_have_decl_sys_errlist" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE $ac_have_decl +#define HAVE_DECL_SYS_ERRLIST $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_ETHER" "ac_cv_have_decl_NET_ETHER" "#include -#include + +ac_fn_c_check_decl "$LINENO" "PTRACE_PEEKUSER" "ac_cv_have_decl_PTRACE_PEEKUSER" "#include " -if test "x$ac_cv_have_decl_NET_ETHER" = xyes; then : +if test "x$ac_cv_have_decl_PTRACE_PEEKUSER" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_ETHER $ac_have_decl +#define HAVE_DECL_PTRACE_PEEKUSER $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_802" "ac_cv_have_decl_NET_802" "#include -#include +ac_fn_c_check_decl "$LINENO" "PTRACE_POKEUSER" "ac_cv_have_decl_PTRACE_POKEUSER" "#include " -if test "x$ac_cv_have_decl_NET_802" = xyes; then : +if test "x$ac_cv_have_decl_PTRACE_POKEUSER" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_802 $ac_have_decl +#define HAVE_DECL_PTRACE_POKEUSER $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_UNIX" "ac_cv_have_decl_NET_UNIX" "#include -#include + + +ac_fn_c_check_decl "$LINENO" "P_PID" "ac_cv_have_decl_P_PID" "#include " -if test "x$ac_cv_have_decl_NET_UNIX" = xyes; then : +if test "x$ac_cv_have_decl_P_PID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_UNIX $ac_have_decl +#define HAVE_DECL_P_PID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4" "ac_cv_have_decl_NET_IPV4" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_PPID" "ac_cv_have_decl_P_PPID" "#include " -if test "x$ac_cv_have_decl_NET_IPV4" = xyes; then : +if test "x$ac_cv_have_decl_P_PPID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4 $ac_have_decl +#define HAVE_DECL_P_PPID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPX" "ac_cv_have_decl_NET_IPX" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_PGID" "ac_cv_have_decl_P_PGID" "#include " -if test "x$ac_cv_have_decl_NET_IPX" = xyes; then : +if test "x$ac_cv_have_decl_P_PGID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPX $ac_have_decl +#define HAVE_DECL_P_PGID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_ATALK" "ac_cv_have_decl_NET_ATALK" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_SID" "ac_cv_have_decl_P_SID" "#include " -if test "x$ac_cv_have_decl_NET_ATALK" = xyes; then : +if test "x$ac_cv_have_decl_P_SID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_ATALK $ac_have_decl +#define HAVE_DECL_P_SID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_NETROM" "ac_cv_have_decl_NET_NETROM" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_CID" "ac_cv_have_decl_P_CID" "#include " -if test "x$ac_cv_have_decl_NET_NETROM" = xyes; then : +if test "x$ac_cv_have_decl_P_CID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_NETROM $ac_have_decl +#define HAVE_DECL_P_CID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_AX25" "ac_cv_have_decl_NET_AX25" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_UID" "ac_cv_have_decl_P_UID" "#include " -if test "x$ac_cv_have_decl_NET_AX25" = xyes; then : +if test "x$ac_cv_have_decl_P_UID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_AX25 $ac_have_decl +#define HAVE_DECL_P_UID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_BRIDGE" "ac_cv_have_decl_NET_BRIDGE" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_GID" "ac_cv_have_decl_P_GID" "#include " -if test "x$ac_cv_have_decl_NET_BRIDGE" = xyes; then : +if test "x$ac_cv_have_decl_P_GID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_BRIDGE $ac_have_decl +#define HAVE_DECL_P_GID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_ROSE" "ac_cv_have_decl_NET_ROSE" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_ALL" "ac_cv_have_decl_P_ALL" "#include " -if test "x$ac_cv_have_decl_NET_ROSE" = xyes; then : +if test "x$ac_cv_have_decl_P_ALL" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_ROSE $ac_have_decl +#define HAVE_DECL_P_ALL $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6" "ac_cv_have_decl_NET_IPV6" "#include -#include +ac_fn_c_check_decl "$LINENO" "P_LWPID" "ac_cv_have_decl_P_LWPID" "#include " -if test "x$ac_cv_have_decl_NET_IPV6" = xyes; then : +if test "x$ac_cv_have_decl_P_LWPID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6 $ac_have_decl +#define HAVE_DECL_P_LWPID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_X25" "ac_cv_have_decl_NET_X25" "#include -#include + + +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_READ_ONLY" "ac_cv_have_decl_LO_FLAGS_READ_ONLY" "#include " -if test "x$ac_cv_have_decl_NET_X25" = xyes; then : +if test "x$ac_cv_have_decl_LO_FLAGS_READ_ONLY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_X25 $ac_have_decl +#define HAVE_DECL_LO_FLAGS_READ_ONLY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TR" "ac_cv_have_decl_NET_TR" "#include -#include +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_USE_AOPS" "ac_cv_have_decl_LO_FLAGS_USE_AOPS" "#include " -if test "x$ac_cv_have_decl_NET_TR" = xyes; then : +if test "x$ac_cv_have_decl_LO_FLAGS_USE_AOPS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TR $ac_have_decl +#define HAVE_DECL_LO_FLAGS_USE_AOPS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_DECNET" "ac_cv_have_decl_NET_DECNET" "#include -#include +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_AUTOCLEAR" "ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" "#include " -if test "x$ac_cv_have_decl_NET_DECNET" = xyes; then : +if test "x$ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_DECNET $ac_have_decl +#define HAVE_DECL_LO_FLAGS_AUTOCLEAR $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_ECONET" "ac_cv_have_decl_NET_ECONET" "#include -#include +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_PARTSCAN" "ac_cv_have_decl_LO_FLAGS_PARTSCAN" "#include " -if test "x$ac_cv_have_decl_NET_ECONET" = xyes; then : +if test "x$ac_cv_have_decl_LO_FLAGS_PARTSCAN" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_ECONET $ac_have_decl +#define HAVE_DECL_LO_FLAGS_PARTSCAN $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_SCTP" "ac_cv_have_decl_NET_SCTP" "#include -#include +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_DIRECT_IO" "ac_cv_have_decl_LO_FLAGS_DIRECT_IO" "#include " -if test "x$ac_cv_have_decl_NET_SCTP" = xyes; then : +if test "x$ac_cv_have_decl_LO_FLAGS_DIRECT_IO" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_SCTP $ac_have_decl +#define HAVE_DECL_LO_FLAGS_DIRECT_IO $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_LLC" "ac_cv_have_decl_NET_LLC" "#include + + +ac_fn_c_check_decl "$LINENO" "CTL_PROC" "ac_cv_have_decl_CTL_PROC" "#include #include " -if test "x$ac_cv_have_decl_NET_LLC" = xyes; then : +if test "x$ac_cv_have_decl_CTL_PROC" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_LLC $ac_have_decl +#define HAVE_DECL_CTL_PROC $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_NETFILTER" "ac_cv_have_decl_NET_NETFILTER" "#include +ac_fn_c_check_decl "$LINENO" "CTL_ARLAN" "ac_cv_have_decl_CTL_ARLAN" "#include #include " -if test "x$ac_cv_have_decl_NET_NETFILTER" = xyes; then : +if test "x$ac_cv_have_decl_CTL_ARLAN" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_NETFILTER $ac_have_decl +#define HAVE_DECL_CTL_ARLAN $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_DCCP" "ac_cv_have_decl_NET_DCCP" "#include +ac_fn_c_check_decl "$LINENO" "CTL_S390DBF" "ac_cv_have_decl_CTL_S390DBF" "#include #include " -if test "x$ac_cv_have_decl_NET_DCCP" = xyes; then : +if test "x$ac_cv_have_decl_CTL_S390DBF" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_DCCP $ac_have_decl +#define HAVE_DECL_CTL_S390DBF $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IRDA" "ac_cv_have_decl_NET_IRDA" "#include +ac_fn_c_check_decl "$LINENO" "CTL_SUNRPC" "ac_cv_have_decl_CTL_SUNRPC" "#include #include " -if test "x$ac_cv_have_decl_NET_IRDA" = xyes; then : +if test "x$ac_cv_have_decl_CTL_SUNRPC" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IRDA $ac_have_decl +#define HAVE_DECL_CTL_SUNRPC $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_WMEM_MAX" "ac_cv_have_decl_NET_CORE_WMEM_MAX" "#include +ac_fn_c_check_decl "$LINENO" "CTL_PM" "ac_cv_have_decl_CTL_PM" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_WMEM_MAX" = xyes; then : +if test "x$ac_cv_have_decl_CTL_PM" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_WMEM_MAX $ac_have_decl +#define HAVE_DECL_CTL_PM $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_RMEM_MAX" "ac_cv_have_decl_NET_CORE_RMEM_MAX" "#include +ac_fn_c_check_decl "$LINENO" "CTL_FRV" "ac_cv_have_decl_CTL_FRV" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_RMEM_MAX" = xyes; then : +if test "x$ac_cv_have_decl_CTL_FRV" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_RMEM_MAX $ac_have_decl +#define HAVE_DECL_CTL_FRV $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_WMEM_DEFAULT" "ac_cv_have_decl_NET_CORE_WMEM_DEFAULT" "#include +ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_WMEM_DEFAULT" = xyes; then : +if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_WMEM_DEFAULT $ac_have_decl +#define HAVE_DECL_KERN_PRINTK_RATELIMIT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_RMEM_DEFAULT" "ac_cv_have_decl_NET_CORE_RMEM_DEFAULT" "#include +ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT_BURST" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_RMEM_DEFAULT" = xyes; then : +if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_RMEM_DEFAULT $ac_have_decl +#define HAVE_DECL_KERN_PRINTK_RATELIMIT_BURST $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_DESTROY_DELAY" "ac_cv_have_decl_NET_CORE_DESTROY_DELAY" "#include +ac_fn_c_check_decl "$LINENO" "KERN_PTY" "ac_cv_have_decl_KERN_PTY" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_DESTROY_DELAY" = xyes; then : +if test "x$ac_cv_have_decl_KERN_PTY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_DESTROY_DELAY $ac_have_decl +#define HAVE_DECL_KERN_PTY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_MAX_BACKLOG" "ac_cv_have_decl_NET_CORE_MAX_BACKLOG" "#include +ac_fn_c_check_decl "$LINENO" "KERN_NGROUPS_MAX" "ac_cv_have_decl_KERN_NGROUPS_MAX" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_MAX_BACKLOG" = xyes; then : +if test "x$ac_cv_have_decl_KERN_NGROUPS_MAX" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_MAX_BACKLOG $ac_have_decl +#define HAVE_DECL_KERN_NGROUPS_MAX $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_FASTROUTE" "ac_cv_have_decl_NET_CORE_FASTROUTE" "#include +ac_fn_c_check_decl "$LINENO" "KERN_SPARC_SCONS_PWROFF" "ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_FASTROUTE" = xyes; then : +if test "x$ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_FASTROUTE $ac_have_decl +#define HAVE_DECL_KERN_SPARC_SCONS_PWROFF $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_MSG_COST" "ac_cv_have_decl_NET_CORE_MSG_COST" "#include +ac_fn_c_check_decl "$LINENO" "KERN_HZ_TIMER" "ac_cv_have_decl_KERN_HZ_TIMER" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_MSG_COST" = xyes; then : +if test "x$ac_cv_have_decl_KERN_HZ_TIMER" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_MSG_COST $ac_have_decl +#define HAVE_DECL_KERN_HZ_TIMER $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_MSG_BURST" "ac_cv_have_decl_NET_CORE_MSG_BURST" "#include +ac_fn_c_check_decl "$LINENO" "KERN_UNKNOWN_NMI_PANIC" "ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_MSG_BURST" = xyes; then : +if test "x$ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_MSG_BURST $ac_have_decl +#define HAVE_DECL_KERN_UNKNOWN_NMI_PANIC $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_OPTMEM_MAX" "ac_cv_have_decl_NET_CORE_OPTMEM_MAX" "#include +ac_fn_c_check_decl "$LINENO" "KERN_BOOTLOADER_TYPE" "ac_cv_have_decl_KERN_BOOTLOADER_TYPE" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_OPTMEM_MAX" = xyes; then : +if test "x$ac_cv_have_decl_KERN_BOOTLOADER_TYPE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_OPTMEM_MAX $ac_have_decl +#define HAVE_DECL_KERN_BOOTLOADER_TYPE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_HOT_LIST_LENGTH" "ac_cv_have_decl_NET_CORE_HOT_LIST_LENGTH" "#include +ac_fn_c_check_decl "$LINENO" "KERN_RANDOMIZE" "ac_cv_have_decl_KERN_RANDOMIZE" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_HOT_LIST_LENGTH" = xyes; then : +if test "x$ac_cv_have_decl_KERN_RANDOMIZE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_HOT_LIST_LENGTH $ac_have_decl +#define HAVE_DECL_KERN_RANDOMIZE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_DIVERT_VERSION" "ac_cv_have_decl_NET_CORE_DIVERT_VERSION" "#include +ac_fn_c_check_decl "$LINENO" "KERN_SETUID_DUMPABLE" "ac_cv_have_decl_KERN_SETUID_DUMPABLE" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_DIVERT_VERSION" = xyes; then : +if test "x$ac_cv_have_decl_KERN_SETUID_DUMPABLE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_DIVERT_VERSION $ac_have_decl +#define HAVE_DECL_KERN_SETUID_DUMPABLE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_NO_CONG_THRESH" "ac_cv_have_decl_NET_CORE_NO_CONG_THRESH" "#include +ac_fn_c_check_decl "$LINENO" "KERN_SPIN_RETRY" "ac_cv_have_decl_KERN_SPIN_RETRY" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_NO_CONG_THRESH" = xyes; then : +if test "x$ac_cv_have_decl_KERN_SPIN_RETRY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_NO_CONG_THRESH $ac_have_decl +#define HAVE_DECL_KERN_SPIN_RETRY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_NO_CONG" "ac_cv_have_decl_NET_CORE_NO_CONG" "#include +ac_fn_c_check_decl "$LINENO" "KERN_ACPI_VIDEO_FLAGS" "ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_NO_CONG" = xyes; then : +if test "x$ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_NO_CONG $ac_have_decl +#define HAVE_DECL_KERN_ACPI_VIDEO_FLAGS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_LO_CONG" "ac_cv_have_decl_NET_CORE_LO_CONG" "#include +ac_fn_c_check_decl "$LINENO" "KERN_IA64_UNALIGNED" "ac_cv_have_decl_KERN_IA64_UNALIGNED" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_LO_CONG" = xyes; then : +if test "x$ac_cv_have_decl_KERN_IA64_UNALIGNED" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_LO_CONG $ac_have_decl +#define HAVE_DECL_KERN_IA64_UNALIGNED $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_MOD_CONG" "ac_cv_have_decl_NET_CORE_MOD_CONG" "#include +ac_fn_c_check_decl "$LINENO" "KERN_COMPAT_LOG" "ac_cv_have_decl_KERN_COMPAT_LOG" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_MOD_CONG" = xyes; then : +if test "x$ac_cv_have_decl_KERN_COMPAT_LOG" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_MOD_CONG $ac_have_decl +#define HAVE_DECL_KERN_COMPAT_LOG $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_DEV_WEIGHT" "ac_cv_have_decl_NET_CORE_DEV_WEIGHT" "#include +ac_fn_c_check_decl "$LINENO" "KERN_MAX_LOCK_DEPTH" "ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_DEV_WEIGHT" = xyes; then : +if test "x$ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_DEV_WEIGHT $ac_have_decl +#define HAVE_DECL_KERN_MAX_LOCK_DEPTH $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_SOMAXCONN" "ac_cv_have_decl_NET_CORE_SOMAXCONN" "#include +ac_fn_c_check_decl "$LINENO" "KERN_NMI_WATCHDOG" "ac_cv_have_decl_KERN_NMI_WATCHDOG" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_SOMAXCONN" = xyes; then : +if test "x$ac_cv_have_decl_KERN_NMI_WATCHDOG" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_SOMAXCONN $ac_have_decl +#define HAVE_DECL_KERN_NMI_WATCHDOG $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_BUDGET" "ac_cv_have_decl_NET_CORE_BUDGET" "#include +ac_fn_c_check_decl "$LINENO" "KERN_PANIC_ON_NMI" "ac_cv_have_decl_KERN_PANIC_ON_NMI" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_BUDGET" = xyes; then : +if test "x$ac_cv_have_decl_KERN_PANIC_ON_NMI" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_BUDGET $ac_have_decl +#define HAVE_DECL_KERN_PANIC_ON_NMI $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_ETIME" "ac_cv_have_decl_NET_CORE_AEVENT_ETIME" "#include +ac_fn_c_check_decl "$LINENO" "NET_LLC" "ac_cv_have_decl_NET_LLC" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_AEVENT_ETIME" = xyes; then : +if test "x$ac_cv_have_decl_NET_LLC" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_AEVENT_ETIME $ac_have_decl +#define HAVE_DECL_NET_LLC $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_RSEQTH" "ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" "#include +ac_fn_c_check_decl "$LINENO" "NET_NETFILTER" "ac_cv_have_decl_NET_NETFILTER" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" = xyes; then : +if test "x$ac_cv_have_decl_NET_NETFILTER" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_AEVENT_RSEQTH $ac_have_decl +#define HAVE_DECL_NET_NETFILTER $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_WARNINGS" "ac_cv_have_decl_NET_CORE_WARNINGS" "#include +ac_fn_c_check_decl "$LINENO" "NET_DCCP" "ac_cv_have_decl_NET_DCCP" "#include #include " -if test "x$ac_cv_have_decl_NET_CORE_WARNINGS" = xyes; then : +if test "x$ac_cv_have_decl_NET_DCCP" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_WARNINGS $ac_have_decl +#define HAVE_DECL_NET_DCCP $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_FORWARD" "ac_cv_have_decl_NET_IPV4_FORWARD" "#include +ac_fn_c_check_decl "$LINENO" "NET_IRDA" "ac_cv_have_decl_NET_IRDA" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_FORWARD" = xyes; then : +if test "x$ac_cv_have_decl_NET_IRDA" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_FORWARD $ac_have_decl +#define HAVE_DECL_NET_IRDA $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_DYNADDR" "ac_cv_have_decl_NET_IPV4_DYNADDR" "#include +ac_fn_c_check_decl "$LINENO" "NET_CORE_DESTROY_DELAY" "ac_cv_have_decl_NET_CORE_DESTROY_DELAY" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_DYNADDR" = xyes; then : +if test "x$ac_cv_have_decl_NET_CORE_DESTROY_DELAY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_DYNADDR $ac_have_decl +#define HAVE_DECL_NET_CORE_DESTROY_DELAY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF" "ac_cv_have_decl_NET_IPV4_CONF" "#include +ac_fn_c_check_decl "$LINENO" "NET_CORE_BUDGET" "ac_cv_have_decl_NET_CORE_BUDGET" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_CONF" = xyes; then : +if test "x$ac_cv_have_decl_NET_CORE_BUDGET" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF $ac_have_decl +#define HAVE_DECL_NET_CORE_BUDGET $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_NEIGH" "ac_cv_have_decl_NET_IPV4_NEIGH" "#include +ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_ETIME" "ac_cv_have_decl_NET_CORE_AEVENT_ETIME" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_NEIGH" = xyes; then : +if test "x$ac_cv_have_decl_NET_CORE_AEVENT_ETIME" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_NEIGH $ac_have_decl +#define HAVE_DECL_NET_CORE_AEVENT_ETIME $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE" "ac_cv_have_decl_NET_IPV4_ROUTE" "#include +ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_RSEQTH" "ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE" = xyes; then : +if test "x$ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE $ac_have_decl +#define HAVE_DECL_NET_CORE_AEVENT_RSEQTH $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_FIB_HASH" "ac_cv_have_decl_NET_IPV4_FIB_HASH" "#include +ac_fn_c_check_decl "$LINENO" "NET_CORE_WARNINGS" "ac_cv_have_decl_NET_CORE_WARNINGS" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_FIB_HASH" = xyes; then : +if test "x$ac_cv_have_decl_NET_CORE_WARNINGS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_FIB_HASH $ac_have_decl +#define HAVE_DECL_NET_CORE_WARNINGS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_NETFILTER" "ac_cv_have_decl_NET_IPV4_NETFILTER" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_IGMP_MAX_MSF" "ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_NETFILTER" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_NETFILTER $ac_have_decl +#define HAVE_DECL_NET_IPV4_IGMP_MAX_MSF $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_TIMESTAMPS" "ac_cv_have_decl_NET_IPV4_TCP_TIMESTAMPS" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_NO_METRICS_SAVE" "ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_TIMESTAMPS" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_TIMESTAMPS $ac_have_decl +#define HAVE_DECL_NET_TCP_NO_METRICS_SAVE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_WINDOW_SCALING" "ac_cv_have_decl_NET_IPV4_TCP_WINDOW_SCALING" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_DEFAULT_WIN_SCALE" "ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_WINDOW_SCALING" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_WINDOW_SCALING $ac_have_decl +#define HAVE_DECL_NET_TCP_DEFAULT_WIN_SCALE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_SACK" "ac_cv_have_decl_NET_IPV4_TCP_SACK" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_MODERATE_RCVBUF" "ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_SACK" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_SACK $ac_have_decl +#define HAVE_DECL_NET_TCP_MODERATE_RCVBUF $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_RETRANS_COLLAPSE" "ac_cv_have_decl_NET_IPV4_TCP_RETRANS_COLLAPSE" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_TSO_WIN_DIVISOR" "ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_RETRANS_COLLAPSE" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_RETRANS_COLLAPSE $ac_have_decl +#define HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_DEFAULT_TTL" "ac_cv_have_decl_NET_IPV4_DEFAULT_TTL" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_BIC_BETA" "ac_cv_have_decl_NET_TCP_BIC_BETA" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_DEFAULT_TTL" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_BIC_BETA" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_DEFAULT_TTL $ac_have_decl +#define HAVE_DECL_NET_TCP_BIC_BETA $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_AUTOCONFIG" "ac_cv_have_decl_NET_IPV4_AUTOCONFIG" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_AUTOCONFIG" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_AUTOCONFIG $ac_have_decl +#define HAVE_DECL_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_NO_PMTU_DISC" "ac_cv_have_decl_NET_IPV4_NO_PMTU_DISC" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_CONG_CONTROL" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_NO_PMTU_DISC" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_CONG_CONTROL" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_NO_PMTU_DISC $ac_have_decl +#define HAVE_DECL_NET_TCP_CONG_CONTROL $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_SYN_RETRIES" "ac_cv_have_decl_NET_IPV4_TCP_SYN_RETRIES" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_ABC" "ac_cv_have_decl_NET_TCP_ABC" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_SYN_RETRIES" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_ABC" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_SYN_RETRIES $ac_have_decl +#define HAVE_DECL_NET_TCP_ABC $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_HIGH_THRESH" "ac_cv_have_decl_NET_IPV4_IPFRAG_HIGH_THRESH" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_MAX_DIST" "ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_HIGH_THRESH" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IPFRAG_HIGH_THRESH $ac_have_decl +#define HAVE_DECL_NET_IPV4_IPFRAG_MAX_DIST $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_LOW_THRESH" "ac_cv_have_decl_NET_IPV4_IPFRAG_LOW_THRESH" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_MTU_PROBING" "ac_cv_have_decl_NET_TCP_MTU_PROBING" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_LOW_THRESH" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_MTU_PROBING" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IPFRAG_LOW_THRESH $ac_have_decl +#define HAVE_DECL_NET_TCP_MTU_PROBING $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_TIME" "ac_cv_have_decl_NET_IPV4_IPFRAG_TIME" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_BASE_MSS" "ac_cv_have_decl_NET_TCP_BASE_MSS" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_TIME" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_BASE_MSS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IPFRAG_TIME $ac_have_decl +#define HAVE_DECL_NET_TCP_BASE_MSS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_MAX_KA_PROBES" "ac_cv_have_decl_NET_IPV4_TCP_MAX_KA_PROBES" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_MAX_KA_PROBES" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_MAX_KA_PROBES $ac_have_decl +#define HAVE_DECL_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_KEEPALIVE_TIME" "ac_cv_have_decl_NET_IPV4_TCP_KEEPALIVE_TIME" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_DMA_COPYBREAK" "ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_KEEPALIVE_TIME" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_TIME $ac_have_decl +#define HAVE_DECL_NET_TCP_DMA_COPYBREAK $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_KEEPALIVE_PROBES" "ac_cv_have_decl_NET_IPV4_TCP_KEEPALIVE_PROBES" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_SLOW_START_AFTER_IDLE" "ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_KEEPALIVE_PROBES" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_PROBES $ac_have_decl +#define HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_RETRIES1" "ac_cv_have_decl_NET_IPV4_TCP_RETRIES1" "#include +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_ENABLE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_RETRIES1" = xyes; then : +if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_RETRIES1 $ac_have_decl +#define HAVE_DECL_NET_CIPSOV4_CACHE_ENABLE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_RETRIES2" "ac_cv_have_decl_NET_IPV4_TCP_RETRIES2" "#include +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_BUCKET_SIZE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_RETRIES2" = xyes; then : +if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_RETRIES2 $ac_have_decl +#define HAVE_DECL_NET_CIPSOV4_CACHE_BUCKET_SIZE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_FIN_TIMEOUT" "ac_cv_have_decl_NET_IPV4_TCP_FIN_TIMEOUT" "#include +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_OPTFMT" "ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_FIN_TIMEOUT" = xyes; then : +if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_FIN_TIMEOUT $ac_have_decl +#define HAVE_DECL_NET_CIPSOV4_RBM_OPTFMT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IP_MASQ_DEBUG" "ac_cv_have_decl_NET_IPV4_IP_MASQ_DEBUG" "#include +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_STRICTVALID" "ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_IP_MASQ_DEBUG" = xyes; then : +if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IP_MASQ_DEBUG $ac_have_decl +#define HAVE_DECL_NET_CIPSOV4_RBM_STRICTVALID $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_SYNCOOKIES" "ac_cv_have_decl_NET_TCP_SYNCOOKIES" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_AVAIL_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" "#include #include " -if test "x$ac_cv_have_decl_NET_TCP_SYNCOOKIES" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_SYNCOOKIES $ac_have_decl +#define HAVE_DECL_NET_TCP_AVAIL_CONG_CONTROL $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_STDURG" "ac_cv_have_decl_NET_TCP_STDURG" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_ALLOWED_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" "#include #include " -if test "x$ac_cv_have_decl_NET_TCP_STDURG" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_STDURG $ac_have_decl +#define HAVE_DECL_NET_TCP_ALLOWED_CONG_CONTROL $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_RFC1337" "ac_cv_have_decl_NET_TCP_RFC1337" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_MAX_SSTHRESH" "ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" "#include #include " -if test "x$ac_cv_have_decl_NET_TCP_RFC1337" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_RFC1337 $ac_have_decl +#define HAVE_DECL_NET_TCP_MAX_SSTHRESH $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_SYN_TAILDROP" "ac_cv_have_decl_NET_TCP_SYN_TAILDROP" "#include +ac_fn_c_check_decl "$LINENO" "NET_TCP_FRTO_RESPONSE" "ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" "#include #include " -if test "x$ac_cv_have_decl_NET_TCP_SYN_TAILDROP" = xyes; then : +if test "x$ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_SYN_TAILDROP $ac_have_decl +#define HAVE_DECL_NET_TCP_FRTO_RESPONSE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MAX_SYN_BACKLOG" "ac_cv_have_decl_NET_TCP_MAX_SYN_BACKLOG" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "#include #include " -if test "x$ac_cv_have_decl_NET_TCP_MAX_SYN_BACKLOG" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MAX_SYN_BACKLOG $ac_have_decl +#define HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_LOCAL_PORT_RANGE" "ac_cv_have_decl_NET_IPV4_LOCAL_PORT_RANGE" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_FORCE_IGMP_VERSION" "ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_LOCAL_PORT_RANGE" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_LOCAL_PORT_RANGE $ac_have_decl +#define HAVE_DECL_NET_IPV4_CONF_FORCE_IGMP_VERSION $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_ECHO_IGNORE_ALL" "ac_cv_have_decl_NET_IPV4_ICMP_ECHO_IGNORE_ALL" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ANNOUNCE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_ECHO_IGNORE_ALL" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_ALL $ac_have_decl +#define HAVE_DECL_NET_IPV4_CONF_ARP_ANNOUNCE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" "ac_cv_have_decl_NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_IGNORE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS $ac_have_decl +#define HAVE_DECL_NET_IPV4_CONF_ARP_IGNORE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_SOURCEQUENCH_RATE" "ac_cv_have_decl_NET_IPV4_ICMP_SOURCEQUENCH_RATE" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_PROMOTE_SECONDARIES" "ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_SOURCEQUENCH_RATE" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_SOURCEQUENCH_RATE $ac_have_decl +#define HAVE_DECL_NET_IPV4_CONF_PROMOTE_SECONDARIES $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_DESTUNREACH_RATE" "ac_cv_have_decl_NET_IPV4_ICMP_DESTUNREACH_RATE" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ACCEPT" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_DESTUNREACH_RATE" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_DESTUNREACH_RATE $ac_have_decl +#define HAVE_DECL_NET_IPV4_CONF_ARP_ACCEPT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_TIMEEXCEED_RATE" "ac_cv_have_decl_NET_IPV4_ICMP_TIMEEXCEED_RATE" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_NOTIFY" "ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_TIMEEXCEED_RATE" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_TIMEEXCEED_RATE $ac_have_decl +#define HAVE_DECL_NET_IPV4_CONF_ARP_NOTIFY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_PARAMPROB_RATE" "ac_cv_have_decl_NET_IPV4_ICMP_PARAMPROB_RATE" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV6_MLD_MAX_MSF" "ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_PARAMPROB_RATE" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_PARAMPROB_RATE $ac_have_decl +#define HAVE_DECL_NET_IPV6_MLD_MAX_MSF $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_ECHOREPLY_RATE" "ac_cv_have_decl_NET_IPV4_ICMP_ECHOREPLY_RATE" "#include +ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_ECHOREPLY_RATE" = xyes; then : +if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_ECHOREPLY_RATE $ac_have_decl +#define HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" "ac_cv_have_decl_NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" "#include +ac_fn_c_check_decl "$LINENO" "VM_MAX_MAP_COUNT" "ac_cv_have_decl_VM_MAX_MAP_COUNT" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" = xyes; then : +if test "x$ac_cv_have_decl_VM_MAX_MAP_COUNT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES $ac_have_decl +#define HAVE_DECL_VM_MAX_MAP_COUNT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IGMP_MAX_MEMBERSHIPS" "ac_cv_have_decl_NET_IPV4_IGMP_MAX_MEMBERSHIPS" "#include +ac_fn_c_check_decl "$LINENO" "VM_LAPTOP_MODE" "ac_cv_have_decl_VM_LAPTOP_MODE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_IGMP_MAX_MEMBERSHIPS" = xyes; then : +if test "x$ac_cv_have_decl_VM_LAPTOP_MODE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IGMP_MAX_MEMBERSHIPS $ac_have_decl +#define HAVE_DECL_VM_LAPTOP_MODE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_TW_RECYCLE" "ac_cv_have_decl_NET_TCP_TW_RECYCLE" "#include +ac_fn_c_check_decl "$LINENO" "VM_BLOCK_DUMP" "ac_cv_have_decl_VM_BLOCK_DUMP" "#include #include " -if test "x$ac_cv_have_decl_NET_TCP_TW_RECYCLE" = xyes; then : +if test "x$ac_cv_have_decl_VM_BLOCK_DUMP" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_TW_RECYCLE $ac_have_decl +#define HAVE_DECL_VM_BLOCK_DUMP $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ALWAYS_DEFRAG" "ac_cv_have_decl_NET_IPV4_ALWAYS_DEFRAG" "#include +ac_fn_c_check_decl "$LINENO" "VM_HUGETLB_GROUP" "ac_cv_have_decl_VM_HUGETLB_GROUP" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_ALWAYS_DEFRAG" = xyes; then : +if test "x$ac_cv_have_decl_VM_HUGETLB_GROUP" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ALWAYS_DEFRAG $ac_have_decl +#define HAVE_DECL_VM_HUGETLB_GROUP $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_KEEPALIVE_INTVL" "ac_cv_have_decl_NET_IPV4_TCP_KEEPALIVE_INTVL" "#include +ac_fn_c_check_decl "$LINENO" "VM_VFS_CACHE_PRESSURE" "ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_KEEPALIVE_INTVL" = xyes; then : +if test "x$ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_INTVL $ac_have_decl +#define HAVE_DECL_VM_VFS_CACHE_PRESSURE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_INET_PEER_THRESHOLD" "ac_cv_have_decl_NET_IPV4_INET_PEER_THRESHOLD" "#include +ac_fn_c_check_decl "$LINENO" "VM_LEGACY_VA_LAYOUT" "ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_INET_PEER_THRESHOLD" = xyes; then : +if test "x$ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_INET_PEER_THRESHOLD $ac_have_decl +#define HAVE_DECL_VM_LEGACY_VA_LAYOUT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_INET_PEER_MINTTL" "ac_cv_have_decl_NET_IPV4_INET_PEER_MINTTL" "#include +ac_fn_c_check_decl "$LINENO" "VM_SWAP_TOKEN_TIMEOUT" "ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" "#include #include " -if test "x$ac_cv_have_decl_NET_IPV4_INET_PEER_MINTTL" = xyes; then : +if test "x$ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_INET_PEER_MINTTL $ac_have_decl +#define HAVE_DECL_VM_SWAP_TOKEN_TIMEOUT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_INET_PEER_MAXTTL" "ac_cv_have_decl_NET_IPV4_INET_PEER_MAXTTL" "#include -#include + + +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_ANY" "ac_cv_have_decl_V4L2_FIELD_ANY" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_INET_PEER_MAXTTL" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_ANY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_INET_PEER_MAXTTL $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_ANY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_INET_PEER_GC_MINTIME" "ac_cv_have_decl_NET_IPV4_INET_PEER_GC_MINTIME" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_NONE" "ac_cv_have_decl_V4L2_FIELD_NONE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_INET_PEER_GC_MINTIME" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_NONE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_INET_PEER_GC_MINTIME $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_NONE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_INET_PEER_GC_MAXTIME" "ac_cv_have_decl_NET_IPV4_INET_PEER_GC_MAXTIME" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_TOP" "ac_cv_have_decl_V4L2_FIELD_TOP" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_INET_PEER_GC_MAXTIME" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_TOP" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_INET_PEER_GC_MAXTIME $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_TOP $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ORPHAN_RETRIES" "ac_cv_have_decl_NET_TCP_ORPHAN_RETRIES" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_BOTTOM" "ac_cv_have_decl_V4L2_FIELD_BOTTOM" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_ORPHAN_RETRIES" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_BOTTOM" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ORPHAN_RETRIES $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_BOTTOM $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ABORT_ON_OVERFLOW" "ac_cv_have_decl_NET_TCP_ABORT_ON_OVERFLOW" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED" "ac_cv_have_decl_V4L2_FIELD_INTERLACED" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_ABORT_ON_OVERFLOW" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ABORT_ON_OVERFLOW $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_INTERLACED $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_SYNACK_RETRIES" "ac_cv_have_decl_NET_TCP_SYNACK_RETRIES" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_SEQ_TB" "ac_cv_have_decl_V4L2_FIELD_SEQ_TB" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_SYNACK_RETRIES" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_SEQ_TB" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_SYNACK_RETRIES $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_SEQ_TB $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MAX_ORPHANS" "ac_cv_have_decl_NET_TCP_MAX_ORPHANS" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_SEQ_BT" "ac_cv_have_decl_V4L2_FIELD_SEQ_BT" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_MAX_ORPHANS" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_SEQ_BT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MAX_ORPHANS $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_SEQ_BT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MAX_TW_BUCKETS" "ac_cv_have_decl_NET_TCP_MAX_TW_BUCKETS" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_ALTERNATE" "ac_cv_have_decl_V4L2_FIELD_ALTERNATE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_MAX_TW_BUCKETS" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_ALTERNATE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MAX_TW_BUCKETS $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_ALTERNATE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_FACK" "ac_cv_have_decl_NET_TCP_FACK" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED_TB" "ac_cv_have_decl_V4L2_FIELD_INTERLACED_TB" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_FACK" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED_TB" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_FACK $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_INTERLACED_TB $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_REORDERING" "ac_cv_have_decl_NET_TCP_REORDERING" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED_BT" "ac_cv_have_decl_V4L2_FIELD_INTERLACED_BT" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_REORDERING" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED_BT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_REORDERING $ac_have_decl +#define HAVE_DECL_V4L2_FIELD_INTERLACED_BT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ECN" "ac_cv_have_decl_NET_TCP_ECN" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_ECN" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ECN $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_DSACK" "ac_cv_have_decl_NET_TCP_DSACK" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_DSACK" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_DSACK $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MEM" "ac_cv_have_decl_NET_TCP_MEM" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_MEM" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MEM $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_WMEM" "ac_cv_have_decl_NET_TCP_WMEM" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_WMEM" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_WMEM $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_RMEM" "ac_cv_have_decl_NET_TCP_RMEM" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OVERLAY" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OVERLAY" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_RMEM" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OVERLAY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_RMEM $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OVERLAY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_APP_WIN" "ac_cv_have_decl_NET_TCP_APP_WIN" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VBI_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_VBI_CAPTURE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_APP_WIN" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VBI_CAPTURE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_APP_WIN $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VBI_CAPTURE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ADV_WIN_SCALE" "ac_cv_have_decl_NET_TCP_ADV_WIN_SCALE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VBI_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_VBI_OUTPUT" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_ADV_WIN_SCALE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VBI_OUTPUT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ADV_WIN_SCALE $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VBI_OUTPUT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_NONLOCAL_BIND" "ac_cv_have_decl_NET_IPV4_NONLOCAL_BIND" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_NONLOCAL_BIND" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_NONLOCAL_BIND $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_RATELIMIT" "ac_cv_have_decl_NET_IPV4_ICMP_RATELIMIT" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_RATELIMIT" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_RATELIMIT $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_RATEMASK" "ac_cv_have_decl_NET_IPV4_ICMP_RATEMASK" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_RATEMASK" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_RATEMASK $ac_have_decl +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_TW_REUSE" "ac_cv_have_decl_NET_TCP_TW_REUSE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_RADIO" "ac_cv_have_decl_V4L2_TUNER_RADIO" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_TW_REUSE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_TUNER_RADIO" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_TW_REUSE $ac_have_decl +#define HAVE_DECL_V4L2_TUNER_RADIO $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_FRTO" "ac_cv_have_decl_NET_TCP_FRTO" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_ANALOG_TV" "ac_cv_have_decl_V4L2_TUNER_ANALOG_TV" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_FRTO" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_TUNER_ANALOG_TV" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_FRTO $ac_have_decl +#define HAVE_DECL_V4L2_TUNER_ANALOG_TV $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_LOW_LATENCY" "ac_cv_have_decl_NET_TCP_LOW_LATENCY" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_DIGITAL_TV" "ac_cv_have_decl_V4L2_TUNER_DIGITAL_TV" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_LOW_LATENCY" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_TUNER_DIGITAL_TV" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_LOW_LATENCY $ac_have_decl +#define HAVE_DECL_V4L2_TUNER_DIGITAL_TV $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_SECRET_INTERVAL" "ac_cv_have_decl_NET_IPV4_IPFRAG_SECRET_INTERVAL" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_MMAP" "ac_cv_have_decl_V4L2_MEMORY_MMAP" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_SECRET_INTERVAL" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_MEMORY_MMAP" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IPFRAG_SECRET_INTERVAL $ac_have_decl +#define HAVE_DECL_V4L2_MEMORY_MMAP $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IGMP_MAX_MSF" "ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_USERPTR" "ac_cv_have_decl_V4L2_MEMORY_USERPTR" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_MEMORY_USERPTR" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IGMP_MAX_MSF $ac_have_decl +#define HAVE_DECL_V4L2_MEMORY_USERPTR $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_NO_METRICS_SAVE" "ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_OVERLAY" "ac_cv_have_decl_V4L2_MEMORY_OVERLAY" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_MEMORY_OVERLAY" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_NO_METRICS_SAVE $ac_have_decl +#define HAVE_DECL_V4L2_MEMORY_OVERLAY $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_DEFAULT_WIN_SCALE" "ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_DMABUF" "ac_cv_have_decl_V4L2_MEMORY_DMABUF" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_MEMORY_DMABUF" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_DEFAULT_WIN_SCALE $ac_have_decl +#define HAVE_DECL_V4L2_MEMORY_DMABUF $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MODERATE_RCVBUF" "ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SMPTE170M" "ac_cv_have_decl_V4L2_COLORSPACE_SMPTE170M" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SMPTE170M" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MODERATE_RCVBUF $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_SMPTE170M $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_TSO_WIN_DIVISOR" "ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SMPTE240M" "ac_cv_have_decl_V4L2_COLORSPACE_SMPTE240M" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SMPTE240M" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_SMPTE240M $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_BIC_BETA" "ac_cv_have_decl_NET_TCP_BIC_BETA" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_REC709" "ac_cv_have_decl_V4L2_COLORSPACE_REC709" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_BIC_BETA" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_REC709" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_BIC_BETA $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_REC709 $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_BT878" "ac_cv_have_decl_V4L2_COLORSPACE_BT878" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_BT878" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_BT878 $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_CONG_CONTROL" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_470_SYSTEM_M" "ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_M" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_CONG_CONTROL" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_M" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_CONG_CONTROL $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_M $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ABC" "ac_cv_have_decl_NET_TCP_ABC" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_470_SYSTEM_BG" "ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_BG" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_ABC" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_BG" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ABC $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_BG $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_MAX_DIST" "ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_JPEG" "ac_cv_have_decl_V4L2_COLORSPACE_JPEG" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_JPEG" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IPFRAG_MAX_DIST $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_JPEG $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MTU_PROBING" "ac_cv_have_decl_NET_TCP_MTU_PROBING" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SRGB" "ac_cv_have_decl_V4L2_COLORSPACE_SRGB" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_MTU_PROBING" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SRGB" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MTU_PROBING $ac_have_decl +#define HAVE_DECL_V4L2_COLORSPACE_SRGB $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_BASE_MSS" "ac_cv_have_decl_NET_TCP_BASE_MSS" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_UNSET" "ac_cv_have_decl_V4L2_PRIORITY_UNSET" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_BASE_MSS" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_PRIORITY_UNSET" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_BASE_MSS $ac_have_decl +#define HAVE_DECL_V4L2_PRIORITY_UNSET $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_BACKGROUND" "ac_cv_have_decl_V4L2_PRIORITY_BACKGROUND" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_PRIORITY_BACKGROUND" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS $ac_have_decl +#define HAVE_DECL_V4L2_PRIORITY_BACKGROUND $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_DMA_COPYBREAK" "ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_INTERACTIVE" "ac_cv_have_decl_V4L2_PRIORITY_INTERACTIVE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_PRIORITY_INTERACTIVE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_DMA_COPYBREAK $ac_have_decl +#define HAVE_DECL_V4L2_PRIORITY_INTERACTIVE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_SLOW_START_AFTER_IDLE" "ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_RECORD" "ac_cv_have_decl_V4L2_PRIORITY_RECORD" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_PRIORITY_RECORD" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE $ac_have_decl +#define HAVE_DECL_V4L2_PRIORITY_RECORD $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_ENABLE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_DISCRETE" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_DISCRETE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_DISCRETE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_CACHE_ENABLE $ac_have_decl +#define HAVE_DECL_V4L2_FRMSIZE_TYPE_DISCRETE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_BUCKET_SIZE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_CONTINUOUS" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_CONTINUOUS" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_CONTINUOUS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_CACHE_BUCKET_SIZE $ac_have_decl +#define HAVE_DECL_V4L2_FRMSIZE_TYPE_CONTINUOUS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_OPTFMT" "ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_STEPWISE" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_STEPWISE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_STEPWISE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_RBM_OPTFMT $ac_have_decl +#define HAVE_DECL_V4L2_FRMSIZE_TYPE_STEPWISE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_STRICTVALID" "ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_DISCRETE" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_DISCRETE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_DISCRETE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_RBM_STRICTVALID $ac_have_decl +#define HAVE_DECL_V4L2_FRMIVAL_TYPE_DISCRETE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_AVAIL_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_CONTINUOUS" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_CONTINUOUS" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_CONTINUOUS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_AVAIL_CONG_CONTROL $ac_have_decl +#define HAVE_DECL_V4L2_FRMIVAL_TYPE_CONTINUOUS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ALLOWED_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_STEPWISE" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_STEPWISE" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_STEPWISE" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ALLOWED_CONG_CONTROL $ac_have_decl +#define HAVE_DECL_V4L2_FRMIVAL_TYPE_STEPWISE $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MAX_SSTHRESH" "ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MAX_SSTHRESH $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_FRTO_RESPONSE" "ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BOOLEAN" "ac_cv_have_decl_V4L2_CTRL_TYPE_BOOLEAN" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BOOLEAN" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_FRTO_RESPONSE $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_BOOLEAN $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_FLUSH" "ac_cv_have_decl_NET_IPV4_ROUTE_FLUSH" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_MENU" "ac_cv_have_decl_V4L2_CTRL_TYPE_MENU" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_FLUSH" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_MENU" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_FLUSH $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_MENU $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_MIN_DELAY" "ac_cv_have_decl_NET_IPV4_ROUTE_MIN_DELAY" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BUTTON" "ac_cv_have_decl_V4L2_CTRL_TYPE_BUTTON" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_MIN_DELAY" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BUTTON" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_MIN_DELAY $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_BUTTON $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_MAX_DELAY" "ac_cv_have_decl_NET_IPV4_ROUTE_MAX_DELAY" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER64" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER64" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_MAX_DELAY" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER64" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_MAX_DELAY $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER64 $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_THRESH" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_THRESH" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_CTRL_CLASS" "ac_cv_have_decl_V4L2_CTRL_TYPE_CTRL_CLASS" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_THRESH" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_CTRL_CLASS" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_GC_THRESH $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_CTRL_CLASS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_MAX_SIZE" "ac_cv_have_decl_NET_IPV4_ROUTE_MAX_SIZE" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_STRING" "ac_cv_have_decl_V4L2_CTRL_TYPE_STRING" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_MAX_SIZE" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_STRING" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_MAX_SIZE $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_STRING $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_MIN_INTERVAL" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BITMASK" "ac_cv_have_decl_V4L2_CTRL_TYPE_BITMASK" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BITMASK" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_BITMASK $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_TIMEOUT" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_TIMEOUT" "#include -#include +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER_MENU" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER_MENU" "#include +#include +#include +#include " -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_TIMEOUT" = xyes; then : +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER_MENU" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_GC_TIMEOUT $ac_have_decl +#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER_MENU $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_INTERVAL" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_INTERVAL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_INTERVAL" = xyes; then : - ac_have_decl=1 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLKGETSIZE64" >&5 +$as_echo_n "checking for BLKGETSIZE64... " >&6; } +if ${ac_cv_have_blkgetsize64+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int +main () +{ +return !BLKGETSIZE64; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_blkgetsize64=yes +else + ac_cv_have_blkgetsize64=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_have_blkgetsize64 = yes; then + +$as_echo "#define HAVE_BLKGETSIZE64 1" >>confdefs.h + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_blkgetsize64" >&5 +$as_echo "$ac_cv_have_blkgetsize64" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_GC_INTERVAL $ac_have_decl +#define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_REDIRECT_LOAD" "ac_cv_have_decl_NET_IPV4_ROUTE_REDIRECT_LOAD" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_REDIRECT_LOAD" = xyes; then : - ac_have_decl=1 + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_LOAD $ac_have_decl +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_REDIRECT_NUMBER" "ac_cv_have_decl_NET_IPV4_ROUTE_REDIRECT_NUMBER" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_REDIRECT_NUMBER" = xyes; then : - ac_have_decl=1 + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "#include +"; then : + +else + if test "$ac_cv_type_off_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } + + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_NUMBER $ac_have_decl +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_REDIRECT_SILENCE" "ac_cv_have_decl_NET_IPV4_ROUTE_REDIRECT_SILENCE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_REDIRECT_SILENCE" = xyes; then : - ac_have_decl=1 + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kernel_long_t" >&5 +$as_echo_n "checking size of kernel_long_t... " >&6; } +if ${ac_cv_sizeof_kernel_long_t+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kernel_long_t))" "ac_cv_sizeof_kernel_long_t" "#include \"$srcdir/kernel_types.h\" +"; then : + +else + if test "$ac_cv_type_kernel_long_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (kernel_long_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_kernel_long_t=0 + fi fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kernel_long_t" >&5 +$as_echo "$ac_cv_sizeof_kernel_long_t" >&6; } + + + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_SILENCE $ac_have_decl +#define SIZEOF_KERNEL_LONG_T $ac_cv_sizeof_kernel_long_t _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_ERROR_COST" "ac_cv_have_decl_NET_IPV4_ROUTE_ERROR_COST" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_ERROR_COST" = xyes; then : - ac_have_decl=1 + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct i64_i32" >&5 +$as_echo_n "checking size of struct i64_i32... " >&6; } +if ${ac_cv_sizeof_struct_i64_i32+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct i64_i32))" "ac_cv_sizeof_struct_i64_i32" "struct i64_i32 {long long i64; int i32;}; +"; then : + +else + if test "$ac_cv_type_struct_i64_i32" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct i64_i32) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_i64_i32=0 + fi +fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_i64_i32" >&5 +$as_echo "$ac_cv_sizeof_struct_i64_i32" >&6; } + + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_ERROR_COST $ac_have_decl +#define SIZEOF_STRUCT_I64_I32 $ac_cv_sizeof_struct_i64_i32 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_ERROR_BURST" "ac_cv_have_decl_NET_IPV4_ROUTE_ERROR_BURST" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_ERROR_BURST" = xyes; then : - ac_have_decl=1 + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGRTMIN" >&5 +$as_echo_n "checking for SIGRTMIN... " >&6; } +if ${st_cv_SIGRTMIN+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + st_cv_SIGRTMIN="$(echo SIGRTMIN | + $CPP $CPPFLAGS -P -imacros asm/signal.h - | + grep '^[0-9]')" + test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_SIGRTMIN" >&5 +$as_echo "$st_cv_SIGRTMIN" >&6; } +if test "x$st_cv_SIGRTMIN" != xno; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_ERROR_BURST $ac_have_decl +#define ASM_SIGRTMIN $st_cv_SIGRTMIN _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_ELASTICITY" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_ELASTICITY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_ELASTICITY" = xyes; then : - ac_have_decl=1 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SA_RESTORER" >&5 +$as_echo_n "checking for SA_RESTORER... " >&6; } +if ${st_cv_SA_RESTORER+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + st_cv_SA_RESTORER="$(echo SA_RESTORER | + $CPP $CPPFLAGS -P -imacros asm/signal.h - | + grep ^0x)" + test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_SA_RESTORER" >&5 +$as_echo "$st_cv_SA_RESTORER" >&6; } +if test "x$st_cv_SA_RESTORER" != xno; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_GC_ELASTICITY $ac_have_decl +#define ASM_SA_RESTORER $st_cv_SA_RESTORER +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 +$as_echo_n "checking for __builtin_popcount... " >&6; } +if ${st_cv_have___builtin_popcount+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__builtin_popcount(0) + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_MTU_EXPIRES" "ac_cv_have_decl_NET_IPV4_ROUTE_MTU_EXPIRES" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_MTU_EXPIRES" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + st_cv_have___builtin_popcount=yes else - ac_have_decl=0 + st_cv_have___builtin_popcount=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have___builtin_popcount" >&5 +$as_echo "$st_cv_have___builtin_popcount" >&6; } +if test "x$st_cv_have___builtin_popcount" = xyes; then + +$as_echo "#define HAVE___BUILTIN_POPCOUNT 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_MTU_EXPIRES $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_MIN_PMTU" "ac_cv_have_decl_NET_IPV4_ROUTE_MIN_PMTU" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_MIN_PMTU" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_MIN_PMTU $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_MIN_ADVMSS" "ac_cv_have_decl_NET_IPV4_ROUTE_MIN_ADVMSS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_MIN_ADVMSS" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in -ldl" >&5 +$as_echo_n "checking for dladdr in -ldl... " >&6; } +if ${ac_cv_lib_dl_dladdr+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_MIN_ADVMSS $ac_have_decl +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dladdr (); +int +main () +{ +return dladdr (); + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_SECRET_INTERVAL" "ac_cv_have_decl_NET_IPV4_ROUTE_SECRET_INTERVAL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_SECRET_INTERVAL" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dladdr=yes else - ac_have_decl=0 + ac_cv_lib_dl_dladdr=no fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_SECRET_INTERVAL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : - ac_have_decl=1 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dladdr" >&5 +$as_echo "$ac_cv_lib_dl_dladdr" >&6; } +if test "x$ac_cv_lib_dl_dladdr" = xyes; then : + dl_LIBS='-ldl' else - ac_have_decl=0 + dl_LIBS= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_FORWARDING" "ac_cv_have_decl_NET_IPV4_CONF_FORWARDING" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_FORWARDING" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_lib_dl_dladdr" = xyes; then + +$as_echo "#define HAVE_DLADDR 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_FORWARDING $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_MC_FORWARDING" "ac_cv_have_decl_NET_IPV4_CONF_MC_FORWARDING" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_MC_FORWARDING" = xyes; then : - ac_have_decl=1 + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PERL+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_MC_FORWARDING $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_PROXY_ARP" "ac_cv_have_decl_NET_IPV4_CONF_PROXY_ARP" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_PROXY_ARP" = xyes; then : - ac_have_decl=1 + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - ac_have_decl=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_PROXY_ARP $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ACCEPT_REDIRECTS" "ac_cv_have_decl_NET_IPV4_CONF_ACCEPT_REDIRECTS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ACCEPT_REDIRECTS" = xyes; then : - ac_have_decl=1 + + +libunwind_CPPFLAGS= +libunwind_LDFLAGS= +libunwind_LIBS= + +# Check whether --with-libunwind was given. +if test "${with_libunwind+set}" = set; then : + withval=$with_libunwind; case "${withval}" in + yes|no|check) ;; + *) with_libunwind=yes + libunwind_CPPFLAGS="-I${withval}/include" + libunwind_LDFLAGS="-L${withval}/lib" ;; + esac else - ac_have_decl=0 + with_libunwind=check + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ACCEPT_REDIRECTS $ac_have_decl + +use_libunwind=no +if test "x$with_libunwind" != xno; then : + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS" + + for ac_header in libunwind-ptrace.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libunwind-ptrace.h" "ac_cv_header_libunwind_ptrace_h" "$ac_includes_default" +if test "x$ac_cv_header_libunwind_ptrace_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUNWIND_PTRACE_H 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_SECURE_REDIRECTS" "ac_cv_have_decl_NET_IPV4_CONF_SECURE_REDIRECTS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_SECURE_REDIRECTS" = xyes; then : - ac_have_decl=1 + saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $libunwind_LDFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lunwind" >&5 +$as_echo_n "checking for backtrace in -lunwind... " >&6; } +if ${ac_cv_lib_unwind_backtrace+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi + ac_check_lib_save_LIBS=$LIBS +LIBS="-lunwind $libunwind_LIBS + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_SECURE_REDIRECTS $ac_have_decl +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char backtrace (); +int +main () +{ +return backtrace (); + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_SEND_REDIRECTS" "ac_cv_have_decl_NET_IPV4_CONF_SEND_REDIRECTS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_SEND_REDIRECTS" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_unwind_backtrace=yes else - ac_have_decl=0 + ac_cv_lib_unwind_backtrace=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_backtrace" >&5 +$as_echo "$ac_cv_lib_unwind_backtrace" >&6; } +if test "x$ac_cv_lib_unwind_backtrace" = xyes; then : + libunwind_LIBS="-lunwind $libunwind_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_create_addr_space in libunwind-generic" >&5 +$as_echo_n "checking for unw_create_addr_space in libunwind-generic... " >&6; } + saved_LIBS="$LIBS" + LIBS="-lunwind-generic $libunwind_LIBS $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return !unw_create_addr_space(0, 0) + ; + return 0; +} -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_SEND_REDIRECTS $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_SHARED_MEDIA" "ac_cv_have_decl_NET_IPV4_CONF_SHARED_MEDIA" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_SHARED_MEDIA" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + libunwind_LIBS="-lunwind-generic $libunwind_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _UPT_create in -lunwind-ptrace" >&5 +$as_echo_n "checking for _UPT_create in -lunwind-ptrace... " >&6; } +if ${ac_cv_lib_unwind_ptrace__UPT_create+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi + ac_check_lib_save_LIBS=$LIBS +LIBS="-lunwind-ptrace $libunwind_LIBS + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_SHARED_MEDIA $ac_have_decl +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _UPT_create (); +int +main () +{ +return _UPT_create (); + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_RP_FILTER" "ac_cv_have_decl_NET_IPV4_CONF_RP_FILTER" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_RP_FILTER" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_unwind_ptrace__UPT_create=yes else - ac_have_decl=0 + ac_cv_lib_unwind_ptrace__UPT_create=no fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_RP_FILTER $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" "ac_cv_have_decl_NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_ptrace__UPT_create" >&5 +$as_echo "$ac_cv_lib_unwind_ptrace__UPT_create" >&6; } +if test "x$ac_cv_lib_unwind_ptrace__UPT_create" = xyes; then : + libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS" + use_libunwind=yes -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_BOOTP_RELAY" "ac_cv_have_decl_NET_IPV4_CONF_BOOTP_RELAY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_BOOTP_RELAY" = xyes; then : - ac_have_decl=1 else - ac_have_decl=0 -fi + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find _UPT_create in libunwind-ptrace +See \`config.log' for more details" "$LINENO" 5; } + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_BOOTP_RELAY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_LOG_MARTIANS" "ac_cv_have_decl_NET_IPV4_CONF_LOG_MARTIANS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_LOG_MARTIANS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_LOG_MARTIANS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_TAG" "ac_cv_have_decl_NET_IPV4_CONF_TAG" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_TAG" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_TAG $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARPFILTER" "ac_cv_have_decl_NET_IPV4_CONF_ARPFILTER" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARPFILTER" = xyes; then : - ac_have_decl=1 else - ac_have_decl=0 -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find unw_create_addr_space in libunwind-generic +See \`config.log' for more details" "$LINENO" 5; } + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARPFILTER $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_MEDIUM_ID" "ac_cv_have_decl_NET_IPV4_CONF_MEDIUM_ID" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_MEDIUM_ID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_MEDIUM_ID $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_NOXFRM" "ac_cv_have_decl_NET_IPV4_CONF_NOXFRM" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_NOXFRM" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_NOXFRM $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_NOPOLICY" "ac_cv_have_decl_NET_IPV4_CONF_NOPOLICY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_NOPOLICY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + LIBS="$saved_LIBS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_NOPOLICY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_FORCE_IGMP_VERSION" "ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" = xyes; then : - ac_have_decl=1 else - ac_have_decl=0 -fi + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find libunwind +See \`config.log' for more details" "$LINENO" 5; } + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_FORCE_IGMP_VERSION $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ANNOUNCE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_ANNOUNCE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_IGNORE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_IGNORE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_PROMOTE_SECONDARIES" "ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + LDFLAGS="$saved_LDFLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_PROMOTE_SECONDARIES $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ACCEPT" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" = xyes; then : - ac_have_decl=1 else - ac_have_decl=0 -fi + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find libunwind-ptrace.h +See \`config.log' for more details" "$LINENO" 5; } + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_ACCEPT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_NOTIFY" "ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_NOTIFY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_CONF" "ac_cv_have_decl_NET_IPV6_CONF" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_CONF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_CONF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_NEIGH" "ac_cv_have_decl_NET_IPV6_NEIGH" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_NEIGH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +done + + + CPPFLAGS="$saved_CPPFLAGS" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_NEIGH $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE" "ac_cv_have_decl_NET_IPV6_ROUTE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ICMP" "ac_cv_have_decl_NET_IPV6_ICMP" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ICMP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ICMP $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_BINDV6ONLY" "ac_cv_have_decl_NET_IPV6_BINDV6ONLY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_BINDV6ONLY" = xyes; then : - ac_have_decl=1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable stack tracing support using libunwind" >&5 +$as_echo_n "checking whether to enable stack tracing support using libunwind... " >&6; } +if test "x$use_libunwind" = xyes; then + +$as_echo "#define USE_LIBUNWIND 1" >>confdefs.h + + + + +fi + if test "x$use_libunwind" = xyes; then + USE_LIBUNWIND_TRUE= + USE_LIBUNWIND_FALSE='#' else - ac_have_decl=0 + USE_LIBUNWIND_TRUE='#' + USE_LIBUNWIND_FALSE= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_BINDV6ONLY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_IP6FRAG_HIGH_THRESH" "ac_cv_have_decl_NET_IPV6_IP6FRAG_HIGH_THRESH" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_IP6FRAG_HIGH_THRESH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libunwind" >&5 +$as_echo "$use_libunwind" >&6; } + +if test "$arch" = mips && test "$no_create" != yes; then + mkdir -p linux/mips + if $srcdir/linux/mips/genstub.sh linux/mips; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Generated MIPS syscallent stubs" >&5 +$as_echo "Generated MIPS syscallent stubs" >&6; } + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Failed to generate syscallent stubs +See \`config.log' for more details" "$LINENO" 5; } + fi fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_IP6FRAG_HIGH_THRESH $ac_have_decl + + + + + + + + + + + +case "$arch" in + aarch64|powerpc64|sparc64|tile|x32|x86_64) + + + + for ac_header in gnu/stubs-32.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "gnu/stubs-32.h" "ac_cv_header_gnu_stubs_32_h" "$ac_includes_default" +if test "x$ac_cv_header_gnu_stubs_32_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GNU_STUBS_32_H 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_IP6FRAG_LOW_THRESH" "ac_cv_have_decl_NET_IPV6_IP6FRAG_LOW_THRESH" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_IP6FRAG_LOW_THRESH" = xyes; then : - ac_have_decl=1 + IFLAG= else - ac_have_decl=0 + mkdir -p gnu + : > gnu/stubs-32.h + { $as_echo "$as_me:${as_lineno-$LINENO}: Created empty gnu/stubs-32.h" >&5 +$as_echo "$as_me: Created empty gnu/stubs-32.h" >&6;} + IFLAG=-I. fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_IP6FRAG_LOW_THRESH $ac_have_decl +done + + + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -m32 $IFLAG" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -m32 compile support" >&5 +$as_echo_n "checking for -m32 compile support... " >&6; } +if ${st_cv_m32_cc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int main(){return 0;} _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_IP6FRAG_TIME" "ac_cv_have_decl_NET_IPV6_IP6FRAG_TIME" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_IP6FRAG_TIME" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_m32_cc=yes else - ac_have_decl=0 + st_cv_m32_cc=no fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_IP6FRAG_TIME $ac_have_decl +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_cc" >&5 +$as_echo "$st_cv_m32_cc" >&6; } + if test $st_cv_m32_cc = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -m32 runtime support" >&5 +$as_echo_n "checking for -m32 runtime support... " >&6; } +if ${st_cv_m32_runtime+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + st_cv_m32_runtime=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int main(){return 0;} _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_IP6FRAG_SECRET_INTERVAL" "ac_cv_have_decl_NET_IPV6_IP6FRAG_SECRET_INTERVAL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_IP6FRAG_SECRET_INTERVAL" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_run "$LINENO"; then : + st_cv_m32_runtime=yes else - ac_have_decl=0 + st_cv_m32_runtime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_IP6FRAG_SECRET_INTERVAL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_MLD_MAX_MSF" "ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_runtime" >&5 +$as_echo "$st_cv_m32_runtime" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh -m32 works" >&5 +$as_echo_n "checking whether mpers.sh -m32 works... " >&6; } +if ${st_cv_m32_mpers+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \ + $srcdir/mpers_test.sh m32; then + st_cv_m32_mpers=yes + else + st_cv_m32_mpers=no + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_mpers" >&5 +$as_echo "$st_cv_m32_mpers" >&6; } + if test $st_cv_m32_mpers = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_MLD_MAX_MSF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_FLUSH" "ac_cv_have_decl_NET_IPV6_ROUTE_FLUSH" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_FLUSH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +$as_echo "#define HAVE_M32_MPERS 1" >>confdefs.h + + + + + + + + + +if test -n "${ac_cv_type_struct_stat+set}"; then : + saved_ac_cv_type_struct_stat="${ac_cv_type_struct_stat}"; unset ac_cv_type_struct_stat +fi +if test -n "${ac_cv_m32_type_struct_stat+set}"; then : + ac_cv_type_struct_stat="${ac_cv_m32_type_struct_stat}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_FLUSH $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_THRESH" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_THRESH" "#include -#include + + + + + +ac_fn_c_check_type "$LINENO" "struct stat" "ac_cv_type_struct_stat" "#include +#include " -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_THRESH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_stat" = xyes; then : + +$as_echo "#define HAVE_M32_STRUCT_STAT 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_GC_THRESH $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_MAX_SIZE" "ac_cv_have_decl_NET_IPV6_ROUTE_MAX_SIZE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_MAX_SIZE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_type_struct_stat+set}"; then : + ac_cv_m32_type_struct_stat="${ac_cv_type_struct_stat}" +fi +if test -n "${saved_ac_cv_type_struct_stat+set}"; then : + ac_cv_type_struct_stat="${saved_ac_cv_type_struct_stat}"; unset saved_ac_cv_type_struct_stat fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_MAX_SIZE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_MIN_INTERVAL" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + + + + + + + +if test -n "${ac_cv_member_struct_stat_st_mtime_nsec+set}"; then : + saved_ac_cv_member_struct_stat_st_mtime_nsec="${ac_cv_member_struct_stat_st_mtime_nsec}"; unset ac_cv_member_struct_stat_st_mtime_nsec +fi +if test -n "${ac_cv_m32_member_struct_stat_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat_st_mtime_nsec="${ac_cv_m32_member_struct_stat_st_mtime_nsec}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_TIMEOUT" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_TIMEOUT" "#include -#include + + + + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_mtime_nsec" "ac_cv_member_struct_stat_st_mtime_nsec" "#include +#include " -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_TIMEOUT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_struct_stat_st_mtime_nsec" = xyes; then : + +$as_echo "#define HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_GC_TIMEOUT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_INTERVAL" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_INTERVAL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_INTERVAL" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_member_struct_stat_st_mtime_nsec+set}"; then : + ac_cv_m32_member_struct_stat_st_mtime_nsec="${ac_cv_member_struct_stat_st_mtime_nsec}" +fi +if test -n "${saved_ac_cv_member_struct_stat_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat_st_mtime_nsec="${saved_ac_cv_member_struct_stat_st_mtime_nsec}"; unset saved_ac_cv_member_struct_stat_st_mtime_nsec fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_GC_INTERVAL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_ELASTICITY" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_ELASTICITY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_ELASTICITY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + + + + + + + + + + +if test -n "${ac_cv_type_struct_stat64+set}"; then : + saved_ac_cv_type_struct_stat64="${ac_cv_type_struct_stat64}"; unset ac_cv_type_struct_stat64 +fi +if test -n "${ac_cv_m32_type_struct_stat64+set}"; then : + ac_cv_type_struct_stat64="${ac_cv_m32_type_struct_stat64}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_GC_ELASTICITY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_MTU_EXPIRES" "ac_cv_have_decl_NET_IPV6_ROUTE_MTU_EXPIRES" "#include -#include + + + + + +ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "#include +#include " -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_MTU_EXPIRES" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_stat64" = xyes; then : + +$as_echo "#define HAVE_M32_STRUCT_STAT64 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_MTU_EXPIRES $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_MIN_ADVMSS" "ac_cv_have_decl_NET_IPV6_ROUTE_MIN_ADVMSS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_MIN_ADVMSS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_type_struct_stat64+set}"; then : + ac_cv_m32_type_struct_stat64="${ac_cv_type_struct_stat64}" +fi +if test -n "${saved_ac_cv_type_struct_stat64+set}"; then : + ac_cv_type_struct_stat64="${saved_ac_cv_type_struct_stat64}"; unset saved_ac_cv_type_struct_stat64 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_MIN_ADVMSS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + + + + + + + +if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + saved_ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}"; unset ac_cv_member_struct_stat64_st_mtime_nsec +fi +if test -n "${ac_cv_m32_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_m32_member_struct_stat64_st_mtime_nsec}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_UNIX_DESTROY_DELAY" "ac_cv_have_decl_NET_UNIX_DESTROY_DELAY" "#include -#include + + + + + +ac_fn_c_check_member "$LINENO" "struct stat64" "st_mtime_nsec" "ac_cv_member_struct_stat64_st_mtime_nsec" "#include +#include " -if test "x$ac_cv_have_decl_NET_UNIX_DESTROY_DELAY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_struct_stat64_st_mtime_nsec" = xyes; then : + +$as_echo "#define HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_UNIX_DESTROY_DELAY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_UNIX_DELETE_DELAY" "ac_cv_have_decl_NET_UNIX_DELETE_DELAY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_UNIX_DELETE_DELAY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_m32_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}" +fi +if test -n "${saved_ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat64_st_mtime_nsec="${saved_ac_cv_member_struct_stat64_st_mtime_nsec}"; unset saved_ac_cv_member_struct_stat64_st_mtime_nsec fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_UNIX_DELETE_DELAY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "NET_UNIX_MAX_DGRAM_QLEN" "ac_cv_have_decl_NET_UNIX_MAX_DGRAM_QLEN" "#include -#include -" -if test "x$ac_cv_have_decl_NET_UNIX_MAX_DGRAM_QLEN" = xyes; then : - ac_have_decl=1 + + + + + + + + fi + fi + CFLAGS="$saved_CFLAGS" + ;; + + *) + st_cv_m32_runtime=no + st_cv_m32_mpers=no + ;; +esac + + if test "$st_cv_m32_mpers$st_cv_m32_runtime" = yesyes; then + HAVE_M32_RUNTIME_TRUE= + HAVE_M32_RUNTIME_FALSE='#' else - ac_have_decl=0 + HAVE_M32_RUNTIME_TRUE='#' + HAVE_M32_RUNTIME_FALSE= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_UNIX_MAX_DGRAM_QLEN $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_OVERCOMMIT_MEMORY" "ac_cv_have_decl_VM_OVERCOMMIT_MEMORY" "#include -#include -" -if test "x$ac_cv_have_decl_VM_OVERCOMMIT_MEMORY" = xyes; then : - ac_have_decl=1 + if test "$st_cv_m32_mpers" = yes; then + HAVE_M32_MPERS_TRUE= + HAVE_M32_MPERS_FALSE='#' else - ac_have_decl=0 + HAVE_M32_MPERS_TRUE='#' + HAVE_M32_MPERS_FALSE= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_OVERCOMMIT_MEMORY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_PAGE_CLUSTER" "ac_cv_have_decl_VM_PAGE_CLUSTER" "#include -#include -" -if test "x$ac_cv_have_decl_VM_PAGE_CLUSTER" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_PAGE_CLUSTER $ac_have_decl + + + + + + + + + + + + + + + + + + + + + +case "$arch" in + x86_64) + + + + for ac_header in gnu/stubs-x32.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "gnu/stubs-x32.h" "ac_cv_header_gnu_stubs_x32_h" "$ac_includes_default" +if test "x$ac_cv_header_gnu_stubs_x32_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GNU_STUBS_X32_H 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_DIRTY_BACKGROUND" "ac_cv_have_decl_VM_DIRTY_BACKGROUND" "#include -#include -" -if test "x$ac_cv_have_decl_VM_DIRTY_BACKGROUND" = xyes; then : - ac_have_decl=1 + IFLAG= else - ac_have_decl=0 + mkdir -p gnu + : > gnu/stubs-x32.h + { $as_echo "$as_me:${as_lineno-$LINENO}: Created empty gnu/stubs-x32.h" >&5 +$as_echo "$as_me: Created empty gnu/stubs-x32.h" >&6;} + IFLAG=-I. fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_DIRTY_BACKGROUND $ac_have_decl +done + + + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -mx32 $IFLAG" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mx32 compile support" >&5 +$as_echo_n "checking for -mx32 compile support... " >&6; } +if ${st_cv_mx32_cc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int main(){return 0;} _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_DIRTY_RATIO" "ac_cv_have_decl_VM_DIRTY_RATIO" "#include -#include -" -if test "x$ac_cv_have_decl_VM_DIRTY_RATIO" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_mx32_cc=yes else - ac_have_decl=0 + st_cv_mx32_cc=no fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_DIRTY_RATIO $ac_have_decl +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_cc" >&5 +$as_echo "$st_cv_mx32_cc" >&6; } + if test $st_cv_mx32_cc = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mx32 runtime support" >&5 +$as_echo_n "checking for -mx32 runtime support... " >&6; } +if ${st_cv_mx32_runtime+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + st_cv_mx32_runtime=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int main(){return 0;} _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_DIRTY_WB_CS" "ac_cv_have_decl_VM_DIRTY_WB_CS" "#include -#include -" -if test "x$ac_cv_have_decl_VM_DIRTY_WB_CS" = xyes; then : - ac_have_decl=1 +if ac_fn_c_try_run "$LINENO"; then : + st_cv_mx32_runtime=yes else - ac_have_decl=0 + st_cv_mx32_runtime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_DIRTY_WB_CS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_DIRTY_EXPIRE_CS" "ac_cv_have_decl_VM_DIRTY_EXPIRE_CS" "#include -#include -" -if test "x$ac_cv_have_decl_VM_DIRTY_EXPIRE_CS" = xyes; then : - ac_have_decl=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_runtime" >&5 +$as_echo "$st_cv_mx32_runtime" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh -mx32 works" >&5 +$as_echo_n "checking whether mpers.sh -mx32 works... " >&6; } +if ${st_cv_mx32_mpers+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \ + $srcdir/mpers_test.sh mx32; then + st_cv_mx32_mpers=yes + else + st_cv_mx32_mpers=no + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_mpers" >&5 +$as_echo "$st_cv_mx32_mpers" >&6; } + if test $st_cv_mx32_mpers = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_DIRTY_EXPIRE_CS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_NR_PDFLUSH_THREADS" "ac_cv_have_decl_VM_NR_PDFLUSH_THREADS" "#include -#include -" -if test "x$ac_cv_have_decl_VM_NR_PDFLUSH_THREADS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +$as_echo "#define HAVE_MX32_MPERS 1" >>confdefs.h + + + + + + + + + +if test -n "${ac_cv_type_struct_stat+set}"; then : + saved_ac_cv_type_struct_stat="${ac_cv_type_struct_stat}"; unset ac_cv_type_struct_stat +fi +if test -n "${ac_cv_mx32_type_struct_stat+set}"; then : + ac_cv_type_struct_stat="${ac_cv_mx32_type_struct_stat}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_NR_PDFLUSH_THREADS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_OVERCOMMIT_RATIO" "ac_cv_have_decl_VM_OVERCOMMIT_RATIO" "#include -#include + + + + + +ac_fn_c_check_type "$LINENO" "struct stat" "ac_cv_type_struct_stat" "#include +#include " -if test "x$ac_cv_have_decl_VM_OVERCOMMIT_RATIO" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_stat" = xyes; then : + +$as_echo "#define HAVE_MX32_STRUCT_STAT 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_OVERCOMMIT_RATIO $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_PAGEBUF" "ac_cv_have_decl_VM_PAGEBUF" "#include -#include -" -if test "x$ac_cv_have_decl_VM_PAGEBUF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_type_struct_stat+set}"; then : + ac_cv_mx32_type_struct_stat="${ac_cv_type_struct_stat}" +fi +if test -n "${saved_ac_cv_type_struct_stat+set}"; then : + ac_cv_type_struct_stat="${saved_ac_cv_type_struct_stat}"; unset saved_ac_cv_type_struct_stat fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_PAGEBUF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_HUGETLB_PAGES" "ac_cv_have_decl_VM_HUGETLB_PAGES" "#include -#include -" -if test "x$ac_cv_have_decl_VM_HUGETLB_PAGES" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + + + + + + + +if test -n "${ac_cv_member_struct_stat_st_mtime_nsec+set}"; then : + saved_ac_cv_member_struct_stat_st_mtime_nsec="${ac_cv_member_struct_stat_st_mtime_nsec}"; unset ac_cv_member_struct_stat_st_mtime_nsec +fi +if test -n "${ac_cv_mx32_member_struct_stat_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat_st_mtime_nsec="${ac_cv_mx32_member_struct_stat_st_mtime_nsec}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_HUGETLB_PAGES $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_SWAPPINESS" "ac_cv_have_decl_VM_SWAPPINESS" "#include -#include + + + + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_mtime_nsec" "ac_cv_member_struct_stat_st_mtime_nsec" "#include +#include " -if test "x$ac_cv_have_decl_VM_SWAPPINESS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_struct_stat_st_mtime_nsec" = xyes; then : + +$as_echo "#define HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_SWAPPINESS $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_LOWMEM_RESERVE_RATIO" "ac_cv_have_decl_VM_LOWMEM_RESERVE_RATIO" "#include -#include -" -if test "x$ac_cv_have_decl_VM_LOWMEM_RESERVE_RATIO" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_member_struct_stat_st_mtime_nsec+set}"; then : + ac_cv_mx32_member_struct_stat_st_mtime_nsec="${ac_cv_member_struct_stat_st_mtime_nsec}" +fi +if test -n "${saved_ac_cv_member_struct_stat_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat_st_mtime_nsec="${saved_ac_cv_member_struct_stat_st_mtime_nsec}"; unset saved_ac_cv_member_struct_stat_st_mtime_nsec fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_LOWMEM_RESERVE_RATIO $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_MIN_FREE_KBYTES" "ac_cv_have_decl_VM_MIN_FREE_KBYTES" "#include -#include -" -if test "x$ac_cv_have_decl_VM_MIN_FREE_KBYTES" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + + + + + + + + + + +if test -n "${ac_cv_type_struct_stat64+set}"; then : + saved_ac_cv_type_struct_stat64="${ac_cv_type_struct_stat64}"; unset ac_cv_type_struct_stat64 +fi +if test -n "${ac_cv_mx32_type_struct_stat64+set}"; then : + ac_cv_type_struct_stat64="${ac_cv_mx32_type_struct_stat64}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_MIN_FREE_KBYTES $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_MAX_MAP_COUNT" "ac_cv_have_decl_VM_MAX_MAP_COUNT" "#include -#include + + + + + +ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "#include +#include " -if test "x$ac_cv_have_decl_VM_MAX_MAP_COUNT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_stat64" = xyes; then : + +$as_echo "#define HAVE_MX32_STRUCT_STAT64 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_MAX_MAP_COUNT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_LAPTOP_MODE" "ac_cv_have_decl_VM_LAPTOP_MODE" "#include -#include -" -if test "x$ac_cv_have_decl_VM_LAPTOP_MODE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_type_struct_stat64+set}"; then : + ac_cv_mx32_type_struct_stat64="${ac_cv_type_struct_stat64}" +fi +if test -n "${saved_ac_cv_type_struct_stat64+set}"; then : + ac_cv_type_struct_stat64="${saved_ac_cv_type_struct_stat64}"; unset saved_ac_cv_type_struct_stat64 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_LAPTOP_MODE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_BLOCK_DUMP" "ac_cv_have_decl_VM_BLOCK_DUMP" "#include -#include -" -if test "x$ac_cv_have_decl_VM_BLOCK_DUMP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + + + + + + + +if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + saved_ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}"; unset ac_cv_member_struct_stat64_st_mtime_nsec +fi +if test -n "${ac_cv_mx32_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_mx32_member_struct_stat64_st_mtime_nsec}" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_BLOCK_DUMP $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_HUGETLB_GROUP" "ac_cv_have_decl_VM_HUGETLB_GROUP" "#include -#include + + + + + +ac_fn_c_check_member "$LINENO" "struct stat64" "st_mtime_nsec" "ac_cv_member_struct_stat64_st_mtime_nsec" "#include +#include " -if test "x$ac_cv_have_decl_VM_HUGETLB_GROUP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_struct_stat64_st_mtime_nsec" = xyes; then : + +$as_echo "#define HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC 1" >>confdefs.h + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_HUGETLB_GROUP $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_VFS_CACHE_PRESSURE" "ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" "#include -#include -" -if test "x$ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + + + + + +if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_mx32_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}" +fi +if test -n "${saved_ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat64_st_mtime_nsec="${saved_ac_cv_member_struct_stat64_st_mtime_nsec}"; unset saved_ac_cv_member_struct_stat64_st_mtime_nsec fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_VFS_CACHE_PRESSURE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_LEGACY_VA_LAYOUT" "ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" "#include -#include -" -if test "x$ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" = xyes; then : - ac_have_decl=1 + + + + + + + + fi + fi + CFLAGS="$saved_CFLAGS" + ;; + + *) + st_cv_mx32_runtime=no + st_cv_mx32_mpers=no + ;; +esac + + if test "$st_cv_mx32_mpers$st_cv_mx32_runtime" = yesyes; then + HAVE_MX32_RUNTIME_TRUE= + HAVE_MX32_RUNTIME_FALSE='#' else - ac_have_decl=0 + HAVE_MX32_RUNTIME_TRUE='#' + HAVE_MX32_RUNTIME_FALSE= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_LEGACY_VA_LAYOUT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "VM_SWAP_TOKEN_TIMEOUT" "ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" "#include -#include -" -if test "x$ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" = xyes; then : - ac_have_decl=1 + if test "$st_cv_mx32_mpers" = yes; then + HAVE_MX32_MPERS_TRUE= + HAVE_MX32_MPERS_FALSE='#' else - ac_have_decl=0 + HAVE_MX32_MPERS_TRUE='#' + HAVE_MX32_MPERS_FALSE= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_SWAP_TOKEN_TIMEOUT $ac_have_decl -_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLKGETSIZE64" >&5 -$as_echo_n "checking for BLKGETSIZE64... " >&6; } -if ${ac_cv_have_blkgetsize64+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -return !BLKGETSIZE64; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_blkgetsize64=yes + + + + + + + + + + + + + + # Check whether --enable-valgrind was given. +if test "${enable_valgrind+set}" = set; then : + enableval=$enable_valgrind; enable_valgrind=$enableval else - ac_cv_have_blkgetsize64=no + enable_valgrind= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_have_blkgetsize64 = yes; then -$as_echo "#define HAVE_BLKGETSIZE64 1" >>confdefs.h - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_blkgetsize64" >&5 -$as_echo "$ac_cv_have_blkgetsize64" >&6; } + if test "$enable_valgrind" != "no"; then : -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : + # Check for Valgrind. + # Extract the first word of "valgrind", so it can be a program name with args. +set dummy valgrind; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_VALGRIND+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - + if test -n "$VALGRIND"; then + ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi -fi +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_VALGRIND="valgrind" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +fi +VALGRIND=$ac_cv_prog_VALGRIND +if test -n "$VALGRIND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 +$as_echo "$VALGRIND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "$VALGRIND" = ""; then : -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF + if test "$enable_valgrind" = "yes"; then : + as_fn_error $? "Could not find valgrind; either install it or reconfigure with --disable-valgrind" "$LINENO" 5 -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + + enable_valgrind=no + +fi else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long=0 - fi + + enable_valgrind=yes + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } + if test "$enable_valgrind" = "yes"; then + VALGRIND_ENABLED_TRUE= + VALGRIND_ENABLED_FALSE='#' +else + VALGRIND_ENABLED_TRUE='#' + VALGRIND_ENABLED_FALSE= +fi + VALGRIND_ENABLED=$enable_valgrind -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF + # Check for Valgrind tools we care about. + valgrind_enabled_tools= -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 -$as_echo_n "checking size of off_t... " >&6; } -if ${ac_cv_sizeof_off_t+:} false; then : - $as_echo_n "(cached) " >&6 + # Check whether --enable-valgrind-memcheck was given. +if test "${enable_valgrind_memcheck+set}" = set; then : + enableval=$enable_valgrind_memcheck; enable_valgrind_memcheck=$enableval else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "#include -"; then : + enable_valgrind_memcheck= +fi + + if test "$enable_valgrind" = "no"; then : + + enable_valgrind_memcheck=no +elif test "$enable_valgrind_memcheck" != "no"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool memcheck" >&5 +$as_echo_n "checking for Valgrind tool memcheck... " >&6; } +if ${ax_cv_valgrind_tool_memcheck+:} false; then : + $as_echo_n "(cached) " >&6 else - if test "$ac_cv_type_off_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (off_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_off_t=0 - fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 -$as_echo "$ac_cv_sizeof_off_t" >&6; } + ax_cv_valgrind_tool_memcheck=no + if `$VALGRIND --tool=memcheck --help >/dev/null 2>&1`; then : + ax_cv_valgrind_tool_memcheck=yes -cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t -_ACEOF +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_memcheck" >&5 +$as_echo "$ax_cv_valgrind_tool_memcheck" >&6; } + if test "$ax_cv_valgrind_tool_memcheck" = "no"; then : + if test "$enable_valgrind_memcheck" = "yes"; then : + + as_fn_error $? "Valgrind does not support memcheck; reconfigure with --disable-valgrind-memcheck" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SA_RESTORER" >&5 -$as_echo_n "checking for SA_RESTORER... " >&6; } -if ${st_cv_sa_restorer+:} false; then : - $as_echo_n "(cached) " >&6 else - st_cv_sa_restorer="$(echo SA_RESTORER | - $CPP $CPPFLAGS -P -imacros asm/signal.h - | - grep ^0x)" - test -n "$st_cv_sa_restorer" || st_cv_sa_restorer=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_sa_restorer" >&5 -$as_echo "$st_cv_sa_restorer" >&6; } -if test "x$st_cv_sa_restorer" != xno; then -cat >>confdefs.h <<_ACEOF -#define ASM_SA_RESTORER $st_cv_sa_restorer -_ACEOF + enable_valgrind_memcheck=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 -$as_echo_n "checking for __builtin_popcount... " >&6; } -if ${st_cv_have___builtin_popcount+:} false; then : - $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ -__builtin_popcount(0) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - st_cv_have___builtin_popcount=yes -else - st_cv_have___builtin_popcount=no + enable_valgrind_memcheck=yes + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have___builtin_popcount" >&5 -$as_echo "$st_cv_have___builtin_popcount" >&6; } -if test "x$st_cv_have___builtin_popcount" = xyes; then + if test "$enable_valgrind_memcheck" = "yes"; then : + + valgrind_enabled_tools="$valgrind_enabled_tools memcheck" + +fi + ENABLE_VALGRIND_memcheck=$enable_valgrind_memcheck -$as_echo "#define HAVE___BUILTIN_POPCOUNT 1" >>confdefs.h + # Check whether --enable-valgrind-helgrind was given. +if test "${enable_valgrind_helgrind+set}" = set; then : + enableval=$enable_valgrind_helgrind; enable_valgrind_helgrind=$enableval +else + enable_valgrind_helgrind= fi -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PERL+:} false; then : + if test "$enable_valgrind" = "no"; then : + + enable_valgrind_helgrind=no +elif test "$enable_valgrind_helgrind" != "no"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool helgrind" >&5 +$as_echo_n "checking for Valgrind tool helgrind... " >&6; } +if ${ax_cv_valgrind_tool_helgrind+:} false; then : $as_echo_n "(cached) " >&6 else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac + ax_cv_valgrind_tool_helgrind=no + + if `$VALGRIND --tool=helgrind --help >/dev/null 2>&1`; then : + + ax_cv_valgrind_tool_helgrind=yes + fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_helgrind" >&5 +$as_echo "$ax_cv_valgrind_tool_helgrind" >&6; } + if test "$ax_cv_valgrind_tool_helgrind" = "no"; then : + if test "$enable_valgrind_helgrind" = "yes"; then : + as_fn_error $? "Valgrind does not support helgrind; reconfigure with --disable-valgrind-helgrind" "$LINENO" 5 -libunwind_CPPFLAGS= -libunwind_LDFLAGS= -libunwind_LIBS= +else + + enable_valgrind_helgrind=no + +fi -# Check whether --with-libunwind was given. -if test "${with_libunwind+set}" = set; then : - withval=$with_libunwind; case "${withval}" in - yes|no|check) ;; - *) with_libunwind=yes - libunwind_CPPFLAGS="-I${withval}/include" - libunwind_LDFLAGS="-L${withval}/lib" ;; - esac else - with_libunwind=check + + enable_valgrind_helgrind=yes fi +fi + if test "$enable_valgrind_helgrind" = "yes"; then : -use_libunwind=no -if test "x$with_libunwind" != xno; then : - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS" + valgrind_enabled_tools="$valgrind_enabled_tools helgrind" - for ac_header in libunwind-ptrace.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libunwind-ptrace.h" "ac_cv_header_libunwind_ptrace_h" "$ac_includes_default" -if test "x$ac_cv_header_libunwind_ptrace_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUNWIND_PTRACE_H 1 -_ACEOF - saved_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $libunwind_LDFLAGS" +fi + ENABLE_VALGRIND_helgrind=$enable_valgrind_helgrind - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lunwind" >&5 -$as_echo_n "checking for backtrace in -lunwind... " >&6; } -if ${ac_cv_lib_unwind_backtrace+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lunwind $libunwind_LIBS - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char backtrace (); -int -main () -{ -return backtrace (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_unwind_backtrace=yes + # Check whether --enable-valgrind-drd was given. +if test "${enable_valgrind_drd+set}" = set; then : + enableval=$enable_valgrind_drd; enable_valgrind_drd=$enableval else - ac_cv_lib_unwind_backtrace=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + enable_valgrind_drd= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_backtrace" >&5 -$as_echo "$ac_cv_lib_unwind_backtrace" >&6; } -if test "x$ac_cv_lib_unwind_backtrace" = xyes; then : - libunwind_LIBS="-lunwind $libunwind_LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_create_addr_space in libunwind-generic" >&5 -$as_echo_n "checking for unw_create_addr_space in libunwind-generic... " >&6; } - saved_LIBS="$LIBS" - LIBS="-lunwind-generic $libunwind_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -return !unw_create_addr_space(0, 0) - ; - return 0; -} + if test "$enable_valgrind" = "no"; then : -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - libunwind_LIBS="-lunwind-generic $libunwind_LIBS" + enable_valgrind_drd=no +elif test "$enable_valgrind_drd" != "no"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _UPT_create in -lunwind-ptrace" >&5 -$as_echo_n "checking for _UPT_create in -lunwind-ptrace... " >&6; } -if ${ac_cv_lib_unwind_ptrace__UPT_create+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool drd" >&5 +$as_echo_n "checking for Valgrind tool drd... " >&6; } +if ${ax_cv_valgrind_tool_drd+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lunwind-ptrace $libunwind_LIBS - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char _UPT_create (); -int -main () -{ -return _UPT_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_unwind_ptrace__UPT_create=yes -else - ac_cv_lib_unwind_ptrace__UPT_create=no + ax_cv_valgrind_tool_drd=no + + if `$VALGRIND --tool=drd --help >/dev/null 2>&1`; then : + + ax_cv_valgrind_tool_drd=yes + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_ptrace__UPT_create" >&5 -$as_echo "$ac_cv_lib_unwind_ptrace__UPT_create" >&6; } -if test "x$ac_cv_lib_unwind_ptrace__UPT_create" = xyes; then : - libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS" - use_libunwind=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_drd" >&5 +$as_echo "$ax_cv_valgrind_tool_drd" >&6; } + if test "$ax_cv_valgrind_tool_drd" = "no"; then : + + if test "$enable_valgrind_drd" = "yes"; then : + + as_fn_error $? "Valgrind does not support drd; reconfigure with --disable-valgrind-drd" "$LINENO" 5 else - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find _UPT_create in libunwind-ptrace -See \`config.log' for more details" "$LINENO" 5; } - fi -fi + enable_valgrind_drd=no +fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find unw_create_addr_space in libunwind-generic -See \`config.log' for more details" "$LINENO" 5; } - fi + enable_valgrind_drd=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$saved_LIBS" +fi + if test "$enable_valgrind_drd" = "yes"; then : -else - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find libunwind -See \`config.log' for more details" "$LINENO" 5; } - fi + valgrind_enabled_tools="$valgrind_enabled_tools drd" fi + ENABLE_VALGRIND_drd=$enable_valgrind_drd - LDFLAGS="$saved_LDFLAGS" - + # Check whether --enable-valgrind-sgcheck was given. +if test "${enable_valgrind_sgcheck+set}" = set; then : + enableval=$enable_valgrind_sgcheck; enable_valgrind_sgcheck=$enableval else - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find libunwind-ptrace.h -See \`config.log' for more details" "$LINENO" 5; } - fi + enable_valgrind_sgcheck= +fi + if test "$enable_valgrind" = "no"; then : -fi + enable_valgrind_sgcheck=no +elif test "$enable_valgrind_sgcheck" = "yes"; then : -done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool sgcheck" >&5 +$as_echo_n "checking for Valgrind tool sgcheck... " >&6; } +if ${ax_cv_valgrind_tool_sgcheck+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_valgrind_tool_sgcheck=no - CPPFLAGS="$saved_CPPFLAGS" + if `$VALGRIND --tool=exp-sgcheck --help >/dev/null 2>&1`; then : + ax_cv_valgrind_tool_sgcheck=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable stack tracing support using libunwind" >&5 -$as_echo_n "checking whether to enable stack tracing support using libunwind... " >&6; } -if test "x$use_libunwind" = xyes; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_sgcheck" >&5 +$as_echo "$ax_cv_valgrind_tool_sgcheck" >&6; } + if test "$ax_cv_valgrind_tool_sgcheck" = "no"; then : -$as_echo "#define USE_LIBUNWIND 1" >>confdefs.h + if test "$enable_valgrind_sgcheck" = "yes"; then : + as_fn_error $? "Valgrind does not support sgcheck; reconfigure with --disable-valgrind-sgcheck" "$LINENO" 5 +else + enable_valgrind_sgcheck=no fi - if test "x$use_libunwind" = xyes; then - USE_LIBUNWIND_TRUE= - USE_LIBUNWIND_FALSE='#' + else - USE_LIBUNWIND_TRUE='#' - USE_LIBUNWIND_FALSE= + + enable_valgrind_sgcheck=yes + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libunwind" >&5 -$as_echo "$use_libunwind" >&6; } +fi + if test "$enable_valgrind_sgcheck" = "yes"; then : + + valgrind_enabled_tools="$valgrind_enabled_tools sgcheck" + +fi + ENABLE_VALGRIND_sgcheck=$enable_valgrind_sgcheck + + + valgrind_tools="memcheck helgrind drd sgcheck" + + valgrind_enabled_tools=$valgrind_enabled_tools + + +VALGRIND_CHECK_RULES=' +# Valgrind check +# +# Optional: +# - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions +# files to load. (Default: empty) +# - VALGRIND_FLAGS: General flags to pass to all Valgrind tools. +# (Default: --num-callers=30) +# - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of: +# memcheck, helgrind, drd, sgcheck). (Default: various) + +# Optional variables +VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES)) +VALGRIND_FLAGS ?= --num-callers=30 +VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no +VALGRIND_helgrind_FLAGS ?= --history-level=approx +VALGRIND_drd_FLAGS ?= +VALGRIND_sgcheck_FLAGS ?= + +# Internal use +valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools))) + +valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS) +valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS) +valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS) +valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS) + +valgrind_quiet = $(valgrind_quiet_$(V)) +valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY)) +valgrind_quiet_0 = --quiet +valgrind_v_use = $(valgrind_v_use_$(V)) +valgrind_v_use_ = $(valgrind_v_use_$(AM_DEFAULT_VERBOSITY)) +valgrind_v_use_0 = @echo " USE " $(patsubst check-valgrind-%,%,$''@):; + +# Support running with and without libtool. +ifneq ($(LIBTOOL),) +valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute +else +valgrind_lt = +endif + +# Use recursive makes in order to ignore errors during check +check-valgrind: +ifeq ($(VALGRIND_ENABLED),yes) + -$(A''M_V_at)$(foreach tool,$(valgrind_enabled_tools), \ + $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-$(tool); \ + ) +else + @echo "Need to reconfigure with --enable-valgrind" +endif + +# Valgrind running +VALGRIND_TESTS_ENVIRONMENT = \ + $(TESTS_ENVIRONMENT) \ + env VALGRIND=$(VALGRIND) \ + G_SLICE=always-malloc,debug-blocks \ + G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly + +VALGRIND_LOG_COMPILER = \ + $(valgrind_lt) \ + $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) + +define valgrind_tool_rule = +check-valgrind-$(1): $$(BUILT_SOURCES) +ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes) + $$(valgrind_v_use)$$(MAKE) $$(AM_MAKEFLAGS) check-am \ + TESTS_ENVIRONMENT="$$(VALGRIND_TESTS_ENVIRONMENT)" \ + LOG_COMPILER="$$(VALGRIND_LOG_COMPILER)" \ + LOG_FLAGS="$$(valgrind_$(1)_flags)" \ + TEST_SUITE_LOG=test-suite-$(1).log +else ifeq ($$(VALGRIND_ENABLED),yes) + @echo "Need to reconfigure with --enable-valgrind-$(1)" +else + @echo "Need to reconfigure with --enable-valgrind" +endif +endef + +$(foreach tool,$(valgrind_tools),$(eval $(call valgrind_tool_rule,$(tool)))) + +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind + +MOSTLYCLEANFILES ?= +MOSTLYCLEANFILES += $(valgrind_log_files) + +.PHONY: check-valgrind $(add-prefix check-valgrind-,$(valgrind_tools)) +' + + + -ac_config_files="$ac_config_files Makefile tests/Makefile" + +ac_config_files="$ac_config_files Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile strace.spec debian/changelog" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -11140,16 +13704,12 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${I386_TRUE}" && test -z "${I386_FALSE}"; then - as_fn_error $? "conditional \"I386\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${X86_64_TRUE}" && test -z "${X86_64_FALSE}"; then - as_fn_error $? "conditional \"X86_64\" was never defined. +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${X32_TRUE}" && test -z "${X32_FALSE}"; then - as_fn_error $? "conditional \"X32\" was never defined. +if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then + as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -11157,6 +13717,26 @@ if test -z "${USE_LIBUNWIND_TRUE}" && test -z "${USE_LIBUNWIND_FALSE}"; then as_fn_error $? "conditional \"USE_LIBUNWIND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_M32_RUNTIME_TRUE}" && test -z "${HAVE_M32_RUNTIME_FALSE}"; then + as_fn_error $? "conditional \"HAVE_M32_RUNTIME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_M32_MPERS_TRUE}" && test -z "${HAVE_M32_MPERS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_M32_MPERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_MX32_RUNTIME_TRUE}" && test -z "${HAVE_MX32_RUNTIME_FALSE}"; then + as_fn_error $? "conditional \"HAVE_MX32_RUNTIME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_MX32_MPERS_TRUE}" && test -z "${HAVE_MX32_MPERS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_MX32_MPERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${VALGRIND_ENABLED_TRUE}" && test -z "${VALGRIND_ENABLED_FALSE}"; then + as_fn_error $? "conditional \"VALGRIND_ENABLED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -11554,7 +14134,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by strace $as_me 4.9, which was +This file was extended by strace $as_me 4.16, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11614,13 +14194,14 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to . +strace home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -strace config.status 4.9 +strace config.status 4.16 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -11753,6 +14334,10 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests-m32/Makefile") CONFIG_FILES="$CONFIG_FILES tests-m32/Makefile" ;; + "tests-mx32/Makefile") CONFIG_FILES="$CONFIG_FILES tests-mx32/Makefile" ;; + "strace.spec") CONFIG_FILES="$CONFIG_FILES strace.spec" ;; + "debian/changelog") CONFIG_FILES="$CONFIG_FILES debian/changelog" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index 054f85be..7004bd3f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,19 +1,67 @@ -dnl Process this file with autoconf to create configure. Use autoreconf. +# Configure template for strace. +# +# Copyright (c) 1999-2001 Wichert Akkerman +# Copyright (c) 2002-2009 Roland McGrath +# Copyright (c) 2006-2016 Dmitry V. Levin +# Copyright (c) 2008-2015 Mike Frysinger +# Copyright (c) 2015 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + AC_PREREQ(2.57) AC_INIT([strace], m4_esyscmd([./git-version-gen .tarball-version]), - [strace-devel@lists.sourceforge.net]) + [strace-devel@lists.sourceforge.net], + [strace], + [https://strace.io]) +AC_COPYRIGHT([Copyright (C) 1999-2017 The strace developers.]) AC_CONFIG_SRCDIR([strace.c]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip silent-rules parallel-tests]) +AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests]) +AM_EXTRA_RECURSIVE_TARGETS([check-valgrind]) AM_MAINTAINER_MODE AC_CANONICAL_HOST +RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')" +AC_SUBST(RPM_CHANGELOGTIME) +DEB_CHANGELOGTIME="$(LC_TIME=C date -R)" +AC_SUBST(DEB_CHANGELOGTIME) + AC_PROG_CC +AC_PROG_CPP +st_WARN_CFLAGS +AX_PROG_CC_FOR_BUILD +AC_PROG_INSTALL +AC_PROG_RANLIB + AC_USE_SYSTEM_EXTENSIONS +AX_CODE_COVERAGE AC_MSG_CHECKING([for supported architecture]) +arch_m32= +arch_mx32= case "$host_cpu" in bfin) arch=bfin @@ -33,6 +81,7 @@ m68k) ;; sparc64*) arch=sparc64 + arch_m32=sparc AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.]) ;; sparc*) @@ -52,13 +101,13 @@ alpha*) AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.]) ;; powerpc*) - arch=powerpc AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.]) AC_TRY_COMPILE( [#ifndef __LP64__ # error 32 bit -#endif], [], ppc_bits=64, ppc_bits=32) - if test "$ppc_bits" = "64"; then +#endif], [], arch=powerpc64, arch=powerpc) + if test "$arch" = "powerpc64"; then + arch_m32=powerpc AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.]) fi ;; @@ -68,6 +117,7 @@ arm*) ;; aarch64*) arch=aarch64 + arch_m32=arm AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.]) ;; avr32*) @@ -99,11 +149,13 @@ sh*) AC_DEFINE([SH], 1, [Define for the SH architecture.]) ;; x86?64*) + arch_m32=i386 AC_TRY_COMPILE( [#ifndef __ILP32__ # error not x32 #endif], [], arch=x32, arch=x86_64) if test "$arch" = "x86_64"; then + arch_mx32=x32 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.]) else AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.]) @@ -125,6 +177,11 @@ microblaze*) arch=microblaze AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.]) ;; +nios2*) + arch=nios2 + AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.]) + ;; + or1k*) arch=or1k AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.]) @@ -135,6 +192,11 @@ xtensa*) AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture]) ;; +riscv*) + arch=riscv + AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture]) + ;; + *) AC_MSG_RESULT([NO!]) AC_MSG_ERROR([architecture $host_cpu is not supported by strace]) @@ -142,13 +204,42 @@ xtensa*) esac AC_MSG_RESULT($arch) +test -n "$arch_m32" || + arch_m32=$arch +test -n "$arch_mx32" || + arch_mx32=$arch AC_SUBST(arch) - -AM_CONDITIONAL([I386], [test x$arch = xi386]) -AM_CONDITIONAL([X86_64], [test x$arch = xx86_64]) -AM_CONDITIONAL([X32], [test x$arch = xx32]) - -AC_INCLUDEDIR +AC_SUBST(arch_m32) +AC_SUBST(arch_mx32) + +MIPS_ABI= +if test "$arch" = mips; then + AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM], + [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], , + [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])]) + + # requires GCC >= 3.4 + AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIO32 ? 1 : - 1];]])], + [st_cv_mips_abi=o32], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIN32 ? 1 : - 1];]])], + [st_cv_mips_abi=n32], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABI64 ? 1 : - 1];]])], + [st_cv_mips_abi=n64], + [st_cv_mips_abi=unknown])])])]) + + case "$st_cv_mips_abi" in + o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _ABIO32.]);; + n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _ABIN32.]);; + n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _ABI64.]);; + *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);; + esac + MIPS_ABI="$st_cv_mips_abi" +fi +AC_SUBST(MIPS_ABI) AC_ARG_ENABLE([arm-oabi], [AS_HELP_STRING([--enable-arm-oabi], @@ -162,136 +253,242 @@ esac AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi], [Define to 1 if you want OABI support on ARM EABI.]) -gl_WARN_ADD([-Wall]) -gl_WARN_ADD([-Wwrite-strings]) -AC_ARG_ENABLE([gcc-Werror], - [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])], - [case $enableval in - yes) gl_WARN_ADD([-Werror]) ;; - no) ;; - *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;; - esac] -) -AC_SUBST([WARN_CFLAGS]) - -AC_PROG_CPP -AC_PROG_INSTALL -AC_C_CONST AC_C_BIGENDIAN -AC_HEADER_STDC -AC_HEADER_STDBOOL -AC_HEADER_DIRENT -AC_HEADER_STAT -AC_CHECK_MEMBERS(m4_normalize([ - struct stat.st_aclcnt, - struct stat.st_blksize, - struct stat.st_blocks, - struct stat.st_flags, - struct stat.st_fstype, - struct stat.st_gen, - struct stat.st_level, - struct stat.st_rdev -])) -AC_STAT64 -AC_STATFS64 +AC_C_TYPEOF -AC_TYPE_SIGNAL AC_TYPE_UID_T -AC_TYPE_MODE_T -AC_TYPE_GETGROUPS -AC_HEADER_MAJOR -AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include ]) -AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, -[#include -#include -#include ]) -AC_LITTLE_ENDIAN_LONG_LONG AC_CHECK_FUNCS(m4_normalize([ + accept4 + fallocate + fanotify_mark fopen64 fork fputs_unlocked + fstatat + ftruncate + futimens if_indextoname - inet_ntop + open64 prctl preadv process_vm_readv pwritev - sendmsg - sigaction + readahead + signalfd stpcpy strerror strsignal + sync_file_range + utimensat ])) + +AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include ]) + +AC_CHECK_TYPES([struct mmsghdr],,, [#include ]) + +AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,, +[#include ]) + +AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,, +[#include +#include ]) + +AC_CHECK_TYPES([struct user_desc],,, [#include ]) + +AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,, +[#include +#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct pt_all_user_regs, + struct ia64_fpreg, + struct ptrace_peeksiginfo_args +]),,, [#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct flock, + struct flock64, + struct __kernel_flock, + struct __kernel_flock64 +]),,, +[#include +#include ]) + +AC_CHECK_MEMBERS([struct timex.tai],,, [#include ]) + +AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include ]) + +AC_CHECK_MEMBERS(m4_normalize([ + siginfo_t.si_syscall, + siginfo_t.si_timerid, + siginfo_t.si_overrun +]),,, [#include ]) + +AC_CHECK_MEMBERS(m4_normalize([ + struct perf_event_attr.precise_ip, + struct perf_event_attr.mmap_data, + struct perf_event_attr.sample_id_all, + struct perf_event_attr.exclude_host, + struct perf_event_attr.exclude_guest, + struct perf_event_attr.exclude_callchain_kernel, + struct perf_event_attr.exclude_callchain_user, + struct perf_event_attr.mmap2, + struct perf_event_attr.comm_exec, + struct perf_event_attr.use_clockid, + struct perf_event_attr.context_switch, + struct perf_event_attr.write_backward, + struct perf_event_attr.bp_type, + struct perf_event_attr.config1, + struct perf_event_attr.config2, + struct perf_event_attr.branch_sample_type, + struct perf_event_attr.sample_regs_user, + struct perf_event_attr.sample_stack_user, + struct perf_event_attr.sample_regs_intr, + struct perf_event_attr.aux_watermark, + struct perf_event_attr.sample_max_stack +]),,, [#include ]) + AC_CHECK_HEADERS(m4_normalize([ asm/cachectl.h asm/sysmips.h + bluetooth/bluetooth.h elf.h inttypes.h - ioctls.h - linux/capability.h + linux/bsg.h + linux/dm-ioctl.h + linux/dqblk_xfs.h + linux/falloc.h + linux/fiemap.h + linux/filter.h + linux/hiddev.h + linux/ip_vs.h + linux/ipc.h + linux/mmtimer.h + linux/msg.h linux/perf_event.h - linux/ptrace.h + linux/quota.h + linux/seccomp.h + linux/securebits.h + linux/sem.h + linux/shm.h + linux/userfaultfd.h linux/utsname.h mqueue.h netinet/sctp.h - poll.h + netipx/ipx.h scsi/sg.h stropts.h - sys/acl.h - sys/asynch.h sys/conf.h - sys/epoll.h - sys/filio.h - sys/ioctl.h - sys/poll.h - sys/ptrace.h + sys/eventfd.h + sys/fanotify.h + sys/ipc.h + sys/msg.h + sys/quota.h sys/reg.h - sys/uio.h - sys/vfs.h + sys/sem.h + sys/shm.h + sys/signalfd.h + sys/xattr.h + ustat.h ])) -AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h], - [], [], [#include -#include -#include ]) -AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include ]) -AC_CHECK_TYPES([struct sigcontext],,, [#include ]) -AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include ]) - -AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include ]) - -AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include ]) -AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg, struct ptrace_peeksiginfo_args],,, - [#include ]) +AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include ]) -AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include ]) +AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include ]) -AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad, - struct sigevent.__pad, - siginfo_t.si_syscall],,, [#include ]) +AC_CHECK_HEADERS([linux/mqueue.h],,, [#include ]) -AC_CHECK_TYPES([struct flock64],,, [#include ]) +AC_CHECK_HEADERS(m4_normalize([ + linux/netfilter_arp/arp_tables.h + linux/netfilter_bridge/ebtables.h + linux/netfilter_ipv4/ip_tables.h + linux/netfilter_ipv6/ip6_tables.h +]),,, [#include +#include ]) + +AC_CHECK_HEADERS([linux/input.h], [ + AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include ]) +]) + +AC_CHECK_HEADERS([linux/bpf.h], [ + AC_CACHE_CHECK([whether union bpf_attr.log_buf initialization works], + [st_cv_have_union_bpf_attr_log_buf], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[union bpf_attr a = { .log_buf = 0 };]])], + [st_cv_have_union_bpf_attr_log_buf=yes], + [st_cv_have_union_bpf_attr_log_buf=no])]) + if test $st_cv_have_union_bpf_attr_log_buf = yes; then + AC_DEFINE(HAVE_UNION_BPF_ATTR_LOG_BUF, [1], + [Define to 1 if union bpf_attr.log_buf initialization works]) + fi + AC_CACHE_CHECK([whether union bpf_attr.bpf_fd initialization works], + [st_cv_have_union_bpf_attr_bpf_fd], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[union bpf_attr a = { .bpf_fd = 0 };]])], + [st_cv_have_union_bpf_attr_bpf_fd=yes], + [st_cv_have_union_bpf_attr_bpf_fd=no])]) + if test $st_cv_have_union_bpf_attr_bpf_fd = yes; then + AC_DEFINE(HAVE_UNION_BPF_ATTR_BPF_FD, [1], + [Define to 1 if union bpf_attr.bpf_fd initialization works]) + fi + AC_CACHE_CHECK([whether union bpf_attr.attach_type initialization works], + [st_cv_have_union_bpf_attr_attach_type], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[union bpf_attr a = { .attach_type = 0 };]])], + [st_cv_have_union_bpf_attr_attach_type=yes], + [st_cv_have_union_bpf_attr_attach_type=no])]) + if test $st_cv_have_union_bpf_attr_attach_type = yes; then + AC_DEFINE(HAVE_UNION_BPF_ATTR_ATTACH_TYPE, [1], + [Define to 1 if union bpf_attr.attach_type initialization works]) + fi +]) + +AC_CHECK_TYPES([struct statfs], [ + AC_CHECK_MEMBERS([struct statfs.f_frsize],,, [#include +#include ]) + AC_CHECK_MEMBERS([struct statfs.f_flags],,, [#include +#include ]) + AC_CHECK_MEMBERS([struct statfs.f_fsid.val],,, [#include +#include ]) + AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,, [#include +#include ]) +],, [#include +#include ]) + +AC_CHECK_TYPES([struct statfs64], [ + AC_CHECK_MEMBERS([struct statfs64.f_frsize],,, [#include +#include ]) + AC_CHECK_MEMBERS([struct statfs64.f_flags],,, [#include +#include ]) + AC_CHECK_MEMBERS([struct statfs64.f_fsid.val],,, [#include +#include ]) + AC_CHECK_MEMBERS([struct statfs64.f_fsid.__val],,, [#include +#include ]) +],, [#include +#include ]) + +AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include ]) + +AC_CHECK_HEADERS([linux/btrfs.h], [ + AC_CHECK_MEMBERS(m4_normalize([ + struct btrfs_ioctl_feature_flags.compat_flags, + struct btrfs_ioctl_fs_info_args.nodesize, + struct btrfs_ioctl_defrag_range_args.start, + struct btrfs_ioctl_search_args_v2.buf_size + ]),,, [ #include +#include ]) + AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB, + BTRFS_COMPRESS_LZO]),,,[ #include +#include ])]) AC_CHECK_DECLS([sys_errlist]) AC_CHECK_DECLS(m4_normalize([ - PTRACE_EVENT_CLONE, - PTRACE_EVENT_EXEC, - PTRACE_EVENT_EXIT, - PTRACE_EVENT_FORK, - PTRACE_EVENT_VFORK, - PTRACE_EVENT_VFORK_DONE, - PTRACE_GETEVENTMSG, - PTRACE_GETSIGINFO, - PTRACE_O_TRACECLONE, - PTRACE_O_TRACEEXEC, - PTRACE_O_TRACEEXIT, - PTRACE_O_TRACEFORK, - PTRACE_O_TRACESYSGOOD, - PTRACE_O_TRACEVFORK, PTRACE_PEEKUSER, - PTRACE_POKEUSER, - PTRACE_SETOPTIONS + PTRACE_POKEUSER ]),,, [#include ]) AC_CHECK_DECLS(m4_normalize([ @@ -308,75 +505,19 @@ AC_CHECK_DECLS(m4_normalize([ AC_CHECK_DECLS(m4_normalize([ LO_FLAGS_READ_ONLY, + LO_FLAGS_USE_AOPS, LO_FLAGS_AUTOCLEAR, - LO_FLAGS_PARTSCAN + LO_FLAGS_PARTSCAN, + LO_FLAGS_DIRECT_IO ]),,, [#include ]) AC_CHECK_DECLS(m4_normalize([ - CTL_KERN, - CTL_VM, - CTL_NET, CTL_PROC, - CTL_FS, - CTL_DEBUG, - CTL_DEV, - CTL_BUS, - CTL_ABI, - CTL_CPU, CTL_ARLAN, CTL_S390DBF, CTL_SUNRPC, CTL_PM, CTL_FRV, - KERN_OSTYPE, - KERN_OSRELEASE, - KERN_OSREV, - KERN_VERSION, - KERN_SECUREMASK, - KERN_PROF, - KERN_NODENAME, - KERN_DOMAINNAME, - KERN_PANIC, - KERN_REALROOTDEV, - KERN_SPARC_REBOOT, - KERN_CTLALTDEL, - KERN_PRINTK, - KERN_NAMETRANS, - KERN_PPC_HTABRECLAIM, - KERN_PPC_ZEROPAGED, - KERN_PPC_POWERSAVE_NAP, - KERN_MODPROBE, - KERN_SG_BIG_BUFF, - KERN_ACCT, - KERN_PPC_L2CR, - KERN_RTSIGNR, - KERN_RTSIGMAX, - KERN_SHMMAX, - KERN_MSGMAX, - KERN_MSGMNB, - KERN_MSGPOOL, - KERN_SYSRQ, - KERN_MAX_THREADS, - KERN_RANDOM, - KERN_SHMALL, - KERN_MSGMNI, - KERN_SEM, - KERN_SPARC_STOP_A, - KERN_SHMMNI, - KERN_OVERFLOWUID, - KERN_OVERFLOWGID, - KERN_SHMPATH, - KERN_HOTPLUG, - KERN_IEEE_EMULATION_WARNINGS, - KERN_S390_USER_DEBUG_LOGGING, - KERN_CORE_USES_PID, - KERN_TAINTED, - KERN_CADPID, - KERN_PIDMAX, - KERN_CORE_PATTERN, - KERN_PANIC_ON_OOPS, - KERN_HPPA_PWRSW, - KERN_HPPA_UNALIGNED, KERN_PRINTK_RATELIMIT, KERN_PRINTK_RATELIMIT_BURST, KERN_PTY, @@ -394,118 +535,15 @@ AC_CHECK_DECLS(m4_normalize([ KERN_MAX_LOCK_DEPTH, KERN_NMI_WATCHDOG, KERN_PANIC_ON_NMI, - NET_CORE, - NET_ETHER, - NET_802, - NET_UNIX, - NET_IPV4, - NET_IPX, - NET_ATALK, - NET_NETROM, - NET_AX25, - NET_BRIDGE, - NET_ROSE, - NET_IPV6, - NET_X25, - NET_TR, - NET_DECNET, - NET_ECONET, - NET_SCTP, NET_LLC, NET_NETFILTER, NET_DCCP, NET_IRDA, - NET_CORE_WMEM_MAX, - NET_CORE_RMEM_MAX, - NET_CORE_WMEM_DEFAULT, - NET_CORE_RMEM_DEFAULT, NET_CORE_DESTROY_DELAY, - NET_CORE_MAX_BACKLOG, - NET_CORE_FASTROUTE, - NET_CORE_MSG_COST, - NET_CORE_MSG_BURST, - NET_CORE_OPTMEM_MAX, - NET_CORE_HOT_LIST_LENGTH, - NET_CORE_DIVERT_VERSION, - NET_CORE_NO_CONG_THRESH, - NET_CORE_NO_CONG, - NET_CORE_LO_CONG, - NET_CORE_MOD_CONG, - NET_CORE_DEV_WEIGHT, - NET_CORE_SOMAXCONN, NET_CORE_BUDGET, NET_CORE_AEVENT_ETIME, NET_CORE_AEVENT_RSEQTH, NET_CORE_WARNINGS, - NET_IPV4_FORWARD, - NET_IPV4_DYNADDR, - NET_IPV4_CONF, - NET_IPV4_NEIGH, - NET_IPV4_ROUTE, - NET_IPV4_FIB_HASH, - NET_IPV4_NETFILTER, - NET_IPV4_TCP_TIMESTAMPS, - NET_IPV4_TCP_WINDOW_SCALING, - NET_IPV4_TCP_SACK, - NET_IPV4_TCP_RETRANS_COLLAPSE, - NET_IPV4_DEFAULT_TTL, - NET_IPV4_AUTOCONFIG, - NET_IPV4_NO_PMTU_DISC, - NET_IPV4_TCP_SYN_RETRIES, - NET_IPV4_IPFRAG_HIGH_THRESH, - NET_IPV4_IPFRAG_LOW_THRESH, - NET_IPV4_IPFRAG_TIME, - NET_IPV4_TCP_MAX_KA_PROBES, - NET_IPV4_TCP_KEEPALIVE_TIME, - NET_IPV4_TCP_KEEPALIVE_PROBES, - NET_IPV4_TCP_RETRIES1, - NET_IPV4_TCP_RETRIES2, - NET_IPV4_TCP_FIN_TIMEOUT, - NET_IPV4_IP_MASQ_DEBUG, - NET_TCP_SYNCOOKIES, - NET_TCP_STDURG, - NET_TCP_RFC1337, - NET_TCP_SYN_TAILDROP, - NET_TCP_MAX_SYN_BACKLOG, - NET_IPV4_LOCAL_PORT_RANGE, - NET_IPV4_ICMP_ECHO_IGNORE_ALL, - NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, - NET_IPV4_ICMP_SOURCEQUENCH_RATE, - NET_IPV4_ICMP_DESTUNREACH_RATE, - NET_IPV4_ICMP_TIMEEXCEED_RATE, - NET_IPV4_ICMP_PARAMPROB_RATE, - NET_IPV4_ICMP_ECHOREPLY_RATE, - NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, - NET_IPV4_IGMP_MAX_MEMBERSHIPS, - NET_TCP_TW_RECYCLE, - NET_IPV4_ALWAYS_DEFRAG, - NET_IPV4_TCP_KEEPALIVE_INTVL, - NET_IPV4_INET_PEER_THRESHOLD, - NET_IPV4_INET_PEER_MINTTL, - NET_IPV4_INET_PEER_MAXTTL, - NET_IPV4_INET_PEER_GC_MINTIME, - NET_IPV4_INET_PEER_GC_MAXTIME, - NET_TCP_ORPHAN_RETRIES, - NET_TCP_ABORT_ON_OVERFLOW, - NET_TCP_SYNACK_RETRIES, - NET_TCP_MAX_ORPHANS, - NET_TCP_MAX_TW_BUCKETS, - NET_TCP_FACK, - NET_TCP_REORDERING, - NET_TCP_ECN, - NET_TCP_DSACK, - NET_TCP_MEM, - NET_TCP_WMEM, - NET_TCP_RMEM, - NET_TCP_APP_WIN, - NET_TCP_ADV_WIN_SCALE, - NET_IPV4_NONLOCAL_BIND, - NET_IPV4_ICMP_RATELIMIT, - NET_IPV4_ICMP_RATEMASK, - NET_TCP_TW_REUSE, - NET_TCP_FRTO, - NET_TCP_LOW_LATENCY, - NET_IPV4_IPFRAG_SECRET_INTERVAL, NET_IPV4_IGMP_MAX_MSF, NET_TCP_NO_METRICS_SAVE, NET_TCP_DEFAULT_WIN_SCALE, @@ -529,83 +567,15 @@ AC_CHECK_DECLS(m4_normalize([ NET_TCP_ALLOWED_CONG_CONTROL, NET_TCP_MAX_SSTHRESH, NET_TCP_FRTO_RESPONSE, - NET_IPV4_ROUTE_FLUSH, - NET_IPV4_ROUTE_MIN_DELAY, - NET_IPV4_ROUTE_MAX_DELAY, - NET_IPV4_ROUTE_GC_THRESH, - NET_IPV4_ROUTE_MAX_SIZE, - NET_IPV4_ROUTE_GC_MIN_INTERVAL, - NET_IPV4_ROUTE_GC_TIMEOUT, - NET_IPV4_ROUTE_GC_INTERVAL, - NET_IPV4_ROUTE_REDIRECT_LOAD, - NET_IPV4_ROUTE_REDIRECT_NUMBER, - NET_IPV4_ROUTE_REDIRECT_SILENCE, - NET_IPV4_ROUTE_ERROR_COST, - NET_IPV4_ROUTE_ERROR_BURST, - NET_IPV4_ROUTE_GC_ELASTICITY, - NET_IPV4_ROUTE_MTU_EXPIRES, - NET_IPV4_ROUTE_MIN_PMTU, - NET_IPV4_ROUTE_MIN_ADVMSS, - NET_IPV4_ROUTE_SECRET_INTERVAL, NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, - NET_IPV4_CONF_FORWARDING, - NET_IPV4_CONF_MC_FORWARDING, - NET_IPV4_CONF_PROXY_ARP, - NET_IPV4_CONF_ACCEPT_REDIRECTS, - NET_IPV4_CONF_SECURE_REDIRECTS, - NET_IPV4_CONF_SEND_REDIRECTS, - NET_IPV4_CONF_SHARED_MEDIA, - NET_IPV4_CONF_RP_FILTER, - NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, - NET_IPV4_CONF_BOOTP_RELAY, - NET_IPV4_CONF_LOG_MARTIANS, - NET_IPV4_CONF_TAG, - NET_IPV4_CONF_ARPFILTER, - NET_IPV4_CONF_MEDIUM_ID, - NET_IPV4_CONF_NOXFRM, - NET_IPV4_CONF_NOPOLICY, NET_IPV4_CONF_FORCE_IGMP_VERSION, NET_IPV4_CONF_ARP_ANNOUNCE, NET_IPV4_CONF_ARP_IGNORE, NET_IPV4_CONF_PROMOTE_SECONDARIES, NET_IPV4_CONF_ARP_ACCEPT, NET_IPV4_CONF_ARP_NOTIFY, - NET_IPV6_CONF, - NET_IPV6_NEIGH, - NET_IPV6_ROUTE, - NET_IPV6_ICMP, - NET_IPV6_BINDV6ONLY, - NET_IPV6_IP6FRAG_HIGH_THRESH, - NET_IPV6_IP6FRAG_LOW_THRESH, - NET_IPV6_IP6FRAG_TIME, - NET_IPV6_IP6FRAG_SECRET_INTERVAL, NET_IPV6_MLD_MAX_MSF, - NET_IPV6_ROUTE_FLUSH, - NET_IPV6_ROUTE_GC_THRESH, - NET_IPV6_ROUTE_MAX_SIZE, - NET_IPV6_ROUTE_GC_MIN_INTERVAL, - NET_IPV6_ROUTE_GC_TIMEOUT, - NET_IPV6_ROUTE_GC_INTERVAL, - NET_IPV6_ROUTE_GC_ELASTICITY, - NET_IPV6_ROUTE_MTU_EXPIRES, - NET_IPV6_ROUTE_MIN_ADVMSS, NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, - NET_UNIX_DESTROY_DELAY, - NET_UNIX_DELETE_DELAY, - NET_UNIX_MAX_DGRAM_QLEN, - VM_OVERCOMMIT_MEMORY, - VM_PAGE_CLUSTER, - VM_DIRTY_BACKGROUND, - VM_DIRTY_RATIO, - VM_DIRTY_WB_CS, - VM_DIRTY_EXPIRE_CS, - VM_NR_PDFLUSH_THREADS, - VM_OVERCOMMIT_RATIO, - VM_PAGEBUF, - VM_HUGETLB_PAGES, - VM_SWAPPINESS, - VM_LOWMEM_RESERVE_RATIO, - VM_MIN_FREE_KBYTES, VM_MAX_MAP_COUNT, VM_LAPTOP_MODE, VM_BLOCK_DUMP, @@ -617,6 +587,66 @@ AC_CHECK_DECLS(m4_normalize([ [#include #include ]) +AC_CHECK_DECLS(m4_normalize([ + V4L2_FIELD_ANY, + V4L2_FIELD_NONE, + V4L2_FIELD_TOP, + V4L2_FIELD_BOTTOM, + V4L2_FIELD_INTERLACED, + V4L2_FIELD_SEQ_TB, + V4L2_FIELD_SEQ_BT, + V4L2_FIELD_ALTERNATE, + V4L2_FIELD_INTERLACED_TB, + V4L2_FIELD_INTERLACED_BT, + V4L2_BUF_TYPE_VIDEO_CAPTURE, + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + V4L2_BUF_TYPE_VIDEO_OUTPUT, + V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + V4L2_BUF_TYPE_VIDEO_OVERLAY, + V4L2_BUF_TYPE_VBI_CAPTURE, + V4L2_BUF_TYPE_VBI_OUTPUT, + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE, + V4L2_BUF_TYPE_SLICED_VBI_OUTPUT, + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, + V4L2_TUNER_RADIO, + V4L2_TUNER_ANALOG_TV, + V4L2_TUNER_DIGITAL_TV, + V4L2_MEMORY_MMAP, + V4L2_MEMORY_USERPTR, + V4L2_MEMORY_OVERLAY, + V4L2_MEMORY_DMABUF, + V4L2_COLORSPACE_SMPTE170M, + V4L2_COLORSPACE_SMPTE240M, + V4L2_COLORSPACE_REC709, + V4L2_COLORSPACE_BT878, + V4L2_COLORSPACE_470_SYSTEM_M, + V4L2_COLORSPACE_470_SYSTEM_BG, + V4L2_COLORSPACE_JPEG, + V4L2_COLORSPACE_SRGB, + V4L2_PRIORITY_UNSET, + V4L2_PRIORITY_BACKGROUND, + V4L2_PRIORITY_INTERACTIVE, + V4L2_PRIORITY_RECORD, + V4L2_FRMSIZE_TYPE_DISCRETE, + V4L2_FRMSIZE_TYPE_CONTINUOUS, + V4L2_FRMSIZE_TYPE_STEPWISE, + V4L2_FRMIVAL_TYPE_DISCRETE, + V4L2_FRMIVAL_TYPE_CONTINUOUS, + V4L2_FRMIVAL_TYPE_STEPWISE, + V4L2_CTRL_TYPE_INTEGER, + V4L2_CTRL_TYPE_BOOLEAN, + V4L2_CTRL_TYPE_MENU, + V4L2_CTRL_TYPE_BUTTON, + V4L2_CTRL_TYPE_INTEGER64, + V4L2_CTRL_TYPE_CTRL_CLASS, + V4L2_CTRL_TYPE_STRING, + V4L2_CTRL_TYPE_BITMASK, + V4L2_CTRL_TYPE_INTEGER_MENU +]),,, [#include +#include +#include +#include ]) + AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include @@ -629,14 +659,25 @@ AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64], AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([long long]) AC_CHECK_SIZEOF([off_t],,[#include ]) +AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"]) +AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};]) -AC_CACHE_CHECK([for SA_RESTORER], [st_cv_sa_restorer], - [st_cv_sa_restorer="$(echo SA_RESTORER | +AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN], + [[st_cv_SIGRTMIN="$(echo SIGRTMIN | + $CPP $CPPFLAGS -P -imacros asm/signal.h - | + grep '^[0-9]')" + test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]]) +if test "x$st_cv_SIGRTMIN" != xno; then + AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN], + [SIGRTMIN defined in ]) +fi +AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER], + [st_cv_SA_RESTORER="$(echo SA_RESTORER | $CPP $CPPFLAGS -P -imacros asm/signal.h - | grep ^0x)" - test -n "$st_cv_sa_restorer" || st_cv_sa_restorer=no]) -if test "x$st_cv_sa_restorer" != xno; then - AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_sa_restorer], + test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no]) +if test "x$st_cv_SA_RESTORER" != xno; then + AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER], [SA_RESTORER defined in ]) fi @@ -649,6 +690,12 @@ if test "x$st_cv_have___builtin_popcount" = xyes; then [Define to 1 if the system provides __builtin_popcount function]) fi +AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=]) +if test "x$ac_cv_lib_dl_dladdr" = xyes; then + AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr]) +fi +AC_SUBST(dl_LIBS) + AC_PATH_PROG([PERL], [perl]) dnl stack trace with libunwind @@ -740,5 +787,25 @@ fi AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes]) AC_MSG_RESULT([$use_libunwind]) -AC_CONFIG_FILES([Makefile tests/Makefile]) +if test "$arch" = mips && test "$no_create" != yes; then + mkdir -p linux/mips + if $srcdir/linux/mips/genstub.sh linux/mips; then + AC_MSG_RESULT([Generated MIPS syscallent stubs]) + else + AC_MSG_FAILURE([Failed to generate syscallent stubs]) + fi +fi + +st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64]) +st_MPERS([mx32], [x86_64]) + +AX_VALGRIND_DFLT([sgcheck], [off]) +AX_VALGRIND_CHECK + +AC_CONFIG_FILES([Makefile + tests/Makefile + tests-m32/Makefile + tests-mx32/Makefile + strace.spec + debian/changelog]) AC_OUTPUT diff --git a/copy_file_range.c b/copy_file_range.c new file mode 100644 index 00000000..ad858a99 --- /dev/null +++ b/copy_file_range.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +SYS_FUNC(copy_file_range) +{ + /* int fd_in */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + /* loff_t *off_in */ + printnum_int64(tcp, tcp->u_arg[1], "%" PRId64); + tprints(", "); + /* int fd_out */ + printfd(tcp, tcp->u_arg[2]); + tprints(", "); + /* loff_t *off_out */ + printnum_int64(tcp, tcp->u_arg[3], "%" PRId64); + tprints(", "); + /* size_t len */ + tprintf("%" PRI_klu ", ", tcp->u_arg[4]); + /* unsigned int flags */ + tprintf("%u", (unsigned int) tcp->u_arg[5]); + + return RVAL_DECODED; +} diff --git a/count.c b/count.c index e41994d3..4b333bf3 100644 --- a/count.c +++ b/count.c @@ -53,20 +53,16 @@ count_syscall(struct tcb *tcp, const struct timeval *syscall_exiting_tv) struct timeval wtv; struct timeval *tv = &wtv; struct call_counts *cc; - unsigned long scno = tcp->scno; - if (!SCNO_IN_RANGE(scno)) + if (!scno_in_range(tcp->scno)) return; - if (!counts) { - counts = calloc(nsyscalls, sizeof(*counts)); - if (!counts) - die_out_of_memory(); - } - cc = &counts[scno]; + if (!counts) + counts = xcalloc(nsyscalls, sizeof(*counts)); + cc = &counts[tcp->scno]; cc->calls++; - if (tcp->u_error) + if (syserror(tcp)) cc->errors++; /* tv = wall clock time spent while in syscall */ @@ -115,8 +111,9 @@ time_cmp(void *a, void *b) static int syscall_cmp(void *a, void *b) { - return strcmp(sysent[*((int *) a)].sys_name, - sysent[*((int *) b)].sys_name); + const char *a_name = sysent[*((int *) a)].sys_name; + const char *b_name = sysent[*((int *) b)].sys_name; + return strcmp(a_name ? a_name : "", b_name ? b_name : ""); } static int @@ -143,7 +140,7 @@ set_sortby(const char *sortby) else if (strcmp(sortby, "nothing") == 0) sortfun = NULL; else { - error_msg_and_die("invalid sortby: '%s'", sortby); + error_msg_and_help("invalid sortby: '%s'", sortby); } } @@ -156,7 +153,7 @@ void set_overhead(int n) static void call_summary_pers(FILE *outf) { - int i; + unsigned int i; int call_cum, error_cum; struct timeval tv_cum, dtv; double float_tv_cum; @@ -171,9 +168,7 @@ call_summary_pers(FILE *outf) fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n", dashes, dashes, dashes, dashes, dashes, dashes); - sorted_count = calloc(sizeof(int), nsyscalls); - if (!sorted_count) - die_out_of_memory(); + sorted_count = xcalloc(sizeof(int), nsyscalls); call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0; if (overhead.tv_sec == -1) { tv_mul(&overhead, &shortest, 8); @@ -230,7 +225,7 @@ call_summary_pers(FILE *outf) void call_summary(FILE *outf) { - int i, old_pers = current_personality; + unsigned int i, old_pers = current_personality; for (i = 0; i < SUPPORTED_PERSONALITIES; ++i) { if (!countv[i]) diff --git a/debian/changelog b/debian/changelog index 52845b24..28bd52d2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,107 @@ -strace (4.9-1) experimental; urgency=low +strace (4.16-1) experimental; urgency=low + * strace 4.16 snapshot. + + -- Strace Tue, 14 Feb 2017 10:49:36 +0000 + +strace (4.15-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 14 Dec 2016 08:09:10 +0000 + +strace (4.14-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 04 Oct 2016 18:19:20 +0000 + +strace (4.13-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 26 Jul 2016 16:17:18 +0000 + +strace (4.12-3) unstable; urgency=medium + + * Fix up 32/64-bit test output in strace -S test to fix i386 build + * Run make check with VERBOSE=1 so we get useful information in build logs + + -- Steve McIntyre <93sam@debian.org> Sat, 04 Jun 2016 02:37:44 +0100 + +strace (4.12-2) unstable; urgency=medium + + * Remove libunwind dependency. Closes: #826223 + + -- Steve McIntyre <93sam@debian.org> Fri, 03 Jun 2016 13:43:44 +0100 + +strace (4.12-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + implemented simultaneous use of -p option and tracing of a command, + closes: #549942 + + fixed decoding of syscalls unknown to the kernel on s390/s390x, + closes: #485979 + + -- Dmitry V. Levin Tue, 31 May 2016 11:12:13 +0000 + +strace (4.11-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + fixed decoding of path argument of umount2 syscall, closes: #785050 + + [ Steve McIntyre ] + * Drop patches against old upstream - all upstream now. + * Add simple upstream patch to fix printing of 32-bit times syscall + return value on 64-bit architectures. + + -- Steve McIntyre <93sam@debian.org> Fri, 08 Jan 2015 00:52:05 +0000 + +strace (4.10-3) unstable; urgency=medium + + * Really fix mips* builds - fix sys_syscall() handling. + Closes: #781753 + * Clean up strace64.substvars at clean time + * Remove ancient changelog entries that annoy lintian + * Update Standards-Version to 3.9.6 (no changes needed) + + -- Steve McIntyre <93sam@debian.org> Wed, 08 Jul 2015 23:44:03 +0100 + +strace (4.10-2) unstable; urgency=medium + + * Fix building on arm64 using patches from upstream. Closes: #790770 + * Fix various test suite failures using patches from upstream. + Closes: #781040 + * Fix mips o32 build. Thanks to Arturo Borrero Gonzalez + for tracking this. + * Add build-dependency on gawk for the test suite. Closes: #780992 + + -- Steve McIntyre <93sam@debian.org> Thu, 02 Jul 2015 02:03:25 +0100 + +strace (4.10-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + enhanced ioctl decoding, closes: #692913 + + enabled mips64el build, closes: #773375 + + updated signal and errno numbers, closes: #768642 + + updated generic and added arch-specific PTRACE_* constants, + closes: #734554 + + -- Steve McIntyre <93sam@debian.org> Sat, 21 Mar 2015 22:18:25 +0000 + +strace (4.9-2) unstable; urgency=medium + + * Turn on support for ppc64el, code is already in upstream. + Closes: #744121. + + -- Steve McIntyre <93sam@debian.org> Wed, 20 Aug 2014 18:00:20 +0100 + +strace (4.9-1) unstable; urgency=medium + + [ Dmitry V. Levin ] * New upstream version. + added -w option to produce stats on syscall latency, closes: #457497 + applied miscellaneous corrections to the manpage, closes: #725987 @@ -7,7 +109,10 @@ strace (4.9-1) experimental; urgency=low + enabled or1k build, closes: #742235 + enabled maximum security hardening, thanks to Markus - -- Dmitry V. Levin Fri, 15 Aug 2014 13:14:15 +0000 + [ Steve McIntyre ] + * New maintainer. Thanks to Frederik for all his prior work! + + -- Steve McIntyre <93sam@debian.org> Wed, 20 Aug 2014 15:11:36 +0100 strace (4.8-1.1) unstable; urgency=low @@ -745,7 +850,7 @@ strace (3.1-11) unstable; urgency=low * Ported to libc6 / glibc2 (Bug# 11729) * Compress manpage - -- Wichert Akkerman Fri, 1 Aug 1997 00:13:38 +02 + -- Wichert Akkerman Fri, 1 Aug 1997 00:13:38 +0200 strace (3.1-10) unstable; urgency=low diff --git a/debian/changelog.in b/debian/changelog.in new file mode 100644 index 00000000..288cef98 --- /dev/null +++ b/debian/changelog.in @@ -0,0 +1,931 @@ +strace (@PACKAGE_VERSION@-1) experimental; urgency=low + + * @PACKAGE_STRING@ snapshot. + + -- Strace <@PACKAGE_BUGREPORT@> @DEB_CHANGELOGTIME@ + +strace (4.15-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 14 Dec 2016 08:09:10 +0000 + +strace (4.14-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 04 Oct 2016 18:19:20 +0000 + +strace (4.13-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 26 Jul 2016 16:17:18 +0000 + +strace (4.12-3) unstable; urgency=medium + + * Fix up 32/64-bit test output in strace -S test to fix i386 build + * Run make check with VERBOSE=1 so we get useful information in build logs + + -- Steve McIntyre <93sam@debian.org> Sat, 04 Jun 2016 02:37:44 +0100 + +strace (4.12-2) unstable; urgency=medium + + * Remove libunwind dependency. Closes: #826223 + + -- Steve McIntyre <93sam@debian.org> Fri, 03 Jun 2016 13:43:44 +0100 + +strace (4.12-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + implemented simultaneous use of -p option and tracing of a command, + closes: #549942 + + fixed decoding of syscalls unknown to the kernel on s390/s390x, + closes: #485979 + + -- Dmitry V. Levin Tue, 31 May 2016 11:12:13 +0000 + +strace (4.11-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + fixed decoding of path argument of umount2 syscall, closes: #785050 + + [ Steve McIntyre ] + * Drop patches against old upstream - all upstream now. + * Add simple upstream patch to fix printing of 32-bit times syscall + return value on 64-bit architectures. + + -- Steve McIntyre <93sam@debian.org> Fri, 08 Jan 2015 00:52:05 +0000 + +strace (4.10-3) unstable; urgency=medium + + * Really fix mips* builds - fix sys_syscall() handling. + Closes: #781753 + * Clean up strace64.substvars at clean time + * Remove ancient changelog entries that annoy lintian + * Update Standards-Version to 3.9.6 (no changes needed) + + -- Steve McIntyre <93sam@debian.org> Wed, 08 Jul 2015 23:44:03 +0100 + +strace (4.10-2) unstable; urgency=medium + + * Fix building on arm64 using patches from upstream. Closes: #790770 + * Fix various test suite failures using patches from upstream. + Closes: #781040 + * Fix mips o32 build. Thanks to Arturo Borrero Gonzalez + for tracking this. + * Add build-dependency on gawk for the test suite. Closes: #780992 + + -- Steve McIntyre <93sam@debian.org> Thu, 02 Jul 2015 02:03:25 +0100 + +strace (4.10-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + enhanced ioctl decoding, closes: #692913 + + enabled mips64el build, closes: #773375 + + updated signal and errno numbers, closes: #768642 + + updated generic and added arch-specific PTRACE_* constants, + closes: #734554 + + -- Steve McIntyre <93sam@debian.org> Sat, 21 Mar 2015 22:18:25 +0000 + +strace (4.9-2) unstable; urgency=medium + + * Turn on support for ppc64el, code is already in upstream. + Closes: #744121. + + -- Steve McIntyre <93sam@debian.org> Wed, 20 Aug 2014 18:00:20 +0100 + +strace (4.9-1) unstable; urgency=medium + + [ Dmitry V. Levin ] + * New upstream version. + + added -w option to produce stats on syscall latency, closes: #457497 + + applied miscellaneous corrections to the manpage, closes: #725987 + + fixed a typo in package description, closes: #697625 + + enabled or1k build, closes: #742235 + + enabled maximum security hardening, thanks to Markus + + [ Steve McIntyre ] + * New maintainer. Thanks to Frederik for all his prior work! + + -- Steve McIntyre <93sam@debian.org> Wed, 20 Aug 2014 15:11:36 +0100 + +strace (4.8-1.1) unstable; urgency=low + + * NMU + * Uploading 4.8 to unstable to fix long-standing bugs that have been + fixed for ages in experimental only. + * enable arm64 build, Closes: #749956 + * enable x32 build, Closes: #727018 + * lintian-inspired fixes: + + add build-arch and build-indep targets in debian/rules + + update standards-version to 3.9.5 + + remove ancient changelog entries causing syntax checker errors + + add hardening using buildflags.mk + + trivial changes to Description: fields + + -- Steve McIntyre <93sam@debian.org> Thu, 10 Jul 2014 14:22:18 +0000 + +strace (4.8-1) experimental; urgency=low + + * New upstream version. + + Added aarch64 support, closes: #693074 + + Fixed kernel release string parsing, closes: #702309 + + -- Dmitry V. Levin Mon, 03 Jun 2013 15:16:17 +0000 + +strace (4.7-1) experimental; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + Fixed sockaddr_un.sun_path name in decoded output, closes: #554946 + + Avoid potential core file clobbering on exit, closes: #656398 + + Fixed a typo in documentation, closes: #653309 + + -- Frederik Schüler Tue, 12 Feb 2013 10:35:22 +0100 + +strace (4.6-1) unstable; urgency=low + + * New upstream version. + + Added HDIO_* ioctl names, closes: #450953 + + Fixed stat64 decoding on mips, closes: #599028 + + Fixed misleading italics in the manual page, closes: #589323 + + -- Dmitry V. Levin Mon, 14 Mar 2011 15:16:17 +0000 + +strace (4.5.20-2.3) unstable; urgency=low + + * Non-maintainer upload. + * Add sh4 to arch list. + * Add powerpcspe to arch list (Closes: #579842). + + -- Nobuhiro Iwamatsu Tue, 22 Mar 2011 09:03:49 +0900 + +strace (4.5.20-2.2) unstable; urgency=low + + * Non-maintainer upload. + * Add sh4 to arch list (Closes: #537105). + + -- Nobuhiro Iwamatsu Wed, 09 Mar 2011 09:22:01 +0900 + +strace (4.5.20-2.1) unstable; urgency=low + + * NMU, added armhf support. (Closes: #596960) + + -- Konstantinos Margaritis Thu, 24 Feb 2011 14:47:54 +0000 + +strace (4.5.20-2) unstable; urgency=low + + * Add missing sparc syscall defines to fix FTBFS on sparc. + + -- Frederik Schüler Tue, 04 May 2010 14:31:46 +0200 + +strace (4.5.20-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream version. + + Corrected decoding of 64bit syscalls, closes: #570603 + + Corrected getsockopt decoding on architectures where + sizeof(long) > sizeof(int), closes: #494844 + + Corrected decoding of epoll_pwait, closes: #513014 + + Implemented -C option to combine regular and -c output, closes: #466196 + + [ Frederik Schüler ] + * Update standards-version to 3.8.4. + * debian/rules: allow parallel building. + * debian/rules: comment out verbose build, only needed for debugging. + * debian/rules: clean up clean: target, dh_clean does most of the work + already. + * debian/rules: use *-stamp instead of stamp-*, so dh_clean can tidy + up for us. + + -- Frederik Schüler Tue, 13 Apr 2010 13:02:57 +0200 + +strace (4.5.19-2) unstable; urgency=low + + * Add sparc64 to the architectures list, closes: #560062 + * Fix FTBFS, thanks to Aurelien Jarno for pointing + out the solution. Closes: #560516 + * Rebuild as normal package, closes: #566968 + * Update standards-version to 3.8.3. + * Lower package priority to optional, matching the archive override. + * Add watch file. + + -- Frederik Schüler Tue, 26 Jan 2010 12:20:51 +0100 + +strace (4.5.19-1) unstable; urgency=low + + [ Dmitry V. Levin ] + * New upstream release. + + Fixed FTBFS on armel, closes: #520084, #535564 + + Marked sendfile(2) as a network syscall, closes: #509499 + + Fixed syscall numbers for tee and sync_file_range, closes: #503124 + + Corrected accept(2) decoding, closes: #507573 + + Changed strace to exit/kill with traced process + exitcode/signal, closes: #37665 + + [ Frederik Schüler ] + * Move myself from uploaders to maintainers, and drop Roland from the list, + closes: #521458 + * Apply hppa fixes, thanks to Carlos O'Donell + and Helge Deller for the fixes, closes: #546619, #437928 + * Update standards-version to 3.8.1. + + -- Frederik Schüler Mon, 05 Oct 2009 22:39:54 +0200 + +strace (4.5.18-1) unstable; urgency=low + + * New upstream release, closes: #515655 + + Fix FTBFS, closes: #518852 + * Backported patch from CVS: Fix support for NUL-terminated + string, closes: #508484 + * Build-depend on debhelper (>= 7.0.0). + + -- Frederik Schüler Mon, 09 Mar 2009 14:39:42 +0100 + +strace (4.5.17+cvs080723-2) unstable; urgency=low + + * Pull Fix for sparc FTBFS from CVS, closes: #492774 + * Make strace64 priority extra. + + -- Frederik Schüler Sat, 02 Aug 2008 10:36:59 +0200 + +strace (4.5.17+cvs080723-1) unstable; urgency=low + + * New upstream cvs snapshot. + - fixes arm and armel FTBFS. + + -- Frederik Schüler Wed, 23 Jul 2008 15:23:22 +0200 + +strace (4.5.17-1) unstable; urgency=low + + * New upstream release. + + -- Frederik Schüler Sat, 19 Jul 2008 21:38:30 +0200 + +strace (4.5.16+cvs20080708-2) unstable; urgency=low + + * Rerun autotools in correct order. + * Add strace64 package on i386, powerpc, s390 and sparc, + closes: #491167, #491188 + + -- Frederik Schüler Thu, 17 Jul 2008 17:21:27 +0200 + +strace (4.5.16+cvs20080708-1) unstable; urgency=low + + * New upstream snapshot. + + Fix chmod/chown typo in debian/rules, closes: #459255. + + Install strace-graph too, closes: 469068. + + Fix m68k build, closes: 456879. + + Arm updates, closes: #441000. + + fix build on mips/mipsel, closes: #448802. + + show poll() parameters before blocking, closes: #369651. + + use dh_strip instead of install -s, closes: #438055, #396682. + + fix sparc build, closes: #469379. + * Acknowledge NMU, closes: #469380. + * Remove Wichert Akkerman from uploaders list. + * Bump standards version to 3.8.0. + - Add Homepage field. + * Add dh_md5sums call, closes: #439428. + * Fix dpkg-gencontrol call. + * Update debian/copyright. + + -- Frederik Schüler Tue, 01 Jul 2008 23:05:51 +0200 + +strace (4.5.16-1) unstable; urgency=low + + * New upstream version. + + 64-bit builds, closes: #435303. + + LFS build fix, closes: #385310. + + Fix multithread issues + + Fix spurious SIGSTOP on early interrupt. + + Fix utime for biarch. + + Fix -u error message. + + Better futex syscall printing. + + Fix argv/envp printing with small -s settings, and for biarch. + + New syscalls: getcpu, eventfd, timerfd, signalfd, epoll_pwait, + move_pages, utimensat. + + -- Roland McGrath Fri, 03 Aug 2007 03:24:21 -0700 + +strace (4.5.15-1) unstable; urgency=high + + [ Roland McGrath ] + * New upstream version. + + Fix -ff -o behavior, closes: #353935. + + Fail when nonoption args follow -p switches, closes: #361302. + + Fix semtimedop, closes: #340239. + + ARM support fixes, closes: #360152, #360154. + + [ Frederik Schüler ] + * Fix configure script, closes: #428997 + + -- Frederik Schüler Fri, 22 Jun 2007 16:28:08 +0000 + +strace (4.5.14-2) unstable; urgency=low + + * New comaintainer. + * Fix build failure with linux-2.6.18, thanks to Andreas Henriksson for the + patch, closes: #392556. + * Fix build with libc6 2.5. + * Acknowledge NMUs, closes: #315500, #355733 + + -- Frederik Schüler Thu, 26 Oct 2006 22:11:25 +0200 + +strace (4.5.14-1) unstable; urgency=low + + * New upstream version. + + Fix crash in printing sysctl, closes: #339117. + + Respect DEB_BUILD_OPTIONS=nostrip, closes: #325132. + + Fix ipc syscall decoding, closes: #340239. + + Add missing source files to tarball, closes: #336197. + + Build on armeb, closes: #335681. + + -- Roland McGrath Mon, 16 Jan 2006 22:17:38 -0800 + +strace (4.5.13-1) unstable; urgency=low + + * New upstream version. + + Fix m68k build, closes: #315500. + + Fix setsockopt decoding on 64-bit. + + Fix typos in socket option name strings. + + Display more IPV6 socket options by name. + + Don't display inappropriate syscalls for -e trace=file. + + New selector type -e trace=desc for file-descriptor using calls. + + Fix 32-bit old_mmap syscall decoding on x86-64. + + Fix errors detaching from multithreaded process on interrupt. + + Note 4.5.12 fix for crash handling bad signal numbers. + + -- Roland McGrath Wed, 3 Aug 2005 04:41:49 -0700 + +strace (4.5.12-1) unstable; urgency=low + + * New upstream version. + + Build on ppc64, closes: #301089. + + Refuse negative -s argument value, closes: #303256. + + Fix known syscall recognition for IA32 processes on x86-64. + + Fix bad output for ptrace on x86-64. + + Fix potential buffer overruns. + + Make some diagnostics more consistent. + + Update PowerPC system calls. + + Better printing for Linux aio system calls. + + Don't truncate statfs64 fields to 32 bits in output. + + Cosmetic code cleanups. + + -- Roland McGrath Wed, 8 Jun 2005 13:52:39 -0700 + +strace (4.5.11-1) unstable; urgency=low + + * New upstream version. + + Update MIPS system call table, closes: #256684. + + Fix build on s390 and sparc, closes: #294172, #293564. + + Fix select handling on nonstandard fd_set sizes, closes: #65654, #284290. + + Don't print errors for null file name pointers, closes: #63093. + + Fix initial execve output with -i. + + Fix build nits, closes: #300598. + + -- Roland McGrath Tue, 22 Mar 2005 15:12:22 -0800 + +strace (4.5.9-1) unstable; urgency=low + + * New upstream version. + + Fix potential crash in getxattr printing, closes: #283704. + + Improve socket ioctl printing, closes: #192164. + + Fix sparc build, closes: #278449. + + Update ia64 syscall list. + + Fix x86_64 syscall argument extraction for 32-bit processes. + + Fix -e signal=NAME parsing. + + Fix x86_64 exit_group syscall handling. + + Improve mount flags printing. + + Support symbolic printing of x86_64 arch_prctl parameters. + + Add strace-udeb package for Debian installer debugging, closes: #268294. + + -- Roland McGrath Fri, 4 Feb 2005 01:53:01 -0800 + +strace (4.5.8-1) unstable; urgency=low + + * New upstream version. + + Fix strace64 man page symlink, closes: #269220. + + Update syscall tables for Alpha, ARM, HPPA, closes: #273887. + + Build strace64 for s390, closes: #271500. + + Fix some endian issues in 64-bit argument output on 32-bit machines. + + Support new Linux syscalls mbind, set_mempolicy, get_mempolicy, waitid. + + Support Linux syscalls fadvise64, fadvise64_64, and epoll_*. + + Improve ioctl command name matching. + + Print RTC_* ioctl structure contents. + + Support newer RLIMIT_* values. + + Print struct cmsghdr details in sendmsg. + + -- Roland McGrath Tue, 19 Oct 2004 18:05:28 -0700 + +strace (4.5.7-1) unstable; urgency=low + + * New upstream version. + + Update man page about -c, closes: #254438. + + Include pread/pwrite calls in -e read/write tracing, closes: #239947. + + Update SO_* and IP_* value lists, closes: #171653. + + Print attribute values in *xattr system calls. + + Print clock_t values symbolically in Linux clock_* system calls. + + Show PER_* values correctly, closes: #40588. + + Fix `strace64' build on sparc, closes: #254728. + + -- Roland McGrath Tue, 31 Aug 2004 01:41:19 -0700 + +strace (4.5.6-1) unstable; urgency=low + + * New upstream version. + + Update Linux ioctl lists and decode some more network ioctls. + + Fix `quotactl' argument decoding on 64-bit. + + Linux/SPARC64 support, closes: #254728. + + -- Roland McGrath Mon, 12 Jul 2004 00:18:32 -0700 + +strace (4.5.5-1) unstable; urgency=low + + * New upstream version. + + Fix support for 32-bit (i386) binaries on Linux/AMD64. + + -- Roland McGrath Sun, 27 Jun 2004 22:19:15 -0700 + +strace (4.5.4-1) unstable; urgency=low + + * Build package on amd64, closes: #246568. + * New upstream version. + + Recognize more PF_* and AF_* values, closes: #250506. + + Other fixes. + + -- Roland McGrath Thu, 3 Jun 2004 19:35:37 -0700 + +strace (4.5.3-1) unstable; urgency=low + + * New upstream version. + + Finish fix for -f on Linux/S390(x). + + Print extra wait status bits, closes: #240062. + + -- Roland McGrath Fri, 16 Apr 2004 15:27:43 -0700 + +strace (4.5.2-1) unstable; urgency=low + + * New upstream version. + + Check for errors writing to -o file, closes: #218762 + + Print multiple ioctl code matches on Linux. + + Various other fixes. + + Update typos and obsolete bits in man page, closes: #217008, #223390 + + Fix compilation problems with newer kernel headers, closes: #223207 + + Update HPPA system calls, closes: #231632 + + Fix PID in messages, closes: #229802 + + Fix s390 brokenness in 4.5, closes: #226098 + + -- Roland McGrath Mon, 1 Mar 2004 22:44:55 -0800 + +strace (4.5-1) unstable; urgency=low + + * New upstream version. + + Fix mlock syscall printing. + + MIPS & S390 updates. + + Print names for SIGRT_* in sets. + + -- Roland McGrath Wed, 24 Sep 2003 15:20:18 -0700 + +strace (4.4.99-1) unstable; urgency=low + + * New upstream version. + + Alpha updates. + + Add a few more new Linux 2.5 system calls. + + Stephen Thomas contributed a port to Linux/SH64. + + Print protocol names for PF_INET6 sockets. + + -- Roland McGrath Thu, 17 Jul 2003 02:04:43 -0700 + +strace (4.4.98-1) unstable; urgency=low + + * New upstream version. + + Fixes clone argument bugs. + + Fixes sem* printing bugs. + + Fixes -e argument parsing, closes: #188379. + + Fixes hanging parent in odd wait cases, closes: #47608, #109656. + + Fixes -q defaulting, closes: #47113, #153678. + + Fixes trying to execute directories, closes: #137103. + + Updates ARM support, thanks to Russell King. + + Updates S390/S390x support. + * Bump standards-version to 3.5.10 + + -- Roland McGrath Mon, 2 Jun 2003 12:26:29 -0700 + +strace (4.4.96-1) unstable; urgency=low + + * New upstream version. + + Handles yet more new Linux 2.5 system calls. + + Fixes x86_64 and ia64 clone printing. + + Updates SH port. + + -- Roland McGrath Sun, 30 Mar 2003 17:14:34 -0800 + +strace (4.4.95-1) unstable; urgency=low + + * New upstream version. + + Fixes printing of getresuid and getresgid values. + + -- Roland McGrath Mon, 24 Feb 2003 02:50:43 -0800 + +strace (4.4.94-1) unstable; urgency=low + + * New upstream version. + + New option -E to set environment variables. + + Build fixes for sparc, closes: #178636. + + -- Roland McGrath Wed, 19 Feb 2003 19:12:40 -0800 + +strace (4.4.93-1) unstable; urgency=low + + * New upstream version. + + Grok new quotactl arguments, closes: #154067. + + Fix m68k build problem, closes: #176528. + + Old bugs prior release actually closes: #154068. + + Fix S390 bugs with -f, and bugs with execve. + * Switched to non-native packaging (empty .diff), closes: #176388. + + -- Roland McGrath Tue, 21 Jan 2003 12:22:08 -0800 + +strace (4.4.92-1) unstable; urgency=low + + * New upstream version. + + Updated config.guess and config.sub, closes: #176241. + + Several fixes for PPC, closes: #144326. + + Fixed ptrace output for unknown requests, closes: #77728. + + Fixed output of getdents64, truncate64, ftruncate64, closes: #169528. + + Old bugs the last release actually closes: #153750, #38467, #109993, + #109815, #104594, #113087, #134803, #166622, #96356, #94725, #32147, + #32798, #36801, #41066, #81637, #138300, #143791. + + -- Roland McGrath Tue, 14 Jan 2003 02:02:44 -0800 + +strace (4.4.91-1) unstable; urgency=low + + * New upstream version. + + Fixes -f on x86-64. + + -- Roland McGrath Fri, 10 Jan 2003 12:55:34 -0800 + +strace (4.4.90-1) unstable; urgency=low + + * New maintainer. + * New upstream version. + + -- Roland McGrath Fri, 10 Jan 2003 01:58:40 -0800 + +strace (4.4-1.2) unstable; urgency=low + + * NMU + * Quick one-liner to allow building on the ARM. Closes: #109993. + * Re-ran autoconf, hopefully I didn't break other arches. + + -- Anand Kumria Mon, 1 Oct 2001 14:22:25 +1000 + +strace (4.4-1.1) unstable; urgency=low + + * NMU. + * Added patch from David Mosberger which fixes some ia64 issues. + Closes: #113087. + * Added ia64-specific Build-Depends on libc6.1-dev. Closes: + #109815. + * Ran autoheader, so the s390 patch applies. Closes: #104594. + + -- Jeff Licquia Tue, 25 Sep 2001 13:15:28 -0500 + +strace (4.4-1) unstable; urgency=low + + * New upstream version + + Added S390 support. Closes: Bug#104594 + + New config.{guess,sub}. Closes: Bug#92532 + + LFS support for Linux/sparc. Closes: Bug#99215 + * Works on IA64 again. Closes: Bug#103854 + * Don't override CFLAGS in debian/rules + * Remove rules to create configure & friends. Closes: Bug#92483 + + -- Wichert Akkerman Sun, 19 Aug 2001 14:10:58 +0200 + +strace (4.3-3.1) unstable; urgency=low + + * copy in new config.{guess,sub} to get support for new architectures. + Closes: #94725 + + -- LaMont Jones Mon, 9 Jul 2001 21:39:34 -0600 + +strace (4.3-3) unstable; urgency=low + + * Update architecture list + + -- Wichert Akkerman Sat, 14 Apr 2001 10:42:19 +0200 + +strace (4.3-2) unstable; urgency=low + + * Run cvsbuild so we don't need to run autohead & friends + * Sync to current CVS + + -- Wichert Akkerman Fri, 13 Apr 2001 19:08:53 +0200 + +strace (4.3-1) unstable; urgency=low + + * New upstream version + * Updated Build-Depends to use a recent glibc so we get the 2.4 kernel + headers + * Changed Architecture so we only build on Linux + * Include section and priority in control info + + -- Wichert Akkerman Sun, 1 Apr 2001 16:35:32 +0200 + +strace (4.2-4) frozen unstable; urgency=low + + * Actually install postinst and prerm so we get the proper /usr/doc/strace + symlink + + -- Wichert Akkerman Thu, 17 Feb 2000 21:49:17 +0100 + +strace (4.2-3) frozen unstable; urgency=low + + * Fix typo in aclocal.m4 that prevented compilation on architectures without + LFS + + -- Wichert Akkerman Sun, 13 Feb 2000 01:19:11 +0100 + +strace (4.2-2) frozen unstable; urgency=low + + * only include linux/ptrace.h if sys/reg.h hasn't been found by configure, + Closes: Bug# 39556 + + -- Wichert Akkerman Thu, 27 Jan 2000 03:22:55 +0100 + +strace (4.2-1) frozen unstable; urgency=low + + * New upstream version: + + Builds correctly on glibc2.0 again, Closes: Bug# 51648 + + Small y2k fix in printtimes, Closes: Bug# 54592 + + semop is handled now, Closes: Bug# 52684 + + -- Wichert Akkerman Fri, 21 Jan 2000 21:45:41 +0100 + +strace (4.1-1) unstable; urgency=low + + * New upstream version + * Bump standards-version to 3.1.0 + * FHS 2.1 compliant + + -- Wichert Akkerman Fri, 26 Nov 1999 01:42:07 +0100 + +strace (4.0-1) unstable; urgency=low + + * New upstream version + + -- Wichert Akkerman Fri, 9 Jul 1999 16:12:34 +0200 + +strace (3.99.1-1) unstable; urgency=low + + * New upstream version, second pre-release for 4.0 + + -- Wichert Akkerman Wed, 9 Jun 1999 15:20:42 +0200 + +strace (3.99-1) unstable; urgency=low + + * New upstream maintainer (me :) + * New upstream version, pre-release for strace 4.0 + * See upstream changelog for changes + * Build with glibc2.1 + + -- Wichert Akkerman Tue, 27 Apr 1999 14:00:15 +0200 + +strace (3.1.0.1-12) unstable; urgency=low + + * Only i386 has a LDT, so check for architecture in mem.c (Bug# 32798) + * Check for nsignals properly, closes: #34445 + * Fix check for overruns in umove*, patch by Nate Eldredge + + -- Wichert Akkerman Mon, 15 Mar 1999 00:43:14 +0100 + +strace (3.1.0.1-11) unstable; urgency=low + + * Merge some ARM stuff that got stuck in my mailbox + + -- Wichert Akkerman Sun, 31 Jan 1999 13:04:13 +0100 + +strace (3.1.0.1-10) unstable; urgency=low + + * Move sys_poll to the DONE section in linux/dummy.h + * Support subarchitectures for alpha (Bug# 32147) + * Incorporate changes from Ulrich Drepper + + up number of supported personalities on Linux sparc to 3 + + add O_DIRECT, O_LARGEFILE and O_DIRECTORY to openmodes + + change prefix for printxval to SEEK_ in sys_lseek + + add a support for a whole bunch of syscalls + + updated sys_pread and sys_pwrite for SVR4 + + handle sys_delete_module properly + + change SYS_socket_subcall to 230 for non-powerpc architectures + + sys_chown is now lchown + + looks like a whole lot of syscalls is moved from 180 to 230 + + Revamp a lot of the signal handling code + + handle sys_clone + + Lots more (it was a 6494-line patch and I'm too lazy to put all + changes in here..) + * Please note you need to have 2.1 or 2.2 kernel sources in /usr/src/linux + in order to compile this. + + -- Wichert Akkerman Fri, 29 Jan 1999 02:04:12 +0100 + +strace (3.1.0.1-9) unstable; urgency=low + + * Add support for poll() systemcall + + -- Wichert Akkerman Thu, 31 Dec 1998 16:03:44 +0100 + +strace (3.1.0.1-8) frozen unstable; urgency=low + + * Use new_stat from libc6 now, except for powerpc and sparc + + -- Wichert Akkerman Thu, 24 Dec 1998 11:35:32 +0100 + +strace (3.1.0.1-7) frozen unstable; urgency=low + + * Fix sparc support + * Display nanosleep call correctly (Bug# 25904) + * Honour -v flag in printargs (Bug# 10426) + * Play with #define to get proper kernel struct stat + * Compile with 2.1.131 kernel source + + -- Wichert Akkerman Sat, 19 Dec 1998 15:02:14 +0100 + +strace (3.1.0.1-6) frozen unstable; urgency=low + + * Set NSIG correctly for ARM + * Include strace-graph script from Richard Braakman + as an example. Try it and be amazed! + * Fix sigaction problem, patch from Topi Miettinen + + + -- Wichert Akkerman Mon, 7 Dec 1998 02:10:30 +0100 + +strace (3.1.0.1-5) unstable; urgency=low + + * Patched from Richard Braakman : + + use correct dirent.h on Linux + + remove debugging code left from the powerpc patch + + fix output for execve when -v is used + + -- Wichert Akkerman Fri, 13 Nov 1998 15:59:17 +0100 + +strace (3.1.0.1-5) unstable; urgency=low + + * Add location of upstream sources to the copyright + * Merged ARM architecture support from Jim Studt + + -- Wichert Akkerman Mon, 9 Nov 1998 16:43:24 +0100 + +strace (3.1.0.1-4) unstable; urgency=low + + * More ppc patches from Daniel Jacobowitz + + -- Wichert Akkerman Mon, 12 Oct 1998 00:59:44 +0200 + +strace (3.1.0.1-3) unstable; urgency=low + + * Added support for sys_query_module, patch from Brian J. Murrell + + * Preserve timestamps for documentation when installed + * Incorporate patches from Daniel Jacobowitz : + + powerpc patches + + Patches include changing SYS_socket_subcall and SYS_ipc_subcall, + check for stray syscall exit after execv, and completely regenerated + syscall, errno, and ioctl lists. + + Decode capget and capset arguments. + + -- Wichert Akkerman Sun, 11 Oct 1998 22:42:56 +0200 + +strace (3.1.0.1-2) unstable; urgency=low + + * Patch to support sparc, courtesy of RedHat + * Cleaned up some stuff the patch left broken + * Fix some more compilation-issues for IPX with current kernels + + -- Wichert Akkerman Fri, 24 Jul 1998 22:53:43 +0200 + +strace (3.1.0.1-1) unstable; urgency=low + + * New (actually very old) upstream version. Fixes something we + already had fixed + * Compiled with current kernel-headers from libc6-dev + * Fixed spelling-error + * Compress changelog + * Bumped standard-version to 2.4.1.0 + + -- Wichert Akkerman Wed, 22 Jul 1998 15:53:23 +0200 + +strace (3.1-14) unstable; urgency=low + + * Don't let libc6 trick us anymore with {f,l,}stat() calls + * Fix configure.in to support PentiumII processors + + -- Wichert Akkerman Mon, 22 Jun 1998 20:17:20 +0200 + +strace (3.1-13) unstable; urgency=low + + * Corrected error on PowerPC patch that broke other archictectures + (Bug# 13837) + + -- Wichert Akkerman Tue, 14 Oct 1997 15:41:29 +0200 + +strace (3.1-12) unstable; urgency=low + + * PowerPC patches by Klee Dienes (Bug# 10788, 10790) + * Create correct md5sums (Bug# 13363) + * Put changelog in correct place (Bug# 13363) + * Pristine sources + + -- Wichert Akkerman Mon, 6 Oct 1997 15:42:25 +0200 + +strace (3.1-11) unstable; urgency=low + + * Ported to libc6 / glibc2 (Bug# 11729) + * Compress manpage + + -- Wichert Akkerman Fri, 1 Aug 1997 00:13:38 +0200 + +strace (3.1-10) unstable; urgency=low + + * Install upstream changelog + * Added dependencies to control file for libc + * Added md5sums to .deb file + + -- Wichert Akkerman Fri, 11 Jul 1997 12:26:12 +0200 + +strace (3.1-9) stable; urgency=low + + * Fixed bug with hanging children. Patch by Matthias Urlichs + * Added some more constants to net.c. + * glibc patches, courtesy of Klee Dienes (Bug# 7735) + + -- Wichert Akkerman Mon, 21 Apr 1997 11:59:45 +0200 + +strace (3.1-8) frozen unstable; urgency=low + + * Added detection of ROSE networking + + -- Wichert Akkerman Tue, 12 Nov 1996 22:21:22 +0100 + +strace (3.1-7) stable; urgency=low + + * Install manpage with correct mode (0644) (Bug#4813) + * Renamed debian changelog to changelog.Debian + + -- Wichert Akkerman Sat, 26 Oct 1996 18:15:41 +0200 + +strace (3.1-6) stable; urgency=low + + * Small patch for compilation on kernels 2.1.0 and later (see signal.c) + + -- Wichert Akkerman Fri, 18 Oct 1996 00:28:47 +0200 + +strace (3.1-5) stable unstable; urgency=low + + * Moved to new packagingformat + * Fixed umoven bug (Bug# 4523) + * Corrected number of parameters for mmap systemcall (bug# 4508) + + -- Wichert Akkerman Sat, 23 Sep 1996 23:33:58 +0200 + +strace (3.1-4) unstable; urgency=low + + * Fixed changestemplate + + -- Wichert Akkerman , Thu Sep 12 14:59:44 MET DST 1996 + +strace (3.1-3) unstable; urgency=low + + * Revamped debian files + + -- Wichert Akkerman , Thu Jul 11 20:19:11 MET DST 1996 + + +strace (3.1-2) unstable; urgency=low + * Added some #ifdef's around IPX stuff to make it compilable on non-Linux + systems. + * changed debian.control and debian.rules to conform to new debian naming + schemes + * added architecture-option to debian.rules and debian.control + + -- Wichert Akkerman + +strace (3.1-1) unstable; urgency=low + + * Moved to new upstream version + * added more protocol families to domains + * added IPIP-protocol to protocols + * added MSG_PROXY and MSG_CTRUNC to msg_flags + * added SO_BSDCOMPAT and SO_REUSEPORT to sockoptions + * added IP, IPX and TCP-options + * added IP, IPX and TCP support to get-/setsockopt() + * added IPX support + + -- Wichert Akkerman diff --git a/debian/control b/debian/control index 3673d2ee..79773c33 100644 --- a/debian/control +++ b/debian/control @@ -1,13 +1,15 @@ Source: strace -Maintainer: Frederik Schüler +Maintainer: Steve McIntyre <93sam@debian.org> Section: utils Priority: optional -Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [i386 powerpc s390 sparc], debhelper (>= 7.0.0) -Standards-Version: 3.9.5 +Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [amd64 i386 powerpc ppc64 s390 sparc sparc64 x32], debhelper (>= 7.0.0), gawk +Standards-Version: 3.9.6 Homepage: http://sourceforge.net/projects/strace/ +Vcs-Git: https://anonscm.debian.org/git/collab-maint/strace.git +Vcs-Browser: https://anonscm.debian.org/git/collab-maint/strace.git Package: strace -Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel or1k powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64 x32 +Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel mips64 mips64el or1k powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64 x32 Depends: ${shlibs:Depends}, ${misc:Depends} Description: System call tracer strace is a system call tracer, i.e. a debugging tool which prints out @@ -40,7 +42,7 @@ Package: strace-udeb Section: debian-installer XC-Package-Type: udeb Priority: extra -Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel or1k powerpc powerpcspe ppc64 s390 sh4 sparc sparc64 x32 +Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel mips64 mips64el or1k powerpc powerpcspe ppc64 ppc64el s390 sh4 sparc sparc64 x32 Depends: ${shlibs:Depends}, ${misc:Depends} Description: System call tracer strace is a system call tracer, i.e. a debugging tool which prints out diff --git a/debian/rules b/debian/rules index 912b4103..4b556a73 100755 --- a/debian/rules +++ b/debian/rules @@ -47,7 +47,7 @@ build-indep: build-stamp $(extra_build_targets) %-stamp: %/Makefile $(MAKE) -C $* ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) - $(MAKE) -C $* check + $(MAKE) -C $* check VERBOSE=1 endif touch $@ @@ -62,7 +62,7 @@ build64/Makefile: clean: dh_testdir dh_testroot - rm -rf build build64 strace64.1 + rm -rf build build64 strace64.1 debian/strace64.substvars dh_clean binary: binary-indep binary-arch diff --git a/debian/watch b/debian/watch index 5e4f652a..8bb7f45a 100644 --- a/debian/watch +++ b/debian/watch @@ -1,2 +1,2 @@ version=3 -opts="uversionmangle=s/-/./g" http://sf.net/strace/strace-([[:digit:].-]*)\.tar\.xz +opts=pgpsigurlmangle=s/$/.asc/,uversionmangle=s/-/./g http://sf.net/strace/strace-([[:digit:].-]*)\.tar\.xz diff --git a/defs.h b/defs.h index 625cac67..b333a221 100644 --- a/defs.h +++ b/defs.h @@ -27,33 +27,19 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef STRACE_DEFS_H +#define STRACE_DEFS_H + #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef MIPS -# include -# if _MIPS_SIM == _MIPS_SIM_ABI64 -# define LINUX_MIPSN64 -# elif _MIPS_SIM == _MIPS_SIM_NABI32 -# define LINUX_MIPSN32 -# elif _MIPS_SIM == _MIPS_SIM_ABI32 -# define LINUX_MIPSO32 -# else -# error Unsupported _MIPS_SIM -# endif -#endif - #include -#ifdef HAVE_STDBOOL_H -# include -#endif +#include #include #include #include -#ifdef STDC_HEADERS -# include -#endif +#include #include #include #include @@ -63,10 +49,13 @@ /* #include */ #include #include -#include #include #include -#include + +#include "kernel_types.h" +#include "mpers_type.h" +#include "gcc_compat.h" +#include "sysent.h" #ifndef HAVE_STRERROR const char *strerror(int); @@ -80,16 +69,12 @@ const char *strerror(int); extern char *stpcpy(char *dst, const char *src); #endif -#if !defined __GNUC__ -# define __attribute__(x) /*nothing*/ -#endif - -#ifndef offsetof -# define offsetof(type, member) \ - (((char *) &(((type *) NULL)->member)) - ((char *) (type *) NULL)) +#ifndef offsetofend +# define offsetofend(type, member) \ + (offsetof(type, member) + sizeof(((type *)NULL)->member)) #endif -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + MUST_BE_ARRAY(a)) /* macros */ #ifndef MAX @@ -140,32 +125,6 @@ extern char *stpcpy(char *dst, const char *src); #define USE_SEIZE 1 /* To force NOMMU build, set to 1 */ #define NOMMU_SYSTEM 0 -/* - * Set to 1 to use speed-optimized vfprintf implementation. - * It results in strace using about 5% less CPU in user space - * (compared to glibc version). - * But strace spends a lot of time in kernel space, - * so overall it does not appear to be a significant win. - * Thus disabled by default. - */ -#define USE_CUSTOM_PRINTF 0 - -#ifdef NEED_PTRACE_PROTOTYPE_WORKAROUND -# define ptrace xptrace -# include -# undef ptrace -extern long ptrace(int, int, char *, long); -#else -# include -#endif - -#if defined(POWERPC) -# include -#endif - -#if defined(TILE) -# include /* struct pt_regs */ -#endif #ifndef ERESTARTSYS # define ERESTARTSYS 512 @@ -180,251 +139,98 @@ extern long ptrace(int, int, char *, long); # define ERESTART_RESTARTBLOCK 516 #endif -#if !HAVE_DECL_PTRACE_SETOPTIONS -# define PTRACE_SETOPTIONS 0x4200 -#endif -#if !HAVE_DECL_PTRACE_GETEVENTMSG -# define PTRACE_GETEVENTMSG 0x4201 -#endif -#if !HAVE_DECL_PTRACE_GETSIGINFO -# define PTRACE_GETSIGINFO 0x4202 -#endif - -#if !HAVE_DECL_PTRACE_O_TRACESYSGOOD -# define PTRACE_O_TRACESYSGOOD 0x00000001 -#endif -#if !HAVE_DECL_PTRACE_O_TRACEFORK -# define PTRACE_O_TRACEFORK 0x00000002 -#endif -#if !HAVE_DECL_PTRACE_O_TRACEVFORK -# define PTRACE_O_TRACEVFORK 0x00000004 -#endif -#if !HAVE_DECL_PTRACE_O_TRACECLONE -# define PTRACE_O_TRACECLONE 0x00000008 -#endif -#if !HAVE_DECL_PTRACE_O_TRACEEXEC -# define PTRACE_O_TRACEEXEC 0x00000010 -#endif -#if !HAVE_DECL_PTRACE_O_TRACEEXIT -# define PTRACE_O_TRACEEXIT 0x00000040 -#endif - -#if !HAVE_DECL_PTRACE_EVENT_FORK -# define PTRACE_EVENT_FORK 1 -#endif -#if !HAVE_DECL_PTRACE_EVENT_VFORK -# define PTRACE_EVENT_VFORK 2 -#endif -#if !HAVE_DECL_PTRACE_EVENT_CLONE -# define PTRACE_EVENT_CLONE 3 -#endif -#if !HAVE_DECL_PTRACE_EVENT_EXEC -# define PTRACE_EVENT_EXEC 4 -#endif -#if !HAVE_DECL_PTRACE_EVENT_VFORK_DONE -# define PTRACE_EVENT_VFORK_DONE 5 -#endif -#if !HAVE_DECL_PTRACE_EVENT_EXIT -# define PTRACE_EVENT_EXIT 6 -#endif - -#if !HAVE_DECL_PTRACE_PEEKUSER -# define PTRACE_PEEKUSER PTRACE_PEEKUSR -#endif -#if !HAVE_DECL_PTRACE_POKEUSER -# define PTRACE_POKEUSER PTRACE_POKEUSR -#endif - -#undef PTRACE_SEIZE -#define PTRACE_SEIZE 0x4206 -#undef PTRACE_INTERRUPT -#define PTRACE_INTERRUPT 0x4207 -#undef PTRACE_LISTEN -#define PTRACE_LISTEN 0x4208 -#undef PTRACE_EVENT_STOP -#define PTRACE_EVENT_STOP 128 - -#ifdef ALPHA -# define REG_R0 0 -# define REG_A0 16 -# define REG_A3 19 -# define REG_FP 30 -# define REG_PC 64 -#endif /* ALPHA */ -#ifdef MIPS -# define REG_V0 2 -# define REG_A0 4 -# define REG_A3 7 -# define REG_SP 29 -# define REG_EPC 64 -#endif /* MIPS */ -#ifdef HPPA -# define PT_GR20 (20*4) -# define PT_GR26 (26*4) -# define PT_GR28 (28*4) -# define PT_IAOQ0 (106*4) -# define PT_IAOQ1 (107*4) -#endif /* HPPA */ -#ifdef SH64 - /* SH64 Linux - this code assumes the following kernel API for system calls: - PC Offset 0 - System Call Offset 16 (actually, (syscall no.) | (0x1n << 16), - where n = no. of parameters. - Other regs Offset 24+ - - On entry: R2-7 = parameters 1-6 (as many as necessary) - On return: R9 = result. */ - - /* Offset for peeks of registers */ -# define REG_OFFSET (24) -# define REG_GENERAL(x) (8*(x)+REG_OFFSET) -# define REG_PC (0*8) -# define REG_SYSCALL (2*8) -#endif /* SH64 */ -#ifdef AARCH64 -struct arm_pt_regs { - int uregs[18]; -}; -# define ARM_cpsr uregs[16] -# define ARM_pc uregs[15] -# define ARM_lr uregs[14] -# define ARM_sp uregs[13] -# define ARM_ip uregs[12] -# define ARM_fp uregs[11] -# define ARM_r10 uregs[10] -# define ARM_r9 uregs[9] -# define ARM_r8 uregs[8] -# define ARM_r7 uregs[7] -# define ARM_r6 uregs[6] -# define ARM_r5 uregs[5] -# define ARM_r4 uregs[4] -# define ARM_r3 uregs[3] -# define ARM_r2 uregs[2] -# define ARM_r1 uregs[1] -# define ARM_r0 uregs[0] -# define ARM_ORIG_r0 uregs[17] -#endif /* AARCH64 */ - -#if defined(SPARC) || defined(SPARC64) -/* Indexes into the pt_regs.u_reg[] array -- UREG_XX from kernel are all off - * by 1 and use Ix instead of Ox. These work for both 32 and 64 bit Linux. */ -# define U_REG_G1 0 -# define U_REG_O0 7 -# define U_REG_O1 8 -# define PERSONALITY0_WORDSIZE 4 -# define PERSONALITY1_WORDSIZE 4 -# if defined(SPARC64) -# include -# define SUPPORTED_PERSONALITIES 3 -# define PERSONALITY2_WORDSIZE 8 -# else -# include -# define SUPPORTED_PERSONALITIES 2 -# endif /* SPARC64 */ -#endif /* SPARC[64] */ - -#ifdef X86_64 +#if defined X86_64 # define SUPPORTED_PERSONALITIES 3 -# define PERSONALITY0_WORDSIZE 8 -# define PERSONALITY1_WORDSIZE 4 -# define PERSONALITY2_WORDSIZE 4 -#endif - -#ifdef X32 +# define PERSONALITY2_WORDSIZE 4 +# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE +#elif defined AARCH64 \ + || defined POWERPC64 \ + || defined RISCV \ + || defined SPARC64 \ + || defined TILE \ + || defined X32 # define SUPPORTED_PERSONALITIES 2 -# define PERSONALITY0_WORDSIZE 4 -# define PERSONALITY1_WORDSIZE 4 -#endif - -#ifdef ARM -/* one personality */ +#else +# define SUPPORTED_PERSONALITIES 1 #endif -#ifdef AARCH64 -/* The existing ARM personality, then AArch64 */ -# define SUPPORTED_PERSONALITIES 2 -# define PERSONALITY0_WORDSIZE 4 -# define PERSONALITY1_WORDSIZE 8 +#if defined TILE && defined __tilepro__ # define DEFAULT_PERSONALITY 1 +#else +# define DEFAULT_PERSONALITY 0 #endif -#ifdef POWERPC64 -# define SUPPORTED_PERSONALITIES 2 -# define PERSONALITY0_WORDSIZE 8 -# define PERSONALITY1_WORDSIZE 4 -#endif +#define PERSONALITY0_WORDSIZE SIZEOF_LONG +#define PERSONALITY0_KLONGSIZE SIZEOF_KERNEL_LONG_T +#define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" +#define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" -#ifdef TILE -# define SUPPORTED_PERSONALITIES 2 -# define PERSONALITY0_WORDSIZE 8 -# define PERSONALITY1_WORDSIZE 4 -# ifdef __tilepro__ -# define DEFAULT_PERSONALITY 1 -# endif +#if SUPPORTED_PERSONALITIES > 1 +# define PERSONALITY1_WORDSIZE 4 +# define PERSONALITY1_KLONGSIZE PERSONALITY1_WORDSIZE #endif -#ifndef SUPPORTED_PERSONALITIES -# define SUPPORTED_PERSONALITIES 1 -#endif -#ifndef DEFAULT_PERSONALITY -# define DEFAULT_PERSONALITY 0 -#endif -#ifndef PERSONALITY0_WORDSIZE -# define PERSONALITY0_WORDSIZE SIZEOF_LONG +#if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS +# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h" +# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h" +# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h" +# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h" +#else +# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" +# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" +# define PERSONALITY1_INCLUDE_FUNCS "empty.h" #endif -#if defined(I386) || defined(X86_64) -extern uint32_t *const i386_esp_ptr; -#elif defined(IA64) -extern bool ia64_ia32mode; -#elif defined(SPARC) || defined(SPARC64) -extern struct pt_regs sparc_regs; -#elif defined(ARM) -extern struct pt_regs arm_regs; -#elif defined(TILE) -extern struct pt_regs tile_regs; -#elif defined(POWERPC) -extern struct pt_regs ppc_regs; +#if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS +# define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h" +# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h" +# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h" +# define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h" +#else +# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" +# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" +# define PERSONALITY2_INCLUDE_FUNCS "empty.h" #endif -typedef struct sysent { - unsigned nargs; - int sys_flags; - int (*sys_func)(); - const char *sys_name; -} struct_sysent; - typedef struct ioctlent { - const char *doth; const char *symbol; - unsigned long code; + unsigned int code; } struct_ioctlent; +struct inject_opts { + uint16_t first; + uint16_t step; + uint16_t signo; + int rval; +}; + +#define MAX_ERRNO_VALUE 4095 +#define INJECT_OPTS_RVAL_DEFAULT (-(MAX_ERRNO_VALUE + 1)) + /* Trace Control Block */ struct tcb { int flags; /* See below for TCB_ values */ int pid; /* If 0, this tcb is free */ int qual_flg; /* qual_flags[scno] or DEFAULT_QUAL_FLAGS + RAW */ - int u_error; /* Error code */ - long scno; /* System call number */ - long u_arg[MAX_ARGS]; /* System call arguments */ -#if defined(LINUX_MIPSN32) || defined(X32) - long long ext_arg[MAX_ARGS]; - long long u_lrval; /* long long return value */ -#endif - long u_rval; /* Return value */ + unsigned long u_error; /* Error code */ + kernel_ulong_t scno; /* System call number */ + kernel_ulong_t u_arg[MAX_ARGS]; /* System call arguments */ + kernel_long_t u_rval; /* Return value */ #if SUPPORTED_PERSONALITIES > 1 - int currpers; /* Personality at the time of scno update */ + unsigned int currpers; /* Personality at the time of scno update */ #endif + int sys_func_rval; /* Syscall entry parser's return value */ int curcol; /* Output column for this process */ FILE *outf; /* Output file for this process */ const char *auxstr; /* Auxiliary info from syscall (see RVAL_STR) */ + void *_priv_data; /* Private data for syscall decoding functions */ + void (*_free_priv_data)(void *); /* Callback for freeing priv_data */ const struct_sysent *s_ent; /* sysent[scno] or dummy struct for bad scno */ + const struct_sysent *s_prev_ent; /* for "resuming interrupted SYSCALL" msg */ + struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES]; struct timeval stime; /* System time usage as of last process wait */ struct timeval dtime; /* Delta for system time usage */ struct timeval etime; /* Syscall entry time */ - /* Support for tracing forked processes: */ - long inst[2]; /* Saved clone args (badly named) */ #ifdef USE_LIBUNWIND struct UPT_info* libunwind_ui; @@ -451,52 +257,26 @@ struct tcb { * are limited to trace(), this condition is never observed in trace_syscall() * and below. * The bit is cleared after all syscall exit processing is done. - * User-generated SIGTRAPs and post-execve SIGTRAP make it necessary - * to be very careful and NOT set TCB_INSYSCALL bit when they are encountered. - * TCB_WAITEXECVE bit is used for this purpose (see below). * * Use entering(tcp) / exiting(tcp) to check this bit to make code more readable. */ #define TCB_INSYSCALL 0x04 #define TCB_ATTACHED 0x08 /* We attached to it already */ -#define TCB_BPTSET 0x10 /* "Breakpoint" set after fork(2) */ -#define TCB_REPRINT 0x20 /* We should reprint this syscall on exit */ -#define TCB_FILTERED 0x40 /* This system call has been filtered out */ -/* - * x86 does not need TCB_WAITEXECVE. - * It can detect post-execve SIGTRAP by looking at eax/rax. - * See "not a syscall entry (eax = %ld)\n" message. - * - * Note! On new kernels (about 2.5.46+), we use PTRACE_O_TRACEEXEC, which - * suppresses post-execve SIGTRAP. If you are adding a new arch which is - * only supported by newer kernels, you most likely don't need to define - * TCB_WAITEXECVE! - */ -#if defined(ALPHA) \ - || defined(SPARC) || defined(SPARC64) \ - || defined(POWERPC) \ - || defined(IA64) \ - || defined(HPPA) \ - || defined(SH) || defined(SH64) \ - || defined(S390) || defined(S390X) \ - || defined(ARM) \ - || defined(MIPS) -/* This tracee has entered into execve syscall. Expect post-execve SIGTRAP - * to happen. (When it is detected, tracee is continued and this bit is cleared.) - */ -# define TCB_WAITEXECVE 0x80 -#endif +#define TCB_REPRINT 0x10 /* We should reprint this syscall on exit */ +#define TCB_FILTERED 0x20 /* This system call has been filtered out */ +#define TCB_TAMPERED 0x40 /* A syscall has been tampered with */ +#define TCB_HIDE_LOG 0x80 /* We should hide everything (until execve) */ +#define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x100 /* -b execve should skip detach on first execve */ /* qualifier flags */ #define QUAL_TRACE 0x001 /* this system call should be traced */ #define QUAL_ABBREV 0x002 /* abbreviate the structures of this syscall */ #define QUAL_VERBOSE 0x004 /* decode the structures of this syscall */ #define QUAL_RAW 0x008 /* print all args in hex for this syscall */ -#define QUAL_SIGNAL 0x010 /* report events with this signal */ -#define QUAL_READ 0x020 /* dump data read on this file descriptor */ -#define QUAL_WRITE 0x040 /* dump data written to this file descriptor */ -typedef uint8_t qualbits_t; -#define UNDEFINED_SCNO 0x100 /* Used only in tcp->qual_flg */ +#define QUAL_INJECT 0x010 /* tamper with this system call on purpose */ +#define QUAL_SIGNAL 0x100 /* report events with this signal */ +#define QUAL_READ 0x200 /* dump data read from this file descriptor */ +#define QUAL_WRITE 0x400 /* dump data written to this file descriptor */ #define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE) @@ -506,18 +286,20 @@ typedef uint8_t qualbits_t; #define verbose(tcp) ((tcp)->qual_flg & QUAL_VERBOSE) #define abbrev(tcp) ((tcp)->qual_flg & QUAL_ABBREV) #define filtered(tcp) ((tcp)->flags & TCB_FILTERED) +#define hide_log(tcp) ((tcp)->flags & TCB_HIDE_LOG) -struct xlat { - int val; - const char *str; -}; -#define XLAT(x) { x, #x } -#define XLAT_END { 0, NULL } +#include "xlat.h" -extern const struct xlat open_mode_flags[]; extern const struct xlat addrfams[]; -extern const struct xlat struct_user_offsets[]; +extern const struct xlat at_flags[]; +extern const struct xlat dirent_types[]; +extern const struct xlat evdev_abs[]; +extern const struct xlat msg_flags[]; extern const struct xlat open_access_modes[]; +extern const struct xlat open_mode_flags[]; +extern const struct xlat resource_flags[]; +extern const struct xlat sg_io_info[]; +extern const struct xlat socketlayers[]; extern const struct xlat whence_codes[]; /* Format of syscall return values */ @@ -525,30 +307,52 @@ extern const struct xlat whence_codes[]; #define RVAL_HEX 001 /* hex format */ #define RVAL_OCTAL 002 /* octal format */ #define RVAL_UDECIMAL 003 /* unsigned decimal format */ -#if defined(LINUX_MIPSN32) || defined(X32) -# if 0 /* unused so far */ -# define RVAL_LDECIMAL 004 /* long decimal format */ -# define RVAL_LHEX 005 /* long hex format */ -# define RVAL_LOCTAL 006 /* long octal format */ -# endif -# define RVAL_LUDECIMAL 007 /* long unsigned decimal format */ -#endif #define RVAL_FD 010 /* file descriptor */ -#define RVAL_MASK 017 /* mask for these values */ +#define RVAL_MASK 013 /* mask for these values */ #define RVAL_STR 020 /* Print `auxstr' field after return val */ #define RVAL_NONE 040 /* Print nothing */ -#define TRACE_FILE 001 /* Trace file-related syscalls. */ -#define TRACE_IPC 002 /* Trace IPC-related syscalls. */ -#define TRACE_NETWORK 004 /* Trace network-related syscalls. */ -#define TRACE_PROCESS 010 /* Trace process-related syscalls. */ -#define TRACE_SIGNAL 020 /* Trace signal-related syscalls. */ -#define TRACE_DESC 040 /* Trace file descriptor-related syscalls. */ -#define TRACE_MEMORY 0100 /* Trace memory mapping-related syscalls. */ -#define SYSCALL_NEVER_FAILS 0200 /* Syscall is always successful. */ -#define STACKTRACE_INVALIDATE_CACHE 0400 /* Trigger proc/maps cache updating */ -#define STACKTRACE_CAPTURE_ON_ENTER 01000 /* Capture stacktrace on "entering" stage */ +#define RVAL_DECODED 0100 /* syscall decoding finished */ + +#define IOCTL_NUMBER_UNKNOWN 0 +#define IOCTL_NUMBER_HANDLED 1 +#define IOCTL_NUMBER_STOP_LOOKUP 010 + +#define indirect_ipccall(tcp) (tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL) + +#if defined(ARM) || defined(AARCH64) \ + || defined(I386) || defined(X32) || defined(X86_64) \ + || defined(IA64) \ + || defined(BFIN) \ + || defined(M68K) \ + || defined(MICROBLAZE) \ + || defined(RISCV) \ + || defined(S390) \ + || defined(SH) || defined(SH64) \ + || defined(SPARC) || defined(SPARC64) \ + /**/ +# define NEED_UID16_PARSERS 1 +#else +# define NEED_UID16_PARSERS 0 +#endif + +enum sock_proto { + SOCK_PROTO_UNKNOWN, + SOCK_PROTO_UNIX, + SOCK_PROTO_TCP, + SOCK_PROTO_UDP, + SOCK_PROTO_TCPv6, + SOCK_PROTO_UDPv6, + SOCK_PROTO_NETLINK +}; +extern enum sock_proto get_proto_by_name(const char *); + +enum iov_decode { + IOV_DECODE_ADDR, + IOV_DECODE_STR, + IOV_DECODE_NETLINK +}; typedef enum { CFLAG_NONE = 0, @@ -563,11 +367,9 @@ extern bool count_wallclock; extern unsigned int qflag; extern bool not_failing_only; extern unsigned int show_fd_path; -extern bool hide_log_until_execve; /* are we filtering traces based on paths? */ extern const char **paths_selected; #define tracing_paths (paths_selected != NULL) -extern bool need_fork_exec_workarounds; extern unsigned xflag; extern unsigned followfork; #ifdef USE_LIBUNWIND @@ -580,149 +382,267 @@ extern unsigned os_release; #undef KERNEL_VERSION #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -enum bitness_t { BITNESS_CURRENT = 0, BITNESS_32 }; - -void error_msg(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); -void perror_msg(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); -void error_msg_and_die(const char *fmt, ...) __attribute__ ((noreturn, format(printf, 1, 2))); -void perror_msg_and_die(const char *fmt, ...) __attribute__ ((noreturn, format(printf, 1, 2))); -void die_out_of_memory(void) __attribute__ ((noreturn)); - -#if USE_CUSTOM_PRINTF -/* - * See comment in vsprintf.c for allowed formats. - * Short version: %h[h]u, %zu, %tu are not allowed, use %[l[l]]u. - */ -int strace_vfprintf(FILE *fp, const char *fmt, va_list args); -#else -# define strace_vfprintf vfprintf -#endif +void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); +void perror_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); +void error_msg_and_die(const char *fmt, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +void error_msg_and_help(const char *fmt, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +void perror_msg_and_die(const char *fmt, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +void die_out_of_memory(void) ATTRIBUTE_NORETURN; + +void *xmalloc(size_t size) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)); +void *xcalloc(size_t nmemb, size_t size) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2)); +void *xreallocarray(void *ptr, size_t nmemb, size_t size) + ATTRIBUTE_ALLOC_SIZE((2, 3)); +char *xstrdup(const char *str) ATTRIBUTE_MALLOC; + +extern int read_int_from_file(const char *, int *); extern void set_sortby(const char *); extern void set_overhead(int); -extern void qualify(const char *); extern void print_pc(struct tcb *); -extern int trace_syscall(struct tcb *); +extern int trace_syscall(struct tcb *, unsigned int *); extern void count_syscall(struct tcb *, const struct timeval *); extern void call_summary(FILE *); -#if defined(AVR32) \ - || defined(I386) \ - || defined(X86_64) || defined(X32) \ - || defined(AARCH64) \ - || defined(ARM) \ - || defined(SPARC) || defined(SPARC64) \ - || defined(TILE) \ - || defined(OR1K) \ - || defined(METAG) \ - || defined(ARC) \ - || defined(POWERPC) -extern long get_regs_error; -# define clear_regs() (get_regs_error = -1) +extern void clear_regs(void); extern void get_regs(pid_t pid); -#else -# define get_regs_error 0 -# define clear_regs() ((void)0) -# define get_regs(pid) ((void)0) -#endif -extern int umoven(struct tcb *, long, int, char *); +extern int get_scno(struct tcb *tcp); +/** + * Convert syscall number to syscall name. + * + * @param scno Syscall number. + * @return String literal corresponding to the syscall number in case latter + * is valid; NULL otherwise. + */ +extern const char *syscall_name(kernel_ulong_t scno); +extern const char *err_name(unsigned long err); + +extern bool is_erestart(struct tcb *); +extern void temporarily_clear_syserror(struct tcb *); +extern void restore_cleared_syserror(struct tcb *); + +extern void *get_tcb_priv_data(const struct tcb *); +extern int set_tcb_priv_data(struct tcb *, void *priv_data, + void (*free_priv_data)(void *)); +extern void free_tcb_priv_data(struct tcb *); + +static inline unsigned long get_tcb_priv_ulong(const struct tcb *tcp) +{ + return (unsigned long) get_tcb_priv_data(tcp); +} + +static inline int set_tcb_priv_ulong(struct tcb *tcp, unsigned long val) +{ + return set_tcb_priv_data(tcp, (void *) val, 0); +} + +extern int +umoven(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, void *laddr); #define umove(pid, addr, objp) \ - umoven((pid), (addr), sizeof(*(objp)), (char *) (objp)) -extern int umovestr(struct tcb *, long, int, char *); -extern int upeek(int pid, long, long *); -#if defined(SPARC) || defined(SPARC64) || defined(IA64) || defined(SH) + umoven((pid), (addr), sizeof(*(objp)), (void *) (objp)) + +extern int +umoven_or_printaddr(struct tcb *tcp, kernel_ulong_t addr, + unsigned int len, void *laddr); +#define umove_or_printaddr(pid, addr, objp) \ + umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp)) + +extern int +umoven_or_printaddr_ignore_syserror(struct tcb *tcp, kernel_ulong_t addr, + unsigned int len, void *laddr); + +extern int +umovestr(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, char *laddr); + +extern int upeek(int pid, unsigned long, kernel_ulong_t *); +extern int upoke(int pid, unsigned long, kernel_ulong_t); + +extern bool +print_array(struct tcb *tcp, + kernel_ulong_t start_addr, + size_t nmemb, + void *elem_buf, + size_t elem_size, + int (*umoven_func)(struct tcb *, + kernel_ulong_t, + unsigned int, + void *), + bool (*print_func)(struct tcb *, + void *elem_buf, + size_t elem_size, + void *opaque_data), + void *opaque_data); + +#if defined ALPHA || defined IA64 || defined MIPS \ + || defined SH || defined SPARC || defined SPARC64 +# define HAVE_GETRVAL2 extern long getrval2(struct tcb *); +#else +# undef HAVE_GETRVAL2 #endif -/* - * On Linux, "setbpt" is a misnomer: we don't set a breakpoint - * (IOW: no poking in user's text segment), - * instead we change fork/vfork/clone into clone(CLONE_PTRACE). - * On newer kernels, we use PTRACE_O_TRACECLONE/TRACE[V]FORK instead. - */ -extern int setbpt(struct tcb *); -extern int clearbpt(struct tcb *); -extern const char *signame(int); +extern const char *signame(const int); extern void pathtrace_select(const char *); extern int pathtrace_match(struct tcb *); extern int getfdpath(struct tcb *, int, char *, unsigned); +extern enum sock_proto getfdproto(struct tcb *, int); -extern const char *xlookup(const struct xlat *, int); +extern const char *xlookup(const struct xlat *, const uint64_t); +extern const char *xlat_search(const struct xlat *, const size_t, const uint64_t); +extern unsigned long get_pagesize(void); +extern int +string_to_uint_ex(const char *str, char **endptr, + unsigned int max_val, const char *accepted_ending); extern int string_to_uint(const char *str); -extern int string_quote(const char *, char *, long, int); +static inline int +string_to_uint_upto(const char *const str, unsigned int max_val) +{ + return string_to_uint_ex(str, NULL, max_val, NULL); +} extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits); +#define QUOTE_0_TERMINATED 0x01 +#define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02 +#define QUOTE_OMIT_TRAILING_0 0x08 +#define QUOTE_FORCE_HEX 0x10 + +extern int string_quote(const char *, char *, unsigned int, unsigned int); +extern int print_quoted_string(const char *, unsigned int, unsigned int); + /* a refers to the lower numbered u_arg, * b refers to the higher numbered u_arg */ -#if HAVE_LITTLE_ENDIAN_LONG_LONG -# define LONG_LONG(a,b) \ - ((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))) +#ifdef WORDS_BIGENDIAN +# define ULONG_LONG(a,b) \ + ((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32)) #else -# define LONG_LONG(a,b) \ - ((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))) -#endif -extern int printllval(struct tcb *, const char *, int); - -extern void printxval(const struct xlat *, int, const char *); +# define ULONG_LONG(a,b) \ + ((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)) +#endif +extern int getllval(struct tcb *, unsigned long long *, int); +extern int printllval(struct tcb *, const char *, int) + ATTRIBUTE_FORMAT((printf, 2, 0)); + +extern void printaddr(kernel_ulong_t addr); +extern int printxvals(const uint64_t, const char *, const struct xlat *, ...) + ATTRIBUTE_SENTINEL; +extern int printxval_searchn(const struct xlat *xlat, size_t xlat_size, + uint64_t val, const char *dflt); +#define printxval_search(xlat__, val__, dflt__) \ + printxval_searchn(xlat__, ARRAY_SIZE(xlat__), val__, dflt__) extern int printargs(struct tcb *); -extern int printargs_lu(struct tcb *); -extern int printargs_ld(struct tcb *); -extern void addflags(const struct xlat *, int); -extern int printflags(const struct xlat *, int, const char *); -extern const char *sprintflags(const char *, const struct xlat *, int); -extern void dumpiov(struct tcb *, int, long); -extern void dumpstr(struct tcb *, long, int); -extern void printstr(struct tcb *, long, long); -extern void printnum(struct tcb *, long, const char *); -extern void printnum_int(struct tcb *, long, const char *); -extern void printpath(struct tcb *, long); -extern void printpathn(struct tcb *, long, int); -#define TIMESPEC_TEXT_BUFSIZE (sizeof(long)*3 * 2 + sizeof("{%u, %u}")) -#define TIMEVAL_TEXT_BUFSIZE TIMESPEC_TEXT_BUFSIZE -extern void printtv_bitness(struct tcb *, long, enum bitness_t, int); -#define printtv(tcp, addr) \ - printtv_bitness((tcp), (addr), BITNESS_CURRENT, 0) -#define printtv_special(tcp, addr) \ - printtv_bitness((tcp), (addr), BITNESS_CURRENT, 1) -extern char *sprinttv(char *, struct tcb *, long, enum bitness_t, int special); -extern void print_timespec(struct tcb *, long); -extern void sprint_timespec(char *, struct tcb *, long); -#ifdef HAVE_SIGINFO_T -extern void printsiginfo(siginfo_t *, int); -extern void printsiginfo_at(struct tcb *tcp, long addr); -#endif +extern int printargs_u(struct tcb *); +extern int printargs_d(struct tcb *); + +extern void addflags(const struct xlat *, uint64_t); +extern int printflags64(const struct xlat *, uint64_t, const char *); +extern const char *sprintflags(const char *, const struct xlat *, uint64_t); +extern const char *sprinttime(time_t); +extern void print_symbolic_mode_t(unsigned int); +extern void print_numeric_umode_t(unsigned short); +extern void print_numeric_long_umask(unsigned long); +extern void print_dev_t(unsigned long long dev); + +extern void +dumpiov_in_msghdr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t data_size); + +extern void +dumpiov_in_mmsghdr(struct tcb *, kernel_ulong_t addr); + +extern void +dumpiov_upto(struct tcb *, int len, kernel_ulong_t addr, kernel_ulong_t data_size); + +extern void +dumpstr(struct tcb *, kernel_ulong_t addr, int len); + +extern void +printstr_ex(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len, + unsigned int user_style); + +extern void +printpathn(struct tcb *, kernel_ulong_t addr, unsigned int n); + +extern void +printpath(struct tcb *, kernel_ulong_t addr); + +#define TIMESPEC_TEXT_BUFSIZE \ + (sizeof(intmax_t)*3 * 2 + sizeof("{tv_sec=%jd, tv_nsec=%jd}")) extern void printfd(struct tcb *, int); +extern void print_sockaddr(struct tcb *tcp, const void *, int); +extern bool print_sockaddr_by_inode(const unsigned long, const enum sock_proto); +extern bool print_sockaddr_by_inode_cached(const unsigned long); extern void print_dirfd(struct tcb *, int); -extern void printsock(struct tcb *, long, int); -extern void print_sock_optmgmt(struct tcb *, long, int); -extern void printrusage(struct tcb *, long); -#ifdef ALPHA -extern void printrusage32(struct tcb *, long); -#endif -extern void printuid(const char *, unsigned long); -extern void print_sigset_addr_len(struct tcb *, long, long); + +extern int +decode_sockaddr(struct tcb *, kernel_ulong_t addr, int addrlen); + +extern void printuid(const char *, const unsigned int); + +extern void +print_sigset_addr_len(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len); + +extern const char *sprintsigmask_n(const char *, const void *, unsigned int); +#define tprintsigmask_addr(prefix, mask) \ + tprints(sprintsigmask_n((prefix), (mask), sizeof(mask))) extern void printsignal(int); -extern void tprint_iov(struct tcb *, unsigned long, unsigned long, int decode_iov); -extern void tprint_iov_upto(struct tcb *, unsigned long, unsigned long, int decode_iov, unsigned long); -extern void tprint_open_modes(mode_t); -extern const char *sprint_open_modes(mode_t); -extern void print_loff_t(struct tcb *, long); - -extern const struct_ioctlent *ioctl_lookup(long); -extern const struct_ioctlent *ioctl_next_match(const struct_ioctlent *); -extern int ioctl_decode(struct tcb *, long, long); -extern int term_ioctl(struct tcb *, long, long); -extern int sock_ioctl(struct tcb *, long, long); -extern int proc_ioctl(struct tcb *, int, int); -extern int rtc_ioctl(struct tcb *, long, long); -extern int scsi_ioctl(struct tcb *, long, long); -extern int block_ioctl(struct tcb *, long, long); -extern int mtd_ioctl(struct tcb *, long, long); -extern int ubi_ioctl(struct tcb *, long, long); -extern int loop_ioctl(struct tcb *, long, long); -extern int ptp_ioctl(struct tcb *, long, long); + +extern void +tprint_iov_upto(struct tcb *, kernel_ulong_t len, kernel_ulong_t addr, + enum iov_decode, kernel_ulong_t data_size); + +extern void +decode_netlink(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len); + +extern void tprint_open_modes(unsigned int); +extern const char *sprint_open_modes(unsigned int); + +extern void +print_seccomp_filter(struct tcb *, kernel_ulong_t addr); + +extern void +print_seccomp_fprog(struct tcb *, kernel_ulong_t addr, unsigned short len); + +struct strace_stat; +extern void print_struct_stat(struct tcb *tcp, const struct strace_stat *const st); + +struct strace_statfs; + +extern void +print_struct_statfs(struct tcb *, kernel_ulong_t addr); + +extern void +print_struct_statfs64(struct tcb *, kernel_ulong_t addr, kernel_ulong_t size); + +extern void print_ifindex(unsigned int); + +struct number_set; +extern struct number_set read_set; +extern struct number_set write_set; +extern struct number_set signal_set; + +extern bool is_number_in_set(unsigned int number, const struct number_set *); +extern void qualify(const char *); +extern unsigned int qual_flags(const unsigned int); + +#define DECL_IOCTL(name) \ +extern int \ +name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg) +DECL_IOCTL(dm); +DECL_IOCTL(file); +DECL_IOCTL(fs_x); +DECL_IOCTL(ptp); +DECL_IOCTL(scsi); +DECL_IOCTL(term); +DECL_IOCTL(ubi); +DECL_IOCTL(uffdio); +#undef DECL_IOCTL + +extern int decode_sg_io_v4(struct tcb *, const kernel_ulong_t arg); extern int tv_nz(const struct timeval *); extern int tv_cmp(const struct timeval *, const struct timeval *); @@ -741,6 +661,60 @@ extern void unwind_print_stacktrace(struct tcb* tcp); extern void unwind_capture_stacktrace(struct tcb* tcp); #endif +static inline void +printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len) +{ + printstr_ex(tcp, addr, len, 0); +} + +static inline void +printstr(struct tcb *tcp, kernel_ulong_t addr) +{ + printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED); +} + +static inline int +printflags(const struct xlat *x, unsigned int flags, const char *dflt) +{ + return printflags64(x, flags, dflt); +} + +static inline int +printxval64(const struct xlat *x, const uint64_t val, const char *dflt) +{ + return printxvals(val, dflt, x, NULL); +} + +static inline int +printxval(const struct xlat *x, const unsigned int val, const char *dflt) +{ + return printxvals(val, dflt, x, NULL); +} + +static inline void +tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr, + enum iov_decode decode_iov) +{ + tprint_iov_upto(tcp, len, addr, decode_iov, -1); +} + +#ifdef ALPHA +typedef struct { + int tv_sec, tv_usec; +} timeval32_t; + +extern void print_timeval32_t(const timeval32_t *); +extern void printrusage32(struct tcb *, kernel_ulong_t); +extern const char *sprint_timeval32(struct tcb *tcp, kernel_ulong_t); +extern void print_timeval32(struct tcb *tcp, kernel_ulong_t); +extern void print_timeval32_pair(struct tcb *tcp, kernel_ulong_t); +extern void print_itimerval32(struct tcb *tcp, kernel_ulong_t); +#endif + +#ifdef HAVE_STRUCT_USER_DESC +extern void print_user_desc(struct tcb *, kernel_ulong_t addr); +#endif + /* Strace log generation machinery. * * printing_tcp: tcb which has incomplete line being printed right now. @@ -762,7 +736,7 @@ extern struct tcb *printing_tcp; extern void printleader(struct tcb *); extern void line_ended(void); extern void tabto(void); -extern void tprintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +extern void tprintf(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); extern void tprints(const char *str); #if SUPPORTED_PERSONALITIES > 1 @@ -775,30 +749,145 @@ extern unsigned current_personality; #if SUPPORTED_PERSONALITIES == 1 # define current_wordsize PERSONALITY0_WORDSIZE +# define current_klongsize PERSONALITY0_KLONGSIZE #else # if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_WORDSIZE == PERSONALITY1_WORDSIZE # define current_wordsize PERSONALITY0_WORDSIZE # else extern unsigned current_wordsize; # endif +# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == PERSONALITY1_KLONGSIZE +# define current_klongsize PERSONALITY0_KLONGSIZE +# else +extern unsigned current_klongsize; +# endif #endif -/* In many, many places we play fast and loose and use - * tprintf("%d", (int) tcp->u_arg[N]) to print fds, pids etc. - * We probably need to use widen_to_long() instead: +#define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG \ + (SIZEOF_KERNEL_LONG_T > 4 \ + && (SIZEOF_LONG < SIZEOF_KERNEL_LONG_T || !defined(current_wordsize))) + +#define DECL_PRINTNUM(name) \ +extern bool \ +printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \ + ATTRIBUTE_FORMAT((printf, 3, 0)) +DECL_PRINTNUM(short); +DECL_PRINTNUM(int); +DECL_PRINTNUM(int64); +#undef DECL_PRINTNUM + +#define DECL_PRINTNUM_ADDR(name) \ +extern bool \ +printnum_addr_ ## name(struct tcb *, kernel_ulong_t addr) +DECL_PRINTNUM_ADDR(int); +DECL_PRINTNUM_ADDR(int64); +#undef DECL_PRINTNUM_ADDR + +#ifndef current_wordsize +extern bool +printnum_long_int(struct tcb *, kernel_ulong_t addr, + const char *fmt_long, const char *fmt_int) + ATTRIBUTE_FORMAT((printf, 3, 0)) + ATTRIBUTE_FORMAT((printf, 4, 0)); +extern bool printnum_addr_long_int(struct tcb *, kernel_ulong_t addr); +# define printnum_slong(tcp, addr) \ + printnum_long_int((tcp), (addr), "%" PRId64, "%d") +# define printnum_ulong(tcp, addr) \ + printnum_long_int((tcp), (addr), "%" PRIu64, "%u") +# define printnum_ptr(tcp, addr) \ + printnum_addr_long_int((tcp), (addr)) +#elif current_wordsize > 4 +# define printnum_slong(tcp, addr) \ + printnum_int64((tcp), (addr), "%" PRId64) +# define printnum_ulong(tcp, addr) \ + printnum_int64((tcp), (addr), "%" PRIu64) +# define printnum_ptr(tcp, addr) \ + printnum_addr_int64((tcp), (addr)) +#else /* current_wordsize == 4 */ +# define printnum_slong(tcp, addr) \ + printnum_int((tcp), (addr), "%d") +# define printnum_ulong(tcp, addr) \ + printnum_int((tcp), (addr), "%u") +# define printnum_ptr(tcp, addr) \ + printnum_addr_int((tcp), (addr)) +#endif + +#ifndef current_klongsize +extern bool printnum_addr_klong_int(struct tcb *, kernel_ulong_t addr); +# define printnum_kptr(tcp, addr) \ + printnum_addr_klong_int((tcp), (addr)) +#elif current_klongsize > 4 +# define printnum_kptr(tcp, addr) \ + printnum_addr_int64((tcp), (addr)) +#else /* current_klongsize == 4 */ +# define printnum_kptr(tcp, addr) \ + printnum_addr_int((tcp), (addr)) +#endif + +#define DECL_PRINTPAIR(name) \ +extern bool \ +printpair_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \ + ATTRIBUTE_FORMAT((printf, 3, 0)) +DECL_PRINTPAIR(int); +DECL_PRINTPAIR(int64); +#undef DECL_PRINTPAIR + +static inline kernel_long_t +truncate_klong_to_current_wordsize(const kernel_long_t v) +{ +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + if (current_wordsize < sizeof(v)) { + return (int) v; + } else +#endif + { + return v; + } +} + +static inline kernel_ulong_t +truncate_kulong_to_current_wordsize(const kernel_ulong_t v) +{ +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + if (current_wordsize < sizeof(v)) { + return (unsigned int) v; + } else +#endif + { + return v; + } +} + +/* + * Cast a pointer or a pointer-sized integer to kernel_ulong_t. */ -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 -# define widen_to_long(v) (current_wordsize == 4 ? (long)(int32_t)(v) : (long)(v)) -#else -# define widen_to_long(v) ((long)(v)) -#endif +#define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v)) + +/* + * Zero-extend a signed integer type to unsigned long long. + */ +#define zero_extend_signed_to_ull(v) \ + (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ + sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ + sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ + sizeof(v) == sizeof(long) ? (unsigned long long) (unsigned long) (v) : \ + (unsigned long long) (v)) + +/* + * Sign-extend an unsigned integer type to long long. + */ +#define sign_extend_unsigned_to_ll(v) \ + (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ + sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ + sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ + sizeof(v) == sizeof(long) ? (long long) (long) (v) : \ + (long long) (v)) extern const struct_sysent sysent0[]; extern const char *const errnoent0[]; extern const char *const signalent0[]; extern const struct_ioctlent ioctlent0[]; -extern qualbits_t *qual_vec[SUPPORTED_PERSONALITIES]; -#define qual_flags (qual_vec[current_personality]) + #if SUPPORTED_PERSONALITIES > 1 extern const struct_sysent *sysent; extern const char *const *errnoent; @@ -810,18 +899,84 @@ extern const struct_ioctlent *ioctlent; # define signalent signalent0 # define ioctlent ioctlent0 #endif + extern unsigned nsyscalls; extern unsigned nerrnos; extern unsigned nsignals; extern unsigned nioctlents; -extern unsigned num_quals; + +extern const unsigned int nsyscall_vec[SUPPORTED_PERSONALITIES]; +extern const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES]; +extern struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES]; + +#ifdef IN_MPERS_BOOTSTRAP +/* Transform multi-line MPERS_PRINTER_DECL statements to one-liners. */ +# define MPERS_PRINTER_DECL(type, name, ...) MPERS_PRINTER_DECL(type, name, __VA_ARGS__) +#else /* !IN_MPERS_BOOTSTRAP */ +# if SUPPORTED_PERSONALITIES > 1 +# include "printers.h" +# else +# include "native_printer_decls.h" +# endif +# define MPERS_PRINTER_DECL(type, name, ...) type MPERS_FUNC_NAME(name)(__VA_ARGS__) +#endif /* !IN_MPERS_BOOTSTRAP */ + +/* Checks that sysent[scno] is not out of range. */ +static inline bool +scno_in_range(kernel_ulong_t scno) +{ + return scno < nsyscalls; +} + +/* + * Checks whether scno is not out of range, + * its corresponding sysent[scno].sys_func is non-NULL, + * and its sysent[scno].sys_flags has no TRACE_INDIRECT_SUBCALL flag set. + */ +static inline bool +scno_is_valid(kernel_ulong_t scno) +{ + return scno_in_range(scno) + && sysent[scno].sys_func + && !(sysent[scno].sys_flags & TRACE_INDIRECT_SUBCALL); +} + +#define MPERS_FUNC_NAME__(prefix, name) prefix ## name +#define MPERS_FUNC_NAME_(prefix, name) MPERS_FUNC_NAME__(prefix, name) +#define MPERS_FUNC_NAME(name) MPERS_FUNC_NAME_(MPERS_PREFIX, name) + +#define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name) + +#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp) + +#if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG +# define PRI_kl "ll" +#else +# define PRI_kl "l" +#endif + +#define PRI_kld PRI_kl"d" +#define PRI_klu PRI_kl"u" +#define PRI_klx PRI_kl"x" /* - * If you need non-NULL sysent[scno].sys_func and sysent[scno].sys_name + * The kernel used to define 64-bit types on 64-bit systems on a per-arch + * basis. Some architectures would use unsigned long and others would use + * unsigned long long. These types were exported as part of the + * kernel-userspace ABI and now must be maintained forever. This matches + * what the kernel exports for each architecture so we don't need to cast + * every printing of __u64 or __s64 to stdint types. */ -#define SCNO_IS_VALID(scno) \ - ((unsigned long)(scno) < nsyscalls && sysent[scno].sys_func) +#if SIZEOF_LONG == 4 +# define PRI__64 "ll" +#elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC +# define PRI__64 "l" +#else +# define PRI__64 "ll" +#endif + +#define PRI__d64 PRI__64"d" +#define PRI__u64 PRI__64"u" +#define PRI__x64 PRI__64"x" -/* Only ensures that sysent[scno] isn't out of range */ -#define SCNO_IN_RANGE(scno) \ - ((unsigned long)(scno) < nsyscalls) +#endif /* !STRACE_DEFS_H */ diff --git a/desc.c b/desc.c index 5b8869bc..48824697 100644 --- a/desc.c +++ b/desc.c @@ -29,303 +29,63 @@ */ #include "defs.h" -#include -#include -#ifdef HAVE_SYS_EPOLL_H -# include -#endif -#ifdef HAVE_LINUX_PERF_EVENT_H -# include -#endif - -#include "xlat/fcntlcmds.h" -#include "xlat/fdflags.h" -#include "xlat/flockcmds.h" -#include "xlat/lockfcmds.h" -#include "xlat/notifyflags.h" -#include "xlat/perf_event_open_flags.h" - -/* - * Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined - * or not defined altogether. - */ -#if defined(F_SETLK64) && F_SETLK64 + 0 != F_SETLK -# define USE_PRINTFLOCK64 1 -#else -# define USE_PRINTFLOCK64 0 -#endif - -#if USE_PRINTFLOCK64 -# ifndef HAVE_STRUCT_FLOCK64 -struct flock64 { - short int l_type, l_whence; - int64_t l_start, l_len; - int l_pid; -}; -# endif - -static void -printflock64(struct tcb *tcp, long addr, int getlk) +SYS_FUNC(close) { - struct flock64 fl; + printfd(tcp, tcp->u_arg[0]); - if (umove(tcp, addr, &fl) < 0) { - tprints("{...}"); - return; - } - tprints("{type="); - printxval(lockfcmds, fl.l_type, "F_???"); - tprints(", whence="); - printxval(whence_codes, fl.l_whence, "SEEK_???"); - tprintf(", start=%lld, len=%lld", (long long) fl.l_start, (long long) fl.l_len); - if (getlk) - tprintf(", pid=%lu}", (unsigned long) fl.l_pid); - else - tprints("}"); + return RVAL_DECODED; } -#endif /* USE_PRINTFLOCK64 */ -static void -printflock(struct tcb *tcp, long addr, int getlk) +SYS_FUNC(dup) { - struct flock fl; - int r; + printfd(tcp, tcp->u_arg[0]); -#if SUPPORTED_PERSONALITIES > 1 - if ( -# if SIZEOF_OFF_T > SIZEOF_LONG - current_personality > 0 && -#endif - current_wordsize != sizeof(fl.l_start)) { - if (current_wordsize == 4) { - /* 32-bit x86 app on x86_64 and similar cases */ - struct { - short int l_type; - short int l_whence; - int32_t l_start; /* off_t */ - int32_t l_len; /* off_t */ - int32_t l_pid; /* pid_t */ - } fl32; - r = umove(tcp, addr, &fl32); - if (r >= 0) { - fl.l_type = fl32.l_type; - fl.l_whence = fl32.l_whence; - fl.l_start = fl32.l_start; - fl.l_len = fl32.l_len; - fl.l_pid = fl32.l_pid; - } - } else { - /* let people know we have a problem here */ - tprintf("", - current_wordsize); - return; - } - } else -#endif - { - r = umove(tcp, addr, &fl); - } - if (r < 0) { - tprints("{...}"); - return; - } - tprints("{type="); - printxval(lockfcmds, fl.l_type, "F_???"); - tprints(", whence="); - printxval(whence_codes, fl.l_whence, "SEEK_???"); -#if SIZEOF_OFF_T > SIZEOF_LONG - tprintf(", start=%lld, len=%lld", fl.l_start, fl.l_len); -#else - tprintf(", start=%ld, len=%ld", fl.l_start, fl.l_len); -#endif - if (getlk) - tprintf(", pid=%lu}", (unsigned long) fl.l_pid); - else - tprints("}"); -} - -int -sys_fcntl(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printxval(fcntlcmds, tcp->u_arg[1], "F_???"); - switch (tcp->u_arg[1]) { - case F_SETFD: - tprints(", "); - printflags(fdflags, tcp->u_arg[2], "FD_???"); - break; - case F_SETOWN: case F_DUPFD: -#ifdef F_DUPFD_CLOEXEC - case F_DUPFD_CLOEXEC: -#endif - tprintf(", %ld", tcp->u_arg[2]); - break; - case F_SETFL: - tprints(", "); - tprint_open_modes(tcp->u_arg[2]); - break; - case F_SETLK: case F_SETLKW: - tprints(", "); - printflock(tcp, tcp->u_arg[2], 0); - break; -#if USE_PRINTFLOCK64 - case F_SETLK64: case F_SETLKW64: - tprints(", "); - printflock64(tcp, tcp->u_arg[2], 0); - break; -#endif /* USE_PRINTFLOCK64 */ -#ifdef F_NOTIFY - case F_NOTIFY: - tprints(", "); - printflags(notifyflags, tcp->u_arg[2], "DN_???"); - break; -#endif -#ifdef F_SETLEASE - case F_SETLEASE: - tprints(", "); - printxval(lockfcmds, tcp->u_arg[2], "F_???"); - break; -#endif - } - } - else { - switch (tcp->u_arg[1]) { - case F_DUPFD: -#ifdef F_DUPFD_CLOEXEC - case F_DUPFD_CLOEXEC: -#endif - case F_SETFD: case F_SETFL: - case F_SETLK: case F_SETLKW: - case F_SETOWN: case F_GETOWN: -#ifdef F_NOTIFY - case F_NOTIFY: -#endif -#ifdef F_SETLEASE - case F_SETLEASE: -#endif - break; - case F_GETFD: - if (syserror(tcp) || tcp->u_rval == 0) - return 0; - tcp->auxstr = sprintflags("flags ", fdflags, tcp->u_rval); - return RVAL_HEX|RVAL_STR; - case F_GETFL: - if (syserror(tcp)) - return 0; - tcp->auxstr = sprint_open_modes(tcp->u_rval); - return RVAL_HEX|RVAL_STR; - case F_GETLK: - tprints(", "); - printflock(tcp, tcp->u_arg[2], 1); - break; -#if USE_PRINTFLOCK64 - case F_GETLK64: - tprints(", "); - printflock64(tcp, tcp->u_arg[2], 1); - break; -#endif -#ifdef F_GETLEASE - case F_GETLEASE: - if (syserror(tcp)) - return 0; - tcp->auxstr = xlookup(lockfcmds, tcp->u_rval); - return RVAL_HEX|RVAL_STR; -#endif - default: - tprintf(", %#lx", tcp->u_arg[2]); - break; - } - } - return 0; -} - -#ifdef LOCK_SH - -int -sys_flock(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printflags(flockcmds, tcp->u_arg[1], "LOCK_???"); - } - return 0; -} -#endif /* LOCK_SH */ - -int -sys_close(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - } - return 0; -} - -int -sys_dup(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - } - return RVAL_FD; + return RVAL_DECODED | RVAL_FD; } static int do_dup2(struct tcb *tcp, int flags_arg) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printfd(tcp, tcp->u_arg[1]); + if (flags_arg >= 0) { tprints(", "); - printfd(tcp, tcp->u_arg[1]); - if (flags_arg >= 0) { - tprints(", "); - printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???"); - } + printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???"); } - return RVAL_FD; + + return RVAL_DECODED | RVAL_FD; } -int -sys_dup2(struct tcb *tcp) +SYS_FUNC(dup2) { return do_dup2(tcp, -1); } -int -sys_dup3(struct tcb *tcp) +SYS_FUNC(dup3) { return do_dup2(tcp, 2); } -#if defined(ALPHA) -int -sys_getdtablesize(struct tcb *tcp) -{ - return 0; -} -#endif - static int -decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) +decode_select(struct tcb *const tcp, const kernel_ulong_t *const args, + void (*const print_tv_ts) (struct tcb *, kernel_ulong_t), + const char * (*const sprint_tv_ts) (struct tcb *, kernel_ulong_t)) { int i, j; int nfds, fdsize; - fd_set *fds; + fd_set *fds = NULL; const char *sep; - long arg; + kernel_ulong_t addr; - /* Kernel truncates arg[0] to int, we do the same. */ + /* Kernel truncates args[0] to int, we do the same. */ nfds = (int) args[0]; /* Kernel rejects negative nfds, so we don't parse it either. */ - if (nfds < 0) { + if (nfds < 0) nfds = 0; - fds = NULL; - } + /* Beware of select(2^31-1, NULL, NULL, NULL) and similar... */ if (nfds > 1024*1024) nfds = 1024*1024; @@ -339,26 +99,18 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) if (entering(tcp)) { tprintf("%d", (int) args[0]); - if (fdsize > 0) { + if (verbose(tcp) && fdsize > 0) fds = malloc(fdsize); - if (!fds) - die_out_of_memory(); - } for (i = 0; i < 3; i++) { - arg = args[i+1]; - if (arg == 0) { - tprints(", NULL"); - continue; - } - if (!verbose(tcp) || !fds) { - tprintf(", %#lx", arg); + addr = args[i+1]; + tprints(", "); + if (!fds) { + printaddr(addr); continue; } - if (umoven(tcp, arg, fdsize, (char *) fds) < 0) { - tprints(", [?]"); + if (umoven_or_printaddr(tcp, addr, fdsize, fds)) continue; - } - tprints(", ["); + tprints("["); for (j = 0, sep = "";; j++) { j = next_set_bit(fds, j, nfds); if (j < 0) @@ -371,9 +123,8 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) } free(fds); tprints(", "); - printtv_bitness(tcp, args[4], bitness, 0); - } - else { + print_tv_ts(tcp, args[4]); + } else { static char outstr[1024]; char *outptr; #define end_outstr (outstr + sizeof(outstr)) @@ -389,16 +140,14 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) } fds = malloc(fdsize); - if (!fds) - die_out_of_memory(); outptr = outstr; sep = ""; for (i = 0; i < 3 && ready_fds > 0; i++) { int first = 1; - arg = args[i+1]; - if (!arg || umoven(tcp, arg, fdsize, (char *) fds) < 0) + addr = args[i+1]; + if (!addr || !fds || umoven(tcp, addr, fdsize, fds) < 0) continue; for (j = 0;; j++) { j = next_set_bit(fds, j, nfds); @@ -428,9 +177,9 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) free(fds); /* This contains no useful information on SunOS. */ if (args[4]) { - if (outptr < end_outstr - (10 + TIMEVAL_TEXT_BUFSIZE)) { - outptr += sprintf(outptr, "%sleft ", sep); - outptr = sprinttv(outptr, tcp, args[4], bitness, /*special:*/ 0); + const char *str = sprint_tv_ts(tcp, args[4]); + if (outptr + sizeof("left ") + strlen(sep) + strlen(str) < end_outstr) { + outptr += sprintf(outptr, "%sleft %s", sep, str); } } *outptr = '\0'; @@ -441,225 +190,77 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) return 0; } -int -sys_oldselect(struct tcb *tcp) -{ - long args[5]; - - if (umoven(tcp, tcp->u_arg[0], sizeof args, (char *) args) < 0) { - tprints("[...]"); - return 0; - } - return decode_select(tcp, args, BITNESS_CURRENT); -} - -#ifdef ALPHA -int -sys_osf_select(struct tcb *tcp) -{ - long *args = tcp->u_arg; - return decode_select(tcp, args, BITNESS_32); -} -#endif - -#include "xlat/epollctls.h" -#include "xlat/epollevents.h" -#include "xlat/epollflags.h" - -/* Not aliased to printargs_ld: we want it to have a distinct address */ -int -sys_epoll_create(struct tcb *tcp) -{ - return printargs_ld(tcp); -} - -int -sys_epoll_create1(struct tcb *tcp) +SYS_FUNC(oldselect) { - if (entering(tcp)) - printflags(epollflags, tcp->u_arg[0], "EPOLL_???"); - return 0; -} + kernel_ulong_t select_args[5]; + unsigned int oldselect_args[5]; -#ifdef HAVE_SYS_EPOLL_H -static void -print_epoll_event(struct epoll_event *ev) -{ - tprints("{"); - printflags(epollevents, ev->events, "EPOLL???"); - /* We cannot know what format the program uses, so print u32 and u64 - which will cover every value. */ - tprintf(", {u32=%" PRIu32 ", u64=%" PRIu64 "}}", - ev->data.u32, ev->data.u64); -} -#endif - -int -sys_epoll_ctl(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printxval(epollctls, tcp->u_arg[1], "EPOLL_CTL_???"); - tprints(", "); - printfd(tcp, tcp->u_arg[2]); - tprints(", "); - if (tcp->u_arg[3] == 0) - tprints("NULL"); - else { -#ifdef HAVE_SYS_EPOLL_H - struct epoll_event ev; - if ( -#ifdef EPOLL_CTL_DEL - (tcp->u_arg[1] != EPOLL_CTL_DEL) && -#endif - umove(tcp, tcp->u_arg[3], &ev) == 0) - print_epoll_event(&ev); - else -#endif - tprintf("%lx", tcp->u_arg[3]); + if (sizeof(*select_args) == sizeof(*oldselect_args)) { + if (umove_or_printaddr(tcp, tcp->u_arg[0], &select_args)) { + return 0; } - } - return 0; -} - -static void -epoll_wait_common(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); } else { - if (syserror(tcp)) - tprintf("%lx", tcp->u_arg[1]); - else if (tcp->u_rval == 0) - tprints("{}"); - else { -#ifdef HAVE_SYS_EPOLL_H - struct epoll_event ev, *start, *cur, *end; - int failed = 0; + unsigned int i; - tprints("{"); - start = (struct epoll_event *) tcp->u_arg[1]; - end = start + tcp->u_rval; - for (cur = start; cur < end; ++cur) { - if (cur > start) - tprints(", "); - if (umove(tcp, (long) cur, &ev) == 0) - print_epoll_event(&ev); - else { - tprints("?"); - failed = 1; - break; - } - } - tprints("}"); - if (failed) - tprintf(" %#lx", (long) start); -#else - tprints("{...}"); -#endif + if (umove_or_printaddr(tcp, tcp->u_arg[0], &oldselect_args)) { + return 0; + } + + for (i = 0; i < 5; ++i) { + select_args[i] = oldselect_args[i]; } - tprintf(", %d, %d", (int) tcp->u_arg[2], (int) tcp->u_arg[3]); } -} -int -sys_epoll_wait(struct tcb *tcp) -{ - epoll_wait_common(tcp); - return 0; + return decode_select(tcp, select_args, print_timeval, sprint_timeval); } -int -sys_epoll_pwait(struct tcb *tcp) +#ifdef ALPHA +SYS_FUNC(osf_select) { - epoll_wait_common(tcp); - if (exiting(tcp)) { - tprints(", "); - /* NB: kernel requires arg[5] == NSIG / 8 */ - print_sigset_addr_len(tcp, tcp->u_arg[4], tcp->u_arg[5]); - tprintf(", %lu", tcp->u_arg[5]); - } - return 0; + return decode_select(tcp, tcp->u_arg, print_timeval32, sprint_timeval32); } +#endif -int -sys_select(struct tcb *tcp) +SYS_FUNC(select) { - return decode_select(tcp, tcp->u_arg, BITNESS_CURRENT); + return decode_select(tcp, tcp->u_arg, print_timeval, sprint_timeval); } -int -sys_pselect6(struct tcb *tcp) +static int +umove_kulong_array_or_printaddr(struct tcb *const tcp, const kernel_ulong_t addr, + kernel_ulong_t *const ptr, const size_t n) { - int rc = decode_select(tcp, tcp->u_arg, BITNESS_CURRENT); - if (entering(tcp)) { - long r; - struct { - unsigned long ptr; - unsigned long len; - } data; -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize == 4) { - struct { - uint32_t ptr; - uint32_t len; - } data32; - r = umove(tcp, tcp->u_arg[5], &data32); - data.ptr = data32.ptr; - data.len = data32.len; - } else -#endif - r = umove(tcp, tcp->u_arg[5], &data); - if (r < 0) - tprintf(", %#lx", tcp->u_arg[5]); - else { - tprints(", {"); - /* NB: kernel requires data.len == NSIG / 8 */ - print_sigset_addr_len(tcp, data.ptr, data.len); - tprintf(", %lu}", data.len); +#ifndef current_klongsize + if (current_klongsize < sizeof(*ptr)) { + uint32_t ptr32[n]; + int r = umove_or_printaddr(tcp, addr, &ptr32); + if (!r) { + size_t i; + + for (i = 0; i < n; ++i) + ptr[i] = ptr32[i]; } + return r; } - return rc; +#endif /* !current_klongsize */ + return umoven_or_printaddr(tcp, addr, n * sizeof(*ptr), ptr); } -static int -do_eventfd(struct tcb *tcp, int flags_arg) +SYS_FUNC(pselect6) { + int rc = decode_select(tcp, tcp->u_arg, print_timespec, sprint_timespec); if (entering(tcp)) { - tprintf("%lu", tcp->u_arg[0]); - if (flags_arg >= 0) { - tprints(", "); - printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???"); + kernel_ulong_t data[2]; + + tprints(", "); + if (!umove_kulong_array_or_printaddr(tcp, tcp->u_arg[5], + data, ARRAY_SIZE(data))) { + tprints("{"); + /* NB: kernel requires data[1] == NSIG_BYTES */ + print_sigset_addr_len(tcp, data[0], data[1]); + tprintf(", %" PRI_klu "}", data[1]); } } - return 0; -} -int -sys_eventfd(struct tcb *tcp) -{ - return do_eventfd(tcp, -1); -} - -int -sys_eventfd2(struct tcb *tcp) -{ - return do_eventfd(tcp, 1); -} - -int -sys_perf_event_open(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%#lx, %d, %d, %d, ", - tcp->u_arg[0], - (int) tcp->u_arg[1], - (int) tcp->u_arg[2], - (int) tcp->u_arg[3]); - printflags(perf_event_open_flags, tcp->u_arg[4], - "PERF_FLAG_???"); - } - return 0; + return rc; } diff --git a/dirent.c b/dirent.c new file mode 100644 index 00000000..2ba6fe7a --- /dev/null +++ b/dirent.c @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(kernel_dirent) + +#include MPERS_DEFS + +#define D_NAME_LEN_MAX 256 + +static void +print_old_dirent(struct tcb *const tcp, const kernel_ulong_t addr) +{ + kernel_dirent d; + + if (umove_or_printaddr(tcp, addr, &d)) + return; + + tprintf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=", + zero_extend_signed_to_ull(d.d_ino), + zero_extend_signed_to_ull(d.d_off), d.d_reclen); + if (d.d_reclen > D_NAME_LEN_MAX) + d.d_reclen = D_NAME_LEN_MAX; + printpathn(tcp, addr + offsetof(kernel_dirent, d_name), d.d_reclen); + tprints("}"); +} + +SYS_FUNC(readdir) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + if (tcp->u_rval == 0) + printaddr(tcp->u_arg[1]); + else + print_old_dirent(tcp, tcp->u_arg[1]); + /* Not much point in printing this out, it is always 1. */ + if (tcp->u_arg[2] != 1) + tprintf(", %" PRI_klu, tcp->u_arg[2]); + } + return 0; +} + +SYS_FUNC(getdents) +{ + unsigned int i, len, dents = 0; + unsigned char *buf; + + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + return 0; + } + + const unsigned int count = tcp->u_arg[2]; + + if (syserror(tcp) || !verbose(tcp)) { + printaddr(tcp->u_arg[1]); + tprintf(", %u", count); + return 0; + } + + /* Beware of insanely large or too small values in tcp->u_rval */ + if (tcp->u_rval > 1024*1024) + len = 1024*1024; + else if (tcp->u_rval < (int) sizeof(kernel_dirent)) + len = 0; + else + len = tcp->u_rval; + + if (len) { + buf = malloc(len); + if (!buf || umoven(tcp, tcp->u_arg[1], len, buf) < 0) { + printaddr(tcp->u_arg[1]); + tprintf(", %u", count); + free(buf); + return 0; + } + } else { + buf = NULL; + } + + if (!abbrev(tcp)) + tprints("["); + for (i = 0; len && i <= len - sizeof(kernel_dirent); ) { + kernel_dirent *d = (kernel_dirent *) &buf[i]; + + if (!abbrev(tcp)) { + int oob = d->d_reclen < sizeof(kernel_dirent) || + i + d->d_reclen - 1 >= len; + int d_name_len = oob ? len - i : d->d_reclen; + d_name_len -= offsetof(kernel_dirent, d_name) + 1; + if (d_name_len > D_NAME_LEN_MAX) + d_name_len = D_NAME_LEN_MAX; + + tprintf("%s{d_ino=%llu, d_off=%llu, d_reclen=%u" + ", d_name=", i ? ", " : "", + zero_extend_signed_to_ull(d->d_ino), + zero_extend_signed_to_ull(d->d_off), + d->d_reclen); + + if (print_quoted_string(d->d_name, d_name_len, + QUOTE_0_TERMINATED) > 0) { + tprints("..."); + } + + tprints(", d_type="); + if (oob) + tprints("?"); + else + printxval(dirent_types, buf[i + d->d_reclen - 1], "DT_???"); + tprints("}"); + } + dents++; + if (d->d_reclen < sizeof(kernel_dirent)) { + tprints("/* d_reclen < sizeof(struct dirent) */"); + break; + } + i += d->d_reclen; + } + if (!abbrev(tcp)) + tprints("]"); + else + tprintf("/* %u entries */", dents); + tprintf(", %u", count); + free(buf); + return 0; +} diff --git a/dirent64.c b/dirent64.c new file mode 100644 index 00000000..448a2f1a --- /dev/null +++ b/dirent64.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +#include "xlat/dirent_types.h" + +#define D_NAME_LEN_MAX 256 + +SYS_FUNC(getdents64) +{ + /* the minimum size of a valid dirent64 structure */ + const unsigned int d_name_offset = offsetof(struct dirent64, d_name); + + unsigned int i, len, dents = 0; + char *buf; + + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + return 0; + } + + const unsigned int count = tcp->u_arg[2]; + + if (syserror(tcp) || !verbose(tcp)) { + printaddr(tcp->u_arg[1]); + tprintf(", %u", count); + return 0; + } + + /* Beware of insanely large or too small values in tcp->u_rval */ + if (tcp->u_rval > 1024*1024) + len = 1024*1024; + else if (tcp->u_rval < (int) d_name_offset) + len = 0; + else + len = tcp->u_rval; + + if (len) { + buf = malloc(len); + if (!buf || umoven(tcp, tcp->u_arg[1], len, buf) < 0) { + printaddr(tcp->u_arg[1]); + tprintf(", %u", count); + free(buf); + return 0; + } + } else { + buf = NULL; + } + + if (!abbrev(tcp)) + tprints("["); + for (i = 0; len && i <= len - d_name_offset; ) { + struct dirent64 *d = (struct dirent64 *) &buf[i]; + if (!abbrev(tcp)) { + int d_name_len; + if (d->d_reclen >= d_name_offset + && i + d->d_reclen <= len) { + d_name_len = d->d_reclen - d_name_offset; + } else { + d_name_len = len - i - d_name_offset; + } + if (d_name_len > D_NAME_LEN_MAX) + d_name_len = D_NAME_LEN_MAX; + + tprintf("%s{d_ino=%" PRIu64 ", d_off=%" PRId64 + ", d_reclen=%u, d_type=", + i ? ", " : "", + d->d_ino, + d->d_off, + d->d_reclen); + printxval(dirent_types, d->d_type, "DT_???"); + + tprints(", d_name="); + if (print_quoted_string(d->d_name, d_name_len, + QUOTE_0_TERMINATED) > 0) { + tprints("..."); + } + + tprints("}"); + } + if (d->d_reclen < d_name_offset) { + tprints("/* d_reclen < offsetof(struct dirent64, d_name) */"); + break; + } + i += d->d_reclen; + dents++; + } + if (!abbrev(tcp)) + tprints("]"); + else + tprintf("/* %u entries */", dents); + tprintf(", %u", count); + free(buf); + return 0; +} diff --git a/dm.c b/dm.c new file mode 100644 index 00000000..7f856895 --- /dev/null +++ b/dm.c @@ -0,0 +1,587 @@ +/* + * Support for decoding of DM_* ioctl commands. + * + * Copyright (c) 2016 Mikulas Patocka + * Copyright (c) 2016 Masatake Yamato + * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_DM_IOCTL_H + +# include +# include + +# if DM_VERSION_MAJOR == 4 + +/* Definitions for command which have been added later */ + +# ifndef DM_LIST_VERSIONS +# define DM_LIST_VERSIONS _IOWR(DM_IOCTL, 0xd, struct dm_ioctl) +# endif +# ifndef DM_TARGET_MSG +# define DM_TARGET_MSG _IOWR(DM_IOCTL, 0xe, struct dm_ioctl) +# endif +# ifndef DM_DEV_SET_GEOMETRY +# define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0xf, struct dm_ioctl) +# endif + + +static void +dm_decode_device(const unsigned int code, const struct dm_ioctl *ioc) +{ + switch (code) { + case DM_REMOVE_ALL: + case DM_LIST_DEVICES: + case DM_LIST_VERSIONS: + break; + default: + if (ioc->dev) { + tprints(", dev="); + print_dev_t(ioc->dev); + } + if (ioc->name[0]) { + tprints(", name="); + print_quoted_string(ioc->name, DM_NAME_LEN, + QUOTE_0_TERMINATED); + } + if (ioc->uuid[0]) { + tprints(", uuid="); + print_quoted_string(ioc->uuid, DM_UUID_LEN, + QUOTE_0_TERMINATED); + } + break; + } +} + +static void +dm_decode_values(struct tcb *tcp, const unsigned int code, + const struct dm_ioctl *ioc) +{ + if (entering(tcp)) { + switch (code) { + case DM_TABLE_LOAD: + tprintf(", target_count=%" PRIu32, + ioc->target_count); + break; + case DM_DEV_SUSPEND: + if (ioc->flags & DM_SUSPEND_FLAG) + break; + /* Fall through */ + case DM_DEV_RENAME: + case DM_DEV_REMOVE: + case DM_DEV_WAIT: + tprintf(", event_nr=%" PRIu32, + ioc->event_nr); + break; + } + } else if (!syserror(tcp)) { + switch (code) { + case DM_DEV_CREATE: + case DM_DEV_RENAME: + case DM_DEV_SUSPEND: + case DM_DEV_STATUS: + case DM_DEV_WAIT: + case DM_TABLE_LOAD: + case DM_TABLE_CLEAR: + case DM_TABLE_DEPS: + case DM_TABLE_STATUS: + case DM_TARGET_MSG: + tprintf(", target_count=%" PRIu32, + ioc->target_count); + tprintf(", open_count=%" PRIu32, + ioc->open_count); + tprintf(", event_nr=%" PRIu32, + ioc->event_nr); + break; + } + } +} + +#include "xlat/dm_flags.h" + +static void +dm_decode_flags(const struct dm_ioctl *ioc) +{ + tprints(", flags="); + printflags(dm_flags, ioc->flags, "DM_???"); +} + +static void +dm_decode_dm_target_spec(struct tcb *const tcp, const kernel_ulong_t addr, + const struct dm_ioctl *const ioc) +{ + static const uint32_t target_spec_size = + sizeof(struct dm_target_spec); + uint32_t i; + uint32_t offset = ioc->data_start; + uint32_t offset_end; + + if (abbrev(tcp)) { + if (ioc->target_count) + tprints(", ..."); + + return; + } + + for (i = 0; i < ioc->target_count; i++) { + struct dm_target_spec s; + + offset_end = offset + target_spec_size; + + if (offset_end <= offset || offset_end > ioc->data_size) + goto misplaced; + + tprints(", "); + + if (i >= max_strlen) { + tprints("..."); + break; + } + + if (umove_or_printaddr(tcp, addr + offset, &s)) + break; + + tprintf("{sector_start=%" PRI__u64 ", length=%" PRI__u64, + s.sector_start, s.length); + + if (exiting(tcp)) + tprintf(", status=%" PRId32, s.status); + + tprints(", target_type="); + print_quoted_string(s.target_type, DM_MAX_TYPE_NAME, + QUOTE_0_TERMINATED); + + tprints(", string="); + printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, + QUOTE_0_TERMINATED); + tprintf("}"); + + if (entering(tcp)) + offset += s.next; + else + offset = ioc->data_start + s.next; + + if (offset <= offset_end) + goto misplaced; + } + + return; + +misplaced: + tprints(", /* misplaced struct dm_target_spec */ ..."); +} + +bool +dm_print_dev(struct tcb *tcp, void *dev_ptr, size_t dev_size, void *dummy) +{ + uint64_t *dev = (uint64_t *) dev_ptr; + + print_dev_t(*dev); + + return 1; +} + +static void +dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ulong_t addr, + const struct dm_ioctl *const ioc) +{ + static const uint32_t target_deps_dev_offs = + offsetof(struct dm_target_deps, dev); + uint64_t dev_buf; + struct dm_target_deps s; + uint32_t offset = ioc->data_start; + uint32_t offset_end = offset + target_deps_dev_offs; + uint32_t space; + + if (abbrev(tcp)) { + tprints(", ..."); + return; + } + + tprints(", "); + + if (offset_end <= offset || offset_end > ioc->data_size) + goto misplaced; + + if (umove_or_printaddr(tcp, addr + offset, &s)) + return; + + space = (ioc->data_size - offset_end) / sizeof(dev_buf); + + if (s.count > space) + goto misplaced; + + tprintf("{count=%u, deps=", s.count); + + print_array(tcp, addr + offset_end, s.count, &dev_buf, sizeof(dev_buf), + umoven_or_printaddr, dm_print_dev, NULL); + + tprints("}"); + + return; + +misplaced: + tprints("/* misplaced struct dm_target_deps */ ..."); +} + +static void +dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr, + const struct dm_ioctl *const ioc) +{ + static const uint32_t name_list_name_offs = + offsetof(struct dm_name_list, name); + struct dm_name_list s; + uint32_t offset = ioc->data_start; + uint32_t offset_end; + uint32_t count; + + if (abbrev(tcp)) { + tprints(", ..."); + return; + } + + for (count = 0;; count++) { + offset_end = offset + name_list_name_offs; + + if (offset_end <= offset || offset_end > ioc->data_size) + goto misplaced; + + tprints(", "); + + if (count >= max_strlen) { + tprints("..."); + break; + } + + if (umove_or_printaddr(tcp, addr + offset, &s)) + break; + if (!count && !s.dev) { + tprints("/* no devices present */"); + break; + } + + tprints("{dev="); + print_dev_t(s.dev); + + tprints("name="); + printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, + QUOTE_0_TERMINATED); + tprints("}"); + + if (!s.next) + break; + + offset += s.next; + if (offset <= offset_end) + goto misplaced; + } + + return; + +misplaced: + tprints(", /* misplaced struct dm_name_list */ ..."); +} + +static void +dm_decode_dm_target_versions(struct tcb *const tcp, const kernel_ulong_t addr, + const struct dm_ioctl *const ioc) +{ + static const uint32_t target_vers_name_offs = + offsetof(struct dm_target_versions, name); + struct dm_target_versions s; + uint32_t offset = ioc->data_start; + uint32_t offset_end; + uint32_t count; + + if (abbrev(tcp)) { + tprints(", ..."); + return; + } + + for (count = 0;; count++) { + offset_end = offset + target_vers_name_offs; + + if (offset_end <= offset || offset_end > ioc->data_size) + goto misplaced; + + tprints(", "); + + if (count >= max_strlen) { + tprints("..."); + break; + } + + if (umove_or_printaddr(tcp, addr + offset, &s)) + break; + + tprints("{name="); + printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, + QUOTE_0_TERMINATED); + tprintf(", version=%" PRIu32 ".%" PRIu32 ".%" PRIu32 "}", + s.version[0], s.version[1], s.version[2]); + + if (!s.next) + break; + + offset += s.next; + if (offset <= offset_end) + goto misplaced; + } + + return; + +misplaced: + tprints(", /* misplaced struct dm_target_versions */ ..."); +} + +static void +dm_decode_dm_target_msg(struct tcb *const tcp, const kernel_ulong_t addr, + const struct dm_ioctl *const ioc) +{ + static const uint32_t target_msg_message_offs = + offsetof(struct dm_target_msg, message); + uint32_t offset = ioc->data_start; + uint32_t offset_end = offset + target_msg_message_offs; + + if (abbrev(tcp)) { + tprints(", ..."); + return; + } + + if (offset_end > offset && offset_end <= ioc->data_size) { + struct dm_target_msg s; + + tprints(", "); + + if (umove_or_printaddr(tcp, addr + offset, &s)) + return; + + tprintf("{sector=%" PRI__u64 ", message=", s.sector); + printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, + QUOTE_0_TERMINATED); + tprints("}"); + } else { + tprints(", /* misplaced struct dm_target_msg */"); + } +} + +static void +dm_decode_string(struct tcb *const tcp, const kernel_ulong_t addr, + const struct dm_ioctl *const ioc) +{ + uint32_t offset = ioc->data_start; + + if (abbrev(tcp)) { + tprints(", ..."); + return; + } + + if (offset < ioc->data_size) { + tprints(", string="); + printstr_ex(tcp, addr + offset, ioc->data_size - offset, + QUOTE_0_TERMINATED); + } else { + tprints(", /* misplaced string */"); + } +} + +static inline bool +dm_ioctl_has_params(const unsigned int code) +{ + switch (code) { + case DM_VERSION: + case DM_REMOVE_ALL: + case DM_DEV_CREATE: + case DM_DEV_REMOVE: + case DM_DEV_SUSPEND: + case DM_DEV_STATUS: + case DM_TABLE_CLEAR: + return false; + } + + return true; +} + +static int +dm_known_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + struct dm_ioctl *ioc = NULL; + struct dm_ioctl *entering_ioc = NULL; + bool ioc_changed = false; + + if (entering(tcp)) { + ioc = malloc(sizeof(*ioc)); + if (!ioc) + return 0; + } else { + ioc = alloca(sizeof(*ioc)); + } + + if ((umoven(tcp, arg, offsetof(struct dm_ioctl, data), ioc) < 0) || + (ioc->data_size < offsetof(struct dm_ioctl, data_size))) { + if (entering(tcp)) + free(ioc); + return 0; + } + if (entering(tcp)) + set_tcb_priv_data(tcp, ioc, free); + else { + entering_ioc = get_tcb_priv_data(tcp); + + /* + * retrieve_status, __dev_status called only in case of success, + * so it looks like there's no need to check open_count, + * event_nr, target_count, dev fields for change (they are + * printed only in case of absence of errors). + */ + if (!entering_ioc || + (ioc->version[0] != entering_ioc->version[0]) || + (ioc->version[1] != entering_ioc->version[1]) || + (ioc->version[2] != entering_ioc->version[2]) || + (ioc->data_size != entering_ioc->data_size) || + (ioc->data_start != entering_ioc->data_start) || + (ioc->flags != entering_ioc->flags)) + ioc_changed = true; + } + + if (exiting(tcp) && syserror(tcp) && !ioc_changed) + return 1; + + /* + * device mapper code uses %d in some places and %u in another, but + * fields themselves are declared as __u32. + */ + tprintf("%s{version=%u.%u.%u", entering(tcp) ? ", " : " => ", + ioc->version[0], ioc->version[1], ioc->version[2]); + /* + * if we use a different version of ABI, do not attempt to decode + * ioctl fields + */ + if (ioc->version[0] != DM_VERSION_MAJOR) { + tprints(", /* Unsupported device mapper ABI version */ ..."); + goto skip; + } + + tprintf(", data_size=%u", ioc->data_size); + + if (dm_ioctl_has_params(code)) + tprintf(", data_start=%u", ioc->data_start); + + if (ioc->data_size < offsetof(struct dm_ioctl, data)) { + tprints(", /* Incorrect data_size */ ..."); + goto skip; + } + + dm_decode_device(code, ioc); + dm_decode_values(tcp, code, ioc); + dm_decode_flags(ioc); + + switch (code) { + case DM_DEV_WAIT: + case DM_TABLE_STATUS: + if (entering(tcp) || syserror(tcp)) + break; + dm_decode_dm_target_spec(tcp, arg, ioc); + break; + case DM_TABLE_LOAD: + if (exiting(tcp)) + break; + dm_decode_dm_target_spec(tcp, arg, ioc); + break; + case DM_TABLE_DEPS: + if (entering(tcp) || syserror(tcp)) + break; + dm_decode_dm_target_deps(tcp, arg, ioc); + break; + case DM_LIST_DEVICES: + if (entering(tcp) || syserror(tcp)) + break; + dm_decode_dm_name_list(tcp, arg, ioc); + break; + case DM_LIST_VERSIONS: + if (entering(tcp) || syserror(tcp)) + break; + dm_decode_dm_target_versions(tcp, arg, ioc); + break; + case DM_TARGET_MSG: + if (entering(tcp)) + dm_decode_dm_target_msg(tcp, arg, ioc); + else if (!syserror(tcp) && ioc->flags & DM_DATA_OUT_FLAG) + dm_decode_string(tcp, arg, ioc); + break; + case DM_DEV_RENAME: + case DM_DEV_SET_GEOMETRY: + if (exiting(tcp)) + break; + dm_decode_string(tcp, arg, ioc); + break; + } + + skip: + tprints("}"); + return 1; +} + +int +dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) +{ + switch (code) { + case DM_VERSION: + case DM_REMOVE_ALL: + case DM_LIST_DEVICES: + case DM_DEV_CREATE: + case DM_DEV_REMOVE: + case DM_DEV_RENAME: + case DM_DEV_SUSPEND: + case DM_DEV_STATUS: + case DM_DEV_WAIT: + case DM_TABLE_LOAD: + case DM_TABLE_CLEAR: + case DM_TABLE_DEPS: + case DM_TABLE_STATUS: + case DM_LIST_VERSIONS: + case DM_TARGET_MSG: + case DM_DEV_SET_GEOMETRY: + return dm_known_ioctl(tcp, code, arg); + default: + return 0; + } +} + +# else /* !(DM_VERSION_MAJOR == 4) */ + +int +dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) +{ + return 0; +} + +# endif /* DM_VERSION_MAJOR == 4 */ +#endif /* HAVE_LINUX_DM_IOCTL_H */ diff --git a/empty.h b/empty.h new file mode 100644 index 00000000..e69de29b diff --git a/epoll.c b/epoll.c new file mode 100644 index 00000000..8dc7ab09 --- /dev/null +++ b/epoll.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2004-2007 Ulrich Drepper + * Copyright (c) 2004 Roland McGrath + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include + +SYS_FUNC(epoll_create) +{ + tprintf("%d", (int) tcp->u_arg[0]); + + return RVAL_DECODED | RVAL_FD; +} + +#include "xlat/epollflags.h" + +SYS_FUNC(epoll_create1) +{ + printflags(epollflags, tcp->u_arg[0], "EPOLL_???"); + + return RVAL_DECODED | RVAL_FD; +} + +#include "xlat/epollevents.h" + +static bool +print_epoll_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const struct epoll_event *ev = elem_buf; + + tprints("{"); + printflags(epollevents, ev->events, "EPOLL???"); + /* We cannot know what format the program uses, so print u32 and u64 + which will cover every value. */ + tprintf(", {u32=%" PRIu32 ", u64=%" PRIu64 "}}", + ev->data.u32, ev->data.u64); + + return true; +} + +#include "xlat/epollctls.h" + +SYS_FUNC(epoll_ctl) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + const unsigned int op = tcp->u_arg[1]; + printxval(epollctls, op, "EPOLL_CTL_???"); + tprints(", "); + printfd(tcp, tcp->u_arg[2]); + tprints(", "); + struct epoll_event ev; + if (EPOLL_CTL_DEL == op) + printaddr(tcp->u_arg[3]); + else if (!umove_or_printaddr(tcp, tcp->u_arg[3], &ev)) + print_epoll_event(tcp, &ev, sizeof(ev), 0); + + return RVAL_DECODED; +} + +static void +epoll_wait_common(struct tcb *tcp) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + struct epoll_event ev; + print_array(tcp, tcp->u_arg[1], tcp->u_rval, &ev, sizeof(ev), + umoven_or_printaddr, print_epoll_event, 0); + tprintf(", %d, %d", (int) tcp->u_arg[2], (int) tcp->u_arg[3]); + } +} + +SYS_FUNC(epoll_wait) +{ + epoll_wait_common(tcp); + return 0; +} + +SYS_FUNC(epoll_pwait) +{ + epoll_wait_common(tcp); + if (exiting(tcp)) { + tprints(", "); + /* NB: kernel requires arg[5] == NSIG_BYTES */ + print_sigset_addr_len(tcp, tcp->u_arg[4], tcp->u_arg[5]); + tprintf(", %" PRI_klu, tcp->u_arg[5]); + } + return 0; +} diff --git a/errnoent.sh b/errnoent.sh index a82fc04c..0b1b06a3 100755 --- a/errnoent.sh +++ b/errnoent.sh @@ -25,16 +25,14 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. awk ' -/^#define[ ]+E[A-Z0-9_]+[ ]+[0-9]+/ { +$1 == "#define" && $2 ~ /^E[A-Z0-9_]+$/ && $3 ~ /^[0-9]+$/ { errno[$3] = $2 if ($3 > max) max = $3 } END { - for (i = 0; i <= max; i++) { - if (!errno[i]) - errno[i] = "ERRNO_" i - printf "\t\"%s\", /* %d */\n", errno[i], i - } + for (i = 0; i <= max; i++) + if (errno[i]) + printf("[%3d] = \"%s\",\n", i, errno[i]) } -' $* +' "$@" diff --git a/evdev.c b/evdev.c new file mode 100644 index 00000000..68745515 --- /dev/null +++ b/evdev.c @@ -0,0 +1,532 @@ +/* + * Copyright (c) 2015 Etienne Gemsa + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_INPUT_H + +#include DEF_MPERS_TYPE(struct_ff_effect) + +# include +# include + +typedef struct ff_effect struct_ff_effect; + +#endif /* HAVE_LINUX_INPUT_H */ + +#include MPERS_DEFS + +#ifdef HAVE_LINUX_INPUT_H + +# include "xlat/evdev_autorepeat.h" +# include "xlat/evdev_ff_status.h" +# include "xlat/evdev_ff_types.h" +# include "xlat/evdev_keycode.h" +# include "xlat/evdev_leds.h" +# include "xlat/evdev_misc.h" +# include "xlat/evdev_mtslots.h" +# include "xlat/evdev_prop.h" +# include "xlat/evdev_relative_axes.h" +# include "xlat/evdev_snd.h" +# include "xlat/evdev_switch.h" +# include "xlat/evdev_sync.h" + +# ifndef SYN_MAX +# define SYN_MAX 0xf +# endif + +static void +decode_envelope(void *const data) +{ + const struct ff_envelope *const envelope = data; + + tprintf(", envelope={attack_length=%" PRIu16 + ", attack_level=%" PRIu16 + ", fade_length=%" PRIu16 + ", fade_level=%#x}", + envelope->attack_length, + envelope->attack_level, + envelope->fade_length, + envelope->fade_level); +} + +static int +ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + + struct_ff_effect ffe; + + if (umove_or_printaddr(tcp, arg, &ffe)) + return 1; + + tprints("{type="); + printxval(evdev_ff_types, ffe.type, "FF_???"); + tprintf(", id=%" PRIu16 + ", direction=%" PRIu16 ", ", + ffe.id, + ffe.direction); + + if (abbrev(tcp)) { + tprints("...}"); + return 1; + } + + tprintf("trigger={button=%" PRIu16 + ", interval=%" PRIu16 "}" + ", replay={length=%" PRIu16 + ", delay=%" PRIu16 "}", + ffe.trigger.button, + ffe.trigger.interval, + ffe.replay.length, + ffe.replay.delay); + + switch (ffe.type) { + case FF_CONSTANT: + tprintf(", constant={level=%" PRId16, + ffe.u.constant.level); + decode_envelope(&ffe.u.constant.envelope); + tprints("}"); + break; + case FF_RAMP: + tprintf(", ramp={start_level=%" PRId16 + ", end_level=%" PRId16, + ffe.u.ramp.start_level, + ffe.u.ramp.end_level); + decode_envelope(&ffe.u.ramp.envelope); + tprints("}"); + break; + case FF_PERIODIC: + tprintf(", periodic={waveform=%" PRIu16 + ", period=%" PRIu16 + ", magnitude=%" PRId16 + ", offset=%" PRId16 + ", phase=%" PRIu16, + ffe.u.periodic.waveform, + ffe.u.periodic.period, + ffe.u.periodic.magnitude, + ffe.u.periodic.offset, + ffe.u.periodic.phase); + decode_envelope(&ffe.u.periodic.envelope); + tprintf(", custom_len=%u, custom_data=", + ffe.u.periodic.custom_len); + printaddr(ptr_to_kulong(ffe.u.periodic.custom_data)); + tprints("}"); + break; + case FF_RUMBLE: + tprintf(", rumble={strong_magnitude=%" PRIu16 + ", weak_magnitude=%" PRIu16 "}", + ffe.u.rumble.strong_magnitude, + ffe.u.rumble.weak_magnitude); + break; + default: + break; + } + + tprints("}"); + + return 1; +} + +static int +abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + + struct input_absinfo absinfo; + + if (!umove_or_printaddr(tcp, arg, &absinfo)) { + tprintf("{value=%u" + ", minimum=%u, ", + absinfo.value, + absinfo.minimum); + + if (!abbrev(tcp)) { + tprintf("maximum=%u" + ", fuzz=%u" + ", flat=%u", + absinfo.maximum, + absinfo.fuzz, + absinfo.flat); +# ifdef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION + tprintf(", resolution=%u", + absinfo.resolution); +# endif + } else { + tprints("..."); + } + + tprints("}"); + } + + return 1; +} + +static int +keycode_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + + unsigned int keycode[2]; + + if (!umove_or_printaddr(tcp, arg, &keycode)) { + tprintf("[%u, ", keycode[0]); + printxval(evdev_keycode, keycode[1], "KEY_???"); + tprints("]"); + } + + return 1; +} + +# ifdef EVIOCGKEYCODE_V2 +static int +keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + + struct input_keymap_entry ike; + + if (umove_or_printaddr(tcp, arg, &ike)) + return 1; + + tprintf("{flags=%" PRIu8 + ", len=%" PRIu8 ", ", + ike.flags, + ike.len); + + if (!abbrev(tcp)) { + unsigned int i; + + tprintf("index=%" PRIu16 ", keycode=", ike.index); + printxval(evdev_keycode, ike.keycode, "KEY_???"); + tprints(", scancode=["); + for (i = 0; i < ARRAY_SIZE(ike.scancode); i++) { + if (i > 0) + tprints(", "); + tprintf("%" PRIx8, ike.scancode[i]); + } + tprints("]"); + } else { + tprints("..."); + } + + tprints("}"); + + return 1; +} +# endif /* EVIOCGKEYCODE_V2 */ + +static int +getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + + struct input_id id; + + if (!umove_or_printaddr(tcp, arg, &id)) + tprintf("{ID_BUS=%" PRIu16 + ", ID_VENDOR=%" PRIu16 + ", ID_PRODUCT=%" PRIu16 + ", ID_VERSION=%" PRIu16 "}", + id.bustype, + id.vendor, + id.product, + id.version); + + return 1; +} + +static int +decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg, + const struct xlat decode_nr[], const unsigned int max_nr, + const char *const dflt) +{ + tprints(", "); + + unsigned int size; + if ((kernel_ulong_t) tcp->u_rval > max_nr) + size = max_nr; + else + size = tcp->u_rval; + char decoded_arg[size]; + + if (umove_or_printaddr(tcp, arg, &decoded_arg)) + return 1; + + tprints("["); + + int bit_displayed = 0; + int i = next_set_bit(decoded_arg, 0, size); + if (i < 0) { + tprints(" 0 "); + } else { + printxval(decode_nr, i, dflt); + + while ((i = next_set_bit(decoded_arg, i + 1, size)) > 0) { + if (abbrev(tcp) && bit_displayed >= 3) { + tprints(", ..."); + break; + } + tprints(", "); + printxval(decode_nr, i, dflt); + bit_displayed++; + } + } + + tprints("]"); + + return 1; +} + +# ifdef EVIOCGMTSLOTS +static int +mtslots_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + tprints(", "); + + const size_t size = _IOC_SIZE(code) / sizeof(int); + if (!size) { + printaddr(arg); + return 1; + } + + int buffer[size]; + + if (umove_or_printaddr(tcp, arg, &buffer)) + return 1; + + tprints("{code="); + printxval(evdev_mtslots, buffer[0], "ABS_MT_???"); + + tprints(", values=["); + + unsigned int i; + for (i = 1; i < ARRAY_SIZE(buffer); i++) + tprintf("%s%d", i > 1 ? ", " : "", buffer[i]); + + tprints("]}"); + + return 1; +} +# endif /* EVIOCGMTSLOTS */ + +# if defined EVIOCGREP || defined EVIOCSREP +static int +repeat_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + printpair_int(tcp, arg, "%u"); + return 1; +} +# endif /* EVIOCGREP || EVIOCSREP */ + +static int +bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr, + const kernel_ulong_t arg) +{ + switch (ev_nr) { + case EV_SYN: + return decode_bitset(tcp, arg, evdev_sync, + SYN_MAX, "SYN_???"); + case EV_KEY: + return decode_bitset(tcp, arg, evdev_keycode, + KEY_MAX, "KEY_???"); + case EV_REL: + return decode_bitset(tcp, arg, evdev_relative_axes, + REL_MAX, "REL_???"); + case EV_ABS: + return decode_bitset(tcp, arg, evdev_abs, + ABS_MAX, "ABS_???"); + case EV_MSC: + return decode_bitset(tcp, arg, evdev_misc, + MSC_MAX, "MSC_???"); +# ifdef EV_SW + case EV_SW: + return decode_bitset(tcp, arg, evdev_switch, + SW_MAX, "SW_???"); +# endif + case EV_LED: + return decode_bitset(tcp, arg, evdev_leds, + LED_MAX, "LED_???"); + case EV_SND: + return decode_bitset(tcp, arg, evdev_snd, + SND_MAX, "SND_???"); + case EV_REP: + return decode_bitset(tcp, arg, evdev_autorepeat, + REP_MAX, "REP_???"); + case EV_FF: + return decode_bitset(tcp, arg, evdev_ff_types, + FF_MAX, "FF_???"); + case EV_PWR: + tprints(", "); + printnum_int(tcp, arg, "%d"); + return 1; + case EV_FF_STATUS: + return decode_bitset(tcp, arg, evdev_ff_status, + FF_STATUS_MAX, "FF_STATUS_???"); + default: + tprints(", "); + printaddr(arg); + return 1; + } +} + +static int +evdev_read_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + /* fixed-number fixed-length commands */ + switch (code) { + case EVIOCGVERSION: + tprints(", "); + printnum_int(tcp, arg, "%#x"); + return 1; + case EVIOCGEFFECTS: + tprints(", "); + printnum_int(tcp, arg, "%u"); + return 1; + case EVIOCGID: + return getid_ioctl(tcp, arg); +# ifdef EVIOCGREP + case EVIOCGREP: + return repeat_ioctl(tcp, arg); +# endif + case EVIOCGKEYCODE: + return keycode_ioctl(tcp, arg); +# ifdef EVIOCGKEYCODE_V2 + case EVIOCGKEYCODE_V2: + return keycode_V2_ioctl(tcp, arg); +# endif + } + + /* fixed-number variable-length commands */ + switch (_IOC_NR(code)) { +# ifdef EVIOCGMTSLOTS + case _IOC_NR(EVIOCGMTSLOTS(0)): + return mtslots_ioctl(tcp, code, arg); +# endif + case _IOC_NR(EVIOCGNAME(0)): + case _IOC_NR(EVIOCGPHYS(0)): + case _IOC_NR(EVIOCGUNIQ(0)): + tprints(", "); + if (syserror(tcp)) + printaddr(arg); + else + printstrn(tcp, arg, tcp->u_rval); + return 1; +# ifdef EVIOCGPROP + case _IOC_NR(EVIOCGPROP(0)): + return decode_bitset(tcp, arg, evdev_prop, + INPUT_PROP_MAX, "PROP_???"); +# endif + case _IOC_NR(EVIOCGSND(0)): + return decode_bitset(tcp, arg, evdev_snd, + SND_MAX, "SND_???"); +# ifdef EVIOCGSW + case _IOC_NR(EVIOCGSW(0)): + return decode_bitset(tcp, arg, evdev_switch, + SW_MAX, "SW_???"); +# endif + case _IOC_NR(EVIOCGKEY(0)): + return decode_bitset(tcp, arg, evdev_keycode, + KEY_MAX, "KEY_???"); + case _IOC_NR(EVIOCGLED(0)): + return decode_bitset(tcp, arg, evdev_leds, + LED_MAX, "LED_???"); + } + + /* multi-number fixed-length commands */ + if ((_IOC_NR(code) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) + return abs_ioctl(tcp, arg); + + /* multi-number variable-length commands */ + if ((_IOC_NR(code) & ~EV_MAX) == _IOC_NR(EVIOCGBIT(0, 0))) + return bit_ioctl(tcp, _IOC_NR(code) & EV_MAX, arg); + + return 0; +} + +static int +evdev_write_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + /* fixed-number fixed-length commands */ + switch (code) { +# ifdef EVIOCSREP + case EVIOCSREP: + return repeat_ioctl(tcp, arg); +# endif + case EVIOCSKEYCODE: + return keycode_ioctl(tcp, arg); +# ifdef EVIOCSKEYCODE_V2 + case EVIOCSKEYCODE_V2: + return keycode_V2_ioctl(tcp, arg); +# endif + case EVIOCSFF: + return ff_effect_ioctl(tcp, arg); + case EVIOCRMFF: + tprintf(", %d", (int) arg); + return 1; + case EVIOCGRAB: +# ifdef EVIOCREVOKE + case EVIOCREVOKE: +# endif + tprintf(", %" PRI_klu, arg); + return 1; +# ifdef EVIOCSCLOCKID + case EVIOCSCLOCKID: + tprints(", "); + printnum_int(tcp, arg, "%u"); + return 1; +# endif + } + + /* multi-number fixed-length commands */ + if ((_IOC_NR(code) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) + return abs_ioctl(tcp, arg); + + return 0; +} + +MPERS_PRINTER_DECL(int, evdev_ioctl, struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) +{ + switch(_IOC_DIR(code)) { + case _IOC_READ: + if (entering(tcp)) + return 0; + return evdev_read_ioctl(tcp, code, arg); + case _IOC_WRITE: + return evdev_write_ioctl(tcp, code, arg) | RVAL_DECODED; + default: + return RVAL_DECODED; + } +} + +#endif /* HAVE_LINUX_INPUT_H */ diff --git a/eventfd.c b/eventfd.c new file mode 100644 index 00000000..0e7babcc --- /dev/null +++ b/eventfd.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2007 Ulrich Drepper + * Copyright (c) 2008-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#ifdef HAVE_SYS_EVENTFD_H +# include +#endif + +#include "xlat/efd_flags.h" + +static int +do_eventfd(struct tcb *tcp, int flags_arg) +{ + tprintf("%u", (unsigned int) tcp->u_arg[0]); + if (flags_arg >= 0) { + tprints(", "); + printflags(efd_flags, tcp->u_arg[flags_arg], "EFD_???"); + } + + return RVAL_DECODED | RVAL_FD; +} + +SYS_FUNC(eventfd) +{ + return do_eventfd(tcp, -1); +} + +SYS_FUNC(eventfd2) +{ + return do_eventfd(tcp, 1); +} diff --git a/execve.c b/execve.c new file mode 100644 index 00000000..6e45b11b --- /dev/null +++ b/execve.c @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2007 Roland McGrath + * Copyright (c) 2011-2012 Denys Vlasenko + * Copyright (c) 2010-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +static void +printargv(struct tcb *const tcp, kernel_ulong_t addr) +{ + if (!addr || !verbose(tcp)) { + printaddr(addr); + return; + } + + const char *const start_sep = "["; + const char *sep = start_sep; + const unsigned int wordsize = current_wordsize; + unsigned int n; + + for (n = 0; addr; sep = ", ", addr += wordsize, ++n) { + union { + unsigned int p32; + kernel_ulong_t p64; + char data[sizeof(kernel_ulong_t)]; + } cp; + + if (umoven(tcp, addr, wordsize, cp.data)) { + if (sep == start_sep) + printaddr(addr); + else + tprints(", ???]"); + return; + } + if (!(wordsize < sizeof(cp.p64) ? cp.p32 : cp.p64)) { + if (sep == start_sep) + tprints(start_sep); + break; + } + if (abbrev(tcp) && n >= max_strlen) { + tprintf("%s...", sep); + break; + } + tprints(sep); + printstr(tcp, wordsize < sizeof(cp.p64) ? cp.p32 : cp.p64); + } + tprints("]"); +} + +static void +printargc(struct tcb *const tcp, kernel_ulong_t addr) +{ + if (!addr || !verbose(tcp)) { + printaddr(addr); + return; + } + + bool unterminated = false; + unsigned int count = 0; + char *cp = NULL; + + for (; addr; addr += current_wordsize, ++count) { + if (umoven(tcp, addr, current_wordsize, &cp)) { + if (count) { + unterminated = true; + break; + } + printaddr(addr); + return; + } + if (!cp) + break; + } + tprintf("[/* %u var%s%s */]", + count, count == 1 ? "" : "s", + unterminated ? ", unterminated" : ""); +} + +static void +decode_execve(struct tcb *tcp, const unsigned int index) +{ + printpath(tcp, tcp->u_arg[index + 0]); + tprints(", "); + + printargv(tcp, tcp->u_arg[index + 1]); + tprints(", "); + + (abbrev(tcp) ? printargc : printargv) (tcp, tcp->u_arg[index + 2]); +} + +SYS_FUNC(execve) +{ + decode_execve(tcp, 0); + + return RVAL_DECODED; +} + +SYS_FUNC(execveat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + decode_execve(tcp, 1); + tprints(", "); + printflags(at_flags, tcp->u_arg[4], "AT_???"); + + return RVAL_DECODED; +} + +#if defined(SPARC) || defined(SPARC64) +SYS_FUNC(execv) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + printargv(tcp, tcp->u_arg[1]); + + return RVAL_DECODED; +} +#endif /* SPARC || SPARC64 */ diff --git a/fadvise.c b/fadvise.c new file mode 100644 index 00000000..f0d057b7 --- /dev/null +++ b/fadvise.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2004 Ulrich Drepper + * Copyright (c) 2004 Roland McGrath + * Copyright (c) 2007 Daniel Jacobowitz + * Copyright (c) 2009 Andreas Schwab + * Copyright (c) 2009 Kirill A. Shutemov + * Copyright (c) 2011-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +#include "xlat/advise.h" + +SYS_FUNC(fadvise64) +{ + int argn; + + printfd(tcp, tcp->u_arg[0]); + argn = printllval(tcp, ", %lld", 1); + tprintf(", %" PRI_klu ", ", tcp->u_arg[argn++]); + printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???"); + + return RVAL_DECODED; +} + +SYS_FUNC(fadvise64_64) +{ + int argn; + + printfd(tcp, tcp->u_arg[0]); + argn = printllval(tcp, ", %lld, ", 1); + argn = printllval(tcp, "%lld, ", argn); +#if defined __ARM_EABI__ || defined AARCH64 || defined POWERPC || defined XTENSA + printxval(advise, tcp->u_arg[1], "POSIX_FADV_???"); +#else + printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???"); +#endif + + return RVAL_DECODED; +} diff --git a/fallocate.c b/fallocate.c new file mode 100644 index 00000000..b707279c --- /dev/null +++ b/fallocate.c @@ -0,0 +1,28 @@ +#include "defs.h" + +#ifdef HAVE_LINUX_FALLOC_H +# include +#endif + +#include "xlat/falloc_flags.h" + +SYS_FUNC(fallocate) +{ + int argn; + + /* fd */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + + /* mode */ + printflags(falloc_flags, tcp->u_arg[1], "FALLOC_FL_???"); + tprints(", "); + + /* offset */ + argn = printllval(tcp, "%lld, ", 2); + + /* len */ + printllval(tcp, "%lld", argn); + + return RVAL_DECODED; +} diff --git a/fanotify.c b/fanotify.c index 32a36675..203e9d29 100644 --- a/fanotify.c +++ b/fanotify.c @@ -1,18 +1,46 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "defs.h" -#include #include "xlat/fan_classes.h" #include "xlat/fan_init_flags.h" -int -sys_fanotify_init(struct tcb *tcp) -{ - unsigned flags; +#ifndef FAN_ALL_CLASS_BITS +# define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT) +#endif +#ifndef FAN_NOFD +# define FAN_NOFD -1 +#endif - if (exiting(tcp)) - return 0; +SYS_FUNC(fanotify_init) +{ + unsigned int flags = tcp->u_arg[0]; - flags = tcp->u_arg[0]; printxval(fan_classes, flags & FAN_ALL_CLASS_BITS, "FAN_CLASS_???"); flags &= ~FAN_ALL_CLASS_BITS; if (flags) { @@ -22,29 +50,35 @@ sys_fanotify_init(struct tcb *tcp) tprints(", "); tprint_open_modes((unsigned) tcp->u_arg[1]); - return 0; + return RVAL_DECODED | RVAL_FD; } #include "xlat/fan_mark_flags.h" #include "xlat/fan_event_flags.h" -int -sys_fanotify_mark(struct tcb *tcp) +SYS_FUNC(fanotify_mark) { - if (exiting(tcp)) - return 0; - printfd(tcp, tcp->u_arg[0]); tprints(", "); - printflags(fan_mark_flags, (unsigned) tcp->u_arg[1], "FAN_MARK_???"); + printflags(fan_mark_flags, tcp->u_arg[1], "FAN_MARK_???"); tprints(", "); - printflags(fan_event_flags, tcp->u_arg[2], "FAN_???"); + /* + * the mask argument is defined as 64-bit, + * but kernel uses the lower 32 bits only. + */ + unsigned long long mask = 0; + int argn = getllval(tcp, &mask, 2); +#ifdef HPPA + /* Parsic is weird. See arch/parisc/kernel/sys_parisc32.c. */ + mask = (mask << 32) | (mask >> 32); +#endif + printflags64(fan_event_flags, mask, "FAN_???"); tprints(", "); - if ((int) tcp->u_arg[3] == FAN_NOFD) + if ((int) tcp->u_arg[argn] == FAN_NOFD) tprints("FAN_NOFD, "); else - print_dirfd(tcp, tcp->u_arg[3]); - printpath(tcp, tcp->u_arg[4]); + print_dirfd(tcp, tcp->u_arg[argn]); + printpath(tcp, tcp->u_arg[argn + 1]); - return 0; + return RVAL_DECODED; } diff --git a/fchownat.c b/fchownat.c new file mode 100644 index 00000000..6aed51d0 --- /dev/null +++ b/fchownat.c @@ -0,0 +1,13 @@ +#include "defs.h" + +SYS_FUNC(fchownat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + printuid(", ", tcp->u_arg[2]); + printuid(", ", tcp->u_arg[3]); + tprints(", "); + printflags(at_flags, tcp->u_arg[4], "AT_???"); + + return RVAL_DECODED; +} diff --git a/fcntl.c b/fcntl.c new file mode 100644 index 00000000..74168c6a --- /dev/null +++ b/fcntl.c @@ -0,0 +1,242 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "flock.h" + +#include "xlat/f_owner_types.h" +#include "xlat/f_seals.h" +#include "xlat/fcntlcmds.h" +#include "xlat/fcntl64cmds.h" +#include "xlat/fdflags.h" +#include "xlat/lockfcmds.h" +#include "xlat/notifyflags.h" + +static void +print_struct_flock64(const struct_kernel_flock64 *fl, const int getlk) +{ + tprints("{l_type="); + printxval(lockfcmds, (unsigned short) fl->l_type, "F_???"); + tprints(", l_whence="); + printxval(whence_codes, (unsigned short) fl->l_whence, "SEEK_???"); + tprintf(", l_start=%" PRId64 ", l_len=%" PRId64, + (int64_t) fl->l_start, (int64_t) fl->l_len); + if (getlk) + tprintf(", l_pid=%lu", (unsigned long) fl->l_pid); + tprints("}"); +} + +static void +printflock64(struct tcb *const tcp, const kernel_ulong_t addr, const int getlk) +{ + struct_kernel_flock64 fl; + + if (fetch_struct_flock64(tcp, addr, &fl)) + print_struct_flock64(&fl, getlk); +} + +static void +printflock(struct tcb *const tcp, const kernel_ulong_t addr, const int getlk) +{ + struct_kernel_flock64 fl; + + if (fetch_struct_flock(tcp, addr, &fl)) + print_struct_flock64(&fl, getlk); +} + +static void +print_f_owner_ex(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct { int type, pid; } owner; + + if (umove_or_printaddr(tcp, addr, &owner)) + return; + + tprints("{type="); + printxval(f_owner_types, owner.type, "F_OWNER_???"); + tprintf(", pid=%d}", owner.pid); +} + +static int +print_fcntl(struct tcb *tcp) +{ + const unsigned int cmd = tcp->u_arg[1]; + + switch (cmd) { + case F_SETFD: + tprints(", "); + printflags(fdflags, tcp->u_arg[2], "FD_???"); + break; + case F_SETOWN: + case F_SETPIPE_SZ: + tprintf(", %" PRI_kld, tcp->u_arg[2]); + break; + case F_DUPFD: + case F_DUPFD_CLOEXEC: + tprintf(", %" PRI_kld, tcp->u_arg[2]); + return RVAL_DECODED | RVAL_FD; + case F_SETFL: + tprints(", "); + tprint_open_modes(tcp->u_arg[2]); + break; + case F_SETLK: + case F_SETLKW: + tprints(", "); + printflock(tcp, tcp->u_arg[2], 0); + break; + case F_OFD_SETLK: + case F_OFD_SETLKW: + tprints(", "); + printflock64(tcp, tcp->u_arg[2], 0); + break; + case F_SETOWN_EX: + tprints(", "); + print_f_owner_ex(tcp, tcp->u_arg[2]); + break; + case F_NOTIFY: + tprints(", "); + printflags64(notifyflags, tcp->u_arg[2], "DN_???"); + break; + case F_SETLEASE: + tprints(", "); + printxval64(lockfcmds, tcp->u_arg[2], "F_???"); + break; + case F_ADD_SEALS: + tprints(", "); + printflags64(f_seals, tcp->u_arg[2], "F_SEAL_???"); + break; + case F_SETSIG: + tprints(", "); + tprints(signame(tcp->u_arg[2])); + break; + case F_GETOWN: + case F_GETPIPE_SZ: + break; + case F_GETFD: + if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0) + return 0; + tcp->auxstr = sprintflags("flags ", fdflags, + (kernel_ulong_t) tcp->u_rval); + return RVAL_HEX | RVAL_STR; + case F_GETFL: + if (entering(tcp) || syserror(tcp)) + return 0; + tcp->auxstr = sprint_open_modes(tcp->u_rval); + return RVAL_HEX | RVAL_STR; + case F_GETLK: + if (entering(tcp)) + return 0; + tprints(", "); + printflock(tcp, tcp->u_arg[2], 1); + break; + case F_OFD_GETLK: + if (entering(tcp)) + return 0; + tprints(", "); + printflock64(tcp, tcp->u_arg[2], 1); + break; + case F_GETOWN_EX: + if (entering(tcp)) + return 0; + tprints(", "); + print_f_owner_ex(tcp, tcp->u_arg[2]); + break; + case F_GETLEASE: + if (entering(tcp) || syserror(tcp)) + return 0; + tcp->auxstr = xlookup(lockfcmds, (kernel_ulong_t) tcp->u_rval); + return RVAL_HEX | RVAL_STR; + case F_GET_SEALS: + if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0) + return 0; + tcp->auxstr = sprintflags("seals ", f_seals, + (kernel_ulong_t) tcp->u_rval); + return RVAL_HEX | RVAL_STR; + case F_GETSIG: + if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0) + return 0; + tcp->auxstr = signame(tcp->u_rval); + return RVAL_STR; + default: + tprintf(", %#" PRI_klx, tcp->u_arg[2]); + break; + } + return RVAL_DECODED; +} + +SYS_FUNC(fcntl) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + const unsigned int cmd = tcp->u_arg[1]; + const char *str = xlookup(fcntlcmds, cmd); + if (str) { + tprints(str); + } else { + /* + * fcntl syscall does not recognize these + * constants, but we would like to show them + * for better debugging experience. + */ + printxval(fcntl64cmds, cmd, "F_???"); + } + } + return print_fcntl(tcp); +} + +SYS_FUNC(fcntl64) +{ + const unsigned int cmd = tcp->u_arg[1]; + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + const char *str = xlookup(fcntl64cmds, cmd); + if (str) { + tprints(str); + } else { + printxval(fcntlcmds, cmd, "F_???"); + } + } + switch (cmd) { + case F_SETLK64: + case F_SETLKW64: + tprints(", "); + printflock64(tcp, tcp->u_arg[2], 0); + return RVAL_DECODED; + case F_GETLK64: + if (exiting(tcp)) { + tprints(", "); + printflock64(tcp, tcp->u_arg[2], 1); + } + return 0; + } + return print_fcntl(tcp); +} diff --git a/fetch_seccomp_fprog.c b/fetch_seccomp_fprog.c new file mode 100644 index 00000000..e483e816 --- /dev/null +++ b/fetch_seccomp_fprog.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(seccomp_fprog_t) + +#include "seccomp_fprog.h" +typedef struct seccomp_fprog seccomp_fprog_t; + +#include MPERS_DEFS + +MPERS_PRINTER_DECL(bool, fetch_seccomp_fprog, struct tcb *const tcp, + const kernel_ulong_t addr, void *const p) +{ + struct seccomp_fprog *pfp = p; + seccomp_fprog_t mfp; + + if (sizeof(*pfp) == sizeof(mfp)) + return !umove_or_printaddr(tcp, addr, pfp); + + if (umove_or_printaddr(tcp, addr, &mfp)) + return false; + + pfp->len = mfp.len; + pfp->filter = mfp.filter; + return true; +} diff --git a/fetch_struct_flock.c b/fetch_struct_flock.c new file mode 100644 index 00000000..bb248761 --- /dev/null +++ b/fetch_struct_flock.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_flock) +#include DEF_MPERS_TYPE(struct_flock64) + +#include "flock.h" +typedef struct_kernel_flock struct_flock; +typedef struct_kernel_flock64 struct_flock64; + +#include MPERS_DEFS + +#define SIZEOF_MEMBER(type, member) \ + sizeof(((type *) NULL)->member) + +#define FLOCK_MEMBERS_EQ(type, member) \ + (SIZEOF_MEMBER(struct_kernel_flock64, member) == SIZEOF_MEMBER(type, member) \ + && offsetof(struct_kernel_flock64, member) == offsetof(type, member)) + +#define FLOCK_STRUCTS_EQ(type) \ + (sizeof(struct_kernel_flock64) == sizeof(type) \ + && FLOCK_MEMBERS_EQ(type, l_type) \ + && FLOCK_MEMBERS_EQ(type, l_whence) \ + && FLOCK_MEMBERS_EQ(type, l_start) \ + && FLOCK_MEMBERS_EQ(type, l_len) \ + && FLOCK_MEMBERS_EQ(type, l_pid)) + +MPERS_PRINTER_DECL(bool, fetch_struct_flock, struct tcb *const tcp, + const kernel_ulong_t addr, void *const p) +{ + struct_kernel_flock64 *pfl = p; + struct_flock mfl; + + if (FLOCK_STRUCTS_EQ(struct_flock)) + return !umove_or_printaddr(tcp, addr, pfl); + + if (umove_or_printaddr(tcp, addr, &mfl)) + return false; + + pfl->l_type = mfl.l_type; + pfl->l_whence = mfl.l_whence; + pfl->l_start = mfl.l_start; + pfl->l_len = mfl.l_len; + pfl->l_pid = mfl.l_pid; + return true; +} + +MPERS_PRINTER_DECL(bool, fetch_struct_flock64, struct tcb *const tcp, + const kernel_ulong_t addr, void *const p) +{ + struct_kernel_flock64 *pfl = p; + struct_flock64 mfl; + + if (FLOCK_STRUCTS_EQ(struct_flock64)) + return !umove_or_printaddr(tcp, addr, pfl); + + if (umove_or_printaddr(tcp, addr, &mfl)) + return false; + + pfl->l_type = mfl.l_type; + pfl->l_whence = mfl.l_whence; + pfl->l_start = mfl.l_start; + pfl->l_len = mfl.l_len; + pfl->l_pid = mfl.l_pid; + return true; +} diff --git a/fetch_struct_mmsghdr.c b/fetch_struct_mmsghdr.c new file mode 100644 index 00000000..04f98aba --- /dev/null +++ b/fetch_struct_mmsghdr.c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_mmsghdr) + +#include "msghdr.h" +typedef struct mmsghdr struct_mmsghdr; + +#include MPERS_DEFS + +/* + * On success, return the number of fetched bytes. + * On error, return 0; + * + * This function cannot use umove_or_printaddr because + * it is called by dumpio and therefore cannot print anything. + */ + +MPERS_PRINTER_DECL(int, fetch_struct_mmsghdr, + struct tcb *const tcp, const kernel_ulong_t addr, + void *const p) +{ + struct mmsghdr *p_native = p; + struct_mmsghdr v_compat; + + if (sizeof(*p_native) == sizeof(v_compat)) + return umove(tcp, addr, p_native) ? 0 : sizeof(*p_native); + + if (umove(tcp, addr, &v_compat)) + return 0; + + p_native->msg_hdr.msg_name = (void *) (unsigned long) + v_compat.msg_hdr.msg_name; + + p_native->msg_hdr.msg_namelen = + v_compat.msg_hdr.msg_namelen; + + p_native->msg_hdr.msg_iov = (void *) (unsigned long) + v_compat.msg_hdr.msg_iov; + + p_native->msg_hdr.msg_iovlen = + v_compat.msg_hdr.msg_iovlen; + + p_native->msg_hdr.msg_control = (void *) (unsigned long) + v_compat.msg_hdr.msg_control; + + p_native->msg_hdr.msg_controllen = + v_compat.msg_hdr.msg_controllen; + + p_native->msg_hdr.msg_flags = + v_compat.msg_hdr.msg_flags; + + p_native->msg_len = + v_compat.msg_len; + + return sizeof(v_compat); +} + +MPERS_PRINTER_DECL(unsigned int, sizeof_struct_mmsghdr, void) +{ + return sizeof(struct_mmsghdr); +} diff --git a/fetch_struct_msghdr.c b/fetch_struct_msghdr.c new file mode 100644 index 00000000..d5f5adc5 --- /dev/null +++ b/fetch_struct_msghdr.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_msghdr) + +#include "msghdr.h" +typedef struct msghdr struct_msghdr; + +#include MPERS_DEFS + +/* + * On success, return the number of fetched bytes. + * On error, return 0; + * + * This function cannot use umove_or_printaddr because + * it is called by dumpio and therefore cannot print anything. + */ + +MPERS_PRINTER_DECL(int, fetch_struct_msghdr, + struct tcb *const tcp, const kernel_ulong_t addr, + void *const p) +{ + struct msghdr *const p_native = p; + struct_msghdr v_compat; + + if (sizeof(*p_native) == sizeof(v_compat)) + return umove(tcp, addr, p_native) ? 0 : sizeof(*p_native); + + if (umove(tcp, addr, &v_compat)) + return 0; + + p_native->msg_name = (void *) (unsigned long) + v_compat.msg_name; + + p_native->msg_namelen = + v_compat.msg_namelen; + + p_native->msg_iov = (void *) (unsigned long) + v_compat.msg_iov; + + p_native->msg_iovlen = + v_compat.msg_iovlen; + + p_native->msg_control = (void *) (unsigned long) + v_compat.msg_control; + + p_native->msg_controllen = + v_compat.msg_controllen; + + p_native->msg_flags = + v_compat.msg_flags; + + return sizeof(v_compat); +} diff --git a/fetch_struct_stat.c b/fetch_struct_stat.c new file mode 100644 index 00000000..50d10284 --- /dev/null +++ b/fetch_struct_stat.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_stat) + +#include "asm_stat.h" + +#if defined MPERS_IS_m32 +# undef HAVE_STRUCT_STAT +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_M32_STRUCT_STAT +# define HAVE_STRUCT_STAT 1 +# ifdef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif /* HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC */ +# endif /* HAVE_M32_STRUCT_STAT */ +#elif defined MPERS_IS_mx32 +# undef HAVE_STRUCT_STAT +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_MX32_STRUCT_STAT +# define HAVE_STRUCT_STAT 1 +# ifdef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif /* HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC */ +# endif /* HAVE_MX32_STRUCT_STAT */ +#else /* !MPERS_IS_m32 && !MPERS_IS_mx32 */ +# define HAVE_STRUCT_STAT 1 +#endif + +#ifndef HAVE_STRUCT_STAT +struct stat {}; +#endif + +typedef struct stat struct_stat; + +#include MPERS_DEFS + +#include "stat.h" + +#ifdef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# define TIME_NSEC(arg) zero_extend_signed_to_ull(arg) +#else +# define TIME_NSEC(arg) 0 +#endif + +MPERS_PRINTER_DECL(bool, fetch_struct_stat, + struct tcb *const tcp, const kernel_ulong_t addr, + struct strace_stat *const dst) +{ +#ifdef HAVE_STRUCT_STAT + struct_stat buf; + if (umove_or_printaddr(tcp, addr, &buf)) + return false; + + dst->dev = zero_extend_signed_to_ull(buf.st_dev); + dst->ino = zero_extend_signed_to_ull(buf.st_ino); + dst->rdev = zero_extend_signed_to_ull(buf.st_rdev); + dst->size = zero_extend_signed_to_ull(buf.st_size); + dst->blocks = zero_extend_signed_to_ull(buf.st_blocks); + dst->blksize = zero_extend_signed_to_ull(buf.st_blksize); + dst->mode = zero_extend_signed_to_ull(buf.st_mode); + dst->nlink = zero_extend_signed_to_ull(buf.st_nlink); + dst->uid = zero_extend_signed_to_ull(buf.st_uid); + dst->gid = zero_extend_signed_to_ull(buf.st_gid); + dst->atime = sign_extend_unsigned_to_ll(buf.st_atime); + dst->ctime = sign_extend_unsigned_to_ll(buf.st_ctime); + dst->mtime = sign_extend_unsigned_to_ll(buf.st_mtime); + dst->atime_nsec = TIME_NSEC(buf.st_atime_nsec); + dst->ctime_nsec = TIME_NSEC(buf.st_ctime_nsec); + dst->mtime_nsec = TIME_NSEC(buf.st_mtime_nsec); + return true; +#else /* !HAVE_STRUCT_STAT */ + printaddr(addr); + return false; +#endif +} diff --git a/fetch_struct_stat64.c b/fetch_struct_stat64.c new file mode 100644 index 00000000..b7e48057 --- /dev/null +++ b/fetch_struct_stat64.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_stat64) + +#include "asm_stat.h" + +#if defined MPERS_IS_m32 +# undef HAVE_STRUCT_STAT64 +# undef HAVE_STRUCT_STAT64_ST_MTIME_NSEC +# ifdef HAVE_M32_STRUCT_STAT64 +# define HAVE_STRUCT_STAT64 1 +# ifdef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT64_ST_MTIME_NSEC 1 +# endif /* HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC */ +# endif /* HAVE_M32_STRUCT_STAT64 */ +#elif defined MPERS_IS_mx32 +# undef HAVE_STRUCT_STAT64 +# undef HAVE_STRUCT_STAT64_ST_MTIME_NSEC +# ifdef HAVE_MX32_STRUCT_STAT64 +# define HAVE_STRUCT_STAT64 1 +# ifdef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT64_ST_MTIME_NSEC 1 +# endif /* HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC */ +# endif /* HAVE_MX32_STRUCT_STAT64 */ +#endif /* MPERS_IS_m32 || MPERS_IS_mx32 */ + +#ifndef HAVE_STRUCT_STAT64 +struct stat64 {}; +#endif + +typedef struct stat64 struct_stat64; + +#include MPERS_DEFS + +#include "stat.h" + +#ifdef HAVE_STRUCT_STAT64_ST_MTIME_NSEC +# define TIME_NSEC(arg) zero_extend_signed_to_ull(arg) +#else +# define TIME_NSEC(arg) 0 +#endif + +MPERS_PRINTER_DECL(bool, fetch_struct_stat64, + struct tcb *const tcp, const kernel_ulong_t addr, + struct strace_stat *const dst) +{ +#ifdef HAVE_STRUCT_STAT64 + struct_stat64 buf; + if (umove_or_printaddr(tcp, addr, &buf)) + return false; + + dst->dev = zero_extend_signed_to_ull(buf.st_dev); + dst->ino = zero_extend_signed_to_ull(buf.st_ino); + dst->rdev = zero_extend_signed_to_ull(buf.st_rdev); + dst->size = zero_extend_signed_to_ull(buf.st_size); + dst->blocks = zero_extend_signed_to_ull(buf.st_blocks); + dst->blksize = zero_extend_signed_to_ull(buf.st_blksize); + dst->mode = zero_extend_signed_to_ull(buf.st_mode); + dst->nlink = zero_extend_signed_to_ull(buf.st_nlink); + dst->uid = zero_extend_signed_to_ull(buf.st_uid); + dst->gid = zero_extend_signed_to_ull(buf.st_gid); + dst->atime = sign_extend_unsigned_to_ll(buf.st_atime); + dst->ctime = sign_extend_unsigned_to_ll(buf.st_ctime); + dst->mtime = sign_extend_unsigned_to_ll(buf.st_mtime); + dst->atime_nsec = TIME_NSEC(buf.st_atime_nsec); + dst->ctime_nsec = TIME_NSEC(buf.st_ctime_nsec); + dst->mtime_nsec = TIME_NSEC(buf.st_mtime_nsec); + return true; +#else /* !HAVE_STRUCT_STAT64 */ + printaddr(addr); + return false; +#endif +} diff --git a/fetch_struct_statfs.c b/fetch_struct_statfs.c new file mode 100644 index 00000000..454e5b4e --- /dev/null +++ b/fetch_struct_statfs.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_statfs) +#include DEF_MPERS_TYPE(struct_statfs64) + +#include +#include +typedef struct statfs struct_statfs; +typedef struct statfs64 struct_statfs64; + +#include MPERS_DEFS + +#include "statfs.h" + +MPERS_PRINTER_DECL(bool, fetch_struct_statfs, + struct tcb *const tcp, const kernel_ulong_t addr, + struct strace_statfs *const p) +{ + struct_statfs b; + + if (umove_or_printaddr(tcp, addr, &b)) + return false; + + p->f_type = zero_extend_signed_to_ull(b.f_type); + p->f_bsize = zero_extend_signed_to_ull(b.f_bsize); + p->f_blocks = zero_extend_signed_to_ull(b.f_blocks); + p->f_bfree = zero_extend_signed_to_ull(b.f_bfree); + p->f_bavail = zero_extend_signed_to_ull(b.f_bavail); + p->f_files = zero_extend_signed_to_ull(b.f_files); + p->f_ffree = zero_extend_signed_to_ull(b.f_ffree); +#if defined HAVE_STRUCT_STATFS_F_FSID_VAL + p->f_fsid[0] = zero_extend_signed_to_ull(b.f_fsid.val[0]); + p->f_fsid[1] = zero_extend_signed_to_ull(b.f_fsid.val[1]); +#elif defined HAVE_STRUCT_STATFS_F_FSID___VAL + p->f_fsid[0] = zero_extend_signed_to_ull(b.f_fsid.__val[0]); + p->f_fsid[1] = zero_extend_signed_to_ull(b.f_fsid.__val[1]); +#endif + p->f_namelen = zero_extend_signed_to_ull(b.f_namelen); +#ifdef HAVE_STRUCT_STATFS_F_FRSIZE + p->f_frsize = zero_extend_signed_to_ull(b.f_frsize); +#endif +#ifdef HAVE_STRUCT_STATFS_F_FLAGS + p->f_flags = zero_extend_signed_to_ull(b.f_flags); +#endif + + return true; +} + +#if defined ARM || (defined AARCH64 && defined IN_MPERS) +/* See arch/arm/kernel/sys_oabi-compat.c for details. */ +# define COMPAT_STATFS64_PADDED_SIZE (sizeof(struct_statfs64) + 4) +#endif + +MPERS_PRINTER_DECL(bool, fetch_struct_statfs64, + struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t size, struct strace_statfs *const p) +{ + struct_statfs64 b; + + if (sizeof(b) != size +#ifdef COMPAT_STATFS64_PADDED_SIZE + && sizeof(b) != COMPAT_STATFS64_PADDED_SIZE +#endif + ) { + printaddr(addr); + return false; + } + + if (umove_or_printaddr(tcp, addr, &b)) + return false; + + p->f_type = zero_extend_signed_to_ull(b.f_type); + p->f_bsize = zero_extend_signed_to_ull(b.f_bsize); + p->f_blocks = zero_extend_signed_to_ull(b.f_blocks); + p->f_bfree = zero_extend_signed_to_ull(b.f_bfree); + p->f_bavail = zero_extend_signed_to_ull(b.f_bavail); + p->f_files = zero_extend_signed_to_ull(b.f_files); + p->f_ffree = zero_extend_signed_to_ull(b.f_ffree); +#if defined HAVE_STRUCT_STATFS64_F_FSID_VAL + p->f_fsid[0] = zero_extend_signed_to_ull(b.f_fsid.val[0]); + p->f_fsid[1] = zero_extend_signed_to_ull(b.f_fsid.val[1]); +#elif defined HAVE_STRUCT_STATFS64_F_FSID___VAL + p->f_fsid[0] = zero_extend_signed_to_ull(b.f_fsid.__val[0]); + p->f_fsid[1] = zero_extend_signed_to_ull(b.f_fsid.__val[1]); +#endif + p->f_namelen = zero_extend_signed_to_ull(b.f_namelen); +#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE + p->f_frsize = zero_extend_signed_to_ull(b.f_frsize); +#endif +#ifdef HAVE_STRUCT_STATFS64_F_FLAGS + p->f_flags = zero_extend_signed_to_ull(b.f_flags); +#endif + + return true; +} diff --git a/file.c b/file.c deleted file mode 100644 index 986f4465..00000000 --- a/file.c +++ /dev/null @@ -1,2529 +0,0 @@ -/* - * Copyright (c) 1991, 1992 Paul Kranenburg - * Copyright (c) 1993 Branko Lankester - * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey - * Copyright (c) 1996-1999 Wichert Akkerman - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "defs.h" -#include -#include - -#if defined(SPARC) || defined(SPARC64) -struct stat { - unsigned short st_dev; - unsigned int st_ino; - unsigned short st_mode; - short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned int st_size; - int st_atime; - unsigned int __unused1; - int st_mtime; - unsigned int __unused2; - int st_ctime; - unsigned int __unused3; - int st_blksize; - int st_blocks; - unsigned int __unused4[2]; -}; -# if defined(SPARC64) -struct stat_sparc64 { - unsigned int st_dev; - unsigned long st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; - unsigned int st_gid; - unsigned int st_rdev; - long st_size; - long st_atime; - long st_mtime; - long st_ctime; - long st_blksize; - long st_blocks; - unsigned long __unused4[2]; -}; -# endif /* SPARC64 */ -# define stat kernel_stat -# include -# undef stat -#elif defined(X32) -struct stat { - unsigned long long st_dev; - unsigned long long st_ino; - unsigned long long st_nlink; - - unsigned int st_mode; - unsigned int st_uid; - unsigned int st_gid; - unsigned int __pad0; - unsigned long long st_rdev; - long long st_size; - long long st_blksize; - long long st_blocks; - - unsigned long long st_atime; - unsigned long long st_atime_nsec; - unsigned long long st_mtime; - unsigned long long st_mtime_nsec; - unsigned long long st_ctime; - unsigned long long st_ctime_nsec; - long long __unused[3]; -}; - -struct stat64 { - unsigned long long st_dev; - unsigned char __pad0[4]; - unsigned long __st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned long st_uid; - unsigned long st_gid; - unsigned long long st_rdev; - unsigned char __pad3[4]; - long long st_size; - unsigned long st_blksize; - unsigned long long st_blocks; - unsigned long st_atime; - unsigned long st_atime_nsec; - unsigned long st_mtime; - unsigned int st_mtime_nsec; - unsigned long st_ctime; - unsigned long st_ctime_nsec; - unsigned long long st_ino; -} __attribute__((packed)); -# define HAVE_STAT64 1 - -struct __old_kernel_stat { - unsigned short st_dev; - unsigned short st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned int st_size; - unsigned int st_atime; - unsigned int st_mtime; - unsigned int st_ctime; -}; -#else -# undef dev_t -# undef ino_t -# undef mode_t -# undef nlink_t -# undef uid_t -# undef gid_t -# undef off_t -# undef loff_t -# define dev_t __kernel_dev_t -# define ino_t __kernel_ino_t -# define mode_t __kernel_mode_t -# define nlink_t __kernel_nlink_t -# define uid_t __kernel_uid_t -# define gid_t __kernel_gid_t -# define off_t __kernel_off_t -# define loff_t __kernel_loff_t - -# include - -# undef dev_t -# undef ino_t -# undef mode_t -# undef nlink_t -# undef uid_t -# undef gid_t -# undef off_t -# undef loff_t -# define dev_t dev_t -# define ino_t ino_t -# define mode_t mode_t -# define nlink_t nlink_t -# define uid_t uid_t -# define gid_t gid_t -# define off_t off_t -# define loff_t loff_t -#endif - -#define stat libc_stat -#define stat64 libc_stat64 -#include -#undef stat -#undef stat64 -/* These might be macros. */ -#undef st_atime -#undef st_mtime -#undef st_ctime - -#include -#ifdef HAVE_SYS_VFS_H -# include -#endif -#ifdef HAVE_LINUX_XATTR_H -# include -#else -# define XATTR_CREATE 1 -# define XATTR_REPLACE 2 -#endif - -#ifdef MAJOR_IN_SYSMACROS -# include -#endif - -#ifdef MAJOR_IN_MKDEV -# include -#endif - -#ifdef HAVE_SYS_ASYNCH_H -# include -#endif - -struct kernel_dirent { - unsigned long d_ino; - unsigned long d_off; - unsigned short d_reclen; - char d_name[1]; -}; - -#ifdef O_LARGEFILE -# if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */ -# undef O_LARGEFILE -# ifdef SPARC64 -# define O_LARGEFILE 0x40000 -# elif defined X86_64 || defined S390X -# define O_LARGEFILE 0100000 -# endif -# endif -#endif - -#include "xlat/open_access_modes.h" -#include "xlat/open_mode_flags.h" - -#ifndef AT_FDCWD -# define AT_FDCWD -100 -#endif - -/* The fd is an "int", so when decoding x86 on x86_64, we need to force sign - * extension to get the right value. We do this by declaring fd as int here. - */ -void -print_dirfd(struct tcb *tcp, int fd) -{ - if (fd == AT_FDCWD) - tprints("AT_FDCWD, "); - else { - printfd(tcp, fd); - tprints(", "); - } -} - -/* - * low bits of the open(2) flags define access mode, - * other bits are real flags. - */ -const char * -sprint_open_modes(mode_t flags) -{ - static char outstr[(1 + ARRAY_SIZE(open_mode_flags)) * sizeof("O_LARGEFILE")]; - char *p; - char sep; - const char *str; - const struct xlat *x; - - sep = ' '; - p = stpcpy(outstr, "flags"); - str = xlookup(open_access_modes, flags & 3); - if (str) { - *p++ = sep; - p = stpcpy(p, str); - flags &= ~3; - if (!flags) - return outstr; - sep = '|'; - } - - for (x = open_mode_flags; x->str; x++) { - if ((flags & x->val) == x->val) { - *p++ = sep; - p = stpcpy(p, x->str); - flags &= ~x->val; - if (!flags) - return outstr; - sep = '|'; - } - } - /* flags is still nonzero */ - *p++ = sep; - sprintf(p, "%#x", flags); - return outstr; -} - -void -tprint_open_modes(mode_t flags) -{ - tprints(sprint_open_modes(flags) + sizeof("flags")); -} - -static int -decode_open(struct tcb *tcp, int offset) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[offset]); - tprints(", "); - /* flags */ - tprint_open_modes(tcp->u_arg[offset + 1]); - if (tcp->u_arg[offset + 1] & O_CREAT) { - /* mode */ - tprintf(", %#lo", tcp->u_arg[offset + 2]); - } - } - return RVAL_FD; -} - -int -sys_open(struct tcb *tcp) -{ - return decode_open(tcp, 0); -} - -int -sys_openat(struct tcb *tcp) -{ - if (entering(tcp)) - print_dirfd(tcp, tcp->u_arg[0]); - return decode_open(tcp, 1); -} - -#if defined(SPARC) || defined(SPARC64) -#include "xlat/openmodessol.h" - -int -solaris_open(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - /* flags */ - printflags(openmodessol, tcp->u_arg[1] + 1, "O_???"); - if (tcp->u_arg[1] & 0x100) { - /* mode */ - tprintf(", %#lo", tcp->u_arg[2]); - } - } - return 0; -} - -#endif - -int -sys_creat(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprintf(", %#lo", tcp->u_arg[1]); - } - return RVAL_FD; -} - -#include "xlat/access_flags.h" - -static int -decode_access(struct tcb *tcp, int offset) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[offset]); - tprints(", "); - printflags(access_flags, tcp->u_arg[offset + 1], "?_OK"); - } - return 0; -} - -int -sys_access(struct tcb *tcp) -{ - return decode_access(tcp, 0); -} - -int -sys_faccessat(struct tcb *tcp) -{ - if (entering(tcp)) - print_dirfd(tcp, tcp->u_arg[0]); - return decode_access(tcp, 1); -} - -int -sys_umask(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%#lo", tcp->u_arg[0]); - } - return RVAL_OCTAL; -} - -#include "xlat/whence_codes.h" - -/* Linux kernel has exactly one version of lseek: - * fs/read_write.c::SYSCALL_DEFINE3(lseek, unsigned, fd, off_t, offset, unsigned, origin) - * In kernel, off_t is always the same as (kernel's) long - * (see include/uapi/asm-generic/posix_types.h), - * which means that on x32 we need to use tcp->ext_arg[N] to get offset argument. - * Use test/x32_lseek.c to test lseek decoding. - */ -#if defined(LINUX_MIPSN32) || defined(X32) -int -sys_lseek(struct tcb *tcp) -{ - long long offset; - int whence; - - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - offset = tcp->ext_arg[1]; - whence = tcp->u_arg[2]; - if (whence == SEEK_SET) - tprintf(", %llu, ", offset); - else - tprintf(", %lld, ", offset); - printxval(whence_codes, whence, "SEEK_???"); - } - return RVAL_LUDECIMAL; -} -#else -int -sys_lseek(struct tcb *tcp) -{ - long offset; - int whence; - - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - offset = tcp->u_arg[1]; - whence = tcp->u_arg[2]; - if (whence == SEEK_SET) - tprintf(", %lu, ", offset); - else - tprintf(", %ld, ", offset); - printxval(whence_codes, whence, "SEEK_???"); - } - return RVAL_UDECIMAL; -} -#endif - -/* llseek syscall takes explicitly two ulong arguments hi, lo, - * rather than one 64-bit argument for which LONG_LONG works - * appropriate for the native byte order. - * - * See kernel's fs/read_write.c::SYSCALL_DEFINE5(llseek, ...) - * - * hi,lo are "unsigned longs" and combined exactly this way in kernel: - * ((loff_t) hi << 32) | lo - * Note that for architectures with kernel's long wider than userspace long - * (such as x32), combining code will use *kernel's*, i.e. *wide* longs - * for hi and lo. We would need to use tcp->ext_arg[N] on x32... - * ...however, x32 (and x86_64) does not _have_ llseek syscall as such. - */ -int -sys_llseek(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - if (tcp->u_arg[4] == SEEK_SET) - tprintf(", %llu, ", - ((long long) tcp->u_arg[1]) << 32 | - (unsigned long long) (unsigned) tcp->u_arg[2]); - else - tprintf(", %lld, ", - ((long long) tcp->u_arg[1]) << 32 | - (unsigned long long) (unsigned) tcp->u_arg[2]); - } - else { - long long off; - if (syserror(tcp) || umove(tcp, tcp->u_arg[3], &off) < 0) - tprintf("%#lx, ", tcp->u_arg[3]); - else - tprintf("[%llu], ", off); - printxval(whence_codes, tcp->u_arg[4], "SEEK_???"); - } - return 0; -} - -int -sys_readahead(struct tcb *tcp) -{ - if (entering(tcp)) { - int argn; - printfd(tcp, tcp->u_arg[0]); - argn = printllval(tcp, ", %lld", 1); - tprintf(", %ld", tcp->u_arg[argn]); - } - return 0; -} - -int -sys_truncate(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; -} - -int -sys_truncate64(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - printllval(tcp, ", %llu", 1); - } - return 0; -} - -int -sys_ftruncate(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; -} - -int -sys_ftruncate64(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - printllval(tcp, ", %llu", 1); - } - return 0; -} - -/* several stats */ - -#include "xlat/modetypes.h" - -static const char * -sprintmode(int mode) -{ - static char buf[sizeof("S_IFSOCK|S_ISUID|S_ISGID|S_ISVTX|%o") - + sizeof(int)*3 - + /*paranoia:*/ 8]; - const char *s; - - if ((mode & S_IFMT) == 0) - s = ""; - else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) { - sprintf(buf, "%#o", mode); - return buf; - } - s = buf + sprintf(buf, "%s%s%s%s", s, - (mode & S_ISUID) ? "|S_ISUID" : "", - (mode & S_ISGID) ? "|S_ISGID" : "", - (mode & S_ISVTX) ? "|S_ISVTX" : ""); - mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX); - if (mode) - sprintf((char*)s, "|%#o", mode); - s = (*buf == '|') ? buf + 1 : buf; - return *s ? s : "0"; -} - -static char * -sprinttime(time_t t) -{ - struct tm *tmp; - static char buf[sizeof("yyyy/mm/dd-hh:mm:ss")]; - - if (t == 0) { - strcpy(buf, "0"); - return buf; - } - tmp = localtime(&t); - if (tmp) - snprintf(buf, sizeof buf, "%02d/%02d/%02d-%02d:%02d:%02d", - tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); - else - snprintf(buf, sizeof buf, "%lu", (unsigned long) t); - - return buf; -} - -#if defined(SPARC) || defined(SPARC64) -typedef struct { - int tv_sec; - int tv_nsec; -} timestruct_t; - -struct solstat { - unsigned st_dev; - int st_pad1[3]; /* network id */ - unsigned st_ino; - unsigned st_mode; - unsigned st_nlink; - unsigned st_uid; - unsigned st_gid; - unsigned st_rdev; - int st_pad2[2]; - int st_size; - int st_pad3; /* st_size, off_t expansion */ - timestruct_t st_atime; - timestruct_t st_mtime; - timestruct_t st_ctime; - int st_blksize; - int st_blocks; - char st_fstype[16]; - int st_pad4[8]; /* expansion area */ -}; - -static void -printstatsol(struct tcb *tcp, long addr) -{ - struct solstat statbuf; - - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - if (!abbrev(tcp)) { - tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ", - (unsigned long) ((statbuf.st_dev >> 18) & 0x3fff), - (unsigned long) (statbuf.st_dev & 0x3ffff), - (unsigned long) statbuf.st_ino, - sprintmode(statbuf.st_mode)); - tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ", - (unsigned long) statbuf.st_nlink, - (unsigned long) statbuf.st_uid, - (unsigned long) statbuf.st_gid); - tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize); - tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks); - } - else - tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode)); - switch (statbuf.st_mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: - tprintf("st_rdev=makedev(%lu, %lu), ", - (unsigned long) ((statbuf.st_rdev >> 18) & 0x3fff), - (unsigned long) (statbuf.st_rdev & 0x3ffff)); - break; - default: - tprintf("st_size=%u, ", statbuf.st_size); - break; - } - if (!abbrev(tcp)) { - tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime.tv_sec)); - tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime.tv_sec)); - tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime.tv_sec)); - } - else - tprints("...}"); -} - -# if defined(SPARC64) -static void -printstat_sparc64(struct tcb *tcp, long addr) -{ - struct stat_sparc64 statbuf; - - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - - if (!abbrev(tcp)) { - tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ", - (unsigned long) major(statbuf.st_dev), - (unsigned long) minor(statbuf.st_dev), - (unsigned long) statbuf.st_ino, - sprintmode(statbuf.st_mode)); - tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ", - (unsigned long) statbuf.st_nlink, - (unsigned long) statbuf.st_uid, - (unsigned long) statbuf.st_gid); - tprintf("st_blksize=%lu, ", - (unsigned long) statbuf.st_blksize); - tprintf("st_blocks=%lu, ", - (unsigned long) statbuf.st_blocks); - } - else - tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode)); - switch (statbuf.st_mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: - tprintf("st_rdev=makedev(%lu, %lu), ", - (unsigned long) major(statbuf.st_rdev), - (unsigned long) minor(statbuf.st_rdev)); - break; - default: - tprintf("st_size=%lu, ", statbuf.st_size); - break; - } - if (!abbrev(tcp)) { - tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime)); - tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime)); - tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime)); - } - else - tprints("...}"); -} -# endif /* SPARC64 */ -#endif /* SPARC[64] */ - -#if defined POWERPC64 -struct stat_powerpc32 { - unsigned int st_dev; - unsigned int st_ino; - unsigned int st_mode; - unsigned short st_nlink; - unsigned int st_uid; - unsigned int st_gid; - unsigned int st_rdev; - unsigned int st_size; - unsigned int st_blksize; - unsigned int st_blocks; - unsigned int st_atime; - unsigned int st_atime_nsec; - unsigned int st_mtime; - unsigned int st_mtime_nsec; - unsigned int st_ctime; - unsigned int st_ctime_nsec; - unsigned int __unused4; - unsigned int __unused5; -}; - -static void -printstat_powerpc32(struct tcb *tcp, long addr) -{ - struct stat_powerpc32 statbuf; - - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - - if (!abbrev(tcp)) { - tprintf("{st_dev=makedev(%u, %u), st_ino=%u, st_mode=%s, ", - major(statbuf.st_dev), minor(statbuf.st_dev), - statbuf.st_ino, - sprintmode(statbuf.st_mode)); - tprintf("st_nlink=%u, st_uid=%u, st_gid=%u, ", - statbuf.st_nlink, statbuf.st_uid, statbuf.st_gid); - tprintf("st_blksize=%u, ", statbuf.st_blksize); - tprintf("st_blocks=%u, ", statbuf.st_blocks); - } - else - tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode)); - switch (statbuf.st_mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: - tprintf("st_rdev=makedev(%lu, %lu), ", - (unsigned long) major(statbuf.st_rdev), - (unsigned long) minor(statbuf.st_rdev)); - break; - default: - tprintf("st_size=%u, ", statbuf.st_size); - break; - } - if (!abbrev(tcp)) { - tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime)); - tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime)); - tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime)); - } - else - tprints("...}"); -} -#endif /* POWERPC64 */ - -#include "xlat/fileflags.h" - -static void -realprintstat(struct tcb *tcp, struct stat *statbuf) -{ - if (!abbrev(tcp)) { - tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ", - (unsigned long) major(statbuf->st_dev), - (unsigned long) minor(statbuf->st_dev), - (unsigned long) statbuf->st_ino, - sprintmode(statbuf->st_mode)); - tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ", - (unsigned long) statbuf->st_nlink, - (unsigned long) statbuf->st_uid, - (unsigned long) statbuf->st_gid); -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE - tprintf("st_blksize=%lu, ", (unsigned long) statbuf->st_blksize); -#endif -#ifdef HAVE_STRUCT_STAT_ST_BLOCKS - tprintf("st_blocks=%lu, ", (unsigned long) statbuf->st_blocks); -#endif - } - else - tprintf("{st_mode=%s, ", sprintmode(statbuf->st_mode)); - switch (statbuf->st_mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: -#ifdef HAVE_STRUCT_STAT_ST_RDEV - tprintf("st_rdev=makedev(%lu, %lu), ", - (unsigned long) major(statbuf->st_rdev), - (unsigned long) minor(statbuf->st_rdev)); -#else /* !HAVE_STRUCT_STAT_ST_RDEV */ - tprintf("st_size=makedev(%lu, %lu), ", - (unsigned long) major(statbuf->st_size), - (unsigned long) minor(statbuf->st_size)); -#endif /* !HAVE_STRUCT_STAT_ST_RDEV */ - break; - default: - tprintf("st_size=%lu, ", (unsigned long) statbuf->st_size); - break; - } - if (!abbrev(tcp)) { - tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime)); - tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime)); - tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime)); -#if HAVE_STRUCT_STAT_ST_FLAGS - tprints(", st_flags="); - printflags(fileflags, statbuf->st_flags, "UF_???"); -#endif -#if HAVE_STRUCT_STAT_ST_ACLCNT - tprintf(", st_aclcnt=%d", statbuf->st_aclcnt); -#endif -#if HAVE_STRUCT_STAT_ST_LEVEL - tprintf(", st_level=%ld", statbuf->st_level); -#endif -#if HAVE_STRUCT_STAT_ST_FSTYPE - tprintf(", st_fstype=%.*s", - (int) sizeof statbuf->st_fstype, statbuf->st_fstype); -#endif -#if HAVE_STRUCT_STAT_ST_GEN - tprintf(", st_gen=%u", statbuf->st_gen); -#endif - tprints("}"); - } - else - tprints("...}"); -} - -#ifndef X32 -static void -printstat(struct tcb *tcp, long addr) -{ - struct stat statbuf; - - if (!addr) { - tprints("NULL"); - return; - } - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - -#if defined(SPARC) || defined(SPARC64) - if (current_personality == 1) { - printstatsol(tcp, addr); - return; - } -#ifdef SPARC64 - else if (current_personality == 2) { - printstat_sparc64(tcp, addr); - return; - } -#endif -#endif /* SPARC[64] */ - -#if defined POWERPC64 - if (current_personality == 1) { - printstat_powerpc32(tcp, addr); - return; - } -#endif - - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - - realprintstat(tcp, &statbuf); -} -#else /* X32 */ -# define printstat printstat64 -#endif - -#if !defined HAVE_STAT64 && (defined AARCH64 || defined X86_64) -/* - * Linux x86_64 has unified `struct stat' but its i386 biarch needs - * `struct stat64'. Its definition expects 32-bit `long'. - * is not in the public includes set. - * __GNUC__ is needed for the required __attribute__ below. - * - * Similarly, aarch64 has a unified `struct stat' but its arm personality - * needs `struct stat64' (which also expects a 32-bit `long' but which - * shouldn't be packed). - */ -struct stat64 { - unsigned long long st_dev; - unsigned char __pad0[4]; - unsigned int __st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; - unsigned int st_gid; - unsigned long long st_rdev; - unsigned char __pad3[4]; - long long st_size; - unsigned int st_blksize; - unsigned long long st_blocks; - unsigned int st_atime; - unsigned int st_atime_nsec; - unsigned int st_mtime; - unsigned int st_mtime_nsec; - unsigned int st_ctime; - unsigned int st_ctime_nsec; - unsigned long long st_ino; -} -# if defined X86_64 - __attribute__((packed)) -# define STAT64_SIZE 96 -#else -# define STAT64_SIZE 104 -# endif -; -# define HAVE_STAT64 1 -#endif - -#ifdef HAVE_STAT64 -static void -printstat64(struct tcb *tcp, long addr) -{ -#ifdef X32 - struct stat statbuf; -#else - struct stat64 statbuf; -#endif - -#ifdef STAT64_SIZE - (void) sizeof(char[sizeof statbuf == STAT64_SIZE ? 1 : -1]); -#endif - - if (!addr) { - tprints("NULL"); - return; - } - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - -#if defined(SPARC) || defined(SPARC64) - if (current_personality == 1) { - printstatsol(tcp, addr); - return; - } -# ifdef SPARC64 - else if (current_personality == 2) { - printstat_sparc64(tcp, addr); - return; - } -# endif -#endif /* SPARC[64] */ - -#if defined AARCH64 - if (current_personality != 0) { - printstat(tcp, addr); - return; - } -#endif -#if defined X86_64 - if (current_personality != 1) { - printstat(tcp, addr); - return; - } -#endif - - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - - if (!abbrev(tcp)) { - tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ", - (unsigned long) major(statbuf.st_dev), - (unsigned long) minor(statbuf.st_dev), - (unsigned long long) statbuf.st_ino, - sprintmode(statbuf.st_mode)); - tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ", - (unsigned long) statbuf.st_nlink, - (unsigned long) statbuf.st_uid, - (unsigned long) statbuf.st_gid); -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE - tprintf("st_blksize=%lu, ", - (unsigned long) statbuf.st_blksize); -#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */ -#ifdef HAVE_STRUCT_STAT_ST_BLOCKS - tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks); -#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */ - } - else - tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode)); - switch (statbuf.st_mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: -#ifdef HAVE_STRUCT_STAT_ST_RDEV - tprintf("st_rdev=makedev(%lu, %lu), ", - (unsigned long) major(statbuf.st_rdev), - (unsigned long) minor(statbuf.st_rdev)); -#else /* !HAVE_STRUCT_STAT_ST_RDEV */ - tprintf("st_size=makedev(%lu, %lu), ", - (unsigned long) major(statbuf.st_size), - (unsigned long) minor(statbuf.st_size)); -#endif /* !HAVE_STRUCT_STAT_ST_RDEV */ - break; - default: - tprintf("st_size=%llu, ", (unsigned long long) statbuf.st_size); - break; - } - if (!abbrev(tcp)) { - tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime)); - tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime)); - tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime)); -#if HAVE_STRUCT_STAT_ST_FLAGS - tprints(", st_flags="); - printflags(fileflags, statbuf.st_flags, "UF_???"); -#endif -#if HAVE_STRUCT_STAT_ST_ACLCNT - tprintf(", st_aclcnt=%d", statbuf.st_aclcnt); -#endif -#if HAVE_STRUCT_STAT_ST_LEVEL - tprintf(", st_level=%ld", statbuf.st_level); -#endif -#if HAVE_STRUCT_STAT_ST_FSTYPE - tprintf(", st_fstype=%.*s", - (int) sizeof statbuf.st_fstype, statbuf.st_fstype); -#endif -#if HAVE_STRUCT_STAT_ST_GEN - tprintf(", st_gen=%u", statbuf.st_gen); -#endif - tprints("}"); - } - else - tprints("...}"); -} -#endif /* HAVE_STAT64 */ - -#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) -static void -convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf) -{ - newbuf->st_dev = oldbuf->st_dev; - newbuf->st_ino = oldbuf->st_ino; - newbuf->st_mode = oldbuf->st_mode; - newbuf->st_nlink = oldbuf->st_nlink; - newbuf->st_uid = oldbuf->st_uid; - newbuf->st_gid = oldbuf->st_gid; - newbuf->st_rdev = oldbuf->st_rdev; - newbuf->st_size = oldbuf->st_size; - newbuf->st_atime = oldbuf->st_atime; - newbuf->st_mtime = oldbuf->st_mtime; - newbuf->st_ctime = oldbuf->st_ctime; - newbuf->st_blksize = 0; /* not supported in old_stat */ - newbuf->st_blocks = 0; /* not supported in old_stat */ -} - -static void -printoldstat(struct tcb *tcp, long addr) -{ - struct __old_kernel_stat statbuf; - struct stat newstatbuf; - - if (!addr) { - tprints("NULL"); - return; - } - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - -# if defined(SPARC) || defined(SPARC64) - if (current_personality == 1) { - printstatsol(tcp, addr); - return; - } -# endif - - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - - convertoldstat(&statbuf, &newstatbuf); - realprintstat(tcp, &newstatbuf); -} -#endif - -int -sys_stat(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - printstat(tcp, tcp->u_arg[1]); - } - return 0; -} - -#ifdef X32 -static void -printstat64_x32(struct tcb *tcp, long addr) -{ - struct stat64 statbuf; - - if (!addr) { - tprints("NULL"); - return; - } - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - - if (!abbrev(tcp)) { - tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ", - (unsigned long) major(statbuf.st_dev), - (unsigned long) minor(statbuf.st_dev), - (unsigned long long) statbuf.st_ino, - sprintmode(statbuf.st_mode)); - tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ", - (unsigned long) statbuf.st_nlink, - (unsigned long) statbuf.st_uid, - (unsigned long) statbuf.st_gid); - tprintf("st_blksize=%lu, ", - (unsigned long) statbuf.st_blksize); - tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks); - } - else - tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode)); - switch (statbuf.st_mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: - tprintf("st_rdev=makedev(%lu, %lu), ", - (unsigned long) major(statbuf.st_rdev), - (unsigned long) minor(statbuf.st_rdev)); - break; - default: - tprintf("st_size=%llu, ", (unsigned long long) statbuf.st_size); - break; - } - if (!abbrev(tcp)) { - tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime)); - tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime)); - tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime)); - tprints("}"); - } - else - tprints("...}"); -} -#endif /* X32 */ - -int -sys_stat64(struct tcb *tcp) -{ -#ifdef HAVE_STAT64 - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - } else { -# ifdef X32 - printstat64_x32(tcp, tcp->u_arg[1]); -# else - printstat64(tcp, tcp->u_arg[1]); -# endif - } - return 0; -#else - return printargs(tcp); -#endif -} - -#ifndef AT_SYMLINK_NOFOLLOW -# define AT_SYMLINK_NOFOLLOW 0x100 -#endif -#ifndef AT_REMOVEDIR -# define AT_REMOVEDIR 0x200 -#endif -#ifndef AT_SYMLINK_FOLLOW -# define AT_SYMLINK_FOLLOW 0x400 -#endif -#ifndef AT_NO_AUTOMOUNT -# define AT_NO_AUTOMOUNT 0x800 -#endif -#ifndef AT_EMPTY_PATH -# define AT_EMPTY_PATH 0x1000 -#endif - -#include "xlat/at_flags.h" - -int -sys_newfstatat(struct tcb *tcp) -{ - if (entering(tcp)) { - print_dirfd(tcp, tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - } else { -#ifdef POWERPC64 - if (current_personality == 0) - printstat(tcp, tcp->u_arg[2]); - else - printstat64(tcp, tcp->u_arg[2]); -#elif defined HAVE_STAT64 - printstat64(tcp, tcp->u_arg[2]); -#else - printstat(tcp, tcp->u_arg[2]); -#endif - tprints(", "); - printflags(at_flags, tcp->u_arg[3], "AT_???"); - } - return 0; -} - -#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) -int -sys_oldstat(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - printoldstat(tcp, tcp->u_arg[1]); - } - return 0; -} -#endif - -int -sys_fstat(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - printstat(tcp, tcp->u_arg[1]); - } - return 0; -} - -int -sys_fstat64(struct tcb *tcp) -{ -#ifdef HAVE_STAT64 - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { -# ifdef X32 - printstat64_x32(tcp, tcp->u_arg[1]); -# else - printstat64(tcp, tcp->u_arg[1]); -# endif - } - return 0; -#else - return printargs(tcp); -#endif -} - -#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) -int -sys_oldfstat(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - printoldstat(tcp, tcp->u_arg[1]); - } - return 0; -} -#endif - -#if defined(SPARC) || defined(SPARC64) - -int -sys_xstat(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - } else { -# ifdef _STAT64_VER - if (tcp->u_arg[0] == _STAT64_VER) - printstat64(tcp, tcp->u_arg[2]); - else -# endif - printstat(tcp, tcp->u_arg[2]); - } - return 0; -} - -int -sys_fxstat(struct tcb *tcp) -{ - if (entering(tcp)) - tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]); - else { -# ifdef _STAT64_VER - if (tcp->u_arg[0] == _STAT64_VER) - printstat64(tcp, tcp->u_arg[2]); - else -# endif - printstat(tcp, tcp->u_arg[2]); - } - return 0; -} - -int -sys_lxstat(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - } else { -# ifdef _STAT64_VER - if (tcp->u_arg[0] == _STAT64_VER) - printstat64(tcp, tcp->u_arg[2]); - else -# endif - printstat(tcp, tcp->u_arg[2]); - } - return 0; -} - -int -sys_xmknod(struct tcb *tcp) -{ - int mode = tcp->u_arg[2]; - - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - tprintf(", %s", sprintmode(mode)); - switch (mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: - tprintf(", makedev(%lu, %lu)", - (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff), - (unsigned long) (tcp->u_arg[3] & 0x3ffff)); - break; - default: - break; - } - } - return 0; -} - -# ifdef HAVE_SYS_ACL_H - -# include - -#include "xlat/aclcmds.h" - -int -sys_acl(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - printxval(aclcmds, tcp->u_arg[1], "???ACL???"); - tprintf(", %ld", tcp->u_arg[2]); - /* - * FIXME - dump out the list of aclent_t's pointed to - * by "tcp->u_arg[3]" if it's not NULL. - */ - if (tcp->u_arg[3]) - tprintf(", %#lx", tcp->u_arg[3]); - else - tprints(", NULL"); - } - return 0; -} - -int -sys_facl(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - printxval(aclcmds, tcp->u_arg[1], "???ACL???"); - tprintf(", %ld", tcp->u_arg[2]); - /* - * FIXME - dump out the list of aclent_t's pointed to - * by "tcp->u_arg[3]" if it's not NULL. - */ - if (tcp->u_arg[3]) - tprintf(", %#lx", tcp->u_arg[3]); - else - tprints(", NULL"); - } - return 0; -} - -#include "xlat/aclipc.h" - -int -sys_aclipc(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(aclipc, tcp->u_arg[0], "???IPC???"); - tprintf(", %#lx, ", tcp->u_arg[1]); - printxval(aclcmds, tcp->u_arg[2], "???ACL???"); - tprintf(", %ld", tcp->u_arg[3]); - /* - * FIXME - dump out the list of aclent_t's pointed to - * by "tcp->u_arg[4]" if it's not NULL. - */ - if (tcp->u_arg[4]) - tprintf(", %#lx", tcp->u_arg[4]); - else - tprints(", NULL"); - } - return 0; -} - -# endif /* HAVE_SYS_ACL_H */ - -#endif /* SPARC[64] */ - -#include "xlat/fsmagic.h" - -static const char * -sprintfstype(int magic) -{ - static char buf[32]; - const char *s; - - s = xlookup(fsmagic, magic); - if (s) { - sprintf(buf, "\"%s\"", s); - return buf; - } - sprintf(buf, "%#x", magic); - return buf; -} - -static void -printstatfs(struct tcb *tcp, long addr) -{ - struct statfs statbuf; - - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } -#ifdef ALPHA - - tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ", - sprintfstype(statbuf.f_type), - statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree); - tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u", - statbuf.f_bavail, statbuf.f_files, statbuf.f_ffree, - statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1], - statbuf.f_namelen); -#else /* !ALPHA */ - tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ", - sprintfstype(statbuf.f_type), - (unsigned long)statbuf.f_bsize, - (unsigned long)statbuf.f_blocks, - (unsigned long)statbuf.f_bfree); - tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}", - (unsigned long)statbuf.f_bavail, - (unsigned long)statbuf.f_files, - (unsigned long)statbuf.f_ffree, - statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]); - tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen); -#endif /* !ALPHA */ -#ifdef _STATFS_F_FRSIZE - tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize); -#endif - tprints("}"); -} - -int -sys_statfs(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - printstatfs(tcp, tcp->u_arg[1]); - } - return 0; -} - -int -sys_fstatfs(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - printstatfs(tcp, tcp->u_arg[1]); - } - return 0; -} - -#if defined HAVE_STATFS64 -static void -printstatfs64(struct tcb *tcp, long addr) -{ - struct statfs64 statbuf; - - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ", - sprintfstype(statbuf.f_type), - (unsigned long long)statbuf.f_bsize, - (unsigned long long)statbuf.f_blocks, - (unsigned long long)statbuf.f_bfree); - tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}", - (unsigned long long)statbuf.f_bavail, - (unsigned long long)statbuf.f_files, - (unsigned long long)statbuf.f_ffree, - statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]); - tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen); -#ifdef _STATFS_F_FRSIZE - tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize); -#endif -#ifdef _STATFS_F_FLAGS - tprintf(", f_flags=%llu", (unsigned long long)statbuf.f_flags); -#endif - tprints("}"); -} - -struct compat_statfs64 { - uint32_t f_type; - uint32_t f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - fsid_t f_fsid; - uint32_t f_namelen; - uint32_t f_frsize; - uint32_t f_flags; - uint32_t f_spare[4]; -} -#if defined(X86_64) || defined(IA64) - __attribute__ ((packed, aligned(4))) -#endif -; - -static void -printcompat_statfs64(struct tcb *tcp, long addr) -{ - struct compat_statfs64 statbuf; - - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - if (umove(tcp, addr, &statbuf) < 0) { - tprints("{...}"); - return; - } - tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%llu, f_bfree=%llu, ", - sprintfstype(statbuf.f_type), - (unsigned long)statbuf.f_bsize, - (unsigned long long)statbuf.f_blocks, - (unsigned long long)statbuf.f_bfree); - tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}", - (unsigned long long)statbuf.f_bavail, - (unsigned long long)statbuf.f_files, - (unsigned long long)statbuf.f_ffree, - statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]); - tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen); - tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize); - tprintf(", f_flags=%lu}", (unsigned long)statbuf.f_frsize); -} - -int -sys_statfs64(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprintf(", %lu, ", tcp->u_arg[1]); - } else { - if (tcp->u_arg[1] == sizeof(struct statfs64)) - printstatfs64(tcp, tcp->u_arg[2]); - else if (tcp->u_arg[1] == sizeof(struct compat_statfs64)) - printcompat_statfs64(tcp, tcp->u_arg[2]); - else - tprints("{???}"); - } - return 0; -} - -int -sys_fstatfs64(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprintf(", %lu, ", tcp->u_arg[1]); - } else { - if (tcp->u_arg[1] == sizeof(struct statfs64)) - printstatfs64(tcp, tcp->u_arg[2]); - else if (tcp->u_arg[1] == sizeof(struct compat_statfs64)) - printcompat_statfs64(tcp, tcp->u_arg[2]); - else - tprints("{???}"); - } - return 0; -} -#endif - -#if defined(ALPHA) -int -osf_statfs(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - printstatfs(tcp, tcp->u_arg[1]); - tprintf(", %lu", tcp->u_arg[2]); - } - return 0; -} - -int -osf_fstatfs(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - } else { - printstatfs(tcp, tcp->u_arg[1]); - tprintf(", %lu", tcp->u_arg[2]); - } - return 0; -} -#endif - -/* directory */ -int -sys_chdir(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - } - return 0; -} - -static int -decode_mkdir(struct tcb *tcp, int offset) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[offset]); - tprintf(", %#lo", tcp->u_arg[offset + 1]); - } - return 0; -} - -int -sys_mkdir(struct tcb *tcp) -{ - return decode_mkdir(tcp, 0); -} - -int -sys_mkdirat(struct tcb *tcp) -{ - if (entering(tcp)) - print_dirfd(tcp, tcp->u_arg[0]); - return decode_mkdir(tcp, 1); -} - -int -sys_link(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - printpath(tcp, tcp->u_arg[1]); - } - return 0; -} - -int -sys_linkat(struct tcb *tcp) -{ - if (entering(tcp)) { - print_dirfd(tcp, tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - print_dirfd(tcp, tcp->u_arg[2]); - printpath(tcp, tcp->u_arg[3]); - tprints(", "); - printflags(at_flags, tcp->u_arg[4], "AT_???"); - } - return 0; -} - -int -sys_unlinkat(struct tcb *tcp) -{ - if (entering(tcp)) { - print_dirfd(tcp, tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - printflags(at_flags, tcp->u_arg[2], "AT_???"); - } - return 0; -} - -int -sys_symlinkat(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - print_dirfd(tcp, tcp->u_arg[1]); - printpath(tcp, tcp->u_arg[2]); - } - return 0; -} - -static int -decode_readlink(struct tcb *tcp, int offset) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[offset]); - tprints(", "); - } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[offset + 1]); - else - /* Used to use printpathn(), but readlink - * neither includes NUL in the returned count, - * nor actually writes it into memory. - * printpathn() would decide on printing - * "..." continuation based on garbage - * past return buffer's end. - */ - printstr(tcp, tcp->u_arg[offset + 1], tcp->u_rval); - tprintf(", %lu", tcp->u_arg[offset + 2]); - } - return 0; -} - -int -sys_readlink(struct tcb *tcp) -{ - return decode_readlink(tcp, 0); -} - -int -sys_readlinkat(struct tcb *tcp) -{ - if (entering(tcp)) - print_dirfd(tcp, tcp->u_arg[0]); - return decode_readlink(tcp, 1); -} - -static void -decode_renameat(struct tcb *tcp) -{ - print_dirfd(tcp, tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - print_dirfd(tcp, tcp->u_arg[2]); - printpath(tcp, tcp->u_arg[3]); -} - -int -sys_renameat(struct tcb *tcp) -{ - if (entering(tcp)) { - decode_renameat(tcp); - } - return 0; -} - -#include "xlat/rename_flags.h" - -int -sys_renameat2(struct tcb *tcp) -{ - if (entering(tcp)) { - decode_renameat(tcp); - tprints(", "); - printflags(rename_flags, tcp->u_arg[4], "RENAME_??"); - } - return 0; -} - -int -sys_chown(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - printuid(", ", tcp->u_arg[1]); - printuid(", ", tcp->u_arg[2]); - } - return 0; -} - -int -sys_fchownat(struct tcb *tcp) -{ - if (entering(tcp)) { - print_dirfd(tcp, tcp->u_arg[0]); - printpath(tcp, tcp->u_arg[1]); - printuid(", ", tcp->u_arg[2]); - printuid(", ", tcp->u_arg[3]); - tprints(", "); - printflags(at_flags, tcp->u_arg[4], "AT_???"); - } - return 0; -} - -int -sys_fchown(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - printuid(", ", tcp->u_arg[1]); - printuid(", ", tcp->u_arg[2]); - } - return 0; -} - -static int -decode_chmod(struct tcb *tcp, int offset) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[offset]); - tprintf(", %#lo", tcp->u_arg[offset + 1]); - } - return 0; -} - -int -sys_chmod(struct tcb *tcp) -{ - return decode_chmod(tcp, 0); -} - -int -sys_fchmodat(struct tcb *tcp) -{ - if (entering(tcp)) - print_dirfd(tcp, tcp->u_arg[0]); - return decode_chmod(tcp, 1); -} - -int -sys_fchmod(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprintf(", %#lo", tcp->u_arg[1]); - } - return 0; -} - -#ifdef ALPHA -int -sys_osf_utimes(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0); - } - return 0; -} -#endif - -static int -decode_utimes(struct tcb *tcp, int offset, int special) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[offset]); - tprints(", "); - if (tcp->u_arg[offset + 1] == 0) - tprints("NULL"); - else { - tprints("{"); - printtv_bitness(tcp, tcp->u_arg[offset + 1], - BITNESS_CURRENT, special); - tprints(", "); - printtv_bitness(tcp, tcp->u_arg[offset + 1] - + sizeof(struct timeval), - BITNESS_CURRENT, special); - tprints("}"); - } - } - return 0; -} - -int -sys_utimes(struct tcb *tcp) -{ - return decode_utimes(tcp, 0, 0); -} - -int -sys_futimesat(struct tcb *tcp) -{ - if (entering(tcp)) - print_dirfd(tcp, tcp->u_arg[0]); - return decode_utimes(tcp, 1, 0); -} - -int -sys_utimensat(struct tcb *tcp) -{ - if (entering(tcp)) { - print_dirfd(tcp, tcp->u_arg[0]); - decode_utimes(tcp, 1, 1); - tprints(", "); - printflags(at_flags, tcp->u_arg[3], "AT_???"); - } - return 0; -} - -int -sys_utime(struct tcb *tcp) -{ - union { - long utl[2]; - int uti[2]; - long paranoia_for_huge_wordsize[4]; - } u; - unsigned wordsize; - - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - - wordsize = current_wordsize; - if (!tcp->u_arg[1]) - tprints("NULL"); - else if (!verbose(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else if (umoven(tcp, tcp->u_arg[1], 2 * wordsize, (char *) &u) < 0) - tprints("[?, ?]"); - else if (wordsize == sizeof u.utl[0]) { - tprintf("[%s,", sprinttime(u.utl[0])); - tprintf(" %s]", sprinttime(u.utl[1])); - } - else if (wordsize == sizeof u.uti[0]) { - tprintf("[%s,", sprinttime(u.uti[0])); - tprintf(" %s]", sprinttime(u.uti[1])); - } - else - tprintf("", - wordsize); - } - return 0; -} - -static int -decode_mknod(struct tcb *tcp, int offset) -{ - int mode = tcp->u_arg[offset + 1]; - - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[offset]); - tprintf(", %s", sprintmode(mode)); - switch (mode & S_IFMT) { - case S_IFCHR: - case S_IFBLK: -#if defined(SPARC) || defined(SPARC64) - if (current_personality == 1) - tprintf(", makedev(%lu, %lu)", - (unsigned long) ((tcp->u_arg[offset + 2] >> 18) & 0x3fff), - (unsigned long) (tcp->u_arg[offset + 2] & 0x3ffff)); - else -#endif - tprintf(", makedev(%lu, %lu)", - (unsigned long) major(tcp->u_arg[offset + 2]), - (unsigned long) minor(tcp->u_arg[offset + 2])); - break; - default: - break; - } - } - return 0; -} - -int -sys_mknod(struct tcb *tcp) -{ - return decode_mknod(tcp, 0); -} - -int -sys_mknodat(struct tcb *tcp) -{ - if (entering(tcp)) - print_dirfd(tcp, tcp->u_arg[0]); - return decode_mknod(tcp, 1); -} - -static void -print_old_dirent(struct tcb *tcp, long addr) -{ -#ifdef SH64 - typedef struct kernel_dirent old_dirent_t; -#else - typedef struct { - uint32_t d_ino; - uint32_t d_off; - unsigned short d_reclen; - char d_name[1]; - } old_dirent_t; -#endif - old_dirent_t d; - - if (!verbose(tcp) || umove(tcp, addr, &d) < 0) { - tprintf("%#lx", addr); - return; - } - - tprintf("{d_ino=%lu, d_off=%lu, d_reclen=%u, d_name=\"", - (unsigned long) d.d_ino, (unsigned long) d.d_off, d.d_reclen); - if (d.d_reclen > 256) - d.d_reclen = 256; - printpathn(tcp, addr + offsetof(old_dirent_t, d_name), d.d_reclen); - tprints("\"}"); -} - -int -sys_readdir(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - print_old_dirent(tcp, tcp->u_arg[1]); - /* Not much point in printing this out, it is always 1. */ - if (tcp->u_arg[2] != 1) - tprintf(", %lu", tcp->u_arg[2]); - } - return 0; -} - -#include "xlat/direnttypes.h" - -int -sys_getdents(struct tcb *tcp) -{ - int i, len, dents = 0; - char *buf; - - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - return 0; - } - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]); - return 0; - } - len = tcp->u_rval; - /* Beware of insanely large or negative values in tcp->u_rval */ - if (tcp->u_rval > 1024*1024) - len = 1024*1024; - if (tcp->u_rval < 0) - len = 0; - buf = len ? malloc(len) : NULL; - if (len && !buf) - die_out_of_memory(); - if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) { - tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]); - free(buf); - return 0; - } - if (!abbrev(tcp)) - tprints("{"); - for (i = 0; i < len;) { - struct kernel_dirent *d = (struct kernel_dirent *) &buf[i]; - if (!abbrev(tcp)) { - tprintf("%s{d_ino=%lu, d_off=%lu, ", - i ? " " : "", d->d_ino, d->d_off); - tprintf("d_reclen=%u, d_name=\"%s\", d_type=", - d->d_reclen, d->d_name); - printxval(direnttypes, buf[i + d->d_reclen - 1], "DT_???"); - tprints("}"); - } - if (!d->d_reclen) { - tprints("/* d_reclen == 0, problem here */"); - break; - } - i += d->d_reclen; - dents++; - } - if (!abbrev(tcp)) - tprints("}"); - else - tprintf("/* %u entries */", dents); - tprintf(", %lu", tcp->u_arg[2]); - free(buf); - return 0; -} - -int -sys_getdents64(struct tcb *tcp) -{ - int i, len, dents = 0; - char *buf; - - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - return 0; - } - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]); - return 0; - } - - len = tcp->u_rval; - /* Beware of insanely large or negative tcp->u_rval */ - if (tcp->u_rval > 1024*1024) - len = 1024*1024; - if (tcp->u_rval < 0) - len = 0; - buf = len ? malloc(len) : NULL; - if (len && !buf) - die_out_of_memory(); - - if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) { - tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]); - free(buf); - return 0; - } - if (!abbrev(tcp)) - tprints("{"); - for (i = 0; i < len;) { - struct dirent64 *d = (struct dirent64 *) &buf[i]; - if (!abbrev(tcp)) { - tprintf("%s{d_ino=%" PRIu64 ", d_off=%" PRId64 ", ", - i ? " " : "", - d->d_ino, - d->d_off); - tprints("d_type="); - printxval(direnttypes, d->d_type, "DT_???"); - tprints(", "); - tprintf("d_reclen=%u, d_name=\"%s\"}", - d->d_reclen, d->d_name); - } - if (!d->d_reclen) { - tprints("/* d_reclen == 0, problem here */"); - break; - } - i += d->d_reclen; - dents++; - } - if (!abbrev(tcp)) - tprints("}"); - else - tprintf("/* %u entries */", dents); - tprintf(", %lu", tcp->u_arg[2]); - free(buf); - return 0; -} - -int -sys_getcwd(struct tcb *tcp) -{ - if (exiting(tcp)) { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else - printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; -} - -#ifdef HAVE_SYS_ASYNCH_H - -int -sys_aioread(struct tcb *tcp) -{ - struct aio_result_t res; - - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]); - printxval(whence, tcp->u_arg[4], "L_???"); - if (syserror(tcp) || tcp->u_arg[5] == 0 - || umove(tcp, tcp->u_arg[5], &res) < 0) - tprintf(", %#lx", tcp->u_arg[5]); - else - tprintf(", {aio_return %d aio_errno %d}", - res.aio_return, res.aio_errno); - } - return 0; -} - -int -sys_aiowrite(struct tcb *tcp) -{ - struct aio_result_t res; - - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]); - printxval(whence, tcp->u_arg[4], "L_???"); - } - else { - if (tcp->u_arg[5] == 0) - tprints(", NULL"); - else if (syserror(tcp) - || umove(tcp, tcp->u_arg[5], &res) < 0) - tprintf(", %#lx", tcp->u_arg[5]); - else - tprintf(", {aio_return %d aio_errno %d}", - res.aio_return, res.aio_errno); - } - return 0; -} - -int -sys_aiowait(struct tcb *tcp) -{ - if (entering(tcp)) - printtv(tcp, tcp->u_arg[0]); - return 0; -} - -int -sys_aiocancel(struct tcb *tcp) -{ - struct aio_result_t res; - - if (exiting(tcp)) { - if (tcp->u_arg[0] == 0) - tprints("NULL"); - else if (syserror(tcp) - || umove(tcp, tcp->u_arg[0], &res) < 0) - tprintf("%#lx", tcp->u_arg[0]); - else - tprintf("{aio_return %d aio_errno %d}", - res.aio_return, res.aio_errno); - } - return 0; -} - -#endif /* HAVE_SYS_ASYNCH_H */ - -#include "xlat/xattrflags.h" - -static void -print_xattr_val(struct tcb *tcp, int failed, - unsigned long arg, - unsigned long insize, - unsigned long size) -{ - if (insize == 0) - failed = 1; - if (!failed) { - unsigned long capacity = 4 * size + 1; - unsigned char *buf = (capacity < size) ? NULL : malloc(capacity); - if (buf == NULL || /* probably a bogus size argument */ - umoven(tcp, arg, size, (char *) &buf[3 * size]) < 0) { - failed = 1; - } - else { - unsigned char *out = buf; - unsigned char *in = &buf[3 * size]; - size_t i; - for (i = 0; i < size; ++i) { - if (in[i] >= ' ' && in[i] <= 0x7e) - *out++ = in[i]; - else { -#define tohex(n) "0123456789abcdef"[n] - *out++ = '\\'; - *out++ = 'x'; - *out++ = tohex(in[i] / 16); - *out++ = tohex(in[i] % 16); - } - } - /* Don't print terminating NUL if there is one. */ - if (i > 0 && in[i - 1] == '\0') - out -= 4; - *out = '\0'; - tprintf(", \"%s\", %ld", buf, insize); - } - free(buf); - } - if (failed) - tprintf(", 0x%lx, %ld", arg, insize); -} - -int -sys_setxattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]); - tprints(", "); - printflags(xattrflags, tcp->u_arg[4], "XATTR_???"); - } - return 0; -} - -int -sys_fsetxattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]); - tprints(", "); - printflags(xattrflags, tcp->u_arg[4], "XATTR_???"); - } - return 0; -} - -int -sys_getxattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - } else { - print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3], - tcp->u_rval); - } - return 0; -} - -int -sys_fgetxattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - } else { - print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3], - tcp->u_rval); - } - return 0; -} - -static void -print_xattr_list(struct tcb *tcp, unsigned long addr, unsigned long size) -{ - if (syserror(tcp)) { - tprintf("%#lx", addr); - } else { - if (!addr) { - tprints("NULL"); - } else { - unsigned long len = - (size < tcp->u_rval) ? size : tcp->u_rval; - printstr(tcp, addr, len); - } - } - tprintf(", %lu", size); -} - -int -sys_listxattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]); - } - return 0; -} - -int -sys_flistxattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]); - } - return 0; -} - -int -sys_removexattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - } - return 0; -} - -int -sys_fremovexattr(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - } - return 0; -} - -#include "xlat/advise.h" - -int -sys_fadvise64(struct tcb *tcp) -{ - if (entering(tcp)) { - int argn; - printfd(tcp, tcp->u_arg[0]); - argn = printllval(tcp, ", %lld", 1); - tprintf(", %ld, ", tcp->u_arg[argn++]); - printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???"); - } - return 0; -} - -int -sys_fadvise64_64(struct tcb *tcp) -{ - if (entering(tcp)) { - int argn; - printfd(tcp, tcp->u_arg[0]); - argn = printllval(tcp, ", %lld, ", 1); - argn = printllval(tcp, "%lld, ", argn); -#if defined __ARM_EABI__ || defined AARCH64 || defined POWERPC || defined XTENSA - printxval(advise, tcp->u_arg[1], "POSIX_FADV_???"); -#else - printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???"); -#endif - } - return 0; -} - -#include "xlat/sync_file_range_flags.h" - -int -sys_sync_file_range(struct tcb *tcp) -{ - if (entering(tcp)) { - int argn; - printfd(tcp, tcp->u_arg[0]); - argn = printllval(tcp, ", %lld, ", 1); - argn = printllval(tcp, "%lld, ", argn); - printflags(sync_file_range_flags, tcp->u_arg[argn], - "SYNC_FILE_RANGE_???"); - } - return 0; -} - -int -sys_sync_file_range2(struct tcb *tcp) -{ - if (entering(tcp)) { - int argn; - printfd(tcp, tcp->u_arg[0]); - printflags(sync_file_range_flags, 1, - "SYNC_FILE_RANGE_???"); - argn = printllval(tcp, ", %lld, ", 2); - argn = printllval(tcp, "%lld, ", argn); - } - return 0; -} - -int -sys_fallocate(struct tcb *tcp) -{ - if (entering(tcp)) { - int argn; - printfd(tcp, tcp->u_arg[0]); /* fd */ - tprintf(", %#lo, ", tcp->u_arg[1]); /* mode */ - argn = printllval(tcp, "%llu, ", 2); /* offset */ - printllval(tcp, "%llu", argn); /* len */ - } - return 0; -} - -#ifndef SWAP_FLAG_PREFER -# define SWAP_FLAG_PREFER 0x8000 -#endif -#ifndef SWAP_FLAG_DISCARD -# define SWAP_FLAG_DISCARD 0x10000 -#endif -#include "xlat/swap_flags.h" - -int -sys_swapon(struct tcb *tcp) -{ - if (entering(tcp)) { - int flags = tcp->u_arg[1]; - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - printflags(swap_flags, flags & ~SWAP_FLAG_PRIO_MASK, - "SWAP_FLAG_???"); - if (flags & SWAP_FLAG_PREFER) - tprintf("|%d", flags & SWAP_FLAG_PRIO_MASK); - } - return 0; -} diff --git a/file_handle.c b/file_handle.c new file mode 100644 index 00000000..f2f0b22d --- /dev/null +++ b/file_handle.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include "xlat/name_to_handle_at_flags.h" + +#ifndef MAX_HANDLE_SZ +# define MAX_HANDLE_SZ 128 +#endif + +typedef struct { + unsigned int handle_bytes; + int handle_type; +} file_handle_header; + +SYS_FUNC(name_to_handle_at) +{ + file_handle_header h; + const kernel_ulong_t addr = tcp->u_arg[2]; + + if (entering(tcp)) { + /* dirfd */ + print_dirfd(tcp, tcp->u_arg[0]); + + /* pathname */ + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + + /* handle */ + if (umove_or_printaddr(tcp, addr, &h)) { + tprints(", "); + + /* mount_id */ + printaddr(tcp->u_arg[3]); + tprints(", "); + + /* flags */ + printflags(name_to_handle_at_flags, tcp->u_arg[4], + "AT_???"); + + return RVAL_DECODED; + } + tprintf("{handle_bytes=%u", h.handle_bytes); + + set_tcb_priv_ulong(tcp, h.handle_bytes); + + return 0; + } else { + unsigned int i = get_tcb_priv_ulong(tcp); + + if ((!syserror(tcp) || EOVERFLOW == tcp->u_error) + && !umove(tcp, addr, &h)) { + unsigned char f_handle[MAX_HANDLE_SZ]; + + if (i != h.handle_bytes) + tprintf(" => %u", h.handle_bytes); + if (!syserror(tcp)) { + tprintf(", handle_type=%d", h.handle_type); + if (h.handle_bytes > MAX_HANDLE_SZ) + h.handle_bytes = MAX_HANDLE_SZ; + if (!umoven(tcp, addr + sizeof(h), h.handle_bytes, + f_handle)) { + tprints(", f_handle=0x"); + for (i = 0; i < h.handle_bytes; ++i) + tprintf("%02x", f_handle[i]); + } + } + } + tprints("}, "); + + /* mount_id */ + printnum_int(tcp, tcp->u_arg[3], "%d"); + tprints(", "); + + /* flags */ + printflags(name_to_handle_at_flags, tcp->u_arg[4], "AT_???"); + } + return 0; +} + +SYS_FUNC(open_by_handle_at) +{ + file_handle_header h; + const kernel_ulong_t addr = tcp->u_arg[1]; + + /* mount_fd */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + + /* handle */ + if (!umove_or_printaddr(tcp, addr, &h)) { + unsigned char f_handle[MAX_HANDLE_SZ]; + + tprintf("{handle_bytes=%u, handle_type=%d", + h.handle_bytes, h.handle_type); + if (h.handle_bytes > MAX_HANDLE_SZ) + h.handle_bytes = MAX_HANDLE_SZ; + if (!umoven(tcp, addr + sizeof(h), h.handle_bytes, &f_handle)) { + unsigned int i; + + tprints(", f_handle=0x"); + for (i = 0; i < h.handle_bytes; ++i) + tprintf("%02x", f_handle[i]); + } + tprints("}"); + } + tprints(", "); + + /* flags */ + tprint_open_modes(tcp->u_arg[2]); + + return RVAL_DECODED; +} diff --git a/file_ioctl.c b/file_ioctl.c new file mode 100644 index 00000000..fec2f69b --- /dev/null +++ b/file_ioctl.c @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2016 Jeff Mahoney + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include + +#ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +#endif + +#ifndef FICLONE +# define FICLONE _IOW(0x94, 9, int) +#endif + +#ifndef FICLONERANGE +# define FICLONERANGE _IOW(0x94, 13, struct file_clone_range) +struct file_clone_range { + int64_t src_fd; + uint64_t src_offset; + uint64_t src_length; + uint64_t dest_offset; +}; +#endif + +#ifndef FIDEDUPERANGE +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +struct file_dedupe_range_info { + int64_t dest_fd; /* in - destination file */ + uint64_t dest_offset; /* in - start of extent in destination */ + uint64_t bytes_deduped; /* out - total # of bytes we were able + * to dedupe from this file. */ + /* status of this dedupe operation: + * < 0 for error + * == FILE_DEDUPE_RANGE_SAME if dedupe succeeds + * == FILE_DEDUPE_RANGE_DIFFERS if data differs + */ + int32_t status; /* out - see above description */ + uint32_t reserved; /* must be zero */ +}; + +struct file_dedupe_range { + uint64_t src_offset; /* in - start of extent in source */ + uint64_t src_length; /* in - length of extent */ + uint16_t dest_count; /* in - total elements in info array */ + uint16_t reserved1; /* must be zero */ + uint32_t reserved2; /* must be zero */ + struct file_dedupe_range_info info[0]; +}; +#endif + +static bool +print_file_dedupe_range_info(struct tcb *tcp, void *elem_buf, + size_t elem_size, void *data) +{ + const struct file_dedupe_range_info *info = elem_buf; + unsigned int *count = data; + + if (count) { + if (*count == 0) { + tprints("..."); + return false; + } + --*count; + } + + if (entering(tcp)) { + tprints("{dest_fd="); + printfd(tcp, info->dest_fd); + tprintf(", dest_offset=%" PRIu64 "}", + (uint64_t) info->dest_offset); + } else { + tprintf("{bytes_deduped=%" PRIu64 ", status=%d}", + (uint64_t) info->bytes_deduped, info->status); + } + + return true; +} + +#ifdef HAVE_LINUX_FIEMAP_H +static bool +print_fiemap_extent(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const struct fiemap_extent *fe = elem_buf; + + tprintf("{fe_logical=%" PRI__u64 + ", fe_physical=%" PRI__u64 + ", fe_length=%" PRI__u64 ", ", + fe->fe_logical, fe->fe_physical, fe->fe_length); + + printflags64(fiemap_extent_flags, fe->fe_flags, + "FIEMAP_EXTENT_???"); + tprints("}"); + + return true; +} +#endif /* HAVE_LINUX_FIEMAP_H */ + +int +file_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { + case FICLONE: /* W */ + tprintf(", %d", (int) arg); + break; + + case FICLONERANGE: { /* W */ + struct file_clone_range args; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{src_fd="); + printfd(tcp, args.src_fd); + tprintf(", src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_offset=%" PRIu64 "}", + (uint64_t) args.src_offset, + (uint64_t) args.src_length, + (uint64_t) args.dest_offset); + break; + } + + case FIDEDUPERANGE: { /* RW */ + struct file_dedupe_range args; + struct file_dedupe_range_info info; + unsigned int *limit = NULL; + unsigned int count = 2; + bool rc; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + tprints("{"); + if (entering(tcp)) { + tprintf("src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_count=%hu, ", + (uint64_t) args.src_offset, + (uint64_t) args.src_length, + (uint16_t) args.dest_count); + } + + tprints("info="); + + /* Limit how many elements we print in abbrev mode. */ + if (abbrev(tcp) && args.dest_count > count) + limit = &count; + + rc = print_array(tcp, arg + offsetof(typeof(args), info), + args.dest_count, &info, sizeof(info), + umoven_or_printaddr, + print_file_dedupe_range_info, limit); + + tprints("}"); + if (!rc || exiting(tcp)) + break; + + return 0; + } + +#ifdef HAVE_LINUX_FIEMAP_H + case FS_IOC_FIEMAP: { + struct fiemap args; + + if (entering(tcp)) + tprints(", "); + else if (syserror(tcp)) + break; + else + tprints(" => "); + + if (umove_or_printaddr(tcp, arg, &args)) + break; + + if (entering(tcp)) { + tprintf("{fm_start=%" PRI__u64 ", " + "fm_length=%" PRI__u64 ", " + "fm_flags=", + args.fm_start, args.fm_length); + printflags64(fiemap_flags, args.fm_flags, + "FIEMAP_FLAG_???"); + tprintf(", fm_extent_count=%u}", args.fm_extent_count); + return 0; + } + + tprints("{fm_flags="); + printflags64(fiemap_flags, args.fm_flags, + "FIEMAP_FLAG_???"); + tprintf(", fm_mapped_extents=%u", + args.fm_mapped_extents); + tprints(", fm_extents="); + if (abbrev(tcp)) { + tprints("..."); + } else { + struct fiemap_extent fe; + print_array(tcp, + arg + offsetof(typeof(args), fm_extents), + args.fm_mapped_extents, &fe, sizeof(fe), + umoven_or_printaddr, + print_fiemap_extent, 0); + } + tprints("}"); + + break; + } +#endif /* HAVE_LINUX_FIEMAP_H */ + + default: + return RVAL_DECODED; + }; + + return RVAL_DECODED | 1; +} diff --git a/flock.c b/flock.c new file mode 100644 index 00000000..6ec43db4 --- /dev/null +++ b/flock.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +#include "xlat/flockcmds.h" + +SYS_FUNC(flock) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printflags(flockcmds, tcp->u_arg[1], "LOCK_???"); + + return RVAL_DECODED; +} diff --git a/flock.h b/flock.h new file mode 100644 index 00000000..afa51482 --- /dev/null +++ b/flock.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_FLOCK_H +#define STRACE_FLOCK_H + +#include + +#if defined HAVE_STRUCT_FLOCK +typedef struct flock struct_kernel_flock; +#elif defined HAVE_STRUCT___KERNEL_FLOCK +typedef struct __kernel_flock struct_kernel_flock; +#else +# error struct flock definition not found in +#endif + +#if defined HAVE_STRUCT_FLOCK64 +typedef struct flock64 struct_kernel_flock64; +#elif defined HAVE_STRUCT___KERNEL_FLOCK64 +typedef struct __kernel_flock64 struct_kernel_flock64; +#else +# error struct flock64 definition not found in +#endif + +#endif /* !STRACE_FLOCK_H */ diff --git a/fs_x_ioctl.c b/fs_x_ioctl.c new file mode 100644 index 00000000..2fa30f56 --- /dev/null +++ b/fs_x_ioctl.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014 Mike Frysinger + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +int +fs_x_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { +#ifdef FITRIM + /* First seen in linux-2.6.37 */ + case FITRIM: { + struct fstrim_range fstrim; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &fstrim)) + tprintf("{start=%#" PRIx64 + ", len=%#" PRIx64 + ", minlen=%#" PRIx64 "}", + (uint64_t) fstrim.start, + (uint64_t) fstrim.len, + (uint64_t) fstrim.minlen); + break; + } +#endif + + /* No arguments */ +#ifdef FIFREEZE + case FIFREEZE: + case FITHAW: + break; +#endif + + default: + return RVAL_DECODED; + } + + return RVAL_DECODED | 1; +} diff --git a/fstatfs.c b/fstatfs.c new file mode 100644 index 00000000..1f358240 --- /dev/null +++ b/fstatfs.c @@ -0,0 +1,12 @@ +#include "defs.h" + +SYS_FUNC(fstatfs) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + print_struct_statfs(tcp, tcp->u_arg[1]); + } + return 0; +} diff --git a/fstatfs64.c b/fstatfs64.c new file mode 100644 index 00000000..166fc63d --- /dev/null +++ b/fstatfs64.c @@ -0,0 +1,12 @@ +#include "defs.h" + +SYS_FUNC(fstatfs64) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + } else { + print_struct_statfs64(tcp, tcp->u_arg[2], tcp->u_arg[1]); + } + return 0; +} diff --git a/futex.c b/futex.c new file mode 100644 index 00000000..5267dc48 --- /dev/null +++ b/futex.c @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2002-2003 Roland McGrath + * Copyright (c) 2007-2008 Ulrich Drepper + * Copyright (c) 2009 Andreas Schwab + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifndef FUTEX_PRIVATE_FLAG +# define FUTEX_PRIVATE_FLAG 128 +#endif +#ifndef FUTEX_CLOCK_REALTIME +# define FUTEX_CLOCK_REALTIME 256 +#endif + +#include "xlat/futexops.h" +#include "xlat/futexwakeops.h" +#include "xlat/futexwakecmps.h" + +SYS_FUNC(futex) +{ + const kernel_ulong_t uaddr = tcp->u_arg[0]; + const int op = tcp->u_arg[1]; + const int cmd = op & 127; + const kernel_ulong_t timeout = tcp->u_arg[3]; + const kernel_ulong_t uaddr2 = tcp->u_arg[4]; + const unsigned int val = tcp->u_arg[2]; + const unsigned int val2 = tcp->u_arg[3]; + const unsigned int val3 = tcp->u_arg[5]; + + printaddr(uaddr); + tprints(", "); + printxval(futexops, op, "FUTEX_???"); + switch (cmd) { + case FUTEX_WAIT: + tprintf(", %u", val); + tprints(", "); + print_timespec(tcp, timeout); + break; + case FUTEX_LOCK_PI: + tprints(", "); + print_timespec(tcp, timeout); + break; + case FUTEX_WAIT_BITSET: + tprintf(", %u", val); + tprints(", "); + print_timespec(tcp, timeout); + tprintf(", %#x", val3); + break; + case FUTEX_WAKE_BITSET: + tprintf(", %u", val); + tprintf(", %#x", val3); + break; + case FUTEX_REQUEUE: + tprintf(", %u", val); + tprintf(", %u, ", val2); + printaddr(uaddr2); + break; + case FUTEX_CMP_REQUEUE: + case FUTEX_CMP_REQUEUE_PI: + tprintf(", %u", val); + tprintf(", %u, ", val2); + printaddr(uaddr2); + tprintf(", %u", val3); + break; + case FUTEX_WAKE_OP: + tprintf(", %u", val); + tprintf(", %u, ", val2); + printaddr(uaddr2); + tprints(", "); + if ((val3 >> 28) & 8) + tprints("FUTEX_OP_OPARG_SHIFT<<28|"); + if (printxval(futexwakeops, (val3 >> 28) & 0x7, NULL)) + tprints("<<28"); + else + tprints("<<28 /* FUTEX_OP_??? */"); + tprintf("|%#x<<12|", (val3 >> 12) & 0xfff); + if (printxval(futexwakecmps, (val3 >> 24) & 0xf, NULL)) + tprints("<<24"); + else + tprints("<<24 /* FUTEX_OP_CMP_??? */"); + tprintf("|%#x", val3 & 0xfff); + break; + case FUTEX_WAIT_REQUEUE_PI: + tprintf(", %u", val); + tprints(", "); + print_timespec(tcp, timeout); + tprints(", "); + printaddr(uaddr2); + break; + case FUTEX_FD: + case FUTEX_WAKE: + tprintf(", %u", val); + break; + case FUTEX_UNLOCK_PI: + case FUTEX_TRYLOCK_PI: + break; + default: + tprintf(", %u", val); + tprints(", "); + printaddr(timeout); + tprints(", "); + printaddr(uaddr2); + tprintf(", %#x", val3); + break; + } + + return RVAL_DECODED; +} diff --git a/gcc_compat.h b/gcc_compat.h new file mode 100644 index 00000000..fe3f9048 --- /dev/null +++ b/gcc_compat.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_GCC_COMPAT_H +#define STRACE_GCC_COMPAT_H + +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +# define __attribute__(x) /* empty */ +# define GNUC_PREREQ(maj, min) 0 +#endif + +#if GNUC_PREREQ(2, 5) +# define ATTRIBUTE_NORETURN __attribute__((__noreturn__)) +#else +# define ATTRIBUTE_NORETURN /* empty */ +#endif + +#if GNUC_PREREQ(2, 7) +# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args)) +# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg))) +# define ATTRIBUTE_PACKED __attribute__((__packed__)) +#else +# define ATTRIBUTE_FORMAT(args) /* empty */ +# define ATTRIBUTE_ALIGNED(arg) /* empty */ +# define ATTRIBUTE_PACKED /* empty */ +#endif + +#if GNUC_PREREQ(3, 0) +# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y)) +# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0) +/* &(a)[0] is a pointer and not an array, shouldn't be treated as the same */ +# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0])) +#else +# define SAME_TYPE(x, y) 0 +# define MUST_BE_ARRAY(a) 0 +#endif + +#if GNUC_PREREQ(3, 0) +# define ATTRIBUTE_MALLOC __attribute__((__malloc__)) +#else +# define ATTRIBUTE_MALLOC /* empty */ +#endif + +#if GNUC_PREREQ(3, 1) +# define ATTRIBUTE_NOINLINE __attribute__((__noinline__)) +#else +# define ATTRIBUTE_NOINLINE /* empty */ +#endif + +#if GNUC_PREREQ(4, 0) +# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__)) +#else +# define ATTRIBUTE_SENTINEL /* empty */ +#endif + +#if GNUC_PREREQ(4, 1) +# define ALIGNOF(t_) __alignof__(t_) +#else +# define ALIGNOF(t_) (sizeof(struct {char x_; t_ y_;}) - sizeof(t_)) +#endif + +#if GNUC_PREREQ(4, 3) +# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args)) +#else +# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */ +#endif + +#endif /* !STRACE_GCC_COMPAT_H */ diff --git a/generate_sen.sh b/generate_sen.sh new file mode 100755 index 00000000..33d55392 --- /dev/null +++ b/generate_sen.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e + +echo 'enum {' +echo 'SEN_printargs = 0,' + sed -r -n '/printargs/! s/.*SEN\(([^)]+)\).*/\1/p' | + LC_COLLATE=C sort -u | + sed 's/.*/SEN_&,/' +echo '};' diff --git a/get_robust_list.c b/get_robust_list.c new file mode 100644 index 00000000..1977023a --- /dev/null +++ b/get_robust_list.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2012-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +SYS_FUNC(get_robust_list) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + } else { + printnum_ptr(tcp, tcp->u_arg[1]); + tprints(", "); + printnum_ulong(tcp, tcp->u_arg[2]); + } + return 0; +} diff --git a/getcpu.c b/getcpu.c new file mode 100644 index 00000000..5d0f52d1 --- /dev/null +++ b/getcpu.c @@ -0,0 +1,13 @@ +#include "defs.h" + +SYS_FUNC(getcpu) +{ + if (exiting(tcp)) { + printnum_int(tcp, tcp->u_arg[0], "%u"); + tprints(", "); + printnum_int(tcp, tcp->u_arg[1], "%u"); + tprints(", "); + printaddr(tcp->u_arg[2]); + } + return 0; +} diff --git a/getcwd.c b/getcwd.c new file mode 100644 index 00000000..a8ef591b --- /dev/null +++ b/getcwd.c @@ -0,0 +1,13 @@ +#include "defs.h" + +SYS_FUNC(getcwd) +{ + if (exiting(tcp)) { + if (syserror(tcp)) + printaddr(tcp->u_arg[0]); + else + printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1); + tprintf(", %" PRI_klu, tcp->u_arg[1]); + } + return 0; +} diff --git a/getrandom.c b/getrandom.c new file mode 100644 index 00000000..ea9ad572 --- /dev/null +++ b/getrandom.c @@ -0,0 +1,16 @@ +#include "defs.h" +#include "xlat/getrandom_flags.h" + +SYS_FUNC(getrandom) +{ + if (exiting(tcp)) { + if (syserror(tcp)) + printaddr(tcp->u_arg[0]); + else + printstr_ex(tcp, tcp->u_arg[0], tcp->u_rval, + QUOTE_FORCE_HEX); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + printflags(getrandom_flags, tcp->u_arg[2], "GRND_???"); + } + return 0; +} diff --git a/hdio.c b/hdio.c new file mode 100644 index 00000000..6e256d94 --- /dev/null +++ b/hdio.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2009, 2010 Jeff Mahoney + * Copyright (c) 2011-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_hd_geometry) + +#include + +typedef struct hd_geometry struct_hd_geometry; + +#include MPERS_DEFS + +MPERS_PRINTER_DECL(int, hdio_ioctl, struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) +{ + switch (code) { + case HDIO_GETGEO: + if (entering(tcp)) + return 0; + else { + struct_hd_geometry geo; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &geo)) + tprintf("{heads=%u, sectors=%u, " + "cylinders=%hu, start=%lu}", + (unsigned) geo.heads, + (unsigned) geo.sectors, + geo.cylinders, + (unsigned long) geo.start); + } + break; + default: + return RVAL_DECODED; + } + + return RVAL_DECODED | 1; +} diff --git a/hostname.c b/hostname.c new file mode 100644 index 00000000..75f96ba6 --- /dev/null +++ b/hostname.c @@ -0,0 +1,38 @@ +#include "defs.h" + +#ifdef HAVE_LINUX_UTSNAME_H +# include +#endif + +#ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +#endif + +SYS_FUNC(sethostname) +{ + unsigned int len = tcp->u_arg[1]; + + if (len > __NEW_UTS_LEN) { + printaddr(tcp->u_arg[0]); + } else { + printstrn(tcp, tcp->u_arg[0], len); + } + + tprintf(", %u", len); + + return RVAL_DECODED; +} + +#if defined(ALPHA) +SYS_FUNC(gethostname) +{ + if (exiting(tcp)) { + if (syserror(tcp)) + printaddr(tcp->u_arg[0]); + else + printstr(tcp, tcp->u_arg[0]); + tprintf(", %" PRI_klu, tcp->u_arg[1]); + } + return 0; +} +#endif /* ALPHA */ diff --git a/inotify.c b/inotify.c index 32f6b311..5ada8a86 100644 --- a/inotify.c +++ b/inotify.c @@ -1,42 +1,64 @@ +/* + * Copyright (c) 2006 Bernhard Kaindl + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "defs.h" #include -#include #include "xlat/inotify_flags.h" #include "xlat/inotify_init_flags.h" -int -sys_inotify_add_watch(struct tcb *tcp) +SYS_FUNC(inotify_add_watch) { - if (entering(tcp)) { - /* file descriptor */ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - /* pathname */ - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - /* mask */ - printflags(inotify_flags, tcp->u_arg[2], "IN_???"); - } - return 0; + /* file descriptor */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + /* pathname */ + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + /* mask */ + printflags(inotify_flags, tcp->u_arg[2], "IN_???"); + + return RVAL_DECODED; } -int -sys_inotify_rm_watch(struct tcb *tcp) +SYS_FUNC(inotify_rm_watch) { - if (entering(tcp)) { - /* file descriptor */ - printfd(tcp, tcp->u_arg[0]); - /* watch descriptor */ - tprintf(", %d", (int) tcp->u_arg[1]); - } - return 0; + /* file descriptor */ + printfd(tcp, tcp->u_arg[0]); + /* watch descriptor */ + tprintf(", %d", (int) tcp->u_arg[1]); + + return RVAL_DECODED; } -int -sys_inotify_init1(struct tcb *tcp) +SYS_FUNC(inotify_init1) { - if (entering(tcp)) - printflags(inotify_init_flags, tcp->u_arg[0], "IN_???"); - return 0; + printflags(inotify_init_flags, tcp->u_arg[0], "IN_???"); + + return RVAL_DECODED | RVAL_FD; } diff --git a/io.c b/io.c index 7238a8fa..c41b66fa 100644 --- a/io.c +++ b/io.c @@ -30,396 +30,284 @@ #include "defs.h" #include -#if HAVE_SYS_UIO_H -# include -#endif +#include -int -sys_read(struct tcb *tcp) +SYS_FUNC(read) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); } else { if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); + printaddr(tcp->u_arg[1]); else - printstr(tcp, tcp->u_arg[1], tcp->u_rval); - tprintf(", %lu", tcp->u_arg[2]); + printstrn(tcp, tcp->u_arg[1], tcp->u_rval); + tprintf(", %" PRI_klu, tcp->u_arg[2]); } return 0; } -int -sys_write(struct tcb *tcp) +SYS_FUNC(write) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu", tcp->u_arg[2]); - } - return 0; + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu, tcp->u_arg[2]); + + return RVAL_DECODED; } -#if HAVE_SYS_UIO_H -/* - * data_size limits the cumulative size of printed data. - * Example: recvmsg returing a short read. - */ -void -tprint_iov_upto(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov, unsigned long data_size) +struct print_iovec_config { + enum iov_decode decode_iov; + kernel_ulong_t data_size; +}; + +static bool +print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { -#if SUPPORTED_PERSONALITIES > 1 - union { - struct { u_int32_t base; u_int32_t len; } iov32; - struct { u_int64_t base; u_int64_t len; } iov64; - } iov; -#define sizeof_iov \ - (current_wordsize == 4 ? sizeof(iov.iov32) : sizeof(iov.iov64)) -#define iov_iov_base \ - (current_wordsize == 4 ? (uint64_t) iov.iov32.base : iov.iov64.base) -#define iov_iov_len \ - (current_wordsize == 4 ? (uint64_t) iov.iov32.len : iov.iov64.len) -#else - struct iovec iov; -#define sizeof_iov sizeof(iov) -#define iov_iov_base iov.iov_base -#define iov_iov_len iov.iov_len -#endif - unsigned long size, cur, end, abbrev_end; - int failed = 0; + const kernel_ulong_t *iov; + kernel_ulong_t iov_buf[2], len; + struct print_iovec_config *c = data; - if (!len) { - tprints("[]"); - return; - } - size = len * sizeof_iov; - end = addr + size; - if (!verbose(tcp) || size / sizeof_iov != len || end < addr) { - tprintf("%#lx", addr); - return; - } - if (abbrev(tcp)) { - abbrev_end = addr + max_strlen * sizeof_iov; - if (abbrev_end < addr) - abbrev_end = end; + if (elem_size < sizeof(iov_buf)) { + iov_buf[0] = ((unsigned int *) elem_buf)[0]; + iov_buf[1] = ((unsigned int *) elem_buf)[1]; + iov = iov_buf; } else { - abbrev_end = end; + iov = elem_buf; } - tprints("["); - for (cur = addr; cur < end; cur += sizeof_iov) { - if (cur > addr) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); + + tprints("{iov_base="); + + len = iov[1]; + + switch (c->decode_iov) { + case IOV_DECODE_STR: + if (len > c->data_size) + len = c->data_size; + if (c->data_size != (kernel_ulong_t) -1) + c->data_size -= len; + printstrn(tcp, iov[0], len); break; - } - if (umoven(tcp, cur, sizeof_iov, (char *) &iov) < 0) { - tprints("?"); - failed = 1; + case IOV_DECODE_NETLINK: + if (len > c->data_size) + len = c->data_size; + if (c->data_size != (kernel_ulong_t) -1) + c->data_size -= len; + decode_netlink(tcp, iov[0], iov[1]); + break; + default: + printaddr(iov[0]); break; - } - tprints("{"); - if (decode_iov) { - unsigned long len = iov_iov_len; - if (len > data_size) - len = data_size; - data_size -= len; - printstr(tcp, (long) iov_iov_base, len); - } else - tprintf("%#lx", (long) iov_iov_base); - tprintf(", %lu}", (unsigned long)iov_iov_len); } - tprints("]"); - if (failed) - tprintf(" %#lx", addr); -#undef sizeof_iov -#undef iov_iov_base -#undef iov_iov_len + + tprintf(", iov_len=%" PRI_klu "}", iov[1]); + + return true; } +/* + * data_size limits the cumulative size of printed data. + * Example: recvmsg returing a short read. + */ void -tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov) +tprint_iov_upto(struct tcb *const tcp, const kernel_ulong_t len, + const kernel_ulong_t addr, const enum iov_decode decode_iov, + const kernel_ulong_t data_size) { - tprint_iov_upto(tcp, len, addr, decode_iov, (unsigned long) -1L); + kernel_ulong_t iov[2]; + struct print_iovec_config config = + { .decode_iov = decode_iov, .data_size = data_size }; + + print_array(tcp, addr, len, iov, current_wordsize * 2, + umoven_or_printaddr_ignore_syserror, print_iovec, &config); } -int -sys_readv(struct tcb *tcp) +SYS_FUNC(readv) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); } else { - if (syserror(tcp)) { - tprintf("%#lx, %lu", - tcp->u_arg[1], tcp->u_arg[2]); - return 0; - } - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); - tprintf(", %lu", tcp->u_arg[2]); + tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], + syserror(tcp) ? IOV_DECODE_ADDR : + IOV_DECODE_STR, tcp->u_rval); + tprintf(", %" PRI_klu, tcp->u_arg[2]); } return 0; } -int -sys_writev(struct tcb *tcp) +SYS_FUNC(writev) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); - tprintf(", %lu", tcp->u_arg[2]); - } - return 0; -} -#endif + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR); + tprintf(", %" PRI_klu, tcp->u_arg[2]); -/* The SH4 ABI does allow long longs in odd-numbered registers, but - does not allow them to be split between registers and memory - and - there are only four argument registers for normal functions. As a - result pread takes an extra padding argument before the offset. This - was changed late in the 2.4 series (around 2.4.20). */ -#if defined(SH) -#define PREAD_OFFSET_ARG 4 -#else -#define PREAD_OFFSET_ARG 3 -#endif + return RVAL_DECODED; +} -int -sys_pread(struct tcb *tcp) +SYS_FUNC(pread) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); } else { if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); + printaddr(tcp->u_arg[1]); else - printstr(tcp, tcp->u_arg[1], tcp->u_rval); - tprintf(", %lu, ", tcp->u_arg[2]); - printllval(tcp, "%llu", PREAD_OFFSET_ARG); + printstrn(tcp, tcp->u_arg[1], tcp->u_rval); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); + printllval(tcp, "%lld", 3); } return 0; } -int -sys_pwrite(struct tcb *tcp) +SYS_FUNC(pwrite) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, ", tcp->u_arg[2]); - printllval(tcp, "%llu", PREAD_OFFSET_ARG); - } - return 0; -} + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); + printllval(tcp, "%lld", 3); -#if HAVE_SYS_UIO_H + return RVAL_DECODED; +} static void -print_llu_from_low_high_val(struct tcb *tcp, int arg) +print_lld_from_low_high_val(struct tcb *tcp, int arg) { -#if SIZEOF_LONG == SIZEOF_LONG_LONG - tprintf("%lu", (unsigned long) tcp->u_arg[arg]); -#elif defined(LINUX_MIPSN32) - tprintf("%llu", (unsigned long long) tcp->ext_arg[arg]); -#else -# ifdef X32 - if (current_personality == 0) - tprintf("%llu", (unsigned long long) tcp->ext_arg[arg]); - else -# endif - tprintf("%llu", - ((unsigned long long) (unsigned long) tcp->u_arg[arg + 1] << sizeof(long) * 8) - | (unsigned long long) (unsigned long) tcp->u_arg[arg]); +#if SIZEOF_KERNEL_LONG_T > 4 +# ifndef current_klongsize + if (current_klongsize < SIZEOF_KERNEL_LONG_T) { + tprintf("%" PRI_kld, (tcp->u_arg[arg + 1] << 32) + | tcp->u_arg[arg]); + } else +# endif /* !current_klongsize */ + { + tprintf("%" PRI_kld, tcp->u_arg[arg]); + } +#else /* SIZEOF_KERNEL_LONG_T == 4 */ + tprintf("%lld", + ((long long) tcp->u_arg[arg + 1] << 32) + | ((long long) tcp->u_arg[arg])); #endif } -int -sys_preadv(struct tcb *tcp) +#include "xlat/rwf_flags.h" + +static int +do_preadv(struct tcb *tcp, const int flags_arg) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); } else { - if (syserror(tcp)) { - tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]); - return 0; + kernel_ulong_t len = + truncate_kulong_to_current_wordsize(tcp->u_arg[2]); + + tprint_iov_upto(tcp, len, tcp->u_arg[1], + syserror(tcp) ? IOV_DECODE_ADDR : + IOV_DECODE_STR, tcp->u_rval); + tprintf(", %" PRI_klu ", ", len); + print_lld_from_low_high_val(tcp, 3); + if (flags_arg >= 0) { + tprints(", "); + printflags(rwf_flags, tcp->u_arg[flags_arg], "RWF_???"); } - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); - tprintf(", %lu, ", tcp->u_arg[2]); - print_llu_from_low_high_val(tcp, 3); } return 0; } -int -sys_pwritev(struct tcb *tcp) +SYS_FUNC(preadv) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); - tprintf(", %lu, ", tcp->u_arg[2]); - print_llu_from_low_high_val(tcp, 3); - } - return 0; + return do_preadv(tcp, -1); } -#endif /* HAVE_SYS_UIO_H */ -static void -print_off_t(struct tcb *tcp, long addr) +SYS_FUNC(preadv2) { - unsigned long offset; - - if (!addr) { - tprints("NULL"); - return; - } - -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize == 4) { - uint32_t off; - - if (umove(tcp, addr, &off) < 0) - tprintf("%#lx", addr); - else - tprintf("[%u]", off); - } else -#endif - if (umove(tcp, addr, &offset) < 0) - tprintf("%#lx", addr); - else - tprintf("[%lu]", offset); + return do_preadv(tcp, 5); } -int -sys_sendfile(struct tcb *tcp) +static int +do_pwritev(struct tcb *tcp, const int flags_arg) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printfd(tcp, tcp->u_arg[1]); + kernel_ulong_t len = + truncate_kulong_to_current_wordsize(tcp->u_arg[2]); + + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + tprint_iov(tcp, len, tcp->u_arg[1], IOV_DECODE_STR); + tprintf(", %" PRI_klu ", ", len); + print_lld_from_low_high_val(tcp, 3); + if (flags_arg >= 0) { tprints(", "); - print_off_t(tcp, tcp->u_arg[2]); - tprintf(", %lu", tcp->u_arg[3]); + printflags(rwf_flags, tcp->u_arg[flags_arg], "RWF_???"); } - return 0; + + return RVAL_DECODED; } -void -print_loff_t(struct tcb *tcp, long addr) +SYS_FUNC(pwritev) { - loff_t offset; - - if (!addr) - tprints("NULL"); - else if (umove(tcp, addr, &offset) < 0) - tprintf("%#lx", addr); - else - tprintf("[%llu]", (unsigned long long int) offset); + return do_pwritev(tcp, -1); } -int -sys_sendfile64(struct tcb *tcp) +SYS_FUNC(pwritev2) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printfd(tcp, tcp->u_arg[1]); - tprints(", "); - print_loff_t(tcp, tcp->u_arg[2]); - tprintf(", %lu", tcp->u_arg[3]); - } - return 0; + return do_pwritev(tcp, 5); } #include "xlat/splice_flags.h" -int -sys_tee(struct tcb *tcp) +SYS_FUNC(tee) { - if (entering(tcp)) { - /* int fd_in */ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - /* int fd_out */ - printfd(tcp, tcp->u_arg[1]); - tprints(", "); - /* size_t len */ - tprintf("%lu, ", tcp->u_arg[2]); - /* unsigned int flags */ - printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???"); - } - return 0; -} + /* int fd_in */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + /* int fd_out */ + printfd(tcp, tcp->u_arg[1]); + tprints(", "); + /* size_t len */ + tprintf("%" PRI_klu ", ", tcp->u_arg[2]); + /* unsigned int flags */ + printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???"); -int -sys_splice(struct tcb *tcp) -{ - if (entering(tcp)) { - /* int fd_in */ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - /* loff_t *off_in */ - print_loff_t(tcp, tcp->u_arg[1]); - tprints(", "); - /* int fd_out */ - printfd(tcp, tcp->u_arg[2]); - tprints(", "); - /* loff_t *off_out */ - print_loff_t(tcp, tcp->u_arg[3]); - tprints(", "); - /* size_t len */ - tprintf("%lu, ", tcp->u_arg[4]); - /* unsigned int flags */ - printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???"); - } - return 0; + return RVAL_DECODED; } -int -sys_vmsplice(struct tcb *tcp) +SYS_FUNC(splice) { - if (entering(tcp)) { - /* int fd */ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - /* const struct iovec *iov, unsigned long nr_segs */ - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); - tprintf(", %lu, ", tcp->u_arg[2]); - /* unsigned int flags */ - printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???"); - } - return 0; + /* int fd_in */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + /* loff_t *off_in */ + printnum_int64(tcp, tcp->u_arg[1], "%" PRId64); + tprints(", "); + /* int fd_out */ + printfd(tcp, tcp->u_arg[2]); + tprints(", "); + /* loff_t *off_out */ + printnum_int64(tcp, tcp->u_arg[3], "%" PRId64); + tprints(", "); + /* size_t len */ + tprintf("%" PRI_klu ", ", tcp->u_arg[4]); + /* unsigned int flags */ + printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???"); + + return RVAL_DECODED; } -int -sys_ioctl(struct tcb *tcp) +SYS_FUNC(vmsplice) { - const struct_ioctlent *iop; + /* int fd */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + /* const struct iovec *iov, unsigned long nr_segs */ + tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); + /* unsigned int flags */ + printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???"); - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - iop = ioctl_lookup(tcp->u_arg[1]); - if (iop) { - tprints(iop->symbol); - while ((iop = ioctl_next_match(iop))) - tprintf(" or %s", iop->symbol); - } else - tprintf("%#lx", tcp->u_arg[1]); - ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]); - } - else { - int ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]); - if (!ret) - tprintf(", %#lx", tcp->u_arg[2]); - else - return ret - 1; - } - return 0; + return RVAL_DECODED; } diff --git a/ioctl.c b/ioctl.c index 3f6c410b..aa1880f8 100644 --- a/ioctl.c +++ b/ioctl.c @@ -29,23 +29,30 @@ */ #include "defs.h" -#include +#include +#include "xlat/ioctl_dirs.h" + +#ifdef HAVE_LINUX_INPUT_H +# include +#endif + +#include "xlat/evdev_abs.h" +#include "xlat/evdev_ev.h" static int compare(const void *a, const void *b) { - unsigned long code1 = (long) a; - unsigned long code2 = ((struct_ioctlent *) b)->code; + const unsigned int code1 = (const uintptr_t) a; + const unsigned int code2 = ((struct_ioctlent *) b)->code; return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0; } -const struct_ioctlent * -ioctl_lookup(long code) +static const struct_ioctlent * +ioctl_lookup(const unsigned int code) { struct_ioctlent *iop; - code &= (_IOC_NRMASK<<_IOC_NRSHIFT) | (_IOC_TYPEMASK<<_IOC_TYPESHIFT); - iop = bsearch((void*)code, ioctlent, + iop = bsearch((const void *) (const uintptr_t) code, ioctlent, nioctlents, sizeof(ioctlent[0]), compare); while (iop > ioctlent) { iop--; @@ -57,25 +64,184 @@ ioctl_lookup(long code) return iop; } -const struct_ioctlent * +static const struct_ioctlent * ioctl_next_match(const struct_ioctlent *iop) { - long code; - - code = iop->code; + const unsigned int code = iop->code; iop++; if (iop < ioctlent + nioctlents && iop->code == code) return iop; return NULL; } -int -ioctl_decode(struct tcb *tcp, long code, long arg) +static void +ioctl_print_code(const unsigned int code) +{ + tprints("_IOC("); + printflags(ioctl_dirs, _IOC_DIR(code), "_IOC_???"); + tprintf(", %#x, %#x, %#x)", + _IOC_TYPE(code), _IOC_NR(code), _IOC_SIZE(code)); +} + +static int +evdev_decode_number(const unsigned int code) +{ + const unsigned int nr = _IOC_NR(code); + + if (_IOC_DIR(code) == _IOC_WRITE) { + if (nr >= 0xc0 && nr <= 0xc0 + 0x3f) { + tprints("EVIOCSABS("); + printxval(evdev_abs, nr - 0xc0, "ABS_???"); + tprints(")"); + return 1; + } + } + + if (_IOC_DIR(code) != _IOC_READ) + return 0; + + if (nr >= 0x20 && nr <= 0x20 + 0x1f) { + tprints("EVIOCGBIT("); + printxval(evdev_ev, nr - 0x20, "EV_???"); + tprintf(", %u)", _IOC_SIZE(code)); + return 1; + } else if (nr >= 0x40 && nr <= 0x40 + 0x3f) { + tprints("EVIOCGABS("); + printxval(evdev_abs, nr - 0x40, "ABS_???"); + tprints(")"); + return 1; + } + + switch (_IOC_NR(nr)) { + case 0x06: + tprintf("EVIOCGNAME(%u)", _IOC_SIZE(code)); + return 1; + case 0x07: + tprintf("EVIOCGPHYS(%u)", _IOC_SIZE(code)); + return 1; + case 0x08: + tprintf("EVIOCGUNIQ(%u)", _IOC_SIZE(code)); + return 1; + case 0x09: + tprintf("EVIOCGPROP(%u)", _IOC_SIZE(code)); + return 1; + case 0x0a: + tprintf("EVIOCGMTSLOTS(%u)", _IOC_SIZE(code)); + return 1; + case 0x18: + tprintf("EVIOCGKEY(%u)", _IOC_SIZE(code)); + return 1; + case 0x19: + tprintf("EVIOCGLED(%u)", _IOC_SIZE(code)); + return 1; + case 0x1a: + tprintf("EVIOCGSND(%u)", _IOC_SIZE(code)); + return 1; + case 0x1b: + tprintf("EVIOCGSW(%u)", _IOC_SIZE(code)); + return 1; + default: + return 0; + } +} + +static int +hiddev_decode_number(const unsigned int code) { - switch ((code >> 8) & 0xff) { + if (_IOC_DIR(code) == _IOC_READ) { + switch (_IOC_NR(code)) { + case 0x04: + tprintf("HIDIOCGRAWNAME(%u)", _IOC_SIZE(code)); + return 1; + case 0x05: + tprintf("HIDIOCGRAWPHYS(%u)", _IOC_SIZE(code)); + return 1; + case 0x06: + tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code)); + return 1; + case 0x12: + tprintf("HIDIOCGPHYS(%u)", _IOC_SIZE(code)); + return 1; + default: + return 0; + } + } else if (_IOC_DIR(code) == (_IOC_READ | _IOC_WRITE)) { + switch (_IOC_NR(code)) { + case 0x06: + tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code)); + return 1; + case 0x07: + tprintf("HIDIOCGFEATURE(%u)", _IOC_SIZE(code)); + return 1; + default: + return 0; + } + } + + return 0; +} + +static int +ioctl_decode_command_number(struct tcb *tcp) +{ + const unsigned int code = tcp->u_arg[1]; + + switch (_IOC_TYPE(code)) { + case 'E': + return evdev_decode_number(code); + case 'H': + return hiddev_decode_number(code); + case 'M': + if (_IOC_DIR(code) == _IOC_WRITE) { + tprintf("MIXER_WRITE(%u)", _IOC_NR(code)); + return 1; + } else if (_IOC_DIR(code) == _IOC_READ) { + tprintf("MIXER_READ(%u)", _IOC_NR(code)); + return 1; + } + return 0; + case 'U': + if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x2c) { + tprintf("UI_GET_SYSNAME(%u)", _IOC_SIZE(code)); + return 1; + } + return 0; + case 'j': + if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x13) { + tprintf("JSIOCGNAME(%u)", _IOC_SIZE(code)); + return 1; + } + return 0; + case 'k': + if (_IOC_DIR(code) == _IOC_WRITE && _IOC_NR(code) == 0) { + tprintf("SPI_IOC_MESSAGE(%u)", _IOC_SIZE(code)); + return 1; + } + return 0; + default: + return 0; + } +} + +static int +ioctl_decode(struct tcb *tcp) +{ + const unsigned int code = tcp->u_arg[1]; + const kernel_ulong_t arg = tcp->u_arg[2]; + + switch (_IOC_TYPE(code)) { #if defined(ALPHA) || defined(POWERPC) - case 'f': case 't': case 'T': + case 'f': { + int ret = file_ioctl(tcp, code, arg); + if (ret != RVAL_DECODED) + return ret; + } + case 't': + case 'T': + return term_ioctl(tcp, code, arg); #else /* !ALPHA */ + case 'f': + return file_ioctl(tcp, code, arg); case 0x54: #endif /* !ALPHA */ return term_ioctl(tcp, code, arg); @@ -84,12 +250,13 @@ ioctl_decode(struct tcb *tcp, long code, long arg) case 'p': return rtc_ioctl(tcp, code, arg); case 0x03: + return hdio_ioctl(tcp, code, arg); case 0x12: return block_ioctl(tcp, code, arg); -#ifdef HAVE_SCSI_SG_H + case 'X': + return fs_x_ioctl(tcp, code, arg); case 0x22: return scsi_ioctl(tcp, code, arg); -#endif case 'L': return loop_ioctl(tcp, code, arg); case 'M': @@ -97,58 +264,69 @@ ioctl_decode(struct tcb *tcp, long code, long arg) case 'o': case 'O': return ubi_ioctl(tcp, code, arg); + case 'V': + return v4l2_ioctl(tcp, code, arg); case '=': return ptp_ioctl(tcp, code, arg); +#ifdef HAVE_LINUX_INPUT_H + case 'E': + return evdev_ioctl(tcp, code, arg); +#endif +#ifdef HAVE_LINUX_USERFAULTFD_H + case 0xaa: + return uffdio_ioctl(tcp, code, arg); +#endif +#ifdef HAVE_LINUX_BTRFS_H + case 0x94: + return btrfs_ioctl(tcp, code, arg); +#endif +#ifdef HAVE_LINUX_DM_IOCTL_H + case 0xfd: + return dm_ioctl(tcp, code, arg); +#endif default: break; } return 0; } -/* - * Registry of ioctl characters, culled from - * @(#)ioccom.h 1.7 89/06/16 SMI; from UCB ioctl.h 7.1 6/4/86 - * - * char file where defined notes - * ---- ------------------ ----- - * F sun/fbio.h - * G sun/gpio.h - * H vaxif/if_hy.h - * M sundev/mcpcmd.h *overlap* - * M sys/modem.h *overlap* - * S sys/stropts.h - * T sys/termio.h -no overlap- - * T sys/termios.h -no overlap- - * V sundev/mdreg.h - * a vaxuba/adreg.h - * d sun/dkio.h -no overlap with sys/des.h- - * d sys/des.h (possible overlap) - * d vax/dkio.h (possible overlap) - * d vaxuba/rxreg.h (possible overlap) - * f sys/filio.h - * g sunwindow/win_ioctl.h -no overlap- - * g sunwindowdev/winioctl.c !no manifest constant! -no overlap- - * h sundev/hrc_common.h - * i sys/sockio.h *overlap* - * i vaxuba/ikreg.h *overlap* - * k sundev/kbio.h - * m sundev/msio.h (possible overlap) - * m sundev/msreg.h (possible overlap) - * m sys/mtio.h (possible overlap) - * n sun/ndio.h - * p net/nit_buf.h (possible overlap) - * p net/nit_if.h (possible overlap) - * p net/nit_pf.h (possible overlap) - * p sundev/fpareg.h (possible overlap) - * p sys/sockio.h (possible overlap) - * p vaxuba/psreg.h (possible overlap) - * q sun/sqz.h - * r sys/sockio.h - * s sys/sockio.h - * t sys/ttold.h (possible overlap) - * t sys/ttycom.h (possible overlap) - * v sundev/vuid_event.h *overlap* - * v sys/vcmd.h *overlap* - * - * End of Registry - */ +SYS_FUNC(ioctl) +{ + const struct_ioctlent *iop; + int ret; + + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + ret = ioctl_decode_command_number(tcp); + if (!(ret & IOCTL_NUMBER_STOP_LOOKUP)) { + iop = ioctl_lookup(tcp->u_arg[1]); + if (iop) { + if (ret) + tprints(" or "); + tprints(iop->symbol); + while ((iop = ioctl_next_match(iop))) + tprintf(" or %s", iop->symbol); + } else if (!ret) { + ioctl_print_code(tcp->u_arg[1]); + } + } + ret = ioctl_decode(tcp); + } else { + ret = ioctl_decode(tcp) | RVAL_DECODED; + } + + if (ret & RVAL_DECODED) { + ret &= ~RVAL_DECODED; + if (ret) + --ret; + else + tprintf(", %#" PRI_klx, tcp->u_arg[2]); + ret |= RVAL_DECODED; + } else { + if (ret) + --ret; + } + + return ret; +} diff --git a/ioctl_iocdef.c b/ioctl_iocdef.c new file mode 100644 index 00000000..accbbedd --- /dev/null +++ b/ioctl_iocdef.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Alexey Neyman + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is *PREPROCESSED*, not *COMPILED* for host and the result + * is included into ioctlsort (which is compiled for build). Since some + * of these values are used in structure initializers, they cannot be + * defined as 'const unsigned int' - instead, they have to be macros. + * Hence, the result of preprocessing will be run through sed to change + * 'DEFINE' into '#define' + */ +#include + +DEFINE HOST_IOC_NONE _IOC_NONE +DEFINE HOST_IOC_READ _IOC_READ +DEFINE HOST_IOC_WRITE _IOC_WRITE + +DEFINE HOST_IOC_SIZESHIFT _IOC_SIZESHIFT +DEFINE HOST_IOC_DIRSHIFT _IOC_DIRSHIFT diff --git a/ioctlsort.c b/ioctlsort.c new file mode 100644 index 00000000..079f21e5 --- /dev/null +++ b/ioctlsort.c @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2001 Wichert Akkerman + * Copyright (c) 2004-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +#include "ioctl_iocdef.h" + +struct ioctlent { + const char *info; + const char *name; + unsigned int dir; + unsigned int type_nr; + unsigned int size; +}; + +static int +is_prefix(const char *s1, const char *s2) +{ + size_t len = strlen(s1); + + if (len > strlen(s2)) + return 0; + return !memcmp(s1, s2, len); +} + +static int +compare_name_info(const void* a, const void* b) +{ + int rc; + + const char *name1 = ((struct ioctlent *) a)->name; + const char *name2 = ((struct ioctlent *) b)->name; + const char *info1 = ((struct ioctlent *) a)->info; + const char *info2 = ((struct ioctlent *) b)->info; + + rc = strcmp(name1, name2); + if (rc) + return rc; + + /* + * exception from lexicographical order: + * "asm/" < "asm-generic/" + */ + if (is_prefix("asm/", info1) && + is_prefix("asm-generic/", info2)) + return -1; + + if (is_prefix("asm/", info2) && + is_prefix("asm-generic/", info1)) + return 1; + + return strcmp(info1, info2); +} + +static unsigned int +code(const struct ioctlent *e) +{ + return e->type_nr | + (e->size << _IOC_SIZESHIFT) | + (e->dir << _IOC_DIRSHIFT); +} + +static int +compare_code_name(const void* a, const void* b) +{ + unsigned int code1 = code((struct ioctlent *) a); + unsigned int code2 = code((struct ioctlent *) b); + const char *name1 = ((struct ioctlent *) a)->name; + const char *name2 = ((struct ioctlent *) b)->name; + return (code1 > code2) ? + 1 : (code1 < code2) ? -1 : strcmp(name1, name2); +} + +static void +ioctlsort(struct ioctlent *ioctls, size_t nioctls) +{ + size_t i; + + qsort(ioctls, nioctls, sizeof(ioctls[0]), compare_name_info); + + for (i = 1; i < nioctls; ++i) + if (!strcmp(ioctls[i-1].name, ioctls[i].name)) { + /* + * If there are multiple definitions for the same + * name, keep the first one and mark all the rest + * for deletion. + */ + ioctls[i].info = NULL; + } + + for (i = 1; i < nioctls; ++i) + if (!ioctls[i].info) { + /* + * Change ioctl code of marked elements + * to make them sorted to the end of array. + */ + ioctls[i].dir = + ioctls[i].type_nr = + ioctls[i].size = 0xffffffffu; + } + + qsort(ioctls, nioctls, sizeof(ioctls[0]), compare_code_name); + + puts("/* Generated by ioctlsort. */"); + for (i = 0; i < nioctls; ++i) { + if (!ioctls[i].info) { + /* + * We've reached the first element marked for deletion. + */ + break; + } + if (i == 0 || code(&ioctls[i-1]) != code(&ioctls[i]) || + !is_prefix(ioctls[i-1].name, ioctls[i].name)) + printf("{ \"%s\", %#010x },\n", + ioctls[i].name, code(ioctls+i)); + } +} + +static struct ioctlent ioctls[] = { +#ifdef IOCTLSORT_INC +# include IOCTLSORT_INC +#else +# include "ioctls_arch.h" +# include "ioctls_inc.h" +#endif +}; + +int +main(void) +{ + ioctlsort(ioctls, sizeof(ioctls) / sizeof(ioctls[0])); + return 0; +} diff --git a/ioperm.c b/ioperm.c new file mode 100644 index 00000000..e9eea7f6 --- /dev/null +++ b/ioperm.c @@ -0,0 +1,9 @@ +#include "defs.h" + +SYS_FUNC(ioperm) +{ + tprintf("%#" PRI_klx ", %#" PRI_klx ", %d", + tcp->u_arg[0], tcp->u_arg[1], (int) tcp->u_arg[2]); + + return RVAL_DECODED; +} diff --git a/iopl.c b/iopl.c new file mode 100644 index 00000000..0f2bb322 --- /dev/null +++ b/iopl.c @@ -0,0 +1,8 @@ +#include "defs.h" + +SYS_FUNC(iopl) +{ + tprintf("%d", (int) tcp->u_arg[0]); + + return RVAL_DECODED; +} diff --git a/ioprio.c b/ioprio.c index 6826e56d..0b83be7a 100644 --- a/ioprio.c +++ b/ioprio.c @@ -1,3 +1,30 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "defs.h" enum { @@ -24,26 +51,25 @@ enum { #define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK) static const char * -sprint_ioprio(int ioprio) +sprint_ioprio(unsigned int ioprio) { static char outstr[256]; const char *str; - int class, data; + unsigned int class, data; class = IOPRIO_PRIO_CLASS(ioprio); data = IOPRIO_PRIO_DATA(ioprio); str = xlookup(ioprio_class, class); if (str) - sprintf(outstr, "IOPRIO_PRIO_VALUE(%s,%d)", str, data); + sprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", str, data); else - sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */,%d)", + sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */, %d)", class, "IOPRIO_CLASS_???", data); return outstr; } -int -sys_ioprio_get(struct tcb *tcp) +SYS_FUNC(ioprio_get) { if (entering(tcp)) { /* int which */ @@ -60,16 +86,14 @@ sys_ioprio_get(struct tcb *tcp) } } -int -sys_ioprio_set(struct tcb *tcp) +SYS_FUNC(ioprio_set) { - if (entering(tcp)) { - /* int which */ - printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???"); - /* int who */ - tprintf(", %d, ", (int) tcp->u_arg[1]); - /* int ioprio */ - tprints(sprint_ioprio(tcp->u_arg[2])); - } - return 0; + /* int which */ + printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???"); + /* int who */ + tprintf(", %d, ", (int) tcp->u_arg[1]); + /* int ioprio */ + tprints(sprint_ioprio(tcp->u_arg[2])); + + return RVAL_DECODED; } diff --git a/ipc.c b/ipc.c index e04a6189..bd23a4ed 100644 --- a/ipc.c +++ b/ipc.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 1993 Ulrich Pegelow - * Copyright (c) 1993 Branko Lankester - * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey - * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,436 +26,26 @@ */ #include "defs.h" -#ifdef HAVE_MQUEUE_H -# include -#endif -#include -#include -#include -#include -#include +#include "xlat/ipccalls.h" -#ifndef MSG_STAT -#define MSG_STAT 11 -#endif -#ifndef MSG_INFO -#define MSG_INFO 12 -#endif -#ifndef SHM_STAT -#define SHM_STAT 13 -#endif -#ifndef SHM_INFO -#define SHM_INFO 14 -#endif -#ifndef SEM_STAT -#define SEM_STAT 18 -#endif -#ifndef SEM_INFO -#define SEM_INFO 19 -#endif - -#if !defined IPC_64 -# define IPC_64 0x100 -#endif - -extern void printsigevent(struct tcb *tcp, long arg); - -#include "xlat/msgctl_flags.h" -#include "xlat/semctl_flags.h" -#include "xlat/shmctl_flags.h" -#include "xlat/resource_flags.h" -#include "xlat/shm_resource_flags.h" -#include "xlat/shm_flags.h" -#include "xlat/ipc_msg_flags.h" -#include "xlat/semop_flags.h" - -int sys_msgget(struct tcb *tcp) -{ - if (entering(tcp)) { - if (tcp->u_arg[0]) - tprintf("%#lx, ", tcp->u_arg[0]); - else - tprints("IPC_PRIVATE, "); - if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0) - tprints("|"); - tprintf("%#lo", tcp->u_arg[1] & 0777); - } - return 0; -} - -#ifdef IPC_64 -# define PRINTCTL(flagset, arg, dflt) \ - if ((arg) & IPC_64) tprints("IPC_64|"); \ - printxval((flagset), (arg) &~ IPC_64, dflt) -#else -# define PRINTCTL printxval -#endif - -static int -indirect_ipccall(struct tcb *tcp) -{ -#ifdef X86_64 - return current_personality == 1; -#endif -#if defined IA64 - return tcp->scno < 1024; /* ia32 emulation syscalls are low */ -#endif -#if defined(ALPHA) || defined(MIPS) || defined(HPPA) || defined(__ARM_EABI__) || defined(AARCH64) - return 0; -#endif - return 1; -} - -int sys_msgctl(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???"); - tprintf(", %#lx", tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]); - } - return 0; -} - -static void -tprint_msgsnd(struct tcb *tcp, long addr, unsigned long count, - unsigned long flags) -{ - long mtype; - - if (umove(tcp, addr, &mtype) < 0) { - tprintf("%#lx", addr); - } else { - tprintf("{%lu, ", mtype); - printstr(tcp, addr + sizeof(mtype), count); - tprints("}"); - } - tprintf(", %lu, ", count); - printflags(ipc_msg_flags, flags, "MSG_???"); -} - -int sys_msgsnd(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%d, ", (int) tcp->u_arg[0]); - if (indirect_ipccall(tcp)) { - tprint_msgsnd(tcp, tcp->u_arg[3], tcp->u_arg[1], - tcp->u_arg[2]); - } else { - tprint_msgsnd(tcp, tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3]); - } - } - return 0; -} - -static void -tprint_msgrcv(struct tcb *tcp, long addr, unsigned long count, long msgtyp) -{ - long mtype; - - if (syserror(tcp) || umove(tcp, addr, &mtype) < 0) { - tprintf("%#lx", addr); - } else { - tprintf("{%lu, ", mtype); - printstr(tcp, addr + sizeof(mtype), count); - tprints("}"); - } - tprintf(", %lu, %ld, ", count, msgtyp); -} - -int sys_msgrcv(struct tcb *tcp) +SYS_FUNC(ipc) { - if (entering(tcp)) { - tprintf("%d, ", (int) tcp->u_arg[0]); - } else { - if (indirect_ipccall(tcp)) { - struct ipc_wrapper { - struct msgbuf *msgp; - long msgtyp; - } tmp; + unsigned int call = tcp->u_arg[0]; + unsigned int version = call >> 16; + call &= 0xffff; + const char *str = xlookup(ipccalls, call); - if (umove(tcp, tcp->u_arg[3], &tmp) < 0) { - tprintf("%#lx, %lu, ", - tcp->u_arg[3], tcp->u_arg[1]); - } else { - tprint_msgrcv(tcp, (long) tmp.msgp, - tcp->u_arg[1], tmp.msgtyp); - } - printflags(ipc_msg_flags, tcp->u_arg[2], "MSG_???"); - } else { - tprint_msgrcv(tcp, tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3]); - printflags(ipc_msg_flags, tcp->u_arg[4], "MSG_???"); - } - } - return 0; -} + if (version) + tprintf("%u<<16|", version); -static void -tprint_sembuf(struct tcb *tcp, long addr, unsigned long count) -{ - unsigned long i, max_count; - - if (abbrev(tcp)) - max_count = (max_strlen < count) ? max_strlen : count; + if (str) + tprints(str); else - max_count = count; - - if (!max_count) { - tprintf("%#lx, %lu", addr, count); - return; - } + tprintf("%u", call); - for (i = 0; i < max_count; ++i) { - struct sembuf sb; - if (i) - tprints(", "); - if (umove(tcp, addr + i * sizeof(struct sembuf), &sb) < 0) { - if (i) { - tprints("{???}"); - break; - } else { - tprintf("%#lx, %lu", addr, count); - return; - } - } else { - if (!i) - tprints("{"); - tprintf("{%u, %d, ", sb.sem_num, sb.sem_op); - printflags(semop_flags, sb.sem_flg, "SEM_???"); - tprints("}"); - } - } - - if (i < max_count || max_count < count) - tprints(", ..."); - - tprintf("}, %lu", count); -} - -int sys_semop(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - if (indirect_ipccall(tcp)) { - tprint_sembuf(tcp, tcp->u_arg[3], tcp->u_arg[1]); - } else { - tprint_sembuf(tcp, tcp->u_arg[1], tcp->u_arg[2]); - } - } - return 0; -} - -int sys_semtimedop(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - if (indirect_ipccall(tcp)) { - tprint_sembuf(tcp, tcp->u_arg[3], tcp->u_arg[1]); - tprints(", "); -#if defined(S390) || defined(S390X) - printtv(tcp, tcp->u_arg[2]); -#else - printtv(tcp, tcp->u_arg[4]); -#endif - } else { - tprint_sembuf(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprints(", "); - printtv(tcp, tcp->u_arg[3]); - } - } - return 0; -} + unsigned int i; + for (i = 1; i < tcp->s_ent->nargs; ++i) + tprintf(", %#" PRI_klx, tcp->u_arg[i]); -int sys_semget(struct tcb *tcp) -{ - if (entering(tcp)) { - if (tcp->u_arg[0]) - tprintf("%#lx", tcp->u_arg[0]); - else - tprints("IPC_PRIVATE"); - tprintf(", %lu, ", tcp->u_arg[1]); - if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0) - tprints("|"); - tprintf("%#lo", tcp->u_arg[2] & 0777); - } - return 0; -} - -int sys_semctl(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???"); - tprintf(", %#lx", tcp->u_arg[3]); - } - return 0; -} - -int sys_shmget(struct tcb *tcp) -{ - if (entering(tcp)) { - if (tcp->u_arg[0]) - tprintf("%#lx", tcp->u_arg[0]); - else - tprints("IPC_PRIVATE"); - tprintf(", %lu, ", tcp->u_arg[1]); - if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0) - tprints("|"); - tprintf("%#lo", tcp->u_arg[2] & 0777); - } - return 0; -} - -int sys_shmctl(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???"); - if (indirect_ipccall(tcp)) { - tprintf(", %#lx", tcp->u_arg[3]); - } else { - tprintf(", %#lx", tcp->u_arg[2]); - } - } - return 0; -} - -int sys_shmat(struct tcb *tcp) -{ - if (exiting(tcp)) { - tprintf("%lu", tcp->u_arg[0]); - if (indirect_ipccall(tcp)) { - tprintf(", %#lx, ", tcp->u_arg[3]); - printflags(shm_flags, tcp->u_arg[1], "SHM_???"); - } else { - tprintf(", %#lx, ", tcp->u_arg[1]); - printflags(shm_flags, tcp->u_arg[2], "SHM_???"); - } - if (syserror(tcp)) - return 0; - if (indirect_ipccall(tcp)) { - unsigned long raddr; - if (umove(tcp, tcp->u_arg[2], &raddr) < 0) - return RVAL_NONE; - tcp->u_rval = raddr; - } - return RVAL_HEX; - } - return 0; -} - -int sys_shmdt(struct tcb *tcp) -{ - if (entering(tcp)) { - if (indirect_ipccall(tcp)) { - tprintf("%#lx", tcp->u_arg[3]); - } else { - tprintf("%#lx", tcp->u_arg[0]); - } - } - return 0; -} - -int -sys_mq_open(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - /* flags */ - tprint_open_modes(tcp->u_arg[1]); - if (tcp->u_arg[1] & O_CREAT) { -# ifndef HAVE_MQUEUE_H - tprintf(", %lx", tcp->u_arg[2]); -# else - struct mq_attr attr; - /* mode */ - tprintf(", %#lo, ", tcp->u_arg[2]); - if (umove(tcp, tcp->u_arg[3], &attr) < 0) - tprints("{???}"); - else - tprintf("{mq_maxmsg=%ld, mq_msgsize=%ld}", - (long) attr.mq_maxmsg, - (long) attr.mq_msgsize); -# endif - } - } - return 0; -} - -int -sys_mq_timedsend(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]); - printtv(tcp, tcp->u_arg[4]); - } - return 0; -} - -int -sys_mq_timedreceive(struct tcb *tcp) -{ - if (entering(tcp)) - tprintf("%ld, ", tcp->u_arg[0]); - else { - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]); - printtv(tcp, tcp->u_arg[4]); - } - return 0; -} - -int -sys_mq_notify(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - printsigevent(tcp, tcp->u_arg[1]); - } - return 0; -} - -static void -printmqattr(struct tcb *tcp, long addr) -{ - if (addr == 0) - tprints("NULL"); - else { -# ifndef HAVE_MQUEUE_H - tprintf("%#lx", addr); -# else - struct mq_attr attr; - if (umove(tcp, addr, &attr) < 0) { - tprints("{...}"); - return; - } - tprints("{mq_flags="); - tprint_open_modes(attr.mq_flags); - tprintf(", mq_maxmsg=%ld, mq_msgsize=%ld, mq_curmsg=%ld}", - (long) attr.mq_maxmsg, (long) attr.mq_msgsize, - (long) attr.mq_curmsgs); -# endif - } -} - -int -sys_mq_getsetattr(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - printmqattr(tcp, tcp->u_arg[1]); - tprints(", "); - } else - printmqattr(tcp, tcp->u_arg[2]); - return 0; -} - -int -sys_ipc(struct tcb *tcp) -{ - return printargs(tcp); + return RVAL_DECODED; } diff --git a/ipc_defs.h b/ipc_defs.h new file mode 100644 index 00000000..e0043ced --- /dev/null +++ b/ipc_defs.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2003 Roland McGrath + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_IPC_DEFS_H +#define STRACE_IPC_DEFS_H + +#ifdef HAVE_SYS_IPC_H +# include +#elif defined HAVE_LINUX_IPC_H +# include +/* While glibc uses __key, the kernel uses key. */ +# define __key key +#endif + +#if !defined IPC_64 +# define IPC_64 0x100 +#endif + +#define PRINTCTL(flagset, arg, dflt) \ + if ((arg) & IPC_64) tprints("IPC_64|"); \ + printxval((flagset), (arg) &~ IPC_64, dflt) + +#endif /* !STRACE_IPC_DEFS_H */ diff --git a/ipc_msg.c b/ipc_msg.c new file mode 100644 index 00000000..a5f9e83e --- /dev/null +++ b/ipc_msg.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 1993 Ulrich Pegelow + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2003-2006 Roland McGrath + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "ipc_defs.h" + +#ifdef HAVE_SYS_MSG_H +# include +#elif defined HAVE_LINUX_MSG_H +# include +#endif + +#include "xlat/ipc_msg_flags.h" +#include "xlat/resource_flags.h" + +SYS_FUNC(msgget) +{ + const int key = (int) tcp->u_arg[0]; + if (key) + tprintf("%#x", key); + else + tprints("IPC_PRIVATE"); + tprints(", "); + if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0) + tprints("|"); + print_numeric_umode_t(tcp->u_arg[1] & 0777); + return RVAL_DECODED; +} + +static void +tprint_msgsnd(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t count, const unsigned int flags) +{ + tprint_msgbuf(tcp, addr, count); + printflags(ipc_msg_flags, flags, "MSG_???"); +} + +SYS_FUNC(msgsnd) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + if (indirect_ipccall(tcp)) { + tprint_msgsnd(tcp, tcp->u_arg[3], tcp->u_arg[1], + tcp->u_arg[2]); + } else { + tprint_msgsnd(tcp, tcp->u_arg[1], tcp->u_arg[2], + tcp->u_arg[3]); + } + return RVAL_DECODED; +} + +static void +tprint_msgrcv(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t count, const kernel_ulong_t msgtyp) +{ + tprint_msgbuf(tcp, addr, count); + tprintf("%" PRI_kld ", ", msgtyp); +} + +static int +fetch_msgrcv_args(struct tcb *const tcp, const kernel_ulong_t addr, + kernel_ulong_t *const pair) +{ + if (current_wordsize == sizeof(*pair)) { + if (umoven_or_printaddr(tcp, addr, 2 * sizeof(*pair), pair)) + return -1; + } else { + unsigned int tmp[2]; + + if (umove_or_printaddr(tcp, addr, &tmp)) + return -1; + pair[0] = tmp[0]; + pair[1] = tmp[1]; + } + return 0; +} + +SYS_FUNC(msgrcv) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + } else { + if (indirect_ipccall(tcp)) { + const bool direct = +#ifdef SPARC64 + current_wordsize == 8 || +#endif + get_tcb_priv_ulong(tcp) != 0; + if (direct) { + tprint_msgrcv(tcp, tcp->u_arg[3], + tcp->u_arg[1], tcp->u_arg[4]); + } else { + kernel_ulong_t pair[2]; + + if (fetch_msgrcv_args(tcp, tcp->u_arg[3], pair)) + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + else + tprint_msgrcv(tcp, pair[0], + tcp->u_arg[1], pair[1]); + } + printflags(ipc_msg_flags, tcp->u_arg[2], "MSG_???"); + } else { + tprint_msgrcv(tcp, tcp->u_arg[1], + tcp->u_arg[2], tcp->u_arg[3]); + printflags(ipc_msg_flags, tcp->u_arg[4], "MSG_???"); + } + } + return 0; +} diff --git a/ipc_msgctl.c b/ipc_msgctl.c new file mode 100644 index 00000000..f289c301 --- /dev/null +++ b/ipc_msgctl.c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 1993 Ulrich Pegelow + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2003-2006 Roland McGrath + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(msqid_ds_t) + +#include "ipc_defs.h" + +#ifdef HAVE_SYS_MSG_H +/* The C library generally exports the struct the current kernel expects. */ +# include +typedef struct msqid_ds msqid_ds_t; +#elif defined HAVE_LINUX_MSG_H +/* The linux header might provide the right struct. */ +# include +typedef struct msqid64_ds msqid_ds_t; +#endif + +#include MPERS_DEFS + +#include "xlat/msgctl_flags.h" + +static void +print_msqid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) +{ + /* TODO: We don't properly decode old compat ipc calls. */ + if (cmd & IPC_64) + cmd &= ~IPC_64; + msqid_ds_t msqid_ds; + switch (cmd) { + case IPC_SET: + case IPC_STAT: + if (umove_or_printaddr(tcp, addr, &msqid_ds)) + return; + + tprints("{msg_perm={"); + printuid("uid=", msqid_ds.msg_perm.uid); + printuid(", gid=", msqid_ds.msg_perm.gid); + tprints(", mode="); + print_numeric_umode_t(msqid_ds.msg_perm.mode); + + if (cmd != IPC_STAT) { + tprints("}, ...}"); + break; + } + + tprintf(", key=%u", (unsigned) msqid_ds.msg_perm.__key); + printuid(", cuid=", msqid_ds.msg_perm.cuid); + printuid(", cgid=", msqid_ds.msg_perm.cgid); + tprints("}"); + tprintf(", msg_stime=%u", (unsigned) msqid_ds.msg_stime); + tprintf(", msg_rtime=%u", (unsigned) msqid_ds.msg_rtime); + tprintf(", msg_ctime=%u", (unsigned) msqid_ds.msg_ctime); + tprintf(", msg_qnum=%u", (unsigned) msqid_ds.msg_qnum); + tprintf(", msg_qbytes=%u", (unsigned) msqid_ds.msg_qbytes); + tprintf(", msg_lspid=%u", (unsigned) msqid_ds.msg_lspid); + tprintf(", msg_lrpid=%u", (unsigned) msqid_ds.msg_lrpid); + tprints("}"); + break; + + default: + printaddr(addr); + break; + } +} + +SYS_FUNC(msgctl) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???"); + tprints(", "); + } else { + const kernel_ulong_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; + print_msqid_ds(tcp, addr, tcp->u_arg[1]); + } + return 0; +} diff --git a/ipc_sem.c b/ipc_sem.c new file mode 100644 index 00000000..4a703783 --- /dev/null +++ b/ipc_sem.c @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1993 Ulrich Pegelow + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2003-2006 Roland McGrath + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "ipc_defs.h" + +#ifdef HAVE_SYS_SEM_H +# include +#elif defined HAVE_LINUX_SEM_H +# include +#endif + +#include "xlat/semctl_flags.h" +#include "xlat/semop_flags.h" + +#if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H +static bool +print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const struct sembuf *sb = elem_buf; + + tprintf("{%u, %d, ", sb->sem_num, sb->sem_op); + printflags(semop_flags, (unsigned short) sb->sem_flg, "SEM_???"); + tprints("}"); + + return true; +} +#endif + +static void +tprint_sembuf_array(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int count) +{ +#if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H + struct sembuf sb; + print_array(tcp, addr, count, &sb, sizeof(sb), + umoven_or_printaddr, print_sembuf, 0); +#else + printaddr(addr); +#endif + tprintf(", %u", count); +} + +SYS_FUNC(semop) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + if (indirect_ipccall(tcp)) { + tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]); + } else { + tprint_sembuf_array(tcp, tcp->u_arg[1], tcp->u_arg[2]); + } + return RVAL_DECODED; +} + +SYS_FUNC(semtimedop) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + if (indirect_ipccall(tcp)) { + tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]); + tprints(", "); +#if defined(S390) || defined(S390X) + print_timespec(tcp, tcp->u_arg[2]); +#else + print_timespec(tcp, tcp->u_arg[4]); +#endif + } else { + tprint_sembuf_array(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprints(", "); + print_timespec(tcp, tcp->u_arg[3]); + } + return RVAL_DECODED; +} + +SYS_FUNC(semget) +{ + const int key = (int) tcp->u_arg[0]; + if (key) + tprintf("%#x", key); + else + tprints("IPC_PRIVATE"); + tprintf(", %d, ", (int) tcp->u_arg[1]); + if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0) + tprints("|"); + print_numeric_umode_t(tcp->u_arg[2] & 0777); + return RVAL_DECODED; +} + +SYS_FUNC(semctl) +{ + tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]); + PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???"); + tprints(", "); + if (indirect_ipccall(tcp) +#ifdef SPARC64 + && current_personality != 0 +#endif + ) { + printnum_ptr(tcp, tcp->u_arg[3]); + } else { + printaddr(tcp->u_arg[3]); + } + return RVAL_DECODED; +} diff --git a/ipc_shm.c b/ipc_shm.c new file mode 100644 index 00000000..c4bdb87a --- /dev/null +++ b/ipc_shm.c @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1993 Ulrich Pegelow + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2003-2006 Roland McGrath + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_SYS_SHM_H +# include +#elif defined HAVE_LINUX_SHM_H +# include +#endif + +#include "xlat/shm_resource_flags.h" +#include "xlat/shm_flags.h" + +SYS_FUNC(shmget) +{ + const int key = (int) tcp->u_arg[0]; + if (key) + tprintf("%#x", key); + else + tprints("IPC_PRIVATE"); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0) + tprints("|"); + print_numeric_umode_t(tcp->u_arg[2] & 0777); + return RVAL_DECODED; +} + +SYS_FUNC(shmat) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + if (indirect_ipccall(tcp)) { + printaddr(tcp->u_arg[3]); + tprints(", "); + printflags(shm_flags, tcp->u_arg[1], "SHM_???"); + } else { + printaddr(tcp->u_arg[1]); + tprints(", "); + printflags(shm_flags, tcp->u_arg[2], "SHM_???"); + } + return 0; + } else { + if (syserror(tcp)) + return 0; + if (indirect_ipccall(tcp)) { + union { + uint64_t r64; + uint32_t r32; + } u; + if (umoven(tcp, tcp->u_arg[2], current_wordsize, &u) < 0) + return RVAL_NONE; + tcp->u_rval = (sizeof(u.r32) == current_wordsize) + ? u.r32 : u.r64; + } + return RVAL_HEX; + } +} + +SYS_FUNC(shmdt) +{ + printaddr(tcp->u_arg[indirect_ipccall(tcp) ? 3 : 0]); + return RVAL_DECODED; +} diff --git a/ipc_shmctl.c b/ipc_shmctl.c new file mode 100644 index 00000000..ff76af8c --- /dev/null +++ b/ipc_shmctl.c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 1993 Ulrich Pegelow + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2003-2006 Roland McGrath + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(shmid_ds_t) + +#include "ipc_defs.h" + +#ifdef HAVE_SYS_SHM_H +/* The C library generally exports the struct the current kernel expects. */ +# include +typedef struct shmid_ds shmid_ds_t; +#elif defined HAVE_LINUX_SHM_H +/* The linux header might provide the right struct. */ +# include +typedef struct shmid64_ds shmid_ds_t; +#endif + +#include MPERS_DEFS + +#include "xlat/shmctl_flags.h" + +static void +print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) +{ + /* TODO: We don't properly decode old compat ipc calls. */ + if (cmd & IPC_64) + cmd &= ~IPC_64; + shmid_ds_t shmid_ds; + switch (cmd) { + case IPC_SET: + case IPC_STAT: + if (umove_or_printaddr(tcp, addr, &shmid_ds)) + return; + + tprints("{shm_perm={"); + printuid("uid=", shmid_ds.shm_perm.uid); + printuid(", gid=", shmid_ds.shm_perm.gid); + tprints(", mode="); + print_numeric_umode_t(shmid_ds.shm_perm.mode); + + if (cmd != IPC_STAT) { + tprints("}, ...}"); + break; + } + + tprintf(", key=%u", (unsigned) shmid_ds.shm_perm.__key); + printuid(", cuid=", shmid_ds.shm_perm.cuid); + printuid(", cgid=", shmid_ds.shm_perm.cgid); + tprints("}"); + tprintf(", shm_segsz=%u", (unsigned) shmid_ds.shm_segsz); + tprintf(", shm_cpid=%u", (unsigned) shmid_ds.shm_cpid); + tprintf(", shm_lpid=%u", (unsigned) shmid_ds.shm_lpid); + tprintf(", shm_nattch=%u", (unsigned) shmid_ds.shm_nattch); + tprintf(", shm_atime=%u", (unsigned) shmid_ds.shm_atime); + tprintf(", shm_dtime=%u", (unsigned) shmid_ds.shm_dtime); + tprintf(", shm_ctime=%u", (unsigned) shmid_ds.shm_ctime); + tprints("}"); + break; + + default: + printaddr(addr); + break; + } +} + +SYS_FUNC(shmctl) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???"); + tprints(", "); + } else { + const kernel_ulong_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; + print_shmid_ds(tcp, addr, tcp->u_arg[1]); + } + return 0; +} diff --git a/kcmp.c b/kcmp.c new file mode 100644 index 00000000..97795e63 --- /dev/null +++ b/kcmp.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "xlat/kcmp_types.h" + +SYS_FUNC(kcmp) +{ + pid_t pid1 = tcp->u_arg[0]; + pid_t pid2 = tcp->u_arg[1]; + int type = tcp->u_arg[2]; + kernel_ulong_t idx1 = tcp->u_arg[3]; + kernel_ulong_t idx2 = tcp->u_arg[4]; + + tprintf("%d, %d, ", pid1, pid2); + printxval(kcmp_types, type, "KCMP_???"); + + switch(type) { + case KCMP_FILE: + tprintf(", %u, %u", (unsigned) idx1, (unsigned) idx2); + break; + case KCMP_FILES: + case KCMP_FS: + case KCMP_IO: + case KCMP_SIGHAND: + case KCMP_SYSVSEM: + case KCMP_VM: + break; + default: + tprintf(", %#" PRI_klx ", %#" PRI_klx, idx1, idx2); + } + + return RVAL_DECODED; +} diff --git a/kernel_types.h b/kernel_types.h new file mode 100644 index 00000000..5a276135 --- /dev/null +++ b/kernel_types.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_KERNEL_TYPES_H +#define STRACE_KERNEL_TYPES_H + +# if defined HAVE___KERNEL_LONG_T && defined HAVE___KERNEL_ULONG_T + +# include + +typedef __kernel_long_t kernel_long_t; +typedef __kernel_ulong_t kernel_ulong_t; + +# elif (defined __x86_64__ && defined __ILP32__) || defined LINUX_MIPSN32 + +typedef long long kernel_long_t; +typedef unsigned long long kernel_ulong_t; + +# else + +typedef long kernel_long_t; +typedef unsigned long kernel_ulong_t; + +# endif + +typedef struct { + kernel_ulong_t d_ino; + kernel_ulong_t d_off; + unsigned short d_reclen; + char d_name[1]; +} kernel_dirent; + +#endif /* !STRACE_KERNEL_TYPES_H */ diff --git a/kexec.c b/kexec.c index f95bea2d..44d5bd18 100644 --- a/kexec.c +++ b/kexec.c @@ -1,90 +1,122 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "defs.h" -#include +#include "xlat/kexec_load_flags.h" #include "xlat/kexec_arch_values.h" -#include "xlat/kexec_flags.h" -static void -print_kexec_segments(struct tcb *tcp, unsigned long addr, unsigned long len) -{ -#if SUPPORTED_PERSONALITIES > 1 - union { - struct { u_int32_t buf, bufsz, mem, memsz; } seg32; - struct { u_int64_t buf, bufsz, mem, memsz; } seg64; - } seg; -# define sizeof_seg \ - (current_wordsize == 4 ? sizeof(seg.seg32) : sizeof(seg.seg64)) -# define seg_buf \ - (current_wordsize == 4 ? (uint64_t) seg.seg32.buf : seg.seg64.buf) -# define seg_bufsz \ - (current_wordsize == 4 ? (uint64_t) seg.seg32.bufsz : seg.seg64.bufsz) -# define seg_mem \ - (current_wordsize == 4 ? (uint64_t) seg.seg32.mem : seg.seg64.mem) -# define seg_memsz \ - (current_wordsize == 4 ? (uint64_t) seg.seg32.memsz : seg.seg64.memsz) -#else - struct kexec_segment seg; -# define sizeof_seg sizeof(seg) -# define seg_buf seg.buf -# define seg_bufsz seg.bufsz -# define seg_mem seg.mem -# define seg_memsz seg.memsz +#ifndef KEXEC_ARCH_MASK +# define KEXEC_ARCH_MASK 0xffff0000 +#endif +#ifndef KEXEC_SEGMENT_MAX +# define KEXEC_SEGMENT_MAX 16 #endif - unsigned int i, failed; - if (!len) { - tprints("[]"); - return; +static bool +print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const kernel_ulong_t *seg; + kernel_ulong_t seg_buf[4]; + + if (elem_size < sizeof(seg_buf)) { + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(seg_buf); ++i) + seg_buf[i] = ((unsigned int *) elem_buf)[i]; + seg = seg_buf; + } else { + seg = elem_buf; } + tprints("{buf="); + printaddr(seg[0]); + tprintf(", bufsz=%" PRI_klu ", mem=", seg[1]); + printaddr(seg[2]); + tprintf(", memsz=%" PRI_klu "}", seg[3]); + + return true; +} + +static void +print_kexec_segments(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len) +{ if (len > KEXEC_SEGMENT_MAX) { - tprintf("%#lx", addr); + printaddr(addr); return; } - failed = 0; - tprints("["); - for (i = 0; i < len; ++i) { - if (i) - tprints(", "); - if (umoven(tcp, addr + i * sizeof_seg, sizeof_seg, - (char *) &seg) < 0) { - tprints("?"); - failed = 1; - break; - } - tprintf("{%#lx, %lu, %#lx, %lu}", - (long) seg_buf, (unsigned long) seg_bufsz, - (long) seg_mem, (unsigned long) seg_memsz); - } - tprints("]"); - if (failed) - tprintf(" %#lx", addr); + kernel_ulong_t seg[4]; + const size_t sizeof_seg = ARRAY_SIZE(seg) * current_wordsize; + + print_array(tcp, addr, len, seg, sizeof_seg, + umoven_or_printaddr, print_seg, 0); } -int -sys_kexec_load(struct tcb *tcp) +SYS_FUNC(kexec_load) { - unsigned long n; - - if (exiting(tcp)) - return 0; - /* entry, nr_segments */ - tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); /* segments */ print_kexec_segments(tcp, tcp->u_arg[2], tcp->u_arg[1]); tprints(", "); /* flags */ - n = tcp->u_arg[3]; - printxval(kexec_arch_values, n & KEXEC_ARCH_MASK, "KEXEC_ARCH_???"); - n &= ~KEXEC_ARCH_MASK; + kernel_ulong_t n = tcp->u_arg[3]; + printxval64(kexec_arch_values, n & KEXEC_ARCH_MASK, "KEXEC_ARCH_???"); + n &= ~(kernel_ulong_t) KEXEC_ARCH_MASK; if (n) { tprints("|"); - printflags(kexec_flags, n, "KEXEC_???"); + printflags64(kexec_load_flags, n, "KEXEC_???"); } - return 0; + return RVAL_DECODED; +} + +#include "xlat/kexec_file_load_flags.h" + +SYS_FUNC(kexec_file_load) +{ + /* kernel_fd */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + /* initrd_fd */ + printfd(tcp, tcp->u_arg[1]); + tprints(", "); + /* cmdline_len */ + tprintf("%" PRI_klu ", ", tcp->u_arg[2]); + /* cmdline */ + printstrn(tcp, tcp->u_arg[3], tcp->u_arg[2]); + tprints(", "); + /* flags */ + printflags64(kexec_file_load_flags, tcp->u_arg[4], "KEXEC_FILE_???"); + + return RVAL_DECODED; } diff --git a/keyctl.c b/keyctl.c index a12bd54c..c270221f 100644 --- a/keyctl.c +++ b/keyctl.c @@ -1,14 +1,46 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "defs.h" -#include typedef int32_t key_serial_t; #include "xlat/key_spec.h" +struct keyctl_dh_params { + int32_t private; + int32_t prime; + int32_t base; +}; + static void print_keyring_serial_number(key_serial_t id) { - const char *str = xlookup(key_spec, id); + const char *str = xlookup(key_spec, (unsigned int) id); if (str) tprints(str); @@ -16,364 +48,326 @@ print_keyring_serial_number(key_serial_t id) tprintf("%d", id); } -int -sys_add_key(struct tcb *tcp) +SYS_FUNC(add_key) { - if (entering(tcp)) { - /* type */ - printstr(tcp, tcp->u_arg[0], -1); - /* description */ - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - /* payload */ - tprints(", "); - printstr(tcp, tcp->u_arg[2], tcp->u_arg[3]); - /* payload length */ - tprintf(", %lu, ", tcp->u_arg[3]); - /* keyring serial number */ - print_keyring_serial_number(tcp->u_arg[4]); - } - return 0; + /* type */ + printstr(tcp, tcp->u_arg[0]); + /* description */ + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + /* payload */ + tprints(", "); + printstrn(tcp, tcp->u_arg[2], tcp->u_arg[3]); + /* payload length */ + tprintf(", %" PRI_klu ", ", tcp->u_arg[3]); + /* keyring serial number */ + print_keyring_serial_number(tcp->u_arg[4]); + + return RVAL_DECODED; } -int -sys_request_key(struct tcb *tcp) +SYS_FUNC(request_key) { - if (entering(tcp)) { - /* type */ - printstr(tcp, tcp->u_arg[0], -1); - /* description */ - tprints(", "); - printstr(tcp, tcp->u_arg[1], -1); - /* callout_info */ - tprints(", "); - printstr(tcp, tcp->u_arg[2], -1); - /* keyring serial number */ - tprints(", "); - print_keyring_serial_number(tcp->u_arg[3]); - } - return 0; + /* type */ + printstr(tcp, tcp->u_arg[0]); + /* description */ + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + /* callout_info */ + tprints(", "); + printstr(tcp, tcp->u_arg[2]); + /* keyring serial number */ + tprints(", "); + print_keyring_serial_number(tcp->u_arg[3]); + + return RVAL_DECODED; } -static int +static void keyctl_get_keyring_id(struct tcb *tcp, key_serial_t id, int create) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id); - tprintf(", %d", create); - } - return 0; -} - -static int -keyctl_join_session_keyring(struct tcb *tcp, long addr) -{ - if (entering(tcp)) { - tprints(", "); - printstr(tcp, addr, -1); - } - return 0; -} - -static int -keyctl_update_key(struct tcb *tcp, key_serial_t id, long addr, long len) -{ - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id); - tprints(", "); - printstr(tcp, addr, len); - tprintf(", %lu", len); - } - return 0; + print_keyring_serial_number(id); + tprintf(", %d", create); } -static int -keyctl_handle_key(struct tcb *tcp, key_serial_t id) +static void +keyctl_update_key(struct tcb *tcp, key_serial_t id, kernel_ulong_t addr, + kernel_ulong_t len) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id); - } - return 0; + print_keyring_serial_number(id); + tprints(", "); + printstrn(tcp, addr, len); + tprintf(", %llu", zero_extend_signed_to_ull(len)); } -static int +static void keyctl_handle_key_key(struct tcb *tcp, key_serial_t id1, key_serial_t id2) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id1); - tprints(", "); - print_keyring_serial_number(id2); - } - return 0; + print_keyring_serial_number(id1); + tprints(", "); + print_keyring_serial_number(id2); } -static int -keyctl_read_key(struct tcb *tcp, key_serial_t id, long addr, long len) +static void +keyctl_read_key(struct tcb *tcp, key_serial_t id, kernel_ulong_t addr, + kernel_ulong_t len, bool has_nul) { if (entering(tcp)) { - tprints(", "); print_keyring_serial_number(id); tprints(", "); } else { - if (addr && syserror(tcp)) - tprintf("%#lx", addr); + if (syserror(tcp)) + printaddr(addr); else { - long rval = tcp->u_rval > len ? - len : (tcp->u_rval ? -1 : 0); - printstr(tcp, addr, rval); + kernel_ulong_t rval = (tcp->u_rval >= 0) && + ((kernel_ulong_t) tcp->u_rval > len) ? len : + (kernel_ulong_t) tcp->u_rval; + printstr_ex(tcp, addr, rval, has_nul ? + QUOTE_OMIT_TRAILING_0 : 0); } - tprintf(", %lu", len); + tprintf(", %llu", zero_extend_signed_to_ull(len)); } - return 0; } -static int -keyctl_keyring_search(struct tcb *tcp, key_serial_t id1, long addr1, - long addr2, key_serial_t id2) +static void +keyctl_keyring_search(struct tcb *tcp, key_serial_t id1, kernel_ulong_t addr1, + kernel_ulong_t addr2, key_serial_t id2) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id1); - tprints(", "); - printstr(tcp, addr1, -1); - tprints(", "); - printstr(tcp, addr2, -1); - tprints(", "); - print_keyring_serial_number(id2); - } - return 0; + print_keyring_serial_number(id1); + tprints(", "); + printstr(tcp, addr1); + tprints(", "); + printstr(tcp, addr2); + tprints(", "); + print_keyring_serial_number(id2); } -static int -keyctl_chown_key(struct tcb *tcp, key_serial_t id, int user, int group) +static void +keyctl_chown_key(struct tcb *tcp, key_serial_t id, unsigned user, + unsigned group) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id); - tprintf(", %d, %d", user, group); - } - return 0; + print_keyring_serial_number(id); + printuid(", ", user); + printuid(", ", group); } -static int -keyctl_instantiate_key(struct tcb *tcp, key_serial_t id1, long addr, - long len, key_serial_t id2) +static void +keyctl_instantiate_key(struct tcb *tcp, key_serial_t id1, kernel_ulong_t addr, + kernel_ulong_t len, key_serial_t id2) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id1); - tprints(", "); - printstr(tcp, addr, len); - tprintf(", %lu, ", len); - print_keyring_serial_number(id2); - } - return 0; + print_keyring_serial_number(id1); + tprints(", "); + printstrn(tcp, addr, len); + tprintf(", %llu, ", zero_extend_signed_to_ull(len)); + print_keyring_serial_number(id2); } -static int +static void keyctl_instantiate_key_iov(struct tcb *tcp, key_serial_t id1, - long addr, long len, key_serial_t id2) + kernel_ulong_t addr, kernel_ulong_t len, + key_serial_t id2) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id1); - tprints(", "); - tprint_iov(tcp, len, addr, 1); - tprintf(", %lu, ", len); - print_keyring_serial_number(id2); - } - return 0; + print_keyring_serial_number(id1); + tprints(", "); + tprint_iov(tcp, len, addr, IOV_DECODE_STR); + tprintf(", %llu, ", zero_extend_signed_to_ull(len)); + print_keyring_serial_number(id2); } -static int +static void keyctl_negate_key(struct tcb *tcp, key_serial_t id1, unsigned timeout, key_serial_t id2) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id1); - tprintf(", %u, ", timeout); - print_keyring_serial_number(id2); - } - return 0; + print_keyring_serial_number(id1); + tprintf(", %u, ", timeout); + print_keyring_serial_number(id2); } -static int +static void keyctl_reject_key(struct tcb *tcp, key_serial_t id1, unsigned timeout, unsigned error, key_serial_t id2) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id1); - tprintf(", %u, %u, ", timeout, error); - print_keyring_serial_number(id2); - } - return 0; + const char *err_str = err_name(error); + + print_keyring_serial_number(id1); + tprintf(", %u, ", timeout); + + if (err_str) + tprintf("%s, ", err_str); + else + tprintf("%u, ", error); + + print_keyring_serial_number(id2); } -static int +static void keyctl_set_timeout(struct tcb *tcp, key_serial_t id, unsigned timeout) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id); - tprintf(", %u", timeout); - } - return 0; + print_keyring_serial_number(id); + tprintf(", %u", timeout); } -static int -keyctl_get_persistent(struct tcb *tcp, int uid, key_serial_t id) +static void +keyctl_get_persistent(struct tcb *tcp, unsigned uid, key_serial_t id) { - if (entering(tcp)) { - tprintf(", %d, ", uid); - print_keyring_serial_number(id); - } - return 0; + printuid("", uid); + tprints(", "); + print_keyring_serial_number(id); } -#define KEY_POS_VIEW 0x01000000 -#define KEY_POS_READ 0x02000000 -#define KEY_POS_WRITE 0x04000000 -#define KEY_POS_SEARCH 0x08000000 -#define KEY_POS_LINK 0x10000000 -#define KEY_POS_SETATTR 0x20000000 -#define KEY_POS_ALL 0x3f000000 -#define KEY_USR_VIEW 0x00010000 -#define KEY_USR_READ 0x00020000 -#define KEY_USR_WRITE 0x00040000 -#define KEY_USR_SEARCH 0x00080000 -#define KEY_USR_LINK 0x00100000 -#define KEY_USR_SETATTR 0x00200000 -#define KEY_USR_ALL 0x003f0000 -#define KEY_GRP_VIEW 0x00000100 -#define KEY_GRP_READ 0x00000200 -#define KEY_GRP_WRITE 0x00000400 -#define KEY_GRP_SEARCH 0x00000800 -#define KEY_GRP_LINK 0x00001000 -#define KEY_GRP_SETATTR 0x00002000 -#define KEY_GRP_ALL 0x00003f00 -#define KEY_OTH_VIEW 0x00000001 -#define KEY_OTH_READ 0x00000002 -#define KEY_OTH_WRITE 0x00000004 -#define KEY_OTH_SEARCH 0x00000008 -#define KEY_OTH_LINK 0x00000010 -#define KEY_OTH_SETATTR 0x00000020 -#define KEY_OTH_ALL 0x0000003f - #include "xlat/key_perms.h" -static int +static void keyctl_setperm_key(struct tcb *tcp, key_serial_t id, uint32_t perm) { - if (entering(tcp)) { - tprints(", "); - print_keyring_serial_number(id); - tprints(", "); - printflags(key_perms, perm, "KEY_???"); - } - return 0; + print_keyring_serial_number(id); + tprints(", "); + printflags(key_perms, perm, "KEY_???"); } -#include "xlat/key_reqkeys.h" +static void +print_dh_params(struct tcb *tcp, kernel_ulong_t addr) +{ + struct keyctl_dh_params params; + + if (umove_or_printaddr(tcp, addr, ¶ms)) + return; + + tprints("{private="); + print_keyring_serial_number(params.private); + tprints(", prime="); + print_keyring_serial_number(params.prime); + tprints(", base="); + print_keyring_serial_number(params.base); + tprints("}"); +} -static int -keyctl_set_reqkey_keyring(struct tcb *tcp, int reqkey) +static void +keyctl_dh_compute(struct tcb *tcp, kernel_ulong_t params, kernel_ulong_t buf, + kernel_ulong_t len) { if (entering(tcp)) { + print_dh_params(tcp, params); tprints(", "); - printxval(key_reqkeys, reqkey, "KEY_REQKEY_DEFL_???"); + } else { + if (syserror(tcp)) { + printaddr(buf); + } else { + kernel_ulong_t rval = (tcp->u_rval >= 0) && + ((kernel_ulong_t) tcp->u_rval > len) ? len : + (kernel_ulong_t) tcp->u_rval; + printstrn(tcp, buf, rval); + } + tprintf(", %llu", zero_extend_signed_to_ull(len)); } - return 0; } +#include "xlat/key_reqkeys.h" #include "xlat/keyctl_commands.h" -int -sys_keyctl(struct tcb *tcp) +SYS_FUNC(keyctl) { int cmd = tcp->u_arg[0]; + kernel_ulong_t arg2 = tcp->u_arg[1]; + kernel_ulong_t arg3 = tcp->u_arg[2]; + kernel_ulong_t arg4 = tcp->u_arg[3]; + kernel_ulong_t arg5 = tcp->u_arg[4]; - if (entering(tcp)) + if (entering(tcp)) { printxval(keyctl_commands, cmd, "KEYCTL_???"); + /* + * For now, KEYCTL_SESSION_TO_PARENT is the only cmd without + * arguments. + */ + if (cmd != KEYCTL_SESSION_TO_PARENT) + tprints(", "); + } + switch (cmd) { case KEYCTL_GET_KEYRING_ID: - return keyctl_get_keyring_id(tcp, tcp->u_arg[1], tcp->u_arg[2]); + keyctl_get_keyring_id(tcp, arg2, arg3); + break; case KEYCTL_JOIN_SESSION_KEYRING: - return keyctl_join_session_keyring(tcp, tcp->u_arg[1]); + printstr(tcp, arg2); + break; case KEYCTL_UPDATE: - return keyctl_update_key(tcp, tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3]); + keyctl_update_key(tcp, arg2, arg3, arg4); + break; case KEYCTL_REVOKE: case KEYCTL_CLEAR: case KEYCTL_INVALIDATE: case KEYCTL_ASSUME_AUTHORITY: - return keyctl_handle_key(tcp, tcp->u_arg[1]); + print_keyring_serial_number(arg2); + break; case KEYCTL_LINK: case KEYCTL_UNLINK: - return keyctl_handle_key_key(tcp, tcp->u_arg[1], tcp->u_arg[2]); + keyctl_handle_key_key(tcp, arg2, arg3); + break; case KEYCTL_DESCRIBE: case KEYCTL_READ: case KEYCTL_GET_SECURITY: - return keyctl_read_key(tcp, tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3]); + keyctl_read_key(tcp, arg2, arg3, arg4, cmd != KEYCTL_READ); + return 0; case KEYCTL_SEARCH: - return keyctl_keyring_search(tcp, tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3], tcp->u_arg[4]); + keyctl_keyring_search(tcp, arg2, arg3, arg4, arg5); + break; case KEYCTL_CHOWN: - return keyctl_chown_key(tcp, tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3]); + keyctl_chown_key(tcp, arg2, arg3, arg4); + break; case KEYCTL_SETPERM: - return keyctl_setperm_key(tcp, tcp->u_arg[1], tcp->u_arg[2]); + keyctl_setperm_key(tcp, arg2, arg3); + break; case KEYCTL_INSTANTIATE: - return keyctl_instantiate_key(tcp, tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3], tcp->u_arg[4]); + keyctl_instantiate_key(tcp, arg2, arg3, arg4, arg5); + break; case KEYCTL_NEGATE: - return keyctl_negate_key(tcp, tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3]); + keyctl_negate_key(tcp, arg2, arg3, arg4); + break; case KEYCTL_SET_REQKEY_KEYRING: - return keyctl_set_reqkey_keyring(tcp, tcp->u_arg[1]); + printxval(key_reqkeys, arg2, "KEY_REQKEY_DEFL_???"); + break; case KEYCTL_SET_TIMEOUT: - return keyctl_set_timeout(tcp, tcp->u_arg[1], tcp->u_arg[2]); + keyctl_set_timeout(tcp, arg2, arg3); + break; case KEYCTL_SESSION_TO_PARENT: - return 0; + break; case KEYCTL_REJECT: - return keyctl_reject_key(tcp, tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3], tcp->u_arg[4]); + keyctl_reject_key(tcp, arg2, arg3, arg4, arg5); + break; case KEYCTL_INSTANTIATE_IOV: - return keyctl_instantiate_key_iov(tcp, tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3], - tcp->u_arg[4]); + keyctl_instantiate_key_iov(tcp, arg2, arg3, arg4, arg5); + break; case KEYCTL_GET_PERSISTENT: - return keyctl_get_persistent(tcp, tcp->u_arg[1], tcp->u_arg[2]); + keyctl_get_persistent(tcp, arg2, arg3); + break; + + case KEYCTL_DH_COMPUTE: + keyctl_dh_compute(tcp, arg2, arg3, arg4); + return 0; default: - if (entering(tcp)) - tprintf(", %#lx, %#lx, %#lx, %#lx", - tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3], tcp->u_arg[4]); + tprintf("%#" PRI_klx ", %#" PRI_klx + ", %#" PRI_klx ", %#" PRI_klx, + arg2, arg3, arg4, arg5); + break; } - return 0; + return RVAL_DECODED; } diff --git a/ldt.c b/ldt.c index 0376d2b7..91bdf15d 100644 --- a/ldt.c +++ b/ldt.c @@ -1,23 +1,49 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2002-2004 Roland McGrath + * Copyright (c) 2010 Andreas Schwab + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "defs.h" -#if defined I386 || defined X86_64 || defined X32 +#ifdef HAVE_STRUCT_USER_DESC # include void -print_user_desc(struct tcb *tcp, long addr) +print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr) { struct user_desc desc; - if (umove(tcp, addr, &desc) < 0) { - tprintf("%lx", addr); - return; - } - - if (!verbose(tcp)) { - tprintf("{entry_number:%d, ...}", desc.entry_number); + if (umove_or_printaddr(tcp, addr, &desc)) return; - } tprintf("{entry_number:%d, " "base_addr:%#08x, " @@ -39,31 +65,27 @@ print_user_desc(struct tcb *tcp, long addr) desc.useable); } -int -sys_modify_ldt(struct tcb *tcp) +SYS_FUNC(modify_ldt) { - if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); - if (tcp->u_arg[1] == 0 - || tcp->u_arg[2] != sizeof(struct user_desc)) { - tprintf("%lx", tcp->u_arg[1]); - } else { - print_user_desc(tcp, tcp->u_arg[1]); - } - tprintf(", %lu", tcp->u_arg[2]); - } - return 0; + tprintf("%" PRI_kld ", ", tcp->u_arg[0]); + if (tcp->u_arg[2] != sizeof(struct user_desc)) + printaddr(tcp->u_arg[1]); + else + print_user_desc(tcp, tcp->u_arg[1]); + tprintf(", %" PRI_klu, tcp->u_arg[2]); + + return RVAL_DECODED; } -int -sys_set_thread_area(struct tcb *tcp) +SYS_FUNC(set_thread_area) { if (entering(tcp)) { print_user_desc(tcp, tcp->u_arg[0]); } else { struct user_desc desc; - if (syserror(tcp) || umove(tcp, tcp->u_arg[0], &desc) < 0) { + if (!verbose(tcp) || syserror(tcp) || + umove(tcp, tcp->u_arg[0], &desc) < 0) { /* returned entry_number is not available */ } else { static char outstr[32]; @@ -76,35 +98,28 @@ sys_set_thread_area(struct tcb *tcp) return 0; } -int -sys_get_thread_area(struct tcb *tcp) +SYS_FUNC(get_thread_area) { - if (exiting(tcp)) { - if (syserror(tcp)) - tprintf("%lx", tcp->u_arg[0]); - else - print_user_desc(tcp, tcp->u_arg[0]); - } + if (exiting(tcp)) + print_user_desc(tcp, tcp->u_arg[0]); return 0; } -#endif /* I386 || X86_64 || X32 */ +#endif /* HAVE_STRUCT_USER_DESC */ #if defined(M68K) || defined(MIPS) -int -sys_set_thread_area(struct tcb *tcp) +SYS_FUNC(set_thread_area) { - if (entering(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - return 0; + printaddr(tcp->u_arg[0]); + + return RVAL_DECODED; } #endif #if defined(M68K) -int -sys_get_thread_area(struct tcb *tcp) +SYS_FUNC(get_thread_area) { - return RVAL_HEX; + return RVAL_DECODED | RVAL_HEX; } #endif diff --git a/link.c b/link.c new file mode 100644 index 00000000..68a13044 --- /dev/null +++ b/link.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2006 Ulrich Drepper + * Copyright (c) 2006 Bernhard Kaindl + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +#include "xlat/at_flags.h" + +SYS_FUNC(link) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + printpath(tcp, tcp->u_arg[1]); + + return RVAL_DECODED; +} + +SYS_FUNC(linkat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + print_dirfd(tcp, tcp->u_arg[2]); + printpath(tcp, tcp->u_arg[3]); + tprints(", "); + printflags(at_flags, tcp->u_arg[4], "AT_???"); + + return RVAL_DECODED; +} + +SYS_FUNC(unlinkat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + printflags(at_flags, tcp->u_arg[2], "AT_???"); + + return RVAL_DECODED; +} + +SYS_FUNC(symlinkat) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + print_dirfd(tcp, tcp->u_arg[1]); + printpath(tcp, tcp->u_arg[2]); + + return RVAL_DECODED; +} diff --git a/linux/32/ioctls_inc.h b/linux/32/ioctls_inc.h new file mode 100644 index 00000000..27ae3f5c --- /dev/null +++ b/linux/32/ioctls_inc.h @@ -0,0 +1,8 @@ +#if defined M68K +# include "32/ioctls_inc_align16.h" +#elif defined X86_64 || defined X32 \ + || SIZEOF_STRUCT_I64_I32 < SIZEOF_LONG_LONG * 2 +# include "32/ioctls_inc_align32.h" +#else +# include "32/ioctls_inc_align64.h" +#endif diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h new file mode 100644 index 00000000..71c9d187 --- /dev/null +++ b/linux/32/ioctls_inc_align16.h @@ -0,0 +1,2729 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */ +{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 }, +{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 }, +{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 }, +{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 }, +{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 }, +{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 }, +{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 }, +{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 }, +{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 }, +{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 }, +{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 }, +{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 }, +{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 }, +{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 }, +{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 }, +{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 }, +{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 }, +{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 }, +{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 }, +{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 }, +{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 }, +{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 }, +{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c }, +{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x64 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1a }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x1c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 }, +{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 }, +{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c }, +{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 }, +{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 }, +{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 }, +{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 }, +{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 }, +{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 }, +{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 }, +{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, +{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, +{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, +{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, +{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, +{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 }, +{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 }, +{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 }, +{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 }, +{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 }, +{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x14 }, +{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 }, +{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 }, +{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 }, +{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 }, +{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 }, +{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 }, +{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 }, +{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 }, +{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 }, +{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 }, +{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, +{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, +{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, +{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c }, +{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 }, +{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 }, +{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 }, +{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 }, +{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c }, +{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 }, +{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 }, +{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 }, +{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 }, +{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c }, +{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 }, +{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 }, +{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c }, +{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c }, +{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 }, +{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c }, +{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c }, +{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c }, +{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 }, +{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c }, +{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c }, +{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c }, +{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 }, +{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c }, +{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c }, +{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 }, +{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c }, +{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c }, +{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 }, +{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 }, +{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, +{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, +{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, +{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa22 }, +{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x44 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc0 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 }, +{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 }, +{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 }, +{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 }, +{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 }, +{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 }, +{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 }, +{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 }, +{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 }, +{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 }, +{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 }, +{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 }, +{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 }, +{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c }, +{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 }, +{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c }, +{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 }, +{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x52 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 }, +{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 }, +{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 }, +{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 }, +{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 }, +{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 }, +{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 }, +{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 }, +{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 }, +{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 }, +{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 }, +{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 }, +{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 }, +{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 }, +{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 }, +{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 }, +{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 }, +{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 }, +{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 }, +{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 }, +{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 }, +{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 }, +{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 }, +{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 }, +{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 }, +{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 }, +{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 }, +{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 }, +{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 }, +{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 }, +{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 }, +{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 }, +{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 }, +{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 }, +{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 }, +{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 }, +{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 }, +{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 }, +{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 }, +{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 }, +{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c }, +{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 }, +{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 }, +{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 }, +{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 }, +{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 }, +{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 }, +{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 }, +{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c }, +{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c }, +{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 }, +{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 }, +{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 }, +{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 }, +{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 }, +{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c }, +{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 }, +{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, +{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 }, +{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 }, +{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 }, +{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 }, +{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dn.h", "SIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "SIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, +{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, +{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, +{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 }, +{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 }, +{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 }, +{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c }, +{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c }, +{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, +{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, +{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, +{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, +{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3a }, +{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x12 }, +{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, +{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0a }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 }, +{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 }, +{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 }, +{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 }, +{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 }, +{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 }, +{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 }, +{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 }, +{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 }, +{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 }, +{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 }, +{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 }, +{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c }, +{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 }, +{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, +{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, +{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, +{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 }, +{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 }, +{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 }, +{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 }, +{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 }, +{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 }, +{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 }, +{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 }, +{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 }, +{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 }, +{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 }, +{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 }, +{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 }, +{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 }, +{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 }, +{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 }, +{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x44 }, +{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 }, +{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 }, +{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 }, +{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c }, +{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 }, +{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 }, +{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 }, +{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 }, +{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c }, +{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x52 }, +{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 }, +{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 }, +{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x1c }, +{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 }, +{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c }, +{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 }, +{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 }, +{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 }, +{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 }, +{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 }, +{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x52 }, +{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 }, +{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 }, +{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c }, +{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 }, +{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 }, +{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x1c }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x0c }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x14 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x24 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x24 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x14 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x24 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x14 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, +{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, +{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, +{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 }, +{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 }, +{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 }, +{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 }, +{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 }, +{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 }, +{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 }, +{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 }, +{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 }, +{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 }, +{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 }, +{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 }, +{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 }, +{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 }, +{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 }, +{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 }, +{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 }, +{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 }, +{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x3e }, +{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 }, +{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 }, +{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 }, +{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 }, +{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 }, +{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 }, +{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 }, +{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 }, +{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 }, +{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 }, +{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, +{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, +{ "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, +{ "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0a }, +{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 }, +{ "linux/gigaset_dev.h", "GIGASET_BRKCHARS", _IOC_WRITE, 0x4702, 0x06 }, +{ "linux/gigaset_dev.h", "GIGASET_CONFIG", _IOC_READ|_IOC_WRITE, 0x4701, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_REDIR", _IOC_READ|_IOC_WRITE, 0x4700, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_VERSION", _IOC_READ|_IOC_WRITE, 0x4703, 0x10 }, +{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 }, +{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 }, +{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 }, +{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 }, +{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c }, +{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 }, +{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 }, +{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 }, +{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c }, +{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c }, +{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 }, +{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 }, +{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 }, +{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 }, +{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 }, +{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 }, +{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 }, +{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 }, +{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 }, +{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 }, +{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 }, +{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 }, +{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 }, +{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 }, +{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 }, +{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 }, +{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 }, +{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 }, +{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 }, +{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 }, +{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 }, +{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 }, +{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 }, +{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 }, +{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 }, +{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1a }, +{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 }, +{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 }, +{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 }, +{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c }, +{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 }, +{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 }, +{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c }, +{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 }, +{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c }, +{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 }, +{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 }, +{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 }, +{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 }, +{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 }, +{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 }, +{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c }, +{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 }, +{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 }, +{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 }, +{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 }, +{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c }, +{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 }, +{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c }, +{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c }, +{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c }, +{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 }, +{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1a }, +{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1a }, +{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1a }, +{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 }, +{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 }, +{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 }, +{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 }, +{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 }, +{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 }, +{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 }, +{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 }, +{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 }, +{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 }, +{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x06 }, +{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x06 }, +{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 }, +{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x06 }, +{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 }, +{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, +{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 }, +{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 }, +{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 }, +{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 }, +{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, +{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, +{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, +{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, +{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 }, +{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 }, +{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 }, +{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 }, +{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 }, +{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 }, +{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 }, +{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x28 }, +{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 }, +{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c }, +{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, +{ "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, +{ "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, +{ "linux/isdn.h", "IIOCGETDVR", _IOC_NONE, 0x4916, 0x00 }, +{ "linux/isdn.h", "IIOCGETMAP", _IOC_NONE, 0x4911, 0x00 }, +{ "linux/isdn.h", "IIOCGETPRF", _IOC_NONE, 0x490f, 0x00 }, +{ "linux/isdn.h", "IIOCGETSET", _IOC_NONE, 0x4908, 0x00 }, +{ "linux/isdn.h", "IIOCNETAIF", _IOC_NONE, 0x4901, 0x00 }, +{ "linux/isdn.h", "IIOCNETALN", _IOC_NONE, 0x4920, 0x00 }, +{ "linux/isdn.h", "IIOCNETANM", _IOC_NONE, 0x4905, 0x00 }, +{ "linux/isdn.h", "IIOCNETASL", _IOC_NONE, 0x4913, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIF", _IOC_NONE, 0x4902, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIL", _IOC_NONE, 0x4914, 0x00 }, +{ "linux/isdn.h", "IIOCNETDLN", _IOC_NONE, 0x4921, 0x00 }, +{ "linux/isdn.h", "IIOCNETDNM", _IOC_NONE, 0x4906, 0x00 }, +{ "linux/isdn.h", "IIOCNETDWRSET", _IOC_NONE, 0x4918, 0x00 }, +{ "linux/isdn.h", "IIOCNETGCF", _IOC_NONE, 0x4904, 0x00 }, +{ "linux/isdn.h", "IIOCNETGNM", _IOC_NONE, 0x4907, 0x00 }, +{ "linux/isdn.h", "IIOCNETGPN", _IOC_NONE, 0x4922, 0x00 }, +{ "linux/isdn.h", "IIOCNETHUP", _IOC_NONE, 0x490b, 0x00 }, +{ "linux/isdn.h", "IIOCNETLCR", _IOC_NONE, 0x4917, 0x00 }, +{ "linux/isdn.h", "IIOCNETSCF", _IOC_NONE, 0x4903, 0x00 }, +{ "linux/isdn.h", "IIOCSETBRJ", _IOC_NONE, 0x490d, 0x00 }, +{ "linux/isdn.h", "IIOCSETGST", _IOC_NONE, 0x490c, 0x00 }, +{ "linux/isdn.h", "IIOCSETMAP", _IOC_NONE, 0x4912, 0x00 }, +{ "linux/isdn.h", "IIOCSETPRF", _IOC_NONE, 0x4910, 0x00 }, +{ "linux/isdn.h", "IIOCSETSET", _IOC_NONE, 0x4909, 0x00 }, +{ "linux/isdn.h", "IIOCSETVER", _IOC_NONE, 0x490a, 0x00 }, +{ "linux/isdn.h", "IIOCSIGPRF", _IOC_NONE, 0x490e, 0x00 }, +{ "linux/isdn_ppp.h", "PPPIOCBUNDLE", _IOC_WRITE, 0x7481, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCGCALLINFO", _IOC_READ|_IOC_WRITE, 0x7480, 0x88 }, +{ "linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", _IOC_READ, 0x7486, 0x20 }, +{ "linux/isdn_ppp.h", "PPPIOCGIFNAME", _IOC_READ, 0x7488, 0x10 }, +{ "linux/isdn_ppp.h", "PPPIOCGMPFLAGS", _IOC_READ, 0x7482, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", _IOC_WRITE, 0x7487, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPFLAGS", _IOC_WRITE, 0x7483, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMRU", _IOC_WRITE, 0x7485, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMTU", _IOC_WRITE, 0x7484, 0x04 }, +{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, +{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, +{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, +{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, +{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, +{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, +{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 }, +{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 }, +{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 }, +{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 }, +{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 }, +{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 }, +{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 }, +{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 }, +{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 }, +{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 }, +{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 }, +{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 }, +{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 }, +{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 }, +{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 }, +{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 }, +{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 }, +{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 }, +{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 }, +{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 }, +{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 }, +{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 }, +{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 }, +{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 }, +{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 }, +{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 }, +{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 }, +{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 }, +{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 }, +{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 }, +{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 }, +{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 }, +{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 }, +{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 }, +{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 }, +{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 }, +{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 }, +{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 }, +{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 }, +{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 }, +{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 }, +{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 }, +{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 }, +{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 }, +{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 }, +{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 }, +{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 }, +{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 }, +{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 }, +{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 }, +{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 }, +{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 }, +{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, +{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, +{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, +{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, +{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, +{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 }, +{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 }, +{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 }, +{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 }, +{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 }, +{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 }, +{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 }, +{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 }, +{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, +{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, +{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, +{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, +{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, +{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 }, +{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 }, +{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 }, +{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 }, +{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 }, +{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 }, +{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, +{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x30 }, +{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, +{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 }, +{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 }, +{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 }, +{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 }, +{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 }, +{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_ADD_DEVICE", _IOC_READ|_IOC_WRITE, 0x7301, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_CONFIG_CHANGE", _IOC_READ|_IOC_WRITE, 0x7305, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_COPY_DESC", _IOC_READ|_IOC_WRITE, 0x7302, 0x04 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x214 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x214 }, +{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c }, +{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x06 }, +{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 }, +{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 }, +{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 }, +{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 }, +{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 }, +{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 }, +{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, +{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x26 }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, +{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, +{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, +{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 }, +{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, +{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x2c }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 }, +{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 }, +{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x1e }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4a }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x16 }, +{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, +{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x0c }, +{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3a }, +{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x0c }, +{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 }, +{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 }, +{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 }, +{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 }, +{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 }, +{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 }, +{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 }, +{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 }, +{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 }, +{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 }, +{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 }, +{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c }, +{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 }, +{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 }, +{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 }, +{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 }, +{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 }, +{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 }, +{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 }, +{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 }, +{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 }, +{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 }, +{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x08 }, +{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 }, +{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 }, +{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 }, +{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 }, +{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 }, +{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 }, +{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 }, +{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 }, +{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x08 }, +{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 }, +{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 }, +{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 }, +{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGIDLE", _IOC_READ, 0x743f, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 }, +{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x06 }, +{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c }, +{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x06 }, +{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 }, +{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 }, +{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 }, +{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 }, +{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 }, +{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 }, +{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 }, +{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 }, +{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 }, +{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, +{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, +{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, +{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, +{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, +{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 }, +{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, +{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, +{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, +{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, +{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 }, +{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 }, +{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 }, +{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 }, +{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 }, +{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 }, +{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 }, +{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 }, +{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 }, +{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 }, +{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 }, +{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c }, +{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 }, +{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c }, +{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 }, +{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 }, +{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 }, +{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 }, +{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 }, +{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 }, +{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 }, +{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 }, +{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, +{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, +{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, +{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, +{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, +{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 }, +{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x1e }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x1e }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, +{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, +{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, +{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 }, +{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 }, +{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 }, +{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 }, +{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 }, +{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c }, +{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c }, +{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 }, +{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 }, +{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 }, +{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 }, +{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 }, +{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 }, +{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 }, +{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x26 }, +{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x26 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x0c }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x14 }, +{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x14 }, +{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x14 }, +{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x24 }, +{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, +{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, +{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, +{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 }, +{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 }, +{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 }, +{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 }, +{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 }, +{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 }, +{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 }, +{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 }, +{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 }, +{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 }, +{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 }, +{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 }, +{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 }, +{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 }, +{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 }, +{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 }, +{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 }, +{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 }, +{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 }, +{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 }, +{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 }, +{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 }, +{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 }, +{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 }, +{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 }, +{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 }, +{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 }, +{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 }, +{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 }, +{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 }, +{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 }, +{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 }, +{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 }, +{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 }, +{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 }, +{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 }, +{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 }, +{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 }, +{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 }, +{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 }, +{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 }, +{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 }, +{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 }, +{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 }, +{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 }, +{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 }, +{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 }, +{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 }, +{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 }, +{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 }, +{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 }, +{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 }, +{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 }, +{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 }, +{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 }, +{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 }, +{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 }, +{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 }, +{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 }, +{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 }, +{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 }, +{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 }, +{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 }, +{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 }, +{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 }, +{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 }, +{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 }, +{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 }, +{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 }, +{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 }, +{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 }, +{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 }, +{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 }, +{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 }, +{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 }, +{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 }, +{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 }, +{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 }, +{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x72 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8a }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8a }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 }, +{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 }, +{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 }, +{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 }, +{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 }, +{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 }, +{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, +{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, +{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x1c }, +{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x1c }, +{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, +{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, +{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, +{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, +{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, +{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, +{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, +{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, +{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, +{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, +{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, +{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, +{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, +{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, +{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, +{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, +{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, +{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, +{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, +{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, +{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, +{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, +{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, +{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, +{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1a }, +{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, +{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x58 }, +{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 }, +{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 }, +{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c }, +{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c }, +{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x58 }, +{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 }, +{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 }, +{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 }, +{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 }, +{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 }, +{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 }, +{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 }, +{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 }, +{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 }, +{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 }, +{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 }, +{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 }, +{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, +{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, +{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x26 }, +{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 }, +{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x06 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2a }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a }, +{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 }, +{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 }, +{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 }, +{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0a }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, +{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, +{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, +{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 }, +{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 }, +{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 }, +{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 }, +{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x78 }, +{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x4c }, +{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 }, +{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x72 }, +{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, +{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 }, +{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 }, +{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 }, +{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 }, +{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 }, +{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 }, +{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 }, +{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 }, +{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 }, +{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 }, +{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 }, +{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 }, +{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 }, +{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 }, +{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 }, +{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 }, +{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 }, +{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 }, +{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 }, +{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 }, +{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 }, +{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 }, +{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 }, +{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 }, +{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 }, +{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 }, +{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 }, +{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 }, +{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 }, +{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 }, +{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 }, +{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 }, +{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 }, +{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 }, +{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 }, +{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 }, +{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 }, +{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 }, +{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 }, +{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 }, +{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 }, +{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 }, +{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 }, +{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 }, +{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 }, +{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 }, +{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 }, +{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 }, +{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 }, +{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 }, +{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 }, +{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 }, +{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 }, +{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 }, +{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 }, +{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 }, +{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 }, +{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 }, +{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 }, +{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 }, +{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 }, +{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 }, +{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 }, +{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 }, +{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 }, +{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 }, +{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 }, +{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 }, +{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 }, +{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, +{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, +{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, +{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, +{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 }, +{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 }, +{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x78 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, +{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, +{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, +{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 }, +{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 }, +{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x1e }, +{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 }, +{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 }, +{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 }, +{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c }, +{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 }, +{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 }, +{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 }, +{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 }, +{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c }, +{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c }, +{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 }, +{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 }, +{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, +{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, +{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, +{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, +{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x26 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 }, +{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 }, +{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 }, +{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 }, +{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 }, +{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 }, +{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 }, +{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 }, +{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 }, +{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 }, +{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 }, +{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 }, +{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 }, +{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 }, +{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 }, +{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 }, +{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 }, +{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 }, +{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 }, +{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 }, +{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 }, +{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 }, +{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 }, +{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa2 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8a }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa2 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8a }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8a }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa2 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8a }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa2 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x56 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x3e }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa2 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8a }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x46 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c2 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c2 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x10 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x232 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x232 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x6c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x84 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x1e }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x24 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x58 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD", _IOC_WRITE, 0x5402, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x08 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x46 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x46 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x22 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x06 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x906 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x1a }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x20 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x26 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 }, +{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 }, +{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, +{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, +{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, +{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, +{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 }, +{ "video/mbxfb.h", "MBXFB_IOCG_ALPHA", _IOC_READ, 0xf401, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_ALPHA", _IOC_WRITE, 0xf402, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_PLANEORDER", _IOC_READ, 0xf403, 0x02 }, +{ "video/mbxfb.h", "MBXFB_IOCS_REG", _IOC_WRITE, 0xf404, 0x0c }, +{ "video/mbxfb.h", "MBXFB_IOCX_OVERLAY", _IOC_READ|_IOC_WRITE, 0xf400, 0x30 }, +{ "video/mbxfb.h", "MBXFB_IOCX_REG", _IOC_READ|_IOC_WRITE, 0xf405, 0x0c }, +{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x114 }, +{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 }, +{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 }, +{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 }, diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h new file mode 100644 index 00000000..699eb905 --- /dev/null +++ b/linux/32/ioctls_inc_align32.h @@ -0,0 +1,2729 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */ +{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 }, +{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 }, +{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 }, +{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 }, +{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 }, +{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 }, +{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 }, +{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 }, +{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 }, +{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 }, +{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 }, +{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 }, +{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 }, +{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 }, +{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 }, +{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 }, +{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 }, +{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 }, +{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 }, +{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 }, +{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 }, +{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 }, +{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c }, +{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x64 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x1c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 }, +{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 }, +{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c }, +{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 }, +{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 }, +{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 }, +{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 }, +{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 }, +{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 }, +{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 }, +{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, +{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, +{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, +{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, +{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, +{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 }, +{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 }, +{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 }, +{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 }, +{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 }, +{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x14 }, +{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 }, +{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 }, +{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 }, +{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 }, +{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 }, +{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 }, +{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 }, +{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 }, +{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 }, +{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 }, +{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, +{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, +{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, +{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c }, +{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 }, +{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 }, +{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 }, +{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 }, +{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c }, +{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 }, +{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 }, +{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 }, +{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 }, +{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c }, +{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 }, +{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 }, +{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c }, +{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c }, +{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 }, +{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c }, +{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c }, +{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c }, +{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 }, +{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c }, +{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c }, +{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c }, +{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 }, +{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c }, +{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c }, +{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 }, +{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c }, +{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c }, +{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 }, +{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 }, +{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, +{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, +{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, +{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa24 }, +{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x44 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc0 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 }, +{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 }, +{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 }, +{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 }, +{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 }, +{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 }, +{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 }, +{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 }, +{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 }, +{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 }, +{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 }, +{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 }, +{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 }, +{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c }, +{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 }, +{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c }, +{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 }, +{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x54 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 }, +{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 }, +{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 }, +{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 }, +{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 }, +{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 }, +{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 }, +{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 }, +{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 }, +{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 }, +{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 }, +{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 }, +{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 }, +{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 }, +{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 }, +{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 }, +{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 }, +{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 }, +{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 }, +{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 }, +{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 }, +{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 }, +{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 }, +{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 }, +{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 }, +{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 }, +{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 }, +{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 }, +{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 }, +{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 }, +{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 }, +{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 }, +{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 }, +{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 }, +{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 }, +{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 }, +{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 }, +{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 }, +{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 }, +{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 }, +{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c }, +{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 }, +{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 }, +{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 }, +{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 }, +{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 }, +{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 }, +{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 }, +{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c }, +{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c }, +{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 }, +{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 }, +{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 }, +{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 }, +{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 }, +{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c }, +{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 }, +{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, +{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 }, +{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 }, +{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 }, +{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 }, +{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dn.h", "SIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "SIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, +{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, +{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, +{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 }, +{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 }, +{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 }, +{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c }, +{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c }, +{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, +{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, +{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, +{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, +{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, +{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, +{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, +{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 }, +{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 }, +{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 }, +{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 }, +{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 }, +{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 }, +{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 }, +{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 }, +{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 }, +{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 }, +{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 }, +{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 }, +{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c }, +{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 }, +{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, +{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, +{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, +{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 }, +{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 }, +{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 }, +{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 }, +{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 }, +{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 }, +{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 }, +{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 }, +{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 }, +{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 }, +{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 }, +{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 }, +{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 }, +{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 }, +{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 }, +{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 }, +{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x48 }, +{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 }, +{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 }, +{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 }, +{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c }, +{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 }, +{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 }, +{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 }, +{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 }, +{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c }, +{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x58 }, +{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 }, +{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 }, +{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x20 }, +{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 }, +{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c }, +{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 }, +{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 }, +{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 }, +{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 }, +{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 }, +{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x58 }, +{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 }, +{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 }, +{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c }, +{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 }, +{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 }, +{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x1c }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x0c }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x14 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x24 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x24 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x14 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x24 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x14 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, +{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, +{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, +{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 }, +{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 }, +{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 }, +{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 }, +{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 }, +{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 }, +{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 }, +{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 }, +{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 }, +{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 }, +{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 }, +{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 }, +{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 }, +{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 }, +{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 }, +{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 }, +{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 }, +{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 }, +{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x40 }, +{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 }, +{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 }, +{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 }, +{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 }, +{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 }, +{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 }, +{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 }, +{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 }, +{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 }, +{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 }, +{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, +{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, +{ "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, +{ "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 }, +{ "linux/gigaset_dev.h", "GIGASET_BRKCHARS", _IOC_WRITE, 0x4702, 0x06 }, +{ "linux/gigaset_dev.h", "GIGASET_CONFIG", _IOC_READ|_IOC_WRITE, 0x4701, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_REDIR", _IOC_READ|_IOC_WRITE, 0x4700, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_VERSION", _IOC_READ|_IOC_WRITE, 0x4703, 0x10 }, +{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 }, +{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 }, +{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 }, +{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 }, +{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c }, +{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 }, +{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 }, +{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 }, +{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c }, +{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c }, +{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 }, +{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 }, +{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 }, +{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 }, +{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 }, +{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 }, +{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 }, +{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 }, +{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 }, +{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 }, +{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 }, +{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 }, +{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 }, +{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 }, +{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 }, +{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 }, +{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 }, +{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 }, +{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 }, +{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 }, +{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 }, +{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 }, +{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 }, +{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 }, +{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 }, +{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c }, +{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 }, +{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 }, +{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 }, +{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c }, +{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 }, +{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 }, +{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c }, +{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 }, +{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c }, +{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 }, +{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 }, +{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 }, +{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 }, +{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 }, +{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 }, +{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c }, +{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 }, +{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 }, +{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 }, +{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 }, +{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c }, +{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 }, +{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c }, +{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c }, +{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c }, +{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 }, +{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1c }, +{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1c }, +{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1c }, +{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 }, +{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 }, +{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 }, +{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 }, +{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 }, +{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 }, +{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 }, +{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 }, +{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 }, +{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 }, +{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x08 }, +{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x08 }, +{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 }, +{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x08 }, +{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 }, +{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, +{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 }, +{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 }, +{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 }, +{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 }, +{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, +{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, +{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, +{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, +{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 }, +{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 }, +{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 }, +{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 }, +{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 }, +{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 }, +{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 }, +{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x2c }, +{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 }, +{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c }, +{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, +{ "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, +{ "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, +{ "linux/isdn.h", "IIOCGETDVR", _IOC_NONE, 0x4916, 0x00 }, +{ "linux/isdn.h", "IIOCGETMAP", _IOC_NONE, 0x4911, 0x00 }, +{ "linux/isdn.h", "IIOCGETPRF", _IOC_NONE, 0x490f, 0x00 }, +{ "linux/isdn.h", "IIOCGETSET", _IOC_NONE, 0x4908, 0x00 }, +{ "linux/isdn.h", "IIOCNETAIF", _IOC_NONE, 0x4901, 0x00 }, +{ "linux/isdn.h", "IIOCNETALN", _IOC_NONE, 0x4920, 0x00 }, +{ "linux/isdn.h", "IIOCNETANM", _IOC_NONE, 0x4905, 0x00 }, +{ "linux/isdn.h", "IIOCNETASL", _IOC_NONE, 0x4913, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIF", _IOC_NONE, 0x4902, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIL", _IOC_NONE, 0x4914, 0x00 }, +{ "linux/isdn.h", "IIOCNETDLN", _IOC_NONE, 0x4921, 0x00 }, +{ "linux/isdn.h", "IIOCNETDNM", _IOC_NONE, 0x4906, 0x00 }, +{ "linux/isdn.h", "IIOCNETDWRSET", _IOC_NONE, 0x4918, 0x00 }, +{ "linux/isdn.h", "IIOCNETGCF", _IOC_NONE, 0x4904, 0x00 }, +{ "linux/isdn.h", "IIOCNETGNM", _IOC_NONE, 0x4907, 0x00 }, +{ "linux/isdn.h", "IIOCNETGPN", _IOC_NONE, 0x4922, 0x00 }, +{ "linux/isdn.h", "IIOCNETHUP", _IOC_NONE, 0x490b, 0x00 }, +{ "linux/isdn.h", "IIOCNETLCR", _IOC_NONE, 0x4917, 0x00 }, +{ "linux/isdn.h", "IIOCNETSCF", _IOC_NONE, 0x4903, 0x00 }, +{ "linux/isdn.h", "IIOCSETBRJ", _IOC_NONE, 0x490d, 0x00 }, +{ "linux/isdn.h", "IIOCSETGST", _IOC_NONE, 0x490c, 0x00 }, +{ "linux/isdn.h", "IIOCSETMAP", _IOC_NONE, 0x4912, 0x00 }, +{ "linux/isdn.h", "IIOCSETPRF", _IOC_NONE, 0x4910, 0x00 }, +{ "linux/isdn.h", "IIOCSETSET", _IOC_NONE, 0x4909, 0x00 }, +{ "linux/isdn.h", "IIOCSETVER", _IOC_NONE, 0x490a, 0x00 }, +{ "linux/isdn.h", "IIOCSIGPRF", _IOC_NONE, 0x490e, 0x00 }, +{ "linux/isdn_ppp.h", "PPPIOCBUNDLE", _IOC_WRITE, 0x7481, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCGCALLINFO", _IOC_READ|_IOC_WRITE, 0x7480, 0x88 }, +{ "linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", _IOC_READ, 0x7486, 0x20 }, +{ "linux/isdn_ppp.h", "PPPIOCGIFNAME", _IOC_READ, 0x7488, 0x10 }, +{ "linux/isdn_ppp.h", "PPPIOCGMPFLAGS", _IOC_READ, 0x7482, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", _IOC_WRITE, 0x7487, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPFLAGS", _IOC_WRITE, 0x7483, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMRU", _IOC_WRITE, 0x7485, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMTU", _IOC_WRITE, 0x7484, 0x04 }, +{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, +{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, +{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, +{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, +{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, +{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, +{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 }, +{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 }, +{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 }, +{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 }, +{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 }, +{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 }, +{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 }, +{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 }, +{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 }, +{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 }, +{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 }, +{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 }, +{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 }, +{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 }, +{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 }, +{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 }, +{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 }, +{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 }, +{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 }, +{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 }, +{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 }, +{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 }, +{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 }, +{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 }, +{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 }, +{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 }, +{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 }, +{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 }, +{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 }, +{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 }, +{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 }, +{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 }, +{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 }, +{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 }, +{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 }, +{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 }, +{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 }, +{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 }, +{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 }, +{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 }, +{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 }, +{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 }, +{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 }, +{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 }, +{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 }, +{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 }, +{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 }, +{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 }, +{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 }, +{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 }, +{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 }, +{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 }, +{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, +{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, +{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, +{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, +{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, +{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 }, +{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 }, +{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 }, +{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 }, +{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 }, +{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 }, +{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 }, +{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 }, +{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, +{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, +{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, +{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, +{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, +{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 }, +{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 }, +{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 }, +{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 }, +{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 }, +{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 }, +{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, +{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, +{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 }, +{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 }, +{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 }, +{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 }, +{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 }, +{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_ADD_DEVICE", _IOC_READ|_IOC_WRITE, 0x7301, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_CONFIG_CHANGE", _IOC_READ|_IOC_WRITE, 0x7305, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_COPY_DESC", _IOC_READ|_IOC_WRITE, 0x7302, 0x04 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x218 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x218 }, +{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c }, +{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 }, +{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 }, +{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 }, +{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 }, +{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 }, +{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 }, +{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 }, +{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, +{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, +{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, +{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, +{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 }, +{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, +{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x2c }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 }, +{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 }, +{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, +{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, +{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c }, +{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 }, +{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 }, +{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 }, +{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 }, +{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 }, +{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 }, +{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 }, +{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 }, +{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 }, +{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 }, +{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 }, +{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c }, +{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 }, +{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 }, +{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 }, +{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 }, +{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 }, +{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 }, +{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 }, +{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 }, +{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 }, +{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 }, +{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x08 }, +{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 }, +{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 }, +{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 }, +{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 }, +{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 }, +{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 }, +{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 }, +{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 }, +{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x08 }, +{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 }, +{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 }, +{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 }, +{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGIDLE", _IOC_READ, 0x743f, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 }, +{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c }, +{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 }, +{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 }, +{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 }, +{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 }, +{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 }, +{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 }, +{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 }, +{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 }, +{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 }, +{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, +{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, +{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, +{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, +{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, +{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 }, +{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, +{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, +{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, +{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, +{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 }, +{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 }, +{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 }, +{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 }, +{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 }, +{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 }, +{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 }, +{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 }, +{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 }, +{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 }, +{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 }, +{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c }, +{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 }, +{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c }, +{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 }, +{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 }, +{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 }, +{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 }, +{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 }, +{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 }, +{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 }, +{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 }, +{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, +{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, +{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, +{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, +{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, +{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 }, +{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, +{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, +{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, +{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 }, +{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 }, +{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 }, +{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 }, +{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 }, +{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c }, +{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c }, +{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 }, +{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 }, +{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 }, +{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 }, +{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 }, +{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 }, +{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 }, +{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 }, +{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x0c }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x14 }, +{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x14 }, +{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x14 }, +{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x24 }, +{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x24 }, +{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, +{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, +{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, +{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 }, +{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 }, +{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 }, +{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 }, +{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 }, +{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 }, +{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 }, +{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 }, +{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 }, +{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 }, +{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 }, +{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 }, +{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 }, +{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 }, +{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 }, +{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 }, +{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 }, +{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 }, +{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 }, +{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 }, +{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 }, +{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 }, +{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 }, +{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 }, +{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 }, +{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 }, +{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 }, +{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 }, +{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 }, +{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 }, +{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 }, +{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 }, +{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 }, +{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 }, +{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 }, +{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 }, +{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 }, +{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 }, +{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 }, +{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 }, +{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 }, +{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 }, +{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 }, +{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 }, +{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 }, +{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 }, +{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 }, +{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 }, +{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 }, +{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 }, +{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 }, +{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 }, +{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 }, +{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 }, +{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 }, +{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 }, +{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 }, +{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 }, +{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 }, +{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 }, +{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 }, +{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 }, +{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 }, +{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 }, +{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 }, +{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 }, +{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 }, +{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 }, +{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 }, +{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 }, +{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 }, +{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 }, +{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 }, +{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 }, +{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 }, +{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 }, +{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 }, +{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 }, +{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 }, +{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 }, +{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 }, +{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 }, +{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 }, +{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 }, +{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, +{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, +{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x20 }, +{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x20 }, +{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, +{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, +{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, +{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, +{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, +{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, +{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, +{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, +{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, +{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, +{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, +{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, +{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, +{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, +{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, +{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, +{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, +{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, +{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, +{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, +{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, +{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, +{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, +{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, +{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, +{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, +{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 }, +{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 }, +{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 }, +{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c }, +{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c }, +{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x60 }, +{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 }, +{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 }, +{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 }, +{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 }, +{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 }, +{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 }, +{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 }, +{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 }, +{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 }, +{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 }, +{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 }, +{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 }, +{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, +{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, +{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 }, +{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 }, +{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a }, +{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 }, +{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 }, +{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 }, +{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, +{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, +{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, +{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 }, +{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 }, +{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 }, +{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 }, +{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x78 }, +{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x4c }, +{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 }, +{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 }, +{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, +{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 }, +{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 }, +{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 }, +{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 }, +{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 }, +{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 }, +{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 }, +{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 }, +{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 }, +{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 }, +{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 }, +{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 }, +{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 }, +{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 }, +{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 }, +{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 }, +{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 }, +{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 }, +{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 }, +{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 }, +{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 }, +{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 }, +{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 }, +{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 }, +{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 }, +{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 }, +{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 }, +{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 }, +{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 }, +{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 }, +{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 }, +{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 }, +{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 }, +{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 }, +{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 }, +{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 }, +{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 }, +{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 }, +{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 }, +{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 }, +{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 }, +{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 }, +{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 }, +{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 }, +{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 }, +{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 }, +{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 }, +{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 }, +{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 }, +{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 }, +{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 }, +{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 }, +{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 }, +{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 }, +{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 }, +{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 }, +{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 }, +{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 }, +{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 }, +{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 }, +{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 }, +{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 }, +{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 }, +{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 }, +{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 }, +{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 }, +{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 }, +{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 }, +{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 }, +{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, +{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, +{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, +{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, +{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 }, +{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 }, +{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x78 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, +{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, +{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, +{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 }, +{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 }, +{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 }, +{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 }, +{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 }, +{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 }, +{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c }, +{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 }, +{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 }, +{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 }, +{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 }, +{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c }, +{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c }, +{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 }, +{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 }, +{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, +{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, +{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, +{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, +{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 }, +{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 }, +{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 }, +{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 }, +{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 }, +{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 }, +{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 }, +{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 }, +{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 }, +{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 }, +{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 }, +{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 }, +{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 }, +{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 }, +{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 }, +{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 }, +{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 }, +{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 }, +{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 }, +{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 }, +{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 }, +{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 }, +{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 }, +{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x48 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c4 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c4 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x10 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x25c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x25c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x6c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x84 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x20 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x24 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x58 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD", _IOC_WRITE, 0x5402, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x1c }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 }, +{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 }, +{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, +{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, +{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, +{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, +{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 }, +{ "video/mbxfb.h", "MBXFB_IOCG_ALPHA", _IOC_READ, 0xf401, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_ALPHA", _IOC_WRITE, 0xf402, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_PLANEORDER", _IOC_READ, 0xf403, 0x02 }, +{ "video/mbxfb.h", "MBXFB_IOCS_REG", _IOC_WRITE, 0xf404, 0x0c }, +{ "video/mbxfb.h", "MBXFB_IOCX_OVERLAY", _IOC_READ|_IOC_WRITE, 0xf400, 0x30 }, +{ "video/mbxfb.h", "MBXFB_IOCX_REG", _IOC_READ|_IOC_WRITE, 0xf405, 0x0c }, +{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c }, +{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 }, +{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 }, +{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 }, diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h new file mode 100644 index 00000000..fcd9d8c2 --- /dev/null +++ b/linux/32/ioctls_inc_align64.h @@ -0,0 +1,2729 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */ +{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 }, +{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 }, +{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 }, +{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 }, +{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 }, +{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 }, +{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 }, +{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 }, +{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 }, +{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 }, +{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 }, +{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 }, +{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 }, +{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 }, +{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 }, +{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 }, +{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 }, +{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 }, +{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 }, +{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 }, +{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 }, +{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 }, +{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c }, +{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 }, +{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 }, +{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c }, +{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 }, +{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 }, +{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 }, +{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 }, +{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 }, +{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 }, +{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 }, +{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, +{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, +{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, +{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, +{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, +{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 }, +{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 }, +{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 }, +{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 }, +{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 }, +{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x18 }, +{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 }, +{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 }, +{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 }, +{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 }, +{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 }, +{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 }, +{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 }, +{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 }, +{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 }, +{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 }, +{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, +{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, +{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, +{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c }, +{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 }, +{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 }, +{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 }, +{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 }, +{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c }, +{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 }, +{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 }, +{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 }, +{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 }, +{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c }, +{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 }, +{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 }, +{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c }, +{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c }, +{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 }, +{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c }, +{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c }, +{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c }, +{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 }, +{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c }, +{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c }, +{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c }, +{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 }, +{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c }, +{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c }, +{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 }, +{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c }, +{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c }, +{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 }, +{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 }, +{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, +{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, +{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, +{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 }, +{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 }, +{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 }, +{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 }, +{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 }, +{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 }, +{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 }, +{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 }, +{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 }, +{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 }, +{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 }, +{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 }, +{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 }, +{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 }, +{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c }, +{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 }, +{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c }, +{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 }, +{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x54 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 }, +{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 }, +{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 }, +{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 }, +{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 }, +{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 }, +{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 }, +{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 }, +{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 }, +{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 }, +{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 }, +{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 }, +{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 }, +{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 }, +{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 }, +{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 }, +{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 }, +{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 }, +{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 }, +{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 }, +{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 }, +{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 }, +{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 }, +{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 }, +{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 }, +{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 }, +{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 }, +{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 }, +{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 }, +{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 }, +{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 }, +{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 }, +{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 }, +{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 }, +{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 }, +{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 }, +{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 }, +{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 }, +{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 }, +{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 }, +{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c }, +{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 }, +{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 }, +{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 }, +{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 }, +{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 }, +{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 }, +{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 }, +{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c }, +{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c }, +{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 }, +{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 }, +{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 }, +{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 }, +{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 }, +{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c }, +{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 }, +{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, +{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 }, +{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 }, +{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 }, +{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 }, +{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dn.h", "SIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "SIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, +{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, +{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, +{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 }, +{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 }, +{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 }, +{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c }, +{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c }, +{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, +{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, +{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, +{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, +{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, +{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, +{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, +{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 }, +{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 }, +{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 }, +{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 }, +{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 }, +{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 }, +{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 }, +{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 }, +{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 }, +{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 }, +{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 }, +{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 }, +{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c }, +{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 }, +{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, +{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, +{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, +{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 }, +{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 }, +{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 }, +{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 }, +{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 }, +{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 }, +{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 }, +{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 }, +{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 }, +{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 }, +{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 }, +{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 }, +{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 }, +{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 }, +{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 }, +{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 }, +{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x48 }, +{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 }, +{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 }, +{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 }, +{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c }, +{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 }, +{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 }, +{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 }, +{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 }, +{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c }, +{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x58 }, +{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 }, +{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 }, +{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x20 }, +{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 }, +{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c }, +{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 }, +{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 }, +{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 }, +{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 }, +{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 }, +{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x58 }, +{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 }, +{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 }, +{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c }, +{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 }, +{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 }, +{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, +{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, +{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, +{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 }, +{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 }, +{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 }, +{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 }, +{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 }, +{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 }, +{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 }, +{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 }, +{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 }, +{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 }, +{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 }, +{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 }, +{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 }, +{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 }, +{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 }, +{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 }, +{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 }, +{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 }, +{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x48 }, +{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 }, +{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 }, +{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 }, +{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 }, +{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 }, +{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 }, +{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 }, +{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 }, +{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 }, +{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 }, +{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, +{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, +{ "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, +{ "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 }, +{ "linux/gigaset_dev.h", "GIGASET_BRKCHARS", _IOC_WRITE, 0x4702, 0x06 }, +{ "linux/gigaset_dev.h", "GIGASET_CONFIG", _IOC_READ|_IOC_WRITE, 0x4701, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_REDIR", _IOC_READ|_IOC_WRITE, 0x4700, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_VERSION", _IOC_READ|_IOC_WRITE, 0x4703, 0x10 }, +{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 }, +{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 }, +{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 }, +{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 }, +{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c }, +{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 }, +{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 }, +{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 }, +{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c }, +{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c }, +{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 }, +{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 }, +{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 }, +{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 }, +{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 }, +{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 }, +{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 }, +{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 }, +{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 }, +{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 }, +{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 }, +{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 }, +{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 }, +{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 }, +{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 }, +{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 }, +{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 }, +{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 }, +{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 }, +{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 }, +{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 }, +{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 }, +{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 }, +{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 }, +{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 }, +{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c }, +{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 }, +{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 }, +{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 }, +{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c }, +{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 }, +{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 }, +{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c }, +{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 }, +{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c }, +{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 }, +{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 }, +{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 }, +{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 }, +{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 }, +{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 }, +{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c }, +{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 }, +{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 }, +{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 }, +{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 }, +{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c }, +{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 }, +{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c }, +{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c }, +{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c }, +{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 }, +{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1c }, +{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1c }, +{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1c }, +{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 }, +{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 }, +{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 }, +{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 }, +{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 }, +{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 }, +{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 }, +{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 }, +{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 }, +{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 }, +{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x08 }, +{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x08 }, +{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 }, +{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x08 }, +{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 }, +{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, +{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 }, +{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 }, +{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 }, +{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 }, +{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, +{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, +{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, +{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, +{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 }, +{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 }, +{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 }, +{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 }, +{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 }, +{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 }, +{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 }, +{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x2c }, +{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 }, +{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c }, +{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, +{ "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, +{ "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, +{ "linux/isdn.h", "IIOCGETDVR", _IOC_NONE, 0x4916, 0x00 }, +{ "linux/isdn.h", "IIOCGETMAP", _IOC_NONE, 0x4911, 0x00 }, +{ "linux/isdn.h", "IIOCGETPRF", _IOC_NONE, 0x490f, 0x00 }, +{ "linux/isdn.h", "IIOCGETSET", _IOC_NONE, 0x4908, 0x00 }, +{ "linux/isdn.h", "IIOCNETAIF", _IOC_NONE, 0x4901, 0x00 }, +{ "linux/isdn.h", "IIOCNETALN", _IOC_NONE, 0x4920, 0x00 }, +{ "linux/isdn.h", "IIOCNETANM", _IOC_NONE, 0x4905, 0x00 }, +{ "linux/isdn.h", "IIOCNETASL", _IOC_NONE, 0x4913, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIF", _IOC_NONE, 0x4902, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIL", _IOC_NONE, 0x4914, 0x00 }, +{ "linux/isdn.h", "IIOCNETDLN", _IOC_NONE, 0x4921, 0x00 }, +{ "linux/isdn.h", "IIOCNETDNM", _IOC_NONE, 0x4906, 0x00 }, +{ "linux/isdn.h", "IIOCNETDWRSET", _IOC_NONE, 0x4918, 0x00 }, +{ "linux/isdn.h", "IIOCNETGCF", _IOC_NONE, 0x4904, 0x00 }, +{ "linux/isdn.h", "IIOCNETGNM", _IOC_NONE, 0x4907, 0x00 }, +{ "linux/isdn.h", "IIOCNETGPN", _IOC_NONE, 0x4922, 0x00 }, +{ "linux/isdn.h", "IIOCNETHUP", _IOC_NONE, 0x490b, 0x00 }, +{ "linux/isdn.h", "IIOCNETLCR", _IOC_NONE, 0x4917, 0x00 }, +{ "linux/isdn.h", "IIOCNETSCF", _IOC_NONE, 0x4903, 0x00 }, +{ "linux/isdn.h", "IIOCSETBRJ", _IOC_NONE, 0x490d, 0x00 }, +{ "linux/isdn.h", "IIOCSETGST", _IOC_NONE, 0x490c, 0x00 }, +{ "linux/isdn.h", "IIOCSETMAP", _IOC_NONE, 0x4912, 0x00 }, +{ "linux/isdn.h", "IIOCSETPRF", _IOC_NONE, 0x4910, 0x00 }, +{ "linux/isdn.h", "IIOCSETSET", _IOC_NONE, 0x4909, 0x00 }, +{ "linux/isdn.h", "IIOCSETVER", _IOC_NONE, 0x490a, 0x00 }, +{ "linux/isdn.h", "IIOCSIGPRF", _IOC_NONE, 0x490e, 0x00 }, +{ "linux/isdn_ppp.h", "PPPIOCBUNDLE", _IOC_WRITE, 0x7481, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCGCALLINFO", _IOC_READ|_IOC_WRITE, 0x7480, 0x88 }, +{ "linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", _IOC_READ, 0x7486, 0x20 }, +{ "linux/isdn_ppp.h", "PPPIOCGIFNAME", _IOC_READ, 0x7488, 0x10 }, +{ "linux/isdn_ppp.h", "PPPIOCGMPFLAGS", _IOC_READ, 0x7482, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", _IOC_WRITE, 0x7487, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPFLAGS", _IOC_WRITE, 0x7483, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMRU", _IOC_WRITE, 0x7485, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMTU", _IOC_WRITE, 0x7484, 0x04 }, +{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, +{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, +{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, +{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, +{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, +{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, +{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 }, +{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 }, +{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 }, +{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 }, +{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 }, +{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 }, +{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 }, +{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 }, +{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 }, +{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 }, +{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 }, +{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 }, +{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 }, +{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 }, +{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 }, +{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 }, +{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 }, +{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 }, +{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 }, +{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 }, +{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 }, +{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 }, +{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 }, +{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 }, +{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 }, +{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 }, +{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 }, +{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 }, +{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 }, +{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 }, +{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 }, +{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 }, +{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 }, +{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 }, +{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 }, +{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 }, +{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 }, +{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 }, +{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 }, +{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 }, +{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 }, +{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 }, +{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 }, +{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 }, +{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 }, +{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 }, +{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 }, +{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 }, +{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 }, +{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 }, +{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 }, +{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 }, +{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, +{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, +{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, +{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, +{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, +{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 }, +{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 }, +{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 }, +{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 }, +{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 }, +{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 }, +{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 }, +{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 }, +{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, +{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, +{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, +{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, +{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, +{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 }, +{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 }, +{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 }, +{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 }, +{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 }, +{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 }, +{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, +{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, +{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 }, +{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 }, +{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 }, +{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 }, +{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 }, +{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_ADD_DEVICE", _IOC_READ|_IOC_WRITE, 0x7301, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_CONFIG_CHANGE", _IOC_READ|_IOC_WRITE, 0x7305, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_COPY_DESC", _IOC_READ|_IOC_WRITE, 0x7302, 0x04 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x218 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x218 }, +{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c }, +{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 }, +{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 }, +{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 }, +{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 }, +{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 }, +{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 }, +{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 }, +{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, +{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, +{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, +{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, +{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 }, +{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, +{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x30 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 }, +{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 }, +{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, +{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, +{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c }, +{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 }, +{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 }, +{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 }, +{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 }, +{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 }, +{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 }, +{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 }, +{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 }, +{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 }, +{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 }, +{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 }, +{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c }, +{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 }, +{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 }, +{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 }, +{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 }, +{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 }, +{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 }, +{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 }, +{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 }, +{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 }, +{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 }, +{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x08 }, +{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 }, +{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 }, +{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 }, +{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 }, +{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 }, +{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 }, +{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 }, +{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 }, +{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x08 }, +{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 }, +{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 }, +{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 }, +{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGIDLE", _IOC_READ, 0x743f, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 }, +{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c }, +{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 }, +{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 }, +{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 }, +{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 }, +{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 }, +{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 }, +{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 }, +{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 }, +{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 }, +{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, +{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, +{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, +{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, +{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, +{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 }, +{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, +{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, +{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, +{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, +{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 }, +{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 }, +{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 }, +{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 }, +{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 }, +{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 }, +{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 }, +{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 }, +{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 }, +{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 }, +{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 }, +{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c }, +{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 }, +{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c }, +{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 }, +{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 }, +{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 }, +{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 }, +{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 }, +{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 }, +{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 }, +{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 }, +{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, +{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, +{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, +{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, +{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, +{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 }, +{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, +{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, +{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, +{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 }, +{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 }, +{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 }, +{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 }, +{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 }, +{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c }, +{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c }, +{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 }, +{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 }, +{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 }, +{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 }, +{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 }, +{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 }, +{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 }, +{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 }, +{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 }, +{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, +{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, +{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, +{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 }, +{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 }, +{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 }, +{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 }, +{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 }, +{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 }, +{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 }, +{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 }, +{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 }, +{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 }, +{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 }, +{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 }, +{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 }, +{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 }, +{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 }, +{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 }, +{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 }, +{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 }, +{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 }, +{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 }, +{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 }, +{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 }, +{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 }, +{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 }, +{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 }, +{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 }, +{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 }, +{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 }, +{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 }, +{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 }, +{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 }, +{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 }, +{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 }, +{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 }, +{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 }, +{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 }, +{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 }, +{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 }, +{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 }, +{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 }, +{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 }, +{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 }, +{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 }, +{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 }, +{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 }, +{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 }, +{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 }, +{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 }, +{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 }, +{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 }, +{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 }, +{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 }, +{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 }, +{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 }, +{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 }, +{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 }, +{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 }, +{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 }, +{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 }, +{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 }, +{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 }, +{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 }, +{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 }, +{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 }, +{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 }, +{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 }, +{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 }, +{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 }, +{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 }, +{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 }, +{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 }, +{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 }, +{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 }, +{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 }, +{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 }, +{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 }, +{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 }, +{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 }, +{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 }, +{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 }, +{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 }, +{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 }, +{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 }, +{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 }, +{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, +{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, +{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x20 }, +{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x20 }, +{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, +{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, +{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, +{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, +{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, +{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, +{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, +{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, +{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, +{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, +{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, +{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, +{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, +{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, +{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, +{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, +{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, +{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, +{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, +{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, +{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, +{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, +{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, +{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, +{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, +{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, +{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 }, +{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 }, +{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 }, +{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c }, +{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c }, +{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x60 }, +{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 }, +{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 }, +{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 }, +{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 }, +{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 }, +{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 }, +{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 }, +{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 }, +{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 }, +{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 }, +{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 }, +{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 }, +{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, +{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, +{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 }, +{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 }, +{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a }, +{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 }, +{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 }, +{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 }, +{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, +{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, +{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, +{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 }, +{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 }, +{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 }, +{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 }, +{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x80 }, +{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x50 }, +{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 }, +{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 }, +{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, +{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 }, +{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 }, +{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 }, +{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 }, +{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 }, +{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 }, +{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 }, +{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 }, +{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 }, +{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 }, +{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 }, +{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 }, +{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 }, +{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 }, +{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 }, +{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 }, +{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 }, +{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 }, +{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 }, +{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 }, +{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 }, +{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 }, +{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 }, +{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 }, +{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 }, +{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 }, +{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 }, +{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 }, +{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 }, +{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 }, +{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 }, +{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 }, +{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 }, +{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 }, +{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 }, +{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 }, +{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 }, +{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 }, +{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 }, +{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 }, +{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 }, +{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 }, +{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 }, +{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 }, +{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 }, +{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 }, +{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 }, +{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 }, +{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 }, +{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 }, +{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 }, +{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 }, +{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 }, +{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 }, +{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 }, +{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 }, +{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 }, +{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 }, +{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 }, +{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 }, +{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 }, +{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 }, +{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 }, +{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 }, +{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 }, +{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 }, +{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 }, +{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 }, +{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 }, +{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, +{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, +{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, +{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, +{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 }, +{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 }, +{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x80 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, +{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, +{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, +{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 }, +{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 }, +{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 }, +{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 }, +{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 }, +{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 }, +{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c }, +{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 }, +{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 }, +{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 }, +{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 }, +{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c }, +{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c }, +{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 }, +{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 }, +{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, +{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, +{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, +{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, +{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 }, +{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 }, +{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 }, +{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 }, +{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 }, +{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 }, +{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 }, +{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 }, +{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 }, +{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 }, +{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 }, +{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 }, +{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 }, +{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 }, +{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 }, +{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 }, +{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 }, +{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 }, +{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 }, +{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 }, +{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 }, +{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 }, +{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 }, +{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x48 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c8 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c8 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x10 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x25c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x25c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x6c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x84 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x20 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x24 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x58 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD", _IOC_WRITE, 0x5402, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x20 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 }, +{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 }, +{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, +{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, +{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, +{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, +{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 }, +{ "video/mbxfb.h", "MBXFB_IOCG_ALPHA", _IOC_READ, 0xf401, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_ALPHA", _IOC_WRITE, 0xf402, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_PLANEORDER", _IOC_READ, 0xf403, 0x02 }, +{ "video/mbxfb.h", "MBXFB_IOCS_REG", _IOC_WRITE, 0xf404, 0x0c }, +{ "video/mbxfb.h", "MBXFB_IOCX_OVERLAY", _IOC_READ|_IOC_WRITE, 0xf400, 0x30 }, +{ "video/mbxfb.h", "MBXFB_IOCX_REG", _IOC_READ|_IOC_WRITE, 0xf405, 0x0c }, +{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c }, +{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 }, +{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 }, +{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 }, diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h new file mode 100644 index 00000000..63162356 --- /dev/null +++ b/linux/32/syscallent.h @@ -0,0 +1,286 @@ +#ifndef sys_ARCH_mmap +# define sys_ARCH_mmap sys_mmap +#endif +[ 0] = { 2, TM, SEN(io_setup), "io_setup" }, +[ 1] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[ 2] = { 3, 0, SEN(io_submit), "io_submit" }, +[ 3] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[ 4] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[ 5] = { 5, TF, SEN(setxattr), "setxattr" }, +[ 6] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[ 7] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[ 8] = { 4, TF, SEN(getxattr), "getxattr" }, +[ 9] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[ 10] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[ 11] = { 3, TF, SEN(listxattr), "listxattr" }, +[ 12] = { 3, TF, SEN(listxattr), "llistxattr" }, +[ 13] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[ 14] = { 2, TF, SEN(removexattr), "removexattr" }, +[ 15] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[ 16] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[ 17] = { 2, TF, SEN(getcwd), "getcwd" }, +[ 18] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[ 19] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[ 20] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[ 21] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[ 22] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[ 23] = { 1, TD, SEN(dup), "dup" }, +[ 24] = { 3, TD, SEN(dup3), "dup3" }, +[ 25] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[ 26] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[ 27] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[ 28] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[ 29] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 30] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[ 31] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[ 32] = { 2, TD, SEN(flock), "flock" }, +[ 33] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[ 34] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[ 35] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[ 36] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[ 37] = { 5, TD|TF, SEN(linkat), "linkat" }, +[ 38] = { 4, TD|TF, SEN(renameat), "renameat" }, +[ 39] = { 2, TF, SEN(umount2), "umount2" }, +[ 40] = { 5, TF, SEN(mount), "mount" }, +[ 41] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[ 42] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[ 43] = { 3, TF, SEN(statfs64), "statfs64" }, +[ 44] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[ 45] = { 3, TF, SEN(truncate64), "truncate64" }, +[ 46] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[ 47] = { 6, TD, SEN(fallocate), "fallocate" }, +[ 48] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[ 49] = { 1, TF, SEN(chdir), "chdir" }, +[ 50] = { 1, TD, SEN(fchdir), "fchdir" }, +[ 51] = { 1, TF, SEN(chroot), "chroot" }, +[ 52] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 53] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[ 54] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[ 55] = { 3, TD, SEN(fchown), "fchown" }, +[ 56] = { 4, TD|TF, SEN(openat), "openat" }, +[ 57] = { 1, TD, SEN(close), "close" }, +[ 58] = { 0, 0, SEN(vhangup), "vhangup" }, +[ 59] = { 2, TD, SEN(pipe2), "pipe2" }, +[ 60] = { 4, TF, SEN(quotactl), "quotactl" }, +[ 61] = { 3, TD, SEN(getdents64), "getdents64" }, +[ 62] = { 5, TD, SEN(llseek), "_llseek" }, +[ 63] = { 3, TD, SEN(read), "read" }, +[ 64] = { 3, TD, SEN(write), "write" }, +[ 65] = { 3, TD, SEN(readv), "readv" }, +[ 66] = { 3, TD, SEN(writev), "writev" }, +[ 67] = { 5, TD, SEN(pread), "pread64" }, +[ 68] = { 5, TD, SEN(pwrite), "pwrite64" }, +[ 69] = { 5, TD, SEN(preadv), "preadv" }, +[ 70] = { 5, TD, SEN(pwritev), "pwritev" }, +[ 71] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[ 72] = { 6, TD, SEN(pselect6), "pselect6" }, +[ 73] = { 5, TD, SEN(ppoll), "ppoll" }, +[ 74] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[ 75] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[ 76] = { 6, TD, SEN(splice), "splice" }, +[ 77] = { 4, TD, SEN(tee), "tee" }, +[ 78] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[ 79] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[ 80] = { 2, TD, SEN(fstat64), "fstat64" }, +[ 81] = { 0, 0, SEN(sync), "sync" }, +[ 82] = { 1, TD, SEN(fsync), "fsync" }, +[ 83] = { 1, TD, SEN(fdatasync), "fdatasync" }, +#ifdef ARCH_WANT_SYNC_FILE_RANGE2 +[ 84] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" }, +#else +[ 84] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +#endif +[ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[ 86] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[ 87] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[ 88] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[ 89] = { 1, TF, SEN(acct), "acct" }, +[ 90] = { 2, 0, SEN(capget), "capget" }, +[ 91] = { 2, 0, SEN(capset), "capset" }, +[ 92] = { 1, NF, SEN(personality), "personality" }, +[ 93] = { 1, TP|SE, SEN(exit), "exit" }, +[ 94] = { 1, TP|SE, SEN(exit), "exit_group" }, +[ 95] = { 5, TP, SEN(waitid), "waitid" }, +[ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[ 97] = { 1, TP, SEN(unshare), "unshare" }, +[ 98] = { 6, 0, SEN(futex), "futex" }, +[ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[100] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[101] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[102] = { 2, 0, SEN(getitimer), "getitimer" }, +[103] = { 3, 0, SEN(setitimer), "setitimer" }, +[104] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[105] = { 3, 0, SEN(init_module), "init_module" }, +[106] = { 2, 0, SEN(delete_module), "delete_module" }, +[107] = { 3, 0, SEN(timer_create), "timer_create" }, +[108] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[109] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[110] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[111] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[112] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[113] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[114] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[115] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[116] = { 3, 0, SEN(syslog), "syslog" }, +[117] = { 4, 0, SEN(ptrace), "ptrace" }, +[118] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[119] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[120] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[121] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[122] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[123] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[124] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[125] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[126] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[127] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[128] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[129] = { 2, TS, SEN(kill), "kill" }, +[130] = { 2, TS, SEN(kill), "tkill" }, +[131] = { 3, TS, SEN(tgkill), "tgkill" }, +[132] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[133] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[134] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[135] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[136] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[137] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[138] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[139] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[140] = { 3, 0, SEN(setpriority), "setpriority" }, +[141] = { 2, 0, SEN(getpriority), "getpriority" }, +[142] = { 4, 0, SEN(reboot), "reboot" }, +[143] = { 2, 0, SEN(setregid), "setregid" }, +[144] = { 1, 0, SEN(setgid), "setgid" }, +[145] = { 2, 0, SEN(setreuid), "setreuid" }, +[146] = { 1, 0, SEN(setuid), "setuid" }, +[147] = { 3, 0, SEN(setresuid), "setresuid" }, +[148] = { 3, 0, SEN(getresuid), "getresuid" }, +[149] = { 3, 0, SEN(setresgid), "setresgid" }, +[150] = { 3, 0, SEN(getresgid), "getresgid" }, +[151] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[152] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[153] = { 1, 0, SEN(times), "times" }, +[154] = { 2, 0, SEN(setpgid), "setpgid" }, +[155] = { 1, 0, SEN(getpgid), "getpgid" }, +[156] = { 1, 0, SEN(getsid), "getsid" }, +[157] = { 0, 0, SEN(setsid), "setsid" }, +[158] = { 2, 0, SEN(getgroups), "getgroups" }, +[159] = { 2, 0, SEN(setgroups), "setgroups" }, +[160] = { 1, 0, SEN(uname), "uname" }, +[161] = { 2, 0, SEN(sethostname), "sethostname" }, +[162] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[163] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[164] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[165] = { 2, 0, SEN(getrusage), "getrusage" }, +[166] = { 1, NF, SEN(umask), "umask" }, +[167] = { 5, 0, SEN(prctl), "prctl" }, +[168] = { 3, 0, SEN(getcpu), "getcpu" }, +[169] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[170] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[171] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[172] = { 0, NF, SEN(getpid), "getpid" }, +[173] = { 0, NF, SEN(getppid), "getppid" }, +[174] = { 0, NF, SEN(getuid), "getuid" }, +[175] = { 0, NF, SEN(geteuid), "geteuid" }, +[176] = { 0, NF, SEN(getgid), "getgid" }, +[177] = { 0, NF, SEN(getegid), "getegid" }, +[178] = { 0, NF, SEN(gettid), "gettid" }, +[179] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[180] = { 4, 0, SEN(mq_open), "mq_open" }, +[181] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[182] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[183] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[184] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[185] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[186] = { 2, TI, SEN(msgget), "msgget" }, +[187] = { 3, TI, SEN(msgctl), "msgctl" }, +[188] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[189] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[190] = { 3, TI, SEN(semget), "semget" }, +[191] = { 4, TI, SEN(semctl), "semctl" }, +[192] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[193] = { 3, TI, SEN(semop), "semop" }, +[194] = { 3, TI, SEN(shmget), "shmget" }, +[195] = { 3, TI, SEN(shmctl), "shmctl" }, +[196] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[197] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[198] = { 3, TN, SEN(socket), "socket" }, +[199] = { 4, TN, SEN(socketpair), "socketpair" }, +[200] = { 3, TN, SEN(bind), "bind" }, +[201] = { 2, TN, SEN(listen), "listen" }, +[202] = { 3, TN, SEN(accept), "accept" }, +[203] = { 3, TN, SEN(connect), "connect" }, +[204] = { 3, TN, SEN(getsockname), "getsockname" }, +[205] = { 3, TN, SEN(getpeername), "getpeername" }, +[206] = { 6, TN, SEN(sendto), "sendto" }, +[207] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[208] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[209] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[210] = { 2, TN, SEN(shutdown), "shutdown" }, +[211] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[212] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[213] = { 4, TD, SEN(readahead), "readahead" }, +[214] = { 1, TM|SI, SEN(brk), "brk" }, +[215] = { 2, TM|SI, SEN(munmap), "munmap" }, +[216] = { 5, TM|SI, SEN(mremap), "mremap" }, +[217] = { 5, 0, SEN(add_key), "add_key" }, +[218] = { 4, 0, SEN(request_key), "request_key" }, +[219] = { 5, 0, SEN(keyctl), "keyctl" }, +[220] = { 5, TP, SEN(clone), "clone" }, +[221] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[222] = { 6, TD|TM|SI, SEN(ARCH_mmap), "mmap2" }, +[223] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[224] = { 2, TF, SEN(swapon), "swapon" }, +[225] = { 1, TF, SEN(swapoff), "swapoff" }, +[226] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[227] = { 3, TM, SEN(msync), "msync" }, +[228] = { 2, TM, SEN(mlock), "mlock" }, +[229] = { 2, TM, SEN(munlock), "munlock" }, +[230] = { 1, TM, SEN(mlockall), "mlockall" }, +[231] = { 0, TM, SEN(munlockall), "munlockall" }, +[232] = { 3, TM, SEN(mincore), "mincore" }, +[233] = { 3, TM, SEN(madvise), "madvise" }, +[234] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[235] = { 6, TM, SEN(mbind), "mbind" }, +[236] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[237] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[238] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[239] = { 6, TM, SEN(move_pages), "move_pages" }, +[240] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[241] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[242] = { 4, TN, SEN(accept4), "accept4" }, +[243] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +/* [244 ... 259] are arch specific */ +[260] = { 4, TP, SEN(wait4), "wait4" }, +[261] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[262] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[263] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[264] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[265] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[266] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[267] = { 1, TD, SEN(syncfs), "syncfs" }, +[268] = { 2, TD, SEN(setns), "setns" }, +[269] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[270] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[271] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[272] = { 5, 0, SEN(kcmp), "kcmp" }, +[273] = { 3, TD, SEN(finit_module), "finit_module" }, +[274] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[275] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[276] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[277] = { 3, 0, SEN(seccomp), "seccomp" }, +[278] = { 3, 0, SEN(getrandom), "getrandom" }, +[279] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[280] = { 3, TD, SEN(bpf), "bpf" }, +[281] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[282] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[283] = { 2, 0, SEN(membarrier), "membarrier" }, +[284] = { 3, TM, SEN(mlock2), "mlock2" }, +[285] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[286] = { 6, TD, SEN(preadv2), "preadv2" }, +[287] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[290] = { 1, 0, SEN(pkey_free), "pkey_free" }, + +#undef sys_ARCH_mmap +#undef ARCH_WANT_SYNC_FILE_RANGE2 diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h new file mode 100644 index 00000000..f59fe111 --- /dev/null +++ b/linux/64/ioctls_inc.h @@ -0,0 +1,2729 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */ +{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 }, +{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 }, +{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 }, +{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 }, +{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 }, +{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 }, +{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 }, +{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 }, +{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 }, +{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 }, +{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 }, +{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 }, +{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 }, +{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 }, +{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 }, +{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 }, +{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 }, +{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 }, +{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 }, +{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 }, +{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 }, +{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 }, +{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x38 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0xf8 }, +{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x20 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x20 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x80 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x28 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x10 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x78 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x78 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x28 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x38 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x60 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x20 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x20 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x30 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x20 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x20 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x28 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x18 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x08 }, +{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x08 }, +{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 }, +{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c }, +{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 }, +{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 }, +{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 }, +{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 }, +{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 }, +{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 }, +{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 }, +{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, +{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, +{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, +{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, +{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, +{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 }, +{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 }, +{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 }, +{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 }, +{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 }, +{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x18 }, +{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 }, +{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 }, +{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 }, +{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 }, +{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 }, +{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 }, +{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 }, +{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 }, +{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 }, +{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 }, +{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, +{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x08 }, +{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x10 }, +{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x10 }, +{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x10 }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x10 }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x10 }, +{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 }, +{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x10 }, +{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x10 }, +{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 }, +{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 }, +{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 }, +{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x10 }, +{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x10 }, +{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x10 }, +{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 }, +{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 }, +{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 }, +{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 }, +{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c }, +{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 }, +{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x10 }, +{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x10 }, +{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x10 }, +{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x10 }, +{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x10 }, +{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 }, +{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x10 }, +{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x10 }, +{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x10 }, +{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x10 }, +{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x10 }, +{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x10 }, +{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x10 }, +{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x10 }, +{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x10 }, +{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x10 }, +{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 }, +{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x10 }, +{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x10 }, +{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 }, +{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x10 }, +{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x10 }, +{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x10 }, +{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x10 }, +{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 }, +{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 }, +{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x08 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, +{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, +{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, +{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 }, +{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 }, +{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 }, +{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 }, +{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 }, +{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 }, +{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 }, +{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 }, +{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 }, +{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 }, +{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 }, +{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x10 }, +{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 }, +{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 }, +{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c }, +{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x60 }, +{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c }, +{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 }, +{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x58 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 }, +{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 }, +{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 }, +{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 }, +{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 }, +{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 }, +{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 }, +{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 }, +{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 }, +{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 }, +{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 }, +{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 }, +{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 }, +{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 }, +{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 }, +{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 }, +{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 }, +{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 }, +{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 }, +{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 }, +{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 }, +{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 }, +{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 }, +{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 }, +{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 }, +{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 }, +{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 }, +{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 }, +{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 }, +{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 }, +{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 }, +{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 }, +{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 }, +{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 }, +{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 }, +{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 }, +{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 }, +{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 }, +{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 }, +{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 }, +{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c }, +{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 }, +{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 }, +{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 }, +{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 }, +{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 }, +{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 }, +{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 }, +{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c }, +{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c }, +{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 }, +{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 }, +{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x10 }, +{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 }, +{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 }, +{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 }, +{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c }, +{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 }, +{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x08 }, +{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x08 }, +{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x08 }, +{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x08 }, +{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x08 }, +{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 }, +{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 }, +{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 }, +{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 }, +{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dn.h", "SIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "SIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, +{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, +{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, +{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 }, +{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 }, +{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 }, +{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c }, +{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c }, +{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, +{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, +{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, +{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, +{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, +{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, +{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, +{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 }, +{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 }, +{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 }, +{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 }, +{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 }, +{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 }, +{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x10 }, +{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x10 }, +{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 }, +{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 }, +{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 }, +{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x10 }, +{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x20 }, +{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 }, +{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x20 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, +{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, +{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, +{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x10 }, +{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x10 }, +{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 }, +{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 }, +{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 }, +{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 }, +{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 }, +{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 }, +{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 }, +{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 }, +{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 }, +{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 }, +{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 }, +{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 }, +{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 }, +{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 }, +{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 }, +{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 }, +{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x68 }, +{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 }, +{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 }, +{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 }, +{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x20 }, +{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 }, +{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 }, +{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 }, +{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 }, +{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c }, +{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x80 }, +{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x50 }, +{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 }, +{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x28 }, +{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 }, +{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x20 }, +{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 }, +{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 }, +{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x50 }, +{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 }, +{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 }, +{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x80 }, +{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 }, +{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 }, +{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x20 }, +{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 }, +{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 }, +{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, +{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x08 }, +{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x08 }, +{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 }, +{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 }, +{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 }, +{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 }, +{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x08 }, +{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 }, +{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 }, +{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 }, +{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 }, +{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 }, +{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 }, +{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 }, +{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 }, +{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 }, +{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 }, +{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 }, +{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 }, +{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 }, +{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x48 }, +{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 }, +{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 }, +{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 }, +{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 }, +{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 }, +{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 }, +{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 }, +{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 }, +{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 }, +{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 }, +{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, +{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, +{ "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x08 }, +{ "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x08 }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, +{ "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x08 }, +{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x08 }, +{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 }, +{ "linux/gigaset_dev.h", "GIGASET_BRKCHARS", _IOC_WRITE, 0x4702, 0x06 }, +{ "linux/gigaset_dev.h", "GIGASET_CONFIG", _IOC_READ|_IOC_WRITE, 0x4701, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_REDIR", _IOC_READ|_IOC_WRITE, 0x4700, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_VERSION", _IOC_READ|_IOC_WRITE, 0x4703, 0x10 }, +{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 }, +{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 }, +{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 }, +{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 }, +{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c }, +{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 }, +{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 }, +{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 }, +{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c }, +{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c }, +{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 }, +{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 }, +{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 }, +{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 }, +{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 }, +{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 }, +{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 }, +{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 }, +{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 }, +{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 }, +{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 }, +{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 }, +{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 }, +{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 }, +{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 }, +{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 }, +{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 }, +{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 }, +{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 }, +{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 }, +{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 }, +{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 }, +{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 }, +{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 }, +{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 }, +{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c }, +{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 }, +{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 }, +{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 }, +{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c }, +{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 }, +{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 }, +{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c }, +{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 }, +{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c }, +{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 }, +{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 }, +{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 }, +{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 }, +{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 }, +{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 }, +{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x18 }, +{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x08 }, +{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 }, +{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 }, +{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 }, +{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 }, +{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c }, +{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 }, +{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x18 }, +{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x30 }, +{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x18 }, +{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x28 }, +{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x28 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU", _IOC_READ, 0x690c, 0x10 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x30 }, +{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x30 }, +{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x30 }, +{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 }, +{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 }, +{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x08 }, +{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x08 }, +{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x08 }, +{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x08 }, +{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 }, +{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x08 }, +{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x08 }, +{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x08 }, +{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x10 }, +{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x10 }, +{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 }, +{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x10 }, +{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 }, +{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, +{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 }, +{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 }, +{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 }, +{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 }, +{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, +{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, +{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, +{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, +{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 }, +{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 }, +{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 }, +{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 }, +{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 }, +{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 }, +{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 }, +{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x30 }, +{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 }, +{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x30 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x30 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x28 }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x30 }, +{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, +{ "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, +{ "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, +{ "linux/isdn.h", "IIOCGETDVR", _IOC_NONE, 0x4916, 0x00 }, +{ "linux/isdn.h", "IIOCGETMAP", _IOC_NONE, 0x4911, 0x00 }, +{ "linux/isdn.h", "IIOCGETPRF", _IOC_NONE, 0x490f, 0x00 }, +{ "linux/isdn.h", "IIOCGETSET", _IOC_NONE, 0x4908, 0x00 }, +{ "linux/isdn.h", "IIOCNETAIF", _IOC_NONE, 0x4901, 0x00 }, +{ "linux/isdn.h", "IIOCNETALN", _IOC_NONE, 0x4920, 0x00 }, +{ "linux/isdn.h", "IIOCNETANM", _IOC_NONE, 0x4905, 0x00 }, +{ "linux/isdn.h", "IIOCNETASL", _IOC_NONE, 0x4913, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIF", _IOC_NONE, 0x4902, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIL", _IOC_NONE, 0x4914, 0x00 }, +{ "linux/isdn.h", "IIOCNETDLN", _IOC_NONE, 0x4921, 0x00 }, +{ "linux/isdn.h", "IIOCNETDNM", _IOC_NONE, 0x4906, 0x00 }, +{ "linux/isdn.h", "IIOCNETDWRSET", _IOC_NONE, 0x4918, 0x00 }, +{ "linux/isdn.h", "IIOCNETGCF", _IOC_NONE, 0x4904, 0x00 }, +{ "linux/isdn.h", "IIOCNETGNM", _IOC_NONE, 0x4907, 0x00 }, +{ "linux/isdn.h", "IIOCNETGPN", _IOC_NONE, 0x4922, 0x00 }, +{ "linux/isdn.h", "IIOCNETHUP", _IOC_NONE, 0x490b, 0x00 }, +{ "linux/isdn.h", "IIOCNETLCR", _IOC_NONE, 0x4917, 0x00 }, +{ "linux/isdn.h", "IIOCNETSCF", _IOC_NONE, 0x4903, 0x00 }, +{ "linux/isdn.h", "IIOCSETBRJ", _IOC_NONE, 0x490d, 0x00 }, +{ "linux/isdn.h", "IIOCSETGST", _IOC_NONE, 0x490c, 0x00 }, +{ "linux/isdn.h", "IIOCSETMAP", _IOC_NONE, 0x4912, 0x00 }, +{ "linux/isdn.h", "IIOCSETPRF", _IOC_NONE, 0x4910, 0x00 }, +{ "linux/isdn.h", "IIOCSETSET", _IOC_NONE, 0x4909, 0x00 }, +{ "linux/isdn.h", "IIOCSETVER", _IOC_NONE, 0x490a, 0x00 }, +{ "linux/isdn.h", "IIOCSIGPRF", _IOC_NONE, 0x490e, 0x00 }, +{ "linux/isdn_ppp.h", "PPPIOCBUNDLE", _IOC_WRITE, 0x7481, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCGCALLINFO", _IOC_READ|_IOC_WRITE, 0x7480, 0x88 }, +{ "linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", _IOC_READ, 0x7486, 0x40 }, +{ "linux/isdn_ppp.h", "PPPIOCGIFNAME", _IOC_READ, 0x7488, 0x10 }, +{ "linux/isdn_ppp.h", "PPPIOCGMPFLAGS", _IOC_READ, 0x7482, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", _IOC_WRITE, 0x7487, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPFLAGS", _IOC_WRITE, 0x7483, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMRU", _IOC_WRITE, 0x7485, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMTU", _IOC_WRITE, 0x7484, 0x04 }, +{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x40 }, +{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x18 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x08 }, +{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x08 }, +{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, +{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, +{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, +{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 }, +{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 }, +{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 }, +{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 }, +{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 }, +{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 }, +{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 }, +{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 }, +{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x08 }, +{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 }, +{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 }, +{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 }, +{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 }, +{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 }, +{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 }, +{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 }, +{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 }, +{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 }, +{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 }, +{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 }, +{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 }, +{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 }, +{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 }, +{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 }, +{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 }, +{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 }, +{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 }, +{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 }, +{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 }, +{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 }, +{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 }, +{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 }, +{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 }, +{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 }, +{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 }, +{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 }, +{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 }, +{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 }, +{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 }, +{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 }, +{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 }, +{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 }, +{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 }, +{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 }, +{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 }, +{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 }, +{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 }, +{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 }, +{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 }, +{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 }, +{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 }, +{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 }, +{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, +{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, +{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, +{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, +{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, +{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 }, +{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 }, +{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 }, +{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 }, +{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 }, +{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 }, +{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 }, +{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 }, +{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, +{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, +{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, +{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, +{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, +{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 }, +{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 }, +{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 }, +{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 }, +{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 }, +{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 }, +{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x08 }, +{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x08 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x08 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x08 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x08 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x08 }, +{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x28 }, +{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, +{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 }, +{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 }, +{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 }, +{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 }, +{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 }, +{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_ADD_DEVICE", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_CONFIG_CHANGE", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_COPY_DESC", _IOC_READ|_IOC_WRITE, 0x7302, 0x08 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x230 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x230 }, +{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x30 }, +{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x08 }, +{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 }, +{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 }, +{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 }, +{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 }, +{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 }, +{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 }, +{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 }, +{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, +{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x18 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x10 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x30 }, +{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, +{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x10 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x18 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x10 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, +{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 }, +{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, +{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x30 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 }, +{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 }, +{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x38 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x70 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x08 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x28 }, +{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, +{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c }, +{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x18 }, +{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 }, +{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 }, +{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 }, +{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 }, +{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x08 }, +{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x08 }, +{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 }, +{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 }, +{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x08 }, +{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x08 }, +{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 }, +{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c }, +{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x08 }, +{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x08 }, +{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x08 }, +{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x08 }, +{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x08 }, +{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x08 }, +{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 }, +{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 }, +{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 }, +{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 }, +{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 }, +{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 }, +{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 }, +{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 }, +{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 }, +{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 }, +{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x10 }, +{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 }, +{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 }, +{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 }, +{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 }, +{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 }, +{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 }, +{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 }, +{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 }, +{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x10 }, +{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 }, +{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 }, +{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 }, +{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGIDLE", _IOC_READ, 0x743f, 0x10 }, +{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 }, +{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x10 }, +{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x10 }, +{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x10 }, +{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 }, +{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x08 }, +{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x08 }, +{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x08 }, +{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x08 }, +{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x08 }, +{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 }, +{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 }, +{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 }, +{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, +{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, +{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, +{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, +{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, +{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 }, +{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, +{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, +{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x08 }, +{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x08 }, +{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 }, +{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 }, +{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 }, +{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 }, +{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 }, +{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 }, +{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 }, +{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 }, +{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 }, +{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 }, +{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 }, +{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c }, +{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 }, +{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c }, +{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 }, +{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 }, +{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 }, +{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 }, +{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 }, +{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 }, +{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 }, +{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 }, +{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, +{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, +{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, +{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, +{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, +{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x08 }, +{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, +{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, +{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, +{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 }, +{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x08 }, +{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x08 }, +{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x08 }, +{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x08 }, +{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 }, +{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 }, +{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x20 }, +{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x20 }, +{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 }, +{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 }, +{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 }, +{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 }, +{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 }, +{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 }, +{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 }, +{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 }, +{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 }, +{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x08 }, +{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, +{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, +{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 }, +{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 }, +{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 }, +{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 }, +{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 }, +{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 }, +{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 }, +{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 }, +{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 }, +{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 }, +{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 }, +{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 }, +{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 }, +{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 }, +{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 }, +{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 }, +{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 }, +{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 }, +{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 }, +{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 }, +{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 }, +{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 }, +{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 }, +{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 }, +{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 }, +{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 }, +{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 }, +{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 }, +{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 }, +{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 }, +{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 }, +{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 }, +{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 }, +{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 }, +{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 }, +{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 }, +{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 }, +{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 }, +{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 }, +{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 }, +{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 }, +{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 }, +{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 }, +{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 }, +{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 }, +{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 }, +{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 }, +{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 }, +{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 }, +{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 }, +{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 }, +{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 }, +{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 }, +{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 }, +{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 }, +{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 }, +{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 }, +{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 }, +{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 }, +{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 }, +{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 }, +{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 }, +{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 }, +{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 }, +{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 }, +{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 }, +{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 }, +{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 }, +{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 }, +{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 }, +{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 }, +{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 }, +{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 }, +{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 }, +{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 }, +{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 }, +{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 }, +{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 }, +{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 }, +{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 }, +{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 }, +{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 }, +{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 }, +{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 }, +{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, +{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, +{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x30 }, +{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x30 }, +{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, +{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, +{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, +{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x08 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x08 }, +{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, +{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, +{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, +{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, +{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, +{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, +{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, +{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, +{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, +{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x08 }, +{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, +{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, +{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, +{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, +{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x08 }, +{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, +{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, +{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, +{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, +{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, +{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, +{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x08 }, +{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x08 }, +{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x08 }, +{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, +{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, +{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x68 }, +{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 }, +{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 }, +{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c }, +{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c }, +{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x68 }, +{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 }, +{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 }, +{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 }, +{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 }, +{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 }, +{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 }, +{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 }, +{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x08 }, +{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 }, +{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 }, +{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 }, +{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 }, +{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, +{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, +{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 }, +{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x08 }, +{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x08 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x18 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL", _IOC_READ|_IOC_WRITE, 0x5500, 0x18 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", _IOC_READ, 0x550e, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB", _IOC_WRITE, 0x550c, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", _IOC_WRITE, 0x550d, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x38 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a }, +{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 }, +{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 }, +{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 }, +{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x60 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x10 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x28 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x28 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, +{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, +{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, +{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 }, +{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 }, +{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 }, +{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0x100 }, +{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x58 }, +{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x88 }, +{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x50 }, +{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 }, +{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x30 }, +{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xd0 }, +{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 }, +{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x58 }, +{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x58 }, +{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x58 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, +{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x30 }, +{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xd0 }, +{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 }, +{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xd0 }, +{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 }, +{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 }, +{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 }, +{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 }, +{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 }, +{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 }, +{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 }, +{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 }, +{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 }, +{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 }, +{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 }, +{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 }, +{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 }, +{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 }, +{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 }, +{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 }, +{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 }, +{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 }, +{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 }, +{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 }, +{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 }, +{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 }, +{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 }, +{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 }, +{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 }, +{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 }, +{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 }, +{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 }, +{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 }, +{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 }, +{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 }, +{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 }, +{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 }, +{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 }, +{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 }, +{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 }, +{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 }, +{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 }, +{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 }, +{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 }, +{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 }, +{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 }, +{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 }, +{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 }, +{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 }, +{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 }, +{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 }, +{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 }, +{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 }, +{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 }, +{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 }, +{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 }, +{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 }, +{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 }, +{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 }, +{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 }, +{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 }, +{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 }, +{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 }, +{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 }, +{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 }, +{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 }, +{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 }, +{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 }, +{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 }, +{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 }, +{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 }, +{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 }, +{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, +{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, +{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, +{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x08 }, +{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, +{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 }, +{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x10 }, +{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x88 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, +{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, +{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, +{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 }, +{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 }, +{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 }, +{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 }, +{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 }, +{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 }, +{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x10 }, +{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 }, +{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 }, +{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 }, +{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x10 }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 }, +{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c }, +{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c }, +{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 }, +{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 }, +{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, +{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, +{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, +{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, +{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x08 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x08 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 }, +{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 }, +{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 }, +{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 }, +{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 }, +{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 }, +{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 }, +{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 }, +{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 }, +{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 }, +{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 }, +{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 }, +{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 }, +{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 }, +{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 }, +{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 }, +{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 }, +{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 }, +{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 }, +{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 }, +{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 }, +{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 }, +{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 }, +{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa8 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa8 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa8 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa8 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa8 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x50 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x4c8 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x4c8 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x60 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x18 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x08 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x08 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x260 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x260 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x18 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x18 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x08 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x98 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x98 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x88 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x88 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x18 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x18 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x30 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x38 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xf8 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x48 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x50 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe8 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x60 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD", _IOC_WRITE, 0x5402, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x1b0 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x1b0 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x10 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x10 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x08 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x08 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x20 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 }, +{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 }, +{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x08 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x08 }, +{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x20 }, +{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x10 }, +{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, +{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, +{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, +{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 }, +{ "video/mbxfb.h", "MBXFB_IOCG_ALPHA", _IOC_READ, 0xf401, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_ALPHA", _IOC_WRITE, 0xf402, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_PLANEORDER", _IOC_READ, 0xf403, 0x02 }, +{ "video/mbxfb.h", "MBXFB_IOCS_REG", _IOC_WRITE, 0xf404, 0x0c }, +{ "video/mbxfb.h", "MBXFB_IOCX_OVERLAY", _IOC_READ|_IOC_WRITE, 0xf400, 0x30 }, +{ "video/mbxfb.h", "MBXFB_IOCX_REG", _IOC_READ|_IOC_WRITE, 0xf405, 0x0c }, +{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c }, +{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 }, +{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 }, +{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x10 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 }, diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h new file mode 100644 index 00000000..598d942c --- /dev/null +++ b/linux/64/syscallent.h @@ -0,0 +1,276 @@ +[ 0] = { 2, TM, SEN(io_setup), "io_setup" }, +[ 1] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[ 2] = { 3, 0, SEN(io_submit), "io_submit" }, +[ 3] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[ 4] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[ 5] = { 5, TF, SEN(setxattr), "setxattr" }, +[ 6] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[ 7] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[ 8] = { 4, TF, SEN(getxattr), "getxattr" }, +[ 9] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[ 10] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[ 11] = { 3, TF, SEN(listxattr), "listxattr" }, +[ 12] = { 3, TF, SEN(listxattr), "llistxattr" }, +[ 13] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[ 14] = { 2, TF, SEN(removexattr), "removexattr" }, +[ 15] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[ 16] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[ 17] = { 2, TF, SEN(getcwd), "getcwd" }, +[ 18] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[ 19] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[ 20] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[ 21] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[ 22] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[ 23] = { 1, TD, SEN(dup), "dup" }, +[ 24] = { 3, TD, SEN(dup3), "dup3" }, +[ 25] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 26] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[ 27] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[ 28] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[ 29] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 30] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[ 31] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[ 32] = { 2, TD, SEN(flock), "flock" }, +[ 33] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[ 34] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[ 35] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[ 36] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[ 37] = { 5, TD|TF, SEN(linkat), "linkat" }, +[ 38] = { 4, TD|TF, SEN(renameat), "renameat" }, +[ 39] = { 2, TF, SEN(umount2), "umount2" }, +[ 40] = { 5, TF, SEN(mount), "mount" }, +[ 41] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[ 42] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[ 43] = { 2, TF, SEN(statfs), "statfs" }, +[ 44] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 45] = { 2, TF, SEN(truncate), "truncate" }, +[ 46] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 47] = { 4, TD, SEN(fallocate), "fallocate" }, +[ 48] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[ 49] = { 1, TF, SEN(chdir), "chdir" }, +[ 50] = { 1, TD, SEN(fchdir), "fchdir" }, +[ 51] = { 1, TF, SEN(chroot), "chroot" }, +[ 52] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 53] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[ 54] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[ 55] = { 3, TD, SEN(fchown), "fchown" }, +[ 56] = { 4, TD|TF, SEN(openat), "openat" }, +[ 57] = { 1, TD, SEN(close), "close" }, +[ 58] = { 0, 0, SEN(vhangup), "vhangup" }, +[ 59] = { 2, TD, SEN(pipe2), "pipe2" }, +[ 60] = { 4, TF, SEN(quotactl), "quotactl" }, +[ 61] = { 3, TD, SEN(getdents64), "getdents64" }, +[ 62] = { 3, TD, SEN(lseek), "lseek" }, +[ 63] = { 3, TD, SEN(read), "read" }, +[ 64] = { 3, TD, SEN(write), "write" }, +[ 65] = { 3, TD, SEN(readv), "readv" }, +[ 66] = { 3, TD, SEN(writev), "writev" }, +[ 67] = { 4, TD, SEN(pread), "pread64" }, +[ 68] = { 4, TD, SEN(pwrite), "pwrite64" }, +[ 69] = { 4, TD, SEN(preadv), "preadv" }, +[ 70] = { 4, TD, SEN(pwritev), "pwritev" }, +[ 71] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, +[ 72] = { 6, TD, SEN(pselect6), "pselect6" }, +[ 73] = { 5, TD, SEN(ppoll), "ppoll" }, +[ 74] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[ 75] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[ 76] = { 6, TD, SEN(splice), "splice" }, +[ 77] = { 4, TD, SEN(tee), "tee" }, +[ 78] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[ 79] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[ 80] = { 2, TD, SEN(fstat), "fstat" }, +[ 81] = { 0, 0, SEN(sync), "sync" }, +[ 82] = { 1, TD, SEN(fsync), "fsync" }, +[ 83] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[ 84] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[ 86] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[ 87] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[ 88] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[ 89] = { 1, TF, SEN(acct), "acct" }, +[ 90] = { 2, 0, SEN(capget), "capget" }, +[ 91] = { 2, 0, SEN(capset), "capset" }, +[ 92] = { 1, NF, SEN(personality), "personality" }, +[ 93] = { 1, TP|SE, SEN(exit), "exit" }, +[ 94] = { 1, TP|SE, SEN(exit), "exit_group" }, +[ 95] = { 5, TP, SEN(waitid), "waitid" }, +[ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[ 97] = { 1, TP, SEN(unshare), "unshare" }, +[ 98] = { 6, 0, SEN(futex), "futex" }, +[ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[100] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[101] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[102] = { 2, 0, SEN(getitimer), "getitimer" }, +[103] = { 3, 0, SEN(setitimer), "setitimer" }, +[104] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[105] = { 3, 0, SEN(init_module), "init_module" }, +[106] = { 2, 0, SEN(delete_module), "delete_module" }, +[107] = { 3, 0, SEN(timer_create), "timer_create" }, +[108] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[109] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[110] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[111] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[112] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[113] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[114] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[115] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[116] = { 3, 0, SEN(syslog), "syslog" }, +[117] = { 4, 0, SEN(ptrace), "ptrace" }, +[118] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[119] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[120] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[121] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[122] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[123] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[124] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[125] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[126] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[127] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[128] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[129] = { 2, TS, SEN(kill), "kill" }, +[130] = { 2, TS, SEN(kill), "tkill" }, +[131] = { 3, TS, SEN(tgkill), "tgkill" }, +[132] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[133] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[134] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[135] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[136] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[137] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[138] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[139] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[140] = { 3, 0, SEN(setpriority), "setpriority" }, +[141] = { 2, 0, SEN(getpriority), "getpriority" }, +[142] = { 4, 0, SEN(reboot), "reboot" }, +[143] = { 2, 0, SEN(setregid), "setregid" }, +[144] = { 1, 0, SEN(setgid), "setgid" }, +[145] = { 2, 0, SEN(setreuid), "setreuid" }, +[146] = { 1, 0, SEN(setuid), "setuid" }, +[147] = { 3, 0, SEN(setresuid), "setresuid" }, +[148] = { 3, 0, SEN(getresuid), "getresuid" }, +[149] = { 3, 0, SEN(setresgid), "setresgid" }, +[150] = { 3, 0, SEN(getresgid), "getresgid" }, +[151] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[152] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[153] = { 1, 0, SEN(times), "times" }, +[154] = { 2, 0, SEN(setpgid), "setpgid" }, +[155] = { 1, 0, SEN(getpgid), "getpgid" }, +[156] = { 1, 0, SEN(getsid), "getsid" }, +[157] = { 0, 0, SEN(setsid), "setsid" }, +[158] = { 2, 0, SEN(getgroups), "getgroups" }, +[159] = { 2, 0, SEN(setgroups), "setgroups" }, +[160] = { 1, 0, SEN(uname), "uname" }, +[161] = { 2, 0, SEN(sethostname), "sethostname" }, +[162] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[163] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[164] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[165] = { 2, 0, SEN(getrusage), "getrusage" }, +[166] = { 1, NF, SEN(umask), "umask" }, +[167] = { 5, 0, SEN(prctl), "prctl" }, +[168] = { 3, 0, SEN(getcpu), "getcpu" }, +[169] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[170] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[171] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[172] = { 0, NF, SEN(getpid), "getpid" }, +[173] = { 0, NF, SEN(getppid), "getppid" }, +[174] = { 0, NF, SEN(getuid), "getuid" }, +[175] = { 0, NF, SEN(geteuid), "geteuid" }, +[176] = { 0, NF, SEN(getgid), "getgid" }, +[177] = { 0, NF, SEN(getegid), "getegid" }, +[178] = { 0, NF, SEN(gettid), "gettid" }, +[179] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[180] = { 4, 0, SEN(mq_open), "mq_open" }, +[181] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[182] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[183] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[184] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[185] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[186] = { 2, TI, SEN(msgget), "msgget" }, +[187] = { 3, TI, SEN(msgctl), "msgctl" }, +[188] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[189] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[190] = { 3, TI, SEN(semget), "semget" }, +[191] = { 4, TI, SEN(semctl), "semctl" }, +[192] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[193] = { 3, TI, SEN(semop), "semop" }, +[194] = { 3, TI, SEN(shmget), "shmget" }, +[195] = { 3, TI, SEN(shmctl), "shmctl" }, +[196] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[197] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[198] = { 3, TN, SEN(socket), "socket" }, +[199] = { 4, TN, SEN(socketpair), "socketpair" }, +[200] = { 3, TN, SEN(bind), "bind" }, +[201] = { 2, TN, SEN(listen), "listen" }, +[202] = { 3, TN, SEN(accept), "accept" }, +[203] = { 3, TN, SEN(connect), "connect" }, +[204] = { 3, TN, SEN(getsockname), "getsockname" }, +[205] = { 3, TN, SEN(getpeername), "getpeername" }, +[206] = { 6, TN, SEN(sendto), "sendto" }, +[207] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[208] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[209] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[210] = { 2, TN, SEN(shutdown), "shutdown" }, +[211] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[212] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[213] = { 3, TD, SEN(readahead), "readahead" }, +[214] = { 1, TM|SI, SEN(brk), "brk" }, +[215] = { 2, TM|SI, SEN(munmap), "munmap" }, +[216] = { 5, TM|SI, SEN(mremap), "mremap" }, +[217] = { 5, 0, SEN(add_key), "add_key" }, +[218] = { 4, 0, SEN(request_key), "request_key" }, +[219] = { 5, 0, SEN(keyctl), "keyctl" }, +[220] = { 5, TP, SEN(clone), "clone" }, +[221] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[222] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[223] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[224] = { 2, TF, SEN(swapon), "swapon" }, +[225] = { 1, TF, SEN(swapoff), "swapoff" }, +[226] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[227] = { 3, TM, SEN(msync), "msync" }, +[228] = { 2, TM, SEN(mlock), "mlock" }, +[229] = { 2, TM, SEN(munlock), "munlock" }, +[230] = { 1, TM, SEN(mlockall), "mlockall" }, +[231] = { 0, TM, SEN(munlockall), "munlockall" }, +[232] = { 3, TM, SEN(mincore), "mincore" }, +[233] = { 3, TM, SEN(madvise), "madvise" }, +[234] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[235] = { 6, TM, SEN(mbind), "mbind" }, +[236] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[237] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[238] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[239] = { 6, TM, SEN(move_pages), "move_pages" }, +[240] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[241] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[242] = { 4, TN, SEN(accept4), "accept4" }, +[243] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +/* [244 ... 259] are arch specific */ +[260] = { 4, TP, SEN(wait4), "wait4" }, +[261] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[262] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[263] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[264] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[265] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[266] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[267] = { 1, TD, SEN(syncfs), "syncfs" }, +[268] = { 2, TD, SEN(setns), "setns" }, +[269] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[270] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[271] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[272] = { 5, 0, SEN(kcmp), "kcmp" }, +[273] = { 3, TD, SEN(finit_module), "finit_module" }, +[274] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[275] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[276] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[277] = { 3, 0, SEN(seccomp), "seccomp" }, +[278] = { 3, 0, SEN(getrandom), "getrandom" }, +[279] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[280] = { 3, TD, SEN(bpf), "bpf" }, +[281] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[282] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[283] = { 2, 0, SEN(membarrier), "membarrier" }, +[284] = { 3, TM, SEN(mlock2), "mlock2" }, +[285] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[286] = { 6, TD, SEN(preadv2), "preadv2" }, +[287] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[290] = { 1, 0, SEN(pkey_free), "pkey_free" }, diff --git a/linux/aarch64/arch_regs.c b/linux/aarch64/arch_regs.c new file mode 100644 index 00000000..4ccb1f5b --- /dev/null +++ b/linux/aarch64/arch_regs.c @@ -0,0 +1,38 @@ +struct arm_pt_regs { + uint32_t uregs[18]; +}; +#define ARM_cpsr uregs[16] +#define ARM_pc uregs[15] +#define ARM_lr uregs[14] +#define ARM_sp uregs[13] +#define ARM_ip uregs[12] +#define ARM_fp uregs[11] +#define ARM_r10 uregs[10] +#define ARM_r9 uregs[9] +#define ARM_r8 uregs[8] +#define ARM_r7 uregs[7] +#define ARM_r6 uregs[6] +#define ARM_r5 uregs[5] +#define ARM_r4 uregs[4] +#define ARM_r3 uregs[3] +#define ARM_r2 uregs[2] +#define ARM_r1 uregs[1] +#define ARM_r0 uregs[0] +#define ARM_ORIG_r0 uregs[17] + +static union { + struct user_pt_regs aarch64_r; + struct arm_pt_regs arm_r; +} arm_regs_union; +#define aarch64_regs arm_regs_union.aarch64_r +#define arm_regs arm_regs_union.arm_r + +uint64_t *const aarch64_sp_ptr = (uint64_t *) &aarch64_regs.sp; +uint32_t *const arm_sp_ptr = &arm_regs.ARM_sp; +static struct iovec aarch64_io = { + .iov_base = &arm_regs_union +}; + +#define ARCH_REGS_FOR_GETREGSET arm_regs_union +#define ARCH_IOVEC_FOR_GETREGSET aarch64_io +#define ARCH_PC_REG ((aarch64_io.iov_len == sizeof(arm_regs)) ? arm_regs.ARM_pc : aarch64_regs.pc) diff --git a/linux/aarch64/arch_regs.h b/linux/aarch64/arch_regs.h new file mode 100644 index 00000000..9a5e33e0 --- /dev/null +++ b/linux/aarch64/arch_regs.h @@ -0,0 +1,2 @@ +extern uint64_t *const aarch64_sp_ptr; +extern uint32_t *const arm_sp_ptr; diff --git a/linux/aarch64/arch_sigreturn.c b/linux/aarch64/arch_sigreturn.c new file mode 100644 index 00000000..f0e29c26 --- /dev/null +++ b/linux/aarch64/arch_sigreturn.c @@ -0,0 +1 @@ +#include "arm/arch_sigreturn.c" diff --git a/linux/aarch64/errnoent1.h b/linux/aarch64/errnoent1.h index e1cbe332..a0394d45 100644 --- a/linux/aarch64/errnoent1.h +++ b/linux/aarch64/errnoent1.h @@ -1,2 +1,2 @@ -/* Native AArch64 */ -#include "../errnoent.h" +/* ARM personality */ +#include "errnoent.h" diff --git a/linux/aarch64/get_error.c b/linux/aarch64/get_error.c new file mode 100644 index 00000000..a3aa1272 --- /dev/null +++ b/linux/aarch64/get_error.c @@ -0,0 +1,19 @@ +#define get_error arm_get_error +#include "arm/get_error.c" +#undef get_error + +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (tcp->currpers == 1) { + arm_get_error(tcp, check_errno); + return; + } + + if (check_errno && is_negated_errno(aarch64_regs.regs[0])) { + tcp->u_rval = -1; + tcp->u_error = -aarch64_regs.regs[0]; + } else { + tcp->u_rval = aarch64_regs.regs[0]; + } +} diff --git a/linux/aarch64/get_scno.c b/linux/aarch64/get_scno.c new file mode 100644 index 00000000..569aea09 --- /dev/null +++ b/linux/aarch64/get_scno.c @@ -0,0 +1,24 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + kernel_ulong_t scno = 0; + + switch (aarch64_io.iov_len) { + case sizeof(aarch64_regs): + /* We are in 64-bit mode */ + scno = aarch64_regs.regs[8]; + update_personality(tcp, 0); + break; + case sizeof(arm_regs): + /* We are in 32-bit mode */ + /* Note: we don't support OABI, unlike 32-bit ARM build */ + scno = arm_regs.ARM_r7; + scno = shuffle_scno(scno); + update_personality(tcp, 1); + break; + } + + tcp->scno = scno; + return 1; +} diff --git a/linux/aarch64/get_syscall_args.c b/linux/aarch64/get_syscall_args.c new file mode 100644 index 00000000..ea6e497d --- /dev/null +++ b/linux/aarch64/get_syscall_args.c @@ -0,0 +1,18 @@ +#define get_syscall_args arm_get_syscall_args +#include "arm/get_syscall_args.c" +#undef get_syscall_args + +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + if (tcp->currpers == 1) + return arm_get_syscall_args(tcp); + tcp->u_arg[0] = aarch64_regs.regs[0]; + tcp->u_arg[1] = aarch64_regs.regs[1]; + tcp->u_arg[2] = aarch64_regs.regs[2]; + tcp->u_arg[3] = aarch64_regs.regs[3]; + tcp->u_arg[4] = aarch64_regs.regs[4]; + tcp->u_arg[5] = aarch64_regs.regs[5]; + return 1; +} diff --git a/linux/aarch64/ioctlent.h.in b/linux/aarch64/ioctlent.h.in deleted file mode 100644 index 83e6eb28..00000000 --- a/linux/aarch64/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../arm/ioctlent.h.in" diff --git a/linux/aarch64/ioctlent1.h b/linux/aarch64/ioctlent1.h deleted file mode 100644 index 72eeaf19..00000000 --- a/linux/aarch64/ioctlent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "ioctlent.h" diff --git a/linux/aarch64/ioctls_arch0.h b/linux/aarch64/ioctls_arch0.h new file mode 100644 index 00000000..6a674ccd --- /dev/null +++ b/linux/aarch64/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm64/include/ tree. */ diff --git a/linux/aarch64/ioctls_arch1.h b/linux/aarch64/ioctls_arch1.h new file mode 100644 index 00000000..b722d22b --- /dev/null +++ b/linux/aarch64/ioctls_arch1.h @@ -0,0 +1 @@ +#include "arm/ioctls_arch0.h" diff --git a/linux/aarch64/ioctls_inc0.h b/linux/aarch64/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/aarch64/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/aarch64/ioctls_inc1.h b/linux/aarch64/ioctls_inc1.h new file mode 100644 index 00000000..46c11b11 --- /dev/null +++ b/linux/aarch64/ioctls_inc1.h @@ -0,0 +1 @@ +#include "arm/ioctls_inc0.h" diff --git a/linux/aarch64/set_error.c b/linux/aarch64/set_error.c new file mode 100644 index 00000000..03686092 --- /dev/null +++ b/linux/aarch64/set_error.c @@ -0,0 +1,25 @@ +#define arch_set_error arm_set_error +#define arch_set_success arm_set_success +#include "arm/set_error.c" +#undef arch_set_success +#undef arch_set_error + +static int +arch_set_error(struct tcb *tcp) +{ + if (aarch64_io.iov_len == sizeof(arm_regs)) + return arm_set_error(tcp); + + aarch64_regs.regs[0] = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + if (aarch64_io.iov_len == sizeof(arm_regs)) + return arm_set_success(tcp); + + aarch64_regs.regs[0] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/aarch64/set_scno.c b/linux/aarch64/set_scno.c new file mode 100644 index 00000000..fe44672b --- /dev/null +++ b/linux/aarch64/set_scno.c @@ -0,0 +1,22 @@ +#ifndef NT_ARM_SYSTEM_CALL +# define NT_ARM_SYSTEM_CALL 0x404 +#endif +/* + * NT_ARM_SYSTEM_CALL regset is supported by linux kernel + * starting with commit v3.19-rc1~59^2~16. + */ + +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + unsigned int n = (uint16_t) scno; + const struct iovec io = { + .iov_base = &n, + .iov_len = sizeof(n) + }; + int rc = ptrace(PTRACE_SETREGSET, tcp->pid, NT_ARM_SYSTEM_CALL, &io); + if (rc && errno != ESRCH) + perror_msg("arch_set_scno: NT_ARM_SYSTEM_CALL pid:%d scno:%#x", + tcp->pid, n); + return rc; +} diff --git a/linux/aarch64/signalent1.h b/linux/aarch64/signalent1.h index d31e6a4a..093cba7f 100644 --- a/linux/aarch64/signalent1.h +++ b/linux/aarch64/signalent1.h @@ -1 +1 @@ -#include "../signalent.h" +#include "signalent.h" diff --git a/linux/aarch64/syscallent.h b/linux/aarch64/syscallent.h index 1b892be0..6b23f8c2 100644 --- a/linux/aarch64/syscallent.h +++ b/linux/aarch64/syscallent.h @@ -1 +1,71 @@ -#include "../arm/syscallent.h" +#include "64/syscallent.h" + +/* Arch-specific block, not used on AArch64 */ +[244 ... 259] = { }, + +/* Quote from asm-generic/unistd.h: + * + * All syscalls below here should go away really, + * these are provided for both review and as a porting + * help for the C library version. + * + * Last chance: are any of these important enough to + * enable by default? + */ + +[1024] = { 3, TD|TF, SEN(open), "open" }, +[1025] = { 2, TF, SEN(link), "link" }, +[1026] = { 1, TF, SEN(unlink), "unlink" }, +[1027] = { 3, TF, SEN(mknod), "mknod" }, +[1028] = { 2, TF, SEN(chmod), "chmod" }, +[1029] = { 3, TF, SEN(chown), "chown" }, +[1030] = { 2, TF, SEN(mkdir), "mkdir" }, +[1031] = { 1, TF, SEN(rmdir), "rmdir" }, +[1032] = { 3, TF, SEN(chown), "lchown" }, +[1033] = { 2, TF, SEN(access), "access" }, +[1034] = { 2, TF, SEN(rename), "rename" }, +[1035] = { 3, TF, SEN(readlink), "readlink" }, +[1036] = { 2, TF, SEN(symlink), "symlink" }, +[1037] = { 2, TF, SEN(utimes), "utimes" }, +[1038] = { 2, TF, SEN(stat), "stat" }, +[1039] = { 2, TF, SEN(lstat), "lstat" }, +[1040] = { 1, TD, SEN(pipe), "pipe" }, +[1041] = { 2, TD, SEN(dup2), "dup2" }, +[1042] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[1043] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[1044] = { 1, TD, SEN(eventfd), "eventfd" }, +[1045] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[1046] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, +[1047] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[1048] = { 2, TF, SEN(truncate), "truncate" }, +[1049] = { 2, TF, SEN(stat), "stat" }, +[1050] = { 2, TF, SEN(lstat), "lstat" }, +[1051] = { 2, TD, SEN(fstat), "fstat" }, +[1052] = { 3, TD, SEN(fcntl), "fcntl" }, +[1053] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[1054] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[1055] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[1056] = { 2, TF, SEN(statfs), "statfs" }, +[1057] = { 3, TD, SEN(lseek), "lseek" }, +[1058] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[1059] = { 1, 0, SEN(alarm), "alarm" }, +[1060] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[1061] = { 0, TS, SEN(pause), "pause" }, +[1062] = { 1, 0, SEN(time), "time" }, +[1063] = { 2, TF, SEN(utime), "utime" }, +[1064] = { 2, TD|TF, SEN(creat), "creat" }, +[1065] = { 3, TD, SEN(getdents), "getdents" }, +[1066] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[1067] = { 5, TD, SEN(select), "select" }, +[1068] = { 3, TD, SEN(poll), "poll" }, +[1069] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[1070] = { 2, 0, SEN(ustat), "ustat" }, +[1071] = { 0, TP, SEN(vfork), "vfork" }, +[1072] = { 4, TP, SEN(wait4), "wait4" }, +[1073] = { 4, TN, SEN(recv), "recv" }, +[1074] = { 4, TN, SEN(send), "send" }, +[1075] = { 2, 0, SEN(bdflush), "bdflush" }, +[1076] = { 1, TF, SEN(umount), "umount" }, +[1077] = { 1, TF, SEN(uselib), "uselib" }, +[1078] = { 1, 0, SEN(sysctl), "sysctl" }, +[1079] = { 0, TP, SEN(fork), "fork" }, diff --git a/linux/aarch64/syscallent1.h b/linux/aarch64/syscallent1.h index c7c14968..1b892be0 100644 --- a/linux/aarch64/syscallent1.h +++ b/linux/aarch64/syscallent1.h @@ -1,335 +1 @@ - { 2, 0, sys_io_setup, "io_setup" }, /* 0 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 1 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 2 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 3 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 4 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 5 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 6 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 7 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 8 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 9 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 10 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 11 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 12 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 13 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 14 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 15 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 16 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 17 */ - { 3, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 18 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 19 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 20 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 21 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 22 */ - { 1, TD, sys_dup, "dup" }, /* 23 */ - { 3, TD, sys_dup3, "dup3" }, /* 24 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 25 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 26 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 27 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 28 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 29 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 30 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 31 */ - { 2, TD, sys_flock, "flock" }, /* 32 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 33 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 34 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 35 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 36 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 37 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 38 */ - { 2, TF, sys_umount2, "umount2" }, /* 39 */ - { 5, TF, sys_mount, "mount" }, /* 40 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 41 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 42 */ - { 2, TF, sys_statfs, "statfs64" }, /* 43 */ - { 2, TD, sys_fstatfs, "fstatfs64" }, /* 44 */ - { 2, TF, sys_truncate, "truncate64" }, /* 45 */ - { 2, TD, sys_ftruncate, "ftruncate64" }, /* 46 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 47 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 48 */ - { 1, TF, sys_chdir, "chdir" }, /* 49 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 50 */ - { 1, TF, sys_chroot, "chroot" }, /* 51 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 52 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 53 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 54 */ - { 3, TD, sys_fchown, "fchown" }, /* 55 */ - { 4, TD|TF, sys_openat, "openat" }, /* 56 */ - { 1, TD, sys_close, "close" }, /* 57 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 58 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 59 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 60 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 61 */ - { 3, TD, sys_lseek, "lseek" }, /* 62 */ - { 3, TD, sys_read, "read" }, /* 63 */ - { 3, TD, sys_write, "write" }, /* 64 */ - { 3, TD, sys_readv, "readv" }, /* 65 */ - { 3, TD, sys_writev, "writev" }, /* 66 */ - { 4, TD, sys_pread, "pread64" }, /* 67 */ - { 4, TD, sys_pwrite, "pwrite64" }, /* 68 */ - { 4, TD, sys_preadv, "preadv" }, /* 69 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 70 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 71 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 72 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 73 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 74 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 75 */ - { 6, TD, sys_splice, "splice" }, /* 76 */ - { 4, TD, sys_tee, "tee" }, /* 77 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 78 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 79 */ - { 2, TD, sys_fstat, "fstat" }, /* 80 */ - { 0, 0, sys_sync, "sync" }, /* 81 */ - { 1, TD, sys_fsync, "fsync" }, /* 82 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 83 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 84 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 85 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 86 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 87 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 88 */ - { 1, TF, sys_acct, "acct" }, /* 89 */ - { 2, 0, sys_capget, "capget" }, /* 90 */ - { 2, 0, sys_capset, "capset" }, /* 91 */ - { 1, 0, sys_personality, "personality" }, /* 92 */ - { 1, TP|SE, sys_exit, "exit" }, /* 93 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 94 */ - { 5, TP, sys_waitid, "waitid" }, /* 95 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 96 */ - { 1, TP, sys_unshare, "unshare" }, /* 97 */ - { 6, 0, sys_futex, "futex" }, /* 98 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 99 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 100 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 101 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 102 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 103 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 104 */ - { 3, 0, sys_init_module, "init_module" }, /* 105 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 106 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 107 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 108 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 109 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 110 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 111 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 112 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 113 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 114 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 115 */ - { 3, 0, sys_syslog, "syslog" }, /* 116 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 117 */ - { 0, 0, sys_sched_setparam, "sched_setparam" }, /* 118 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 119 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 120 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 121 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 122 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 123 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 124 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max" }, /* 125 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min" }, /* 126 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 127 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 128 */ - { 2, TS, sys_kill, "kill" }, /* 129 */ - { 2, TS, sys_kill, "tkill" }, /* 130 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 131 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 132 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 133 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 134 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 135 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 136 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 137 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 138 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 139 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 140 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 141 */ - { 4, 0, sys_reboot, "reboot" }, /* 142 */ - { 2, 0, sys_setregid, "setregid" }, /* 143 */ - { 1, 0, sys_setgid, "setgid" }, /* 144 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 145 */ - { 1, 0, sys_setuid, "setuid" }, /* 146 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 147 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 148 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 149 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 150 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 151 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 152 */ - { 1, 0, sys_times, "times" }, /* 153 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 154 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 155 */ - { 1, 0, sys_getsid, "getsid" }, /* 156 */ - { 0, 0, sys_setsid, "setsid" }, /* 157 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 158 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 159 */ - { 1, 0, sys_uname, "uname" }, /* 160 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 161 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 162 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 163 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 164 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 165 */ - { 1, 0, sys_umask, "umask" }, /* 166 */ - { 5, 0, sys_prctl, "prctl" }, /* 167 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 168 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 169 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 170 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 171 */ - { 0, 0, sys_getpid, "getpid" }, /* 172 */ - { 0, 0, sys_getppid, "getppid" }, /* 173 */ - { 0, NF, sys_getuid, "getuid" }, /* 174 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 175 */ - { 0, NF, sys_getgid, "getgid" }, /* 176 */ - { 0, NF, sys_getegid, "getegid" }, /* 177 */ - { 0, 0, sys_gettid, "gettid" }, /* 178 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 179 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 180 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 181 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 182 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 183 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 184 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 185 */ - { 4, TI, sys_msgget, "msgget" }, /* 186 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 187 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 188 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 189 */ - { 4, TI, sys_semget, "semget" }, /* 190 */ - { 4, TI, sys_semctl, "semctl" }, /* 191 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 192 */ - { 4, TI, sys_semop, "semop" }, /* 193 */ - { 4, TI, sys_shmget, "shmget" }, /* 194 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 195 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 196 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 197 */ - { 3, TN, sys_socket, "socket" }, /* 198 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 199 */ - { 3, TN, sys_bind, "bind" }, /* 200 */ - { 2, TN, sys_listen, "listen" }, /* 201 */ - { 3, TN, sys_accept, "accept" }, /* 202 */ - { 3, TN, sys_connect, "connect" }, /* 203 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 204 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 205 */ - { 6, TN, sys_sendto, "sendto" }, /* 206 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 207 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 208 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 209 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 210 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 211 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 212 */ - { 3, TD, sys_readahead, "readahead" }, /* 213 */ - { 1, TM|SI, sys_brk, "brk" }, /* 214 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 215 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 216 */ - { 5, 0, sys_add_key, "add_key" }, /* 217 */ - { 4, 0, sys_request_key, "request_key" }, /* 218 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 219 */ - { 5, TP, sys_clone, "clone" }, /* 220 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 221 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 222 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 223 */ - { 2, TF, sys_swapon, "swapon" }, /* 224 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 225 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 226 */ - { 3, TM, sys_msync, "msync" }, /* 227 */ - { 3, TM, sys_msync, "msync" }, /* 228 */ - { 2, TM, sys_munlock, "munlock" }, /* 229 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 230 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 231 */ - { 3, TM, sys_mincore, "mincore" }, /* 232 */ - { 3, TM, sys_madvise, "madvise" }, /* 233 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 234 */ - { 6, TM, sys_mbind, "mbind" }, /* 235 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 236 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 237 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 238 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 239 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 240 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 241 */ - { 4, TN, sys_accept4, "accept4" }, /* 242 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 243 */ - - /* Arch-specific block, not used on AArch64 */ - [244 ... 259] = { }, - - { 4, TP, sys_wait4, "wait4" }, /* 260 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 261 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 262 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 263 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 264 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 265 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 266 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 267 */ - { 2, TD, sys_setns, "setns" }, /* 268 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 269 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 270 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 271 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 272 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 273 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 274 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 275 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 276 */ - - /* Blank down to 1023 */ - [277 ... 1023] = { }, - - /* Quote from asm-generic/unistd.h: - * - * All syscalls below here should go away really, - * these are provided for both review and as a porting - * help for the C library version. - * - * Last chance: are any of these important enough to - * enable by default? - */ - - { 3, TD|TF, sys_open, "open" }, /* 1024 */ - { 2, TF, sys_link, "link" }, /* 1025 */ - { 1, TF, sys_unlink, "unlink" }, /* 1026 */ - { 3, TF, sys_mknod, "mknod" }, /* 1027 */ - { 2, TF, sys_chmod, "chmod" }, /* 1028 */ - { 3, TF, sys_chown, "chown" }, /* 1029 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 1030 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 1031 */ - { 3, TF, sys_chown, "lchown" }, /* 1032 */ - { 2, TF, sys_access, "access" }, /* 1033 */ - { 2, TF, sys_rename, "rename" }, /* 1034 */ - { 3, TF, sys_readlink, "readlink" }, /* 1035 */ - { 2, TF, sys_symlink, "symlink" }, /* 1036 */ - { 2, TF, sys_utimes, "utimes" }, /* 1037 */ - { 2, TF, sys_stat, "stat" }, /* 1038 */ - { 2, TF, sys_lstat, "lstat" }, /* 1039 */ - { 1, TD, sys_pipe, "pipe" }, /* 1040 */ - { 2, TD, sys_dup2, "dup2" }, /* 1041 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 1042 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 1043 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 1044 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 1045 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 1046 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 1047 */ - { 2, TF, sys_truncate, "truncate" }, /* 1048 */ - { 2, TF, sys_stat, "stat" }, /* 1049 */ - { 2, TF, sys_lstat, "lstat" }, /* 1050 */ - { 2, TD, sys_fstat, "fstat" }, /* 1051 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 1052 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 1053 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 1054 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 1055 */ - { 2, TF, sys_statfs, "statfs" }, /* 1056 */ - { 3, TD, sys_lseek, "lseek" }, /* 1057 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 1058 */ - { 1, 0, sys_alarm, "alarm" }, /* 1059 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 1060 */ - { 0, TS, sys_pause, "pause" }, /* 1061 */ - { 1, 0, sys_time, "time" }, /* 1062 */ - { 2, TF, sys_utime, "utime" }, /* 1063 */ - { 2, TD|TF, sys_creat, "creat" }, /* 1064 */ - { 3, TD, sys_getdents, "getdents" }, /* 1065 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 1066 */ - { 5, TD, sys_select, "select" }, /* 1067 */ - { 3, TD, sys_poll, "poll" }, /* 1068 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 1069 */ - { 2, 0, sys_ustat, "ustat" }, /* 1070 */ - { 0, TP, sys_vfork, "vfork" }, /* 1071 */ - { 4, TP, sys_wait4, "wait4" }, /* 1072 */ - { 6, TN, sys_recv, "recv" }, /* 1073 */ - { 4, TN, sys_send, "send" }, /* 1074 */ - { 2, 0, sys_bdflush, "bdflush" }, /* 1075 */ - { 2, TF, sys_umount, "umount" }, /* 1076 */ - { 1, TF, sys_uselib, "uselib" }, /* 1077 */ - { 1, 0, sys_sysctl, "sysctl" }, /* 1078 */ - { 0, TP, sys_fork, "fork" }, /* 1079 */ +#include "../arm/syscallent.h" diff --git a/linux/alpha/arch_getrval2.c b/linux/alpha/arch_getrval2.c new file mode 100644 index 00000000..f78a9f0f --- /dev/null +++ b/linux/alpha/arch_getrval2.c @@ -0,0 +1,8 @@ +long +getrval2(struct tcb *tcp) +{ + unsigned long r20; + if (upeek(tcp->pid, 20, &r20) < 0) + return -1; + return r20; +} diff --git a/linux/alpha/arch_regs.c b/linux/alpha/arch_regs.c new file mode 100644 index 00000000..4d397996 --- /dev/null +++ b/linux/alpha/arch_regs.c @@ -0,0 +1,3 @@ +static unsigned long alpha_r0; +static unsigned long alpha_a3; +#define ARCH_PC_PEEK_ADDR REG_PC diff --git a/linux/alpha/arch_regs.h b/linux/alpha/arch_regs.h new file mode 100644 index 00000000..66277fd8 --- /dev/null +++ b/linux/alpha/arch_regs.h @@ -0,0 +1,5 @@ +#define REG_R0 0 +#define REG_A0 16 +#define REG_A3 19 +#define REG_FP 30 +#define REG_PC 64 diff --git a/linux/alpha/arch_sigreturn.c b/linux/alpha/arch_sigreturn.c new file mode 100644 index 00000000..3317a954 --- /dev/null +++ b/linux/alpha/arch_sigreturn.c @@ -0,0 +1,13 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + unsigned long addr; + + if (upeek(tcp->pid, REG_FP, &addr) < 0) + return; + addr += offsetof(struct sigcontext, sc_mask); + + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/alpha/errnoent.h b/linux/alpha/errnoent.h index 4ffaff9c..b9157cfe 100644 --- a/linux/alpha/errnoent.h +++ b/linux/alpha/errnoent.h @@ -1,516 +1,148 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EDEADLK", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "EAGAIN", /* 35 */ - "EINPROGRESS", /* 36 */ - "EALREADY", /* 37 */ - "ENOTSOCK", /* 38 */ - "EDESTADDRREQ", /* 39 */ - "EMSGSIZE", /* 40 */ - "EPROTOTYPE", /* 41 */ - "ENOPROTOOPT", /* 42 */ - "EPROTONOSUPPORT", /* 43 */ - "ESOCKTNOSUPPORT", /* 44 */ - "EOPNOTSUPP", /* 45 */ - "EPFNOSUPPORT", /* 46 */ - "EAFNOSUPPORT", /* 47 */ - "EADDRINUSE", /* 48 */ - "EADDRNOTAVAIL", /* 49 */ - "ENETDOWN", /* 50 */ - "ENETUNREACH", /* 51 */ - "ENETRESET", /* 52 */ - "ECONNABORTED", /* 53 */ - "ECONNRESET", /* 54 */ - "ENOBUFS", /* 55 */ - "EISCONN", /* 56 */ - "ENOTCONN", /* 57 */ - "ESHUTDOWN", /* 58 */ - "ETOOMANYREFS", /* 59 */ - "ETIMEDOUT", /* 60 */ - "ECONNREFUSED", /* 61 */ - "ELOOP", /* 62 */ - "ENAMETOOLONG", /* 63 */ - "EHOSTDOWN", /* 64 */ - "EHOSTUNREACH", /* 65 */ - "ENOTEMPTY", /* 66 */ - "ERRNO_67", /* 67 */ - "EUSERS", /* 68 */ - "EDQUOT", /* 69 */ - "ESTALE", /* 70 */ - "EREMOTE", /* 71 */ - "ERRNO_72", /* 72 */ - "ERRNO_73", /* 73 */ - "ERRNO_74", /* 74 */ - "ERRNO_75", /* 75 */ - "ERRNO_76", /* 76 */ - "ENOLCK", /* 77 */ - "ENOSYS", /* 78 */ - "ERRNO_79", /* 79 */ - "ENOMSG", /* 80 */ - "EIDRM", /* 81 */ - "ENOSR", /* 82 */ - "ETIME", /* 83 */ - "EBADMSG", /* 84 */ - "EPROTO", /* 85 */ - "ENODATA", /* 86 */ - "ENOSTR", /* 87 */ - "ECHRNG", /* 88 */ - "EL2NSYNC", /* 89 */ - "EL3HLT", /* 90 */ - "EL3RST", /* 91 */ - "ENOPKG", /* 92 */ - "ELNRNG", /* 93 */ - "EUNATCH", /* 94 */ - "ENOCSI", /* 95 */ - "EL2HLT", /* 96 */ - "EBADE", /* 97 */ - "EBADR", /* 98 */ - "EXFULL", /* 99 */ - "ENOANO", /* 100 */ - "EBADRQC", /* 101 */ - "EBADSLT", /* 102 */ - "EDEADLOCK", /* 103 */ - "EBFONT", /* 104 */ - "ENONET", /* 105 */ - "ENOLINK", /* 106 */ - "EADV", /* 107 */ - "ESRMNT", /* 108 */ - "ECOMM", /* 109 */ - "EMULTIHOP", /* 110 */ - "EDOTDOT", /* 111 */ - "EOVERFLOW", /* 112 */ - "ENOTUNIQ", /* 113 */ - "EBADFD", /* 114 */ - "EREMCHG", /* 115 */ - "EILSEQ", /* 116 */ - "EUCLEAN", /* 117 */ - "ENOTNAM", /* 118 */ - "ENAVAIL", /* 119 */ - "EISNAM", /* 120 */ - "EREMOTEIO", /* 121 */ - "ELIBACC", /* 122 */ - "ELIBBAD", /* 123 */ - "ELIBSCN", /* 124 */ - "ELIBMAX", /* 125 */ - "ELIBEXEC", /* 126 */ - "ERESTART", /* 127 */ - "ESTRPIPE", /* 128 */ - "ERRNO_129", /* 129 */ - "ERRNO_130", /* 130 */ - "ERRNO_131", /* 131 */ - "ERRNO_132", /* 132 */ - "ERRNO_133", /* 133 */ - "ERRNO_134", /* 134 */ - "ERRNO_135", /* 135 */ - "ERRNO_136", /* 136 */ - "ERRNO_137", /* 137 */ - "ERRNO_138", /* 138 */ - "ERRNO_139", /* 139 */ - "ERRNO_140", /* 140 */ - "ERRNO_141", /* 141 */ - "ERRNO_142", /* 142 */ - "ERRNO_143", /* 143 */ - "ERRNO_144", /* 144 */ - "ERRNO_145", /* 145 */ - "ERRNO_146", /* 146 */ - "ERRNO_147", /* 147 */ - "ERRNO_148", /* 148 */ - "ERRNO_149", /* 149 */ - "ERRNO_150", /* 150 */ - "ERRNO_151", /* 151 */ - "ERRNO_152", /* 152 */ - "ERRNO_153", /* 153 */ - "ERRNO_154", /* 154 */ - "ERRNO_155", /* 155 */ - "ERRNO_156", /* 156 */ - "ERRNO_157", /* 157 */ - "ERRNO_158", /* 158 */ - "ERRNO_159", /* 159 */ - "ERRNO_160", /* 160 */ - "ERRNO_161", /* 161 */ - "ERRNO_162", /* 162 */ - "ERRNO_163", /* 163 */ - "ERRNO_164", /* 164 */ - "ERRNO_165", /* 165 */ - "ERRNO_166", /* 166 */ - "ERRNO_167", /* 167 */ - "ERRNO_168", /* 168 */ - "ERRNO_169", /* 169 */ - "ERRNO_170", /* 170 */ - "ERRNO_171", /* 171 */ - "ERRNO_172", /* 172 */ - "ERRNO_173", /* 173 */ - "ERRNO_174", /* 174 */ - "ERRNO_175", /* 175 */ - "ERRNO_176", /* 176 */ - "ERRNO_177", /* 177 */ - "ERRNO_178", /* 178 */ - "ERRNO_179", /* 179 */ - "ERRNO_180", /* 180 */ - "ERRNO_181", /* 181 */ - "ERRNO_182", /* 182 */ - "ERRNO_183", /* 183 */ - "ERRNO_184", /* 184 */ - "ERRNO_185", /* 185 */ - "ERRNO_186", /* 186 */ - "ERRNO_187", /* 187 */ - "ERRNO_188", /* 188 */ - "ERRNO_189", /* 189 */ - "ERRNO_190", /* 190 */ - "ERRNO_191", /* 191 */ - "ERRNO_192", /* 192 */ - "ERRNO_193", /* 193 */ - "ERRNO_194", /* 194 */ - "ERRNO_195", /* 195 */ - "ERRNO_196", /* 196 */ - "ERRNO_197", /* 197 */ - "ERRNO_198", /* 198 */ - "ERRNO_199", /* 199 */ - "ERRNO_200", /* 200 */ - "ERRNO_201", /* 201 */ - "ERRNO_202", /* 202 */ - "ERRNO_203", /* 203 */ - "ERRNO_204", /* 204 */ - "ERRNO_205", /* 205 */ - "ERRNO_206", /* 206 */ - "ERRNO_207", /* 207 */ - "ERRNO_208", /* 208 */ - "ERRNO_209", /* 209 */ - "ERRNO_210", /* 210 */ - "ERRNO_211", /* 211 */ - "ERRNO_212", /* 212 */ - "ERRNO_213", /* 213 */ - "ERRNO_214", /* 214 */ - "ERRNO_215", /* 215 */ - "ERRNO_216", /* 216 */ - "ERRNO_217", /* 217 */ - "ERRNO_218", /* 218 */ - "ERRNO_219", /* 219 */ - "ERRNO_220", /* 220 */ - "ERRNO_221", /* 221 */ - "ERRNO_222", /* 222 */ - "ERRNO_223", /* 223 */ - "ERRNO_224", /* 224 */ - "ERRNO_225", /* 225 */ - "ERRNO_226", /* 226 */ - "ERRNO_227", /* 227 */ - "ERRNO_228", /* 228 */ - "ERRNO_229", /* 229 */ - "ERRNO_230", /* 230 */ - "ERRNO_231", /* 231 */ - "ERRNO_232", /* 232 */ - "ERRNO_233", /* 233 */ - "ERRNO_234", /* 234 */ - "ERRNO_235", /* 235 */ - "ERRNO_236", /* 236 */ - "ERRNO_237", /* 237 */ - "ERRNO_238", /* 238 */ - "ERRNO_239", /* 239 */ - "ERRNO_240", /* 240 */ - "ERRNO_241", /* 241 */ - "ERRNO_242", /* 242 */ - "ERRNO_243", /* 243 */ - "ERRNO_244", /* 244 */ - "ERRNO_245", /* 245 */ - "ERRNO_246", /* 246 */ - "ERRNO_247", /* 247 */ - "ERRNO_248", /* 248 */ - "ERRNO_249", /* 249 */ - "ERRNO_250", /* 250 */ - "ERRNO_251", /* 251 */ - "ERRNO_252", /* 252 */ - "ERRNO_253", /* 253 */ - "ERRNO_254", /* 254 */ - "ERRNO_255", /* 255 */ - "ERRNO_256", /* 256 */ - "ERRNO_257", /* 257 */ - "ERRNO_258", /* 258 */ - "ERRNO_259", /* 259 */ - "ERRNO_260", /* 260 */ - "ERRNO_261", /* 261 */ - "ERRNO_262", /* 262 */ - "ERRNO_263", /* 263 */ - "ERRNO_264", /* 264 */ - "ERRNO_265", /* 265 */ - "ERRNO_266", /* 266 */ - "ERRNO_267", /* 267 */ - "ERRNO_268", /* 268 */ - "ERRNO_269", /* 269 */ - "ERRNO_270", /* 270 */ - "ERRNO_271", /* 271 */ - "ERRNO_272", /* 272 */ - "ERRNO_273", /* 273 */ - "ERRNO_274", /* 274 */ - "ERRNO_275", /* 275 */ - "ERRNO_276", /* 276 */ - "ERRNO_277", /* 277 */ - "ERRNO_278", /* 278 */ - "ERRNO_279", /* 279 */ - "ERRNO_280", /* 280 */ - "ERRNO_281", /* 281 */ - "ERRNO_282", /* 282 */ - "ERRNO_283", /* 283 */ - "ERRNO_284", /* 284 */ - "ERRNO_285", /* 285 */ - "ERRNO_286", /* 286 */ - "ERRNO_287", /* 287 */ - "ERRNO_288", /* 288 */ - "ERRNO_289", /* 289 */ - "ERRNO_290", /* 290 */ - "ERRNO_291", /* 291 */ - "ERRNO_292", /* 292 */ - "ERRNO_293", /* 293 */ - "ERRNO_294", /* 294 */ - "ERRNO_295", /* 295 */ - "ERRNO_296", /* 296 */ - "ERRNO_297", /* 297 */ - "ERRNO_298", /* 298 */ - "ERRNO_299", /* 299 */ - "ERRNO_300", /* 300 */ - "ERRNO_301", /* 301 */ - "ERRNO_302", /* 302 */ - "ERRNO_303", /* 303 */ - "ERRNO_304", /* 304 */ - "ERRNO_305", /* 305 */ - "ERRNO_306", /* 306 */ - "ERRNO_307", /* 307 */ - "ERRNO_308", /* 308 */ - "ERRNO_309", /* 309 */ - "ERRNO_310", /* 310 */ - "ERRNO_311", /* 311 */ - "ERRNO_312", /* 312 */ - "ERRNO_313", /* 313 */ - "ERRNO_314", /* 314 */ - "ERRNO_315", /* 315 */ - "ERRNO_316", /* 316 */ - "ERRNO_317", /* 317 */ - "ERRNO_318", /* 318 */ - "ERRNO_319", /* 319 */ - "ERRNO_320", /* 320 */ - "ERRNO_321", /* 321 */ - "ERRNO_322", /* 322 */ - "ERRNO_323", /* 323 */ - "ERRNO_324", /* 324 */ - "ERRNO_325", /* 325 */ - "ERRNO_326", /* 326 */ - "ERRNO_327", /* 327 */ - "ERRNO_328", /* 328 */ - "ERRNO_329", /* 329 */ - "ERRNO_330", /* 330 */ - "ERRNO_331", /* 331 */ - "ERRNO_332", /* 332 */ - "ERRNO_333", /* 333 */ - "ERRNO_334", /* 334 */ - "ERRNO_335", /* 335 */ - "ERRNO_336", /* 336 */ - "ERRNO_337", /* 337 */ - "ERRNO_338", /* 338 */ - "ERRNO_339", /* 339 */ - "ERRNO_340", /* 340 */ - "ERRNO_341", /* 341 */ - "ERRNO_342", /* 342 */ - "ERRNO_343", /* 343 */ - "ERRNO_344", /* 344 */ - "ERRNO_345", /* 345 */ - "ERRNO_346", /* 346 */ - "ERRNO_347", /* 347 */ - "ERRNO_348", /* 348 */ - "ERRNO_349", /* 349 */ - "ERRNO_350", /* 350 */ - "ERRNO_351", /* 351 */ - "ERRNO_352", /* 352 */ - "ERRNO_353", /* 353 */ - "ERRNO_354", /* 354 */ - "ERRNO_355", /* 355 */ - "ERRNO_356", /* 356 */ - "ERRNO_357", /* 357 */ - "ERRNO_358", /* 358 */ - "ERRNO_359", /* 359 */ - "ERRNO_360", /* 360 */ - "ERRNO_361", /* 361 */ - "ERRNO_362", /* 362 */ - "ERRNO_363", /* 363 */ - "ERRNO_364", /* 364 */ - "ERRNO_365", /* 365 */ - "ERRNO_366", /* 366 */ - "ERRNO_367", /* 367 */ - "ERRNO_368", /* 368 */ - "ERRNO_369", /* 369 */ - "ERRNO_370", /* 370 */ - "ERRNO_371", /* 371 */ - "ERRNO_372", /* 372 */ - "ERRNO_373", /* 373 */ - "ERRNO_374", /* 374 */ - "ERRNO_375", /* 375 */ - "ERRNO_376", /* 376 */ - "ERRNO_377", /* 377 */ - "ERRNO_378", /* 378 */ - "ERRNO_379", /* 379 */ - "ERRNO_380", /* 380 */ - "ERRNO_381", /* 381 */ - "ERRNO_382", /* 382 */ - "ERRNO_383", /* 383 */ - "ERRNO_384", /* 384 */ - "ERRNO_385", /* 385 */ - "ERRNO_386", /* 386 */ - "ERRNO_387", /* 387 */ - "ERRNO_388", /* 388 */ - "ERRNO_389", /* 389 */ - "ERRNO_390", /* 390 */ - "ERRNO_391", /* 391 */ - "ERRNO_392", /* 392 */ - "ERRNO_393", /* 393 */ - "ERRNO_394", /* 394 */ - "ERRNO_395", /* 395 */ - "ERRNO_396", /* 396 */ - "ERRNO_397", /* 397 */ - "ERRNO_398", /* 398 */ - "ERRNO_399", /* 399 */ - "ERRNO_400", /* 400 */ - "ERRNO_401", /* 401 */ - "ERRNO_402", /* 402 */ - "ERRNO_403", /* 403 */ - "ERRNO_404", /* 404 */ - "ERRNO_405", /* 405 */ - "ERRNO_406", /* 406 */ - "ERRNO_407", /* 407 */ - "ERRNO_408", /* 408 */ - "ERRNO_409", /* 409 */ - "ERRNO_410", /* 410 */ - "ERRNO_411", /* 411 */ - "ERRNO_412", /* 412 */ - "ERRNO_413", /* 413 */ - "ERRNO_414", /* 414 */ - "ERRNO_415", /* 415 */ - "ERRNO_416", /* 416 */ - "ERRNO_417", /* 417 */ - "ERRNO_418", /* 418 */ - "ERRNO_419", /* 419 */ - "ERRNO_420", /* 420 */ - "ERRNO_421", /* 421 */ - "ERRNO_422", /* 422 */ - "ERRNO_423", /* 423 */ - "ERRNO_424", /* 424 */ - "ERRNO_425", /* 425 */ - "ERRNO_426", /* 426 */ - "ERRNO_427", /* 427 */ - "ERRNO_428", /* 428 */ - "ERRNO_429", /* 429 */ - "ERRNO_430", /* 430 */ - "ERRNO_431", /* 431 */ - "ERRNO_432", /* 432 */ - "ERRNO_433", /* 433 */ - "ERRNO_434", /* 434 */ - "ERRNO_435", /* 435 */ - "ERRNO_436", /* 436 */ - "ERRNO_437", /* 437 */ - "ERRNO_438", /* 438 */ - "ERRNO_439", /* 439 */ - "ERRNO_440", /* 440 */ - "ERRNO_441", /* 441 */ - "ERRNO_442", /* 442 */ - "ERRNO_443", /* 443 */ - "ERRNO_444", /* 444 */ - "ERRNO_445", /* 445 */ - "ERRNO_446", /* 446 */ - "ERRNO_447", /* 447 */ - "ERRNO_448", /* 448 */ - "ERRNO_449", /* 449 */ - "ERRNO_450", /* 450 */ - "ERRNO_451", /* 451 */ - "ERRNO_452", /* 452 */ - "ERRNO_453", /* 453 */ - "ERRNO_454", /* 454 */ - "ERRNO_455", /* 455 */ - "ERRNO_456", /* 456 */ - "ERRNO_457", /* 457 */ - "ERRNO_458", /* 458 */ - "ERRNO_459", /* 459 */ - "ERRNO_460", /* 460 */ - "ERRNO_461", /* 461 */ - "ERRNO_462", /* 462 */ - "ERRNO_463", /* 463 */ - "ERRNO_464", /* 464 */ - "ERRNO_465", /* 465 */ - "ERRNO_466", /* 466 */ - "ERRNO_467", /* 467 */ - "ERRNO_468", /* 468 */ - "ERRNO_469", /* 469 */ - "ERRNO_470", /* 470 */ - "ERRNO_471", /* 471 */ - "ERRNO_472", /* 472 */ - "ERRNO_473", /* 473 */ - "ERRNO_474", /* 474 */ - "ERRNO_475", /* 475 */ - "ERRNO_476", /* 476 */ - "ERRNO_477", /* 477 */ - "ERRNO_478", /* 478 */ - "ERRNO_479", /* 479 */ - "ERRNO_480", /* 480 */ - "ERRNO_481", /* 481 */ - "ERRNO_482", /* 482 */ - "ERRNO_483", /* 483 */ - "ERRNO_484", /* 484 */ - "ERRNO_485", /* 485 */ - "ERRNO_486", /* 486 */ - "ERRNO_487", /* 487 */ - "ERRNO_488", /* 488 */ - "ERRNO_489", /* 489 */ - "ERRNO_490", /* 490 */ - "ERRNO_491", /* 491 */ - "ERRNO_492", /* 492 */ - "ERRNO_493", /* 493 */ - "ERRNO_494", /* 494 */ - "ERRNO_495", /* 495 */ - "ERRNO_496", /* 496 */ - "ERRNO_497", /* 497 */ - "ERRNO_498", /* 498 */ - "ERRNO_499", /* 499 */ - "ERRNO_500", /* 500 */ - "ERRNO_501", /* 501 */ - "ERRNO_502", /* 502 */ - "ERRNO_503", /* 503 */ - "ERRNO_504", /* 504 */ - "ERRNO_505", /* 505 */ - "ERRNO_506", /* 506 */ - "ERRNO_507", /* 507 */ - "ERRNO_508", /* 508 */ - "ERRNO_509", /* 509 */ - "ERRNO_510", /* 510 */ - "ERRNO_511", /* 511 */ - "ERESTARTSYS", /* 512 */ - "ERESTARTNOINTR", /* 513 */ - "ERESTARTNOHAND", /* 514 */ - "ENOIOCTLCMD", /* 515 */ +[ 1] = "EPERM", +[ 2] = "ENOENT", +[ 3] = "ESRCH", +[ 4] = "EINTR", +[ 5] = "EIO", +[ 6] = "ENXIO", +[ 7] = "E2BIG", +[ 8] = "ENOEXEC", +[ 9] = "EBADF", +[ 10] = "ECHILD", +[ 11] = "EDEADLK", +[ 12] = "ENOMEM", +[ 13] = "EACCES", +[ 14] = "EFAULT", +[ 15] = "ENOTBLK", +[ 16] = "EBUSY", +[ 17] = "EEXIST", +[ 18] = "EXDEV", +[ 19] = "ENODEV", +[ 20] = "ENOTDIR", +[ 21] = "EISDIR", +[ 22] = "EINVAL", +[ 23] = "ENFILE", +[ 24] = "EMFILE", +[ 25] = "ENOTTY", +[ 26] = "ETXTBSY", +[ 27] = "EFBIG", +[ 28] = "ENOSPC", +[ 29] = "ESPIPE", +[ 30] = "EROFS", +[ 31] = "EMLINK", +[ 32] = "EPIPE", +[ 33] = "EDOM", +[ 34] = "ERANGE", +[ 35] = "EAGAIN", +[ 36] = "EINPROGRESS", +[ 37] = "EALREADY", +[ 38] = "ENOTSOCK", +[ 39] = "EDESTADDRREQ", +[ 40] = "EMSGSIZE", +[ 41] = "EPROTOTYPE", +[ 42] = "ENOPROTOOPT", +[ 43] = "EPROTONOSUPPORT", +[ 44] = "ESOCKTNOSUPPORT", +[ 45] = "EOPNOTSUPP", +[ 46] = "EPFNOSUPPORT", +[ 47] = "EAFNOSUPPORT", +[ 48] = "EADDRINUSE", +[ 49] = "EADDRNOTAVAIL", +[ 50] = "ENETDOWN", +[ 51] = "ENETUNREACH", +[ 52] = "ENETRESET", +[ 53] = "ECONNABORTED", +[ 54] = "ECONNRESET", +[ 55] = "ENOBUFS", +[ 56] = "EISCONN", +[ 57] = "ENOTCONN", +[ 58] = "ESHUTDOWN", +[ 59] = "ETOOMANYREFS", +[ 60] = "ETIMEDOUT", +[ 61] = "ECONNREFUSED", +[ 62] = "ELOOP", +[ 63] = "ENAMETOOLONG", +[ 64] = "EHOSTDOWN", +[ 65] = "EHOSTUNREACH", +[ 66] = "ENOTEMPTY", +[ 68] = "EUSERS", +[ 69] = "EDQUOT", +[ 70] = "ESTALE", +[ 71] = "EREMOTE", +[ 77] = "ENOLCK", +[ 78] = "ENOSYS", +[ 80] = "ENOMSG", +[ 81] = "EIDRM", +[ 82] = "ENOSR", +[ 83] = "ETIME", +[ 84] = "EBADMSG", +[ 85] = "EPROTO", +[ 86] = "ENODATA", +[ 87] = "ENOSTR", +[ 88] = "ECHRNG", +[ 89] = "EL2NSYNC", +[ 90] = "EL3HLT", +[ 91] = "EL3RST", +[ 92] = "ENOPKG", +[ 93] = "ELNRNG", +[ 94] = "EUNATCH", +[ 95] = "ENOCSI", +[ 96] = "EL2HLT", +[ 97] = "EBADE", +[ 98] = "EBADR", +[ 99] = "EXFULL", +[100] = "ENOANO", +[101] = "EBADRQC", +[102] = "EBADSLT", +[103] = "EDEADLOCK", +[104] = "EBFONT", +[105] = "ENONET", +[106] = "ENOLINK", +[107] = "EADV", +[108] = "ESRMNT", +[109] = "ECOMM", +[110] = "EMULTIHOP", +[111] = "EDOTDOT", +[112] = "EOVERFLOW", +[113] = "ENOTUNIQ", +[114] = "EBADFD", +[115] = "EREMCHG", +[116] = "EILSEQ", +[117] = "EUCLEAN", +[118] = "ENOTNAM", +[119] = "ENAVAIL", +[120] = "EISNAM", +[121] = "EREMOTEIO", +[122] = "ELIBACC", +[123] = "ELIBBAD", +[124] = "ELIBSCN", +[125] = "ELIBMAX", +[126] = "ELIBEXEC", +[127] = "ERESTART", +[128] = "ESTRPIPE", +[129] = "ENOMEDIUM", +[130] = "EMEDIUMTYPE", +[131] = "ECANCELED", +[132] = "ENOKEY", +[133] = "EKEYEXPIRED", +[134] = "EKEYREVOKED", +[135] = "EKEYREJECTED", +[136] = "EOWNERDEAD", +[137] = "ENOTRECOVERABLE", +[138] = "ERFKILL", +[139] = "EHWPOISON", +[512] = "ERESTARTSYS", +[513] = "ERESTARTNOINTR", +[514] = "ERESTARTNOHAND", +[515] = "ENOIOCTLCMD", +[516] = "ERESTART_RESTARTBLOCK", +[517] = "EPROBE_DEFER", +[518] = "EOPENSTALE", +[521] = "EBADHANDLE", +[522] = "ENOTSYNC", +[523] = "EBADCOOKIE", +[524] = "ENOTSUPP", +[525] = "ETOOSMALL", +[526] = "ESERVERFAULT", +[527] = "EBADTYPE", +[528] = "EJUKEBOX", +[529] = "EIOCBQUEUED", diff --git a/linux/alpha/get_error.c b/linux/alpha/get_error.c new file mode 100644 index 00000000..d4928d4b --- /dev/null +++ b/linux/alpha/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (alpha_a3) { + tcp->u_rval = -1; + tcp->u_error = alpha_r0; + } else { + tcp->u_rval = alpha_r0; + } +} diff --git a/linux/alpha/get_scno.c b/linux/alpha/get_scno.c new file mode 100644 index 00000000..3ffd78a6 --- /dev/null +++ b/linux/alpha/get_scno.c @@ -0,0 +1,26 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + kernel_ulong_t scno = 0; + + if (upeek(tcp->pid, REG_A3, &alpha_a3) < 0) + return -1; + if (upeek(tcp->pid, REG_R0, &scno) < 0) + return -1; + + /* + * Do some sanity checks to figure out if it's + * really a syscall entry + */ + if (!scno_in_range(scno)) { + if (alpha_a3 == 0 || alpha_a3 == -1UL) { + if (debug_flag) + error_msg("stray syscall exit: r0 = %lu", scno); + return 0; + } + } + + tcp->scno = scno; + return 1; +} diff --git a/linux/alpha/get_syscall_args.c b/linux/alpha/get_syscall_args.c new file mode 100644 index 00000000..a3857263 --- /dev/null +++ b/linux/alpha/get_syscall_args.c @@ -0,0 +1,11 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, REG_A0+i, &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/alpha/get_syscall_result.c b/linux/alpha/get_syscall_result.c new file mode 100644 index 00000000..f4c504f1 --- /dev/null +++ b/linux/alpha/get_syscall_result.c @@ -0,0 +1,6 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + return (upeek(tcp->pid, REG_A3, &alpha_a3) < 0 || + upeek(tcp->pid, REG_R0, &alpha_r0) < 0) ? -1 : 0; +} diff --git a/linux/alpha/ioctlent.h.in b/linux/alpha/ioctlent.h.in deleted file mode 100644 index db7d3282..00000000 --- a/linux/alpha/ioctlent.h.in +++ /dev/null @@ -1,73 +0,0 @@ - {"asm/ioctls.h", "TIOCEXCL", 0x540c}, - {"asm/ioctls.h", "TIOCNXCL", 0x540d}, - {"asm/ioctls.h", "TIOCSCTTY", 0x540e}, - {"asm/ioctls.h", "TIOCSTI", 0x5412}, - {"asm/ioctls.h", "TIOCMGET", 0x5415}, - {"asm/ioctls.h", "TIOCMBIS", 0x5416}, - {"asm/ioctls.h", "TIOCMBIC", 0x5417}, - {"asm/ioctls.h", "TIOCMSET", 0x5418}, - {"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, - {"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, - {"asm/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm/ioctls.h", "TIOCCONS", 0x541d}, - {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm/ioctls.h", "TIOCPKT", 0x5420}, - {"asm/ioctls.h", "TIOCNOTTY", 0x5422}, - {"asm/ioctls.h", "TIOCSETD", 0x5423}, - {"asm/ioctls.h", "TIOCGETD", 0x5424}, - {"asm/ioctls.h", "TCSBRKP", 0x5425}, - {"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426}, - {"asm/ioctls.h", "TIOCSBRK", 0x5427}, - {"asm/ioctls.h", "TIOCCBRK", 0x5428}, - {"asm/ioctls.h", "TIOCGSID", 0x5429}, - {"asm/ioctls.h", "TIOCGPTN", 0x5430}, - {"asm/ioctls.h", "TIOCSPTLCK", 0x5431}, - {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm/ioctls.h", "TIOCGHAYESESP", 0x545e}, - {"asm/ioctls.h", "TIOCSHAYESESP", 0x545f}, - {"asm/ioctls.h", "FIOCLEX", 0x6601}, - {"asm/ioctls.h", "FIONCLEX", 0x6602}, - {"asm/sockios.h", "FIOGETOWN", 0x667b}, - {"asm/sockios.h", "FIOSETOWN", 0x667c}, - {"asm/ioctls.h", "FIOASYNC", 0x667d}, - {"asm/ioctls.h", "FIONBIO", 0x667e}, - {"asm/ioctls.h", "FIONREAD", 0x667f}, - {"asm/sockios.h", "SIOCATMARK", 0x7307}, - {"asm/sockios.h", "SIOCSPGRP", 0x7308}, - {"asm/sockios.h", "SIOCGPGRP", 0x7309}, - {"asm/ioctls.h", "TIOCGETP", 0x7408}, - {"asm/ioctls.h", "TIOCSETP", 0x7409}, - {"asm/ioctls.h", "TIOCSETN", 0x740a}, - {"asm/ioctls.h", "TIOCSETC", 0x7411}, - {"asm/ioctls.h", "TIOCGETC", 0x7412}, - {"asm/ioctls.h", "TCGETS", 0x7413}, - {"asm/ioctls.h", "TCSETS", 0x7414}, - {"asm/ioctls.h", "TCSETSW", 0x7415}, - {"asm/ioctls.h", "TCSETSF", 0x7416}, - {"asm/ioctls.h", "TCGETA", 0x7417}, - {"asm/ioctls.h", "TCSETA", 0x7418}, - {"asm/ioctls.h", "TCSETAW", 0x7419}, - {"asm/ioctls.h", "TCSETAF", 0x741c}, - {"asm/ioctls.h", "TCSBRK", 0x741d}, - {"asm/ioctls.h", "TCXONC", 0x741e}, - {"asm/ioctls.h", "TCFLSH", 0x741f}, - {"asm/ioctls.h", "TIOCSWINSZ", 0x7467}, - {"asm/ioctls.h", "TIOCGWINSZ", 0x7468}, - {"asm/ioctls.h", "TIOCSTART", 0x746e}, - {"asm/ioctls.h", "TIOCSTOP", 0x746f}, - {"asm/ioctls.h", "TIOCOUTQ", 0x7473}, - {"asm/ioctls.h", "TIOCGLTC", 0x7474}, - {"asm/ioctls.h", "TIOCSLTC", 0x7475}, - {"asm/ioctls.h", "TIOCSPGRP", 0x7476}, - {"asm/ioctls.h", "TIOCGPGRP", 0x7477}, diff --git a/linux/alpha/ioctls_arch0.h b/linux/alpha/ioctls_arch0.h new file mode 100644 index 00000000..526f3fed --- /dev/null +++ b/linux/alpha/ioctls_arch0.h @@ -0,0 +1,82 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/alpha/include/ tree. */ +{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, +{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, +{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, +{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, +{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 }, +{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x7417, 0x12 }, +{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x7413, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x7418, 0x12 }, +{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x741c, 0x12 }, +{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x7419, 0x12 }, +{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x7414, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x7416, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x7415, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETC", _IOC_READ, 0x7412, 0x06 }, +{ "asm/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm/ioctls.h", "TIOCGETP", _IOC_READ, 0x7408, 0x06 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGLTC", _IOC_READ, 0x7474, 0x06 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, +{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 }, +{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, +{ "asm/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm/ioctls.h", "TIOCSETC", _IOC_WRITE, 0x7411, 0x06 }, +{ "asm/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm/ioctls.h", "TIOCSETN", _IOC_WRITE, 0x740a, 0x06 }, +{ "asm/ioctls.h", "TIOCSETP", _IOC_WRITE, 0x7409, 0x06 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSLTC", _IOC_WRITE, 0x7475, 0x06 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 }, +{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, +{ "asm/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, +{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 }, +{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 }, +{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 }, +{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 }, +{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 }, diff --git a/linux/alpha/ioctls_inc0.h b/linux/alpha/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/alpha/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/alpha/set_error.c b/linux/alpha/set_error.c new file mode 100644 index 00000000..bcc5ff86 --- /dev/null +++ b/linux/alpha/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + alpha_r0 = tcp->u_error; + return upoke(tcp->pid, REG_R0, alpha_r0); +} + +static int +arch_set_success(struct tcb *tcp) +{ + return upoke(tcp->pid, REG_A3, (alpha_a3 = 0)) + || upoke(tcp->pid, REG_R0, (alpha_r0 = tcp->u_rval)); +} diff --git a/linux/alpha/set_scno.c b/linux/alpha/set_scno.c new file mode 100644 index 00000000..d5bcfb6d --- /dev/null +++ b/linux/alpha/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, REG_R0, scno); +} diff --git a/linux/alpha/signalent.h b/linux/alpha/signalent.h index 2b507e3b..174b17b8 100644 --- a/linux/alpha/signalent.h +++ b/linux/alpha/signalent.h @@ -30,3 +30,4 @@ "SIGINFO", /* 29 */ "SIGUSR1", /* 30 */ "SIGUSR2", /* 31 */ + "SIGRTMIN", /* 32 */ diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h index 408854e0..b55f23ad 100644 --- a/linux/alpha/syscallent.h +++ b/linux/alpha/syscallent.h @@ -26,511 +26,453 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 6, 0, printargs, "osf_syscall" }, /* 0, not implemented */ - { 1, TP|SE, sys_exit, "exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 5, 0, printargs, "osf_old_open" }, /* 5, not implemented */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 4, TP, sys_osf_wait4, "osf_wait4" }, /* 7 */ - { 5, 0, printargs, "osf_old_creat" }, /* 8, not implemented */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 5, 0, printargs, "osf_execve" }, /* 11, not implemented */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "chown" }, /* 16 */ - { 1, TM|SI, sys_brk, "brk" }, /* 17 */ - { 5, 0, printargs, "osf_getfsstat" }, /* 18, not implemented */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getxpid" }, /* 20 */ - { 4, 0, printargs, "osf_mount" }, /* 21 */ - { 2, TF, sys_umount2, "umount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getxuid" }, /* 24 */ - { 5, 0, printargs, "exec_with_loader" }, /* 25, not implemented */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 5, 0, printargs, "osf_nrecvmsg" }, /* 27, not implemented */ - { 5, 0, printargs, "osf_nsendmsg" }, /* 28, not implemented */ - { 5, 0, printargs, "osf_nrecvfrom" }, /* 29, not implemented */ - { 5, 0, printargs, "osf_naccept" }, /* 30, not implemented */ - { 5, 0, printargs, "osf_ngetpeername" }, /* 31, not implemented */ - { 5, 0, printargs, "osf_ngetsockname" }, /* 32, not implemented */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 5, 0, printargs, "osf_chflags" }, /* 34, not implemented */ - { 5, 0, printargs, "osf_fchflags" }, /* 35, not implemented */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 5, 0, printargs, "osf_old_stat" }, /* 38, not implemented */ - { 2, 0, sys_setpgid, "setpgid" }, /* 39 */ - { 5, 0, printargs, "osf_old_lstat" }, /* 40, not implemented */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 5, 0, printargs, "osf_set_program_attributes" }, /* 43 */ - { 5, 0, printargs, "osf_profil" }, /* 44, not implemented */ - { 3, TD|TF, sys_open, "open" }, /* 45 */ - { 5, 0, printargs, "osf_old_sigaction" }, /* 46, not implemented */ - { 1, NF, sys_getgid, "getxgid" }, /* 47 */ - { 2, TS, sys_sigprocmask, "osf_sigprocmask" }, /* 48 */ - { 5, 0, printargs, "osf_getlogin" }, /* 49, not implemented */ - { 5, 0, printargs, "osf_setlogin" }, /* 50, not implemented */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 52 */ - { 5, 0, NULL, NULL }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 5, 0, printargs, "osf_reboot" }, /* 55, not implemented */ - { 5, 0, printargs, "osf_revoke" }, /* 56, not implemented */ - { 2, TF, sys_symlink, "symlink" }, /* 57 */ - { 3, TF, sys_readlink, "readlink" }, /* 58 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 5, 0, printargs, "osf_old_fstat" }, /* 62, not implemented */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 63 */ - { 0, 0, sys_getpagesize, "getpagesize" }, /* 64 */ - { 5, TM, printargs, "osf_mremap" }, /* 65, not implemented */ - { 0, TP, sys_vfork, "vfork" }, /* 66 */ - { 2, TF, sys_stat, "stat" }, /* 67 */ - { 2, TF, sys_lstat, "lstat" }, /* 68 */ - { 5, TM, printargs, "osf_sbrk" }, /* 69, not implemented */ - { 5, 0, printargs, "osf_sstk" }, /* 70, not implemented */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 71 */ - { 5, 0, printargs, "osf_old_vadvise" }, /* 72, not implemented */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 73 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 74 */ - { 3, TM, sys_madvise, "madvise" }, /* 75 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 76 */ - { 5, 0, printargs, "osf_kmodcall" }, /* 77, not implemented */ - { 5, TM, printargs, "osf_mincore" }, /* 78, not implemented */ - { 2, 0, sys_getgroups, "getgroups" }, /* 79 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 80 */ - { 5, 0, printargs, "osf_old_getpgrp" }, /* 81, not implemented */ - { 2, 0, sys_setpgrp, "setpgrp" }, /* 82 */ - { 3, 0, sys_osf_setitimer, "osf_setitimer" }, /* 83 */ - { 5, 0, printargs, "osf_old_wait" }, /* 84, not implemented */ - { 5, 0, printargs, "osf_table" }, /* 85, not implemented */ - { 2, 0, sys_osf_getitimer, "osf_getitimer" }, /* 86 */ - { 2, 0, sys_gethostname, "gethostname" }, /* 87 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 88 */ - { 0, 0, sys_getdtablesize, "getdtablesize" }, /* 89 */ - { 2, TD, sys_dup2, "dup2" }, /* 90 */ - { 2, TD, sys_fstat, "fstat" }, /* 91 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 92 */ - { 5, 0, sys_osf_select, "osf_select" }, /* 93 */ - { 3, TD, sys_poll, "poll" }, /* 94 */ - { 1, TD, sys_fsync, "fsync" }, /* 95 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 96 */ - { 3, TN, sys_socket, "socket" }, /* 97 */ - { 3, TN, sys_connect, "connect" }, /* 98 */ - { 3, TN, sys_accept, "accept" }, /* 99 */ - { 2, 0, sys_getpriority, "osf_getpriority" }, /* 100 */ - { 4, TN, sys_send, "send" }, /* 101 */ - { 4, TN, sys_recv, "recv" }, /* 102 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 103 */ - { 3, TN, sys_bind, "bind" }, /* 104 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 105 */ - { 2, TN, sys_listen, "listen" }, /* 106 */ - { 5, 0, printargs, "osf_plock" }, /* 107, not implemented */ - { 5, 0, printargs, "osf_old_sigvec" }, /* 108, not implemented */ - { 5, 0, printargs, "osf_old_sigblock" }, /* 109, not implemented */ - { 5, 0, printargs, "osf_old_sigsetmask" }, /* 110, not implemented */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 111 */ - { 5, 0, printargs, "sigstack" }, /* 112 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 113 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 114 */ - { 5, 0, printargs, "osf_old_vtrace" }, /* 115, not implemented */ - { 2, 0, sys_osf_gettimeofday, "osf_gettimeofday" }, /* 116 */ - { 2, 0, sys_osf_getrusage, "osf_getrusage" }, /* 117 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 118 */ - { 5, 0, NULL, NULL }, /* 119 */ - { 3, TD, sys_readv, "readv" }, /* 120 */ - { 3, TD, sys_writev, "writev" }, /* 121 */ - { 2, 0, sys_osf_settimeofday, "osf_settimeofday" }, /* 122 */ - { 3, TD, sys_fchown, "fchown" }, /* 123 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 124 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 125 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 126 */ - { 2, 0, sys_setregid, "setregid" }, /* 127 */ - { 2, TF, sys_rename, "rename" }, /* 128 */ - { 2, TF, sys_truncate, "truncate" }, /* 129 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 130 */ - { 2, TD, sys_flock, "flock" }, /* 131 */ - { 1, 0, sys_setgid, "setgid" }, /* 132 */ - { 6, TN, sys_sendto, "sendto" }, /* 133 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 134 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 135 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 136 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 137 */ - { 2, 0, sys_osf_utimes, "osf_utimes" }, /* 138 */ - { 5, 0, printargs, "osf_old_sigreturn" }, /* 139 */ - { 5, 0, printargs, "osf_adjtime" }, /* 140, not implemented */ - { 3, TN, sys_getpeername, "getpeername" }, /* 141 */ - { 5, 0, printargs, "osf_gethostid" }, /* 142, not implemented */ - { 5, 0, printargs, "osf_sethostid" }, /* 143, not implemented */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 144 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 145 */ - { 5, 0, printargs, "osf_old_killpg" }, /* 146, not implemented */ - { 0, 0, sys_setsid, "setsid" }, /* 147 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 148 */ - { 5, 0, printargs, "osf_oldquota" }, /* 149, not implemented */ - { 3, TN, sys_getsockname, "getsockname" }, /* 150 */ - { 5, 0, NULL, NULL }, /* 151 */ - { 5, 0, NULL, NULL }, /* 152 */ - { 5, 0, printargs, "osf_pid_block" }, /* 153, not implemented */ - { 5, 0, printargs, "osf_pid_unblock" }, /* 154, not implemented */ - { 5, 0, NULL, NULL }, /* 155 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 156 */ - { 5, 0, printargs, "osf_sigwaitprim" }, /* 157, not implemented */ - { 5, 0, printargs, "osf_nfssvc" }, /* 158, not implemented */ - { 4, 0, printargs, "osf_getdirentries" }, /* 159 */ - { 3, 0, osf_statfs, "osf_statfs" }, /* 160 */ - { 3, 0, osf_fstatfs, "osf_fstatfs" }, /* 161 */ - { 5, 0, NULL, NULL }, /* 162 */ - { 5, 0, printargs, "osf_asynch_daemon" }, /* 163, not implemented */ - { 5, 0, printargs, "osf_getfh" }, /* 164, not implemented */ - { 2, 0, printargs, "osf_getdomainname" }, /* 165 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 166 */ - { 5, 0, NULL, NULL }, /* 167 */ - { 5, 0, NULL, NULL }, /* 168 */ - { 5, 0, printargs, "osf_exportfs" }, /* 169, not implemented */ - { 5, 0, NULL, NULL }, /* 170 */ - { 5, 0, NULL, NULL }, /* 171 */ - { 5, 0, NULL, NULL }, /* 172 */ - { 5, 0, NULL, NULL }, /* 173 */ - { 5, 0, NULL, NULL }, /* 174 */ - { 5, 0, NULL, NULL }, /* 175 */ - { 5, 0, NULL, NULL }, /* 176 */ - { 5, 0, NULL, NULL }, /* 177 */ - { 5, 0, NULL, NULL }, /* 178 */ - { 5, 0, NULL, NULL }, /* 179 */ - { 5, 0, NULL, NULL }, /* 180 */ - { 5, 0, printargs, "osf_alt_plock" }, /* 181, not implemented */ - { 5, 0, NULL, NULL }, /* 182 */ - { 5, 0, NULL, NULL }, /* 183 */ - { 5, 0, printargs, "osf_getmnt" }, /* 184, not implemented */ - { 5, 0, NULL, NULL }, /* 185 */ - { 5, 0, NULL, NULL }, /* 186 */ - { 5, 0, printargs, "osf_alt_sigpending" }, /* 187, not implemented */ - { 5, 0, printargs, "osf_alt_setsid" }, /* 188, not implemented */ - { 5, 0, NULL, NULL }, /* 189 */ - { 5, 0, NULL, NULL }, /* 190 */ - { 5, 0, NULL, NULL }, /* 191 */ - { 5, 0, NULL, NULL }, /* 192 */ - { 5, 0, NULL, NULL }, /* 193 */ - { 5, 0, NULL, NULL }, /* 194 */ - { 5, 0, NULL, NULL }, /* 195 */ - { 5, 0, NULL, NULL }, /* 196 */ - { 5, 0, NULL, NULL }, /* 197 */ - { 5, 0, NULL, NULL }, /* 198 */ - { 4, 0, printargs, "osf_swapon" }, /* 199 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 200 */ - { 4, TI, sys_msgget, "msgget" }, /* 201 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 202 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 203 */ - { 4, TI, sys_semctl, "semctl" }, /* 204 */ - { 4, TI, sys_semget, "semget" }, /* 205 */ - { 4, TI, printargs, "semop" }, /* 206 */ - { 1, 0, printargs, "osf_utsname" }, /* 207 */ - { 3, TF, sys_chown, "lchown" }, /* 208 */ - { 3, TI|TM, printargs, "osf_shmat" }, /* 209 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 210 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 211 */ - { 4, TI, sys_shmget, "shmget" }, /* 212 */ - { 5, 0, printargs, "osf_mvalid" }, /* 213, not implemented */ - { 5, 0, printargs, "osf_getaddressconf" }, /* 214, not implemented */ - { 5, 0, printargs, "osf_msleep" }, /* 215, not implemented */ - { 5, 0, printargs, "osf_mwakeup" }, /* 216, not implemented */ - { 3, TM, sys_msync, "msync" }, /* 217 */ - { 5, 0, printargs, "osf_signal" }, /* 218, not implemented */ - { 5, 0, printargs, "osf_utc_gettime" }, /* 219, not implemented */ - { 5, 0, printargs, "osf_utc_adjtime" }, /* 220, not implemented */ - { 5, 0, NULL, NULL }, /* 221 */ - { 5, 0, printargs, "osf_security" }, /* 222, not implemented */ - { 5, 0, printargs, "osf_kloadcall" }, /* 223, not implemented */ - { 5, 0, NULL, NULL }, /* 224 */ - { 5, 0, NULL, NULL }, /* 225 */ - { 5, 0, NULL, NULL }, /* 226 */ - { 5, 0, NULL, NULL }, /* 227 */ - { 5, 0, NULL, NULL }, /* 228 */ - { 5, 0, NULL, NULL }, /* 229 */ - { 5, 0, NULL, NULL }, /* 230 */ - { 5, 0, NULL, NULL }, /* 231 */ - { 5, 0, NULL, NULL }, /* 232 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 233 */ - { 1, 0, sys_getsid, "getsid" }, /* 234 */ - { 5, TS, sys_sigaltstack, "sigaltstack" }, /* 235 */ - { 5, 0, printargs, "osf_waitid" }, /* 236, not implemented */ - { 5, 0, printargs, "osf_priocntlset" }, /* 237, not implemented */ - { 5, 0, printargs, "osf_sigsendset" }, /* 238, not implemented */ - { 5, 0, printargs, "osf_set_speculative" }, /* 239, not implemented */ - { 5, 0, printargs, "osf_msfs_syscall" }, /* 240, not implemented */ - { 5, 0, printargs, "osf_sysinfo" }, /* 241 */ - { 5, 0, printargs, "osf_uadmin" }, /* 242, not implemented */ - { 5, 0, printargs, "osf_fuser" }, /* 243, not implemented */ - { 2, 0, printargs, "osf_proplist_syscall" }, /* 244 */ - { 5, 0, printargs, "osf_ntp_adjtime" }, /* 245, not implemented */ - { 5, 0, printargs, "osf_ntp_gettime" }, /* 246, not implemented */ - { 5, 0, printargs, "osf_pathconf" }, /* 247, not implemented */ - { 5, 0, printargs, "osf_fpathconf" }, /* 248, not implemented */ - { 5, 0, NULL, NULL }, /* 249 */ - { 5, 0, printargs, "osf_uswitch" }, /* 250, not implemented */ - { 2, 0, printargs, "osf_usleep_thread" }, /* 251 */ - { 5, 0, printargs, "osf_audcntl" }, /* 252, not implemented */ - { 5, 0, printargs, "osf_audgen" }, /* 253, not implemented */ - { 5, 0, sys_sysfs, "sysfs" }, /* 254 */ - { 5, 0, printargs, "osf_subsysinfo" }, /* 255, not implemented */ - { 5, 0, printargs, "osf_getsysinfo" }, /* 256 */ - { 5, 0, printargs, "osf_setsysinfo" }, /* 257 */ - { 5, 0, printargs, "osf_afs_syscall" }, /* 258, not implemented */ - { 5, 0, printargs, "osf_swapctl" }, /* 259, not implemented */ - { 5, 0, printargs, "osf_memcntl" }, /* 260, not implemented */ - { 5, 0, printargs, "osf_fdatasync" }, /* 261, not implemented */ - { 5, 0, NULL, NULL }, /* 262 */ - { 5, 0, NULL, NULL }, /* 263 */ - { 5, 0, NULL, NULL }, /* 264 */ - { 5, 0, NULL, NULL }, /* 265 */ - { 5, 0, NULL, NULL }, /* 266 */ - { 5, 0, NULL, NULL }, /* 267 */ - { 5, 0, NULL, NULL }, /* 268 */ - { 5, 0, NULL, NULL }, /* 269 */ - { 5, 0, NULL, NULL }, /* 270 */ - { 5, 0, NULL, NULL }, /* 271 */ - { 5, 0, NULL, NULL }, /* 272 */ - { 5, 0, NULL, NULL }, /* 273 */ - { 5, 0, NULL, NULL }, /* 274 */ - { 5, 0, NULL, NULL }, /* 275 */ - { 5, 0, NULL, NULL }, /* 276 */ - { 5, 0, NULL, NULL }, /* 277 */ - { 5, 0, NULL, NULL }, /* 278 */ - { 5, 0, NULL, NULL }, /* 279 */ - { 5, 0, NULL, NULL }, /* 280 */ - { 5, 0, NULL, NULL }, /* 281 */ - { 5, 0, NULL, NULL }, /* 282 */ - { 5, 0, NULL, NULL }, /* 283 */ - { 5, 0, NULL, NULL }, /* 284 */ - { 5, 0, NULL, NULL }, /* 285 */ - { 5, 0, NULL, NULL }, /* 286 */ - { 5, 0, NULL, NULL }, /* 287 */ - { 5, 0, NULL, NULL }, /* 288 */ - { 5, 0, NULL, NULL }, /* 289 */ - { 5, 0, NULL, NULL }, /* 290 */ - { 5, 0, NULL, NULL }, /* 291 */ - { 5, 0, NULL, NULL }, /* 292 */ - { 5, 0, NULL, NULL }, /* 293 */ - { 5, 0, NULL, NULL }, /* 294 */ - { 5, 0, NULL, NULL }, /* 295 */ - { 5, 0, NULL, NULL }, /* 296 */ - { 5, 0, NULL, NULL }, /* 297 */ - { 5, 0, NULL, NULL }, /* 298 */ - { 5, 0, NULL, NULL }, /* 299 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 300 */ - { 3, 0, printargs, "sethae" }, /* 301 */ - { 5, TF, sys_mount, "mount" }, /* 302 */ - { 1, 0, sys_adjtimex, "adjtimex32" }, /* 303 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 304 */ - { 3, TD, sys_getdents, "getdents" }, /* 305 */ - { 2, 0, sys_create_module, "create_module" }, /* 306 */ - { 4, 0, sys_init_module, "init_module" }, /* 307 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 308 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms" }, /* 309 */ - { 3, 0, sys_syslog, "syslog" }, /* 310 */ - { 4, 0, sys_reboot, "reboot" }, /* 311 */ - { 5, TP, sys_clone, "clone" }, /* 312 */ - { 1, TF, sys_uselib, "uselib" }, /* 313 */ - { 2, TM, sys_mlock, "mlock" }, /* 314 */ - { 2, TM, sys_munlock, "munlock" }, /* 315 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 316 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 317 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 318 */ - { 1, 0, sys_sysctl, "sysctl" }, /* 319 */ - { 0, 0, sys_idle, "idle" }, /* 320 */ - { 1, TF, sys_umount, "oldumount" }, /* 321 */ - { 2, TF, sys_swapon, "swapon" }, /* 322 */ - { 1, 0, sys_times, "times" }, /* 323 */ - { 1, 0, sys_personality, "personality" }, /* 324 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 325 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 326 */ - { 2, 0, sys_ustat, "ustat" }, /* 327 */ - { 2, TF, sys_statfs, "statfs" }, /* 328 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 329 */ - { 2, 0, sys_sched_setparam, "sched_setparam" }, /* 330 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 331 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 332 */ - { 2, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 333 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 334 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max" }, /* 335 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min" }, /* 336 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval" }, /* 337 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 338 */ - { 1, 0, sys_uname, "uname" }, /* 339 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 340 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 341 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 342 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 343 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 344 */ - { 5, 0, printargs, "pciconfig_read" }, /* 345 */ - { 5, 0, printargs, "pciconfig_write" }, /* 346 */ - { 5, 0, sys_query_module, "query_module" }, /* 347 */ - { 5, 0, sys_prctl, "prctl" }, /* 348 */ - { 4, TD, sys_pread, "pread" }, /* 349 */ - { 4, TD, sys_pwrite, "pwrite" }, /* 350 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 351 */ - { 5, TS, sys_rt_sigaction, "rt_sigaction" }, /* 352 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 353 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 354 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 355 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 356 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 357 */ - { 5, TD, sys_select, "select" }, /* 358 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 359 */ - { 3, 0, sys_settimeofday, "settimeofday" }, /* 360 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 361 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 362 */ - { 2, TF, sys_utimes, "utimes" }, /* 363 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 364 */ - { 4, TP, sys_wait4, "wait4" }, /* 365 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 366 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 367 */ - { 2, 0, sys_capget, "capget" }, /* 368 */ - { 2, 0, sys_capset, "capset" }, /* 369 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 370 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 371 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 372 */ - { 4, 0, printargs, "dipc" }, /* 373, not implemented */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 374 */ - { 3, TM, sys_mincore, "mincore" }, /* 375 */ - { 3, 0, printargs, "pciconfig_iobase" }, /* 376 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 377 */ - { 0, 0, sys_gettid, "gettid" }, /* 378 */ - { 3, TD, sys_readahead, "readahead" }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 2, TS, sys_kill, "tkill" }, /* 381 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 382 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 383 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 384 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 385 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 386 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 387 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 388 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 389 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 390 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 391 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 392 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 393 */ - { 6, 0, sys_futex, "futex" }, /* 394 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 395 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 396 */ - { 5, 0, sys_tuxcall, "tuxcall" }, /* 397 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 398 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 399 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 400 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 401 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 402 */ - { 5, 0, NULL, NULL }, /* 403 */ - { 5, 0, NULL, NULL }, /* 404 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 405 */ - { 3, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 406 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 407 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 408 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 409 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 410 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 411 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 412 */ - { 4, TD, sys_fadvise64, "fadvise" }, /* 413 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 414 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 415 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 416 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 417 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 418 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 419 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 420 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 421 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 422 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 423 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 424 */ - { 2, TF, sys_stat64, "stat64" }, /* 425 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 426 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 427 */ - { 5, 0, sys_vserver, "vserver" }, /* 428 ??? */ - { 5, TM, printargs, "mbind" }, /* 429 ??? */ - { 5, TM, printargs, "get_mempolicy" }, /* 430 ??? */ - { 5, TM, printargs, "set_mempolicy" }, /* 431 ??? */ - { 4, 0, sys_mq_open, "mq_open" }, /* 432 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 433 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 434 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 435 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 436 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 437 */ - { 5, TP, sys_waitid, "waitid" }, /* 438 */ - { 5, 0, sys_add_key, "add_key" }, /* 439 */ - { 4, 0, sys_request_key, "request_key" }, /* 440 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 441 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 442 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 443 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 444 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 445 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 446 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 447 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 448 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 449 */ - { 4, TD|TF, sys_openat, "openat" }, /* 450 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 451 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 452 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 453 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 454 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 455 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 456 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 457 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 458 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 459 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 460 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 461 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 462 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 463 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 464 */ - { 1, TP, sys_unshare, "unshare" }, /* 465 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 466 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 467 */ - { 6, TD, sys_splice, "splice" }, /* 468 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 469 */ - { 4, TD, sys_tee, "tee" }, /* 470 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 471 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 472 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 473 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 474 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 475 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 476 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 477 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 478 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 479 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 480 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 481 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 482 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 483 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 484 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 485 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 486 */ - { 3, TD, sys_dup3, "dup3" }, /* 487 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 488 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 489 */ - { 4, TD, sys_preadv, "preadv" }, /* 490 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 491 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 492 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 493 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 494 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 495 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 496 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 497 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 498 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 499 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 500 */ - { 2, TD, sys_setns, "setns" }, /* 501 */ - { 4, TN, sys_accept4, "accept4" }, /* 502 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 503 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 504 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 505 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 506 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 507 */ +[ 0] = { 6, 0, SEN(printargs), "osf_syscall" }, /*not implemented */ +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 5, 0, SEN(printargs), "osf_old_open" }, /*not implemented */ +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 4, TP, SEN(osf_wait4), "osf_wait4" }, +[ 8] = { 5, 0, SEN(printargs), "osf_old_creat" }, /*not implemented */ +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 5, 0, SEN(printargs), "osf_execve" }, /*not implemented */ +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, TD, SEN(fchdir), "fchdir" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown), "chown" }, +[ 17] = { 1, TM|SI, SEN(brk), "brk" }, +[ 18] = { 5, 0, SEN(printargs), "osf_getfsstat" }, /*not implemented */ +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getxpid), "getxpid" }, +[ 21] = { 4, 0, SEN(printargs), "osf_mount" }, +[ 22] = { 2, TF, SEN(umount2), "umount" }, +[ 23] = { 1, 0, SEN(setuid), "setuid" }, +[ 24] = { 0, NF, SEN(getxuid), "getxuid" }, +[ 25] = { 5, 0, SEN(printargs), "exec_with_loader" }, /*not implemented */ +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 5, 0, SEN(printargs), "osf_nrecvmsg" }, /*not implemented */ +[ 28] = { 5, 0, SEN(printargs), "osf_nsendmsg" }, /*not implemented */ +[ 29] = { 5, 0, SEN(printargs), "osf_nrecvfrom" }, /*not implemented */ +[ 30] = { 5, 0, SEN(printargs), "osf_naccept" }, /*not implemented */ +[ 31] = { 5, 0, SEN(printargs), "osf_ngetpeername" }, /*not implemented */ +[ 32] = { 5, 0, SEN(printargs), "osf_ngetsockname" }, /*not implemented */ +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 5, 0, SEN(printargs), "osf_chflags" }, /*not implemented */ +[ 35] = { 5, 0, SEN(printargs), "osf_fchflags" }, /*not implemented */ +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 5, 0, SEN(printargs), "osf_old_stat" }, /*not implemented */ +[ 39] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 40] = { 5, 0, SEN(printargs), "osf_old_lstat" }, /*not implemented */ +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 0, TD, SEN(pipe), "pipe" }, +[ 43] = { 4, 0, SEN(printargs), "osf_set_program_attributes" }, +[ 44] = { 5, 0, SEN(printargs), "osf_profil" }, /*not implemented */ +[ 45] = { 3, TD|TF, SEN(open), "open" }, +[ 46] = { 5, 0, SEN(printargs), "osf_old_sigaction" }, /*not implemented */ +[ 47] = { 1, NF, SEN(getxgid), "getxgid" }, +[ 48] = { 2, TS, SEN(sigprocmask), "osf_sigprocmask" }, +[ 49] = { 5, 0, SEN(printargs), "osf_getlogin" }, /*not implemented */ +[ 50] = { 5, 0, SEN(printargs), "osf_setlogin" }, /*not implemented */ +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 53] = { }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 5, 0, SEN(printargs), "osf_reboot" }, /*not implemented */ +[ 56] = { 5, 0, SEN(printargs), "osf_revoke" }, /*not implemented */ +[ 57] = { 2, TF, SEN(symlink), "symlink" }, +[ 58] = { 3, TF, SEN(readlink), "readlink" }, +[ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 5, 0, SEN(printargs), "osf_old_fstat" }, /*not implemented */ +[ 63] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[ 65] = { 5, TM, SEN(printargs), "osf_mremap" }, /*not implemented */ +[ 66] = { 0, TP, SEN(vfork), "vfork" }, +[ 67] = { 2, TF, SEN(stat), "stat" }, +[ 68] = { 2, TF, SEN(lstat), "lstat" }, +[ 69] = { 5, TM, SEN(printargs), "osf_sbrk" }, /*not implemented */ +[ 70] = { 5, 0, SEN(printargs), "osf_sstk" }, /*not implemented */ +[ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 72] = { 5, 0, SEN(printargs), "osf_old_vadvise" }, /*not implemented */ +[ 73] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[ 75] = { 3, TM, SEN(madvise), "madvise" }, +[ 76] = { 0, 0, SEN(vhangup), "vhangup" }, +[ 77] = { 5, 0, SEN(printargs), "osf_kmodcall" }, /*not implemented */ +[ 78] = { 5, TM, SEN(printargs), "osf_mincore" }, /*not implemented */ +[ 79] = { 2, 0, SEN(getgroups), "getgroups" }, +[ 80] = { 2, 0, SEN(setgroups), "setgroups" }, +[ 81] = { 5, 0, SEN(printargs), "osf_old_getpgrp" }, /*not implemented */ +[ 82] = { 2, 0, SEN(setpgrp), "setpgrp" }, +[ 83] = { 3, 0, SEN(osf_setitimer), "osf_setitimer" }, +[ 84] = { 5, 0, SEN(printargs), "osf_old_wait" }, /*not implemented */ +[ 85] = { 5, 0, SEN(printargs), "osf_table" }, /*not implemented */ +[ 86] = { 2, 0, SEN(osf_getitimer), "osf_getitimer" }, +[ 87] = { 2, 0, SEN(gethostname), "gethostname" }, +[ 88] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 89] = { 0, 0, SEN(getdtablesize), "getdtablesize" }, +[ 90] = { 2, TD, SEN(dup2), "dup2" }, +[ 91] = { 2, TD, SEN(fstat), "fstat" }, +[ 92] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 93] = { 5, 0, SEN(osf_select), "osf_select" }, +[ 94] = { 3, TD, SEN(poll), "poll" }, +[ 95] = { 1, TD, SEN(fsync), "fsync" }, +[ 96] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 97] = { 3, TN, SEN(socket), "socket" }, +[ 98] = { 3, TN, SEN(connect), "connect" }, +[ 99] = { 3, TN, SEN(accept), "accept" }, +[100] = { 2, 0, SEN(getpriority), "getpriority" }, +[101] = { 4, TN, SEN(send), "send" }, +[102] = { 4, TN, SEN(recv), "recv" }, +[103] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[104] = { 3, TN, SEN(bind), "bind" }, +[105] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[106] = { 2, TN, SEN(listen), "listen" }, +[107] = { 5, 0, SEN(printargs), "osf_plock" }, /*not implemented */ +[108] = { 5, 0, SEN(printargs), "osf_old_sigvec" }, /*not implemented */ +[109] = { 5, 0, SEN(printargs), "osf_old_sigblock" }, /*not implemented */ +[110] = { 5, 0, SEN(printargs), "osf_old_sigsetmask" }, /*not implemented */ +[111] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[112] = { 2, 0, SEN(printargs), "osf_sigstack" }, +[113] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[114] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[115] = { 5, 0, SEN(printargs), "osf_old_vtrace" }, /*not implemented */ +[116] = { 2, 0, SEN(osf_gettimeofday), "osf_gettimeofday" }, +[117] = { 2, 0, SEN(osf_getrusage), "osf_getrusage" }, +[118] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[119] = { }, +[120] = { 3, TD, SEN(readv), "readv" }, +[121] = { 3, TD, SEN(writev), "writev" }, +[122] = { 2, 0, SEN(osf_settimeofday), "osf_settimeofday" }, +[123] = { 3, TD, SEN(fchown), "fchown" }, +[124] = { 2, TD, SEN(fchmod), "fchmod" }, +[125] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[126] = { 2, 0, SEN(setreuid), "setreuid" }, +[127] = { 2, 0, SEN(setregid), "setregid" }, +[128] = { 2, TF, SEN(rename), "rename" }, +[129] = { 2, TF, SEN(truncate), "truncate" }, +[130] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[131] = { 2, TD, SEN(flock), "flock" }, +[132] = { 1, 0, SEN(setgid), "setgid" }, +[133] = { 6, TN, SEN(sendto), "sendto" }, +[134] = { 2, TN, SEN(shutdown), "shutdown" }, +[135] = { 4, TN, SEN(socketpair), "socketpair" }, +[136] = { 2, TF, SEN(mkdir), "mkdir" }, +[137] = { 1, TF, SEN(rmdir), "rmdir" }, +[138] = { 2, 0, SEN(osf_utimes), "osf_utimes" }, +[139] = { 5, 0, SEN(printargs), "osf_old_sigreturn" }, +[140] = { 5, 0, SEN(printargs), "osf_adjtime" }, /*not implemented */ +[141] = { 3, TN, SEN(getpeername), "getpeername" }, +[142] = { 5, 0, SEN(printargs), "osf_gethostid" }, /*not implemented */ +[143] = { 5, 0, SEN(printargs), "osf_sethostid" }, /*not implemented */ +[144] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[145] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[146] = { 5, 0, SEN(printargs), "osf_old_killpg" }, /*not implemented */ +[147] = { 0, 0, SEN(setsid), "setsid" }, +[148] = { 4, TF, SEN(quotactl), "quotactl" }, +[149] = { 5, 0, SEN(printargs), "osf_oldquota" }, /*not implemented */ +[150] = { 3, TN, SEN(getsockname), "getsockname" }, +[151 ... 152] = { }, +[153] = { 5, 0, SEN(printargs), "osf_pid_block" }, /*not implemented */ +[154] = { 5, 0, SEN(printargs), "osf_pid_unblock" }, /*not implemented */ +[155] = { }, +[156] = { 3, TS, SEN(sigaction), "sigaction" }, +[157] = { 5, 0, SEN(printargs), "osf_sigwaitprim" }, /*not implemented */ +[158] = { 5, 0, SEN(printargs), "osf_nfssvc" }, /*not implemented */ +[159] = { 4, 0, SEN(printargs), "osf_getdirentries" }, +[160] = { 3, 0, SEN(osf_statfs), "osf_statfs" }, +[161] = { 3, 0, SEN(osf_fstatfs), "osf_fstatfs" }, +[162] = { }, +[163] = { 5, 0, SEN(printargs), "osf_asynch_daemon" }, /*not implemented */ +[164] = { 5, 0, SEN(printargs), "osf_getfh" }, /*not implemented */ +[165] = { 2, 0, SEN(printargs), "osf_getdomainname" }, +[166] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[167 ... 168] = { }, +[169] = { 5, 0, SEN(printargs), "osf_exportfs" }, /*not implemented */ +[170 ... 180] = { }, +[181] = { 5, 0, SEN(printargs), "osf_alt_plock" }, /*not implemented */ +[182 ... 183] = { }, +[184] = { 5, 0, SEN(printargs), "osf_getmnt" }, /*not implemented */ +[185 ... 186] = { }, +[187] = { 5, 0, SEN(printargs), "osf_alt_sigpending" }, /*not implemented */ +[188] = { 5, 0, SEN(printargs), "osf_alt_setsid" }, /*not implemented */ +[189 ... 198] = { }, +[199] = { 4, 0, SEN(printargs), "osf_swapon" }, +[200] = { 3, TI, SEN(msgctl), "msgctl" }, +[201] = { 2, TI, SEN(msgget), "msgget" }, +[202] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[203] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[204] = { 4, TI, SEN(semctl), "semctl" }, +[205] = { 3, TI, SEN(semget), "semget" }, +[206] = { 3, TI, SEN(semop), "semop" }, +[207] = { 1, 0, SEN(printargs), "osf_utsname" }, +[208] = { 3, TF, SEN(chown), "lchown" }, +[209] = { 3, TI|TM|SI, SEN(shmat), "osf_shmat" }, +[210] = { 3, TI, SEN(shmctl), "shmctl" }, +[211] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[212] = { 3, TI, SEN(shmget), "shmget" }, +[213] = { 5, 0, SEN(printargs), "osf_mvalid" }, /*not implemented */ +[214] = { 5, 0, SEN(printargs), "osf_getaddressconf" }, /*not implemented */ +[215] = { 5, 0, SEN(printargs), "osf_msleep" }, /*not implemented */ +[216] = { 5, 0, SEN(printargs), "osf_mwakeup" }, /*not implemented */ +[217] = { 3, TM, SEN(msync), "msync" }, +[218] = { 5, 0, SEN(printargs), "osf_signal" }, /*not implemented */ +[219] = { 5, 0, SEN(printargs), "osf_utc_gettime" }, /*not implemented */ +[220] = { 5, 0, SEN(printargs), "osf_utc_adjtime" }, /*not implemented */ +[221] = { }, +[222] = { 5, 0, SEN(printargs), "osf_security" }, /*not implemented */ +[223] = { 5, 0, SEN(printargs), "osf_kloadcall" }, /*not implemented */ +[224] = { 5, 0, SEN(printargs), "osf_stat" }, /*not implemented */ +[225] = { 5, 0, SEN(printargs), "osf_lstat" }, /*not implemented */ +[226] = { 5, 0, SEN(printargs), "osf_fstat" }, /*not implemented */ +[227] = { 3, 0, SEN(osf_statfs), "osf_statfs64" }, /*not implemented */ +[228] = { 3, 0, SEN(osf_fstatfs), "osf_fstatfs64" }, /*not implemented */ +[229 ... 232] = { }, +[233] = { 1, 0, SEN(getpgid), "getpgid" }, +[234] = { 1, 0, SEN(getsid), "getsid" }, +[235] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[236] = { 5, 0, SEN(printargs), "osf_waitid" }, /*not implemented */ +[237] = { 5, 0, SEN(printargs), "osf_priocntlset" }, /*not implemented */ +[238] = { 5, 0, SEN(printargs), "osf_sigsendset" }, /*not implemented */ +[239] = { 5, 0, SEN(printargs), "osf_set_speculative" }, /*not implemented */ +[240] = { 5, 0, SEN(printargs), "osf_msfs_syscall" }, /*not implemented */ +[241] = { 5, 0, SEN(printargs), "osf_sysinfo" }, +[242] = { 5, 0, SEN(printargs), "osf_uadmin" }, /*not implemented */ +[243] = { 5, 0, SEN(printargs), "osf_fuser" }, /*not implemented */ +[244] = { 2, 0, SEN(printargs), "osf_proplist_syscall" }, +[245] = { 5, 0, SEN(printargs), "osf_ntp_adjtime" }, /*not implemented */ +[246] = { 5, 0, SEN(printargs), "osf_ntp_gettime" }, /*not implemented */ +[247] = { 5, 0, SEN(printargs), "osf_pathconf" }, /*not implemented */ +[248] = { 5, 0, SEN(printargs), "osf_fpathconf" }, /*not implemented */ +[249] = { }, +[250] = { 5, 0, SEN(printargs), "osf_uswitch" }, /*not implemented */ +[251] = { 2, 0, SEN(printargs), "osf_usleep_thread" }, +[252] = { 5, 0, SEN(printargs), "osf_audcntl" }, /*not implemented */ +[253] = { 5, 0, SEN(printargs), "osf_audgen" }, /*not implemented */ +[254] = { 3, 0, SEN(sysfs), "sysfs" }, +[255] = { 5, 0, SEN(printargs), "osf_subsys_info" }, /*not implemented */ +[256] = { 5, 0, SEN(printargs), "osf_getsysinfo" }, +[257] = { 5, 0, SEN(printargs), "osf_setsysinfo" }, +[258] = { 5, 0, SEN(printargs), "osf_afs_syscall" }, /*not implemented */ +[259] = { 5, 0, SEN(printargs), "osf_swapctl" }, /*not implemented */ +[260] = { 5, 0, SEN(printargs), "osf_memcntl" }, /*not implemented */ +[261] = { 5, 0, SEN(printargs), "osf_fdatasync" }, /*not implemented */ +[262 ... 299] = { }, +[300] = { 2, 0, SEN(bdflush), "bdflush" }, +[301] = { 3, 0, SEN(printargs), "sethae" }, +[302] = { 5, TF, SEN(mount), "mount" }, +[303] = { 1, 0, SEN(adjtimex), "old_adjtimex" }, +[304] = { 1, TF, SEN(swapoff), "swapoff" }, +[305] = { 3, TD, SEN(getdents), "getdents" }, +[306] = { 2, 0, SEN(create_module), "create_module" }, +[307] = { 3, 0, SEN(init_module), "init_module" }, +[308] = { 2, 0, SEN(delete_module), "delete_module" }, +[309] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[310] = { 3, 0, SEN(syslog), "syslog" }, +[311] = { 4, 0, SEN(reboot), "reboot" }, +[312] = { 5, TP, SEN(clone), "clone" }, +[313] = { 1, TF, SEN(uselib), "uselib" }, +[314] = { 2, TM, SEN(mlock), "mlock" }, +[315] = { 2, TM, SEN(munlock), "munlock" }, +[316] = { 1, TM, SEN(mlockall), "mlockall" }, +[317] = { 0, TM, SEN(munlockall), "munlockall" }, +[318] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[319] = { 1, 0, SEN(sysctl), "_sysctl" }, +[320] = { }, +[321] = { 1, TF, SEN(umount), "oldumount" }, +[322] = { 2, TF, SEN(swapon), "swapon" }, +[323] = { 1, 0, SEN(times), "times" }, +[324] = { 1, NF, SEN(personality), "personality" }, +[325] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[326] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[327] = { 2, 0, SEN(ustat), "ustat" }, +[328] = { 2, TF, SEN(statfs), "statfs" }, +[329] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[330] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[331] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[332] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[333] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[334] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[335] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[336] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[337] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[338] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[339] = { 1, 0, SEN(uname), "uname" }, +[340] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[341] = { 5, TM|SI, SEN(mremap), "mremap" }, +[342] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[343] = { 3, 0, SEN(setresuid), "setresuid" }, +[344] = { 3, 0, SEN(getresuid), "getresuid" }, +[345] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[346] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[347] = { 5, 0, SEN(query_module), "query_module" }, +[348] = { 5, 0, SEN(prctl), "prctl" }, +[349] = { 4, TD, SEN(pread), "pread64" }, +[350] = { 4, TD, SEN(pwrite), "pwrite64" }, +[351] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[352] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" }, +[353] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[354] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[355] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[356] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[357] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[358] = { 5, TD, SEN(select), "select" }, +[359] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[360] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[361] = { 2, 0, SEN(getitimer), "getitimer" }, +[362] = { 3, 0, SEN(setitimer), "setitimer" }, +[363] = { 2, TF, SEN(utimes), "utimes" }, +[364] = { 2, 0, SEN(getrusage), "getrusage" }, +[365] = { 4, TP, SEN(wait4), "wait4" }, +[366] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[367] = { 2, TF, SEN(getcwd), "getcwd" }, +[368] = { 2, 0, SEN(capget), "capget" }, +[369] = { 2, 0, SEN(capset), "capset" }, +[370] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[371] = { 3, 0, SEN(setresgid), "setresgid" }, +[372] = { 3, 0, SEN(getresgid), "getresgid" }, +[373] = { 4, 0, SEN(printargs), "dipc" }, /*not implemented */ +[374] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[375] = { 3, TM, SEN(mincore), "mincore" }, +[376] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, +[377] = { 3, TD, SEN(getdents64), "getdents64" }, +[378] = { 0, NF, SEN(gettid), "gettid" }, +[379] = { 3, TD, SEN(readahead), "readahead" }, +[380] = { }, +[381] = { 2, TS, SEN(kill), "tkill" }, +[382] = { 5, TF, SEN(setxattr), "setxattr" }, +[383] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[384] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[385] = { 4, TF, SEN(getxattr), "getxattr" }, +[386] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[387] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[388] = { 3, TF, SEN(listxattr), "listxattr" }, +[389] = { 3, TF, SEN(listxattr), "llistxattr" }, +[390] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[391] = { 2, TF, SEN(removexattr), "removexattr" }, +[392] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[393] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[394] = { 6, 0, SEN(futex), "futex" }, +[395] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[396] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[397] = { 5, 0, SEN(tuxcall), "tuxcall" }, +[398] = { 2, TM, SEN(io_setup), "io_setup" }, +[399] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[400] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[401] = { 3, 0, SEN(io_submit), "io_submit" }, +[402] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[403 ... 404] = { }, +[405] = { 1, TP|SE, SEN(exit), "exit_group" }, +[406] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[407] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[408] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[409] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[410] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[411] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[412] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[413] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[414] = { 3, 0, SEN(timer_create), "timer_create" }, +[415] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[416] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[417] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[418] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[419] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[420] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[421] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[422] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[423] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[424] = { 3, TS, SEN(tgkill), "tgkill" }, +[425] = { 2, TF, SEN(stat64), "stat64" }, +[426] = { 2, TF, SEN(lstat64), "lstat64" }, +[427] = { 2, TD, SEN(fstat64), "fstat64" }, +[428] = { 5, 0, SEN(vserver), "vserver" }, +[429] = { 6, TM, SEN(mbind), "mbind" }, +[430] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[431] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[432] = { 4, 0, SEN(mq_open), "mq_open" }, +[433] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[434] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[435] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[436] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[437] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[438] = { 5, TP, SEN(waitid), "waitid" }, +[439] = { 5, 0, SEN(add_key), "add_key" }, +[440] = { 4, 0, SEN(request_key), "request_key" }, +[441] = { 5, 0, SEN(keyctl), "keyctl" }, +[442] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[443] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[444] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[445] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[446] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[447] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[448] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[449] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[450] = { 4, TD|TF, SEN(openat), "openat" }, +[451] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[452] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[453] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[454] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[455] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[456] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[457] = { 4, TD|TF, SEN(renameat), "renameat" }, +[458] = { 5, TD|TF, SEN(linkat), "linkat" }, +[459] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[460] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[461] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[462] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[463] = { 6, TD, SEN(pselect6), "pselect6" }, +[464] = { 5, TD, SEN(ppoll), "ppoll" }, +[465] = { 1, TP, SEN(unshare), "unshare" }, +[466] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[467] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[468] = { 6, TD, SEN(splice), "splice" }, +[469] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[470] = { 4, TD, SEN(tee), "tee" }, +[471] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[472] = { 6, TM, SEN(move_pages), "move_pages" }, +[473] = { 3, 0, SEN(getcpu), "getcpu" }, +[474] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[475] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[476] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[477] = { 4, TD, SEN(timerfd), "timerfd" }, +[478] = { 1, TD, SEN(eventfd), "eventfd" }, +[479] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[480] = { 4, TD, SEN(fallocate), "fallocate" }, +[481] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[482] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[483] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[484] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[485] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[486] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[487] = { 3, TD, SEN(dup3), "dup3" }, +[488] = { 2, TD, SEN(pipe2), "pipe2" }, +[489] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[490] = { 4, TD, SEN(preadv), "preadv" }, +[491] = { 4, TD, SEN(pwritev), "pwritev" }, +[492] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[493] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[494] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[495] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[496] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[497] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[498] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[499] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[500] = { 1, TD, SEN(syncfs), "syncfs" }, +[501] = { 2, TD, SEN(setns), "setns" }, +[502] = { 4, TN, SEN(accept4), "accept4" }, +[503] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[504] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[505] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[506] = { 5, 0, SEN(kcmp), "kcmp" }, +[507] = { 3, TD, SEN(finit_module), "finit_module" }, +[508] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[509] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[510] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[511] = { 3, 0, SEN(getrandom), "getrandom" }, +[512] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[513] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, diff --git a/linux/alpha/userent.h b/linux/alpha/userent.h new file mode 100644 index 00000000..3a043b56 --- /dev/null +++ b/linux/alpha/userent.h @@ -0,0 +1,67 @@ +{ 0, "r0" }, +{ 1, "r1" }, +{ 2, "r2" }, +{ 3, "r3" }, +{ 4, "r4" }, +{ 5, "r5" }, +{ 6, "r6" }, +{ 7, "r7" }, +{ 8, "r8" }, +{ 9, "r9" }, +{ 10, "r10" }, +{ 11, "r11" }, +{ 12, "r12" }, +{ 13, "r13" }, +{ 14, "r14" }, +{ 15, "r15" }, +{ 16, "r16" }, +{ 17, "r17" }, +{ 18, "r18" }, +{ 19, "r19" }, +{ 20, "r20" }, +{ 21, "r21" }, +{ 22, "r22" }, +{ 23, "r23" }, +{ 24, "r24" }, +{ 25, "r25" }, +{ 26, "r26" }, +{ 27, "r27" }, +{ 28, "r28" }, +{ 29, "gp" }, +{ 30, "fp" }, +{ 31, "zero" }, +{ 32, "fp0" }, +{ 33, "fp" }, +{ 34, "fp2" }, +{ 35, "fp3" }, +{ 36, "fp4" }, +{ 37, "fp5" }, +{ 38, "fp6" }, +{ 39, "fp7" }, +{ 40, "fp8" }, +{ 41, "fp9" }, +{ 42, "fp10" }, +{ 43, "fp11" }, +{ 44, "fp12" }, +{ 45, "fp13" }, +{ 46, "fp14" }, +{ 47, "fp15" }, +{ 48, "fp16" }, +{ 49, "fp17" }, +{ 50, "fp18" }, +{ 51, "fp19" }, +{ 52, "fp20" }, +{ 53, "fp21" }, +{ 54, "fp22" }, +{ 55, "fp23" }, +{ 56, "fp24" }, +{ 57, "fp25" }, +{ 58, "fp26" }, +{ 59, "fp27" }, +{ 60, "fp28" }, +{ 61, "fp29" }, +{ 62, "fp30" }, +{ 63, "fp31" }, +{ 64, "pc" }, +/* Other fields in "struct user" */ +#include "../userent0.h" diff --git a/linux/arc/arch_regs.c b/linux/arc/arch_regs.c new file mode 100644 index 00000000..18460080 --- /dev/null +++ b/linux/arc/arch_regs.c @@ -0,0 +1,3 @@ +static struct user_regs_struct arc_regs; +#define ARCH_REGS_FOR_GETREGSET arc_regs +#define ARCH_PC_REG arc_regs.efa diff --git a/linux/arc/get_error.c b/linux/arc/get_error.c new file mode 100644 index 00000000..e19debc1 --- /dev/null +++ b/linux/arc/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(arc_regs.scratch.r0)) { + tcp->u_rval = -1; + tcp->u_error = -arc_regs.scratch.r0; + } else { + tcp->u_rval = arc_regs.scratch.r0; + } +} diff --git a/linux/arc/get_scno.c b/linux/arc/get_scno.c new file mode 100644 index 00000000..d2046b2d --- /dev/null +++ b/linux/arc/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = arc_regs.scratch.r8; + return 1; +} diff --git a/linux/arc/get_syscall_args.c b/linux/arc/get_syscall_args.c new file mode 100644 index 00000000..85e867f0 --- /dev/null +++ b/linux/arc/get_syscall_args.c @@ -0,0 +1,11 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + unsigned long *arc_args = &arc_regs.scratch.r0; + unsigned int i; + + for (i = 0; i < MAX_ARGS; ++i) + tcp->u_arg[i] = *arc_args--; + return 1; +} diff --git a/linux/arc/ioctlent.h.in b/linux/arc/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/arc/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/arc/ioctls_arch0.h b/linux/arc/ioctls_arch0.h new file mode 100644 index 00000000..2103d5b0 --- /dev/null +++ b/linux/arc/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arc/include/ tree. */ diff --git a/linux/arc/ioctls_inc0.h b/linux/arc/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/arc/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/arc/set_error.c b/linux/arc/set_error.c new file mode 100644 index 00000000..afc9bd50 --- /dev/null +++ b/linux/arc/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + arc_regs.scratch.r0 = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + arc_regs.scratch.r0 = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/arc/set_scno.c b/linux/arc/set_scno.c new file mode 100644 index 00000000..ea25d74d --- /dev/null +++ b/linux/arc/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + arc_regs.scratch.r8 = scno; + return set_regs(tcp->pid); +} diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h index 6bc9f276..edcdff2e 100644 --- a/linux/arc/syscallent.h +++ b/linux/arc/syscallent.h @@ -1,264 +1,8 @@ - { 2, 0, sys_io_setup, "io_setup" }, /* 0 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 1 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 2 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 3 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 4 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 5 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 6 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 7 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 8 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 9 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 10 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 11 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 12 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 13 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 14 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 15 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 16 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 17 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 18 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 19 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 20 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 21 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 22 */ - { 1, TD, sys_dup, "dup" }, /* 23 */ - { 3, TD, sys_dup3, "dup3" }, /* 24 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 25 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 26 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 27 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 28 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 29 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 30 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 31 */ - { 2, TD, sys_flock, "flock" }, /* 32 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 33 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 34 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 35 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 36 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 37 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 38 */ - { 2, TF, sys_umount2, "umount2" }, /* 39 */ - { 5, TF, sys_mount, "mount" }, /* 40 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 41 */ - { }, /* 42 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 43 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 44 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 45 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 46 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 47 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 48 */ - { 1, TF, sys_chdir, "chdir" }, /* 49 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 50 */ - { 1, TF, sys_chroot, "chroot" }, /* 51 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 52 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 53 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 54 */ - { 3, TD, sys_fchown, "fchown" }, /* 55 */ - { 4, TD|TF, sys_openat, "openat" }, /* 56 */ - { 1, TD, sys_close, "close" }, /* 57 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 58 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 59 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 60 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 61 */ - { 5, TD, sys_llseek, "_llseek" }, /* 62 */ - { 3, TD, sys_read, "read" }, /* 63 */ - { 3, TD, sys_write, "write" }, /* 64 */ - { 3, TD, sys_readv, "readv" }, /* 65 */ - { 3, TD, sys_writev, "writev" }, /* 66 */ - { 5, TD, sys_pread, "pread64" }, /* 67 */ - { 5, TD, sys_pwrite, "pwrite64" }, /* 68 */ - { 5, TD, sys_preadv, "preadv" }, /* 69 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 70 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 71 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 72 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 73 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 74 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 75 */ - { 6, TD, sys_splice, "splice" }, /* 76 */ - { 4, TD, sys_tee, "tee" }, /* 77 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 78 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 79 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 80 */ - { 0, 0, sys_sync, "sync" }, /* 81 */ - { 1, TD, sys_fsync, "fsync" }, /* 82 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 83 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 84 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 85 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 86 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 87 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 88 */ - { 1, TF, sys_acct, "acct" }, /* 89 */ - { 2, 0, sys_capget, "capget" }, /* 90 */ - { 2, 0, sys_capset, "capset" }, /* 91 */ - { 1, 0, sys_personality, "personality" }, /* 92 */ - { 1, TP|SE, sys_exit, "exit" }, /* 93 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 94 */ - { 5, TP, sys_waitid, "waitid" }, /* 95 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 96 */ - { 1, TP, sys_unshare, "unshare" }, /* 97 */ - { 6, 0, sys_futex, "futex" }, /* 98 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 99 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 100 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 101 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 102 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 103 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 104 */ - { 3, 0, sys_init_module, "init_module" }, /* 105 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 106 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 107 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 108 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 109 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 110 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 111 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 112 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 113 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 114 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 115 */ - { 3, 0, sys_syslog, "syslog" }, /* 116 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 117 */ - { 2, 0, sys_sched_setparam, "sched_setparam" }, /* 118 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 119 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 120 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 121 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 122 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 123 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 124 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max"}, /* 125 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min"}, /* 126 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 127 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 128 */ - { 2, TS, sys_kill, "kill" }, /* 129 */ - { 2, TS, sys_kill, "tkill" }, /* 130 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 131 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 132 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 133 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 134 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 135 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 136 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 137 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 138 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 139 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 140 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 141 */ - { 4, 0, sys_reboot, "reboot" }, /* 142 */ - { 2, 0, sys_setregid, "setregid" }, /* 143 */ - { 1, 0, sys_setgid, "setgid" }, /* 144 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 145 */ - { 1, 0, sys_setuid, "setuid" }, /* 146 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 147 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 148 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 149 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 150 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 151 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 152 */ - { 1, 0, sys_times, "times" }, /* 153 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 154 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 155 */ - { 1, 0, sys_getsid, "getsid" }, /* 156 */ - { 0, 0, sys_setsid, "setsid" }, /* 157 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 158 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 159 */ - { 1, 0, sys_uname, "uname" }, /* 160 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 161 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 162 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 163 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 164 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 165 */ - { 1, 0, sys_umask, "umask" }, /* 166 */ - { 5, 0, sys_prctl, "prctl" }, /* 167 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 168 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 169 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 170 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 171 */ - { 0, 0, sys_getpid, "getpid" }, /* 172 */ - { 0, 0, sys_getppid, "getppid" }, /* 173 */ - { 0, NF, sys_getuid, "getuid" }, /* 174 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 175 */ - { 0, NF, sys_getgid, "getgid" }, /* 176 */ - { 0, NF, sys_getegid, "getegid" }, /* 177 */ - { 0, 0, sys_gettid, "gettid" }, /* 178 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 179 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 180 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 181 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 182 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 183 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 184 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 185 */ - { 2, TI, sys_msgget, "msgget" }, /* 186 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 187 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 188 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 189 */ - { 3, TI, sys_semget, "semget" }, /* 190 */ - { 4, TI, sys_semctl, "semctl" }, /* 191 */ - { 4, TI, sys_semtimedop, "semtimedop" }, /* 192 */ - { 3, TI, sys_semop, "semop" }, /* 193 */ - { 3, TI, sys_shmget, "shmget" }, /* 194 */ - { 3, TI, sys_shmctl, "shmctl" }, /* 195 */ - { 3, TI|TM|SI, sys_shmat, "shmat" }, /* 196 */ - { 1, TI|TM|SI, sys_shmdt, "shmdt" }, /* 197 */ - { 3, TN, sys_socket, "socket" }, /* 198 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 199 */ - { 3, TN, sys_bind, "bind" }, /* 200 */ - { 2, TN, sys_listen, "listen" }, /* 201 */ - { 3, TN, sys_accept, "accept" }, /* 202 */ - { 3, TN, sys_connect, "connect" }, /* 203 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 204 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 205 */ - { 6, TN, sys_sendto, "sendto" }, /* 206 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 207 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 208 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 209 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 210 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 211 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 212 */ - { 4, TD, sys_readahead, "readahead" }, /* 213 */ - { 1, TM|SI, sys_brk, "brk" }, /* 214 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 215 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 216 */ - { 5, 0, sys_add_key, "add_key" }, /* 217 */ - { 4, 0, sys_request_key, "request_key" }, /* 218 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 219 */ - { 5, TP, sys_clone, "clone" }, /* 220 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 221 */ - { 6, TD|TM|SI, sys_mmap, "mmap2" }, /* 222 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 223 */ - { 2, TF, sys_swapon, "swapon" }, /* 224 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 225 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 226 */ - { 3, TM, sys_msync, "msync" }, /* 227 */ - { 2, TM, sys_mlock, "mlock" }, /* 228 */ - { 2, TM, sys_munlock, "munlock" }, /* 229 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 230 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 231 */ - { 3, TM, sys_mincore, "mincore" }, /* 232 */ - { 3, TM, sys_madvise, "madvise" }, /* 233 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 234 */ - { 6, TM, sys_mbind, "mbind" }, /* 235 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 236 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 237 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 238 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 239 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 240 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 241 */ - { 4, TN, sys_accept4, "accept4" }, /* 242 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 243 */ - { 3, 0, printargs, "arc_cacheflush" }, /* 244 */ - { 1, 0, printargs, "arc_settls" }, /* 245 */ - { 0, 0, printargs, "arc_gettls" }, /* 246 */ - - [247 ... 259] = { }, - - { 4, TP, sys_wait4, "wait4" }, /* 260 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 261 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 262 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 263 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 264 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 265 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 266 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 267 */ - { 2, TD, sys_setns, "setns" }, /* 268 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 269 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 270 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 271 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 272 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 273 */ +#define sys_ARCH_mmap sys_mmap_pgoff +#include "32/syscallent.h" +/* [244 ... 259] are arch specific */ +[244] = { 3, 0, SEN(printargs), "cacheflush" }, +[245] = { 1, 0, SEN(printargs), "arc_settls" }, +[246] = { 0, 0, SEN(printargs), "arc_gettls" }, +[247] = { 3, 0, SEN(sysfs), "sysfs" }, +[248] = { 3, 0, SEN(printargs), "arc_usr_cmpxchg"}, diff --git a/linux/arch_regs.h b/linux/arch_regs.h new file mode 100644 index 00000000..da84fa5f --- /dev/null +++ b/linux/arch_regs.h @@ -0,0 +1 @@ +/* nothing */ diff --git a/linux/arch_sigreturn.c b/linux/arch_sigreturn.c new file mode 100644 index 00000000..73a2b103 --- /dev/null +++ b/linux/arch_sigreturn.c @@ -0,0 +1,6 @@ +#warning sigreturn/rt_sigreturn signal mask decoding is not implemented for this architecture + +static void +arch_sigreturn(struct tcb *tcp) +{ +} diff --git a/linux/arm/arch_regs.c b/linux/arm/arch_regs.c new file mode 100644 index 00000000..8b73cb86 --- /dev/null +++ b/linux/arm/arch_regs.c @@ -0,0 +1,5 @@ +static struct pt_regs arm_regs; +unsigned long *const arm_sp_ptr = (unsigned long *) &arm_regs.ARM_sp; + +#define ARCH_REGS_FOR_GETREGS arm_regs +#define ARCH_PC_REG arm_regs.ARM_pc diff --git a/linux/arm/arch_regs.h b/linux/arm/arch_regs.h new file mode 100644 index 00000000..4edd50c7 --- /dev/null +++ b/linux/arm/arch_regs.h @@ -0,0 +1 @@ +extern unsigned long *const arm_sp_ptr; diff --git a/linux/arm/arch_sigreturn.c b/linux/arm/arch_sigreturn.c new file mode 100644 index 00000000..378ba67f --- /dev/null +++ b/linux/arm/arch_sigreturn.c @@ -0,0 +1,19 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ +#define SIZEOF_STRUCT_SIGINFO 128 +#define SIZEOF_STRUCT_SIGCONTEXT (21 * 4) +#define OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK (5 * 4 + SIZEOF_STRUCT_SIGCONTEXT) + + const unsigned long addr = +#ifdef AARCH64 + tcp->currpers == 0 ? + (*aarch64_sp_ptr + SIZEOF_STRUCT_SIGINFO + + offsetof(struct ucontext, uc_sigmask)) : +#endif + (*arm_sp_ptr + + OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK); + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/arm/get_error.c b/linux/arm/get_error.c new file mode 100644 index 00000000..fa81dd76 --- /dev/null +++ b/linux/arm/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(arm_regs.ARM_r0)) { + tcp->u_rval = -1; + tcp->u_error = -arm_regs.ARM_r0; + } else { + tcp->u_rval = arm_regs.ARM_r0; + } +} diff --git a/linux/arm/get_scno.c b/linux/arm/get_scno.c new file mode 100644 index 00000000..d2bc0682 --- /dev/null +++ b/linux/arm/get_scno.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2003 Russell King + * Copyright (c) 2011-2013 Denys Vlasenko + * Copyright (c) 2011-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + kernel_ulong_t scno = 0; + + /* Note: we support only 32-bit CPUs, not 26-bit */ + +#if !defined(__ARM_EABI__) || ENABLE_ARM_OABI + if (arm_regs.ARM_cpsr & 0x20) { + /* Thumb mode */ + goto scno_in_r7; + } + /* ARM mode */ + /* Check EABI/OABI by examining SVC insn's low 24 bits */ + errno = 0; + scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *)(arm_regs.ARM_pc - 4), NULL); + if (errno) + return -1; + /* EABI syscall convention? */ + if (scno != 0xef000000) { + /* No, it's OABI */ + if ((scno & 0x0ff00000) != 0x0f900000) { + error_msg("pid %d unknown syscall trap 0x%08lx", + tcp->pid, scno); + return -1; + } + /* Fixup the syscall number */ + scno &= 0x000fffff; + } else { + scno_in_r7: + scno = arm_regs.ARM_r7; + } +#else /* __ARM_EABI__ || !ENABLE_ARM_OABI */ + + scno = arm_regs.ARM_r7; + +#endif + + scno = shuffle_scno(scno); + + /* + * Do some sanity checks to figure out + * whether it's really a syscall entry. + */ + if (arm_regs.ARM_ip && !scno_in_range(scno)) { + if (debug_flag) + error_msg("pid %d stray syscall exit:" + " ARM_ip = %ld, scno = %ld", + tcp->pid, arm_regs.ARM_ip, + shuffle_scno(scno)); + return 0; + } + + tcp->scno = scno; + return 1; +} diff --git a/linux/arm/get_syscall_args.c b/linux/arm/get_syscall_args.c new file mode 100644 index 00000000..6be17501 --- /dev/null +++ b/linux/arm/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = arm_regs.uregs[0]; + tcp->u_arg[1] = arm_regs.uregs[1]; + tcp->u_arg[2] = arm_regs.uregs[2]; + tcp->u_arg[3] = arm_regs.uregs[3]; + tcp->u_arg[4] = arm_regs.uregs[4]; + tcp->u_arg[5] = arm_regs.uregs[5]; + return 1; +} diff --git a/linux/arm/ioctlent.h.in b/linux/arm/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/arm/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/arm/ioctls_arch0.h b/linux/arm/ioctls_arch0.h new file mode 100644 index 00000000..f44b4a34 --- /dev/null +++ b/linux/arm/ioctls_arch0.h @@ -0,0 +1,89 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm/include/ tree. */ +{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 }, +{ "linux/kvm.h", "KVM_ARM_PREFERRED_TARGET", _IOC_READ, 0xaeaf, 0x20 }, +{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_ARM_VCPU_INIT", _IOC_WRITE, 0xaeae, 0x20 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x00 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x98 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x00 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, +{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, +{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, +{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, +{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, +{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, +{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, +{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, +{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, +{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 }, +{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, +{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, +{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x00 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x98 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, +{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/arm/ioctls_inc0.h b/linux/arm/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/arm/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/arm/set_error.c b/linux/arm/set_error.c new file mode 100644 index 00000000..9b303d5c --- /dev/null +++ b/linux/arm/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + arm_regs.ARM_r0 = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + arm_regs.ARM_r0 = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/arm/set_scno.c b/linux/arm/set_scno.c new file mode 100644 index 00000000..015ed066 --- /dev/null +++ b/linux/arm/set_scno.c @@ -0,0 +1,18 @@ +#ifndef PTRACE_SET_SYSCALL +# define PTRACE_SET_SYSCALL 23 +#endif +/* + * PTRACE_SET_SYSCALL is supported by linux kernel + * starting with commit v2.6.16-rc1~107^2 + */ + +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + unsigned int n = (uint16_t) scno; + int rc = ptrace(PTRACE_SET_SYSCALL, tcp->pid, NULL, (unsigned long) n); + if (rc && errno != ESRCH) + perror_msg("arch_set_scno: PTRACE_SET_SYSCALL pid:%d scno:%#x", + tcp->pid, n); + return rc; +} diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index adaa1722..23e57f63 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -26,478 +26,425 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 0 */ - { 1, TP|SE, sys_exit, "exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "old_getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 1, TD|TM|SI, sys_old_mmap, "old_mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 5, 0, printargs, "syscall" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 6, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, sys_vm86, "vm86" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 5, 0, SEN(printargs), "syscall" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { 5, 0, SEN(vm86), "vm86" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 6, TD, SEN(pread), "pread64" }, +[181] = { 6, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "chown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +[193] = { 4, TF, SEN(truncate64), "truncate64" }, +[194] = { 4, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "lchown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "chown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 3, TD, SEN(getdents64), "getdents64" }, +[218] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[219] = { 3, TM, SEN(mincore), "mincore" }, +[220] = { 3, TM, SEN(madvise), "madvise" }, +[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[222 ... 223] = { }, +[224] = { 0, NF, SEN(gettid), "gettid" }, +[225] = { 5, TD, SEN(readahead), "readahead" }, +[226] = { 5, TF, SEN(setxattr), "setxattr" }, +[227] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[229] = { 4, TF, SEN(getxattr), "getxattr" }, +[230] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[232] = { 3, TF, SEN(listxattr), "listxattr" }, +[233] = { 3, TF, SEN(listxattr), "llistxattr" }, +[234] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[235] = { 2, TF, SEN(removexattr), "removexattr" }, +[236] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[238] = { 2, TS, SEN(kill), "tkill" }, +[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[240] = { 6, 0, SEN(futex), "futex" }, +[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[243] = { 2, TM, SEN(io_setup), "io_setup" }, +[244] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[245] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[246] = { 3, 0, SEN(io_submit), "io_submit" }, +[247] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[248] = { 1, TP|SE, SEN(exit), "exit_group" }, +[249] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[250] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[251] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[252] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[253] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[254 ... 255] = { }, +[256] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[257] = { 3, 0, SEN(timer_create), "timer_create" }, +[258] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[259] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[260] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[261] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[262] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[263] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[264] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[265] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[266] = { 3, TF, SEN(statfs64), "statfs64" }, +[267] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[268] = { 3, TS, SEN(tgkill), "tgkill" }, +[269] = { 2, TF, SEN(utimes), "utimes" }, +[270] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[271] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, +[272] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[273] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[274] = { 4, 0, SEN(mq_open), "mq_open" }, +[275] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[276] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[277] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[278] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[279] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[280] = { 5, TP, SEN(waitid), "waitid" }, +[281] = { 3, TN, SEN(socket), "socket" }, +[282] = { 3, TN, SEN(bind), "bind" }, +[283] = { 3, TN, SEN(connect), "connect" }, +[284] = { 2, TN, SEN(listen), "listen" }, +[285] = { 3, TN, SEN(accept), "accept" }, +[286] = { 3, TN, SEN(getsockname), "getsockname" }, +[287] = { 3, TN, SEN(getpeername), "getpeername" }, +[288] = { 4, TN, SEN(socketpair), "socketpair" }, +[289] = { 4, TN, SEN(send), "send" }, +[290] = { 6, TN, SEN(sendto), "sendto" }, +[291] = { 4, TN, SEN(recv), "recv" }, +[292] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[293] = { 2, TN, SEN(shutdown), "shutdown" }, +[294] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[295] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[296] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[297] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[298] = { 3, TI, SEN(semop), "semop" }, +[299] = { 3, TI, SEN(semget), "semget" }, +[300] = { 4, TI, SEN(semctl), "semctl" }, +[301] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[302] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[303] = { 2, TI, SEN(msgget), "msgget" }, +[304] = { 3, TI, SEN(msgctl), "msgctl" }, +[305] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[306] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[307] = { 3, TI, SEN(shmget), "shmget" }, +[308] = { 3, TI, SEN(shmctl), "shmctl" }, +[309] = { 5, 0, SEN(add_key), "add_key" }, +[310] = { 4, 0, SEN(request_key), "request_key" }, +[311] = { 5, 0, SEN(keyctl), "keyctl" }, +[312] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[313] = { 5, 0, SEN(vserver), "vserver" }, +[314] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[315] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[316] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[317] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[318] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[319] = { 6, TM, SEN(mbind), "mbind" }, +[320] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[321] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[322] = { 4, TD|TF, SEN(openat), "openat" }, +[323] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[324] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[325] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[326] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[327] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[328] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[329] = { 4, TD|TF, SEN(renameat), "renameat" }, +[330] = { 5, TD|TF, SEN(linkat), "linkat" }, +[331] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[332] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[333] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[334] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[335] = { 6, TD, SEN(pselect6), "pselect6" }, +[336] = { 5, TD, SEN(ppoll), "ppoll" }, +[337] = { 1, TP, SEN(unshare), "unshare" }, +[338] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[339] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[340] = { 6, TD, SEN(splice), "splice" }, +[341] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" }, +[342] = { 4, TD, SEN(tee), "tee" }, +[343] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[344] = { 6, TM, SEN(move_pages), "move_pages" }, +[345] = { 3, 0, SEN(getcpu), "getcpu" }, +[346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[347] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[348] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[349] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[350] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[351] = { 1, TD, SEN(eventfd), "eventfd" }, +[352] = { 6, TD, SEN(fallocate), "fallocate" }, +[353] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[354] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[355] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[356] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[357] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[358] = { 3, TD, SEN(dup3), "dup3" }, +[359] = { 2, TD, SEN(pipe2), "pipe2" }, +[360] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[361] = { 5, TD, SEN(preadv), "preadv" }, +[362] = { 5, TD, SEN(pwritev), "pwritev" }, +[363] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[364] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[365] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[366] = { 4, TN, SEN(accept4), "accept4" }, +[367] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[368] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[369] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[370] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[371] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[372] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[373] = { 1, TD, SEN(syncfs), "syncfs" }, +[374] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[375] = { 2, TD, SEN(setns), "setns" }, +[376] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[377] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[378] = { 5, 0, SEN(kcmp), "kcmp" }, +[379] = { 3, TD, SEN(finit_module), "finit_module" }, +[380] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[381] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[382] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[383] = { 3, 0, SEN(seccomp), "seccomp" }, +[384] = { 3, 0, SEN(getrandom), "getrandom" }, +[385] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[386] = { 3, TD, SEN(bpf), "bpf" }, +[387] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[388] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[389] = { 2, 0, SEN(membarrier), "membarrier" }, +[390] = { 3, TM, SEN(mlock2), "mlock2" }, +[391] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[392] = { 6, TD, SEN(preadv2), "preadv2" }, +[393] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[394] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[395] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[396] = { 1, 0, SEN(pkey_free), "pkey_free" }, - { 6, TD, sys_pread, "pread" }, /* 180 */ - { 6, TD, sys_pwrite, "pwrite" }, /* 181 */ - { 3, TF, sys_chown, "chown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 188 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 191 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 192 */ - { 4, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 4, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 3, TF, sys_chown, "lchown32" }, /* 198 */ - { 0, NF, sys_getuid, "getuid32" }, /* 199 */ - - { 0, NF, sys_getgid, "getgid32" }, /* 200 */ - { 0, NF, sys_geteuid, "geteuid32" }, /* 201 */ - { 0, NF, sys_geteuid, "getegid32" }, /* 202 */ - { 2, 0, sys_setreuid, "setreuid32" }, /* 203 */ - { 2, 0, sys_setregid, "setregid32" }, /* 204 */ - { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */ - { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */ - { 3, TD, sys_fchown, "fchown32" }, /* 207 */ - { 3, 0, sys_setresuid, "setresuid32" }, /* 208 */ - { 3, 0, sys_getresuid, "getresuid32" }, /* 209 */ - { 3, 0, sys_setresgid, "setresgid32" }, /* 210 */ - { 3, 0, sys_getresgid, "getresgid32" }, /* 211 */ - { 3, TF, sys_chown, "chown32" }, /* 212 */ - { 1, 0, sys_setuid, "setuid32" }, /* 213 */ - { 1, 0, sys_setgid, "setgid32" }, /* 214 */ - { 1, NF, sys_setfsuid, "setfsuid32" }, /* 215 */ - { 1, NF, sys_setfsgid, "setfsgid32" }, /* 216 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 217 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 218 */ - { 3, TM, sys_mincore, "mincore" }, /* 219 */ - { 3, TM, sys_madvise, "madvise" }, /* 220 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 221 */ - { 5, 0, NULL, NULL }, /* 222 */ - { 5, 0, NULL, NULL }, /* 223 */ - { 0, 0, sys_gettid, "gettid" }, /* 224 */ - { 5, TD, sys_readahead, "readahead" }, /* 225 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 226 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 227 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 228 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 229 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 230 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 231 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 232 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 233 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 234 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 235 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 236 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 237 */ - { 2, TS, sys_kill, "tkill" }, /* 238 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 239 */ - { 6, 0, sys_futex, "futex" }, /* 240 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 241 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 242 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 243 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 244 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 245 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 246 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 247 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 248 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 249 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 250 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 251 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 252 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 253 */ - { 5, 0, NULL, NULL }, /* 254 */ - { 5, 0, NULL, NULL }, /* 255 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 256 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 257 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 258 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 259 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 260 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 261 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 262 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 263 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 264 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 265 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 266 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 267 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 268 */ - { 2, TF, sys_utimes, "utimes" }, /* 269 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 270 */ - { 5, 0, printargs, "pciconfig_iobase" }, /* 271 */ - { 5, 0, printargs, "pciconfig_read" }, /* 272 */ - { 5, 0, printargs, "pciconfig_write" }, /* 273 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 274 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 275 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 276 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 277 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 278 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 279 */ - { 5, TP, sys_waitid, "waitid" }, /* 280 */ - { 3, TN, sys_socket, "socket" }, /* 281 */ - { 3, TN, sys_bind, "bind" }, /* 282 */ - { 3, TN, sys_connect, "connect" }, /* 283 */ - { 2, TN, sys_listen, "listen" }, /* 284 */ - { 3, TN, sys_accept, "accept" }, /* 285 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 286 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 287 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 288 */ - { 4, TN, sys_send, "send" }, /* 289 */ - { 6, TN, sys_sendto, "sendto" }, /* 290 */ - { 4, TN, sys_recv, "recv" }, /* 291 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 292 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 293 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 294 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 295 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 296 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 297 */ - { 4, TI, sys_semop, "semop" }, /* 298 */ - { 4, TI, sys_semget, "semget" }, /* 299 */ - { 4, TI, sys_semctl, "semctl" }, /* 300 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 301 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 302 */ - { 4, TI, sys_msgget, "msgget" }, /* 303 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 304 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 305 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 306 */ - { 4, TI, sys_shmget, "shmget" }, /* 307 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 308 */ - { 5, 0, sys_add_key, "add_key" }, /* 309 */ - { 4, 0, sys_request_key, "request_key" }, /* 310 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 311 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 312 */ - { 5, 0, sys_vserver, "vserver" }, /* 313 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 314 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 315 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 316 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 317 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 318 */ - { 6, TM, sys_mbind, "mbind" }, /* 319 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 320 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 321 */ - { 4, TD|TF, sys_openat, "openat" }, /* 322 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 323 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 324 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 325 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 326 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 327 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 328 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 329 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 330 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 331 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 332 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 333 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 334 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 335 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 336 */ - { 1, TP, sys_unshare, "unshare" }, /* 337 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 338 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 339 */ - { 6, TD, sys_splice, "splice" }, /* 340 */ - { 6, TD, sys_sync_file_range2, "sync_file_range2"}, /* 341 */ - { 4, TD, sys_tee, "tee" }, /* 342 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 343 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 344 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 345 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 346 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 347 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 348 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 349 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 350 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 351 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 352 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 353 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 354 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 355 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 356 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 357 */ - { 3, TD, sys_dup3, "dup3" }, /* 358 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 359 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 360 */ - { 5, TD, sys_preadv, "preadv" }, /* 361 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 362 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 363 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 364 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 365 */ - { 4, TN, sys_accept4, "accept4" }, /* 366 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 367 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 368 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 369 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 370 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 371 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 372 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 373 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 374 */ - { 2, TD, sys_setns, "setns" }, /* 375 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 376 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 377 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 378 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 379 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 380 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 381 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 382 */ #ifdef __ARM_EABI__ -# define ARM_LAST_ORDINARY_SYSCALL 382 +# define ARM_FIRST_SHUFFLED_SYSCALL 400 #else - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ -#define SYS_socket_subcall 400 -#include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -# if SYS_ipc_subcall != 420 -# error fix me -# endif - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ - { 4, TI, sys_semop, "semop" }, /* 421 */ - { 4, TI, sys_semget, "semget" }, /* 422 */ - { 4, TI, sys_semctl, "semctl" }, /* 423 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 424 */ - { 4, 0, printargs, "ipc_subcall" }, /* 425 */ - { 4, 0, printargs, "ipc_subcall" }, /* 426 */ - { 4, 0, printargs, "ipc_subcall" }, /* 427 */ - { 4, 0, printargs, "ipc_subcall" }, /* 428 */ - { 4, 0, printargs, "ipc_subcall" }, /* 429 */ - { 4, 0, printargs, "ipc_subcall" }, /* 430 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 431 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 432 */ - { 4, TI, sys_msgget, "msgget" }, /* 433 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 434 */ - { 4, 0, printargs, "ipc_subcall" }, /* 435 */ - { 4, 0, printargs, "ipc_subcall" }, /* 436 */ - { 4, 0, printargs, "ipc_subcall" }, /* 437 */ - { 4, 0, printargs, "ipc_subcall" }, /* 438 */ - { 4, 0, printargs, "ipc_subcall" }, /* 439 */ - { 4, 0, printargs, "ipc_subcall" }, /* 440 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 441 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 442 */ - { 4, TI, sys_shmget, "shmget" }, /* 443 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 444 */ -# define ARM_LAST_ORDINARY_SYSCALL 444 -#endif /* !EABI */ +# define SYS_socket_subcall 400 +# include "subcall.h" +# define ARM_FIRST_SHUFFLED_SYSCALL (SYS_ipc_subcall + SYS_ipc_nsubcalls) +#endif /* !__ARM_EABI__ */ - /* __ARM_NR_cmpxchg (0x000ffff0). - * Remapped by shuffle_scno() to be directly after ordinary syscalls - * in this table. - */ - { 5, 0, printargs, "cmpxchg" }, +/* + * __ARM_NR_cmpxchg (0x000ffff0). + * Remapped by shuffle_scno() to be directly after ordinary syscalls + * in this table. + */ +[ARM_FIRST_SHUFFLED_SYSCALL ] = { 5, 0, SEN(printargs), "cmpxchg" }, - /* ARM specific syscalls. Encoded with scno 0x000f00xx. - * Remapped by shuffle_scno() to be directly after __ARM_NR_cmpxchg. - */ - { 5, 0, NULL, NULL }, /* 0 */ - { 5, 0, printargs, "breakpoint" }, /* 1 */ - { 5, 0, printargs, "cacheflush" }, /* 2 */ - { 5, 0, printargs, "usr26" }, /* 3 */ - { 5, 0, printargs, "usr32" }, /* 4 */ - { 5, 0, printargs, "set_tls" }, /* 5 */ +/* + * ARM specific syscalls. Encoded with scno 0x000f00xx. + * Remapped by shuffle_scno() to be directly after __ARM_NR_cmpxchg. + */ +[ARM_FIRST_SHUFFLED_SYSCALL+1+0] = { }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+1] = { 5, 0, SEN(printargs), "breakpoint" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+2] = { 5, 0, SEN(printargs), "cacheflush" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+3] = { 5, 0, SEN(printargs), "usr26" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+4] = { 5, 0, SEN(printargs), "usr32" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+5] = { 5, 0, SEN(printargs), "set_tls" }, #define ARM_LAST_SPECIAL_SYSCALL 5 diff --git a/linux/arm/userent.h b/linux/arm/userent.h new file mode 100644 index 00000000..bd36a6fa --- /dev/null +++ b/linux/arm/userent.h @@ -0,0 +1,30 @@ +{ uoff(regs.ARM_r0), "r0" }, +{ uoff(regs.ARM_r1), "r1" }, +{ uoff(regs.ARM_r2), "r2" }, +{ uoff(regs.ARM_r3), "r3" }, +{ uoff(regs.ARM_r4), "r4" }, +{ uoff(regs.ARM_r5), "r5" }, +{ uoff(regs.ARM_r6), "r6" }, +{ uoff(regs.ARM_r7), "r7" }, +{ uoff(regs.ARM_r8), "r8" }, +{ uoff(regs.ARM_r9), "r9" }, +{ uoff(regs.ARM_r10), "r10" }, +{ uoff(regs.ARM_fp), "fp" }, +{ uoff(regs.ARM_ip), "ip" }, +{ uoff(regs.ARM_sp), "sp" }, +{ uoff(regs.ARM_lr), "lr" }, +{ uoff(regs.ARM_pc), "pc" }, +{ uoff(regs.ARM_cpsr), "cpsr" }, +/* Other fields in "struct user" */ +XLAT_UOFF(u_fpvalid), +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +XLAT_UOFF(start_stack), +XLAT_UOFF(signal), +XLAT_UOFF(reserved), +XLAT_UOFF(u_ar0), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/asm_stat.h b/linux/asm_stat.h new file mode 100644 index 00000000..a9266020 --- /dev/null +++ b/linux/asm_stat.h @@ -0,0 +1,50 @@ +#ifndef STRACE_ASM_STAT_H +#define STRACE_ASM_STAT_H + +# undef dev_t +# undef gid_t +# undef ino_t +# undef loff_t +# undef mode_t +# undef nlink_t +# undef off64_t +# undef off_t +# undef time_t +# undef uid_t + +# define dev_t __kernel_dev_t +# define gid_t __kernel_gid_t +# define ino_t __kernel_ino_t +# define loff_t __kernel_loff_t +# define mode_t __kernel_mode_t +# define nlink_t __kernel_nlink_t +# define off64_t __kernel_off64_t +# define off_t __kernel_off_t +# define time_t __kernel_time_t +# define uid_t __kernel_uid_t + +# include + +# undef dev_t +# undef gid_t +# undef ino_t +# undef loff_t +# undef mode_t +# undef nlink_t +# undef off64_t +# undef off_t +# undef time_t +# undef uid_t + +# define dev_t dev_t +# define gid_t gid_t +# define ino_t ino_t +# define loff_t loff_t +# define mode_t mode_t +# define nlink_t nlink_t +# define off64_t off64_t +# define off_t off_t +# define time_t time_t +# define uid_t uid_t + +#endif /* !STRACE_ASM_STAT_H */ diff --git a/linux/avr32/arch_regs.c b/linux/avr32/arch_regs.c new file mode 100644 index 00000000..8b52a8d0 --- /dev/null +++ b/linux/avr32/arch_regs.c @@ -0,0 +1,3 @@ +static struct pt_regs avr32_regs; +#define ARCH_REGS_FOR_GETREGS avr32_regs +#define ARCH_PC_REG avr32_regs.pc diff --git a/linux/avr32/get_error.c b/linux/avr32/get_error.c new file mode 100644 index 00000000..75e7f67f --- /dev/null +++ b/linux/avr32/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(avr32_regs.r12)) { + tcp->u_rval = -1; + tcp->u_error = -avr32_regs.r12; + } else { + tcp->u_rval = avr32_regs.r12; + } +} diff --git a/linux/avr32/get_scno.c b/linux/avr32/get_scno.c new file mode 100644 index 00000000..092dad30 --- /dev/null +++ b/linux/avr32/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = avr32_regs.r8; + return 1; +} diff --git a/linux/avr32/get_syscall_args.c b/linux/avr32/get_syscall_args.c new file mode 100644 index 00000000..e8c41198 --- /dev/null +++ b/linux/avr32/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = avr32_regs.r12; + tcp->u_arg[1] = avr32_regs.r11; + tcp->u_arg[2] = avr32_regs.r10; + tcp->u_arg[3] = avr32_regs.r9; + tcp->u_arg[4] = avr32_regs.r5; + tcp->u_arg[5] = avr32_regs.r3; + return 1; +} diff --git a/linux/avr32/ioctlent.h.in b/linux/avr32/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/avr32/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/avr32/ioctls_arch0.h b/linux/avr32/ioctls_arch0.h new file mode 100644 index 00000000..c50a25c3 --- /dev/null +++ b/linux/avr32/ioctls_arch0.h @@ -0,0 +1,8 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/avr32/include/ tree. */ +{ "asm/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, diff --git a/linux/avr32/ioctls_inc0.h b/linux/avr32/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/avr32/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/avr32/set_error.c b/linux/avr32/set_error.c new file mode 100644 index 00000000..f4ef41d6 --- /dev/null +++ b/linux/avr32/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + avr32_regs.r12 = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + avr32_regs.r12 = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/avr32/set_scno.c b/linux/avr32/set_scno.c new file mode 100644 index 00000000..66c4db7e --- /dev/null +++ b/linux/avr32/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + avr32_regs.r8 = scno; + return set_regs(tcp->pid); +} diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h index b47653ca..d18902f1 100644 --- a/linux/avr32/syscallent.h +++ b/linux/avr32/syscallent.h @@ -25,287 +25,334 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_setup, "setup" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 1, 0, sys_umask, "umask" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "chown" }, /* 16 */ - { 3, TF, sys_chown, "lchown" }, /* 17 */ - { 3, TD, sys_lseek, "lseek" }, /* 18 */ - { 5, TD, sys_llseek, "_llseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 2, TF, sys_umount, "umount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 0, TS, sys_pause, "pause" }, /* 28 */ - { 2, TF, sys_utime, "utime" }, /* 29 */ - { 2, TF, sys_stat, "stat" }, /* 30 */ - { 2, TD, sys_fstat, "fstat" }, /* 31 */ - { 2, TF, sys_lstat, "lstat" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, TF, sys_chroot, "chroot" }, /* 34 */ - { 0, 0, sys_sync, "sync" }, /* 35 */ - { 1, TD, sys_fsync, "fsync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 5, TP, sys_clone, "clone" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 52 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 56 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 57 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 58 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 59 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 60 */ - { 2, 0, sys_setregid, "setregid" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 67 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 68 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 69 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 70 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 71 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 72 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "old_getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 5, TD, sys_select, "select" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 5, TD, sys_pread, "pread" }, /* 86 */ - { 5, TD, sys_pwrite, "pwrite" }, /* 87 */ - { 2, TF, sys_swapon, "swapon" }, /* 88 */ - { 4, 0, sys_reboot, "reboot" }, /* 89 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, TP, sys_wait4, "wait4" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 101 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 106 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 107 */ - { 6, TI, sys_ipc, "ipc" }, /* 108 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 109 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 110 */ - { 1, 0, sys_uname, "uname" }, /* 111 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 112 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 113 */ - { 0, TP, sys_vfork, "vfork" }, /* 114 */ - { 3, 0, sys_init_module, "init_module" }, /* 115 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 116 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 117 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 118 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 119 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 120 */ - { 1, 0, sys_personality, "personality" }, /* 121 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 122 */ - { 3, TD, sys_getdents, "getdents" }, /* 123 */ - { 2, TD, sys_flock, "flock" }, /* 124 */ - { 3, TM, sys_msync, "msync" }, /* 125 */ - { 3, TD, sys_readv, "readv" }, /* 126 */ - { 3, TD, sys_writev, "writev" }, /* 127 */ - { 1, 0, sys_getsid, "getsid" }, /* 128 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 129 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 130 */ - { 2, TM, sys_mlock, "mlock" }, /* 131 */ - { 2, TM, sys_munlock, "munlock" }, /* 132 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 133 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 134 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 135 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 136 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 137 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 138 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 139 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 140 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 141 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 142 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 143 */ - { 3, TD, sys_poll, "poll" }, /* 144 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 145 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 146 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 147 */ - { 5, 0, sys_prctl, "prctl" }, /* 148 */ - { 3, TN, sys_socket, "socket" }, /* 149 */ - { 3, TN, sys_bind, "bind" }, /* 150 */ - { 3, TN, sys_connect, "connect" }, /* 151 */ - { 2, TN, sys_listen, "listen" }, /* 152 */ - { 3, TN, sys_accept, "accept" }, /* 153 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 154 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 155 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 156 */ - { 4, TN, sys_send, "send" }, /* 157 */ - { 4, TN, sys_recv, "recv" }, /* 158 */ - { 6, TN, sys_sendto, "sendto" }, /* 159 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 160 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 161 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 162 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 163 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 164 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 165 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 166 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 167 */ - { 2, TF, sys_stat64, "stat64" }, /* 168 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 169 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 170 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 171 */ - { 3, TM, sys_mincore, "mincore" }, /* 172 */ - { 3, TM, sys_madvise, "madvise" }, /* 173 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 174 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 175 */ - { 0, 0, sys_gettid, "gettid" }, /* 176 */ - { 4, TD, sys_readahead, "readahead" }, /* 177 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 178 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 179 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 180 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 181 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 182 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 183 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 184 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 185 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 186 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 187 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 188 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 189 */ - { 2, TS, sys_kill, "tkill" }, /* 190 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 191 */ - { 6, 0, sys_futex, "futex" }, /* 192 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 193 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 194 */ - { 2, 0, sys_capget, "capget" }, /* 195 */ - { 2, 0, sys_capset, "capset" }, /* 196 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 197 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 198 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 199 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 200 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 201 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 202 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 203 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 204 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 205 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 206 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 207 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 208 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 209 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 210 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 211 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 212 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 213 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 214 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 215 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 216 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 217 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 218 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 219 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 220 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 221 */ - { 5, 0, NULL, NULL }, /* 222 */ - { 2, TF, sys_utimes, "utimes" }, /* 223 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 224 */ - { 3, 0, printargs, "cacheflush" }, /* 225 */ - { 5, 0, sys_vserver, "vserver" }, /* 226 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 227 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 228 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 229 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 230 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 231 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 232 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 233 */ - { 5, TP, sys_waitid, "waitid" }, /* 234 */ - { 5, 0, sys_add_key, "add_key" }, /* 235 */ - { 4, 0, sys_request_key, "request_key" }, /* 236 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 237 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 238 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 239 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 240 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 241 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 242 */ - { 4, TD|TF, sys_openat, "openat" }, /* 243 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 244 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 245 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 246 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 247 */ - { 4, TD|TF, printargs, "fstatat64" }, /* 248 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 249 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 250 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 251 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 252 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 253 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 254 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 255 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 256 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 257 */ - { 1, TP, sys_unshare, "unshare" }, /* 258 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 259 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 260 */ - { 6, TD, sys_splice, "splice" }, /* 261 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 262 */ - { 4, TD, sys_tee, "tee" }, /* 263 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 264 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 265 */ - { 4, TI, sys_msgget, "msgget" }, /* 266 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 267 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 268 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 269 */ - { 4, TI, sys_semget, "semget" }, /* 270 */ - { 4, TI, sys_semop, "semop" }, /* 271 */ - { 4, TI, sys_semctl, "semctl" }, /* 272 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 273 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 274 */ - { 4, TI, sys_shmget, "shmget" }, /* 275 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 276 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 277 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 278 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 279 */ - { 2, TD, sys_timerfd, "timerfd_create" }, /* 280 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 281 */ - { 5, 0, NULL, NULL }, /* 282 */ - { 2, TD, sys_setns, "setns" }, /* 283 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 1, NF, SEN(umask), "umask" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown), "chown" }, +[ 17] = { 3, TF, SEN(chown), "lchown" }, +[ 18] = { 3, TD, SEN(lseek), "lseek" }, +[ 19] = { 5, TD, SEN(llseek), "_llseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount2), "umount2" }, +[ 23] = { 1, 0, SEN(setuid), "setuid" }, +[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 0, TS, SEN(pause), "pause" }, +[ 29] = { 2, TF, SEN(utime), "utime" }, +[ 30] = { 2, TF, SEN(stat), "stat" }, +[ 31] = { 2, TD, SEN(fstat), "fstat" }, +[ 32] = { 2, TF, SEN(lstat), "lstat" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, TF, SEN(chroot), "chroot" }, +[ 35] = { 0, 0, SEN(sync), "sync" }, +[ 36] = { 1, TD, SEN(fsync), "fsync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 5, TP, SEN(clone), "clone" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid), "setgid" }, +[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 48] = { 2, TF, SEN(getcwd), "getcwd" }, +[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[ 53] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 57] = { 5, TM|SI, SEN(mremap), "mremap" }, +[ 58] = { 3, 0, SEN(setresuid), "setresuid" }, +[ 59] = { 3, 0, SEN(getresuid), "getresuid" }, +[ 60] = { 2, 0, SEN(setreuid), "setreuid" }, +[ 61] = { 2, 0, SEN(setregid), "setregid" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[ 68] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[ 69] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[ 70] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[ 71] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[ 72] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[ 73] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups), "setgroups" }, +[ 82] = { 5, TD, SEN(select), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 1, TD, SEN(fchdir), "fchdir" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 5, TD, SEN(pread), "pread" }, +[ 87] = { 5, TD, SEN(pwrite), "pwrite" }, +[ 88] = { 2, TF, SEN(swapon), "swapon" }, +[ 89] = { 4, 0, SEN(reboot), "reboot" }, +[ 90] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, TP, SEN(wait4), "wait4" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 0, 0, SEN(vhangup), "vhangup" }, +[102] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 1, TF, SEN(swapoff), "swapoff" }, +[107] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[108] = { 6, TI, SEN(ipc), "ipc" }, +[109] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[110] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[111] = { 1, 0, SEN(uname), "uname" }, +[112] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[113] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[114] = { 0, TP, SEN(vfork), "vfork" }, +[115] = { 3, 0, SEN(init_module), "init_module" }, +[116] = { 2, 0, SEN(delete_module), "delete_module" }, +[117] = { 4, TF, SEN(quotactl), "quotactl" }, +[118] = { 1, 0, SEN(getpgid), "getpgid" }, +[119] = { 2, 0, SEN(bdflush), "bdflush" }, +[120] = { 3, 0, SEN(sysfs), "sysfs" }, +[121] = { 1, NF, SEN(personality), "personality" }, +[122] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[123] = { 3, TD, SEN(getdents), "getdents" }, +[124] = { 2, TD, SEN(flock), "flock" }, +[125] = { 3, TM, SEN(msync), "msync" }, +[126] = { 3, TD, SEN(readv), "readv" }, +[127] = { 3, TD, SEN(writev), "writev" }, +[128] = { 1, 0, SEN(getsid), "getsid" }, +[129] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[130] = { 1, 0, SEN(sysctl), "_sysctl" }, +[131] = { 2, TM, SEN(mlock), "mlock" }, +[132] = { 2, TM, SEN(munlock), "munlock" }, +[133] = { 1, TM, SEN(mlockall), "mlockall" }, +[134] = { 0, TM, SEN(munlockall), "munlockall" }, +[135] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[136] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[137] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[138] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[139] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[140] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[141] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[142] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[143] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[144] = { 3, TD, SEN(poll), "poll" }, +[145] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[146] = { 3, 0, SEN(setresgid), "setresgid" }, +[147] = { 3, 0, SEN(getresgid), "getresgid" }, +[148] = { 5, 0, SEN(prctl), "prctl" }, +[149] = { 3, TN, SEN(socket), "socket" }, +[150] = { 3, TN, SEN(bind), "bind" }, +[151] = { 3, TN, SEN(connect), "connect" }, +[152] = { 2, TN, SEN(listen), "listen" }, +[153] = { 3, TN, SEN(accept), "accept" }, +[154] = { 3, TN, SEN(getsockname), "getsockname" }, +[155] = { 3, TN, SEN(getpeername), "getpeername" }, +[156] = { 4, TN, SEN(socketpair), "socketpair" }, +[157] = { 4, TN, SEN(send), "send" }, +[158] = { 4, TN, SEN(recv), "recv" }, +[159] = { 6, TN, SEN(sendto), "sendto" }, +[160] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[161] = { 2, TN, SEN(shutdown), "shutdown" }, +[162] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[163] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[164] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[165] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[166] = { 3, TF, SEN(truncate64), "truncate64" }, +[167] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[168] = { 2, TF, SEN(stat64), "stat64" }, +[169] = { 2, TF, SEN(lstat64), "lstat64" }, +[170] = { 2, TD, SEN(fstat64), "fstat64" }, +[171] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[172] = { 3, TM, SEN(mincore), "mincore" }, +[173] = { 3, TM, SEN(madvise), "madvise" }, +[174] = { 3, TD, SEN(getdents64), "getdents64" }, +[175] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[176] = { 0, NF, SEN(gettid), "gettid" }, +[177] = { 4, TD, SEN(readahead), "readahead" }, +[178] = { 5, TF, SEN(setxattr), "setxattr" }, +[179] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[180] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[181] = { 4, TF, SEN(getxattr), "getxattr" }, +[182] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[183] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[184] = { 3, TF, SEN(listxattr), "listxattr" }, +[185] = { 3, TF, SEN(listxattr), "llistxattr" }, +[186] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[187] = { 2, TF, SEN(removexattr), "removexattr" }, +[188] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[189] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[190] = { 2, TS, SEN(kill), "tkill" }, +[191] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[192] = { 6, 0, SEN(futex), "futex" }, +[193] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[194] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[195] = { 2, 0, SEN(capget), "capget" }, +[196] = { 2, 0, SEN(capset), "capset" }, +[197] = { 2, TM, SEN(io_setup), "io_setup" }, +[198] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[199] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[200] = { 3, 0, SEN(io_submit), "io_submit" }, +[201] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[202] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[203] = { 1, TP|SE, SEN(exit), "exit_group" }, +[204] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[205] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[206] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[207] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[208] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[209] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[210] = { 3, 0, SEN(timer_create), "timer_create" }, +[211] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[212] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[213] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[214] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[215] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[216] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[217] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[218] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[219] = { 3, TF, SEN(statfs64), "statfs64" }, +[220] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[221] = { 3, TS, SEN(tgkill), "tgkill" }, +[222] = { }, +[223] = { 2, TF, SEN(utimes), "utimes" }, +[224] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[225] = { 3, 0, SEN(printargs), "cacheflush" }, +[226] = { 5, 0, SEN(vserver), "vserver" }, +[227] = { 4, 0, SEN(mq_open), "mq_open" }, +[228] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[229] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[230] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[231] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[232] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[233] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[234] = { 5, TP, SEN(waitid), "waitid" }, +[235] = { 5, 0, SEN(add_key), "add_key" }, +[236] = { 4, 0, SEN(request_key), "request_key" }, +[237] = { 5, 0, SEN(keyctl), "keyctl" }, +[238] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[239] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[240] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[241] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[242] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[243] = { 4, TD|TF, SEN(openat), "openat" }, +[244] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[245] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[246] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[247] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[248] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[249] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[250] = { 4, TD|TF, SEN(renameat), "renameat" }, +[251] = { 5, TD|TF, SEN(linkat), "linkat" }, +[252] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[253] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[254] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[255] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[256] = { 6, TD, SEN(pselect6), "pselect6" }, +[257] = { 5, TD, SEN(ppoll), "ppoll" }, +[258] = { 1, TP, SEN(unshare), "unshare" }, +[259] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[260] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[261] = { 6, TD, SEN(splice), "splice" }, +[262] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[263] = { 4, TD, SEN(tee), "tee" }, +[264] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[265] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[266] = { 2, TI, SEN(msgget), "msgget" }, +[267] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[268] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[269] = { 3, TI, SEN(msgctl), "msgctl" }, +[270] = { 3, TI, SEN(semget), "semget" }, +[271] = { 3, TI, SEN(semop), "semop" }, +[272] = { 4, TI, SEN(semctl), "semctl" }, +[273] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[274] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[275] = { 3, TI, SEN(shmget), "shmget" }, +[276] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[277] = { 3, TI, SEN(shmctl), "shmctl" }, +[278] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[279] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[280] = { 4, TD, SEN(timerfd), "timerfd" }, +[281] = { 1, TD, SEN(eventfd), "eventfd" }, +[282] = { }, +[283] = { 2, TD, SEN(setns), "setns" }, +[284] = { 5, TD, SEN(pread), "pread64" }, +[285] = { 5, TD, SEN(pwrite), "pwrite64" }, +[286] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[287] = { 6, TD, SEN(fallocate), "fallocate" }, +[288] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[289] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[290] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[291] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[292] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[293] = { 3, TD, SEN(dup3), "dup3" }, +[294] = { 2, TD, SEN(pipe2), "pipe2" }, +[295] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[296] = { 5, TD, SEN(preadv), "preadv" }, +[297] = { 5, TD, SEN(pwritev), "pwritev" }, +[298] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[299] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[300] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[301] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[302] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[303] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[304] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[305] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[306] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[307] = { 1, TD, SEN(syncfs), "syncfs" }, +[308] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[309] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[310] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[311] = { 5, 0, SEN(kcmp), "kcmp" }, +[312] = { 3, TD, SEN(finit_module), "finit_module" }, +[313] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[314] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[315] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[316] = { 3, 0, SEN(seccomp), "seccomp" }, +[317] = { 3, 0, SEN(getrandom), "getrandom" }, +[318] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[319] = { 3, TD, SEN(bpf), "bpf" }, +[320] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[321] = { 4, TN, SEN(accept4), "accept4" }, +[322] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[323] = { 2, 0, SEN(membarrier), "membarrier" }, +[324] = { 3, TM, SEN(mlock2), "mlock2" }, +[325] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[326] = { 6, TD, SEN(preadv2), "preadv2" }, +[327] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[328] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[329] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[330] = { 1, 0, SEN(pkey_free), "pkey_free" }, diff --git a/linux/avr32/userent.h b/linux/avr32/userent.h new file mode 100644 index 00000000..4fbfc142 --- /dev/null +++ b/linux/avr32/userent.h @@ -0,0 +1,30 @@ +{ uoff(regs.sr), "sr" }, +{ uoff(regs.pc), "pc" }, +{ uoff(regs.lr), "lr" }, +{ uoff(regs.sp), "sp" }, +{ uoff(regs.r12), "r12" }, +{ uoff(regs.r11), "r11" }, +{ uoff(regs.r10), "r10" }, +{ uoff(regs.r9), "r9" }, +{ uoff(regs.r8), "r8" }, +{ uoff(regs.r7), "r7" }, +{ uoff(regs.r6), "r6" }, +{ uoff(regs.r5), "r5" }, +{ uoff(regs.r4), "r4" }, +{ uoff(regs.r3), "r3" }, +{ uoff(regs.r2), "r2" }, +{ uoff(regs.r1), "r1" }, +{ uoff(regs.r0), "r0" }, +{ uoff(regs.r12_orig), "orig_r12" }, +/* Other fields in "struct user" */ +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +XLAT_UOFF(start_data), +XLAT_UOFF(start_stack), +XLAT_UOFF(signal), +XLAT_UOFF(u_ar0), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/bfin/arch_regs.c b/linux/bfin/arch_regs.c new file mode 100644 index 00000000..ea76cb98 --- /dev/null +++ b/linux/bfin/arch_regs.c @@ -0,0 +1,2 @@ +static unsigned long bfin_r0; +#define ARCH_PC_PEEK_ADDR PT_PC diff --git a/linux/bfin/get_error.c b/linux/bfin/get_error.c new file mode 100644 index 00000000..80aeb377 --- /dev/null +++ b/linux/bfin/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(bfin_r0)) { + tcp->u_rval = -1; + tcp->u_error = -bfin_r0; + } else { + tcp->u_rval = bfin_r0; + } +} diff --git a/linux/bfin/get_scno.c b/linux/bfin/get_scno.c new file mode 100644 index 00000000..8c3a7d21 --- /dev/null +++ b/linux/bfin/get_scno.c @@ -0,0 +1,6 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + return upeek(tcp->pid, PT_ORIG_P0, &tcp->scno) < 0 ? -1 : 1; +} diff --git a/linux/bfin/get_syscall_args.c b/linux/bfin/get_syscall_args.c new file mode 100644 index 00000000..13d58bd7 --- /dev/null +++ b/linux/bfin/get_syscall_args.c @@ -0,0 +1,13 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + static const int argreg[MAX_ARGS] = + { PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5 }; + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, argreg[i], &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/bfin/get_syscall_result.c b/linux/bfin/get_syscall_result.c new file mode 100644 index 00000000..c189a5fd --- /dev/null +++ b/linux/bfin/get_syscall_result.c @@ -0,0 +1,5 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + return upeek(tcp->pid, PT_R0, &bfin_r0) < 0 ? -1 : 0; +} diff --git a/linux/bfin/ioctlent.h.in b/linux/bfin/ioctlent.h.in deleted file mode 100644 index 791d8e36..00000000 --- a/linux/bfin/ioctlent.h.in +++ /dev/null @@ -1,8 +0,0 @@ - {"asm/bfin_sport.h", "SPORT_IOC_CONFIG", 0x5001}, - {"asm/bfin_sport.h", "SPORT_IOC_GET_SYSTEMCLOCK", 0x5002}, - {"asm/bfin_sport.h", "SPORT_IOC_SET_BAUDRATE", 0x5003}, - {"asm/ioctls.h", "FIOQSIZE", 0x545e}, - {"asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_SET_PERIOD", 0x7402}, - {"asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_START", 0x7406}, - {"asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_STOP", 0x7408}, - {"asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_READ", 0x740a}, diff --git a/linux/bfin/ioctls_arch0.h b/linux/bfin/ioctls_arch0.h new file mode 100644 index 00000000..7d9804d6 --- /dev/null +++ b/linux/bfin/ioctls_arch0.h @@ -0,0 +1,12 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/blackfin/include/ tree. */ +{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_READ", _IOC_NONE, 0x740a, 0x00 }, +{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_READ_COUNTER", _IOC_NONE, 0x740b, 0x00 }, +{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_SET_MODE", _IOC_NONE, 0x7404, 0x00 }, +{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_SET_PERIOD", _IOC_NONE, 0x7402, 0x00 }, +{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_SET_WIDTH", _IOC_NONE, 0x7403, 0x00 }, +{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_START", _IOC_NONE, 0x7406, 0x00 }, +{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_STOP", _IOC_NONE, 0x7408, 0x00 }, +{ "asm/bfin_sport.h", "SPORT_IOC_CONFIG", _IOC_READ|_IOC_WRITE, 0x5001, 0x24 }, +{ "asm/bfin_sport.h", "SPORT_IOC_GET_SYSTEMCLOCK", _IOC_READ, 0x5002, 0x04 }, +{ "asm/bfin_sport.h", "SPORT_IOC_SET_BAUDRATE", _IOC_WRITE, 0x5003, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 }, diff --git a/linux/bfin/ioctls_inc0.h b/linux/bfin/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/bfin/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/bfin/set_error.c b/linux/bfin/set_error.c new file mode 100644 index 00000000..2bfecda0 --- /dev/null +++ b/linux/bfin/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + bfin_r0 = -tcp->u_error; + return upoke(tcp->pid, PT_R0, bfin_r0); +} + +static int +arch_set_success(struct tcb *tcp) +{ + bfin_r0 = tcp->u_rval; + return upoke(tcp->pid, PT_R0, bfin_r0); +} diff --git a/linux/bfin/set_scno.c b/linux/bfin/set_scno.c new file mode 100644 index 00000000..4508be1a --- /dev/null +++ b/linux/bfin/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, PT_ORIG_P0, scno); +} diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h index 8df6a4dd..f4b88716 100644 --- a/linux/bfin/syscallent.h +++ b/linux/bfin/syscallent.h @@ -26,386 +26,395 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "chown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "old_getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 6, TD|TM|SI, printargs, "old_mmap" }, /* 90: not implemented in kernel */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 1, 0, sys_vm86old, "vm86old" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 6, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 1, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms" }, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam" }, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 158 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max" }, /* 159 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min" }, /* 160 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, sys_vm86, "vm86" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 5, TD, sys_pread, "pread" }, /* 180 */ - { 5, TD, sys_pwrite, "pwrite" }, /* 181 */ - { 3, TF, sys_chown, "lchown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 188 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 191 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 192 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 3, TF, sys_chown, "chown32" }, /* 198 */ - { 0, NF, sys_getuid, "getuid32" }, /* 199 */ - { 0, NF, sys_getgid, "getgid32" }, /* 200 */ - { 0, NF, sys_geteuid, "geteuid32" }, /* 201 */ - { 0, NF, sys_geteuid, "getegid32" }, /* 202 */ - { 2, 0, sys_setreuid, "setreuid32" }, /* 203 */ - { 2, 0, sys_setregid, "setregid32" }, /* 204 */ - { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */ - { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */ - { 3, TD, sys_fchown, "fchown32" }, /* 207 */ - { 3, 0, sys_setresuid, "setresuid32" }, /* 208 */ - { 3, 0, sys_getresuid, "getresuid32" }, /* 209 */ - { 3, 0, sys_setresgid, "setresgid32" }, /* 210 */ - { 3, 0, sys_getresgid, "getresgid32" }, /* 211 */ - { 3, TF, sys_chown, "lchown32" }, /* 212 */ - { 1, 0, sys_setuid, "setuid32" }, /* 213 */ - { 1, 0, sys_setgid, "setgid32" }, /* 214 */ - { 1, NF, sys_setfsuid, "setfsuid32" }, /* 215 */ - { 1, NF, sys_setfsgid, "setfsgid32" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 3, TM, sys_mincore, "mincore" }, /* 218 */ - { 3, TM, sys_madvise, "madvise" }, /* 219 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 220 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 221 */ - { 4, 0, NULL, NULL }, /* 222 */ - { 5, 0, sys_security, "security" }, /* 223 */ - { 0, 0, sys_gettid, "gettid" }, /* 224 */ - { 4, TD, sys_readahead, "readahead" }, /* 225 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 226 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 227 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 228 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 229 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 230 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 231 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 232 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 233 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 234 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 235 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 236 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 237 */ - { 2, TS, sys_kill, "tkill" }, /* 238 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 239 */ - { 6, 0, sys_futex, "futex" }, /* 240 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 241 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 242 */ - { 1, 0, sys_set_thread_area, "set_thread_area" }, /* 243 */ - { 1, 0, sys_get_thread_area, "get_thread_area" }, /* 244 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 245 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 246 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 247 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 248 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ - { 5, 0, printargs, "alloc_hugepages" }, /* 250 */ - { 1, 0, printargs, "free_hugepages" }, /* 251 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 252 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 253 */ - { 1, 0, printargs, "bfin_spinlock" }, /* 254 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 255 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 256 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 257 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 258 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 259 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 260 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 261 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 262 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 263 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 264 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 265 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 266 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 267 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 268 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 269 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 270 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 271 */ - { 2, TF, sys_utimes, "utimes" }, /* 272 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 273 */ - { 5, 0, sys_vserver, "vserver" }, /* 274 */ - { 6, TM, sys_mbind, "mbind" }, /* 275 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 276 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 277 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 278 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 279 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 280 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 281 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 282 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 283 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 284 */ - { 5, TP, sys_waitid, "waitid" }, /* 285 */ - { 5, 0, sys_add_key, "add_key" }, /* 286 */ - { 4, 0, sys_request_key, "request_key" }, /* 287 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 288 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 289 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 290 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 291 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 292 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 293 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 294 */ - { 4, TD|TF, sys_openat, "openat" }, /* 295 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 296 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 297 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 298 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 299 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 300 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 301 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 302 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 303 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 304 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 305 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 306 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 307 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 308 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 309 */ - { 1, TP, sys_unshare, "unshare" }, /* 310 */ - { 2, 0, sys_sram_alloc, "sram_alloc" }, /* 311 */ - { 1, 0, printargs, "sram_free" }, /* 312 */ - { 3, 0, printargs, "dma_memcpy" }, /* 313 */ - { 3, TN, sys_accept, "accept" }, /* 314 */ - { 3, TN, sys_bind, "bind" }, /* 315 */ - { 3, TN, sys_connect, "connect" }, /* 316 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 317 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 318 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 319 */ - { 2, TN, sys_listen, "listen" }, /* 320 */ - { 4, TN, sys_recv, "recv" }, /* 321 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 322 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 323 */ - { 4, TN, sys_send, "send" }, /* 324 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 325 */ - { 6, TN, sys_sendto, "sendto" }, /* 326 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 327 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 328 */ - { 3, TN, sys_socket, "socket" }, /* 329 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 330 */ - { 4, TI, sys_semctl, "semctl" }, /* 331 */ - { 4, TI, sys_semget, "semget" }, /* 332 */ - { 4, TI, sys_semop, "semop" }, /* 333 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 334 */ - { 4, TI, sys_msgget, "msgget" }, /* 335 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 336 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 337 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 338 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 339 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 340 */ - { 4, TI, sys_shmget, "shmget" }, /* 341 */ - { 6, TD, sys_splice, "splice" }, /* 342 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 343 */ - { 4, TD, sys_tee, "tee" }, /* 344 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 345 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 346 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 347 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 348 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 349 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 350 */ - { 5, TD, sys_pread, "pread64" }, /* 351 */ - { 5, TD, sys_pwrite, "pwrite64" }, /* 352 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 353 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 354 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 355 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 356 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 357 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 358 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 359 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 360 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 361 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 362 */ - { 3, TD, sys_dup3, "dup3" }, /* 363 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 364 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 365 */ - { 5, TD, sys_preadv, "preadv" }, /* 366 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 367 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 368 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 369 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 370 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 371 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 372 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 373 */ - { 3, 0, sys_cacheflush, "cacheflush" }, /* 374 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 375 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 376 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 377 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 378 */ - { 2, TD, sys_setns, "setns" }, /* 379 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 380 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 381 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 382 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "chown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "old_getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 6, TD|TM|SI, SEN(printargs), "mmap" }, /*not implemented in kernel */ +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 1, 0, SEN(vm86old), "vm86old" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { 5, 0, SEN(vm86), "vm86" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 5, TD, SEN(pread), "pread" }, +[181] = { 5, TD, SEN(pwrite), "pwrite" }, +[182] = { 3, TF, SEN(chown16), "lchown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[193] = { 3, TF, SEN(truncate64), "truncate64" }, +[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "chown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "lchown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[222 ... 223] = { }, +[224] = { 0, NF, SEN(gettid), "gettid" }, +[225] = { 4, TD, SEN(readahead), "readahead" }, +[226] = { 5, TF, SEN(setxattr), "setxattr" }, +[227] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[229] = { 4, TF, SEN(getxattr), "getxattr" }, +[230] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[232] = { 3, TF, SEN(listxattr), "listxattr" }, +[233] = { 3, TF, SEN(listxattr), "llistxattr" }, +[234] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[235] = { 2, TF, SEN(removexattr), "removexattr" }, +[236] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[238] = { 2, TS, SEN(kill), "tkill" }, +[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[240] = { 6, 0, SEN(futex), "futex" }, +[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, +[245] = { 2, TM, SEN(io_setup), "io_setup" }, +[246] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[248] = { 3, 0, SEN(io_submit), "io_submit" }, +[249] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[250] = { 5, 0, SEN(printargs), "alloc_hugepages" }, +[251] = { 1, 0, SEN(printargs), "free_hugepages" }, +[252] = { 1, TP|SE, SEN(exit), "exit_group" }, +[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[254] = { 1, 0, SEN(printargs), "bfin_spinlock" }, +[255] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[256] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[257] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[258] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[259] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[260] = { 3, 0, SEN(timer_create), "timer_create" }, +[261] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[262] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[263] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[264] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[265] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[266] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[267] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[268] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[269] = { 3, TF, SEN(statfs64), "statfs64" }, +[270] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[271] = { 3, TS, SEN(tgkill), "tgkill" }, +[272] = { 2, TF, SEN(utimes), "utimes" }, +[273] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[274] = { 5, 0, SEN(vserver), "vserver" }, +[275] = { 6, TM, SEN(mbind), "mbind" }, +[276] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[277] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[278] = { 4, 0, SEN(mq_open), "mq_open" }, +[279] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[280] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[281] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[282] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[283] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[284] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[285] = { 5, TP, SEN(waitid), "waitid" }, +[286] = { 5, 0, SEN(add_key), "add_key" }, +[287] = { 4, 0, SEN(request_key), "request_key" }, +[288] = { 5, 0, SEN(keyctl), "keyctl" }, +[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[291] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[295] = { 4, TD|TF, SEN(openat), "openat" }, +[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[302] = { 4, TD|TF, SEN(renameat), "renameat" }, +[303] = { 5, TD|TF, SEN(linkat), "linkat" }, +[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[308] = { 6, TD, SEN(pselect6), "pselect6" }, +[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[310] = { 1, TP, SEN(unshare), "unshare" }, +[311] = { 2, 0, SEN(sram_alloc), "sram_alloc" }, +[312] = { 1, 0, SEN(printargs), "sram_free" }, +[313] = { 3, 0, SEN(printargs), "dma_memcpy" }, +[314] = { 3, TN, SEN(accept), "accept" }, +[315] = { 3, TN, SEN(bind), "bind" }, +[316] = { 3, TN, SEN(connect), "connect" }, +[317] = { 3, TN, SEN(getpeername), "getpeername" }, +[318] = { 3, TN, SEN(getsockname), "getsockname" }, +[319] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[320] = { 2, TN, SEN(listen), "listen" }, +[321] = { 4, TN, SEN(recv), "recv" }, +[322] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[323] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[324] = { 4, TN, SEN(send), "send" }, +[325] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[326] = { 6, TN, SEN(sendto), "sendto" }, +[327] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[328] = { 2, TN, SEN(shutdown), "shutdown" }, +[329] = { 3, TN, SEN(socket), "socket" }, +[330] = { 4, TN, SEN(socketpair), "socketpair" }, +[331] = { 4, TI, SEN(semctl), "semctl" }, +[332] = { 3, TI, SEN(semget), "semget" }, +[333] = { 3, TI, SEN(semop), "semop" }, +[334] = { 3, TI, SEN(msgctl), "msgctl" }, +[335] = { 2, TI, SEN(msgget), "msgget" }, +[336] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[337] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[338] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[339] = { 3, TI, SEN(shmctl), "shmctl" }, +[340] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[341] = { 3, TI, SEN(shmget), "shmget" }, +[342] = { 6, TD, SEN(splice), "splice" }, +[343] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[344] = { 4, TD, SEN(tee), "tee" }, +[345] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[347] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[348] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[349] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[350] = { 1, TD, SEN(eventfd), "eventfd" }, +[351] = { 5, TD, SEN(pread), "pread64" }, +[352] = { 5, TD, SEN(pwrite), "pwrite64" }, +[353] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[354] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[355] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[356] = { 6, TD, SEN(fallocate), "fallocate" }, +[357] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[358] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[359] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[360] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[361] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[362] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[363] = { 3, TD, SEN(dup3), "dup3" }, +[364] = { 2, TD, SEN(pipe2), "pipe2" }, +[365] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[366] = { 5, TD, SEN(preadv), "preadv" }, +[367] = { 5, TD, SEN(pwritev), "pwritev" }, +[368] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[369] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[370] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[371] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[372] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[373] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[374] = { 3, 0, SEN(cacheflush), "cacheflush" }, +[375] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[376] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[377] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[378] = { 1, TD, SEN(syncfs), "syncfs" }, +[379] = { 2, TD, SEN(setns), "setns" }, +[380] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[381] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[382] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[383] = { 5, 0, SEN(kcmp), "kcmp" }, +[384] = { 3, TD, SEN(finit_module), "finit_module" }, +[385] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[386] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[387] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[388] = { 3, 0, SEN(seccomp), "seccomp" }, +[389] = { 3, 0, SEN(getrandom), "getrandom" }, +[390] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[391] = { 3, TD, SEN(bpf), "bpf" }, +[392] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, diff --git a/linux/bfin/userent.h b/linux/bfin/userent.h new file mode 100644 index 00000000..f7a7ca63 --- /dev/null +++ b/linux/bfin/userent.h @@ -0,0 +1,9 @@ +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +XLAT_UOFF(signal), +XLAT_UOFF(u_ar0), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/crisv10/arch_regs.c b/linux/crisv10/arch_regs.c new file mode 100644 index 00000000..9c372a36 --- /dev/null +++ b/linux/crisv10/arch_regs.c @@ -0,0 +1,2 @@ +static unsigned long cris_r10; +#define ARCH_PC_PEEK_ADDR (4 * PT_IRP) diff --git a/linux/crisv10/arch_sigreturn.c b/linux/crisv10/arch_sigreturn.c new file mode 100644 index 00000000..b449d41e --- /dev/null +++ b/linux/crisv10/arch_sigreturn.c @@ -0,0 +1,16 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + unsigned long regs[PT_MAX + 1]; + + if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, regs) < 0) { + perror_msg("sigreturn: PTRACE_GETREGS"); + return; + } + const unsigned long addr = + regs[PT_USP] + offsetof(struct sigcontext, oldmask); + + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/crisv10/get_error.c b/linux/crisv10/get_error.c new file mode 100644 index 00000000..b9da923f --- /dev/null +++ b/linux/crisv10/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(cris_r10)) { + tcp->u_rval = -1; + tcp->u_error = -cris_r10; + } else { + tcp->u_rval = cris_r10; + } +} diff --git a/linux/crisv10/get_scno.c b/linux/crisv10/get_scno.c new file mode 100644 index 00000000..14ff3386 --- /dev/null +++ b/linux/crisv10/get_scno.c @@ -0,0 +1,6 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + return upeek(tcp->pid, 4 * PT_R9, &tcp->scno) < 0 ? -1 : 1; +} diff --git a/linux/crisv10/get_syscall_args.c b/linux/crisv10/get_syscall_args.c new file mode 100644 index 00000000..bdd05746 --- /dev/null +++ b/linux/crisv10/get_syscall_args.c @@ -0,0 +1,15 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + static const int crisregs[MAX_ARGS] = { + 4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12, + 4*PT_R13 , 4*PT_MOF, 4*PT_SRP + }; + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, crisregs[i], &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/crisv10/get_syscall_result.c b/linux/crisv10/get_syscall_result.c new file mode 100644 index 00000000..6b3679c1 --- /dev/null +++ b/linux/crisv10/get_syscall_result.c @@ -0,0 +1,5 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + return upeek(tcp->pid, 4 * PT_R10, &cris_r10) < 0 ? -1 : 0; +} diff --git a/linux/crisv10/set_error.c b/linux/crisv10/set_error.c new file mode 100644 index 00000000..3a14a87a --- /dev/null +++ b/linux/crisv10/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + cris_r10 = -tcp->u_error; + return upoke(tcp->pid, 4 * PT_R10, cris_r10); +} + +static int +arch_set_success(struct tcb *tcp) +{ + cris_r10 = tcp->u_rval; + return upoke(tcp->pid, 4 * PT_R10, cris_r10); +} diff --git a/linux/crisv10/set_scno.c b/linux/crisv10/set_scno.c new file mode 100644 index 00000000..0de38fa7 --- /dev/null +++ b/linux/crisv10/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, 4 * PT_R9, scno); +} diff --git a/linux/crisv10/syscallent.h b/linux/crisv10/syscallent.h new file mode 100644 index 00000000..d411fe71 --- /dev/null +++ b/linux/crisv10/syscallent.h @@ -0,0 +1,358 @@ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 5, 0, SEN(vm86), "vm86" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 5, TD, SEN(pread), "pread64" }, +[181] = { 5, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "chown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[193] = { 3, TF, SEN(truncate64), "truncate64" }, +[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "lchown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(getegid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "chown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[224] = { 0, NF, SEN(gettid), "gettid" }, +[225] = { 4, TD, SEN(readahead), "readahead" }, +[226] = { 5, TF, SEN(setxattr), "setxattr" }, +[227] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[229] = { 4, TF, SEN(getxattr), "getxattr" }, +[230] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[232] = { 3, TF, SEN(listxattr), "listxattr" }, +[233] = { 3, TF, SEN(listxattr), "llistxattr" }, +[234] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[235] = { 2, TF, SEN(removexattr), "removexattr" }, +[236] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[238] = { 2, TS, SEN(kill), "tkill" }, +[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[240] = { 6, 0, SEN(futex), "futex" }, +[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, +[245] = { 2, TM, SEN(io_setup), "io_setup" }, +[246] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[248] = { 3, 0, SEN(io_submit), "io_submit" }, +[249] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[250] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[252] = { 1, TP|SE, SEN(exit), "exit_group" }, +[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[254] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[259] = { 3, 0, SEN(timer_create), "timer_create" }, +[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[263] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[268] = { 3, TF, SEN(statfs64), "statfs64" }, +[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[270] = { 3, TS, SEN(tgkill), "tgkill" }, +[271] = { 2, TF, SEN(utimes), "utimes" }, +[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[273] = { 5, 0, SEN(vserver), "vserver" }, +[274] = { 6, TM, SEN(mbind), "mbind" }, +[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[277] = { 4, 0, SEN(mq_open), "mq_open" }, +[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[283] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[284] = { 5, TP, SEN(waitid), "waitid" }, +[286] = { 5, 0, SEN(add_key), "add_key" }, +[287] = { 4, 0, SEN(request_key), "request_key" }, +[288] = { 5, 0, SEN(keyctl), "keyctl" }, +[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[291] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[295] = { 4, TD|TF, SEN(openat), "openat" }, +[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[302] = { 4, TD|TF, SEN(renameat), "renameat" }, +[303] = { 5, TD|TF, SEN(linkat), "linkat" }, +[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[308] = { 6, TD, SEN(pselect6), "pselect6" }, +[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[310] = { 1, TP, SEN(unshare), "unshare" }, +[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[313] = { 6, TD, SEN(splice), "splice" }, +[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[315] = { 4, TD, SEN(tee), "tee" }, +[316] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[317] = { 6, TM, SEN(move_pages), "move_pages" }, +[318] = { 3, 0, SEN(getcpu), "getcpu" }, +[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[323] = { 1, TD, SEN(eventfd), "eventfd" }, +[324] = { 6, TD, SEN(fallocate), "fallocate" }, +[325] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[326] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[328] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[329] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[330] = { 3, TD, SEN(dup3), "dup3" }, +[331] = { 2, TD, SEN(pipe2), "pipe2" }, +[332] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[333] = { 5, TD, SEN(preadv), "preadv" }, +[334] = { 5, TD, SEN(pwritev), "pwritev" }, +[335] = { 2, TD, SEN(setns), "setns" }, +[336] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[337] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[338] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[339] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[340] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[341] = { 4, TN, SEN(accept4), "accept4" }, +[342] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[343] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[344] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[345] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[346] = { 1, TD, SEN(syncfs), "syncfs" }, +[347] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[348] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[349] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[350] = { 5, 0, SEN(kcmp), "kcmp" }, +[351] = { 3, TD, SEN(finit_module), "finit_module" }, +[352] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[353] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[354] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[355] = { 3, 0, SEN(seccomp), "seccomp" }, +[356] = { 3, 0, SEN(getrandom), "getrandom" }, +[357] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[358] = { 3, TD, SEN(bpf), "bpf" }, +[359] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, + +#define SYS_socket_subcall 400 +#include "subcall.h" diff --git a/linux/crisv10/userent.h b/linux/crisv10/userent.h new file mode 100644 index 00000000..bea16aea --- /dev/null +++ b/linux/crisv10/userent.h @@ -0,0 +1,26 @@ +XLAT(4*PT_FRAMETYPE), +XLAT(4*PT_ORIG_R10), +XLAT(4*PT_R13), +XLAT(4*PT_R12), +XLAT(4*PT_R11), +XLAT(4*PT_R10), +XLAT(4*PT_R9), +XLAT(4*PT_R8), +XLAT(4*PT_R7), +XLAT(4*PT_R6), +XLAT(4*PT_R5), +XLAT(4*PT_R4), +XLAT(4*PT_R3), +XLAT(4*PT_R2), +XLAT(4*PT_R1), +XLAT(4*PT_R0), +XLAT(4*PT_MOF), +XLAT(4*PT_DCCR), +XLAT(4*PT_SRP), +XLAT(4*PT_IRP), +XLAT(4*PT_CSRINSTR), +XLAT(4*PT_CSRADDR), +XLAT(4*PT_CSRDATA), +XLAT(4*PT_USP), +/* Other fields in "struct user" */ +#include "../userent0.h" diff --git a/linux/crisv32/arch_regs.c b/linux/crisv32/arch_regs.c new file mode 100644 index 00000000..8e59c156 --- /dev/null +++ b/linux/crisv32/arch_regs.c @@ -0,0 +1,2 @@ +#include "crisv10/arch_regs.c" +#define ARCH_PC_PEEK_ADDR (4 * PT_ERP) diff --git a/linux/crisv32/arch_sigreturn.c b/linux/crisv32/arch_sigreturn.c new file mode 100644 index 00000000..6c0fc03b --- /dev/null +++ b/linux/crisv32/arch_sigreturn.c @@ -0,0 +1 @@ +#include "crisv10/arch_sigreturn.c" diff --git a/linux/crisv32/get_error.c b/linux/crisv32/get_error.c new file mode 100644 index 00000000..f7bb1e01 --- /dev/null +++ b/linux/crisv32/get_error.c @@ -0,0 +1 @@ +#include "crisv10/get_error.c" diff --git a/linux/crisv32/get_scno.c b/linux/crisv32/get_scno.c new file mode 100644 index 00000000..edfd60f8 --- /dev/null +++ b/linux/crisv32/get_scno.c @@ -0,0 +1 @@ +#include "crisv10/get_scno.c" diff --git a/linux/crisv32/get_syscall_args.c b/linux/crisv32/get_syscall_args.c new file mode 100644 index 00000000..4d984659 --- /dev/null +++ b/linux/crisv32/get_syscall_args.c @@ -0,0 +1 @@ +#include "crisv10/get_syscall_args.c" diff --git a/linux/crisv32/get_syscall_result.c b/linux/crisv32/get_syscall_result.c new file mode 100644 index 00000000..ebefdb20 --- /dev/null +++ b/linux/crisv32/get_syscall_result.c @@ -0,0 +1 @@ +#include "crisv10/get_syscall_result.c" diff --git a/linux/crisv32/set_error.c b/linux/crisv32/set_error.c new file mode 100644 index 00000000..18a5ee8c --- /dev/null +++ b/linux/crisv32/set_error.c @@ -0,0 +1 @@ +#include "crisv10/set_error.c" diff --git a/linux/crisv32/set_scno.c b/linux/crisv32/set_scno.c new file mode 100644 index 00000000..b021adf1 --- /dev/null +++ b/linux/crisv32/set_scno.c @@ -0,0 +1 @@ +#include "crisv10/set_scno.c" diff --git a/linux/crisv32/syscallent.h b/linux/crisv32/syscallent.h new file mode 100644 index 00000000..ce4e5284 --- /dev/null +++ b/linux/crisv32/syscallent.h @@ -0,0 +1 @@ +#include "crisv10/syscallent.h" diff --git a/linux/crisv32/userent.h b/linux/crisv32/userent.h new file mode 100644 index 00000000..3c5949eb --- /dev/null +++ b/linux/crisv32/userent.h @@ -0,0 +1,43 @@ +XLAT(4*PT_ORIG_R10), +XLAT(4*PT_R0), +XLAT(4*PT_R1), +XLAT(4*PT_R2), +XLAT(4*PT_R3), +XLAT(4*PT_R4), +XLAT(4*PT_R5), +XLAT(4*PT_R6), +XLAT(4*PT_R7), +XLAT(4*PT_R8), +XLAT(4*PT_R9), +XLAT(4*PT_R10), +XLAT(4*PT_R11), +XLAT(4*PT_R12), +XLAT(4*PT_R13), +XLAT(4*PT_ACR), +XLAT(4*PT_SRS), +XLAT(4*PT_MOF), +XLAT(4*PT_SPC), +XLAT(4*PT_CCS), +XLAT(4*PT_SRP), +XLAT(4*PT_ERP), +XLAT(4*PT_EXS), +XLAT(4*PT_EDA), +XLAT(4*PT_USP), +XLAT(4*PT_PPC), +XLAT(4*PT_BP_CTRL), +XLAT(4*PT_BP+4), +XLAT(4*PT_BP+8), +XLAT(4*PT_BP+12), +XLAT(4*PT_BP+16), +XLAT(4*PT_BP+20), +XLAT(4*PT_BP+24), +XLAT(4*PT_BP+28), +XLAT(4*PT_BP+32), +XLAT(4*PT_BP+36), +XLAT(4*PT_BP+40), +XLAT(4*PT_BP+44), +XLAT(4*PT_BP+48), +XLAT(4*PT_BP+52), +XLAT(4*PT_BP+56), +/* Other fields in "struct user" */ +#include "../userent0.h" diff --git a/linux/dummy.h b/linux/dummy.h index 31be7b74..2758cfb2 100644 --- a/linux/dummy.h +++ b/linux/dummy.h @@ -26,48 +26,56 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef STRACE_LINUX_DUMMY_H +#define STRACE_LINUX_DUMMY_H + #ifndef HAVE_STRUCT___OLD_KERNEL_STAT #define sys_oldfstat printargs #define sys_oldstat printargs #endif /* still unfinished */ -#define sys_ioperm printargs -#define sys_iopl printargs -#define sys_kcmp printargs -#define sys_lookup_dcookie printargs -#define sys_name_to_handle_at printargs -#define sys_open_by_handle_at printargs -#define sys_sched_getattr printargs -#define sys_sched_setattr printargs -#define sys_sysfs printargs -#define sys_vm86old printargs #define sys_vm86 printargs +#define sys_vm86old printargs /* machine-specific */ -#if !(defined I386 || defined X86_64 || defined X32) +#ifndef HAVE_STRUCT_USER_DESC # define sys_modify_ldt printargs -# ifndef M68K -# define sys_get_thread_area printargs -# ifndef MIPS -# define sys_set_thread_area printargs -# endif -# endif +#endif + +#if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS) +# define sys_set_thread_area printargs +#endif + +#if !(defined HAVE_STRUCT_USER_DESC || defined M68K) +# define sys_get_thread_area printargs +#endif + +#ifdef ALPHA +# define sys_getdtablesize printargs #endif /* like another call */ #define sys_acct sys_chdir #define sys_chroot sys_chdir #define sys_clock_getres sys_clock_gettime +#define sys_connect sys_bind #define sys_fchdir sys_close #define sys_fdatasync sys_close #define sys_fsync sys_close #define sys_getegid sys_getuid +#define sys_getegid16 sys_geteuid16 #define sys_geteuid sys_getuid +#define sys_geteuid16 sys_getuid16 #define sys_getgid sys_getuid +#define sys_getgid16 sys_getuid16 +#define sys_getpeername sys_getsockname #define sys_getresgid sys_getresuid +#define sys_getresgid16 sys_getresuid16 #define sys_lstat sys_stat #define sys_lstat64 sys_stat64 +#define sys_mkdir sys_chmod +#define sys_mkdirat sys_fchmodat #define sys_mlock sys_munmap #define sys_mq_unlink sys_chdir #define sys_munlock sys_munmap @@ -77,10 +85,16 @@ #define sys_rmdir sys_chdir #define sys_sched_get_priority_max sys_sched_get_priority_min #define sys_set_robust_list sys_munmap +#define sys_setdomainname sys_sethostname #define sys_setfsgid sys_setfsuid +#define sys_setfsgid16 sys_setfsuid16 #define sys_setgid sys_setuid +#define sys_setgid16 sys_setuid16 #define sys_setregid sys_setreuid +#define sys_setregid16 sys_setreuid16 #define sys_setresgid sys_setresuid +#define sys_setresgid16 sys_setresuid16 +#define sys_stime sys_time #define sys_swapoff sys_chdir #define sys_symlink sys_link #define sys_syncfs sys_close @@ -90,7 +104,7 @@ #define sys_vfork sys_fork /* printargs does the right thing */ -#define sys_getpgid printargs +#define sys_getpgrp printargs #define sys_getpid printargs #define sys_getppid printargs #define sys_gettid printargs @@ -98,63 +112,56 @@ #define sys_inotify_init printargs #define sys_munlockall printargs #define sys_pause printargs +#define sys_printargs printargs #define sys_rt_sigreturn printargs #define sys_sched_yield printargs #define sys_setsid printargs #define sys_set_tid_address printargs #define sys_setup printargs #define sys_sync printargs -#define sys_timer_delete printargs -#define sys_timer_getoverrun printargs +#define sys_syscall printargs #define sys_vhangup printargs -/* printargs_lu/ld does the right thing */ -#define sys_alarm printargs_lu -#define sys_getpgrp printargs_lu -#define sys_getsid printargs_lu -#define sys_nice printargs_ld -#define sys_setpgid printargs_lu -#define sys_setpgrp printargs_lu +/* printargs_u does the right thing */ +#define sys_alarm printargs_u + +/* printargs_d does the right thing */ +#define sys_exit printargs_d +#define sys_getpgid printargs_d +#define sys_getsid printargs_d +#define sys_nice printargs_d +#define sys_setpgid printargs_d +#define sys_setpgrp printargs_d +#define sys_timer_delete printargs_d +#define sys_timer_getoverrun printargs_d /* unimplemented */ #define sys_afs_syscall printargs #define sys_break printargs +#define sys_create_module printargs #define sys_ftime printargs #define sys_get_kernel_syms printargs +#define sys_getpmsg printargs #define sys_gtty printargs #define sys_lock printargs #define sys_mpx printargs #define sys_nfsservctl printargs #define sys_phys printargs -#define sys_profil printargs #define sys_prof printargs +#define sys_profil printargs +#define sys_putpmsg printargs +#define sys_query_module printargs #define sys_security printargs #define sys_stty printargs +#define sys_timerfd printargs #define sys_tuxcall printargs #define sys_ulimit printargs -#define sys_ustat printargs #define sys_vserver printargs /* deprecated */ #define sys_bdflush printargs #define sys_oldolduname printargs #define sys_olduname printargs +#define sys_sysfs printargs -/* no library support */ -#ifndef HAVE_SENDMSG -#define sys_recvmsg printargs -#define sys_sendmsg printargs -#endif - -/* Who has STREAMS syscalls? - * Linux hasn't. Solaris has (had?). - * Just in case I miss something, retain in for Sparc. - * Note: SYS_get/putpmsg may be defined even though syscalls - * return ENOSYS. Can't just check defined(SYS_getpmsg). - */ -#if (!defined(SPARC) && !defined(SPARC64)) || !defined(SYS_getpmsg) -#define sys_getpmsg printargs -#endif -#if (!defined(SPARC) && !defined(SPARC64)) || !defined(SYS_putpmsg) -#define sys_putpmsg printargs -#endif +#endif /* !STRACE_LINUX_DUMMY_H */ diff --git a/linux/errnoent.h b/linux/errnoent.h index c2ac6839..012f0999 100644 --- a/linux/errnoent.h +++ b/linux/errnoent.h @@ -1,535 +1,147 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EAGAIN", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "EDEADLK", /* 35 */ - "ENAMETOOLONG", /* 36 */ - "ENOLCK", /* 37 */ - "ENOSYS", /* 38 */ - "ENOTEMPTY", /* 39 */ - "ELOOP", /* 40 */ - "ERRNO_41", /* 41 */ - "ENOMSG", /* 42 */ - "EIDRM", /* 43 */ - "ECHRNG", /* 44 */ - "EL2NSYNC", /* 45 */ - "EL3HLT", /* 46 */ - "EL3RST", /* 47 */ - "ELNRNG", /* 48 */ - "EUNATCH", /* 49 */ - "ENOCSI", /* 50 */ - "EL2HLT", /* 51 */ - "EBADE", /* 52 */ - "EBADR", /* 53 */ - "EXFULL", /* 54 */ - "ENOANO", /* 55 */ - "EBADRQC", /* 56 */ - "EBADSLT", /* 57 */ -#ifdef POWERPC - "EDEADLOCK", /* 58 */ -#else - "ERRNO_58", /* 58 */ -#endif - "EBFONT", /* 59 */ - "ENOSTR", /* 60 */ - "ENODATA", /* 61 */ - "ETIME", /* 62 */ - "ENOSR", /* 63 */ - "ENONET", /* 64 */ - "ENOPKG", /* 65 */ - "EREMOTE", /* 66 */ - "ENOLINK", /* 67 */ - "EADV", /* 68 */ - "ESRMNT", /* 69 */ - "ECOMM", /* 70 */ - "EPROTO", /* 71 */ - "EMULTIHOP", /* 72 */ - "EDOTDOT", /* 73 */ - "EBADMSG", /* 74 */ - "EOVERFLOW", /* 75 */ - "ENOTUNIQ", /* 76 */ - "EBADFD", /* 77 */ - "EREMCHG", /* 78 */ - "ELIBACC", /* 79 */ - "ELIBBAD", /* 80 */ - "ELIBSCN", /* 81 */ - "ELIBMAX", /* 82 */ - "ELIBEXEC", /* 83 */ - "EILSEQ", /* 84 */ - "ERESTART", /* 85 */ - "ESTRPIPE", /* 86 */ - "EUSERS", /* 87 */ - "ENOTSOCK", /* 88 */ - "EDESTADDRREQ", /* 89 */ - "EMSGSIZE", /* 90 */ - "EPROTOTYPE", /* 91 */ - "ENOPROTOOPT", /* 92 */ - "EPROTONOSUPPORT", /* 93 */ - "ESOCKTNOSUPPORT", /* 94 */ - "EOPNOTSUPP", /* 95 */ - "EPFNOSUPPORT", /* 96 */ - "EAFNOSUPPORT", /* 97 */ - "EADDRINUSE", /* 98 */ - "EADDRNOTAVAIL", /* 99 */ - "ENETDOWN", /* 100 */ - "ENETUNREACH", /* 101 */ - "ENETRESET", /* 102 */ - "ECONNABORTED", /* 103 */ - "ECONNRESET", /* 104 */ - "ENOBUFS", /* 105 */ - "EISCONN", /* 106 */ - "ENOTCONN", /* 107 */ - "ESHUTDOWN", /* 108 */ - "ETOOMANYREFS", /* 109 */ - "ETIMEDOUT", /* 110 */ - "ECONNREFUSED", /* 111 */ - "EHOSTDOWN", /* 112 */ - "EHOSTUNREACH", /* 113 */ - "EALREADY", /* 114 */ - "EINPROGRESS", /* 115 */ - "ESTALE", /* 116 */ - "EUCLEAN", /* 117 */ - "ENOTNAM", /* 118 */ - "ENAVAIL", /* 119 */ - "EISNAM", /* 120 */ - "EREMOTEIO", /* 121 */ - "EDQUOT", /* 122 */ - "ENOMEDIUM", /* 123 */ - "EMEDIUMTYPE", /* 124 */ - "ECANCELED", /* 125 */ - "ENOKEY", /* 126 */ - "EKEYEXPIRED", /* 127 */ - "EKEYREVOKED", /* 128 */ - "EKEYREJECTED", /* 129 */ - "EOWNERDEAD", /* 130 */ - "ENOTRECOVERABLE", /* 131 */ - "ERFKILL", /* 132 */ - "EHWPOISON", /* 133 */ - "ERRNO_134", /* 134 */ - "ERRNO_135", /* 135 */ - "ERRNO_136", /* 136 */ - "ERRNO_137", /* 137 */ - "ERRNO_138", /* 138 */ - "ERRNO_139", /* 139 */ - "ERRNO_140", /* 140 */ - "ERRNO_141", /* 141 */ - "ERRNO_142", /* 142 */ - "ERRNO_143", /* 143 */ - "ERRNO_144", /* 144 */ - "ERRNO_145", /* 145 */ - "ERRNO_146", /* 146 */ - "ERRNO_147", /* 147 */ - "ERRNO_148", /* 148 */ - "ERRNO_149", /* 149 */ - "ERRNO_150", /* 150 */ - "ERRNO_151", /* 151 */ - "ERRNO_152", /* 152 */ - "ERRNO_153", /* 153 */ - "ERRNO_154", /* 154 */ - "ERRNO_155", /* 155 */ - "ERRNO_156", /* 156 */ - "ERRNO_157", /* 157 */ - "ERRNO_158", /* 158 */ - "ERRNO_159", /* 159 */ - "ERRNO_160", /* 160 */ - "ERRNO_161", /* 161 */ - "ERRNO_162", /* 162 */ - "ERRNO_163", /* 163 */ - "ERRNO_164", /* 164 */ - "ERRNO_165", /* 165 */ - "ERRNO_166", /* 166 */ - "ERRNO_167", /* 167 */ - "ERRNO_168", /* 168 */ - "ERRNO_169", /* 169 */ - "ERRNO_170", /* 170 */ - "ERRNO_171", /* 171 */ - "ERRNO_172", /* 172 */ - "ERRNO_173", /* 173 */ - "ERRNO_174", /* 174 */ - "ERRNO_175", /* 175 */ - "ERRNO_176", /* 176 */ - "ERRNO_177", /* 177 */ - "ERRNO_178", /* 178 */ - "ERRNO_179", /* 179 */ - "ERRNO_180", /* 180 */ - "ERRNO_181", /* 181 */ - "ERRNO_182", /* 182 */ - "ERRNO_183", /* 183 */ - "ERRNO_184", /* 184 */ - "ERRNO_185", /* 185 */ - "ERRNO_186", /* 186 */ - "ERRNO_187", /* 187 */ - "ERRNO_188", /* 188 */ - "ERRNO_189", /* 189 */ - "ERRNO_190", /* 190 */ - "ERRNO_191", /* 191 */ - "ERRNO_192", /* 192 */ - "ERRNO_193", /* 193 */ - "ERRNO_194", /* 194 */ - "ERRNO_195", /* 195 */ - "ERRNO_196", /* 196 */ - "ERRNO_197", /* 197 */ - "ERRNO_198", /* 198 */ - "ERRNO_199", /* 199 */ - "ERRNO_200", /* 200 */ - "ERRNO_201", /* 201 */ - "ERRNO_202", /* 202 */ - "ERRNO_203", /* 203 */ - "ERRNO_204", /* 204 */ - "ERRNO_205", /* 205 */ - "ERRNO_206", /* 206 */ - "ERRNO_207", /* 207 */ - "ERRNO_208", /* 208 */ - "ERRNO_209", /* 209 */ - "ERRNO_210", /* 210 */ - "ERRNO_211", /* 211 */ - "ERRNO_212", /* 212 */ - "ERRNO_213", /* 213 */ - "ERRNO_214", /* 214 */ - "ERRNO_215", /* 215 */ - "ERRNO_216", /* 216 */ - "ERRNO_217", /* 217 */ - "ERRNO_218", /* 218 */ - "ERRNO_219", /* 219 */ - "ERRNO_220", /* 220 */ - "ERRNO_221", /* 221 */ - "ERRNO_222", /* 222 */ - "ERRNO_223", /* 223 */ - "ERRNO_224", /* 224 */ - "ERRNO_225", /* 225 */ - "ERRNO_226", /* 226 */ - "ERRNO_227", /* 227 */ - "ERRNO_228", /* 228 */ - "ERRNO_229", /* 229 */ - "ERRNO_230", /* 230 */ - "ERRNO_231", /* 231 */ - "ERRNO_232", /* 232 */ - "ERRNO_233", /* 233 */ - "ERRNO_234", /* 234 */ - "ERRNO_235", /* 235 */ - "ERRNO_236", /* 236 */ - "ERRNO_237", /* 237 */ - "ERRNO_238", /* 238 */ - "ERRNO_239", /* 239 */ - "ERRNO_240", /* 240 */ - "ERRNO_241", /* 241 */ - "ERRNO_242", /* 242 */ - "ERRNO_243", /* 243 */ - "ERRNO_244", /* 244 */ - "ERRNO_245", /* 245 */ - "ERRNO_246", /* 246 */ - "ERRNO_247", /* 247 */ - "ERRNO_248", /* 248 */ - "ERRNO_249", /* 249 */ - "ERRNO_250", /* 250 */ - "ERRNO_251", /* 251 */ - "ERRNO_252", /* 252 */ - "ERRNO_253", /* 253 */ - "ERRNO_254", /* 254 */ - "ERRNO_255", /* 255 */ - "ERRNO_256", /* 256 */ - "ERRNO_257", /* 257 */ - "ERRNO_258", /* 258 */ - "ERRNO_259", /* 259 */ - "ERRNO_260", /* 260 */ - "ERRNO_261", /* 261 */ - "ERRNO_262", /* 262 */ - "ERRNO_263", /* 263 */ - "ERRNO_264", /* 264 */ - "ERRNO_265", /* 265 */ - "ERRNO_266", /* 266 */ - "ERRNO_267", /* 267 */ - "ERRNO_268", /* 268 */ - "ERRNO_269", /* 269 */ - "ERRNO_270", /* 270 */ - "ERRNO_271", /* 271 */ - "ERRNO_272", /* 272 */ - "ERRNO_273", /* 273 */ - "ERRNO_274", /* 274 */ - "ERRNO_275", /* 275 */ - "ERRNO_276", /* 276 */ - "ERRNO_277", /* 277 */ - "ERRNO_278", /* 278 */ - "ERRNO_279", /* 279 */ - "ERRNO_280", /* 280 */ - "ERRNO_281", /* 281 */ - "ERRNO_282", /* 282 */ - "ERRNO_283", /* 283 */ - "ERRNO_284", /* 284 */ - "ERRNO_285", /* 285 */ - "ERRNO_286", /* 286 */ - "ERRNO_287", /* 287 */ - "ERRNO_288", /* 288 */ - "ERRNO_289", /* 289 */ - "ERRNO_290", /* 290 */ - "ERRNO_291", /* 291 */ - "ERRNO_292", /* 292 */ - "ERRNO_293", /* 293 */ - "ERRNO_294", /* 294 */ - "ERRNO_295", /* 295 */ - "ERRNO_296", /* 296 */ - "ERRNO_297", /* 297 */ - "ERRNO_298", /* 298 */ - "ERRNO_299", /* 299 */ - "ERRNO_300", /* 300 */ - "ERRNO_301", /* 301 */ - "ERRNO_302", /* 302 */ - "ERRNO_303", /* 303 */ - "ERRNO_304", /* 304 */ - "ERRNO_305", /* 305 */ - "ERRNO_306", /* 306 */ - "ERRNO_307", /* 307 */ - "ERRNO_308", /* 308 */ - "ERRNO_309", /* 309 */ - "ERRNO_310", /* 310 */ - "ERRNO_311", /* 311 */ - "ERRNO_312", /* 312 */ - "ERRNO_313", /* 313 */ - "ERRNO_314", /* 314 */ - "ERRNO_315", /* 315 */ - "ERRNO_316", /* 316 */ - "ERRNO_317", /* 317 */ - "ERRNO_318", /* 318 */ - "ERRNO_319", /* 319 */ - "ERRNO_320", /* 320 */ - "ERRNO_321", /* 321 */ - "ERRNO_322", /* 322 */ - "ERRNO_323", /* 323 */ - "ERRNO_324", /* 324 */ - "ERRNO_325", /* 325 */ - "ERRNO_326", /* 326 */ - "ERRNO_327", /* 327 */ - "ERRNO_328", /* 328 */ - "ERRNO_329", /* 329 */ - "ERRNO_330", /* 330 */ - "ERRNO_331", /* 331 */ - "ERRNO_332", /* 332 */ - "ERRNO_333", /* 333 */ - "ERRNO_334", /* 334 */ - "ERRNO_335", /* 335 */ - "ERRNO_336", /* 336 */ - "ERRNO_337", /* 337 */ - "ERRNO_338", /* 338 */ - "ERRNO_339", /* 339 */ - "ERRNO_340", /* 340 */ - "ERRNO_341", /* 341 */ - "ERRNO_342", /* 342 */ - "ERRNO_343", /* 343 */ - "ERRNO_344", /* 344 */ - "ERRNO_345", /* 345 */ - "ERRNO_346", /* 346 */ - "ERRNO_347", /* 347 */ - "ERRNO_348", /* 348 */ - "ERRNO_349", /* 349 */ - "ERRNO_350", /* 350 */ - "ERRNO_351", /* 351 */ - "ERRNO_352", /* 352 */ - "ERRNO_353", /* 353 */ - "ERRNO_354", /* 354 */ - "ERRNO_355", /* 355 */ - "ERRNO_356", /* 356 */ - "ERRNO_357", /* 357 */ - "ERRNO_358", /* 358 */ - "ERRNO_359", /* 359 */ - "ERRNO_360", /* 360 */ - "ERRNO_361", /* 361 */ - "ERRNO_362", /* 362 */ - "ERRNO_363", /* 363 */ - "ERRNO_364", /* 364 */ - "ERRNO_365", /* 365 */ - "ERRNO_366", /* 366 */ - "ERRNO_367", /* 367 */ - "ERRNO_368", /* 368 */ - "ERRNO_369", /* 369 */ - "ERRNO_370", /* 370 */ - "ERRNO_371", /* 371 */ - "ERRNO_372", /* 372 */ - "ERRNO_373", /* 373 */ - "ERRNO_374", /* 374 */ - "ERRNO_375", /* 375 */ - "ERRNO_376", /* 376 */ - "ERRNO_377", /* 377 */ - "ERRNO_378", /* 378 */ - "ERRNO_379", /* 379 */ - "ERRNO_380", /* 380 */ - "ERRNO_381", /* 381 */ - "ERRNO_382", /* 382 */ - "ERRNO_383", /* 383 */ - "ERRNO_384", /* 384 */ - "ERRNO_385", /* 385 */ - "ERRNO_386", /* 386 */ - "ERRNO_387", /* 387 */ - "ERRNO_388", /* 388 */ - "ERRNO_389", /* 389 */ - "ERRNO_390", /* 390 */ - "ERRNO_391", /* 391 */ - "ERRNO_392", /* 392 */ - "ERRNO_393", /* 393 */ - "ERRNO_394", /* 394 */ - "ERRNO_395", /* 395 */ - "ERRNO_396", /* 396 */ - "ERRNO_397", /* 397 */ - "ERRNO_398", /* 398 */ - "ERRNO_399", /* 399 */ - "ERRNO_400", /* 400 */ - "ERRNO_401", /* 401 */ - "ERRNO_402", /* 402 */ - "ERRNO_403", /* 403 */ - "ERRNO_404", /* 404 */ - "ERRNO_405", /* 405 */ - "ERRNO_406", /* 406 */ - "ERRNO_407", /* 407 */ - "ERRNO_408", /* 408 */ - "ERRNO_409", /* 409 */ - "ERRNO_410", /* 410 */ - "ERRNO_411", /* 411 */ - "ERRNO_412", /* 412 */ - "ERRNO_413", /* 413 */ - "ERRNO_414", /* 414 */ - "ERRNO_415", /* 415 */ - "ERRNO_416", /* 416 */ - "ERRNO_417", /* 417 */ - "ERRNO_418", /* 418 */ - "ERRNO_419", /* 419 */ - "ERRNO_420", /* 420 */ - "ERRNO_421", /* 421 */ - "ERRNO_422", /* 422 */ - "ERRNO_423", /* 423 */ - "ERRNO_424", /* 424 */ - "ERRNO_425", /* 425 */ - "ERRNO_426", /* 426 */ - "ERRNO_427", /* 427 */ - "ERRNO_428", /* 428 */ - "ERRNO_429", /* 429 */ - "ERRNO_430", /* 430 */ - "ERRNO_431", /* 431 */ - "ERRNO_432", /* 432 */ - "ERRNO_433", /* 433 */ - "ERRNO_434", /* 434 */ - "ERRNO_435", /* 435 */ - "ERRNO_436", /* 436 */ - "ERRNO_437", /* 437 */ - "ERRNO_438", /* 438 */ - "ERRNO_439", /* 439 */ - "ERRNO_440", /* 440 */ - "ERRNO_441", /* 441 */ - "ERRNO_442", /* 442 */ - "ERRNO_443", /* 443 */ - "ERRNO_444", /* 444 */ - "ERRNO_445", /* 445 */ - "ERRNO_446", /* 446 */ - "ERRNO_447", /* 447 */ - "ERRNO_448", /* 448 */ - "ERRNO_449", /* 449 */ - "ERRNO_450", /* 450 */ - "ERRNO_451", /* 451 */ - "ERRNO_452", /* 452 */ - "ERRNO_453", /* 453 */ - "ERRNO_454", /* 454 */ - "ERRNO_455", /* 455 */ - "ERRNO_456", /* 456 */ - "ERRNO_457", /* 457 */ - "ERRNO_458", /* 458 */ - "ERRNO_459", /* 459 */ - "ERRNO_460", /* 460 */ - "ERRNO_461", /* 461 */ - "ERRNO_462", /* 462 */ - "ERRNO_463", /* 463 */ - "ERRNO_464", /* 464 */ - "ERRNO_465", /* 465 */ - "ERRNO_466", /* 466 */ - "ERRNO_467", /* 467 */ - "ERRNO_468", /* 468 */ - "ERRNO_469", /* 469 */ - "ERRNO_470", /* 470 */ - "ERRNO_471", /* 471 */ - "ERRNO_472", /* 472 */ - "ERRNO_473", /* 473 */ - "ERRNO_474", /* 474 */ - "ERRNO_475", /* 475 */ - "ERRNO_476", /* 476 */ - "ERRNO_477", /* 477 */ - "ERRNO_478", /* 478 */ - "ERRNO_479", /* 479 */ - "ERRNO_480", /* 480 */ - "ERRNO_481", /* 481 */ - "ERRNO_482", /* 482 */ - "ERRNO_483", /* 483 */ - "ERRNO_484", /* 484 */ - "ERRNO_485", /* 485 */ - "ERRNO_486", /* 486 */ - "ERRNO_487", /* 487 */ - "ERRNO_488", /* 488 */ - "ERRNO_489", /* 489 */ - "ERRNO_490", /* 490 */ - "ERRNO_491", /* 491 */ - "ERRNO_492", /* 492 */ - "ERRNO_493", /* 493 */ - "ERRNO_494", /* 494 */ - "ERRNO_495", /* 495 */ - "ERRNO_496", /* 496 */ - "ERRNO_497", /* 497 */ - "ERRNO_498", /* 498 */ - "ERRNO_499", /* 499 */ - "ERRNO_500", /* 500 */ - "ERRNO_501", /* 501 */ - "ERRNO_502", /* 502 */ - "ERRNO_503", /* 503 */ - "ERRNO_504", /* 504 */ - "ERRNO_505", /* 505 */ - "ERRNO_506", /* 506 */ - "ERRNO_507", /* 507 */ - "ERRNO_508", /* 508 */ - "ERRNO_509", /* 509 */ - "ERRNO_510", /* 510 */ - "ERRNO_511", /* 511 */ - "ERESTARTSYS", /* 512 */ - "ERESTARTNOINTR", /* 513 */ - "ERESTARTNOHAND", /* 514 */ - "ENOIOCTLCMD", /* 515 */ - "ERESTART_RESTARTBLOCK", /* 516 */ - "EPROBE_DEFER", /* 517 */ - "EOPENSTALE", /* 518 */ - "ERRNO_519", /* 519 */ - "ERRNO_520", /* 520 */ - "EBADHANDLE", /* 521 */ - "ENOTSYNC", /* 522 */ - "EBADCOOKIE", /* 523 */ - "ENOTSUPP", /* 524 */ - "ETOOSMALL", /* 525 */ - "ESERVERFAULT", /* 526 */ - "EBADTYPE", /* 527 */ - "EJUKEBOX", /* 528 */ - "EIOCBQUEUED", /* 529 */ - "EIOCBRETRY", /* 530 */ +[ 1] = "EPERM", +[ 2] = "ENOENT", +[ 3] = "ESRCH", +[ 4] = "EINTR", +[ 5] = "EIO", +[ 6] = "ENXIO", +[ 7] = "E2BIG", +[ 8] = "ENOEXEC", +[ 9] = "EBADF", +[ 10] = "ECHILD", +[ 11] = "EAGAIN", +[ 12] = "ENOMEM", +[ 13] = "EACCES", +[ 14] = "EFAULT", +[ 15] = "ENOTBLK", +[ 16] = "EBUSY", +[ 17] = "EEXIST", +[ 18] = "EXDEV", +[ 19] = "ENODEV", +[ 20] = "ENOTDIR", +[ 21] = "EISDIR", +[ 22] = "EINVAL", +[ 23] = "ENFILE", +[ 24] = "EMFILE", +[ 25] = "ENOTTY", +[ 26] = "ETXTBSY", +[ 27] = "EFBIG", +[ 28] = "ENOSPC", +[ 29] = "ESPIPE", +[ 30] = "EROFS", +[ 31] = "EMLINK", +[ 32] = "EPIPE", +[ 33] = "EDOM", +[ 34] = "ERANGE", +[ 35] = "EDEADLK", +[ 36] = "ENAMETOOLONG", +[ 37] = "ENOLCK", +[ 38] = "ENOSYS", +[ 39] = "ENOTEMPTY", +[ 40] = "ELOOP", +[ 42] = "ENOMSG", +[ 43] = "EIDRM", +[ 44] = "ECHRNG", +[ 45] = "EL2NSYNC", +[ 46] = "EL3HLT", +[ 47] = "EL3RST", +[ 48] = "ELNRNG", +[ 49] = "EUNATCH", +[ 50] = "ENOCSI", +[ 51] = "EL2HLT", +[ 52] = "EBADE", +[ 53] = "EBADR", +[ 54] = "EXFULL", +[ 55] = "ENOANO", +[ 56] = "EBADRQC", +[ 57] = "EBADSLT", +[ 59] = "EBFONT", +[ 60] = "ENOSTR", +[ 61] = "ENODATA", +[ 62] = "ETIME", +[ 63] = "ENOSR", +[ 64] = "ENONET", +[ 65] = "ENOPKG", +[ 66] = "EREMOTE", +[ 67] = "ENOLINK", +[ 68] = "EADV", +[ 69] = "ESRMNT", +[ 70] = "ECOMM", +[ 71] = "EPROTO", +[ 72] = "EMULTIHOP", +[ 73] = "EDOTDOT", +[ 74] = "EBADMSG", +[ 75] = "EOVERFLOW", +[ 76] = "ENOTUNIQ", +[ 77] = "EBADFD", +[ 78] = "EREMCHG", +[ 79] = "ELIBACC", +[ 80] = "ELIBBAD", +[ 81] = "ELIBSCN", +[ 82] = "ELIBMAX", +[ 83] = "ELIBEXEC", +[ 84] = "EILSEQ", +[ 85] = "ERESTART", +[ 86] = "ESTRPIPE", +[ 87] = "EUSERS", +[ 88] = "ENOTSOCK", +[ 89] = "EDESTADDRREQ", +[ 90] = "EMSGSIZE", +[ 91] = "EPROTOTYPE", +[ 92] = "ENOPROTOOPT", +[ 93] = "EPROTONOSUPPORT", +[ 94] = "ESOCKTNOSUPPORT", +[ 95] = "EOPNOTSUPP", +[ 96] = "EPFNOSUPPORT", +[ 97] = "EAFNOSUPPORT", +[ 98] = "EADDRINUSE", +[ 99] = "EADDRNOTAVAIL", +[100] = "ENETDOWN", +[101] = "ENETUNREACH", +[102] = "ENETRESET", +[103] = "ECONNABORTED", +[104] = "ECONNRESET", +[105] = "ENOBUFS", +[106] = "EISCONN", +[107] = "ENOTCONN", +[108] = "ESHUTDOWN", +[109] = "ETOOMANYREFS", +[110] = "ETIMEDOUT", +[111] = "ECONNREFUSED", +[112] = "EHOSTDOWN", +[113] = "EHOSTUNREACH", +[114] = "EALREADY", +[115] = "EINPROGRESS", +[116] = "ESTALE", +[117] = "EUCLEAN", +[118] = "ENOTNAM", +[119] = "ENAVAIL", +[120] = "EISNAM", +[121] = "EREMOTEIO", +[122] = "EDQUOT", +[123] = "ENOMEDIUM", +[124] = "EMEDIUMTYPE", +[125] = "ECANCELED", +[126] = "ENOKEY", +[127] = "EKEYEXPIRED", +[128] = "EKEYREVOKED", +[129] = "EKEYREJECTED", +[130] = "EOWNERDEAD", +[131] = "ENOTRECOVERABLE", +[132] = "ERFKILL", +[133] = "EHWPOISON", +[512] = "ERESTARTSYS", +[513] = "ERESTARTNOINTR", +[514] = "ERESTARTNOHAND", +[515] = "ENOIOCTLCMD", +[516] = "ERESTART_RESTARTBLOCK", +[517] = "EPROBE_DEFER", +[518] = "EOPENSTALE", +[521] = "EBADHANDLE", +[522] = "ENOTSYNC", +[523] = "EBADCOOKIE", +[524] = "ENOTSUPP", +[525] = "ETOOSMALL", +[526] = "ESERVERFAULT", +[527] = "EBADTYPE", +[528] = "EJUKEBOX", +[529] = "EIOCBQUEUED", diff --git a/linux/fanotify.h b/linux/fanotify.h deleted file mode 100644 index f780e5ae..00000000 --- a/linux/fanotify.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef _LINUX_FANOTIFY_H -#define _LINUX_FANOTIFY_H - -#include - -/* the following events that user-space can register for */ -#define FAN_ACCESS 0x00000001 /* File was accessed */ -#define FAN_MODIFY 0x00000002 /* File was modified */ -#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */ -#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ -#define FAN_OPEN 0x00000020 /* File was opened */ - -#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ - -#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ -#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ - -#define FAN_ONDIR 0x40000000 /* event occurred against dir */ - -#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ - -/* helper events */ -#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ - -/* flags used for fanotify_init() */ -#define FAN_CLOEXEC 0x00000001 -#define FAN_NONBLOCK 0x00000002 - -/* These are NOT bitwise flags. Both bits are used togther. */ -#define FAN_CLASS_NOTIF 0x00000000 -#define FAN_CLASS_CONTENT 0x00000004 -#define FAN_CLASS_PRE_CONTENT 0x00000008 -#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ - FAN_CLASS_PRE_CONTENT) - -#define FAN_UNLIMITED_QUEUE 0x00000010 -#define FAN_UNLIMITED_MARKS 0x00000020 - -#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ - FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\ - FAN_UNLIMITED_MARKS) - -/* flags used for fanotify_modify_mark() */ -#define FAN_MARK_ADD 0x00000001 -#define FAN_MARK_REMOVE 0x00000002 -#define FAN_MARK_DONT_FOLLOW 0x00000004 -#define FAN_MARK_ONLYDIR 0x00000008 -#define FAN_MARK_MOUNT 0x00000010 -#define FAN_MARK_IGNORED_MASK 0x00000020 -#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 -#define FAN_MARK_FLUSH 0x00000080 - -#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ - FAN_MARK_REMOVE |\ - FAN_MARK_DONT_FOLLOW |\ - FAN_MARK_ONLYDIR |\ - FAN_MARK_MOUNT |\ - FAN_MARK_IGNORED_MASK |\ - FAN_MARK_IGNORED_SURV_MODIFY |\ - FAN_MARK_FLUSH) - -/* - * All of the events - we build the list by hand so that we can add flags in - * the future and not break backward compatibility. Apps will get only the - * events that they originally wanted. Be sure to add new events here! - */ -#define FAN_ALL_EVENTS (FAN_ACCESS |\ - FAN_MODIFY |\ - FAN_CLOSE |\ - FAN_OPEN) - -/* - * All events which require a permission response from userspace - */ -#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\ - FAN_ACCESS_PERM) - -#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\ - FAN_ALL_PERM_EVENTS |\ - FAN_Q_OVERFLOW) - -#define FANOTIFY_METADATA_VERSION 3 - -struct fanotify_event_metadata { - __u32 event_len; - __u8 vers; - __u8 reserved; - __u16 metadata_len; - __aligned_u64 mask; - __s32 fd; - __s32 pid; -}; - -struct fanotify_response { - __s32 fd; - __u32 response; -}; - -/* Legit userspace responses to a _PERM event */ -#define FAN_ALLOW 0x01 -#define FAN_DENY 0x02 -/* No fd set in event */ -#define FAN_NOFD -1 - -/* Helper functions to deal with fanotify_event_metadata buffers */ -#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata)) - -#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \ - (struct fanotify_event_metadata*)(((char *)(meta)) + \ - (meta)->event_len)) - -#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \ - (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \ - (long)(meta)->event_len <= (long)(len)) - -#endif /* _LINUX_FANOTIFY_H */ diff --git a/linux/getregs_old.h b/linux/getregs_old.h new file mode 100644 index 00000000..fd2c3a3d --- /dev/null +++ b/linux/getregs_old.h @@ -0,0 +1 @@ +#undef HAVE_GETREGS_OLD diff --git a/linux/hppa/arch_regs.c b/linux/hppa/arch_regs.c new file mode 100644 index 00000000..7113bdb6 --- /dev/null +++ b/linux/hppa/arch_regs.c @@ -0,0 +1,2 @@ +static unsigned long hppa_r28; +#define ARCH_PC_PEEK_ADDR PT_IAOQ0 diff --git a/linux/hppa/arch_regs.h b/linux/hppa/arch_regs.h new file mode 100644 index 00000000..d42fc149 --- /dev/null +++ b/linux/hppa/arch_regs.h @@ -0,0 +1,5 @@ +#define PT_GR20 (20*4) +#define PT_GR26 (26*4) +#define PT_GR28 (28*4) +#define PT_IAOQ0 (106*4) +#define PT_IAOQ1 (107*4) diff --git a/linux/hppa/errnoent.h b/linux/hppa/errnoent.h index 2c926333..896980be 100644 --- a/linux/hppa/errnoent.h +++ b/linux/hppa/errnoent.h @@ -1,254 +1,151 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EAGAIN", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "ENOMSG", /* 35 */ - "EIDRM", /* 36 */ - "ECHRNG", /* 37 */ - "EL2NSYNC", /* 38 */ - "EL3HLT", /* 39 */ - "EL3RST", /* 40 */ - "ELNRNG", /* 41 */ - "EUNATCH", /* 42 */ - "ENOCSI", /* 43 */ - "EL2HLT", /* 44 */ - "EDEADLK", /* 45 */ - "ENOLCK", /* 46 */ - "EILSEQ", /* 47 */ - "ERRNO_48", /* 48 */ - "ERRNO_49", /* 49 */ - "ENONET", /* 50 */ - "ENODATA", /* 51 */ - "ETIME", /* 52 */ - "ENOSR", /* 53 */ - "ENOSTR", /* 54 */ - "ENOPKG", /* 55 */ - "ERRNO_56", /* 56 */ - "ENOLINK", /* 57 */ - "EADV", /* 58 */ - "ESRMNT", /* 59 */ - "ECOMM", /* 60 */ - "EPROTO", /* 61 */ - "ERRNO_62", /* 62 */ - "ERRNO_63", /* 63 */ - "EMULTIHOP", /* 64 */ - "ERRNO_65", /* 65 */ - "EDOTDOT", /* 66 */ - "EBADMSG", /* 67 */ - "EUSERS", /* 68 */ - "EDQUOT", /* 69 */ - "ESTALE", /* 70 */ - "EREMOTE", /* 71 */ - "EOVERFLOW", /* 72 */ - "ERRNO_73", /* 73 */ - "ERRNO_74", /* 74 */ - "ERRNO_75", /* 75 */ - "ERRNO_76", /* 76 */ - "ERRNO_77", /* 77 */ - "ERRNO_78", /* 78 */ - "ERRNO_79", /* 79 */ - "ERRNO_80", /* 80 */ - "ERRNO_81", /* 81 */ - "ERRNO_82", /* 82 */ - "ERRNO_83", /* 83 */ - "ERRNO_84", /* 84 */ - "ERRNO_85", /* 85 */ - "ERRNO_86", /* 86 */ - "ERRNO_87", /* 87 */ - "ERRNO_88", /* 88 */ - "ERRNO_89", /* 89 */ - "ERRNO_90", /* 90 */ - "ERRNO_91", /* 91 */ - "ERRNO_92", /* 92 */ - "ERRNO_93", /* 93 */ - "ERRNO_94", /* 94 */ - "ERRNO_95", /* 95 */ - "ERRNO_96", /* 96 */ - "ERRNO_97", /* 97 */ - "ERRNO_98", /* 98 */ - "ERRNO_99", /* 99 */ - "ERRNO_100", /* 100 */ - "ERRNO_101", /* 101 */ - "ERRNO_102", /* 102 */ - "ERRNO_103", /* 103 */ - "ERRNO_104", /* 104 */ - "ERRNO_105", /* 105 */ - "ERRNO_106", /* 106 */ - "ERRNO_107", /* 107 */ - "ERRNO_108", /* 108 */ - "ERRNO_109", /* 109 */ - "ERRNO_110", /* 110 */ - "ERRNO_111", /* 111 */ - "ERRNO_112", /* 112 */ - "ERRNO_113", /* 113 */ - "ERRNO_114", /* 114 */ - "ERRNO_115", /* 115 */ - "ERRNO_116", /* 116 */ - "ERRNO_117", /* 117 */ - "ERRNO_118", /* 118 */ - "ERRNO_119", /* 119 */ - "ERRNO_120", /* 120 */ - "ERRNO_121", /* 121 */ - "ERRNO_122", /* 122 */ - "ERRNO_123", /* 123 */ - "ERRNO_124", /* 124 */ - "ERRNO_125", /* 125 */ - "ERRNO_126", /* 126 */ - "ERRNO_127", /* 127 */ - "ERRNO_128", /* 128 */ - "ERRNO_129", /* 129 */ - "ERRNO_130", /* 130 */ - "ERRNO_131", /* 131 */ - "ERRNO_132", /* 132 */ - "ERRNO_133", /* 133 */ - "ERRNO_134", /* 134 */ - "ERRNO_135", /* 135 */ - "ERRNO_136", /* 136 */ - "ERRNO_137", /* 137 */ - "ERRNO_138", /* 138 */ - "ERRNO_139", /* 139 */ - "ERRNO_140", /* 140 */ - "ERRNO_141", /* 141 */ - "ERRNO_142", /* 142 */ - "ERRNO_143", /* 143 */ - "ERRNO_144", /* 144 */ - "ERRNO_145", /* 145 */ - "ERRNO_146", /* 146 */ - "ERRNO_147", /* 147 */ - "ERRNO_148", /* 148 */ - "ERRNO_149", /* 149 */ - "ERRNO_150", /* 150 */ - "ERRNO_151", /* 151 */ - "ERRNO_152", /* 152 */ - "ERRNO_153", /* 153 */ - "ERRNO_154", /* 154 */ - "ERRNO_155", /* 155 */ - "ERRNO_156", /* 156 */ - "ERRNO_157", /* 157 */ - "ERRNO_158", /* 158 */ - "ERRNO_159", /* 159 */ - "EBADE", /* 160 */ - "EBADR", /* 161 */ - "EXFULL", /* 162 */ - "ENOANO", /* 163 */ - "EBADRQC", /* 164 */ - "EBADSLT", /* 165 */ - "EBFONT", /* 166 */ - "ENOTUNIQ", /* 167 */ - "EBADFD", /* 168 */ - "EREMCHG", /* 169 */ - "ELIBACC", /* 170 */ - "ELIBBAD", /* 171 */ - "ELIBSCN", /* 172 */ - "ELIBMAX", /* 173 */ - "ELIBEXEC", /* 174 */ - "ERESTART", /* 175 */ - "ESTRPIPE", /* 176 */ - "EUCLEAN", /* 177 */ - "ENOTNAM", /* 178 */ - "ENAVAIL", /* 179 */ - "EISNAM", /* 180 */ - "EREMOTEIO", /* 181 */ - "ENOMEDIUM", /* 182 */ - "EMEDIUMTYPE", /* 183 */ - "ERRNO_184", /* 184 */ - "ERRNO_185", /* 185 */ - "ERRNO_186", /* 186 */ - "ERRNO_187", /* 187 */ - "ERRNO_188", /* 188 */ - "ERRNO_189", /* 189 */ - "ERRNO_190", /* 190 */ - "ERRNO_191", /* 191 */ - "ERRNO_192", /* 192 */ - "ERRNO_193", /* 193 */ - "ERRNO_194", /* 194 */ - "ERRNO_195", /* 195 */ - "ERRNO_196", /* 196 */ - "ERRNO_197", /* 197 */ - "ERRNO_198", /* 198 */ - "ERRNO_199", /* 199 */ - "ERRNO_200", /* 200 */ - "ERRNO_201", /* 201 */ - "ERRNO_202", /* 202 */ - "ERRNO_203", /* 203 */ - "ERRNO_204", /* 204 */ - "ERRNO_205", /* 205 */ - "ERRNO_206", /* 206 */ - "ERRNO_207", /* 207 */ - "ERRNO_208", /* 208 */ - "ERRNO_209", /* 209 */ - "ERRNO_210", /* 210 */ - "ERRNO_211", /* 211 */ - "ERRNO_212", /* 212 */ - "ERRNO_213", /* 213 */ - "ERRNO_214", /* 214 */ - "ENOSYM", /* 215 */ - "ENOTSOCK", /* 216 */ - "EDESTADDRREQ", /* 217 */ - "EMSGSIZE", /* 218 */ - "EPROTOTYPE", /* 219 */ - "ENOPROTOOPT", /* 220 */ - "EPROTONOSUPPORT", /* 221 */ - "ESOCKTNOSUPPORT", /* 222 */ - "EOPNOTSUPP", /* 223 */ - "EPFNOSUPPORT", /* 224 */ - "EAFNOSUPPORT", /* 225 */ - "EADDRINUSE", /* 226 */ - "EADDRNOTAVAIL", /* 227 */ - "ENETDOWN", /* 228 */ - "ENETUNREACH", /* 229 */ - "ENETRESET", /* 230 */ - "ECONNABORTED", /* 231 */ - "ECONNRESET", /* 232 */ - "ENOBUFS", /* 233 */ - "EISCONN", /* 234 */ - "ENOTCONN", /* 235 */ - "ESHUTDOWN", /* 236 */ - "ETOOMANYREFS", /* 237 */ - "ETIMEDOUT", /* 238 */ - "ECONNREFUSED", /* 239 */ - "EREMOTERELEASE", /* 240 */ - "EHOSTDOWN", /* 241 */ - "EHOSTUNREACH", /* 242 */ - "ERRNO_243", /* 243 */ - "EALREADY", /* 244 */ - "EINPROGRESS", /* 245 */ - "EWOULDBLOCK", /* 246 */ - "ENOTEMPTY", /* 247 */ - "ENAMETOOLONG", /* 248 */ - "ELOOP", /* 249 */ - "ERRNO_250", /* 250 */ - "ENOSYS", /* 251 */ - "ENOTSUP", /* 252 */ - "ECANCELLED", /* 253 */ +[ 1] = "EPERM", +[ 2] = "ENOENT", +[ 3] = "ESRCH", +[ 4] = "EINTR", +[ 5] = "EIO", +[ 6] = "ENXIO", +[ 7] = "E2BIG", +[ 8] = "ENOEXEC", +[ 9] = "EBADF", +[ 10] = "ECHILD", +[ 11] = "EAGAIN", +[ 12] = "ENOMEM", +[ 13] = "EACCES", +[ 14] = "EFAULT", +[ 15] = "ENOTBLK", +[ 16] = "EBUSY", +[ 17] = "EEXIST", +[ 18] = "EXDEV", +[ 19] = "ENODEV", +[ 20] = "ENOTDIR", +[ 21] = "EISDIR", +[ 22] = "EINVAL", +[ 23] = "ENFILE", +[ 24] = "EMFILE", +[ 25] = "ENOTTY", +[ 26] = "ETXTBSY", +[ 27] = "EFBIG", +[ 28] = "ENOSPC", +[ 29] = "ESPIPE", +[ 30] = "EROFS", +[ 31] = "EMLINK", +[ 32] = "EPIPE", +[ 33] = "EDOM", +[ 34] = "ERANGE", +[ 35] = "ENOMSG", +[ 36] = "EIDRM", +[ 37] = "ECHRNG", +[ 38] = "EL2NSYNC", +[ 39] = "EL3HLT", +[ 40] = "EL3RST", +[ 41] = "ELNRNG", +[ 42] = "EUNATCH", +[ 43] = "ENOCSI", +[ 44] = "EL2HLT", +[ 45] = "EDEADLK", +[ 46] = "ENOLCK", +[ 47] = "EILSEQ", +[ 50] = "ENONET", +[ 51] = "ENODATA", +[ 52] = "ETIME", +[ 53] = "ENOSR", +[ 54] = "ENOSTR", +[ 55] = "ENOPKG", +[ 57] = "ENOLINK", +[ 58] = "EADV", +[ 59] = "ESRMNT", +[ 60] = "ECOMM", +[ 61] = "EPROTO", +[ 64] = "EMULTIHOP", +[ 66] = "EDOTDOT", +[ 67] = "EBADMSG", +[ 68] = "EUSERS", +[ 69] = "EDQUOT", +[ 70] = "ESTALE", +[ 71] = "EREMOTE", +[ 72] = "EOVERFLOW", +[160] = "EBADE", +[161] = "EBADR", +[162] = "EXFULL", +[163] = "ENOANO", +[164] = "EBADRQC", +[165] = "EBADSLT", +[166] = "EBFONT", +[167] = "ENOTUNIQ", +[168] = "EBADFD", +[169] = "EREMCHG", +[170] = "ELIBACC", +[171] = "ELIBBAD", +[172] = "ELIBSCN", +[173] = "ELIBMAX", +[174] = "ELIBEXEC", +[175] = "ERESTART", +[176] = "ESTRPIPE", +[177] = "EUCLEAN", +[178] = "ENOTNAM", +[179] = "ENAVAIL", +[180] = "EISNAM", +[181] = "EREMOTEIO", +[182] = "ENOMEDIUM", +[183] = "EMEDIUMTYPE", +[184] = "ENOKEY", +[185] = "EKEYEXPIRED", +[186] = "EKEYREVOKED", +[187] = "EKEYREJECTED", +[215] = "ENOSYM", +[216] = "ENOTSOCK", +[217] = "EDESTADDRREQ", +[218] = "EMSGSIZE", +[219] = "EPROTOTYPE", +[220] = "ENOPROTOOPT", +[221] = "EPROTONOSUPPORT", +[222] = "ESOCKTNOSUPPORT", +[223] = "EOPNOTSUPP", +[224] = "EPFNOSUPPORT", +[225] = "EAFNOSUPPORT", +[226] = "EADDRINUSE", +[227] = "EADDRNOTAVAIL", +[228] = "ENETDOWN", +[229] = "ENETUNREACH", +[230] = "ENETRESET", +[231] = "ECONNABORTED", +[232] = "ECONNRESET", +[233] = "ENOBUFS", +[234] = "EISCONN", +[235] = "ENOTCONN", +[236] = "ESHUTDOWN", +[237] = "ETOOMANYREFS", +[238] = "ETIMEDOUT", +[239] = "ECONNREFUSED", +[240] = "EREMOTERELEASE", +[241] = "EHOSTDOWN", +[242] = "EHOSTUNREACH", +[244] = "EALREADY", +[245] = "EINPROGRESS", +[246] = "EWOULDBLOCK", +[247] = "ENOTEMPTY", +[248] = "ENAMETOOLONG", +[249] = "ELOOP", +[251] = "ENOSYS", +[252] = "ENOTSUP", +[253] = "ECANCELED", +[254] = "EOWNERDEAD", +[255] = "ENOTRECOVERABLE", +[256] = "ERFKILL", +[257] = "EHWPOISON", +[512] = "ERESTARTSYS", +[513] = "ERESTARTNOINTR", +[514] = "ERESTARTNOHAND", +[515] = "ENOIOCTLCMD", +[516] = "ERESTART_RESTARTBLOCK", +[517] = "EPROBE_DEFER", +[518] = "EOPENSTALE", +[521] = "EBADHANDLE", +[522] = "ENOTSYNC", +[523] = "EBADCOOKIE", +[524] = "ENOTSUPP", +[525] = "ETOOSMALL", +[526] = "ESERVERFAULT", +[527] = "EBADTYPE", +[528] = "EJUKEBOX", +[529] = "EIOCBQUEUED", diff --git a/linux/hppa/get_error.c b/linux/hppa/get_error.c new file mode 100644 index 00000000..a2a7c0ea --- /dev/null +++ b/linux/hppa/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(hppa_r28)) { + tcp->u_rval = -1; + tcp->u_error = -hppa_r28; + } else { + tcp->u_rval = hppa_r28; + } +} diff --git a/linux/hppa/get_scno.c b/linux/hppa/get_scno.c new file mode 100644 index 00000000..7da2fc40 --- /dev/null +++ b/linux/hppa/get_scno.c @@ -0,0 +1,6 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + return upeek(tcp->pid, PT_GR20, &tcp->scno) < 0 ? -1 : 1; +} diff --git a/linux/hppa/get_syscall_args.c b/linux/hppa/get_syscall_args.c new file mode 100644 index 00000000..2258ea87 --- /dev/null +++ b/linux/hppa/get_syscall_args.c @@ -0,0 +1,11 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, PT_GR26-4*i, &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/hppa/get_syscall_result.c b/linux/hppa/get_syscall_result.c new file mode 100644 index 00000000..0d15d4db --- /dev/null +++ b/linux/hppa/get_syscall_result.c @@ -0,0 +1,5 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + return upeek(tcp->pid, PT_GR28, &hppa_r28) < 0 ? -1 : 0; +} diff --git a/linux/hppa/ioctlent.h.in b/linux/hppa/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/hppa/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/hppa/ioctls_arch0.h b/linux/hppa/ioctls_arch0.h new file mode 100644 index 00000000..ba939719 --- /dev/null +++ b/linux/hppa/ioctls_arch0.h @@ -0,0 +1,101 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/parisc/include/ tree. */ +{ "asm/grfioctl.h", "GCAOFF", _IOC_NONE, 0x4704, 0x00 }, +{ "asm/grfioctl.h", "GCAON", _IOC_NONE, 0x4703, 0x00 }, +{ "asm/grfioctl.h", "GCDESCRIBE", _IOC_READ, 0x4715, 0x70 }, +{ "asm/grfioctl.h", "GCFASTLOCK", _IOC_NONE, 0x471a, 0x00 }, +{ "asm/grfioctl.h", "GCID", _IOC_READ, 0x4700, 0x04 }, +{ "asm/grfioctl.h", "GCLOCK", _IOC_NONE, 0x4707, 0x00 }, +{ "asm/grfioctl.h", "GCLOCK_MINIMUM", _IOC_NONE, 0x4709, 0x00 }, +{ "asm/grfioctl.h", "GCMAP", _IOC_READ|_IOC_WRITE, 0x4705, 0x04 }, +{ "asm/grfioctl.h", "GCMAP_HPUX", _IOC_NONE, 0x4705, 0x00 }, +{ "asm/grfioctl.h", "GCOFF", _IOC_NONE, 0x4702, 0x00 }, +{ "asm/grfioctl.h", "GCON", _IOC_NONE, 0x4701, 0x00 }, +{ "asm/grfioctl.h", "GCSTATIC_CMAP", _IOC_NONE, 0x470b, 0x00 }, +{ "asm/grfioctl.h", "GCTERM", _IOC_READ|_IOC_WRITE, 0x4714, 0x04 }, +{ "asm/grfioctl.h", "GCUNLOCK", _IOC_NONE, 0x4708, 0x00 }, +{ "asm/grfioctl.h", "GCUNLOCK_MINIMUM", _IOC_NONE, 0x470a, 0x00 }, +{ "asm/grfioctl.h", "GCUNMAP", _IOC_READ|_IOC_WRITE, 0x4706, 0x04 }, +{ "asm/grfioctl.h", "GCUNMAP_HPUX", _IOC_NONE, 0x4706, 0x00 }, +{ "asm/grfioctl.h", "GCVARIABLE_CMAP", _IOC_NONE, 0x470c, 0x00 }, +{ "asm/ioctls.h", "FIOASYNC", 0, 0x5452, 0 }, +{ "asm/ioctls.h", "FIOCLEX", 0, 0x5451, 0 }, +{ "asm/ioctls.h", "FIONBIO", 0, 0x5421, 0 }, +{ "asm/ioctls.h", "FIONCLEX", 0, 0x5450, 0 }, +{ "asm/ioctls.h", "FIONREAD", 0, 0x541B, 0 }, +{ "asm/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x5407, 0x00 }, +{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x5401, 0x12 }, +{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x5410, 0x24 }, +{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x5405, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x5402, 0x12 }, +{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x5404, 0x12 }, +{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x5403, 0x12 }, +{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x5411, 0x24 }, +{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x5413, 0x24 }, +{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x5412, 0x24 }, +{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x5406, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x541e, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, +{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5414, 0x04 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 }, +{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 }, +{ "asm/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSLTC", 0, 0x5462, 0 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x541d, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 }, +{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm/ioctls.h", "TIOCSTART", 0, 0x5461, 0 }, +{ "asm/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm/ioctls.h", "TIOCSTOP", 0, 0x5462, 0 }, +{ "asm/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 }, +{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm/perf.h", "PA_PERF_OFF", _IOC_READ, 0x7002, 0x04 }, +{ "asm/perf.h", "PA_PERF_ON", _IOC_NONE, 0x7001, 0x00 }, +{ "asm/perf.h", "PA_PERF_VERSION", _IOC_READ, 0x7003, 0x04 }, +{ "asm/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, diff --git a/linux/hppa/ioctls_inc0.h b/linux/hppa/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/hppa/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/hppa/set_error.c b/linux/hppa/set_error.c new file mode 100644 index 00000000..92a7979f --- /dev/null +++ b/linux/hppa/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + hppa_r28 = -tcp->u_error; + return upoke(tcp->pid, PT_GR28, hppa_r28); +} + +static int +arch_set_success(struct tcb *tcp) +{ + hppa_r28 = tcp->u_rval; + return upoke(tcp->pid, PT_GR28, hppa_r28); +} diff --git a/linux/hppa/set_scno.c b/linux/hppa/set_scno.c new file mode 100644 index 00000000..d4d873be --- /dev/null +++ b/linux/hppa/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, PT_GR20, scno); +} diff --git a/linux/hppa/signalent.h b/linux/hppa/signalent.h index 92e5565e..6d699876 100644 --- a/linux/hppa/signalent.h +++ b/linux/hppa/signalent.h @@ -5,12 +5,12 @@ "SIGILL", /* 4 */ "SIGTRAP", /* 5 */ "SIGABRT", /* 6 */ - "SIGEMT", /* 7 */ + "SIGSTKFLT", /* 7 */ "SIGFPE", /* 8 */ "SIGKILL", /* 9 */ "SIGBUS", /* 10 */ "SIGSEGV", /* 11 */ - "SIGSYS", /* 12 */ + "SIGXCPU", /* 12 */ "SIGPIPE", /* 13 */ "SIGALRM", /* 14 */ "SIGTERM", /* 15 */ @@ -28,11 +28,6 @@ "SIGTTIN", /* 27 */ "SIGTTOU", /* 28 */ "SIGURG", /* 29 */ - "SIGLOST", /* 30 */ - "SIGUNUSED", /* 31 */ - "SIG_32", /* 32 */ - "SIGXCPU", /* 33 */ - "SIGXFSZ", /* 34 */ - "SIG_35", /* 35 */ - "SIGSTKFLT", /* 36 */ - "SIGRTMIN", /* 37 */ + "SIGXFSZ", /* 30 */ + "SIGSYS", /* 31 */ + "SIGRTMIN", /* 32 */ diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h index 0a58c5d5..97e2a327 100644 --- a/linux/hppa/syscallent.h +++ b/linux/hppa/syscallent.h @@ -2,341 +2,352 @@ * Copyright (c) 2001 Hewlett-Packard, Matthew Wilcox */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */ - { 1, TP|SE, sys_exit, "exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 3, TN, sys_socket, "socket" }, /* 17 */ - { 2, TF, sys_stat, "newstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 3, TN, sys_bind, "bind" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_fstat, "newfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 3, TN, sys_connect, "connect" }, /* 31 */ - { 2, TN, sys_listen, "listen" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 3, TN, sys_accept, "accept" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 2, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount2" }, /* 52 */ - { 3, TN, sys_getpeername, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 4, TN, sys_send, "send" }, /* 58 */ - { 1, 0, sys_uname, "newuname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TM, sys_mincore, "mincore" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 6, TN, sys_sendto, "sendto" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_lstat, "newlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" }, /* 89 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, TN, sys_recv, "recv" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 2, TF, sys_stat64, "stat64" }, /* 101 */ - { 5, 0, NULL, NULL }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, 0, sys_capget, "capget" }, /* 106 */ - { 2, 0, sys_capset, "capset" }, /* 107 */ - { 5, TD, sys_pread, "pread" }, /* 108 */ - { 5, TD, sys_pwrite, "pwrite" }, /* 109 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 112 */ - { 0, TP, sys_vfork, "vfork" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 3, TM, sys_madvise, "madvise" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 122 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 4, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms" }, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 5, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "_newselect" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 1, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 2, 0, sys_sched_setparam, "sched_setparam" }, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 156 */ - { 2, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_setresuid, "getresuid" }, /* 165 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_setresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 3, TF, sys_chown, "chown" }, /* 180 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 181 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 182 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 183 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 184 */ - { 4, TI, sys_semop, "semop" }, /* 185 */ - { 4, TI, sys_semget, "semget" }, /* 186 */ - { 4, TI, sys_semctl, "semctl" }, /* 187 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 188 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 189 */ - { 4, TI, sys_msgget, "msgget" }, /* 190 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 191 */ - { 3, TI|TM|SI, sys_shmat, "shmat" }, /* 192 */ - { 1, TI|TM|SI, sys_shmdt, "shmdt" }, /* 193 */ - { 3, TI, sys_shmget, "shmget" }, /* 194 */ - { 3, TI, sys_shmctl, "shmctl" }, /* 195 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 196 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 197 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 198 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 199 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 200 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 201 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 202 */ - { 5, 0, printargs, "attrctl" }, /* 203 */ - { 5, 0, printargs, "acl_get" }, /* 204 */ - { 5, 0, printargs, "acl_set" }, /* 205 */ - { 0, 0, sys_gettid, "gettid" }, /* 206 */ - { 4, TD, sys_readahead, "readahead" }, /* 207 */ - { 2, TS, sys_kill, "tkill" }, /* 208 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 209 */ - { 6, 0, sys_futex, "futex" }, /* 210 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 211 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 212 */ - { 5, 0, printargs, "set_thread_area" }, /* 213 */ - { 5, 0, printargs, "get_thread_area" }, /* 214 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 215 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 216 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 217 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 218 */ - { 4, 0, sys_io_cancel, "io_cancel" }, /* 219 */ - { 5, 0, printargs, "alloc_hugepages" }, /* 220 */ - { 1, 0, printargs, "free_hugepages" }, /* 221 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 222 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 223 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 224 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 225 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 226 */ - { 5, TM|SI, printargs, "remap_file_pages" }, /* 227 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 228 */ - { 5, 0, printargs, "mq_open" }, /* 229 */ - { 5, 0, printargs, "mq_unlink" }, /* 230 */ - { 5, 0, printargs, "mq_timedsend" }, /* 231 */ - { 5, 0, printargs, "mq_timedreceive" }, /* 232 */ - { 5, 0, printargs, "mq_notify" }, /* 233 */ - { 5, 0, printargs, "mq_getsetattr" }, /* 234 */ - { 5, TP, sys_waitid, "waitid" }, /* 235 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 236 */ - { 5, 0, sys_set_tid_address, "set_tid_address" }, /* 237 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 238 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 239 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 240 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 241 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 242 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 243 */ - { 5, TF, sys_listxattr, "listxattr" }, /* 244 */ - { 5, TF, sys_listxattr, "llistxattr" }, /* 245 */ - { 5, TD, sys_flistxattr, "flistxattr" }, /* 246 */ - { 5, TF, sys_removexattr, "removexattr" }, /* 247 */ - { 5, TF, sys_removexattr, "lremovexattr" }, /* 248 */ - { 5, TD, sys_fremovexattr, "fremovexattr" }, /* 249 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 250 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 251 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 252 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 253 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 254 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 255 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 256 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 257 */ - { 5, 0, printargs, "clock_nanosleep" }, /* 258 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 259 */ - { 5, TM, printargs, "mbind" }, /* 260 */ - { 5, TM, printargs, "get_mempolicy" }, /* 261 */ - { 5, TM, printargs, "set_mempolicy" }, /* 262 */ - { 5, 0, sys_vserver, "vserver" }, /* 263 */ - { 5, 0, sys_add_key, "add_key" }, /* 264 */ - { 4, 0, sys_request_key, "request_key" }, /* 265 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 266 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 267 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 268 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 269 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 270 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 271 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 272 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 273 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 274 */ - { 4, TD|TF, sys_openat, "openat" }, /* 275 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 276 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 277 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 278 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 279 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 280 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 281 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 282 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 283 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 284 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 285 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 286 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 287 */ - { 1, TP, sys_unshare, "unshare" }, /* 288 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 289 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 290 */ - { 6, TD, sys_splice, "splice" }, /* 291 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 292 */ - { 4, TD, sys_tee, "tee" }, /* 293 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 294 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 295 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 296 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 297 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 298 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 299 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 300 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 301 */ - { 3, TD, printargs, "signalfd" }, /* 302 */ - { 4, TD, printargs, "timerfd" }, /* 303 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 304 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 305 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 306 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 307 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 308 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 309 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 310 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 311 */ - { 3, TD, sys_dup3, "dup3" }, /* 312 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 313 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 314 */ - { 5, TD, sys_preadv, "preadv" }, /* 315 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 316 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 317 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 318 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 319 */ - { 4, TN, sys_accept4, "accept4" }, /* 320 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 321 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 322 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 323 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 324 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 325 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 326 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 327 */ - { 2, TD, sys_setns, "setns" }, /* 328 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 329 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 330 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 331 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 332 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 333 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 334 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 335 */ - { 2, TF, sys_utimes, "utimes" }, /* 336 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 337 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown), "lchown" }, +[ 17] = { 3, TN, SEN(socket), "socket" }, +[ 18] = { 2, TF, SEN(stat), "stat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 3, TN, SEN(bind), "bind" }, +[ 23] = { 1, 0, SEN(setuid), "setuid" }, +[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(fstat), "fstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 3, TN, SEN(connect), "connect" }, +[ 32] = { 2, TN, SEN(listen), "listen" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 3, TN, SEN(accept), "accept" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 3, TN, SEN(getsockname), "getsockname" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid), "setgid" }, +[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 3, TN, SEN(getpeername), "getpeername" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 4, TN, SEN(socketpair), "socketpair" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 4, TN, SEN(send), "send" }, +[ 59] = { 1, 0, SEN(uname), "uname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid), "setregid" }, +[ 72] = { 3, TM, SEN(mincore), "mincore" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups), "setgroups" }, +[ 82] = { 6, TN, SEN(sendto), "sendto" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(lstat), "lstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, TN, SEN(recv), "recv" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 2, TF, SEN(stat64), "stat64" }, +[102] = { }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, 0, SEN(capget), "capget" }, +[107] = { 2, 0, SEN(capset), "capset" }, +[108] = { 5, TD, SEN(pread), "pread64" }, +[109] = { 5, TD, SEN(pwrite), "pwrite64" }, +[110] = { 2, TF, SEN(getcwd), "getcwd" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 2, TD, SEN(fstat64), "fstat64" }, +[113] = { 0, TP, SEN(vfork), "vfork" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 2, TN, SEN(shutdown), "shutdown" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 3, TM, SEN(madvise), "madvise" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[123] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid), "setresuid" }, +[165] = { 3, 0, SEN(getresuid), "getresuid" }, +[166] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid), "setresgid" }, +[171] = { 3, 0, SEN(getresgid), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 3, TF, SEN(chown), "chown" }, +[181] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[182] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[183] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[184] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[185] = { 3, TI, SEN(semop), "semop" }, +[186] = { 3, TI, SEN(semget), "semget" }, +[187] = { 4, TI, SEN(semctl), "semctl" }, +[188] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[189] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[190] = { 2, TI, SEN(msgget), "msgget" }, +[191] = { 3, TI, SEN(msgctl), "msgctl" }, +[192] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[193] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[194] = { 3, TI, SEN(shmget), "shmget" }, +[195] = { 3, TI, SEN(shmctl), "shmctl" }, +[196] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[197] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[198] = { 2, TF, SEN(lstat64), "lstat64" }, +[199] = { 3, TF, SEN(truncate64), "truncate64" }, +[200] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[201] = { 3, TD, SEN(getdents64), "getdents64" }, +[202] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[203] = { 5, 0, SEN(printargs), "attrctl" }, +[204] = { 5, 0, SEN(printargs), "acl_get" }, +[205] = { 5, 0, SEN(printargs), "acl_set" }, +[206] = { 0, NF, SEN(gettid), "gettid" }, +[207] = { 4, TD, SEN(readahead), "readahead" }, +[208] = { 2, TS, SEN(kill), "tkill" }, +[209] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[210] = { 6, 0, SEN(futex), "futex" }, +[211] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[212] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[213] = { 5, 0, SEN(printargs), "set_thread_area" }, +[214] = { 5, 0, SEN(printargs), "get_thread_area" }, +[215] = { 2, TM, SEN(io_setup), "io_setup" }, +[216] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[217] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[218] = { 3, 0, SEN(io_submit), "io_submit" }, +[219] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[220] = { 5, 0, SEN(printargs), "alloc_hugepages" }, +[221] = { 1, 0, SEN(printargs), "free_hugepages" }, +[222] = { 1, TP|SE, SEN(exit), "exit_group" }, +[223] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[224] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[225] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[226] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[227] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[228] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[229] = { 4, 0, SEN(mq_open), "mq_open" }, +[230] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[231] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[232] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[233] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[234] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[235] = { 5, TP, SEN(waitid), "waitid" }, +[236] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[237] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[238] = { 5, TF, SEN(setxattr), "setxattr" }, +[239] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[240] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[241] = { 4, TF, SEN(getxattr), "getxattr" }, +[242] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[243] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[244] = { 3, TF, SEN(listxattr), "listxattr" }, +[245] = { 3, TF, SEN(listxattr), "llistxattr" }, +[246] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[247] = { 2, TF, SEN(removexattr), "removexattr" }, +[248] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[249] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[250] = { 3, 0, SEN(timer_create), "timer_create" }, +[251] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[252] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[253] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[254] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[255] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[256] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[257] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[258] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[259] = { 3, TS, SEN(tgkill), "tgkill" }, +[260] = { 6, TM, SEN(mbind), "mbind" }, +[261] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[262] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[263] = { 5, 0, SEN(vserver), "vserver" }, +[264] = { 5, 0, SEN(add_key), "add_key" }, +[265] = { 4, 0, SEN(request_key), "request_key" }, +[266] = { 5, 0, SEN(keyctl), "keyctl" }, +[267] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[268] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[269] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[270] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[271] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[272] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[273] = { 6, TD, SEN(pselect6), "pselect6" }, +[274] = { 5, TD, SEN(ppoll), "ppoll" }, +[275] = { 4, TD|TF, SEN(openat), "openat" }, +[276] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[277] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[278] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[279] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[280] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[281] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[282] = { 4, TD|TF, SEN(renameat), "renameat" }, +[283] = { 5, TD|TF, SEN(linkat), "linkat" }, +[284] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[285] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[286] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[287] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[288] = { 1, TP, SEN(unshare), "unshare" }, +[289] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[290] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[291] = { 6, TD, SEN(splice), "splice" }, +[292] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[293] = { 4, TD, SEN(tee), "tee" }, +[294] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[295] = { 6, TM, SEN(move_pages), "move_pages" }, +[296] = { 3, 0, SEN(getcpu), "getcpu" }, +[297] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[298] = { 3, TF, SEN(statfs64), "statfs64" }, +[299] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[300] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[301] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[302] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[303] = { 4, TD, SEN(timerfd), "timerfd" }, +[304] = { 1, TD, SEN(eventfd), "eventfd" }, +[305] = { 6, TD, SEN(fallocate), "fallocate" }, +[306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[307] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[308] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[309] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[310] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[311] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[312] = { 3, TD, SEN(dup3), "dup3" }, +[313] = { 2, TD, SEN(pipe2), "pipe2" }, +[314] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[315] = { 5, TD, SEN(preadv), "preadv" }, +[316] = { 5, TD, SEN(pwritev), "pwritev" }, +[317] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[318] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[319] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[320] = { 4, TN, SEN(accept4), "accept4" }, +[321] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[322] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[323] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[324] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[325] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[326] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[327] = { 1, TD, SEN(syncfs), "syncfs" }, +[328] = { 2, TD, SEN(setns), "setns" }, +[329] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[330] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[331] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[332] = { 5, 0, SEN(kcmp), "kcmp" }, +[333] = { 3, TD, SEN(finit_module), "finit_module" }, +[334] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[335] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[336] = { 2, TF, SEN(utimes), "utimes" }, +[337] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[338] = { 3, 0, SEN(seccomp), "seccomp" }, +[339] = { 3, 0, SEN(getrandom), "getrandom" }, +[340] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[341] = { 3, TD, SEN(bpf), "bpf" }, +[342] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[343] = { 2, 0, SEN(membarrier), "membarrier" }, +[344] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[345] = { 3, TM, SEN(mlock2), "mlock2" }, +[346] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[347] = { 6, TD, SEN(preadv2), "preadv2" }, +[348] = { 6, TD, SEN(pwritev2), "pwritev2" }, diff --git a/linux/i386/arch_regs.c b/linux/i386/arch_regs.c new file mode 100644 index 00000000..0dcea1f0 --- /dev/null +++ b/linux/i386/arch_regs.c @@ -0,0 +1,5 @@ +static struct user_regs_struct i386_regs; +unsigned long *const i386_esp_ptr = (unsigned long *) &i386_regs.esp; + +#define ARCH_REGS_FOR_GETREGS i386_regs +#define ARCH_PC_REG i386_regs.eip diff --git a/linux/i386/arch_regs.h b/linux/i386/arch_regs.h new file mode 100644 index 00000000..6f622092 --- /dev/null +++ b/linux/i386/arch_regs.h @@ -0,0 +1 @@ +extern unsigned long *const i386_esp_ptr; diff --git a/linux/i386/arch_sigreturn.c b/linux/i386/arch_sigreturn.c new file mode 100644 index 00000000..9446994e --- /dev/null +++ b/linux/i386/arch_sigreturn.c @@ -0,0 +1,24 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + /* + * On i386, sigcontext is followed on stack by struct fpstate + * and after it an additional u32 extramask which holds + * upper half of the mask. + */ + struct { + uint32_t struct_sigcontext_padding1[20]; + uint32_t oldmask; + uint32_t struct_sigcontext_padding2; + uint32_t struct_fpstate_padding[156]; + uint32_t extramask; + } frame; + + if (umove(tcp, *i386_esp_ptr, &frame) < 0) { + tprintf("{mask=%#lx}", (unsigned long) *i386_esp_ptr); + } else { + uint32_t mask[2] = { frame.oldmask, frame.extramask }; + tprintsigmask_addr("{mask=", mask); + tprints("}"); + } +} diff --git a/linux/i386/get_error.c b/linux/i386/get_error.c new file mode 100644 index 00000000..1f63605e --- /dev/null +++ b/linux/i386/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(i386_regs.eax)) { + tcp->u_rval = -1; + tcp->u_error = -i386_regs.eax; + } else { + tcp->u_rval = i386_regs.eax; + } +} diff --git a/linux/i386/get_scno.c b/linux/i386/get_scno.c new file mode 100644 index 00000000..c2e55510 --- /dev/null +++ b/linux/i386/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = i386_regs.orig_eax; + return 1; +} diff --git a/linux/i386/get_syscall_args.c b/linux/i386/get_syscall_args.c new file mode 100644 index 00000000..d5de1d95 --- /dev/null +++ b/linux/i386/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = i386_regs.ebx; + tcp->u_arg[1] = i386_regs.ecx; + tcp->u_arg[2] = i386_regs.edx; + tcp->u_arg[3] = i386_regs.esi; + tcp->u_arg[4] = i386_regs.edi; + tcp->u_arg[5] = i386_regs.ebp; + return 1; +} diff --git a/linux/i386/ioctlent.h.in b/linux/i386/ioctlent.h.in deleted file mode 100644 index 449ad401..00000000 --- a/linux/i386/ioctlent.h.in +++ /dev/null @@ -1,15 +0,0 @@ - {"asm/mtrr.h", "MTRRIOC_ADD_ENTRY", 0x4d00}, - {"asm/mce.h", "MCE_GET_RECORD_LEN", 0x4d01}, - {"asm/mtrr.h", "MTRRIOC_SET_ENTRY", 0x4d01}, - {"asm/mce.h", "MCE_GET_LOG_LEN", 0x4d02}, - {"asm/mtrr.h", "MTRRIOC_DEL_ENTRY", 0x4d02}, - {"asm/mce.h", "MCE_GETCLEAR_FLAGS", 0x4d03}, - {"asm/mtrr.h", "MTRRIOC_GET_ENTRY", 0x4d03}, - {"asm/mtrr.h", "MTRRIOC_KILL_ENTRY", 0x4d04}, - {"asm/mtrr.h", "MTRRIOC_ADD_PAGE_ENTRY", 0x4d05}, - {"asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", 0x4d06}, - {"asm/mtrr.h", "MTRRIOC_DEL_PAGE_ENTRY", 0x4d07}, - {"asm/mtrr.h", "MTRRIOC_GET_PAGE_ENTRY", 0x4d08}, - {"asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", 0x4d09}, - {"asm/msr.h", "X86_IOC_RDMSR_REGS", 0x63a0}, - {"asm/msr.h", "X86_IOC_WRMSR_REGS", 0x63a1}, diff --git a/linux/i386/ioctls_arch0.h b/linux/i386/ioctls_arch0.h new file mode 100644 index 00000000..e5b81a9d --- /dev/null +++ b/linux/i386/ioctls_arch0.h @@ -0,0 +1,126 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/x86/include/ tree. */ +{ "asm/mce.h", "MCE_GETCLEAR_FLAGS", _IOC_READ, 0x4d03, 0x04 }, +{ "asm/mce.h", "MCE_GET_LOG_LEN", _IOC_READ, 0x4d02, 0x04 }, +{ "asm/mce.h", "MCE_GET_RECORD_LEN", _IOC_READ, 0x4d01, 0x04 }, +{ "asm/msr.h", "X86_IOC_RDMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a0, 0x20 }, +{ "asm/msr.h", "X86_IOC_WRMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a1, 0x20 }, +{ "asm/mtrr.h", "MTRRIOC_ADD_ENTRY", _IOC_WRITE, 0x4d00, 0x0c }, +{ "asm/mtrr.h", "MTRRIOC_ADD_PAGE_ENTRY", _IOC_WRITE, 0x4d05, 0x0c }, +{ "asm/mtrr.h", "MTRRIOC_DEL_ENTRY", _IOC_WRITE, 0x4d02, 0x0c }, +{ "asm/mtrr.h", "MTRRIOC_DEL_PAGE_ENTRY", _IOC_WRITE, 0x4d07, 0x0c }, +{ "asm/mtrr.h", "MTRRIOC_GET_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d03, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_GET_PAGE_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_KILL_ENTRY", _IOC_WRITE, 0x4d04, 0x0c }, +{ "asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", _IOC_WRITE, 0x4d09, 0x0c }, +{ "asm/mtrr.h", "MTRRIOC_SET_ENTRY", _IOC_WRITE, 0x4d01, 0x0c }, +{ "asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", _IOC_WRITE, 0x4d06, 0x0c }, +{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x0c }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_CPUID2", _IOC_READ|_IOC_WRITE, 0xae91, 0x08 }, +{ "linux/kvm.h", "KVM_GET_DEBUGREGS", _IOC_READ, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_EMULATED_CPUID", _IOC_READ|_IOC_WRITE, 0xae09, 0x08 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x1a0 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_LAPIC", _IOC_READ, 0xae8e, 0x400 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 }, +{ "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 }, +{ "linux/kvm.h", "KVM_GET_PIT2", _IOC_READ, 0xae9f, 0x70 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x90 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x138 }, +{ "linux/kvm.h", "KVM_GET_SUPPORTED_CPUID", _IOC_READ|_IOC_WRITE, 0xae05, 0x08 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_EVENTS", _IOC_READ, 0xae9f, 0x40 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_GET_XCRS", _IOC_READ, 0xaea6, 0x188 }, +{ "linux/kvm.h", "KVM_GET_XSAVE", _IOC_READ, 0xaea4, 0x1000 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, +{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, +{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, +{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, +{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, +{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, +{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, +{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, +{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, +{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 }, +{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, +{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, +{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_CPUID", _IOC_WRITE, 0xae8a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_CPUID2", _IOC_WRITE, 0xae90, 0x08 }, +{ "linux/kvm.h", "KVM_SET_DEBUGREGS", _IOC_WRITE, 0xaea2, 0x80 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x1a0 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x48 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_LAPIC", _IOC_WRITE, 0xae8f, 0x400 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_ALIAS", _IOC_WRITE, 0xae43, 0x20 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 }, +{ "linux/kvm.h", "KVM_SET_PIT2", _IOC_WRITE, 0xaea0, 0x70 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x90 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x138 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SET_VCPU_EVENTS", _IOC_WRITE, 0xaea0, 0x40 }, +{ "linux/kvm.h", "KVM_SET_XCRS", _IOC_WRITE, 0xaea7, 0x188 }, +{ "linux/kvm.h", "KVM_SET_XSAVE", _IOC_WRITE, 0xaea5, 0x1000 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, +{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SET_MCE", _IOC_WRITE, 0xae9e, 0x40 }, +{ "linux/kvm.h", "KVM_XEN_HVM_CONFIG", _IOC_WRITE, 0xae7a, 0x38 }, diff --git a/linux/i386/ioctls_inc0.h b/linux/i386/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/i386/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/i386/set_error.c b/linux/i386/set_error.c new file mode 100644 index 00000000..92b0a8d7 --- /dev/null +++ b/linux/i386/set_error.c @@ -0,0 +1,21 @@ +static int +arch_set_error(struct tcb *tcp) +{ + i386_regs.eax = -tcp->u_error; +#ifdef HAVE_GETREGS_OLD + return upoke(tcp->pid, 4 * EAX, i386_regs.eax); +#else + return set_regs(tcp->pid); +#endif +} + +static int +arch_set_success(struct tcb *tcp) +{ + i386_regs.eax = tcp->u_rval; +#ifdef HAVE_GETREGS_OLD + return upoke(tcp->pid, 4 * EAX, i386_regs.eax); +#else + return set_regs(tcp->pid); +#endif +} diff --git a/linux/i386/set_scno.c b/linux/i386/set_scno.c new file mode 100644 index 00000000..3abe7768 --- /dev/null +++ b/linux/i386/set_scno.c @@ -0,0 +1,10 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ +#ifdef HAVE_GETREGS_OLD + return upoke(tcp->pid, 4 * ORIG_EAX, scno); +#else + i386_regs.orig_eax = scno; + return set_regs(tcp->pid); +#endif +} diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h index f7d2cefe..31023c20 100644 --- a/linux/i386/syscallent.h +++ b/linux/i386/syscallent.h @@ -26,456 +26,388 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "old_getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 6, TD|TM|SI, sys_old_mmap, "old_mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 1, 0, sys_vm86old, "vm86old" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 6, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, sys_vm86, "vm86" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 1, 0, SEN(vm86old), "vm86old" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { 5, 0, SEN(vm86), "vm86" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 5, TD, SEN(pread), "pread64" }, +[181] = { 5, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "chown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[193] = { 3, TF, SEN(truncate64), "truncate64" }, +[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "lchown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(getegid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "chown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[222 ... 223] = { }, +[224] = { 0, NF, SEN(gettid), "gettid" }, +[225] = { 4, TD, SEN(readahead), "readahead" }, +[226] = { 5, TF, SEN(setxattr), "setxattr" }, +[227] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[229] = { 4, TF, SEN(getxattr), "getxattr" }, +[230] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[232] = { 3, TF, SEN(listxattr), "listxattr" }, +[233] = { 3, TF, SEN(listxattr), "llistxattr" }, +[234] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[235] = { 2, TF, SEN(removexattr), "removexattr" }, +[236] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[238] = { 2, TS, SEN(kill), "tkill" }, +[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[240] = { 6, 0, SEN(futex), "futex" }, +[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, +[245] = { 2, TM, SEN(io_setup), "io_setup" }, +[246] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[248] = { 3, 0, SEN(io_submit), "io_submit" }, +[249] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[250] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[251] = { }, /* sys_set_zone_reclaim */ +[252] = { 1, TP|SE, SEN(exit), "exit_group" }, +[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[254] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[259] = { 3, 0, SEN(timer_create), "timer_create" }, +[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[263] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[268] = { 3, TF, SEN(statfs64), "statfs64" }, +[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[270] = { 3, TS, SEN(tgkill), "tgkill" }, +[271] = { 2, TF, SEN(utimes), "utimes" }, +[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[273] = { 5, 0, SEN(vserver), "vserver" }, +[274] = { 6, TM, SEN(mbind), "mbind" }, +[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[277] = { 4, 0, SEN(mq_open), "mq_open" }, +[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[283] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[284] = { 5, TP, SEN(waitid), "waitid" }, +[285] = { }, /* sys_setaltroot */ +[286] = { 5, 0, SEN(add_key), "add_key" }, +[287] = { 4, 0, SEN(request_key), "request_key" }, +[288] = { 5, 0, SEN(keyctl), "keyctl" }, +[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[291] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[295] = { 4, TD|TF, SEN(openat), "openat" }, +[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[302] = { 4, TD|TF, SEN(renameat), "renameat" }, +[303] = { 5, TD|TF, SEN(linkat), "linkat" }, +[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[308] = { 6, TD, SEN(pselect6), "pselect6" }, +[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[310] = { 1, TP, SEN(unshare), "unshare" }, +[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[313] = { 6, TD, SEN(splice), "splice" }, +[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[315] = { 4, TD, SEN(tee), "tee" }, +[316] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[317] = { 6, TM, SEN(move_pages), "move_pages" }, +[318] = { 3, 0, SEN(getcpu), "getcpu" }, +[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[323] = { 1, TD, SEN(eventfd), "eventfd" }, +[324] = { 6, TD, SEN(fallocate), "fallocate" }, +[325] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[326] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[328] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[329] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[330] = { 3, TD, SEN(dup3), "dup3" }, +[331] = { 2, TD, SEN(pipe2), "pipe2" }, +[332] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[333] = { 5, TD, SEN(preadv), "preadv" }, +[334] = { 5, TD, SEN(pwritev), "pwritev" }, +[335] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[336] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[337] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[338] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[339] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[340] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[341] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[342] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[343] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[344] = { 1, TD, SEN(syncfs), "syncfs" }, +[345] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[346] = { 2, TD, SEN(setns), "setns" }, +[347] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[348] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[349] = { 5, 0, SEN(kcmp), "kcmp" }, +[350] = { 3, TD, SEN(finit_module), "finit_module" }, +[351] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[352] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[353] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[354] = { 3, 0, SEN(seccomp), "seccomp" }, +[355] = { 3, 0, SEN(getrandom), "getrandom" }, +[356] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[357] = { 3, TD, SEN(bpf), "bpf" }, +[358] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[359] = { 3, TN, SEN(socket), "socket" }, +[360] = { 4, TN, SEN(socketpair), "socketpair" }, +[361] = { 3, TN, SEN(bind), "bind" }, +[362] = { 3, TN, SEN(connect), "connect" }, +[363] = { 2, TN, SEN(listen), "listen" }, +[364] = { 4, TN, SEN(accept4), "accept4" }, +[365] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[366] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[367] = { 3, TN, SEN(getsockname), "getsockname" }, +[368] = { 3, TN, SEN(getpeername), "getpeername" }, +[369] = { 6, TN, SEN(sendto), "sendto" }, +[370] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[371] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[372] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[373] = { 2, TN, SEN(shutdown), "shutdown" }, +[374] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[375] = { 2, 0, SEN(membarrier), "membarrier" }, +[376] = { 3, TM, SEN(mlock2), "mlock2" }, +[377] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[378] = { 6, TD, SEN(preadv2), "preadv2" }, +[379] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[380] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[381] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[382] = { 1, 0, SEN(pkey_free), "pkey_free" }, - { 5, TD, sys_pread, "pread64" }, /* 180 */ - { 5, TD, sys_pwrite, "pwrite64" }, /* 181 */ - { 3, TF, sys_chown, "chown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 188 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 191 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 192 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 3, TF, sys_chown, "lchown32" }, /* 198 */ - { 0, NF, sys_getuid, "getuid32" }, /* 199 */ - - { 0, NF, sys_getgid, "getgid32" }, /* 200 */ - { 0, NF, sys_geteuid, "geteuid32" }, /* 201 */ - { 0, NF, sys_getegid, "getegid32" }, /* 202 */ - { 2, 0, sys_setreuid, "setreuid32" }, /* 203 */ - { 2, 0, sys_setregid, "setregid32" }, /* 204 */ - { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */ - { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */ - { 3, TD, sys_fchown, "fchown32" }, /* 207 */ - { 3, 0, sys_setresuid, "setresuid32" }, /* 208 */ - { 3, 0, sys_getresuid, "getresuid32" }, /* 209 */ - { 3, 0, sys_setresgid, "setresgid32" }, /* 210 */ - { 3, 0, sys_getresgid, "getresgid32" }, /* 211 */ - { 3, TF, sys_chown, "chown32" }, /* 212 */ - { 1, 0, sys_setuid, "setuid32" }, /* 213 */ - { 1, 0, sys_setgid, "setgid32" }, /* 214 */ - { 1, NF, sys_setfsuid, "setfsuid32" }, /* 215 */ - { 1, NF, sys_setfsgid, "setfsgid32" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 3, TM, sys_mincore, "mincore" }, /* 218 */ - { 3, TM, sys_madvise, "madvise" }, /* 219 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 220 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 221 */ - { 6, 0, NULL, NULL }, /* 222 */ - { 5, 0, sys_security, "security" }, /* 223 */ - { 0, 0, sys_gettid, "gettid" }, /* 224 */ - { 4, TD, sys_readahead, "readahead" }, /* 225 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 226 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 227 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 228 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 229 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 230 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 231 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 232 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 233 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 234 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 235 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 236 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 237 */ - { 2, TS, sys_kill, "tkill" }, /* 238 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 239 */ - { 6, 0, sys_futex, "futex" }, /* 240 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 241 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 242 */ - { 1, 0, sys_set_thread_area, "set_thread_area" }, /* 243 */ - { 1, 0, sys_get_thread_area, "get_thread_area" }, /* 244 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 245 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 246 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 247 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 248 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 250 */ - { 6, 0, NULL, NULL }, /* 251 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 252 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 253 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 254 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 256 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 257 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 258 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 259 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 260 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 261 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 262 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 263 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 264 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 265 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 266 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 267 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 268 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 269 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 270 */ - { 2, TF, sys_utimes, "utimes" }, /* 271 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 272 */ - { 5, 0, sys_vserver, "vserver" }, /* 273 */ - { 6, TM, sys_mbind, "mbind" }, /* 274 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 275 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 276 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 277 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 278 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 279 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 280 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 281 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 282 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 283 */ - { 5, TP, sys_waitid, "waitid" }, /* 284 */ - { 6, 0, NULL, NULL }, /* 285 */ - { 5, 0, sys_add_key, "add_key" }, /* 286 */ - { 4, 0, sys_request_key, "request_key" }, /* 287 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 288 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 289 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 290 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 291 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 292 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 293 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 294 */ - { 4, TD|TF, sys_openat, "openat" }, /* 295 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 296 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 297 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 298 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 299 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 300 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 301 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 302 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 303 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 304 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 305 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 306 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 307 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 308 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 309 */ - { 1, TP, sys_unshare, "unshare" }, /* 310 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 311 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 312 */ - { 6, TD, sys_splice, "splice" }, /* 313 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 314 */ - { 4, TD, sys_tee, "tee" }, /* 315 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 316 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 317 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 318 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 319 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 320 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 321 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 322 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 323 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 324 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 325 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 326 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 327 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 328 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 329 */ - { 3, TD, sys_dup3, "dup3" }, /* 330 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 331 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 332 */ - { 5, TD, sys_preadv, "preadv" }, /* 333 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 334 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 335 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 336 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 337 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 338 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 339 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 340 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 341 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 342 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 343 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 344 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 345 */ - { 2, TD, sys_setns, "setns" }, /* 346 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 347 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 348 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 349 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 350 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 351 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 352 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 353 */ - { 5, 0, NULL, NULL }, /* 354 */ - { 5, 0, NULL, NULL }, /* 355 */ - { 5, 0, NULL, NULL }, /* 356 */ - { 5, 0, NULL, NULL }, /* 357 */ - { 5, 0, NULL, NULL }, /* 358 */ - { 5, 0, NULL, NULL }, /* 359 */ - { 5, 0, NULL, NULL }, /* 360 */ - { 5, 0, NULL, NULL }, /* 361 */ - { 5, 0, NULL, NULL }, /* 362 */ - { 5, 0, NULL, NULL }, /* 363 */ - { 5, 0, NULL, NULL }, /* 364 */ - { 5, 0, NULL, NULL }, /* 365 */ - { 5, 0, NULL, NULL }, /* 366 */ - { 5, 0, NULL, NULL }, /* 367 */ - { 5, 0, NULL, NULL }, /* 368 */ - { 5, 0, NULL, NULL }, /* 369 */ - { 5, 0, NULL, NULL }, /* 370 */ - { 5, 0, NULL, NULL }, /* 371 */ - { 5, 0, NULL, NULL }, /* 372 */ - { 5, 0, NULL, NULL }, /* 373 */ - { 5, 0, NULL, NULL }, /* 374 */ - { 5, 0, NULL, NULL }, /* 375 */ - { 5, 0, NULL, NULL }, /* 376 */ - { 5, 0, NULL, NULL }, /* 377 */ - { 5, 0, NULL, NULL }, /* 378 */ - { 5, 0, NULL, NULL }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 5, 0, NULL, NULL }, /* 381 */ - { 5, 0, NULL, NULL }, /* 382 */ - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ #define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -#if SYS_ipc_subcall != 420 - #error fix me -#endif - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ - { 4, TI, sys_semop, "semop" }, /* 421 */ - { 4, TI, sys_semget, "semget" }, /* 422 */ - { 4, TI, sys_semctl, "semctl" }, /* 423 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 424 */ - { 4, 0, printargs, "ipc_subcall" }, /* 425 */ - { 4, 0, printargs, "ipc_subcall" }, /* 426 */ - { 4, 0, printargs, "ipc_subcall" }, /* 427 */ - { 4, 0, printargs, "ipc_subcall" }, /* 428 */ - { 4, 0, printargs, "ipc_subcall" }, /* 429 */ - { 4, 0, printargs, "ipc_subcall" }, /* 430 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 431 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 432 */ - { 4, TI, sys_msgget, "msgget" }, /* 433 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 434 */ - { 4, 0, printargs, "ipc_subcall" }, /* 435 */ - { 4, 0, printargs, "ipc_subcall" }, /* 436 */ - { 4, 0, printargs, "ipc_subcall" }, /* 437 */ - { 4, 0, printargs, "ipc_subcall" }, /* 438 */ - { 4, 0, printargs, "ipc_subcall" }, /* 439 */ - { 4, 0, printargs, "ipc_subcall" }, /* 440 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 441 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 442 */ - { 4, TI, sys_shmget, "shmget" }, /* 443 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 444 */ diff --git a/linux/i386/userent.h b/linux/i386/userent.h new file mode 100644 index 00000000..a8abd11d --- /dev/null +++ b/linux/i386/userent.h @@ -0,0 +1,19 @@ +XLAT(4*EBX), +XLAT(4*ECX), +XLAT(4*EDX), +XLAT(4*ESI), +XLAT(4*EDI), +XLAT(4*EBP), +XLAT(4*EAX), +XLAT(4*DS), +XLAT(4*ES), +XLAT(4*FS), +XLAT(4*GS), +XLAT(4*ORIG_EAX), +XLAT(4*EIP), +XLAT(4*CS), +XLAT(4*EFL), +XLAT(4*UESP), +XLAT(4*SS), +/* Other fields in "struct user" */ +#include "userent0.h" diff --git a/linux/i386/userent0.h b/linux/i386/userent0.h new file mode 100644 index 00000000..d2728ff7 --- /dev/null +++ b/linux/i386/userent0.h @@ -0,0 +1,15 @@ +XLAT_UOFF(u_fpvalid), +XLAT_UOFF(i387), +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +XLAT_UOFF(start_stack), +XLAT_UOFF(signal), +XLAT_UOFF(reserved), +XLAT_UOFF(u_ar0), +XLAT_UOFF(u_fpstate), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +XLAT_UOFF(u_debugreg), +#include "../userent0.h" diff --git a/linux/ia64/arch_getrval2.c b/linux/ia64/arch_getrval2.c new file mode 100644 index 00000000..7a6875f0 --- /dev/null +++ b/linux/ia64/arch_getrval2.c @@ -0,0 +1,5 @@ +long +getrval2(struct tcb *tcp) +{ + return ia64_regs.gr[9]; +} diff --git a/linux/ia64/arch_regs.c b/linux/ia64/arch_regs.c new file mode 100644 index 00000000..deec1769 --- /dev/null +++ b/linux/ia64/arch_regs.c @@ -0,0 +1,8 @@ +static struct pt_all_user_regs ia64_regs; +unsigned long *const ia64_frame_ptr = &ia64_regs.gr[12]; + +#define IA64_PSR_IS (1UL << 34) +#define ia64_ia32mode (ia64_regs.cr_ipsr & IA64_PSR_IS) + +#define ARCH_REGS_FOR_GETREGS ia64_regs +#define ARCH_PC_REG ia64_regs.br[0] diff --git a/linux/ia64/arch_regs.h b/linux/ia64/arch_regs.h new file mode 100644 index 00000000..7ad969c8 --- /dev/null +++ b/linux/ia64/arch_regs.h @@ -0,0 +1,2 @@ +#include +extern unsigned long *const ia64_frame_ptr; diff --git a/linux/ia64/arch_sigreturn.c b/linux/ia64/arch_sigreturn.c new file mode 100644 index 00000000..0c0034f9 --- /dev/null +++ b/linux/ia64/arch_sigreturn.c @@ -0,0 +1,12 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + /* offsetof(struct sigframe, sc) */ +#define OFFSETOF_STRUCT_SIGFRAME_SC 0xA0 + const unsigned long addr = *ia64_frame_ptr + 16 + + OFFSETOF_STRUCT_SIGFRAME_SC + + offsetof(struct sigcontext, sc_mask); + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/ia64/get_error.c b/linux/ia64/get_error.c new file mode 100644 index 00000000..52daa7f4 --- /dev/null +++ b/linux/ia64/get_error.c @@ -0,0 +1,20 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (ia64_ia32mode) { + int err = ia64_regs.gr[8]; + if (check_errno && is_negated_errno(err)) { + tcp->u_rval = -1; + tcp->u_error = -err; + } else { + tcp->u_rval = err; + } + } else { + if (ia64_regs.gr[10]) { + tcp->u_rval = -1; + tcp->u_error = ia64_regs.gr[8]; + } else { + tcp->u_rval = ia64_regs.gr[8]; + } + } +} diff --git a/linux/ia64/get_scno.c b/linux/ia64/get_scno.c new file mode 100644 index 00000000..0ddc17a9 --- /dev/null +++ b/linux/ia64/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = ia64_ia32mode ? ia64_regs.gr[0] : ia64_regs.gr[15]; + return 1; +} diff --git a/linux/ia64/get_syscall_args.c b/linux/ia64/get_syscall_args.c new file mode 100644 index 00000000..1b942eba --- /dev/null +++ b/linux/ia64/get_syscall_args.c @@ -0,0 +1,29 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + if (!ia64_ia32mode) { + unsigned long *rbs_end = + (unsigned long *) ia64_regs.ar[PT_AUR_BSP]; + unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f; + unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f; + unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol); + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) { + if (umove(tcp, + (unsigned long) ia64_rse_skip_regs(out0, i), + &tcp->u_arg[i]) < 0) + return -1; + } + } else { + /* truncate away IVE sign-extension */ + tcp->u_arg[0] = 0xffffffff & ia64_regs.gr[11]; /* EBX */ + tcp->u_arg[1] = 0xffffffff & ia64_regs.gr[ 9]; /* ECX */ + tcp->u_arg[2] = 0xffffffff & ia64_regs.gr[10]; /* EDX */ + tcp->u_arg[3] = 0xffffffff & ia64_regs.gr[14]; /* ESI */ + tcp->u_arg[4] = 0xffffffff & ia64_regs.gr[15]; /* EDI */ + tcp->u_arg[5] = 0xffffffff & ia64_regs.gr[13]; /* EBP */ + } + return 1; +} diff --git a/linux/ia64/ioctlent.h.in b/linux/ia64/ioctlent.h.in deleted file mode 100644 index 970ba559..00000000 --- a/linux/ia64/ioctlent.h.in +++ /dev/null @@ -1,66 +0,0 @@ - {"asm/ioctls.h", "TCGETS", 0x5401}, - {"asm/ioctls.h", "TCSETS", 0x5402}, - {"asm/ioctls.h", "TCSETSW", 0x5403}, - {"asm/ioctls.h", "TCSETSF", 0x5404}, - {"asm/ioctls.h", "TCGETA", 0x5405}, - {"asm/ioctls.h", "TCSETA", 0x5406}, - {"asm/ioctls.h", "TCSETAW", 0x5407}, - {"asm/ioctls.h", "TCSETAF", 0x5408}, - {"asm/ioctls.h", "TCSBRK", 0x5409}, - {"asm/ioctls.h", "TCXONC", 0x540a}, - {"asm/ioctls.h", "TCFLSH", 0x540b}, - {"asm/ioctls.h", "TIOCEXCL", 0x540c}, - {"asm/ioctls.h", "TIOCNXCL", 0x540d}, - {"asm/ioctls.h", "TIOCSCTTY", 0x540e}, - {"asm/ioctls.h", "TIOCGPGRP", 0x540f}, - {"asm/ioctls.h", "TIOCSPGRP", 0x5410}, - {"asm/ioctls.h", "TIOCOUTQ", 0x5411}, - {"asm/ioctls.h", "TIOCSTI", 0x5412}, - {"asm/ioctls.h", "TIOCGWINSZ", 0x5413}, - {"asm/ioctls.h", "TIOCSWINSZ", 0x5414}, - {"asm/ioctls.h", "TIOCMGET", 0x5415}, - {"asm/ioctls.h", "TIOCMBIS", 0x5416}, - {"asm/ioctls.h", "TIOCMBIC", 0x5417}, - {"asm/ioctls.h", "TIOCMSET", 0x5418}, - {"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, - {"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, - {"asm/ioctls.h", "FIONREAD", 0x541b}, - {"asm/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm/ioctls.h", "TIOCCONS", 0x541d}, - {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm/ioctls.h", "TIOCPKT", 0x5420}, - {"asm/ioctls.h", "FIONBIO", 0x5421}, - {"asm/ioctls.h", "TIOCNOTTY", 0x5422}, - {"asm/ioctls.h", "TIOCSETD", 0x5423}, - {"asm/ioctls.h", "TIOCGETD", 0x5424}, - {"asm/ioctls.h", "TCSBRKP", 0x5425}, - {"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426}, - {"asm/ioctls.h", "TIOCSBRK", 0x5427}, - {"asm/ioctls.h", "TIOCCBRK", 0x5428}, - {"asm/ioctls.h", "TIOCGSID", 0x5429}, - {"asm/ioctls.h", "TIOCGPTN", 0x5430}, - {"asm/ioctls.h", "TIOCSPTLCK", 0x5431}, - {"asm/ioctls.h", "FIONCLEX", 0x5450}, - {"asm/ioctls.h", "FIOCLEX", 0x5451}, - {"asm/ioctls.h", "FIOASYNC", 0x5452}, - {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm/ioctls.h", "TIOCGHAYESESP", 0x545e}, - {"asm/ioctls.h", "TIOCSHAYESESP", 0x545f}, - {"asm/ioctls.h", "FIOQSIZE", 0x5460}, - {"asm/sockios.h", "FIOSETOWN", 0x8901}, - {"asm/sockios.h", "SIOCSPGRP", 0x8902}, - {"asm/sockios.h", "FIOGETOWN", 0x8903}, - {"asm/sockios.h", "SIOCGPGRP", 0x8904}, - {"asm/sockios.h", "SIOCATMARK", 0x8905}, - {"asm/sockios.h", "SIOCGSTAMP", 0x8906}, diff --git a/linux/ia64/ioctls_arch0.h b/linux/ia64/ioctls_arch0.h new file mode 100644 index 00000000..6a6e4000 --- /dev/null +++ b/linux/ia64/ioctls_arch0.h @@ -0,0 +1,8 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/ia64/include/ tree. */ +{ "asm/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, diff --git a/linux/ia64/ioctls_inc0.h b/linux/ia64/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/ia64/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/ia64/set_error.c b/linux/ia64/set_error.c new file mode 100644 index 00000000..c566b638 --- /dev/null +++ b/linux/ia64/set_error.c @@ -0,0 +1,21 @@ +static int +arch_set_error(struct tcb *tcp) +{ + if (ia64_ia32mode) { + ia64_regs.gr[8] = -tcp->u_error; + } else { + ia64_regs.gr[8] = tcp->u_error; + ia64_regs.gr[10] = -1; + } + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + ia64_regs.gr[8] = tcp->u_rval; + if (!ia64_ia32mode) { + ia64_regs.gr[10] = 0; + } + return set_regs(tcp->pid); +} diff --git a/linux/ia64/set_scno.c b/linux/ia64/set_scno.c new file mode 100644 index 00000000..1af7b025 --- /dev/null +++ b/linux/ia64/set_scno.c @@ -0,0 +1,10 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + if (ia64_ia32mode) + ia64_regs.gr[0] = scno; + else + ia64_regs.gr[15] = scno; + + return set_regs(tcp->pid); +} diff --git a/linux/ia64/signalent.h b/linux/ia64/signalent.h deleted file mode 100644 index e791a641..00000000 --- a/linux/ia64/signalent.h +++ /dev/null @@ -1,64 +0,0 @@ - "SIG_0", /* 0 */ - "SIGHUP", /* 1 */ - "SIGINT", /* 2 */ - "SIGQUIT", /* 3 */ - "SIGILL", /* 4 */ - "SIGTRAP", /* 5 */ - "SIGABRT", /* 6 */ - "SIGBUS", /* 7 */ - "SIGFPE", /* 8 */ - "SIGKILL", /* 9 */ - "SIGUSR1", /* 10 */ - "SIGSEGV", /* 11 */ - "SIGUSR2", /* 12 */ - "SIGPIPE", /* 13 */ - "SIGALRM", /* 14 */ - "SIGTERM", /* 15 */ - "SIGSTKFLT", /* 16 */ - "SIGCHLD", /* 17 */ - "SIGCONT", /* 18 */ - "SIGSTOP", /* 19 */ - "SIGTSTP", /* 20 */ - "SIGTTIN", /* 21 */ - "SIGTTOU", /* 22 */ - "SIGURG", /* 23 */ - "SIGXCPU", /* 24 */ - "SIGXFSZ", /* 25 */ - "SIGVTALRM", /* 26 */ - "SIGPROF", /* 27 */ - "SIGWINCH", /* 28 */ - "SIGIO", /* 29 */ - "SIGPWR", /* 30 */ - "SIGSYS", /* 31 */ - "SIGRT0", /* 32 */ - "SIGRT1", /* 33 */ - "SIGRT2", /* 34 */ - "SIGRT3", /* 35 */ - "SIGRT4", /* 36 */ - "SIGRT5", /* 37 */ - "SIGRT6", /* 38 */ - "SIGRT7", /* 39 */ - "SIGRT8", /* 40 */ - "SIGRT9", /* 41 */ - "SIGRT10", /* 42 */ - "SIGRT11", /* 43 */ - "SIGRT12", /* 44 */ - "SIGRT13", /* 45 */ - "SIGRT14", /* 46 */ - "SIGRT15", /* 47 */ - "SIGRT16", /* 48 */ - "SIGRT17", /* 49 */ - "SIGRT18", /* 50 */ - "SIGRT19", /* 51 */ - "SIGRT20", /* 52 */ - "SIGRT21", /* 53 */ - "SIGRT22", /* 54 */ - "SIGRT23", /* 55 */ - "SIGRT24", /* 56 */ - "SIGRT25", /* 57 */ - "SIGRT26", /* 58 */ - "SIGRT27", /* 59 */ - "SIGRT28", /* 60 */ - "SIGRT29", /* 61 */ - "SIGRT30", /* 62 */ - "SIGRT31", /* 63 */ diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index 48422d99..97ecab9c 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -30,1103 +30,340 @@ * IA-32 syscalls that have pointer arguments which are incompatible * with 64-bit layout get redirected to printargs. */ -#define sys_getrlimit printargs -#define sys_afs_syscall printargs -#define sys_getpmsg printargs -#define sys_putpmsg printargs -#define sys_ugetrlimit printargs -#define sys_waitpid printargs -#define sys_time printargs -#define sys_break printargs -#define sys_oldstat printargs -#define sys_lseek printargs -#define sys_stime printargs -#define sys_ptrace printargs -#define sys_oldfstat printargs -#define sys_pause printargs -#define sys_utime printargs -#define sys_stty printargs -#define sys_gtty printargs -#define sys_ftime printargs -#define sys_pipe printargs -#define sys_times printargs -#define sys_prof printargs -#define sys_signal printargs -#define sys_lock printargs -#define sys_ioctl printargs -#define sys_fcntl printargs -#define sys_mpx printargs -#define sys_ulimit printargs -#define sys_oldolduname printargs -#define sys_sigaction printargs -#define sys_siggetmask printargs -#define sys_sigsetmask printargs -#define sys_sigsuspend printargs -#define sys_sigpending printargs -#define sys_setrlimit printargs -#define sys_getrusage printargs -#define sys_gettimeofday printargs -#define sys_settimeofday printargs -#define sys_getgroups printargs -#define sys_setgroups printargs -#define sys_select printargs -#undef sys_oldlstat -#define sys_oldlstat printargs -#define sys_readdir printargs -#define sys_profil printargs -#define sys_statfs printargs -#define sys_fstatfs printargs -#define sys_ioperm printargs -#define sys_setitimer printargs -#define sys_getitimer printargs -#define sys_stat printargs -#undef sys_lstat -#define sys_lstat printargs -#define sys_fstat printargs -#define sys_olduname printargs -#define sys_iopl printargs -#define sys_idle printargs -#define sys_vm86old printargs -#define sys_wait4 printargs -#define sys_sysinfo printargs -#define sys_sigreturn printargs -#define sys_uname printargs -#define sys_modify_ldt printargs -#define sys_adjtimex printargs -#define sys_sigprocmask printargs -#define sys_create_module printargs -#define sys_init_module printargs -#define sys_get_kernel_syms printargs -#define sys_quotactl printargs -#define sys_bdflush printargs -#define sys_personality printargs -#define sys_getdents printargs -#define sys__newselect printargs -#define sys_msync printargs -#define sys_readv printargs -#define sys_writev printargs -#define sys__sysctl printargs -#define sys_sched_rr_get_interval printargs -#define sys_getresuid printargs -#define sys_vm86 printargs -#define sys_query_module printargs -#define sys_nfsservctl printargs -#define sys_rt_sigreturn printargs -#define sys_rt_sigaction printargs -#define sys_rt_sigprocmask printargs -#define sys_rt_sigtimedwait printargs -#define sys_rt_sigqueueinfo printargs -#define sys_rt_sigsuspend printargs -#define sys_pread printargs -#define sys_pwrite printargs -#define sys_sigaltstack printargs -#define sys_sendfile printargs -#define sys_truncate64 printargs -#define sys_ftruncate64 printargs -#define sys_stat64 printargs -#undef sys_lstat64 -#define sys_lstat64 printargs -#define sys_fstat64 printargs -#define sys_fcntl64 printargs - -#include "../i386/syscallent.h" - -#undef sys_getrlimit -#undef sys_afs_syscall -#undef sys_getpmsg -#undef sys_putpmsg -#undef sys_ugetrlimit -#undef sys_waitpid -#undef sys_time -#undef sys_break -#undef sys_oldstat -#undef sys_lseek -#undef sys_stime -#undef sys_ptrace -#undef sys_oldfstat -#undef sys_pause -#undef sys_utime -#undef sys_stty -#undef sys_gtty -#undef sys_ftime -#undef sys_pipe -#undef sys_times -#undef sys_prof -#undef sys_signal -#undef sys_lock -#undef sys_ioctl -#undef sys_fcntl -#undef sys_mpx -#undef sys_ulimit -#undef sys_oldolduname -#undef sys_sigaction -#undef sys_siggetmask -#undef sys_sigsetmask -#undef sys_sigsuspend -#undef sys_sigpending -#undef sys_setrlimit -#undef sys_getrusage -#undef sys_gettimeofday -#undef sys_settimeofday -#undef sys_getgroups -#undef sys_setgroups -#undef sys_select -#undef sys_oldlstat -#undef sys_readdir -#undef sys_profil -#undef sys_statfs -#undef sys_fstatfs -#undef sys_ioperm -#undef sys_setitimer -#undef sys_getitimer -#undef sys_stat -#undef sys_lstat -#undef sys_fstat -#undef sys_olduname -#undef sys_iopl -#undef sys_idle -#undef sys_vm86old -#undef sys_wait4 -#undef sys_sysinfo -#undef sys_sigreturn -#undef sys_uname -#undef sys_modify_ldt -#undef sys_adjtimex -#undef sys_sigprocmask -#undef sys_create_module -#undef sys_init_module -#undef sys_get_kernel_syms -#undef sys_quotactl -#undef sys_bdflush -#undef sys_personality -#undef sys_getdents -#undef sys__newselect -#undef sys_msync -#undef sys_readv -#undef sys_writev -#undef sys__sysctl -#undef sys_sched_rr_get_interval -#undef sys_getresuid -#undef sys_vm86 -#undef sys_query_module -#undef sys_nfsservctl -#undef sys_rt_sigreturn -#undef sys_rt_sigaction -#undef sys_rt_sigprocmask -#undef sys_rt_sigtimedwait -#undef sys_rt_sigqueueinfo -#undef sys_rt_sigsuspend -#undef sys_pread -#undef sys_pwrite -#undef sys_sigaltstack -#undef sys_sendfile -#undef sys_truncate64 -#undef sys_ftruncate64 -#undef sys_stat64 -#undef sys_lstat64 -#undef sys_fstat64 -#undef sys_fcntl64 - -#include "../dummy.h" +#if CST > 0 +# undef SYS_FUNC_NAME +# define SYS_FUNC_NAME(syscall_name) printargs +# include "../i386/syscallent.h" +# undef SYS_FUNC_NAME +# define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name) +#endif /* You must be careful to check ../i386/syscallent.h so that this table starts where that one leaves off. */ -#if SYS_ipc_subcall + SYS_ipc_nsubcalls != 445 -# error fix me -#endif - - { MA, 0, NULL, NULL }, /* 445 */ - { MA, 0, NULL, NULL }, /* 446 */ - { MA, 0, NULL, NULL }, /* 447 */ - { MA, 0, NULL, NULL }, /* 448 */ - { MA, 0, NULL, NULL }, /* 449 */ - { MA, 0, NULL, NULL }, /* 450 */ - { MA, 0, NULL, NULL }, /* 451 */ - { MA, 0, NULL, NULL }, /* 452 */ - { MA, 0, NULL, NULL }, /* 453 */ - { MA, 0, NULL, NULL }, /* 454 */ - { MA, 0, NULL, NULL }, /* 455 */ - { MA, 0, NULL, NULL }, /* 456 */ - { MA, 0, NULL, NULL }, /* 457 */ - { MA, 0, NULL, NULL }, /* 458 */ - { MA, 0, NULL, NULL }, /* 459 */ - { MA, 0, NULL, NULL }, /* 460 */ - { MA, 0, NULL, NULL }, /* 461 */ - { MA, 0, NULL, NULL }, /* 462 */ - { MA, 0, NULL, NULL }, /* 463 */ - { MA, 0, NULL, NULL }, /* 464 */ - { MA, 0, NULL, NULL }, /* 465 */ - { MA, 0, NULL, NULL }, /* 466 */ - { MA, 0, NULL, NULL }, /* 467 */ - { MA, 0, NULL, NULL }, /* 468 */ - { MA, 0, NULL, NULL }, /* 469 */ - { MA, 0, NULL, NULL }, /* 470 */ - { MA, 0, NULL, NULL }, /* 471 */ - { MA, 0, NULL, NULL }, /* 472 */ - { MA, 0, NULL, NULL }, /* 473 */ - { MA, 0, NULL, NULL }, /* 474 */ - { MA, 0, NULL, NULL }, /* 475 */ - { MA, 0, NULL, NULL }, /* 476 */ - { MA, 0, NULL, NULL }, /* 477 */ - { MA, 0, NULL, NULL }, /* 478 */ - { MA, 0, NULL, NULL }, /* 479 */ - { MA, 0, NULL, NULL }, /* 480 */ - { MA, 0, NULL, NULL }, /* 481 */ - { MA, 0, NULL, NULL }, /* 482 */ - { MA, 0, NULL, NULL }, /* 483 */ - { MA, 0, NULL, NULL }, /* 484 */ - { MA, 0, NULL, NULL }, /* 485 */ - { MA, 0, NULL, NULL }, /* 486 */ - { MA, 0, NULL, NULL }, /* 487 */ - { MA, 0, NULL, NULL }, /* 488 */ - { MA, 0, NULL, NULL }, /* 489 */ - { MA, 0, NULL, NULL }, /* 490 */ - { MA, 0, NULL, NULL }, /* 491 */ - { MA, 0, NULL, NULL }, /* 492 */ - { MA, 0, NULL, NULL }, /* 493 */ - { MA, 0, NULL, NULL }, /* 494 */ - { MA, 0, NULL, NULL }, /* 495 */ - { MA, 0, NULL, NULL }, /* 496 */ - { MA, 0, NULL, NULL }, /* 497 */ - { MA, 0, NULL, NULL }, /* 498 */ - { MA, 0, NULL, NULL }, /* 499 */ - { MA, 0, NULL, NULL }, /* 500 */ - { MA, 0, NULL, NULL }, /* 501 */ - { MA, 0, NULL, NULL }, /* 502 */ - { MA, 0, NULL, NULL }, /* 503 */ - { MA, 0, NULL, NULL }, /* 504 */ - { MA, 0, NULL, NULL }, /* 505 */ - { MA, 0, NULL, NULL }, /* 506 */ - { MA, 0, NULL, NULL }, /* 507 */ - { MA, 0, NULL, NULL }, /* 508 */ - { MA, 0, NULL, NULL }, /* 509 */ - { MA, 0, NULL, NULL }, /* 510 */ - { MA, 0, NULL, NULL }, /* 511 */ - { MA, 0, NULL, NULL }, /* 512 */ - { MA, 0, NULL, NULL }, /* 513 */ - { MA, 0, NULL, NULL }, /* 514 */ - { MA, 0, NULL, NULL }, /* 515 */ - { MA, 0, NULL, NULL }, /* 516 */ - { MA, 0, NULL, NULL }, /* 517 */ - { MA, 0, NULL, NULL }, /* 518 */ - { MA, 0, NULL, NULL }, /* 519 */ - { MA, 0, NULL, NULL }, /* 520 */ - { MA, 0, NULL, NULL }, /* 521 */ - { MA, 0, NULL, NULL }, /* 522 */ - { MA, 0, NULL, NULL }, /* 523 */ - { MA, 0, NULL, NULL }, /* 524 */ - { MA, 0, NULL, NULL }, /* 525 */ - { MA, 0, NULL, NULL }, /* 526 */ - { MA, 0, NULL, NULL }, /* 527 */ - { MA, 0, NULL, NULL }, /* 528 */ - { MA, 0, NULL, NULL }, /* 529 */ - { MA, 0, NULL, NULL }, /* 530 */ - { MA, 0, NULL, NULL }, /* 531 */ - { MA, 0, NULL, NULL }, /* 532 */ - { MA, 0, NULL, NULL }, /* 533 */ - { MA, 0, NULL, NULL }, /* 534 */ - { MA, 0, NULL, NULL }, /* 535 */ - { MA, 0, NULL, NULL }, /* 536 */ - { MA, 0, NULL, NULL }, /* 537 */ - { MA, 0, NULL, NULL }, /* 538 */ - { MA, 0, NULL, NULL }, /* 539 */ - { MA, 0, NULL, NULL }, /* 540 */ - { MA, 0, NULL, NULL }, /* 541 */ - { MA, 0, NULL, NULL }, /* 542 */ - { MA, 0, NULL, NULL }, /* 543 */ - { MA, 0, NULL, NULL }, /* 544 */ - { MA, 0, NULL, NULL }, /* 545 */ - { MA, 0, NULL, NULL }, /* 546 */ - { MA, 0, NULL, NULL }, /* 547 */ - { MA, 0, NULL, NULL }, /* 548 */ - { MA, 0, NULL, NULL }, /* 549 */ - { MA, 0, NULL, NULL }, /* 550 */ - { MA, 0, NULL, NULL }, /* 551 */ - { MA, 0, NULL, NULL }, /* 552 */ - { MA, 0, NULL, NULL }, /* 553 */ - { MA, 0, NULL, NULL }, /* 554 */ - { MA, 0, NULL, NULL }, /* 555 */ - { MA, 0, NULL, NULL }, /* 556 */ - { MA, 0, NULL, NULL }, /* 557 */ - { MA, 0, NULL, NULL }, /* 558 */ - { MA, 0, NULL, NULL }, /* 559 */ - { MA, 0, NULL, NULL }, /* 560 */ - { MA, 0, NULL, NULL }, /* 561 */ - { MA, 0, NULL, NULL }, /* 562 */ - { MA, 0, NULL, NULL }, /* 563 */ - { MA, 0, NULL, NULL }, /* 564 */ - { MA, 0, NULL, NULL }, /* 565 */ - { MA, 0, NULL, NULL }, /* 566 */ - { MA, 0, NULL, NULL }, /* 567 */ - { MA, 0, NULL, NULL }, /* 568 */ - { MA, 0, NULL, NULL }, /* 569 */ - { MA, 0, NULL, NULL }, /* 570 */ - { MA, 0, NULL, NULL }, /* 571 */ - { MA, 0, NULL, NULL }, /* 572 */ - { MA, 0, NULL, NULL }, /* 573 */ - { MA, 0, NULL, NULL }, /* 574 */ - { MA, 0, NULL, NULL }, /* 575 */ - { MA, 0, NULL, NULL }, /* 576 */ - { MA, 0, NULL, NULL }, /* 577 */ - { MA, 0, NULL, NULL }, /* 578 */ - { MA, 0, NULL, NULL }, /* 579 */ - { MA, 0, NULL, NULL }, /* 580 */ - { MA, 0, NULL, NULL }, /* 581 */ - { MA, 0, NULL, NULL }, /* 582 */ - { MA, 0, NULL, NULL }, /* 583 */ - { MA, 0, NULL, NULL }, /* 584 */ - { MA, 0, NULL, NULL }, /* 585 */ - { MA, 0, NULL, NULL }, /* 586 */ - { MA, 0, NULL, NULL }, /* 587 */ - { MA, 0, NULL, NULL }, /* 588 */ - { MA, 0, NULL, NULL }, /* 589 */ - { MA, 0, NULL, NULL }, /* 590 */ - { MA, 0, NULL, NULL }, /* 591 */ - { MA, 0, NULL, NULL }, /* 592 */ - { MA, 0, NULL, NULL }, /* 593 */ - { MA, 0, NULL, NULL }, /* 594 */ - { MA, 0, NULL, NULL }, /* 595 */ - { MA, 0, NULL, NULL }, /* 596 */ - { MA, 0, NULL, NULL }, /* 597 */ - { MA, 0, NULL, NULL }, /* 598 */ - { MA, 0, NULL, NULL }, /* 599 */ - { MA, 0, NULL, NULL }, /* 600 */ - { MA, 0, NULL, NULL }, /* 601 */ - { MA, 0, NULL, NULL }, /* 602 */ - { MA, 0, NULL, NULL }, /* 603 */ - { MA, 0, NULL, NULL }, /* 604 */ - { MA, 0, NULL, NULL }, /* 605 */ - { MA, 0, NULL, NULL }, /* 606 */ - { MA, 0, NULL, NULL }, /* 607 */ - { MA, 0, NULL, NULL }, /* 608 */ - { MA, 0, NULL, NULL }, /* 609 */ - { MA, 0, NULL, NULL }, /* 610 */ - { MA, 0, NULL, NULL }, /* 611 */ - { MA, 0, NULL, NULL }, /* 612 */ - { MA, 0, NULL, NULL }, /* 613 */ - { MA, 0, NULL, NULL }, /* 614 */ - { MA, 0, NULL, NULL }, /* 615 */ - { MA, 0, NULL, NULL }, /* 616 */ - { MA, 0, NULL, NULL }, /* 617 */ - { MA, 0, NULL, NULL }, /* 618 */ - { MA, 0, NULL, NULL }, /* 619 */ - { MA, 0, NULL, NULL }, /* 620 */ - { MA, 0, NULL, NULL }, /* 621 */ - { MA, 0, NULL, NULL }, /* 622 */ - { MA, 0, NULL, NULL }, /* 623 */ - { MA, 0, NULL, NULL }, /* 624 */ - { MA, 0, NULL, NULL }, /* 625 */ - { MA, 0, NULL, NULL }, /* 626 */ - { MA, 0, NULL, NULL }, /* 627 */ - { MA, 0, NULL, NULL }, /* 628 */ - { MA, 0, NULL, NULL }, /* 629 */ - { MA, 0, NULL, NULL }, /* 630 */ - { MA, 0, NULL, NULL }, /* 631 */ - { MA, 0, NULL, NULL }, /* 632 */ - { MA, 0, NULL, NULL }, /* 633 */ - { MA, 0, NULL, NULL }, /* 634 */ - { MA, 0, NULL, NULL }, /* 635 */ - { MA, 0, NULL, NULL }, /* 636 */ - { MA, 0, NULL, NULL }, /* 637 */ - { MA, 0, NULL, NULL }, /* 638 */ - { MA, 0, NULL, NULL }, /* 639 */ - { MA, 0, NULL, NULL }, /* 640 */ - { MA, 0, NULL, NULL }, /* 641 */ - { MA, 0, NULL, NULL }, /* 642 */ - { MA, 0, NULL, NULL }, /* 643 */ - { MA, 0, NULL, NULL }, /* 644 */ - { MA, 0, NULL, NULL }, /* 645 */ - { MA, 0, NULL, NULL }, /* 646 */ - { MA, 0, NULL, NULL }, /* 647 */ - { MA, 0, NULL, NULL }, /* 648 */ - { MA, 0, NULL, NULL }, /* 649 */ - { MA, 0, NULL, NULL }, /* 650 */ - { MA, 0, NULL, NULL }, /* 651 */ - { MA, 0, NULL, NULL }, /* 652 */ - { MA, 0, NULL, NULL }, /* 653 */ - { MA, 0, NULL, NULL }, /* 654 */ - { MA, 0, NULL, NULL }, /* 655 */ - { MA, 0, NULL, NULL }, /* 656 */ - { MA, 0, NULL, NULL }, /* 657 */ - { MA, 0, NULL, NULL }, /* 658 */ - { MA, 0, NULL, NULL }, /* 659 */ - { MA, 0, NULL, NULL }, /* 660 */ - { MA, 0, NULL, NULL }, /* 661 */ - { MA, 0, NULL, NULL }, /* 662 */ - { MA, 0, NULL, NULL }, /* 663 */ - { MA, 0, NULL, NULL }, /* 664 */ - { MA, 0, NULL, NULL }, /* 665 */ - { MA, 0, NULL, NULL }, /* 666 */ - { MA, 0, NULL, NULL }, /* 667 */ - { MA, 0, NULL, NULL }, /* 668 */ - { MA, 0, NULL, NULL }, /* 669 */ - { MA, 0, NULL, NULL }, /* 670 */ - { MA, 0, NULL, NULL }, /* 671 */ - { MA, 0, NULL, NULL }, /* 672 */ - { MA, 0, NULL, NULL }, /* 673 */ - { MA, 0, NULL, NULL }, /* 674 */ - { MA, 0, NULL, NULL }, /* 675 */ - { MA, 0, NULL, NULL }, /* 676 */ - { MA, 0, NULL, NULL }, /* 677 */ - { MA, 0, NULL, NULL }, /* 678 */ - { MA, 0, NULL, NULL }, /* 679 */ - { MA, 0, NULL, NULL }, /* 680 */ - { MA, 0, NULL, NULL }, /* 681 */ - { MA, 0, NULL, NULL }, /* 682 */ - { MA, 0, NULL, NULL }, /* 683 */ - { MA, 0, NULL, NULL }, /* 684 */ - { MA, 0, NULL, NULL }, /* 685 */ - { MA, 0, NULL, NULL }, /* 686 */ - { MA, 0, NULL, NULL }, /* 687 */ - { MA, 0, NULL, NULL }, /* 688 */ - { MA, 0, NULL, NULL }, /* 689 */ - { MA, 0, NULL, NULL }, /* 690 */ - { MA, 0, NULL, NULL }, /* 691 */ - { MA, 0, NULL, NULL }, /* 692 */ - { MA, 0, NULL, NULL }, /* 693 */ - { MA, 0, NULL, NULL }, /* 694 */ - { MA, 0, NULL, NULL }, /* 695 */ - { MA, 0, NULL, NULL }, /* 696 */ - { MA, 0, NULL, NULL }, /* 697 */ - { MA, 0, NULL, NULL }, /* 698 */ - { MA, 0, NULL, NULL }, /* 699 */ - { MA, 0, NULL, NULL }, /* 700 */ - { MA, 0, NULL, NULL }, /* 701 */ - { MA, 0, NULL, NULL }, /* 702 */ - { MA, 0, NULL, NULL }, /* 703 */ - { MA, 0, NULL, NULL }, /* 704 */ - { MA, 0, NULL, NULL }, /* 705 */ - { MA, 0, NULL, NULL }, /* 706 */ - { MA, 0, NULL, NULL }, /* 707 */ - { MA, 0, NULL, NULL }, /* 708 */ - { MA, 0, NULL, NULL }, /* 709 */ - { MA, 0, NULL, NULL }, /* 710 */ - { MA, 0, NULL, NULL }, /* 711 */ - { MA, 0, NULL, NULL }, /* 712 */ - { MA, 0, NULL, NULL }, /* 713 */ - { MA, 0, NULL, NULL }, /* 714 */ - { MA, 0, NULL, NULL }, /* 715 */ - { MA, 0, NULL, NULL }, /* 716 */ - { MA, 0, NULL, NULL }, /* 717 */ - { MA, 0, NULL, NULL }, /* 718 */ - { MA, 0, NULL, NULL }, /* 719 */ - { MA, 0, NULL, NULL }, /* 720 */ - { MA, 0, NULL, NULL }, /* 721 */ - { MA, 0, NULL, NULL }, /* 722 */ - { MA, 0, NULL, NULL }, /* 723 */ - { MA, 0, NULL, NULL }, /* 724 */ - { MA, 0, NULL, NULL }, /* 725 */ - { MA, 0, NULL, NULL }, /* 726 */ - { MA, 0, NULL, NULL }, /* 727 */ - { MA, 0, NULL, NULL }, /* 728 */ - { MA, 0, NULL, NULL }, /* 729 */ - { MA, 0, NULL, NULL }, /* 730 */ - { MA, 0, NULL, NULL }, /* 731 */ - { MA, 0, NULL, NULL }, /* 732 */ - { MA, 0, NULL, NULL }, /* 733 */ - { MA, 0, NULL, NULL }, /* 734 */ - { MA, 0, NULL, NULL }, /* 735 */ - { MA, 0, NULL, NULL }, /* 736 */ - { MA, 0, NULL, NULL }, /* 737 */ - { MA, 0, NULL, NULL }, /* 738 */ - { MA, 0, NULL, NULL }, /* 739 */ - { MA, 0, NULL, NULL }, /* 740 */ - { MA, 0, NULL, NULL }, /* 741 */ - { MA, 0, NULL, NULL }, /* 742 */ - { MA, 0, NULL, NULL }, /* 743 */ - { MA, 0, NULL, NULL }, /* 744 */ - { MA, 0, NULL, NULL }, /* 745 */ - { MA, 0, NULL, NULL }, /* 746 */ - { MA, 0, NULL, NULL }, /* 747 */ - { MA, 0, NULL, NULL }, /* 748 */ - { MA, 0, NULL, NULL }, /* 749 */ - { MA, 0, NULL, NULL }, /* 750 */ - { MA, 0, NULL, NULL }, /* 751 */ - { MA, 0, NULL, NULL }, /* 752 */ - { MA, 0, NULL, NULL }, /* 753 */ - { MA, 0, NULL, NULL }, /* 754 */ - { MA, 0, NULL, NULL }, /* 755 */ - { MA, 0, NULL, NULL }, /* 756 */ - { MA, 0, NULL, NULL }, /* 757 */ - { MA, 0, NULL, NULL }, /* 758 */ - { MA, 0, NULL, NULL }, /* 759 */ - { MA, 0, NULL, NULL }, /* 760 */ - { MA, 0, NULL, NULL }, /* 761 */ - { MA, 0, NULL, NULL }, /* 762 */ - { MA, 0, NULL, NULL }, /* 763 */ - { MA, 0, NULL, NULL }, /* 764 */ - { MA, 0, NULL, NULL }, /* 765 */ - { MA, 0, NULL, NULL }, /* 766 */ - { MA, 0, NULL, NULL }, /* 767 */ - { MA, 0, NULL, NULL }, /* 768 */ - { MA, 0, NULL, NULL }, /* 769 */ - { MA, 0, NULL, NULL }, /* 770 */ - { MA, 0, NULL, NULL }, /* 771 */ - { MA, 0, NULL, NULL }, /* 772 */ - { MA, 0, NULL, NULL }, /* 773 */ - { MA, 0, NULL, NULL }, /* 774 */ - { MA, 0, NULL, NULL }, /* 775 */ - { MA, 0, NULL, NULL }, /* 776 */ - { MA, 0, NULL, NULL }, /* 777 */ - { MA, 0, NULL, NULL }, /* 778 */ - { MA, 0, NULL, NULL }, /* 779 */ - { MA, 0, NULL, NULL }, /* 780 */ - { MA, 0, NULL, NULL }, /* 781 */ - { MA, 0, NULL, NULL }, /* 782 */ - { MA, 0, NULL, NULL }, /* 783 */ - { MA, 0, NULL, NULL }, /* 784 */ - { MA, 0, NULL, NULL }, /* 785 */ - { MA, 0, NULL, NULL }, /* 786 */ - { MA, 0, NULL, NULL }, /* 787 */ - { MA, 0, NULL, NULL }, /* 788 */ - { MA, 0, NULL, NULL }, /* 789 */ - { MA, 0, NULL, NULL }, /* 790 */ - { MA, 0, NULL, NULL }, /* 791 */ - { MA, 0, NULL, NULL }, /* 792 */ - { MA, 0, NULL, NULL }, /* 793 */ - { MA, 0, NULL, NULL }, /* 794 */ - { MA, 0, NULL, NULL }, /* 795 */ - { MA, 0, NULL, NULL }, /* 796 */ - { MA, 0, NULL, NULL }, /* 797 */ - { MA, 0, NULL, NULL }, /* 798 */ - { MA, 0, NULL, NULL }, /* 799 */ - { MA, 0, NULL, NULL }, /* 800 */ - { MA, 0, NULL, NULL }, /* 801 */ - { MA, 0, NULL, NULL }, /* 802 */ - { MA, 0, NULL, NULL }, /* 803 */ - { MA, 0, NULL, NULL }, /* 804 */ - { MA, 0, NULL, NULL }, /* 805 */ - { MA, 0, NULL, NULL }, /* 806 */ - { MA, 0, NULL, NULL }, /* 807 */ - { MA, 0, NULL, NULL }, /* 808 */ - { MA, 0, NULL, NULL }, /* 809 */ - { MA, 0, NULL, NULL }, /* 810 */ - { MA, 0, NULL, NULL }, /* 811 */ - { MA, 0, NULL, NULL }, /* 812 */ - { MA, 0, NULL, NULL }, /* 813 */ - { MA, 0, NULL, NULL }, /* 814 */ - { MA, 0, NULL, NULL }, /* 815 */ - { MA, 0, NULL, NULL }, /* 816 */ - { MA, 0, NULL, NULL }, /* 817 */ - { MA, 0, NULL, NULL }, /* 818 */ - { MA, 0, NULL, NULL }, /* 819 */ - { MA, 0, NULL, NULL }, /* 820 */ - { MA, 0, NULL, NULL }, /* 821 */ - { MA, 0, NULL, NULL }, /* 822 */ - { MA, 0, NULL, NULL }, /* 823 */ - { MA, 0, NULL, NULL }, /* 824 */ - { MA, 0, NULL, NULL }, /* 825 */ - { MA, 0, NULL, NULL }, /* 826 */ - { MA, 0, NULL, NULL }, /* 827 */ - { MA, 0, NULL, NULL }, /* 828 */ - { MA, 0, NULL, NULL }, /* 829 */ - { MA, 0, NULL, NULL }, /* 830 */ - { MA, 0, NULL, NULL }, /* 831 */ - { MA, 0, NULL, NULL }, /* 832 */ - { MA, 0, NULL, NULL }, /* 833 */ - { MA, 0, NULL, NULL }, /* 834 */ - { MA, 0, NULL, NULL }, /* 835 */ - { MA, 0, NULL, NULL }, /* 836 */ - { MA, 0, NULL, NULL }, /* 837 */ - { MA, 0, NULL, NULL }, /* 838 */ - { MA, 0, NULL, NULL }, /* 839 */ - { MA, 0, NULL, NULL }, /* 840 */ - { MA, 0, NULL, NULL }, /* 841 */ - { MA, 0, NULL, NULL }, /* 842 */ - { MA, 0, NULL, NULL }, /* 843 */ - { MA, 0, NULL, NULL }, /* 844 */ - { MA, 0, NULL, NULL }, /* 845 */ - { MA, 0, NULL, NULL }, /* 846 */ - { MA, 0, NULL, NULL }, /* 847 */ - { MA, 0, NULL, NULL }, /* 848 */ - { MA, 0, NULL, NULL }, /* 849 */ - { MA, 0, NULL, NULL }, /* 850 */ - { MA, 0, NULL, NULL }, /* 851 */ - { MA, 0, NULL, NULL }, /* 852 */ - { MA, 0, NULL, NULL }, /* 853 */ - { MA, 0, NULL, NULL }, /* 854 */ - { MA, 0, NULL, NULL }, /* 855 */ - { MA, 0, NULL, NULL }, /* 856 */ - { MA, 0, NULL, NULL }, /* 857 */ - { MA, 0, NULL, NULL }, /* 858 */ - { MA, 0, NULL, NULL }, /* 859 */ - { MA, 0, NULL, NULL }, /* 860 */ - { MA, 0, NULL, NULL }, /* 861 */ - { MA, 0, NULL, NULL }, /* 862 */ - { MA, 0, NULL, NULL }, /* 863 */ - { MA, 0, NULL, NULL }, /* 864 */ - { MA, 0, NULL, NULL }, /* 865 */ - { MA, 0, NULL, NULL }, /* 866 */ - { MA, 0, NULL, NULL }, /* 867 */ - { MA, 0, NULL, NULL }, /* 868 */ - { MA, 0, NULL, NULL }, /* 869 */ - { MA, 0, NULL, NULL }, /* 870 */ - { MA, 0, NULL, NULL }, /* 871 */ - { MA, 0, NULL, NULL }, /* 872 */ - { MA, 0, NULL, NULL }, /* 873 */ - { MA, 0, NULL, NULL }, /* 874 */ - { MA, 0, NULL, NULL }, /* 875 */ - { MA, 0, NULL, NULL }, /* 876 */ - { MA, 0, NULL, NULL }, /* 877 */ - { MA, 0, NULL, NULL }, /* 878 */ - { MA, 0, NULL, NULL }, /* 879 */ - { MA, 0, NULL, NULL }, /* 880 */ - { MA, 0, NULL, NULL }, /* 881 */ - { MA, 0, NULL, NULL }, /* 882 */ - { MA, 0, NULL, NULL }, /* 883 */ - { MA, 0, NULL, NULL }, /* 884 */ - { MA, 0, NULL, NULL }, /* 885 */ - { MA, 0, NULL, NULL }, /* 886 */ - { MA, 0, NULL, NULL }, /* 887 */ - { MA, 0, NULL, NULL }, /* 888 */ - { MA, 0, NULL, NULL }, /* 889 */ - { MA, 0, NULL, NULL }, /* 890 */ - { MA, 0, NULL, NULL }, /* 891 */ - { MA, 0, NULL, NULL }, /* 892 */ - { MA, 0, NULL, NULL }, /* 893 */ - { MA, 0, NULL, NULL }, /* 894 */ - { MA, 0, NULL, NULL }, /* 895 */ - { MA, 0, NULL, NULL }, /* 896 */ - { MA, 0, NULL, NULL }, /* 897 */ - { MA, 0, NULL, NULL }, /* 898 */ - { MA, 0, NULL, NULL }, /* 899 */ - { MA, 0, NULL, NULL }, /* 900 */ - { MA, 0, NULL, NULL }, /* 901 */ - { MA, 0, NULL, NULL }, /* 902 */ - { MA, 0, NULL, NULL }, /* 903 */ - { MA, 0, NULL, NULL }, /* 904 */ - { MA, 0, NULL, NULL }, /* 905 */ - { MA, 0, NULL, NULL }, /* 906 */ - { MA, 0, NULL, NULL }, /* 907 */ - { MA, 0, NULL, NULL }, /* 908 */ - { MA, 0, NULL, NULL }, /* 909 */ - { MA, 0, NULL, NULL }, /* 910 */ - { MA, 0, NULL, NULL }, /* 911 */ - { MA, 0, NULL, NULL }, /* 912 */ - { MA, 0, NULL, NULL }, /* 913 */ - { MA, 0, NULL, NULL }, /* 914 */ - { MA, 0, NULL, NULL }, /* 915 */ - { MA, 0, NULL, NULL }, /* 916 */ - { MA, 0, NULL, NULL }, /* 917 */ - { MA, 0, NULL, NULL }, /* 918 */ - { MA, 0, NULL, NULL }, /* 919 */ - { MA, 0, NULL, NULL }, /* 920 */ - { MA, 0, NULL, NULL }, /* 921 */ - { MA, 0, NULL, NULL }, /* 922 */ - { MA, 0, NULL, NULL }, /* 923 */ - { MA, 0, NULL, NULL }, /* 924 */ - { MA, 0, NULL, NULL }, /* 925 */ - { MA, 0, NULL, NULL }, /* 926 */ - { MA, 0, NULL, NULL }, /* 927 */ - { MA, 0, NULL, NULL }, /* 928 */ - { MA, 0, NULL, NULL }, /* 929 */ - { MA, 0, NULL, NULL }, /* 930 */ - { MA, 0, NULL, NULL }, /* 931 */ - { MA, 0, NULL, NULL }, /* 932 */ - { MA, 0, NULL, NULL }, /* 933 */ - { MA, 0, NULL, NULL }, /* 934 */ - { MA, 0, NULL, NULL }, /* 935 */ - { MA, 0, NULL, NULL }, /* 936 */ - { MA, 0, NULL, NULL }, /* 937 */ - { MA, 0, NULL, NULL }, /* 938 */ - { MA, 0, NULL, NULL }, /* 939 */ - { MA, 0, NULL, NULL }, /* 940 */ - { MA, 0, NULL, NULL }, /* 941 */ - { MA, 0, NULL, NULL }, /* 942 */ - { MA, 0, NULL, NULL }, /* 943 */ - { MA, 0, NULL, NULL }, /* 944 */ - { MA, 0, NULL, NULL }, /* 945 */ - { MA, 0, NULL, NULL }, /* 946 */ - { MA, 0, NULL, NULL }, /* 947 */ - { MA, 0, NULL, NULL }, /* 948 */ - { MA, 0, NULL, NULL }, /* 949 */ - { MA, 0, NULL, NULL }, /* 950 */ - { MA, 0, NULL, NULL }, /* 951 */ - { MA, 0, NULL, NULL }, /* 952 */ - { MA, 0, NULL, NULL }, /* 953 */ - { MA, 0, NULL, NULL }, /* 954 */ - { MA, 0, NULL, NULL }, /* 955 */ - { MA, 0, NULL, NULL }, /* 956 */ - { MA, 0, NULL, NULL }, /* 957 */ - { MA, 0, NULL, NULL }, /* 958 */ - { MA, 0, NULL, NULL }, /* 959 */ - { MA, 0, NULL, NULL }, /* 960 */ - { MA, 0, NULL, NULL }, /* 961 */ - { MA, 0, NULL, NULL }, /* 962 */ - { MA, 0, NULL, NULL }, /* 963 */ - { MA, 0, NULL, NULL }, /* 964 */ - { MA, 0, NULL, NULL }, /* 965 */ - { MA, 0, NULL, NULL }, /* 966 */ - { MA, 0, NULL, NULL }, /* 967 */ - { MA, 0, NULL, NULL }, /* 968 */ - { MA, 0, NULL, NULL }, /* 969 */ - { MA, 0, NULL, NULL }, /* 970 */ - { MA, 0, NULL, NULL }, /* 971 */ - { MA, 0, NULL, NULL }, /* 972 */ - { MA, 0, NULL, NULL }, /* 973 */ - { MA, 0, NULL, NULL }, /* 974 */ - { MA, 0, NULL, NULL }, /* 975 */ - { MA, 0, NULL, NULL }, /* 976 */ - { MA, 0, NULL, NULL }, /* 977 */ - { MA, 0, NULL, NULL }, /* 978 */ - { MA, 0, NULL, NULL }, /* 979 */ - { MA, 0, NULL, NULL }, /* 980 */ - { MA, 0, NULL, NULL }, /* 981 */ - { MA, 0, NULL, NULL }, /* 982 */ - { MA, 0, NULL, NULL }, /* 983 */ - { MA, 0, NULL, NULL }, /* 984 */ - { MA, 0, NULL, NULL }, /* 985 */ - { MA, 0, NULL, NULL }, /* 986 */ - { MA, 0, NULL, NULL }, /* 987 */ - { MA, 0, NULL, NULL }, /* 988 */ - { MA, 0, NULL, NULL }, /* 989 */ - { MA, 0, NULL, NULL }, /* 990 */ - { MA, 0, NULL, NULL }, /* 991 */ - { MA, 0, NULL, NULL }, /* 992 */ - { MA, 0, NULL, NULL }, /* 993 */ - { MA, 0, NULL, NULL }, /* 994 */ - { MA, 0, NULL, NULL }, /* 995 */ - { MA, 0, NULL, NULL }, /* 996 */ - { MA, 0, NULL, NULL }, /* 997 */ - { MA, 0, NULL, NULL }, /* 998 */ - { MA, 0, NULL, NULL }, /* 999 */ - { MA, 0, NULL, NULL }, /* 1000 */ - { MA, 0, NULL, NULL }, /* 1001 */ - { MA, 0, NULL, NULL }, /* 1002 */ - { MA, 0, NULL, NULL }, /* 1003 */ - { MA, 0, NULL, NULL }, /* 1004 */ - { MA, 0, NULL, NULL }, /* 1005 */ - { MA, 0, NULL, NULL }, /* 1006 */ - { MA, 0, NULL, NULL }, /* 1007 */ - { MA, 0, NULL, NULL }, /* 1008 */ - { MA, 0, NULL, NULL }, /* 1009 */ - { MA, 0, NULL, NULL }, /* 1010 */ - { MA, 0, NULL, NULL }, /* 1011 */ - { MA, 0, NULL, NULL }, /* 1012 */ - { MA, 0, NULL, NULL }, /* 1013 */ - { MA, 0, NULL, NULL }, /* 1014 */ - { MA, 0, NULL, NULL }, /* 1015 */ - { MA, 0, NULL, NULL }, /* 1016 */ - { MA, 0, NULL, NULL }, /* 1017 */ - { MA, 0, NULL, NULL }, /* 1018 */ - { MA, 0, NULL, NULL }, /* 1019 */ - { MA, 0, NULL, NULL }, /* 1020 */ - { MA, 0, NULL, NULL }, /* 1021 */ - { MA, 0, NULL, NULL }, /* 1022 */ - { MA, 0, NULL, NULL }, /* 1023 */ - { 0, 0, printargs, "ni_syscall" }, /* 1024 */ - { 1, TP|SE, sys_exit, "exit" }, /* 1025 */ - { 3, TD, sys_read, "read" }, /* 1026 */ - { 3, TD, sys_write, "write" }, /* 1027 */ - { 3, TD|TF, sys_open, "open" }, /* 1028 */ - { 1, TD, sys_close, "close" }, /* 1029 */ - { 2, TD|TF, sys_creat, "creat" }, /* 1030 */ - { 2, TF, sys_link, "link" }, /* 1031 */ - { 1, TF, sys_unlink, "unlink" }, /* 1032 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 1033 */ - { 1, TF, sys_chdir, "chdir" }, /* 1034 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 1035 */ - { 2, TF, sys_utimes, "utimes" }, /* 1036 */ - { 3, TF, sys_mknod, "mknod" }, /* 1037 */ - { 2, TF, sys_chmod, "chmod" }, /* 1038 */ - { 3, TF, sys_chown, "chown" }, /* 1039 */ - { 3, TD, sys_lseek, "lseek" }, /* 1040 */ - { 0, 0, sys_getpid, "getpid" }, /* 1041 */ - { 0, 0, sys_getppid, "getppid" }, /* 1042 */ - { 5, TF, sys_mount, "mount" }, /* 1043 */ - { 1, TF, sys_umount2, "umount" }, /* 1044 */ - { 1, 0, sys_setuid, "setuid" }, /* 1045 */ - { 0, NF, sys_getuid, "getuid" }, /* 1046 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 1047 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 1048 */ - { 2, TF, sys_access, "access" }, /* 1049 */ - { 0, 0, sys_sync, "sync" }, /* 1050 */ - { 1, TD, sys_fsync, "fsync" }, /* 1051 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 1052 */ - { 2, TS, sys_kill, "kill" }, /* 1053 */ - { 2, TF, sys_rename, "rename" }, /* 1054 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 1055 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 1056 */ - { 1, TD, sys_dup, "dup" }, /* 1057 */ - { 1, TD, sys_pipe, "pipe" }, /* 1058 */ - { 1, 0, sys_times, "times" }, /* 1059 */ - { 1, TM|SI, sys_brk, "brk" }, /* 1060 */ - { 1, 0, sys_setgid, "setgid" }, /* 1061 */ - { 0, NF, sys_getgid, "getgid" }, /* 1062 */ - { 0, NF, sys_getegid, "getegid" }, /* 1063 */ - { 1, TF, sys_acct, "acct" }, /* 1064 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 1065 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 1066 */ - { 1, 0, sys_umask, "umask" }, /* 1067 */ - { 1, TF, sys_chroot, "chroot" }, /* 1068 */ - { 2, 0, sys_ustat, "ustat" }, /* 1069 */ - { 2, TD, sys_dup2, "dup2" }, /* 1070 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 1071 */ - { 2, 0, sys_setregid, "setregid" }, /* 1072 */ - { 3, 0, printargs, "getresuid" }, /* 1073 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 1074 */ - { 3, 0, sys_getresuid, "getresgid" }, /* 1075 */ - { 3, 0, printargs, "setresgid" }, /* 1076 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 1077 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 1078 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 1079 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 1080 */ - { 0, 0, sys_setsid, "setsid" }, /* 1081 */ - { 1, 0, sys_getsid, "getsid" }, /* 1082 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 1083 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 1084 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 1085 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 1086 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 1087 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 1088 */ - { 5, TD, sys_select, "select" }, /* 1089 */ - { 3, TD, sys_poll, "poll" }, /* 1090 */ - { 2, TF, sys_symlink, "symlink" }, /* 1091 */ - { 3, TF, sys_readlink, "readlink" }, /* 1092 */ - { 1, TF, sys_uselib, "uselib" }, /* 1093 */ - { 2, TF, sys_swapon, "swapon" }, /* 1094 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 1095 */ - { 4, 0, sys_reboot, "reboot" }, /* 1096 */ - { 2, TF, sys_truncate, "truncate" }, /* 1097 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 1098 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 1099 */ - { 3, TD, sys_fchown, "fchown" }, /* 1100 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 1101 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 1102 */ - { 2, TF, sys_statfs, "statfs" }, /* 1103 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 1104 */ - { 3, 0, sys_gettid, "gettid" }, /* 1105 */ - { 3, TI, sys_semget, "semget" }, /* 1106 */ - { 3, TI, printargs, "semop" }, /* 1107 */ - { 4, TI, sys_semctl, "semctl" }, /* 1108 */ - { 2, TI, sys_msgget, "msgget" }, /* 1109 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 1110 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 1111 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 1112 */ - { 3, TI, sys_shmget, "shmget" }, /* 1113 */ - { 3, TI|TM|SI, sys_shmat, "shmat" }, /* 1114 */ - { 1, TI|TM|SI, sys_shmdt, "shmdt" }, /* 1115 */ - { 3, TI, sys_shmctl, "shmctl" }, /* 1116 */ - { 3, 0, sys_syslog, "syslog" }, /* 1117 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 1118 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 1119 */ - { 2, TF, sys_stat, "stat" }, /* 1120 */ - { 2, TF, sys_lstat, "lstat" }, /* 1121 */ - { 2, TD, sys_fstat, "fstat" }, /* 1122 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 1123 */ - { 3, TF, sys_chown, "lchown" }, /* 1124 */ - { 5, 0, sys_vm86, "vm86" }, /* 1125 */ - { 4, TP, sys_wait4, "wait4" }, /* 1126 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 1127 */ - { 5, TP, sys_clone, "clone" }, /* 1128 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 1129 */ - { 1, 0, sys_uname, "uname" }, /* 1130 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 1131 */ - { 2, 0, sys_create_module, "create_module" }, /* 1132 */ - { 4, 0, sys_init_module, "init_module" }, /* 1133 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 1134 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 1135 */ - { 5, 0, sys_query_module, "query_module" }, /* 1136 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 1137 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 1138 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 1139 */ - { 1, 0, sys_personality, "personality" }, /* 1140 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 1141 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 1142 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 1143 */ - { 3, TD, sys_getdents, "getdents" }, /* 1144 */ - { 2, TD, sys_flock, "flock" }, /* 1145 */ - { 5, TD, sys_readv, "readv" }, /* 1146 */ - { 5, TD, sys_writev, "writev" }, /* 1147 */ - { 4, TD, sys_pread, "pread" }, /* 1148 */ - { 4, TD, sys_pwrite, "pwrite" }, /* 1149 */ - { 1, 0, printargs, "_sysctl" }, /* 1150 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 1151 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 1152 */ - { 2, TM, sys_mlock, "mlock" }, /* 1153 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 1154 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 1155 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 1156 */ - { 3, TM, sys_msync, "msync" }, /* 1157 */ - { 2, TM, sys_munlock, "munlock" }, /* 1158 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 1159 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 1160 */ - { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 1161 */ - { 2, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 1162 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 1163 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 1164 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 1165 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 1166 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 1167 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 1168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 1169 */ - { 5, 0, sys_prctl, "prctl" }, /* 1170 */ - { 1, 0, sys_getpagesize, "getpagesize" }, /* 1171 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 1172 */ - { 5, 0, printargs, "pciconfig_read"}, /* 1173 */ - { 5, 0, printargs, "pciconfig_write"}, /* 1174 */ - { MA, 0, printargs, "perfmonctl" }, /* 1175 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 1176 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 1177 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 1178 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 1179 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 1180 */ - { 0, TS, sys_sigreturn, "rt_sigreturn" }, /* 1181 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 1182 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 1183 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 1184 */ - { 2, 0, sys_capget, "capget" }, /* 1185 */ - { 2, 0, sys_capset, "capset" }, /* 1186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 1187 */ - { 5, TN, printargs, "getpmsg" }, /* 1188 */ - { 5, TN, printargs, "putpmsg" }, /* 1189 */ - { 3, TN, sys_socket, "socket" }, /* 1190 */ - { 3, TN, sys_bind, "bind" }, /* 1191 */ - { 3, TN, sys_connect, "connect" }, /* 1192 */ - { 2, TN, sys_listen, "listen" }, /* 1193 */ - { 3, TN, sys_accept, "accept" }, /* 1194 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 1195 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 1196 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 1197 */ - { 4, TN, sys_send, "send" }, /* 1198 */ - { 6, TN, sys_sendto, "sendto" }, /* 1199 */ - { 4, TN, sys_recv, "recv" }, /* 1200 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 1201 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 1202 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 1203 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 1204 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 1205 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 1206 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 1207 */ - { 3, TM, sys_mincore, "mincore" }, /* 1208 */ - { 3, TM, sys_madvise, "madvise" }, /* 1209 */ - { 2, TF, sys_stat, "stat" }, /* 1210 */ - { 2, TF, sys_lstat, "lstat" }, /* 1211 */ - { 2, TD, sys_fstat, "fstat" }, /* 1212 */ - { 6, TP, sys_clone, "clone2" }, /* 1213 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 1214 */ - { 2, 0, printargs, "getunwind" }, /* 1215 */ - { 3, TD, sys_readahead, "readahead" }, /* 1216 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 1217 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 1218 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 1219 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 1220 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 1221 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 1222 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 1223 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 1224 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 1225 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 1226 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 1227 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 1228 */ - { 2, TS, sys_kill, "tkill" }, /* 1229 */ - { 6, 0, sys_futex, "futex" }, /* 1230 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"},/* 1231 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"},/* 1232 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 1233 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 1234 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 1235 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 1236 */ - { 3, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 1237 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 1238 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 1239 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 1240 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 1241 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 1242 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 1243 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 1244 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 1245 */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 1246 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 1247 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 1248 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 1249 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 1250 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 1251 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 1252 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 1253 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 1254 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 1255 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 1256 */ - { MA, 0, printargs, "fstatfs64" }, /* 1257 */ - { MA, 0, printargs, "statfs64" }, /* 1258 */ - { 6, TM, sys_mbind, "mbind" }, /* 1259 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 1260 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 1261 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 1262 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 1263 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 1264 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 1265 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 1266 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 1267 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 1268 */ - { 5, 0, sys_vserver, "vserver" }, /* 1269 */ - { 5, TP, sys_waitid, "waitid" }, /* 1270 */ - { 5, 0, sys_add_key, "add_key" }, /* 1271 */ - { 4, 0, sys_request_key, "request_key" }, /* 1272 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 1273 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 1274 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 1275 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 1276 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 1277 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 1278 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 1279 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 1280 */ - { 4, TD|TF, sys_openat, "openat" }, /* 1281 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 1282 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 1283 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 1284 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 1285 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 1286 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 1287 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 1288 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 1289 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 1290 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 1291 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 1292 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 1293 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 1294 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 1295 */ - { 1, TP, sys_unshare, "unshare" }, /* 1296 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 1297 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 1298 */ - { 6, TD, sys_splice, "splice" }, /* 1299 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 1300 */ - { 4, TD, sys_tee, "tee" }, /* 1301 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 1302 */ - { MA, 0, NULL, NULL }, /* 1303 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 1304 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 1305 */ - { MA, 0, NULL, NULL }, /* 1306 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 1307 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 1308 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 1309 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 1310 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 1311 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 1312 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 1313 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 1314 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 1315 */ - { 3, TD, sys_dup3, "dup3" }, /* 1316 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 1317 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 1318 */ - { 4, TD, sys_preadv, "preadv" }, /* 1319 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 1320 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 1321 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 1322 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 1323 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 1324 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 1325 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 1326 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 1327 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 1328 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 1329 */ - { 2, TD, sys_setns, "setns" }, /* 1330 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 1331 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 1332 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 1333 */ - { 4, TN, sys_accept4, "accept4" }, /* 1334 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 1335 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 1336 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 1337 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 1338 */ +[1024] = { 0, 0, SEN(printargs), "ni_syscall" }, +[1025] = { 1, TP|SE, SEN(exit), "exit" }, +[1026] = { 3, TD, SEN(read), "read" }, +[1027] = { 3, TD, SEN(write), "write" }, +[1028] = { 3, TD|TF, SEN(open), "open" }, +[1029] = { 1, TD, SEN(close), "close" }, +[1030] = { 2, TD|TF, SEN(creat), "creat" }, +[1031] = { 2, TF, SEN(link), "link" }, +[1032] = { 1, TF, SEN(unlink), "unlink" }, +[1033] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[1034] = { 1, TF, SEN(chdir), "chdir" }, +[1035] = { 1, TD, SEN(fchdir), "fchdir" }, +[1036] = { 2, TF, SEN(utimes), "utimes" }, +[1037] = { 3, TF, SEN(mknod), "mknod" }, +[1038] = { 2, TF, SEN(chmod), "chmod" }, +[1039] = { 3, TF, SEN(chown), "chown" }, +[1040] = { 3, TD, SEN(lseek), "lseek" }, +[1041] = { 0, NF, SEN(getpid), "getpid" }, +[1042] = { 0, NF, SEN(getppid), "getppid" }, +[1043] = { 5, TF, SEN(mount), "mount" }, +[1044] = { 2, TF, SEN(umount2), "umount" }, +[1045] = { 1, 0, SEN(setuid), "setuid" }, +[1046] = { 0, NF, SEN(getuid), "getuid" }, +[1047] = { 0, NF, SEN(geteuid), "geteuid" }, +[1048] = { 4, 0, SEN(ptrace), "ptrace" }, +[1049] = { 2, TF, SEN(access), "access" }, +[1050] = { 0, 0, SEN(sync), "sync" }, +[1051] = { 1, TD, SEN(fsync), "fsync" }, +[1052] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[1053] = { 2, TS, SEN(kill), "kill" }, +[1054] = { 2, TF, SEN(rename), "rename" }, +[1055] = { 2, TF, SEN(mkdir), "mkdir" }, +[1056] = { 1, TF, SEN(rmdir), "rmdir" }, +[1057] = { 1, TD, SEN(dup), "dup" }, +[1058] = { 0, TD, SEN(pipe), "pipe" }, +[1059] = { 1, 0, SEN(times), "times" }, +[1060] = { 1, TM|SI, SEN(brk), "brk" }, +[1061] = { 1, 0, SEN(setgid), "setgid" }, +[1062] = { 0, NF, SEN(getgid), "getgid" }, +[1063] = { 0, NF, SEN(getegid), "getegid" }, +[1064] = { 1, TF, SEN(acct), "acct" }, +[1065] = { 3, TD, SEN(ioctl), "ioctl" }, +[1066] = { 3, TD, SEN(fcntl), "fcntl" }, +[1067] = { 1, NF, SEN(umask), "umask" }, +[1068] = { 1, TF, SEN(chroot), "chroot" }, +[1069] = { 2, 0, SEN(ustat), "ustat" }, +[1070] = { 2, TD, SEN(dup2), "dup2" }, +[1071] = { 2, 0, SEN(setreuid), "setreuid" }, +[1072] = { 2, 0, SEN(setregid), "setregid" }, +[1073] = { 3, 0, SEN(getresuid), "getresuid" }, +[1074] = { 3, 0, SEN(setresuid), "setresuid" }, +[1075] = { 3, 0, SEN(getresgid), "getresgid" }, +[1076] = { 3, 0, SEN(setresgid), "setresgid" }, +[1077] = { 2, 0, SEN(getgroups), "getgroups" }, +[1078] = { 2, 0, SEN(setgroups), "setgroups" }, +[1079] = { 1, 0, SEN(getpgid), "getpgid" }, +[1080] = { 2, 0, SEN(setpgid), "setpgid" }, +[1081] = { 0, 0, SEN(setsid), "setsid" }, +[1082] = { 1, 0, SEN(getsid), "getsid" }, +[1083] = { 2, 0, SEN(sethostname), "sethostname" }, +[1084] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[1085] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[1086] = { 2, 0, SEN(getrusage), "getrusage" }, +[1087] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[1088] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[1089] = { 5, TD, SEN(select), "select" }, +[1090] = { 3, TD, SEN(poll), "poll" }, +[1091] = { 2, TF, SEN(symlink), "symlink" }, +[1092] = { 3, TF, SEN(readlink), "readlink" }, +[1093] = { 1, TF, SEN(uselib), "uselib" }, +[1094] = { 2, TF, SEN(swapon), "swapon" }, +[1095] = { 1, TF, SEN(swapoff), "swapoff" }, +[1096] = { 4, 0, SEN(reboot), "reboot" }, +[1097] = { 2, TF, SEN(truncate), "truncate" }, +[1098] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[1099] = { 2, TD, SEN(fchmod), "fchmod" }, +[1100] = { 3, TD, SEN(fchown), "fchown" }, +[1101] = { 2, 0, SEN(getpriority), "getpriority" }, +[1102] = { 3, 0, SEN(setpriority), "setpriority" }, +[1103] = { 2, TF, SEN(statfs), "statfs" }, +[1104] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[1105] = { 0, NF, SEN(gettid), "gettid" }, +[1106] = { 3, TI, SEN(semget), "semget" }, +[1107] = { 3, TI, SEN(semop), "semop" }, +[1108] = { 4, TI, SEN(semctl), "semctl" }, +[1109] = { 2, TI, SEN(msgget), "msgget" }, +[1110] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[1111] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[1112] = { 3, TI, SEN(msgctl), "msgctl" }, +[1113] = { 3, TI, SEN(shmget), "shmget" }, +[1114] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[1115] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[1116] = { 3, TI, SEN(shmctl), "shmctl" }, +[1117] = { 3, 0, SEN(syslog), "syslog" }, +[1118] = { 3, 0, SEN(setitimer), "setitimer" }, +[1119] = { 2, 0, SEN(getitimer), "getitimer" }, +[1120] = { 2, TF, SEN(stat), "stat" }, +[1121] = { 2, TF, SEN(lstat), "lstat" }, +[1122] = { 2, TD, SEN(fstat), "fstat" }, +[1123] = { 0, 0, SEN(vhangup), "vhangup" }, +[1124] = { 3, TF, SEN(chown), "lchown" }, +[1125] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[1126] = { 4, TP, SEN(wait4), "wait4" }, +[1127] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[1128] = { 5, TP, SEN(clone), "clone" }, +[1129] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[1130] = { 1, 0, SEN(uname), "uname" }, +[1131] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[1132] = { 2, 0, SEN(create_module), "create_module" }, +[1133] = { 3, 0, SEN(init_module), "init_module" }, +[1134] = { 2, 0, SEN(delete_module), "delete_module" }, +[1135] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[1136] = { 5, 0, SEN(query_module), "query_module" }, +[1137] = { 4, TF, SEN(quotactl), "quotactl" }, +[1138] = { 2, 0, SEN(bdflush), "bdflush" }, +[1139] = { 3, 0, SEN(sysfs), "sysfs" }, +[1140] = { 1, NF, SEN(personality), "personality" }, +[1141] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[1142] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[1143] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[1144] = { 3, TD, SEN(getdents), "getdents" }, +[1145] = { 2, TD, SEN(flock), "flock" }, +[1146] = { 3, TD, SEN(readv), "readv" }, +[1147] = { 3, TD, SEN(writev), "writev" }, +[1148] = { 4, TD, SEN(pread), "pread64" }, +[1149] = { 4, TD, SEN(pwrite), "pwrite64" }, +[1150] = { 1, 0, SEN(printargs), "_sysctl" }, +[1151] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[1152] = { 2, TM|SI, SEN(munmap), "munmap" }, +[1153] = { 2, TM, SEN(mlock), "mlock" }, +[1154] = { 1, TM, SEN(mlockall), "mlockall" }, +[1155] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[1156] = { 5, TM|SI, SEN(mremap), "mremap" }, +[1157] = { 3, TM, SEN(msync), "msync" }, +[1158] = { 2, TM, SEN(munlock), "munlock" }, +[1159] = { 0, TM, SEN(munlockall), "munlockall" }, +[1160] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[1161] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[1162] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[1163] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[1164] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[1165] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[1166] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[1167] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[1168] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[1169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[1170] = { 5, 0, SEN(prctl), "prctl" }, +[1171] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[1172] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[1173] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[1174] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[1175] = { MA, 0, SEN(printargs), "perfmonctl" }, +[1176] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[1177] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[1178] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[1179] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[1180] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[1181] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[1182] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[1183] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[1184] = { 2, TF, SEN(getcwd), "getcwd" }, +[1185] = { 2, 0, SEN(capget), "capget" }, +[1186] = { 2, 0, SEN(capset), "capset" }, +[1187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[1188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[1189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[1190] = { 3, TN, SEN(socket), "socket" }, +[1191] = { 3, TN, SEN(bind), "bind" }, +[1192] = { 3, TN, SEN(connect), "connect" }, +[1193] = { 2, TN, SEN(listen), "listen" }, +[1194] = { 3, TN, SEN(accept), "accept" }, +[1195] = { 3, TN, SEN(getsockname), "getsockname" }, +[1196] = { 3, TN, SEN(getpeername), "getpeername" }, +[1197] = { 4, TN, SEN(socketpair), "socketpair" }, +[1198] = { 4, TN, SEN(send), "send" }, +[1199] = { 6, TN, SEN(sendto), "sendto" }, +[1200] = { 4, TN, SEN(recv), "recv" }, +[1201] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[1202] = { 2, TN, SEN(shutdown), "shutdown" }, +[1203] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[1204] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[1205] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[1206] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[1207] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[1208] = { 3, TM, SEN(mincore), "mincore" }, +[1209] = { 3, TM, SEN(madvise), "madvise" }, +[1210] = { 2, TF, SEN(stat), "stat" }, +[1211] = { 2, TF, SEN(lstat), "lstat" }, +[1212] = { 2, TD, SEN(fstat), "fstat" }, +[1213] = { 6, TP, SEN(clone), "clone2" }, +[1214] = { 3, TD, SEN(getdents64), "getdents64" }, +[1215] = { 2, 0, SEN(printargs), "getunwind" }, +[1216] = { 3, TD, SEN(readahead), "readahead" }, +[1217] = { 5, TF, SEN(setxattr), "setxattr" }, +[1218] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[1219] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[1220] = { 4, TF, SEN(getxattr), "getxattr" }, +[1221] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[1222] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[1223] = { 3, TF, SEN(listxattr), "listxattr" }, +[1224] = { 3, TF, SEN(listxattr), "llistxattr" }, +[1225] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[1226] = { 2, TF, SEN(removexattr), "removexattr" }, +[1227] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[1228] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[1229] = { 2, TS, SEN(kill), "tkill" }, +[1230] = { 6, 0, SEN(futex), "futex" }, +[1231] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[1232] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[1233] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[1234] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[1235] = { 3, TS, SEN(tgkill), "tgkill" }, +[1236] = { 1, TP|SE, SEN(exit), "exit_group" }, +[1237] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[1238] = { 2, TM, SEN(io_setup), "io_setup" }, +[1239] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[1240] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[1241] = { 3, 0, SEN(io_submit), "io_submit" }, +[1242] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[1243] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[1244] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[1245] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[1246] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[1247] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[1248] = { 3, 0, SEN(timer_create), "timer_create" }, +[1249] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[1250] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[1251] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[1252] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[1253] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[1254] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[1255] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[1256] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[1257] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[1258] = { 3, TF, SEN(statfs64), "statfs64" }, +[1259] = { 6, TM, SEN(mbind), "mbind" }, +[1260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[1261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[1262] = { 4, 0, SEN(mq_open), "mq_open" }, +[1263] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[1264] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[1265] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[1266] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[1267] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[1268] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[1269] = { 5, 0, SEN(vserver), "vserver" }, +[1270] = { 5, TP, SEN(waitid), "waitid" }, +[1271] = { 5, 0, SEN(add_key), "add_key" }, +[1272] = { 4, 0, SEN(request_key), "request_key" }, +[1273] = { 5, 0, SEN(keyctl), "keyctl" }, +[1274] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[1275] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[1276] = { 6, TM, SEN(move_pages), "move_pages" }, +[1277] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[1278] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[1279] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[1280] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[1281] = { 4, TD|TF, SEN(openat), "openat" }, +[1282] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[1283] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[1284] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[1285] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[1286] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[1287] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[1288] = { 4, TD|TF, SEN(renameat), "renameat" }, +[1289] = { 5, TD|TF, SEN(linkat), "linkat" }, +[1290] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[1291] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[1292] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[1293] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[1294] = { 6, TD, SEN(pselect6), "pselect6" }, +[1295] = { 5, TD, SEN(ppoll), "ppoll" }, +[1296] = { 1, TP, SEN(unshare), "unshare" }, +[1297] = { 6, TD, SEN(splice), "splice" }, +[1298] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[1299] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[1300] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[1301] = { 4, TD, SEN(tee), "tee" }, +[1302] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[1303] = { 4, TD, SEN(fallocate), "fallocate" }, +[1304] = { 3, 0, SEN(getcpu), "getcpu" }, +[1305] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[1306] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[1307] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[1308] = { 4, TD, SEN(timerfd), "timerfd" }, +[1309] = { 1, TD, SEN(eventfd), "eventfd" }, +[1310] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[1311] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[1312] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[1313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[1314] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[1315] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[1316] = { 3, TD, SEN(dup3), "dup3" }, +[1317] = { 2, TD, SEN(pipe2), "pipe2" }, +[1318] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[1319] = { 4, TD, SEN(preadv), "preadv" }, +[1320] = { 4, TD, SEN(pwritev), "pwritev" }, +[1321] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[1322] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[1323] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[1324] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[1325] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[1326] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[1327] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[1328] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[1329] = { 1, TD, SEN(syncfs), "syncfs" }, +[1330] = { 2, TD, SEN(setns), "setns" }, +[1331] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[1332] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[1333] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[1334] = { 4, TN, SEN(accept4), "accept4" }, +[1335] = { 3, TD, SEN(finit_module), "finit_module" }, +[1336] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[1337] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[1338] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[1339] = { 3, 0, SEN(getrandom), "getrandom" }, +[1340] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[1341] = { 3, TD, SEN(bpf), "bpf" }, +[1342] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[1343] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[1344] = { 2, 0, SEN(membarrier), "membarrier" }, +[1345] = { 5, 0, SEN(kcmp), "kcmp" }, +[1346] = { 3, TM, SEN(mlock2), "mlock2" }, +[1347] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[1348] = { 6, TD, SEN(preadv2), "preadv2" }, +[1349] = { 6, TD, SEN(pwritev2), "pwritev2" }, diff --git a/linux/ia64/userent.h b/linux/ia64/userent.h new file mode 100644 index 00000000..d2ffae6f --- /dev/null +++ b/linux/ia64/userent.h @@ -0,0 +1,73 @@ +{ PT_F32, "f32" }, { PT_F33, "f33" }, { PT_F34, "f34" }, +{ PT_F35, "f35" }, { PT_F36, "f36" }, { PT_F37, "f37" }, +{ PT_F38, "f38" }, { PT_F39, "f39" }, { PT_F40, "f40" }, +{ PT_F41, "f41" }, { PT_F42, "f42" }, { PT_F43, "f43" }, +{ PT_F44, "f44" }, { PT_F45, "f45" }, { PT_F46, "f46" }, +{ PT_F47, "f47" }, { PT_F48, "f48" }, { PT_F49, "f49" }, +{ PT_F50, "f50" }, { PT_F51, "f51" }, { PT_F52, "f52" }, +{ PT_F53, "f53" }, { PT_F54, "f54" }, { PT_F55, "f55" }, +{ PT_F56, "f56" }, { PT_F57, "f57" }, { PT_F58, "f58" }, +{ PT_F59, "f59" }, { PT_F60, "f60" }, { PT_F61, "f61" }, +{ PT_F62, "f62" }, { PT_F63, "f63" }, { PT_F64, "f64" }, +{ PT_F65, "f65" }, { PT_F66, "f66" }, { PT_F67, "f67" }, +{ PT_F68, "f68" }, { PT_F69, "f69" }, { PT_F70, "f70" }, +{ PT_F71, "f71" }, { PT_F72, "f72" }, { PT_F73, "f73" }, +{ PT_F74, "f74" }, { PT_F75, "f75" }, { PT_F76, "f76" }, +{ PT_F77, "f77" }, { PT_F78, "f78" }, { PT_F79, "f79" }, +{ PT_F80, "f80" }, { PT_F81, "f81" }, { PT_F82, "f82" }, +{ PT_F83, "f83" }, { PT_F84, "f84" }, { PT_F85, "f85" }, +{ PT_F86, "f86" }, { PT_F87, "f87" }, { PT_F88, "f88" }, +{ PT_F89, "f89" }, { PT_F90, "f90" }, { PT_F91, "f91" }, +{ PT_F92, "f92" }, { PT_F93, "f93" }, { PT_F94, "f94" }, +{ PT_F95, "f95" }, { PT_F96, "f96" }, { PT_F97, "f97" }, +{ PT_F98, "f98" }, { PT_F99, "f99" }, { PT_F100, "f100" }, +{ PT_F101, "f101" }, { PT_F102, "f102" }, { PT_F103, "f103" }, +{ PT_F104, "f104" }, { PT_F105, "f105" }, { PT_F106, "f106" }, +{ PT_F107, "f107" }, { PT_F108, "f108" }, { PT_F109, "f109" }, +{ PT_F110, "f110" }, { PT_F111, "f111" }, { PT_F112, "f112" }, +{ PT_F113, "f113" }, { PT_F114, "f114" }, { PT_F115, "f115" }, +{ PT_F116, "f116" }, { PT_F117, "f117" }, { PT_F118, "f118" }, +{ PT_F119, "f119" }, { PT_F120, "f120" }, { PT_F121, "f121" }, +{ PT_F122, "f122" }, { PT_F123, "f123" }, { PT_F124, "f124" }, +{ PT_F125, "f125" }, { PT_F126, "f126" }, { PT_F127, "f127" }, +/* switch stack: */ +{ PT_F2, "f2" }, { PT_F3, "f3" }, { PT_F4, "f4" }, +{ PT_F5, "f5" }, { PT_F10, "f10" }, { PT_F11, "f11" }, +{ PT_F12, "f12" }, { PT_F13, "f13" }, { PT_F14, "f14" }, +{ PT_F15, "f15" }, { PT_F16, "f16" }, { PT_F17, "f17" }, +{ PT_F18, "f18" }, { PT_F19, "f19" }, { PT_F20, "f20" }, +{ PT_F21, "f21" }, { PT_F22, "f22" }, { PT_F23, "f23" }, +{ PT_F24, "f24" }, { PT_F25, "f25" }, { PT_F26, "f26" }, +{ PT_F27, "f27" }, { PT_F28, "f28" }, { PT_F29, "f29" }, +{ PT_F30, "f30" }, { PT_F31, "f31" }, { PT_R4, "r4" }, +{ PT_R5, "r5" }, { PT_R6, "r6" }, { PT_R7, "r7" }, +{ PT_B1, "b1" }, { PT_B2, "b2" }, { PT_B3, "b3" }, +{ PT_B4, "b4" }, { PT_B5, "b5" }, +{ PT_AR_EC, "ar.ec" }, { PT_AR_LC, "ar.lc" }, +/* pt_regs */ +{ PT_CR_IPSR, "psr" }, { PT_CR_IIP, "ip" }, +{ PT_CFM, "cfm" }, { PT_AR_UNAT, "ar.unat" }, +{ PT_AR_PFS, "ar.pfs" }, { PT_AR_RSC, "ar.rsc" }, +{ PT_AR_RNAT, "ar.rnat" }, { PT_AR_BSPSTORE, "ar.bspstore" }, +{ PT_PR, "pr" }, { PT_B6, "b6" }, { PT_AR_BSP, "ar.bsp" }, +{ PT_R1, "r1" }, { PT_R2, "r2" }, { PT_R3, "r3" }, +{ PT_R12, "r12" }, { PT_R13, "r13" }, { PT_R14, "r14" }, +{ PT_R15, "r15" }, { PT_R8, "r8" }, { PT_R9, "r9" }, +{ PT_R10, "r10" }, { PT_R11, "r11" }, { PT_R16, "r16" }, +{ PT_R17, "r17" }, { PT_R18, "r18" }, { PT_R19, "r19" }, +{ PT_R20, "r20" }, { PT_R21, "r21" }, { PT_R22, "r22" }, +{ PT_R23, "r23" }, { PT_R24, "r24" }, { PT_R25, "r25" }, +{ PT_R26, "r26" }, { PT_R27, "r27" }, { PT_R28, "r28" }, +{ PT_R29, "r29" }, { PT_R30, "r30" }, { PT_R31, "r31" }, +{ PT_AR_CCV, "ar.ccv" }, { PT_AR_FPSR, "ar.fpsr" }, +{ PT_B0, "b0" }, { PT_B7, "b7" }, { PT_F6, "f6" }, +{ PT_F7, "f7" }, { PT_F8, "f8" }, { PT_F9, "f9" }, +#ifdef PT_AR_CSD +{ PT_AR_CSD, "ar.csd" }, +#endif +#ifdef PT_AR_SSD +{ PT_AR_SSD, "ar.ssd" }, +#endif +{ PT_DBR, "dbr" }, { PT_IBR, "ibr" }, { PT_PMD, "pmd" }, +/* Other fields in "struct user" */ +#include "../userent0.h" diff --git a/linux/inet_diag.h b/linux/inet_diag.h new file mode 100644 index 00000000..69012af0 --- /dev/null +++ b/linux/inet_diag.h @@ -0,0 +1,43 @@ +#ifndef STRACE_LINUX_INET_DIAG_H +#define STRACE_LINUX_INET_DIAG_H + +#define TCPDIAG_GETSOCK 18 +#define DCCPDIAG_GETSOCK 19 + +/* Socket identity */ +struct inet_diag_sockid { + uint16_t idiag_sport; + uint16_t idiag_dport; + uint32_t idiag_src[4]; + uint32_t idiag_dst[4]; + uint32_t idiag_if; + uint32_t idiag_cookie[2]; +}; + +/* Request structure */ +struct inet_diag_req_v2 { + uint8_t sdiag_family; + uint8_t sdiag_protocol; + uint8_t idiag_ext; + uint8_t pad; + uint32_t idiag_states; + struct inet_diag_sockid id; +}; + +/* Info structure */ +struct inet_diag_msg { + uint8_t idiag_family; + uint8_t idiag_state; + uint8_t idiag_timer; + uint8_t idiag_retrans; + + struct inet_diag_sockid id; + + uint32_t idiag_expires; + uint32_t idiag_rqueue; + uint32_t idiag_wqueue; + uint32_t idiag_uid; + uint32_t idiag_inode; +}; + +#endif /* !STRACE_LINUX_INET_DIAG_H */ diff --git a/linux/inotify.h b/linux/inotify.h deleted file mode 100644 index 0af03078..00000000 --- a/linux/inotify.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Inode based directory notification for Linux - * - * Copyright (C) 2005 John McCutchan - */ - -#ifndef _LINUX_INOTIFY_H -#define _LINUX_INOTIFY_H - -/* the following are legal, implemented events that user-space can watch for */ -#define IN_ACCESS 0x00000001 /* File was accessed */ -#define IN_MODIFY 0x00000002 /* File was modified */ -#define IN_ATTRIB 0x00000004 /* Metadata changed */ -#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */ -#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ -#define IN_OPEN 0x00000020 /* File was opened */ -#define IN_MOVED_FROM 0x00000040 /* File was moved from X */ -#define IN_MOVED_TO 0x00000080 /* File was moved to Y */ -#define IN_CREATE 0x00000100 /* Subfile was created */ -#define IN_DELETE 0x00000200 /* Subfile was deleted */ -#define IN_DELETE_SELF 0x00000400 /* Self was deleted */ -#define IN_MOVE_SELF 0x00000800 /* Self was moved */ - -/* the following are legal events. they are sent as needed to any watch */ -#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ -#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ -#define IN_IGNORED 0x00008000 /* File was ignored */ - -/* helper events */ -#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */ -#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ - -/* special flags */ -#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */ -#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */ -#define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */ -#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ -#define IN_ISDIR 0x40000000 /* event occurred against dir */ -#define IN_ONESHOT 0x80000000 /* only send event once */ - - -#endif /* _LINUX_INOTIFY_H */ diff --git a/linux/ioctlent-filter.awk b/linux/ioctlent-filter.awk deleted file mode 100644 index 181c4bf7..00000000 --- a/linux/ioctlent-filter.awk +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/awk -f -# Filter out redundant "*32" symbols. - -BEGIN { - s="" - c="" -} - -NF == 3 && $2 ~ /^"[^",]*",$/ { - if ($2 == s && $3 == c) - next - s = $2 - sub(/",$/, "32\",", s) - c = $3 -} - -{ - print -} diff --git a/linux/ioctlent.h.in b/linux/ioctlent.h.in deleted file mode 100644 index 9b2bd72c..00000000 --- a/linux/ioctlent.h.in +++ /dev/null @@ -1,1763 +0,0 @@ - /* Generated by ioctlsort */ - {"linux/fs.h", "FIBMAP", 0x0001}, - {"linux/fs.h", "FIGETBSZ", 0x0002}, - {"linux/fd.h", "FDGETPRM", 0x0204}, - {"linux/fd.h", "FDGETMAXERRS", 0x020e}, - {"linux/fd.h", "FDGETDRVTYP", 0x020f}, - {"linux/fd.h", "FDGETDRVPRM", 0x0211}, - {"linux/fd.h", "FDGETDRVSTAT", 0x0212}, - {"linux/fd.h", "FDPOLLDRVSTAT", 0x0213}, - {"linux/fd.h", "FDGETFDCSTAT", 0x0215}, - {"linux/fd.h", "FDWERRORGET", 0x0217}, - {"linux/fd.h", "FDCLRPRM", 0x0241}, - {"linux/fd.h", "FDSETPRM", 0x0242}, - {"linux/fd.h", "FDDEFPRM", 0x0243}, - {"linux/fd.h", "FDMSGON", 0x0245}, - {"linux/fd.h", "FDMSGOFF", 0x0246}, - {"linux/fd.h", "FDFMTBEG", 0x0247}, - {"linux/fd.h", "FDFMTTRK", 0x0248}, - {"linux/fd.h", "FDFMTEND", 0x0249}, - {"linux/fd.h", "FDSETEMSGTRESH", 0x024a}, - {"linux/fd.h", "FDFLUSH", 0x024b}, - {"linux/fd.h", "FDSETMAXERRS", 0x024c}, - {"linux/fd.h", "FDRESET", 0x0254}, - {"linux/fd.h", "FDWERRORCLR", 0x0256}, - {"linux/fd.h", "FDRAWCMD", 0x0258}, - {"linux/fd.h", "FDTWADDLE", 0x0259}, - {"linux/fd.h", "FDEJECT", 0x025a}, - {"linux/fd.h", "FDSETDRVPRM", 0x0290}, - {"linux/hdreg.h", "HDIO_GETGEO", 0x0301}, - {"linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0x0302}, - {"linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0x0304}, - {"linux/hdreg.h", "HDIO_GET_QDMA", 0x0305}, - {"linux/hdreg.h", "HDIO_SET_XFER", 0x0306}, - {"linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0x0307}, - {"linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0x0308}, - {"linux/hdreg.h", "HDIO_GET_32BIT", 0x0309}, - {"linux/hdreg.h", "HDIO_GET_NOWERR", 0x030a}, - {"linux/hdreg.h", "HDIO_GET_DMA", 0x030b}, - {"linux/hdreg.h", "HDIO_GET_NICE", 0x030c}, - {"linux/hdreg.h", "HDIO_GET_IDENTITY", 0x030d}, - {"linux/hdreg.h", "HDIO_GET_WCACHE", 0x030e}, - {"linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0x030f}, - {"linux/hdreg.h", "HDIO_GET_ADDRESS", 0x0310}, - {"linux/hdreg.h", "HDIO_GET_BUSSTATE", 0x031a}, - {"linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0x031b}, - {"linux/hdreg.h", "HDIO_DRIVE_RESET", 0x031c}, - {"linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0x031d}, - {"linux/hdreg.h", "HDIO_DRIVE_TASK", 0x031e}, - {"linux/hdreg.h", "HDIO_DRIVE_CMD", 0x031f}, - {"linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0x0321}, - {"linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0x0322}, - {"linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0x0323}, - {"linux/hdreg.h", "HDIO_SET_32BIT", 0x0324}, - {"linux/hdreg.h", "HDIO_SET_NOWERR", 0x0325}, - {"linux/hdreg.h", "HDIO_SET_DMA", 0x0326}, - {"linux/hdreg.h", "HDIO_SET_PIO_MODE", 0x0327}, - {"linux/hdreg.h", "HDIO_SCAN_HWIF", 0x0328}, - {"linux/hdreg.h", "HDIO_SET_NICE", 0x0329}, - {"linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0x032a}, - {"linux/hdreg.h", "HDIO_SET_WCACHE", 0x032b}, - {"linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0x032c}, - {"linux/hdreg.h", "HDIO_SET_BUSSTATE", 0x032d}, - {"linux/hdreg.h", "HDIO_SET_QDMA", 0x032e}, - {"linux/hdreg.h", "HDIO_SET_ADDRESS", 0x032f}, - {"linux/fs.h", "BLKROSET", 0x125d}, - {"linux/fs.h", "BLKROGET", 0x125e}, - {"linux/fs.h", "BLKRRPART", 0x125f}, - {"linux/fs.h", "BLKGETSIZE", 0x1260}, - {"linux/fs.h", "BLKFLSBUF", 0x1261}, - {"linux/fs.h", "BLKRASET", 0x1262}, - {"linux/fs.h", "BLKRAGET", 0x1263}, - {"linux/fs.h", "BLKFRASET", 0x1264}, - {"linux/fs.h", "BLKFRAGET", 0x1265}, - {"linux/fs.h", "BLKSECTSET", 0x1266}, - {"linux/fs.h", "BLKSECTGET", 0x1267}, - {"linux/fs.h", "BLKSSZGET", 0x1268}, - {"linux/blkpg.h", "BLKPG", 0x1269}, - {"linux/fs.h", "BLKELVGET", 0x126a}, - {"linux/fs.h", "BLKELVSET", 0x126b}, - {"linux/fs.h", "BLKBSZGET", 0x1270}, - {"linux/fs.h", "BLKBSZSET", 0x1271}, - {"linux/fs.h", "BLKGETSIZE64", 0x1272}, - {"linux/fs.h", "BLKTRACESETUP", 0x1273}, - {"linux/fs.h", "BLKTRACESTART", 0x1274}, - {"linux/fs.h", "BLKTRACESTOP", 0x1275}, - {"linux/fs.h", "BLKTRACETEARDOWN", 0x1276}, - {"linux/fs.h", "BLKDISCARD", 0x1277}, - {"linux/fs.h", "BLKIOMIN", 0x1278}, - {"linux/fs.h", "BLKIOOPT", 0x1279}, - {"linux/fs.h", "BLKALIGNOFF", 0x127a}, - {"linux/fs.h", "BLKPBSZGET", 0x127b}, - {"linux/fs.h", "BLKDISCARDZEROES", 0x127c}, - {"linux/fs.h", "BLKSECDISCARD", 0x127d}, - {"linux/fs.h", "BLKROTATIONAL", 0x127e}, - {"linux/fs.h", "BLKZEROOUT", 0x127f}, - {"scsi/sg.h", "SG_SET_TIMEOUT", 0x2201}, - {"scsi/sg.h", "SG_GET_TIMEOUT", 0x2202}, - {"scsi/sg.h", "SG_EMULATED_HOST", 0x2203}, - {"scsi/sg.h", "SG_SET_TRANSFORM", 0x2204}, - {"scsi/sg.h", "SG_GET_TRANSFORM", 0x2205}, - {"scsi/sg.h", "SG_GET_COMMAND_Q", 0x2270}, - {"scsi/sg.h", "SG_SET_COMMAND_Q", 0x2271}, - {"scsi/sg.h", "SG_GET_RESERVED_SIZE", 0x2272}, - {"scsi/sg.h", "SG_SET_RESERVED_SIZE", 0x2275}, - {"scsi/sg.h", "SG_GET_SCSI_ID", 0x2276}, - {"scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0x2279}, - {"scsi/sg.h", "SG_GET_LOW_DMA", 0x227a}, - {"scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0x227b}, - {"scsi/sg.h", "SG_GET_PACK_ID", 0x227c}, - {"scsi/sg.h", "SG_GET_NUM_WAITING", 0x227d}, - {"scsi/sg.h", "SG_SET_DEBUG", 0x227e}, - {"scsi/sg.h", "SG_GET_SG_TABLESIZE", 0x227f}, - {"scsi/sg.h", "SG_GET_VERSION_NUM", 0x2282}, - {"scsi/sg.h", "SG_NEXT_CMD_LEN", 0x2283}, - {"scsi/sg.h", "SG_SCSI_RESET", 0x2284}, - {"scsi/sg.h", "SG_IO", 0x2285}, - {"scsi/sg.h", "SG_GET_REQUEST_TABLE", 0x2286}, - {"scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0x2287}, - {"scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0x2288}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", 0x2300}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", 0x2301}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", 0x2302}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", 0x2303}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", 0x2304}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", 0x2305}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", 0x2306}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", 0x2307}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", 0x2308}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", 0x2309}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", 0x230a}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", 0x230b}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", 0x230c}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", 0x230d}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", 0x230e}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", 0x230f}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", 0x2310}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", 0x2311}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", 0x2312}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", 0x2313}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", 0x2314}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", 0x2315}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", 0x2316}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", 0x2317}, - {"linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", 0x2318}, - {"linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", 0x2400}, - {"linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", 0x2401}, - {"linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", 0x2402}, - {"linux/perf_event.h", "PERF_EVENT_IOC_RESET", 0x2403}, - {"linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", 0x2404}, - {"linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", 0x2405}, - {"linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", 0x2406}, - {"linux/perf_event.h", "PERF_EVENT_IOC_ID", 0x2407}, - {"linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", 0x3301}, - {"linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", 0x3302}, - {"linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", 0x3304}, - {"linux/suspend_ioctls.h", "SNAPSHOT_FREE", 0x3305}, - {"linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", 0x3309}, - {"linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", 0x330b}, - {"linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", 0x330d}, - {"linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", 0x330e}, - {"linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", 0x330f}, - {"linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", 0x3310}, - {"linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", 0x3311}, - {"linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", 0x3312}, - {"linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", 0x3313}, - {"linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", 0x3314}, - {"linux/vfio.h", "VFIO_GET_API_VERSION", 0x3b64}, - {"linux/vfio.h", "VFIO_CHECK_EXTENSION", 0x3b65}, - {"linux/vfio.h", "VFIO_SET_IOMMU", 0x3b66}, - {"linux/vfio.h", "VFIO_GROUP_GET_STATUS", 0x3b67}, - {"linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", 0x3b68}, - {"linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", 0x3b69}, - {"linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", 0x3b6a}, - {"linux/vfio.h", "VFIO_DEVICE_GET_INFO", 0x3b6b}, - {"linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", 0x3b6c}, - {"linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", 0x3b6d}, - {"linux/vfio.h", "VFIO_DEVICE_SET_IRQS", 0x3b6e}, - {"linux/vfio.h", "VFIO_DEVICE_RESET", 0x3b6f}, - {"linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", 0x3b70}, - {"linux/vfio.h", "VFIO_IOMMU_GET_INFO", 0x3b70}, - {"linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", 0x3b70}, - {"linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", 0x3b71}, - {"linux/vfio.h", "VFIO_IOMMU_MAP_DMA", 0x3b71}, - {"linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", 0x3b72}, - {"linux/vfio.h", "VFIO_IOMMU_ENABLE", 0x3b73}, - {"linux/vfio.h", "VFIO_IOMMU_DISABLE", 0x3b74}, - {"linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", 0x3d01}, - {"linux/ptp_clock.h", "PTP_EXTTS_REQUEST", 0x3d02}, - {"linux/ptp_clock.h", "PTP_PEROUT_REQUEST", 0x3d03}, - {"linux/ptp_clock.h", "PTP_ENABLE_PPS", 0x3d04}, - {"linux/ptp_clock.h", "PTP_SYS_OFFSET", 0x3d05}, - {"linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", 0x4003}, - {"linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", 0x4004}, - {"linux/agpgart.h", "AGPIOC_INFO", 0x4100}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", 0x4100}, - {"linux/agpgart.h", "AGPIOC_ACQUIRE", 0x4101}, - {"linux/apm_bios.h", "APM_IOC_STANDBY", 0x4101}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_INFO", 0x4101}, - {"linux/agpgart.h", "AGPIOC_RELEASE", 0x4102}, - {"linux/apm_bios.h", "APM_IOC_SUSPEND", 0x4102}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", 0x4102}, - {"linux/agpgart.h", "AGPIOC_SETUP", 0x4103}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", 0x4103}, - {"linux/agpgart.h", "AGPIOC_RESERVE", 0x4104}, - {"linux/agpgart.h", "AGPIOC_PROTECT", 0x4105}, - {"linux/agpgart.h", "AGPIOC_ALLOCATE", 0x4106}, - {"linux/agpgart.h", "AGPIOC_DEALLOCATE", 0x4107}, - {"linux/agpgart.h", "AGPIOC_BIND", 0x4108}, - {"linux/agpgart.h", "AGPIOC_UNBIND", 0x4109}, - {"linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", 0x410a}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", 0x4110}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", 0x4111}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", 0x4112}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", 0x4113}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", 0x4120}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", 0x4121}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", 0x4122}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", 0x4123}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", 0x4132}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", 0x4140}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_RESET", 0x4141}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_START", 0x4142}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_DROP", 0x4143}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", 0x4144}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", 0x4145}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", 0x4146}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", 0x4147}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", 0x4148}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", 0x4149}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", 0x4150}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", 0x4151}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", 0x4152}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", 0x4153}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_LINK", 0x4160}, - {"sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", 0x4161}, - {"linux/pmu.h", "PMU_IOC_SLEEP", 0x4200}, - {"linux/cciss_ioctl.h", "CCISS_GETPCIINFO", 0x4201}, - {"linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", 0x4201}, - {"linux/cciss_ioctl.h", "CCISS_GETINTINFO", 0x4202}, - {"linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", 0x4202}, - {"linux/cciss_ioctl.h", "CCISS_SETINTINFO", 0x4203}, - {"linux/pmu.h", "PMU_IOC_GET_MODEL", 0x4203}, - {"linux/cciss_ioctl.h", "CCISS_GETNODENAME", 0x4204}, - {"linux/pmu.h", "PMU_IOC_HAS_ADB", 0x4204}, - {"linux/cciss_ioctl.h", "CCISS_SETNODENAME", 0x4205}, - {"linux/pmu.h", "PMU_IOC_CAN_SLEEP", 0x4205}, - {"linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", 0x4206}, - {"linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", 0x4206}, - {"linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", 0x4207}, - {"linux/cciss_ioctl.h", "CCISS_GETFIRMVER", 0x4208}, - {"linux/cciss_ioctl.h", "CCISS_GETDRIVVER", 0x4209}, - {"linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", 0x420a}, - {"linux/cciss_ioctl.h", "CCISS_PASSTHRU", 0x420b}, - {"linux/cciss_ioctl.h", "CCISS_DEREGDISK", 0x420c}, - {"linux/cciss_ioctl.h", "CCISS_REGNEWDISK", 0x420d}, - {"linux/cciss_ioctl.h", "CCISS_REGNEWD", 0x420e}, - {"linux/cciss_ioctl.h", "CCISS_RESCANDISK", 0x4210}, - {"linux/cciss_ioctl.h", "CCISS_GETLUNINFO", 0x4211}, - {"linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", 0x4212}, - {"linux/soundcard.h", "SNDCTL_COPR_RESET", 0x4300}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", 0x4300}, - {"linux/capi.h", "CAPI_REGISTER", 0x4301}, - {"linux/soundcard.h", "SNDCTL_COPR_LOAD", 0x4301}, - {"linux/soundcard.h", "SNDCTL_COPR_RDATA", 0x4302}, - {"linux/soundcard.h", "SNDCTL_COPR_RCODE", 0x4303}, - {"linux/soundcard.h", "SNDCTL_COPR_WDATA", 0x4304}, - {"linux/soundcard.h", "SNDCTL_COPR_WCODE", 0x4305}, - {"linux/capi.h", "CAPI_GET_MANUFACTURER", 0x4306}, - {"linux/soundcard.h", "SNDCTL_COPR_RUN", 0x4306}, - {"linux/capi.h", "CAPI_GET_VERSION", 0x4307}, - {"linux/soundcard.h", "SNDCTL_COPR_HALT", 0x4307}, - {"linux/capi.h", "CAPI_GET_SERIAL", 0x4308}, - {"linux/soundcard.h", "SNDCTL_COPR_SENDMSG", 0x4308}, - {"linux/capi.h", "CAPI_GET_PROFILE", 0x4309}, - {"linux/soundcard.h", "SNDCTL_COPR_RCVMSG", 0x4309}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", 0x4310}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", 0x4311}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", 0x4312}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", 0x4313}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", 0x4314}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", 0x4315}, - {"linux/capi.h", "CAPI_MANUFACTURER_CMD", 0x4320}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", 0x4320}, - {"linux/capi.h", "CAPI_GET_ERRCODE", 0x4321}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", 0x4321}, - {"linux/capi.h", "CAPI_INSTALLED", 0x4322}, - {"linux/capi.h", "CAPI_GET_FLAGS", 0x4323}, - {"linux/capi.h", "CAPI_SET_FLAGS", 0x4324}, - {"linux/capi.h", "CAPI_CLR_FLAGS", 0x4325}, - {"linux/capi.h", "CAPI_NCCI_OPENCOUNT", 0x4326}, - {"linux/capi.h", "CAPI_NCCI_GETUNIT", 0x4327}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", 0x4330}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", 0x4331}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_START", 0x4332}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_STOP", 0x4333}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", 0x4334}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", 0x4335}, - {"sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", 0x4336}, - {"linux/input.h", "EVIOCGVERSION", 0x4501}, - {"linux/input.h", "EVIOCGID", 0x4502}, - {"linux/input.h", "EVIOCGREP", 0x4503}, - {"linux/input.h", "EVIOCSREP", 0x4503}, - {"linux/input.h", "EVIOCGKEYCODE", 0x4504}, - {"linux/input.h", "EVIOCGKEYCODE_V2", 0x4504}, - {"linux/input.h", "EVIOCSKEYCODE", 0x4504}, - {"linux/input.h", "EVIOCSKEYCODE_V2", 0x4504}, - {"linux/input.h", "EVIOCRMFF", 0x4581}, - {"linux/input.h", "EVIOCGEFFECTS", 0x4584}, - {"linux/input.h", "EVIOCGRAB", 0x4590}, - {"linux/input.h", "EVIOCREVOKE", 0x4591}, - {"linux/input.h", "EVIOCSCLOCKID", 0x45a0}, - {"linux/fb.h", "FBIOGET_VSCREENINFO", 0x4600}, - {"linux/fb.h", "FBIOPUT_VSCREENINFO", 0x4601}, - {"linux/fb.h", "FBIOGET_FSCREENINFO", 0x4602}, - {"linux/fb.h", "FBIOGETCMAP", 0x4604}, - {"linux/fb.h", "FBIOPUTCMAP", 0x4605}, - {"linux/fb.h", "FBIOPAN_DISPLAY", 0x4606}, - {"linux/fb.h", "FBIO_CURSOR", 0x4608}, - {"linux/fb.h", "FBIOGET_CON2FBMAP", 0x460f}, - {"linux/fb.h", "FBIOPUT_CON2FBMAP", 0x4610}, - {"linux/fb.h", "FBIOBLANK", 0x4611}, - {"linux/fb.h", "FBIOGET_VBLANK", 0x4612}, - {"linux/fb.h", "FBIO_ALLOC", 0x4613}, - {"linux/fb.h", "FBIO_FREE", 0x4614}, - {"linux/fb.h", "FBIOGET_GLYPH", 0x4615}, - {"linux/fb.h", "FBIOGET_HWCINFO", 0x4616}, - {"linux/fb.h", "FBIOPUT_MODEINFO", 0x4617}, - {"linux/fb.h", "FBIOGET_DISPINFO", 0x4618}, - {"linux/fb.h", "FBIO_WAITFORVSYNC", 0x4620}, - {"linux/arcfb.h", "FBIO_WAITEVENT", 0x4688}, - {"linux/arcfb.h", "FBIO_GETCONTROL2", 0x4689}, - {"linux/gigaset_dev.h", "GIGASET_REDIR", 0x4700}, - {"linux/gigaset_dev.h", "GIGASET_CONFIG", 0x4701}, - {"linux/gigaset_dev.h", "GIGASET_BRKCHARS", 0x4702}, - {"linux/gigaset_dev.h", "GIGASET_VERSION", 0x4703}, - {"sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", 0x4800}, - {"linux/hidraw.h", "HIDIOCGRDESCSIZE", 0x4801}, - {"linux/hiddev.h", "HIDIOCGVERSION", 0x4801}, - {"sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", 0x4801}, - {"linux/hiddev.h", "HIDIOCAPPLICATION", 0x4802}, - {"linux/hidraw.h", "HIDIOCGRDESC", 0x4802}, - {"sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", 0x4802}, - {"linux/hiddev.h", "HIDIOCGDEVINFO", 0x4803}, - {"linux/hidraw.h", "HIDIOCGRAWINFO", 0x4803}, - {"sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", 0x4803}, - {"linux/hiddev.h", "HIDIOCGSTRING", 0x4804}, - {"linux/hiddev.h", "HIDIOCINITREPORT", 0x4805}, - {"linux/hiddev.h", "HIDIOCGREPORT", 0x4807}, - {"linux/hiddev.h", "HIDIOCSREPORT", 0x4808}, - {"linux/hiddev.h", "HIDIOCGREPORTINFO", 0x4809}, - {"linux/hiddev.h", "HIDIOCGFIELDINFO", 0x480a}, - {"linux/hiddev.h", "HIDIOCGUSAGE", 0x480b}, - {"linux/hiddev.h", "HIDIOCSUSAGE", 0x480c}, - {"linux/hiddev.h", "HIDIOCGUCODE", 0x480d}, - {"linux/hiddev.h", "HIDIOCGFLAG", 0x480e}, - {"linux/hiddev.h", "HIDIOCSFLAG", 0x480f}, - {"linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", 0x4810}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", 0x4810}, - {"sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", 0x4810}, - {"linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", 0x4811}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", 0x4811}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", 0x4812}, - {"sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", 0x4812}, - {"linux/hiddev.h", "HIDIOCGUSAGES", 0x4813}, - {"sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", 0x4813}, - {"linux/hiddev.h", "HIDIOCSUSAGES", 0x4814}, - {"sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", 0x4814}, - {"sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", 0x4815}, - {"sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", 0x4816}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", 0x4820}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", 0x4820}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", 0x4821}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", 0x4821}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", 0x4822}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", 0x4822}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", 0x4823}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", 0x4824}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", 0x4825}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", 0x4826}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", 0x4830}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", 0x4831}, - {"sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", 0x4840}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", 0x4840}, - {"sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", 0x4840}, - {"sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", 0x4841}, - {"sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", 0x4842}, - {"sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", 0x4843}, - {"sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", 0x4844}, - {"sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", 0x4844}, - {"sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", 0x4845}, - {"sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", 0x4846}, - {"sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", 0x4848}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", 0x4880}, - {"sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", 0x4880}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", 0x4881}, - {"sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", 0x4881}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", 0x4882}, - {"sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", 0x4882}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", 0x4883}, - {"sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", 0x4883}, - {"sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", 0x4884}, - {"sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", 0x4884}, - {"sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", 0x4884}, - {"linux/isdn.h", "IIOCNETAIF", 0x4901}, - {"linux/isdn.h", "IIOCNETDIF", 0x4902}, - {"linux/isdn.h", "IIOCNETSCF", 0x4903}, - {"linux/isdn.h", "IIOCNETGCF", 0x4904}, - {"linux/isdn.h", "IIOCNETANM", 0x4905}, - {"linux/isdn.h", "IIOCNETDNM", 0x4906}, - {"linux/isdn.h", "IIOCNETGNM", 0x4907}, - {"linux/isdn.h", "IIOCGETSET", 0x4908}, - {"linux/isdn.h", "IIOCSETSET", 0x4909}, - {"linux/isdn.h", "IIOCSETVER", 0x490a}, - {"linux/isdn.h", "IIOCNETHUP", 0x490b}, - {"linux/isdn.h", "IIOCSETGST", 0x490c}, - {"linux/isdn.h", "IIOCSETBRJ", 0x490d}, - {"linux/isdn.h", "IIOCSIGPRF", 0x490e}, - {"linux/isdn.h", "IIOCGETPRF", 0x490f}, - {"linux/isdn.h", "IIOCSETPRF", 0x4910}, - {"linux/isdn.h", "IIOCGETMAP", 0x4911}, - {"linux/isdn.h", "IIOCSETMAP", 0x4912}, - {"linux/isdn.h", "IIOCNETASL", 0x4913}, - {"linux/isdn.h", "IIOCNETDIL", 0x4914}, - {"linux/isdn.h", "IIOCGETCPS", 0x4915}, - {"linux/isdn.h", "IIOCGETDVR", 0x4916}, - {"linux/isdn.h", "IIOCNETLCR", 0x4917}, - {"linux/isdn.h", "IIOCNETDWRSET", 0x4918}, - {"linux/isdn.h", "IIOCNETALN", 0x4920}, - {"linux/isdn.h", "IIOCNETDLN", 0x4921}, - {"linux/isdn.h", "IIOCNETGPN", 0x4922}, - {"linux/isdn.h", "IIOCDBGVAR", 0x497f}, - {"linux/isdn.h", "IIOCDRVCTL", 0x4980}, - {"linux/kd.h", "KIOCSOUND", 0x4b2f}, - {"linux/kd.h", "KDMKTONE", 0x4b30}, - {"linux/kd.h", "KDGETLED", 0x4b31}, - {"linux/kd.h", "KDSETLED", 0x4b32}, - {"linux/kd.h", "KDGKBTYPE", 0x4b33}, - {"linux/kd.h", "KDADDIO", 0x4b34}, - {"linux/kd.h", "KDDELIO", 0x4b35}, - {"linux/kd.h", "KDENABIO", 0x4b36}, - {"linux/kd.h", "KDDISABIO", 0x4b37}, - {"linux/kd.h", "KDSETMODE", 0x4b3a}, - {"linux/kd.h", "KDGETMODE", 0x4b3b}, - {"linux/kd.h", "KDMAPDISP", 0x4b3c}, - {"linux/kd.h", "KDUNMAPDISP", 0x4b3d}, - {"linux/kd.h", "GIO_SCRNMAP", 0x4b40}, - {"linux/kd.h", "PIO_SCRNMAP", 0x4b41}, - {"linux/kd.h", "KDGKBMODE", 0x4b44}, - {"linux/kd.h", "KDSKBMODE", 0x4b45}, - {"linux/kd.h", "KDGKBENT", 0x4b46}, - {"linux/kd.h", "KDSKBENT", 0x4b47}, - {"linux/kd.h", "KDGKBSENT", 0x4b48}, - {"linux/kd.h", "KDSKBSENT", 0x4b49}, - {"linux/kd.h", "KDGKBDIACR", 0x4b4a}, - {"linux/kd.h", "KDSKBDIACR", 0x4b4b}, - {"linux/kd.h", "KDGETKEYCODE", 0x4b4c}, - {"linux/kd.h", "KDSETKEYCODE", 0x4b4d}, - {"linux/kd.h", "KDSIGACCEPT", 0x4b4e}, - {"linux/kd.h", "KDKBDREP", 0x4b52}, - {"linux/kd.h", "GIO_FONT", 0x4b60}, - {"linux/kd.h", "PIO_FONT", 0x4b61}, - {"linux/kd.h", "KDGKBMETA", 0x4b62}, - {"linux/kd.h", "KDSKBMETA", 0x4b63}, - {"linux/kd.h", "KDGKBLED", 0x4b64}, - {"linux/kd.h", "KDSKBLED", 0x4b65}, - {"linux/kd.h", "GIO_UNIMAP", 0x4b66}, - {"linux/kd.h", "PIO_UNIMAP", 0x4b67}, - {"linux/kd.h", "PIO_UNIMAPCLR", 0x4b68}, - {"linux/kd.h", "GIO_UNISCRNMAP", 0x4b69}, - {"linux/kd.h", "PIO_UNISCRNMAP", 0x4b6a}, - {"linux/kd.h", "GIO_FONTX", 0x4b6b}, - {"linux/kd.h", "PIO_FONTX", 0x4b6c}, - {"linux/kd.h", "PIO_FONTRESET", 0x4b6d}, - {"linux/kd.h", "GIO_CMAP", 0x4b70}, - {"linux/kd.h", "PIO_CMAP", 0x4b71}, - {"linux/kd.h", "KDFONTOP", 0x4b72}, - {"linux/kd.h", "KDGKBDIACRUC", 0x4bfa}, - {"linux/kd.h", "KDSKBDIACRUC", 0x4bfb}, - {"linux/loop.h", "LOOP_SET_FD", 0x4c00}, - {"linux/loop.h", "LOOP_CLR_FD", 0x4c01}, - {"linux/loop.h", "LOOP_SET_STATUS", 0x4c02}, - {"linux/loop.h", "LOOP_GET_STATUS", 0x4c03}, - {"linux/loop.h", "LOOP_SET_STATUS64", 0x4c04}, - {"linux/loop.h", "LOOP_GET_STATUS64", 0x4c05}, - {"linux/loop.h", "LOOP_CHANGE_FD", 0x4c06}, - {"linux/loop.h", "LOOP_SET_CAPACITY", 0x4c07}, - {"linux/loop.h", "LOOP_CTL_ADD", 0x4c80}, - {"linux/loop.h", "LOOP_CTL_REMOVE", 0x4c81}, - {"linux/loop.h", "LOOP_CTL_GET_FREE", 0x4c82}, - {"asm/mtrr.h", "MTRRIOC_ADD_ENTRY", 0x4d00}, - {"asm/mce.h", "MCE_GET_RECORD_LEN", 0x4d01}, - {"asm/mtrr.h", "MTRRIOC_SET_ENTRY", 0x4d01}, - {"asm/mce.h", "MCE_GET_LOG_LEN", 0x4d02}, - {"asm/mtrr.h", "MTRRIOC_DEL_ENTRY", 0x4d02}, - {"asm/mce.h", "MCE_GETCLEAR_FLAGS", 0x4d03}, - {"asm/mtrr.h", "MTRRIOC_GET_ENTRY", 0x4d03}, - {"asm/mtrr.h", "MTRRIOC_KILL_ENTRY", 0x4d04}, - {"asm/mtrr.h", "MTRRIOC_ADD_PAGE_ENTRY", 0x4d05}, - {"asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", 0x4d06}, - {"asm/mtrr.h", "MTRRIOC_DEL_PAGE_ENTRY", 0x4d07}, - {"asm/mtrr.h", "MTRRIOC_GET_PAGE_ENTRY", 0x4d08}, - {"asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", 0x4d09}, - {"linux/soundcard.h", "SOUND_MIXER_INFO", 0x4d65}, - {"linux/soundcard.h", "SOUND_OLD_MIXER_INFO", 0x4d65}, - {"linux/soundcard.h", "SOUND_MIXER_ACCESS", 0x4d66}, - {"linux/soundcard.h", "SOUND_MIXER_AGC", 0x4d67}, - {"linux/soundcard.h", "SOUND_MIXER_3DSE", 0x4d68}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE1", 0x4d6f}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE2", 0x4d70}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE3", 0x4d71}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE4", 0x4d72}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE5", 0x4d73}, - {"linux/soundcard.h", "SOUND_MIXER_GETLEVELS", 0x4d74}, - {"linux/soundcard.h", "SOUND_MIXER_SETLEVELS", 0x4d75}, - {"linux/soundcard.h", "OSS_GETVERSION", 0x4d76}, - {"linux/nvme.h", "NVME_IOCTL_ID", 0x4e40}, - {"linux/nvme.h", "NVME_IOCTL_ADMIN_CMD", 0x4e41}, - {"linux/nvme.h", "NVME_IOCTL_SUBMIT_IO", 0x4e42}, - {"linux/soundcard.h", "SNDCTL_DSP_RESET", 0x5000}, - {"linux/soundcard.h", "SNDCTL_DSP_SYNC", 0x5001}, - {"linux/soundcard.h", "SNDCTL_DSP_SPEED", 0x5002}, - {"linux/soundcard.h", "SOUND_PCM_READ_RATE", 0x5002}, - {"linux/soundcard.h", "SNDCTL_DSP_STEREO", 0x5003}, - {"linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", 0x5004}, - {"linux/soundcard.h", "SNDCTL_DSP_SETFMT", 0x5005}, - {"linux/soundcard.h", "SOUND_PCM_READ_BITS", 0x5005}, - {"linux/soundcard.h", "SNDCTL_DSP_CHANNELS", 0x5006}, - {"linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", 0x5006}, - {"linux/soundcard.h", "SOUND_PCM_READ_FILTER", 0x5007}, - {"linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", 0x5007}, - {"linux/soundcard.h", "SNDCTL_DSP_POST", 0x5008}, - {"linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", 0x5009}, - {"linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", 0x500a}, - {"linux/soundcard.h", "SNDCTL_DSP_GETFMTS", 0x500b}, - {"linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", 0x500c}, - {"linux/soundcard.h", "SNDCTL_DSP_GETISPACE", 0x500d}, - {"linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", 0x500e}, - {"linux/soundcard.h", "SNDCTL_DSP_GETCAPS", 0x500f}, - {"linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", 0x5010}, - {"linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", 0x5010}, - {"linux/soundcard.h", "SNDCTL_DSP_GETIPTR", 0x5011}, - {"linux/soundcard.h", "SNDCTL_DSP_GETOPTR", 0x5012}, - {"linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", 0x5013}, - {"linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", 0x5014}, - {"linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", 0x5015}, - {"linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", 0x5016}, - {"linux/soundcard.h", "SNDCTL_DSP_GETODELAY", 0x5017}, - {"linux/soundcard.h", "SNDCTL_DSP_PROFILE", 0x5017}, - {"linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", 0x5040}, - {"linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", 0x5041}, - {"linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", 0x5042}, - {"linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", 0x5043}, - {"linux/soundcard.h", "SNDCTL_SEQ_RESET", 0x5100}, - {"linux/soundcard.h", "SNDCTL_SEQ_SYNC", 0x5101}, - {"linux/soundcard.h", "SNDCTL_SYNTH_INFO", 0x5102}, - {"linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", 0x5103}, - {"linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", 0x5104}, - {"linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", 0x5105}, - {"linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", 0x5106}, - {"linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", 0x5107}, - {"linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", 0x5108}, - {"linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", 0x5109}, - {"linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", 0x510a}, - {"linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", 0x510b}, - {"linux/soundcard.h", "SNDCTL_MIDI_INFO", 0x510c}, - {"linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", 0x510d}, - {"linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", 0x510e}, - {"linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", 0x510f}, - {"linux/soundcard.h", "SNDCTL_SEQ_PANIC", 0x5111}, - {"linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", 0x5112}, - {"linux/soundcard.h", "SNDCTL_SEQ_GETTIME", 0x5113}, - {"linux/soundcard.h", "SNDCTL_SYNTH_ID", 0x5114}, - {"linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", 0x5115}, - {"linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", 0x5116}, - {"linux/random.h", "RNDGETENTCNT", 0x5200}, - {"linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", 0x5201}, - {"linux/random.h", "RNDADDTOENTCNT", 0x5201}, - {"linux/random.h", "RNDGETPOOL", 0x5202}, - {"linux/random.h", "RNDADDENTROPY", 0x5203}, - {"linux/random.h", "RNDZAPENTCNT", 0x5204}, - {"linux/random.h", "RNDCLEARPOOL", 0x5206}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", 0x5300}, - {"linux/cdrom.h", "CDROMPAUSE", 0x5301}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", 0x5301}, - {"linux/cdrom.h", "CDROMRESUME", 0x5302}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", 0x5302}, - {"linux/cdrom.h", "CDROMPLAYMSF", 0x5303}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", 0x5303}, - {"linux/cdrom.h", "CDROMPLAYTRKIND", 0x5304}, - {"linux/cdrom.h", "CDROMREADTOCHDR", 0x5305}, - {"linux/cdrom.h", "CDROMREADTOCENTRY", 0x5306}, - {"linux/cdrom.h", "CDROMSTOP", 0x5307}, - {"linux/cdrom.h", "CDROMSTART", 0x5308}, - {"linux/cdrom.h", "CDROMEJECT", 0x5309}, - {"linux/cdrom.h", "CDROMVOLCTRL", 0x530a}, - {"linux/cdrom.h", "CDROMSUBCHNL", 0x530b}, - {"linux/cdrom.h", "CDROMREADMODE2", 0x530c}, - {"linux/cdrom.h", "CDROMREADMODE1", 0x530d}, - {"linux/cdrom.h", "CDROMREADAUDIO", 0x530e}, - {"linux/cdrom.h", "CDROMEJECT_SW", 0x530f}, - {"linux/cdrom.h", "CDROMMULTISESSION", 0x5310}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", 0x5310}, - {"linux/cdrom.h", "CDROM_GET_MCN", 0x5311}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", 0x5311}, - {"linux/cdrom.h", "CDROMRESET", 0x5312}, - {"linux/cdrom.h", "CDROMVOLREAD", 0x5313}, - {"linux/cdrom.h", "CDROMREADRAW", 0x5314}, - {"linux/cdrom.h", "CDROMREADCOOKED", 0x5315}, - {"linux/cdrom.h", "CDROMSEEK", 0x5316}, - {"linux/cdrom.h", "CDROMPLAYBLK", 0x5317}, - {"linux/cdrom.h", "CDROMREADALL", 0x5318}, - {"linux/cdrom.h", "CDROMCLOSETRAY", 0x5319}, - {"linux/cdrom.h", "CDROMGETSPINDOWN", 0x531d}, - {"linux/cdrom.h", "CDROMSETSPINDOWN", 0x531e}, - {"linux/cdrom.h", "CDROM_SET_OPTIONS", 0x5320}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", 0x5320}, - {"linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0x5321}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", 0x5321}, - {"linux/cdrom.h", "CDROM_SELECT_SPEED", 0x5322}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", 0x5322}, - {"linux/cdrom.h", "CDROM_SELECT_DISC", 0x5323}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", 0x5323}, - {"linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0x5325}, - {"linux/cdrom.h", "CDROM_DRIVE_STATUS", 0x5326}, - {"linux/cdrom.h", "CDROM_DISC_STATUS", 0x5327}, - {"linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0x5328}, - {"linux/cdrom.h", "CDROM_LOCKDOOR", 0x5329}, - {"linux/cdrom.h", "CDROM_DEBUG", 0x5330}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", 0x5330}, - {"linux/cdrom.h", "CDROM_GET_CAPABILITY", 0x5331}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", 0x5331}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", 0x5332}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", 0x5333}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", 0x5334}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", 0x5335}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", 0x5336}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", 0x5340}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", 0x5341}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", 0x5342}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER", 0x5343}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER", 0x5344}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", 0x5345}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", 0x5346}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", 0x5349}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", 0x534a}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", 0x534b}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", 0x534c}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", 0x534e}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", 0x534f}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", 0x5350}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", 0x5351}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", 0x5352}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC", 0x5353}, - {"sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC", 0x5354}, - {"scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0x5380}, - {"scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0x5381}, - {"linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0x5382}, - {"scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0x5382}, - {"scsi/scsi.h", "SCSI_IOCTL_TAGGED_ENABLE", 0x5383}, - {"scsi/scsi.h", "SCSI_IOCTL_TAGGED_DISABLE", 0x5384}, - {"scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0x5385}, - {"scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0x5386}, - {"linux/cdrom.h", "DVD_READ_STRUCT", 0x5390}, - {"linux/cdrom.h", "DVD_WRITE_STRUCT", 0x5391}, - {"linux/cdrom.h", "DVD_AUTH", 0x5392}, - {"linux/cdrom.h", "CDROM_SEND_PACKET", 0x5393}, - {"linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0x5394}, - {"linux/cdrom.h", "CDROM_LAST_WRITTEN", 0x5395}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", 0x5400}, - {"linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", 0x5401}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", 0x5401}, - {"asm-generic/ioctls.h", "TCGETS", 0x5401}, - {"linux/soundcard.h", "SNDCTL_TMR_START", 0x5402}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD", 0x5402}, - {"asm-generic/ioctls.h", "TCSETS", 0x5402}, - {"linux/soundcard.h", "SNDCTL_TMR_STOP", 0x5403}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", 0x5403}, - {"asm-generic/ioctls.h", "TCSETSW", 0x5403}, - {"linux/soundcard.h", "SNDCTL_TMR_CONTINUE", 0x5404}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", 0x5404}, - {"asm-generic/ioctls.h", "TCSETSF", 0x5404}, - {"linux/soundcard.h", "SNDCTL_TMR_TEMPO", 0x5405}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", 0x5405}, - {"asm-generic/ioctls.h", "TCGETA", 0x5405}, - {"linux/soundcard.h", "SNDCTL_TMR_SOURCE", 0x5406}, - {"asm-generic/ioctls.h", "TCSETA", 0x5406}, - {"linux/soundcard.h", "SNDCTL_TMR_METRONOME", 0x5407}, - {"asm-generic/ioctls.h", "TCSETAW", 0x5407}, - {"linux/soundcard.h", "SNDCTL_TMR_SELECT", 0x5408}, - {"asm-generic/ioctls.h", "TCSETAF", 0x5408}, - {"asm-generic/ioctls.h", "TCSBRK", 0x5409}, - {"asm-generic/ioctls.h", "TCXONC", 0x540a}, - {"asm-generic/ioctls.h", "TCFLSH", 0x540b}, - {"asm-generic/ioctls.h", "TIOCEXCL", 0x540c}, - {"asm-generic/ioctls.h", "TIOCNXCL", 0x540d}, - {"asm-generic/ioctls.h", "TIOCSCTTY", 0x540e}, - {"asm-generic/ioctls.h", "TIOCGPGRP", 0x540f}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", 0x5410}, - {"asm-generic/ioctls.h", "TIOCSPGRP", 0x5410}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", 0x5411}, - {"asm-generic/ioctls.h", "TIOCOUTQ", 0x5411}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", 0x5412}, - {"asm-generic/ioctls.h", "TIOCSTI", 0x5412}, - {"asm-generic/ioctls.h", "TIOCGWINSZ", 0x5413}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", 0x5414}, - {"asm-generic/ioctls.h", "TIOCSWINSZ", 0x5414}, - {"asm-generic/ioctls.h", "TIOCMGET", 0x5415}, - {"asm-generic/ioctls.h", "TIOCMBIS", 0x5416}, - {"asm-generic/ioctls.h", "TIOCMBIC", 0x5417}, - {"asm-generic/ioctls.h", "TIOCMSET", 0x5418}, - {"asm-generic/ioctls.h", "TIOCGSOFTCAR", 0x5419}, - {"asm-generic/ioctls.h", "TIOCSSOFTCAR", 0x541a}, - {"asm-generic/ioctls.h", "FIONREAD", 0x541b}, - {"asm-generic/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm-generic/ioctls.h", "TIOCCONS", 0x541d}, - {"asm-generic/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm-generic/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm-generic/ioctls.h", "TIOCPKT", 0x5420}, - {"asm-generic/ioctls.h", "FIONBIO", 0x5421}, - {"asm-generic/ioctls.h", "TIOCNOTTY", 0x5422}, - {"asm-generic/ioctls.h", "TIOCSETD", 0x5423}, - {"asm-generic/ioctls.h", "TIOCGETD", 0x5424}, - {"asm-generic/ioctls.h", "TCSBRKP", 0x5425}, - {"asm-generic/ioctls.h", "TIOCSBRK", 0x5427}, - {"asm-generic/ioctls.h", "TIOCCBRK", 0x5428}, - {"asm-generic/ioctls.h", "TIOCGSID", 0x5429}, - {"asm-generic/ioctls.h", "TCGETS2", 0x542a}, - {"asm-generic/ioctls.h", "TCSETS2", 0x542b}, - {"asm-generic/ioctls.h", "TCSETSW2", 0x542c}, - {"asm-generic/ioctls.h", "TCSETSF2", 0x542d}, - {"asm-generic/ioctls.h", "TIOCGRS485", 0x542e}, - {"asm-generic/ioctls.h", "TIOCSRS485", 0x542f}, - {"asm-generic/ioctls.h", "TIOCGPTN", 0x5430}, - {"asm-generic/ioctls.h", "TIOCSPTLCK", 0x5431}, - {"asm-generic/ioctls.h", "TCGETX", 0x5432}, - {"asm-generic/ioctls.h", "TIOCGDEV", 0x5432}, - {"asm-generic/ioctls.h", "TCSETX", 0x5433}, - {"asm-generic/ioctls.h", "TCSETXF", 0x5434}, - {"asm-generic/ioctls.h", "TCSETXW", 0x5435}, - {"asm-generic/ioctls.h", "TIOCSIG", 0x5436}, - {"asm-generic/ioctls.h", "TIOCVHANGUP", 0x5437}, - {"asm-generic/ioctls.h", "TIOCGPKT", 0x5438}, - {"asm-generic/ioctls.h", "TIOCGPTLCK", 0x5439}, - {"asm-generic/ioctls.h", "TIOCGEXCL", 0x5440}, - {"asm-generic/ioctls.h", "FIONCLEX", 0x5450}, - {"asm-generic/ioctls.h", "FIOCLEX", 0x5451}, - {"asm-generic/ioctls.h", "FIOASYNC", 0x5452}, - {"asm-generic/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm-generic/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm-generic/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm-generic/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm-generic/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm-generic/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm-generic/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm-generic/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm-generic/ioctls.h", "FIOQSIZE", 0x5460}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_START", 0x54a0}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", 0x54a1}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", 0x54a2}, - {"sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", 0x54a3}, - {"linux/if_tun.h", "TUNSETNOCSUM", 0x54c8}, - {"linux/if_tun.h", "TUNSETDEBUG", 0x54c9}, - {"linux/if_tun.h", "TUNSETIFF", 0x54ca}, - {"linux/if_tun.h", "TUNSETPERSIST", 0x54cb}, - {"linux/if_tun.h", "TUNSETOWNER", 0x54cc}, - {"linux/if_tun.h", "TUNSETLINK", 0x54cd}, - {"linux/if_tun.h", "TUNSETGROUP", 0x54ce}, - {"linux/if_tun.h", "TUNGETFEATURES", 0x54cf}, - {"linux/if_tun.h", "TUNSETOFFLOAD", 0x54d0}, - {"linux/if_tun.h", "TUNSETTXFILTER", 0x54d1}, - {"linux/if_tun.h", "TUNGETIFF", 0x54d2}, - {"linux/if_tun.h", "TUNGETSNDBUF", 0x54d3}, - {"linux/if_tun.h", "TUNSETSNDBUF", 0x54d4}, - {"linux/if_tun.h", "TUNATTACHFILTER", 0x54d5}, - {"linux/if_tun.h", "TUNDETACHFILTER", 0x54d6}, - {"linux/if_tun.h", "TUNGETVNETHDRSZ", 0x54d7}, - {"linux/if_tun.h", "TUNSETVNETHDRSZ", 0x54d8}, - {"linux/if_tun.h", "TUNSETQUEUE", 0x54d9}, - {"linux/if_tun.h", "TUNSETIFINDEX", 0x54da}, - {"linux/if_tun.h", "TUNGETFILTER", 0x54db}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", 0x5500}, - {"linux/usbdevice_fs.h", "USBDEVFS_CONTROL", 0x5500}, - {"linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", 0x5500}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", 0x5501}, - {"linux/uinput.h", "UI_DEV_CREATE", 0x5501}, - {"linux/uinput.h", "UI_DEV_DESTROY", 0x5502}, - {"linux/usbdevice_fs.h", "USBDEVFS_BULK", 0x5502}, - {"linux/usbdevice_fs.h", "USBDEVFS_BULK32", 0x5502}, - {"linux/usbdevice_fs.h", "USBDEVFS_RESETEP", 0x5503}, - {"linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", 0x5504}, - {"linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", 0x5505}, - {"linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", 0x5508}, - {"linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", 0x550a}, - {"linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", 0x550a}, - {"linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", 0x550b}, - {"linux/usbdevice_fs.h", "USBDEVFS_REAPURB", 0x550c}, - {"linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", 0x550c}, - {"linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", 0x550d}, - {"linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", 0x550d}, - {"linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", 0x550e}, - {"linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", 0x550e}, - {"linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", 0x550f}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", 0x5510}, - {"linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", 0x5510}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", 0x5511}, - {"linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", 0x5511}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", 0x5512}, - {"linux/usbdevice_fs.h", "USBDEVFS_IOCTL", 0x5512}, - {"linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", 0x5512}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", 0x5513}, - {"linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", 0x5513}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", 0x5514}, - {"linux/usbdevice_fs.h", "USBDEVFS_RESET", 0x5514}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", 0x5515}, - {"linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", 0x5515}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", 0x5516}, - {"linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", 0x5516}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", 0x5517}, - {"linux/usbdevice_fs.h", "USBDEVFS_CONNECT", 0x5517}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", 0x5518}, - {"linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", 0x5518}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", 0x5519}, - {"linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", 0x5519}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", 0x551a}, - {"linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", 0x551a}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", 0x551b}, - {"linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", 0x551b}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", 0x551c}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", 0x5520}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", 0x5521}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", 0x5530}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", 0x5531}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", 0x5532}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", 0x5540}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", 0x5541}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", 0x5542}, - {"linux/uinput.h", "UI_SET_EVBIT", 0x5564}, - {"linux/uinput.h", "UI_SET_KEYBIT", 0x5565}, - {"linux/uinput.h", "UI_SET_RELBIT", 0x5566}, - {"linux/uinput.h", "UI_SET_ABSBIT", 0x5567}, - {"linux/uinput.h", "UI_SET_MSCBIT", 0x5568}, - {"linux/uinput.h", "UI_SET_LEDBIT", 0x5569}, - {"linux/uinput.h", "UI_SET_SNDBIT", 0x556a}, - {"linux/uinput.h", "UI_SET_FFBIT", 0x556b}, - {"linux/uinput.h", "UI_SET_PHYS", 0x556c}, - {"linux/uinput.h", "UI_SET_SWBIT", 0x556d}, - {"linux/uinput.h", "UI_SET_PROPBIT", 0x556e}, - {"linux/uinput.h", "UI_BEGIN_FF_UPLOAD", 0x55c8}, - {"linux/uinput.h", "UI_END_FF_UPLOAD", 0x55c9}, - {"linux/uinput.h", "UI_BEGIN_FF_ERASE", 0x55ca}, - {"linux/uinput.h", "UI_END_FF_ERASE", 0x55cb}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_POWER", 0x55d0}, - {"sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", 0x55d1}, - {"linux/videodev2.h", "VIDIOC_QUERYCAP", 0x5600}, - {"linux/vt.h", "VT_OPENQRY", 0x5600}, - {"linux/videodev2.h", "VIDIOC_RESERVED", 0x5601}, - {"linux/vt.h", "VT_GETMODE", 0x5601}, - {"linux/videodev2.h", "VIDIOC_ENUM_FMT", 0x5602}, - {"linux/vt.h", "VT_SETMODE", 0x5602}, - {"linux/vt.h", "VT_GETSTATE", 0x5603}, - {"linux/videodev2.h", "VIDIOC_G_FMT", 0x5604}, - {"linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", 0x5604}, - {"linux/vt.h", "VT_SENDSIG", 0x5604}, - {"linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", 0x5605}, - {"linux/videodev2.h", "VIDIOC_S_FMT", 0x5605}, - {"linux/vt.h", "VT_RELDISP", 0x5605}, - {"linux/vt.h", "VT_ACTIVATE", 0x5606}, - {"linux/vt.h", "VT_WAITACTIVE", 0x5607}, - {"linux/videodev2.h", "VIDIOC_REQBUFS", 0x5608}, - {"linux/vt.h", "VT_DISALLOCATE", 0x5608}, - {"linux/videodev2.h", "VIDIOC_QUERYBUF", 0x5609}, - {"linux/vt.h", "VT_RESIZE", 0x5609}, - {"linux/videodev2.h", "VIDIOC_G_FBUF", 0x560a}, - {"linux/vt.h", "VT_RESIZEX", 0x560a}, - {"linux/videodev2.h", "VIDIOC_S_FBUF", 0x560b}, - {"linux/vt.h", "VT_LOCKSWITCH", 0x560b}, - {"linux/vt.h", "VT_UNLOCKSWITCH", 0x560c}, - {"linux/vt.h", "VT_GETHIFONTMASK", 0x560d}, - {"linux/videodev2.h", "VIDIOC_OVERLAY", 0x560e}, - {"linux/vt.h", "VT_WAITEVENT", 0x560e}, - {"linux/videodev2.h", "VIDIOC_QBUF", 0x560f}, - {"linux/vt.h", "VT_SETACTIVATE", 0x560f}, - {"linux/videodev2.h", "VIDIOC_EXPBUF", 0x5610}, - {"linux/videodev2.h", "VIDIOC_DQBUF", 0x5611}, - {"linux/videodev2.h", "VIDIOC_STREAMON", 0x5612}, - {"linux/videodev2.h", "VIDIOC_STREAMOFF", 0x5613}, - {"linux/videodev2.h", "VIDIOC_G_PARM", 0x5615}, - {"linux/videodev2.h", "VIDIOC_S_PARM", 0x5616}, - {"linux/videodev2.h", "VIDIOC_G_STD", 0x5617}, - {"linux/videodev2.h", "VIDIOC_S_STD", 0x5618}, - {"linux/videodev2.h", "VIDIOC_ENUMSTD", 0x5619}, - {"linux/videodev2.h", "VIDIOC_ENUMINPUT", 0x561a}, - {"linux/videodev2.h", "VIDIOC_G_CTRL", 0x561b}, - {"linux/videodev2.h", "VIDIOC_S_CTRL", 0x561c}, - {"linux/videodev2.h", "VIDIOC_G_TUNER", 0x561d}, - {"linux/videodev2.h", "VIDIOC_S_TUNER", 0x561e}, - {"linux/videodev2.h", "VIDIOC_G_AUDIO", 0x5621}, - {"linux/videodev2.h", "VIDIOC_S_AUDIO", 0x5622}, - {"linux/videodev2.h", "VIDIOC_QUERYCTRL", 0x5624}, - {"linux/videodev2.h", "VIDIOC_QUERYMENU", 0x5625}, - {"linux/videodev2.h", "VIDIOC_G_INPUT", 0x5626}, - {"linux/videodev2.h", "VIDIOC_S_INPUT", 0x5627}, - {"linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", 0x5628}, - {"linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", 0x5629}, - {"linux/videodev2.h", "VIDIOC_G_OUTPUT", 0x562e}, - {"linux/videodev2.h", "VIDIOC_S_OUTPUT", 0x562f}, - {"linux/videodev2.h", "VIDIOC_ENUMOUTPUT", 0x5630}, - {"linux/videodev2.h", "VIDIOC_G_AUDOUT", 0x5631}, - {"linux/videodev2.h", "VIDIOC_S_AUDOUT", 0x5632}, - {"linux/videodev2.h", "VIDIOC_G_MODULATOR", 0x5636}, - {"linux/videodev2.h", "VIDIOC_S_MODULATOR", 0x5637}, - {"linux/videodev2.h", "VIDIOC_G_FREQUENCY", 0x5638}, - {"linux/videodev2.h", "VIDIOC_S_FREQUENCY", 0x5639}, - {"linux/videodev2.h", "VIDIOC_CROPCAP", 0x563a}, - {"linux/videodev2.h", "VIDIOC_G_CROP", 0x563b}, - {"linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", 0x563b}, - {"linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", 0x563c}, - {"linux/videodev2.h", "VIDIOC_S_CROP", 0x563c}, - {"linux/videodev2.h", "VIDIOC_G_JPEGCOMP", 0x563d}, - {"linux/videodev2.h", "VIDIOC_S_JPEGCOMP", 0x563e}, - {"linux/videodev2.h", "VIDIOC_QUERYSTD", 0x563f}, - {"linux/videodev2.h", "VIDIOC_TRY_FMT", 0x5640}, - {"linux/videodev2.h", "VIDIOC_ENUMAUDIO", 0x5641}, - {"linux/videodev2.h", "VIDIOC_ENUMAUDOUT", 0x5642}, - {"linux/videodev2.h", "VIDIOC_G_PRIORITY", 0x5643}, - {"linux/videodev2.h", "VIDIOC_S_PRIORITY", 0x5644}, - {"linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", 0x5645}, - {"linux/videodev2.h", "VIDIOC_LOG_STATUS", 0x5646}, - {"linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", 0x5647}, - {"linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", 0x5648}, - {"linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", 0x5649}, - {"linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", 0x564a}, - {"linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", 0x564b}, - {"linux/videodev2.h", "VIDIOC_G_ENC_INDEX", 0x564c}, - {"linux/videodev2.h", "VIDIOC_ENCODER_CMD", 0x564d}, - {"linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", 0x564e}, - {"linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", 0x564f}, - {"linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", 0x5650}, - {"linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", 0x5652}, - {"linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", 0x5657}, - {"linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", 0x5658}, - {"linux/videodev2.h", "VIDIOC_DQEVENT", 0x5659}, - {"linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", 0x565a}, - {"linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", 0x565b}, - {"linux/videodev2.h", "VIDIOC_CREATE_BUFS", 0x565c}, - {"linux/videodev2.h", "VIDIOC_PREPARE_BUF", 0x565d}, - {"linux/videodev2.h", "VIDIOC_G_SELECTION", 0x565e}, - {"linux/videodev2.h", "VIDIOC_S_SELECTION", 0x565f}, - {"linux/videodev2.h", "VIDIOC_DECODER_CMD", 0x5660}, - {"linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", 0x5661}, - {"linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", 0x5662}, - {"linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", 0x5663}, - {"linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", 0x5664}, - {"linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", 0x5665}, - {"linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", 0x5666}, - {"linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", 0x56c0}, - {"linux/ivtv.h", "IVTV_IOC_DMA_FRAME", 0x56c0}, - {"linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", 0x56c1}, - {"sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", 0x5700}, - {"linux/watchdog.h", "WDIOC_GETSUPPORT", 0x5700}, - {"sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", 0x5701}, - {"linux/watchdog.h", "WDIOC_GETSTATUS", 0x5701}, - {"linux/watchdog.h", "WDIOC_GETBOOTSTATUS", 0x5702}, - {"linux/watchdog.h", "WDIOC_GETTEMP", 0x5703}, - {"linux/watchdog.h", "WDIOC_SETOPTIONS", 0x5704}, - {"linux/watchdog.h", "WDIOC_KEEPALIVE", 0x5705}, - {"linux/watchdog.h", "WDIOC_SETTIMEOUT", 0x5706}, - {"linux/watchdog.h", "WDIOC_GETTIMEOUT", 0x5707}, - {"linux/watchdog.h", "WDIOC_SETPRETIMEOUT", 0x5708}, - {"linux/watchdog.h", "WDIOC_GETPRETIMEOUT", 0x5709}, - {"linux/watchdog.h", "WDIOC_GETTIMELEFT", 0x570a}, - {"sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", 0x5710}, - {"sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", 0x5720}, - {"sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", 0x5730}, - {"sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", 0x5731}, - {"linux/pktcdvd.h", "PACKET_CTRL_CMD", 0x5801}, - {"linux/fs.h", "FIFREEZE", 0x5877}, - {"linux/fs.h", "FITHAW", 0x5878}, - {"linux/fs.h", "FITRIM", 0x5879}, - {"linux/sonet.h", "SONET_GETSTAT", 0x6110}, - {"linux/sonet.h", "SONET_GETSTATZ", 0x6111}, - {"linux/sonet.h", "SONET_SETDIAG", 0x6112}, - {"linux/sonet.h", "SONET_CLRDIAG", 0x6113}, - {"linux/sonet.h", "SONET_GETDIAG", 0x6114}, - {"linux/sonet.h", "SONET_SETFRAMING", 0x6115}, - {"linux/sonet.h", "SONET_GETFRAMING", 0x6116}, - {"linux/sonet.h", "SONET_GETFRSENSE", 0x6117}, - {"linux/atm_idt77105.h", "IDT77105_GETSTAT", 0x6132}, - {"linux/atm_idt77105.h", "IDT77105_GETSTATZ", 0x6133}, - {"linux/atmdev.h", "ATM_GETSTAT", 0x6150}, - {"linux/atmdev.h", "ATM_GETSTATZ", 0x6151}, - {"linux/atmdev.h", "ATM_GETLOOP", 0x6152}, - {"linux/atmdev.h", "ATM_SETLOOP", 0x6153}, - {"linux/atmdev.h", "ATM_QUERYLOOP", 0x6154}, - {"linux/atm_eni.h", "ENI_MEMDUMP", 0x6160}, - {"linux/atm_he.h", "HE_GET_REG", 0x6160}, - {"linux/atm_nicstar.h", "NS_GETPSTAT", 0x6161}, - {"linux/atm_zatm.h", "ZATM_GETPOOL", 0x6161}, - {"linux/atm_nicstar.h", "NS_SETBUFLEV", 0x6162}, - {"linux/atm_zatm.h", "ZATM_GETPOOLZ", 0x6162}, - {"linux/atm_nicstar.h", "NS_ADJBUFLEV", 0x6163}, - {"linux/atm_zatm.h", "ZATM_SETPOOL", 0x6163}, - {"linux/atm_eni.h", "ENI_SETMULT", 0x6167}, - {"linux/atm_tcp.h", "SIOCSIFATMTCP", 0x6180}, - {"linux/atmdev.h", "ATM_GETLINKRATE", 0x6181}, - {"linux/atmdev.h", "ATM_GETNAMES", 0x6183}, - {"linux/atmdev.h", "ATM_GETTYPE", 0x6184}, - {"linux/atmdev.h", "ATM_GETESI", 0x6185}, - {"linux/atmdev.h", "ATM_GETADDR", 0x6186}, - {"linux/atmdev.h", "ATM_RSTADDR", 0x6187}, - {"linux/atmdev.h", "ATM_ADDADDR", 0x6188}, - {"linux/atmdev.h", "ATM_DELADDR", 0x6189}, - {"linux/atmdev.h", "ATM_GETCIRANGE", 0x618a}, - {"linux/atmdev.h", "ATM_SETCIRANGE", 0x618b}, - {"linux/atmdev.h", "ATM_SETESI", 0x618c}, - {"linux/atmdev.h", "ATM_SETESIF", 0x618d}, - {"linux/atm_tcp.h", "ATMTCP_CREATE", 0x618e}, - {"linux/atmdev.h", "ATM_ADDLECSADDR", 0x618e}, - {"linux/atm_tcp.h", "ATMTCP_REMOVE", 0x618f}, - {"linux/atmdev.h", "ATM_DELLECSADDR", 0x618f}, - {"linux/atmdev.h", "ATM_GETLECSADDR", 0x6190}, - {"linux/atmbr2684.h", "BR2684_SETFILT", 0x6190}, - {"linux/atmlec.h", "ATMLEC_CTRL", 0x61d0}, - {"linux/atmlec.h", "ATMLEC_DATA", 0x61d1}, - {"linux/atmlec.h", "ATMLEC_MCAST", 0x61d2}, - {"linux/atmmpc.h", "ATMMPC_CTRL", 0x61d8}, - {"linux/atmmpc.h", "ATMMPC_DATA", 0x61d9}, - {"linux/atmclip.h", "SIOCMKCLIP", 0x61e0}, - {"linux/atmarp.h", "ATMARPD_CTRL", 0x61e1}, - {"linux/atmarp.h", "ATMARP_MKIP", 0x61e2}, - {"linux/atmarp.h", "ATMARP_SETENTRY", 0x61e3}, - {"linux/atmarp.h", "ATMARP_ENCAP", 0x61e5}, - {"linux/atmsvc.h", "ATMSIGD_CTRL", 0x61f0}, - {"linux/atmdev.h", "ATM_SETSC", 0x61f1}, - {"linux/atmdev.h", "ATM_SETBACKEND", 0x61f2}, - {"linux/atmdev.h", "ATM_NEWBACKENDIF", 0x61f3}, - {"linux/atmdev.h", "ATM_ADDPARTY", 0x61f4}, - {"linux/atmdev.h", "COMPAT_ATM_ADDPARTY", 0x61f4}, - {"linux/atmdev.h", "ATM_DROPPARTY", 0x61f5}, - {"linux/cm4000_cs.h", "CM_IOCGSTATUS", 0x6300}, - {"linux/chio.h", "CHIOMOVE", 0x6301}, - {"linux/cm4000_cs.h", "CM_IOCGATR", 0x6301}, - {"linux/chio.h", "CHIOEXCHANGE", 0x6302}, - {"linux/cm4000_cs.h", "CM_IOCSPTS", 0x6302}, - {"linux/chio.h", "CHIOPOSITION", 0x6303}, - {"linux/cm4000_cs.h", "CM_IOCSRDR", 0x6303}, - {"linux/chio.h", "CHIOGPICKER", 0x6304}, - {"linux/cm4000_cs.h", "CM_IOCARDOFF", 0x6304}, - {"linux/chio.h", "CHIOSPICKER", 0x6305}, - {"linux/chio.h", "CHIOGPARAMS", 0x6306}, - {"linux/chio.h", "CHIOGSTATUS", 0x6308}, - {"linux/coda.h", "CIOC_KERNEL_VERSION", 0x630a}, - {"linux/chio.h", "CHIOGELEM", 0x6310}, - {"linux/chio.h", "CHIOINITELEM", 0x6311}, - {"linux/chio.h", "CHIOSVOLTAG", 0x6312}, - {"linux/chio.h", "CHIOGVPARAMS", 0x6313}, - {"asm/msr.h", "X86_IOC_RDMSR_REGS", 0x63a0}, - {"asm/msr.h", "X86_IOC_WRMSR_REGS", 0x63a1}, - {"linux/cm4000_cs.h", "CM_IOSDBGLVL", 0x63fa}, - {"linux/fs.h", "FS_IOC32_GETFLAGS", 0x6601}, - {"linux/fs.h", "FS_IOC_GETFLAGS", 0x6601}, - {"linux/fs.h", "FS_IOC32_SETFLAGS", 0x6602}, - {"linux/fs.h", "FS_IOC_SETFLAGS", 0x6602}, - {"linux/fs.h", "FS_IOC_FIEMAP", 0x660b}, - {"linux/hpet.h", "HPET_IE_ON", 0x6801}, - {"linux/hpet.h", "HPET_IE_OFF", 0x6802}, - {"linux/hpet.h", "HPET_INFO", 0x6803}, - {"linux/hpet.h", "HPET_EPI", 0x6804}, - {"linux/hpet.h", "HPET_DPI", 0x6805}, - {"linux/hpet.h", "HPET_IRQFREQ", 0x6806}, - {"linux/i2o-dev.h", "I2OGETIOPS", 0x6900}, - {"linux/i2o-dev.h", "I2OHRTGET", 0x6901}, - {"linux/i2o-dev.h", "I2OLCTGET", 0x6902}, - {"linux/i2o-dev.h", "I2OPARMSET", 0x6903}, - {"linux/i2o-dev.h", "I2OPARMGET", 0x6904}, - {"linux/i2o-dev.h", "I2OSWDL", 0x6905}, - {"linux/i2o-dev.h", "I2OSWUL", 0x6906}, - {"linux/i2o-dev.h", "I2OSWDEL", 0x6907}, - {"linux/i2o-dev.h", "I2OVALIDATE", 0x6908}, - {"linux/i2o-dev.h", "I2OHTML", 0x6909}, - {"linux/i2o-dev.h", "I2OEVTREG", 0x690a}, - {"linux/i2o-dev.h", "I2OEVTGET", 0x690b}, - {"linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", 0x690b}, - {"linux/i2o-dev.h", "I2OPASSTHRU", 0x690c}, - {"linux/i2o-dev.h", "I2OPASSTHRU32", 0x690c}, - {"linux/ipmi.h", "IPMICTL_RECEIVE_MSG", 0x690c}, - {"linux/ipmi.h", "IPMICTL_SEND_COMMAND", 0x690d}, - {"linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", 0x690e}, - {"linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", 0x690f}, - {"linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", 0x6910}, - {"linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", 0x6911}, - {"linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", 0x6912}, - {"linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", 0x6913}, - {"linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", 0x6914}, - {"linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", 0x6915}, - {"linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", 0x6916}, - {"linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", 0x6917}, - {"linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", 0x691c}, - {"linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", 0x691d}, - {"linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", 0x691e}, - {"linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", 0x691f}, - {"linux/i8k.h", "I8K_BIOS_VERSION", 0x6980}, - {"linux/i8k.h", "I8K_MACHINE_ID", 0x6981}, - {"linux/i8k.h", "I8K_POWER_STATUS", 0x6982}, - {"linux/i8k.h", "I8K_FN_STATUS", 0x6983}, - {"linux/i8k.h", "I8K_GET_TEMP", 0x6984}, - {"linux/i8k.h", "I8K_GET_SPEED", 0x6985}, - {"linux/i8k.h", "I8K_GET_FAN", 0x6986}, - {"linux/i8k.h", "I8K_SET_FAN", 0x6987}, - {"linux/joystick.h", "JSIOCGVERSION", 0x6a01}, - {"linux/joystick.h", "JSIOCGAXES", 0x6a11}, - {"linux/joystick.h", "JSIOCGBUTTONS", 0x6a12}, - {"linux/joystick.h", "JSIOCSCORR", 0x6a21}, - {"linux/joystick.h", "JSIOCGCORR", 0x6a22}, - {"linux/joystick.h", "JSIOCSAXMAP", 0x6a31}, - {"linux/joystick.h", "JSIOCGAXMAP", 0x6a32}, - {"linux/joystick.h", "JSIOCSBTNMAP", 0x6a33}, - {"linux/joystick.h", "JSIOCGBTNMAP", 0x6a34}, - {"linux/udf_fs_i.h", "UDF_GETEASIZE", 0x6c40}, - {"linux/udf_fs_i.h", "UDF_GETEABLOCK", 0x6c41}, - {"linux/udf_fs_i.h", "UDF_GETVOLIDENT", 0x6c42}, - {"linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", 0x6c43}, - {"linux/synclink.h", "MGSL_IOCSPARAMS", 0x6d00}, - {"linux/mmtimer.h", "MMTIMER_GETOFFSET", 0x6d00}, - {"linux/soundcard.h", "SNDCTL_MIDI_PRETIME", 0x6d00}, - {"linux/synclink.h", "MGSL_IOCGPARAMS", 0x6d01}, - {"linux/mmtimer.h", "MMTIMER_GETRES", 0x6d01}, - {"linux/mtio.h", "MTIOCTOP", 0x6d01}, - {"linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", 0x6d01}, - {"linux/synclink.h", "MGSL_IOCSTXIDLE", 0x6d02}, - {"linux/mmtimer.h", "MMTIMER_GETFREQ", 0x6d02}, - {"linux/mtio.h", "MTIOCGET", 0x6d02}, - {"linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", 0x6d02}, - {"linux/synclink.h", "MGSL_IOCGTXIDLE", 0x6d03}, - {"linux/mtio.h", "MTIOCPOS", 0x6d03}, - {"linux/synclink.h", "MGSL_IOCTXENABLE", 0x6d04}, - {"linux/mmtimer.h", "MMTIMER_GETBITS", 0x6d04}, - {"linux/synclink.h", "MGSL_IOCRXENABLE", 0x6d05}, - {"linux/synclink.h", "MGSL_IOCTXABORT", 0x6d06}, - {"linux/mmtimer.h", "MMTIMER_MMAPAVAIL", 0x6d06}, - {"linux/synclink.h", "MGSL_IOCGSTATS", 0x6d07}, - {"linux/synclink.h", "MGSL_IOCWAITEVENT", 0x6d08}, - {"linux/synclink.h", "MGSL_IOCLOOPTXDONE", 0x6d09}, - {"linux/mmtimer.h", "MMTIMER_GETCOUNTER", 0x6d09}, - {"linux/synclink.h", "MGSL_IOCSIF", 0x6d0a}, - {"linux/synclink.h", "MGSL_IOCGIF", 0x6d0b}, - {"linux/synclink.h", "MGSL_IOCCLRMODCOUNT", 0x6d0f}, - {"linux/synclink.h", "MGSL_IOCSGPIO", 0x6d10}, - {"linux/synclink.h", "MGSL_IOCGGPIO", 0x6d11}, - {"linux/synclink.h", "MGSL_IOCWAITGPIO", 0x6d12}, - {"linux/synclink.h", "MGSL_IOCSXSYNC", 0x6d13}, - {"linux/synclink.h", "MGSL_IOCGXSYNC", 0x6d14}, - {"linux/synclink.h", "MGSL_IOCSXCTRL", 0x6d15}, - {"linux/synclink.h", "MGSL_IOCGXCTRL", 0x6d16}, - {"linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", 0x6e01}, - {"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", 0x6e02}, - {"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", 0x6e02}, - {"linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", 0x6e03}, - {"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", 0x6e04}, - {"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", 0x6e04}, - {"linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", 0x6e05}, - {"linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", 0x6e06}, - {"linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", 0x6e06}, - {"linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", 0x6e07}, - {"linux/ncp_fs.h", "NCP_IOC_GETROOT", 0x6e08}, - {"linux/ncp_fs.h", "NCP_IOC_SETROOT", 0x6e08}, - {"linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", 0x6e09}, - {"linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", 0x6e09}, - {"linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", 0x6e0a}, - {"linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", 0x6e0a}, - {"linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", 0x6e0b}, - {"linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", 0x6e0b}, - {"linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", 0x6e0c}, - {"linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", 0x6e0c}, - {"linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", 0x6ef8}, - {"linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", 0x6ef8}, - {"linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", 0x6ef9}, - {"linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", 0x6efa}, - {"linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", 0x6efa}, - {"linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", 0x6efb}, - {"linux/phantom.h", "PHN_GET_REG", 0x7000}, - {"linux/phantom.h", "PHN_SET_REG", 0x7001}, - {"linux/rtc.h", "RTC_AIE_ON", 0x7001}, - {"linux/phantom.h", "PHN_GET_REGS", 0x7002}, - {"linux/rtc.h", "RTC_AIE_OFF", 0x7002}, - {"linux/phantom.h", "PHN_SET_REGS", 0x7003}, - {"linux/rtc.h", "RTC_UIE_ON", 0x7003}, - {"linux/phantom.h", "PHN_NOT_OH", 0x7004}, - {"linux/rtc.h", "RTC_UIE_OFF", 0x7004}, - {"linux/phantom.h", "PHN_GETREG", 0x7005}, - {"linux/rtc.h", "RTC_PIE_ON", 0x7005}, - {"linux/phantom.h", "PHN_SETREG", 0x7006}, - {"linux/rtc.h", "RTC_PIE_OFF", 0x7006}, - {"linux/phantom.h", "PHN_GETREGS", 0x7007}, - {"linux/rtc.h", "RTC_ALM_SET", 0x7007}, - {"linux/phantom.h", "PHN_SETREGS", 0x7008}, - {"linux/rtc.h", "RTC_ALM_READ", 0x7008}, - {"linux/rtc.h", "RTC_RD_TIME", 0x7009}, - {"linux/rtc.h", "RTC_SET_TIME", 0x700a}, - {"linux/rtc.h", "RTC_IRQP_READ", 0x700b}, - {"linux/rtc.h", "RTC_IRQP_SET", 0x700c}, - {"linux/rtc.h", "RTC_EPOCH_READ", 0x700d}, - {"linux/rtc.h", "RTC_EPOCH_SET", 0x700e}, - {"linux/rtc.h", "RTC_WIE_ON", 0x700f}, - {"linux/rtc.h", "RTC_WKALM_SET", 0x700f}, - {"linux/rtc.h", "RTC_WIE_OFF", 0x7010}, - {"linux/rtc.h", "RTC_WKALM_RD", 0x7010}, - {"linux/rtc.h", "RTC_PLL_GET", 0x7011}, - {"linux/rtc.h", "RTC_PLL_SET", 0x7012}, - {"linux/rtc.h", "RTC_VL_READ", 0x7013}, - {"linux/rtc.h", "RTC_VL_CLR", 0x7014}, - {"linux/nvram.h", "NVRAM_INIT", 0x7040}, - {"linux/nvram.h", "NVRAM_SETCKS", 0x7041}, - {"linux/ppdev.h", "PPSETMODE", 0x7080}, - {"linux/ppdev.h", "PPRSTATUS", 0x7081}, - {"linux/ppdev.h", "PPRCONTROL", 0x7083}, - {"linux/ppdev.h", "PPWCONTROL", 0x7084}, - {"linux/ppdev.h", "PPRDATA", 0x7085}, - {"linux/ppdev.h", "PPWDATA", 0x7086}, - {"linux/ppdev.h", "PPCLAIM", 0x708b}, - {"linux/ppdev.h", "PPRELEASE", 0x708c}, - {"linux/ppdev.h", "PPYIELD", 0x708d}, - {"linux/ppdev.h", "PPFCONTROL", 0x708e}, - {"linux/ppdev.h", "PPEXCL", 0x708f}, - {"linux/ppdev.h", "PPDATADIR", 0x7090}, - {"linux/ppdev.h", "PPNEGOT", 0x7091}, - {"linux/ppdev.h", "PPWCTLONIRQ", 0x7092}, - {"linux/ppdev.h", "PPCLRIRQ", 0x7093}, - {"linux/ppdev.h", "PPSETPHASE", 0x7094}, - {"linux/ppdev.h", "PPGETTIME", 0x7095}, - {"linux/ppdev.h", "PPSETTIME", 0x7096}, - {"linux/ppdev.h", "PPGETMODES", 0x7097}, - {"linux/ppdev.h", "PPGETMODE", 0x7098}, - {"linux/ppdev.h", "PPGETPHASE", 0x7099}, - {"linux/ppdev.h", "PPGETFLAGS", 0x709a}, - {"linux/ppdev.h", "PPSETFLAGS", 0x709b}, - {"linux/pps.h", "PPS_GETPARAMS", 0x70a1}, - {"linux/pps.h", "PPS_SETPARAMS", 0x70a2}, - {"linux/pps.h", "PPS_GETCAP", 0x70a3}, - {"linux/pps.h", "PPS_FETCH", 0x70a4}, - {"linux/pps.h", "PPS_KC_BIND", 0x70a5}, - {"linux/serio.h", "SPIOCSTYPE", 0x7101}, - {"linux/telephony.h", "PHONE_CAPABILITIES", 0x7180}, - {"linux/telephony.h", "PHONE_CAPABILITIES_LIST", 0x7181}, - {"linux/telephony.h", "PHONE_CAPABILITIES_CHECK", 0x7182}, - {"linux/telephony.h", "PHONE_RING", 0x7183}, - {"linux/telephony.h", "PHONE_HOOKSTATE", 0x7184}, - {"linux/telephony.h", "PHONE_MAXRINGS", 0x7185}, - {"linux/telephony.h", "PHONE_RING_CADENCE", 0x7186}, - {"linux/telephony.h", "OLD_PHONE_RING_START", 0x7187}, - {"linux/telephony.h", "PHONE_RING_START", 0x7187}, - {"linux/telephony.h", "PHONE_RING_STOP", 0x7188}, - {"linux/telephony.h", "PHONE_REC_CODEC", 0x7189}, - {"linux/telephony.h", "PHONE_REC_START", 0x718a}, - {"linux/telephony.h", "PHONE_REC_STOP", 0x718b}, - {"linux/telephony.h", "PHONE_REC_DEPTH", 0x718c}, - {"linux/telephony.h", "PHONE_FRAME", 0x718d}, - {"linux/telephony.h", "PHONE_REC_VOLUME", 0x718e}, - {"linux/telephony.h", "PHONE_REC_LEVEL", 0x718f}, - {"linux/telephony.h", "PHONE_PLAY_CODEC", 0x7190}, - {"linux/telephony.h", "PHONE_PLAY_START", 0x7191}, - {"linux/telephony.h", "PHONE_PLAY_STOP", 0x7192}, - {"linux/telephony.h", "PHONE_PLAY_DEPTH", 0x7193}, - {"linux/telephony.h", "PHONE_PLAY_VOLUME", 0x7194}, - {"linux/telephony.h", "PHONE_PLAY_LEVEL", 0x7195}, - {"linux/telephony.h", "PHONE_DTMF_READY", 0x7196}, - {"linux/telephony.h", "PHONE_GET_DTMF", 0x7197}, - {"linux/telephony.h", "PHONE_GET_DTMF_ASCII", 0x7198}, - {"linux/telephony.h", "PHONE_DTMF_OOB", 0x7199}, - {"linux/telephony.h", "PHONE_EXCEPTION", 0x719a}, - {"linux/telephony.h", "PHONE_PLAY_TONE", 0x719b}, - {"linux/telephony.h", "PHONE_SET_TONE_ON_TIME", 0x719c}, - {"linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", 0x719d}, - {"linux/telephony.h", "PHONE_GET_TONE_ON_TIME", 0x719e}, - {"linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", 0x719f}, - {"linux/telephony.h", "PHONE_GET_TONE_STATE", 0x71a0}, - {"linux/telephony.h", "PHONE_BUSY", 0x71a1}, - {"linux/telephony.h", "PHONE_RINGBACK", 0x71a2}, - {"linux/telephony.h", "PHONE_DIALTONE", 0x71a3}, - {"linux/telephony.h", "PHONE_CPT_STOP", 0x71a4}, - {"linux/telephony.h", "PHONE_PSTN_SET_STATE", 0x71a4}, - {"linux/telephony.h", "PHONE_PSTN_GET_STATE", 0x71a5}, - {"linux/telephony.h", "PHONE_WINK_DURATION", 0x71a6}, - {"linux/telephony.h", "PHONE_QUERY_CODEC", 0x71a7}, - {"linux/telephony.h", "PHONE_PSTN_LINETEST", 0x71a8}, - {"linux/telephony.h", "PHONE_VAD", 0x71a9}, - {"linux/telephony.h", "PHONE_WINK", 0x71aa}, - {"linux/ixjuser.h", "IXJCTL_DSP_RESET", 0x71c0}, - {"linux/ixjuser.h", "IXJCTL_CARDTYPE", 0x71c1}, - {"linux/ixjuser.h", "IXJCTL_SERIAL", 0x71c2}, - {"linux/ixjuser.h", "IXJCTL_DSP_TYPE", 0x71c3}, - {"linux/ixjuser.h", "IXJCTL_DSP_VERSION", 0x71c4}, - {"linux/ixjuser.h", "IXJCTL_DSP_IDLE", 0x71c5}, - {"linux/ixjuser.h", "IXJCTL_TESTRAM", 0x71c6}, - {"linux/ixjuser.h", "IXJCTL_SET_FILTER", 0x71c7}, - {"linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", 0x71c8}, - {"linux/ixjuser.h", "IXJCTL_INIT_TONE", 0x71c9}, - {"linux/ixjuser.h", "IXJCTL_TONE_CADENCE", 0x71ca}, - {"linux/ixjuser.h", "IXJCTL_AEC_START", 0x71cb}, - {"linux/ixjuser.h", "IXJCTL_AEC_STOP", 0x71cc}, - {"linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", 0x71cd}, - {"linux/ixjuser.h", "IXJCTL_SET_LED", 0x71ce}, - {"linux/ixjuser.h", "IXJCTL_MIXER", 0x71cf}, - {"linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", 0x71d0}, - {"linux/ixjuser.h", "IXJCTL_PORT", 0x71d1}, - {"linux/ixjuser.h", "IXJCTL_DAA_AGAIN", 0x71d2}, - {"linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", 0x71d3}, - {"linux/ixjuser.h", "IXJCTL_CID", 0x71d4}, - {"linux/ixjuser.h", "IXJCTL_POTS_PSTN", 0x71d5}, - {"linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", 0x71d6}, - {"linux/ixjuser.h", "IXJCTL_PLAY_CID", 0x71d7}, - {"linux/ixjuser.h", "IXJCTL_VMWI", 0x71d8}, - {"linux/ixjuser.h", "IXJCTL_CIDCW", 0x71d9}, - {"linux/ixjuser.h", "IXJCTL_VERSION", 0x71da}, - {"linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", 0x71db}, - {"linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", 0x71dc}, - {"linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", 0x71dd}, - {"linux/ixjuser.h", "IXJCTL_HZ", 0x71e0}, - {"linux/ixjuser.h", "IXJCTL_RATE", 0x71e1}, - {"linux/ixjuser.h", "IXJCTL_FRAMES_READ", 0x71e2}, - {"linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", 0x71e3}, - {"linux/ixjuser.h", "IXJCTL_READ_WAIT", 0x71e4}, - {"linux/ixjuser.h", "IXJCTL_WRITE_WAIT", 0x71e5}, - {"linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", 0x71e6}, - {"linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", 0x71e7}, - {"linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", 0x71e8}, - {"linux/ixjuser.h", "IXJCTL_SIGCTL", 0x71e9}, - {"linux/ixjuser.h", "IXJCTL_SC_RXG", 0x71ea}, - {"linux/ixjuser.h", "IXJCTL_SC_TXG", 0x71eb}, - {"linux/ixjuser.h", "IXJCTL_INTERCOM_START", 0x71fd}, - {"linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", 0x71fe}, - {"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", 0x7201}, - {"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", 0x7202}, - {"linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", 0x7210}, - {"linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", 0x7211}, - {"linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", 0x7213}, - {"linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", 0x7436}, - {"linux/ppp-ioctl.h", "PPPIOCGCHAN", 0x7437}, - {"linux/ppp-ioctl.h", "PPPIOCATTCHAN", 0x7438}, - {"linux/ppp-ioctl.h", "PPPIOCDISCONN", 0x7439}, - {"linux/ppp-ioctl.h", "PPPIOCCONNECT", 0x743a}, - {"linux/ppp-ioctl.h", "PPPIOCSMRRU", 0x743b}, - {"linux/ppp-ioctl.h", "PPPIOCDETACH", 0x743c}, - {"linux/ppp-ioctl.h", "PPPIOCATTACH", 0x743d}, - {"linux/ppp-ioctl.h", "PPPIOCNEWUNIT", 0x743e}, - {"linux/ppp-ioctl.h", "PPPIOCGIDLE", 0x743f}, - {"linux/ppp-ioctl.h", "PPPIOCSDEBUG", 0x7440}, - {"linux/ppp-ioctl.h", "PPPIOCGDEBUG", 0x7441}, - {"linux/ppp-ioctl.h", "PPPIOCSACTIVE", 0x7446}, - {"linux/ppp-ioctl.h", "PPPIOCSPASS", 0x7447}, - {"linux/ppp-ioctl.h", "PPPIOCSNPMODE", 0x744b}, - {"linux/ppp-ioctl.h", "PPPIOCGNPMODE", 0x744c}, - {"linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", 0x744d}, - {"linux/ppp-ioctl.h", "PPPIOCXFERUNIT", 0x744e}, - {"linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", 0x744f}, - {"linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", 0x7450}, - {"linux/ppp-ioctl.h", "PPPIOCSMAXCID", 0x7451}, - {"linux/ppp-ioctl.h", "PPPIOCSMRU", 0x7452}, - {"linux/ppp-ioctl.h", "PPPIOCGMRU", 0x7453}, - {"linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", 0x7454}, - {"linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", 0x7455}, - {"linux/ppp-ioctl.h", "PPPIOCGUNIT", 0x7456}, - {"linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", 0x7457}, - {"linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", 0x7458}, - {"linux/ppp-ioctl.h", "PPPIOCSFLAGS", 0x7459}, - {"linux/ppp-ioctl.h", "PPPIOCGFLAGS", 0x745a}, - {"linux/isdn_ppp.h", "PPPIOCGCALLINFO", 0x7480}, - {"linux/isdn_ppp.h", "PPPIOCBUNDLE", 0x7481}, - {"linux/isdn_ppp.h", "PPPIOCGMPFLAGS", 0x7482}, - {"linux/isdn_ppp.h", "PPPIOCSMPFLAGS", 0x7483}, - {"linux/isdn_ppp.h", "PPPIOCSMPMTU", 0x7484}, - {"linux/isdn_ppp.h", "PPPIOCSMPMRU", 0x7485}, - {"linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", 0x7486}, - {"linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", 0x7487}, - {"linux/isdn_ppp.h", "PPPIOCGIFNAME", 0x7488}, - {"linux/toshiba.h", "TOSH_SMM", 0x7490}, - {"linux/uvcvideo.h", "UVCIOC_CTRL_MAP", 0x7520}, - {"linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", 0x7521}, - {"linux/sonypi.h", "SONYPI_IOCGBRT", 0x7600}, - {"linux/sonypi.h", "SONYPI_IOCSBRT", 0x7600}, - {"linux/fs.h", "FS_IOC32_GETVERSION", 0x7601}, - {"linux/fs.h", "FS_IOC_GETVERSION", 0x7601}, - {"linux/fs.h", "FS_IOC32_SETVERSION", 0x7602}, - {"linux/fs.h", "FS_IOC_SETVERSION", 0x7602}, - {"linux/sonypi.h", "SONYPI_IOCGBAT1CAP", 0x7602}, - {"linux/sonypi.h", "SONYPI_IOCGBAT1REM", 0x7603}, - {"linux/sonypi.h", "SONYPI_IOCGBAT2CAP", 0x7604}, - {"linux/sonypi.h", "SONYPI_IOCGBAT2REM", 0x7605}, - {"linux/sonypi.h", "SONYPI_IOCGBATFLAGS", 0x7607}, - {"linux/sonypi.h", "SONYPI_IOCGBLUE", 0x7608}, - {"linux/sonypi.h", "SONYPI_IOCSBLUE", 0x7609}, - {"linux/sonypi.h", "SONYPI_IOCGFAN", 0x760a}, - {"linux/sonypi.h", "SONYPI_IOCSFAN", 0x760b}, - {"linux/sonypi.h", "SONYPI_IOCGTEMP", 0x760c}, - {"linux/meye.h", "MEYEIOC_G_PARAMS", 0x76c0}, - {"linux/meye.h", "MEYEIOC_S_PARAMS", 0x76c1}, - {"linux/meye.h", "MEYEIOC_QBUF_CAPT", 0x76c2}, - {"linux/meye.h", "MEYEIOC_SYNC", 0x76c3}, - {"linux/meye.h", "MEYEIOC_STILLCAPT", 0x76c4}, - {"linux/meye.h", "MEYEIOC_STILLJCAPT", 0x76c5}, - {"linux/media.h", "MEDIA_IOC_DEVICE_INFO", 0x7c00}, - {"linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", 0x7c01}, - {"linux/media.h", "MEDIA_IOC_ENUM_LINKS", 0x7c02}, - {"linux/media.h", "MEDIA_IOC_SETUP_LINK", 0x7c03}, - {"asm-generic/sockios.h", "FIOSETOWN", 0x8901}, - {"asm-generic/sockios.h", "SIOCSPGRP", 0x8902}, - {"asm-generic/sockios.h", "FIOGETOWN", 0x8903}, - {"asm-generic/sockios.h", "SIOCGPGRP", 0x8904}, - {"asm-generic/sockios.h", "SIOCATMARK", 0x8905}, - {"asm-generic/sockios.h", "SIOCGSTAMP", 0x8906}, - {"asm-generic/sockios.h", "SIOCGSTAMPNS", 0x8907}, - {"linux/sockios.h", "SIOCADDRT", 0x890b}, - {"linux/sockios.h", "SIOCDELRT", 0x890c}, - {"linux/sockios.h", "SIOCRTMSG", 0x890d}, - {"linux/sockios.h", "SIOCGIFNAME", 0x8910}, - {"linux/sockios.h", "SIOCSIFLINK", 0x8911}, - {"linux/sockios.h", "SIOCGIFCONF", 0x8912}, - {"linux/sockios.h", "SIOCGIFFLAGS", 0x8913}, - {"linux/sockios.h", "SIOCSIFFLAGS", 0x8914}, - {"linux/sockios.h", "SIOCGIFADDR", 0x8915}, - {"linux/sockios.h", "SIOCSIFADDR", 0x8916}, - {"linux/sockios.h", "SIOCGIFDSTADDR", 0x8917}, - {"linux/sockios.h", "SIOCSIFDSTADDR", 0x8918}, - {"linux/sockios.h", "SIOCGIFBRDADDR", 0x8919}, - {"linux/sockios.h", "SIOCSIFBRDADDR", 0x891a}, - {"linux/sockios.h", "SIOCGIFNETMASK", 0x891b}, - {"linux/sockios.h", "SIOCSIFNETMASK", 0x891c}, - {"linux/sockios.h", "SIOCGIFMETRIC", 0x891d}, - {"linux/sockios.h", "SIOCSIFMETRIC", 0x891e}, - {"linux/sockios.h", "SIOCGIFMEM", 0x891f}, - {"linux/sockios.h", "SIOCSIFMEM", 0x8920}, - {"linux/sockios.h", "SIOCGIFMTU", 0x8921}, - {"linux/sockios.h", "SIOCSIFMTU", 0x8922}, - {"linux/sockios.h", "SIOCSIFNAME", 0x8923}, - {"linux/sockios.h", "SIOCSIFHWADDR", 0x8924}, - {"linux/sockios.h", "SIOCGIFENCAP", 0x8925}, - {"linux/sockios.h", "SIOCSIFENCAP", 0x8926}, - {"linux/sockios.h", "SIOCGIFHWADDR", 0x8927}, - {"linux/sockios.h", "SIOCGIFSLAVE", 0x8929}, - {"linux/sockios.h", "SIOCSIFSLAVE", 0x8930}, - {"linux/sockios.h", "SIOCADDMULTI", 0x8931}, - {"linux/sockios.h", "SIOCDELMULTI", 0x8932}, - {"linux/sockios.h", "SIOCGIFINDEX", 0x8933}, - {"linux/sockios.h", "SIOCSIFPFLAGS", 0x8934}, - {"linux/sockios.h", "SIOCGIFPFLAGS", 0x8935}, - {"linux/sockios.h", "SIOCDIFADDR", 0x8936}, - {"linux/sockios.h", "SIOCSIFHWBROADCAST", 0x8937}, - {"linux/sockios.h", "SIOCGIFCOUNT", 0x8938}, - {"linux/sockios.h", "SIOCGIFBR", 0x8940}, - {"linux/sockios.h", "SIOCSIFBR", 0x8941}, - {"linux/sockios.h", "SIOCGIFTXQLEN", 0x8942}, - {"linux/sockios.h", "SIOCSIFTXQLEN", 0x8943}, - {"linux/sockios.h", "SIOCETHTOOL", 0x8946}, - {"linux/sockios.h", "SIOCGMIIPHY", 0x8947}, - {"linux/sockios.h", "SIOCGMIIREG", 0x8948}, - {"linux/sockios.h", "SIOCSMIIREG", 0x8949}, - {"linux/sockios.h", "SIOCWANDEV", 0x894a}, - {"linux/sockios.h", "SIOCOUTQNSD", 0x894b}, - {"linux/sockios.h", "SIOCDARP", 0x8953}, - {"linux/sockios.h", "SIOCGARP", 0x8954}, - {"linux/sockios.h", "SIOCSARP", 0x8955}, - {"linux/sockios.h", "SIOCDRARP", 0x8960}, - {"linux/sockios.h", "SIOCGRARP", 0x8961}, - {"linux/sockios.h", "SIOCSRARP", 0x8962}, - {"linux/sockios.h", "SIOCGIFMAP", 0x8970}, - {"linux/sockios.h", "SIOCSIFMAP", 0x8971}, - {"linux/sockios.h", "SIOCADDDLCI", 0x8980}, - {"linux/sockios.h", "SIOCDELDLCI", 0x8981}, - {"linux/sockios.h", "SIOCGIFVLAN", 0x8982}, - {"linux/sockios.h", "SIOCSIFVLAN", 0x8983}, - {"linux/sockios.h", "SIOCBONDENSLAVE", 0x8990}, - {"linux/sockios.h", "SIOCBONDRELEASE", 0x8991}, - {"linux/sockios.h", "SIOCBONDSETHWADDR", 0x8992}, - {"linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0x8993}, - {"linux/sockios.h", "SIOCBONDINFOQUERY", 0x8994}, - {"linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0x8995}, - {"linux/sockios.h", "SIOCBRADDBR", 0x89a0}, - {"linux/sockios.h", "SIOCBRDELBR", 0x89a1}, - {"linux/sockios.h", "SIOCBRADDIF", 0x89a2}, - {"linux/sockios.h", "SIOCBRDELIF", 0x89a3}, - {"linux/sockios.h", "SIOCSHWTSTAMP", 0x89b0}, - {"linux/dn.h", "OSIOCSNETADDR", 0x89e0}, - {"linux/sockios.h", "SIOCPROTOPRIVATE", 0x89e0}, - {"linux/dn.h", "SIOCSNETADDR", 0x89e0}, - {"linux/dn.h", "OSIOCGNETADDR", 0x89e1}, - {"linux/dn.h", "SIOCGNETADDR", 0x89e1}, - {"linux/sockios.h", "SIOCDEVPRIVATE", 0x89f0}, - {"linux/wireless.h", "SIOCIWFIRST", 0x8b00}, - {"linux/wireless.h", "SIOCSIWCOMMIT", 0x8b00}, - {"linux/wireless.h", "SIOCGIWNAME", 0x8b01}, - {"linux/wireless.h", "SIOCSIWNWID", 0x8b02}, - {"linux/wireless.h", "SIOCGIWNWID", 0x8b03}, - {"linux/wireless.h", "SIOCSIWFREQ", 0x8b04}, - {"linux/wireless.h", "SIOCGIWFREQ", 0x8b05}, - {"linux/wireless.h", "SIOCSIWMODE", 0x8b06}, - {"linux/wireless.h", "SIOCGIWMODE", 0x8b07}, - {"linux/wireless.h", "SIOCSIWSENS", 0x8b08}, - {"linux/wireless.h", "SIOCGIWSENS", 0x8b09}, - {"linux/wireless.h", "SIOCSIWRANGE", 0x8b0a}, - {"linux/wireless.h", "SIOCGIWRANGE", 0x8b0b}, - {"linux/wireless.h", "SIOCSIWPRIV", 0x8b0c}, - {"linux/wireless.h", "SIOCGIWPRIV", 0x8b0d}, - {"linux/wireless.h", "SIOCSIWSTATS", 0x8b0e}, - {"linux/wireless.h", "SIOCGIWSTATS", 0x8b0f}, - {"linux/wireless.h", "SIOCSIWSPY", 0x8b10}, - {"linux/wireless.h", "SIOCGIWSPY", 0x8b11}, - {"linux/wireless.h", "SIOCSIWTHRSPY", 0x8b12}, - {"linux/wireless.h", "SIOCGIWTHRSPY", 0x8b13}, - {"linux/wireless.h", "SIOCSIWAP", 0x8b14}, - {"linux/wireless.h", "SIOCGIWAP", 0x8b15}, - {"linux/wireless.h", "SIOCSIWMLME", 0x8b16}, - {"linux/wireless.h", "SIOCGIWAPLIST", 0x8b17}, - {"linux/wireless.h", "SIOCSIWSCAN", 0x8b18}, - {"linux/wireless.h", "SIOCGIWSCAN", 0x8b19}, - {"linux/wireless.h", "SIOCSIWESSID", 0x8b1a}, - {"linux/wireless.h", "SIOCGIWESSID", 0x8b1b}, - {"linux/wireless.h", "SIOCSIWNICKN", 0x8b1c}, - {"linux/wireless.h", "SIOCGIWNICKN", 0x8b1d}, - {"linux/wireless.h", "SIOCSIWRATE", 0x8b20}, - {"linux/wireless.h", "SIOCGIWRATE", 0x8b21}, - {"linux/wireless.h", "SIOCSIWRTS", 0x8b22}, - {"linux/wireless.h", "SIOCGIWRTS", 0x8b23}, - {"linux/wireless.h", "SIOCSIWFRAG", 0x8b24}, - {"linux/wireless.h", "SIOCGIWFRAG", 0x8b25}, - {"linux/wireless.h", "SIOCSIWTXPOW", 0x8b26}, - {"linux/wireless.h", "SIOCGIWTXPOW", 0x8b27}, - {"linux/wireless.h", "SIOCSIWRETRY", 0x8b28}, - {"linux/wireless.h", "SIOCGIWRETRY", 0x8b29}, - {"linux/wireless.h", "SIOCSIWENCODE", 0x8b2a}, - {"linux/wireless.h", "SIOCGIWENCODE", 0x8b2b}, - {"linux/wireless.h", "SIOCSIWPOWER", 0x8b2c}, - {"linux/wireless.h", "SIOCGIWPOWER", 0x8b2d}, - {"linux/wireless.h", "SIOCSIWGENIE", 0x8b30}, - {"linux/wireless.h", "SIOCGIWGENIE", 0x8b31}, - {"linux/wireless.h", "SIOCSIWAUTH", 0x8b32}, - {"linux/wireless.h", "SIOCGIWAUTH", 0x8b33}, - {"linux/wireless.h", "SIOCSIWENCODEEXT", 0x8b34}, - {"linux/wireless.h", "SIOCGIWENCODEEXT", 0x8b35}, - {"linux/wireless.h", "SIOCSIWPMKSA", 0x8b36}, - {"linux/wireless.h", "SIOCIWFIRSTPRIV", 0x8be0}, - {"linux/wireless.h", "SIOCIWLASTPRIV", 0x8bff}, - {"linux/auto_fs.h", "AUTOFS_IOC_READY", 0x9360}, - {"linux/auto_fs.h", "AUTOFS_IOC_FAIL", 0x9361}, - {"linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", 0x9362}, - {"linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", 0x9363}, - {"linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", 0x9364}, - {"linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", 0x9364}, - {"linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", 0x9365}, - {"linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", 0x9366}, - {"linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", 0x9367}, - {"linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", 0x9370}, - {"linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", 0x9401}, - {"linux/btrfs.h", "BTRFS_IOC_DEFRAG", 0x9402}, - {"linux/btrfs.h", "BTRFS_IOC_RESIZE", 0x9403}, - {"linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", 0x9404}, - {"linux/btrfs.h", "BTRFS_IOC_TRANS_START", 0x9406}, - {"linux/btrfs.h", "BTRFS_IOC_TRANS_END", 0x9407}, - {"linux/btrfs.h", "BTRFS_IOC_SYNC", 0x9408}, - {"linux/btrfs.h", "BTRFS_IOC_CLONE", 0x9409}, - {"linux/btrfs.h", "BTRFS_IOC_ADD_DEV", 0x940a}, - {"linux/btrfs.h", "BTRFS_IOC_RM_DEV", 0x940b}, - {"linux/btrfs.h", "BTRFS_IOC_BALANCE", 0x940c}, - {"linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", 0x940d}, - {"linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", 0x940e}, - {"linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", 0x940f}, - {"linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", 0x9410}, - {"linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", 0x9411}, - {"linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", 0x9412}, - {"linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", 0x9413}, - {"linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", 0x9414}, - {"linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", 0x9416}, - {"linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", 0x9417}, - {"linux/btrfs.h", "BTRFS_IOC_START_SYNC", 0x9418}, - {"linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", 0x9418}, - {"linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", 0x9419}, - {"linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", 0x941a}, - {"linux/btrfs.h", "BTRFS_IOC_SCRUB", 0x941b}, - {"linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", 0x941c}, - {"linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", 0x941d}, - {"linux/btrfs.h", "BTRFS_IOC_DEV_INFO", 0x941e}, - {"linux/btrfs.h", "BTRFS_IOC_FS_INFO", 0x941f}, - {"linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", 0x9420}, - {"linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", 0x9421}, - {"linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", 0x9422}, - {"linux/btrfs.h", "BTRFS_IOC_INO_PATHS", 0x9423}, - {"linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", 0x9424}, - {"linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", 0x9425}, - {"linux/btrfs.h", "BTRFS_IOC_SEND", 0x9426}, - {"linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", 0x9427}, - {"linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", 0x9428}, - {"linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", 0x9429}, - {"linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", 0x942a}, - {"linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", 0x942b}, - {"linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", 0x942c}, - {"linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", 0x942d}, - {"linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", 0x942e}, - {"linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", 0x9431}, - {"linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", 0x9432}, - {"linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", 0x9434}, - {"linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", 0x9435}, - {"linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", 0x9436}, - {"linux/nbd.h", "NBD_SET_SOCK", 0xab00}, - {"linux/nbd.h", "NBD_SET_BLKSIZE", 0xab01}, - {"linux/nbd.h", "NBD_SET_SIZE", 0xab02}, - {"linux/nbd.h", "NBD_DO_IT", 0xab03}, - {"linux/nbd.h", "NBD_CLEAR_SOCK", 0xab04}, - {"linux/nbd.h", "NBD_CLEAR_QUE", 0xab05}, - {"linux/nbd.h", "NBD_PRINT_DEBUG", 0xab06}, - {"linux/nbd.h", "NBD_SET_SIZE_BLOCKS", 0xab07}, - {"linux/nbd.h", "NBD_DISCONNECT", 0xab08}, - {"linux/nbd.h", "NBD_SET_TIMEOUT", 0xab09}, - {"linux/nbd.h", "NBD_SET_FLAGS", 0xab0a}, - {"linux/raw.h", "RAW_SETBIND", 0xac00}, - {"linux/raw.h", "RAW_GETBIND", 0xac01}, - {"linux/kvm.h", "KVM_GET_API_VERSION", 0xae00}, - {"linux/kvm.h", "KVM_CREATE_VM", 0xae01}, - {"linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", 0xae02}, - {"linux/kvm.h", "KVM_CHECK_EXTENSION", 0xae03}, - {"linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", 0xae04}, - {"linux/kvm.h", "KVM_GET_SUPPORTED_CPUID", 0xae05}, - {"linux/kvm.h", "KVM_S390_ENABLE_SIE", 0xae06}, - {"linux/kvm.h", "KVM_SET_MEMORY_REGION", 0xae40}, - {"linux/kvm.h", "KVM_CREATE_VCPU", 0xae41}, - {"linux/kvm.h", "KVM_GET_DIRTY_LOG", 0xae42}, - {"linux/kvm.h", "KVM_SET_MEMORY_ALIAS", 0xae43}, - {"linux/kvm.h", "KVM_SET_NR_MMU_PAGES", 0xae44}, - {"linux/kvm.h", "KVM_GET_NR_MMU_PAGES", 0xae45}, - {"linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", 0xae46}, - {"linux/kvm.h", "KVM_SET_TSS_ADDR", 0xae47}, - {"linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", 0xae48}, - {"linux/kvm.h", "KVM_S390_UCAS_MAP", 0xae50}, - {"linux/kvm.h", "KVM_S390_UCAS_UNMAP", 0xae51}, - {"linux/kvm.h", "KVM_S390_VCPU_FAULT", 0xae52}, - {"linux/kvm.h", "KVM_CREATE_IRQCHIP", 0xae60}, - {"linux/kvm.h", "KVM_IRQ_LINE", 0xae61}, - {"linux/kvm.h", "KVM_GET_IRQCHIP", 0xae62}, - {"linux/kvm.h", "KVM_SET_IRQCHIP", 0xae63}, - {"linux/kvm.h", "KVM_CREATE_PIT", 0xae64}, - {"linux/kvm.h", "KVM_GET_PIT", 0xae65}, - {"linux/kvm.h", "KVM_SET_PIT", 0xae66}, - {"linux/kvm.h", "KVM_IRQ_LINE_STATUS", 0xae67}, - {"linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", 0xae69}, - {"linux/kvm.h", "KVM_SET_GSI_ROUTING", 0xae6a}, - {"linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", 0xae70}, - {"linux/kvm.h", "KVM_REINJECT_CONTROL", 0xae71}, - {"linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", 0xae72}, - {"linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", 0xae73}, - {"linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", 0xae74}, - {"linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", 0xae75}, - {"linux/kvm.h", "KVM_IRQFD", 0xae76}, - {"linux/kvm.h", "KVM_CREATE_PIT2", 0xae77}, - {"linux/kvm.h", "KVM_SET_BOOT_CPU_ID", 0xae78}, - {"linux/kvm.h", "KVM_IOEVENTFD", 0xae79}, - {"linux/kvm.h", "KVM_XEN_HVM_CONFIG", 0xae7a}, - {"linux/kvm.h", "KVM_SET_CLOCK", 0xae7b}, - {"linux/kvm.h", "KVM_GET_CLOCK", 0xae7c}, - {"linux/kvm.h", "KVM_RUN", 0xae80}, - {"linux/kvm.h", "KVM_GET_REGS", 0xae81}, - {"linux/kvm.h", "KVM_SET_REGS", 0xae82}, - {"linux/kvm.h", "KVM_GET_SREGS", 0xae83}, - {"linux/kvm.h", "KVM_SET_SREGS", 0xae84}, - {"linux/kvm.h", "KVM_TRANSLATE", 0xae85}, - {"linux/kvm.h", "KVM_INTERRUPT", 0xae86}, - {"linux/kvm.h", "KVM_GET_MSRS", 0xae88}, - {"linux/kvm.h", "KVM_SET_MSRS", 0xae89}, - {"linux/kvm.h", "KVM_SET_CPUID", 0xae8a}, - {"linux/kvm.h", "KVM_SET_SIGNAL_MASK", 0xae8b}, - {"linux/kvm.h", "KVM_GET_FPU", 0xae8c}, - {"linux/kvm.h", "KVM_SET_FPU", 0xae8d}, - {"linux/kvm.h", "KVM_GET_LAPIC", 0xae8e}, - {"linux/kvm.h", "KVM_SET_LAPIC", 0xae8f}, - {"linux/kvm.h", "KVM_SET_CPUID2", 0xae90}, - {"linux/kvm.h", "KVM_GET_CPUID2", 0xae91}, - {"linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", 0xae92}, - {"linux/kvm.h", "KVM_SET_VAPIC_ADDR", 0xae93}, - {"linux/kvm.h", "KVM_S390_INTERRUPT", 0xae94}, - {"linux/kvm.h", "KVM_S390_STORE_STATUS", 0xae95}, - {"linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", 0xae96}, - {"linux/kvm.h", "KVM_S390_INITIAL_RESET", 0xae97}, - {"linux/kvm.h", "KVM_GET_MP_STATE", 0xae98}, - {"linux/kvm.h", "KVM_SET_MP_STATE", 0xae99}, - {"linux/kvm.h", "KVM_IA64_VCPU_GET_STACK", 0xae9a}, - {"linux/kvm.h", "KVM_NMI", 0xae9a}, - {"linux/kvm.h", "KVM_IA64_VCPU_SET_STACK", 0xae9b}, - {"linux/kvm.h", "KVM_SET_GUEST_DEBUG", 0xae9b}, - {"linux/kvm.h", "KVM_X86_SETUP_MCE", 0xae9c}, - {"linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", 0xae9d}, - {"linux/kvm.h", "KVM_X86_SET_MCE", 0xae9e}, - {"linux/kvm.h", "KVM_GET_PIT2", 0xae9f}, - {"linux/kvm.h", "KVM_GET_VCPU_EVENTS", 0xae9f}, - {"linux/kvm.h", "KVM_SET_PIT2", 0xaea0}, - {"linux/kvm.h", "KVM_SET_VCPU_EVENTS", 0xaea0}, - {"linux/kvm.h", "KVM_GET_DEBUGREGS", 0xaea1}, - {"linux/kvm.h", "KVM_PPC_GET_PVINFO", 0xaea1}, - {"linux/kvm.h", "KVM_SET_DEBUGREGS", 0xaea2}, - {"linux/kvm.h", "KVM_SET_TSC_KHZ", 0xaea2}, - {"linux/kvm.h", "KVM_ENABLE_CAP", 0xaea3}, - {"linux/kvm.h", "KVM_GET_TSC_KHZ", 0xaea3}, - {"linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", 0xaea4}, - {"linux/kvm.h", "KVM_GET_XSAVE", 0xaea4}, - {"linux/kvm.h", "KVM_SET_XSAVE", 0xaea5}, - {"linux/kvm.h", "KVM_SIGNAL_MSI", 0xaea5}, - {"linux/kvm.h", "KVM_GET_XCRS", 0xaea6}, - {"linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", 0xaea6}, - {"linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", 0xaea7}, - {"linux/kvm.h", "KVM_SET_XCRS", 0xaea7}, - {"linux/kvm.h", "KVM_CREATE_SPAPR_TCE", 0xaea8}, - {"linux/kvm.h", "KVM_ALLOCATE_RMA", 0xaea9}, - {"linux/kvm.h", "KVM_DIRTY_TLB", 0xaeaa}, - {"linux/kvm.h", "KVM_PPC_GET_HTAB_FD", 0xaeaa}, - {"linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", 0xaeab}, - {"linux/kvm.h", "KVM_GET_ONE_REG", 0xaeab}, - {"linux/kvm.h", "KVM_PPC_RTAS_DEFINE_TOKEN", 0xaeac}, - {"linux/kvm.h", "KVM_SET_ONE_REG", 0xaeac}, - {"linux/kvm.h", "KVM_KVMCLOCK_CTRL", 0xaead}, - {"linux/kvm.h", "KVM_ARM_VCPU_INIT", 0xaeae}, - {"linux/kvm.h", "KVM_GET_REG_LIST", 0xaeb0}, - {"linux/kvm.h", "KVM_CREATE_DEVICE", 0xaee0}, - {"linux/kvm.h", "KVM_SET_DEVICE_ATTR", 0xaee1}, - {"linux/kvm.h", "KVM_GET_DEVICE_ATTR", 0xaee2}, - {"linux/kvm.h", "KVM_HAS_DEVICE_ATTR", 0xaee3}, - {"linux/vhost.h", "VHOST_GET_FEATURES", 0xaf00}, - {"linux/vhost.h", "VHOST_SET_FEATURES", 0xaf00}, - {"linux/vhost.h", "VHOST_SET_OWNER", 0xaf01}, - {"linux/vhost.h", "VHOST_RESET_OWNER", 0xaf02}, - {"linux/vhost.h", "VHOST_SET_MEM_TABLE", 0xaf03}, - {"linux/vhost.h", "VHOST_SET_LOG_BASE", 0xaf04}, - {"linux/vhost.h", "VHOST_SET_LOG_FD", 0xaf07}, - {"linux/vhost.h", "VHOST_SET_VRING_NUM", 0xaf10}, - {"linux/vhost.h", "VHOST_SET_VRING_ADDR", 0xaf11}, - {"linux/vhost.h", "VHOST_GET_VRING_BASE", 0xaf12}, - {"linux/vhost.h", "VHOST_SET_VRING_BASE", 0xaf12}, - {"linux/vhost.h", "VHOST_SET_VRING_KICK", 0xaf20}, - {"linux/vhost.h", "VHOST_SET_VRING_CALL", 0xaf21}, - {"linux/vhost.h", "VHOST_SET_VRING_ERR", 0xaf22}, - {"linux/vhost.h", "VHOST_NET_SET_BACKEND", 0xaf30}, - {"linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", 0xaf40}, - {"linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", 0xaf41}, - {"linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", 0xaf42}, - {"linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", 0xaf43}, - {"linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", 0xaf44}, - {"linux/if_pppox.h", "PPPOEIOCSFWD", 0xb100}, - {"linux/if_pppox.h", "PPPOEIOCDFWD", 0xb101}, - {"linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", 0xcd01}, - {"linux/dm-ioctl.h", "DM_VERSION", 0xfd00}, - {"linux/dm-ioctl.h", "DM_REMOVE_ALL", 0xfd01}, - {"linux/dm-ioctl.h", "DM_LIST_DEVICES", 0xfd02}, - {"linux/dm-ioctl.h", "DM_DEV_CREATE", 0xfd03}, - {"linux/dm-ioctl.h", "DM_DEV_REMOVE", 0xfd04}, - {"linux/dm-ioctl.h", "DM_DEV_RENAME", 0xfd05}, - {"linux/dm-ioctl.h", "DM_DEV_SUSPEND", 0xfd06}, - {"linux/dm-ioctl.h", "DM_DEV_STATUS", 0xfd07}, - {"linux/dm-ioctl.h", "DM_DEV_WAIT", 0xfd08}, - {"linux/dm-ioctl.h", "DM_TABLE_LOAD", 0xfd09}, - {"linux/dm-ioctl.h", "DM_TABLE_CLEAR", 0xfd0a}, - {"linux/dm-ioctl.h", "DM_TABLE_DEPS", 0xfd0b}, - {"linux/dm-ioctl.h", "DM_TABLE_STATUS", 0xfd0c}, - {"linux/dm-ioctl.h", "DM_LIST_VERSIONS", 0xfd0d}, - {"linux/dm-ioctl.h", "DM_TARGET_MSG", 0xfd0e}, - {"linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", 0xfd0f}, diff --git a/linux/ioctlent.sh b/linux/ioctlent.sh deleted file mode 100755 index c483ba88..00000000 --- a/linux/ioctlent.sh +++ /dev/null @@ -1,156 +0,0 @@ -#! /bin/sh -# Copyright (c) 2001 Wichert Akkerman -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Validate arg count. -case $# in -1) - dir="$1" - asm=asm - ;; -2) - dir="$1" - asm="$2" - ;; -*) - echo "usage: $0 include-directory [asm-subdirectory]" >&2 - exit 1 - ;; -esac - -lookup_ioctls() -{ - type="$1" - shift - - # Build the list of all ioctls - regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+0x'"$type"'..\>' - (cd "$dir" && for f; do grep "$regexp" "$f" "uapi/$f" 2>/dev/null; done) | - sed -ne "s,$asm/,asm/,g"' -s/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*\(0x'"$type"'..\).*/ { "\1", "\2", \3 },/p' \ - >> ioctls.h -} - -> ioctls.h - -lookup_ioctls 03 linux/hdreg.h -lookup_ioctls 22 scsi/sg.h -lookup_ioctls 46 linux/fb.h -lookup_ioctls 4B linux/kd.h -lookup_ioctls 4C linux/loop.h -lookup_ioctls 53 linux/cdrom.h scsi/scsi.h scsi/scsi_ioctl.h -lookup_ioctls 54 $asm/ioctls.h asm-generic/ioctls.h -lookup_ioctls 56 linux/vt.h -lookup_ioctls '7[12]' linux/videotext.h -lookup_ioctls 89 $asm/sockios.h asm-generic/sockios.h linux/sockios.h -lookup_ioctls 8B linux/wireless.h - -if [ -e $dir/Kbuild ]; then - # kernel has exported user space headers, so query only them - files=$( - cd $dir || exit - find . -mindepth 2 -name Kbuild | \ - sed -e 's:^\./::' -e 's:/Kbuild:/*:' | \ - grep -v '^asm-' - echo "$asm/* asm-generic/*" - ) - # special case: some headers aren't exported directly - files="${files} media/* net/bluetooth/* pcmcia/*" -else - # older kernel so just assume some headers - files="linux/* $asm/* asm-generic/* scsi/* sound/*" -fi - -# Build the list of all ioctls -# Example output: -# { "asm/ioctls.h", "TIOCSWINSZ", 0x5414 }, -# { "asm/mce.h", "MCE_GETCLEAR_FLAGS", _IOC(_IOC_NONE,'M',3,0) }, -regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+_S\?\(IO\|IOW\|IOR\|IOWR\)\>' -(cd $dir && grep $regexp $files 2>/dev/null) | \ - sed -n \ - -e "s,$asm/,asm/,g" \ - -e 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_S\?I.*(\([^[,]*\)[[:space:]]*,[[:space:]]*\([^,)]*\).*/ { "\1", "\2", _IOC(_IOC_NONE,\3,\4,0) },/p' \ - >> ioctls.h - -# Strip uapi/ prefix -sed -i 's|"uapi/|"|' ioctls.h - -# Sort and drop dups -sort -u -o ioctls.h ioctls.h - -> ioctldefs.h - -# Collect potential ioctl names. ('bases' is a bad name. Sigh) -# Some use a special base to offset their ioctls on. Extract that as well. -# Some use 2 defines: _IOC(_IOC_NONE,DM_IOCTL,DM_LIST_DEVICES_CMD,....) -bases=$(sed -n \ - -e 's/.*_IOC_NONE.*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]]*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]+,].*/\1\n\2/p' \ - -e 's/.*_IOC_NONE.*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]+,].*/\1/p' \ - ioctls.h | sort -u) - -for base in $bases; do - echo "Looking for $base" - regexp="^[[:space:]]*#[[:space:]]*define[[:space:]]\+$base" - line=$( (cd $dir && grep -h $regexp 2>/dev/null $files) | grep -v '\<_IO') - if [ x"$line" != x ]; then - echo "$base is a #define" # "($line)" - echo "$line" >> ioctldefs.h - fi - - if ! grep "\<$base\>" ioctldefs.h >/dev/null 2>/dev/null; then - # Not all ioctl's are defines ... some (like the DM_* stuff) - # are enums, so we have to extract that crap ourself - ( - cd $dir || exit - # -P: inhibit generation of linemarkers - ${CPP:-cpp} -P $(grep -l $base $files 2>/dev/null) | sed '/^$/d' | \ - awk -v base="$base" '{ - if ($1 == "enum") { - val = 0 - while ($NF != "};") { - if (!getline) - exit - gsub(/,/, "") - if ($0 ~ /=/) - val = $NF - if ($1 == base) { - print "#define " base " (" val ")" - exit - } - val++ - } - } - }' - ) >> ioctldefs.h - if ! grep "\<$base\>" ioctldefs.h >/dev/null 2>/dev/null; then - echo "Can't find the definition for $base" - else - echo "$base is an enum" - fi - fi -done - -# Sort and drop dups? -# sort -u ioctldefs1.h && mv ioctldefs1.h ioctldefs.h diff --git a/linux/ioctlsort.c b/linux/ioctlsort.c deleted file mode 100644 index dab30f12..00000000 --- a/linux/ioctlsort.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include "ioctldefs.h" -#include - -struct ioctlent { - const char* header; - const char* name; - unsigned long code; -}; - -struct ioctlent ioctls[] = { -#include "ioctls.h" -}; - -int nioctls = sizeof(ioctls) / sizeof(ioctls[0]); - -int compare(const void* a, const void* b) { - unsigned long code1 = ((struct ioctlent *) a)->code; - unsigned long code2 = ((struct ioctlent *) b)->code; - const char *name1 = ((struct ioctlent *) a)->name; - const char *name2 = ((struct ioctlent *) b)->name; - return (code1 > code2) ? 1 : (code1 < code2) ? -1 : strcmp(name1, name2); -} - -int main(int argc, char** argv) { - int i; - - /* ioctl_lookup() only looks at the NR and TYPE bits atm. */ - for (i = 0; i < nioctls; i++) - ioctls[i].code &= (_IOC_NRMASK << _IOC_NRSHIFT) | - (_IOC_TYPEMASK << _IOC_TYPESHIFT); - - qsort(ioctls, nioctls, sizeof(ioctls[0]), compare); - puts("\t/* Generated by ioctlsort */"); - for (i = 0; i < nioctls; i++) - if (i == 0 || ioctls[i].code != ioctls[i-1].code || - strcmp(ioctls[i].name, ioctls[i-1].name)) - printf("\t{\"%s\",\t\"%s\",\t%#06lx},\n", - ioctls[i].header, ioctls[i].name, ioctls[i].code); - - return 0; -} diff --git a/linux/kexec.h b/linux/kexec.h deleted file mode 100644 index 767ccb51..00000000 --- a/linux/kexec.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef LINUX_KEXEC_H -#define LINUX_KEXEC_H - -/* kexec system call - It loads the new kernel to boot into. - * kexec does not sync, or unmount filesystems so if you need - * that to happen you need to do that yourself. - */ - -/* kexec flags for different usage scenarios */ -#define KEXEC_ON_CRASH 0x00000001 -#define KEXEC_PRESERVE_CONTEXT 0x00000002 -#define KEXEC_ARCH_MASK 0xffff0000 - -/* These values match the ELF architecture values. - * Unless there is a good reason that should continue to be the case. - */ -#define KEXEC_ARCH_DEFAULT ( 0 << 16) -#define KEXEC_ARCH_386 ( 3 << 16) -#define KEXEC_ARCH_X86_64 (62 << 16) -#define KEXEC_ARCH_PPC (20 << 16) -#define KEXEC_ARCH_PPC64 (21 << 16) -#define KEXEC_ARCH_IA_64 (50 << 16) -#define KEXEC_ARCH_ARM (40 << 16) -#define KEXEC_ARCH_S390 (22 << 16) -#define KEXEC_ARCH_SH (42 << 16) -#define KEXEC_ARCH_MIPS_LE (10 << 16) -#define KEXEC_ARCH_MIPS ( 8 << 16) - -/* The artificial cap on the number of segments passed to kexec_load. */ -#define KEXEC_SEGMENT_MAX 16 - -/* - * This structure is used to hold the arguments that are used when - * loading kernel binaries. - */ -struct kexec_segment { - const void *buf; - size_t bufsz; - const void *mem; - size_t memsz; -}; - -/* Load a new kernel image as described by the kexec_segment array - * consisting of passed number of segments at the entry-point address. - * The flags allow different useage types. - */ -extern int kexec_load(void *, size_t, struct kexec_segment *, - unsigned long int); - -#endif /* LINUX_KEXEC_H */ diff --git a/linux/keyctl.h b/linux/keyctl.h deleted file mode 100644 index 840cb990..00000000 --- a/linux/keyctl.h +++ /dev/null @@ -1,61 +0,0 @@ -/* keyctl.h: keyctl command IDs - * - * Copyright (C) 2004, 2008 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _LINUX_KEYCTL_H -#define _LINUX_KEYCTL_H - -/* special process keyring shortcut IDs */ -#define KEY_SPEC_THREAD_KEYRING -1 /* - key ID for thread-specific keyring */ -#define KEY_SPEC_PROCESS_KEYRING -2 /* - key ID for process-specific keyring */ -#define KEY_SPEC_SESSION_KEYRING -3 /* - key ID for session-specific keyring */ -#define KEY_SPEC_USER_KEYRING -4 /* - key ID for UID-specific keyring */ -#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */ -#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */ -#define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */ -#define KEY_SPEC_REQUESTOR_KEYRING -8 /* - key ID for request_key() dest keyring */ - -/* request-key default keyrings */ -#define KEY_REQKEY_DEFL_NO_CHANGE -1 -#define KEY_REQKEY_DEFL_DEFAULT 0 -#define KEY_REQKEY_DEFL_THREAD_KEYRING 1 -#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2 -#define KEY_REQKEY_DEFL_SESSION_KEYRING 3 -#define KEY_REQKEY_DEFL_USER_KEYRING 4 -#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5 -#define KEY_REQKEY_DEFL_GROUP_KEYRING 6 -#define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7 - -/* keyctl commands */ -#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */ -#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */ -#define KEYCTL_UPDATE 2 /* update a key */ -#define KEYCTL_REVOKE 3 /* revoke a key */ -#define KEYCTL_CHOWN 4 /* set ownership of a key */ -#define KEYCTL_SETPERM 5 /* set perms on a key */ -#define KEYCTL_DESCRIBE 6 /* describe a key */ -#define KEYCTL_CLEAR 7 /* clear contents of a keyring */ -#define KEYCTL_LINK 8 /* link a key into a keyring */ -#define KEYCTL_UNLINK 9 /* unlink a key from a keyring */ -#define KEYCTL_SEARCH 10 /* search for a key in a keyring */ -#define KEYCTL_READ 11 /* read a key or keyring's contents */ -#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */ -#define KEYCTL_NEGATE 13 /* negate a partially constructed key */ -#define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */ -#define KEYCTL_SET_TIMEOUT 15 /* set key timeout */ -#define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */ -#define KEYCTL_GET_SECURITY 17 /* get key security label */ -#define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */ -#define KEYCTL_REJECT 19 /* reject a partially constructed key */ -#define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */ -#define KEYCTL_INVALIDATE 21 /* invalidate a key */ -#define KEYCTL_GET_PERSISTENT 22 /* get a user's persistent keyring */ - -#endif /* _LINUX_KEYCTL_H */ diff --git a/linux/m68k/arch_regs.c b/linux/m68k/arch_regs.c new file mode 100644 index 00000000..3d4c3d9e --- /dev/null +++ b/linux/m68k/arch_regs.c @@ -0,0 +1,4 @@ +static struct user_regs_struct m68k_regs; +unsigned long *const m68k_usp_ptr = (unsigned long *) &m68k_regs.usp; +#define ARCH_PC_REG m68k_regs.pc +#define ARCH_REGS_FOR_GETREGS m68k_regs diff --git a/linux/m68k/arch_regs.h b/linux/m68k/arch_regs.h new file mode 100644 index 00000000..424ec11c --- /dev/null +++ b/linux/m68k/arch_regs.h @@ -0,0 +1 @@ +extern unsigned long *const m68k_usp_ptr; diff --git a/linux/m68k/arch_sigreturn.c b/linux/m68k/arch_sigreturn.c new file mode 100644 index 00000000..b1402683 --- /dev/null +++ b/linux/m68k/arch_sigreturn.c @@ -0,0 +1,22 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + unsigned long addr; + + /* Fetch pointer to struct sigcontext. */ + if (umove(tcp, *m68k_usp_ptr + 2 * sizeof(int), &addr) < 0) + return; + + unsigned long mask[NSIG_BYTES / sizeof(long)]; + /* Fetch first word of signal mask. */ + if (umove(tcp, addr, &mask[0]) < 0) + return; + + /* Fetch remaining words of signal mask, located immediately before. */ + addr -= sizeof(mask) - sizeof(long); + if (umoven(tcp, addr, sizeof(mask) - sizeof(long), &mask[1]) < 0) + return; + + tprintsigmask_addr("{mask=", mask); + tprints("}"); +} diff --git a/linux/m68k/get_error.c b/linux/m68k/get_error.c new file mode 100644 index 00000000..3ad51a08 --- /dev/null +++ b/linux/m68k/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(m68k_regs.d0)) { + tcp->u_rval = -1; + tcp->u_error = -m68k_regs.d0; + } else { + tcp->u_rval = m68k_regs.d0; + } +} diff --git a/linux/m68k/get_scno.c b/linux/m68k/get_scno.c new file mode 100644 index 00000000..829f3477 --- /dev/null +++ b/linux/m68k/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = m68k_regs.orig_d0; + return 1; +} diff --git a/linux/m68k/get_syscall_args.c b/linux/m68k/get_syscall_args.c new file mode 100644 index 00000000..8ec3d281 --- /dev/null +++ b/linux/m68k/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = m68k_regs.d1; + tcp->u_arg[1] = m68k_regs.d2; + tcp->u_arg[2] = m68k_regs.d3; + tcp->u_arg[3] = m68k_regs.d4; + tcp->u_arg[4] = m68k_regs.d5; + tcp->u_arg[5] = m68k_regs.a0; + return 1; +} diff --git a/linux/m68k/ioctlent.h.in b/linux/m68k/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/m68k/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/m68k/ioctls_arch0.h b/linux/m68k/ioctls_arch0.h new file mode 100644 index 00000000..c8636ab2 --- /dev/null +++ b/linux/m68k/ioctls_arch0.h @@ -0,0 +1,24 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/m68k/include/ tree. */ +{ "asm/fbio.h", "FBIOGATTR", _IOC_READ, 0x4606, 0x58 }, +{ "asm/fbio.h", "FBIOGCURMAX", _IOC_READ, 0x461c, 0x04 }, +{ "asm/fbio.h", "FBIOGCURPOS", _IOC_WRITE, 0x461b, 0x04 }, +{ "asm/fbio.h", "FBIOGCURSOR", _IOC_READ|_IOC_WRITE, 0x4619, 0x2c }, +{ "asm/fbio.h", "FBIOGETCMAP", _IOC_WRITE, 0x4604, 0x14 }, +{ "asm/fbio.h", "FBIOGTYPE", _IOC_READ, 0x4600, 0x18 }, +{ "asm/fbio.h", "FBIOGVIDEO", _IOC_READ, 0x4608, 0x04 }, +{ "asm/fbio.h", "FBIOPUTCMAP", _IOC_WRITE, 0x4603, 0x14 }, +{ "asm/fbio.h", "FBIOSATTR", _IOC_WRITE, 0x4605, 0x58 }, +{ "asm/fbio.h", "FBIOSCURPOS", _IOC_WRITE, 0x461a, 0x04 }, +{ "asm/fbio.h", "FBIOSCURSOR", _IOC_WRITE, 0x4618, 0x2c }, +{ "asm/fbio.h", "FBIOSVIDEO", _IOC_WRITE, 0x4607, 0x04 }, +{ "asm/fbio.h", "FBIO_WID_ALLOC", _IOC_READ|_IOC_WRITE, 0x461e, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_FREE", _IOC_WRITE, 0x461f, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_GET", _IOC_READ|_IOC_WRITE, 0x4621, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_PUT", _IOC_WRITE, 0x4620, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTALLOC", _IOC_READ|_IOC_WRITE, 0x4c35, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTFREE", _IOC_WRITE, 0x4c36, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTPOST", _IOC_WRITE, 0x4c38, 0x1c }, +{ "asm/fbio.h", "LEO_CLUTREAD", _IOC_WRITE, 0x4c37, 0x1c }, +{ "asm/fbio.h", "LEO_GETGAMMA", _IOC_READ, 0x4c45, 0x04 }, +{ "asm/fbio.h", "LEO_SETGAMMA", _IOC_WRITE, 0x4c44, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 }, diff --git a/linux/m68k/ioctls_inc0.h b/linux/m68k/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/m68k/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/m68k/set_error.c b/linux/m68k/set_error.c new file mode 100644 index 00000000..1ce72abe --- /dev/null +++ b/linux/m68k/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + m68k_regs.d0 = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + m68k_regs.d0 = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/m68k/set_scno.c b/linux/m68k/set_scno.c new file mode 100644 index 00000000..b45e6485 --- /dev/null +++ b/linux/m68k/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + m68k_regs.orig_d0 = scno; + return set_regs(tcp->pid); +} diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h index 4543db8a..1c33b090 100644 --- a/linux/m68k/syscallent.h +++ b/linux/m68k/syscallent.h @@ -26,454 +26,384 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "chown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "old_getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 1, TD|TM|SI, sys_old_mmap, "old_mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 1, 0, sys_vm86old, "vm86old" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 6, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 4, 0, sys_cacheflush, "cacheflush" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, printargs, "getpagesize" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 5, TD, sys_pread, "pread64" }, /* 180 */ - { 5, TD, sys_pwrite, "pwrite64" }, /* 181 */ - { 3, TF, sys_chown, "lchown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 188 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 191 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 192 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 3, TF, sys_chown, "chown32" }, /* 198 */ - { 0, NF, sys_getuid, "getuid32" }, /* 199 */ - { 0, NF, sys_getgid, "getgid32" }, /* 200 */ - { 0, NF, sys_geteuid, "geteuid32" }, /* 201 */ - { 0, NF, sys_geteuid, "getegid32" }, /* 202 */ - { 2, 0, sys_setreuid, "setreuid32" }, /* 203 */ - { 2, 0, sys_setregid, "setregid32" }, /* 204 */ - { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */ - { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */ - { 3, TD, sys_fchown, "fchown32" }, /* 207 */ - { 3, 0, sys_setresuid, "setresuid32" }, /* 208 */ - { 3, 0, sys_getresuid, "getresuid32" }, /* 209 */ - { 3, 0, sys_setresgid, "setresgid32" }, /* 210 */ - { 3, 0, sys_getresgid, "getresgid32" }, /* 211 */ - { 3, TF, sys_chown, "lchown32" }, /* 212 */ - { 1, 0, sys_setuid, "setuid32" }, /* 213 */ - { 1, 0, sys_setgid, "setgid32" }, /* 214 */ - { 1, NF, sys_setfsuid, "setfsuid32" }, /* 215 */ - { 1, NF, sys_setfsgid, "setfsgid32" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 5, 0, NULL, NULL }, /* 218 */ - { 5, 0, NULL, NULL }, /* 219 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 220 */ - { 0, 0, sys_gettid, "gettid" }, /* 221 */ - { 2, TS, sys_kill, "tkill" }, /* 222 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 223 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 224 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 225 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 226 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 227 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 228 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 229 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 230 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 231 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 232 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 233 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 234 */ - { 6, 0, sys_futex, "futex" }, /* 235 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 236 */ - { 3, TM, sys_mincore, "mincore" }, /* 237 */ - { 3, TM, sys_madvise, "madvise" }, /* 238 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 239 */ - { 4, TD, sys_readahead, "readahead" }, /* 240 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 241 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 242 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 243 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 244 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 245 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 246 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 247 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 248 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 249 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 250 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 251 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 252 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 253 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 254 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 255 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 256 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 257 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 258 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 259 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 260 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 261 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 262 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 263 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 264 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 265 */ - { 2, TF, sys_utimes, "utimes" }, /* 266 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 267 */ - { 6, TM, sys_mbind, "mbind" }, /* 268 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 269 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 270 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 271 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 272 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 273 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 274 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 275 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 276 */ - { 5, TP, sys_waitid, "waitid" }, /* 277 */ - { 5, 0, sys_vserver, "vserver" }, /* 278 */ - { 5, 0, sys_add_key, "add_key" }, /* 279 */ - { 5, 0, sys_request_key, "request_key" }, /* 280 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 281 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 282 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 283 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 284 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 285 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 286 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 287 */ - { 4, TD|TF, sys_openat, "openat" }, /* 288 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 289 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 290 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 291 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 292 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 293 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 294 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 295 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 296 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 297 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 298 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 299 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 300 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 301 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 302 */ - { 1, TP, sys_unshare, "unshare" }, /* 303 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 304 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 305 */ - { 6, TD, sys_splice, "splice" }, /* 306 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 307 */ - { 4, TD, sys_tee, "tee" }, /* 308 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 309 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 310 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 311 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 312 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 313 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 314 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 315 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 316 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 317 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 318 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 319 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 320 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 321 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 322 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 323 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 324 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 325 */ - { 3, TD, sys_dup3, "dup3" }, /* 326 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 327 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 328 */ - { 5, TD, sys_preadv, "preadv" }, /* 329 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 330 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 331 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 332 */ - { 0, 0, sys_get_thread_area, "get_thread_area"}, /* 333 */ - { 1, 0, sys_set_thread_area, "set_thread_area"}, /* 334 */ - { 6, 0, printargs, "atomic_comxchg_32"}, /* 335 */ - { 0, 0, printargs, "atomic_barrier"}, /* 336 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 337 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 338 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 339 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 340 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 341 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 342 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 343 */ - { 2, TD, sys_setns, "setns" }, /* 344 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 345 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 346 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 347 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 348 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 349 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 350 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 351 */ - { 5, 0, NULL, NULL }, /* 352 */ - { 5, 0, NULL, NULL }, /* 353 */ - { 5, 0, NULL, NULL }, /* 354 */ - { 5, 0, NULL, NULL }, /* 355 */ - { 5, 0, NULL, NULL }, /* 356 */ - { 5, 0, NULL, NULL }, /* 357 */ - { 5, 0, NULL, NULL }, /* 358 */ - { 5, 0, NULL, NULL }, /* 359 */ - { 5, 0, NULL, NULL }, /* 360 */ - { 5, 0, NULL, NULL }, /* 361 */ - { 5, 0, NULL, NULL }, /* 362 */ - { 5, 0, NULL, NULL }, /* 363 */ - { 5, 0, NULL, NULL }, /* 364 */ - { 5, 0, NULL, NULL }, /* 365 */ - { 5, 0, NULL, NULL }, /* 366 */ - { 5, 0, NULL, NULL }, /* 367 */ - { 5, 0, NULL, NULL }, /* 368 */ - { 5, 0, NULL, NULL }, /* 369 */ - { 5, 0, NULL, NULL }, /* 370 */ - { 5, 0, NULL, NULL }, /* 371 */ - { 5, 0, NULL, NULL }, /* 372 */ - { 5, 0, NULL, NULL }, /* 373 */ - { 5, 0, NULL, NULL }, /* 374 */ - { 5, 0, NULL, NULL }, /* 375 */ - { 5, 0, NULL, NULL }, /* 376 */ - { 5, 0, NULL, NULL }, /* 377 */ - { 5, 0, NULL, NULL }, /* 378 */ - { 5, 0, NULL, NULL }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 5, 0, NULL, NULL }, /* 381 */ - { 5, 0, NULL, NULL }, /* 382 */ - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "chown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 1, 0, SEN(vm86old), "vm86old" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 4, 0, SEN(cacheflush), "cacheflush" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 5, TD, SEN(pread), "pread64" }, +[181] = { 5, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "lchown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[193] = { 3, TF, SEN(truncate64), "truncate64" }, +[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "chown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "lchown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218 ... 219] = { }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { 0, NF, SEN(gettid), "gettid" }, +[222] = { 2, TS, SEN(kill), "tkill" }, +[223] = { 5, TF, SEN(setxattr), "setxattr" }, +[224] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[225] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[226] = { 4, TF, SEN(getxattr), "getxattr" }, +[227] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[228] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[229] = { 3, TF, SEN(listxattr), "listxattr" }, +[230] = { 3, TF, SEN(listxattr), "llistxattr" }, +[231] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[232] = { 2, TF, SEN(removexattr), "removexattr" }, +[233] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[234] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[235] = { 6, 0, SEN(futex), "futex" }, +[236] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[237] = { 3, TM, SEN(mincore), "mincore" }, +[238] = { 3, TM, SEN(madvise), "madvise" }, +[239] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[240] = { 4, TD, SEN(readahead), "readahead" }, +[241] = { 2, TM, SEN(io_setup), "io_setup" }, +[242] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[243] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[244] = { 3, 0, SEN(io_submit), "io_submit" }, +[245] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[246] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[247] = { 1, TP|SE, SEN(exit), "exit_group" }, +[248] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[249] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[250] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[251] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[252] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[253] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[254] = { 3, 0, SEN(timer_create), "timer_create" }, +[255] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[256] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[258] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[259] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[260] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[261] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[262] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[263] = { 3, TF, SEN(statfs64), "statfs64" }, +[264] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[265] = { 3, TS, SEN(tgkill), "tgkill" }, +[266] = { 2, TF, SEN(utimes), "utimes" }, +[267] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[268] = { 6, TM, SEN(mbind), "mbind" }, +[269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[271] = { 4, 0, SEN(mq_open), "mq_open" }, +[272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[275] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[277] = { 5, TP, SEN(waitid), "waitid" }, +[278] = { 5, 0, SEN(vserver), "vserver" }, +[279] = { 5, 0, SEN(add_key), "add_key" }, +[280] = { 4, 0, SEN(request_key), "request_key" }, +[281] = { 5, 0, SEN(keyctl), "keyctl" }, +[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[284] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[288] = { 4, TD|TF, SEN(openat), "openat" }, +[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[293] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[295] = { 4, TD|TF, SEN(renameat), "renameat" }, +[296] = { 5, TD|TF, SEN(linkat), "linkat" }, +[297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[301] = { 6, TD, SEN(pselect6), "pselect6" }, +[302] = { 5, TD, SEN(ppoll), "ppoll" }, +[303] = { 1, TP, SEN(unshare), "unshare" }, +[304] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[305] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[306] = { 6, TD, SEN(splice), "splice" }, +[307] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[308] = { 4, TD, SEN(tee), "tee" }, +[309] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[310] = { 6, TM, SEN(move_pages), "move_pages" }, +[311] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[312] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[313] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[314] = { 3, 0, SEN(getcpu), "getcpu" }, +[315] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[316] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[317] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[318] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[319] = { 1, TD, SEN(eventfd), "eventfd" }, +[320] = { 6, TD, SEN(fallocate), "fallocate" }, +[321] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[322] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[323] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[324] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[325] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[326] = { 3, TD, SEN(dup3), "dup3" }, +[327] = { 2, TD, SEN(pipe2), "pipe2" }, +[328] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[329] = { 5, TD, SEN(preadv), "preadv" }, +[330] = { 5, TD, SEN(pwritev), "pwritev" }, +[331] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[332] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[333] = { 0, 0, SEN(get_thread_area), "get_thread_area" }, +[334] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[335] = { 6, 0, SEN(printargs), "atomic_cmpxchg_32" }, +[336] = { 0, 0, SEN(printargs), "atomic_barrier" }, +[337] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[338] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[339] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[340] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[341] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[342] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[343] = { 1, TD, SEN(syncfs), "syncfs" }, +[344] = { 2, TD, SEN(setns), "setns" }, +[345] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[346] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[347] = { 5, 0, SEN(kcmp), "kcmp" }, +[348] = { 3, TD, SEN(finit_module), "finit_module" }, +[349] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[350] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[351] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[352] = { 3, 0, SEN(getrandom), "getrandom" }, +[353] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[354] = { 3, TD, SEN(bpf), "bpf" }, +[355] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[356] = { 3, TN, SEN(socket), "socket" }, +[357] = { 4, TN, SEN(socketpair), "socketpair" }, +[358] = { 3, TN, SEN(bind), "bind" }, +[359] = { 3, TN, SEN(connect), "connect" }, +[360] = { 2, TN, SEN(listen), "listen" }, +[361] = { 4, TN, SEN(accept4), "accept4" }, +[362] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[363] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[364] = { 3, TN, SEN(getsockname), "getsockname" }, +[365] = { 3, TN, SEN(getpeername), "getpeername" }, +[366] = { 6, TN, SEN(sendto), "sendto" }, +[367] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[368] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[369] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[370] = { 2, TN, SEN(shutdown), "shutdown" }, +[371] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[372] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[373] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[374] = { 2, 0, SEN(membarrier), "membarrier" }, +[375] = { 3, TM, SEN(mlock2), "mlock2" }, +[376] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[377] = { 6, TD, SEN(preadv2), "preadv2" }, +[378] = { 6, TD, SEN(pwritev2), "pwritev2" }, + #define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -#if SYS_ipc_subcall != 420 - #error fix me -#endif - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ - { 4, TI, sys_semop, "semop" }, /* 421 */ - { 4, TI, sys_semget, "semget" }, /* 422 */ - { 4, TI, sys_semctl, "semctl" }, /* 423 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 424 */ - { 4, 0, printargs, "ipc_subcall" }, /* 425 */ - { 4, 0, printargs, "ipc_subcall" }, /* 426 */ - { 4, 0, printargs, "ipc_subcall" }, /* 427 */ - { 4, 0, printargs, "ipc_subcall" }, /* 428 */ - { 4, 0, printargs, "ipc_subcall" }, /* 429 */ - { 4, 0, printargs, "ipc_subcall" }, /* 430 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 431 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 432 */ - { 4, TI, sys_msgget, "msgget" }, /* 433 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 434 */ - { 4, 0, printargs, "ipc_subcall" }, /* 435 */ - { 4, 0, printargs, "ipc_subcall" }, /* 436 */ - { 4, 0, printargs, "ipc_subcall" }, /* 437 */ - { 4, 0, printargs, "ipc_subcall" }, /* 438 */ - { 4, 0, printargs, "ipc_subcall" }, /* 439 */ - { 4, 0, printargs, "ipc_subcall" }, /* 440 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 441 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 442 */ - { 4, TI, sys_shmget, "shmget" }, /* 443 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 444 */ diff --git a/linux/m68k/userent.h b/linux/m68k/userent.h new file mode 100644 index 00000000..a17807ec --- /dev/null +++ b/linux/m68k/userent.h @@ -0,0 +1,34 @@ +XLAT(4*PT_D1), +XLAT(4*PT_D2), +XLAT(4*PT_D3), +XLAT(4*PT_D4), +XLAT(4*PT_D5), +XLAT(4*PT_D6), +XLAT(4*PT_D7), +XLAT(4*PT_A0), +XLAT(4*PT_A1), +XLAT(4*PT_A2), +XLAT(4*PT_A3), +XLAT(4*PT_A4), +XLAT(4*PT_A5), +XLAT(4*PT_A6), +XLAT(4*PT_D0), +XLAT(4*PT_USP), +XLAT(4*PT_ORIG_D0), +XLAT(4*PT_SR), +XLAT(4*PT_PC), +/* Other fields in "struct user" */ +XLAT_UOFF(u_fpvalid), +XLAT_UOFF(m68kfp), +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +XLAT_UOFF(start_stack), +XLAT_UOFF(signal), +XLAT_UOFF(reserved), +XLAT_UOFF(u_ar0), +XLAT_UOFF(u_fpstate), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/metag/arch_regs.c b/linux/metag/arch_regs.c new file mode 100644 index 00000000..e9f0d78a --- /dev/null +++ b/linux/metag/arch_regs.c @@ -0,0 +1,3 @@ +static struct user_gp_regs metag_regs; +#define ARCH_REGS_FOR_GETREGSET metag_regs +#define ARCH_PC_REG metag_regs.pc diff --git a/linux/metag/get_error.c b/linux/metag/get_error.c new file mode 100644 index 00000000..b7d287f9 --- /dev/null +++ b/linux/metag/get_error.c @@ -0,0 +1,11 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + /* result pointer in D0Re0 (D0.0) */ + if (check_errno && is_negated_errno(metag_regs.dx[0][0])) { + tcp->u_rval = -1; + tcp->u_error = -metag_regs.dx[0][0]; + } else { + tcp->u_rval = metag_regs.dx[0][0]; + } +} diff --git a/linux/metag/get_scno.c b/linux/metag/get_scno.c new file mode 100644 index 00000000..6dc2ab4a --- /dev/null +++ b/linux/metag/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = metag_regs.dx[0][1]; /* syscall number in D1Re0 (D1.0) */ + return 1; +} diff --git a/linux/metag/get_syscall_args.c b/linux/metag/get_syscall_args.c new file mode 100644 index 00000000..4cae04f1 --- /dev/null +++ b/linux/metag/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + unsigned int i; + + for (i = 0; i < MAX_ARGS; i++) { + /* arguments go backwards from D1Ar1 (D1.3) */ + tcp->u_arg[i] = (&metag_regs.dx[3][1])[-i]; + } + return 1; +} diff --git a/linux/metag/ioctlent.h.in b/linux/metag/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/metag/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/metag/ioctls_arch0.h b/linux/metag/ioctls_arch0.h new file mode 100644 index 00000000..191bb36e --- /dev/null +++ b/linux/metag/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/metag/include/ tree. */ diff --git a/linux/metag/ioctls_inc0.h b/linux/metag/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/metag/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/metag/set_error.c b/linux/metag/set_error.c new file mode 100644 index 00000000..9e10d798 --- /dev/null +++ b/linux/metag/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + metag_regs.dx[0][0] = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + metag_regs.dx[0][0] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/metag/set_scno.c b/linux/metag/set_scno.c new file mode 100644 index 00000000..c9b63c81 --- /dev/null +++ b/linux/metag/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + metag_regs.dx[0][1] = scno; + return set_regs(tcp->pid); +} diff --git a/linux/metag/syscallent.h b/linux/metag/syscallent.h index ac42cd2e..82ad55bb 100644 --- a/linux/metag/syscallent.h +++ b/linux/metag/syscallent.h @@ -1,266 +1,6 @@ - { 2, 0, sys_io_setup, "io_setup" }, /* 0 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 1 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 2 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 3 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 4 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 5 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 6 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 7 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 8 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 9 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 10 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 11 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 12 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 13 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 14 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 15 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 16 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 17 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 18 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 19 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 20 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 21 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 22 */ - { 1, TD, sys_dup, "dup" }, /* 23 */ - { 3, TD, sys_dup3, "dup3" }, /* 24 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 25 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 26 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 27 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 28 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 29 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 30 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 31 */ - { 2, TD, sys_flock, "flock" }, /* 32 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 33 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 34 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 35 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 36 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 37 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 38 */ - { 2, TF, sys_umount2, "umount" }, /* 39 */ - { 5, TF, sys_mount, "mount" }, /* 40 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 41 */ - { }, /* 42 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 43 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 44 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 45 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 46 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 47 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 48 */ - { 1, TF, sys_chdir, "chdir" }, /* 49 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 50 */ - { 1, TF, sys_chroot, "chroot" }, /* 51 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 52 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 53 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 54 */ - { 3, TD, sys_fchown, "fchown" }, /* 55 */ - { 4, TD|TF, sys_openat, "openat" }, /* 56 */ - { 1, TD, sys_close, "close" }, /* 57 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 58 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 59 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 60 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 61 */ - { 5, TD, sys_llseek, "_llseek" }, /* 62 */ - { 3, TD, sys_read, "read" }, /* 63 */ - { 3, TD, sys_write, "write" }, /* 64 */ - { 3, TD, sys_readv, "readv" }, /* 65 */ - { 3, TD, sys_writev, "writev" }, /* 66 */ - { 5, TD, sys_pread, "pread64" }, /* 67 */ - { 5, TD, sys_pwrite, "pwrite64" }, /* 68 */ - { 5, TD, sys_preadv, "preadv" }, /* 69 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 70 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 71 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 72 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 73 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 74 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 75 */ - { 6, TD, sys_splice, "splice" }, /* 76 */ - { 4, TD, sys_tee, "tee" }, /* 77 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 78 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 79 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 80 */ - { 0, 0, sys_sync, "sync" }, /* 81 */ - { 1, TD, sys_fsync, "fsync" }, /* 82 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 83 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 84 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 85 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 86 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 87 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 88 */ - { 1, TF, sys_acct, "acct" }, /* 89 */ - { 2, 0, sys_capget, "capget" }, /* 90 */ - { 2, 0, sys_capset, "capset" }, /* 91 */ - { 1, 0, sys_personality, "personality" }, /* 92 */ - { 1, TP|SE, sys_exit, "exit" }, /* 93 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 94 */ - { 5, TP, sys_waitid, "waitid" }, /* 95 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 96 */ - { 1, TP, sys_unshare, "unshare" }, /* 97 */ - { 6, 0, sys_futex, "futex" }, /* 98 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 99 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 100 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 101 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 102 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 103 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 104 */ - { 3, 0, sys_init_module, "init_module" }, /* 105 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 106 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 107 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 108 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 109 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 110 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 111 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 112 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 113 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 114 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 115 */ - { 3, 0, sys_syslog, "syslog" }, /* 116 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 117 */ - { 2, 0, sys_sched_setparam, "sched_setparam" }, /* 118 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 119 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 120 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 121 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 122 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 123 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 124 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max"}, /* 125 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min"}, /* 126 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 127 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 128 */ - { 2, TS, sys_kill, "kill" }, /* 129 */ - { 2, TS, sys_kill, "tkill" }, /* 130 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 131 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 132 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 133 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 134 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 135 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 136 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 137 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 138 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 139 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 140 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 141 */ - { 4, 0, sys_reboot, "reboot" }, /* 142 */ - { 2, 0, sys_setregid, "setregid" }, /* 143 */ - { 1, 0, sys_setgid, "setgid" }, /* 144 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 145 */ - { 1, 0, sys_setuid, "setuid" }, /* 146 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 147 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 148 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 149 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 150 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 151 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 152 */ - { 1, 0, sys_times, "times" }, /* 153 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 154 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 155 */ - { 1, 0, sys_getsid, "getsid" }, /* 156 */ - { 0, 0, sys_setsid, "setsid" }, /* 157 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 158 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 159 */ - { 1, 0, sys_uname, "uname" }, /* 160 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 161 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 162 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 163 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 164 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 165 */ - { 1, 0, sys_umask, "umask" }, /* 166 */ - { 5, 0, sys_prctl, "prctl" }, /* 167 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 168 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 169 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 170 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 171 */ - { 0, 0, sys_getpid, "getpid" }, /* 172 */ - { 0, 0, sys_getppid, "getppid" }, /* 173 */ - { 0, NF, sys_getuid, "getuid" }, /* 174 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 175 */ - { 0, NF, sys_getgid, "getgid" }, /* 176 */ - { 0, NF, sys_getegid, "getegid" }, /* 177 */ - { 0, 0, sys_gettid, "gettid" }, /* 178 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 179 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 180 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 181 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 182 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 183 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 184 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 185 */ - { 2, TI, sys_msgget, "msgget" }, /* 186 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 187 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 188 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 189 */ - { 3, TI, sys_semget, "semget" }, /* 190 */ - { 4, TI, sys_semctl, "semctl" }, /* 191 */ - { 4, TI, sys_semtimedop, "semtimedop" }, /* 192 */ - { 3, TI, sys_semop, "semop" }, /* 193 */ - { 3, TI, sys_shmget, "shmget" }, /* 194 */ - { 3, TI, sys_shmctl, "shmctl" }, /* 195 */ - { 3, TI|TM|SI, sys_shmat, "shmat" }, /* 196 */ - { 1, TI|TM|SI, sys_shmdt, "shmdt" }, /* 197 */ - { 3, TN, sys_socket, "socket" }, /* 198 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 199 */ - { 3, TN, sys_bind, "bind" }, /* 200 */ - { 2, TN, sys_listen, "listen" }, /* 201 */ - { 3, TN, sys_accept, "accept" }, /* 202 */ - { 3, TN, sys_connect, "connect" }, /* 203 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 204 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 205 */ - { 6, TN, sys_sendto, "sendto" }, /* 206 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 207 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 208 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 209 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 210 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 211 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 212 */ - { 4, TD, sys_readahead, "readahead" }, /* 213 */ - { 1, TM|SI, sys_brk, "brk" }, /* 214 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 215 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 216 */ - { 5, 0, sys_add_key, "add_key" }, /* 217 */ - { 4, 0, sys_request_key, "request_key" }, /* 218 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 219 */ - { 5, TP, sys_clone, "clone" }, /* 220 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 221 */ - { 6, TD|TM|SI, sys_mmap, "mmap2" }, /* 222 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 223 */ - { 2, TF, sys_swapon, "swapon" }, /* 224 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 225 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 226 */ - { 3, TM, sys_msync, "msync" }, /* 227 */ - { 2, TM, sys_mlock, "mlock" }, /* 228 */ - { 2, TM, sys_munlock, "munlock" }, /* 229 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 230 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 231 */ - { 3, TM, sys_mincore, "mincore" }, /* 232 */ - { 3, TM, sys_madvise, "madvise" }, /* 233 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 234 */ - { 6, TM, sys_mbind, "mbind" }, /* 235 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 236 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 237 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 238 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 239 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 240 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 241 */ - { 4, TN, sys_accept4, "accept4" }, /* 242 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 243 */ - { }, /* 244 */ - { 2, 0, printargs, "metag_setglobalbit" }, /* 245 */ - { 1, 0, printargs, "metag_set_fpu_flags" }, /* 246 */ - { 1, 0, printargs, "metag_set_tls" }, /* 247 */ - { 0, 0, printargs, "metag_get_tls" }, /* 248 */ - - [249 ... 259] = { }, - - { 4, TP, sys_wait4, "wait4" }, /* 260 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 261 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 262 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 263 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 264 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 265 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 266 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 267 */ - { 2, TD, sys_setns, "setns" }, /* 268 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 269 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 270 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 271 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 272 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 273 */ +#include "32/syscallent.h" +/* [244 ... 259] are arch specific */ +[245] = { 2, 0, SEN(printargs), "metag_setglobalbit" }, +[246] = { 1, 0, SEN(printargs), "metag_set_fpu_flags" }, +[247] = { 1, 0, SEN(printargs), "metag_set_tls" }, +[248] = { 0, NF, SEN(printargs), "metag_get_tls" }, diff --git a/linux/microblaze/arch_regs.c b/linux/microblaze/arch_regs.c new file mode 100644 index 00000000..a5fec611 --- /dev/null +++ b/linux/microblaze/arch_regs.c @@ -0,0 +1,2 @@ +static unsigned long microblaze_r3; +#define ARCH_PC_PEEK_ADDR PT_PC diff --git a/linux/microblaze/arch_sigreturn.c b/linux/microblaze/arch_sigreturn.c new file mode 100644 index 00000000..6eb7cd8e --- /dev/null +++ b/linux/microblaze/arch_sigreturn.c @@ -0,0 +1,16 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + /* TODO: Verify that this is correct... */ + + unsigned long addr; + + /* Read r1, the stack pointer. */ + if (upeek(tcp->pid, 1 * 4, &addr) < 0) + return; + addr += offsetof(struct sigcontext, oldmask); + + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/microblaze/get_error.c b/linux/microblaze/get_error.c new file mode 100644 index 00000000..878e24f6 --- /dev/null +++ b/linux/microblaze/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(microblaze_r3)) { + tcp->u_rval = -1; + tcp->u_error = -microblaze_r3; + } else { + tcp->u_rval = microblaze_r3; + } +} diff --git a/linux/microblaze/get_scno.c b/linux/microblaze/get_scno.c new file mode 100644 index 00000000..6f98f834 --- /dev/null +++ b/linux/microblaze/get_scno.c @@ -0,0 +1,6 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + return upeek(tcp->pid, 0, &tcp->scno) < 0 ? -1 : 1; +} diff --git a/linux/microblaze/get_syscall_args.c b/linux/microblaze/get_syscall_args.c new file mode 100644 index 00000000..830c8c32 --- /dev/null +++ b/linux/microblaze/get_syscall_args.c @@ -0,0 +1,11 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, (5 + i) * 4, &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/microblaze/get_syscall_result.c b/linux/microblaze/get_syscall_result.c new file mode 100644 index 00000000..9ece53e8 --- /dev/null +++ b/linux/microblaze/get_syscall_result.c @@ -0,0 +1,5 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + return upeek(tcp->pid, 3 * 4, µblaze_r3) < 0 ? -1 : 0; +} diff --git a/linux/microblaze/ioctlent.h.in b/linux/microblaze/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/microblaze/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/microblaze/ioctls_arch0.h b/linux/microblaze/ioctls_arch0.h new file mode 100644 index 00000000..e310f8e7 --- /dev/null +++ b/linux/microblaze/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/microblaze/include/ tree. */ diff --git a/linux/microblaze/ioctls_inc0.h b/linux/microblaze/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/microblaze/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/microblaze/set_error.c b/linux/microblaze/set_error.c new file mode 100644 index 00000000..46866719 --- /dev/null +++ b/linux/microblaze/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + microblaze_r3 = -tcp->u_error; + return upoke(tcp->pid, 3 * 4, microblaze_r3); +} + +static int +arch_set_success(struct tcb *tcp) +{ + microblaze_r3 = tcp->u_rval; + return upoke(tcp->pid, 3 * 4, microblaze_r3); +} diff --git a/linux/microblaze/set_scno.c b/linux/microblaze/set_scno.c new file mode 100644 index 00000000..b9cddefc --- /dev/null +++ b/linux/microblaze/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, 0, scno); +} diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h index c10e9576..d71e97ac 100644 --- a/linux/microblaze/syscallent.h +++ b/linux/microblaze/syscallent.h @@ -26,387 +26,400 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "old_getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 6, TD|TM|SI, sys_mmap, "old_mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 1, 0, sys_vm86old, "vm86old" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 6, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, sys_vm86, "vm86" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 5, TD, sys_pread, "pread64" }, /* 180 */ - { 5, TD, sys_pwrite, "pwrite64" }, /* 181 */ - { 3, TF, sys_chown, "chown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 188 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 191 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 192 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 3, TF, sys_chown, "lchown32" }, /* 198 */ - { 0, NF, sys_getuid, "getuid32" }, /* 199 */ - { 0, NF, sys_getgid, "getgid32" }, /* 200 */ - { 0, NF, sys_geteuid, "geteuid32" }, /* 201 */ - { 0, NF, sys_geteuid, "getegid32" }, /* 202 */ - { 2, 0, sys_setreuid, "setreuid32" }, /* 203 */ - { 2, 0, sys_setregid, "setregid32" }, /* 204 */ - { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */ - { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */ - { 3, TD, sys_fchown, "fchown32" }, /* 207 */ - { 3, 0, sys_setresuid, "setresuid32" }, /* 208 */ - { 3, 0, sys_getresuid, "getresuid32" }, /* 209 */ - { 3, 0, sys_setresgid, "setresgid32" }, /* 210 */ - { 3, 0, sys_getresgid, "getresgid32" }, /* 211 */ - { 3, TF, sys_chown, "chown32" }, /* 212 */ - { 1, 0, sys_setuid, "setuid32" }, /* 213 */ - { 1, 0, sys_setgid, "setgid32" }, /* 214 */ - { 1, NF, sys_setfsuid, "setfsuid32" }, /* 215 */ - { 1, NF, sys_setfsgid, "setfsgid32" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 3, TM, sys_mincore, "mincore" }, /* 218 */ - { 3, TM, sys_madvise, "madvise" }, /* 219 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 220 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 221 */ - { 4, 0, NULL, NULL }, /* 222 */ - { 4, 0, NULL, NULL }, /* 223 */ - { 0, 0, sys_gettid, "gettid" }, /* 224 */ - { 4, TD, sys_readahead, "readahead" }, /* 225 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 226 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 227 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 228 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 229 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 230 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 231 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 232 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 233 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 234 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 235 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 236 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 237 */ - { 2, TS, sys_kill, "tkill" }, /* 238 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 239 */ - { 6, 0, sys_futex, "futex" }, /* 240 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 241 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 242 */ - { 1, 0, sys_set_thread_area, "set_thread_area"}, /* 243 */ - { 1, 0, sys_get_thread_area, "get_thread_area"}, /* 244 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 245 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 246 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 247 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 248 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 250 */ - { 0, 0, NULL, NULL }, /* 251 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 252 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 253 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 254 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 256 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 257 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 258 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 259 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 260 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 261 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 262 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 263 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 264 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 265 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 266 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 267 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 268 */ - { 2, TD, sys_fstatfs64, "fstatfs64" }, /* 269 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 270 */ - { 2, TF, sys_utimes, "utimes" }, /* 271 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 272 */ - { 5, 0, sys_vserver, "vserver" }, /* 273 */ - { 4, TM, sys_mbind, "mbind" }, /* 274 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 275 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 276 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 277 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 278 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 279 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive"}, /* 280 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 281 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 282 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 283 */ - { 5, TP, sys_waitid, "waitid" }, /* 284 */ - { 5, 0, NULL, NULL }, /* 285 */ - { 5, 0, sys_add_key, "add_key" }, /* 286 */ - { 4, 0, sys_request_key, "request_key" }, /* 287 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 288 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 289 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 290 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 291 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 292 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 293 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 294 */ - { 4, TD|TF, sys_openat, "openat" }, /* 295 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 296 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 297 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 298 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 299 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 300 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 301 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 302 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 303 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 304 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 305 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 306 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 307 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 308 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 309 */ - { 1, TP, sys_unshare, "unshare" }, /* 310 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 311 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 312 */ - { 6, TD, sys_splice, "splice" }, /* 313 */ - { 6, TD, sys_sync_file_range, "sync_file_range"}, /* 314 */ - { 4, TD, sys_tee, "tee" }, /* 315 */ - { 5, TD, sys_vmsplice, "vmsplice" }, /* 316 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 317 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 318 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 319 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 320 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 321 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 322 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 323 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 324 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 325 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 326 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 327 */ - { 4, TI, sys_semctl, "semctl" }, /* 328 */ - { 4, TI, sys_semget, "semget" }, /* 329 */ - { 4, TI, sys_semop, "semop" }, /* 330 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 331 */ - { 4, TI, sys_msgget, "msgget" }, /* 332 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 333 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 334 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 335 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 336 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 337 */ - { 4, TI, sys_shmget, "shmget" }, /* 338 */ - { 4, TD|TS, printargs, "signalfd4" }, /* 339 */ - { 2, TD, printargs, "eventfd2" }, /* 340 */ - { 1, TD, printargs, "epoll_create1" }, /* 341 */ - { 3, TD, printargs, "dup3" }, /* 342 */ - { 2, TD, printargs, "pipe2" }, /* 343 */ - { 1, TD, printargs, "inotify_init1" }, /* 344 */ - { 3, TN, sys_socket, "socket" }, /* 345 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 346 */ - { 3, TN, sys_bind, "bind" }, /* 347 */ - { 2, TN, sys_listen, "listen" }, /* 348 */ - { 3, TN, sys_accept, "accept" }, /* 349 */ - { 3, TN, sys_connect, "connect" }, /* 350 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 351 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 352 */ - { 6, TN, sys_sendto, "sendto" }, /* 353 */ - { 4, TN, sys_send, "send" }, /* 354 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 355 */ - { 4, TN, sys_recv, "recv" }, /* 356 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 357 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 358 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 359 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 360 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 361 */ - { 4, TN, sys_accept4, "accept4" }, /* 362 */ - { 5, TD, sys_preadv, "preadv" }, /* 363 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 364 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 365 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 366 */ - { 5, TN, printargs, "recvmmsg" }, /* 367 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 368 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 369 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 370 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 371 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 372 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 373 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 374 */ - { 2, TD, sys_setns, "setns" }, /* 375 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 376 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 377 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 378 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 379 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 380 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 381 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 382 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 383 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 1, 0, SEN(vm86old), "vm86old" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 6, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { 5, 0, SEN(vm86), "vm86" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 5, TD, SEN(pread), "pread64" }, +[181] = { 5, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "chown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[193] = { 3, TF, SEN(truncate64), "truncate64" }, +[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "lchown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "chown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[222 ... 223] = { }, +[224] = { 0, NF, SEN(gettid), "gettid" }, +[225] = { 4, TD, SEN(readahead), "readahead" }, +[226] = { 5, TF, SEN(setxattr), "setxattr" }, +[227] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[229] = { 4, TF, SEN(getxattr), "getxattr" }, +[230] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[232] = { 3, TF, SEN(listxattr), "listxattr" }, +[233] = { 3, TF, SEN(listxattr), "llistxattr" }, +[234] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[235] = { 2, TF, SEN(removexattr), "removexattr" }, +[236] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[238] = { 2, TS, SEN(kill), "tkill" }, +[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[240] = { 6, 0, SEN(futex), "futex" }, +[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, +[245] = { 2, TM, SEN(io_setup), "io_setup" }, +[246] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[248] = { 3, 0, SEN(io_submit), "io_submit" }, +[249] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[250] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[251] = { }, +[252] = { 1, TP|SE, SEN(exit), "exit_group" }, +[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[254] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[259] = { 3, 0, SEN(timer_create), "timer_create" }, +[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[263] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[268] = { 3, TF, SEN(statfs64), "statfs64" }, +[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[270] = { 3, TS, SEN(tgkill), "tgkill" }, +[271] = { 2, TF, SEN(utimes), "utimes" }, +[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[273] = { 5, 0, SEN(vserver), "vserver" }, +[274] = { 6, TM, SEN(mbind), "mbind" }, +[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[277] = { 4, 0, SEN(mq_open), "mq_open" }, +[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[283] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[284] = { 5, TP, SEN(waitid), "waitid" }, +[285] = { }, +[286] = { 5, 0, SEN(add_key), "add_key" }, +[287] = { 4, 0, SEN(request_key), "request_key" }, +[288] = { 5, 0, SEN(keyctl), "keyctl" }, +[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[291] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[295] = { 4, TD|TF, SEN(openat), "openat" }, +[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[302] = { 4, TD|TF, SEN(renameat), "renameat" }, +[303] = { 5, TD|TF, SEN(linkat), "linkat" }, +[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[308] = { 6, TD, SEN(pselect6), "pselect6" }, +[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[310] = { 1, TP, SEN(unshare), "unshare" }, +[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[313] = { 6, TD, SEN(splice), "splice" }, +[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[315] = { 4, TD, SEN(tee), "tee" }, +[316] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[317] = { 6, TM, SEN(move_pages), "move_pages" }, +[318] = { 3, 0, SEN(getcpu), "getcpu" }, +[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[323] = { 1, TD, SEN(eventfd), "eventfd" }, +[324] = { 6, TD, SEN(fallocate), "fallocate" }, +[325] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[326] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[327] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[328] = { 4, TI, SEN(semctl), "semctl" }, +[329] = { 3, TI, SEN(semget), "semget" }, +[330] = { 3, TI, SEN(semop), "semop" }, +[331] = { 3, TI, SEN(msgctl), "msgctl" }, +[332] = { 2, TI, SEN(msgget), "msgget" }, +[333] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[334] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[335] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[336] = { 3, TI, SEN(shmctl), "shmctl" }, +[337] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[338] = { 3, TI, SEN(shmget), "shmget" }, +[339] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[340] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[341] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[342] = { 3, TD, SEN(dup3), "dup3" }, +[343] = { 2, TD, SEN(pipe2), "pipe2" }, +[344] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[345] = { 3, TN, SEN(socket), "socket" }, +[346] = { 4, TN, SEN(socketpair), "socketpair" }, +[347] = { 3, TN, SEN(bind), "bind" }, +[348] = { 2, TN, SEN(listen), "listen" }, +[349] = { 3, TN, SEN(accept), "accept" }, +[350] = { 3, TN, SEN(connect), "connect" }, +[351] = { 3, TN, SEN(getsockname), "getsockname" }, +[352] = { 3, TN, SEN(getpeername), "getpeername" }, +[353] = { 6, TN, SEN(sendto), "sendto" }, +[354] = { 4, TN, SEN(send), "send" }, +[355] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[356] = { 4, TN, SEN(recv), "recv" }, +[357] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[358] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[359] = { 2, TN, SEN(shutdown), "shutdown" }, +[360] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[361] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[362] = { 4, TN, SEN(accept4), "accept4" }, +[363] = { 5, TD, SEN(preadv), "preadv" }, +[364] = { 5, TD, SEN(pwritev), "pwritev" }, +[365] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[366] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[367] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[368] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[369] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[370] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[371] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[372] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[373] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[374] = { 1, TD, SEN(syncfs), "syncfs" }, +[375] = { 2, TD, SEN(setns), "setns" }, +[376] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[377] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[378] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[379] = { 5, 0, SEN(kcmp), "kcmp" }, +[380] = { 3, TD, SEN(finit_module), "finit_module" }, +[381] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[382] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[383] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[384] = { 3, 0, SEN(seccomp), "seccomp" }, +[385] = { 3, 0, SEN(getrandom), "getrandom" }, +[386] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[387] = { 3, TD, SEN(bpf), "bpf" }, +[388] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[389] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[390] = { 2, 0, SEN(membarrier), "membarrier" }, +[391] = { 3, TM, SEN(mlock2), "mlock2" }, +[392] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[393] = { 6, TD, SEN(preadv2), "preadv2" }, +[394] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[395] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[396] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[397] = { 1, 0, SEN(pkey_free), "pkey_free" }, diff --git a/linux/microblaze/userent.h b/linux/microblaze/userent.h new file mode 100644 index 00000000..68710cf3 --- /dev/null +++ b/linux/microblaze/userent.h @@ -0,0 +1,40 @@ +{ PT_GPR(0), "r0" }, +{ PT_GPR(1), "r1" }, +{ PT_GPR(2), "r2" }, +{ PT_GPR(3), "r3" }, +{ PT_GPR(4), "r4" }, +{ PT_GPR(5), "r5" }, +{ PT_GPR(6), "r6" }, +{ PT_GPR(7), "r7" }, +{ PT_GPR(8), "r8" }, +{ PT_GPR(9), "r9" }, +{ PT_GPR(10), "r10" }, +{ PT_GPR(11), "r11" }, +{ PT_GPR(12), "r12" }, +{ PT_GPR(13), "r13" }, +{ PT_GPR(14), "r14" }, +{ PT_GPR(15), "r15" }, +{ PT_GPR(16), "r16" }, +{ PT_GPR(17), "r17" }, +{ PT_GPR(18), "r18" }, +{ PT_GPR(19), "r19" }, +{ PT_GPR(20), "r20" }, +{ PT_GPR(21), "r21" }, +{ PT_GPR(22), "r22" }, +{ PT_GPR(23), "r23" }, +{ PT_GPR(24), "r24" }, +{ PT_GPR(25), "r25" }, +{ PT_GPR(26), "r26" }, +{ PT_GPR(27), "r27" }, +{ PT_GPR(28), "r28" }, +{ PT_GPR(29), "r29" }, +{ PT_GPR(30), "r30" }, +{ PT_GPR(31), "r31" }, +{ PT_PC, "rpc" }, +{ PT_MSR, "rmsr" }, +{ PT_EAR, "rear" }, +{ PT_ESR, "resr" }, +{ PT_FSR, "rfsr" }, +{ PT_KERNEL_MODE, "kernel_mode" }, +/* Other fields in "struct user" */ +#include "../userent0.h" diff --git a/linux/mips/arch_getrval2.c b/linux/mips/arch_getrval2.c new file mode 100644 index 00000000..332f2706 --- /dev/null +++ b/linux/mips/arch_getrval2.c @@ -0,0 +1,5 @@ +long +getrval2(struct tcb *tcp) +{ + return mips_regs.uregs[3]; +} diff --git a/linux/mips/arch_regs.c b/linux/mips/arch_regs.c new file mode 100644 index 00000000..44f6bd5e --- /dev/null +++ b/linux/mips/arch_regs.c @@ -0,0 +1,4 @@ +struct mips_regs mips_regs; /* not static */ +/* PTRACE_GETREGS on MIPS is available since linux v2.6.15. */ +#define ARCH_REGS_FOR_GETREGS mips_regs +#define ARCH_PC_REG mips_REG_EPC diff --git a/linux/mips/arch_regs.h b/linux/mips/arch_regs.h new file mode 100644 index 00000000..6372badc --- /dev/null +++ b/linux/mips/arch_regs.h @@ -0,0 +1,18 @@ +struct mips_regs { + uint64_t uregs[38]; +}; + +extern struct mips_regs mips_regs; + +#define REG_V0 2 +#define REG_A0 4 + +#define mips_REG_V0 mips_regs.uregs[REG_V0] +#define mips_REG_A0 mips_regs.uregs[REG_A0 + 0] +#define mips_REG_A1 mips_regs.uregs[REG_A0 + 1] +#define mips_REG_A2 mips_regs.uregs[REG_A0 + 2] +#define mips_REG_A3 mips_regs.uregs[REG_A0 + 3] +#define mips_REG_A4 mips_regs.uregs[REG_A0 + 4] +#define mips_REG_A5 mips_regs.uregs[REG_A0 + 5] +#define mips_REG_SP mips_regs.uregs[29] +#define mips_REG_EPC mips_regs.uregs[34] diff --git a/linux/mips/arch_sigreturn.c b/linux/mips/arch_sigreturn.c new file mode 100644 index 00000000..72f7619b --- /dev/null +++ b/linux/mips/arch_sigreturn.c @@ -0,0 +1,26 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ +#if defined LINUX_MIPSO32 + /* + * offsetof(struct sigframe, sf_mask) == + * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct sigcontext) + */ + const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + + sizeof(struct sigcontext); +#else + /* + * This decodes rt_sigreturn. + * The 64-bit ABIs do not have sigreturn. + * + * offsetof(struct rt_sigframe, rs_uc) == + * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct siginfo) + */ + const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + 128 + + offsetof(struct ucontext, uc_sigmask); +#endif + + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/mips/errnoent.h b/linux/mips/errnoent.h index b22ee87a..a82f9c62 100644 --- a/linux/mips/errnoent.h +++ b/linux/mips/errnoent.h @@ -1,1135 +1,150 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EAGAIN", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "ENOMSG", /* 35 */ - "EIDRM", /* 36 */ - "ECHRNG", /* 37 */ - "EL2NSYNC", /* 38 */ - "EL3HLT", /* 39 */ - "EL3RST", /* 40 */ - "ELNRNG", /* 41 */ - "EUNATCH", /* 42 */ - "ENOCSI", /* 43 */ - "EL2HLT", /* 44 */ - "EDEADLK", /* 45 */ - "ENOLCK", /* 46 */ - "ERRNO_47", /* 47 */ - "ERRNO_48", /* 48 */ - "ERRNO_49", /* 49 */ - "EBADE", /* 50 */ - "EBADR", /* 51 */ - "EXFULL", /* 52 */ - "ENOANO", /* 53 */ - "EBADRQC", /* 54 */ - "EBADSLT", /* 55 */ - "EDEADLOCK", /* 56 */ - "ERRNO_57", /* 57 */ - "ERRNO_58", /* 58 */ - "EBFONT", /* 59 */ - "ENOSTR", /* 60 */ - "ENODATA", /* 61 */ - "ETIME", /* 62 */ - "ENOSR", /* 63 */ - "ENONET", /* 64 */ - "ENOPKG", /* 65 */ - "EREMOTE", /* 66 */ - "ENOLINK", /* 67 */ - "EADV", /* 68 */ - "ESRMNT", /* 69 */ - "ECOMM", /* 70 */ - "EPROTO", /* 71 */ - "ERRNO_72", /* 72 */ - "EDOTDOT", /* 73 */ - "EMULTIHOP", /* 74 */ - "ERRNO_75", /* 75 */ - "ERRNO_76", /* 76 */ - "EBADMSG", /* 77 */ - "ENAMETOOLONG", /* 78 */ - "EOVERFLOW", /* 79 */ - "ENOTUNIQ", /* 80 */ - "EBADFD", /* 81 */ - "EREMCHG", /* 82 */ - "ELIBACC", /* 83 */ - "ELIBBAD", /* 84 */ - "ELIBSCN", /* 85 */ - "ELIBMAX", /* 86 */ - "ELIBEXEC", /* 87 */ - "EILSEQ", /* 88 */ - "ENOSYS", /* 89 */ - "ELOOP", /* 90 */ - "ERESTART", /* 91 */ - "ESTRPIPE", /* 92 */ - "ENOTEMPTY", /* 93 */ - "EUSERS", /* 94 */ - "ENOTSOCK", /* 95 */ - "EDESTADDRREQ", /* 96 */ - "EMSGSIZE", /* 97 */ - "EPROTOTYPE", /* 98 */ - "ENOPROTOOPT", /* 99 */ - "ERRNO_100", /* 100 */ - "ERRNO_101", /* 101 */ - "ERRNO_102", /* 102 */ - "ERRNO_103", /* 103 */ - "ERRNO_104", /* 104 */ - "ERRNO_105", /* 105 */ - "ERRNO_106", /* 106 */ - "ERRNO_107", /* 107 */ - "ERRNO_108", /* 108 */ - "ERRNO_109", /* 109 */ - "ERRNO_110", /* 110 */ - "ERRNO_111", /* 111 */ - "ERRNO_112", /* 112 */ - "ERRNO_113", /* 113 */ - "ERRNO_114", /* 114 */ - "ERRNO_115", /* 115 */ - "ERRNO_116", /* 116 */ - "ERRNO_117", /* 117 */ - "ERRNO_118", /* 118 */ - "ERRNO_119", /* 119 */ - "EPROTONOSUPPORT", /* 120 */ - "ESOCKTNOSUPPORT", /* 121 */ - "EOPNOTSUPP", /* 122 */ - "EPFNOSUPPORT", /* 123 */ - "EAFNOSUPPORT", /* 124 */ - "EADDRINUSE", /* 125 */ - "EADDRNOTAVAIL", /* 126 */ - "ENETDOWN", /* 127 */ - "ENETUNREACH", /* 128 */ - "ENETRESET", /* 129 */ - "ECONNABORTED", /* 130 */ - "ECONNRESET", /* 131 */ - "ENOBUFS", /* 132 */ - "EISCONN", /* 133 */ - "ENOTCONN", /* 134 */ - "EUCLEAN", /* 135 */ - "ERRNO_136", /* 136 */ - "ENOTNAM", /* 137 */ - "ENAVAIL", /* 138 */ - "EISNAM", /* 139 */ - "EREMOTEIO", /* 140 */ - "EINIT", /* 141 */ - "EREMDEV", /* 142 */ - "ESHUTDOWN", /* 143 */ - "ETOOMANYREFS", /* 144 */ - "ETIMEDOUT", /* 145 */ - "ECONNREFUSED", /* 146 */ - "EHOSTDOWN", /* 147 */ - "EHOSTUNREACH", /* 148 */ - "EALREADY", /* 149 */ - "EINPROGRESS", /* 150 */ - "ESTALE", /* 151 */ - "ERRNO_152", /* 152 */ - "ERRNO_153", /* 153 */ - "ERRNO_154", /* 154 */ - "ERRNO_155", /* 155 */ - "ERRNO_156", /* 156 */ - "ERRNO_157", /* 157 */ - "ECANCELED", /* 158 */ - "ENOMEDIUM", /* 159 */ - "EMEDIUMTYPE", /* 160 */ - "ERRNO_161", /* 161 */ - "ERRNO_162", /* 162 */ - "ERRNO_163", /* 163 */ - "ERRNO_164", /* 164 */ - "ERRNO_165", /* 165 */ - "ERRNO_166", /* 166 */ - "ERRNO_167", /* 167 */ - "ERRNO_168", /* 168 */ - "ERRNO_169", /* 169 */ - "ERRNO_170", /* 170 */ - "ERRNO_171", /* 171 */ - "ERRNO_172", /* 172 */ - "ERRNO_173", /* 173 */ - "ERRNO_174", /* 174 */ - "ERRNO_175", /* 175 */ - "ERRNO_176", /* 176 */ - "ERRNO_177", /* 177 */ - "ERRNO_178", /* 178 */ - "ERRNO_179", /* 179 */ - "ERRNO_180", /* 180 */ - "ERRNO_181", /* 181 */ - "ERRNO_182", /* 182 */ - "ERRNO_183", /* 183 */ - "ERRNO_184", /* 184 */ - "ERRNO_185", /* 185 */ - "ERRNO_186", /* 186 */ - "ERRNO_187", /* 187 */ - "ERRNO_188", /* 188 */ - "ERRNO_189", /* 189 */ - "ERRNO_190", /* 190 */ - "ERRNO_191", /* 191 */ - "ERRNO_192", /* 192 */ - "ERRNO_193", /* 193 */ - "ERRNO_194", /* 194 */ - "ERRNO_195", /* 195 */ - "ERRNO_196", /* 196 */ - "ERRNO_197", /* 197 */ - "ERRNO_198", /* 198 */ - "ERRNO_199", /* 199 */ - "ERRNO_200", /* 200 */ - "ERRNO_201", /* 201 */ - "ERRNO_202", /* 202 */ - "ERRNO_203", /* 203 */ - "ERRNO_204", /* 204 */ - "ERRNO_205", /* 205 */ - "ERRNO_206", /* 206 */ - "ERRNO_207", /* 207 */ - "ERRNO_208", /* 208 */ - "ERRNO_209", /* 209 */ - "ERRNO_210", /* 210 */ - "ERRNO_211", /* 211 */ - "ERRNO_212", /* 212 */ - "ERRNO_213", /* 213 */ - "ERRNO_214", /* 214 */ - "ERRNO_215", /* 215 */ - "ERRNO_216", /* 216 */ - "ERRNO_217", /* 217 */ - "ERRNO_218", /* 218 */ - "ERRNO_219", /* 219 */ - "ERRNO_220", /* 220 */ - "ERRNO_221", /* 221 */ - "ERRNO_222", /* 222 */ - "ERRNO_223", /* 223 */ - "ERRNO_224", /* 224 */ - "ERRNO_225", /* 225 */ - "ERRNO_226", /* 226 */ - "ERRNO_227", /* 227 */ - "ERRNO_228", /* 228 */ - "ERRNO_229", /* 229 */ - "ERRNO_230", /* 230 */ - "ERRNO_231", /* 231 */ - "ERRNO_232", /* 232 */ - "ERRNO_233", /* 233 */ - "ERRNO_234", /* 234 */ - "ERRNO_235", /* 235 */ - "ERRNO_236", /* 236 */ - "ERRNO_237", /* 237 */ - "ERRNO_238", /* 238 */ - "ERRNO_239", /* 239 */ - "ERRNO_240", /* 240 */ - "ERRNO_241", /* 241 */ - "ERRNO_242", /* 242 */ - "ERRNO_243", /* 243 */ - "ERRNO_244", /* 244 */ - "ERRNO_245", /* 245 */ - "ERRNO_246", /* 246 */ - "ERRNO_247", /* 247 */ - "ERRNO_248", /* 248 */ - "ERRNO_249", /* 249 */ - "ERRNO_250", /* 250 */ - "ERRNO_251", /* 251 */ - "ERRNO_252", /* 252 */ - "ERRNO_253", /* 253 */ - "ERRNO_254", /* 254 */ - "ERRNO_255", /* 255 */ - "ERRNO_256", /* 256 */ - "ERRNO_257", /* 257 */ - "ERRNO_258", /* 258 */ - "ERRNO_259", /* 259 */ - "ERRNO_260", /* 260 */ - "ERRNO_261", /* 261 */ - "ERRNO_262", /* 262 */ - "ERRNO_263", /* 263 */ - "ERRNO_264", /* 264 */ - "ERRNO_265", /* 265 */ - "ERRNO_266", /* 266 */ - "ERRNO_267", /* 267 */ - "ERRNO_268", /* 268 */ - "ERRNO_269", /* 269 */ - "ERRNO_270", /* 270 */ - "ERRNO_271", /* 271 */ - "ERRNO_272", /* 272 */ - "ERRNO_273", /* 273 */ - "ERRNO_274", /* 274 */ - "ERRNO_275", /* 275 */ - "ERRNO_276", /* 276 */ - "ERRNO_277", /* 277 */ - "ERRNO_278", /* 278 */ - "ERRNO_279", /* 279 */ - "ERRNO_280", /* 280 */ - "ERRNO_281", /* 281 */ - "ERRNO_282", /* 282 */ - "ERRNO_283", /* 283 */ - "ERRNO_284", /* 284 */ - "ERRNO_285", /* 285 */ - "ERRNO_286", /* 286 */ - "ERRNO_287", /* 287 */ - "ERRNO_288", /* 288 */ - "ERRNO_289", /* 289 */ - "ERRNO_290", /* 290 */ - "ERRNO_291", /* 291 */ - "ERRNO_292", /* 292 */ - "ERRNO_293", /* 293 */ - "ERRNO_294", /* 294 */ - "ERRNO_295", /* 295 */ - "ERRNO_296", /* 296 */ - "ERRNO_297", /* 297 */ - "ERRNO_298", /* 298 */ - "ERRNO_299", /* 299 */ - "ERRNO_300", /* 300 */ - "ERRNO_301", /* 301 */ - "ERRNO_302", /* 302 */ - "ERRNO_303", /* 303 */ - "ERRNO_304", /* 304 */ - "ERRNO_305", /* 305 */ - "ERRNO_306", /* 306 */ - "ERRNO_307", /* 307 */ - "ERRNO_308", /* 308 */ - "ERRNO_309", /* 309 */ - "ERRNO_310", /* 310 */ - "ERRNO_311", /* 311 */ - "ERRNO_312", /* 312 */ - "ERRNO_313", /* 313 */ - "ERRNO_314", /* 314 */ - "ERRNO_315", /* 315 */ - "ERRNO_316", /* 316 */ - "ERRNO_317", /* 317 */ - "ERRNO_318", /* 318 */ - "ERRNO_319", /* 319 */ - "ERRNO_320", /* 320 */ - "ERRNO_321", /* 321 */ - "ERRNO_322", /* 322 */ - "ERRNO_323", /* 323 */ - "ERRNO_324", /* 324 */ - "ERRNO_325", /* 325 */ - "ERRNO_326", /* 326 */ - "ERRNO_327", /* 327 */ - "ERRNO_328", /* 328 */ - "ERRNO_329", /* 329 */ - "ERRNO_330", /* 330 */ - "ERRNO_331", /* 331 */ - "ERRNO_332", /* 332 */ - "ERRNO_333", /* 333 */ - "ERRNO_334", /* 334 */ - "ERRNO_335", /* 335 */ - "ERRNO_336", /* 336 */ - "ERRNO_337", /* 337 */ - "ERRNO_338", /* 338 */ - "ERRNO_339", /* 339 */ - "ERRNO_340", /* 340 */ - "ERRNO_341", /* 341 */ - "ERRNO_342", /* 342 */ - "ERRNO_343", /* 343 */ - "ERRNO_344", /* 344 */ - "ERRNO_345", /* 345 */ - "ERRNO_346", /* 346 */ - "ERRNO_347", /* 347 */ - "ERRNO_348", /* 348 */ - "ERRNO_349", /* 349 */ - "ERRNO_350", /* 350 */ - "ERRNO_351", /* 351 */ - "ERRNO_352", /* 352 */ - "ERRNO_353", /* 353 */ - "ERRNO_354", /* 354 */ - "ERRNO_355", /* 355 */ - "ERRNO_356", /* 356 */ - "ERRNO_357", /* 357 */ - "ERRNO_358", /* 358 */ - "ERRNO_359", /* 359 */ - "ERRNO_360", /* 360 */ - "ERRNO_361", /* 361 */ - "ERRNO_362", /* 362 */ - "ERRNO_363", /* 363 */ - "ERRNO_364", /* 364 */ - "ERRNO_365", /* 365 */ - "ERRNO_366", /* 366 */ - "ERRNO_367", /* 367 */ - "ERRNO_368", /* 368 */ - "ERRNO_369", /* 369 */ - "ERRNO_370", /* 370 */ - "ERRNO_371", /* 371 */ - "ERRNO_372", /* 372 */ - "ERRNO_373", /* 373 */ - "ERRNO_374", /* 374 */ - "ERRNO_375", /* 375 */ - "ERRNO_376", /* 376 */ - "ERRNO_377", /* 377 */ - "ERRNO_378", /* 378 */ - "ERRNO_379", /* 379 */ - "ERRNO_380", /* 380 */ - "ERRNO_381", /* 381 */ - "ERRNO_382", /* 382 */ - "ERRNO_383", /* 383 */ - "ERRNO_384", /* 384 */ - "ERRNO_385", /* 385 */ - "ERRNO_386", /* 386 */ - "ERRNO_387", /* 387 */ - "ERRNO_388", /* 388 */ - "ERRNO_389", /* 389 */ - "ERRNO_390", /* 390 */ - "ERRNO_391", /* 391 */ - "ERRNO_392", /* 392 */ - "ERRNO_393", /* 393 */ - "ERRNO_394", /* 394 */ - "ERRNO_395", /* 395 */ - "ERRNO_396", /* 396 */ - "ERRNO_397", /* 397 */ - "ERRNO_398", /* 398 */ - "ERRNO_399", /* 399 */ - "ERRNO_400", /* 400 */ - "ERRNO_401", /* 401 */ - "ERRNO_402", /* 402 */ - "ERRNO_403", /* 403 */ - "ERRNO_404", /* 404 */ - "ERRNO_405", /* 405 */ - "ERRNO_406", /* 406 */ - "ERRNO_407", /* 407 */ - "ERRNO_408", /* 408 */ - "ERRNO_409", /* 409 */ - "ERRNO_410", /* 410 */ - "ERRNO_411", /* 411 */ - "ERRNO_412", /* 412 */ - "ERRNO_413", /* 413 */ - "ERRNO_414", /* 414 */ - "ERRNO_415", /* 415 */ - "ERRNO_416", /* 416 */ - "ERRNO_417", /* 417 */ - "ERRNO_418", /* 418 */ - "ERRNO_419", /* 419 */ - "ERRNO_420", /* 420 */ - "ERRNO_421", /* 421 */ - "ERRNO_422", /* 422 */ - "ERRNO_423", /* 423 */ - "ERRNO_424", /* 424 */ - "ERRNO_425", /* 425 */ - "ERRNO_426", /* 426 */ - "ERRNO_427", /* 427 */ - "ERRNO_428", /* 428 */ - "ERRNO_429", /* 429 */ - "ERRNO_430", /* 430 */ - "ERRNO_431", /* 431 */ - "ERRNO_432", /* 432 */ - "ERRNO_433", /* 433 */ - "ERRNO_434", /* 434 */ - "ERRNO_435", /* 435 */ - "ERRNO_436", /* 436 */ - "ERRNO_437", /* 437 */ - "ERRNO_438", /* 438 */ - "ERRNO_439", /* 439 */ - "ERRNO_440", /* 440 */ - "ERRNO_441", /* 441 */ - "ERRNO_442", /* 442 */ - "ERRNO_443", /* 443 */ - "ERRNO_444", /* 444 */ - "ERRNO_445", /* 445 */ - "ERRNO_446", /* 446 */ - "ERRNO_447", /* 447 */ - "ERRNO_448", /* 448 */ - "ERRNO_449", /* 449 */ - "ERRNO_450", /* 450 */ - "ERRNO_451", /* 451 */ - "ERRNO_452", /* 452 */ - "ERRNO_453", /* 453 */ - "ERRNO_454", /* 454 */ - "ERRNO_455", /* 455 */ - "ERRNO_456", /* 456 */ - "ERRNO_457", /* 457 */ - "ERRNO_458", /* 458 */ - "ERRNO_459", /* 459 */ - "ERRNO_460", /* 460 */ - "ERRNO_461", /* 461 */ - "ERRNO_462", /* 462 */ - "ERRNO_463", /* 463 */ - "ERRNO_464", /* 464 */ - "ERRNO_465", /* 465 */ - "ERRNO_466", /* 466 */ - "ERRNO_467", /* 467 */ - "ERRNO_468", /* 468 */ - "ERRNO_469", /* 469 */ - "ERRNO_470", /* 470 */ - "ERRNO_471", /* 471 */ - "ERRNO_472", /* 472 */ - "ERRNO_473", /* 473 */ - "ERRNO_474", /* 474 */ - "ERRNO_475", /* 475 */ - "ERRNO_476", /* 476 */ - "ERRNO_477", /* 477 */ - "ERRNO_478", /* 478 */ - "ERRNO_479", /* 479 */ - "ERRNO_480", /* 480 */ - "ERRNO_481", /* 481 */ - "ERRNO_482", /* 482 */ - "ERRNO_483", /* 483 */ - "ERRNO_484", /* 484 */ - "ERRNO_485", /* 485 */ - "ERRNO_486", /* 486 */ - "ERRNO_487", /* 487 */ - "ERRNO_488", /* 488 */ - "ERRNO_489", /* 489 */ - "ERRNO_490", /* 490 */ - "ERRNO_491", /* 491 */ - "ERRNO_492", /* 492 */ - "ERRNO_493", /* 493 */ - "ERRNO_494", /* 494 */ - "ERRNO_495", /* 495 */ - "ERRNO_496", /* 496 */ - "ERRNO_497", /* 497 */ - "ERRNO_498", /* 498 */ - "ERRNO_499", /* 499 */ - "ERRNO_500", /* 500 */ - "ERRNO_501", /* 501 */ - "ERRNO_502", /* 502 */ - "ERRNO_503", /* 503 */ - "ERRNO_504", /* 504 */ - "ERRNO_505", /* 505 */ - "ERRNO_506", /* 506 */ - "ERRNO_507", /* 507 */ - "ERRNO_508", /* 508 */ - "ERRNO_509", /* 509 */ - "ERRNO_510", /* 510 */ - "ERRNO_511", /* 511 */ - "ERRNO_512", /* 512 */ - "ERRNO_513", /* 513 */ - "ERRNO_514", /* 514 */ - "ERRNO_515", /* 515 */ - "ERRNO_516", /* 516 */ - "ERRNO_517", /* 517 */ - "ERRNO_518", /* 518 */ - "ERRNO_519", /* 519 */ - "ERRNO_520", /* 520 */ - "ERRNO_521", /* 521 */ - "ERRNO_522", /* 522 */ - "ERRNO_523", /* 523 */ - "ERRNO_524", /* 524 */ - "ERRNO_525", /* 525 */ - "ERRNO_526", /* 526 */ - "ERRNO_527", /* 527 */ - "ERRNO_528", /* 528 */ - "ERRNO_529", /* 529 */ - "ERRNO_530", /* 530 */ - "ERRNO_531", /* 531 */ - "ERRNO_532", /* 532 */ - "ERRNO_533", /* 533 */ - "ERRNO_534", /* 534 */ - "ERRNO_535", /* 535 */ - "ERRNO_536", /* 536 */ - "ERRNO_537", /* 537 */ - "ERRNO_538", /* 538 */ - "ERRNO_539", /* 539 */ - "ERRNO_540", /* 540 */ - "ERRNO_541", /* 541 */ - "ERRNO_542", /* 542 */ - "ERRNO_543", /* 543 */ - "ERRNO_544", /* 544 */ - "ERRNO_545", /* 545 */ - "ERRNO_546", /* 546 */ - "ERRNO_547", /* 547 */ - "ERRNO_548", /* 548 */ - "ERRNO_549", /* 549 */ - "ERRNO_550", /* 550 */ - "ERRNO_551", /* 551 */ - "ERRNO_552", /* 552 */ - "ERRNO_553", /* 553 */ - "ERRNO_554", /* 554 */ - "ERRNO_555", /* 555 */ - "ERRNO_556", /* 556 */ - "ERRNO_557", /* 557 */ - "ERRNO_558", /* 558 */ - "ERRNO_559", /* 559 */ - "ERRNO_560", /* 560 */ - "ERRNO_561", /* 561 */ - "ERRNO_562", /* 562 */ - "ERRNO_563", /* 563 */ - "ERRNO_564", /* 564 */ - "ERRNO_565", /* 565 */ - "ERRNO_566", /* 566 */ - "ERRNO_567", /* 567 */ - "ERRNO_568", /* 568 */ - "ERRNO_569", /* 569 */ - "ERRNO_570", /* 570 */ - "ERRNO_571", /* 571 */ - "ERRNO_572", /* 572 */ - "ERRNO_573", /* 573 */ - "ERRNO_574", /* 574 */ - "ERRNO_575", /* 575 */ - "ERRNO_576", /* 576 */ - "ERRNO_577", /* 577 */ - "ERRNO_578", /* 578 */ - "ERRNO_579", /* 579 */ - "ERRNO_580", /* 580 */ - "ERRNO_581", /* 581 */ - "ERRNO_582", /* 582 */ - "ERRNO_583", /* 583 */ - "ERRNO_584", /* 584 */ - "ERRNO_585", /* 585 */ - "ERRNO_586", /* 586 */ - "ERRNO_587", /* 587 */ - "ERRNO_588", /* 588 */ - "ERRNO_589", /* 589 */ - "ERRNO_590", /* 590 */ - "ERRNO_591", /* 591 */ - "ERRNO_592", /* 592 */ - "ERRNO_593", /* 593 */ - "ERRNO_594", /* 594 */ - "ERRNO_595", /* 595 */ - "ERRNO_596", /* 596 */ - "ERRNO_597", /* 597 */ - "ERRNO_598", /* 598 */ - "ERRNO_599", /* 599 */ - "ERRNO_600", /* 600 */ - "ERRNO_601", /* 601 */ - "ERRNO_602", /* 602 */ - "ERRNO_603", /* 603 */ - "ERRNO_604", /* 604 */ - "ERRNO_605", /* 605 */ - "ERRNO_606", /* 606 */ - "ERRNO_607", /* 607 */ - "ERRNO_608", /* 608 */ - "ERRNO_609", /* 609 */ - "ERRNO_610", /* 610 */ - "ERRNO_611", /* 611 */ - "ERRNO_612", /* 612 */ - "ERRNO_613", /* 613 */ - "ERRNO_614", /* 614 */ - "ERRNO_615", /* 615 */ - "ERRNO_616", /* 616 */ - "ERRNO_617", /* 617 */ - "ERRNO_618", /* 618 */ - "ERRNO_619", /* 619 */ - "ERRNO_620", /* 620 */ - "ERRNO_621", /* 621 */ - "ERRNO_622", /* 622 */ - "ERRNO_623", /* 623 */ - "ERRNO_624", /* 624 */ - "ERRNO_625", /* 625 */ - "ERRNO_626", /* 626 */ - "ERRNO_627", /* 627 */ - "ERRNO_628", /* 628 */ - "ERRNO_629", /* 629 */ - "ERRNO_630", /* 630 */ - "ERRNO_631", /* 631 */ - "ERRNO_632", /* 632 */ - "ERRNO_633", /* 633 */ - "ERRNO_634", /* 634 */ - "ERRNO_635", /* 635 */ - "ERRNO_636", /* 636 */ - "ERRNO_637", /* 637 */ - "ERRNO_638", /* 638 */ - "ERRNO_639", /* 639 */ - "ERRNO_640", /* 640 */ - "ERRNO_641", /* 641 */ - "ERRNO_642", /* 642 */ - "ERRNO_643", /* 643 */ - "ERRNO_644", /* 644 */ - "ERRNO_645", /* 645 */ - "ERRNO_646", /* 646 */ - "ERRNO_647", /* 647 */ - "ERRNO_648", /* 648 */ - "ERRNO_649", /* 649 */ - "ERRNO_650", /* 650 */ - "ERRNO_651", /* 651 */ - "ERRNO_652", /* 652 */ - "ERRNO_653", /* 653 */ - "ERRNO_654", /* 654 */ - "ERRNO_655", /* 655 */ - "ERRNO_656", /* 656 */ - "ERRNO_657", /* 657 */ - "ERRNO_658", /* 658 */ - "ERRNO_659", /* 659 */ - "ERRNO_660", /* 660 */ - "ERRNO_661", /* 661 */ - "ERRNO_662", /* 662 */ - "ERRNO_663", /* 663 */ - "ERRNO_664", /* 664 */ - "ERRNO_665", /* 665 */ - "ERRNO_666", /* 666 */ - "ERRNO_667", /* 667 */ - "ERRNO_668", /* 668 */ - "ERRNO_669", /* 669 */ - "ERRNO_670", /* 670 */ - "ERRNO_671", /* 671 */ - "ERRNO_672", /* 672 */ - "ERRNO_673", /* 673 */ - "ERRNO_674", /* 674 */ - "ERRNO_675", /* 675 */ - "ERRNO_676", /* 676 */ - "ERRNO_677", /* 677 */ - "ERRNO_678", /* 678 */ - "ERRNO_679", /* 679 */ - "ERRNO_680", /* 680 */ - "ERRNO_681", /* 681 */ - "ERRNO_682", /* 682 */ - "ERRNO_683", /* 683 */ - "ERRNO_684", /* 684 */ - "ERRNO_685", /* 685 */ - "ERRNO_686", /* 686 */ - "ERRNO_687", /* 687 */ - "ERRNO_688", /* 688 */ - "ERRNO_689", /* 689 */ - "ERRNO_690", /* 690 */ - "ERRNO_691", /* 691 */ - "ERRNO_692", /* 692 */ - "ERRNO_693", /* 693 */ - "ERRNO_694", /* 694 */ - "ERRNO_695", /* 695 */ - "ERRNO_696", /* 696 */ - "ERRNO_697", /* 697 */ - "ERRNO_698", /* 698 */ - "ERRNO_699", /* 699 */ - "ERRNO_700", /* 700 */ - "ERRNO_701", /* 701 */ - "ERRNO_702", /* 702 */ - "ERRNO_703", /* 703 */ - "ERRNO_704", /* 704 */ - "ERRNO_705", /* 705 */ - "ERRNO_706", /* 706 */ - "ERRNO_707", /* 707 */ - "ERRNO_708", /* 708 */ - "ERRNO_709", /* 709 */ - "ERRNO_710", /* 710 */ - "ERRNO_711", /* 711 */ - "ERRNO_712", /* 712 */ - "ERRNO_713", /* 713 */ - "ERRNO_714", /* 714 */ - "ERRNO_715", /* 715 */ - "ERRNO_716", /* 716 */ - "ERRNO_717", /* 717 */ - "ERRNO_718", /* 718 */ - "ERRNO_719", /* 719 */ - "ERRNO_720", /* 720 */ - "ERRNO_721", /* 721 */ - "ERRNO_722", /* 722 */ - "ERRNO_723", /* 723 */ - "ERRNO_724", /* 724 */ - "ERRNO_725", /* 725 */ - "ERRNO_726", /* 726 */ - "ERRNO_727", /* 727 */ - "ERRNO_728", /* 728 */ - "ERRNO_729", /* 729 */ - "ERRNO_730", /* 730 */ - "ERRNO_731", /* 731 */ - "ERRNO_732", /* 732 */ - "ERRNO_733", /* 733 */ - "ERRNO_734", /* 734 */ - "ERRNO_735", /* 735 */ - "ERRNO_736", /* 736 */ - "ERRNO_737", /* 737 */ - "ERRNO_738", /* 738 */ - "ERRNO_739", /* 739 */ - "ERRNO_740", /* 740 */ - "ERRNO_741", /* 741 */ - "ERRNO_742", /* 742 */ - "ERRNO_743", /* 743 */ - "ERRNO_744", /* 744 */ - "ERRNO_745", /* 745 */ - "ERRNO_746", /* 746 */ - "ERRNO_747", /* 747 */ - "ERRNO_748", /* 748 */ - "ERRNO_749", /* 749 */ - "ERRNO_750", /* 750 */ - "ERRNO_751", /* 751 */ - "ERRNO_752", /* 752 */ - "ERRNO_753", /* 753 */ - "ERRNO_754", /* 754 */ - "ERRNO_755", /* 755 */ - "ERRNO_756", /* 756 */ - "ERRNO_757", /* 757 */ - "ERRNO_758", /* 758 */ - "ERRNO_759", /* 759 */ - "ERRNO_760", /* 760 */ - "ERRNO_761", /* 761 */ - "ERRNO_762", /* 762 */ - "ERRNO_763", /* 763 */ - "ERRNO_764", /* 764 */ - "ERRNO_765", /* 765 */ - "ERRNO_766", /* 766 */ - "ERRNO_767", /* 767 */ - "ERRNO_768", /* 768 */ - "ERRNO_769", /* 769 */ - "ERRNO_770", /* 770 */ - "ERRNO_771", /* 771 */ - "ERRNO_772", /* 772 */ - "ERRNO_773", /* 773 */ - "ERRNO_774", /* 774 */ - "ERRNO_775", /* 775 */ - "ERRNO_776", /* 776 */ - "ERRNO_777", /* 777 */ - "ERRNO_778", /* 778 */ - "ERRNO_779", /* 779 */ - "ERRNO_780", /* 780 */ - "ERRNO_781", /* 781 */ - "ERRNO_782", /* 782 */ - "ERRNO_783", /* 783 */ - "ERRNO_784", /* 784 */ - "ERRNO_785", /* 785 */ - "ERRNO_786", /* 786 */ - "ERRNO_787", /* 787 */ - "ERRNO_788", /* 788 */ - "ERRNO_789", /* 789 */ - "ERRNO_790", /* 790 */ - "ERRNO_791", /* 791 */ - "ERRNO_792", /* 792 */ - "ERRNO_793", /* 793 */ - "ERRNO_794", /* 794 */ - "ERRNO_795", /* 795 */ - "ERRNO_796", /* 796 */ - "ERRNO_797", /* 797 */ - "ERRNO_798", /* 798 */ - "ERRNO_799", /* 799 */ - "ERRNO_800", /* 800 */ - "ERRNO_801", /* 801 */ - "ERRNO_802", /* 802 */ - "ERRNO_803", /* 803 */ - "ERRNO_804", /* 804 */ - "ERRNO_805", /* 805 */ - "ERRNO_806", /* 806 */ - "ERRNO_807", /* 807 */ - "ERRNO_808", /* 808 */ - "ERRNO_809", /* 809 */ - "ERRNO_810", /* 810 */ - "ERRNO_811", /* 811 */ - "ERRNO_812", /* 812 */ - "ERRNO_813", /* 813 */ - "ERRNO_814", /* 814 */ - "ERRNO_815", /* 815 */ - "ERRNO_816", /* 816 */ - "ERRNO_817", /* 817 */ - "ERRNO_818", /* 818 */ - "ERRNO_819", /* 819 */ - "ERRNO_820", /* 820 */ - "ERRNO_821", /* 821 */ - "ERRNO_822", /* 822 */ - "ERRNO_823", /* 823 */ - "ERRNO_824", /* 824 */ - "ERRNO_825", /* 825 */ - "ERRNO_826", /* 826 */ - "ERRNO_827", /* 827 */ - "ERRNO_828", /* 828 */ - "ERRNO_829", /* 829 */ - "ERRNO_830", /* 830 */ - "ERRNO_831", /* 831 */ - "ERRNO_832", /* 832 */ - "ERRNO_833", /* 833 */ - "ERRNO_834", /* 834 */ - "ERRNO_835", /* 835 */ - "ERRNO_836", /* 836 */ - "ERRNO_837", /* 837 */ - "ERRNO_838", /* 838 */ - "ERRNO_839", /* 839 */ - "ERRNO_840", /* 840 */ - "ERRNO_841", /* 841 */ - "ERRNO_842", /* 842 */ - "ERRNO_843", /* 843 */ - "ERRNO_844", /* 844 */ - "ERRNO_845", /* 845 */ - "ERRNO_846", /* 846 */ - "ERRNO_847", /* 847 */ - "ERRNO_848", /* 848 */ - "ERRNO_849", /* 849 */ - "ERRNO_850", /* 850 */ - "ERRNO_851", /* 851 */ - "ERRNO_852", /* 852 */ - "ERRNO_853", /* 853 */ - "ERRNO_854", /* 854 */ - "ERRNO_855", /* 855 */ - "ERRNO_856", /* 856 */ - "ERRNO_857", /* 857 */ - "ERRNO_858", /* 858 */ - "ERRNO_859", /* 859 */ - "ERRNO_860", /* 860 */ - "ERRNO_861", /* 861 */ - "ERRNO_862", /* 862 */ - "ERRNO_863", /* 863 */ - "ERRNO_864", /* 864 */ - "ERRNO_865", /* 865 */ - "ERRNO_866", /* 866 */ - "ERRNO_867", /* 867 */ - "ERRNO_868", /* 868 */ - "ERRNO_869", /* 869 */ - "ERRNO_870", /* 870 */ - "ERRNO_871", /* 871 */ - "ERRNO_872", /* 872 */ - "ERRNO_873", /* 873 */ - "ERRNO_874", /* 874 */ - "ERRNO_875", /* 875 */ - "ERRNO_876", /* 876 */ - "ERRNO_877", /* 877 */ - "ERRNO_878", /* 878 */ - "ERRNO_879", /* 879 */ - "ERRNO_880", /* 880 */ - "ERRNO_881", /* 881 */ - "ERRNO_882", /* 882 */ - "ERRNO_883", /* 883 */ - "ERRNO_884", /* 884 */ - "ERRNO_885", /* 885 */ - "ERRNO_886", /* 886 */ - "ERRNO_887", /* 887 */ - "ERRNO_888", /* 888 */ - "ERRNO_889", /* 889 */ - "ERRNO_890", /* 890 */ - "ERRNO_891", /* 891 */ - "ERRNO_892", /* 892 */ - "ERRNO_893", /* 893 */ - "ERRNO_894", /* 894 */ - "ERRNO_895", /* 895 */ - "ERRNO_896", /* 896 */ - "ERRNO_897", /* 897 */ - "ERRNO_898", /* 898 */ - "ERRNO_899", /* 899 */ - "ERRNO_900", /* 900 */ - "ERRNO_901", /* 901 */ - "ERRNO_902", /* 902 */ - "ERRNO_903", /* 903 */ - "ERRNO_904", /* 904 */ - "ERRNO_905", /* 905 */ - "ERRNO_906", /* 906 */ - "ERRNO_907", /* 907 */ - "ERRNO_908", /* 908 */ - "ERRNO_909", /* 909 */ - "ERRNO_910", /* 910 */ - "ERRNO_911", /* 911 */ - "ERRNO_912", /* 912 */ - "ERRNO_913", /* 913 */ - "ERRNO_914", /* 914 */ - "ERRNO_915", /* 915 */ - "ERRNO_916", /* 916 */ - "ERRNO_917", /* 917 */ - "ERRNO_918", /* 918 */ - "ERRNO_919", /* 919 */ - "ERRNO_920", /* 920 */ - "ERRNO_921", /* 921 */ - "ERRNO_922", /* 922 */ - "ERRNO_923", /* 923 */ - "ERRNO_924", /* 924 */ - "ERRNO_925", /* 925 */ - "ERRNO_926", /* 926 */ - "ERRNO_927", /* 927 */ - "ERRNO_928", /* 928 */ - "ERRNO_929", /* 929 */ - "ERRNO_930", /* 930 */ - "ERRNO_931", /* 931 */ - "ERRNO_932", /* 932 */ - "ERRNO_933", /* 933 */ - "ERRNO_934", /* 934 */ - "ERRNO_935", /* 935 */ - "ERRNO_936", /* 936 */ - "ERRNO_937", /* 937 */ - "ERRNO_938", /* 938 */ - "ERRNO_939", /* 939 */ - "ERRNO_940", /* 940 */ - "ERRNO_941", /* 941 */ - "ERRNO_942", /* 942 */ - "ERRNO_943", /* 943 */ - "ERRNO_944", /* 944 */ - "ERRNO_945", /* 945 */ - "ERRNO_946", /* 946 */ - "ERRNO_947", /* 947 */ - "ERRNO_948", /* 948 */ - "ERRNO_949", /* 949 */ - "ERRNO_950", /* 950 */ - "ERRNO_951", /* 951 */ - "ERRNO_952", /* 952 */ - "ERRNO_953", /* 953 */ - "ERRNO_954", /* 954 */ - "ERRNO_955", /* 955 */ - "ERRNO_956", /* 956 */ - "ERRNO_957", /* 957 */ - "ERRNO_958", /* 958 */ - "ERRNO_959", /* 959 */ - "ERRNO_960", /* 960 */ - "ERRNO_961", /* 961 */ - "ERRNO_962", /* 962 */ - "ERRNO_963", /* 963 */ - "ERRNO_964", /* 964 */ - "ERRNO_965", /* 965 */ - "ERRNO_966", /* 966 */ - "ERRNO_967", /* 967 */ - "ERRNO_968", /* 968 */ - "ERRNO_969", /* 969 */ - "ERRNO_970", /* 970 */ - "ERRNO_971", /* 971 */ - "ERRNO_972", /* 972 */ - "ERRNO_973", /* 973 */ - "ERRNO_974", /* 974 */ - "ERRNO_975", /* 975 */ - "ERRNO_976", /* 976 */ - "ERRNO_977", /* 977 */ - "ERRNO_978", /* 978 */ - "ERRNO_979", /* 979 */ - "ERRNO_980", /* 980 */ - "ERRNO_981", /* 981 */ - "ERRNO_982", /* 982 */ - "ERRNO_983", /* 983 */ - "ERRNO_984", /* 984 */ - "ERRNO_985", /* 985 */ - "ERRNO_986", /* 986 */ - "ERRNO_987", /* 987 */ - "ERRNO_988", /* 988 */ - "ERRNO_989", /* 989 */ - "ERRNO_990", /* 990 */ - "ERRNO_991", /* 991 */ - "ERRNO_992", /* 992 */ - "ERRNO_993", /* 993 */ - "ERRNO_994", /* 994 */ - "ERRNO_995", /* 995 */ - "ERRNO_996", /* 996 */ - "ERRNO_997", /* 997 */ - "ERRNO_998", /* 998 */ - "ERRNO_999", /* 999 */ - "ECANCELED", /* 1000 */ - "ERRNO_1001", /* 1001 */ - "ERRNO_1002", /* 1002 */ - "ERRNO_1003", /* 1003 */ - "ERRNO_1004", /* 1004 */ - "ERRNO_1005", /* 1005 */ - "ERRNO_1006", /* 1006 */ - "ERRNO_1007", /* 1007 */ - "ERRNO_1008", /* 1008 */ - "ERRNO_1009", /* 1009 */ - "ERRNO_1010", /* 1010 */ - "ERRNO_1011", /* 1011 */ - "ERRNO_1012", /* 1012 */ - "ERRNO_1013", /* 1013 */ - "ERRNO_1014", /* 1014 */ - "ERRNO_1015", /* 1015 */ - "ERRNO_1016", /* 1016 */ - "ERRNO_1017", /* 1017 */ - "ERRNO_1018", /* 1018 */ - "ERRNO_1019", /* 1019 */ - "ERRNO_1020", /* 1020 */ - "ERRNO_1021", /* 1021 */ - "ERRNO_1022", /* 1022 */ - "ERRNO_1023", /* 1023 */ - "ERRNO_1024", /* 1024 */ - "ERRNO_1025", /* 1025 */ - "ERRNO_1026", /* 1026 */ - "ERRNO_1027", /* 1027 */ - "ERRNO_1028", /* 1028 */ - "ERRNO_1029", /* 1029 */ - "ERRNO_1030", /* 1030 */ - "ERRNO_1031", /* 1031 */ - "ERRNO_1032", /* 1032 */ - "ERRNO_1033", /* 1033 */ - "ERRNO_1034", /* 1034 */ - "ERRNO_1035", /* 1035 */ - "ERRNO_1036", /* 1036 */ - "ERRNO_1037", /* 1037 */ - "ERRNO_1038", /* 1038 */ - "ERRNO_1039", /* 1039 */ - "ERRNO_1040", /* 1040 */ - "ERRNO_1041", /* 1041 */ - "ERRNO_1042", /* 1042 */ - "ERRNO_1043", /* 1043 */ - "ERRNO_1044", /* 1044 */ - "ERRNO_1045", /* 1045 */ - "ERRNO_1046", /* 1046 */ - "ERRNO_1047", /* 1047 */ - "ERRNO_1048", /* 1048 */ - "ERRNO_1049", /* 1049 */ - "ERRNO_1050", /* 1050 */ - "ERRNO_1051", /* 1051 */ - "ERRNO_1052", /* 1052 */ - "ERRNO_1053", /* 1053 */ - "ERRNO_1054", /* 1054 */ - "ERRNO_1055", /* 1055 */ - "ERRNO_1056", /* 1056 */ - "ERRNO_1057", /* 1057 */ - "ERRNO_1058", /* 1058 */ - "ERRNO_1059", /* 1059 */ - "ERRNO_1060", /* 1060 */ - "ERRNO_1061", /* 1061 */ - "ERRNO_1062", /* 1062 */ - "ERRNO_1063", /* 1063 */ - "ERRNO_1064", /* 1064 */ - "ERRNO_1065", /* 1065 */ - "ERRNO_1066", /* 1066 */ - "ERRNO_1067", /* 1067 */ - "ERRNO_1068", /* 1068 */ - "ERRNO_1069", /* 1069 */ - "ERRNO_1070", /* 1070 */ - "ERRNO_1071", /* 1071 */ - "ERRNO_1072", /* 1072 */ - "ERRNO_1073", /* 1073 */ - "ERRNO_1074", /* 1074 */ - "ERRNO_1075", /* 1075 */ - "ERRNO_1076", /* 1076 */ - "ERRNO_1077", /* 1077 */ - "ERRNO_1078", /* 1078 */ - "ERRNO_1079", /* 1079 */ - "ERRNO_1080", /* 1080 */ - "ERRNO_1081", /* 1081 */ - "ERRNO_1082", /* 1082 */ - "ERRNO_1083", /* 1083 */ - "ERRNO_1084", /* 1084 */ - "ERRNO_1085", /* 1085 */ - "ERRNO_1086", /* 1086 */ - "ERRNO_1087", /* 1087 */ - "ERRNO_1088", /* 1088 */ - "ERRNO_1089", /* 1089 */ - "ERRNO_1090", /* 1090 */ - "ERRNO_1091", /* 1091 */ - "ERRNO_1092", /* 1092 */ - "ERRNO_1093", /* 1093 */ - "ERRNO_1094", /* 1094 */ - "ERRNO_1095", /* 1095 */ - "ERRNO_1096", /* 1096 */ - "ERRNO_1097", /* 1097 */ - "ERRNO_1098", /* 1098 */ - "ERRNO_1099", /* 1099 */ - "ERRNO_1100", /* 1100 */ - "ERRNO_1101", /* 1101 */ - "ERRNO_1102", /* 1102 */ - "ERRNO_1103", /* 1103 */ - "ERRNO_1104", /* 1104 */ - "ERRNO_1105", /* 1105 */ - "ERRNO_1106", /* 1106 */ - "ERRNO_1107", /* 1107 */ - "ERRNO_1108", /* 1108 */ - "ERRNO_1109", /* 1109 */ - "ERRNO_1110", /* 1110 */ - "ERRNO_1111", /* 1111 */ - "ERRNO_1112", /* 1112 */ - "ERRNO_1113", /* 1113 */ - "ERRNO_1114", /* 1114 */ - "ERRNO_1115", /* 1115 */ - "ERRNO_1116", /* 1116 */ - "ERRNO_1117", /* 1117 */ - "ERRNO_1118", /* 1118 */ - "ERRNO_1119", /* 1119 */ - "ERRNO_1120", /* 1120 */ - "ERRNO_1121", /* 1121 */ - "ERRNO_1122", /* 1122 */ - "ERRNO_1123", /* 1123 */ - "ERRNO_1124", /* 1124 */ - "ERRNO_1125", /* 1125 */ - "ERRNO_1126", /* 1126 */ - "ERRNO_1127", /* 1127 */ - "ERRNO_1128", /* 1128 */ - "ERRNO_1129", /* 1129 */ - "ERRNO_1130", /* 1130 */ - "ERRNO_1131", /* 1131 */ - "ERRNO_1132", /* 1132 */ - "EDQUOT", /* 1133 */ - "EMAXERRNO", /* 1134 */ +[ 1] = "EPERM", +[ 2] = "ENOENT", +[ 3] = "ESRCH", +[ 4] = "EINTR", +[ 5] = "EIO", +[ 6] = "ENXIO", +[ 7] = "E2BIG", +[ 8] = "ENOEXEC", +[ 9] = "EBADF", +[ 10] = "ECHILD", +[ 11] = "EAGAIN", +[ 12] = "ENOMEM", +[ 13] = "EACCES", +[ 14] = "EFAULT", +[ 15] = "ENOTBLK", +[ 16] = "EBUSY", +[ 17] = "EEXIST", +[ 18] = "EXDEV", +[ 19] = "ENODEV", +[ 20] = "ENOTDIR", +[ 21] = "EISDIR", +[ 22] = "EINVAL", +[ 23] = "ENFILE", +[ 24] = "EMFILE", +[ 25] = "ENOTTY", +[ 26] = "ETXTBSY", +[ 27] = "EFBIG", +[ 28] = "ENOSPC", +[ 29] = "ESPIPE", +[ 30] = "EROFS", +[ 31] = "EMLINK", +[ 32] = "EPIPE", +[ 33] = "EDOM", +[ 34] = "ERANGE", +[ 35] = "ENOMSG", +[ 36] = "EIDRM", +[ 37] = "ECHRNG", +[ 38] = "EL2NSYNC", +[ 39] = "EL3HLT", +[ 40] = "EL3RST", +[ 41] = "ELNRNG", +[ 42] = "EUNATCH", +[ 43] = "ENOCSI", +[ 44] = "EL2HLT", +[ 45] = "EDEADLK", +[ 46] = "ENOLCK", +[ 50] = "EBADE", +[ 51] = "EBADR", +[ 52] = "EXFULL", +[ 53] = "ENOANO", +[ 54] = "EBADRQC", +[ 55] = "EBADSLT", +[ 56] = "EDEADLOCK", +[ 59] = "EBFONT", +[ 60] = "ENOSTR", +[ 61] = "ENODATA", +[ 62] = "ETIME", +[ 63] = "ENOSR", +[ 64] = "ENONET", +[ 65] = "ENOPKG", +[ 66] = "EREMOTE", +[ 67] = "ENOLINK", +[ 68] = "EADV", +[ 69] = "ESRMNT", +[ 70] = "ECOMM", +[ 71] = "EPROTO", +[ 73] = "EDOTDOT", +[ 74] = "EMULTIHOP", +[ 77] = "EBADMSG", +[ 78] = "ENAMETOOLONG", +[ 79] = "EOVERFLOW", +[ 80] = "ENOTUNIQ", +[ 81] = "EBADFD", +[ 82] = "EREMCHG", +[ 83] = "ELIBACC", +[ 84] = "ELIBBAD", +[ 85] = "ELIBSCN", +[ 86] = "ELIBMAX", +[ 87] = "ELIBEXEC", +[ 88] = "EILSEQ", +[ 89] = "ENOSYS", +[ 90] = "ELOOP", +[ 91] = "ERESTART", +[ 92] = "ESTRPIPE", +[ 93] = "ENOTEMPTY", +[ 94] = "EUSERS", +[ 95] = "ENOTSOCK", +[ 96] = "EDESTADDRREQ", +[ 97] = "EMSGSIZE", +[ 98] = "EPROTOTYPE", +[ 99] = "ENOPROTOOPT", +[120] = "EPROTONOSUPPORT", +[121] = "ESOCKTNOSUPPORT", +[122] = "EOPNOTSUPP", +[123] = "EPFNOSUPPORT", +[124] = "EAFNOSUPPORT", +[125] = "EADDRINUSE", +[126] = "EADDRNOTAVAIL", +[127] = "ENETDOWN", +[128] = "ENETUNREACH", +[129] = "ENETRESET", +[130] = "ECONNABORTED", +[131] = "ECONNRESET", +[132] = "ENOBUFS", +[133] = "EISCONN", +[134] = "ENOTCONN", +[135] = "EUCLEAN", +[137] = "ENOTNAM", +[138] = "ENAVAIL", +[139] = "EISNAM", +[140] = "EREMOTEIO", +[141] = "EINIT", +[142] = "EREMDEV", +[143] = "ESHUTDOWN", +[144] = "ETOOMANYREFS", +[145] = "ETIMEDOUT", +[146] = "ECONNREFUSED", +[147] = "EHOSTDOWN", +[148] = "EHOSTUNREACH", +[149] = "EALREADY", +[150] = "EINPROGRESS", +[151] = "ESTALE", +[158] = "ECANCELED", +[159] = "ENOMEDIUM", +[160] = "EMEDIUMTYPE", +[161] = "ENOKEY", +[162] = "EKEYEXPIRED", +[163] = "EKEYREVOKED", +[164] = "EKEYREJECTED", +[165] = "EOWNERDEAD", +[166] = "ENOTRECOVERABLE", +[167] = "ERFKILL", +[168] = "EHWPOISON", +[512] = "ERESTARTSYS", +[513] = "ERESTARTNOINTR", +[514] = "ERESTARTNOHAND", +[515] = "ENOIOCTLCMD", +[516] = "ERESTART_RESTARTBLOCK", +[517] = "EPROBE_DEFER", +[518] = "EOPENSTALE", +[521] = "EBADHANDLE", +[522] = "ENOTSYNC", +[523] = "EBADCOOKIE", +[524] = "ENOTSUPP", +[525] = "ETOOSMALL", +[526] = "ESERVERFAULT", +[527] = "EBADTYPE", +[528] = "EJUKEBOX", +[529] = "EIOCBQUEUED", +[1133] = "EDQUOT", diff --git a/linux/mips/genstub.sh b/linux/mips/genstub.sh new file mode 100755 index 00000000..11f141f5 --- /dev/null +++ b/linux/mips/genstub.sh @@ -0,0 +1,10 @@ +#!/bin/sh -e + +srcdir="${0%/*}" +dstdir="$1"; shift + +for n in n32 n64 o32; do + in="$srcdir/syscallent-$n.h" + out="$dstdir/syscallent-$n-stub.h" + sed -r -n '/^#if/,/^#else/ {s/^([^{]*\{[^,]*,[^,]*,[[:space:]]*)[^,[:space:]]+,[[:space:]]*"([^"]+".*)/\1SEN(printargs), "'$n':\2/; s/^\[.*/&/p}' < "$in" > "$out" +done diff --git a/linux/mips/get_error.c b/linux/mips/get_error.c new file mode 100644 index 00000000..4096de26 --- /dev/null +++ b/linux/mips/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (mips_REG_A3) { + tcp->u_rval = -1; + tcp->u_error = mips_REG_V0; + } else { + tcp->u_rval = mips_REG_V0; + } +} diff --git a/linux/mips/get_scno.c b/linux/mips/get_scno.c new file mode 100644 index 00000000..9364f817 --- /dev/null +++ b/linux/mips/get_scno.c @@ -0,0 +1,17 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = mips_REG_V0; + + if (!scno_in_range(tcp->scno)) { + if (mips_REG_A3 == 0 || mips_REG_A3 == (uint64_t) -1) { + if (debug_flag) + error_msg("stray syscall exit: v0 = %ld", + tcp->scno); + return 0; + } + } + + return 1; +} diff --git a/linux/mips/get_syscall_args.c b/linux/mips/get_syscall_args.c new file mode 100644 index 00000000..ca2819bf --- /dev/null +++ b/linux/mips/get_syscall_args.c @@ -0,0 +1,27 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ +#if defined LINUX_MIPSN64 || defined LINUX_MIPSN32 + tcp->u_arg[0] = mips_REG_A0; + tcp->u_arg[1] = mips_REG_A1; + tcp->u_arg[2] = mips_REG_A2; + tcp->u_arg[3] = mips_REG_A3; + tcp->u_arg[4] = mips_REG_A4; + tcp->u_arg[5] = mips_REG_A5; +#elif defined LINUX_MIPSO32 + tcp->u_arg[0] = mips_REG_A0; + tcp->u_arg[1] = mips_REG_A1; + tcp->u_arg[2] = mips_REG_A2; + tcp->u_arg[3] = mips_REG_A3; + if (tcp->s_ent->nargs > 4) { + if (umoven(tcp, mips_REG_SP + 4 * 4, + (tcp->s_ent->nargs - 4) * sizeof(tcp->u_arg[0]), + &tcp->u_arg[4]) < 0) + return -1; + } +#else +# error unsupported mips abi +#endif + return 1; +} diff --git a/linux/mips/ioctlent.h.in b/linux/mips/ioctlent.h.in deleted file mode 100644 index 15808a65..00000000 --- a/linux/mips/ioctlent.h.in +++ /dev/null @@ -1,59 +0,0 @@ - {"asm/ioctls.h", "TCGETS", 0x5401}, - {"asm/ioctls.h", "TCSETS", 0x5402}, - {"asm/ioctls.h", "TCSETSW", 0x5403}, - {"asm/ioctls.h", "TCSETSF", 0x5404}, - {"asm/ioctls.h", "TCGETA", 0x5405}, - {"asm/ioctls.h", "TCSETA", 0x5406}, - {"asm/ioctls.h", "TCSETAW", 0x5407}, - {"asm/ioctls.h", "TCSETAF", 0x5408}, - {"asm/ioctls.h", "TCSBRK", 0x5409}, - {"asm/ioctls.h", "TCXONC", 0x540a}, - {"asm/ioctls.h", "TCFLSH", 0x540b}, - {"asm/ioctls.h", "TIOCEXCL", 0x540c}, - {"asm/ioctls.h", "TIOCNXCL", 0x540d}, - {"asm/ioctls.h", "TIOCSCTTY", 0x540e}, - {"asm/ioctls.h", "TIOCGPGRP", 0x540f}, - {"asm/ioctls.h", "TIOCSPGRP", 0x5410}, - {"asm/ioctls.h", "TIOCOUTQ", 0x5411}, - {"asm/ioctls.h", "TIOCSTI", 0x5412}, - {"asm/ioctls.h", "TIOCGWINSZ", 0x5413}, - {"asm/ioctls.h", "TIOCSWINSZ", 0x5414}, - {"asm/ioctls.h", "TIOCMGET", 0x5415}, - {"asm/ioctls.h", "TIOCMBIS", 0x5416}, - {"asm/ioctls.h", "TIOCMBIC", 0x5417}, - {"asm/ioctls.h", "TIOCMSET", 0x5418}, - {"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, - {"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, - {"asm/ioctls.h", "FIONREAD", 0x541b}, - {"asm/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm/ioctls.h", "TIOCCONS", 0x541d}, - {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm/ioctls.h", "TIOCPKT", 0x5420}, - {"asm/ioctls.h", "FIONBIO", 0x5421}, - {"asm/ioctls.h", "TIOCNOTTY", 0x5422}, - {"asm/ioctls.h", "TIOCSETD", 0x5423}, - {"asm/ioctls.h", "TIOCGETD", 0x5424}, - {"asm/ioctls.h", "TCSBRKP", 0x5425}, - {"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426}, - {"asm/ioctls.h", "TIOCSBRK", 0x5427}, - {"asm/ioctls.h", "TIOCCBRK", 0x5428}, - {"asm/ioctls.h", "TIOCGSID", 0x5429}, - {"asm/ioctls.h", "TIOCGPTN", 0x5430}, - {"asm/ioctls.h", "TIOCSPTLCK", 0x5431}, - {"asm/ioctls.h", "FIONCLEX", 0x5450}, - {"asm/ioctls.h", "FIOCLEX", 0x5451}, - {"asm/ioctls.h", "FIOASYNC", 0x5452}, - {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm/ioctls.h", "TIOCGHAYESESP", 0x545e}, - {"asm/ioctls.h", "TIOCSHAYESESP", 0x545f}, diff --git a/linux/mips/ioctlent.sh b/linux/mips/ioctlent.sh deleted file mode 100755 index 52d8df5b..00000000 --- a/linux/mips/ioctlent.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh -# Copyright (c) 1993, 1994, 1995 Rick Sladkey -# All rights reserved. -# -# Copyright (c) 1995, 1996 Michael Elizabeth Chastain -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Files to find. -file_find='asm/*.h linux/*.h scsi/*.h' - -# Files to stop. -file_stop='asm/byteorder.h linux/config.h linux/pci.h linux/xd.h' - -# Defs to find. -# Work on the kernel source to convert all to df_iowr. -# Don't know how to find low-numbered ioctls in linux/mc146818rtc.h. -df_name='^[ ]*#[ ]*define[ ]+[A-Z_][A-Z0-9_]*[ ]+' -df_iowr='_IO|_IOR|_IOW|_IOWR' -df_NNNN='0[Xx](03|06|22|46|4B|4C|53|54|56|89|90)[0-9A-Fa-f][0-9A-Fa-f]' -df_4359='0[Xx]4359[0-9A-Fa-f][0-9A-Fa-f]' # linux/cyclades.h -df_470N='470[0-9]' # linux/fs.h (only in 1.2.13) -df_smix='MIXER_READ|MIXER_WRITE' # linux/soundcard.h -df_12NN='12[3-4][0-9]' # linux/umsdos_fs.h (only in 1.2.13) -df_tail='([() ]|$)' -def_find="$df_name($df_iowr|$df_NNNN|$df_4359|$df_470N|$df_smix|$df_12NN)$df_tail" - -# Defs to stop. -ds_tail='_MAGIC|_PATCH' -ds_fdmp='FD(DEF|GET|SET)MEDIAPRM' # linux/fd.h aliases (only in 1.2.13) -ds_mtio='MTIOC(GET|SET)CONFIG' # linux/mtio.h needs config (only in 1.2.13) -def_stop="$ds_tail|$ds_fdmp|$ds_mtio" - -# Validate arg count. -if [ $# -ne 1 ] -then - echo "usage: $0 include-directory" >&2 - exit 1 -fi - -# Grep through the files. -( - # Construct list: find files minus stop files. - cd $1 || exit - file_list=`(ls $file_find $file_stop $file_stop 2>/dev/null) | sort | uniq -u` - - # Grep matching #define lines. - # Transform to C structure form. - # Filter out stop list. - egrep "$def_find" $file_list | - sed -n -e 's/^\(.*\):#[ ]*define[ ]*\([A-Z_][A-Z0-9_]*\).*$/ { "\1", "\2", \2 },/p' | - egrep -v "$def_stop" -) > ioctlent.tmp - -# Generate the output file. -echo '/* This file is automatically generated by ioctlent.sh */' -echo -echo '#include ' -echo -echo '/* Needed for */' -echo '#define BAYCOM_DEBUG' -echo -echo '/* Needed for */' -echo '#include ' -echo '#include ' -echo -awk '{ print "#include <" substr($2, 2, length($2) - 3) ">" }' ioctlent.tmp | sort -u -echo -echo 'struct ioctlent ioctlent [] =' -echo '{' -cat ioctlent.tmp -echo '};' - -# Clean up. -rm -f ioctlent.tmp diff --git a/linux/mips/ioctls_arch0.h b/linux/mips/ioctls_arch0.h new file mode 100644 index 00000000..966e9ae5 --- /dev/null +++ b/linux/mips/ioctls_arch0.h @@ -0,0 +1,82 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/mips/include/ tree. */ +{ "asm/ioctls.h", "FIOASYNC", 0, 0x667d, 0 }, +{ "asm/ioctls.h", "FIOCLEX", 0, 0x6601, 0 }, +{ "asm/ioctls.h", "FIONBIO", 0, 0x667e, 0 }, +{ "asm/ioctls.h", "FIONCLEX", 0, 0x6602, 0 }, +{ "asm/ioctls.h", "FIONREAD", 0, 0x467f, 0 }, +{ "asm/ioctls.h", "FIOQSIZE", 0, 0x667f, 0 }, +{ "asm/ioctls.h", "TCFLSH", 0, 0x5407, 0 }, +{ "asm/ioctls.h", "TCGETA", 0, 0x5401, 0 }, +{ "asm/ioctls.h", "TCGETS", 0, 0x540d, 0 }, +{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x30 }, +{ "asm/ioctls.h", "TCSBRK", 0, 0x5405, 0 }, +{ "asm/ioctls.h", "TCSBRKP", 0, 0x5486, 0 }, +{ "asm/ioctls.h", "TCSETA", 0, 0x5402, 0 }, +{ "asm/ioctls.h", "TCSETAF", 0, 0x5404, 0 }, +{ "asm/ioctls.h", "TCSETAW", 0, 0x5403, 0 }, +{ "asm/ioctls.h", "TCSETS", 0, 0x540e, 0 }, +{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x30 }, +{ "asm/ioctls.h", "TCSETSF", 0, 0x5410, 0 }, +{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x30 }, +{ "asm/ioctls.h", "TCSETSW", 0, 0x540f, 0 }, +{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x30 }, +{ "asm/ioctls.h", "TCXONC", 0, 0x5406, 0 }, +{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm/ioctls.h", "TIOCCONS", _IOC_WRITE, 0x7478, 0x04 }, +{ "asm/ioctls.h", "TIOCEXCL", 0, 0x740d, 0 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETD", 0, 0x7400, 0 }, +{ "asm/ioctls.h", "TIOCGETP", 0, 0x7408, 0 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x5492, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x548b, 0 }, +{ "asm/ioctls.h", "TIOCGLTC", 0, 0x7474, 0 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, +{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x5484, 0 }, +{ "asm/ioctls.h", "TIOCGSID", 0, 0x7416, 0 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5481, 0 }, +{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 }, +{ "asm/ioctls.h", "TIOCLINUX", 0, 0x5483, 0 }, +{ "asm/ioctls.h", "TIOCMBIC", 0, 0x741c, 0 }, +{ "asm/ioctls.h", "TIOCMBIS", 0, 0x741b, 0 }, +{ "asm/ioctls.h", "TIOCMGET", 0, 0x741d, 0 }, +{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x5491, 0 }, +{ "asm/ioctls.h", "TIOCMSET", 0, 0x741a, 0 }, +{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5471, 0 }, +{ "asm/ioctls.h", "TIOCNXCL", 0, 0x740e, 0 }, +{ "asm/ioctls.h", "TIOCOUTQ", 0, 0x7472, 0 }, +{ "asm/ioctls.h", "TIOCPKT", 0, 0x5470, 0 }, +{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x5480, 0 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5488, 0 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x548e, 0 }, +{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x548f, 0 }, +{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x548d, 0 }, +{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5489, 0 }, +{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x5490, 0 }, +{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x548a, 0 }, +{ "asm/ioctls.h", "TIOCSETD", 0, 0x7401, 0 }, +{ "asm/ioctls.h", "TIOCSETN", 0, 0x740a, 0 }, +{ "asm/ioctls.h", "TIOCSETP", 0, 0x7409, 0 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x548c, 0 }, +{ "asm/ioctls.h", "TIOCSLTC", 0, 0x7475, 0 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 }, +{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x5485, 0 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x5482, 0 }, +{ "asm/ioctls.h", "TIOCSTI", 0, 0x5472, 0 }, +{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 }, +{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 }, +{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 }, +{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 }, +{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 }, diff --git a/linux/mips/ioctls_inc0.h b/linux/mips/ioctls_inc0.h new file mode 100644 index 00000000..c00687f6 --- /dev/null +++ b/linux/mips/ioctls_inc0.h @@ -0,0 +1,5 @@ +#ifdef LINUX_MIPSN64 +# include "64/ioctls_inc.h" +#else +# include "32/ioctls_inc.h" +#endif diff --git a/linux/mips/set_error.c b/linux/mips/set_error.c new file mode 100644 index 00000000..89cf38ce --- /dev/null +++ b/linux/mips/set_error.c @@ -0,0 +1,15 @@ +static int +arch_set_error(struct tcb *tcp) +{ + mips_REG_V0 = tcp->u_error; + mips_REG_A3 = -1; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + mips_REG_V0 = tcp->u_rval; + mips_REG_A3 = 0; + return set_regs(tcp->pid); +} diff --git a/linux/mips/set_scno.c b/linux/mips/set_scno.c new file mode 100644 index 00000000..1eb456cc --- /dev/null +++ b/linux/mips/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + mips_REG_V0 = scno; + return set_regs(tcp->pid); +} diff --git a/linux/mips/signalent.h b/linux/mips/signalent.h index 2cf746af..d18e5105 100644 --- a/linux/mips/signalent.h +++ b/linux/mips/signalent.h @@ -30,3 +30,4 @@ "SIGPROF", /* 29 */ "SIGXCPU", /* 30 */ "SIGXFSZ", /* 31 */ + "SIGRTMIN", /* 32 */ diff --git a/linux/mips/syscallent-compat.h b/linux/mips/syscallent-compat.h index 0902e408..82a373b6 100644 --- a/linux/mips/syscallent-compat.h +++ b/linux/mips/syscallent-compat.h @@ -1,870 +1,700 @@ - { 0, 0, printargs, "svr4_syscall" }, /* 000 */ - { 0, 0, printargs, "svr4_exit" }, /* 001 */ - { 0, 0, printargs, "svr4_fork" }, /* 002 */ - { 0, 0, printargs, "svr4_read" }, /* 003 */ - { 0, 0, printargs, "svr4_write" }, /* 004 */ - { 0, 0, printargs, "svr4_open" }, /* 005 */ - { 0, 0, printargs, "svr4_close" }, /* 006 */ - { 0, 0, printargs, "svr4_wait" }, /* 007 */ - { 0, 0, printargs, "svr4_creat" }, /* 008 */ - { 0, 0, printargs, "svr4_link" }, /* 009 */ - { 0, 0, printargs, "svr4_unlink" }, /* 010 */ - { 0, 0, printargs, "svr4_exec" }, /* 011 */ - { 0, 0, printargs, "svr4_chdir" }, /* 012 */ - { 0, 0, printargs, "svr4_gtime" }, /* 013 */ - { 0, 0, printargs, "svr4_mknod" }, /* 014 */ - { 0, 0, printargs, "svr4_chmod" }, /* 015 */ - { 0, 0, printargs, "svr4_chown" }, /* 016 */ - { 0, TM, printargs, "svr4_sbreak" }, /* 017 */ - { 0, 0, printargs, "svr4_stat" }, /* 018 */ - { 0, 0, printargs, "svr4_lseek" }, /* 019 */ - { 0, 0, printargs, "svr4_getpid" }, /* 020 */ - { 0, 0, printargs, "svr4_mount" }, /* 021 */ - { 0, 0, printargs, "svr4_umount" }, /* 022 */ - { 0, 0, printargs, "svr4_setuid" }, /* 023 */ - { 0, 0, printargs, "svr4_getuid" }, /* 024 */ - { 0, 0, printargs, "svr4_stime" }, /* 025 */ - { 0, 0, printargs, "svr4_ptrace" }, /* 026 */ - { 0, 0, printargs, "svr4_alarm" }, /* 027 */ - { 0, 0, printargs, "svr4_fstat" }, /* 028 */ - { 0, 0, printargs, "svr4_pause" }, /* 029 */ - { 0, 0, printargs, "svr4_utime" }, /* 030 */ - { 0, 0, printargs, "svr4_stty" }, /* 031 */ - { 0, 0, printargs, "svr4_gtty" }, /* 032 */ - { 0, 0, printargs, "svr4_access" }, /* 033 */ - { 0, 0, printargs, "svr4_nice" }, /* 034 */ - { 0, 0, printargs, "svr4_statfs" }, /* 035 */ - { 0, 0, printargs, "svr4_sync" }, /* 036 */ - { 0, 0, printargs, "svr4_kill" }, /* 037 */ - { 0, 0, printargs, "svr4_fstatfs" }, /* 038 */ - { 0, 0, printargs, "svr4_setpgrp" }, /* 039 */ - { 0, 0, printargs, "svr4_cxenix" }, /* 040 */ - { 0, 0, printargs, "svr4_dup" }, /* 041 */ - { 0, 0, printargs, "svr4_pipe" }, /* 042 */ - { 0, 0, printargs, "svr4_times" }, /* 043 */ - { 0, 0, printargs, "svr4_profil" }, /* 044 */ - { 0, 0, printargs, "svr4_plock" }, /* 045 */ - { 0, 0, printargs, "svr4_setgid" }, /* 046 */ - { 0, 0, printargs, "svr4_getgid" }, /* 047 */ - { 0, 0, printargs, "svr4_sig" }, /* 048 */ - { 0, 0, printargs, "svr4_msgsys" }, /* 049 */ - { 0, 0, printargs, "svr4_sysmips" }, /* 050 */ - { 0, 0, printargs, "svr4_sysacct" }, /* 051 */ - { 0, 0, printargs, "svr4_shmsys" }, /* 052 */ - { 0, 0, printargs, "svr4_semsys" }, /* 053 */ - { 0, 0, printargs, "svr4_ioctl" }, /* 054 */ - { 0, 0, printargs, "svr4_uadmin" }, /* 055 */ - { 0, 0, printargs, "svr4_exch" }, /* 056 */ - { 0, 0, printargs, "svr4_utssys" }, /* 057 */ - { 0, 0, printargs, "svr4_fsync" }, /* 058 */ - { 0, 0, printargs, "svr4_exece" }, /* 059 */ - { 0, 0, printargs, "svr4_umask" }, /* 060 */ - { 0, 0, printargs, "svr4_chroot" }, /* 061 */ - { 0, 0, printargs, "svr4_fcntl" }, /* 062 */ - { 0, 0, printargs, "svr4_ulimit" }, /* 063 */ - { 0, 0, NULL, NULL }, /* 064 */ - { 0, 0, NULL, NULL }, /* 065 */ - { 0, 0, NULL, NULL }, /* 066 */ - { 0, 0, NULL, NULL }, /* 067 */ - { 0, 0, NULL, NULL }, /* 068 */ - { 0, 0, NULL, NULL }, /* 069 */ - { 0, 0, printargs, "svr4_advfs" }, /* 070 */ - { 0, 0, printargs, "svr4_unadvfs" }, /* 071 */ - { 0, 0, NULL, NULL }, /* 072 */ - { 0, 0, NULL, NULL }, /* 073 */ - { 0, 0, printargs, "svr4_rfstart" }, /* 074 */ - { 0, 0, NULL, NULL }, /* 075 */ - { 0, 0, printargs, "svr4_rdebug" }, /* 076 */ - { 0, 0, printargs, "svr4_rfstop" }, /* 077 */ - { 0, 0, printargs, "svr4_rfsys" }, /* 078 */ - { 0, 0, printargs, "svr4_rmdir" }, /* 079 */ - { 0, 0, printargs, "svr4_mkdir" }, /* 080 */ - { 0, 0, printargs, "svr4_getdents" }, /* 081 */ - { 0, 0, printargs, "svr4_libattach" }, /* 082 */ - { 0, 0, printargs, "svr4_libdetach" }, /* 083 */ - { 0, 0, printargs, "svr4_sysfs" }, /* 084 */ - { 0, 0, printargs, "svr4_getmsg" }, /* 085 */ - { 0, 0, printargs, "svr4_putmsg" }, /* 086 */ - { 0, 0, printargs, "svr4_poll" }, /* 087 */ - { 0, 0, printargs, "svr4_lstat" }, /* 088 */ - { 0, 0, printargs, "svr4_symlink" }, /* 089 */ - { 0, 0, printargs, "svr4_readlink" }, /* 090 */ - { 0, 0, printargs, "svr4_setgroups" }, /* 091 */ - { 0, 0, printargs, "svr4_getgroups" }, /* 092 */ - { 0, 0, printargs, "svr4_fchmod" }, /* 093 */ - { 0, 0, printargs, "svr4_fchown" }, /* 094 */ - { 0, 0, printargs, "svr4_sigprocmask" }, /* 095 */ - { 0, 0, printargs, "svr4_sigsuspend" }, /* 096 */ - { 0, 0, printargs, "svr4_sigaltstack" }, /* 097 */ - { 0, 0, printargs, "svr4_sigaction" }, /* 098 */ - { 0, 0, printargs, "svr4_sigpending" }, /* 099 */ - { 0, 0, printargs, "svr4_setcontext" }, /* 0100 */ - { 0, 0, printargs, "svr4_evsys" }, /* 0101 */ - { 0, 0, printargs, "svr4_evtrapret" }, /* 0102 */ - { 0, 0, printargs, "svr4_statvfs" }, /* 0103 */ - { 0, 0, printargs, "svr4_fstatvfs" }, /* 0104 */ - { 0, 0, NULL, NULL }, /* 105 */ - { 0, 0, printargs, "svr4_nfssys" }, /* 0106 */ - { 0, 0, printargs, "svr4_waitid" }, /* 0107 */ - { 0, 0, printargs, "svr4_sigsendset" }, /* 0108 */ - { 0, 0, printargs, "svr4_hrtsys" }, /* 0109 */ - { 0, 0, printargs, "svr4_acancel" }, /* 0110 */ - { 0, 0, printargs, "svr4_async" }, /* 0111 */ - { 0, 0, printargs, "svr4_priocntlset" }, /* 0112 */ - { 0, 0, printargs, "svr4_pathconf" }, /* 0113 */ - { 0, TM, printargs, "svr4_mincore" }, /* 0114 */ - { 0, TD|TM|SI, printargs, "svr4_mmap" }, /* 0115 */ - { 0, TM|SI, printargs, "svr4_mprotect" }, /* 0116 */ - { 0, TM|SI, printargs, "svr4_munmap" }, /* 0117 */ - { 0, 0, printargs, "svr4_fpathconf" }, /* 0118 */ - { 0, 0, printargs, "svr4_vfork" }, /* 0119 */ - { 0, 0, printargs, "svr4_fchdir" }, /* 0120 */ - { 0, 0, printargs, "svr4_readv" }, /* 0121 */ - { 0, 0, printargs, "svr4_writev" }, /* 0122 */ - { 0, 0, printargs, "svr4_xstat" }, /* 0123 */ - { 0, 0, printargs, "svr4_lxstat" }, /* 0124 */ - { 0, 0, printargs, "svr4_fxstat" }, /* 0125 */ - { 0, 0, printargs, "svr4_xmknod" }, /* 0126 */ - { 0, 0, printargs, "svr4_clocal" }, /* 0127 */ - { 0, 0, printargs, "svr4_setrlimit" }, /* 0128 */ - { 0, 0, printargs, "svr4_getrlimit" }, /* 0129 */ - { 0, 0, printargs, "svr4_lchown" }, /* 0130 */ - { 0, 0, printargs, "svr4_memcntl" }, /* 0131 */ - { 0, 0, printargs, "svr4_getpmsg" }, /* 0132 */ - { 0, 0, printargs, "svr4_putpmsg" }, /* 0133 */ - { 0, 0, printargs, "svr4_rename" }, /* 0134 */ - { 0, 0, printargs, "svr4_nuname" }, /* 0135 */ - { 0, 0, printargs, "svr4_setegid" }, /* 0136 */ - { 0, 0, printargs, "svr4_sysconf" }, /* 0137 */ - { 0, 0, printargs, "svr4_adjtime" }, /* 0138 */ - { 0, 0, printargs, "svr4_sysinfo" }, /* 0139 */ - { 0, 0, NULL, NULL }, /* 140 */ - { 0, 0, printargs, "svr4_seteuid" }, /* 0141 */ - { 0, 0, printargs, "svr4_PYRAMID_statis" }, /* 0142 */ - { 0, 0, printargs, "svr4_PYRAMID_tuning" }, /* 0143 */ - { 0, 0, printargs, "svr4_PYRAMID_forcerr" }, /* 0144 */ - { 0, 0, printargs, "svr4_PYRAMID_mpcntl" }, /* 0145 */ - { 0, 0, NULL, NULL }, /* 146 */ - { 0, 0, NULL, NULL }, /* 147 */ - { 0, 0, NULL, NULL }, /* 148 */ - { 0, 0, NULL, NULL }, /* 149 */ - { 0, 0, NULL, NULL }, /* 150 */ - { 0, 0, NULL, NULL }, /* 151 */ - { 0, 0, NULL, NULL }, /* 152 */ - { 0, 0, NULL, NULL }, /* 153 */ - { 0, 0, NULL, NULL }, /* 154 */ - { 0, 0, NULL, NULL }, /* 155 */ - { 0, 0, NULL, NULL }, /* 156 */ - { 0, 0, NULL, NULL }, /* 157 */ - { 0, 0, NULL, NULL }, /* 158 */ - { 0, 0, NULL, NULL }, /* 159 */ - { 0, 0, NULL, NULL }, /* 160 */ - { 0, 0, NULL, NULL }, /* 161 */ - { 0, 0, NULL, NULL }, /* 162 */ - { 0, 0, NULL, NULL }, /* 163 */ - { 0, 0, NULL, NULL }, /* 164 */ - { 0, 0, NULL, NULL }, /* 165 */ - { 0, 0, NULL, NULL }, /* 166 */ - { 0, 0, NULL, NULL }, /* 167 */ - { 0, 0, NULL, NULL }, /* 168 */ - { 0, 0, NULL, NULL }, /* 169 */ - { 0, 0, NULL, NULL }, /* 170 */ - { 0, 0, NULL, NULL }, /* 171 */ - { 0, 0, NULL, NULL }, /* 172 */ - { 0, 0, NULL, NULL }, /* 173 */ - { 0, 0, NULL, NULL }, /* 174 */ - { 0, 0, NULL, NULL }, /* 175 */ - { 0, 0, NULL, NULL }, /* 176 */ - { 0, 0, NULL, NULL }, /* 177 */ - { 0, 0, NULL, NULL }, /* 178 */ - { 0, 0, NULL, NULL }, /* 179 */ - { 0, 0, NULL, NULL }, /* 180 */ - { 0, 0, NULL, NULL }, /* 181 */ - { 0, 0, NULL, NULL }, /* 182 */ - { 0, 0, NULL, NULL }, /* 183 */ - { 0, 0, NULL, NULL }, /* 184 */ - { 0, 0, NULL, NULL }, /* 185 */ - { 0, 0, NULL, NULL }, /* 186 */ - { 0, 0, NULL, NULL }, /* 187 */ - { 0, 0, NULL, NULL }, /* 188 */ - { 0, 0, NULL, NULL }, /* 189 */ - { 0, 0, NULL, NULL }, /* 190 */ - { 0, 0, NULL, NULL }, /* 191 */ - { 0, 0, NULL, NULL }, /* 192 */ - { 0, 0, NULL, NULL }, /* 193 */ - { 0, 0, NULL, NULL }, /* 194 */ - { 0, 0, NULL, NULL }, /* 195 */ - { 0, 0, NULL, NULL }, /* 196 */ - { 0, 0, NULL, NULL }, /* 197 */ - { 0, 0, NULL, NULL }, /* 198 */ - { 0, 0, NULL, NULL }, /* 199 */ - { 0, 0, NULL, NULL }, /* 200 */ - { 0, 0, printargs, "svr4_aread" }, /* 0201 */ - { 0, 0, printargs, "svr4_awrite" }, /* 0202 */ - { 0, 0, printargs, "svr4_listio" }, /* 0203 */ - { 0, 0, printargs, "svr4_mips_acancel" }, /* 0204 */ - { 0, 0, printargs, "svr4_astatus" }, /* 0205 */ - { 0, 0, printargs, "svr4_await" }, /* 0206 */ - { 0, 0, printargs, "svr4_areadv" }, /* 0207 */ - { 0, 0, printargs, "svr4_awritev" }, /* 0208 */ +[ 0] = { 0, 0, SEN(printargs), "svr4_syscall" }, +[ 1] = { 0, 0, SEN(printargs), "svr4_exit" }, +[ 2] = { 0, 0, SEN(printargs), "svr4_fork" }, +[ 3] = { 0, 0, SEN(printargs), "svr4_read" }, +[ 4] = { 0, 0, SEN(printargs), "svr4_write" }, +[ 5] = { 0, 0, SEN(printargs), "svr4_open" }, +[ 6] = { 0, 0, SEN(printargs), "svr4_close" }, +[ 7] = { 0, 0, SEN(printargs), "svr4_wait" }, +[ 8] = { 0, 0, SEN(printargs), "svr4_creat" }, +[ 9] = { 0, 0, SEN(printargs), "svr4_link" }, +[ 10] = { 0, 0, SEN(printargs), "svr4_unlink" }, +[ 11] = { 0, 0, SEN(printargs), "svr4_exec" }, +[ 12] = { 0, 0, SEN(printargs), "svr4_chdir" }, +[ 13] = { 0, 0, SEN(printargs), "svr4_gtime" }, +[ 14] = { 0, 0, SEN(printargs), "svr4_mknod" }, +[ 15] = { 0, 0, SEN(printargs), "svr4_chmod" }, +[ 16] = { 0, 0, SEN(printargs), "svr4_chown" }, +[ 17] = { 0, TM, SEN(printargs), "svr4_sbreak" }, +[ 18] = { 0, 0, SEN(printargs), "svr4_stat" }, +[ 19] = { 0, 0, SEN(printargs), "svr4_lseek" }, +[ 20] = { 0, 0, SEN(printargs), "svr4_getpid" }, +[ 21] = { 0, 0, SEN(printargs), "svr4_mount" }, +[ 22] = { 0, 0, SEN(printargs), "svr4_umount" }, +[ 23] = { 0, 0, SEN(printargs), "svr4_setuid" }, +[ 24] = { 0, 0, SEN(printargs), "svr4_getuid" }, +[ 25] = { 0, 0, SEN(printargs), "svr4_stime" }, +[ 26] = { 0, 0, SEN(printargs), "svr4_ptrace" }, +[ 27] = { 0, 0, SEN(printargs), "svr4_alarm" }, +[ 28] = { 0, 0, SEN(printargs), "svr4_fstat" }, +[ 29] = { 0, 0, SEN(printargs), "svr4_pause" }, +[ 30] = { 0, 0, SEN(printargs), "svr4_utime" }, +[ 31] = { 0, 0, SEN(printargs), "svr4_stty" }, +[ 32] = { 0, 0, SEN(printargs), "svr4_gtty" }, +[ 33] = { 0, 0, SEN(printargs), "svr4_access" }, +[ 34] = { 0, 0, SEN(printargs), "svr4_nice" }, +[ 35] = { 0, 0, SEN(printargs), "svr4_statfs" }, +[ 36] = { 0, 0, SEN(printargs), "svr4_sync" }, +[ 37] = { 0, 0, SEN(printargs), "svr4_kill" }, +[ 38] = { 0, 0, SEN(printargs), "svr4_fstatfs" }, +[ 39] = { 0, 0, SEN(printargs), "svr4_setpgrp" }, +[ 40] = { 0, 0, SEN(printargs), "svr4_cxenix" }, +[ 41] = { 0, 0, SEN(printargs), "svr4_dup" }, +[ 42] = { 0, 0, SEN(printargs), "svr4_pipe" }, +[ 43] = { 0, 0, SEN(printargs), "svr4_times" }, +[ 44] = { 0, 0, SEN(printargs), "svr4_profil" }, +[ 45] = { 0, 0, SEN(printargs), "svr4_plock" }, +[ 46] = { 0, 0, SEN(printargs), "svr4_setgid" }, +[ 47] = { 0, 0, SEN(printargs), "svr4_getgid" }, +[ 48] = { 0, 0, SEN(printargs), "svr4_sig" }, +[ 49] = { 0, 0, SEN(printargs), "svr4_msgsys" }, +[ 50] = { 0, 0, SEN(printargs), "svr4_sysmips" }, +[ 51] = { 0, 0, SEN(printargs), "svr4_sysacct" }, +[ 52] = { 0, 0, SEN(printargs), "svr4_shmsys" }, +[ 53] = { 0, 0, SEN(printargs), "svr4_semsys" }, +[ 54] = { 0, 0, SEN(printargs), "svr4_ioctl" }, +[ 55] = { 0, 0, SEN(printargs), "svr4_uadmin" }, +[ 56] = { 0, 0, SEN(printargs), "svr4_exch" }, +[ 57] = { 0, 0, SEN(printargs), "svr4_utssys" }, +[ 58] = { 0, 0, SEN(printargs), "svr4_fsync" }, +[ 59] = { 0, 0, SEN(printargs), "svr4_exece" }, +[ 60] = { 0, 0, SEN(printargs), "svr4_umask" }, +[ 61] = { 0, 0, SEN(printargs), "svr4_chroot" }, +[ 62] = { 0, 0, SEN(printargs), "svr4_fcntl" }, +[ 63] = { 0, 0, SEN(printargs), "svr4_ulimit" }, +[64 ... 69] = { }, +[ 70] = { 0, 0, SEN(printargs), "svr4_advfs" }, +[ 71] = { 0, 0, SEN(printargs), "svr4_unadvfs" }, +[ 72] = { }, +[ 73] = { }, +[ 74] = { 0, 0, SEN(printargs), "svr4_rfstart" }, +[ 75] = { }, +[ 76] = { 0, 0, SEN(printargs), "svr4_rdebug" }, +[ 77] = { 0, 0, SEN(printargs), "svr4_rfstop" }, +[ 78] = { 0, 0, SEN(printargs), "svr4_rfsys" }, +[ 79] = { 0, 0, SEN(printargs), "svr4_rmdir" }, +[ 80] = { 0, 0, SEN(printargs), "svr4_mkdir" }, +[ 81] = { 0, 0, SEN(printargs), "svr4_getdents" }, +[ 82] = { 0, 0, SEN(printargs), "svr4_libattach" }, +[ 83] = { 0, 0, SEN(printargs), "svr4_libdetach" }, +[ 84] = { 0, 0, SEN(printargs), "svr4_sysfs" }, +[ 85] = { 0, 0, SEN(printargs), "svr4_getmsg" }, +[ 86] = { 0, 0, SEN(printargs), "svr4_putmsg" }, +[ 87] = { 0, 0, SEN(printargs), "svr4_poll" }, +[ 88] = { 0, 0, SEN(printargs), "svr4_lstat" }, +[ 89] = { 0, 0, SEN(printargs), "svr4_symlink" }, +[ 90] = { 0, 0, SEN(printargs), "svr4_readlink" }, +[ 91] = { 0, 0, SEN(printargs), "svr4_setgroups" }, +[ 92] = { 0, 0, SEN(printargs), "svr4_getgroups" }, +[ 93] = { 0, 0, SEN(printargs), "svr4_fchmod" }, +[ 94] = { 0, 0, SEN(printargs), "svr4_fchown" }, +[ 95] = { 0, 0, SEN(printargs), "svr4_sigprocmask" }, +[ 96] = { 0, 0, SEN(printargs), "svr4_sigsuspend" }, +[ 97] = { 0, 0, SEN(printargs), "svr4_sigaltstack" }, +[ 98] = { 0, 0, SEN(printargs), "svr4_sigaction" }, +[ 99] = { 0, 0, SEN(printargs), "svr4_sigpending" }, +[ 100] = { 0, 0, SEN(printargs), "svr4_setcontext" }, +[ 101] = { 0, 0, SEN(printargs), "svr4_evsys" }, +[ 102] = { 0, 0, SEN(printargs), "svr4_evtrapret" }, +[ 103] = { 0, 0, SEN(printargs), "svr4_statvfs" }, +[ 104] = { 0, 0, SEN(printargs), "svr4_fstatvfs" }, +[ 105] = { }, +[ 106] = { 0, 0, SEN(printargs), "svr4_nfssys" }, +[ 107] = { 0, 0, SEN(printargs), "svr4_waitid" }, +[ 108] = { 0, 0, SEN(printargs), "svr4_sigsendset" }, +[ 109] = { 0, 0, SEN(printargs), "svr4_hrtsys" }, +[ 110] = { 0, 0, SEN(printargs), "svr4_acancel" }, +[ 111] = { 0, 0, SEN(printargs), "svr4_async" }, +[ 112] = { 0, 0, SEN(printargs), "svr4_priocntlset" }, +[ 113] = { 0, 0, SEN(printargs), "svr4_pathconf" }, +[ 114] = { 0, TM, SEN(printargs), "svr4_mincore" }, +[ 115] = { 0, TD|TM|SI, SEN(printargs), "svr4_mmap" }, +[ 116] = { 0, TM|SI, SEN(printargs), "svr4_mprotect" }, +[ 117] = { 0, TM|SI, SEN(printargs), "svr4_munmap" }, +[ 118] = { 0, 0, SEN(printargs), "svr4_fpathconf" }, +[ 119] = { 0, 0, SEN(printargs), "svr4_vfork" }, +[ 120] = { 0, 0, SEN(printargs), "svr4_fchdir" }, +[ 121] = { 0, 0, SEN(printargs), "svr4_readv" }, +[ 122] = { 0, 0, SEN(printargs), "svr4_writev" }, +[ 123] = { 0, 0, SEN(printargs), "svr4_xstat" }, +[ 124] = { 0, 0, SEN(printargs), "svr4_lxstat" }, +[ 125] = { 0, 0, SEN(printargs), "svr4_fxstat" }, +[ 126] = { 0, 0, SEN(printargs), "svr4_xmknod" }, +[ 127] = { 0, 0, SEN(printargs), "svr4_clocal" }, +[ 128] = { 0, 0, SEN(printargs), "svr4_setrlimit" }, +[ 129] = { 0, 0, SEN(printargs), "svr4_getrlimit" }, +[ 130] = { 0, 0, SEN(printargs), "svr4_lchown" }, +[ 131] = { 0, 0, SEN(printargs), "svr4_memcntl" }, +[ 132] = { 0, 0, SEN(printargs), "svr4_getpmsg" }, +[ 133] = { 0, 0, SEN(printargs), "svr4_putpmsg" }, +[ 134] = { 0, 0, SEN(printargs), "svr4_rename" }, +[ 135] = { 0, 0, SEN(printargs), "svr4_nuname" }, +[ 136] = { 0, 0, SEN(printargs), "svr4_setegid" }, +[ 137] = { 0, 0, SEN(printargs), "svr4_sysconf" }, +[ 138] = { 0, 0, SEN(printargs), "svr4_adjtime" }, +[ 139] = { 0, 0, SEN(printargs), "svr4_sysinfo" }, +[ 140] = { }, +[ 141] = { 0, 0, SEN(printargs), "svr4_seteuid" }, +[ 142] = { 0, 0, SEN(printargs), "svr4_PYRAMID_statis" }, +[ 143] = { 0, 0, SEN(printargs), "svr4_PYRAMID_tuning" }, +[ 144] = { 0, 0, SEN(printargs), "svr4_PYRAMID_forcerr" }, +[ 145] = { 0, 0, SEN(printargs), "svr4_PYRAMID_mpcntl" }, +[146 ... 200] = { }, +[ 201] = { 0, 0, SEN(printargs), "svr4_aread" }, +[ 202] = { 0, 0, SEN(printargs), "svr4_awrite" }, +[ 203] = { 0, 0, SEN(printargs), "svr4_listio" }, +[ 204] = { 0, 0, SEN(printargs), "svr4_mips_acancel" }, +[ 205] = { 0, 0, SEN(printargs), "svr4_astatus" }, +[ 206] = { 0, 0, SEN(printargs), "svr4_await" }, +[ 207] = { 0, 0, SEN(printargs), "svr4_areadv" }, +[ 208] = { 0, 0, SEN(printargs), "svr4_awritev" }, - [209 ... 999] = { }, /* 999 */ /* end of SVR4 */ +[1000] = { 0, 0, SEN(printargs), "sysv_syscall" }, /* start of SYSV */ +[1001] = { 0, 0, SEN(printargs), "sysv_exit" }, +[1002] = { 0, 0, SEN(printargs), "sysv_fork" }, +[1003] = { 0, 0, SEN(printargs), "sysv_read" }, +[1004] = { 0, 0, SEN(printargs), "sysv_write" }, +[1005] = { 0, 0, SEN(printargs), "sysv_open" }, +[1006] = { 0, 0, SEN(printargs), "sysv_close" }, +[1007] = { 0, 0, SEN(printargs), "sysv_wait" }, +[1008] = { 0, 0, SEN(printargs), "sysv_creat" }, +[1009] = { 0, 0, SEN(printargs), "sysv_link" }, +[1010] = { 0, 0, SEN(printargs), "sysv_unlink" }, +[1011] = { 0, 0, SEN(printargs), "sysv_execv" }, +[1012] = { 0, 0, SEN(printargs), "sysv_chdir" }, +[1013] = { 0, 0, SEN(printargs), "sysv_time" }, +[1014] = { 0, 0, SEN(printargs), "sysv_mknod" }, +[1015] = { 0, 0, SEN(printargs), "sysv_chmod" }, +[1016] = { 0, 0, SEN(printargs), "sysv_chown" }, +[1017] = { 0, TM|SI, SEN(printargs), "sysv_brk" }, +[1018] = { 0, 0, SEN(printargs), "sysv_stat" }, +[1019] = { 0, 0, SEN(printargs), "sysv_lseek" }, +[1020] = { 0, 0, SEN(printargs), "sysv_getpid" }, +[1021] = { 0, 0, SEN(printargs), "sysv_mount" }, +[1022] = { 0, 0, SEN(printargs), "sysv_umount" }, +[1023] = { 0, 0, SEN(printargs), "sysv_setuid" }, +[1024] = { 0, 0, SEN(printargs), "sysv_getuid" }, +[1025] = { 0, 0, SEN(printargs), "sysv_stime" }, +[1026] = { 0, 0, SEN(printargs), "sysv_ptrace" }, +[1027] = { 0, 0, SEN(printargs), "sysv_alarm" }, +[1028] = { 0, 0, SEN(printargs), "sysv_fstat" }, +[1029] = { 0, 0, SEN(printargs), "sysv_pause" }, +[1030] = { 0, 0, SEN(printargs), "sysv_utime" }, +[1031] = { 0, 0, SEN(printargs), "sysv_stty" }, +[1032] = { 0, 0, SEN(printargs), "sysv_gtty" }, +[1033] = { 0, 0, SEN(printargs), "sysv_access" }, +[1034] = { 0, 0, SEN(printargs), "sysv_nice" }, +[1035] = { 0, 0, SEN(printargs), "sysv_statfs" }, +[1036] = { 0, 0, SEN(printargs), "sysv_sync" }, +[1037] = { 0, 0, SEN(printargs), "sysv_kill" }, +[1038] = { 0, 0, SEN(printargs), "sysv_fstatfs" }, +[1039] = { 0, 0, SEN(printargs), "sysv_setpgrp" }, +[1040] = { 0, 0, SEN(printargs), "sysv_syssgi" }, +[1041] = { 0, 0, SEN(printargs), "sysv_dup" }, +[1042] = { 0, 0, SEN(printargs), "sysv_pipe" }, +[1043] = { 0, 0, SEN(printargs), "sysv_times" }, +[1044] = { 0, 0, SEN(printargs), "sysv_profil" }, +[1045] = { 0, 0, SEN(printargs), "sysv_plock" }, +[1046] = { 0, 0, SEN(printargs), "sysv_setgid" }, +[1047] = { 0, 0, SEN(printargs), "sysv_getgid" }, +[1048] = { 0, 0, SEN(printargs), "sysv_sig" }, +[1049] = { 0, 0, SEN(printargs), "sysv_msgsys" }, +[1050] = { 0, 0, SEN(printargs), "sysv_sysmips" }, +[1051] = { 0, 0, SEN(printargs), "sysv_acct" }, +[1052] = { 0, 0, SEN(printargs), "sysv_shmsys" }, +[1053] = { 0, 0, SEN(printargs), "sysv_semsys" }, +[1054] = { 0, 0, SEN(printargs), "sysv_ioctl" }, +[1055] = { 0, 0, SEN(printargs), "sysv_uadmin" }, +[1056] = { 0, 0, SEN(printargs), "sysv_sysmp" }, +[1057] = { 0, 0, SEN(printargs), "sysv_utssys" }, +[1058] = { }, +[1059] = { 0, 0, SEN(printargs), "sysv_execve" }, +[1060] = { 0, 0, SEN(printargs), "sysv_umask" }, +[1061] = { 0, 0, SEN(printargs), "sysv_chroot" }, +[1062] = { 0, 0, SEN(printargs), "sysv_fcntl" }, +[1063] = { 0, 0, SEN(printargs), "sysv_ulimit" }, +[1064 ... 1069] = { }, +[1070] = { 0, 0, SEN(printargs), "sysv_advfs" }, +[1071] = { 0, 0, SEN(printargs), "sysv_unadvfs" }, +[1072] = { 0, 0, SEN(printargs), "sysv_rmount" }, +[1073] = { 0, 0, SEN(printargs), "sysv_rumount" }, +[1074] = { 0, 0, SEN(printargs), "sysv_rfstart" }, +[1075] = { 0, 0, SEN(printargs), "sysv_getrlimit64" }, +[1076] = { 0, 0, SEN(printargs), "sysv_setrlimit64" }, +[1077] = { 0, 0, SEN(printargs), "sysv_nanosleep" }, +[1078] = { 0, 0, SEN(printargs), "sysv_lseek64" }, +[1079] = { 0, 0, SEN(printargs), "sysv_rmdir" }, +[1080] = { 0, 0, SEN(printargs), "sysv_mkdir" }, +[1081] = { 0, 0, SEN(printargs), "sysv_getdents" }, +[1082] = { 0, 0, SEN(printargs), "sysv_sginap" }, +[1083] = { 0, 0, SEN(printargs), "sysv_sgikopt" }, +[1084] = { 0, 0, SEN(printargs), "sysv_sysfs" }, +[1085] = { 0, 0, SEN(printargs), "sysv_getmsg" }, +[1086] = { 0, 0, SEN(printargs), "sysv_putmsg" }, +[1087] = { 0, 0, SEN(printargs), "sysv_poll" }, +[1088] = { 0, 0, SEN(printargs), "sysv_sigreturn" }, +[1089] = { 0, 0, SEN(printargs), "sysv_accept" }, +[1090] = { 0, 0, SEN(printargs), "sysv_bind" }, +[1091] = { 0, 0, SEN(printargs), "sysv_connect" }, +[1092] = { 0, 0, SEN(printargs), "sysv_gethostid" }, +[1093] = { 0, 0, SEN(printargs), "sysv_getpeername" }, +[1094] = { 0, 0, SEN(printargs), "sysv_getsockname" }, +[1095] = { 0, 0, SEN(printargs), "sysv_getsockopt" }, +[1096] = { 0, 0, SEN(printargs), "sysv_listen" }, +[1097] = { 0, 0, SEN(printargs), "sysv_recv" }, +[1098] = { 0, 0, SEN(printargs), "sysv_recvfrom" }, +[1099] = { 0, 0, SEN(printargs), "sysv_recvmsg" }, +[1100] = { 0, 0, SEN(printargs), "sysv_select" }, +[1101] = { 0, 0, SEN(printargs), "sysv_send" }, +[1102] = { 0, 0, SEN(printargs), "sysv_sendmsg" }, +[1103] = { 0, 0, SEN(printargs), "sysv_sendto" }, +[1104] = { 0, 0, SEN(printargs), "sysv_sethostid" }, +[1105] = { 0, 0, SEN(printargs), "sysv_setsockopt" }, +[1106] = { 0, 0, SEN(printargs), "sysv_shutdown" }, +[1107] = { 0, 0, SEN(printargs), "sysv_socket" }, +[1108] = { 0, 0, SEN(printargs), "sysv_gethostname" }, +[1109] = { 0, 0, SEN(printargs), "sysv_sethostname" }, +[1110] = { 0, 0, SEN(printargs), "sysv_getdomainname" }, +[1111] = { 0, 0, SEN(printargs), "sysv_setdomainname" }, +[1112] = { 0, 0, SEN(printargs), "sysv_truncate" }, +[1113] = { 0, 0, SEN(printargs), "sysv_ftruncate" }, +[1114] = { 0, 0, SEN(printargs), "sysv_rename" }, +[1115] = { 0, 0, SEN(printargs), "sysv_symlink" }, +[1116] = { 0, 0, SEN(printargs), "sysv_readlink" }, +[1117] = { 0, 0, SEN(printargs), "sysv_lstat" }, +[1118] = { 0, 0, SEN(printargs), "sysv_nfsmount" }, +[1119] = { 0, 0, SEN(printargs), "sysv_nfssvc" }, +[1120] = { 0, 0, SEN(printargs), "sysv_getfh" }, +[1121] = { 0, 0, SEN(printargs), "sysv_async_daemon" }, +[1122] = { 0, 0, SEN(printargs), "sysv_exportfs" }, +[1123] = { 0, 0, SEN(printargs), "sysv_setregid" }, +[1124] = { 0, 0, SEN(printargs), "sysv_setreuid" }, +[1125] = { 0, 0, SEN(printargs), "sysv_getitimer" }, +[1126] = { 0, 0, SEN(printargs), "sysv_setitimer" }, +[1127] = { 0, 0, SEN(printargs), "sysv_adjtime" }, +[1128] = { 0, 0, SEN(printargs), "sysv_BSD_getime" }, +[1129] = { 0, 0, SEN(printargs), "sysv_sproc" }, +[1130] = { 0, 0, SEN(printargs), "sysv_prctl" }, +[1131] = { 0, 0, SEN(printargs), "sysv_procblk" }, +[1132] = { 0, 0, SEN(printargs), "sysv_sprocsp" }, +[1133] = { 0, 0, SEN(printargs), "sysv_sgigsc" }, +[1134] = { 0, TD|TM|SI, SEN(printargs), "sysv_mmap" }, +[1135] = { 0, TM|SI, SEN(printargs), "sysv_munmap" }, +[1136] = { 0, TM|SI, SEN(printargs), "sysv_mprotect" }, +[1137] = { 0, TM, SEN(printargs), "sysv_msync" }, +[1138] = { 0, TM, SEN(printargs), "sysv_madvise" }, +[1139] = { 0, 0, SEN(printargs), "sysv_pagelock" }, +[1140] = { 0, 0, SEN(printargs), "sysv_getpagesize" }, +[1141] = { 0, TF, SEN(printargs), "sysv_quotactl" }, +[1142] = { 0, 0, SEN(printargs), "sysv_libdetach" }, +[1143] = { 0, 0, SEN(printargs), "sysv_BSDgetpgrp" }, +[1144] = { 0, 0, SEN(printargs), "sysv_BSDsetpgrp" }, +[1145] = { 0, 0, SEN(printargs), "sysv_vhangup" }, +[1146] = { 0, 0, SEN(printargs), "sysv_fsync" }, +[1147] = { 0, 0, SEN(printargs), "sysv_fchdir" }, +[1148] = { 0, 0, SEN(printargs), "sysv_getrlimit" }, +[1149] = { 0, 0, SEN(printargs), "sysv_setrlimit" }, +[1150] = { 0, 0, SEN(printargs), "sysv_cacheflush" }, +[1151] = { 0, 0, SEN(printargs), "sysv_cachectl" }, +[1152] = { 0, 0, SEN(printargs), "sysv_fchown" }, +[1153] = { 0, 0, SEN(printargs), "sysv_fchmod" }, +[1154] = { 0, 0, SEN(printargs), "sysv_wait3" }, +[1155] = { 0, 0, SEN(printargs), "sysv_socketpair" }, +[1156] = { 0, 0, SEN(printargs), "sysv_sysinfo" }, +[1157] = { 0, 0, SEN(printargs), "sysv_nuname" }, +[1158] = { 0, 0, SEN(printargs), "sysv_xstat" }, +[1159] = { 0, 0, SEN(printargs), "sysv_lxstat" }, +[1160] = { 0, 0, SEN(printargs), "sysv_fxstat" }, +[1161] = { 0, 0, SEN(printargs), "sysv_xmknod" }, +[1162] = { 0, 0, SEN(printargs), "sysv_ksigaction" }, +[1163] = { 0, 0, SEN(printargs), "sysv_sigpending" }, +[1164] = { 0, 0, SEN(printargs), "sysv_sigprocmask" }, +[1165] = { 0, 0, SEN(printargs), "sysv_sigsuspend" }, +[1166] = { 0, 0, SEN(printargs), "sysv_sigpoll" }, +[1167] = { 0, 0, SEN(printargs), "sysv_swapctl" }, +[1168] = { 0, 0, SEN(printargs), "sysv_getcontext" }, +[1169] = { 0, 0, SEN(printargs), "sysv_setcontext" }, +[1170] = { 0, 0, SEN(printargs), "sysv_waitsys" }, +[1171] = { 0, 0, SEN(printargs), "sysv_sigstack" }, +[1172] = { 0, 0, SEN(printargs), "sysv_sigaltstack" }, +[1173] = { 0, 0, SEN(printargs), "sysv_sigsendset" }, +[1174] = { 0, 0, SEN(printargs), "sysv_statvfs" }, +[1175] = { 0, 0, SEN(printargs), "sysv_fstatvfs" }, +[1176] = { 0, 0, SEN(printargs), "sysv_getpmsg" }, +[1177] = { 0, 0, SEN(printargs), "sysv_putpmsg" }, +[1178] = { 0, 0, SEN(printargs), "sysv_lchown" }, +[1179] = { 0, 0, SEN(printargs), "sysv_priocntl" }, +[1180] = { 0, 0, SEN(printargs), "sysv_ksigqueue" }, +[1181] = { 0, 0, SEN(printargs), "sysv_readv" }, +[1182] = { 0, 0, SEN(printargs), "sysv_writev" }, +[1183] = { 0, 0, SEN(printargs), "sysv_truncate64" }, +[1184] = { 0, 0, SEN(printargs), "sysv_ftruncate64" }, +[1185] = { 0, TD|TM|SI, SEN(printargs), "sysv_mmap64" }, +[1186] = { 0, 0, SEN(printargs), "sysv_dmi" }, +[1187] = { 0, 0, SEN(printargs), "sysv_pread" }, +[1188] = { 0, 0, SEN(printargs), "sysv_pwrite" }, - { 0, 0, printargs, "sysv_syscall" }, /* 1000 */ /* start of SYSV */ - { 0, 0, printargs, "sysv_exit" }, /* 1001 */ - { 0, 0, printargs, "sysv_fork" }, /* 1002 */ - { 0, 0, printargs, "sysv_read" }, /* 1003 */ - { 0, 0, printargs, "sysv_write" }, /* 1004 */ - { 0, 0, printargs, "sysv_open" }, /* 1005 */ - { 0, 0, printargs, "sysv_close" }, /* 1006 */ - { 0, 0, printargs, "sysv_wait" }, /* 1007 */ - { 0, 0, printargs, "sysv_creat" }, /* 1008 */ - { 0, 0, printargs, "sysv_link" }, /* 1009 */ - { 0, 0, printargs, "sysv_unlink" }, /* 1010 */ - { 0, 0, printargs, "sysv_execv" }, /* 1011 */ - { 0, 0, printargs, "sysv_chdir" }, /* 1012 */ - { 0, 0, printargs, "sysv_time" }, /* 1013 */ - { 0, 0, printargs, "sysv_mknod" }, /* 1014 */ - { 0, 0, printargs, "sysv_chmod" }, /* 1015 */ - { 0, 0, printargs, "sysv_chown" }, /* 1016 */ - { 0, TM|SI, printargs, "sysv_brk" }, /* 1017 */ - { 0, 0, printargs, "sysv_stat" }, /* 1018 */ - { 0, 0, printargs, "sysv_lseek" }, /* 1019 */ - { 0, 0, printargs, "sysv_getpid" }, /* 1020 */ - { 0, 0, printargs, "sysv_mount" }, /* 1021 */ - { 0, 0, printargs, "sysv_umount" }, /* 1022 */ - { 0, 0, printargs, "sysv_setuid" }, /* 1023 */ - { 0, 0, printargs, "sysv_getuid" }, /* 1024 */ - { 0, 0, printargs, "sysv_stime" }, /* 1025 */ - { 0, 0, printargs, "sysv_ptrace" }, /* 1026 */ - { 0, 0, printargs, "sysv_alarm" }, /* 1027 */ - { 0, 0, printargs, "sysv_fstat" }, /* 1028 */ - { 0, 0, printargs, "sysv_pause" }, /* 1029 */ - { 0, 0, printargs, "sysv_utime" }, /* 1030 */ - { 0, 0, printargs, "sysv_stty" }, /* 1031 */ - { 0, 0, printargs, "sysv_gtty" }, /* 1032 */ - { 0, 0, printargs, "sysv_access" }, /* 1033 */ - { 0, 0, printargs, "sysv_nice" }, /* 1034 */ - { 0, 0, printargs, "sysv_statfs" }, /* 1035 */ - { 0, 0, printargs, "sysv_sync" }, /* 1036 */ - { 0, 0, printargs, "sysv_kill" }, /* 1037 */ - { 0, 0, printargs, "sysv_fstatfs" }, /* 1038 */ - { 0, 0, printargs, "sysv_setpgrp" }, /* 1039 */ - { 0, 0, printargs, "sysv_syssgi" }, /* 1040 */ - { 0, 0, printargs, "sysv_dup" }, /* 1041 */ - { 0, 0, printargs, "sysv_pipe" }, /* 1042 */ - { 0, 0, printargs, "sysv_times" }, /* 1043 */ - { 0, 0, printargs, "sysv_profil" }, /* 1044 */ - { 0, 0, printargs, "sysv_plock" }, /* 1045 */ - { 0, 0, printargs, "sysv_setgid" }, /* 1046 */ - { 0, 0, printargs, "sysv_getgid" }, /* 1047 */ - { 0, 0, printargs, "sysv_sig" }, /* 1048 */ - { 0, 0, printargs, "sysv_msgsys" }, /* 1049 */ - { 0, 0, printargs, "sysv_sysmips" }, /* 1050 */ - { 0, 0, printargs, "sysv_acct" }, /* 1051 */ - { 0, 0, printargs, "sysv_shmsys" }, /* 1052 */ - { 0, 0, printargs, "sysv_semsys" }, /* 1053 */ - { 0, 0, printargs, "sysv_ioctl" }, /* 1054 */ - { 0, 0, printargs, "sysv_uadmin" }, /* 1055 */ - { 0, 0, printargs, "sysv_sysmp" }, /* 1056 */ - { 0, 0, printargs, "sysv_utssys" }, /* 1057 */ - { 0, 0, NULL, NULL }, /* 1058 */ - { 0, 0, printargs, "sysv_execve" }, /* 1059 */ - { 0, 0, printargs, "sysv_umask" }, /* 1060 */ - { 0, 0, printargs, "sysv_chroot" }, /* 1061 */ - { 0, 0, printargs, "sysv_fcntl" }, /* 1062 */ - { 0, 0, printargs, "sysv_ulimit" }, /* 1063 */ - { 0, 0, NULL, NULL }, /* 1064 */ - { 0, 0, NULL, NULL }, /* 1065 */ - { 0, 0, NULL, NULL }, /* 1066 */ - { 0, 0, NULL, NULL }, /* 1067 */ - { 0, 0, NULL, NULL }, /* 1068 */ - { 0, 0, NULL, NULL }, /* 1069 */ - { 0, 0, printargs, "sysv_advfs" }, /* 1070 */ - { 0, 0, printargs, "sysv_unadvfs" }, /* 1071 */ - { 0, 0, printargs, "sysv_rmount" }, /* 1072 */ - { 0, 0, printargs, "sysv_rumount" }, /* 1073 */ - { 0, 0, printargs, "sysv_rfstart" }, /* 1074 */ - { 0, 0, printargs, "sysv_getrlimit64" }, /* 1075 */ - { 0, 0, printargs, "sysv_setrlimit64" }, /* 1076 */ - { 0, 0, printargs, "sysv_nanosleep" }, /* 1077 */ - { 0, 0, printargs, "sysv_lseek64" }, /* 1078 */ - { 0, 0, printargs, "sysv_rmdir" }, /* 1079 */ - { 0, 0, printargs, "sysv_mkdir" }, /* 1080 */ - { 0, 0, printargs, "sysv_getdents" }, /* 1081 */ - { 0, 0, printargs, "sysv_sginap" }, /* 1082 */ - { 0, 0, printargs, "sysv_sgikopt" }, /* 1083 */ - { 0, 0, printargs, "sysv_sysfs" }, /* 1084 */ - { 0, 0, printargs, "sysv_getmsg" }, /* 1085 */ - { 0, 0, printargs, "sysv_putmsg" }, /* 1086 */ - { 0, 0, printargs, "sysv_poll" }, /* 1087 */ - { 0, 0, printargs, "sysv_sigreturn" }, /* 1088 */ - { 0, 0, printargs, "sysv_accept" }, /* 1089 */ - { 0, 0, printargs, "sysv_bind" }, /* 1090 */ - { 0, 0, printargs, "sysv_connect" }, /* 1091 */ - { 0, 0, printargs, "sysv_gethostid" }, /* 1092 */ - { 0, 0, printargs, "sysv_getpeername" }, /* 1093 */ - { 0, 0, printargs, "sysv_getsockname" }, /* 1094 */ - { 0, 0, printargs, "sysv_getsockopt" }, /* 1095 */ - { 0, 0, printargs, "sysv_listen" }, /* 1096 */ - { 0, 0, printargs, "sysv_recv" }, /* 1097 */ - { 0, 0, printargs, "sysv_recvfrom" }, /* 1098 */ - { 0, 0, printargs, "sysv_recvmsg" }, /* 1099 */ - { 0, 0, printargs, "sysv_select" }, /* 1100 */ - { 0, 0, printargs, "sysv_send" }, /* 1101 */ - { 0, 0, printargs, "sysv_sendmsg" }, /* 1102 */ - { 0, 0, printargs, "sysv_sendto" }, /* 1103 */ - { 0, 0, printargs, "sysv_sethostid" }, /* 1104 */ - { 0, 0, printargs, "sysv_setsockopt" }, /* 1105 */ - { 0, 0, printargs, "sysv_shutdown" }, /* 1106 */ - { 0, 0, printargs, "sysv_socket" }, /* 1107 */ - { 0, 0, printargs, "sysv_gethostname" }, /* 1108 */ - { 0, 0, printargs, "sysv_sethostname" }, /* 1109 */ - { 0, 0, printargs, "sysv_getdomainname" }, /* 1110 */ - { 0, 0, printargs, "sysv_setdomainname" }, /* 1111 */ - { 0, 0, printargs, "sysv_truncate" }, /* 1112 */ - { 0, 0, printargs, "sysv_ftruncate" }, /* 1113 */ - { 0, 0, printargs, "sysv_rename" }, /* 1114 */ - { 0, 0, printargs, "sysv_symlink" }, /* 1115 */ - { 0, 0, printargs, "sysv_readlink" }, /* 1116 */ - { 0, 0, printargs, "sysv_lstat" }, /* 1117 */ - { 0, 0, printargs, "sysv_nfsmount" }, /* 1118 */ - { 0, 0, printargs, "sysv_nfssvc" }, /* 1119 */ - { 0, 0, printargs, "sysv_getfh" }, /* 1120 */ - { 0, 0, printargs, "sysv_async_daemon" }, /* 1121 */ - { 0, 0, printargs, "sysv_exportfs" }, /* 1122 */ - { 0, 0, printargs, "sysv_setregid" }, /* 1123 */ - { 0, 0, printargs, "sysv_setreuid" }, /* 1124 */ - { 0, 0, printargs, "sysv_getitimer" }, /* 1125 */ - { 0, 0, printargs, "sysv_setitimer" }, /* 1126 */ - { 0, 0, printargs, "sysv_adjtime" }, /* 1127 */ - { 0, 0, printargs, "sysv_BSD_getime" }, /* 1128 */ - { 0, 0, printargs, "sysv_sproc" }, /* 1129 */ - { 0, 0, printargs, "sysv_prctl" }, /* 1130 */ - { 0, 0, printargs, "sysv_procblk" }, /* 1131 */ - { 0, 0, printargs, "sysv_sprocsp" }, /* 1132 */ - { 0, 0, printargs, "sysv_sgigsc" }, /* 1133 */ - { 0, TD|TM|SI, printargs, "sysv_mmap" }, /* 1134 */ - { 0, TM|SI, printargs, "sysv_munmap" }, /* 1135 */ - { 0, TM|SI, printargs, "sysv_mprotect" }, /* 1136 */ - { 0, TM, printargs, "sysv_msync" }, /* 1137 */ - { 0, TM, printargs, "sysv_madvise" }, /* 1138 */ - { 0, 0, printargs, "sysv_pagelock" }, /* 1139 */ - { 0, 0, printargs, "sysv_getpagesize" }, /* 1140 */ - { 0, TF, printargs, "sysv_quotactl" }, /* 1141 */ - { 0, 0, printargs, "sysv_libdetach" }, /* 1142 */ - { 0, 0, printargs, "sysv_BSDgetpgrp" }, /* 1143 */ - { 0, 0, printargs, "sysv_BSDsetpgrp" }, /* 1144 */ - { 0, 0, printargs, "sysv_vhangup" }, /* 1145 */ - { 0, 0, printargs, "sysv_fsync" }, /* 1146 */ - { 0, 0, printargs, "sysv_fchdir" }, /* 1147 */ - { 0, 0, printargs, "sysv_getrlimit" }, /* 1148 */ - { 0, 0, printargs, "sysv_setrlimit" }, /* 1149 */ - { 0, 0, printargs, "sysv_cacheflush" }, /* 1150 */ - { 0, 0, printargs, "sysv_cachectl" }, /* 1151 */ - { 0, 0, printargs, "sysv_fchown" }, /* 1152 */ - { 0, 0, printargs, "sysv_fchmod" }, /* 1153 */ - { 0, 0, printargs, "sysv_wait3" }, /* 1154 */ - { 0, 0, printargs, "sysv_socketpair" }, /* 1155 */ - { 0, 0, printargs, "sysv_sysinfo" }, /* 1156 */ - { 0, 0, printargs, "sysv_nuname" }, /* 1157 */ - { 0, 0, printargs, "sysv_xstat" }, /* 1158 */ - { 0, 0, printargs, "sysv_lxstat" }, /* 1159 */ - { 0, 0, printargs, "sysv_fxstat" }, /* 1160 */ - { 0, 0, printargs, "sysv_xmknod" }, /* 1161 */ - { 0, 0, printargs, "sysv_ksigaction" }, /* 1162 */ - { 0, 0, printargs, "sysv_sigpending" }, /* 1163 */ - { 0, 0, printargs, "sysv_sigprocmask" }, /* 1164 */ - { 0, 0, printargs, "sysv_sigsuspend" }, /* 1165 */ - { 0, 0, printargs, "sysv_sigpoll" }, /* 1166 */ - { 0, 0, printargs, "sysv_swapctl" }, /* 1167 */ - { 0, 0, printargs, "sysv_getcontext" }, /* 1168 */ - { 0, 0, printargs, "sysv_setcontext" }, /* 1169 */ - { 0, 0, printargs, "sysv_waitsys" }, /* 1170 */ - { 0, 0, printargs, "sysv_sigstack" }, /* 1171 */ - { 0, 0, printargs, "sysv_sigaltstack" }, /* 1172 */ - { 0, 0, printargs, "sysv_sigsendset" }, /* 1173 */ - { 0, 0, printargs, "sysv_statvfs" }, /* 1174 */ - { 0, 0, printargs, "sysv_fstatvfs" }, /* 1175 */ - { 0, 0, printargs, "sysv_getpmsg" }, /* 1176 */ - { 0, 0, printargs, "sysv_putpmsg" }, /* 1177 */ - { 0, 0, printargs, "sysv_lchown" }, /* 1178 */ - { 0, 0, printargs, "sysv_priocntl" }, /* 1179 */ - { 0, 0, printargs, "sysv_ksigqueue" }, /* 1180 */ - { 0, 0, printargs, "sysv_readv" }, /* 1181 */ - { 0, 0, printargs, "sysv_writev" }, /* 1182 */ - { 0, 0, printargs, "sysv_truncate64" }, /* 1183 */ - { 0, 0, printargs, "sysv_ftruncate64" }, /* 1184 */ - { 0, TD|TM|SI, printargs, "sysv_mmap64" }, /* 1185 */ - { 0, 0, printargs, "sysv_dmi" }, /* 1186 */ - { 0, 0, printargs, "sysv_pread" }, /* 1187 */ - { 0, 0, printargs, "sysv_pwrite" }, /* 1188 */ +[2000] = { 0, 0, SEN(printargs), "bsd43_syscall" }, /* start of BSD 4.3 */ +[2001] = { 0, 0, SEN(printargs), "bsd43_exit" }, +[2002] = { 0, 0, SEN(printargs), "bsd43_fork" }, +[2003] = { 0, 0, SEN(printargs), "bsd43_read" }, +[2004] = { 0, 0, SEN(printargs), "bsd43_write" }, +[2005] = { 0, 0, SEN(printargs), "bsd43_open" }, +[2006] = { 0, 0, SEN(printargs), "bsd43_close" }, +[2007] = { 0, 0, SEN(printargs), "bsd43_wait" }, +[2008] = { 0, 0, SEN(printargs), "bsd43_creat" }, +[2009] = { 0, 0, SEN(printargs), "bsd43_link" }, +[2010] = { 0, 0, SEN(printargs), "bsd43_unlink" }, +[2011] = { 0, 0, SEN(printargs), "bsd43_exec" }, +[2012] = { 0, 0, SEN(printargs), "bsd43_chdir" }, +[2013] = { 0, 0, SEN(printargs), "bsd43_time" }, +[2014] = { 0, 0, SEN(printargs), "bsd43_mknod" }, +[2015] = { 0, 0, SEN(printargs), "bsd43_chmod" }, +[2016] = { 0, 0, SEN(printargs), "bsd43_chown" }, +[2017] = { 0, TM, SEN(printargs), "bsd43_sbreak" }, +[2018] = { 0, 0, SEN(printargs), "bsd43_oldstat" }, +[2019] = { 0, 0, SEN(printargs), "bsd43_lseek" }, +[2020] = { 0, 0, SEN(printargs), "bsd43_getpid" }, +[2021] = { 0, 0, SEN(printargs), "bsd43_oldmount" }, +[2022] = { 0, 0, SEN(printargs), "bsd43_umount" }, +[2023] = { 0, 0, SEN(printargs), "bsd43_setuid" }, +[2024] = { 0, 0, SEN(printargs), "bsd43_getuid" }, +[2025] = { 0, 0, SEN(printargs), "bsd43_stime" }, +[2026] = { 0, 0, SEN(printargs), "bsd43_ptrace" }, +[2027] = { 0, 0, SEN(printargs), "bsd43_alarm" }, +[2028] = { 0, 0, SEN(printargs), "bsd43_oldfstat" }, +[2029] = { 0, 0, SEN(printargs), "bsd43_pause" }, +[2030] = { 0, 0, SEN(printargs), "bsd43_utime" }, +[2031] = { 0, 0, SEN(printargs), "bsd43_stty" }, +[2032] = { 0, 0, SEN(printargs), "bsd43_gtty" }, +[2033] = { 0, 0, SEN(printargs), "bsd43_access" }, +[2034] = { 0, 0, SEN(printargs), "bsd43_nice" }, +[2035] = { 0, 0, SEN(printargs), "bsd43_ftime" }, +[2036] = { 0, 0, SEN(printargs), "bsd43_sync" }, +[2037] = { 0, 0, SEN(printargs), "bsd43_kill" }, +[2038] = { 0, 0, SEN(printargs), "bsd43_stat" }, +[2039] = { 0, 0, SEN(printargs), "bsd43_oldsetpgrp" }, +[2040] = { 0, 0, SEN(printargs), "bsd43_lstat" }, +[2041] = { 0, 0, SEN(printargs), "bsd43_dup" }, +[2042] = { 0, 0, SEN(printargs), "bsd43_pipe" }, +[2043] = { 0, 0, SEN(printargs), "bsd43_times" }, +[2044] = { 0, 0, SEN(printargs), "bsd43_profil" }, +[2045] = { 0, 0, SEN(printargs), "bsd43_msgsys" }, +[2046] = { 0, 0, SEN(printargs), "bsd43_setgid" }, +[2047] = { 0, 0, SEN(printargs), "bsd43_getgid" }, +[2048] = { 0, 0, SEN(printargs), "bsd43_ssig" }, +[2049] = { }, +[2050] = { }, +[2051] = { 0, 0, SEN(printargs), "bsd43_sysacct" }, +[2052] = { 0, 0, SEN(printargs), "bsd43_phys" }, +[2053] = { 0, 0, SEN(printargs), "bsd43_lock" }, +[2054] = { 0, 0, SEN(printargs), "bsd43_ioctl" }, +[2055] = { 0, 0, SEN(printargs), "bsd43_reboot" }, +[2056] = { 0, 0, SEN(printargs), "bsd43_mpxchan" }, +[2057] = { 0, 0, SEN(printargs), "bsd43_symlink" }, +[2058] = { 0, 0, SEN(printargs), "bsd43_readlink" }, +[2059] = { 0, 0, SEN(printargs), "bsd43_execve" }, +[2060] = { 0, 0, SEN(printargs), "bsd43_umask" }, +[2061] = { 0, 0, SEN(printargs), "bsd43_chroot" }, +[2062] = { 0, 0, SEN(printargs), "bsd43_fstat" }, +[2063] = { }, +[2064] = { 0, 0, SEN(printargs), "bsd43_getpagesize" }, +[2065] = { 0, TM|SI, SEN(printargs), "bsd43_mremap" }, +[2066] = { 0, 0, SEN(printargs), "bsd43_vfork" }, +[2067] = { 0, 0, SEN(printargs), "bsd43_vread" }, +[2068] = { 0, 0, SEN(printargs), "bsd43_vwrite" }, +[2069] = { 0, TM|SI, SEN(printargs), "bsd43_sbrk" }, +[2070] = { 0, 0, SEN(printargs), "bsd43_sstk" }, +[2071] = { 0, TD|TM|SI, SEN(printargs), "bsd43_mmap" }, +[2072] = { 0, 0, SEN(printargs), "bsd43_vadvise" }, +[2073] = { 0, TM|SI, SEN(printargs), "bsd43_munmap" }, +[2074] = { 0, TM|SI, SEN(printargs), "bsd43_mprotect" }, +[2075] = { 0, TM, SEN(printargs), "bsd43_madvise" }, +[2076] = { 0, 0, SEN(printargs), "bsd43_vhangup" }, +[2077] = { 0, 0, SEN(printargs), "bsd43_vlimit" }, +[2078] = { 0, TM, SEN(printargs), "bsd43_mincore" }, +[2079] = { 0, 0, SEN(printargs), "bsd43_getgroups" }, +[2080] = { 0, 0, SEN(printargs), "bsd43_setgroups" }, +[2081] = { 0, 0, SEN(printargs), "bsd43_getpgrp" }, +[2082] = { 0, 0, SEN(printargs), "bsd43_setpgrp" }, +[2083] = { 0, 0, SEN(printargs), "bsd43_setitimer" }, +[2084] = { 0, 0, SEN(printargs), "bsd43_wait3" }, +[2085] = { 0, 0, SEN(printargs), "bsd43_swapon" }, +[2086] = { 0, 0, SEN(printargs), "bsd43_getitimer" }, +[2087] = { 0, 0, SEN(printargs), "bsd43_gethostname" }, +[2088] = { 0, 0, SEN(printargs), "bsd43_sethostname" }, +[2089] = { 0, 0, SEN(printargs), "bsd43_getdtablesize" }, +[2090] = { 0, 0, SEN(printargs), "bsd43_dup2" }, +[2091] = { 0, 0, SEN(printargs), "bsd43_getdopt" }, +[2092] = { 0, 0, SEN(printargs), "bsd43_fcntl" }, +[2093] = { 0, 0, SEN(printargs), "bsd43_select" }, +[2094] = { 0, 0, SEN(printargs), "bsd43_setdopt" }, +[2095] = { 0, 0, SEN(printargs), "bsd43_fsync" }, +[2096] = { 0, 0, SEN(printargs), "bsd43_setpriority" }, +[2097] = { 0, 0, SEN(printargs), "bsd43_socket" }, +[2098] = { 0, 0, SEN(printargs), "bsd43_connect" }, +[2099] = { 0, 0, SEN(printargs), "bsd43_oldaccept" }, +[2100] = { 0, 0, SEN(printargs), "bsd43_getpriority" }, +[2101] = { 0, 0, SEN(printargs), "bsd43_send" }, +[2102] = { 0, 0, SEN(printargs), "bsd43_recv" }, +[2103] = { 0, 0, SEN(printargs), "bsd43_sigreturn" }, +[2104] = { 0, 0, SEN(printargs), "bsd43_bind" }, +[2105] = { 0, 0, SEN(printargs), "bsd43_setsockopt" }, +[2106] = { 0, 0, SEN(printargs), "bsd43_listen" }, +[2107] = { 0, 0, SEN(printargs), "bsd43_vtimes" }, +[2108] = { 0, 0, SEN(printargs), "bsd43_sigvec" }, +[2109] = { 0, 0, SEN(printargs), "bsd43_sigblock" }, +[2110] = { 0, 0, SEN(printargs), "bsd43_sigsetmask" }, +[2111] = { 0, 0, SEN(printargs), "bsd43_sigpause" }, +[2112] = { 0, 0, SEN(printargs), "bsd43_sigstack" }, +[2113] = { 0, 0, SEN(printargs), "bsd43_oldrecvmsg" }, +[2114] = { 0, 0, SEN(printargs), "bsd43_oldsendmsg" }, +[2115] = { 0, 0, SEN(printargs), "bsd43_vtrace" }, +[2116] = { 0, 0, SEN(printargs), "bsd43_gettimeofday" }, +[2117] = { 0, 0, SEN(printargs), "bsd43_getrusage" }, +[2118] = { 0, 0, SEN(printargs), "bsd43_getsockopt" }, +[2119] = { }, +[2120] = { 0, 0, SEN(printargs), "bsd43_readv" }, +[2121] = { 0, 0, SEN(printargs), "bsd43_writev" }, +[2122] = { 0, 0, SEN(printargs), "bsd43_settimeofday" }, +[2123] = { 0, 0, SEN(printargs), "bsd43_fchown" }, +[2124] = { 0, 0, SEN(printargs), "bsd43_fchmod" }, +[2125] = { 0, 0, SEN(printargs), "bsd43_oldrecvfrom" }, +[2126] = { 0, 0, SEN(printargs), "bsd43_setreuid" }, +[2127] = { 0, 0, SEN(printargs), "bsd43_setregid" }, +[2128] = { 0, 0, SEN(printargs), "bsd43_rename" }, +[2129] = { 0, 0, SEN(printargs), "bsd43_truncate" }, +[2130] = { 0, 0, SEN(printargs), "bsd43_ftruncate" }, +[2131] = { 0, 0, SEN(printargs), "bsd43_flock" }, +[2132] = { 0, 0, SEN(printargs), "bsd43_semsys" }, +[2133] = { 0, 0, SEN(printargs), "bsd43_sendto" }, +[2134] = { 0, 0, SEN(printargs), "bsd43_shutdown" }, +[2135] = { 0, 0, SEN(printargs), "bsd43_socketpair" }, +[2136] = { 0, 0, SEN(printargs), "bsd43_mkdir" }, +[2137] = { 0, 0, SEN(printargs), "bsd43_rmdir" }, +[2138] = { 0, 0, SEN(printargs), "bsd43_utimes" }, +[2139] = { 0, 0, SEN(printargs), "bsd43_sigcleanup" }, +[2140] = { 0, 0, SEN(printargs), "bsd43_adjtime" }, +[2141] = { 0, 0, SEN(printargs), "bsd43_oldgetpeername" }, +[2142] = { 0, 0, SEN(printargs), "bsd43_gethostid" }, +[2143] = { 0, 0, SEN(printargs), "bsd43_sethostid" }, +[2144] = { 0, 0, SEN(printargs), "bsd43_getrlimit" }, +[2145] = { 0, 0, SEN(printargs), "bsd43_setrlimit" }, +[2146] = { 0, 0, SEN(printargs), "bsd43_killpg" }, +[2147] = { 0, 0, SEN(printargs), "bsd43_shmsys" }, +[2148] = { 0, 0, SEN(printargs), "bsd43_quota" }, +[2149] = { 0, 0, SEN(printargs), "bsd43_qquota" }, +[2150] = { 0, 0, SEN(printargs), "bsd43_oldgetsockname" }, +[2151] = { 0, 0, SEN(printargs), "bsd43_sysmips" }, +[2152] = { 0, 0, SEN(printargs), "bsd43_cacheflush" }, +[2153] = { 0, 0, SEN(printargs), "bsd43_cachectl" }, +[2154] = { 0, 0, SEN(printargs), "bsd43_debug" }, +[2155] = { }, +[2156] = { }, +[2157] = { 0, 0, SEN(printargs), "bsd43_nfs_mount" }, +[2158] = { 0, 0, SEN(printargs), "bsd43_nfs_svc" }, +[2159] = { 0, 0, SEN(printargs), "bsd43_getdirentries" }, +[2160] = { 0, 0, SEN(printargs), "bsd43_statfs" }, +[2161] = { 0, 0, SEN(printargs), "bsd43_fstatfs" }, +[2162] = { 0, 0, SEN(printargs), "bsd43_unmount" }, +[2163] = { 0, 0, SEN(printargs), "bsd43_async_daemon" }, +[2164] = { 0, 0, SEN(printargs), "bsd43_nfs_getfh" }, +[2165] = { 0, 0, SEN(printargs), "bsd43_getdomainname" }, +[2166] = { 0, 0, SEN(printargs), "bsd43_setdomainname" }, +[2167] = { 0, 0, SEN(printargs), "bsd43_pcfs_mount" }, +[2168] = { 0, TF, SEN(printargs), "bsd43_quotactl" }, +[2169] = { 0, 0, SEN(printargs), "bsd43_oldexportfs" }, +[2170] = { 0, 0, SEN(printargs), "bsd43_smount" }, +[2171] = { 0, 0, SEN(printargs), "bsd43_mipshwconf" }, +[2172] = { 0, 0, SEN(printargs), "bsd43_exportfs" }, +[2173] = { 0, 0, SEN(printargs), "bsd43_nfsfh_open" }, +[2174] = { 0, 0, SEN(printargs), "bsd43_libattach" }, +[2175] = { 0, 0, SEN(printargs), "bsd43_libdetach" }, +[2176] = { 0, 0, SEN(printargs), "bsd43_accept" }, +[2177] = { }, +[2178] = { }, +[2179] = { 0, 0, SEN(printargs), "bsd43_recvmsg" }, +[2180] = { 0, 0, SEN(printargs), "bsd43_recvfrom" }, +[2181] = { 0, 0, SEN(printargs), "bsd43_sendmsg" }, +[2182] = { 0, 0, SEN(printargs), "bsd43_getpeername" }, +[2183] = { 0, 0, SEN(printargs), "bsd43_getsockname" }, +[2184] = { 0, 0, SEN(printargs), "bsd43_aread" }, +[2185] = { 0, 0, SEN(printargs), "bsd43_awrite" }, +[2186] = { 0, 0, SEN(printargs), "bsd43_listio" }, +[2187] = { 0, 0, SEN(printargs), "bsd43_acancel" }, +[2188] = { 0, 0, SEN(printargs), "bsd43_astatus" }, +[2189] = { 0, 0, SEN(printargs), "bsd43_await" }, +[2190] = { 0, 0, SEN(printargs), "bsd43_areadv" }, +[2191] = { 0, 0, SEN(printargs), "bsd43_awritev" }, - [1189 ... 1999] = { }, /* 1999 */ /* end of SYSV */ - - { 0, 0, printargs, "bsd43_syscall" }, /* 2000 */ /* start of BSD 4.3 */ - { 0, 0, printargs, "bsd43_exit" }, /* 2001 */ - { 0, 0, printargs, "bsd43_fork" }, /* 2002 */ - { 0, 0, printargs, "bsd43_read" }, /* 2003 */ - { 0, 0, printargs, "bsd43_write" }, /* 2004 */ - { 0, 0, printargs, "bsd43_open" }, /* 2005 */ - { 0, 0, printargs, "bsd43_close" }, /* 2006 */ - { 0, 0, printargs, "bsd43_wait" }, /* 2007 */ - { 0, 0, printargs, "bsd43_creat" }, /* 2008 */ - { 0, 0, printargs, "bsd43_link" }, /* 2009 */ - { 0, 0, printargs, "bsd43_unlink" }, /* 2010 */ - { 0, 0, printargs, "bsd43_exec" }, /* 2011 */ - { 0, 0, printargs, "bsd43_chdir" }, /* 2012 */ - { 0, 0, printargs, "bsd43_time" }, /* 2013 */ - { 0, 0, printargs, "bsd43_mknod" }, /* 2014 */ - { 0, 0, printargs, "bsd43_chmod" }, /* 2015 */ - { 0, 0, printargs, "bsd43_chown" }, /* 2016 */ - { 0, TM, printargs, "bsd43_sbreak" }, /* 2017 */ - { 0, 0, printargs, "bsd43_oldstat" }, /* 2018 */ - { 0, 0, printargs, "bsd43_lseek" }, /* 2019 */ - { 0, 0, printargs, "bsd43_getpid" }, /* 2020 */ - { 0, 0, printargs, "bsd43_oldmount" }, /* 2021 */ - { 0, 0, printargs, "bsd43_umount" }, /* 2022 */ - { 0, 0, printargs, "bsd43_setuid" }, /* 2023 */ - { 0, 0, printargs, "bsd43_getuid" }, /* 2024 */ - { 0, 0, printargs, "bsd43_stime" }, /* 2025 */ - { 0, 0, printargs, "bsd43_ptrace" }, /* 2026 */ - { 0, 0, printargs, "bsd43_alarm" }, /* 2027 */ - { 0, 0, printargs, "bsd43_oldfstat" }, /* 2028 */ - { 0, 0, printargs, "bsd43_pause" }, /* 2029 */ - { 0, 0, printargs, "bsd43_utime" }, /* 2030 */ - { 0, 0, printargs, "bsd43_stty" }, /* 2031 */ - { 0, 0, printargs, "bsd43_gtty" }, /* 2032 */ - { 0, 0, printargs, "bsd43_access" }, /* 2033 */ - { 0, 0, printargs, "bsd43_nice" }, /* 2034 */ - { 0, 0, printargs, "bsd43_ftime" }, /* 2035 */ - { 0, 0, printargs, "bsd43_sync" }, /* 2036 */ - { 0, 0, printargs, "bsd43_kill" }, /* 2037 */ - { 0, 0, printargs, "bsd43_stat" }, /* 2038 */ - { 0, 0, printargs, "bsd43_oldsetpgrp" }, /* 2039 */ - { 0, 0, printargs, "bsd43_lstat" }, /* 2040 */ - { 0, 0, printargs, "bsd43_dup" }, /* 2041 */ - { 0, 0, printargs, "bsd43_pipe" }, /* 2042 */ - { 0, 0, printargs, "bsd43_times" }, /* 2043 */ - { 0, 0, printargs, "bsd43_profil" }, /* 2044 */ - { 0, 0, printargs, "bsd43_msgsys" }, /* 2045 */ - { 0, 0, printargs, "bsd43_setgid" }, /* 2046 */ - { 0, 0, printargs, "bsd43_getgid" }, /* 2047 */ - { 0, 0, printargs, "bsd43_ssig" }, /* 2048 */ - { 0, 0, NULL, NULL }, /* 2049 */ - { 0, 0, NULL, NULL }, /* 2050 */ - { 0, 0, printargs, "bsd43_sysacct" }, /* 2051 */ - { 0, 0, printargs, "bsd43_phys" }, /* 2052 */ - { 0, 0, printargs, "bsd43_lock" }, /* 2053 */ - { 0, 0, printargs, "bsd43_ioctl" }, /* 2054 */ - { 0, 0, printargs, "bsd43_reboot" }, /* 2055 */ - { 0, 0, printargs, "bsd43_mpxchan" }, /* 2056 */ - { 0, 0, printargs, "bsd43_symlink" }, /* 2057 */ - { 0, 0, printargs, "bsd43_readlink" }, /* 2058 */ - { 0, 0, printargs, "bsd43_execve" }, /* 2059 */ - { 0, 0, printargs, "bsd43_umask" }, /* 2060 */ - { 0, 0, printargs, "bsd43_chroot" }, /* 2061 */ - { 0, 0, printargs, "bsd43_fstat" }, /* 2062 */ - { 0, 0, NULL, NULL }, /* 2063 */ - { 0, 0, printargs, "bsd43_getpagesize" }, /* 2064 */ - { 0, TM|SI, printargs, "bsd43_mremap" }, /* 2065 */ - { 0, 0, printargs, "bsd43_vfork" }, /* 2066 */ - { 0, 0, printargs, "bsd43_vread" }, /* 2067 */ - { 0, 0, printargs, "bsd43_vwrite" }, /* 2068 */ - { 0, TM|SI, printargs, "bsd43_sbrk" }, /* 2069 */ - { 0, 0, printargs, "bsd43_sstk" }, /* 2070 */ - { 0, TD|TM|SI, printargs, "bsd43_mmap" }, /* 2071 */ - { 0, 0, printargs, "bsd43_vadvise" }, /* 2072 */ - { 0, TM|SI, printargs, "bsd43_munmap" }, /* 2073 */ - { 0, TM|SI, printargs, "bsd43_mprotect" }, /* 2074 */ - { 0, TM, printargs, "bsd43_madvise" }, /* 2075 */ - { 0, 0, printargs, "bsd43_vhangup" }, /* 2076 */ - { 0, 0, printargs, "bsd43_vlimit" }, /* 2077 */ - { 0, TM, printargs, "bsd43_mincore" }, /* 2078 */ - { 0, 0, printargs, "bsd43_getgroups" }, /* 2079 */ - { 0, 0, printargs, "bsd43_setgroups" }, /* 2080 */ - { 0, 0, printargs, "bsd43_getpgrp" }, /* 2081 */ - { 0, 0, printargs, "bsd43_setpgrp" }, /* 2082 */ - { 0, 0, printargs, "bsd43_setitimer" }, /* 2083 */ - { 0, 0, printargs, "bsd43_wait3" }, /* 2084 */ - { 0, 0, printargs, "bsd43_swapon" }, /* 2085 */ - { 0, 0, printargs, "bsd43_getitimer" }, /* 2086 */ - { 0, 0, printargs, "bsd43_gethostname" }, /* 2087 */ - { 0, 0, printargs, "bsd43_sethostname" }, /* 2088 */ - { 0, 0, printargs, "bsd43_getdtablesize" }, /* 2089 */ - { 0, 0, printargs, "bsd43_dup2" }, /* 2090 */ - { 0, 0, printargs, "bsd43_getdopt" }, /* 2091 */ - { 0, 0, printargs, "bsd43_fcntl" }, /* 2092 */ - { 0, 0, printargs, "bsd43_select" }, /* 2093 */ - { 0, 0, printargs, "bsd43_setdopt" }, /* 2094 */ - { 0, 0, printargs, "bsd43_fsync" }, /* 2095 */ - { 0, 0, printargs, "bsd43_setpriority" }, /* 2096 */ - { 0, 0, printargs, "bsd43_socket" }, /* 2097 */ - { 0, 0, printargs, "bsd43_connect" }, /* 2098 */ - { 0, 0, printargs, "bsd43_oldaccept" }, /* 2099 */ - { 0, 0, printargs, "bsd43_getpriority" }, /* 2100 */ - { 0, 0, printargs, "bsd43_send" }, /* 2101 */ - { 0, 0, printargs, "bsd43_recv" }, /* 2102 */ - { 0, 0, printargs, "bsd43_sigreturn" }, /* 2103 */ - { 0, 0, printargs, "bsd43_bind" }, /* 2104 */ - { 0, 0, printargs, "bsd43_setsockopt" }, /* 2105 */ - { 0, 0, printargs, "bsd43_listen" }, /* 2106 */ - { 0, 0, printargs, "bsd43_vtimes" }, /* 2107 */ - { 0, 0, printargs, "bsd43_sigvec" }, /* 2108 */ - { 0, 0, printargs, "bsd43_sigblock" }, /* 2109 */ - { 0, 0, printargs, "bsd43_sigsetmask" }, /* 2110 */ - { 0, 0, printargs, "bsd43_sigpause" }, /* 2111 */ - { 0, 0, printargs, "bsd43_sigstack" }, /* 2112 */ - { 0, 0, printargs, "bsd43_oldrecvmsg" }, /* 2113 */ - { 0, 0, printargs, "bsd43_oldsendmsg" }, /* 2114 */ - { 0, 0, printargs, "bsd43_vtrace" }, /* 2115 */ - { 0, 0, printargs, "bsd43_gettimeofday" }, /* 2116 */ - { 0, 0, printargs, "bsd43_getrusage" }, /* 2117 */ - { 0, 0, printargs, "bsd43_getsockopt" }, /* 2118 */ - { 0, 0, NULL, NULL }, /* 2119 */ - { 0, 0, printargs, "bsd43_readv" }, /* 2120 */ - { 0, 0, printargs, "bsd43_writev" }, /* 2121 */ - { 0, 0, printargs, "bsd43_settimeofday" }, /* 2122 */ - { 0, 0, printargs, "bsd43_fchown" }, /* 2123 */ - { 0, 0, printargs, "bsd43_fchmod" }, /* 2124 */ - { 0, 0, printargs, "bsd43_oldrecvfrom" }, /* 2125 */ - { 0, 0, printargs, "bsd43_setreuid" }, /* 2126 */ - { 0, 0, printargs, "bsd43_setregid" }, /* 2127 */ - { 0, 0, printargs, "bsd43_rename" }, /* 2128 */ - { 0, 0, printargs, "bsd43_truncate" }, /* 2129 */ - { 0, 0, printargs, "bsd43_ftruncate" }, /* 2130 */ - { 0, 0, printargs, "bsd43_flock" }, /* 2131 */ - { 0, 0, printargs, "bsd43_semsys" }, /* 2132 */ - { 0, 0, printargs, "bsd43_sendto" }, /* 2133 */ - { 0, 0, printargs, "bsd43_shutdown" }, /* 2134 */ - { 0, 0, printargs, "bsd43_socketpair" }, /* 2135 */ - { 0, 0, printargs, "bsd43_mkdir" }, /* 2136 */ - { 0, 0, printargs, "bsd43_rmdir" }, /* 2137 */ - { 0, 0, printargs, "bsd43_utimes" }, /* 2138 */ - { 0, 0, printargs, "bsd43_sigcleanup" }, /* 2139 */ - { 0, 0, printargs, "bsd43_adjtime" }, /* 2140 */ - { 0, 0, printargs, "bsd43_oldgetpeername" }, /* 2141 */ - { 0, 0, printargs, "bsd43_gethostid" }, /* 2142 */ - { 0, 0, printargs, "bsd43_sethostid" }, /* 2143 */ - { 0, 0, printargs, "bsd43_getrlimit" }, /* 2144 */ - { 0, 0, printargs, "bsd43_setrlimit" }, /* 2145 */ - { 0, 0, printargs, "bsd43_killpg" }, /* 2146 */ - { 0, 0, printargs, "bsd43_shmsys" }, /* 2147 */ - { 0, 0, printargs, "bsd43_quota" }, /* 2148 */ - { 0, 0, printargs, "bsd43_qquota" }, /* 2149 */ - { 0, 0, printargs, "bsd43_oldgetsockname" }, /* 2150 */ - { 0, 0, printargs, "bsd43_sysmips" }, /* 2151 */ - { 0, 0, printargs, "bsd43_cacheflush" }, /* 2152 */ - { 0, 0, printargs, "bsd43_cachectl" }, /* 2153 */ - { 0, 0, printargs, "bsd43_debug" }, /* 2154 */ - { 0, 0, NULL, NULL }, /* 2155 */ - { 0, 0, NULL, NULL }, /* 2156 */ - { 0, 0, printargs, "bsd43_nfs_mount" }, /* 2157 */ - { 0, 0, printargs, "bsd43_nfs_svc" }, /* 2158 */ - { 0, 0, printargs, "bsd43_getdirentries" }, /* 2159 */ - { 0, 0, printargs, "bsd43_statfs" }, /* 2160 */ - { 0, 0, printargs, "bsd43_fstatfs" }, /* 2161 */ - { 0, 0, printargs, "bsd43_unmount" }, /* 2162 */ - { 0, 0, printargs, "bsd43_async_daemon" }, /* 2163 */ - { 0, 0, printargs, "bsd43_nfs_getfh" }, /* 2164 */ - { 0, 0, printargs, "bsd43_getdomainname" }, /* 2165 */ - { 0, 0, printargs, "bsd43_setdomainname" }, /* 2166 */ - { 0, 0, printargs, "bsd43_pcfs_mount" }, /* 2167 */ - { 0, TF, printargs, "bsd43_quotactl" }, /* 2168 */ - { 0, 0, printargs, "bsd43_oldexportfs" }, /* 2169 */ - { 0, 0, printargs, "bsd43_smount" }, /* 2170 */ - { 0, 0, printargs, "bsd43_mipshwconf" }, /* 2171 */ - { 0, 0, printargs, "bsd43_exportfs" }, /* 2172 */ - { 0, 0, printargs, "bsd43_nfsfh_open" }, /* 2173 */ - { 0, 0, printargs, "bsd43_libattach" }, /* 2174 */ - { 0, 0, printargs, "bsd43_libdetach" }, /* 2175 */ - { 0, 0, printargs, "bsd43_accept" }, /* 2176 */ - { 0, 0, NULL, NULL }, /* 2177 */ - { 0, 0, NULL, NULL }, /* 2178 */ - { 0, 0, printargs, "bsd43_recvmsg" }, /* 2179 */ - { 0, 0, printargs, "bsd43_recvfrom" }, /* 2180 */ - { 0, 0, printargs, "bsd43_sendmsg" }, /* 2181 */ - { 0, 0, printargs, "bsd43_getpeername" }, /* 2182 */ - { 0, 0, printargs, "bsd43_getsockname" }, /* 2183 */ - { 0, 0, printargs, "bsd43_aread" }, /* 2184 */ - { 0, 0, printargs, "bsd43_awrite" }, /* 2185 */ - { 0, 0, printargs, "bsd43_listio" }, /* 2186 */ - { 0, 0, printargs, "bsd43_acancel" }, /* 2187 */ - { 0, 0, printargs, "bsd43_astatus" }, /* 2188 */ - { 0, 0, printargs, "bsd43_await" }, /* 2189 */ - { 0, 0, printargs, "bsd43_areadv" }, /* 2190 */ - { 0, 0, printargs, "bsd43_awritev" }, /* 2191 */ - - [2192 ... 2999] = { }, /* 2999 */ /* end of BSD 4.3 */ - - { 0, 0, printargs, "posix_syscall" }, /* 3000 */ /* start of POSIX */ - { 0, 0, printargs, "posix_exit" }, /* 3001 */ - { 0, 0, printargs, "posix_fork" }, /* 3002 */ - { 0, 0, printargs, "posix_read" }, /* 3003 */ - { 0, 0, printargs, "posix_write" }, /* 3004 */ - { 0, 0, printargs, "posix_open" }, /* 3005 */ - { 0, 0, printargs, "posix_close" }, /* 3006 */ - { 0, 0, printargs, "posix_wait" }, /* 3007 */ - { 0, 0, printargs, "posix_creat" }, /* 3008 */ - { 0, 0, printargs, "posix_link" }, /* 3009 */ - { 0, 0, printargs, "posix_unlink" }, /* 3010 */ - { 0, 0, printargs, "posix_exec" }, /* 3011 */ - { 0, 0, printargs, "posix_chdir" }, /* 3012 */ - { 0, 0, printargs, "posix_gtime" }, /* 3013 */ - { 0, 0, printargs, "posix_mknod" }, /* 3014 */ - { 0, 0, printargs, "posix_chmod" }, /* 3015 */ - { 0, 0, printargs, "posix_chown" }, /* 3016 */ - { 0, TM, printargs, "posix_sbreak" }, /* 3017 */ - { 0, 0, printargs, "posix_stat" }, /* 3018 */ - { 0, 0, printargs, "posix_lseek" }, /* 3019 */ - { 0, 0, printargs, "posix_getpid" }, /* 3020 */ - { 0, 0, printargs, "posix_mount" }, /* 3021 */ - { 0, 0, printargs, "posix_umount" }, /* 3022 */ - { 0, 0, printargs, "posix_setuid" }, /* 3023 */ - { 0, 0, printargs, "posix_getuid" }, /* 3024 */ - { 0, 0, printargs, "posix_stime" }, /* 3025 */ - { 0, 0, printargs, "posix_ptrace" }, /* 3026 */ - { 0, 0, printargs, "posix_alarm" }, /* 3027 */ - { 0, 0, printargs, "posix_fstat" }, /* 3028 */ - { 0, 0, printargs, "posix_pause" }, /* 3029 */ - { 0, 0, printargs, "posix_utime" }, /* 3030 */ - { 0, 0, printargs, "posix_stty" }, /* 3031 */ - { 0, 0, printargs, "posix_gtty" }, /* 3032 */ - { 0, 0, printargs, "posix_access" }, /* 3033 */ - { 0, 0, printargs, "posix_nice" }, /* 3034 */ - { 0, 0, printargs, "posix_statfs" }, /* 3035 */ - { 0, 0, printargs, "posix_sync" }, /* 3036 */ - { 0, 0, printargs, "posix_kill" }, /* 3037 */ - { 0, 0, printargs, "posix_fstatfs" }, /* 3038 */ - { 0, 0, printargs, "posix_getpgrp" }, /* 3039 */ - { 0, 0, printargs, "posix_syssgi" }, /* 3040 */ - { 0, 0, printargs, "posix_dup" }, /* 3041 */ - { 0, 0, printargs, "posix_pipe" }, /* 3042 */ - { 0, 0, printargs, "posix_times" }, /* 3043 */ - { 0, 0, printargs, "posix_profil" }, /* 3044 */ - { 0, 0, printargs, "posix_lock" }, /* 3045 */ - { 0, 0, printargs, "posix_setgid" }, /* 3046 */ - { 0, 0, printargs, "posix_getgid" }, /* 3047 */ - { 0, 0, printargs, "posix_sig" }, /* 3048 */ - { 0, 0, printargs, "posix_msgsys" }, /* 3049 */ - { 0, 0, printargs, "posix_sysmips" }, /* 3050 */ - { 0, 0, printargs, "posix_sysacct" }, /* 3051 */ - { 0, 0, printargs, "posix_shmsys" }, /* 3052 */ - { 0, 0, printargs, "posix_semsys" }, /* 3053 */ - { 0, 0, printargs, "posix_ioctl" }, /* 3054 */ - { 0, 0, printargs, "posix_uadmin" }, /* 3055 */ - { 0, 0, printargs, "posix_exch" }, /* 3056 */ - { 0, 0, printargs, "posix_utssys" }, /* 3057 */ - { 0, 0, NULL, NULL }, /* 3058 */ - { 0, 0, printargs, "posix_exece" }, /* 3059 */ - { 0, 0, printargs, "posix_umask" }, /* 3060 */ - { 0, 0, printargs, "posix_chroot" }, /* 3061 */ - { 0, 0, printargs, "posix_fcntl" }, /* 3062 */ - { 0, 0, printargs, "posix_ulimit" }, /* 3063 */ - { 0, 0, NULL, NULL }, /* 3064 */ - { 0, 0, NULL, NULL }, /* 3065 */ - { 0, 0, NULL, NULL }, /* 3066 */ - { 0, 0, NULL, NULL }, /* 3067 */ - { 0, 0, NULL, NULL }, /* 3068 */ - { 0, 0, NULL, NULL }, /* 3069 */ - { 0, 0, printargs, "posix_advfs" }, /* 3070 */ - { 0, 0, printargs, "posix_unadvfs" }, /* 3071 */ - { 0, 0, printargs, "posix_rmount" }, /* 3072 */ - { 0, 0, printargs, "posix_rumount" }, /* 3073 */ - { 0, 0, printargs, "posix_rfstart" }, /* 3074 */ - { 0, 0, NULL, NULL }, /* 3075 */ - { 0, 0, printargs, "posix_rdebug" }, /* 3076 */ - { 0, 0, printargs, "posix_rfstop" }, /* 3077 */ - { 0, 0, printargs, "posix_rfsys" }, /* 3078 */ - { 0, 0, printargs, "posix_rmdir" }, /* 3079 */ - { 0, 0, printargs, "posix_mkdir" }, /* 3080 */ - { 0, 0, printargs, "posix_getdents" }, /* 3081 */ - { 0, 0, printargs, "posix_sginap" }, /* 3082 */ - { 0, 0, printargs, "posix_sgikopt" }, /* 3083 */ - { 0, 0, printargs, "posix_sysfs" }, /* 3084 */ - { 0, 0, printargs, "posix_getmsg" }, /* 3085 */ - { 0, 0, printargs, "posix_putmsg" }, /* 3086 */ - { 0, 0, printargs, "posix_poll" }, /* 3087 */ - { 0, 0, printargs, "posix_sigreturn" }, /* 3088 */ - { 0, 0, printargs, "posix_accept" }, /* 3089 */ - { 0, 0, printargs, "posix_bind" }, /* 3090 */ - { 0, 0, printargs, "posix_connect" }, /* 3091 */ - { 0, 0, printargs, "posix_gethostid" }, /* 3092 */ - { 0, 0, printargs, "posix_getpeername" }, /* 3093 */ - { 0, 0, printargs, "posix_getsockname" }, /* 3094 */ - { 0, 0, printargs, "posix_getsockopt" }, /* 3095 */ - { 0, 0, printargs, "posix_listen" }, /* 3096 */ - { 0, 0, printargs, "posix_recv" }, /* 3097 */ - { 0, 0, printargs, "posix_recvfrom" }, /* 3098 */ - { 0, 0, printargs, "posix_recvmsg" }, /* 3099 */ - { 0, 0, printargs, "posix_select" }, /* 3100 */ - { 0, 0, printargs, "posix_send" }, /* 3101 */ - { 0, 0, printargs, "posix_sendmsg" }, /* 3102 */ - { 0, 0, printargs, "posix_sendto" }, /* 3103 */ - { 0, 0, printargs, "posix_sethostid" }, /* 3104 */ - { 0, 0, printargs, "posix_setsockopt" }, /* 3105 */ - { 0, 0, printargs, "posix_shutdown" }, /* 3106 */ - { 0, 0, printargs, "posix_socket" }, /* 3107 */ - { 0, 0, printargs, "posix_gethostname" }, /* 3108 */ - { 0, 0, printargs, "posix_sethostname" }, /* 3109 */ - { 0, 0, printargs, "posix_getdomainname" }, /* 3110 */ - { 0, 0, printargs, "posix_setdomainname" }, /* 3111 */ - { 0, 0, printargs, "posix_truncate" }, /* 3112 */ - { 0, 0, printargs, "posix_ftruncate" }, /* 3113 */ - { 0, 0, printargs, "posix_rename" }, /* 3114 */ - { 0, 0, printargs, "posix_symlink" }, /* 3115 */ - { 0, 0, printargs, "posix_readlink" }, /* 3116 */ - { 0, 0, printargs, "posix_lstat" }, /* 3117 */ - { 0, 0, printargs, "posix_nfs_mount" }, /* 3118 */ - { 0, 0, printargs, "posix_nfs_svc" }, /* 3119 */ - { 0, 0, printargs, "posix_nfs_getfh" }, /* 3120 */ - { 0, 0, printargs, "posix_async_daemon" }, /* 3121 */ - { 0, 0, printargs, "posix_exportfs" }, /* 3122 */ - { 0, 0, printargs, "posix_SGI_setregid" }, /* 3123 */ - { 0, 0, printargs, "posix_SGI_setreuid" }, /* 3124 */ - { 0, 0, printargs, "posix_getitimer" }, /* 3125 */ - { 0, 0, printargs, "posix_setitimer" }, /* 3126 */ - { 0, 0, printargs, "posix_adjtime" }, /* 3127 */ - { 0, 0, printargs, "posix_SGI_bsdgettime" }, /* 3128 */ - { 0, 0, printargs, "posix_SGI_sproc" }, /* 3129 */ - { 0, 0, printargs, "posix_SGI_prctl" }, /* 3130 */ - { 0, 0, printargs, "posix_SGI_blkproc" }, /* 3131 */ - { 0, 0, NULL, NULL }, /* 3132 */ - { 0, 0, printargs, "posix_SGI_sgigsc" }, /* 3133 */ - { 0, TD|TM|SI, printargs, "posix_SGI_mmap" }, /* 3134 */ - { 0, TM|SI, printargs, "posix_SGI_munmap" }, /* 3135 */ - { 0, TM|SI, printargs, "posix_SGI_mprotect" }, /* 3136 */ - { 0, TM, printargs, "posix_SGI_msync" }, /* 3137 */ - { 0, TM, printargs, "posix_SGI_madvise" }, /* 3138 */ - { 0, 0, printargs, "posix_SGI_mpin" }, /* 3139 */ - { 0, 0, printargs, "posix_SGI_getpagesize" }, /* 3140 */ - { 0, 0, printargs, "posix_SGI_libattach" }, /* 3141 */ - { 0, 0, printargs, "posix_SGI_libdetach" }, /* 3142 */ - { 0, 0, printargs, "posix_SGI_getpgrp" }, /* 3143 */ - { 0, 0, printargs, "posix_SGI_setpgrp" }, /* 3144 */ - { 0, 0, NULL, NULL }, /* 3145 */ - { 0, 0, NULL, NULL }, /* 3146 */ - { 0, 0, NULL, NULL }, /* 3147 */ - { 0, 0, NULL, NULL }, /* 3148 */ - { 0, 0, NULL, NULL }, /* 3149 */ - { 0, 0, printargs, "posix_cacheflush" }, /* 3150 */ - { 0, 0, printargs, "posix_cachectl" }, /* 3151 */ - { 0, 0, printargs, "posix_fchown" }, /* 3152 */ - { 0, 0, printargs, "posix_fchmod" }, /* 3153 */ - { 0, 0, printargs, "posix_wait3" }, /* 3154 */ - { 0, TD|TM|SI, printargs, "posix_mmap" }, /* 3155 */ - { 0, TM|SI, printargs, "posix_munmap" }, /* 3156 */ - { 0, TM, printargs, "posix_madvise" }, /* 3157 */ - { 0, 0, printargs, "posix_BSD_getpagesize" }, /* 3158 */ - { 0, 0, printargs, "posix_setreuid" }, /* 3159 */ - { 0, 0, printargs, "posix_setregid" }, /* 3160 */ - { 0, 0, printargs, "posix_setpgid" }, /* 3161 */ - { 0, 0, printargs, "posix_getgroups" }, /* 3162 */ - { 0, 0, printargs, "posix_setgroups" }, /* 3163 */ - { 0, 0, printargs, "posix_gettimeofday" }, /* 3164 */ - { 0, 0, printargs, "posix_getrusage" }, /* 3165 */ - { 0, 0, printargs, "posix_getrlimit" }, /* 3166 */ - { 0, 0, printargs, "posix_setrlimit" }, /* 3167 */ - { 0, 0, printargs, "posix_waitpid" }, /* 3168 */ - { 0, 0, printargs, "posix_dup2" }, /* 3169 */ - { 0, 0, NULL, NULL }, /* 3170 */ - { 0, 0, NULL, NULL }, /* 3171 */ - { 0, 0, NULL, NULL }, /* 3172 */ - { 0, 0, NULL, NULL }, /* 3173 */ - { 0, 0, NULL, NULL }, /* 3174 */ - { 0, 0, NULL, NULL }, /* 3175 */ - { 0, 0, NULL, NULL }, /* 3176 */ - { 0, 0, NULL, NULL }, /* 3177 */ - { 0, 0, NULL, NULL }, /* 3178 */ - { 0, 0, NULL, NULL }, /* 3179 */ - { 0, 0, NULL, NULL }, /* 3180 */ - { 0, 0, NULL, NULL }, /* 3181 */ - { 0, 0, NULL, NULL }, /* 3182 */ - { 0, 0, NULL, NULL }, /* 3183 */ - { 0, 0, NULL, NULL }, /* 3184 */ - { 0, 0, NULL, NULL }, /* 3185 */ - { 0, 0, NULL, NULL }, /* 3186 */ - { 0, 0, NULL, NULL }, /* 3187 */ - { 0, 0, NULL, NULL }, /* 3188 */ - { 0, 0, NULL, NULL }, /* 3189 */ - { 0, 0, NULL, NULL }, /* 3190 */ - { 0, 0, NULL, NULL }, /* 3191 */ - { 0, 0, NULL, NULL }, /* 3192 */ - { 0, 0, NULL, NULL }, /* 3193 */ - { 0, 0, NULL, NULL }, /* 3194 */ - { 0, 0, NULL, NULL }, /* 3195 */ - { 0, 0, NULL, NULL }, /* 3196 */ - { 0, 0, NULL, NULL }, /* 3197 */ - { 0, 0, NULL, NULL }, /* 3198 */ - { 0, 0, NULL, NULL }, /* 3199 */ - { 0, 0, NULL, NULL }, /* 3200 */ - { 0, 0, NULL, NULL }, /* 3201 */ - { 0, 0, NULL, NULL }, /* 3202 */ - { 0, 0, NULL, NULL }, /* 3203 */ - { 0, 0, NULL, NULL }, /* 3204 */ - { 0, 0, NULL, NULL }, /* 3205 */ - { 0, 0, NULL, NULL }, /* 3206 */ - { 0, 0, NULL, NULL }, /* 3207 */ - { 0, 0, NULL, NULL }, /* 3208 */ - { 0, 0, NULL, NULL }, /* 3209 */ - { 0, 0, NULL, NULL }, /* 3210 */ - { 0, 0, NULL, NULL }, /* 3211 */ - { 0, 0, NULL, NULL }, /* 3212 */ - { 0, 0, NULL, NULL }, /* 3213 */ - { 0, 0, NULL, NULL }, /* 3214 */ - { 0, 0, NULL, NULL }, /* 3215 */ - { 0, 0, NULL, NULL }, /* 3216 */ - { 0, 0, NULL, NULL }, /* 3217 */ - { 0, 0, NULL, NULL }, /* 3218 */ - { 0, 0, NULL, NULL }, /* 3219 */ - { 0, 0, NULL, NULL }, /* 3220 */ - { 0, 0, NULL, NULL }, /* 3221 */ - { 0, 0, NULL, NULL }, /* 3222 */ - { 0, 0, NULL, NULL }, /* 3223 */ - { 0, 0, NULL, NULL }, /* 3224 */ - { 0, 0, NULL, NULL }, /* 3225 */ - { 0, 0, NULL, NULL }, /* 3226 */ - { 0, 0, NULL, NULL }, /* 3227 */ - { 0, 0, NULL, NULL }, /* 3228 */ - { 0, 0, NULL, NULL }, /* 3229 */ - { 0, 0, NULL, NULL }, /* 3230 */ - { 0, 0, NULL, NULL }, /* 3231 */ - { 0, 0, NULL, NULL }, /* 3232 */ - { 0, 0, NULL, NULL }, /* 3233 */ - { 0, 0, NULL, NULL }, /* 3234 */ - { 0, 0, NULL, NULL }, /* 3235 */ - { 0, 0, NULL, NULL }, /* 3236 */ - { 0, 0, NULL, NULL }, /* 3237 */ - { 0, 0, NULL, NULL }, /* 3238 */ - { 0, 0, NULL, NULL }, /* 3239 */ - { 0, 0, NULL, NULL }, /* 3240 */ - { 0, 0, NULL, NULL }, /* 3241 */ - { 0, 0, NULL, NULL }, /* 3242 */ - { 0, 0, NULL, NULL }, /* 3243 */ - { 0, 0, NULL, NULL }, /* 3244 */ - { 0, 0, NULL, NULL }, /* 3245 */ - { 0, 0, NULL, NULL }, /* 3246 */ - { 0, 0, NULL, NULL }, /* 3247 */ - { 0, 0, NULL, NULL }, /* 3248 */ - { 0, 0, NULL, NULL }, /* 3249 */ - { 0, 0, NULL, NULL }, /* 3250 */ - { 0, 0, NULL, NULL }, /* 3251 */ - { 0, 0, NULL, NULL }, /* 3252 */ - { 0, 0, NULL, NULL }, /* 3253 */ - { 0, 0, NULL, NULL }, /* 3254 */ - { 0, 0, NULL, NULL }, /* 3255 */ - { 0, 0, NULL, NULL }, /* 3256 */ - { 0, 0, NULL, NULL }, /* 3257 */ - { 0, 0, NULL, NULL }, /* 3258 */ - { 0, 0, NULL, NULL }, /* 3259 */ - { 0, 0, printargs, "posix_netboot" }, /* 3260 */ - { 0, 0, printargs, "posix_netunboot" }, /* 3261 */ - { 0, 0, printargs, "posix_rdump" }, /* 3262 */ - { 0, 0, printargs, "posix_setsid" }, /* 3263 */ - { 0, 0, printargs, "posix_getmaxsig" }, /* 3264 */ - { 0, 0, printargs, "posix_sigpending" }, /* 3265 */ - { 0, 0, printargs, "posix_sigprocmask" }, /* 3266 */ - { 0, 0, printargs, "posix_sigsuspend" }, /* 3267 */ - { 0, 0, printargs, "posix_sigaction" }, /* 3268 */ - - [3269 ... 3999] = { }, /* 3999 */ /* end of POSIX */ +[3000] = { 0, 0, SEN(printargs), "posix_syscall" }, /* start of POSIX */ +[3001] = { 0, 0, SEN(printargs), "posix_exit" }, +[3002] = { 0, 0, SEN(printargs), "posix_fork" }, +[3003] = { 0, 0, SEN(printargs), "posix_read" }, +[3004] = { 0, 0, SEN(printargs), "posix_write" }, +[3005] = { 0, 0, SEN(printargs), "posix_open" }, +[3006] = { 0, 0, SEN(printargs), "posix_close" }, +[3007] = { 0, 0, SEN(printargs), "posix_wait" }, +[3008] = { 0, 0, SEN(printargs), "posix_creat" }, +[3009] = { 0, 0, SEN(printargs), "posix_link" }, +[3010] = { 0, 0, SEN(printargs), "posix_unlink" }, +[3011] = { 0, 0, SEN(printargs), "posix_exec" }, +[3012] = { 0, 0, SEN(printargs), "posix_chdir" }, +[3013] = { 0, 0, SEN(printargs), "posix_gtime" }, +[3014] = { 0, 0, SEN(printargs), "posix_mknod" }, +[3015] = { 0, 0, SEN(printargs), "posix_chmod" }, +[3016] = { 0, 0, SEN(printargs), "posix_chown" }, +[3017] = { 0, TM, SEN(printargs), "posix_sbreak" }, +[3018] = { 0, 0, SEN(printargs), "posix_stat" }, +[3019] = { 0, 0, SEN(printargs), "posix_lseek" }, +[3020] = { 0, 0, SEN(printargs), "posix_getpid" }, +[3021] = { 0, 0, SEN(printargs), "posix_mount" }, +[3022] = { 0, 0, SEN(printargs), "posix_umount" }, +[3023] = { 0, 0, SEN(printargs), "posix_setuid" }, +[3024] = { 0, 0, SEN(printargs), "posix_getuid" }, +[3025] = { 0, 0, SEN(printargs), "posix_stime" }, +[3026] = { 0, 0, SEN(printargs), "posix_ptrace" }, +[3027] = { 0, 0, SEN(printargs), "posix_alarm" }, +[3028] = { 0, 0, SEN(printargs), "posix_fstat" }, +[3029] = { 0, 0, SEN(printargs), "posix_pause" }, +[3030] = { 0, 0, SEN(printargs), "posix_utime" }, +[3031] = { 0, 0, SEN(printargs), "posix_stty" }, +[3032] = { 0, 0, SEN(printargs), "posix_gtty" }, +[3033] = { 0, 0, SEN(printargs), "posix_access" }, +[3034] = { 0, 0, SEN(printargs), "posix_nice" }, +[3035] = { 0, 0, SEN(printargs), "posix_statfs" }, +[3036] = { 0, 0, SEN(printargs), "posix_sync" }, +[3037] = { 0, 0, SEN(printargs), "posix_kill" }, +[3038] = { 0, 0, SEN(printargs), "posix_fstatfs" }, +[3039] = { 0, 0, SEN(printargs), "posix_getpgrp" }, +[3040] = { 0, 0, SEN(printargs), "posix_syssgi" }, +[3041] = { 0, 0, SEN(printargs), "posix_dup" }, +[3042] = { 0, 0, SEN(printargs), "posix_pipe" }, +[3043] = { 0, 0, SEN(printargs), "posix_times" }, +[3044] = { 0, 0, SEN(printargs), "posix_profil" }, +[3045] = { 0, 0, SEN(printargs), "posix_lock" }, +[3046] = { 0, 0, SEN(printargs), "posix_setgid" }, +[3047] = { 0, 0, SEN(printargs), "posix_getgid" }, +[3048] = { 0, 0, SEN(printargs), "posix_sig" }, +[3049] = { 0, 0, SEN(printargs), "posix_msgsys" }, +[3050] = { 0, 0, SEN(printargs), "posix_sysmips" }, +[3051] = { 0, 0, SEN(printargs), "posix_sysacct" }, +[3052] = { 0, 0, SEN(printargs), "posix_shmsys" }, +[3053] = { 0, 0, SEN(printargs), "posix_semsys" }, +[3054] = { 0, 0, SEN(printargs), "posix_ioctl" }, +[3055] = { 0, 0, SEN(printargs), "posix_uadmin" }, +[3056] = { 0, 0, SEN(printargs), "posix_exch" }, +[3057] = { 0, 0, SEN(printargs), "posix_utssys" }, +[3058] = { }, +[3059] = { 0, 0, SEN(printargs), "posix_exece" }, +[3060] = { 0, 0, SEN(printargs), "posix_umask" }, +[3061] = { 0, 0, SEN(printargs), "posix_chroot" }, +[3062] = { 0, 0, SEN(printargs), "posix_fcntl" }, +[3063] = { 0, 0, SEN(printargs), "posix_ulimit" }, +[3064 ... 3069] = { }, +[3070] = { 0, 0, SEN(printargs), "posix_advfs" }, +[3071] = { 0, 0, SEN(printargs), "posix_unadvfs" }, +[3072] = { 0, 0, SEN(printargs), "posix_rmount" }, +[3073] = { 0, 0, SEN(printargs), "posix_rumount" }, +[3074] = { 0, 0, SEN(printargs), "posix_rfstart" }, +[3075] = { }, +[3076] = { 0, 0, SEN(printargs), "posix_rdebug" }, +[3077] = { 0, 0, SEN(printargs), "posix_rfstop" }, +[3078] = { 0, 0, SEN(printargs), "posix_rfsys" }, +[3079] = { 0, 0, SEN(printargs), "posix_rmdir" }, +[3080] = { 0, 0, SEN(printargs), "posix_mkdir" }, +[3081] = { 0, 0, SEN(printargs), "posix_getdents" }, +[3082] = { 0, 0, SEN(printargs), "posix_sginap" }, +[3083] = { 0, 0, SEN(printargs), "posix_sgikopt" }, +[3084] = { 0, 0, SEN(printargs), "posix_sysfs" }, +[3085] = { 0, 0, SEN(printargs), "posix_getmsg" }, +[3086] = { 0, 0, SEN(printargs), "posix_putmsg" }, +[3087] = { 0, 0, SEN(printargs), "posix_poll" }, +[3088] = { 0, 0, SEN(printargs), "posix_sigreturn" }, +[3089] = { 0, 0, SEN(printargs), "posix_accept" }, +[3090] = { 0, 0, SEN(printargs), "posix_bind" }, +[3091] = { 0, 0, SEN(printargs), "posix_connect" }, +[3092] = { 0, 0, SEN(printargs), "posix_gethostid" }, +[3093] = { 0, 0, SEN(printargs), "posix_getpeername" }, +[3094] = { 0, 0, SEN(printargs), "posix_getsockname" }, +[3095] = { 0, 0, SEN(printargs), "posix_getsockopt" }, +[3096] = { 0, 0, SEN(printargs), "posix_listen" }, +[3097] = { 0, 0, SEN(printargs), "posix_recv" }, +[3098] = { 0, 0, SEN(printargs), "posix_recvfrom" }, +[3099] = { 0, 0, SEN(printargs), "posix_recvmsg" }, +[3100] = { 0, 0, SEN(printargs), "posix_select" }, +[3101] = { 0, 0, SEN(printargs), "posix_send" }, +[3102] = { 0, 0, SEN(printargs), "posix_sendmsg" }, +[3103] = { 0, 0, SEN(printargs), "posix_sendto" }, +[3104] = { 0, 0, SEN(printargs), "posix_sethostid" }, +[3105] = { 0, 0, SEN(printargs), "posix_setsockopt" }, +[3106] = { 0, 0, SEN(printargs), "posix_shutdown" }, +[3107] = { 0, 0, SEN(printargs), "posix_socket" }, +[3108] = { 0, 0, SEN(printargs), "posix_gethostname" }, +[3109] = { 0, 0, SEN(printargs), "posix_sethostname" }, +[3110] = { 0, 0, SEN(printargs), "posix_getdomainname" }, +[3111] = { 0, 0, SEN(printargs), "posix_setdomainname" }, +[3112] = { 0, 0, SEN(printargs), "posix_truncate" }, +[3113] = { 0, 0, SEN(printargs), "posix_ftruncate" }, +[3114] = { 0, 0, SEN(printargs), "posix_rename" }, +[3115] = { 0, 0, SEN(printargs), "posix_symlink" }, +[3116] = { 0, 0, SEN(printargs), "posix_readlink" }, +[3117] = { 0, 0, SEN(printargs), "posix_lstat" }, +[3118] = { 0, 0, SEN(printargs), "posix_nfs_mount" }, +[3119] = { 0, 0, SEN(printargs), "posix_nfs_svc" }, +[3120] = { 0, 0, SEN(printargs), "posix_nfs_getfh" }, +[3121] = { 0, 0, SEN(printargs), "posix_async_daemon" }, +[3122] = { 0, 0, SEN(printargs), "posix_exportfs" }, +[3123] = { 0, 0, SEN(printargs), "posix_SGI_setregid" }, +[3124] = { 0, 0, SEN(printargs), "posix_SGI_setreuid" }, +[3125] = { 0, 0, SEN(printargs), "posix_getitimer" }, +[3126] = { 0, 0, SEN(printargs), "posix_setitimer" }, +[3127] = { 0, 0, SEN(printargs), "posix_adjtime" }, +[3128] = { 0, 0, SEN(printargs), "posix_SGI_bsdgettime" }, +[3129] = { 0, 0, SEN(printargs), "posix_SGI_sproc" }, +[3130] = { 0, 0, SEN(printargs), "posix_SGI_prctl" }, +[3131] = { 0, 0, SEN(printargs), "posix_SGI_blkproc" }, +[3132] = { }, +[3133] = { 0, 0, SEN(printargs), "posix_SGI_sgigsc" }, +[3134] = { 0, TD|TM|SI, SEN(printargs), "posix_SGI_mmap" }, +[3135] = { 0, TM|SI, SEN(printargs), "posix_SGI_munmap" }, +[3136] = { 0, TM|SI, SEN(printargs), "posix_SGI_mprotect" }, +[3137] = { 0, TM, SEN(printargs), "posix_SGI_msync" }, +[3138] = { 0, TM, SEN(printargs), "posix_SGI_madvise" }, +[3139] = { 0, 0, SEN(printargs), "posix_SGI_mpin" }, +[3140] = { 0, 0, SEN(printargs), "posix_SGI_getpagesize" }, +[3141] = { 0, 0, SEN(printargs), "posix_SGI_libattach" }, +[3142] = { 0, 0, SEN(printargs), "posix_SGI_libdetach" }, +[3143] = { 0, 0, SEN(printargs), "posix_SGI_getpgrp" }, +[3144] = { 0, 0, SEN(printargs), "posix_SGI_setpgrp" }, +[3145 ... 3149] = { }, +[3150] = { 0, 0, SEN(printargs), "posix_cacheflush" }, +[3151] = { 0, 0, SEN(printargs), "posix_cachectl" }, +[3152] = { 0, 0, SEN(printargs), "posix_fchown" }, +[3153] = { 0, 0, SEN(printargs), "posix_fchmod" }, +[3154] = { 0, 0, SEN(printargs), "posix_wait3" }, +[3155] = { 0, TD|TM|SI, SEN(printargs), "posix_mmap" }, +[3156] = { 0, TM|SI, SEN(printargs), "posix_munmap" }, +[3157] = { 0, TM, SEN(printargs), "posix_madvise" }, +[3158] = { 0, 0, SEN(printargs), "posix_BSD_getpagesize" }, +[3159] = { 0, 0, SEN(printargs), "posix_setreuid" }, +[3160] = { 0, 0, SEN(printargs), "posix_setregid" }, +[3161] = { 0, 0, SEN(printargs), "posix_setpgid" }, +[3162] = { 0, 0, SEN(printargs), "posix_getgroups" }, +[3163] = { 0, 0, SEN(printargs), "posix_setgroups" }, +[3164] = { 0, 0, SEN(printargs), "posix_gettimeofday" }, +[3165] = { 0, 0, SEN(printargs), "posix_getrusage" }, +[3166] = { 0, 0, SEN(printargs), "posix_getrlimit" }, +[3167] = { 0, 0, SEN(printargs), "posix_setrlimit" }, +[3168] = { 0, 0, SEN(printargs), "posix_waitpid" }, +[3169] = { 0, 0, SEN(printargs), "posix_dup2" }, +[3170 ... 3259] = { }, +[3260] = { 0, 0, SEN(printargs), "posix_netboot" }, +[3261] = { 0, 0, SEN(printargs), "posix_netunboot" }, +[3262] = { 0, 0, SEN(printargs), "posix_rdump" }, +[3263] = { 0, 0, SEN(printargs), "posix_setsid" }, +[3264] = { 0, 0, SEN(printargs), "posix_getmaxsig" }, +[3265] = { 0, 0, SEN(printargs), "posix_sigpending" }, +[3266] = { 0, 0, SEN(printargs), "posix_sigprocmask" }, +[3267] = { 0, 0, SEN(printargs), "posix_sigsuspend" }, +[3268] = { 0, 0, SEN(printargs), "posix_sigaction" }, diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h index ba7c84f3..c93c33bd 100644 --- a/linux/mips/syscallent-n32.h +++ b/linux/mips/syscallent-n32.h @@ -1,636 +1,341 @@ #if defined LINUX_MIPSN32 - /* For an N32 strace decode the N32 64-bit syscalls. */ - { 3, TD, sys_read, "read" }, /* 6000 */ /* start of Linux N32 */ - { 3, TD, sys_write, "write" }, /* 6001 */ - { 3, TD|TF, sys_open, "open" }, /* 6002 */ - { 1, TD, sys_close, "close" }, /* 6003 */ - { 2, TF, sys_stat64, "stat" }, /* 6004 */ - { 2, TD, sys_fstat64, "fstat" }, /* 6005 */ - { 2, TF, sys_lstat64, "lstat" }, /* 6006 */ - { 3, TD, sys_poll, "poll" }, /* 6007 */ - { 3, TD, sys_lseek, "lseek" }, /* 6008 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 6009 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 6010 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 6011 */ - { 1, TM|SI, sys_brk, "brk" }, /* 6012 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 6013 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 6014 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 6015 */ - { 4, TD, sys_pread, "pread64" }, /* 6016 */ - { 4, TD, sys_pwrite, "pwrite64" }, /* 6017 */ - { 3, TD, sys_readv, "readv" }, /* 6018 */ - { 3, TD, sys_writev, "writev" }, /* 6019 */ - { 2, TF, sys_access, "access" }, /* 6020 */ - { 1, TD, sys_pipe, "pipe" }, /* 6021 */ - { 5, TD, sys_select, "_newselect" }, /* 6022 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 6023 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 6024 */ - { 3, TM, sys_msync, "msync" }, /* 6025 */ - { 3, TM, sys_mincore, "mincore" }, /* 6026 */ - { 3, TM, sys_madvise, "madvise" }, /* 6027 */ - { 3, TI, sys_shmget, "shmget" }, /* 6028 */ - { 3, TI|TM|SI, sys_shmat, "shmat" }, /* 6029 */ - { 3, TI, sys_shmctl, "shmctl" }, /* 6030 */ - { 1, TD, sys_dup, "dup" }, /* 6031 */ - { 2, TD, sys_dup2, "dup2" }, /* 6032 */ - { 0, TS, sys_pause, "pause" }, /* 6033 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 6034 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 6035 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 6036 */ - { 1, 0, sys_alarm, "alarm" }, /* 6037 */ - { 0, 0, sys_getpid, "getpid" }, /* 6038 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 6039 */ - { 3, TN, sys_socket, "socket" }, /* 6040 */ - { 3, TN, sys_connect, "connect" }, /* 6041 */ - { 3, TN, sys_accept, "accept" }, /* 6042 */ - { 6, TN, sys_sendto, "sendto" }, /* 6043 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 6044 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 6045 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 6046 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 6047 */ - { 3, TN, sys_bind, "bind" }, /* 6048 */ - { 2, TN, sys_listen, "listen" }, /* 6049 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 6050 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 6051 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 6052 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 6053 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 6054 */ - { 5, TP, sys_clone, "clone" }, /* 6055 */ - { 0, TP, sys_fork, "fork" }, /* 6056 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 6057 */ - { 1, TP|SE, sys_exit, "exit" }, /* 6058 */ - { 4, TP, sys_wait4, "wait4" }, /* 6059 */ - { 2, TS, sys_kill, "kill" }, /* 6060 */ - { 1, 0, sys_uname, "uname" }, /* 6061 */ - { 3, TI, sys_semget, "semget" }, /* 6062 */ - { 3, TI, printargs, "semop" }, /* 6063 */ - { 4, TI, sys_semctl, "semctl" }, /* 6064 */ - { 1, TI|TM|SI, sys_shmdt, "shmdt" }, /* 6065 */ - { 2, TI, sys_msgget, "msgget" }, /* 6066 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 6067 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 6068 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 6069 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 6070 */ - { 2, TD, sys_flock, "flock" }, /* 6071 */ - { 1, TD, sys_fsync, "fsync" }, /* 6072 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 6073 */ - { 2, TF, sys_truncate64, "truncate" }, /* 6074 */ - { 2, TD, sys_ftruncate64, "ftruncate" }, /* 6075 */ - { 3, TD, sys_getdents, "getdents" }, /* 6076 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 6077 */ - { 1, TF, sys_chdir, "chdir" }, /* 6078 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 6079 */ - { 2, TF, sys_rename, "rename" }, /* 6080 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 6081 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 6082 */ - { 2, TD|TF, sys_creat, "creat" }, /* 6083 */ - { 2, TF, sys_link, "link" }, /* 6084 */ - { 1, TF, sys_unlink, "unlink" }, /* 6085 */ - { 2, TF, sys_symlink, "symlink" }, /* 6086 */ - { 3, TF, sys_readlink, "readlink" }, /* 6087 */ - { 2, TF, sys_chmod, "chmod" }, /* 6088 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 6089 */ - { 3, TF, sys_chown, "chown" }, /* 6090 */ - { 3, TD, sys_fchown, "fchown" }, /* 6091 */ - { 3, TF, sys_chown, "lchown" }, /* 6092 */ - { 1, 0, sys_umask, "umask" }, /* 6093 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 6094 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 6095 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 6096 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 6097 */ - { 1, 0, sys_times, "times" }, /* 6098 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 6099 */ - { 0, NF, sys_getuid, "getuid" }, /* 6100 */ - { 3, 0, sys_syslog, "syslog" }, /* 6101 */ - { 0, NF, sys_getgid, "getgid" }, /* 6102 */ - { 1, 0, sys_setuid, "setuid" }, /* 6103 */ - { 1, 0, sys_setgid, "setgid" }, /* 6104 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 6105 */ - { 0, NF, sys_getegid, "getegid" }, /* 6106 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 6107 */ - { 0, 0, sys_getppid, "getppid" }, /* 6108 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 6109 */ - { 0, 0, sys_setsid, "setsid" }, /* 6110 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 6111 */ - { 2, 0, sys_setregid, "setregid" }, /* 6112 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 6113 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 6114 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 6115 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 6116 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 6117 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 6118 */ - { 0, 0, sys_getpgid, "getpgid" }, /* 6119 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 6120 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 6121 */ - { 1, 0, sys_getsid, "getsid" }, /* 6122 */ - { 2, 0, sys_capget, "capget" }, /* 6123 */ - { 2, 0, sys_capset, "capset" }, /* 6124 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 6125 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"},/* 6126 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"},/* 6127 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 6128 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 6129 */ - { 2, TF, sys_utime, "utime" }, /* 6130 */ - { 3, TF, sys_mknod, "mknod" }, /* 6131 */ - { 1, 0, sys_personality, "personality" }, /* 6132 */ - { 2, 0, sys_ustat, "ustat" }, /* 6133 */ - { 3, TF, sys_statfs, "statfs" }, /* 6134 */ - { 3, TD, sys_fstatfs, "fstatfs" }, /* 6135 */ - { 5, 0, sys_sysfs, "sysfs" }, /* 6136 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 6137 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 6138 */ - { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 6139 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 6140 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 6141 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 6142 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 6143 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 6144 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 6145 */ - { 2, TM, sys_mlock, "mlock" }, /* 6146 */ - { 2, TM, sys_munlock, "munlock" }, /* 6147 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 6148 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 6149 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 6150 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 6151 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 6152 */ - { 5, 0, sys_prctl, "prctl" }, /* 6153 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 6154 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 6155 */ - { 1, TF, sys_chroot, "chroot" }, /* 6156 */ - { 0, 0, sys_sync, "sync" }, /* 6157 */ - { 1, TF, sys_acct, "acct" }, /* 6158 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 6159 */ - { 5, TF, sys_mount, "mount" }, /* 6160 */ - { 2, TF, sys_umount2, "umount2" }, /* 6161 */ - { 2, TF, sys_swapon, "swapon" }, /* 6162 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 6163 */ - { 4, 0, sys_reboot, "reboot" }, /* 6164 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 6165 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 6166 */ - { 2, 0, sys_create_module, "create_module" }, /* 6167 */ - { 4, 0, sys_init_module, "init_module" }, /* 6168 */ - { 1, 0, sys_delete_module, "delete_module" }, /* 6169 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 6170 */ - { 5, 0, sys_query_module, "query_module" }, /* 6171 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 6172 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 6173 */ - { 5, TN, printargs, "getpmsg" }, /* 6174 */ - { 5, TN, printargs, "putpmsg" }, /* 6175 */ - { 0, 0, sys_afs_syscall, "afs_syscall" }, /* 6176 */ - { 0, 0, printargs, "reserved177" }, /* 6177 */ - { 0, 0, sys_gettid, "gettid" }, /* 6178 */ - { 3, TD, sys_readahead, "readahead" }, /* 6179 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 6180 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 6181 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 6182 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 6183 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 6184 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 6185 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 6186 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 6187 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 6188 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 6189 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 6190 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 6191 */ - { 2, TS, sys_kill, "tkill" }, /* 6192 */ - { 1, 0, sys_time, "time" }, /* 6193 */ - { 6, 0, sys_futex, "futex" }, /* 6194 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 6195 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 6196 */ - { 3, 0, printargs, "cacheflush" }, /* 6197 */ - { 3, 0, printargs, "cachectl" }, /* 6198 */ - { 4, 0, sys_sysmips, "sysmips" }, /* 6199 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 6200 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 6201 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 6202 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 6203 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 6204 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 6205 */ - { 3, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 6206 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 6207 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 6208 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 6209 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 6210 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 6211 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 6212 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 6213 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 6214 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 6215 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 6216 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 6217 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 6218 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 6219 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 6220 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 6221 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 6222 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 6223 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 6224 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 6225 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 6226 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 6227 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 6228 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 6229 */ - { 2, TF, sys_utimes, "utimes" }, /* 6230 */ - { 6, TM, sys_mbind, "mbind" }, /* 6231 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 6232 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 6233 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 6234 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 6235 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 6236 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 6237 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 6238 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 6239 */ - { 5, 0, sys_vserver, "vserver" }, /* 6240 */ - { 5, TP, sys_waitid, "waitid" }, /* 6241 */ - [6242] = { }, - { 5, 0, sys_add_key, "add_key" }, /* 6243 */ - { 4, 0, sys_request_key, "request_key" }, /* 6244 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 6245 */ - { 1, 0, sys_set_thread_area, "set_thread_area" }, /* 6246 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 6247 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 6248 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 6249 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 6250 */ - { 4, TD|TF, sys_openat, "openat" }, /* 6251 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 6252 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 6253 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 6254 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 6255 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 6256 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 6257 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 6258 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 6259 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 6260 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 6261 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 6262 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 6263 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 6264 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 6265 */ - { 1, TP, sys_unshare, "unshare" }, /* 6266 */ - { 6, TD, sys_splice, "splice" }, /* 6267 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 6268 */ - { 4, TD, sys_tee, "tee" }, /* 6269 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 6270 */ - { 6, TM, printargs, "move_pages" }, /* 6271 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 6272 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 6273 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 6274 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 6275 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 6276 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 6277 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 6278 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 6279 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 6280 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 6281 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 6282 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 6283 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 6284 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 6285 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 6286 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 6287 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 6288 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 6289 */ - { 3, TD, sys_dup3, "dup3" }, /* 6290 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 6291 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 6292 */ - { 4, TD, sys_preadv, "preadv" }, /* 6293 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 6294 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 6295 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 6296 */ - { 4, TN, sys_accept4, "accept4" }, /* 6297 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 6298 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 6299 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 6300 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 6301 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 6302 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 6303 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 6304 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 6305 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 6306 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 6307 */ - { 2, TD, sys_setns, "setns" }, /* 6308 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 6309 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 6310 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 6311 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 6312 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 6313 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 6314 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 6315 */ +/* For an N32 strace decode the N32 64-bit syscalls. */ +[6000] = { 3, TD, SEN(read), "read" }, /* start of Linux N32 */ +[6001] = { 3, TD, SEN(write), "write" }, +[6002] = { 3, TD|TF, SEN(open), "open" }, +[6003] = { 1, TD, SEN(close), "close" }, +[6004] = { 2, TF, SEN(stat64), "stat" }, +[6005] = { 2, TD, SEN(fstat64), "fstat" }, +[6006] = { 2, TF, SEN(lstat64), "lstat" }, +[6007] = { 3, TD, SEN(poll), "poll" }, +[6008] = { 3, TD, SEN(lseek), "lseek" }, +[6009] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[6010] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[6011] = { 2, TM|SI, SEN(munmap), "munmap" }, +[6012] = { 1, TM|SI, SEN(brk), "brk" }, +[6013] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[6014] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[6015] = { 3, TD, SEN(ioctl), "ioctl" }, +[6016] = { 4, TD, SEN(pread), "pread64" }, +[6017] = { 4, TD, SEN(pwrite), "pwrite64" }, +[6018] = { 3, TD, SEN(readv), "readv" }, +[6019] = { 3, TD, SEN(writev), "writev" }, +[6020] = { 2, TF, SEN(access), "access" }, +[6021] = { 0, TD, SEN(pipe), "pipe" }, +[6022] = { 5, TD, SEN(select), "_newselect" }, +[6023] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[6024] = { 5, TM|SI, SEN(mremap), "mremap" }, +[6025] = { 3, TM, SEN(msync), "msync" }, +[6026] = { 3, TM, SEN(mincore), "mincore" }, +[6027] = { 3, TM, SEN(madvise), "madvise" }, +[6028] = { 3, TI, SEN(shmget), "shmget" }, +[6029] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[6030] = { 3, TI, SEN(shmctl), "shmctl" }, +[6031] = { 1, TD, SEN(dup), "dup" }, +[6032] = { 2, TD, SEN(dup2), "dup2" }, +[6033] = { 0, TS, SEN(pause), "pause" }, +[6034] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[6035] = { 2, 0, SEN(getitimer), "getitimer" }, +[6036] = { 3, 0, SEN(setitimer), "setitimer" }, +[6037] = { 1, 0, SEN(alarm), "alarm" }, +[6038] = { 0, NF, SEN(getpid), "getpid" }, +[6039] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[6040] = { 3, TN, SEN(socket), "socket" }, +[6041] = { 3, TN, SEN(connect), "connect" }, +[6042] = { 3, TN, SEN(accept), "accept" }, +[6043] = { 6, TN, SEN(sendto), "sendto" }, +[6044] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[6045] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[6046] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[6047] = { 2, TN, SEN(shutdown), "shutdown" }, +[6048] = { 3, TN, SEN(bind), "bind" }, +[6049] = { 2, TN, SEN(listen), "listen" }, +[6050] = { 3, TN, SEN(getsockname), "getsockname" }, +[6051] = { 3, TN, SEN(getpeername), "getpeername" }, +[6052] = { 4, TN, SEN(socketpair), "socketpair" }, +[6053] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[6054] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[6055] = { 5, TP, SEN(clone), "clone" }, +[6056] = { 0, TP, SEN(fork), "fork" }, +[6057] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[6058] = { 1, TP|SE, SEN(exit), "exit" }, +[6059] = { 4, TP, SEN(wait4), "wait4" }, +[6060] = { 2, TS, SEN(kill), "kill" }, +[6061] = { 1, 0, SEN(uname), "uname" }, +[6062] = { 3, TI, SEN(semget), "semget" }, +[6063] = { 3, TI, SEN(semop), "semop" }, +[6064] = { 4, TI, SEN(semctl), "semctl" }, +[6065] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[6066] = { 2, TI, SEN(msgget), "msgget" }, +[6067] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[6068] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[6069] = { 3, TI, SEN(msgctl), "msgctl" }, +[6070] = { 3, TD, SEN(fcntl), "fcntl" }, +[6071] = { 2, TD, SEN(flock), "flock" }, +[6072] = { 1, TD, SEN(fsync), "fsync" }, +[6073] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[6074] = { 2, TF, SEN(truncate64), "truncate" }, +[6075] = { 2, TD, SEN(ftruncate64), "ftruncate" }, +[6076] = { 3, TD, SEN(getdents), "getdents" }, +[6077] = { 2, TF, SEN(getcwd), "getcwd" }, +[6078] = { 1, TF, SEN(chdir), "chdir" }, +[6079] = { 1, TD, SEN(fchdir), "fchdir" }, +[6080] = { 2, TF, SEN(rename), "rename" }, +[6081] = { 2, TF, SEN(mkdir), "mkdir" }, +[6082] = { 1, TF, SEN(rmdir), "rmdir" }, +[6083] = { 2, TD|TF, SEN(creat), "creat" }, +[6084] = { 2, TF, SEN(link), "link" }, +[6085] = { 1, TF, SEN(unlink), "unlink" }, +[6086] = { 2, TF, SEN(symlink), "symlink" }, +[6087] = { 3, TF, SEN(readlink), "readlink" }, +[6088] = { 2, TF, SEN(chmod), "chmod" }, +[6089] = { 2, TD, SEN(fchmod), "fchmod" }, +[6090] = { 3, TF, SEN(chown), "chown" }, +[6091] = { 3, TD, SEN(fchown), "fchown" }, +[6092] = { 3, TF, SEN(chown), "lchown" }, +[6093] = { 1, NF, SEN(umask), "umask" }, +[6094] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[6095] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[6096] = { 2, 0, SEN(getrusage), "getrusage" }, +[6097] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[6098] = { 1, 0, SEN(times), "times" }, +[6099] = { 4, 0, SEN(ptrace), "ptrace" }, +[6100] = { 0, NF, SEN(getuid), "getuid" }, +[6101] = { 3, 0, SEN(syslog), "syslog" }, +[6102] = { 0, NF, SEN(getgid), "getgid" }, +[6103] = { 1, 0, SEN(setuid), "setuid" }, +[6104] = { 1, 0, SEN(setgid), "setgid" }, +[6105] = { 0, NF, SEN(geteuid), "geteuid" }, +[6106] = { 0, NF, SEN(getegid), "getegid" }, +[6107] = { 2, 0, SEN(setpgid), "setpgid" }, +[6108] = { 0, NF, SEN(getppid), "getppid" }, +[6109] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[6110] = { 0, 0, SEN(setsid), "setsid" }, +[6111] = { 2, 0, SEN(setreuid), "setreuid" }, +[6112] = { 2, 0, SEN(setregid), "setregid" }, +[6113] = { 2, 0, SEN(getgroups), "getgroups" }, +[6114] = { 2, 0, SEN(setgroups), "setgroups" }, +[6115] = { 3, 0, SEN(setresuid), "setresuid" }, +[6116] = { 3, 0, SEN(getresuid), "getresuid" }, +[6117] = { 3, 0, SEN(setresgid), "setresgid" }, +[6118] = { 3, 0, SEN(getresgid), "getresgid" }, +[6119] = { 1, 0, SEN(getpgid), "getpgid" }, +[6120] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[6121] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[6122] = { 1, 0, SEN(getsid), "getsid" }, +[6123] = { 2, 0, SEN(capget), "capget" }, +[6124] = { 2, 0, SEN(capset), "capset" }, +[6125] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[6126] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[6127] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[6128] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[6129] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[6130] = { 2, TF, SEN(utime), "utime" }, +[6131] = { 3, TF, SEN(mknod), "mknod" }, +[6132] = { 1, NF, SEN(personality), "personality" }, +[6133] = { 2, 0, SEN(ustat), "ustat" }, +[6134] = { 2, TF, SEN(statfs), "statfs" }, +[6135] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[6136] = { 3, 0, SEN(sysfs), "sysfs" }, +[6137] = { 2, 0, SEN(getpriority), "getpriority" }, +[6138] = { 3, 0, SEN(setpriority), "setpriority" }, +[6139] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[6140] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[6141] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[6142] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[6143] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[6144] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[6145] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[6146] = { 2, TM, SEN(mlock), "mlock" }, +[6147] = { 2, TM, SEN(munlock), "munlock" }, +[6148] = { 1, TM, SEN(mlockall), "mlockall" }, +[6149] = { 0, TM, SEN(munlockall), "munlockall" }, +[6150] = { 0, 0, SEN(vhangup), "vhangup" }, +[6151] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[6152] = { 1, 0, SEN(sysctl), "_sysctl" }, +[6153] = { 5, 0, SEN(prctl), "prctl" }, +[6154] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[6155] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[6156] = { 1, TF, SEN(chroot), "chroot" }, +[6157] = { 0, 0, SEN(sync), "sync" }, +[6158] = { 1, TF, SEN(acct), "acct" }, +[6159] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[6160] = { 5, TF, SEN(mount), "mount" }, +[6161] = { 2, TF, SEN(umount2), "umount2" }, +[6162] = { 2, TF, SEN(swapon), "swapon" }, +[6163] = { 1, TF, SEN(swapoff), "swapoff" }, +[6164] = { 4, 0, SEN(reboot), "reboot" }, +[6165] = { 2, 0, SEN(sethostname), "sethostname" }, +[6166] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[6167] = { 2, 0, SEN(create_module), "create_module" }, +[6168] = { 3, 0, SEN(init_module), "init_module" }, +[6169] = { 2, 0, SEN(delete_module), "delete_module" }, +[6170] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[6171] = { 5, 0, SEN(query_module), "query_module" }, +[6172] = { 4, TF, SEN(quotactl), "quotactl" }, +[6173] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[6174] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[6175] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[6176] = { 0, 0, SEN(afs_syscall), "afs_syscall" }, +[6177] = { 0, 0, SEN(printargs), "reserved177" }, +[6178] = { 0, NF, SEN(gettid), "gettid" }, +[6179] = { 3, TD, SEN(readahead), "readahead" }, +[6180] = { 5, TF, SEN(setxattr), "setxattr" }, +[6181] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[6182] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[6183] = { 4, TF, SEN(getxattr), "getxattr" }, +[6184] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[6185] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[6186] = { 3, TF, SEN(listxattr), "listxattr" }, +[6187] = { 3, TF, SEN(listxattr), "llistxattr" }, +[6188] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[6189] = { 2, TF, SEN(removexattr), "removexattr" }, +[6190] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[6191] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[6192] = { 2, TS, SEN(kill), "tkill" }, +[6193] = { 1, 0, SEN(time), "time" }, +[6194] = { 6, 0, SEN(futex), "futex" }, +[6195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[6196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[6197] = { 3, 0, SEN(printargs), "cacheflush" }, +[6198] = { 3, 0, SEN(printargs), "cachectl" }, +[6199] = { 4, 0, SEN(sysmips), "sysmips" }, +[6200] = { 2, TM, SEN(io_setup), "io_setup" }, +[6201] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[6202] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[6203] = { 3, 0, SEN(io_submit), "io_submit" }, +[6204] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[6205] = { 1, TP|SE, SEN(exit), "exit_group" }, +[6206] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[6207] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[6208] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[6209] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[6210] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[6211] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[6212] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[6213] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[6214] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[6215] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[6216] = { 4, TD, SEN(fadvise64_64), "fadvise64" }, +[6217] = { 3, TF, SEN(statfs64), "statfs64" }, +[6218] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[6219] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[6220] = { 3, 0, SEN(timer_create), "timer_create" }, +[6221] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[6222] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[6223] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[6224] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[6225] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[6226] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[6227] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[6228] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[6229] = { 3, TS, SEN(tgkill), "tgkill" }, +[6230] = { 2, TF, SEN(utimes), "utimes" }, +[6231] = { 6, TM, SEN(mbind), "mbind" }, +[6232] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[6233] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[6234] = { 4, 0, SEN(mq_open), "mq_open" }, +[6235] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[6236] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[6237] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[6238] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[6239] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[6240] = { 5, 0, SEN(vserver), "vserver" }, +[6241] = { 5, TP, SEN(waitid), "waitid" }, +[6242] = { }, +[6243] = { 5, 0, SEN(add_key), "add_key" }, +[6244] = { 4, 0, SEN(request_key), "request_key" }, +[6245] = { 5, 0, SEN(keyctl), "keyctl" }, +[6246] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[6247] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[6248] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[6249] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[6250] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[6251] = { 4, TD|TF, SEN(openat), "openat" }, +[6252] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[6253] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[6254] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[6255] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[6256] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[6257] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[6258] = { 4, TD|TF, SEN(renameat), "renameat" }, +[6259] = { 5, TD|TF, SEN(linkat), "linkat" }, +[6260] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[6261] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[6262] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[6263] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[6264] = { 6, TD, SEN(pselect6), "pselect6" }, +[6265] = { 5, TD, SEN(ppoll), "ppoll" }, +[6266] = { 1, TP, SEN(unshare), "unshare" }, +[6267] = { 6, TD, SEN(splice), "splice" }, +[6268] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[6269] = { 4, TD, SEN(tee), "tee" }, +[6270] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[6271] = { 6, TM, SEN(move_pages), "move_pages" }, +[6272] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[6273] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[6274] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[6275] = { 3, 0, SEN(getcpu), "getcpu" }, +[6276] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[6277] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[6278] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[6279] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[6280] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[6281] = { 4, TD, SEN(timerfd), "timerfd" }, +[6282] = { 1, TD, SEN(eventfd), "eventfd" }, +[6283] = { 4, TD, SEN(fallocate), "fallocate" }, +[6284] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[6285] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[6286] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[6287] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[6288] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[6289] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[6290] = { 3, TD, SEN(dup3), "dup3" }, +[6291] = { 2, TD, SEN(pipe2), "pipe2" }, +[6292] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[6293] = { 4, TD, SEN(preadv), "preadv" }, +[6294] = { 4, TD, SEN(pwritev), "pwritev" }, +[6295] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[6296] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[6297] = { 4, TN, SEN(accept4), "accept4" }, +[6298] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[6299] = { 3, TD, SEN(getdents64), "getdents64" }, +[6300] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[6301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[6302] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[6303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[6304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[6305] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[6306] = { 1, TD, SEN(syncfs), "syncfs" }, +[6307] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[6308] = { 2, TD, SEN(setns), "setns" }, +[6309] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[6310] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[6311] = { 5, 0, SEN(kcmp), "kcmp" }, +[6312] = { 3, TD, SEN(finit_module), "finit_module" }, +[6313] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[6314] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[6315] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[6316] = { 3, 0, SEN(seccomp), "seccomp" }, +[6317] = { 3, 0, SEN(getrandom), "getrandom" }, +[6318] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[6319] = { 3, TD, SEN(bpf), "bpf" }, +[6320] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[6321] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[6322] = { 2, 0, SEN(membarrier), "membarrier" }, +[6323] = { 3, TM, SEN(mlock2), "mlock2" }, +[6324] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[6325] = { 6, TD, SEN(preadv2), "preadv2" }, +[6326] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[6327] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[6328] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[6329] = { 1, 0, SEN(pkey_free), "pkey_free" }, + +# define SYS_socket_subcall 6400 +# include "subcall.h" + #else - { 0, 0, printargs, "n32_read" }, /* 6000 */ - { 0, 0, printargs, "n32_write" }, /* 6001 */ - { 0, 0, printargs, "n32_open" }, /* 6002 */ - { 0, 0, printargs, "n32_close" }, /* 6003 */ - { 0, 0, printargs, "n32_stat" }, /* 6004 */ - { 0, 0, printargs, "n32_fstat" }, /* 6005 */ - { 0, 0, printargs, "n32_lstat" }, /* 6006 */ - { 0, 0, printargs, "n32_poll" }, /* 6007 */ - { 0, 0, printargs, "n32_lseek" }, /* 6008 */ - { 0, TD|TM|SI, printargs, "n32_mmap" }, /* 6009 */ - { 0, TM|SI, printargs, "n32_mprotect" }, /* 6010 */ - { 0, TM|SI, printargs, "n32_munmap" }, /* 6011 */ - { 0, TM|SI, printargs, "n32_brk" }, /* 6012 */ - { 0, 0, printargs, "n32_rt_sigaction" }, /* 6013 */ - { 0, 0, printargs, "n32_rt_sigprocmask" }, /* 6014 */ - { 0, 0, printargs, "n32_ioctl" }, /* 6015 */ - { 0, 0, printargs, "n32_pread64" }, /* 6016 */ - { 0, 0, printargs, "n32_pwrite64" }, /* 6017 */ - { 0, 0, printargs, "n32_readv" }, /* 6018 */ - { 0, 0, printargs, "n32_writev" }, /* 6019 */ - { 0, 0, printargs, "n32_access" }, /* 6020 */ - { 0, 0, printargs, "n32_pipe" }, /* 6021 */ - { 0, 0, printargs, "n32__newselect" }, /* 6022 */ - { 0, 0, printargs, "n32_sched_yield" }, /* 6023 */ - { 0, TM|SI, printargs, "n32_mremap" }, /* 6024 */ - { 0, TM, printargs, "n32_msync" }, /* 6025 */ - { 0, TM, printargs, "n32_mincore" }, /* 6026 */ - { 0, TM, printargs, "n32_madvise" }, /* 6027 */ - { 0, 0, printargs, "n32_shmget" }, /* 6028 */ - { 0, TI|TM|SI, printargs, "n32_shmat" }, /* 6029 */ - { 0, 0, printargs, "n32_shmctl" }, /* 6030 */ - { 0, 0, printargs, "n32_dup" }, /* 6031 */ - { 0, 0, printargs, "n32_dup2" }, /* 6032 */ - { 0, 0, printargs, "n32_pause" }, /* 6033 */ - { 0, 0, printargs, "n32_nanosleep" }, /* 6034 */ - { 0, 0, printargs, "n32_getitimer" }, /* 6035 */ - { 0, 0, printargs, "n32_setitimer" }, /* 6036 */ - { 0, 0, printargs, "n32_alarm" }, /* 6037 */ - { 0, 0, printargs, "n32_getpid" }, /* 6038 */ - { 0, 0, printargs, "n32_sendfile" }, /* 6039 */ - { 0, 0, printargs, "n32_socket" }, /* 6040 */ - { 0, 0, printargs, "n32_connect" }, /* 6041 */ - { 0, 0, printargs, "n32_accept" }, /* 6042 */ - { 0, 0, printargs, "n32_sendto" }, /* 6043 */ - { 0, 0, printargs, "n32_recvfrom" }, /* 6044 */ - { 0, 0, printargs, "n32_sendmsg" }, /* 6045 */ - { 0, 0, printargs, "n32_recvmsg" }, /* 6046 */ - { 0, 0, printargs, "n32_shutdown" }, /* 6047 */ - { 0, 0, printargs, "n32_bind" }, /* 6048 */ - { 0, 0, printargs, "n32_listen" }, /* 6049 */ - { 0, 0, printargs, "n32_getsockname" }, /* 6050 */ - { 0, 0, printargs, "n32_getpeername" }, /* 6051 */ - { 0, 0, printargs, "n32_socketpair" }, /* 6052 */ - { 0, 0, printargs, "n32_setsockopt" }, /* 6053 */ - { 0, 0, printargs, "n32_getsockopt" }, /* 6054 */ - { 5, TP, printargs, "n32_clone" }, /* 6055 */ - { 0, TP, printargs, "n32_fork" }, /* 6056 */ - { 3, TF|TP|SE|SI, printargs, "n32_execve" }, /* 6057 */ - { 1, TP|SE, printargs, "n32_exit" }, /* 6058 */ - { 4, TP, printargs, "n32_wait4" }, /* 6059 */ - { 0, 0, printargs, "n32_kill" }, /* 6060 */ - { 0, 0, printargs, "n32_uname" }, /* 6061 */ - { 0, 0, printargs, "n32_semget" }, /* 6062 */ - { 0, 0, printargs, "n32_semop" }, /* 6063 */ - { 0, 0, printargs, "n32_semctl" }, /* 6064 */ - { 0, TI|TM|SI, printargs, "n32_shmdt" }, /* 6065 */ - { 0, 0, printargs, "n32_msgget" }, /* 6066 */ - { 0, 0, printargs, "n32_msgsnd" }, /* 6067 */ - { 0, 0, printargs, "n32_msgrcv" }, /* 6068 */ - { 0, 0, printargs, "n32_msgctl" }, /* 6069 */ - { 0, 0, printargs, "n32_fcntl" }, /* 6070 */ - { 0, 0, printargs, "n32_flock" }, /* 6071 */ - { 0, 0, printargs, "n32_fsync" }, /* 6072 */ - { 0, 0, printargs, "n32_fdatasync" }, /* 6073 */ - { 0, 0, printargs, "n32_truncate" }, /* 6074 */ - { 0, 0, printargs, "n32_ftruncate" }, /* 6075 */ - { 0, 0, printargs, "n32_getdents" }, /* 6076 */ - { 0, 0, printargs, "n32_getcwd" }, /* 6077 */ - { 0, 0, printargs, "n32_chdir" }, /* 6078 */ - { 0, 0, printargs, "n32_fchdir" }, /* 6079 */ - { 0, 0, printargs, "n32_rename" }, /* 6080 */ - { 0, 0, printargs, "n32_mkdir" }, /* 6081 */ - { 0, 0, printargs, "n32_rmdir" }, /* 6082 */ - { 0, 0, printargs, "n32_creat" }, /* 6083 */ - { 0, 0, printargs, "n32_link" }, /* 6084 */ - { 0, 0, printargs, "n32_unlink" }, /* 6085 */ - { 0, 0, printargs, "n32_symlink" }, /* 6086 */ - { 0, 0, printargs, "n32_readlink" }, /* 6087 */ - { 0, 0, printargs, "n32_chmod" }, /* 6088 */ - { 0, 0, printargs, "n32_fchmod" }, /* 6089 */ - { 0, 0, printargs, "n32_chown" }, /* 6090 */ - { 0, 0, printargs, "n32_fchown" }, /* 6091 */ - { 0, 0, printargs, "n32_lchown" }, /* 6092 */ - { 0, 0, printargs, "n32_umask" }, /* 6093 */ - { 0, 0, printargs, "n32_gettimeofday" }, /* 6094 */ - { 0, 0, printargs, "n32_getrlimit" }, /* 6095 */ - { 0, 0, printargs, "n32_getrusage" }, /* 6096 */ - { 0, 0, printargs, "n32_sysinfo" }, /* 6097 */ - { 0, 0, printargs, "n32_times" }, /* 6098 */ - { 0, 0, printargs, "n32_ptrace" }, /* 6099 */ - { 0, 0, printargs, "n32_getuid" }, /* 6100 */ - { 0, 0, printargs, "n32_syslog" }, /* 6101 */ - { 0, 0, printargs, "n32_getgid" }, /* 6102 */ - { 0, 0, printargs, "n32_setuid" }, /* 6103 */ - { 0, 0, printargs, "n32_setgid" }, /* 6104 */ - { 0, 0, printargs, "n32_geteuid" }, /* 6105 */ - { 0, 0, printargs, "n32_getegid" }, /* 6106 */ - { 0, 0, printargs, "n32_setpgid" }, /* 6107 */ - { 0, 0, printargs, "n32_getppid" }, /* 6108 */ - { 0, 0, printargs, "n32_getpgrp" }, /* 6109 */ - { 0, 0, printargs, "n32_setsid" }, /* 6110 */ - { 0, 0, printargs, "n32_setreuid" }, /* 6111 */ - { 0, 0, printargs, "n32_setregid" }, /* 6112 */ - { 0, 0, printargs, "n32_getgroups" }, /* 6113 */ - { 0, 0, printargs, "n32_setgroups" }, /* 6114 */ - { 0, 0, printargs, "n32_setresuid" }, /* 6115 */ - { 0, 0, printargs, "n32_getresuid" }, /* 6116 */ - { 0, 0, printargs, "n32_setresgid" }, /* 6117 */ - { 0, 0, printargs, "n32_getresgid" }, /* 6118 */ - { 0, 0, printargs, "n32_getpgid" }, /* 6119 */ - { 0, 0, printargs, "n32_setfsuid" }, /* 6120 */ - { 0, 0, printargs, "n32_setfsgid" }, /* 6121 */ - { 0, 0, printargs, "n32_getsid" }, /* 6122 */ - { 0, 0, printargs, "n32_capget" }, /* 6123 */ - { 0, 0, printargs, "n32_capset" }, /* 6124 */ - { 0, 0, printargs, "n32_rt_sigpending" }, /* 6125 */ - { 0, 0, printargs, "n32_rt_sigtimedwait" }, /* 6126 */ - { 0, 0, printargs, "n32_rt_sigqueueinfo" }, /* 6127 */ - { 0, 0, printargs, "n32_rt_sigsuspend" }, /* 6128 */ - { 0, 0, printargs, "n32_sigaltstack" }, /* 6129 */ - { 0, 0, printargs, "n32_utime" }, /* 6130 */ - { 0, 0, printargs, "n32_mknod" }, /* 6131 */ - { 0, 0, printargs, "n32_personality" }, /* 6132 */ - { 0, 0, printargs, "n32_ustat" }, /* 6133 */ - { 0, 0, printargs, "n32_statfs" }, /* 6134 */ - { 0, 0, printargs, "n32_fstatfs" }, /* 6135 */ - { 0, 0, printargs, "n32_sysfs" }, /* 6136 */ - { 0, 0, printargs, "n32_getpriority" }, /* 6137 */ - { 0, 0, printargs, "n32_setpriority" }, /* 6138 */ - { 0, 0, printargs, "n32_sched_setparam" }, /* 6139 */ - { 0, 0, printargs, "n32_sched_getparam" }, /* 6140 */ - { 0, 0, printargs, "n32_sched_setscheduler"}, /* 6141 */ - { 0, 0, printargs, "n32_sched_getscheduler"}, /* 6142 */ - { 0, 0, printargs, "n32_sched_get_priority_max"}, /* 6143 */ - { 0, 0, printargs, "n32_sched_get_priority_min"}, /* 6144 */ - { 0, 0, printargs, "n32_sched_rr_get_interval"}, /* 6145 */ - { 0, TM, printargs, "n32_mlock" }, /* 6146 */ - { 0, TM, printargs, "n32_munlock" }, /* 6147 */ - { 0, TM, printargs, "n32_mlockall" }, /* 6148 */ - { 0, TM, printargs, "n32_munlockall" }, /* 6149 */ - { 0, 0, printargs, "n32_vhangup" }, /* 6150 */ - { 0, 0, printargs, "n32_pivot_root" }, /* 6151 */ - { 0, 0, printargs, "n32__sysctl" }, /* 6152 */ - { 0, 0, printargs, "n32_prctl" }, /* 6153 */ - { 0, 0, printargs, "n32_adjtimex" }, /* 6154 */ - { 0, 0, printargs, "n32_setrlimit" }, /* 6155 */ - { 0, 0, printargs, "n32_chroot" }, /* 6156 */ - { 0, 0, printargs, "n32_sync" }, /* 6157 */ - { 0, 0, printargs, "n32_acct" }, /* 6158 */ - { 0, 0, printargs, "n32_settimeofday" }, /* 6159 */ - { 0, 0, printargs, "n32_mount" }, /* 6160 */ - { 0, 0, printargs, "n32_umount2" }, /* 6161 */ - { 0, 0, printargs, "n32_swapon" }, /* 6162 */ - { 0, 0, printargs, "n32_swapoff" }, /* 6163 */ - { 0, 0, printargs, "n32_reboot" }, /* 6164 */ - { 0, 0, printargs, "n32_sethostname" }, /* 6165 */ - { 0, 0, printargs, "n32_setdomainname" }, /* 6166 */ - { 0, 0, printargs, "n32_create_module" }, /* 6167 */ - { 0, 0, printargs, "n32_init_module" }, /* 6168 */ - { 0, 0, printargs, "n32_delete_module" }, /* 6169 */ - { 0, 0, printargs, "n32_get_kernel_syms" }, /* 6170 */ - { 0, 0, printargs, "n32_query_module" }, /* 6171 */ - { 0, TF, printargs, "n32_quotactl" }, /* 6172 */ - { 0, 0, printargs, "n32_nfsservctl" }, /* 6173 */ - { 0, 0, printargs, "n32_getpmsg" }, /* 6174 */ - { 0, 0, printargs, "n32_putpmsg" }, /* 6175 */ - { 0, 0, printargs, "n32_afs_syscall" }, /* 6176 */ - { 0, 0, printargs, "n32_reserved177" }, /* 6177 */ - { 0, 0, printargs, "n32_gettid" }, /* 6178 */ - { 0, 0, printargs, "n32_readahead" }, /* 6179 */ - { 0, 0, printargs, "n32_setxattr" }, /* 6180 */ - { 0, 0, printargs, "n32_lsetxattr" }, /* 6181 */ - { 0, 0, printargs, "n32_fsetxattr" }, /* 6182 */ - { 0, 0, printargs, "n32_getxattr" }, /* 6183 */ - { 0, 0, printargs, "n32_lgetxattr" }, /* 6184 */ - { 0, 0, printargs, "n32_fgetxattr" }, /* 6185 */ - { 0, 0, printargs, "n32_listxattr" }, /* 6186 */ - { 0, 0, printargs, "n32_llistxattr" }, /* 6187 */ - { 0, 0, printargs, "n32_flistxattr" }, /* 6188 */ - { 0, 0, printargs, "n32_removexattr" }, /* 6189 */ - { 0, 0, printargs, "n32_lremovexattr" }, /* 6190 */ - { 0, 0, printargs, "n32_fremovexattr" }, /* 6191 */ - { 0, 0, printargs, "n32_tkill" }, /* 6192 */ - { 0, 0, printargs, "n32_time" }, /* 6193 */ - { 0, 0, printargs, "n32_futex" }, /* 6194 */ - { 0, 0, printargs, "n32_sched_setaffinity" }, /* 6195 */ - { 0, 0, printargs, "n32_sched_getaffinity" }, /* 6196 */ - { 0, 0, printargs, "n32_cacheflush" }, /* 6197 */ - { 0, 0, printargs, "n32_cachectl" }, /* 6198 */ - { 0, 0, printargs, "n32_sysmips" }, /* 6199 */ - { 0, 0, printargs, "n32_io_setup" }, /* 6200 */ - { 0, 0, printargs, "n32_io_destroy" }, /* 6201 */ - { 0, 0, printargs, "n32_io_getevents" }, /* 6202 */ - { 0, 0, printargs, "n32_io_submit" }, /* 6203 */ - { 0, 0, printargs, "n32_io_cancel" }, /* 6204 */ - { 1, TP|SE, printargs, "n32_exit_group" }, /* 6205 */ - { 0, 0, printargs, "n32_lookup_dcookie" }, /* 6206 */ - { 0, 0, printargs, "n32_epoll_create" }, /* 6207 */ - { 0, 0, printargs, "n32_epoll_ctl" }, /* 6208 */ - { 0, 0, printargs, "n32_epoll_wait" }, /* 6209 */ - { 0, TM|SI, printargs, "n32_remap_file_pages" }, /* 6210 */ - { 0, 0, printargs, "n32_rt_sigreturn" }, /* 6211 */ - { 0, 0, printargs, "n32_fcntl64" }, /* 6212 */ - { 0, 0, printargs, "n32_set_tid_address" }, /* 6213 */ - { 0, 0, printargs, "n32_restart_syscall" }, /* 6214 */ - { 0, 0, printargs, "n32_semtimedop" }, /* 6215 */ - { 0, 0, printargs, "n32_fadvise64" }, /* 6216 */ - { 0, 0, printargs, "n32_statfs64" }, /* 6217 */ - { 0, 0, printargs, "n32_fstatfs64" }, /* 6218 */ - { 0, 0, printargs, "n32_sendfile64" }, /* 6219 */ - { 3, 0, printargs, "n32_timer_create" }, /* 6220 */ - { 4, 0, printargs, "n32_timer_settime" }, /* 6221 */ - { 2, 0, printargs, "n32_timer_gettime" }, /* 6222 */ - { 1, 0, printargs, "n32_timer_getoverrun" }, /* 6223 */ - { 1, 0, printargs, "n32_timer_delete" }, /* 6224 */ - { 2, 0, printargs, "n32_clock_settime" }, /* 6225 */ - { 2, 0, printargs, "n32_clock_gettime" }, /* 6226 */ - { 2, 0, printargs, "n32_clock_getres" }, /* 6227 */ - { 4, 0, printargs, "n32_clock_nanosleep" }, /* 6228 */ - { 3, 0, printargs, "n32_tgkill" }, /* 6229 */ - { 2, 0, printargs, "n32_utimes" }, /* 6230 */ - { 6, TM, printargs, "n32_mbind" }, /* 6231 */ - { 5, TM, printargs, "n32_get_mempolicy" }, /* 6232 */ - { 3, TM, printargs, "n32_set_mempolicy" }, /* 6233 */ - { 4, 0, printargs, "n32_mq_open" }, /* 6234 */ - { 1, 0, printargs, "n32_mq_unlink" }, /* 6235 */ - { 5, 0, printargs, "n32_mq_timedsend" }, /* 6236 */ - { 5, 0, printargs, "n32_mq_timedreceive" }, /* 6237 */ - { 2, 0, printargs, "n32_mq_notify" }, /* 6238 */ - { 3, 0, printargs, "n32_mq_getsetattr" }, /* 6239 */ - { 5, 0, printargs, "n32_vserver" }, /* 6240 */ - { 5, TP, printargs, "n32_waitid" }, /* 6241 */ - { 0, 0, printargs, "n32_SYS_6242" }, /* 6242 */ - { 5, 0, printargs, "n32_add_key" }, /* 6243 */ - { 4, 0, printargs, "n32_request_key" }, /* 6244 */ - { 5, 0, printargs, "n32_keyctl" }, /* 6245 */ - { 1, 0, printargs, "n32_set_thread_area" }, /* 6246 */ - { 0, TD, printargs, "n32_inotify_init" }, /* 6247 */ - { 3, TD, printargs, "n32_inotify_add_watch" }, /* 6248 */ - { 2, TD, printargs, "n32_inotify_rm_watch" }, /* 6249 */ - { 4, TM, printargs, "n32_migrate_pages" }, /* 6250 */ - { 4, TD|TF, printargs, "n32_openat" }, /* 6251 */ - { 3, TD|TF, printargs, "n32_mkdirat" }, /* 6252 */ - { 4, TD|TF, printargs, "n32_mknodat" }, /* 6253 */ - { 5, TD|TF, printargs, "n32_fchownat" }, /* 6254 */ - { 3, TD|TF, printargs, "n32_futimesat" }, /* 6255 */ - { 4, TD|TF, printargs, "n32_newfstatat" }, /* 6256 */ - { 3, TD|TF, printargs, "n32_unlinkat" }, /* 6257 */ - { 4, TD|TF, printargs, "n32_renameat" }, /* 6258 */ - { 5, TD|TF, printargs, "n32_linkat" }, /* 6259 */ - { 3, TD|TF, printargs, "n32_symlinkat" }, /* 6260 */ - { 4, TD|TF, printargs, "n32_readlinkat" }, /* 6261 */ - { 3, TD|TF, printargs, "n32_fchmodat" }, /* 6262 */ - { 3, TD|TF, printargs, "n32_faccessat" }, /* 6263 */ - { 6, TD, printargs, "n32_pselect6" }, /* 6264 */ - { 5, TD, printargs, "n32_ppoll" }, /* 6265 */ - { 1, TP, printargs, "n32_unshare" }, /* 6266 */ - { 6, TD, printargs, "n32_splice" }, /* 6267 */ - { 4, TD, printargs, "n32_sync_file_range" }, /* 6268 */ - { 4, TD, printargs, "n32_tee" }, /* 6269 */ - { 4, TD, printargs, "n32_vmsplice" }, /* 6270 */ - { 6, TM, printargs, "n32_move_pages" }, /* 6271 */ - { 2, 0, printargs, "n32_set_robust_list" }, /* 6272 */ - { 3, 0, printargs, "n32_get_robust_list" }, /* 6273 */ - { 5, 0, printargs, "n32_kexec_load" }, /* 6274 */ - { 3, 0, printargs, "n32_getcpu" }, /* 6275 */ - { 5, TD, printargs, "n32_epoll_pwait" }, /* 6276 */ - { 3, 0, printargs, "n32_ioprio_set" }, /* 6277 */ - { 2, 0, printargs, "n32_ioprio_get" }, /* 6278 */ - { 4, TD|TF, printargs, "n32_utimensat" }, /* 6279 */ - { 3, TD|TS, printargs, "n32_signalfd" }, /* 6280 */ - { 4, TD, printargs, "n32_timerfd" }, /* 6281 */ - { 1, TD, printargs, "n32_eventfd" }, /* 6282 */ - { 6, TD, printargs, "n32_fallocate" }, /* 6283 */ - { 2, TD, printargs, "n32_timerfd_create" }, /* 6284 */ - { 2, TD, printargs, "n32_timerfd_gettime" }, /* 6285 */ - { 4, TD, printargs, "n32_timerfd_settime" }, /* 6286 */ - { 4, TD|TS, printargs, "n32_signalfd4" }, /* 6287 */ - { 2, TD, printargs, "n32_eventfd2" }, /* 6288 */ - { 1, TD, printargs, "n32_epoll_create1" }, /* 6289 */ - { 3, TD, printargs, "n32_dup3" }, /* 6290 */ - { 2, TD, printargs, "n32_pipe2" }, /* 6291 */ - { 1, TD, printargs, "n32_inotify_init1" }, /* 6292 */ - { 5, TD, printargs, "n32_preadv" }, /* 6293 */ - { 5, TD, printargs, "n32_pwritev" }, /* 6294 */ - { 4, TP|TS, printargs, "n32_rt_tgsigqueueinfo" }, /* 6295 */ - { 5, TD, printargs, "n32_perf_event_open" }, /* 6296 */ - { 4, TN, printargs, "n32_accept4" }, /* 6297 */ - { 5, TN, printargs, "n32_recvmmsg" }, /* 6298 */ - { 3, TD, printargs, "n32_getdents64" }, /* 6299 */ - { 2, 0, printargs, "n32_fanotify_init" }, /* 6300 */ - { 5, 0, printargs, "n32_fanotify_mark" }, /* 6301 */ - { 4, 0, printargs, "n32_prlimit64" }, /* 6302 */ - { 5, TD|TF, printargs, "n32_name_to_handle_at" }, /* 6303 */ - { 3, TD, printargs, "n32_open_by_handle_at" }, /* 6304 */ - { 2, 0, printargs, "n32_clock_adjtime" }, /* 6305 */ - { 1, TD, printargs, "n32_syncfs" }, /* 6306 */ - { 4, TN, printargs, "n32_sendmmsg" }, /* 6307 */ - { 2, TD, printargs, "n32_setns" }, /* 6308 */ - { 6, 0, printargs, "n32_process_vm_readv" }, /* 6309 */ - { 6, 0, printargs, "n32_process_vm_writev" }, /* 6310 */ - { 5, 0, printargs, "n32_kcmp" }, /* 6311 */ - { 3, TD, printargs, "n32_finit_module" }, /* 6312 */ - { 3, 0, printargs, "n32_sched_setattr" }, /* 6313 */ - { 4, 0, printargs, "n32_sched_getattr" }, /* 6314 */ - { 5, TD|TF, printargs, "n32_renameat2" }, /* 6315 */ + +# include "syscallent-n32-stub.h" + #endif diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h index 9a4143ef..f14eebfa 100644 --- a/linux/mips/syscallent-n64.h +++ b/linux/mips/syscallent-n64.h @@ -1,629 +1,337 @@ #if defined LINUX_MIPSN64 - /* For an N64 strace decode the N64 64-bit syscalls. */ - { 3, TD, sys_read, "read" }, /* 5000 */ /* start of Linux N64 */ - { 3, TD, sys_write, "write" }, /* 5001 */ - { 3, TD|TF, sys_open, "open" }, /* 5002 */ - { 1, TD, sys_close, "close" }, /* 5003 */ - { 2, TF, sys_stat, "stat" }, /* 5004 */ - { 2, TD, sys_fstat, "fstat" }, /* 5005 */ - { 2, TF, sys_lstat, "lstat" }, /* 5006 */ - { 3, TD, sys_poll, "poll" }, /* 5007 */ - { 3, TD, sys_lseek, "lseek" }, /* 5008 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 5009 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 5010 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 5011 */ - { 1, TM|SI, sys_brk, "brk" }, /* 5012 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 5013 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 5014 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 5015 */ - { 4, TD, sys_pread, "pread64" }, /* 5016 */ - { 4, TD, sys_pwrite, "pwrite64" }, /* 5017 */ - { 3, TD, sys_readv, "readv" }, /* 5018 */ - { 3, TD, sys_writev, "writev" }, /* 5019 */ - { 2, TF, sys_access, "access" }, /* 5020 */ - { 1, TD, sys_pipe, "pipe" }, /* 5021 */ - { 5, TD, sys_select, "_newselect" }, /* 5022 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 5023 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 5024 */ - { 3, TM, sys_msync, "msync" }, /* 5025 */ - { 3, TM, sys_mincore, "mincore" }, /* 5026 */ - { 3, TM, sys_madvise, "madvise" }, /* 5027 */ - { 3, TI, sys_shmget, "shmget" }, /* 5028 */ - { 3, TI|TM|SI, sys_shmat, "shmat" }, /* 5029 */ - { 3, TI, sys_shmctl, "shmctl" }, /* 5030 */ - { 1, TD, sys_dup, "dup" }, /* 5031 */ - { 2, TD, sys_dup2, "dup2" }, /* 5032 */ - { 0, TS, sys_pause, "pause" }, /* 5033 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 5034 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 5035 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 5036 */ - { 1, 0, sys_alarm, "alarm" }, /* 5037 */ - { 0, 0, sys_getpid, "getpid" }, /* 5038 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 5039 */ - { 3, TN, sys_socket, "socket" }, /* 5040 */ - { 3, TN, sys_connect, "connect" }, /* 5041 */ - { 3, TN, sys_accept, "accept" }, /* 5042 */ - { 6, TN, sys_sendto, "sendto" }, /* 5043 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 5044 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 5045 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 5046 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 5047 */ - { 3, TN, sys_bind, "bind" }, /* 5048 */ - { 2, TN, sys_listen, "listen" }, /* 5049 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 5050 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 5051 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 5052 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 5053 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 5054 */ - { 5, TP, sys_clone, "clone" }, /* 5055 */ - { 0, TP, sys_fork, "fork" }, /* 5056 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 5057 */ - { 1, TP|SE, sys_exit, "exit" }, /* 5058 */ - { 4, TP, sys_wait4, "wait4" }, /* 5059 */ - { 2, TS, sys_kill, "kill" }, /* 5060 */ - { 1, 0, sys_uname, "uname" }, /* 5061 */ - { 3, TI, sys_semget, "semget" }, /* 5062 */ - { 3, TI, printargs, "semop" }, /* 5063 */ - { 4, TI, sys_semctl, "semctl" }, /* 5064 */ - { 1, TI|TM|SI, sys_shmdt, "shmdt" }, /* 5065 */ - { 2, TI, sys_msgget, "msgget" }, /* 5066 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 5067 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 5068 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 5069 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 5070 */ - { 2, TD, sys_flock, "flock" }, /* 5071 */ - { 1, TD, sys_fsync, "fsync" }, /* 5072 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 5073 */ - { 2, TF, sys_truncate, "truncate" }, /* 5074 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 5075 */ - { 3, TD, sys_getdents, "getdents" }, /* 5076 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 5077 */ - { 1, TF, sys_chdir, "chdir" }, /* 5078 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 5079 */ - { 2, TF, sys_rename, "rename" }, /* 5080 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 5081 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 5082 */ - { 2, TD|TF, sys_creat, "creat" }, /* 5083 */ - { 2, TF, sys_link, "link" }, /* 5084 */ - { 1, TF, sys_unlink, "unlink" }, /* 5085 */ - { 2, TF, sys_symlink, "symlink" }, /* 5086 */ - { 3, TF, sys_readlink, "readlink" }, /* 5087 */ - { 2, TF, sys_chmod, "chmod" }, /* 5088 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 5089 */ - { 3, TF, sys_chown, "chown" }, /* 5090 */ - { 3, TD, sys_fchown, "fchown" }, /* 5091 */ - { 3, TF, sys_chown, "lchown" }, /* 5092 */ - { 1, 0, sys_umask, "umask" }, /* 5093 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 5094 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 5095 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 5096 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 5097 */ - { 1, 0, sys_times, "times" }, /* 5098 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 5099 */ - { 0, NF, sys_getuid, "getuid" }, /* 5100 */ - { 3, 0, sys_syslog, "syslog" }, /* 5101 */ - { 0, NF, sys_getgid, "getgid" }, /* 5102 */ - { 1, 0, sys_setuid, "setuid" }, /* 5103 */ - { 1, 0, sys_setgid, "setgid" }, /* 5104 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 5105 */ - { 0, NF, sys_getegid, "getegid" }, /* 5106 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 5107 */ - { 0, 0, sys_getppid, "getppid" }, /* 5108 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 5109 */ - { 0, 0, sys_setsid, "setsid" }, /* 5110 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 5111 */ - { 2, 0, sys_setregid, "setregid" }, /* 5112 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 5113 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 5114 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 5115 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 5116 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 5117 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 5118 */ - { 0, 0, sys_getpgid, "getpgid" }, /* 5119 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 5120 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 5121 */ - { 1, 0, sys_getsid, "getsid" }, /* 5122 */ - { 2, 0, sys_capget, "capget" }, /* 5123 */ - { 2, 0, sys_capset, "capset" }, /* 5124 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 5125 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"},/* 5126 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"},/* 5127 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 5128 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 5129 */ - { 2, TF, sys_utime, "utime" }, /* 5130 */ - { 3, TF, sys_mknod, "mknod" }, /* 5131 */ - { 1, 0, sys_personality, "personality" }, /* 5132 */ - { 2, 0, sys_ustat, "ustat" }, /* 5133 */ - { 3, TF, sys_statfs, "statfs" }, /* 5134 */ - { 3, TD, sys_fstatfs, "fstatfs" }, /* 5135 */ - { 5, 0, sys_sysfs, "sysfs" }, /* 5136 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 5137 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 5138 */ - { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 5139 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 5140 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 5141 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 5142 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 5143 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 5144 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 5145 */ - { 2, TM, sys_mlock, "mlock" }, /* 5146 */ - { 2, TM, sys_munlock, "munlock" }, /* 5147 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 5148 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 5149 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 5150 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 5151 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 5152 */ - { 5, 0, sys_prctl, "prctl" }, /* 5153 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 5154 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 5155 */ - { 1, TF, sys_chroot, "chroot" }, /* 5156 */ - { 0, 0, sys_sync, "sync" }, /* 5157 */ - { 1, TF, sys_acct, "acct" }, /* 5158 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 5159 */ - { 5, TF, sys_mount, "mount" }, /* 5160 */ - { 2, TF, sys_umount2, "umount2" }, /* 5161 */ - { 2, TF, sys_swapon, "swapon" }, /* 5162 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 5163 */ - { 4, 0, sys_reboot, "reboot" }, /* 5164 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 5165 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 5166 */ - { 2, 0, sys_create_module, "create_module" }, /* 5167 */ - { 4, 0, sys_init_module, "init_module" }, /* 5168 */ - { 1, 0, sys_delete_module, "delete_module" }, /* 5169 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 5170 */ - { 5, 0, sys_query_module, "query_module" }, /* 5171 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 5172 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 5173 */ - { 5, TN, printargs, "getpmsg" }, /* 5174 */ - { 5, TN, printargs, "putpmsg" }, /* 5175 */ - { 0, 0, sys_afs_syscall, "afs_syscall" }, /* 5176 */ - { 0, 0, printargs, "reserved177" }, /* 5177 */ - { 0, 0, sys_gettid, "gettid" }, /* 5178 */ - { 3, TD, sys_readahead, "readahead" }, /* 5179 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 5180 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 5181 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 5182 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 5183 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 5184 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 5185 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 5186 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 5187 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 5188 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 5189 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 5190 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 5191 */ - { 2, TS, sys_kill, "tkill" }, /* 5192 */ - { 1, 0, sys_time, "time" }, /* 5193 */ - { 6, 0, sys_futex, "futex" }, /* 5194 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 5195 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 5196 */ - { 3, 0, printargs, "cacheflush" }, /* 5197 */ - { 3, 0, printargs, "cachectl" }, /* 5198 */ - { 4, 0, sys_sysmips, "sysmips" }, /* 5199 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 5200 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 5201 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 5202 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 5203 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 5204 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 5205 */ - { 3, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 5206 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 5207 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 5208 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 5209 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 5210 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 5211 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 5212 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 5213 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 5214 */ - { 4, TD, sys_fadvise64_64, "fadvise64_64" }, /* 5215 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 5216 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 5217 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 5218 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 5219 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 5220 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 5221 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 5222 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 5223 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 5224 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 5225 */ - { 2, TF, sys_utimes, "utimes" }, /* 5226 */ - { 6, TM, sys_mbind, "mbind" }, /* 5227 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 5228 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 5229 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 5230 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 5231 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 5232 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 5233 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 5234 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 5235 */ - { 5, 0, sys_vserver, "vserver" }, /* 5236 */ - { 5, TP, sys_waitid, "waitid" }, /* 5237 */ - [5238] = { }, - { 5, 0, sys_add_key, "add_key" }, /* 5239 */ - { 4, 0, sys_request_key, "request_key" }, /* 5230 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 5241 */ - { 1, 0, sys_set_thread_area, "set_thread_area" }, /* 5242 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 5243 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 5244 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 5245 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 5246 */ - { 4, TD|TF, sys_openat, "openat" }, /* 5247 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 5248 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 5249 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 5250 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 5251 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 5252 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 5253 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 5254 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 5255 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 5256 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 5257 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 5258 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 5259 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 5260 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 5261 */ - { 1, TP, sys_unshare, "unshare" }, /* 5262 */ - { 6, TD, sys_splice, "splice" }, /* 5263 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 5264 */ - { 4, TD, sys_tee, "tee" }, /* 5265 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 5266 */ - { 6, TM, printargs, "move_pages" }, /* 5267 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 5268 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 5269 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 5270 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 5271 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 5272 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 5273 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 5274 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 5275 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 5276 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 5277 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 5278 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 5279 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 5280 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 5281 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 5282 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 5283 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 5284 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 5285 */ - { 3, TD, sys_dup3, "dup3" }, /* 5286 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 5287 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 5288 */ - { 4, TD, sys_preadv, "preadv" }, /* 5289 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 5290 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 5291 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 5292 */ - { 4, TN, sys_accept4, "accept4" }, /* 5293 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 5294 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 5295 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 5296 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 5297 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 5298 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 5299 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 5300 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 5301 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 5302 */ - { 2, TD, sys_setns, "setns" }, /* 5303 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 5304 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 5305 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 5306 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 5307 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 5308 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 5309 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 5310 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 5311 */ +/* For an N64 strace decode the N64 64-bit syscalls. */ +[5000] = { 3, TD, SEN(read), "read" }, /* start of Linux N64 */ +[5001] = { 3, TD, SEN(write), "write" }, +[5002] = { 3, TD|TF, SEN(open), "open" }, +[5003] = { 1, TD, SEN(close), "close" }, +[5004] = { 2, TF, SEN(stat), "stat" }, +[5005] = { 2, TD, SEN(fstat), "fstat" }, +[5006] = { 2, TF, SEN(lstat), "lstat" }, +[5007] = { 3, TD, SEN(poll), "poll" }, +[5008] = { 3, TD, SEN(lseek), "lseek" }, +[5009] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[5010] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[5011] = { 2, TM|SI, SEN(munmap), "munmap" }, +[5012] = { 1, TM|SI, SEN(brk), "brk" }, +[5013] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[5014] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[5015] = { 3, TD, SEN(ioctl), "ioctl" }, +[5016] = { 4, TD, SEN(pread), "pread64" }, +[5017] = { 4, TD, SEN(pwrite), "pwrite64" }, +[5018] = { 3, TD, SEN(readv), "readv" }, +[5019] = { 3, TD, SEN(writev), "writev" }, +[5020] = { 2, TF, SEN(access), "access" }, +[5021] = { 0, TD, SEN(pipe), "pipe" }, +[5022] = { 5, TD, SEN(select), "_newselect" }, +[5023] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[5024] = { 5, TM|SI, SEN(mremap), "mremap" }, +[5025] = { 3, TM, SEN(msync), "msync" }, +[5026] = { 3, TM, SEN(mincore), "mincore" }, +[5027] = { 3, TM, SEN(madvise), "madvise" }, +[5028] = { 3, TI, SEN(shmget), "shmget" }, +[5029] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[5030] = { 3, TI, SEN(shmctl), "shmctl" }, +[5031] = { 1, TD, SEN(dup), "dup" }, +[5032] = { 2, TD, SEN(dup2), "dup2" }, +[5033] = { 0, TS, SEN(pause), "pause" }, +[5034] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[5035] = { 2, 0, SEN(getitimer), "getitimer" }, +[5036] = { 3, 0, SEN(setitimer), "setitimer" }, +[5037] = { 1, 0, SEN(alarm), "alarm" }, +[5038] = { 0, NF, SEN(getpid), "getpid" }, +[5039] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[5040] = { 3, TN, SEN(socket), "socket" }, +[5041] = { 3, TN, SEN(connect), "connect" }, +[5042] = { 3, TN, SEN(accept), "accept" }, +[5043] = { 6, TN, SEN(sendto), "sendto" }, +[5044] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[5045] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[5046] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[5047] = { 2, TN, SEN(shutdown), "shutdown" }, +[5048] = { 3, TN, SEN(bind), "bind" }, +[5049] = { 2, TN, SEN(listen), "listen" }, +[5050] = { 3, TN, SEN(getsockname), "getsockname" }, +[5051] = { 3, TN, SEN(getpeername), "getpeername" }, +[5052] = { 4, TN, SEN(socketpair), "socketpair" }, +[5053] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[5054] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[5055] = { 5, TP, SEN(clone), "clone" }, +[5056] = { 0, TP, SEN(fork), "fork" }, +[5057] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[5058] = { 1, TP|SE, SEN(exit), "exit" }, +[5059] = { 4, TP, SEN(wait4), "wait4" }, +[5060] = { 2, TS, SEN(kill), "kill" }, +[5061] = { 1, 0, SEN(uname), "uname" }, +[5062] = { 3, TI, SEN(semget), "semget" }, +[5063] = { 3, TI, SEN(semop), "semop" }, +[5064] = { 4, TI, SEN(semctl), "semctl" }, +[5065] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[5066] = { 2, TI, SEN(msgget), "msgget" }, +[5067] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[5068] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[5069] = { 3, TI, SEN(msgctl), "msgctl" }, +[5070] = { 3, TD, SEN(fcntl), "fcntl" }, +[5071] = { 2, TD, SEN(flock), "flock" }, +[5072] = { 1, TD, SEN(fsync), "fsync" }, +[5073] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[5074] = { 2, TF, SEN(truncate), "truncate" }, +[5075] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[5076] = { 3, TD, SEN(getdents), "getdents" }, +[5077] = { 2, TF, SEN(getcwd), "getcwd" }, +[5078] = { 1, TF, SEN(chdir), "chdir" }, +[5079] = { 1, TD, SEN(fchdir), "fchdir" }, +[5080] = { 2, TF, SEN(rename), "rename" }, +[5081] = { 2, TF, SEN(mkdir), "mkdir" }, +[5082] = { 1, TF, SEN(rmdir), "rmdir" }, +[5083] = { 2, TD|TF, SEN(creat), "creat" }, +[5084] = { 2, TF, SEN(link), "link" }, +[5085] = { 1, TF, SEN(unlink), "unlink" }, +[5086] = { 2, TF, SEN(symlink), "symlink" }, +[5087] = { 3, TF, SEN(readlink), "readlink" }, +[5088] = { 2, TF, SEN(chmod), "chmod" }, +[5089] = { 2, TD, SEN(fchmod), "fchmod" }, +[5090] = { 3, TF, SEN(chown), "chown" }, +[5091] = { 3, TD, SEN(fchown), "fchown" }, +[5092] = { 3, TF, SEN(chown), "lchown" }, +[5093] = { 1, NF, SEN(umask), "umask" }, +[5094] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[5095] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[5096] = { 2, 0, SEN(getrusage), "getrusage" }, +[5097] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[5098] = { 1, 0, SEN(times), "times" }, +[5099] = { 4, 0, SEN(ptrace), "ptrace" }, +[5100] = { 0, NF, SEN(getuid), "getuid" }, +[5101] = { 3, 0, SEN(syslog), "syslog" }, +[5102] = { 0, NF, SEN(getgid), "getgid" }, +[5103] = { 1, 0, SEN(setuid), "setuid" }, +[5104] = { 1, 0, SEN(setgid), "setgid" }, +[5105] = { 0, NF, SEN(geteuid), "geteuid" }, +[5106] = { 0, NF, SEN(getegid), "getegid" }, +[5107] = { 2, 0, SEN(setpgid), "setpgid" }, +[5108] = { 0, NF, SEN(getppid), "getppid" }, +[5109] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[5110] = { 0, 0, SEN(setsid), "setsid" }, +[5111] = { 2, 0, SEN(setreuid), "setreuid" }, +[5112] = { 2, 0, SEN(setregid), "setregid" }, +[5113] = { 2, 0, SEN(getgroups), "getgroups" }, +[5114] = { 2, 0, SEN(setgroups), "setgroups" }, +[5115] = { 3, 0, SEN(setresuid), "setresuid" }, +[5116] = { 3, 0, SEN(getresuid), "getresuid" }, +[5117] = { 3, 0, SEN(setresgid), "setresgid" }, +[5118] = { 3, 0, SEN(getresgid), "getresgid" }, +[5119] = { 1, 0, SEN(getpgid), "getpgid" }, +[5120] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[5121] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[5122] = { 1, 0, SEN(getsid), "getsid" }, +[5123] = { 2, 0, SEN(capget), "capget" }, +[5124] = { 2, 0, SEN(capset), "capset" }, +[5125] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[5126] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[5127] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[5128] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[5129] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[5130] = { 2, TF, SEN(utime), "utime" }, +[5131] = { 3, TF, SEN(mknod), "mknod" }, +[5132] = { 1, NF, SEN(personality), "personality" }, +[5133] = { 2, 0, SEN(ustat), "ustat" }, +[5134] = { 2, TF, SEN(statfs), "statfs" }, +[5135] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[5136] = { 3, 0, SEN(sysfs), "sysfs" }, +[5137] = { 2, 0, SEN(getpriority), "getpriority" }, +[5138] = { 3, 0, SEN(setpriority), "setpriority" }, +[5139] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[5140] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[5141] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[5142] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[5143] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[5144] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[5145] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[5146] = { 2, TM, SEN(mlock), "mlock" }, +[5147] = { 2, TM, SEN(munlock), "munlock" }, +[5148] = { 1, TM, SEN(mlockall), "mlockall" }, +[5149] = { 0, TM, SEN(munlockall), "munlockall" }, +[5150] = { 0, 0, SEN(vhangup), "vhangup" }, +[5151] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[5152] = { 1, 0, SEN(sysctl), "_sysctl" }, +[5153] = { 5, 0, SEN(prctl), "prctl" }, +[5154] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[5155] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[5156] = { 1, TF, SEN(chroot), "chroot" }, +[5157] = { 0, 0, SEN(sync), "sync" }, +[5158] = { 1, TF, SEN(acct), "acct" }, +[5159] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[5160] = { 5, TF, SEN(mount), "mount" }, +[5161] = { 2, TF, SEN(umount2), "umount2" }, +[5162] = { 2, TF, SEN(swapon), "swapon" }, +[5163] = { 1, TF, SEN(swapoff), "swapoff" }, +[5164] = { 4, 0, SEN(reboot), "reboot" }, +[5165] = { 2, 0, SEN(sethostname), "sethostname" }, +[5166] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[5167] = { 2, 0, SEN(create_module), "create_module" }, +[5168] = { 3, 0, SEN(init_module), "init_module" }, +[5169] = { 2, 0, SEN(delete_module), "delete_module" }, +[5170] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[5171] = { 5, 0, SEN(query_module), "query_module" }, +[5172] = { 4, TF, SEN(quotactl), "quotactl" }, +[5173] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[5174] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[5175] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[5176] = { 0, 0, SEN(afs_syscall), "afs_syscall" }, +[5177] = { 0, 0, SEN(printargs), "reserved177" }, +[5178] = { 0, NF, SEN(gettid), "gettid" }, +[5179] = { 3, TD, SEN(readahead), "readahead" }, +[5180] = { 5, TF, SEN(setxattr), "setxattr" }, +[5181] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[5182] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[5183] = { 4, TF, SEN(getxattr), "getxattr" }, +[5184] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[5185] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[5186] = { 3, TF, SEN(listxattr), "listxattr" }, +[5187] = { 3, TF, SEN(listxattr), "llistxattr" }, +[5188] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[5189] = { 2, TF, SEN(removexattr), "removexattr" }, +[5190] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[5191] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[5192] = { 2, TS, SEN(kill), "tkill" }, +[5193] = { 1, 0, SEN(time), "time" }, +[5194] = { 6, 0, SEN(futex), "futex" }, +[5195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[5196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[5197] = { 3, 0, SEN(printargs), "cacheflush" }, +[5198] = { 3, 0, SEN(printargs), "cachectl" }, +[5199] = { 4, 0, SEN(sysmips), "sysmips" }, +[5200] = { 2, TM, SEN(io_setup), "io_setup" }, +[5201] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[5202] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[5203] = { 3, 0, SEN(io_submit), "io_submit" }, +[5204] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[5205] = { 1, TP|SE, SEN(exit), "exit_group" }, +[5206] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[5207] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[5208] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[5209] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[5210] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[5211] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[5212] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[5213] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[5214] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[5215] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[5216] = { 3, 0, SEN(timer_create), "timer_create" }, +[5217] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[5218] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[5219] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[5220] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[5221] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[5222] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[5223] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[5224] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[5225] = { 3, TS, SEN(tgkill), "tgkill" }, +[5226] = { 2, TF, SEN(utimes), "utimes" }, +[5227] = { 6, TM, SEN(mbind), "mbind" }, +[5228] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[5229] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[5230] = { 4, 0, SEN(mq_open), "mq_open" }, +[5231] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[5232] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[5233] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[5234] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[5235] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[5236] = { 5, 0, SEN(vserver), "vserver" }, +[5237] = { 5, TP, SEN(waitid), "waitid" }, +[5238] = { }, +[5239] = { 5, 0, SEN(add_key), "add_key" }, +[5240] = { 4, 0, SEN(request_key), "request_key" }, +[5241] = { 5, 0, SEN(keyctl), "keyctl" }, +[5242] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[5243] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[5244] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[5245] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[5246] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[5247] = { 4, TD|TF, SEN(openat), "openat" }, +[5248] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[5249] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[5250] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[5251] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[5252] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[5253] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[5254] = { 4, TD|TF, SEN(renameat), "renameat" }, +[5255] = { 5, TD|TF, SEN(linkat), "linkat" }, +[5256] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[5257] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[5258] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[5259] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[5260] = { 6, TD, SEN(pselect6), "pselect6" }, +[5261] = { 5, TD, SEN(ppoll), "ppoll" }, +[5262] = { 1, TP, SEN(unshare), "unshare" }, +[5263] = { 6, TD, SEN(splice), "splice" }, +[5264] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[5265] = { 4, TD, SEN(tee), "tee" }, +[5266] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[5267] = { 6, TM, SEN(move_pages), "move_pages" }, +[5268] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[5269] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[5270] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[5271] = { 3, 0, SEN(getcpu), "getcpu" }, +[5272] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[5273] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[5274] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[5275] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[5276] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[5277] = { 4, TD, SEN(timerfd), "timerfd" }, +[5278] = { 1, TD, SEN(eventfd), "eventfd" }, +[5279] = { 4, TD, SEN(fallocate), "fallocate" }, +[5280] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[5281] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[5282] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[5283] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[5284] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[5285] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[5286] = { 3, TD, SEN(dup3), "dup3" }, +[5287] = { 2, TD, SEN(pipe2), "pipe2" }, +[5288] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[5289] = { 4, TD, SEN(preadv), "preadv" }, +[5290] = { 4, TD, SEN(pwritev), "pwritev" }, +[5291] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[5292] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[5293] = { 4, TN, SEN(accept4), "accept4" }, +[5294] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[5295] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[5296] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[5297] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[5298] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[5299] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[5300] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[5301] = { 1, TD, SEN(syncfs), "syncfs" }, +[5302] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[5303] = { 2, TD, SEN(setns), "setns" }, +[5304] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[5305] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[5306] = { 5, 0, SEN(kcmp), "kcmp" }, +[5307] = { 3, TD, SEN(finit_module), "finit_module" }, +[5308] = { 3, TD, SEN(getdents64), "getdents64" }, +[5309] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[5310] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[5311] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[5312] = { 3, 0, SEN(seccomp), "seccomp" }, +[5313] = { 3, 0, SEN(getrandom), "getrandom" }, +[5314] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[5315] = { 3, TD, SEN(bpf), "bpf" }, +[5316] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[5317] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[5318] = { 2, 0, SEN(membarrier), "membarrier" }, +[5319] = { 3, TM, SEN(mlock2), "mlock2" }, +[5320] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[5321] = { 6, TD, SEN(preadv2), "preadv2" }, +[5322] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[5323] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[5324] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[5325] = { 1, 0, SEN(pkey_free), "pkey_free" }, + +# define SYS_socket_subcall 5400 +# include "subcall.h" + #else - { 0, 0, printargs, "n64_read" }, /* 5000 */ - { 0, 0, printargs, "n64_write" }, /* 5001 */ - { 0, 0, printargs, "n64_open" }, /* 5002 */ - { 0, 0, printargs, "n64_close" }, /* 5003 */ - { 0, 0, printargs, "n64_stat" }, /* 5004 */ - { 0, 0, printargs, "n64_fstat" }, /* 5005 */ - { 0, 0, printargs, "n64_lstat" }, /* 5006 */ - { 0, 0, printargs, "n64_poll" }, /* 5007 */ - { 0, 0, printargs, "n64_lseek" }, /* 5008 */ - { 0, TD|TM|SI, printargs, "n64_mmap" }, /* 5009 */ - { 0, TM|SI, printargs, "n64_mprotect" }, /* 5010 */ - { 0, TM|SI, printargs, "n64_munmap" }, /* 5011 */ - { 0, TM|SI, printargs, "n64_brk" }, /* 5012 */ - { 0, 0, printargs, "n64_rt_sigaction" }, /* 5013 */ - { 0, 0, printargs, "n64_rt_sigprocmask" }, /* 5014 */ - { 0, 0, printargs, "n64_ioctl" }, /* 5015 */ - { 0, 0, printargs, "n64_pread" }, /* 5016 */ - { 0, 0, printargs, "n64_pwrite" }, /* 5017 */ - { 0, 0, printargs, "n64_readv" }, /* 5018 */ - { 0, 0, printargs, "n64_writev" }, /* 5019 */ - { 0, 0, printargs, "n64_access" }, /* 5020 */ - { 0, 0, printargs, "n64_pipe" }, /* 5021 */ - { 0, 0, printargs, "n64__newselect" }, /* 5022 */ - { 0, 0, printargs, "n64_sched_yield" }, /* 5023 */ - { 0, TM|SI, printargs, "n64_mremap" }, /* 5024 */ - { 0, TM, printargs, "n64_msync" }, /* 5025 */ - { 0, TM, printargs, "n64_mincore" }, /* 5026 */ - { 0, TM, printargs, "n64_madvise" }, /* 5027 */ - { 0, 0, printargs, "n64_shmget" }, /* 5028 */ - { 0, TI|TM|SI, printargs, "n64_shmat" }, /* 5029 */ - { 0, 0, printargs, "n64_shmctl" }, /* 5030 */ - { 0, 0, printargs, "n64_dup" }, /* 5031 */ - { 0, 0, printargs, "n64_dup2" }, /* 5032 */ - { 0, 0, printargs, "n64_pause" }, /* 5033 */ - { 0, 0, printargs, "n64_nanosleep" }, /* 5034 */ - { 0, 0, printargs, "n64_getitimer" }, /* 5035 */ - { 0, 0, printargs, "n64_setitimer" }, /* 5036 */ - { 0, 0, printargs, "n64_alarm" }, /* 5037 */ - { 0, 0, printargs, "n64_getpid" }, /* 5038 */ - { 0, 0, printargs, "n64_sendfile" }, /* 5039 */ - { 0, 0, printargs, "n64_socketcall" }, /* 5040 */ - { 0, 0, printargs, "n64_connect" }, /* 5041 */ - { 0, 0, printargs, "n64_accept" }, /* 5042 */ - { 0, 0, printargs, "n64_sendto" }, /* 5043 */ - { 0, 0, printargs, "n64_recvfrom" }, /* 5044 */ - { 0, 0, printargs, "n64_sendmsg" }, /* 5045 */ - { 0, 0, printargs, "n64_recvmsg" }, /* 5046 */ - { 0, 0, printargs, "n64_shutdown" }, /* 5047 */ - { 0, 0, printargs, "n64_bind" }, /* 5048 */ - { 0, 0, printargs, "n64_listen" }, /* 5049 */ - { 0, 0, printargs, "n64_getsockname" }, /* 5050 */ - { 0, 0, printargs, "n64_getpeername" }, /* 5051 */ - { 0, 0, printargs, "n64_socketpair" }, /* 5052 */ - { 0, 0, printargs, "n64_setsockopt" }, /* 5053 */ - { 0, 0, printargs, "n64_getsockopt" }, /* 5054 */ - { 5, TP, printargs, "n64_clone" }, /* 5055 */ - { 0, TP, printargs, "n64_fork" }, /* 5056 */ - { 3, TF|TP|SE|SI, printargs, "n64_execve" }, /* 5057 */ - { 1, TP|SE, printargs, "n64_exit" }, /* 5058 */ - { 4, TP, printargs, "n64_wait4" }, /* 5059 */ - { 0, 0, printargs, "n64_kill" }, /* 5060 */ - { 0, 0, printargs, "n64_uname" }, /* 5061 */ - { 0, 0, printargs, "n64_semget" }, /* 5062 */ - { 0, 0, printargs, "n64_semop" }, /* 5063 */ - { 0, 0, printargs, "n64_semctl" }, /* 5064 */ - { 0, TI|TM|SI, printargs, "n64_shmdt" }, /* 5065 */ - { 0, 0, printargs, "n64_msgget" }, /* 5066 */ - { 0, 0, printargs, "n64_msgsnd" }, /* 5067 */ - { 0, 0, printargs, "n64_msgrcv" }, /* 5068 */ - { 0, 0, printargs, "n64_msgctl" }, /* 5069 */ - { 0, 0, printargs, "n64_fcntl" }, /* 5070 */ - { 0, 0, printargs, "n64_flock" }, /* 5071 */ - { 0, 0, printargs, "n64_fsync" }, /* 5072 */ - { 0, 0, printargs, "n64_fdatasync" }, /* 5073 */ - { 0, 0, printargs, "n64_truncate" }, /* 5074 */ - { 0, 0, printargs, "n64_ftruncate" }, /* 5075 */ - { 0, 0, printargs, "n64_getdents" }, /* 5076 */ - { 0, 0, printargs, "n64_getcwd" }, /* 5077 */ - { 0, 0, printargs, "n64_chdir" }, /* 5078 */ - { 0, 0, printargs, "n64_fchdir" }, /* 5079 */ - { 0, 0, printargs, "n64_rename" }, /* 5080 */ - { 0, 0, printargs, "n64_mkdir" }, /* 5081 */ - { 0, 0, printargs, "n64_rmdir" }, /* 5082 */ - { 0, 0, printargs, "n64_creat" }, /* 5083 */ - { 0, 0, printargs, "n64_link" }, /* 5084 */ - { 0, 0, printargs, "n64_unlink" }, /* 5085 */ - { 0, 0, printargs, "n64_symlink" }, /* 5086 */ - { 0, 0, printargs, "n64_readlink" }, /* 5087 */ - { 0, 0, printargs, "n64_chmod" }, /* 5088 */ - { 0, 0, printargs, "n64_fchmod" }, /* 5089 */ - { 0, 0, printargs, "n64_chown" }, /* 5090 */ - { 0, 0, printargs, "n64_fchown" }, /* 5091 */ - { 0, 0, printargs, "n64_lchown" }, /* 5092 */ - { 0, 0, printargs, "n64_umask" }, /* 5093 */ - { 0, 0, printargs, "n64_gettimeofday" }, /* 5094 */ - { 0, 0, printargs, "n64_getrlimit" }, /* 5095 */ - { 0, 0, printargs, "n64_getrusage" }, /* 5096 */ - { 0, 0, printargs, "n64_sysinfo" }, /* 5097 */ - { 0, 0, printargs, "n64_times" }, /* 5098 */ - { 0, 0, printargs, "n64_ptrace" }, /* 5099 */ - { 0, 0, printargs, "n64_getuid" }, /* 5100 */ - { 0, 0, printargs, "n64_syslog" }, /* 5101 */ - { 0, 0, printargs, "n64_getgid" }, /* 5102 */ - { 0, 0, printargs, "n64_setuid" }, /* 5103 */ - { 0, 0, printargs, "n64_setgid" }, /* 5104 */ - { 0, 0, printargs, "n64_geteuid" }, /* 5105 */ - { 0, 0, printargs, "n64_getegid" }, /* 5106 */ - { 0, 0, printargs, "n64_setpgid" }, /* 5107 */ - { 0, 0, printargs, "n64_getppid" }, /* 5108 */ - { 0, 0, printargs, "n64_getpgrp" }, /* 5109 */ - { 0, 0, printargs, "n64_setsid" }, /* 5110 */ - { 0, 0, printargs, "n64_setreuid" }, /* 5111 */ - { 0, 0, printargs, "n64_setregid" }, /* 5112 */ - { 0, 0, printargs, "n64_getgroups" }, /* 5113 */ - { 0, 0, printargs, "n64_setgroups" }, /* 5114 */ - { 0, 0, printargs, "n64_setresuid" }, /* 5115 */ - { 0, 0, printargs, "n64_getresuid" }, /* 5116 */ - { 0, 0, printargs, "n64_setresgid" }, /* 5117 */ - { 0, 0, printargs, "n64_getresgid" }, /* 5118 */ - { 0, 0, printargs, "n64_getpgid" }, /* 5119 */ - { 0, 0, printargs, "n64_setfsuid" }, /* 5120 */ - { 0, 0, printargs, "n64_setfsgid" }, /* 5121 */ - { 0, 0, printargs, "n64_getsid" }, /* 5122 */ - { 0, 0, printargs, "n64_capget" }, /* 5123 */ - { 0, 0, printargs, "n64_capset" }, /* 5124 */ - { 0, 0, printargs, "n64_rt_sigpending" }, /* 5125 */ - { 0, 0, printargs, "n64_rt_sigtimedwait" }, /* 5126 */ - { 0, 0, printargs, "n64_rt_sigqueueinfo" }, /* 5127 */ - { 0, 0, printargs, "n64_rt_sigsuspend" }, /* 5128 */ - { 0, 0, printargs, "n64_sigaltstack" }, /* 5129 */ - { 0, 0, printargs, "n64_utime" }, /* 5130 */ - { 0, 0, printargs, "n64_mknod" }, /* 5131 */ - { 0, 0, printargs, "n64_personality" }, /* 5132 */ - { 0, 0, printargs, "n64_ustat" }, /* 5133 */ - { 0, 0, printargs, "n64_statfs" }, /* 5134 */ - { 0, 0, printargs, "n64_fstatfs" }, /* 5135 */ - { 0, 0, printargs, "n64_sysfs" }, /* 5136 */ - { 0, 0, printargs, "n64_getpriority" }, /* 5137 */ - { 0, 0, printargs, "n64_setpriority" }, /* 5138 */ - { 0, 0, printargs, "n64_sched_setparam" }, /* 5139 */ - { 0, 0, printargs, "n64_sched_getparam" }, /* 5140 */ - { 0, 0, printargs, "n64_sched_setscheduler"}, /* 5141 */ - { 0, 0, printargs, "n64_sched_getscheduler"}, /* 5142 */ - { 0, 0, printargs, "n64_sched_get_priority_max"}, /* 5143 */ - { 0, 0, printargs, "n64_sched_get_priority_min"}, /* 5144 */ - { 0, 0, printargs, "n64_sched_rr_get_interval"}, /* 5145 */ - { 0, TM, printargs, "n64_mlock" }, /* 5146 */ - { 0, TM, printargs, "n64_munlock" }, /* 5147 */ - { 0, TM, printargs, "n64_mlockall" }, /* 5148 */ - { 0, TM, printargs, "n64_munlockall" }, /* 5149 */ - { 0, 0, printargs, "n64_vhangup" }, /* 5150 */ - { 0, 0, printargs, "n64_pivot_root" }, /* 5151 */ - { 0, 0, printargs, "n64__sysctl" }, /* 5152 */ - { 0, 0, printargs, "n64_prctl" }, /* 5153 */ - { 0, 0, printargs, "n64_adjtimex" }, /* 5154 */ - { 0, 0, printargs, "n64_setrlimit" }, /* 5155 */ - { 0, 0, printargs, "n64_chroot" }, /* 5156 */ - { 0, 0, printargs, "n64_sync" }, /* 5157 */ - { 0, 0, printargs, "n64_acct" }, /* 5158 */ - { 0, 0, printargs, "n64_settimeofday" }, /* 5159 */ - { 0, 0, printargs, "n64_mount" }, /* 5160 */ - { 0, 0, printargs, "n64_umount" }, /* 5161 */ - { 0, 0, printargs, "n64_swapon" }, /* 5162 */ - { 0, 0, printargs, "n64_swapoff" }, /* 5163 */ - { 0, 0, printargs, "n64_reboot" }, /* 5164 */ - { 0, 0, printargs, "n64_sethostname" }, /* 5165 */ - { 0, 0, printargs, "n64_setdomainname" }, /* 5166 */ - { 0, 0, printargs, "n64_create_module" }, /* 5167 */ - { 0, 0, printargs, "n64_init_module" }, /* 5168 */ - { 0, 0, printargs, "n64_delete_module" }, /* 5169 */ - { 0, 0, printargs, "n64_get_kernel_syms" }, /* 5170 */ - { 0, 0, printargs, "n64_query_module" }, /* 5171 */ - { 0, TF, printargs, "n64_quotactl" }, /* 5172 */ - { 0, 0, printargs, "n64_nfsservctl" }, /* 5173 */ - { 0, 0, printargs, "n64_getpmsg" }, /* 5174 */ - { 0, 0, printargs, "n64_putpmsg" }, /* 5175 */ - { 0, 0, printargs, "n64_afs_syscall" }, /* 5176 */ - { 0, 0, printargs, "n64_reserved177" }, /* 5177 */ - { 0, 0, printargs, "n64_gettid" }, /* 5178 */ - { 0, 0, printargs, "n64_readahead" }, /* 5179 */ - { 0, 0, printargs, "n64_setxattr" }, /* 5180 */ - { 0, 0, printargs, "n64_lsetxattr" }, /* 5181 */ - { 0, 0, printargs, "n64_fsetxattr" }, /* 5182 */ - { 0, 0, printargs, "n64_getxattr" }, /* 5183 */ - { 0, 0, printargs, "n64_lgetxattr" }, /* 5184 */ - { 0, 0, printargs, "n64_fgetxattr" }, /* 5185 */ - { 0, 0, printargs, "n64_listxattr" }, /* 5186 */ - { 0, 0, printargs, "n64_llistxattr" }, /* 5187 */ - { 0, 0, printargs, "n64_flistxattr" }, /* 5188 */ - { 0, 0, printargs, "n64_removexattr" }, /* 5189 */ - { 0, 0, printargs, "n64_lremovexattr" }, /* 5190 */ - { 0, 0, printargs, "n64_fremovexattr" }, /* 5191 */ - { 0, 0, printargs, "n64_tkill" }, /* 5192 */ - { 0, 0, printargs, "n64_time" }, /* 5193 */ - { 0, 0, printargs, "n64_futex" }, /* 5194 */ - { 0, 0, printargs, "n64_sched_setaffinity" }, /* 5195 */ - { 0, 0, printargs, "n64_sched_getaffinity" }, /* 5196 */ - { 0, 0, printargs, "n64_cacheflush" }, /* 5197 */ - { 0, 0, printargs, "n64_cachectl" }, /* 5198 */ - { 0, 0, printargs, "n64_sysmips" }, /* 5199 */ - { 0, 0, printargs, "n64_io_setup" }, /* 5200 */ - { 0, 0, printargs, "n64_io_destroy" }, /* 5201 */ - { 0, 0, printargs, "n64_io_getevents" }, /* 5202 */ - { 0, 0, printargs, "n64_io_submit" }, /* 5203 */ - { 0, 0, printargs, "n64_io_cancel" }, /* 5204 */ - { 1, TP|SE, printargs, "n64_exit_group" }, /* 5205 */ - { 0, 0, printargs, "n64_lookup_dcookie" }, /* 5206 */ - { 0, 0, printargs, "n64_epoll_create" }, /* 5207 */ - { 0, 0, printargs, "n64_epoll_ctl" }, /* 5208 */ - { 0, 0, printargs, "n64_epoll_wait" }, /* 5209 */ - { 0, TM|SI, printargs, "n64_remap_file_pages" }, /* 5210 */ - { 0, 0, printargs, "n64_rt_sigreturn" }, /* 5211 */ - { 1, 0, printargs, "n64_set_tid_address" }, /* 5212 */ - { 0, 0, printargs, "n64_restart_syscall" }, /* 5213 */ - { 5, TI, printargs, "n64_semtimedop" }, /* 5214 */ - { 0, 0, printargs, "n64_fadvise64_64" }, /* 5215 */ - { 0, 0, printargs, "n64_timer_create" }, /* 5216 */ - { 0, 0, printargs, "n64_timer_settime" }, /* 5217 */ - { 0, 0, printargs, "n64_timer_gettime" }, /* 5218 */ - { 0, 0, printargs, "n64_timer_getoverrun" }, /* 5219 */ - { 0, 0, printargs, "n64_timer_delete" }, /* 5220 */ - { 0, 0, printargs, "n64_clock_settime" }, /* 5221 */ - { 0, 0, printargs, "n64_clock_gettime" }, /* 5222 */ - { 0, 0, printargs, "n64_clock_getres" }, /* 5223 */ - { 0, 0, printargs, "n64_clock_nanosleep" }, /* 5224 */ - { 0, 0, printargs, "n64_tgkill" }, /* 5225 */ - { 0, 0, printargs, "n64_utimes" }, /* 5226 */ - { 6, TM, printargs, "n64_mbind" }, /* 5227 */ - { 5, TM, printargs, "n64_get_mempolicy" }, /* 5228 */ - { 3, TM, printargs, "n64_set_mempolicy" }, /* 5229 */ - { 0, 0, printargs, "n64_mq_open" }, /* 5230 */ - { 0, 0, printargs, "n64_mq_unlink" }, /* 5231 */ - { 0, 0, printargs, "n64_mq_timedsend" }, /* 5232 */ - { 0, 0, printargs, "n64_mq_timedreceive" }, /* 5233 */ - { 0, 0, printargs, "n64_mq_notify" }, /* 5234 */ - { 0, 0, printargs, "n64_mq_getsetattr" }, /* 5235 */ - { 5, 0, printargs, "n64_vserver" }, /* 5236 */ - { 5, TP, printargs, "n64_waitid" }, /* 5237 */ - { 0, 0, printargs, "n64_SYS_5238" }, /* 5238 */ - { 0, 0, printargs, "n64_add_key" }, /* 5239 */ - { 0, 0, printargs, "n64_request_key" }, /* 5230 */ - { 0, 0, printargs, "n64_keyctl" }, /* 5241 */ - { 0, 0, printargs, "n64_set_thread_area" }, /* 5242 */ - { 0, 0, printargs, "n64_inotify_init" }, /* 5243 */ - { 0, 0, printargs, "n64_inotify_add_watch" }, /* 5244 */ - { 0, 0, printargs, "n64_inotify_rm_watch" }, /* 5245 */ - { 0, TM, printargs, "n64_migrate_pages" }, /* 5246 */ - { 0, 0, printargs, "n64_openat" }, /* 5247 */ - { 0, 0, printargs, "n64_mkdirat" }, /* 5248 */ - { 0, 0, printargs, "n64_mknodat" }, /* 5249 */ - { 0, 0, printargs, "n64_fchownat" }, /* 5250 */ - { 0, 0, printargs, "n64_futimesat" }, /* 5251 */ - { 0, 0, printargs, "n64_newfstatat" }, /* 5252 */ - { 0, 0, printargs, "n64_unlinkat" }, /* 5253 */ - { 0, 0, printargs, "n64_renameat" }, /* 5254 */ - { 0, 0, printargs, "n64_linkat" }, /* 5255 */ - { 0, 0, printargs, "n64_symlinkat" }, /* 5256 */ - { 0, 0, printargs, "n64_readlinkat" }, /* 5257 */ - { 0, 0, printargs, "n64_fchmodat" }, /* 5258 */ - { 0, 0, printargs, "n64_faccessat" }, /* 5259 */ - { 0, 0, printargs, "n64_pselect6" }, /* 5260 */ - { 0, 0, printargs, "n64_ppoll" }, /* 5261 */ - { 1, TP, printargs, "n64_unshare" }, /* 5262 */ - { 0, 0, printargs, "n64_splice" }, /* 5263 */ - { 0, 0, printargs, "n64_sync_file_range" }, /* 5264 */ - { 0, 0, printargs, "n64_tee" }, /* 5265 */ - { 0, 0, printargs, "n64_vmsplice" }, /* 5266 */ - { 0, TM, printargs, "n64_move_pages" }, /* 5267 */ - { 0, 0, printargs, "n64_set_robust_list" }, /* 5268 */ - { 0, 0, printargs, "n64_get_robust_list" }, /* 5269 */ - { 0, 0, printargs, "n64_kexec_load" }, /* 5270 */ - { 0, 0, printargs, "n64_getcpu" }, /* 5271 */ - { 0, 0, printargs, "n64_epoll_pwait" }, /* 5272 */ - { 0, 0, printargs, "n64_ioprio_set" }, /* 5273 */ - { 0, 0, printargs, "n64_ioprio_get" }, /* 5274 */ - { 0, 0, printargs, "n64_utimensat" }, /* 5275 */ - { 0, 0, printargs, "n64_signalfd" }, /* 5276 */ - { 4, TD, printargs, "n64_timerfd" }, /* 5277 */ - { 0, 0, printargs, "n64_eventfd" }, /* 5278 */ - { 0, 0, printargs, "n64_fallocate" }, /* 5279 */ - { 0, 0, printargs, "n64_timerfd_create" }, /* 5280 */ - { 0, 0, printargs, "n64_timerfd_gettime" }, /* 5281 */ - { 0, 0, printargs, "n64_timerfd_settime" }, /* 5282 */ - { 0, 0, printargs, "n64_signalfd4" }, /* 5283 */ - { 0, 0, printargs, "n64_eventfd2" }, /* 5284 */ - { 0, 0, printargs, "n64_epoll_create1" }, /* 5285 */ - { 0, 0, printargs, "n64_dup3" }, /* 5286 */ - { 0, 0, printargs, "n64_pipe2" }, /* 5287 */ - { 0, 0, printargs, "n64_inotify_init1" }, /* 5288 */ - { 0, 0, printargs, "n64_preadv" }, /* 5289 */ - { 0, 0, printargs, "n64_pwritev" }, /* 5290 */ - { 4, TP|TS, printargs, "n64_rt_tgsigqueueinfo" }, /* 5291 */ - { 0, 0, printargs, "n64_perf_event_open" }, /* 5292 */ - { 0, 0, printargs, "n64_accept4" }, /* 5293 */ - { 0, 0, printargs, "n64_recvmmsg" }, /* 5294 */ - { 2, 0, printargs, "n64_fanotify_init" }, /* 5295 */ - { 5, 0, printargs, "n64_fanotify_mark" }, /* 5296 */ - { 4, 0, printargs, "n64_prlimit64" }, /* 5297 */ - { 5, TD|TF, printargs, "n64_name_to_handle_at" }, /* 5298 */ - { 3, TD, printargs, "n64_open_by_handle_at" }, /* 5299 */ - { 2, 0, printargs, "n64_clock_adjtime" }, /* 5300 */ - { 1, TD, printargs, "n64_syncfs" }, /* 5301 */ - { 4, TN, printargs, "n64_sendmmsg" }, /* 5302 */ - { 2, TD, printargs, "n64_setns" }, /* 5303 */ - { 6, 0, printargs, "n64_process_vm_readv" }, /* 5304 */ - { 6, 0, printargs, "n64_process_vm_writev" }, /* 5305 */ - { 5, 0, printargs, "n64_kcmp" }, /* 5306 */ - { 3, TD, printargs, "n64_finit_module" }, /* 5307 */ - { 3, TD, printargs, "n64_getdents64" }, /* 5308 */ - { 3, 0, printargs, "n64_sched_setattr" }, /* 5309 */ - { 4, 0, printargs, "n64_sched_getattr" }, /* 5310 */ - { 5, TD|TF, printargs, "n64_renameat2" }, /* 5311 */ + +# include "syscallent-n64-stub.h" + #endif - [5308 ... 5999] = { }, /* 5999 */ /* end of Linux N64 */ diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h index 41dae469..780d3bc0 100644 --- a/linux/mips/syscallent-o32.h +++ b/linux/mips/syscallent-o32.h @@ -1,709 +1,377 @@ #if defined LINUX_MIPSO32 - /* For an O32 strace, decode the o32 syscalls. */ - { MA, 0, printargs, "syscall" }, /* 4000 */ /* start of Linux o32 */ - { 1, TP|SE, sys_exit, "exit" }, /* 4001 */ - { 0, TP, sys_fork, "fork" }, /* 4002 */ - { 3, TD, sys_read, "read" }, /* 4003 */ - { 3, TD, sys_write, "write" }, /* 4004 */ - { 3, TD|TF, sys_open, "open" }, /* 4005 */ - { 1, TD, sys_close, "close" }, /* 4006 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 4007 */ - { 2, TD|TF, sys_creat, "creat" }, /* 4008 */ - { 2, TF, sys_link, "link" }, /* 4009 */ - { 1, TF, sys_unlink, "unlink" }, /* 4010 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 4011 */ - { 1, TF, sys_chdir, "chdir" }, /* 4012 */ - { 1, 0, sys_time, "time" }, /* 4013 */ - { 3, TF, sys_mknod, "mknod" }, /* 4014 */ - { 2, TF, sys_chmod, "chmod" }, /* 4015 */ - { 3, TF, sys_chown, "lchown" }, /* 4016 */ - { 0, TM, sys_break, "break" }, /* 4017 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 4018 */ - { 3, TD, sys_lseek, "lseek" }, /* 4019 */ - { 0, 0, sys_getpid, "getpid" }, /* 4020 */ - { 5, TF, sys_mount, "mount" }, /* 4021 */ - { 1, TF, sys_umount, "umount" }, /* 4022 */ - { 1, 0, sys_setuid, "setuid" }, /* 4023 */ - { 0, NF, sys_getuid, "getuid" }, /* 4024 */ - { 1, 0, sys_stime, "stime" }, /* 4025 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 4026 */ - { 1, 0, sys_alarm, "alarm" }, /* 4027 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 4028 */ - { 0, TS, sys_pause, "pause" }, /* 4029 */ - { 2, TF, sys_utime, "utime" }, /* 4030 */ - { 0, 0, sys_stty, "stty" }, /* 4031 */ - { 0, 0, sys_gtty, "gtty" }, /* 4032 */ - { 2, TF, sys_access, "access" }, /* 4033 */ - { 1, 0, sys_nice, "nice" }, /* 4034 */ - { 1, 0, sys_ftime, "ftime" }, /* 4035 */ - { 0, 0, sys_sync, "sync" }, /* 4036 */ - { 2, TS, sys_kill, "kill" }, /* 4037 */ - { 2, TF, sys_rename, "rename" }, /* 4038 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 4039 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 4040 */ - { 1, TD, sys_dup, "dup" }, /* 4041 */ - { 1, TD, sys_pipe, "pipe" }, /* 4042 */ - { 1, 0, sys_times, "times" }, /* 4043 */ - { 0, 0, sys_prof, "prof" }, /* 4044 */ - { 1, TM|SI, sys_brk, "brk" }, /* 4045 */ - { 1, 0, sys_setgid, "setgid" }, /* 4046 */ - { 0, NF, sys_getgid, "getgid" }, /* 4047 */ - { 1, TS, sys_signal, "signal" }, /* 4048 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 4049 */ - { 0, NF, sys_getegid, "getegid" }, /* 4050 */ - { 1, TF, sys_acct, "acct" }, /* 4051 */ - { 2, TF, sys_umount2, "umount2" }, /* 4052 */ - { 0, 0, sys_lock, "lock" }, /* 4053 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 4054 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 4055 */ - { 0, 0, sys_mpx, "mpx" }, /* 4056 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 4057 */ - { 0, 0, sys_ulimit, "ulimit" }, /* 4058 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 4059 */ - { 1, 0, sys_umask, "umask" }, /* 4060 */ - { 1, TF, sys_chroot, "chroot" }, /* 4061 */ - { 2, 0, sys_ustat, "ustat" }, /* 4062 */ - { 2, TD, sys_dup2, "dup2" }, /* 4063 */ - { 0, 0, sys_getppid, "getppid" }, /* 4064 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 4065 */ - { 0, 0, sys_setsid, "setsid" }, /* 4066 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 4067 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 4068 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 4069 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 4070 */ - { 2, 0, sys_setregid, "setregid" }, /* 4071 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 4072 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 4073 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 4074 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 4075 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 4076 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 4077 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 4078 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 4079 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 4080 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 4081 */ - { 0, 0, printargs, "reserved82" }, /* 4082 */ - { 2, TF, sys_symlink, "symlink" }, /* 4083 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 4084 */ - { 3, TF, sys_readlink, "readlink" }, /* 4085 */ - { 1, TF, sys_uselib, "uselib" }, /* 4086 */ - { 2, TF, sys_swapon, "swapon" }, /* 4087 */ - { 4, 0, sys_reboot, "reboot" }, /* 4088 */ - { 3, TD, sys_readdir, "readdir" }, /* 4089 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 4090 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 4091 */ - { 2, TF, sys_truncate, "truncate" }, /* 4092 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 4093 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 4094 */ - { 3, TD, sys_fchown, "fchown" }, /* 4095 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 4096 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 4097 */ - { 0, 0, sys_profil, "profil" }, /* 4098 */ - { 3, TF, sys_statfs, "statfs" }, /* 4099 */ - { 3, TD, sys_fstatfs, "fstatfs" }, /* 4100 */ - { 0, 0, sys_ioperm, "ioperm" }, /* 4101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 4102 */ - { 3, 0, sys_syslog, "syslog" }, /* 4103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 4104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 4105 */ - { 2, TF, sys_stat, "stat" }, /* 4106 */ - { 2, TF, sys_lstat, "lstat" }, /* 4107 */ - { 2, TD, sys_fstat, "fstat" }, /* 4108 */ - { 1, 0, sys_olduname, "olduname" }, /* 4109 */ - { 0, 0, sys_iopl, "iopl" }, /* 4110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 4111 */ - { 0, 0, sys_idle, "idle" }, /* 4112 */ - { 5, 0, sys_vm86old, "vm86" }, /* 4113 */ - { 4, TP, sys_wait4, "wait4" }, /* 4114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 4115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 4116 */ - { 6, TI, sys_ipc, "ipc" }, /* 4117 */ - { 1, TD, sys_fsync, "fsync" }, /* 4118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 4119 */ - { 5, TP, sys_clone, "clone" }, /* 4120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 4121 */ - { 1, 0, sys_uname, "uname" }, /* 4122 */ - { 0, 0, sys_modify_ldt, "modify_ldt" }, /* 4123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 4124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 4125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 4126 */ - { 2, 0, sys_create_module, "create_module" }, /* 4127 */ - { 3, 0, sys_init_module, "init_module" }, /* 4128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 4129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 4130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 4131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 4132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 4133 */ - { 2, 0, sys_bdflush, "bdflush" }, /* 4134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 4135 */ - { 1, 0, sys_personality, "personality" }, /* 4136 */ - { 0, 0, sys_afs_syscall, "afs_syscall" }, /* 4137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 4138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 4139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 4140 */ - { 3, TD, sys_getdents, "getdents" }, /* 4141 */ - { 5, TD, sys_select, "_newselect" }, /* 4142 */ - { 2, TD, sys_flock, "flock" }, /* 4143 */ - { 3, TM, sys_msync, "msync" }, /* 4144 */ - { 3, TD, sys_readv, "readv" }, /* 4145 */ - { 3, TD, sys_writev, "writev" }, /* 4146 */ - { 3, 0, printargs, "cacheflush" }, /* 4147 */ - { 3, 0, printargs, "cachectl" }, /* 4148 */ - { 4, 0, sys_sysmips, "sysmips" }, /* 4149 */ - { 0, 0, sys_setup, "setup" }, /* 4150 */ - { 1, 0, sys_getsid, "getsid" }, /* 4151 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 4152 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 4153 */ - { 2, TM, sys_mlock, "mlock" }, /* 4154 */ - { 2, TM, sys_munlock, "munlock" }, /* 4155 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 4156 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 4157 */ - { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 4158 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 4159 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 4160 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 4161 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 4162 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 4163 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 4164 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 4165 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 4166 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 4167 */ - { 3, TN, sys_accept, "accept" }, /* 4168 */ - { 3, TN, sys_bind, "bind" }, /* 4169 */ - { 3, TN, sys_connect, "connect" }, /* 4170 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 4171 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 4172 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 4173 */ - { 2, TN, sys_listen, "listen" }, /* 4174 */ - { 4, TN, sys_recv, "recv" }, /* 4175 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 4176 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 4177 */ - { 4, TN, sys_send, "send" }, /* 4178 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 4179 */ - { 6, TN, sys_sendto, "sendto" }, /* 4180 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 4181 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 4182 */ - { 3, TN, sys_socket, "socket" }, /* 4183 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 4184 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 4185 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 4186 */ - { 5, 0, sys_query_module, "query_module" }, /* 4187 */ - { 3, TD, sys_poll, "poll" }, /* 4188 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 4189 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 4190 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 4191 */ - { 5, 0, sys_prctl, "prctl" }, /* 4192 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 4193 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 4194 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 4195 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 4196 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"},/* 4197 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"},/* 4198 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 4199 */ - { 6, TD, sys_pread, "pread64" }, /* 4200 */ - { 6, TD, sys_pwrite, "pwrite64" }, /* 4201 */ - { 3, TF, sys_chown, "chown" }, /* 4202 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 4203 */ - { 2, 0, sys_capget, "capget" }, /* 4204 */ - { 2, 0, sys_capset, "capset" }, /* 4205 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 4206 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 4207 */ - { 5, TN, printargs, "getpmsg" }, /* 4208 */ - { 5, TN, printargs, "putpmsg" }, /* 4209 */ - { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" }, /* 4210 */ - { 4, TF, sys_truncate64, "truncate64" }, /* 4211 */ - { 4, TD, sys_ftruncate64, "ftruncate64" }, /* 4212 */ - { 2, TF, sys_stat64, "stat64" }, /* 4213 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 4214 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 4215 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 4216 */ - { 3, TM, sys_mincore, "mincore" }, /* 4217 */ - { 3, TM, sys_madvise, "madvise" }, /* 4218 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 4219 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 4220 */ - { 0, 0, NULL, NULL }, /* 4221 */ - { 0, 0, sys_gettid, "gettid" }, /* 4222 */ - { 5, TD, sys_readahead, "readahead" }, /* 4223 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 4224 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 4225 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 4226 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 4227 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 4228 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 4229 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 4230 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 4231 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 4232 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 4233 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 4234 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 4235 */ - { 2, TS, sys_kill, "tkill" }, /* 4236 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 4237 */ - { 6, 0, sys_futex, "futex" }, /* 4238 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 4239 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 4240 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 4241 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 4242 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 4243 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 4244 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 4245 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 4246 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 4247 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 4248 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 4249 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 4250 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 4251 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 4252 */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 4253 */ - { 7, TD, sys_fadvise64_64, "fadvise64_64" }, /* 4254 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 4255 */ - { 2, TD, sys_fstatfs64, "fstatfs64" }, /* 4256 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 4257 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 4258 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 4259 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 4260 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 4261 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 4262 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 4263 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 4264 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 4265 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 4266 */ - { 2, TF, sys_utimes, "utimes" }, /* 4267 */ - { 4, TM, sys_mbind, "mbind" }, /* 4268 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 4269 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 4270 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 4271 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 4272 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 4273 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive"}, /* 4274 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 4275 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 4276 */ - { 5, 0, sys_vserver, "vserver" }, /* 4277 */ - { 5, TP, sys_waitid, "waitid" }, /* 4278 */ - { 0, 0, NULL, NULL }, /* 4279 */ - { 5, 0, sys_add_key, "add_key" }, /* 4280 */ - { 4, 0, sys_request_key, "request_key" }, /* 4281 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 4282 */ - { 1, 0, sys_set_thread_area, "set_thread_area" }, /* 4283 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 4284 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 4285 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 4286 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 4287 */ - { 4, TD|TF, sys_openat, "openat" }, /* 4288 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 4289 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 4290 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 4291 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 4292 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 4293 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 4294 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 4295 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 4296 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 4297 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 4298 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 4299 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 4300 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 4301 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 4302 */ - { 1, TP, sys_unshare, "unshare" }, /* 4303 */ - { 6, TD, sys_splice, "splice" }, /* 4304 */ - { 7, TD, sys_sync_file_range, "sync_file_range" }, /* 4305 */ - { 4, TD, sys_tee, "tee" }, /* 4306 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 4307 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 4308 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 4309 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 4310 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 4311 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 4312 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 4313 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 4314 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 4315 */ - { 4, 0, printargs, "utimensat" }, /* 4316 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 4317 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 4318 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 4319 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 4320 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 4321 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 4322 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 4323 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 4324 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 4325 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 4326 */ - { 3, TD, sys_dup3, "dup3" }, /* 4327 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 4328 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 4329 */ - { 5, TD, sys_preadv, "preadv" }, /* 4330 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 4331 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 4332 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 4333 */ - { 4, TN, sys_accept4, "accept4" }, /* 4334 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 4335 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 4336 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 4337 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 4338 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 4339 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 4340 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 4341 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 4342 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 4343 */ - { 2, TD, sys_setns, "setns" }, /* 4344 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 4345 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 4346 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 4347 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 4348 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 4349 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 4350 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 4351 */ +/* For an O32 strace, decode the o32 syscalls. */ +[4000] = { MA, 0, SEN(syscall), "syscall" }, /* start of Linux o32 */ +[4001] = { 1, TP|SE, SEN(exit), "exit" }, +[4002] = { 0, TP, SEN(fork), "fork" }, +[4003] = { 3, TD, SEN(read), "read" }, +[4004] = { 3, TD, SEN(write), "write" }, +[4005] = { 3, TD|TF, SEN(open), "open" }, +[4006] = { 1, TD, SEN(close), "close" }, +[4007] = { 3, TP, SEN(waitpid), "waitpid" }, +[4008] = { 2, TD|TF, SEN(creat), "creat" }, +[4009] = { 2, TF, SEN(link), "link" }, +[4010] = { 1, TF, SEN(unlink), "unlink" }, +[4011] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[4012] = { 1, TF, SEN(chdir), "chdir" }, +[4013] = { 1, 0, SEN(time), "time" }, +[4014] = { 3, TF, SEN(mknod), "mknod" }, +[4015] = { 2, TF, SEN(chmod), "chmod" }, +[4016] = { 3, TF, SEN(chown), "lchown" }, +[4017] = { 0, TM, SEN(break), "break" }, +[4018] = { 2, TF, SEN(oldstat), "oldstat" }, +[4019] = { 3, TD, SEN(lseek), "lseek" }, +[4020] = { 0, NF, SEN(getpid), "getpid" }, +[4021] = { 5, TF, SEN(mount), "mount" }, +[4022] = { 1, TF, SEN(umount), "umount" }, +[4023] = { 1, 0, SEN(setuid), "setuid" }, +[4024] = { 0, NF, SEN(getuid), "getuid" }, +[4025] = { 1, 0, SEN(stime), "stime" }, +[4026] = { 4, 0, SEN(ptrace), "ptrace" }, +[4027] = { 1, 0, SEN(alarm), "alarm" }, +[4028] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[4029] = { 0, TS, SEN(pause), "pause" }, +[4030] = { 2, TF, SEN(utime), "utime" }, +[4031] = { 0, 0, SEN(stty), "stty" }, +[4032] = { 0, 0, SEN(gtty), "gtty" }, +[4033] = { 2, TF, SEN(access), "access" }, +[4034] = { 1, 0, SEN(nice), "nice" }, +[4035] = { 1, 0, SEN(ftime), "ftime" }, +[4036] = { 0, 0, SEN(sync), "sync" }, +[4037] = { 2, TS, SEN(kill), "kill" }, +[4038] = { 2, TF, SEN(rename), "rename" }, +[4039] = { 2, TF, SEN(mkdir), "mkdir" }, +[4040] = { 1, TF, SEN(rmdir), "rmdir" }, +[4041] = { 1, TD, SEN(dup), "dup" }, +[4042] = { 0, TD, SEN(pipe), "pipe" }, +[4043] = { 1, 0, SEN(times), "times" }, +[4044] = { 0, 0, SEN(prof), "prof" }, +[4045] = { 1, TM|SI, SEN(brk), "brk" }, +[4046] = { 1, 0, SEN(setgid), "setgid" }, +[4047] = { 0, NF, SEN(getgid), "getgid" }, +[4048] = { 2, TS, SEN(signal), "signal" }, +[4049] = { 0, NF, SEN(geteuid), "geteuid" }, +[4050] = { 0, NF, SEN(getegid), "getegid" }, +[4051] = { 1, TF, SEN(acct), "acct" }, +[4052] = { 2, TF, SEN(umount2), "umount2" }, +[4053] = { 0, 0, SEN(lock), "lock" }, +[4054] = { 3, TD, SEN(ioctl), "ioctl" }, +[4055] = { 3, TD, SEN(fcntl), "fcntl" }, +[4056] = { 0, 0, SEN(mpx), "mpx" }, +[4057] = { 2, 0, SEN(setpgid), "setpgid" }, +[4058] = { 0, 0, SEN(ulimit), "ulimit" }, +[4059] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[4060] = { 1, NF, SEN(umask), "umask" }, +[4061] = { 1, TF, SEN(chroot), "chroot" }, +[4062] = { 2, 0, SEN(ustat), "ustat" }, +[4063] = { 2, TD, SEN(dup2), "dup2" }, +[4064] = { 0, NF, SEN(getppid), "getppid" }, +[4065] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[4066] = { 0, 0, SEN(setsid), "setsid" }, +[4067] = { 3, TS, SEN(sigaction), "sigaction" }, +[4068] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[4069] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[4070] = { 2, 0, SEN(setreuid), "setreuid" }, +[4071] = { 2, 0, SEN(setregid), "setregid" }, +[4072] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[4073] = { 1, TS, SEN(sigpending), "sigpending" }, +[4074] = { 2, 0, SEN(sethostname), "sethostname" }, +[4075] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[4076] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[4077] = { 2, 0, SEN(getrusage), "getrusage" }, +[4078] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[4079] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[4080] = { 2, 0, SEN(getgroups), "getgroups" }, +[4081] = { 2, 0, SEN(setgroups), "setgroups" }, +[4082] = { 0, 0, SEN(printargs), "reserved82" }, +[4083] = { 2, TF, SEN(symlink), "symlink" }, +[4084] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[4085] = { 3, TF, SEN(readlink), "readlink" }, +[4086] = { 1, TF, SEN(uselib), "uselib" }, +[4087] = { 2, TF, SEN(swapon), "swapon" }, +[4088] = { 4, 0, SEN(reboot), "reboot" }, +[4089] = { 3, TD, SEN(readdir), "readdir" }, +[4090] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[4091] = { 2, TM|SI, SEN(munmap), "munmap" }, +[4092] = { 2, TF, SEN(truncate), "truncate" }, +[4093] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[4094] = { 2, TD, SEN(fchmod), "fchmod" }, +[4095] = { 3, TD, SEN(fchown), "fchown" }, +[4096] = { 2, 0, SEN(getpriority), "getpriority" }, +[4097] = { 3, 0, SEN(setpriority), "setpriority" }, +[4098] = { 0, 0, SEN(profil), "profil" }, +[4099] = { 2, TF, SEN(statfs), "statfs" }, +[4100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[4101] = { 3, 0, SEN(ioperm), "ioperm" }, +[4102] = { 2, TD, SEN(socketcall), "socketcall" }, +[4103] = { 3, 0, SEN(syslog), "syslog" }, +[4104] = { 3, 0, SEN(setitimer), "setitimer" }, +[4105] = { 2, 0, SEN(getitimer), "getitimer" }, +[4106] = { 2, TF, SEN(stat), "stat" }, +[4107] = { 2, TF, SEN(lstat), "lstat" }, +[4108] = { 2, TD, SEN(fstat), "fstat" }, +[4109] = { 1, 0, SEN(olduname), "olduname" }, +[4110] = { 1, 0, SEN(iopl), "iopl" }, +[4111] = { 0, 0, SEN(vhangup), "vhangup" }, +[4112] = { 0, 0, SEN(idle), "idle" }, +[4113] = { 5, 0, SEN(vm86old), "vm86" }, +[4114] = { 4, TP, SEN(wait4), "wait4" }, +[4115] = { 1, TF, SEN(swapoff), "swapoff" }, +[4116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[4117] = { 6, TI, SEN(ipc), "ipc" }, +[4118] = { 1, TD, SEN(fsync), "fsync" }, +[4119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[4120] = { 5, TP, SEN(clone), "clone" }, +[4121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[4122] = { 1, 0, SEN(uname), "uname" }, +[4123] = { 0, 0, SEN(modify_ldt), "modify_ldt" }, +[4124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[4125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[4126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[4127] = { 2, 0, SEN(create_module), "create_module" }, +[4128] = { 3, 0, SEN(init_module), "init_module" }, +[4129] = { 2, 0, SEN(delete_module), "delete_module" }, +[4130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[4131] = { 4, TF, SEN(quotactl), "quotactl" }, +[4132] = { 1, 0, SEN(getpgid), "getpgid" }, +[4133] = { 1, TD, SEN(fchdir), "fchdir" }, +[4134] = { 2, 0, SEN(bdflush), "bdflush" }, +[4135] = { 3, 0, SEN(sysfs), "sysfs" }, +[4136] = { 1, NF, SEN(personality), "personality" }, +[4137] = { 0, 0, SEN(afs_syscall), "afs_syscall" }, +[4138] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[4139] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[4140] = { 5, TD, SEN(llseek), "_llseek" }, +[4141] = { 3, TD, SEN(getdents), "getdents" }, +[4142] = { 5, TD, SEN(select), "_newselect" }, +[4143] = { 2, TD, SEN(flock), "flock" }, +[4144] = { 3, TM, SEN(msync), "msync" }, +[4145] = { 3, TD, SEN(readv), "readv" }, +[4146] = { 3, TD, SEN(writev), "writev" }, +[4147] = { 3, 0, SEN(printargs), "cacheflush" }, +[4148] = { 3, 0, SEN(printargs), "cachectl" }, +[4149] = { 4, 0, SEN(sysmips), "sysmips" }, +[4150] = { 0, 0, SEN(setup), "setup" }, +[4151] = { 1, 0, SEN(getsid), "getsid" }, +[4152] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[4153] = { 1, 0, SEN(sysctl), "_sysctl" }, +[4154] = { 2, TM, SEN(mlock), "mlock" }, +[4155] = { 2, TM, SEN(munlock), "munlock" }, +[4156] = { 1, TM, SEN(mlockall), "mlockall" }, +[4157] = { 0, TM, SEN(munlockall), "munlockall" }, +[4158] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[4159] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[4160] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[4161] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[4162] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[4163] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[4164] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[4165] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[4166] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[4167] = { 5, TM|SI, SEN(mremap), "mremap" }, +[4168] = { 3, TN, SEN(accept), "accept" }, +[4169] = { 3, TN, SEN(bind), "bind" }, +[4170] = { 3, TN, SEN(connect), "connect" }, +[4171] = { 3, TN, SEN(getpeername), "getpeername" }, +[4172] = { 3, TN, SEN(getsockname), "getsockname" }, +[4173] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[4174] = { 2, TN, SEN(listen), "listen" }, +[4175] = { 4, TN, SEN(recv), "recv" }, +[4176] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[4177] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[4178] = { 4, TN, SEN(send), "send" }, +[4179] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[4180] = { 6, TN, SEN(sendto), "sendto" }, +[4181] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[4182] = { 2, TN, SEN(shutdown), "shutdown" }, +[4183] = { 3, TN, SEN(socket), "socket" }, +[4184] = { 4, TN, SEN(socketpair), "socketpair" }, +[4185] = { 3, 0, SEN(setresuid), "setresuid" }, +[4186] = { 3, 0, SEN(getresuid), "getresuid" }, +[4187] = { 5, 0, SEN(query_module), "query_module" }, +[4188] = { 3, TD, SEN(poll), "poll" }, +[4189] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[4190] = { 3, 0, SEN(setresgid), "setresgid" }, +[4191] = { 3, 0, SEN(getresgid), "getresgid" }, +[4192] = { 5, 0, SEN(prctl), "prctl" }, +[4193] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[4194] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[4195] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[4196] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[4197] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[4198] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[4199] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[4200] = { 6, TD, SEN(pread), "pread64" }, +[4201] = { 6, TD, SEN(pwrite), "pwrite64" }, +[4202] = { 3, TF, SEN(chown), "chown" }, +[4203] = { 2, TF, SEN(getcwd), "getcwd" }, +[4204] = { 2, 0, SEN(capget), "capget" }, +[4205] = { 2, 0, SEN(capset), "capset" }, +[4206] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[4207] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[4208] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[4209] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[4210] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +[4211] = { 4, TF, SEN(truncate64), "truncate64" }, +[4212] = { 4, TD, SEN(ftruncate64), "ftruncate64" }, +[4213] = { 2, TF, SEN(stat64), "stat64" }, +[4214] = { 2, TF, SEN(lstat64), "lstat64" }, +[4215] = { 2, TD, SEN(fstat64), "fstat64" }, +[4216] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[4217] = { 3, TM, SEN(mincore), "mincore" }, +[4218] = { 3, TM, SEN(madvise), "madvise" }, +[4219] = { 3, TD, SEN(getdents64), "getdents64" }, +[4220] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[4221] = { }, +[4222] = { 0, NF, SEN(gettid), "gettid" }, +[4223] = { 5, TD, SEN(readahead), "readahead" }, +[4224] = { 5, TF, SEN(setxattr), "setxattr" }, +[4225] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[4226] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[4227] = { 4, TF, SEN(getxattr), "getxattr" }, +[4228] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[4229] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[4230] = { 3, TF, SEN(listxattr), "listxattr" }, +[4231] = { 3, TF, SEN(listxattr), "llistxattr" }, +[4232] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[4233] = { 2, TF, SEN(removexattr), "removexattr" }, +[4234] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[4235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[4236] = { 2, TS, SEN(kill), "tkill" }, +[4237] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[4238] = { 6, 0, SEN(futex), "futex" }, +[4239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[4240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[4241] = { 2, TM, SEN(io_setup), "io_setup" }, +[4242] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[4243] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[4244] = { 3, 0, SEN(io_submit), "io_submit" }, +[4245] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[4246] = { 1, TP|SE, SEN(exit), "exit_group" }, +[4247] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[4248] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[4249] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[4250] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[4251] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[4252] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[4253] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[4254] = { 7, TD, SEN(fadvise64_64), "fadvise64" }, +[4255] = { 3, TF, SEN(statfs64), "statfs64" }, +[4256] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[4257] = { 3, 0, SEN(timer_create), "timer_create" }, +[4258] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[4259] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[4260] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[4261] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[4262] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[4263] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[4264] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[4265] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[4266] = { 3, TS, SEN(tgkill), "tgkill" }, +[4267] = { 2, TF, SEN(utimes), "utimes" }, +[4268] = { 6, TM, SEN(mbind), "mbind" }, +[4269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[4270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[4271] = { 4, 0, SEN(mq_open), "mq_open" }, +[4272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[4273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[4274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[4275] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[4276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[4277] = { 5, 0, SEN(vserver), "vserver" }, +[4278] = { 5, TP, SEN(waitid), "waitid" }, +[4279] = { }, +[4280] = { 5, 0, SEN(add_key), "add_key" }, +[4281] = { 4, 0, SEN(request_key), "request_key" }, +[4282] = { 5, 0, SEN(keyctl), "keyctl" }, +[4283] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[4284] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[4285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[4286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[4287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[4288] = { 4, TD|TF, SEN(openat), "openat" }, +[4289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[4290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[4291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[4292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[4293] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[4294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[4295] = { 4, TD|TF, SEN(renameat), "renameat" }, +[4296] = { 5, TD|TF, SEN(linkat), "linkat" }, +[4297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[4298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[4299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[4300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[4301] = { 6, TD, SEN(pselect6), "pselect6" }, +[4302] = { 5, TD, SEN(ppoll), "ppoll" }, +[4303] = { 1, TP, SEN(unshare), "unshare" }, +[4304] = { 6, TD, SEN(splice), "splice" }, +[4305] = { 7, TD, SEN(sync_file_range), "sync_file_range" }, +[4306] = { 4, TD, SEN(tee), "tee" }, +[4307] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[4308] = { 6, TM, SEN(move_pages), "move_pages" }, +[4309] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[4310] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[4311] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[4312] = { 3, 0, SEN(getcpu), "getcpu" }, +[4313] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[4314] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[4315] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[4316] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[4317] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[4318] = { 4, TD, SEN(timerfd), "timerfd" }, +[4319] = { 1, TD, SEN(eventfd), "eventfd" }, +[4320] = { 6, TD, SEN(fallocate), "fallocate" }, +[4321] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[4322] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[4323] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[4324] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[4325] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[4326] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[4327] = { 3, TD, SEN(dup3), "dup3" }, +[4328] = { 2, TD, SEN(pipe2), "pipe2" }, +[4329] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[4330] = { 5, TD, SEN(preadv), "preadv" }, +[4331] = { 5, TD, SEN(pwritev), "pwritev" }, +[4332] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[4333] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[4334] = { 4, TN, SEN(accept4), "accept4" }, +[4335] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[4336] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[4337] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[4338] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[4339] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[4340] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[4341] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[4342] = { 1, TD, SEN(syncfs), "syncfs" }, +[4343] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[4344] = { 2, TD, SEN(setns), "setns" }, +[4345] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[4346] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[4347] = { 5, 0, SEN(kcmp), "kcmp" }, +[4348] = { 3, TD, SEN(finit_module), "finit_module" }, +[4349] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[4350] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[4351] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[4352] = { 3, 0, SEN(seccomp), "seccomp" }, +[4353] = { 3, 0, SEN(getrandom), "getrandom" }, +[4354] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[4355] = { 3, TD, SEN(bpf), "bpf" }, +[4356] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[4357] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[4358] = { 2, 0, SEN(membarrier), "membarrier" }, +[4359] = { 3, TM, SEN(mlock2), "mlock2" }, +[4360] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[4361] = { 6, TD, SEN(preadv2), "preadv2" }, +[4362] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[4363] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[4364] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[4365] = { 1, 0, SEN(pkey_free), "pkey_free" }, + +# define SYS_socket_subcall 4400 +# include "subcall.h" + #else - { 0, 0, printargs, "o32_syscall" }, /* 4000 */ - { 1, TP|SE, printargs, "o32_exit" }, /* 4001 */ - { 0, TP, printargs, "o32_fork" }, /* 4002 */ - { 0, 0, printargs, "o32_read" }, /* 4003 */ - { 0, 0, printargs, "o32_write" }, /* 4004 */ - { 0, 0, printargs, "o32_open" }, /* 4005 */ - { 0, 0, printargs, "o32_close" }, /* 4006 */ - { 3, TP, printargs, "o32_waitpid" }, /* 4007 */ - { 0, 0, printargs, "o32_creat" }, /* 4008 */ - { 0, 0, printargs, "o32_link" }, /* 4009 */ - { 0, 0, printargs, "o32_unlink" }, /* 4010 */ - { 3, TF|TP|SE|SI, printargs, "o32_execve" }, /* 4011 */ - { 0, 0, printargs, "o32_chdir" }, /* 4012 */ - { 0, 0, printargs, "o32_time" }, /* 4013 */ - { 0, 0, printargs, "o32_mknod" }, /* 4014 */ - { 0, 0, printargs, "o32_chmod" }, /* 4015 */ - { 0, 0, printargs, "o32_lchown" }, /* 4016 */ - { 0, TM, printargs, "o32_break" }, /* 4017 */ - { 0, 0, printargs, "o32_oldstat" }, /* 4018 */ - { 0, 0, printargs, "o32_lseek" }, /* 4019 */ - { 0, 0, printargs, "o32_getpid" }, /* 4020 */ - { 0, 0, printargs, "o32_mount" }, /* 4021 */ - { 0, 0, printargs, "o32_umount" }, /* 4022 */ - { 0, 0, printargs, "o32_setuid" }, /* 4023 */ - { 0, 0, printargs, "o32_getuid" }, /* 4024 */ - { 0, 0, printargs, "o32_stime" }, /* 4025 */ - { 0, 0, printargs, "o32_ptrace" }, /* 4026 */ - { 0, 0, printargs, "o32_alarm" }, /* 4027 */ - { 0, 0, printargs, "o32_oldfstat" }, /* 4028 */ - { 0, 0, printargs, "o32_pause" }, /* 4029 */ - { 0, 0, printargs, "o32_utime" }, /* 4030 */ - { 0, 0, printargs, "o32_stty" }, /* 4031 */ - { 0, 0, printargs, "o32_gtty" }, /* 4032 */ - { 0, 0, printargs, "o32_access" }, /* 4033 */ - { 0, 0, printargs, "o32_nice" }, /* 4034 */ - { 0, 0, printargs, "o32_ftime" }, /* 4035 */ - { 0, 0, printargs, "o32_sync" }, /* 4036 */ - { 0, 0, printargs, "o32_kill" }, /* 4037 */ - { 0, 0, printargs, "o32_rename" }, /* 4038 */ - { 0, 0, printargs, "o32_mkdir" }, /* 4039 */ - { 0, 0, printargs, "o32_rmdir" }, /* 4040 */ - { 0, 0, printargs, "o32_dup" }, /* 4041 */ - { 0, 0, printargs, "o32_pipe" }, /* 4042 */ - { 0, 0, printargs, "o32_times" }, /* 4043 */ - { 0, 0, printargs, "o32_prof" }, /* 4044 */ - { 0, TM|SI, printargs, "o32_brk" }, /* 4045 */ - { 0, 0, printargs, "o32_setgid" }, /* 4046 */ - { 0, 0, printargs, "o32_getgid" }, /* 4047 */ - { 0, 0, printargs, "o32_signal" }, /* 4048 */ - { 0, 0, printargs, "o32_geteuid" }, /* 4049 */ - { 0, 0, printargs, "o32_getegid" }, /* 4050 */ - { 0, 0, printargs, "o32_acct" }, /* 4051 */ - { 0, 0, printargs, "o32_umount2" }, /* 4052 */ - { 0, 0, printargs, "o32_lock" }, /* 4053 */ - { 0, 0, printargs, "o32_ioctl" }, /* 4054 */ - { 0, 0, printargs, "o32_fcntl" }, /* 4055 */ - { 0, 0, printargs, "o32_mpx" }, /* 4056 */ - { 0, 0, printargs, "o32_setpgid" }, /* 4057 */ - { 0, 0, printargs, "o32_ulimit" }, /* 4058 */ - { 0, 0, printargs, "o32_oldolduname" }, /* 4059 */ - { 0, 0, printargs, "o32_umask" }, /* 4060 */ - { 0, 0, printargs, "o32_chroot" }, /* 4061 */ - { 0, 0, printargs, "o32_ustat" }, /* 4062 */ - { 0, 0, printargs, "o32_dup2" }, /* 4063 */ - { 0, 0, printargs, "o32_getppid" }, /* 4064 */ - { 0, 0, printargs, "o32_getpgrp" }, /* 4065 */ - { 0, 0, printargs, "o32_setsid" }, /* 4066 */ - { 0, 0, printargs, "o32_sigaction" }, /* 4067 */ - { 0, 0, printargs, "o32_siggetmask" }, /* 4068 */ - { 0, 0, printargs, "o32_sigsetmask" }, /* 4069 */ - { 0, 0, printargs, "o32_setreuid" }, /* 4070 */ - { 0, 0, printargs, "o32_setregid" }, /* 4071 */ - { 0, 0, printargs, "o32_sigsuspend" }, /* 4072 */ - { 0, 0, printargs, "o32_sigpending" }, /* 4073 */ - { 0, 0, printargs, "o32_sethostname" }, /* 4074 */ - { 0, 0, printargs, "o32_setrlimit" }, /* 4075 */ - { 0, 0, printargs, "o32_getrlimit" }, /* 4076 */ - { 0, 0, printargs, "o32_getrusage" }, /* 4077 */ - { 0, 0, printargs, "o32_gettimeofday" }, /* 4078 */ - { 0, 0, printargs, "o32_settimeofday" }, /* 4079 */ - { 0, 0, printargs, "o32_getgroups" }, /* 4080 */ - { 0, 0, printargs, "o32_setgroups" }, /* 4081 */ - { 0, 0, printargs, "o32_reserved82" }, /* 4082 */ - { 0, 0, printargs, "o32_symlink" }, /* 4083 */ - { 0, 0, printargs, "o32_oldlstat" }, /* 4084 */ - { 0, 0, printargs, "o32_readlink" }, /* 4085 */ - { 0, 0, printargs, "o32_uselib" }, /* 4086 */ - { 0, 0, printargs, "o32_swapon" }, /* 4087 */ - { 0, 0, printargs, "o32_reboot" }, /* 4088 */ - { 0, 0, printargs, "o32_readdir" }, /* 4089 */ - { 0, TD|TM|SI, printargs, "o32_mmap" }, /* 4090 */ - { 0, TM|SI, printargs, "o32_munmap" }, /* 4091 */ - { 0, 0, printargs, "o32_truncate" }, /* 4092 */ - { 0, 0, printargs, "o32_ftruncate" }, /* 4093 */ - { 0, 0, printargs, "o32_fchmod" }, /* 4094 */ - { 0, 0, printargs, "o32_fchown" }, /* 4095 */ - { 0, 0, printargs, "o32_getpriority" }, /* 4096 */ - { 0, 0, printargs, "o32_setpriority" }, /* 4097 */ - { 0, 0, printargs, "o32_profil" }, /* 4098 */ - { 0, 0, printargs, "o32_statfs" }, /* 4099 */ - { 0, 0, printargs, "o32_fstatfs" }, /* 4100 */ - { 0, 0, printargs, "o32_ioperm" }, /* 4101 */ - { 0, 0, printargs, "o32_socketcall" }, /* 4102 */ - { 0, 0, printargs, "o32_syslog" }, /* 4103 */ - { 0, 0, printargs, "o32_setitimer" }, /* 4104 */ - { 0, 0, printargs, "o32_getitimer" }, /* 4105 */ - { 0, 0, printargs, "o32_stat" }, /* 4106 */ - { 0, 0, printargs, "o32_lstat" }, /* 4107 */ - { 0, 0, printargs, "o32_fstat" }, /* 4108 */ - { 0, 0, printargs, "o32_olduname" }, /* 4109 */ - { 0, 0, printargs, "o32_iopl" }, /* 4110 */ - { 0, 0, printargs, "o32_vhangup" }, /* 4111 */ - { 0, 0, printargs, "o32_idle" }, /* 4112 */ - { 0, 0, printargs, "o32_vm86" }, /* 4113 */ - { 4, TP, printargs, "o32_wait4" }, /* 4114 */ - { 0, 0, printargs, "o32_swapoff" }, /* 4115 */ - { 0, 0, printargs, "o32_sysinfo" }, /* 4116 */ - { 0, 0, printargs, "o32_ipc" }, /* 4117 */ - { 0, 0, printargs, "o32_fsync" }, /* 4118 */ - { 0, 0, printargs, "o32_sigreturn" }, /* 4119 */ - { 5, TP, printargs, "o32_clone" }, /* 4120 */ - { 0, 0, printargs, "o32_setdomainname" }, /* 4121 */ - { 0, 0, printargs, "o32_uname" }, /* 4122 */ - { 0, 0, printargs, "o32_modify_ldt" }, /* 4123 */ - { 0, 0, printargs, "o32_adjtimex" }, /* 4124 */ - { 0, TM|SI, printargs, "o32_mprotect" }, /* 4125 */ - { 0, 0, printargs, "o32_sigprocmask" }, /* 4126 */ - { 0, 0, printargs, "o32_create_module" }, /* 4127 */ - { 0, 0, printargs, "o32_init_module" }, /* 4128 */ - { 0, 0, printargs, "o32_delete_module" }, /* 4129 */ - { 0, 0, printargs, "o32_get_kernel_syms"}, /* 4130 */ - { 0, TF, printargs, "o32_quotactl" }, /* 4131 */ - { 0, 0, printargs, "o32_getpgid" }, /* 4132 */ - { 0, 0, printargs, "o32_fchdir" }, /* 4133 */ - { 0, 0, printargs, "o32_bdflush" }, /* 4134 */ - { 0, 0, printargs, "o32_sysfs" }, /* 4135 */ - { 0, 0, printargs, "o32_personality" }, /* 4136 */ - { 0, 0, printargs, "o32_afs_syscall" }, /* 4137 */ - { 0, 0, printargs, "o32_setfsuid" }, /* 4138 */ - { 0, 0, printargs, "o32_setfsgid" }, /* 4139 */ - { 0, 0, printargs, "o32__llseek" }, /* 4140 */ - { 0, 0, printargs, "o32_getdents" }, /* 4141 */ - { 0, 0, printargs, "o32__newselect" }, /* 4142 */ - { 0, 0, printargs, "o32_flock" }, /* 4143 */ - { 0, TM, printargs, "o32_msync" }, /* 4144 */ - { 0, 0, printargs, "o32_readv" }, /* 4145 */ - { 0, 0, printargs, "o32_writev" }, /* 4146 */ - { 0, 0, printargs, "o32_cacheflush" }, /* 4147 */ - { 0, 0, printargs, "o32_cachectl" }, /* 4148 */ - { 0, 0, printargs, "o32_sysmips" }, /* 4149 */ - { 0, 0, printargs, "o32_setup" }, /* 4150 */ - { 0, 0, printargs, "o32_getsid" }, /* 4151 */ - { 0, 0, printargs, "o32_fdatasync" }, /* 4152 */ - { 0, 0, printargs, "o32__sysctl" }, /* 4153 */ - { 0, TM, printargs, "o32_mlock" }, /* 4154 */ - { 0, TM, printargs, "o32_munlock" }, /* 4155 */ - { 0, TM, printargs, "o32_mlockall" }, /* 4156 */ - { 0, TM, printargs, "o32_munlockall" }, /* 4157 */ - { 0, 0, printargs, "o32_sched_setparam"}, /* 4158 */ - { 0, 0, printargs, "o32_sched_getparam"}, /* 4159 */ - { 0, 0, printargs, "o32_sched_setscheduler"}, /* 4160 */ - { 0, 0, printargs, "o32_sched_getscheduler"}, /* 4161 */ - { 0, 0, printargs, "o32_sched_yield" }, /* 4162 */ - { 0, 0, printargs, "o32_sched_get_priority_max"}, /* 4163 */ - { 0, 0, printargs, "o32_sched_get_priority_min"},/* 4164 */ - { 0, 0, printargs, "o32_sched_rr_get_interval"}, /* 4165 */ - { 0, 0, printargs, "o32_nanosleep" }, /* 4166 */ - { 0, TM|SI, printargs, "o32_mremap" }, /* 4167 */ - { 0, 0, printargs, "o32_accept" }, /* 4168 */ - { 0, 0, printargs, "o32_bind" }, /* 4169 */ - { 0, 0, printargs, "o32_connect" }, /* 4170 */ - { 0, 0, printargs, "o32_getpeername" }, /* 4171 */ - { 0, 0, printargs, "o32_getsockname" }, /* 4172 */ - { 0, 0, printargs, "o32_getsockopt" }, /* 4173 */ - { 0, 0, printargs, "o32_listen" }, /* 4174 */ - { 0, 0, printargs, "o32_recv" }, /* 4175 */ - { 0, 0, printargs, "o32_recvfrom" }, /* 4176 */ - { 0, 0, printargs, "o32_recvmsg" }, /* 4177 */ - { 0, 0, printargs, "o32_send" }, /* 4178 */ - { 0, 0, printargs, "o32_sendmsg" }, /* 4179 */ - { 0, 0, printargs, "o32_sendto" }, /* 4180 */ - { 0, 0, printargs, "o32_setsockopt" }, /* 4181 */ - { 0, 0, printargs, "o32_shutdown" }, /* 4182 */ - { 0, 0, printargs, "o32_socket" }, /* 4183 */ - { 0, 0, printargs, "o32_socketpair" }, /* 4184 */ - { 0, 0, printargs, "o32_setresuid" }, /* 4185 */ - { 0, 0, printargs, "o32_getresuid" }, /* 4186 */ - { 0, 0, printargs, "o32_query_module" }, /* 4187 */ - { 0, 0, printargs, "o32_poll" }, /* 4188 */ - { 0, 0, printargs, "o32_nfsservctl" }, /* 4189 */ - { 0, 0, printargs, "o32_setresgid" }, /* 4190 */ - { 0, 0, printargs, "o32_getresgid" }, /* 4191 */ - { 0, 0, printargs, "o32_prctl" }, /* 4192 */ - { 0, 0, printargs, "o32_rt_sigreturn" }, /* 4193 */ - { 0, 0, printargs, "o32_rt_sigaction" }, /* 4194 */ - { 0, 0, printargs, "o32_rt_sigprocmask"}, /* 4195 */ - { 0, 0, printargs, "o32_rt_sigpending" }, /* 4196 */ - { 0, 0, printargs, "o32_rt_sigtimedwait"},/* 4197 */ - { 0, 0, printargs, "o32_rt_sigqueueinfo"},/* 4198 */ - { 0, 0, printargs, "o32_rt_siguspend" }, /* 4199 */ - { 0, 0, printargs, "o32_pread64" }, /* 4200 */ - { 0, 0, printargs, "o32_pwrite64" }, /* 4201 */ - { 0, 0, printargs, "o32_chown" }, /* 4202 */ - { 0, 0, printargs, "o32_getcwd" }, /* 4203 */ - { 0, 0, printargs, "o32_capget" }, /* 4204 */ - { 0, 0, printargs, "o32_capset" }, /* 4205 */ - { 0, 0, printargs, "o32_sigaltstack" }, /* 4206 */ - { 0, 0, printargs, "o32_sendfile" }, /* 4207 */ - { 5, TN, printargs, "o32_getpmsg" }, /* 4208 */ - { 5, TN, printargs, "o32_putpmsg" }, /* 4209 */ - { 6, TD|TM|SI, printargs, "o32_mmap2" }, /* 4210 */ - { 0, 0, printargs, "o32_truncate64" }, /* 4211 */ - { 0, 0, printargs, "o32_ftruncate64" }, /* 4212 */ - { 0, 0, printargs, "o32_stat64" }, /* 4213 */ - { 0, 0, printargs, "o32_lstat64" }, /* 4214 */ - { 0, 0, printargs, "o32_fstat64" }, /* 4215 */ - { 0, 0, printargs, "o32_pivot_root" }, /* 4216 */ - { 0, TM, printargs, "o32_mincore" }, /* 4217 */ - { 0, TM, printargs, "o32_madvise" }, /* 4218 */ - { 0, 0, printargs, "o32_getdents64" }, /* 4219 */ - { 0, 0, printargs, "o32_fcntl64" }, /* 4220 */ - { 0, 0, NULL, NULL }, /* 4221 */ - { 0, 0, printargs, "o32_gettid" }, /* 4222 */ - { 5, TD, printargs, "o32_readahead" }, /* 4223 */ - { 5, TF, printargs, "o32_setxattr" }, /* 4224 */ - { 5, TF, printargs, "o32_lsetxattr" }, /* 4225 */ - { 5, TD, printargs, "o32_fsetxattr" }, /* 4226 */ - { 4, TF, printargs, "o32_getxattr" }, /* 4227 */ - { 4, TF, printargs, "o32_lgetxattr" }, /* 4228 */ - { 4, TD, printargs, "o32_fgetxattr" }, /* 4229 */ - { 3, TF, printargs, "o32_listxattr" }, /* 4230 */ - { 3, TF, printargs, "o32_llistxattr" }, /* 4231 */ - { 3, TD, printargs, "o32_flistxattr" }, /* 4232 */ - { 2, TF, printargs, "o32_removexattr" }, /* 4233 */ - { 2, TF, printargs, "o32_lremovexattr" }, /* 4234 */ - { 2, TD, printargs, "o32_fremovexattr" }, /* 4235 */ - { 2, TS, printargs, "o32_tkill" }, /* 4236 */ - { 5, TD|TN, printargs, "o32_sendfile64" }, /* 4237 */ - { 6, 0, printargs, "o32_futex" }, /* 4238 */ - { 3, 0, printargs, "o32_sched_setaffinity"}, /* 4239 */ - { 3, 0, printargs, "o32_sched_getaffinity"}, /* 4240 */ - { 2, 0, printargs, "o32_io_setup" }, /* 4241 */ - { 1, 0, printargs, "o32_io_destroy" }, /* 4242 */ - { 5, 0, printargs, "o32_io_getevents" }, /* 4243 */ - { 3, 0, printargs, "o32_io_submit" }, /* 4244 */ - { 3, 0, printargs, "o32_io_cancel" }, /* 4245 */ - { 1, TP|SE, printargs, "o32_exit_group" }, /* 4246 */ - { 3, 0, printargs, "o32_lookup_dcookie"}, /* 4247 */ - { 1, TD, printargs, "o32_epoll_create" }, /* 4248 */ - { 4, TD, printargs, "o32_epoll_ctl" }, /* 4249 */ - { 4, TD, printargs, "o32_epoll_wait" }, /* 4250 */ - { 5, TM|SI, printargs, "o32_remap_file_pages"}, /* 4251 */ - { 1, 0, printargs, "o32_set_tid_address"}, /* 4252 */ - { 0, 0, printargs, "o32_restart_syscall"}, /* 4253 */ - { MA, 0, printargs, "o32_fadvise64_64" }, /* 4254 */ - { 3, TF, printargs, "o32_statfs64" }, /* 4255 */ - { 2, TD, printargs, "o32_fstatfs64" }, /* 4256 */ - { 3, 0, printargs, "o32_timer_create" }, /* 4257 */ - { 4, 0, printargs, "o32_timer_settime" }, /* 4258 */ - { 2, 0, printargs, "o32_timer_gettime" }, /* 4259 */ - { 1, 0, printargs, "o32_timer_getoverrun"}, /* 4260 */ - { 1, 0, printargs, "o32_timer_delete" }, /* 4261 */ - { 2, 0, printargs, "o32_clock_settime" }, /* 4262 */ - { 2, 0, printargs, "o32_clock_gettime" }, /* 4263 */ - { 2, 0, printargs, "o32_clock_getres" }, /* 4264 */ - { 4, 0, printargs, "o32_clock_nanosleep"}, /* 4265 */ - { 3, TS, printargs, "o32_tgkill" }, /* 4266 */ - { 2, TF, printargs, "o32_utimes" }, /* 4267 */ - { 4, TM, printargs, "o32_mbind" }, /* 4268 */ - { 5, TM, printargs, "o32_get_mempolicy" }, /* 4269 */ - { 3, TM, printargs, "o32_set_mempolicy" }, /* 4270 */ - { 4, 0, printargs, "o32_mq_open" }, /* 4271 */ - { 1, 0, printargs, "o32_mq_unlink" }, /* 4272 */ - { 5, 0, printargs, "o32_mq_timedsend" }, /* 4273 */ - { 5, 0, printargs, "o32_mq_timedreceive"}, /* 4274 */ - { 2, 0, printargs, "o32_mq_notify" }, /* 4275 */ - { 3, 0, printargs, "o32_mq_getsetattr" }, /* 4276 */ - { 5, 0, printargs, "o32_vserver" }, /* 4277 */ - { 5, TP, printargs, "o32_waitid" }, /* 4278 */ - { 0, 0, printargs, "o32_SYS_4279" }, /* 4279 */ - { 5, 0, printargs, "o32_add_key" }, /* 4280 */ - { 4, 0, printargs, "o32_request_key" }, /* 4281 */ - { 5, 0, printargs, "o32_keyctl" }, /* 4282 */ - { 1, 0, printargs, "o32_set_thread_area" }, /* 4283 */ - { 0, TD, printargs, "o32_inotify_init" }, /* 4284 */ - { 3, TD, printargs, "o32_inotify_add_watch" }, /* 4285 */ - { 2, TD, printargs, "o32_inotify_rm_watch" }, /* 4286 */ - { 4, TM, printargs, "o32_migrate_pages" }, /* 4287 */ - { 4, TD|TF, printargs, "o32_openat" }, /* 4288 */ - { 3, TD|TF, printargs, "o32_mkdirat" }, /* 4289 */ - { 4, TD|TF, printargs, "o32_mknodat" }, /* 4290 */ - { 5, TD|TF, printargs, "o32_fchownat" }, /* 4291 */ - { 3, TD|TF, printargs, "o32_futimesat" }, /* 4292 */ - { 4, TD|TF, printargs, "o32_fstatat64" }, /* 4293 */ - { 3, TD|TF, printargs, "o32_unlinkat" }, /* 4294 */ - { 4, TD|TF, printargs, "o32_renameat" }, /* 4295 */ - { 5, TD|TF, printargs, "o32_linkat" }, /* 4296 */ - { 3, TD|TF, printargs, "o32_symlinkat" }, /* 4297 */ - { 4, TD|TF, printargs, "o32_readlinkat" }, /* 4298 */ - { 3, TD|TF, printargs, "o32_fchmodat" }, /* 4299 */ - { 3, TD|TF, printargs, "o32_faccessat" }, /* 4300 */ - { 6, TD, printargs, "o32_pselect6" }, /* 4301 */ - { 5, TD, printargs, "o32_ppoll" }, /* 4302 */ - { 1, TP, printargs, "o32_unshare" }, /* 4303 */ - { 6, TD, printargs, "o32_splice" }, /* 4304 */ - { 4, TD, printargs, "o32_sync_file_range" }, /* 4305 */ - { 4, TD, printargs, "o32_tee" }, /* 4306 */ - { 4, TD, printargs, "o32_vmsplice" }, /* 4307 */ - { 6, TM, printargs, "o32_move_pages" }, /* 4308 */ - { 2, 0, printargs, "o32_set_robust_list" }, /* 4309 */ - { 3, 0, printargs, "o32_get_robust_list" }, /* 4310 */ - { 4, 0, printargs, "o32_kexec_load" }, /* 4311 */ - { 3, 0, printargs, "o32_getcpu" }, /* 4312 */ - { 5, TD, printargs, "o32_epoll_pwait" }, /* 4313 */ - { 3, 0, printargs, "o32_ioprio_set" }, /* 4314 */ - { 2, 0, printargs, "o32_ioprio_get" }, /* 4315 */ - { 4, 0, printargs, "o32_utimensat" }, /* 4316 */ - { 3, TD|TS, printargs, "o32_signalfd" }, /* 4317 */ - { 4, TD, printargs, "o32_timerfd" }, /* 4318 */ - { 1, TD, printargs, "o32_eventfd" }, /* 4319 */ - { 6, TD, printargs, "o32_fallocate" }, /* 4320 */ - { 2, TD, printargs, "o32_timerfd_create" }, /* 4321 */ - { 2, TD, printargs, "o32_timerfd_gettime" }, /* 4322 */ - { 4, TD, printargs, "o32_timerfd_settime" }, /* 4323 */ - { 4, TD|TS, printargs, "o32_signalfd4" }, /* 4324 */ - { 2, TD, printargs, "o32_eventfd2" }, /* 4325 */ - { 1, TD, printargs, "o32_epoll_create1" }, /* 4326 */ - { 3, TD, printargs, "o32_dup3" }, /* 4327 */ - { 2, TD, printargs, "o32_pipe2" }, /* 4328 */ - { 1, TD, printargs, "o32_inotify_init1" }, /* 4329 */ - { 5, TD, printargs, "o32_preadv" }, /* 4330 */ - { 5, TD, printargs, "o32_pwritev" }, /* 4331 */ - { 4, TP|TS, printargs, "o32_rt_tgsigqueueinfo" }, /* 4332 */ - { 5, TD, printargs, "o32_perf_event_open" }, /* 4333 */ - { 4, TN, printargs, "o32_accept4" }, /* 4334 */ - { 5, TN, printargs, "o32_recvmmsg" }, /* 4335 */ - { 2, TD, printargs, "o32_fanotify_init" }, /* 4336 */ - { 6, TD|TF, printargs, "o32_fanotify_mark" }, /* 4337 */ - { 4, 0, printargs, "o32_prlimit64" }, /* 4338 */ - { 5, TD|TF, printargs, "o32_name_to_handle_at"}, /* 4339 */ - { 3, TD, printargs, "o32_open_by_handle_at"}, /* 4340 */ - { 2, 0, printargs, "o32_clock_adjtime" }, /* 4341 */ - { 1, TD, printargs, "o32_syncfs" }, /* 4342 */ - { 4, TN, printargs, "o32_sendmmsg" }, /* 4343 */ - { 2, TD, printargs, "o32_setns" }, /* 4344 */ - { 6, 0, printargs, "o32_process_vm_readv" }, /* 4345 */ - { 6, 0, printargs, "o32_process_vm_writev" }, /* 4346 */ - { 5, 0, printargs, "o32_kcmp" }, /* 4347 */ - { 3, TD, printargs, "o32_finit_module" }, /* 4348 */ - { 3, 0, printargs, "o32_sched_setattr" }, /* 4349 */ - { 4, 0, printargs, "o32_sched_getattr" }, /* 4350 */ - { 5, TD|TF, printargs, "o32_renameat2" }, /* 4351 */ + +# include "syscallent-o32-stub.h" + #endif - [4349 ... 4999] = { }, /* 4999 */ /* end of Linux o32 */ diff --git a/linux/mips/userent.h b/linux/mips/userent.h new file mode 100644 index 00000000..1399142b --- /dev/null +++ b/linux/mips/userent.h @@ -0,0 +1,83 @@ +{ 0, "r0" }, +{ 1, "r1" }, +{ 2, "r2" }, +{ 3, "r3" }, +{ 4, "r4" }, +{ 5, "r5" }, +{ 6, "r6" }, +{ 7, "r7" }, +{ 8, "r8" }, +{ 9, "r9" }, +{ 10, "r10" }, +{ 11, "r11" }, +{ 12, "r12" }, +{ 13, "r13" }, +{ 14, "r14" }, +{ 15, "r15" }, +{ 16, "r16" }, +{ 17, "r17" }, +{ 18, "r18" }, +{ 19, "r19" }, +{ 20, "r20" }, +{ 21, "r21" }, +{ 22, "r22" }, +{ 23, "r23" }, +{ 24, "r24" }, +{ 25, "r25" }, +{ 26, "r26" }, +{ 27, "r27" }, +{ 28, "r28" }, +{ 29, "r29" }, +{ 30, "r30" }, +{ 31, "r31" }, +{ 32, "f0" }, +{ 33, "f1" }, +{ 34, "f2" }, +{ 35, "f3" }, +{ 36, "f4" }, +{ 37, "f5" }, +{ 38, "f6" }, +{ 39, "f7" }, +{ 40, "f8" }, +{ 41, "f9" }, +{ 42, "f10" }, +{ 43, "f11" }, +{ 44, "f12" }, +{ 45, "f13" }, +{ 46, "f14" }, +{ 47, "f15" }, +{ 48, "f16" }, +{ 49, "f17" }, +{ 50, "f18" }, +{ 51, "f19" }, +{ 52, "f20" }, +{ 53, "f21" }, +{ 54, "f22" }, +{ 55, "f23" }, +{ 56, "f24" }, +{ 57, "f25" }, +{ 58, "f26" }, +{ 59, "f27" }, +{ 60, "f28" }, +{ 61, "f29" }, +{ 62, "f30" }, +{ 63, "f31" }, +{ 64, "pc" }, +{ 65, "cause" }, +{ 66, "badvaddr" }, +{ 67, "mmhi" }, +{ 68, "mmlo" }, +{ 69, "fpcsr" }, +{ 70, "fpeir" }, +/* Other fields in "struct user" */ +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +XLAT_UOFF(start_data), +XLAT_UOFF(start_stack), +XLAT_UOFF(signal), +XLAT_UOFF(u_ar0), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/netlink_diag.h b/linux/netlink_diag.h new file mode 100644 index 00000000..a52507c7 --- /dev/null +++ b/linux/netlink_diag.h @@ -0,0 +1,29 @@ +#ifndef STRACE_LINUX_NETLINK_DIAG_H +#define STRACE_LINUX_NETLINK_DIAG_H + +struct netlink_diag_req { + uint8_t sdiag_family; + uint8_t sdiag_protocol; + uint16_t pad; + uint32_t ndiag_ino; + uint32_t ndiag_show; + uint32_t ndiag_cookie[2]; +}; + +struct netlink_diag_msg { + uint8_t ndiag_family; + uint8_t ndiag_type; + uint8_t ndiag_protocol; + uint8_t ndiag_state; + + uint32_t ndiag_portid; + uint32_t ndiag_dst_portid; + uint32_t ndiag_dst_group; + uint32_t ndiag_ino; + uint32_t ndiag_cookie[2]; +}; + +#define NDIAG_SHOW_MEMINFO 0x00000001 +#define NDIAG_PROTO_ALL ((uint8_t) ~0) + +#endif /* !STRACE_LINUX_NETLINK_DIAG_H */ diff --git a/linux/nios2/arch_regs.c b/linux/nios2/arch_regs.c new file mode 100644 index 00000000..2c30321f --- /dev/null +++ b/linux/nios2/arch_regs.c @@ -0,0 +1,3 @@ +static struct user_pt_regs nios2_regs; +# define ARCH_REGS_FOR_GETREGSET nios2_regs +#define ARCH_PC_REG nios2_regs.regs[PTR_EA] diff --git a/linux/nios2/get_error.c b/linux/nios2/get_error.c new file mode 100644 index 00000000..1c91c0ac --- /dev/null +++ b/linux/nios2/get_error.c @@ -0,0 +1,17 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + /* + * The system call convention specifies that r2 contains the return + * value on success or a positive error number on failure. A flag + * indicating successful completion is written to r7; r7=0 indicates + * the system call success, r7=1 indicates an error. The positive + * errno value written in r2. + */ + if (nios2_regs.regs[7]) { + tcp->u_rval = -1; + tcp->u_error = nios2_regs.regs[2]; + } else { + tcp->u_rval = nios2_regs.regs[2]; + } +} diff --git a/linux/nios2/get_scno.c b/linux/nios2/get_scno.c new file mode 100644 index 00000000..f4db85ee --- /dev/null +++ b/linux/nios2/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = nios2_regs.regs[2]; + return 1; +} diff --git a/linux/nios2/get_syscall_args.c b/linux/nios2/get_syscall_args.c new file mode 100644 index 00000000..707f594a --- /dev/null +++ b/linux/nios2/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = nios2_regs.regs[4]; + tcp->u_arg[1] = nios2_regs.regs[5]; + tcp->u_arg[2] = nios2_regs.regs[6]; + tcp->u_arg[3] = nios2_regs.regs[7]; + tcp->u_arg[4] = nios2_regs.regs[8]; + tcp->u_arg[5] = nios2_regs.regs[9]; + return 1; +} diff --git a/linux/nios2/ioctls_arch0.h b/linux/nios2/ioctls_arch0.h new file mode 100644 index 00000000..f015def4 --- /dev/null +++ b/linux/nios2/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/nios2/include/ tree. */ diff --git a/linux/nios2/ioctls_inc0.h b/linux/nios2/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/nios2/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/nios2/set_error.c b/linux/nios2/set_error.c new file mode 100644 index 00000000..ecef8aa2 --- /dev/null +++ b/linux/nios2/set_error.c @@ -0,0 +1,15 @@ +static int +arch_set_error(struct tcb *tcp) +{ + nios2_regs.regs[7] = 1; + nios2_regs.regs[2] = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + nios2_regs.regs[7] = 0; + nios2_regs.regs[2] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/nios2/set_scno.c b/linux/nios2/set_scno.c new file mode 100644 index 00000000..1f5051c2 --- /dev/null +++ b/linux/nios2/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + nios2_regs.regs[2] = scno; + return set_regs(tcp->pid); +} diff --git a/linux/nios2/syscallent.h b/linux/nios2/syscallent.h new file mode 100644 index 00000000..301fd0e2 --- /dev/null +++ b/linux/nios2/syscallent.h @@ -0,0 +1,4 @@ +#define sys_ARCH_mmap sys_mmap_pgoff +#include "32/syscallent.h" +/* [244 ... 259] are arch specific */ +[244] = {4, 0, SEN(cacheflush), "cacheflush"}, diff --git a/linux/or1k/arch_regs.c b/linux/or1k/arch_regs.c new file mode 100644 index 00000000..78693e5a --- /dev/null +++ b/linux/or1k/arch_regs.c @@ -0,0 +1,3 @@ +static struct user_regs_struct or1k_regs; +#define ARCH_REGS_FOR_GETREGSET or1k_regs +#define ARCH_PC_REG or1k_regs.pc diff --git a/linux/or1k/get_error.c b/linux/or1k/get_error.c new file mode 100644 index 00000000..40e00bf4 --- /dev/null +++ b/linux/or1k/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(or1k_regs.gpr[11])) { + tcp->u_rval = -1; + tcp->u_error = -or1k_regs.gpr[11]; + } else { + tcp->u_rval = or1k_regs.gpr[11]; + } +} diff --git a/linux/or1k/get_scno.c b/linux/or1k/get_scno.c new file mode 100644 index 00000000..f446c907 --- /dev/null +++ b/linux/or1k/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = or1k_regs.gpr[11]; + return 1; +} diff --git a/linux/or1k/get_syscall_args.c b/linux/or1k/get_syscall_args.c new file mode 100644 index 00000000..b72e01f0 --- /dev/null +++ b/linux/or1k/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = or1k_regs.gpr[3 + 0]; + tcp->u_arg[1] = or1k_regs.gpr[3 + 1]; + tcp->u_arg[2] = or1k_regs.gpr[3 + 2]; + tcp->u_arg[3] = or1k_regs.gpr[3 + 3]; + tcp->u_arg[4] = or1k_regs.gpr[3 + 4]; + tcp->u_arg[5] = or1k_regs.gpr[3 + 5]; + return 1; +} diff --git a/linux/or1k/ioctlent.h.in b/linux/or1k/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/or1k/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/or1k/ioctls_arch0.h b/linux/or1k/ioctls_arch0.h new file mode 100644 index 00000000..5950cbec --- /dev/null +++ b/linux/or1k/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/openrisc/include/ tree. */ diff --git a/linux/or1k/ioctls_inc0.h b/linux/or1k/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/or1k/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/or1k/set_error.c b/linux/or1k/set_error.c new file mode 100644 index 00000000..17973387 --- /dev/null +++ b/linux/or1k/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + or1k_regs.gpr[11] = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + or1k_regs.gpr[11] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/or1k/set_scno.c b/linux/or1k/set_scno.c new file mode 100644 index 00000000..269eeb5a --- /dev/null +++ b/linux/or1k/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + or1k_regs.gpr[11] = scno; + return set_regs(tcp->pid); +} diff --git a/linux/or1k/syscallent.h b/linux/or1k/syscallent.h index c67bb5ce..10af205e 100644 --- a/linux/or1k/syscallent.h +++ b/linux/or1k/syscallent.h @@ -1,262 +1,4 @@ - { 2, 0, sys_io_setup, "io_setup" }, /* 0 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 1 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 2 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 3 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 4 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 5 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 6 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 7 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 8 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 9 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 10 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 11 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 12 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 13 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 14 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 15 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 16 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 17 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 18 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 19 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 20 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 21 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 22 */ - { 1, TD, sys_dup, "dup" }, /* 23 */ - { 3, TD, sys_dup3, "dup3" }, /* 24 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 25 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 26 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 27 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 28 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 29 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 30 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 31 */ - { 2, TD, sys_flock, "flock" }, /* 32 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 33 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 34 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 35 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 36 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 37 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 38 */ - { 2, TF, sys_umount2, "umount" }, /* 39 */ - { 5, TF, sys_mount, "mount" }, /* 40 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 41 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 42 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 43 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 44 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 45 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 46 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 47 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 48 */ - { 1, TF, sys_chdir, "chdir" }, /* 49 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 50 */ - { 1, TF, sys_chroot, "chroot" }, /* 51 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 52 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 53 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 54 */ - { 3, TD, sys_fchown, "fchown" }, /* 55 */ - { 4, TD|TF, sys_openat, "openat" }, /* 56 */ - { 1, TD, sys_close, "close" }, /* 57 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 58 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 59 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 60 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 61 */ - { 5, TD, sys_llseek, "_llseek" }, /* 62 */ - { 3, TD, sys_read, "read" }, /* 63 */ - { 3, TD, sys_write, "write" }, /* 64 */ - { 3, TD, sys_readv, "readv" }, /* 65 */ - { 3, TD, sys_writev, "writev" }, /* 66 */ - { 5, TD, sys_pread, "pread64" }, /* 67 */ - { 5, TD, sys_pwrite, "pwrite64" }, /* 68 */ - { 5, TD, sys_preadv, "preadv" }, /* 69 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 70 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 71 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 72 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 73 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 74 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 75 */ - { 6, TD, sys_splice, "splice" }, /* 76 */ - { 4, TD, sys_tee, "tee" }, /* 77 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 78 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 79 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 80 */ - { 0, 0, sys_sync, "sync" }, /* 81 */ - { 1, TD, sys_fsync, "fsync" }, /* 82 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 83 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 84 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 85 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 86 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 87 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 88 */ - { 1, TF, sys_acct, "acct" }, /* 89 */ - { 2, 0, sys_capget, "capget" }, /* 90 */ - { 2, 0, sys_capset, "capset" }, /* 91 */ - { 1, 0, sys_personality, "personality" }, /* 92 */ - { 1, TP|SE, sys_exit, "exit" }, /* 93 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 94 */ - { 5, TP, sys_waitid, "waitid" }, /* 95 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 96 */ - { 1, TP, sys_unshare, "unshare" }, /* 97 */ - { 6, 0, sys_futex, "futex" }, /* 98 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 99 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 100 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 101 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 102 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 103 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 104 */ - { 3, 0, sys_init_module, "init_module" }, /* 105 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 106 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 107 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 108 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 109 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 110 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 111 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 112 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 113 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 114 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 115 */ - { 3, 0, sys_syslog, "syslog" }, /* 116 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 117 */ - { 2, 0, sys_sched_setparam, "sched_setparam" }, /* 118 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 119 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 120 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 121 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 122 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 123 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 124 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max"}, /* 125 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min"}, /* 126 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 127 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 128 */ - { 2, TS, sys_kill, "kill" }, /* 129 */ - { 2, TS, sys_kill, "tkill" }, /* 130 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 131 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 132 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 133 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 134 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 135 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 136 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 137 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 138 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 139 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 140 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 141 */ - { 4, 0, sys_reboot, "reboot" }, /* 142 */ - { 2, 0, sys_setregid, "setregid" }, /* 143 */ - { 1, 0, sys_setgid, "setgid" }, /* 144 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 145 */ - { 1, 0, sys_setuid, "setuid" }, /* 146 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 147 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 148 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 149 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 150 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 151 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 152 */ - { 1, 0, sys_times, "times" }, /* 153 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 154 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 155 */ - { 1, 0, sys_getsid, "getsid" }, /* 156 */ - { 0, 0, sys_setsid, "setsid" }, /* 157 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 158 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 159 */ - { 1, 0, sys_uname, "uname" }, /* 160 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 161 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 162 */ - { 2, 0, sys_getrlimit, "oldgetrlimit" }, /* 163 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 164 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 165 */ - { 1, 0, sys_umask, "umask" }, /* 166 */ - { 5, 0, sys_prctl, "prctl" }, /* 167 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 168 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 169 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 170 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 171 */ - { 0, 0, sys_getpid, "getpid" }, /* 172 */ - { 0, 0, sys_getppid, "getppid" }, /* 173 */ - { 0, NF, sys_getuid, "getuid" }, /* 174 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 175 */ - { 0, NF, sys_getgid, "getgid" }, /* 176 */ - { 0, NF, sys_getegid, "getegid" }, /* 177 */ - { 0, 0, sys_gettid, "gettid" }, /* 178 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 179 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 180 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 181 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 182 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 183 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 184 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 185 */ - { 4, TI, sys_msgget, "msgget" }, /* 186 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 187 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 188 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 189 */ - { 4, TI, sys_semget, "semget" }, /* 190 */ - { 4, TI, sys_semctl, "semctl" }, /* 191 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 192 */ - { 4, TI, sys_semop, "semop" }, /* 193 */ - { 4, TI, sys_shmget, "shmget" }, /* 194 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 195 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 196 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 197 */ - { 3, TN, sys_socket, "socket" }, /* 198 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 199 */ - { 3, TN, sys_bind, "bind" }, /* 200 */ - { 2, TN, sys_listen, "listen" }, /* 201 */ - { 3, TN, sys_accept, "accept" }, /* 202 */ - { 3, TN, sys_connect, "connect" }, /* 203 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 204 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 205 */ - { 6, TN, sys_sendto, "sendto" }, /* 206 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 207 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 208 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 209 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 210 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 211 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 212 */ - { 4, TD, sys_readahead, "readahead" }, /* 213 */ - { 1, TM|SI, sys_brk, "brk" }, /* 214 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 215 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 216 */ - { 5, 0, sys_add_key, "add_key" }, /* 217 */ - { 4, 0, sys_request_key, "request_key" }, /* 218 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 219 */ - { 5, TP, sys_clone, "clone" }, /* 220 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 221 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 222 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 223 */ - { 2, TF, sys_swapon, "swapon" }, /* 224 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 225 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 226 */ - { 3, TM, sys_msync, "msync" }, /* 227 */ - { 2, TM, sys_mlock, "mlock" }, /* 228 */ - { 2, TM, sys_munlock, "munlock" }, /* 229 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 230 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 231 */ - { 3, TM, sys_mincore, "mincore" }, /* 232 */ - { 3, TM, sys_madvise, "madvise" }, /* 233 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 234 */ - { 6, TM, sys_mbind, "mbind" }, /* 235 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 236 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 237 */ - { 5, TM, sys_migrate_pages, "migrate_pages" }, /* 238 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 239 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 240 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 241 */ - { 4, TN, sys_accept4, "accept4" }, /* 242 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 243 */ - { 6, NF, sys_or1k_atomic, "or1k_atomic" }, /* 244 */ - - [245 ... 259] = { }, - - { 4, TP, sys_wait4, "wait4" }, /* 260 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 261 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 262 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 263 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 264 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 265 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 266 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 267 */ - { 2, TD, sys_setns, "setns" }, /* 268 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 269 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 270 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 271 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 272 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 273 */ +#define sys_ARCH_mmap sys_mmap_pgoff +#include "32/syscallent.h" +/* [244 ... 259] are arch specific */ +[244] = { 3, NF, SEN(or1k_atomic), "or1k_atomic" }, diff --git a/linux/or1k/userent.h b/linux/or1k/userent.h new file mode 100644 index 00000000..c6fd7d39 --- /dev/null +++ b/linux/or1k/userent.h @@ -0,0 +1,34 @@ +{ 4*0, "r0" }, +{ 4*1, "r1" }, +{ 4*2, "r2" }, +{ 4*3, "r3" }, +{ 4*4, "r4" }, +{ 4*5, "r5" }, +{ 4*6, "r6" }, +{ 4*7, "r7" }, +{ 4*8, "r8" }, +{ 4*9, "r9" }, +{ 4*10, "r10" }, +{ 4*11, "r11" }, +{ 4*12, "r12" }, +{ 4*13, "r13" }, +{ 4*14, "r14" }, +{ 4*15, "r15" }, +{ 4*16, "r16" }, +{ 4*17, "r17" }, +{ 4*18, "r18" }, +{ 4*19, "r19" }, +{ 4*20, "r20" }, +{ 4*21, "r21" }, +{ 4*22, "r22" }, +{ 4*23, "r23" }, +{ 4*24, "r24" }, +{ 4*25, "r25" }, +{ 4*26, "r26" }, +{ 4*27, "r27" }, +{ 4*28, "r28" }, +{ 4*29, "r29" }, +{ 4*30, "r30" }, +{ 4*31, "r31" }, +{ 4*32, "pc" }, +{ 4*33, "sr" }, diff --git a/linux/powerpc/arch_regs.c b/linux/powerpc/arch_regs.c new file mode 100644 index 00000000..dd573f71 --- /dev/null +++ b/linux/powerpc/arch_regs.c @@ -0,0 +1,4 @@ +struct pt_regs ppc_regs; /* not static */ + +#define ARCH_REGS_FOR_GETREGS ppc_regs +#define ARCH_PC_REG ppc_regs.nip diff --git a/linux/powerpc/arch_regs.h b/linux/powerpc/arch_regs.h new file mode 100644 index 00000000..1296e83e --- /dev/null +++ b/linux/powerpc/arch_regs.h @@ -0,0 +1 @@ +extern struct pt_regs ppc_regs; diff --git a/linux/powerpc/arch_sigreturn.c b/linux/powerpc/arch_sigreturn.c new file mode 100644 index 00000000..4f68648d --- /dev/null +++ b/linux/powerpc/arch_sigreturn.c @@ -0,0 +1,28 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + unsigned long addr = ppc_regs.gpr[1]; + struct sigcontext sc; + + /* Skip dummy stack frame. */ +#ifdef POWERPC64 + if (current_personality == 0) + addr += 128; + else +#endif + addr += 64; + + if (umove(tcp, addr, &sc) < 0) { + tprintf("{mask=%#lx}", addr); + } else { + unsigned long mask[NSIG_BYTES / sizeof(long)]; +#ifdef POWERPC64 + mask[0] = sc.oldmask | (sc._unused[3] << 32); +#else + mask[0] = sc.oldmask; + mask[1] = sc._unused[3]; +#endif + tprintsigmask_addr("{mask=", mask); + tprints("}"); + } +} diff --git a/linux/powerpc/errnoent.h b/linux/powerpc/errnoent.h new file mode 100644 index 00000000..b118c8eb --- /dev/null +++ b/linux/powerpc/errnoent.h @@ -0,0 +1,2 @@ +#include "../errnoent.h" +[ 58] = "EDEADLOCK", diff --git a/linux/powerpc/errnoent1.h b/linux/powerpc/errnoent1.h deleted file mode 100644 index 441c66bc..00000000 --- a/linux/powerpc/errnoent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "../errnoent.h" diff --git a/linux/powerpc/get_error.c b/linux/powerpc/get_error.c new file mode 100644 index 00000000..8f10612d --- /dev/null +++ b/linux/powerpc/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (ppc_regs.ccr & 0x10000000) { + tcp->u_rval = -1; + tcp->u_error = ppc_regs.gpr[3]; + } else { + tcp->u_rval = ppc_regs.gpr[3]; + } +} diff --git a/linux/powerpc/get_scno.c b/linux/powerpc/get_scno.c new file mode 100644 index 00000000..ef06656f --- /dev/null +++ b/linux/powerpc/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = ppc_regs.gpr[0]; + return 1; +} diff --git a/linux/powerpc/get_syscall_args.c b/linux/powerpc/get_syscall_args.c new file mode 100644 index 00000000..66bcae31 --- /dev/null +++ b/linux/powerpc/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = ppc_regs.orig_gpr3; + tcp->u_arg[1] = ppc_regs.gpr[4]; + tcp->u_arg[2] = ppc_regs.gpr[5]; + tcp->u_arg[3] = ppc_regs.gpr[6]; + tcp->u_arg[4] = ppc_regs.gpr[7]; + tcp->u_arg[5] = ppc_regs.gpr[8]; + return 1; +} diff --git a/linux/powerpc/getregs_old.c b/linux/powerpc/getregs_old.c new file mode 100644 index 00000000..1730f033 --- /dev/null +++ b/linux/powerpc/getregs_old.c @@ -0,0 +1,35 @@ +/* + * PTRACE_GETREGS was added to the PowerPC kernel in v2.6.23, + * we provide a slow fallback for old kernels. + */ +static int +getregs_old(pid_t pid) +{ + int i; + long r; + + if (iflag) { + r = upeek(pid, sizeof(long) * PT_NIP, &ppc_regs.nip); + if (r) + goto out; + } +#ifdef POWERPC64 /* else we never use it */ + r = upeek(pid, sizeof(long) * PT_MSR, &ppc_regs.msr); + if (r) + goto out; +#endif + r = upeek(pid, sizeof(long) * PT_CCR, &ppc_regs.ccr); + if (r) + goto out; + r = upeek(pid, sizeof(long) * PT_ORIG_R3, &ppc_regs.orig_gpr3); + if (r) + goto out; + for (i = 0; i <= 8; i++) { + r = upeek(pid, sizeof(long) * (PT_R0 + i), + &ppc_regs.gpr[i]); + if (r) + goto out; + } + out: + return r; +} diff --git a/linux/powerpc/getregs_old.h b/linux/powerpc/getregs_old.h new file mode 100644 index 00000000..31388e27 --- /dev/null +++ b/linux/powerpc/getregs_old.h @@ -0,0 +1 @@ +#include "x86_64/getregs_old.h" diff --git a/linux/powerpc/ioctlent.h.in b/linux/powerpc/ioctlent.h.in deleted file mode 100644 index 510f5aa4..00000000 --- a/linux/powerpc/ioctlent.h.in +++ /dev/null @@ -1,84 +0,0 @@ - {"asm/ioctls.h", "TIOCEXCL", 0x540c}, - {"asm/ioctls.h", "TIOCNXCL", 0x540d}, - {"asm/ioctls.h", "TIOCSCTTY", 0x540e}, - {"asm/ioctls.h", "TIOCSTI", 0x5412}, - {"asm/ioctls.h", "TIOCMGET", 0x5415}, - {"asm/ioctls.h", "TIOCMBIS", 0x5416}, - {"asm/ioctls.h", "TIOCMBIC", 0x5417}, - {"asm/ioctls.h", "TIOCMSET", 0x5418}, - {"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, - {"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, - {"asm/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm/ioctls.h", "TIOCCONS", 0x541d}, - {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm/ioctls.h", "TIOCPKT", 0x5420}, - {"asm/ioctls.h", "TIOCNOTTY", 0x5422}, - {"asm/ioctls.h", "TIOCSETD", 0x5423}, - {"asm/ioctls.h", "TIOCGETD", 0x5424}, - {"asm/ioctls.h", "TCSBRKP", 0x5425}, - {"asm/ioctls.h", "TIOCSBRK", 0x5427}, - {"asm/ioctls.h", "TIOCCBRK", 0x5428}, - {"asm/ioctls.h", "TIOCGSID", 0x5429}, - {"asm/ioctls.h", "TIOCGRS485", 0x542e}, - {"asm/ioctls.h", "TIOCSRS485", 0x542f}, - {"asm/ioctls.h", "TIOCGPTN", 0x5430}, - {"asm/ioctls.h", "TIOCSPTLCK", 0x5431}, - {"asm/ioctls.h", "TIOCSIG", 0x5436}, - {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm/ioctls.h", "FIOCLEX", 0x6601}, - {"asm/ioctls.h", "FIONCLEX", 0x6602}, - {"asm/ioctls.h", "FIOASYNC", 0x667d}, - {"asm/ioctls.h", "FIONBIO", 0x667e}, - {"asm/ioctls.h", "FIONREAD", 0x667f}, - {"asm/ioctls.h", "FIOQSIZE", 0x6680}, - {"asm/nvram.h", "IOC_NVRAM_GET_OFFSET", 0x7042}, - {"asm/nvram.h", "IOC_NVRAM_SYNC", 0x7043}, - {"asm/ps3fb.h", "PS3FB_IOCTL_SETMODE", 0x7201}, - {"asm/ps3fb.h", "PS3FB_IOCTL_GETMODE", 0x7202}, - {"asm/ps3fb.h", "PS3FB_IOCTL_SCREENINFO", 0x7203}, - {"asm/ps3fb.h", "PS3FB_IOCTL_ON", 0x7204}, - {"asm/ps3fb.h", "PS3FB_IOCTL_OFF", 0x7205}, - {"asm/ps3fb.h", "PS3FB_IOCTL_FSEL", 0x7206}, - {"asm/ioctls.h", "TIOCGETP", 0x7408}, - {"asm/ioctls.h", "TIOCSETP", 0x7409}, - {"asm/ioctls.h", "TIOCSETN", 0x740a}, - {"asm/ioctls.h", "TIOCSETC", 0x7411}, - {"asm/ioctls.h", "TIOCGETC", 0x7412}, - {"asm/ioctls.h", "TCGETS", 0x7413}, - {"asm/ioctls.h", "TCSETS", 0x7414}, - {"asm/ioctls.h", "TCSETSW", 0x7415}, - {"asm/ioctls.h", "TCSETSF", 0x7416}, - {"asm/ioctls.h", "TCGETA", 0x7417}, - {"asm/ioctls.h", "TCSETA", 0x7418}, - {"asm/ioctls.h", "TCSETAW", 0x7419}, - {"asm/ioctls.h", "TCSETAF", 0x741c}, - {"asm/ioctls.h", "TCSBRK", 0x741d}, - {"asm/ioctls.h", "TCXONC", 0x741e}, - {"asm/ioctls.h", "TCFLSH", 0x741f}, - {"asm/ioctls.h", "TIOCSWINSZ", 0x7467}, - {"asm/ioctls.h", "TIOCGWINSZ", 0x7468}, - {"asm/ioctls.h", "TIOCSTART", 0x746e}, - {"asm/ioctls.h", "TIOCSTOP", 0x746f}, - {"asm/ioctls.h", "TIOCOUTQ", 0x7473}, - {"asm/ioctls.h", "TIOCGLTC", 0x7474}, - {"asm/ioctls.h", "TIOCSLTC", 0x7475}, - {"asm/ioctls.h", "TIOCSPGRP", 0x7476}, - {"asm/ioctls.h", "TIOCGPGRP", 0x7477}, - {"asm/sockios.h", "FIOSETOWN", 0x8901}, - {"asm/sockios.h", "SIOCSPGRP", 0x8902}, - {"asm/sockios.h", "FIOGETOWN", 0x8903}, - {"asm/sockios.h", "SIOCGPGRP", 0x8904}, - {"asm/sockios.h", "SIOCATMARK", 0x8905}, - {"asm/sockios.h", "SIOCGSTAMP", 0x8906}, - {"asm/sockios.h", "SIOCGSTAMPNS", 0x8907}, diff --git a/linux/powerpc/ioctlent1.h b/linux/powerpc/ioctlent1.h deleted file mode 100644 index 72eeaf19..00000000 --- a/linux/powerpc/ioctlent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "ioctlent.h" diff --git a/linux/powerpc/ioctls_arch0.h b/linux/powerpc/ioctls_arch0.h new file mode 100644 index 00000000..6b429d30 --- /dev/null +++ b/linux/powerpc/ioctls_arch0.h @@ -0,0 +1,185 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/powerpc/include/ tree. */ +{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, +{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, +{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, +{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, +{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 }, +{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x7417, 0x14 }, +{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x7413, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x7418, 0x14 }, +{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x741c, 0x14 }, +{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x7419, 0x14 }, +{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x7414, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x7416, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x7415, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETC", _IOC_READ, 0x7412, 0x06 }, +{ "asm/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm/ioctls.h", "TIOCGETP", _IOC_READ, 0x7408, 0x06 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGLTC", _IOC_READ, 0x7474, 0x06 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", 0, 0x542e, 0 }, +{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 }, +{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, +{ "asm/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm/ioctls.h", "TIOCSETC", _IOC_WRITE, 0x7411, 0x06 }, +{ "asm/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm/ioctls.h", "TIOCSETN", _IOC_WRITE, 0x740a, 0x06 }, +{ "asm/ioctls.h", "TIOCSETP", _IOC_WRITE, 0x7409, 0x06 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSLTC", _IOC_WRITE, 0x7475, 0x06 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", 0, 0x542f, 0 }, +{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, +{ "asm/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, +{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 }, +{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm/nvram.h", "IOC_NVRAM_GET_OFFSET", _IOC_READ|_IOC_WRITE, 0x7042, 0x04 }, +{ "asm/nvram.h", "IOC_NVRAM_SYNC", _IOC_NONE, 0x7043, 0x00 }, +{ "asm/nvram.h", "OBSOLETE_PMAC_NVRAM_GET_OFFSET", _IOC_READ|_IOC_WRITE, 0x7040, 0x04 }, +{ "asm/opal-prd.h", "OPAL_PRD_GET_INFO", _IOC_READ, 0x6f01, 0x20 }, +{ "asm/opal-prd.h", "OPAL_PRD_SCOM_READ", _IOC_READ, 0x6f02, 0x20 }, +{ "asm/opal-prd.h", "OPAL_PRD_SCOM_WRITE", _IOC_WRITE, 0x6f03, 0x20 }, +{ "asm/ps3fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 }, +{ "asm/ps3fb.h", "PS3FB_IOCTL_FSEL", _IOC_WRITE, 0x7206, 0x04 }, +{ "asm/ps3fb.h", "PS3FB_IOCTL_GETMODE", _IOC_READ, 0x7202, 0x04 }, +{ "asm/ps3fb.h", "PS3FB_IOCTL_OFF", _IOC_NONE, 0x7205, 0x00 }, +{ "asm/ps3fb.h", "PS3FB_IOCTL_ON", _IOC_NONE, 0x7204, 0x00 }, +{ "asm/ps3fb.h", "PS3FB_IOCTL_SCREENINFO", _IOC_READ, 0x7203, 0x04 }, +{ "asm/ps3fb.h", "PS3FB_IOCTL_SETMODE", _IOC_WRITE, 0x7201, 0x04 }, +{ "asm/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "linux/kvm.h", "KVM_ALLOCATE_RMA", _IOC_READ, 0xaea9, 0x08 }, +{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_SPAPR_TCE", _IOC_WRITE, 0xaea8, 0x10 }, +{ "linux/kvm.h", "KVM_CREATE_SPAPR_TCE_64", _IOC_WRITE, 0xaea8, 0x20 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x100 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x188 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x4d0 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, +{ "linux/kvm.h", "KVM_PPC_GET_HTAB_FD", _IOC_WRITE, 0xaeaa, 0x20 }, +{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, +{ "linux/kvm.h", "KVM_PPC_RTAS_DEFINE_TOKEN", _IOC_WRITE, 0xaeac, 0x80 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, +{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, +{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, +{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, +{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, +{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, +{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, +{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, +{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 }, +{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, +{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, +{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x100 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x108 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x188 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x4d0 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, +{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/powerpc/ioctls_inc0.h b/linux/powerpc/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/powerpc/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/powerpc/set_error.c b/linux/powerpc/set_error.c new file mode 100644 index 00000000..7edabee5 --- /dev/null +++ b/linux/powerpc/set_error.c @@ -0,0 +1,23 @@ +static int +arch_set_error(struct tcb *tcp) +{ + ppc_regs.gpr[3] = tcp->u_error; +#ifdef HAVE_GETREGS_OLD + return upoke(tcp->pid, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]); +#else + return set_regs(tcp->pid); +#endif +} + +static int +arch_set_success(struct tcb *tcp) +{ + ppc_regs.gpr[3] = tcp->u_rval; + ppc_regs.ccr &= ~0x10000000; +#ifdef HAVE_GETREGS_OLD + return upoke(tcp->pid, sizeof(long) * PT_CCR, ppc_regs.ccr) || + upoke(tcp->pid, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]); +#else + return set_regs(tcp->pid); +#endif +} diff --git a/linux/powerpc/set_scno.c b/linux/powerpc/set_scno.c new file mode 100644 index 00000000..c5a04687 --- /dev/null +++ b/linux/powerpc/set_scno.c @@ -0,0 +1,10 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ +#ifdef HAVE_GETREGS_OLD + return upoke(tcp->pid, sizeof(long) * PT_R0, scno); +#else + ppc_regs.gpr[0] = scno; + return set_regs(tcp->pid); +#endif +} diff --git a/linux/powerpc/signalent1.h b/linux/powerpc/signalent1.h deleted file mode 100644 index d31e6a4a..00000000 --- a/linux/powerpc/signalent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "../signalent.h" diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h index 5eb5a3ce..4e1eb8b7 100644 --- a/linux/powerpc/syscallent.h +++ b/linux/powerpc/syscallent.h @@ -26,459 +26,389 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */ - { 1, TP|SE, sys_exit, "exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "oldgetrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 5, 0, printargs, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 5, 0, sys_vm86, "vm86" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 6, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 5, 0, printargs, "modify_ldt" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms" }, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 2, 0, sys_sched_setparam, "sched_setparam" }, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, sys_query_module, "query_module" }, /* 166 */ - { 3, TD, sys_poll, "poll" }, /* 167 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 168 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 169 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 170 */ - { 5, 0, sys_prctl, "prctl" }, /* 171 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 172 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 173 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 174 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 175 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 176 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 177 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 178 */ - { 6, TD, sys_pread, "pread64" }, /* 179 */ - { 6, TD, sys_pwrite, "pwrite64" }, /* 180 */ - { 3, TF, sys_chown, "chown" }, /* 181 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 182 */ - { 2, 0, sys_capget, "capget" }, /* 183 */ - { 2, 0, sys_capset, "capset" }, /* 184 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 185 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 186 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 187 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 188 */ - { 0, TP, sys_vfork, "vfork" }, /* 189 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 190 */ - { 5, TD, sys_readahead, "readahead" }, /* 190 */ - { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" }, /* 192 */ - { 4, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 4, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 5, 0, printargs, "pciconfig_read" }, /* 198 */ - { 5, 0, printargs, "pciconfig_write" }, /* 199 */ - { 3, 0, printargs, "pciconfig_iobase" }, /* 200 */ - { 6, 0, printargs, "MOL" }, /* 201 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 202 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 203 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 204 */ - { 3, TM, sys_madvise, "madvise" }, /* 205 */ - { 3, TM, sys_mincore, "mincore" }, /* 206 */ - { 0, 0, sys_gettid, "gettid" }, /* 207 */ - { 2, TS, sys_kill, "tkill" }, /* 208 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 209 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 210 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 211 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 212 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 213 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 214 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 215 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 216 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 217 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 218 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 219 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 220 */ - { 6, 0, sys_futex, "futex" }, /* 221 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 222 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 223 */ - { 5, 0, NULL, NULL }, /* 224 */ - { 5, 0, printargs, "tux" }, /* 225 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 226 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 227 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 228 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 229 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 230 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 231 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 232 */ - { 6, TD, sys_fadvise64, "fadvise64" }, /* 233 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 234 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 235 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 236 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 237 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 238 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 239 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 240 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 241 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 242 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 243 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 244 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 245 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 246 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 247 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 248 */ - { 2, 0, printargs, "swapcontext" }, /* 249 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 250 */ - { 2, TF, sys_utimes, "utimes" }, /* 251 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 252 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 253 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 254 */ - { 1, 0, printargs, "rtas" }, /* 255 */ - { 5, 0, printargs, "debug_setcontext" }, /* 256 */ - { 5, 0, sys_vserver, "vserver" }, /* 257 */ - { 5, TM, sys_migrate_pages, "migrate_pages" }, /* 258 */ - { 6, TM, sys_mbind, "mbind" }, /* 259 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 260 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 261 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 262 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 263 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 264 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 265 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 266 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 267 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 268 */ - { 5, 0, sys_add_key, "add_key" }, /* 269 */ - { 4, 0, sys_request_key, "request_key" }, /* 270 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 271 */ - { 5, TP, sys_waitid, "waitid" }, /* 272 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 273 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 274 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 275 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 276 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 277 */ - { 5, 0, printargs, "spu_run" }, /* 278 */ - { 5, 0, printargs, "spu_create" }, /* 279 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 280 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 281 */ - { 1, TP, sys_unshare, "unshare" }, /* 282 */ - { 6, TD, sys_splice, "splice" }, /* 283 */ - { 4, TD, sys_tee, "tee" }, /* 284 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 285 */ - { 4, TD|TF, sys_openat, "openat" }, /* 286 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 287 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 288 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 289 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 290 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 291 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 292 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 293 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 294 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 295 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 296 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 297 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 298 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 299 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 300 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 301 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 302 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 303 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 304 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 305 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 306 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 307 */ - { 6, TD, sys_sync_file_range2, "sync_file_range2" }, /* 308 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 309 */ - { 3, 0, sys_subpage_prot, "subpage_prot" }, /* 310 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 311 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 312 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 313 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 314 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 315 */ - { 3, TD, sys_dup3, "dup3" }, /* 316 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 317 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 318 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 319 */ - { 5, TD, sys_preadv, "preadv" }, /* 320 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 321 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 322 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 323 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 324 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 325 */ - { 3, TN, sys_socket, "socket" }, /* 326 */ - { 3, TN, sys_bind, "bind" }, /* 327 */ - { 3, TN, sys_connect, "connect" }, /* 328 */ - { 2, TN, sys_listen, "listen" }, /* 329 */ - { 3, TN, sys_accept, "accept" }, /* 330 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 331 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 332 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 333 */ - { 4, TN, sys_send, "send" }, /* 334 */ - { 6, TN, sys_sendto, "sendto" }, /* 335 */ - { 4, TN, sys_recv, "recv" }, /* 336 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 337 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 338 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 339 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 340 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 341 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 342 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 343 */ - { 4, TN, sys_accept4, "accept4" }, /* 344 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 345 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 346 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 347 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 348 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 349 */ - { 2, TD, sys_setns, "setns" }, /* 350 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 351 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 352 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 353 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 354 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 355 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 356 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 357 */ - { 5, 0, NULL, NULL }, /* 358 */ - { 5, 0, NULL, NULL }, /* 359 */ - { 5, 0, NULL, NULL }, /* 360 */ - { 5, 0, NULL, NULL }, /* 361 */ - { 5, 0, NULL, NULL }, /* 362 */ - { 5, 0, NULL, NULL }, /* 363 */ - { 5, 0, NULL, NULL }, /* 364 */ - { 5, 0, NULL, NULL }, /* 365 */ - { 5, 0, NULL, NULL }, /* 366 */ - { 5, 0, NULL, NULL }, /* 367 */ - { 5, 0, NULL, NULL }, /* 368 */ - { 5, 0, NULL, NULL }, /* 369 */ - { 5, 0, NULL, NULL }, /* 370 */ - { 5, 0, NULL, NULL }, /* 371 */ - { 5, 0, NULL, NULL }, /* 372 */ - { 5, 0, NULL, NULL }, /* 373 */ - { 5, 0, NULL, NULL }, /* 374 */ - { 5, 0, NULL, NULL }, /* 375 */ - { 5, 0, NULL, NULL }, /* 376 */ - { 5, 0, NULL, NULL }, /* 377 */ - { 5, 0, NULL, NULL }, /* 378 */ - { 5, 0, NULL, NULL }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 5, 0, NULL, NULL }, /* 381 */ - { 5, 0, NULL, NULL }, /* 382 */ - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid), "setuid" }, +[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid), "setgid" }, +[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 5, 0, SEN(vm86), "vm86" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 5, 0, SEN(printargs), "modify_ldt" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid), "setresuid" }, +[165] = { 3, 0, SEN(getresuid), "getresuid" }, +[166] = { 5, 0, SEN(query_module), "query_module" }, +[167] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[169] = { 3, 0, SEN(setresgid), "setresgid" }, +[170] = { 3, 0, SEN(getresgid), "getresgid" }, +[171] = { 5, 0, SEN(prctl), "prctl" }, +[172] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[175] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[176] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[178] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[179] = { 6, TD, SEN(pread), "pread64" }, +[180] = { 6, TD, SEN(pwrite), "pwrite64" }, +[181] = { 3, TF, SEN(chown), "chown" }, +[182] = { 2, TF, SEN(getcwd), "getcwd" }, +[183] = { 2, 0, SEN(capget), "capget" }, +[184] = { 2, 0, SEN(capset), "capset" }, +[185] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[186] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[187] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[188] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[189] = { 0, TP, SEN(vfork), "vfork" }, +[190] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[191] = { 5, TD, SEN(readahead), "readahead" }, +[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +[193] = { 4, TF, SEN(truncate64), "truncate64" }, +[194] = { 4, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[199] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[200] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, +[201] = { 6, 0, SEN(printargs), "multiplexer" }, +[202] = { 3, TD, SEN(getdents64), "getdents64" }, +[203] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[204] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[205] = { 3, TM, SEN(madvise), "madvise" }, +[206] = { 3, TM, SEN(mincore), "mincore" }, +[207] = { 0, NF, SEN(gettid), "gettid" }, +[208] = { 2, TS, SEN(kill), "tkill" }, +[209] = { 5, TF, SEN(setxattr), "setxattr" }, +[210] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[211] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[212] = { 4, TF, SEN(getxattr), "getxattr" }, +[213] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[214] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[215] = { 3, TF, SEN(listxattr), "listxattr" }, +[216] = { 3, TF, SEN(listxattr), "llistxattr" }, +[217] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[218] = { 2, TF, SEN(removexattr), "removexattr" }, +[219] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[220] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[221] = { 6, 0, SEN(futex), "futex" }, +[222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[224] = { }, +[225] = { 5, 0, SEN(printargs), "tuxcall" }, +[226] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[227] = { 2, TM, SEN(io_setup), "io_setup" }, +[228] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[229] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[230] = { 3, 0, SEN(io_submit), "io_submit" }, +[231] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[232] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[233] = { 6, TD, SEN(fadvise64), "fadvise64" }, +[234] = { 1, TP|SE, SEN(exit), "exit_group" }, +[235] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[236] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[237] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[238] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[239] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[240] = { 3, 0, SEN(timer_create), "timer_create" }, +[241] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[242] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[243] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[244] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[245] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[246] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[247] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[248] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[249] = { 2, 0, SEN(printargs), "swapcontext" }, +[250] = { 3, TS, SEN(tgkill), "tgkill" }, +[251] = { 2, TF, SEN(utimes), "utimes" }, +[252] = { 3, TF, SEN(statfs64), "statfs64" }, +[253] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[254] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[255] = { 1, 0, SEN(printargs), "rtas" }, +[256] = { 5, 0, SEN(printargs), "sys_debug_setcontext" }, +[257] = { 5, 0, SEN(vserver), "vserver" }, +[258] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[259] = { 6, TM, SEN(mbind), "mbind" }, +[260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[262] = { 4, 0, SEN(mq_open), "mq_open" }, +[263] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[264] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[265] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[266] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[267] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[268] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[269] = { 5, 0, SEN(add_key), "add_key" }, +[270] = { 4, 0, SEN(request_key), "request_key" }, +[271] = { 5, 0, SEN(keyctl), "keyctl" }, +[272] = { 5, TP, SEN(waitid), "waitid" }, +[273] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[274] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[275] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[276] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[277] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[278] = { 3, 0, SEN(printargs), "spu_run" }, +[279] = { 4, 0, SEN(printargs), "spu_create" }, +[280] = { 6, TD, SEN(pselect6), "pselect6" }, +[281] = { 5, TD, SEN(ppoll), "ppoll" }, +[282] = { 1, TP, SEN(unshare), "unshare" }, +[283] = { 6, TD, SEN(splice), "splice" }, +[284] = { 4, TD, SEN(tee), "tee" }, +[285] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[286] = { 4, TD|TF, SEN(openat), "openat" }, +[287] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[288] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[289] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[290] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[291] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[292] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[293] = { 4, TD|TF, SEN(renameat), "renameat" }, +[294] = { 5, TD|TF, SEN(linkat), "linkat" }, +[295] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[296] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[297] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[298] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[299] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[301] = { 6, TM, SEN(move_pages), "move_pages" }, +[302] = { 3, 0, SEN(getcpu), "getcpu" }, +[303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[304] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[305] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[307] = { 1, TD, SEN(eventfd), "eventfd" }, +[308] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" }, +[309] = { 6, TD, SEN(fallocate), "fallocate" }, +[310] = { 3, 0, SEN(subpage_prot), "subpage_prot" }, +[311] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[312] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[314] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[315] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[316] = { 3, TD, SEN(dup3), "dup3" }, +[317] = { 2, TD, SEN(pipe2), "pipe2" }, +[318] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[319] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[320] = { 5, TD, SEN(preadv), "preadv" }, +[321] = { 5, TD, SEN(pwritev), "pwritev" }, +[322] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[323] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[324] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[325] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[326] = { 3, TN, SEN(socket), "socket" }, +[327] = { 3, TN, SEN(bind), "bind" }, +[328] = { 3, TN, SEN(connect), "connect" }, +[329] = { 2, TN, SEN(listen), "listen" }, +[330] = { 3, TN, SEN(accept), "accept" }, +[331] = { 3, TN, SEN(getsockname), "getsockname" }, +[332] = { 3, TN, SEN(getpeername), "getpeername" }, +[333] = { 4, TN, SEN(socketpair), "socketpair" }, +[334] = { 4, TN, SEN(send), "send" }, +[335] = { 6, TN, SEN(sendto), "sendto" }, +[336] = { 4, TN, SEN(recv), "recv" }, +[337] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[338] = { 2, TN, SEN(shutdown), "shutdown" }, +[339] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[340] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[341] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[342] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[343] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[344] = { 4, TN, SEN(accept4), "accept4" }, +[345] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[346] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[347] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[348] = { 1, TD, SEN(syncfs), "syncfs" }, +[349] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[350] = { 2, TD, SEN(setns), "setns" }, +[351] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[352] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[353] = { 3, TD, SEN(finit_module), "finit_module" }, +[354] = { 5, 0, SEN(kcmp), "kcmp" }, +[355] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[356] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[357] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[358] = { 3, 0, SEN(seccomp), "seccomp" }, +[359] = { 3, 0, SEN(getrandom), "getrandom" }, +[360] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[361] = { 3, TD, SEN(bpf), "bpf" }, +[362] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[363] = { 0, 0, SEN(printargs), "switch_endian" }, +[364] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[365] = { 2, 0, SEN(membarrier), "membarrier" }, +[366] = { 3, TI, SEN(semop), "semop" }, +[367] = { 3, TI, SEN(semget), "semget" }, +[368] = { 4, TI, SEN(semctl), "semctl" }, +[369] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[370] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[371] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[372] = { 2, TI, SEN(msgget), "msgget" }, +[373] = { 3, TI, SEN(msgctl), "msgctl" }, +[374] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[375] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[376] = { 3, TI, SEN(shmget), "shmget" }, +[377] = { 3, TI, SEN(shmctl), "shmctl" }, +[378] = { 3, TM, SEN(mlock2), "mlock2" }, +[379] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[380] = { 6, TD, SEN(preadv2), "preadv2" }, +[381] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[382] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, + #define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -#if SYS_ipc_subcall != 420 - #error fix me -#endif - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ - { 4, TI, sys_semop, "semop" }, /* 421 */ - { 4, TI, sys_semget, "semget" }, /* 422 */ - { 4, TI, sys_semctl, "semctl" }, /* 423 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 424 */ - { 4, 0, printargs, "ipc_subcall" }, /* 425 */ - { 4, 0, printargs, "ipc_subcall" }, /* 426 */ - { 4, 0, printargs, "ipc_subcall" }, /* 427 */ - { 4, 0, printargs, "ipc_subcall" }, /* 428 */ - { 4, 0, printargs, "ipc_subcall" }, /* 429 */ - { 4, 0, printargs, "ipc_subcall" }, /* 430 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 431 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 432 */ - { 4, TI, sys_msgget, "msgget" }, /* 433 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 434 */ - { 4, 0, printargs, "ipc_subcall" }, /* 435 */ - { 4, 0, printargs, "ipc_subcall" }, /* 436 */ - { 4, 0, printargs, "ipc_subcall" }, /* 437 */ - { 4, 0, printargs, "ipc_subcall" }, /* 438 */ - { 4, 0, printargs, "ipc_subcall" }, /* 439 */ - { 4, 0, printargs, "ipc_subcall" }, /* 440 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 441 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 442 */ - { 4, TI, sys_shmget, "shmget" }, /* 443 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 444 */ - { 5, 0, NULL, NULL }, /* 445 */ - { 5, 0, NULL, NULL }, /* 446 */ - { 5, 0, NULL, NULL }, /* 447 */ - { 5, 0, NULL, NULL }, /* 448 */ - { 5, 0, NULL, NULL }, /* 449 */ diff --git a/linux/powerpc/syscallent1.h b/linux/powerpc/syscallent1.h deleted file mode 100644 index 49ccb8af..00000000 --- a/linux/powerpc/syscallent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "syscallent.h" diff --git a/linux/powerpc/userent.h b/linux/powerpc/userent.h new file mode 100644 index 00000000..e2094c24 --- /dev/null +++ b/linux/powerpc/userent.h @@ -0,0 +1,47 @@ +#ifndef PT_ORIG_R3 +# define PT_ORIG_R3 34 +#endif +#define REGSIZE (sizeof(unsigned long)) +{ REGSIZE*PT_R0, "r0" }, +{ REGSIZE*PT_R1, "r1" }, +{ REGSIZE*PT_R2, "r2" }, +{ REGSIZE*PT_R3, "r3" }, +{ REGSIZE*PT_R4, "r4" }, +{ REGSIZE*PT_R5, "r5" }, +{ REGSIZE*PT_R6, "r6" }, +{ REGSIZE*PT_R7, "r7" }, +{ REGSIZE*PT_R8, "r8" }, +{ REGSIZE*PT_R9, "r9" }, +{ REGSIZE*PT_R10, "r10" }, +{ REGSIZE*PT_R11, "r11" }, +{ REGSIZE*PT_R12, "r12" }, +{ REGSIZE*PT_R13, "r13" }, +{ REGSIZE*PT_R14, "r14" }, +{ REGSIZE*PT_R15, "r15" }, +{ REGSIZE*PT_R16, "r16" }, +{ REGSIZE*PT_R17, "r17" }, +{ REGSIZE*PT_R18, "r18" }, +{ REGSIZE*PT_R19, "r19" }, +{ REGSIZE*PT_R20, "r20" }, +{ REGSIZE*PT_R21, "r21" }, +{ REGSIZE*PT_R22, "r22" }, +{ REGSIZE*PT_R23, "r23" }, +{ REGSIZE*PT_R24, "r24" }, +{ REGSIZE*PT_R25, "r25" }, +{ REGSIZE*PT_R26, "r26" }, +{ REGSIZE*PT_R27, "r27" }, +{ REGSIZE*PT_R28, "r28" }, +{ REGSIZE*PT_R29, "r29" }, +{ REGSIZE*PT_R30, "r30" }, +{ REGSIZE*PT_R31, "r31" }, +{ REGSIZE*PT_NIP, "NIP" }, +{ REGSIZE*PT_MSR, "MSR" }, +{ REGSIZE*PT_ORIG_R3, "ORIG_R3" }, +{ REGSIZE*PT_CTR, "CTR" }, +{ REGSIZE*PT_LNK, "LNK" }, +{ REGSIZE*PT_XER, "XER" }, +{ REGSIZE*PT_CCR, "CCR" }, +{ REGSIZE*PT_FPR0, "FPR0" }, +#undef REGSIZE +/* Other fields in "struct user" */ +#include "../userent0.h" diff --git a/linux/powerpc64/arch_regs.c b/linux/powerpc64/arch_regs.c new file mode 100644 index 00000000..c50855d9 --- /dev/null +++ b/linux/powerpc64/arch_regs.c @@ -0,0 +1,3 @@ +#include "powerpc/arch_regs.c" +#undef ARCH_PC_REG +#define ARCH_PC_REG ppc_regs.nip diff --git a/linux/powerpc64/arch_regs.h b/linux/powerpc64/arch_regs.h new file mode 100644 index 00000000..05e4fe19 --- /dev/null +++ b/linux/powerpc64/arch_regs.h @@ -0,0 +1 @@ +#include "powerpc/arch_regs.h" diff --git a/linux/powerpc64/arch_sigreturn.c b/linux/powerpc64/arch_sigreturn.c new file mode 100644 index 00000000..316022fd --- /dev/null +++ b/linux/powerpc64/arch_sigreturn.c @@ -0,0 +1 @@ +#include "powerpc/arch_sigreturn.c" diff --git a/linux/powerpc64/errnoent.h b/linux/powerpc64/errnoent.h new file mode 100644 index 00000000..30f6425e --- /dev/null +++ b/linux/powerpc64/errnoent.h @@ -0,0 +1 @@ +#include "powerpc/errnoent.h" diff --git a/linux/powerpc64/errnoent1.h b/linux/powerpc64/errnoent1.h new file mode 100644 index 00000000..c0f7787d --- /dev/null +++ b/linux/powerpc64/errnoent1.h @@ -0,0 +1 @@ +#include "errnoent.h" diff --git a/linux/powerpc64/get_error.c b/linux/powerpc64/get_error.c new file mode 100644 index 00000000..209bfd8f --- /dev/null +++ b/linux/powerpc64/get_error.c @@ -0,0 +1 @@ +#include "powerpc/get_error.c" diff --git a/linux/powerpc64/get_scno.c b/linux/powerpc64/get_scno.c new file mode 100644 index 00000000..8a943e8d --- /dev/null +++ b/linux/powerpc64/get_scno.c @@ -0,0 +1,15 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = ppc_regs.gpr[0]; + /* + * Check for 64/32 bit mode. + * Embedded implementations covered by Book E extension of PPC use + * bit 0 (CM) of 32-bit Machine state register (MSR). + * Other implementations use bit 0 (SF) of 64-bit MSR. + */ + unsigned int currpers = (ppc_regs.msr & 0x8000000080000000) ? 0 : 1; + update_personality(tcp, currpers); + return 1; +} diff --git a/linux/powerpc64/get_syscall_args.c b/linux/powerpc64/get_syscall_args.c new file mode 100644 index 00000000..5561a551 --- /dev/null +++ b/linux/powerpc64/get_syscall_args.c @@ -0,0 +1 @@ +#include "powerpc/get_syscall_args.c" diff --git a/linux/powerpc64/getregs_old.c b/linux/powerpc64/getregs_old.c new file mode 100644 index 00000000..177ff74b --- /dev/null +++ b/linux/powerpc64/getregs_old.c @@ -0,0 +1 @@ +#include "powerpc/getregs_old.c" diff --git a/linux/powerpc64/getregs_old.h b/linux/powerpc64/getregs_old.h new file mode 100644 index 00000000..fdd98f9f --- /dev/null +++ b/linux/powerpc64/getregs_old.h @@ -0,0 +1 @@ +#include "powerpc/getregs_old.h" diff --git a/linux/powerpc64/ioctls_arch0.h b/linux/powerpc64/ioctls_arch0.h new file mode 100644 index 00000000..bf6962ce --- /dev/null +++ b/linux/powerpc64/ioctls_arch0.h @@ -0,0 +1 @@ +#include "powerpc/ioctls_arch0.h" diff --git a/linux/powerpc64/ioctls_arch1.h b/linux/powerpc64/ioctls_arch1.h new file mode 100644 index 00000000..bf6962ce --- /dev/null +++ b/linux/powerpc64/ioctls_arch1.h @@ -0,0 +1 @@ +#include "powerpc/ioctls_arch0.h" diff --git a/linux/powerpc64/ioctls_inc0.h b/linux/powerpc64/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/powerpc64/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/powerpc64/ioctls_inc1.h b/linux/powerpc64/ioctls_inc1.h new file mode 100644 index 00000000..2e5b2de9 --- /dev/null +++ b/linux/powerpc64/ioctls_inc1.h @@ -0,0 +1 @@ +#include "powerpc/ioctls_inc0.h" diff --git a/linux/powerpc64/set_error.c b/linux/powerpc64/set_error.c new file mode 100644 index 00000000..b8dc768f --- /dev/null +++ b/linux/powerpc64/set_error.c @@ -0,0 +1 @@ +#include "powerpc/set_error.c" diff --git a/linux/powerpc64/set_scno.c b/linux/powerpc64/set_scno.c new file mode 100644 index 00000000..c23bb83e --- /dev/null +++ b/linux/powerpc64/set_scno.c @@ -0,0 +1 @@ +#include "powerpc/set_scno.c" diff --git a/linux/powerpc64/signalent1.h b/linux/powerpc64/signalent1.h new file mode 100644 index 00000000..093cba7f --- /dev/null +++ b/linux/powerpc64/signalent1.h @@ -0,0 +1 @@ +#include "signalent.h" diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h new file mode 100644 index 00000000..e5263d4d --- /dev/null +++ b/linux/powerpc64/syscallent.h @@ -0,0 +1,409 @@ +/* + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid), "setuid" }, +[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid), "setgid" }, +[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 5, 0, SEN(vm86), "vm86" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 5, 0, SEN(printargs), "modify_ldt" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid), "setresuid" }, +[165] = { 3, 0, SEN(getresuid), "getresuid" }, +[166] = { 5, 0, SEN(query_module), "query_module" }, +[167] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[169] = { 3, 0, SEN(setresgid), "setresgid" }, +[170] = { 3, 0, SEN(getresgid), "getresgid" }, +[171] = { 5, 0, SEN(prctl), "prctl" }, +[172] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[175] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[176] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[178] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[179] = { 4, TD, SEN(pread), "pread64" }, +[180] = { 4, TD, SEN(pwrite), "pwrite64" }, +[181] = { 3, TF, SEN(chown), "chown" }, +[182] = { 2, TF, SEN(getcwd), "getcwd" }, +[183] = { 2, 0, SEN(capget), "capget" }, +[184] = { 2, 0, SEN(capset), "capset" }, +[185] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[186] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[187] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[188] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[189] = { 0, TP, SEN(vfork), "vfork" }, +[190] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[191] = { 3, TD, SEN(readahead), "readahead" }, +[192 ... 197] = { }, +[198] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[199] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[200] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, +[201] = { 6, 0, SEN(printargs), "multiplexer" }, +[202] = { 3, TD, SEN(getdents64), "getdents64" }, +[203] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[204] = { }, +[205] = { 3, TM, SEN(madvise), "madvise" }, +[206] = { 3, TM, SEN(mincore), "mincore" }, +[207] = { 0, NF, SEN(gettid), "gettid" }, +[208] = { 2, TS, SEN(kill), "tkill" }, +[209] = { 5, TF, SEN(setxattr), "setxattr" }, +[210] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[211] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[212] = { 4, TF, SEN(getxattr), "getxattr" }, +[213] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[214] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[215] = { 3, TF, SEN(listxattr), "listxattr" }, +[216] = { 3, TF, SEN(listxattr), "llistxattr" }, +[217] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[218] = { 2, TF, SEN(removexattr), "removexattr" }, +[219] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[220] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[221] = { 6, 0, SEN(futex), "futex" }, +[222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[224] = { }, +[225] = { 5, 0, SEN(printargs), "tuxcall" }, +[226] = { }, +[227] = { 2, TM, SEN(io_setup), "io_setup" }, +[228] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[229] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[230] = { 3, 0, SEN(io_submit), "io_submit" }, +[231] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[232] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[233] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[234] = { 1, TP|SE, SEN(exit), "exit_group" }, +[235] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[236] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[237] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[238] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[239] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[240] = { 3, 0, SEN(timer_create), "timer_create" }, +[241] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[242] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[243] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[244] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[245] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[246] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[247] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[248] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[249] = { 2, 0, SEN(printargs), "swapcontext" }, +[250] = { 3, TS, SEN(tgkill), "tgkill" }, +[251] = { 2, TF, SEN(utimes), "utimes" }, +[252] = { 3, TF, SEN(statfs64), "statfs64" }, +[253] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[254] = { }, +[255] = { 1, 0, SEN(printargs), "rtas" }, +[256] = { 5, 0, SEN(printargs), "sys_debug_setcontext" }, +[257] = { 5, 0, SEN(vserver), "vserver" }, +[258] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[259] = { 6, TM, SEN(mbind), "mbind" }, +[260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[262] = { 4, 0, SEN(mq_open), "mq_open" }, +[263] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[264] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[265] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[266] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[267] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[268] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[269] = { 5, 0, SEN(add_key), "add_key" }, +[270] = { 4, 0, SEN(request_key), "request_key" }, +[271] = { 5, 0, SEN(keyctl), "keyctl" }, +[272] = { 5, TP, SEN(waitid), "waitid" }, +[273] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[274] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[275] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[276] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[277] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[278] = { 3, 0, SEN(printargs), "spu_run" }, +[279] = { 4, 0, SEN(printargs), "spu_create" }, +[280] = { 6, TD, SEN(pselect6), "pselect6" }, +[281] = { 5, TD, SEN(ppoll), "ppoll" }, +[282] = { 1, TP, SEN(unshare), "unshare" }, +[283] = { 6, TD, SEN(splice), "splice" }, +[284] = { 4, TD, SEN(tee), "tee" }, +[285] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[286] = { 4, TD|TF, SEN(openat), "openat" }, +[287] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[288] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[289] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[290] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[291] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[292] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[293] = { 4, TD|TF, SEN(renameat), "renameat" }, +[294] = { 5, TD|TF, SEN(linkat), "linkat" }, +[295] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[296] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[297] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[298] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[299] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[301] = { 6, TM, SEN(move_pages), "move_pages" }, +[302] = { 3, 0, SEN(getcpu), "getcpu" }, +[303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[304] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[305] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[307] = { 1, TD, SEN(eventfd), "eventfd" }, +[308] = { 4, TD, SEN(sync_file_range2), "sync_file_range2" }, +[309] = { 4, TD, SEN(fallocate), "fallocate" }, +[310] = { 3, 0, SEN(subpage_prot), "subpage_prot" }, +[311] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[312] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[314] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[315] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[316] = { 3, TD, SEN(dup3), "dup3" }, +[317] = { 2, TD, SEN(pipe2), "pipe2" }, +[318] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[319] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[320] = { 4, TD, SEN(preadv), "preadv" }, +[321] = { 4, TD, SEN(pwritev), "pwritev" }, +[322] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[323] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[324] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[325] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[326] = { 3, TN, SEN(socket), "socket" }, +[327] = { 3, TN, SEN(bind), "bind" }, +[328] = { 3, TN, SEN(connect), "connect" }, +[329] = { 2, TN, SEN(listen), "listen" }, +[330] = { 3, TN, SEN(accept), "accept" }, +[331] = { 3, TN, SEN(getsockname), "getsockname" }, +[332] = { 3, TN, SEN(getpeername), "getpeername" }, +[333] = { 4, TN, SEN(socketpair), "socketpair" }, +[334] = { 4, TN, SEN(send), "send" }, +[335] = { 6, TN, SEN(sendto), "sendto" }, +[336] = { 4, TN, SEN(recv), "recv" }, +[337] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[338] = { 2, TN, SEN(shutdown), "shutdown" }, +[339] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[340] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[341] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[342] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[343] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[344] = { 4, TN, SEN(accept4), "accept4" }, +[345] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[346] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[347] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[348] = { 1, TD, SEN(syncfs), "syncfs" }, +[349] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[350] = { 2, TD, SEN(setns), "setns" }, +[351] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[352] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[353] = { 3, TD, SEN(finit_module), "finit_module" }, +[354] = { 5, 0, SEN(kcmp), "kcmp" }, +[355] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[356] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[357] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[358] = { 3, 0, SEN(seccomp), "seccomp" }, +[359] = { 3, 0, SEN(getrandom), "getrandom" }, +[360] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[361] = { 3, TD, SEN(bpf), "bpf" }, +[362] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[363] = { 0, 0, SEN(printargs), "switch_endian" }, +[364] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[365] = { 2, 0, SEN(membarrier), "membarrier" }, +[366] = { 3, TI, SEN(semop), "semop" }, +[367] = { 3, TI, SEN(semget), "semget" }, +[368] = { 4, TI, SEN(semctl), "semctl" }, +[369] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[370] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[371] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[372] = { 2, TI, SEN(msgget), "msgget" }, +[373] = { 3, TI, SEN(msgctl), "msgctl" }, +[374] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[375] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[376] = { 3, TI, SEN(shmget), "shmget" }, +[377] = { 3, TI, SEN(shmctl), "shmctl" }, +[378] = { 3, TM, SEN(mlock2), "mlock2" }, +[379] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[380] = { 6, TD, SEN(preadv2), "preadv2" }, +[381] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[382] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, + +#define SYS_socket_subcall 400 +#include "subcall.h" diff --git a/linux/powerpc64/syscallent1.h b/linux/powerpc64/syscallent1.h new file mode 100644 index 00000000..64a9f01c --- /dev/null +++ b/linux/powerpc64/syscallent1.h @@ -0,0 +1 @@ +#include "powerpc/syscallent.h" diff --git a/linux/powerpc64/userent.h b/linux/powerpc64/userent.h new file mode 100644 index 00000000..27c240b5 --- /dev/null +++ b/linux/powerpc64/userent.h @@ -0,0 +1 @@ +#include "powerpc/userent.h" diff --git a/linux/reboot.h b/linux/reboot.h deleted file mode 100644 index aa336741..00000000 --- a/linux/reboot.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _LINUX_REBOOT_H -#define _LINUX_REBOOT_H - -/* - * Magic values required to use _reboot() system call. - */ - -#define LINUX_REBOOT_MAGIC1 0xfee1dead -#define LINUX_REBOOT_MAGIC2 672274793 -#define LINUX_REBOOT_MAGIC2A 85072278 -#define LINUX_REBOOT_MAGIC2B 369367448 -#define LINUX_REBOOT_MAGIC2C 537993216 - - -/* - * Commands accepted by the _reboot() system call. - * - * RESTART Restart system using default command and mode. - * HALT Stop OS and give system control to ROM monitor, if any. - * CAD_ON Ctrl-Alt-Del sequence causes RESTART command. - * CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task. - * POWER_OFF Stop OS and remove all power from system, if possible. - * RESTART2 Restart system using given command string. - * SW_SUSPEND Suspend system using software suspend if compiled in. - * KEXEC Restart system using a previously loaded Linux kernel - */ - -#define LINUX_REBOOT_CMD_RESTART 0x01234567 -#define LINUX_REBOOT_CMD_HALT 0xCDEF0123 -#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF -#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000 -#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC -#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 -#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2 -#define LINUX_REBOOT_CMD_KEXEC 0x45584543 - - - -#endif /* _LINUX_REBOOT_H */ diff --git a/linux/riscv/arch_regs.c b/linux/riscv/arch_regs.c new file mode 100644 index 00000000..40be17d9 --- /dev/null +++ b/linux/riscv/arch_regs.c @@ -0,0 +1,3 @@ +static struct user_regs_struct riscv_regs; +#define ARCH_REGS_FOR_GETREGSET riscv_regs +#define ARCH_PC_REG riscv_regs.pc diff --git a/linux/riscv/errnoent1.h b/linux/riscv/errnoent1.h new file mode 100644 index 00000000..2a5c728c --- /dev/null +++ b/linux/riscv/errnoent1.h @@ -0,0 +1,2 @@ +/* RISC-V rv32 and rv64 */ +#include "../errnoent.h" diff --git a/linux/riscv/get_error.c b/linux/riscv/get_error.c new file mode 100644 index 00000000..be640d0a --- /dev/null +++ b/linux/riscv/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(riscv_regs.a0)) { + tcp->u_rval = -1; + tcp->u_error = -riscv_regs.a0; + } else { + tcp->u_rval = riscv_regs.a0; + } +} diff --git a/linux/riscv/get_scno.c b/linux/riscv/get_scno.c new file mode 100644 index 00000000..0ca1ed34 --- /dev/null +++ b/linux/riscv/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = riscv_regs.a7; + return 1; +} diff --git a/linux/riscv/get_syscall_args.c b/linux/riscv/get_syscall_args.c new file mode 100644 index 00000000..746e085c --- /dev/null +++ b/linux/riscv/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = riscv_regs.a0; + tcp->u_arg[1] = riscv_regs.a1; + tcp->u_arg[2] = riscv_regs.a2; + tcp->u_arg[3] = riscv_regs.a3; + tcp->u_arg[4] = riscv_regs.a4; + tcp->u_arg[5] = riscv_regs.a5; + return 1; +} diff --git a/linux/riscv/ioctls_arch0.h b/linux/riscv/ioctls_arch0.h new file mode 100644 index 00000000..9c039fc8 --- /dev/null +++ b/linux/riscv/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/riscv/include/ tree. */ diff --git a/linux/riscv/ioctls_arch1.h b/linux/riscv/ioctls_arch1.h new file mode 100644 index 00000000..41d00f92 --- /dev/null +++ b/linux/riscv/ioctls_arch1.h @@ -0,0 +1 @@ +#include "ioctls_arch0.h" diff --git a/linux/riscv/ioctls_inc0.h b/linux/riscv/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/riscv/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/riscv/ioctls_inc1.h b/linux/riscv/ioctls_inc1.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/riscv/ioctls_inc1.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/riscv/set_error.c b/linux/riscv/set_error.c new file mode 100644 index 00000000..6d1eee4c --- /dev/null +++ b/linux/riscv/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + riscv_regs.a0 = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + riscv_regs.a0 = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/riscv/set_scno.c b/linux/riscv/set_scno.c new file mode 100644 index 00000000..64c7db76 --- /dev/null +++ b/linux/riscv/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + riscv_regs.a7 = scno; + return set_regs(tcp->pid); +} diff --git a/linux/riscv/signalent1.h b/linux/riscv/signalent1.h new file mode 100644 index 00000000..39891b8f --- /dev/null +++ b/linux/riscv/signalent1.h @@ -0,0 +1,2 @@ +/* RISC-V rv32 and rv64 */ +#include "../signalent.h" diff --git a/linux/riscv/syscallent.h b/linux/riscv/syscallent.h new file mode 100644 index 00000000..7c416ef1 --- /dev/null +++ b/linux/riscv/syscallent.h @@ -0,0 +1 @@ +#include "64/syscallent.h" diff --git a/linux/riscv/syscallent1.h b/linux/riscv/syscallent1.h new file mode 100644 index 00000000..22eff673 --- /dev/null +++ b/linux/riscv/syscallent1.h @@ -0,0 +1 @@ +#include "32/syscallent.h" diff --git a/linux/s390/arch_regs.c b/linux/s390/arch_regs.c new file mode 100644 index 00000000..fefb7630 --- /dev/null +++ b/linux/s390/arch_regs.c @@ -0,0 +1,5 @@ +/* PTRACE_GETREGSET on S390 is available since linux v2.6.27. */ +static struct user_regs_struct s390_regset; +unsigned long *const s390_frame_ptr = &s390_regset.gprs[15]; +#define ARCH_REGS_FOR_GETREGSET s390_regset +#define ARCH_PC_REG s390_regset.psw.addr diff --git a/linux/s390/arch_regs.h b/linux/s390/arch_regs.h new file mode 100644 index 00000000..586326ff --- /dev/null +++ b/linux/s390/arch_regs.h @@ -0,0 +1 @@ +extern unsigned long *const s390_frame_ptr; diff --git a/linux/s390/arch_sigreturn.c b/linux/s390/arch_sigreturn.c new file mode 100644 index 00000000..d1b85986 --- /dev/null +++ b/linux/s390/arch_sigreturn.c @@ -0,0 +1,13 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + unsigned long mask[NSIG_BYTES / sizeof(long)]; + const unsigned long addr = *s390_frame_ptr + __SIGNAL_FRAMESIZE; + + if (umove(tcp, addr, &mask) < 0) { + tprintf("{mask=%#lx}", addr); + } else { + tprintsigmask_addr("{mask=", mask); + tprints("}"); + } +} diff --git a/linux/s390/get_error.c b/linux/s390/get_error.c new file mode 100644 index 00000000..f491962d --- /dev/null +++ b/linux/s390/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(s390_regset.gprs[2])) { + tcp->u_rval = -1; + tcp->u_error = -s390_regset.gprs[2]; + } else { + tcp->u_rval = s390_regset.gprs[2]; + } +} diff --git a/linux/s390/get_scno.c b/linux/s390/get_scno.c new file mode 100644 index 00000000..d323860d --- /dev/null +++ b/linux/s390/get_scno.c @@ -0,0 +1,8 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = s390_regset.gprs[2] ? + s390_regset.gprs[2] : s390_regset.gprs[1]; + return 1; +} diff --git a/linux/s390/get_syscall_args.c b/linux/s390/get_syscall_args.c new file mode 100644 index 00000000..ebf6c6c4 --- /dev/null +++ b/linux/s390/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = s390_regset.orig_gpr2; + tcp->u_arg[1] = s390_regset.gprs[3]; + tcp->u_arg[2] = s390_regset.gprs[4]; + tcp->u_arg[3] = s390_regset.gprs[5]; + tcp->u_arg[4] = s390_regset.gprs[6]; + tcp->u_arg[5] = s390_regset.gprs[7]; + return 1; +} diff --git a/linux/s390/ioctlent.h.in b/linux/s390/ioctlent.h.in deleted file mode 100644 index 1e93a0b5..00000000 --- a/linux/s390/ioctlent.h.in +++ /dev/null @@ -1,49 +0,0 @@ - {"asm/dasd.h", "BIODASDDISABLE", 0x4400}, - {"asm/dasd.h", "DASDAPIVER", 0x4400}, - {"asm/dasd.h", "BIODASDENABLE", 0x4401}, - {"asm/dasd.h", "BIODASDFMT", 0x4401}, - {"asm/dasd.h", "BIODASDINFO", 0x4401}, - {"asm/dasd.h", "BIODASDSNID", 0x4401}, - {"asm/dasd.h", "BIODASDPRRD", 0x4402}, - {"asm/dasd.h", "BIODASDRSRV", 0x4402}, - {"asm/dasd.h", "BIODASDSATTR", 0x4402}, - {"asm/dasd.h", "BIODASDINFO2", 0x4403}, - {"asm/dasd.h", "BIODASDRLSE", 0x4403}, - {"asm/dasd.h", "BIODASDPSRD", 0x4404}, - {"asm/dasd.h", "BIODASDSLCK", 0x4404}, - {"asm/dasd.h", "BIODASDGATTR", 0x4405}, - {"asm/dasd.h", "BIODASDPRRST", 0x4405}, - {"asm/dasd.h", "BIODASDQUIESCE", 0x4406}, - {"asm/dasd.h", "BIODASDRESUME", 0x4407}, - {"asm/cmb.h", "BIODASDCMFENABLE", 0x4420}, - {"asm/cmb.h", "BIODASDCMFDISABLE", 0x4421}, - {"asm/cmb.h", "BIODASDREADALLCMB", 0x4421}, - {"asm/dasd.h", "BIODASDSYMMIO", 0x44f0}, - {"asm/ioctls.h", "FIOQSIZE", 0x545e}, - {"asm/chsc.h", "CHSC_START", 0x6381}, - {"asm/chsc.h", "CHSC_INFO_CHANNEL_PATH", 0x6382}, - {"asm/chsc.h", "CHSC_INFO_CU", 0x6383}, - {"asm/chsc.h", "CHSC_INFO_SCH_CU", 0x6384}, - {"asm/chsc.h", "CHSC_INFO_CI", 0x6385}, - {"asm/chsc.h", "CHSC_INFO_CCL", 0x6386}, - {"asm/chsc.h", "CHSC_INFO_CPD", 0x6387}, - {"asm/chsc.h", "CHSC_INFO_DCAL", 0x6388}, - {"asm/tape390.h", "TAPE390_DISPLAY", 0x6401}, - {"asm/tape390.h", "TAPE390_CRYPT_SET", 0x6402}, - {"asm/tape390.h", "TAPE390_CRYPT_QUERY", 0x6403}, - {"asm/tape390.h", "TAPE390_KEKL_SET", 0x6404}, - {"asm/tape390.h", "TAPE390_KEKL_QUERY", 0x6405}, - {"asm/zcrypt.h", "Z90STAT_TOTALCOUNT", 0x7a40}, - {"asm/zcrypt.h", "Z90STAT_PCICACOUNT", 0x7a41}, - {"asm/zcrypt.h", "Z90STAT_PCICCCOUNT", 0x7a42}, - {"asm/zcrypt.h", "Z90STAT_REQUESTQ_COUNT", 0x7a44}, - {"asm/zcrypt.h", "Z90STAT_PENDINGQ_COUNT", 0x7a45}, - {"asm/zcrypt.h", "Z90STAT_TOTALOPEN_COUNT", 0x7a46}, - {"asm/zcrypt.h", "Z90STAT_DOMAIN_INDEX", 0x7a47}, - {"asm/zcrypt.h", "Z90STAT_STATUS_MASK", 0x7a48}, - {"asm/zcrypt.h", "Z90STAT_QDEPTH_MASK", 0x7a49}, - {"asm/zcrypt.h", "Z90STAT_PERDEV_REQCNT", 0x7a4a}, - {"asm/zcrypt.h", "Z90STAT_PCIXCCMCL2COUNT", 0x7a4b}, - {"asm/zcrypt.h", "Z90STAT_PCIXCCMCL3COUNT", 0x7a4c}, - {"asm/zcrypt.h", "Z90STAT_CEX2CCOUNT", 0x7a4d}, - {"asm/zcrypt.h", "Z90STAT_CEX2ACOUNT", 0x7a4e}, diff --git a/linux/s390/ioctls_arch0.h b/linux/s390/ioctls_arch0.h new file mode 100644 index 00000000..a287f0f8 --- /dev/null +++ b/linux/s390/ioctls_arch0.h @@ -0,0 +1,148 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/s390/include/ tree. */ +{ "asm/chsc.h", "CHSC_INFO_CCL", _IOC_READ|_IOC_WRITE, 0x6386, 0x1014 }, +{ "asm/chsc.h", "CHSC_INFO_CHANNEL_PATH", _IOC_READ|_IOC_WRITE, 0x6382, 0x100c }, +{ "asm/chsc.h", "CHSC_INFO_CI", _IOC_READ|_IOC_WRITE, 0x6385, 0x100c }, +{ "asm/chsc.h", "CHSC_INFO_CPD", _IOC_READ|_IOC_WRITE, 0x6387, 0x1014 }, +{ "asm/chsc.h", "CHSC_INFO_CU", _IOC_READ|_IOC_WRITE, 0x6383, 0x100c }, +{ "asm/chsc.h", "CHSC_INFO_DCAL", _IOC_READ|_IOC_WRITE, 0x6388, 0x1010 }, +{ "asm/chsc.h", "CHSC_INFO_SCH_CU", _IOC_READ|_IOC_WRITE, 0x6384, 0x1008 }, +{ "asm/chsc.h", "CHSC_ON_CLOSE_REMOVE", _IOC_NONE, 0x638b, 0x00 }, +{ "asm/chsc.h", "CHSC_ON_CLOSE_SET", _IOC_READ|_IOC_WRITE, 0x638a, 0x1000 }, +{ "asm/chsc.h", "CHSC_START", _IOC_READ|_IOC_WRITE, 0x6381, 0x1000 }, +{ "asm/chsc.h", "CHSC_START_SYNC", _IOC_READ|_IOC_WRITE, 0x6389, 0x1000 }, +{ "asm/clp.h", "CLP_SYNC", _IOC_READ|_IOC_WRITE, 0x63c1, 0x10 }, +{ "asm/cmb.h", "BIODASDCMFDISABLE", _IOC_NONE, 0x4421, 0x00 }, +{ "asm/cmb.h", "BIODASDCMFENABLE", _IOC_NONE, 0x4420, 0x00 }, +{ "asm/cmb.h", "BIODASDREADALLCMB", _IOC_READ|_IOC_WRITE, 0x4421, 0x58 }, +{ "asm/dasd.h", "BIODASDABORTIO", _IOC_NONE, 0x44f0, 0x00 }, +{ "asm/dasd.h", "BIODASDALLOWIO", _IOC_NONE, 0x44f1, 0x00 }, +{ "asm/dasd.h", "BIODASDCHECKFMT", _IOC_READ|_IOC_WRITE, 0x4402, 0x28 }, +{ "asm/dasd.h", "BIODASDDISABLE", _IOC_NONE, 0x4400, 0x00 }, +{ "asm/dasd.h", "BIODASDENABLE", _IOC_NONE, 0x4401, 0x00 }, +{ "asm/dasd.h", "BIODASDFMT", _IOC_WRITE, 0x4401, 0x10 }, +{ "asm/dasd.h", "BIODASDGATTR", _IOC_READ, 0x4405, 0x20 }, +{ "asm/dasd.h", "BIODASDINFO", _IOC_READ, 0x4401, 0x178 }, +{ "asm/dasd.h", "BIODASDINFO2", _IOC_READ, 0x4403, 0x1a0 }, +{ "asm/dasd.h", "BIODASDPRRD", _IOC_READ, 0x4402, 0x408 }, +{ "asm/dasd.h", "BIODASDPRRST", _IOC_NONE, 0x4405, 0x00 }, +{ "asm/dasd.h", "BIODASDPSRD", _IOC_READ, 0x4404, 0xc0 }, +{ "asm/dasd.h", "BIODASDQUIESCE", _IOC_NONE, 0x4406, 0x00 }, +{ "asm/dasd.h", "BIODASDRESUME", _IOC_NONE, 0x4407, 0x00 }, +{ "asm/dasd.h", "BIODASDRLSE", _IOC_NONE, 0x4403, 0x00 }, +{ "asm/dasd.h", "BIODASDRSRV", _IOC_NONE, 0x4402, 0x00 }, +{ "asm/dasd.h", "BIODASDSATTR", _IOC_WRITE, 0x4402, 0x20 }, +{ "asm/dasd.h", "BIODASDSLCK", _IOC_NONE, 0x4404, 0x00 }, +{ "asm/dasd.h", "BIODASDSNID", _IOC_READ|_IOC_WRITE, 0x4401, 0x0d }, +{ "asm/dasd.h", "BIODASDSYMMIO", _IOC_READ|_IOC_WRITE, 0x44f0, 0x20 }, +{ "asm/dasd.h", "DASDAPIVER", _IOC_READ, 0x4400, 0x04 }, +{ "asm/hypfs.h", "HYPFS_DIAG304", _IOC_READ|_IOC_WRITE, 0x1020, 0x18 }, +{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 }, +{ "asm/sclp_ctl.h", "SCLP_CTL_SCCB", _IOC_READ|_IOC_WRITE, 0x1010, 0x0c }, +{ "asm/tape390.h", "TAPE390_CRYPT_QUERY", _IOC_READ, 0x6403, 0x03 }, +{ "asm/tape390.h", "TAPE390_CRYPT_SET", _IOC_WRITE, 0x6402, 0x03 }, +{ "asm/tape390.h", "TAPE390_DISPLAY", _IOC_WRITE, 0x6401, 0x11 }, +{ "asm/tape390.h", "TAPE390_KEKL_QUERY", _IOC_READ, 0x6405, 0x86 }, +{ "asm/tape390.h", "TAPE390_KEKL_SET", _IOC_WRITE, 0x6404, 0x86 }, +{ "asm/zcrypt.h", "ICARSACRT", _IOC_READ|_IOC_WRITE, 0x7a06, 0x00 }, +{ "asm/zcrypt.h", "ICARSAMODEXPO", _IOC_READ|_IOC_WRITE, 0x7a05, 0x00 }, +{ "asm/zcrypt.h", "Z90STAT_CEX2ACOUNT", _IOC_READ, 0x7a4e, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_CEX2CCOUNT", _IOC_READ, 0x7a4d, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_DOMAIN_INDEX", _IOC_READ, 0x7a47, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCICACOUNT", _IOC_READ, 0x7a41, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCICCCOUNT", _IOC_READ, 0x7a42, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL2COUNT", _IOC_READ, 0x7a4b, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL3COUNT", _IOC_READ, 0x7a4c, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PENDINGQ_COUNT", _IOC_READ, 0x7a45, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PERDEV_REQCNT", _IOC_READ, 0x7a4a, 0x100 }, +{ "asm/zcrypt.h", "Z90STAT_QDEPTH_MASK", _IOC_READ, 0x7a49, 0x40 }, +{ "asm/zcrypt.h", "Z90STAT_REQUESTQ_COUNT", _IOC_READ, 0x7a44, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_STATUS_MASK", _IOC_READ, 0x7a48, 0x40 }, +{ "asm/zcrypt.h", "Z90STAT_TOTALCOUNT", _IOC_READ, 0x7a40, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_TOTALOPEN_COUNT", _IOC_READ, 0x7a46, 0x04 }, +{ "asm/zcrypt.h", "ZSECSENDCPRB", _IOC_READ|_IOC_WRITE, 0x7a81, 0x00 }, +{ "asm/zcrypt.h", "ZSENDEP11CPRB", _IOC_READ|_IOC_WRITE, 0x7a04, 0x00 }, +{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x88 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x80 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0xc0 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, +{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, +{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, +{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, +{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, +{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, +{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, +{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, +{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, +{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 }, +{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, +{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, +{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x88 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x14 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x80 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0xc0 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, +{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/s390/ioctls_inc0.h b/linux/s390/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/s390/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/s390/set_error.c b/linux/s390/set_error.c new file mode 100644 index 00000000..7262e5ce --- /dev/null +++ b/linux/s390/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + s390_regset.gprs[2] = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + s390_regset.gprs[2] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/s390/set_scno.c b/linux/s390/set_scno.c new file mode 100644 index 00000000..c7a31100 --- /dev/null +++ b/linux/s390/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + s390_regset.gprs[2] = scno; + return set_regs(tcp->pid); +} diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h index 7b349811..6f841c77 100644 --- a/linux/s390/syscallent.h +++ b/linux/s390/syscallent.h @@ -28,454 +28,384 @@ * */ - { 0, 0, sys_setup, "setup" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { MA, 0, NULL, NULL }, /* 17 */ - { MA, 0, NULL, NULL }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { MA, 0, NULL, NULL }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { MA, 0, NULL, NULL }, /* 31 */ - { MA, 0, NULL, NULL }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { MA, 0, NULL, NULL }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { MA, 0, NULL, NULL }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { MA, 0, NULL, NULL }, /* 46 */ - { MA, 0, NULL, NULL }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { MA, 0, NULL, NULL }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { MA, 0, NULL, NULL }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { MA, 0, NULL, NULL }, /* 58 */ - { MA, 0, NULL, NULL }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { MA, 0, NULL, NULL }, /* 68 */ - { MA, 0, NULL, NULL }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { MA, 0, NULL, NULL }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { MA, 0, NULL, NULL }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 6, TD|TM|SI, sys_old_mmap, "mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { MA, 0, NULL, NULL }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { MA, 0, NULL, NULL }, /* 109 */ - { MA, 0, NULL, NULL }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { MA, 0, NULL, NULL }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 5, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { MA, 0, NULL, NULL }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { MA, 0, NULL, NULL }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 5, TD, sys_pread, "pread" }, /* 180 */ - { 5, TD, sys_pwrite, "pwrite" }, /* 181 */ - { 3, TF, sys_chown, "lchown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 188 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 191 */ - { 1, TD|TM|SI, sys_old_mmap_pgoff, "mmap2" }, /* 192 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 3, TF, sys_chown, "lchown" }, /* 198 */ - { 0, NF, sys_getuid, "getuid" }, /* 199 */ - { 0, NF, sys_getgid, "getgid" }, /* 200 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 201 */ - { 0, NF, sys_getegid, "getegid" }, /* 202 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 203 */ - { 2, 0, sys_setregid, "setregid" }, /* 204 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 205 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 206 */ - { 3, TD, sys_fchown, "fchown" }, /* 207 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 208 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 209 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 210 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 211 */ - { 3, TF, sys_chown, "chown" }, /* 212 */ - { 1, 0, sys_setuid, "setuid" }, /* 213 */ - { 1, 0, sys_setgid, "setgid" }, /* 214 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 215 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 3, TM, sys_mincore, "mincore" }, /* 218 */ - { 3, TM, sys_madvise, "madvise" }, /* 219 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 220 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 221 */ - { 4, TD, sys_readahead, "readahead" }, /* 222 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 223 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 224 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 225 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 226 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 227 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 228 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 229 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 230 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 231 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 232 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 233 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 234 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 235 */ - { 0, 0, sys_gettid, "gettid" }, /* 236 */ - { 2, TS, sys_kill, "tkill" }, /* 237 */ - { 6, 0, sys_futex, "futex" }, /* 238 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 239 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 240 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 241 */ - { MA, 0, NULL, NULL }, /* 242 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 243 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 244 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 245 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 246 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 247 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 248 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 249 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 250 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 251 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 252 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 253 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 254 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 255 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 256 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 257 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 258 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 259 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 260 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 261 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 262 */ - { 5, 0, sys_vserver, "vserver" }, /* 263 */ - { 5, TD, printargs, "fadvise64_64" }, /* 264 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 265 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 266 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 267 */ - { 6, TM, sys_mbind, "mbind" }, /* 268 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 269 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 270 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 271 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 272 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 273 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 274 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 275 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 276 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 277 */ - { 5, 0, sys_add_key, "add_key" }, /* 278 */ - { 4, 0, sys_request_key, "request_key" }, /* 279 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 280 */ - { 5, TP, sys_waitid, "waitid" }, /* 281 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 282 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 283 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 284 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 285 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 286 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 287 */ - { 4, TD|TF, sys_openat, "openat" }, /* 288 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 289 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 290 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 291 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 292 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 293 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 294 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 295 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 296 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 297 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 298 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 299 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 300 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 301 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 302 */ - { 1, TP, sys_unshare, "unshare" }, /* 303 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 304 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 305 */ - { 6, TD, sys_splice, "splice" }, /* 306 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 307 */ - { 4, TD, sys_tee, "tee" }, /* 308 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 309 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 310 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 311 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 312 */ - { 2, TF, sys_utimes, "utimes" }, /* 313 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 314 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 315 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 316 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 317 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 318 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 319 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 320 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 321 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 322 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 323 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 324 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 325 */ - { 3, TD, sys_dup3, "dup3" }, /* 326 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 327 */ - { 5, TD, sys_preadv, "preadv" }, /* 328 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 329 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 330 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 331 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 332 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 333 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 334 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 335 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 336 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 337 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 338 */ - { 2, TD, sys_setns, "setns" }, /* 339 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 340 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 341 */ - { 2, 0, printargs, "s390_runtime_instr" }, /* 342 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 343 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 344 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 345 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 346 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 347 */ - { 5, 0, NULL, NULL }, /* 348 */ - { 5, 0, NULL, NULL }, /* 349 */ - { 5, 0, NULL, NULL }, /* 350 */ - { 5, 0, NULL, NULL }, /* 351 */ - { 5, 0, NULL, NULL }, /* 352 */ - { 5, 0, NULL, NULL }, /* 353 */ - { 5, 0, NULL, NULL }, /* 354 */ - { 5, 0, NULL, NULL }, /* 355 */ - { 5, 0, NULL, NULL }, /* 356 */ - { 5, 0, NULL, NULL }, /* 357 */ - { 5, 0, NULL, NULL }, /* 358 */ - { 5, 0, NULL, NULL }, /* 359 */ - { 5, 0, NULL, NULL }, /* 360 */ - { 5, 0, NULL, NULL }, /* 361 */ - { 5, 0, NULL, NULL }, /* 362 */ - { 5, 0, NULL, NULL }, /* 363 */ - { 5, 0, NULL, NULL }, /* 364 */ - { 5, 0, NULL, NULL }, /* 365 */ - { 5, 0, NULL, NULL }, /* 366 */ - { 5, 0, NULL, NULL }, /* 367 */ - { 5, 0, NULL, NULL }, /* 368 */ - { 5, 0, NULL, NULL }, /* 369 */ - { 5, 0, NULL, NULL }, /* 370 */ - { 5, 0, NULL, NULL }, /* 371 */ - { 5, 0, NULL, NULL }, /* 372 */ - { 5, 0, NULL, NULL }, /* 373 */ - { 5, 0, NULL, NULL }, /* 374 */ - { 5, 0, NULL, NULL }, /* 375 */ - { 5, 0, NULL, NULL }, /* 376 */ - { 5, 0, NULL, NULL }, /* 377 */ - { 5, 0, NULL, NULL }, /* 378 */ - { 5, 0, NULL, NULL }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 5, 0, NULL, NULL }, /* 381 */ - { 5, 0, NULL, NULL }, /* 382 */ - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ +[ 0] = {MA, 0, SEN(setup), "setup" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { }, +[ 18] = { }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { }, +[ 32] = { }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { }, +[ 59] = { }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { }, +[ 69] = { }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { }, +[110] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 5, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 5, TD, SEN(pread), "pread64" }, +[181] = { 5, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "chown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 1, TD|TM|SI, SEN(old_mmap_pgoff), "mmap2" }, +[193] = { 3, TF, SEN(truncate64), "truncate64" }, +[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "lchown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(getegid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "chown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[222] = { 4, TD, SEN(readahead), "readahead" }, +[223] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[224] = { 5, TF, SEN(setxattr), "setxattr" }, +[225] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[226] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[227] = { 4, TF, SEN(getxattr), "getxattr" }, +[228] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[229] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[230] = { 3, TF, SEN(listxattr), "listxattr" }, +[231] = { 3, TF, SEN(listxattr), "llistxattr" }, +[232] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[233] = { 2, TF, SEN(removexattr), "removexattr" }, +[234] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[236] = { 0, NF, SEN(gettid), "gettid" }, +[237] = { 2, TS, SEN(kill), "tkill" }, +[238] = { 6, 0, SEN(futex), "futex" }, +[239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[241] = { 3, TS, SEN(tgkill), "tgkill" }, +[242] = { }, +[243] = { 2, TM, SEN(io_setup), "io_setup" }, +[244] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[245] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[246] = { 3, 0, SEN(io_submit), "io_submit" }, +[247] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[248] = { 1, TP|SE, SEN(exit), "exit_group" }, +[249] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[250] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[251] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[252] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[253] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[254] = { 3, 0, SEN(timer_create), "timer_create" }, +[255] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[256] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[258] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[259] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[260] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[261] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[262] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[263] = { 5, 0, SEN(vserver), "vserver" }, +[264] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[265] = { 3, TF, SEN(statfs64), "statfs64" }, +[266] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[267] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[268] = { 6, TM, SEN(mbind), "mbind" }, +[269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[271] = { 4, 0, SEN(mq_open), "mq_open" }, +[272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[275] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[277] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[278] = { 5, 0, SEN(add_key), "add_key" }, +[279] = { 4, 0, SEN(request_key), "request_key" }, +[280] = { 5, 0, SEN(keyctl), "keyctl" }, +[281] = { 5, TP, SEN(waitid), "waitid" }, +[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[284] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[288] = { 4, TD|TF, SEN(openat), "openat" }, +[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[293] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[295] = { 4, TD|TF, SEN(renameat), "renameat" }, +[296] = { 5, TD|TF, SEN(linkat), "linkat" }, +[297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[301] = { 6, TD, SEN(pselect6), "pselect6" }, +[302] = { 5, TD, SEN(ppoll), "ppoll" }, +[303] = { 1, TP, SEN(unshare), "unshare" }, +[304] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[305] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[306] = { 6, TD, SEN(splice), "splice" }, +[307] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[308] = { 4, TD, SEN(tee), "tee" }, +[309] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[310] = { 6, TM, SEN(move_pages), "move_pages" }, +[311] = { 3, 0, SEN(getcpu), "getcpu" }, +[312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[313] = { 2, TF, SEN(utimes), "utimes" }, +[314] = { 6, TD, SEN(fallocate), "fallocate" }, +[315] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[316] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[317] = { 4, TD, SEN(timerfd), "timerfd" }, +[318] = { 1, TD, SEN(eventfd), "eventfd" }, +[319] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[320] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[321] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[322] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[323] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[324] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[325] = { 2, TD, SEN(pipe2), "pipe2" }, +[326] = { 3, TD, SEN(dup3), "dup3" }, +[327] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[328] = { 5, TD, SEN(preadv), "preadv" }, +[329] = { 5, TD, SEN(pwritev), "pwritev" }, +[330] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[331] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[332] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[333] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[334] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[335] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[336] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[337] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[338] = { 1, TD, SEN(syncfs), "syncfs" }, +[339] = { 2, TD, SEN(setns), "setns" }, +[340] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[341] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[342] = { 2, 0, SEN(printargs), "s390_runtime_instr" }, +[343] = { 5, 0, SEN(kcmp), "kcmp" }, +[344] = { 3, TD, SEN(finit_module), "finit_module" }, +[345] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[346] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[347] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[348] = { 3, 0, SEN(seccomp), "seccomp" }, +[349] = { 3, 0, SEN(getrandom), "getrandom" }, +[350] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[351] = { 3, TD, SEN(bpf), "bpf" }, +[352] = { 3, 0, SEN(printargs), "s390_pci_mmio_write" }, +[353] = { 3, 0, SEN(printargs), "s390_pci_mmio_read" }, +[354] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[356] = { 2, 0, SEN(membarrier), "membarrier" }, +[357] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[358] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[359] = { 3, TN, SEN(socket), "socket" }, +[360] = { 4, TN, SEN(socketpair), "socketpair" }, +[361] = { 3, TN, SEN(bind), "bind" }, +[362] = { 3, TN, SEN(connect), "connect" }, +[363] = { 2, TN, SEN(listen), "listen" }, +[364] = { 4, TN, SEN(accept4), "accept4" }, +[365] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[366] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[367] = { 3, TN, SEN(getsockname), "getsockname" }, +[368] = { 3, TN, SEN(getpeername), "getpeername" }, +[369] = { 6, TN, SEN(sendto), "sendto" }, +[370] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[371] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[372] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[373] = { 2, TN, SEN(shutdown), "shutdown" }, +[374] = { 3, TM, SEN(mlock2), "mlock2" }, +[375] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[376] = { 6, TD, SEN(preadv2), "preadv2" }, +[377] = { 6, TD, SEN(pwritev2), "pwritev2" }, + #define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -#if SYS_ipc_subcall != 420 - #error fix me -#endif - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ - { 4, TI, sys_semop, "semop" }, /* 421 */ - { 4, TI, sys_semget, "semget" }, /* 422 */ - { 4, TI, sys_semctl, "semctl" }, /* 423 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 424 */ - { 4, 0, printargs, "ipc_subcall" }, /* 425 */ - { 4, 0, printargs, "ipc_subcall" }, /* 426 */ - { 4, 0, printargs, "ipc_subcall" }, /* 427 */ - { 4, 0, printargs, "ipc_subcall" }, /* 428 */ - { 4, 0, printargs, "ipc_subcall" }, /* 429 */ - { 4, 0, printargs, "ipc_subcall" }, /* 430 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 431 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 432 */ - { 4, TI, sys_msgget, "msgget" }, /* 433 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 434 */ - { 4, 0, printargs, "ipc_subcall" }, /* 435 */ - { 4, 0, printargs, "ipc_subcall" }, /* 436 */ - { 4, 0, printargs, "ipc_subcall" }, /* 437 */ - { 4, 0, printargs, "ipc_subcall" }, /* 438 */ - { 4, 0, printargs, "ipc_subcall" }, /* 439 */ - { 4, 0, printargs, "ipc_subcall" }, /* 440 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 441 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 442 */ - { 4, TI, sys_shmget, "shmget" }, /* 443 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 444 */ diff --git a/linux/s390/userent.h b/linux/s390/userent.h new file mode 100644 index 00000000..f9c71d8a --- /dev/null +++ b/linux/s390/userent.h @@ -0,0 +1,35 @@ +#include "userent0.h" +{ PT_FPR0_HI, "fpr0.hi" }, +{ PT_FPR0_LO, "fpr0.lo" }, +{ PT_FPR1_HI, "fpr1.hi" }, +{ PT_FPR1_LO, "fpr1.lo" }, +{ PT_FPR2_HI, "fpr2.hi" }, +{ PT_FPR2_LO, "fpr2.lo" }, +{ PT_FPR3_HI, "fpr3.hi" }, +{ PT_FPR3_LO, "fpr3.lo" }, +{ PT_FPR4_HI, "fpr4.hi" }, +{ PT_FPR4_LO, "fpr4.lo" }, +{ PT_FPR5_HI, "fpr5.hi" }, +{ PT_FPR5_LO, "fpr5.lo" }, +{ PT_FPR6_HI, "fpr6.hi" }, +{ PT_FPR6_LO, "fpr6.lo" }, +{ PT_FPR7_HI, "fpr7.hi" }, +{ PT_FPR7_LO, "fpr7.lo" }, +{ PT_FPR8_HI, "fpr8.hi" }, +{ PT_FPR8_LO, "fpr8.lo" }, +{ PT_FPR9_HI, "fpr9.hi" }, +{ PT_FPR9_LO, "fpr9.lo" }, +{ PT_FPR10_HI, "fpr10.hi" }, +{ PT_FPR10_LO, "fpr10.lo" }, +{ PT_FPR11_HI, "fpr11.hi" }, +{ PT_FPR11_LO, "fpr11.lo" }, +{ PT_FPR12_HI, "fpr12.hi" }, +{ PT_FPR12_LO, "fpr12.lo" }, +{ PT_FPR13_HI, "fpr13.hi" }, +{ PT_FPR13_LO, "fpr13.lo" }, +{ PT_FPR14_HI, "fpr14.hi" }, +{ PT_FPR14_LO, "fpr14.lo" }, +{ PT_FPR15_HI, "fpr15.hi" }, +{ PT_FPR15_LO, "fpr15.lo" }, +/* Other fields in "struct user" */ +#include "userent1.h" diff --git a/linux/s390/userent0.h b/linux/s390/userent0.h new file mode 100644 index 00000000..71fae74a --- /dev/null +++ b/linux/s390/userent0.h @@ -0,0 +1,41 @@ +{ PT_PSWMASK, "psw_mask" }, +{ PT_PSWADDR, "psw_addr" }, +{ PT_GPR0, "gpr0" }, +{ PT_GPR1, "gpr1" }, +{ PT_GPR2, "gpr2" }, +{ PT_GPR3, "gpr3" }, +{ PT_GPR4, "gpr4" }, +{ PT_GPR5, "gpr5" }, +{ PT_GPR6, "gpr6" }, +{ PT_GPR7, "gpr7" }, +{ PT_GPR8, "gpr8" }, +{ PT_GPR9, "gpr9" }, +{ PT_GPR10, "gpr10" }, +{ PT_GPR11, "gpr11" }, +{ PT_GPR12, "gpr12" }, +{ PT_GPR13, "gpr13" }, +{ PT_GPR14, "gpr14" }, +{ PT_GPR15, "gpr15" }, +{ PT_ACR0, "acr0" }, +{ PT_ACR1, "acr1" }, +{ PT_ACR2, "acr2" }, +{ PT_ACR3, "acr3" }, +{ PT_ACR4, "acr4" }, +{ PT_ACR5, "acr5" }, +{ PT_ACR6, "acr6" }, +{ PT_ACR7, "acr7" }, +{ PT_ACR8, "acr8" }, +{ PT_ACR9, "acr9" }, +{ PT_ACR10, "acr10" }, +{ PT_ACR11, "acr11" }, +{ PT_ACR12, "acr12" }, +{ PT_ACR13, "acr13" }, +{ PT_ACR14, "acr14" }, +{ PT_ACR15, "acr15" }, +{ PT_ORIGGPR2, "orig_gpr2" }, +{ PT_FPC, "fpc" }, +/* PT_FPR* differ between s390 and s390x */ +{ PT_CR_9, "cr9" }, +{ PT_CR_10, "cr10" }, +{ PT_CR_11, "cr11" }, +{ PT_IEEE_IP, "ieee_exception_ip" }, diff --git a/linux/s390/userent1.h b/linux/s390/userent1.h new file mode 100644 index 00000000..3ff99b90 --- /dev/null +++ b/linux/s390/userent1.h @@ -0,0 +1,11 @@ +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +/* S390[X] has no start_data */ +XLAT_UOFF(start_stack), +XLAT_UOFF(signal), +XLAT_UOFF(u_ar0), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/s390x/arch_regs.c b/linux/s390x/arch_regs.c new file mode 100644 index 00000000..62aece72 --- /dev/null +++ b/linux/s390x/arch_regs.c @@ -0,0 +1 @@ +#include "s390/arch_regs.c" diff --git a/linux/s390x/arch_regs.h b/linux/s390x/arch_regs.h new file mode 100644 index 00000000..14fced4e --- /dev/null +++ b/linux/s390x/arch_regs.h @@ -0,0 +1 @@ +#include "s390/arch_regs.h" diff --git a/linux/s390x/arch_sigreturn.c b/linux/s390x/arch_sigreturn.c new file mode 100644 index 00000000..679a3952 --- /dev/null +++ b/linux/s390x/arch_sigreturn.c @@ -0,0 +1 @@ +#include "s390/arch_sigreturn.c" diff --git a/linux/s390x/get_error.c b/linux/s390x/get_error.c new file mode 100644 index 00000000..8e3944c2 --- /dev/null +++ b/linux/s390x/get_error.c @@ -0,0 +1 @@ +#include "s390/get_error.c" diff --git a/linux/s390x/get_scno.c b/linux/s390x/get_scno.c new file mode 100644 index 00000000..71816fbd --- /dev/null +++ b/linux/s390x/get_scno.c @@ -0,0 +1 @@ +#include "s390/get_scno.c" diff --git a/linux/s390x/get_syscall_args.c b/linux/s390x/get_syscall_args.c new file mode 100644 index 00000000..4ded41d4 --- /dev/null +++ b/linux/s390x/get_syscall_args.c @@ -0,0 +1 @@ +#include "s390/get_syscall_args.c" diff --git a/linux/s390x/ioctlent.h.in b/linux/s390x/ioctlent.h.in deleted file mode 100644 index 214b67fe..00000000 --- a/linux/s390x/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../s390/ioctlent.h.in" diff --git a/linux/s390x/ioctls_arch0.h b/linux/s390x/ioctls_arch0.h new file mode 100644 index 00000000..f7c3355e --- /dev/null +++ b/linux/s390x/ioctls_arch0.h @@ -0,0 +1,148 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/s390/include/ tree. */ +{ "asm/chsc.h", "CHSC_INFO_CCL", _IOC_READ|_IOC_WRITE, 0x6386, 0x1014 }, +{ "asm/chsc.h", "CHSC_INFO_CHANNEL_PATH", _IOC_READ|_IOC_WRITE, 0x6382, 0x100c }, +{ "asm/chsc.h", "CHSC_INFO_CI", _IOC_READ|_IOC_WRITE, 0x6385, 0x100c }, +{ "asm/chsc.h", "CHSC_INFO_CPD", _IOC_READ|_IOC_WRITE, 0x6387, 0x1014 }, +{ "asm/chsc.h", "CHSC_INFO_CU", _IOC_READ|_IOC_WRITE, 0x6383, 0x100c }, +{ "asm/chsc.h", "CHSC_INFO_DCAL", _IOC_READ|_IOC_WRITE, 0x6388, 0x1010 }, +{ "asm/chsc.h", "CHSC_INFO_SCH_CU", _IOC_READ|_IOC_WRITE, 0x6384, 0x1008 }, +{ "asm/chsc.h", "CHSC_ON_CLOSE_REMOVE", _IOC_NONE, 0x638b, 0x00 }, +{ "asm/chsc.h", "CHSC_ON_CLOSE_SET", _IOC_READ|_IOC_WRITE, 0x638a, 0x1000 }, +{ "asm/chsc.h", "CHSC_START", _IOC_READ|_IOC_WRITE, 0x6381, 0x1000 }, +{ "asm/chsc.h", "CHSC_START_SYNC", _IOC_READ|_IOC_WRITE, 0x6389, 0x1000 }, +{ "asm/clp.h", "CLP_SYNC", _IOC_READ|_IOC_WRITE, 0x63c1, 0x10 }, +{ "asm/cmb.h", "BIODASDCMFDISABLE", _IOC_NONE, 0x4421, 0x00 }, +{ "asm/cmb.h", "BIODASDCMFENABLE", _IOC_NONE, 0x4420, 0x00 }, +{ "asm/cmb.h", "BIODASDREADALLCMB", _IOC_READ|_IOC_WRITE, 0x4421, 0x58 }, +{ "asm/dasd.h", "BIODASDABORTIO", _IOC_NONE, 0x44f0, 0x00 }, +{ "asm/dasd.h", "BIODASDALLOWIO", _IOC_NONE, 0x44f1, 0x00 }, +{ "asm/dasd.h", "BIODASDCHECKFMT", _IOC_READ|_IOC_WRITE, 0x4402, 0x28 }, +{ "asm/dasd.h", "BIODASDDISABLE", _IOC_NONE, 0x4400, 0x00 }, +{ "asm/dasd.h", "BIODASDENABLE", _IOC_NONE, 0x4401, 0x00 }, +{ "asm/dasd.h", "BIODASDFMT", _IOC_WRITE, 0x4401, 0x10 }, +{ "asm/dasd.h", "BIODASDGATTR", _IOC_READ, 0x4405, 0x20 }, +{ "asm/dasd.h", "BIODASDINFO", _IOC_READ, 0x4401, 0x178 }, +{ "asm/dasd.h", "BIODASDINFO2", _IOC_READ, 0x4403, 0x1a0 }, +{ "asm/dasd.h", "BIODASDPRRD", _IOC_READ, 0x4402, 0x408 }, +{ "asm/dasd.h", "BIODASDPRRST", _IOC_NONE, 0x4405, 0x00 }, +{ "asm/dasd.h", "BIODASDPSRD", _IOC_READ, 0x4404, 0xc0 }, +{ "asm/dasd.h", "BIODASDQUIESCE", _IOC_NONE, 0x4406, 0x00 }, +{ "asm/dasd.h", "BIODASDRESUME", _IOC_NONE, 0x4407, 0x00 }, +{ "asm/dasd.h", "BIODASDRLSE", _IOC_NONE, 0x4403, 0x00 }, +{ "asm/dasd.h", "BIODASDRSRV", _IOC_NONE, 0x4402, 0x00 }, +{ "asm/dasd.h", "BIODASDSATTR", _IOC_WRITE, 0x4402, 0x20 }, +{ "asm/dasd.h", "BIODASDSLCK", _IOC_NONE, 0x4404, 0x00 }, +{ "asm/dasd.h", "BIODASDSNID", _IOC_READ|_IOC_WRITE, 0x4401, 0x0d }, +{ "asm/dasd.h", "BIODASDSYMMIO", _IOC_READ|_IOC_WRITE, 0x44f0, 0x20 }, +{ "asm/dasd.h", "DASDAPIVER", _IOC_READ, 0x4400, 0x04 }, +{ "asm/hypfs.h", "HYPFS_DIAG304", _IOC_READ|_IOC_WRITE, 0x1020, 0x18 }, +{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 }, +{ "asm/sclp_ctl.h", "SCLP_CTL_SCCB", _IOC_READ|_IOC_WRITE, 0x1010, 0x0c }, +{ "asm/tape390.h", "TAPE390_CRYPT_QUERY", _IOC_READ, 0x6403, 0x03 }, +{ "asm/tape390.h", "TAPE390_CRYPT_SET", _IOC_WRITE, 0x6402, 0x03 }, +{ "asm/tape390.h", "TAPE390_DISPLAY", _IOC_WRITE, 0x6401, 0x11 }, +{ "asm/tape390.h", "TAPE390_KEKL_QUERY", _IOC_READ, 0x6405, 0x86 }, +{ "asm/tape390.h", "TAPE390_KEKL_SET", _IOC_WRITE, 0x6404, 0x86 }, +{ "asm/zcrypt.h", "ICARSACRT", _IOC_READ|_IOC_WRITE, 0x7a06, 0x00 }, +{ "asm/zcrypt.h", "ICARSAMODEXPO", _IOC_READ|_IOC_WRITE, 0x7a05, 0x00 }, +{ "asm/zcrypt.h", "Z90STAT_CEX2ACOUNT", _IOC_READ, 0x7a4e, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_CEX2CCOUNT", _IOC_READ, 0x7a4d, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_DOMAIN_INDEX", _IOC_READ, 0x7a47, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCICACOUNT", _IOC_READ, 0x7a41, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCICCCOUNT", _IOC_READ, 0x7a42, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL2COUNT", _IOC_READ, 0x7a4b, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL3COUNT", _IOC_READ, 0x7a4c, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PENDINGQ_COUNT", _IOC_READ, 0x7a45, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_PERDEV_REQCNT", _IOC_READ, 0x7a4a, 0x100 }, +{ "asm/zcrypt.h", "Z90STAT_QDEPTH_MASK", _IOC_READ, 0x7a49, 0x40 }, +{ "asm/zcrypt.h", "Z90STAT_REQUESTQ_COUNT", _IOC_READ, 0x7a44, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_STATUS_MASK", _IOC_READ, 0x7a48, 0x40 }, +{ "asm/zcrypt.h", "Z90STAT_TOTALCOUNT", _IOC_READ, 0x7a40, 0x04 }, +{ "asm/zcrypt.h", "Z90STAT_TOTALOPEN_COUNT", _IOC_READ, 0x7a46, 0x04 }, +{ "asm/zcrypt.h", "ZSECSENDCPRB", _IOC_READ|_IOC_WRITE, 0x7a81, 0x00 }, +{ "asm/zcrypt.h", "ZSENDEP11CPRB", _IOC_READ|_IOC_WRITE, 0x7a04, 0x00 }, +{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x88 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x80 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0xc0 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, +{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, +{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, +{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, +{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, +{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, +{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, +{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, +{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, +{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x08 }, +{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, +{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, +{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x08 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x88 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x18 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x80 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0xc0 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, +{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/s390x/ioctls_inc0.h b/linux/s390x/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/s390x/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/s390x/set_error.c b/linux/s390x/set_error.c new file mode 100644 index 00000000..737ddef7 --- /dev/null +++ b/linux/s390x/set_error.c @@ -0,0 +1 @@ +#include "s390/set_error.c" diff --git a/linux/s390x/set_scno.c b/linux/s390x/set_scno.c new file mode 100644 index 00000000..9cea4d10 --- /dev/null +++ b/linux/s390x/set_scno.c @@ -0,0 +1 @@ +#include "s390/set_scno.c" diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index aae69b51..ca67f467 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -27,454 +27,369 @@ * */ - { 0, 0, sys_setup, "setup" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { MA, 0, NULL, NULL }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { MA, 0, NULL, NULL }, /* 16 */ - { MA, 0, NULL, NULL }, /* 17 */ - { MA, 0, NULL, NULL }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { MA, 0, NULL, NULL }, /* 23 */ - { MA, 0, NULL, NULL }, /* 24 */ - { MA, 0, NULL, NULL }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { MA, 0, NULL, NULL }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { MA, 0, NULL, NULL }, /* 31 */ - { MA, 0, NULL, NULL }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { MA, 0, NULL, NULL }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { MA, 0, NULL, NULL }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { MA, 0, NULL, NULL }, /* 46 */ - { MA, 0, NULL, NULL }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { MA, 0, NULL, NULL }, /* 49 */ - { MA, 0, NULL, NULL }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { MA, 0, NULL, NULL }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { MA, 0, NULL, NULL }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { MA, 0, NULL, NULL }, /* 58 */ - { MA, 0, NULL, NULL }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { MA, 0, NULL, NULL }, /* 68 */ - { MA, 0, NULL, NULL }, /* 69 */ - { MA, 0, NULL, NULL }, /* 70 */ - { MA, 0, NULL, NULL }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { MA, 0, NULL, NULL }, /* 80 */ - { MA, 0, NULL, NULL }, /* 81 */ - { MA, 0, NULL, NULL }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { MA, 0, NULL, NULL }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { MA, 0, NULL, NULL }, /* 89 */ - { 1, TD|TM|SI, sys_old_mmap, "mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { MA, 0, NULL, NULL }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { MA, 0, NULL, NULL }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { MA, 0, NULL, NULL }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { MA, 0, NULL, NULL }, /* 109 */ - { MA, 0, NULL, NULL }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { MA, 0, NULL, NULL }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 5, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { MA, 0, NULL, NULL }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { MA, 0, NULL, NULL }, /* 138 */ - { MA, 0, NULL, NULL }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 2, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { MA, 0, NULL, NULL }, /* 164 */ - { MA, 0, NULL, NULL }, /* 165 */ - { MA, 0, NULL, NULL }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { MA, 0, NULL, NULL }, /* 170 */ - { MA, 0, NULL, NULL }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 4, TD, sys_pread, "pread" }, /* 180 */ - { 4, TD, sys_pwrite, "pwrite" }, /* 181 */ - { MA, 0, NULL, NULL }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 188 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 191 */ - { MA, 0, NULL, NULL }, /* 192 */ - { MA, 0, NULL, NULL }, /* 193 */ - { MA, 0, NULL, NULL }, /* 194 */ - { MA, 0, NULL, NULL }, /* 195 */ - { MA, 0, NULL, NULL }, /* 196 */ - { MA, 0, NULL, NULL }, /* 197 */ - { 3, TF, sys_chown, "lchown" }, /* 198 */ - { 0, NF, sys_getuid, "getuid" }, /* 199 */ - { 0, NF, sys_getgid, "getgid" }, /* 200 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 201 */ - { 0, NF, sys_getegid, "getegid" }, /* 202 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 203 */ - { 2, 0, sys_setregid, "setregid" }, /* 204 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 205 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 206 */ - { 3, TD, sys_fchown, "fchown" }, /* 207 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 208 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 209 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 210 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 211 */ - { 3, TF, sys_chown, "chown" }, /* 212 */ - { 1, 0, sys_setuid, "setuid" }, /* 213 */ - { 1, 0, sys_setgid, "setgid" }, /* 214 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 215 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 3, TM, sys_mincore, "mincore" }, /* 218 */ - { 3, TM, sys_madvise, "madvise" }, /* 219 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 220 */ - { MA, 0, NULL, NULL }, /* 221 */ - { 3, TD, sys_readahead, "readahead" }, /* 222 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 223 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 224 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 225 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 226 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 227 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 228 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 229 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 230 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 231 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 232 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 233 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 234 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 235 */ - { 0, 0, sys_gettid, "gettid" }, /* 236 */ - { 2, TS, sys_kill, "tkill" }, /* 237 */ - { 6, 0, sys_futex, "futex" }, /* 238 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 239 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 240 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 241 */ - { MA, 0, NULL, NULL }, /* 242 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 243 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 244 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 245 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 246 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 247 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 248 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 249 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 250 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 251 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 252 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 253 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 254 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 255 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 256 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 257 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 258 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 259 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 260 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 261 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 262 */ - { 5, 0, sys_vserver, "vserver" }, /* 263 */ - { 4, TD, sys_fadvise64, "fadvise64_64" }, /* 264 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 265 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 266 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 267 */ - { 6, TM, sys_mbind, "mbind" }, /* 268 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 269 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 270 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 271 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 272 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 273 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 274 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 275 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 276 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 277 */ - { 5, 0, sys_add_key, "add_key" }, /* 278 */ - { 4, 0, sys_request_key, "request_key" }, /* 279 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 280 */ - { 5, TP, sys_waitid, "waitid" }, /* 281 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 282 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 283 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 284 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 285 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 286 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 287 */ - { 4, TD|TF, sys_openat, "openat" }, /* 288 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 289 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 290 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 291 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 292 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 293 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 294 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 295 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 296 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 297 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 298 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 299 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 300 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 301 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 302 */ - { 1, TP, sys_unshare, "unshare" }, /* 303 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 304 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 305 */ - { 6, TD, sys_splice, "splice" }, /* 306 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 307 */ - { 4, TD, sys_tee, "tee" }, /* 308 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 309 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 310 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 311 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 312 */ - { 2, TF, sys_utimes, "utimes" }, /* 313 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 314 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 315 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 316 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 317 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 318 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 319 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 320 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 321 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 322 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 323 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 324 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 325 */ - { 3, TD, sys_dup3, "dup3" }, /* 326 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 327 */ - { 4, TD, sys_preadv, "preadv" }, /* 328 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 329 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 330 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 331 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 332 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 333 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 334 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 335 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 336 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 337 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 338 */ - { 2, TD, sys_setns, "setns" }, /* 339 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 340 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 341 */ - { 2, 0, printargs, "s390_runtime_instr" }, /* 342 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 343 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 344 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 345 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 346 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 347 */ - { 5, 0, NULL, NULL }, /* 348 */ - { 5, 0, NULL, NULL }, /* 349 */ - { 5, 0, NULL, NULL }, /* 350 */ - { 5, 0, NULL, NULL }, /* 351 */ - { 5, 0, NULL, NULL }, /* 352 */ - { 5, 0, NULL, NULL }, /* 353 */ - { 5, 0, NULL, NULL }, /* 354 */ - { 5, 0, NULL, NULL }, /* 355 */ - { 5, 0, NULL, NULL }, /* 356 */ - { 5, 0, NULL, NULL }, /* 357 */ - { 5, 0, NULL, NULL }, /* 358 */ - { 5, 0, NULL, NULL }, /* 359 */ - { 5, 0, NULL, NULL }, /* 360 */ - { 5, 0, NULL, NULL }, /* 361 */ - { 5, 0, NULL, NULL }, /* 362 */ - { 5, 0, NULL, NULL }, /* 363 */ - { 5, 0, NULL, NULL }, /* 364 */ - { 5, 0, NULL, NULL }, /* 365 */ - { 5, 0, NULL, NULL }, /* 366 */ - { 5, 0, NULL, NULL }, /* 367 */ - { 5, 0, NULL, NULL }, /* 368 */ - { 5, 0, NULL, NULL }, /* 369 */ - { 5, 0, NULL, NULL }, /* 370 */ - { 5, 0, NULL, NULL }, /* 371 */ - { 5, 0, NULL, NULL }, /* 372 */ - { 5, 0, NULL, NULL }, /* 373 */ - { 5, 0, NULL, NULL }, /* 374 */ - { 5, 0, NULL, NULL }, /* 375 */ - { 5, 0, NULL, NULL }, /* 376 */ - { 5, 0, NULL, NULL }, /* 377 */ - { 5, 0, NULL, NULL }, /* 378 */ - { 5, 0, NULL, NULL }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 5, 0, NULL, NULL }, /* 381 */ - { 5, 0, NULL, NULL }, /* 382 */ - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ +[ 0] = {MA, 0, SEN(setup), "setup" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { }, +[ 17] = { }, +[ 18] = { }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { }, +[ 24] = { }, +[ 25] = { }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { }, +[ 32] = { }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 1, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { }, +[ 47] = { }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { }, +[ 50] = { }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { }, +[ 59] = { }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68 ... 71] = { }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80 ... 82] = { }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { }, +[110] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 5, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138 ... 140] = { }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "select" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164 ... 166] = { }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170 ... 171] = { }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 4, TD, SEN(pread), "pread64" }, +[181] = { 4, TD, SEN(pwrite), "pwrite64" }, +[182] = { }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[196 ... 197] = { }, +[198] = { 3, TF, SEN(chown), "lchown" }, +[199] = { 0, NF, SEN(getuid), "getuid" }, +[200] = { 0, NF, SEN(getgid), "getgid" }, +[201] = { 0, NF, SEN(geteuid), "geteuid" }, +[202] = { 0, NF, SEN(getegid), "getegid" }, +[203] = { 2, 0, SEN(setreuid), "setreuid" }, +[204] = { 2, 0, SEN(setregid), "setregid" }, +[205] = { 2, 0, SEN(getgroups), "getgroups" }, +[206] = { 2, 0, SEN(setgroups), "setgroups" }, +[207] = { 3, TD, SEN(fchown), "fchown" }, +[208] = { 3, 0, SEN(setresuid), "setresuid" }, +[209] = { 3, 0, SEN(getresuid), "getresuid" }, +[210] = { 3, 0, SEN(setresgid), "setresgid" }, +[211] = { 3, 0, SEN(getresgid), "getresgid" }, +[212] = { 3, TF, SEN(chown), "chown" }, +[213] = { 1, 0, SEN(setuid), "setuid" }, +[214] = { 1, 0, SEN(setgid), "setgid" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { }, +[222] = { 3, TD, SEN(readahead), "readahead" }, +[223] = { }, +[224] = { 5, TF, SEN(setxattr), "setxattr" }, +[225] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[226] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[227] = { 4, TF, SEN(getxattr), "getxattr" }, +[228] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[229] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[230] = { 3, TF, SEN(listxattr), "listxattr" }, +[231] = { 3, TF, SEN(listxattr), "llistxattr" }, +[232] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[233] = { 2, TF, SEN(removexattr), "removexattr" }, +[234] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[236] = { 0, NF, SEN(gettid), "gettid" }, +[237] = { 2, TS, SEN(kill), "tkill" }, +[238] = { 6, 0, SEN(futex), "futex" }, +[239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[241] = { 3, TS, SEN(tgkill), "tgkill" }, +[242] = { }, +[243] = { 2, TM, SEN(io_setup), "io_setup" }, +[244] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[245] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[246] = { 3, 0, SEN(io_submit), "io_submit" }, +[247] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[248] = { 1, TP|SE, SEN(exit), "exit_group" }, +[249] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[250] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[251] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[252] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[253] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[254] = { 3, 0, SEN(timer_create), "timer_create" }, +[255] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[256] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[258] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[259] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[260] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[261] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[262] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[263] = { 5, 0, SEN(vserver), "vserver" }, +[264] = { }, +[265] = { 3, TF, SEN(statfs64), "statfs64" }, +[266] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[267] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[268] = { 6, TM, SEN(mbind), "mbind" }, +[269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[271] = { 4, 0, SEN(mq_open), "mq_open" }, +[272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[275] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[277] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[278] = { 5, 0, SEN(add_key), "add_key" }, +[279] = { 4, 0, SEN(request_key), "request_key" }, +[280] = { 5, 0, SEN(keyctl), "keyctl" }, +[281] = { 5, TP, SEN(waitid), "waitid" }, +[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[284] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[288] = { 4, TD|TF, SEN(openat), "openat" }, +[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[293] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[295] = { 4, TD|TF, SEN(renameat), "renameat" }, +[296] = { 5, TD|TF, SEN(linkat), "linkat" }, +[297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[301] = { 6, TD, SEN(pselect6), "pselect6" }, +[302] = { 5, TD, SEN(ppoll), "ppoll" }, +[303] = { 1, TP, SEN(unshare), "unshare" }, +[304] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[305] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[306] = { 6, TD, SEN(splice), "splice" }, +[307] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[308] = { 4, TD, SEN(tee), "tee" }, +[309] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[310] = { 6, TM, SEN(move_pages), "move_pages" }, +[311] = { 3, 0, SEN(getcpu), "getcpu" }, +[312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[313] = { 2, TF, SEN(utimes), "utimes" }, +[314] = { 4, TD, SEN(fallocate), "fallocate" }, +[315] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[316] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[317] = { 4, TD, SEN(timerfd), "timerfd" }, +[318] = { 1, TD, SEN(eventfd), "eventfd" }, +[319] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[320] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[321] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[322] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[323] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[324] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[325] = { 2, TD, SEN(pipe2), "pipe2" }, +[326] = { 3, TD, SEN(dup3), "dup3" }, +[327] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[328] = { 4, TD, SEN(preadv), "preadv" }, +[329] = { 4, TD, SEN(pwritev), "pwritev" }, +[330] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[331] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[332] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[333] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[334] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[335] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[336] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[337] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[338] = { 1, TD, SEN(syncfs), "syncfs" }, +[339] = { 2, TD, SEN(setns), "setns" }, +[340] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[341] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[342] = { 2, 0, SEN(printargs), "s390_runtime_instr" }, +[343] = { 5, 0, SEN(kcmp), "kcmp" }, +[344] = { 3, TD, SEN(finit_module), "finit_module" }, +[345] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[346] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[347] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[348] = { 3, 0, SEN(seccomp), "seccomp" }, +[349] = { 3, 0, SEN(getrandom), "getrandom" }, +[350] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[351] = { 3, TD, SEN(bpf), "bpf" }, +[352] = { 3, 0, SEN(printargs), "s390_pci_mmio_write" }, +[353] = { 3, 0, SEN(printargs), "s390_pci_mmio_read" }, +[354] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[356] = { 2, 0, SEN(membarrier), "membarrier" }, +[357] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[358] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[359] = { 3, TN, SEN(socket), "socket" }, +[360] = { 4, TN, SEN(socketpair), "socketpair" }, +[361] = { 3, TN, SEN(bind), "bind" }, +[362] = { 3, TN, SEN(connect), "connect" }, +[363] = { 2, TN, SEN(listen), "listen" }, +[364] = { 4, TN, SEN(accept4), "accept4" }, +[365] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[366] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[367] = { 3, TN, SEN(getsockname), "getsockname" }, +[368] = { 3, TN, SEN(getpeername), "getpeername" }, +[369] = { 6, TN, SEN(sendto), "sendto" }, +[370] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[371] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[372] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[373] = { 2, TN, SEN(shutdown), "shutdown" }, +[374] = { 3, TM, SEN(mlock2), "mlock2" }, +[375] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[376] = { 6, TD, SEN(preadv2), "preadv2" }, +[377] = { 6, TD, SEN(pwritev2), "pwritev2" }, + #define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -#if SYS_ipc_subcall != 420 - #error fix me -#endif - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ - { 4, TI, sys_semop, "semop" }, /* 421 */ - { 4, TI, sys_semget, "semget" }, /* 422 */ - { 4, TI, sys_semctl, "semctl" }, /* 423 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 424 */ - { 4, 0, printargs, "ipc_subcall" }, /* 425 */ - { 4, 0, printargs, "ipc_subcall" }, /* 426 */ - { 4, 0, printargs, "ipc_subcall" }, /* 427 */ - { 4, 0, printargs, "ipc_subcall" }, /* 428 */ - { 4, 0, printargs, "ipc_subcall" }, /* 429 */ - { 4, 0, printargs, "ipc_subcall" }, /* 430 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 431 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 432 */ - { 4, TI, sys_msgget, "msgget" }, /* 433 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 434 */ - { 4, 0, printargs, "ipc_subcall" }, /* 435 */ - { 4, 0, printargs, "ipc_subcall" }, /* 436 */ - { 4, 0, printargs, "ipc_subcall" }, /* 437 */ - { 4, 0, printargs, "ipc_subcall" }, /* 438 */ - { 4, 0, printargs, "ipc_subcall" }, /* 439 */ - { 4, 0, printargs, "ipc_subcall" }, /* 440 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 441 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 442 */ - { 4, TI, sys_shmget, "shmget" }, /* 443 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 444 */ diff --git a/linux/s390x/userent.h b/linux/s390x/userent.h new file mode 100644 index 00000000..d14488fe --- /dev/null +++ b/linux/s390x/userent.h @@ -0,0 +1,19 @@ +#include "../s390/userent0.h" +{ PT_FPR0, "fpr0" }, +{ PT_FPR1, "fpr1" }, +{ PT_FPR2, "fpr2" }, +{ PT_FPR3, "fpr3" }, +{ PT_FPR4, "fpr4" }, +{ PT_FPR5, "fpr5" }, +{ PT_FPR6, "fpr6" }, +{ PT_FPR7, "fpr7" }, +{ PT_FPR8, "fpr8" }, +{ PT_FPR9, "fpr9" }, +{ PT_FPR10, "fpr10" }, +{ PT_FPR11, "fpr11" }, +{ PT_FPR12, "fpr12" }, +{ PT_FPR13, "fpr13" }, +{ PT_FPR14, "fpr14" }, +{ PT_FPR15, "fpr15" }, +/* Other fields in "struct user" */ +#include "../s390/userent1.h" diff --git a/linux/sh/arch_getrval2.c b/linux/sh/arch_getrval2.c new file mode 100644 index 00000000..27b7cdd0 --- /dev/null +++ b/linux/sh/arch_getrval2.c @@ -0,0 +1,8 @@ +long +getrval2(struct tcb *tcp) +{ + unsigned long val; + if (upeek(tcp->pid, 4*(REG_REG0+1), &val) < 0) + return -1; + return val; +} diff --git a/linux/sh/arch_regs.c b/linux/sh/arch_regs.c new file mode 100644 index 00000000..5429b4f5 --- /dev/null +++ b/linux/sh/arch_regs.c @@ -0,0 +1,2 @@ +static unsigned long sh_r0; +#define ARCH_PC_PEEK_ADDR (4 * REG_PC) diff --git a/linux/sh/get_error.c b/linux/sh/get_error.c new file mode 100644 index 00000000..158ff9e6 --- /dev/null +++ b/linux/sh/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(sh_r0)) { + tcp->u_rval = -1; + tcp->u_error = -sh_r0; + } else { + tcp->u_rval = sh_r0; + } +} diff --git a/linux/sh/get_scno.c b/linux/sh/get_scno.c new file mode 100644 index 00000000..45fc0b7b --- /dev/null +++ b/linux/sh/get_scno.c @@ -0,0 +1,27 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + kernel_ulong_t scno = 0; + + /* + * In the new syscall ABI, the system call number is in R3. + */ + if (upeek(tcp->pid, 4*(REG_REG0+3), &scno) < 0) + return -1; + + if ((long) scno < 0) { + /* Odd as it may seem, a glibc bug has been known to cause + glibc to issue bogus negative syscall numbers. So for + our purposes, make strace print what it *should* have been */ + kernel_ulong_t correct_scno = (scno & 0xff); + if (debug_flag) + error_msg("Detected glibc bug: bogus system call" + " number = %ld, correcting to %ld", + scno, correct_scno); + scno = correct_scno; + } + + tcp->scno = scno; + return 1; +} diff --git a/linux/sh/get_syscall_args.c b/linux/sh/get_syscall_args.c new file mode 100644 index 00000000..0b6c8819 --- /dev/null +++ b/linux/sh/get_syscall_args.c @@ -0,0 +1,19 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + static const int syscall_regs[MAX_ARGS] = { + 4 * (REG_REG0+4), + 4 * (REG_REG0+5), + 4 * (REG_REG0+6), + 4 * (REG_REG0+7), + 4 * (REG_REG0 ), + 4 * (REG_REG0+1) + }; + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, syscall_regs[i], &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/sh/get_syscall_result.c b/linux/sh/get_syscall_result.c new file mode 100644 index 00000000..f7b93b74 --- /dev/null +++ b/linux/sh/get_syscall_result.c @@ -0,0 +1,6 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + /* new syscall ABI returns result in R0 */ + return upeek(tcp->pid, 4 * REG_REG0, &sh_r0) < 0 ? -1 : 0; +} diff --git a/linux/sh/ioctlent.h.in b/linux/sh/ioctlent.h.in deleted file mode 100644 index 06273163..00000000 --- a/linux/sh/ioctlent.h.in +++ /dev/null @@ -1,65 +0,0 @@ - {"asm/ioctls.h", "TCGETS", 0x5401}, - {"asm/ioctls.h", "TCSETS", 0x5402}, - {"asm/ioctls.h", "TCSETSW", 0x5403}, - {"asm/ioctls.h", "TCSETSF", 0x5404}, - {"asm/ioctls.h", "TIOCEXCL", 0x540c}, - {"asm/ioctls.h", "TIOCNXCL", 0x540d}, - {"asm/ioctls.h", "TIOCSCTTY", 0x540e}, - {"asm/ioctls.h", "TIOCSTI", 0x5412}, - {"asm/ioctls.h", "TIOCMGET", 0x5415}, - {"asm/ioctls.h", "TIOCMBIS", 0x5416}, - {"asm/ioctls.h", "TIOCMBIC", 0x5417}, - {"asm/ioctls.h", "TIOCMSET", 0x5418}, - {"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, - {"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, - {"asm/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm/ioctls.h", "TIOCCONS", 0x541d}, - {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm/ioctls.h", "TIOCPKT", 0x5420}, - {"asm/ioctls.h", "TIOCNOTTY", 0x5422}, - {"asm/ioctls.h", "TIOCSETD", 0x5423}, - {"asm/ioctls.h", "TIOCGETD", 0x5424}, - {"asm/ioctls.h", "TCSBRKP", 0x5425}, - {"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426}, - {"asm/ioctls.h", "TIOCSBRK", 0x5427}, - {"asm/ioctls.h", "TIOCCBRK", 0x5428}, - {"asm/ioctls.h", "TIOCGSID", 0x5429}, - {"asm/ioctls.h", "TIOCGPTN", 0x5430}, - {"asm/ioctls.h", "TIOCSPTLCK", 0x5431}, - {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm/ioctls.h", "FIOCLEX", 0x6601}, - {"asm/ioctls.h", "FIONCLEX", 0x6602}, - {"asm/sockios.h", "FIOGETOWN", 0x667b}, - {"asm/sockios.h", "FIOSETOWN", 0x667c}, - {"asm/ioctls.h", "FIOASYNC", 0x667d}, - {"asm/ioctls.h", "FIONBIO", 0x667e}, - {"asm/ioctls.h", "FIONREAD", 0x667f}, - {"asm/sockios.h", "SIOCATMARK", 0x7307}, - {"asm/sockios.h", "SIOCSPGRP", 0x7308}, - {"asm/sockios.h", "SIOCGPGRP", 0x7309}, - {"asm/sockios.h", "SIOCGSTAMP", 0x7364}, - {"asm/ioctls.h", "TCGETA", 0x7417}, - {"asm/ioctls.h", "TCSETA", 0x7418}, - {"asm/ioctls.h", "TCSETAW", 0x7419}, - {"asm/ioctls.h", "TCSETAF", 0x741c}, - {"asm/ioctls.h", "TCSBRK", 0x741d}, - {"asm/ioctls.h", "TCXONC", 0x741e}, - {"asm/ioctls.h", "TCFLSH", 0x741f}, - {"asm/ioctls.h", "TIOCSWINSZ", 0x7467}, - {"asm/ioctls.h", "TIOCGWINSZ", 0x7468}, - {"asm/ioctls.h", "TIOCSTART", 0x746e}, - {"asm/ioctls.h", "TIOCSTOP", 0x746f}, - {"asm/ioctls.h", "TIOCOUTQ", 0x7473}, - {"asm/ioctls.h", "TIOCSPGRP", 0x7476}, - {"asm/ioctls.h", "TIOCGPGRP", 0x7477}, diff --git a/linux/sh/ioctls_arch0.h b/linux/sh/ioctls_arch0.h new file mode 100644 index 00000000..4cf49ce7 --- /dev/null +++ b/linux/sh/ioctls_arch0.h @@ -0,0 +1,77 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sh/include/ tree. */ +{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, +{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, +{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, +{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, +{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 }, +{ "asm/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", _IOC_WRITE, 0x5425, 0x04 }, +{ "asm/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x5428, 0x00 }, +{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x541d, 0x00 }, +{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x540c, 0x00 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x5424, 0x04 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, +{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5429, 0x04 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x5419, 0x04 }, +{ "asm/ioctls.h", "TIOCLINUX", _IOC_WRITE, 0x541c, 0x01 }, +{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x5417, 0x04 }, +{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x5416, 0x04 }, +{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x5415, 0x04 }, +{ "asm/ioctls.h", "TIOCMIWAIT", _IOC_NONE, 0x545c, 0x00 }, +{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x5418, 0x04 }, +{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x5422, 0x00 }, +{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x540d, 0x00 }, +{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, +{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x5420, 0x04 }, +{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x5427, 0x00 }, +{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x540e, 0x00 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", _IOC_NONE, 0x5453, 0x00 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", _IOC_READ, 0x5459, 0x04 }, +{ "asm/ioctls.h", "TIOCSERGWILD", _IOC_READ, 0x5454, 0x04 }, +{ "asm/ioctls.h", "TIOCSERSWILD", _IOC_WRITE, 0x5455, 0x04 }, +{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x5423, 0x04 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x541a, 0x04 }, +{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, +{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x5412, 0x01 }, +{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, +{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 }, +{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 }, +{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 }, +{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 }, +{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 }, +{ "asm/sockios.h", "SIOCGSTAMP", _IOC_READ, 0x7364, 0x08 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", _IOC_READ, 0x7365, 0x08 }, +{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA1", _IOC_READ, 0x6b02, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA2", _IOC_READ, 0x6b04, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA4", _IOC_READ, 0x6b06, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCHARDRESET", _IOC_NONE, 0x6b08, 0x00 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCRESET", _IOC_NONE, 0x6b00, 0x00 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA1", _IOC_WRITE, 0x6b01, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA2", _IOC_WRITE, 0x6b03, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA4", _IOC_WRITE, 0x6b05, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIOSETADDR", _IOC_WRITE, 0x6b07, 0x04 }, diff --git a/linux/sh/ioctls_inc0.h b/linux/sh/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/sh/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/sh/set_error.c b/linux/sh/set_error.c new file mode 100644 index 00000000..cb093b64 --- /dev/null +++ b/linux/sh/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + sh_r0 = -tcp->u_error; + return upoke(tcp->pid, 4 * REG_REG0, sh_r0); +} + +static int +arch_set_success(struct tcb *tcp) +{ + sh_r0 = tcp->u_rval; + return upoke(tcp->pid, 4 * REG_REG0, sh_r0); +} diff --git a/linux/sh/set_scno.c b/linux/sh/set_scno.c new file mode 100644 index 00000000..5f71664a --- /dev/null +++ b/linux/sh/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, 4 * (REG_REG0 + 3), scno); +} diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h index 7033af11..758c7f19 100644 --- a/linux/sh/syscallent.h +++ b/linux/sh/syscallent.h @@ -28,457 +28,386 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 6, TD|TM|SI, sys_mmap, "old_mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 1, 0, sys_vm86old, "vm86old" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 5, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 3, 0, sys_cacheflush, "cacheflush" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 1, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 1, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, sys_vm86, "vm86" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 0, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { 1, TD, SEN(oldselect), "select" }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { 1, 0, SEN(vm86old), "vm86old" }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 3, 0, SEN(cacheflush), "cacheflush" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { 5, 0, SEN(vm86), "vm86" }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 6, TD, SEN(pread), "pread64" }, +[181] = { 6, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "chown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188 ... 189] = { }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +[193] = { 3, TF, SEN(truncate64), "truncate64" }, +[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "lchown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(getegid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "chown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TD, SEN(getdents64), "getdents64" }, +[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[222 ... 223] = { }, +[224] = { 0, NF, SEN(gettid), "gettid" }, +[225] = { 4, TD, SEN(readahead), "readahead" }, +[226] = { 5, TF, SEN(setxattr), "setxattr" }, +[227] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[229] = { 4, TF, SEN(getxattr), "getxattr" }, +[230] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[232] = { 3, TF, SEN(listxattr), "listxattr" }, +[233] = { 3, TF, SEN(listxattr), "llistxattr" }, +[234] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[235] = { 2, TF, SEN(removexattr), "removexattr" }, +[236] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[238] = { 2, TS, SEN(kill), "tkill" }, +[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[240] = { 6, 0, SEN(futex), "futex" }, +[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[243 ... 244] = { }, +[245] = { 2, TM, SEN(io_setup), "io_setup" }, +[246] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[248] = { 3, 0, SEN(io_submit), "io_submit" }, +[249] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[250] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[251] = { }, +[252] = { 1, TP|SE, SEN(exit), "exit_group" }, +[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[254] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[259] = { 3, 0, SEN(timer_create), "timer_create" }, +[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[263] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[268] = { 3, TF, SEN(statfs64), "statfs64" }, +[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[270] = { 3, TS, SEN(tgkill), "tgkill" }, +[271] = { 2, TF, SEN(utimes), "utimes" }, +[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[273] = { }, +[274] = { 6, TM, SEN(mbind), "mbind" }, +[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[277] = { 4, 0, SEN(mq_open), "mq_open" }, +[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[283] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[284] = { 5, TP, SEN(waitid), "waitid" }, +[285] = { 5, 0, SEN(add_key), "add_key" }, +[286] = { 4, 0, SEN(request_key), "request_key" }, +[287] = { 5, 0, SEN(keyctl), "keyctl" }, +[288] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[289] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[290] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[291] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[292] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[293] = { }, +[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[295] = { 4, TD|TF, SEN(openat), "openat" }, +[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[302] = { 4, TD|TF, SEN(renameat), "renameat" }, +[303] = { 5, TD|TF, SEN(linkat), "linkat" }, +[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[308] = { 6, TD, SEN(pselect6), "pselect6" }, +[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[310] = { 1, TP, SEN(unshare), "unshare" }, +[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[313] = { 6, TD, SEN(splice), "splice" }, +[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[315] = { 4, TD, SEN(tee), "tee" }, +[316] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[317] = { 6, TM, SEN(move_pages), "move_pages" }, +[318] = { 3, 0, SEN(getcpu), "getcpu" }, +[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[323] = { 1, TD, SEN(eventfd), "eventfd" }, +[324] = { 6, TD, SEN(fallocate), "fallocate" }, +[325] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[326] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[328] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[329] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[330] = { 3, TD, SEN(dup3), "dup3" }, +[331] = { 2, TD, SEN(pipe2), "pipe2" }, +[332] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[333] = { 5, TD, SEN(preadv), "preadv" }, +[334] = { 5, TD, SEN(pwritev), "pwritev" }, +[335] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[336] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[337] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[338] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[339] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[340] = { 3, TN, SEN(socket), "socket" }, +[341] = { 3, TN, SEN(bind), "bind" }, +[342] = { 3, TN, SEN(connect), "connect" }, +[343] = { 2, TN, SEN(listen), "listen" }, +[344] = { 3, TN, SEN(accept), "accept" }, +[345] = { 3, TN, SEN(getsockname), "getsockname" }, +[346] = { 3, TN, SEN(getpeername), "getpeername" }, +[347] = { 4, TN, SEN(socketpair), "socketpair" }, +[348] = { 4, TN, SEN(send), "send" }, +[349] = { 6, TN, SEN(sendto), "sendto" }, +[350] = { 4, TN, SEN(recv), "recv" }, +[351] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[352] = { 2, TN, SEN(shutdown), "shutdown" }, +[353] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[354] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[355] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[356] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[357] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[358] = { 4, TN, SEN(accept4), "accept4" }, +[359] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[360] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[361] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[362] = { 1, TD, SEN(syncfs), "syncfs" }, +[363] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[364] = { 2, TD, SEN(setns), "setns" }, +[365] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[366] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[367] = { 5, 0, SEN(kcmp), "kcmp" }, +[368] = { 3, TD, SEN(finit_module), "finit_module" }, +[369] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[370] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[371] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[372] = { 3, 0, SEN(seccomp), "seccomp" }, +[373] = { 3, 0, SEN(getrandom), "getrandom" }, +[374] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[375] = { 3, TD, SEN(bpf), "bpf" }, +[376] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[377] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[378] = { 2, 0, SEN(membarrier), "membarrier" }, +[379] = { 3, TM, SEN(mlock2), "mlock2" }, +[380] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[381] = { 6, TD, SEN(preadv2), "preadv2" }, +[382] = { 6, TD, SEN(pwritev2), "pwritev2" }, - { 6, TD, sys_pread, "pread" }, /* 180 */ - { 6, TD, sys_pwrite, "pwrite" }, /* 181 */ - { 3, TF, sys_chown, "chown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, NULL, NULL }, /* 188 */ - { 5, 0, NULL, NULL }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 5, 0, printargs, "getrlimit" }, /* 191 */ - { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" }, /* 192 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 193 */ - { 3, TD, sys_ftruncate64, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ -/*TODO*/{ 3, TF, printargs, "lchown32" }, /* 198 */ -/*TODO*/{ 0, 0, printargs, "getuid32" }, /* 199 */ - - { 0, 0, printargs, "getgid32" }, /* 200 */ - { 0, 0, printargs, "geteuid32" }, /* 201 */ - { 0, 0, printargs, "getegid32" }, /* 202 */ - { 2, 0, printargs, "setreuid32" }, /* 203 */ - { 2, 0, printargs, "setregid32" }, /* 204 */ - { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */ - { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */ - { 3, 0, printargs, "fchown32" }, /* 207 */ - { 3, 0, printargs, "setresuid32" }, /* 208 */ - { 3, 0, printargs, "getresuid32" }, /* 209 */ - { 3, 0, printargs, "setresgid32" }, /* 210 */ - { 3, 0, printargs, "getsetgid32" }, /* 211 */ - { 3, TF, printargs, "chown32" }, /* 212 */ - { 1, 0, printargs, "setuid32" }, /* 213 */ - { 1, 0, printargs, "setgid32" }, /* 214 */ - { 1, 0, printargs, "setfsuid32" }, /* 215 */ - { 1, 0, printargs, "setfsgid32" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 3, TM, sys_mincore, "mincore" }, /* 218 */ - { 3, TM, sys_madvise, "madvise" }, /* 219 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 220 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 221 */ - { 4, 0, NULL, NULL }, /* 222 */ - { 4, 0, NULL, NULL }, /* 223 */ - { 4, 0, sys_gettid, "gettid" }, /* 224 */ - { 4, TD, sys_readahead, "readahead" }, /* 225 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 226 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 227 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 228 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 229 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 230 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 231 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 232 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 233 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 234 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 235 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 236 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 237 */ - { 2, TS, sys_kill, "tkill" }, /* 238 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 239 */ - { 6, 0, sys_futex, "futex" }, /* 240 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 241 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 242 */ - { 0, 0, NULL, NULL }, /* 243 */ - { 0, 0, NULL, NULL }, /* 244 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 245 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 246 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 247 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 248 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 250 */ - { 0, 0, NULL, NULL }, /* 251 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 252 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 253 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 254 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 256 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 257 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 258 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 259 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 260 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 261 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 262 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 263 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 264 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 265 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 266 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 267 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 268 */ - { 2, TD, sys_fstatfs64, "fstatfs64" }, /* 269 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 270 */ - { 2, TF, sys_utimes, "utimes" }, /* 271 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 272 */ - { 0, 0, NULL, NULL }, /* 273 */ - { 4, TM, sys_mbind, "mbind" }, /* 274 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 275 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 276 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 277 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 278 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 279 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive"}, /* 280 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 281 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 282 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 283 */ - { 5, TP, sys_waitid, "waitid" }, /* 284 */ - { 5, 0, sys_add_key, "add_key" }, /* 285 */ - { 4, 0, sys_request_key, "request_key" }, /* 286 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 287 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 288 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 289 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 290 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch"}, /* 291 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch"}, /* 292 */ - { 5, 0, NULL, NULL }, /* 293 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 294 */ - { 4, TD|TF, sys_openat, "openat" }, /* 295 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 296 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 297 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 298 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 299 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 300 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 301 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 302 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 303 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 304 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 305 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 306 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 307 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 308 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 309 */ - { 1, TP, sys_unshare, "unshare" }, /* 310 */ - { 2, 0, sys_set_robust_list, "set_robust_list"}, /* 311 */ - { 3, 0, sys_get_robust_list, "get_robust_list"}, /* 312 */ - { 6, TD, sys_splice, "splice" }, /* 313 */ - { 6, TD, sys_sync_file_range, "sync_file_range"}, /* 314 */ - { 4, TD, sys_tee, "tee" }, /* 315 */ - { 5, TD, sys_vmsplice, "vmsplice" }, /* 316 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 317 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 318 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 319 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 320 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 321 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 322 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 323 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 324 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 325 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 326 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 327 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 328 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 329 */ - { 3, TD, sys_dup3, "dup3" }, /* 330 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 331 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 332 */ - { 5, TD, sys_preadv, "preadv" }, /* 333 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 334 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 335 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 336 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 337 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 338 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 339 */ - { 3, TN, sys_socket, "socket" }, /* 340 */ - { 3, TN, sys_bind, "bind" }, /* 341 */ - { 3, TN, sys_connect, "connect" }, /* 342 */ - { 2, TN, sys_listen, "listen" }, /* 343 */ - { 3, TN, sys_accept, "accept" }, /* 344 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 345 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 346 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 347 */ - { 4, TN, sys_send, "send" }, /* 348 */ - { 6, TN, sys_sendto, "sendto" }, /* 349 */ - { 4, TN, sys_recv, "recv" }, /* 350 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 351 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 352 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 353 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 354 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 355 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 356 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 357 */ - { 4, TN, sys_accept4, "accept4" }, /* 358 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 359 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 360 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 361 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 362 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 363 */ - { 2, TD, sys_setns, "setns" }, /* 364 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 365 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 366 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 367 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 368 */ - { 5, 0, NULL, NULL }, /* 369 */ - { 5, 0, NULL, NULL }, /* 370 */ - { 5, 0, NULL, NULL }, /* 371 */ - { 5, 0, NULL, NULL }, /* 372 */ - { 5, 0, NULL, NULL }, /* 373 */ - { 5, 0, NULL, NULL }, /* 374 */ - { 5, 0, NULL, NULL }, /* 375 */ - { 5, 0, NULL, NULL }, /* 376 */ - { 5, 0, NULL, NULL }, /* 377 */ - { 5, 0, NULL, NULL }, /* 378 */ - { 5, 0, NULL, NULL }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 5, 0, NULL, NULL }, /* 381 */ - { 5, 0, NULL, NULL }, /* 382 */ - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ #define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -#if SYS_ipc_subcall != 420 - #error fix me -#endif - - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ - { 4, TI, sys_semop, "semop" }, /* 421 */ - { 4, TI, sys_semget, "semget" }, /* 422 */ - { 4, TI, sys_semctl, "semctl" }, /* 423 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 424 */ - { 4, 0, printargs, "ipc_subcall" }, /* 425 */ - { 4, 0, printargs, "ipc_subcall" }, /* 426 */ - { 4, 0, printargs, "ipc_subcall" }, /* 427 */ - { 4, 0, printargs, "ipc_subcall" }, /* 428 */ - { 4, 0, printargs, "ipc_subcall" }, /* 429 */ - { 4, 0, printargs, "ipc_subcall" }, /* 430 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 431 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 432 */ - { 4, TI, sys_msgget, "msgget" }, /* 433 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 434 */ - { 4, 0, printargs, "ipc_subcall" }, /* 435 */ - { 4, 0, printargs, "ipc_subcall" }, /* 436 */ - { 4, 0, printargs, "ipc_subcall" }, /* 437 */ - { 4, 0, printargs, "ipc_subcall" }, /* 438 */ - { 4, 0, printargs, "ipc_subcall" }, /* 439 */ - { 4, 0, printargs, "ipc_subcall" }, /* 440 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 441 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 442 */ - { 4, TI, sys_shmget, "shmget" }, /* 443 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 444 */ diff --git a/linux/sh/userent.h b/linux/sh/userent.h new file mode 100644 index 00000000..116861a9 --- /dev/null +++ b/linux/sh/userent.h @@ -0,0 +1,53 @@ +XLAT(4*REG_REG0), +{ 4*(REG_REG0+1), "4*REG_REG1" }, +{ 4*(REG_REG0+2), "4*REG_REG2" }, +{ 4*(REG_REG0+3), "4*REG_REG3" }, +{ 4*(REG_REG0+4), "4*REG_REG4" }, +{ 4*(REG_REG0+5), "4*REG_REG5" }, +{ 4*(REG_REG0+6), "4*REG_REG6" }, +{ 4*(REG_REG0+7), "4*REG_REG7" }, +{ 4*(REG_REG0+8), "4*REG_REG8" }, +{ 4*(REG_REG0+9), "4*REG_REG9" }, +{ 4*(REG_REG0+10), "4*REG_REG10" }, +{ 4*(REG_REG0+11), "4*REG_REG11" }, +{ 4*(REG_REG0+12), "4*REG_REG12" }, +{ 4*(REG_REG0+13), "4*REG_REG13" }, +{ 4*(REG_REG0+14), "4*REG_REG14" }, +XLAT(4*REG_REG15), +XLAT(4*REG_PC), +XLAT(4*REG_PR), +XLAT(4*REG_SR), +XLAT(4*REG_GBR), +XLAT(4*REG_MACH), +XLAT(4*REG_MACL), +XLAT(4*REG_SYSCALL), +XLAT(4*REG_FPUL), +XLAT(4*REG_FPREG0), +{ 4*(REG_FPREG0+1), "4*REG_FPREG1" }, +{ 4*(REG_FPREG0+2), "4*REG_FPREG2" }, +{ 4*(REG_FPREG0+3), "4*REG_FPREG3" }, +{ 4*(REG_FPREG0+4), "4*REG_FPREG4" }, +{ 4*(REG_FPREG0+5), "4*REG_FPREG5" }, +{ 4*(REG_FPREG0+6), "4*REG_FPREG6" }, +{ 4*(REG_FPREG0+7), "4*REG_FPREG7" }, +{ 4*(REG_FPREG0+8), "4*REG_FPREG8" }, +{ 4*(REG_FPREG0+9), "4*REG_FPREG9" }, +{ 4*(REG_FPREG0+10), "4*REG_FPREG10" }, +{ 4*(REG_FPREG0+11), "4*REG_FPREG11" }, +{ 4*(REG_FPREG0+12), "4*REG_FPREG12" }, +{ 4*(REG_FPREG0+13), "4*REG_FPREG13" }, +{ 4*(REG_FPREG0+14), "4*REG_FPREG14" }, +XLAT(4*REG_FPREG15), +#ifdef REG_XDREG0 +XLAT(4*REG_XDREG0), +{ 4*(REG_XDREG0+2), "4*REG_XDREG2" }, +{ 4*(REG_XDREG0+4), "4*REG_XDREG4" }, +{ 4*(REG_XDREG0+6), "4*REG_XDREG6" }, +{ 4*(REG_XDREG0+8), "4*REG_XDREG8" }, +{ 4*(REG_XDREG0+10), "4*REG_XDREG10" }, +{ 4*(REG_XDREG0+12), "4*REG_XDREG12" }, +XLAT(4*REG_XDREG14), +#endif +XLAT(4*REG_FPSCR), +/* Other fields in "struct user" */ +#include "userent0.h" diff --git a/linux/sh/userent0.h b/linux/sh/userent0.h new file mode 100644 index 00000000..918805a1 --- /dev/null +++ b/linux/sh/userent0.h @@ -0,0 +1,13 @@ +XLAT_UOFF(u_fpvalid), +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(start_code), +XLAT_UOFF(start_data), +XLAT_UOFF(start_stack), +XLAT_UOFF(signal), +XLAT_UOFF(u_ar0), +XLAT_UOFF(u_fpstate), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/sh64/arch_regs.c b/linux/sh64/arch_regs.c new file mode 100644 index 00000000..8b3202a8 --- /dev/null +++ b/linux/sh64/arch_regs.c @@ -0,0 +1,2 @@ +static unsigned long sh64_r9; +#define ARCH_PC_PEEK_ADDR REG_PC diff --git a/linux/sh64/arch_regs.h b/linux/sh64/arch_regs.h new file mode 100644 index 00000000..7f64b497 --- /dev/null +++ b/linux/sh64/arch_regs.h @@ -0,0 +1,15 @@ +/* SH64 Linux - this code assumes the following kernel API for system calls: + PC Offset 0 + System Call Offset 16 (actually, (syscall no.) | (0x1n << 16), + where n = no. of parameters. + Other regs Offset 24+ + + On entry: R2-7 = parameters 1-6 (as many as necessary) + On return: R9 = result. +*/ + +/* Offset for peeks of registers */ +#define REG_OFFSET (24) +#define REG_GENERAL(x) (8*(x)+REG_OFFSET) +#define REG_PC (0*8) +#define REG_SYSCALL (2*8) diff --git a/linux/sh64/get_error.c b/linux/sh64/get_error.c new file mode 100644 index 00000000..7858df7c --- /dev/null +++ b/linux/sh64/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(sh64_r9)) { + tcp->u_rval = -1; + tcp->u_error = -sh64_r9; + } else { + tcp->u_rval = sh64_r9; + } +} diff --git a/linux/sh64/get_scno.c b/linux/sh64/get_scno.c new file mode 100644 index 00000000..50a52232 --- /dev/null +++ b/linux/sh64/get_scno.c @@ -0,0 +1,9 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + if (upeek(tcp->pid, REG_SYSCALL, &tcp->scno) < 0) + return -1; + tcp->scno &= 0xffff; + return 1; +} diff --git a/linux/sh64/get_syscall_args.c b/linux/sh64/get_syscall_args.c new file mode 100644 index 00000000..3970df8f --- /dev/null +++ b/linux/sh64/get_syscall_args.c @@ -0,0 +1,14 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + /* Registers used by SH5 Linux system calls for parameters */ + static const int syscall_regs[MAX_ARGS] = { 2, 3, 4, 5, 6, 7 }; + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, REG_GENERAL(syscall_regs[i]), + &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/sh64/get_syscall_result.c b/linux/sh64/get_syscall_result.c new file mode 100644 index 00000000..4264dccc --- /dev/null +++ b/linux/sh64/get_syscall_result.c @@ -0,0 +1,6 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + /* ABI defines result returned in r9 */ + return upeek(tcp->pid, REG_GENERAL(9), &sh64_r9) < 0 ? -1 : 0; +} diff --git a/linux/sh64/ioctlent.h.in b/linux/sh64/ioctlent.h.in deleted file mode 100644 index 0d5f9bd8..00000000 --- a/linux/sh64/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../sh/ioctlent.h.in" diff --git a/linux/sh64/ioctls_arch0.h b/linux/sh64/ioctls_arch0.h new file mode 100644 index 00000000..36e5aa26 --- /dev/null +++ b/linux/sh64/ioctls_arch0.h @@ -0,0 +1,77 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sh/include/ tree. */ +{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, +{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, +{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, +{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, +{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 }, +{ "asm/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", _IOC_WRITE, 0x5425, 0x04 }, +{ "asm/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x5428, 0x00 }, +{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x541d, 0x00 }, +{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x540c, 0x00 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x5424, 0x04 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, +{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5429, 0x04 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x5419, 0x04 }, +{ "asm/ioctls.h", "TIOCLINUX", _IOC_WRITE, 0x541c, 0x01 }, +{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x5417, 0x04 }, +{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x5416, 0x04 }, +{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x5415, 0x04 }, +{ "asm/ioctls.h", "TIOCMIWAIT", _IOC_NONE, 0x545c, 0x00 }, +{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x5418, 0x04 }, +{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x5422, 0x00 }, +{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x540d, 0x00 }, +{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, +{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x5420, 0x04 }, +{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x5427, 0x00 }, +{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x540e, 0x00 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", _IOC_NONE, 0x5453, 0x00 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", _IOC_READ, 0x5459, 0x04 }, +{ "asm/ioctls.h", "TIOCSERGWILD", _IOC_READ, 0x5454, 0x04 }, +{ "asm/ioctls.h", "TIOCSERSWILD", _IOC_WRITE, 0x5455, 0x04 }, +{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x5423, 0x04 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x541a, 0x04 }, +{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, +{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x5412, 0x01 }, +{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, +{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 }, +{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 }, +{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 }, +{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 }, +{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 }, +{ "asm/sockios.h", "SIOCGSTAMP", _IOC_READ, 0x7364, 0x10 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", _IOC_READ, 0x7365, 0x10 }, +{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA1", _IOC_READ, 0x6b02, 0x08 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA2", _IOC_READ, 0x6b04, 0x08 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA4", _IOC_READ, 0x6b06, 0x08 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCHARDRESET", _IOC_NONE, 0x6b08, 0x00 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCRESET", _IOC_NONE, 0x6b00, 0x00 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA1", _IOC_WRITE, 0x6b01, 0x08 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA2", _IOC_WRITE, 0x6b03, 0x08 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA4", _IOC_WRITE, 0x6b05, 0x08 }, +{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIOSETADDR", _IOC_WRITE, 0x6b07, 0x08 }, diff --git a/linux/sh64/ioctls_inc0.h b/linux/sh64/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/sh64/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/sh64/set_error.c b/linux/sh64/set_error.c new file mode 100644 index 00000000..35271fb5 --- /dev/null +++ b/linux/sh64/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + sh64_r9 = -tcp->u_error; + return upoke(tcp->pid, REG_GENERAL(9), sh64_r9); +} + +static int +arch_set_success(struct tcb *tcp) +{ + sh64_r9 = tcp->u_rval; + return upoke(tcp->pid, REG_GENERAL(9), sh64_r9); +} diff --git a/linux/sh64/set_scno.c b/linux/sh64/set_scno.c new file mode 100644 index 00000000..be4f1ed1 --- /dev/null +++ b/linux/sh64/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, REG_SYSCALL, scno); +} diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h index 5db52e25..e35ef6f3 100644 --- a/linux/sh64/syscallent.h +++ b/linux/sh64/syscallent.h @@ -26,430 +26,397 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - { 0, 0, sys_setup, "setup" }, /* 0 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 1, 0, sys_time, "time" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 0, TM, sys_break, "break" }, /* 17 */ - { 2, TF, sys_oldstat, "oldstat" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_stime, "stime" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TD, sys_oldfstat, "oldfstat" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 2, 0, sys_stty, "stty" }, /* 31 */ - { 2, 0, sys_gtty, "gtty" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 0, 0, sys_ftime, "ftime" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, TD, sys_dup, "dup" }, /* 41 */ - { 1, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, 0, sys_prof, "prof" }, /* 44 */ - { 1, TM|SI, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 0, 0, sys_lock, "lock" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 55 */ - { 0, 0, sys_mpx, "mpx" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 58 */ - { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, TD, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 67 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 68 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 1, TD, sys_oldselect, "oldselect" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 2, TF, sys_swapon, "swapon" }, /* 87 */ - { 4, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, TD, sys_readdir, "readdir" }, /* 89 */ - { 6, TD|TM|SI, sys_mmap, "old_mmap" }, /* 90 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 94 */ - { 3, TD, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 4, 0, sys_profil, "profil" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, TD, sys_fstat, "fstat" }, /* 108 */ - { 1, 0, sys_olduname, "olduname" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 0, 0, sys_idle, "idle" }, /* 112 */ - { 1, 0, NULL, NULL }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 5, TI, sys_ipc, "ipc" }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 3, 0, printargs, "cacheflush" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 3, 0, sys_init_module, "init_module" }, /* 128 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, TD, sys_llseek, "_llseek" }, /* 140 */ - { 3, TD, sys_getdents, "getdents" }, /* 141 */ - { 5, TD, sys_select, "select" }, /* 142 */ - { 2, TD, sys_flock, "flock" }, /* 143 */ - { 3, TM, sys_msync, "msync" }, /* 144 */ - { 3, TD, sys_readv, "readv" }, /* 145 */ - { 3, TD, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 1, TM, sys_mlock, "mlock" }, /* 150 */ - { 2, TM, sys_munlock, "munlock" }, /* 151 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 152 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, NULL, NULL }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, TD, sys_poll, "poll" }, /* 168 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 4, TD, sys_pread, "pread" }, /* 180 */ - { 4, TD, sys_pwrite, "pwrite" }, /* 181 */ - { 3, TF, sys_chown, "chown" }, /* 182 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, NULL, NULL }, /* 188 */ - { 5, 0, NULL, NULL }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 2, 0, printargs, "getrlimit" }, /* 191 */ - { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" }, /* 192 */ - { 2, TF, sys_truncate, "truncate64" }, /* 193 */ - { 2, TD, sys_ftruncate, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 197 */ - { 3, TF, sys_chown, "lchown32" }, /* 198 */ - { 0, NF, sys_getuid, "getuid32" }, /* 199 */ - { 0, 0, printargs, "getgid32" }, /* 200 */ - { 0, 0, printargs, "geteuid32" }, /* 201 */ - { 0, 0, printargs, "getegid32" }, /* 202 */ - { 2, 0, printargs, "setreuid32" }, /* 203 */ - { 2, 0, printargs, "setregid32" }, /* 204 */ - { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */ - { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */ - { 3, 0, printargs, "fchown32" }, /* 207 */ - { 3, 0, printargs, "setresuid32" }, /* 208 */ - { 3, 0, printargs, "getresuid32" }, /* 209 */ - { 3, 0, printargs, "setresgid32" }, /* 210 */ - { 3, 0, printargs, "getresgid32" }, /* 211 */ - { 3, TF, printargs, "chown32" }, /* 212 */ - { 1, 0, printargs, "setuid32" }, /* 213 */ - { 1, 0, printargs, "setgid32" }, /* 214 */ - { 1, 0, printargs, "setfsuid32" }, /* 215 */ - { 1, 0, printargs, "setfsgid32" }, /* 216 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */ - { 3, TM, sys_mincore, "mincore" }, /* 218 */ - { 3, TM, sys_madvise, "madvise" }, /* 219 */ - { 3, TN, sys_socket, "socket" }, /* 220 */ - { 3, TN, sys_bind, "bind" }, /* 221 */ - { 3, TN, sys_connect, "connect" }, /* 222 */ - { 2, TN, sys_listen, "listen" }, /* 223 */ - { 3, TN, sys_accept, "accept" }, /* 224 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 225 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 226 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 227 */ - { 4, TN, sys_send, "send" }, /* 228 */ - { 6, TN, sys_sendto, "sendto" }, /* 229 */ - { 4, TN, sys_recv, "recv" }, /* 230 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 231 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 232 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 233 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 234 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 235 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 236 */ - { 4, TI, sys_semop, "semop" }, /* 237 */ - { 4, TI, sys_semget, "semget" }, /* 238 */ - { 4, TI, sys_semctl, "semctl" }, /* 239 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 240 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 241 */ - { 4, TI, sys_msgget, "msgget" }, /* 242 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 243 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 244 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 245 */ - { 4, TI, sys_shmget, "shmget" }, /* 246 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 247 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 248 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 249 */ - { 4, 0, NULL, NULL }, /* 250 */ - { 4, 0, NULL, NULL }, /* 251 */ - { 4, 0, sys_gettid, "gettid" }, /* 252 */ - { 3, TD, sys_readahead, "readahead" }, /* 253 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 254 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 255 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 256 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 257 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 258 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 259 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 260 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 261 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 262 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 263 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 264 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 265 */ - { 2, TS, sys_kill, "tkill" }, /* 266 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 267 */ - { 6, 0, sys_futex, "futex" }, /* 268 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 269 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 270 */ - { 5, 0, NULL, NULL }, /* 271 */ - { 5, 0, NULL, NULL }, /* 272 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 273 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 274 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 275 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 276 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 277 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 278 */ - { 5, 0, NULL, NULL }, /* 279 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 280 */ - { 3, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 281 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 282 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 283 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 284 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 285 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 286 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 287 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 288 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 289 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 290 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 291 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 292 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 293 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 294 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 295 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 296 */ - { 2, TD, sys_fstatfs64, "fstatfs64" }, /* 297 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 298 */ - { 2, TF, sys_utimes, "utimes" }, /* 299 */ - { 4, TD, sys_fadvise64, "fadvise64_64" }, /* 300 */ - { 0, 0, NULL, NULL }, /* 301 */ - { 4, TM, sys_mbind, "mbind" }, /* 302 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 303 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 304 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 305 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 306 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 307 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive"}, /* 308 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 309 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 310 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 311 */ - { 5, TP, sys_waitid, "waitid" }, /* 312 */ - { 5, 0, sys_add_key, "add_key" }, /* 313 */ - { 4, 0, sys_request_key, "request_key" }, /* 314 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 315 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 316 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 317 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 318 */ - { 3, TD, printargs, "inotify_add_watch"}, /* 319 */ - { 2, TD, printargs, "inotify_rm_watch"}, /* 320 */ - { 5, 0, NULL, NULL }, /* 321 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 322 */ - { 4, TD|TF, sys_openat, "openat" }, /* 323 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 324 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 325 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 326 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 327 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 328 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 329 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 330 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 331 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 332 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 333 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 334 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 335 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 336 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 337 */ - { 1, TP, sys_unshare, "unshare" }, /* 338 */ - { 2, 0, sys_set_robust_list, "set_robust_list"}, /* 339 */ - { 3, 0, sys_get_robust_list, "get_robust_list"}, /* 340 */ - { 6, TD, sys_splice, "splice" }, /* 341 */ - { 4, TD, sys_sync_file_range, "sync_file_range"}, /* 342 */ - { 4, TD, sys_tee, "tee" }, /* 343 */ - { 5, TD, sys_vmsplice, "vmsplice" }, /* 344 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 345 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 346 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 347 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 348 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 349 */ - { 4, TD, sys_timerfd, "timerfd" }, /* 350 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 351 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 352 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 353 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 354 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 355 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 356 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 357 */ - { 3, TD, sys_dup3, "dup3" }, /* 358 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 359 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 360 */ - { 4, TD, sys_preadv, "preadv" }, /* 361 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 362 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 363 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 364 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 365 */ - { 4, TN, sys_accept4, "accept4" }, /* 366 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 367 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 368 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 369 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 370 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 371 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 372 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 373 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 374 */ - { 2, TD, sys_setns, "setns" }, /* 375 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 376 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 377 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 378 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 379 */ - { 5, 0, NULL, NULL }, /* 380 */ - { 5, 0, NULL, NULL }, /* 381 */ - { 5, 0, NULL, NULL }, /* 382 */ - { 5, 0, NULL, NULL }, /* 383 */ - { 5, 0, NULL, NULL }, /* 384 */ - { 5, 0, NULL, NULL }, /* 385 */ - { 5, 0, NULL, NULL }, /* 386 */ - { 5, 0, NULL, NULL }, /* 387 */ - { 5, 0, NULL, NULL }, /* 388 */ - { 5, 0, NULL, NULL }, /* 389 */ - { 5, 0, NULL, NULL }, /* 390 */ - { 5, 0, NULL, NULL }, /* 391 */ - { 5, 0, NULL, NULL }, /* 392 */ - { 5, 0, NULL, NULL }, /* 393 */ - { 5, 0, NULL, NULL }, /* 394 */ - { 5, 0, NULL, NULL }, /* 395 */ - { 5, 0, NULL, NULL }, /* 396 */ - { 5, 0, NULL, NULL }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 1, 0, SEN(time), "time" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { 0, TM, SEN(break), "break" }, +[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 5, TF, SEN(mount), "mount" }, +[ 22] = { 1, TF, SEN(umount), "umount" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 1, 0, SEN(stime), "stime" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 2, 0, SEN(stty), "stty" }, +[ 32] = { 2, 0, SEN(gtty), "gtty" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 0, 0, SEN(ftime), "ftime" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(rename), "rename" }, +[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 0, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, 0, SEN(prof), "prof" }, +[ 45] = { 1, TM|SI, SEN(brk), "brk" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, TF, SEN(umount2), "umount2" }, +[ 53] = { 0, 0, SEN(lock), "lock" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 56] = { 0, 0, SEN(mpx), "mpx" }, +[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, +[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 63] = { 2, TD, SEN(dup2), "dup2" }, +[ 64] = { 0, NF, SEN(getppid), "getppid" }, +[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 66] = { 0, 0, SEN(setsid), "setsid" }, +[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, +[ 71] = { 2, 0, SEN(setregid16), "setregid" }, +[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, +[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 82] = { }, +[ 83] = { 2, TF, SEN(symlink), "symlink" }, +[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 85] = { 3, TF, SEN(readlink), "readlink" }, +[ 86] = { 1, TF, SEN(uselib), "uselib" }, +[ 87] = { 2, TF, SEN(swapon), "swapon" }, +[ 88] = { 4, 0, SEN(reboot), "reboot" }, +[ 89] = { 3, TD, SEN(readdir), "readdir" }, +[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 92] = { 2, TF, SEN(truncate), "truncate" }, +[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 95] = { 3, TD, SEN(fchown16), "fchown" }, +[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, +[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 98] = { 4, 0, SEN(profil), "profil" }, +[ 99] = { 2, TF, SEN(statfs), "statfs" }, +[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[101] = { 3, 0, SEN(ioperm), "ioperm" }, +[102] = { 2, TD, SEN(socketcall), "socketcall" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 3, 0, SEN(setitimer), "setitimer" }, +[105] = { 2, 0, SEN(getitimer), "getitimer" }, +[106] = { 2, TF, SEN(stat), "stat" }, +[107] = { 2, TF, SEN(lstat), "lstat" }, +[108] = { 2, TD, SEN(fstat), "fstat" }, +[109] = { 1, 0, SEN(olduname), "olduname" }, +[110] = { 1, 0, SEN(iopl), "iopl" }, +[111] = { 0, 0, SEN(vhangup), "vhangup" }, +[112] = { 0, 0, SEN(idle), "idle" }, +[113] = { }, +[114] = { 4, TP, SEN(wait4), "wait4" }, +[115] = { 1, TF, SEN(swapoff), "swapoff" }, +[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[117] = { 6, TI, SEN(ipc), "ipc" }, +[118] = { 1, TD, SEN(fsync), "fsync" }, +[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[120] = { 5, TP, SEN(clone), "clone" }, +[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[122] = { 1, 0, SEN(uname), "uname" }, +[123] = { 3, 0, SEN(printargs), "cacheflush" }, +[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[127] = { 2, 0, SEN(create_module), "create_module" }, +[128] = { 3, 0, SEN(init_module), "init_module" }, +[129] = { 2, 0, SEN(delete_module), "delete_module" }, +[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[131] = { 4, TF, SEN(quotactl), "quotactl" }, +[132] = { 1, 0, SEN(getpgid), "getpgid" }, +[133] = { 1, TD, SEN(fchdir), "fchdir" }, +[134] = { 2, 0, SEN(bdflush), "bdflush" }, +[135] = { 3, 0, SEN(sysfs), "sysfs" }, +[136] = { 1, NF, SEN(personality), "personality" }, +[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[140] = { 5, TD, SEN(llseek), "_llseek" }, +[141] = { 3, TD, SEN(getdents), "getdents" }, +[142] = { 5, TD, SEN(select), "_newselect" }, +[143] = { 2, TD, SEN(flock), "flock" }, +[144] = { 3, TM, SEN(msync), "msync" }, +[145] = { 3, TD, SEN(readv), "readv" }, +[146] = { 3, TD, SEN(writev), "writev" }, +[147] = { 1, 0, SEN(getsid), "getsid" }, +[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[149] = { 1, 0, SEN(sysctl), "_sysctl" }, +[150] = { 2, TM, SEN(mlock), "mlock" }, +[151] = { 2, TM, SEN(munlock), "munlock" }, +[152] = { 1, TM, SEN(mlockall), "mlockall" }, +[153] = { 0, TM, SEN(munlockall), "munlockall" }, +[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[163] = { 5, TM|SI, SEN(mremap), "mremap" }, +[164] = { 3, 0, SEN(setresuid16), "setresuid" }, +[165] = { 3, 0, SEN(getresuid16), "getresuid" }, +[166] = { }, +[167] = { 5, 0, SEN(query_module), "query_module" }, +[168] = { 3, TD, SEN(poll), "poll" }, +[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[170] = { 3, 0, SEN(setresgid16), "setresgid" }, +[171] = { 3, 0, SEN(getresgid16), "getresgid" }, +[172] = { 5, 0, SEN(prctl), "prctl" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[180] = { 4, TD, SEN(pread), "pread64" }, +[181] = { 4, TD, SEN(pwrite), "pwrite64" }, +[182] = { 3, TF, SEN(chown16), "chown" }, +[183] = { 2, TF, SEN(getcwd), "getcwd" }, +[184] = { 2, 0, SEN(capget), "capget" }, +[185] = { 2, 0, SEN(capset), "capset" }, +[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[188 ... 189] = { }, +[190] = { 0, TP, SEN(vfork), "vfork" }, +[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, +[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +[193] = { 2, TF, SEN(truncate), "truncate64" }, +[194] = { 2, TD, SEN(ftruncate), "ftruncate64" }, +[195] = { 2, TF, SEN(stat64), "stat64" }, +[196] = { 2, TF, SEN(lstat64), "lstat64" }, +[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[198] = { 3, TF, SEN(chown), "lchown32" }, +[199] = { 0, NF, SEN(getuid), "getuid32" }, +[200] = { 0, NF, SEN(getgid), "getgid32" }, +[201] = { 0, NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, NF, SEN(getegid), "getegid32" }, +[203] = { 2, 0, SEN(setreuid), "setreuid32" }, +[204] = { 2, 0, SEN(setregid), "setregid32" }, +[205] = { 2, 0, SEN(getgroups), "getgroups32" }, +[206] = { 2, 0, SEN(setgroups), "setgroups32" }, +[207] = { 3, TD, SEN(fchown), "fchown32" }, +[208] = { 3, 0, SEN(setresuid), "setresuid32" }, +[209] = { 3, 0, SEN(getresuid), "getresuid32" }, +[210] = { 3, 0, SEN(setresgid), "setresgid32" }, +[211] = { 3, 0, SEN(getresgid), "getresgid32" }, +[212] = { 3, TF, SEN(chown), "chown32" }, +[213] = { 1, 0, SEN(setuid), "setuid32" }, +[214] = { 1, 0, SEN(setgid), "setgid32" }, +[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[218] = { 3, TM, SEN(mincore), "mincore" }, +[219] = { 3, TM, SEN(madvise), "madvise" }, +[220] = { 3, TN, SEN(socket), "socket" }, +[221] = { 3, TN, SEN(bind), "bind" }, +[222] = { 3, TN, SEN(connect), "connect" }, +[223] = { 2, TN, SEN(listen), "listen" }, +[224] = { 3, TN, SEN(accept), "accept" }, +[225] = { 3, TN, SEN(getsockname), "getsockname" }, +[226] = { 3, TN, SEN(getpeername), "getpeername" }, +[227] = { 4, TN, SEN(socketpair), "socketpair" }, +[228] = { 4, TN, SEN(send), "send" }, +[229] = { 6, TN, SEN(sendto), "sendto" }, +[230] = { 4, TN, SEN(recv), "recv" }, +[231] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[232] = { 2, TN, SEN(shutdown), "shutdown" }, +[233] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[234] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[235] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[236] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[237] = { 3, TI, SEN(semop), "semop" }, +[238] = { 3, TI, SEN(semget), "semget" }, +[239] = { 4, TI, SEN(semctl), "semctl" }, +[240] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[241] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[242] = { 2, TI, SEN(msgget), "msgget" }, +[243] = { 3, TI, SEN(msgctl), "msgctl" }, +[244] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[245] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[246] = { 3, TI, SEN(shmget), "shmget" }, +[247] = { 3, TI, SEN(shmctl), "shmctl" }, +[248] = { 3, TD, SEN(getdents64), "getdents64" }, +[249] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[250 ... 251] = { }, +[252] = { 0, NF, SEN(gettid), "gettid" }, +[253] = { 3, TD, SEN(readahead), "readahead" }, +[254] = { 5, TF, SEN(setxattr), "setxattr" }, +[255] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[256] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[257] = { 4, TF, SEN(getxattr), "getxattr" }, +[258] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[259] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[260] = { 3, TF, SEN(listxattr), "listxattr" }, +[261] = { 3, TF, SEN(listxattr), "llistxattr" }, +[262] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[263] = { 2, TF, SEN(removexattr), "removexattr" }, +[264] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[265] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[266] = { 2, TS, SEN(kill), "tkill" }, +[267] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[268] = { 6, 0, SEN(futex), "futex" }, +[269] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[270] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[271 ... 272] = { }, +[273] = { 2, TM, SEN(io_setup), "io_setup" }, +[274] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[275] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[276] = { 3, 0, SEN(io_submit), "io_submit" }, +[277] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[278] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[279] = { }, +[280] = { 1, TP|SE, SEN(exit), "exit_group" }, +[281] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[282] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[283] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[284] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[285] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[286] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[287] = { 3, 0, SEN(timer_create), "timer_create" }, +[288] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[289] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[290] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[291] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[292] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[293] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[294] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[295] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[296] = { 3, TF, SEN(statfs64), "statfs64" }, +[297] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[298] = { 3, TS, SEN(tgkill), "tgkill" }, +[299] = { 2, TF, SEN(utimes), "utimes" }, +[300] = { 4, TD, SEN(fadvise64_64), "fadvise64_64" }, +[301] = { }, +[302] = { 6, TM, SEN(mbind), "mbind" }, +[303] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[304] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[305] = { 4, 0, SEN(mq_open), "mq_open" }, +[306] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[307] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[308] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[309] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[310] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[311] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[312] = { 5, TP, SEN(waitid), "waitid" }, +[313] = { 5, 0, SEN(add_key), "add_key" }, +[314] = { 4, 0, SEN(request_key), "request_key" }, +[315] = { 5, 0, SEN(keyctl), "keyctl" }, +[316] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[317] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[318] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[319] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[320] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[321] = { }, +[322] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[323] = { 4, TD|TF, SEN(openat), "openat" }, +[324] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[325] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[326] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[327] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[328] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[329] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[330] = { 4, TD|TF, SEN(renameat), "renameat" }, +[331] = { 5, TD|TF, SEN(linkat), "linkat" }, +[332] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[333] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[334] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[335] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[336] = { 6, TD, SEN(pselect6), "pselect6" }, +[337] = { 5, TD, SEN(ppoll), "ppoll" }, +[338] = { 1, TP, SEN(unshare), "unshare" }, +[339] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[340] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[341] = { 6, TD, SEN(splice), "splice" }, +[342] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[343] = { 4, TD, SEN(tee), "tee" }, +[344] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[345] = { 6, TM, SEN(move_pages), "move_pages" }, +[346] = { 3, 0, SEN(getcpu), "getcpu" }, +[347] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[348] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[349] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[350] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[351] = { 1, TD, SEN(eventfd), "eventfd" }, +[352] = { 4, TD, SEN(fallocate), "fallocate" }, +[353] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[354] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[355] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[356] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[357] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[358] = { 3, TD, SEN(dup3), "dup3" }, +[359] = { 2, TD, SEN(pipe2), "pipe2" }, +[360] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[361] = { 4, TD, SEN(preadv), "preadv" }, +[362] = { 4, TD, SEN(pwritev), "pwritev" }, +[363] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[364] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[365] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[366] = { 4, TN, SEN(accept4), "accept4" }, +[367] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[368] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[369] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[370] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[371] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[372] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[373] = { 1, TD, SEN(syncfs), "syncfs" }, +[374] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[375] = { 2, TD, SEN(setns), "setns" }, +[376] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[377] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[378] = { 5, 0, SEN(kcmp), "kcmp" }, +[379] = { 3, TD, SEN(finit_module), "finit_module" }, +[380] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[381] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[382] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[383] = { 3, 0, SEN(seccomp), "seccomp" }, +[384] = { 3, 0, SEN(getrandom), "getrandom" }, +[385] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[386] = { 3, TD, SEN(bpf), "bpf" }, +[387] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[388] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[389] = { 2, 0, SEN(membarrier), "membarrier" }, +[390] = { 3, TM, SEN(mlock2), "mlock2" }, +[391] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[392] = { 6, TD, SEN(preadv2), "preadv2" }, +[393] = { 6, TD, SEN(pwritev2), "pwritev2" }, + #define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 400 */ - { 3, TN, sys_socket, "socket" }, /* 401 */ - { 3, TN, sys_bind, "bind" }, /* 402 */ - { 3, TN, sys_connect, "connect" }, /* 403 */ - { 2, TN, sys_listen, "listen" }, /* 404 */ - { 3, TN, sys_accept, "accept" }, /* 405 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 406 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 407 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 408 */ - { 4, TN, sys_send, "send" }, /* 409 */ - { 4, TN, sys_recv, "recv" }, /* 410 */ - { 6, TN, sys_sendto, "sendto" }, /* 411 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 412 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 413 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 414 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 415 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 416 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 417 */ - { 4, TN, sys_accept4, "accept4" }, /* 418 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 419 */ - -#if SYS_ipc_subcall != 420 - #error fix me -#endif - { 4, 0, printargs, "ipc_subcall" }, /* 420 */ diff --git a/linux/sh64/userent.h b/linux/sh64/userent.h new file mode 100644 index 00000000..e8810d29 --- /dev/null +++ b/linux/sh64/userent.h @@ -0,0 +1,154 @@ +{ 0, "PC(L)" }, +{ 4, "PC(U)" }, +{ 8, "SR(L)" }, +{ 12, "SR(U)" }, +{ 16, "syscall no.(L)" }, +{ 20, "syscall_no.(U)" }, +{ 24, "R0(L)" }, +{ 28, "R0(U)" }, +{ 32, "R1(L)" }, +{ 36, "R1(U)" }, +{ 40, "R2(L)" }, +{ 44, "R2(U)" }, +{ 48, "R3(L)" }, +{ 52, "R3(U)" }, +{ 56, "R4(L)" }, +{ 60, "R4(U)" }, +{ 64, "R5(L)" }, +{ 68, "R5(U)" }, +{ 72, "R6(L)" }, +{ 76, "R6(U)" }, +{ 80, "R7(L)" }, +{ 84, "R7(U)" }, +{ 88, "R8(L)" }, +{ 92, "R8(U)" }, +{ 96, "R9(L)" }, +{ 100, "R9(U)" }, +{ 104, "R10(L)" }, +{ 108, "R10(U)" }, +{ 112, "R11(L)" }, +{ 116, "R11(U)" }, +{ 120, "R12(L)" }, +{ 124, "R12(U)" }, +{ 128, "R13(L)" }, +{ 132, "R13(U)" }, +{ 136, "R14(L)" }, +{ 140, "R14(U)" }, +{ 144, "R15(L)" }, +{ 148, "R15(U)" }, +{ 152, "R16(L)" }, +{ 156, "R16(U)" }, +{ 160, "R17(L)" }, +{ 164, "R17(U)" }, +{ 168, "R18(L)" }, +{ 172, "R18(U)" }, +{ 176, "R19(L)" }, +{ 180, "R19(U)" }, +{ 184, "R20(L)" }, +{ 188, "R20(U)" }, +{ 192, "R21(L)" }, +{ 196, "R21(U)" }, +{ 200, "R22(L)" }, +{ 204, "R22(U)" }, +{ 208, "R23(L)" }, +{ 212, "R23(U)" }, +{ 216, "R24(L)" }, +{ 220, "R24(U)" }, +{ 224, "R25(L)" }, +{ 228, "R25(U)" }, +{ 232, "R26(L)" }, +{ 236, "R26(U)" }, +{ 240, "R27(L)" }, +{ 244, "R27(U)" }, +{ 248, "R28(L)" }, +{ 252, "R28(U)" }, +{ 256, "R29(L)" }, +{ 260, "R29(U)" }, +{ 264, "R30(L)" }, +{ 268, "R30(U)" }, +{ 272, "R31(L)" }, +{ 276, "R31(U)" }, +{ 280, "R32(L)" }, +{ 284, "R32(U)" }, +{ 288, "R33(L)" }, +{ 292, "R33(U)" }, +{ 296, "R34(L)" }, +{ 300, "R34(U)" }, +{ 304, "R35(L)" }, +{ 308, "R35(U)" }, +{ 312, "R36(L)" }, +{ 316, "R36(U)" }, +{ 320, "R37(L)" }, +{ 324, "R37(U)" }, +{ 328, "R38(L)" }, +{ 332, "R38(U)" }, +{ 336, "R39(L)" }, +{ 340, "R39(U)" }, +{ 344, "R40(L)" }, +{ 348, "R40(U)" }, +{ 352, "R41(L)" }, +{ 356, "R41(U)" }, +{ 360, "R42(L)" }, +{ 364, "R42(U)" }, +{ 368, "R43(L)" }, +{ 372, "R43(U)" }, +{ 376, "R44(L)" }, +{ 380, "R44(U)" }, +{ 384, "R45(L)" }, +{ 388, "R45(U)" }, +{ 392, "R46(L)" }, +{ 396, "R46(U)" }, +{ 400, "R47(L)" }, +{ 404, "R47(U)" }, +{ 408, "R48(L)" }, +{ 412, "R48(U)" }, +{ 416, "R49(L)" }, +{ 420, "R49(U)" }, +{ 424, "R50(L)" }, +{ 428, "R50(U)" }, +{ 432, "R51(L)" }, +{ 436, "R51(U)" }, +{ 440, "R52(L)" }, +{ 444, "R52(U)" }, +{ 448, "R53(L)" }, +{ 452, "R53(U)" }, +{ 456, "R54(L)" }, +{ 460, "R54(U)" }, +{ 464, "R55(L)" }, +{ 468, "R55(U)" }, +{ 472, "R56(L)" }, +{ 476, "R56(U)" }, +{ 480, "R57(L)" }, +{ 484, "R57(U)" }, +{ 488, "R58(L)" }, +{ 492, "R58(U)" }, +{ 496, "R59(L)" }, +{ 500, "R59(U)" }, +{ 504, "R60(L)" }, +{ 508, "R60(U)" }, +{ 512, "R61(L)" }, +{ 516, "R61(U)" }, +{ 520, "R62(L)" }, +{ 524, "R62(U)" }, +{ 528, "TR0(L)" }, +{ 532, "TR0(U)" }, +{ 536, "TR1(L)" }, +{ 540, "TR1(U)" }, +{ 544, "TR2(L)" }, +{ 548, "TR2(U)" }, +{ 552, "TR3(L)" }, +{ 556, "TR3(U)" }, +{ 560, "TR4(L)" }, +{ 564, "TR4(U)" }, +{ 568, "TR5(L)" }, +{ 572, "TR5(U)" }, +{ 576, "TR6(L)" }, +{ 580, "TR6(U)" }, +{ 584, "TR7(L)" }, +{ 588, "TR7(U)" }, +/* Other fields in "struct user" */ +/* This entry is in case pt_regs contains dregs (depends on +the kernel build options). */ +XLAT_UOFF(regs), +XLAT_UOFF(fpu), +#include "../sh/userent0.h" diff --git a/linux/sock_diag.h b/linux/sock_diag.h new file mode 100644 index 00000000..ba0c114f --- /dev/null +++ b/linux/sock_diag.h @@ -0,0 +1,11 @@ +#ifndef STRACE_LINUX_SOCK_DIAG_H +#define STRACE_LINUX_SOCK_DIAG_H + +#define SOCK_DIAG_BY_FAMILY 20 + +struct sock_diag_req { + uint8_t sdiag_family; + uint8_t sdiag_protocol; +}; + +#endif /* !STRACE_LINUX_SOCK_DIAG_H */ diff --git a/linux/sparc/arch_getrval2.c b/linux/sparc/arch_getrval2.c new file mode 100644 index 00000000..9079482c --- /dev/null +++ b/linux/sparc/arch_getrval2.c @@ -0,0 +1,5 @@ +long +getrval2(struct tcb *tcp) +{ + return sparc_regs.u_regs[U_REG_O1]; +} diff --git a/linux/sparc/arch_regs.c b/linux/sparc/arch_regs.c new file mode 100644 index 00000000..c0f22e6c --- /dev/null +++ b/linux/sparc/arch_regs.c @@ -0,0 +1,3 @@ +struct pt_regs sparc_regs; /* not static */ +#define ARCH_REGS_FOR_GETREGS sparc_regs +#define ARCH_PC_REG sparc_regs.pc diff --git a/linux/sparc/arch_regs.h b/linux/sparc/arch_regs.h new file mode 100644 index 00000000..ac11a1df --- /dev/null +++ b/linux/sparc/arch_regs.h @@ -0,0 +1,7 @@ +extern struct pt_regs sparc_regs; +/* Indexes into the pt_regs.u_reg[] array -- UREG_XX from kernel are all off + * by 1 and use Ix instead of Ox. These work for both 32 and 64 bit Linux. */ +#define U_REG_G1 0 +#define U_REG_O0 7 +#define U_REG_O1 8 +#define U_REG_FP 13 diff --git a/linux/sparc/arch_sigreturn.c b/linux/sparc/arch_sigreturn.c new file mode 100644 index 00000000..2170a7ba --- /dev/null +++ b/linux/sparc/arch_sigreturn.c @@ -0,0 +1,37 @@ +#ifndef SIZEOF_STRUCT_SPARC_STACKF +# define SIZEOF_STRUCT_SPARC_STACKF sizeof(struct sparc_stackf) +#endif +#ifndef SIZEOF_STRUCT_PT_REGS +# define SIZEOF_STRUCT_PT_REGS sizeof(struct pt_regs) +#endif +#ifndef PERSONALITY_WORDSIZE +# define PERSONALITY_WORDSIZE PERSONALITY0_WORDSIZE +#endif + +static void +arch_sigreturn(struct tcb *tcp) +{ + unsigned long addr = sparc_regs.u_regs[U_REG_FP] + + SIZEOF_STRUCT_SPARC_STACKF + SIZEOF_STRUCT_PT_REGS; + struct { + unsigned int mask; + char fpu_save[PERSONALITY_WORDSIZE]; + char insns[PERSONALITY_WORDSIZE * 2] ATTRIBUTE_ALIGNED(8); + unsigned int extramask[NSIG_BYTES / sizeof(int) - 1]; + } frame; + + if (umove(tcp, addr, &frame) < 0) { + tprintf("{mask=%#lx}", addr); + } else { + unsigned int mask[NSIG_BYTES / sizeof(int)]; + + mask[0] = frame.mask; + memcpy(mask + 1, frame.extramask, sizeof(frame.extramask)); + tprintsigmask_addr("{mask=", mask); + tprints("}"); + } +} + +#undef PERSONALITY_WORDSIZE +#undef SIZEOF_STRUCT_PT_REGS +#undef SIZEOF_STRUCT_SPARC_STACKF diff --git a/linux/sparc/dummy2.h b/linux/sparc/dummy2.h deleted file mode 100644 index 39552a27..00000000 --- a/linux/sparc/dummy2.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995 Rick Sladkey - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* still unfinished */ - -#define solaris_sysmp printargs -#define solaris_sginap printargs -#define solaris_sgikopt printargs -#define solaris_sysmips printargs -#define solaris_sigreturn printargs -#define solaris_recvmsg printargs -#define solaris_sendmsg printargs -#define solaris_nfssvc printargs -#define solaris_getfh printargs -#define solaris_async_daemon printargs -#define solaris_exportfs printargs -#define solaris_BSD_getime printargs -#define solaris_sproc printargs -#define solaris_procblk printargs -#define solaris_sprocsp printargs -#define solaris_msync printargs -#define solaris_madvise printargs -#define solaris_pagelock printargs -#define solaris_quotactl printargs -#define solaris_cacheflush printargs -#define solaris_cachectl printargs -#define solaris_nuname printargs -#define solaris_sigpoll printargs -#define solaris_swapctl printargs -#define solaris_sigstack printargs -#define solaris_sigsendset printargs -#define solaris_priocntl printargs -#define solaris_ksigqueue printargs -#define solaris_lwp_sema_wait printargs -#define solaris_memcntl printargs -#define solaris_syscall printargs -#define solaris_clocal printargs -#define solaris_syssun printargs -#define solaris_sysi86 printargs -#define solaris_sysmachine printargs -#define solaris_plock printargs -#define solaris_pathconf printargs -#define solaris_sigtimedwait printargs -#define solaris_ulimit printargs -#define solaris_ptrace printargs -#define solaris_stty printargs -#define solaris_lwp_info printargs -#define solaris_priocntlsys printargs -#define solaris_hrtsys printargs -#define solaris_xenix printargs -#define solaris_statfs printargs -#define solaris_fstatfs printargs -#define solaris_statvfs printargs -#define solaris_fstatvfs printargs -#define solaris_fork1 printargs -#define solaris_sigsendsys printargs -#define solaris_gtty printargs -#define solaris_vtrace printargs -#define solaris_fpathconf printargs -#define solaris_evsys printargs -#define solaris_acct printargs -#define solaris_exec printargs -#define solaris_lwp_sema_post printargs -#define solaris_nfssys printargs -#define solaris_sigaltstack printargs -#define solaris_uadmin printargs -#define solaris_umount printargs -#define solaris_modctl printargs -#define solaris_acancel printargs -#define solaris_async printargs -#define solaris_evtrapret printargs -#define solaris_lwp_create printargs -#define solaris_lwp_exit printargs -#define solaris_lwp_suspend printargs -#define solaris_lwp_continue printargs -#define solaris_lwp_kill printargs -#define solaris_lwp_self printargs -#define solaris_lwp_setprivate printargs -#define solaris_lwp_getprivate printargs -#define solaris_lwp_wait printargs -#define solaris_lwp_mutex_unlock printargs -#define solaris_lwp_mutex_lock printargs -#define solaris_lwp_cond_wait printargs -#define solaris_lwp_cond_signal printargs -#define solaris_lwp_cond_broadcast printargs -#define solaris_llseek printargs -#define solaris_inst_sync printargs -#define solaris_auditsys printargs -#define solaris_processor_bind printargs -#define solaris_processor_info printargs -#define solaris_p_online printargs -#define solaris_sigqueue printargs -#define solaris_clock_gettime printargs -#define solaris_clock_settime printargs -#define solaris_clock_getres printargs -#define solaris_nanosleep printargs -#define solaris_timer_create printargs -#define solaris_timer_delete printargs -#define solaris_timer_settime printargs -#define solaris_timer_gettime printargs -#define solaris_timer_getoverrun printargs -#define solaris_signal printargs -#define solaris_sigset printargs -#define solaris_sighold printargs -#define solaris_sigrelse printargs -#define solaris_sigignore printargs -#define solaris_sigpause printargs -#define solaris_msgctl printargs -#define solaris_msgget printargs -#define solaris_msgrcv printargs -#define solaris_msgsnd printargs -#define solaris_shmat printargs -#define solaris_shmctl printargs -#define solaris_shmdt printargs -#define solaris_shmget printargs -#define solaris_semctl printargs -#define solaris_semget printargs -#define solaris_semop printargs -#define solaris_olduname printargs -#define solaris_ustat printargs -#define solaris_fusers printargs -#define solaris_sysfs1 printargs -#define solaris_sysfs2 printargs -#define solaris_sysfs3 printargs - -/* like another call */ -#define solaris_lchown solaris_chown -#define solaris_setuid solaris_close -#define solaris_seteuid solaris_close -#define solaris_setgid solaris_close -#define solaris_setegid solaris_close -#define solaris_vhangup solaris_close -#define solaris_fdsync solaris_close -#define solaris_sigfillset solaris_sigpending -#define solaris_vfork solaris_fork -#define solaris_ksigaction solaris_sigaction -#define solaris_BSDgetpgrp solaris_getpgrp -#define solaris_BSDsetpgrp solaris_setpgrp -#define solaris_waitsys solaris_waitid - -/* printargs does the right thing */ -#define solaris_sync printargs -#define solaris_profil printargs -#define solaris_yield printargs -#define solaris_pause printargs -#define solaris_sethostid printargs - -/* subfunction entry points */ -#define solaris_pgrpsys printargs -#define solaris_sigcall printargs -#define solaris_msgsys printargs -#define solaris_shmsys printargs -#define solaris_semsys printargs -#define solaris_utssys printargs -#define solaris_sysfs printargs -#define solaris_spcall printargs -#define solaris_context printargs - -/* same as linux */ -#define solaris_exit sys_exit -#define solaris_fork sys_fork -#define solaris_read sys_read -#define solaris_write sys_write -#define solaris_close sys_close -#define solaris_creat sys_creat -#define solaris_link sys_link -#define solaris_unlink sys_unlink -#define solaris_chdir sys_chdir -#define solaris_time sys_time -#define solaris_chmod sys_chmod -#define solaris_lseek sys_lseek -#define solaris_stime sys_stime -#define solaris_alarm sys_alarm -#define solaris_utime sys_utime -#define solaris_access sys_access -#define solaris_nice sys_nice -#define solaris_dup sys_dup -#define solaris_pipe sys_pipe -#define solaris_times sys_times -#define solaris_execve sys_execve -#define solaris_umask sys_umask -#define solaris_chroot sys_chroot -#define solaris_rmdir sys_rmdir -#define solaris_mkdir sys_mkdir -#define solaris_getdents sys_getdents -#define solaris_poll sys_poll -#define solaris_symlink sys_symlink -#define solaris_readlink sys_readlink -#define solaris_setgroups sys_setgroups -#define solaris_getgroups sys_getgroups -#define solaris_fchmod sys_fchmod -#define solaris_fchown sys_fchown -#define solaris_mprotect sys_mprotect -#define solaris_munmap sys_munmap -#define solaris_readv sys_readv -#define solaris_writev sys_writev -#define solaris_chown sys_chown -#define solaris_rename sys_rename -#define solaris_gettimeofday sys_gettimeofday -#define solaris_getitimer sys_getitimer -#define solaris_setitimer sys_setitimer -#define solaris_brk sys_brk -#define solaris_mmap sys_mmap -#define solaris_getsid sys_getsid -#define solaris_setsid sys_setsid -#define solaris_getpgid sys_getpgid -#define solaris_setpgid sys_setpgid -#define solaris_getpgrp sys_getpgrp - -/* These are handled according to current_personality */ -#define solaris_xstat sys_xstat -#define solaris_fxstat sys_fxstat -#define solaris_lxstat sys_lxstat -#define solaris_xmknod sys_xmknod -#define solaris_stat sys_stat -#define solaris_fstat sys_fstat -#define solaris_lstat sys_lstat -#define solaris_pread sys_pread -#define solaris_pwrite sys_pwrite -#define solaris_ioctl sys_ioctl -#define solaris_mknod sys_mknod - -/* To be done */ -#define solaris_mount printargs -#define solaris_sysinfo printargs -#define solaris_sysconfig printargs -#define solaris_getpmsg printargs -#define solaris_putpmsg printargs -#define solaris_wait printargs -#define solaris_waitid printargs -#define solaris_sigsuspend printargs -#define solaris_setpgrp printargs -#define solaris_getcontext printargs -#define solaris_setcontext printargs -#define solaris_getpid printargs -#define solaris_getuid printargs -#define solaris_kill printargs -#define solaris_getgid printargs -#define solaris_fcntl printargs -#define solaris_getmsg printargs -#define solaris_putmsg printargs -#define solaris_sigprocmask printargs -#define solaris_sigaction printargs -#define solaris_sigpending printargs -#define solaris_mincore printargs -#define solaris_fchdir printargs -#define solaris_setrlimit printargs -#define solaris_getrlimit printargs -#define solaris_uname printargs -#define solaris_adjtime printargs -#define solaris_fchroot printargs -#define solaris_utimes printargs diff --git a/linux/sparc/errnoent.h b/linux/sparc/errnoent.h index d2436998..fe5ff07d 100644 --- a/linux/sparc/errnoent.h +++ b/linux/sparc/errnoent.h @@ -1,127 +1,151 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EAGAIN", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "EWOULDBLOCK", /* 35 */ - "EINPROGRESS", /* 36 */ - "EALREADY", /* 37 */ - "ENOTSOCK", /* 38 */ - "EDESTADDRREQ", /* 39 */ - "EMSGSIZE", /* 40 */ - "EPROTOTYPE", /* 41 */ - "ENOPROTOOPT", /* 42 */ - "EPROTONOSUPPORT", /* 43 */ - "ESOCKTNOSUPPORT", /* 44 */ - "EOPNOTSUPP", /* 45 */ - "EPFNOSUPPORT", /* 46 */ - "EAFNOSUPPORT", /* 47 */ - "EADDRINUSE", /* 48 */ - "EADDRNOTAVAIL", /* 49 */ - "ENETDOWN", /* 50 */ - "ENETUNREACH", /* 51 */ - "ENETRESET", /* 52 */ - "ECONNABORTED", /* 53 */ - "ECONNRESET", /* 54 */ - "ENOBUFS", /* 55 */ - "EISCONN", /* 56 */ - "ENOTCONN", /* 57 */ - "ESHUTDOWN", /* 58 */ - "ETOOMANYREFS", /* 59 */ - "ETIMEDOUT", /* 60 */ - "ECONNREFUSED", /* 61 */ - "ELOOP", /* 62 */ - "ENAMETOOLONG", /* 63 */ - "EHOSTDOWN", /* 64 */ - "EHOSTUNREACH", /* 65 */ - "ENOTEMPTY", /* 66 */ - "EPROCLIM", /* 67 */ - "EUSERS", /* 68 */ - "EDQUOT", /* 69 */ - "ESTALE", /* 70 */ - "EREMOTE", /* 71 */ - "ENOSTR", /* 72 */ - "ETIME", /* 73 */ - "ENOSR", /* 74 */ - "ENOMSG", /* 75 */ - "EBADMSG", /* 76 */ - "EIDRM", /* 77 */ - "EDEADLK", /* 78 */ - "ENOLCK", /* 79 */ - "ENONET", /* 80 */ - "ERREMOTE", /* 81 */ - "ENOLINK", /* 82 */ - "EADV", /* 83 */ - "ESRMNT", /* 84 */ - "ECOMM", /* 85 */ - "EPROTO", /* 86 */ - "EMULTIHOP", /* 87 */ - "EDOTDOT", /* 88 */ - "EREMCHG", /* 89 */ - "ENOSYS", /* 90 */ - "ESTRPIPE", /* 91 */ - "EOVERFLOW", /* 92 */ - "EBADFD", /* 93 */ - "ECHRNG", /* 94 */ - "EL2NSYNC", /* 95 */ - "EL3HLT", /* 96 */ - "EL3RST", /* 97 */ - "ELNRNG", /* 98 */ - "EUNATCH", /* 99 */ - "ENOCSI", /* 100 */ - "EL2HLT", /* 101 */ - "EBADE", /* 102 */ - "EBADR", /* 103 */ - "EXFULL", /* 104 */ - "ENOANO", /* 105 */ - "EBADRQC", /* 106 */ - "EBADSLT", /* 107 */ - "EDEADLOCK", /* 108 */ - "EBFONT", /* 109 */ - "ELIBEXEC", /* 110 */ - "ENODATA", /* 111 */ - "ELIBBAD", /* 112 */ - "ENOPKG", /* 113 */ - "ELIBACC", /* 114 */ - "ENOTUNIQ", /* 115 */ - "ERESTART", /* 116 */ - "EUCLEAN", /* 117 */ - "ENOTNAM", /* 118 */ - "ENAVAIL", /* 119 */ - "EISNAM", /* 120 */ - "EREMOTEIO", /* 121 */ - "EILSEQ", /* 122 */ - "ELIBMAX", /* 123 */ - "ELIBSCN", /* 124 */ - "ENOMEDIUM", /* 125 */ - "EMEDIUMTYPE", /* 126 */ +[ 1] = "EPERM", +[ 2] = "ENOENT", +[ 3] = "ESRCH", +[ 4] = "EINTR", +[ 5] = "EIO", +[ 6] = "ENXIO", +[ 7] = "E2BIG", +[ 8] = "ENOEXEC", +[ 9] = "EBADF", +[ 10] = "ECHILD", +[ 11] = "EAGAIN", +[ 12] = "ENOMEM", +[ 13] = "EACCES", +[ 14] = "EFAULT", +[ 15] = "ENOTBLK", +[ 16] = "EBUSY", +[ 17] = "EEXIST", +[ 18] = "EXDEV", +[ 19] = "ENODEV", +[ 20] = "ENOTDIR", +[ 21] = "EISDIR", +[ 22] = "EINVAL", +[ 23] = "ENFILE", +[ 24] = "EMFILE", +[ 25] = "ENOTTY", +[ 26] = "ETXTBSY", +[ 27] = "EFBIG", +[ 28] = "ENOSPC", +[ 29] = "ESPIPE", +[ 30] = "EROFS", +[ 31] = "EMLINK", +[ 32] = "EPIPE", +[ 33] = "EDOM", +[ 34] = "ERANGE", +[ 35] = "EWOULDBLOCK", +[ 36] = "EINPROGRESS", +[ 37] = "EALREADY", +[ 38] = "ENOTSOCK", +[ 39] = "EDESTADDRREQ", +[ 40] = "EMSGSIZE", +[ 41] = "EPROTOTYPE", +[ 42] = "ENOPROTOOPT", +[ 43] = "EPROTONOSUPPORT", +[ 44] = "ESOCKTNOSUPPORT", +[ 45] = "EOPNOTSUPP", +[ 46] = "EPFNOSUPPORT", +[ 47] = "EAFNOSUPPORT", +[ 48] = "EADDRINUSE", +[ 49] = "EADDRNOTAVAIL", +[ 50] = "ENETDOWN", +[ 51] = "ENETUNREACH", +[ 52] = "ENETRESET", +[ 53] = "ECONNABORTED", +[ 54] = "ECONNRESET", +[ 55] = "ENOBUFS", +[ 56] = "EISCONN", +[ 57] = "ENOTCONN", +[ 58] = "ESHUTDOWN", +[ 59] = "ETOOMANYREFS", +[ 60] = "ETIMEDOUT", +[ 61] = "ECONNREFUSED", +[ 62] = "ELOOP", +[ 63] = "ENAMETOOLONG", +[ 64] = "EHOSTDOWN", +[ 65] = "EHOSTUNREACH", +[ 66] = "ENOTEMPTY", +[ 67] = "EPROCLIM", +[ 68] = "EUSERS", +[ 69] = "EDQUOT", +[ 70] = "ESTALE", +[ 71] = "EREMOTE", +[ 72] = "ENOSTR", +[ 73] = "ETIME", +[ 74] = "ENOSR", +[ 75] = "ENOMSG", +[ 76] = "EBADMSG", +[ 77] = "EIDRM", +[ 78] = "EDEADLK", +[ 79] = "ENOLCK", +[ 80] = "ENONET", +[ 81] = "ERREMOTE", +[ 82] = "ENOLINK", +[ 83] = "EADV", +[ 84] = "ESRMNT", +[ 85] = "ECOMM", +[ 86] = "EPROTO", +[ 87] = "EMULTIHOP", +[ 88] = "EDOTDOT", +[ 89] = "EREMCHG", +[ 90] = "ENOSYS", +[ 91] = "ESTRPIPE", +[ 92] = "EOVERFLOW", +[ 93] = "EBADFD", +[ 94] = "ECHRNG", +[ 95] = "EL2NSYNC", +[ 96] = "EL3HLT", +[ 97] = "EL3RST", +[ 98] = "ELNRNG", +[ 99] = "EUNATCH", +[100] = "ENOCSI", +[101] = "EL2HLT", +[102] = "EBADE", +[103] = "EBADR", +[104] = "EXFULL", +[105] = "ENOANO", +[106] = "EBADRQC", +[107] = "EBADSLT", +[108] = "EDEADLOCK", +[109] = "EBFONT", +[110] = "ELIBEXEC", +[111] = "ENODATA", +[112] = "ELIBBAD", +[113] = "ENOPKG", +[114] = "ELIBACC", +[115] = "ENOTUNIQ", +[116] = "ERESTART", +[117] = "EUCLEAN", +[118] = "ENOTNAM", +[119] = "ENAVAIL", +[120] = "EISNAM", +[121] = "EREMOTEIO", +[122] = "EILSEQ", +[123] = "ELIBMAX", +[124] = "ELIBSCN", +[125] = "ENOMEDIUM", +[126] = "EMEDIUMTYPE", +[127] = "ECANCELED", +[128] = "ENOKEY", +[129] = "EKEYEXPIRED", +[130] = "EKEYREVOKED", +[131] = "EKEYREJECTED", +[132] = "EOWNERDEAD", +[133] = "ENOTRECOVERABLE", +[134] = "ERFKILL", +[135] = "EHWPOISON", +[512] = "ERESTARTSYS", +[513] = "ERESTARTNOINTR", +[514] = "ERESTARTNOHAND", +[515] = "ENOIOCTLCMD", +[516] = "ERESTART_RESTARTBLOCK", +[517] = "EPROBE_DEFER", +[518] = "EOPENSTALE", +[521] = "EBADHANDLE", +[522] = "ENOTSYNC", +[523] = "EBADCOOKIE", +[524] = "ENOTSUPP", +[525] = "ETOOSMALL", +[526] = "ESERVERFAULT", +[527] = "EBADTYPE", +[528] = "EJUKEBOX", +[529] = "EIOCBQUEUED", diff --git a/linux/sparc/errnoent1.h b/linux/sparc/errnoent1.h deleted file mode 100644 index 418e2db9..00000000 --- a/linux/sparc/errnoent1.h +++ /dev/null @@ -1,152 +0,0 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EAGAIN", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "ENOMSG", /* 35 */ - "EIDRM", /* 36 */ - "ECHRNG", /* 37 */ - "EL2NSYNC", /* 38 */ - "EL3HLT", /* 39 */ - "EL3RST", /* 40 */ - "ELNRNG", /* 41 */ - "EUNATCH", /* 42 */ - "ENOCSI", /* 43 */ - "EL2HLT", /* 44 */ - "EDEADLK", /* 45 */ - "ENOLCK", /* 46 */ - "ECANCELED", /* 47 */ - "ENOTSUP", /* 48 */ - "ERRNO_49", /* 49 */ - "EBADE", /* 50 */ - "EBADR", /* 51 */ - "EXFULL", /* 52 */ - "ENOANO", /* 53 */ - "EBADRQC", /* 54 */ - "EBADSLT", /* 55 */ - "EDEADLOCK", /* 56 */ - "EBFONT", /* 57 */ - "ERRNO_58", /* 58 */ - "ERRNO_59", /* 59 */ - "ENOSTR", /* 60 */ - "ENODATA", /* 61 */ - "ETIME", /* 62 */ - "ENOSR", /* 63 */ - "ENONET", /* 64 */ - "ENOPKG", /* 65 */ - "EREMOTE", /* 66 */ - "ENOLINK", /* 67 */ - "EADV", /* 68 */ - "ESRMNT", /* 69 */ - "ECOMM", /* 70 */ - "EPROTO", /* 71 */ - "ERRNO_72", /* 72 */ - "ERRNO_73", /* 73 */ - "EMULTIHOP", /* 74 */ - "ERRNO_75", /* 75 */ - "ERRNO_76", /* 76 */ - "EBADMSG", /* 77 */ - "ENAMETOOLONG", /* 78 */ - "EOVERFLOW", /* 79 */ - "ENOTUNIQ", /* 80 */ - "EBADFD", /* 81 */ - "EREMCHG", /* 82 */ - "ELIBACC", /* 83 */ - "ELIBBAD", /* 84 */ - "ELIBSCN", /* 85 */ - "ELIBMAX", /* 86 */ - "ELIBEXEC", /* 87 */ - "EILSEQ", /* 88 */ - "ENOSYS", /* 89 */ - "ELOOP", /* 90 */ - "ERESTART", /* 91 */ - "ESTRPIPE", /* 92 */ - "ENOTEMPTY", /* 93 */ - "EUSERS", /* 94 */ - "ENOTSOCK", /* 95 */ - "EDESTADDRREQ", /* 96 */ - "EMSGSIZE", /* 97 */ - "EPROTOTYPE", /* 98 */ - "ENOPROTOOPT", /* 99 */ - "ERRNO_100", /* 100 */ - "ERRNO_101", /* 101 */ - "ERRNO_102", /* 102 */ - "ERRNO_103", /* 103 */ - "ERRNO_104", /* 104 */ - "ERRNO_105", /* 105 */ - "ERRNO_106", /* 106 */ - "ERRNO_107", /* 107 */ - "ERRNO_108", /* 108 */ - "ERRNO_109", /* 109 */ - "ERRNO_110", /* 110 */ - "ERRNO_111", /* 111 */ - "ERRNO_112", /* 112 */ - "ERRNO_113", /* 113 */ - "ERRNO_114", /* 114 */ - "ERRNO_115", /* 115 */ - "ERRNO_116", /* 116 */ - "ERRNO_117", /* 117 */ - "ERRNO_118", /* 118 */ - "ERRNO_119", /* 119 */ - "EPROTONOSUPPORT", /* 120 */ - "ESOCKTNOSUPPORT", /* 121 */ - "EOPNOTSUPP", /* 122 */ - "EPFNOSUPPORT", /* 123 */ - "EAFNOSUPPORT", /* 124 */ - "EADDRINUSE", /* 125 */ - "EADDRNOTAVAIL", /* 126 */ - "ENETDOWN", /* 127 */ - "ENETUNREACH", /* 128 */ - "ENETRESET", /* 129 */ - "ECONNABORTED", /* 130 */ - "ECONNRESET", /* 131 */ - "ENOBUFS", /* 132 */ - "EISCONN", /* 133 */ - "ENOTCONN", /* 134 */ - "ERRNO_135", /* 135 */ - "ERRNO_136", /* 136 */ - "ERRNO_137", /* 137 */ - "ERRNO_138", /* 138 */ - "ERRNO_139", /* 139 */ - "ERRNO_140", /* 140 */ - "ERRNO_141", /* 141 */ - "ERRNO_142", /* 142 */ - "ESHUTDOWN", /* 143 */ - "ETOOMANYREFS", /* 144 */ - "ETIMEDOUT", /* 145 */ - "ECONNREFUSED", /* 146 */ - "EHOSTDOWN", /* 147 */ - "EHOSTUNREACH", /* 148 */ - "EALREADY", /* 149 */ - "EINPROGRESS", /* 150 */ - "ESTALE", /* 151 */ diff --git a/linux/sparc/get_error.c b/linux/sparc/get_error.c new file mode 100644 index 00000000..1b960ace --- /dev/null +++ b/linux/sparc/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (sparc_regs.psr & PSR_C) { + tcp->u_rval = -1; + tcp->u_error = sparc_regs.u_regs[U_REG_O0]; + } else { + tcp->u_rval = sparc_regs.u_regs[U_REG_O0]; + } +} diff --git a/linux/sparc/get_scno.c b/linux/sparc/get_scno.c new file mode 100644 index 00000000..f041259d --- /dev/null +++ b/linux/sparc/get_scno.c @@ -0,0 +1,7 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + tcp->scno = sparc_regs.u_regs[U_REG_G1]; + return 1; +} diff --git a/linux/sparc/get_syscall_args.c b/linux/sparc/get_syscall_args.c new file mode 100644 index 00000000..57b5488e --- /dev/null +++ b/linux/sparc/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = sparc_regs.u_regs[U_REG_O0 + 0]; + tcp->u_arg[1] = sparc_regs.u_regs[U_REG_O0 + 1]; + tcp->u_arg[2] = sparc_regs.u_regs[U_REG_O0 + 2]; + tcp->u_arg[3] = sparc_regs.u_regs[U_REG_O0 + 3]; + tcp->u_arg[4] = sparc_regs.u_regs[U_REG_O0 + 4]; + tcp->u_arg[5] = sparc_regs.u_regs[U_REG_O0 + 5]; + return 1; +} diff --git a/linux/sparc/ioctlent.h.in b/linux/sparc/ioctlent.h.in deleted file mode 100644 index 008aae09..00000000 --- a/linux/sparc/ioctlent.h.in +++ /dev/null @@ -1,120 +0,0 @@ - {"asm/apc.h", "APCIOCGFANCTL", 0x4100}, - {"asm/apc.h", "APCIOCSFANCTL", 0x4101}, - {"asm/apc.h", "APCIOCGCPWR", 0x4102}, - {"asm/apc.h", "APCIOCSCPWR", 0x4103}, - {"asm/apc.h", "APCIOCGBPORT", 0x4104}, - {"asm/apc.h", "APCIOCSBPORT", 0x4105}, - {"asm/fbio.h", "FBIOGTYPE", 0x4600}, - {"asm/fbio.h", "FBIOPUTCMAP", 0x4603}, - {"asm/fbio.h", "FBIOSATTR", 0x4605}, - {"asm/fbio.h", "FBIOGATTR", 0x4606}, - {"asm/fbio.h", "FBIOSVIDEO", 0x4607}, - {"asm/fbio.h", "FBIOGVIDEO", 0x4608}, - {"asm/fbio.h", "FBIOSCURSOR", 0x4618}, - {"asm/fbio.h", "FBIOGCURSOR", 0x4619}, - {"asm/fbio.h", "FBIOSCURPOS", 0x461a}, - {"asm/fbio.h", "FBIOGCURPOS", 0x461b}, - {"asm/fbio.h", "FBIOGCURMAX", 0x461c}, - {"asm/fbio.h", "FBIO_WID_ALLOC", 0x461e}, - {"asm/fbio.h", "FBIO_WID_FREE", 0x461f}, - {"asm/fbio.h", "FBIO_WID_PUT", 0x4620}, - {"asm/fbio.h", "FBIO_WID_GET", 0x4621}, - {"asm/fbio.h", "LEO_CLUTALLOC", 0x4c35}, - {"asm/fbio.h", "LEO_CLUTFREE", 0x4c36}, - {"asm/fbio.h", "LEO_CLUTREAD", 0x4c37}, - {"asm/fbio.h", "LEO_CLUTPOST", 0x4c38}, - {"asm/fbio.h", "LEO_SETGAMMA", 0x4c44}, - {"asm/fbio.h", "LEO_GETGAMMA", 0x4c45}, - {"asm/openpromio.h", "OPIOCGET", 0x4f01}, - {"asm/openpromio.h", "OPIOCSET", 0x4f02}, - {"asm/openpromio.h", "OPIOCNEXTPROP", 0x4f03}, - {"asm/openpromio.h", "OPIOCGETOPTNODE", 0x4f04}, - {"asm/openpromio.h", "OPIOCGETNEXT", 0x4f05}, - {"asm/openpromio.h", "OPIOCGETCHILD", 0x4f06}, - {"asm/ioctls.h", "TCGETA", 0x5401}, - {"asm/ioctls.h", "TCSETA", 0x5402}, - {"asm/ioctls.h", "TCSETAW", 0x5403}, - {"asm/ioctls.h", "TCSETAF", 0x5404}, - {"asm/ioctls.h", "TCSBRK", 0x5405}, - {"asm/ioctls.h", "TCXONC", 0x5406}, - {"asm/ioctls.h", "TCFLSH", 0x5407}, - {"asm/ioctls.h", "TCGETS", 0x5408}, - {"asm/ioctls.h", "TCSETS", 0x5409}, - {"asm/ioctls.h", "TCSETSW", 0x540a}, - {"asm/ioctls.h", "TCSETSF", 0x540b}, - {"asm/ioctls.h", "TCGETS2", 0x540c}, - {"asm/ioctls.h", "TCSETS2", 0x540d}, - {"asm/ioctls.h", "TCSETSW2", 0x540e}, - {"asm/ioctls.h", "TCSETSF2", 0x540f}, - {"asm/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm/ioctls.h", "TCSBRKP", 0x5425}, - {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm/watchdog.h", "WIOCSTART", 0x570a}, - {"asm/watchdog.h", "WIOCSTOP", 0x570b}, - {"asm/watchdog.h", "WIOCGSTAT", 0x570c}, - {"asm/ioctls.h", "FIOCLEX", 0x6601}, - {"asm/ioctls.h", "FIONCLEX", 0x6602}, - {"asm/ioctls.h", "FIOASYNC", 0x667d}, - {"asm/ioctls.h", "FIONBIO", 0x667e}, - {"asm/ioctls.h", "FIONREAD", 0x667f}, - {"asm/ioctls.h", "FIOQSIZE", 0x6680}, - {"asm/envctrl.h", "ENVCTRL_RD_CPU_TEMPERATURE", 0x7040}, - {"asm/envctrl.h", "ENVCTRL_RD_CPU_VOLTAGE", 0x7041}, - {"asm/envctrl.h", "ENVCTRL_RD_FAN_STATUS", 0x7042}, - {"asm/envctrl.h", "ENVCTRL_RD_WARNING_TEMPERATURE", 0x7043}, - {"asm/envctrl.h", "ENVCTRL_RD_SHUTDOWN_TEMPERATURE", 0x7044}, - {"asm/display7seg.h", "D7SIOCRD", 0x7045}, - {"asm/envctrl.h", "ENVCTRL_RD_VOLTAGE_STATUS", 0x7045}, - {"asm/display7seg.h", "D7SIOCWR", 0x7046}, - {"asm/envctrl.h", "ENVCTRL_RD_SCSI_TEMPERATURE", 0x7046}, - {"asm/display7seg.h", "D7SIOCTM", 0x7047}, - {"asm/envctrl.h", "ENVCTRL_RD_ETHERNET_TEMPERATURE", 0x7047}, - {"asm/envctrl.h", "ENVCTRL_RD_MTHRBD_TEMPERATURE", 0x7048}, - {"asm/envctrl.h", "ENVCTRL_RD_GLOBALADDRESS", 0x7049}, - {"asm/ioctls.h", "TIOCGETD", 0x7400}, - {"asm/ioctls.h", "TIOCSETD", 0x7401}, - {"asm/ioctls.h", "TIOCEXCL", 0x740d}, - {"asm/ioctls.h", "TIOCNXCL", 0x740e}, - {"asm/ioctls.h", "TIOCCONS", 0x7424}, - {"asm/ioctls.h", "TIOCGSOFTCAR", 0x7464}, - {"asm/ioctls.h", "TIOCSSOFTCAR", 0x7465}, - {"asm/ioctls.h", "TIOCSWINSZ", 0x7467}, - {"asm/ioctls.h", "TIOCGWINSZ", 0x7468}, - {"asm/ioctls.h", "TIOCMGET", 0x746a}, - {"asm/ioctls.h", "TIOCMBIC", 0x746b}, - {"asm/ioctls.h", "TIOCMBIS", 0x746c}, - {"asm/ioctls.h", "TIOCMSET", 0x746d}, - {"asm/ioctls.h", "TIOCSTART", 0x746e}, - {"asm/ioctls.h", "TIOCSTOP", 0x746f}, - {"asm/ioctls.h", "TIOCPKT", 0x7470}, - {"asm/ioctls.h", "TIOCNOTTY", 0x7471}, - {"asm/ioctls.h", "TIOCSTI", 0x7472}, - {"asm/ioctls.h", "TIOCOUTQ", 0x7473}, - {"asm/ioctls.h", "TIOCCBRK", 0x747a}, - {"asm/ioctls.h", "TIOCSBRK", 0x747b}, - {"asm/ioctls.h", "TIOCSPGRP", 0x7482}, - {"asm/ioctls.h", "TIOCGPGRP", 0x7483}, - {"asm/ioctls.h", "TIOCSCTTY", 0x7484}, - {"asm/ioctls.h", "TIOCGSID", 0x7485}, - {"asm/ioctls.h", "TIOCGPTN", 0x7486}, - {"asm/ioctls.h", "TIOCSPTLCK", 0x7487}, - {"asm/ioctls.h", "TIOCSIG", 0x7488}, - {"asm/sockios.h", "FIOSETOWN", 0x8901}, - {"asm/sockios.h", "SIOCSPGRP", 0x8902}, - {"asm/sockios.h", "FIOGETOWN", 0x8903}, - {"asm/sockios.h", "SIOCGPGRP", 0x8904}, - {"asm/sockios.h", "SIOCATMARK", 0x8905}, - {"asm/sockios.h", "SIOCGSTAMP", 0x8906}, - {"asm/sockios.h", "SIOCGSTAMPNS", 0x8907}, diff --git a/linux/sparc/ioctlent1.h b/linux/sparc/ioctlent1.h deleted file mode 100644 index 7119c870..00000000 --- a/linux/sparc/ioctlent1.h +++ /dev/null @@ -1,429 +0,0 @@ -{"sys/dkio.h", "DKIOCGGEOM", 0x401}, -{"sys/dkio.h", "DKIOCSGEOM", 0x402}, -{"sys/dkio.h", "DKIOCINFO", 0x403}, -{"sys/dkio.h", "DKIOCSAPART", 0x404}, -{"sys/dkio.h", "DKIOCGAPART", 0x405}, -{"sys/dkio.h", "DKIOCEJECT", 0x406}, -{"sys/dkio.h", "DKIOCLOCK", 0x407}, -{"sys/dkio.h", "DKIOCUNLOCK", 0x408}, -{"sys/dkio.h", "DKIOCGVTOC", 0x40b}, -{"sys/dkio.h", "DKIOCSVTOC", 0x40c}, -{"sys/dkio.h", "DKIOCSTATE", 0x40d}, -{"sys/fdio.h", "FDIOGCHAR", 0x433}, -{"sys/fdio.h", "FDIOSCHAR", 0x434}, -{"sys/fdio.h", "FDEJECT", 0x435}, -{"sys/fdio.h", "FDGETCHANGE", 0x436}, -{"sys/fdio.h", "FDGETDRIVECHAR", 0x437}, -{"sys/fdio.h", "FDSETDRIVECHAR", 0x438}, -{"sys/fdio.h", "FDGETSEARCH", 0x439}, -{"sys/fdio.h", "FDSETSEARCH", 0x43a}, -{"sys/fdio.h", "FDIOCMD", 0x43b}, -{"sys/fdio.h", "FDRAW", 0x446}, -{"sys/fdio.h", "FDDEFGEOCHAR", 0x456}, -{"sys/hdio.h", "HDKIOCSTYPE", 0x465}, -{"sys/hdio.h", "HDKIOCGTYPE", 0x466}, -{"sys/hdio.h", "HDKIOCSBAD", 0x467}, -{"sys/hdio.h", "HDKIOCGBAD", 0x468}, -{"sys/hdio.h", "HDKIOCSCMD", 0x469}, -{"sys/hdio.h", "HDKIOCGDIAG", 0x46a}, -{"sys/cdio.h", "CDROMPAUSE", 0x497}, -{"sys/cdio.h", "CDROMRESUME", 0x498}, -{"sys/cdio.h", "CDROMPLAYMSF", 0x499}, -{"sys/cdio.h", "CDROMPLAYTRKIND", 0x49a}, -{"sys/cdio.h", "CDROMREADTOCHDR", 0x49b}, -{"sys/cdio.h", "CDROMREADTOCENTRY", 0x49c}, -{"sys/cdio.h", "CDROMSTOP", 0x49d}, -{"sys/cdio.h", "CDROMSTART", 0x49e}, -{"sys/cdio.h", "CDROMEJECT", 0x49f}, -{"sys/cdio.h", "CDROMVOLCTRL", 0x4a0}, -{"sys/cdio.h", "CDROMSUBCHNL", 0x4a1}, -{"sys/cdio.h", "CDROMREADMODE2", 0x4a2}, -{"sys/cdio.h", "CDROMREADMODE1", 0x4a3}, -{"sys/cdio.h", "CDROMREADOFFSET", 0x4a4}, -{"sys/cdio.h", "CDROMGBLKMODE", 0x4a5}, -{"sys/cdio.h", "CDROMSBLKMODE", 0x4a6}, -{"sys/cdio.h", "CDROMCDDA", 0x4a7}, -{"sys/cdio.h", "CDROMCDXA", 0x4a8}, -{"sys/cdio.h", "CDROMSUBCODE", 0x4a9}, -{"sys/cdio.h", "CDROMGDRVSPEED", 0x4aa}, -{"sys/cdio.h", "CDROMSDRVSPEED", 0x4ab}, -{"sys/scsi/impl/uscsi.h", "USCSICMD", 0x4c9}, -{"sys/bufmod.h", "SBIOCSTIME", 0x4201}, -{"sys/bufmod.h", "SBIOCGTIME", 0x4202}, -{"sys/bufmod.h", "SBIOCCTIME", 0x4203}, -{"sys/bufmod.h", "SBIOCSCHUNK", 0x4204}, -{"sys/bufmod.h", "SBIOCGCHUNK", 0x4205}, -{"sys/bufmod.h", "SBIOCSSNAP", 0x4206}, -{"sys/bufmod.h", "SBIOCGSNAP", 0x4207}, -{"sys/bufmod.h", "SBIOCSFLAGS", 0x4208}, -{"sys/bufmod.h", "SBIOCGFLAGS", 0x4209}, -{"sys/termios.h", "LDOPEN", 0x4400}, -{"sys/termios.h", "LDCLOSE", 0x4401}, -{"sys/dlpi.h", "DLIOCRAW", 0x4401}, -{"sys/sad.h", "SAD_SAP", 0x4401}, -{"sys/termios.h", "LDCHG", 0x4402}, -{"sys/sad.h", "SAD_GAP", 0x4402}, -{"sys/sad.h", "SAD_VML", 0x4403}, -{"sys/termios.h", "LDGETT", 0x4408}, -{"sys/termios.h", "LDSETT", 0x4409}, -{"sys/dlpi.h", "DL_IOC_HDR_INFO", 0x440a}, -{"sys/termios.h", "LDSMAP", 0x446e}, -{"sys/termios.h", "LDGMAP", 0x446f}, -{"sys/termios.h", "LDNMAP", 0x4470}, -{"sys/termios.h", "LDEMAP", 0x4471}, -{"sys/termios.h", "LDDMAP", 0x4472}, -{"sys/fbio.h", "FBIOGTYPE", 0x4600}, -{"sys/fbio.h", "FBIOGINFO", 0x4602}, -{"sys/fbio.h", "FBIOPUTCMAP", 0x4603}, -{"sys/fbio.h", "FBIOGETCMAP", 0x4604}, -{"sys/fbio.h", "FBIOSATTR", 0x4605}, -{"sys/fbio.h", "FBIOGATTR", 0x4606}, -{"sys/fbio.h", "FBIOSVIDEO", 0x4607}, -{"sys/fbio.h", "FBIOGVIDEO", 0x4608}, -{"sys/fbio.h", "FBIOVERTICAL", 0x4609}, -{"sys/fbio.h", "GRABPAGEALLOC", 0x460a}, -{"sys/fbio.h", "GRABPAGEFREE", 0x460b}, -{"sys/fbio.h", "GRABATTACH", 0x460c}, -{"sys/fbio.h", "FBIOGPLNGRP", 0x460d}, -{"sys/fbio.h", "FBIOGCMSIZE", 0x460e}, -{"sys/fbio.h", "FBIOSCMSIZE", 0x460f}, -{"sys/fbio.h", "FBIOSCMS", 0x4610}, -{"sys/fbio.h", "FBIOAVAILPLNGRP", 0x4611}, -{"sys/fbio.h", "FBIODBLGINFO", 0x4612}, -{"sys/fbio.h", "FBIODBLSINFO", 0x4613}, -{"sys/fbio.h", "FBIOSWINFD", 0x4614}, -{"sys/fbio.h", "FBIOSAVWINFD", 0x4615}, -{"sys/fbio.h", "FBIORESWINFD", 0x4616}, -{"sys/fbio.h", "FBIOSRWINFD", 0x4617}, -{"sys/visual_io.h", "VIS_SETCURSOR", 0x4618}, -{"sys/fbio.h", "FBIOSCURSOR", 0x4618}, -{"sys/fbio.h", "FBIOGCURSOR", 0x4619}, -{"sys/visual_io.h", "VIS_GETCURSOR", 0x4619}, -{"sys/fbio.h", "FBIOSCURPOS", 0x461a}, -{"sys/visual_io.h", "VIS_MOVECURSOR", 0x461a}, -{"sys/fbio.h", "FBIOGCURPOS", 0x461b}, -{"sys/visual_io.h", "VIS_GETCURSORPOS", 0x461b}, -{"sys/fbio.h", "FBIOGCURMAX", 0x461c}, -{"sys/fbio.h", "GRABLOCKINFO", 0x461d}, -{"sys/fbio.h", "FBIO_WID_ALLOC", 0x461e}, -{"sys/fbio.h", "FBIO_WID_FREE", 0x461f}, -{"sys/fbio.h", "FBIO_WID_PUT", 0x4620}, -{"sys/fbio.h", "FBIO_WID_GET", 0x4621}, -{"sys/fbio.h", "FBIO_DEVID", 0x4622}, -{"sys/fbio.h", "FBIO_U_RST", 0x4623}, -{"sys/fbio.h", "FBIO_FULLSCREEN_ELIMINATION_GROUPS", 0x4624}, -{"sys/fbio.h", "FBIO_WID_DBL_SET", 0x4625}, -{"sys/fbio.h", "FBIOVRTOFFSET", 0x4626}, -{"sys/fbio.h", "FBIOGXINFO", 0x4627}, -{"sys/fbio.h", "FBIOMONINFO", 0x4628}, -{"sys/fbio.h", "FBIOPUTCMAPI", 0x4629}, -{"sys/fbio.h", "FBIOGETCMAPI", 0x462a}, -{"sys/fbio.h", "FBIO_ASSIGNWID", 0x462b}, -{"sys/fbio.h", "FBIO_STEREO", 0x462c}, -{"sys/gpio.h", "GP1IO_PUT_INFO", 0x4700}, -{"sys/gpio.h", "GP1IO_GET_STATIC_BLOCK", 0x4701}, -{"sys/gpio.h", "GP1IO_FREE_STATIC_BLOCK", 0x4702}, -{"sys/gpio.h", "GP1IO_GET_GBUFFER_STATE", 0x4703}, -{"sys/gpio.h", "GP1IO_CHK_GP", 0x4704}, -{"sys/gpio.h", "GP1IO_GET_RESTART_COUNT", 0x4705}, -{"sys/gpio.h", "GP1IO_REDIRECT_DEVFB", 0x4706}, -{"sys/gpio.h", "GP1IO_GET_REQDEV", 0x4707}, -{"sys/gpio.h", "GP1IO_GET_TRUMINORDEV", 0x4708}, -{"sys/gpio.h", "GP1IO_CHK_FOR_GBUFFER", 0x4709}, -{"sys/gpio.h", "GP1IO_SET_USING_GBUFFER", 0x470a}, -{"sys/gpio.h", "GP1IO_INFO_STATIC_BLOCK", 0x470b}, -{"sys/sockmod.h", "O_SI_GETUDATA", 0x4965}, -{"sys/sockmod.h", "SI_SHUTDOWN", 0x4966}, -{"sys/sockmod.h", "SI_LISTEN", 0x4967}, -{"sys/sockmod.h", "SI_SETMYNAME", 0x4968}, -{"sys/sockmod.h", "SI_SETPEERNAME", 0x4969}, -{"sys/sockmod.h", "SI_GETINTRANSIT", 0x496a}, -{"sys/sockmod.h", "SI_SOCKPARAMS", 0x496d}, -{"sys/sockmod.h", "SI_GETUDATA", 0x496e}, -{"sys/strlog.h", "I_TRCLOG", 0x4c01}, -{"sys/strlog.h", "I_ERRLOG", 0x4c02}, -{"sys/strlog.h", "I_CONSLOG", 0x4c03}, -{"sys/cg14io.h", "MDI_RESET", 0x4d01}, -{"sys/cg14io.h", "MDI_GET_CFGINFO", 0x4d02}, -{"sys/cg14io.h", "MDI_SET_PIXELMODE", 0x4d03}, -{"sys/cg14io.h", "MDI_SET_COUNTERS", 0x4d04}, -{"sys/cg14io.h", "MDI_SET_PPR", 0x4d05}, -{"sys/cg14io.h", "MDI_VRT_CNTL", 0x4d06}, -{"sys/cg14io.h", "MDI_SET_CLUT", 0x4d07}, -{"sys/cg14io.h", "MDI_GET_CLUT", 0x4d08}, -{"sys/cg14io.h", "MDI_SET_XLUT", 0x4d09}, -{"sys/cg14io.h", "MDI_GET_XLUT", 0x4d0a}, -{"sys/cg14io.h", "MDI_GAMMA_CORRECT", 0x4d0b}, -{"sys/cg14io.h", "MDI_SET_GAMMALUT", 0x4d0c}, -{"sys/cg14io.h", "MDI_GET_GAMMALUT", 0x4d0d}, -{"sys/cg14io.h", "MDI_SET_DEGAMMALUT", 0x4d0e}, -{"sys/cg14io.h", "MDI_GET_DEGAMMALUT", 0x4d0f}, -{"sys/cg14io.h", "MDI_GET_BUFFER_INFO", 0x4d10}, -{"sys/cg14io.h", "MDI_SET_CURSOR", 0x4d11}, -{"sys/cg14io.h", "MDI_GET_DIAGINFO", 0x4d12}, -{"sys/cg14io.h", "MDI_SET_RESOLUTION", 0x4d13}, -{"sys/cg14io.h", "SET_MONITOR_POWER", 0x4d14}, -{"sys/openpromio.h", "OPROMGETBOOTARGS", 0x4f0c}, -{"sys/pfmod.h", "PFIOCSETF", 0x5001}, -{"sys/stropts.h", "I_NREAD", 0x5301}, -{"sys/stropts.h", "I_PUSH", 0x5302}, -{"sys/stropts.h", "I_POP", 0x5303}, -{"sys/stropts.h", "I_LOOK", 0x5304}, -{"sys/stropts.h", "I_FLUSH", 0x5305}, -{"sys/stropts.h", "I_SRDOPT", 0x5306}, -{"sys/stropts.h", "I_GRDOPT", 0x5307}, -{"sys/stropts.h", "I_STR", 0x5308}, -{"sys/stropts.h", "I_SETSIG", 0x5309}, -{"sys/stropts.h", "I_GETSIG", 0x530a}, -{"sys/stropts.h", "I_FIND", 0x530b}, -{"sys/stropts.h", "I_LINK", 0x530c}, -{"sys/stropts.h", "I_UNLINK", 0x530d}, -{"sys/stropts.h", "I_RECVFD", 0x530e}, -{"sys/stropts.h", "I_PEEK", 0x530f}, -{"sys/stropts.h", "I_FDINSERT", 0x5310}, -{"sys/stropts.h", "I_SENDFD", 0x5311}, -{"sys/stropts.h", "I_SWROPT", 0x5313}, -{"sys/stropts.h", "I_GWROPT", 0x5314}, -{"sys/stropts.h", "I_LIST", 0x5315}, -{"sys/stropts.h", "I_PLINK", 0x5316}, -{"sys/stropts.h", "I_PUNLINK", 0x5317}, -{"sys/stropts.h", "I_SETEV", 0x5318}, -{"sys/stropts.h", "I_GETEV", 0x5319}, -{"sys/stropts.h", "I_STREV", 0x531a}, -{"sys/stropts.h", "I_UNSTREV", 0x531b}, -{"sys/stropts.h", "I_FLUSHBAND", 0x531c}, -{"sys/stropts.h", "I_CKBAND", 0x531d}, -{"sys/stropts.h", "I_GETBAND", 0x531e}, -{"sys/stropts.h", "I_ATMARK", 0x531f}, -{"sys/stropts.h", "I_SETCLTIME", 0x5320}, -{"sys/stropts.h", "I_GETCLTIME", 0x5321}, -{"sys/stropts.h", "I_CANPUT", 0x5322}, -{"sys/termios.h", "TCGETA", 0x5401}, -{"sys/termios.h", "TCSETA", 0x5402}, -{"sys/termios.h", "TCSETAW", 0x5403}, -{"sys/termios.h", "TCSETAF", 0x5404}, -{"sys/termios.h", "TCSBRK", 0x5405}, -{"sys/termios.h", "TCXONC", 0x5406}, -{"sys/termios.h", "TCFLSH", 0x5407}, -{"sys/termios.h", "TIOCKBON", 0x5408}, -{"sys/termios.h", "TIOCKBOF", 0x5409}, -{"sys/termios.h", "KBENABLED", 0x540a}, -{"sys/termios.h", "TCGETS", 0x540d}, -{"sys/termios.h", "TCSETS", 0x540e}, -{"sys/termios.h", "TCSANOW", 0x540e}, -{"sys/termios.h", "TCSADRAIN", 0x540f}, -{"sys/termios.h", "TCSETSW", 0x540f}, -{"sys/termios.h", "TCSAFLUSH", 0x5410}, -{"sys/termios.h", "TCSETSF", 0x5410}, -{"sys/termio.h", "TCDSET", 0x5420}, -{"sys/termios.h", "TCDSET", 0x5420}, -{"sys/termios.h", "RTS_TOG", 0x5421}, -{"sys/ttold.h", "TIOCSWINSZ", 0x5467}, -{"sys/termios.h", "TIOCSWINSZ", 0x5467}, -{"sys/ttold.h", "TIOCGWINSZ", 0x5468}, -{"sys/termios.h", "TIOCGWINSZ", 0x5468}, -{"sys/termios.h", "TIOCGSOFTCAR", 0x5469}, -{"sys/termios.h", "TIOCSSOFTCAR", 0x546a}, -{"sys/timod.h", "TI_GETINFO", 0x548c}, -{"sys/timod.h", "TI_OPTMGMT", 0x548d}, -{"sys/timod.h", "TI_BIND", 0x548e}, -{"sys/timod.h", "TI_UNBIND", 0x548f}, -{"sys/timod.h", "TI_GETMYNAME", 0x5490}, -{"sys/timod.h", "TI_GETPEERNAME", 0x5491}, -{"sys/timod.h", "TI_SETMYNAME", 0x5492}, -{"sys/timod.h", "TI_SETPEERNAME", 0x5493}, -{"sys/termiox.h", "TCGETX", 0x5801}, -{"sys/termiox.h", "TCSETX", 0x5802}, -{"sys/termiox.h", "TCSETXW", 0x5803}, -{"sys/termiox.h", "TCSETXF", 0x5804}, -{"sys/ioctl.h", "DIOCGETC", 0x6401}, -{"sys/ioctl.h", "DIOCGETB", 0x6402}, -{"sys/ioctl.h", "DIOCSETE", 0x6403}, -{"sys/termios.h", "DIOCGETP", 0x6408}, -{"sys/termios.h", "DIOCSETP", 0x6409}, -{"sys/jioctl.h", "JBOOT", 0x6a01}, -{"sys/jioctl.h", "JTERM", 0x6a02}, -{"sys/jioctl.h", "JMPX", 0x6a03}, -{"sys/jioctl.h", "JWINSIZE", 0x6a05}, -{"sys/jioctl.h", "JZOMBOOT", 0x6a07}, -{"sys/jioctl.h", "JAGENT", 0x6a09}, -{"sys/jioctl.h", "JTRUN", 0x6a0a}, -{"sys/jioctl.h", "JXTPROTO", 0x6a0b}, -{"sys/kbio.h", "KIOCTRANS", 0x6b00}, -{"sys/kbio.h", "KIOCSETKEY", 0x6b01}, -{"sys/kbio.h", "KIOCGETKEY", 0x6b02}, -{"sys/kbio.h", "KIOCGTRANS", 0x6b05}, -{"sys/kbio.h", "KIOCTRANSABLE", 0x6b06}, -{"sys/kbio.h", "KIOCGTRANSABLE", 0x6b07}, -{"sys/kbio.h", "KIOCCMD", 0x6b08}, -{"sys/kbio.h", "KIOCTYPE", 0x6b09}, -{"sys/kbio.h", "KIOCSDIRECT", 0x6b0a}, -{"sys/kbio.h", "KIOCGDIRECT", 0x6b0b}, -{"sys/kbio.h", "KIOCSKEY", 0x6b0c}, -{"sys/kbio.h", "KIOCGKEY", 0x6b0d}, -{"sys/kbio.h", "KIOCSLED", 0x6b0e}, -{"sys/kbio.h", "KIOCGLED", 0x6b0f}, -{"sys/kbio.h", "KIOCSCOMPAT", 0x6b10}, -{"sys/kbio.h", "KIOCGCOMPAT", 0x6b11}, -{"sys/kbio.h", "KIOCLAYOUT", 0x6b14}, -{"sys/ioctl.h", "LIOCGETP", 0x6c01}, -{"sys/ioctl.h", "LIOCSETP", 0x6c02}, -{"sys/ioctl.h", "LIOCGETS", 0x6c05}, -{"sys/ioctl.h", "LIOCSETS", 0x6c06}, -{"sys/mtio.h", "MTIOCTOP", 0x6d01}, -{"sys/msio.h", "MSIOGETPARMS", 0x6d01}, -{"sys/msio.h", "MSIOSETPARMS", 0x6d02}, -{"sys/mtio.h", "MTIOCGET", 0x6d02}, -{"sys/mtio.h", "MTIOCGETDRIVETYPE", 0x6d03}, -{"sys/procfs.h", "PIOCSTATUS", 0x7101}, -{"sys/procfs.h", "PIOCSTOP", 0x7102}, -{"sys/procfs.h", "PIOCWSTOP", 0x7103}, -{"sys/procfs.h", "PIOCRUN", 0x7104}, -{"sys/procfs.h", "PIOCGTRACE", 0x7105}, -{"sys/procfs.h", "PIOCSTRACE", 0x7106}, -{"sys/procfs.h", "PIOCSSIG", 0x7107}, -{"sys/procfs.h", "PIOCKILL", 0x7108}, -{"sys/procfs.h", "PIOCUNKILL", 0x7109}, -{"sys/procfs.h", "PIOCGHOLD", 0x710a}, -{"sys/procfs.h", "PIOCSHOLD", 0x710b}, -{"sys/procfs.h", "PIOCMAXSIG", 0x710c}, -{"sys/procfs.h", "PIOCACTION", 0x710d}, -{"sys/procfs.h", "PIOCGFAULT", 0x710e}, -{"sys/procfs.h", "PIOCSFAULT", 0x710f}, -{"sys/procfs.h", "PIOCCFAULT", 0x7110}, -{"sys/procfs.h", "PIOCGENTRY", 0x7111}, -{"sys/procfs.h", "PIOCSENTRY", 0x7112}, -{"sys/procfs.h", "PIOCGEXIT", 0x7113}, -{"sys/procfs.h", "PIOCSEXIT", 0x7114}, -{"sys/procfs.h", "PIOCSFORK", 0x7115}, -{"sys/procfs.h", "PIOCRFORK", 0x7116}, -{"sys/procfs.h", "PIOCSRLC", 0x7117}, -{"sys/procfs.h", "PIOCRRLC", 0x7118}, -{"sys/procfs.h", "PIOCGREG", 0x7119}, -{"sys/procfs.h", "PIOCSREG", 0x711a}, -{"sys/procfs.h", "PIOCGFPREG", 0x711b}, -{"sys/procfs.h", "PIOCSFPREG", 0x711c}, -{"sys/procfs.h", "PIOCNICE", 0x711d}, -{"sys/procfs.h", "PIOCPSINFO", 0x711e}, -{"sys/procfs.h", "PIOCNMAP", 0x711f}, -{"sys/procfs.h", "PIOCMAP", 0x7120}, -{"sys/procfs.h", "PIOCOPENM", 0x7121}, -{"sys/procfs.h", "PIOCCRED", 0x7122}, -{"sys/procfs.h", "PIOCGROUPS", 0x7123}, -{"sys/procfs.h", "PIOCGETPR", 0x7124}, -{"sys/procfs.h", "PIOCGETU", 0x7125}, -{"sys/procfs.h", "PIOCSET", 0x7126}, -{"sys/procfs.h", "PIOCRESET", 0x7127}, -{"sys/procfs.h", "PIOCNWATCH", 0x7128}, -{"sys/procfs.h", "PIOCGWATCH", 0x7129}, -{"sys/procfs.h", "PIOCSWATCH", 0x712a}, -{"sys/procfs.h", "PIOCUSAGE", 0x712b}, -{"sys/procfs.h", "PIOCOPENPD", 0x712c}, -{"sys/procfs.h", "PIOCLWPIDS", 0x712d}, -{"sys/procfs.h", "PIOCOPENLWP", 0x712e}, -{"sys/procfs.h", "PIOCLSTATUS", 0x712f}, -{"sys/procfs.h", "PIOCLUSAGE", 0x7130}, -{"sys/procfs.h", "PIOCNAUXV", 0x7131}, -{"sys/procfs.h", "PIOCAUXV", 0x7132}, -{"sys/procfs.h", "PIOCGWIN", 0x7165}, -{"sys/ttold.h", "TIOCGETD", 0x7400}, -{"sys/termios.h", "TIOCGETD", 0x7400}, -{"sys/termios.h", "TIOCSETD", 0x7401}, -{"sys/ttold.h", "TIOCSETD", 0x7401}, -{"sys/termios.h", "TIOCHPCL", 0x7402}, -{"sys/ttold.h", "TIOCHPCL", 0x7402}, -{"sys/ttold.h", "TIOCGETP", 0x7408}, -{"sys/termios.h", "TIOCGETP", 0x7408}, -{"sys/termios.h", "TIOCSETP", 0x7409}, -{"sys/ttold.h", "TIOCSETP", 0x7409}, -{"sys/ttold.h", "TIOCSETN", 0x740a}, -{"sys/termios.h", "TIOCSETN", 0x740a}, -{"sys/ttold.h", "TIOCEXCL", 0x740d}, -{"sys/termios.h", "TIOCEXCL", 0x740d}, -{"sys/ttold.h", "TIOCNXCL", 0x740e}, -{"sys/termios.h", "TIOCNXCL", 0x740e}, -{"sys/termios.h", "TIOCFLUSH", 0x7410}, -{"sys/ttold.h", "TIOCFLUSH", 0x7410}, -{"sys/termios.h", "TIOCSETC", 0x7411}, -{"sys/ttold.h", "TIOCSETC", 0x7411}, -{"sys/termios.h", "TIOCGETC", 0x7412}, -{"sys/ttold.h", "TIOCGETC", 0x7412}, -{"sys/termios.h", "TIOCGPGRP", 0x7414}, -{"sys/termios.h", "TIOCSPGRP", 0x7415}, -{"sys/termios.h", "TIOCGSID", 0x7416}, -{"sys/termios.h", "TIOCSTI", 0x7417}, -{"sys/termios.h", "TIOCSSID", 0x7418}, -{"sys/termios.h", "TIOCMSET", 0x741a}, -{"sys/termios.h", "TIOCMBIS", 0x741b}, -{"sys/termios.h", "TIOCMBIC", 0x741c}, -{"sys/termios.h", "TIOCMGET", 0x741d}, -{"sys/termios.h", "TIOCREMOTE", 0x741e}, -{"sys/ttold.h", "TIOCREMOTE", 0x741e}, -{"sys/termios.h", "TIOCSIGNAL", 0x741f}, -{"sys/termios.h", "TIOCSTART", 0x746e}, -{"sys/ttold.h", "TIOCSTART", 0x746e}, -{"sys/termios.h", "TIOCSTOP", 0x746f}, -{"sys/ttold.h", "TIOCSTOP", 0x746f}, -{"sys/ttold.h", "TIOCNOTTY", 0x7471}, -{"sys/termios.h", "TIOCNOTTY", 0x7471}, -{"sys/termios.h", "TIOCOUTQ", 0x7473}, -{"sys/ttold.h", "TIOCOUTQ", 0x7473}, -{"sys/termios.h", "TIOCGLTC", 0x7474}, -{"sys/ttold.h", "TIOCGLTC", 0x7474}, -{"sys/termios.h", "TIOCSLTC", 0x7475}, -{"sys/ttold.h", "TIOCSLTC", 0x7475}, -{"sys/termios.h", "TIOCCDTR", 0x7478}, -{"sys/ttold.h", "TIOCCDTR", 0x7478}, -{"sys/ttold.h", "TIOCSDTR", 0x7479}, -{"sys/termios.h", "TIOCSDTR", 0x7479}, -{"sys/termios.h", "TIOCCBRK", 0x747a}, -{"sys/ttold.h", "TIOCCBRK", 0x747a}, -{"sys/termios.h", "TIOCSBRK", 0x747b}, -{"sys/ttold.h", "TIOCSBRK", 0x747b}, -{"sys/termios.h", "TIOCLGET", 0x747c}, -{"sys/ttold.h", "TIOCLGET", 0x747c}, -{"sys/termios.h", "TIOCLSET", 0x747d}, -{"sys/ttold.h", "TIOCLSET", 0x747d}, -{"sys/ttold.h", "TIOCLBIC", 0x747e}, -{"sys/termios.h", "TIOCLBIC", 0x747e}, -{"sys/ttold.h", "TIOCLBIS", 0x747f}, -{"sys/termios.h", "TIOCLBIS", 0x747f}, -{"sys/vol.h", "VOLIOCMAP", 0x7601}, -{"sys/vuid_event.h", "VUIDSFORMAT", 0x7601}, -{"sys/vuid_event.h", "VUIDSFORMAT", 0x7601}, -{"sys/vuid_event.h", "VUIDGFORMAT", 0x7602}, -{"sys/vuid_event.h", "VUIDGFORMAT", 0x7602}, -{"sys/vol.h", "VOLIOCUNMAP", 0x7602}, -{"sys/vol.h", "VOLIOCEVENT", 0x7603}, -{"sys/vuid_event.h", "VUIDSADDR", 0x7603}, -{"sys/vuid_event.h", "VUIDSADDR", 0x7603}, -{"sys/vuid_event.h", "VUIDGADDR", 0x7604}, -{"sys/vuid_event.h", "VUIDGADDR", 0x7604}, -{"sys/vol.h", "VOLIOCEJECT", 0x7604}, -{"sys/vol.h", "VOLIOCCHECK", 0x7605}, -{"sys/vol.h", "VOLIOCINUSE", 0x7606}, -{"sys/vol.h", "VOLIOCDGATTR", 0x7607}, -{"sys/vol.h", "VOLIOCDSATTR", 0x7608}, -{"sys/vol.h", "VOLIOCDCHECK", 0x7609}, -{"sys/vol.h", "VOLIOCCANCEL", 0x760a}, -{"sys/vol.h", "VOLIOCINFO", 0x760b}, -{"sys/vol.h", "VOLIOCSATTR", 0x760c}, -{"sys/vol.h", "VOLIOCGATTR", 0x760d}, -{"sys/vol.h", "VOLIOCDINUSE", 0x760e}, -{"sys/vol.h", "VOLIOCDAEMON", 0x760f}, -{"sys/vol.h", "VOLIOCFLAGS", 0x7610}, -{"sys/vol.h", "VOLIOCEXTRA4", 0x7611}, -{"sys/vol.h", "VOLIOCEXTRA5", 0x7612}, -{"sys/vol.h", "VOLIOCEXTRA6", 0x7613}, -{"sys/vol.h", "VOLIOCEXTRA7", 0x7614}, -{"sys/ser_sync.h", "S_IOCGETMODE", 0x7a01}, -{"sys/ser_sync.h", "S_IOCSETMODE", 0x7a02}, -{"sys/ser_sync.h", "S_IOCGETSTATS", 0x7a03}, -{"sys/ser_sync.h", "S_IOCCLRSTATS", 0x7a04}, -{"sys/ser_sync.h", "S_IOCGETSPEED", 0x7a05}, -{"sys/ser_sync.h", "S_IOCGETMRU", 0x7a06}, -{"sys/ser_sync.h", "S_IOCSETMRU", 0x7a07}, -{"sys/ser_sync.h", "S_IOCGETMTU", 0x7a08}, -{"sys/ser_sync.h", "S_IOCSETMTU", 0x7a09}, -{"sys/ser_sync.h", "S_IOCGETMCTL", 0x7a0a}, -{"sys/tl.h", "TL_IOC_CREDOPT", 0x544c01}, diff --git a/linux/sparc/ioctls_arch0.h b/linux/sparc/ioctls_arch0.h new file mode 100644 index 00000000..07dccdd8 --- /dev/null +++ b/linux/sparc/ioctls_arch0.h @@ -0,0 +1,129 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sparc/include/ tree. */ +{ "asm/apc.h", "APCIOCGBPORT", _IOC_READ, 0x4104, 0x04 }, +{ "asm/apc.h", "APCIOCGCPWR", _IOC_READ, 0x4102, 0x04 }, +{ "asm/apc.h", "APCIOCGFANCTL", _IOC_READ, 0x4100, 0x04 }, +{ "asm/apc.h", "APCIOCSBPORT", _IOC_WRITE, 0x4105, 0x04 }, +{ "asm/apc.h", "APCIOCSCPWR", _IOC_WRITE, 0x4103, 0x04 }, +{ "asm/apc.h", "APCIOCSFANCTL", _IOC_WRITE, 0x4101, 0x04 }, +{ "asm/display7seg.h", "D7SIOCRD", _IOC_READ, 0x7045, 0x04 }, +{ "asm/display7seg.h", "D7SIOCTM", _IOC_NONE, 0x7047, 0x00 }, +{ "asm/display7seg.h", "D7SIOCWR", _IOC_WRITE, 0x7046, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_CPU_TEMPERATURE", _IOC_READ, 0x7040, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_CPU_VOLTAGE", _IOC_READ, 0x7041, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_ETHERNET_TEMPERATURE", _IOC_READ, 0x7047, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_FAN_STATUS", _IOC_READ, 0x7042, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_GLOBALADDRESS", _IOC_READ, 0x7049, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_MTHRBD_TEMPERATURE", _IOC_READ, 0x7048, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_SCSI_TEMPERATURE", _IOC_READ, 0x7046, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_SHUTDOWN_TEMPERATURE", _IOC_READ, 0x7044, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_VOLTAGE_STATUS", _IOC_READ, 0x7045, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_WARNING_TEMPERATURE", _IOC_READ, 0x7043, 0x04 }, +{ "asm/fbio.h", "FBIOGATTR", _IOC_READ, 0x4606, 0x58 }, +{ "asm/fbio.h", "FBIOGCURMAX", _IOC_READ, 0x461c, 0x04 }, +{ "asm/fbio.h", "FBIOGCURPOS", _IOC_WRITE, 0x461b, 0x04 }, +{ "asm/fbio.h", "FBIOGCURSOR", _IOC_READ|_IOC_WRITE, 0x4619, 0x2c }, +{ "asm/fbio.h", "FBIOGETCMAP", _IOC_WRITE, 0x4604, 0x14 }, +{ "asm/fbio.h", "FBIOGTYPE", _IOC_READ, 0x4600, 0x18 }, +{ "asm/fbio.h", "FBIOGVIDEO", _IOC_READ, 0x4608, 0x04 }, +{ "asm/fbio.h", "FBIOPUTCMAP", _IOC_WRITE, 0x4603, 0x14 }, +{ "asm/fbio.h", "FBIOSATTR", _IOC_WRITE, 0x4605, 0x58 }, +{ "asm/fbio.h", "FBIOSCURPOS", _IOC_WRITE, 0x461a, 0x04 }, +{ "asm/fbio.h", "FBIOSCURSOR", _IOC_WRITE, 0x4618, 0x2c }, +{ "asm/fbio.h", "FBIOSVIDEO", _IOC_WRITE, 0x4607, 0x04 }, +{ "asm/fbio.h", "FBIO_WID_ALLOC", _IOC_READ|_IOC_WRITE, 0x461e, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_FREE", _IOC_WRITE, 0x461f, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_GET", _IOC_READ|_IOC_WRITE, 0x4621, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_PUT", _IOC_WRITE, 0x4620, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTALLOC", _IOC_READ|_IOC_WRITE, 0x4c35, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTFREE", _IOC_WRITE, 0x4c36, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTPOST", _IOC_WRITE, 0x4c38, 0x1c }, +{ "asm/fbio.h", "LEO_CLUTREAD", _IOC_WRITE, 0x4c37, 0x1c }, +{ "asm/fbio.h", "LEO_GETGAMMA", _IOC_READ, 0x4c45, 0x04 }, +{ "asm/fbio.h", "LEO_SETGAMMA", _IOC_WRITE, 0x4c44, 0x04 }, +{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, +{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, +{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, +{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, +{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x5407, 0x00 }, +{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x5401, 0x12 }, +{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x5408, 0x24 }, +{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x540c, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x5405, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x5402, 0x12 }, +{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x5404, 0x12 }, +{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x5403, 0x12 }, +{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x5409, 0x24 }, +{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x540d, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x540b, 0x24 }, +{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x540f, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x540a, 0x24 }, +{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x540e, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x5406, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x747a, 0x00 }, +{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x7424, 0x00 }, +{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x740d, 0x00 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x7400, 0x04 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7483, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x7486, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x5441, 0x20 }, +{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x7485, 0x04 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x7464, 0x04 }, +{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 }, +{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x746b, 0x04 }, +{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x746c, 0x04 }, +{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x746a, 0x04 }, +{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x746d, 0x04 }, +{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x7471, 0x00 }, +{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x740e, 0x00 }, +{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, +{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x7470, 0x04 }, +{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x747b, 0x00 }, +{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x7484, 0x00 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x7401, 0x04 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x7488, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7482, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x7487, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x5442, 0x20 }, +{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x7465, 0x04 }, +{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, +{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x7472, 0x01 }, +{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, +{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 }, +{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 }, +{ "asm/openpromio.h", "OPIOCGET", _IOC_READ|_IOC_WRITE, 0x4f01, 0x14 }, +{ "asm/openpromio.h", "OPIOCGETCHILD", _IOC_READ|_IOC_WRITE, 0x4f06, 0x04 }, +{ "asm/openpromio.h", "OPIOCGETNEXT", _IOC_READ|_IOC_WRITE, 0x4f05, 0x04 }, +{ "asm/openpromio.h", "OPIOCGETOPTNODE", _IOC_READ, 0x4f04, 0x04 }, +{ "asm/openpromio.h", "OPIOCNEXTPROP", _IOC_READ|_IOC_WRITE, 0x4f03, 0x14 }, +{ "asm/openpromio.h", "OPIOCSET", _IOC_WRITE, 0x4f02, 0x14 }, +{ "asm/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "asm/watchdog.h", "WIOCGSTAT", _IOC_READ, 0x570c, 0x04 }, +{ "asm/watchdog.h", "WIOCSTART", _IOC_NONE, 0x570a, 0x00 }, +{ "asm/watchdog.h", "WIOCSTOP", _IOC_NONE, 0x570b, 0x00 }, diff --git a/linux/sparc/ioctls_inc0.h b/linux/sparc/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/sparc/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/sparc/set_error.c b/linux/sparc/set_error.c new file mode 100644 index 00000000..d285b7ca --- /dev/null +++ b/linux/sparc/set_error.c @@ -0,0 +1,15 @@ +static int +arch_set_error(struct tcb *tcp) +{ + sparc_regs.psr |= PSR_C; + sparc_regs.u_regs[U_REG_O0] = tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + sparc_regs.psr &= ~PSR_C; + sparc_regs.u_regs[U_REG_O0] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/sparc/set_scno.c b/linux/sparc/set_scno.c new file mode 100644 index 00000000..c891a0b5 --- /dev/null +++ b/linux/sparc/set_scno.c @@ -0,0 +1,11 @@ +/* + * Reloading the syscall number from %g1 register is supported + * by linux kernel starting with commit v4.5-rc7~35^2~3. + */ + +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + sparc_regs.u_regs[U_REG_G1] = scno; + return set_regs(tcp->pid); +} diff --git a/linux/sparc/signalent.h b/linux/sparc/signalent.h index e059b5d0..83ca9ca8 100644 --- a/linux/sparc/signalent.h +++ b/linux/sparc/signalent.h @@ -30,3 +30,4 @@ "SIGLOST", /* 29 */ "SIGUSR1", /* 30 */ "SIGUSR2", /* 31 */ + "SIGRTMIN", /* 32 */ diff --git a/linux/sparc/signalent1.h b/linux/sparc/signalent1.h deleted file mode 100644 index 58869a51..00000000 --- a/linux/sparc/signalent1.h +++ /dev/null @@ -1,36 +0,0 @@ - "SIG_0", /* 0 */ - "SIGHUP", /* 1 */ - "SIGINT", /* 2 */ - "SIGQUIT", /* 3 */ - "SIGILL", /* 4 */ - "SIGTRAP", /* 5 */ - "SIGABRT", /* 6 */ - "SIGEMT", /* 7 */ - "SIGFPE", /* 8 */ - "SIGKILL", /* 9 */ - "SIGBUS", /* 10 */ - "SIGSEGV", /* 11 */ - "SIGSYS", /* 12 */ - "SIGPIPE", /* 13 */ - "SIGALRM", /* 14 */ - "SIGTERM", /* 15 */ - "SIGUSR1", /* 16 */ - "SIGUSR2", /* 17 */ - "SIGCHLD", /* 18 */ - "SIGPWR", /* 19 */ - "SIGWINCH", /* 20 */ - "SIGURG", /* 21 */ - "SIGPOLL", /* 22 */ - "SIGSTOP", /* 23 */ - "SIGTSTP", /* 24 */ - "SIGCONT", /* 25 */ - "SIGTTIN", /* 26 */ - "SIGTTOU", /* 27 */ - "SIGVTALRM", /* 28 */ - "SIGPROF", /* 29 */ - "SIGXCPU", /* 30 */ - "SIGXFSZ", /* 31 */ - "SIGWAITING", /* 32 */ - "SIGLWP", /* 33 */ - "SIGFREEZE", /* 34 */ - "SIGTHAW", /* 35 */ diff --git a/linux/sparc/syscall1.h b/linux/sparc/syscall1.h deleted file mode 100644 index 6f30b742..00000000 --- a/linux/sparc/syscall1.h +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995 Rick Sladkey - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#define SOLARIS_syscall 0 -#define SOLARIS_exit 1 -#define SOLARIS_fork 2 -#define SOLARIS_read 3 -#define SOLARIS_write 4 -#define SOLARIS_open 5 -#define SOLARIS_close 6 -#define SOLARIS_wait 7 -#define SOLARIS_creat 8 -#define SOLARIS_link 9 -#define SOLARIS_unlink 10 -#define SOLARIS_exec 11 -#define SOLARIS_chdir 12 -#define SOLARIS_time 13 -#define SOLARIS_mknod 14 -#define SOLARIS_chmod 15 -#define SOLARIS_chown 16 -#define SOLARIS_brk 17 -#define SOLARIS_stat 18 -#define SOLARIS_lseek 19 -#define SOLARIS_getpid 20 -#define SOLARIS_mount 21 -#define SOLARIS_umount 22 -#define SOLARIS_setuid 23 -#define SOLARIS_getuid 24 -#define SOLARIS_stime 25 -#define SOLARIS_ptrace 26 -#define SOLARIS_alarm 27 -#define SOLARIS_fstat 28 -#define SOLARIS_pause 29 -#define SOLARIS_utime 30 -#define SOLARIS_stty 31 -#define SOLARIS_gtty 32 -#define SOLARIS_access 33 -#define SOLARIS_nice 34 -#define SOLARIS_statfs 35 -#define SOLARIS_sync 36 -#define SOLARIS_kill 37 -#define SOLARIS_fstatfs 38 -#define SOLARIS_pgrpsys 39 -#define SOLARIS_xenix 40 -#define SOLARIS_dup 41 -#define SOLARIS_pipe 42 -#define SOLARIS_times 43 -#define SOLARIS_profil 44 -#define SOLARIS_plock 45 -#define SOLARIS_setgid 46 -#define SOLARIS_getgid 47 -#define SOLARIS_signal 48 -#define SOLARIS_msgsys 49 -#define SOLARIS_syssun 50 -#define SOLARIS_acct 51 -#define SOLARIS_shmsys 52 -#define SOLARIS_semsys 53 -#define SOLARIS_ioctl 54 -#define SOLARIS_uadmin 55 -#define SOLARIS_utssys 57 -#define SOLARIS_fdsync 58 -#define SOLARIS_execve 59 -#define SOLARIS_umask 60 -#define SOLARIS_chroot 61 -#define SOLARIS_fcntl 62 -#define SOLARIS_ulimit 63 -#define SOLARIS_rmdir 79 -#define SOLARIS_mkdir 80 -#define SOLARIS_getdents 81 -#define SOLARIS_sysfs 84 -#define SOLARIS_getmsg 85 -#define SOLARIS_putmsg 86 -#define SOLARIS_poll 87 -#define SOLARIS_lstat 88 -#define SOLARIS_symlink 89 -#define SOLARIS_readlink 90 -#define SOLARIS_setgroups 91 -#define SOLARIS_getgroups 92 -#define SOLARIS_fchmod 93 -#define SOLARIS_fchown 94 -#define SOLARIS_sigprocmask 95 -#define SOLARIS_sigsuspend 96 -#define SOLARIS_sigaltstack 97 -#define SOLARIS_sigaction 98 -#define SOLARIS_sigpending 99 -#define SOLARIS_context 100 -#define SOLARIS_evsys 101 -#define SOLARIS_evtrapret 102 -#define SOLARIS_statvfs 103 -#define SOLARIS_fstatvfs 104 -#define SOLARIS_nfssys 106 -#define SOLARIS_waitsys 107 -#define SOLARIS_sigsendsys 108 -#define SOLARIS_hrtsys 109 -#define SOLARIS_acancel 110 -#define SOLARIS_async 111 -#define SOLARIS_priocntlsys 112 -#define SOLARIS_pathconf 113 -#define SOLARIS_mincore 114 -#define SOLARIS_mmap 115 -#define SOLARIS_mprotect 116 -#define SOLARIS_munmap 117 -#define SOLARIS_fpathconf 118 -#define SOLARIS_vfork 119 -#define SOLARIS_fchdir 120 -#define SOLARIS_readv 121 -#define SOLARIS_writev 122 -#define SOLARIS_xstat 123 -#define SOLARIS_lxstat 124 -#define SOLARIS_fxstat 125 -#define SOLARIS_xmknod 126 -#define SOLARIS_clocal 127 -#define SOLARIS_setrlimit 128 -#define SOLARIS_getrlimit 129 -#define SOLARIS_lchown 130 -#define SOLARIS_memcntl 131 -#define SOLARIS_getpmsg 132 -#define SOLARIS_putpmsg 133 -#define SOLARIS_rename 134 -#define SOLARIS_uname 135 -#define SOLARIS_setegid 136 -#define SOLARIS_sysconfig 137 -#define SOLARIS_adjtime 138 -#define SOLARIS_systeminfo 139 -#define SOLARIS_seteuid 141 -#define SOLARIS_vtrace 142 -#define SOLARIS_fork1 143 -#define SOLARIS_sigtimedwait 144 -#define SOLARIS_lwp_info 145 -#define SOLARIS_yield 146 -#define SOLARIS_lwp_sema_wait 147 -#define SOLARIS_lwp_sema_post 148 -#define SOLARIS_modctl 152 -#define SOLARIS_fchroot 153 -#define SOLARIS_utimes 154 -#define SOLARIS_vhangup 155 -#define SOLARIS_gettimeofday 156 -#define SOLARIS_getitimer 157 -#define SOLARIS_setitimer 158 -#define SOLARIS_lwp_create 159 -#define SOLARIS_lwp_exit 160 -#define SOLARIS_lwp_suspend 161 -#define SOLARIS_lwp_continue 162 -#define SOLARIS_lwp_kill 163 -#define SOLARIS_lwp_self 164 -#define SOLARIS_lwp_setprivate 165 -#define SOLARIS_lwp_getprivate 166 -#define SOLARIS_lwp_wait 167 -#define SOLARIS_lwp_mutex_unlock 168 -#define SOLARIS_lwp_mutex_lock 169 -#define SOLARIS_lwp_cond_wait 170 -#define SOLARIS_lwp_cond_signal 171 -#define SOLARIS_lwp_cond_broadcast 172 -#define SOLARIS_pread 173 -#define SOLARIS_pwrite 174 -#define SOLARIS_llseek 175 -#define SOLARIS_inst_sync 176 -#define SOLARIS_kaio 178 -#define SOLARIS_tsolsys 184 -#define SOLARIS_acl 185 -#define SOLARIS_auditsys 186 -#define SOLARIS_processor_bind 187 -#define SOLARIS_processor_info 188 -#define SOLARIS_p_online 189 -#define SOLARIS_sigqueue 190 -#define SOLARIS_clock_gettime 191 -#define SOLARIS_clock_settime 192 -#define SOLARIS_clock_getres 193 -#define SOLARIS_timer_create 194 -#define SOLARIS_timer_delete 195 -#define SOLARIS_timer_settime 196 -#define SOLARIS_timer_gettime 197 -#define SOLARIS_timer_getoverrun 198 -#define SOLARIS_nanosleep 199 -#define SOLARIS_facl 200 -#define SOLARIS_door 201 -#define SOLARIS_setreuid 202 -#define SOLARIS_setregid 203 -#define SOLARIS_signotifywait 210 -#define SOLARIS_lwp_sigredirect 211 -#define SOLARIS_lwp_alarm 212 - -#include "dummy2.h" - -extern int solaris_syscall(); -extern int solaris_exit(); -extern int solaris_fork(); -extern int solaris_read(); -extern int solaris_write(); -extern int solaris_open(); -extern int solaris_close(); -extern int solaris_wait(); -extern int solaris_creat(); -extern int solaris_link(); -extern int solaris_unlink(); -extern int solaris_exec(); -extern int solaris_chdir(); -extern int solaris_time(); -extern int solaris_mknod(); -extern int solaris_chmod(); -extern int solaris_chown(); -extern int solaris_brk(); -extern int solaris_stat(); -extern int solaris_lseek(); -extern int solaris_getpid(); -extern int solaris_mount(); -extern int solaris_umount(); -extern int solaris_setuid(); -extern int solaris_getuid(); -extern int solaris_stime(); -extern int solaris_ptrace(); -extern int solaris_alarm(); -extern int solaris_fstat(); -extern int solaris_pause(); -extern int solaris_utime(); -extern int solaris_stty(); -extern int solaris_gtty(); -extern int solaris_access(); -extern int solaris_nice(); -extern int solaris_statfs(); -extern int solaris_sync(); -extern int solaris_kill(); -extern int solaris_fstatfs(); -extern int solaris_pgrpsys(); -extern int solaris_setpgrp(); -extern int solaris_xenix(); -extern int solaris_syssgi(); -extern int solaris_dup(); -extern int solaris_pipe(); -extern int solaris_times(); -extern int solaris_profil(); -extern int solaris_plock(); -extern int solaris_setgid(); -extern int solaris_getgid(); -extern int solaris_sigcall(); -extern int solaris_msgsys(); -extern int solaris_syssun(); -extern int solaris_sysi86(); -extern int solaris_sysmips(); -extern int solaris_sysmachine(); -extern int solaris_acct(); -extern int solaris_shmsys(); -extern int solaris_semsys(); -extern int solaris_ioctl(); -extern int solaris_uadmin(); -extern int solaris_utssys(); -extern int solaris_fdsync(); -extern int solaris_execve(); -extern int solaris_umask(); -extern int solaris_chroot(); -extern int solaris_fcntl(); -extern int solaris_ulimit(); -extern int solaris_rmdir(); -extern int solaris_mkdir(); -extern int solaris_getdents(); -extern int solaris_sysfs(); -extern int solaris_getmsg(); -extern int solaris_putmsg(); -extern int solaris_poll(); -extern int solaris_lstat(); -extern int solaris_symlink(); -extern int solaris_readlink(); -extern int solaris_setgroups(); -extern int solaris_getgroups(); -extern int solaris_fchmod(); -extern int solaris_fchown(); -extern int solaris_sigprocmask(); -extern int solaris_sigsuspend(); -extern int solaris_sigaltstack(); -extern int solaris_sigaction(); -extern int solaris_spcall(); -extern int solaris_context(); -extern int solaris_evsys(); -extern int solaris_evtrapret(); -extern int solaris_statvfs(); -extern int solaris_fstatvfs(); -extern int solaris_nfssys(); -extern int solaris_waitid(); -extern int solaris_sigsendsys(); -extern int solaris_hrtsys(); -extern int solaris_acancel(); -extern int solaris_async(); -extern int solaris_priocntlsys(); -extern int solaris_pathconf(); -extern int solaris_mincore(); -extern int solaris_mmap(); -extern int solaris_mprotect(); -extern int solaris_munmap(); -extern int solaris_fpathconf(); -extern int solaris_vfork(); -extern int solaris_fchdir(); -extern int solaris_readv(); -extern int solaris_writev(); -extern int solaris_xstat(); -extern int solaris_lxstat(); -extern int solaris_fxstat(); -extern int solaris_xmknod(); -extern int solaris_clocal(); -extern int solaris_setrlimit(); -extern int solaris_getrlimit(); -extern int solaris_lchown(); -extern int solaris_memcntl(); -extern int solaris_getpmsg(); -extern int solaris_putpmsg(); -extern int solaris_rename(); -extern int solaris_uname(); -extern int solaris_setegid(); -extern int solaris_sysconfig(); -extern int solaris_adjtime(); -extern int solaris_sysinfo(); -extern int solaris_seteuid(); -extern int solaris_vtrace(); -extern int solaris_fork1(); -extern int solaris_sigtimedwait(); -extern int solaris_lwp_info(); -extern int solaris_yield(); -extern int solaris_lwp_sema_wait(); -extern int solaris_lwp_sema_post(); -extern int solaris_modctl(); -extern int solaris_fchroot(); -extern int solaris_utimes(); -extern int solaris_vhangup(); -extern int solaris_gettimeofday(); -extern int solaris_getitimer(); -extern int solaris_setitimer(); -extern int solaris_lwp_create(); -extern int solaris_lwp_exit(); -extern int solaris_lwp_suspend(); -extern int solaris_lwp_continue(); -extern int solaris_lwp_kill(); -extern int solaris_lwp_self(); -extern int solaris_lwp_setprivate(); -extern int solaris_lwp_getprivate(); -extern int solaris_lwp_wait(); -extern int solaris_lwp_mutex_unlock(); -extern int solaris_lwp_mutex_lock(); -extern int solaris_lwp_cond_wait(); -extern int solaris_lwp_cond_signal(); -extern int solaris_lwp_cond_broadcast(); -extern int solaris_pread(); -extern int solaris_pwrite(); -extern int solaris_llseek(); -extern int solaris_inst_sync(); -extern int solaris_auditsys(); -extern int solaris_processor_bind(); -extern int solaris_processor_info(); -extern int solaris_p_online(); -extern int solaris_sigqueue(); -extern int solaris_clock_gettime(); -extern int solaris_clock_settime(); -extern int solaris_clock_getres(); -extern int solaris_timer_create(); -extern int solaris_timer_delete(); -extern int solaris_timer_settime(); -extern int solaris_timer_gettime(); -extern int solaris_timer_getoverrun(); -extern int solaris_nanosleep(); - -/* solaris_pgrpsys subcalls */ - -extern int solaris_getpgrp(), solaris_setpgrp(), solaris_getsid(); -extern int solaris_setsid(), solaris_getpgid(), solaris_setpgid(); - -#define SOLARIS_pgrpsys_subcall 300 -#define SOLARIS_getpgrp (SOLARIS_pgrpsys_subcall + 0) -#define SOLARIS_setpgrp (SOLARIS_pgrpsys_subcall + 1) -#define SOLARIS_getsid (SOLARIS_pgrpsys_subcall + 2) -#define SOLARIS_setsid (SOLARIS_pgrpsys_subcall + 3) -#define SOLARIS_getpgid (SOLARIS_pgrpsys_subcall + 4) -#define SOLARIS_setpgid (SOLARIS_pgrpsys_subcall + 5) - -#define SOLARIS_pgrpsys_nsubcalls 6 - -/* solaris_sigcall subcalls */ - -#undef SOLARIS_signal -#define SOLARIS_sigcall 48 - -extern int solaris_signal(), solaris_sigset(), solaris_sighold(); -extern int solaris_sigrelse(), solaris_sigignore(), solaris_sigpause(); - -#define SOLARIS_sigcall_subcall 310 -#define SOLARIS_signal (SOLARIS_sigcall_subcall + 0) -#define SOLARIS_sigset (SOLARIS_sigcall_subcall + 1) -#define SOLARIS_sighold (SOLARIS_sigcall_subcall + 2) -#define SOLARIS_sigrelse (SOLARIS_sigcall_subcall + 3) -#define SOLARIS_sigignore (SOLARIS_sigcall_subcall + 4) -#define SOLARIS_sigpause (SOLARIS_sigcall_subcall + 5) - -#define SOLARIS_sigcall_nsubcalls 6 - -/* msgsys subcalls */ - -extern int solaris_msgget(), solaris_msgctl(), solaris_msgrcv(), solaris_msgsnd(); - -#define SOLARIS_msgsys_subcall 320 -#define SOLARIS_msgget (SOLARIS_msgsys_subcall + 0) -#define SOLARIS_msgctl (SOLARIS_msgsys_subcall + 1) -#define SOLARIS_msgrcv (SOLARIS_msgsys_subcall + 2) -#define SOLARIS_msgsnd (SOLARIS_msgsys_subcall + 3) - -#define SOLARIS_msgsys_nsubcalls 4 - -/* shmsys subcalls */ - -extern int solaris_shmat(), solaris_shmctl(), solaris_shmdt(), solaris_shmget(); - -#define SOLARIS_shmsys_subcall 330 -#define SOLARIS_shmat (SOLARIS_shmsys_subcall + 0) -#define SOLARIS_shmctl (SOLARIS_shmsys_subcall + 1) -#define SOLARIS_shmdt (SOLARIS_shmsys_subcall + 2) -#define SOLARIS_shmget (SOLARIS_shmsys_subcall + 3) - -#define SOLARIS_shmsys_nsubcalls 4 - -/* semsys subcalls */ - -extern int solaris_semctl(), solaris_semget(), solaris_semop(); - -#define SOLARIS_semsys_subcall 340 -#define SOLARIS_semctl (SOLARIS_semsys_subcall + 0) -#define SOLARIS_semget (SOLARIS_semsys_subcall + 1) -#define SOLARIS_semop (SOLARIS_semsys_subcall + 2) - -#define SOLARIS_semsys_nsubcalls 3 - -/* utssys subcalls */ - -extern int solaris_olduname(), solaris_ustat(), solaris_fusers(); - -#define SOLARIS_utssys_subcall 350 - -#define SOLARIS_olduname (SOLARIS_utssys_subcall + 0) - /* 1 is unused */ -#define SOLARIS_ustat (SOLARIS_utssys_subcall + 2) -#define SOLARIS_fusers (SOLARIS_utssys_subcall + 3) - -#define SOLARIS_utssys_nsubcalls 4 - -/* sysfs subcalls */ - -extern int solaris_sysfs1(), solaris_sysfs2(), solaris_sysfs3(); - -#define SOLARIS_sysfs_subcall 360 - /* 0 is unused */ -#define SOLARIS_sysfs1 (SOLARIS_sysfs_subcall + 1) -#define SOLARIS_sysfs2 (SOLARIS_sysfs_subcall + 2) -#define SOLARIS_sysfs3 (SOLARIS_sysfs_subcall + 3) - -#define SOLARIS_sysfs_nsubcalls 4 - -/* solaris_spcall subcalls */ - -#undef SOLARIS_sigpending -#define SOLARIS_spcall 99 - -extern int solaris_sigpending(), solaris_sigfillset(); - -#define SOLARIS_spcall_subcall 370 - /* 0 is unused */ -#define SOLARIS_sigpending (SOLARIS_spcall_subcall + 1) -#define SOLARIS_sigfillset (SOLARIS_spcall_subcall + 2) - -#define SOLARIS_spcall_nsubcalls 3 - -/* solaris_context subcalls */ - -extern int solaris_getcontext(), solaris_setcontext(); - -#define SOLARIS_context_subcall 380 -#define SOLARIS_getcontext (SOLARIS_context_subcall + 0) -#define SOLARIS_setcontext (SOLARIS_context_subcall + 1) - -#define SOLARIS_context_nsubcalls 2 diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h index b4e77f53..ab27a15a 100644 --- a/linux/sparc/syscallent.h +++ b/linux/sparc/syscallent.h @@ -1,407 +1,363 @@ - { 0, 0, sys_restart_syscall, "restart_syscall" },/* 0 */ - { 1, TP|SE, sys_exit, "exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, TD, sys_read, "read" }, /* 3 */ - { 3, TD, sys_write, "write" }, /* 4 */ - { 3, TD|TF, sys_open, "open" }, /* 5 */ - { 1, TD, sys_close, "close" }, /* 6 */ - { 4, TP, sys_wait4, "wait4" }, /* 7 */ - { 2, TD|TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 2, TF|TP|SE|SI, sys_execv, "execv" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 3, TF, sys_chown, "chown"}, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 1, TM|SI, sys_brk, "brk" }, /* 17 */ - { 4, 0, printargs, "perfctr" }, /* 18 */ - { 3, TD, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 2, 0, sys_capget, "capget" }, /* 21 */ - { 2, 0, sys_capset, "capset" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, NF, sys_getuid, "getuid" }, /* 24 */ - { 1, 0, sys_time, "time" }, /* 25 */ - { 5, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 2, TS, sys_sigaltstack,"sigaltstack" }, /* 28 */ - { 0, TS, sys_pause, "pause" }, /* 29 */ - { 2, TF, sys_utime, "utime" }, /* 30 */ - { 3, TF, sys_chown, "lchown32" }, /* 31 */ - { 3, TD, sys_fchown, "fchown32" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 3, TF, sys_chown, "chown32" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_stat, "stat" }, /* 38 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 39 */ - { 2, TF, sys_lstat, "lstat" }, /* 40 */ - { 2, TD, sys_dup, "dup" }, /* 41 */ - { 0, TD, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 0, NF, sys_getuid, "getuid32" }, /* 44 */ - { 2, TF, sys_umount2, "umount" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, NF, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 49 */ - { 0, NF, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, 0, printargs, "memory_ordering" }, /* 52 */ - { 0, NF, sys_getgid, "getgid32" }, /* 53 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 54 */ - { 4, 0, sys_reboot, "reboot" }, /* 55 */ - { 6, TD|TM|SI, sys_mmap, "mmap2" }, /* 56 */ - { 2, TF, sys_symlink, "symlink" }, /* 57 */ - { 3, TF, sys_readlink, "readlink" }, /* 58 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, TD, sys_fstat, "fstat" }, /* 62 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 63 */ - { 0, 0, sys_getpagesize,"getpagesize" }, /* 64 */ - { 3, TM, sys_msync, "msync" }, /* 65 */ - { 0, TP, sys_vfork, "vfork" }, /* 66 */ - { 5, TD, sys_pread, "pread" }, /* 67 */ - { 5, TD, sys_pwrite, "pwrite" }, /* 68 */ - { 0, NF, sys_geteuid, "geteuid32" }, /* 69 */ - { 0, NF, sys_getegid, "getegid32" }, /* 70 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 71 */ - { 2, 0, sys_setreuid, "setreuid32" }, /* 72 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 73 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 74 */ - { 3, TM, sys_madvise, "madvise" }, /* 75 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 76 */ - { 3, TF, sys_truncate64, "truncate64" }, /* 77 */ - { 3, TM, sys_mincore, "mincore" }, /* 78 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 79 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 80 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 81 */ - { 2, 0, sys_setgroups32,"setgroups32" }, /* 82 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 83 */ - { 3, TD, sys_ftruncate64,"ftruncate64" }, /* 84 */ - { 2, TF, sys_swapon, "swapon" }, /* 85 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 86 */ - { 1, 0, sys_setuid, "setuid32" }, /* 87 */ - { 2, 0, sys_sethostname,"sethostname" }, /* 88 */ - { 1, 0, sys_setgid, "setgid32" }, /* 89 */ - { 2, TD, sys_dup2, "dup2" }, /* 90 */ - { 1, NF, sys_setfsuid, "setfsuid32" }, /* 91 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 92 */ - { 5, TD, sys_select, "select" }, /* 93 */ - { 1, NF, sys_setfsgid, "setfsgid32" }, /* 94 */ - { 1, TD, sys_fsync, "fsync" }, /* 95 */ - { 3, 0, sys_setpriority,"setpriority" }, /* 96 */ - { 3, TN, sys_socket, "socket" }, /* 97 */ - { 3, TN, sys_connect, "connect" }, /* 98 */ - { 3, TN, sys_accept, "accept" }, /* 99 */ - { 2, 0, sys_getpriority,"getpriority" }, /* 100 */ - { 0, TS, sys_rt_sigreturn,"rt_sigreturn" }, /* 101 */ - { 5, TS, sys_rt_sigaction,"rt_sigaction" }, /* 102 */ - { 4, TS, sys_rt_sigprocmask,"rt_sigprocmask" }, /* 103 */ - { 2, TS, sys_rt_sigpending,"rt_sigpending" }, /* 104 */ - { 4, TS, sys_rt_sigtimedwait,"rt_sigtimedwait" },/* 105 */ - { 3, TS, sys_rt_sigqueueinfo,"rt_sigqueueinfo" },/* 106 */ - { 2, TS, sys_rt_sigsuspend,"rt_sigsuspend" }, /* 107 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 108 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 109 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 110 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 111 */ - { 2, 0, sys_setresgid, "setresgid32" }, /* 112 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 113 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 114 */ - { 2, 0, sys_getgroups32,"getgroups32" }, /* 115 */ - { 2, 0, sys_gettimeofday,"gettimeofday" }, /* 116 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 117 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 118 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 119 */ - { 3, TD, sys_readv, "readv" }, /* 120 */ - { 3, TD, sys_writev, "writev" }, /* 121 */ - { 2, 0, sys_settimeofday,"settimeofday" }, /* 122 */ - { 3, TD, sys_fchown, "fchown" }, /* 123 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 124 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 125 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 126 */ - { 2, 0, sys_setregid, "setregid" }, /* 127 */ - { 2, TF, sys_rename, "rename" }, /* 128 */ - { 2, TF, sys_truncate, "truncate" }, /* 129 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 130 */ - { 2, TD, sys_flock, "flock" }, /* 131 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 132 */ - { 6, TN, sys_sendto, "sendto" }, /* 133 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 134 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 135 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 136 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 137 */ - { 2, TF, sys_utimes, "utimes" }, /* 138 */ - { 2, TF, sys_stat64, "stat64" }, /* 139 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 140 */ - { 3, TN, sys_getpeername,"getpeername" }, /* 141 */ - { 6, 0, sys_futex, "futex" }, /* 142 */ - { 0, 0, sys_gettid, "gettid" }, /* 143 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 144 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 145 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 146 */ - { 5, 0, sys_prctl, "prctl" }, /* 147 */ - { 5, 0, printargs, "pciconfig_read" }, /* 148 */ - { 5, 0, printargs, "pciconfig_write" }, /* 149 */ - { 3, TN, sys_getsockname,"getsockname" }, /* 150 */ - { 4, TN, sys_getmsg, "getmsg" }, /* 151 */ - { 4, TN, sys_putmsg, "putmsg" }, /* 152 */ - { 3, TD, sys_poll, "poll" }, /* 153 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 154 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 155 */ - { 4, 0, printargs, "getdirentries" }, /* 156 */ - { 2, TF, sys_statfs, "statfs" }, /* 157 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 158 */ - { 1, TF, sys_umount, "oldumount" }, /* 159 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 160 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 161 */ - { 2, 0, printargs, "getdomainname" }, /* 162 */ - { 2, 0, sys_setdomainname,"setdomainname" }, /* 163 */ - { 5, 0, printargs, "utrap_install" }, /* 164 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 165 */ - { 1, 0, sys_set_tid_address,"set_tid_address" }, /* 166 */ - { 5, TF, sys_mount, "mount" }, /* 167 */ - { 2, 0, sys_ustat, "ustat" }, /* 168 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 169 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 170 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 171 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 172 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 173 */ - { 3, TD, sys_getdents, "getdents" }, /* 174 */ - { 0, 0, sys_setsid, "setsid" }, /* 175 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 176 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 177 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 178 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 179 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 180 */ - { 2, TF, sys_removexattr,"removexattr" }, /* 181 */ - { 2, TF, sys_removexattr,"lremovexattr" }, /* 182 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 183 */ - { 5, 0, sys_query_module,"query_module" }, /* 184 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 185 */ - { 2, TD, sys_fremovexattr,"fremovexattr" }, /* 186 */ - { 2, TS, sys_kill, "tkill" }, /* 187 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 188 */ - { 1, 0, sys_uname, "uname" }, /* 189 */ - { 3, 0, sys_init_module,"init_module" }, /* 190 */ - { 1, 0, sys_personality,"personality" }, /* 191 */ - { 5, TM|SI, sys_remap_file_pages,"remap_file_pages" },/* 192 */ - { 1, TD, sys_epoll_create,"epoll_create" }, /* 193 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 194 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 195 */ - { 2, 0, sys_ulimit, "ulimit" }, /* 196 */ - { 0, 0, sys_getppid, "getppid" }, /* 197 */ - { 3, TS, sys_sigaction, "sigaction" }, /* 198 */ - { 0, TS, sys_siggetmask, "sgetmask" }, /* 199 */ - { 1, TS, sys_sigsetmask, "ssetmask" }, /* 200 */ - { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 201 */ - { 2, TF, sys_lstat, "lstat" }, /* 202 */ - { 1, TF, sys_uselib, "uselib" }, /* 203 */ - { 3, TD, sys_readdir, "readdir" }, /* 204 */ - { 4, TD, sys_readahead, "readahead" }, /* 205 */ - { 2, TD, sys_socketcall, "socketcall" }, /* 206 */ - { 3, 0, sys_syslog, "syslog" }, /* 207 */ - { 4, 0, sys_lookup_dcookie,"lookup_dcookie" }, /* 208 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 209 */ - { 6, TD, sys_fadvise64_64,"fadvise64_64" }, /* 210 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 211 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 212 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 213 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 214 */ - { 5, TI, sys_ipc, "ipc" }, /* 215 */ - { 0, TS, sys_sigreturn, "sigreturn" }, /* 216 */ - { 5, TP, sys_clone, "clone" }, /* 217 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 218 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 219 */ - { 3, TS, sys_sigprocmask,"sigprocmask" }, /* 220 */ - { 2, 0, sys_create_module,"create_module" }, /* 221 */ - { 2, 0, sys_delete_module,"delete_module" }, - { 1, 0, sys_get_kernel_syms,"get_kernel_syms"}, /* 223 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 224 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 225 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 226 */ - { 5, 0, sys_afs_syscall,"afs_syscall" }, /* 227 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 228 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 229 */ - { 5, TD, sys_select, "select" }, /* 230 */ - { 1, 0, sys_time, "time" }, /* 231 */ - { 2, TF, sys_stat, "stat" }, /* 232 */ - { 1, 0, sys_stime, "stime" }, /* 233 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 234 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 235 */ - { 5, TD, sys_llseek, "_llseek" }, /* 236 */ - { 2, TM, sys_mlock, "mlock" }, /* 237 */ - { 2, TM, sys_munlock, "munlock" }, /* 238 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 239 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 240 */ - { 2, 0, sys_sched_setparam,"sched_setparam"}, /* 241 */ - { 2, 0, sys_sched_getparam,"sched_getparam"}, /* 242 */ - { 3, 0, sys_sched_setscheduler,"sched_setscheduler"},/* 243 */ - { 1, 0, sys_sched_getscheduler,"sched_getscheduler"},/* 244 */ - { 0, 0, sys_sched_yield,"sched_yield" }, /* 245 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"},/* 246 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"},/* 247 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"},/* 248 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 249 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 250 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 251 */ - { 1, 0, sys_getsid, "getsid" }, /* 252 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 253 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 254 */ - { 5, 0, printargs, "aplib" }, /* 255 */ - { 2, 0, sys_clock_settime,"clock_settime" }, /* 256 */ - { 2, 0, sys_clock_gettime,"clock_gettime" }, /* 257 */ - { 2, 0, sys_clock_getres,"clock_getres" }, /* 258 */ - { 4, 0, sys_clock_nanosleep,"clock_nanosleep" },/* 259 */ - { 3, 0, sys_sched_setaffinity,"sched_setaffinity" },/* 260 */ - { 3, 0, sys_sched_getaffinity,"sched_getaffinity" },/* 261 */ - { 4, 0, sys_timer_settime,"timer_settime" }, /* 262 */ - { 2, 0, sys_timer_gettime,"timer_gettime" }, /* 263 */ - { 1, 0, sys_timer_getoverrun,"timer_getoverrun" },/* 264 */ - { 1, 0, sys_timer_delete,"timer_delete" }, /* 265 */ - { 3, 0, sys_timer_create,"timer_create" }, /* 266 */ - { 5, 0, NULL, NULL }, /* 267 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 268 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 269 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 270 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 271 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 272 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 273 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 274 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 275 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 276 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 277 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 278 */ - { 5, TP, sys_waitid, "waitid" }, /* 279 */ - { 4, TD, sys_tee, "tee" }, /* 280 */ - { 5, 0, sys_add_key, "add_key" }, /* 281 */ - { 4, 0, sys_request_key, "request_key" }, /* 282 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 283 */ - { 4, TD|TF, sys_openat, "openat" }, /* 284 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 285 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 286 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 287 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 288 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 289 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 290 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 291 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 292 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 293 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 294 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 295 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 296 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 297 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 298 */ - { 1, TP, sys_unshare, "unshare" }, /* 299 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 300 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 301 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 302 */ - { 6, TM, sys_mbind, "mbind" }, /* 303 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 304 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 305 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 306 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 307 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 308 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 309 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 310 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 311 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 312 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 313 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 314 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 315 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 316 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 317 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 318 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 319 */ - { 3, TD, sys_dup3, "dup3" }, /* 320 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 321 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 322 */ - { 4, TN, sys_accept4, "accept4" }, /* 323 */ - { 5, TD, sys_preadv, "preadv" }, /* 324 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 325 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 326 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 327 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 328 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 329 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 330 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 331 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 332 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 333 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 334 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 335 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 336 */ - { 2, TD, sys_setns, "setns" }, /* 337 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 338 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 339 */ - { 0, NF, printargs, "kern_features" }, /* 340 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 341 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 342 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 343 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 344 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 345 */ - { 5, 0, NULL, NULL }, /* 346 */ - { 5, 0, NULL, NULL }, /* 347 */ - { 5, 0, NULL, NULL }, /* 348 */ - { 5, 0, NULL, NULL }, /* 349 */ - { 5, 0, NULL, NULL }, /* 350 */ - { 5, 0, NULL, NULL }, /* 351 */ - { 5, 0, NULL, NULL }, /* 352 */ -#define SYS_socket_subcall 353 +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 4, TP, SEN(wait4), "wait4" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 2, TF|TP|SE|SI, SEN(execv), "execv" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 3, TF, SEN(chown16), "chown" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown16), "lchown" }, +[ 17] = { 1, TM|SI, SEN(brk), "brk" }, +[ 18] = { 4, 0, SEN(printargs), "perfctr" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 2, 0, SEN(capget), "capget" }, +[ 22] = { 2, 0, SEN(capset), "capset" }, +[ 23] = { 1, 0, SEN(setuid16), "setuid" }, +[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 25] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31] = { 3, TF, SEN(chown), "lchown32" }, +[ 32] = { 3, TD, SEN(fchown), "fchown32" }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { 3, TF, SEN(chown), "chown32" }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(stat), "stat" }, +[ 39] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[ 40] = { 2, TF, SEN(lstat), "lstat" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 0, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { 0, NF, SEN(getuid), "getuid32" }, +[ 45] = { 2, TF, SEN(umount2), "umount2" }, +[ 46] = { 1, 0, SEN(setgid16), "setgid" }, +[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { }, +[ 53] = { 0, NF, SEN(getgid), "getgid32" }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 4, 0, SEN(reboot), "reboot" }, +[ 56] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +[ 57] = { 2, TF, SEN(symlink), "symlink" }, +[ 58] = { 3, TF, SEN(readlink), "readlink" }, +[ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, TD, SEN(fstat), "fstat" }, +[ 63] = { 2, TD, SEN(fstat64), "fstat64" }, +[ 64] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[ 65] = { 3, TM, SEN(msync), "msync" }, +[ 66] = { 0, TP, SEN(vfork), "vfork" }, +[ 67] = { 5, TD, SEN(pread), "pread64" }, +[ 68] = { 5, TD, SEN(pwrite), "pwrite64" }, +[ 69] = { 0, NF, SEN(geteuid), "geteuid32" }, +[ 70] = { 0, NF, SEN(getegid), "getegid32" }, +[ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 72] = { 2, 0, SEN(setreuid), "setreuid32" }, +[ 73] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[ 75] = { 3, TM, SEN(madvise), "madvise" }, +[ 76] = { 0, 0, SEN(vhangup), "vhangup" }, +[ 77] = { 3, TF, SEN(truncate64), "truncate64" }, +[ 78] = { 3, TM, SEN(mincore), "mincore" }, +[ 79] = { 2, 0, SEN(getgroups16), "getgroups" }, +[ 80] = { 2, 0, SEN(setgroups16), "setgroups" }, +[ 81] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 82] = { 2, 0, SEN(setgroups), "setgroups32" }, +[ 83] = { 3, 0, SEN(setitimer), "setitimer" }, +[ 84] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, +[ 85] = { 2, TF, SEN(swapon), "swapon" }, +[ 86] = { 2, 0, SEN(getitimer), "getitimer" }, +[ 87] = { 1, 0, SEN(setuid), "setuid32" }, +[ 88] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 89] = { 1, 0, SEN(setgid), "setgid32" }, +[ 90] = { 2, TD, SEN(dup2), "dup2" }, +[ 91] = { 1, NF, SEN(setfsuid), "setfsuid32" }, +[ 92] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 93] = { 5, TD, SEN(select), "select" }, +[ 94] = { 1, NF, SEN(setfsgid), "setfsgid32" }, +[ 95] = { 1, TD, SEN(fsync), "fsync" }, +[ 96] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 97] = { 3, TN, SEN(socket), "socket" }, +[ 98] = { 3, TN, SEN(connect), "connect" }, +[ 99] = { 3, TN, SEN(accept), "accept" }, +[100] = { 2, 0, SEN(getpriority), "getpriority" }, +[101] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[102] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" }, +[103] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[104] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[105] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[106] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[107] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[108] = { 3, 0, SEN(setresuid), "setresuid32" }, +[109] = { 3, 0, SEN(getresuid), "getresuid32" }, +[110] = { 3, 0, SEN(setresgid), "setresgid32" }, +[111] = { 3, 0, SEN(getresgid), "getresgid32" }, +[112] = { 2, 0, SEN(setregid), "setregid32" }, +[113] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[114] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[115] = { 2, 0, SEN(getgroups), "getgroups32" }, +[116] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[117] = { 2, 0, SEN(getrusage), "getrusage" }, +[118] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[119] = { 2, TF, SEN(getcwd), "getcwd" }, +[120] = { 3, TD, SEN(readv), "readv" }, +[121] = { 3, TD, SEN(writev), "writev" }, +[122] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[123] = { 3, TD, SEN(fchown16), "fchown" }, +[124] = { 2, TD, SEN(fchmod), "fchmod" }, +[125] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[126] = { 2, 0, SEN(setreuid16), "setreuid" }, +[127] = { 2, 0, SEN(setregid16), "setregid" }, +[128] = { 2, TF, SEN(rename), "rename" }, +[129] = { 2, TF, SEN(truncate), "truncate" }, +[130] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[131] = { 2, TD, SEN(flock), "flock" }, +[132] = { 2, TF, SEN(lstat64), "lstat64" }, +[133] = { 6, TN, SEN(sendto), "sendto" }, +[134] = { 2, TN, SEN(shutdown), "shutdown" }, +[135] = { 4, TN, SEN(socketpair), "socketpair" }, +[136] = { 2, TF, SEN(mkdir), "mkdir" }, +[137] = { 1, TF, SEN(rmdir), "rmdir" }, +[138] = { 2, TF, SEN(utimes), "utimes" }, +[139] = { 2, TF, SEN(stat64), "stat64" }, +[140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[141] = { 3, TN, SEN(getpeername), "getpeername" }, +[142] = { 6, 0, SEN(futex), "futex" }, +[143] = { 0, NF, SEN(gettid), "gettid" }, +[144] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[145] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[146] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[147] = { 5, 0, SEN(prctl), "prctl" }, +[148] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[149] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[150] = { 3, TN, SEN(getsockname), "getsockname" }, +[151] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[152] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[153] = { 3, TD, SEN(poll), "poll" }, +[154] = { 3, TD, SEN(getdents64), "getdents64" }, +[155] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[156] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[157] = { 2, TF, SEN(statfs), "statfs" }, +[158] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[159] = { 1, TF, SEN(umount), "umount" }, +[160] = { 3, 0, SEN(sched_setaffinity), "sched_set_affinity" }, +[161] = { 3, 0, SEN(sched_getaffinity), "sched_get_affinity" }, +[162] = { 2, 0, SEN(printargs), "getdomainname" }, +[163] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[164] = { }, +[165] = { 4, TF, SEN(quotactl), "quotactl" }, +[166] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[167] = { 5, TF, SEN(mount), "mount" }, +[168] = { 2, 0, SEN(ustat), "ustat" }, +[169] = { 5, TF, SEN(setxattr), "setxattr" }, +[170] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[171] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[172] = { 4, TF, SEN(getxattr), "getxattr" }, +[173] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[174] = { 3, TD, SEN(getdents), "getdents" }, +[175] = { 0, 0, SEN(setsid), "setsid" }, +[176] = { 1, TD, SEN(fchdir), "fchdir" }, +[177] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[178] = { 3, TF, SEN(listxattr), "listxattr" }, +[179] = { 3, TF, SEN(listxattr), "llistxattr" }, +[180] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[181] = { 2, TF, SEN(removexattr), "removexattr" }, +[182] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[183] = { 1, TS, SEN(sigpending), "sigpending" }, +[184] = { 5, 0, SEN(query_module), "query_module" }, +[185] = { 2, 0, SEN(setpgid), "setpgid" }, +[186] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[187] = { 2, TS, SEN(kill), "tkill" }, +[188] = { 1, TP|SE, SEN(exit), "exit_group" }, +[189] = { 1, 0, SEN(uname), "uname" }, +[190] = { 3, 0, SEN(init_module), "init_module" }, +[191] = { 1, NF, SEN(personality), "personality" }, +[192] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[193] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[194] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[195] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[196] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[197] = { 0, NF, SEN(getppid), "getppid" }, +[198] = { 3, TS, SEN(sigaction), "sigaction" }, +[199] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[200] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[201] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[202] = { 2, TF, SEN(lstat), "oldlstat" }, +[203] = { 1, TF, SEN(uselib), "uselib" }, +[204] = { 3, TD, SEN(readdir), "readdir" }, +[205] = { 4, TD, SEN(readahead), "readahead" }, +[206] = { 2, TD, SEN(socketcall), "socketcall" }, +[207] = { 3, 0, SEN(syslog), "syslog" }, +[208] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[209] = { 5, TD, SEN(fadvise64), "fadvise64" }, +[210] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[211] = { 3, TS, SEN(tgkill), "tgkill" }, +[212] = { 3, TP, SEN(waitpid), "waitpid" }, +[213] = { 1, TF, SEN(swapoff), "swapoff" }, +[214] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[215] = { 6, TI, SEN(ipc), "ipc" }, +[216] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[217] = { 5, TP, SEN(clone), "clone" }, +[218] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[219] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[220] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[221] = { 2, 0, SEN(create_module), "create_module" }, +[222] = { 2, 0, SEN(delete_module), "delete_module" }, +[223] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[224] = { 1, 0, SEN(getpgid), "getpgid" }, +[225] = { 2, 0, SEN(bdflush), "bdflush" }, +[226] = { 3, 0, SEN(sysfs), "sysfs" }, +[227] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[228] = { 1, NF, SEN(setfsuid16), "setfsuid" }, +[229] = { 1, NF, SEN(setfsgid16), "setfsgid" }, +[230] = { 5, TD, SEN(select), "_newselect" }, +[231] = { 1, 0, SEN(time), "time" }, +[232] = { 6, TD, SEN(splice), "splice" }, +[233] = { 1, 0, SEN(stime), "stime" }, +[234] = { 3, TF, SEN(statfs64), "statfs64" }, +[235] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[236] = { 5, TD, SEN(llseek), "_llseek" }, +[237] = { 2, TM, SEN(mlock), "mlock" }, +[238] = { 2, TM, SEN(munlock), "munlock" }, +[239] = { 1, TM, SEN(mlockall), "mlockall" }, +[240] = { 0, TM, SEN(munlockall), "munlockall" }, +[241] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[242] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[243] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[244] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[245] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[246] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[247] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[248] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[249] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[250] = { 5, TM|SI, SEN(mremap), "mremap" }, +[251] = { 1, 0, SEN(sysctl), "_sysctl" }, +[252] = { 1, 0, SEN(getsid), "getsid" }, +[253] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[254] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[255] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, +[256] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[257] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[258] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[259] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[260] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[261] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[262] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[263] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[264] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[265] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[266] = { 3, 0, SEN(timer_create), "timer_create" }, +[267] = { }, +[268] = { 2, TM, SEN(io_setup), "io_setup" }, +[269] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[270] = { 3, 0, SEN(io_submit), "io_submit" }, +[271] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[272] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[273] = { 4, 0, SEN(mq_open), "mq_open" }, +[274] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[275] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[276] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[277] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[278] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[279] = { 5, TP, SEN(waitid), "waitid" }, +[280] = { 4, TD, SEN(tee), "tee" }, +[281] = { 5, 0, SEN(add_key), "add_key" }, +[282] = { 4, 0, SEN(request_key), "request_key" }, +[283] = { 5, 0, SEN(keyctl), "keyctl" }, +[284] = { 4, TD|TF, SEN(openat), "openat" }, +[285] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[286] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[287] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[288] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[289] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[290] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[291] = { 4, TD|TF, SEN(renameat), "renameat" }, +[292] = { 5, TD|TF, SEN(linkat), "linkat" }, +[293] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[294] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[295] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[296] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[297] = { 6, TD, SEN(pselect6), "pselect6" }, +[298] = { 5, TD, SEN(ppoll), "ppoll" }, +[299] = { 1, TP, SEN(unshare), "unshare" }, +[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[301] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[302] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[303] = { 6, TM, SEN(mbind), "mbind" }, +[304] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[305] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[306] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[307] = { 6, TM, SEN(move_pages), "move_pages" }, +[308] = { 3, 0, SEN(getcpu), "getcpu" }, +[309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[310] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[311] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[313] = { 1, TD, SEN(eventfd), "eventfd" }, +[314] = { 6, TD, SEN(fallocate), "fallocate" }, +[315] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[316] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[317] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[318] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[319] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[320] = { 3, TD, SEN(dup3), "dup3" }, +[321] = { 2, TD, SEN(pipe2), "pipe2" }, +[322] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[323] = { 4, TN, SEN(accept4), "accept4" }, +[324] = { 5, TD, SEN(preadv), "preadv" }, +[325] = { 5, TD, SEN(pwritev), "pwritev" }, +[326] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[327] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[328] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[329] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[330] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[331] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[332] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[333] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[334] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[335] = { 1, TD, SEN(syncfs), "syncfs" }, +[336] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[337] = { 2, TD, SEN(setns), "setns" }, +[338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[340] = { 0, NF, SEN(printargs), "kern_features" }, +[341] = { 5, 0, SEN(kcmp), "kcmp" }, +[342] = { 3, TD, SEN(finit_module), "finit_module" }, +[343] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[344] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[345] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[346] = { 3, 0, SEN(seccomp), "seccomp" }, +[347] = { 3, 0, SEN(getrandom), "getrandom" }, +[348] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[349] = { 3, TD, SEN(bpf), "bpf" }, +[350] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[351] = { 2, 0, SEN(membarrier), "membarrier" }, +[352] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[353] = { 3, TN, SEN(bind), "bind" }, +[354] = { 2, TN, SEN(listen), "listen" }, +[355] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[356] = { 3, TM, SEN(mlock2), "mlock2" }, +[357] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[358] = { 6, TD, SEN(preadv2), "preadv2" }, +[359] = { 6, TD, SEN(pwritev2), "pwritev2" }, + +#define SYS_socket_subcall 400 #include "subcall.h" - { 6, 0, printargs, "socket_subcall"}, /* 353 */ - { 3, TN, sys_socket, "socket" }, /* 354 */ - { 3, TN, sys_bind, "bind" }, /* 355 */ - { 3, TN, sys_connect, "connect" }, /* 356 */ - { 2, TN, sys_listen, "listen" }, /* 357 */ - { 3, TN, sys_accept, "accept" }, /* 358 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 359 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 360 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 361 */ - { 4, TN, sys_send, "send" }, /* 362 */ - { 4, TN, sys_recv, "recv" }, /* 363 */ - { 6, TN, sys_sendto, "sendto" }, /* 364 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 365 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 366 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 367 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 368 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 369 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 370 */ - { 4, TN, sys_accept4, "accept4" }, /* 371 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 372 */ -#if SYS_ipc_subcall != 373 - #error fix me -#endif - { 4, 0, printargs, "ipc_subcall" }, /* 373 */ - { 4, TI, printargs, "semop" }, /* 374 */ - { 4, TI, sys_semget, "semget" }, /* 375 */ - { 4, TI, sys_semctl, "semctl" }, /* 376 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 377 */ - { 4, 0, printargs, "ipc_subcall" }, /* 378 */ - { 4, 0, printargs, "ipc_subcall" }, /* 379 */ - { 4, 0, printargs, "ipc_subcall" }, /* 380 */ - { 4, 0, printargs, "ipc_subcall" }, /* 381 */ - { 4, 0, printargs, "ipc_subcall" }, /* 382 */ - { 4, 0, printargs, "ipc_subcall" }, /* 383 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 384 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 385 */ - { 4, TI, sys_msgget, "msgget" }, /* 386 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 387 */ - { 4, 0, printargs, "ipc_subcall" }, /* 388 */ - { 4, 0, printargs, "ipc_subcall" }, /* 389 */ - { 4, 0, printargs, "ipc_subcall" }, /* 390 */ - { 4, 0, printargs, "ipc_subcall" }, /* 391 */ - { 4, 0, printargs, "ipc_subcall" }, /* 392 */ - { 4, 0, printargs, "ipc_subcall" }, /* 393 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 394 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 395 */ - { 4, TI, sys_shmget, "shmget" }, /* 396 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 397 */ - { 5, 0, NULL, NULL }, /* 398 */ - { 5, 0, NULL, NULL }, /* 399 */ - { 5, 0, NULL, NULL }, /* 400 */ - { 5, 0, NULL, NULL }, /* 401 */ diff --git a/linux/sparc/syscallent1.h b/linux/sparc/syscallent1.h deleted file mode 100644 index 2e2805b2..00000000 --- a/linux/sparc/syscallent1.h +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - { 6, 0, solaris_syscall, "syscall" }, /* 0 */ - { 6, TP, solaris_exit, "_exit" }, /* 1 */ - { 6, TP, solaris_fork, "fork" }, /* 2 */ - { 6, 0, solaris_read, "read" }, /* 3 */ - { 6, 0, solaris_write, "write" }, /* 4 */ - { 6, TF, solaris_open, "open" }, /* 5 */ - { 6, 0, solaris_close, "close" }, /* 6 */ - { 6, TP, solaris_wait, "wait" }, /* 7 */ - { 6, TF, solaris_creat, "creat" }, /* 8 */ - { 6, TF, solaris_link, "link" }, /* 9 */ - { 6, TF, solaris_unlink, "unlink" }, /* 10 */ - { 6, TF|TP, solaris_exec, "exec" }, /* 11 */ - { 6, TF, solaris_chdir, "chdir" }, /* 12 */ - { 6, 0, solaris_time, "time" }, /* 13 */ - { 6, TF, solaris_mknod, "mknod" }, /* 14 */ - { 6, TF, solaris_chmod, "chmod" }, /* 15 */ - { 6, TF, solaris_chown, "chown" }, /* 16 */ - { 6, 0, solaris_brk, "brk" }, /* 17 */ - { 6, TF, solaris_stat, "stat" }, /* 18 */ - { 6, 0, solaris_lseek, "lseek" }, /* 19 */ - { 6, 0, solaris_getpid, "getpid" }, /* 20 */ - { 6, TF, solaris_mount, "mount" }, /* 21 */ - { 6, TF, solaris_umount, "umount" }, /* 22 */ - { 6, 0, solaris_setuid, "setuid" }, /* 23 */ - { 6, 0, solaris_getuid, "getuid" }, /* 24 */ - { 6, 0, solaris_stime, "stime" }, /* 25 */ - { 6, 0, solaris_ptrace, "ptrace" }, /* 26 */ - { 6, 0, solaris_alarm, "alarm" }, /* 27 */ - { 6, 0, solaris_fstat, "fstat" }, /* 28 */ - { 6, TS, solaris_pause, "pause" }, /* 29 */ - { 6, TF, solaris_utime, "utime" }, /* 30 */ - { 6, 0, solaris_stty, "stty" }, /* 31 */ - { 6, 0, solaris_gtty, "gtty" }, /* 32 */ - { 6, TF, solaris_access, "access" }, /* 33 */ - { 6, 0, solaris_nice, "nice" }, /* 34 */ - { 6, TF, solaris_statfs, "statfs" }, /* 35 */ - { 6, 0, solaris_sync, "sync" }, /* 36 */ - { 6, TS, solaris_kill, "kill" }, /* 37 */ - { 6, 0, solaris_fstatfs, "fstatfs" }, /* 38 */ - { 6, 0, solaris_pgrpsys, "pgrpsys" }, /* 39 */ - { 6, 0, solaris_xenix, "xenix" }, /* 40 */ - { 6, 0, solaris_dup, "dup" }, /* 41 */ - { 6, 0, solaris_pipe, "pipe" }, /* 42 */ - { 6, 0, solaris_times, "times" }, /* 43 */ - { 6, 0, solaris_profil, "profil" }, /* 44 */ - { 6, 0, solaris_plock, "plock" }, /* 45 */ - { 6, 0, solaris_setgid, "setgid" }, /* 46 */ - { 6, 0, solaris_getgid, "getgid" }, /* 47 */ - { 6, 0, solaris_sigcall, "sigcall" }, /* 48 */ - { 6, TI, solaris_msgsys, "msgsys" }, /* 49 */ - { 6, 0, solaris_syssun, "syssun" }, /* 50 */ - { 6, TF, solaris_acct, "acct" }, /* 51 */ - { 6, TI, solaris_shmsys, "shmsys" }, /* 52 */ - { 6, TI, solaris_semsys, "semsys" }, /* 53 */ - { 6, 0, solaris_ioctl, "ioctl" }, /* 54 */ - { 6, 0, solaris_uadmin, "uadmin" }, /* 55 */ - { 6, 0, solaris_sysmp, "sysmp" }, /* 56 */ - { 6, 0, solaris_utssys, "utssys" }, /* 57 */ - { 6, 0, solaris_fdsync, "fdsync" }, /* 58 */ - { 6, TF|TP, solaris_execve, "execve" }, /* 59 */ - { 6, 0, solaris_umask, "umask" }, /* 60 */ - { 6, TF, solaris_chroot, "chroot" }, /* 61 */ - { 6, 0, solaris_fcntl, "fcntl" }, /* 62 */ - { 6, 0, solaris_ulimit, "ulimit" }, /* 63 */ - { 6, 0, NULL, NULL }, /* 64 */ - { 6, 0, NULL, NULL }, /* 65 */ - { 6, 0, NULL, NULL }, /* 66 */ - { 6, 0, NULL, NULL }, /* 67 */ - { 6, 0, NULL, NULL }, /* 68 */ - { 6, 0, NULL, NULL }, /* 69 */ - { 6, 0, NULL, NULL }, /* 70 */ - { 6, 0, NULL, NULL }, /* 71 */ - { 6, 0, NULL, NULL }, /* 72 */ - { 6, 0, NULL, NULL }, /* 73 */ - { 6, 0, NULL, NULL }, /* 74 */ - { 6, 0, NULL, NULL }, /* 75 */ - { 6, 0, NULL, NULL }, /* 76 */ - { 6, 0, NULL, NULL }, /* 77 */ - { 6, 0, NULL, NULL }, /* 78 */ - { 6, TF, solaris_rmdir, "rmdir" }, /* 79 */ - { 6, TF, solaris_mkdir, "mkdir" }, /* 80 */ - { 6, 0, solaris_getdents, "getdents" }, /* 81 */ - { 6, 0, solaris_sginap, "sginap" }, /* 82 */ - { 6, 0, solaris_sgikopt, "sgikopt" }, /* 83 */ - { 6, 0, solaris_sysfs, "sysfs" }, /* 84 */ - { 6, TN, sys_getmsg, "getmsg" }, /* 85 */ - { 6, TN, sys_putmsg, "putmsg" }, /* 86 */ - { 6, TN, solaris_poll, "poll" }, /* 87 */ - { 6, TF, solaris_lstat, "lstat" }, /* 88 */ - { 6, TF, solaris_symlink, "symlink" }, /* 89 */ - { 6, TF, solaris_readlink, "readlink" }, /* 90 */ - { 6, 0, solaris_setgroups, "setgroups" }, /* 91 */ - { 6, 0, solaris_getgroups, "getgroups" }, /* 92 */ - { 6, 0, solaris_fchmod, "fchmod" }, /* 93 */ - { 6, 0, solaris_fchown, "fchown" }, /* 94 */ - { 6, TS, solaris_sigprocmask, "sigprocmask" }, /* 95 */ - { 6, TS, solaris_sigsuspend, "sigsuspend" }, /* 96 */ - { 6, TS, solaris_sigaltstack, "sigaltstack" }, /* 97 */ - { 6, TS, solaris_sigaction, "sigaction" }, /* 98 */ - { 6, 0, solaris_spcall, "spcall" }, /* 99 */ - { 6, 0, solaris_context, "context" }, /* 100 */ - { 6, 0, solaris_evsys, "evsys" }, /* 101 */ - { 6, 0, solaris_evtrapret, "evtrapret" }, /* 102 */ - { 6, TF, solaris_statvfs, "statvfs" }, /* 103 */ - { 6, 0, solaris_fstatvfs, "fstatvfs" }, /* 104 */ - { 6, 0, NULL, NULL }, /* 105 */ - { 6, 0, solaris_nfssys, "nfssys" }, /* 106 */ - { 6, TP, solaris_waitid, "waitid" }, /* 107 */ - { 6, 0, solaris_sigsendsys, "sigsendsys" }, /* 108 */ - { 6, 0, solaris_hrtsys, "hrtsys" }, /* 109 */ - { 6, 0, solaris_acancel, "acancel" }, /* 110 */ - { 6, 0, solaris_async, "async" }, /* 111 */ - { 6, 0, solaris_priocntlsys, "priocntlsys" }, /* 112 */ - { 6, TF, solaris_pathconf, "pathconf" }, /* 113 */ - { 6, 0, solaris_mincore, "mincore" }, /* 114 */ - { 6, TD|TM, solaris_mmap, "mmap" }, /* 115 */ - { 6, 0, solaris_mprotect, "mprotect" }, /* 116 */ - { 6, 0, solaris_munmap, "munmap" }, /* 117 */ - { 6, 0, solaris_fpathconf, "fpathconf" }, /* 118 */ - { 6, TP, solaris_vfork, "vfork" }, /* 119 */ - { 6, 0, solaris_fchdir, "fchdir" }, /* 120 */ - { 6, 0, solaris_readv, "readv" }, /* 121 */ - { 6, 0, solaris_writev, "writev" }, /* 122 */ - { 6, TF, solaris_xstat, "xstat" }, /* 123 */ - { 6, TF, solaris_lxstat, "lxstat" }, /* 124 */ - { 6, 0, solaris_fxstat, "fxstat" }, /* 125 */ - { 6, TF, solaris_xmknod, "xmknod" }, /* 126 */ - { 6, 0, solaris_clocal, "clocal" }, /* 127 */ - { 6, 0, solaris_setrlimit, "setrlimit" }, /* 128 */ - { 6, 0, solaris_getrlimit, "getrlimit" }, /* 129 */ - { 6, TF, solaris_lchown, "lchown" }, /* 130 */ - { 6, 0, solaris_memcntl, "memcntl" }, /* 131 */ - { 6, TN, solaris_getpmsg, "getpmsg" }, /* 132 */ - { 6, TN, solaris_putpmsg, "putpmsg" }, /* 133 */ - { 6, TF, solaris_rename, "rename" }, /* 134 */ - { 6, 0, solaris_uname, "uname" }, /* 135 */ - { 6, 0, solaris_setegid, "setegid" }, /* 136 */ - { 6, 0, solaris_sysconfig, "sysconfig" }, /* 137 */ - { 6, 0, solaris_adjtime, "adjtime" }, /* 138 */ - { 6, 0, solaris_sysinfo, "sysinfo" }, /* 139 */ - { 6, 0, NULL, NULL }, /* 140 */ - { 6, 0, solaris_seteuid, "seteuid" }, /* 141 */ - { 6, 0, solaris_vtrace, "vtrace" }, /* 142 */ - { 6, TP, solaris_fork1, "fork1" }, /* 143 */ - { 6, TS, solaris_sigtimedwait, "sigtimedwait" }, /* 144 */ - { 6, 0, solaris_lwp_info, "lwp_info" }, /* 145 */ - { 6, 0, solaris_yield, "yield" }, /* 146 */ - { 6, 0, solaris_lwp_sema_wait, "lwp_sema_wait" }, /* 147 */ - { 6, 0, solaris_lwp_sema_post, "lwp_sema_post" }, /* 148 */ - { 6, 0, NULL, NULL }, /* 149 */ - { 6, 0, NULL, NULL }, /* 150 */ - { 6, 0, NULL, NULL }, /* 151 */ - { 6, 0, solaris_modctl, "modctl" }, /* 152 */ - { 6, 0, solaris_fchroot, "fchroot" }, /* 153 */ - { 6, TF, solaris_utimes, "utimes" }, /* 154 */ - { 6, 0, solaris_vhangup, "vhangup" }, /* 155 */ - { 6, 0, solaris_gettimeofday, "gettimeofday" }, /* 156 */ - { 6, 0, solaris_getitimer, "getitimer" }, /* 157 */ - { 6, 0, solaris_setitimer, "setitimer" }, /* 158 */ - { 6, 0, solaris_lwp_create, "lwp_create" }, /* 159 */ - { 6, 0, solaris_lwp_exit, "lwp_exit" }, /* 160 */ - { 6, 0, solaris_lwp_suspend, "lwp_suspend" }, /* 161 */ - { 6, 0, solaris_lwp_continue, "lwp_continue" }, /* 162 */ - { 6, 0, solaris_lwp_kill, "lwp_kill" }, /* 163 */ - { 6, 0, solaris_lwp_self, "lwp_self" }, /* 164 */ - { 6, 0, solaris_lwp_setprivate, "lwp_setprivate"}, /* 165 */ - { 6, 0, solaris_lwp_getprivate, "lwp_getprivate"}, /* 166 */ - { 6, 0, solaris_lwp_wait, "lwp_wait" }, /* 167 */ - { 6, 0, solaris_lwp_mutex_unlock,"lwp_mutex_unlock"}, /* 168 */ - { 6, 0, solaris_lwp_mutex_lock, "lwp_mutex_lock"}, /* 169 */ - { 6, 0, solaris_lwp_cond_wait, "lwp_cond_wait"}, /* 170 */ - { 6, 0, solaris_lwp_cond_signal,"lwp_cond_signal"}, /* 171 */ - { 6, 0, solaris_lwp_cond_broadcast,"lwp_cond_broadcast"}, /* 172 */ - { 6, 0, solaris_pread, "pread" }, /* 173 */ - { 6, 0, solaris_pwrite, "pwrite" }, /* 174 */ - { 6, 0, solaris_llseek, "llseek" }, /* 175 */ - { 6, 0, solaris_inst_sync, "inst_sync" }, /* 176 */ - { 6, 0, NULL, NULL }, /* 177 */ - { 6, 0, NULL, NULL }, /* 178 */ - { 6, 0, NULL, NULL }, /* 179 */ - { 6, 0, NULL, NULL }, /* 180 */ - { 6, 0, NULL, NULL }, /* 181 */ - { 6, 0, NULL, NULL }, /* 182 */ - { 6, 0, NULL, NULL }, /* 183 */ - { 6, 0, NULL, NULL }, /* 184 */ - { 6, 0, NULL, NULL }, /* 185 */ - { 6, 0, solaris_auditsys, "auditsys" }, /* 186 */ - { 6, 0, solaris_processor_bind, "processor_bind"}, /* 187 */ - { 6, 0, solaris_processor_info, "processor_info"}, /* 188 */ - { 6, 0, solaris_p_online, "p_online" }, /* 189 */ - { 6, 0, solaris_sigqueue, "sigqueue" }, /* 190 */ - { 6, 0, solaris_clock_gettime, "clock_gettime" }, /* 191 */ - { 6, 0, solaris_clock_settime, "clock_settime" }, /* 192 */ - { 6, 0, solaris_clock_getres, "clock_getres" }, /* 193 */ - { 6, 0, solaris_timer_create, "timer_create" }, /* 194 */ - { 6, 0, solaris_timer_delete, "timer_delete" }, /* 195 */ - { 6, 0, solaris_timer_settime, "timer_settime" }, /* 196 */ - { 6, 0, solaris_timer_gettime, "timer_gettime" }, /* 197 */ - { 6, 0, solaris_timer_getoverrun,"timer_getoverrun"}, /* 198 */ - { 6, 0, solaris_nanosleep, "nanosleep" }, /* 199 */ - { 6, 0, NULL, NULL }, /* 200 */ - { 6, 0, NULL, NULL }, /* 201 */ - { 6, 0, NULL, NULL }, /* 202 */ - { 6, 0, NULL, NULL }, /* 203 */ - { 6, 0, NULL, NULL }, /* 204 */ - { 6, 0, NULL, NULL }, /* 205 */ - { 6, 0, NULL, NULL }, /* 206 */ - { 6, 0, NULL, NULL }, /* 207 */ - { 6, 0, NULL, NULL }, /* 208 */ - { 6, 0, NULL, NULL }, /* 209 */ - { 6, 0, NULL, NULL }, /* 210 */ - { 6, 0, NULL, NULL }, /* 211 */ - { 6, 0, NULL, NULL }, /* 212 */ - { 6, 0, NULL, NULL }, /* 213 */ - { 6, 0, NULL, NULL }, /* 214 */ - { 6, 0, NULL, NULL }, /* 215 */ - { 6, 0, NULL, NULL }, /* 216 */ - { 6, 0, NULL, NULL }, /* 217 */ - { 6, 0, NULL, NULL }, /* 218 */ - { 6, 0, NULL, NULL }, /* 219 */ - { 6, 0, NULL, NULL }, /* 220 */ - { 6, 0, NULL, NULL }, /* 221 */ - { 6, 0, NULL, NULL }, /* 222 */ - { 6, 0, NULL, NULL }, /* 223 */ - { 6, 0, NULL, NULL }, /* 224 */ - { 6, 0, NULL, NULL }, /* 225 */ - { 6, 0, NULL, NULL }, /* 226 */ - { 6, 0, NULL, NULL }, /* 227 */ - { 6, 0, NULL, NULL }, /* 228 */ - { 6, 0, NULL, NULL }, /* 229 */ - { 6, 0, NULL, NULL }, /* 230 */ - { 6, 0, NULL, NULL }, /* 231 */ - { 6, 0, NULL, NULL }, /* 232 */ - { 6, 0, NULL, NULL }, /* 233 */ - { 6, 0, NULL, NULL }, /* 234 */ - { 6, 0, NULL, NULL }, /* 235 */ - { 6, 0, NULL, NULL }, /* 236 */ - { 6, 0, NULL, NULL }, /* 237 */ - { 6, 0, NULL, NULL }, /* 238 */ - { 6, 0, NULL, NULL }, /* 239 */ - { 6, 0, NULL, NULL }, /* 240 */ - { 6, 0, NULL, NULL }, /* 241 */ - { 6, 0, NULL, NULL }, /* 242 */ - { 6, 0, NULL, NULL }, /* 243 */ - { 6, 0, NULL, NULL }, /* 244 */ - { 6, 0, NULL, NULL }, /* 245 */ - { 6, 0, NULL, NULL }, /* 246 */ - { 6, 0, NULL, NULL }, /* 247 */ - { 6, 0, NULL, NULL }, /* 248 */ - { 6, 0, NULL, NULL }, /* 249 */ - { 6, 0, NULL, NULL }, /* 250 */ - { 6, 0, NULL, NULL }, /* 251 */ - { 6, 0, NULL, NULL }, /* 252 */ - { 6, 0, NULL, NULL }, /* 253 */ - { 6, 0, NULL, NULL }, /* 254 */ - { 6, 0, NULL, NULL }, /* 255 */ - { 6, 0, NULL, NULL }, /* 256 */ - { 6, 0, NULL, NULL }, /* 257 */ - { 6, 0, NULL, NULL }, /* 258 */ - { 6, 0, NULL, NULL }, /* 259 */ - { 6, 0, NULL, NULL }, /* 260 */ - { 6, 0, NULL, NULL }, /* 261 */ - { 6, 0, NULL, NULL }, /* 262 */ - { 6, 0, NULL, NULL }, /* 263 */ - { 6, 0, NULL, NULL }, /* 264 */ - { 6, 0, NULL, NULL }, /* 265 */ - { 6, 0, NULL, NULL }, /* 266 */ - { 6, 0, NULL, NULL }, /* 267 */ - { 6, 0, NULL, NULL }, /* 268 */ - { 6, 0, NULL, NULL }, /* 269 */ - { 6, 0, NULL, NULL }, /* 270 */ - { 6, 0, NULL, NULL }, /* 271 */ - { 6, 0, NULL, NULL }, /* 272 */ - { 6, 0, NULL, NULL }, /* 273 */ - { 6, 0, NULL, NULL }, /* 274 */ - { 6, 0, NULL, NULL }, /* 275 */ - { 6, 0, NULL, NULL }, /* 276 */ - { 6, 0, NULL, NULL }, /* 277 */ - { 6, 0, NULL, NULL }, /* 278 */ - { 6, 0, NULL, NULL }, /* 279 */ - { 6, 0, NULL, NULL }, /* 280 */ - { 6, 0, NULL, NULL }, /* 281 */ - { 6, 0, NULL, NULL }, /* 282 */ - { 6, 0, NULL, NULL }, /* 283 */ - { 6, 0, NULL, NULL }, /* 284 */ - { 6, 0, NULL, NULL }, /* 285 */ - { 6, 0, NULL, NULL }, /* 286 */ - { 6, 0, NULL, NULL }, /* 287 */ - { 6, 0, NULL, NULL }, /* 288 */ - { 6, 0, NULL, NULL }, /* 289 */ - { 6, 0, NULL, NULL }, /* 290 */ - { 6, 0, NULL, NULL }, /* 291 */ - { 6, 0, NULL, NULL }, /* 292 */ - { 6, 0, NULL, NULL }, /* 293 */ - { 6, 0, NULL, NULL }, /* 294 */ - { 6, 0, NULL, NULL }, /* 295 */ - { 6, 0, NULL, NULL }, /* 296 */ - { 6, 0, NULL, NULL }, /* 297 */ - { 6, 0, NULL, NULL }, /* 298 */ - { 6, 0, NULL, NULL }, /* 299 */ - - { 6, 0, solaris_getpgrp, "getpgrp" }, /* 300 */ - { 6, 0, solaris_setpgrp, "setpgrp" }, /* 301 */ - { 6, 0, solaris_getsid, "getsid" }, /* 302 */ - { 6, 0, solaris_setsid, "setsid" }, /* 303 */ - { 6, 0, solaris_getpgid, "getpgid" }, /* 304 */ - { 6, 0, solaris_setpgid, "setpgid" }, /* 305 */ - { 6, 0, NULL, NULL }, /* 306 */ - { 6, 0, NULL, NULL }, /* 307 */ - { 6, 0, NULL, NULL }, /* 308 */ - { 6, 0, NULL, NULL }, /* 309 */ - - { 6, TS, solaris_signal, "signal" }, /* 310 */ - { 6, TS, solaris_sigset, "sigset" }, /* 311 */ - { 6, TS, solaris_sighold, "sighold" }, /* 312 */ - { 6, TS, solaris_sigrelse, "sigrelse" }, /* 313 */ - { 6, TS, solaris_sigignore, "sigignore" }, /* 314 */ - { 6, TS, solaris_sigpause, "sigpause" }, /* 315 */ - { 6, 0, NULL, NULL }, /* 316 */ - { 6, 0, NULL, NULL }, /* 317 */ - { 6, 0, NULL, NULL }, /* 318 */ - { 6, 0, NULL, NULL }, /* 319 */ - - { 6, TI, solaris_msgget, "msgget" }, /* 320 */ - { 6, TI, solaris_msgctl, "msgctl" }, /* 321 */ - { 6, TI, solaris_msgrcv, "msgrcv" }, /* 322 */ - { 6, TI, solaris_msgsnd, "msgsnd" }, /* 323 */ - { 6, 0, NULL, NULL }, /* 324 */ - { 6, 0, NULL, NULL }, /* 325 */ - { 6, 0, NULL, NULL }, /* 326 */ - { 6, 0, NULL, NULL }, /* 327 */ - { 6, 0, NULL, NULL }, /* 328 */ - { 6, 0, NULL, NULL }, /* 329 */ - - { 6, TI|TM, solaris_shmat, "shmat" }, /* 330 */ - { 6, TI, solaris_shmctl, "shmctl" }, /* 331 */ - { 6, TI|TM, solaris_shmdt, "shmdt" }, /* 332 */ - { 6, TI, solaris_shmget, "shmget" }, /* 333 */ - { 6, 0, NULL, NULL }, /* 334 */ - { 6, 0, NULL, NULL }, /* 335 */ - { 6, 0, NULL, NULL }, /* 336 */ - { 6, 0, NULL, NULL }, /* 337 */ - { 6, 0, NULL, NULL }, /* 338 */ - { 6, 0, NULL, NULL }, /* 339 */ - - { 6, TI, solaris_semctl, "semctl" }, /* 340 */ - { 6, TI, solaris_semget, "semget" }, /* 341 */ - { 6, TI, solaris_semop, "semop" }, /* 342 */ - { 6, 0, NULL, NULL }, /* 343 */ - { 6, 0, NULL, NULL }, /* 344 */ - { 6, 0, NULL, NULL }, /* 345 */ - { 6, 0, NULL, NULL }, /* 346 */ - { 6, 0, NULL, NULL }, /* 347 */ - { 6, 0, NULL, NULL }, /* 348 */ - { 6, 0, NULL, NULL }, /* 349 */ - - { 6, 0, solaris_olduname, "olduname" }, /* 350 */ - { 6, 0, printargs, "utssys1" }, /* 351 */ - { 6, 0, solaris_ustat, "ustat" }, /* 352 */ - { 6, 0, solaris_fusers, "fusers" }, /* 353 */ - { 6, 0, NULL, NULL }, /* 354 */ - { 6, 0, NULL, NULL }, /* 355 */ - { 6, 0, NULL, NULL }, /* 356 */ - { 6, 0, NULL, NULL }, /* 357 */ - { 6, 0, NULL, NULL }, /* 358 */ - { 6, 0, NULL, NULL }, /* 359 */ - - { 6, 0, printargs, "sysfs0" }, /* 360 */ - { 6, 0, solaris_sysfs1, "sysfs1" }, /* 361 */ - { 6, 0, solaris_sysfs2, "sysfs2" }, /* 362 */ - { 6, 0, solaris_sysfs3, "sysfs3" }, /* 363 */ - { 6, 0, NULL, NULL }, /* 364 */ - { 6, 0, NULL, NULL }, /* 365 */ - { 6, 0, NULL, NULL }, /* 366 */ - { 6, 0, NULL, NULL }, /* 367 */ - { 6, 0, NULL, NULL }, /* 368 */ - { 6, 0, NULL, NULL }, /* 369 */ - - { 6, 0, printargs, "spcall0" }, /* 370 */ - { 6, TS, solaris_sigpending, "sigpending" }, /* 371 */ - { 6, TS, solaris_sigfillset, "sigfillset" }, /* 372 */ - { 6, 0, NULL, NULL }, /* 373 */ - { 6, 0, NULL, NULL }, /* 374 */ - { 6, 0, NULL, NULL }, /* 375 */ - { 6, 0, NULL, NULL }, /* 376 */ - { 6, 0, NULL, NULL }, /* 377 */ - { 6, 0, NULL, NULL }, /* 378 */ - { 6, 0, NULL, NULL }, /* 379 */ - - { 6, 0, solaris_getcontext, "getcontext" }, /* 380 */ - { 6, 0, solaris_setcontext, "setcontext" }, /* 381 */ - { 6, 0, NULL, NULL }, /* 382 */ - { 6, 0, NULL, NULL }, /* 383 */ - { 6, 0, NULL, NULL }, /* 384 */ - { 6, 0, NULL, NULL }, /* 385 */ - { 6, 0, NULL, NULL }, /* 386 */ - { 6, 0, NULL, NULL }, /* 387 */ - { 6, 0, NULL, NULL }, /* 388 */ - { 6, 0, NULL, NULL }, /* 389 */ - - { 6, 0, NULL, NULL }, /* 390 */ - { 6, 0, NULL, NULL }, /* 391 */ - { 6, 0, NULL, NULL }, /* 392 */ - { 6, 0, NULL, NULL }, /* 393 */ - { 6, 0, NULL, NULL }, /* 394 */ - { 6, 0, NULL, NULL }, /* 395 */ - { 6, 0, NULL, NULL }, /* 396 */ - { 6, 0, NULL, NULL }, /* 397 */ - { 6, 0, NULL, NULL }, /* 398 */ - { 6, 0, NULL, NULL }, /* 399 */ diff --git a/linux/sparc/userent.h b/linux/sparc/userent.h new file mode 100644 index 00000000..f842946b --- /dev/null +++ b/linux/sparc/userent.h @@ -0,0 +1 @@ +#include "../userent0.h" diff --git a/linux/sparc64/arch_getrval2.c b/linux/sparc64/arch_getrval2.c new file mode 100644 index 00000000..81f15562 --- /dev/null +++ b/linux/sparc64/arch_getrval2.c @@ -0,0 +1 @@ +#include "sparc/arch_getrval2.c" diff --git a/linux/sparc64/arch_regs.c b/linux/sparc64/arch_regs.c new file mode 100644 index 00000000..c1c2fae2 --- /dev/null +++ b/linux/sparc64/arch_regs.c @@ -0,0 +1,3 @@ +#include "sparc/arch_regs.c" +#undef ARCH_PC_REG +#define ARCH_PC_REG sparc_regs.tpc diff --git a/linux/sparc64/arch_regs.h b/linux/sparc64/arch_regs.h new file mode 100644 index 00000000..a49ad539 --- /dev/null +++ b/linux/sparc64/arch_regs.h @@ -0,0 +1 @@ +#include "sparc/arch_regs.h" diff --git a/linux/sparc64/arch_sigreturn.c b/linux/sparc64/arch_sigreturn.c new file mode 100644 index 00000000..feac9da6 --- /dev/null +++ b/linux/sparc64/arch_sigreturn.c @@ -0,0 +1,19 @@ +#define arch_sigreturn sparc64_arch_sigreturn +#include "sparc/arch_sigreturn.c" +#undef arch_sigreturn + +#define SIZEOF_STRUCT_SPARC_STACKF sizeof(struct sparc_stackf32) +#define SIZEOF_STRUCT_PT_REGS sizeof(struct pt_regs32) +#define PERSONALITY_WORDSIZE PERSONALITY1_WORDSIZE +#define arch_sigreturn sparc32_arch_sigreturn +#include "sparc/arch_sigreturn.c" +#undef arch_sigreturn + +static void +arch_sigreturn(struct tcb *tcp) +{ + if (current_personality == 1) + sparc32_arch_sigreturn(tcp); + else + sparc64_arch_sigreturn(tcp); +} diff --git a/linux/sparc64/dummy2.h b/linux/sparc64/dummy2.h deleted file mode 100644 index 39552a27..00000000 --- a/linux/sparc64/dummy2.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995 Rick Sladkey - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* still unfinished */ - -#define solaris_sysmp printargs -#define solaris_sginap printargs -#define solaris_sgikopt printargs -#define solaris_sysmips printargs -#define solaris_sigreturn printargs -#define solaris_recvmsg printargs -#define solaris_sendmsg printargs -#define solaris_nfssvc printargs -#define solaris_getfh printargs -#define solaris_async_daemon printargs -#define solaris_exportfs printargs -#define solaris_BSD_getime printargs -#define solaris_sproc printargs -#define solaris_procblk printargs -#define solaris_sprocsp printargs -#define solaris_msync printargs -#define solaris_madvise printargs -#define solaris_pagelock printargs -#define solaris_quotactl printargs -#define solaris_cacheflush printargs -#define solaris_cachectl printargs -#define solaris_nuname printargs -#define solaris_sigpoll printargs -#define solaris_swapctl printargs -#define solaris_sigstack printargs -#define solaris_sigsendset printargs -#define solaris_priocntl printargs -#define solaris_ksigqueue printargs -#define solaris_lwp_sema_wait printargs -#define solaris_memcntl printargs -#define solaris_syscall printargs -#define solaris_clocal printargs -#define solaris_syssun printargs -#define solaris_sysi86 printargs -#define solaris_sysmachine printargs -#define solaris_plock printargs -#define solaris_pathconf printargs -#define solaris_sigtimedwait printargs -#define solaris_ulimit printargs -#define solaris_ptrace printargs -#define solaris_stty printargs -#define solaris_lwp_info printargs -#define solaris_priocntlsys printargs -#define solaris_hrtsys printargs -#define solaris_xenix printargs -#define solaris_statfs printargs -#define solaris_fstatfs printargs -#define solaris_statvfs printargs -#define solaris_fstatvfs printargs -#define solaris_fork1 printargs -#define solaris_sigsendsys printargs -#define solaris_gtty printargs -#define solaris_vtrace printargs -#define solaris_fpathconf printargs -#define solaris_evsys printargs -#define solaris_acct printargs -#define solaris_exec printargs -#define solaris_lwp_sema_post printargs -#define solaris_nfssys printargs -#define solaris_sigaltstack printargs -#define solaris_uadmin printargs -#define solaris_umount printargs -#define solaris_modctl printargs -#define solaris_acancel printargs -#define solaris_async printargs -#define solaris_evtrapret printargs -#define solaris_lwp_create printargs -#define solaris_lwp_exit printargs -#define solaris_lwp_suspend printargs -#define solaris_lwp_continue printargs -#define solaris_lwp_kill printargs -#define solaris_lwp_self printargs -#define solaris_lwp_setprivate printargs -#define solaris_lwp_getprivate printargs -#define solaris_lwp_wait printargs -#define solaris_lwp_mutex_unlock printargs -#define solaris_lwp_mutex_lock printargs -#define solaris_lwp_cond_wait printargs -#define solaris_lwp_cond_signal printargs -#define solaris_lwp_cond_broadcast printargs -#define solaris_llseek printargs -#define solaris_inst_sync printargs -#define solaris_auditsys printargs -#define solaris_processor_bind printargs -#define solaris_processor_info printargs -#define solaris_p_online printargs -#define solaris_sigqueue printargs -#define solaris_clock_gettime printargs -#define solaris_clock_settime printargs -#define solaris_clock_getres printargs -#define solaris_nanosleep printargs -#define solaris_timer_create printargs -#define solaris_timer_delete printargs -#define solaris_timer_settime printargs -#define solaris_timer_gettime printargs -#define solaris_timer_getoverrun printargs -#define solaris_signal printargs -#define solaris_sigset printargs -#define solaris_sighold printargs -#define solaris_sigrelse printargs -#define solaris_sigignore printargs -#define solaris_sigpause printargs -#define solaris_msgctl printargs -#define solaris_msgget printargs -#define solaris_msgrcv printargs -#define solaris_msgsnd printargs -#define solaris_shmat printargs -#define solaris_shmctl printargs -#define solaris_shmdt printargs -#define solaris_shmget printargs -#define solaris_semctl printargs -#define solaris_semget printargs -#define solaris_semop printargs -#define solaris_olduname printargs -#define solaris_ustat printargs -#define solaris_fusers printargs -#define solaris_sysfs1 printargs -#define solaris_sysfs2 printargs -#define solaris_sysfs3 printargs - -/* like another call */ -#define solaris_lchown solaris_chown -#define solaris_setuid solaris_close -#define solaris_seteuid solaris_close -#define solaris_setgid solaris_close -#define solaris_setegid solaris_close -#define solaris_vhangup solaris_close -#define solaris_fdsync solaris_close -#define solaris_sigfillset solaris_sigpending -#define solaris_vfork solaris_fork -#define solaris_ksigaction solaris_sigaction -#define solaris_BSDgetpgrp solaris_getpgrp -#define solaris_BSDsetpgrp solaris_setpgrp -#define solaris_waitsys solaris_waitid - -/* printargs does the right thing */ -#define solaris_sync printargs -#define solaris_profil printargs -#define solaris_yield printargs -#define solaris_pause printargs -#define solaris_sethostid printargs - -/* subfunction entry points */ -#define solaris_pgrpsys printargs -#define solaris_sigcall printargs -#define solaris_msgsys printargs -#define solaris_shmsys printargs -#define solaris_semsys printargs -#define solaris_utssys printargs -#define solaris_sysfs printargs -#define solaris_spcall printargs -#define solaris_context printargs - -/* same as linux */ -#define solaris_exit sys_exit -#define solaris_fork sys_fork -#define solaris_read sys_read -#define solaris_write sys_write -#define solaris_close sys_close -#define solaris_creat sys_creat -#define solaris_link sys_link -#define solaris_unlink sys_unlink -#define solaris_chdir sys_chdir -#define solaris_time sys_time -#define solaris_chmod sys_chmod -#define solaris_lseek sys_lseek -#define solaris_stime sys_stime -#define solaris_alarm sys_alarm -#define solaris_utime sys_utime -#define solaris_access sys_access -#define solaris_nice sys_nice -#define solaris_dup sys_dup -#define solaris_pipe sys_pipe -#define solaris_times sys_times -#define solaris_execve sys_execve -#define solaris_umask sys_umask -#define solaris_chroot sys_chroot -#define solaris_rmdir sys_rmdir -#define solaris_mkdir sys_mkdir -#define solaris_getdents sys_getdents -#define solaris_poll sys_poll -#define solaris_symlink sys_symlink -#define solaris_readlink sys_readlink -#define solaris_setgroups sys_setgroups -#define solaris_getgroups sys_getgroups -#define solaris_fchmod sys_fchmod -#define solaris_fchown sys_fchown -#define solaris_mprotect sys_mprotect -#define solaris_munmap sys_munmap -#define solaris_readv sys_readv -#define solaris_writev sys_writev -#define solaris_chown sys_chown -#define solaris_rename sys_rename -#define solaris_gettimeofday sys_gettimeofday -#define solaris_getitimer sys_getitimer -#define solaris_setitimer sys_setitimer -#define solaris_brk sys_brk -#define solaris_mmap sys_mmap -#define solaris_getsid sys_getsid -#define solaris_setsid sys_setsid -#define solaris_getpgid sys_getpgid -#define solaris_setpgid sys_setpgid -#define solaris_getpgrp sys_getpgrp - -/* These are handled according to current_personality */ -#define solaris_xstat sys_xstat -#define solaris_fxstat sys_fxstat -#define solaris_lxstat sys_lxstat -#define solaris_xmknod sys_xmknod -#define solaris_stat sys_stat -#define solaris_fstat sys_fstat -#define solaris_lstat sys_lstat -#define solaris_pread sys_pread -#define solaris_pwrite sys_pwrite -#define solaris_ioctl sys_ioctl -#define solaris_mknod sys_mknod - -/* To be done */ -#define solaris_mount printargs -#define solaris_sysinfo printargs -#define solaris_sysconfig printargs -#define solaris_getpmsg printargs -#define solaris_putpmsg printargs -#define solaris_wait printargs -#define solaris_waitid printargs -#define solaris_sigsuspend printargs -#define solaris_setpgrp printargs -#define solaris_getcontext printargs -#define solaris_setcontext printargs -#define solaris_getpid printargs -#define solaris_getuid printargs -#define solaris_kill printargs -#define solaris_getgid printargs -#define solaris_fcntl printargs -#define solaris_getmsg printargs -#define solaris_putmsg printargs -#define solaris_sigprocmask printargs -#define solaris_sigaction printargs -#define solaris_sigpending printargs -#define solaris_mincore printargs -#define solaris_fchdir printargs -#define solaris_setrlimit printargs -#define solaris_getrlimit printargs -#define solaris_uname printargs -#define solaris_adjtime printargs -#define solaris_fchroot printargs -#define solaris_utimes printargs diff --git a/linux/sparc64/errnoent.h b/linux/sparc64/errnoent.h index d2436998..4ac2b730 100644 --- a/linux/sparc64/errnoent.h +++ b/linux/sparc64/errnoent.h @@ -1,127 +1 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EAGAIN", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "EWOULDBLOCK", /* 35 */ - "EINPROGRESS", /* 36 */ - "EALREADY", /* 37 */ - "ENOTSOCK", /* 38 */ - "EDESTADDRREQ", /* 39 */ - "EMSGSIZE", /* 40 */ - "EPROTOTYPE", /* 41 */ - "ENOPROTOOPT", /* 42 */ - "EPROTONOSUPPORT", /* 43 */ - "ESOCKTNOSUPPORT", /* 44 */ - "EOPNOTSUPP", /* 45 */ - "EPFNOSUPPORT", /* 46 */ - "EAFNOSUPPORT", /* 47 */ - "EADDRINUSE", /* 48 */ - "EADDRNOTAVAIL", /* 49 */ - "ENETDOWN", /* 50 */ - "ENETUNREACH", /* 51 */ - "ENETRESET", /* 52 */ - "ECONNABORTED", /* 53 */ - "ECONNRESET", /* 54 */ - "ENOBUFS", /* 55 */ - "EISCONN", /* 56 */ - "ENOTCONN", /* 57 */ - "ESHUTDOWN", /* 58 */ - "ETOOMANYREFS", /* 59 */ - "ETIMEDOUT", /* 60 */ - "ECONNREFUSED", /* 61 */ - "ELOOP", /* 62 */ - "ENAMETOOLONG", /* 63 */ - "EHOSTDOWN", /* 64 */ - "EHOSTUNREACH", /* 65 */ - "ENOTEMPTY", /* 66 */ - "EPROCLIM", /* 67 */ - "EUSERS", /* 68 */ - "EDQUOT", /* 69 */ - "ESTALE", /* 70 */ - "EREMOTE", /* 71 */ - "ENOSTR", /* 72 */ - "ETIME", /* 73 */ - "ENOSR", /* 74 */ - "ENOMSG", /* 75 */ - "EBADMSG", /* 76 */ - "EIDRM", /* 77 */ - "EDEADLK", /* 78 */ - "ENOLCK", /* 79 */ - "ENONET", /* 80 */ - "ERREMOTE", /* 81 */ - "ENOLINK", /* 82 */ - "EADV", /* 83 */ - "ESRMNT", /* 84 */ - "ECOMM", /* 85 */ - "EPROTO", /* 86 */ - "EMULTIHOP", /* 87 */ - "EDOTDOT", /* 88 */ - "EREMCHG", /* 89 */ - "ENOSYS", /* 90 */ - "ESTRPIPE", /* 91 */ - "EOVERFLOW", /* 92 */ - "EBADFD", /* 93 */ - "ECHRNG", /* 94 */ - "EL2NSYNC", /* 95 */ - "EL3HLT", /* 96 */ - "EL3RST", /* 97 */ - "ELNRNG", /* 98 */ - "EUNATCH", /* 99 */ - "ENOCSI", /* 100 */ - "EL2HLT", /* 101 */ - "EBADE", /* 102 */ - "EBADR", /* 103 */ - "EXFULL", /* 104 */ - "ENOANO", /* 105 */ - "EBADRQC", /* 106 */ - "EBADSLT", /* 107 */ - "EDEADLOCK", /* 108 */ - "EBFONT", /* 109 */ - "ELIBEXEC", /* 110 */ - "ENODATA", /* 111 */ - "ELIBBAD", /* 112 */ - "ENOPKG", /* 113 */ - "ELIBACC", /* 114 */ - "ENOTUNIQ", /* 115 */ - "ERESTART", /* 116 */ - "EUCLEAN", /* 117 */ - "ENOTNAM", /* 118 */ - "ENAVAIL", /* 119 */ - "EISNAM", /* 120 */ - "EREMOTEIO", /* 121 */ - "EILSEQ", /* 122 */ - "ELIBMAX", /* 123 */ - "ELIBSCN", /* 124 */ - "ENOMEDIUM", /* 125 */ - "EMEDIUMTYPE", /* 126 */ +#include "sparc/errnoent.h" diff --git a/linux/sparc64/errnoent1.h b/linux/sparc64/errnoent1.h index c1eaac67..c0f7787d 100644 --- a/linux/sparc64/errnoent1.h +++ b/linux/sparc64/errnoent1.h @@ -1 +1 @@ -#include "../sparc/errnoent1.h" +#include "errnoent.h" diff --git a/linux/sparc64/errnoent2.h b/linux/sparc64/errnoent2.h deleted file mode 100644 index d2436998..00000000 --- a/linux/sparc64/errnoent2.h +++ /dev/null @@ -1,127 +0,0 @@ - "ERRNO_0", /* 0 */ - "EPERM", /* 1 */ - "ENOENT", /* 2 */ - "ESRCH", /* 3 */ - "EINTR", /* 4 */ - "EIO", /* 5 */ - "ENXIO", /* 6 */ - "E2BIG", /* 7 */ - "ENOEXEC", /* 8 */ - "EBADF", /* 9 */ - "ECHILD", /* 10 */ - "EAGAIN", /* 11 */ - "ENOMEM", /* 12 */ - "EACCES", /* 13 */ - "EFAULT", /* 14 */ - "ENOTBLK", /* 15 */ - "EBUSY", /* 16 */ - "EEXIST", /* 17 */ - "EXDEV", /* 18 */ - "ENODEV", /* 19 */ - "ENOTDIR", /* 20 */ - "EISDIR", /* 21 */ - "EINVAL", /* 22 */ - "ENFILE", /* 23 */ - "EMFILE", /* 24 */ - "ENOTTY", /* 25 */ - "ETXTBSY", /* 26 */ - "EFBIG", /* 27 */ - "ENOSPC", /* 28 */ - "ESPIPE", /* 29 */ - "EROFS", /* 30 */ - "EMLINK", /* 31 */ - "EPIPE", /* 32 */ - "EDOM", /* 33 */ - "ERANGE", /* 34 */ - "EWOULDBLOCK", /* 35 */ - "EINPROGRESS", /* 36 */ - "EALREADY", /* 37 */ - "ENOTSOCK", /* 38 */ - "EDESTADDRREQ", /* 39 */ - "EMSGSIZE", /* 40 */ - "EPROTOTYPE", /* 41 */ - "ENOPROTOOPT", /* 42 */ - "EPROTONOSUPPORT", /* 43 */ - "ESOCKTNOSUPPORT", /* 44 */ - "EOPNOTSUPP", /* 45 */ - "EPFNOSUPPORT", /* 46 */ - "EAFNOSUPPORT", /* 47 */ - "EADDRINUSE", /* 48 */ - "EADDRNOTAVAIL", /* 49 */ - "ENETDOWN", /* 50 */ - "ENETUNREACH", /* 51 */ - "ENETRESET", /* 52 */ - "ECONNABORTED", /* 53 */ - "ECONNRESET", /* 54 */ - "ENOBUFS", /* 55 */ - "EISCONN", /* 56 */ - "ENOTCONN", /* 57 */ - "ESHUTDOWN", /* 58 */ - "ETOOMANYREFS", /* 59 */ - "ETIMEDOUT", /* 60 */ - "ECONNREFUSED", /* 61 */ - "ELOOP", /* 62 */ - "ENAMETOOLONG", /* 63 */ - "EHOSTDOWN", /* 64 */ - "EHOSTUNREACH", /* 65 */ - "ENOTEMPTY", /* 66 */ - "EPROCLIM", /* 67 */ - "EUSERS", /* 68 */ - "EDQUOT", /* 69 */ - "ESTALE", /* 70 */ - "EREMOTE", /* 71 */ - "ENOSTR", /* 72 */ - "ETIME", /* 73 */ - "ENOSR", /* 74 */ - "ENOMSG", /* 75 */ - "EBADMSG", /* 76 */ - "EIDRM", /* 77 */ - "EDEADLK", /* 78 */ - "ENOLCK", /* 79 */ - "ENONET", /* 80 */ - "ERREMOTE", /* 81 */ - "ENOLINK", /* 82 */ - "EADV", /* 83 */ - "ESRMNT", /* 84 */ - "ECOMM", /* 85 */ - "EPROTO", /* 86 */ - "EMULTIHOP", /* 87 */ - "EDOTDOT", /* 88 */ - "EREMCHG", /* 89 */ - "ENOSYS", /* 90 */ - "ESTRPIPE", /* 91 */ - "EOVERFLOW", /* 92 */ - "EBADFD", /* 93 */ - "ECHRNG", /* 94 */ - "EL2NSYNC", /* 95 */ - "EL3HLT", /* 96 */ - "EL3RST", /* 97 */ - "ELNRNG", /* 98 */ - "EUNATCH", /* 99 */ - "ENOCSI", /* 100 */ - "EL2HLT", /* 101 */ - "EBADE", /* 102 */ - "EBADR", /* 103 */ - "EXFULL", /* 104 */ - "ENOANO", /* 105 */ - "EBADRQC", /* 106 */ - "EBADSLT", /* 107 */ - "EDEADLOCK", /* 108 */ - "EBFONT", /* 109 */ - "ELIBEXEC", /* 110 */ - "ENODATA", /* 111 */ - "ELIBBAD", /* 112 */ - "ENOPKG", /* 113 */ - "ELIBACC", /* 114 */ - "ENOTUNIQ", /* 115 */ - "ERESTART", /* 116 */ - "EUCLEAN", /* 117 */ - "ENOTNAM", /* 118 */ - "ENAVAIL", /* 119 */ - "EISNAM", /* 120 */ - "EREMOTEIO", /* 121 */ - "EILSEQ", /* 122 */ - "ELIBMAX", /* 123 */ - "ELIBSCN", /* 124 */ - "ENOMEDIUM", /* 125 */ - "EMEDIUMTYPE", /* 126 */ diff --git a/linux/sparc64/get_error.c b/linux/sparc64/get_error.c new file mode 100644 index 00000000..8f8978b6 --- /dev/null +++ b/linux/sparc64/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (sparc_regs.tstate & 0x1100000000UL) { + tcp->u_rval = -1; + tcp->u_error = sparc_regs.u_regs[U_REG_O0]; + } else { + tcp->u_rval = sparc_regs.u_regs[U_REG_O0]; + } +} diff --git a/linux/sparc64/get_scno.c b/linux/sparc64/get_scno.c new file mode 100644 index 00000000..4abe2a1f --- /dev/null +++ b/linux/sparc64/get_scno.c @@ -0,0 +1,25 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + /* Retrieve the syscall trap instruction. */ + unsigned long trap; + errno = 0; + trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *) sparc_regs.tpc, 0); + if (errno) + return -1; + trap >>= 32; + switch (trap) { + case 0x91d02010: + /* Linux/SPARC syscall trap. */ + update_personality(tcp, 1); + break; + case 0x91d0206d: + /* Linux/SPARC64 syscall trap. */ + update_personality(tcp, 0); + break; + } + + tcp->scno = sparc_regs.u_regs[U_REG_G1]; + return 1; +} diff --git a/linux/sparc64/get_syscall_args.c b/linux/sparc64/get_syscall_args.c new file mode 100644 index 00000000..f5c1aa6f --- /dev/null +++ b/linux/sparc64/get_syscall_args.c @@ -0,0 +1,28 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + if (tcp->currpers == 1) { + /* + * Zero-extend from 32 bits. + * Use truncate_klong_to_current_wordsize(tcp->u_arg[N]) + * in syscall handlers + * if you need to use *sign-extended* parameter. + */ + tcp->u_arg[0] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 0]; + tcp->u_arg[1] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 1]; + tcp->u_arg[2] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 2]; + tcp->u_arg[3] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 3]; + tcp->u_arg[4] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 4]; + tcp->u_arg[5] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 5]; + } else { + tcp->u_arg[0] = sparc_regs.u_regs[U_REG_O0 + 0]; + tcp->u_arg[1] = sparc_regs.u_regs[U_REG_O0 + 1]; + tcp->u_arg[2] = sparc_regs.u_regs[U_REG_O0 + 2]; + tcp->u_arg[3] = sparc_regs.u_regs[U_REG_O0 + 3]; + tcp->u_arg[4] = sparc_regs.u_regs[U_REG_O0 + 4]; + tcp->u_arg[5] = sparc_regs.u_regs[U_REG_O0 + 5]; + } + + return 1; +} diff --git a/linux/sparc64/ioctlent.h.in b/linux/sparc64/ioctlent.h.in deleted file mode 100644 index 4bc5cfd1..00000000 --- a/linux/sparc64/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../sparc/ioctlent.h.in" diff --git a/linux/sparc64/ioctlent1.h b/linux/sparc64/ioctlent1.h deleted file mode 100644 index c572f6e7..00000000 --- a/linux/sparc64/ioctlent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "../sparc/ioctlent1.h" diff --git a/linux/sparc64/ioctlent2.h b/linux/sparc64/ioctlent2.h deleted file mode 100644 index c1d6b8a4..00000000 --- a/linux/sparc64/ioctlent2.h +++ /dev/null @@ -1,838 +0,0 @@ - {"linux/fs.h", "FIBMAP", 0x1}, - {"linux/fs.h", "FIGETBSZ", 0x2}, - {"linux/fd.h", "FDGETPRM", 0x204}, - {"linux/fd.h", "FDGETMAXERRS", 0x20e}, - {"linux/fd.h", "FDGETDRVTYP", 0x20f}, - {"linux/fd.h", "FDGETDRVPRM", 0x211}, - {"linux/fd.h", "FDGETDRVSTAT", 0x212}, - {"linux/fd.h", "FDPOLLDRVSTAT", 0x213}, - {"linux/fd.h", "FDGETFDCSTAT", 0x215}, - {"linux/fd.h", "FDWERRORGET", 0x217}, - {"linux/fd.h", "FDCLRPRM", 0x241}, - {"linux/fd.h", "FDSETPRM", 0x242}, - {"linux/fd.h", "FDDEFPRM", 0x243}, - {"linux/fd.h", "FDMSGON", 0x245}, - {"linux/fd.h", "FDMSGOFF", 0x246}, - {"linux/fd.h", "FDFMTBEG", 0x247}, - {"linux/fd.h", "FDFMTTRK", 0x248}, - {"linux/fd.h", "FDFMTEND", 0x249}, - {"linux/fd.h", "FDSETEMSGTRESH", 0x24a}, - {"linux/fd.h", "FDFLUSH", 0x24b}, - {"linux/fd.h", "FDSETMAXERRS", 0x24c}, - {"linux/fd.h", "FDRESET", 0x254}, - {"linux/fd.h", "FDWERRORCLR", 0x256}, - {"linux/fd.h", "FDRAWCMD", 0x258}, - {"linux/fd.h", "FDTWADDLE", 0x259}, - {"linux/fd.h", "FDEJECT", 0x25a}, - {"linux/fd.h", "FDSETDRVPRM", 0x290}, - {"linux/umsdos_fs.h", "UMSDOS_READDIR_DOS", 0x4d2}, - {"linux/umsdos_fs.h", "UMSDOS_UNLINK_DOS", 0x4d3}, - {"linux/umsdos_fs.h", "UMSDOS_RMDIR_DOS", 0x4d4}, - {"linux/umsdos_fs.h", "UMSDOS_STAT_DOS", 0x4d5}, - {"linux/umsdos_fs.h", "UMSDOS_CREAT_EMD", 0x4d6}, - {"linux/umsdos_fs.h", "UMSDOS_UNLINK_EMD", 0x4d7}, - {"linux/umsdos_fs.h", "UMSDOS_READDIR_EMD", 0x4d8}, - {"linux/umsdos_fs.h", "UMSDOS_GETVERSION", 0x4d9}, - {"linux/umsdos_fs.h", "UMSDOS_INIT_EMD", 0x4da}, - {"linux/umsdos_fs.h", "UMSDOS_DOS_SETUP", 0x4db}, - {"linux/umsdos_fs.h", "UMSDOS_RENAME_DOS", 0x4dc}, - {"linux/fs.h", "BLKROSET", 0x125d}, - {"linux/fs.h", "BLKROGET", 0x125e}, - {"linux/fs.h", "BLKRRPART", 0x125f}, - {"linux/fs.h", "BLKGETSIZE", 0x1260}, - {"linux/fs.h", "BLKFLSBUF", 0x1261}, - {"linux/fs.h", "BLKRASET", 0x1262}, - {"linux/fs.h", "BLKRAGET", 0x1263}, - {"linux/fs.h", "BLKFRASET", 0x1264}, - {"linux/fs.h", "BLKFRAGET", 0x1265}, - {"linux/fs.h", "BLKSECTSET", 0x1266}, - {"linux/fs.h", "BLKSECTGET", 0x1267}, - {"linux/fs.h", "BLKSSZGET", 0x1268}, - {"linux/blkpg.h", "BLKPG", 0x1269}, - {"linux/fs.h", "BLKPG", 0x1269}, - {"linux/elevator.h", "BLKELVGET", 0x126a}, - {"linux/fs.h", "BLKELVGET", 0x126a}, - {"linux/elevator.h", "BLKELVSET", 0x126b}, - {"linux/fs.h", "BLKELVSET", 0x126b}, - {"linux/fs.h", "BLKBSZGET", 0x1270}, - {"linux/fs.h", "BLKBSZSET", 0x1271}, - {"linux/fs.h", "BLKGETSIZE64", 0x1272}, - {"linux/agpgart.h", "AGPIOC_INFO", 0x4100}, - {"linux/agpgart.h", "AGPIOC_ACQUIRE", 0x4101}, - {"linux/apm_bios.h", "APM_IOC_STANDBY", 0x4101}, - {"linux/agpgart.h", "AGPIOC_RELEASE", 0x4102}, - {"linux/apm_bios.h", "APM_IOC_SUSPEND", 0x4102}, - {"linux/agpgart.h", "AGPIOC_SETUP", 0x4103}, - {"linux/agpgart.h", "AGPIOC_RESERVE", 0x4104}, - {"linux/agpgart.h", "AGPIOC_PROTECT", 0x4105}, - {"linux/agpgart.h", "AGPIOC_ALLOCATE", 0x4106}, - {"linux/agpgart.h", "AGPIOC_DEALLOCATE", 0x4107}, - {"linux/agpgart.h", "AGPIOC_BIND", 0x4108}, - {"linux/agpgart.h", "AGPIOC_UNBIND", 0x4109}, - {"linux/pmu.h", "PMU_IOC_SLEEP", 0x4200}, - {"linux/cciss_ioctl.h", "CCISS_GETPCIINFO", 0x4201}, - {"linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", 0x4201}, - {"linux/cciss_ioctl.h", "CCISS_GETINTINFO", 0x4202}, - {"linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", 0x4202}, - {"linux/cciss_ioctl.h", "CCISS_SETINTINFO", 0x4203}, - {"linux/pmu.h", "PMU_IOC_GET_MODEL", 0x4203}, - {"linux/cciss_ioctl.h", "CCISS_GETNODENAME", 0x4204}, - {"linux/pmu.h", "PMU_IOC_HAS_ADB", 0x4204}, - {"linux/cciss_ioctl.h", "CCISS_SETNODENAME", 0x4205}, - {"linux/pmu.h", "PMU_IOC_CAN_SLEEP", 0x4205}, - {"linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", 0x4206}, - {"linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", 0x4207}, - {"linux/cciss_ioctl.h", "CCISS_GETFIRMVER", 0x4208}, - {"linux/cciss_ioctl.h", "CCISS_GETDRIVVER", 0x4209}, - {"linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", 0x420a}, - {"linux/cciss_ioctl.h", "CCISS_PASSTHRU", 0x420b}, - {"linux/soundcard.h", "SNDCTL_COPR_RESET", 0x4300}, - {"linux/capi.h", "CAPI_REGISTER", 0x4301}, - {"linux/soundcard.h", "SNDCTL_COPR_LOAD", 0x4301}, - {"linux/soundcard.h", "SNDCTL_COPR_RDATA", 0x4302}, - {"linux/soundcard.h", "SNDCTL_COPR_RCODE", 0x4303}, - {"linux/soundcard.h", "SNDCTL_COPR_WDATA", 0x4304}, - {"linux/soundcard.h", "SNDCTL_COPR_WCODE", 0x4305}, - {"linux/capi.h", "CAPI_GET_MANUFACTURER", 0x4306}, - {"linux/soundcard.h", "SNDCTL_COPR_RUN", 0x4306}, - {"linux/capi.h", "CAPI_GET_VERSION", 0x4307}, - {"linux/soundcard.h", "SNDCTL_COPR_HALT", 0x4307}, - {"linux/capi.h", "CAPI_GET_SERIAL", 0x4308}, - {"linux/soundcard.h", "SNDCTL_COPR_SENDMSG", 0x4308}, - {"linux/capi.h", "CAPI_GET_PROFILE", 0x4309}, - {"linux/soundcard.h", "SNDCTL_COPR_RCVMSG", 0x4309}, - {"linux/capi.h", "CAPI_MANUFACTURER_CMD", 0x4320}, - {"linux/capi.h", "CAPI_GET_ERRCODE", 0x4321}, - {"linux/capi.h", "CAPI_INSTALLED", 0x4322}, - {"linux/capi.h", "CAPI_GET_FLAGS", 0x4323}, - {"linux/capi.h", "CAPI_SET_FLAGS", 0x4324}, - {"linux/capi.h", "CAPI_CLR_FLAGS", 0x4325}, - {"linux/capi.h", "CAPI_NCCI_OPENCOUNT", 0x4326}, - {"linux/capi.h", "CAPI_NCCI_GETUNIT", 0x4327}, - {"linux/input.h", "EVIOCGVERSION", 0x4501}, - {"linux/input.h", "EVIOCGID", 0x4502}, - {"linux/input.h", "EVIOCGREP", 0x4503}, - {"linux/input.h", "EVIOCSREP", 0x4503}, - {"linux/input.h", "EVIOCGKEYCODE", 0x4504}, - {"linux/input.h", "EVIOCSKEYCODE", 0x4504}, - {"linux/input.h", "EVIOCGKEY", 0x4505}, - {"linux/input.h", "EVIOCGBUS", 0x4507}, - {"linux/input.h", "EVIOCRMFF", 0x4581}, - {"linux/input.h", "EVIOCSGAIN", 0x4582}, - {"linux/input.h", "EVIOCSAUTOCENTER", 0x4583}, - {"linux/input.h", "EVIOCGEFFECTS", 0x4584}, - {"linux/fb.h", "FBIOGET_VBLANK", 0x4612}, - {"linux/hiddev.h", "HIDIOCGVERSION", 0x4801}, - {"linux/hiddev.h", "HIDIOCAPPLICATION", 0x4802}, - {"linux/hiddev.h", "HIDIOCGDEVINFO", 0x4803}, - {"linux/hiddev.h", "HIDIOCGSTRING", 0x4804}, - {"linux/hiddev.h", "HIDIOCINITREPORT", 0x4805}, - {"linux/hiddev.h", "HIDIOCGREPORT", 0x4807}, - {"linux/hiddev.h", "HIDIOCSREPORT", 0x4808}, - {"linux/hiddev.h", "HIDIOCGREPORTINFO", 0x4809}, - {"linux/hiddev.h", "HIDIOCGFIELDINFO", 0x480a}, - {"linux/hiddev.h", "HIDIOCGUSAGE", 0x480b}, - {"linux/hiddev.h", "HIDIOCSUSAGE", 0x480c}, - {"linux/hiddev.h", "HIDIOCGUCODE", 0x480d}, - {"linux/isdn.h", "IIOCNETAIF", 0x4901}, - {"linux/isdn.h", "IIOCNETDIF", 0x4902}, - {"linux/isdn.h", "IIOCNETSCF", 0x4903}, - {"linux/isdn.h", "IIOCNETGCF", 0x4904}, - {"linux/isdn.h", "IIOCNETANM", 0x4905}, - {"linux/isdn.h", "IIOCNETDNM", 0x4906}, - {"linux/isdn.h", "IIOCNETGNM", 0x4907}, - {"linux/isdn.h", "IIOCGETSET", 0x4908}, - {"linux/isdn.h", "IIOCSETSET", 0x4909}, - {"linux/isdn.h", "IIOCSETVER", 0x490a}, - {"linux/isdn.h", "IIOCNETHUP", 0x490b}, - {"linux/isdn.h", "IIOCSETGST", 0x490c}, - {"linux/isdn.h", "IIOCSETBRJ", 0x490d}, - {"linux/isdn.h", "IIOCSIGPRF", 0x490e}, - {"linux/isdn.h", "IIOCGETPRF", 0x490f}, - {"linux/isdn.h", "IIOCSETPRF", 0x4910}, - {"linux/isdn.h", "IIOCGETMAP", 0x4911}, - {"linux/isdn.h", "IIOCSETMAP", 0x4912}, - {"linux/isdn.h", "IIOCNETASL", 0x4913}, - {"linux/isdn.h", "IIOCNETDIL", 0x4914}, - {"linux/isdn.h", "IIOCGETCPS", 0x4915}, - {"linux/isdn.h", "IIOCGETDVR", 0x4916}, - {"linux/isdn.h", "IIOCNETLCR", 0x4917}, - {"linux/isdn.h", "IIOCNETDWRSET", 0x4918}, - {"linux/isdn.h", "IIOCNETALN", 0x4920}, - {"linux/isdn.h", "IIOCNETDLN", 0x4921}, - {"linux/isdn.h", "IIOCNETGPN", 0x4922}, - {"linux/isdn.h", "IIOCDBGVAR", 0x497f}, - {"linux/isdn.h", "IIOCDRVCTL", 0x4980}, - {"linux/soundcard.h", "SOUND_MIXER_INFO", 0x4d65}, - {"linux/soundcard.h", "SOUND_OLD_MIXER_INFO", 0x4d65}, - {"linux/soundcard.h", "SOUND_MIXER_ACCESS", 0x4d66}, - {"linux/soundcard.h", "SOUND_MIXER_AGC", 0x4d67}, - {"linux/soundcard.h", "SOUND_MIXER_3DSE", 0x4d68}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE1", 0x4d6f}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE2", 0x4d70}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE3", 0x4d71}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE4", 0x4d72}, - {"linux/soundcard.h", "SOUND_MIXER_PRIVATE5", 0x4d73}, - {"linux/soundcard.h", "SOUND_MIXER_GETLEVELS", 0x4d74}, - {"linux/soundcard.h", "SOUND_MIXER_SETLEVELS", 0x4d75}, - {"linux/soundcard.h", "OSS_GETVERSION", 0x4d76}, - {"linux/soundcard.h", "SNDCTL_DSP_RESET", 0x5000}, - {"linux/soundcard.h", "SNDCTL_DSP_SYNC", 0x5001}, - {"linux/soundcard.h", "SNDCTL_DSP_SPEED", 0x5002}, - {"linux/soundcard.h", "SOUND_PCM_READ_RATE", 0x5002}, - {"linux/soundcard.h", "SNDCTL_DSP_STEREO", 0x5003}, - {"linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", 0x5004}, - {"linux/soundcard.h", "SNDCTL_DSP_SETFMT", 0x5005}, - {"linux/soundcard.h", "SOUND_PCM_READ_BITS", 0x5005}, - {"linux/soundcard.h", "SNDCTL_DSP_CHANNELS", 0x5006}, - {"linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", 0x5006}, - {"linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", 0x5007}, - {"linux/soundcard.h", "SOUND_PCM_READ_FILTER", 0x5007}, - {"linux/soundcard.h", "SNDCTL_DSP_POST", 0x5008}, - {"linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", 0x5009}, - {"linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", 0x500a}, - {"linux/soundcard.h", "SNDCTL_DSP_GETFMTS", 0x500b}, - {"linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", 0x500c}, - {"linux/soundcard.h", "SNDCTL_DSP_GETISPACE", 0x500d}, - {"linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", 0x500e}, - {"linux/soundcard.h", "SNDCTL_DSP_GETCAPS", 0x500f}, - {"linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", 0x5010}, - {"linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", 0x5010}, - {"linux/soundcard.h", "SNDCTL_DSP_GETIPTR", 0x5011}, - {"linux/soundcard.h", "SNDCTL_DSP_GETOPTR", 0x5012}, - {"linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", 0x5013}, - {"linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", 0x5014}, - {"linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", 0x5015}, - {"linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", 0x5016}, - {"linux/soundcard.h", "SNDCTL_DSP_GETODELAY", 0x5017}, - {"linux/soundcard.h", "SNDCTL_DSP_PROFILE", 0x5017}, - {"linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", 0x5040}, - {"linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", 0x5041}, - {"linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", 0x5042}, - {"linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", 0x5043}, - {"linux/soundcard.h", "SNDCTL_SEQ_RESET", 0x5100}, - {"linux/soundcard.h", "SNDCTL_SEQ_SYNC", 0x5101}, - {"linux/soundcard.h", "SNDCTL_SYNTH_INFO", 0x5102}, - {"linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", 0x5103}, - {"linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", 0x5104}, - {"linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", 0x5105}, - {"linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", 0x5106}, - {"linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", 0x5107}, - {"linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", 0x5108}, - {"linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", 0x5109}, - {"linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", 0x510a}, - {"linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", 0x510b}, - {"linux/soundcard.h", "SNDCTL_MIDI_INFO", 0x510c}, - {"linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", 0x510d}, - {"linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", 0x510e}, - {"linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", 0x510f}, - {"linux/soundcard.h", "SNDCTL_SEQ_PANIC", 0x5111}, - {"linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", 0x5112}, - {"linux/soundcard.h", "SNDCTL_SEQ_GETTIME", 0x5113}, - {"linux/soundcard.h", "SNDCTL_SYNTH_ID", 0x5114}, - {"linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", 0x5115}, - {"linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", 0x5116}, - {"linux/random.h", "RNDGETENTCNT", 0x5200}, - {"linux/random.h", "RNDADDTOENTCNT", 0x5201}, - {"linux/random.h", "RNDGETPOOL", 0x5202}, - {"linux/random.h", "RNDADDENTROPY", 0x5203}, - {"linux/random.h", "RNDZAPENTCNT", 0x5204}, - {"linux/random.h", "RNDCLEARPOOL", 0x5206}, - {"asm/ioctls.h", "TCGETS", 0x5401}, - {"linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", 0x5401}, - {"asm/ioctls.h", "TCSETS", 0x5402}, - {"linux/soundcard.h", "SNDCTL_TMR_START", 0x5402}, - {"asm/ioctls.h", "TCSETSW", 0x5403}, - {"linux/soundcard.h", "SNDCTL_TMR_STOP", 0x5403}, - {"asm/ioctls.h", "TCSETSF", 0x5404}, - {"linux/soundcard.h", "SNDCTL_TMR_CONTINUE", 0x5404}, - {"asm/ioctls.h", "TCGETA", 0x5405}, - {"linux/soundcard.h", "SNDCTL_TMR_TEMPO", 0x5405}, - {"asm/ioctls.h", "TCSETA", 0x5406}, - {"linux/soundcard.h", "SNDCTL_TMR_SOURCE", 0x5406}, - {"asm/ioctls.h", "TCSETAW", 0x5407}, - {"linux/soundcard.h", "SNDCTL_TMR_METRONOME", 0x5407}, - {"asm/ioctls.h", "TCSETAF", 0x5408}, - {"linux/soundcard.h", "SNDCTL_TMR_SELECT", 0x5408}, - {"asm/ioctls.h", "TCSBRK", 0x5409}, - {"asm/ioctls.h", "TCXONC", 0x540a}, - {"asm/ioctls.h", "TCFLSH", 0x540b}, - {"asm/ioctls.h", "TIOCEXCL", 0x540c}, - {"asm/ioctls.h", "TIOCNXCL", 0x540d}, - {"asm/ioctls.h", "TIOCSCTTY", 0x540e}, - {"asm/ioctls.h", "TIOCGPGRP", 0x540f}, - {"asm/ioctls.h", "TIOCSPGRP", 0x5410}, - {"asm/ioctls.h", "TIOCOUTQ", 0x5411}, - {"asm/ioctls.h", "TIOCSTI", 0x5412}, - {"asm/ioctls.h", "TIOCGWINSZ", 0x5413}, - {"asm/ioctls.h", "TIOCSWINSZ", 0x5414}, - {"asm/ioctls.h", "TIOCMGET", 0x5415}, - {"asm/ioctls.h", "TIOCMBIS", 0x5416}, - {"asm/ioctls.h", "TIOCMBIC", 0x5417}, - {"asm/ioctls.h", "TIOCMSET", 0x5418}, - {"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, - {"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, - {"asm/ioctls.h", "FIONREAD", 0x541b}, - {"asm/ioctls.h", "TIOCLINUX", 0x541c}, - {"asm/ioctls.h", "TIOCCONS", 0x541d}, - {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, - {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, - {"asm/ioctls.h", "TIOCPKT", 0x5420}, - {"asm/ioctls.h", "FIONBIO", 0x5421}, - {"asm/ioctls.h", "TIOCNOTTY", 0x5422}, - {"asm/ioctls.h", "TIOCSETD", 0x5423}, - {"asm/ioctls.h", "TIOCGETD", 0x5424}, - {"asm/ioctls.h", "TCSBRKP", 0x5425}, - {"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426}, - {"asm/ioctls.h", "TIOCSBRK", 0x5427}, - {"asm/ioctls.h", "TIOCCBRK", 0x5428}, - {"asm/ioctls.h", "TIOCGSID", 0x5429}, - {"asm/ioctls.h", "TIOCGPTN", 0x5430}, - {"asm/ioctls.h", "TIOCSPTLCK", 0x5431}, - {"asm/ioctls.h", "FIONCLEX", 0x5450}, - {"asm/ioctls.h", "FIOCLEX", 0x5451}, - {"asm/ioctls.h", "FIOASYNC", 0x5452}, - {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, - {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, - {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, - {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, - {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, - {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, - {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, - {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, - {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, - {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, - {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, - {"asm/ioctls.h", "TIOCGHAYESESP", 0x545e}, - {"asm/ioctls.h", "TIOCSHAYESESP", 0x545f}, - {"linux/if_tun.h", "TUNSETNOCSUM", 0x54c8}, - {"linux/if_tun.h", "TUNSETDEBUG", 0x54c9}, - {"linux/if_tun.h", "TUNSETIFF", 0x54ca}, - {"linux/if_tun.h", "TUNSETPERSIST", 0x54cb}, - {"linux/if_tun.h", "TUNSETOWNER", 0x54cc}, - {"linux/usbdevice_fs.h", "USBDEVFS_CONTROL", 0x5500}, - {"linux/usbdevice_fs.h", "USBDEVFS_BULK", 0x5502}, - {"linux/usbdevice_fs.h", "USBDEVFS_RESETEP", 0x5503}, - {"linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", 0x5504}, - {"linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", 0x5505}, - {"linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", 0x5508}, - {"linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", 0x550a}, - {"linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", 0x550b}, - {"linux/usbdevice_fs.h", "USBDEVFS_REAPURB", 0x550c}, - {"linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", 0x550d}, - {"linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", 0x550e}, - {"linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", 0x550f}, - {"linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", 0x5510}, - {"linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", 0x5511}, - {"linux/usbdevice_fs.h", "USBDEVFS_IOCTL", 0x5512}, - {"linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", 0x5513}, - {"linux/usbdevice_fs.h", "USBDEVFS_RESET", 0x5514}, - {"linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", 0x5515}, - {"linux/watchdog.h", "WDIOC_GETSUPPORT", 0x5700}, - {"linux/watchdog.h", "WDIOC_GETSTATUS", 0x5701}, - {"linux/watchdog.h", "WDIOC_GETBOOTSTATUS", 0x5702}, - {"linux/watchdog.h", "WDIOC_GETTEMP", 0x5703}, - {"linux/watchdog.h", "WDIOC_SETOPTIONS", 0x5704}, - {"linux/watchdog.h", "WDIOC_KEEPALIVE", 0x5705}, - {"linux/watchdog.h", "WDIOC_SETTIMEOUT", 0x5706}, - {"linux/watchdog.h", "WDIOC_GETTIMEOUT", 0x5707}, - {"linux/ite_gpio.h", "ITE_GPIO_IN", 0x5a00}, - {"linux/ite_gpio.h", "ITE_GPIO_OUT", 0x5a01}, - {"linux/ite_gpio.h", "ITE_GPIO_INT_CTRL", 0x5a02}, - {"linux/ite_gpio.h", "ITE_GPIO_IN_STATUS", 0x5a03}, - {"linux/ite_gpio.h", "ITE_GPIO_OUT_STATUS", 0x5a04}, - {"linux/ite_gpio.h", "ITE_GPIO_GEN_CTRL", 0x5a05}, - {"linux/ite_gpio.h", "ITE_GPIO_INT_WAIT", 0x5a06}, - {"linux/sonet.h", "SONET_GETSTAT", 0x6110}, - {"linux/sonet.h", "SONET_GETSTATZ", 0x6111}, - {"linux/sonet.h", "SONET_SETDIAG", 0x6112}, - {"linux/sonet.h", "SONET_CLRDIAG", 0x6113}, - {"linux/sonet.h", "SONET_GETDIAG", 0x6114}, - {"linux/sonet.h", "SONET_SETFRAMING", 0x6115}, - {"linux/sonet.h", "SONET_GETFRAMING", 0x6116}, - {"linux/sonet.h", "SONET_GETFRSENSE", 0x6117}, - {"linux/atm_idt77105.h", "IDT77105_GETSTAT", 0x6132}, - {"linux/atm_idt77105.h", "IDT77105_GETSTATZ", 0x6133}, - {"linux/atmdev.h", "ATM_GETSTAT", 0x6150}, - {"linux/atmdev.h", "ATM_GETSTATZ", 0x6151}, - {"linux/atmdev.h", "ATM_GETLOOP", 0x6152}, - {"linux/atmdev.h", "ATM_SETLOOP", 0x6153}, - {"linux/atmdev.h", "ATM_QUERYLOOP", 0x6154}, - {"linux/atm_eni.h", "ENI_MEMDUMP", 0x6160}, - {"linux/atm_nicstar.h", "NS_GETPSTAT", 0x6161}, - {"linux/atm_zatm.h", "ZATM_GETPOOL", 0x6161}, - {"linux/atm_nicstar.h", "NS_SETBUFLEV", 0x6162}, - {"linux/atm_zatm.h", "ZATM_GETPOOLZ", 0x6162}, - {"linux/atm_nicstar.h", "NS_ADJBUFLEV", 0x6163}, - {"linux/atm_zatm.h", "ZATM_SETPOOL", 0x6163}, - {"linux/atm_zatm.h", "ZATM_GETTHIST", 0x6164}, - {"linux/atm_eni.h", "ENI_SETMULT", 0x6167}, - {"linux/atm_tcp.h", "SIOCSIFATMTCP", 0x6180}, - {"linux/atmdev.h", "ATM_GETLINKRATE", 0x6181}, - {"linux/atmdev.h", "ATM_GETNAMES", 0x6183}, - {"linux/atmdev.h", "ATM_GETTYPE", 0x6184}, - {"linux/atmdev.h", "ATM_GETESI", 0x6185}, - {"linux/atmdev.h", "ATM_GETADDR", 0x6186}, - {"linux/atmdev.h", "ATM_RSTADDR", 0x6187}, - {"linux/atmdev.h", "ATM_ADDADDR", 0x6188}, - {"linux/atmdev.h", "ATM_DELADDR", 0x6189}, - {"linux/atmdev.h", "ATM_GETCIRANGE", 0x618a}, - {"linux/atmdev.h", "ATM_SETCIRANGE", 0x618b}, - {"linux/atmdev.h", "ATM_SETESI", 0x618c}, - {"linux/atmdev.h", "ATM_SETESIF", 0x618d}, - {"linux/atm_tcp.h", "ATMTCP_CREATE", 0x618e}, - {"linux/atm_tcp.h", "ATMTCP_REMOVE", 0x618f}, - {"linux/atmlec.h", "ATMLEC_CTRL", 0x61d0}, - {"linux/atmlec.h", "ATMLEC_DATA", 0x61d1}, - {"linux/atmlec.h", "ATMLEC_MCAST", 0x61d2}, - {"linux/atmmpc.h", "ATMMPC_CTRL", 0x61d8}, - {"linux/atmmpc.h", "ATMMPC_DATA", 0x61d9}, - {"linux/atmclip.h", "SIOCMKCLIP", 0x61e0}, - {"linux/atmarp.h", "ATMARPD_CTRL", 0x61e1}, - {"linux/atmarp.h", "ATMARP_MKIP", 0x61e2}, - {"linux/atmarp.h", "ATMARP_SETENTRY", 0x61e3}, - {"linux/atmarp.h", "ATMARP_ENCAP", 0x61e5}, - {"linux/atmsvc.h", "ATMSIGD_CTRL", 0x61f0}, - {"linux/atmdev.h", "ATM_SETSC", 0x61f1}, - {"linux/atmdev.h", "ATM_SETBACKEND", 0x61f2}, - {"linux/coda.h", "CIOC_KERNEL_VERSION", 0x630a}, - {"linux/comstats.h", "COM_GETPORTSTATS", 0x631e}, - {"linux/comstats.h", "COM_CLRPORTSTATS", 0x631f}, - {"linux/comstats.h", "COM_GETBRDSTATS", 0x6320}, - {"linux/comstats.h", "COM_READPORT", 0x6328}, - {"linux/comstats.h", "COM_READBOARD", 0x6329}, - {"linux/comstats.h", "COM_READPANEL", 0x632a}, - {"linux/devfs_fs.h", "DEVFSDIOC_GET_PROTO_REV", 0x6400}, - {"linux/video_decoder.h", "DECODER_GET_CAPABILITIES", 0x6401}, - {"linux/devfs_fs.h", "DEVFSDIOC_SET_EVENT_MASK", 0x6402}, - {"linux/video_decoder.h", "DECODER_GET_STATUS", 0x6402}, - {"linux/devfs_fs.h", "DEVFSDIOC_RELEASE_EVENT_QUEUE", 0x6403}, - {"linux/video_decoder.h", "DECODER_SET_NORM", 0x6403}, - {"linux/devfs_fs.h", "DEVFSDIOC_SET_DEBUG_MASK", 0x6404}, - {"linux/video_decoder.h", "DECODER_SET_INPUT", 0x6404}, - {"linux/video_decoder.h", "DECODER_SET_OUTPUT", 0x6405}, - {"linux/video_decoder.h", "DECODER_ENABLE_OUTPUT", 0x6406}, - {"linux/video_decoder.h", "DECODER_SET_PICTURE", 0x6407}, - {"linux/video_decoder.h", "DECODER_DUMP", 0x64c0}, - {"linux/video_encoder.h", "ENCODER_GET_CAPABILITIES", 0x6501}, - {"linux/video_encoder.h", "ENCODER_SET_NORM", 0x6502}, - {"linux/video_encoder.h", "ENCODER_SET_INPUT", 0x6503}, - {"linux/video_encoder.h", "ENCODER_SET_OUTPUT", 0x6504}, - {"linux/video_encoder.h", "ENCODER_ENABLE_OUTPUT", 0x6505}, - {"linux/ext2_fs.h", "EXT2_IOC_GETFLAGS", 0x6601}, - {"linux/ext3_fs.h", "EXT3_IOC_GETFLAGS", 0x6601}, - {"linux/ext2_fs.h", "EXT2_IOC_SETFLAGS", 0x6602}, - {"linux/ext3_fs.h", "EXT3_IOC_SETFLAGS", 0x6602}, - {"linux/ext3_fs.h", "EXT3_IOC_GETVERSION", 0x6603}, - {"linux/ext3_fs.h", "EXT3_IOC_SETVERSION", 0x6604}, - {"linux/ext3_fs.h", "EXT3_IOC_WAIT_FOR_READONLY", 0x6663}, - {"linux/i2o-dev.h", "I2OGETIOPS", 0x6900}, - {"linux/i2o-dev.h", "I2OHRTGET", 0x6901}, - {"linux/i2o-dev.h", "I2OLCTGET", 0x6902}, - {"linux/i2o-dev.h", "I2OPARMSET", 0x6903}, - {"linux/i2o-dev.h", "I2OPARMGET", 0x6904}, - {"linux/i2o-dev.h", "I2OSWDL", 0x6905}, - {"linux/i2o-dev.h", "I2OSWUL", 0x6906}, - {"linux/i2o-dev.h", "I2OSWDEL", 0x6907}, - {"linux/i2o-dev.h", "I2OVALIDATE", 0x6908}, - {"linux/i2o-dev.h", "I2OHTML", 0x6909}, - {"linux/i2o-dev.h", "I2OEVTREG", 0x690a}, - {"linux/i2o-dev.h", "I2OEVTGET", 0x690b}, - {"linux/i8k.h", "I8K_BIOS_VERSION", 0x6980}, - {"linux/i8k.h", "I8K_MACHINE_ID", 0x6981}, - {"linux/i8k.h", "I8K_POWER_STATUS", 0x6982}, - {"linux/i8k.h", "I8K_FN_STATUS", 0x6983}, - {"linux/i8k.h", "I8K_GET_TEMP", 0x6984}, - {"linux/i8k.h", "I8K_GET_SPEED", 0x6985}, - {"linux/i8k.h", "I8K_GET_FAN", 0x6986}, - {"linux/i8k.h", "I8K_SET_FAN", 0x6987}, - {"linux/joystick.h", "JSIOCGVERSION", 0x6a01}, - {"linux/joystick.h", "JSIOCGAXES", 0x6a11}, - {"linux/joystick.h", "JSIOCGBUTTONS", 0x6a12}, - {"linux/joystick.h", "JSIOCSCORR", 0x6a21}, - {"linux/joystick.h", "JSIOCGCORR", 0x6a22}, - {"linux/joystick.h", "JSIOCSAXMAP", 0x6a31}, - {"linux/joystick.h", "JSIOCGAXMAP", 0x6a32}, - {"linux/joystick.h", "JSIOCSBTNMAP", 0x6a33}, - {"linux/joystick.h", "JSIOCGBTNMAP", 0x6a34}, - {"linux/udf_fs_i.h", "UDF_GETEASIZE", 0x6c40}, - {"linux/udf_fs_i.h", "UDF_GETEABLOCK", 0x6c41}, - {"linux/udf_fs_i.h", "UDF_GETVOLIDENT", 0x6c42}, - {"linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", 0x6c43}, - {"linux/soundcard.h", "SNDCTL_MIDI_PRETIME", 0x6d00}, - {"linux/synclink.h", "MGSL_IOCSPARAMS", 0x6d00}, - {"linux/mtio.h", "MTIOCTOP", 0x6d01}, - {"linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", 0x6d01}, - {"linux/synclink.h", "MGSL_IOCGPARAMS", 0x6d01}, - {"linux/mtio.h", "MTIOCGET", 0x6d02}, - {"linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", 0x6d02}, - {"linux/synclink.h", "MGSL_IOCSTXIDLE", 0x6d02}, - {"linux/mtio.h", "MTIOCPOS", 0x6d03}, - {"linux/synclink.h", "MGSL_IOCGTXIDLE", 0x6d03}, - {"linux/mtio.h", "MTIOCGETCONFIG", 0x6d04}, - {"linux/synclink.h", "MGSL_IOCTXENABLE", 0x6d04}, - {"linux/mtio.h", "MTIOCSETCONFIG", 0x6d05}, - {"linux/synclink.h", "MGSL_IOCRXENABLE", 0x6d05}, - {"linux/mtio.h", "MTIOCRDFTSEG", 0x6d06}, - {"linux/synclink.h", "MGSL_IOCTXABORT", 0x6d06}, - {"linux/mtio.h", "MTIOCWRFTSEG", 0x6d07}, - {"linux/synclink.h", "MGSL_IOCGSTATS", 0x6d07}, - {"linux/mtio.h", "MTIOCVOLINFO", 0x6d08}, - {"linux/synclink.h", "MGSL_IOCWAITEVENT", 0x6d08}, - {"linux/mtio.h", "MTIOCGETSIZE", 0x6d09}, - {"linux/synclink.h", "MGSL_IOCLOOPTXDONE", 0x6d09}, - {"linux/mtio.h", "MTIOCFTFORMAT", 0x6d0a}, - {"linux/mtio.h", "MTIOCFTCMD", 0x6d0b}, - {"linux/synclink.h", "MGSL_IOCCLRMODCOUNT", 0x6d0f}, - {"linux/zftape.h", "MTIOC_ZFTAPE_GETBLKSZ", 0x6d68}, - {"linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", 0x6e01}, - {"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", 0x6e02}, - {"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", 0x6e02}, - {"linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", 0x6e03}, - {"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", 0x6e04}, - {"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", 0x6e04}, - {"linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", 0x6e05}, - {"linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", 0x6e06}, - {"linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", 0x6e06}, - {"linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", 0x6e07}, - {"linux/ncp_fs.h", "NCP_IOC_GETROOT", 0x6e08}, - {"linux/ncp_fs.h", "NCP_IOC_SETROOT", 0x6e08}, - {"linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", 0x6e09}, - {"linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", 0x6e09}, - {"linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", 0x6e0a}, - {"linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", 0x6e0a}, - {"linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", 0x6e0b}, - {"linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", 0x6e0b}, - {"linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", 0x6e0c}, - {"linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", 0x6e0c}, - {"linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", 0x6ef8}, - {"linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", 0x6ef8}, - {"linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", 0x6ef9}, - {"linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", 0x6efa}, - {"linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", 0x6efa}, - {"linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", 0x6efb}, - {"linux/rtc.h", "RTC_AIE_ON", 0x7001}, - {"linux/rtc.h", "RTC_AIE_OFF", 0x7002}, - {"linux/intermezzo_fs.h", "PRESTO_GETMOUNT", 0x7003}, - {"linux/rtc.h", "RTC_UIE_ON", 0x7003}, - {"linux/intermezzo_fs.h", "PRESTO_SETPID", 0x7004}, - {"linux/rtc.h", "RTC_UIE_OFF", 0x7004}, - {"linux/rtc.h", "RTC_PIE_ON", 0x7005}, - {"linux/intermezzo_fs.h", "PRESTO_CLOSE_JOURNALF", 0x7006}, - {"linux/rtc.h", "RTC_PIE_OFF", 0x7006}, - {"linux/intermezzo_fs.h", "PRESTO_SET_FSETROOT", 0x7007}, - {"linux/rtc.h", "RTC_ALM_SET", 0x7007}, - {"linux/intermezzo_fs.h", "PRESTO_CLEAR_FSETROOT", 0x7008}, - {"linux/rtc.h", "RTC_ALM_READ", 0x7008}, - {"linux/intermezzo_fs.h", "PRESTO_SETOPT", 0x7009}, - {"linux/rtc.h", "RTC_RD_TIME", 0x7009}, - {"linux/intermezzo_fs.h", "PRESTO_GETOPT", 0x700a}, - {"linux/rtc.h", "RTC_SET_TIME", 0x700a}, - {"linux/intermezzo_fs.h", "PRESTO_GET_KMLSIZE", 0x700b}, - {"linux/rtc.h", "RTC_IRQP_READ", 0x700b}, - {"linux/intermezzo_fs.h", "PRESTO_GET_RECNO", 0x700c}, - {"linux/rtc.h", "RTC_IRQP_SET", 0x700c}, - {"linux/rtc.h", "RTC_EPOCH_READ", 0x700d}, - {"linux/rtc.h", "RTC_EPOCH_SET", 0x700e}, - {"linux/rtc.h", "RTC_WIE_ON", 0x700f}, - {"linux/rtc.h", "RTC_WKALM_SET", 0x700f}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_SETATTR", 0x7010}, - {"linux/rtc.h", "RTC_WIE_OFF", 0x7010}, - {"linux/rtc.h", "RTC_WKALM_RD", 0x7010}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_CREATE", 0x7011}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_LINK", 0x7012}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_UNLINK", 0x7013}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_SYMLINK", 0x7014}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_MKDIR", 0x7015}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_RMDIR", 0x7016}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_MKNOD", 0x7017}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_RENAME", 0x7018}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_CLOSE", 0x701a}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_IOPEN", 0x701b}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_SETEXTATTR", 0x701c}, - {"linux/intermezzo_fs.h", "PRESTO_VFS_DELEXTATTR", 0x701d}, - {"linux/intermezzo_fs.h", "PRESTO_MARK", 0x7020}, - {"linux/intermezzo_fs.h", "PRESTO_RELEASE_PERMIT", 0x7021}, - {"linux/intermezzo_fs.h", "PRESTO_CLEAR_ALL_FSETROOTS", 0x7022}, - {"linux/intermezzo_fs.h", "PRESTO_BACKFETCH_LML", 0x7023}, - {"linux/intermezzo_fs.h", "PRESTO_REINT", 0x7024}, - {"linux/intermezzo_fs.h", "PRESTO_CANCEL_LML", 0x7025}, - {"linux/intermezzo_fs.h", "PRESTO_RESET_FSET", 0x7026}, - {"linux/intermezzo_fs.h", "PRESTO_COMPLETE_CLOSES", 0x7027}, - {"linux/intermezzo_fs.h", "PRESTO_REINT_BEGIN", 0x7030}, - {"linux/intermezzo_fs.h", "PRESTO_DO_REINT", 0x7031}, - {"linux/intermezzo_fs.h", "PRESTO_REINT_END", 0x7032}, - {"linux/nvram.h", "NVRAM_INIT", 0x7040}, - {"linux/nvram.h", "NVRAM_SETCKS", 0x7041}, - {"linux/ppdev.h", "PPSETMODE", 0x7080}, - {"linux/ppdev.h", "PPRSTATUS", 0x7081}, - {"linux/ppdev.h", "PPRCONTROL", 0x7083}, - {"linux/ppdev.h", "PPWCONTROL", 0x7084}, - {"linux/ppdev.h", "PPRDATA", 0x7085}, - {"linux/ppdev.h", "PPWDATA", 0x7086}, - {"linux/ppdev.h", "PPCLAIM", 0x708b}, - {"linux/ppdev.h", "PPRELEASE", 0x708c}, - {"linux/ppdev.h", "PPYIELD", 0x708d}, - {"linux/ppdev.h", "PPFCONTROL", 0x708e}, - {"linux/ppdev.h", "PPEXCL", 0x708f}, - {"linux/ppdev.h", "PPDATADIR", 0x7090}, - {"linux/ppdev.h", "PPNEGOT", 0x7091}, - {"linux/ppdev.h", "PPWCTLONIRQ", 0x7092}, - {"linux/ppdev.h", "PPCLRIRQ", 0x7093}, - {"linux/ppdev.h", "PPSETPHASE", 0x7094}, - {"linux/ppdev.h", "PPGETTIME", 0x7095}, - {"linux/ppdev.h", "PPSETTIME", 0x7096}, - {"linux/ppdev.h", "PPGETMODES", 0x7097}, - {"linux/ppdev.h", "PPGETMODE", 0x7098}, - {"linux/ppdev.h", "PPGETPHASE", 0x7099}, - {"linux/ppdev.h", "PPGETFLAGS", 0x709a}, - {"linux/ppdev.h", "PPSETFLAGS", 0x709b}, - {"linux/serio.h", "SPIOCSTYPE", 0x7101}, - {"linux/telephony.h", "PHONE_CAPABILITIES", 0x7180}, - {"linux/telephony.h", "PHONE_CAPABILITIES_LIST", 0x7181}, - {"linux/telephony.h", "PHONE_CAPABILITIES_CHECK", 0x7182}, - {"linux/telephony.h", "PHONE_RING", 0x7183}, - {"linux/telephony.h", "PHONE_HOOKSTATE", 0x7184}, - {"linux/telephony.h", "PHONE_MAXRINGS", 0x7185}, - {"linux/telephony.h", "PHONE_RING_CADENCE", 0x7186}, - {"linux/telephony.h", "OLD_PHONE_RING_START", 0x7187}, - {"linux/telephony.h", "PHONE_RING_START", 0x7187}, - {"linux/telephony.h", "PHONE_RING_STOP", 0x7188}, - {"linux/telephony.h", "PHONE_REC_CODEC", 0x7189}, - {"linux/telephony.h", "PHONE_REC_START", 0x718a}, - {"linux/telephony.h", "PHONE_REC_STOP", 0x718b}, - {"linux/telephony.h", "PHONE_REC_DEPTH", 0x718c}, - {"linux/telephony.h", "PHONE_FRAME", 0x718d}, - {"linux/telephony.h", "PHONE_REC_VOLUME", 0x718e}, - {"linux/telephony.h", "PHONE_REC_LEVEL", 0x718f}, - {"linux/telephony.h", "PHONE_PLAY_CODEC", 0x7190}, - {"linux/telephony.h", "PHONE_PLAY_START", 0x7191}, - {"linux/telephony.h", "PHONE_PLAY_STOP", 0x7192}, - {"linux/telephony.h", "PHONE_PLAY_DEPTH", 0x7193}, - {"linux/telephony.h", "PHONE_PLAY_VOLUME", 0x7194}, - {"linux/telephony.h", "PHONE_PLAY_LEVEL", 0x7195}, - {"linux/telephony.h", "PHONE_DTMF_READY", 0x7196}, - {"linux/telephony.h", "PHONE_GET_DTMF", 0x7197}, - {"linux/telephony.h", "PHONE_GET_DTMF_ASCII", 0x7198}, - {"linux/telephony.h", "PHONE_DTMF_OOB", 0x7199}, - {"linux/telephony.h", "PHONE_EXCEPTION", 0x719a}, - {"linux/telephony.h", "PHONE_PLAY_TONE", 0x719b}, - {"linux/telephony.h", "PHONE_SET_TONE_ON_TIME", 0x719c}, - {"linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", 0x719d}, - {"linux/telephony.h", "PHONE_GET_TONE_ON_TIME", 0x719e}, - {"linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", 0x719f}, - {"linux/telephony.h", "PHONE_GET_TONE_STATE", 0x71a0}, - {"linux/telephony.h", "PHONE_BUSY", 0x71a1}, - {"linux/telephony.h", "PHONE_RINGBACK", 0x71a2}, - {"linux/telephony.h", "PHONE_DIALTONE", 0x71a3}, - {"linux/telephony.h", "PHONE_CPT_STOP", 0x71a4}, - {"linux/telephony.h", "PHONE_PSTN_SET_STATE", 0x71a4}, - {"linux/telephony.h", "PHONE_PSTN_GET_STATE", 0x71a5}, - {"linux/telephony.h", "PHONE_WINK_DURATION", 0x71a6}, - {"linux/telephony.h", "PHONE_QUERY_CODEC", 0x71a7}, - {"linux/telephony.h", "PHONE_PSTN_LINETEST", 0x71a8}, - {"linux/telephony.h", "PHONE_VAD", 0x71a9}, - {"linux/telephony.h", "PHONE_WINK", 0x71aa}, - {"linux/ixjuser.h", "IXJCTL_DSP_RESET", 0x71c0}, - {"linux/ixjuser.h", "IXJCTL_CARDTYPE", 0x71c1}, - {"linux/ixjuser.h", "IXJCTL_SERIAL", 0x71c2}, - {"linux/ixjuser.h", "IXJCTL_DSP_TYPE", 0x71c3}, - {"linux/ixjuser.h", "IXJCTL_DSP_VERSION", 0x71c4}, - {"linux/ixjuser.h", "IXJCTL_DSP_IDLE", 0x71c5}, - {"linux/ixjuser.h", "IXJCTL_TESTRAM", 0x71c6}, - {"linux/ixjuser.h", "IXJCTL_SET_FILTER", 0x71c7}, - {"linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", 0x71c8}, - {"linux/ixjuser.h", "IXJCTL_INIT_TONE", 0x71c9}, - {"linux/ixjuser.h", "IXJCTL_TONE_CADENCE", 0x71ca}, - {"linux/ixjuser.h", "IXJCTL_AEC_START", 0x71cb}, - {"linux/ixjuser.h", "IXJCTL_AEC_STOP", 0x71cc}, - {"linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", 0x71cd}, - {"linux/ixjuser.h", "IXJCTL_SET_LED", 0x71ce}, - {"linux/ixjuser.h", "IXJCTL_MIXER", 0x71cf}, - {"linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", 0x71d0}, - {"linux/ixjuser.h", "IXJCTL_PORT", 0x71d1}, - {"linux/ixjuser.h", "IXJCTL_DAA_AGAIN", 0x71d2}, - {"linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", 0x71d3}, - {"linux/ixjuser.h", "IXJCTL_CID", 0x71d4}, - {"linux/ixjuser.h", "IXJCTL_POTS_PSTN", 0x71d5}, - {"linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", 0x71d6}, - {"linux/ixjuser.h", "IXJCTL_PLAY_CID", 0x71d7}, - {"linux/ixjuser.h", "IXJCTL_VMWI", 0x71d8}, - {"linux/ixjuser.h", "IXJCTL_CIDCW", 0x71d9}, - {"linux/ixjuser.h", "IXJCTL_VERSION", 0x71da}, - {"linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", 0x71db}, - {"linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", 0x71dc}, - {"linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", 0x71dd}, - {"linux/ixjuser.h", "IXJCTL_HZ", 0x71e0}, - {"linux/ixjuser.h", "IXJCTL_RATE", 0x71e1}, - {"linux/ixjuser.h", "IXJCTL_FRAMES_READ", 0x71e2}, - {"linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", 0x71e3}, - {"linux/ixjuser.h", "IXJCTL_READ_WAIT", 0x71e4}, - {"linux/ixjuser.h", "IXJCTL_WRITE_WAIT", 0x71e5}, - {"linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", 0x71e6}, - {"linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", 0x71e7}, - {"linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", 0x71e8}, - {"linux/ixjuser.h", "IXJCTL_SIGCTL", 0x71e9}, - {"linux/ixjuser.h", "IXJCTL_SC_RXG", 0x71ea}, - {"linux/ixjuser.h", "IXJCTL_SC_TXG", 0x71eb}, - {"linux/ixjuser.h", "IXJCTL_INTERCOM_START", 0x71fd}, - {"linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", 0x71fe}, - {"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", 0x7201}, - {"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", 0x7202}, - {"linux/cdk.h", "STL_BINTR", 0x7314}, - {"linux/cdk.h", "STL_BSTART", 0x7315}, - {"linux/cdk.h", "STL_BSTOP", 0x7316}, - {"linux/cdk.h", "STL_BRESET", 0x7317}, - {"linux/cdk.h", "STL_GETPFLAG", 0x7350}, - {"linux/cdk.h", "STL_SETPFLAG", 0x7351}, - {"linux/if_ppp.h", "PPPIOCGCHAN", 0x7437}, - {"linux/if_ppp.h", "PPPIOCATTCHAN", 0x7438}, - {"linux/if_ppp.h", "PPPIOCDISCONN", 0x7439}, - {"linux/if_ppp.h", "PPPIOCCONNECT", 0x743a}, - {"linux/if_ppp.h", "PPPIOCSMRRU", 0x743b}, - {"linux/if_ppp.h", "PPPIOCDETACH", 0x743c}, - {"linux/if_ppp.h", "PPPIOCATTACH", 0x743d}, - {"linux/if_ppp.h", "PPPIOCNEWUNIT", 0x743e}, - {"linux/if_ppp.h", "PPPIOCGIDLE", 0x743f}, - {"linux/if_ppp.h", "PPPIOCSDEBUG", 0x7440}, - {"linux/if_ppp.h", "PPPIOCGDEBUG", 0x7441}, - {"linux/if_ppp.h", "PPPIOCSACTIVE", 0x7446}, - {"linux/if_ppp.h", "PPPIOCSPASS", 0x7447}, - {"linux/if_ppp.h", "PPPIOCSNPMODE", 0x744b}, - {"linux/if_ppp.h", "PPPIOCGNPMODE", 0x744c}, - {"linux/if_ppp.h", "PPPIOCSCOMPRESS", 0x744d}, - {"linux/if_ppp.h", "PPPIOCXFERUNIT", 0x744e}, - {"linux/if_ppp.h", "PPPIOCSXASYNCMAP", 0x744f}, - {"linux/if_ppp.h", "PPPIOCGXASYNCMAP", 0x7450}, - {"linux/if_ppp.h", "PPPIOCSMAXCID", 0x7451}, - {"linux/if_ppp.h", "PPPIOCSMRU", 0x7452}, - {"linux/if_ppp.h", "PPPIOCGMRU", 0x7453}, - {"linux/if_ppp.h", "PPPIOCSRASYNCMAP", 0x7454}, - {"linux/if_ppp.h", "PPPIOCGRASYNCMAP", 0x7455}, - {"linux/if_ppp.h", "PPPIOCGUNIT", 0x7456}, - {"linux/if_ppp.h", "PPPIOCSASYNCMAP", 0x7457}, - {"linux/if_ppp.h", "PPPIOCGASYNCMAP", 0x7458}, - {"linux/if_ppp.h", "PPPIOCSFLAGS", 0x7459}, - {"linux/if_ppp.h", "PPPIOCGFLAGS", 0x745a}, - {"linux/jffs.h", "JFFS_PRINT_HASH", 0x745a}, - {"linux/jffs.h", "JFFS_PRINT_TREE", 0x745b}, - {"linux/jffs.h", "JFFS_GET_STATUS", 0x745c}, - {"linux/isdn_ppp.h", "PPPIOCGCALLINFO", 0x7480}, - {"linux/isdn_ppp.h", "PPPIOCBUNDLE", 0x7481}, - {"linux/isdn_ppp.h", "PPPIOCGMPFLAGS", 0x7482}, - {"linux/isdn_ppp.h", "PPPIOCSMPFLAGS", 0x7483}, - {"linux/isdn_ppp.h", "PPPIOCSMPMTU", 0x7484}, - {"linux/isdn_ppp.h", "PPPIOCSMPMRU", 0x7485}, - {"linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", 0x7486}, - {"linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", 0x7487}, - {"linux/isdn_ppp.h", "PPPIOCGIFNAME", 0x7488}, - {"linux/toshiba.h", "TOSH_SMM", 0x7490}, - {"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID", 0x7501}, - {"linux/smb_fs.h", "SMB_IOC_NEWCONN", 0x7502}, - {"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID32", 0x7503}, - {"linux/sonypi.h", "SONYPI_IOCGBRT", 0x7600}, - {"linux/sonypi.h", "SONYPI_IOCSBRT", 0x7600}, - {"linux/ext2_fs.h", "EXT2_IOC_GETVERSION", 0x7601}, - {"linux/ext3_fs.h", "EXT3_IOC_GETVERSION_OLD", 0x7601}, - {"linux/videodev.h", "VIDIOCGCAP", 0x7601}, - {"linux/ext2_fs.h", "EXT2_IOC_SETVERSION", 0x7602}, - {"linux/ext3_fs.h", "EXT3_IOC_SETVERSION_OLD", 0x7602}, - {"linux/sonypi.h", "SONYPI_IOCGBAT1CAP", 0x7602}, - {"linux/videodev.h", "VIDIOCGCHAN", 0x7602}, - {"linux/sonypi.h", "SONYPI_IOCGBAT1REM", 0x7603}, - {"linux/videodev.h", "VIDIOCSCHAN", 0x7603}, - {"linux/sonypi.h", "SONYPI_IOCGBAT2CAP", 0x7604}, - {"linux/videodev.h", "VIDIOCGTUNER", 0x7604}, - {"linux/sonypi.h", "SONYPI_IOCGBAT2REM", 0x7605}, - {"linux/videodev.h", "VIDIOCSTUNER", 0x7605}, - {"linux/videodev.h", "VIDIOCGPICT", 0x7606}, - {"linux/sonypi.h", "SONYPI_IOCGBATFLAGS", 0x7607}, - {"linux/videodev.h", "VIDIOCSPICT", 0x7607}, - {"linux/sonypi.h", "SONYPI_IOCGBLUE", 0x7608}, - {"linux/videodev.h", "VIDIOCCAPTURE", 0x7608}, - {"linux/sonypi.h", "SONYPI_IOCSBLUE", 0x7609}, - {"linux/videodev.h", "VIDIOCGWIN", 0x7609}, - {"linux/videodev.h", "VIDIOCSWIN", 0x760a}, - {"linux/videodev.h", "VIDIOCGFBUF", 0x760b}, - {"linux/videodev.h", "VIDIOCSFBUF", 0x760c}, - {"linux/videodev.h", "VIDIOCKEY", 0x760d}, - {"linux/videodev.h", "VIDIOCGFREQ", 0x760e}, - {"linux/videodev.h", "VIDIOCSFREQ", 0x760f}, - {"linux/videodev.h", "VIDIOCGAUDIO", 0x7610}, - {"linux/videodev.h", "VIDIOCSAUDIO", 0x7611}, - {"linux/videodev.h", "VIDIOCSYNC", 0x7612}, - {"linux/videodev.h", "VIDIOCMCAPTURE", 0x7613}, - {"linux/videodev.h", "VIDIOCGMBUF", 0x7614}, - {"linux/videodev.h", "VIDIOCGUNIT", 0x7615}, - {"linux/videodev.h", "VIDIOCGCAPTURE", 0x7616}, - {"linux/videodev.h", "VIDIOCSCAPTURE", 0x7617}, - {"linux/videodev.h", "VIDIOCSPLAYMODE", 0x7618}, - {"linux/videodev.h", "VIDIOCSWRITEMODE", 0x7619}, - {"linux/videodev.h", "VIDIOCGPLAYINFO", 0x761a}, - {"linux/videodev.h", "VIDIOCSMICROCODE", 0x761b}, - {"linux/videodev.h", "VIDIOCGVBIFMT", 0x761c}, - {"linux/videodev.h", "VIDIOCSVBIFMT", 0x761d}, - {"linux/meye.h", "MEYEIOC_G_PARAMS", 0x76c0}, - {"linux/meye.h", "MEYEIOC_S_PARAMS", 0x76c1}, - {"linux/meye.h", "MEYEIOC_QBUF_CAPT", 0x76c2}, - {"linux/meye.h", "MEYEIOC_SYNC", 0x76c3}, - {"linux/meye.h", "MEYEIOC_STILLCAPT", 0x76c4}, - {"linux/meye.h", "MEYEIOC_STILLJCAPT", 0x76c5}, - {"linux/dn.h", "SIOCSNETADDR", 0x89e0}, - {"linux/dn.h", "OSIOCSNETADDR", 0x89e0}, - {"linux/dn.h", "SIOCGNETADDR", 0x89e1}, - {"linux/dn.h", "OSIOCGNETADDR", 0x89e1}, - {"linux/auto_fs.h", "AUTOFS_IOC_READY", 0x9360}, - {"linux/auto_fs.h", "AUTOFS_IOC_FAIL", 0x9361}, - {"linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", 0x9362}, - {"linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", 0x9363}, - {"linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", 0x9364}, - {"linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", 0x9365}, - {"linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", 0x9366}, - {"linux/nbd.h", "NBD_SET_SOCK", 0xab00}, - {"linux/nbd.h", "NBD_SET_BLKSIZE", 0xab01}, - {"linux/nbd.h", "NBD_SET_SIZE", 0xab02}, - {"linux/nbd.h", "NBD_DO_IT", 0xab03}, - {"linux/nbd.h", "NBD_CLEAR_SOCK", 0xab04}, - {"linux/nbd.h", "NBD_CLEAR_QUE", 0xab05}, - {"linux/nbd.h", "NBD_PRINT_DEBUG", 0xab06}, - {"linux/nbd.h", "NBD_SET_SIZE_BLOCKS", 0xab07}, - {"linux/nbd.h", "NBD_DISCONNECT", 0xab08}, - {"linux/raw.h", "RAW_SETBIND", 0xac00}, - {"linux/raw.h", "RAW_GETBIND", 0xac01}, - {"linux/if_pppox.h", "PPPOEIOCSFWD", 0xb100}, - {"linux/if_pppox.h", "PPPOEIOCDFWD", 0xb101}, - {"linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", 0xcd01}, - {"linux/lvm.h", "VG_CREATE_OLD", 0xfe00}, - {"linux/lvm.h", "VG_REMOVE", 0xfe01}, - {"linux/lvm.h", "VG_EXTEND", 0xfe03}, - {"linux/lvm.h", "VG_REDUCE", 0xfe04}, - {"linux/lvm.h", "VG_STATUS", 0xfe05}, - {"linux/lvm.h", "VG_STATUS_GET_COUNT", 0xfe06}, - {"linux/lvm.h", "VG_STATUS_GET_NAMELIST", 0xfe07}, - {"linux/lvm.h", "VG_SET_EXTENDABLE", 0xfe08}, - {"linux/lvm.h", "VG_RENAME", 0xfe09}, - {"linux/lvm.h", "VG_CREATE", 0xfe0a}, - {"linux/lvm.h", "LV_CREATE", 0xfe20}, - {"linux/lvm.h", "LV_REMOVE", 0xfe21}, - {"linux/lvm.h", "LV_ACTIVATE", 0xfe22}, - {"linux/lvm.h", "LV_DEACTIVATE", 0xfe23}, - {"linux/lvm.h", "LV_EXTEND", 0xfe24}, - {"linux/lvm.h", "LV_REDUCE", 0xfe25}, - {"linux/lvm.h", "LV_STATUS_BYNAME", 0xfe26}, - {"linux/lvm.h", "LV_STATUS_BYINDEX", 0xfe27}, - {"linux/lvm.h", "LV_SET_ACCESS", 0xfe28}, - {"linux/lvm.h", "LV_SET_ALLOCATION", 0xfe29}, - {"linux/lvm.h", "LV_SET_STATUS", 0xfe2a}, - {"linux/lvm.h", "LE_REMAP", 0xfe2b}, - {"linux/lvm.h", "LV_SNAPSHOT_USE_RATE", 0xfe2c}, - {"linux/lvm.h", "LV_STATUS_BYDEV", 0xfe2e}, - {"linux/lvm.h", "LV_RENAME", 0xfe2f}, - {"linux/lvm.h", "LV_BMAP", 0xfe30}, - {"linux/lvm.h", "PV_STATUS", 0xfe40}, - {"linux/lvm.h", "PV_CHANGE", 0xfe41}, - {"linux/lvm.h", "PV_FLUSH", 0xfe42}, - {"linux/lvm.h", "PE_LOCK_UNLOCK", 0xfe50}, - {"linux/lvm.h", "LVM_GET_IOP_VERSION", 0xfe98}, - {"linux/lvm.h", "LVM_RESET", 0xfe99}, - {"linux/lvm.h", "LVM_LOCK_LVM", 0xff00}, diff --git a/linux/sparc64/ioctls_arch0.h b/linux/sparc64/ioctls_arch0.h new file mode 100644 index 00000000..0e5f1a0e --- /dev/null +++ b/linux/sparc64/ioctls_arch0.h @@ -0,0 +1,129 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sparc/include/ tree. */ +{ "asm/apc.h", "APCIOCGBPORT", _IOC_READ, 0x4104, 0x04 }, +{ "asm/apc.h", "APCIOCGCPWR", _IOC_READ, 0x4102, 0x04 }, +{ "asm/apc.h", "APCIOCGFANCTL", _IOC_READ, 0x4100, 0x04 }, +{ "asm/apc.h", "APCIOCSBPORT", _IOC_WRITE, 0x4105, 0x04 }, +{ "asm/apc.h", "APCIOCSCPWR", _IOC_WRITE, 0x4103, 0x04 }, +{ "asm/apc.h", "APCIOCSFANCTL", _IOC_WRITE, 0x4101, 0x04 }, +{ "asm/display7seg.h", "D7SIOCRD", _IOC_READ, 0x7045, 0x04 }, +{ "asm/display7seg.h", "D7SIOCTM", _IOC_NONE, 0x7047, 0x00 }, +{ "asm/display7seg.h", "D7SIOCWR", _IOC_WRITE, 0x7046, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_CPU_TEMPERATURE", _IOC_READ, 0x7040, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_CPU_VOLTAGE", _IOC_READ, 0x7041, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_ETHERNET_TEMPERATURE", _IOC_READ, 0x7047, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_FAN_STATUS", _IOC_READ, 0x7042, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_GLOBALADDRESS", _IOC_READ, 0x7049, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_MTHRBD_TEMPERATURE", _IOC_READ, 0x7048, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_SCSI_TEMPERATURE", _IOC_READ, 0x7046, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_SHUTDOWN_TEMPERATURE", _IOC_READ, 0x7044, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_VOLTAGE_STATUS", _IOC_READ, 0x7045, 0x04 }, +{ "asm/envctrl.h", "ENVCTRL_RD_WARNING_TEMPERATURE", _IOC_READ, 0x7043, 0x04 }, +{ "asm/fbio.h", "FBIOGATTR", _IOC_READ, 0x4606, 0x58 }, +{ "asm/fbio.h", "FBIOGCURMAX", _IOC_READ, 0x461c, 0x04 }, +{ "asm/fbio.h", "FBIOGCURPOS", _IOC_WRITE, 0x461b, 0x04 }, +{ "asm/fbio.h", "FBIOGCURSOR", _IOC_READ|_IOC_WRITE, 0x4619, 0x48 }, +{ "asm/fbio.h", "FBIOGETCMAP", _IOC_WRITE, 0x4604, 0x20 }, +{ "asm/fbio.h", "FBIOGTYPE", _IOC_READ, 0x4600, 0x18 }, +{ "asm/fbio.h", "FBIOGVIDEO", _IOC_READ, 0x4608, 0x04 }, +{ "asm/fbio.h", "FBIOPUTCMAP", _IOC_WRITE, 0x4603, 0x20 }, +{ "asm/fbio.h", "FBIOSATTR", _IOC_WRITE, 0x4605, 0x58 }, +{ "asm/fbio.h", "FBIOSCURPOS", _IOC_WRITE, 0x461a, 0x04 }, +{ "asm/fbio.h", "FBIOSCURSOR", _IOC_WRITE, 0x4618, 0x48 }, +{ "asm/fbio.h", "FBIOSVIDEO", _IOC_WRITE, 0x4607, 0x04 }, +{ "asm/fbio.h", "FBIO_WID_ALLOC", _IOC_READ|_IOC_WRITE, 0x461e, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_FREE", _IOC_WRITE, 0x461f, 0x0c }, +{ "asm/fbio.h", "FBIO_WID_GET", _IOC_READ|_IOC_WRITE, 0x4621, 0x10 }, +{ "asm/fbio.h", "FBIO_WID_PUT", _IOC_WRITE, 0x4620, 0x10 }, +{ "asm/fbio.h", "LEO_CLUTALLOC", _IOC_READ|_IOC_WRITE, 0x4c35, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTFREE", _IOC_WRITE, 0x4c36, 0x0c }, +{ "asm/fbio.h", "LEO_CLUTPOST", _IOC_WRITE, 0x4c38, 0x28 }, +{ "asm/fbio.h", "LEO_CLUTREAD", _IOC_WRITE, 0x4c37, 0x28 }, +{ "asm/fbio.h", "LEO_GETGAMMA", _IOC_READ, 0x4c45, 0x04 }, +{ "asm/fbio.h", "LEO_SETGAMMA", _IOC_WRITE, 0x4c44, 0x04 }, +{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, +{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, +{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, +{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, +{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x5407, 0x00 }, +{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x5401, 0x12 }, +{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x5408, 0x24 }, +{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x540c, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x5405, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x5402, 0x12 }, +{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x5404, 0x12 }, +{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x5403, 0x12 }, +{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x5409, 0x24 }, +{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x540d, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x540b, 0x24 }, +{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x540f, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x540a, 0x24 }, +{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x540e, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x5406, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x747a, 0x00 }, +{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x7424, 0x00 }, +{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x740d, 0x00 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x7400, 0x04 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7483, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x7486, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x5441, 0x20 }, +{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x7485, 0x04 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x7464, 0x04 }, +{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 }, +{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x746b, 0x04 }, +{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x746c, 0x04 }, +{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x746a, 0x04 }, +{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x746d, 0x04 }, +{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x7471, 0x00 }, +{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x740e, 0x00 }, +{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, +{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x7470, 0x04 }, +{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x747b, 0x00 }, +{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x7484, 0x00 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x7401, 0x04 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x7488, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7482, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x7487, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x5442, 0x20 }, +{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x7465, 0x04 }, +{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, +{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x7472, 0x01 }, +{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, +{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 }, +{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 }, +{ "asm/openpromio.h", "OPIOCGET", _IOC_READ|_IOC_WRITE, 0x4f01, 0x20 }, +{ "asm/openpromio.h", "OPIOCGETCHILD", _IOC_READ|_IOC_WRITE, 0x4f06, 0x04 }, +{ "asm/openpromio.h", "OPIOCGETNEXT", _IOC_READ|_IOC_WRITE, 0x4f05, 0x04 }, +{ "asm/openpromio.h", "OPIOCGETOPTNODE", _IOC_READ, 0x4f04, 0x04 }, +{ "asm/openpromio.h", "OPIOCNEXTPROP", _IOC_READ|_IOC_WRITE, 0x4f03, 0x20 }, +{ "asm/openpromio.h", "OPIOCSET", _IOC_WRITE, 0x4f02, 0x20 }, +{ "asm/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "asm/watchdog.h", "WIOCGSTAT", _IOC_READ, 0x570c, 0x04 }, +{ "asm/watchdog.h", "WIOCSTART", _IOC_NONE, 0x570a, 0x00 }, +{ "asm/watchdog.h", "WIOCSTOP", _IOC_NONE, 0x570b, 0x00 }, diff --git a/linux/sparc64/ioctls_arch1.h b/linux/sparc64/ioctls_arch1.h new file mode 100644 index 00000000..96bd895f --- /dev/null +++ b/linux/sparc64/ioctls_arch1.h @@ -0,0 +1 @@ +#include "sparc/ioctls_arch0.h" diff --git a/linux/sparc64/ioctls_inc0.h b/linux/sparc64/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/sparc64/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/sparc64/ioctls_inc1.h b/linux/sparc64/ioctls_inc1.h new file mode 100644 index 00000000..63b70e43 --- /dev/null +++ b/linux/sparc64/ioctls_inc1.h @@ -0,0 +1 @@ +#include "sparc/ioctls_inc0.h" diff --git a/linux/sparc64/set_error.c b/linux/sparc64/set_error.c new file mode 100644 index 00000000..6c266af9 --- /dev/null +++ b/linux/sparc64/set_error.c @@ -0,0 +1,15 @@ +static int +arch_set_error(struct tcb *tcp) +{ + sparc_regs.tstate |= 0x1100000000UL; + sparc_regs.u_regs[U_REG_O0] = tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + sparc_regs.tstate &= ~0x1100000000UL; + sparc_regs.u_regs[U_REG_O0] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/sparc64/set_scno.c b/linux/sparc64/set_scno.c new file mode 100644 index 00000000..ae57cdfb --- /dev/null +++ b/linux/sparc64/set_scno.c @@ -0,0 +1 @@ +#include "sparc/set_scno.c" diff --git a/linux/sparc64/signalent.h b/linux/sparc64/signalent.h index e059b5d0..b4c6c15c 100644 --- a/linux/sparc64/signalent.h +++ b/linux/sparc64/signalent.h @@ -1,32 +1 @@ - "SIG_0", /* 0 */ - "SIGHUP", /* 1 */ - "SIGINT", /* 2 */ - "SIGQUIT", /* 3 */ - "SIGILL", /* 4 */ - "SIGTRAP", /* 5 */ - "SIGABRT", /* 6 */ - "SIGEMT", /* 7 */ - "SIGFPE", /* 8 */ - "SIGKILL", /* 9 */ - "SIGBUS", /* 10 */ - "SIGSEGV", /* 11 */ - "SIGSYS", /* 12 */ - "SIGPIPE", /* 13 */ - "SIGALRM", /* 14 */ - "SIGTERM", /* 15 */ - "SIGURG", /* 16 */ - "SIGSTOP", /* 17 */ - "SIGTSTP", /* 18 */ - "SIGCONT", /* 19 */ - "SIGCHLD", /* 20 */ - "SIGTTIN", /* 21 */ - "SIGTTOU", /* 22 */ - "SIGIO", /* 23 */ - "SIGXCPU", /* 24 */ - "SIGXFSZ", /* 25 */ - "SIGVTALRM", /* 26 */ - "SIGPROF", /* 27 */ - "SIGWINCH", /* 28 */ - "SIGLOST", /* 29 */ - "SIGUSR1", /* 30 */ - "SIGUSR2", /* 31 */ +#include "sparc/signalent.h" diff --git a/linux/sparc64/signalent1.h b/linux/sparc64/signalent1.h index 0f6314f1..093cba7f 100644 --- a/linux/sparc64/signalent1.h +++ b/linux/sparc64/signalent1.h @@ -1 +1 @@ -#include "../sparc/signalent1.h" +#include "signalent.h" diff --git a/linux/sparc64/signalent2.h b/linux/sparc64/signalent2.h deleted file mode 100644 index e059b5d0..00000000 --- a/linux/sparc64/signalent2.h +++ /dev/null @@ -1,32 +0,0 @@ - "SIG_0", /* 0 */ - "SIGHUP", /* 1 */ - "SIGINT", /* 2 */ - "SIGQUIT", /* 3 */ - "SIGILL", /* 4 */ - "SIGTRAP", /* 5 */ - "SIGABRT", /* 6 */ - "SIGEMT", /* 7 */ - "SIGFPE", /* 8 */ - "SIGKILL", /* 9 */ - "SIGBUS", /* 10 */ - "SIGSEGV", /* 11 */ - "SIGSYS", /* 12 */ - "SIGPIPE", /* 13 */ - "SIGALRM", /* 14 */ - "SIGTERM", /* 15 */ - "SIGURG", /* 16 */ - "SIGSTOP", /* 17 */ - "SIGTSTP", /* 18 */ - "SIGCONT", /* 19 */ - "SIGCHLD", /* 20 */ - "SIGTTIN", /* 21 */ - "SIGTTOU", /* 22 */ - "SIGIO", /* 23 */ - "SIGXCPU", /* 24 */ - "SIGXFSZ", /* 25 */ - "SIGVTALRM", /* 26 */ - "SIGPROF", /* 27 */ - "SIGWINCH", /* 28 */ - "SIGLOST", /* 29 */ - "SIGUSR1", /* 30 */ - "SIGUSR2", /* 31 */ diff --git a/linux/sparc64/syscall1.h b/linux/sparc64/syscall1.h deleted file mode 100644 index 6f30b742..00000000 --- a/linux/sparc64/syscall1.h +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995 Rick Sladkey - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#define SOLARIS_syscall 0 -#define SOLARIS_exit 1 -#define SOLARIS_fork 2 -#define SOLARIS_read 3 -#define SOLARIS_write 4 -#define SOLARIS_open 5 -#define SOLARIS_close 6 -#define SOLARIS_wait 7 -#define SOLARIS_creat 8 -#define SOLARIS_link 9 -#define SOLARIS_unlink 10 -#define SOLARIS_exec 11 -#define SOLARIS_chdir 12 -#define SOLARIS_time 13 -#define SOLARIS_mknod 14 -#define SOLARIS_chmod 15 -#define SOLARIS_chown 16 -#define SOLARIS_brk 17 -#define SOLARIS_stat 18 -#define SOLARIS_lseek 19 -#define SOLARIS_getpid 20 -#define SOLARIS_mount 21 -#define SOLARIS_umount 22 -#define SOLARIS_setuid 23 -#define SOLARIS_getuid 24 -#define SOLARIS_stime 25 -#define SOLARIS_ptrace 26 -#define SOLARIS_alarm 27 -#define SOLARIS_fstat 28 -#define SOLARIS_pause 29 -#define SOLARIS_utime 30 -#define SOLARIS_stty 31 -#define SOLARIS_gtty 32 -#define SOLARIS_access 33 -#define SOLARIS_nice 34 -#define SOLARIS_statfs 35 -#define SOLARIS_sync 36 -#define SOLARIS_kill 37 -#define SOLARIS_fstatfs 38 -#define SOLARIS_pgrpsys 39 -#define SOLARIS_xenix 40 -#define SOLARIS_dup 41 -#define SOLARIS_pipe 42 -#define SOLARIS_times 43 -#define SOLARIS_profil 44 -#define SOLARIS_plock 45 -#define SOLARIS_setgid 46 -#define SOLARIS_getgid 47 -#define SOLARIS_signal 48 -#define SOLARIS_msgsys 49 -#define SOLARIS_syssun 50 -#define SOLARIS_acct 51 -#define SOLARIS_shmsys 52 -#define SOLARIS_semsys 53 -#define SOLARIS_ioctl 54 -#define SOLARIS_uadmin 55 -#define SOLARIS_utssys 57 -#define SOLARIS_fdsync 58 -#define SOLARIS_execve 59 -#define SOLARIS_umask 60 -#define SOLARIS_chroot 61 -#define SOLARIS_fcntl 62 -#define SOLARIS_ulimit 63 -#define SOLARIS_rmdir 79 -#define SOLARIS_mkdir 80 -#define SOLARIS_getdents 81 -#define SOLARIS_sysfs 84 -#define SOLARIS_getmsg 85 -#define SOLARIS_putmsg 86 -#define SOLARIS_poll 87 -#define SOLARIS_lstat 88 -#define SOLARIS_symlink 89 -#define SOLARIS_readlink 90 -#define SOLARIS_setgroups 91 -#define SOLARIS_getgroups 92 -#define SOLARIS_fchmod 93 -#define SOLARIS_fchown 94 -#define SOLARIS_sigprocmask 95 -#define SOLARIS_sigsuspend 96 -#define SOLARIS_sigaltstack 97 -#define SOLARIS_sigaction 98 -#define SOLARIS_sigpending 99 -#define SOLARIS_context 100 -#define SOLARIS_evsys 101 -#define SOLARIS_evtrapret 102 -#define SOLARIS_statvfs 103 -#define SOLARIS_fstatvfs 104 -#define SOLARIS_nfssys 106 -#define SOLARIS_waitsys 107 -#define SOLARIS_sigsendsys 108 -#define SOLARIS_hrtsys 109 -#define SOLARIS_acancel 110 -#define SOLARIS_async 111 -#define SOLARIS_priocntlsys 112 -#define SOLARIS_pathconf 113 -#define SOLARIS_mincore 114 -#define SOLARIS_mmap 115 -#define SOLARIS_mprotect 116 -#define SOLARIS_munmap 117 -#define SOLARIS_fpathconf 118 -#define SOLARIS_vfork 119 -#define SOLARIS_fchdir 120 -#define SOLARIS_readv 121 -#define SOLARIS_writev 122 -#define SOLARIS_xstat 123 -#define SOLARIS_lxstat 124 -#define SOLARIS_fxstat 125 -#define SOLARIS_xmknod 126 -#define SOLARIS_clocal 127 -#define SOLARIS_setrlimit 128 -#define SOLARIS_getrlimit 129 -#define SOLARIS_lchown 130 -#define SOLARIS_memcntl 131 -#define SOLARIS_getpmsg 132 -#define SOLARIS_putpmsg 133 -#define SOLARIS_rename 134 -#define SOLARIS_uname 135 -#define SOLARIS_setegid 136 -#define SOLARIS_sysconfig 137 -#define SOLARIS_adjtime 138 -#define SOLARIS_systeminfo 139 -#define SOLARIS_seteuid 141 -#define SOLARIS_vtrace 142 -#define SOLARIS_fork1 143 -#define SOLARIS_sigtimedwait 144 -#define SOLARIS_lwp_info 145 -#define SOLARIS_yield 146 -#define SOLARIS_lwp_sema_wait 147 -#define SOLARIS_lwp_sema_post 148 -#define SOLARIS_modctl 152 -#define SOLARIS_fchroot 153 -#define SOLARIS_utimes 154 -#define SOLARIS_vhangup 155 -#define SOLARIS_gettimeofday 156 -#define SOLARIS_getitimer 157 -#define SOLARIS_setitimer 158 -#define SOLARIS_lwp_create 159 -#define SOLARIS_lwp_exit 160 -#define SOLARIS_lwp_suspend 161 -#define SOLARIS_lwp_continue 162 -#define SOLARIS_lwp_kill 163 -#define SOLARIS_lwp_self 164 -#define SOLARIS_lwp_setprivate 165 -#define SOLARIS_lwp_getprivate 166 -#define SOLARIS_lwp_wait 167 -#define SOLARIS_lwp_mutex_unlock 168 -#define SOLARIS_lwp_mutex_lock 169 -#define SOLARIS_lwp_cond_wait 170 -#define SOLARIS_lwp_cond_signal 171 -#define SOLARIS_lwp_cond_broadcast 172 -#define SOLARIS_pread 173 -#define SOLARIS_pwrite 174 -#define SOLARIS_llseek 175 -#define SOLARIS_inst_sync 176 -#define SOLARIS_kaio 178 -#define SOLARIS_tsolsys 184 -#define SOLARIS_acl 185 -#define SOLARIS_auditsys 186 -#define SOLARIS_processor_bind 187 -#define SOLARIS_processor_info 188 -#define SOLARIS_p_online 189 -#define SOLARIS_sigqueue 190 -#define SOLARIS_clock_gettime 191 -#define SOLARIS_clock_settime 192 -#define SOLARIS_clock_getres 193 -#define SOLARIS_timer_create 194 -#define SOLARIS_timer_delete 195 -#define SOLARIS_timer_settime 196 -#define SOLARIS_timer_gettime 197 -#define SOLARIS_timer_getoverrun 198 -#define SOLARIS_nanosleep 199 -#define SOLARIS_facl 200 -#define SOLARIS_door 201 -#define SOLARIS_setreuid 202 -#define SOLARIS_setregid 203 -#define SOLARIS_signotifywait 210 -#define SOLARIS_lwp_sigredirect 211 -#define SOLARIS_lwp_alarm 212 - -#include "dummy2.h" - -extern int solaris_syscall(); -extern int solaris_exit(); -extern int solaris_fork(); -extern int solaris_read(); -extern int solaris_write(); -extern int solaris_open(); -extern int solaris_close(); -extern int solaris_wait(); -extern int solaris_creat(); -extern int solaris_link(); -extern int solaris_unlink(); -extern int solaris_exec(); -extern int solaris_chdir(); -extern int solaris_time(); -extern int solaris_mknod(); -extern int solaris_chmod(); -extern int solaris_chown(); -extern int solaris_brk(); -extern int solaris_stat(); -extern int solaris_lseek(); -extern int solaris_getpid(); -extern int solaris_mount(); -extern int solaris_umount(); -extern int solaris_setuid(); -extern int solaris_getuid(); -extern int solaris_stime(); -extern int solaris_ptrace(); -extern int solaris_alarm(); -extern int solaris_fstat(); -extern int solaris_pause(); -extern int solaris_utime(); -extern int solaris_stty(); -extern int solaris_gtty(); -extern int solaris_access(); -extern int solaris_nice(); -extern int solaris_statfs(); -extern int solaris_sync(); -extern int solaris_kill(); -extern int solaris_fstatfs(); -extern int solaris_pgrpsys(); -extern int solaris_setpgrp(); -extern int solaris_xenix(); -extern int solaris_syssgi(); -extern int solaris_dup(); -extern int solaris_pipe(); -extern int solaris_times(); -extern int solaris_profil(); -extern int solaris_plock(); -extern int solaris_setgid(); -extern int solaris_getgid(); -extern int solaris_sigcall(); -extern int solaris_msgsys(); -extern int solaris_syssun(); -extern int solaris_sysi86(); -extern int solaris_sysmips(); -extern int solaris_sysmachine(); -extern int solaris_acct(); -extern int solaris_shmsys(); -extern int solaris_semsys(); -extern int solaris_ioctl(); -extern int solaris_uadmin(); -extern int solaris_utssys(); -extern int solaris_fdsync(); -extern int solaris_execve(); -extern int solaris_umask(); -extern int solaris_chroot(); -extern int solaris_fcntl(); -extern int solaris_ulimit(); -extern int solaris_rmdir(); -extern int solaris_mkdir(); -extern int solaris_getdents(); -extern int solaris_sysfs(); -extern int solaris_getmsg(); -extern int solaris_putmsg(); -extern int solaris_poll(); -extern int solaris_lstat(); -extern int solaris_symlink(); -extern int solaris_readlink(); -extern int solaris_setgroups(); -extern int solaris_getgroups(); -extern int solaris_fchmod(); -extern int solaris_fchown(); -extern int solaris_sigprocmask(); -extern int solaris_sigsuspend(); -extern int solaris_sigaltstack(); -extern int solaris_sigaction(); -extern int solaris_spcall(); -extern int solaris_context(); -extern int solaris_evsys(); -extern int solaris_evtrapret(); -extern int solaris_statvfs(); -extern int solaris_fstatvfs(); -extern int solaris_nfssys(); -extern int solaris_waitid(); -extern int solaris_sigsendsys(); -extern int solaris_hrtsys(); -extern int solaris_acancel(); -extern int solaris_async(); -extern int solaris_priocntlsys(); -extern int solaris_pathconf(); -extern int solaris_mincore(); -extern int solaris_mmap(); -extern int solaris_mprotect(); -extern int solaris_munmap(); -extern int solaris_fpathconf(); -extern int solaris_vfork(); -extern int solaris_fchdir(); -extern int solaris_readv(); -extern int solaris_writev(); -extern int solaris_xstat(); -extern int solaris_lxstat(); -extern int solaris_fxstat(); -extern int solaris_xmknod(); -extern int solaris_clocal(); -extern int solaris_setrlimit(); -extern int solaris_getrlimit(); -extern int solaris_lchown(); -extern int solaris_memcntl(); -extern int solaris_getpmsg(); -extern int solaris_putpmsg(); -extern int solaris_rename(); -extern int solaris_uname(); -extern int solaris_setegid(); -extern int solaris_sysconfig(); -extern int solaris_adjtime(); -extern int solaris_sysinfo(); -extern int solaris_seteuid(); -extern int solaris_vtrace(); -extern int solaris_fork1(); -extern int solaris_sigtimedwait(); -extern int solaris_lwp_info(); -extern int solaris_yield(); -extern int solaris_lwp_sema_wait(); -extern int solaris_lwp_sema_post(); -extern int solaris_modctl(); -extern int solaris_fchroot(); -extern int solaris_utimes(); -extern int solaris_vhangup(); -extern int solaris_gettimeofday(); -extern int solaris_getitimer(); -extern int solaris_setitimer(); -extern int solaris_lwp_create(); -extern int solaris_lwp_exit(); -extern int solaris_lwp_suspend(); -extern int solaris_lwp_continue(); -extern int solaris_lwp_kill(); -extern int solaris_lwp_self(); -extern int solaris_lwp_setprivate(); -extern int solaris_lwp_getprivate(); -extern int solaris_lwp_wait(); -extern int solaris_lwp_mutex_unlock(); -extern int solaris_lwp_mutex_lock(); -extern int solaris_lwp_cond_wait(); -extern int solaris_lwp_cond_signal(); -extern int solaris_lwp_cond_broadcast(); -extern int solaris_pread(); -extern int solaris_pwrite(); -extern int solaris_llseek(); -extern int solaris_inst_sync(); -extern int solaris_auditsys(); -extern int solaris_processor_bind(); -extern int solaris_processor_info(); -extern int solaris_p_online(); -extern int solaris_sigqueue(); -extern int solaris_clock_gettime(); -extern int solaris_clock_settime(); -extern int solaris_clock_getres(); -extern int solaris_timer_create(); -extern int solaris_timer_delete(); -extern int solaris_timer_settime(); -extern int solaris_timer_gettime(); -extern int solaris_timer_getoverrun(); -extern int solaris_nanosleep(); - -/* solaris_pgrpsys subcalls */ - -extern int solaris_getpgrp(), solaris_setpgrp(), solaris_getsid(); -extern int solaris_setsid(), solaris_getpgid(), solaris_setpgid(); - -#define SOLARIS_pgrpsys_subcall 300 -#define SOLARIS_getpgrp (SOLARIS_pgrpsys_subcall + 0) -#define SOLARIS_setpgrp (SOLARIS_pgrpsys_subcall + 1) -#define SOLARIS_getsid (SOLARIS_pgrpsys_subcall + 2) -#define SOLARIS_setsid (SOLARIS_pgrpsys_subcall + 3) -#define SOLARIS_getpgid (SOLARIS_pgrpsys_subcall + 4) -#define SOLARIS_setpgid (SOLARIS_pgrpsys_subcall + 5) - -#define SOLARIS_pgrpsys_nsubcalls 6 - -/* solaris_sigcall subcalls */ - -#undef SOLARIS_signal -#define SOLARIS_sigcall 48 - -extern int solaris_signal(), solaris_sigset(), solaris_sighold(); -extern int solaris_sigrelse(), solaris_sigignore(), solaris_sigpause(); - -#define SOLARIS_sigcall_subcall 310 -#define SOLARIS_signal (SOLARIS_sigcall_subcall + 0) -#define SOLARIS_sigset (SOLARIS_sigcall_subcall + 1) -#define SOLARIS_sighold (SOLARIS_sigcall_subcall + 2) -#define SOLARIS_sigrelse (SOLARIS_sigcall_subcall + 3) -#define SOLARIS_sigignore (SOLARIS_sigcall_subcall + 4) -#define SOLARIS_sigpause (SOLARIS_sigcall_subcall + 5) - -#define SOLARIS_sigcall_nsubcalls 6 - -/* msgsys subcalls */ - -extern int solaris_msgget(), solaris_msgctl(), solaris_msgrcv(), solaris_msgsnd(); - -#define SOLARIS_msgsys_subcall 320 -#define SOLARIS_msgget (SOLARIS_msgsys_subcall + 0) -#define SOLARIS_msgctl (SOLARIS_msgsys_subcall + 1) -#define SOLARIS_msgrcv (SOLARIS_msgsys_subcall + 2) -#define SOLARIS_msgsnd (SOLARIS_msgsys_subcall + 3) - -#define SOLARIS_msgsys_nsubcalls 4 - -/* shmsys subcalls */ - -extern int solaris_shmat(), solaris_shmctl(), solaris_shmdt(), solaris_shmget(); - -#define SOLARIS_shmsys_subcall 330 -#define SOLARIS_shmat (SOLARIS_shmsys_subcall + 0) -#define SOLARIS_shmctl (SOLARIS_shmsys_subcall + 1) -#define SOLARIS_shmdt (SOLARIS_shmsys_subcall + 2) -#define SOLARIS_shmget (SOLARIS_shmsys_subcall + 3) - -#define SOLARIS_shmsys_nsubcalls 4 - -/* semsys subcalls */ - -extern int solaris_semctl(), solaris_semget(), solaris_semop(); - -#define SOLARIS_semsys_subcall 340 -#define SOLARIS_semctl (SOLARIS_semsys_subcall + 0) -#define SOLARIS_semget (SOLARIS_semsys_subcall + 1) -#define SOLARIS_semop (SOLARIS_semsys_subcall + 2) - -#define SOLARIS_semsys_nsubcalls 3 - -/* utssys subcalls */ - -extern int solaris_olduname(), solaris_ustat(), solaris_fusers(); - -#define SOLARIS_utssys_subcall 350 - -#define SOLARIS_olduname (SOLARIS_utssys_subcall + 0) - /* 1 is unused */ -#define SOLARIS_ustat (SOLARIS_utssys_subcall + 2) -#define SOLARIS_fusers (SOLARIS_utssys_subcall + 3) - -#define SOLARIS_utssys_nsubcalls 4 - -/* sysfs subcalls */ - -extern int solaris_sysfs1(), solaris_sysfs2(), solaris_sysfs3(); - -#define SOLARIS_sysfs_subcall 360 - /* 0 is unused */ -#define SOLARIS_sysfs1 (SOLARIS_sysfs_subcall + 1) -#define SOLARIS_sysfs2 (SOLARIS_sysfs_subcall + 2) -#define SOLARIS_sysfs3 (SOLARIS_sysfs_subcall + 3) - -#define SOLARIS_sysfs_nsubcalls 4 - -/* solaris_spcall subcalls */ - -#undef SOLARIS_sigpending -#define SOLARIS_spcall 99 - -extern int solaris_sigpending(), solaris_sigfillset(); - -#define SOLARIS_spcall_subcall 370 - /* 0 is unused */ -#define SOLARIS_sigpending (SOLARIS_spcall_subcall + 1) -#define SOLARIS_sigfillset (SOLARIS_spcall_subcall + 2) - -#define SOLARIS_spcall_nsubcalls 3 - -/* solaris_context subcalls */ - -extern int solaris_getcontext(), solaris_setcontext(); - -#define SOLARIS_context_subcall 380 -#define SOLARIS_getcontext (SOLARIS_context_subcall + 0) -#define SOLARIS_setcontext (SOLARIS_context_subcall + 1) - -#define SOLARIS_context_nsubcalls 2 diff --git a/linux/sparc64/syscallent.h b/linux/sparc64/syscallent.h index 776b5f11..ffc35a19 100644 --- a/linux/sparc64/syscallent.h +++ b/linux/sparc64/syscallent.h @@ -1 +1,361 @@ -#include "../sparc/syscallent.h" +[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[ 1] = { 1, TP|SE, SEN(exit), "exit" }, +[ 2] = { 0, TP, SEN(fork), "fork" }, +[ 3] = { 3, TD, SEN(read), "read" }, +[ 4] = { 3, TD, SEN(write), "write" }, +[ 5] = { 3, TD|TF, SEN(open), "open" }, +[ 6] = { 1, TD, SEN(close), "close" }, +[ 7] = { 4, TP, SEN(wait4), "wait4" }, +[ 8] = { 2, TD|TF, SEN(creat), "creat" }, +[ 9] = { 2, TF, SEN(link), "link" }, +[ 10] = { 1, TF, SEN(unlink), "unlink" }, +[ 11] = { 2, TF|TP|SE|SI, SEN(execv), "execv" }, +[ 12] = { 1, TF, SEN(chdir), "chdir" }, +[ 13] = { 3, TF, SEN(chown), "chown" }, +[ 14] = { 3, TF, SEN(mknod), "mknod" }, +[ 15] = { 2, TF, SEN(chmod), "chmod" }, +[ 16] = { 3, TF, SEN(chown), "lchown" }, +[ 17] = { 1, TM|SI, SEN(brk), "brk" }, +[ 18] = { 4, 0, SEN(printargs), "perfctr" }, +[ 19] = { 3, TD, SEN(lseek), "lseek" }, +[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 21] = { 2, 0, SEN(capget), "capget" }, +[ 22] = { 2, 0, SEN(capset), "capset" }, +[ 23] = { 1, 0, SEN(setuid), "setuid" }, +[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 25] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, +[ 27] = { 1, 0, SEN(alarm), "alarm" }, +[ 28] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[ 29] = { 0, TS, SEN(pause), "pause" }, +[ 30] = { 2, TF, SEN(utime), "utime" }, +[ 31 ... 32] = { }, +[ 33] = { 2, TF, SEN(access), "access" }, +[ 34] = { 1, 0, SEN(nice), "nice" }, +[ 35] = { }, +[ 36] = { 0, 0, SEN(sync), "sync" }, +[ 37] = { 2, TS, SEN(kill), "kill" }, +[ 38] = { 2, TF, SEN(stat), "stat" }, +[ 39] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[ 40] = { 2, TF, SEN(lstat), "lstat" }, +[ 41] = { 1, TD, SEN(dup), "dup" }, +[ 42] = { 0, TD, SEN(pipe), "pipe" }, +[ 43] = { 1, 0, SEN(times), "times" }, +[ 44] = { }, +[ 45] = { 2, TF, SEN(umount2), "umount2" }, +[ 46] = { 1, 0, SEN(setgid), "setgid" }, +[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 48] = { 2, TS, SEN(signal), "signal" }, +[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 51] = { 1, TF, SEN(acct), "acct" }, +[ 52] = { 2, 0, SEN(printargs), "memory_ordering" }, +[ 53] = { }, +[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 55] = { 4, 0, SEN(reboot), "reboot" }, +[ 56] = { }, +[ 57] = { 2, TF, SEN(symlink), "symlink" }, +[ 58] = { 3, TF, SEN(readlink), "readlink" }, +[ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, +[ 61] = { 1, TF, SEN(chroot), "chroot" }, +[ 62] = { 2, TD, SEN(fstat), "fstat" }, +[ 63] = { 2, TD, SEN(fstat64), "fstat64" }, +[ 64] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[ 65] = { 3, TM, SEN(msync), "msync" }, +[ 66] = { 0, TP, SEN(vfork), "vfork" }, +[ 67] = { 4, TD, SEN(pread), "pread64" }, +[ 68] = { 4, TD, SEN(pwrite), "pwrite64" }, +[ 69 ... 70] = { }, +[ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 72] = { }, +[ 73] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[ 75] = { 3, TM, SEN(madvise), "madvise" }, +[ 76] = { 0, 0, SEN(vhangup), "vhangup" }, +[ 77] = { }, +[ 78] = { 3, TM, SEN(mincore), "mincore" }, +[ 79] = { 2, 0, SEN(getgroups), "getgroups" }, +[ 80] = { 2, 0, SEN(setgroups), "setgroups" }, +[ 81] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 82] = { }, +[ 83] = { 3, 0, SEN(setitimer), "setitimer" }, +[ 84] = { }, +[ 85] = { 2, TF, SEN(swapon), "swapon" }, +[ 86] = { 2, 0, SEN(getitimer), "getitimer" }, +[ 87] = { }, +[ 88] = { 2, 0, SEN(sethostname), "sethostname" }, +[ 89] = { }, +[ 90] = { 2, TD, SEN(dup2), "dup2" }, +[ 91] = { }, +[ 92] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 93] = { 5, TD, SEN(select), "select" }, +[ 94] = { }, +[ 95] = { 1, TD, SEN(fsync), "fsync" }, +[ 96] = { 3, 0, SEN(setpriority), "setpriority" }, +[ 97] = { 3, TN, SEN(socket), "socket" }, +[ 98] = { 3, TN, SEN(connect), "connect" }, +[ 99] = { 3, TN, SEN(accept), "accept" }, +[100] = { 2, 0, SEN(getpriority), "getpriority" }, +[101] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[102] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" }, +[103] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[104] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[105] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[106] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[107] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[108] = { 3, 0, SEN(setresuid), "setresuid" }, +[109] = { 3, 0, SEN(getresuid), "getresuid" }, +[110] = { 3, 0, SEN(setresgid), "setresgid" }, +[111] = { 3, 0, SEN(getresgid), "getresgid" }, +[112] = { }, +[113] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[114] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[115] = { }, +[116] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[117] = { 2, 0, SEN(getrusage), "getrusage" }, +[118] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[119] = { 2, TF, SEN(getcwd), "getcwd" }, +[120] = { 3, TD, SEN(readv), "readv" }, +[121] = { 3, TD, SEN(writev), "writev" }, +[122] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[123] = { 3, TD, SEN(fchown), "fchown" }, +[124] = { 2, TD, SEN(fchmod), "fchmod" }, +[125] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[126] = { 2, 0, SEN(setreuid), "setreuid" }, +[127] = { 2, 0, SEN(setregid), "setregid" }, +[128] = { 2, TF, SEN(rename), "rename" }, +[129] = { 2, TF, SEN(truncate), "truncate" }, +[130] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[131] = { 2, TD, SEN(flock), "flock" }, +[132] = { 2, TF, SEN(lstat64), "lstat64" }, +[133] = { 6, TN, SEN(sendto), "sendto" }, +[134] = { 2, TN, SEN(shutdown), "shutdown" }, +[135] = { 4, TN, SEN(socketpair), "socketpair" }, +[136] = { 2, TF, SEN(mkdir), "mkdir" }, +[137] = { 1, TF, SEN(rmdir), "rmdir" }, +[138] = { 2, TF, SEN(utimes), "utimes" }, +[139] = { 2, TF, SEN(stat64), "stat64" }, +[140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[141] = { 3, TN, SEN(getpeername), "getpeername" }, +[142] = { 6, 0, SEN(futex), "futex" }, +[143] = { 0, NF, SEN(gettid), "gettid" }, +[144] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[145] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[146] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[147] = { 5, 0, SEN(prctl), "prctl" }, +[148] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[149] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[150] = { 3, TN, SEN(getsockname), "getsockname" }, +[151] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[152] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[153] = { 3, TD, SEN(poll), "poll" }, +[154] = { 3, TD, SEN(getdents64), "getdents64" }, +[155] = { }, +[156] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[157] = { 2, TF, SEN(statfs), "statfs" }, +[158] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[159] = { 1, TF, SEN(umount), "umount" }, +[160] = { 3, 0, SEN(sched_setaffinity), "sched_set_affinity" }, +[161] = { 3, 0, SEN(sched_getaffinity), "sched_get_affinity" }, +[162] = { 2, 0, SEN(printargs), "getdomainname" }, +[163] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[164] = { 5, 0, SEN(printargs), "utrap_install" }, +[165] = { 4, TF, SEN(quotactl), "quotactl" }, +[166] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[167] = { 5, TF, SEN(mount), "mount" }, +[168] = { 2, 0, SEN(ustat), "ustat" }, +[169] = { 5, TF, SEN(setxattr), "setxattr" }, +[170] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[171] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[172] = { 4, TF, SEN(getxattr), "getxattr" }, +[173] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[174] = { 3, TD, SEN(getdents), "getdents" }, +[175] = { 0, 0, SEN(setsid), "setsid" }, +[176] = { 1, TD, SEN(fchdir), "fchdir" }, +[177] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[178] = { 3, TF, SEN(listxattr), "listxattr" }, +[179] = { 3, TF, SEN(listxattr), "llistxattr" }, +[180] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[181] = { 2, TF, SEN(removexattr), "removexattr" }, +[182] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[183] = { 1, TS, SEN(sigpending), "sigpending" }, +[184] = { 5, 0, SEN(query_module), "query_module" }, +[185] = { 2, 0, SEN(setpgid), "setpgid" }, +[186] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[187] = { 2, TS, SEN(kill), "tkill" }, +[188] = { 1, TP|SE, SEN(exit), "exit_group" }, +[189] = { 1, 0, SEN(uname), "uname" }, +[190] = { 3, 0, SEN(init_module), "init_module" }, +[191] = { 1, NF, SEN(personality), "personality" }, +[192] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[193] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[194] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[195] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[196] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[197] = { 0, NF, SEN(getppid), "getppid" }, +[198] = { 3, TS, SEN(sigaction), "sigaction" }, +[199] = { 0, TS, SEN(siggetmask), "sgetmask" }, +[200] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[201] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[202] = { 2, TF, SEN(lstat), "oldlstat" }, +[203] = { 1, TF, SEN(uselib), "uselib" }, +[204] = { 3, TD, SEN(readdir), "readdir" }, +[205] = { 3, TD, SEN(readahead), "readahead" }, +[206] = { 2, TD, SEN(socketcall), "socketcall" }, +[207] = { 3, 0, SEN(syslog), "syslog" }, +[208] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[209] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[210] = { 4, TD, SEN(fadvise64_64), "fadvise64_64" }, +[211] = { 3, TS, SEN(tgkill), "tgkill" }, +[212] = { 3, TP, SEN(waitpid), "waitpid" }, +[213] = { 1, TF, SEN(swapoff), "swapoff" }, +[214] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[215] = { 6, TI, SEN(ipc), "ipc" }, +[216] = { 0, TS, SEN(sigreturn), "sigreturn" }, +[217] = { 5, TP, SEN(clone), "clone" }, +[218] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[219] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[220] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +[221] = { 2, 0, SEN(create_module), "create_module" }, +[222] = { 2, 0, SEN(delete_module), "delete_module" }, +[223] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[224] = { 1, 0, SEN(getpgid), "getpgid" }, +[225] = { 2, 0, SEN(bdflush), "bdflush" }, +[226] = { 3, 0, SEN(sysfs), "sysfs" }, +[227] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[228] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[229] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[230] = { 5, TD, SEN(select), "_newselect" }, +[231] = { }, +[232] = { 6, TD, SEN(splice), "splice" }, +[233] = { 1, 0, SEN(stime), "stime" }, +[234] = { 3, TF, SEN(statfs64), "statfs64" }, +[235] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[236] = { 5, TD, SEN(llseek), "_llseek" }, +[237] = { 2, TM, SEN(mlock), "mlock" }, +[238] = { 2, TM, SEN(munlock), "munlock" }, +[239] = { 1, TM, SEN(mlockall), "mlockall" }, +[240] = { 0, TM, SEN(munlockall), "munlockall" }, +[241] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[242] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[243] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[244] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[245] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[246] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[247] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[248] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[249] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[250] = { 5, TM|SI, SEN(mremap), "mremap" }, +[251] = { 1, 0, SEN(sysctl), "_sysctl" }, +[252] = { 1, 0, SEN(getsid), "getsid" }, +[253] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[254] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[255] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[256] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[257] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[258] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[259] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[260] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[261] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[262] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[263] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[264] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[265] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[266] = { 3, 0, SEN(timer_create), "timer_create" }, +[267] = { }, +[268] = { 2, TM, SEN(io_setup), "io_setup" }, +[269] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[270] = { 3, 0, SEN(io_submit), "io_submit" }, +[271] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[272] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[273] = { 4, 0, SEN(mq_open), "mq_open" }, +[274] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[275] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[276] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[277] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[278] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[279] = { 5, TP, SEN(waitid), "waitid" }, +[280] = { 4, TD, SEN(tee), "tee" }, +[281] = { 5, 0, SEN(add_key), "add_key" }, +[282] = { 4, 0, SEN(request_key), "request_key" }, +[283] = { 5, 0, SEN(keyctl), "keyctl" }, +[284] = { 4, TD|TF, SEN(openat), "openat" }, +[285] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[286] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[287] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[288] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[289] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[290] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[291] = { 4, TD|TF, SEN(renameat), "renameat" }, +[292] = { 5, TD|TF, SEN(linkat), "linkat" }, +[293] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[294] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[295] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[296] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[297] = { 6, TD, SEN(pselect6), "pselect6" }, +[298] = { 5, TD, SEN(ppoll), "ppoll" }, +[299] = { 1, TP, SEN(unshare), "unshare" }, +[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[301] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[302] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[303] = { 6, TM, SEN(mbind), "mbind" }, +[304] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[305] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[306] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[307] = { 6, TM, SEN(move_pages), "move_pages" }, +[308] = { 3, 0, SEN(getcpu), "getcpu" }, +[309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[310] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[311] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[313] = { 1, TD, SEN(eventfd), "eventfd" }, +[314] = { 4, TD, SEN(fallocate), "fallocate" }, +[315] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[316] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[317] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[318] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[319] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[320] = { 3, TD, SEN(dup3), "dup3" }, +[321] = { 2, TD, SEN(pipe2), "pipe2" }, +[322] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[323] = { 4, TN, SEN(accept4), "accept4" }, +[324] = { 4, TD, SEN(preadv), "preadv" }, +[325] = { 4, TD, SEN(pwritev), "pwritev" }, +[326] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[327] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[328] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[329] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[330] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[331] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[332] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[333] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[334] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[335] = { 1, TD, SEN(syncfs), "syncfs" }, +[336] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[337] = { 2, TD, SEN(setns), "setns" }, +[338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[340] = { 0, NF, SEN(printargs), "kern_features" }, +[341] = { 5, 0, SEN(kcmp), "kcmp" }, +[342] = { 3, TD, SEN(finit_module), "finit_module" }, +[343] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[344] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[345] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[346] = { 3, 0, SEN(seccomp), "seccomp" }, +[347] = { 3, 0, SEN(getrandom), "getrandom" }, +[348] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[349] = { 3, TD, SEN(bpf), "bpf" }, +[350] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[351] = { 2, 0, SEN(membarrier), "membarrier" }, +[352] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[353] = { 3, TN, SEN(bind), "bind" }, +[354] = { 2, TN, SEN(listen), "listen" }, +[355] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[356] = { 3, TM, SEN(mlock2), "mlock2" }, +[357] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[358] = { 6, TD, SEN(preadv2), "preadv2" }, +[359] = { 6, TD, SEN(pwritev2), "pwritev2" }, + +#define SYS_socket_subcall 400 +#include "subcall.h" diff --git a/linux/sparc64/syscallent1.h b/linux/sparc64/syscallent1.h index 821d77c2..776b5f11 100644 --- a/linux/sparc64/syscallent1.h +++ b/linux/sparc64/syscallent1.h @@ -1 +1 @@ -#include "../sparc/syscallent1.h" +#include "../sparc/syscallent.h" diff --git a/linux/sparc64/syscallent2.h b/linux/sparc64/syscallent2.h deleted file mode 100644 index 776b5f11..00000000 --- a/linux/sparc64/syscallent2.h +++ /dev/null @@ -1 +0,0 @@ -#include "../sparc/syscallent.h" diff --git a/linux/sparc64/userent.h b/linux/sparc64/userent.h new file mode 100644 index 00000000..9387e254 --- /dev/null +++ b/linux/sparc64/userent.h @@ -0,0 +1,7 @@ +XLAT_UOFF(u_tsize), +XLAT_UOFF(u_dsize), +XLAT_UOFF(u_ssize), +XLAT_UOFF(signal), +XLAT_UOFF(magic), +XLAT_UOFF(u_comm), +#include "../userent0.h" diff --git a/linux/subcall.h b/linux/subcall.h index 54f7fcaf..169e5eab 100644 --- a/linux/subcall.h +++ b/linux/subcall.h @@ -1,6 +1,73 @@ +/* + * Copyright (c) 2013-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #ifndef SYS_socket_subcall # error SYS_socket_subcall is not defined #endif -#define SYS_socket_nsubcalls 20 -#define SYS_ipc_subcall ((SYS_socket_subcall)+(SYS_socket_nsubcalls)) + +#define IS TRACE_INDIRECT_SUBCALL + +[SYS_socket_subcall + 1] = { 3, IS|TN, SEN(socket), "socket" }, +[SYS_socket_subcall + 2] = { 3, IS|TN, SEN(bind), "bind" }, +[SYS_socket_subcall + 3] = { 3, IS|TN, SEN(connect), "connect" }, +[SYS_socket_subcall + 4] = { 2, IS|TN, SEN(listen), "listen" }, +[SYS_socket_subcall + 5] = { 3, IS|TN, SEN(accept), "accept" }, +[SYS_socket_subcall + 6] = { 3, IS|TN, SEN(getsockname), "getsockname" }, +[SYS_socket_subcall + 7] = { 3, IS|TN, SEN(getpeername), "getpeername" }, +[SYS_socket_subcall + 8] = { 4, IS|TN, SEN(socketpair), "socketpair" }, +[SYS_socket_subcall + 9] = { 4, IS|TN, SEN(send), "send" }, +[SYS_socket_subcall + 10] = { 4, IS|TN, SEN(recv), "recv" }, +[SYS_socket_subcall + 11] = { 6, IS|TN, SEN(sendto), "sendto" }, +[SYS_socket_subcall + 12] = { 6, IS|TN, SEN(recvfrom), "recvfrom" }, +[SYS_socket_subcall + 13] = { 2, IS|TN, SEN(shutdown), "shutdown" }, +[SYS_socket_subcall + 14] = { 5, IS|TN, SEN(setsockopt), "setsockopt" }, +[SYS_socket_subcall + 15] = { 5, IS|TN, SEN(getsockopt), "getsockopt" }, +[SYS_socket_subcall + 16] = { 3, IS|TN, SEN(sendmsg), "sendmsg" }, +[SYS_socket_subcall + 17] = { 3, IS|TN, SEN(recvmsg), "recvmsg" }, +[SYS_socket_subcall + 18] = { 4, IS|TN, SEN(accept4), "accept4" }, +[SYS_socket_subcall + 19] = { 5, IS|TN, SEN(recvmmsg), "recvmmsg" }, +[SYS_socket_subcall + 20] = { 4, IS|TN, SEN(sendmmsg), "sendmmsg" }, + +#define SYS_socket_nsubcalls 21 +#define SYS_ipc_subcall ((SYS_socket_subcall) + (SYS_socket_nsubcalls)) + +[SYS_ipc_subcall + 1] = { 4, IS|TI, SEN(semop), "semop" }, +[SYS_ipc_subcall + 2] = { 3, IS|TI, SEN(semget), "semget" }, +[SYS_ipc_subcall + 3] = { 4, IS|TI, SEN(semctl), "semctl" }, +[SYS_ipc_subcall + 4] = { 5, IS|TI, SEN(semtimedop), "semtimedop" }, +[SYS_ipc_subcall + 11] = { 4, IS|TI, SEN(msgsnd), "msgsnd" }, +[SYS_ipc_subcall + 12] = { 5, IS|TI, SEN(msgrcv), "msgrcv" }, +[SYS_ipc_subcall + 13] = { 2, IS|TI, SEN(msgget), "msgget" }, +[SYS_ipc_subcall + 14] = { 4, IS|TI, SEN(msgctl), "msgctl" }, +[SYS_ipc_subcall + 21] = { 4, IS|TI|TM|SI, SEN(shmat), "shmat" }, +[SYS_ipc_subcall + 22] = { 4, IS|TI|TM|SI, SEN(shmdt), "shmdt" }, +[SYS_ipc_subcall + 23] = { 3, IS|TI, SEN(shmget), "shmget" }, +[SYS_ipc_subcall + 24] = { 4, IS|TI, SEN(shmctl), "shmctl" }, + #define SYS_ipc_nsubcalls 25 + +#undef IS diff --git a/linux/syscall.h b/linux/syscall.h index 0e695989..6bf8b420 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -26,335 +26,24 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "dummy.h" - -/* common syscalls */ - -int sys_accept(); -int sys_accept4(); -int sys_access(); -int sys_add_key(); -int sys_adjtimex(); -int sys_arch_prctl(); -int sys_bind(); -int sys_brk(); -int sys_capget(); -int sys_capset(); -int sys_chdir(); -int sys_chmod(); -int sys_chown(); -int sys_clock_adjtime(); -int sys_clock_gettime(); -int sys_clock_nanosleep(); -int sys_clock_settime(); -int sys_clone(); -int sys_close(); -int sys_connect(); -int sys_creat(); -int sys_create_module(); -int sys_delete_module(); -int sys_dup(); -int sys_dup2(); -int sys_dup3(); -int sys_epoll_create(); -int sys_epoll_create1(); -int sys_epoll_ctl(); -int sys_epoll_pwait(); -int sys_epoll_wait(); -int sys_eventfd(); -int sys_eventfd2(); -int sys_execve(); -int sys_exit(); -int sys_faccessat(); -int sys_fadvise64(); -int sys_fadvise64_64(); -int sys_fallocate(); -int sys_fanotify_init(); -int sys_fanotify_mark(); -int sys_fchmod(); -int sys_fchmodat(); -int sys_fchown(); -int sys_fchownat(); -int sys_fcntl(); -int sys_fgetxattr(); -int sys_finit_module(); -int sys_flistxattr(); -int sys_flock(); -int sys_fork(); -int sys_fremovexattr(); -int sys_fsetxattr(); -int sys_fstat(); -int sys_fstat64(); -int sys_fstatfs(); -int sys_fstatfs64(); -int sys_ftruncate(); -int sys_ftruncate64(); -int sys_futex(); -int sys_futimesat(); -int sys_get_mempolicy(); -int sys_get_robust_list(); -int sys_get_thread_area(); -int sys_getcpu(); -int sys_getcwd(); -int sys_getdents(); -int sys_getdents64(); -int sys_getdtablesize(); -int sys_getgroups(); -int sys_getgroups32(); -int sys_gethostname(); -int sys_getitimer(); -int sys_getpeername(); -int sys_getpmsg(); /* TODO: non-Linux, remove? */ -int sys_getpriority(); -int sys_getresuid(); -int sys_getrlimit(); -int sys_getrusage(); -int sys_getsockname(); -int sys_getsockopt(); -int sys_gettimeofday(); -int sys_getuid(); -int sys_getxattr(); -int sys_init_module(); -int sys_inotify_add_watch(); -int sys_inotify_init1(); -int sys_inotify_rm_watch(); -int sys_io_cancel(); -int sys_io_destroy(); -int sys_io_getevents(); -int sys_io_setup(); -int sys_io_submit(); -int sys_ioctl(); -int sys_ioprio_get(); -int sys_ioprio_set(); -int sys_ipc(); -int sys_keyctl(); -int sys_kexec_load(); -int sys_kill(); -int sys_link(); -int sys_linkat(); -int sys_listen(); -int sys_listxattr(); -int sys_llseek(); -int sys_lseek(); -int sys_madvise(); -int sys_mbind(); -int sys_migrate_pages(); -int sys_mincore(); -int sys_mkdir(); -int sys_mkdirat(); -int sys_mknod(); -int sys_mknodat(); -int sys_mlockall(); -int sys_mmap(); -int sys_mmap_pgoff(); -int sys_mmap_4koff(); -int sys_modify_ldt(); -int sys_mount(); -int sys_move_pages(); -int sys_mprotect(); -int sys_mq_getsetattr(); -int sys_mq_notify(); -int sys_mq_open(); -int sys_mq_timedreceive(); -int sys_mq_timedsend(); -int sys_mremap(); -int sys_msgctl(); -int sys_msgget(); -int sys_msgrcv(); -int sys_msgsnd(); -int sys_msync(); -int sys_munmap(); -int sys_nanosleep(); -int sys_newfstatat(); -int sys_old_mmap(); -int sys_old_mmap_pgoff(); -int sys_oldfstat(); -int sys_oldselect(); -int sys_oldstat(); -int sys_open(); -int sys_openat(); -int sys_perf_event_open(); -int sys_personality(); -int sys_pipe(); -int sys_pipe2(); -int sys_poll(); -int sys_poll(); -int sys_ppoll(); -int sys_prctl(); -int sys_pread(); -int sys_preadv(); -int sys_prlimit64(); -int sys_process_vm_readv(); -int sys_process_vm_writev(); -int sys_pselect6(); -int sys_ptrace(); -int sys_putpmsg(); /* TODO: non-Linux, remove? */ -int sys_pwrite(); -int sys_pwritev(); -int sys_query_module(); -int sys_quotactl(); -int sys_read(); -int sys_readahead(); -int sys_readdir(); -int sys_readlink(); -int sys_readlinkat(); -int sys_readv(); -int sys_reboot(); -int sys_recv(); -int sys_recvfrom(); -int sys_recvmmsg(); -int sys_recvmsg(); -int sys_remap_file_pages(); -int sys_removexattr(); -int sys_renameat(); -int sys_renameat2(); -int sys_request_key(); -int sys_restart_syscall(); -int sys_rt_sigaction(); -int sys_rt_sigpending(); -int sys_rt_sigprocmask(); -int sys_rt_sigqueueinfo(); -int sys_rt_sigsuspend(); -int sys_rt_sigtimedwait(); -int sys_rt_tgsigqueueinfo(); -int sys_sched_get_priority_min(); -int sys_sched_getaffinity(); -int sys_sched_getparam(); -int sys_sched_getscheduler(); -int sys_sched_rr_get_interval(); -int sys_sched_setaffinity(); -int sys_sched_setparam(); -int sys_sched_setscheduler(); -int sys_select(); -int sys_semctl(); -int sys_semget(); -int sys_semop(); -int sys_semtimedop(); -int sys_send(); -int sys_sendfile(); -int sys_sendfile64(); -int sys_sendmmsg(); -int sys_sendmsg(); -int sys_sendto(); -int sys_set_mempolicy(); -int sys_set_thread_area(); -int sys_setdomainname(); -int sys_setfsuid(); -int sys_setgroups(); -int sys_setgroups32(); -int sys_sethostname(); -int sys_setitimer(); -int sys_setns(); -int sys_setpriority(); -int sys_setresuid(); -int sys_setreuid(); -int sys_setrlimit(); -int sys_setsockopt(); -int sys_settimeofday(); -int sys_setuid(); -int sys_setxattr(); -int sys_shmat(); -int sys_shmctl(); -int sys_shmdt(); -int sys_shmget(); -int sys_shutdown(); -int sys_sigaction(); -int sys_sigaltstack(); -int sys_siggetmask(); -int sys_signal(); -int sys_signalfd(); -int sys_signalfd4(); -int sys_sigpending(); -int sys_sigprocmask(); -int sys_sigreturn(); -int sys_sigsetmask(); -int sys_sigsuspend(); -int sys_socket(); -int sys_socketcall(); -int sys_socketpair(); -int sys_splice(); -int sys_stat(); -int sys_stat64(); -int sys_statfs(); -int sys_statfs64(); -int sys_stime(); -int sys_swapon(); -int sys_symlinkat(); -int sys_sync_file_range(); -int sys_sync_file_range2(); -int sys_sysctl(); -int sys_sysinfo(); -int sys_syslog(); -int sys_tee(); -int sys_tgkill(); -int sys_time(); -int sys_timer_create(); -int sys_timer_gettime(); -int sys_timer_settime(); -int sys_timerfd(); -int sys_timerfd_create(); -int sys_timerfd_gettime(); -int sys_timerfd_settime(); -int sys_times(); -int sys_truncate(); -int sys_truncate64(); -int sys_umask(); -int sys_umount2(); -int sys_uname(); -int sys_unlinkat(); -int sys_unshare(); -int sys_utime(); -int sys_utimensat(); -int sys_utimes(); -int sys_vmsplice(); -int sys_wait4(); -int sys_waitid(); -int sys_waitpid(); -int sys_write(); -int sys_writev(); - -/* architecture-specific calls */ -#ifdef ALPHA -int osf_statfs(); -int osf_fstatfs(); -int sys_osf_getitimer(); -int sys_osf_getrusage(); -int sys_osf_gettimeofday(); -int sys_osf_select(); -int sys_osf_setitimer(); -int sys_osf_settimeofday(); -int sys_osf_utimes(); -int sys_osf_wait4(); -#endif +#ifndef STRACE_LINUX_SYSCALL_H +#define STRACE_LINUX_SYSCALL_H -#if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64) -int sys_getpagesize(); -#endif - -#ifdef MIPS -int sys_sysmips(); -#endif - -#if defined M68K || defined SH -int sys_cacheflush(); -#endif - -#if defined OR1K -int sys_or1k_atomic(); -#endif - -#ifdef POWERPC -int sys_subpage_prot(); -#endif - -#ifdef BFIN -int sys_cacheflush(); -int sys_sram_alloc(); -#endif - -#if defined SPARC || defined SPARC64 -#include "sparc/syscall1.h" -int sys_execv(); -int sys_getmsg(); -int sys_putmsg(); -#endif +#include "dummy.h" +#include "sys_func.h" +#include "sen.h" + +#if NEED_UID16_PARSERS +extern SYS_FUNC(chown16); +extern SYS_FUNC(fchown16); +extern SYS_FUNC(getgroups16); +extern SYS_FUNC(getresuid16); +extern SYS_FUNC(getuid16); +extern SYS_FUNC(setfsuid16); +extern SYS_FUNC(setgroups16); +extern SYS_FUNC(setresuid16); +extern SYS_FUNC(setreuid16); +extern SYS_FUNC(setuid16); +#endif + +#endif /* !STRACE_LINUX_SYSCALL_H */ diff --git a/linux/tile/arch_regs.c b/linux/tile/arch_regs.c new file mode 100644 index 00000000..6a7309d2 --- /dev/null +++ b/linux/tile/arch_regs.c @@ -0,0 +1,3 @@ +struct pt_regs tile_regs; /* not static */ +#define ARCH_REGS_FOR_GETREGS tile_regs +#define ARCH_PC_REG tile_regs.pc diff --git a/linux/tile/arch_regs.h b/linux/tile/arch_regs.h new file mode 100644 index 00000000..cd3f72b3 --- /dev/null +++ b/linux/tile/arch_regs.h @@ -0,0 +1 @@ +extern struct pt_regs tile_regs; diff --git a/linux/tile/arch_sigreturn.c b/linux/tile/arch_sigreturn.c new file mode 100644 index 00000000..88e946f0 --- /dev/null +++ b/linux/tile/arch_sigreturn.c @@ -0,0 +1,12 @@ +static void +arch_sigreturn(struct tcb *tcp) +{ + /* offset of ucontext in the kernel's sigframe structure */ +#define SIGFRAME_UC_OFFSET C_ABI_SAVE_AREA_SIZE + sizeof(siginfo_t) + const unsigned long addr = tile_regs.sp + SIGFRAME_UC_OFFSET + + offsetof(struct ucontext, uc_sigmask); + + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/tile/errnoent1.h b/linux/tile/errnoent1.h index 439ec5c2..091df787 100644 --- a/linux/tile/errnoent1.h +++ b/linux/tile/errnoent1.h @@ -1,2 +1,2 @@ /* tilegx32/tilepro */ -#include "../errnoent.h" +#include "errnoent.h" diff --git a/linux/tile/get_error.c b/linux/tile/get_error.c new file mode 100644 index 00000000..9949af4f --- /dev/null +++ b/linux/tile/get_error.c @@ -0,0 +1,16 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + /* + * The standard tile calling convention returns the value + * (or negative errno) in r0, and zero (or positive errno) in r1. + * Until at least kernel 3.8, however, the r1 value is not + * reflected in ptregs at this point, so we use r0 here. + */ + if (check_errno && is_negated_errno(tile_regs.regs[0])) { + tcp->u_rval = -1; + tcp->u_error = -tile_regs.regs[0]; + } else { + tcp->u_rval = tile_regs.regs[0]; + } +} diff --git a/linux/tile/get_scno.c b/linux/tile/get_scno.c new file mode 100644 index 00000000..e8403d9b --- /dev/null +++ b/linux/tile/get_scno.c @@ -0,0 +1,22 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + unsigned int currpers; + +#ifdef __tilepro__ + currpers = 1; +#else +# ifndef PT_FLAGS_COMPAT +# define PT_FLAGS_COMPAT 0x10000 /* from Linux 3.8 on */ +# endif + if (tile_regs.flags & PT_FLAGS_COMPAT) + currpers = 1; + else + currpers = 0; +#endif + update_personality(tcp, currpers); + tcp->scno = tile_regs.regs[10]; + + return 1; +} diff --git a/linux/tile/get_syscall_args.c b/linux/tile/get_syscall_args.c new file mode 100644 index 00000000..b2043d39 --- /dev/null +++ b/linux/tile/get_syscall_args.c @@ -0,0 +1,12 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = tile_regs.regs[0]; + tcp->u_arg[1] = tile_regs.regs[1]; + tcp->u_arg[2] = tile_regs.regs[2]; + tcp->u_arg[3] = tile_regs.regs[3]; + tcp->u_arg[4] = tile_regs.regs[4]; + tcp->u_arg[5] = tile_regs.regs[5]; + return 1; +} diff --git a/linux/tile/ioctlent.h.in b/linux/tile/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/tile/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/tile/ioctlent1.h b/linux/tile/ioctlent1.h deleted file mode 100644 index 9057b32f..00000000 --- a/linux/tile/ioctlent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* tilegx32/tilepro */ -#include "ioctlent.h" diff --git a/linux/tile/ioctls_arch0.h b/linux/tile/ioctls_arch0.h new file mode 100644 index 00000000..05635852 --- /dev/null +++ b/linux/tile/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/tile/include/ tree. */ diff --git a/linux/tile/ioctls_arch1.h b/linux/tile/ioctls_arch1.h new file mode 100644 index 00000000..05635852 --- /dev/null +++ b/linux/tile/ioctls_arch1.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/tile/include/ tree. */ diff --git a/linux/tile/ioctls_inc0.h b/linux/tile/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/tile/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/tile/ioctls_inc1.h b/linux/tile/ioctls_inc1.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/tile/ioctls_inc1.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/tile/set_error.c b/linux/tile/set_error.c new file mode 100644 index 00000000..16d9b956 --- /dev/null +++ b/linux/tile/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + tile_regs.regs[0] = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + tile_regs.regs[0] = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/tile/set_scno.c b/linux/tile/set_scno.c new file mode 100644 index 00000000..c28d88c3 --- /dev/null +++ b/linux/tile/set_scno.c @@ -0,0 +1,6 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + tile_regs.regs[10] = scno; + return set_regs(tcp->pid); +} diff --git a/linux/tile/signalent1.h b/linux/tile/signalent1.h index 27a3e481..62f11939 100644 --- a/linux/tile/signalent1.h +++ b/linux/tile/signalent1.h @@ -1,2 +1,2 @@ /* tilegx32/tilepro */ -#include "../signalent.h" +#include "signalent.h" diff --git a/linux/tile/syscallent.h b/linux/tile/syscallent.h index 5c41539e..eb518fb9 100644 --- a/linux/tile/syscallent.h +++ b/linux/tile/syscallent.h @@ -1,274 +1,4 @@ - { 2, 0, sys_io_setup, "io_setup" }, /* 0 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 1 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 2 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 3 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 4 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 5 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 6 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 7 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 8 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 9 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 10 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 11 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 12 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 13 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 14 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 15 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 16 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 17 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 18 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 19 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 20 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 21 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 22 */ - { 1, TD, sys_dup, "dup" }, /* 23 */ - { 3, TD, sys_dup3, "dup3" }, /* 24 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 25 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 26 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 27 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 28 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 29 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 30 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 31 */ - { 2, TD, sys_flock, "flock" }, /* 32 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 33 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 34 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 35 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 36 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 37 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 38 */ - { 2, TF, sys_umount2, "umount2" }, /* 39 */ - { 5, TF, sys_mount, "mount" }, /* 40 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 41 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 42 */ - { 2, TF, sys_statfs, "statfs" }, /* 43 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 44 */ - { 2, TF, sys_truncate, "truncate" }, /* 45 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 46 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 47 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 48 */ - { 1, TF, sys_chdir, "chdir" }, /* 49 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 50 */ - { 1, TF, sys_chroot, "chroot" }, /* 51 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 52 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 53 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 54 */ - { 3, TD, sys_fchown, "fchown" }, /* 55 */ - { 4, TD|TF, sys_openat, "openat" }, /* 56 */ - { 1, TD, sys_close, "close" }, /* 57 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 58 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 59 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 60 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 61 */ - { 3, TD, sys_lseek, "lseek" }, /* 62 */ - { 3, TD, sys_read, "read" }, /* 63 */ - { 3, TD, sys_write, "write" }, /* 64 */ - { 3, TD, sys_readv, "readv" }, /* 65 */ - { 3, TD, sys_writev, "writev" }, /* 66 */ - { 4, TD, sys_pread, "pread64" }, /* 67 */ - { 4, TD, sys_pwrite, "pwrite64" }, /* 68 */ - { 4, TD, sys_preadv, "preadv" }, /* 69 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 70 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 71 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 72 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 73 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 74 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 75 */ - { 6, TD, sys_splice, "splice" }, /* 76 */ - { 4, TD, sys_tee, "tee" }, /* 77 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 78 */ - { 4, TD|TF, sys_newfstatat, "fstatat" }, /* 79 */ - { 2, TD, sys_fstat, "fstat" }, /* 80 */ - { 0, 0, sys_sync, "sync" }, /* 81 */ - { 1, TD, sys_fsync, "fsync" }, /* 82 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 83 */ - { 4, TD, sys_sync_file_range2, "sync_file_range2" }, /* 84 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 85 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 86 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 87 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 88 */ - { 1, TF, sys_acct, "acct" }, /* 89 */ - { 2, 0, sys_capget, "capget" }, /* 90 */ - { 2, 0, sys_capset, "capset" }, /* 91 */ - { 1, 0, sys_personality, "personality" }, /* 92 */ - { 1, TP|SE, sys_exit, "exit" }, /* 93 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 94 */ - { 5, TP, sys_waitid, "waitid" }, /* 95 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 96 */ - { 1, TP, sys_unshare, "unshare" }, /* 97 */ - { 6, 0, sys_futex, "futex" }, /* 98 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 99 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 100 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 101 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 102 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 103 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 104 */ - { 3, 0, sys_init_module, "init_module" }, /* 105 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 106 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 107 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 108 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 109 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 110 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 111 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 112 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 113 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 114 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 115 */ - { 3, 0, sys_syslog, "syslog" }, /* 116 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 117 */ - { 0, 0, sys_sched_setparam, "sched_setparam" }, /* 118 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 119 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 120 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 121 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 122 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 123 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 124 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max" }, /* 125 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min" }, /* 126 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 127 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 128 */ - { 2, TS, sys_kill, "kill" }, /* 129 */ - { 2, TS, sys_kill, "tkill" }, /* 130 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 131 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 132 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 133 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 134 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 135 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 136 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 137 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 138 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 139 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 140 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 141 */ - { 4, 0, sys_reboot, "reboot" }, /* 142 */ - { 2, 0, sys_setregid, "setregid" }, /* 143 */ - { 1, 0, sys_setgid, "setgid" }, /* 144 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 145 */ - { 1, 0, sys_setuid, "setuid" }, /* 146 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 147 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 148 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 149 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 150 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 151 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 152 */ - { 1, 0, sys_times, "times" }, /* 153 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 154 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 155 */ - { 1, 0, sys_getsid, "getsid" }, /* 156 */ - { 0, 0, sys_setsid, "setsid" }, /* 157 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 158 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 159 */ - { 1, 0, sys_uname, "uname" }, /* 160 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 161 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 162 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 163 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 164 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 165 */ - { 1, 0, sys_umask, "umask" }, /* 166 */ - { 5, 0, sys_prctl, "prctl" }, /* 167 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 168 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 169 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 170 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 171 */ - { 0, 0, sys_getpid, "getpid" }, /* 172 */ - { 0, 0, sys_getppid, "getppid" }, /* 173 */ - { 0, NF, sys_getuid, "getuid" }, /* 174 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 175 */ - { 0, NF, sys_getgid, "getgid" }, /* 176 */ - { 0, NF, sys_getegid, "getegid" }, /* 177 */ - { 0, 0, sys_gettid, "gettid" }, /* 178 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 179 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 180 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 181 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 182 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 183 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 184 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 185 */ - { 4, TI, sys_msgget, "msgget" }, /* 186 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 187 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 188 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 189 */ - { 4, TI, sys_semget, "semget" }, /* 190 */ - { 4, TI, sys_semctl, "semctl" }, /* 191 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 192 */ - { 4, TI, sys_semop, "semop" }, /* 193 */ - { 4, TI, sys_shmget, "shmget" }, /* 194 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 195 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 196 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 197 */ - { 3, TN, sys_socket, "socket" }, /* 198 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 199 */ - { 3, TN, sys_bind, "bind" }, /* 200 */ - { 2, TN, sys_listen, "listen" }, /* 201 */ - { 3, TN, sys_accept, "accept" }, /* 202 */ - { 3, TN, sys_connect, "connect" }, /* 203 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 204 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 205 */ - { 6, TN, sys_sendto, "sendto" }, /* 206 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 207 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 208 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 209 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 210 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 211 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 212 */ - { 3, TD, sys_readahead, "readahead" }, /* 213 */ - { 1, TM|SI, sys_brk, "brk" }, /* 214 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 215 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 216 */ - { 5, 0, sys_add_key, "add_key" }, /* 217 */ - { 4, 0, sys_request_key, "request_key" }, /* 218 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 219 */ - { 5, TP, sys_clone, "clone" }, /* 220 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 221 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 222 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 223 */ - { 1, TF, sys_swapon, "swapon" }, /* 224 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 225 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 226 */ - { 3, TM, sys_msync, "msync" }, /* 227 */ - { 2, TM, sys_mlock, "mlock" }, /* 228 */ - { 2, TM, sys_munlock, "munlock" }, /* 229 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 230 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 231 */ - { 3, TM, sys_mincore, "mincore" }, /* 232 */ - { 3, TM, sys_madvise, "madvise" }, /* 233 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 234 */ - { 6, TM, sys_mbind, "mbind" }, /* 235 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 236 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 237 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 238 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 239 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 240 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 241 */ - { 4, TN, sys_accept4, "accept4" }, /* 242 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 243 */ - { 0, 0, printargs, "arch_unimpl" }, /* 244 */ - { 3, 0, printargs, "cacheflush" }, /* 245 */ - { 1, 0, printargs, "set_dataplane" }, /* 246 */ - { 0, 0, printargs, "arch_unimpl" }, /* 247 */ - { 0, 0, printargs, "arch_unimpl" }, /* 248 */ - { 0, 0, printargs, "arch_unimpl" }, /* 249 */ - { 0, 0, printargs, "arch_unimpl" }, /* 250 */ - { 0, 0, printargs, "arch_unimpl" }, /* 251 */ - { 0, 0, printargs, "arch_unimpl" }, /* 252 */ - { 0, 0, printargs, "arch_unimpl" }, /* 253 */ - { 0, 0, printargs, "arch_unimpl" }, /* 254 */ - { 0, 0, printargs, "arch_unimpl" }, /* 255 */ - { 0, 0, printargs, "arch_unimpl" }, /* 256 */ - { 0, 0, printargs, "arch_unimpl" }, /* 257 */ - { 0, 0, printargs, "arch_unimpl" }, /* 258 */ - { 0, 0, printargs, "arch_unimpl" }, /* 259 */ - { 4, TP, sys_wait4, "wait4" }, /* 260 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 261 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 262 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 263 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 264 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 265 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 266 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 267 */ - { 2, TD, sys_setns, "setns" }, /* 268 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 269 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 270 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 271 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 272 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 273 */ +#include "64/syscallent.h" +/* [244 ... 259] are arch specific */ +[244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" }, +[245] = { 3, 0, SEN(printargs), "cacheflush" }, diff --git a/linux/tile/syscallent1.h b/linux/tile/syscallent1.h index a1ac2680..b305f067 100644 --- a/linux/tile/syscallent1.h +++ b/linux/tile/syscallent1.h @@ -1,278 +1,6 @@ - { 2, 0, sys_io_setup, "io_setup" }, /* 0 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 1 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 2 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 3 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 4 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 5 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 6 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 7 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 8 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 9 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 10 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 11 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 12 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 13 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 14 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 15 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 16 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 17 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie" }, /* 18 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 19 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 20 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 21 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 22 */ - { 1, TD, sys_dup, "dup" }, /* 23 */ - { 3, TD, sys_dup3, "dup3" }, /* 24 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 25 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 26 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 27 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 28 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 29 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 30 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 31 */ - { 2, TD, sys_flock, "flock" }, /* 32 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 33 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 34 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 35 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 36 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 37 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 38 */ - { 2, TF, sys_umount2, "umount2" }, /* 39 */ - { 5, TF, sys_mount, "mount" }, /* 40 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 41 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 42 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 43 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 44 */ - { 4, TF, sys_truncate64, "truncate64" }, /* 45 */ - { 4, TD, sys_ftruncate64, "ftruncate64" }, /* 46 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 47 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 48 */ - { 1, TF, sys_chdir, "chdir" }, /* 49 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 50 */ - { 1, TF, sys_chroot, "chroot" }, /* 51 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 52 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 53 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 54 */ - { 3, TD, sys_fchown, "fchown" }, /* 55 */ - { 4, TD|TF, sys_openat, "openat" }, /* 56 */ - { 1, TD, sys_close, "close" }, /* 57 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 58 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 59 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 60 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 61 */ - { 5, TD, sys_llseek, "llseek" }, /* 62 */ - { 3, TD, sys_read, "read" }, /* 63 */ - { 3, TD, sys_write, "write" }, /* 64 */ - { 3, TD, sys_readv, "readv" }, /* 65 */ - { 3, TD, sys_writev, "writev" }, /* 66 */ - { 6, TD, sys_pread, "pread64" }, /* 67 */ - { 6, TD, sys_pwrite, "pwrite64" }, /* 68 */ - { 5, TD, sys_preadv, "preadv" }, /* 69 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 70 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 71 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 72 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 73 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 74 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 75 */ - { 6, TD, sys_splice, "splice" }, /* 76 */ - { 4, TD, sys_tee, "tee" }, /* 77 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 78 */ - { 4, TD|TF, sys_newfstatat, "fstatat64" }, /* 79 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 80 */ - { 0, 0, sys_sync, "sync" }, /* 81 */ - { 1, TD, sys_fsync, "fsync" }, /* 82 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 83 */ - { 6, TD, sys_sync_file_range2, "sync_file_range2" }, /* 84 */ - { 2, TD, sys_timerfd_create, "timerfd_create" }, /* 85 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime" }, /* 86 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime" }, /* 87 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 88 */ - { 1, TF, sys_acct, "acct" }, /* 89 */ - { 2, 0, sys_capget, "capget" }, /* 90 */ - { 2, 0, sys_capset, "capset" }, /* 91 */ - { 1, 0, sys_personality, "personality" }, /* 92 */ - { 1, TP|SE, sys_exit, "exit" }, /* 93 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 94 */ - { 5, TP, sys_waitid, "waitid" }, /* 95 */ - { 1, 0, sys_set_tid_address, "set_tid_address" }, /* 96 */ - { 1, TP, sys_unshare, "unshare" }, /* 97 */ - { 6, 0, sys_futex, "futex" }, /* 98 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 99 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 100 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 101 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 102 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 103 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 104 */ - { 3, 0, sys_init_module, "init_module" }, /* 105 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 106 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 107 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 108 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun" }, /* 109 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 110 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 111 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 112 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 113 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 114 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep" }, /* 115 */ - { 3, 0, sys_syslog, "syslog" }, /* 116 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 117 */ - { 0, 0, sys_sched_setparam, "sched_setparam" }, /* 118 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 119 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 120 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 121 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 122 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 123 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 124 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max" }, /* 125 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min" }, /* 126 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 127 */ - { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 128 */ - { 2, TS, sys_kill, "kill" }, /* 129 */ - { 2, TS, sys_kill, "tkill" }, /* 130 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 131 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 132 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 133 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 134 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 135 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 136 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 137 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 138 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 139 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 140 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 141 */ - { 4, 0, sys_reboot, "reboot" }, /* 142 */ - { 2, 0, sys_setregid, "setregid" }, /* 143 */ - { 1, 0, sys_setgid, "setgid" }, /* 144 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 145 */ - { 1, 0, sys_setuid, "setuid" }, /* 146 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 147 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 148 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 149 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 150 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 151 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 152 */ - { 1, 0, sys_times, "times" }, /* 153 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 154 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 155 */ - { 1, 0, sys_getsid, "getsid" }, /* 156 */ - { 0, 0, sys_setsid, "setsid" }, /* 157 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 158 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 159 */ - { 1, 0, sys_uname, "uname" }, /* 160 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 161 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 162 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 163 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 164 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 165 */ - { 1, 0, sys_umask, "umask" }, /* 166 */ - { 5, 0, sys_prctl, "prctl" }, /* 167 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 168 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 169 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 170 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 171 */ - { 0, 0, sys_getpid, "getpid" }, /* 172 */ - { 0, 0, sys_getppid, "getppid" }, /* 173 */ - { 0, NF, sys_getuid, "getuid" }, /* 174 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 175 */ - { 0, NF, sys_getgid, "getgid" }, /* 176 */ - { 0, NF, sys_getegid, "getegid" }, /* 177 */ - { 0, 0, sys_gettid, "gettid" }, /* 178 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 179 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 180 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 181 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 182 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 183 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 184 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 185 */ - { 4, TI, sys_msgget, "msgget" }, /* 186 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 187 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 188 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 189 */ - { 4, TI, sys_semget, "semget" }, /* 190 */ - { 4, TI, sys_semctl, "semctl" }, /* 191 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 192 */ - { 4, TI, sys_semop, "semop" }, /* 193 */ - { 4, TI, sys_shmget, "shmget" }, /* 194 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 195 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 196 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 197 */ - { 3, TN, sys_socket, "socket" }, /* 198 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 199 */ - { 3, TN, sys_bind, "bind" }, /* 200 */ - { 2, TN, sys_listen, "listen" }, /* 201 */ - { 3, TN, sys_accept, "accept" }, /* 202 */ - { 3, TN, sys_connect, "connect" }, /* 203 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 204 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 205 */ - { 6, TN, sys_sendto, "sendto" }, /* 206 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 207 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 208 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 209 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 210 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 211 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 212 */ - { 4, TD, sys_readahead, "readahead" }, /* 213 */ - { 1, TM|SI, sys_brk, "brk" }, /* 214 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 215 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 216 */ - { 5, 0, sys_add_key, "add_key" }, /* 217 */ - { 4, 0, sys_request_key, "request_key" }, /* 218 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 219 */ - { 5, TP, sys_clone, "clone" }, /* 220 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 221 */ - { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" }, /* 222 */ - { 5, TD, sys_fadvise64, "fadvise64" }, /* 223 */ - { 1, TF, sys_swapon, "swapon" }, /* 224 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 225 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 226 */ - { 3, TM, sys_msync, "msync" }, /* 227 */ - { 2, TM, sys_mlock, "mlock" }, /* 228 */ - { 2, TM, sys_munlock, "munlock" }, /* 229 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 230 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 231 */ - { 3, TM, sys_mincore, "mincore" }, /* 232 */ - { 3, TM, sys_madvise, "madvise" }, /* 233 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages" }, /* 234 */ - { 6, TM, sys_mbind, "mbind" }, /* 235 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 236 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 237 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 238 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 239 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 240 */ - { 5, TD, sys_perf_event_open, "perf_event_open" }, /* 241 */ - { 4, TN, sys_accept4, "accept4" }, /* 242 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 243 */ -#ifdef __tilegx__ - { 0, 0, printargs, "arch_unimpl" }, /* 244 */ -#else - { 2, 0, printargs, "cmpxchg_badaddr" }, /* 244 */ -#endif - { 3, 0, printargs, "cacheflush" }, /* 245 */ - { 1, 0, printargs, "set_dataplane" }, /* 246 */ - { 0, 0, printargs, "arch_unimpl" }, /* 247 */ - { 0, 0, printargs, "arch_unimpl" }, /* 248 */ - { 0, 0, printargs, "arch_unimpl" }, /* 249 */ - { 0, 0, printargs, "arch_unimpl" }, /* 250 */ - { 0, 0, printargs, "arch_unimpl" }, /* 251 */ - { 0, 0, printargs, "arch_unimpl" }, /* 252 */ - { 0, 0, printargs, "arch_unimpl" }, /* 253 */ - { 0, 0, printargs, "arch_unimpl" }, /* 254 */ - { 0, 0, printargs, "arch_unimpl" }, /* 255 */ - { 0, 0, printargs, "arch_unimpl" }, /* 256 */ - { 0, 0, printargs, "arch_unimpl" }, /* 257 */ - { 0, 0, printargs, "arch_unimpl" }, /* 258 */ - { 0, 0, printargs, "arch_unimpl" }, /* 259 */ - { 4, TP, sys_wait4, "wait4" }, /* 260 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 261 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 262 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 263 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at" }, /* 264 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at" }, /* 265 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 266 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 267 */ - { 2, TD, sys_setns, "setns" }, /* 268 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 269 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 270 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 271 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 272 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 273 */ +#define sys_ARCH_mmap sys_mmap_4koff +#define ARCH_WANT_SYNC_FILE_RANGE2 1 +#include "32/syscallent.h" +/* [244 ... 259] are arch specific */ +[244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" }, +[245] = { 3, 0, SEN(printargs), "cacheflush" }, diff --git a/linux/tile/userent.h b/linux/tile/userent.h new file mode 100644 index 00000000..915f4a50 --- /dev/null +++ b/linux/tile/userent.h @@ -0,0 +1,61 @@ +{ PTREGS_OFFSET_REG(0), "r0" }, +{ PTREGS_OFFSET_REG(1), "r1" }, +{ PTREGS_OFFSET_REG(2), "r2" }, +{ PTREGS_OFFSET_REG(3), "r3" }, +{ PTREGS_OFFSET_REG(4), "r4" }, +{ PTREGS_OFFSET_REG(5), "r5" }, +{ PTREGS_OFFSET_REG(6), "r6" }, +{ PTREGS_OFFSET_REG(7), "r7" }, +{ PTREGS_OFFSET_REG(8), "r8" }, +{ PTREGS_OFFSET_REG(9), "r9" }, +{ PTREGS_OFFSET_REG(10), "r10" }, +{ PTREGS_OFFSET_REG(11), "r11" }, +{ PTREGS_OFFSET_REG(12), "r12" }, +{ PTREGS_OFFSET_REG(13), "r13" }, +{ PTREGS_OFFSET_REG(14), "r14" }, +{ PTREGS_OFFSET_REG(15), "r15" }, +{ PTREGS_OFFSET_REG(16), "r16" }, +{ PTREGS_OFFSET_REG(17), "r17" }, +{ PTREGS_OFFSET_REG(18), "r18" }, +{ PTREGS_OFFSET_REG(19), "r19" }, +{ PTREGS_OFFSET_REG(20), "r20" }, +{ PTREGS_OFFSET_REG(21), "r21" }, +{ PTREGS_OFFSET_REG(22), "r22" }, +{ PTREGS_OFFSET_REG(23), "r23" }, +{ PTREGS_OFFSET_REG(24), "r24" }, +{ PTREGS_OFFSET_REG(25), "r25" }, +{ PTREGS_OFFSET_REG(26), "r26" }, +{ PTREGS_OFFSET_REG(27), "r27" }, +{ PTREGS_OFFSET_REG(28), "r28" }, +{ PTREGS_OFFSET_REG(29), "r29" }, +{ PTREGS_OFFSET_REG(30), "r30" }, +{ PTREGS_OFFSET_REG(31), "r31" }, +{ PTREGS_OFFSET_REG(32), "r32" }, +{ PTREGS_OFFSET_REG(33), "r33" }, +{ PTREGS_OFFSET_REG(34), "r34" }, +{ PTREGS_OFFSET_REG(35), "r35" }, +{ PTREGS_OFFSET_REG(36), "r36" }, +{ PTREGS_OFFSET_REG(37), "r37" }, +{ PTREGS_OFFSET_REG(38), "r38" }, +{ PTREGS_OFFSET_REG(39), "r39" }, +{ PTREGS_OFFSET_REG(40), "r40" }, +{ PTREGS_OFFSET_REG(41), "r41" }, +{ PTREGS_OFFSET_REG(42), "r42" }, +{ PTREGS_OFFSET_REG(43), "r43" }, +{ PTREGS_OFFSET_REG(44), "r44" }, +{ PTREGS_OFFSET_REG(45), "r45" }, +{ PTREGS_OFFSET_REG(46), "r46" }, +{ PTREGS_OFFSET_REG(47), "r47" }, +{ PTREGS_OFFSET_REG(48), "r48" }, +{ PTREGS_OFFSET_REG(49), "r49" }, +{ PTREGS_OFFSET_REG(50), "r50" }, +{ PTREGS_OFFSET_REG(51), "r51" }, +{ PTREGS_OFFSET_REG(52), "r52" }, +{ PTREGS_OFFSET_TP, "tp" }, +{ PTREGS_OFFSET_SP, "sp" }, +{ PTREGS_OFFSET_LR, "lr" }, +{ PTREGS_OFFSET_PC, "pc" }, +{ PTREGS_OFFSET_EX1, "ex1" }, +{ PTREGS_OFFSET_FAULTNUM, "faultnum" }, +{ PTREGS_OFFSET_ORIG_R0, "orig_r0" }, +{ PTREGS_OFFSET_FLAGS, "flags" }, diff --git a/linux/ubi-user.h b/linux/ubi-user.h index a12c8848..e9e56b35 100644 --- a/linux/ubi-user.h +++ b/linux/ubi-user.h @@ -307,7 +307,7 @@ struct ubi_mkvol_req { __s16 name_len; __s8 padding2[4]; char name[UBI_MAX_VOLUME_NAME + 1]; -} __attribute__((packed)); +} ATTRIBUTE_PACKED; /** * struct ubi_rsvol_req - a data structure used in volume re-size requests. @@ -323,7 +323,7 @@ struct ubi_mkvol_req { struct ubi_rsvol_req { __s64 bytes; __s32 vol_id; -} __attribute__((packed)); +} ATTRIBUTE_PACKED; /** * struct ubi_rnvol_req - volumes re-name request. @@ -365,7 +365,7 @@ struct ubi_rnvol_req { __s8 padding2[2]; char name[UBI_MAX_VOLUME_NAME + 1]; } ents[UBI_MAX_RNVOL]; -} __attribute__((packed)); +} ATTRIBUTE_PACKED; /** * struct ubi_leb_change_req - a data structure used in atomic LEB change @@ -389,7 +389,7 @@ struct ubi_leb_change_req { __s32 bytes; __s8 dtype; /* obsolete, do not use! */ __s8 padding[7]; -} __attribute__((packed)); +} ATTRIBUTE_PACKED; /** * struct ubi_map_req - a data structure used in map LEB requests. @@ -401,7 +401,7 @@ struct ubi_map_req { __s32 lnum; __s8 dtype; /* obsolete, do not use! */ __s8 padding[3]; -} __attribute__((packed)); +} ATTRIBUTE_PACKED; /** @@ -415,6 +415,6 @@ struct ubi_set_vol_prop_req { __u8 property; __u8 padding[7]; __u64 value; -} __attribute__((packed)); +} ATTRIBUTE_PACKED; #endif /* __UBI_USER_H__ */ diff --git a/linux/unix_diag.h b/linux/unix_diag.h new file mode 100644 index 00000000..0c3da5bb --- /dev/null +++ b/linux/unix_diag.h @@ -0,0 +1,29 @@ +#ifndef STRACE_LINUX_UNIX_DIAG_H +#define STRACE_LINUX_UNIX_DIAG_H + +struct unix_diag_req { + uint8_t sdiag_family; + uint8_t sdiag_protocol; + uint16_t pad; + uint32_t udiag_states; + uint32_t udiag_ino; + uint32_t udiag_show; + uint32_t udiag_cookie[2]; +}; + +#define UDIAG_SHOW_NAME 0x01 +#define UDIAG_SHOW_PEER 0x04 + +struct unix_diag_msg { + uint8_t udiag_family; + uint8_t udiag_type; + uint8_t udiag_state; + uint8_t pad; + uint32_t udiag_ino; + uint32_t udiag_cookie[2]; +}; + +#define UNIX_DIAG_NAME 0 +#define UNIX_DIAG_PEER 2 + +#endif /* !STRACE_LINUX_UNIX_DIAG_H */ diff --git a/linux/userent.h b/linux/userent.h new file mode 100644 index 00000000..da84fa5f --- /dev/null +++ b/linux/userent.h @@ -0,0 +1 @@ +/* nothing */ diff --git a/linux/userent0.h b/linux/userent0.h new file mode 100644 index 00000000..b3c5ebce --- /dev/null +++ b/linux/userent0.h @@ -0,0 +1 @@ +{ sizeof(struct user), "sizeof(struct user)" }, diff --git a/linux/x32/arch_regs.c b/linux/x32/arch_regs.c new file mode 100644 index 00000000..62c70be8 --- /dev/null +++ b/linux/x32/arch_regs.c @@ -0,0 +1 @@ +#include "x86_64/arch_regs.c" diff --git a/linux/x32/arch_regs.h b/linux/x32/arch_regs.h new file mode 100644 index 00000000..9064ca69 --- /dev/null +++ b/linux/x32/arch_regs.h @@ -0,0 +1 @@ +#include "x86_64/arch_regs.h" diff --git a/linux/x32/arch_sigreturn.c b/linux/x32/arch_sigreturn.c new file mode 100644 index 00000000..9a778fc7 --- /dev/null +++ b/linux/x32/arch_sigreturn.c @@ -0,0 +1 @@ +#include "x86_64/arch_sigreturn.c" diff --git a/linux/x32/asm_stat.h b/linux/x32/asm_stat.h new file mode 100644 index 00000000..865aa4a0 --- /dev/null +++ b/linux/x32/asm_stat.h @@ -0,0 +1 @@ +#include "x86_64/asm_stat.h" diff --git a/linux/x32/errnoent.h b/linux/x32/errnoent.h deleted file mode 100644 index 441c66bc..00000000 --- a/linux/x32/errnoent.h +++ /dev/null @@ -1 +0,0 @@ -#include "../errnoent.h" diff --git a/linux/x32/errnoent1.h b/linux/x32/errnoent1.h index de1136cd..d32435af 100644 --- a/linux/x32/errnoent1.h +++ b/linux/x32/errnoent1.h @@ -1,2 +1,2 @@ /* i386 personality */ -#include "../errnoent.h" +#include "errnoent.h" diff --git a/linux/x32/get_error.c b/linux/x32/get_error.c new file mode 100644 index 00000000..6c6fbaf3 --- /dev/null +++ b/linux/x32/get_error.c @@ -0,0 +1 @@ +#include "x86_64/get_error.c" diff --git a/linux/x32/get_scno.c b/linux/x32/get_scno.c new file mode 100644 index 00000000..492863fa --- /dev/null +++ b/linux/x32/get_scno.c @@ -0,0 +1 @@ +#include "x86_64/get_scno.c" diff --git a/linux/x32/get_syscall_args.c b/linux/x32/get_syscall_args.c new file mode 100644 index 00000000..6cdb465b --- /dev/null +++ b/linux/x32/get_syscall_args.c @@ -0,0 +1 @@ +#include "x86_64/get_syscall_args.c" diff --git a/linux/x32/ioctlent.h.in b/linux/x32/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/x32/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/x32/ioctlent1.h b/linux/x32/ioctlent1.h deleted file mode 100644 index 47506717..00000000 --- a/linux/x32/ioctlent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* i386 personality */ -#include "ioctlent.h" diff --git a/linux/x32/ioctls_arch0.h b/linux/x32/ioctls_arch0.h new file mode 100644 index 00000000..7070560b --- /dev/null +++ b/linux/x32/ioctls_arch0.h @@ -0,0 +1 @@ +#include "x86_64/ioctls_arch0.h" diff --git a/linux/x32/ioctls_arch1.h b/linux/x32/ioctls_arch1.h new file mode 100644 index 00000000..58a57064 --- /dev/null +++ b/linux/x32/ioctls_arch1.h @@ -0,0 +1 @@ +#include "i386/ioctls_arch0.h" diff --git a/linux/x32/ioctls_inc0.h b/linux/x32/ioctls_inc0.h new file mode 100644 index 00000000..46303d12 --- /dev/null +++ b/linux/x32/ioctls_inc0.h @@ -0,0 +1,2729 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */ +{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 }, +{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 }, +{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 }, +{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 }, +{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 }, +{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 }, +{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 }, +{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 }, +{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 }, +{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 }, +{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 }, +{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 }, +{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, +{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 }, +{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 }, +{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 }, +{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 }, +{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 }, +{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 }, +{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 }, +{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, +{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, +{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, +{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, +{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, +{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, +{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, +{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 }, +{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, +{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, +{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, +{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, +{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, +{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, +{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, +{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 }, +{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, +{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, +{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, +{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, +{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, +{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, +{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, +{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, +{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, +{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 }, +{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, +{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, +{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, +{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, +{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm-generic/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, +{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c }, +{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c }, +{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 }, +{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, +{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 }, +{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c }, +{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 }, +{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 }, +{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, +{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 }, +{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 }, +{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 }, +{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 }, +{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c }, +{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 }, +{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 }, +{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 }, +{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 }, +{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 }, +{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 }, +{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 }, +{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, +{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, +{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, +{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, +{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, +{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 }, +{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 }, +{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 }, +{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 }, +{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 }, +{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x18 }, +{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 }, +{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 }, +{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 }, +{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 }, +{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 }, +{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 }, +{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 }, +{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 }, +{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 }, +{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 }, +{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 }, +{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, +{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, +{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, +{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, +{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, +{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c }, +{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c }, +{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 }, +{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 }, +{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 }, +{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 }, +{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c }, +{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c }, +{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 }, +{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 }, +{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 }, +{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 }, +{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c }, +{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 }, +{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c }, +{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 }, +{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c }, +{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c }, +{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 }, +{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c }, +{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c }, +{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c }, +{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c }, +{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 }, +{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c }, +{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c }, +{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c }, +{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 }, +{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c }, +{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c }, +{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 }, +{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c }, +{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c }, +{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c }, +{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 }, +{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 }, +{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 }, +{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 }, +{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, +{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, +{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, +{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, +{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, +{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 }, +{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 }, +{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, +{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 }, +{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 }, +{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 }, +{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 }, +{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 }, +{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 }, +{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 }, +{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 }, +{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 }, +{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 }, +{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 }, +{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 }, +{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 }, +{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 }, +{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 }, +{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c }, +{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 }, +{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c }, +{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 }, +{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x54 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 }, +{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 }, +{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 }, +{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 }, +{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 }, +{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 }, +{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 }, +{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 }, +{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 }, +{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 }, +{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 }, +{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 }, +{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 }, +{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 }, +{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 }, +{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 }, +{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 }, +{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 }, +{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 }, +{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 }, +{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 }, +{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 }, +{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 }, +{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 }, +{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 }, +{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 }, +{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 }, +{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 }, +{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 }, +{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 }, +{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 }, +{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 }, +{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 }, +{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 }, +{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 }, +{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 }, +{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 }, +{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 }, +{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 }, +{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 }, +{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 }, +{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 }, +{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 }, +{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 }, +{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 }, +{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 }, +{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c }, +{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 }, +{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c }, +{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 }, +{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 }, +{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 }, +{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 }, +{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 }, +{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 }, +{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c }, +{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c }, +{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 }, +{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 }, +{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 }, +{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 }, +{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 }, +{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c }, +{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 }, +{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 }, +{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 }, +{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, +{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, +{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 }, +{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 }, +{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 }, +{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 }, +{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 }, +{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 }, +{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 }, +{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dn.h", "SIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 }, +{ "linux/dn.h", "SIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, +{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, +{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, +{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, +{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, +{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, +{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 }, +{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 }, +{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 }, +{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c }, +{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c }, +{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, +{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, +{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, +{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, +{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, +{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, +{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, +{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, +{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, +{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 }, +{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 }, +{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 }, +{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 }, +{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 }, +{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 }, +{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 }, +{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 }, +{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 }, +{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 }, +{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 }, +{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 }, +{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 }, +{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 }, +{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 }, +{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 }, +{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 }, +{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c }, +{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 }, +{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x20 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, +{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, +{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, +{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, +{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, +{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, +{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, +{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 }, +{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 }, +{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 }, +{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 }, +{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 }, +{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 }, +{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 }, +{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 }, +{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 }, +{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 }, +{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 }, +{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 }, +{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 }, +{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 }, +{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 }, +{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 }, +{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x48 }, +{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 }, +{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 }, +{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 }, +{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c }, +{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 }, +{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 }, +{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 }, +{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 }, +{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c }, +{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x58 }, +{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 }, +{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 }, +{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x20 }, +{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 }, +{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c }, +{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 }, +{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 }, +{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 }, +{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 }, +{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 }, +{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x58 }, +{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 }, +{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 }, +{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c }, +{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 }, +{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 }, +{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x20 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x18 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, +{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, +{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, +{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, +{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 }, +{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 }, +{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 }, +{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 }, +{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 }, +{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 }, +{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 }, +{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 }, +{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 }, +{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 }, +{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 }, +{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 }, +{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 }, +{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 }, +{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 }, +{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 }, +{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 }, +{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 }, +{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 }, +{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x48 }, +{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 }, +{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 }, +{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 }, +{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 }, +{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 }, +{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 }, +{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 }, +{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 }, +{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 }, +{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 }, +{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 }, +{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 }, +{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, +{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, +{ "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, +{ "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, +{ "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c }, +{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 }, +{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 }, +{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 }, +{ "linux/gigaset_dev.h", "GIGASET_BRKCHARS", _IOC_WRITE, 0x4702, 0x06 }, +{ "linux/gigaset_dev.h", "GIGASET_CONFIG", _IOC_READ|_IOC_WRITE, 0x4701, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_REDIR", _IOC_READ|_IOC_WRITE, 0x4700, 0x04 }, +{ "linux/gigaset_dev.h", "GIGASET_VERSION", _IOC_READ|_IOC_WRITE, 0x4703, 0x10 }, +{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 }, +{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 }, +{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 }, +{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 }, +{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c }, +{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 }, +{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 }, +{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 }, +{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c }, +{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c }, +{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 }, +{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 }, +{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 }, +{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 }, +{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 }, +{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 }, +{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 }, +{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 }, +{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 }, +{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 }, +{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 }, +{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 }, +{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 }, +{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 }, +{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 }, +{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 }, +{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 }, +{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 }, +{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 }, +{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 }, +{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 }, +{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 }, +{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 }, +{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 }, +{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 }, +{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 }, +{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 }, +{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 }, +{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 }, +{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 }, +{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 }, +{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c }, +{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 }, +{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 }, +{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c }, +{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 }, +{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 }, +{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c }, +{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 }, +{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 }, +{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c }, +{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 }, +{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c }, +{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 }, +{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 }, +{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 }, +{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 }, +{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 }, +{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 }, +{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 }, +{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c }, +{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 }, +{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 }, +{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 }, +{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 }, +{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c }, +{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 }, +{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 }, +{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c }, +{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 }, +{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c }, +{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c }, +{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c }, +{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 }, +{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 }, +{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1c }, +{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1c }, +{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1c }, +{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 }, +{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 }, +{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 }, +{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 }, +{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 }, +{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 }, +{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 }, +{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 }, +{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 }, +{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 }, +{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x08 }, +{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x08 }, +{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 }, +{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x08 }, +{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 }, +{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, +{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, +{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, +{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 }, +{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 }, +{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 }, +{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 }, +{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, +{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, +{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, +{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, +{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, +{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 }, +{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 }, +{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 }, +{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 }, +{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 }, +{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 }, +{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 }, +{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x2c }, +{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 }, +{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 }, +{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 }, +{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 }, +{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c }, +{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 }, +{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, +{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, +{ "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, +{ "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, +{ "linux/isdn.h", "IIOCGETDVR", _IOC_NONE, 0x4916, 0x00 }, +{ "linux/isdn.h", "IIOCGETMAP", _IOC_NONE, 0x4911, 0x00 }, +{ "linux/isdn.h", "IIOCGETPRF", _IOC_NONE, 0x490f, 0x00 }, +{ "linux/isdn.h", "IIOCGETSET", _IOC_NONE, 0x4908, 0x00 }, +{ "linux/isdn.h", "IIOCNETAIF", _IOC_NONE, 0x4901, 0x00 }, +{ "linux/isdn.h", "IIOCNETALN", _IOC_NONE, 0x4920, 0x00 }, +{ "linux/isdn.h", "IIOCNETANM", _IOC_NONE, 0x4905, 0x00 }, +{ "linux/isdn.h", "IIOCNETASL", _IOC_NONE, 0x4913, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIF", _IOC_NONE, 0x4902, 0x00 }, +{ "linux/isdn.h", "IIOCNETDIL", _IOC_NONE, 0x4914, 0x00 }, +{ "linux/isdn.h", "IIOCNETDLN", _IOC_NONE, 0x4921, 0x00 }, +{ "linux/isdn.h", "IIOCNETDNM", _IOC_NONE, 0x4906, 0x00 }, +{ "linux/isdn.h", "IIOCNETDWRSET", _IOC_NONE, 0x4918, 0x00 }, +{ "linux/isdn.h", "IIOCNETGCF", _IOC_NONE, 0x4904, 0x00 }, +{ "linux/isdn.h", "IIOCNETGNM", _IOC_NONE, 0x4907, 0x00 }, +{ "linux/isdn.h", "IIOCNETGPN", _IOC_NONE, 0x4922, 0x00 }, +{ "linux/isdn.h", "IIOCNETHUP", _IOC_NONE, 0x490b, 0x00 }, +{ "linux/isdn.h", "IIOCNETLCR", _IOC_NONE, 0x4917, 0x00 }, +{ "linux/isdn.h", "IIOCNETSCF", _IOC_NONE, 0x4903, 0x00 }, +{ "linux/isdn.h", "IIOCSETBRJ", _IOC_NONE, 0x490d, 0x00 }, +{ "linux/isdn.h", "IIOCSETGST", _IOC_NONE, 0x490c, 0x00 }, +{ "linux/isdn.h", "IIOCSETMAP", _IOC_NONE, 0x4912, 0x00 }, +{ "linux/isdn.h", "IIOCSETPRF", _IOC_NONE, 0x4910, 0x00 }, +{ "linux/isdn.h", "IIOCSETSET", _IOC_NONE, 0x4909, 0x00 }, +{ "linux/isdn.h", "IIOCSETVER", _IOC_NONE, 0x490a, 0x00 }, +{ "linux/isdn.h", "IIOCSIGPRF", _IOC_NONE, 0x490e, 0x00 }, +{ "linux/isdn_ppp.h", "PPPIOCBUNDLE", _IOC_WRITE, 0x7481, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCGCALLINFO", _IOC_READ|_IOC_WRITE, 0x7480, 0x88 }, +{ "linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", _IOC_READ, 0x7486, 0x20 }, +{ "linux/isdn_ppp.h", "PPPIOCGIFNAME", _IOC_READ, 0x7488, 0x10 }, +{ "linux/isdn_ppp.h", "PPPIOCGMPFLAGS", _IOC_READ, 0x7482, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", _IOC_WRITE, 0x7487, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPFLAGS", _IOC_WRITE, 0x7483, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMRU", _IOC_WRITE, 0x7485, 0x04 }, +{ "linux/isdn_ppp.h", "PPPIOCSMPMTU", _IOC_WRITE, 0x7484, 0x04 }, +{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, +{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, +{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, +{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, +{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, +{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, +{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, +{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, +{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 }, +{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 }, +{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 }, +{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 }, +{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 }, +{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 }, +{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 }, +{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 }, +{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 }, +{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 }, +{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 }, +{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 }, +{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 }, +{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 }, +{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 }, +{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 }, +{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 }, +{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 }, +{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 }, +{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 }, +{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 }, +{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 }, +{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 }, +{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 }, +{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 }, +{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 }, +{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 }, +{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 }, +{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 }, +{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 }, +{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 }, +{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 }, +{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 }, +{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 }, +{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 }, +{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 }, +{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 }, +{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 }, +{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 }, +{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 }, +{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 }, +{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 }, +{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 }, +{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 }, +{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 }, +{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 }, +{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 }, +{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 }, +{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 }, +{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 }, +{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 }, +{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 }, +{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, +{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, +{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, +{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, +{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, +{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 }, +{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 }, +{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 }, +{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 }, +{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 }, +{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 }, +{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 }, +{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 }, +{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 }, +{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, +{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, +{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, +{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, +{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, +{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, +{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, +{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 }, +{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 }, +{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 }, +{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 }, +{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 }, +{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 }, +{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 }, +{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 }, +{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, +{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, +{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, +{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, +{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 }, +{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 }, +{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 }, +{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 }, +{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 }, +{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_ADD_DEVICE", _IOC_READ|_IOC_WRITE, 0x7301, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_CONFIG_CHANGE", _IOC_READ|_IOC_WRITE, 0x7305, 0x04 }, +{ "linux/mic_ioctl.h", "MIC_VIRTIO_COPY_DESC", _IOC_READ|_IOC_WRITE, 0x7302, 0x04 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 }, +{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 }, +{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 }, +{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 }, +{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 }, +{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x230 }, +{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x230 }, +{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c }, +{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 }, +{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 }, +{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 }, +{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 }, +{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 }, +{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 }, +{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 }, +{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, +{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, +{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, +{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, +{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, +{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, +{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, +{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, +{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, +{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, +{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 }, +{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 }, +{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, +{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, +{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, +{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, +{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x30 }, +{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 }, +{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 }, +{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, +{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c }, +{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 }, +{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 }, +{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 }, +{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 }, +{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 }, +{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 }, +{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, +{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 }, +{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 }, +{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 }, +{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 }, +{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 }, +{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 }, +{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 }, +{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 }, +{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 }, +{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 }, +{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c }, +{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 }, +{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 }, +{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 }, +{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 }, +{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 }, +{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 }, +{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 }, +{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 }, +{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 }, +{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 }, +{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 }, +{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x10 }, +{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 }, +{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 }, +{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 }, +{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 }, +{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 }, +{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 }, +{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 }, +{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 }, +{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x10 }, +{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 }, +{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 }, +{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 }, +{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 }, +{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGIDLE", _IOC_READ, 0x743f, 0x10 }, +{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 }, +{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c }, +{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x08 }, +{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 }, +{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 }, +{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 }, +{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 }, +{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 }, +{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 }, +{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 }, +{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 }, +{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 }, +{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 }, +{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 }, +{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, +{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, +{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, +{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, +{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, +{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 }, +{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, +{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, +{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, +{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, +{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 }, +{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 }, +{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 }, +{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 }, +{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 }, +{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 }, +{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 }, +{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 }, +{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 }, +{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 }, +{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 }, +{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c }, +{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 }, +{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c }, +{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 }, +{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 }, +{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 }, +{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 }, +{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 }, +{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 }, +{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 }, +{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 }, +{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 }, +{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, +{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, +{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, +{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, +{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, +{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 }, +{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 }, +{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 }, +{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 }, +{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, +{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, +{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, +{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, +{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, +{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 }, +{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 }, +{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 }, +{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 }, +{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 }, +{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 }, +{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c }, +{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c }, +{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 }, +{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 }, +{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 }, +{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 }, +{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 }, +{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 }, +{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 }, +{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 }, +{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 }, +{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 }, +{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x18 }, +{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 }, +{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 }, +{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 }, +{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, +{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, +{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, +{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 }, +{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 }, +{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 }, +{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 }, +{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 }, +{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 }, +{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 }, +{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 }, +{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 }, +{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 }, +{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 }, +{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 }, +{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 }, +{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 }, +{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 }, +{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 }, +{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 }, +{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 }, +{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 }, +{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 }, +{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 }, +{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 }, +{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 }, +{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 }, +{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 }, +{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 }, +{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 }, +{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 }, +{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 }, +{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 }, +{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 }, +{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 }, +{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 }, +{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 }, +{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 }, +{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 }, +{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 }, +{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 }, +{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 }, +{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 }, +{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 }, +{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 }, +{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 }, +{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 }, +{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 }, +{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 }, +{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 }, +{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 }, +{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 }, +{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 }, +{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 }, +{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 }, +{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 }, +{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 }, +{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 }, +{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 }, +{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 }, +{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 }, +{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 }, +{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 }, +{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 }, +{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 }, +{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 }, +{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 }, +{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 }, +{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 }, +{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 }, +{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 }, +{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 }, +{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 }, +{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 }, +{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 }, +{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 }, +{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 }, +{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 }, +{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 }, +{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 }, +{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 }, +{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 }, +{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 }, +{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 }, +{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 }, +{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c }, +{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 }, +{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 }, +{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 }, +{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 }, +{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 }, +{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 }, +{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 }, +{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 }, +{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 }, +{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 }, +{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, +{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, +{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, +{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x20 }, +{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 }, +{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x20 }, +{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, +{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, +{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, +{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, +{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, +{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, +{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, +{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, +{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, +{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, +{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, +{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, +{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, +{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, +{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, +{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, +{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, +{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, +{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, +{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, +{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, +{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, +{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, +{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, +{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, +{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, +{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, +{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, +{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, +{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, +{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, +{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, +{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, +{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, +{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, +{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, +{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 }, +{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 }, +{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 }, +{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c }, +{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c }, +{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x60 }, +{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 }, +{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 }, +{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 }, +{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 }, +{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 }, +{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 }, +{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 }, +{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 }, +{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 }, +{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 }, +{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 }, +{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 }, +{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, +{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, +{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, +{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, +{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 }, +{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 }, +{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2c }, +{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a }, +{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 }, +{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 }, +{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 }, +{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 }, +{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, +{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, +{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, +{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, +{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 }, +{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, +{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, +{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, +{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 }, +{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 }, +{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 }, +{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, +{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 }, +{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 }, +{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 }, +{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 }, +{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 }, +{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x50 }, +{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x88 }, +{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, +{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x50 }, +{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 }, +{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 }, +{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x50 }, +{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x50 }, +{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x50 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 }, +{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, +{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, +{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 }, +{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 }, +{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, +{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, +{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c }, +{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 }, +{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c }, +{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 }, +{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 }, +{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 }, +{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 }, +{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 }, +{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 }, +{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 }, +{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 }, +{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc }, +{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 }, +{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 }, +{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 }, +{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 }, +{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 }, +{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 }, +{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 }, +{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 }, +{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 }, +{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 }, +{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 }, +{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 }, +{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 }, +{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 }, +{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 }, +{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 }, +{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 }, +{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 }, +{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 }, +{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 }, +{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 }, +{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 }, +{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 }, +{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 }, +{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 }, +{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 }, +{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 }, +{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 }, +{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 }, +{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 }, +{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 }, +{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 }, +{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 }, +{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 }, +{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 }, +{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 }, +{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 }, +{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 }, +{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 }, +{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 }, +{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 }, +{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 }, +{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 }, +{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 }, +{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 }, +{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 }, +{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 }, +{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 }, +{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 }, +{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 }, +{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 }, +{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 }, +{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 }, +{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 }, +{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 }, +{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 }, +{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 }, +{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 }, +{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 }, +{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 }, +{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 }, +{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 }, +{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 }, +{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 }, +{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 }, +{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 }, +{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 }, +{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 }, +{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 }, +{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 }, +{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 }, +{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 }, +{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 }, +{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, +{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, +{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, +{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, +{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, +{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 }, +{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 }, +{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 }, +{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x88 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 }, +{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, +{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, +{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, +{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, +{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, +{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 }, +{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 }, +{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 }, +{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 }, +{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 }, +{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 }, +{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 }, +{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c }, +{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 }, +{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 }, +{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 }, +{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c }, +{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 }, +{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 }, +{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c }, +{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c }, +{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 }, +{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 }, +{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, +{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, +{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, +{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, +{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, +{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 }, +{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, +{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, +{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, +{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, +{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 }, +{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 }, +{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 }, +{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 }, +{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 }, +{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 }, +{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 }, +{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 }, +{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 }, +{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 }, +{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 }, +{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 }, +{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 }, +{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 }, +{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 }, +{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 }, +{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 }, +{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 }, +{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 }, +{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 }, +{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 }, +{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 }, +{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 }, +{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 }, +{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 }, +{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa4 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 }, +{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x48 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c8 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c8 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 }, +{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc }, +{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x18 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x25c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x25c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x80 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x80 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x88 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x20 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 }, +{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x30 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x60 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 }, +{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD", _IOC_WRITE, 0x5402, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 }, +{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 }, +{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 }, +{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, +{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 }, +{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x20 }, +{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 }, +{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 }, +{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 }, +{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 }, +{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, +{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, +{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, +{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, +{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, +{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, +{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, +{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 }, +{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 }, +{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 }, +{ "video/mbxfb.h", "MBXFB_IOCG_ALPHA", _IOC_READ, 0xf401, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_ALPHA", _IOC_WRITE, 0xf402, 0x18 }, +{ "video/mbxfb.h", "MBXFB_IOCS_PLANEORDER", _IOC_READ, 0xf403, 0x02 }, +{ "video/mbxfb.h", "MBXFB_IOCS_REG", _IOC_WRITE, 0xf404, 0x0c }, +{ "video/mbxfb.h", "MBXFB_IOCX_OVERLAY", _IOC_READ|_IOC_WRITE, 0xf400, 0x30 }, +{ "video/mbxfb.h", "MBXFB_IOCX_REG", _IOC_READ|_IOC_WRITE, 0xf405, 0x0c }, +{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c }, +{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 }, +{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 }, +{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 }, +{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 }, +{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, +{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 }, +{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 }, diff --git a/linux/x32/ioctls_inc1.h b/linux/x32/ioctls_inc1.h new file mode 100644 index 00000000..c9fcdf8f --- /dev/null +++ b/linux/x32/ioctls_inc1.h @@ -0,0 +1 @@ +#include "i386/ioctls_inc0.h" diff --git a/linux/x32/set_error.c b/linux/x32/set_error.c new file mode 100644 index 00000000..66a73271 --- /dev/null +++ b/linux/x32/set_error.c @@ -0,0 +1 @@ +#include "x86_64/set_error.c" diff --git a/linux/x32/set_scno.c b/linux/x32/set_scno.c new file mode 100644 index 00000000..5f7cdb4b --- /dev/null +++ b/linux/x32/set_scno.c @@ -0,0 +1 @@ +#include "x86_64/set_scno.c" diff --git a/linux/x32/signalent.h b/linux/x32/signalent.h deleted file mode 100644 index d31e6a4a..00000000 --- a/linux/x32/signalent.h +++ /dev/null @@ -1 +0,0 @@ -#include "../signalent.h" diff --git a/linux/x32/signalent1.h b/linux/x32/signalent1.h index c927d729..fdae15fc 100644 --- a/linux/x32/signalent1.h +++ b/linux/x32/signalent1.h @@ -1,2 +1,2 @@ /* i386 personality */ -#include "../signalent.h" +#include "signalent.h" diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h index 2000113f..0cda1a65 100644 --- a/linux/x32/syscallent.h +++ b/linux/x32/syscallent.h @@ -1,353 +1,373 @@ - { 3, TD, sys_read, "read" }, /* 0 */ - { 3, TD, sys_write, "write" }, /* 1 */ - { 3, TD|TF, sys_open, "open" }, /* 2 */ - { 1, TD, sys_close, "close" }, /* 3 */ - { 2, TF, sys_stat, "stat" }, /* 4 */ - { 2, TD, sys_fstat, "fstat" }, /* 5 */ - { 2, TF, sys_lstat, "lstat" }, /* 6 */ - { 3, TD, sys_poll, "poll" }, /* 7 */ - { 3, TD, sys_lseek, "lseek" }, /* 8 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 9 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 10 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 11 */ - { 1, TM|SI, sys_brk, "brk" }, /* 12 */ - { 4, TS, printargs, "64:rt_sigaction" }, /* 13 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 14 */ - { 0, TS, printargs, "64:rt_sigreturn" }, /* 15 */ - { 3, TD, printargs, "64:ioctl" }, /* 16 */ - { 4, TD, sys_pread, "pread" }, /* 17 */ - { 4, TD, sys_pwrite, "pwrite" }, /* 18 */ - { 3, TD, printargs, "64:readv" }, /* 19 */ - { 3, TD, printargs, "64:writev" }, /* 20 */ - { 2, TF, sys_access, "access" }, /* 21 */ - { 1, TD, sys_pipe, "pipe" }, /* 22 */ - { 5, TD, sys_select, "select" }, /* 23 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 24 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 25 */ - { 3, TM, sys_msync, "msync" }, /* 26 */ - { 3, TM, sys_mincore, "mincore" }, /* 27 */ - { 3, TM, sys_madvise, "madvise" }, /* 28 */ - { 4, TI, sys_shmget, "shmget" }, /* 29 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 30 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 31 */ - { 1, TD, sys_dup, "dup" }, /* 32 */ - { 2, TD, sys_dup2, "dup2" }, /* 33 */ - { 0, TS, sys_pause, "pause" }, /* 34 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 35 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 36 */ - { 1, 0, sys_alarm, "alarm" }, /* 37 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 38 */ - { 0, 0, sys_getpid, "getpid" }, /* 39 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 40 */ - { 3, TN, sys_socket, "socket" }, /* 41 */ - { 3, TN, sys_connect, "connect" }, /* 42 */ - { 3, TN, sys_accept, "accept" }, /* 43 */ - { 6, TN, sys_sendto, "sendto" }, /* 44 */ - { 6, TN, printargs, "64:recvfrom" }, /* 45 */ - { 3, TN, printargs, "64:sendmsg" }, /* 46 */ - { 5, TN, printargs, "64:recvmsg" }, /* 47 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 48 */ - { 3, TN, sys_bind, "bind" }, /* 49 */ - { 2, TN, sys_listen, "listen" }, /* 50 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 51 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 52 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 53 */ - { 5, TN, printargs, "64:setsockopt" }, /* 54 */ - { 5, TN, printargs, "64:getsockopt" }, /* 55 */ - { 5, TP, sys_clone, "clone" }, /* 56 */ - { 0, TP, sys_fork, "fork" }, /* 57 */ - { 0, TP, sys_vfork, "vfork" }, /* 58 */ - { 3, TF|TP|SE|SI, printargs, "64:execve" }, /* 59 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 60 */ - { 4, TP, sys_wait4, "wait4" }, /* 61 */ - { 2, TS, sys_kill, "kill" }, /* 62 */ - { 1, 0, sys_uname, "uname" }, /* 63 */ - { 4, TI, sys_semget, "semget" }, /* 64 */ - { 4, TI, sys_semop, "semop" }, /* 65 */ - { 4, TI, sys_semctl, "semctl" }, /* 66 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 67 */ - { 4, TI, sys_msgget, "msgget" }, /* 68 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 69 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 70 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 71 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 72 */ - { 2, TD, sys_flock, "flock" }, /* 73 */ - { 1, TD, sys_fsync, "fsync" }, /* 74 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 75 */ - { 2, TF, sys_truncate64, "truncate" }, /* 76 */ - { 2, TD, sys_ftruncate64, "ftruncate" }, /* 77 */ - { 3, TD, sys_getdents, "getdents" }, /* 78 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 79 */ - { 1, TF, sys_chdir, "chdir" }, /* 80 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 81 */ - { 2, TF, sys_rename, "rename" }, /* 82 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 83 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 84 */ - { 2, TD|TF, sys_creat, "creat" }, /* 85 */ - { 2, TF, sys_link, "link" }, /* 86 */ - { 1, TF, sys_unlink, "unlink" }, /* 87 */ - { 2, TF, sys_symlink, "symlink" }, /* 88 */ - { 3, TF, sys_readlink, "readlink" }, /* 89 */ - { 2, TF, sys_chmod, "chmod" }, /* 90 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 91 */ - { 3, TF, sys_chown, "chown" }, /* 92 */ - { 3, TD, sys_fchown, "fchown" }, /* 93 */ - { 3, TF, sys_chown, "lchown" }, /* 94 */ - { 1, 0, sys_umask, "umask" }, /* 95 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 96 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 97 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 98 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 99 */ - { 1, 0, sys_times, "times" }, /* 100 */ - { 4, 0, printargs, "64:ptrace" }, /* 101 */ - { 0, NF, sys_getuid, "getuid" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 0, NF, sys_getgid, "getgid" }, /* 104 */ - { 1, 0, sys_setuid, "setuid" }, /* 105 */ - { 1, 0, sys_setgid, "setgid" }, /* 106 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 107 */ - { 0, NF, sys_getegid, "getegid" }, /* 108 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 109 */ - { 0, 0, sys_getppid, "getppid" }, /* 110 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 111 */ - { 0, 0, sys_setsid, "setsid" }, /* 112 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 113 */ - { 2, 0, sys_setregid, "setregid" }, /* 114 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 115 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 116 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 117 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 118 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 119 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 120 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 121 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 122 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 123 */ - { 1, 0, sys_getsid, "getsid" }, /* 124 */ - { 2, 0, sys_capget, "capget" }, /* 125 */ - { 2, 0, sys_capset, "capset" }, /* 126 */ - { 2, TS, printargs, "64:rt_sigpending" }, /* 127 */ - { 4, TS, printargs, "64:rt_sigtimedwait" }, /* 128 */ - { 3, TS, printargs, "64:rt_sigqueueinfo" }, /* 129 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 130 */ - { 2, TS, printargs, "64:sigaltstack"}, /* 131 */ - { 2, TF, sys_utime, "utime" }, /* 132 */ - { 3, TF, sys_mknod, "mknod" }, /* 133 */ - { 1, TF, printargs, "64:uselib" }, /* 134 */ - { 1, 0, sys_personality, "personality" }, /* 135 */ - { 2, 0, sys_ustat, "ustat" }, /* 136 */ - { 2, TF, sys_statfs, "statfs" }, /* 137 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 138 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 139 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 140 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 141 */ - { 0, 0, sys_sched_setparam, "sched_setparam" }, /* 142 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 143 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 144 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 145 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max" }, /* 146 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min" }, /* 147 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 148 */ - { 2, TM, sys_mlock, "mlock" }, /* 149 */ - { 2, TM, sys_munlock, "munlock" }, /* 150 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 151 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 152 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 153 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 154 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 155 */ - { 1, 0, printargs, "64:_sysctl" }, /* 156 */ - { 5, 0, sys_prctl, "prctl" }, /* 157 */ - { 2, TP, sys_arch_prctl, "arch_prctl" }, /* 158 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 159 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 160 */ - { 1, TF, sys_chroot, "chroot" }, /* 161 */ - { 0, 0, sys_sync, "sync" }, /* 162 */ - { 1, TF, sys_acct, "acct" }, /* 163 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 164 */ - { 5, TF, sys_mount, "mount" }, /* 165 */ - { 2, TF, sys_umount2, "umount" }, /* 166 */ - { 2, TF, sys_swapon, "swapon" }, /* 167 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 168 */ - { 4, 0, sys_reboot, "reboot" }, /* 169 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 170 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 171 */ - { 1, 0, sys_iopl, "iopl" }, /* 172 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 173 */ - { 2, 0, printargs, "64:create_module" }, /* 174 */ - { 3, 0, sys_init_module, "init_module" }, /* 175 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 176 */ - { 1, 0, printargs, "64:get_kernel_syms" }, /* 177 */ - { 5, 0, printargs, "64:query_module" }, /* 178 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 179 */ - { 3, 0, printargs, "64:nfsservctl" }, /* 180 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 181 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 182 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 183 */ - { 3, 0, sys_tuxcall, "tuxcall" }, /* 184 */ - { 3, 0, sys_security, "security" }, /* 185 */ - { 0, 0, sys_gettid, "gettid" }, /* 186 */ - { 3, TD, sys_readahead, "readahead" }, /* 187 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 188 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 189 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 190 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 191 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 192 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 193 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 194 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 195 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 196 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 197 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 198 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 199 */ - { 2, TS, sys_kill, "tkill" }, /* 200 */ - { 1, 0, sys_time, "time" }, /* 201 */ - { 6, 0, sys_futex, "futex" }, /* 202 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 203 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 204 */ - { 1, 0, printargs, "64:set_thread_area" }, /* 205 */ - { 2, 0, sys_io_setup, "64:io_setup" }, /* 206 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 207 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 208 */ - { 3, 0, sys_io_submit, "64:io_submit" }, /* 209 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 210 */ - { 1, 0, printargs, "64:get_thread_area" }, /* 211 */ - { 4, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 212 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 213 */ - { 4, 0, printargs, "64:epoll_ctl_old" }, /* 214 */ - { 4, 0, printargs, "64:epoll_wait_old" }, /* 215 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 216 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 217 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 218 */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 219 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 220 */ - { 4, TD, sys_fadvise64_64, "fadvise64" }, /* 221 */ - { 3, 0, printargs, "64:timer_create"}, /* 222 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 223 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 224 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 225 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 226 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 227 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 228 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 229 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 230 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 231 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 232 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 233 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 234 */ - { 2, TF, sys_utimes, "utimes" }, /* 235 */ - { 5, 0, printargs, "64:vserver" }, /* 236 */ - { 6, TM, sys_mbind, "mbind" }, /* 237 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 238 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 239 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 240 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 241 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 242 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 243 */ - { 2, 0, printargs, "64:mq_notify" }, /* 244 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 245 */ - { 4, 0, printargs, "64:kexec_load" }, /* 246 */ - { 5, TP, printargs, "64:waitid" }, /* 247 */ - { 5, 0, sys_add_key, "add_key" }, /* 248 */ - { 4, 0, sys_request_key, "request_key" }, /* 249 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 250 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 251 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 252 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 253 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 254 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 255 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 256 */ - { 4, TD|TF, sys_openat, "openat" }, /* 257 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 258 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 259 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 260 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 261 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 262 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 263 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 264 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 265 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 266 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 267 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 268 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 269 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 270 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 271 */ - { 1, TP, sys_unshare, "unshare" }, /* 272 */ - { 2, 0, printargs, "64:set_robust_list" }, /* 273 */ - { 3, 0, printargs, "64:get_robust_list" }, /* 274 */ - { 6, TD, sys_splice, "splice" }, /* 275 */ - { 4, TD, sys_tee, "tee" }, /* 276 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 277 */ - { 4, TD, printargs, "64:vmsplice" }, /* 278 */ - { 6, TM, printargs, "64:move_pages" }, /* 279 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 280 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 281 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 282 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 283 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 284 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 285 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 286 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 287 */ - { 4, TN, sys_accept4, "accept4" }, /* 288 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 289 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 290 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 291 */ - { 3, TD, sys_dup3, "dup3" }, /* 292 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 293 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 294 */ - { 4, TD, printargs, "64:preadv" }, /* 295 */ - { 4, TD, printargs, "64:pwritev" }, /* 296 */ - { 4, TP|TS, printargs, "64:rt_tgsigqueueinfo"}, /* 297 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 298 */ - { 5, TN, printargs, "64:recvmmsg" }, /* 299 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 300 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 301 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 302 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 303 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 304 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 305 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 306 */ - { 4, TN, printargs, "64:sendmmsg" }, /* 307 */ - { 2, TD, sys_setns, "setns" }, /* 308 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 309 */ - { 6, 0, printargs, "64:process_vm_readv" }, /* 310 */ - { 6, 0, printargs, "64:process_vm_writev" }, /* 311 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 312 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 313 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 314 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 315 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 316 */ - - [317 ... 511] = {}, - - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 512 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 513 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 514 */ - { 3, TD, sys_readv, "readv" }, /* 515 */ - { 3, TD, sys_writev, "writev" }, /* 516 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 517 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 518 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 519 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 520 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 521 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 522 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 523 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 524 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 525 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 526 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 527 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 528 */ - { 5, TP, sys_waitid, "waitid" }, /* 529 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 530 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 531 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 532 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 533 */ - { 4, TD, sys_preadv, "preadv" }, /* 534 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 535 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" }, /* 536 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 537 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 538 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 539 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 540 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 541 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 542 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 543 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 544 */ +[ 0] = { 3, TD, SEN(read), "read" }, +[ 1] = { 3, TD, SEN(write), "write" }, +[ 2] = { 3, TD|TF, SEN(open), "open" }, +[ 3] = { 1, TD, SEN(close), "close" }, +[ 4] = { 2, TF, SEN(stat), "stat" }, +[ 5] = { 2, TD, SEN(fstat), "fstat" }, +[ 6] = { 2, TF, SEN(lstat), "lstat" }, +[ 7] = { 3, TD, SEN(poll), "poll" }, +[ 8] = { 3, TD, SEN(lseek), "lseek" }, +[ 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 10] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[ 11] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 12] = { 1, TM|SI, SEN(brk), "brk" }, +[ 13] = { 4, TS, SEN(printargs), "64:rt_sigaction" }, +[ 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[ 15] = { 0, TS, SEN(printargs), "64:rt_sigreturn" }, +[ 16] = { 3, TD, SEN(printargs), "64:ioctl" }, +[ 17] = { 4, TD, SEN(pread), "pread64" }, +[ 18] = { 4, TD, SEN(pwrite), "pwrite64" }, +[ 19] = { 3, TD, SEN(printargs), "64:readv" }, +[ 20] = { 3, TD, SEN(printargs), "64:writev" }, +[ 21] = { 2, TF, SEN(access), "access" }, +[ 22] = { 1, TD, SEN(pipe), "pipe" }, +[ 23] = { 5, TD, SEN(select), "select" }, +[ 24] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[ 25] = { 5, TM|SI, SEN(mremap), "mremap" }, +[ 26] = { 3, TM, SEN(msync), "msync" }, +[ 27] = { 3, TM, SEN(mincore), "mincore" }, +[ 28] = { 3, TM, SEN(madvise), "madvise" }, +[ 29] = { 3, TI, SEN(shmget), "shmget" }, +[ 30] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[ 31] = { 3, TI, SEN(shmctl), "shmctl" }, +[ 32] = { 1, TD, SEN(dup), "dup" }, +[ 33] = { 2, TD, SEN(dup2), "dup2" }, +[ 34] = { 0, TS, SEN(pause), "pause" }, +[ 35] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[ 36] = { 2, 0, SEN(getitimer), "getitimer" }, +[ 37] = { 1, 0, SEN(alarm), "alarm" }, +[ 38] = { 3, 0, SEN(setitimer), "setitimer" }, +[ 39] = { 0, NF, SEN(getpid), "getpid" }, +[ 40] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, +[ 41] = { 3, TN, SEN(socket), "socket" }, +[ 42] = { 3, TN, SEN(connect), "connect" }, +[ 43] = { 3, TN, SEN(accept), "accept" }, +[ 44] = { 6, TN, SEN(sendto), "sendto" }, +[ 45] = { 6, TN, SEN(printargs), "64:recvfrom" }, +[ 46] = { 3, TN, SEN(printargs), "64:sendmsg" }, +[ 47] = { 3, TN, SEN(printargs), "64:recvmsg" }, +[ 48] = { 2, TN, SEN(shutdown), "shutdown" }, +[ 49] = { 3, TN, SEN(bind), "bind" }, +[ 50] = { 2, TN, SEN(listen), "listen" }, +[ 51] = { 3, TN, SEN(getsockname), "getsockname" }, +[ 52] = { 3, TN, SEN(getpeername), "getpeername" }, +[ 53] = { 4, TN, SEN(socketpair), "socketpair" }, +[ 54] = { 5, TN, SEN(printargs), "64:setsockopt" }, +[ 55] = { 5, TN, SEN(printargs), "64:getsockopt" }, +[ 56] = { 5, TP, SEN(clone), "clone" }, +[ 57] = { 0, TP, SEN(fork), "fork" }, +[ 58] = { 0, TP, SEN(vfork), "vfork" }, +[ 59] = { 3, TF|TP|SE|SI, SEN(printargs), "64:execve" }, +[ 60] = { 1, TP|SE, SEN(exit), "exit" }, +[ 61] = { 4, TP, SEN(wait4), "wait4" }, +[ 62] = { 2, TS, SEN(kill), "kill" }, +[ 63] = { 1, 0, SEN(uname), "uname" }, +[ 64] = { 3, TI, SEN(semget), "semget" }, +[ 65] = { 3, TI, SEN(semop), "semop" }, +[ 66] = { 4, TI, SEN(semctl), "semctl" }, +[ 67] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[ 68] = { 2, TI, SEN(msgget), "msgget" }, +[ 69] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[ 70] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[ 71] = { 3, TI, SEN(msgctl), "msgctl" }, +[ 72] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 73] = { 2, TD, SEN(flock), "flock" }, +[ 74] = { 1, TD, SEN(fsync), "fsync" }, +[ 75] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[ 76] = { 2, TF, SEN(truncate64), "truncate" }, +[ 77] = { 2, TD, SEN(ftruncate64), "ftruncate" }, +[ 78] = { 3, TD, SEN(getdents), "getdents" }, +[ 79] = { 2, TF, SEN(getcwd), "getcwd" }, +[ 80] = { 1, TF, SEN(chdir), "chdir" }, +[ 81] = { 1, TD, SEN(fchdir), "fchdir" }, +[ 82] = { 2, TF, SEN(rename), "rename" }, +[ 83] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 84] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 85] = { 2, TD|TF, SEN(creat), "creat" }, +[ 86] = { 2, TF, SEN(link), "link" }, +[ 87] = { 1, TF, SEN(unlink), "unlink" }, +[ 88] = { 2, TF, SEN(symlink), "symlink" }, +[ 89] = { 3, TF, SEN(readlink), "readlink" }, +[ 90] = { 2, TF, SEN(chmod), "chmod" }, +[ 91] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 92] = { 3, TF, SEN(chown), "chown" }, +[ 93] = { 3, TD, SEN(fchown), "fchown" }, +[ 94] = { 3, TF, SEN(chown), "lchown" }, +[ 95] = { 1, NF, SEN(umask), "umask" }, +[ 96] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 97] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 98] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 99] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[100] = { 1, 0, SEN(times), "times" }, +[101] = { 4, 0, SEN(printargs), "64:ptrace" }, +[102] = { 0, NF, SEN(getuid), "getuid" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 0, NF, SEN(getgid), "getgid" }, +[105] = { 1, 0, SEN(setuid), "setuid" }, +[106] = { 1, 0, SEN(setgid), "setgid" }, +[107] = { 0, NF, SEN(geteuid), "geteuid" }, +[108] = { 0, NF, SEN(getegid), "getegid" }, +[109] = { 2, 0, SEN(setpgid), "setpgid" }, +[110] = { 0, NF, SEN(getppid), "getppid" }, +[111] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[112] = { 0, 0, SEN(setsid), "setsid" }, +[113] = { 2, 0, SEN(setreuid), "setreuid" }, +[114] = { 2, 0, SEN(setregid), "setregid" }, +[115] = { 2, 0, SEN(getgroups), "getgroups" }, +[116] = { 2, 0, SEN(setgroups), "setgroups" }, +[117] = { 3, 0, SEN(setresuid), "setresuid" }, +[118] = { 3, 0, SEN(getresuid), "getresuid" }, +[119] = { 3, 0, SEN(setresgid), "setresgid" }, +[120] = { 3, 0, SEN(getresgid), "getresgid" }, +[121] = { 1, 0, SEN(getpgid), "getpgid" }, +[122] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[123] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[124] = { 1, 0, SEN(getsid), "getsid" }, +[125] = { 2, 0, SEN(capget), "capget" }, +[126] = { 2, 0, SEN(capset), "capset" }, +[127] = { 2, TS, SEN(printargs), "64:rt_sigpending" }, +[128] = { 4, TS, SEN(printargs), "64:rt_sigtimedwait" }, +[129] = { 3, TS, SEN(printargs), "64:rt_sigqueueinfo" }, +[130] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[131] = { 2, TS, SEN(printargs), "64:sigaltstack" }, +[132] = { 2, TF, SEN(utime), "utime" }, +[133] = { 3, TF, SEN(mknod), "mknod" }, +[134] = { 1, TF, SEN(printargs), "64:uselib" }, +[135] = { 1, NF, SEN(personality), "personality" }, +[136] = { 2, 0, SEN(ustat), "ustat" }, +[137] = { 2, TF, SEN(statfs), "statfs" }, +[138] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[139] = { 3, 0, SEN(sysfs), "sysfs" }, +[140] = { 2, 0, SEN(getpriority), "getpriority" }, +[141] = { 3, 0, SEN(setpriority), "setpriority" }, +[142] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[143] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[144] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[145] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[146] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[147] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[148] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[149] = { 2, TM, SEN(mlock), "mlock" }, +[150] = { 2, TM, SEN(munlock), "munlock" }, +[151] = { 1, TM, SEN(mlockall), "mlockall" }, +[152] = { 0, TM, SEN(munlockall), "munlockall" }, +[153] = { 0, 0, SEN(vhangup), "vhangup" }, +[154] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, +[155] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[156] = { 1, 0, SEN(printargs), "64:_sysctl" }, +[157] = { 5, 0, SEN(prctl), "prctl" }, +[158] = { 2, TP, SEN(arch_prctl), "arch_prctl" }, +[159] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[160] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[161] = { 1, TF, SEN(chroot), "chroot" }, +[162] = { 0, 0, SEN(sync), "sync" }, +[163] = { 1, TF, SEN(acct), "acct" }, +[164] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[165] = { 5, TF, SEN(mount), "mount" }, +[166] = { 2, TF, SEN(umount2), "umount2" }, +[167] = { 2, TF, SEN(swapon), "swapon" }, +[168] = { 1, TF, SEN(swapoff), "swapoff" }, +[169] = { 4, 0, SEN(reboot), "reboot" }, +[170] = { 2, 0, SEN(sethostname), "sethostname" }, +[171] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[172] = { 1, 0, SEN(iopl), "iopl" }, +[173] = { 3, 0, SEN(ioperm), "ioperm" }, +[174] = { 2, 0, SEN(printargs), "64:create_module" }, +[175] = { 3, 0, SEN(init_module), "init_module" }, +[176] = { 2, 0, SEN(delete_module), "delete_module" }, +[177] = { 1, 0, SEN(printargs), "64:get_kernel_syms" }, +[178] = { 5, 0, SEN(printargs), "64:query_module" }, +[179] = { 4, TF, SEN(quotactl), "quotactl" }, +[180] = { 3, 0, SEN(printargs), "64:nfsservctl" }, +[181] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[182] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[183] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[184] = { 3, 0, SEN(tuxcall), "tuxcall" }, +[185] = { 3, 0, SEN(security), "security" }, +[186] = { 0, NF, SEN(gettid), "gettid" }, +[187] = { 3, TD, SEN(readahead), "readahead" }, +[188] = { 5, TF, SEN(setxattr), "setxattr" }, +[189] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[190] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[191] = { 4, TF, SEN(getxattr), "getxattr" }, +[192] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[193] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[194] = { 3, TF, SEN(listxattr), "listxattr" }, +[195] = { 3, TF, SEN(listxattr), "llistxattr" }, +[196] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[197] = { 2, TF, SEN(removexattr), "removexattr" }, +[198] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[199] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[200] = { 2, TS, SEN(kill), "tkill" }, +[201] = { 1, 0, SEN(time), "time" }, +[202] = { 6, 0, SEN(futex), "futex" }, +[203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[205] = { 1, 0, SEN(printargs), "64:set_thread_area" }, +[206] = { 2, TM, SEN(printargs), "64:io_setup" }, +[207] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[208] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[209] = { 3, 0, SEN(printargs), "64:io_submit" }, +[210] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[211] = { 1, 0, SEN(printargs), "64:get_thread_area" }, +[212] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[213] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[214] = { 4, 0, SEN(printargs), "64:epoll_ctl_old" }, +[215] = { 4, 0, SEN(printargs), "64:epoll_wait_old" }, +[216] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[217] = { 3, TD, SEN(getdents64), "getdents64" }, +[218] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[219] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[220] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[221] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[222] = { 3, 0, SEN(printargs), "64:timer_create" }, +[223] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[224] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[225] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[226] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[227] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[228] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[229] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[230] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[231] = { 1, TP|SE, SEN(exit), "exit_group" }, +[232] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[233] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[234] = { 3, TS, SEN(tgkill), "tgkill" }, +[235] = { 2, TF, SEN(utimes), "utimes" }, +[236] = { 5, 0, SEN(printargs), "64:vserver" }, +[237] = { 6, TM, SEN(mbind), "mbind" }, +[238] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[239] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[240] = { 4, 0, SEN(mq_open), "mq_open" }, +[241] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[242] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[243] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[244] = { 2, 0, SEN(printargs), "64:mq_notify" }, +[245] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[246] = { 4, 0, SEN(printargs), "64:kexec_load" }, +[247] = { 5, TP, SEN(printargs), "64:waitid" }, +[248] = { 5, 0, SEN(add_key), "add_key" }, +[249] = { 4, 0, SEN(request_key), "request_key" }, +[250] = { 5, 0, SEN(keyctl), "keyctl" }, +[251] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[252] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[253] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[254] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[256] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[257] = { 4, TD|TF, SEN(openat), "openat" }, +[258] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[259] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[260] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[261] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[262] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[264] = { 4, TD|TF, SEN(renameat), "renameat" }, +[265] = { 5, TD|TF, SEN(linkat), "linkat" }, +[266] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[269] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[270] = { 6, TD, SEN(pselect6), "pselect6" }, +[271] = { 5, TD, SEN(ppoll), "ppoll" }, +[272] = { 1, TP, SEN(unshare), "unshare" }, +[273] = { 2, 0, SEN(printargs), "64:set_robust_list" }, +[274] = { 3, 0, SEN(printargs), "64:get_robust_list" }, +[275] = { 6, TD, SEN(splice), "splice" }, +[276] = { 4, TD, SEN(tee), "tee" }, +[277] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[278] = { 4, TD, SEN(printargs), "64:vmsplice" }, +[279] = { 6, TM, SEN(printargs), "64:move_pages" }, +[280] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[282] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[283] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[284] = { 1, TD, SEN(eventfd), "eventfd" }, +[285] = { 4, TD, SEN(fallocate), "fallocate" }, +[286] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[287] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[288] = { 4, TN, SEN(accept4), "accept4" }, +[289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[290] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[291] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[292] = { 3, TD, SEN(dup3), "dup3" }, +[293] = { 2, TD, SEN(pipe2), "pipe2" }, +[294] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[295] = { 4, TD, SEN(printargs), "64:preadv" }, +[296] = { 4, TD, SEN(printargs), "64:pwritev" }, +[297] = { 4, TP|TS, SEN(printargs), "64:rt_tgsigqueueinfo" }, +[298] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[299] = { 5, TN, SEN(printargs), "64:recvmmsg" }, +[300] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[302] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[305] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[306] = { 1, TD, SEN(syncfs), "syncfs" }, +[307] = { 4, TN, SEN(printargs), "64:sendmmsg" }, +[308] = { 2, TD, SEN(setns), "setns" }, +[309] = { 3, 0, SEN(getcpu), "getcpu" }, +[310] = { 6, 0, SEN(printargs), "64:process_vm_readv" }, +[311] = { 6, 0, SEN(printargs), "64:process_vm_writev" }, +[312] = { 5, 0, SEN(kcmp), "kcmp" }, +[313] = { 3, TD, SEN(finit_module), "finit_module" }, +[314] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[315] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[316] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[317] = { 3, 0, SEN(seccomp), "seccomp" }, +[318] = { 3, 0, SEN(getrandom), "getrandom" }, +[319] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[320] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[321] = { 3, TD, SEN(bpf), "bpf" }, +[322] = { 5, TD|TF|TP|SE|SI, SEN(printargs), "64:execveat" }, +[323] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[324] = { 2, 0, SEN(membarrier), "membarrier" }, +[325] = { 3, TM, SEN(mlock2), "mlock2" }, +[326] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[327] = { 6, TD, SEN(printargs), "64:preadv2" }, +[328] = { 6, TD, SEN(printargs), "64:pwritev2" }, +[329] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[330] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[331] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[332 ... 511] = { }, +/* + * x32-specific system call numbers start at 512 to avoid cache impact + * for native 64-bit operation. + */ +[512] = { 4, CST|TS, SEN(rt_sigaction), "rt_sigaction" }, +[513] = { 0, CST|TS, SEN(sigreturn), "rt_sigreturn" }, +[514] = { 3, CST|TD, SEN(ioctl), "ioctl" }, +[515] = { 3, CST|TD, SEN(readv), "readv" }, +[516] = { 3, CST|TD, SEN(writev), "writev" }, +[517] = { 6, CST|TN, SEN(recvfrom), "recvfrom" }, +[518] = { 3, CST|TN, SEN(sendmsg), "sendmsg" }, +[519] = { 3, CST|TN, SEN(recvmsg), "recvmsg" }, +[520] = { 3, CST|TF|TP|SE|SI,SEN(execve), "execve" }, +[521] = { 4, CST, SEN(ptrace), "ptrace" }, +[522] = { 2, CST|TS, SEN(rt_sigpending), "rt_sigpending" }, +[523] = { 4, CST|TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[524] = { 3, CST|TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[525] = { 2, CST|TS, SEN(sigaltstack), "sigaltstack" }, +[526] = { 3, CST, SEN(timer_create), "timer_create" }, +[527] = { 2, CST, SEN(mq_notify), "mq_notify" }, +[528] = { 4, CST, SEN(kexec_load), "kexec_load" }, +[529] = { 5, CST|TP, SEN(waitid), "waitid" }, +[530] = { 2, CST, SEN(set_robust_list), "set_robust_list" }, +[531] = { 3, CST, SEN(get_robust_list), "get_robust_list" }, +[532] = { 4, CST|TD, SEN(vmsplice), "vmsplice" }, +[533] = { 6, CST|TM, SEN(move_pages), "move_pages" }, +[534] = { 4, TD, SEN(preadv), "preadv" }, +[535] = { 4, TD, SEN(pwritev), "pwritev" }, +[536] = { 4, CST|TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[537] = { 5, CST|TN, SEN(recvmmsg), "recvmmsg" }, +[538] = { 4, CST|TN, SEN(sendmmsg), "sendmmsg" }, +[539] = { 6, CST, SEN(process_vm_readv), "process_vm_readv" }, +[540] = { 6, CST, SEN(process_vm_writev), "process_vm_writev" }, +[541] = { 5, CST|TN, SEN(setsockopt), "setsockopt" }, +[542] = { 5, CST|TN, SEN(getsockopt), "getsockopt" }, +[543] = { 2, CST|TM, SEN(io_setup), "io_setup" }, +[544] = { 3, CST, SEN(io_submit), "io_submit" }, +[545] = { 5, CST|TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[546] = { 6, TD, SEN(preadv2), "preadv2" }, +[547] = { 6, TD, SEN(pwritev2), "pwritev2" }, diff --git a/linux/x32/userent.h b/linux/x32/userent.h new file mode 100644 index 00000000..ae69a3f7 --- /dev/null +++ b/linux/x32/userent.h @@ -0,0 +1 @@ +#include "../x86_64/userent.h" diff --git a/linux/x86_64/arch_regs.c b/linux/x86_64/arch_regs.c new file mode 100644 index 00000000..daee69f9 --- /dev/null +++ b/linux/x86_64/arch_regs.c @@ -0,0 +1,41 @@ +/* + * On i386, pt_regs and user_regs_struct are the same, + * but on 64 bit x86, user_regs_struct has six more fields: + * fs_base, gs_base, ds, es, fs, gs. + * PTRACE_GETREGS fills them too, so struct pt_regs would overflow. + */ +struct i386_user_regs_struct { + uint32_t ebx; + uint32_t ecx; + uint32_t edx; + uint32_t esi; + uint32_t edi; + uint32_t ebp; + uint32_t eax; + uint32_t xds; + uint32_t xes; + uint32_t xfs; + uint32_t xgs; + uint32_t orig_eax; + uint32_t eip; + uint32_t xcs; + uint32_t eflags; + uint32_t esp; + uint32_t xss; +}; +static union { + struct user_regs_struct x86_64_r; + struct i386_user_regs_struct i386_r; +} x86_regs_union; +#define x86_64_regs x86_regs_union.x86_64_r +#define i386_regs x86_regs_union.i386_r + +uint32_t *const i386_esp_ptr = &i386_regs.esp; +uint64_t *const x86_64_rsp_ptr = (uint64_t *) &x86_64_regs.rsp; +static struct iovec x86_io = { + .iov_base = &x86_regs_union +}; + +#define ARCH_REGS_FOR_GETREGSET x86_regs_union +#define ARCH_IOVEC_FOR_GETREGSET x86_io +#define ARCH_PC_REG (x86_io.iov_len == sizeof(i386_regs) ? i386_regs.eip : x86_64_regs.rip) diff --git a/linux/x86_64/arch_regs.h b/linux/x86_64/arch_regs.h new file mode 100644 index 00000000..c2ccee67 --- /dev/null +++ b/linux/x86_64/arch_regs.h @@ -0,0 +1,2 @@ +extern uint32_t *const i386_esp_ptr; +extern uint64_t *const x86_64_rsp_ptr; diff --git a/linux/x86_64/arch_sigreturn.c b/linux/x86_64/arch_sigreturn.c new file mode 100644 index 00000000..060b93a7 --- /dev/null +++ b/linux/x86_64/arch_sigreturn.c @@ -0,0 +1,32 @@ +#define arch_sigreturn i386_arch_sigreturn +#include "i386/arch_sigreturn.c" +#undef arch_sigreturn + +static void +arch_sigreturn(struct tcb *tcp) +{ + if (current_personality == 1) { + i386_arch_sigreturn(tcp); + return; + } + + typedef struct { + uint32_t flags, link, stack[3], pad; + struct sigcontext mcontext; + } ucontext_x32_header; + +#define X86_64_SIGMASK_OFFSET offsetof(struct ucontext, uc_sigmask) +#define X32_SIGMASK_OFFSET sizeof(ucontext_x32_header) + + const kernel_ulong_t offset = +#ifdef X32 + X32_SIGMASK_OFFSET; +#else + current_personality == 2 ? X32_SIGMASK_OFFSET : + X86_64_SIGMASK_OFFSET; +#endif + const kernel_ulong_t addr = (kernel_ulong_t) *x86_64_rsp_ptr + offset; + tprints("{mask="); + print_sigset_addr_len(tcp, addr, NSIG_BYTES); + tprints("}"); +} diff --git a/linux/x86_64/asm_stat.h b/linux/x86_64/asm_stat.h new file mode 100644 index 00000000..a563f087 --- /dev/null +++ b/linux/x86_64/asm_stat.h @@ -0,0 +1,39 @@ +#ifndef STRACE_X86_64_ASM_STAT_H +#define STRACE_X86_64_ASM_STAT_H + +# if defined __x86_64__ && defined __ILP32__ +# define stat redirect_kernel_stat +# endif + +# include "linux/asm_stat.h" + +# if defined __x86_64__ && defined __ILP32__ +# undef stat +/* + * This is a replacement for x32 which + * appears to be wrong in older kernel headers. + */ +struct stat { + kernel_ulong_t st_dev; + kernel_ulong_t st_ino; + kernel_ulong_t st_nlink; + unsigned int st_mode; + unsigned int st_uid; + unsigned int st_gid; + unsigned int pad0__; + kernel_ulong_t st_rdev; + kernel_long_t st_size; + kernel_long_t st_blksize; + kernel_long_t st_blocks; + kernel_ulong_t st_atime; + kernel_ulong_t st_atime_nsec; + kernel_ulong_t st_mtime; + kernel_ulong_t st_mtime_nsec; + kernel_ulong_t st_ctime; + kernel_ulong_t st_ctime_nsec; + kernel_long_t pad1__[3]; +}; + +# endif /* __x86_64__ && __ILP32__ */ + +#endif /* !STRACE_X86_64_ASM_STAT_H */ diff --git a/linux/x86_64/errnoent1.h b/linux/x86_64/errnoent1.h index de1136cd..d32435af 100644 --- a/linux/x86_64/errnoent1.h +++ b/linux/x86_64/errnoent1.h @@ -1,2 +1,2 @@ /* i386 personality */ -#include "../errnoent.h" +#include "errnoent.h" diff --git a/linux/x86_64/errnoent2.h b/linux/x86_64/errnoent2.h index 0630919d..2192ec8d 100644 --- a/linux/x86_64/errnoent2.h +++ b/linux/x86_64/errnoent2.h @@ -1,2 +1,2 @@ /* x32 personality */ -#include "../errnoent.h" +#include "errnoent.h" diff --git a/linux/x86_64/get_error.c b/linux/x86_64/get_error.c new file mode 100644 index 00000000..9411625b --- /dev/null +++ b/linux/x86_64/get_error.c @@ -0,0 +1,23 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + /* + * In X32, return value is 64-bit (llseek uses one). + * Using merely "long rax" would not work. + */ + long long rax; + + if (x86_io.iov_len == sizeof(i386_regs)) { + /* Sign extend from 32 bits */ + rax = (int32_t) i386_regs.eax; + } else { + rax = x86_64_regs.rax; + } + + if (check_errno && is_negated_errno(rax)) { + tcp->u_rval = -1; + tcp->u_error = -rax; + } else { + tcp->u_rval = rax; + } +} diff --git a/linux/x86_64/get_scno.c b/linux/x86_64/get_scno.c new file mode 100644 index 00000000..b8c31948 --- /dev/null +++ b/linux/x86_64/get_scno.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2002 Andi Kleen + * Copyright (c) 2002 Michal Ludvig + * Copyright (c) 2002 Roland McGrath + * Copyright (c) 2008-2013 Denys Vlasenko + * Copyright (c) 2012 H.J. Lu + * Copyright (c) 2010-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef X86_64 +# define X32_PERSONALITY_NUMBER 2 +#else +# define X32_PERSONALITY_NUMBER 0 +#endif + +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + kernel_ulong_t scno = 0; + unsigned int currpers; + +#ifndef __X32_SYSCALL_BIT +# define __X32_SYSCALL_BIT 0x40000000 +#endif + +#if 1 + /* + * GETREGSET of NT_PRSTATUS tells us regset size, + * which unambiguously detects i386. + * + * Linux kernel distinguishes x86-64 and x32 processes + * solely by looking at __X32_SYSCALL_BIT: + * arch/x86/include/asm/compat.h::is_x32_task(): + * if (task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT) + * return true; + */ + if (x86_io.iov_len == sizeof(i386_regs)) { + scno = i386_regs.orig_eax; + currpers = 1; + } else { + scno = x86_64_regs.orig_rax; + currpers = 0; + if (scno & __X32_SYSCALL_BIT) { + /* + * Syscall number -1 requires special treatment: + * it might be a side effect of SECCOMP_RET_ERRNO + * filtering that sets orig_rax to -1 + * in some versions of linux kernel. + * If that is the case, then + * __X32_SYSCALL_BIT logic does not apply. + */ + if ((long long) x86_64_regs.orig_rax != -1) { + scno -= __X32_SYSCALL_BIT; + currpers = 2; + } else { +# ifdef X32 + currpers = 2; +# endif + } + } + } + +#elif 0 + /* + * cs = 0x33 for long mode (native 64 bit and x32) + * cs = 0x23 for compatibility mode (32 bit) + * ds = 0x2b for x32 mode (x86-64 in 32 bit) + */ + scno = x86_64_regs.orig_rax; + switch (x86_64_regs.cs) { + case 0x23: currpers = 1; break; + case 0x33: + if (x86_64_regs.ds == 0x2b) { + currpers = 2; + scno &= ~__X32_SYSCALL_BIT; + } else + currpers = 0; + break; + default: + error_msg("Unknown value CS=0x%08X while " + "detecting personality of process PID=%d", + (int)x86_64_regs.cs, tcp->pid); + currpers = current_personality; + break; + } +#elif 0 + /* + * This version analyzes the opcode of a syscall instruction. + * (int 0x80 on i386 vs. syscall on x86-64) + * It works, but is too complicated, and strictly speaking, unreliable. + */ + unsigned long call, rip = x86_64_regs.rip; + /* sizeof(syscall) == sizeof(int 0x80) == 2 */ + rip -= 2; + errno = 0; + call = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)rip, (char *)0); + if (errno) + perror_msg("ptrace_peektext failed"); + switch (call & 0xffff) { + /* x86-64: syscall = 0x0f 0x05 */ + case 0x050f: currpers = 0; break; + /* i386: int 0x80 = 0xcd 0x80 */ + case 0x80cd: currpers = 1; break; + default: + currpers = current_personality; + error_msg("Unknown syscall opcode (0x%04X) while " + "detecting personality of process PID=%d", + (int)call, tcp->pid); + break; + } +#endif + +#ifdef X32 + /* + * If we are built for a x32 system, then personality 0 is x32 + * (not x86_64), and stracing of x86_64 apps is not supported. + * Stracing of i386 apps is still supported. + */ + if (currpers == 0) { + error_msg("syscall_%" PRI_klu "(...) in unsupported " + "64-bit mode of process PID=%d", scno, tcp->pid); + return 0; + } + currpers &= ~2; /* map 2,1 to 0,1 */ +#endif /* X32 */ + + update_personality(tcp, currpers); + tcp->scno = scno; + return 1; +} diff --git a/linux/x86_64/get_syscall_args.c b/linux/x86_64/get_syscall_args.c new file mode 100644 index 00000000..f285ac32 --- /dev/null +++ b/linux/x86_64/get_syscall_args.c @@ -0,0 +1,43 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + if (x86_io.iov_len != sizeof(i386_regs)) { + /* x86-64 or x32 ABI */ + if (tcp->s_ent->sys_flags & COMPAT_SYSCALL_TYPES) { + /* + * X32 compat syscall: zero-extend from 32 bits. + * Use truncate_klong_to_current_wordsize(tcp->u_arg[N]) + * in syscall handlers + * if you need to use *sign-extended* parameter. + */ + tcp->u_arg[0] = (uint32_t) x86_64_regs.rdi; + tcp->u_arg[1] = (uint32_t) x86_64_regs.rsi; + tcp->u_arg[2] = (uint32_t) x86_64_regs.rdx; + tcp->u_arg[3] = (uint32_t) x86_64_regs.r10; + tcp->u_arg[4] = (uint32_t) x86_64_regs.r8; + tcp->u_arg[5] = (uint32_t) x86_64_regs.r9; + } else { + tcp->u_arg[0] = x86_64_regs.rdi; + tcp->u_arg[1] = x86_64_regs.rsi; + tcp->u_arg[2] = x86_64_regs.rdx; + tcp->u_arg[3] = x86_64_regs.r10; + tcp->u_arg[4] = x86_64_regs.r8; + tcp->u_arg[5] = x86_64_regs.r9; + } + } else { + /* + * i386 ABI: zero-extend from 32 bits. + * Use truncate_klong_to_current_wordsize(tcp->u_arg[N]) + * in syscall handlers + * if you need to use *sign-extended* parameter. + */ + tcp->u_arg[0] = (uint32_t) i386_regs.ebx; + tcp->u_arg[1] = (uint32_t) i386_regs.ecx; + tcp->u_arg[2] = (uint32_t) i386_regs.edx; + tcp->u_arg[3] = (uint32_t) i386_regs.esi; + tcp->u_arg[4] = (uint32_t) i386_regs.edi; + tcp->u_arg[5] = (uint32_t) i386_regs.ebp; + } + return 1; +} diff --git a/linux/x86_64/getregs_old.c b/linux/x86_64/getregs_old.c new file mode 100644 index 00000000..9f7c2489 --- /dev/null +++ b/linux/x86_64/getregs_old.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2013 Denys Vlasenko + * Copyright (c) 2013-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * PTRACE_GETREGSET was added to the kernel in v2.6.25, + * a PTRACE_GETREGS based fallback is provided for old kernels. + */ +static int +getregs_old(pid_t pid) +{ + /* Use old method, with unreliable heuristical detection of 32-bitness. */ + long r = ptrace(PTRACE_GETREGS, pid, NULL, &x86_64_regs); + if (r) + return r; + + if (x86_64_regs.cs == 0x23) { + x86_io.iov_len = sizeof(i386_regs); + /* + * The order is important: i386_regs and x86_64_regs + * are overlaid in memory! + */ + i386_regs.ebx = x86_64_regs.rbx; + i386_regs.ecx = x86_64_regs.rcx; + i386_regs.edx = x86_64_regs.rdx; + i386_regs.esi = x86_64_regs.rsi; + i386_regs.edi = x86_64_regs.rdi; + i386_regs.ebp = x86_64_regs.rbp; + i386_regs.eax = x86_64_regs.rax; + /* i386_regs.xds = x86_64_regs.ds; unused by strace */ + /* i386_regs.xes = x86_64_regs.es; ditto... */ + /* i386_regs.xfs = x86_64_regs.fs; */ + /* i386_regs.xgs = x86_64_regs.gs; */ + i386_regs.orig_eax = x86_64_regs.orig_rax; + i386_regs.eip = x86_64_regs.rip; + /* i386_regs.xcs = x86_64_regs.cs; */ + /* i386_regs.eflags = x86_64_regs.eflags; */ + i386_regs.esp = x86_64_regs.rsp; + /* i386_regs.xss = x86_64_regs.ss; */ + } else { + x86_io.iov_len = sizeof(x86_64_regs); + } + return 0; +} diff --git a/linux/x86_64/getregs_old.h b/linux/x86_64/getregs_old.h new file mode 100644 index 00000000..80303016 --- /dev/null +++ b/linux/x86_64/getregs_old.h @@ -0,0 +1,2 @@ +#define HAVE_GETREGS_OLD +static int getregs_old(pid_t); diff --git a/linux/x86_64/ioctlent.h.in b/linux/x86_64/ioctlent.h.in deleted file mode 100644 index 52ac99ba..00000000 --- a/linux/x86_64/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/ioctlent.h.in" diff --git a/linux/x86_64/ioctlent1.h b/linux/x86_64/ioctlent1.h deleted file mode 100644 index 47506717..00000000 --- a/linux/x86_64/ioctlent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* i386 personality */ -#include "ioctlent.h" diff --git a/linux/x86_64/ioctlent2.h b/linux/x86_64/ioctlent2.h deleted file mode 100644 index fd4b94dd..00000000 --- a/linux/x86_64/ioctlent2.h +++ /dev/null @@ -1,2 +0,0 @@ -/* x32 personality */ -#include "ioctlent.h" diff --git a/linux/x86_64/ioctls_arch0.h b/linux/x86_64/ioctls_arch0.h new file mode 100644 index 00000000..d13cb463 --- /dev/null +++ b/linux/x86_64/ioctls_arch0.h @@ -0,0 +1,126 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/x86/include/ tree. */ +{ "asm/mce.h", "MCE_GETCLEAR_FLAGS", _IOC_READ, 0x4d03, 0x04 }, +{ "asm/mce.h", "MCE_GET_LOG_LEN", _IOC_READ, 0x4d02, 0x04 }, +{ "asm/mce.h", "MCE_GET_RECORD_LEN", _IOC_READ, 0x4d01, 0x04 }, +{ "asm/msr.h", "X86_IOC_RDMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a0, 0x20 }, +{ "asm/msr.h", "X86_IOC_WRMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a1, 0x20 }, +{ "asm/mtrr.h", "MTRRIOC_ADD_ENTRY", _IOC_WRITE, 0x4d00, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_ADD_PAGE_ENTRY", _IOC_WRITE, 0x4d05, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_DEL_ENTRY", _IOC_WRITE, 0x4d02, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_DEL_PAGE_ENTRY", _IOC_WRITE, 0x4d07, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_GET_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d03, 0x18 }, +{ "asm/mtrr.h", "MTRRIOC_GET_PAGE_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d08, 0x18 }, +{ "asm/mtrr.h", "MTRRIOC_KILL_ENTRY", _IOC_WRITE, 0x4d04, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", _IOC_WRITE, 0x4d09, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_SET_ENTRY", _IOC_WRITE, 0x4d01, 0x10 }, +{ "asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", _IOC_WRITE, 0x4d06, 0x10 }, +{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_CPUID2", _IOC_READ|_IOC_WRITE, 0xae91, 0x08 }, +{ "linux/kvm.h", "KVM_GET_DEBUGREGS", _IOC_READ, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_EMULATED_CPUID", _IOC_READ|_IOC_WRITE, 0xae09, 0x08 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x1a0 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_LAPIC", _IOC_READ, 0xae8e, 0x400 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 }, +{ "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 }, +{ "linux/kvm.h", "KVM_GET_PIT2", _IOC_READ, 0xae9f, 0x70 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x90 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x138 }, +{ "linux/kvm.h", "KVM_GET_SUPPORTED_CPUID", _IOC_READ|_IOC_WRITE, 0xae05, 0x08 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_EVENTS", _IOC_READ, 0xae9f, 0x40 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_GET_XCRS", _IOC_READ, 0xaea6, 0x188 }, +{ "linux/kvm.h", "KVM_GET_XSAVE", _IOC_READ, 0xaea4, 0x1000 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, +{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, +{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, +{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, +{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, +{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, +{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, +{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, +{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, +{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x08 }, +{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, +{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, +{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x08 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_CPUID", _IOC_WRITE, 0xae8a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_CPUID2", _IOC_WRITE, 0xae90, 0x08 }, +{ "linux/kvm.h", "KVM_SET_DEBUGREGS", _IOC_WRITE, 0xaea2, 0x80 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x1a0 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x48 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_LAPIC", _IOC_WRITE, 0xae8f, 0x400 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_ALIAS", _IOC_WRITE, 0xae43, 0x20 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 }, +{ "linux/kvm.h", "KVM_SET_PIT2", _IOC_WRITE, 0xaea0, 0x70 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x90 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x138 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SET_VCPU_EVENTS", _IOC_WRITE, 0xaea0, 0x40 }, +{ "linux/kvm.h", "KVM_SET_XCRS", _IOC_WRITE, 0xaea7, 0x188 }, +{ "linux/kvm.h", "KVM_SET_XSAVE", _IOC_WRITE, 0xaea5, 0x1000 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, +{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, +{ "linux/kvm.h", "KVM_X86_SET_MCE", _IOC_WRITE, 0xae9e, 0x40 }, +{ "linux/kvm.h", "KVM_XEN_HVM_CONFIG", _IOC_WRITE, 0xae7a, 0x38 }, diff --git a/linux/x86_64/ioctls_arch1.h b/linux/x86_64/ioctls_arch1.h new file mode 100644 index 00000000..58a57064 --- /dev/null +++ b/linux/x86_64/ioctls_arch1.h @@ -0,0 +1 @@ +#include "i386/ioctls_arch0.h" diff --git a/linux/x86_64/ioctls_arch2.h b/linux/x86_64/ioctls_arch2.h new file mode 100644 index 00000000..41d00f92 --- /dev/null +++ b/linux/x86_64/ioctls_arch2.h @@ -0,0 +1 @@ +#include "ioctls_arch0.h" diff --git a/linux/x86_64/ioctls_inc0.h b/linux/x86_64/ioctls_inc0.h new file mode 100644 index 00000000..f9939faa --- /dev/null +++ b/linux/x86_64/ioctls_inc0.h @@ -0,0 +1 @@ +#include "64/ioctls_inc.h" diff --git a/linux/x86_64/ioctls_inc1.h b/linux/x86_64/ioctls_inc1.h new file mode 100644 index 00000000..c9fcdf8f --- /dev/null +++ b/linux/x86_64/ioctls_inc1.h @@ -0,0 +1 @@ +#include "i386/ioctls_inc0.h" diff --git a/linux/x86_64/ioctls_inc2.h b/linux/x86_64/ioctls_inc2.h new file mode 100644 index 00000000..97496644 --- /dev/null +++ b/linux/x86_64/ioctls_inc2.h @@ -0,0 +1 @@ +#include "x32/ioctls_inc0.h" diff --git a/linux/x86_64/set_error.c b/linux/x86_64/set_error.c new file mode 100644 index 00000000..123c8951 --- /dev/null +++ b/linux/x86_64/set_error.c @@ -0,0 +1,37 @@ +#ifndef HAVE_GETREGS_OLD +# define arch_set_error i386_set_error +# define arch_set_success i386_set_success +# include "i386/set_error.c" +# undef arch_set_success +# undef arch_set_error +#endif /* !HAVE_GETREGS_OLD */ + +static int +arch_set_error(struct tcb *tcp) +{ +#ifdef HAVE_GETREGS_OLD + x86_64_regs.rax = - (long long) tcp->u_error; + return upoke(tcp->pid, 8 * RAX, x86_64_regs.rax); +#else + if (x86_io.iov_len == sizeof(i386_regs)) + return i386_set_error(tcp); + + x86_64_regs.rax = - (long long) tcp->u_error; + return set_regs(tcp->pid); +#endif +} + +static int +arch_set_success(struct tcb *tcp) +{ +#ifdef HAVE_GETREGS_OLD + x86_64_regs.rax = (long long) tcp->u_rval; + return upoke(tcp->pid, 8 * RAX, x86_64_regs.rax); +#else + if (x86_io.iov_len == sizeof(i386_regs)) + return i386_set_success(tcp); + + x86_64_regs.rax = (long long) tcp->u_rval; + return set_regs(tcp->pid); +#endif +} diff --git a/linux/x86_64/set_scno.c b/linux/x86_64/set_scno.c new file mode 100644 index 00000000..6438c526 --- /dev/null +++ b/linux/x86_64/set_scno.c @@ -0,0 +1,19 @@ +#ifndef HAVE_GETREGS_OLD +# define arch_set_scno i386_set_scno +# include "i386/set_scno.c" +# undef arch_set_scno +#endif /* !HAVE_GETREGS_OLD */ + +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ +#ifdef HAVE_GETREGS_OLD + return upoke(tcp->pid, 8 * ORIG_RAX, scno); +#else + if (x86_io.iov_len == sizeof(i386_regs)) + return i386_set_scno(tcp, scno); + + x86_64_regs.orig_rax = scno; + return set_regs(tcp->pid); +#endif +} diff --git a/linux/x86_64/signalent1.h b/linux/x86_64/signalent1.h index c927d729..fdae15fc 100644 --- a/linux/x86_64/signalent1.h +++ b/linux/x86_64/signalent1.h @@ -1,2 +1,2 @@ /* i386 personality */ -#include "../signalent.h" +#include "signalent.h" diff --git a/linux/x86_64/signalent2.h b/linux/x86_64/signalent2.h index c8f6824f..6b32d62f 100644 --- a/linux/x86_64/signalent2.h +++ b/linux/x86_64/signalent2.h @@ -1,2 +1,2 @@ /* x32 personality */ -#include "../signalent.h" +#include "signalent.h" diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h index ed0f4fb9..fcabde74 100644 --- a/linux/x86_64/syscallent.h +++ b/linux/x86_64/syscallent.h @@ -1,317 +1,332 @@ - { 3, TD, sys_read, "read" }, /* 0 */ - { 3, TD, sys_write, "write" }, /* 1 */ - { 3, TD|TF, sys_open, "open" }, /* 2 */ - { 1, TD, sys_close, "close" }, /* 3 */ - { 2, TF, sys_stat, "stat" }, /* 4 */ - { 2, TD, sys_fstat, "fstat" }, /* 5 */ - { 2, TF, sys_lstat, "lstat" }, /* 6 */ - { 3, TD, sys_poll, "poll" }, /* 7 */ - { 3, TD, sys_lseek, "lseek" }, /* 8 */ - { 6, TD|TM|SI, sys_mmap, "mmap" }, /* 9 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 10 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 11 */ - { 1, TM|SI, sys_brk, "brk" }, /* 12 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 13 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 14 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 15 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 16 */ - { 4, TD, sys_pread, "pread" }, /* 17 */ - { 4, TD, sys_pwrite, "pwrite" }, /* 18 */ - { 3, TD, sys_readv, "readv" }, /* 19 */ - { 3, TD, sys_writev, "writev" }, /* 20 */ - { 2, TF, sys_access, "access" }, /* 21 */ - { 1, TD, sys_pipe, "pipe" }, /* 22 */ - { 5, TD, sys_select, "select" }, /* 23 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 24 */ - { 5, TM|SI, sys_mremap, "mremap" }, /* 25 */ - { 3, TM, sys_msync, "msync" }, /* 26 */ - { 3, TM, sys_mincore, "mincore" }, /* 27 */ - { 3, TM, sys_madvise, "madvise" }, /* 28 */ - { 4, TI, sys_shmget, "shmget" }, /* 29 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 30 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 31 */ - { 1, TD, sys_dup, "dup" }, /* 32 */ - { 2, TD, sys_dup2, "dup2" }, /* 33 */ - { 0, TS, sys_pause, "pause" }, /* 34 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 35 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 36 */ - { 1, 0, sys_alarm, "alarm" }, /* 37 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 38 */ - { 0, 0, sys_getpid, "getpid" }, /* 39 */ - { 4, TD|TN, sys_sendfile64, "sendfile" }, /* 40 */ - { 3, TN, sys_socket, "socket" }, /* 41 */ - { 3, TN, sys_connect, "connect" }, /* 42 */ - { 3, TN, sys_accept, "accept" }, /* 43 */ - { 6, TN, sys_sendto, "sendto" }, /* 44 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 45 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 46 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 47 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 48 */ - { 3, TN, sys_bind, "bind" }, /* 49 */ - { 2, TN, sys_listen, "listen" }, /* 50 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 51 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 52 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 53 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 54 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 55 */ - { 5, TP, sys_clone, "clone" }, /* 56 */ - { 0, TP, sys_fork, "fork" }, /* 57 */ - { 0, TP, sys_vfork, "vfork" }, /* 58 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 59 */ - { 1, TP|SE, sys_exit, "_exit" }, /* 60 */ - { 4, TP, sys_wait4, "wait4" }, /* 61 */ - { 2, TS, sys_kill, "kill" }, /* 62 */ - { 1, 0, sys_uname, "uname" }, /* 63 */ - { 4, TI, sys_semget, "semget" }, /* 64 */ - { 4, TI, sys_semop, "semop" }, /* 65 */ - { 4, TI, sys_semctl, "semctl" }, /* 66 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 67 */ - { 4, TI, sys_msgget, "msgget" }, /* 68 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 69 */ - { 5, TI, sys_msgrcv, "msgrcv" }, /* 70 */ - { 3, TI, sys_msgctl, "msgctl" }, /* 71 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 72 */ - { 2, TD, sys_flock, "flock" }, /* 73 */ - { 1, TD, sys_fsync, "fsync" }, /* 74 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 75 */ - { 2, TF, sys_truncate, "truncate" }, /* 76 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 77 */ - { 3, TD, sys_getdents, "getdents" }, /* 78 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 79 */ - { 1, TF, sys_chdir, "chdir" }, /* 80 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 81 */ - { 2, TF, sys_rename, "rename" }, /* 82 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 83 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 84 */ - { 2, TD|TF, sys_creat, "creat" }, /* 85 */ - { 2, TF, sys_link, "link" }, /* 86 */ - { 1, TF, sys_unlink, "unlink" }, /* 87 */ - { 2, TF, sys_symlink, "symlink" }, /* 88 */ - { 3, TF, sys_readlink, "readlink" }, /* 89 */ - { 2, TF, sys_chmod, "chmod" }, /* 90 */ - { 2, TD, sys_fchmod, "fchmod" }, /* 91 */ - { 3, TF, sys_chown, "chown" }, /* 92 */ - { 3, TD, sys_fchown, "fchown" }, /* 93 */ - { 3, TF, sys_chown, "lchown" }, /* 94 */ - { 1, 0, sys_umask, "umask" }, /* 95 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 96 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 97 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 98 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 99 */ - { 1, 0, sys_times, "times" }, /* 100 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 101 */ - { 0, NF, sys_getuid, "getuid" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 0, NF, sys_getgid, "getgid" }, /* 104 */ - { 1, 0, sys_setuid, "setuid" }, /* 105 */ - { 1, 0, sys_setgid, "setgid" }, /* 106 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 107 */ - { 0, NF, sys_getegid, "getegid" }, /* 108 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 109 */ - { 0, 0, sys_getppid, "getppid" }, /* 110 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 111 */ - { 0, 0, sys_setsid, "setsid" }, /* 112 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 113 */ - { 2, 0, sys_setregid, "setregid" }, /* 114 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 115 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 116 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 117 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 118 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 119 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 120 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 121 */ - { 1, NF, sys_setfsuid, "setfsuid" }, /* 122 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 123 */ - { 1, 0, sys_getsid, "getsid" }, /* 124 */ - { 2, 0, sys_capget, "capget" }, /* 125 */ - { 2, 0, sys_capset, "capset" }, /* 126 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 127 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait" }, /* 128 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo" }, /* 129 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 130 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 131 */ - { 2, TF, sys_utime, "utime" }, /* 132 */ - { 3, TF, sys_mknod, "mknod" }, /* 133 */ - { 1, TF, sys_uselib, "uselib" }, /* 134 */ - { 1, 0, sys_personality, "personality" }, /* 135 */ - { 2, 0, sys_ustat, "ustat" }, /* 136 */ - { 2, TF, sys_statfs, "statfs" }, /* 137 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 138 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 139 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 140 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 141 */ - { 0, 0, sys_sched_setparam, "sched_setparam" }, /* 142 */ - { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 143 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 144 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 145 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max" }, /* 146 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min" }, /* 147 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval" }, /* 148 */ - { 2, TM, sys_mlock, "mlock" }, /* 149 */ - { 2, TM, sys_munlock, "munlock" }, /* 150 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 151 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 152 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 153 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 154 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 155 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 156 */ - { 5, 0, sys_prctl, "prctl" }, /* 157 */ - { 2, TP, sys_arch_prctl, "arch_prctl" }, /* 158 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 159 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 160 */ - { 1, TF, sys_chroot, "chroot" }, /* 161 */ - { 0, 0, sys_sync, "sync" }, /* 162 */ - { 1, TF, sys_acct, "acct" }, /* 163 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 164 */ - { 5, TF, sys_mount, "mount" }, /* 165 */ - { 2, TF, sys_umount2, "umount" }, /* 166 */ - { 2, TF, sys_swapon, "swapon" }, /* 167 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 168 */ - { 4, 0, sys_reboot, "reboot" }, /* 169 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 170 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 171 */ - { 1, 0, sys_iopl, "iopl" }, /* 172 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 173 */ - { 2, 0, sys_create_module, "create_module" }, /* 174 */ - { 3, 0, sys_init_module, "init_module" }, /* 175 */ - { 2, 0, sys_delete_module, "delete_module" }, /* 176 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 177 */ - { 5, 0, sys_query_module, "query_module" }, /* 178 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 179 */ - { 3, 0, sys_nfsservctl, "nfsservctl" }, /* 180 */ - { 5, 0, sys_getpmsg, "getpmsg" }, /* 181 */ - { 5, 0, sys_putpmsg, "putpmsg" }, /* 182 */ - { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 183 */ - { 3, 0, sys_tuxcall, "tuxcall" }, /* 184 */ - { 3, 0, sys_security, "security" }, /* 185 */ - { 0, 0, sys_gettid, "gettid" }, /* 186 */ - { 3, TD, sys_readahead, "readahead" }, /* 187 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 188 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 189 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 190 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 191 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 192 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 193 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 194 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 195 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 196 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 197 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 198 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 199 */ - { 2, TS, sys_kill, "tkill" }, /* 200 */ - { 1, 0, sys_time, "time" }, /* 201 */ - { 6, 0, sys_futex, "futex" }, /* 202 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 203 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 204 */ - { 1, 0, sys_set_thread_area, "set_thread_area" }, /* 205 */ - { 2, 0, sys_io_setup, "io_setup" }, /* 206 */ - { 1, 0, sys_io_destroy, "io_destroy" }, /* 207 */ - { 5, 0, sys_io_getevents, "io_getevents" }, /* 208 */ - { 3, 0, sys_io_submit, "io_submit" }, /* 209 */ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 210 */ - { 1, 0, sys_get_thread_area, "get_thread_area" }, /* 211 */ - { 3, 0, sys_lookup_dcookie, "lookup_dcookie"}, /* 212 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 213 */ - { 4, 0, printargs, "epoll_ctl_old" }, /* 214 */ - { 4, 0, printargs, "epoll_wait_old"}, /* 215 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 216 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 217 */ - { 1, 0, sys_set_tid_address, "set_tid_address"}, /* 218 */ - { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 219 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 220 */ - { 4, TD, sys_fadvise64, "fadvise64" }, /* 221 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 222 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 223 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 224 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 225 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 226 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 227 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 228 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 229 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 230 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 231 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 232 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 233 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 234 */ - { 2, TF, sys_utimes, "utimes" }, /* 235 */ - { 5, 0, sys_vserver, "vserver" }, /* 236 */ - { 6, TM, sys_mbind, "mbind" }, /* 237 */ - { 3, TM, sys_set_mempolicy, "set_mempolicy" }, /* 238 */ - { 5, TM, sys_get_mempolicy, "get_mempolicy" }, /* 239 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 240 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 241 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 242 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive" }, /* 243 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 244 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 245 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 246 */ - { 5, TP, sys_waitid, "waitid" }, /* 247 */ - { 5, 0, sys_add_key, "add_key" }, /* 248 */ - { 4, 0, sys_request_key, "request_key" }, /* 249 */ - { 5, 0, sys_keyctl, "keyctl" }, /* 250 */ - { 3, 0, sys_ioprio_set, "ioprio_set" }, /* 251 */ - { 2, 0, sys_ioprio_get, "ioprio_get" }, /* 252 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 253 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch" }, /* 254 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch" }, /* 255 */ - { 4, TM, sys_migrate_pages, "migrate_pages" }, /* 256 */ - { 4, TD|TF, sys_openat, "openat" }, /* 257 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 258 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 259 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 260 */ - { 3, TD|TF, sys_futimesat, "futimesat" }, /* 261 */ - { 4, TD|TF, sys_newfstatat, "newfstatat" }, /* 262 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 263 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 264 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 265 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 266 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 267 */ - { 3, TD|TF, sys_fchmodat, "fchmodat" }, /* 268 */ - { 3, TD|TF, sys_faccessat, "faccessat" }, /* 269 */ - { 6, TD, sys_pselect6, "pselect6" }, /* 270 */ - { 5, TD, sys_ppoll, "ppoll" }, /* 271 */ - { 1, TP, sys_unshare, "unshare" }, /* 272 */ - { 2, 0, sys_set_robust_list, "set_robust_list" }, /* 273 */ - { 3, 0, sys_get_robust_list, "get_robust_list" }, /* 274 */ - { 6, TD, sys_splice, "splice" }, /* 275 */ - { 4, TD, sys_tee, "tee" }, /* 276 */ - { 4, TD, sys_sync_file_range, "sync_file_range" }, /* 277 */ - { 4, TD, sys_vmsplice, "vmsplice" }, /* 278 */ - { 6, TM, sys_move_pages, "move_pages" }, /* 279 */ - { 4, TD|TF, sys_utimensat, "utimensat" }, /* 280 */ - { 6, TD, sys_epoll_pwait, "epoll_pwait" }, /* 281 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 282 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 283 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 284 */ - { 4, TD, sys_fallocate, "fallocate" }, /* 285 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 286 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 287 */ - { 4, TN, sys_accept4, "accept4" }, /* 288 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 289 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 290 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 291 */ - { 3, TD, sys_dup3, "dup3" }, /* 292 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 293 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 294 */ - { 4, TD, sys_preadv, "preadv" }, /* 295 */ - { 4, TD, sys_pwritev, "pwritev" }, /* 296 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 297 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 298 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 299 */ - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 300 */ - { 5, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 301 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 302 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 303 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 304 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 305 */ - { 1, TD, sys_syncfs, "syncfs" }, /* 306 */ - { 4, TN, sys_sendmmsg, "sendmmsg" }, /* 307 */ - { 2, TD, sys_setns, "setns" }, /* 308 */ - { 3, 0, sys_getcpu, "getcpu" }, /* 309 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv" }, /* 310 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev" }, /* 311 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 312 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 313 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 314 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 315 */ - { 5, TD|TF, sys_renameat2, "renameat2" }, /* 316 */ +[ 0] = { 3, TD, SEN(read), "read" }, +[ 1] = { 3, TD, SEN(write), "write" }, +[ 2] = { 3, TD|TF, SEN(open), "open" }, +[ 3] = { 1, TD, SEN(close), "close" }, +[ 4] = { 2, TF, SEN(stat), "stat" }, +[ 5] = { 2, TD, SEN(fstat), "fstat" }, +[ 6] = { 2, TF, SEN(lstat), "lstat" }, +[ 7] = { 3, TD, SEN(poll), "poll" }, +[ 8] = { 3, TD, SEN(lseek), "lseek" }, +[ 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[ 10] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[ 11] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 12] = { 1, TM|SI, SEN(brk), "brk" }, +[ 13] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[ 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[ 15] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[ 16] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 17] = { 4, TD, SEN(pread), "pread64" }, +[ 18] = { 4, TD, SEN(pwrite), "pwrite64" }, +[ 19] = { 3, TD, SEN(readv), "readv" }, +[ 20] = { 3, TD, SEN(writev), "writev" }, +[ 21] = { 2, TF, SEN(access), "access" }, +[ 22] = { 1, TD, SEN(pipe), "pipe" }, +[ 23] = { 5, TD, SEN(select), "select" }, +[ 24] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[ 25] = { 5, TM|SI, SEN(mremap), "mremap" }, +[ 26] = { 3, TM, SEN(msync), "msync" }, +[ 27] = { 3, TM, SEN(mincore), "mincore" }, +[ 28] = { 3, TM, SEN(madvise), "madvise" }, +[ 29] = { 3, TI, SEN(shmget), "shmget" }, +[ 30] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[ 31] = { 3, TI, SEN(shmctl), "shmctl" }, +[ 32] = { 1, TD, SEN(dup), "dup" }, +[ 33] = { 2, TD, SEN(dup2), "dup2" }, +[ 34] = { 0, TS, SEN(pause), "pause" }, +[ 35] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[ 36] = { 2, 0, SEN(getitimer), "getitimer" }, +[ 37] = { 1, 0, SEN(alarm), "alarm" }, +[ 38] = { 3, 0, SEN(setitimer), "setitimer" }, +[ 39] = { 0, NF, SEN(getpid), "getpid" }, +[ 40] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, +[ 41] = { 3, TN, SEN(socket), "socket" }, +[ 42] = { 3, TN, SEN(connect), "connect" }, +[ 43] = { 3, TN, SEN(accept), "accept" }, +[ 44] = { 6, TN, SEN(sendto), "sendto" }, +[ 45] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[ 46] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[ 47] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[ 48] = { 2, TN, SEN(shutdown), "shutdown" }, +[ 49] = { 3, TN, SEN(bind), "bind" }, +[ 50] = { 2, TN, SEN(listen), "listen" }, +[ 51] = { 3, TN, SEN(getsockname), "getsockname" }, +[ 52] = { 3, TN, SEN(getpeername), "getpeername" }, +[ 53] = { 4, TN, SEN(socketpair), "socketpair" }, +[ 54] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[ 55] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[ 56] = { 5, TP, SEN(clone), "clone" }, +[ 57] = { 0, TP, SEN(fork), "fork" }, +[ 58] = { 0, TP, SEN(vfork), "vfork" }, +[ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[ 60] = { 1, TP|SE, SEN(exit), "exit" }, +[ 61] = { 4, TP, SEN(wait4), "wait4" }, +[ 62] = { 2, TS, SEN(kill), "kill" }, +[ 63] = { 1, 0, SEN(uname), "uname" }, +[ 64] = { 3, TI, SEN(semget), "semget" }, +[ 65] = { 3, TI, SEN(semop), "semop" }, +[ 66] = { 4, TI, SEN(semctl), "semctl" }, +[ 67] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[ 68] = { 2, TI, SEN(msgget), "msgget" }, +[ 69] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[ 70] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[ 71] = { 3, TI, SEN(msgctl), "msgctl" }, +[ 72] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 73] = { 2, TD, SEN(flock), "flock" }, +[ 74] = { 1, TD, SEN(fsync), "fsync" }, +[ 75] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[ 76] = { 2, TF, SEN(truncate), "truncate" }, +[ 77] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 78] = { 3, TD, SEN(getdents), "getdents" }, +[ 79] = { 2, TF, SEN(getcwd), "getcwd" }, +[ 80] = { 1, TF, SEN(chdir), "chdir" }, +[ 81] = { 1, TD, SEN(fchdir), "fchdir" }, +[ 82] = { 2, TF, SEN(rename), "rename" }, +[ 83] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 84] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 85] = { 2, TD|TF, SEN(creat), "creat" }, +[ 86] = { 2, TF, SEN(link), "link" }, +[ 87] = { 1, TF, SEN(unlink), "unlink" }, +[ 88] = { 2, TF, SEN(symlink), "symlink" }, +[ 89] = { 3, TF, SEN(readlink), "readlink" }, +[ 90] = { 2, TF, SEN(chmod), "chmod" }, +[ 91] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 92] = { 3, TF, SEN(chown), "chown" }, +[ 93] = { 3, TD, SEN(fchown), "fchown" }, +[ 94] = { 3, TF, SEN(chown), "lchown" }, +[ 95] = { 1, NF, SEN(umask), "umask" }, +[ 96] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[ 97] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[ 98] = { 2, 0, SEN(getrusage), "getrusage" }, +[ 99] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[100] = { 1, 0, SEN(times), "times" }, +[101] = { 4, 0, SEN(ptrace), "ptrace" }, +[102] = { 0, NF, SEN(getuid), "getuid" }, +[103] = { 3, 0, SEN(syslog), "syslog" }, +[104] = { 0, NF, SEN(getgid), "getgid" }, +[105] = { 1, 0, SEN(setuid), "setuid" }, +[106] = { 1, 0, SEN(setgid), "setgid" }, +[107] = { 0, NF, SEN(geteuid), "geteuid" }, +[108] = { 0, NF, SEN(getegid), "getegid" }, +[109] = { 2, 0, SEN(setpgid), "setpgid" }, +[110] = { 0, NF, SEN(getppid), "getppid" }, +[111] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[112] = { 0, 0, SEN(setsid), "setsid" }, +[113] = { 2, 0, SEN(setreuid), "setreuid" }, +[114] = { 2, 0, SEN(setregid), "setregid" }, +[115] = { 2, 0, SEN(getgroups), "getgroups" }, +[116] = { 2, 0, SEN(setgroups), "setgroups" }, +[117] = { 3, 0, SEN(setresuid), "setresuid" }, +[118] = { 3, 0, SEN(getresuid), "getresuid" }, +[119] = { 3, 0, SEN(setresgid), "setresgid" }, +[120] = { 3, 0, SEN(getresgid), "getresgid" }, +[121] = { 1, 0, SEN(getpgid), "getpgid" }, +[122] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[123] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[124] = { 1, 0, SEN(getsid), "getsid" }, +[125] = { 2, 0, SEN(capget), "capget" }, +[126] = { 2, 0, SEN(capset), "capset" }, +[127] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[128] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[129] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[130] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[131] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[132] = { 2, TF, SEN(utime), "utime" }, +[133] = { 3, TF, SEN(mknod), "mknod" }, +[134] = { 1, TF, SEN(uselib), "uselib" }, +[135] = { 1, NF, SEN(personality), "personality" }, +[136] = { 2, 0, SEN(ustat), "ustat" }, +[137] = { 2, TF, SEN(statfs), "statfs" }, +[138] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[139] = { 3, 0, SEN(sysfs), "sysfs" }, +[140] = { 2, 0, SEN(getpriority), "getpriority" }, +[141] = { 3, 0, SEN(setpriority), "setpriority" }, +[142] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[143] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[144] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[145] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[146] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[147] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[148] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[149] = { 2, TM, SEN(mlock), "mlock" }, +[150] = { 2, TM, SEN(munlock), "munlock" }, +[151] = { 1, TM, SEN(mlockall), "mlockall" }, +[152] = { 0, TM, SEN(munlockall), "munlockall" }, +[153] = { 0, 0, SEN(vhangup), "vhangup" }, +[154] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, +[155] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[156] = { 1, 0, SEN(sysctl), "_sysctl" }, +[157] = { 5, 0, SEN(prctl), "prctl" }, +[158] = { 2, TP, SEN(arch_prctl), "arch_prctl" }, +[159] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[160] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[161] = { 1, TF, SEN(chroot), "chroot" }, +[162] = { 0, 0, SEN(sync), "sync" }, +[163] = { 1, TF, SEN(acct), "acct" }, +[164] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[165] = { 5, TF, SEN(mount), "mount" }, +[166] = { 2, TF, SEN(umount2), "umount2" }, +[167] = { 2, TF, SEN(swapon), "swapon" }, +[168] = { 1, TF, SEN(swapoff), "swapoff" }, +[169] = { 4, 0, SEN(reboot), "reboot" }, +[170] = { 2, 0, SEN(sethostname), "sethostname" }, +[171] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[172] = { 1, 0, SEN(iopl), "iopl" }, +[173] = { 3, 0, SEN(ioperm), "ioperm" }, +[174] = { 2, 0, SEN(create_module), "create_module" }, +[175] = { 3, 0, SEN(init_module), "init_module" }, +[176] = { 2, 0, SEN(delete_module), "delete_module" }, +[177] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[178] = { 5, 0, SEN(query_module), "query_module" }, +[179] = { 4, TF, SEN(quotactl), "quotactl" }, +[180] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[181] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[182] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[183] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[184] = { 3, 0, SEN(tuxcall), "tuxcall" }, +[185] = { 3, 0, SEN(security), "security" }, +[186] = { 0, NF, SEN(gettid), "gettid" }, +[187] = { 3, TD, SEN(readahead), "readahead" }, +[188] = { 5, TF, SEN(setxattr), "setxattr" }, +[189] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[190] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[191] = { 4, TF, SEN(getxattr), "getxattr" }, +[192] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[193] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[194] = { 3, TF, SEN(listxattr), "listxattr" }, +[195] = { 3, TF, SEN(listxattr), "llistxattr" }, +[196] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[197] = { 2, TF, SEN(removexattr), "removexattr" }, +[198] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[199] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[200] = { 2, TS, SEN(kill), "tkill" }, +[201] = { 1, 0, SEN(time), "time" }, +[202] = { 6, 0, SEN(futex), "futex" }, +[203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[205] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, +[206] = { 2, TM, SEN(io_setup), "io_setup" }, +[207] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[208] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[209] = { 3, 0, SEN(io_submit), "io_submit" }, +[210] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[211] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, +[212] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[213] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[214] = { 4, 0, SEN(printargs), "epoll_ctl_old" }, +[215] = { 4, 0, SEN(printargs), "epoll_wait_old" }, +[216] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[217] = { 3, TD, SEN(getdents64), "getdents64" }, +[218] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[219] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[220] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[221] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[222] = { 3, 0, SEN(timer_create), "timer_create" }, +[223] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[224] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[225] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[226] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[227] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[228] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[229] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[230] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[231] = { 1, TP|SE, SEN(exit), "exit_group" }, +[232] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[233] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[234] = { 3, TS, SEN(tgkill), "tgkill" }, +[235] = { 2, TF, SEN(utimes), "utimes" }, +[236] = { 5, 0, SEN(vserver), "vserver" }, +[237] = { 6, TM, SEN(mbind), "mbind" }, +[238] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[239] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[240] = { 4, 0, SEN(mq_open), "mq_open" }, +[241] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[242] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[243] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[244] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[245] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[246] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[247] = { 5, TP, SEN(waitid), "waitid" }, +[248] = { 5, 0, SEN(add_key), "add_key" }, +[249] = { 4, 0, SEN(request_key), "request_key" }, +[250] = { 5, 0, SEN(keyctl), "keyctl" }, +[251] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[252] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[253] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[254] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[256] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[257] = { 4, TD|TF, SEN(openat), "openat" }, +[258] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[259] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[260] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[261] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[262] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[264] = { 4, TD|TF, SEN(renameat), "renameat" }, +[265] = { 5, TD|TF, SEN(linkat), "linkat" }, +[266] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[269] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[270] = { 6, TD, SEN(pselect6), "pselect6" }, +[271] = { 5, TD, SEN(ppoll), "ppoll" }, +[272] = { 1, TP, SEN(unshare), "unshare" }, +[273] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[274] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[275] = { 6, TD, SEN(splice), "splice" }, +[276] = { 4, TD, SEN(tee), "tee" }, +[277] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[278] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[279] = { 6, TM, SEN(move_pages), "move_pages" }, +[280] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[282] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[283] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[284] = { 1, TD, SEN(eventfd), "eventfd" }, +[285] = { 4, TD, SEN(fallocate), "fallocate" }, +[286] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[287] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[288] = { 4, TN, SEN(accept4), "accept4" }, +[289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[290] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[291] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[292] = { 3, TD, SEN(dup3), "dup3" }, +[293] = { 2, TD, SEN(pipe2), "pipe2" }, +[294] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[295] = { 4, TD, SEN(preadv), "preadv" }, +[296] = { 4, TD, SEN(pwritev), "pwritev" }, +[297] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[298] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[299] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[300] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[302] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[305] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[306] = { 1, TD, SEN(syncfs), "syncfs" }, +[307] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[308] = { 2, TD, SEN(setns), "setns" }, +[309] = { 3, 0, SEN(getcpu), "getcpu" }, +[310] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[311] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[312] = { 5, 0, SEN(kcmp), "kcmp" }, +[313] = { 3, TD, SEN(finit_module), "finit_module" }, +[314] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[315] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[316] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[317] = { 3, 0, SEN(seccomp), "seccomp" }, +[318] = { 3, 0, SEN(getrandom), "getrandom" }, +[319] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[320] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[321] = { 3, TD, SEN(bpf), "bpf" }, +[322] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[323] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[324] = { 2, 0, SEN(membarrier), "membarrier" }, +[325] = { 3, TM, SEN(mlock2), "mlock2" }, +[326] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[327] = { 6, TD, SEN(preadv2), "preadv2" }, +[328] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[329] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[330] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[331] = { 1, 0, SEN(pkey_free), "pkey_free" }, diff --git a/linux/x86_64/userent.h b/linux/x86_64/userent.h new file mode 100644 index 00000000..c5c084eb --- /dev/null +++ b/linux/x86_64/userent.h @@ -0,0 +1,23 @@ +XLAT(8*R15), +XLAT(8*R14), +XLAT(8*R13), +XLAT(8*R12), +XLAT(8*RBP), +XLAT(8*RBX), +XLAT(8*R11), +XLAT(8*R10), +XLAT(8*R9), +XLAT(8*R8), +XLAT(8*RAX), +XLAT(8*RCX), +XLAT(8*RDX), +XLAT(8*RSI), +XLAT(8*RDI), +XLAT(8*ORIG_RAX), +XLAT(8*RIP), +XLAT(8*CS), +{ 8*EFLAGS, "8*EFL" }, +XLAT(8*RSP), +XLAT(8*SS), +/* Other fields in "struct user" */ +#include "../i386/userent0.h" diff --git a/linux/xtensa/arch_regs.c b/linux/xtensa/arch_regs.c new file mode 100644 index 00000000..67e5f010 --- /dev/null +++ b/linux/xtensa/arch_regs.c @@ -0,0 +1,2 @@ +static unsigned long xtensa_a2; +#define ARCH_PC_PEEK_ADDR REG_PC diff --git a/linux/xtensa/get_error.c b/linux/xtensa/get_error.c new file mode 100644 index 00000000..51ccd3b8 --- /dev/null +++ b/linux/xtensa/get_error.c @@ -0,0 +1,10 @@ +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(xtensa_a2)) { + tcp->u_rval = -1; + tcp->u_error = -xtensa_a2; + } else { + tcp->u_rval = xtensa_a2; + } +} diff --git a/linux/xtensa/get_scno.c b/linux/xtensa/get_scno.c new file mode 100644 index 00000000..d230f73b --- /dev/null +++ b/linux/xtensa/get_scno.c @@ -0,0 +1,6 @@ +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ + return upeek(tcp->pid, SYSCALL_NR, &tcp->scno) < 0 ? -1 : 1; +} diff --git a/linux/xtensa/get_syscall_args.c b/linux/xtensa/get_syscall_args.c new file mode 100644 index 00000000..a9c933a9 --- /dev/null +++ b/linux/xtensa/get_syscall_args.c @@ -0,0 +1,20 @@ +/* Return -1 on error or 1 on success (never 0!). */ +static int +get_syscall_args(struct tcb *tcp) +{ + /* arg0: a6, arg1: a3, arg2: a4, arg3: a5, arg4: a8, arg5: a9 */ + static const int xtensaregs[MAX_ARGS] = { + REG_A_BASE + 6, + REG_A_BASE + 3, + REG_A_BASE + 4, + REG_A_BASE + 5, + REG_A_BASE + 8, + REG_A_BASE + 9 + }; + unsigned int i; + + for (i = 0; i < tcp->s_ent->nargs; ++i) + if (upeek(tcp->pid, xtensaregs[i], &tcp->u_arg[i]) < 0) + return -1; + return 1; +} diff --git a/linux/xtensa/get_syscall_result.c b/linux/xtensa/get_syscall_result.c new file mode 100644 index 00000000..51ad6dea --- /dev/null +++ b/linux/xtensa/get_syscall_result.c @@ -0,0 +1,5 @@ +static int +get_syscall_result_regs(struct tcb *tcp) +{ + return upeek(tcp->pid, REG_A_BASE + 2, &xtensa_a2) < 0 ? -1 : 0; +} diff --git a/linux/xtensa/ioctlent.h.in b/linux/xtensa/ioctlent.h.in deleted file mode 100644 index a9eae81f..00000000 --- a/linux/xtensa/ioctlent.h.in +++ /dev/null @@ -1 +0,0 @@ -/* intentionally empty */ diff --git a/linux/xtensa/ioctls_arch0.h b/linux/xtensa/ioctls_arch0.h new file mode 100644 index 00000000..054048ac --- /dev/null +++ b/linux/xtensa/ioctls_arch0.h @@ -0,0 +1,69 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/xtensa/include/ tree. */ +{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, +{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, +{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, +{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, +{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, +{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, +{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 }, +{ "asm/ioctls.h", "TCGETS", 0, 0x5401, 0 }, +{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c }, +{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 }, +{ "asm/ioctls.h", "TCSBRKP", _IOC_WRITE, 0x5425, 0x04 }, +{ "asm/ioctls.h", "TCSETS", 0, 0x5402, 0 }, +{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c }, +{ "asm/ioctls.h", "TCSETSF", 0, 0x5404, 0 }, +{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c }, +{ "asm/ioctls.h", "TCSETSW", 0, 0x5403, 0 }, +{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c }, +{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 }, +{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x5428, 0x00 }, +{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x541d, 0x00 }, +{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x540c, 0x00 }, +{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, +{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x5424, 0x04 }, +{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, +{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, +{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, +{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, +{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5429, 0x04 }, +{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x5419, 0x04 }, +{ "asm/ioctls.h", "TIOCLINUX", _IOC_WRITE, 0x541c, 0x01 }, +{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x5417, 0x04 }, +{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x5416, 0x04 }, +{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x5415, 0x04 }, +{ "asm/ioctls.h", "TIOCMIWAIT", _IOC_NONE, 0x545c, 0x00 }, +{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x5418, 0x04 }, +{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x5422, 0x00 }, +{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x540d, 0x00 }, +{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, +{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x5420, 0x04 }, +{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x5427, 0x00 }, +{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x540e, 0x00 }, +{ "asm/ioctls.h", "TIOCSERCONFIG", _IOC_NONE, 0x5453, 0x00 }, +{ "asm/ioctls.h", "TIOCSERGETLSR", _IOC_READ, 0x5459, 0x04 }, +{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, +{ "asm/ioctls.h", "TIOCSERGWILD", _IOC_READ, 0x5454, 0x04 }, +{ "asm/ioctls.h", "TIOCSERSWILD", _IOC_WRITE, 0x5455, 0x04 }, +{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x5423, 0x04 }, +{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, +{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, +{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, +{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 }, +{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x541a, 0x04 }, +{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, +{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x5412, 0x01 }, +{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, +{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 }, +{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 }, +{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 }, +{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 }, +{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 }, +{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, +{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, +{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 }, diff --git a/linux/xtensa/ioctls_inc0.h b/linux/xtensa/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/xtensa/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/xtensa/set_error.c b/linux/xtensa/set_error.c new file mode 100644 index 00000000..4eb59171 --- /dev/null +++ b/linux/xtensa/set_error.c @@ -0,0 +1,13 @@ +static int +arch_set_error(struct tcb *tcp) +{ + xtensa_a2 = -tcp->u_error; + return upoke(tcp->pid, REG_A_BASE + 2, xtensa_a2); +} + +static int +arch_set_success(struct tcb *tcp) +{ + xtensa_a2 = tcp->u_rval; + return upoke(tcp->pid, REG_A_BASE + 2, xtensa_a2); +} diff --git a/linux/xtensa/set_scno.c b/linux/xtensa/set_scno.c new file mode 100644 index 00000000..54c948d3 --- /dev/null +++ b/linux/xtensa/set_scno.c @@ -0,0 +1,5 @@ +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + return upoke(tcp->pid, SYSCALL_NR, scno); +} diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h index 76e3bbf0..a130d6e0 100644 --- a/linux/xtensa/syscallent.h +++ b/linux/xtensa/syscallent.h @@ -1,328 +1,338 @@ - { 0, 0, printargs, "spill" }, /* 0 */ - { 0, 0, printargs, "xtensa" }, /* 1 */ - [2 ... 7] = { }, - { 3, TD|TF, sys_open, "open" }, /* 8 */ - { 1, TD, sys_close, "close" }, /* 9 */ - { 1, TD, sys_dup, "dup" }, /* 10 */ - { 2, TD, sys_dup2, "dup2" }, /* 11 */ - { 3, TD, sys_read, "read" }, /* 12 */ - { 3, TD, sys_write, "write" }, /* 13 */ - { 5, TD, sys_select, "select" }, /* 14 */ - { 3, TD, sys_lseek, "lseek" }, /* 15 */ - { 3, TD, sys_poll, "poll" }, /* 16 */ - { 5, TD, sys_llseek, "_llseek" }, /* 17 */ - { 4, TD, sys_epoll_wait, "epoll_wait" }, /* 18 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 19 */ - { 1, TD, sys_epoll_create, "epoll_create" }, /* 20 */ - { 2, TD|TF, sys_creat, "creat" }, /* 21 */ - { 2, TF, sys_truncate, "truncate" }, /* 22 */ - { 2, TD, sys_ftruncate, "ftruncate" }, /* 23 */ - { 3, TD, sys_readv, "readv" }, /* 24 */ - { 3, TD, sys_writev, "writev" }, /* 25 */ - { 1, TD, sys_fsync, "fsync" }, /* 26 */ - { 1, TD, sys_fdatasync, "fdatasync" }, /* 27 */ - { 4, TF, sys_truncate64, "truncate64" }, /* 28 */ - { 4, TD, sys_ftruncate64, "ftruncate64" }, /* 29 */ - { 6, TD, sys_pread, "pread64" }, /* 30 */ - { 6, TD, sys_pwrite, "pwrite64" }, /* 31 */ - { 2, TF, sys_link, "link" }, /* 32 */ - { 2, TF, sys_rename, "rename" }, /* 33 */ - { 2, TF, sys_symlink, "symlink" }, /* 34 */ - { 3, TF, sys_readlink, "readlink" }, /* 35 */ - { 3, TF, sys_mknod, "mknod" }, /* 36 */ - { 1, TD, sys_pipe, "pipe" }, /* 37 */ - { 1, TF, sys_unlink, "unlink" }, /* 38 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 39 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 40 */ - { 1, TF, sys_chdir, "chdir" }, /* 41 */ - { 1, TD, sys_fchdir, "fchdir" }, /* 42 */ - { 2, TF, sys_getcwd, "getcwd" }, /* 43 */ - { 2, TF, sys_chmod, "chmod" }, /* 44 */ - { 3, TF, sys_chown, "chown" }, /* 45 */ - { 2, TF, sys_stat, "stat" }, /* 46 */ - { 2, TF, sys_stat64, "stat64" }, /* 47 */ - { 3, TF, sys_chown, "lchown" }, /* 48 */ - { 2, TF, sys_lstat, "lstat" }, /* 49 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 50 */ - [51] = { }, - { 2, TD, sys_fchmod, "fchmod" }, /* 52 */ - { 3, TD, sys_fchown, "fchown" }, /* 53 */ - { 2, TD, sys_fstat, "fstat" }, /* 54 */ - { 2, TD, sys_fstat64, "fstat64" }, /* 55 */ - { 2, TD, sys_flock, "flock" }, /* 56 */ - { 2, TF, sys_access, "access" }, /* 57 */ - { 1, 0, sys_umask, "umask" }, /* 58 */ - { 3, TD, sys_getdents, "getdents" }, /* 59 */ - { 3, TD, sys_getdents64, "getdents64" }, /* 60 */ - { 3, TD, sys_fcntl, "fcntl64" }, /* 61 */ - { 6, TD, sys_fallocate, "fallocate" }, /* 62 */ - { 6, TD, sys_fadvise64_64, "fadvise64_64" }, /* 63 */ - { 2, TF, sys_utime, "utime" }, /* 64 */ - { 2, TF, sys_utimes, "utimes" }, /* 65 */ - { 3, TD, sys_ioctl, "ioctl" }, /* 66 */ - { 3, TD, sys_fcntl, "fcntl" }, /* 67 */ - { 5, TF, sys_setxattr, "setxattr" }, /* 68 */ - { 4, TF, sys_getxattr, "getxattr" }, /* 69 */ - { 3, TF, sys_listxattr, "listxattr" }, /* 70 */ - { 2, TF, sys_removexattr, "removexattr" }, /* 71 */ - { 5, TF, sys_setxattr, "lsetxattr" }, /* 72 */ - { 4, TF, sys_getxattr, "lgetxattr" }, /* 73 */ - { 3, TF, sys_listxattr, "llistxattr" }, /* 74 */ - { 2, TF, sys_removexattr, "lremovexattr" }, /* 75 */ - { 5, TD, sys_fsetxattr, "fsetxattr" }, /* 76 */ - { 4, TD, sys_fgetxattr, "fgetxattr" }, /* 77 */ - { 3, TD, sys_flistxattr, "flistxattr" }, /* 78 */ - { 2, TD, sys_fremovexattr, "fremovexattr" }, /* 79 */ - { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" }, /* 80 */ - { 2, TM|SI, sys_munmap, "munmap" }, /* 81 */ - { 3, TM|SI, sys_mprotect, "mprotect" }, /* 82 */ - { 1, TM|SI, sys_brk, "brk" }, /* 83 */ - { 2, TM, sys_mlock, "mlock" }, /* 84 */ - { 2, TM, sys_munlock, "munlock" }, /* 85 */ - { 1, TM, sys_mlockall, "mlockall" }, /* 86 */ - { 0, TM, sys_munlockall, "munlockall" }, /* 87 */ - { 4, TM|SI, sys_mremap, "mremap" }, /* 88 */ - { 3, TM, sys_msync, "msync" }, /* 89 */ - { 3, TM, sys_mincore, "mincore" }, /* 90 */ - { 3, TM, sys_madvise, "madvise" }, /* 91 */ - { 4, TI, sys_shmget, "shmget" }, /* 92 */ - { 4, TI|TM|SI, sys_shmat, "shmat" }, /* 93 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 94 */ - { 4, TI|TM|SI, sys_shmdt, "shmdt" }, /* 95 */ - { 3, TN, sys_socket, "socket" }, /* 96 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 97 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 98 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 99 */ - { 3, TN, sys_bind, "bind" }, /* 100 */ - { 3, TN, sys_connect, "connect" }, /* 101 */ - { 2, TN, sys_listen, "listen" }, /* 102 */ - { 3, TN, sys_accept, "accept" }, /* 103 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 104 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 105 */ - { 3, TN, sys_sendmsg, "sendmsg" }, /* 106 */ - { 3, TN, sys_recvmsg, "recvmsg" }, /* 107 */ - { 4, TN, sys_send, "send" }, /* 108 */ - { 4, TN, sys_recv, "recv" }, /* 109 */ - { 6, TN, sys_sendto, "sendto" }, /* 110 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 111 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 112 */ - { 4, TD|TN, sys_sendfile, "sendfile" }, /* 113 */ - { 4, TD|TN, sys_sendfile64, "sendfile64" }, /* 114 */ - { 4, TN, sys_sendmsg, "sendmsg" }, /* 115 */ - { 5, TP, sys_clone, "clone" }, /* 116 */ - { 3, TF|TP|SE|SI, sys_execve, "execve" }, /* 117 */ - { 1, TP|SE, sys_exit, "exit" }, /* 118 */ - { 1, TP|SE, sys_exit, "exit_group" }, /* 119 */ - { 0, 0, sys_getpid, "getpid" }, /* 120 */ - { 4, TP, sys_wait4, "wait4" }, /* 121 */ - { 5, TP, sys_waitid, "waitid" }, /* 122 */ - { 2, TS, sys_kill, "kill" }, /* 123 */ - { 2, TS, sys_kill, "tkill" }, /* 124 */ - { 3, TS, sys_tgkill, "tgkill" }, /* 125 */ - { 1, 0, printargs, "set_tid_address"}, /* 126 */ - { 0, 0, printargs, "gettid" }, /* 127 */ - { 0, 0, sys_setsid, "setsid" }, /* 128 */ - { 1, 0, sys_getsid, "getsid" }, /* 129 */ - { 5, 0, sys_prctl, "prctl" }, /* 130 */ - { 1, 0, sys_personality, "personality" }, /* 131 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 132 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 133 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 134 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 135 */ - { 1, 0, sys_setuid, "setuid" }, /* 136 */ - { 0, NF, sys_getuid, "getuid" }, /* 137 */ - { 1, 0, sys_setgid, "setgid" }, /* 138 */ - { 0, NF, sys_getgid, "getgid" }, /* 139 */ - { 0, NF, sys_geteuid, "geteuid" }, /* 140 */ - { 0, NF, sys_getegid, "getegid" }, /* 141 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 142 */ - { 2, 0, sys_setregid, "setregid" }, /* 143 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 144 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 145 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 146 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 147 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 148 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 149 */ - { 0, 0, sys_getppid, "getppid" }, /* 150 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 151 */ - [152 ... 153] = { }, - { 1, 0, sys_times, "times" }, /* 154 */ - { 1, TF, sys_acct, "acct" }, /* 155 */ - { 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 156 */ - { 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 157 */ - { 2, 0, sys_capget, "capget" }, /* 158 */ - { 2, 0, sys_capset, "capset" }, /* 159 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 160 */ - { 5, TI, sys_semtimedop, "semtimedop" }, /* 161 */ - { 4, TI, sys_semget, "semget" }, /* 162 */ - { 4, TI, sys_semop, "semop" }, /* 163 */ - { 4, TI, sys_semctl, "semctl" }, /* 164 */ - [165] = { }, - { 4, TI, sys_msgget, "msgget" }, /* 166 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 167 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 168 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 169 */ - [170] = { }, - { 2, TF, sys_umount2, "umount2" }, /* 171 */ - { 5, TF, sys_mount, "mount" }, /* 172 */ - { 2, TF, sys_swapon, "swapon" }, /* 173 */ - { 1, TF, sys_chroot, "chroot" }, /* 174 */ - { 2, TF, sys_pivotroot, "pivot_root" }, /* 175 */ - { 2, TF, sys_umount, "umount" }, /* 176 */ - { 1, TF, sys_swapoff, "swapoff" }, /* 177 */ - { 0, 0, sys_sync, "sync" }, /* 178 */ - [179] = { }, - { 1, NF, sys_setfsuid, "setfsuid" }, /* 180 */ - { 1, NF, sys_setfsgid, "setfsgid" }, /* 181 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 182 */ - { 2, 0, sys_ustat, "ustat" }, /* 183 */ - { 2, TF, sys_statfs, "statfs" }, /* 184 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 185 */ - { 3, TF, sys_statfs64, "statfs64" }, /* 186 */ - { 3, TD, sys_fstatfs64, "fstatfs64" }, /* 187 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 188 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 189 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 190 */ - { 5, 0, sys_futex, "futex" }, /* 191 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 192 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 193 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 194 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 195 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 196 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 197 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 198 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 199 */ - { 3, 0, sys_syslog, "syslog" }, /* 200 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 201 */ - { 1, TF, sys_uselib, "uselib" }, /* 202 */ - { 3, 0, sys_reboot, "reboot" }, /* 203 */ - { 4, TF, sys_quotactl, "quotactl" }, /* 204 */ - { 0, 0, printargs, "nfsservctl" }, /* 205 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 206 */ - { 2, 0, sys_bdflush, "bdflush" }, /* 207 */ - { 1, 0, sys_uname, "uname" }, /* 208 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 209 */ - { 2, 0, sys_init_module, "init_module" }, /* 210 */ - { 1, 0, sys_delete_module, "delete_module" }, /* 211 */ - { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 212 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 213 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 214 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 215 */ - { 1, 0, sys_sched_get_priority_max, "sched_get_priority_max"}, /* 216 */ - { 1, 0, sys_sched_get_priority_min, "sched_get_priority_min"}, /* 217 */ - { 2, 0, sys_sched_rr_get_interval, "sched_rr_get_interval"}, /* 218 */ - { 0, 0, sys_sched_yield, "sched_yield" }, /* 219 */ - [220 ... 222] = { }, - { 0, 0, printargs, "restart_syscall"}, /* 223 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 224 */ - { 0, TS, sys_rt_sigreturn, "rt_sigreturn" }, /* 225 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 226 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 227 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 228 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 229 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 230 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 231 */ - { 4, 0, sys_mq_open, "mq_open" }, /* 232 */ - { 1, 0, sys_mq_unlink, "mq_unlink" }, /* 233 */ - { 5, 0, sys_mq_timedsend, "mq_timedsend" }, /* 234 */ - { 5, 0, sys_mq_timedreceive, "mq_timedreceive"}, /* 235 */ - { 2, 0, sys_mq_notify, "mq_notify" }, /* 236 */ - { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 237 */ - [238] = { }, - { 2, 0, printargs, "io_setup" }, /* 239 */ - { 1, 0, printargs, "io_destroy" }, /* 240 */ - { 3, 0, printargs, "io_submit" }, /* 241 */ - { 5, 0, printargs, "io_getevents" }, /* 242 */ - { 3, 0, printargs, "io_cancel" }, /* 243 */ - { 2, 0, sys_clock_settime, "clock_settime" }, /* 244 */ - { 2, 0, sys_clock_gettime, "clock_gettime" }, /* 245 */ - { 2, 0, sys_clock_getres, "clock_getres" }, /* 246 */ - { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 247 */ - { 3, 0, sys_timer_create, "timer_create" }, /* 248 */ - { 1, 0, sys_timer_delete, "timer_delete" }, /* 249 */ - { 4, 0, sys_timer_settime, "timer_settime" }, /* 250 */ - { 2, 0, sys_timer_gettime, "timer_gettime" }, /* 251 */ - { 1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 252 */ - [253] = { }, - { 4, 0, printargs, "lookup_dcookie"}, /* 254 */ - [255] = { }, - { 5, 0, printargs, "add_key" }, /* 256 */ - { 5, 0, printargs, "request_key" }, /* 257 */ - { 5, 0, printargs, "keyctl" }, /* 258 */ - [259] = { }, - { 5, TD, sys_readahead, "readahead" }, /* 260 */ - { 5, TM|SI, sys_remap_file_pages, "remap_file_pages"}, /* 261 */ - { 5, TM, sys_migrate_pages, "migrate_pages" }, /* 262 */ - { 0, TM, sys_mbind, "mbind" }, /* 263 */ - { 6, TM, sys_get_mempolicy, "get_mempolicy" }, /* 264 */ - { 5, TM, sys_set_mempolicy, "set_mempolicy" }, /* 265 */ - { 1, TP, sys_unshare, "unshare" }, /* 266 */ - { 1, TM, sys_move_pages, "move_pages" }, /* 267 */ - { 0, TD, sys_splice, "splice" }, /* 268 */ - { 0, TD, sys_tee, "tee" }, /* 269 */ - { 0, TD, sys_vmsplice, "vmsplice" }, /* 270 */ - { 0, 0, printargs, "SYS_271" }, /* 271 */ - { 0, TD, sys_pselect6, "pselect6" }, /* 272 */ - { 0, TD, sys_ppoll, "ppoll" }, /* 273 */ - { 0, TD, sys_epoll_pwait, "epoll_pwait" }, /* 274 */ - { 1, TD, sys_epoll_create1, "epoll_create1" }, /* 275 */ - { 0, TD, sys_inotify_init, "inotify_init" }, /* 276 */ - { 3, TD, sys_inotify_add_watch, "inotify_add_watch"}, /* 277 */ - { 2, TD, sys_inotify_rm_watch, "inotify_rm_watch"}, /* 278 */ - { 1, TD, sys_inotify_init1, "inotify_init1" }, /* 279 */ - { 0, 0, sys_getcpu, "getcpu" }, /* 280 */ - { 4, 0, sys_kexec_load, "kexec_load" }, /* 281 */ - { 2, 0, sys_ioprio_set, "ioprio_set" }, /* 282 */ - { 3, 0, sys_ioprio_get, "ioprio_get" }, /* 283 */ - { 3, 0, sys_set_robust_list, "set_robust_list"}, /* 284 */ - { 3, 0, sys_get_robust_list, "get_robust_list"}, /* 285 */ - { 0, 0, printargs, "SYS_286" }, /* 286 */ - { 0, 0, printargs, "SYS_287" }, /* 287 */ - { 4, TD|TF, sys_openat, "openat" }, /* 288 */ - { 3, TD|TF, sys_mkdirat, "mkdirat" }, /* 289 */ - { 4, TD|TF, sys_mknodat, "mknodat" }, /* 290 */ - { 3, TD|TF, sys_unlinkat, "unlinkat" }, /* 291 */ - { 4, TD|TF, sys_renameat, "renameat" }, /* 292 */ - { 5, TD|TF, sys_linkat, "linkat" }, /* 293 */ - { 3, TD|TF, sys_symlinkat, "symlinkat" }, /* 294 */ - { 4, TD|TF, sys_readlinkat, "readlinkat" }, /* 295 */ - { 0, TD|TF, sys_utimensat, "utimensat" }, /* 296 */ - { 5, TD|TF, sys_fchownat, "fchownat" }, /* 297 */ - { 4, TD|TF, sys_futimesat, "futimesat" }, /* 298 */ - { 0, TD|TF, sys_newfstatat, "fstatat64" }, /* 299 */ - { 4, TD|TF, sys_fchmodat, "fchmodat" }, /* 300 */ - { 4, TD|TF, sys_faccessat, "faccessat" }, /* 301 */ - { 0, 0, printargs, "SYS_302" }, /* 302 */ - { 0, 0, printargs, "SYS_303" }, /* 303 */ - { 3, TD|TS, sys_signalfd, "signalfd" }, /* 304 */ - { 0, 0, printargs, "SYS_305" }, /* 305 */ - { 1, TD, sys_eventfd, "eventfd" }, /* 306 */ - { 5, TN, sys_recvmmsg, "recvmmsg" }, /* 307 */ - { 2, TD, sys_setns, "setns" }, /* 308 */ - { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 309 */ - { 3, TD, sys_dup3, "dup3" }, /* 310 */ - { 2, TD, sys_pipe2, "pipe2" }, /* 311 */ - { 2, TD, sys_timerfd_create, "timerfd_create"}, /* 312 */ - { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 313 */ - { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 314 */ - { 0, 0, printargs, "SYS_315" }, /* 315 */ - { 2, TD, sys_eventfd2, "eventfd2" }, /* 316 */ - { 5, TD, sys_preadv, "preadv" }, /* 317 */ - { 5, TD, sys_pwritev, "pwritev" }, /* 318 */ - [319] = { }, - { 2, TD, sys_fanotify_init, "fanotify_init" }, /* 320 */ - { 6, TD|TF, sys_fanotify_mark, "fanotify_mark" }, /* 321 */ - { 6, 0, sys_process_vm_readv, "process_vm_readv"}, /* 322 */ - { 6, 0, sys_process_vm_writev, "process_vm_writev"}, /* 323 */ - { 5, TD|TF, sys_name_to_handle_at, "name_to_handle_at"}, /* 324 */ - { 3, TD, sys_open_by_handle_at, "open_by_handle_at"}, /* 325 */ - { 6, TD, sys_sync_file_range2, "sync_file_range2"}, /* 326 */ - { 5, TD, sys_perf_event_open, "perf_event_open"}, /* 327 */ - { 4, TP|TS, sys_rt_tgsigqueueinfo, "rt_tgsigqueueinfo"}, /* 328 */ - { 2, 0, sys_clock_adjtime, "clock_adjtime" }, /* 329 */ - { 4, 0, sys_prlimit64, "prlimit64" }, /* 330 */ - { 5, 0, sys_kcmp, "kcmp" }, /* 331 */ - { 3, TD, sys_finit_module, "finit_module" }, /* 332 */ - { 4, TN, sys_accept4, "accept4" }, /* 333 */ - { 3, 0, sys_sched_setattr, "sched_setattr" }, /* 334 */ - { 4, 0, sys_sched_getattr, "sched_getattr" }, /* 335 */ +[ 0] = { 0, 0, SEN(printargs), "spill" }, +[ 1] = { 0, 0, SEN(printargs), "xtensa" }, +[ 2 ... 7] = { }, +[ 8] = { 3, TD|TF, SEN(open), "open" }, +[ 9] = { 1, TD, SEN(close), "close" }, +[ 10] = { 1, TD, SEN(dup), "dup" }, +[ 11] = { 2, TD, SEN(dup2), "dup2" }, +[ 12] = { 3, TD, SEN(read), "read" }, +[ 13] = { 3, TD, SEN(write), "write" }, +[ 14] = { 5, TD, SEN(select), "select" }, +[ 15] = { 3, TD, SEN(lseek), "lseek" }, +[ 16] = { 3, TD, SEN(poll), "poll" }, +[ 17] = { 5, TD, SEN(llseek), "_llseek" }, +[ 18] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[ 19] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[ 20] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[ 21] = { 2, TD|TF, SEN(creat), "creat" }, +[ 22] = { 2, TF, SEN(truncate), "truncate" }, +[ 23] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[ 24] = { 3, TD, SEN(readv), "readv" }, +[ 25] = { 3, TD, SEN(writev), "writev" }, +[ 26] = { 1, TD, SEN(fsync), "fsync" }, +[ 27] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[ 28] = { 4, TF, SEN(truncate64), "truncate64" }, +[ 29] = { 4, TD, SEN(ftruncate64), "ftruncate64" }, +[ 30] = { 6, TD, SEN(pread), "pread64" }, +[ 31] = { 6, TD, SEN(pwrite), "pwrite64" }, +[ 32] = { 2, TF, SEN(link), "link" }, +[ 33] = { 2, TF, SEN(rename), "rename" }, +[ 34] = { 2, TF, SEN(symlink), "symlink" }, +[ 35] = { 3, TF, SEN(readlink), "readlink" }, +[ 36] = { 3, TF, SEN(mknod), "mknod" }, +[ 37] = { 1, TD, SEN(pipe), "pipe" }, +[ 38] = { 1, TF, SEN(unlink), "unlink" }, +[ 39] = { 1, TF, SEN(rmdir), "rmdir" }, +[ 40] = { 2, TF, SEN(mkdir), "mkdir" }, +[ 41] = { 1, TF, SEN(chdir), "chdir" }, +[ 42] = { 1, TD, SEN(fchdir), "fchdir" }, +[ 43] = { 2, TF, SEN(getcwd), "getcwd" }, +[ 44] = { 2, TF, SEN(chmod), "chmod" }, +[ 45] = { 3, TF, SEN(chown), "chown" }, +[ 46] = { 2, TF, SEN(stat), "stat" }, +[ 47] = { 2, TF, SEN(stat64), "stat64" }, +[ 48] = { 3, TF, SEN(chown), "lchown" }, +[ 49] = { 2, TF, SEN(lstat), "lstat" }, +[ 50] = { 2, TF, SEN(lstat64), "lstat64" }, +[ 51] = { }, +[ 52] = { 2, TD, SEN(fchmod), "fchmod" }, +[ 53] = { 3, TD, SEN(fchown), "fchown" }, +[ 54] = { 2, TD, SEN(fstat), "fstat" }, +[ 55] = { 2, TD, SEN(fstat64), "fstat64" }, +[ 56] = { 2, TD, SEN(flock), "flock" }, +[ 57] = { 2, TF, SEN(access), "access" }, +[ 58] = { 1, NF, SEN(umask), "umask" }, +[ 59] = { 3, TD, SEN(getdents), "getdents" }, +[ 60] = { 3, TD, SEN(getdents64), "getdents64" }, +[ 61] = { 3, TD, SEN(fcntl64), "fcntl64" }, +[ 62] = { 6, TD, SEN(fallocate), "fallocate" }, +[ 63] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +[ 64] = { 2, TF, SEN(utime), "utime" }, +[ 65] = { 2, TF, SEN(utimes), "utimes" }, +[ 66] = { 3, TD, SEN(ioctl), "ioctl" }, +[ 67] = { 3, TD, SEN(fcntl), "fcntl" }, +[ 68] = { 5, TF, SEN(setxattr), "setxattr" }, +[ 69] = { 4, TF, SEN(getxattr), "getxattr" }, +[ 70] = { 3, TF, SEN(listxattr), "listxattr" }, +[ 71] = { 2, TF, SEN(removexattr), "removexattr" }, +[ 72] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[ 73] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[ 74] = { 3, TF, SEN(listxattr), "llistxattr" }, +[ 75] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[ 76] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[ 77] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[ 78] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[ 79] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[ 80] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[ 81] = { 2, TM|SI, SEN(munmap), "munmap" }, +[ 82] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[ 83] = { 1, TM|SI, SEN(brk), "brk" }, +[ 84] = { 2, TM, SEN(mlock), "mlock" }, +[ 85] = { 2, TM, SEN(munlock), "munlock" }, +[ 86] = { 1, TM, SEN(mlockall), "mlockall" }, +[ 87] = { 0, TM, SEN(munlockall), "munlockall" }, +[ 88] = { 5, TM|SI, SEN(mremap), "mremap" }, +[ 89] = { 3, TM, SEN(msync), "msync" }, +[ 90] = { 3, TM, SEN(mincore), "mincore" }, +[ 91] = { 3, TM, SEN(madvise), "madvise" }, +[ 92] = { 3, TI, SEN(shmget), "shmget" }, +[ 93] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[ 94] = { 3, TI, SEN(shmctl), "shmctl" }, +[ 95] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[ 96] = { 3, TN, SEN(socket), "socket" }, +[ 97] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[ 98] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[ 99] = { 2, TN, SEN(shutdown), "shutdown" }, +[100] = { 3, TN, SEN(bind), "bind" }, +[101] = { 3, TN, SEN(connect), "connect" }, +[102] = { 2, TN, SEN(listen), "listen" }, +[103] = { 3, TN, SEN(accept), "accept" }, +[104] = { 3, TN, SEN(getsockname), "getsockname" }, +[105] = { 3, TN, SEN(getpeername), "getpeername" }, +[106] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[107] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[108] = { 4, TN, SEN(send), "send" }, +[109] = { 4, TN, SEN(recv), "recv" }, +[110] = { 6, TN, SEN(sendto), "sendto" }, +[111] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[112] = { 4, TN, SEN(socketpair), "socketpair" }, +[113] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[114] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, +[115] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[116] = { 5, TP, SEN(clone), "clone" }, +[117] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[118] = { 1, TP|SE, SEN(exit), "exit" }, +[119] = { 1, TP|SE, SEN(exit), "exit_group" }, +[120] = { 0, NF, SEN(getpid), "getpid" }, +[121] = { 4, TP, SEN(wait4), "wait4" }, +[122] = { 5, TP, SEN(waitid), "waitid" }, +[123] = { 2, TS, SEN(kill), "kill" }, +[124] = { 2, TS, SEN(kill), "tkill" }, +[125] = { 3, TS, SEN(tgkill), "tgkill" }, +[126] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[127] = { 0, NF, SEN(gettid), "gettid" }, +[128] = { 0, 0, SEN(setsid), "setsid" }, +[129] = { 1, 0, SEN(getsid), "getsid" }, +[130] = { 5, 0, SEN(prctl), "prctl" }, +[131] = { 1, NF, SEN(personality), "personality" }, +[132] = { 2, 0, SEN(getpriority), "getpriority" }, +[133] = { 3, 0, SEN(setpriority), "setpriority" }, +[134] = { 3, 0, SEN(setitimer), "setitimer" }, +[135] = { 2, 0, SEN(getitimer), "getitimer" }, +[136] = { 1, 0, SEN(setuid), "setuid" }, +[137] = { 0, NF, SEN(getuid), "getuid" }, +[138] = { 1, 0, SEN(setgid), "setgid" }, +[139] = { 0, NF, SEN(getgid), "getgid" }, +[140] = { 0, NF, SEN(geteuid), "geteuid" }, +[141] = { 0, NF, SEN(getegid), "getegid" }, +[142] = { 2, 0, SEN(setreuid), "setreuid" }, +[143] = { 2, 0, SEN(setregid), "setregid" }, +[144] = { 3, 0, SEN(setresuid), "setresuid" }, +[145] = { 3, 0, SEN(getresuid), "getresuid" }, +[146] = { 3, 0, SEN(setresgid), "setresgid" }, +[147] = { 3, 0, SEN(getresgid), "getresgid" }, +[148] = { 2, 0, SEN(setpgid), "setpgid" }, +[149] = { 1, 0, SEN(getpgid), "getpgid" }, +[150] = { 0, NF, SEN(getppid), "getppid" }, +[151] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[152 ... 153] = { }, +[154] = { 1, 0, SEN(times), "times" }, +[155] = { 1, TF, SEN(acct), "acct" }, +[156] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[157] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[158] = { 2, 0, SEN(capget), "capget" }, +[159] = { 2, 0, SEN(capset), "capset" }, +[160] = { 4, 0, SEN(ptrace), "ptrace" }, +[161] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[162] = { 3, TI, SEN(semget), "semget" }, +[163] = { 3, TI, SEN(semop), "semop" }, +[164] = { 4, TI, SEN(semctl), "semctl" }, +[165] = { }, +[166] = { 2, TI, SEN(msgget), "msgget" }, +[167] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[168] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[169] = { 3, TI, SEN(msgctl), "msgctl" }, +[170] = { }, +[171] = { 2, TF, SEN(umount2), "umount2" }, +[172] = { 5, TF, SEN(mount), "mount" }, +[173] = { 2, TF, SEN(swapon), "swapon" }, +[174] = { 1, TF, SEN(chroot), "chroot" }, +[175] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[176] = { 1, TF, SEN(umount), "umount" }, +[177] = { 1, TF, SEN(swapoff), "swapoff" }, +[178] = { 0, 0, SEN(sync), "sync" }, +[179] = { 1, TD, SEN(syncfs), "syncfs" }, +[180] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[181] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[182] = { 3, 0, SEN(sysfs), "sysfs" }, +[183] = { 2, 0, SEN(ustat), "ustat" }, +[184] = { 2, TF, SEN(statfs), "statfs" }, +[185] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[186] = { 3, TF, SEN(statfs64), "statfs64" }, +[187] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[188] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[189] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[190] = { 2, 0, SEN(getrusage), "getrusage" }, +[191] = { 6, 0, SEN(futex), "futex" }, +[192] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[193] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[194] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[195] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[196] = { 2, 0, SEN(getgroups), "getgroups" }, +[197] = { 2, 0, SEN(setgroups), "setgroups" }, +[198] = { 2, 0, SEN(sethostname), "sethostname" }, +[199] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[200] = { 3, 0, SEN(syslog), "syslog" }, +[201] = { 0, 0, SEN(vhangup), "vhangup" }, +[202] = { 1, TF, SEN(uselib), "uselib" }, +[203] = { 4, 0, SEN(reboot), "reboot" }, +[204] = { 4, TF, SEN(quotactl), "quotactl" }, +[205] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[206] = { 1, 0, SEN(sysctl), "_sysctl" }, +[207] = { 2, 0, SEN(bdflush), "bdflush" }, +[208] = { 1, 0, SEN(uname), "uname" }, +[209] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[210] = { 3, 0, SEN(init_module), "init_module" }, +[211] = { 2, 0, SEN(delete_module), "delete_module" }, +[212] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[213] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[214] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[215] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[216] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[217] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[218] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[219] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[220 ... 222] = { }, +[223] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[224] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[225] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[226] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[227] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[228] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[229] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[230] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[231] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[232] = { 4, 0, SEN(mq_open), "mq_open" }, +[233] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[234] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, +[235] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, +[236] = { 2, 0, SEN(mq_notify), "mq_notify" }, +[237] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[238] = { }, +[239] = { 2, TM, SEN(io_setup), "io_setup" }, +[240] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[241] = { 3, 0, SEN(io_submit), "io_submit" }, +[242] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[243] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[244] = { 2, 0, SEN(clock_settime), "clock_settime" }, +[245] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, +[246] = { 2, 0, SEN(clock_getres), "clock_getres" }, +[247] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[248] = { 3, 0, SEN(timer_create), "timer_create" }, +[249] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[250] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[251] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[252] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[253] = { }, +[254] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[255] = { }, +[256] = { 5, 0, SEN(add_key), "add_key" }, +[257] = { 4, 0, SEN(request_key), "request_key" }, +[258] = { 5, 0, SEN(keyctl), "keyctl" }, +[259] = { }, +[260] = { 5, TD, SEN(readahead), "readahead" }, +[261] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[262] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[263] = { 6, TM, SEN(mbind), "mbind" }, +[264] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[265] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[266] = { 1, TP, SEN(unshare), "unshare" }, +[267] = { 6, TM, SEN(move_pages), "move_pages" }, +[268] = { 6, TD, SEN(splice), "splice" }, +[269] = { 4, TD, SEN(tee), "tee" }, +[270] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[271] = { }, +[272] = { 6, TD, SEN(pselect6), "pselect6" }, +[273] = { 5, TD, SEN(ppoll), "ppoll" }, +[274] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[275] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[276] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[277] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[278] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[279] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[280] = { 3, 0, SEN(getcpu), "getcpu" }, +[281] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[284] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[285] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[286 ... 287] = { }, +[288] = { 4, TD|TF, SEN(openat), "openat" }, +[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[291] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[292] = { 4, TD|TF, SEN(renameat), "renameat" }, +[293] = { 5, TD|TF, SEN(linkat), "linkat" }, +[294] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[295] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[296] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[297] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[298] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[299] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[300] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[301] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[302 ... 303] = { }, +[304] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[305] = { }, +[306] = { 1, TD, SEN(eventfd), "eventfd" }, +[307] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[308] = { 2, TD, SEN(setns), "setns" }, +[309] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[310] = { 3, TD, SEN(dup3), "dup3" }, +[311] = { 2, TD, SEN(pipe2), "pipe2" }, +[312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[313] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[314] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[315] = { }, +[316] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[317] = { 5, TD, SEN(preadv), "preadv" }, +[318] = { 5, TD, SEN(pwritev), "pwritev" }, +[319] = { }, +[320] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[321] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[322] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[323] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[324] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[325] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[326] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" }, +[327] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[328] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[329] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[330] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[331] = { 5, 0, SEN(kcmp), "kcmp" }, +[332] = { 3, TD, SEN(finit_module), "finit_module" }, +[333] = { 4, TN, SEN(accept4), "accept4" }, +[334] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[335] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[336] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[337] = { 3, 0, SEN(seccomp), "seccomp" }, +[338] = { 3, 0, SEN(getrandom), "getrandom" }, +[339] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[340] = { 3, TD, SEN(bpf), "bpf" }, +[341] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[342] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[343] = { 2, 0, SEN(membarrier), "membarrier" }, +[344] = { 3, TM, SEN(mlock2), "mlock2" }, +[345] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[346] = { 6, TD, SEN(preadv2), "preadv2" }, +[347] = { 6, TD, SEN(pwritev2), "pwritev2" }, diff --git a/linux/xtensa/userent.h b/linux/xtensa/userent.h new file mode 100644 index 00000000..0bee7179 --- /dev/null +++ b/linux/xtensa/userent.h @@ -0,0 +1,89 @@ +{ REG_A_BASE, "a0" }, +{ REG_A_BASE+1, "a1" }, +{ REG_A_BASE+2, "a2" }, +{ REG_A_BASE+3, "a3" }, +{ REG_A_BASE+4, "a4" }, +{ REG_A_BASE+5, "a5" }, +{ REG_A_BASE+6, "a6" }, +{ REG_A_BASE+7, "a7" }, +{ REG_A_BASE+8, "a8" }, +{ REG_A_BASE+9, "a9" }, +{ REG_A_BASE+10, "a10" }, +{ REG_A_BASE+11, "a11" }, +{ REG_A_BASE+12, "a12" }, +{ REG_A_BASE+13, "a13" }, +{ REG_A_BASE+14, "a14" }, +{ REG_A_BASE+15, "a15" }, +{ REG_PC, "pc" }, +{ SYSCALL_NR, "syscall_nr" }, +{ REG_AR_BASE, "ar0" }, +{ REG_AR_BASE+1, "ar1" }, +{ REG_AR_BASE+2, "ar2" }, +{ REG_AR_BASE+3, "ar3" }, +{ REG_AR_BASE+4, "ar4" }, +{ REG_AR_BASE+5, "ar5" }, +{ REG_AR_BASE+6, "ar6" }, +{ REG_AR_BASE+7, "ar7" }, +{ REG_AR_BASE+8, "ar8" }, +{ REG_AR_BASE+9, "ar9" }, +{ REG_AR_BASE+10, "ar10" }, +{ REG_AR_BASE+11, "ar11" }, +{ REG_AR_BASE+12, "ar12" }, +{ REG_AR_BASE+13, "ar13" }, +{ REG_AR_BASE+14, "ar14" }, +{ REG_AR_BASE+15, "ar15" }, +{ REG_AR_BASE+16, "ar16" }, +{ REG_AR_BASE+17, "ar17" }, +{ REG_AR_BASE+18, "ar18" }, +{ REG_AR_BASE+19, "ar19" }, +{ REG_AR_BASE+20, "ar20" }, +{ REG_AR_BASE+21, "ar21" }, +{ REG_AR_BASE+22, "ar22" }, +{ REG_AR_BASE+23, "ar23" }, +{ REG_AR_BASE+24, "ar24" }, +{ REG_AR_BASE+25, "ar25" }, +{ REG_AR_BASE+26, "ar26" }, +{ REG_AR_BASE+27, "ar27" }, +{ REG_AR_BASE+28, "ar28" }, +{ REG_AR_BASE+29, "ar29" }, +{ REG_AR_BASE+30, "ar30" }, +{ REG_AR_BASE+31, "ar31" }, +{ REG_AR_BASE+32, "ar32" }, +{ REG_AR_BASE+33, "ar33" }, +{ REG_AR_BASE+34, "ar34" }, +{ REG_AR_BASE+35, "ar35" }, +{ REG_AR_BASE+36, "ar36" }, +{ REG_AR_BASE+37, "ar37" }, +{ REG_AR_BASE+38, "ar38" }, +{ REG_AR_BASE+39, "ar39" }, +{ REG_AR_BASE+40, "ar40" }, +{ REG_AR_BASE+41, "ar41" }, +{ REG_AR_BASE+42, "ar42" }, +{ REG_AR_BASE+43, "ar43" }, +{ REG_AR_BASE+44, "ar44" }, +{ REG_AR_BASE+45, "ar45" }, +{ REG_AR_BASE+46, "ar46" }, +{ REG_AR_BASE+47, "ar47" }, +{ REG_AR_BASE+48, "ar48" }, +{ REG_AR_BASE+49, "ar49" }, +{ REG_AR_BASE+50, "ar50" }, +{ REG_AR_BASE+51, "ar51" }, +{ REG_AR_BASE+52, "ar52" }, +{ REG_AR_BASE+53, "ar53" }, +{ REG_AR_BASE+54, "ar54" }, +{ REG_AR_BASE+55, "ar55" }, +{ REG_AR_BASE+56, "ar56" }, +{ REG_AR_BASE+57, "ar57" }, +{ REG_AR_BASE+58, "ar58" }, +{ REG_AR_BASE+59, "ar59" }, +{ REG_AR_BASE+60, "ar60" }, +{ REG_AR_BASE+61, "ar61" }, +{ REG_AR_BASE+62, "ar62" }, +{ REG_AR_BASE+63, "ar63" }, +{ REG_LBEG, "lbeg" }, +{ REG_LEND, "lend" }, +{ REG_LCOUNT, "lcount" }, +{ REG_SAR, "sar" }, +{ REG_WB, "wb" }, +{ REG_WS, "ws" }, +{ REG_PS, "ps" }, diff --git a/lookup_dcookie.c b/lookup_dcookie.c new file mode 100644 index 00000000..279694f1 --- /dev/null +++ b/lookup_dcookie.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +SYS_FUNC(lookup_dcookie) +{ + if (entering(tcp)) + return 0; + + /* cookie */ + int argn = printllval(tcp, "%llu", 0); + tprints(", "); + + /* buffer */ + if (syserror(tcp)) + printaddr(tcp->u_arg[argn]); + else + printstrn(tcp, tcp->u_arg[argn], tcp->u_rval); + + /* len */ + tprintf(", %" PRI_klu, tcp->u_arg[argn + 1]); + + return 0; +} diff --git a/loop.c b/loop.c index 2e163479..f19ad928 100644 --- a/loop.c +++ b/loop.c @@ -26,144 +26,183 @@ */ #include "defs.h" +#include +#include -#include +typedef struct loop_info struct_loop_info; -#include +#include DEF_MPERS_TYPE(struct_loop_info) +#include MPERS_DEFS + +#include "xlat/loop_cmds.h" #include "xlat/loop_flags_options.h" #include "xlat/loop_crypt_type_options.h" -int loop_ioctl(struct tcb *tcp, long code, long arg) +static void +decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr) { - struct loop_info info; - struct loop_info64 info64; - char *s = alloca((LO_NAME_SIZE + LO_KEY_SIZE) * 4); + struct_loop_info info; - if (entering(tcp)) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &info)) + return; - switch (code) { + tprintf("{lo_number=%d", info.lo_number); - case LOOP_SET_STATUS: - case LOOP_GET_STATUS: - if (!verbose(tcp) || umove(tcp, arg, &info) < 0) - return 0; + if (!abbrev(tcp)) { + tprints(", lo_device="); + print_dev_t(info.lo_device); + tprintf(", lo_inode=%" PRI_klu, (kernel_ulong_t) info.lo_inode); + tprints(", lo_rdevice="); + print_dev_t(info.lo_rdevice); + } - tprintf(", {number=%d", info.lo_number); + tprintf(", lo_offset=%#x", info.lo_offset); + + if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) { + tprints(", lo_encrypt_type="); + printxval(loop_crypt_type_options, info.lo_encrypt_type, + "LO_CRYPT_???"); + /* + * It is converted to unsigned before use in kernel, see + * loop_info64_from_old in drivers/block/loop.c + */ + tprintf(", lo_encrypt_key_size=%" PRIu32, + (uint32_t) info.lo_encrypt_key_size); + } - if (!abbrev(tcp)) { - tprintf(", device=%#lx, inode=%lu, rdevice=%#lx", - (unsigned long) info.lo_device, - info.lo_inode, - (unsigned long) info.lo_rdevice); - } + tprints(", lo_flags="); + printflags(loop_flags_options, info.lo_flags, "LO_FLAGS_???"); - tprintf(", offset=%#x", info.lo_offset); + tprints(", lo_name="); + print_quoted_string(info.lo_name, LO_NAME_SIZE, + QUOTE_0_TERMINATED); - if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) { - tprints(", encrypt_type="); - printxval(loop_crypt_type_options, info.lo_encrypt_type, - "LO_CRYPT_???"); - tprintf(", encrypt_key_size=%d", info.lo_encrypt_key_size); - } + if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) { + tprints(", lo_encrypt_key="); + print_quoted_string((void *) info.lo_encrypt_key, + MIN((uint32_t) info.lo_encrypt_key_size, + LO_KEY_SIZE), 0); + } - tprints(", flags="); - printflags(loop_flags_options, info.lo_flags, "LO_FLAGS_???"); + if (!abbrev(tcp)) + tprintf(", lo_init=[%#" PRI_klx ", %#" PRI_klx "]" + ", reserved=[%#hhx, %#hhx, %#hhx, %#hhx]}", + (kernel_ulong_t) info.lo_init[0], + (kernel_ulong_t) info.lo_init[1], + info.reserved[0], info.reserved[1], + info.reserved[2], info.reserved[3]); + else + tprints(", ...}"); +} - string_quote(info.lo_name, s, -1, LO_NAME_SIZE); - tprintf(", name=%s", s); +static void +decode_loop_info64(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct loop_info64 info64; - if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) { - string_quote((void *) info.lo_encrypt_key, s, 0, LO_KEY_SIZE); - tprintf(", encrypt_key=%s", s); - } + tprints(", "); + if (umove_or_printaddr(tcp, addr, &info64)) + return; + + if (!abbrev(tcp)) { + tprints("{lo_device="); + print_dev_t(info64.lo_device); + tprintf(", lo_inode=%" PRIu64, (uint64_t) info64.lo_inode); + tprints(", lo_rdevice="); + print_dev_t(info64.lo_rdevice); + tprintf(", lo_offset=%#" PRIx64 ", lo_sizelimit=%" PRIu64 + ", lo_number=%" PRIu32, + (uint64_t) info64.lo_offset, + (uint64_t) info64.lo_sizelimit, + (uint32_t) info64.lo_number); + } else { + tprintf("{lo_offset=%#" PRIx64 ", lo_number=%" PRIu32, + (uint64_t) info64.lo_offset, + (uint32_t) info64.lo_number); + } - if (!abbrev(tcp)) - tprintf(", init={%#lx, %#lx}" - ", reserved={%#x, %#x, %#x, %#x}}", - info.lo_init[0], info.lo_init[1], - info.reserved[0], info.reserved[1], - info.reserved[2], info.reserved[3]); - else - tprints(", ...}"); + if (!abbrev(tcp) || info64.lo_encrypt_type != LO_CRYPT_NONE) { + tprints(", lo_encrypt_type="); + printxval(loop_crypt_type_options, info64.lo_encrypt_type, + "LO_CRYPT_???"); + tprintf(", lo_encrypt_key_size=%" PRIu32, + info64.lo_encrypt_key_size); + } - return 1; + tprints(", lo_flags="); + printflags(loop_flags_options, info64.lo_flags, "LO_FLAGS_???"); + + tprints(", lo_file_name="); + print_quoted_string((void *) info64.lo_file_name, + LO_NAME_SIZE, QUOTE_0_TERMINATED); + + if (!abbrev(tcp) || info64.lo_encrypt_type != LO_CRYPT_NONE) { + tprints(", lo_crypt_name="); + print_quoted_string((void *) info64.lo_crypt_name, + LO_NAME_SIZE, QUOTE_0_TERMINATED); + tprints(", lo_encrypt_key="); + print_quoted_string((void *) info64.lo_encrypt_key, + MIN(info64.lo_encrypt_key_size, + LO_KEY_SIZE), 0); + } - case LOOP_SET_STATUS64: - case LOOP_GET_STATUS64: - if (!verbose(tcp) || umove(tcp, arg, &info64) < 0) + if (!abbrev(tcp)) + tprintf(", lo_init=[%#" PRIx64 ", %#" PRIx64 "]}", + (uint64_t) info64.lo_init[0], + (uint64_t) info64.lo_init[1]); + else + tprints(", ...}"); +} + +MPERS_PRINTER_DECL(int, loop_ioctl, + struct tcb *tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { + case LOOP_GET_STATUS: + if (entering(tcp)) return 0; + /* fall through */ + case LOOP_SET_STATUS: + decode_loop_info(tcp, arg); + break; - tprints(", {"); - - if (!abbrev(tcp)) { - tprintf("device=%" PRIu64 ", inode=%" PRIu64 ", " - "rdevice=%" PRIu64 ", offset=%#" PRIx64 ", " - "sizelimit=%" PRIu64 ", number=%" PRIu32, - (uint64_t) info64.lo_device, - (uint64_t) info64.lo_inode, - (uint64_t) info64.lo_rdevice, - (uint64_t) info64.lo_offset, - (uint64_t) info64.lo_sizelimit, - (uint32_t) info64.lo_number); - } else { - tprintf("offset=%#" PRIx64 ", number=%" PRIu32, - (uint64_t) info64.lo_offset, - (uint32_t) info64.lo_number); - } - - if (!abbrev(tcp) || info64.lo_encrypt_type != LO_CRYPT_NONE) { - tprints(", encrypt_type="); - printxval(loop_crypt_type_options, info64.lo_encrypt_type, - "LO_CRYPT_???"); - tprintf(", encrypt_key_size=%" PRIu32, - info64.lo_encrypt_key_size); - } - - tprints(", flags="); - printflags(loop_flags_options, info64.lo_flags, "LO_FLAGS_???"); - - string_quote((void *) info64.lo_file_name, s, -1, LO_NAME_SIZE); - tprintf(", file_name=%s", s); - - if (!abbrev(tcp) || info64.lo_encrypt_type != LO_CRYPT_NONE) { - string_quote((void *) info64.lo_crypt_name, s, -1, LO_NAME_SIZE); - tprintf(", crypt_name=%s", s); - string_quote((void *) info64.lo_encrypt_key, s, 0, LO_KEY_SIZE); - tprintf(", encrypt_key=%s", s); - } - - if (!abbrev(tcp)) - tprintf(", init={%#" PRIx64 ", %#" PRIx64 "}}", - (uint64_t) info64.lo_init[0], - (uint64_t) info64.lo_init[1]); - else - tprints(", ...}"); - - return 1; + case LOOP_GET_STATUS64: + if (entering(tcp)) + return 0; + /* fall through */ + case LOOP_SET_STATUS64: + decode_loop_info64(tcp, arg); + break; case LOOP_CLR_FD: -#ifdef LOOP_SET_CAPACITY case LOOP_SET_CAPACITY: -#endif -#ifdef LOOP_CTL_GET_FREE /* newer loop-control stuff */ case LOOP_CTL_GET_FREE: -#endif /* Takes no arguments */ - return 1; + break; case LOOP_SET_FD: case LOOP_CHANGE_FD: -#ifdef LOOP_CTL_ADD + tprints(", "); + printfd(tcp, arg); + break; + /* newer loop-control stuff */ case LOOP_CTL_ADD: case LOOP_CTL_REMOVE: -#endif - /* These take simple args, so let default printer handle it */ + tprintf(", %d", (int) arg); + break; + + case LOOP_SET_DIRECT_IO: + tprintf(", %" PRI_klu, arg); + break; default: - return 0; + return RVAL_DECODED; } + + return RVAL_DECODED | 1; } diff --git a/lseek.c b/lseek.c new file mode 100644 index 00000000..18d847b6 --- /dev/null +++ b/lseek.c @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2002-2005 Roland McGrath + * Copyright (c) 2009 Andreas Schwab + * Copyright (c) 2012 H.J. Lu + * Copyright (c) 2013 Denys Vlasenko + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include "xlat/whence_codes.h" + +/* Linux kernel has exactly one version of lseek: + * fs/read_write.c::SYSCALL_DEFINE3(lseek, unsigned, fd, off_t, offset, unsigned, origin) + * In kernel, off_t is always the same as (kernel's) long + * (see include/uapi/asm-generic/posix_types.h). + * Use test/x32_lseek.c to test lseek decoding. + */ +SYS_FUNC(lseek) +{ + printfd(tcp, tcp->u_arg[0]); + + kernel_long_t offset; + +# ifndef current_klongsize + if (current_klongsize < sizeof(kernel_long_t)) { + offset = (int) tcp->u_arg[1]; + } else +# endif /* !current_klongsize */ + { + offset = tcp->u_arg[1]; + } + + tprintf(", %" PRI_kld ", ", offset); + + printxval(whence_codes, tcp->u_arg[2], "SEEK_???"); + + return RVAL_DECODED | RVAL_UDECIMAL; +} + +/* llseek syscall takes explicitly two ulong arguments hi, lo, + * rather than one 64-bit argument for which ULONG_LONG works + * appropriate for the native byte order. + * + * See kernel's fs/read_write.c::SYSCALL_DEFINE5(llseek, ...) + * + * hi,lo are "unsigned longs" and combined exactly this way in kernel: + * ((loff_t) hi << 32) | lo + * Note that for architectures with kernel's long wider than userspace long + * (such as x32), combining code will use *kernel's*, i.e. *wide* longs + * for hi and lo. + */ +SYS_FUNC(llseek) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprintf(", %lld, ", + ((long long) tcp->u_arg[1] << 32) + | ((long long) tcp->u_arg[2])); + } else { + printnum_int64(tcp, tcp->u_arg[3], "%" PRIu64); + tprints(", "); + printxval(whence_codes, tcp->u_arg[4], "SEEK_???"); + } + return 0; +} diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4 new file mode 100644 index 00000000..93dfce3a --- /dev/null +++ b/m4/ax_code_coverage.m4 @@ -0,0 +1,274 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CODE_COVERAGE() +# +# DESCRIPTION +# +# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LDFLAGS which should be +# included in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LDFLAGS variables of +# every build target (program or library) which should be built with code +# coverage support. Also defines CODE_COVERAGE_RULES which should be +# substituted in your Makefile; and $enable_code_coverage which can be +# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined +# and substituted, and corresponds to the value of the +# --enable-code-coverage option, which defaults to being disabled. +# +# Test also for gcov program and create GCOV variable that could be +# substituted. +# +# Note that all optimisation flags in CFLAGS must be disabled when code +# coverage is enabled. +# +# Usage example: +# +# configure.ac: +# +# AX_CODE_COVERAGE +# +# Makefile.am: +# +# @CODE_COVERAGE_RULES@ +# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ... +# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... +# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... +# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... +# +# This results in a "check-code-coverage" rule being added to any +# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module +# has been configured with --enable-code-coverage). Running `make +# check-code-coverage` in that directory will run the module's test suite +# (`make check`) and build a code coverage report detailing the code which +# was touched, then print the URI for the report. +# +# This code was derived from Makefile.decl in GLib, originally licenced +# under LGPLv2.1+. +# +# LICENSE +# +# Copyright (c) 2012, 2016 Philip Withnall +# Copyright (c) 2012 Xan Lopez +# Copyright (c) 2012 Christian Persch +# Copyright (c) 2012 Paolo Borelli +# Copyright (c) 2012 Dan Winship +# Copyright (c) 2015 Bastien ROUCARIES +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +#serial 16 + +AC_DEFUN([AX_CODE_COVERAGE],[ + dnl Check for --enable-code-coverage + AC_REQUIRE([AC_PROG_SED]) + + # allow to override gcov location + AC_ARG_WITH([gcov], + [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) + + AC_MSG_CHECKING([whether to build with code coverage support]) + AC_ARG_ENABLE([code-coverage], + AS_HELP_STRING([--enable-code-coverage], + [Whether to enable code coverage support]),, + enable_code_coverage=no) + + AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) + AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) + AC_MSG_RESULT($enable_code_coverage) + + AS_IF([ test "$enable_code_coverage" = "yes" ], [ + # check for gcov + AC_CHECK_TOOL([GCOV], + [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], + [:]) + AS_IF([test "X$GCOV" = "X:"], + [AC_MSG_ERROR([gcov is needed to do coverage])]) + AC_SUBST([GCOV]) + + dnl Check if gcc is being used + AS_IF([ test "$GCC" = "no" ], [ + AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) + ]) + + # List of supported lcov versions. + lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" + + AC_CHECK_PROG([LCOV], [lcov], [lcov]) + AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) + + AS_IF([ test "$LCOV" ], [ + AC_CACHE_CHECK([for lcov version], ax_cv_lcov_version, [ + ax_cv_lcov_version=invalid + lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` + for lcov_check_version in $lcov_version_list; do + if test "$lcov_version" = "$lcov_check_version"; then + ax_cv_lcov_version="$lcov_check_version (ok)" + fi + done + ]) + ], [ + lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" + AC_MSG_ERROR([$lcov_msg]) + ]) + + case $ax_cv_lcov_version in + ""|invalid[)] + lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." + AC_MSG_ERROR([$lcov_msg]) + LCOV="exit 0;" + ;; + esac + + AS_IF([ test -z "$GENHTML" ], [ + AC_MSG_ERROR([Could not find genhtml from the lcov package]) + ]) + + dnl Build the code coverage flags + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_LDFLAGS="-lgcov" + + AC_SUBST([CODE_COVERAGE_CPPFLAGS]) + AC_SUBST([CODE_COVERAGE_CFLAGS]) + AC_SUBST([CODE_COVERAGE_CXXFLAGS]) + AC_SUBST([CODE_COVERAGE_LDFLAGS]) + ]) + +[CODE_COVERAGE_RULES=' +# Code coverage +# +# Optional: +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. +# Multiple directories may be specified, separated by whitespace. +# (Default: $(top_builddir)) +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated +# by lcov for code coverage. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage +# reports to be created. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, +# set to 0 to disable it and leave empty to stay with the default. +# (Default: empty) +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering +# lcov instance. (Default: empty) +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore +# +# The generated report will be titled using the $(PACKAGE_NAME) and +# $(PACKAGE_VERSION). In order to add the current git hash to the title, +# use the git-version-gen script, available online. + +# Optional variables +CODE_COVERAGE_DIRECTORY ?= $(top_builddir) +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage +CODE_COVERAGE_BRANCH_COVERAGE ?= +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) +CODE_COVERAGE_IGNORE_PATTERN ?= + +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ + $(CODE_COVERAGE_OUTPUT_FILE); +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ + $(CODE_COVERAGE_IGNORE_PATTERN); +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); +code_coverage_quiet = $(code_coverage_quiet_$(V)) +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +code_coverage_quiet_0 = --quiet + +# sanitizes the test-name: replaces with underscores: dashes and dots +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) + +# Use recursive makes in order to ignore errors during check +check-code-coverage: +ifeq ($(CODE_COVERAGE_ENABLED),yes) + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +else + @echo "Need to reconfigure with --enable-code-coverage" +endif + +# Capture code coverage data +code-coverage-capture: code-coverage-capture-hook +ifeq ($(CODE_COVERAGE_ENABLED),yes) + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +else + @echo "Need to reconfigure with --enable-code-coverage" +endif + +# Hook rule executed before code-coverage-capture, overridable by the user +code-coverage-capture-hook: + +ifeq ($(CODE_COVERAGE_ENABLED),yes) +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +endif + +GITIGNOREFILES ?= +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) + +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage + +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean +'] + + AC_SUBST([CODE_COVERAGE_RULES]) + m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) +]) diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 new file mode 100644 index 00000000..9fddbf64 --- /dev/null +++ b/m4/ax_prog_cc_for_build.m4 @@ -0,0 +1,157 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_CC_FOR_BUILD +# +# DESCRIPTION +# +# This macro searches for a C compiler that generates native executables, +# that is a C compiler that surely is not a cross-compiler. This can be +# useful if you have to generate source code at compile-time like for +# example GCC does. +# +# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything +# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). +# The value of these variables can be overridden by the user by specifying +# a compiler with an environment variable (like you do for standard CC). +# +# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object +# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if +# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are +# substituted in the Makefile. +# +# LICENSE +# +# Copyright (c) 2008 Paolo Bonzini +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 8 +#modified for strace project + +AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) +AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_CPP])dnl +AC_REQUIRE([AC_EXEEXT])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl + +dnl Use the standard macros, but make them use other variable names +dnl +pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl +pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl +pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl +pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl +pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl +pushdef([ac_cv_prog_cc_stdc], ac_cv_build_prog_cc_stdc)dnl +pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl +pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl +pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl +pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl +pushdef([ac_cv_objext], ac_cv_build_objext)dnl +pushdef([ac_exeext], ac_build_exeext)dnl +pushdef([ac_objext], ac_build_objext)dnl +pushdef([CC], CC_FOR_BUILD)dnl +pushdef([CPP], CPP_FOR_BUILD)dnl +pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl +pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl +pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl +pushdef([WARN_CFLAGS], WARN_CFLAGS_FOR_BUILD)dnl +pushdef([host], build)dnl +pushdef([host_alias], build_alias)dnl +pushdef([host_cpu], build_cpu)dnl +pushdef([host_vendor], build_vendor)dnl +pushdef([host_os], build_os)dnl +pushdef([ac_cv_host], ac_cv_build)dnl +pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl +pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl +pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl +pushdef([ac_cv_host_os], ac_cv_build_os)dnl +pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl +pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl +pushdef([gl_unknown_warnings_are_errors], gl_build_unknown_warnings_are_errors)dnl + +st_SAVE_VAR([ac_c_decl_warn_flag]) +st_SAVE_VAR([ac_c_preproc_warn_flag]) +st_SAVE_VAR([ac_c_werror_flag]) +st_SAVE_VAR([ac_compile]) +st_SAVE_VAR([ac_compiler_gnu]) +st_SAVE_VAR([ac_cpp]) +st_SAVE_VAR([ac_cv_c_compiler_gnu]) +st_SAVE_VAR([ac_cv_c_decl_report]) +st_SAVE_VAR([ac_link]) +st_SAVE_VAR([ac_tool_prefix]) +st_SAVE_VAR([cross_compiling]) +cross_compiling=no + +AC_MSG_NOTICE([looking for a C compiler that generates native executables]) +AC_PROG_CC +AC_PROG_CPP +AC_EXEEXT + +st_WARN_CFLAGS + +st_RESTORE_VAR([cross_compiling]) +st_RESTORE_VAR([ac_tool_prefix]) +st_RESTORE_VAR([ac_link]) +st_RESTORE_VAR([ac_cv_c_decl_report]) +st_RESTORE_VAR([ac_cv_c_compiler_gnu]) +st_RESTORE_VAR([ac_cpp]) +st_RESTORE_VAR([ac_compiler_gnu]) +st_RESTORE_VAR([ac_compile]) +st_RESTORE_VAR([ac_c_werror_flag]) +st_RESTORE_VAR([ac_c_preproc_warn_flag]) +st_RESTORE_VAR([ac_c_decl_warn_flag]) + +dnl Restore the old definitions +dnl +popdef([gl_unknown_warnings_are_errors])dnl +popdef([am_cv_CC_dependencies_compiler_type])dnl +popdef([am_cv_prog_cc_c_o])dnl +popdef([ac_cv_host_os])dnl +popdef([ac_cv_host_vendor])dnl +popdef([ac_cv_host_cpu])dnl +popdef([ac_cv_host_alias])dnl +popdef([ac_cv_host])dnl +popdef([host_os])dnl +popdef([host_vendor])dnl +popdef([host_cpu])dnl +popdef([host_alias])dnl +popdef([host])dnl +popdef([WARN_CFLAGS])dnl +popdef([LDFLAGS])dnl +popdef([CPPFLAGS])dnl +popdef([CFLAGS])dnl +popdef([CPP])dnl +popdef([CC])dnl +popdef([ac_objext])dnl +popdef([ac_exeext])dnl +popdef([ac_cv_objext])dnl +popdef([ac_cv_exeext])dnl +popdef([ac_cv_prog_cc_c89])dnl +popdef([ac_cv_prog_cc_c99])dnl +popdef([ac_cv_prog_cc_c11])dnl +popdef([ac_cv_prog_cc_stdc])dnl +popdef([ac_cv_prog_cc_g])dnl +popdef([ac_cv_prog_cc_cross])dnl +popdef([ac_cv_prog_cc_works])dnl +popdef([ac_cv_prog_gcc])dnl +popdef([ac_cv_prog_CPP])dnl + +dnl Finally, set Makefile variables +dnl +BUILD_EXEEXT=$ac_build_exeext +BUILD_OBJEXT=$ac_build_objext +AC_SUBST(BUILD_EXEEXT)dnl +AC_SUBST(BUILD_OBJEXT)dnl +AC_SUBST([CFLAGS_FOR_BUILD])dnl +AC_SUBST([CPPFLAGS_FOR_BUILD])dnl +AC_SUBST([LDFLAGS_FOR_BUILD])dnl +AC_SUBST([WARN_CFLAGS_FOR_BUILD])dnl +]) diff --git a/m4/ax_valgrind_check.m4 b/m4/ax_valgrind_check.m4 new file mode 100644 index 00000000..fa84a35e --- /dev/null +++ b/m4/ax_valgrind_check.m4 @@ -0,0 +1,237 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_VALGRIND_DFLT(memcheck|helgrind|drd|sgcheck, on|off) +# AX_VALGRIND_CHECK() +# +# DESCRIPTION +# +# AX_VALGRIND_CHECK checks whether Valgrind is present and, if so, allows +# running `make check` under a variety of Valgrind tools to check for +# memory and threading errors. +# +# Defines VALGRIND_CHECK_RULES which should be substituted in your +# Makefile; and $enable_valgrind which can be used in subsequent configure +# output. VALGRIND_ENABLED is defined and substituted, and corresponds to +# the value of the --enable-valgrind option, which defaults to being +# enabled if Valgrind is installed and disabled otherwise. Individual +# Valgrind tools can be disabled via --disable-valgrind-, the +# default is configurable via the AX_VALGRIND_DFLT command or is to use +# all commands not disabled via AX_VALGRIND_DFLT. All AX_VALGRIND_DFLT +# calls must be made before the call to AX_VALGRIND_CHECK. +# +# If unit tests are written using a shell script and automake's +# LOG_COMPILER system, the $(VALGRIND) variable can be used within the +# shell scripts to enable Valgrind, as described here: +# +# https://www.gnu.org/software/gnulib/manual/html_node/Running-self_002dtests-under-valgrind.html +# +# Usage example: +# +# configure.ac: +# +# AX_VALGRIND_DFLT([sgcheck], [off]) +# AX_VALGRIND_CHECK +# +# Makefile.am: +# +# @VALGRIND_CHECK_RULES@ +# VALGRIND_SUPPRESSIONS_FILES = my-project.supp +# EXTRA_DIST = my-project.supp +# +# This results in a "check-valgrind" rule being added to any Makefile.am +# which includes "@VALGRIND_CHECK_RULES@" (assuming the module has been +# configured with --enable-valgrind). Running `make check-valgrind` in +# that directory will run the module's test suite (`make check`) once for +# each of the available Valgrind tools (out of memcheck, helgrind and drd) +# while the sgcheck will be skipped unless enabled again on the +# commandline with --enable-valgrind-sgcheck. The results for each check +# will be output to test-suite-$toolname.log. The target will succeed if +# there are zero errors and fail otherwise. +# +# Alternatively, a "check-valgrind-$TOOL" rule will be added, for $TOOL in +# memcheck, helgrind, drd and sgcheck. These are useful because often only +# some of those tools can be ran cleanly on a codebase. +# +# The macro supports running with and without libtool. +# +# LICENSE +# +# Copyright (c) 2014, 2015, 2016 Philip Withnall +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 13 +#modified for strace project + +dnl Configured tools +m4_define([valgrind_tool_list], [[memcheck], [helgrind], [drd], [sgcheck]]) +m4_set_add_all([valgrind_exp_tool_set], [sgcheck]) +m4_foreach([vgtool], [valgrind_tool_list], + [m4_define([en_dflt_valgrind_]vgtool, [on])]) + +AC_DEFUN([AX_VALGRIND_DFLT],[ + m4_define([en_dflt_valgrind_$1], [$2]) +])dnl + +AC_DEFUN([AX_VALGRIND_CHECK],[ + dnl Check for --enable-valgrind + AC_ARG_ENABLE([valgrind], + [AS_HELP_STRING([--enable-valgrind], [Whether to enable Valgrind on the unit tests])], + [enable_valgrind=$enableval],[enable_valgrind=]) + + AS_IF([test "$enable_valgrind" != "no"],[ + # Check for Valgrind. + AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind]) + AS_IF([test "$VALGRIND" = ""],[ + AS_IF([test "$enable_valgrind" = "yes"],[ + AC_MSG_ERROR([Could not find valgrind; either install it or reconfigure with --disable-valgrind]) + ],[ + enable_valgrind=no + ]) + ],[ + enable_valgrind=yes + ]) + ]) + + AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"]) + AC_SUBST([VALGRIND_ENABLED],[$enable_valgrind]) + + # Check for Valgrind tools we care about. + [valgrind_enabled_tools=] + m4_foreach([vgtool],[valgrind_tool_list],[ + AC_ARG_ENABLE([valgrind-]vgtool, + m4_if(m4_defn([en_dflt_valgrind_]vgtool),[off],dnl +[AS_HELP_STRING([--enable-valgrind-]vgtool, [Whether to use ]vgtool[ during the Valgrind tests])],dnl +[AS_HELP_STRING([--disable-valgrind-]vgtool, [Whether to skip ]vgtool[ during the Valgrind tests])]), + [enable_valgrind_]vgtool[=$enableval], + [enable_valgrind_]vgtool[=]) + AS_IF([test "$enable_valgrind" = "no"],[ + enable_valgrind_]vgtool[=no], + [test "$enable_valgrind_]vgtool[" ]dnl +m4_if(m4_defn([en_dflt_valgrind_]vgtool), [off], [= "yes"], [!= "no"]),[ + AC_CACHE_CHECK([for Valgrind tool ]vgtool, + [ax_cv_valgrind_tool_]vgtool,[ + ax_cv_valgrind_tool_]vgtool[=no + m4_set_contains([valgrind_exp_tool_set],vgtool, + [m4_define([vgtoolx],[exp-]vgtool)], + [m4_define([vgtoolx],vgtool)]) + AS_IF([`$VALGRIND --tool=]vgtoolx[ --help >/dev/null 2>&1`],[ + ax_cv_valgrind_tool_]vgtool[=yes + ]) + ]) + AS_IF([test "$ax_cv_valgrind_tool_]vgtool[" = "no"],[ + AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[ + AC_MSG_ERROR([Valgrind does not support ]vgtool[; reconfigure with --disable-valgrind-]vgtool) + ],[ + enable_valgrind_]vgtool[=no + ]) + ],[ + enable_valgrind_]vgtool[=yes + ]) + ]) + AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[ + valgrind_enabled_tools="$valgrind_enabled_tools ]m4_bpatsubst(vgtool,[^exp-])[" + ]) + AC_SUBST([ENABLE_VALGRIND_]vgtool,[$enable_valgrind_]vgtool) + ]) + AC_SUBST([valgrind_tools],["]m4_join([ ], valgrind_tool_list)["]) + AC_SUBST([valgrind_enabled_tools],[$valgrind_enabled_tools]) + +[VALGRIND_CHECK_RULES=' +# Valgrind check +# +# Optional: +# - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions +# files to load. (Default: empty) +# - VALGRIND_FLAGS: General flags to pass to all Valgrind tools. +# (Default: --num-callers=30) +# - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of: +# memcheck, helgrind, drd, sgcheck). (Default: various) + +# Optional variables +VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES)) +VALGRIND_FLAGS ?= --num-callers=30 +VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no +VALGRIND_helgrind_FLAGS ?= --history-level=approx +VALGRIND_drd_FLAGS ?= +VALGRIND_sgcheck_FLAGS ?= + +# Internal use +valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools))) + +valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS) +valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS) +valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS) +valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS) + +valgrind_quiet = $(valgrind_quiet_$(V)) +valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY)) +valgrind_quiet_0 = --quiet +valgrind_v_use = $(valgrind_v_use_$(V)) +valgrind_v_use_ = $(valgrind_v_use_$(AM_DEFAULT_VERBOSITY)) +valgrind_v_use_0 = @echo " USE " $(patsubst check-valgrind-%,%,$''@):; + +# Support running with and without libtool. +ifneq ($(LIBTOOL),) +valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute +else +valgrind_lt = +endif + +# Use recursive makes in order to ignore errors during check +check-valgrind: +ifeq ($(VALGRIND_ENABLED),yes) + -$(A''M_V_at)$(foreach tool,$(valgrind_enabled_tools), \ + $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-$(tool); \ + ) +else + @echo "Need to reconfigure with --enable-valgrind" +endif + +# Valgrind running +VALGRIND_TESTS_ENVIRONMENT = \ + $(TESTS_ENVIRONMENT) \ + env VALGRIND=$(VALGRIND) \ + G_SLICE=always-malloc,debug-blocks \ + G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly + +VALGRIND_LOG_COMPILER = \ + $(valgrind_lt) \ + $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) + +define valgrind_tool_rule = +check-valgrind-$(1): $$(BUILT_SOURCES) +ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes) + $$(valgrind_v_use)$$(MAKE) $$(AM_MAKEFLAGS) check-am \ + TESTS_ENVIRONMENT="$$(VALGRIND_TESTS_ENVIRONMENT)" \ + LOG_COMPILER="$$(VALGRIND_LOG_COMPILER)" \ + LOG_FLAGS="$$(valgrind_$(1)_flags)" \ + TEST_SUITE_LOG=test-suite-$(1).log +else ifeq ($$(VALGRIND_ENABLED),yes) + @echo "Need to reconfigure with --enable-valgrind-$(1)" +else + @echo "Need to reconfigure with --enable-valgrind" +endif +endef + +$(foreach tool,$(valgrind_tools),$(eval $(call valgrind_tool_rule,$(tool)))) + +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind + +MOSTLYCLEANFILES ?= +MOSTLYCLEANFILES += $(valgrind_log_files) + +.PHONY: check-valgrind $(add-prefix check-valgrind-,$(valgrind_tools)) +'] + + AC_SUBST([VALGRIND_CHECK_RULES]) + m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])]) +]) diff --git a/m4/includedir.m4 b/m4/includedir.m4 deleted file mode 100644 index dd859bbd..00000000 --- a/m4/includedir.m4 +++ /dev/null @@ -1,23 +0,0 @@ -dnl ### A macro to find the include directory, useful for cross-compiling. -AC_DEFUN([AC_INCLUDEDIR], -[AC_REQUIRE([AC_PROG_AWK])dnl -AC_SUBST(includedir) -AC_MSG_CHECKING(for primary include directory) -includedir=/usr/include -if test -n "$GCC" -then - >conftest.c - new_includedir=` - $CC -v -E conftest.c 2>&1 | $AWK ' - /^End of search list/ { print last; exit } - { last = [$]1 } - ' - ` - rm -f conftest.c - if test -n "$new_includedir" && test -d "$new_includedir" - then - includedir=$new_includedir - fi -fi -AC_MSG_RESULT($includedir) -]) diff --git a/m4/long_long.m4 b/m4/long_long.m4 deleted file mode 100644 index e6d22f0c..00000000 --- a/m4/long_long.m4 +++ /dev/null @@ -1,29 +0,0 @@ -dnl ### A macro to determine endianness of long long -AC_DEFUN([AC_LITTLE_ENDIAN_LONG_LONG], -[AC_MSG_CHECKING(for little endian long long) -AC_CACHE_VAL(ac_cv_have_little_endian_long_long, -[AC_RUN_IFELSE([AC_LANG_SOURCE([[ -int main () { - union { - long long ll; - int l [2]; - } u; - u.ll = 0x12345678; - if (u.l[0] == 0x12345678) - return 0; - return 1; -} -]])],[ac_cv_have_little_endian_long_long=yes],[ac_cv_have_little_endian_long_long=no],[ -if test "x$ac_cv_c_bigendian" = "xyes"; then - ac_cv_have_little_endian_long_long=no -else - ac_cv_have_little_endian_long_long=yes -fi -])]) -AC_MSG_RESULT($ac_cv_have_little_endian_long_long) -if test "$ac_cv_have_little_endian_long_long" = yes -then - AC_DEFINE([HAVE_LITTLE_ENDIAN_LONG_LONG], 1, -[Define if long long is little-endian.]) -fi -]) diff --git a/m4/mpers.m4 b/m4/mpers.m4 new file mode 100644 index 00000000..277a3841 --- /dev/null +++ b/m4/mpers.m4 @@ -0,0 +1,152 @@ +#!/usr/bin/m4 +# +# Copyright (c) 2015-2016 Dmitry V. Levin +# Copyright (c) 2015 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +AC_DEFUN([st_MPERS_LOAD_AC_CV], [ + +pushdef([var], [ac_cv_$1]) +pushdef([saved], [saved_ac_cv_$1]) +pushdef([mpers], [ac_cv_]mpers_name[_$1]) + +AS_IF([test -n "${var+set}"], [saved="${var}"; unset var]) +AS_IF([test -n "${mpers+set}"], [var="${mpers}"]) + +popdef([mpers]) +popdef([saved]) +popdef([var]) + +]) + +AC_DEFUN([st_MPERS_SAVE_AC_CV], [ + +pushdef([var], [ac_cv_$1]) +pushdef([saved], [saved_ac_cv_$1]) +pushdef([mpers], [ac_cv_]mpers_name[_$1]) + +AS_IF([test -n "${var+set}"], [mpers="${var}"]) +AS_IF([test -n "${saved+set}"], [var="${saved}"; unset saved]) + +popdef([mpers]) +popdef([saved]) +popdef([var]) + +]) + +AC_DEFUN([st_MPERS_STRUCT_STAT], [ + +st_MPERS_LOAD_AC_CV([type_struct_stat$1]) +AC_CHECK_TYPE([struct stat$1], + AC_DEFINE([HAVE_]MPERS_NAME[_STRUCT_STAT$1], [1], + [Define to 1 if MPERS_NAME has the type 'struct stat$1'.]),, +[#include +#include ]) +st_MPERS_SAVE_AC_CV([type_struct_stat$1]) + +st_MPERS_LOAD_AC_CV([member_struct_stat$1_st_mtime_nsec]) +AC_CHECK_MEMBER([struct stat$1.st_mtime_nsec], + AC_DEFINE([HAVE_]MPERS_NAME[_STRUCT_STAT$1_ST_MTIME_NSEC], [1], + [Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat$1'.]),, +[#include +#include ]) +st_MPERS_SAVE_AC_CV([member_struct_stat$1_st_mtime_nsec]) + +]) + +AC_DEFUN([st_MPERS],[ + +pushdef([mpers_name], [$1]) +pushdef([MPERS_NAME], translit([$1], [a-z], [A-Z])) +pushdef([HAVE_MPERS], [HAVE_]MPERS_NAME[_MPERS]) +pushdef([HAVE_RUNTIME], [HAVE_]MPERS_NAME[_RUNTIME]) +pushdef([CFLAG], [-$1]) +pushdef([st_cv_cc], [st_cv_$1_cc]) +pushdef([st_cv_runtime], [st_cv_$1_runtime]) +pushdef([st_cv_mpers], [st_cv_$1_mpers]) + +case "$arch" in + [$2]) + AH_TEMPLATE([HAVE_GNU_STUBS_32_H], + [Define to 1 if you have the header file.]) + AH_TEMPLATE([HAVE_GNU_STUBS_X32_H], + [Define to 1 if you have the header file.]) + pushdef([gnu_stubs], [gnu/stubs-][m4_substr([$1], 1)][.h]) + AC_CHECK_HEADERS([gnu_stubs], [IFLAG=], + [mkdir -p gnu + : > gnu_stubs + AC_MSG_NOTICE([Created empty gnu_stubs]) + IFLAG=-I.]) + popdef([gnu_stubs]) + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS CFLAG $IFLAG" + AC_CACHE_CHECK([for CFLAG compile support], [st_cv_cc], + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include + int main(){return 0;}]])], + [st_cv_cc=yes], + [st_cv_cc=no])]) + if test $st_cv_cc = yes; then + AC_CACHE_CHECK([for CFLAG runtime support], [st_cv_runtime], + [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include + int main(){return 0;}]])], + [st_cv_runtime=yes], + [st_cv_runtime=no], + [st_cv_runtime=no])]) + AC_CACHE_CHECK([whether mpers.sh CFLAG works], [st_cv_mpers], + [if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \ + $srcdir/mpers_test.sh [$1]; then + st_cv_mpers=yes + else + st_cv_mpers=no + fi]) + if test $st_cv_mpers = yes; then + AC_DEFINE(HAVE_MPERS, [1], + [Define to 1 if you have CFLAG mpers support]) + st_MPERS_STRUCT_STAT([]) + st_MPERS_STRUCT_STAT([64]) + fi + fi + CFLAGS="$saved_CFLAGS" + ;; + + *) + st_cv_runtime=no + st_cv_mpers=no + ;; +esac + +AM_CONDITIONAL(HAVE_RUNTIME, [test "$st_cv_mpers$st_cv_runtime" = yesyes]) +AM_CONDITIONAL(HAVE_MPERS, [test "$st_cv_mpers" = yes]) + +popdef([st_cv_mpers]) +popdef([st_cv_runtime]) +popdef([st_cv_cc]) +popdef([CFLAG]) +popdef([HAVE_RUNTIME]) +popdef([HAVE_MPERS]) +popdef([MPERS_NAME]) +popdef([mpers_name]) + +]) diff --git a/m4/st_save_restore_var.m4 b/m4/st_save_restore_var.m4 new file mode 100644 index 00000000..2939380a --- /dev/null +++ b/m4/st_save_restore_var.m4 @@ -0,0 +1,7 @@ +AC_DEFUN([st_SAVE_VAR], [dnl +AS_IF([test -n "${$1+set}"], [st_saved_$1="${$1}"; unset $1]) +]) + +AC_DEFUN([st_RESTORE_VAR], [dnl +AS_IF([test -n "${st_saved_$1+set}"], [$1="${st_saved_$1}"; unset st_saved_$1]) +]) diff --git a/m4/st_warn_cflags.m4 b/m4/st_warn_cflags.m4 new file mode 100644 index 00000000..04d45442 --- /dev/null +++ b/m4/st_warn_cflags.m4 @@ -0,0 +1,24 @@ +AC_DEFUN([st_WARN_CFLAGS], [dnl +gl_WARN_ADD([-Wall]) +gl_WARN_ADD([-Wempty-body]) +gl_WARN_ADD([-Wformat-security]) +gl_WARN_ADD([-Wignored-qualifiers]) +gl_WARN_ADD([-Winit-self]) +gl_WARN_ADD([-Wlogical-op]) +gl_WARN_ADD([-Wmissing-parameter-type]) +gl_WARN_ADD([-Wnested-externs]) +gl_WARN_ADD([-Wold-style-declaration]) +gl_WARN_ADD([-Wold-style-definition]) +gl_WARN_ADD([-Wsign-compare]) +gl_WARN_ADD([-Wtype-limits]) +gl_WARN_ADD([-Wwrite-strings]) +AC_ARG_ENABLE([gcc-Werror], + [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])], + [case $enableval in + yes) gl_WARN_ADD([-Werror]) ;; + no) ;; + *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;; + esac] +) +AC_SUBST([WARN_CFLAGS]) +]) diff --git a/m4/stat.m4 b/m4/stat.m4 deleted file mode 100644 index bf0e480e..00000000 --- a/m4/stat.m4 +++ /dev/null @@ -1,16 +0,0 @@ -dnl ### A macro to determine whether stat64 is defined. -AC_DEFUN([AC_STAT64], -[AC_MSG_CHECKING(for stat64 in (asm|sys)/stat.h) -AC_CACHE_VAL(ac_cv_type_stat64, -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[struct stat64 st;]])],[ac_cv_type_stat64=yes],[ac_cv_type_stat64=no])]) -AC_MSG_RESULT($ac_cv_type_stat64) -if test "$ac_cv_type_stat64" = yes -then - AC_DEFINE([HAVE_STAT64], 1, -[Define if stat64 is available in asm/stat.h.]) -fi -]) diff --git a/m4/statfs.m4 b/m4/statfs.m4 deleted file mode 100644 index 1a2f9712..00000000 --- a/m4/statfs.m4 +++ /dev/null @@ -1,15 +0,0 @@ -dnl ### A macro to determine whether statfs64 is defined. -AC_DEFUN([AC_STATFS64], -[AC_MSG_CHECKING(for statfs64 in sys/vfs.h) -AC_CACHE_VAL(ac_cv_type_statfs64, -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])]) -AC_MSG_RESULT($ac_cv_type_statfs64) -if test "$ac_cv_type_statfs64" = yes -then - AC_DEFINE([HAVE_STATFS64], 1, -[Define if statfs64 is available in sys/vfs.h.]) -fi -]) diff --git a/m4/warnings.m4 b/m4/warnings.m4 index dad5c1f2..1917b5b9 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,5 +1,6 @@ -# warnings.m4 serial 2 -dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +# warnings.m4 serial 11 +# modified for strace project +dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,23 +15,69 @@ m4_ifdef([AS_VAR_APPEND], [m4_define([gl_AS_VAR_APPEND], [AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) -# gl_WARN_ADD(PARAMETER, [VARIABLE = WARN_CFLAGS]) -# ------------------------------------------------ -# Adds parameter to WARN_CFLAGS if the compiler supports it. For example, -# gl_WARN_ADD([-Wparentheses]). -AC_DEFUN([gl_WARN_ADD], -[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl -AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [ - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="${CPPFLAGS} $1" - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])], - [AS_VAR_SET([gl_Warn], [yes])], - [AS_VAR_SET([gl_Warn], [no])]) - CPPFLAGS="$save_CPPFLAGS" + +# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED], +# [PROGRAM = AC_LANG_PROGRAM()]) +# ----------------------------------------------------------------- +# Check if the compiler supports OPTION when compiling PROGRAM. +# +# FIXME: gl_Warn must be used unquoted until we can assume Autoconf +# 2.64 or newer. +AC_DEFUN([gl_COMPILER_OPTION_IF], +[AS_VAR_PUSHDEF([gl_Flags], _AC_LANG_PREFIX[]FLAGS)dnl +AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]gl_Flags[]_$1])dnl +AS_LITERAL_IF([$1], + [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], + [gl_positive="$1" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +m4_pushdef([gl_Positive], [$gl_positive])])dnl +AC_CACHE_CHECK([whether $[]_AC_CC[] handles $1], m4_defn([gl_Warn]), [ + gl_save_compiler_FLAGS="$gl_Flags" + gl_AS_VAR_APPEND(m4_defn([gl_Flags]), + [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) + AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], + [AS_VAR_SET(gl_Warn, [yes])], + [AS_VAR_SET(gl_Warn, [no])]) + gl_Flags="$gl_save_compiler_FLAGS" ]) -AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl -AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])]) +AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) +m4_popdef([gl_Positive])dnl AS_VAR_POPDEF([gl_Flags])dnl AS_VAR_POPDEF([gl_Warn])dnl -m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl ]) + +# gl_UNKNOWN_WARNINGS_ARE_ERRORS +# ------------------------------ +# Clang doesn't complain about unknown warning options unless one also +# specifies -Wunknown-warning-option -Werror. Detect this. +AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], +[AS_IF([test x${gl_unknown_warnings_are_errors+set} = x], + [gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], + [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], + [gl_unknown_warnings_are_errors=]) + ]) +]) + +# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS], +# [PROGRAM = AC_LANG_PROGRAM()]) +# --------------------------------------------- +# Adds parameter to WARN_CFLAGS if the compiler supports it when +# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]). +# +# If VARIABLE is a variable name, AC_SUBST it. +AC_DEFUN([gl_WARN_ADD], +[gl_UNKNOWN_WARNINGS_ARE_ERRORS +gl_COMPILER_OPTION_IF([$1], + [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])], + [], + [$3]) +m4_ifval([$2], + [AS_LITERAL_IF([$2], [AC_SUBST([$2])])], + [AC_SUBST([WARN_CFLAGS])])dnl +]) + +# Local Variables: +# mode: autoconf +# End: diff --git a/maint/ioctls_gen.sh b/maint/ioctls_gen.sh new file mode 100755 index 00000000..b20a0bd1 --- /dev/null +++ b/maint/ioctls_gen.sh @@ -0,0 +1,126 @@ +#!/bin/sh +# Copyright (c) 2004-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -efu + +me="${0##*/}" +mydir="${0%/*}" +msg() +{ + printf >&2 '%s\n' "$me: $*" +} + +case $# in + 1) + inc_dir="$1" + arch_dir= + ;; + 2) + inc_dir="$1" + arch_dir="$2" + ;; + *) + echo >&2 "usage: $me include-directory [arch-include-directory]" + exit 1 + ;; +esac + +# Check and canonicalize include-directory and arch-include-directory. +abs_inc_dir="$(cd "$inc_dir" && pwd -P)" +INCLUDES_inc="-I$abs_inc_dir/uapi -I$abs_inc_dir" +abs_arch_dir= +INCLUDES_arch= +[ -z "$arch_dir" ] || { + abs_arch_dir="$(cd "$arch_dir" && pwd -P)" + INCLUDES_arch="-I$abs_arch_dir/uapi -I$abs_arch_dir" +} + +cleanup() +{ + trap - EXIT + rm -f ioctls_hex.h ioctls_sym.h + exit "$@" +} +trap 'cleanup $?' EXIT +trap 'cleanup 1' HUP PIPE INT QUIT TERM + +# Fetch ioctl commands defined in hex form. +{ + "$mydir"/ioctls_hex.sh "$inc_dir" 03 linux/hdreg.h + "$mydir"/ioctls_hex.sh "$inc_dir" 22 scsi/sg.h + "$mydir"/ioctls_hex.sh "$inc_dir" 46 linux/fb.h + "$mydir"/ioctls_hex.sh "$inc_dir" 4B linux/kd.h + "$mydir"/ioctls_hex.sh "$inc_dir" 4C linux/loop.h + "$mydir"/ioctls_hex.sh "$inc_dir" 53 linux/cdrom.h scsi/scsi.h scsi/scsi_ioctl.h + "$mydir"/ioctls_hex.sh "$inc_dir" '\(46\|54\|66\|74\)' asm/ioctls.h asm-generic/ioctls.h + "$mydir"/ioctls_hex.sh "$inc_dir" 56 linux/vt.h + "$mydir"/ioctls_hex.sh "$inc_dir" '7[12]' linux/videotext.h + "$mydir"/ioctls_hex.sh "$inc_dir" 89 asm/sockios.h asm-generic/sockios.h linux/sockios.h + "$mydir"/ioctls_hex.sh "$inc_dir" 8B linux/wireless.h +} > ioctls_hex.h +msg "generated $(grep -c '^{' ioctls_hex.h) hex ioctls from $inc_dir" + +# Fetch ioctl commands defined in symbolic form. +INCLUDES="$INCLUDES_arch ${INCLUDES-}" \ + "$mydir"/ioctls_sym.sh "$inc_dir" > ioctls_sym.h + +# Move KVM_* constants from ioctls_inc.h to ioctls_arch.h. +grep -F 'linux/kvm.h' < ioctls_sym.h > ioctls_kvm.h ||: +grep -Fv 'linux/kvm.h' < ioctls_sym.h > ioctls_unkvm.h +mv ioctls_unkvm.h ioctls_sym.h + +# Part of android ioctl commands are defined elsewhere. +android_dir="$inc_dir/../drivers/staging/android" +if [ -d "$android_dir/uapi" ]; then + INCLUDES="$INCLUDES_inc $INCLUDES_arch ${INCLUDES-}" \ + "$mydir"/ioctls_sym.sh "$android_dir" staging/android >> ioctls_sym.h +fi +msg "generated $(grep -c '^{' ioctls_sym.h) symbolic ioctls from $inc_dir" + +# Output all ioctl definitions fetched from include-directory. +echo "/* Generated by $me from definitions found in ${inc_dir%%/}/ tree. */" > ioctls_inc.h +LC_COLLATE=C sort -u ioctls_hex.h ioctls_sym.h >> ioctls_inc.h +msg "generated $(grep -c '^{' ioctls_inc.h) ioctls from $inc_dir" + +[ -n "$arch_dir" ] || exit 0 + +# Fetch ioctl commands defined in hex form. +{ + "$mydir"/ioctls_hex.sh "$arch_dir" 54 asm/ioctls.h + "$mydir"/ioctls_hex.sh "$arch_dir" '\(46\|54\|66\|74\)' asm/ioctls.h + "$mydir"/ioctls_hex.sh "$arch_dir" 89 asm/sockios.h +} > ioctls_hex.h +msg "generated $(grep -c '^{' ioctls_hex.h) hex ioctls from $arch_dir" + +# Fetch ioctl commands defined in symbolic form. +INCLUDES="$INCLUDES_inc ${INCLUDES-}" \ + "$mydir"/ioctls_sym.sh "$arch_dir" > ioctls_sym.h +msg "generated $(grep -c '^{' ioctls_sym.h) symbolic ioctls from $arch_dir" + +# Output all ioctl definitions fetched from arch-include-directory. +echo "/* Generated by $me from definitions found in ${arch_dir%%/}/ tree. */" > ioctls_arch.h +LC_COLLATE=C sort -u ioctls_hex.h ioctls_kvm.h ioctls_sym.h >> ioctls_arch.h +msg "generated $(grep -c '^{' ioctls_arch.h) ioctls from $arch_dir" diff --git a/maint/ioctls_hex.sh b/maint/ioctls_hex.sh new file mode 100755 index 00000000..a7987333 --- /dev/null +++ b/maint/ioctls_hex.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# Copyright (c) 2001 Wichert Akkerman +# Copyright (c) 2004-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -efu + +me="${0##*/}" + +[ $# -ge 2 ] || { + echo >&2 "usage: $me include-directory type [files...]" + exit 1 +} + +dir="$1"; shift # dir must exist +type="$1"; shift # type might be a regexp + +cd "$dir" + +regexp='[[:space:]]*#[[:space:]]*define[[:space:]]\+\([A-Z][A-Z0-9_]*\)[[:space:]]\+\(0x'"$type"'..\)\>' + +for f; do + grep "^$regexp" "$f" "uapi/$f" 2>/dev/null ||:; +done | + sed 's|^uapi/||' | + sed -n 's/^\([^:]*\):'"$regexp"'.*/{ "\1", "\2", 0, \3, 0 },/p' | + LC_COLLATE=C sort -u diff --git a/maint/ioctls_sym.sh b/maint/ioctls_sym.sh new file mode 100755 index 00000000..14d53c66 --- /dev/null +++ b/maint/ioctls_sym.sh @@ -0,0 +1,435 @@ +#!/bin/sh +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -efu + +# This script processes header files containing ioctl command definitions in +# symbolic form, assuming that these definitions match the following regular +# expressions: + +r_define='^[[:space:]]*#[[:space:]]*define[[:space:]]\+' +r_cmd_name='[A-Z][A-Z0-9_]*' +r_io='\([A-Z]\+\)\?_S\?\(IO\|IOW\|IOR\|IOWR\|IOC\)' +r_value='[[:space:]]\+'"$r_io"'[[:space:]]*([^)]' +regexp="${r_define}${r_cmd_name}${r_value}" + +uname_m="$(uname -m)" +me="${0##*/}" +msg() +{ + printf >&2 '%s\n' "$me: $*" +} + +prefix= +case $# in + 1) inc_dir="$1"; shift + ;; + 2) inc_dir="$1"; shift + prefix="$1"; shift + ;; + *) echo >&2 "usage: $me include-directory [prefix]" + exit 1 + ;; +esac + +[ -z "$prefix" ] || + prefix="${prefix%%/}/" + +tmpdir= +cleanup() +{ + trap - EXIT + [ -z "$tmpdir" ] || + rm -rf -- "$tmpdir" + exit "$@" +} + +trap 'cleanup $?' EXIT +trap 'cleanup 1' HUP PIPE INT QUIT TERM +tmpdir="$(mktemp -dt "$me.XXXXXX")" + +# list interesting files in $inc_dir. +cd "$inc_dir" +inc_dir="$(pwd -P)" +find . -type f -name '*.h' -print0 | + xargs -r0 grep -l "$r_value" -- > "$tmpdir"/headers1.list || + exit 0 +cd - > /dev/null +sed 's|^\./\(uapi/\)\?||' < "$tmpdir"/headers1.list > "$tmpdir"/headers.list +LC_COLLATE=C sort -u -o "$tmpdir"/headers.list "$tmpdir"/headers.list + +msg "processing $(wc -l < "$tmpdir"/headers.list) header files from $inc_dir" +failed=0 + +CC="${CC:-gcc}" +CPP="${CPP:-cpp}" +CPPFLAGS="${CPPFLAGS-} -D__EXPORTED_HEADERS__" +CFLAGS="${CFLAGS:--Wall -O2} -D__EXPORTED_HEADERS__" +LDFLAGS="${LDFLAGS-}" +INCLUDES="-I$inc_dir/uapi -I$inc_dir ${INCLUDES-}" + +$CC $INCLUDES $CFLAGS -c -o "$tmpdir"/print_ioctlent.o "${0%/*}"/print_ioctlent.c + +# Hook onto and +for d in asm-generic asm; do + mkdir "$tmpdir/$d" + cat > "$tmpdir/$d"/ioctl.h <<__EOF__ +#include_next <$d/ioctl.h> +#undef _IOC +#define _IOC(dir,type,nr,size) dir, type, nr, size +__EOF__ +done + +INCLUDES="-I$tmpdir $INCLUDES" + +process_file() +{ + local f="$1"; shift + + # Common code for every processed file. + cat > "$tmpdir"/printents.c <<__EOF__ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifndef NULL +# define NULL ((void*)0) +#endif +#ifndef __user +# define __user +#endif +#ifndef __iomem +# define __iomem +#endif +#ifndef __noreturn +# define __noreturn __attribute__((noreturn)) +#endif +#ifndef __packed +# define __packed __attribute__((packed)) +#endif + +typedef signed char s8; +typedef unsigned char u8; +typedef signed short s16; +typedef unsigned short u16; +typedef signed int s32; +typedef unsigned int u32; +typedef signed long long s64; +typedef unsigned long long u64; + +#include "fixes.h" + +#include +#ifndef BITS_PER_LONG +# define BITS_PER_LONG __BITS_PER_LONG +#endif + +#include "$f" + +void print_ioctlent(const char *, const char *, unsigned short, unsigned short, unsigned short, unsigned short); + +int main(void) +{ + +#include "defs.h" + +return 0; +} +__EOF__ + + # Soft pre-include workarounds for some processed files. Fragile. + case "$f" in + *asm/amigayle.h) + return 0 # false positive + ;; + *asm/cmb.h) + echo '#include ' + ;; + *asm/core_*.h) + return 0 # false positives + ;; + *asm/ioctls.h) + cat <<'__EOF__' +#include +#include +__EOF__ + ;; + drm/sis_drm.h) + echo '#include ' + ;; + *drm/*_drm.h) + echo '#include ' > "$tmpdir/drm.h" + ;; + fbio.h|*/fbio.h) + cat <<'__EOF__' +#include +#undef FBIOGETCMAP +#undef FBIOPUTCMAP +__EOF__ + ;; + *linux/atm_zatm.h) + cat <<'__EOF__' +#include +#ifndef _LINUX_TIME_H +# define _LINUX_TIME_H +#endif +#ifndef _UAPI_LINUX_TIME_H +# define _UAPI_LINUX_TIME_H +#endif +__EOF__ + ;; + *linux/atm?*.h) + echo '#include ' + ;; + *linux/auto_fs*.h) + echo 'typedef u32 compat_ulong_t;' + ;; + *linux/coda.h|*android_alarm.h) + cat <<'__EOF__' +#ifndef _LINUX_TIME_H +# define _LINUX_TIME_H +#endif +#ifndef _UAPI_LINUX_TIME_H +# define _UAPI_LINUX_TIME_H +#endif +__EOF__ + ;; + *linux/fs.h|*linux/ncp_fs.h) + cat <<'__EOF__' +#include +#include +__EOF__ + ;; + *linux/if_pppox.h) + echo '#include ' + ;; + *linux/if_tun.h|*linux/ppp-ioctl.h) + echo '#include ' + ;; + *linux/isdn_ppp.h|*linux/gsmmux.h) + echo '#include ' + ;; + *media*/saa6588.h) + echo 'typedef struct poll_table_struct poll_table;' + ;; + *linux/ivtvfb.h|*linux/meye.h|*media/*.h) + echo '#include ' + ;; + *linux/kvm.h) + case "$uname_m" in + i?86|x86_64|arm*|ppc*|s390*) ;; + *) return 0 ;; # not applicable + esac + ;; + *linux/sonet.h) + echo '#include ' + ;; + *linux/usbdevice_fs.h) + cat <<'__EOF__' +struct usbdevfs_ctrltransfer32 { __u32 unused[4]; }; +struct usbdevfs_bulktransfer32 { __u32 unused[4]; }; +struct usbdevfs_disconnectsignal32 { __u32 unused[2]; }; +struct usbdevfs_urb32 { __u8 unused[42]; }; +struct usbdevfs_ioctl32 { __u32 unused[3]; }; +__EOF__ + ;; + logger.h|*/logger.h) + echo 'typedef __u32 kuid_t;' + ;; + *sound/asequencer.h) + cat <<'__EOF__' +#include +struct snd_seq_queue_owner { __u32 unused[0]; }; +__EOF__ + ;; + *sound/emu10k1.h) + cat <<'__EOF__' +#include +#ifndef DECLARE_BITMAP +# define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) +# define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, 8 * sizeof(long)) +# define DECLARE_BITMAP(name,bits) unsigned long name[BITS_TO_LONGS(bits)] +#endif +__EOF__ + ;; + *video/sstfb.h) + echo 'struct fb_info;' + ;; + *xen/evtchn.h|*xen/gntdev.h) + cat <<'__EOF__' +typedef uint32_t grant_ref_t; +typedef uint16_t domid_t; +__EOF__ + ;; + *xen/interface/*.h) + return 0 # false positives + ;; + *xen/privcmd.h) + return 0 # too much work to make it compileable + ;; + esac > "$tmpdir"/fixes.h + + cat > "$tmpdir"/header.in <<__EOF__ +#include +#ifndef BITS_PER_LONG +# define BITS_PER_LONG __BITS_PER_LONG +#endif +#include "$f" +__EOF__ + + if [ -f "$inc_dir/uapi/$f" ]; then + s="$inc_dir/uapi/$f" + elif [ -f "$inc_dir/$f" ]; then + s="$inc_dir/$f" + else + msg "$f: file not found" + return 1 + fi + + [ -n "${f##*/*}" ] || + mkdir -p "$tmpdir/${f%/*}" + # Hard workarounds for some processed files. Very fragile. + case "$f" in + *asm-generic/ioctls.h) + # Filter out macros defined using unavailable types. + case "$uname_m" in + alpha*|ppc*) + grep -Fv 'struct termios2' < "$s" > "$tmpdir/$f" + ;; + esac + ;; + *acpi/*|*linux/i2o.h|*media*/exynos-fimc.h|*media/v4l2-subdev.h|*net/bluetooth/*|net/nfc/nci_core.h) + # Fetch macros only. + grep "${r_define}${r_cmd_name}" < "$s" > "$tmpdir/$f" + ;; + binder.h|*/binder.h) + # Convert enums to macros. + sed '/^enum binder/,/^};/d' < "$s" > "$tmpdir/$f" + sed -n '/^enum binder/,/^};/ s/^[[:space:]].*/&/p' < "$s" | + sed -e ' +s/^[[:space:]]*\([A-Z][A-Z_0-9]*\)[[:space:]]*=[[:space:]]*_\(IO\|IOW\|IOR\|IOWR\|IOC\)[[:space:]]*(/#define \1 _\2(/ +s/^\(#define .*)\),$/\1/ +s/^\(#define .*,\)$/\1 \\/ +s/^\([[:space:]]\+[^),]\+)\),$/\1/' >> "$tmpdir/$f" + ;; + *drm/r128_drm.h) + # Filter out the code that references unknown types. + sed '/drm_r128_clear2_t/d' < "$s" > "$tmpdir/$f" + ;; + *drm/sis_drm.h) + # Filter out the code that references unknown types. + sed '/^struct sis_file_private/,/^}/d' < "$s" > "$tmpdir/$f" + ;; + *drm/via_drm.h) + # Create the file it attempts to include. + touch "$tmpdir/via_drmclient.h" + # Filter out the code that references unknown types. + sed '/^struct via_file_private/,/^}/d' < "$s" > "$tmpdir/$f" + ;; + *linux/nilfs2_fs.h) + # Create the file it attempts to include. + touch "$tmpdir/asm/bug.h" + ;; + *linux/vmw_vmci_defs.h) + # Fetch ioctl macros only. + grep "${r_define}I" < "$s" > "$tmpdir/$f" + ;; + *media/v4l2-common.h) + # Fetch one piece of code containing ioctls definitions. + sed -n '/ remaining ioctls/,/ ---/p' < "$s" > "$tmpdir/$f" + ;; + openpromio.h|*/openpromio.h|fbio.h|*/fbio.h) + # Create the file it attempts to include. + mkdir -p "$tmpdir/linux" + touch "$tmpdir/linux/compiler.h" + esac + if [ -f "$tmpdir/$f" ]; then + s="$tmpdir/$f" + fi + + # This may fail if the file includes unavailable headers. + # In case of success it outputs both the #define directives + # and the result of preprocessing. + $CPP $CPPFLAGS -dD $INCLUDES < "$tmpdir"/header.in > "$tmpdir"/header.out + + # Soft post-preprocess workarounds. Fragile. + case "$f" in + *linux/kvm.h) + arm_list='KVM_ARM_PREFERRED_TARGET|KVM_ARM_VCPU_INIT' + ppc_list='KVM_ALLOCATE_RMA|KVM_CREATE_SPAPR_TCE|KVM_CREATE_SPAPR_TCE_64|KVM_PPC_GET_HTAB_FD|KVM_PPC_RTAS_DEFINE_TOKEN' + x86_list='KVM_GET_CPUID2|KVM_GET_DEBUGREGS|KVM_GET_EMULATED_CPUID|KVM_GET_LAPIC|KVM_GET_MSRS|KVM_GET_MSR_INDEX_LIST|KVM_GET_PIT|KVM_GET_PIT2|KVM_GET_SUPPORTED_CPUID|KVM_GET_VCPU_EVENTS|KVM_GET_XCRS|KVM_GET_XSAVE|KVM_SET_CPUID|KVM_SET_CPUID2|KVM_SET_DEBUGREGS|KVM_SET_LAPIC|KVM_SET_MEMORY_ALIAS|KVM_SET_MSRS|KVM_SET_PIT|KVM_SET_PIT2|KVM_SET_VCPU_EVENTS|KVM_SET_XCRS|KVM_SET_XSAVE|KVM_X86_SET_MCE|KVM_XEN_HVM_CONFIG' + case "$uname_m" in + arm*) list="$ppc_list|$x86_list" ;; + ppc*) list="$arm_list|$x86_list" ;; + i?86|x86_64*) list="$arm_list|$ppc_list" ;; + *) list="$arm_list|$ppc_list|$x86_list" ;; + esac + sed -r -i "/[[:space:]]($list)[[:space:]]/d" "$tmpdir"/header.out + ;; + esac + + # Need to exclude ioctl commands defined elsewhere. + local_defines='^[[:space:]]*#[[:space:]]*define[[:space:]]\+\('"$r_cmd_name"'\)[[:space:]]' + sed -n 's/'"$local_defines"'.*/\1\\/p' "$s" > "$tmpdir"/local_names + r_local_names="$(tr '\n' '|' < "$tmpdir"/local_names)" + r_local_names="${r_local_names%%|}" + r_local_names="${r_local_names%%\\}" + + # Keep this in sync with $regexp by replacing $r_cmd_name with $r_local_names. + defs_regexp="${r_define}\($r_local_names\)${r_value}" + + qf="$(echo "$prefix$f" | sed 's/[&\/]/\\&/g')" + # This outputs lines in the following format: + # print_ioctlent("filename.h", "IOCTL_CMD_NAME", IOCTL_CMD_NAME); + sed -n 's/'"$defs_regexp"'.*/print_ioctlent("'"$qf"'", "\1", \1);/p' \ + < "$tmpdir"/header.out > "$tmpdir"/defs.h + + # If something is wrong with the file, this will fail. + $CC $INCLUDES $CFLAGS -c -o "$tmpdir"/printents.o "$tmpdir"/printents.c + $CC $LDFLAGS -o "$tmpdir"/print_ioctlents \ + "$tmpdir"/printents.o "$tmpdir"/print_ioctlent.o + "$tmpdir"/print_ioctlents > "$tmpdir"/ioctlents + cat "$tmpdir"/ioctlents + msg "$f: fetched $(grep -c '^{' "$tmpdir"/ioctlents) ioctl entries" +} + +while read f; do + (process_file "$f" < /dev/null) + [ $? -eq 0 ] || { + msg "$f: failed to process" + failed=$((1 + $failed)) + } +done < "$tmpdir"/headers.list + +[ $failed -eq 0 ] || + msg "failed to process $failed file(s)" diff --git a/maint/print_ioctlent.c b/maint/print_ioctlent.c new file mode 100644 index 00000000..d15aa351 --- /dev/null +++ b/maint/print_ioctlent.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +typedef unsigned short u16; + +static const char * +dir2str(const char *name, u16 dir) +{ + switch (dir) { +#define CASE(x) case x: return #x + CASE(_IOC_NONE); + CASE(_IOC_READ); + CASE(_IOC_WRITE); + CASE(_IOC_READ|_IOC_WRITE); + } + + static char buf[3 + sizeof(dir) * 2]; + fprintf(stderr, + "print_ioctlents: WARNING: invalid dir 0x%02x in %s\n", + dir, name); + snprintf(buf, sizeof(buf), "0x%02x", dir); + return buf; +} + +void +print_ioctlent(const char *info, const char *name, + u16 dir, u16 type, u16 nr, u16 size) +{ + unsigned int type_nr = + ((unsigned) type << _IOC_TYPESHIFT) | + ((unsigned) nr << _IOC_NRSHIFT); + + if (dir & ~_IOC_DIRMASK) + fprintf(stderr, + "print_ioctlents: WARNING: dir 0x%02x is out of mask 0x%02x in %s\n", + dir, _IOC_DIRMASK, name); + if (type & ~_IOC_TYPEMASK) + fprintf(stderr, + "print_ioctlents: WARNING: type 0x%02x is out of mask 0x%02x in %s\n", + type, _IOC_TYPEMASK, name); + if (nr & ~_IOC_NRMASK) + fprintf(stderr, + "print_ioctlents: WARNING: nr 0x%02x is out of mask 0x%02x in %s\n", + nr, _IOC_NRMASK, name); + if (size & ~_IOC_SIZEMASK) + fprintf(stderr, + "print_ioctlents: WARNING: size 0x%02x is out of mask 0x%02x in %s\n", + size, _IOC_SIZEMASK, name); + + printf("{ \"%s\", \"%s\", %s, 0x%04x, 0x%02x },\n", + info, name, dir2str(name, dir), type_nr, size); +} diff --git a/mem.c b/mem.c index 6ecd363c..40ed707a 100644 --- a/mem.c +++ b/mem.c @@ -34,8 +34,8 @@ #include #include -static unsigned long -get_pagesize() +unsigned long +get_pagesize(void) { static unsigned long pagesize; @@ -44,46 +44,38 @@ get_pagesize() return pagesize; } -int -sys_brk(struct tcb *tcp) +SYS_FUNC(brk) { - if (entering(tcp)) { - tprintf("%#lx", tcp->u_arg[0]); - } - return RVAL_HEX; + printaddr(tcp->u_arg[0]); + + return RVAL_DECODED | RVAL_HEX; } #include "xlat/mmap_prot.h" #include "xlat/mmap_flags.h" -static int -print_mmap(struct tcb *tcp, long *u_arg, unsigned long long offset) +static void +print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset) { - if (entering(tcp)) { - /* addr */ - if (!u_arg[0]) - tprints("NULL, "); - else - tprintf("%#lx, ", u_arg[0]); - /* len */ - tprintf("%lu, ", u_arg[1]); - /* prot */ - printflags(mmap_prot, u_arg[2], "PROT_???"); - tprints(", "); - /* flags */ + const kernel_ulong_t addr = u_arg[0]; + const kernel_ulong_t len = u_arg[1]; + const kernel_ulong_t prot = u_arg[2]; + const kernel_ulong_t flags = u_arg[3]; + const int fd = u_arg[4]; + + printaddr(addr); + tprintf(", %" PRI_klu ", ", len); + printflags64(mmap_prot, prot, "PROT_???"); + tprints(", "); #ifdef MAP_TYPE - printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???"); - addflags(mmap_flags, u_arg[3] & ~MAP_TYPE); + printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???"); + addflags(mmap_flags, flags & ~MAP_TYPE); #else - printflags(mmap_flags, u_arg[3], "MAP_???"); + printflags64(mmap_flags, flags, "MAP_???"); #endif - tprints(", "); - /* fd */ - printfd(tcp, u_arg[4]); - /* offset */ - tprintf(", %#llx", offset); - } - return RVAL_HEX; + tprints(", "); + printfd(tcp, fd); + tprintf(", %#llx", offset); } /* Syscall name<->function correspondence is messed up on many arches. @@ -94,231 +86,203 @@ print_mmap(struct tcb *tcp, long *u_arg, unsigned long long offset) * Confused? Me too! */ +#if defined AARCH64 || defined ARM \ + || defined I386 || defined X86_64 || defined X32 \ + || defined M68K \ + || defined S390 || defined S390X /* Params are pointed to by u_arg[0], offset is in bytes */ -int -sys_old_mmap(struct tcb *tcp) +SYS_FUNC(old_mmap) { - long u_arg[6]; -#if defined(IA64) - /* - * IA64 processes never call this routine, they only use the - * new 'sys_mmap' interface. Only IA32 processes come here. - */ - int i; - unsigned narrow_arg[6]; - if (umoven(tcp, tcp->u_arg[0], sizeof(narrow_arg), (char *) narrow_arg) == -1) - return 0; + kernel_ulong_t u_arg[6]; +# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + /* We are here only in a 32-bit personality. */ + unsigned int narrow_arg[6]; + if (umove_or_printaddr(tcp, tcp->u_arg[0], &narrow_arg)) + return RVAL_DECODED | RVAL_HEX; + unsigned int i; for (i = 0; i < 6; i++) - u_arg[i] = (unsigned long) narrow_arg[i]; -#elif defined(X86_64) - /* We are here only in personality 1 (i386) */ - int i; - unsigned narrow_arg[6]; - if (umoven(tcp, tcp->u_arg[0], sizeof(narrow_arg), (char *) narrow_arg) == -1) - return 0; - for (i = 0; i < 6; ++i) - u_arg[i] = (unsigned long) narrow_arg[i]; -#else - if (umoven(tcp, tcp->u_arg[0], sizeof(u_arg), (char *) u_arg) == -1) - return 0; -#endif - return print_mmap(tcp, u_arg, (unsigned long) u_arg[5]); + u_arg[i] = narrow_arg[i]; +# else + if (umove_or_printaddr(tcp, tcp->u_arg[0], &u_arg)) + return RVAL_DECODED | RVAL_HEX; +# endif + print_mmap(tcp, u_arg, u_arg[5]); + + return RVAL_DECODED | RVAL_HEX; } +#endif /* old_mmap architectures */ -#if defined(S390) +#ifdef S390 /* Params are pointed to by u_arg[0], offset is in pages */ -int -sys_old_mmap_pgoff(struct tcb *tcp) +SYS_FUNC(old_mmap_pgoff) { - long u_arg[5]; + kernel_ulong_t u_arg[5]; int i; - unsigned narrow_arg[6]; + unsigned int narrow_arg[6]; unsigned long long offset; - if (umoven(tcp, tcp->u_arg[0], sizeof(narrow_arg), (char *) narrow_arg) == -1) - return 0; + if (umove_or_printaddr(tcp, tcp->u_arg[0], &narrow_arg)) + return RVAL_DECODED | RVAL_HEX; for (i = 0; i < 5; i++) - u_arg[i] = (unsigned long) narrow_arg[i]; + u_arg[i] = narrow_arg[i]; offset = narrow_arg[5]; offset *= get_pagesize(); - return print_mmap(tcp, u_arg, offset); + print_mmap(tcp, u_arg, offset); + + return RVAL_DECODED | RVAL_HEX; } -#endif +#endif /* S390 */ /* Params are passed directly, offset is in bytes */ -int -sys_mmap(struct tcb *tcp) +SYS_FUNC(mmap) { - unsigned long long offset = (unsigned long) tcp->u_arg[5]; -#if defined(LINUX_MIPSN32) || defined(X32) - /* Try test/x32_mmap.c */ - offset = tcp->ext_arg[5]; -#endif /* Example of kernel-side handling of this variety of mmap: * arch/x86/kernel/sys_x86_64.c::SYSCALL_DEFINE6(mmap, ...) calls * sys_mmap_pgoff(..., off >> PAGE_SHIFT); i.e. off is in bytes, * since the above code converts off to pages. */ - return print_mmap(tcp, tcp->u_arg, offset); + print_mmap(tcp, tcp->u_arg, tcp->u_arg[5]); + + return RVAL_DECODED | RVAL_HEX; } /* Params are passed directly, offset is in pages */ -int -sys_mmap_pgoff(struct tcb *tcp) +SYS_FUNC(mmap_pgoff) { /* Try test/mmap_offset_decode.c */ unsigned long long offset; - offset = (unsigned long) tcp->u_arg[5]; + offset = tcp->u_arg[5]; offset *= get_pagesize(); - return print_mmap(tcp, tcp->u_arg, offset); + print_mmap(tcp, tcp->u_arg, offset); + + return RVAL_DECODED | RVAL_HEX; } /* Params are passed directly, offset is in 4k units */ -int -sys_mmap_4koff(struct tcb *tcp) +SYS_FUNC(mmap_4koff) { unsigned long long offset; - offset = (unsigned long) tcp->u_arg[5]; + offset = tcp->u_arg[5]; offset <<= 12; - return print_mmap(tcp, tcp->u_arg, offset); + print_mmap(tcp, tcp->u_arg, offset); + + return RVAL_DECODED | RVAL_HEX; } -int -sys_munmap(struct tcb *tcp) +SYS_FUNC(munmap) { - if (entering(tcp)) { - tprintf("%#lx, %lu", - tcp->u_arg[0], tcp->u_arg[1]); - } - return 0; + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu, tcp->u_arg[1]); + + return RVAL_DECODED; +} + +static int +do_mprotect(struct tcb *tcp, bool has_pkey) +{ + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + printflags64(mmap_prot, tcp->u_arg[2], "PROT_???"); + + if (has_pkey) + tprintf(", %d", (int) tcp->u_arg[3]); + + return RVAL_DECODED; } -int -sys_mprotect(struct tcb *tcp) +SYS_FUNC(mprotect) { - if (entering(tcp)) { - tprintf("%#lx, %lu, ", - tcp->u_arg[0], tcp->u_arg[1]); - printflags(mmap_prot, tcp->u_arg[2], "PROT_???"); - } - return 0; + return do_mprotect(tcp, false); +} + +SYS_FUNC(pkey_mprotect) +{ + return do_mprotect(tcp, true); } #include "xlat/mremap_flags.h" -int -sys_mremap(struct tcb *tcp) +SYS_FUNC(mremap) { - if (entering(tcp)) { - tprintf("%#lx, %lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1], - tcp->u_arg[2]); - printflags(mremap_flags, tcp->u_arg[3], "MREMAP_???"); + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", %" PRI_klu ", ", tcp->u_arg[1], tcp->u_arg[2]); + printflags64(mremap_flags, tcp->u_arg[3], "MREMAP_???"); #ifdef MREMAP_FIXED - if ((tcp->u_arg[3] & (MREMAP_MAYMOVE | MREMAP_FIXED)) == - (MREMAP_MAYMOVE | MREMAP_FIXED)) - tprintf(", %#lx", tcp->u_arg[4]); -#endif + if ((tcp->u_arg[3] & (MREMAP_MAYMOVE | MREMAP_FIXED)) == + (MREMAP_MAYMOVE | MREMAP_FIXED)) { + tprints(", "); + printaddr(tcp->u_arg[4]); } - return RVAL_HEX; +#endif + return RVAL_DECODED | RVAL_HEX; } #include "xlat/madvise_cmds.h" -int -sys_madvise(struct tcb *tcp) +SYS_FUNC(madvise) { - if (entering(tcp)) { - tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - printxval(madvise_cmds, tcp->u_arg[2], "MADV_???"); - } - return 0; + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + printxval(madvise_cmds, tcp->u_arg[2], "MADV_???"); + + return RVAL_DECODED; } #include "xlat/mlockall_flags.h" -int -sys_mlockall(struct tcb *tcp) +SYS_FUNC(mlockall) { - if (entering(tcp)) { - printflags(mlockall_flags, tcp->u_arg[0], "MCL_???"); - } - return 0; -} + printflags(mlockall_flags, tcp->u_arg[0], "MCL_???"); -#ifdef MS_ASYNC + return RVAL_DECODED; +} #include "xlat/mctl_sync.h" -int -sys_msync(struct tcb *tcp) +SYS_FUNC(msync) { - if (entering(tcp)) { - /* addr */ - tprintf("%#lx", tcp->u_arg[0]); - /* len */ - tprintf(", %lu, ", tcp->u_arg[1]); - /* flags */ - printflags(mctl_sync, tcp->u_arg[2], "MS_???"); - } - return 0; + /* addr */ + printaddr(tcp->u_arg[0]); + /* len */ + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + /* flags */ + printflags(mctl_sync, tcp->u_arg[2], "MS_???"); + + return RVAL_DECODED; } -#endif /* MS_ASYNC */ - -#ifdef MC_SYNC - -#include "xlat/mctl_funcs.h" -#include "xlat/mctl_lockas.h" +#include "xlat/mlock_flags.h" -int -sys_mctl(struct tcb *tcp) +SYS_FUNC(mlock2) { - int arg, function; + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + printflags(mlock_flags, tcp->u_arg[2], "MLOCK_???"); - if (entering(tcp)) { - /* addr */ - tprintf("%#lx", tcp->u_arg[0]); - /* len */ - tprintf(", %lu, ", tcp->u_arg[1]); - /* function */ - function = tcp->u_arg[2]; - printflags(mctl_funcs, function, "MC_???"); - /* arg */ - arg = tcp->u_arg[3]; - tprints(", "); - switch (function) { - case MC_SYNC: - printflags(mctl_sync, arg, "MS_???"); - break; - case MC_LOCKAS: - printflags(mctl_lockas, arg, "MCL_???"); - break; - default: - tprintf("%#x", arg); - break; - } - } - return 0; + return RVAL_DECODED; } -#endif /* MC_SYNC */ - -int -sys_mincore(struct tcb *tcp) +SYS_FUNC(mincore) { if (entering(tcp)) { - tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); } else { - unsigned long i, len; - char *vec = NULL; - - len = tcp->u_arg[1]; - if (syserror(tcp) || tcp->u_arg[2] == 0 || - (vec = malloc(len)) == NULL || - umoven(tcp, tcp->u_arg[2], len, vec) < 0) - tprintf("%#lx", tcp->u_arg[2]); + const unsigned long page_size = get_pagesize(); + const unsigned long page_mask = page_size - 1; + unsigned long len = tcp->u_arg[1]; + unsigned char *vec = NULL; + + len = len / page_size + (len & page_mask ? 1 : 0); + if (syserror(tcp) || !verbose(tcp) || + !tcp->u_arg[2] || !(vec = malloc(len)) || + umoven(tcp, tcp->u_arg[2], len, vec) < 0) + printaddr(tcp->u_arg[2]); else { + unsigned long i; tprints("["); for (i = 0; i < len; i++) { + if (i) + tprints(", "); if (abbrev(tcp) && i >= max_strlen) { tprints("..."); break; @@ -332,262 +296,59 @@ sys_mincore(struct tcb *tcp) return 0; } -#if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64) -int -sys_getpagesize(struct tcb *tcp) +#if defined ALPHA || defined IA64 || defined M68K \ + || defined SPARC || defined SPARC64 +SYS_FUNC(getpagesize) { - if (exiting(tcp)) - return RVAL_HEX; - return 0; + return RVAL_DECODED | RVAL_HEX; } #endif -int -sys_remap_file_pages(struct tcb *tcp) +SYS_FUNC(remap_file_pages) { - if (entering(tcp)) { - tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - printflags(mmap_prot, tcp->u_arg[2], "PROT_???"); - tprintf(", %lu, ", tcp->u_arg[3]); + const kernel_ulong_t addr = tcp->u_arg[0]; + const kernel_ulong_t size = tcp->u_arg[1]; + const kernel_ulong_t prot = tcp->u_arg[2]; + const kernel_ulong_t pgoff = tcp->u_arg[3]; + const kernel_ulong_t flags = tcp->u_arg[4]; + + printaddr(addr); + tprintf(", %" PRI_klu ", ", size); + printflags64(mmap_prot, prot, "PROT_???"); + tprintf(", %" PRI_klu ", ", pgoff); #ifdef MAP_TYPE - printxval(mmap_flags, tcp->u_arg[4] & MAP_TYPE, "MAP_???"); - addflags(mmap_flags, tcp->u_arg[4] & ~MAP_TYPE); + printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???"); + addflags(mmap_flags, flags & ~MAP_TYPE); #else - printflags(mmap_flags, tcp->u_arg[4], "MAP_???"); + printflags64(mmap_flags, flags, "MAP_???"); #endif - } - return 0; -} -#define MPOL_DEFAULT 0 -#define MPOL_PREFERRED 1 -#define MPOL_BIND 2 -#define MPOL_INTERLEAVE 3 - -#define MPOL_F_NODE (1<<0) -#define MPOL_F_ADDR (1<<1) - -#define MPOL_MF_STRICT (1<<0) -#define MPOL_MF_MOVE (1<<1) -#define MPOL_MF_MOVE_ALL (1<<2) - -#include "xlat/policies.h" -#include "xlat/mbindflags.h" -#include "xlat/mempolicyflags.h" -#include "xlat/move_pages_flags.h" - -static void -get_nodes(struct tcb *tcp, unsigned long ptr, unsigned long maxnodes, int err) -{ - unsigned long nlongs, size, end; - - nlongs = (maxnodes + 8 * sizeof(long) - 1) / (8 * sizeof(long)); - size = nlongs * sizeof(long); - end = ptr + size; - if (nlongs == 0 || ((err || verbose(tcp)) && (size * 8 == maxnodes) - && (end > ptr))) { - unsigned long n, cur, abbrev_end; - int failed = 0; - - if (abbrev(tcp)) { - abbrev_end = ptr + max_strlen * sizeof(long); - if (abbrev_end < ptr) - abbrev_end = end; - } else { - abbrev_end = end; - } - tprints(", {"); - for (cur = ptr; cur < end; cur += sizeof(long)) { - if (cur > ptr) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); - break; - } - if (umoven(tcp, cur, sizeof(n), (char *) &n) < 0) { - tprints("?"); - failed = 1; - break; - } - tprintf("%#0*lx", (int) sizeof(long) * 2 + 2, n); - } - tprints("}"); - if (failed) - tprintf(" %#lx", ptr); - } else - tprintf(", %#lx", ptr); - tprintf(", %lu", maxnodes); + return RVAL_DECODED; } -int -sys_mbind(struct tcb *tcp) +#if defined(POWERPC) +static bool +print_protmap_entry(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - if (entering(tcp)) { - tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - printxval(policies, tcp->u_arg[2], "MPOL_???"); - get_nodes(tcp, tcp->u_arg[3], tcp->u_arg[4], 0); - tprints(", "); - printflags(mbindflags, tcp->u_arg[5], "MPOL_???"); - } - return 0; -} + tprintf("%#08x", * (unsigned int *) elem_buf); -int -sys_set_mempolicy(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(policies, tcp->u_arg[0], "MPOL_???"); - get_nodes(tcp, tcp->u_arg[1], tcp->u_arg[2], 0); - } - return 0; + return true; } -int -sys_get_mempolicy(struct tcb *tcp) +SYS_FUNC(subpage_prot) { - if (exiting(tcp)) { - int pol; - if (tcp->u_arg[0] == 0) - tprints("NULL"); - else if (syserror(tcp) || umove(tcp, tcp->u_arg[0], &pol) < 0) - tprintf("%#lx", tcp->u_arg[0]); - else - printxval(policies, pol, "MPOL_???"); - get_nodes(tcp, tcp->u_arg[1], tcp->u_arg[2], syserror(tcp)); - tprintf(", %#lx, ", tcp->u_arg[3]); - printflags(mempolicyflags, tcp->u_arg[4], "MPOL_???"); - } - return 0; -} + kernel_ulong_t addr = tcp->u_arg[0]; + kernel_ulong_t len = tcp->u_arg[1]; + kernel_ulong_t nmemb = len >> 16; + kernel_ulong_t map = tcp->u_arg[2]; -int -sys_migrate_pages(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]); - get_nodes(tcp, tcp->u_arg[2], tcp->u_arg[1], 0); - tprints(", "); - get_nodes(tcp, tcp->u_arg[3], tcp->u_arg[1], 0); - } - return 0; -} + printaddr(addr); + tprintf(", %" PRI_klu ", ", len); -int -sys_move_pages(struct tcb *tcp) -{ - if (entering(tcp)) { - unsigned long npages = tcp->u_arg[1]; - tprintf("%ld, %lu, ", tcp->u_arg[0], npages); - if (tcp->u_arg[2] == 0) - tprints("NULL, "); - else { - int i; - long puser = tcp->u_arg[2]; - tprints("{"); - for (i = 0; i < npages; ++i) { - void *p; - if (i > 0) - tprints(", "); - if (umove(tcp, puser, &p) < 0) { - tprints("???"); - break; - } - tprintf("%p", p); - puser += sizeof(void *); - } - tprints("}, "); - } - if (tcp->u_arg[3] == 0) - tprints("NULL, "); - else { - int i; - long nodeuser = tcp->u_arg[3]; - tprints("{"); - for (i = 0; i < npages; ++i) { - int node; - if (i > 0) - tprints(", "); - if (umove(tcp, nodeuser, &node) < 0) { - tprints("???"); - break; - } - tprintf("%#x", node); - nodeuser += sizeof(int); - } - tprints("}, "); - } - } - if (exiting(tcp)) { - unsigned long npages = tcp->u_arg[1]; - if (tcp->u_arg[4] == 0) - tprints("NULL, "); - else { - int i; - long statususer = tcp->u_arg[4]; - tprints("{"); - for (i = 0; i < npages; ++i) { - int status; - if (i > 0) - tprints(", "); - if (umove(tcp, statususer, &status) < 0) { - tprints("???"); - break; - } - tprintf("%#x", status); - statususer += sizeof(int); - } - tprints("}, "); - } - printflags(move_pages_flags, tcp->u_arg[5], "MPOL_???"); - } - return 0; -} - -#if defined(POWERPC) -int -sys_subpage_prot(struct tcb *tcp) -{ - if (entering(tcp)) { - unsigned long cur, end, abbrev_end, entries; - unsigned int entry; - - tprintf("%#lx, %#lx, ", tcp->u_arg[0], tcp->u_arg[1]); - entries = tcp->u_arg[1] >> 16; - if (!entries || !tcp->u_arg[2]) { - tprints("{}"); - return 0; - } - cur = tcp->u_arg[2]; - end = cur + (sizeof(int) * entries); - if (!verbose(tcp) || end < tcp->u_arg[2]) { - tprintf("%#lx", tcp->u_arg[2]); - return 0; - } - if (abbrev(tcp)) { - abbrev_end = cur + (sizeof(int) * max_strlen); - if (abbrev_end > end) - abbrev_end = end; - } - else - abbrev_end = end; - tprints("{"); - for (; cur < end; cur += sizeof(int)) { - if (cur > tcp->u_arg[2]) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); - break; - } - if (umove(tcp, cur, &entry) < 0) { - tprintf("??? [%#lx]", cur); - break; - } - else - tprintf("%#08x", entry); - } - tprints("}"); - } + unsigned int entry; + print_array(tcp, map, nmemb, &entry, sizeof(entry), + umoven_or_printaddr, print_protmap_entry, 0); - return 0; + return RVAL_DECODED; } #endif diff --git a/membarrier.c b/membarrier.c new file mode 100644 index 00000000..759b76f3 --- /dev/null +++ b/membarrier.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include "xlat/membarrier_cmds.h" + +SYS_FUNC(membarrier) +{ + if (entering(tcp)) { + int cmd = tcp->u_arg[0], flags = tcp->u_arg[1]; + + printxval(membarrier_cmds, cmd, "MEMBARRIER_CMD_???"); + tprintf(", %d", flags); + + return cmd ? RVAL_DECODED : 0; + } + + if (syserror(tcp) || !tcp->u_rval) + return 0; + + tcp->auxstr = sprintflags("", membarrier_cmds, + (kernel_ulong_t) tcp->u_rval); + return RVAL_HEX | RVAL_STR; +} diff --git a/memfd_create.c b/memfd_create.c new file mode 100644 index 00000000..0101f061 --- /dev/null +++ b/memfd_create.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include "xlat/memfd_create_flags.h" + +SYS_FUNC(memfd_create) +{ + printstr(tcp, tcp->u_arg[0]); + tprints(", "); + printflags(memfd_create_flags, tcp->u_arg[1], "MFD_???"); + + return RVAL_DECODED | RVAL_FD; +} diff --git a/mknod.c b/mknod.c new file mode 100644 index 00000000..3edcd848 --- /dev/null +++ b/mknod.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2006 Ulrich Drepper + * Copyright (c) 2006 Bernhard Kaindl + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include +#include + +static void +decode_mknod(struct tcb *tcp, int offset) +{ + unsigned short mode = tcp->u_arg[offset + 1]; + unsigned int dev; + + printpath(tcp, tcp->u_arg[offset]); + tprints(", "); + print_symbolic_mode_t(mode); + switch (mode & S_IFMT) { + case S_IFCHR: + case S_IFBLK: + dev = tcp->u_arg[offset + 2]; + tprints(", "); + print_dev_t(dev); + break; + } +} + +SYS_FUNC(mknod) +{ + decode_mknod(tcp, 0); + + return RVAL_DECODED; +} + +SYS_FUNC(mknodat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + decode_mknod(tcp, 1); + + return RVAL_DECODED; +} diff --git a/mmsghdr.c b/mmsghdr.c new file mode 100644 index 00000000..c9e6cf0b --- /dev/null +++ b/mmsghdr.c @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2010 Andreas Schwab + * Copyright (c) 2012-2013 Denys Vlasenko + * Copyright (c) 2014 Masatake YAMATO + * Copyright (c) 2010-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "msghdr.h" +#include + +static int +fetch_struct_mmsghdr_or_printaddr(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, void *const mh) +{ + if ((entering(tcp) || !syserror(tcp)) + && fetch_struct_mmsghdr(tcp, addr, mh)) { + return 0; + } else { + printaddr(addr); + return -1; + } +} + +struct print_struct_mmsghdr_config { + const int *p_user_msg_namelen; + unsigned int msg_len_vlen; + unsigned int count; + bool use_msg_len; +}; + +static bool +print_struct_mmsghdr(struct tcb *tcp, void *elem_buf, + size_t elem_size, void *data) +{ + const struct mmsghdr *const mmsg = elem_buf; + struct print_struct_mmsghdr_config *const c = data; + + if (!c->count) { + tprints("..."); + return false; + } + --c->count; + + tprints("{msg_hdr="); + print_struct_msghdr(tcp, &mmsg->msg_hdr, c->p_user_msg_namelen, + c->use_msg_len ? mmsg->msg_len : (kernel_ulong_t) -1); + if (c->msg_len_vlen) { + tprintf(", msg_len=%u", mmsg->msg_len); + --c->msg_len_vlen; + } + tprints("}"); + + if (c->p_user_msg_namelen) + ++c->p_user_msg_namelen; + + return true; +} + +static void +free_mmsgvec_data(void *ptr) +{ + char **pstr = ptr; + free(*pstr); + *pstr = 0; + + free(ptr); +} + +struct mmsgvec_data { + char *timeout; + unsigned int count; + int namelen[IOV_MAX]; +}; + +static void +save_mmsgvec_namelen(struct tcb *const tcp, kernel_ulong_t addr, + unsigned int len, const char *const timeout) +{ + if (len > IOV_MAX) + len = IOV_MAX; + + const size_t data_size = offsetof(struct mmsgvec_data, namelen) + + sizeof(int) * len; + struct mmsgvec_data *const data = xmalloc(data_size); + data->timeout = xstrdup(timeout); + + unsigned int i, fetched; + + for (i = 0; i < len; ++i, addr += fetched) { + struct mmsghdr mh; + + fetched = fetch_struct_mmsghdr(tcp, addr, &mh); + if (!fetched) + break; + data->namelen[i] = mh.msg_hdr.msg_namelen; + } + data->count = i; + + set_tcb_priv_data(tcp, data, free_mmsgvec_data); +} + +static void +decode_mmsgvec(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int vlen, const unsigned int msg_len_vlen, + const bool use_msg_len) +{ + struct mmsghdr mmsg; + struct print_struct_mmsghdr_config c = { + .msg_len_vlen = msg_len_vlen, + .count = IOV_MAX, + .use_msg_len = use_msg_len + }; + const struct mmsgvec_data *const data = get_tcb_priv_data(tcp); + + if (data) { + if (data->count < c.count) + c.count = data->count; + c.p_user_msg_namelen = data->namelen; + } + + print_array(tcp, addr, vlen, &mmsg, sizeof_struct_mmsghdr(), + fetch_struct_mmsghdr_or_printaddr, + print_struct_mmsghdr, &c); +} + +void +dumpiov_in_mmsghdr(struct tcb *const tcp, kernel_ulong_t addr) +{ + unsigned int len = tcp->u_rval; + unsigned int i, fetched; + struct mmsghdr mmsg; + + for (i = 0; i < len; ++i, addr += fetched) { + fetched = fetch_struct_mmsghdr(tcp, addr, &mmsg); + if (!fetched) + break; + tprintf(" = %" PRI_klu " buffers in vector %u\n", + (kernel_ulong_t) mmsg.msg_hdr.msg_iovlen, i); + dumpiov_upto(tcp, mmsg.msg_hdr.msg_iovlen, + ptr_to_kulong(mmsg.msg_hdr.msg_iov), + mmsg.msg_len); + } +} + +SYS_FUNC(sendmmsg) +{ + if (entering(tcp)) { + /* sockfd */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + if (!verbose(tcp)) { + /* msgvec */ + printaddr(tcp->u_arg[1]); + /* vlen */ + tprintf(", %u, ", (unsigned int) tcp->u_arg[2]); + /* flags */ + printflags(msg_flags, tcp->u_arg[3], "MSG_???"); + return RVAL_DECODED; + } + } else { + const unsigned int msg_len_vlen = + syserror(tcp) ? 0 : tcp->u_rval; + /* msgvec */ + temporarily_clear_syserror(tcp); + decode_mmsgvec(tcp, tcp->u_arg[1], tcp->u_arg[2], + msg_len_vlen, false); + restore_cleared_syserror(tcp); + /* vlen */ + tprintf(", %u, ", (unsigned int) tcp->u_arg[2]); + /* flags */ + printflags(msg_flags, tcp->u_arg[3], "MSG_???"); + } + return 0; +} + +SYS_FUNC(recvmmsg) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + if (verbose(tcp)) { + save_mmsgvec_namelen(tcp, tcp->u_arg[1], tcp->u_arg[2], + sprint_timespec(tcp, tcp->u_arg[4])); + } else { + /* msgvec */ + printaddr(tcp->u_arg[1]); + /* vlen */ + tprintf(", %u, ", (unsigned int) tcp->u_arg[2]); + /* flags */ + printflags(msg_flags, tcp->u_arg[3], "MSG_???"); + tprints(", "); + print_timespec(tcp, tcp->u_arg[4]); + } + return 0; + } else { + if (verbose(tcp)) { + /* msgvec */ + decode_mmsgvec(tcp, tcp->u_arg[1], tcp->u_rval, + tcp->u_rval, true); + /* vlen */ + tprintf(", %u, ", (unsigned int) tcp->u_arg[2]); + /* flags */ + printflags(msg_flags, tcp->u_arg[3], "MSG_???"); + tprints(", "); + /* timeout on entrance */ + tprints(*(const char **) get_tcb_priv_data(tcp)); + } + if (syserror(tcp)) + return 0; + if (tcp->u_rval == 0) { + tcp->auxstr = "Timeout"; + return RVAL_STR; + } + if (!verbose(tcp) || !tcp->u_arg[4]) + return 0; + /* timeout on exit */ + static char str[sizeof("left") + TIMESPEC_TEXT_BUFSIZE]; + snprintf(str, sizeof(str), "left %s", + sprint_timespec(tcp, tcp->u_arg[4])); + tcp->auxstr = str; + return RVAL_STR; + } +} diff --git a/mount.c b/mount.c new file mode 100644 index 00000000..997452cc --- /dev/null +++ b/mount.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005 Roland McGrath + * Copyright (c) 2007-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#define MS_MGC_VAL 0xc0ed0000 /* old magic mount flag number */ +#define MS_MGC_MSK 0xffff0000 /* old magic mount flag mask */ + +#include "xlat/mount_flags.h" + +SYS_FUNC(mount) +{ + bool ignore_type = false; + bool ignore_data = false; + bool old_magic = false; + kernel_ulong_t flags = tcp->u_arg[3]; + + /* Discard magic */ + if ((flags & MS_MGC_MSK) == MS_MGC_VAL) { + flags &= ~MS_MGC_MSK; + old_magic = true; + } + + if (flags & MS_REMOUNT) + ignore_type = true; + else if (flags & (MS_BIND | MS_MOVE | MS_SHARED + | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) + ignore_type = ignore_data = true; + + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + + if (ignore_type) + printaddr(tcp->u_arg[2]); + else + printstr(tcp, tcp->u_arg[2]); + tprints(", "); + + if (old_magic) { + tprints("MS_MGC_VAL"); + if (flags) + tprints("|"); + } + if (flags || !old_magic) + printflags64(mount_flags, flags, "MS_???"); + tprints(", "); + + if (ignore_data) + printaddr(tcp->u_arg[4]); + else + printstr(tcp, tcp->u_arg[4]); + + return RVAL_DECODED; +} diff --git a/mpers.am b/mpers.am new file mode 100644 index 00000000..1e3c7506 --- /dev/null +++ b/mpers.am @@ -0,0 +1,2 @@ +# Generated by ./generate_mpers_am.sh; do not edit. +mpers_source_files = block.c btrfs.c dirent.c evdev.c fetch_seccomp_fprog.c fetch_struct_flock.c fetch_struct_mmsghdr.c fetch_struct_msghdr.c fetch_struct_stat.c fetch_struct_stat64.c fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c print_sigevent.c print_time.c print_timespec.c print_timeval.c print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c diff --git a/mpers.awk b/mpers.awk new file mode 100644 index 00000000..2283b966 --- /dev/null +++ b/mpers.awk @@ -0,0 +1,248 @@ +#!/bin/gawk +# +# Copyright (c) 2015 Elvira Khabirova +# Copyright (c) 2015-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +function compare_indices(i1, v1, i2, v2) { + c1 = strtonum(sprintf("%s", i1)) + c2 = strtonum(sprintf("%s", i2)) + if (c1 < c2) + return -1 + return (c1 != c2) +} +function array_get(array_idx, array_member, array_return) +{ + array_return = array[array_idx][array_member] + if ("" == array_return) { + printf("%s: index [%s] without %s\n", + FILENAME, array_idx, array_member) > "/dev/stderr" + exit 1 + } + return array_return +} +function array_seq(array_idx) +{ + if ("seq" in array[array_idx]) + return array[array_idx]["seq"] + index_seq++ + array[array_idx]["seq"] = index_seq + return index_seq +} +function enter(array_idx) +{ + if (array_idx in called) { + printf("%s: index loop detected:", FILENAME) > "/dev/stderr" + for (item in called) + printf(" %s", item) > "/dev/stderr" + print "" > "/dev/stderr" + exit 1 + } + called[array_idx] = 1 +} +function leave(array_idx, to_return) +{ + delete called[array_idx] + return to_return +} +function what_is(what_idx, type_idx, special, item, \ + location, prev_location, prev_returned_size) +{ + enter(what_idx) + special = array_get(what_idx, "special") + switch (special) { + case "base_type": + switch (array_get(what_idx, "encoding")) { + case 5: # signed + printf("int%s_t ", + 8 * array_get(what_idx, "byte_size")) + break + case 7: # unsigned + printf("uint%s_t ", + 8 * array_get(what_idx, "byte_size")) + break + default: # float, signed/unsigned char + printf("%s ", array_get(what_idx, "name")) + break + } + returned_size = array_get(what_idx, "byte_size") + break + case "enumeration_type": + returned_size = array_get(what_idx, "byte_size") + printf("uint%s_t ", 8 * returned_size) + break + case "pointer_type": + printf("mpers_ptr_t ") + returned_size = array_get(what_idx, "byte_size") + break + case "array_type": + type_idx = array_get(what_idx, "type") + what_is(type_idx) + to_return = array[what_idx]["upper_bound"] + if ("" == to_return) + to_return = 0 + returned_size = to_return * returned_size + return leave(what_idx, to_return) + break + case "structure_type": + print "struct {" + prev_location = 0 + location = 0 + returned_size = 0 + prev_returned_size = 0 + for (item in array) { + if ("parent" in array[item] && \ + array_get(item, "parent") == what_idx) { + location = array_get(item, "location") + loc_diff = location - prev_location - \ + prev_returned_size + if (loc_diff != 0) { + printf("unsigned char mpers_%s_%s[%s];\n", + "filler", array_seq(item), loc_diff) + } + prev_location = location + returned = what_is(item) + prev_returned_size = returned_size + printf("%s", array[item]["name"]) + if ("" != returned) { + printf("[%s]", returned) + } + print ";" + } + } + returned_size = array_get(what_idx, "byte_size") + loc_diff = returned_size - prev_location - prev_returned_size + if (loc_diff != 0) { + printf("unsigned char mpers_%s_%s[%s];\n", + "end_filler", array_seq(item), loc_diff) + } + printf("} ATTRIBUTE_PACKED ") + break + case "union_type": + print "union {" + for (item in array) { + if ("parent" in array[item] && \ + array_get(item, "parent") == what_idx) { + returned = what_is(item) + printf("%s", array[item]["name"]) + if ("" != returned) { + printf("[%s]", returned) + } + print ";" + } + } + printf("} ") + returned_size = array_get(what_idx, "byte_size") + break + case "typedef": + type_idx = array_get(what_idx, "type") + return leave(what_idx, what_is(type_idx)) + break + case "member": + type_idx = array_get(what_idx, "type") + return leave(what_idx, what_is(type_idx)) + break + default: + type_idx = array_get(what_idx, "type") + what_is(type_idx) + break + } + return leave(what_idx, "") +} +BEGIN { + match(ARCH_FLAG, /[[:digit:]]+/, temparray) + default_pointer_size = temparray[0] / 8 + print "#include " +} +/^<[[:xdigit:]]+>/ { + match($0, /([[:alnum:]]+)><([[:alnum:]]+)/, matches) + level = matches[1] + idx = "0x" matches[2] + array[idx]["idx"] = idx + parent[level] = idx +} +/^DW_AT_data_member_location/ { + if (!match($0, /\(DW_OP_plus_uconst:[[:space:]]+([[:digit:]]+)\)/, temparray)) + match($0, /([[:digit:]]+)/, temparray) + array[idx]["location"] = temparray[1] +} +/^DW_AT_name/ { + match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \ + temparray) + array[idx]["name"] = temparray[1] +} +/^DW_AT_byte_size/ { + match($0, /[[:digit:]]+/, temparray) + array[idx]["byte_size"] = temparray[0] +} +/^DW_AT_encoding/ { + match($0, /[[:digit:]]+/, temparray) + array[idx]["encoding"] = temparray[0] +} +/^DW_AT_type/ { + match($0, /:[[:space:]]+<(0x[[:xdigit:]]*)>$/, temparray) + array[idx]["type"] = temparray[1] +} +/^DW_AT_upper_bound/ { + match($0, /[[:digit:]]+/, temparray) + array[parent[level-1]]["upper_bound"] = temparray[0] + 1 +} +/^DW_AT_count/ { + match($0, /[[:digit:]]+/, temparray) + array[parent[level-1]]["upper_bound"] = temparray[0] +} +/^Abbrev Number:[^(]+\(DW_TAG_/ { + if (match($0, /typedef|union_type|structure_type|pointer_type\ +|enumeration_type|array_type|base_type|member/, temparray)) { + array[idx]["special"] = temparray[0] + if ("pointer_type" == temparray[0]) + array[idx]["byte_size"] = default_pointer_size + if (level > 1 && "member" == temparray[0]) + array[idx]["parent"] = parent[level-1] + } +} +END { + PROCINFO["sorted_in"] = "compare_indices" + for (item in array) { + if (array[item]["special"] == "pointer_type") { + print "typedef uint" \ + 8 * array_get(item, "byte_size") "_t mpers_ptr_t;" + break + } + } + for (item in array) { + if (array[item]["name"] == VAR_NAME) { + type = array_get(item, "type") + print "typedef" + what_is(type) + name = array_get(type, "name") + print ARCH_FLAG "_" name ";" + print "#define MPERS_" \ + ARCH_FLAG "_" name " " \ + ARCH_FLAG "_" name + break + } + } +} diff --git a/mpers.sh b/mpers.sh new file mode 100755 index 00000000..36913e7d --- /dev/null +++ b/mpers.sh @@ -0,0 +1,74 @@ +#!/bin/sh -e +# +# Copyright (c) 2015 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +export LC_ALL=C + +MPERS_AWK="${0%/*}/mpers.awk" +ARCH_FLAG=$1 +PARSER_FILE=$2 + +CC="${CC-gcc}" +CFLAGS="$CFLAGS -gdwarf-2 -c" +CPP="${CPP-$CC -E}" +CPPFLAGS="$CPPFLAGS -MM -MG" + +VAR_NAME='mpers_target_var' +BITS_DIR="mpers${ARCH_FLAG}" + +mkdir -p ${BITS_DIR} +set -- $(sed -r -n \ + 's/^#[[:space:]]*include[[:space:]]+DEF_MPERS_TYPE\(([^)[:space:]]*)\)$/\1/p' \ + "${PARSER_FILE}") +for m_type; do + f_h="${BITS_DIR}/${m_type}.h" + f_c="${BITS_DIR}/${m_type}.c" + f_i="${BITS_DIR}/${m_type}.i" + f_o="${BITS_DIR}/${m_type}.o" + f_d1="${BITS_DIR}/${m_type}.d1" + f_d2="${BITS_DIR}/${m_type}.d2" + sed -e ' + /DEF_MPERS_TYPE('"${m_type}"')$/n + /DEF_MPERS_TYPE/d + /^[[:space:]]*#[[:space:]]*include[[:space:]]*"xlat\//d + /^#[[:space:]]*include[[:space:]][[:space:]]*MPERS_DEFS$/ {s//'"${m_type} ${VAR_NAME}"';/;q} + ' "${PARSER_FILE}" > "${f_c}" + $CPP $CPPFLAGS "${f_c}" > "${f_i}" + grep -F -q "${m_type}.h" "${f_i}" || + continue + sed -i -e '/DEF_MPERS_TYPE/d' "${f_c}" + $CC $CFLAGS $ARCH_FLAG "${f_c}" -o "${f_o}" + readelf --debug-dump=info "${f_o}" > "${f_d1}" + sed -r -n ' + /^[[:space:]]*<1>/,/^[[:space:]]*<1><[^>]+>: Abbrev Number: 0/!d + /^[[:space:]]*<[^>]*><[^>]*>: Abbrev Number: 0/d + s/^[[:space:]]*<[[:xdigit:]]+>[[:space:]]+// + s/^[[:space:]]*((<[[:xdigit:]]+>){2}):[[:space:]]+/\1\n/ + s/[[:space:]]+$// + p' "${f_d1}" > "${f_d2}" + gawk -v VAR_NAME="$VAR_NAME" -v ARCH_FLAG="${ARCH_FLAG#-}" \ + -f "$MPERS_AWK" "${f_d2}" > "${f_h}" +done diff --git a/mpers_test.sh b/mpers_test.sh new file mode 100755 index 00000000..907460b8 --- /dev/null +++ b/mpers_test.sh @@ -0,0 +1,127 @@ +#!/bin/sh -efu +# +# Copyright (c) 2015 Elvira Khabirova +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +mpers_name="$1"; shift +size="$(printf %s "$mpers_name" |tr -cd '[0-9]')" +[ "$size" -gt 0 ] + +srcdir=${0%/*} +mpers_sh="${srcdir}/mpers.sh" + +mpers_dir="mpers-$mpers_name" +mkdir -p "$mpers_dir" + +sample="$mpers_dir/sample.c" +cat > "$sample" < "$expected" < +typedef uint${size}_t mpers_ptr_t; +typedef +struct { +struct { +mpers_ptr_t p; +char sc; +unsigned char mpers_filler_1[1]; +int16_t ss; +unsigned char uc; +unsigned char mpers_filler_2[3]; +int32_t si; +uint32_t ui; +int${size}_t sl; +uint16_t us; +unsigned char mpers_filler_3[6]; +int64_t sll; +uint64_t ull; +uint${size}_t ul; +int${size}_t asl[3]; +char f; +unsigned char mpers_end_filler_4[7]; +} ATTRIBUTE_PACKED s; +union { +int64_t sll; +uint64_t ull; +mpers_ptr_t p; +int${size}_t sl; +uint${size}_t ul; +int32_t si; +uint32_t ui; +int16_t ss; +uint16_t us; +char sc; +unsigned char uc; +} u[3]; +int16_t f[0]; +} ATTRIBUTE_PACKED ${mpers_name}_sample_struct; +#define MPERS_${mpers_name}_sample_struct ${mpers_name}_sample_struct +EOF + +CFLAGS="$CPPFLAGS -I${srcdir} -DMPERS_IS_${mpers_name}" \ +CPPFLAGS="$CPPFLAGS -I${srcdir} -DIN_MPERS -DMPERS_IS_${mpers_name}" \ +"$mpers_sh" "-$mpers_name" "$sample" +cmp "$expected" "$mpers_dir"/sample_struct.h > /dev/null diff --git a/mpers_type.h b/mpers_type.h new file mode 100644 index 00000000..ac840adb --- /dev/null +++ b/mpers_type.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_MPERS_TYPE_H +#define STRACE_MPERS_TYPE_H + +#ifdef IN_MPERS +# define STRINGIFY(a) #a +# define DEF_MPERS_TYPE(args) STRINGIFY(args.h) +# ifdef MPERS_IS_m32 +# define MPERS_PREFIX m32_ +# define MPERS_DEFS "m32_type_defs.h" +# elif defined MPERS_IS_mx32 +# define MPERS_PREFIX mx32_ +# define MPERS_DEFS "mx32_type_defs.h" +# endif +#else +# define MPERS_PREFIX +# define DEF_MPERS_TYPE(args) "empty.h" +# if IN_MPERS_BOOTSTRAP +# define MPERS_DEFS "empty.h" +# else +# define MPERS_DEFS "native_defs.h" +# endif +#endif + +#endif /* !STRACE_MPERS_TYPE_H */ diff --git a/mpers_xlat.h b/mpers_xlat.h new file mode 100644 index 00000000..52f49641 --- /dev/null +++ b/mpers_xlat.h @@ -0,0 +1,85 @@ +extern const struct xlat blkpg_ops[]; +extern const struct xlat btrfs_balance_args[]; +extern const struct xlat btrfs_balance_ctl_cmds[]; +extern const struct xlat btrfs_balance_flags[]; +extern const struct xlat btrfs_balance_state[]; +extern const struct xlat btrfs_compress_types[]; +extern const struct xlat btrfs_defrag_flags[]; +extern const struct xlat btrfs_dev_replace_cmds[]; +extern const struct xlat btrfs_dev_replace_results[]; +extern const struct xlat btrfs_dev_replace_state[]; +extern const struct xlat btrfs_dev_stats_flags[]; +extern const struct xlat btrfs_dev_stats_values[]; +extern const struct xlat btrfs_features_compat[]; +extern const struct xlat btrfs_features_compat_ro[]; +extern const struct xlat btrfs_features_incompat[]; +extern const struct xlat btrfs_key_types[]; +extern const struct xlat btrfs_qgroup_ctl_cmds[]; +extern const struct xlat btrfs_qgroup_inherit_flags[]; +extern const struct xlat btrfs_qgroup_limit_flags[]; +extern const struct xlat btrfs_qgroup_status_flags[]; +extern const struct xlat btrfs_scrub_flags[]; +extern const struct xlat btrfs_send_flags[]; +extern const struct xlat btrfs_snap_flags_v2[]; +extern const struct xlat btrfs_space_info_flags[]; +extern const struct xlat btrfs_tree_objectids[]; +extern const struct xlat evdev_autorepeat[]; +extern const struct xlat evdev_ff_status[]; +extern const struct xlat evdev_ff_types[]; +extern const struct xlat evdev_keycode[]; +extern const struct xlat evdev_leds[]; +extern const struct xlat evdev_misc[]; +extern const struct xlat evdev_mtslots[]; +extern const struct xlat evdev_prop[]; +extern const struct xlat evdev_relative_axes[]; +extern const struct xlat evdev_snd[]; +extern const struct xlat evdev_switch[]; +extern const struct xlat evdev_sync[]; +extern const struct xlat msgctl_flags[]; +extern const struct xlat shmctl_flags[]; +extern const struct xlat loop_cmds[]; +extern const struct xlat loop_flags_options[]; +extern const struct xlat loop_crypt_type_options[]; +extern const struct xlat mtd_mode_options[]; +extern const struct xlat mtd_file_mode_options[]; +extern const struct xlat mtd_type_options[]; +extern const struct xlat mtd_flags_options[]; +extern const struct xlat mtd_otp_options[]; +extern const struct xlat mtd_nandecc_options[]; +extern const struct xlat mq_attr_flags[]; +extern const struct xlat sigev_value[]; +extern const struct xlat adjtimex_modes[]; +extern const struct xlat adjtimex_status[]; +extern const struct xlat audit_arch[]; +extern const struct xlat sigbus_codes[]; +extern const struct xlat sigchld_codes[]; +extern const struct xlat sigfpe_codes[]; +extern const struct xlat sigill_codes[]; +extern const struct xlat siginfo_codes[]; +extern const struct xlat sigpoll_codes[]; +extern const struct xlat sigprof_codes[]; +extern const struct xlat sigsegv_codes[]; +extern const struct xlat sigsys_codes[]; +extern const struct xlat sigtrap_codes[]; +extern const struct xlat sigemt_codes[]; +extern const struct xlat sg_io_info[]; +extern const struct xlat sg_io_dxfer_direction[]; +extern const struct xlat sg_io_flags[]; +extern const struct xlat sigaltstack_flags[]; +extern const struct xlat iffflags[]; +extern const struct xlat v4l2_device_capabilities_flags[]; +extern const struct xlat v4l2_buf_types[]; +extern const struct xlat v4l2_format_description_flags[]; +extern const struct xlat v4l2_fields[]; +extern const struct xlat v4l2_colorspaces[]; +extern const struct xlat v4l2_memories[]; +extern const struct xlat v4l2_buf_flags[]; +extern const struct xlat v4l2_streaming_capabilities[]; +extern const struct xlat v4l2_capture_modes[]; +extern const struct xlat v4l2_input_types[]; +extern const struct xlat v4l2_control_ids[]; +extern const struct xlat v4l2_control_types[]; +extern const struct xlat v4l2_control_flags[]; +extern const struct xlat v4l2_control_classes[]; +extern const struct xlat v4l2_framesize_types[]; +extern const struct xlat v4l2_frameinterval_types[]; diff --git a/mq.c b/mq.c new file mode 100644 index 00000000..5b46d478 --- /dev/null +++ b/mq.c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2004 Ulrich Drepper + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +SYS_FUNC(mq_open) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + /* flags */ + tprint_open_modes(tcp->u_arg[1]); + if (tcp->u_arg[1] & O_CREAT) { + /* mode */ + tprints(", "); + print_numeric_umode_t(tcp->u_arg[2]); + tprints(", "); + printmqattr(tcp, tcp->u_arg[3], false); + } + return RVAL_DECODED; +} + +SYS_FUNC(mq_timedsend) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu ", %u, ", tcp->u_arg[2], + (unsigned int) tcp->u_arg[3]); + print_timespec(tcp, tcp->u_arg[4]); + return RVAL_DECODED; +} + +SYS_FUNC(mq_timedreceive) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + } else { + if (syserror(tcp)) + printaddr(tcp->u_arg[1]); + else + printstrn(tcp, tcp->u_arg[1], tcp->u_rval); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); + printnum_int(tcp, tcp->u_arg[3], "%u"); + tprintf(", "); + /* + * Since the timeout parameter is read by the kernel + * on entering syscall, it has to be decoded the same way + * whether the syscall has failed or not. + */ + temporarily_clear_syserror(tcp); + print_timespec(tcp, tcp->u_arg[4]); + restore_cleared_syserror(tcp); + } + return 0; +} + +SYS_FUNC(mq_notify) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + print_sigevent(tcp, tcp->u_arg[1]); + return RVAL_DECODED; +} + +SYS_FUNC(mq_getsetattr) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + printmqattr(tcp, tcp->u_arg[1], true); + tprints(", "); + } else { + printmqattr(tcp, tcp->u_arg[2], true); + } + return 0; +} diff --git a/msghdr.c b/msghdr.c new file mode 100644 index 00000000..56ba5498 --- /dev/null +++ b/msghdr.c @@ -0,0 +1,446 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2000 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "msghdr.h" +#include +#include +#include + +#include "xlat/msg_flags.h" +#include "xlat/scmvals.h" +#include "xlat/ip_cmsg_types.h" + +#ifndef current_wordsize +struct cmsghdr32 { + uint32_t cmsg_len; + int cmsg_level; + int cmsg_type; +}; +#endif + +typedef union { + char *ptr; + struct cmsghdr *cmsg; +#ifndef current_wordsize + struct cmsghdr32 *cmsg32; +#endif +} union_cmsghdr; + +static void +print_scm_rights(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const int *fds = cmsg_data; + const unsigned int nfds = data_len / sizeof(*fds); + unsigned int i; + + tprints("["); + + for (i = 0; i < nfds; ++i) { + if (i) + tprints(", "); + if (abbrev(tcp) && i >= max_strlen) { + tprints("..."); + break; + } + printfd(tcp, fds[i]); + } + + tprints("]"); +} + +static void +print_scm_creds(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const struct ucred *uc = cmsg_data; + + tprintf("{pid=%u, uid=%u, gid=%u}", + (unsigned) uc->pid, (unsigned) uc->uid, (unsigned) uc->gid); +} + +static void +print_scm_security(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + print_quoted_string(cmsg_data, data_len, 0); +} + +static void +print_cmsg_ip_pktinfo(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const struct in_pktinfo *info = cmsg_data; + + tprints("{ipi_ifindex="); + print_ifindex(info->ipi_ifindex); + tprintf(", ipi_spec_dst=inet_addr(\"%s\")", + inet_ntoa(info->ipi_spec_dst)); + tprintf(", ipi_addr=inet_addr(\"%s\")}", + inet_ntoa(info->ipi_addr)); +} + +static void +print_cmsg_uint(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const unsigned int *p = cmsg_data; + + tprintf("[%u]", *p); +} + +static void +print_cmsg_uint8_t(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const uint8_t *p = cmsg_data; + + tprintf("[%#x]", *p); +} + +static void +print_cmsg_ip_opts(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const unsigned char *opts = cmsg_data; + unsigned int i; + + tprints("["); + for (i = 0; i < data_len; ++i) { + if (i) + tprints(", "); + if (abbrev(tcp) && i >= max_strlen) { + tprints("..."); + break; + } + tprintf("0x%02x", opts[i]); + } + tprints("]"); +} + +struct sock_ee { + uint32_t ee_errno; + uint8_t ee_origin; + uint8_t ee_type; + uint8_t ee_code; + uint8_t ee_pad; + uint32_t ee_info; + uint32_t ee_data; + struct sockaddr_in offender; +}; + +static void +print_cmsg_ip_recverr(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const struct sock_ee *const err = cmsg_data; + + tprintf("{ee_errno=%u, ee_origin=%u, ee_type=%u, ee_code=%u" + ", ee_info=%u, ee_data=%u, offender=", + err->ee_errno, err->ee_origin, err->ee_type, + err->ee_code, err->ee_info, err->ee_data); + print_sockaddr(tcp, &err->offender, sizeof(err->offender)); + tprints("}"); +} + +static void +print_cmsg_ip_origdstaddr(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + const unsigned int addr_len = + data_len > sizeof(struct sockaddr_storage) + ? sizeof(struct sockaddr_storage) : data_len; + + print_sockaddr(tcp, cmsg_data, addr_len); +} + +typedef void (* const cmsg_printer)(struct tcb *, const void *, unsigned int); + +static const struct { + const cmsg_printer printer; + const unsigned int min_len; +} cmsg_socket_printers[] = { + [SCM_RIGHTS] = { print_scm_rights, sizeof(int) }, + [SCM_CREDENTIALS] = { print_scm_creds, sizeof(struct ucred) }, + [SCM_SECURITY] = { print_scm_security, 1 } +}, cmsg_ip_printers[] = { + [IP_PKTINFO] = { print_cmsg_ip_pktinfo, sizeof(struct in_pktinfo) }, + [IP_TTL] = { print_cmsg_uint, sizeof(unsigned int) }, + [IP_TOS] = { print_cmsg_uint8_t, 1 }, + [IP_RECVOPTS] = { print_cmsg_ip_opts, 1 }, + [IP_RETOPTS] = { print_cmsg_ip_opts, 1 }, + [IP_RECVERR] = { print_cmsg_ip_recverr, sizeof(struct sock_ee) }, + [IP_ORIGDSTADDR] = { print_cmsg_ip_origdstaddr, sizeof(struct sockaddr_in) }, + [IP_CHECKSUM] = { print_cmsg_uint, sizeof(unsigned int) }, + [SCM_SECURITY] = { print_scm_security, 1 } +}; + +static void +print_cmsg_type_data(struct tcb *tcp, const int cmsg_level, const int cmsg_type, + const void *cmsg_data, const unsigned int data_len) +{ + const unsigned int utype = cmsg_type; + switch (cmsg_level) { + case SOL_SOCKET: + printxval(scmvals, cmsg_type, "SCM_???"); + if (utype < ARRAY_SIZE(cmsg_socket_printers) + && cmsg_socket_printers[utype].printer + && data_len >= cmsg_socket_printers[utype].min_len) { + tprints(", cmsg_data="); + cmsg_socket_printers[utype].printer(tcp, cmsg_data, data_len); + } + break; + case SOL_IP: + printxval(ip_cmsg_types, cmsg_type, "IP_???"); + if (utype < ARRAY_SIZE(cmsg_ip_printers) + && cmsg_ip_printers[utype].printer + && data_len >= cmsg_ip_printers[utype].min_len) { + tprints(", cmsg_data="); + cmsg_ip_printers[utype].printer(tcp, cmsg_data, data_len); + } + break; + default: + tprintf("%#x", cmsg_type); + } +} + +static unsigned int +get_optmem_max(void) +{ + static int optmem_max; + + if (!optmem_max) { + if (read_int_from_file("/proc/sys/net/core/optmem_max", + &optmem_max) || optmem_max <= 0) { + optmem_max = sizeof(long long) * (2 * IOV_MAX + 512); + } else { + optmem_max = (optmem_max + sizeof(long long) - 1) + & ~(sizeof(long long) - 1); + } + } + + return optmem_max; +} + +static void +decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t in_control_len) +{ + if (!in_control_len) + return; + tprints(", msg_control="); + + const unsigned int cmsg_size = +#ifndef current_wordsize + (current_wordsize < sizeof(long)) ? sizeof(struct cmsghdr32) : +#endif + sizeof(struct cmsghdr); + + unsigned int control_len = in_control_len > get_optmem_max() + ? get_optmem_max() : in_control_len; + unsigned int buf_len = control_len; + char *buf = buf_len < cmsg_size ? NULL : malloc(buf_len); + if (!buf || umoven(tcp, addr, buf_len, buf) < 0) { + printaddr(addr); + free(buf); + return; + } + + union_cmsghdr u = { .ptr = buf }; + + tprints("["); + while (buf_len >= cmsg_size) { + const kernel_ulong_t cmsg_len = +#ifndef current_wordsize + (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_len : +#endif + u.cmsg->cmsg_len; + const int cmsg_level = +#ifndef current_wordsize + (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_level : +#endif + u.cmsg->cmsg_level; + const int cmsg_type = +#ifndef current_wordsize + (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_type : +#endif + u.cmsg->cmsg_type; + + if (u.ptr != buf) + tprints(", "); + tprintf("{cmsg_len=%" PRI_klu ", cmsg_level=", cmsg_len); + printxval(socketlayers, cmsg_level, "SOL_???"); + tprints(", cmsg_type="); + + kernel_ulong_t len = cmsg_len > buf_len ? buf_len : cmsg_len; + + print_cmsg_type_data(tcp, cmsg_level, cmsg_type, + (const void *) (u.ptr + cmsg_size), + len > cmsg_size ? len - cmsg_size: 0); + tprints("}"); + + if (len < cmsg_size) { + buf_len -= cmsg_size; + break; + } + len = (cmsg_len + current_wordsize - 1) & + ~((kernel_ulong_t) current_wordsize - 1); + if (len >= buf_len) { + buf_len = 0; + break; + } + u.ptr += len; + buf_len -= len; + } + if (buf_len) { + tprints(", "); + printaddr(addr + (control_len - buf_len)); + } else if (control_len < in_control_len) { + tprints(", ..."); + } + tprints("]"); + free(buf); +} + +void +print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg, + const int *const p_user_msg_namelen, + const kernel_ulong_t data_size) +{ + const int msg_namelen = + p_user_msg_namelen && (int) msg->msg_namelen > *p_user_msg_namelen + ? *p_user_msg_namelen : (int) msg->msg_namelen; + + tprints("{msg_name="); + const int family = + decode_sockaddr(tcp, ptr_to_kulong(msg->msg_name), msg_namelen); + const enum iov_decode decode = + (family == AF_NETLINK) ? IOV_DECODE_NETLINK : IOV_DECODE_STR; + + tprints(", msg_namelen="); + if (p_user_msg_namelen && *p_user_msg_namelen != (int) msg->msg_namelen) + tprintf("%d->", *p_user_msg_namelen); + tprintf("%d", msg->msg_namelen); + + tprints(", msg_iov="); + + tprint_iov_upto(tcp, msg->msg_iovlen, + ptr_to_kulong(msg->msg_iov), decode, data_size); + tprintf(", msg_iovlen=%" PRI_klu, (kernel_ulong_t) msg->msg_iovlen); + + decode_msg_control(tcp, ptr_to_kulong(msg->msg_control), + msg->msg_controllen); + tprintf(", msg_controllen=%" PRI_klu, (kernel_ulong_t) msg->msg_controllen); + + tprints(", msg_flags="); + printflags(msg_flags, msg->msg_flags, "MSG_???"); + tprints("}"); +} + +static bool +fetch_msghdr_namelen(struct tcb *const tcp, const kernel_ulong_t addr, + int *const p_msg_namelen) +{ + struct msghdr msg; + + if (addr && verbose(tcp) && fetch_struct_msghdr(tcp, addr, &msg)) { + *p_msg_namelen = msg.msg_namelen; + return true; + } else { + return false; + } +} + +static void +decode_msghdr(struct tcb *const tcp, const int *const p_user_msg_namelen, + const kernel_ulong_t addr, const kernel_ulong_t data_size) +{ + struct msghdr msg; + + if (addr && verbose(tcp) && fetch_struct_msghdr(tcp, addr, &msg)) + print_struct_msghdr(tcp, &msg, p_user_msg_namelen, data_size); + else + printaddr(addr); +} + +void +dumpiov_in_msghdr(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t data_size) +{ + struct msghdr msg; + + if (fetch_struct_msghdr(tcp, addr, &msg)) { + dumpiov_upto(tcp, msg.msg_iovlen, + ptr_to_kulong(msg.msg_iov), data_size); + } +} + +SYS_FUNC(sendmsg) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + decode_msghdr(tcp, 0, tcp->u_arg[1], -1); + /* flags */ + tprints(", "); + printflags(msg_flags, tcp->u_arg[2], "MSG_???"); + + return RVAL_DECODED; +} + +SYS_FUNC(recvmsg) +{ + int msg_namelen; + + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + if (fetch_msghdr_namelen(tcp, tcp->u_arg[1], &msg_namelen)) { + set_tcb_priv_ulong(tcp, msg_namelen); + return 0; + } + printaddr(tcp->u_arg[1]); + } else { + msg_namelen = get_tcb_priv_ulong(tcp); + + if (syserror(tcp)) + tprintf("{msg_namelen=%d}", msg_namelen); + else + decode_msghdr(tcp, &msg_namelen, tcp->u_arg[1], + tcp->u_rval); + } + + /* flags */ + tprints(", "); + printflags(msg_flags, tcp->u_arg[2], "MSG_???"); + + return RVAL_DECODED; +} diff --git a/msghdr.h b/msghdr.h new file mode 100644 index 00000000..9e458fec --- /dev/null +++ b/msghdr.h @@ -0,0 +1,20 @@ +#ifndef STRACE_MSGHDR_H +#define STRACE_MSGHDR_H + +/* For definitions of struct msghdr and struct mmsghdr. */ +# include + +# ifndef HAVE_STRUCT_MMSGHDR +struct mmsghdr { + struct msghdr msg_hdr; + unsigned msg_len; +}; +# endif + +struct tcb; + +extern void +print_struct_msghdr(struct tcb *, const struct msghdr *, + const int *p_user_msg_namelen, kernel_ulong_t data_size); + +#endif /* !STRACE_MSGHDR_H */ diff --git a/mtd.c b/mtd.c index 8ba658b5..954a08b7 100644 --- a/mtd.c +++ b/mtd.c @@ -26,7 +26,9 @@ #include "defs.h" -#include +#include DEF_MPERS_TYPE(struct_mtd_oob_buf) + +#include /* The mtd api changes quickly, so we have to keep a local copy */ #include @@ -35,329 +37,327 @@ #else # include #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) -# include "ubi-user.h" -#else -# include -#endif + +typedef struct mtd_oob_buf struct_mtd_oob_buf; + +#include MPERS_DEFS #include "xlat/mtd_mode_options.h" +#include "xlat/mtd_file_mode_options.h" #include "xlat/mtd_type_options.h" #include "xlat/mtd_flags_options.h" #include "xlat/mtd_otp_options.h" #include "xlat/mtd_nandecc_options.h" -int mtd_ioctl(struct tcb *tcp, long code, long arg) +static void +decode_erase_info_user(struct tcb *const tcp, const kernel_ulong_t addr) { - struct mtd_info_user minfo; struct erase_info_user einfo; - struct erase_info_user64 einfo64; - struct mtd_oob_buf mbuf; - struct mtd_oob_buf64 mbuf64; - struct region_info_user rinfo; - struct otp_info oinfo; - struct mtd_ecc_stats estat; - struct mtd_write_req mreq; - struct nand_oobinfo ninfo; - struct nand_ecclayout_user nlay; - int i, j; - if (entering(tcp)) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &einfo)) + return; - switch (code) { + tprintf("{start=%#x, length=%#x}", einfo.start, einfo.length); +} - case MEMGETINFO: - if (!verbose(tcp) || umove(tcp, arg, &minfo) < 0) - return 0; +static void +decode_erase_info_user64(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct erase_info_user64 einfo64; - tprints(", {type="); - printxval(mtd_type_options, minfo.type, "MTD_???"); - tprints(", flags="); - printflags(mtd_flags_options, minfo.flags, "MTD_???"); - tprintf(", size=%#" PRIx32 ", erasesize=%#" PRIx32, - minfo.size, minfo.erasesize); - tprintf(", writesize=%#" PRIx32 ", oobsize=%#" PRIx32, - minfo.writesize, minfo.oobsize); - tprintf(", padding=%#" PRIx64 "}", - (uint64_t) minfo.padding); - return 1; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &einfo64)) + return; - case MEMERASE: - case MEMLOCK: - case MEMUNLOCK: - case MEMISLOCKED: - if (!verbose(tcp) || umove(tcp, arg, &einfo) < 0) - return 0; + tprintf("{start=%#" PRIx64 ", length=%#" PRIx64 "}", + (uint64_t) einfo64.start, (uint64_t) einfo64.length); +} - tprintf(", {start=%#" PRIx32 ", length=%#" PRIx32 "}", - einfo.start, einfo.length); - return 1; +static void +decode_mtd_oob_buf(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct_mtd_oob_buf mbuf; - case MEMERASE64: - if (!verbose(tcp) || umove(tcp, arg, &einfo64) < 0) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &mbuf)) + return; - tprintf(", {start=%#" PRIx64 ", length=%#" PRIx64 "}", - (uint64_t) einfo64.start, (uint64_t) einfo64.length); - return 1; + tprintf("{start=%#x, length=%#x, ptr=", mbuf.start, mbuf.length); + printaddr(ptr_to_kulong(mbuf.ptr)); + tprints("}"); +} - case MEMWRITEOOB: - case MEMREADOOB: - if (!verbose(tcp) || umove(tcp, arg, &mbuf) < 0) - return 0; +static void +decode_mtd_oob_buf64(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct mtd_oob_buf64 mbuf64; - tprintf(", {start=%#" PRIx32 ", length=%#" PRIx32 ", ptr=...}", - mbuf.start, mbuf.length); - return 1; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &mbuf64)) + return; - case MEMWRITEOOB64: - case MEMREADOOB64: - if (!verbose(tcp) || umove(tcp, arg, &mbuf64) < 0) - return 0; + tprintf("{start=%#" PRIx64 ", length=%#x, usr_ptr=%#" PRIx64 "}", + (uint64_t) mbuf64.start, mbuf64.length, + (uint64_t) mbuf64.usr_ptr); +} - tprintf(", {start=%#" PRIx64 ", length=%#" PRIx64 ", ptr=...}", - (uint64_t) mbuf64.start, (uint64_t) mbuf64.length); - return 1; +static void +decode_otp_info(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct otp_info oinfo; - case MEMGETREGIONINFO: - if (!verbose(tcp) || umove(tcp, arg, &rinfo) < 0) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &oinfo)) + return; - tprintf(", {offset=%#" PRIx32 ", erasesize=%#" PRIx32, - rinfo.offset, rinfo.erasesize); - tprintf(", numblocks=%#" PRIx32 ", regionindex=%#" PRIx32 "}", - rinfo.numblocks, rinfo.regionindex); - return 1; + tprintf("{start=%#x, length=%#x, locked=%u}", + oinfo.start, oinfo.length, oinfo.locked); +} - case MEMGETOOBSEL: - if (!verbose(tcp) || umove(tcp, arg, &ninfo) < 0) - return 0; +static void +decode_otp_select(struct tcb *const tcp, const kernel_ulong_t addr) +{ + unsigned int i; - tprints(", {useecc="); - printxval(mtd_nandecc_options, ninfo.useecc, "MTD_NANDECC_???"); - tprintf(", eccbytes=%#" PRIx32, ninfo.eccbytes); - - tprints(", oobfree={"); - for (i = 0; i < ARRAY_SIZE(ninfo.oobfree); ++i) { - if (i) - tprints("}, "); - tprints("{"); - for (j = 0; j < ARRAY_SIZE(ninfo.oobfree[0]); ++j) { - if (j) - tprints(", "); - tprintf("%#" PRIx32, ninfo.oobfree[i][j]); - } - } + tprints(", "); + if (umove_or_printaddr(tcp, addr, &i)) + return; - tprints("}}, eccpos={"); - for (i = 0; i < ARRAY_SIZE(ninfo.eccpos); ++i) { - if (i) - tprints(", "); - tprintf("%#" PRIx32, ninfo.eccpos[i]); - } + tprints("["); + printxval(mtd_otp_options, i, "MTD_OTP_???"); + tprints("]"); +} - tprints("}"); - return 1; +static void +decode_mtd_write_req(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct mtd_write_req mreq; - case OTPGETREGIONINFO: - case OTPLOCK: - if (!verbose(tcp) || umove(tcp, arg, &oinfo) < 0) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &mreq)) + return; + + tprintf("{start=%#" PRIx64 ", len=%#" PRIx64 + ", ooblen=%#" PRIx64 ", usr_data=%#" PRIx64 + ", usr_oob=%#" PRIx64 ", mode=", + (uint64_t) mreq.start, (uint64_t) mreq.len, + (uint64_t) mreq.ooblen, (uint64_t) mreq.usr_data, + (uint64_t) mreq.usr_oob); + printxval(mtd_mode_options, mreq.mode, "MTD_OPS_???"); + tprints("}"); +} - tprintf(", {start=%#" PRIx32 ", length=%#" PRIx32 ", locked=%" PRIu32 "}", - oinfo.start, oinfo.length, oinfo.locked); - return 1; +static void +decode_mtd_info_user(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct mtd_info_user minfo; - case ECCGETLAYOUT: - if (!verbose(tcp) || umove(tcp, arg, &nlay) < 0) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &minfo)) + return; + + tprints("{type="); + printxval(mtd_type_options, minfo.type, "MTD_???"); + tprints(", flags="); + printflags(mtd_flags_options, minfo.flags, "MTD_???"); + tprintf(", size=%#x, erasesize=%#x, writesize=%#x, oobsize=%#x" + ", padding=%#" PRIx64 "}", + minfo.size, minfo.erasesize, minfo.writesize, minfo.oobsize, + (uint64_t) minfo.padding); +} - tprintf(", {eccbytes=%#" PRIx32 ", eccpos={", nlay.eccbytes); - for (i = 0; i < ARRAY_SIZE(nlay.eccpos); ++i) { - if (i) - tprints(", "); - tprintf("%#" PRIx32, nlay.eccpos[i]); - } - tprintf("}, oobavail=%#" PRIx32 ", oobfree={", nlay.oobavail); - for (i = 0; i < ARRAY_SIZE(nlay.oobfree); ++i) { - if (i) +static void +decode_nand_oobinfo(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct nand_oobinfo ninfo; + unsigned int i, j; + + tprints(", "); + if (umove_or_printaddr(tcp, addr, &ninfo)) + return; + + tprints("{useecc="); + printxval(mtd_nandecc_options, ninfo.useecc, "MTD_NANDECC_???"); + tprintf(", eccbytes=%#x", ninfo.eccbytes); + + tprints(", oobfree={"); + for (i = 0; i < ARRAY_SIZE(ninfo.oobfree); ++i) { + if (i) + tprints("}, "); + tprints("{"); + for (j = 0; j < ARRAY_SIZE(ninfo.oobfree[0]); ++j) { + if (j) tprints(", "); - tprintf("{offset=%#" PRIx32 ", length=%#" PRIx32 "}", - nlay.oobfree[i].offset, nlay.oobfree[i].length); + tprintf("%#x", ninfo.oobfree[i][j]); } - tprints("}"); - return 1; - - case ECCGETSTATS: - if (!verbose(tcp) || umove(tcp, arg, &estat) < 0) - return 0; - - tprintf(", {corrected=%#" PRIx32 ", failed=%#" PRIx32, - estat.corrected, estat.failed); - tprintf(", badblocks=%#" PRIx32 ", bbtblocks=%#" PRIx32 "}", - estat.badblocks, estat.bbtblocks); - return 1; - - case MEMWRITE: - if (!verbose(tcp) || umove(tcp, arg, &mreq) < 0) - return 0; - - tprintf(", {start=%#" PRIx64 ", len=%#" PRIx64, - (uint64_t) mreq.start, (uint64_t) mreq.len); - tprintf(", ooblen=%#" PRIx64 ", usr_data=%#" PRIx64, - (uint64_t) mreq.ooblen, (uint64_t) mreq.usr_data); - tprintf(", usr_oob=%#" PRIx64 ", mode=", - (uint64_t) mreq.usr_oob); - printxval(mtd_mode_options, mreq.mode, "MTD_OPS_???"); - tprints(", padding=...}"); - return 1; - - case OTPSELECT: - if (!verbose(tcp) || umove(tcp, arg, &i) < 0) - return 0; + } - tprints(", ["); - printxval(mtd_otp_options, i, "MTD_OTP_???"); - tprints("]"); - return 1; + tprints("}}, eccpos={"); + for (i = 0; i < ARRAY_SIZE(ninfo.eccpos); ++i) { + if (i) + tprints(", "); + tprintf("%#x", ninfo.eccpos[i]); + } - case MEMGETBADBLOCK: - case MEMSETBADBLOCK: - if (!verbose(tcp)) - return 0; + tprints("}"); +} - tprints(", "); - print_loff_t(tcp, arg); - return 1; +static void +decode_nand_ecclayout_user(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct nand_ecclayout_user nlay; + unsigned int i; - case OTPGETREGIONCOUNT: - if (!verbose(tcp) || umove(tcp, arg, &i) < 0) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &nlay)) + return; - tprintf(", [%d]", i); - return 1; + tprintf("{eccbytes=%#x, eccpos={", nlay.eccbytes); + for (i = 0; i < ARRAY_SIZE(nlay.eccpos); ++i) { + if (i) + tprints(", "); + tprintf("%#x", nlay.eccpos[i]); + } + tprintf("}, oobavail=%#x, oobfree={", nlay.oobavail); + for (i = 0; i < ARRAY_SIZE(nlay.oobfree); ++i) { + if (i) + tprints(", "); + tprintf("{offset=%#x, length=%#x}", + nlay.oobfree[i].offset, nlay.oobfree[i].length); + } + tprints("}"); +} - case MTDFILEMODE: - /* XXX: process return value as enum mtd_file_modes */ +static void +decode_mtd_ecc_stats(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct mtd_ecc_stats es; - case MEMGETREGIONCOUNT: - /* These ones take simple args, so let default printer handle it */ + tprints(", "); + if (umove_or_printaddr(tcp, addr, &es)) + return; - default: - return 0; - } + tprintf("{corrected=%#x, failed=%#x, badblocks=%#x, bbtblocks=%#x}", + es.corrected, es.failed, es.badblocks, es.bbtblocks); } -#include "xlat/ubi_volume_types.h" -#include "xlat/ubi_volume_props.h" - -int ubi_ioctl(struct tcb *tcp, long code, long arg) +MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) { - struct ubi_mkvol_req mkvol; - struct ubi_rsvol_req rsvol; - struct ubi_rnvol_req rnvol; - struct ubi_attach_req attach; - struct ubi_map_req map; - struct ubi_set_vol_prop_req prop; - /* 4*(n-1) + 3 for quotes and NUL */ - char vol_name[(UBI_MAX_VOLUME_NAME + 1) * 4]; - int ret; - - if (entering(tcp)) - return 0; - switch (code) { - case UBI_IOCMKVOL: - if (!verbose(tcp) || umove(tcp, arg, &mkvol) < 0) - return 0; + case MEMERASE: + case MEMLOCK: + case MEMUNLOCK: + case MEMISLOCKED: + decode_erase_info_user(tcp, arg); + break; - tprintf(", {vol_id=%" PRIi32 ", alignment=%" PRIi32 - ", bytes=%" PRIi64 ", vol_type=", mkvol.vol_id, - mkvol.alignment, (int64_t)mkvol.bytes); - printxval(ubi_volume_types, mkvol.vol_type, "UBI_???_VOLUME"); - ret = string_quote(mkvol.name, vol_name, -1, - CLAMP(mkvol.name_len, 0, UBI_MAX_VOLUME_NAME)); - tprintf(", name_len=%" PRIi16 ", name=%s%s", - mkvol.name_len, vol_name, ret ? "..." : ""); - tprints("}"); - return 1; - - case UBI_IOCRSVOL: - if (!verbose(tcp) || umove(tcp, arg, &rsvol) < 0) - return 0; + case MEMERASE64: + decode_erase_info_user64(tcp, arg); + break; - tprintf(", {vol_id=%" PRIi32 ", bytes=%" PRIi64 "}", - rsvol.vol_id, (int64_t)rsvol.bytes); - return 1; + case MEMWRITEOOB: + case MEMREADOOB: + decode_mtd_oob_buf(tcp, arg); + break; - case UBI_IOCRNVOL: { - __s32 c; + case MEMWRITEOOB64: + case MEMREADOOB64: + decode_mtd_oob_buf64(tcp, arg); + break; - if (!verbose(tcp) || umove(tcp, arg, &rnvol) < 0) + case MEMWRITE: + decode_mtd_write_req(tcp, arg); + break; + + case OTPGETREGIONINFO: + if (entering(tcp)) return 0; + /* fall through */ + case OTPLOCK: + decode_otp_info(tcp, arg); + break; - tprintf(", {count=%" PRIi32 ", ents=[", rnvol.count); - for (c = 0; c < CLAMP(rnvol.count, 0, UBI_MAX_RNVOL); ++c) { - if (c) - tprints(", "); - ret = string_quote(rnvol.ents[c].name, vol_name, -1, - CLAMP(rnvol.ents[c].name_len, 0, UBI_MAX_VOLUME_NAME)); - tprintf("{vol_id=%" PRIi32 ", name_len=%" PRIi16 - ", name=%s%s}", rnvol.ents[c].vol_id, - rnvol.ents[c].name_len, vol_name, ret ? "..." : ""); - } - tprints("]}"); - return 1; - } + case OTPSELECT: + decode_otp_select(tcp, arg); + break; - case UBI_IOCVOLUP: { - __s64 bytes; + case MTDFILEMODE: + tprints(", "); + printxval64(mtd_file_mode_options, arg, "MTD_FILE_MODE_???"); + break; - if (!verbose(tcp) || umove(tcp, arg, &bytes) < 0) - return 0; + case MEMGETBADBLOCK: + case MEMSETBADBLOCK: + tprints(", "); + printnum_int64(tcp, arg, "%" PRIu64); + break; - tprintf(", %" PRIi64, (int64_t)bytes); - return 1; - } + case MEMGETINFO: + if (entering(tcp)) + return 0; + decode_mtd_info_user(tcp, arg); + break; - case UBI_IOCATT: - if (!verbose(tcp) || umove(tcp, arg, &attach) < 0) + case MEMGETOOBSEL: + if (entering(tcp)) return 0; + decode_nand_oobinfo(tcp, arg); + break; - tprintf(", {ubi_num=%" PRIi32 ", mtd_num=%" PRIi32 - ", vid_hdr_offset=%" PRIi32 - ", max_beb_per1024=%" PRIi16 "}", - attach.ubi_num, attach.mtd_num, - attach.vid_hdr_offset, attach.max_beb_per1024); - return 1; + case ECCGETLAYOUT: + if (entering(tcp)) + return 0; + decode_nand_ecclayout_user(tcp, arg); + break; - case UBI_IOCEBMAP: - if (!verbose(tcp) || umove(tcp, arg, &map) < 0) + case ECCGETSTATS: + if (entering(tcp)) return 0; + decode_mtd_ecc_stats(tcp, arg); + break; - tprintf(", {lnum=%" PRIi32 ", dtype=%" PRIi8 "}", - map.lnum, map.dtype); - return 1; + case OTPGETREGIONCOUNT: + if (entering(tcp)) + return 0; + tprints(", "); + printnum_int(tcp, arg, "%u"); + break; - case UBI_IOCSETVOLPROP: - if (!verbose(tcp) || umove(tcp, arg, &prop) < 0) + case MEMGETREGIONCOUNT: + if (entering(tcp)) return 0; + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; - tprints(", {property="); - printxval(ubi_volume_props, prop.property, "UBI_VOL_PROP_???"); - tprintf(", value=%#" PRIx64 "}", (uint64_t)prop.value); - return 1; + case MEMGETREGIONINFO: + if (entering(tcp)) { + struct region_info_user rinfo; - case UBI_IOCRMVOL: - case UBI_IOCDET: - case UBI_IOCEBER: - case UBI_IOCEBCH: - case UBI_IOCEBUNMAP: - case UBI_IOCEBISMAP: - /* These ones take simple args, so let default printer handle it */ + tprints(", "); + if (umove_or_printaddr(tcp, arg, &rinfo)) + break; + tprintf("{regionindex=%#x", rinfo.regionindex); + return 0; + } else { + struct region_info_user rinfo; + + if (!syserror(tcp) && !umove(tcp, arg, &rinfo)) + tprintf(", offset=%#x" + ", erasesize=%#x" + ", numblocks=%#x}", + rinfo.offset, + rinfo.erasesize, + rinfo.numblocks); + tprints("}"); + break; + } default: - return 0; + return RVAL_DECODED; } + + return RVAL_DECODED | 1; } diff --git a/native_defs.h b/native_defs.h new file mode 100644 index 00000000..cdc735e0 --- /dev/null +++ b/native_defs.h @@ -0,0 +1,4 @@ +#undef MPERS_PRINTER_NAME +#define MPERS_PRINTER_NAME(printer_name) printer_name + +#include "native_printer_decls.h" diff --git a/net.c b/net.c index 0e6bcce6..314e02ab 100644 --- a/net.c +++ b/net.c @@ -31,12 +31,8 @@ #include "defs.h" #include #include +#include #include -#if defined(HAVE_SIN6_SCOPE_ID_LINUX) -# define in6_addr in6_addr_libc -# define ipv6_mreq ipv6_mreq_libc -# define sockaddr_in6 sockaddr_in6_libc -#endif #include #ifdef HAVE_NETINET_TCP_H # include @@ -50,448 +46,83 @@ #include #include #include -#if defined(__GLIBC__) +#ifdef HAVE_NETIPX_IPX_H # include #else # include #endif -#if defined(__GLIBC__) && defined(HAVE_SIN6_SCOPE_ID_LINUX) -# if defined(HAVE_LINUX_IN6_H) -# if defined(HAVE_SIN6_SCOPE_ID_LINUX) -# undef in6_addr -# undef ipv6_mreq -# undef sockaddr_in6 -# define in6_addr in6_addr_kernel -# define ipv6_mreq ipv6_mreq_kernel -# define sockaddr_in6 sockaddr_in6_kernel -# endif -# include -# if defined(HAVE_SIN6_SCOPE_ID_LINUX) -# undef in6_addr -# undef ipv6_mreq -# undef sockaddr_in6 -# define in6_addr in6_addr_libc -# define ipv6_mreq ipv6_mreq_libc -# define sockaddr_in6 sockaddr_in6_kernel -# endif -# endif -#endif - -#if defined(HAVE_SYS_UIO_H) -# include +#if defined(HAVE_LINUX_IP_VS_H) +# include #endif -#if defined(HAVE_LINUX_NETLINK_H) -# include +#include +#if defined(HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H) +# include #endif -#if defined(HAVE_LINUX_IF_PACKET_H) -# include +#if defined(HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H) +# include #endif -#if defined(HAVE_LINUX_ICMP_H) -# include +#if defined(HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H) +# include #endif -#ifndef PF_UNSPEC -# define PF_UNSPEC AF_UNSPEC +#if defined(HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H) +# include #endif +#include +#include -#include "xlat/domains.h" -#include "xlat/addrfams.h" #include "xlat/socktypes.h" #include "xlat/sock_type_flags.h" #ifndef SOCK_TYPE_MASK # define SOCK_TYPE_MASK 0xf #endif + #include "xlat/socketlayers.h" -/*** WARNING: DANGER WILL ROBINSON: NOTE "socketlayers" array above - falls into "inet_protocols" array below!!!! This is intended!!! ***/ -#include "xlat/inet_protocols.h" -#ifdef PF_NETLINK +#include "xlat/inet_protocols.h" #include "xlat/netlink_protocols.h" -#endif - -#include "xlat/msg_flags.h" -#include "xlat/sockoptions.h" - -#if !defined(SOL_IP) && defined(IPPROTO_IP) -#define SOL_IP IPPROTO_IP -#endif - -#ifdef SOL_IP -#include "xlat/sockipoptions.h" -#endif /* SOL_IP */ - -#ifdef SOL_IPV6 -#include "xlat/sockipv6options.h" -#endif /* SOL_IPV6 */ -#ifdef SOL_IPX -#include "xlat/sockipxoptions.h" -#endif /* SOL_IPX */ - -#ifdef SOL_RAW -#include "xlat/sockrawoptions.h" -#endif /* SOL_RAW */ - -#ifdef SOL_PACKET -#include "xlat/sockpacketoptions.h" -#endif /* SOL_PACKET */ - -#ifdef SOL_SCTP -#include "xlat/socksctpoptions.h" -#endif - -#if !defined(SOL_TCP) && defined(IPPROTO_TCP) -#define SOL_TCP IPPROTO_TCP +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include "xlat/bt_protocols.h" #endif -#ifdef SOL_TCP -#include "xlat/socktcpoptions.h" -#endif /* SOL_TCP */ - -#ifdef SOL_RAW -#include "xlat/icmpfilterflags.h" -#endif /* SOL_RAW */ - -#if defined(AF_PACKET) /* from e.g. linux/if_packet.h */ -#include "xlat/af_packet_types.h" -#endif /* defined(AF_PACKET) */ - void -printsock(struct tcb *tcp, long addr, int addrlen) +print_ifindex(unsigned int ifindex) { - union { - char pad[128]; - struct sockaddr sa; - struct sockaddr_in sin; - struct sockaddr_un sau; -#ifdef HAVE_INET_NTOP - struct sockaddr_in6 sa6; -#endif -#if defined(AF_IPX) - struct sockaddr_ipx sipx; -#endif -#ifdef AF_PACKET - struct sockaddr_ll ll; -#endif -#ifdef AF_NETLINK - struct sockaddr_nl nl; -#endif - } addrbuf; - char string_addr[100]; - - if (addr == 0) { - tprints("NULL"); - return; - } - if (!verbose(tcp)) { - tprintf("%#lx", addr); - return; - } - - if (addrlen < 2 || addrlen > sizeof(addrbuf)) - addrlen = sizeof(addrbuf); +#ifdef HAVE_IF_INDEXTONAME + char buf[IFNAMSIZ + 1]; - memset(&addrbuf, 0, sizeof(addrbuf)); - if (umoven(tcp, addr, addrlen, addrbuf.pad) < 0) { - tprints("{...}"); + if (if_indextoname(ifindex, buf)) { + tprints("if_nametoindex("); + print_quoted_string(buf, sizeof(buf), QUOTE_0_TERMINATED); + tprints(")"); return; } - addrbuf.pad[sizeof(addrbuf.pad) - 1] = '\0'; - - tprints("{sa_family="); - printxval(addrfams, addrbuf.sa.sa_family, "AF_???"); - tprints(", "); - - switch (addrbuf.sa.sa_family) { - case AF_UNIX: - if (addrlen == 2) { - tprints("NULL"); - } else if (addrbuf.sau.sun_path[0]) { - tprints("sun_path="); - printpathn(tcp, addr + 2, strlen(addrbuf.sau.sun_path)); - } else { - tprints("sun_path=@"); - printpathn(tcp, addr + 3, strlen(addrbuf.sau.sun_path + 1)); - } - break; - case AF_INET: - tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")", - ntohs(addrbuf.sin.sin_port), inet_ntoa(addrbuf.sin.sin_addr)); - break; -#ifdef HAVE_INET_NTOP - case AF_INET6: - inet_ntop(AF_INET6, &addrbuf.sa6.sin6_addr, string_addr, sizeof(string_addr)); - tprintf("sin6_port=htons(%u), inet_pton(AF_INET6, \"%s\", &sin6_addr), sin6_flowinfo=%u", - ntohs(addrbuf.sa6.sin6_port), string_addr, - addrbuf.sa6.sin6_flowinfo); -#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID - { -#if defined(HAVE_IF_INDEXTONAME) && defined(IN6_IS_ADDR_LINKLOCAL) && defined(IN6_IS_ADDR_MC_LINKLOCAL) - int numericscope = 0; - if (IN6_IS_ADDR_LINKLOCAL(&addrbuf.sa6.sin6_addr) - || IN6_IS_ADDR_MC_LINKLOCAL(&addrbuf.sa6.sin6_addr)) { - char scopebuf[IFNAMSIZ + 1]; - - if (if_indextoname(addrbuf.sa6.sin6_scope_id, scopebuf) == NULL) - numericscope++; - else - tprintf(", sin6_scope_id=if_nametoindex(\"%s\")", scopebuf); - } else - numericscope++; - - if (numericscope) -#endif - tprintf(", sin6_scope_id=%u", addrbuf.sa6.sin6_scope_id); - } -#endif - break; #endif -#if defined(AF_IPX) - case AF_IPX: - { - int i; - tprintf("sipx_port=htons(%u), ", - ntohs(addrbuf.sipx.sipx_port)); - /* Yes, I know, this does not look too - * strace-ish, but otherwise the IPX - * addresses just look monstrous... - * Anyways, feel free if you don't like - * this way.. :) - */ - tprintf("%08lx:", (unsigned long)ntohl(addrbuf.sipx.sipx_network)); - for (i = 0; i < IPX_NODE_LEN; i++) - tprintf("%02x", addrbuf.sipx.sipx_node[i]); - tprintf("/[%02x]", addrbuf.sipx.sipx_type); - } - break; -#endif /* AF_IPX */ -#ifdef AF_PACKET - case AF_PACKET: - { - int i; - tprintf("proto=%#04x, if%d, pkttype=", - ntohs(addrbuf.ll.sll_protocol), - addrbuf.ll.sll_ifindex); - printxval(af_packet_types, addrbuf.ll.sll_pkttype, "?"); - tprintf(", addr(%d)={%d, ", - addrbuf.ll.sll_halen, - addrbuf.ll.sll_hatype); - for (i = 0; i < addrbuf.ll.sll_halen; i++) - tprintf("%02x", addrbuf.ll.sll_addr[i]); - } - break; - -#endif /* AF_PACKET */ -#ifdef AF_NETLINK - case AF_NETLINK: - tprintf("pid=%d, groups=%08x", addrbuf.nl.nl_pid, addrbuf.nl.nl_groups); - break; -#endif /* AF_NETLINK */ - /* AF_AX25 AF_APPLETALK AF_NETROM AF_BRIDGE AF_AAL5 - AF_X25 AF_ROSE etc. still need to be done */ - - default: - tprints("sa_data="); - printstr(tcp, (long) &((struct sockaddr *) addr)->sa_data, - sizeof addrbuf.sa.sa_data); - break; - } - tprints("}"); -} - -#if HAVE_SENDMSG -#include "xlat/scmvals.h" - -static void -printcmsghdr(struct tcb *tcp, unsigned long addr, unsigned long len) -{ - struct cmsghdr *cmsg = len < sizeof(struct cmsghdr) ? - NULL : malloc(len); - if (cmsg == NULL || umoven(tcp, addr, len, (char *) cmsg) < 0) { - tprintf(", msg_control=%#lx", addr); - free(cmsg); - return; - } - - tprintf(", {cmsg_len=%u, cmsg_level=", (unsigned) cmsg->cmsg_len); - printxval(socketlayers, cmsg->cmsg_level, "SOL_???"); - tprints(", cmsg_type="); - - if (cmsg->cmsg_level == SOL_SOCKET) { - unsigned long cmsg_len; - - printxval(scmvals, cmsg->cmsg_type, "SCM_???"); - cmsg_len = (len < cmsg->cmsg_len) ? len : cmsg->cmsg_len; - - if (cmsg->cmsg_type == SCM_RIGHTS - && CMSG_LEN(sizeof(int)) <= cmsg_len) { - int *fds = (int *) CMSG_DATA(cmsg); - int first = 1; - - tprints(", {"); - while ((char *) fds < ((char *) cmsg + cmsg_len)) { - if (!first) - tprints(", "); - printfd(tcp, *fds++); - first = 0; - } - tprints("}}"); - free(cmsg); - return; - } - if (cmsg->cmsg_type == SCM_CREDENTIALS - && CMSG_LEN(sizeof(struct ucred)) <= cmsg_len) { - struct ucred *uc = (struct ucred *) CMSG_DATA(cmsg); - - tprintf("{pid=%ld, uid=%ld, gid=%ld}}", - (long)uc->pid, (long)uc->uid, (long)uc->gid); - free(cmsg); - return; - } - } - free(cmsg); - tprints(", ...}"); -} - -static void -do_msghdr(struct tcb *tcp, struct msghdr *msg, unsigned long data_size) -{ - tprintf("{msg_name(%d)=", msg->msg_namelen); - printsock(tcp, (long)msg->msg_name, msg->msg_namelen); - - tprintf(", msg_iov(%lu)=", (unsigned long)msg->msg_iovlen); - tprint_iov_upto(tcp, (unsigned long)msg->msg_iovlen, - (unsigned long)msg->msg_iov, 1, data_size); - -#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL - tprintf(", msg_controllen=%lu", (unsigned long)msg->msg_controllen); - if (msg->msg_controllen) - printcmsghdr(tcp, (unsigned long) msg->msg_control, - msg->msg_controllen); - tprints(", msg_flags="); - printflags(msg_flags, msg->msg_flags, "MSG_???"); -#else /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */ - tprintf("msg_accrights=%#lx, msg_accrightslen=%u", - (unsigned long) msg->msg_accrights, msg->msg_accrightslen); -#endif /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */ - tprints("}"); + tprintf("%u", ifindex); } -struct msghdr32 { - uint32_t /* void* */ msg_name; - uint32_t /* socklen_t */msg_namelen; - uint32_t /* iovec* */ msg_iov; - uint32_t /* size_t */ msg_iovlen; - uint32_t /* void* */ msg_control; - uint32_t /* size_t */ msg_controllen; - uint32_t /* int */ msg_flags; -}; -struct mmsghdr32 { - struct msghdr32 msg_hdr; - uint32_t /* unsigned */ msg_len; -}; - static void -printmsghdr(struct tcb *tcp, long addr, unsigned long data_size) +decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr, + const kernel_ulong_t addrlen) { - struct msghdr msg; - -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize == 4) { - struct msghdr32 msg32; - - if (umove(tcp, addr, &msg32) < 0) { - tprintf("%#lx", addr); - return; - } - msg.msg_name = (void*)(long)msg32.msg_name; - msg.msg_namelen = msg32.msg_namelen; - msg.msg_iov = (void*)(long)msg32.msg_iov; - msg.msg_iovlen = msg32.msg_iovlen; - msg.msg_control = (void*)(long)msg32.msg_control; - msg.msg_controllen = msg32.msg_controllen; - msg.msg_flags = msg32.msg_flags; - } else -#endif - if (umove(tcp, addr, &msg) < 0) { - tprintf("%#lx", addr); - return; - } - do_msghdr(tcp, &msg, data_size); -} -static void -printmmsghdr(struct tcb *tcp, long addr, unsigned int idx, unsigned long msg_len) -{ - struct mmsghdr { - struct msghdr msg_hdr; - unsigned msg_len; - } mmsg; - -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize == 4) { - struct mmsghdr32 mmsg32; - - addr += sizeof(mmsg32) * idx; - if (umove(tcp, addr, &mmsg32) < 0) { - tprintf("%#lx", addr); - return; - } - mmsg.msg_hdr.msg_name = (void*)(long)mmsg32.msg_hdr.msg_name; - mmsg.msg_hdr.msg_namelen = mmsg32.msg_hdr.msg_namelen; - mmsg.msg_hdr.msg_iov = (void*)(long)mmsg32.msg_hdr.msg_iov; - mmsg.msg_hdr.msg_iovlen = mmsg32.msg_hdr.msg_iovlen; - mmsg.msg_hdr.msg_control = (void*)(long)mmsg32.msg_hdr.msg_control; - mmsg.msg_hdr.msg_controllen = mmsg32.msg_hdr.msg_controllen; - mmsg.msg_hdr.msg_flags = mmsg32.msg_hdr.msg_flags; - mmsg.msg_len = mmsg32.msg_len; - } else -#endif - { - addr += sizeof(mmsg) * idx; - if (umove(tcp, addr, &mmsg) < 0) { - tprintf("%#lx", addr); - return; - } + switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) { + case SOCK_PROTO_NETLINK: + decode_netlink(tcp, addr, addrlen); + break; + default: + printstrn(tcp, addr, addrlen); } - tprints("{"); - do_msghdr(tcp, &mmsg.msg_hdr, msg_len ? msg_len : mmsg.msg_len); - tprintf(", %u}", mmsg.msg_len); } -static void -decode_mmsg(struct tcb *tcp, unsigned long msg_len) -{ - /* mmsgvec */ - if (syserror(tcp)) { - tprintf("%#lx", tcp->u_arg[1]); - } else { - unsigned int len = tcp->u_rval; - unsigned int i; - - tprints("{"); - for (i = 0; i < len; ++i) { - if (i) - tprints(", "); - printmmsghdr(tcp, tcp->u_arg[1], i, msg_len); - } - tprints("}"); - } - /* vlen */ - tprintf(", %u, ", (unsigned int) tcp->u_arg[2]); - /* flags */ - printflags(msg_flags, tcp->u_arg[3], "MSG_???"); -} - -#endif /* HAVE_SENDMSG */ - /* * low bits of the socket type define real socket type, * other bits are socket type flags. */ static void -tprint_sock_type(struct tcb *tcp, int flags) +tprint_sock_type(unsigned int flags) { const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK); @@ -505,359 +136,259 @@ tprint_sock_type(struct tcb *tcp, int flags) printflags(sock_type_flags, flags, "SOCK_???"); } -int -sys_socket(struct tcb *tcp) +SYS_FUNC(socket) { - if (entering(tcp)) { - printxval(domains, tcp->u_arg[0], "PF_???"); - tprints(", "); - tprint_sock_type(tcp, tcp->u_arg[1]); - tprints(", "); - switch (tcp->u_arg[0]) { - case PF_INET: -#ifdef PF_INET6 - case PF_INET6: -#endif - printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???"); - break; -#ifdef PF_IPX - case PF_IPX: - /* BTW: I don't believe this.. */ - tprints("["); - printxval(domains, tcp->u_arg[2], "PF_???"); - tprints("]"); - break; -#endif /* PF_IPX */ -#ifdef PF_NETLINK - case PF_NETLINK: - printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???"); - break; + printxval(addrfams, tcp->u_arg[0], "AF_???"); + tprints(", "); + tprint_sock_type(tcp->u_arg[1]); + tprints(", "); + switch (tcp->u_arg[0]) { + case AF_INET: + case AF_INET6: + printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???"); + break; + + case AF_NETLINK: + printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???"); + break; + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + case AF_BLUETOOTH: + printxval(bt_protocols, tcp->u_arg[2], "BTPROTO_???"); + break; #endif - default: - tprintf("%lu", tcp->u_arg[2]); - break; - } + + default: + tprintf("%" PRI_klu, tcp->u_arg[2]); + break; } - return 0; + + return RVAL_DECODED | RVAL_FD; } -int -sys_bind(struct tcb *tcp) +SYS_FUNC(bind) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printsock(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu", tcp->u_arg[2]); - } - return 0; + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + const int addrlen = tcp->u_arg[2]; + decode_sockaddr(tcp, tcp->u_arg[1], addrlen); + tprintf(", %d", addrlen); + + return RVAL_DECODED; } -int -sys_connect(struct tcb *tcp) +SYS_FUNC(listen) { - return sys_bind(tcp); + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + tprintf("%" PRI_klu, tcp->u_arg[1]); + + return RVAL_DECODED; } -int -sys_listen(struct tcb *tcp) +static bool +fetch_socklen(struct tcb *const tcp, int *const plen, + const kernel_ulong_t sockaddr, const kernel_ulong_t socklen) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - tprintf("%lu", tcp->u_arg[1]); - } - return 0; + return verbose(tcp) && sockaddr && socklen + && umove(tcp, socklen, plen) == 0; } static int -do_sockname(struct tcb *tcp, int flags_arg) +decode_sockname(struct tcb *tcp) { + int ulen, rlen; + if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - return 0; - } - if (!tcp->u_arg[2]) - tprintf("%#lx, NULL", tcp->u_arg[1]); - else { - int len; - if (tcp->u_arg[1] == 0 || syserror(tcp) - || umove(tcp, tcp->u_arg[2], &len) < 0) { - tprintf("%#lx", tcp->u_arg[1]); + if (fetch_socklen(tcp, &ulen, tcp->u_arg[1], tcp->u_arg[2])) { + set_tcb_priv_ulong(tcp, ulen); + return 0; } else { - printsock(tcp, tcp->u_arg[1], len); + printaddr(tcp->u_arg[1]); + tprints(", "); + printaddr(tcp->u_arg[2]); + return RVAL_DECODED; } - tprints(", "); - printnum_int(tcp, tcp->u_arg[2], "%u"); } - if (flags_arg >= 0) { - tprints(", "); - printflags(sock_type_flags, tcp->u_arg[flags_arg], - "SOCK_???"); + + ulen = get_tcb_priv_ulong(tcp); + + if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &rlen) < 0) { + printaddr(tcp->u_arg[1]); + tprintf(", [%d]", ulen); + } else { + decode_sockaddr(tcp, tcp->u_arg[1], ulen > rlen ? rlen : ulen); + if (ulen != rlen) + tprintf(", [%d->%d]", ulen, rlen); + else + tprintf(", [%d]", rlen); } - return 0; -} -int -sys_accept(struct tcb *tcp) -{ - do_sockname(tcp, -1); - return RVAL_FD; + return RVAL_DECODED; } -int -sys_accept4(struct tcb *tcp) +SYS_FUNC(accept) { - do_sockname(tcp, 3); - return RVAL_FD; + return decode_sockname(tcp) | RVAL_FD; } -int -sys_send(struct tcb *tcp) +SYS_FUNC(accept4) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, ", tcp->u_arg[2]); - /* flags */ - printflags(msg_flags, tcp->u_arg[3], "MSG_???"); - } - return 0; -} + int rc = decode_sockname(tcp); -int -sys_sendto(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); + if (rc & RVAL_DECODED) { tprints(", "); - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, ", tcp->u_arg[2]); - /* flags */ - printflags(msg_flags, tcp->u_arg[3], "MSG_???"); - /* to address */ - tprints(", "); - printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]); - /* to length */ - tprintf(", %lu", tcp->u_arg[5]); + printflags(sock_type_flags, tcp->u_arg[3], "SOCK_???"); } - return 0; -} -#ifdef HAVE_SENDMSG + return rc | RVAL_FD; +} -int -sys_sendmsg(struct tcb *tcp) +SYS_FUNC(send) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printmsghdr(tcp, tcp->u_arg[1], (unsigned long) -1L); - /* flags */ - tprints(", "); - printflags(msg_flags, tcp->u_arg[2], "MSG_???"); - } - return 0; + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); + /* flags */ + printflags(msg_flags, tcp->u_arg[3], "MSG_???"); + + return RVAL_DECODED; } -int -sys_sendmmsg(struct tcb *tcp) +SYS_FUNC(sendto) { - if (entering(tcp)) { - /* sockfd */ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - if (!verbose(tcp)) { - tprintf("%#lx, %u, ", - tcp->u_arg[1], (unsigned int) tcp->u_arg[2]); - printflags(msg_flags, tcp->u_arg[3], "MSG_???"); - } - } else { - if (verbose(tcp)) - decode_mmsg(tcp, (unsigned long) -1L); - } - return 0; -} + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); + /* flags */ + printflags(msg_flags, tcp->u_arg[3], "MSG_???"); + /* to address */ + const int addrlen = tcp->u_arg[5]; + tprints(", "); + decode_sockaddr(tcp, tcp->u_arg[4], addrlen); + /* to length */ + tprintf(", %d", addrlen); -#endif /* HAVE_SENDMSG */ + return RVAL_DECODED; +} -int -sys_recv(struct tcb *tcp) +SYS_FUNC(recv) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printstr(tcp, tcp->u_arg[1], tcp->u_rval); + if (syserror(tcp)) { + printaddr(tcp->u_arg[1]); + } else { + decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], + tcp->u_rval); + } - tprintf(", %lu, ", tcp->u_arg[2]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); printflags(msg_flags, tcp->u_arg[3], "MSG_???"); } return 0; } -int -sys_recvfrom(struct tcb *tcp) +SYS_FUNC(recvfrom) { - int fromlen; + int ulen, rlen; if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); + if (fetch_socklen(tcp, &ulen, tcp->u_arg[4], tcp->u_arg[5])) { + set_tcb_priv_ulong(tcp, ulen); + } } else { + /* buf */ if (syserror(tcp)) { - tprintf("%#lx, %lu, %lu, %#lx, %#lx", - tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3], - tcp->u_arg[4], tcp->u_arg[5]); - return 0; + printaddr(tcp->u_arg[1]); + } else { + decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], + tcp->u_rval); } - /* buf */ - printstr(tcp, tcp->u_arg[1], tcp->u_rval); - /* len */ - tprintf(", %lu, ", tcp->u_arg[2]); + /* size */ + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); /* flags */ printflags(msg_flags, tcp->u_arg[3], "MSG_???"); - /* from address, len */ - if (!tcp->u_arg[4] || !tcp->u_arg[5]) { - if (tcp->u_arg[4] == 0) - tprints(", NULL"); - else - tprintf(", %#lx", tcp->u_arg[4]); - if (tcp->u_arg[5] == 0) - tprints(", NULL"); - else - tprintf(", %#lx", tcp->u_arg[5]); + tprints(", "); + + ulen = get_tcb_priv_ulong(tcp); + + if (!fetch_socklen(tcp, &rlen, tcp->u_arg[4], tcp->u_arg[5])) { + /* from address */ + printaddr(tcp->u_arg[4]); + tprints(", "); + /* from length */ + printaddr(tcp->u_arg[5]); return 0; } - if (umove(tcp, tcp->u_arg[5], &fromlen) < 0) { - tprints(", {...}, [?]"); + if (syserror(tcp)) { + /* from address */ + printaddr(tcp->u_arg[4]); + /* from length */ + tprintf(", [%d]", ulen); return 0; } - tprints(", "); - printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]); + /* from address */ + decode_sockaddr(tcp, tcp->u_arg[4], ulen > rlen ? rlen : ulen); /* from length */ - tprintf(", [%u]", fromlen); - } - return 0; -} - -#ifdef HAVE_SENDMSG - -int -sys_recvmsg(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - if (syserror(tcp) || !verbose(tcp)) - tprintf("%#lx", tcp->u_arg[1]); + if (ulen != rlen) + tprintf(", [%d->%d]", ulen, rlen); else - printmsghdr(tcp, tcp->u_arg[1], tcp->u_rval); - /* flags */ - tprints(", "); - printflags(msg_flags, tcp->u_arg[2], "MSG_???"); + tprintf(", [%d]", rlen); } return 0; } -int -sys_recvmmsg(struct tcb *tcp) +#include "xlat/shutdown_modes.h" + +SYS_FUNC(shutdown) { - /* +5 chars are for "left " prefix */ - static char str[5 + TIMESPEC_TEXT_BUFSIZE]; + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printxval(shutdown_modes, tcp->u_arg[1], "SHUT_???"); - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - if (verbose(tcp)) { - sprint_timespec(str, tcp, tcp->u_arg[4]); - /* Abusing tcp->auxstr as temp storage. - * Will be used and freed on syscall exit. - */ - tcp->auxstr = strdup(str); - } else { - tprintf("%#lx, %ld, ", tcp->u_arg[1], tcp->u_arg[2]); - printflags(msg_flags, tcp->u_arg[3], "MSG_???"); - tprints(", "); - print_timespec(tcp, tcp->u_arg[4]); - } - return 0; - } else { - if (verbose(tcp)) { - decode_mmsg(tcp, 0); - /* timeout on entrance */ - tprintf(", %s", tcp->auxstr ? tcp->auxstr : "{...}"); - free((void *) tcp->auxstr); - tcp->auxstr = NULL; - } - if (syserror(tcp)) - return 0; - if (tcp->u_rval == 0) { - tcp->auxstr = "Timeout"; - return RVAL_STR; - } - if (!verbose(tcp)) - return 0; - /* timeout on exit */ - sprint_timespec(stpcpy(str, "left "), tcp, tcp->u_arg[4]); - tcp->auxstr = str; - return RVAL_STR; - } + return RVAL_DECODED; } -#endif /* HAVE_SENDMSG */ - -#include "xlat/shutdown_modes.h" - -int -sys_shutdown(struct tcb *tcp) +SYS_FUNC(getsockname) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printxval(shutdown_modes, tcp->u_arg[1], "SHUT_???"); - } - return 0; + return decode_sockname(tcp); } -int -sys_getsockname(struct tcb *tcp) +static void +printpair_fd(struct tcb *tcp, const int i0, const int i1) { - return do_sockname(tcp, -1); + tprints("["); + printfd(tcp, i0); + tprints(", "); + printfd(tcp, i1); + tprints("]"); } -int -sys_getpeername(struct tcb *tcp) +static void +decode_pair_fd(struct tcb *const tcp, const kernel_ulong_t addr) { - return do_sockname(tcp, -1); + int pair[2]; + + if (umove_or_printaddr(tcp, addr, &pair)) + return; + + printpair_fd(tcp, pair[0], pair[1]); } static int do_pipe(struct tcb *tcp, int flags_arg) { if (exiting(tcp)) { - if (syserror(tcp)) { - tprintf("%#lx", tcp->u_arg[0]); - } else { -#if !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64) - int fds[2]; - - if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0) - tprints("[...]"); - else - tprintf("[%u, %u]", fds[0], fds[1]); -#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(IA64) - tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp)); -#else - tprintf("%#lx", tcp->u_arg[0]); -#endif - } + decode_pair_fd(tcp, tcp->u_arg[0]); if (flags_arg >= 0) { tprints(", "); printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???"); @@ -866,317 +397,461 @@ do_pipe(struct tcb *tcp, int flags_arg) return 0; } -int -sys_pipe(struct tcb *tcp) +SYS_FUNC(pipe) { +#ifdef HAVE_GETRVAL2 + if (exiting(tcp) && !syserror(tcp)) + printpair_fd(tcp, tcp->u_rval, getrval2(tcp)); + return 0; +#else return do_pipe(tcp, -1); +#endif } -int -sys_pipe2(struct tcb *tcp) +SYS_FUNC(pipe2) { return do_pipe(tcp, 1); } -int -sys_socketpair(struct tcb *tcp) +SYS_FUNC(socketpair) { - int fds[2]; - if (entering(tcp)) { - printxval(domains, tcp->u_arg[0], "PF_???"); + printxval(addrfams, tcp->u_arg[0], "AF_???"); tprints(", "); - tprint_sock_type(tcp, tcp->u_arg[1]); - tprintf(", %lu", tcp->u_arg[2]); + tprint_sock_type(tcp->u_arg[1]); + tprintf(", %" PRI_klu, tcp->u_arg[2]); } else { - if (syserror(tcp)) { - tprintf(", %#lx", tcp->u_arg[3]); - return 0; - } - if (umoven(tcp, tcp->u_arg[3], sizeof fds, (char *) fds) < 0) - tprints(", [...]"); - else - tprintf(", [%u, %u]", fds[0], fds[1]); + tprints(", "); + decode_pair_fd(tcp, tcp->u_arg[3]); } return 0; } -int -sys_getsockopt(struct tcb *tcp) +#include "xlat/sockoptions.h" +#include "xlat/sockipoptions.h" +#include "xlat/getsockipoptions.h" +#include "xlat/setsockipoptions.h" +#include "xlat/sockipv6options.h" +#include "xlat/getsockipv6options.h" +#include "xlat/setsockipv6options.h" +#include "xlat/sockipxoptions.h" +#include "xlat/sockrawoptions.h" +#include "xlat/sockpacketoptions.h" +#include "xlat/socksctpoptions.h" +#include "xlat/socktcpoptions.h" + +static void +print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level, + unsigned int name, bool is_getsockopt) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printxval(socketlayers, tcp->u_arg[1], "SOL_???"); - tprints(", "); - switch (tcp->u_arg[1]) { - case SOL_SOCKET: - printxval(sockoptions, tcp->u_arg[2], "SO_???"); - break; -#ifdef SOL_IP - case SOL_IP: - printxval(sockipoptions, tcp->u_arg[2], "IP_???"); - break; -#endif -#ifdef SOL_IPV6 - case SOL_IPV6: - printxval(sockipv6options, tcp->u_arg[2], "IPV6_???"); - break; -#endif -#ifdef SOL_IPX - case SOL_IPX: - printxval(sockipxoptions, tcp->u_arg[2], "IPX_???"); - break; -#endif -#ifdef SOL_PACKET - case SOL_PACKET: - printxval(sockpacketoptions, tcp->u_arg[2], "PACKET_???"); - break; -#endif -#ifdef SOL_TCP - case SOL_TCP: - printxval(socktcpoptions, tcp->u_arg[2], "TCP_???"); - break; -#endif -#ifdef SOL_SCTP - case SOL_SCTP: - printxval(socksctpoptions, tcp->u_arg[2], "SCTP_???"); - break; -#endif + printfd(tcp, fd); + tprints(", "); + printxval(socketlayers, level, "SOL_??"); + tprints(", "); - /* SOL_AX25 SOL_ROSE SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25 - * etc. still need work */ - default: - tprintf("%lu", tcp->u_arg[2]); - break; - } - tprints(", "); + switch (level) { + case SOL_SOCKET: + printxval(sockoptions, name, "SO_???"); + break; + case SOL_IP: + printxvals(name, "IP_???", sockipoptions, + is_getsockopt ? getsockipoptions : setsockipoptions, NULL); + break; + case SOL_IPV6: + printxvals(name, "IPV6_???", sockipv6options, + is_getsockopt ? getsockipv6options : setsockipv6options, NULL); + break; + case SOL_IPX: + printxval(sockipxoptions, name, "IPX_???"); + break; + case SOL_PACKET: + printxval(sockpacketoptions, name, "PACKET_???"); + break; + case SOL_TCP: + printxval(socktcpoptions, name, "TCP_???"); + break; + case SOL_SCTP: + printxval(socksctpoptions, name, "SCTP_???"); + break; + case SOL_RAW: + printxval(sockrawoptions, name, "RAW_???"); + break; + + /* Other SOL_* protocol levels still need work. */ + + default: + tprintf("%u", name); + } + + tprints(", "); +} + +static void +print_linger(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +{ + struct linger linger; + + if (len != sizeof(linger) || + umove(tcp, addr, &linger) < 0) { + printaddr(addr); + return; + } + + tprintf("{onoff=%d, linger=%d}", + linger.l_onoff, + linger.l_linger); +} + +#ifdef SO_PEERCRED +static void +print_ucred(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +{ + struct ucred uc; + + if (len != sizeof(uc) || + umove(tcp, addr, &uc) < 0) { + printaddr(addr); } else { - int len; - if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &len) < 0) { - tprintf("%#lx, %#lx", - tcp->u_arg[3], tcp->u_arg[4]); - return 0; - } + tprintf("{pid=%u, uid=%u, gid=%u}", + (unsigned) uc.pid, + (unsigned) uc.uid, + (unsigned) uc.gid); + } +} +#endif /* SO_PEERCRED */ - switch (tcp->u_arg[1]) { - case SOL_SOCKET: - switch (tcp->u_arg[2]) { -#ifdef SO_LINGER - case SO_LINGER: - if (len == sizeof(struct linger)) { - struct linger linger; - if (umove(tcp, - tcp->u_arg[3], - &linger) < 0) - break; - tprintf("{onoff=%d, linger=%d}, " - "[%d]", - linger.l_onoff, - linger.l_linger, - len); - return 0; - } - break; -#endif +#ifdef PACKET_STATISTICS +static void +print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr, + const int len) +{ + struct tpacket_stats stats; + + if (len != sizeof(stats) || + umove(tcp, addr, &stats) < 0) { + printaddr(addr); + } else { + tprintf("{packets=%u, drops=%u}", + stats.tp_packets, + stats.tp_drops); + } +} +#endif /* PACKET_STATISTICS */ + +#include "xlat/icmpfilterflags.h" + +static void +print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len) +{ + struct icmp_filter filter = {}; + + if (len > (int) sizeof(filter)) + len = sizeof(filter); + else if (len <= 0) { + printaddr(addr); + return; + } + + if (umoven_or_printaddr(tcp, addr, len, &filter)) + return; + + tprints("~("); + printflags(icmpfilterflags, ~filter.data, "ICMP_???"); + tprints(")"); +} + +static void +print_getsockopt(struct tcb *const tcp, const unsigned int level, + const unsigned int name, const kernel_ulong_t addr, + const int len) +{ + if (addr && verbose(tcp)) + switch (level) { + case SOL_SOCKET: + switch (name) { + case SO_LINGER: + print_linger(tcp, addr, len); + goto done; #ifdef SO_PEERCRED - case SO_PEERCRED: - if (len == sizeof(struct ucred)) { - struct ucred uc; - if (umove(tcp, - tcp->u_arg[3], - &uc) < 0) - break; - tprintf("{pid=%ld, uid=%ld, gid=%ld}, " - "[%d]", - (long)uc.pid, - (long)uc.uid, - (long)uc.gid, - len); - return 0; - } - break; + case SO_PEERCRED: + print_ucred(tcp, addr, len); + goto done; #endif - } - break; - case SOL_PACKET: - switch (tcp->u_arg[2]) { + } + break; + + case SOL_PACKET: + switch (name) { #ifdef PACKET_STATISTICS - case PACKET_STATISTICS: - if (len == sizeof(struct tpacket_stats)) { - struct tpacket_stats stats; - if (umove(tcp, - tcp->u_arg[3], - &stats) < 0) - break; - tprintf("{packets=%u, drops=%u}, " - "[%d]", - stats.tp_packets, - stats.tp_drops, - len); - return 0; - } - break; + case PACKET_STATISTICS: + print_tpacket_stats(tcp, addr, len); + goto done; #endif - } - break; } + break; + + case SOL_RAW: + switch (name) { + case ICMP_FILTER: + print_icmp_filter(tcp, addr, len); + goto done; + } + break; + } + + /* default arg printing */ + if (verbose(tcp)) { if (len == sizeof(int)) { - printnum_int(tcp, tcp->u_arg[3], "%d"); + printnum_int(tcp, addr, "%d"); + } else { + printstrn(tcp, addr, len); } - else { - printstr(tcp, tcp->u_arg[3], len); + } else { + printaddr(addr); + } +done: + tprintf(", [%d]", len); +} + +SYS_FUNC(getsockopt) +{ + if (entering(tcp)) { + print_sockopt_fd_level_name(tcp, tcp->u_arg[0], + tcp->u_arg[1], tcp->u_arg[2], true); + } else { + int len; + + if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &len) < 0) { + printaddr(tcp->u_arg[3]); + tprints(", "); + printaddr(tcp->u_arg[4]); + } else { + print_getsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2], + tcp->u_arg[3], len); } - tprintf(", [%d]", len); } return 0; } -#if defined(ICMP_FILTER) -static void printicmpfilter(struct tcb *tcp, long addr) +#ifdef IP_ADD_MEMBERSHIP +static void +print_mreq(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int len) { - struct icmp_filter filter; + struct ip_mreq mreq; - if (!addr) { - tprints("NULL"); + if (len < sizeof(mreq)) { + printstrn(tcp, addr, len); return; } - if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#lx", addr); + if (umove_or_printaddr(tcp, addr, &mreq)) return; - } - if (umove(tcp, addr, &filter) < 0) { - tprints("{...}"); + + tprints("{imr_multiaddr=inet_addr("); + print_quoted_string(inet_ntoa(mreq.imr_multiaddr), + 16, QUOTE_0_TERMINATED); + tprints("), imr_interface=inet_addr("); + print_quoted_string(inet_ntoa(mreq.imr_interface), + 16, QUOTE_0_TERMINATED); + tprints(")}"); +} +#endif /* IP_ADD_MEMBERSHIP */ + +#ifdef IPV6_ADD_MEMBERSHIP +static void +print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int len) +{ + struct ipv6_mreq mreq; + + if (len < sizeof(mreq)) + goto fail; + + if (umove_or_printaddr(tcp, addr, &mreq)) + return; + + const struct in6_addr *in6 = &mreq.ipv6mr_multiaddr; + char address[INET6_ADDRSTRLEN]; + + if (!inet_ntop(AF_INET6, in6, address, sizeof(address))) + goto fail; + + tprints("{ipv6mr_multiaddr=inet_pton("); + print_quoted_string(address, sizeof(address), QUOTE_0_TERMINATED); + tprints("), ipv6mr_interface="); + print_ifindex(mreq.ipv6mr_interface); + tprints("}"); + return; + +fail: + printstrn(tcp, addr, len); +} +#endif /* IPV6_ADD_MEMBERSHIP */ + +#ifdef MCAST_JOIN_GROUP +static void +print_group_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +{ + struct group_req greq; + + if (len != sizeof(greq) || + umove(tcp, addr, &greq) < 0) { + printaddr(addr); return; } - tprints("~("); - printflags(icmpfilterflags, ~filter.data, "ICMP_???"); - tprints(")"); + tprintf("{gr_interface=%u, gr_group=", greq.gr_interface); + print_sockaddr(tcp, &greq.gr_group, sizeof(greq.gr_group)); + tprints("}"); + } -#endif /* ICMP_FILTER */ +#endif /* MCAST_JOIN_GROUP */ -static int -printsockopt(struct tcb *tcp, int level, int name, long addr, int len) +#ifdef PACKET_RX_RING +static void +print_tpacket_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { - printxval(socketlayers, level, "SOL_??"); - tprints(", "); + struct tpacket_req req; + + if (len != sizeof(req) || + umove(tcp, addr, &req) < 0) { + printaddr(addr); + } else { + tprintf("{block_size=%u, block_nr=%u, " + "frame_size=%u, frame_nr=%u}", + req.tp_block_size, + req.tp_block_nr, + req.tp_frame_size, + req.tp_frame_nr); + } +} +#endif /* PACKET_RX_RING */ + +#ifdef PACKET_ADD_MEMBERSHIP +# include "xlat/packet_mreq_type.h" + +static void +print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +{ + struct packet_mreq mreq; + + if (len != sizeof(mreq) || + umove(tcp, addr, &mreq) < 0) { + printaddr(addr); + } else { + unsigned int i; + + tprintf("{mr_ifindex=%u, mr_type=", mreq.mr_ifindex); + printxval(packet_mreq_type, mreq.mr_type, "PACKET_MR_???"); + tprintf(", mr_alen=%u, mr_address=", mreq.mr_alen); + if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address)) + mreq.mr_alen = ARRAY_SIZE(mreq.mr_address); + for (i = 0; i < mreq.mr_alen; ++i) + tprintf("%02x", mreq.mr_address[i]); + tprints("}"); + } +} +#endif /* PACKET_ADD_MEMBERSHIP */ + +static void +print_setsockopt(struct tcb *const tcp, const unsigned int level, + const unsigned int name, const kernel_ulong_t addr, + const int len) +{ + if (addr && verbose(tcp)) switch (level) { case SOL_SOCKET: - printxval(sockoptions, name, "SO_???"); switch (name) { -#if defined(SO_LINGER) case SO_LINGER: - if (len == sizeof(struct linger)) { - struct linger linger; - if (umove(tcp, addr, &linger) < 0) - break; - tprintf(", {onoff=%d, linger=%d}", - linger.l_onoff, - linger.l_linger); - return 0; - } - break; -#endif + print_linger(tcp, addr, len); + goto done; } break; -#ifdef SOL_IP + case SOL_IP: - printxval(sockipoptions, name, "IP_???"); + switch (name) { +#ifdef IP_ADD_MEMBERSHIP + case IP_ADD_MEMBERSHIP: + case IP_DROP_MEMBERSHIP: + print_mreq(tcp, addr, len); + goto done; +#endif /* IP_ADD_MEMBERSHIP */ +#ifdef MCAST_JOIN_GROUP + case MCAST_JOIN_GROUP: + case MCAST_LEAVE_GROUP: + print_group_req(tcp, addr, len); + goto done; +#endif /* MCAST_JOIN_GROUP */ + } break; -#endif -#ifdef SOL_IPV6 + case SOL_IPV6: - printxval(sockipv6options, name, "IPV6_???"); - break; -#endif -#ifdef SOL_IPX - case SOL_IPX: - printxval(sockipxoptions, name, "IPX_???"); + switch (name) { +#ifdef IPV6_ADD_MEMBERSHIP + case IPV6_ADD_MEMBERSHIP: + case IPV6_DROP_MEMBERSHIP: +# ifdef IPV6_JOIN_ANYCAST + case IPV6_JOIN_ANYCAST: +# endif +# ifdef IPV6_LEAVE_ANYCAST + case IPV6_LEAVE_ANYCAST: +# endif + print_mreq6(tcp, addr, len); + goto done; +#endif /* IPV6_ADD_MEMBERSHIP */ + } break; -#endif -#ifdef SOL_PACKET + case SOL_PACKET: - printxval(sockpacketoptions, name, "PACKET_???"); - /* TODO: decode packate_mreq for PACKET_*_MEMBERSHIP */ switch (name) { #ifdef PACKET_RX_RING case PACKET_RX_RING: -#endif -#ifdef PACKET_TX_RING +# ifdef PACKET_TX_RING case PACKET_TX_RING: -#endif -#if defined(PACKET_RX_RING) || defined(PACKET_TX_RING) - if (len == sizeof(struct tpacket_req)) { - struct tpacket_req req; - if (umove(tcp, addr, &req) < 0) - break; - tprintf(", {block_size=%u, block_nr=%u, frame_size=%u, frame_nr=%u}", - req.tp_block_size, - req.tp_block_nr, - req.tp_frame_size, - req.tp_frame_nr); - return 0; - } - break; -#endif /* PACKET_RX_RING || PACKET_TX_RING */ +# endif + print_tpacket_req(tcp, addr, len); + goto done; +#endif /* PACKET_RX_RING */ +#ifdef PACKET_ADD_MEMBERSHIP + case PACKET_ADD_MEMBERSHIP: + case PACKET_DROP_MEMBERSHIP: + print_packet_mreq(tcp, addr, len); + goto done; +#endif /* PACKET_ADD_MEMBERSHIP */ } break; -#endif -#ifdef SOL_TCP - case SOL_TCP: - printxval(socktcpoptions, name, "TCP_???"); - break; -#endif -#ifdef SOL_SCTP - case SOL_SCTP: - printxval(socksctpoptions, name, "SCTP_???"); - break; -#endif -#ifdef SOL_RAW + case SOL_RAW: - printxval(sockrawoptions, name, "RAW_???"); switch (name) { -#if defined(ICMP_FILTER) - case ICMP_FILTER: - tprints(", "); - printicmpfilter(tcp, addr); - return 0; -#endif + case ICMP_FILTER: + print_icmp_filter(tcp, addr, len); + goto done; } break; -#endif - - /* SOL_AX25 SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25 - * etc. still need work */ - - default: - tprintf("%u", name); } /* default arg printing */ - tprints(", "); - - if (len == sizeof(int)) { - printnum_int(tcp, addr, "%d"); - } - else { - printstr(tcp, addr, len); + if (verbose(tcp)) { + if (len == sizeof(int)) { + printnum_int(tcp, addr, "%d"); + } else { + printstrn(tcp, addr, len); + } + } else { + printaddr(addr); } - return 0; +done: + tprintf(", %d", len); } -int -sys_setsockopt(struct tcb *tcp) +SYS_FUNC(setsockopt) { - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3], tcp->u_arg[4]); - tprintf(", %lu", tcp->u_arg[4]); - } - return 0; + print_sockopt_fd_level_name(tcp, tcp->u_arg[0], + tcp->u_arg[1], tcp->u_arg[2], false); + print_setsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2], + tcp->u_arg[3], tcp->u_arg[4]); + + return RVAL_DECODED; } diff --git a/netlink.c b/netlink.c new file mode 100644 index 00000000..db6e43f8 --- /dev/null +++ b/netlink.c @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include +#include "xlat/netlink_flags.h" +#include "xlat/netlink_types.h" + +/* + * Fetch a struct nlmsghdr from the given address. + */ +static bool +fetch_nlmsghdr(struct tcb *const tcp, struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, const kernel_ulong_t len) +{ + if (len < sizeof(struct nlmsghdr)) { + printstrn(tcp, addr, len); + return false; + } + + if (umove_or_printaddr(tcp, addr, nlmsghdr)) + return false; + + return true; +} + +static void +print_nlmsghdr(struct tcb *tcp, const struct nlmsghdr *const nlmsghdr) +{ + /* print the whole structure regardless of its nlmsg_len */ + + tprintf("{len=%u, type=", nlmsghdr->nlmsg_len); + + printxval(netlink_types, nlmsghdr->nlmsg_type, "NLMSG_???"); + + tprints(", flags="); + printflags(netlink_flags, nlmsghdr->nlmsg_flags, "NLM_F_???"); + + tprintf(", seq=%u, pid=%u}", nlmsghdr->nlmsg_seq, + nlmsghdr->nlmsg_pid); +} + +static void +decode_nlmsghdr_with_payload(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const kernel_ulong_t len) +{ + tprints("{"); + + print_nlmsghdr(tcp, nlmsghdr); + + unsigned int nlmsg_len = + nlmsghdr->nlmsg_len > len ? len : nlmsghdr->nlmsg_len; + if (nlmsg_len > sizeof(struct nlmsghdr)) { + tprints(", "); + + printstrn(tcp, addr + sizeof(struct nlmsghdr), + nlmsg_len - sizeof(struct nlmsghdr)); + } + + tprints("}"); +} + +void +decode_netlink(struct tcb *const tcp, kernel_ulong_t addr, kernel_ulong_t len) +{ + struct nlmsghdr nlmsghdr; + bool print_array = false; + unsigned int elt; + + for (elt = 0; fetch_nlmsghdr(tcp, &nlmsghdr, addr, len); elt++) { + if (abbrev(tcp) && elt == max_strlen) { + tprints("..."); + break; + } + + unsigned int nlmsg_len = NLMSG_ALIGN(nlmsghdr.nlmsg_len); + kernel_ulong_t next_addr = 0; + kernel_ulong_t next_len = 0; + + if (nlmsghdr.nlmsg_len >= sizeof(struct nlmsghdr)) { + next_len = (len >= nlmsg_len) ? len - nlmsg_len : 0; + + if (next_len && addr + nlmsg_len > addr) + next_addr = addr + nlmsg_len; + } + + if (!print_array && next_addr) { + tprints("["); + print_array = true; + } + + decode_nlmsghdr_with_payload(tcp, &nlmsghdr, addr, len); + + if (!next_addr) + break; + + tprints(", "); + addr = next_addr; + len = next_len; + } + + if (print_array) { + tprints("]"); + } +} diff --git a/nsig.h b/nsig.h new file mode 100644 index 00000000..528f7033 --- /dev/null +++ b/nsig.h @@ -0,0 +1,15 @@ +#ifndef STRACE_NSIG_H +#define STRACE_NSIG_H + +#include + +#ifndef NSIG +# warning NSIG is not defined, using 32 +# define NSIG 32 +#elif NSIG < 32 +# error NSIG < 32 +#endif + +#define NSIG_BYTES (NSIG / 8) + +#endif /* !STRACE_NSIG_H */ diff --git a/numa.c b/numa.c new file mode 100644 index 00000000..c2cd143a --- /dev/null +++ b/numa.c @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2003-2007 Ulrich Drepper + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +static bool +print_node(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + if (elem_size < sizeof(kernel_ulong_t)) { + tprintf("%#0*x", (int) elem_size * 2 + 2, + * (unsigned int *) elem_buf); + } else { + tprintf("%#0*" PRI_klx, (int) elem_size * 2 + 2, + * (kernel_ulong_t *) elem_buf); + } + + return true; +} + +static void +print_nodemask(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t maxnodes) +{ + const unsigned int bits_per_long = 8 * current_wordsize; + const kernel_ulong_t nmemb = + (maxnodes + bits_per_long - 2) / bits_per_long; + + if (nmemb < maxnodes / bits_per_long || + (maxnodes && !nmemb)) { + printaddr(addr); + return; + } + + kernel_ulong_t buf; + print_array(tcp, addr, nmemb, &buf, current_wordsize, + umoven_or_printaddr, print_node, 0); +} + +SYS_FUNC(migrate_pages) +{ + tprintf("%d, %" PRI_klu ", ", (int) tcp->u_arg[0], tcp->u_arg[1]); + print_nodemask(tcp, tcp->u_arg[2], tcp->u_arg[1]); + tprints(", "); + print_nodemask(tcp, tcp->u_arg[3], tcp->u_arg[1]); + + return RVAL_DECODED; +} + +#include "xlat/policies.h" +#include "xlat/mbindflags.h" + +SYS_FUNC(mbind) +{ + printaddr(tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + printxval64(policies, tcp->u_arg[2], "MPOL_???"); + tprints(", "); + print_nodemask(tcp, tcp->u_arg[3], tcp->u_arg[4]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[4]); + printflags(mbindflags, tcp->u_arg[5], "MPOL_???"); + + return RVAL_DECODED; +} + +SYS_FUNC(set_mempolicy) +{ + printxval(policies, tcp->u_arg[0], "MPOL_???"); + tprints(", "); + print_nodemask(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu, tcp->u_arg[2]); + + return RVAL_DECODED; +} + +#include "xlat/mempolicyflags.h" + +SYS_FUNC(get_mempolicy) +{ + if (exiting(tcp)) { + int pol; + if (!umove_or_printaddr(tcp, tcp->u_arg[0], &pol)) { + tprints("["); + printxval(policies, pol, "MPOL_???"); + tprints("]"); + } + tprints(", "); + print_nodemask(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); + printaddr(tcp->u_arg[3]); + tprints(", "); + printflags64(mempolicyflags, tcp->u_arg[4], "MPOL_???"); + } + return 0; +} + +#include "xlat/move_pages_flags.h" + +static bool +print_addr(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + kernel_ulong_t addr; + + if (elem_size < sizeof(addr)) { + addr = * (unsigned int *) elem_buf; + } else { + addr = * (kernel_ulong_t *) elem_buf; + } + + printaddr(addr); + + return true; +} + +static bool +print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const int status = * (int *) elem_buf; + + if (status < 0 && (unsigned) -status < nerrnos) + tprintf("%s", errnoent[-status]); + else + tprintf("%d", status); + + return true; +} + +static bool +print_int(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + tprintf("%d", * (int *) elem_buf); + + return true; +} + +SYS_FUNC(move_pages) +{ + const kernel_ulong_t npages = tcp->u_arg[1]; + kernel_ulong_t buf; + + if (entering(tcp)) { + tprintf("%d, %" PRI_klu ", ", (int) tcp->u_arg[0], npages); + print_array(tcp, tcp->u_arg[2], npages, &buf, current_wordsize, + umoven_or_printaddr, print_addr, 0); + tprints(", "); + print_array(tcp, tcp->u_arg[3], npages, &buf, sizeof(int), + umoven_or_printaddr, print_int, 0); + tprints(", "); + } else { + print_array(tcp, tcp->u_arg[4], npages, &buf, sizeof(int), + umoven_or_printaddr, print_status, 0); + tprints(", "); + printflags(move_pages_flags, tcp->u_arg[5], "MPOL_???"); + } + return 0; +} diff --git a/oldstat.c b/oldstat.c new file mode 100644 index 00000000..5535310e --- /dev/null +++ b/oldstat.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "asm_stat.h" +#include "stat.h" + +#ifdef HAVE_STRUCT___OLD_KERNEL_STAT + +static void +print_old_kernel_stat(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct __old_kernel_stat buf; + if (umove_or_printaddr(tcp, addr, &buf)) + return; + + struct strace_stat st = { + .dev = zero_extend_signed_to_ull(buf.st_dev), + .ino = zero_extend_signed_to_ull(buf.st_ino), + .rdev = zero_extend_signed_to_ull(buf.st_rdev), + .size = zero_extend_signed_to_ull(buf.st_size), + .mode = zero_extend_signed_to_ull(buf.st_mode), + .nlink = zero_extend_signed_to_ull(buf.st_nlink), + .uid = zero_extend_signed_to_ull(buf.st_uid), + .gid = zero_extend_signed_to_ull(buf.st_gid), + .atime = sign_extend_unsigned_to_ll(buf.st_atime), + .ctime = sign_extend_unsigned_to_ll(buf.st_ctime), + .mtime = sign_extend_unsigned_to_ll(buf.st_mtime) + }; + + print_struct_stat(tcp, &st); +} + +SYS_FUNC(oldstat) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + print_old_kernel_stat(tcp, tcp->u_arg[1]); + } + return 0; +} + +SYS_FUNC(oldfstat) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + print_old_kernel_stat(tcp, tcp->u_arg[1]); + } + return 0; +} + +#endif /* HAVE_STRUCT___OLD_KERNEL_STAT */ diff --git a/open.c b/open.c new file mode 100644 index 00000000..2944d55c --- /dev/null +++ b/open.c @@ -0,0 +1,163 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2007 Roland McGrath + * Copyright (c) 2006-2007 Ulrich Drepper + * Copyright (c) 2009-2013 Denys Vlasenko + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +/* some libcs are guilty of messing up with O_ACCMODE */ +#undef O_ACCMODE +#define O_ACCMODE 03 + +#ifdef O_LARGEFILE +# if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */ +# undef O_LARGEFILE +# ifdef SPARC64 +# define O_LARGEFILE 0x40000 +# elif defined X86_64 || defined S390X +# define O_LARGEFILE 0100000 +# endif +# endif +#endif + +#include "xlat/open_access_modes.h" +#include "xlat/open_mode_flags.h" + +#ifndef AT_FDCWD +# define AT_FDCWD -100 +#endif + +/* The fd is an "int", so when decoding x86 on x86_64, we need to force sign + * extension to get the right value. We do this by declaring fd as int here. + */ +void +print_dirfd(struct tcb *tcp, int fd) +{ + if (fd == AT_FDCWD) + tprints("AT_FDCWD, "); + else { + printfd(tcp, fd); + tprints(", "); + } +} + +/* + * low bits of the open(2) flags define access mode, + * other bits are real flags. + */ +const char * +sprint_open_modes(unsigned int flags) +{ + static char outstr[(1 + ARRAY_SIZE(open_mode_flags)) * sizeof("O_LARGEFILE")]; + char *p; + char sep; + const char *str; + const struct xlat *x; + + sep = ' '; + p = stpcpy(outstr, "flags"); + str = xlookup(open_access_modes, flags & 3); + if (str) { + *p++ = sep; + p = stpcpy(p, str); + flags &= ~3; + if (!flags) + return outstr; + sep = '|'; + } + + for (x = open_mode_flags; x->str; x++) { + if ((flags & x->val) == x->val) { + *p++ = sep; + p = stpcpy(p, x->str); + flags &= ~x->val; + if (!flags) + return outstr; + sep = '|'; + } + } + /* flags is still nonzero */ + *p++ = sep; + sprintf(p, "%#x", flags); + return outstr; +} + +void +tprint_open_modes(unsigned int flags) +{ + tprints(sprint_open_modes(flags) + sizeof("flags")); +} + +#ifdef O_TMPFILE +/* The kernel & C libraries often inline O_DIRECTORY. */ +# define STRACE_O_TMPFILE (O_TMPFILE & ~O_DIRECTORY) +#else /* !O_TMPFILE */ +# define STRACE_O_TMPFILE 0 +#endif + +static int +decode_open(struct tcb *tcp, int offset) +{ + printpath(tcp, tcp->u_arg[offset]); + tprints(", "); + /* flags */ + tprint_open_modes(tcp->u_arg[offset + 1]); + if (tcp->u_arg[offset + 1] & (O_CREAT | STRACE_O_TMPFILE)) { + /* mode */ + tprints(", "); + print_numeric_umode_t(tcp->u_arg[offset + 2]); + } + + return RVAL_DECODED | RVAL_FD; +} + +SYS_FUNC(open) +{ + return decode_open(tcp, 0); +} + +SYS_FUNC(openat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + return decode_open(tcp, 1); +} + +SYS_FUNC(creat) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + print_numeric_umode_t(tcp->u_arg[1]); + + return RVAL_DECODED | RVAL_FD; +} diff --git a/or1k_atomic.c b/or1k_atomic.c new file mode 100644 index 00000000..bb02e0e4 --- /dev/null +++ b/or1k_atomic.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2013 Christian Svensson + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef OR1K + +#define OR1K_ATOMIC_SWAP 1 +#define OR1K_ATOMIC_CMPXCHG 2 +#define OR1K_ATOMIC_XCHG 3 +#define OR1K_ATOMIC_ADD 4 +#define OR1K_ATOMIC_DECPOS 5 +#define OR1K_ATOMIC_AND 6 +#define OR1K_ATOMIC_OR 7 +#define OR1K_ATOMIC_UMAX 8 +#define OR1K_ATOMIC_UMIN 9 + +#include "xlat/atomic_ops.h" + +SYS_FUNC(or1k_atomic) +{ + printxval64(atomic_ops, tcp->u_arg[0], "???"); + switch(tcp->u_arg[0]) { + case OR1K_ATOMIC_SWAP: + tprintf(", 0x%lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); + break; + case OR1K_ATOMIC_CMPXCHG: + tprintf(", 0x%lx, %#lx, %#lx", tcp->u_arg[1], tcp->u_arg[2], + tcp->u_arg[3]); + break; + + case OR1K_ATOMIC_XCHG: + case OR1K_ATOMIC_ADD: + case OR1K_ATOMIC_AND: + case OR1K_ATOMIC_OR: + case OR1K_ATOMIC_UMAX: + case OR1K_ATOMIC_UMIN: + tprintf(", 0x%lx, %#lx", tcp->u_arg[1], tcp->u_arg[2]); + break; + + case OR1K_ATOMIC_DECPOS: + tprintf(", 0x%lx", tcp->u_arg[1]); + break; + + default: + break; + } + + return RVAL_DECODED | RVAL_HEX; +} + +#endif /* OR1K */ diff --git a/pathtrace.c b/pathtrace.c index ccfb3c27..d991aeda 100644 --- a/pathtrace.c +++ b/pathtrace.c @@ -28,11 +28,7 @@ #include "defs.h" #include -#if defined HAVE_POLL_H -# include -#elif defined HAVE_SYS_POLL_H -# include -#endif +#include #include "syscall.h" @@ -58,7 +54,7 @@ pathmatch(const char *path) * Return true if specified path (in user-space) matches. */ static int -upathmatch(struct tcb *tcp, unsigned long upath) +upathmatch(struct tcb *const tcp, const kernel_ulong_t upath) { char path[PATH_MAX + 1]; @@ -91,9 +87,8 @@ storepath(const char *path) return; /* already in table */ i = num_selected++; - paths_selected = realloc(paths_selected, num_selected * sizeof(paths_selected[0])); - if (!paths_selected) - die_out_of_memory(); + paths_selected = xreallocarray(paths_selected, num_selected, + sizeof(paths_selected[0])); paths_selected[i] = path; } @@ -142,8 +137,7 @@ pathtrace_select(const char *path) return; } - fprintf(stderr, "Requested path '%s' resolved into '%s'\n", - path, rpath); + error_msg("Requested path '%s' resolved into '%s'", path, rpath); storepath(rpath); } @@ -166,117 +160,119 @@ pathtrace_match(struct tcb *tcp) * other than test arg[0]. */ - if (s->sys_func == sys_dup2 || - s->sys_func == sys_dup3 || - s->sys_func == sys_sendfile || - s->sys_func == sys_sendfile64 || - s->sys_func == sys_tee) - { + switch (s->sen) { + case SEN_dup2: + case SEN_dup3: + case SEN_kexec_file_load: + case SEN_sendfile: + case SEN_sendfile64: + case SEN_tee: /* fd, fd */ return fdmatch(tcp, tcp->u_arg[0]) || fdmatch(tcp, tcp->u_arg[1]); - } - if (s->sys_func == sys_inotify_add_watch || - s->sys_func == sys_faccessat || - s->sys_func == sys_fchmodat || - s->sys_func == sys_futimesat || - s->sys_func == sys_mkdirat || - s->sys_func == sys_unlinkat || - s->sys_func == sys_newfstatat || - s->sys_func == sys_mknodat || - s->sys_func == sys_openat || - s->sys_func == sys_readlinkat || - s->sys_func == sys_utimensat || - s->sys_func == sys_fchownat || - s->sys_func == sys_pipe2) - { + case SEN_faccessat: + case SEN_fchmodat: + case SEN_fchownat: + case SEN_fstatat64: + case SEN_futimesat: + case SEN_inotify_add_watch: + case SEN_mkdirat: + case SEN_mknodat: + case SEN_name_to_handle_at: + case SEN_newfstatat: + case SEN_openat: + case SEN_readlinkat: + case SEN_unlinkat: + case SEN_utimensat: /* fd, path */ return fdmatch(tcp, tcp->u_arg[0]) || upathmatch(tcp, tcp->u_arg[1]); - } - if (s->sys_func == sys_link || - s->sys_func == sys_mount) - { + case SEN_link: + case SEN_mount: + case SEN_pivotroot: /* path, path */ return upathmatch(tcp, tcp->u_arg[0]) || upathmatch(tcp, tcp->u_arg[1]); - } - if (s->sys_func == sys_quotactl) - { + case SEN_quotactl: /* x, path */ return upathmatch(tcp, tcp->u_arg[1]); - } - if (s->sys_func == sys_renameat || - s->sys_func == sys_renameat2 || - s->sys_func == sys_linkat) - { + case SEN_linkat: + case SEN_renameat2: + case SEN_renameat: /* fd, path, fd, path */ return fdmatch(tcp, tcp->u_arg[0]) || fdmatch(tcp, tcp->u_arg[2]) || upathmatch(tcp, tcp->u_arg[1]) || upathmatch(tcp, tcp->u_arg[3]); - } - if ( - s->sys_func == sys_old_mmap || + case SEN_old_mmap: #if defined(S390) - s->sys_func == sys_old_mmap_pgoff || + case SEN_old_mmap_pgoff: #endif - s->sys_func == sys_mmap || - s->sys_func == sys_mmap_pgoff || - s->sys_func == sys_mmap_4koff - ) { + case SEN_mmap: + case SEN_mmap_4koff: + case SEN_mmap_pgoff: + case SEN_ARCH_mmap: /* x, x, x, x, fd */ return fdmatch(tcp, tcp->u_arg[4]); - } - if (s->sys_func == sys_symlinkat) { + case SEN_symlinkat: /* path, fd, path */ return fdmatch(tcp, tcp->u_arg[1]) || upathmatch(tcp, tcp->u_arg[0]) || upathmatch(tcp, tcp->u_arg[2]); - } - if (s->sys_func == sys_splice) { - /* fd, x, fd, x, x */ + case SEN_copy_file_range: + case SEN_splice: + /* fd, x, fd, x, x, x */ return fdmatch(tcp, tcp->u_arg[0]) || fdmatch(tcp, tcp->u_arg[2]); - } - if (s->sys_func == sys_epoll_ctl) { + case SEN_epoll_ctl: /* x, x, fd, x */ return fdmatch(tcp, tcp->u_arg[2]); - } - if (s->sys_func == sys_fanotify_mark) { + + case SEN_fanotify_mark: /* x, x, x, fd, path */ return fdmatch(tcp, tcp->u_arg[3]) || upathmatch(tcp, tcp->u_arg[4]); - } - if (s->sys_func == sys_select || - s->sys_func == sys_oldselect || - s->sys_func == sys_pselect6) + case SEN_oldselect: + case SEN_pselect6: + case SEN_select: { int i, j; int nfds; - long *args, oldargs[5]; - unsigned fdsize; + kernel_ulong_t *args; + kernel_ulong_t select_args[5]; + unsigned int oldselect_args[5]; + unsigned int fdsize; fd_set *fds; - args = tcp->u_arg; - if (s->sys_func == sys_oldselect) { - if (umoven(tcp, tcp->u_arg[0], sizeof oldargs, - (char*) oldargs) < 0) - { - fprintf(stderr, "umoven() failed\n"); - return 0; + if (SEN_oldselect == s->sen) { + if (sizeof(*select_args) == sizeof(*oldselect_args)) { + if (umove(tcp, tcp->u_arg[0], &select_args)) { + return 0; + } + } else { + unsigned int n; + + if (umove(tcp, tcp->u_arg[0], &oldselect_args)) { + return 0; + } + + for (n = 0; n < 5; ++n) { + select_args[n] = oldselect_args[n]; + } } - args = oldargs; + args = select_args; + } else { + args = tcp->u_arg; } /* Kernel truncates arg[0] to int, we do the same. */ @@ -288,15 +284,12 @@ pathtrace_match(struct tcb *tcp) if (nfds > 1024*1024) nfds = 1024*1024; fdsize = (((nfds + 7) / 8) + current_wordsize-1) & -current_wordsize; - fds = malloc(fdsize); - if (!fds) - die_out_of_memory(); + fds = xmalloc(fdsize); for (i = 1; i <= 3; ++i) { if (args[i] == 0) continue; - if (umoven(tcp, args[i], fdsize, (char *) fds) < 0) { - fprintf(stderr, "umoven() failed\n"); + if (umoven(tcp, args[i], fdsize, fds) < 0) { continue; } for (j = 0;; j++) { @@ -313,12 +306,12 @@ pathtrace_match(struct tcb *tcp) return 0; } - if (s->sys_func == sys_poll || - s->sys_func == sys_ppoll) + case SEN_poll: + case SEN_ppoll: { struct pollfd fds; unsigned nfds; - unsigned long start, cur, end; + kernel_ulong_t start, cur, end; start = tcp->u_arg[0]; nfds = tcp->u_arg[1]; @@ -329,27 +322,31 @@ pathtrace_match(struct tcb *tcp) return 0; for (cur = start; cur < end; cur += sizeof(fds)) - if ((umoven(tcp, cur, sizeof fds, (char *) &fds) == 0) + if ((umove(tcp, cur, &fds) == 0) && fdmatch(tcp, fds.fd)) return 1; return 0; } - if (s->sys_func == printargs || - s->sys_func == sys_pipe || - s->sys_func == sys_pipe2 || - s->sys_func == sys_eventfd2 || - s->sys_func == sys_eventfd || - s->sys_func == sys_inotify_init1 || - s->sys_func == sys_timerfd_create || - s->sys_func == sys_timerfd_settime || - s->sys_func == sys_timerfd_gettime || - s->sys_func == sys_epoll_create || - s->sys_func == sys_socket || - s->sys_func == sys_socketpair || - s->sys_func == sys_fanotify_init) - { + case SEN_bpf: + case SEN_epoll_create: + case SEN_epoll_create1: + case SEN_eventfd2: + case SEN_eventfd: + case SEN_fanotify_init: + case SEN_inotify_init1: + case SEN_memfd_create: + case SEN_perf_event_open: + case SEN_pipe: + case SEN_pipe2: + case SEN_printargs: + case SEN_socket: + case SEN_socketpair: + case SEN_timerfd_create: + case SEN_timerfd_gettime: + case SEN_timerfd_settime: + case SEN_userfaultfd: /* * These have TRACE_FILE or TRACE_DESCRIPTOR or TRACE_NETWORK set, * but they don't have any file descriptor or path args to test. diff --git a/perf.c b/perf.c new file mode 100644 index 00000000..f151c198 --- /dev/null +++ b/perf.c @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2013 Ben Noordhuis + * Copyright (c) 2013-2015 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include "perf_event_struct.h" + +#include "xlat/clocknames.h" +#include "xlat/hw_breakpoint_len.h" +#include "xlat/hw_breakpoint_type.h" +#include "xlat/perf_attr_size.h" +#include "xlat/perf_branch_sample_type.h" +#include "xlat/perf_event_open_flags.h" +#include "xlat/perf_event_read_format.h" +#include "xlat/perf_event_sample_format.h" +#include "xlat/perf_hw_cache_id.h" +#include "xlat/perf_hw_cache_op_id.h" +#include "xlat/perf_hw_cache_op_result_id.h" +#include "xlat/perf_hw_id.h" +#include "xlat/perf_sw_ids.h" +#include "xlat/perf_type_id.h" + +struct pea_desc { + struct perf_event_attr *attr; + uint32_t size; +}; + +static void +free_pea_desc(void *pea_desc_ptr) +{ + struct pea_desc *desc = pea_desc_ptr; + + free(desc->attr); + free(desc); +} + +static int +fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct pea_desc *desc; + struct perf_event_attr *attr; + uint32_t size; + + if (umove(tcp, addr + offsetof(struct perf_event_attr, size), &size)) { + printaddr(addr); + return 1; + } + + if (size > sizeof(*attr)) + size = sizeof(*attr); + + if (!size) + size = PERF_ATTR_SIZE_VER0; + + /* + * Kernel (rightfully) deems invalid attribute structures with size less + * than first published format size, and we do the same. + */ + if (size < PERF_ATTR_SIZE_VER0) { + printaddr(addr); + return 1; + } + + if (abbrev(tcp)) + size = offsetofend(struct perf_event_attr, config); + + /* Size should be multiple of 8, but kernel doesn't check for it */ + /* size &= ~7; */ + + attr = xcalloc(1, sizeof(*attr)); + + if (umoven_or_printaddr(tcp, addr, size, attr)) { + free(attr); + + return 1; + } + + desc = xmalloc(sizeof(*desc)); + + desc->attr = attr; + desc->size = size; + + set_tcb_priv_data(tcp, desc, free_pea_desc); + + return 0; +} + +#define PRINT_XLAT(prefix, xlat, x, dflt) \ + do { \ + tprints(prefix); \ + printxval_search(xlat, x, dflt); \ + } while (0) + +static void +print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) +{ + static const char *precise_ip_desc[] = { + "arbitrary skid", + "constant skid", + "requested to have 0 skid", + "must have 0 skid", + }; + + struct pea_desc *desc; + struct perf_event_attr *attr; + uint32_t size; + uint32_t new_size; + int use_new_size = 0; + + /* + * Amusingly, kernel accepts structures with only part of the field + * present, so we making check like this (instead of checking + * offsetofend against size) in order to print fields as kernel sees + * them. This also should work great on big endian architectures. + */ + #define _PERF_CHECK_FIELD(_field) \ + do { \ + if (offsetof(struct perf_event_attr, _field) >= size) \ + goto print_perf_event_attr_out; \ + } while (0) + + desc = get_tcb_priv_data(tcp); + + attr = desc->attr; + size = desc->size; + + /* The only error which expected to change size field currently */ + if (tcp->u_error == E2BIG) { + if (umove(tcp, addr + offsetof(struct perf_event_attr, size), + &new_size)) + use_new_size = -1; + else + use_new_size = 1; + } + + PRINT_XLAT("{type=", perf_type_id, attr->type, "PERF_TYPE_???"); + tprintf(", size="); + printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???"); + + if (use_new_size) { + tprints(" => "); + + if (use_new_size > 0) + printxval(perf_attr_size, new_size, + "PERF_ATTR_SIZE_???"); + else + tprints("???"); + } + + switch (attr->type) { + case PERF_TYPE_HARDWARE: + PRINT_XLAT(", config=", perf_hw_id, attr->config, + "PERF_COUNT_HW_???"); + break; + case PERF_TYPE_SOFTWARE: + PRINT_XLAT(", config=", perf_sw_ids, attr->config, + "PERF_COUNT_SW_???"); + break; + case PERF_TYPE_TRACEPOINT: + /* + * "The value to use in config can be obtained from under + * debugfs tracing/events/../../id if ftrace is enabled in the + * kernel." + */ + tprintf(", config=%" PRIu64, attr->config); + break; + case PERF_TYPE_HW_CACHE: + /* + * (perf_hw_cache_id) | (perf_hw_cache_op_id << 8) | + * (perf_hw_cache_op_result_id << 16) + */ + PRINT_XLAT(", config=", perf_hw_cache_id, attr->config & 0xFF, + "PERF_COUNT_HW_CACHE_???"); + PRINT_XLAT("|", perf_hw_cache_op_id, (attr->config >> 8) & 0xFF, + "PERF_COUNT_HW_CACHE_OP_???"); + /* + * Current code (see set_ext_hw_attr in arch/x86/events/core.c, + * tile_map_cache_event in arch/tile/kernel/perf_event.c, + * arc_pmu_cache_event in arch/arc/kernel/perf_event.c, + * hw_perf_cache_event in arch/blackfin/kernel/perf_event.c, + * _hw_perf_cache_event in arch/metag/kernel/perf/perf_event.c, + * mipspmu_map_cache_event in arch/mips/kernel/perf_event_mipsxx.c, + * hw_perf_cache_event in arch/powerpc/perf/core-book3s.c, + * hw_perf_cache_event in arch/powerpc/perf/core-fsl-emb.c, + * hw_perf_cache_event in arch/sh/kernel/perf_event.c, + * sparc_map_cache_event in arch/sparc/kernel/perf_event.c, + * xtensa_pmu_cache_event in arch/xtensa/kernel/perf_event.c, + * armpmu_map_cache_event in drivers/perf/arm_pmu.c) assumes + * that cache result is 8 bits in size. + */ + PRINT_XLAT("<<8|", perf_hw_cache_op_result_id, + (attr->config >> 16) & 0xFF, + "PERF_COUNT_HW_CACHE_RESULT_???"); + tprintf("<<16"); + if (attr->config >> 24) + tprintf("|%#" PRIx64 "<<24 " + "/* PERF_COUNT_HW_CACHE_??? */", + attr->config >> 24); + break; + case PERF_TYPE_RAW: + /* + * "If type is PERF_TYPE_RAW, then a custom "raw" config + * value is needed. Most CPUs support events that are not + * covered by the "generalized" events. These are + * implementation defined; see your CPU manual (for example the + * Intel Volume 3B documentation or the AMD BIOS and Kernel + * Developer Guide). The libpfm4 library can be used to + * translate from the name in the architectural manuals + * to the raw hex value perf_event_open() expects in this + * field." + */ + case PERF_TYPE_BREAKPOINT: + /* + * "If type is PERF_TYPE_BREAKPOINT, then leave config set + * to zero. Its parameters are set in other places." + */ + default: + tprintf(", config=%#" PRIx64, attr->config); + break; + } + + if (abbrev(tcp)) + goto print_perf_event_attr_out; + + if (attr->freq) + tprintf(", sample_freq=%" PRIu64, attr->sample_freq); + else + tprintf(", sample_period=%" PRIu64, attr->sample_period); + + tprintf(", sample_type="); + printflags64(perf_event_sample_format, attr->sample_type, + "PERF_SAMPLE_???"); + + tprintf(", read_format="); + printflags64(perf_event_read_format, attr->read_format, + "PERF_FORMAT_???"); + + tprintf(", disabled=%u" + ", inherit=%u" + ", pinned=%u" + ", exclusive=%u" + ", exclusive_user=%u" + ", exclude_kernel=%u" + ", exclude_hv=%u" + ", exclude_idle=%u" + ", mmap=%u" + ", comm=%u" + ", freq=%u" + ", inherit_stat=%u" + ", enable_on_exec=%u" + ", task=%u" + ", watermark=%u" + ", precise_ip=%u /* %s */" + ", mmap_data=%u" + ", sample_id_all=%u" + ", exclude_host=%u" + ", exclude_guest=%u" + ", exclude_callchain_kernel=%u" + ", exclude_callchain_user=%u" + ", mmap2=%u" + ", comm_exec=%u" + ", use_clockid=%u" + ", context_switch=%u" + ", write_backward=%u", + attr->disabled, + attr->inherit, + attr->pinned, + attr->exclusive, + attr->exclude_user, + attr->exclude_kernel, + attr->exclude_hv, + attr->exclude_idle, + attr->mmap, + attr->comm, + attr->freq, + attr->inherit_stat, + attr->enable_on_exec, + attr->task, + attr->watermark, + attr->precise_ip, precise_ip_desc[attr->precise_ip], + attr->mmap_data, + attr->sample_id_all, + attr->exclude_host, + attr->exclude_guest, + attr->exclude_callchain_kernel, + attr->exclude_callchain_user, + attr->mmap2, + attr->comm_exec, + attr->use_clockid, + attr->context_switch, + attr->write_backward); + + /* + * Print it only in case it is non-zero, since it may contain flags we + * are not aware about. + */ + if (attr->__reserved_1) + tprintf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", + (uint64_t) attr->__reserved_1); + + if (attr->watermark) + tprintf(", wakeup_watermark=%u", attr->wakeup_watermark); + else + tprintf(", wakeup_events=%u", attr->wakeup_events); + + if (attr->type == PERF_TYPE_BREAKPOINT) + /* Any combination of R/W with X is deemed invalid */ + PRINT_XLAT(", bp_type=", hw_breakpoint_type, attr->bp_type, + (attr->bp_type <= + (HW_BREAKPOINT_X | HW_BREAKPOINT_RW)) ? + "HW_BREAKPOINT_INVALID" : + "HW_BREAKPOINT_???"); + + if (attr->type == PERF_TYPE_BREAKPOINT) + tprintf(", bp_addr=%#" PRIx64, attr->bp_addr); + else + tprintf(", config1=%#" PRIx64, attr->config1); + + /* + * Fields after bp_addr/config1 are optional and may not present; check + * against size is needed. + */ + + _PERF_CHECK_FIELD(bp_len); + if (attr->type == PERF_TYPE_BREAKPOINT) + tprintf(", bp_len=%" PRIu64, attr->bp_len); + else + tprintf(", config2=%#" PRIx64, attr->config2); + + _PERF_CHECK_FIELD(branch_sample_type); + if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) { + tprintf(", branch_sample_type="); + printflags64(perf_branch_sample_type, attr->branch_sample_type, + "PERF_SAMPLE_BRANCH_???"); + } + + _PERF_CHECK_FIELD(sample_regs_user); + /* + * "This bit mask defines the set of user CPU registers to dump on + * samples. The layout of the register mask is architecture-specific and + * described in the kernel header + * arch/ARCH/include/uapi/asm/perf_regs.h." + */ + tprintf(", sample_regs_user=%#" PRIx64, attr->sample_regs_user); + + _PERF_CHECK_FIELD(sample_stack_user); + /* + * "size of the user stack to dump if PERF_SAMPLE_STACK_USER is + * specified." + */ + if (attr->sample_type & PERF_SAMPLE_STACK_USER) + tprintf(", sample_stack_user=%#" PRIx32, + attr->sample_stack_user); + + if (attr->use_clockid) { + _PERF_CHECK_FIELD(clockid); + tprintf(", clockid="); + printxval(clocknames, attr->clockid, "CLOCK_???"); + } + + _PERF_CHECK_FIELD(sample_regs_intr); + tprintf(", sample_regs_intr=%#" PRIx64, attr->sample_regs_intr); + + _PERF_CHECK_FIELD(aux_watermark); + tprintf(", aux_watermark=%" PRIu32, attr->aux_watermark); + + _PERF_CHECK_FIELD(sample_max_stack); + tprintf(", sample_max_stack=%" PRIu16, attr->sample_max_stack); + + /* _PERF_CHECK_FIELD(__reserved_2); + tprintf(", __reserved2=%" PRIu16, attr->__reserved_2); */ + +print_perf_event_attr_out: + if ((attr->size && (attr->size > size)) || + (!attr->size && (size < PERF_ATTR_SIZE_VER0))) + tprintf(", ..."); + + tprintf("}"); +} + +SYS_FUNC(perf_event_open) +{ + /* + * We try to copy out the whole structure on entering in order to check + * size value on exiting. We do not check the rest of the fields because + * they shouldn't be changed, but copy the whole structure instead + * of just size field because they could. + */ + if (entering(tcp)) { + if (!fetch_perf_event_attr(tcp, tcp->u_arg[0])) + return 0; + } else { + print_perf_event_attr(tcp, tcp->u_arg[0]); + } + + tprintf(", %d, %d, %d, ", + (int) tcp->u_arg[1], + (int) tcp->u_arg[2], + (int) tcp->u_arg[3]); + printflags64(perf_event_open_flags, tcp->u_arg[4], "PERF_FLAG_???"); + + return RVAL_DECODED | RVAL_FD; +} diff --git a/perf_event_struct.h b/perf_event_struct.h new file mode 100644 index 00000000..161f6383 --- /dev/null +++ b/perf_event_struct.h @@ -0,0 +1,73 @@ +#ifndef STRACE_LINUX_PERF_EVENT_STRUCT_H +#define STRACE_LINUX_PERF_EVENT_STRUCT_H + +#include + +struct perf_event_attr { + uint32_t type; + uint32_t size; + uint64_t config; + union { + uint64_t sample_period; + uint64_t sample_freq; + }; + uint64_t sample_type; + uint64_t read_format; + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + __reserved_1 :36; + union { + uint32_t wakeup_events; + uint32_t wakeup_watermark; + }; + uint32_t bp_type; + union { + uint64_t bp_addr; + uint64_t config1; + }; + /* End of ver 0 - 64 bytes */ + union { + uint64_t bp_len; + uint64_t config2; + }; + /* End of ver 1 - 72 bytes */ + uint64_t branch_sample_type; + /* End of ver 2 - 80 bytes */ + uint64_t sample_regs_user; + uint32_t sample_stack_user; + int32_t clockid; + /* End of ver 3 - 96 bytes */ + uint64_t sample_regs_intr; + /* End of ver 4 - 104 bytes */ + uint32_t aux_watermark; + uint16_t sample_max_stack; + uint16_t __reserved_2; + /* End of ver 5 - 112 bytes */ +}; + +#endif /* !STRACE_LINUX_PERF_EVENT_STRUCT_H */ diff --git a/personality.c b/personality.c new file mode 100644 index 00000000..44ed5e3b --- /dev/null +++ b/personality.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include "xlat/personality_types.h" +#include "xlat/personality_flags.h" + + +SYS_FUNC(personality) +{ + unsigned int pers; + + if (entering(tcp)) { + pers = tcp->u_arg[0]; + if (0xffffffff == pers) { + tprints("0xffffffff"); + } else { + printxval(personality_types, pers & PER_MASK, "PER_???"); + pers &= ~PER_MASK; + if (pers) { + tprints("|"); + printflags(personality_flags, pers, NULL); + } + } + return 0; + } + + if (syserror(tcp)) + return 0; + + pers = tcp->u_rval; + const char *type = xlookup(personality_types, pers & PER_MASK); + char *p; + static char outstr[1024]; + if (type) + p = stpcpy(outstr, type); + else + p = outstr + sprintf(outstr, "%#x /* %s */", pers & PER_MASK, "PER_???"); + pers &= ~PER_MASK; + if (pers) + strcpy(p, sprintflags("|", personality_flags, pers)); + tcp->auxstr = outstr; + return RVAL_HEX | RVAL_STR; +} diff --git a/pkeys.c b/pkeys.c new file mode 100644 index 00000000..f5338ab8 --- /dev/null +++ b/pkeys.c @@ -0,0 +1,18 @@ +#include "defs.h" + +#include "xlat/pkey_access.h" + +SYS_FUNC(pkey_alloc) +{ + tprintf("%#" PRI_klx ", ", tcp->u_arg[0]); + printflags64(pkey_access, tcp->u_arg[1], "PKEY_???"); + + return RVAL_DECODED; +} + +SYS_FUNC(pkey_free) +{ + tprintf("%d", (int) tcp->u_arg[0]); + + return RVAL_DECODED; +} diff --git a/poll.c b/poll.c new file mode 100644 index 00000000..f2a23814 --- /dev/null +++ b/poll.c @@ -0,0 +1,187 @@ +/* + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +#include "xlat/pollflags.h" + +static bool +print_pollfd(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const struct pollfd *fds = elem_buf; + + tprints("{fd="); + printfd(tcp, fds->fd); + if (fds->fd >= 0) { + tprints(", events="); + printflags(pollflags, (unsigned short) fds->events, "POLL???"); + } + tprints("}"); + + return true; +} + +static void +decode_poll_entering(struct tcb *tcp) +{ + const kernel_ulong_t addr = tcp->u_arg[0]; + const unsigned int nfds = tcp->u_arg[1]; + struct pollfd fds; + + print_array(tcp, addr, nfds, &fds, sizeof(fds), + umoven_or_printaddr, print_pollfd, 0); + tprintf(", %u, ", nfds); +} + +static int +decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts) +{ + struct pollfd fds; + const unsigned int nfds = tcp->u_arg[1]; + const unsigned long size = sizeof(fds) * nfds; + const kernel_ulong_t start = tcp->u_arg[0]; + const kernel_ulong_t end = start + size; + kernel_ulong_t cur; + const unsigned int max_printed = + abbrev(tcp) ? max_strlen : -1U; + unsigned int printed; + + static char outstr[1024]; + char *outptr; +#define end_outstr (outstr + sizeof(outstr)) + + if (syserror(tcp)) + return 0; + if (tcp->u_rval == 0) { + tcp->auxstr = "Timeout"; + return RVAL_STR; + } + + if (!verbose(tcp) || !start || !nfds || + size / sizeof(fds) != nfds || end < start) + return 0; + + outptr = outstr; + + for (printed = 0, cur = start; cur < end; cur += sizeof(fds)) { + if (umove(tcp, cur, &fds) < 0) { + if (outptr == outstr) + *outptr++ = '['; + else + outptr = stpcpy(outptr, ", "); + outptr += sprintf(outptr, "%#" PRI_klx, cur); + break; + } + if (!fds.revents) + continue; + if (outptr == outstr) + *outptr++ = '['; + else + outptr = stpcpy(outptr, ", "); + if (printed >= max_printed) { + outptr = stpcpy(outptr, "..."); + break; + } + + static const char fmt[] = "{fd=%d, revents="; + char fdstr[sizeof(fmt) + sizeof(int) * 3]; + sprintf(fdstr, fmt, fds.fd); + + const char *flagstr = sprintflags("", pollflags, + (unsigned short) fds.revents); + + if (outptr + strlen(fdstr) + strlen(flagstr) + 1 >= + end_outstr - (2 + 2 * sizeof(long) + sizeof(", ], ..."))) { + outptr = stpcpy(outptr, "..."); + break; + } + outptr = stpcpy(outptr, fdstr); + outptr = stpcpy(outptr, flagstr); + *outptr++ = '}'; + ++printed; + } + + if (outptr != outstr) + *outptr++ = ']'; + + *outptr = '\0'; + if (pts) { + const char *str = sprint_timespec(tcp, pts); + + if (outptr + sizeof(", left ") + strlen(str) < end_outstr) { + outptr = stpcpy(outptr, outptr == outstr ? "left " : ", left "); + outptr = stpcpy(outptr, str); + } else { + outptr = stpcpy(outptr, ", ..."); + } + } + + if (outptr == outstr) + return 0; + + tcp->auxstr = outstr; + return RVAL_STR; +#undef end_outstr +} + +SYS_FUNC(poll) +{ + if (entering(tcp)) { + decode_poll_entering(tcp); + int timeout = tcp->u_arg[2]; + +#ifdef INFTIM + if (INFTIM == timeout) + tprints("INFTIM"); + else +#endif + tprintf("%d", timeout); + + return 0; + } else { + return decode_poll_exiting(tcp, 0); + } +} + +SYS_FUNC(ppoll) +{ + if (entering(tcp)) { + decode_poll_entering(tcp); + + print_timespec(tcp, tcp->u_arg[2]); + tprints(", "); + /* NB: kernel requires arg[4] == NSIG_BYTES */ + print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]); + tprintf(", %" PRI_klu, tcp->u_arg[4]); + + return 0; + } else { + return decode_poll_exiting(tcp, tcp->u_arg[2]); + } +} diff --git a/prctl.c b/prctl.c new file mode 100644 index 00000000..6779ad51 --- /dev/null +++ b/prctl.c @@ -0,0 +1,377 @@ +/* + * Copyright (c) 1994-1996 Rick Sladkey + * Copyright (c) 1996-2000 Wichert Akkerman + * Copyright (c) 2005-2007 Roland McGrath + * Copyright (c) 2008-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +#include "xlat/prctl_options.h" +#include "xlat/pr_cap_ambient.h" +#include "xlat/pr_dumpable.h" +#include "xlat/pr_fp_mode.h" +#include "xlat/pr_mce_kill.h" +#include "xlat/pr_mce_kill_policy.h" +#include "xlat/pr_set_mm.h" +#include "xlat/pr_tsc.h" +#include "xlat/pr_unalign_flags.h" + +#ifndef TASK_COMM_LEN +# define TASK_COMM_LEN 16 +#endif + +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#include "xlat/seccomp_mode.h" + +#ifdef HAVE_LINUX_SECUREBITS_H +# include +#endif +#include "xlat/secbits.h" + +/* these constants are the same as in */ +enum { +#include "caps0.h" +#include "caps1.h" +}; + +#include "xlat/cap.h" + +static void +print_prctl_args(struct tcb *tcp, const unsigned int first) +{ + unsigned int i; + + for (i = first; i < tcp->s_ent->nargs; ++i) + tprintf(", %#" PRI_klx, tcp->u_arg[i]); +} + +SYS_FUNC(prctl) +{ + const unsigned int option = tcp->u_arg[0]; + const kernel_ulong_t arg2 = tcp->u_arg[1]; + const kernel_ulong_t arg3 = tcp->u_arg[2]; + /* + * PR_SET_VMA is the only command which actually uses these arguments + * currently, and it is available only on Android for now. + */ +#ifdef __ANDROID__ + const kernel_ulong_t arg4 = tcp->u_arg[3]; + const kernel_ulong_t arg5 = tcp->u_arg[4]; +#endif + unsigned int i; + + if (entering(tcp)) + printxval(prctl_options, option, "PR_???"); + + switch (option) { + case PR_GET_KEEPCAPS: + case PR_GET_SECCOMP: + case PR_GET_TIMERSLACK: + case PR_GET_TIMING: + return RVAL_DECODED; + + case PR_GET_CHILD_SUBREAPER: + case PR_GET_ENDIAN: + case PR_GET_FPEMU: + case PR_GET_FPEXC: + if (entering(tcp)) + tprints(", "); + else + printnum_int(tcp, arg2, "%u"); + break; + + case PR_GET_DUMPABLE: + if (entering(tcp)) + break; + if (syserror(tcp)) + return 0; + tcp->auxstr = xlookup(pr_dumpable, (kernel_ulong_t) tcp->u_rval); + return RVAL_STR; + + case PR_GET_NAME: + if (entering(tcp)) { + tprints(", "); + } else { + if (syserror(tcp)) + printaddr(arg2); + else + printstr_ex(tcp, arg2, TASK_COMM_LEN, + QUOTE_0_TERMINATED); + } + break; + + case PR_GET_PDEATHSIG: + if (entering(tcp)) { + tprints(", "); + } else if (!umove_or_printaddr(tcp, arg2, &i)) { + tprints("["); + tprints(signame(i)); + tprints("]"); + } + break; + + case PR_GET_SECUREBITS: + if (entering(tcp)) + break; + if (syserror(tcp) || tcp->u_rval == 0) + return 0; + tcp->auxstr = sprintflags("", secbits, + (kernel_ulong_t) tcp->u_rval); + return RVAL_STR; + + case PR_GET_TID_ADDRESS: + if (entering(tcp)) + tprints(", "); + else + printnum_kptr(tcp, arg2); + break; + + case PR_GET_TSC: + if (entering(tcp)) { + tprints(", "); + } else if (!umove_or_printaddr(tcp, arg2, &i)) { + tprints("["); + printxval(pr_tsc, i, "PR_TSC_???"); + tprints("]"); + } + break; + + case PR_GET_UNALIGN: + if (entering(tcp)) { + tprints(", "); + } else if (!umove_or_printaddr(tcp, arg2, &i)) { + tprints("["); + printflags(pr_unalign_flags, i, "PR_UNALIGN_???"); + tprints("]"); + } + break; + + case PR_GET_FP_MODE: + if (entering(tcp)) + break; + if (syserror(tcp) || tcp->u_rval == 0) + return 0; + tcp->auxstr = sprintflags("", pr_fp_mode, + (kernel_ulong_t) tcp->u_rval); + return RVAL_STR; + + /* PR_TASK_PERF_EVENTS_* take no arguments. */ + case PR_TASK_PERF_EVENTS_DISABLE: + case PR_TASK_PERF_EVENTS_ENABLE: + return RVAL_DECODED; + + case PR_SET_CHILD_SUBREAPER: + case PR_SET_ENDIAN: + case PR_SET_FPEMU: + case PR_SET_FPEXC: + case PR_SET_KEEPCAPS: + case PR_SET_TIMING: + tprintf(", %" PRI_klu, arg2); + return RVAL_DECODED; + + case PR_SET_DUMPABLE: + tprints(", "); + printxval64(pr_dumpable, arg2, "SUID_DUMP_???"); + return RVAL_DECODED; + + case PR_CAPBSET_DROP: + case PR_CAPBSET_READ: + tprints(", "); + printxval64(cap, arg2, "CAP_???"); + return RVAL_DECODED; + + case PR_CAP_AMBIENT: + tprints(", "); + printxval64(pr_cap_ambient, arg2, + "PR_CAP_AMBIENT_???"); + switch (arg2) { + case PR_CAP_AMBIENT_RAISE: + case PR_CAP_AMBIENT_LOWER: + case PR_CAP_AMBIENT_IS_SET: + tprints(", "); + printxval64(cap, arg3, "CAP_???"); + print_prctl_args(tcp, 3); + break; + default: + print_prctl_args(tcp, 2); + break; + } + return RVAL_DECODED; + + case PR_MCE_KILL: + tprints(", "); + printxval64(pr_mce_kill, arg2, "PR_MCE_KILL_???"); + tprints(", "); + if (PR_MCE_KILL_SET == arg2) + printxval64(pr_mce_kill_policy, arg3, + "PR_MCE_KILL_???"); + else + tprintf("%#" PRI_klx, arg3); + print_prctl_args(tcp, 3); + return RVAL_DECODED; + + case PR_SET_NAME: + tprints(", "); + printstr_ex(tcp, arg2, TASK_COMM_LEN - 1, + QUOTE_0_TERMINATED); + return RVAL_DECODED; + +#ifdef __ANDROID__ +# ifndef PR_SET_VMA_ANON_NAME +# define PR_SET_VMA_ANON_NAME 0 +# endif + case PR_SET_VMA: + if (arg2 == PR_SET_VMA_ANON_NAME) { + tprintf(", PR_SET_VMA_ANON_NAME, %#" PRI_klx, arg3); + tprintf(", %" PRI_klu ", ", arg4); + printstr(tcp, arg5); + } else { + /* There are no other sub-options now, but there + * might be in future... */ + print_prctl_args(tcp, 1); + } + return RVAL_DECODED; +#endif + + case PR_SET_MM: + tprints(", "); + printxval(pr_set_mm, arg2, "PR_SET_MM_???"); + print_prctl_args(tcp, 2); + return RVAL_DECODED; + + case PR_SET_PDEATHSIG: + tprints(", "); + if (arg2 > 128) + tprintf("%" PRI_klu, arg2); + else + tprints(signame(arg2)); + return RVAL_DECODED; + + case PR_SET_PTRACER: + tprints(", "); + if ((int) arg2 == -1) + tprints("PR_SET_PTRACER_ANY"); + else + tprintf("%" PRI_klu, arg2); + return RVAL_DECODED; + + case PR_SET_SECCOMP: + tprints(", "); + printxval64(seccomp_mode, arg2, + "SECCOMP_MODE_???"); + if (SECCOMP_MODE_STRICT == arg2) + return RVAL_DECODED; + if (SECCOMP_MODE_FILTER == arg2) { + tprints(", "); + print_seccomp_filter(tcp, arg3); + return RVAL_DECODED; + } + print_prctl_args(tcp, 2); + return RVAL_DECODED; + + case PR_SET_SECUREBITS: + tprints(", "); + printflags64(secbits, arg2, "SECBIT_???"); + return RVAL_DECODED; + + case PR_SET_TIMERSLACK: + tprintf(", %" PRI_kld, arg2); + return RVAL_DECODED; + + case PR_SET_TSC: + tprints(", "); + printxval(pr_tsc, arg2, "PR_TSC_???"); + return RVAL_DECODED; + + case PR_SET_UNALIGN: + tprints(", "); + printflags(pr_unalign_flags, arg2, "PR_UNALIGN_???"); + return RVAL_DECODED; + + case PR_SET_NO_NEW_PRIVS: + case PR_SET_THP_DISABLE: + tprintf(", %" PRI_klu, arg2); + print_prctl_args(tcp, 2); + return RVAL_DECODED; + + case PR_MCE_KILL_GET: + if (entering(tcp)) { + print_prctl_args(tcp, 1); + return 0; + } + if (syserror(tcp)) + return 0; + tcp->auxstr = xlookup(pr_mce_kill_policy, + (kernel_ulong_t) tcp->u_rval); + return tcp->auxstr ? RVAL_STR : RVAL_UDECIMAL; + + case PR_SET_FP_MODE: + tprints(", "); + printflags(pr_fp_mode, arg2, "PR_FP_MODE_???"); + return RVAL_DECODED; + + case PR_GET_NO_NEW_PRIVS: + case PR_GET_THP_DISABLE: + case PR_MPX_DISABLE_MANAGEMENT: + case PR_MPX_ENABLE_MANAGEMENT: + default: + print_prctl_args(tcp, 1); + return RVAL_DECODED; + } + return 0; +} + +#if defined X86_64 || defined X32 +# include +# include "xlat/archvals.h" + +SYS_FUNC(arch_prctl) +{ + const unsigned int option = tcp->u_arg[0]; + const kernel_ulong_t addr = tcp->u_arg[1]; + + if (entering(tcp)) + printxval(archvals, option, "ARCH_???"); + + switch (option) { + case ARCH_GET_GS: + case ARCH_GET_FS: + if (entering(tcp)) + tprints(", "); + else + printnum_ptr(tcp, addr); + return 0; + } + + tprintf(", %#" PRI_klx, addr); + return RVAL_DECODED; +} +#endif /* X86_64 || X32 */ diff --git a/print_dev_t.c b/print_dev_t.c new file mode 100644 index 00000000..9b62f842 --- /dev/null +++ b/print_dev_t.c @@ -0,0 +1,37 @@ +/* + * Device number printing routine. + * + * Copyright (c) 2016 The strace developers. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +void +print_dev_t(const unsigned long long dev) +{ + tprintf("makedev(%u, %u)", major(dev), minor(dev)); +} diff --git a/print_mq_attr.c b/print_mq_attr.c new file mode 100644 index 00000000..b5f9c134 --- /dev/null +++ b/print_mq_attr.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2004 Ulrich Drepper + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(mq_attr_t) + +#ifdef HAVE_MQUEUE_H +# include +typedef struct mq_attr mq_attr_t; +#elif defined HAVE_LINUX_MQUEUE_H +# include +# include +typedef struct mq_attr mq_attr_t; +#endif + +#include "xlat/mq_attr_flags.h" + +#include MPERS_DEFS + +MPERS_PRINTER_DECL(void, printmqattr, struct tcb *const tcp, + const kernel_ulong_t addr, const bool decode_flags) +{ +#if defined HAVE_MQUEUE_H || defined HAVE_LINUX_MQUEUE_H + mq_attr_t attr; + if (umove_or_printaddr(tcp, addr, &attr)) + return; + tprints("{mq_flags="); + if (decode_flags) + printflags64(mq_attr_flags, + zero_extend_signed_to_ull(attr.mq_flags), + "/* O_??? */"); + else + tprintf("%#llx", zero_extend_signed_to_ull(attr.mq_flags)); + tprintf(", mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}", + sign_extend_unsigned_to_ll(attr.mq_maxmsg), + sign_extend_unsigned_to_ll(attr.mq_msgsize), + sign_extend_unsigned_to_ll(attr.mq_curmsgs)); +#else + printaddr(addr); +#endif +} diff --git a/print_msgbuf.c b/print_msgbuf.c new file mode 100644 index 00000000..348a8914 --- /dev/null +++ b/print_msgbuf.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 1993 Ulrich Pegelow + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2003-2006 Roland McGrath + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +#include DEF_MPERS_TYPE(msgbuf_t) +typedef struct msgbuf msgbuf_t; +#include MPERS_DEFS + +MPERS_PRINTER_DECL(void, tprint_msgbuf, struct tcb *const tcp, + const kernel_ulong_t addr, const kernel_ulong_t count) +{ + msgbuf_t msg; + + if (!umove_or_printaddr(tcp, addr, &msg)) { + tprintf("{%" PRI_kld ", ", (kernel_long_t) msg.mtype); + printstrn(tcp, addr + sizeof(msg.mtype), count); + tprints("}"); + } + tprintf(", %" PRI_klu ", ", count); +} diff --git a/print_sg_req_info.c b/print_sg_req_info.c new file mode 100644 index 00000000..9f0249ec --- /dev/null +++ b/print_sg_req_info.c @@ -0,0 +1,74 @@ +/* + * Decode struct sg_req_info. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_SCSI_SG_H + +#include DEF_MPERS_TYPE(struct_sg_req_info) + +# include + +typedef struct sg_req_info struct_sg_req_info; + +#endif /* HAVE_SCSI_SG_H */ + +#include MPERS_DEFS + +#ifdef HAVE_SCSI_SG_H + +MPERS_PRINTER_DECL(int, decode_sg_req_info, + struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct_sg_req_info info; + + if (entering(tcp)) + return 0; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &info)) { + tprintf("{req_state=%hhd" + ", orphan=%hhd" + ", sg_io_owned=%hhd" + ", problem=%hhd" + ", pack_id=%d" + ", usr_ptr=", + info.req_state, + info.orphan, + info.sg_io_owned, + info.problem, + info.pack_id); + printaddr(ptr_to_kulong(info.usr_ptr)); + tprintf(", duration=%u}", info.duration); + } + + return RVAL_DECODED | 1; +} + +#endif /* HAVE_SCSI_SG_H */ diff --git a/print_sigevent.c b/print_sigevent.c new file mode 100644 index 00000000..cfdbc087 --- /dev/null +++ b/print_sigevent.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2003, 2004 Ulrich Drepper + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_sigevent) +#include "sigevent.h" +#include MPERS_DEFS + +#include +#include "xlat/sigev_value.h" + +MPERS_PRINTER_DECL(void, print_sigevent, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct_sigevent sev; + + if (umove_or_printaddr(tcp, addr, &sev)) + return; + + tprints("{"); + if (sev.sigev_value.sival_ptr) { + tprintf("sigev_value={sival_int=%d, sival_ptr=", + sev.sigev_value.sival_int); + printaddr(sev.sigev_value.sival_ptr); + tprints("}, "); + } + + tprints("sigev_signo="); + switch (sev.sigev_notify) { + case SIGEV_SIGNAL: + case SIGEV_THREAD: + case SIGEV_THREAD_ID: + tprints(signame(sev.sigev_signo)); + break; + default: + tprintf("%u", sev.sigev_signo); + } + + tprints(", sigev_notify="); + printxval(sigev_value, sev.sigev_notify, "SIGEV_???"); + + switch (sev.sigev_notify) { + case SIGEV_THREAD_ID: + tprintf(", sigev_notify_thread_id=%d", sev.sigev_un.tid); + break; + case SIGEV_THREAD: + tprints(", sigev_notify_function="); + printaddr(sev.sigev_un.sigev_thread.function); + tprints(", sigev_notify_attributes="); + printaddr(sev.sigev_un.sigev_thread.attribute); + break; + } + tprints("}"); +} diff --git a/print_statfs.c b/print_statfs.c new file mode 100644 index 00000000..c98ff8fe --- /dev/null +++ b/print_statfs.c @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "statfs.h" +#include "xlat/fsmagic.h" +#include "xlat/statfs_flags.h" + +static void +print_statfs_type(const char *const prefix, const unsigned long long magic) +{ + tprints(prefix); + printxval_search(fsmagic, magic, NULL); +} + +#if defined HAVE_STRUCT_STATFS_F_FLAGS || defined HAVE_STRUCT_STATFS64_F_FLAGS +static void +print_statfs_flags(const char *const prefix, const unsigned long long flags) +{ + if (flags & ST_VALID) { + tprints(prefix); + printflags64(statfs_flags, flags, "ST_???"); + } +} +#endif /* HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS */ + +static void +print_statfs_number(const char *const prefix, const unsigned long long number) +{ + tprints(prefix); + tprintf("%llu", number); +} + +void +print_struct_statfs(struct tcb *const tcp, const kernel_ulong_t addr) +{ +#ifdef HAVE_STRUCT_STATFS + struct strace_statfs b; + + if (!fetch_struct_statfs(tcp, addr, &b)) + return; + + print_statfs_type("{f_type=", b.f_type); + print_statfs_number(", f_bsize=", b.f_bsize); + print_statfs_number(", f_blocks=", b.f_blocks); + print_statfs_number(", f_bfree=", b.f_bfree); + print_statfs_number(", f_bavail=", b.f_bavail); + print_statfs_number(", f_files=", b.f_files); + print_statfs_number(", f_ffree=", b.f_ffree); +# if defined HAVE_STRUCT_STATFS_F_FSID_VAL \ + || defined HAVE_STRUCT_STATFS_F_FSID___VAL + print_statfs_number(", f_fsid={val=[", b.f_fsid[0]); + print_statfs_number(", ", b.f_fsid[1]); + tprints("]}"); +# endif + print_statfs_number(", f_namelen=", b.f_namelen); +# ifdef HAVE_STRUCT_STATFS_F_FRSIZE + print_statfs_number(", f_frsize=", b.f_frsize); +# endif +# ifdef HAVE_STRUCT_STATFS_F_FLAGS + print_statfs_flags(", f_flags=", b.f_flags); +# endif + tprints("}"); +#else + printaddr(addr); +#endif +} + +void +print_struct_statfs64(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t size) +{ +#ifdef HAVE_STRUCT_STATFS64 + struct strace_statfs b; + + if (!fetch_struct_statfs64(tcp, addr, size, &b)) + return; + + print_statfs_type("{f_type=", b.f_type); + print_statfs_number(", f_bsize=", b.f_bsize); + print_statfs_number(", f_blocks=", b.f_blocks); + print_statfs_number(", f_bfree=", b.f_bfree); + print_statfs_number(", f_bavail=", b.f_bavail); + print_statfs_number(", f_files=", b.f_files); + print_statfs_number(", f_ffree=", b.f_ffree); +# if defined HAVE_STRUCT_STATFS64_F_FSID_VAL \ + || defined HAVE_STRUCT_STATFS64_F_FSID___VAL + print_statfs_number(", f_fsid={val=[", b.f_fsid[0]); + print_statfs_number(", ", b.f_fsid[1]); + tprints("]}"); +# endif + print_statfs_number(", f_namelen=", b.f_namelen); +# ifdef HAVE_STRUCT_STATFS64_F_FRSIZE + print_statfs_number(", f_frsize=", b.f_frsize); +# endif +# ifdef HAVE_STRUCT_STATFS64_F_FLAGS + print_statfs_flags(", f_flags=", b.f_flags); +# endif + tprints("}"); +#else + printaddr(addr); +#endif +} diff --git a/print_struct_stat.c b/print_struct_stat.c new file mode 100644 index 00000000..7e9e2338 --- /dev/null +++ b/print_struct_stat.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 1999-2003 Ulrich Drepper + * Copyright (c) 2004 David S. Miller + * Copyright (c) 2003-2005 Roland McGrath + * Copyright (c) 2007 Jan Kratochvil + * Copyright (c) 2009 Denys Vlasenko + * Copyright (c) 2009-2010 Andreas Schwab + * Copyright (c) 2012 H.J. Lu + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include "stat.h" + +void +print_struct_stat(struct tcb *tcp, const struct strace_stat *const st) +{ + tprints("{"); + if (!abbrev(tcp)) { + tprints("st_dev="); + print_dev_t(st->dev); + tprintf(", st_ino=%llu, st_mode=", st->ino); + print_symbolic_mode_t(st->mode); + tprintf(", st_nlink=%llu, st_uid=%llu, st_gid=%llu", + st->nlink, st->uid, st->gid); + tprintf(", st_blksize=%llu", st->blksize); + tprintf(", st_blocks=%llu", st->blocks); + } else { + tprints("st_mode="); + print_symbolic_mode_t(st->mode); + } + + switch (st->mode & S_IFMT) { + case S_IFCHR: case S_IFBLK: + tprints(", st_rdev="); + print_dev_t(st->rdev); + break; + default: + tprintf(", st_size=%llu", st->size); + break; + } + + if (!abbrev(tcp)) { + tprints(", st_atime="); + tprints(sprinttime(st->atime)); + if (st->atime_nsec) + tprintf(".%09llu", st->atime_nsec); + tprints(", st_mtime="); + tprints(sprinttime(st->mtime)); + if (st->mtime_nsec) + tprintf(".%09llu", st->mtime_nsec); + tprints(", st_ctime="); + tprints(sprinttime(st->ctime)); + if (st->ctime_nsec) + tprintf(".%09llu", st->ctime_nsec); + } else { + tprints(", ..."); + } + tprints("}"); +} diff --git a/print_time.c b/print_time.c new file mode 100644 index 00000000..82d64fa2 --- /dev/null +++ b/print_time.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(time_t) + +#include MPERS_DEFS + +SYS_FUNC(time) +{ + if (exiting(tcp)) { + time_t t; + + if (!umove_or_printaddr(tcp, tcp->u_arg[0], &t)) + tprintf("[%jd]", (intmax_t) t); + } + + return 0; +} diff --git a/print_timespec.c b/print_timespec.c new file mode 100644 index 00000000..76c70edb --- /dev/null +++ b/print_timespec.c @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(timespec_t) + +typedef struct timespec timespec_t; + +#include MPERS_DEFS + +#ifndef UTIME_NOW +# define UTIME_NOW ((1l << 30) - 1l) +#endif +#ifndef UTIME_OMIT +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +static const char timespec_fmt[] = "{tv_sec=%jd, tv_nsec=%jd}"; + +static void +print_timespec_t(const timespec_t *t) +{ + tprintf(timespec_fmt, (intmax_t) t->tv_sec, (intmax_t) t->tv_nsec); +} + +static void +print_timespec_t_utime(const timespec_t *t) +{ + switch (t->tv_nsec) { + case UTIME_NOW: + tprints("UTIME_NOW"); + break; + case UTIME_OMIT: + tprints("UTIME_OMIT"); + break; + default: + print_timespec_t(t); + break; + } +} + +MPERS_PRINTER_DECL(void, print_timespec, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timespec_t t; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + print_timespec_t(&t); +} + +MPERS_PRINTER_DECL(const char *, sprint_timespec, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timespec_t t; + static char buf[sizeof(timespec_fmt) + 3 * sizeof(t)]; + + if (!addr) { + strcpy(buf, "NULL"); + } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || + umove(tcp, addr, &t)) { + snprintf(buf, sizeof(buf), "%#" PRI_klx, addr); + } else { + snprintf(buf, sizeof(buf), timespec_fmt, + (intmax_t) t.tv_sec, (intmax_t) t.tv_nsec); + } + + return buf; +} + +MPERS_PRINTER_DECL(void, print_timespec_utime_pair, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timespec_t t[2]; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + tprints("["); + print_timespec_t_utime(&t[0]); + tprints(", "); + print_timespec_t_utime(&t[1]); + tprints("]"); +} + +MPERS_PRINTER_DECL(void, print_itimerspec, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timespec_t t[2]; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + tprints("{it_interval="); + print_timespec_t(&t[0]); + tprints(", it_value="); + print_timespec_t(&t[1]); + tprints("}"); +} diff --git a/print_timeval.c b/print_timeval.c new file mode 100644 index 00000000..5c286754 --- /dev/null +++ b/print_timeval.c @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(timeval_t) + +typedef struct timeval timeval_t; + +#include MPERS_DEFS + +static const char timeval_fmt[] = "{tv_sec=%jd, tv_usec=%jd}"; + +static void +print_timeval_t(const timeval_t *t) +{ + tprintf(timeval_fmt, (intmax_t) t->tv_sec, (intmax_t) t->tv_usec); +} + +MPERS_PRINTER_DECL(void, print_struct_timeval, const void *arg) +{ + print_timeval_t(arg); +} + +MPERS_PRINTER_DECL(void, print_timeval, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval_t t; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + print_timeval_t(&t); +} + +static bool +print_timeval_item(struct tcb *tcp, void *elem_buf, size_t size, void *data) +{ + timeval_t *t = elem_buf; + + print_timeval_t(t); + + return true; +} + +MPERS_PRINTER_DECL(void, print_timeval_pair, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval_t t; + + print_array(tcp, addr, 2, &t, sizeof(t), umoven_or_printaddr, + print_timeval_item, NULL); +} + +MPERS_PRINTER_DECL(const char *, sprint_timeval, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval_t t; + static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)]; + + if (!addr) { + strcpy(buf, "NULL"); + } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || + umove(tcp, addr, &t)) { + snprintf(buf, sizeof(buf), "%#" PRI_klx, addr); + } else { + snprintf(buf, sizeof(buf), timeval_fmt, + (intmax_t) t.tv_sec, (intmax_t) t.tv_usec); + } + + return buf; +} + +MPERS_PRINTER_DECL(void, print_itimerval, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval_t t[2]; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + tprints("{it_interval="); + print_timeval_t(&t[0]); + tprints(", it_value="); + print_timeval_t(&t[1]); + tprints("}"); +} + +#ifdef ALPHA + +void +print_timeval32_t(const timeval32_t *t) +{ + tprintf(timeval_fmt, (intmax_t) t->tv_sec, (intmax_t) t->tv_usec); +} + +void +print_timeval32(struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval32_t t; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + print_timeval32_t(&t); +} + +void +print_timeval32_pair(struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval32_t t[2]; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + tprints("["); + print_timeval32_t(&t[0]); + tprints(", "); + print_timeval32_t(&t[1]); + tprints("]"); +} + +void +print_itimerval32(struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval32_t t[2]; + + if (umove_or_printaddr(tcp, addr, &t)) + return; + + tprints("{it_interval="); + print_timeval32_t(&t[0]); + tprints(", it_value="); + print_timeval32_t(&t[1]); + tprints("}"); +} + +const char * +sprint_timeval32(struct tcb *const tcp, const kernel_ulong_t addr) +{ + timeval32_t t; + static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)]; + + if (!addr) { + strcpy(buf, "NULL"); + } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || + umove(tcp, addr, &t)) { + snprintf(buf, sizeof(buf), "%#" PRI_klx, addr); + } else { + snprintf(buf, sizeof(buf), timeval_fmt, + (intmax_t) t.tv_sec, (intmax_t) t.tv_usec); + } + + return buf; +} + +#endif /* ALPHA */ diff --git a/print_timex.c b/print_timex.c new file mode 100644 index 00000000..5d0c478e --- /dev/null +++ b/print_timex.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_timex) + +#include +typedef struct timex struct_timex; + +#include MPERS_DEFS + +#include "xlat/adjtimex_modes.h" +#include "xlat/adjtimex_status.h" + +MPERS_PRINTER_DECL(int, print_timex, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct_timex tx; + + if (umove_or_printaddr(tcp, addr, &tx)) + return -1; + + tprints("{modes="); + printflags(adjtimex_modes, tx.modes, "ADJ_???"); + tprintf(", offset=%jd, freq=%jd, maxerror=%ju, esterror=%ju, status=", + (intmax_t) tx.offset, (intmax_t) tx.freq, + (uintmax_t) tx.maxerror, (uintmax_t) tx.esterror); + printflags(adjtimex_status, tx.status, "STA_???"); + tprintf(", constant=%jd, precision=%ju, tolerance=%jd, time=", + (intmax_t) tx.constant, (uintmax_t) tx.precision, + (intmax_t) tx.tolerance); + MPERS_FUNC_NAME(print_struct_timeval)(&tx.time); + tprintf(", tick=%jd, ppsfreq=%jd, jitter=%jd", + (intmax_t) tx.tick, (intmax_t) tx.ppsfreq, (intmax_t) tx.jitter); + tprintf(", shift=%d, stabil=%jd, jitcnt=%jd", + tx.shift, (intmax_t) tx.stabil, (intmax_t) tx.jitcnt); + tprintf(", calcnt=%jd, errcnt=%jd, stbcnt=%jd", + (intmax_t) tx.calcnt, (intmax_t) tx.errcnt, (intmax_t) tx.stbcnt); +#ifdef HAVE_STRUCT_TIMEX_TAI + tprintf(", tai=%d", tx.tai); +#endif + tprints("}"); + return 0; +} diff --git a/printmode.c b/printmode.c new file mode 100644 index 00000000..1babed6d --- /dev/null +++ b/printmode.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2012 Denys Vlasenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include +#include + +#include "xlat/modetypes.h" + +void +print_symbolic_mode_t(const unsigned int mode) +{ + const char *ifmt; + + if (mode & S_IFMT) { + ifmt = xlookup(modetypes, mode & S_IFMT); + if (!ifmt) { + tprintf("%#03o", mode); + return; + } + } else { + ifmt = NULL; + } + + tprintf("%s%s%s%s%s%#03o", + ifmt ? ifmt : "", + ifmt ? "|" : "", + (mode & S_ISUID) ? "S_ISUID|" : "", + (mode & S_ISGID) ? "S_ISGID|" : "", + (mode & S_ISVTX) ? "S_ISVTX|" : "", + mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)); +} + +void +print_numeric_umode_t(const unsigned short mode) +{ + tprintf("%#03ho", mode); +} + +void +print_numeric_long_umask(const unsigned long mode) +{ + tprintf("%#03lo", mode); +} diff --git a/printrusage.c b/printrusage.c new file mode 100644 index 00000000..0a6a3c34 --- /dev/null +++ b/printrusage.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +#include DEF_MPERS_TYPE(rusage_t) + +typedef struct rusage rusage_t; + +#include MPERS_DEFS + +MPERS_PRINTER_DECL(void, printrusage, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + rusage_t ru; + + if (umove_or_printaddr(tcp, addr, &ru)) + return; + + tprints("{ru_utime="); + MPERS_FUNC_NAME(print_struct_timeval)(&ru.ru_utime); + tprints(", ru_stime="); + MPERS_FUNC_NAME(print_struct_timeval)(&ru.ru_stime); + if (abbrev(tcp)) + tprints(", ..."); + else { +#define PRINT_RUSAGE_MEMBER(member) \ + tprintf(", " #member "=%llu", zero_extend_signed_to_ull(ru.member)) + PRINT_RUSAGE_MEMBER(ru_maxrss); + PRINT_RUSAGE_MEMBER(ru_ixrss); + PRINT_RUSAGE_MEMBER(ru_idrss); + PRINT_RUSAGE_MEMBER(ru_isrss); + PRINT_RUSAGE_MEMBER(ru_minflt); + PRINT_RUSAGE_MEMBER(ru_majflt); + PRINT_RUSAGE_MEMBER(ru_nswap); + PRINT_RUSAGE_MEMBER(ru_inblock); + PRINT_RUSAGE_MEMBER(ru_oublock); + PRINT_RUSAGE_MEMBER(ru_msgsnd); + PRINT_RUSAGE_MEMBER(ru_msgrcv); + PRINT_RUSAGE_MEMBER(ru_nsignals); + PRINT_RUSAGE_MEMBER(ru_nvcsw); + PRINT_RUSAGE_MEMBER(ru_nivcsw); +#undef PRINT_RUSAGE_MEMBER + } + tprints("}"); +} + +#ifdef ALPHA +void +printrusage32(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct rusage32 { + timeval32_t ru_utime; /* user time used */ + timeval32_t ru_stime; /* system time used */ + long ru_maxrss; /* maximum resident set size */ + long ru_ixrss; /* integral shared memory size */ + long ru_idrss; /* integral unshared data size */ + long ru_isrss; /* integral unshared stack size */ + long ru_minflt; /* page reclaims */ + long ru_majflt; /* page faults */ + long ru_nswap; /* swaps */ + long ru_inblock; /* block input operations */ + long ru_oublock; /* block output operations */ + long ru_msgsnd; /* messages sent */ + long ru_msgrcv; /* messages received */ + long ru_nsignals; /* signals received */ + long ru_nvcsw; /* voluntary context switches */ + long ru_nivcsw; /* involuntary " */ + } ru; + + if (umove_or_printaddr(tcp, addr, &ru)) + return; + + tprints("{ru_utime="); + print_timeval32_t(&ru.ru_utime); + tprints(", ru_stime="); + print_timeval32_t(&ru.ru_stime); + if (abbrev(tcp)) + tprints(", ..."); + else { +# define PRINT_RUSAGE_MEMBER(member) \ + tprintf(", " #member "=%lu", ru.member) + PRINT_RUSAGE_MEMBER(ru_maxrss); + PRINT_RUSAGE_MEMBER(ru_ixrss); + PRINT_RUSAGE_MEMBER(ru_idrss); + PRINT_RUSAGE_MEMBER(ru_isrss); + PRINT_RUSAGE_MEMBER(ru_minflt); + PRINT_RUSAGE_MEMBER(ru_majflt); + PRINT_RUSAGE_MEMBER(ru_nswap); + PRINT_RUSAGE_MEMBER(ru_inblock); + PRINT_RUSAGE_MEMBER(ru_oublock); + PRINT_RUSAGE_MEMBER(ru_msgsnd); + PRINT_RUSAGE_MEMBER(ru_msgrcv); + PRINT_RUSAGE_MEMBER(ru_nsignals); + PRINT_RUSAGE_MEMBER(ru_nvcsw); + PRINT_RUSAGE_MEMBER(ru_nivcsw); +# undef PRINT_RUSAGE_MEMBER + } + tprints("}"); +} +#endif diff --git a/printsiginfo.c b/printsiginfo.c new file mode 100644 index 00000000..7bbb4214 --- /dev/null +++ b/printsiginfo.c @@ -0,0 +1,264 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2001 John Hughes + * Copyright (c) 2013 Denys Vlasenko + * Copyright (c) 2011-2015 Dmitry V. Levin + * Copyright (c) 2015 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(siginfo_t) + +#include +#include + +#include MPERS_DEFS + +#ifndef IN_MPERS +#include "printsiginfo.h" +#endif + +#include "xlat/audit_arch.h" +#include "xlat/sigbus_codes.h" +#include "xlat/sigchld_codes.h" +#include "xlat/sigfpe_codes.h" +#include "xlat/sigill_codes.h" +#include "xlat/siginfo_codes.h" +#include "xlat/sigpoll_codes.h" +#include "xlat/sigprof_codes.h" +#include "xlat/sigsegv_codes.h" +#include "xlat/sigsys_codes.h" +#include "xlat/sigtrap_codes.h" + +#ifdef SIGEMT +# include "xlat/sigemt_codes.h" +#endif + +#ifndef SI_FROMUSER +# define SI_FROMUSER(sip) ((sip)->si_code <= 0) +#endif + +static void +printsigsource(const siginfo_t *sip) +{ + tprintf(", si_pid=%u, si_uid=%u", + (unsigned int) sip->si_pid, + (unsigned int) sip->si_uid); +} + +static void +printsigval(const siginfo_t *sip) +{ + tprintf(", si_value={int=%d, ptr=", sip->si_int); + printaddr(ptr_to_kulong(sip->si_ptr)); + tprints("}"); +} + +static void +print_si_code(int si_signo, unsigned int si_code) +{ + const char *code = xlookup(siginfo_codes, si_code); + + if (!code) { + switch (si_signo) { + case SIGTRAP: + code = xlookup(sigtrap_codes, si_code); + break; + case SIGCHLD: + code = xlookup(sigchld_codes, si_code); + break; + case SIGPOLL: + code = xlookup(sigpoll_codes, si_code); + break; + case SIGPROF: + code = xlookup(sigprof_codes, si_code); + break; + case SIGILL: + code = xlookup(sigill_codes, si_code); + break; +#ifdef SIGEMT + case SIGEMT: + code = xlookup(sigemt_codes, si_code); + break; +#endif + case SIGFPE: + code = xlookup(sigfpe_codes, si_code); + break; + case SIGSEGV: + code = xlookup(sigsegv_codes, si_code); + break; + case SIGBUS: + code = xlookup(sigbus_codes, si_code); + break; + case SIGSYS: + code = xlookup(sigsys_codes, si_code); + break; + } + } + + if (code) + tprints(code); + else + tprintf("%#x", si_code); +} + +static void +print_si_info(const siginfo_t *sip) +{ + if (sip->si_errno) { + tprints(", si_errno="); + if ((unsigned) sip->si_errno < nerrnos + && errnoent[sip->si_errno]) + tprints(errnoent[sip->si_errno]); + else + tprintf("%d", sip->si_errno); + } + + if (SI_FROMUSER(sip)) { + switch (sip->si_code) { + case SI_USER: + printsigsource(sip); + break; + case SI_TKILL: + printsigsource(sip); + break; +#if defined HAVE_SIGINFO_T_SI_TIMERID && defined HAVE_SIGINFO_T_SI_OVERRUN + case SI_TIMER: + tprintf(", si_timerid=%#x, si_overrun=%d", + sip->si_timerid, sip->si_overrun); + printsigval(sip); + break; +#endif + default: + printsigsource(sip); + if (sip->si_ptr) + printsigval(sip); + break; + } + } else { + switch (sip->si_signo) { + case SIGCHLD: + printsigsource(sip); + tprints(", si_status="); + if (sip->si_code == CLD_EXITED) + tprintf("%d", sip->si_status); + else + printsignal(sip->si_status); + tprintf(", si_utime=%llu, si_stime=%llu", + zero_extend_signed_to_ull(sip->si_utime), + zero_extend_signed_to_ull(sip->si_stime)); + break; + case SIGILL: case SIGFPE: + case SIGSEGV: case SIGBUS: + tprints(", si_addr="); + printaddr(ptr_to_kulong(sip->si_addr)); + break; + case SIGPOLL: + switch (sip->si_code) { + case POLL_IN: case POLL_OUT: case POLL_MSG: + tprintf(", si_band=%ld", + (long) sip->si_band); + break; + } + break; +#ifdef HAVE_SIGINFO_T_SI_SYSCALL + case SIGSYS: { + const char *scname = + syscall_name((unsigned) sip->si_syscall); + + tprints(", si_call_addr="); + printaddr(ptr_to_kulong(sip->si_call_addr)); + tprints(", si_syscall="); + if (scname) + tprintf("__NR_%s", scname); + else + tprintf("%u", (unsigned) sip->si_syscall); + tprints(", si_arch="); + printxval(audit_arch, sip->si_arch, "AUDIT_ARCH_???"); + break; + } +#endif + default: + if (sip->si_pid || sip->si_uid) + printsigsource(sip); + if (sip->si_ptr) + printsigval(sip); + } + } +} + +#ifdef IN_MPERS +static +#endif +void +printsiginfo(const siginfo_t *sip) +{ + if (sip->si_signo == 0) { + tprints("{}"); + return; + } + tprints("{si_signo="); + printsignal(sip->si_signo); + + tprints(", si_code="); + print_si_code(sip->si_signo, sip->si_code); + +#ifdef SI_NOINFO + if (sip->si_code != SI_NOINFO) +#endif + print_si_info(sip); + + tprints("}"); +} + +MPERS_PRINTER_DECL(void, printsiginfo_at, + struct tcb *const tcp, const kernel_ulong_t addr) +{ + siginfo_t si; + + if (!umove_or_printaddr(tcp, addr, &si)) + printsiginfo(&si); +} + +static bool +print_siginfo_t(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + printsiginfo((const siginfo_t *) elem_buf); + return true; +} + +MPERS_PRINTER_DECL(void, print_siginfo_array, struct tcb *const tcp, + const kernel_ulong_t addr, const kernel_ulong_t len) +{ + siginfo_t si; + + print_array(tcp, addr, len, &si, sizeof(si), + umoven_or_printaddr, print_siginfo_t, 0); +} diff --git a/printsiginfo.h b/printsiginfo.h new file mode 100644 index 00000000..7ad72380 --- /dev/null +++ b/printsiginfo.h @@ -0,0 +1,6 @@ +#ifndef STRACE_PRINTSIGINFO_H +#define STRACE_PRINTSIGINFO_H + +extern void printsiginfo(const siginfo_t *); + +#endif /* !STRACE_PRINTSIGINFO_H */ diff --git a/process.c b/process.c index 2cd0f01f..6928fb92 100644 --- a/process.c +++ b/process.c @@ -35,2563 +35,224 @@ */ #include "defs.h" -#include -#include -#include -#include -#include -#include + #ifdef HAVE_ELF_H # include #endif -#ifdef HAVE_SYS_REG_H -# include -#endif - -#ifdef HAVE_LINUX_PTRACE_H -# undef PTRACE_SYSCALL -# ifdef HAVE_STRUCT_IA64_FPREG -# define ia64_fpreg XXX_ia64_fpreg -# endif -# ifdef HAVE_STRUCT_PT_ALL_USER_REGS -# define pt_all_user_regs XXX_pt_all_user_regs -# endif -# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS -# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args -# endif -# include -# undef ptrace_peeksiginfo_args -# undef ia64_fpreg -# undef pt_all_user_regs -#endif - -#if defined(SPARC64) -# define r_pc r_tpc -# undef PTRACE_GETREGS -# define PTRACE_GETREGS PTRACE_GETREGS64 -# undef PTRACE_SETREGS -# define PTRACE_SETREGS PTRACE_SETREGS64 -#endif - -#ifdef HAVE_LINUX_FUTEX_H -# include -#endif -#ifndef FUTEX_WAIT -# define FUTEX_WAIT 0 -#endif -#ifndef FUTEX_WAKE -# define FUTEX_WAKE 1 -#endif -#ifndef FUTEX_FD -# define FUTEX_FD 2 -#endif -#ifndef FUTEX_REQUEUE -# define FUTEX_REQUEUE 3 -#endif - -#include -#include -#undef GETGROUPS_T -#define GETGROUPS_T __kernel_gid_t -#undef GETGROUPS32_T -#define GETGROUPS32_T __kernel_gid32_t - -#if defined(IA64) -# include -# include -#endif - -#ifdef HAVE_PRCTL -# include +#include "xlat/nt_descriptor_types.h" -#include "xlat/prctl_options.h" +#include "regs.h" +#include "ptrace.h" +#include "xlat/ptrace_cmds.h" +#include "xlat/ptrace_setoptions_flags.h" +#include "xlat/ptrace_peeksiginfo_flags.h" -static const char * -unalignctl_string(unsigned int ctl) -{ - static char buf[sizeof(int)*2 + 2]; +#define uoff(member) offsetof(struct user, member) +#define XLAT_UOFF(member) { uoff(member), "offsetof(struct user, " #member ")" } - switch (ctl) { -#ifdef PR_UNALIGN_NOPRINT - case PR_UNALIGN_NOPRINT: - return "NOPRINT"; -#endif -#ifdef PR_UNALIGN_SIGBUS - case PR_UNALIGN_SIGBUS: - return "SIGBUS"; -#endif - default: - break; - } - sprintf(buf, "%x", ctl); - return buf; -} +static const struct xlat struct_user_offsets[] = { +#include "userent.h" + XLAT_END +}; -int -sys_prctl(struct tcb *tcp) +static void +print_user_offset_addr(const kernel_ulong_t addr) { - int i; + const struct xlat *x; - if (entering(tcp)) { - printxval(prctl_options, tcp->u_arg[0], "PR_???"); - switch (tcp->u_arg[0]) { -#ifdef PR_GETNSHARE - case PR_GETNSHARE: + for (x = struct_user_offsets; x->str; ++x) { + if (x->val >= addr) break; -#endif -#ifdef PR_SET_PDEATHSIG - case PR_SET_PDEATHSIG: - tprintf(", %lu", tcp->u_arg[1]); - break; -#endif -#ifdef PR_GET_PDEATHSIG - case PR_GET_PDEATHSIG: - break; -#endif -#ifdef PR_SET_DUMPABLE - case PR_SET_DUMPABLE: - tprintf(", %lu", tcp->u_arg[1]); - break; -#endif -#ifdef PR_GET_DUMPABLE - case PR_GET_DUMPABLE: - break; -#endif -#ifdef PR_SET_UNALIGN - case PR_SET_UNALIGN: - tprintf(", %s", unalignctl_string(tcp->u_arg[1])); - break; -#endif -#ifdef PR_GET_UNALIGN - case PR_GET_UNALIGN: - tprintf(", %#lx", tcp->u_arg[1]); - break; -#endif -#ifdef PR_SET_KEEPCAPS - case PR_SET_KEEPCAPS: - tprintf(", %lu", tcp->u_arg[1]); - break; -#endif -#ifdef PR_GET_KEEPCAPS - case PR_GET_KEEPCAPS: - break; -#endif - default: - for (i = 1; i < tcp->s_ent->nargs; i++) - tprintf(", %#lx", tcp->u_arg[i]); - break; - } - } else { - switch (tcp->u_arg[0]) { -#ifdef PR_GET_PDEATHSIG - case PR_GET_PDEATHSIG: - if (umove(tcp, tcp->u_arg[1], &i) < 0) - tprintf(", %#lx", tcp->u_arg[1]); - else - tprintf(", {%u}", i); - break; -#endif -#ifdef PR_GET_DUMPABLE - case PR_GET_DUMPABLE: - return RVAL_UDECIMAL; -#endif -#ifdef PR_GET_UNALIGN - case PR_GET_UNALIGN: - if (syserror(tcp) || umove(tcp, tcp->u_arg[1], &i) < 0) - break; - tcp->auxstr = unalignctl_string(i); - return RVAL_STR; -#endif -#ifdef PR_GET_KEEPCAPS - case PR_GET_KEEPCAPS: - return RVAL_UDECIMAL; -#endif - default: - break; - } - } - return 0; -} -#endif /* HAVE_PRCTL */ - -int -sys_sethostname(struct tcb *tcp) -{ - if (entering(tcp)) { - printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; -} - -#if defined(ALPHA) -int -sys_gethostname(struct tcb *tcp) -{ - if (exiting(tcp)) { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else - printstr(tcp, tcp->u_arg[0], -1); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; -} -#endif - -int -sys_setdomainname(struct tcb *tcp) -{ - if (entering(tcp)) { - printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]); - tprintf(", %lu", tcp->u_arg[1]); } - return 0; -} - -int -sys_exit(struct tcb *tcp) -{ - if (exiting(tcp)) { - fprintf(stderr, "_exit returned!\n"); - return -1; - } - /* special case: we stop tracing this process, finish line now */ - tprintf("%ld) ", tcp->u_arg[0]); - tabto(); - tprints("= ?\n"); - line_ended(); - return 0; -} - -/* defines copied from linux/sched.h since we can't include that - * ourselves (it conflicts with *lots* of libc includes) - */ -#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */ -#define CLONE_VM 0x00000100 /* set if VM shared between processes */ -#define CLONE_FS 0x00000200 /* set if fs info shared between processes */ -#define CLONE_FILES 0x00000400 /* set if open files shared between processes */ -#define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */ -#define CLONE_IDLETASK 0x00001000 /* kernel-only flag */ -#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */ -#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ -#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */ -#define CLONE_THREAD 0x00010000 /* Same thread group? */ -#define CLONE_NEWNS 0x00020000 /* New namespace group? */ -#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */ -#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */ -#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */ -#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */ -#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ -#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ -#define CLONE_STOPPED 0x02000000 /* Start in stopped state */ -#define CLONE_NEWUTS 0x04000000 /* New utsname group? */ -#define CLONE_NEWIPC 0x08000000 /* New ipcs */ -#define CLONE_NEWUSER 0x10000000 /* New user namespace */ -#define CLONE_NEWPID 0x20000000 /* New pid namespace */ -#define CLONE_NEWNET 0x40000000 /* New network namespace */ -#define CLONE_IO 0x80000000 /* Clone io context */ - -#include "xlat/clone_flags.h" - -#if defined I386 || defined X86_64 || defined X32 -extern void print_user_desc(struct tcb *, long); -#endif /* I386 || X86_64 || X32 */ - -#if defined IA64 -# define ARG_FLAGS 0 -# define ARG_STACK 1 -# define ARG_STACKSIZE (tcp->scno == SYS_clone2 ? 2 : -1) -# define ARG_PTID (tcp->scno == SYS_clone2 ? 3 : 2) -# define ARG_CTID (tcp->scno == SYS_clone2 ? 4 : 3) -# define ARG_TLS (tcp->scno == SYS_clone2 ? 5 : 4) -#elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32 -# define ARG_STACK 0 -# define ARG_FLAGS 1 -# define ARG_PTID 2 -# define ARG_CTID 3 -# define ARG_TLS 4 -#elif defined X86_64 || defined X32 -/* x86 personality processes have the last two arguments flipped. */ -# define ARG_FLAGS 0 -# define ARG_STACK 1 -# define ARG_PTID 2 -# define ARG_CTID ((current_personality != 1) ? 3 : 4) -# define ARG_TLS ((current_personality != 1) ? 4 : 3) -#elif defined ALPHA || defined TILE || defined OR1K -# define ARG_FLAGS 0 -# define ARG_STACK 1 -# define ARG_PTID 2 -# define ARG_CTID 3 -# define ARG_TLS 4 -#else -# define ARG_FLAGS 0 -# define ARG_STACK 1 -# define ARG_PTID 2 -# define ARG_TLS 3 -# define ARG_CTID 4 -#endif -int -sys_clone(struct tcb *tcp) -{ - if (exiting(tcp)) { - const char *sep = "|"; - unsigned long flags = tcp->u_arg[ARG_FLAGS]; - tprintf("child_stack=%#lx, ", tcp->u_arg[ARG_STACK]); -#ifdef ARG_STACKSIZE - if (ARG_STACKSIZE != -1) - tprintf("stack_size=%#lx, ", - tcp->u_arg[ARG_STACKSIZE]); -#endif - tprints("flags="); - if (!printflags(clone_flags, flags &~ CSIGNAL, NULL)) - sep = ""; - if ((flags & CSIGNAL) != 0) - tprintf("%s%s", sep, signame(flags & CSIGNAL)); - if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID - |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0) - return 0; - if (flags & CLONE_PARENT_SETTID) - tprintf(", parent_tidptr=%#lx", tcp->u_arg[ARG_PTID]); - if (flags & CLONE_SETTLS) { -#if defined I386 || defined X86_64 || defined X32 -# ifndef I386 - if (current_personality == 1) -# endif - { - tprints(", tls="); - print_user_desc(tcp, tcp->u_arg[ARG_TLS]); - } -# ifndef I386 - else -# endif -#endif /* I386 || X86_64 || X32 */ - tprintf(", tls=%#lx", tcp->u_arg[ARG_TLS]); - } - if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID)) - tprintf(", child_tidptr=%#lx", tcp->u_arg[ARG_CTID]); - } - /* TODO on syscall entry: - * We can clear CLONE_PTRACE here since it is an ancient hack - * to allow us to catch children, and we use another hack for that. - * But CLONE_PTRACE can conceivably be used by malicious programs - * to subvert us. By clearing this bit, we can defend against it: - * in untraced execution, CLONE_PTRACE should have no effect. - * - * We can also clear CLONE_UNTRACED, since it allows to start - * children outside of our control. At the moment - * I'm trying to figure out whether there is a *legitimate* - * use of this flag which we should respect. - */ - return 0; -} - -int -sys_setns(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printflags(clone_flags, tcp->u_arg[1], "CLONE_???"); - } - return 0; -} - -int -sys_unshare(struct tcb *tcp) -{ - if (entering(tcp)) - printflags(clone_flags, tcp->u_arg[0], "CLONE_???"); - return 0; -} - -int -sys_fork(struct tcb *tcp) -{ - if (exiting(tcp)) - return RVAL_UDECIMAL; - return 0; -} - -int sys_getuid(struct tcb *tcp) -{ - if (exiting(tcp)) - tcp->u_rval = (uid_t) tcp->u_rval; - return RVAL_UDECIMAL; -} - -int sys_setfsuid(struct tcb *tcp) -{ - if (entering(tcp)) - tprintf("%u", (uid_t) tcp->u_arg[0]); - else - tcp->u_rval = (uid_t) tcp->u_rval; - return RVAL_UDECIMAL; -} - -int -sys_setuid(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%u", (uid_t) tcp->u_arg[0]); - } - return 0; -} - -int -sys_getresuid(struct tcb *tcp) -{ - if (exiting(tcp)) { - __kernel_uid_t uid; - if (syserror(tcp)) - tprintf("%#lx, %#lx, %#lx", tcp->u_arg[0], - tcp->u_arg[1], tcp->u_arg[2]); - else { - if (umove(tcp, tcp->u_arg[0], &uid) < 0) - tprintf("%#lx, ", tcp->u_arg[0]); - else - tprintf("[%lu], ", (unsigned long) uid); - if (umove(tcp, tcp->u_arg[1], &uid) < 0) - tprintf("%#lx, ", tcp->u_arg[1]); - else - tprintf("[%lu], ", (unsigned long) uid); - if (umove(tcp, tcp->u_arg[2], &uid) < 0) - tprintf("%#lx", tcp->u_arg[2]); - else - tprintf("[%lu]", (unsigned long) uid); - } - } - return 0; -} - -int -sys_setreuid(struct tcb *tcp) -{ - if (entering(tcp)) { - printuid("", tcp->u_arg[0]); - printuid(", ", tcp->u_arg[1]); - } - return 0; -} - -int -sys_setresuid(struct tcb *tcp) -{ - if (entering(tcp)) { - printuid("", tcp->u_arg[0]); - printuid(", ", tcp->u_arg[1]); - printuid(", ", tcp->u_arg[2]); - } - return 0; -} - -int -sys_setgroups(struct tcb *tcp) -{ - if (entering(tcp)) { - unsigned long len, size, start, cur, end, abbrev_end; - GETGROUPS_T gid; - int failed = 0; - - len = tcp->u_arg[0]; - tprintf("%lu, ", len); - if (len == 0) { - tprints("[]"); - return 0; - } - start = tcp->u_arg[1]; - if (start == 0) { - tprints("NULL"); - return 0; - } - size = len * sizeof(gid); - end = start + size; - if (!verbose(tcp) || size / sizeof(gid) != len || end < start) { - tprintf("%#lx", start); - return 0; - } - if (abbrev(tcp)) { - abbrev_end = start + max_strlen * sizeof(gid); - if (abbrev_end < start) - abbrev_end = end; + if (!x->str) { + printaddr(addr); + } else if (x->val > addr) { + if (x == struct_user_offsets) { + printaddr(addr); } else { - abbrev_end = end; - } - tprints("["); - for (cur = start; cur < end; cur += sizeof(gid)) { - if (cur > start) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); - break; - } - if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) { - tprints("?"); - failed = 1; - break; - } - tprintf("%lu", (unsigned long) gid); + --x; + tprintf("%s + %" PRI_klu, + x->str, addr - (kernel_ulong_t) x->val); } - tprints("]"); - if (failed) - tprintf(" %#lx", tcp->u_arg[1]); - } - return 0; -} - -int -sys_getgroups(struct tcb *tcp) -{ - unsigned long len; - - if (entering(tcp)) { - len = tcp->u_arg[0]; - tprintf("%lu, ", len); } else { - unsigned long size, start, cur, end, abbrev_end; - GETGROUPS_T gid; - int failed = 0; - - len = tcp->u_rval; - if (len == 0) { - tprints("[]"); - return 0; - } - start = tcp->u_arg[1]; - if (start == 0) { - tprints("NULL"); - return 0; - } - if (tcp->u_arg[0] == 0) { - tprintf("%#lx", start); - return 0; - } - size = len * sizeof(gid); - end = start + size; - if (!verbose(tcp) || tcp->u_arg[0] == 0 || - size / sizeof(gid) != len || end < start) { - tprintf("%#lx", start); - return 0; - } - if (abbrev(tcp)) { - abbrev_end = start + max_strlen * sizeof(gid); - if (abbrev_end < start) - abbrev_end = end; - } else { - abbrev_end = end; - } - tprints("["); - for (cur = start; cur < end; cur += sizeof(gid)) { - if (cur > start) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); - break; - } - if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) { - tprints("?"); - failed = 1; - break; - } - tprintf("%lu", (unsigned long) gid); - } - tprints("]"); - if (failed) - tprintf(" %#lx", tcp->u_arg[1]); + tprints(x->str); } - return 0; } -int -sys_setgroups32(struct tcb *tcp) +SYS_FUNC(ptrace) { - if (entering(tcp)) { - unsigned long len, size, start, cur, end, abbrev_end; - GETGROUPS32_T gid; - int failed = 0; - - len = tcp->u_arg[0]; - tprintf("%lu, ", len); - if (len == 0) { - tprints("[]"); - return 0; - } - start = tcp->u_arg[1]; - if (start == 0) { - tprints("NULL"); - return 0; - } - size = len * sizeof(gid); - end = start + size; - if (!verbose(tcp) || size / sizeof(gid) != len || end < start) { - tprintf("%#lx", start); - return 0; - } - if (abbrev(tcp)) { - abbrev_end = start + max_strlen * sizeof(gid); - if (abbrev_end < start) - abbrev_end = end; - } else { - abbrev_end = end; - } - tprints("["); - for (cur = start; cur < end; cur += sizeof(gid)) { - if (cur > start) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); - break; - } - if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) { - tprints("?"); - failed = 1; - break; - } - tprintf("%lu", (unsigned long) gid); - } - tprints("]"); - if (failed) - tprintf(" %#lx", tcp->u_arg[1]); - } - return 0; -} - -int -sys_getgroups32(struct tcb *tcp) -{ - unsigned long len; + const kernel_ulong_t request = tcp->u_arg[0]; + const int pid = tcp->u_arg[1]; + const kernel_ulong_t addr = tcp->u_arg[2]; + const kernel_ulong_t data = tcp->u_arg[3]; if (entering(tcp)) { - len = tcp->u_arg[0]; - tprintf("%lu, ", len); - } else { - unsigned long size, start, cur, end, abbrev_end; - GETGROUPS32_T gid; - int failed = 0; + /* request */ + printxval64(ptrace_cmds, request, "PTRACE_???"); - len = tcp->u_rval; - if (len == 0) { - tprints("[]"); - return 0; - } - start = tcp->u_arg[1]; - if (start == 0) { - tprints("NULL"); - return 0; - } - size = len * sizeof(gid); - end = start + size; - if (!verbose(tcp) || tcp->u_arg[0] == 0 || - size / sizeof(gid) != len || end < start) { - tprintf("%#lx", start); - return 0; - } - if (abbrev(tcp)) { - abbrev_end = start + max_strlen * sizeof(gid); - if (abbrev_end < start) - abbrev_end = end; - } else { - abbrev_end = end; - } - tprints("["); - for (cur = start; cur < end; cur += sizeof(gid)) { - if (cur > start) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); - break; - } - if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) { - tprints("?"); - failed = 1; - break; - } - tprintf("%lu", (unsigned long) gid); + if (request == PTRACE_TRACEME) { + /* pid, addr, and data are ignored. */ + return RVAL_DECODED; } - tprints("]"); - if (failed) - tprintf(" %#lx", tcp->u_arg[1]); - } - return 0; -} -static void -printargv(struct tcb *tcp, long addr) -{ - union { - unsigned int p32; - unsigned long p64; - char data[sizeof(long)]; - } cp; - const char *sep; - int n = 0; - unsigned wordsize = current_wordsize; + /* pid */ + tprintf(", %d", pid); - cp.p64 = 1; - for (sep = ""; !abbrev(tcp) || n < max_strlen / 2; sep = ", ", ++n) { - if (umoven(tcp, addr, wordsize, cp.data) < 0) { - tprintf("%#lx", addr); - return; - } - if (wordsize == 4) - cp.p64 = cp.p32; - if (cp.p64 == 0) + /* addr */ + switch (request) { + case PTRACE_ATTACH: + case PTRACE_INTERRUPT: + case PTRACE_KILL: + case PTRACE_LISTEN: + /* addr and data are ignored */ + return RVAL_DECODED; + case PTRACE_PEEKUSER: + case PTRACE_POKEUSER: + tprints(", "); + print_user_offset_addr(addr); break; - tprints(sep); - printstr(tcp, cp.p64, -1); - addr += wordsize; - } - if (cp.p64) - tprintf("%s...", sep); -} - -static void -printargc(const char *fmt, struct tcb *tcp, long addr) -{ - int count; - char *cp; - - for (count = 0; umove(tcp, addr, &cp) >= 0 && cp != NULL; count++) { - addr += sizeof(char *); - } - tprintf(fmt, count, count == 1 ? "" : "s"); -} - -#if defined(SPARC) || defined(SPARC64) -int -sys_execv(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - if (!verbose(tcp)) - tprintf(", %#lx", tcp->u_arg[1]); - else { - tprints(", ["); - printargv(tcp, tcp->u_arg[1]); - tprints("]"); - } - } - return 0; -} -#endif - -int -sys_execve(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - if (!verbose(tcp)) - tprintf(", %#lx", tcp->u_arg[1]); - else { - tprints(", ["); - printargv(tcp, tcp->u_arg[1]); - tprints("]"); - } - if (!verbose(tcp)) - tprintf(", %#lx", tcp->u_arg[2]); - else if (abbrev(tcp)) - printargc(", [/* %d var%s */]", tcp, tcp->u_arg[2]); - else { - tprints(", ["); - printargv(tcp, tcp->u_arg[2]); - tprints("]"); - } - } - return 0; -} - -#ifndef __WNOTHREAD -#define __WNOTHREAD 0x20000000 -#endif -#ifndef __WALL -#define __WALL 0x40000000 -#endif -#ifndef __WCLONE -#define __WCLONE 0x80000000 -#endif - -#include "xlat/wait4_options.h" - -#if !defined WCOREFLAG && defined WCOREFLG -# define WCOREFLAG WCOREFLG -#endif -#ifndef WCOREFLAG -# define WCOREFLAG 0x80 -#endif -#ifndef WCOREDUMP -# define WCOREDUMP(status) ((status) & 0200) -#endif -#ifndef W_STOPCODE -# define W_STOPCODE(sig) ((sig) << 8 | 0x7f) -#endif -#ifndef W_EXITCODE -# define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) -#endif - -static int -printstatus(int status) -{ - int exited = 0; - - /* - * Here is a tricky presentation problem. This solution - * is still not entirely satisfactory but since there - * are no wait status constructors it will have to do. - */ - if (WIFSTOPPED(status)) { - tprintf("[{WIFSTOPPED(s) && WSTOPSIG(s) == %s}", - signame(WSTOPSIG(status))); - status &= ~W_STOPCODE(WSTOPSIG(status)); - } - else if (WIFSIGNALED(status)) { - tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}", - signame(WTERMSIG(status)), - WCOREDUMP(status) ? " && WCOREDUMP(s)" : ""); - status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG); - } - else if (WIFEXITED(status)) { - tprintf("[{WIFEXITED(s) && WEXITSTATUS(s) == %d}", - WEXITSTATUS(status)); - exited = 1; - status &= ~W_EXITCODE(WEXITSTATUS(status), 0); - } - else { - tprintf("[%#x]", status); - return 0; - } - - if (status == 0) - tprints("]"); - else - tprintf(" | %#x]", status); - - return exited; -} - -static int -printwaitn(struct tcb *tcp, int n, int bitness) -{ - int status; - - if (entering(tcp)) { - /* On Linux, kernel-side pid_t is typedef'ed to int - * on all arches. Also, glibc-2.8 truncates wait3 and wait4 - * pid argument to int on 64bit arches, producing, - * for example, wait4(4294967295, ...) instead of -1 - * in strace. We have to use int here, not long. - */ - int pid = tcp->u_arg[0]; - tprintf("%d, ", pid); - } else { - /* status */ - if (!tcp->u_arg[1]) - tprints("NULL"); - else if (syserror(tcp) || tcp->u_rval == 0) - tprintf("%#lx", tcp->u_arg[1]); - else if (umove(tcp, tcp->u_arg[1], &status) < 0) - tprints("[?]"); - else - printstatus(status); - /* options */ - tprints(", "); - printflags(wait4_options, tcp->u_arg[2], "W???"); - if (n == 4) { + case PTRACE_GETREGSET: + case PTRACE_SETREGSET: tprints(", "); - /* usage */ - if (!tcp->u_arg[3]) - tprints("NULL"); - else if (tcp->u_rval > 0) { -#ifdef ALPHA - if (bitness) - printrusage32(tcp, tcp->u_arg[3]); - else -#endif - printrusage(tcp, tcp->u_arg[3]); + printxval(nt_descriptor_types, addr, "NT_???"); + break; + case PTRACE_GETSIGMASK: + case PTRACE_SETSIGMASK: + case PTRACE_SECCOMP_GET_FILTER: + tprintf(", %" PRI_klu, addr); + break; + case PTRACE_PEEKSIGINFO: { + tprints(", "); + struct { + uint64_t off; + uint32_t flags; + uint32_t nr; + } psi; + if (umove_or_printaddr(tcp, addr, &psi)) { + tprints(", "); + printaddr(data); + return RVAL_DECODED; } - else - tprintf("%#lx", tcp->u_arg[3]); + tprintf("{off=%" PRIu64 ", flags=", psi.off); + printflags(ptrace_peeksiginfo_flags, psi.flags, + "PTRACE_PEEKSIGINFO_???"); + tprintf(", nr=%u}", psi.nr); + break; } - } - return 0; -} - -int -sys_waitpid(struct tcb *tcp) -{ - return printwaitn(tcp, 3, 0); -} - -int -sys_wait4(struct tcb *tcp) -{ - return printwaitn(tcp, 4, 0); -} - -#ifdef ALPHA -int -sys_osf_wait4(struct tcb *tcp) -{ - return printwaitn(tcp, 4, 1); -} -#endif - -#include "xlat/waitid_types.h" - -int -sys_waitid(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(waitid_types, tcp->u_arg[0], "P_???"); - tprintf(", %ld, ", tcp->u_arg[1]); - } - else { - /* siginfo */ - printsiginfo_at(tcp, tcp->u_arg[2]); - /* options */ - tprints(", "); - printflags(wait4_options, tcp->u_arg[3], "W???"); - if (tcp->s_ent->nargs > 4) { - /* usage */ + default: tprints(", "); - if (!tcp->u_arg[4]) - tprints("NULL"); - else if (tcp->u_error) - tprintf("%#lx", tcp->u_arg[4]); - else - printrusage(tcp, tcp->u_arg[4]); - } - } - return 0; -} - -int -sys_uname(struct tcb *tcp) -{ - struct utsname uname; - - if (exiting(tcp)) { - if (syserror(tcp) || !verbose(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else if (umove(tcp, tcp->u_arg[0], &uname) < 0) - tprints("{...}"); - else if (!abbrev(tcp)) { - tprintf("{sysname=\"%s\", nodename=\"%s\", ", - uname.sysname, uname.nodename); - tprintf("release=\"%s\", version=\"%s\", ", - uname.release, uname.version); - tprintf("machine=\"%s\"", uname.machine); -#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME - tprintf(", domainname=\"%s\"", uname.domainname); -#endif - tprints("}"); + printaddr(addr); } - else - tprintf("{sys=\"%s\", node=\"%s\", ...}", - uname.sysname, uname.nodename); - } - return 0; -} -#include "xlat/ptrace_cmds.h" -#include "xlat/ptrace_setoptions_flags.h" -#include "xlat/nt_descriptor_types.h" +# if defined IA64 || defined SPARC || defined SPARC64 + switch (request) { +# ifdef IA64 + case PTRACE_PEEKDATA: + case PTRACE_PEEKTEXT: + case PTRACE_PEEKUSER: + /* data is ignored */ + return RVAL_DECODED | RVAL_HEX; +# endif /* IA64 */ +# if defined SPARC || defined SPARC64 + case PTRACE_GETREGS: + case PTRACE_SETREGS: + case PTRACE_GETFPREGS: + case PTRACE_SETFPREGS: + /* data is ignored */ + return RVAL_DECODED; +# endif /* SPARC || SPARC64 */ + } +# endif /* IA64 || SPARC || SPARC64 */ -#define uoff(member) offsetof(struct user, member) + tprints(", "); -const struct xlat struct_user_offsets[] = { -#if defined(S390) || defined(S390X) - { PT_PSWMASK, "psw_mask" }, - { PT_PSWADDR, "psw_addr" }, - { PT_GPR0, "gpr0" }, - { PT_GPR1, "gpr1" }, - { PT_GPR2, "gpr2" }, - { PT_GPR3, "gpr3" }, - { PT_GPR4, "gpr4" }, - { PT_GPR5, "gpr5" }, - { PT_GPR6, "gpr6" }, - { PT_GPR7, "gpr7" }, - { PT_GPR8, "gpr8" }, - { PT_GPR9, "gpr9" }, - { PT_GPR10, "gpr10" }, - { PT_GPR11, "gpr11" }, - { PT_GPR12, "gpr12" }, - { PT_GPR13, "gpr13" }, - { PT_GPR14, "gpr14" }, - { PT_GPR15, "gpr15" }, - { PT_ACR0, "acr0" }, - { PT_ACR1, "acr1" }, - { PT_ACR2, "acr2" }, - { PT_ACR3, "acr3" }, - { PT_ACR4, "acr4" }, - { PT_ACR5, "acr5" }, - { PT_ACR6, "acr6" }, - { PT_ACR7, "acr7" }, - { PT_ACR8, "acr8" }, - { PT_ACR9, "acr9" }, - { PT_ACR10, "acr10" }, - { PT_ACR11, "acr11" }, - { PT_ACR12, "acr12" }, - { PT_ACR13, "acr13" }, - { PT_ACR14, "acr14" }, - { PT_ACR15, "acr15" }, - { PT_ORIGGPR2, "orig_gpr2" }, - { PT_FPC, "fpc" }, -#if defined(S390) - { PT_FPR0_HI, "fpr0.hi" }, - { PT_FPR0_LO, "fpr0.lo" }, - { PT_FPR1_HI, "fpr1.hi" }, - { PT_FPR1_LO, "fpr1.lo" }, - { PT_FPR2_HI, "fpr2.hi" }, - { PT_FPR2_LO, "fpr2.lo" }, - { PT_FPR3_HI, "fpr3.hi" }, - { PT_FPR3_LO, "fpr3.lo" }, - { PT_FPR4_HI, "fpr4.hi" }, - { PT_FPR4_LO, "fpr4.lo" }, - { PT_FPR5_HI, "fpr5.hi" }, - { PT_FPR5_LO, "fpr5.lo" }, - { PT_FPR6_HI, "fpr6.hi" }, - { PT_FPR6_LO, "fpr6.lo" }, - { PT_FPR7_HI, "fpr7.hi" }, - { PT_FPR7_LO, "fpr7.lo" }, - { PT_FPR8_HI, "fpr8.hi" }, - { PT_FPR8_LO, "fpr8.lo" }, - { PT_FPR9_HI, "fpr9.hi" }, - { PT_FPR9_LO, "fpr9.lo" }, - { PT_FPR10_HI, "fpr10.hi" }, - { PT_FPR10_LO, "fpr10.lo" }, - { PT_FPR11_HI, "fpr11.hi" }, - { PT_FPR11_LO, "fpr11.lo" }, - { PT_FPR12_HI, "fpr12.hi" }, - { PT_FPR12_LO, "fpr12.lo" }, - { PT_FPR13_HI, "fpr13.hi" }, - { PT_FPR13_LO, "fpr13.lo" }, - { PT_FPR14_HI, "fpr14.hi" }, - { PT_FPR14_LO, "fpr14.lo" }, - { PT_FPR15_HI, "fpr15.hi" }, - { PT_FPR15_LO, "fpr15.lo" }, -#endif -#if defined(S390X) - { PT_FPR0, "fpr0" }, - { PT_FPR1, "fpr1" }, - { PT_FPR2, "fpr2" }, - { PT_FPR3, "fpr3" }, - { PT_FPR4, "fpr4" }, - { PT_FPR5, "fpr5" }, - { PT_FPR6, "fpr6" }, - { PT_FPR7, "fpr7" }, - { PT_FPR8, "fpr8" }, - { PT_FPR9, "fpr9" }, - { PT_FPR10, "fpr10" }, - { PT_FPR11, "fpr11" }, - { PT_FPR12, "fpr12" }, - { PT_FPR13, "fpr13" }, - { PT_FPR14, "fpr14" }, - { PT_FPR15, "fpr15" }, -#endif - { PT_CR_9, "cr9" }, - { PT_CR_10, "cr10" }, - { PT_CR_11, "cr11" }, - { PT_IEEE_IP, "ieee_exception_ip" }, -#elif defined(SPARC) - /* XXX No support for these offsets yet. */ -#elif defined(HPPA) - /* XXX No support for these offsets yet. */ -#elif defined(POWERPC) -# ifndef PT_ORIG_R3 -# define PT_ORIG_R3 34 -# endif -# define REGSIZE (sizeof(unsigned long)) - { REGSIZE*PT_R0, "r0" }, - { REGSIZE*PT_R1, "r1" }, - { REGSIZE*PT_R2, "r2" }, - { REGSIZE*PT_R3, "r3" }, - { REGSIZE*PT_R4, "r4" }, - { REGSIZE*PT_R5, "r5" }, - { REGSIZE*PT_R6, "r6" }, - { REGSIZE*PT_R7, "r7" }, - { REGSIZE*PT_R8, "r8" }, - { REGSIZE*PT_R9, "r9" }, - { REGSIZE*PT_R10, "r10" }, - { REGSIZE*PT_R11, "r11" }, - { REGSIZE*PT_R12, "r12" }, - { REGSIZE*PT_R13, "r13" }, - { REGSIZE*PT_R14, "r14" }, - { REGSIZE*PT_R15, "r15" }, - { REGSIZE*PT_R16, "r16" }, - { REGSIZE*PT_R17, "r17" }, - { REGSIZE*PT_R18, "r18" }, - { REGSIZE*PT_R19, "r19" }, - { REGSIZE*PT_R20, "r20" }, - { REGSIZE*PT_R21, "r21" }, - { REGSIZE*PT_R22, "r22" }, - { REGSIZE*PT_R23, "r23" }, - { REGSIZE*PT_R24, "r24" }, - { REGSIZE*PT_R25, "r25" }, - { REGSIZE*PT_R26, "r26" }, - { REGSIZE*PT_R27, "r27" }, - { REGSIZE*PT_R28, "r28" }, - { REGSIZE*PT_R29, "r29" }, - { REGSIZE*PT_R30, "r30" }, - { REGSIZE*PT_R31, "r31" }, - { REGSIZE*PT_NIP, "NIP" }, - { REGSIZE*PT_MSR, "MSR" }, - { REGSIZE*PT_ORIG_R3, "ORIG_R3" }, - { REGSIZE*PT_CTR, "CTR" }, - { REGSIZE*PT_LNK, "LNK" }, - { REGSIZE*PT_XER, "XER" }, - { REGSIZE*PT_CCR, "CCR" }, - { REGSIZE*PT_FPR0, "FPR0" }, -# undef REGSIZE -#elif defined(ALPHA) - { 0, "r0" }, - { 1, "r1" }, - { 2, "r2" }, - { 3, "r3" }, - { 4, "r4" }, - { 5, "r5" }, - { 6, "r6" }, - { 7, "r7" }, - { 8, "r8" }, - { 9, "r9" }, - { 10, "r10" }, - { 11, "r11" }, - { 12, "r12" }, - { 13, "r13" }, - { 14, "r14" }, - { 15, "r15" }, - { 16, "r16" }, - { 17, "r17" }, - { 18, "r18" }, - { 19, "r19" }, - { 20, "r20" }, - { 21, "r21" }, - { 22, "r22" }, - { 23, "r23" }, - { 24, "r24" }, - { 25, "r25" }, - { 26, "r26" }, - { 27, "r27" }, - { 28, "r28" }, - { 29, "gp" }, - { 30, "fp" }, - { 31, "zero" }, - { 32, "fp0" }, - { 33, "fp" }, - { 34, "fp2" }, - { 35, "fp3" }, - { 36, "fp4" }, - { 37, "fp5" }, - { 38, "fp6" }, - { 39, "fp7" }, - { 40, "fp8" }, - { 41, "fp9" }, - { 42, "fp10" }, - { 43, "fp11" }, - { 44, "fp12" }, - { 45, "fp13" }, - { 46, "fp14" }, - { 47, "fp15" }, - { 48, "fp16" }, - { 49, "fp17" }, - { 50, "fp18" }, - { 51, "fp19" }, - { 52, "fp20" }, - { 53, "fp21" }, - { 54, "fp22" }, - { 55, "fp23" }, - { 56, "fp24" }, - { 57, "fp25" }, - { 58, "fp26" }, - { 59, "fp27" }, - { 60, "fp28" }, - { 61, "fp29" }, - { 62, "fp30" }, - { 63, "fp31" }, - { 64, "pc" }, -#elif defined(IA64) - { PT_F32, "f32" }, { PT_F33, "f33" }, { PT_F34, "f34" }, - { PT_F35, "f35" }, { PT_F36, "f36" }, { PT_F37, "f37" }, - { PT_F38, "f38" }, { PT_F39, "f39" }, { PT_F40, "f40" }, - { PT_F41, "f41" }, { PT_F42, "f42" }, { PT_F43, "f43" }, - { PT_F44, "f44" }, { PT_F45, "f45" }, { PT_F46, "f46" }, - { PT_F47, "f47" }, { PT_F48, "f48" }, { PT_F49, "f49" }, - { PT_F50, "f50" }, { PT_F51, "f51" }, { PT_F52, "f52" }, - { PT_F53, "f53" }, { PT_F54, "f54" }, { PT_F55, "f55" }, - { PT_F56, "f56" }, { PT_F57, "f57" }, { PT_F58, "f58" }, - { PT_F59, "f59" }, { PT_F60, "f60" }, { PT_F61, "f61" }, - { PT_F62, "f62" }, { PT_F63, "f63" }, { PT_F64, "f64" }, - { PT_F65, "f65" }, { PT_F66, "f66" }, { PT_F67, "f67" }, - { PT_F68, "f68" }, { PT_F69, "f69" }, { PT_F70, "f70" }, - { PT_F71, "f71" }, { PT_F72, "f72" }, { PT_F73, "f73" }, - { PT_F74, "f74" }, { PT_F75, "f75" }, { PT_F76, "f76" }, - { PT_F77, "f77" }, { PT_F78, "f78" }, { PT_F79, "f79" }, - { PT_F80, "f80" }, { PT_F81, "f81" }, { PT_F82, "f82" }, - { PT_F83, "f83" }, { PT_F84, "f84" }, { PT_F85, "f85" }, - { PT_F86, "f86" }, { PT_F87, "f87" }, { PT_F88, "f88" }, - { PT_F89, "f89" }, { PT_F90, "f90" }, { PT_F91, "f91" }, - { PT_F92, "f92" }, { PT_F93, "f93" }, { PT_F94, "f94" }, - { PT_F95, "f95" }, { PT_F96, "f96" }, { PT_F97, "f97" }, - { PT_F98, "f98" }, { PT_F99, "f99" }, { PT_F100, "f100" }, - { PT_F101, "f101" }, { PT_F102, "f102" }, { PT_F103, "f103" }, - { PT_F104, "f104" }, { PT_F105, "f105" }, { PT_F106, "f106" }, - { PT_F107, "f107" }, { PT_F108, "f108" }, { PT_F109, "f109" }, - { PT_F110, "f110" }, { PT_F111, "f111" }, { PT_F112, "f112" }, - { PT_F113, "f113" }, { PT_F114, "f114" }, { PT_F115, "f115" }, - { PT_F116, "f116" }, { PT_F117, "f117" }, { PT_F118, "f118" }, - { PT_F119, "f119" }, { PT_F120, "f120" }, { PT_F121, "f121" }, - { PT_F122, "f122" }, { PT_F123, "f123" }, { PT_F124, "f124" }, - { PT_F125, "f125" }, { PT_F126, "f126" }, { PT_F127, "f127" }, - /* switch stack: */ - { PT_F2, "f2" }, { PT_F3, "f3" }, { PT_F4, "f4" }, - { PT_F5, "f5" }, { PT_F10, "f10" }, { PT_F11, "f11" }, - { PT_F12, "f12" }, { PT_F13, "f13" }, { PT_F14, "f14" }, - { PT_F15, "f15" }, { PT_F16, "f16" }, { PT_F17, "f17" }, - { PT_F18, "f18" }, { PT_F19, "f19" }, { PT_F20, "f20" }, - { PT_F21, "f21" }, { PT_F22, "f22" }, { PT_F23, "f23" }, - { PT_F24, "f24" }, { PT_F25, "f25" }, { PT_F26, "f26" }, - { PT_F27, "f27" }, { PT_F28, "f28" }, { PT_F29, "f29" }, - { PT_F30, "f30" }, { PT_F31, "f31" }, { PT_R4, "r4" }, - { PT_R5, "r5" }, { PT_R6, "r6" }, { PT_R7, "r7" }, - { PT_B1, "b1" }, { PT_B2, "b2" }, { PT_B3, "b3" }, - { PT_B4, "b4" }, { PT_B5, "b5" }, - { PT_AR_EC, "ar.ec" }, { PT_AR_LC, "ar.lc" }, - /* pt_regs */ - { PT_CR_IPSR, "psr" }, { PT_CR_IIP, "ip" }, - { PT_CFM, "cfm" }, { PT_AR_UNAT, "ar.unat" }, - { PT_AR_PFS, "ar.pfs" }, { PT_AR_RSC, "ar.rsc" }, - { PT_AR_RNAT, "ar.rnat" }, { PT_AR_BSPSTORE, "ar.bspstore" }, - { PT_PR, "pr" }, { PT_B6, "b6" }, { PT_AR_BSP, "ar.bsp" }, - { PT_R1, "r1" }, { PT_R2, "r2" }, { PT_R3, "r3" }, - { PT_R12, "r12" }, { PT_R13, "r13" }, { PT_R14, "r14" }, - { PT_R15, "r15" }, { PT_R8, "r8" }, { PT_R9, "r9" }, - { PT_R10, "r10" }, { PT_R11, "r11" }, { PT_R16, "r16" }, - { PT_R17, "r17" }, { PT_R18, "r18" }, { PT_R19, "r19" }, - { PT_R20, "r20" }, { PT_R21, "r21" }, { PT_R22, "r22" }, - { PT_R23, "r23" }, { PT_R24, "r24" }, { PT_R25, "r25" }, - { PT_R26, "r26" }, { PT_R27, "r27" }, { PT_R28, "r28" }, - { PT_R29, "r29" }, { PT_R30, "r30" }, { PT_R31, "r31" }, - { PT_AR_CCV, "ar.ccv" }, { PT_AR_FPSR, "ar.fpsr" }, - { PT_B0, "b0" }, { PT_B7, "b7" }, { PT_F6, "f6" }, - { PT_F7, "f7" }, { PT_F8, "f8" }, { PT_F9, "f9" }, -# ifdef PT_AR_CSD - { PT_AR_CSD, "ar.csd" }, -# endif -# ifdef PT_AR_SSD - { PT_AR_SSD, "ar.ssd" }, -# endif - { PT_DBR, "dbr" }, { PT_IBR, "ibr" }, { PT_PMD, "pmd" }, -#elif defined(I386) - XLAT(4*EBX), - XLAT(4*ECX), - XLAT(4*EDX), - XLAT(4*ESI), - XLAT(4*EDI), - XLAT(4*EBP), - XLAT(4*EAX), - XLAT(4*DS), - XLAT(4*ES), - XLAT(4*FS), - XLAT(4*GS), - XLAT(4*ORIG_EAX), - XLAT(4*EIP), - XLAT(4*CS), - XLAT(4*EFL), - XLAT(4*UESP), - XLAT(4*SS), -#elif defined(X86_64) || defined(X32) - XLAT(8*R15), - XLAT(8*R14), - XLAT(8*R13), - XLAT(8*R12), - XLAT(8*RBP), - XLAT(8*RBX), - XLAT(8*R11), - XLAT(8*R10), - XLAT(8*R9), - XLAT(8*R8), - XLAT(8*RAX), - XLAT(8*RCX), - XLAT(8*RDX), - XLAT(8*RSI), - XLAT(8*RDI), - XLAT(8*ORIG_RAX), - XLAT(8*RIP), - XLAT(8*CS), - { 8*EFLAGS, "8*EFL" }, - XLAT(8*RSP), - XLAT(8*SS), -#elif defined(M68K) - XLAT(4*PT_D1), - XLAT(4*PT_D2), - XLAT(4*PT_D3), - XLAT(4*PT_D4), - XLAT(4*PT_D5), - XLAT(4*PT_D6), - XLAT(4*PT_D7), - XLAT(4*PT_A0), - XLAT(4*PT_A1), - XLAT(4*PT_A2), - XLAT(4*PT_A3), - XLAT(4*PT_A4), - XLAT(4*PT_A5), - XLAT(4*PT_A6), - XLAT(4*PT_D0), - XLAT(4*PT_USP), - XLAT(4*PT_ORIG_D0), - XLAT(4*PT_SR), - XLAT(4*PT_PC), -#elif defined(SH) - XLAT(4*REG_REG0), - { 4*(REG_REG0+1), "4*REG_REG1" }, - { 4*(REG_REG0+2), "4*REG_REG2" }, - { 4*(REG_REG0+3), "4*REG_REG3" }, - { 4*(REG_REG0+4), "4*REG_REG4" }, - { 4*(REG_REG0+5), "4*REG_REG5" }, - { 4*(REG_REG0+6), "4*REG_REG6" }, - { 4*(REG_REG0+7), "4*REG_REG7" }, - { 4*(REG_REG0+8), "4*REG_REG8" }, - { 4*(REG_REG0+9), "4*REG_REG9" }, - { 4*(REG_REG0+10), "4*REG_REG10" }, - { 4*(REG_REG0+11), "4*REG_REG11" }, - { 4*(REG_REG0+12), "4*REG_REG12" }, - { 4*(REG_REG0+13), "4*REG_REG13" }, - { 4*(REG_REG0+14), "4*REG_REG14" }, - XLAT(4*REG_REG15), - XLAT(4*REG_PC), - XLAT(4*REG_PR), - XLAT(4*REG_SR), - XLAT(4*REG_GBR), - XLAT(4*REG_MACH), - XLAT(4*REG_MACL), - XLAT(4*REG_SYSCALL), - XLAT(4*REG_FPUL), - XLAT(4*REG_FPREG0), - { 4*(REG_FPREG0+1), "4*REG_FPREG1" }, - { 4*(REG_FPREG0+2), "4*REG_FPREG2" }, - { 4*(REG_FPREG0+3), "4*REG_FPREG3" }, - { 4*(REG_FPREG0+4), "4*REG_FPREG4" }, - { 4*(REG_FPREG0+5), "4*REG_FPREG5" }, - { 4*(REG_FPREG0+6), "4*REG_FPREG6" }, - { 4*(REG_FPREG0+7), "4*REG_FPREG7" }, - { 4*(REG_FPREG0+8), "4*REG_FPREG8" }, - { 4*(REG_FPREG0+9), "4*REG_FPREG9" }, - { 4*(REG_FPREG0+10), "4*REG_FPREG10" }, - { 4*(REG_FPREG0+11), "4*REG_FPREG11" }, - { 4*(REG_FPREG0+12), "4*REG_FPREG12" }, - { 4*(REG_FPREG0+13), "4*REG_FPREG13" }, - { 4*(REG_FPREG0+14), "4*REG_FPREG14" }, - XLAT(4*REG_FPREG15), -# ifdef REG_XDREG0 - XLAT(4*REG_XDREG0), - { 4*(REG_XDREG0+2), "4*REG_XDREG2" }, - { 4*(REG_XDREG0+4), "4*REG_XDREG4" }, - { 4*(REG_XDREG0+6), "4*REG_XDREG6" }, - { 4*(REG_XDREG0+8), "4*REG_XDREG8" }, - { 4*(REG_XDREG0+10), "4*REG_XDREG10" }, - { 4*(REG_XDREG0+12), "4*REG_XDREG12" }, - XLAT(4*REG_XDREG14), -# endif - XLAT(4*REG_FPSCR), -#elif defined(SH64) - { 0, "PC(L)" }, - { 4, "PC(U)" }, - { 8, "SR(L)" }, - { 12, "SR(U)" }, - { 16, "syscall no.(L)" }, - { 20, "syscall_no.(U)" }, - { 24, "R0(L)" }, - { 28, "R0(U)" }, - { 32, "R1(L)" }, - { 36, "R1(U)" }, - { 40, "R2(L)" }, - { 44, "R2(U)" }, - { 48, "R3(L)" }, - { 52, "R3(U)" }, - { 56, "R4(L)" }, - { 60, "R4(U)" }, - { 64, "R5(L)" }, - { 68, "R5(U)" }, - { 72, "R6(L)" }, - { 76, "R6(U)" }, - { 80, "R7(L)" }, - { 84, "R7(U)" }, - { 88, "R8(L)" }, - { 92, "R8(U)" }, - { 96, "R9(L)" }, - { 100, "R9(U)" }, - { 104, "R10(L)" }, - { 108, "R10(U)" }, - { 112, "R11(L)" }, - { 116, "R11(U)" }, - { 120, "R12(L)" }, - { 124, "R12(U)" }, - { 128, "R13(L)" }, - { 132, "R13(U)" }, - { 136, "R14(L)" }, - { 140, "R14(U)" }, - { 144, "R15(L)" }, - { 148, "R15(U)" }, - { 152, "R16(L)" }, - { 156, "R16(U)" }, - { 160, "R17(L)" }, - { 164, "R17(U)" }, - { 168, "R18(L)" }, - { 172, "R18(U)" }, - { 176, "R19(L)" }, - { 180, "R19(U)" }, - { 184, "R20(L)" }, - { 188, "R20(U)" }, - { 192, "R21(L)" }, - { 196, "R21(U)" }, - { 200, "R22(L)" }, - { 204, "R22(U)" }, - { 208, "R23(L)" }, - { 212, "R23(U)" }, - { 216, "R24(L)" }, - { 220, "R24(U)" }, - { 224, "R25(L)" }, - { 228, "R25(U)" }, - { 232, "R26(L)" }, - { 236, "R26(U)" }, - { 240, "R27(L)" }, - { 244, "R27(U)" }, - { 248, "R28(L)" }, - { 252, "R28(U)" }, - { 256, "R29(L)" }, - { 260, "R29(U)" }, - { 264, "R30(L)" }, - { 268, "R30(U)" }, - { 272, "R31(L)" }, - { 276, "R31(U)" }, - { 280, "R32(L)" }, - { 284, "R32(U)" }, - { 288, "R33(L)" }, - { 292, "R33(U)" }, - { 296, "R34(L)" }, - { 300, "R34(U)" }, - { 304, "R35(L)" }, - { 308, "R35(U)" }, - { 312, "R36(L)" }, - { 316, "R36(U)" }, - { 320, "R37(L)" }, - { 324, "R37(U)" }, - { 328, "R38(L)" }, - { 332, "R38(U)" }, - { 336, "R39(L)" }, - { 340, "R39(U)" }, - { 344, "R40(L)" }, - { 348, "R40(U)" }, - { 352, "R41(L)" }, - { 356, "R41(U)" }, - { 360, "R42(L)" }, - { 364, "R42(U)" }, - { 368, "R43(L)" }, - { 372, "R43(U)" }, - { 376, "R44(L)" }, - { 380, "R44(U)" }, - { 384, "R45(L)" }, - { 388, "R45(U)" }, - { 392, "R46(L)" }, - { 396, "R46(U)" }, - { 400, "R47(L)" }, - { 404, "R47(U)" }, - { 408, "R48(L)" }, - { 412, "R48(U)" }, - { 416, "R49(L)" }, - { 420, "R49(U)" }, - { 424, "R50(L)" }, - { 428, "R50(U)" }, - { 432, "R51(L)" }, - { 436, "R51(U)" }, - { 440, "R52(L)" }, - { 444, "R52(U)" }, - { 448, "R53(L)" }, - { 452, "R53(U)" }, - { 456, "R54(L)" }, - { 460, "R54(U)" }, - { 464, "R55(L)" }, - { 468, "R55(U)" }, - { 472, "R56(L)" }, - { 476, "R56(U)" }, - { 480, "R57(L)" }, - { 484, "R57(U)" }, - { 488, "R58(L)" }, - { 492, "R58(U)" }, - { 496, "R59(L)" }, - { 500, "R59(U)" }, - { 504, "R60(L)" }, - { 508, "R60(U)" }, - { 512, "R61(L)" }, - { 516, "R61(U)" }, - { 520, "R62(L)" }, - { 524, "R62(U)" }, - { 528, "TR0(L)" }, - { 532, "TR0(U)" }, - { 536, "TR1(L)" }, - { 540, "TR1(U)" }, - { 544, "TR2(L)" }, - { 548, "TR2(U)" }, - { 552, "TR3(L)" }, - { 556, "TR3(U)" }, - { 560, "TR4(L)" }, - { 564, "TR4(U)" }, - { 568, "TR5(L)" }, - { 572, "TR5(U)" }, - { 576, "TR6(L)" }, - { 580, "TR6(U)" }, - { 584, "TR7(L)" }, - { 588, "TR7(U)" }, - /* This entry is in case pt_regs contains dregs (depends on - the kernel build options). */ - { uoff(regs), "offsetof(struct user, regs)" }, - { uoff(fpu), "offsetof(struct user, fpu)" }, -#elif defined(ARM) - { uoff(regs.ARM_r0), "r0" }, - { uoff(regs.ARM_r1), "r1" }, - { uoff(regs.ARM_r2), "r2" }, - { uoff(regs.ARM_r3), "r3" }, - { uoff(regs.ARM_r4), "r4" }, - { uoff(regs.ARM_r5), "r5" }, - { uoff(regs.ARM_r6), "r6" }, - { uoff(regs.ARM_r7), "r7" }, - { uoff(regs.ARM_r8), "r8" }, - { uoff(regs.ARM_r9), "r9" }, - { uoff(regs.ARM_r10), "r10" }, - { uoff(regs.ARM_fp), "fp" }, - { uoff(regs.ARM_ip), "ip" }, - { uoff(regs.ARM_sp), "sp" }, - { uoff(regs.ARM_lr), "lr" }, - { uoff(regs.ARM_pc), "pc" }, - { uoff(regs.ARM_cpsr), "cpsr" }, -#elif defined(AVR32) - { uoff(regs.sr), "sr" }, - { uoff(regs.pc), "pc" }, - { uoff(regs.lr), "lr" }, - { uoff(regs.sp), "sp" }, - { uoff(regs.r12), "r12" }, - { uoff(regs.r11), "r11" }, - { uoff(regs.r10), "r10" }, - { uoff(regs.r9), "r9" }, - { uoff(regs.r8), "r8" }, - { uoff(regs.r7), "r7" }, - { uoff(regs.r6), "r6" }, - { uoff(regs.r5), "r5" }, - { uoff(regs.r4), "r4" }, - { uoff(regs.r3), "r3" }, - { uoff(regs.r2), "r2" }, - { uoff(regs.r1), "r1" }, - { uoff(regs.r0), "r0" }, - { uoff(regs.r12_orig), "orig_r12" }, -#elif defined(MIPS) - { 0, "r0" }, - { 1, "r1" }, - { 2, "r2" }, - { 3, "r3" }, - { 4, "r4" }, - { 5, "r5" }, - { 6, "r6" }, - { 7, "r7" }, - { 8, "r8" }, - { 9, "r9" }, - { 10, "r10" }, - { 11, "r11" }, - { 12, "r12" }, - { 13, "r13" }, - { 14, "r14" }, - { 15, "r15" }, - { 16, "r16" }, - { 17, "r17" }, - { 18, "r18" }, - { 19, "r19" }, - { 20, "r20" }, - { 21, "r21" }, - { 22, "r22" }, - { 23, "r23" }, - { 24, "r24" }, - { 25, "r25" }, - { 26, "r26" }, - { 27, "r27" }, - { 28, "r28" }, - { 29, "r29" }, - { 30, "r30" }, - { 31, "r31" }, - { 32, "f0" }, - { 33, "f1" }, - { 34, "f2" }, - { 35, "f3" }, - { 36, "f4" }, - { 37, "f5" }, - { 38, "f6" }, - { 39, "f7" }, - { 40, "f8" }, - { 41, "f9" }, - { 42, "f10" }, - { 43, "f11" }, - { 44, "f12" }, - { 45, "f13" }, - { 46, "f14" }, - { 47, "f15" }, - { 48, "f16" }, - { 49, "f17" }, - { 50, "f18" }, - { 51, "f19" }, - { 52, "f20" }, - { 53, "f21" }, - { 54, "f22" }, - { 55, "f23" }, - { 56, "f24" }, - { 57, "f25" }, - { 58, "f26" }, - { 59, "f27" }, - { 60, "f28" }, - { 61, "f29" }, - { 62, "f30" }, - { 63, "f31" }, - { 64, "pc" }, - { 65, "cause" }, - { 66, "badvaddr" }, - { 67, "mmhi" }, - { 68, "mmlo" }, - { 69, "fpcsr" }, - { 70, "fpeir" }, -#elif defined(TILE) - { PTREGS_OFFSET_REG(0), "r0" }, - { PTREGS_OFFSET_REG(1), "r1" }, - { PTREGS_OFFSET_REG(2), "r2" }, - { PTREGS_OFFSET_REG(3), "r3" }, - { PTREGS_OFFSET_REG(4), "r4" }, - { PTREGS_OFFSET_REG(5), "r5" }, - { PTREGS_OFFSET_REG(6), "r6" }, - { PTREGS_OFFSET_REG(7), "r7" }, - { PTREGS_OFFSET_REG(8), "r8" }, - { PTREGS_OFFSET_REG(9), "r9" }, - { PTREGS_OFFSET_REG(10), "r10" }, - { PTREGS_OFFSET_REG(11), "r11" }, - { PTREGS_OFFSET_REG(12), "r12" }, - { PTREGS_OFFSET_REG(13), "r13" }, - { PTREGS_OFFSET_REG(14), "r14" }, - { PTREGS_OFFSET_REG(15), "r15" }, - { PTREGS_OFFSET_REG(16), "r16" }, - { PTREGS_OFFSET_REG(17), "r17" }, - { PTREGS_OFFSET_REG(18), "r18" }, - { PTREGS_OFFSET_REG(19), "r19" }, - { PTREGS_OFFSET_REG(20), "r20" }, - { PTREGS_OFFSET_REG(21), "r21" }, - { PTREGS_OFFSET_REG(22), "r22" }, - { PTREGS_OFFSET_REG(23), "r23" }, - { PTREGS_OFFSET_REG(24), "r24" }, - { PTREGS_OFFSET_REG(25), "r25" }, - { PTREGS_OFFSET_REG(26), "r26" }, - { PTREGS_OFFSET_REG(27), "r27" }, - { PTREGS_OFFSET_REG(28), "r28" }, - { PTREGS_OFFSET_REG(29), "r29" }, - { PTREGS_OFFSET_REG(30), "r30" }, - { PTREGS_OFFSET_REG(31), "r31" }, - { PTREGS_OFFSET_REG(32), "r32" }, - { PTREGS_OFFSET_REG(33), "r33" }, - { PTREGS_OFFSET_REG(34), "r34" }, - { PTREGS_OFFSET_REG(35), "r35" }, - { PTREGS_OFFSET_REG(36), "r36" }, - { PTREGS_OFFSET_REG(37), "r37" }, - { PTREGS_OFFSET_REG(38), "r38" }, - { PTREGS_OFFSET_REG(39), "r39" }, - { PTREGS_OFFSET_REG(40), "r40" }, - { PTREGS_OFFSET_REG(41), "r41" }, - { PTREGS_OFFSET_REG(42), "r42" }, - { PTREGS_OFFSET_REG(43), "r43" }, - { PTREGS_OFFSET_REG(44), "r44" }, - { PTREGS_OFFSET_REG(45), "r45" }, - { PTREGS_OFFSET_REG(46), "r46" }, - { PTREGS_OFFSET_REG(47), "r47" }, - { PTREGS_OFFSET_REG(48), "r48" }, - { PTREGS_OFFSET_REG(49), "r49" }, - { PTREGS_OFFSET_REG(50), "r50" }, - { PTREGS_OFFSET_REG(51), "r51" }, - { PTREGS_OFFSET_REG(52), "r52" }, - { PTREGS_OFFSET_TP, "tp" }, - { PTREGS_OFFSET_SP, "sp" }, - { PTREGS_OFFSET_LR, "lr" }, - { PTREGS_OFFSET_PC, "pc" }, - { PTREGS_OFFSET_EX1, "ex1" }, - { PTREGS_OFFSET_FAULTNUM, "faultnum" }, - { PTREGS_OFFSET_ORIG_R0, "orig_r0" }, - { PTREGS_OFFSET_FLAGS, "flags" }, -#endif -#ifdef CRISV10 - XLAT(4*PT_FRAMETYPE), - XLAT(4*PT_ORIG_R10), - XLAT(4*PT_R13), - XLAT(4*PT_R12), - XLAT(4*PT_R11), - XLAT(4*PT_R10), - XLAT(4*PT_R9), - XLAT(4*PT_R8), - XLAT(4*PT_R7), - XLAT(4*PT_R6), - XLAT(4*PT_R5), - XLAT(4*PT_R4), - XLAT(4*PT_R3), - XLAT(4*PT_R2), - XLAT(4*PT_R1), - XLAT(4*PT_R0), - XLAT(4*PT_MOF), - XLAT(4*PT_DCCR), - XLAT(4*PT_SRP), - XLAT(4*PT_IRP), - XLAT(4*PT_CSRINSTR), - XLAT(4*PT_CSRADDR), - XLAT(4*PT_CSRDATA), - XLAT(4*PT_USP), -#endif -#ifdef CRISV32 - XLAT(4*PT_ORIG_R10), - XLAT(4*PT_R0), - XLAT(4*PT_R1), - XLAT(4*PT_R2), - XLAT(4*PT_R3), - XLAT(4*PT_R4), - XLAT(4*PT_R5), - XLAT(4*PT_R6), - XLAT(4*PT_R7), - XLAT(4*PT_R8), - XLAT(4*PT_R9), - XLAT(4*PT_R10), - XLAT(4*PT_R11), - XLAT(4*PT_R12), - XLAT(4*PT_R13), - XLAT(4*PT_ACR), - XLAT(4*PT_SRS), - XLAT(4*PT_MOF), - XLAT(4*PT_SPC), - XLAT(4*PT_CCS), - XLAT(4*PT_SRP), - XLAT(4*PT_ERP), - XLAT(4*PT_EXS), - XLAT(4*PT_EDA), - XLAT(4*PT_USP), - XLAT(4*PT_PPC), - XLAT(4*PT_BP_CTRL), - XLAT(4*PT_BP+4), - XLAT(4*PT_BP+8), - XLAT(4*PT_BP+12), - XLAT(4*PT_BP+16), - XLAT(4*PT_BP+20), - XLAT(4*PT_BP+24), - XLAT(4*PT_BP+28), - XLAT(4*PT_BP+32), - XLAT(4*PT_BP+36), - XLAT(4*PT_BP+40), - XLAT(4*PT_BP+44), - XLAT(4*PT_BP+48), - XLAT(4*PT_BP+52), - XLAT(4*PT_BP+56), -#endif -#ifdef MICROBLAZE - { PT_GPR(0), "r0" }, - { PT_GPR(1), "r1" }, - { PT_GPR(2), "r2" }, - { PT_GPR(3), "r3" }, - { PT_GPR(4), "r4" }, - { PT_GPR(5), "r5" }, - { PT_GPR(6), "r6" }, - { PT_GPR(7), "r7" }, - { PT_GPR(8), "r8" }, - { PT_GPR(9), "r9" }, - { PT_GPR(10), "r10" }, - { PT_GPR(11), "r11" }, - { PT_GPR(12), "r12" }, - { PT_GPR(13), "r13" }, - { PT_GPR(14), "r14" }, - { PT_GPR(15), "r15" }, - { PT_GPR(16), "r16" }, - { PT_GPR(17), "r17" }, - { PT_GPR(18), "r18" }, - { PT_GPR(19), "r19" }, - { PT_GPR(20), "r20" }, - { PT_GPR(21), "r21" }, - { PT_GPR(22), "r22" }, - { PT_GPR(23), "r23" }, - { PT_GPR(24), "r24" }, - { PT_GPR(25), "r25" }, - { PT_GPR(26), "r26" }, - { PT_GPR(27), "r27" }, - { PT_GPR(28), "r28" }, - { PT_GPR(29), "r29" }, - { PT_GPR(30), "r30" }, - { PT_GPR(31), "r31" }, - { PT_PC, "rpc", }, - { PT_MSR, "rmsr", }, - { PT_EAR, "rear", }, - { PT_ESR, "resr", }, - { PT_FSR, "rfsr", }, - { PT_KERNEL_MODE, "kernel_mode", }, -#endif -#ifdef OR1K - { 4*0, "r0" }, - { 4*1, "r1" }, - { 4*2, "r2" }, - { 4*3, "r3" }, - { 4*4, "r4" }, - { 4*5, "r5" }, - { 4*6, "r6" }, - { 4*7, "r7" }, - { 4*8, "r8" }, - { 4*9, "r9" }, - { 4*10, "r10" }, - { 4*11, "r11" }, - { 4*12, "r12" }, - { 4*13, "r13" }, - { 4*14, "r14" }, - { 4*15, "r15" }, - { 4*16, "r16" }, - { 4*17, "r17" }, - { 4*18, "r18" }, - { 4*19, "r19" }, - { 4*20, "r20" }, - { 4*21, "r21" }, - { 4*22, "r22" }, - { 4*23, "r23" }, - { 4*24, "r24" }, - { 4*25, "r25" }, - { 4*26, "r26" }, - { 4*27, "r27" }, - { 4*28, "r28" }, - { 4*29, "r29" }, - { 4*30, "r30" }, - { 4*31, "r31" }, - { 4*32, "pc" }, - { 4*33, "sr" }, -#endif -#ifdef XTENSA - { REG_A_BASE, "a0" }, - { REG_A_BASE+1, "a1" }, - { REG_A_BASE+2, "a2" }, - { REG_A_BASE+3, "a3" }, - { REG_A_BASE+4, "a4" }, - { REG_A_BASE+5, "a5" }, - { REG_A_BASE+6, "a6" }, - { REG_A_BASE+7, "a7" }, - { REG_A_BASE+8, "a8" }, - { REG_A_BASE+9, "a9" }, - { REG_A_BASE+10, "a10" }, - { REG_A_BASE+11, "a11" }, - { REG_A_BASE+12, "a12" }, - { REG_A_BASE+13, "a13" }, - { REG_A_BASE+14, "a14" }, - { REG_A_BASE+15, "a15" }, - { REG_PC, "pc" }, - { SYSCALL_NR, "syscall_nr" }, - { REG_AR_BASE, "ar0" }, - { REG_AR_BASE+1, "ar1" }, - { REG_AR_BASE+2, "ar2" }, - { REG_AR_BASE+3, "ar3" }, - { REG_AR_BASE+4, "ar4" }, - { REG_AR_BASE+5, "ar5" }, - { REG_AR_BASE+6, "ar6" }, - { REG_AR_BASE+7, "ar7" }, - { REG_AR_BASE+8, "ar8" }, - { REG_AR_BASE+9, "ar9" }, - { REG_AR_BASE+10, "ar10" }, - { REG_AR_BASE+11, "ar11" }, - { REG_AR_BASE+12, "ar12" }, - { REG_AR_BASE+13, "ar13" }, - { REG_AR_BASE+14, "ar14" }, - { REG_AR_BASE+15, "ar15" }, - { REG_AR_BASE+16, "ar16" }, - { REG_AR_BASE+17, "ar17" }, - { REG_AR_BASE+18, "ar18" }, - { REG_AR_BASE+19, "ar19" }, - { REG_AR_BASE+20, "ar20" }, - { REG_AR_BASE+21, "ar21" }, - { REG_AR_BASE+22, "ar22" }, - { REG_AR_BASE+23, "ar23" }, - { REG_AR_BASE+24, "ar24" }, - { REG_AR_BASE+25, "ar25" }, - { REG_AR_BASE+26, "ar26" }, - { REG_AR_BASE+27, "ar27" }, - { REG_AR_BASE+28, "ar28" }, - { REG_AR_BASE+29, "ar29" }, - { REG_AR_BASE+30, "ar30" }, - { REG_AR_BASE+31, "ar31" }, - { REG_AR_BASE+32, "ar32" }, - { REG_AR_BASE+33, "ar33" }, - { REG_AR_BASE+34, "ar34" }, - { REG_AR_BASE+35, "ar35" }, - { REG_AR_BASE+36, "ar36" }, - { REG_AR_BASE+37, "ar37" }, - { REG_AR_BASE+38, "ar38" }, - { REG_AR_BASE+39, "ar39" }, - { REG_AR_BASE+40, "ar40" }, - { REG_AR_BASE+41, "ar41" }, - { REG_AR_BASE+42, "ar42" }, - { REG_AR_BASE+43, "ar43" }, - { REG_AR_BASE+44, "ar44" }, - { REG_AR_BASE+45, "ar45" }, - { REG_AR_BASE+46, "ar46" }, - { REG_AR_BASE+47, "ar47" }, - { REG_AR_BASE+48, "ar48" }, - { REG_AR_BASE+49, "ar49" }, - { REG_AR_BASE+50, "ar50" }, - { REG_AR_BASE+51, "ar51" }, - { REG_AR_BASE+52, "ar52" }, - { REG_AR_BASE+53, "ar53" }, - { REG_AR_BASE+54, "ar54" }, - { REG_AR_BASE+55, "ar55" }, - { REG_AR_BASE+56, "ar56" }, - { REG_AR_BASE+57, "ar57" }, - { REG_AR_BASE+58, "ar58" }, - { REG_AR_BASE+59, "ar59" }, - { REG_AR_BASE+60, "ar60" }, - { REG_AR_BASE+61, "ar61" }, - { REG_AR_BASE+62, "ar62" }, - { REG_AR_BASE+63, "ar63" }, - { REG_LBEG, "lbeg" }, - { REG_LEND, "lend" }, - { REG_LCOUNT, "lcount" }, - { REG_SAR, "sar" }, - { REG_WB, "wb" }, - { REG_WS, "ws" }, - { REG_PS, "ps" }, + /* data */ + switch (request) { + case PTRACE_CONT: + case PTRACE_DETACH: + case PTRACE_SYSCALL: +#ifdef PTRACE_SINGLESTEP + case PTRACE_SINGLESTEP: #endif - - /* Other fields in "struct user" */ -#if defined(S390) || defined(S390X) - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - /* S390[X] has no start_data */ - { uoff(start_stack), "offsetof(struct user, start_stack)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(POWERPC) - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(I386) || defined(X86_64) || defined(X32) - { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, - { uoff(i387), "offsetof(struct user, i387)" }, - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - { uoff(start_stack), "offsetof(struct user, start_stack)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(reserved), "offsetof(struct user, reserved)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { uoff(u_debugreg), "offsetof(struct user, u_debugreg)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(IA64) - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(ARM) - { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - { uoff(start_stack), "offsetof(struct user, start_stack)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(reserved), "offsetof(struct user, reserved)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(AARCH64) - /* nothing */ -#elif defined(M68K) - { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, - { uoff(m68kfp), "offsetof(struct user, m68kfp)" }, - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - { uoff(start_stack), "offsetof(struct user, start_stack)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(reserved), "offsetof(struct user, reserved)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(MIPS) || defined(LINUX_MIPSN32) - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - { uoff(start_data), "offsetof(struct user, start_data)" }, - { uoff(start_stack), "offsetof(struct user, start_stack)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(ALPHA) - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(SPARC) - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(SPARC64) - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(HPPA) - /* nothing */ -#elif defined(SH) || defined(SH64) - { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - { uoff(start_data), "offsetof(struct user, start_data)" }, - { uoff(start_stack), "offsetof(struct user, start_stack)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(CRISV10) || defined(CRISV32) - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(TILE) - /* nothing */ -#elif defined(MICROBLAZE) - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(AVR32) - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - { uoff(start_data), "offsetof(struct user, start_data)" }, - { uoff(start_stack), "offsetof(struct user, start_stack)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(BFIN) - { uoff(u_tsize), "offsetof(struct user, u_tsize)" }, - { uoff(u_dsize), "offsetof(struct user, u_dsize)" }, - { uoff(u_ssize), "offsetof(struct user, u_ssize)" }, - { uoff(start_code), "offsetof(struct user, start_code)" }, - { uoff(signal), "offsetof(struct user, signal)" }, - { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, - { uoff(magic), "offsetof(struct user, magic)" }, - { uoff(u_comm), "offsetof(struct user, u_comm)" }, - { sizeof(struct user), "sizeof(struct user)" }, -#elif defined(OR1K) - /* nothing */ -#elif defined(METAG) - /* nothing */ -#elif defined(XTENSA) - /* nothing */ -#elif defined(ARC) - /* nothing */ +#ifdef PTRACE_SINGLEBLOCK + case PTRACE_SINGLEBLOCK: #endif - XLAT_END -}; - -int -sys_ptrace(struct tcb *tcp) -{ - const struct xlat *x; - long addr; - - if (entering(tcp)) { - printxval(ptrace_cmds, tcp->u_arg[0], "PTRACE_???"); - tprintf(", %lu, ", tcp->u_arg[1]); - - addr = tcp->u_arg[2]; - if (tcp->u_arg[0] == PTRACE_PEEKUSER - || tcp->u_arg[0] == PTRACE_POKEUSER - ) { - for (x = struct_user_offsets; x->str; x++) { - if (x->val >= addr) - break; - } - if (!x->str) - tprintf("%#lx, ", addr); - else if (x->val > addr && x != struct_user_offsets) { - x--; - tprintf("%s + %ld, ", x->str, addr - x->val); - } - else - tprintf("%s, ", x->str); - } else -#ifdef PTRACE_GETREGSET - if (tcp->u_arg[0] == PTRACE_GETREGSET - || tcp->u_arg[0] == PTRACE_SETREGSET - ) { - printxval(nt_descriptor_types, tcp->u_arg[2], "NT_???"); - tprints(", "); - } else +#ifdef PTRACE_SYSEMU + case PTRACE_SYSEMU: #endif - tprintf("%#lx, ", addr); - - - switch (tcp->u_arg[0]) { -#ifndef IA64 - case PTRACE_PEEKDATA: - case PTRACE_PEEKTEXT: - case PTRACE_PEEKUSER: - break; +#ifdef PTRACE_SYSEMU_SINGLESTEP + case PTRACE_SYSEMU_SINGLESTEP: #endif - case PTRACE_CONT: - case PTRACE_SINGLESTEP: - case PTRACE_SYSCALL: - case PTRACE_DETACH: - printsignal(tcp->u_arg[3]); + printsignal(data); break; -#ifdef PTRACE_SETOPTIONS + case PTRACE_SEIZE: case PTRACE_SETOPTIONS: - printflags(ptrace_setoptions_flags, tcp->u_arg[3], "PTRACE_O_???"); - break; +#ifdef PTRACE_OLDSETOPTIONS + case PTRACE_OLDSETOPTIONS: #endif -#ifdef PTRACE_SETSIGINFO - case PTRACE_SETSIGINFO: { - printsiginfo_at(tcp, tcp->u_arg[3]); + printflags64(ptrace_setoptions_flags, data, "PTRACE_O_???"); break; - } -#endif -#ifdef PTRACE_GETSIGINFO - case PTRACE_GETSIGINFO: - /* Don't print anything, do it at syscall return. */ + case PTRACE_SETSIGINFO: + printsiginfo_at(tcp, data); break; -#endif -#ifdef PTRACE_GETREGSET - case PTRACE_GETREGSET: + case PTRACE_SETSIGMASK: + print_sigset_addr_len(tcp, data, addr); break; case PTRACE_SETREGSET: - tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0); + tprint_iov(tcp, /*len:*/ 1, data, IOV_DECODE_ADDR); break; +#ifndef IA64 + case PTRACE_PEEKDATA: + case PTRACE_PEEKTEXT: + case PTRACE_PEEKUSER: #endif + case PTRACE_GETEVENTMSG: + case PTRACE_GETREGSET: + case PTRACE_GETSIGINFO: + case PTRACE_GETSIGMASK: + case PTRACE_PEEKSIGINFO: + case PTRACE_SECCOMP_GET_FILTER: + if (verbose(tcp)) { + /* print data on exiting syscall */ + return 0; + } + /* fall through */ default: - tprintf("%#lx", tcp->u_arg[3]); + printaddr(data); break; } + + return RVAL_DECODED; } else { - switch (tcp->u_arg[0]) { + switch (request) { +#ifndef IA64 case PTRACE_PEEKDATA: case PTRACE_PEEKTEXT: case PTRACE_PEEKUSER: -#ifdef IA64 - return RVAL_HEX; -#else - printnum(tcp, tcp->u_arg[3], "%#lx"); + printnum_ptr(tcp, data); break; #endif -#ifdef PTRACE_GETSIGINFO - case PTRACE_GETSIGINFO: { - printsiginfo_at(tcp, tcp->u_arg[3]); + case PTRACE_GETEVENTMSG: + printnum_ulong(tcp, data); break; - } -#endif -#ifdef PTRACE_GETREGSET case PTRACE_GETREGSET: - tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0); + tprint_iov(tcp, /*len:*/ 1, data, IOV_DECODE_ADDR); break; -#endif - } - } - return 0; -} - -#ifndef FUTEX_CMP_REQUEUE -# define FUTEX_CMP_REQUEUE 4 -#endif -#ifndef FUTEX_WAKE_OP -# define FUTEX_WAKE_OP 5 -#endif -#ifndef FUTEX_LOCK_PI -# define FUTEX_LOCK_PI 6 -# define FUTEX_UNLOCK_PI 7 -# define FUTEX_TRYLOCK_PI 8 -#endif -#ifndef FUTEX_WAIT_BITSET -# define FUTEX_WAIT_BITSET 9 -#endif -#ifndef FUTEX_WAKE_BITSET -# define FUTEX_WAKE_BITSET 10 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI -# define FUTEX_WAIT_REQUEUE_PI 11 -#endif -#ifndef FUTEX_CMP_REQUEUE_PI -# define FUTEX_CMP_REQUEUE_PI 12 -#endif -#ifndef FUTEX_PRIVATE_FLAG -# define FUTEX_PRIVATE_FLAG 128 -#endif -#ifndef FUTEX_CLOCK_REALTIME -# define FUTEX_CLOCK_REALTIME 256 -#endif -#ifndef FUTEX_WAIT_PRIVATE -# define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_WAKE_PRIVATE -# define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_REQUEUE_PRIVATE -# define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_CMP_REQUEUE_PRIVATE -# define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_WAKE_OP_PRIVATE -# define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_LOCK_PI_PRIVATE -# define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_UNLOCK_PI_PRIVATE -# define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_TRYLOCK_PI_PRIVATE -# define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_WAIT_BITSET_PRIVATE -# define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_WAKE_BITSET_PRIVATE -# define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI_PRIVATE -# define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_CMP_REQUEUE_PI_PRIVATE -# define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG) -#endif -#include "xlat/futexops.h" -#ifndef FUTEX_OP_SET -# define FUTEX_OP_SET 0 -# define FUTEX_OP_ADD 1 -# define FUTEX_OP_OR 2 -# define FUTEX_OP_ANDN 3 -# define FUTEX_OP_XOR 4 -# define FUTEX_OP_CMP_EQ 0 -# define FUTEX_OP_CMP_NE 1 -# define FUTEX_OP_CMP_LT 2 -# define FUTEX_OP_CMP_LE 3 -# define FUTEX_OP_CMP_GT 4 -# define FUTEX_OP_CMP_GE 5 -#endif -#include "xlat/futexwakeops.h" -#include "xlat/futexwakecmps.h" - -int -sys_futex(struct tcb *tcp) -{ - if (entering(tcp)) { - long int cmd = tcp->u_arg[1] & 127; - tprintf("%p, ", (void *) tcp->u_arg[0]); - printxval(futexops, tcp->u_arg[1], "FUTEX_???"); - tprintf(", %ld", tcp->u_arg[2]); - if (cmd == FUTEX_WAKE_BITSET) - tprintf(", %lx", tcp->u_arg[5]); - else if (cmd == FUTEX_WAIT) { - tprints(", "); - printtv(tcp, tcp->u_arg[3]); - } else if (cmd == FUTEX_WAIT_BITSET) { - tprints(", "); - printtv(tcp, tcp->u_arg[3]); - tprintf(", %lx", tcp->u_arg[5]); - } else if (cmd == FUTEX_REQUEUE) - tprintf(", %ld, %p", tcp->u_arg[3], (void *) tcp->u_arg[4]); - else if (cmd == FUTEX_CMP_REQUEUE || cmd == FUTEX_CMP_REQUEUE_PI) - tprintf(", %ld, %p, %ld", tcp->u_arg[3], (void *) tcp->u_arg[4], tcp->u_arg[5]); - else if (cmd == FUTEX_WAKE_OP) { - tprintf(", %ld, %p, {", tcp->u_arg[3], (void *) tcp->u_arg[4]); - if ((tcp->u_arg[5] >> 28) & 8) - tprints("FUTEX_OP_OPARG_SHIFT|"); - printxval(futexwakeops, (tcp->u_arg[5] >> 28) & 0x7, "FUTEX_OP_???"); - tprintf(", %ld, ", (tcp->u_arg[5] >> 12) & 0xfff); - if ((tcp->u_arg[5] >> 24) & 8) - tprints("FUTEX_OP_OPARG_SHIFT|"); - printxval(futexwakecmps, (tcp->u_arg[5] >> 24) & 0x7, "FUTEX_OP_CMP_???"); - tprintf(", %ld}", tcp->u_arg[5] & 0xfff); - } else if (cmd == FUTEX_WAIT_REQUEUE_PI) { - tprints(", "); - printtv(tcp, tcp->u_arg[3]); - tprintf(", %p", (void *) tcp->u_arg[4]); - } - } - return 0; -} - -static void -print_affinitylist(struct tcb *tcp, long list, unsigned int len) -{ - int first = 1; - unsigned long w, min_len; - - if (abbrev(tcp) && len / sizeof(w) > max_strlen) - min_len = len - max_strlen * sizeof(w); - else - min_len = 0; - for (; len >= sizeof(w) && len > min_len; - len -= sizeof(w), list += sizeof(w)) { - if (umove(tcp, list, &w) < 0) + case PTRACE_GETSIGINFO: + printsiginfo_at(tcp, data); + break; + case PTRACE_GETSIGMASK: + print_sigset_addr_len(tcp, data, addr); + break; + case PTRACE_PEEKSIGINFO: + print_siginfo_array(tcp, data, tcp->u_rval); + break; + case PTRACE_SECCOMP_GET_FILTER: + print_seccomp_fprog(tcp, data, tcp->u_rval); break; - if (first) - tprints("{"); - else - tprints(", "); - first = 0; - tprintf("%lx", w); - } - if (len) { - if (first) - tprintf("%#lx", list); - else - tprintf(", %s}", (len >= sizeof(w) && len > min_len ? - "???" : "...")); - } else { - tprints(first ? "{}" : "}"); - } -} - -int -sys_sched_setaffinity(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - print_affinitylist(tcp, tcp->u_arg[2], tcp->u_arg[1]); - } - return 0; -} - -int -sys_sched_getaffinity(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - } else { - if (tcp->u_rval == -1) - tprintf("%#lx", tcp->u_arg[2]); - else - print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval); - } - return 0; -} - -int -sys_get_robust_list(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]); - } else { - void *addr; - size_t len; - - if (syserror(tcp) || - !tcp->u_arg[1] || - umove(tcp, tcp->u_arg[1], &addr) < 0) { - tprintf("%#lx, ", tcp->u_arg[1]); - } else { - tprintf("[%p], ", addr); - } - - if (syserror(tcp) || - !tcp->u_arg[2] || - umove(tcp, tcp->u_arg[2], &len) < 0) { - tprintf("%#lx", tcp->u_arg[2]); - } else { - tprintf("[%lu]", (unsigned long) len); - } - } - return 0; -} - -#include "xlat/schedulers.h" - -int -sys_sched_getscheduler(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%d", (int) tcp->u_arg[0]); - } else if (!syserror(tcp)) { - tcp->auxstr = xlookup(schedulers, tcp->u_rval); - if (tcp->auxstr != NULL) - return RVAL_STR; - } - return 0; -} - -int -sys_sched_setscheduler(struct tcb *tcp) -{ - if (entering(tcp)) { - struct sched_param p; - tprintf("%d, ", (int) tcp->u_arg[0]); - printxval(schedulers, tcp->u_arg[1], "SCHED_???"); - if (umove(tcp, tcp->u_arg[2], &p) < 0) - tprintf(", %#lx", tcp->u_arg[2]); - else - tprintf(", { %d }", p.sched_priority); - } - return 0; -} - -int -sys_sched_getparam(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%d, ", (int) tcp->u_arg[0]); - } else { - struct sched_param p; - if (umove(tcp, tcp->u_arg[1], &p) < 0) - tprintf("%#lx", tcp->u_arg[1]); - else - tprintf("{ %d }", p.sched_priority); - } - return 0; -} - -int -sys_sched_setparam(struct tcb *tcp) -{ - if (entering(tcp)) { - struct sched_param p; - if (umove(tcp, tcp->u_arg[1], &p) < 0) - tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]); - else - tprintf("%d, { %d }", (int) tcp->u_arg[0], p.sched_priority); - } - return 0; -} - -int -sys_sched_get_priority_min(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(schedulers, tcp->u_arg[0], "SCHED_???"); - } - return 0; -} - -int -sys_sched_rr_get_interval(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]); - } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - print_timespec(tcp, tcp->u_arg[1]); - } - return 0; -} - -#if defined X86_64 || defined X32 -# include - -#include "xlat/archvals.h" - -int -sys_arch_prctl(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(archvals, tcp->u_arg[0], "ARCH_???"); - if (tcp->u_arg[0] == ARCH_SET_GS - || tcp->u_arg[0] == ARCH_SET_FS - ) { - tprintf(", %#lx", tcp->u_arg[1]); - } - } else { - if (tcp->u_arg[0] == ARCH_GET_GS - || tcp->u_arg[0] == ARCH_GET_FS - ) { - long int v; - if (!syserror(tcp) && umove(tcp, tcp->u_arg[1], &v) != -1) - tprintf(", [%#lx]", v); - else - tprintf(", %#lx", tcp->u_arg[1]); - } - } - return 0; -} -#endif /* X86_64 || X32 */ - -int -sys_getcpu(struct tcb *tcp) -{ - if (exiting(tcp)) { - unsigned u; - if (tcp->u_arg[0] == 0) - tprints("NULL, "); - else if (umove(tcp, tcp->u_arg[0], &u) < 0) - tprintf("%#lx, ", tcp->u_arg[0]); - else - tprintf("[%u], ", u); - if (tcp->u_arg[1] == 0) - tprints("NULL, "); - else if (umove(tcp, tcp->u_arg[1], &u) < 0) - tprintf("%#lx, ", tcp->u_arg[1]); - else - tprintf("[%u], ", u); - tprintf("%#lx", tcp->u_arg[2]); - } - return 0; -} - -int -sys_process_vm_readv(struct tcb *tcp) -{ - if (entering(tcp)) { - /* arg 1: pid */ - tprintf("%ld, ", tcp->u_arg[0]); - } else { - /* arg 2: local iov */ - if (syserror(tcp)) { - tprintf("%#lx", tcp->u_arg[1]); - } else { - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); - } - /* arg 3: local iovcnt */ - tprintf(", %lu, ", tcp->u_arg[2]); - /* arg 4: remote iov */ - if (syserror(tcp)) { - tprintf("%#lx", tcp->u_arg[3]); - } else { - tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0); } - /* arg 5: remote iovcnt */ - /* arg 6: flags */ - tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]); - } - return 0; -} - -int -sys_process_vm_writev(struct tcb *tcp) -{ - if (entering(tcp)) { - /* arg 1: pid */ - tprintf("%ld, ", tcp->u_arg[0]); - /* arg 2: local iov */ - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); - /* arg 3: local iovcnt */ - tprintf(", %lu, ", tcp->u_arg[2]); - /* arg 4: remote iov */ - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[3]); - else - tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0); - /* arg 5: remote iovcnt */ - /* arg 6: flags */ - tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]); } return 0; } diff --git a/process_vm.c b/process_vm.c new file mode 100644 index 00000000..f63b9173 --- /dev/null +++ b/process_vm.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2012 Denys Vlasenko + * Copyright (c) 2012-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +SYS_FUNC(process_vm_readv) +{ + if (entering(tcp)) { + /* arg 1: pid */ + tprintf("%d, ", (int) tcp->u_arg[0]); + } else { + kernel_ulong_t local_iovcnt = tcp->u_arg[2]; + kernel_ulong_t remote_iovcnt = tcp->u_arg[4]; + kernel_ulong_t flags = tcp->u_arg[5]; + + /* arg 2: local iov */ + tprint_iov_upto(tcp, local_iovcnt, tcp->u_arg[1], + syserror(tcp) ? IOV_DECODE_ADDR : IOV_DECODE_STR, + tcp->u_rval); + /* arg 3: local iovcnt */ + tprintf(", %" PRI_klu ", ", local_iovcnt); + /* arg 4: remote iov */ + tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3], + IOV_DECODE_ADDR); + /* arg 5: remote iovcnt */ + /* arg 6: flags */ + tprintf(", %" PRI_klu ", %" PRI_klu, remote_iovcnt, flags); + } + return 0; +} + +SYS_FUNC(process_vm_writev) +{ + kernel_ulong_t local_iovcnt = tcp->u_arg[2]; + kernel_ulong_t remote_iovcnt = tcp->u_arg[4]; + kernel_ulong_t flags = tcp->u_arg[5]; + + /* arg 1: pid */ + tprintf("%d, ", (int) tcp->u_arg[0]); + /* arg 2: local iov */ + tprint_iov(tcp, local_iovcnt, tcp->u_arg[1], IOV_DECODE_STR); + /* arg 3: local iovcnt */ + tprintf(", %" PRI_klu ", ", local_iovcnt); + /* arg 4: remote iov */ + tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3], IOV_DECODE_ADDR); + /* arg 5: remote iovcnt */ + /* arg 6: flags */ + tprintf(", %" PRI_klu ", %" PRI_klu, remote_iovcnt, flags); + + return RVAL_DECODED; +} diff --git a/ptp.c b/ptp.c index 1d9cf247..e2a720ba 100644 --- a/ptp.c +++ b/ptp.c @@ -1,97 +1,139 @@ +/* + * Copyright (c) 2014 Stefan Sørensen + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "defs.h" -#include +#include #include #include "xlat/ptp_flags_options.h" -int ptp_ioctl(struct tcb *tcp, long code, long arg) +int +ptp_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) { if (!verbose(tcp)) - return 0; + return RVAL_DECODED; switch (code) { - case PTP_CLOCK_GETCAPS: /* decode on exit */ - { - struct ptp_clock_caps caps; + case PTP_EXTTS_REQUEST: { + struct ptp_extts_request extts; - if (entering(tcp) || syserror(tcp) || - umove(tcp, arg, &caps) < 0) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, arg, &extts)) + break; - tprintf(", {max_adj=%d, n_alarm=%d, n_ext_ts=%d, n_per_out=%d, pps=%d}", - caps.max_adj, caps.n_alarm, caps.n_ext_ts, - caps.n_per_out, caps.pps); - return 1; - } + tprintf("{index=%d, flags=", extts.index); + printflags(ptp_flags_options, extts.flags, "PTP_???"); + tprints("}"); + break; + } - case PTP_EXTTS_REQUEST: /* decode on enter */ - { - struct ptp_extts_request extts; + case PTP_PEROUT_REQUEST: { + struct ptp_perout_request perout; - if (exiting(tcp)) - return 1; - if (umove(tcp, arg, &extts) < 0) { - tprintf(", %#lx", arg); - return 0; - } - tprintf(", {index=%d, flags=", extts.index); - printflags(ptp_flags_options, extts.flags, "PTP_???"); - tprints("}"); - return 1; - } + tprints(", "); + if (umove_or_printaddr(tcp, arg, &perout)) + break; - case PTP_PEROUT_REQUEST: /* decode on enter */ - { - struct ptp_perout_request perout; + tprintf("{start={%" PRId64 ", %" PRIu32 "}" + ", period={%" PRId64 ", %" PRIu32 "}" + ", index=%d, flags=", + (int64_t)perout.start.sec, perout.start.nsec, + (int64_t)perout.period.sec, perout.period.nsec, + perout.index); + printflags(ptp_flags_options, perout.flags, "PTP_???"); + tprints("}"); + break; + } - if (exiting(tcp)) - return 1; - if (umove(tcp, arg, &perout) < 0) { - tprintf(", %#lx", arg); - return 0; - } + case PTP_ENABLE_PPS: + tprintf(", %" PRI_kld, arg); + break; - tprintf(", {start={%" PRId64 ", %" PRIu32 "}" - ", period={%" PRId64 ", %" PRIu32 "}" - ", index=%d, flags=", - (int64_t)perout.start.sec, perout.start.nsec, - (int64_t)perout.period.sec, perout.period.nsec, - perout.index); - printflags(ptp_flags_options, perout.flags, "PTP_???"); - tprints("}"); - return 1; - } + case PTP_SYS_OFFSET: { + struct ptp_sys_offset sysoff; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &sysoff)) + break; - case PTP_ENABLE_PPS: /* decode on enter */ - if (entering(tcp)) - tprintf(", %ld", arg); + tprintf("{n_samples=%u", sysoff.n_samples); return 1; + } else { + unsigned int n_samples, i; - case PTP_SYS_OFFSET: /* decode on exit */ - { - struct ptp_sys_offset sysoff; - unsigned int i; + if (syserror(tcp)) { + tprints("}"); + break; + } - if (entering(tcp) || umove(tcp, arg, &sysoff) < 0) - return 0; + tprints(", "); + if (umove(tcp, arg, &sysoff) < 0) { + tprints("???}"); + break; + } - tprintf(", {n_samples=%u, ts={", sysoff.n_samples); - if (syserror(tcp)) { - tprints("...}}"); - return 1; + tprints("ts=["); + n_samples = sysoff.n_samples > PTP_MAX_SAMPLES ? + PTP_MAX_SAMPLES : sysoff.n_samples; + for (i = 0; i < 2 * n_samples + 1; ++i) { + if (i > 0) + tprints(", "); + tprintf("{%" PRId64 ", %" PRIu32 "}", + (int64_t)sysoff.ts[i].sec, + sysoff.ts[i].nsec); } if (sysoff.n_samples > PTP_MAX_SAMPLES) - sysoff.n_samples = PTP_MAX_SAMPLES; - tprintf("{%" PRId64 ", %" PRIu32 "}", - (int64_t)sysoff.ts[0].sec, sysoff.ts[0].nsec); - for (i = 1; i < 2*sysoff.n_samples+1; ++i) - tprintf(", {%" PRId64 ", %" PRIu32 "}", - (int64_t)sysoff.ts[i].sec, sysoff.ts[i].nsec); - tprints("}}"); - return 1; + tprints(", ..."); + tprints("]}"); + break; } + } + case PTP_CLOCK_GETCAPS: { + struct ptp_clock_caps caps; - default: /* decode on exit */ + if (entering(tcp)) return 0; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &caps)) + break; + + tprintf("{max_adj=%d, n_alarm=%d, n_ext_ts=%d, n_per_out=%d, pps=%d}", + caps.max_adj, caps.n_alarm, caps.n_ext_ts, + caps.n_per_out, caps.pps); + break; } + + default: + return RVAL_DECODED; + } + + return RVAL_DECODED | 1; } diff --git a/ptrace.h b/ptrace.h new file mode 100644 index 00000000..ce4fd9af --- /dev/null +++ b/ptrace.h @@ -0,0 +1,182 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 2004 Roland McGrath + * Copyright (c) 2010 Wang Chao + * Copyright (c) 2011-2013 Denys Vlasenko + * Copyright (c) 2011-2016 Dmitry V. Levin + * Copyright (c) 2013 Ali Polatel + * Copyright (c) 2015 Mike Frysinger + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_PTRACE_H +#define STRACE_PTRACE_H + +#include + +#ifdef HAVE_STRUCT_IA64_FPREG +# define ia64_fpreg XXX_ia64_fpreg +#endif +#ifdef HAVE_STRUCT_PT_ALL_USER_REGS +# define pt_all_user_regs XXX_pt_all_user_regs +#endif +#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS +# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args +#endif + +#include + +#ifdef HAVE_STRUCT_IA64_FPREG +# undef ia64_fpreg +#endif +#ifdef HAVE_STRUCT_PT_ALL_USER_REGS +# undef pt_all_user_regs +#endif +#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS +# undef ptrace_peeksiginfo_args +#endif + +#if defined(SPARC) || defined(SPARC64) +/* + * SPARC has a different PTRACE_DETACH value correctly defined in sys/ptrace.h, + * but linux/ptrace.h clobbers it with the standard one. PTRACE_SUNDETACH is + * also defined to the correct value by sys/ptrace.h, so use that instead. + */ +# undef PTRACE_DETACH +# define PTRACE_DETACH PTRACE_SUNDETACH +#endif + +#ifndef PTRACE_EVENT_FORK +# define PTRACE_EVENT_FORK 1 +#endif +#ifndef PTRACE_EVENT_VFORK +# define PTRACE_EVENT_VFORK 2 +#endif +#ifndef PTRACE_EVENT_CLONE +# define PTRACE_EVENT_CLONE 3 +#endif +#ifndef PTRACE_EVENT_EXEC +# define PTRACE_EVENT_EXEC 4 +#endif +#ifndef PTRACE_EVENT_VFORK_DONE +# define PTRACE_EVENT_VFORK_DONE 5 +#endif +#ifndef PTRACE_EVENT_EXIT +# define PTRACE_EVENT_EXIT 6 +#endif +#ifndef PTRACE_EVENT_SECCOMP +# define PTRACE_EVENT_SECCOMP 7 +#endif +#ifdef PTRACE_EVENT_STOP +/* Linux 3.1 - 3.3 releases had a broken value. It was fixed in 3.4. */ +# if PTRACE_EVENT_STOP == 7 +# undef PTRACE_EVENT_STOP +# endif +#endif +#ifndef PTRACE_EVENT_STOP +# define PTRACE_EVENT_STOP 128 +#endif + +#ifndef PTRACE_O_TRACESYSGOOD +# define PTRACE_O_TRACESYSGOOD 1 +#endif +#ifndef PTRACE_O_TRACEFORK +# define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK) +#endif +#ifndef PTRACE_O_TRACEVFORK +# define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK) +#endif +#ifndef PTRACE_O_TRACECLONE +# define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE) +#endif +#ifndef PTRACE_O_TRACEEXEC +# define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC) +#endif +#ifndef PTRACE_O_TRACEVFORKDONE +# define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE) +#endif +#ifndef PTRACE_O_TRACEEXIT +# define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) +#endif +#ifndef PTRACE_O_TRACESECCOMP +# define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) +#endif +#ifndef PTRACE_O_EXITKILL +# define PTRACE_O_EXITKILL (1 << 20) +#endif +#ifndef PTRACE_O_SUSPEND_SECCOMP +# define PTRACE_O_SUSPEND_SECCOMP (1 << 21) +#endif + +#ifndef PTRACE_SETOPTIONS +# define PTRACE_SETOPTIONS 0x4200 +#endif +#ifndef PTRACE_GETEVENTMSG +# define PTRACE_GETEVENTMSG 0x4201 +#endif +#ifndef PTRACE_GETSIGINFO +# define PTRACE_GETSIGINFO 0x4202 +#endif +#ifndef PTRACE_SETSIGINFO +# define PTRACE_SETSIGINFO 0x4203 +#endif +#ifndef PTRACE_GETREGSET +# define PTRACE_GETREGSET 0x4204 +#endif +#ifndef PTRACE_SETREGSET +# define PTRACE_SETREGSET 0x4205 +#endif +#ifndef PTRACE_SEIZE +# define PTRACE_SEIZE 0x4206 +#endif +#ifndef PTRACE_INTERRUPT +# define PTRACE_INTERRUPT 0x4207 +#endif +#ifndef PTRACE_LISTEN +# define PTRACE_LISTEN 0x4208 +#endif +#ifndef PTRACE_PEEKSIGINFO +# define PTRACE_PEEKSIGINFO 0x4209 +#endif +#ifndef PTRACE_GETSIGMASK +# define PTRACE_GETSIGMASK 0x420a +#endif +#ifndef PTRACE_SETSIGMASK +# define PTRACE_SETSIGMASK 0x420b +#endif +#ifndef PTRACE_SECCOMP_GET_FILTER +# define PTRACE_SECCOMP_GET_FILTER 0x420c +#endif + +#if !HAVE_DECL_PTRACE_PEEKUSER +# define PTRACE_PEEKUSER PTRACE_PEEKUSR +#endif +#if !HAVE_DECL_PTRACE_POKEUSER +# define PTRACE_POKEUSER PTRACE_POKEUSR +#endif + +#endif /* !STRACE_PTRACE_H */ diff --git a/qualify.c b/qualify.c new file mode 100644 index 00000000..bb4aefe3 --- /dev/null +++ b/qualify.c @@ -0,0 +1,640 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "nsig.h" + +typedef unsigned int number_slot_t; +#define BITS_PER_SLOT (sizeof(number_slot_t) * 8) + +struct number_set { + number_slot_t *vec; + unsigned int nslots; + bool not; +}; + +struct number_set read_set; +struct number_set write_set; +struct number_set signal_set; + +static struct number_set abbrev_set[SUPPORTED_PERSONALITIES]; +static struct number_set inject_set[SUPPORTED_PERSONALITIES]; +static struct number_set raw_set[SUPPORTED_PERSONALITIES]; +static struct number_set trace_set[SUPPORTED_PERSONALITIES]; +static struct number_set verbose_set[SUPPORTED_PERSONALITIES]; + +static void +number_setbit(const unsigned int i, number_slot_t *const vec) +{ + vec[i / BITS_PER_SLOT] |= (number_slot_t) 1 << (i % BITS_PER_SLOT); +} + +static bool +number_isset(const unsigned int i, const number_slot_t *const vec) +{ + return vec[i / BITS_PER_SLOT] & ((number_slot_t) 1 << (i % BITS_PER_SLOT)); +} + +static void +reallocate_number_set(struct number_set *const set, const unsigned int new_nslots) +{ + if (new_nslots <= set->nslots) + return; + set->vec = xreallocarray(set->vec, new_nslots, sizeof(*set->vec)); + memset(set->vec + set->nslots, 0, + sizeof(*set->vec) * (new_nslots - set->nslots)); + set->nslots = new_nslots; +} + +static void +add_number_to_set(const unsigned int number, struct number_set *const set) +{ + reallocate_number_set(set, number / BITS_PER_SLOT + 1); + number_setbit(number, set->vec); +} + +bool +is_number_in_set(const unsigned int number, const struct number_set *const set) +{ + return ((number / BITS_PER_SLOT < set->nslots) + && number_isset(number, set->vec)) ^ set->not; +} + +typedef int (*string_to_uint_func)(const char *); + +/* + * Add numbers to SET according to STR specification. + */ +static void +qualify_tokens(const char *const str, struct number_set *const set, + string_to_uint_func func, const char *const name) +{ + /* Clear the set. */ + if (set->nslots) + memset(set->vec, 0, sizeof(*set->vec) * set->nslots); + set->not = false; + + /* + * Each leading ! character means inversion + * of the remaining specification. + */ + const char *s = str; +handle_inversion: + while (*s == '!') { + set->not = !set->not; + ++s; + } + + if (strcmp(s, "none") == 0) { + /* + * No numbers are added to the set. + * Subsequent is_number_in_set invocations will return set->not. + */ + return; + } else if (strcmp(s, "all") == 0) { + s = "!none"; + goto handle_inversion; + } + + /* + * Split the string into comma separated tokens. + * For each token, find out the corresponding number + * by calling FUNC, and add that number to the set. + * The absence of tokens or a negative answer + * from FUNC is a fatal error. + */ + char *copy = xstrdup(s); + char *saveptr = NULL; + const char *token; + int number = -1; + + for (token = strtok_r(copy, ",", &saveptr); token; + token = strtok_r(NULL, ",", &saveptr)) { + number = func(token); + if (number < 0) { + error_msg_and_die("invalid %s '%s'", name, token); + } + + add_number_to_set(number, set); + } + + free(copy); + + if (number < 0) { + error_msg_and_die("invalid %s '%s'", name, str); + } +} + +static int +sigstr_to_uint(const char *s) +{ + int i; + + if (*s >= '0' && *s <= '9') + return string_to_uint_upto(s, 255); + + if (strncasecmp(s, "SIG", 3) == 0) + s += 3; + + for (i = 0; i <= 255; ++i) { + const char *name = signame(i); + + if (strncasecmp(name, "SIG", 3) != 0) + continue; + + name += 3; + + if (strcasecmp(name, s) != 0) + continue; + + return i; + } + + return -1; +} + +static bool +qualify_syscall_number(const char *s, struct number_set *set) +{ + int n = string_to_uint(s); + if (n < 0) + return false; + + unsigned int p; + bool done = false; + + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + if ((unsigned) n >= nsyscall_vec[p]) { + continue; + } + add_number_to_set(n, &set[p]); + done = true; + } + + return done; +} + +static unsigned int +lookup_class(const char *s) +{ + static const struct { + const char *name; + unsigned int value; + } syscall_class[] = { + { "desc", TRACE_DESC }, + { "file", TRACE_FILE }, + { "memory", TRACE_MEMORY }, + { "process", TRACE_PROCESS }, + { "signal", TRACE_SIGNAL }, + { "ipc", TRACE_IPC }, + { "network", TRACE_NETWORK }, + }; + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(syscall_class); ++i) { + if (strcmp(s, syscall_class[i].name) == 0) { + return syscall_class[i].value; + } + } + + return 0; +} + +static bool +qualify_syscall_class(const char *s, struct number_set *set) +{ + const unsigned int n = lookup_class(s); + if (!n) + return false; + + unsigned int p; + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + unsigned int i; + + for (i = 0; i < nsyscall_vec[p]; ++i) { + if (!sysent_vec[p][i].sys_name + || (sysent_vec[p][i].sys_flags & n) != n) { + continue; + } + add_number_to_set(i, &set[p]); + } + } + + return true; +} + +static bool +qualify_syscall_name(const char *s, struct number_set *set) +{ + unsigned int p; + bool found = false; + + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + unsigned int i; + + for (i = 0; i < nsyscall_vec[p]; ++i) { + if (!sysent_vec[p][i].sys_name + || strcmp(s, sysent_vec[p][i].sys_name)) { + continue; + } + add_number_to_set(i, &set[p]); + found = true; + } + } + + return found; +} + +static bool +qualify_syscall(const char *token, struct number_set *set) +{ + if (*token >= '0' && *token <= '9') + return qualify_syscall_number(token, set); + return qualify_syscall_class(token, set) + || qualify_syscall_name(token, set); +} + +/* + * Add syscall numbers to SETs for each supported personality + * according to STR specification. + */ +static void +qualify_syscall_tokens(const char *const str, struct number_set *const set, + const char *const name) +{ + /* Clear all sets. */ + unsigned int p; + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + if (set[p].nslots) + memset(set[p].vec, 0, + sizeof(*set[p].vec) * set[p].nslots); + set[p].not = false; + } + + /* + * Each leading ! character means inversion + * of the remaining specification. + */ + const char *s = str; +handle_inversion: + while (*s == '!') { + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + set[p].not = !set[p].not; + } + ++s; + } + + if (strcmp(s, "none") == 0) { + /* + * No syscall numbers are added to sets. + * Subsequent is_number_in_set invocations + * will return set[p]->not. + */ + return; + } else if (strcmp(s, "all") == 0) { + s = "!none"; + goto handle_inversion; + } + + /* + * Split the string into comma separated tokens. + * For each token, call qualify_syscall that will take care + * if adding appropriate syscall numbers to sets. + * The absence of tokens or a negative return code + * from qualify_syscall is a fatal error. + */ + char *copy = xstrdup(s); + char *saveptr = NULL; + const char *token; + bool done = false; + + for (token = strtok_r(copy, ",", &saveptr); token; + token = strtok_r(NULL, ",", &saveptr)) { + done = qualify_syscall(token, set); + if (!done) { + error_msg_and_die("invalid %s '%s'", name, token); + } + } + + free(copy); + + if (!done) { + error_msg_and_die("invalid %s '%s'", name, str); + } +} + +/* + * Returns NULL if STR does not start with PREFIX, + * or a pointer to the first char in STR after PREFIX. + */ +static const char * +strip_prefix(const char *prefix, const char *str) +{ + size_t len = strlen(prefix); + + return strncmp(prefix, str, len) ? NULL : str + len; +} + +static int +find_errno_by_name(const char *name) +{ + unsigned int i; + + for (i = 1; i < nerrnos; ++i) { + if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0)) + return i; + } + + return -1; +} + +static bool +parse_inject_token(const char *const token, struct inject_opts *const fopts, + const bool fault_tokens_only) +{ + const char *val; + int intval; + + if ((val = strip_prefix("when=", token))) { + /* + * == 1+1 + * F == F+0 + * F+ == F+1 + * F+S + */ + char *end; + intval = string_to_uint_ex(val, &end, 0xffff, "+"); + if (intval < 1) + return false; + + fopts->first = intval; + + if (*end) { + val = end + 1; + if (*val) { + /* F+S */ + intval = string_to_uint_upto(val, 0xffff); + if (intval < 1) + return false; + fopts->step = intval; + } else { + /* F+ == F+1 */ + fopts->step = 1; + } + } else { + /* F == F+0 */ + fopts->step = 0; + } + } else if ((val = strip_prefix("error=", token))) { + if (fopts->rval != INJECT_OPTS_RVAL_DEFAULT) + return false; + intval = string_to_uint_upto(val, MAX_ERRNO_VALUE); + if (intval < 0) + intval = find_errno_by_name(val); + if (intval < 1) + return false; + fopts->rval = -intval; + } else if (!fault_tokens_only && (val = strip_prefix("retval=", token))) { + if (fopts->rval != INJECT_OPTS_RVAL_DEFAULT) + return false; + intval = string_to_uint(val); + if (intval < 0) + return false; + fopts->rval = intval; + } else if (!fault_tokens_only && (val = strip_prefix("signal=", token))) { + intval = sigstr_to_uint(val); + if (intval < 1 || intval > NSIG_BYTES * 8) + return false; + fopts->signo = intval; + } else { + return false; + } + + return true; +} + +static char * +parse_inject_expression(const char *const s, char **buf, + struct inject_opts *const fopts, + const bool fault_tokens_only) +{ + char *saveptr = NULL; + char *name = NULL; + char *token; + + *buf = xstrdup(s); + for (token = strtok_r(*buf, ":", &saveptr); token; + token = strtok_r(NULL, ":", &saveptr)) { + if (!name) + name = token; + else if (!parse_inject_token(token, fopts, fault_tokens_only)) + goto parse_error; + } + + if (name) + return name; + +parse_error: + free(*buf); + return *buf = NULL; +} + +static void +qualify_read(const char *const str) +{ + qualify_tokens(str, &read_set, string_to_uint, "descriptor"); +} + +static void +qualify_write(const char *const str) +{ + qualify_tokens(str, &write_set, string_to_uint, "descriptor"); +} + +static void +qualify_signals(const char *const str) +{ + qualify_tokens(str, &signal_set, sigstr_to_uint, "signal"); +} + +static void +qualify_trace(const char *const str) +{ + qualify_syscall_tokens(str, trace_set, "system call"); +} + +static void +qualify_abbrev(const char *const str) +{ + qualify_syscall_tokens(str, abbrev_set, "system call"); +} + +static void +qualify_verbose(const char *const str) +{ + qualify_syscall_tokens(str, verbose_set, "system call"); +} + +static void +qualify_raw(const char *const str) +{ + qualify_syscall_tokens(str, raw_set, "system call"); +} + +static void +qualify_inject_common(const char *const str, + const bool fault_tokens_only, + const char *const description) +{ + struct inject_opts opts = { + .first = 1, + .step = 1, + .rval = INJECT_OPTS_RVAL_DEFAULT, + .signo = 0 + }; + char *buf = NULL; + char *name = parse_inject_expression(str, &buf, &opts, fault_tokens_only); + if (!name) { + error_msg_and_die("invalid %s '%s'", description, str); + } + + /* If neither of retval, error, or signal is specified, then ... */ + if (opts.rval == INJECT_OPTS_RVAL_DEFAULT && !opts.signo) { + if (fault_tokens_only) { + /* in fault= syntax the default error code is ENOSYS. */ + opts.rval = -ENOSYS; + } else { + /* in inject= syntax this is not allowed. */ + error_msg_and_die("invalid %s '%s'", description, str); + } + } + + struct number_set tmp_set[SUPPORTED_PERSONALITIES]; + memset(tmp_set, 0, sizeof(tmp_set)); + qualify_syscall_tokens(name, tmp_set, description); + + free(buf); + + /* + * Initialize inject_vec accourding to tmp_set. + * Merge tmp_set into inject_set. + */ + unsigned int p; + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + if (!tmp_set[p].nslots && !tmp_set[p].not) { + continue; + } + + if (!inject_vec[p]) { + inject_vec[p] = xcalloc(nsyscall_vec[p], + sizeof(*inject_vec[p])); + } + + unsigned int i; + for (i = 0; i < nsyscall_vec[p]; ++i) { + if (is_number_in_set(i, &tmp_set[p])) { + add_number_to_set(i, &inject_set[p]); + inject_vec[p][i] = opts; + } + } + + free(tmp_set[p].vec); + } +} + +static void +qualify_fault(const char *const str) +{ + qualify_inject_common(str, true, "fault argument"); +} + +static void +qualify_inject(const char *const str) +{ + qualify_inject_common(str, false, "inject argument"); +} + +static const struct qual_options { + const char *name; + void (*qualify)(const char *); +} qual_options[] = { + { "trace", qualify_trace }, + { "t", qualify_trace }, + { "abbrev", qualify_abbrev }, + { "a", qualify_abbrev }, + { "verbose", qualify_verbose }, + { "v", qualify_verbose }, + { "raw", qualify_raw }, + { "x", qualify_raw }, + { "signal", qualify_signals }, + { "signals", qualify_signals }, + { "s", qualify_signals }, + { "read", qualify_read }, + { "reads", qualify_read }, + { "r", qualify_read }, + { "write", qualify_write }, + { "writes", qualify_write }, + { "w", qualify_write }, + { "fault", qualify_fault }, + { "inject", qualify_inject }, +}; + +void +qualify(const char *str) +{ + const struct qual_options *opt = qual_options; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(qual_options); ++i) { + const char *p = qual_options[i].name; + unsigned int len = strlen(p); + + if (strncmp(str, p, len) || str[len] != '=') + continue; + + opt = &qual_options[i]; + str += len + 1; + break; + } + + opt->qualify(str); +} + +unsigned int +qual_flags(const unsigned int scno) +{ + return (is_number_in_set(scno, &trace_set[current_personality]) + ? QUAL_TRACE : 0) + | (is_number_in_set(scno, &abbrev_set[current_personality]) + ? QUAL_ABBREV : 0) + | (is_number_in_set(scno, &verbose_set[current_personality]) + ? QUAL_VERBOSE : 0) + | (is_number_in_set(scno, &raw_set[current_personality]) + ? QUAL_RAW : 0) + | (is_number_in_set(scno, &inject_set[current_personality]) + ? QUAL_INJECT : 0); +} diff --git a/quota.c b/quota.c index f9a1bc57..19f391f7 100644 --- a/quota.c +++ b/quota.c @@ -3,7 +3,7 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman - * Copyright (c) 2005, 2006 Dmitry V. Levin + * Copyright (c) 2005-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,499 +33,430 @@ #define SUBCMDMASK 0x00ff #define SUBCMDSHIFT 8 -#define QCMD_CMD(cmd) ((u_int32_t)(cmd) >> SUBCMDSHIFT) -#define QCMD_TYPE(cmd) ((u_int32_t)(cmd) & SUBCMDMASK) - -#define OLD_CMD(cmd) ((u_int32_t)(cmd) << 8) -#define NEW_CMD(cmd) ((u_int32_t)(cmd) | 0x800000) -#define XQM_CMD(cmd) ((u_int32_t)(cmd) | ('X'<<8)) - -#define Q_V1_QUOTAON OLD_CMD(0x1) -#define Q_V1_QUOTAOFF OLD_CMD(0x2) -#define Q_V1_GETQUOTA OLD_CMD(0x3) -#define Q_V1_SETQUOTA OLD_CMD(0x4) -#define Q_V1_SETUSE OLD_CMD(0x5) -#define Q_V1_SYNC OLD_CMD(0x6) -#define Q_SETQLIM OLD_CMD(0x7) -#define Q_V1_GETSTATS OLD_CMD(0x8) -#define Q_V1_RSQUASH OLD_CMD(0x10) - -#define Q_V2_GETQUOTA OLD_CMD(0xD) -#define Q_V2_SETQUOTA OLD_CMD(0xE) -#define Q_V2_SETUSE OLD_CMD(0xF) -#define Q_V2_GETINFO OLD_CMD(0x9) -#define Q_V2_SETINFO OLD_CMD(0xA) -#define Q_V2_SETGRACE OLD_CMD(0xB) -#define Q_V2_SETFLAGS OLD_CMD(0xC) -#define Q_V2_GETSTATS OLD_CMD(0x11) - -#define Q_SYNC NEW_CMD(0x1) -#define Q_QUOTAON NEW_CMD(0x2) -#define Q_QUOTAOFF NEW_CMD(0x3) -#define Q_GETFMT NEW_CMD(0x4) -#define Q_GETINFO NEW_CMD(0x5) -#define Q_SETINFO NEW_CMD(0x6) -#define Q_GETQUOTA NEW_CMD(0x7) -#define Q_SETQUOTA NEW_CMD(0x8) - -#define Q_XQUOTAON XQM_CMD(0x1) -#define Q_XQUOTAOFF XQM_CMD(0x2) -#define Q_XGETQUOTA XQM_CMD(0x3) -#define Q_XSETQLIM XQM_CMD(0x4) -#define Q_XGETQSTAT XQM_CMD(0x5) -#define Q_XQUOTARM XQM_CMD(0x6) -#define Q_XQUOTASYNC XQM_CMD(0x7) +#define QCMD_CMD(cmd) ((uint32_t)(cmd) >> SUBCMDSHIFT) +#define QCMD_TYPE(cmd) ((uint32_t)(cmd) & SUBCMDMASK) -#include "xlat/quotacmds.h" - -#define USRQUOTA 0 -#define GRPQUOTA 1 +#define OLD_CMD(cmd) ((uint32_t)(cmd) << SUBCMDSHIFT) +#define NEW_CMD(cmd) ((uint32_t)(cmd) | 0x800000) +#define XQM_CMD(cmd) ((uint32_t)(cmd) | ('X' << SUBCMDSHIFT)) +#include "xlat/quotacmds.h" #include "xlat/quotatypes.h" - -/* Quota format identifiers */ -#define QFMT_VFS_OLD 1 -#define QFMT_VFS_V0 2 - #include "xlat/quota_formats.h" - -#define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */ -#define XFS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */ -#define XFS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */ -#define XFS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */ - -#define XFS_USER_QUOTA (1<<0) /* user quota type */ -#define XFS_PROJ_QUOTA (1<<1) /* (IRIX) project quota type */ -#define XFS_GROUP_QUOTA (1<<2) /* group quota type */ - #include "xlat/xfs_quota_flags.h" #include "xlat/xfs_dqblk_flags.h" +#include "xlat/if_dqblk_valid.h" +#include "xlat/if_dqinfo_flags.h" +#include "xlat/if_dqinfo_valid.h" /* - * Following flags are used to specify which fields are valid + * We add attribute packed due to the fact that the structure is 8-byte aligned + * on 64-bit systems and therefore has additional 4 bytes of padding, which + * leads to problems when it is used on 32-bit tracee which does not have such + * padding. */ -#define QIF_BLIMITS 1 -#define QIF_SPACE 2 -#define QIF_ILIMITS 4 -#define QIF_INODES 8 -#define QIF_BTIME 16 -#define QIF_ITIME 32 - -#include "xlat/if_dqblk_valid.h" - struct if_dqblk { - u_int64_t dqb_bhardlimit; - u_int64_t dqb_bsoftlimit; - u_int64_t dqb_curspace; - u_int64_t dqb_ihardlimit; - u_int64_t dqb_isoftlimit; - u_int64_t dqb_curinodes; - u_int64_t dqb_btime; - u_int64_t dqb_itime; - u_int32_t dqb_valid; -}; - -struct v1_dqblk -{ - u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ - u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */ - u_int32_t dqb_curblocks; /* current block count */ - u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */ - u_int32_t dqb_isoftlimit; /* preferred inode limit */ - u_int32_t dqb_curinodes; /* current # allocated inodes */ - time_t dqb_btime; /* time limit for excessive disk use */ - time_t dqb_itime; /* time limit for excessive files */ -}; - -struct v2_dqblk -{ - unsigned int dqb_ihardlimit; - unsigned int dqb_isoftlimit; - unsigned int dqb_curinodes; - unsigned int dqb_bhardlimit; - unsigned int dqb_bsoftlimit; - u_int64_t dqb_curspace; - time_t dqb_btime; - time_t dqb_itime; + uint64_t dqb_bhardlimit; + uint64_t dqb_bsoftlimit; + uint64_t dqb_curspace; + uint64_t dqb_ihardlimit; + uint64_t dqb_isoftlimit; + uint64_t dqb_curinodes; + uint64_t dqb_btime; + uint64_t dqb_itime; + uint32_t dqb_valid; +} ATTRIBUTE_PACKED; + +struct if_nextdqblk { + uint64_t dqb_bhardlimit; + uint64_t dqb_bsoftlimit; + uint64_t dqb_curspace; + uint64_t dqb_ihardlimit; + uint64_t dqb_isoftlimit; + uint64_t dqb_curinodes; + uint64_t dqb_btime; + uint64_t dqb_itime; + uint32_t dqb_valid; + uint32_t dqb_id; }; struct xfs_dqblk { - int8_t d_version; /* version of this structure */ - int8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */ - u_int16_t d_fieldmask; /* field specifier */ - u_int32_t d_id; /* user, project, or group ID */ - u_int64_t d_blk_hardlimit; /* absolute limit on disk blks */ - u_int64_t d_blk_softlimit; /* preferred limit on disk blks */ - u_int64_t d_ino_hardlimit; /* maximum # allocated inodes */ - u_int64_t d_ino_softlimit; /* preferred inode limit */ - u_int64_t d_bcount; /* # disk blocks owned by the user */ - u_int64_t d_icount; /* # inodes owned by the user */ - int32_t d_itimer; /* zero if within inode limits */ - int32_t d_btimer; /* similar to above; for disk blocks */ - u_int16_t d_iwarns; /* # warnings issued wrt num inodes */ - u_int16_t d_bwarns; /* # warnings issued wrt disk blocks */ - int32_t d_padding2; /* padding2 - for future use */ - u_int64_t d_rtb_hardlimit; /* absolute limit on realtime blks */ - u_int64_t d_rtb_softlimit; /* preferred limit on RT disk blks */ - u_int64_t d_rtbcount; /* # realtime blocks owned */ - int32_t d_rtbtimer; /* similar to above; for RT disk blks */ - u_int16_t d_rtbwarns; /* # warnings issued wrt RT disk blks */ - int16_t d_padding3; /* padding3 - for future use */ - char d_padding4[8]; /* yet more padding */ + int8_t d_version; /* version of this structure */ + int8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */ + uint16_t d_fieldmask; /* field specifier */ + uint32_t d_id; /* user, project, or group ID */ + uint64_t d_blk_hardlimit; /* absolute limit on disk blks */ + uint64_t d_blk_softlimit; /* preferred limit on disk blks */ + uint64_t d_ino_hardlimit; /* maximum # allocated inodes */ + uint64_t d_ino_softlimit; /* preferred inode limit */ + uint64_t d_bcount; /* # disk blocks owned by the user */ + uint64_t d_icount; /* # inodes owned by the user */ + int32_t d_itimer; /* zero if within inode limits */ + int32_t d_btimer; /* similar to above; for disk blocks */ + uint16_t d_iwarns; /* # warnings issued wrt num inodes */ + uint16_t d_bwarns; /* # warnings issued wrt disk blocks */ + int32_t d_padding2; /* padding2 - for future use */ + uint64_t d_rtb_hardlimit; /* absolute limit on realtime blks */ + uint64_t d_rtb_softlimit; /* preferred limit on RT disk blks */ + uint64_t d_rtbcount; /* # realtime blocks owned */ + int32_t d_rtbtimer; /* similar to above; for RT disk blks */ + uint16_t d_rtbwarns; /* # warnings issued wrt RT disk blks */ + int16_t d_padding3; /* padding3 - for future use */ + char d_padding4[8]; /* yet more padding */ }; -/* - * Following flags are used to specify which fields are valid - */ -#define IIF_BGRACE 1 -#define IIF_IGRACE 2 -#define IIF_FLAGS 4 - -#include "xlat/if_dqinfo_valid.h" - struct if_dqinfo { - u_int64_t dqi_bgrace; - u_int64_t dqi_igrace; - u_int32_t dqi_flags; - u_int32_t dqi_valid; -}; - -struct v2_dqinfo -{ - unsigned int dqi_bgrace; - unsigned int dqi_igrace; - unsigned int dqi_flags; - unsigned int dqi_blocks; - unsigned int dqi_free_blk; - unsigned int dqi_free_entry; -}; - -struct v1_dqstats -{ - u_int32_t lookups; - u_int32_t drops; - u_int32_t reads; - u_int32_t writes; - u_int32_t cache_hits; - u_int32_t allocated_dquots; - u_int32_t free_dquots; - u_int32_t syncs; -}; - -struct v2_dqstats -{ - u_int32_t lookups; - u_int32_t drops; - u_int32_t reads; - u_int32_t writes; - u_int32_t cache_hits; - u_int32_t allocated_dquots; - u_int32_t free_dquots; - u_int32_t syncs; - u_int32_t version; + uint64_t dqi_bgrace; + uint64_t dqi_igrace; + uint32_t dqi_flags; + uint32_t dqi_valid; }; typedef struct fs_qfilestat { - u_int64_t qfs_ino; /* inode number */ - u_int64_t qfs_nblks; /* number of BBs 512-byte-blks */ - u_int32_t qfs_nextents; /* number of extents */ + uint64_t qfs_ino; /* inode number */ + uint64_t qfs_nblks; /* number of BBs 512-byte-blks */ + uint32_t qfs_nextents; /* number of extents */ } fs_qfilestat_t; struct xfs_dqstats { - int8_t qs_version; /* version number for future changes */ - u_int16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */ - int8_t qs_pad; /* unused */ + int8_t qs_version; /* version number for future changes */ + uint16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */ + int8_t qs_pad; /* unused */ fs_qfilestat_t qs_uquota; /* user quota storage information */ fs_qfilestat_t qs_gquota; /* group quota storage information */ - u_int32_t qs_incoredqs; /* number of dquots incore */ - int32_t qs_btimelimit; /* limit for blks timer */ - int32_t qs_itimelimit; /* limit for inodes timer */ + uint32_t qs_incoredqs; /* number of dquots incore */ + int32_t qs_btimelimit; /* limit for blks timer */ + int32_t qs_itimelimit; /* limit for inodes timer */ int32_t qs_rtbtimelimit; /* limit for rt blks timer */ - u_int16_t qs_bwarnlimit; /* limit for num warnings */ - u_int16_t qs_iwarnlimit; /* limit for num warnings */ + uint16_t qs_bwarnlimit; /* limit for num warnings */ + uint16_t qs_iwarnlimit; /* limit for num warnings */ +}; + +struct fs_qfilestatv { + uint64_t qfs_ino, qfs_nblks; + uint32_t qfs_nextents, qfs_pad; }; -static void -decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data) +struct fs_quota_statv { + int8_t qs_version; + uint8_t qs_pad1; + uint16_t qs_flags; + uint32_t qs_incoredqs; + struct fs_qfilestatv qs_uquota; + struct fs_qfilestatv qs_gquota; + struct fs_qfilestatv qs_pquota; + int32_t qs_btimelimit; + int32_t qs_itimelimit; + int32_t qs_rtbtimelimit; + uint16_t qs_bwarnlimit; + uint16_t qs_iwarnlimit; + uint64_t qs_pad2[8]; +}; + +#define PRINT_FIELD_D(prefix, where, field) \ + tprintf("%s%s=%lld", (prefix), #field, \ + sign_extend_unsigned_to_ll((where).field)) + +#define PRINT_FIELD_U(prefix, where, field) \ + tprintf("%s%s=%llu", (prefix), #field, \ + zero_extend_signed_to_ull((where).field)) + +#define PRINT_FIELD_X(prefix, where, field) \ + tprintf("%s%s=%#llx", (prefix), #field, \ + zero_extend_signed_to_ull((where).field)) + +static int +decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) { switch (cmd) { - case Q_GETQUOTA: - case Q_SETQUOTA: - { - struct if_dqblk dq; - - if (cmd == Q_GETQUOTA && syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{bhardlimit=%" PRIu64 ", ", dq.dqb_bhardlimit); - tprintf("bsoftlimit=%" PRIu64 ", ", dq.dqb_bsoftlimit); - tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace); - tprintf("ihardlimit=%" PRIu64 ", ", dq.dqb_ihardlimit); - tprintf("isoftlimit=%" PRIu64 ", ", dq.dqb_isoftlimit); - tprintf("curinodes=%" PRIu64 ", ", dq.dqb_curinodes); - if (!abbrev(tcp)) { - tprintf("btime=%" PRIu64 ", ", dq.dqb_btime); - tprintf("itime=%" PRIu64 ", ", dq.dqb_itime); - tprints("valid="); - printflags(if_dqblk_valid, - dq.dqb_valid, "QIF_???"); - tprints("}"); - } else - tprints("...}"); - break; + case Q_QUOTAOFF: + case Q_SYNC: + case Q_XQUOTASYNC: + break; + case Q_QUOTAON: + tprints(", "); + printxval(quota_formats, id, "QFMT_VFS_???"); + tprints(", "); + printpath(tcp, data); + break; + case Q_GETQUOTA: + if (entering(tcp)) { + printuid(", ", id); + tprints(", "); + + return 0; } - case Q_V1_GETQUOTA: - case Q_V1_SETQUOTA: - { - struct v1_dqblk dq; - - if (cmd == Q_V1_GETQUOTA && syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{bhardlimit=%u, ", dq.dqb_bhardlimit); - tprintf("bsoftlimit=%u, ", dq.dqb_bsoftlimit); - tprintf("curblocks=%u, ", dq.dqb_curblocks); - tprintf("ihardlimit=%u, ", dq.dqb_ihardlimit); - tprintf("isoftlimit=%u, ", dq.dqb_isoftlimit); - tprintf("curinodes=%u, ", dq.dqb_curinodes); - tprintf("btime=%lu, ", (long) dq.dqb_btime); - tprintf("itime=%lu}", (long) dq.dqb_itime); - break; + + /* Fall-through */ + case Q_SETQUOTA: + { + struct if_dqblk dq; + + if (entering(tcp)) { + printuid(", ", id); + tprints(", "); } - case Q_V2_GETQUOTA: - case Q_V2_SETQUOTA: - { - struct v2_dqblk dq; - - if (cmd == Q_V2_GETQUOTA && syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{ihardlimit=%u, ", dq.dqb_ihardlimit); - tprintf("isoftlimit=%u, ", dq.dqb_isoftlimit); - tprintf("curinodes=%u, ", dq.dqb_curinodes); - tprintf("bhardlimit=%u, ", dq.dqb_bhardlimit); - tprintf("bsoftlimit=%u, ", dq.dqb_bsoftlimit); - tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace); - tprintf("btime=%lu, ", (long) dq.dqb_btime); - tprintf("itime=%lu}", (long) dq.dqb_itime); + + if (umove_or_printaddr(tcp, data, &dq)) break; + PRINT_FIELD_U("{", dq, dqb_bhardlimit); + PRINT_FIELD_U(", ", dq, dqb_bsoftlimit); + PRINT_FIELD_U(", ", dq, dqb_curspace); + PRINT_FIELD_U(", ", dq, dqb_ihardlimit); + PRINT_FIELD_U(", ", dq, dqb_isoftlimit); + PRINT_FIELD_U(", ", dq, dqb_curinodes); + if (!abbrev(tcp)) { + PRINT_FIELD_U(", ", dq, dqb_btime); + PRINT_FIELD_U(", ", dq, dqb_itime); + tprints(", dqb_valid="); + printflags(if_dqblk_valid, + dq.dqb_valid, "QIF_???"); + } else { + tprints(", ..."); } - case Q_XGETQUOTA: - case Q_XSETQLIM: - { - struct xfs_dqblk dq; - - if (cmd == Q_XGETQUOTA && syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{version=%d, ", dq.d_version); - tprints("flags="); - printflags(xfs_dqblk_flags, - dq.d_flags, "XFS_???_QUOTA"); - tprintf(", fieldmask=%#x, ", dq.d_fieldmask); - tprintf("id=%u, ", dq.d_id); - tprintf("blk_hardlimit=%" PRIu64 ", ", dq.d_blk_hardlimit); - tprintf("blk_softlimit=%" PRIu64 ", ", dq.d_blk_softlimit); - tprintf("ino_hardlimit=%" PRIu64 ", ", dq.d_ino_hardlimit); - tprintf("ino_softlimit=%" PRIu64 ", ", dq.d_ino_softlimit); - tprintf("bcount=%" PRIu64 ", ", dq.d_bcount); - tprintf("icount=%" PRIu64 ", ", dq.d_icount); - if (!abbrev(tcp)) { - tprintf("itimer=%d, ", dq.d_itimer); - tprintf("btimer=%d, ", dq.d_btimer); - tprintf("iwarns=%u, ", dq.d_iwarns); - tprintf("bwarns=%u, ", dq.d_bwarns); - tprintf("rtbcount=%" PRIu64 ", ", dq.d_rtbcount); - tprintf("rtbtimer=%d, ", dq.d_rtbtimer); - tprintf("rtbwarns=%u}", dq.d_rtbwarns); - } else - tprints("...}"); - break; + tprints("}"); + break; + } + case Q_GETNEXTQUOTA: + { + struct if_nextdqblk dq; + + if (entering(tcp)) { + printuid(", ", id); + tprints(", "); + + return 0; } - case Q_GETFMT: - { - u_int32_t fmt; - - if (syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &fmt) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprints("{"); - printxval(quota_formats, fmt, "QFMT_VFS_???"); - tprints("}"); + + if (umove_or_printaddr(tcp, data, &dq)) break; + PRINT_FIELD_U("{", dq, dqb_bhardlimit); + PRINT_FIELD_U(", ", dq, dqb_bsoftlimit); + PRINT_FIELD_U(", ", dq, dqb_curspace); + PRINT_FIELD_U(", ", dq, dqb_ihardlimit); + PRINT_FIELD_U(", ", dq, dqb_isoftlimit); + PRINT_FIELD_U(", ", dq, dqb_curinodes); + if (!abbrev(tcp)) { + PRINT_FIELD_U(", ", dq, dqb_btime); + PRINT_FIELD_U(", ", dq, dqb_itime); + tprints(", dqb_valid="); + printflags(if_dqblk_valid, + dq.dqb_valid, "QIF_???"); + PRINT_FIELD_U(", ", dq, dqb_id); + } else { + PRINT_FIELD_U(", ", dq, dqb_id); + tprints(", ..."); } - case Q_GETINFO: - case Q_SETINFO: - { - struct if_dqinfo dq; - - if (cmd == Q_GETINFO && syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{bgrace=%" PRIu64 ", ", dq.dqi_bgrace); - tprintf("igrace=%" PRIu64 ", ", dq.dqi_igrace); - tprintf("flags=%#x, ", dq.dqi_flags); - tprints("valid="); - printflags(if_dqinfo_valid, dq.dqi_valid, "IIF_???"); - tprints("}"); - break; + tprints("}"); + break; + } + case Q_XGETQUOTA: + case Q_XGETNEXTQUOTA: + if (entering(tcp)) { + printuid(", ", id); + tprints(", "); + + return 0; } - case Q_V2_GETINFO: - case Q_V2_SETINFO: - { - struct v2_dqinfo dq; - - if (cmd == Q_V2_GETINFO && syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{bgrace=%u, ", dq.dqi_bgrace); - tprintf("igrace=%u, ", dq.dqi_igrace); - tprintf("flags=%#x, ", dq.dqi_flags); - tprintf("blocks=%u, ", dq.dqi_blocks); - tprintf("free_blk=%u, ", dq.dqi_free_blk); - tprintf("free_entry=%u}", dq.dqi_free_entry); + + /* Fall-through */ + case Q_XSETQLIM: + { + struct xfs_dqblk dq; + + if (entering(tcp)) { + printuid(", ", id); + tprints(", "); + } + + if (umove_or_printaddr(tcp, data, &dq)) break; + PRINT_FIELD_D("{", dq, d_version); + tprints(", d_flags="); + printflags(xfs_dqblk_flags, + (uint8_t) dq.d_flags, "XFS_???_QUOTA"); + PRINT_FIELD_X(", ", dq, d_fieldmask); + PRINT_FIELD_U(", ", dq, d_id); + PRINT_FIELD_U(", ", dq, d_blk_hardlimit); + PRINT_FIELD_U(", ", dq, d_blk_softlimit); + PRINT_FIELD_U(", ", dq, d_ino_hardlimit); + PRINT_FIELD_U(", ", dq, d_ino_softlimit); + PRINT_FIELD_U(", ", dq, d_bcount); + PRINT_FIELD_U(", ", dq, d_icount); + if (!abbrev(tcp)) { + PRINT_FIELD_D(", ", dq, d_itimer); + PRINT_FIELD_D(", ", dq, d_btimer); + PRINT_FIELD_U(", ", dq, d_iwarns); + PRINT_FIELD_U(", ", dq, d_bwarns); + PRINT_FIELD_U(", ", dq, d_rtb_hardlimit); + PRINT_FIELD_U(", ", dq, d_rtb_softlimit); + PRINT_FIELD_U(", ", dq, d_rtbcount); + PRINT_FIELD_D(", ", dq, d_rtbtimer); + PRINT_FIELD_U(", ", dq, d_rtbwarns); + } else { + tprints(", ..."); + } + tprints("}"); + break; + } + case Q_GETFMT: + { + uint32_t fmt; + + if (entering(tcp)) { + tprints(", "); + + return 0; } - case Q_V1_GETSTATS: - { - struct v1_dqstats dq; - - if (syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{lookups=%u, ", dq.lookups); - tprintf("drops=%u, ", dq.drops); - tprintf("reads=%u, ", dq.reads); - tprintf("writes=%u, ", dq.writes); - tprintf("cache_hits=%u, ", dq.cache_hits); - tprintf("allocated_dquots=%u, ", dq.allocated_dquots); - tprintf("free_dquots=%u, ", dq.free_dquots); - tprintf("syncs=%u}", dq.syncs); + + if (umove_or_printaddr(tcp, data, &fmt)) break; + tprints("["); + printxval(quota_formats, fmt, "QFMT_VFS_???"); + tprints("]"); + break; + } + case Q_GETINFO: + if (entering(tcp)) { + tprints(", "); + + return 0; } - case Q_V2_GETSTATS: - { - struct v2_dqstats dq; - - if (syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{lookups=%u, ", dq.lookups); - tprintf("drops=%u, ", dq.drops); - tprintf("reads=%u, ", dq.reads); - tprintf("writes=%u, ", dq.writes); - tprintf("cache_hits=%u, ", dq.cache_hits); - tprintf("allocated_dquots=%u, ", dq.allocated_dquots); - tprintf("free_dquots=%u, ", dq.free_dquots); - tprintf("syncs=%u, ", dq.syncs); - tprintf("version=%u}", dq.version); + + /* Fall-through */ + case Q_SETINFO: + { + struct if_dqinfo dq; + + if (entering(tcp)) + tprints(", "); + + if (umove_or_printaddr(tcp, data, &dq)) break; + PRINT_FIELD_U("{", dq, dqi_bgrace); + PRINT_FIELD_U(", ", dq, dqi_igrace); + tprints(", dqi_flags="); + printflags(if_dqinfo_flags, dq.dqi_flags, "DQF_???"); + tprints(", dqi_valid="); + printflags(if_dqinfo_valid, dq.dqi_valid, "IIF_???"); + tprints("}"); + break; + } + case Q_XGETQSTAT: + { + struct xfs_dqstats dq; + + if (entering(tcp)) { + tprints(", "); + + return 0; } - case Q_XGETQSTAT: - { - struct xfs_dqstats dq; - - if (syserror(tcp)) { - tprintf("%#lx", data); - break; - } - if (umove(tcp, data, &dq) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprintf("{version=%d, ", dq.qs_version); - if (abbrev(tcp)) { - tprints("...}"); - break; - } - tprints("flags="); + + if (umove_or_printaddr(tcp, data, &dq)) + break; + PRINT_FIELD_D("{", dq, qs_version); + if (!abbrev(tcp)) { + tprints(", qs_flags="); printflags(xfs_quota_flags, dq.qs_flags, "XFS_QUOTA_???"); - tprintf(", incoredqs=%u, ", dq.qs_incoredqs); - tprintf("u_ino=%" PRIu64 ", ", dq.qs_uquota.qfs_ino); - tprintf("u_nblks=%" PRIu64 ", ", dq.qs_uquota.qfs_nblks); - tprintf("u_nextents=%u, ", dq.qs_uquota.qfs_nextents); - tprintf("g_ino=%" PRIu64 ", ", dq.qs_gquota.qfs_ino); - tprintf("g_nblks=%" PRIu64 ", ", dq.qs_gquota.qfs_nblks); - tprintf("g_nextents=%u, ", dq.qs_gquota.qfs_nextents); - tprintf("btimelimit=%d, ", dq.qs_btimelimit); - tprintf("itimelimit=%d, ", dq.qs_itimelimit); - tprintf("rtbtimelimit=%d, ", dq.qs_rtbtimelimit); - tprintf("bwarnlimit=%u, ", dq.qs_bwarnlimit); - tprintf("iwarnlimit=%u}", dq.qs_iwarnlimit); - break; + PRINT_FIELD_U(", ", dq, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", dq.qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", dq.qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nextents); + PRINT_FIELD_D("}, ", dq, qs_btimelimit); + PRINT_FIELD_D(", ", dq, qs_itimelimit); + PRINT_FIELD_D(", ", dq, qs_rtbtimelimit); + PRINT_FIELD_U(", ", dq, qs_bwarnlimit); + PRINT_FIELD_U(", ", dq, qs_iwarnlimit); + } else { + tprints(", ..."); } - case Q_XQUOTAON: - { - u_int32_t flag; - - if (umove(tcp, data, &flag) < 0) { - tprintf("{???} %#lx", data); - break; - } - tprints("{"); - printflags(xfs_quota_flags, flag, "XFS_QUOTA_???"); - tprints("}"); + tprints("}"); + break; + } + case Q_XGETQSTATV: + { + struct fs_quota_statv dq; + + if (entering(tcp)) { + tprints(", "); + + return 0; + } + + if (umove_or_printaddr(tcp, data, &dq)) break; + PRINT_FIELD_D("{", dq, qs_version); + if (!abbrev(tcp)) { + tprints(", qs_flags="); + printflags(xfs_quota_flags, + dq.qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", ", dq, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", dq.qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", dq.qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, qs_pquota={", dq.qs_pquota, qfs_ino); + PRINT_FIELD_U(", ", dq.qs_pquota, qfs_nblks); + PRINT_FIELD_U(", ", dq.qs_pquota, qfs_nextents); + PRINT_FIELD_D("}, ", dq, qs_btimelimit); + PRINT_FIELD_D(", ", dq, qs_itimelimit); + PRINT_FIELD_D(", ", dq, qs_rtbtimelimit); + PRINT_FIELD_U(", ", dq, qs_bwarnlimit); + PRINT_FIELD_U(", ", dq, qs_iwarnlimit); + } else { + tprints(", ..."); } - default: - tprintf("%#lx", data); + tprints("}"); + break; + } + case Q_XQUOTAON: + case Q_XQUOTAOFF: + { + uint32_t flag; + + tprints(", "); + + if (umove_or_printaddr(tcp, data, &flag)) + break; + tprints("["); + printflags(xfs_quota_flags, flag, "XFS_QUOTA_???"); + tprints("]"); + break; + } + case Q_XQUOTARM: + { + uint32_t flag; + + tprints(", "); + + if (umove_or_printaddr(tcp, data, &flag)) break; + tprints("["); + printflags(xfs_dqblk_flags, flag, "XFS_???_QUOTA"); + tprints("]"); + break; + } + default: + printuid(", ", id); + tprints(", "); + printaddr(data); + break; } + return RVAL_DECODED; } -int -sys_quotactl(struct tcb *tcp) +SYS_FUNC(quotactl) { /* * The Linux kernel only looks at the low 32 bits of command and id @@ -533,49 +464,18 @@ sys_quotactl(struct tcb *tcp) * will have been sign-extended when we see it. The high 1 bits * don't mean anything, so don't confuse the output with them. */ - u_int32_t qcmd = tcp->u_arg[0]; - u_int32_t cmd = QCMD_CMD(qcmd); - u_int32_t type = QCMD_TYPE(qcmd); - u_int32_t id = tcp->u_arg[2]; - - if (!verbose(tcp)) - return printargs(tcp); + uint32_t qcmd = tcp->u_arg[0]; + uint32_t cmd = QCMD_CMD(qcmd); + uint32_t type = QCMD_TYPE(qcmd); + uint32_t id = tcp->u_arg[2]; if (entering(tcp)) { + tprints("QCMD("); printxval(quotacmds, cmd, "Q_???"); - tprints("|"); - printxval(quotatypes, type, "???QUOTA"); tprints(", "); + printxval(quotatypes, type, "???QUOTA"); + tprints("), "); printpath(tcp, tcp->u_arg[1]); - tprints(", "); - switch (cmd) { - case Q_V1_QUOTAON: - case Q_QUOTAON: - printxval(quota_formats, id, "QFMT_VFS_???"); - break; - case Q_V1_GETQUOTA: - case Q_V2_GETQUOTA: - case Q_GETQUOTA: - case Q_V1_SETQUOTA: - case Q_V2_SETQUOTA: - case Q_V1_SETUSE: - case Q_V2_SETUSE: - case Q_SETQLIM: - case Q_SETQUOTA: - case Q_XGETQUOTA: - case Q_XSETQLIM: - tprintf("%u", id); - break; - default: - tprintf("%#lx", tcp->u_arg[2]); - break; - } - tprints(", "); - } else { - if (!tcp->u_arg[3]) - tprints("NULL"); - else - decode_cmd_data(tcp, cmd, tcp->u_arg[3]); } - return 0; + return decode_cmd_data(tcp, id, cmd, tcp->u_arg[3]); } diff --git a/readahead.c b/readahead.c new file mode 100644 index 00000000..d6caac33 --- /dev/null +++ b/readahead.c @@ -0,0 +1,12 @@ +#include "defs.h" + +SYS_FUNC(readahead) +{ + int argn; + + printfd(tcp, tcp->u_arg[0]); + argn = printllval(tcp, ", %lld", 1); + tprintf(", %" PRI_klu, tcp->u_arg[argn]); + + return RVAL_DECODED; +} diff --git a/readlink.c b/readlink.c new file mode 100644 index 00000000..fd65b253 --- /dev/null +++ b/readlink.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2006 Ulrich Drepper + * Copyright (c) 2006 Bernhard Kaindl + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +static int +decode_readlink(struct tcb *tcp, int offset) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[offset]); + tprints(", "); + } else { + if (syserror(tcp)) + printaddr(tcp->u_arg[offset + 1]); + else + /* Used to use printpathn(), but readlink + * neither includes NUL in the returned count, + * nor actually writes it into memory. + * printpathn() would decide on printing + * "..." continuation based on garbage + * past return buffer's end. + */ + printstrn(tcp, tcp->u_arg[offset + 1], tcp->u_rval); + tprintf(", %" PRI_klu, tcp->u_arg[offset + 2]); + } + return 0; +} + +SYS_FUNC(readlink) +{ + return decode_readlink(tcp, 0); +} + +SYS_FUNC(readlinkat) +{ + if (entering(tcp)) + print_dirfd(tcp, tcp->u_arg[0]); + return decode_readlink(tcp, 1); +} diff --git a/reboot.c b/reboot.c index 397a1269..381e4e89 100644 --- a/reboot.c +++ b/reboot.c @@ -1,24 +1,23 @@ #include "defs.h" -#include #include "xlat/bootflags1.h" #include "xlat/bootflags2.h" #include "xlat/bootflags3.h" -int -sys_reboot(struct tcb *tcp) +SYS_FUNC(reboot) { - if (exiting(tcp)) - return 0; + const unsigned int magic1 = tcp->u_arg[0]; + const unsigned int magic2 = tcp->u_arg[1]; + const unsigned int cmd = tcp->u_arg[2]; - printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???"); + printflags(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???"); tprints(", "); - printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???"); + printflags(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???"); tprints(", "); - printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???"); - if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) { + printflags(bootflags3, cmd, "LINUX_REBOOT_CMD_???"); + if (cmd == LINUX_REBOOT_CMD_RESTART2) { tprints(", "); - printstr(tcp, tcp->u_arg[3], -1); + printstr(tcp, tcp->u_arg[3]); } - return 0; + return RVAL_DECODED; } diff --git a/regs.h b/regs.h new file mode 100644 index 00000000..d89581d7 --- /dev/null +++ b/regs.h @@ -0,0 +1,12 @@ +#ifndef STRACE_REGS_H +#define STRACE_REGS_H + +#include + +#ifdef HAVE_SYS_REG_H +# include +#endif + +#include "arch_regs.h" + +#endif /* !STRACE_REGS_H */ diff --git a/renameat.c b/renameat.c new file mode 100644 index 00000000..746e9c4a --- /dev/null +++ b/renameat.c @@ -0,0 +1,30 @@ +#include "defs.h" + +static void +decode_renameat(struct tcb *tcp) +{ + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + print_dirfd(tcp, tcp->u_arg[2]); + printpath(tcp, tcp->u_arg[3]); +} + +SYS_FUNC(renameat) +{ + decode_renameat(tcp); + + return RVAL_DECODED; +} + +#include +#include "xlat/rename_flags.h" + +SYS_FUNC(renameat2) +{ + decode_renameat(tcp); + tprints(", "); + printflags(rename_flags, tcp->u_arg[4], "RENAME_??"); + + return RVAL_DECODED; +} diff --git a/resource.c b/resource.c index 12e218f2..61c877e4 100644 --- a/resource.c +++ b/resource.c @@ -30,8 +30,6 @@ #include "defs.h" #include -#include -#include #include "xlat/resources.h" @@ -51,33 +49,19 @@ sprint_rlim64(uint64_t lim) } static void -print_rlimit64(struct tcb *tcp, unsigned long addr) +print_rlimit64(struct tcb *const tcp, const kernel_ulong_t addr) { struct rlimit_64 { uint64_t rlim_cur; uint64_t rlim_max; } rlim; - if (umove(tcp, addr, &rlim) < 0) - tprintf("%#lx", addr); - else { + if (!umove_or_printaddr(tcp, addr, &rlim)) { tprintf("{rlim_cur=%s,", sprint_rlim64(rlim.rlim_cur)); tprintf(" rlim_max=%s}", sprint_rlim64(rlim.rlim_max)); } } -static void -decode_rlimit64(struct tcb *tcp, unsigned long addr) -{ - if (!addr) - tprints("NULL"); - else if (!verbose(tcp) || - (exiting(tcp) && syserror(tcp))) - tprintf("%#lx", addr); - else - print_rlimit64(tcp, addr); -} - #if !defined(current_wordsize) || current_wordsize == 4 static const char * @@ -96,54 +80,41 @@ sprint_rlim32(uint32_t lim) } static void -print_rlimit32(struct tcb *tcp, unsigned long addr) +print_rlimit32(struct tcb *const tcp, const kernel_ulong_t addr) { struct rlimit_32 { uint32_t rlim_cur; uint32_t rlim_max; } rlim; - if (umove(tcp, addr, &rlim) < 0) - tprintf("%#lx", addr); - else { + if (!umove_or_printaddr(tcp, addr, &rlim)) { tprintf("{rlim_cur=%s,", sprint_rlim32(rlim.rlim_cur)); tprintf(" rlim_max=%s}", sprint_rlim32(rlim.rlim_max)); } } static void -decode_rlimit(struct tcb *tcp, unsigned long addr) -{ - if (!addr) - tprints("NULL"); - else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp))) - tprintf("%#lx", addr); - else { -# if defined(X86_64) || defined(X32) - /* - * i386 is the only personality on X86_64 and X32 - * with 32-bit rlim_t. - * When current_personality is X32, current_wordsize - * equals to 4 but rlim_t is 64-bit. - */ - if (current_personality == 1) -# else - if (current_wordsize == 4) -# endif - print_rlimit32(tcp, addr); - else - print_rlimit64(tcp, addr); - } +decode_rlimit(struct tcb *const tcp, const kernel_ulong_t addr) +{ + /* + * i386 is the only personality on X86_64 and X32 + * with 32-bit rlim_t. + * When current_personality is X32, current_wordsize + * equals to 4 but rlim_t is 64-bit. + */ + if (current_klongsize == 4) + print_rlimit32(tcp, addr); + else + print_rlimit64(tcp, addr); } #else /* defined(current_wordsize) && current_wordsize != 4 */ -# define decode_rlimit decode_rlimit64 +# define decode_rlimit print_rlimit64 #endif -int -sys_getrlimit(struct tcb *tcp) +SYS_FUNC(getrlimit) { if (entering(tcp)) { printxval(resources, tcp->u_arg[0], "RLIMIT_???"); @@ -155,129 +126,32 @@ sys_getrlimit(struct tcb *tcp) return 0; } -int -sys_setrlimit(struct tcb *tcp) +SYS_FUNC(setrlimit) { - if (entering(tcp)) { - printxval(resources, tcp->u_arg[0], "RLIMIT_???"); - tprints(", "); - decode_rlimit(tcp, tcp->u_arg[1]); - } - return 0; + printxval(resources, tcp->u_arg[0], "RLIMIT_???"); + tprints(", "); + decode_rlimit(tcp, tcp->u_arg[1]); + + return RVAL_DECODED; } -int -sys_prlimit64(struct tcb *tcp) +SYS_FUNC(prlimit64) { if (entering(tcp)) { - tprintf("%ld, ", tcp->u_arg[0]); + tprintf("%d, ", (int) tcp->u_arg[0]); printxval(resources, tcp->u_arg[1], "RLIMIT_???"); tprints(", "); - decode_rlimit64(tcp, tcp->u_arg[2]); + print_rlimit64(tcp, tcp->u_arg[2]); tprints(", "); } else { - decode_rlimit64(tcp, tcp->u_arg[3]); + print_rlimit64(tcp, tcp->u_arg[3]); } return 0; } #include "xlat/usagewho.h" -#ifdef ALPHA -void -printrusage32(struct tcb *tcp, long addr) -{ - struct timeval32 { - unsigned tv_sec; - unsigned tv_usec; - }; - struct rusage32 { - struct timeval32 ru_utime; /* user time used */ - struct timeval32 ru_stime; /* system time used */ - long ru_maxrss; /* maximum resident set size */ - long ru_ixrss; /* integral shared memory size */ - long ru_idrss; /* integral unshared data size */ - long ru_isrss; /* integral unshared stack size */ - long ru_minflt; /* page reclaims */ - long ru_majflt; /* page faults */ - long ru_nswap; /* swaps */ - long ru_inblock; /* block input operations */ - long ru_oublock; /* block output operations */ - long ru_msgsnd; /* messages sent */ - long ru_msgrcv; /* messages received */ - long ru_nsignals; /* signals received */ - long ru_nvcsw; /* voluntary context switches */ - long ru_nivcsw; /* involuntary " */ - } ru; - - if (!addr) - tprints("NULL"); - else if (syserror(tcp) || !verbose(tcp)) - tprintf("%#lx", addr); - else if (umove(tcp, addr, &ru) < 0) - tprints("{...}"); - else if (!abbrev(tcp)) { - tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ", - (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec, - (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec); - tprintf("ru_maxrss=%lu, ru_ixrss=%lu, ", - ru.ru_maxrss, ru.ru_ixrss); - tprintf("ru_idrss=%lu, ru_isrss=%lu, ", - ru.ru_idrss, ru.ru_isrss); - tprintf("ru_minflt=%lu, ru_majflt=%lu, ru_nswap=%lu, ", - ru.ru_minflt, ru.ru_majflt, ru.ru_nswap); - tprintf("ru_inblock=%lu, ru_oublock=%lu, ", - ru.ru_inblock, ru.ru_oublock); - tprintf("ru_msgsnd=%lu, ru_msgrcv=%lu, ", - ru.ru_msgsnd, ru.ru_msgrcv); - tprintf("ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}", - ru.ru_nsignals, ru.ru_nvcsw, ru.ru_nivcsw); - } - else { - tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ...}", - (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec, - (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec); - } -} -#endif - -void -printrusage(struct tcb *tcp, long addr) -{ - struct rusage ru; - - if (!addr) - tprints("NULL"); - else if (syserror(tcp) || !verbose(tcp)) - tprintf("%#lx", addr); - else if (umove(tcp, addr, &ru) < 0) - tprints("{...}"); - else if (!abbrev(tcp)) { - tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ", - (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec, - (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec); - tprintf("ru_maxrss=%lu, ru_ixrss=%lu, ", - ru.ru_maxrss, ru.ru_ixrss); - tprintf("ru_idrss=%lu, ru_isrss=%lu, ", - ru.ru_idrss, ru.ru_isrss); - tprintf("ru_minflt=%lu, ru_majflt=%lu, ru_nswap=%lu, ", - ru.ru_minflt, ru.ru_majflt, ru.ru_nswap); - tprintf("ru_inblock=%lu, ru_oublock=%lu, ", - ru.ru_inblock, ru.ru_oublock); - tprintf("ru_msgsnd=%lu, ru_msgrcv=%lu, ", - ru.ru_msgsnd, ru.ru_msgrcv); - tprintf("ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}", - ru.ru_nsignals, ru.ru_nvcsw, ru.ru_nivcsw); - } - else { - tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ...}", - (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec, - (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec); - } -} - -int -sys_getrusage(struct tcb *tcp) +SYS_FUNC(getrusage) { if (entering(tcp)) { printxval(usagewho, tcp->u_arg[0], "RUSAGE_???"); @@ -289,8 +163,7 @@ sys_getrusage(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_getrusage(struct tcb *tcp) +SYS_FUNC(osf_getrusage) { if (entering(tcp)) { printxval(usagewho, tcp->u_arg[0], "RUSAGE_???"); @@ -302,74 +175,20 @@ sys_osf_getrusage(struct tcb *tcp) } #endif /* ALPHA */ -int -sys_sysinfo(struct tcb *tcp) -{ - struct sysinfo si; - - if (exiting(tcp)) { - if (syserror(tcp) || !verbose(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else if (umove(tcp, tcp->u_arg[0], &si) < 0) - tprints("{...}"); - else { - tprintf("{uptime=%lu, loads=[%lu, %lu, %lu] ", - (long) si.uptime, (long) si.loads[0], - (long) si.loads[1], (long) si.loads[2]); - tprintf("totalram=%lu, freeram=%lu, ", - (long) si.totalram, (long) si.freeram); - tprintf("sharedram=%lu, bufferram=%lu} ", - (long) si.sharedram, (long) si.bufferram); - tprintf("totalswap=%lu, freeswap=%lu, procs=%u}", - (long) si.totalswap, (long) si.freeswap, - (unsigned)si.procs); - } - } - return 0; -} - #include "xlat/priorities.h" -int -sys_getpriority(struct tcb *tcp) +SYS_FUNC(getpriority) { - if (entering(tcp)) { - printxval(priorities, tcp->u_arg[0], "PRIO_???"); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; -} + printxval(priorities, tcp->u_arg[0], "PRIO_???"); + tprintf(", %d", (int) tcp->u_arg[1]); -int -sys_setpriority(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(priorities, tcp->u_arg[0], "PRIO_???"); - tprintf(", %lu, %ld", tcp->u_arg[1], tcp->u_arg[2]); - } - return 0; + return RVAL_DECODED; } -int -sys_times(struct tcb *tcp) +SYS_FUNC(setpriority) { - struct tms tbuf; + printxval(priorities, tcp->u_arg[0], "PRIO_???"); + tprintf(", %d, %d", (int) tcp->u_arg[1], (int) tcp->u_arg[2]); - if (exiting(tcp)) { - if (tcp->u_arg[0] == 0) - tprints("NULL"); - else if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else if (umove(tcp, tcp->u_arg[0], &tbuf) < 0) - tprints("{...}"); - else { - tprintf("{tms_utime=%llu, tms_stime=%llu, ", - (unsigned long long) tbuf.tms_utime, - (unsigned long long) tbuf.tms_stime); - tprintf("tms_cutime=%llu, tms_cstime=%llu}", - (unsigned long long) tbuf.tms_cutime, - (unsigned long long) tbuf.tms_cstime); - } - } - return 0; + return RVAL_DECODED; } diff --git a/rtc.c b/rtc.c new file mode 100644 index 00000000..43ea9466 --- /dev/null +++ b/rtc.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2004 Ulrich Drepper + * Copyright (c) 2004-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_rtc_pll_info) + +#include +#include + +typedef struct rtc_pll_info struct_rtc_pll_info; + +#include MPERS_DEFS + +static void +print_rtc_time(struct tcb *tcp, const struct rtc_time *rt) +{ + tprintf("{tm_sec=%d, tm_min=%d, tm_hour=%d, " + "tm_mday=%d, tm_mon=%d, tm_year=%d, ", + rt->tm_sec, rt->tm_min, rt->tm_hour, + rt->tm_mday, rt->tm_mon, rt->tm_year); + if (!abbrev(tcp)) + tprintf("tm_wday=%d, tm_yday=%d, tm_isdst=%d}", + rt->tm_wday, rt->tm_yday, rt->tm_isdst); + else + tprints("...}"); +} + +static void +decode_rtc_time(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct rtc_time rt; + + if (!umove_or_printaddr(tcp, addr, &rt)) + print_rtc_time(tcp, &rt); +} + +static void +decode_rtc_wkalrm(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct rtc_wkalrm wk; + + if (!umove_or_printaddr(tcp, addr, &wk)) { + tprintf("{enabled=%d, pending=%d, time=", wk.enabled, wk.pending); + print_rtc_time(tcp, &wk.time); + tprints("}"); + } +} + +static void +decode_rtc_pll_info(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct_rtc_pll_info pll; + + if (!umove_or_printaddr(tcp, addr, &pll)) + tprintf("{pll_ctrl=%d, pll_value=%d, pll_max=%d, pll_min=%d" + ", pll_posmult=%d, pll_negmult=%d, pll_clock=%ld}", + pll.pll_ctrl, pll.pll_value, pll.pll_max, pll.pll_min, + pll.pll_posmult, pll.pll_negmult, (long) pll.pll_clock); +} + +MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) +{ + switch (code) { + case RTC_ALM_READ: + case RTC_RD_TIME: + if (entering(tcp)) + return 0; + /* fall through */ + case RTC_ALM_SET: + case RTC_SET_TIME: + tprints(", "); + decode_rtc_time(tcp, arg); + break; + case RTC_IRQP_SET: + case RTC_EPOCH_SET: + tprintf(", %" PRI_klu, arg); + break; + case RTC_IRQP_READ: + case RTC_EPOCH_READ: + if (entering(tcp)) + return 0; + tprints(", "); + printnum_ulong(tcp, arg); + break; + case RTC_WKALM_RD: + if (entering(tcp)) + return 0; + /* fall through */ + case RTC_WKALM_SET: + tprints(", "); + decode_rtc_wkalrm(tcp, arg); + break; + case RTC_PLL_GET: + if (entering(tcp)) + return 0; + /* fall through */ + case RTC_PLL_SET: + tprints(", "); + decode_rtc_pll_info(tcp, arg); + break; +#ifdef RTC_VL_READ + case RTC_VL_READ: + if (entering(tcp)) + return 0; + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; +#endif + case RTC_AIE_ON: + case RTC_AIE_OFF: + case RTC_UIE_ON: + case RTC_UIE_OFF: + case RTC_PIE_ON: + case RTC_PIE_OFF: + case RTC_WIE_ON: + case RTC_WIE_OFF: +#ifdef RTC_VL_CLR + case RTC_VL_CLR: +#endif + /* no args */ + break; + default: + return RVAL_DECODED; + } + + return RVAL_DECODED | 1; +} diff --git a/sched.c b/sched.c new file mode 100644 index 00000000..90242615 --- /dev/null +++ b/sched.c @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2004 Ulrich Drepper + * Copyright (c) 2005 Roland McGrath + * Copyright (c) 2012-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +#include "xlat/schedulers.h" +#include "xlat/sched_flags.h" + +SYS_FUNC(sched_getscheduler) +{ + if (entering(tcp)) { + tprintf("%d", (int) tcp->u_arg[0]); + } else if (!syserror(tcp)) { + tcp->auxstr = xlookup(schedulers, (kernel_ulong_t) tcp->u_rval); + if (tcp->auxstr != NULL) + return RVAL_STR; + } + return 0; +} + +SYS_FUNC(sched_setscheduler) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + printxval(schedulers, tcp->u_arg[1], "SCHED_???"); + tprints(", "); + printnum_int(tcp, tcp->u_arg[2], "%d"); + + return RVAL_DECODED; +} + +SYS_FUNC(sched_getparam) +{ + if (entering(tcp)) + tprintf("%d, ", (int) tcp->u_arg[0]); + else + printnum_int(tcp, tcp->u_arg[1], "%d"); + return 0; +} + +SYS_FUNC(sched_setparam) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + printnum_int(tcp, tcp->u_arg[1], "%d"); + + return RVAL_DECODED; +} + +SYS_FUNC(sched_get_priority_min) +{ + printxval(schedulers, tcp->u_arg[0], "SCHED_???"); + + return RVAL_DECODED; +} + +SYS_FUNC(sched_rr_get_interval) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + } else { + if (syserror(tcp)) + printaddr(tcp->u_arg[1]); + else + print_timespec(tcp, tcp->u_arg[1]); + } + return 0; +} + +static void +print_sched_attr(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int size) +{ + struct { + uint32_t size; + uint32_t sched_policy; + uint64_t sched_flags; + uint32_t sched_nice; + uint32_t sched_priority; + uint64_t sched_runtime; + uint64_t sched_deadline; + uint64_t sched_period; + } attr = {}; + + if (size > sizeof(attr)) + size = sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return; + + tprintf("{size=%u, sched_policy=", attr.size); + printxval(schedulers, attr.sched_policy, "SCHED_???"); + tprints(", sched_flags="); + printflags64(sched_flags, attr.sched_flags, "SCHED_FLAG_???"); + tprintf(", sched_nice=%d", attr.sched_nice); + tprintf(", sched_priority=%u", attr.sched_priority); + tprintf(", sched_runtime=%" PRIu64, attr.sched_runtime); + tprintf(", sched_deadline=%" PRIu64, attr.sched_deadline); + tprintf(", sched_period=%" PRIu64 "}", attr.sched_period); +} + +SYS_FUNC(sched_setattr) +{ + tprintf("%d, ", (int) tcp->u_arg[0]); + print_sched_attr(tcp, tcp->u_arg[1], 0x100); + tprintf(", %u", (unsigned int) tcp->u_arg[2]); + + return RVAL_DECODED; +} + +SYS_FUNC(sched_getattr) +{ + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + } else { + print_sched_attr(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %u, %u", + (unsigned int) tcp->u_arg[2], + (unsigned int) tcp->u_arg[3]); + } + + return 0; +} diff --git a/scno.am b/scno.am new file mode 100644 index 00000000..12745f12 --- /dev/null +++ b/scno.am @@ -0,0 +1,44 @@ +# scno.h make rules for strace. +# +# Copyright (c) 2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) + +syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ + +digits = [[:digit:]][[:digit:]]* +al_nums = [[:alnum:]_][[:alnum:]_]* +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p + +scno.h: $(top_srcdir)/scno.head syscallent.i + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + cat $< >> $@-t + LC_ALL=C sed -n '$(SCNO_SED)' $(filter-out $<,$^) >> $@-t + mv $@-t $@ + +CLEANFILES += syscallent.i scno.h diff --git a/scno.head b/scno.head new file mode 100644 index 00000000..a640102f --- /dev/null +++ b/scno.head @@ -0,0 +1,6 @@ +#if defined __X32_SYSCALL_BIT && defined __NR_read \ + && (__X32_SYSCALL_BIT & __NR_read) == __X32_SYSCALL_BIT +# define SYSCALL_BIT __X32_SYSCALL_BIT +#else +# define SYSCALL_BIT 0 +#endif diff --git a/scsi.c b/scsi.c index 2aa4c7b3..35796201 100644 --- a/scsi.c +++ b/scsi.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2007 Vladimir Nadvornik - * Copyright (c) 2007 Dmitry V. Levin + * Copyright (c) 2007-2017 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,110 +29,155 @@ #include "defs.h" #ifdef HAVE_SCSI_SG_H - -# include # include +#endif -#include "xlat/sg_io_dxfer_direction.h" +#include "xlat/scsi_sg_commands.h" +#include "xlat/sg_scsi_reset.h" -static void -print_sg_io_buffer(struct tcb *tcp, unsigned char *addr, int len) +static int +decode_sg_io(struct tcb *const tcp, const uint32_t iid, + const kernel_ulong_t arg) { - unsigned char *buf = NULL; - int allocated, i; - - if (len == 0) - return; - allocated = (len > max_strlen) ? max_strlen : len; - if (len < 0 || - (buf = malloc(allocated)) == NULL || - umoven(tcp, (unsigned long) addr, allocated, (char *) buf) < 0) { - tprintf("%p", addr); - free(buf); - return; + switch (iid) { + case 'S': + return decode_sg_io_v3(tcp, arg); + case 'Q': + return decode_sg_io_v4(tcp, arg); + default: + tprintf("[%u]", iid); + return RVAL_DECODED | 1; } - tprintf("%02x", buf[0]); - for (i = 1; i < allocated; ++i) - tprintf(", %02x", buf[i]); - free(buf); - if (allocated != len) - tprints(", ..."); -} -static void -print_sg_io_req(struct tcb *tcp, struct sg_io_hdr *sg_io) -{ - tprintf("{'%c', ", sg_io->interface_id); - printxval(sg_io_dxfer_direction, sg_io->dxfer_direction, - "SG_DXFER_???"); - tprintf(", cmd[%u]=[", sg_io->cmd_len); - print_sg_io_buffer(tcp, sg_io->cmdp, sg_io->cmd_len); - tprintf("], mx_sb_len=%d, ", sg_io->mx_sb_len); - tprintf("iovec_count=%d, ", sg_io->iovec_count); - tprintf("dxfer_len=%u, ", sg_io->dxfer_len); - tprintf("timeout=%u, ", sg_io->timeout); - tprintf("flags=%#x", sg_io->flags); - - if (sg_io->dxfer_direction == SG_DXFER_TO_DEV || - sg_io->dxfer_direction == SG_DXFER_TO_FROM_DEV) { - tprintf(", data[%u]=[", sg_io->dxfer_len); - printstr(tcp, (unsigned long) sg_io->dxferp, - sg_io->dxfer_len); - tprints("]"); - } } -static void -print_sg_io_res(struct tcb *tcp, struct sg_io_hdr *sg_io) +#ifdef HAVE_SCSI_SG_H + +static int +decode_sg_scsi_id(struct tcb *const tcp, const kernel_ulong_t arg) { - if (sg_io->dxfer_direction == SG_DXFER_FROM_DEV || - sg_io->dxfer_direction == SG_DXFER_TO_FROM_DEV) { - tprintf(", data[%u]=[", sg_io->dxfer_len); - printstr(tcp, (unsigned long) sg_io->dxferp, - sg_io->dxfer_len); - tprints("]"); + struct sg_scsi_id id; + + if (entering(tcp)) + return 0; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &id)) { + tprintf("{host_no=%d" + ", channel=%d" + ", scsi_id=%#x" + ", lun=%d" + ", scsi_type=%#x" + ", h_cmd_per_lun=%hd" + ", d_queue_depth=%hd}", + id.host_no, + id.channel, + id.scsi_id, + id.lun, + id.scsi_type, + id.h_cmd_per_lun, + id.d_queue_depth); } - tprintf(", status=%02x, ", sg_io->status); - tprintf("masked_status=%02x, ", sg_io->masked_status); - tprintf("sb[%u]=[", sg_io->sb_len_wr); - print_sg_io_buffer(tcp, sg_io->sbp, sg_io->sb_len_wr); - tprintf("], host_status=%#x, ", sg_io->host_status); - tprintf("driver_status=%#x, ", sg_io->driver_status); - tprintf("resid=%d, ", sg_io->resid); - tprintf("duration=%d, ", sg_io->duration); - tprintf("info=%#x}", sg_io->info); + return RVAL_DECODED | 1; } +#endif /* HAVE_SCSI_SG_H */ + int -scsi_ioctl(struct tcb *tcp, long code, long arg) +scsi_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) { switch (code) { case SG_IO: if (entering(tcp)) { - struct sg_io_hdr sg_io; + uint32_t iid; - if (umove(tcp, arg, &sg_io) < 0) - tprintf(", %#lx", arg); - else { - tprints(", "); - print_sg_io_req(tcp, &sg_io); + tprints(", "); + if (umove_or_printaddr(tcp, arg, &iid)) { + break; + } else { + return decode_sg_io(tcp, iid, arg); } + } else { + uint32_t *piid = get_tcb_priv_data(tcp); + if (piid) + decode_sg_io(tcp, *piid, arg); + tprints("}"); + break; } - if (exiting(tcp)) { - struct sg_io_hdr sg_io; - if (!syserror(tcp) && umove(tcp, arg, &sg_io) >= 0) - print_sg_io_res(tcp, &sg_io); - else - tprints("}"); +#ifdef HAVE_SCSI_SG_H + /* returns struct sg_scsi_id */ + case SG_GET_SCSI_ID: + return decode_sg_scsi_id(tcp, arg); + /* returns struct sg_req_info */ + case SG_GET_REQUEST_TABLE: + return decode_sg_req_info(tcp, arg); +#endif /* HAVE_SCSI_SG_H */ + + /* takes a value by pointer */ + case SG_SCSI_RESET: { + unsigned int val; + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &val)) { + tprints("["); + if (val & SG_SCSI_RESET_NO_ESCALATE) { + printxval(sg_scsi_reset, + SG_SCSI_RESET_NO_ESCALATE, 0); + tprints("|"); + } + printxval(sg_scsi_reset, + val & ~SG_SCSI_RESET_NO_ESCALATE, + "SG_SCSI_RESET_???"); + tprints("]"); + } break; - default: + } + + /* takes a signed int by pointer */ + case SG_NEXT_CMD_LEN: + case SG_SET_COMMAND_Q: + case SG_SET_DEBUG: + case SG_SET_FORCE_LOW_DMA: + case SG_SET_FORCE_PACK_ID: + case SG_SET_KEEP_ORPHAN: + case SG_SET_RESERVED_SIZE: + case SG_SET_TIMEOUT: + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; + + /* returns a signed int by pointer */ + case SG_EMULATED_HOST: + case SG_GET_ACCESS_COUNT: + case SG_GET_COMMAND_Q: + case SG_GET_KEEP_ORPHAN: + case SG_GET_LOW_DMA: + case SG_GET_NUM_WAITING: + case SG_GET_PACK_ID: + case SG_GET_RESERVED_SIZE: + case SG_GET_SG_TABLESIZE: + case SG_GET_TRANSFORM: + case SG_GET_VERSION_NUM: if (entering(tcp)) - tprintf(", %#lx", arg); + return 0; + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; + + /* takes an integer by value */ + case SG_SET_TRANSFORM: + tprintf(", %#x", (unsigned int) arg); break; + + /* no arguments */ + case SG_GET_TIMEOUT: + break; + + default: + return RVAL_DECODED; } - return 1; -} -#endif /* HAVE_SCSI_SG_H */ + return RVAL_DECODED | 1; +} diff --git a/seccomp.c b/seccomp.c new file mode 100644 index 00000000..f778a6c4 --- /dev/null +++ b/seccomp.c @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#include "xlat/seccomp_ops.h" +#include "xlat/seccomp_filter_flags.h" + +#ifdef HAVE_LINUX_FILTER_H +# include +# include "xlat/bpf_class.h" +# include "xlat/bpf_miscop.h" +# include "xlat/bpf_mode.h" +# include "xlat/bpf_op_alu.h" +# include "xlat/bpf_op_jmp.h" +# include "xlat/bpf_rval.h" +# include "xlat/bpf_size.h" +# include "xlat/bpf_src.h" + +# ifndef SECCOMP_RET_ACTION +# define SECCOMP_RET_ACTION 0x7fff0000U +# endif +# include "xlat/seccomp_ret_action.h" +#endif + +struct bpf_filter { + uint16_t code; + uint8_t jt; + uint8_t jf; + uint32_t k; +}; + +#ifdef HAVE_LINUX_FILTER_H + +static void +decode_bpf_code(uint16_t code) +{ + uint16_t i = code & ~BPF_CLASS(code); + + printxval(bpf_class, BPF_CLASS(code), "BPF_???"); + switch (BPF_CLASS(code)) { + case BPF_LD: + case BPF_LDX: + tprints("|"); + printxval(bpf_size, BPF_SIZE(code), "BPF_???"); + tprints("|"); + printxval(bpf_mode, BPF_MODE(code), "BPF_???"); + break; + case BPF_ST: + case BPF_STX: + if (i) + tprintf("|%#x /* %s */", i, "BPF_???"); + break; + case BPF_ALU: + tprints("|"); + printxval(bpf_src, BPF_SRC(code), "BPF_???"); + tprints("|"); + printxval(bpf_op_alu, BPF_OP(code), "BPF_???"); + break; + case BPF_JMP: + tprints("|"); + printxval(bpf_src, BPF_SRC(code), "BPF_???"); + tprints("|"); + printxval(bpf_op_jmp, BPF_OP(code), "BPF_???"); + break; + case BPF_RET: + tprints("|"); + printxval(bpf_rval, BPF_RVAL(code), "BPF_???"); + i &= ~BPF_RVAL(code); + if (i) + tprintf("|%#x /* %s */", i, "BPF_???"); + break; + case BPF_MISC: + tprints("|"); + printxval(bpf_miscop, BPF_MISCOP(code), "BPF_???"); + i &= ~BPF_MISCOP(code); + if (i) + tprintf("|%#x /* %s */", i, "BPF_???"); + break; + } + +} + +#endif /* HAVE_LINUX_FILTER_H */ + +static void +decode_bpf_stmt(const struct bpf_filter *filter) +{ +#ifdef HAVE_LINUX_FILTER_H + tprints("BPF_STMT("); + decode_bpf_code(filter->code); + tprints(", "); + if (BPF_CLASS(filter->code) == BPF_RET) { + unsigned int action = SECCOMP_RET_ACTION & filter->k; + unsigned int data = filter->k & ~action; + + printxval(seccomp_ret_action, action, "SECCOMP_RET_???"); + if (data) + tprintf("|%#x)", data); + else + tprints(")"); + } else { + tprintf("%#x)", filter->k); + } +#else + tprintf("BPF_STMT(%#x, %#x)", filter->code, filter->k); +#endif /* HAVE_LINUX_FILTER_H */ +} + +static void +decode_bpf_jump(const struct bpf_filter *filter) +{ +#ifdef HAVE_LINUX_FILTER_H + tprints("BPF_JUMP("); + decode_bpf_code(filter->code); + tprintf(", %#x, %#x, %#x)", + filter->k, filter->jt, filter->jf); +#else + tprintf("BPF_JUMP(%#x, %#x, %#x, %#x)", + filter->code, filter->k, filter->jt, filter->jf); +#endif /* HAVE_LINUX_FILTER_H */ +} + +#ifndef BPF_MAXINSNS +# define BPF_MAXINSNS 4096 +#endif + +static bool +print_bpf_filter(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const struct bpf_filter *filter = elem_buf; + unsigned int *pn = data; + + if ((*pn)++ >= BPF_MAXINSNS) { + tprints("..."); + return false; + } + + if (filter->jt || filter->jf) + decode_bpf_jump(filter); + else + decode_bpf_stmt(filter); + + return true; +} + +void +print_seccomp_fprog(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned short len) +{ + if (abbrev(tcp)) { + printaddr(addr); + } else { + unsigned int insns = 0; + struct bpf_filter filter; + + print_array(tcp, addr, len, &filter, sizeof(filter), + umoven_or_printaddr, print_bpf_filter, &insns); + } +} + +#include "seccomp_fprog.h" + +void +print_seccomp_filter(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct seccomp_fprog fprog; + + if (fetch_seccomp_fprog(tcp, addr, &fprog)) { + tprintf("{len=%hu, filter=", fprog.len); + print_seccomp_fprog(tcp, fprog.filter, fprog.len); + tprints("}"); + } +} + +static void +decode_seccomp_set_mode_strict(const unsigned int flags, + const kernel_ulong_t addr) +{ + tprintf("%u, ", flags); + printaddr(addr); +} + +SYS_FUNC(seccomp) +{ + unsigned int op = tcp->u_arg[0]; + + printxval(seccomp_ops, op, "SECCOMP_SET_MODE_???"); + tprints(", "); + + if (op == SECCOMP_SET_MODE_FILTER) { + printflags(seccomp_filter_flags, tcp->u_arg[1], + "SECCOMP_FILTER_FLAG_???"); + tprints(", "); + print_seccomp_filter(tcp, tcp->u_arg[2]); + } else { + decode_seccomp_set_mode_strict(tcp->u_arg[1], + tcp->u_arg[2]); + } + + return RVAL_DECODED; +} diff --git a/seccomp_fprog.h b/seccomp_fprog.h new file mode 100644 index 00000000..f4837272 --- /dev/null +++ b/seccomp_fprog.h @@ -0,0 +1,9 @@ +#ifndef STRACE_SECCOMP_FPROG_H +#define STRACE_SECCOMP_FPROG_H + +struct seccomp_fprog { + unsigned short len; + unsigned long filter; +}; + +#endif /* !STRACE_SECCOMP_FPROG_H */ diff --git a/sendfile.c b/sendfile.c new file mode 100644 index 00000000..7faf1ca2 --- /dev/null +++ b/sendfile.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +SYS_FUNC(sendfile64) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printfd(tcp, tcp->u_arg[1]); + tprints(", "); + if (!printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64)) { + tprintf(", %" PRI_klu, tcp->u_arg[3]); + return RVAL_DECODED; + } + } else { + if (!syserror(tcp) && tcp->u_rval) { + tprints(" => "); + printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64); + } + tprintf(", %" PRI_klu, tcp->u_arg[3]); + } + + return 0; +} + +SYS_FUNC(sendfile) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printfd(tcp, tcp->u_arg[1]); + tprints(", "); + if (!printnum_ulong(tcp, tcp->u_arg[2]) + || !tcp->u_arg[3]) { + tprintf(", %" PRI_klu, tcp->u_arg[3]); + return RVAL_DECODED; + } + } else { + if (!syserror(tcp) && tcp->u_rval) { + tprints(" => "); + printnum_ulong(tcp, tcp->u_arg[2]); + } + tprintf(", %" PRI_klu, tcp->u_arg[3]); + } + + return 0; +} diff --git a/sg_io_v3.c b/sg_io_v3.c new file mode 100644 index 00000000..33aff506 --- /dev/null +++ b/sg_io_v3.c @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2007 Vladimir Nadvornik + * Copyright (c) 2007-2017 Dmitry V. Levin + * Copyright (c) 2015 Bart Van Assche + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_SCSI_SG_H + +#include DEF_MPERS_TYPE(struct_sg_io_hdr) + +# include + +typedef struct sg_io_hdr struct_sg_io_hdr; + +#endif /* HAVE_SCSI_SG_H */ + +#include MPERS_DEFS + +#include "xlat/sg_io_info.h" + +#ifdef HAVE_SCSI_SG_H +# include "xlat/sg_io_dxfer_direction.h" +# include "xlat/sg_io_flags.h" + +static void +print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int data_size, const unsigned int iovec_count) +{ + if (iovec_count) { + tprint_iov_upto(tcp, iovec_count, addr, IOV_DECODE_STR, + data_size); + } else { + printstr_ex(tcp, addr, data_size, QUOTE_FORCE_HEX); + } +} + +static int +decode_request(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct_sg_io_hdr sg_io; + static const size_t skip_iid = + offsetof(struct_sg_io_hdr, dxfer_direction); + + tprints("{interface_id='S', "); + if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid, + &sg_io.dxfer_direction)) { + tprints("}"); + return RVAL_DECODED | 1; + } + + tprints("dxfer_direction="); + printxval(sg_io_dxfer_direction, sg_io.dxfer_direction, + "SG_DXFER_???"); + tprintf(", cmd_len=%u, cmdp=", sg_io.cmd_len); + print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.cmdp), sg_io.cmd_len, 0); + tprintf(", mx_sb_len=%d", sg_io.mx_sb_len); + tprintf(", iovec_count=%d", sg_io.iovec_count); + tprintf(", dxfer_len=%u", sg_io.dxfer_len); + tprintf(", timeout=%u", sg_io.timeout); + tprints(", flags="); + printflags(sg_io_flags, sg_io.flags, "SG_FLAG_???"); + + if (sg_io.dxfer_direction == SG_DXFER_TO_DEV || + sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) { + tprints(", dxferp="); + print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.dxferp), + sg_io.dxfer_len, sg_io.iovec_count); + } + + struct_sg_io_hdr *entering_sg_io = malloc(sizeof(*entering_sg_io)); + if (entering_sg_io) { + memcpy(entering_sg_io, &sg_io, sizeof(sg_io)); + entering_sg_io->interface_id = (unsigned char) 'S'; + set_tcb_priv_data(tcp, entering_sg_io, free); + } + + return 1; +} + +static int +decode_response(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct_sg_io_hdr *entering_sg_io = get_tcb_priv_data(tcp); + struct_sg_io_hdr sg_io; + + if (umove(tcp, arg, &sg_io) < 0) { + /* print i/o fields fetched on entering syscall */ + if (entering_sg_io->dxfer_direction == SG_DXFER_FROM_DEV) { + tprints(", dxferp="); + printaddr(ptr_to_kulong(entering_sg_io->dxferp)); + } + tprints(", sbp="); + printaddr(ptr_to_kulong(entering_sg_io->sbp)); + return RVAL_DECODED | 1; + } + + if (sg_io.interface_id != entering_sg_io->interface_id) { + tprintf(" => interface_id=%u", sg_io.interface_id); + return RVAL_DECODED | 1; + } + + if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV || + sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) { + uint32_t din_len = sg_io.dxfer_len; + + if (sg_io.resid > 0 && (unsigned int) sg_io.resid <= din_len) + din_len -= sg_io.resid; + if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV) { + tprints(", dxferp="); + } else if (din_len) { + tprints(" => dxferp="); + } + if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV || din_len) { + print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.dxferp), + din_len, sg_io.iovec_count); + } + } + tprintf(", status=%#x", sg_io.status); + tprintf(", masked_status=%#x", sg_io.masked_status); + tprintf(", msg_status=%#x", sg_io.msg_status); + tprintf(", sb_len_wr=%u, sbp=", sg_io.sb_len_wr); + print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.sbp), sg_io.sb_len_wr, 0); + tprintf(", host_status=%#x", sg_io.host_status); + tprintf(", driver_status=%#x", sg_io.driver_status); + tprintf(", resid=%d", sg_io.resid); + tprintf(", duration=%u", sg_io.duration); + tprints(", info="); + printflags(sg_io_info, sg_io.info, "SG_INFO_???"); + + return RVAL_DECODED | 1; +} + +#else /* !HAVE_SCSI_SG_H */ + +static int +decode_request(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints("{interface_id='S', ...}"); + return RVAL_DECODED | 1; +} + +static int +decode_response(struct tcb *const tcp, const kernel_ulong_t arg) +{ + return 0; +} + +#endif + +MPERS_PRINTER_DECL(int, decode_sg_io_v3, + struct tcb *const tcp, const kernel_ulong_t arg) +{ + return entering(tcp) ? decode_request(tcp, arg) + : decode_response(tcp, arg); +} diff --git a/sg_io_v4.c b/sg_io_v4.c new file mode 100644 index 00000000..1ae8814d --- /dev/null +++ b/sg_io_v4.c @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2015 Bart Van Assche + * Copyright (c) 2015-2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_BSG_H + +# include +# include "xlat/bsg_protocol.h" +# include "xlat/bsg_subprotocol.h" +# include "xlat/bsg_flags.h" + +static void +print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int data_size, const unsigned int iovec_count) +{ + if (iovec_count) { + tprint_iov_upto(tcp, iovec_count, addr, IOV_DECODE_STR, + data_size); + } else { + printstr_ex(tcp, addr, data_size, QUOTE_FORCE_HEX); + } +} + +static int +decode_request(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct sg_io_v4 sg_io; + static const size_t skip_iid = offsetof(struct sg_io_v4, protocol); + + tprints("{guard='Q', "); + if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid, + &sg_io.protocol)) { + tprints("}"); + return RVAL_DECODED | 1; + } + + tprints("protocol="); + printxval(bsg_protocol, sg_io.protocol, "BSG_PROTOCOL_???"); + tprints(", subprotocol="); + printxval(bsg_subprotocol, sg_io.subprotocol, "BSG_SUB_PROTOCOL_???"); + tprintf(", request_len=%u, request=", sg_io.request_len); + print_sg_io_buffer(tcp, sg_io.request, sg_io.request_len, 0); + tprintf(", request_tag=%#" PRI__x64, sg_io.request_tag); + tprintf(", request_attr=%u", sg_io.request_attr); + tprintf(", request_priority=%u", sg_io.request_priority); + tprintf(", request_extra=%u", sg_io.request_extra); + tprintf(", max_response_len=%u", sg_io.max_response_len); + + tprintf(", dout_iovec_count=%u", sg_io.dout_iovec_count); + tprintf(", dout_xfer_len=%u", sg_io.dout_xfer_len); + tprintf(", din_iovec_count=%u", sg_io.din_iovec_count); + tprintf(", din_xfer_len=%u", sg_io.din_xfer_len); + tprints(", dout_xferp="); + print_sg_io_buffer(tcp, sg_io.dout_xferp, sg_io.dout_xfer_len, + sg_io.dout_iovec_count); + + tprintf(", timeout=%u", sg_io.timeout); + tprints(", flags="); + printflags(bsg_flags, sg_io.flags, "BSG_FLAG_???"); + tprintf(", usr_ptr=%#" PRI__x64, sg_io.usr_ptr); + + struct sg_io_v4 *entering_sg_io = malloc(sizeof(*entering_sg_io)); + if (entering_sg_io) { + memcpy(entering_sg_io, &sg_io, sizeof(sg_io)); + entering_sg_io->guard = (unsigned char) 'Q'; + set_tcb_priv_data(tcp, entering_sg_io, free); + } + + return 1; +} + +static int +decode_response(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct sg_io_v4 *entering_sg_io = get_tcb_priv_data(tcp); + struct sg_io_v4 sg_io; + uint32_t din_len; + + if (umove(tcp, arg, &sg_io) < 0) { + /* print i/o fields fetched on entering syscall */ + tprints(", response="); + printaddr(entering_sg_io->response); + tprints(", din_xferp="); + printaddr(entering_sg_io->din_xferp); + return RVAL_DECODED | 1; + } + + if (sg_io.guard != entering_sg_io->guard) { + tprintf(" => guard=%u", sg_io.guard); + return RVAL_DECODED | 1; + } + + tprintf(", response_len=%u, response=", sg_io.response_len); + print_sg_io_buffer(tcp, sg_io.response, sg_io.response_len, 0); + din_len = sg_io.din_xfer_len; + if (sg_io.din_resid > 0 && (unsigned int) sg_io.din_resid <= din_len) + din_len -= sg_io.din_resid; + tprints(", din_xferp="); + print_sg_io_buffer(tcp, sg_io.din_xferp, din_len, + sg_io.din_iovec_count); + tprintf(", driver_status=%#x", sg_io.driver_status); + tprintf(", transport_status=%#x", sg_io.transport_status); + tprintf(", device_status=%#x", sg_io.device_status); + tprintf(", retry_delay=%u", sg_io.retry_delay); + tprints(", info="); + printflags(sg_io_info, sg_io.info, "SG_INFO_???"); + tprintf(", duration=%u", sg_io.duration); + tprintf(", response_len=%u", sg_io.response_len); + tprintf(", din_resid=%d", sg_io.din_resid); + tprintf(", dout_resid=%d", sg_io.dout_resid); + tprintf(", generated_tag=%#" PRI__x64, sg_io.generated_tag); + + return RVAL_DECODED | 1; +} + +#else /* !HAVE_LINUX_BSG_H */ + +static int +decode_request(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints("{guard='Q', ...}"); + return RVAL_DECODED | 1; +} + +static int +decode_response(struct tcb *const tcp, const kernel_ulong_t arg) +{ + return 0; +} + +#endif + +int +decode_sg_io_v4(struct tcb *const tcp, const kernel_ulong_t arg) +{ + return entering(tcp) ? decode_request(tcp, arg) + : decode_response(tcp, arg); +} diff --git a/sigaltstack.c b/sigaltstack.c new file mode 100644 index 00000000..7b624c97 --- /dev/null +++ b/sigaltstack.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(stack_t) + +#include + +#include MPERS_DEFS + +#include "xlat/sigaltstack_flags.h" + +static void +print_stack_t(struct tcb *const tcp, const kernel_ulong_t addr) +{ + stack_t ss; + + if (umove_or_printaddr(tcp, addr, &ss)) + return; + + tprints("{ss_sp="); + printaddr(ptr_to_kulong(ss.ss_sp)); + tprints(", ss_flags="); + printflags(sigaltstack_flags, ss.ss_flags, "SS_???"); + tprintf(", ss_size=%" PRI_klu "}", (kernel_ulong_t) ss.ss_size); +} + +SYS_FUNC(sigaltstack) +{ + if (entering(tcp)) { + print_stack_t(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + print_stack_t(tcp, tcp->u_arg[1]); + } + return 0; +} diff --git a/sigevent.h b/sigevent.h new file mode 100644 index 00000000..04c90792 --- /dev/null +++ b/sigevent.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_SIGEVENT_H +#define STRACE_SIGEVENT_H + +typedef struct { + union { + int sival_int; + unsigned long sival_ptr; + } sigev_value; + int sigev_signo; + int sigev_notify; + union { + int tid; + struct { + unsigned long function; + unsigned long attribute; + } sigev_thread; + } sigev_un; +} struct_sigevent; + +#endif /* !STRACE_SIGEVENT_H */ diff --git a/signal.c b/signal.c index f6eeed0e..25329d3e 100644 --- a/signal.c +++ b/signal.c @@ -32,65 +32,7 @@ */ #include "defs.h" -#include -#include - -#ifdef HAVE_SYS_REG_H -# include -#elif defined(HAVE_LINUX_PTRACE_H) -# undef PTRACE_SYSCALL -# ifdef HAVE_STRUCT_IA64_FPREG -# define ia64_fpreg XXX_ia64_fpreg -# endif -# ifdef HAVE_STRUCT_PT_ALL_USER_REGS -# define pt_all_user_regs XXX_pt_all_user_regs -# endif -# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS -# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args -# endif -# include -# undef ptrace_peeksiginfo_args -# undef ia64_fpreg -# undef pt_all_user_regs -#endif - -#ifdef IA64 -# include -#endif - -#if defined(SPARC) || defined(SPARC64) || defined(MIPS) -typedef struct { - struct pt_regs si_regs; - int si_mask; -} m_siginfo_t; -#elif defined HAVE_ASM_SIGCONTEXT_H -# if !defined(IA64) && !defined(X86_64) && !defined(X32) -# include -# endif -#else /* !HAVE_ASM_SIGCONTEXT_H */ -# if defined M68K && !defined HAVE_STRUCT_SIGCONTEXT -struct sigcontext { - unsigned long sc_mask; - unsigned long sc_usp; - unsigned long sc_d0; - unsigned long sc_d1; - unsigned long sc_a0; - unsigned long sc_a1; - unsigned short sc_sr; - unsigned long sc_pc; - unsigned short sc_formatvec; -}; -# endif /* M68K */ -#endif /* !HAVE_ASM_SIGCONTEXT_H */ - -#ifndef NSIG -# warning: NSIG is not defined, using 32 -# define NSIG 32 -#elif NSIG < 32 -# error: NSIG < 32 -#endif - -#ifdef HAVE_SIGACTION +#include "nsig.h" /* The libc headers do not define this constant since it should only be used by the implementation. So we define it here. */ @@ -100,25 +42,47 @@ struct sigcontext { # endif #endif -/* Some arches define this in their headers, but don't actually have it, - so we have to delete the define. */ -#if defined(HPPA) || defined(IA64) -# undef SA_RESTORER +/* + * Some architectures define SA_RESTORER in their headers, + * but do not actually have sa_restorer. + * + * Some architectures, otherwise, do not define SA_RESTORER in their headers, + * but actually have sa_restorer. + */ +#ifdef SA_RESTORER +# if defined HPPA || defined IA64 +# define HAVE_SA_RESTORER 0 +# else +# define HAVE_SA_RESTORER 1 +# endif +#else /* !SA_RESTORER */ +# if defined SPARC || defined SPARC64 || defined M68K +# define HAVE_SA_RESTORER 1 +# else +# define HAVE_SA_RESTORER 0 +# endif #endif +#include "xlat/sa_handler_values.h" #include "xlat/sigact_flags.h" #include "xlat/sigprocmaskcmds.h" -#endif /* HAVE_SIGACTION */ - /* Anonymous realtime signals. */ -/* Under glibc 2.1, SIGRTMIN et al are functions, but __SIGRTMIN is a - constant. This is what we want. Otherwise, just use SIGRTMIN. */ -#ifdef SIGRTMIN -#ifndef __SIGRTMIN -#define __SIGRTMIN SIGRTMIN -#define __SIGRTMAX SIGRTMAX /* likewise */ +#ifndef ASM_SIGRTMIN +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define ASM_SIGRTMIN 32 #endif +#ifndef ASM_SIGRTMAX +/* Under glibc 2.1, SIGRTMAX et al are functions, but __SIGRTMAX is a + constant. This is what we want. Otherwise, just use SIGRTMAX. */ +# ifdef SIGRTMAX +# ifndef __SIGRTMAX +# define __SIGRTMAX SIGRTMAX +# endif +# endif +# ifdef __SIGRTMAX +# define ASM_SIGRTMAX __SIGRTMAX +# endif #endif /* Note on the size of sigset_t: @@ -140,22 +104,43 @@ struct sigcontext { * umoven(tcp, addr, sizeof(sigset_t), &sigset) * may be a bad idea: it'll try to read much more data than needed * to fetch a sigset_t. - * Use (NSIG / 8) as a size instead. + * Use NSIG_BYTES as a size instead. */ +static const char * +get_sa_handler_str(kernel_ulong_t handler) +{ + return xlookup(sa_handler_values, handler); +} + +static void +print_sa_handler(kernel_ulong_t handler) +{ + const char *sa_handler_str = get_sa_handler_str(handler); + + if (sa_handler_str) + tprints(sa_handler_str); + else + printaddr(handler); +} + const char * -signame(int sig) +signame(const int sig) { - static char buf[sizeof("SIGRT_%d") + sizeof(int)*3]; - - if (sig >= 0 && sig < nsignals) - return signalent[sig]; -#ifdef SIGRTMIN - if (sig >= __SIGRTMIN && sig <= __SIGRTMAX) { - sprintf(buf, "SIGRT_%d", (int)(sig - __SIGRTMIN)); - return buf; - } + static char buf[sizeof("SIGRT_%u") + sizeof(int)*3]; + + if (sig >= 0) { + const unsigned int s = sig; + + if (s < nsignals) + return signalent[s]; +#ifdef ASM_SIGRTMAX + if (s >= ASM_SIGRTMIN && s <= (unsigned int) ASM_SIGRTMAX) { + sprintf(buf, "SIGRT_%u", s - ASM_SIGRTMIN); + return buf; + } #endif + } sprintf(buf, "%d", sig); return buf; } @@ -179,20 +164,21 @@ popcount32(const uint32_t *a, unsigned int size) return count; } -static const char * +const char * sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) { /* - * The maximum number of signal names to be printed is NSIG * 2 / 3. + * The maximum number of signal names to be printed + * is NSIG_BYTES * 8 * 2 / 3. * Most of signal names have length 7, * average length of signal names is less than 7. * The length of prefix string does not exceed 16. */ - static char outstr[128 + 8 * (NSIG * 2 / 3)]; + static char outstr[128 + 8 * (NSIG_BYTES * 8 * 2 / 3)]; char *s; const uint32_t *mask; - uint32_t inverted_mask[NSIG / 32]; + uint32_t inverted_mask[NSIG_BYTES / 4]; unsigned int size; int i; char sep; @@ -201,10 +187,10 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) mask = sig_mask; /* length of signal mask in 4-byte words */ - size = (bytes >= NSIG / 8) ? NSIG / 32 : (bytes + 3) / 4; + size = (bytes >= NSIG_BYTES) ? NSIG_BYTES / 4 : (bytes + 3) / 4; /* check whether 2/3 or more bits are set */ - if (popcount32(mask, size) >= size * 32 * 2 / 3) { + if (popcount32(mask, size) >= size * (4 * 8) * 2 / 3) { /* show those signals that are NOT in the mask */ unsigned int j; for (j = 0; j < size; ++j) @@ -214,15 +200,15 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) } sep = '['; - for (i = 0; (i = next_set_bit(mask, i, size * 32)) >= 0; ) { + for (i = 0; (i = next_set_bit(mask, i, size * (4 * 8))) >= 0; ) { ++i; *s++ = sep; - if (i < nsignals) { + if ((unsigned) i < nsignals) { s = stpcpy(s, signalent[i] + 3); } -#ifdef SIGRTMIN - else if (i >= __SIGRTMIN && i <= __SIGRTMAX) { - s += sprintf(s, "RT_%u", i - __SIGRTMIN); +#ifdef ASM_SIGRTMAX + else if (i >= ASM_SIGRTMIN && i <= ASM_SIGRTMAX) { + s += sprintf(s, "RT_%u", i - ASM_SIGRTMIN); } #endif else { @@ -237,9 +223,6 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) return outstr; } -#define tprintsigmask_addr(prefix, mask) \ - tprints(sprintsigmask_n((prefix), (mask), sizeof(mask))) - #define sprintsigmask_val(prefix, mask) \ sprintsigmask_n((prefix), &(mask), sizeof(mask)) @@ -252,285 +235,32 @@ printsignal(int nr) tprints(signame(nr)); } -void -print_sigset_addr_len(struct tcb *tcp, long addr, long len) +static void +print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len, const unsigned int min_len) { - char mask[NSIG / 8]; - - if (!addr) { - tprints("NULL"); - return; - } - /* Here len is usually equals NSIG / 8 or current_wordsize. + /* + * Here len is usually equal to NSIG_BYTES or current_wordsize. * But we code this defensively: */ - if (len < 0) { - bad: - tprintf("%#lx", addr); + if (len < min_len || len > NSIG_BYTES) { + printaddr(addr); return; } - if (len >= NSIG / 8) - len = NSIG / 8; - else - len = (len + 3) & ~3; - - if (umoven(tcp, addr, len, mask) < 0) - goto bad; - tprints(sprintsigmask_n("", mask, len)); -} - -#ifndef ILL_ILLOPC -#define ILL_ILLOPC 1 /* illegal opcode */ -#define ILL_ILLOPN 2 /* illegal operand */ -#define ILL_ILLADR 3 /* illegal addressing mode */ -#define ILL_ILLTRP 4 /* illegal trap */ -#define ILL_PRVOPC 5 /* privileged opcode */ -#define ILL_PRVREG 6 /* privileged register */ -#define ILL_COPROC 7 /* coprocessor error */ -#define ILL_BADSTK 8 /* internal stack error */ -#define FPE_INTDIV 1 /* integer divide by zero */ -#define FPE_INTOVF 2 /* integer overflow */ -#define FPE_FLTDIV 3 /* floating point divide by zero */ -#define FPE_FLTOVF 4 /* floating point overflow */ -#define FPE_FLTUND 5 /* floating point underflow */ -#define FPE_FLTRES 6 /* floating point inexact result */ -#define FPE_FLTINV 7 /* floating point invalid operation */ -#define FPE_FLTSUB 8 /* subscript out of range */ -#define SEGV_MAPERR 1 /* address not mapped to object */ -#define SEGV_ACCERR 2 /* invalid permissions for mapped object */ -#define BUS_ADRALN 1 /* invalid address alignment */ -#define BUS_ADRERR 2 /* non-existant physical address */ -#define BUS_OBJERR 3 /* object specific hardware error */ -#define SYS_SECCOMP 1 /* seccomp triggered */ -#define TRAP_BRKPT 1 /* process breakpoint */ -#define TRAP_TRACE 2 /* process trace trap */ -#define CLD_EXITED 1 /* child has exited */ -#define CLD_KILLED 2 /* child was killed */ -#define CLD_DUMPED 3 /* child terminated abnormally */ -#define CLD_TRAPPED 4 /* traced child has trapped */ -#define CLD_STOPPED 5 /* child has stopped */ -#define CLD_CONTINUED 6 /* stopped child has continued */ -#define POLL_IN 1 /* data input available */ -#define POLL_OUT 2 /* output buffers available */ -#define POLL_MSG 3 /* input message available */ -#define POLL_ERR 4 /* i/o error */ -#define POLL_PRI 5 /* high priority input available */ -#define POLL_HUP 6 /* device disconnected */ -#define SI_KERNEL 0x80 /* sent by kernel */ -#define SI_USER 0 /* sent by kill, sigsend, raise */ -#define SI_QUEUE -1 /* sent by sigqueue */ -#define SI_TIMER -2 /* sent by timer expiration */ -#define SI_MESGQ -3 /* sent by real time mesq state change */ -#define SI_ASYNCIO -4 /* sent by AIO completion */ -#define SI_SIGIO -5 /* sent by SIGIO */ -#define SI_TKILL -6 /* sent by tkill */ -#define SI_DETHREAD -7 /* sent by execve killing subsidiary threads */ -#define SI_ASYNCNL -60 /* sent by asynch name lookup completion */ -#endif - -#ifndef SI_FROMUSER -# define SI_FROMUSER(sip) ((sip)->si_code <= 0) -#endif - -#include "xlat/siginfo_codes.h" -#include "xlat/sigill_codes.h" -#include "xlat/sigfpe_codes.h" -#include "xlat/sigtrap_codes.h" -#include "xlat/sigchld_codes.h" -#include "xlat/sigpoll_codes.h" -#include "xlat/sigprof_codes.h" - -#ifdef SIGEMT -#include "xlat/sigemt_codes.h" -#endif - -#include "xlat/sigsegv_codes.h" -#include "xlat/sigbus_codes.h" - -#ifndef SYS_SECCOMP -# define SYS_SECCOMP 1 -#endif -#include "xlat/sigsys_codes.h" - -static void -printsigsource(const siginfo_t *sip) -{ - tprintf(", si_pid=%lu, si_uid=%lu", - (unsigned long) sip->si_pid, - (unsigned long) sip->si_uid); -} - -static void -printsigval(const siginfo_t *sip, int verbose) -{ - if (!verbose) - tprints(", ..."); - else - tprintf(", si_value={int=%u, ptr=%#lx}", - sip->si_int, - (unsigned long) sip->si_ptr); -} - -void -printsiginfo(siginfo_t *sip, int verbose) -{ - const char *code; - - if (sip->si_signo == 0) { - tprints("{}"); + int mask[NSIG_BYTES / sizeof(int)] = {}; + if (umoven_or_printaddr(tcp, addr, len, mask)) return; - } - tprints("{si_signo="); - printsignal(sip->si_signo); - code = xlookup(siginfo_codes, sip->si_code); - if (!code) { - switch (sip->si_signo) { - case SIGTRAP: - code = xlookup(sigtrap_codes, sip->si_code); - break; - case SIGCHLD: - code = xlookup(sigchld_codes, sip->si_code); - break; - case SIGPOLL: - code = xlookup(sigpoll_codes, sip->si_code); - break; - case SIGPROF: - code = xlookup(sigprof_codes, sip->si_code); - break; - case SIGILL: - code = xlookup(sigill_codes, sip->si_code); - break; -#ifdef SIGEMT - case SIGEMT: - code = xlookup(sigemt_codes, sip->si_code); - break; -#endif - case SIGFPE: - code = xlookup(sigfpe_codes, sip->si_code); - break; - case SIGSEGV: - code = xlookup(sigsegv_codes, sip->si_code); - break; - case SIGBUS: - code = xlookup(sigbus_codes, sip->si_code); - break; - case SIGSYS: - code = xlookup(sigsys_codes, sip->si_code); - break; - } - } - if (code) - tprintf(", si_code=%s", code); - else - tprintf(", si_code=%#x", sip->si_code); -#ifdef SI_NOINFO - if (sip->si_code != SI_NOINFO) -#endif - { - if (sip->si_errno) { - if (sip->si_errno < 0 || sip->si_errno >= nerrnos) - tprintf(", si_errno=%d", sip->si_errno); - else - tprintf(", si_errno=%s", - errnoent[sip->si_errno]); - } -#ifdef SI_FROMUSER - if (SI_FROMUSER(sip)) { - switch (sip->si_code) { -#ifdef SI_USER - case SI_USER: - printsigsource(sip); - break; -#endif -#ifdef SI_TKILL - case SI_TKILL: - printsigsource(sip); - break; -#endif -#ifdef SI_TIMER - case SI_TIMER: - tprintf(", si_timerid=%#x, si_overrun=%d", - sip->si_timerid, sip->si_overrun); - printsigval(sip, verbose); - break; -#endif - default: - printsigsource(sip); - if (sip->si_ptr) - printsigval(sip, verbose); - break; - } - } - else -#endif /* SI_FROMUSER */ - { - switch (sip->si_signo) { - case SIGCHLD: - printsigsource(sip); - tprints(", si_status="); - if (sip->si_code == CLD_EXITED) - tprintf("%d", sip->si_status); - else - printsignal(sip->si_status); - if (!verbose) - tprints(", ..."); - else - tprintf(", si_utime=%llu, si_stime=%llu", - (unsigned long long) sip->si_utime, - (unsigned long long) sip->si_stime); - break; - case SIGILL: case SIGFPE: - case SIGSEGV: case SIGBUS: - tprintf(", si_addr=%#lx", - (unsigned long) sip->si_addr); - break; - case SIGPOLL: - switch (sip->si_code) { - case POLL_IN: case POLL_OUT: case POLL_MSG: - tprintf(", si_band=%ld", - (long) sip->si_band); - break; - } - break; -#ifdef HAVE_SIGINFO_T_SI_SYSCALL - case SIGSYS: - tprintf(", si_call_addr=%#lx, si_syscall=%d, si_arch=%u", - (unsigned long) sip->si_call_addr, - sip->si_syscall, sip->si_arch); - break; -#endif - default: - if (sip->si_pid || sip->si_uid) - printsigsource(sip); - if (sip->si_ptr) - printsigval(sip, verbose); - } - } - } - tprints("}"); + tprints(sprintsigmask_n("", mask, len)); } void -printsiginfo_at(struct tcb *tcp, long addr) +print_sigset_addr_len(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len) { - siginfo_t si; - if (!addr) { - tprints("NULL"); - return; - } - if (syserror(tcp)) { - tprintf("%#lx", addr); - return; - } - if (umove(tcp, addr, &si) < 0) { - tprints("{???}"); - return; - } - printsiginfo(&si, verbose(tcp)); + print_sigset_addr_len_limit(tcp, addr, len, current_wordsize); } -int -sys_sigsetmask(struct tcb *tcp) +SYS_FUNC(sigsetmask) { if (entering(tcp)) { tprintsigmask_val("", tcp->u_arg[0]); @@ -542,99 +272,77 @@ sys_sigsetmask(struct tcb *tcp) return 0; } -#ifdef HAVE_SIGACTION - struct old_sigaction { /* sa_handler may be a libc #define, need to use other name: */ #ifdef MIPS unsigned int sa_flags; - void (*__sa_handler)(int); + unsigned long sa_handler__; /* Kernel treats sa_mask as an array of longs. */ - unsigned long sa_mask[NSIG / sizeof(long) ? NSIG / sizeof(long) : 1]; + unsigned long sa_mask[NSIG / sizeof(long)]; #else - void (*__sa_handler)(int); + unsigned long sa_handler__; unsigned long sa_mask; unsigned long sa_flags; - void (*sa_restorer)(void); #endif /* !MIPS */ +#if HAVE_SA_RESTORER + unsigned long sa_restorer; +#endif }; struct old_sigaction32 { /* sa_handler may be a libc #define, need to use other name: */ - uint32_t __sa_handler; + uint32_t sa_handler__; uint32_t sa_mask; uint32_t sa_flags; +#if HAVE_SA_RESTORER uint32_t sa_restorer; +#endif }; static void -decode_old_sigaction(struct tcb *tcp, long addr) +decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) { struct old_sigaction sa; - int r; - - if (!addr) { - tprints("NULL"); - return; - } - if (!verbose(tcp) || (exiting(tcp) && syserror(tcp))) { - tprintf("%#lx", addr); - return; - } -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize != sizeof(sa.__sa_handler) && current_wordsize == 4) { +#ifndef current_wordsize + if (current_wordsize < sizeof(sa.sa_handler__)) { struct old_sigaction32 sa32; - r = umove(tcp, addr, &sa32); - if (r >= 0) { - memset(&sa, 0, sizeof(sa)); - sa.__sa_handler = (void*)(uintptr_t)sa32.__sa_handler; - sa.sa_flags = sa32.sa_flags; - sa.sa_restorer = (void*)(uintptr_t)sa32.sa_restorer; - sa.sa_mask = sa32.sa_mask; - } + + if (umove_or_printaddr(tcp, addr, &sa32)) + return; + + memset(&sa, 0, sizeof(sa)); + sa.sa_handler__ = sa32.sa_handler__; + sa.sa_flags = sa32.sa_flags; +#if HAVE_SA_RESTORER && defined SA_RESTORER + sa.sa_restorer = sa32.sa_restorer; +#endif + sa.sa_mask = sa32.sa_mask; } else #endif - { - r = umove(tcp, addr, &sa); - } - if (r < 0) { - tprints("{...}"); + if (umove_or_printaddr(tcp, addr, &sa)) return; - } - /* Architectures using function pointers, like - * hppa, may need to manipulate the function pointer - * to compute the result of a comparison. However, - * the __sa_handler function pointer exists only in - * the address space of the traced process, and can't - * be manipulated by strace. In order to prevent the - * compiler from generating code to manipulate - * __sa_handler we cast the function pointers to long. */ - if ((long)sa.__sa_handler == (long)SIG_ERR) - tprints("{SIG_ERR, "); - else if ((long)sa.__sa_handler == (long)SIG_DFL) - tprints("{SIG_DFL, "); - else if ((long)sa.__sa_handler == (long)SIG_IGN) - tprints("{SIG_IGN, "); - else - tprintf("{%#lx, ", (long) sa.__sa_handler); + tprints("{sa_handler="); + print_sa_handler(sa.sa_handler__); + tprints(", sa_mask="); #ifdef MIPS tprintsigmask_addr("", sa.sa_mask); #else tprintsigmask_val("", sa.sa_mask); #endif - tprints(", "); + tprints(", sa_flags="); printflags(sigact_flags, sa.sa_flags, "SA_???"); -#ifdef SA_RESTORER - if (sa.sa_flags & SA_RESTORER) - tprintf(", %p", sa.sa_restorer); +#if HAVE_SA_RESTORER && defined SA_RESTORER + if (sa.sa_flags & SA_RESTORER) { + tprints(", sa_restorer="); + printaddr(sa.sa_restorer); + } #endif tprints("}"); } -int -sys_sigaction(struct tcb *tcp) +SYS_FUNC(sigaction) { if (entering(tcp)) { printsignal(tcp->u_arg[0]); @@ -646,307 +354,21 @@ sys_sigaction(struct tcb *tcp) return 0; } -int -sys_signal(struct tcb *tcp) +SYS_FUNC(signal) { if (entering(tcp)) { printsignal(tcp->u_arg[0]); tprints(", "); - switch (tcp->u_arg[1]) { - case (long) SIG_ERR: - tprints("SIG_ERR"); - break; - case (long) SIG_DFL: - tprints("SIG_DFL"); - break; - case (long) SIG_IGN: - tprints("SIG_IGN"); - break; - default: - tprintf("%#lx", tcp->u_arg[1]); - } + print_sa_handler(tcp->u_arg[1]); return 0; - } - else if (!syserror(tcp)) { - switch (tcp->u_rval) { - case (long) SIG_ERR: - tcp->auxstr = "SIG_ERR"; break; - case (long) SIG_DFL: - tcp->auxstr = "SIG_DFL"; break; - case (long) SIG_IGN: - tcp->auxstr = "SIG_IGN"; break; - default: - tcp->auxstr = NULL; - } + } else if (!syserror(tcp)) { + tcp->auxstr = get_sa_handler_str(tcp->u_rval); return RVAL_HEX | RVAL_STR; } return 0; } -#endif /* HAVE_SIGACTION */ - -int -sys_sigreturn(struct tcb *tcp) -{ -#if defined(ARM) - if (entering(tcp)) { - struct arm_sigcontext { - unsigned long trap_no; - unsigned long error_code; - unsigned long oldmask; - unsigned long arm_r0; - unsigned long arm_r1; - unsigned long arm_r2; - unsigned long arm_r3; - unsigned long arm_r4; - unsigned long arm_r5; - unsigned long arm_r6; - unsigned long arm_r7; - unsigned long arm_r8; - unsigned long arm_r9; - unsigned long arm_r10; - unsigned long arm_fp; - unsigned long arm_ip; - unsigned long arm_sp; - unsigned long arm_lr; - unsigned long arm_pc; - unsigned long arm_cpsr; - unsigned long fault_address; - }; - struct arm_ucontext { - unsigned long uc_flags; - unsigned long uc_link; /* struct ucontext* */ - /* The next three members comprise stack_t struct: */ - unsigned long ss_sp; /* void* */ - unsigned long ss_flags; /* int */ - unsigned long ss_size; /* size_t */ - struct arm_sigcontext sc; - /* These two members are sigset_t: */ - unsigned long uc_sigmask[2]; - /* more fields follow, which we aren't interested in */ - }; - struct arm_ucontext uc; - if (umove(tcp, arm_regs.ARM_sp, &uc) < 0) - return 0; - /* - * Kernel fills out uc.sc.oldmask too when it sets up signal stack, - * but for sigmask restore, sigreturn syscall uses uc.uc_sigmask instead. - */ - tprintsigmask_addr(") (mask ", uc.uc_sigmask); - } -#elif defined(S390) || defined(S390X) - if (entering(tcp)) { - long usp; - struct sigcontext sc; - if (upeek(tcp->pid, PT_GPR15, &usp) < 0) - return 0; - if (umove(tcp, usp + __SIGNAL_FRAMESIZE, &sc) < 0) - return 0; - tprintsigmask_addr(") (mask ", sc.oldmask); - } -#elif defined(I386) || defined(X86_64) -# if defined(X86_64) - if (current_personality == 0) /* 64-bit */ - return 0; -# endif - if (entering(tcp)) { - struct i386_sigcontext_struct { - uint16_t gs, __gsh; - uint16_t fs, __fsh; - uint16_t es, __esh; - uint16_t ds, __dsh; - uint32_t edi; - uint32_t esi; - uint32_t ebp; - uint32_t esp; - uint32_t ebx; - uint32_t edx; - uint32_t ecx; - uint32_t eax; - uint32_t trapno; - uint32_t err; - uint32_t eip; - uint16_t cs, __csh; - uint32_t eflags; - uint32_t esp_at_signal; - uint16_t ss, __ssh; - uint32_t i387; - uint32_t oldmask; - uint32_t cr2; - }; - struct i386_fpstate { - uint32_t cw; - uint32_t sw; - uint32_t tag; - uint32_t ipoff; - uint32_t cssel; - uint32_t dataoff; - uint32_t datasel; - uint8_t st[8][10]; /* 8*10 bytes: FP regs */ - uint16_t status; - uint16_t magic; - uint32_t fxsr_env[6]; - uint32_t mxcsr; - uint32_t reserved; - uint8_t stx[8][16]; /* 8*16 bytes: FP regs, each padded to 16 bytes */ - uint8_t xmm[8][16]; /* 8 XMM regs */ - uint32_t padding1[44]; - uint32_t padding2[12]; /* union with struct _fpx_sw_bytes */ - }; - struct { - struct i386_sigcontext_struct sc; - struct i386_fpstate fp; - uint32_t extramask[1]; - } signal_stack; - /* On i386, sc is followed on stack by struct fpstate - * and after it an additional u32 extramask[1] which holds - * upper half of the mask. - */ - uint32_t sigmask[2]; - if (umove(tcp, *i386_esp_ptr, &signal_stack) < 0) - return 0; - sigmask[0] = signal_stack.sc.oldmask; - sigmask[1] = signal_stack.extramask[0]; - tprintsigmask_addr(") (mask ", sigmask); - } -#elif defined(IA64) - if (entering(tcp)) { - struct sigcontext sc; - long sp; - /* offset of sigcontext in the kernel's sigframe structure: */ -# define SIGFRAME_SC_OFFSET 0x90 - if (upeek(tcp->pid, PT_R12, &sp) < 0) - return 0; - if (umove(tcp, sp + 16 + SIGFRAME_SC_OFFSET, &sc) < 0) - return 0; - tprintsigmask_val(") (mask ", sc.sc_mask); - } -#elif defined(POWERPC) - if (entering(tcp)) { - long esp; - struct sigcontext sc; - - esp = ppc_regs.gpr[1]; - - /* Skip dummy stack frame. */ -#ifdef POWERPC64 - if (current_personality == 0) - esp += 128; - else - esp += 64; -#else - esp += 64; -#endif - if (umove(tcp, esp, &sc) < 0) - return 0; - tprintsigmask_val(") (mask ", sc.oldmask); - } -#elif defined(M68K) - if (entering(tcp)) { - long usp; - struct sigcontext sc; - if (upeek(tcp->pid, 4*PT_USP, &usp) < 0) - return 0; - if (umove(tcp, usp, &sc) < 0) - return 0; - tprintsigmask_val(") (mask ", sc.sc_mask); - } -#elif defined(ALPHA) - if (entering(tcp)) { - long fp; - struct sigcontext sc; - if (upeek(tcp->pid, REG_FP, &fp) < 0) - return 0; - if (umove(tcp, fp, &sc) < 0) - return 0; - tprintsigmask_val(") (mask ", sc.sc_mask); - } -#elif defined(SPARC) || defined(SPARC64) - if (entering(tcp)) { - long i1; - m_siginfo_t si; - i1 = sparc_regs.u_regs[U_REG_O1]; - if (umove(tcp, i1, &si) < 0) { - perror_msg("sigreturn: umove"); - return 0; - } - tprintsigmask_val(") (mask ", si.si_mask); - } -#elif defined(LINUX_MIPSN32) || defined(LINUX_MIPSN64) - /* This decodes rt_sigreturn. The 64-bit ABIs do not have - sigreturn. */ - if (entering(tcp)) { - long sp; - struct ucontext uc; - if (upeek(tcp->pid, REG_SP, &sp) < 0) - return 0; - /* There are six words followed by a 128-byte siginfo. */ - sp = sp + 6 * 4 + 128; - if (umove(tcp, sp, &uc) < 0) - return 0; - tprintsigmask_val(") (mask ", uc.uc_sigmask); - } -#elif defined(MIPS) - if (entering(tcp)) { - long sp; - struct pt_regs regs; - m_siginfo_t si; - if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)®s, 0) < 0) { - perror_msg("sigreturn: PTRACE_GETREGS"); - return 0; - } - sp = regs.regs[29]; - if (umove(tcp, sp, &si) < 0) - return 0; - tprintsigmask_val(") (mask ", si.si_mask); - } -#elif defined(CRISV10) || defined(CRISV32) - if (entering(tcp)) { - struct sigcontext sc; - long regs[PT_MAX+1]; - if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long)regs) < 0) { - perror_msg("sigreturn: PTRACE_GETREGS"); - return 0; - } - if (umove(tcp, regs[PT_USP], &sc) < 0) - return 0; - tprintsigmask_val(") (mask ", sc.oldmask); - } -#elif defined(TILE) - if (entering(tcp)) { - struct ucontext uc; - - /* offset of ucontext in the kernel's sigframe structure */ -# define SIGFRAME_UC_OFFSET C_ABI_SAVE_AREA_SIZE + sizeof(siginfo_t) - if (umove(tcp, tile_regs.sp + SIGFRAME_UC_OFFSET, &uc) < 0) - return 0; - tprintsigmask_val(") (mask ", uc.uc_sigmask); - } -#elif defined(MICROBLAZE) - /* TODO: Verify that this is correct... */ - if (entering(tcp)) { - struct sigcontext sc; - long sp; - /* Read r1, the stack pointer. */ - if (upeek(tcp->pid, 1 * 4, &sp) < 0) - return 0; - if (umove(tcp, sp, &sc) < 0) - return 0; - tprintsigmask_val(") (mask ", sc.oldmask); - } -#elif defined(XTENSA) - /* Xtensa only has rt_sys_sigreturn */ -#elif defined(ARC) - /* ARC syscall ABI only supports rt_sys_sigreturn */ -#else -# warning No sys_sigreturn() for this architecture -# warning (no problem, just a reminder :-) -#endif - return 0; -} - -int -sys_siggetmask(struct tcb *tcp) +SYS_FUNC(siggetmask) { if (exiting(tcp)) { tcp->auxstr = sprintsigmask_val("mask ", tcp->u_rval); @@ -954,79 +376,15 @@ sys_siggetmask(struct tcb *tcp) return RVAL_HEX | RVAL_STR; } -int -sys_sigsuspend(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintsigmask_val("", tcp->u_arg[2]); - } - return 0; -} - -#if !defined SS_ONSTACK -#define SS_ONSTACK 1 -#define SS_DISABLE 2 -#endif - -#include "xlat/sigaltstack_flags.h" - -static void -print_stack_t(struct tcb *tcp, unsigned long addr) +SYS_FUNC(sigsuspend) { - stack_t ss; - int r; - - if (!addr) { - tprints("NULL"); - return; - } - -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize != sizeof(ss.ss_sp) && current_wordsize == 4) { - struct { - uint32_t ss_sp; - int32_t ss_flags; - uint32_t ss_size; - } ss32; - r = umove(tcp, addr, &ss32); - if (r >= 0) { - memset(&ss, 0, sizeof(ss)); - ss.ss_sp = (void*)(unsigned long) ss32.ss_sp; - ss.ss_flags = ss32.ss_flags; - ss.ss_size = (unsigned long) ss32.ss_size; - } - } else -#endif - { - r = umove(tcp, addr, &ss); - } - if (r < 0) { - tprintf("%#lx", addr); - } else { - tprintf("{ss_sp=%#lx, ss_flags=", (unsigned long) ss.ss_sp); - printflags(sigaltstack_flags, ss.ss_flags, "SS_???"); - tprintf(", ss_size=%lu}", (unsigned long) ss.ss_size); - } -} + tprintsigmask_val("", tcp->u_arg[2]); -int -sys_sigaltstack(struct tcb *tcp) -{ - if (entering(tcp)) { - print_stack_t(tcp, tcp->u_arg[0]); - } - else { - tprints(", "); - print_stack_t(tcp, tcp->u_arg[1]); - } - return 0; + return RVAL_DECODED; } -#ifdef HAVE_SIGACTION - /* "Old" sigprocmask, which operates with word-sized signal masks */ -int -sys_sigprocmask(struct tcb *tcp) +SYS_FUNC(sigprocmask) { # ifdef ALPHA if (entering(tcp)) { @@ -1056,58 +414,41 @@ sys_sigprocmask(struct tcb *tcp) tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[2]); - else - print_sigset_addr_len(tcp, tcp->u_arg[2], current_wordsize); + print_sigset_addr_len(tcp, tcp->u_arg[2], current_wordsize); } # endif /* !ALPHA */ return 0; } -#endif /* HAVE_SIGACTION */ - -int -sys_kill(struct tcb *tcp) +SYS_FUNC(kill) { - if (entering(tcp)) { - tprintf("%ld, %s", - widen_to_long(tcp->u_arg[0]), - signame(tcp->u_arg[1]) - ); - } - return 0; + tprintf("%d, %s", + (int) tcp->u_arg[0], + signame(tcp->u_arg[1])); + + return RVAL_DECODED; } -int -sys_tgkill(struct tcb *tcp) +SYS_FUNC(tgkill) { - if (entering(tcp)) { - tprintf("%ld, %ld, %s", - widen_to_long(tcp->u_arg[0]), - widen_to_long(tcp->u_arg[1]), - signame(tcp->u_arg[2]) - ); - } - return 0; + tprintf("%d, %d, %s", + (int) tcp->u_arg[0], + (int) tcp->u_arg[1], + signame(tcp->u_arg[2])); + + return RVAL_DECODED; } -int -sys_sigpending(struct tcb *tcp) +SYS_FUNC(sigpending) { - if (exiting(tcp)) { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else - print_sigset_addr_len(tcp, tcp->u_arg[0], current_wordsize); - } + if (exiting(tcp)) + print_sigset_addr_len(tcp, tcp->u_arg[0], current_wordsize); return 0; } -int -sys_rt_sigprocmask(struct tcb *tcp) +SYS_FUNC(rt_sigprocmask) { - /* Note: arg[3] is the length of the sigset. Kernel requires NSIG / 8 */ + /* Note: arg[3] is the length of the sigset. Kernel requires NSIG_BYTES */ if (entering(tcp)) { printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???"); tprints(", "); @@ -1115,11 +456,8 @@ sys_rt_sigprocmask(struct tcb *tcp) tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[2]); - else - print_sigset_addr_len(tcp, tcp->u_arg[2], tcp->u_arg[3]); - tprintf(", %lu", tcp->u_arg[3]); + print_sigset_addr_len(tcp, tcp->u_arg[2], tcp->u_arg[3]); + tprintf(", %" PRI_klu, tcp->u_arg[3]); } return 0; } @@ -1130,104 +468,84 @@ struct new_sigaction /* sa_handler may be a libc #define, need to use other name: */ #ifdef MIPS unsigned int sa_flags; - void (*__sa_handler)(int); + unsigned long sa_handler__; #else - void (*__sa_handler)(int); + unsigned long sa_handler__; unsigned long sa_flags; -# if !defined(ALPHA) && !defined(HPPA) && !defined(IA64) - void (*sa_restorer)(void); -# endif /* !ALPHA && !HPPA && !IA64 */ #endif /* !MIPS */ +#if HAVE_SA_RESTORER + unsigned long sa_restorer; +#endif /* Kernel treats sa_mask as an array of longs. */ - unsigned long sa_mask[NSIG / sizeof(long) ? NSIG / sizeof(long) : 1]; + unsigned long sa_mask[NSIG / sizeof(long)]; }; /* Same for i386-on-x86_64 and similar cases */ struct new_sigaction32 { - uint32_t __sa_handler; + uint32_t sa_handler__; uint32_t sa_flags; +#if HAVE_SA_RESTORER uint32_t sa_restorer; - uint32_t sa_mask[2 * (NSIG / sizeof(long) ? NSIG / sizeof(long) : 1)]; +#endif + uint32_t sa_mask[2 * (NSIG / sizeof(long))]; }; static void -decode_new_sigaction(struct tcb *tcp, long addr) +decode_new_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) { struct new_sigaction sa; - int r; - if (!addr) { - tprints("NULL"); - return; - } - if (!verbose(tcp) || (exiting(tcp) && syserror(tcp))) { - tprintf("%#lx", addr); - return; - } -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize != sizeof(sa.sa_flags) && current_wordsize == 4) { +#ifndef current_wordsize + if (current_wordsize < sizeof(sa.sa_handler__)) { struct new_sigaction32 sa32; - r = umove(tcp, addr, &sa32); - if (r >= 0) { - memset(&sa, 0, sizeof(sa)); - sa.__sa_handler = (void*)(unsigned long)sa32.__sa_handler; - sa.sa_flags = sa32.sa_flags; - sa.sa_restorer = (void*)(unsigned long)sa32.sa_restorer; - /* Kernel treats sa_mask as an array of longs. - * For 32-bit process, "long" is uint32_t, thus, for example, - * 32th bit in sa_mask will end up as bit 0 in sa_mask[1]. - * But for (64-bit) kernel, 32th bit in sa_mask is - * 32th bit in 0th (64-bit) long! - * For little-endian, it's the same. - * For big-endian, we swap 32-bit words. - */ - sa.sa_mask[0] = sa32.sa_mask[0] + ((long)(sa32.sa_mask[1]) << 32); - } + + if (umove_or_printaddr(tcp, addr, &sa32)) + return; + + memset(&sa, 0, sizeof(sa)); + sa.sa_handler__ = sa32.sa_handler__; + sa.sa_flags = sa32.sa_flags; +#if HAVE_SA_RESTORER && defined SA_RESTORER + sa.sa_restorer = sa32.sa_restorer; +#endif + /* Kernel treats sa_mask as an array of longs. + * For 32-bit process, "long" is uint32_t, thus, for example, + * 32th bit in sa_mask will end up as bit 0 in sa_mask[1]. + * But for (64-bit) kernel, 32th bit in sa_mask is + * 32th bit in 0th (64-bit) long! + * For little-endian, it's the same. + * For big-endian, we swap 32-bit words. + */ + sa.sa_mask[0] = ULONG_LONG(sa32.sa_mask[0], sa32.sa_mask[1]); } else #endif - { - r = umove(tcp, addr, &sa); - } - if (r < 0) { - tprints("{...}"); + if (umove_or_printaddr(tcp, addr, &sa)) return; - } - /* Architectures using function pointers, like - * hppa, may need to manipulate the function pointer - * to compute the result of a comparison. However, - * the __sa_handler function pointer exists only in - * the address space of the traced process, and can't - * be manipulated by strace. In order to prevent the - * compiler from generating code to manipulate - * __sa_handler we cast the function pointers to long. */ - if ((long)sa.__sa_handler == (long)SIG_ERR) - tprints("{SIG_ERR, "); - else if ((long)sa.__sa_handler == (long)SIG_DFL) - tprints("{SIG_DFL, "); - else if ((long)sa.__sa_handler == (long)SIG_IGN) - tprints("{SIG_IGN, "); - else - tprintf("{%#lx, ", (long) sa.__sa_handler); + + tprints("{sa_handler="); + print_sa_handler(sa.sa_handler__); + tprints(", sa_mask="); /* * Sigset size is in tcp->u_arg[4] (SPARC) * or in tcp->u_arg[3] (all other), * but kernel won't handle sys_rt_sigaction * with wrong sigset size (just returns EINVAL instead). - * We just fetch the right size, which is NSIG / 8. + * We just fetch the right size, which is NSIG_BYTES. */ tprintsigmask_val("", sa.sa_mask); - tprints(", "); + tprints(", sa_flags="); printflags(sigact_flags, sa.sa_flags, "SA_???"); -#ifdef SA_RESTORER - if (sa.sa_flags & SA_RESTORER) - tprintf(", %p", sa.sa_restorer); +#if HAVE_SA_RESTORER && defined SA_RESTORER + if (sa.sa_flags & SA_RESTORER) { + tprints(", sa_restorer="); + printaddr(sa.sa_restorer); + } #endif tprints("}"); } -int -sys_rt_sigaction(struct tcb *tcp) +SYS_FUNC(rt_sigaction) { if (entering(tcp)) { printsignal(tcp->u_arg[0]); @@ -1237,133 +555,106 @@ sys_rt_sigaction(struct tcb *tcp) } else { decode_new_sigaction(tcp, tcp->u_arg[2]); #if defined(SPARC) || defined(SPARC64) - tprintf(", %#lx, %lu", tcp->u_arg[3], tcp->u_arg[4]); + tprintf(", %#" PRI_klx ", %" PRI_klu, tcp->u_arg[3], tcp->u_arg[4]); #elif defined(ALPHA) - tprintf(", %lu, %#lx", tcp->u_arg[3], tcp->u_arg[4]); + tprintf(", %" PRI_klu ", %#" PRI_klx, tcp->u_arg[3], tcp->u_arg[4]); #else - tprintf(", %lu", tcp->u_arg[3]); + tprintf(", %" PRI_klu, tcp->u_arg[3]); #endif } return 0; } -int -sys_rt_sigpending(struct tcb *tcp) +SYS_FUNC(rt_sigpending) { if (exiting(tcp)) { /* * One of the few syscalls where sigset size (arg[1]) - * is allowed to be <= NSIG / 8, not strictly ==. + * is allowed to be <= NSIG_BYTES, not strictly ==. * This allows non-rt sigpending() syscall * to reuse rt_sigpending() code in kernel. */ - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else - print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[1]); - tprintf(", %lu", tcp->u_arg[1]); + print_sigset_addr_len_limit(tcp, tcp->u_arg[0], + tcp->u_arg[1], 1); + tprintf(", %" PRI_klu, tcp->u_arg[1]); } return 0; } -int -sys_rt_sigsuspend(struct tcb *tcp) +SYS_FUNC(rt_sigsuspend) { - if (entering(tcp)) { - /* NB: kernel requires arg[1] == NSIG / 8 */ - print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[1]); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; + /* NB: kernel requires arg[1] == NSIG_BYTES */ + print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[1]); + tprintf(", %" PRI_klu, tcp->u_arg[1]); + + return RVAL_DECODED; } static void -print_sigqueueinfo(struct tcb *tcp, int sig, unsigned long uinfo) +print_sigqueueinfo(struct tcb *const tcp, const int sig, + const kernel_ulong_t addr) { printsignal(sig); tprints(", "); - printsiginfo_at(tcp, uinfo); + printsiginfo_at(tcp, addr); } -int -sys_rt_sigqueueinfo(struct tcb *tcp) +SYS_FUNC(rt_sigqueueinfo) { - if (entering(tcp)) { - tprintf("%lu, ", tcp->u_arg[0]); - print_sigqueueinfo(tcp, tcp->u_arg[1], tcp->u_arg[2]); - } - return 0; -} + tprintf("%d, ", (int) tcp->u_arg[0]); + print_sigqueueinfo(tcp, tcp->u_arg[1], tcp->u_arg[2]); -int -sys_rt_tgsigqueueinfo(struct tcb *tcp) -{ - if (entering(tcp)) { - tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); - print_sigqueueinfo(tcp, tcp->u_arg[2], tcp->u_arg[3]); - } - return 0; + return RVAL_DECODED; } -int sys_rt_sigtimedwait(struct tcb *tcp) +SYS_FUNC(rt_tgsigqueueinfo) { - /* NB: kernel requires arg[3] == NSIG / 8 */ - if (entering(tcp)) { - print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[3]); - tprints(", "); - /* This is the only "return" parameter, */ - if (tcp->u_arg[1] != 0) - return 0; - /* ... if it's NULL, can decode all on entry */ - tprints("NULL, "); - } - else if (tcp->u_arg[1] != 0) { - /* syscall exit, and u_arg[1] wasn't NULL */ - printsiginfo_at(tcp, tcp->u_arg[1]); - tprints(", "); - } - else { - /* syscall exit, and u_arg[1] was NULL */ - return 0; - } - print_timespec(tcp, tcp->u_arg[2]); - tprintf(", %lu", tcp->u_arg[3]); - return 0; -}; + tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]); + print_sigqueueinfo(tcp, tcp->u_arg[2], tcp->u_arg[3]); -int -sys_restart_syscall(struct tcb *tcp) -{ - if (entering(tcp)) - tprints("<... resuming interrupted call ...>"); - return 0; + return RVAL_DECODED; } -static int -do_signalfd(struct tcb *tcp, int flags_arg) +SYS_FUNC(rt_sigtimedwait) { - /* NB: kernel requires arg[2] == NSIG / 8 */ + /* NB: kernel requires arg[3] == NSIG_BYTES */ if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); + print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[3]); tprints(", "); - print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu", tcp->u_arg[2]); - if (flags_arg >= 0) { + if (!(tcp->u_arg[1] && verbose(tcp))) { + /* + * This is the only "return" parameter, + * if we are not going to fetch it on exit, + * decode all parameters on entry. + */ + printaddr(tcp->u_arg[1]); + tprints(", "); + print_timespec(tcp, tcp->u_arg[2]); + tprintf(", %" PRI_klu, tcp->u_arg[3]); + } else { + char *sts = xstrdup(sprint_timespec(tcp, tcp->u_arg[2])); + set_tcb_priv_data(tcp, sts, free); + } + } else { + if (tcp->u_arg[1] && verbose(tcp)) { + printsiginfo_at(tcp, tcp->u_arg[1]); tprints(", "); - printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???"); + tprints(get_tcb_priv_data(tcp)); + tprintf(", %" PRI_klu, tcp->u_arg[3]); + } + + if (!syserror(tcp) && tcp->u_rval) { + tcp->auxstr = signame(tcp->u_rval); + return RVAL_STR; } } return 0; -} +}; -int -sys_signalfd(struct tcb *tcp) +SYS_FUNC(restart_syscall) { - return do_signalfd(tcp, -1); -} + tprintf("<... resuming interrupted %s ...>", + tcp->s_prev_ent ? tcp->s_prev_ent->sys_name : "system call"); -int -sys_signalfd4(struct tcb *tcp) -{ - return do_signalfd(tcp, 3); + return RVAL_DECODED; } diff --git a/signalfd.c b/signalfd.c new file mode 100644 index 00000000..3895c766 --- /dev/null +++ b/signalfd.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#ifdef HAVE_SYS_SIGNALFD_H +# include +#endif + +#include "xlat/sfd_flags.h" + +static int +do_signalfd(struct tcb *tcp, int flags_arg) +{ + /* NB: kernel requires arg[2] == NSIG_BYTES */ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %" PRI_klu, tcp->u_arg[2]); + if (flags_arg >= 0) { + tprints(", "); + printflags(sfd_flags, tcp->u_arg[flags_arg], "SFD_???"); + } + + return RVAL_DECODED | RVAL_FD; +} + +SYS_FUNC(signalfd) +{ + return do_signalfd(tcp, -1); +} + +SYS_FUNC(signalfd4) +{ + return do_signalfd(tcp, 3); +} diff --git a/sigreturn.c b/sigreturn.c new file mode 100644 index 00000000..b2eeb7a4 --- /dev/null +++ b/sigreturn.c @@ -0,0 +1,17 @@ +#include "defs.h" +#include "nsig.h" +#include "regs.h" +#include "ptrace.h" + +#if defined HAVE_ASM_SIGCONTEXT_H && !defined HAVE_STRUCT_SIGCONTEXT +# include +#endif + +#include "arch_sigreturn.c" + +SYS_FUNC(sigreturn) +{ + arch_sigreturn(tcp); + + return RVAL_DECODED; +} diff --git a/sock.c b/sock.c index d3a5b35a..9dd247cc 100644 --- a/sock.c +++ b/sock.c @@ -26,71 +26,256 @@ */ #include "defs.h" + #include +#if defined ALPHA || defined SH || defined SH64 +# include +#endif #include #include -#if defined(ALPHA) || defined(SH) || defined(SH64) -# if defined(HAVE_SYS_IOCTL_H) -# include -# elif defined(HAVE_IOCTLS_H) -# include -# endif -#endif #include +#include DEF_MPERS_TYPE(struct_ifconf) +#include DEF_MPERS_TYPE(struct_ifreq) + +typedef struct ifconf struct_ifconf; +typedef struct ifreq struct_ifreq; + +#include MPERS_DEFS + #include "xlat/iffflags.h" +#define PRINT_IFREQ_ADDR(tcp, ifr, sockaddr) \ + do { \ + tprints(#sockaddr "="); \ + print_sockaddr(tcp, &((ifr)->sockaddr), \ + sizeof((ifr)->sockaddr)); \ + } while (0) + static void -print_addr(struct tcb *tcp, long addr, struct ifreq *ifr) +print_ifname(const char *ifname) { - if (ifr->ifr_addr.sa_family == AF_INET) { - struct sockaddr_in *sinp; - sinp = (struct sockaddr_in *) &ifr->ifr_addr; - tprintf("inet_addr(\"%s\")", inet_ntoa(sinp->sin_addr)); - } else - printstr(tcp, addr, sizeof(ifr->ifr_addr.sa_data)); + print_quoted_string(ifname, IFNAMSIZ + 1, QUOTE_0_TERMINATED); +} + +static void +print_ifreq(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg, const struct_ifreq *const ifr) +{ + switch (code) { + case SIOCSIFADDR: + case SIOCGIFADDR: + PRINT_IFREQ_ADDR(tcp, ifr, ifr_addr); + break; + case SIOCSIFDSTADDR: + case SIOCGIFDSTADDR: + PRINT_IFREQ_ADDR(tcp, ifr, ifr_dstaddr); + break; + case SIOCSIFBRDADDR: + case SIOCGIFBRDADDR: + PRINT_IFREQ_ADDR(tcp, ifr, ifr_broadaddr); + break; + case SIOCSIFNETMASK: + case SIOCGIFNETMASK: + PRINT_IFREQ_ADDR(tcp, ifr, ifr_netmask); + break; + case SIOCSIFHWADDR: + case SIOCGIFHWADDR: { + /* XXX Are there other hardware addresses + than 6-byte MACs? */ + const unsigned char *bytes = + (unsigned char *) &ifr->ifr_hwaddr.sa_data; + tprintf("ifr_hwaddr=%02x:%02x:%02x:%02x:%02x:%02x", + bytes[0], bytes[1], bytes[2], + bytes[3], bytes[4], bytes[5]); + break; + } + case SIOCSIFFLAGS: + case SIOCGIFFLAGS: + tprints("ifr_flags="); + printflags(iffflags, (unsigned short) ifr->ifr_flags, "IFF_???"); + break; + case SIOCSIFMETRIC: + case SIOCGIFMETRIC: + tprintf("ifr_metric=%d", ifr->ifr_metric); + break; + case SIOCSIFMTU: + case SIOCGIFMTU: + tprintf("ifr_mtu=%d", ifr->ifr_mtu); + break; + case SIOCSIFSLAVE: + case SIOCGIFSLAVE: + tprints("ifr_slave="); + print_ifname(ifr->ifr_slave); + break; + case SIOCSIFTXQLEN: + case SIOCGIFTXQLEN: + tprintf("ifr_qlen=%d", ifr->ifr_qlen); + break; + case SIOCSIFMAP: + case SIOCGIFMAP: + tprintf("ifr_map={mem_start=%#" PRI_klx ", " + "mem_end=%#" PRI_klx ", base_addr=%#x, " + "irq=%u, dma=%u, port=%u}", + (kernel_ulong_t) ifr->ifr_map.mem_start, + (kernel_ulong_t) ifr->ifr_map.mem_end, + (unsigned) ifr->ifr_map.base_addr, + (unsigned) ifr->ifr_map.irq, + (unsigned) ifr->ifr_map.dma, + (unsigned) ifr->ifr_map.port); + break; + } } -int -sock_ioctl(struct tcb *tcp, long code, long arg) +static unsigned int +print_ifc_len(int len) { - struct ifreq ifr; - struct ifconf ifc; - const char *str = NULL; - unsigned char *bytes; + const unsigned int n = (unsigned int) len / sizeof(struct_ifreq); + + if (len < 0 || n * sizeof(struct_ifreq) != (unsigned int) len) + tprintf("%d", len); + else + tprintf("%u * sizeof(struct ifreq)", n); + + return n; +} + +static bool +print_ifconf_ifreq(struct tcb *tcp, void *elem_buf, size_t elem_size, + void *dummy) +{ + struct_ifreq *ifr = elem_buf; + + tprints("{ifr_name="); + print_ifname(ifr->ifr_name); + tprints(", "); + PRINT_IFREQ_ADDR(tcp, ifr, ifr_addr); + tprints("}"); + + return true; +} + +/* + * There are two different modes of operation: + * + * - Get buffer size. In this case, the callee sets ifc_buf to NULL, + * and the kernel returns the buffer size in ifc_len. + * - Get actual data. In this case, the callee specifies the buffer address + * in ifc_buf and its size in ifc_len. The kernel fills the buffer with + * the data, and its amount is returned in ifc_len. + * + * Note that, technically, the whole struct ifconf is overwritten, + * so ifc_buf could be different on exit, but current ioctl handler + * implementation does not touch it. + */ +static int +decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct_ifconf *entering_ifc = NULL; + struct_ifconf *ifc = + entering(tcp) ? malloc(sizeof(*ifc)) : alloca(sizeof(*ifc)); + + if (exiting(tcp)) { + entering_ifc = get_tcb_priv_data(tcp); + + if (!entering_ifc) { + error_msg("decode_ifconf: where is my ifconf?"); + return 0; + } + } + + if (!ifc || umove(tcp, addr, ifc) < 0) { + if (entering(tcp)) { + free(ifc); + + tprints(", "); + printaddr(addr); + } else { + /* + * We failed to fetch the structure on exiting syscall, + * print whatever was fetched on entering syscall. + */ + if (!entering_ifc->ifc_buf) + print_ifc_len(entering_ifc->ifc_len); + + tprints(", ifc_buf="); + printaddr(ptr_to_kulong(entering_ifc->ifc_buf)); + + tprints("}"); + } + + return RVAL_DECODED | 1; + } if (entering(tcp)) { - if (code == SIOCGIFCONF) { - if (umove(tcp, tcp->u_arg[2], &ifc) >= 0 - && ifc.ifc_buf == NULL) - tprintf(", {%d -> ", ifc.ifc_len); - else - tprints(", {"); + tprints(", {ifc_len="); + if (ifc->ifc_buf) + print_ifc_len(ifc->ifc_len); + + set_tcb_priv_data(tcp, ifc, free); + + return 1; + } + + /* exiting */ + + if (entering_ifc->ifc_buf && (entering_ifc->ifc_len != ifc->ifc_len)) + tprints(" => "); + if (!entering_ifc->ifc_buf || (entering_ifc->ifc_len != ifc->ifc_len)) + print_ifc_len(ifc->ifc_len); + + tprints(", ifc_buf="); + + if (!entering_ifc->ifc_buf || syserror(tcp)) { + printaddr(ptr_to_kulong(entering_ifc->ifc_buf)); + if (entering_ifc->ifc_buf != ifc->ifc_buf) { + tprints(" => "); + printaddr(ptr_to_kulong(ifc->ifc_buf)); } - return 0; + } else { + struct_ifreq ifr; + + print_array(tcp, ptr_to_kulong(ifc->ifc_buf), + ifc->ifc_len / sizeof(struct_ifreq), + &ifr, sizeof(ifr), + umoven_or_printaddr, print_ifconf_ifreq, NULL); } + tprints("}"); + + return RVAL_DECODED | 1; +} + +MPERS_PRINTER_DECL(int, sock_ioctl, + struct tcb *tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + struct_ifreq ifr; + switch (code) { -#ifdef SIOCSHIWAT - case SIOCSHIWAT: -#endif -#ifdef SIOCGHIWAT - case SIOCGHIWAT: -#endif -#ifdef SIOCSLOWAT - case SIOCSLOWAT: -#endif -#ifdef SIOCGLOWAT - case SIOCGLOWAT: + case SIOCGIFCONF: + return decode_ifconf(tcp, arg); + +#ifdef SIOCBRADDBR + case SIOCBRADDBR: + case SIOCBRDELBR: + tprints(", "); + printstr(tcp, arg); + break; #endif + #ifdef FIOSETOWN case FIOSETOWN: #endif -#ifdef FIOGETOWN - case FIOGETOWN: -#endif #ifdef SIOCSPGRP case SIOCSPGRP: +#endif + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; + +#ifdef FIOGETOWN + case FIOGETOWN: #endif #ifdef SIOCGPGRP case SIOCGPGRP: @@ -98,173 +283,99 @@ sock_ioctl(struct tcb *tcp, long code, long arg) #ifdef SIOCATMARK case SIOCATMARK: #endif - printnum(tcp, arg, ", %#d"); - return 1; - case SIOCGIFNAME: + if (entering(tcp)) + return 0; + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; + +#ifdef SIOCBRADDIF + case SIOCBRADDIF: +#endif +#ifdef SIOCBRDELIF + case SIOCBRDELIF: +#endif + /* no arguments */ + break; + case SIOCSIFNAME: + case SIOCSIFADDR: + case SIOCSIFDSTADDR: + case SIOCSIFBRDADDR: + case SIOCSIFNETMASK: + case SIOCSIFFLAGS: + case SIOCSIFMETRIC: + case SIOCSIFMTU: + case SIOCSIFSLAVE: + case SIOCSIFHWADDR: + case SIOCSIFTXQLEN: + case SIOCSIFMAP: + tprints(", "); + if (umove_or_printaddr(tcp, arg, &ifr)) + break; + + tprints("{ifr_name="); + print_ifname(ifr.ifr_name); + tprints(", "); + if (code == SIOCSIFNAME) { + tprints("ifr_newname="); + print_ifname(ifr.ifr_newname); + } else { + print_ifreq(tcp, code, arg, &ifr); + } + tprints("}"); + break; + + case SIOCGIFNAME: case SIOCGIFINDEX: case SIOCGIFADDR: - case SIOCSIFADDR: case SIOCGIFDSTADDR: - case SIOCSIFDSTADDR: case SIOCGIFBRDADDR: - case SIOCSIFBRDADDR: case SIOCGIFNETMASK: - case SIOCSIFNETMASK: case SIOCGIFFLAGS: - case SIOCSIFFLAGS: case SIOCGIFMETRIC: - case SIOCSIFMETRIC: case SIOCGIFMTU: - case SIOCSIFMTU: case SIOCGIFSLAVE: - case SIOCSIFSLAVE: case SIOCGIFHWADDR: - case SIOCSIFHWADDR: case SIOCGIFTXQLEN: - case SIOCSIFTXQLEN: case SIOCGIFMAP: - case SIOCSIFMAP: - if (umove(tcp, tcp->u_arg[2], &ifr) < 0) - tprintf(", %#lx", tcp->u_arg[2]); - else if (syserror(tcp)) { - if (code == SIOCGIFNAME || code == SIOCSIFNAME) - tprintf(", {ifr_index=%d, ifr_name=???}", ifr.ifr_ifindex); - else - tprintf(", {ifr_name=\"%s\", ???}", ifr.ifr_name); - } else if (code == SIOCGIFNAME || code == SIOCSIFNAME) - tprintf(", {ifr_index=%d, ifr_name=\"%s\"}", - ifr.ifr_ifindex, ifr.ifr_name); - else { - tprintf(", {ifr_name=\"%s\", ", ifr.ifr_name); - switch (code) { - case SIOCGIFINDEX: - tprintf("ifr_index=%d", ifr.ifr_ifindex); - break; - case SIOCGIFADDR: - case SIOCSIFADDR: - str = "ifr_addr"; - case SIOCGIFDSTADDR: - case SIOCSIFDSTADDR: - if (!str) - str = "ifr_dstaddr"; - case SIOCGIFBRDADDR: - case SIOCSIFBRDADDR: - if (!str) - str = "ifr_broadaddr"; - case SIOCGIFNETMASK: - case SIOCSIFNETMASK: - if (!str) - str = "ifr_netmask"; - tprintf("%s={", str); - printxval(addrfams, - ifr.ifr_addr.sa_family, - "AF_???"); - tprints(", "); - print_addr(tcp, ((long) tcp->u_arg[2] - + offsetof(struct ifreq, - ifr_addr.sa_data)), - &ifr); - tprints("}"); - break; - case SIOCGIFHWADDR: - case SIOCSIFHWADDR: - /* XXX Are there other hardware addresses - than 6-byte MACs? */ - bytes = (unsigned char *) &ifr.ifr_hwaddr.sa_data; - tprintf("ifr_hwaddr=%02x:%02x:%02x:%02x:%02x:%02x", - bytes[0], bytes[1], bytes[2], - bytes[3], bytes[4], bytes[5]); - break; - case SIOCGIFFLAGS: - case SIOCSIFFLAGS: - tprints("ifr_flags="); - printflags(iffflags, ifr.ifr_flags, "IFF_???"); - break; - case SIOCGIFMETRIC: - case SIOCSIFMETRIC: - tprintf("ifr_metric=%d", ifr.ifr_metric); - break; - case SIOCGIFMTU: - case SIOCSIFMTU: - tprintf("ifr_mtu=%d", ifr.ifr_mtu); - break; - case SIOCGIFSLAVE: - case SIOCSIFSLAVE: - tprintf("ifr_slave=\"%s\"", ifr.ifr_slave); - break; - case SIOCGIFTXQLEN: - case SIOCSIFTXQLEN: - tprintf("ifr_qlen=%d", ifr.ifr_qlen); - break; - case SIOCGIFMAP: - case SIOCSIFMAP: - tprintf("ifr_map={mem_start=%#lx, " - "mem_end=%#lx, base_addr=%#x, " - "irq=%u, dma=%u, port=%u}", - ifr.ifr_map.mem_start, - ifr.ifr_map.mem_end, - (unsigned) ifr.ifr_map.base_addr, - (unsigned) ifr.ifr_map.irq, - (unsigned) ifr.ifr_map.dma, - (unsigned) ifr.ifr_map.port); + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &ifr)) break; + + if (SIOCGIFNAME == code) { + tprintf("{ifr_index=%d", ifr.ifr_ifindex); + } else { + tprints("{ifr_name="); + print_ifname(ifr.ifr_name); } - tprints("}"); - } - return 1; - case SIOCGIFCONF: - if (umove(tcp, tcp->u_arg[2], &ifc) < 0) { - tprints("???}"); return 1; - } - tprintf("%d, ", ifc.ifc_len); - if (syserror(tcp)) { - tprintf("%lx", (unsigned long) ifc.ifc_buf); - } else if (ifc.ifc_buf == NULL) { - tprints("NULL"); } else { - int i; - unsigned nifra = ifc.ifc_len / sizeof(struct ifreq); - struct ifreq ifra[nifra]; - - if (umoven(tcp, (unsigned long) ifc.ifc_buf, - sizeof(ifra), (char *) ifra) < 0) { - tprintf("%lx}", (unsigned long) ifc.ifc_buf); - return 1; + if (syserror(tcp)) { + tprints("}"); + break; } - tprints("{"); - for (i = 0; i < nifra; ++i ) { - if (i > 0) - tprints(", "); - tprintf("{\"%s\", {", - ifra[i].ifr_name); - if (verbose(tcp)) { - printxval(addrfams, - ifra[i].ifr_addr.sa_family, - "AF_???"); - tprints(", "); - print_addr(tcp, ((long) tcp->u_arg[2] - + offsetof(struct ifreq, - ifr_addr.sa_data) - + ((char *) &ifra[i] - - (char *) &ifra[0])), - &ifra[i]); - } else - tprints("..."); - tprints("}}"); + + tprints(", "); + if (umove(tcp, arg, &ifr) < 0) { + tprints("???}"); + break; + } + + if (SIOCGIFNAME == code) { + tprints("ifr_name="); + print_ifname(ifr.ifr_name); + } else { + print_ifreq(tcp, code, arg, &ifr); } tprints("}"); + break; } - tprints("}"); - return 1; + default: - return 0; + return RVAL_DECODED; } -} -int -sys_socketcall(struct tcb *tcp) -{ - return printargs(tcp); + return RVAL_DECODED | 1; } diff --git a/sockaddr.c b/sockaddr.c new file mode 100644 index 00000000..174108ca --- /dev/null +++ b/sockaddr.c @@ -0,0 +1,306 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2000 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_NETIPX_IPX_H +# include +#else +# include +#endif + +#include "xlat/addrfams.h" +#include "xlat/arp_hardware_types.h" +#include "xlat/ethernet_protocols.h" +#include "xlat/af_packet_types.h" + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include +# include +# include +# include + +# include "xlat/hci_channels.h" +#endif + +#define SIZEOF_SA_FAMILY sizeof(((struct sockaddr *) 0)->sa_family) + +static void +print_sockaddr_data_un(const void *const buf, const int addrlen) +{ + const struct sockaddr_un *const sa_un = buf; + const int un_len = addrlen > (int) sizeof(*sa_un) + ? (int) sizeof(*sa_un) : addrlen; + const int path_len = un_len - SIZEOF_SA_FAMILY; + + tprints("sun_path="); + if (sa_un->sun_path[0]) { + print_quoted_string(sa_un->sun_path, path_len + 1, + QUOTE_0_TERMINATED); + } else { + tprints("@"); + print_quoted_string(sa_un->sun_path + 1, path_len - 1, 0); + } +} + +static void +print_sockaddr_data_in(const void *const buf, const int addrlen) +{ + const struct sockaddr_in *const sa_in = buf; + + tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")", + ntohs(sa_in->sin_port), inet_ntoa(sa_in->sin_addr)); +} + +#define SIN6_MIN_LEN offsetof(struct sockaddr_in6, sin6_scope_id) + +static void +print_sockaddr_data_in6(const void *const buf, const int addrlen) +{ + const struct sockaddr_in6 *const sa_in6 = buf; + + char string_addr[100]; + inet_ntop(AF_INET6, &sa_in6->sin6_addr, + string_addr, sizeof(string_addr)); + tprintf("sin6_port=htons(%u), inet_pton(AF_INET6" + ", \"%s\", &sin6_addr), sin6_flowinfo=htonl(%u)", + ntohs(sa_in6->sin6_port), string_addr, + ntohl(sa_in6->sin6_flowinfo)); + + if (addrlen <= (int) SIN6_MIN_LEN) + return; + + tprints(", sin6_scope_id="); +#if defined IN6_IS_ADDR_LINKLOCAL && defined IN6_IS_ADDR_MC_LINKLOCAL + if (IN6_IS_ADDR_LINKLOCAL(&sa_in6->sin6_addr) + || IN6_IS_ADDR_MC_LINKLOCAL(&sa_in6->sin6_addr)) + print_ifindex(sa_in6->sin6_scope_id); + else +#endif + tprintf("%u", sa_in6->sin6_scope_id); +} + +static void +print_sockaddr_data_ipx(const void *const buf, const int addrlen) +{ + const struct sockaddr_ipx *const sa_ipx = buf; + unsigned int i; + + tprintf("sipx_port=htons(%u)" + ", sipx_network=htonl(%#08x)" + ", sipx_node=[", + ntohs(sa_ipx->sipx_port), + ntohl(sa_ipx->sipx_network)); + for (i = 0; i < IPX_NODE_LEN; ++i) { + tprintf("%s%#02x", i ? ", " : "", + sa_ipx->sipx_node[i]); + } + tprintf("], sipx_type=%#02x", sa_ipx->sipx_type); +} + +static void +print_sockaddr_data_nl(const void *const buf, const int addrlen) +{ + const struct sockaddr_nl *const sa_nl = buf; + + tprintf("nl_pid=%d, nl_groups=%#08x", + sa_nl->nl_pid, sa_nl->nl_groups); +} + +static void +print_sockaddr_data_ll(const void *const buf, const int addrlen) +{ + const struct sockaddr_ll *const sa_ll = buf; + + tprints("sll_protocol=htons("); + printxval(ethernet_protocols, ntohs(sa_ll->sll_protocol), "ETH_P_???"); + tprints("), sll_ifindex="); + print_ifindex(sa_ll->sll_ifindex); + tprints(", sll_hatype="); + printxval(arp_hardware_types, sa_ll->sll_hatype, "ARPHRD_???"); + tprints(", sll_pkttype="); + printxval(af_packet_types, sa_ll->sll_pkttype, "PACKET_???"); + tprintf(", sll_halen=%u", sa_ll->sll_halen); + if (sa_ll->sll_halen) { + const unsigned int oob_halen = + addrlen - offsetof(struct sockaddr_ll, sll_addr); + unsigned int i; + + tprints(", sll_addr=["); + for (i = 0; i < sa_ll->sll_halen; ++i) { + if (i) + tprints(", "); + if (i >= oob_halen) { + tprints("..."); + break; + } + tprintf("%#02x", sa_ll->sll_addr[i]); + } + tprints("]"); + } +} + +static void +print_sockaddr_data_raw(const void *const buf, const int addrlen) +{ + const char *const data = buf + SIZEOF_SA_FAMILY; + const int datalen = addrlen - SIZEOF_SA_FAMILY; + + tprints("sa_data="); + print_quoted_string(data, datalen, 0); +} + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static void +print_sockaddr_data_bt(const void *const buf, const int addrlen) +{ + switch (addrlen) { + case sizeof(struct sockaddr_hci): { + const struct sockaddr_hci *const hci = buf; + tprintf("hci_dev=htobs(%hu), hci_channel=", + btohs(hci->hci_dev)); + printxval(hci_channels, hci->hci_channel, + "HCI_CHANNEL_???"); + break; + } + case sizeof(struct sockaddr_sco): { + const struct sockaddr_sco *const sco = buf; + tprintf("sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x", + sco->sco_bdaddr.b[0], sco->sco_bdaddr.b[1], + sco->sco_bdaddr.b[2], sco->sco_bdaddr.b[3], + sco->sco_bdaddr.b[4], sco->sco_bdaddr.b[5]); + break; + } + case sizeof(struct sockaddr_rc): { + const struct sockaddr_rc *const rc = buf; + tprintf("rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", rc_channel=%u", + rc->rc_bdaddr.b[0], rc->rc_bdaddr.b[1], + rc->rc_bdaddr.b[2], rc->rc_bdaddr.b[3], + rc->rc_bdaddr.b[4], rc->rc_bdaddr.b[5], + rc->rc_channel); + break; + } + case sizeof(struct sockaddr_l2): { + const struct sockaddr_l2 *const l2 = buf; + tprintf("l2_psm=htobs(%hu)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(%hu), l2_bdaddr_type=%u", + btohs(l2->l2_psm), + l2->l2_bdaddr.b[0], l2->l2_bdaddr.b[1], + l2->l2_bdaddr.b[2], l2->l2_bdaddr.b[3], + l2->l2_bdaddr.b[4], l2->l2_bdaddr.b[5], + btohs(l2->l2_cid), l2->l2_bdaddr_type); + break; + } + default: + print_sockaddr_data_raw(buf, addrlen); + break; + } +} +#endif /* HAVE_BLUETOOTH_BLUETOOTH_H */ + +typedef void (* const sockaddr_printer)(const void *const, const int); + +static const struct { + const sockaddr_printer printer; + const int min_len; +} sa_printers[] = { + [AF_UNIX] = { print_sockaddr_data_un, SIZEOF_SA_FAMILY + 1 }, + [AF_INET] = { print_sockaddr_data_in, sizeof(struct sockaddr_in) }, + [AF_IPX] = { print_sockaddr_data_ipx, sizeof(struct sockaddr_ipx) }, + [AF_INET6] = { print_sockaddr_data_in6, SIN6_MIN_LEN }, + [AF_NETLINK] = { print_sockaddr_data_nl, SIZEOF_SA_FAMILY + 1 }, + [AF_PACKET] = { print_sockaddr_data_ll, sizeof(struct sockaddr_ll) }, +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + [AF_BLUETOOTH] = { print_sockaddr_data_bt, SIZEOF_SA_FAMILY + 1 }, +#endif +}; + +void +print_sockaddr(struct tcb *tcp, const void *const buf, const int addrlen) +{ + const struct sockaddr *const sa = buf; + + tprints("{sa_family="); + printxval(addrfams, sa->sa_family, "AF_???"); + + if (addrlen > (int) SIZEOF_SA_FAMILY) { + tprints(", "); + + if (sa->sa_family < ARRAY_SIZE(sa_printers) + && sa_printers[sa->sa_family].printer + && addrlen >= sa_printers[sa->sa_family].min_len) { + sa_printers[sa->sa_family].printer(buf, addrlen); + } else { + print_sockaddr_data_raw(buf, addrlen); + } + } + + tprints("}"); +} + +int +decode_sockaddr(struct tcb *const tcp, const kernel_ulong_t addr, int addrlen) +{ + if (addrlen < 2) { + printaddr(addr); + return -1; + } + + union { + struct sockaddr sa; + struct sockaddr_storage storage; + char pad[sizeof(struct sockaddr_storage) + 1]; + } addrbuf; + + if ((unsigned) addrlen > sizeof(addrbuf.storage)) + addrlen = sizeof(addrbuf.storage); + + if (umoven_or_printaddr(tcp, addr, addrlen, addrbuf.pad)) + return -1; + + memset(&addrbuf.pad[addrlen], 0, sizeof(addrbuf.pad) - addrlen); + + print_sockaddr(tcp, &addrbuf, addrlen); + + return addrbuf.sa.sa_family; +} diff --git a/socketcall.c b/socketcall.c new file mode 100644 index 00000000..9f48a104 --- /dev/null +++ b/socketcall.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "xlat/socketcalls.h" + +SYS_FUNC(socketcall) +{ + const unsigned int call = tcp->u_arg[0]; + const char *str = xlookup(socketcalls, call); + + if (str) + tprints(str); + else + tprintf("%d", call); + + tprints(", "); + printaddr(tcp->u_arg[1]); + + return RVAL_DECODED; +} diff --git a/socketutils.c b/socketutils.c new file mode 100644 index 00000000..d50ef831 --- /dev/null +++ b/socketutils.c @@ -0,0 +1,496 @@ +/* + * Copyright (c) 2014 Zubin Mithra + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "xlat/netlink_protocols.h" + +#include +#ifndef UNIX_PATH_MAX +# define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) 0)->sun_path) +#endif + +typedef struct { + unsigned long inode; + char *details; +} cache_entry; + +#define CACHE_SIZE 1024U +static cache_entry cache[CACHE_SIZE]; +#define CACHE_MASK (CACHE_SIZE - 1) + +static int +cache_and_print_inode_details(const unsigned long inode, char *const details) +{ + cache_entry *e = &cache[inode & CACHE_MASK]; + free(e->details); + e->inode = inode; + e->details = details; + + tprints(details); + return 1; +} + +bool +print_sockaddr_by_inode_cached(const unsigned long inode) +{ + const cache_entry *const e = &cache[inode & CACHE_MASK]; + if (e && inode == e->inode) { + tprints(e->details); + return true; + } + return false; +} + +static bool +send_query(const int fd, void *req, size_t req_size) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = req, + .iov_len = req_size + }; + const struct msghdr msg = { + .msg_name = &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + for (;;) { + if (sendmsg(fd, &msg, 0) < 0) { + if (errno == EINTR) + continue; + return false; + } + return true; + } +} + +static bool +inet_send_query(const int fd, const int family, const int proto) +{ + struct { + const struct nlmsghdr nlh; + const struct inet_diag_req_v2 idr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .idr = { + .sdiag_family = family, + .sdiag_protocol = proto, + .idiag_states = -1 + } + }; + return send_query(fd, &req, sizeof(req)); +} + +static int +inet_parse_response(const char *const proto_name, const void *const data, + const int data_len, const unsigned long inode) +{ + const struct inet_diag_msg *const diag_msg = data; + static const char zero_addr[sizeof(struct in6_addr)]; + socklen_t addr_size, text_size; + + if (data_len < (int) NLMSG_LENGTH(sizeof(*diag_msg))) + return -1; + if (diag_msg->idiag_inode != inode) + return 0; + + switch(diag_msg->idiag_family) { + case AF_INET: + addr_size = sizeof(struct in_addr); + text_size = INET_ADDRSTRLEN; + break; + case AF_INET6: + addr_size = sizeof(struct in6_addr); + text_size = INET6_ADDRSTRLEN; + break; + default: + return -1; + } + + char src_buf[text_size]; + char *details; + + if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_src, + src_buf, text_size)) + return -1; + + if (diag_msg->id.idiag_dport || + memcmp(zero_addr, diag_msg->id.idiag_dst, addr_size)) { + char dst_buf[text_size]; + + if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_dst, + dst_buf, text_size)) + return -1; + + if (asprintf(&details, "%s:[%s:%u->%s:%u]", proto_name, + src_buf, ntohs(diag_msg->id.idiag_sport), + dst_buf, ntohs(diag_msg->id.idiag_dport)) < 0) + return false; + } else { + if (asprintf(&details, "%s:[%s:%u]", proto_name, src_buf, + ntohs(diag_msg->id.idiag_sport)) < 0) + return false; + } + + return cache_and_print_inode_details(inode, details); +} + +static bool +receive_responses(const int fd, const unsigned long inode, + const char *proto_name, + int (* parser) (const char *, const void *, + int, unsigned long)) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + int flags = 0; + + for (;;) { + struct msghdr msg = { + .msg_name = &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, flags); + if (ret < 0) { + if (errno == EINTR) + continue; + return false; + } + + const struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + return false; + for (; NLMSG_OK(h, ret); h = NLMSG_NEXT(h, ret)) { + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + return false; + const int rc = parser(proto_name, NLMSG_DATA(h), + h->nlmsg_len, inode); + if (rc > 0) + return true; + if (rc < 0) + return false; + } + flags = MSG_DONTWAIT; + } +} + +static bool +inet_print(const int fd, const int family, const int protocol, + const unsigned long inode, const char *proto_name) +{ + return inet_send_query(fd, family, protocol) + && receive_responses(fd, inode, proto_name, inet_parse_response); +} + +static bool +unix_send_query(const int fd, const unsigned long inode) +{ + struct { + const struct nlmsghdr nlh; + const struct unix_diag_req udr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .udr = { + .sdiag_family = AF_UNIX, + .udiag_ino = inode, + .udiag_states = -1, + .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER + } + }; + return send_query(fd, &req, sizeof(req)); +} + +static int +unix_parse_response(const char *proto_name, const void *data, + const int data_len, const unsigned long inode) +{ + const struct unix_diag_msg *diag_msg = data; + struct rtattr *attr; + int rta_len = data_len - NLMSG_LENGTH(sizeof(*diag_msg)); + uint32_t peer = 0; + size_t path_len = 0; + char path[UNIX_PATH_MAX + 1]; + + if (rta_len < 0) + return -1; + if (diag_msg->udiag_ino != inode) + return 0; + if (diag_msg->udiag_family != AF_UNIX) + return -1; + + for (attr = (struct rtattr *) (diag_msg + 1); + RTA_OK(attr, rta_len); + attr = RTA_NEXT(attr, rta_len)) { + switch (attr->rta_type) { + case UNIX_DIAG_NAME: + if (!path_len) { + path_len = RTA_PAYLOAD(attr); + if (path_len > UNIX_PATH_MAX) + path_len = UNIX_PATH_MAX; + memcpy(path, RTA_DATA(attr), path_len); + path[path_len] = '\0'; + } + break; + case UNIX_DIAG_PEER: + if (RTA_PAYLOAD(attr) >= 4) + peer = *(uint32_t *) RTA_DATA(attr); + break; + } + } + + /* + * print obtained information in the following format: + * "UNIX:[" SELF_INODE [ "->" PEER_INODE ][ "," SOCKET_FILE ] "]" + */ + if (!peer && !path_len) + return -1; + + char peer_str[3 + sizeof(peer) * 3]; + if (peer) + snprintf(peer_str, sizeof(peer_str), "->%u", peer); + else + peer_str[0] = '\0'; + + const char *path_str; + if (path_len) { + char *outstr = alloca(4 * path_len + 4); + + outstr[0] = ','; + if (path[0] == '\0') { + outstr[1] = '@'; + string_quote(path + 1, outstr + 2, + path_len - 1, QUOTE_0_TERMINATED); + } else { + string_quote(path, outstr + 1, + path_len, QUOTE_0_TERMINATED); + } + path_str = outstr; + } else { + path_str = ""; + } + + char *details; + if (asprintf(&details, "%s:[%lu%s%s]", proto_name, inode, + peer_str, path_str) < 0) + return -1; + + return cache_and_print_inode_details(inode, details); +} + +static bool +netlink_send_query(const int fd, const unsigned long inode) +{ + struct { + const struct nlmsghdr nlh; + const struct netlink_diag_req ndr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .ndr = { + .sdiag_family = AF_NETLINK, + .sdiag_protocol = NDIAG_PROTO_ALL, + .ndiag_show = NDIAG_SHOW_MEMINFO + } + }; + return send_query(fd, &req, sizeof(req)); +} + +static int +netlink_parse_response(const char *proto_name, const void *data, + const int data_len, const unsigned long inode) +{ + const struct netlink_diag_msg *const diag_msg = data; + const char *netlink_proto; + char *details; + + if (data_len < (int) NLMSG_LENGTH(sizeof(*diag_msg))) + return -1; + if (diag_msg->ndiag_ino != inode) + return 0; + + if (diag_msg->ndiag_family != AF_NETLINK) + return -1; + + netlink_proto = xlookup(netlink_protocols, + diag_msg->ndiag_protocol); + + if (netlink_proto) { + static const char netlink_prefix[] = "NETLINK_"; + const size_t netlink_prefix_len = + sizeof(netlink_prefix) -1; + if (strncmp(netlink_proto, netlink_prefix, + netlink_prefix_len) == 0) + netlink_proto += netlink_prefix_len; + if (asprintf(&details, "%s:[%s:%u]", proto_name, + netlink_proto, diag_msg->ndiag_portid) < 0) + return -1; + } else { + if (asprintf(&details, "%s:[%u]", proto_name, + (unsigned) diag_msg->ndiag_protocol) < 0) + return -1; + } + + return cache_and_print_inode_details(inode, details); +} + +static bool +unix_print(const int fd, const unsigned long inode) +{ + return unix_send_query(fd, inode) + && receive_responses(fd, inode, "UNIX", unix_parse_response); +} + +static bool +tcp_v4_print(const int fd, const unsigned long inode) +{ + return inet_print(fd, AF_INET, IPPROTO_TCP, inode, "TCP"); +} + +static bool +udp_v4_print(const int fd, const unsigned long inode) +{ + return inet_print(fd, AF_INET, IPPROTO_UDP, inode, "UDP"); +} + +static bool +tcp_v6_print(const int fd, const unsigned long inode) +{ + return inet_print(fd, AF_INET6, IPPROTO_TCP, inode, "TCPv6"); +} + +static bool +udp_v6_print(const int fd, const unsigned long inode) +{ + return inet_print(fd, AF_INET6, IPPROTO_UDP, inode, "UDPv6"); +} + +static bool +netlink_print(const int fd, const unsigned long inode) +{ + return netlink_send_query(fd, inode) + && receive_responses(fd, inode, "NETLINK", + netlink_parse_response); +} + +static const struct { + const char *const name; + bool (*const print)(int, unsigned long); +} protocols[] = { + [SOCK_PROTO_UNIX] = { "UNIX", unix_print }, + [SOCK_PROTO_TCP] = { "TCP", tcp_v4_print }, + [SOCK_PROTO_UDP] = { "UDP", udp_v4_print }, + [SOCK_PROTO_TCPv6] = { "TCPv6", tcp_v6_print }, + [SOCK_PROTO_UDPv6] = { "UDPv6", udp_v6_print }, + [SOCK_PROTO_NETLINK] = { "NETLINK", netlink_print } +}; + +enum sock_proto +get_proto_by_name(const char *const name) +{ + unsigned int i; + for (i = (unsigned int) SOCK_PROTO_UNKNOWN + 1; + i < ARRAY_SIZE(protocols); ++i) { + if (protocols[i].name && !strcmp(name, protocols[i].name)) + return (enum sock_proto) i; + } + return SOCK_PROTO_UNKNOWN; +} + +/* Given an inode number of a socket, print out the details + * of the ip address and port. */ + +bool +print_sockaddr_by_inode(const unsigned long inode, const enum sock_proto proto) +{ + if ((unsigned int) proto >= ARRAY_SIZE(protocols) || + (proto != SOCK_PROTO_UNKNOWN && !protocols[proto].print)) + return false; + + const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); + if (fd < 0) + return false; + bool r = false; + + if (proto != SOCK_PROTO_UNKNOWN) { + r = protocols[proto].print(fd, inode); + if (!r) { + tprintf("%s:[%lu]", protocols[proto].name, inode); + r = true; + } + } else { + unsigned int i; + for (i = (unsigned int) SOCK_PROTO_UNKNOWN + 1; + i < ARRAY_SIZE(protocols); ++i) { + if (!protocols[i].print) + continue; + r = protocols[i].print(fd, inode); + if (r) + break; + } + } + + close(fd); + return r; +} diff --git a/sram_alloc.c b/sram_alloc.c new file mode 100644 index 00000000..922746bb --- /dev/null +++ b/sram_alloc.c @@ -0,0 +1,19 @@ +#include "defs.h" + +#ifdef BFIN + +#include + +#include "xlat/sram_alloc_flags.h" + +SYS_FUNC(sram_alloc) +{ + /* size */ + tprintf("%lu, ", tcp->u_arg[0]); + /* flags */ + printflags64(sram_alloc_flags, tcp->u_arg[1], "???_SRAM"); + + return RVAL_DECODED | RVAL_HEX; +} + +#endif /* BFIN */ diff --git a/stat.c b/stat.c new file mode 100644 index 00000000..28bd15ef --- /dev/null +++ b/stat.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "stat.h" + +static void +decode_struct_stat(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct strace_stat st; + + if (fetch_struct_stat(tcp, addr, &st)) + print_struct_stat(tcp, &st); +} + +SYS_FUNC(stat) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + decode_struct_stat(tcp, tcp->u_arg[1]); + } + return 0; +} + +SYS_FUNC(fstat) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + decode_struct_stat(tcp, tcp->u_arg[1]); + } + return 0; +} + +SYS_FUNC(newfstatat) +{ + if (entering(tcp)) { + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + } else { + decode_struct_stat(tcp, tcp->u_arg[2]); + tprints(", "); + printflags(at_flags, tcp->u_arg[3], "AT_???"); + } + return 0; +} diff --git a/stat.h b/stat.h new file mode 100644 index 00000000..092d2687 --- /dev/null +++ b/stat.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_STAT_H +#define STRACE_STAT_H + +struct strace_stat { + unsigned long long dev; + unsigned long long ino; + unsigned long long rdev; + unsigned long long size; + unsigned long long blocks; + unsigned long long blksize; + unsigned long long mode; + unsigned long long nlink; + unsigned long long uid; + unsigned long long gid; + long long atime; + long long ctime; + long long mtime; + unsigned long long atime_nsec; + unsigned long long ctime_nsec; + unsigned long long mtime_nsec; +}; + +#endif /* !STRACE_STAT_H */ diff --git a/stat64.c b/stat64.c new file mode 100644 index 00000000..09d203dc --- /dev/null +++ b/stat64.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "stat.h" + +static void +decode_struct_stat64(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct strace_stat st; + + if (fetch_struct_stat64(tcp, addr, &st)) + print_struct_stat(tcp, &st); +} + +SYS_FUNC(stat64) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + decode_struct_stat64(tcp, tcp->u_arg[1]); + } + return 0; +} + +SYS_FUNC(fstat64) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + decode_struct_stat64(tcp, tcp->u_arg[1]); + } + return 0; +} + +SYS_FUNC(fstatat64) +{ + if (entering(tcp)) { + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + } else { + decode_struct_stat64(tcp, tcp->u_arg[2]); + tprints(", "); + printflags(at_flags, tcp->u_arg[3], "AT_???"); + } + return 0; +} diff --git a/statfs.c b/statfs.c new file mode 100644 index 00000000..00dd04c4 --- /dev/null +++ b/statfs.c @@ -0,0 +1,12 @@ +#include "defs.h" + +SYS_FUNC(statfs) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + print_struct_statfs(tcp, tcp->u_arg[1]); + } + return 0; +} diff --git a/statfs.h b/statfs.h new file mode 100644 index 00000000..c9864248 --- /dev/null +++ b/statfs.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_STATFS_H +#define STRACE_STATFS_H + +struct strace_statfs { + unsigned long long f_type; + unsigned long long f_bsize; + unsigned long long f_blocks; + unsigned long long f_bfree; + unsigned long long f_bavail; + unsigned long long f_files; + unsigned long long f_ffree; + unsigned long f_fsid[2]; + unsigned long long f_namelen; + unsigned long long f_frsize; + unsigned long long f_flags; +}; + +#endif /* !STRACE_STATFS_H */ diff --git a/statfs64.c b/statfs64.c new file mode 100644 index 00000000..cd433d51 --- /dev/null +++ b/statfs64.c @@ -0,0 +1,12 @@ +#include "defs.h" + +SYS_FUNC(statfs64) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); + } else { + print_struct_statfs64(tcp, tcp->u_arg[2], tcp->u_arg[1]); + } + return 0; +} diff --git a/strace-graph b/strace-graph index d57e7686..5435e864 100755 --- a/strace-graph +++ b/strace-graph @@ -33,14 +33,19 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +use strict; +use warnings; + my %unfinished; +my $floatform; # Scales for strace slowdown. Make configurable! my $scale_factor = 3.5; while (<>) { - my ($pid, $call, $args, $result, $time); + my ($pid, $call, $args, $result, $time, $time_spent); chop; + $floatform = 0; s/^(\d+)\s+//; $pid = $1; @@ -70,7 +75,7 @@ while (<>) { delete $unfinished{$pid}; } - if (/^--- SIG(\S+) \(.*\) ---$/) { + if (/^--- SIG(\S+) (.*) ---$/) { # $pid received signal $1 # currently we don't do anything with this next; @@ -82,7 +87,16 @@ while (<>) { next; } + if (/^\+\+\+ exited with (\d+) \+\+\+$/) { + # $pid exited $1 + # currently we don't do anything with this + next; + } + ($call, $args, $result) = /(\S+)\((.*)\)\s+= (.*)$/; + if ($result =~ /^(.*) <([0-9.]*)>$/) { + ($result, $time_spent) = ($1, $2); + } unless (defined $result) { print STDERR "$0: $ARGV: $.: cannot parse line.\n"; next; @@ -119,13 +133,14 @@ sub parse_one { my ($in) = @_; if ($in =~ s/^\"//) { + my $tmp; ($tmp, $in) = parse_str($in); if (not defined $tmp) { print STDERR "$0: $ARGV: $.: cannot parse string.\n"; return (undef, $in); } return ($tmp, $in); - } elsif ($in =~ s/^0x(\x+)//) { + } elsif ($in =~ s/^0x([[:xdigit:]]+)//) { return (hex $1, $in); } elsif ($in =~ s/^(\d+)//) { return (int $1, $in); @@ -197,7 +212,7 @@ my $depth = ""; # process info, indexed by pid. # fields: # parent pid number -# seq forks and execs for this pid, in sequence (array) +# seq clones, forks and execs for this pid, in sequence (array) # filename and argv (from latest exec) # basename (derived from filename) @@ -214,10 +229,10 @@ sub handle_trace { } if ($call eq 'execve') { - return if $result != 0; + return if $result ne '0'; my ($filename, $argv) = parseargs($args); - ($basename) = $filename =~ m/([^\/]*)$/; + my ($basename) = $filename =~ m/([^\/]*)$/; if ($basename ne $$argv[0]) { $$argv[0] = "$basename($$argv[0])"; } @@ -235,7 +250,8 @@ sub handle_trace { push @$seq, ['FORK', $result]; $pr{$pid}{seq} = $seq; $pr{$result}{parent} = $pid; - } elsif ($call eq '_exit') { + $pr{$result}{seq} = []; + } elsif ($call eq '_exit' || $call eq 'exit_group') { $pr{$pid}{end} = $time if defined $time; } } @@ -249,7 +265,7 @@ sub straight_seq { my ($pid) = @_; my $seq = $pr{$pid}{seq}; - for $elem (@$seq) { + for my $elem (@$seq) { if ($$elem[0] eq 'EXEC') { my $argv = $$elem[2]; print "$$elem[0] $$elem[1] @$argv\n"; @@ -265,7 +281,7 @@ sub first_exec { my ($pid) = @_; my $seq = $pr{$pid}{seq}; - for $elem (@$seq) { + for my $elem (@$seq) { if ($$elem[0] eq 'EXEC') { return $elem; } @@ -293,15 +309,15 @@ sub display_pid_trace { } } - for $elem (@seq) { + for my $elem (@seq) { $i++; if ($$elem[0] eq 'EXEC') { my $argv = $$elem[2]; if (defined $elapsed) { - print "$lead [$elapsed] @$argv\n"; + print "$lead [$elapsed] $pid @$argv\n"; undef $elapsed; } else { - print "$lead @$argv\n"; + print "$lead $pid @$argv\n"; } } elsif ($$elem[0] eq 'FORK') { if ($i == 1) { diff --git a/strace.1 b/strace.1 index 2a24c383..9230766e 100644 --- a/strace.1 +++ b/strace.1 @@ -203,72 +203,33 @@ sigprocmask(SIG_UNBLOCK, ~[], NULL) = 0 .CE Here the second argument represents the full set of all signals. .SH OPTIONS +.SS Output format .TP 12 -.TP -.B \-c -Count time, calls, and errors for each system call and report a summary on -program exit. On Linux, this attempts to show system time (CPU time spent -running in the kernel) independent of wall clock time. If -.B \-c -is used with -.B \-f -or -.B \-F -(below), only aggregate totals for all traced processes are kept. -.TP -.B \-C -Like -.B \-c -but also print regular output while processes are running. -.TP -.B \-D -Run tracer process as a detached grandchild, not as parent of the -tracee. This reduces the visible effect of -.B strace -by keeping the tracee a direct child of the calling process. -.TP -.B \-d -Show some debugging output of -.B strace -itself on the standard error. -.TP -.B \-f -Trace child processes as they are created by currently traced -processes as a result of the -.BR fork (2), -.BR vfork (2) -and -.BR clone (2) -system calls. Note that -.B \-p -.I PID -.B \-f -will attach all threads of process PID if it is multi-threaded, -not only thread with thread_id = PID. -.TP -.B \-ff -If the -.B \-o -.I filename -option is in effect, each processes trace is written to -.I filename.pid -where pid is the numeric process id of each process. -This is incompatible with -.BR \-c , -since no per-process counts are kept. -.TP -.B \-F -This option is now obsolete and it has the same functionality as -.BR \-f . -.TP -.B \-h -Print the help summary. +.BI "\-a " column +Align return values in a specific column (default column 40). .TP .B \-i Print the instruction pointer at the time of the system call. .TP .B \-k Print the execution stack trace of the traced processes after each system call (experimental). +This option is available only if +.B strace +is built with libunwind. +.TP +.BI "\-o " filename +Write the trace output to the file +.I filename +rather than to stderr. +Use +.I filename.pid +if +.B \-ff +is used. +If the argument begins with '|' or with '!' then the rest of the +argument is treated as a command and all output is piped to it. +This is convenient for piping the debugging output to a program +without affecting the redirections of executed programs. .TP .B \-q Suppress messages about attaching, detaching etc. This happens @@ -283,6 +244,11 @@ Print a relative timestamp upon entry to each system call. This records the time difference between the beginning of successive system calls. .TP +.BI "\-s " strsize +Specify the maximum string size to print (the default is 32). Note +that filenames are not considered strings and are always printed in +full. +.TP .B \-t Prefix each line of the trace with the time of day. .TP @@ -298,20 +264,6 @@ of seconds since the epoch. Show the time spent in system calls. This records the time difference between the beginning and the end of each system call. .TP -.B \-w -Summarise the time difference between the beginning and end of -each system call. The default is to summarise the system time. -.TP -.B \-v -Print unabbreviated versions of environment, stat, termios, etc. -calls. These structures are very common in calls and so the default -behavior displays a reasonable subset of structure members. Use -this option to get all of the gory details. -.TP -.B \-V -Print the version number of -.BR strace . -.TP .B \-x Print all non-ASCII strings in hexadecimal string format. .TP @@ -321,17 +273,58 @@ Print all strings in hexadecimal string format. .B \-y Print paths associated with file descriptor arguments. .TP -.BI "\-a " column -Align return values in a specific column (default column 40). +.B \-yy +Print protocol specific information associated with socket file descriptors. +.SS Statistics +.TP 12 +.B \-c +Count time, calls, and errors for each system call and report a summary on +program exit. On Linux, this attempts to show system time (CPU time spent +running in the kernel) independent of wall clock time. If +.B \-c +is used with +.B \-f +or +.B \-F +, only aggregate totals for all traced processes are kept. .TP -.BI "\-b " syscall -If specified syscall is reached, detach from traced process. -Currently, only -.I execve -syscall is supported. This option is useful if you want to trace -multi-threaded process and therefore require -f, but don't want -to trace its (potentially very complex) children. +.B \-C +Like +.B \-c +but also print regular output while processes are running. .TP +.BI "\-O " overhead +Set the overhead for tracing system calls to +.I overhead +microseconds. +This is useful for overriding the default heuristic for guessing +how much time is spent in mere measuring when timing system calls using +the +.B \-c +option. The accuracy of the heuristic can be gauged by timing a given +program run without tracing (using +.BR time (1)) +and comparing the accumulated +system call time to the total produced using +.BR \-c . +.TP +.BI "\-S " sortby +Sort the output of the histogram printed by the +.B \-c +option by the specified criterion. Legal values are +.BR time , +.BR calls , +.BR name , +and +.B nothing +(default is +.BR time ). +.TP +.B \-w +Summarise the time difference between the beginning and end of +each system call. The default is to summarise the system time. +.SS Filtering +.TP 12 .BI "\-e " expr A qualifying expression which modifies which events to trace or how to trace them. The format of the expression is: @@ -349,8 +342,10 @@ is one of .BR raw , .BR signal , .BR read , +.BR write , +.BR fault , or -.B write +.B inject and .I value is a qualifier-dependent symbol or number. The default @@ -475,41 +470,199 @@ Note that this is independent from the normal tracing of the system call which is controlled by the option .BR -e "\ " trace = write . .TP +\fB\-e\ inject\fR=\,\fIset\/\fR[:\fBerror\fR=\,\fIerrno\/\fR|:\fBretval\fR=\,\fIvalue\/\fR][:\fBsignal\fR=\,\fIsig\/\fR][:\fBwhen\fR=\,\fIexpr\/\fR] +Perform syscall tampering for the specified set of syscalls. + +At least one of +.BR error , +.BR retval , +or +.B signal +options has to be specified. +.B error +and +.B retval +are mutually exclusive. + +If :\fBerror\fR=\,\fIerrno\/\fR option is specified, +a fault is injected into a syscall invocation: +the syscall number is replaced by -1 which corresponds to an invalid syscall, +and the error code is specified using a symbolic +.I errno +value like +.B ENOSYS +or a numeric value within 1..4095 range. + +If :\fBretval\fR=\,\fIvalue\/\fR option is specified, +success injection is performed: the syscall number is replaced by -1, +but a bogus success value is returned to the callee. + +If :\fBsignal\fR=\,\fIsig\/\fR option is specified with either a symbolic value +like +.B SIGSEGV +or a numeric value within 1..\fBSIGRTMAX\fR range, +that signal is delivered on entering every syscall specified by the +.IR set . + +If :\fBsignal\fR=\,\fIsig\/\fR option is specified without +:\fBerror\fR=\,\fIerrno\/\fR or :\fBretval\fR=\,\fIvalue\/\fR options, +then only a signal +.I sig +is delivered without a syscall fault injection. +Conversely, :\fBerror\fR=\,\fIerrno\/\fR or +:\fBretval\fR=\,\fIvalue\/\fR option without +:\fBsignal\fR=\,\fIsig\/\fR option injects a fault without delivering a signal. + +If both :\fBerror\fR=\,\fIerrno\/\fR or :\fBretval\fR=\,\fIvalue\/\fR +and :\fBsignal\fR=\,\fIsig\/\fR options are specified, then both +a fault or success is injected and a signal is delivered. + +Unless a :\fBwhen\fR=\,\fIexpr\fR subexpression is specified, +an injection is being made into every invocation of each syscall from the +.IR set . + +The format of the subexpression is one of the following: +.RS +.IP "" 2 +.I first +.RS 4 +For every syscall from the +.IR set , +perform an injection for the syscall invocation number +.I first +only. +.RE +.IP "" 2 +\fIfirst\/\fB+\fR +.RS 4 +For every syscall from the +.IR set , +perform injections for the syscall invocation number +.I first +and all subsequent invocations. +.RE +.IP "" 2 +\fIfirst\/\fB+\fIstep\fR +.RS 4 +For every syscall from the +.IR set , +perform injections for syscall invocations number +.IR first , +.IR first + step , +.IR first + step + step , +and so on. +.RE +.RE +.IP +For example, to fail each third and subsequent chdir syscalls with +.BR ENOENT , +use +\fB\-e\ inject\fR=\,\fIchdir\/\fR:\fBerror\fR=\,\fIENOENT\/\fR:\fBwhen\fR=\,\fI3\/\fB+\fR. + +The valid range for numbers +.I first +and +.I step +is 1..65535. + +An injection expression can contain only one +.BR error = +or +.BR retval = +specification. +If an injection expression contains multiple +.BR when = +specifications, the last one takes precedence. + +Accounting of syscalls that are subject to injection +is done per syscall and per tracee. + +Specification of syscall injection can be combined +with other syscall filtering options, for example, +\fB\-P \fI/dev/urandom \fB\-e inject\fR=\,\fIfile\/\fR:\fBerror\fR=\,\fIENOENT\fR. + +.TP +\fB\-e\ fault\fR=\,\fIset\/\fR[:\fBerror\fR=\,\fIerrno\/\fR][:\fBwhen\fR=\,\fIexpr\/\fR] +Perform syscall fault injection for the specified set of syscalls. + +This is equivalent to more generic +\fB\-e\ inject\fR= expression with default value of +.I errno +option set to +.IR ENOSYS . + +.TP +.BI "\-P " path +Trace only system calls accessing +.IR path . +Multiple +.B \-P +options can be used to specify several paths. +.TP +.B \-v +Print unabbreviated versions of environment, stat, termios, etc. +calls. These structures are very common in calls and so the default +behavior displays a reasonable subset of structure members. Use +this option to get all of the gory details. +.SS Tracing +.TP 12 +.BI "\-b " syscall +If specified syscall is reached, detach from traced process. +Currently, only +.I execve +syscall is supported. This option is useful if you want to trace +multi-threaded process and therefore require -f, but don't want +to trace its (potentially very complex) children. +.TP +.B \-D +Run tracer process as a detached grandchild, not as parent of the +tracee. This reduces the visible effect of +.B strace +by keeping the tracee a direct child of the calling process. +.TP +.B \-f +Trace child processes as they are created by currently traced +processes as a result of the +.BR fork (2), +.BR vfork (2) +and +.BR clone (2) +system calls. Note that +.B \-p +.I PID +.B \-f +will attach all threads of process PID if it is multi-threaded, +not only thread with thread_id = PID. +.TP +.B \-ff +If the +.B \-o +.I filename +option is in effect, each processes trace is written to +.I filename.pid +where pid is the numeric process id of each process. +This is incompatible with +.BR \-c , +since no per-process counts are kept. +.TP .BI "\-I " interruptible When strace can be interrupted by signals (such as pressing ^C). 1: no signals are blocked; 2: fatal signals are blocked while decoding syscall (default); 3: fatal signals are always blocked (default if '-o FILE PROG'); 4: fatal signals and SIGTSTP (^Z) are always blocked (useful to make strace -o FILE PROG not stop on ^Z). +.SS Startup +.TP 12 +\fB\-E\ \fIvar\fR=\,\fIval\fR +Run command with +.IR var = val +in its list of environment variables. .TP -.BI "\-o " filename -Write the trace output to the file -.I filename -rather than to stderr. -Use -.I filename.pid -if -.B \-ff -is used. -If the argument begins with '|' or with '!' then the rest of the -argument is treated as a command and all output is piped to it. -This is convenient for piping the debugging output to a program -without affecting the redirections of executed programs. -.TP -.BI "\-O " overhead -Set the overhead for tracing system calls to -.I overhead -microseconds. -This is useful for overriding the default heuristic for guessing -how much time is spent in mere measuring when timing system calls using -the -.B \-c -option. The accuracy of the heuristic can be gauged by timing a given -program run without tracing (using -.BR time (1)) -and comparing the accumulated -system call time to the total produced using -.BR \-c . +.BI "\-E " var +Remove +.IR var +from the inherited list of environment variables before passing it on to +the command. .TP .BI "\-p " pid Attach to the process with the process @@ -524,32 +677,13 @@ will respond by detaching itself from the traced process(es) leaving it (them) to continue running. Multiple .B \-p -options can be used to attach to many processes. --p "`pidof PROG`" syntax is supported. -.TP -.BI "\-P " path -Trace only system calls accessing -.I path. -Multiple -.B \-P -options can be used to specify several paths. -.TP -.BI "\-s " strsize -Specify the maximum string size to print (the default is 32). Note -that filenames are not considered strings and are always printed in -full. -.TP -.BI "\-S " sortby -Sort the output of the histogram printed by the -.B \-c -option by the specified criterion. Legal values are -.BR time , -.BR calls , -.BR name , -and -.B nothing -(default is -.BR time ). +options can be used to attach to many processes in addition to +.I command +(which is optional if at least one +.B \-p +option is given). +.B \-p +"`pidof PROG`" syntax is supported. .TP .BI "\-u " username Run command with the user \s-1ID\s0, group \s-2ID\s0, and @@ -559,17 +693,23 @@ This option is only useful when running as root and enables the correct execution of setuid and/or setgid binaries. Unless this option is used setuid and setgid programs are executed without effective privileges. +.SS Miscellaneous +.TP 12 +.B \-d +Show some debugging output of +.B strace +itself on the standard error. .TP -\fB\-E\ \fIvar\fR=\,\fIval\fR -Run command with -.IR var = val -in its list of environment variables. +.B \-F +This option is now obsolete and it has the same functionality as +.BR \-f . .TP -.BI "\-E " var -Remove -.IR var -from the inherited list of environment variables before passing it on to -the command. +.B \-h +Print the help summary. +.TP +.B \-V +Print the version number of +.BR strace . .SH DIAGNOSTICS When .I command @@ -590,10 +730,13 @@ unless is used. .LP When using -.BR \-p , +.B \-p +without a +.IR command , the exit status of .B strace -is zero unless there was an unexpected error in doing the tracing. +is zero unless no processes has been attached or there was an unexpected error +in doing the tracing. .SH "SETUID INSTALLATION" If .B strace @@ -620,11 +763,6 @@ If you do use this feature, please remember to install a non-setuid version of .B strace for ordinary lusers to use. -.SH "SEE ALSO" -.BR ltrace (1), -.BR time (1), -.BR ptrace (2), -.BR proc (5) .SH NOTES It is a pity that so much tracing clutter is produced by systems employing shared libraries. @@ -648,6 +786,18 @@ discrepancies are normal but idiosyncratic characteristics of the system call interface and are accounted for by C library wrapper functions. .LP +Some system calls have different names in different architectures and +personalities. In these cases, system call filtering and printing +uses the names that match corresponding +.BR __NR_ * +kernel macros of the tracee's architecture and personality. +There are two exceptions from this general rule: +.BR arm_fadvise64_64 (2) +ARM syscall and +.BR xtensa_fadvise64_64 (2) +Xtensa syscall are filtered and printed as +.BR fadvise64_64 (2). +.LP On some platforms a process that is attached to with the .B \-p option may observe a spurious EINTR return from the current @@ -705,9 +855,14 @@ automatic configuration support. In 1995 he ported .B strace to Irix and tired of writing about himself in the third person. -.SH PROBLEMS +.SH REPORTING BUGS Problems with .B strace should be reported to the .B strace mailing list at . +.SH "SEE ALSO" +.BR ltrace (1), +.BR time (1), +.BR ptrace (2), +.BR proc (5) diff --git a/strace.c b/strace.c index 2bc5c675..7214e6ef 100644 --- a/strace.c +++ b/strace.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -42,9 +43,12 @@ #ifdef HAVE_PRCTL # include #endif -#if defined(IA64) -# include -#endif +#include + +#include "scno.h" +#include "ptrace.h" +#include "printsiginfo.h" + /* In some libc, these aren't declared. Do it ourself: */ extern char **environ; extern int optind; @@ -55,15 +59,7 @@ extern char *optarg; bool stack_trace_enabled = false; #endif -#if defined __NR_tkill -# define my_tkill(tid, sig) syscall(__NR_tkill, (tid), (sig)) -#else - /* kill() may choose arbitrarily the target task of the process group - while we later wait on a that specific TID. PID process waits become - TID task specific waits for a process under ptrace(2). */ -# warning "tkill(2) not available, risk of strace hangs!" -# define my_tkill(tid, sig) kill((tid), (sig)) -#endif +#define my_tkill(tid, sig) syscall(__NR_tkill, (tid), (sig)) /* Glue for systems without a MMU that cannot provide fork() */ #if !defined(HAVE_FORK) @@ -74,18 +70,18 @@ bool stack_trace_enabled = false; # define fork() vfork() #endif +const unsigned int syscall_trap_sig = SIGTRAP | 0x80; + cflag_t cflag = CFLAG_NONE; unsigned int followfork = 0; -unsigned int ptrace_setoptions = 0; +unsigned int ptrace_setoptions = PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC + | PTRACE_O_TRACEEXIT; unsigned int xflag = 0; -bool need_fork_exec_workarounds = 0; bool debug_flag = 0; bool Tflag = 0; bool iflag = 0; bool count_wallclock = 0; unsigned int qflag = 0; -/* Which WSTOPSIG(status) value marks syscall traps? */ -static unsigned int syscall_trap_sig = SIGTRAP; static unsigned int tflag = 0; static bool rflag = 0; static bool print_pid_pfx = 0; @@ -132,12 +128,8 @@ bool not_failing_only = 0; unsigned int show_fd_path = 0; static bool detach_on_execve = 0; -/* Are we "strace PROG" and need to skip detach on first execve? */ -static bool skip_one_b_execve = 0; -/* Are we "strace PROG" and need to hide everything until execve? */ -bool hide_log_until_execve = 0; -static int exit_code = 0; +static int exit_code; static int strace_child = 0; static int strace_tracer_pid = 0; @@ -195,52 +187,83 @@ strerror(int err_no) #endif /* HAVE_STERRROR */ static void -usage(FILE *ofp, int exitval) +print_version(void) +{ + printf("%s -- version %s\n" + "Copyright (C) %s The strace developers <%s>.\n" + "This is free software; see the source for copying conditions. There is NO\n" + "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", + PACKAGE_NAME, PACKAGE_VERSION, "1991-2017", PACKAGE_URL); +} + +static void +usage(void) { - fprintf(ofp, "\ -usage: strace [-CdffhiqrtttTvVxxy] [-I n] [-e expr]...\n\ + printf("\ +usage: strace [-CdffhiqrtttTvVwxxy] [-I n] [-e expr]...\n\ [-a column] [-o file] [-s strsize] [-P path]...\n\ -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]\n\ - or: strace -c[df] [-I n] [-e expr]... [-O overhead] [-S sortby]\n\ + or: strace -c[dfw] [-I n] [-e expr]... [-O overhead] [-S sortby]\n\ -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]\n\ --c -- count time, calls, and errors for each syscall and report summary\n\ --C -- like -c but also print regular output\n\ --w -- summarise syscall latency (default is system time)\n\ --d -- enable debug output to stderr\n\ --D -- run tracer process as a detached grandchild, not as parent\n\ --f -- follow forks, -ff -- with output into separate files\n\ --i -- print instruction pointer at time of syscall\n\ --q -- suppress messages about attaching, detaching, etc.\n\ --r -- print relative timestamp, -t -- absolute timestamp, -tt -- with usecs\n\ --T -- print time spent in each syscall\n\ --v -- verbose mode: print unabbreviated argv, stat, termios, etc. args\n\ --x -- print non-ascii strings in hex, -xx -- print all strings in hex\n\ --y -- print paths associated with file descriptor arguments\n\ --h -- print help message, -V -- print version\n\ --a column -- alignment COLUMN for printing syscall results (default %d)\n\ --b execve -- detach on this syscall\n\ --e expr -- a qualifying expression: option=[!]all or option=[!]val1[,val2]...\n\ - options: trace, abbrev, verbose, raw, signal, read, write\n\ --I interruptible --\n\ - 1: no signals are blocked\n\ - 2: fatal signals are blocked while decoding syscall (default)\n\ - 3: fatal signals are always blocked (default if '-o FILE PROG')\n\ - 4: fatal signals and SIGTSTP (^Z) are always blocked\n\ - (useful to make 'strace -o FILE PROG' not stop on ^Z)\n\ --o file -- send trace output to FILE instead of stderr\n\ --O overhead -- set overhead for tracing syscalls to OVERHEAD usecs\n\ --p pid -- trace process with process id PID, may be repeated\n\ --s strsize -- limit length of print strings to STRSIZE chars (default %d)\n\ --S sortby -- sort syscall counts by: time, calls, name, nothing (default %s)\n\ --u username -- run command as username handling setuid and/or setgid\n\ --E var=val -- put var=val in the environment for command\n\ --E var -- remove var from the environment for command\n\ --P path -- trace accesses to path\n\ +\n\ +Output format:\n\ + -a column alignment COLUMN for printing syscall results (default %d)\n\ + -i print instruction pointer at time of syscall\n\ " #ifdef USE_LIBUNWIND -"-k obtain stack trace between each syscall (experimental)\n\ +"\ + -k obtain stack trace between each syscall (experimental)\n\ " #endif +"\ + -o file send trace output to FILE instead of stderr\n\ + -q suppress messages about attaching, detaching, etc.\n\ + -r print relative timestamp\n\ + -s strsize limit length of print strings to STRSIZE chars (default %d)\n\ + -t print absolute timestamp\n\ + -tt print absolute timestamp with usecs\n\ + -T print time spent in each syscall\n\ + -x print non-ascii strings in hex\n\ + -xx print all strings in hex\n\ + -y print paths associated with file descriptor arguments\n\ + -yy print protocol specific information associated with socket file descriptors\n\ +\n\ +Statistics:\n\ + -c count time, calls, and errors for each syscall and report summary\n\ + -C like -c but also print regular output\n\ + -O overhead set overhead for tracing syscalls to OVERHEAD usecs\n\ + -S sortby sort syscall counts by: time, calls, name, nothing (default %s)\n\ + -w summarise syscall latency (default is system time)\n\ +\n\ +Filtering:\n\ + -e expr a qualifying expression: option=[!]all or option=[!]val1[,val2]...\n\ + options: trace, abbrev, verbose, raw, signal, read, write, fault\n\ + -P path trace accesses to path\n\ +\n\ +Tracing:\n\ + -b execve detach on execve syscall\n\ + -D run tracer process as a detached grandchild, not as parent\n\ + -f follow forks\n\ + -ff follow forks with output into separate files\n\ + -I interruptible\n\ + 1: no signals are blocked\n\ + 2: fatal signals are blocked while decoding syscall (default)\n\ + 3: fatal signals are always blocked (default if '-o FILE PROG')\n\ + 4: fatal signals and SIGTSTP (^Z) are always blocked\n\ + (useful to make 'strace -o FILE PROG' not stop on ^Z)\n\ +\n\ +Startup:\n\ + -E var remove var from the environment for command\n\ + -E var=val put var=val in the environment for command\n\ + -p pid trace process with process id PID, may be repeated\n\ + -u username run command as username handling setuid and/or setgid\n\ +\n\ +Miscellaneous:\n\ + -d enable debug output to stderr\n\ + -v verbose mode: print unabbreviated argv, stat, termios, etc. args\n\ + -h print help message\n\ + -V print version\n\ +" /* ancient, no one should use it -F -- attempt to follow vforks (deprecated, use -f)\n\ */ @@ -248,11 +271,11 @@ usage: strace [-CdffhiqrtttTvVxxy] [-I n] [-e expr]...\n\ -z -- print only succeeding syscalls\n\ */ , DEFAULT_ACOLUMN, DEFAULT_STRLEN, DEFAULT_SORTBY); - exit(exitval); + exit(0); } -static void die(void) __attribute__ ((noreturn)); -static void die(void) +static void ATTRIBUTE_NORETURN +die(void) { if (strace_tracer_pid == getpid()) { cflag = 0; @@ -308,6 +331,17 @@ void error_msg_and_die(const char *fmt, ...) die(); } +void error_msg_and_help(const char *fmt, ...) +{ + if (fmt != NULL) { + va_list p; + va_start(p, fmt); + verror_msg(0, fmt, p); + } + fprintf(stderr, "Try '%s -h' for more information.\n", progname); + die(); +} + void perror_msg(const char *fmt, ...) { va_list p; @@ -324,37 +358,32 @@ void perror_msg_and_die(const char *fmt, ...) die(); } -void die_out_of_memory(void) -{ - static bool recursed = 0; - if (recursed) - exit(1); - recursed = 1; - error_msg_and_die("Out of memory"); -} - static void error_opt_arg(int opt, const char *arg) { - error_msg_and_die("Invalid -%c argument: '%s'", opt, arg); + error_msg_and_help("invalid -%c argument: '%s'", opt, arg); } -#if USE_SEIZE +static const char *ptrace_attach_cmd; + static int ptrace_attach_or_seize(int pid) { +#if USE_SEIZE int r; if (!use_seize) - return ptrace(PTRACE_ATTACH, pid, 0L, 0L); - r = ptrace(PTRACE_SEIZE, pid, 0L, (unsigned long)ptrace_setoptions); + return ptrace_attach_cmd = "PTRACE_ATTACH", + ptrace(PTRACE_ATTACH, pid, 0L, 0L); + r = ptrace(PTRACE_SEIZE, pid, 0L, (unsigned long) ptrace_setoptions); if (r) - return r; + return ptrace_attach_cmd = "PTRACE_SEIZE", r; r = ptrace(PTRACE_INTERRUPT, pid, 0L, 0L); - return r; -} + return ptrace_attach_cmd = "PTRACE_INTERRUPT", r; #else -# define ptrace_attach_or_seize(pid) ptrace(PTRACE_ATTACH, (pid), 0, 0) + return ptrace_attach_cmd = "PTRACE_ATTACH", + ptrace(PTRACE_ATTACH, pid, 0L, 0L); #endif +} /* * Used when we want to unblock stopped traced process. @@ -364,26 +393,31 @@ ptrace_attach_or_seize(int pid) * Otherwise prints error message and returns -1. */ static int -ptrace_restart(int op, struct tcb *tcp, int sig) +ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig) { int err; const char *msg; errno = 0; - ptrace(op, tcp->pid, (void *) 0, (long) sig); + ptrace(op, tcp->pid, 0L, (unsigned long) sig); err = errno; if (!err) return 0; - msg = "SYSCALL"; - if (op == PTRACE_CONT) - msg = "CONT"; - if (op == PTRACE_DETACH) - msg = "DETACH"; -#ifdef PTRACE_LISTEN - if (op == PTRACE_LISTEN) - msg = "LISTEN"; -#endif + switch (op) { + case PTRACE_CONT: + msg = "CONT"; + break; + case PTRACE_DETACH: + msg = "DETACH"; + break; + case PTRACE_LISTEN: + msg = "LISTEN"; + break; + default: + msg = "SYSCALL"; + } + /* * Why curcol != 0? Otherwise sometimes we get this: * @@ -400,7 +434,7 @@ ptrace_restart(int op, struct tcb *tcp, int sig) if (err == ESRCH) return 0; errno = err; - perror_msg("ptrace(PTRACE_%s,pid:%d,sig:%d)", msg, tcp->pid, sig); + perror_msg("ptrace(PTRACE_%s,pid:%d,sig:%u)", msg, tcp->pid, sig); return -1; } @@ -426,7 +460,8 @@ set_cloexec_flag(int fd) fcntl(fd, F_SETFD, newflags); /* never fails */ } -static void kill_save_errno(pid_t pid, int sig) +static void +kill_save_errno(pid_t pid, int sig) { int saved_errno = errno; @@ -541,7 +576,7 @@ tprintf(const char *fmt, ...) va_start(args, fmt); if (current_tcp) { - int n = strace_vfprintf(current_tcp->outf, fmt, args); + int n = vfprintf(current_tcp->outf, fmt, args); if (n < 0) { if (current_tcp->outf != stderr) perror_msg("%s", outfname); @@ -670,26 +705,31 @@ newoutf(struct tcb *tcp) static void expand_tcbtab(void) { - /* Allocate some more TCBs and expand the table. + /* Allocate some (more) TCBs (and expand the table). We don't want to relocate the TCBs because our callers have pointers and it would be a pain. So tcbtab is a table of pointers. Since we never free the TCBs, we allocate a single chunk of many. */ - int i = tcbtabsize; - struct tcb *newtcbs = calloc(tcbtabsize, sizeof(newtcbs[0])); - struct tcb **newtab = realloc(tcbtab, tcbtabsize * 2 * sizeof(tcbtab[0])); - if (!newtab || !newtcbs) - die_out_of_memory(); - tcbtabsize *= 2; - tcbtab = newtab; - while (i < tcbtabsize) - tcbtab[i++] = newtcbs++; + unsigned int new_tcbtabsize, alloc_tcbtabsize; + struct tcb *newtcbs; + + if (tcbtabsize) { + alloc_tcbtabsize = tcbtabsize; + new_tcbtabsize = tcbtabsize * 2; + } else { + new_tcbtabsize = alloc_tcbtabsize = 1; + } + + newtcbs = xcalloc(alloc_tcbtabsize, sizeof(newtcbs[0])); + tcbtab = xreallocarray(tcbtab, new_tcbtabsize, sizeof(tcbtab[0])); + while (tcbtabsize < new_tcbtabsize) + tcbtab[tcbtabsize++] = newtcbs++; } static struct tcb * alloctcb(int pid) { - int i; + unsigned int i; struct tcb *tcp; if (nprocs == tcbtabsize) @@ -711,19 +751,57 @@ alloctcb(int pid) nprocs++; if (debug_flag) - fprintf(stderr, "new tcb for pid %d, active tcbs:%d\n", tcp->pid, nprocs); + error_msg("new tcb for pid %d, active tcbs:%d", + tcp->pid, nprocs); return tcp; } } error_msg_and_die("bug in alloctcb"); } +void * +get_tcb_priv_data(const struct tcb *tcp) +{ + return tcp->_priv_data; +} + +int +set_tcb_priv_data(struct tcb *tcp, void *const priv_data, + void (*const free_priv_data)(void *)) +{ + if (tcp->_priv_data) + return -1; + + tcp->_free_priv_data = free_priv_data; + tcp->_priv_data = priv_data; + + return 0; +} + +void +free_tcb_priv_data(struct tcb *tcp) +{ + if (tcp->_priv_data) { + if (tcp->_free_priv_data) { + tcp->_free_priv_data(tcp->_priv_data); + tcp->_free_priv_data = NULL; + } + tcp->_priv_data = NULL; + } +} + static void droptcb(struct tcb *tcp) { if (tcp->pid == 0) return; + int p; + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) + free(tcp->inject_vec[p]); + + free_tcb_priv_data(tcp); + #ifdef USE_LIBUNWIND if (stack_trace_enabled) { unwind_tcb_fin(tcp); @@ -732,7 +810,8 @@ droptcb(struct tcb *tcp) nprocs--; if (debug_flag) - fprintf(stderr, "dropped tcb for pid %d, %d remain\n", tcp->pid, nprocs); + error_msg("dropped tcb for pid %d, %d remain", + tcp->pid, nprocs); if (tcp->outf) { if (followfork >= 2) { @@ -765,18 +844,11 @@ detach(struct tcb *tcp) int error; int status; - if (tcp->flags & TCB_BPTSET) - clearbpt(tcp); - /* * Linux wrongly insists the child be stopped * before detaching. Arghh. We go through hoops * to make a clean break of things. */ -#if defined(SPARC) -# undef PTRACE_DETACH -# define PTRACE_DETACH PTRACE_SUNDETACH -#endif if (!(tcp->flags & TCB_ATTACHED)) goto drop; @@ -837,7 +909,7 @@ detach(struct tcb *tcp) * 3. Attach SIGSTOP was already pending (TCB_IGNORE_ONE_SIGSTOP set) */ for (;;) { - int sig; + unsigned int sig; if (waitpid(tcp->pid, &status, __WALL) < 0) { if (errno == EINTR) continue; @@ -864,8 +936,8 @@ detach(struct tcb *tcp) } sig = WSTOPSIG(status); if (debug_flag) - fprintf(stderr, "detach wait: event:%d sig:%d\n", - (unsigned)status >> 16, sig); + error_msg("detach wait: event:%d sig:%d", + (unsigned)status >> 16, sig); if (use_seize) { unsigned event = (unsigned)status >> 16; if (event == PTRACE_EVENT_STOP /*&& sig == SIGTRAP*/) { @@ -918,7 +990,7 @@ detach(struct tcb *tcp) drop: if (!qflag && (tcp->flags & TCB_ATTACHED)) - fprintf(stderr, "Process %u detached\n", tcp->pid); + error_msg("Process %u detached", tcp->pid); droptcb(tcp); } @@ -951,10 +1023,74 @@ process_opt_p_list(char *opt) } } +static void +attach_tcb(struct tcb *const tcp) +{ + if (ptrace_attach_or_seize(tcp->pid) < 0) { + perror_msg("attach: ptrace(%s, %d)", + ptrace_attach_cmd, tcp->pid); + droptcb(tcp); + return; + } + + tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; + newoutf(tcp); + if (debug_flag) + error_msg("attach to pid %d (main) succeeded", tcp->pid); + + char procdir[sizeof("/proc/%d/task") + sizeof(int) * 3]; + DIR *dir; + unsigned int ntid = 0, nerr = 0; + + if (followfork && tcp->pid != strace_child && + sprintf(procdir, "/proc/%d/task", tcp->pid) > 0 && + (dir = opendir(procdir)) != NULL) { + struct_dirent *de; + + while ((de = read_dir(dir)) != NULL) { + if (de->d_fileno == 0) + continue; + + int tid = string_to_uint(de->d_name); + if (tid <= 0 || tid == tcp->pid) + continue; + + ++ntid; + if (ptrace_attach_or_seize(tid) < 0) { + ++nerr; + if (debug_flag) + perror_msg("attach: ptrace(%s, %d)", + ptrace_attach_cmd, tid); + continue; + } + if (debug_flag) + error_msg("attach to pid %d succeeded", tid); + + struct tcb *tid_tcp = alloctcb(tid); + tid_tcp->flags |= TCB_ATTACHED | TCB_STARTUP | + post_attach_sigstop; + newoutf(tid_tcp); + } + + closedir(dir); + } + + if (!qflag) { + if (ntid > nerr) + error_msg("Process %u attached" + " with %u threads", + tcp->pid, ntid - nerr + 1); + else + error_msg("Process %u attached", + tcp->pid); + } +} + static void startup_attach(void) { - int tcbi; + pid_t parent_pid = strace_tracer_pid; + unsigned int tcbi; struct tcb *tcp; /* @@ -996,94 +1132,32 @@ startup_attach(void) if (tcp->flags & TCB_ATTACHED) continue; /* no, we already attached it */ - if (followfork && !daemonized_tracer) { - char procdir[sizeof("/proc/%d/task") + sizeof(int) * 3]; - DIR *dir; - - sprintf(procdir, "/proc/%d/task", tcp->pid); - dir = opendir(procdir); - if (dir != NULL) { - unsigned int ntid = 0, nerr = 0; - struct_dirent *de; - - while ((de = read_dir(dir)) != NULL) { - struct tcb *cur_tcp; - int tid; - - if (de->d_fileno == 0) - continue; - /* we trust /proc filesystem */ - tid = atoi(de->d_name); - if (tid <= 0) - continue; - ++ntid; - if (ptrace_attach_or_seize(tid) < 0) { - ++nerr; - if (debug_flag) - fprintf(stderr, "attach to pid %d failed\n", tid); - continue; - } - if (debug_flag) - fprintf(stderr, "attach to pid %d succeeded\n", tid); - cur_tcp = tcp; - if (tid != tcp->pid) - cur_tcp = alloctcb(tid); - cur_tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; - newoutf(cur_tcp); - } - closedir(dir); - if (interactive) { - sigprocmask(SIG_SETMASK, &empty_set, NULL); - if (interrupted) - goto ret; - sigprocmask(SIG_BLOCK, &blocked_set, NULL); - } - ntid -= nerr; - if (ntid == 0) { - perror_msg("attach: ptrace(PTRACE_ATTACH, ...)"); - droptcb(tcp); - continue; - } - if (!qflag) { - fprintf(stderr, ntid > 1 -? "Process %u attached with %u threads\n" -: "Process %u attached\n", - tcp->pid, ntid); - } - if (!(tcp->flags & TCB_ATTACHED)) { - /* -p PID, we failed to attach to PID itself - * but did attach to some of its sibling threads. - * Drop PID's tcp. - */ - droptcb(tcp); - } - continue; - } /* if (opendir worked) */ - } /* if (-f) */ - if (ptrace_attach_or_seize(tcp->pid) < 0) { - perror_msg("attach: ptrace(PTRACE_ATTACH, ...)"); + if (tcp->pid == parent_pid || tcp->pid == strace_tracer_pid) { + errno = EPERM; + perror_msg("attach: pid %d", tcp->pid); droptcb(tcp); continue; } - tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; - newoutf(tcp); - if (debug_flag) - fprintf(stderr, "attach to pid %d (main) succeeded\n", tcp->pid); - if (daemonized_tracer) { - /* - * Make parent go away. - * Also makes grandparent's wait() unblock. - */ - kill(getppid(), SIGKILL); - } + attach_tcb(tcp); - if (!qflag) - fprintf(stderr, - "Process %u attached\n", - tcp->pid); + if (interactive) { + sigprocmask(SIG_SETMASK, &empty_set, NULL); + if (interrupted) + goto ret; + sigprocmask(SIG_BLOCK, &blocked_set, NULL); + } } /* for each tcbtab[] */ + if (daemonized_tracer) { + /* + * Make parent go away. + * Also makes grandparent's wait() unblock. + */ + kill(parent_pid, SIGKILL); + strace_child = 0; + } + ret: if (interactive) sigprocmask(SIG_SETMASK, &empty_set, NULL); @@ -1100,7 +1174,8 @@ struct exec_params { char *pathname; }; static struct exec_params params_for_tracee; -static void __attribute__ ((noinline, noreturn)) + +static void ATTRIBUTE_NOINLINE ATTRIBUTE_NORETURN exec_or_die(void) { struct exec_params *params = ¶ms_for_tracee; @@ -1155,21 +1230,88 @@ exec_or_die(void) perror_msg_and_die("exec"); } +/* + * Open a dummy descriptor for use as a placeholder. + * The descriptor is O_RDONLY with FD_CLOEXEC flag set. + * A read attempt from such descriptor ends with EOF, + * a write attempt is rejected with EBADF. + */ +static int +open_dummy_desc(void) +{ + int fds[2]; + + if (pipe(fds)) + perror_msg_and_die("pipe"); + close(fds[1]); + set_cloexec_flag(fds[0]); + return fds[0]; +} + +/* placeholder fds status for stdin and stdout */ +static bool fd_is_placeholder[2]; + +/* + * Ensure that all standard file descriptors are open by opening placeholder + * file descriptors for those standard file descriptors that are not open. + * + * The information which descriptors have been made open is saved + * in fd_is_placeholder for later use. + */ +static void +ensure_standard_fds_opened(void) +{ + int fd; + + while ((fd = open_dummy_desc()) <= 2) { + if (fd == 2) + break; + fd_is_placeholder[fd] = true; + } + + if (fd > 2) + close(fd); +} + +/* + * Redirect stdin and stdout unless they have been opened earlier + * by ensure_standard_fds_opened as placeholders. + */ +static void +redirect_standard_fds(void) +{ + int i; + + /* + * It might be a good idea to redirect stderr as well, + * but we sometimes need to print error messages. + */ + for (i = 0; i <= 1; ++i) { + if (!fd_is_placeholder[i]) { + close(i); + open_dummy_desc(); + } + } +} + static void startup_child(char **argv) { struct_stat statbuf; const char *filename; - char pathname[MAXPATHLEN]; + size_t filename_len; + char pathname[PATH_MAX]; int pid; struct tcb *tcp; filename = argv[0]; + filename_len = strlen(filename); + + if (filename_len > sizeof(pathname) - 1) { + errno = ENAMETOOLONG; + perror_msg_and_die("exec"); + } if (strchr(filename, '/')) { - if (strlen(filename) > sizeof pathname - 1) { - errno = ENAMETOOLONG; - perror_msg_and_die("exec"); - } strcpy(pathname, filename); } #ifdef USE_DEBUGGING_EXEC @@ -1183,7 +1325,7 @@ startup_child(char **argv) #endif /* USE_DEBUGGING_EXEC */ else { const char *path; - int m, n, len; + size_t m, n, len; for (path = getenv("PATH"); path && *path; path += m) { const char *colon = strchr(path, ':'); @@ -1194,7 +1336,7 @@ startup_child(char **argv) else m = n = strlen(path); if (n == 0) { - if (!getcwd(pathname, MAXPATHLEN)) + if (!getcwd(pathname, PATH_MAX)) continue; len = strlen(pathname); } @@ -1206,6 +1348,8 @@ startup_child(char **argv) } if (len && pathname[len - 1] != '/') pathname[len++] = '/'; + if (filename_len + len > sizeof(pathname) - 1) + continue; strcpy(pathname + len, filename); if (stat_file(pathname, &statbuf) == 0 && /* Accept only regular files @@ -1215,6 +1359,8 @@ startup_child(char **argv) (statbuf.st_mode & 0111)) break; } + if (!path || !*path) + pathname[0] = '\0'; } if (stat_file(pathname, &statbuf) < 0) { perror_msg_and_die("Can't stat '%s'", filename); @@ -1228,7 +1374,7 @@ startup_child(char **argv) * On NOMMU, can be safely freed only after execve in tracee. * It's hard to know when that happens, so we just leak it. */ - params_for_tracee.pathname = NOMMU_SYSTEM ? strdup(pathname) : pathname; + params_for_tracee.pathname = NOMMU_SYSTEM ? xstrdup(pathname) : pathname; #if defined HAVE_PRCTL && defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY if (daemonized_tracer) @@ -1266,7 +1412,8 @@ startup_child(char **argv) } if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { kill_save_errno(pid, SIGKILL); - perror_msg_and_die("Unexpected wait status %x", status); + perror_msg_and_die("Unexpected wait status %#x", + status); } } /* Else: NOMMU case, we have no way to sync. @@ -1276,24 +1423,24 @@ startup_child(char **argv) if (ptrace_attach_or_seize(pid)) { kill_save_errno(pid, SIGKILL); - perror_msg_and_die("Can't attach to %d", pid); + perror_msg_and_die("attach: ptrace(%s, %d)", + ptrace_attach_cmd, pid); } if (!NOMMU_SYSTEM) kill(pid, SIGCONT); } tcp = alloctcb(pid); - if (!NOMMU_SYSTEM) - tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; - else - tcp->flags |= TCB_ATTACHED | TCB_STARTUP; + tcp->flags |= TCB_ATTACHED | TCB_STARTUP + | TCB_SKIP_DETACH_ON_FIRST_EXEC + | (NOMMU_SYSTEM ? 0 : (TCB_HIDE_LOG | post_attach_sigstop)); newoutf(tcp); } else { - /* With -D, we are *child* here, IOW: different pid. Fetch it: */ + /* With -D, we are *child* here, the tracee is our parent. */ + strace_child = strace_tracer_pid; strace_tracer_pid = getpid(); - /* The tracee is our parent: */ - pid = getppid(); - alloctcb(pid); + tcp = alloctcb(strace_child); + tcp->flags |= TCB_SKIP_DETACH_ON_FIRST_EXEC | TCB_HIDE_LOG; /* attaching will be done later, by startup_attach */ /* note: we don't do newoutf(tcp) here either! */ @@ -1307,7 +1454,7 @@ startup_child(char **argv) * instead of call (won't push anything to stack), * (2) by trying very hard in exec_or_die() * to not use any stack, - * (3) having a really big (MAXPATHLEN) stack object + * (3) having a really big (PATH_MAX) stack object * in this function, which creates a "buffer" between * child's and parent's stack pointers. * This may save us if (1) and (2) failed @@ -1318,219 +1465,18 @@ startup_child(char **argv) * to create a genuine separate stack and execute on it. */ } -} - -/* - * Test whether the kernel support PTRACE_O_TRACECLONE et al options. - * First fork a new child, call ptrace with PTRACE_SETOPTIONS on it, - * and then see which options are supported by the kernel. - */ -static int -test_ptrace_setoptions_followfork(void) -{ - int pid, expected_grandchild = 0, found_grandchild = 0; - const unsigned int test_options = PTRACE_O_TRACECLONE | - PTRACE_O_TRACEFORK | - PTRACE_O_TRACEVFORK; - - /* Need fork for test. NOMMU has no forks */ - if (NOMMU_SYSTEM) - goto worked; /* be bold, and pretend that test succeeded */ - - pid = fork(); - if (pid < 0) - perror_msg_and_die("fork"); - if (pid == 0) { - pid = getpid(); - if (ptrace(PTRACE_TRACEME, 0L, 0L, 0L) < 0) - perror_msg_and_die("%s: PTRACE_TRACEME doesn't work", - __func__); - kill_save_errno(pid, SIGSTOP); - if (fork() < 0) - perror_msg_and_die("fork"); - _exit(0); - } - - while (1) { - int status, tracee_pid; - - errno = 0; - tracee_pid = wait(&status); - if (tracee_pid <= 0) { - if (errno == EINTR) - continue; - if (errno == ECHILD) - break; - kill_save_errno(pid, SIGKILL); - perror_msg_and_die("%s: unexpected wait result %d", - __func__, tracee_pid); - } - if (WIFEXITED(status)) { - if (WEXITSTATUS(status)) { - if (tracee_pid != pid) - kill_save_errno(pid, SIGKILL); - error_msg_and_die("%s: unexpected exit status %u", - __func__, WEXITSTATUS(status)); - } - continue; - } - if (WIFSIGNALED(status)) { - if (tracee_pid != pid) - kill_save_errno(pid, SIGKILL); - error_msg_and_die("%s: unexpected signal %u", - __func__, WTERMSIG(status)); - } - if (!WIFSTOPPED(status)) { - if (tracee_pid != pid) - kill_save_errno(tracee_pid, SIGKILL); - kill_save_errno(pid, SIGKILL); - error_msg_and_die("%s: unexpected wait status %x", - __func__, status); - } - if (tracee_pid != pid) { - found_grandchild = tracee_pid; - if (ptrace(PTRACE_CONT, tracee_pid, 0, 0) < 0) { - kill_save_errno(tracee_pid, SIGKILL); - kill_save_errno(pid, SIGKILL); - perror_msg_and_die("PTRACE_CONT doesn't work"); - } - continue; - } - switch (WSTOPSIG(status)) { - case SIGSTOP: - if (ptrace(PTRACE_SETOPTIONS, pid, 0, test_options) < 0 - && errno != EINVAL && errno != EIO) - perror_msg("PTRACE_SETOPTIONS"); - break; - case SIGTRAP: - if (status >> 16 == PTRACE_EVENT_FORK) { - long msg = 0; - - if (ptrace(PTRACE_GETEVENTMSG, pid, - NULL, (long) &msg) == 0) - expected_grandchild = msg; - } - break; - } - if (ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) { - kill_save_errno(pid, SIGKILL); - perror_msg_and_die("PTRACE_SYSCALL doesn't work"); - } - } - if (expected_grandchild && expected_grandchild == found_grandchild) { - worked: - ptrace_setoptions |= test_options; - if (debug_flag) - fprintf(stderr, "ptrace_setoptions = %#x\n", - ptrace_setoptions); - return 0; - } - error_msg("Test for PTRACE_O_TRACECLONE failed, " - "giving up using this feature."); - return 1; -} - -/* - * Test whether the kernel support PTRACE_O_TRACESYSGOOD. - * First fork a new child, call ptrace(PTRACE_SETOPTIONS) on it, - * and then see whether it will stop with (SIGTRAP | 0x80). - * - * Use of this option enables correct handling of user-generated SIGTRAPs, - * and SIGTRAPs generated by special instructions such as int3 on x86: - -# compile with: gcc -nostartfiles -nostdlib -o int3 int3.S -_start: .globl _start - int3 - movl $42, %ebx - movl $1, %eax - int $0x80 - */ -static int -test_ptrace_setoptions_for_all(void) -{ - const unsigned int test_options = PTRACE_O_TRACESYSGOOD | - PTRACE_O_TRACEEXEC; - int pid; - int it_worked = 0; - - /* Need fork for test. NOMMU has no forks */ - if (NOMMU_SYSTEM) - goto worked; /* be bold, and pretend that test succeeded */ - - pid = fork(); - if (pid < 0) - perror_msg_and_die("fork"); - - if (pid == 0) { - pid = getpid(); - if (ptrace(PTRACE_TRACEME, 0L, 0L, 0L) < 0) - /* Note: exits with exitcode 1 */ - perror_msg_and_die("%s: PTRACE_TRACEME doesn't work", - __func__); - kill(pid, SIGSTOP); - _exit(0); /* parent should see entry into this syscall */ - } - - while (1) { - int status, tracee_pid; - - errno = 0; - tracee_pid = wait(&status); - if (tracee_pid <= 0) { - if (errno == EINTR) - continue; - kill_save_errno(pid, SIGKILL); - perror_msg_and_die("%s: unexpected wait result %d", - __func__, tracee_pid); - } - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) == 0) - break; - error_msg_and_die("%s: unexpected exit status %u", - __func__, WEXITSTATUS(status)); - } - if (WIFSIGNALED(status)) { - error_msg_and_die("%s: unexpected signal %u", - __func__, WTERMSIG(status)); - } - if (!WIFSTOPPED(status)) { - kill(pid, SIGKILL); - error_msg_and_die("%s: unexpected wait status %x", - __func__, status); - } - if (WSTOPSIG(status) == SIGSTOP) { - /* - * We don't check "options aren't accepted" error. - * If it happens, we'll never get (SIGTRAP | 0x80), - * and thus will decide to not use the option. - * IOW: the outcome of the test will be correct. - */ - if (ptrace(PTRACE_SETOPTIONS, pid, 0L, test_options) < 0 - && errno != EINVAL && errno != EIO) - perror_msg("PTRACE_SETOPTIONS"); - } - if (WSTOPSIG(status) == (SIGTRAP | 0x80)) { - it_worked = 1; - } - if (ptrace(PTRACE_SYSCALL, pid, 0L, 0L) < 0) { - kill_save_errno(pid, SIGKILL); - perror_msg_and_die("PTRACE_SYSCALL doesn't work"); - } - } - - if (it_worked) { - worked: - syscall_trap_sig = (SIGTRAP | 0x80); - ptrace_setoptions |= test_options; - if (debug_flag) - fprintf(stderr, "ptrace_setoptions = %#x\n", - ptrace_setoptions); - return 0; - } - - error_msg("Test for PTRACE_O_TRACESYSGOOD failed, " - "giving up using this feature."); - return 1; + /* + * A case where straced process is part of a pipe: + * { sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9' + * If strace won't close its fd#0, closing it in tracee is not enough: + * the pipe is still open, it has a reader. Thus, "head" will not get its + * SIGPIPE at once, on the first write. + * + * Preventing it by redirecting strace's stdin/out. + * (Don't leave fds 0 and 1 closed, this is bad practice: future opens + * will reuse them, unexpectedly making a newly opened object "stdin"). + */ + redirect_standard_fds(); } #if USE_SEIZE @@ -1561,7 +1507,7 @@ test_ptrace_seize(void) if (ptrace(PTRACE_SEIZE, pid, 0, 0) == 0) { post_attach_sigstop = 0; /* this sets use_seize to 1 */ } else if (debug_flag) { - fprintf(stderr, "PTRACE_SEIZE doesn't work\n"); + error_msg("PTRACE_SEIZE doesn't work"); } kill(pid, SIGKILL); @@ -1580,8 +1526,8 @@ test_ptrace_seize(void) if (WIFSIGNALED(status)) { return; } - error_msg_and_die("%s: unexpected wait status %x", - __func__, status); + error_msg_and_die("%s: unexpected wait status %#x", + __func__, status); } } #else /* !USE_SEIZE */ @@ -1629,10 +1575,9 @@ get_os_release(void) * Don't want main() to inline us and defeat the reason * we have a separate function. */ -static void __attribute__ ((noinline)) +static void ATTRIBUTE_NOINLINE init(int argc, char *argv[]) { - struct tcb *tcp; int c, i; int optF = 0; struct sigaction sa; @@ -1650,17 +1595,6 @@ init(int argc, char *argv[]) os_release = get_os_release(); - /* Allocate the initial tcbtab. */ - tcbtabsize = argc; /* Surely enough for all -p args. */ - tcbtab = calloc(tcbtabsize, sizeof(tcbtab[0])); - if (!tcbtab) - die_out_of_memory(); - tcp = calloc(tcbtabsize, sizeof(*tcp)); - if (!tcp) - die_out_of_memory(); - for (c = 0; c < tcbtabsize; c++) - tcbtab[c] = tcp++; - shared_log = stderr; set_sortby(DEFAULT_SORTBY); set_personality(DEFAULT_PERSONALITY); @@ -1687,13 +1621,13 @@ init(int argc, char *argv[]) break; case 'c': if (cflag == CFLAG_BOTH) { - error_msg_and_die("-c and -C are mutually exclusive"); + error_msg_and_help("-c and -C are mutually exclusive"); } cflag = CFLAG_ONLY_STATS; break; case 'C': if (cflag == CFLAG_ONLY_STATS) { - error_msg_and_die("-c and -C are mutually exclusive"); + error_msg_and_help("-c and -C are mutually exclusive"); } cflag = CFLAG_BOTH; break; @@ -1710,7 +1644,7 @@ init(int argc, char *argv[]) followfork++; break; case 'h': - usage(stdout, 0); + usage(); break; case 'i': iflag = 1; @@ -1720,7 +1654,7 @@ init(int argc, char *argv[]) break; case 'r': rflag = 1; - /* fall through to tflag++ */ + break; case 't': tflag++; break; @@ -1740,7 +1674,7 @@ init(int argc, char *argv[]) qualify("abbrev=none"); break; case 'V': - printf("%s -- version %s\n", PACKAGE_NAME, VERSION); + print_version(); exit(0); break; case 'z': @@ -1755,7 +1689,7 @@ init(int argc, char *argv[]) qualify(optarg); break; case 'o': - outfname = strdup(optarg); + outfname = xstrdup(optarg); break; case 'O': i = string_to_uint(optarg); @@ -1779,7 +1713,7 @@ init(int argc, char *argv[]) set_sortby(optarg); break; case 'u': - username = strdup(optarg); + username = xstrdup(optarg); break; #ifdef USE_LIBUNWIND case 'k': @@ -1791,41 +1725,39 @@ init(int argc, char *argv[]) die_out_of_memory(); break; case 'I': - opt_intr = string_to_uint(optarg); - if (opt_intr <= 0 || opt_intr >= NUM_INTR_OPTS) + opt_intr = string_to_uint_upto(optarg, NUM_INTR_OPTS - 1); + if (opt_intr <= 0) error_opt_arg(c, optarg); break; default: - usage(stderr, 1); + error_msg_and_help(NULL); break; } } argv += optind; /* argc -= optind; - no need, argc is not used below */ - acolumn_spaces = malloc(acolumn + 1); - if (!acolumn_spaces) - die_out_of_memory(); + acolumn_spaces = xmalloc(acolumn + 1); memset(acolumn_spaces, ' ', acolumn); acolumn_spaces[acolumn] = '\0'; - /* Must have PROG [ARGS], or -p PID. Not both. */ - if (!argv[0] == !nprocs) - usage(stderr, 1); + if (!argv[0] && !nprocs) { + error_msg_and_help("must have PROG [ARGS] or -p PID"); + } - if (nprocs != 0 && daemonized_tracer) { - error_msg_and_die("-D and -p are mutually exclusive"); + if (!argv[0] && daemonized_tracer) { + error_msg_and_help("PROG [ARGS] must be specified with -D"); } if (!followfork) followfork = optF; if (followfork >= 2 && cflag) { - error_msg_and_die("(-c or -C) and -ff are mutually exclusive"); + error_msg_and_help("(-c or -C) and -ff are mutually exclusive"); } if (count_wallclock && !cflag) { - error_msg_and_die("-w must be given with (-c or -C)"); + error_msg_and_help("-w must be given with (-c or -C)"); } if (cflag == CFLAG_ONLY_STATS) { @@ -1845,9 +1777,21 @@ init(int argc, char *argv[]) error_msg("-%c has no effect with -c", 'y'); } + if (rflag) { + if (tflag > 1) + error_msg("-tt has no effect with -r"); + tflag = 1; + } + #ifdef USE_LIBUNWIND - if (stack_trace_enabled) + if (stack_trace_enabled) { + unsigned int tcbi; + unwind_init(); + for (tcbi = 0; tcbi < tcbtabsize; ++tcbi) { + unwind_tcb_init(tcbtab[tcbi]); + } + } #endif /* See if they want to run as another user. */ @@ -1869,16 +1813,27 @@ init(int argc, char *argv[]) run_gid = getgid(); } - /* - * On any reasonably recent Linux kernel (circa about 2.5.46) - * need_fork_exec_workarounds should stay 0 after these tests: - */ - /*need_fork_exec_workarounds = 0; - already is */ if (followfork) - need_fork_exec_workarounds = test_ptrace_setoptions_followfork(); - need_fork_exec_workarounds |= test_ptrace_setoptions_for_all(); + ptrace_setoptions |= PTRACE_O_TRACECLONE | + PTRACE_O_TRACEFORK | + PTRACE_O_TRACEVFORK; + if (debug_flag) + error_msg("ptrace_setoptions = %#x", ptrace_setoptions); test_ptrace_seize(); + /* + * Is something weird with our stdin and/or stdout - + * for example, may they be not open? In this case, + * ensure that none of the future opens uses them. + * + * This was seen in the wild when /proc/sys/kernel/core_pattern + * was set to "|/bin/strace -o/tmp/LOG PROG": + * kernel runs coredump helper with fd#0 open but fd#1 closed (!), + * therefore LOG gets opened to fd#1, and fd#1 is closed by + * "don't hold up stdin/out open" code soon after. + */ + ensure_standard_fds_opened(); + /* Check if they want to redirect the output. */ if (outfname) { /* See if they want to pipe the output. */ @@ -1888,7 +1843,7 @@ init(int argc, char *argv[]) * when using popen, so prohibit it. */ if (followfork >= 2) - error_msg_and_die("Piping the output and -ff are mutually exclusive"); + error_msg_and_help("piping the output and -ff are mutually exclusive"); shared_log = strace_popen(outfname + 1); } else if (followfork < 2) @@ -1900,23 +1855,21 @@ init(int argc, char *argv[]) } if (!outfname || outfname[0] == '|' || outfname[0] == '!') { - char *buf = malloc(BUFSIZ); - if (!buf) - die_out_of_memory(); - setvbuf(shared_log, buf, _IOLBF, BUFSIZ); + setvbuf(shared_log, NULL, _IOLBF, 0); } if (outfname && argv[0]) { if (!opt_intr) opt_intr = INTR_NEVER; - qflag = 1; + if (!qflag) + qflag = 1; } if (!opt_intr) opt_intr = INTR_WHILE_WAIT; /* argv[0] -pPID -oFILE Default interactive setting - * yes 0 0 INTR_WHILE_WAIT + * yes * 0 INTR_WHILE_WAIT * no 1 0 INTR_WHILE_WAIT - * yes 0 1 INTR_NEVER + * yes * 1 INTR_NEVER * no 1 1 INTR_WHILE_WAIT */ @@ -1929,9 +1882,6 @@ init(int argc, char *argv[]) * in the startup_child() mode we kill the spawned process anyway. */ if (argv[0]) { - if (!NOMMU_SYSTEM || daemonized_tracer) - hide_log_until_execve = 1; - skip_one_b_execve = 1; startup_child(argv); } @@ -1978,7 +1928,7 @@ init(int argc, char *argv[]) static struct tcb * pid2tcb(int pid) { - int i; + unsigned int i; if (pid <= 0) return NULL; @@ -1995,7 +1945,7 @@ pid2tcb(int pid) static void cleanup(void) { - int i; + unsigned int i; struct tcb *tcp; int fatal_sig; @@ -2009,8 +1959,7 @@ cleanup(void) if (!tcp->pid) continue; if (debug_flag) - fprintf(stderr, - "cleanup: looking at pid %u\n", tcp->pid); + error_msg("cleanup: looking at pid %u", tcp->pid); if (tcp->pid == strace_child) { kill(tcp->pid, SIGCONT); kill(tcp->pid, fatal_sig); @@ -2028,11 +1977,267 @@ interrupt(int sig) } static void +print_debug_info(const int pid, int status) +{ + const unsigned int event = (unsigned int) status >> 16; + char buf[sizeof("WIFEXITED,exitcode=%u") + sizeof(int)*3 /*paranoia:*/ + 16]; + char evbuf[sizeof(",EVENT_VFORK_DONE (%u)") + sizeof(int)*3 /*paranoia:*/ + 16]; + + strcpy(buf, "???"); + if (WIFSIGNALED(status)) +#ifdef WCOREDUMP + sprintf(buf, "WIFSIGNALED,%ssig=%s", + WCOREDUMP(status) ? "core," : "", + signame(WTERMSIG(status))); +#else + sprintf(buf, "WIFSIGNALED,sig=%s", + signame(WTERMSIG(status))); +#endif + if (WIFEXITED(status)) + sprintf(buf, "WIFEXITED,exitcode=%u", WEXITSTATUS(status)); + if (WIFSTOPPED(status)) + sprintf(buf, "WIFSTOPPED,sig=%s", signame(WSTOPSIG(status))); +#ifdef WIFCONTINUED + /* Should never be seen */ + if (WIFCONTINUED(status)) + strcpy(buf, "WIFCONTINUED"); +#endif + evbuf[0] = '\0'; + if (event != 0) { + static const char *const event_names[] = { + [PTRACE_EVENT_CLONE] = "CLONE", + [PTRACE_EVENT_FORK] = "FORK", + [PTRACE_EVENT_VFORK] = "VFORK", + [PTRACE_EVENT_VFORK_DONE] = "VFORK_DONE", + [PTRACE_EVENT_EXEC] = "EXEC", + [PTRACE_EVENT_EXIT] = "EXIT", + /* [PTRACE_EVENT_STOP (=128)] would make biggish array */ + }; + const char *e = "??"; + if (event < ARRAY_SIZE(event_names)) + e = event_names[event]; + else if (event == PTRACE_EVENT_STOP) + e = "STOP"; + sprintf(evbuf, ",EVENT_%s (%u)", e, event); + } + error_msg("[wait(0x%06x) = %u] %s%s", status, pid, buf, evbuf); +} + +static struct tcb * +maybe_allocate_tcb(const int pid, int status) +{ + if (!WIFSTOPPED(status)) { + if (detach_on_execve && pid == strace_child) { + /* example: strace -bexecve sh -c 'exec true' */ + strace_child = 0; + return NULL; + } + /* + * This can happen if we inherited an unknown child. + * Example: (sleep 1 & exec strace true) + */ + error_msg("Exit of unknown pid %u ignored", pid); + return NULL; + } + if (followfork) { + /* We assume it's a fork/vfork/clone child */ + struct tcb *tcp = alloctcb(pid); + tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; + newoutf(tcp); + if (!qflag) + error_msg("Process %d attached", pid); + return tcp; + } else { + /* This can happen if a clone call used + * CLONE_PTRACE itself. + */ + ptrace(PTRACE_CONT, pid, NULL, 0); + error_msg("Stop of unknown pid %u seen, PTRACE_CONTed it", pid); + return NULL; + } +} + +static struct tcb * +maybe_switch_tcbs(struct tcb *tcp, const int pid) +{ + FILE *fp; + struct tcb *execve_thread; + long old_pid = 0; + + if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, &old_pid) < 0) + return tcp; + /* Avoid truncation in pid2tcb() param passing */ + if (old_pid <= 0 || old_pid == pid) + return tcp; + if ((unsigned long) old_pid > UINT_MAX) + return tcp; + execve_thread = pid2tcb(old_pid); + /* It should be !NULL, but I feel paranoid */ + if (!execve_thread) + return tcp; + + if (execve_thread->curcol != 0) { + /* + * One case we are here is -ff: + * try "strace -oLOG -ff test/threaded_execve" + */ + fprintf(execve_thread->outf, " \n", pid); + /*execve_thread->curcol = 0; - no need, see code below */ + } + /* Swap output FILEs (needed for -ff) */ + fp = execve_thread->outf; + execve_thread->outf = tcp->outf; + tcp->outf = fp; + /* And their column positions */ + execve_thread->curcol = tcp->curcol; + tcp->curcol = 0; + /* Drop leader, but close execve'd thread outfile (if -ff) */ + droptcb(tcp); + /* Switch to the thread, reusing leader's outfile and pid */ + tcp = execve_thread; + tcp->pid = pid; + if (cflag != CFLAG_ONLY_STATS) { + printleader(tcp); + tprintf("+++ superseded by execve in pid %lu +++\n", old_pid); + line_ended(); + tcp->flags |= TCB_REPRINT; + } + + return tcp; +} + +static void +print_signalled(struct tcb *tcp, const int pid, int status) +{ + if (pid == strace_child) { + exit_code = 0x100 | WTERMSIG(status); + strace_child = 0; + } + + if (cflag != CFLAG_ONLY_STATS + && is_number_in_set(WTERMSIG(status), &signal_set)) { + printleader(tcp); +#ifdef WCOREDUMP + tprintf("+++ killed by %s %s+++\n", + signame(WTERMSIG(status)), + WCOREDUMP(status) ? "(core dumped) " : ""); +#else + tprintf("+++ killed by %s +++\n", + signame(WTERMSIG(status))); +#endif + line_ended(); + } +} + +static void +print_exited(struct tcb *tcp, const int pid, int status) +{ + if (pid == strace_child) { + exit_code = WEXITSTATUS(status); + strace_child = 0; + } + + if (cflag != CFLAG_ONLY_STATS && + qflag < 2) { + printleader(tcp); + tprintf("+++ exited with %d +++\n", WEXITSTATUS(status)); + line_ended(); + } +} + +static void +print_stopped(struct tcb *tcp, const siginfo_t *si, const unsigned int sig) +{ + if (cflag != CFLAG_ONLY_STATS + && !hide_log(tcp) + && is_number_in_set(sig, &signal_set)) { + printleader(tcp); + if (si) { + tprintf("--- %s ", signame(sig)); + printsiginfo(si); + tprints(" ---\n"); + } else + tprintf("--- stopped by %s ---\n", signame(sig)); + line_ended(); + } +} + +static void +startup_tcb(struct tcb *tcp) +{ + if (debug_flag) + error_msg("pid %d has TCB_STARTUP, initializing it", tcp->pid); + + tcp->flags &= ~TCB_STARTUP; + + if (!use_seize) { + if (debug_flag) + error_msg("setting opts 0x%x on pid %d", + ptrace_setoptions, tcp->pid); + if (ptrace(PTRACE_SETOPTIONS, tcp->pid, NULL, ptrace_setoptions) < 0) { + if (errno != ESRCH) { + /* Should never happen, really */ + perror_msg_and_die("PTRACE_SETOPTIONS"); + } + } + } +} + +static void +print_event_exit(struct tcb *tcp) +{ + if (entering(tcp) || filtered(tcp) || hide_log(tcp) + || cflag == CFLAG_ONLY_STATS) { + return; + } + + if (followfork < 2 && printing_tcp && printing_tcp != tcp + && printing_tcp->curcol != 0) { + current_tcp = printing_tcp; + tprints(" \n"); + fflush(printing_tcp->outf); + printing_tcp->curcol = 0; + current_tcp = tcp; + } + + if ((followfork < 2 && printing_tcp != tcp) + || (tcp->flags & TCB_REPRINT)) { + tcp->flags &= ~TCB_REPRINT; + printleader(tcp); + tprintf("<... %s resumed>", tcp->s_ent->sys_name); + } + + if (!(tcp->sys_func_rval & RVAL_DECODED)) { + /* + * The decoder has probably decided to print something + * on exiting syscall which is not going to happen. + */ + tprints(" "); + } + tprints(") "); + tabto(); + tprints("= ?\n"); + line_ended(); +} + +/* Returns true iff the main trace loop has to continue. */ +static bool trace(void) { + int pid; + int wait_errno; + int status; + bool stopped; + unsigned int sig; + unsigned int event; + struct tcb *tcp; struct rusage ru; - /* Used to be "while (nprocs != 0)", but in this testcase: + if (interrupted) + return false; + + /* + * Used to exit simply when nprocs hits zero, but in this testcase: * int main() { _exit(!!fork()); } * under strace -f, parent sometimes (rarely) manages * to exit before we see the first stop of the child, @@ -2040,130 +2245,66 @@ trace(void) * 19923 clone(...) = 19924 * 19923 exit_group(1) = ? * 19923 +++ exited with 1 +++ - * Waiting for ECHILD works better. - * (However, if -o|logger is in use, we can't do that. - * Can work around that by double-forking the logger, - * but that loses the ability to wait for its completion on exit. - * Oh well...) + * Exiting only when wait() returns ECHILD works better. */ - while (1) { - int pid; - int wait_errno; - int status, sig; - int stopped; - struct tcb *tcp; - unsigned event; - - if (interrupted) - return; - - if (popen_pid != 0 && nprocs == 0) - return; + if (popen_pid != 0) { + /* However, if -o|logger is in use, we can't do that. + * Can work around that by double-forking the logger, + * but that loses the ability to wait for its completion + * on exit. Oh well... + */ + if (nprocs == 0) + return false; + } - if (interactive) - sigprocmask(SIG_SETMASK, &empty_set, NULL); - pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); - wait_errno = errno; - if (interactive) - sigprocmask(SIG_BLOCK, &blocked_set, NULL); + if (interactive) + sigprocmask(SIG_SETMASK, &empty_set, NULL); + pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); + wait_errno = errno; + if (interactive) + sigprocmask(SIG_BLOCK, &blocked_set, NULL); - if (pid < 0) { - if (wait_errno == EINTR) - continue; - if (nprocs == 0 && wait_errno == ECHILD) - return; - /* If nprocs > 0, ECHILD is not expected, - * treat it as any other error here: - */ - errno = wait_errno; - perror_msg_and_die("wait4(__WALL)"); - } + if (pid < 0) { + if (wait_errno == EINTR) + return true; + if (nprocs == 0 && wait_errno == ECHILD) + return false; + /* + * If nprocs > 0, ECHILD is not expected, + * treat it as any other error here: + */ + errno = wait_errno; + perror_msg_and_die("wait4(__WALL)"); + } - if (pid == popen_pid) { - if (!WIFSTOPPED(status)) - popen_pid = 0; - continue; - } + if (pid == popen_pid) { + if (!WIFSTOPPED(status)) + popen_pid = 0; + return true; + } - event = ((unsigned)status >> 16); - if (debug_flag) { - char buf[sizeof("WIFEXITED,exitcode=%u") + sizeof(int)*3 /*paranoia:*/ + 16]; - char evbuf[sizeof(",EVENT_VFORK_DONE (%u)") + sizeof(int)*3 /*paranoia:*/ + 16]; - strcpy(buf, "???"); - if (WIFSIGNALED(status)) -#ifdef WCOREDUMP - sprintf(buf, "WIFSIGNALED,%ssig=%s", - WCOREDUMP(status) ? "core," : "", - signame(WTERMSIG(status))); -#else - sprintf(buf, "WIFSIGNALED,sig=%s", - signame(WTERMSIG(status))); -#endif - if (WIFEXITED(status)) - sprintf(buf, "WIFEXITED,exitcode=%u", WEXITSTATUS(status)); - if (WIFSTOPPED(status)) - sprintf(buf, "WIFSTOPPED,sig=%s", signame(WSTOPSIG(status))); -#ifdef WIFCONTINUED - /* Should never be seen */ - if (WIFCONTINUED(status)) - strcpy(buf, "WIFCONTINUED"); -#endif - evbuf[0] = '\0'; - if (event != 0) { - static const char *const event_names[] = { - [PTRACE_EVENT_CLONE] = "CLONE", - [PTRACE_EVENT_FORK] = "FORK", - [PTRACE_EVENT_VFORK] = "VFORK", - [PTRACE_EVENT_VFORK_DONE] = "VFORK_DONE", - [PTRACE_EVENT_EXEC] = "EXEC", - [PTRACE_EVENT_EXIT] = "EXIT", - /* [PTRACE_EVENT_STOP (=128)] would make biggish array */ - }; - const char *e = "??"; - if (event < ARRAY_SIZE(event_names)) - e = event_names[event]; - else if (event == PTRACE_EVENT_STOP) - e = "STOP"; - sprintf(evbuf, ",EVENT_%s (%u)", e, event); - } - fprintf(stderr, " [wait(0x%06x) = %u] %s%s\n", status, pid, buf, evbuf); - } + if (debug_flag) + print_debug_info(pid, status); - /* Look up 'pid' in our table. */ - tcp = pid2tcb(pid); + /* Look up 'pid' in our table. */ + tcp = pid2tcb(pid); - if (!tcp) { - if (!WIFSTOPPED(status)) { - /* This can happen if we inherited - * an unknown child. Example: - * (sleep 1 & exec strace sleep 2) - */ - error_msg("Exit of unknown pid %u seen", pid); - continue; - } - if (followfork) { - /* We assume it's a fork/vfork/clone child */ - tcp = alloctcb(pid); - tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; - newoutf(tcp); - if (!qflag) - fprintf(stderr, "Process %d attached\n", - pid); - } else { - /* This can happen if a clone call used - * CLONE_PTRACE itself. - */ - ptrace(PTRACE_CONT, pid, (char *) 0, 0); - error_msg("Stop of unknown pid %u seen, PTRACE_CONTed it", pid); - continue; - } - } + if (!tcp) { + tcp = maybe_allocate_tcb(pid, status); + if (!tcp) + return true; + } + if (WIFSTOPPED(status)) + get_regs(pid); + else clear_regs(); - if (WIFSTOPPED(status)) - get_regs(pid); - /* Under Linux, execve changes pid to thread leader's pid, + event = (unsigned int) status >> 16; + + if (event == PTRACE_EVENT_EXEC) { + /* + * Under Linux, execve changes pid to thread leader's pid, * and we see this changed pid on EVENT_EXEC and later, * execve sysexit. Leader "disappears" without exit * notification. Let user know that, drop leader's tcb, @@ -2177,248 +2318,171 @@ trace(void) * PTRACE_GETEVENTMSG returns old pid starting from Linux 3.0. * On 2.6 and earlier, it can return garbage. */ - if (event == PTRACE_EVENT_EXEC && os_release >= KERNEL_VERSION(3,0,0)) { - FILE *fp; - struct tcb *execve_thread; - long old_pid = 0; - - if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, (long) &old_pid) < 0) - goto dont_switch_tcbs; - /* Avoid truncation in pid2tcb() param passing */ - if (old_pid > UINT_MAX) - goto dont_switch_tcbs; - if (old_pid <= 0 || old_pid == pid) - goto dont_switch_tcbs; - execve_thread = pid2tcb(old_pid); - /* It should be !NULL, but I feel paranoid */ - if (!execve_thread) - goto dont_switch_tcbs; - - if (execve_thread->curcol != 0) { - /* - * One case we are here is -ff: - * try "strace -oLOG -ff test/threaded_execve" - */ - fprintf(execve_thread->outf, " \n", pid); - /*execve_thread->curcol = 0; - no need, see code below */ - } - /* Swap output FILEs (needed for -ff) */ - fp = execve_thread->outf; - execve_thread->outf = tcp->outf; - tcp->outf = fp; - /* And their column positions */ - execve_thread->curcol = tcp->curcol; - tcp->curcol = 0; - /* Drop leader, but close execve'd thread outfile (if -ff) */ - droptcb(tcp); - /* Switch to the thread, reusing leader's outfile and pid */ - tcp = execve_thread; - tcp->pid = pid; - if (cflag != CFLAG_ONLY_STATS) { - printleader(tcp); - tprintf("+++ superseded by execve in pid %lu +++\n", old_pid); - line_ended(); - tcp->flags |= TCB_REPRINT; - } - } - dont_switch_tcbs: + if (os_release >= KERNEL_VERSION(3,0,0)) + tcp = maybe_switch_tcbs(tcp, pid); - if (event == PTRACE_EVENT_EXEC) { - if (detach_on_execve && !skip_one_b_execve) + if (detach_on_execve) { + if (tcp->flags & TCB_SKIP_DETACH_ON_FIRST_EXEC) { + tcp->flags &= ~TCB_SKIP_DETACH_ON_FIRST_EXEC; + } else { detach(tcp); /* do "-b execve" thingy */ - skip_one_b_execve = 0; + return true; + } } + } - /* Set current output file */ - current_tcp = tcp; + /* Set current output file */ + current_tcp = tcp; - if (cflag) { - tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime); - tcp->stime = ru.ru_stime; - } + if (cflag) { + tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime); + tcp->stime = ru.ru_stime; + } - if (WIFSIGNALED(status)) { - if (pid == strace_child) - exit_code = 0x100 | WTERMSIG(status); - if (cflag != CFLAG_ONLY_STATS - && (qual_flags[WTERMSIG(status)] & QUAL_SIGNAL) - ) { - printleader(tcp); -#ifdef WCOREDUMP - tprintf("+++ killed by %s %s+++\n", - signame(WTERMSIG(status)), - WCOREDUMP(status) ? "(core dumped) " : ""); -#else - tprintf("+++ killed by %s +++\n", - signame(WTERMSIG(status))); -#endif - line_ended(); - } - droptcb(tcp); - continue; - } - if (WIFEXITED(status)) { - if (pid == strace_child) - exit_code = WEXITSTATUS(status); - if (cflag != CFLAG_ONLY_STATS && - qflag < 2) { - printleader(tcp); - tprintf("+++ exited with %d +++\n", WEXITSTATUS(status)); - line_ended(); - } - droptcb(tcp); - continue; - } - if (!WIFSTOPPED(status)) { - fprintf(stderr, "PANIC: pid %u not stopped\n", pid); - droptcb(tcp); - continue; - } + if (WIFSIGNALED(status)) { + print_signalled(tcp, pid, status); + droptcb(tcp); + return true; + } - /* Is this the very first time we see this tracee stopped? */ - if (tcp->flags & TCB_STARTUP) { - if (debug_flag) - fprintf(stderr, "pid %d has TCB_STARTUP, initializing it\n", tcp->pid); - tcp->flags &= ~TCB_STARTUP; - if (tcp->flags & TCB_BPTSET) { - /* - * One example is a breakpoint inherited from - * parent through fork(). - */ - if (clearbpt(tcp) < 0) { - /* Pretty fatal */ - droptcb(tcp); - exit_code = 1; - return; - } - } - if (!use_seize && ptrace_setoptions) { - if (debug_flag) - fprintf(stderr, "setting opts 0x%x on pid %d\n", ptrace_setoptions, tcp->pid); - if (ptrace(PTRACE_SETOPTIONS, tcp->pid, NULL, ptrace_setoptions) < 0) { - if (errno != ESRCH) { - /* Should never happen, really */ - perror_msg_and_die("PTRACE_SETOPTIONS"); - } - } - } - } + if (WIFEXITED(status)) { + print_exited(tcp, pid, status); + droptcb(tcp); + return true; + } - sig = WSTOPSIG(status); + if (!WIFSTOPPED(status)) { + /* + * Neither signalled, exited or stopped. + * How could that be? + */ + error_msg("pid %u not stopped!", pid); + droptcb(tcp); + return true; + } + + /* Is this the very first time we see this tracee stopped? */ + if (tcp->flags & TCB_STARTUP) { + startup_tcb(tcp); + if (get_scno(tcp) == 1) + tcp->s_prev_ent = tcp->s_ent; + } + + sig = WSTOPSIG(status); - if (event != 0) { - /* Ptrace event */ + switch (event) { + case 0: + break; + case PTRACE_EVENT_EXIT: + print_event_exit(tcp); + goto restart_tracee_with_sig_0; #if USE_SEIZE - if (event == PTRACE_EVENT_STOP) { - /* - * PTRACE_INTERRUPT-stop or group-stop. - * PTRACE_INTERRUPT-stop has sig == SIGTRAP here. - */ - if (sig == SIGSTOP - || sig == SIGTSTP - || sig == SIGTTIN - || sig == SIGTTOU - ) { - stopped = 1; + case PTRACE_EVENT_STOP: + /* + * PTRACE_INTERRUPT-stop or group-stop. + * PTRACE_INTERRUPT-stop has sig == SIGTRAP here. + */ + switch (sig) { + case SIGSTOP: + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + stopped = true; goto show_stopsig; - } } + /* fall through */ #endif + default: goto restart_tracee_with_sig_0; - } + } - /* Is this post-attach SIGSTOP? - * Interestingly, the process may stop - * with STOPSIG equal to some other signal - * than SIGSTOP if we happend to attach - * just before the process takes a signal. - */ - if (sig == SIGSTOP && (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) { - if (debug_flag) - fprintf(stderr, "ignored SIGSTOP on pid %d\n", tcp->pid); - tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP; - goto restart_tracee_with_sig_0; - } + /* + * Is this post-attach SIGSTOP? + * Interestingly, the process may stop + * with STOPSIG equal to some other signal + * than SIGSTOP if we happend to attach + * just before the process takes a signal. + */ + if (sig == SIGSTOP && (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) { + if (debug_flag) + error_msg("ignored SIGSTOP on pid %d", tcp->pid); + tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP; + goto restart_tracee_with_sig_0; + } - if (sig != syscall_trap_sig) { - siginfo_t si; + if (sig != syscall_trap_sig) { + siginfo_t si = {}; - /* Nonzero (true) if tracee is stopped by signal - * (as opposed to "tracee received signal"). - * TODO: shouldn't we check for errno == EINVAL too? - * We can get ESRCH instead, you know... - */ - stopped = (ptrace(PTRACE_GETSIGINFO, pid, 0, (long) &si) < 0); + /* + * True if tracee is stopped by signal + * (as opposed to "tracee received signal"). + * TODO: shouldn't we check for errno == EINVAL too? + * We can get ESRCH instead, you know... + */ + stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, &si) < 0; #if USE_SEIZE - show_stopsig: +show_stopsig: #endif - if (cflag != CFLAG_ONLY_STATS - && !hide_log_until_execve - && (qual_flags[sig] & QUAL_SIGNAL) - ) { - printleader(tcp); - if (!stopped) { - tprintf("--- %s ", signame(sig)); - printsiginfo(&si, verbose(tcp)); - tprints(" ---\n"); - } else - tprintf("--- stopped by %s ---\n", - signame(sig)); - line_ended(); - } + print_stopped(tcp, stopped ? NULL : &si, sig); - if (!stopped) - /* It's signal-delivery-stop. Inject the signal */ - goto restart_tracee; + if (!stopped) + /* It's signal-delivery-stop. Inject the signal */ + goto restart_tracee; - /* It's group-stop */ - if (use_seize) { - /* - * This ends ptrace-stop, but does *not* end group-stop. - * This makes stopping signals work properly on straced process - * (that is, process really stops. It used to continue to run). - */ - if (ptrace_restart(PTRACE_LISTEN, tcp, 0) < 0) { - /* Note: ptrace_restart emitted error message */ - exit_code = 1; - return; - } - continue; + /* It's group-stop */ + if (use_seize) { + /* + * This ends ptrace-stop, but does *not* end group-stop. + * This makes stopping signals work properly on straced process + * (that is, process really stops. It used to continue to run). + */ + if (ptrace_restart(PTRACE_LISTEN, tcp, 0) < 0) { + /* Note: ptrace_restart emitted error message */ + exit_code = 1; + return false; } - /* We don't have PTRACE_LISTEN support... */ - goto restart_tracee; + return true; } + /* We don't have PTRACE_LISTEN support... */ + goto restart_tracee; + } - /* We handled quick cases, we are permitted to interrupt now. */ - if (interrupted) - return; + /* We handled quick cases, we are permitted to interrupt now. */ + if (interrupted) + return false; - /* This should be syscall entry or exit. - * (Or it still can be that pesky post-execve SIGTRAP!) - * Handle it. + /* + * This should be syscall entry or exit. + * Handle it. + */ + sig = 0; + if (trace_syscall(tcp, &sig) < 0) { + /* + * ptrace() failed in trace_syscall(). + * Likely a result of process disappearing mid-flight. + * Observed case: exit_group() or SIGKILL terminating + * all processes in thread group. + * We assume that ptrace error was caused by process death. + * We used to detach(tcp) here, but since we no longer + * implement "detach before death" policy/hack, + * we can let this process to report its death to us + * normally, via WIFEXITED or WIFSIGNALED wait status. */ - if (trace_syscall(tcp) < 0) { - /* ptrace() failed in trace_syscall(). - * Likely a result of process disappearing mid-flight. - * Observed case: exit_group() or SIGKILL terminating - * all processes in thread group. - * We assume that ptrace error was caused by process death. - * We used to detach(tcp) here, but since we no longer - * implement "detach before death" policy/hack, - * we can let this process to report its death to us - * normally, via WIFEXITED or WIFSIGNALED wait status. - */ - continue; - } - restart_tracee_with_sig_0: - sig = 0; - restart_tracee: - if (ptrace_restart(PTRACE_SYSCALL, tcp, sig) < 0) { - /* Note: ptrace_restart emitted error message */ - exit_code = 1; - return; - } - } /* while (1) */ + return true; + } + goto restart_tracee; + +restart_tracee_with_sig_0: + sig = 0; + +restart_tracee: + if (ptrace_restart(PTRACE_SYSCALL, tcp, sig) < 0) { + /* Note: ptrace_restart emitted error message */ + exit_code = 1; + return false; + } + + return true; } int @@ -2426,8 +2490,10 @@ main(int argc, char *argv[]) { init(argc, argv); - /* Run main tracing loop */ - trace(); + exit_code = !nprocs; + + while (trace()) + ; cleanup(); fflush(NULL); diff --git a/strace.spec b/strace.spec index 9384fa5d..f134bd8d 100644 --- a/strace.spec +++ b/strace.spec @@ -1,15 +1,20 @@ Summary: Tracks and displays system calls associated with a running process Name: strace -Version: 4.9 +Version: 4.16 Release: 1%{?dist} License: BSD Group: Development/Debuggers URL: http://sourceforge.net/projects/strace/ Source: http://downloads.sourceforge.net/strace/%{name}-%{version}.tar.xz - -BuildRequires: libacl-devel, libaio-devel, time - +%if 0%{?fedora} >= 20 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1300 +%define buildrequires_libunwind_devel BuildRequires: libunwind-devel +%endif +%ifarch x86_64 +# for experimental -k option +%{?buildrequires_libunwind_devel} +%endif %define strace64_arches ppc64 sparc64 +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} %description The strace program intercepts and records the system calls called and @@ -42,8 +47,19 @@ The `strace' program in the `strace' package is for 32-bit processes. %prep %setup -q +echo -n %version-%release > .tarball-version %build +echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION' +uname -a |head -1 +libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)" +$libc |head -1 +file -L /bin/sh +gcc --version |head -1 +kver="$(echo -e '#include \nLINUX_VERSION_CODE' | gcc -E -P -)" +printf 'kernel-headers %%s.%%s.%%s\n' $(($kver/65536)) $(($kver/256%%256)) $(($kver%%256)) +echo 'END OF BUILD ENVIRONMENT INFORMATION' + %configure make %{?_smp_mflags} @@ -65,9 +81,13 @@ rm -f %{buildroot}%{_bindir}/strace-graph %endif %check -make -k check VERBOSE=1 +make %{?_smp_mflags} -k check VERBOSE=1 +echo 'BEGIN OF TEST SUITE INFORMATION' +tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log +echo 'END OF TEST SUITE INFORMATION' %files +%{?suse_version:%defattr(-,root,root)} %doc CREDITS ChangeLog ChangeLog-CVS COPYING NEWS README %{_bindir}/strace %{_bindir}/strace-log-merge @@ -75,10 +95,62 @@ make -k check VERBOSE=1 %ifarch %{strace64_arches} %files -n strace64 +%{?suse_version:%defattr(-,root,root)} %{_bindir}/strace64 %endif %changelog +* Tue Feb 14 2017 strace-devel@lists.sourceforge.net - 4.16-1 +- strace 4.16 snapshot. + +* Wed Dec 14 2016 Dmitry V. Levin - 4.15-1 +- v4.14-100-g622af42 -> v4.15. + +* Wed Nov 16 2016 Dmitry V. Levin - 4.14.0.100.622a-1 +- v4.14 -> v4.14-100-g622af42: + + implemented syscall fault injection. + +* Tue Oct 04 2016 Dmitry V. Levin - 4.14-1 +- v4.13 -> v4.14: + + added printing of the mode argument of open and openat syscalls + when O_TMPFILE flag is set (#1377846). + +* Tue Jul 26 2016 Dmitry V. Levin - 4.13-1 +- v4.12 -> v4.13. + +* Tue May 31 2016 Dmitry V. Levin - 4.12-1 +- v4.11-163-g972018f -> v4.12. + +* Fri Feb 05 2016 Fedora Release Engineering - 4.11.0.163.9720-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jan 15 2016 Dmitry V. Levin - 4.11.0.163.9720-1 +- New upstream snapshot v4.11-163-g972018f: + + fixed decoding of syscalls unknown to the kernel on s390/s390x (#1298294). + +* Wed Dec 23 2015 Dmitry V. Levin - 4.11-2 +- Enabled experimental -k option on x86_64 (#1170296). + +* Mon Dec 21 2015 Dmitry V. Levin - 4.11-1 +- New upstream release: + + print nanoseconds along with seconds in stat family syscalls (#1251176). + +* Fri Jun 19 2015 Fedora Release Engineering - 4.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon May 11 2015 Marcin Juszkiewicz - 4.10-2 +- Backport set of upstream patches to get it buildable on AArch64 + +* Fri Mar 06 2015 Dmitry V. Levin - 4.10-1 +- New upstream release: + + enhanced ioctl decoding (#902788). + +* Mon Nov 03 2014 Lubomir Rintel - 4.9-3 +- Regenerate ioctl entries with proper kernel headers + +* Mon Aug 18 2014 Fedora Release Engineering - 4.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Fri Aug 15 2014 Dmitry V. Levin - 4.9-1 - New upstream release: + fixed build when and conflict (#993384); diff --git a/strace.spec.in b/strace.spec.in new file mode 100644 index 00000000..b9451787 --- /dev/null +++ b/strace.spec.in @@ -0,0 +1,575 @@ +Summary: Tracks and displays system calls associated with a running process +Name: strace +Version: @PACKAGE_VERSION@ +Release: 1%{?dist} +License: BSD +Group: Development/Debuggers +URL: http://sourceforge.net/projects/strace/ +Source: http://downloads.sourceforge.net/strace/%{name}-%{version}.tar.xz +%if 0%{?fedora} >= 20 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1300 +%define buildrequires_libunwind_devel BuildRequires: libunwind-devel +%endif +%ifarch x86_64 +# for experimental -k option +%{?buildrequires_libunwind_devel} +%endif +%define strace64_arches ppc64 sparc64 +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} + +%description +The strace program intercepts and records the system calls called and +received by a running process. Strace can print a record of each +system call, its arguments and its return value. Strace is useful for +diagnosing problems and debugging, as well as for instructional +purposes. + +Install strace if you need a tool to track the system calls made and +received by a process. + +%ifarch %{strace64_arches} +%package -n strace64 +Summary: Tracks and displays system calls associated with a running process. +Group: Development/Debuggers + +%description -n strace64 +The strace program intercepts and records the system calls called and +received by a running process. Strace can print a record of each +system call, its arguments and its return value. Strace is useful for +diagnosing problems and debugging, as well as for instructional +purposes. + +Install strace if you need a tool to track the system calls made and +received by a process. + +This package provides the `strace64' program to trace 64-bit processes. +The `strace' program in the `strace' package is for 32-bit processes. +%endif + +%prep +%setup -q +echo -n %version-%release > .tarball-version + +%build +echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION' +uname -a |head -1 +libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)" +$libc |head -1 +file -L /bin/sh +gcc --version |head -1 +kver="$(echo -e '#include \nLINUX_VERSION_CODE' | gcc -E -P -)" +printf 'kernel-headers %%s.%%s.%%s\n' $(($kver/65536)) $(($kver/256%%256)) $(($kver%%256)) +echo 'END OF BUILD ENVIRONMENT INFORMATION' + +%configure +make %{?_smp_mflags} + +%install +make DESTDIR=%{buildroot} install + +# remove unpackaged files from the buildroot +rm -f %{buildroot}%{_bindir}/strace-graph + +%define copy64 ln +%if 0%{?rhel} +%if 0%{?rhel} < 6 +%endif +%define copy64 cp -p +%endif + +%ifarch %{strace64_arches} +%{copy64} %{buildroot}%{_bindir}/strace %{buildroot}%{_bindir}/strace64 +%endif + +%check +make %{?_smp_mflags} -k check VERBOSE=1 +echo 'BEGIN OF TEST SUITE INFORMATION' +tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log +echo 'END OF TEST SUITE INFORMATION' + +%files +%{?suse_version:%defattr(-,root,root)} +%doc CREDITS ChangeLog ChangeLog-CVS COPYING NEWS README +%{_bindir}/strace +%{_bindir}/strace-log-merge +%{_mandir}/man1/* + +%ifarch %{strace64_arches} +%files -n strace64 +%{?suse_version:%defattr(-,root,root)} +%{_bindir}/strace64 +%endif + +%changelog +* @RPM_CHANGELOGTIME@ @PACKAGE_BUGREPORT@ - @PACKAGE_VERSION@-1 +- @PACKAGE_STRING@ snapshot. + +* Wed Dec 14 2016 Dmitry V. Levin - 4.15-1 +- v4.14-100-g622af42 -> v4.15. + +* Wed Nov 16 2016 Dmitry V. Levin - 4.14.0.100.622a-1 +- v4.14 -> v4.14-100-g622af42: + + implemented syscall fault injection. + +* Tue Oct 04 2016 Dmitry V. Levin - 4.14-1 +- v4.13 -> v4.14: + + added printing of the mode argument of open and openat syscalls + when O_TMPFILE flag is set (#1377846). + +* Tue Jul 26 2016 Dmitry V. Levin - 4.13-1 +- v4.12 -> v4.13. + +* Tue May 31 2016 Dmitry V. Levin - 4.12-1 +- v4.11-163-g972018f -> v4.12. + +* Fri Feb 05 2016 Fedora Release Engineering - 4.11.0.163.9720-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jan 15 2016 Dmitry V. Levin - 4.11.0.163.9720-1 +- New upstream snapshot v4.11-163-g972018f: + + fixed decoding of syscalls unknown to the kernel on s390/s390x (#1298294). + +* Wed Dec 23 2015 Dmitry V. Levin - 4.11-2 +- Enabled experimental -k option on x86_64 (#1170296). + +* Mon Dec 21 2015 Dmitry V. Levin - 4.11-1 +- New upstream release: + + print nanoseconds along with seconds in stat family syscalls (#1251176). + +* Fri Jun 19 2015 Fedora Release Engineering - 4.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon May 11 2015 Marcin Juszkiewicz - 4.10-2 +- Backport set of upstream patches to get it buildable on AArch64 + +* Fri Mar 06 2015 Dmitry V. Levin - 4.10-1 +- New upstream release: + + enhanced ioctl decoding (#902788). + +* Mon Nov 03 2014 Lubomir Rintel - 4.9-3 +- Regenerate ioctl entries with proper kernel headers + +* Mon Aug 18 2014 Fedora Release Engineering - 4.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Dmitry V. Levin - 4.9-1 +- New upstream release: + + fixed build when and conflict (#993384); + + updated CLOCK_* constants (#1088455); + + enabled ppc64le support (#1122323); + + fixed attach to a process on ppc64le (#1129569). + +* Fri Jul 25 2014 Dan Horák - 4.8-5 +- update for ppc64 + +* Sun Jun 08 2014 Fedora Release Engineering - 4.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Dec 6 2013 Peter Robinson 4.8-3 +- Fix FTBFS + +* Sun Aug 04 2013 Fedora Release Engineering - 4.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jun 03 2013 Dmitry V. Levin - 4.8-1 +- New upstream release: + + fixed ERESTARTNOINTR leaking to userspace on ancient kernels (#659382); + + fixed decoding of *xattr syscalls (#885233); + + fixed handling of files with 64-bit inode numbers by 32-bit strace (#912790); + + added aarch64 support (#969858). + +* Fri Feb 15 2013 Fedora Release Engineering - 4.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Jul 21 2012 Fedora Release Engineering - 4.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed May 02 2012 Dmitry V. Levin 4.7-1 +- New upstream release. + + implemented proper handling of real SIGTRAPs (#162774). + +* Sat Jan 14 2012 Fedora Release Engineering - 4.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Mar 14 2011 Dmitry V. Levin - 4.6-1 +- New upstream release. + + fixed a corner case in waitpid handling (#663547). + +* Wed Feb 09 2011 Fedora Release Engineering - 4.5.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Apr 13 2010 Roland McGrath - 4.5.20-1 +- New upstream release, work mostly by Andreas Schwab and Dmitry V. Levin. + + fixed potential stack buffer overflow in select decoder (#556678); + + fixed FTBFS (#539044). + +* Wed Oct 21 2009 Roland McGrath - 4.5.19-1 +- New upstream release, work mostly by Dmitry V. Levin + + exit/kill strace with traced process exitcode/signal (#105371); + + fixed build on ARM EABI (#507576); + + fixed display of 32-bit argv array on 64-bit architectures (#519480); + + fixed display of 32-bit fcntl(F_SETLK) on 64-bit architectures (#471169); + + fixed several bugs in strings decoder, including potential heap + memory corruption (#470529, #478324, #511035). + +* Thu Aug 28 2008 Roland McGrath - 4.5.18-1 +- build fix for newer kernel headers (#457291) +- fix CLONE_VFORK handling (#455078) +- Support new Linux/PPC system call subpage_prot and PROT_SAO flag. +- In sigaction system call, display sa_flags value along with SIG_DFL/SIG_IGN. + +* Mon Jul 21 2008 Roland McGrath - 4.5.17-1 +- handle O_CLOEXEC, MSG_CMSG_CLOEXEC (#365781) +- fix biarch stat64 decoding (#222275) +- fix spurious "..." in printing of environment strings (#358241) +- improve prctl decoding (#364401) +- fix hang wait on exited child with exited child (#354261) +- fix biarch fork/vfork (-f) tracing (#447475) +- fix biarch printing of negative argument kill (#430585) +- fix biarch decoding of error return values (#447587) +- fix -f tracing of CLONE_VFORK (#455078) +- fix ia64 register clobberation in -f tracing (#453438) +- print SO_NODEFER, SA_RESETHAND instead of SA_NOMASK, SA_ONESHOT (#455821) +- fix futex argument decoding (#448628, #448629) + +* Fri Aug 3 2007 Roland McGrath - 4.5.16-1 +- fix multithread issues (#240962, #240961, #247907) +- fix spurious SIGSTOP on early interrupt (#240986) +- fix utime for biarch (#247185) +- fix -u error message (#247170) +- better futex syscall printing (##241467) +- fix argv/envp printing with small -s settings, and for biarch +- new syscalls: getcpu, eventfd, timerfd, signalfd, epoll_pwait, + move_pages, utimensat + +* Tue Jan 16 2007 Roland McGrath - 4.5.15-1 +- biarch fixes (#179740, #192193, #171626, #173050, #218433, #218043) +- fix -ff -o behavior (#204950, #218435, #193808, #219423) +- better quotactl printing (#118696) +- *at, inotify*, pselect6, ppoll and unshare syscalls (#178633, #191275) +- glibc-2.5 build fixes (#209856) +- memory corruption fixes (#200621 +- fix race in child setup under -f (#180293) +- show ipc key values in hex (#198179, #192182) +- disallow -c with -ff (#187847) +- Resolves: RHBZ #179740, RHBZ #192193, RHBZ #204950, RHBZ #218435 +- Resolves: RHBZ #193808, RHBZ #219423, RHBZ #171626, RHBZ #173050 +- Resolves: RHBZ #218433, RHBZ #218043, RHBZ #118696, RHBZ #178633 +- Resolves: RHBZ #191275, RHBZ #209856, RHBZ #200621, RHBZ #180293 +- Resolves: RHBZ #198179, RHBZ #198182, RHBZ #187847 + +* Mon Nov 20 2006 Jakub Jelinek - 4.5.14-4 +- Fix ia64 syscall decoding (#206768) +- Fix build with glibc-2.4.90-33 and up on all arches but ia64 +- Fix build against 2.6.18+ headers + +* Tue Aug 22 2006 Roland McGrath - 4.5.14-3 +- Fix bogus decoding of syscalls >= 300 (#201462, #202620). + +* Fri Jul 14 2006 Jesse Keating - 4.5.14-2 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 4.5.14-1.2 +- bump again for long double bug on ppc{,64} + +* Tue Feb 07 2006 Jesse Keating - 4.5.14-1.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Mon Jan 16 2006 Roland McGrath - 4.5.14-1 +- Fix biarch decoding of socket syscalls (#174354). +- Fix biarch -e support (#173986). +- Accept numeric syscalls in -e (#174798). +- Fix ipc syscall decoding (#164755). +- Improve msgrcv printing (#164757). +- Man page updates (#165375). +- Improve mount syscall printing (#165377). +- Correct printing of restarting syscalls (#165469). + +* Wed Aug 3 2005 Roland McGrath - 4.5.13-1 +- Fix setsockopt decoding on 64-bit (#162449). +- Fix typos in socket option name strings (#161578). +- Display more IPV6 socket options by name (#162450). +- Don't display inappropriate syscalls for -e trace=file (#159340). +- New selector type -e trace=desc for file-descriptor using calls (#159400). +- Fix 32-bit old_mmap syscall decoding on x86-64 (#162467, #164215). +- Fix errors detaching from multithreaded process on interrupt (#161919). +- Note 4.5.12 fix for crash handling bad signal numbers (#162739). + +* Wed Jun 8 2005 Roland McGrath - 4.5.12-1 +- Fix known syscall recognition for IA32 processes on x86-64 (#158934). +- Fix bad output for ptrace on x86-64 (#159787). +- Fix potential buffer overruns (#151570, #159196). +- Make some diagnostics more consistent (#159308). +- Update PowerPC system calls. +- Better printing for Linux aio system calls. +- Don't truncate statfs64 fields to 32 bits in output (#158243). +- Cosmetic code cleanups (#159688). + +* Tue Mar 22 2005 Roland McGrath - 4.5.11-1 +- Build tweaks. +- Note 4.5.10 select fix (#151570). + +* Mon Mar 14 2005 Roland McGrath - 4.5.10-1 +- Fix select handling on nonstandard fd_set sizes. +- Don't print errors for null file name pointers. +- Fix initial execve output with -i (#143365). + +* Fri Feb 4 2005 Roland McGrath - 4.5.9-2 +- update ia64 syscall list (#146245) +- fix x86_64 syscall argument extraction for 32-bit processes (#146093) +- fix -e signal=NAME parsing (#143362) +- fix x86_64 exit_group syscall handling +- improve socket ioctl printing (#138223) +- code cleanups (#143369, #143370) +- improve mount flags printing (#141932) +- support symbolic printing of x86_64 arch_prctl parameters (#142667) +- fix potential crash in getxattr printing + +* Tue Oct 19 2004 Roland McGrath - 4.5.8-1 +- fix multithreaded exit handling (#132150, #135254) +- fix ioctl name matching (#129808) +- print RTC_* ioctl structure contents (#58606) +- grok epoll_* syscalls (#134463) +- grok new RLIMIT_* values (#133594) +- print struct cmsghdr contents for sendmsg (#131689) +- fix clock_* and timer_* argument output (#131420) + +* Tue Aug 31 2004 Roland McGrath - 4.5.7-2 +- new upstream version, misc fixes and updates (#128091, #129166, #128391, #129378, #130965, #131177) + +* Mon Jul 12 2004 Roland McGrath 4.5.6-1 +- new upstream version, updates ioctl lists (#127398), fixes quotactl (#127393), more ioctl decoding (#126917) + +* Sun Jun 27 2004 Roland McGrath 4.5.5-1 +- new upstream version, fixes x86-64 biarch support (#126547) + +* Tue Jun 15 2004 Elliot Lee 4.5.4-2 +- rebuilt + +* Thu Jun 3 2004 Roland McGrath 4.5.4-0.FC1 +- rebuilt for FC1 update + +* Thu Jun 3 2004 Roland McGrath 4.5.4-1 +- new upstream version, more ioctls (#122257), minor fixes + +* Fri Apr 16 2004 Roland McGrath 4.5.3-1 +- new upstream version, mq_* calls (#120701), -p vs NPTL (#120462), more fixes (#118694, #120541, #118685) + +* Tue Mar 02 2004 Elliot Lee 4.5.2-1.1 +- rebuilt + +* Mon Mar 1 2004 Roland McGrath 4.5.2-1 +- new upstream version, sched_* calls (#116990), show core flag (#112117) + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Thu Nov 13 2003 Roland McGrath 4.5.1-1 +- new upstream version, more fixes (#108012, #105366, #105359, #105358) + +* Tue Sep 30 2003 Roland McGrath 4.5-3 +- revert bogus s390 fix + +* Thu Sep 25 2003 Roland McGrath 4.5-1.2.1AS +- rebuilt for 2.1AS erratum + +* Wed Sep 24 2003 Roland McGrath 4.5-2 +- rebuilt + +* Wed Sep 24 2003 Roland McGrath 4.5-1 +- new upstream version, more fixes (#101499, #104365) + +* Thu Jul 17 2003 Roland McGrath 4.4.99-2 +- rebuilt + +* Thu Jul 17 2003 Roland McGrath 4.4.99-1 +- new upstream version, groks more new system calls, PF_INET6 sockets + +* Tue Jun 10 2003 Roland McGrath 4.4.98-1 +- new upstream version, more fixes (#90754, #91085) + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Sun Mar 30 2003 Roland McGrath 4.4.96-1 +- new upstream version, handles yet more 2.5 syscalls, x86_64 & ia64 fixes + +* Mon Feb 24 2003 Elliot Lee 4.4.95-2 +- rebuilt + +* Mon Feb 24 2003 Roland McGrath 4.4.95-1 +- new upstream version, fixed getresuid/getresgid (#84959) + +* Wed Feb 19 2003 Roland McGrath 4.4.94-1 +- new upstream version, new option -E to set environment variables (#82392) + +* Wed Jan 22 2003 Tim Powers 4.4.93-2 +- rebuilt + +* Tue Jan 21 2003 Roland McGrath 4.4.93-1 +- new upstream version, fixes ppc and s390 bugs, adds missing ptrace requests + +* Fri Jan 10 2003 Roland McGrath 4.4.91-1 +- new upstream version, fixes -f on x86-64 + +* Fri Jan 10 2003 Roland McGrath 4.4.90-1 +- new upstream version, fixes all known bugs modulo ia64 and s390 issues + +* Fri Jan 03 2003 Florian La Roche 4.4-11 +- add further s390 patch from IBM + +* Wed Nov 27 2002 Tim Powers 4.4-10 +- remove unpackaged files from the buildroot + +* Mon Oct 07 2002 Phil Knirsch 4.4-9.1 +- Added latest s390(x) patch. + +* Fri Sep 06 2002 Karsten Hopp 4.4-9 +- preliminary x86_64 support with an ugly patch to help + debugging. Needs cleanup! + +* Mon Sep 2 2002 Jakub Jelinek 4.4-8 +- newer version of the clone fixing patch (Roland McGrath) +- aio syscalls for i386/ia64/ppc (Ben LaHaise) + +* Wed Aug 28 2002 Jakub Jelinek 4.4-7 +- fix strace -f (Roland McGrath, #68994) +- handle ?et_thread_area, SA_RESTORER (Ulrich Drepper) + +* Fri Jun 21 2002 Jakub Jelinek 4.4-6 +- handle futexes, *xattr, sendfile64, etc. (Ulrich Drepper) +- handle modify_ldt (#66894) + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Tue Apr 16 2002 Jakub Jelinek 4.4-4 +- fix for the last patch by Jeff Law (#62591) + +* Mon Mar 4 2002 Preston Brown 4.4-3 +- integrate patch from Jeff Law to eliminate hang tracing threads + +* Sat Feb 23 2002 Florian La Roche +- minor update from debian tar-ball + +* Wed Jan 02 2002 Florian La Roche +- update to 4.4 + +* Sun Jul 22 2001 Florian La Roche +- disable s390 patches, they are already included + +* Wed Jul 18 2001 Preston Brown 4.3-1 +- new upstream version. Seems to have integrated most new syscalls +- tracing threaded programs is now functional. + +* Mon Jun 11 2001 Than Ngo +- port s390 patches from IBM + +* Wed May 16 2001 Nalin Dahyabhai +- modify new syscall patch to allocate enough heap space in setgroups32() + +* Wed Feb 14 2001 Jakub Jelinek +- #include in addition to + +* Fri Jan 26 2001 Karsten Hopp +- clean up conflicting patches. This happened only + when building on S390 + +* Fri Jan 19 2001 Bill Nottingham +- update to CVS, reintegrate ia64 support + +* Fri Dec 8 2000 Bernhard Rosenkraenzer +- Get S/390 support into the normal package + +* Sat Nov 18 2000 Florian La Roche +- added S/390 patch from IBM, adapting it to not conflict with + IA64 patch + +* Sat Aug 19 2000 Jakub Jelinek +- doh, actually apply the 2.4 syscalls patch +- make it compile with 2.4.0-test7-pre4+ headers, add + getdents64 and fcntl64 + +* Thu Aug 3 2000 Jakub Jelinek +- add a bunch of new 2.4 syscalls (#14036) + +* Wed Jul 12 2000 Prospector +- automatic rebuild +- excludearch ia64 + +* Fri Jun 2 2000 Matt Wilson +- use buildinstall for FHS + +* Wed May 24 2000 Jakub Jelinek +- make things compile on sparc +- fix sigreturn on sparc + +* Fri Mar 31 2000 Bill Nottingham +- fix stat64 misdef (#10485) + +* Tue Mar 21 2000 Michael K. Johnson +- added ia64 patch + +* Thu Feb 03 2000 Cristian Gafton +- man pages are compressed +- version 4.2 (why are we keeping all these patches around?) + +* Sat Nov 27 1999 Jeff Johnson +- update to 4.1 (with sparc socketcall patch). + +* Fri Nov 12 1999 Jakub Jelinek +- fix socketcall on sparc. + +* Thu Sep 02 1999 Cristian Gafton +- fix KERN_SECURELVL compile problem + +* Tue Aug 31 1999 Cristian Gafton +- added alpha patch from HJLu to fix the osf_sigprocmask interpretation + +* Sat Jun 12 1999 Jeff Johnson +- update to 3.99.1. + +* Wed Jun 2 1999 Jeff Johnson +- add (the other :-) jj's sparc patch. + +* Wed May 26 1999 Jeff Johnson +- upgrade to 3.99 in order to +- add new 2.2.x open flags (#2955). +- add new 2.2.x syscalls (#2866). +- strace 3.1 patches carried along for now. + +* Sun May 16 1999 Jeff Johnson +- don't rely on (broken!) rpm %%patch (#2735) + +* Tue Apr 06 1999 Preston Brown +- strip binary + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 16) + +* Tue Feb 9 1999 Jeff Johnson +- vfork est arrive! + +* Tue Feb 9 1999 Christopher Blizzard +- Add patch to follow clone() syscalls, too. + +* Sun Jan 17 1999 Jeff Johnson +- patch to build alpha/sparc with glibc 2.1. + +* Thu Dec 03 1998 Cristian Gafton +- patch to build on ARM + +* Wed Sep 30 1998 Jeff Johnson +- fix typo (printf, not tprintf). + +* Sat Sep 19 1998 Jeff Johnson +- fix compile problem on sparc. + +* Tue Aug 18 1998 Cristian Gafton +- buildroot + +* Mon Jul 20 1998 Cristian Gafton +- added the umoven patch from James Youngman +- fixed build problems on newer glibc releases + +* Mon Jun 08 1998 Prospector System +- translations modified for de, fr, tr diff --git a/stream.c b/stream.c deleted file mode 100644 index ceb9e2d6..00000000 --- a/stream.c +++ /dev/null @@ -1,401 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey - * Copyright (c) 1996-1999 Wichert Akkerman - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "defs.h" -#if defined HAVE_POLL_H -# include -#elif defined HAVE_SYS_POLL_H -# include -#endif -#ifdef HAVE_SYS_CONF_H -# include -#endif - -/* Who has STREAMS syscalls? - * Linux hasn't. Solaris has (had?). - * Just in case I miss something, retain in for Sparc... - */ -#if defined(SPARC) || defined(SPARC64) - -# ifdef HAVE_STROPTS_H -# include -# else -# define RS_HIPRI 1 -struct strbuf { - int maxlen; /* no. of bytes in buffer */ - int len; /* no. of bytes returned */ - const char *buf; /* pointer to data */ -}; -# define MORECTL 1 -# define MOREDATA 2 -# endif - -#include "xlat/msgflags.h" - -static void -printstrbuf(struct tcb *tcp, struct strbuf *sbp, int getting) -{ - if (sbp->maxlen == -1 && getting) - tprints("{maxlen=-1}"); - else { - tprints("{"); - if (getting) - tprintf("maxlen=%d, ", sbp->maxlen); - tprintf("len=%d, buf=", sbp->len); - printstr(tcp, (unsigned long) sbp->buf, sbp->len); - tprints("}"); - } -} - -static void -printstrbufarg(struct tcb *tcp, long arg, int getting) -{ - struct strbuf buf; - - if (arg == 0) - tprints("NULL"); - else if (umove(tcp, arg, &buf) < 0) - tprints("{...}"); - else - printstrbuf(tcp, &buf, getting); - tprints(", "); -} - -int -sys_putmsg(struct tcb *tcp) -{ - int i; - - if (entering(tcp)) { - /* fd */ - tprintf("%ld, ", tcp->u_arg[0]); - /* control and data */ - for (i = 1; i < 3; i++) - printstrbufarg(tcp, tcp->u_arg[i], 0); - /* flags */ - printflags(msgflags, tcp->u_arg[3], "RS_???"); - } - return 0; -} - -int -sys_getmsg(struct tcb *tcp) -{ - int i, flags; - - if (entering(tcp)) { - /* fd */ - tprintf("%lu, ", tcp->u_arg[0]); - } else { - if (syserror(tcp)) { - tprintf("%#lx, %#lx, %#lx", - tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); - return 0; - } - /* control and data */ - for (i = 1; i < 3; i++) - printstrbufarg(tcp, tcp->u_arg[i], 1); - /* pointer to flags */ - if (tcp->u_arg[3] == 0) - tprints("NULL"); - else if (umove(tcp, tcp->u_arg[3], &flags) < 0) - tprints("[?]"); - else { - tprints("["); - printflags(msgflags, flags, "RS_???"); - tprints("]"); - } - /* decode return value */ - switch (tcp->u_rval) { - case MORECTL: - tcp->auxstr = "MORECTL"; - break; - case MORECTL|MOREDATA: - tcp->auxstr = "MORECTL|MOREDATA"; - break; - case MOREDATA: - tcp->auxstr = "MORECTL"; - break; - default: - tcp->auxstr = NULL; - break; - } - } - return RVAL_HEX | RVAL_STR; -} - -# if defined SYS_putpmsg || defined SYS_getpmsg -#include "xlat/pmsgflags.h" -# ifdef SYS_putpmsg -int -sys_putpmsg(struct tcb *tcp) -{ - int i; - - if (entering(tcp)) { - /* fd */ - tprintf("%ld, ", tcp->u_arg[0]); - /* control and data */ - for (i = 1; i < 3; i++) - printstrbufarg(tcp, tcp->u_arg[i], 0); - /* band */ - tprintf("%ld, ", tcp->u_arg[3]); - /* flags */ - printflags(pmsgflags, tcp->u_arg[4], "MSG_???"); - } - return 0; -} -# endif -# ifdef SYS_getpmsg -int -sys_getpmsg(struct tcb *tcp) -{ - int i, flags; - - if (entering(tcp)) { - /* fd */ - tprintf("%lu, ", tcp->u_arg[0]); - } else { - if (syserror(tcp)) { - tprintf("%#lx, %#lx, %#lx, %#lx", tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[4]); - return 0; - } - /* control and data */ - for (i = 1; i < 3; i++) - printstrbufarg(tcp, tcp->u_arg[i], 1); - /* pointer to band */ - printnum(tcp, tcp->u_arg[3], "%d"); - tprints(", "); - /* pointer to flags */ - if (tcp->u_arg[4] == 0) - tprints("NULL"); - else if (umove(tcp, tcp->u_arg[4], &flags) < 0) - tprints("[?]"); - else { - tprints("["); - printflags(pmsgflags, flags, "MSG_???"); - tprints("]"); - } - /* decode return value */ - switch (tcp->u_rval) { - case MORECTL: - tcp->auxstr = "MORECTL"; - break; - case MORECTL|MOREDATA: - tcp->auxstr = "MORECTL|MOREDATA"; - break; - case MOREDATA: - tcp->auxstr = "MORECTL"; - break; - default: - tcp->auxstr = NULL; - break; - } - } - return RVAL_HEX | RVAL_STR; -} -# endif -# endif /* getpmsg/putpmsg */ - -#endif /* STREAMS syscalls support */ - - -#ifdef HAVE_SYS_POLL_H - -#include "xlat/pollflags.h" - -static int -decode_poll(struct tcb *tcp, long pts) -{ - struct pollfd fds; - unsigned nfds; - unsigned long size, start, cur, end, abbrev_end; - int failed = 0; - - if (entering(tcp)) { - nfds = tcp->u_arg[1]; - size = sizeof(fds) * nfds; - start = tcp->u_arg[0]; - end = start + size; - if (nfds == 0 || size / sizeof(fds) != nfds || end < start) { - tprintf("%#lx, %d, ", - tcp->u_arg[0], nfds); - return 0; - } - if (abbrev(tcp)) { - abbrev_end = start + max_strlen * sizeof(fds); - if (abbrev_end < start) - abbrev_end = end; - } else { - abbrev_end = end; - } - tprints("["); - for (cur = start; cur < end; cur += sizeof(fds)) { - if (cur > start) - tprints(", "); - if (cur >= abbrev_end) { - tprints("..."); - break; - } - if (umoven(tcp, cur, sizeof fds, (char *) &fds) < 0) { - tprints("?"); - failed = 1; - break; - } - if (fds.fd < 0) { - tprintf("{fd=%d}", fds.fd); - continue; - } - tprints("{fd="); - printfd(tcp, fds.fd); - tprints(", events="); - printflags(pollflags, fds.events, "POLL???"); - tprints("}"); - } - tprints("]"); - if (failed) - tprintf(" %#lx", start); - tprintf(", %d, ", nfds); - return 0; - } else { - static char outstr[1024]; - char *outptr; -#define end_outstr (outstr + sizeof(outstr)) - const char *flagstr; - - if (syserror(tcp)) - return 0; - if (tcp->u_rval == 0) { - tcp->auxstr = "Timeout"; - return RVAL_STR; - } - - nfds = tcp->u_arg[1]; - size = sizeof(fds) * nfds; - start = tcp->u_arg[0]; - end = start + size; - if (nfds == 0 || size / sizeof(fds) != nfds || end < start) - return 0; - if (abbrev(tcp)) { - abbrev_end = start + max_strlen * sizeof(fds); - if (abbrev_end < start) - abbrev_end = end; - } else { - abbrev_end = end; - } - - outptr = outstr; - - for (cur = start; cur < end; cur += sizeof(fds)) { - if (umoven(tcp, cur, sizeof fds, (char *) &fds) < 0) { - if (outptr < end_outstr - 2) - *outptr++ = '?'; - failed = 1; - break; - } - if (!fds.revents) - continue; - if (outptr == outstr) { - *outptr++ = '['; - } else { - if (outptr < end_outstr - 3) - outptr = stpcpy(outptr, ", "); - } - if (cur >= abbrev_end) { - if (outptr < end_outstr - 4) - outptr = stpcpy(outptr, "..."); - break; - } - if (outptr < end_outstr - (sizeof("{fd=%d, revents=") + sizeof(int)*3) + 1) - outptr += sprintf(outptr, "{fd=%d, revents=", fds.fd); - flagstr = sprintflags("", pollflags, fds.revents); - if (outptr < end_outstr - (strlen(flagstr) + 2)) { - outptr = stpcpy(outptr, flagstr); - *outptr++ = '}'; - } - } - if (failed) - return 0; - - if (outptr != outstr /* && outptr < end_outstr - 1 (always true)*/) - *outptr++ = ']'; - - *outptr = '\0'; - if (pts) { - if (outptr < end_outstr - (10 + TIMESPEC_TEXT_BUFSIZE)) { - outptr = stpcpy(outptr, outptr == outstr ? "left " : ", left "); - sprint_timespec(outptr, tcp, pts); - } - } - - if (outptr == outstr) - return 0; - - tcp->auxstr = outstr; - return RVAL_STR; -#undef end_outstr - } -} - -int -sys_poll(struct tcb *tcp) -{ - int rc = decode_poll(tcp, 0); - if (entering(tcp)) { -# ifdef INFTIM - if (tcp->u_arg[2] == INFTIM) - tprints("INFTIM"); - else -# endif - tprintf("%ld", tcp->u_arg[2]); - } - return rc; -} - -int -sys_ppoll(struct tcb *tcp) -{ - int rc = decode_poll(tcp, tcp->u_arg[2]); - if (entering(tcp)) { - print_timespec(tcp, tcp->u_arg[2]); - tprints(", "); - /* NB: kernel requires arg[4] == NSIG / 8 */ - print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]); - tprintf(", %lu", tcp->u_arg[4]); - } - return rc; -} - -#else /* !HAVE_SYS_POLL_H */ -int -sys_poll(struct tcb *tcp) -{ - return 0; -} -#endif diff --git a/swapon.c b/swapon.c new file mode 100644 index 00000000..e5ebd0fa --- /dev/null +++ b/swapon.c @@ -0,0 +1,23 @@ +#include "defs.h" + +#include + +#include "xlat/swap_flags.h" + +SYS_FUNC(swapon) +{ + unsigned int flags = tcp->u_arg[1]; + unsigned int prio = flags & SWAP_FLAG_PRIO_MASK; + flags &= ~SWAP_FLAG_PRIO_MASK; + + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + if (flags) { + printflags(swap_flags, flags, "SWAP_FLAG_???"); + tprintf("|%u", prio); + } else { + tprintf("%u", prio); + } + + return RVAL_DECODED; +} diff --git a/sync_file_range.c b/sync_file_range.c new file mode 100644 index 00000000..855e8af3 --- /dev/null +++ b/sync_file_range.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013 William Manley + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include "xlat/sync_file_range_flags.h" + +SYS_FUNC(sync_file_range) +{ + int argn; + + printfd(tcp, tcp->u_arg[0]); + argn = printllval(tcp, ", %lld, ", 1); + argn = printllval(tcp, "%lld, ", argn); + printflags(sync_file_range_flags, tcp->u_arg[argn], + "SYNC_FILE_RANGE_???"); + + return RVAL_DECODED; +} diff --git a/sync_file_range2.c b/sync_file_range2.c new file mode 100644 index 00000000..a1ef091b --- /dev/null +++ b/sync_file_range2.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013 William Manley + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include +#include "xlat/sync_file_range_flags.h" + +SYS_FUNC(sync_file_range2) +{ + int argn; + + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printflags(sync_file_range_flags, tcp->u_arg[1], + "SYNC_FILE_RANGE_???"); + argn = printllval(tcp, ", %lld, ", 2); + argn = printllval(tcp, "%lld", argn); + + return RVAL_DECODED; +} diff --git a/syscall.c b/syscall.c index b0ad47e1..c0407ed5 100644 --- a/syscall.c +++ b/syscall.c @@ -32,27 +32,18 @@ */ #include "defs.h" -#include +#include "native_defs.h" +#include "nsig.h" #include -#ifdef HAVE_SYS_REG_H -# include -#elif defined(HAVE_LINUX_PTRACE_H) -# undef PTRACE_SYSCALL -# ifdef HAVE_STRUCT_IA64_FPREG -# define ia64_fpreg XXX_ia64_fpreg -# endif -# ifdef HAVE_STRUCT_PT_ALL_USER_REGS -# define pt_all_user_regs XXX_pt_all_user_regs -# endif -# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS -# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args -# endif -# include -# undef ptrace_peeksiginfo_args -# undef ia64_fpreg -# undef pt_all_user_regs -#endif +/* for struct iovec */ +#include + +/* for __X32_SYSCALL_BIT */ +#include + +#include "regs.h" +#include "ptrace.h" #if defined(SPARC64) # undef PTRACE_GETREGS @@ -61,29 +52,18 @@ # define PTRACE_SETREGS PTRACE_SETREGS64 #endif -#if defined(IA64) -# include -# include -#endif - -/* for struct iovec */ -#include -/* for NT_PRSTATUS */ -#ifdef HAVE_ELF_H -# include -#endif - -#if defined(AARCH64) -# include +#if defined SPARC64 +# include +#elif defined SPARC +# include #endif -#if defined(XTENSA) -# include +#ifdef IA64 +# include #endif -#ifndef NSIG -# warning: NSIG is not defined, using 32 -# define NSIG 32 +#ifndef NT_PRSTATUS +# define NT_PRSTATUS 1 #endif #include "syscall.h" @@ -100,24 +80,30 @@ #define MA MAX_ARGS #define SI STACKTRACE_INVALIDATE_CACHE #define SE STACKTRACE_CAPTURE_ON_ENTER +#define CST COMPAT_SYSCALL_TYPES + +#define SEN(syscall_name) SEN_ ## syscall_name, SYS_FUNC_NAME(sys_ ## syscall_name) const struct_sysent sysent0[] = { #include "syscallent.h" }; #if SUPPORTED_PERSONALITIES > 1 +# include PERSONALITY1_INCLUDE_FUNCS static const struct_sysent sysent1[] = { # include "syscallent1.h" }; #endif #if SUPPORTED_PERSONALITIES > 2 +# include PERSONALITY2_INCLUDE_FUNCS static const struct_sysent sysent2[] = { # include "syscallent2.h" }; #endif /* Now undef them since short defines cause wicked namespace pollution. */ +#undef SEN #undef TD #undef TF #undef TI @@ -129,9 +115,10 @@ static const struct_sysent sysent2[] = { #undef MA #undef SI #undef SE +#undef CST /* - * `ioctlent.h' may be generated from `ioctlent.raw' by the auxiliary + * `ioctlent[012].h' files are automatically generated by the auxiliary * program `ioctlsort', such that the list is sorted by the `code' field. * This has the side-effect of resolving the _IO.. macros into * plain integers, eliminating the need to include here everything @@ -145,7 +132,7 @@ const char *const signalent0[] = { #include "signalent.h" }; const struct_ioctlent ioctlent0[] = { -#include "ioctlent.h" +#include "ioctlent0.h" }; #if SUPPORTED_PERSONALITIES > 1 @@ -158,6 +145,14 @@ static const char *const signalent1[] = { static const struct_ioctlent ioctlent1[] = { # include "ioctlent1.h" }; +# include PERSONALITY0_INCLUDE_PRINTERS_DECLS +static const struct_printers printers0 = { +# include PERSONALITY0_INCLUDE_PRINTERS_DEFS +}; +# include PERSONALITY1_INCLUDE_PRINTERS_DECLS +static const struct_printers printers1 = { +# include PERSONALITY1_INCLUDE_PRINTERS_DEFS +}; #endif #if SUPPORTED_PERSONALITIES > 2 @@ -170,6 +165,10 @@ static const char *const signalent2[] = { static const struct_ioctlent ioctlent2[] = { # include "ioctlent2.h" }; +# include PERSONALITY2_INCLUDE_PRINTERS_DECLS +static const struct_printers printers2 = { +# include PERSONALITY2_INCLUDE_PRINTERS_DEFS +}; #endif enum { @@ -217,16 +216,15 @@ const struct_sysent *sysent = sysent0; const char *const *errnoent = errnoent0; const char *const *signalent = signalent0; const struct_ioctlent *ioctlent = ioctlent0; +const struct_printers *printers = &printers0; #endif + unsigned nsyscalls = nsyscalls0; unsigned nerrnos = nerrnos0; unsigned nsignals = nsignals0; unsigned nioctlents = nioctlents0; -unsigned num_quals; -qualbits_t *qual_vec[SUPPORTED_PERSONALITIES]; - -static const unsigned nsyscall_vec[SUPPORTED_PERSONALITIES] = { +const unsigned int nsyscall_vec[SUPPORTED_PERSONALITIES] = { nsyscalls0, #if SUPPORTED_PERSONALITIES > 1 nsyscalls1, @@ -235,7 +233,7 @@ static const unsigned nsyscall_vec[SUPPORTED_PERSONALITIES] = { nsyscalls2, #endif }; -static const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES] = { +const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES] = { sysent0, #if SUPPORTED_PERSONALITIES > 1 sysent1, @@ -245,26 +243,6 @@ static const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES] = { #endif }; -enum { - MAX_NSYSCALLS1 = (nsyscalls0 -#if SUPPORTED_PERSONALITIES > 1 - > nsyscalls1 ? nsyscalls0 : nsyscalls1 -#endif - ), - MAX_NSYSCALLS2 = (MAX_NSYSCALLS1 -#if SUPPORTED_PERSONALITIES > 2 - > nsyscalls2 ? MAX_NSYSCALLS1 : nsyscalls2 -#endif - ), - MAX_NSYSCALLS = MAX_NSYSCALLS2, - /* We are ready for arches with up to 255 signals, - * even though the largest known signo is on MIPS and it is 128. - * The number of existing syscalls on all arches is - * larger that 255 anyway, so it is just a pedantic matter. - */ - MIN_QUALS = MAX_NSYSCALLS > 255 ? MAX_NSYSCALLS : 255 -}; - #if SUPPORTED_PERSONALITIES > 1 unsigned current_personality; @@ -279,6 +257,17 @@ static const int personality_wordsize[SUPPORTED_PERSONALITIES] = { }; # endif +# ifndef current_klongsize +unsigned current_klongsize; +static const int personality_klongsize[SUPPORTED_PERSONALITIES] = { + PERSONALITY0_KLONGSIZE, + PERSONALITY1_KLONGSIZE, +# if SUPPORTED_PERSONALITIES > 2 + PERSONALITY2_KLONGSIZE, +# endif +}; +# endif + void set_personality(int personality) { @@ -293,6 +282,7 @@ set_personality(int personality) nioctlents = nioctlents0; signalent = signalent0; nsignals = nsignals0; + printers = &printers0; break; case 1: @@ -302,6 +292,7 @@ set_personality(int personality) nioctlents = nioctlents1; signalent = signalent1; nsignals = nsignals1; + printers = &printers1; break; # if SUPPORTED_PERSONALITIES > 2 @@ -312,6 +303,7 @@ set_personality(int personality) nioctlents = nioctlents2; signalent = signalent2; nsignals = nsignals2; + printers = &printers2; break; # endif } @@ -320,10 +312,13 @@ set_personality(int personality) # ifndef current_wordsize current_wordsize = personality_wordsize[personality]; # endif +# ifndef current_klongsize + current_klongsize = personality_klongsize[personality]; +# endif } static void -update_personality(struct tcb *tcp, int personality) +update_personality(struct tcb *tcp, unsigned int personality) { if (personality == current_personality) return; @@ -333,2179 +328,420 @@ update_personality(struct tcb *tcp, int personality) return; tcp->currpers = personality; -# if defined(POWERPC64) - if (!qflag) { - static const char *const names[] = {"64 bit", "32 bit"}; - fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", - tcp->pid, names[personality]); - } -# elif defined(X86_64) - if (!qflag) { - static const char *const names[] = {"64 bit", "32 bit", "x32"}; - fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", - tcp->pid, names[personality]); - } -# elif defined(X32) - if (!qflag) { - static const char *const names[] = {"x32", "32 bit"}; - fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", - tcp->pid, names[personality]); - } -# elif defined(AARCH64) - if (!qflag) { - static const char *const names[] = {"32-bit", "AArch64"}; - fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", - tcp->pid, names[personality]); - } -# elif defined(TILE) +# undef PERSONALITY_NAMES +# if defined POWERPC64 +# define PERSONALITY_NAMES {"64 bit", "32 bit"} +# elif defined X86_64 +# define PERSONALITY_NAMES {"64 bit", "32 bit", "x32"} +# elif defined X32 +# define PERSONALITY_NAMES {"x32", "32 bit"} +# elif defined AARCH64 +# define PERSONALITY_NAMES {"64 bit", "32 bit"} +# elif defined TILE +# define PERSONALITY_NAMES {"64-bit", "32-bit"} +# endif +# ifdef PERSONALITY_NAMES if (!qflag) { - static const char *const names[] = {"64-bit", "32-bit"}; - fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", - tcp->pid, names[personality]); + static const char *const names[] = PERSONALITY_NAMES; + error_msg("[ Process PID=%d runs in %s mode. ]", + tcp->pid, names[personality]); } # endif } #endif -static int qual_syscall(), qual_signal(), qual_desc(); - -static const struct qual_options { - int bitflag; - const char *option_name; - int (*qualify)(const char *, int, int); - const char *argument_name; -} qual_options[] = { - { QUAL_TRACE, "trace", qual_syscall, "system call" }, - { QUAL_TRACE, "t", qual_syscall, "system call" }, - { QUAL_ABBREV, "abbrev", qual_syscall, "system call" }, - { QUAL_ABBREV, "a", qual_syscall, "system call" }, - { QUAL_VERBOSE, "verbose", qual_syscall, "system call" }, - { QUAL_VERBOSE, "v", qual_syscall, "system call" }, - { QUAL_RAW, "raw", qual_syscall, "system call" }, - { QUAL_RAW, "x", qual_syscall, "system call" }, - { QUAL_SIGNAL, "signal", qual_signal, "signal" }, - { QUAL_SIGNAL, "signals", qual_signal, "signal" }, - { QUAL_SIGNAL, "s", qual_signal, "signal" }, - { QUAL_READ, "read", qual_desc, "descriptor" }, - { QUAL_READ, "reads", qual_desc, "descriptor" }, - { QUAL_READ, "r", qual_desc, "descriptor" }, - { QUAL_WRITE, "write", qual_desc, "descriptor" }, - { QUAL_WRITE, "writes", qual_desc, "descriptor" }, - { QUAL_WRITE, "w", qual_desc, "descriptor" }, - { 0, NULL, NULL, NULL }, -}; - -static void -reallocate_qual(int n) -{ - unsigned p; - qualbits_t *qp; - for (p = 0; p < SUPPORTED_PERSONALITIES; p++) { - qp = qual_vec[p] = realloc(qual_vec[p], n * sizeof(qualbits_t)); - if (!qp) - die_out_of_memory(); - memset(&qp[num_quals], 0, (n - num_quals) * sizeof(qualbits_t)); - } - num_quals = n; -} - +#ifdef SYS_socket_subcall static void -qualify_one(int n, int bitflag, int not, int pers) +decode_socket_subcall(struct tcb *tcp) { - unsigned p; + const int call = tcp->u_arg[0]; - if (num_quals <= n) - reallocate_qual(n + 1); + if (call < 1 || call >= SYS_socket_nsubcalls) + return; - for (p = 0; p < SUPPORTED_PERSONALITIES; p++) { - if (pers == p || pers < 0) { - if (not) - qual_vec[p][n] &= ~bitflag; - else - qual_vec[p][n] |= bitflag; - } - } -} + const kernel_ulong_t scno = SYS_socket_subcall + call; + const unsigned int nargs = sysent[scno].nargs; + uint64_t buf[nargs]; -static int -qual_syscall(const char *s, int bitflag, int not) -{ - unsigned p; - unsigned i; - int rc = -1; - - if (*s >= '0' && *s <= '9') { - i = string_to_uint(s); - if (i >= MAX_NSYSCALLS) - return -1; - qualify_one(i, bitflag, not, -1); - return 0; - } + if (umoven(tcp, tcp->u_arg[1], nargs * current_wordsize, buf) < 0) + return; - for (p = 0; p < SUPPORTED_PERSONALITIES; p++) { - for (i = 0; i < nsyscall_vec[p]; i++) { - if (sysent_vec[p][i].sys_name - && strcmp(s, sysent_vec[p][i].sys_name) == 0 - ) { - qualify_one(i, bitflag, not, p); - rc = 0; - } - } - } + tcp->scno = scno; + tcp->qual_flg = qual_flags(scno); + tcp->s_ent = &sysent[scno]; - return rc; + unsigned int i; + for (i = 0; i < nargs; ++i) + tcp->u_arg[i] = (sizeof(uint32_t) == current_wordsize) + ? ((uint32_t *) (void *) buf)[i] : buf[i]; } +#endif -static int -qual_signal(const char *s, int bitflag, int not) +#ifdef SYS_ipc_subcall +static void +decode_ipc_subcall(struct tcb *tcp) { - int i; + unsigned int call = tcp->u_arg[0]; + const unsigned int version = call >> 16; - if (*s >= '0' && *s <= '9') { - int signo = string_to_uint(s); - if (signo < 0 || signo > 255) - return -1; - qualify_one(signo, bitflag, not, -1); - return 0; - } - if (strncasecmp(s, "SIG", 3) == 0) - s += 3; - for (i = 0; i <= NSIG; i++) { - if (strcasecmp(s, signame(i) + 3) == 0) { - qualify_one(i, bitflag, not, -1); - return 0; - } + if (version) { +# if defined S390 || defined S390X + return; +# else +# ifdef SPARC64 + if (current_wordsize == 8) + return; +# endif + set_tcb_priv_ulong(tcp, version); + call &= 0xffff; +# endif } - return -1; -} -static int -qual_desc(const char *s, int bitflag, int not) -{ - if (*s >= '0' && *s <= '9') { - int desc = string_to_uint(s); - if (desc < 0 || desc > 0x7fff) /* paranoia */ - return -1; - qualify_one(desc, bitflag, not, -1); - return 0; + switch (call) { + case 1: case 2: case 3: case 4: + case 11: case 12: case 13: case 14: + case 21: case 22: case 23: case 24: + break; + default: + return; } - return -1; -} -static int -lookup_class(const char *s) -{ - if (strcmp(s, "file") == 0) - return TRACE_FILE; - if (strcmp(s, "ipc") == 0) - return TRACE_IPC; - if (strcmp(s, "network") == 0) - return TRACE_NETWORK; - if (strcmp(s, "process") == 0) - return TRACE_PROCESS; - if (strcmp(s, "signal") == 0) - return TRACE_SIGNAL; - if (strcmp(s, "desc") == 0) - return TRACE_DESC; - if (strcmp(s, "memory") == 0) - return TRACE_MEMORY; - return -1; -} + tcp->scno = SYS_ipc_subcall + call; + tcp->qual_flg = qual_flags(tcp->scno); + tcp->s_ent = &sysent[tcp->scno]; -void -qualify(const char *s) -{ - const struct qual_options *opt; - int not; - char *copy; - const char *p; - int i, n; - - if (num_quals == 0) - reallocate_qual(MIN_QUALS); - - opt = &qual_options[0]; - for (i = 0; (p = qual_options[i].option_name); i++) { - n = strlen(p); - if (strncmp(s, p, n) == 0 && s[n] == '=') { - opt = &qual_options[i]; - s += n + 1; - break; - } - } - not = 0; - if (*s == '!') { - not = 1; - s++; - } - if (strcmp(s, "none") == 0) { - not = 1 - not; - s = "all"; - } - if (strcmp(s, "all") == 0) { - for (i = 0; i < num_quals; i++) { - qualify_one(i, opt->bitflag, not, -1); - } - return; - } - for (i = 0; i < num_quals; i++) { - qualify_one(i, opt->bitflag, !not, -1); - } - copy = strdup(s); - if (!copy) - die_out_of_memory(); - for (p = strtok(copy, ","); p; p = strtok(NULL, ",")) { - if (opt->bitflag == QUAL_TRACE && (n = lookup_class(p)) > 0) { - unsigned pers; - for (pers = 0; pers < SUPPORTED_PERSONALITIES; pers++) { - for (i = 0; i < nsyscall_vec[pers]; i++) - if (sysent_vec[pers][i].sys_flags & n) - qualify_one(i, opt->bitflag, not, pers); - } - continue; - } - if (opt->qualify(p, opt->bitflag, not)) { - error_msg_and_die("invalid %s '%s'", - opt->argument_name, p); - } - } - free(copy); - return; + const unsigned int n = tcp->s_ent->nargs; + unsigned int i; + for (i = 0; i < n; i++) + tcp->u_arg[i] = tcp->u_arg[i + 1]; } +#endif -#ifdef SYS_socket_subcall +#ifdef LINUX_MIPSO32 static void -decode_socket_subcall(struct tcb *tcp) +decode_mips_subcall(struct tcb *tcp) { - unsigned long addr; - unsigned int i, n, size; - - if (tcp->u_arg[0] < 0 || tcp->u_arg[0] >= SYS_socket_nsubcalls) + if (!scno_is_valid(tcp->u_arg[0])) return; - - tcp->scno = SYS_socket_subcall + tcp->u_arg[0]; - tcp->qual_flg = qual_flags[tcp->scno]; + tcp->scno = tcp->u_arg[0]; + tcp->qual_flg = qual_flags(tcp->scno); tcp->s_ent = &sysent[tcp->scno]; - addr = tcp->u_arg[1]; - size = current_wordsize; - n = tcp->s_ent->nargs; - for (i = 0; i < n; ++i) { - if (size == sizeof(int)) { - unsigned int arg; - if (umove(tcp, addr, &arg) < 0) - arg = 0; - tcp->u_arg[i] = arg; - } - else { - unsigned long arg; - if (umove(tcp, addr, &arg) < 0) - arg = 0; - tcp->u_arg[i] = arg; - } - addr += size; + memmove(&tcp->u_arg[0], &tcp->u_arg[1], + sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0])); + /* + * Fetching the last arg of 7-arg syscalls (fadvise64_64 + * and sync_file_range) requires additional code, + * see linux/mips/get_syscall_args.c + */ + if (tcp->s_ent->nargs == MAX_ARGS) { + if (umoven(tcp, + mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]), + sizeof(tcp->u_arg[0]), + &tcp->u_arg[MAX_ARGS - 1]) < 0) + tcp->u_arg[MAX_ARGS - 1] = 0; } } -#endif +#endif /* LINUX_MIPSO32 */ -#ifdef SYS_ipc_subcall static void -decode_ipc_subcall(struct tcb *tcp) +dumpio(struct tcb *tcp) { - unsigned int i, n; - - if (tcp->u_arg[0] < 0 || tcp->u_arg[0] >= SYS_ipc_nsubcalls) + if (syserror(tcp)) return; - tcp->scno = SYS_ipc_subcall + tcp->u_arg[0]; - tcp->qual_flg = qual_flags[tcp->scno]; - tcp->s_ent = &sysent[tcp->scno]; - n = tcp->s_ent->nargs; - for (i = 0; i < n; i++) - tcp->u_arg[i] = tcp->u_arg[i + 1]; -} -#endif - -int -printargs(struct tcb *tcp) -{ - if (entering(tcp)) { - int i; - int n = tcp->s_ent->nargs; - for (i = 0; i < n; i++) - tprintf("%s%#lx", i ? ", " : "", tcp->u_arg[i]); - } - return 0; -} + int fd = tcp->u_arg[0]; + if (fd < 0) + return; -int -printargs_lu(struct tcb *tcp) -{ - if (entering(tcp)) { - int i; - int n = tcp->s_ent->nargs; - for (i = 0; i < n; i++) - tprintf("%s%lu", i ? ", " : "", tcp->u_arg[i]); + if (is_number_in_set(fd, &read_set)) { + switch (tcp->s_ent->sen) { + case SEN_read: + case SEN_pread: + case SEN_recv: + case SEN_recvfrom: + case SEN_mq_timedreceive: + dumpstr(tcp, tcp->u_arg[1], tcp->u_rval); + return; + case SEN_readv: + case SEN_preadv: + case SEN_preadv2: + dumpiov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], + tcp->u_rval); + return; + case SEN_recvmsg: + dumpiov_in_msghdr(tcp, tcp->u_arg[1], tcp->u_rval); + return; + case SEN_recvmmsg: + dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]); + return; + } } - return 0; -} - -int -printargs_ld(struct tcb *tcp) -{ - if (entering(tcp)) { - int i; - int n = tcp->s_ent->nargs; - for (i = 0; i < n; i++) - tprintf("%s%ld", i ? ", " : "", tcp->u_arg[i]); + if (is_number_in_set(fd, &write_set)) { + switch (tcp->s_ent->sen) { + case SEN_write: + case SEN_pwrite: + case SEN_send: + case SEN_sendto: + case SEN_mq_timedsend: + dumpstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); + break; + case SEN_writev: + case SEN_pwritev: + case SEN_pwritev2: + case SEN_vmsplice: + dumpiov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], -1); + break; + case SEN_sendmsg: + dumpiov_in_msghdr(tcp, tcp->u_arg[1], -1); + break; + case SEN_sendmmsg: + dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]); + break; + } } - return 0; -} - -#if defined(SPARC) || defined(SPARC64) || defined(IA64) || defined(SH) -long -getrval2(struct tcb *tcp) -{ - long val; - -# if defined(SPARC) || defined(SPARC64) - val = sparc_regs.u_regs[U_REG_O1]; -# elif defined(SH) - if (upeek(tcp->pid, 4*(REG_REG0+1), &val) < 0) - return -1; -# elif defined(IA64) - if (upeek(tcp->pid, PT_R9, &val) < 0) - return -1; -# endif - - return val; } -#endif -#if defined(I386) -static struct user_regs_struct i386_regs; -/* Cast suppresses signedness warning (.esp is long, not unsigned long) */ -uint32_t *const i386_esp_ptr = (uint32_t*)&i386_regs.esp; -# define ARCH_REGS_FOR_GETREGSET i386_regs -#elif defined(X86_64) || defined(X32) /* - * On i386, pt_regs and user_regs_struct are the same, - * but on 64 bit x86, user_regs_struct has six more fields: - * fs_base, gs_base, ds, es, fs, gs. - * PTRACE_GETREGS fills them too, so struct pt_regs would overflow. + * Shuffle syscall numbers so that we don't have huge gaps in syscall table. + * The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n. */ -struct i386_user_regs_struct { - uint32_t ebx; - uint32_t ecx; - uint32_t edx; - uint32_t esi; - uint32_t edi; - uint32_t ebp; - uint32_t eax; - uint32_t xds; - uint32_t xes; - uint32_t xfs; - uint32_t xgs; - uint32_t orig_eax; - uint32_t eip; - uint32_t xcs; - uint32_t eflags; - uint32_t esp; - uint32_t xss; -}; -static union { - struct user_regs_struct x86_64_r; - struct i386_user_regs_struct i386_r; -} x86_regs_union; -# define x86_64_regs x86_regs_union.x86_64_r -# define i386_regs x86_regs_union.i386_r -uint32_t *const i386_esp_ptr = &i386_regs.esp; -static struct iovec x86_io = { - .iov_base = &x86_regs_union -}; -#elif defined(IA64) -bool ia64_ia32mode = 0; /* not static */ -static long ia64_r8, ia64_r10; -#elif defined(POWERPC) -struct pt_regs ppc_regs; -#elif defined(M68K) -static long m68k_d0; -#elif defined(BFIN) -static long bfin_r0; -#elif defined(ARM) -struct pt_regs arm_regs; /* not static */ -# define ARCH_REGS_FOR_GETREGSET arm_regs -#elif defined(AARCH64) -static union { - struct user_pt_regs aarch64_r; - struct arm_pt_regs arm_r; -} arm_regs_union; -# define aarch64_regs arm_regs_union.aarch64_r -# define arm_regs arm_regs_union.arm_r -static struct iovec aarch64_io = { - .iov_base = &arm_regs_union -}; -#elif defined(ALPHA) -static long alpha_r0; -static long alpha_a3; -#elif defined(AVR32) -static struct pt_regs avr32_regs; -#elif defined(SPARC) || defined(SPARC64) -struct pt_regs sparc_regs; /* not static */ -#elif defined(LINUX_MIPSN32) -static long long mips_a3; -static long long mips_r2; -#elif defined(MIPS) -static long mips_a3; -static long mips_r2; -#elif defined(S390) || defined(S390X) -static long s390_gpr2; -#elif defined(HPPA) -static long hppa_r28; -#elif defined(SH) -static long sh_r0; -#elif defined(SH64) -static long sh64_r9; -#elif defined(CRISV10) || defined(CRISV32) -static long cris_r10; -#elif defined(TILE) -struct pt_regs tile_regs; -#elif defined(MICROBLAZE) -static long microblaze_r3; -#elif defined(OR1K) -static struct user_regs_struct or1k_regs; -# define ARCH_REGS_FOR_GETREGSET or1k_regs -#elif defined(METAG) -static struct user_gp_regs metag_regs; -# define ARCH_REGS_FOR_GETREGSET metag_regs -#elif defined(XTENSA) -static long xtensa_a2; -# elif defined(ARC) -static struct user_regs_struct arc_regs; -# define ARCH_REGS_FOR_GETREGSET arc_regs -#endif - -void -print_pc(struct tcb *tcp) +static kernel_ulong_t +shuffle_scno(kernel_ulong_t scno) { -#define PRINTBADPC tprintf(sizeof(long) == 4 ? "[????????] " : \ - sizeof(long) == 8 ? "[????????????????] " : \ - NULL /* crash */) - if (get_regs_error) { - PRINTBADPC; - return; - } -#if defined(I386) - tprintf("[%08lx] ", i386_regs.eip); -#elif defined(S390) || defined(S390X) - long psw; - if (upeek(tcp->pid, PT_PSWADDR, &psw) < 0) { - PRINTBADPC; - return; - } -# ifdef S390 - tprintf("[%08lx] ", psw); -# elif S390X - tprintf("[%016lx] ", psw); -# endif -#elif defined(X86_64) || defined(X32) - if (x86_io.iov_len == sizeof(i386_regs)) { - tprintf("[%08x] ", (unsigned) i386_regs.eip); - } else { -# if defined(X86_64) - tprintf("[%016lx] ", (unsigned long) x86_64_regs.rip); -# elif defined(X32) - /* Note: this truncates 64-bit rip to 32 bits */ - tprintf("[%08lx] ", (unsigned long) x86_64_regs.rip); -# endif - } -#elif defined(IA64) - long ip; - if (upeek(tcp->pid, PT_B0, &ip) < 0) { - PRINTBADPC; - return; - } - tprintf("[%08lx] ", ip); -#elif defined(POWERPC) - long pc = ppc_regs.nip; -# ifdef POWERPC64 - tprintf("[%016lx] ", pc); -# else - tprintf("[%08lx] ", pc); -# endif -#elif defined(M68K) - long pc; - if (upeek(tcp->pid, 4*PT_PC, &pc) < 0) { - tprints("[????????] "); - return; - } - tprintf("[%08lx] ", pc); -#elif defined(ALPHA) - long pc; - if (upeek(tcp->pid, REG_PC, &pc) < 0) { - tprints("[????????????????] "); - return; - } - tprintf("[%08lx] ", pc); -#elif defined(SPARC) - tprintf("[%08lx] ", sparc_regs.pc); -#elif defined(SPARC64) - tprintf("[%08lx] ", sparc_regs.tpc); -#elif defined(HPPA) - long pc; - if (upeek(tcp->pid, PT_IAOQ0, &pc) < 0) { - tprints("[????????] "); - return; - } - tprintf("[%08lx] ", pc); -#elif defined(MIPS) - long pc; - if (upeek(tcp->pid, REG_EPC, &pc) < 0) { - tprints("[????????] "); - return; - } - tprintf("[%08lx] ", pc); -#elif defined(SH) - long pc; - if (upeek(tcp->pid, 4*REG_PC, &pc) < 0) { - tprints("[????????] "); - return; - } - tprintf("[%08lx] ", pc); -#elif defined(SH64) - long pc; - if (upeek(tcp->pid, REG_PC, &pc) < 0) { - tprints("[????????????????] "); - return; - } - tprintf("[%08lx] ", pc); -#elif defined(ARM) - tprintf("[%08lx] ", arm_regs.ARM_pc); -#elif defined(AARCH64) - /* tprintf("[%016lx] ", aarch64_regs.regs[???]); */ -#elif defined(AVR32) - tprintf("[%08lx] ", avr32_regs.pc); -#elif defined(BFIN) - long pc; - if (upeek(tcp->pid, PT_PC, &pc) < 0) { - PRINTBADPC; - return; - } - tprintf("[%08lx] ", pc); -#elif defined(CRISV10) - long pc; - if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0) { - PRINTBADPC; - return; - } - tprintf("[%08lx] ", pc); -#elif defined(CRISV32) - long pc; - if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0) { - PRINTBADPC; - return; - } - tprintf("[%08lx] ", pc); -#elif defined(TILE) -# ifdef _LP64 - tprintf("[%016lx] ", (unsigned long) tile_regs.pc); -# else - tprintf("[%08lx] ", (unsigned long) tile_regs.pc); -# endif -#elif defined(OR1K) - tprintf("[%08lx] ", or1k_regs.pc); -#elif defined(METAG) - tprintf("[%08lx] ", metag_regs.pc); -#elif defined(XTENSA) - long pc; - if (upeek(tcp->pid, REG_PC, &pc) < 0) { - PRINTBADPC; - return; - } - tprintf("[%08lx] ", pc); -#elif defined(ARC) - tprintf("[%08lx] ", arc_regs.efa); -#endif /* architecture */ -} - -/* Shuffle syscall numbers so that we don't have huge gaps in syscall table. - * The shuffling should be reversible: shuffle_scno(shuffle_scno(n)) == n. - */ #if defined(ARM) || defined(AARCH64) /* So far only 32-bit ARM needs this */ -static long -shuffle_scno(unsigned long scno) -{ - if (scno <= ARM_LAST_ORDINARY_SYSCALL) + if (scno < ARM_FIRST_SHUFFLED_SYSCALL) return scno; /* __ARM_NR_cmpxchg? Swap with LAST_ORDINARY+1 */ - if (scno == 0x000ffff0) - return ARM_LAST_ORDINARY_SYSCALL+1; - if (scno == ARM_LAST_ORDINARY_SYSCALL+1) + if (scno == ARM_FIRST_SHUFFLED_SYSCALL) return 0x000ffff0; + if (scno == 0x000ffff0) + return ARM_FIRST_SHUFFLED_SYSCALL; - /* Is it ARM specific syscall? - * Swap with [LAST_ORDINARY+2, LAST_ORDINARY+2 + LAST_SPECIAL] range. +# define ARM_SECOND_SHUFFLED_SYSCALL (ARM_FIRST_SHUFFLED_SYSCALL + 1) + /* + * Is it ARM specific syscall? + * Swap [0x000f0000, 0x000f0000 + LAST_SPECIAL] range + * with [SECOND_SHUFFLED, SECOND_SHUFFLED + LAST_SPECIAL] range. */ - if (scno >= 0x000f0000 - && scno <= 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL - ) { - return scno - 0x000f0000 + (ARM_LAST_ORDINARY_SYSCALL+2); + if (scno >= 0x000f0000 && + scno <= 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL) { + return scno - 0x000f0000 + ARM_SECOND_SHUFFLED_SYSCALL; } - if (/* scno >= ARM_LAST_ORDINARY_SYSCALL+2 - always true */ 1 - && scno <= (ARM_LAST_ORDINARY_SYSCALL+2) + ARM_LAST_SPECIAL_SYSCALL - ) { - return scno + 0x000f0000 - (ARM_LAST_ORDINARY_SYSCALL+2); + if (scno <= ARM_SECOND_SHUFFLED_SYSCALL + ARM_LAST_SPECIAL_SYSCALL) { + return scno + 0x000f0000 - ARM_SECOND_SHUFFLED_SYSCALL; } +#endif /* ARM || AARCH64 */ return scno; } -#else -# define shuffle_scno(scno) ((long)(scno)) -#endif -static char* -undefined_scno_name(struct tcb *tcp) +const char * +err_name(unsigned long err) { - static char buf[sizeof("syscall_%lu") + sizeof(long)*3]; + if ((err < nerrnos) && errnoent[err]) + return errnoent[err]; - sprintf(buf, "syscall_%lu", shuffle_scno(tcp->scno)); - return buf; + return NULL; } -#ifdef POWERPC -/* - * PTRACE_GETREGS was added to the PowerPC kernel in v2.6.23, - * we provide a slow fallback for old kernels. - */ -static int powerpc_getregs_old(pid_t pid) -{ - int i; - long r; +static long get_regs_error; - if (iflag) { - r = upeek(pid, sizeof(long) * PT_NIP, (long *)&ppc_regs.nip); - if (r) - goto out; - } -#ifdef POWERPC64 /* else we never use it */ - r = upeek(pid, sizeof(long) * PT_MSR, (long *)&ppc_regs.msr); - if (r) - goto out; -#endif - r = upeek(pid, sizeof(long) * PT_CCR, (long *)&ppc_regs.ccr); - if (r) - goto out; - r = upeek(pid, sizeof(long) * PT_ORIG_R3, (long *)&ppc_regs.orig_gpr3); - if (r) - goto out; - for (i = 0; i <= 8; i++) { - r = upeek(pid, sizeof(long) * (PT_R0 + i), - (long *)&ppc_regs.gpr[i]); - if (r) - goto out; - } - out: - return r; +void +clear_regs(void) +{ + get_regs_error = -1; } -#endif -#ifndef get_regs -long get_regs_error; +static int get_syscall_args(struct tcb *); +static int get_syscall_result(struct tcb *); +static int arch_get_scno(struct tcb *tcp); +static int arch_set_scno(struct tcb *, kernel_ulong_t); +static void get_error(struct tcb *, const bool); +static int arch_set_error(struct tcb *); +static int arch_set_success(struct tcb *); + +struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES]; -#if defined(PTRACE_GETREGSET) && defined(NT_PRSTATUS) -static void get_regset(pid_t pid) +static struct inject_opts * +tcb_inject_opts(struct tcb *tcp) { -/* constant iovec */ -# if defined(ARM) \ - || defined(I386) \ - || defined(METAG) \ - || defined(OR1K) \ - || defined(ARC) - static struct iovec io = { - .iov_base = &ARCH_REGS_FOR_GETREGSET, - .iov_len = sizeof(ARCH_REGS_FOR_GETREGSET) - }; - get_regs_error = ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &io); - -/* variable iovec */ -# elif defined(X86_64) || defined(X32) - /* x86_io.iov_base = &x86_regs_union; - already is */ - x86_io.iov_len = sizeof(x86_regs_union); - get_regs_error = ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &x86_io); -# elif defined(AARCH64) - /* aarch64_io.iov_base = &arm_regs_union; - already is */ - aarch64_io.iov_len = sizeof(arm_regs_union); - get_regs_error = ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &aarch64_io); -# else -# warning both PTRACE_GETREGSET and NT_PRSTATUS are available but not yet used -# endif + return (scno_in_range(tcp->scno) && tcp->inject_vec[current_personality]) + ? &tcp->inject_vec[current_personality][tcp->scno] : NULL; } -#endif /* PTRACE_GETREGSET && NT_PRSTATUS */ -void -get_regs(pid_t pid) + +static long +tamper_with_syscall_entering(struct tcb *tcp, unsigned int *signo) { -/* PTRACE_GETREGSET only */ -# if defined(METAG) || defined(OR1K) || defined(X32) || defined(AARCH64) || defined(ARC) - get_regset(pid); - -/* PTRACE_GETREGS only */ -# elif defined(AVR32) - get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, &avr32_regs); -# elif defined(TILE) - get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, &tile_regs); -# elif defined(SPARC) || defined(SPARC64) - get_regs_error = ptrace(PTRACE_GETREGS, pid, (char *)&sparc_regs, 0); -# elif defined(POWERPC) - static bool old_kernel = 0; - if (old_kernel) - goto old; - get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, (long) &ppc_regs); - if (get_regs_error && errno == EIO) { - old_kernel = 1; - old: - get_regs_error = powerpc_getregs_old(pid); + if (!tcp->inject_vec[current_personality]) { + tcp->inject_vec[current_personality] = + xcalloc(nsyscalls, sizeof(**inject_vec)); + memcpy(tcp->inject_vec[current_personality], + inject_vec[current_personality], + nsyscalls * sizeof(**inject_vec)); } -/* try PTRACE_GETREGSET first, fallback to PTRACE_GETREGS */ -# else -# if defined(PTRACE_GETREGSET) && defined(NT_PRSTATUS) - static int getregset_support; + struct inject_opts *opts = tcb_inject_opts(tcp); - if (getregset_support >= 0) { - get_regset(pid); - if (getregset_support > 0) - return; - if (get_regs_error >= 0) { - getregset_support = 1; - return; - } - if (errno == EPERM || errno == ESRCH) - return; - getregset_support = -1; - } -# endif /* PTRACE_GETREGSET && NT_PRSTATUS */ -# if defined(ARM) - get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, &arm_regs); -# elif defined(I386) - get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, &i386_regs); -# elif defined(X86_64) - /* Use old method, with unreliable heuristical detection of 32-bitness. */ - x86_io.iov_len = sizeof(x86_64_regs); - get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, &x86_64_regs); - if (!get_regs_error && x86_64_regs.cs == 0x23) { - x86_io.iov_len = sizeof(i386_regs); - /* - * The order is important: i386_regs and x86_64_regs - * are overlaid in memory! - */ - i386_regs.ebx = x86_64_regs.rbx; - i386_regs.ecx = x86_64_regs.rcx; - i386_regs.edx = x86_64_regs.rdx; - i386_regs.esi = x86_64_regs.rsi; - i386_regs.edi = x86_64_regs.rdi; - i386_regs.ebp = x86_64_regs.rbp; - i386_regs.eax = x86_64_regs.rax; - /* i386_regs.xds = x86_64_regs.ds; unused by strace */ - /* i386_regs.xes = x86_64_regs.es; ditto... */ - /* i386_regs.xfs = x86_64_regs.fs; */ - /* i386_regs.xgs = x86_64_regs.gs; */ - i386_regs.orig_eax = x86_64_regs.orig_rax; - i386_regs.eip = x86_64_regs.rip; - /* i386_regs.xcs = x86_64_regs.cs; */ - /* i386_regs.eflags = x86_64_regs.eflags; */ - i386_regs.esp = x86_64_regs.rsp; - /* i386_regs.xss = x86_64_regs.ss; */ - } -# else -# error unhandled architecture -# endif /* ARM || I386 || X86_64 */ -# endif -} -#endif /* !get_regs */ + if (!opts || opts->first == 0) + return 0; -/* Returns: - * 0: "ignore this ptrace stop", bail out of trace_syscall_entering() silently. - * 1: ok, continue in trace_syscall_entering(). - * other: error, trace_syscall_entering() should print error indicator - * ("????" etc) and bail out. - */ -static int -get_scno(struct tcb *tcp) -{ - long scno = 0; - -#if defined(S390) || defined(S390X) - if (upeek(tcp->pid, PT_GPR2, &s390_gpr2) < 0) - return -1; - - if (s390_gpr2 != -ENOSYS) { - /* - * Since kernel version 2.5.44 the scno gets passed in gpr2. - */ - scno = s390_gpr2; - } else { - /* - * Old style of "passing" the scno via the SVC instruction. - */ - long psw; - long opcode, offset_reg, tmp; - void *svc_addr; - static const int gpr_offset[16] = { - PT_GPR0, PT_GPR1, PT_ORIGGPR2, PT_GPR3, - PT_GPR4, PT_GPR5, PT_GPR6, PT_GPR7, - PT_GPR8, PT_GPR9, PT_GPR10, PT_GPR11, - PT_GPR12, PT_GPR13, PT_GPR14, PT_GPR15 - }; - - if (upeek(tcp->pid, PT_PSWADDR, &psw) < 0) - return -1; - errno = 0; - opcode = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)(psw - sizeof(long)), 0); - if (errno) { - perror_msg("peektext(psw-oneword)"); - return -1; - } - - /* - * We have to check if the SVC got executed directly or via an - * EXECUTE instruction. In case of EXECUTE it is necessary to do - * instruction decoding to derive the system call number. - * Unfortunately the opcode sizes of EXECUTE and SVC are differently, - * so that this doesn't work if a SVC opcode is part of an EXECUTE - * opcode. Since there is no way to find out the opcode size this - * is the best we can do... - */ - if ((opcode & 0xff00) == 0x0a00) { - /* SVC opcode */ - scno = opcode & 0xff; - } - else { - /* SVC got executed by EXECUTE instruction */ - - /* - * Do instruction decoding of EXECUTE. If you really want to - * understand this, read the Principles of Operations. - */ - svc_addr = (void *) (opcode & 0xfff); - - tmp = 0; - offset_reg = (opcode & 0x000f0000) >> 16; - if (offset_reg && (upeek(tcp->pid, gpr_offset[offset_reg], &tmp) < 0)) - return -1; - svc_addr += tmp; - - tmp = 0; - offset_reg = (opcode & 0x0000f000) >> 12; - if (offset_reg && (upeek(tcp->pid, gpr_offset[offset_reg], &tmp) < 0)) - return -1; - svc_addr += tmp; - - scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, svc_addr, 0); - if (errno) - return -1; -# if defined(S390X) - scno >>= 48; -# else - scno >>= 16; -# endif - tmp = 0; - offset_reg = (opcode & 0x00f00000) >> 20; - if (offset_reg && (upeek(tcp->pid, gpr_offset[offset_reg], &tmp) < 0)) - return -1; - - scno = (scno | tmp) & 0xff; - } - } -#elif defined(POWERPC) - scno = ppc_regs.gpr[0]; -# ifdef POWERPC64 - int currpers; + --opts->first; - /* - * Check for 64/32 bit mode. - * Embedded implementations covered by Book E extension of PPC use - * bit 0 (CM) of 32-bit Machine state register (MSR). - * Other implementations use bit 0 (SF) of 64-bit MSR. - */ - currpers = (ppc_regs.msr & 0x8000000080000000) ? 0 : 1; - update_personality(tcp, currpers); -# endif -#elif defined(AVR32) - scno = avr32_regs.r8; -#elif defined(BFIN) - if (upeek(tcp->pid, PT_ORIG_P0, &scno)) - return -1; -#elif defined(I386) - scno = i386_regs.orig_eax; -#elif defined(X86_64) || defined(X32) -# ifndef __X32_SYSCALL_BIT -# define __X32_SYSCALL_BIT 0x40000000 -# endif - int currpers; -# if 1 - /* GETREGSET of NT_PRSTATUS tells us regset size, - * which unambiguously detects i386. - * - * Linux kernel distinguishes x86-64 and x32 processes - * solely by looking at __X32_SYSCALL_BIT: - * arch/x86/include/asm/compat.h::is_x32_task(): - * if (task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT) - * return true; - */ - if (x86_io.iov_len == sizeof(i386_regs)) { - scno = i386_regs.orig_eax; - currpers = 1; - } else { - scno = x86_64_regs.orig_rax; - currpers = 0; - if (scno & __X32_SYSCALL_BIT) { - scno -= __X32_SYSCALL_BIT; - currpers = 2; - } - } -# elif 0 - /* cs = 0x33 for long mode (native 64 bit and x32) - * cs = 0x23 for compatibility mode (32 bit) - * ds = 0x2b for x32 mode (x86-64 in 32 bit) - */ - scno = x86_64_regs.orig_rax; - switch (x86_64_regs.cs) { - case 0x23: currpers = 1; break; - case 0x33: - if (x86_64_regs.ds == 0x2b) { - currpers = 2; - scno &= ~__X32_SYSCALL_BIT; - } else - currpers = 0; - break; - default: - fprintf(stderr, "Unknown value CS=0x%08X while " - "detecting personality of process " - "PID=%d\n", (int)x86_64_regs.cs, tcp->pid); - currpers = current_personality; - break; - } -# elif 0 - /* This version analyzes the opcode of a syscall instruction. - * (int 0x80 on i386 vs. syscall on x86-64) - * It works, but is too complicated, and strictly speaking, unreliable. - */ - unsigned long call, rip = x86_64_regs.rip; - /* sizeof(syscall) == sizeof(int 0x80) == 2 */ - rip -= 2; - errno = 0; - call = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)rip, (char *)0); - if (errno) - fprintf(stderr, "ptrace_peektext failed: %s\n", - strerror(errno)); - switch (call & 0xffff) { - /* x86-64: syscall = 0x0f 0x05 */ - case 0x050f: currpers = 0; break; - /* i386: int 0x80 = 0xcd 0x80 */ - case 0x80cd: currpers = 1; break; - default: - currpers = current_personality; - fprintf(stderr, - "Unknown syscall opcode (0x%04X) while " - "detecting personality of process " - "PID=%d\n", (int)call, tcp->pid); - break; - } -# endif - -# ifdef X32 - /* If we are built for a x32 system, then personality 0 is x32 - * (not x86_64), and stracing of x86_64 apps is not supported. - * Stracing of i386 apps is still supported. - */ - if (currpers == 0) { - fprintf(stderr, "syscall_%lu(...) in unsupported " - "64-bit mode of process PID=%d\n", - scno, tcp->pid); + if (opts->first != 0) return 0; - } - currpers &= ~2; /* map 2,1 to 0,1 */ -# endif - update_personality(tcp, currpers); -#elif defined(IA64) -# define IA64_PSR_IS ((long)1 << 34) - long psr; - if (upeek(tcp->pid, PT_CR_IPSR, &psr) >= 0) - ia64_ia32mode = ((psr & IA64_PSR_IS) != 0); - if (ia64_ia32mode) { - if (upeek(tcp->pid, PT_R1, &scno) < 0) - return -1; - } else { - if (upeek(tcp->pid, PT_R15, &scno) < 0) - return -1; - } -#elif defined(AARCH64) - switch (aarch64_io.iov_len) { - case sizeof(aarch64_regs): - /* We are in 64-bit mode */ - scno = aarch64_regs.regs[8]; - update_personality(tcp, 1); - break; - case sizeof(arm_regs): - /* We are in 32-bit mode */ - /* Note: we don't support OABI, unlike 32-bit ARM build */ - scno = arm_regs.ARM_r7; - scno = shuffle_scno(scno); - update_personality(tcp, 0); - break; - } -#elif defined(ARM) - if (arm_regs.ARM_ip != 0) { - /* It is not a syscall entry */ - fprintf(stderr, "pid %d stray syscall exit\n", tcp->pid); - tcp->flags |= TCB_INSYSCALL; - return 0; - } - /* Note: we support only 32-bit CPUs, not 26-bit */ - -# if !defined(__ARM_EABI__) || ENABLE_ARM_OABI - if (arm_regs.ARM_cpsr & 0x20) - /* Thumb mode */ - goto scno_in_r7; - /* ARM mode */ - /* Check EABI/OABI by examining SVC insn's low 24 bits */ - errno = 0; - scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *)(arm_regs.ARM_pc - 4), NULL); - if (errno) - return -1; - /* EABI syscall convention? */ - if (scno != 0xef000000) { - /* No, it's OABI */ - if ((scno & 0x0ff00000) != 0x0f900000) { - fprintf(stderr, "pid %d unknown syscall trap 0x%08lx\n", - tcp->pid, scno); - return -1; - } - /* Fixup the syscall number */ - scno &= 0x000fffff; - } else { - scno_in_r7: - scno = arm_regs.ARM_r7; - } -# else /* __ARM_EABI__ || !ENABLE_ARM_OABI */ - scno = arm_regs.ARM_r7; -# endif - scno = shuffle_scno(scno); -#elif defined(M68K) - if (upeek(tcp->pid, 4*PT_ORIG_D0, &scno) < 0) - return -1; -#elif defined(LINUX_MIPSN32) - unsigned long long regs[38]; - - if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long) ®s) < 0) - return -1; - mips_a3 = regs[REG_A3]; - mips_r2 = regs[REG_V0]; - - scno = mips_r2; - if (!SCNO_IN_RANGE(scno)) { - if (mips_a3 == 0 || mips_a3 == -1) { - if (debug_flag) - fprintf(stderr, "stray syscall exit: v0 = %ld\n", scno); - return 0; - } - } -#elif defined(MIPS) - if (upeek(tcp->pid, REG_A3, &mips_a3) < 0) - return -1; - if (upeek(tcp->pid, REG_V0, &scno) < 0) - return -1; - - if (!SCNO_IN_RANGE(scno)) { - if (mips_a3 == 0 || mips_a3 == -1) { - if (debug_flag) - fprintf(stderr, "stray syscall exit: v0 = %ld\n", scno); - return 0; - } - } -#elif defined(ALPHA) - if (upeek(tcp->pid, REG_A3, &alpha_a3) < 0) - return -1; - if (upeek(tcp->pid, REG_R0, &scno) < 0) - return -1; - - /* - * Do some sanity checks to figure out if it's - * really a syscall entry - */ - if (!SCNO_IN_RANGE(scno)) { - if (alpha_a3 == 0 || alpha_a3 == -1) { - if (debug_flag) - fprintf(stderr, "stray syscall exit: r0 = %ld\n", scno); - return 0; - } - } -#elif defined(SPARC) || defined(SPARC64) - /* Disassemble the syscall trap. */ - /* Retrieve the syscall trap instruction. */ - unsigned long trap; - errno = 0; -# if defined(SPARC64) - trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)sparc_regs.tpc, 0); - trap >>= 32; -# else - trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)sparc_regs.pc, 0); -# endif - if (errno) - return -1; - /* Disassemble the trap to see what personality to use. */ - switch (trap) { - case 0x91d02010: - /* Linux/SPARC syscall trap. */ - update_personality(tcp, 0); - break; - case 0x91d0206d: - /* Linux/SPARC64 syscall trap. */ - update_personality(tcp, 2); - break; - case 0x91d02000: - /* SunOS syscall trap. (pers 1) */ - fprintf(stderr, "syscall: SunOS no support\n"); - return -1; - case 0x91d02008: - /* Solaris 2.x syscall trap. (per 2) */ - update_personality(tcp, 1); - break; - case 0x91d02009: - /* NetBSD/FreeBSD syscall trap. */ - fprintf(stderr, "syscall: NetBSD/FreeBSD not supported\n"); - return -1; - case 0x91d02027: - /* Solaris 2.x gettimeofday */ - update_personality(tcp, 1); - break; - default: -# if defined(SPARC64) - fprintf(stderr, "syscall: unknown syscall trap %08lx %016lx\n", trap, sparc_regs.tpc); -# else - fprintf(stderr, "syscall: unknown syscall trap %08lx %08lx\n", trap, sparc_regs.pc); -# endif - return -1; - } - - /* Extract the system call number from the registers. */ - if (trap == 0x91d02027) - scno = 156; - else - scno = sparc_regs.u_regs[U_REG_G1]; - if (scno == 0) { - scno = sparc_regs.u_regs[U_REG_O0]; - memmove(&sparc_regs.u_regs[U_REG_O0], &sparc_regs.u_regs[U_REG_O1], 7*sizeof(sparc_regs.u_regs[0])); - } -#elif defined(HPPA) - if (upeek(tcp->pid, PT_GR20, &scno) < 0) - return -1; -#elif defined(SH) - /* - * In the new syscall ABI, the system call number is in R3. - */ - if (upeek(tcp->pid, 4*(REG_REG0+3), &scno) < 0) - return -1; + opts->first = opts->step; - if (scno < 0) { - /* Odd as it may seem, a glibc bug has been known to cause - glibc to issue bogus negative syscall numbers. So for - our purposes, make strace print what it *should* have been */ - long correct_scno = (scno & 0xff); - if (debug_flag) - fprintf(stderr, - "Detected glibc bug: bogus system call" - " number = %ld, correcting to %ld\n", - scno, - correct_scno); - scno = correct_scno; - } -#elif defined(SH64) - if (upeek(tcp->pid, REG_SYSCALL, &scno) < 0) - return -1; - scno &= 0xFFFF; -#elif defined(CRISV10) || defined(CRISV32) - if (upeek(tcp->pid, 4*PT_R9, &scno) < 0) - return -1; -#elif defined(TILE) - int currpers; - scno = tile_regs.regs[10]; -# ifdef __tilepro__ - currpers = 1; -# else -# ifndef PT_FLAGS_COMPAT -# define PT_FLAGS_COMPAT 0x10000 /* from Linux 3.8 on */ -# endif - if (tile_regs.flags & PT_FLAGS_COMPAT) - currpers = 1; - else - currpers = 0; -# endif - update_personality(tcp, currpers); -#elif defined(MICROBLAZE) - if (upeek(tcp->pid, 0, &scno) < 0) - return -1; -#elif defined(OR1K) - scno = or1k_regs.gpr[11]; -#elif defined(METAG) - scno = metag_regs.dx[0][1]; /* syscall number in D1Re0 (D1.0) */ -#elif defined(XTENSA) - if (upeek(tcp->pid, SYSCALL_NR, &scno) < 0) - return -1; -# elif defined(ARC) - scno = arc_regs.scratch.r8; -#endif + if (opts->signo > 0) + *signo = opts->signo; + if (opts->rval != INJECT_OPTS_RVAL_DEFAULT && !arch_set_scno(tcp, -1)) + tcp->flags |= TCB_TAMPERED; - tcp->scno = scno; - if (SCNO_IS_VALID(tcp->scno)) { - tcp->s_ent = &sysent[scno]; - tcp->qual_flg = qual_flags[scno]; - } else { - static const struct_sysent unknown = { - .nargs = MAX_ARGS, - .sys_flags = 0, - .sys_func = printargs, - .sys_name = "unknown", /* not used */ - }; - tcp->s_ent = &unknown; - tcp->qual_flg = UNDEFINED_SCNO | QUAL_RAW | DEFAULT_QUAL_FLAGS; - } - return 1; -} - -/* Called at each syscall entry. - * Returns: - * 0: "ignore this ptrace stop", bail out of trace_syscall_entering() silently. - * 1: ok, continue in trace_syscall_entering(). - * other: error, trace_syscall_entering() should print error indicator - * ("????" etc) and bail out. - */ -static int -syscall_fixup_on_sysenter(struct tcb *tcp) -{ - /* A common case of "not a syscall entry" is post-execve SIGTRAP */ -#if defined(I386) - if (i386_regs.eax != -ENOSYS) { - if (debug_flag) - fprintf(stderr, "not a syscall entry (eax = %ld)\n", i386_regs.eax); - return 0; - } -#elif defined(X86_64) || defined(X32) - { - long rax; - if (x86_io.iov_len == sizeof(i386_regs)) { - /* Sign extend from 32 bits */ - rax = (int32_t)i386_regs.eax; - } else { - /* Note: in X32 build, this truncates 64 to 32 bits */ - rax = x86_64_regs.rax; - } - if (rax != -ENOSYS) { - if (debug_flag) - fprintf(stderr, "not a syscall entry (rax = %ld)\n", rax); - return 0; - } - } -#elif defined(M68K) - /* TODO? Eliminate upeek's in arches below like we did in x86 */ - if (upeek(tcp->pid, 4*PT_D0, &m68k_d0) < 0) - return -1; - if (m68k_d0 != -ENOSYS) { - if (debug_flag) - fprintf(stderr, "not a syscall entry (d0 = %ld)\n", m68k_d0); - return 0; - } -#elif defined(IA64) - if (upeek(tcp->pid, PT_R10, &ia64_r10) < 0) - return -1; - if (upeek(tcp->pid, PT_R8, &ia64_r8) < 0) - return -1; - if (ia64_ia32mode && ia64_r8 != -ENOSYS) { - if (debug_flag) - fprintf(stderr, "not a syscall entry (r8 = %ld)\n", ia64_r8); - return 0; - } -#elif defined(CRISV10) || defined(CRISV32) - if (upeek(tcp->pid, 4*PT_R10, &cris_r10) < 0) - return -1; - if (cris_r10 != -ENOSYS) { - if (debug_flag) - fprintf(stderr, "not a syscall entry (r10 = %ld)\n", cris_r10); - return 0; - } -#elif defined(MICROBLAZE) - if (upeek(tcp->pid, 3 * 4, µblaze_r3) < 0) - return -1; - if (microblaze_r3 != -ENOSYS) { - if (debug_flag) - fprintf(stderr, "not a syscall entry (r3 = %ld)\n", microblaze_r3); - return 0; - } -#endif - return 1; -} - -static void -internal_fork(struct tcb *tcp) -{ -#if defined S390 || defined S390X || defined CRISV10 || defined CRISV32 -# define ARG_FLAGS 1 -#else -# define ARG_FLAGS 0 -#endif -#ifndef CLONE_UNTRACED -# define CLONE_UNTRACED 0x00800000 -#endif - if ((ptrace_setoptions - & (PTRACE_O_TRACECLONE | PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK)) - == (PTRACE_O_TRACECLONE | PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK)) - return; - - if (!followfork) - return; - - if (entering(tcp)) { - /* - * We won't see the new child if clone is called with - * CLONE_UNTRACED, so we keep the same logic with that option - * and don't trace it. - */ - if ((tcp->s_ent->sys_func == sys_clone) - && (tcp->u_arg[ARG_FLAGS] & CLONE_UNTRACED) - ) - return; - setbpt(tcp); - } else { - if (tcp->flags & TCB_BPTSET) - clearbpt(tcp); - } -} - -#if defined(TCB_WAITEXECVE) -static void -internal_exec(struct tcb *tcp) -{ - /* Maybe we have post-execve SIGTRAP suppressed? */ - if (ptrace_setoptions & PTRACE_O_TRACEEXEC) - return; /* yes, no need to do anything */ - - if (exiting(tcp) && syserror(tcp)) - /* Error in execve, no post-execve SIGTRAP expected */ - tcp->flags &= ~TCB_WAITEXECVE; - else - tcp->flags |= TCB_WAITEXECVE; -} -#endif - -static void -syscall_fixup_for_fork_exec(struct tcb *tcp) -{ - /* - * We must always trace a few critical system calls in order to - * correctly support following forks in the presence of tracing - * qualifiers. - */ - int (*func)(); - - func = tcp->s_ent->sys_func; - - if ( sys_fork == func - || sys_clone == func - ) { - internal_fork(tcp); - return; - } - -#if defined(TCB_WAITEXECVE) - if ( sys_execve == func -# if defined(SPARC) || defined(SPARC64) - || sys_execv == func -# endif - ) { - internal_exec(tcp); - return; - } -#endif -} - -/* Return -1 on error or 1 on success (never 0!) */ -static int -get_syscall_args(struct tcb *tcp) -{ - int i, nargs; - - nargs = tcp->s_ent->nargs; - -#if defined(S390) || defined(S390X) - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, i==0 ? PT_ORIGGPR2 : PT_GPR2 + i*sizeof(long), &tcp->u_arg[i]) < 0) - return -1; -#elif defined(ALPHA) - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, REG_A0+i, &tcp->u_arg[i]) < 0) - return -1; -#elif defined(IA64) - if (!ia64_ia32mode) { - unsigned long *out0, cfm, sof, sol; - long rbs_end; - /* be backwards compatible with kernel < 2.4.4... */ -# ifndef PT_RBS_END -# define PT_RBS_END PT_AR_BSP -# endif - - if (upeek(tcp->pid, PT_RBS_END, &rbs_end) < 0) - return -1; - if (upeek(tcp->pid, PT_CFM, (long *) &cfm) < 0) - return -1; - - sof = (cfm >> 0) & 0x7f; - sol = (cfm >> 7) & 0x7f; - out0 = ia64_rse_skip_regs((unsigned long *) rbs_end, -sof + sol); - - for (i = 0; i < nargs; ++i) { - if (umoven(tcp, (unsigned long) ia64_rse_skip_regs(out0, i), - sizeof(long), (char *) &tcp->u_arg[i]) < 0) - return -1; - } - } else { - static const int argreg[MAX_ARGS] = { PT_R11 /* EBX = out0 */, - PT_R9 /* ECX = out1 */, - PT_R10 /* EDX = out2 */, - PT_R14 /* ESI = out3 */, - PT_R15 /* EDI = out4 */, - PT_R13 /* EBP = out5 */}; - - for (i = 0; i < nargs; ++i) { - if (upeek(tcp->pid, argreg[i], &tcp->u_arg[i]) < 0) - return -1; - /* truncate away IVE sign-extension */ - tcp->u_arg[i] &= 0xffffffff; - } - } -#elif defined(LINUX_MIPSN32) || defined(LINUX_MIPSN64) - /* N32 and N64 both use up to six registers. */ - unsigned long long regs[38]; - - if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long) ®s) < 0) - return -1; - - for (i = 0; i < nargs; ++i) { - tcp->u_arg[i] = regs[REG_A0 + i]; -# if defined(LINUX_MIPSN32) - tcp->ext_arg[i] = regs[REG_A0 + i]; -# endif - } -#elif defined(MIPS) - if (nargs > 4) { - long sp; - - if (upeek(tcp->pid, REG_SP, &sp) < 0) - return -1; - for (i = 0; i < 4; ++i) - if (upeek(tcp->pid, REG_A0 + i, &tcp->u_arg[i]) < 0) - return -1; - umoven(tcp, sp + 16, (nargs - 4) * sizeof(tcp->u_arg[0]), - (char *)(tcp->u_arg + 4)); - } else { - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, REG_A0 + i, &tcp->u_arg[i]) < 0) - return -1; - } -#elif defined(POWERPC) - (void)i; - (void)nargs; - tcp->u_arg[0] = ppc_regs.orig_gpr3; - tcp->u_arg[1] = ppc_regs.gpr[4]; - tcp->u_arg[2] = ppc_regs.gpr[5]; - tcp->u_arg[3] = ppc_regs.gpr[6]; - tcp->u_arg[4] = ppc_regs.gpr[7]; - tcp->u_arg[5] = ppc_regs.gpr[8]; -#elif defined(SPARC) || defined(SPARC64) - for (i = 0; i < nargs; ++i) - tcp->u_arg[i] = sparc_regs.u_regs[U_REG_O0 + i]; -#elif defined(HPPA) - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, PT_GR26-4*i, &tcp->u_arg[i]) < 0) - return -1; -#elif defined(ARM) || defined(AARCH64) -# if defined(AARCH64) - if (tcp->currpers == 1) - for (i = 0; i < nargs; ++i) - tcp->u_arg[i] = aarch64_regs.regs[i]; - else -# endif - for (i = 0; i < nargs; ++i) - tcp->u_arg[i] = arm_regs.uregs[i]; -#elif defined(AVR32) - (void)i; - (void)nargs; - tcp->u_arg[0] = avr32_regs.r12; - tcp->u_arg[1] = avr32_regs.r11; - tcp->u_arg[2] = avr32_regs.r10; - tcp->u_arg[3] = avr32_regs.r9; - tcp->u_arg[4] = avr32_regs.r5; - tcp->u_arg[5] = avr32_regs.r3; -#elif defined(BFIN) - static const int argreg[MAX_ARGS] = { PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5 }; - - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, argreg[i], &tcp->u_arg[i]) < 0) - return -1; -#elif defined(SH) - static const int syscall_regs[MAX_ARGS] = { - 4 * (REG_REG0+4), 4 * (REG_REG0+5), 4 * (REG_REG0+6), - 4 * (REG_REG0+7), 4 * (REG_REG0 ), 4 * (REG_REG0+1) - }; - - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, syscall_regs[i], &tcp->u_arg[i]) < 0) - return -1; -#elif defined(SH64) - int i; - /* Registers used by SH5 Linux system calls for parameters */ - static const int syscall_regs[MAX_ARGS] = { 2, 3, 4, 5, 6, 7 }; - - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, REG_GENERAL(syscall_regs[i]), &tcp->u_arg[i]) < 0) - return -1; -#elif defined(I386) - (void)i; - (void)nargs; - tcp->u_arg[0] = i386_regs.ebx; - tcp->u_arg[1] = i386_regs.ecx; - tcp->u_arg[2] = i386_regs.edx; - tcp->u_arg[3] = i386_regs.esi; - tcp->u_arg[4] = i386_regs.edi; - tcp->u_arg[5] = i386_regs.ebp; -#elif defined(X86_64) || defined(X32) - (void)i; - (void)nargs; - if (x86_io.iov_len != sizeof(i386_regs)) { - /* x86-64 or x32 ABI */ - tcp->u_arg[0] = x86_64_regs.rdi; - tcp->u_arg[1] = x86_64_regs.rsi; - tcp->u_arg[2] = x86_64_regs.rdx; - tcp->u_arg[3] = x86_64_regs.r10; - tcp->u_arg[4] = x86_64_regs.r8; - tcp->u_arg[5] = x86_64_regs.r9; -# ifdef X32 - tcp->ext_arg[0] = x86_64_regs.rdi; - tcp->ext_arg[1] = x86_64_regs.rsi; - tcp->ext_arg[2] = x86_64_regs.rdx; - tcp->ext_arg[3] = x86_64_regs.r10; - tcp->ext_arg[4] = x86_64_regs.r8; - tcp->ext_arg[5] = x86_64_regs.r9; -# endif - } else { - /* i386 ABI */ - /* Zero-extend from 32 bits */ - /* Use widen_to_long(tcp->u_arg[N]) in syscall handlers - * if you need to use *sign-extended* parameter. - */ - tcp->u_arg[0] = (long)(uint32_t)i386_regs.ebx; - tcp->u_arg[1] = (long)(uint32_t)i386_regs.ecx; - tcp->u_arg[2] = (long)(uint32_t)i386_regs.edx; - tcp->u_arg[3] = (long)(uint32_t)i386_regs.esi; - tcp->u_arg[4] = (long)(uint32_t)i386_regs.edi; - tcp->u_arg[5] = (long)(uint32_t)i386_regs.ebp; - } -#elif defined(MICROBLAZE) - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, (5 + i) * 4, &tcp->u_arg[i]) < 0) - return -1; -#elif defined(CRISV10) || defined(CRISV32) - static const int crisregs[MAX_ARGS] = { - 4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12, - 4*PT_R13 , 4*PT_MOF, 4*PT_SRP - }; - - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, crisregs[i], &tcp->u_arg[i]) < 0) - return -1; -#elif defined(TILE) - for (i = 0; i < nargs; ++i) - tcp->u_arg[i] = tile_regs.regs[i]; -#elif defined(M68K) - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, (i < 5 ? i : i + 2)*4, &tcp->u_arg[i]) < 0) - return -1; -#elif defined(OR1K) - (void)nargs; - for (i = 0; i < 6; ++i) - tcp->u_arg[i] = or1k_regs.gpr[3 + i]; -#elif defined(METAG) - for (i = 0; i < nargs; i++) - /* arguments go backwards from D1Ar1 (D1.3) */ - tcp->u_arg[i] = ((unsigned long *)&metag_regs.dx[3][1])[-i]; -#elif defined(XTENSA) - /* arg0: a6, arg1: a3, arg2: a4, arg3: a5, arg4: a8, arg5: a9 */ - static const int xtensaregs[MAX_ARGS] = { 6, 3, 4, 5, 8, 9 }; - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, REG_A_BASE + xtensaregs[i], &tcp->u_arg[i]) < 0) - return -1; -# elif defined(ARC) - long *arc_args = &arc_regs.scratch.r0; - for (i = 0; i < nargs; ++i) - tcp->u_arg[i] = *arc_args--; - -#else /* Other architecture (32bits specific) */ - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, i*4, &tcp->u_arg[i]) < 0) - return -1; -#endif - return 1; + return 0; } -static int -trace_syscall_entering(struct tcb *tcp) +static long +tamper_with_syscall_exiting(struct tcb *tcp) { - int res, scno_good; - -#if defined TCB_WAITEXECVE - if (tcp->flags & TCB_WAITEXECVE) { - /* This is the post-execve SIGTRAP. */ - tcp->flags &= ~TCB_WAITEXECVE; - return 0; - } -#endif - - scno_good = res = (get_regs_error ? -1 : get_scno(tcp)); - if (res == 0) - return res; - if (res == 1) { - res = syscall_fixup_on_sysenter(tcp); - if (res == 0) - return res; - if (res == 1) - res = get_syscall_args(tcp); - } - - if (res != 1) { - printleader(tcp); - if (scno_good != 1) - tprints("????" /* anti-trigraph gap */ "("); - else if (tcp->qual_flg & UNDEFINED_SCNO) - tprintf("%s(", undefined_scno_name(tcp)); - else - tprintf("%s(", tcp->s_ent->sys_name); - /* - * " " will be added later by the code which - * detects ptrace errors. - */ - goto ret; - } - - if ( sys_execve == tcp->s_ent->sys_func -# if defined(SPARC) || defined(SPARC64) - || sys_execv == tcp->s_ent->sys_func -# endif - ) { - hide_log_until_execve = 0; - } - -#if defined(SYS_socket_subcall) || defined(SYS_ipc_subcall) - while (1) { -# ifdef SYS_socket_subcall - if (tcp->s_ent->sys_func == sys_socketcall) { - decode_socket_subcall(tcp); - break; - } -# endif -# ifdef SYS_ipc_subcall - if (tcp->s_ent->sys_func == sys_ipc) { - decode_ipc_subcall(tcp); - break; - } -# endif - break; - } -#endif + struct inject_opts *opts = tcb_inject_opts(tcp); - if (need_fork_exec_workarounds) - syscall_fixup_for_fork_exec(tcp); - - if (!(tcp->qual_flg & QUAL_TRACE) - || (tracing_paths && !pathtrace_match(tcp)) - ) { - tcp->flags |= TCB_INSYSCALL | TCB_FILTERED; + if (!opts) return 0; - } - - tcp->flags &= ~TCB_FILTERED; - - if (cflag == CFLAG_ONLY_STATS || hide_log_until_execve) { - res = 0; - goto ret; - } - -#ifdef USE_LIBUNWIND - if (stack_trace_enabled) { - if (tcp->s_ent->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) - unwind_capture_stacktrace(tcp); - } -#endif - - printleader(tcp); - if (tcp->qual_flg & UNDEFINED_SCNO) - tprintf("%s(", undefined_scno_name(tcp)); - else - tprintf("%s(", tcp->s_ent->sys_name); - if ((tcp->qual_flg & QUAL_RAW) && tcp->s_ent->sys_func != sys_exit) - res = printargs(tcp); - else - res = tcp->s_ent->sys_func(tcp); - - fflush(tcp->outf); - ret: - tcp->flags |= TCB_INSYSCALL; - /* Measure the entrance time as late as possible to avoid errors. */ - if (Tflag || cflag) - gettimeofday(&tcp->etime, NULL); - return res; -} - -/* Returns: - * 1: ok, continue in trace_syscall_exiting(). - * -1: error, trace_syscall_exiting() should print error indicator - * ("????" etc) and bail out. - */ -static int -get_syscall_result(struct tcb *tcp) -{ -#if defined(S390) || defined(S390X) - if (upeek(tcp->pid, PT_GPR2, &s390_gpr2) < 0) - return -1; -#elif defined(POWERPC) - /* already done by get_regs */ -#elif defined(AVR32) - /* already done by get_regs */ -#elif defined(BFIN) - if (upeek(tcp->pid, PT_R0, &bfin_r0) < 0) - return -1; -#elif defined(I386) - /* already done by get_regs */ -#elif defined(X86_64) || defined(X32) - /* already done by get_regs */ -#elif defined(IA64) -# define IA64_PSR_IS ((long)1 << 34) - long psr; - if (upeek(tcp->pid, PT_CR_IPSR, &psr) >= 0) - ia64_ia32mode = ((psr & IA64_PSR_IS) != 0); - if (upeek(tcp->pid, PT_R8, &ia64_r8) < 0) - return -1; - if (upeek(tcp->pid, PT_R10, &ia64_r10) < 0) - return -1; -#elif defined(ARM) - /* already done by get_regs */ -#elif defined(AARCH64) - /* register reading already done by get_regs */ - - /* Used to do this, but we did it on syscall entry already: */ - /* We are in 64-bit mode (personality 1) if register struct is aarch64_regs, - * else it's personality 0. - */ - /*update_personality(tcp, aarch64_io.iov_len == sizeof(aarch64_regs));*/ -#elif defined(M68K) - if (upeek(tcp->pid, 4*PT_D0, &m68k_d0) < 0) - return -1; -#elif defined(LINUX_MIPSN32) - unsigned long long regs[38]; - - if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long) ®s) < 0) - return -1; - mips_a3 = regs[REG_A3]; - mips_r2 = regs[REG_V0]; -#elif defined(MIPS) - if (upeek(tcp->pid, REG_A3, &mips_a3) < 0) - return -1; - if (upeek(tcp->pid, REG_V0, &mips_r2) < 0) - return -1; -#elif defined(ALPHA) - if (upeek(tcp->pid, REG_A3, &alpha_a3) < 0) - return -1; - if (upeek(tcp->pid, REG_R0, &alpha_r0) < 0) - return -1; -#elif defined(SPARC) || defined(SPARC64) - /* already done by get_regs */ -#elif defined(HPPA) - if (upeek(tcp->pid, PT_GR28, &hppa_r28) < 0) - return -1; -#elif defined(SH) - /* new syscall ABI returns result in R0 */ - if (upeek(tcp->pid, 4*REG_REG0, (long *)&sh_r0) < 0) - return -1; -#elif defined(SH64) - /* ABI defines result returned in r9 */ - if (upeek(tcp->pid, REG_GENERAL(9), (long *)&sh64_r9) < 0) - return -1; -#elif defined(CRISV10) || defined(CRISV32) - if (upeek(tcp->pid, 4*PT_R10, &cris_r10) < 0) - return -1; -#elif defined(TILE) - /* already done by get_regs */ -#elif defined(MICROBLAZE) - if (upeek(tcp->pid, 3 * 4, µblaze_r3) < 0) - return -1; -#elif defined(OR1K) - /* already done by get_regs */ -#elif defined(METAG) - /* already done by get_regs */ -#elif defined(XTENSA) - if (upeek(tcp->pid, REG_A_BASE + 2, &xtensa_a2) < 0) - return -1; -#elif defined(ARC) - /* already done by get_regs */ -#endif - return 1; -} - -/* Called at each syscall exit */ -static void -syscall_fixup_on_sysexit(struct tcb *tcp) -{ -#if defined(S390) || defined(S390X) - if ((tcp->flags & TCB_WAITEXECVE) - && (s390_gpr2 == -ENOSYS || s390_gpr2 == tcp->scno)) { - /* - * Return from execve. - * Fake a return value of zero. We leave the TCB_WAITEXECVE - * flag set for the post-execve SIGTRAP to see and reset. - */ - s390_gpr2 = 0; - } -#endif -} - -/* - * Check the syscall return value register value for whether it is - * a negated errno code indicating an error, or a success return value. - */ -static inline int -is_negated_errno(unsigned long int val) -{ - unsigned long int max = -(long int) nerrnos; -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize < sizeof(val)) { - val = (unsigned int) val; - max = (unsigned int) max; - } -#endif - return val > max; -} -#if defined(X32) -static inline int -is_negated_errno_x32(unsigned long long val) -{ - unsigned long long max = -(long long) nerrnos; - /* - * current_wordsize is 4 even in personality 0 (native X32) - * but truncation _must not_ be done in it. - * can't check current_wordsize here! - */ - if (current_personality != 0) { - val = (uint32_t) val; - max = (uint32_t) max; - } - return val > max; -} -#endif + if (opts->rval >= 0) { + kernel_long_t u_rval = tcp->u_rval; -/* Returns: - * 1: ok, continue in trace_syscall_exiting(). - * -1: error, trace_syscall_exiting() should print error indicator - * ("????" etc) and bail out. - */ -static void -get_error(struct tcb *tcp) -{ - int u_error = 0; - int check_errno = 1; - if (tcp->s_ent->sys_flags & SYSCALL_NEVER_FAILS) { - check_errno = 0; - } -#if defined(S390) || defined(S390X) - if (check_errno && is_negated_errno(s390_gpr2)) { - tcp->u_rval = -1; - u_error = -s390_gpr2; - } - else { - tcp->u_rval = s390_gpr2; - } -#elif defined(I386) - if (check_errno && is_negated_errno(i386_regs.eax)) { - tcp->u_rval = -1; - u_error = -i386_regs.eax; - } - else { - tcp->u_rval = i386_regs.eax; - } -#elif defined(X86_64) - long rax; - if (x86_io.iov_len == sizeof(i386_regs)) { - /* Sign extend from 32 bits */ - rax = (int32_t)i386_regs.eax; - } else { - rax = x86_64_regs.rax; - } - if (check_errno && is_negated_errno(rax)) { - tcp->u_rval = -1; - u_error = -rax; - } - else { - tcp->u_rval = rax; - } -#elif defined(X32) - /* In X32, return value is 64-bit (llseek uses one). - * Using merely "long rax" would not work. - */ - long long rax; - if (x86_io.iov_len == sizeof(i386_regs)) { - /* Sign extend from 32 bits */ - rax = (int32_t)i386_regs.eax; - } else { - rax = x86_64_regs.rax; - } - /* Careful: is_negated_errno() works only on longs */ - if (check_errno && is_negated_errno_x32(rax)) { - tcp->u_rval = -1; - u_error = -rax; - } - else { - tcp->u_rval = rax; /* truncating */ - tcp->u_lrval = rax; - } -#elif defined(IA64) - if (ia64_ia32mode) { - int err; - - err = (int)ia64_r8; - if (check_errno && is_negated_errno(err)) { - tcp->u_rval = -1; - u_error = -err; - } - else { - tcp->u_rval = err; - } - } else { - if (check_errno && ia64_r10) { - tcp->u_rval = -1; - u_error = ia64_r8; + tcp->u_rval = opts->rval; + if (arch_set_success(tcp)) { + tcp->u_rval = u_rval; } else { - tcp->u_rval = ia64_r8; + tcp->u_error = 0; } - } -#elif defined(MIPS) - if (check_errno && mips_a3) { - tcp->u_rval = -1; - u_error = mips_r2; } else { - tcp->u_rval = mips_r2; -# if defined(LINUX_MIPSN32) - tcp->u_lrval = mips_r2; -# endif - } -#elif defined(POWERPC) - if (check_errno && (ppc_regs.ccr & 0x10000000)) { - tcp->u_rval = -1; - u_error = ppc_regs.gpr[3]; - } - else { - tcp->u_rval = ppc_regs.gpr[3]; - } -#elif defined(M68K) - if (check_errno && is_negated_errno(m68k_d0)) { - tcp->u_rval = -1; - u_error = -m68k_d0; - } - else { - tcp->u_rval = m68k_d0; - } -#elif defined(ARM) || defined(AARCH64) -# if defined(AARCH64) - if (tcp->currpers == 1) { - if (check_errno && is_negated_errno(aarch64_regs.regs[0])) { - tcp->u_rval = -1; - u_error = -aarch64_regs.regs[0]; - } - else { - tcp->u_rval = aarch64_regs.regs[0]; - } - } - else -# endif - { - if (check_errno && is_negated_errno(arm_regs.ARM_r0)) { - tcp->u_rval = -1; - u_error = -arm_regs.ARM_r0; - } - else { - tcp->u_rval = arm_regs.ARM_r0; + unsigned long new_error = -opts->rval; + + if (new_error != tcp->u_error && new_error <= MAX_ERRNO_VALUE) { + unsigned long u_error = tcp->u_error; + + tcp->u_error = new_error; + if (arch_set_error(tcp)) { + tcp->u_error = u_error; + } } } -#elif defined(AVR32) - if (check_errno && avr32_regs.r12 && (unsigned) -avr32_regs.r12 < nerrnos) { - tcp->u_rval = -1; - u_error = -avr32_regs.r12; - } - else { - tcp->u_rval = avr32_regs.r12; - } -#elif defined(BFIN) - if (check_errno && is_negated_errno(bfin_r0)) { - tcp->u_rval = -1; - u_error = -bfin_r0; - } else { - tcp->u_rval = bfin_r0; - } -#elif defined(ALPHA) - if (check_errno && alpha_a3) { - tcp->u_rval = -1; - u_error = alpha_r0; - } - else { - tcp->u_rval = alpha_r0; - } -#elif defined(SPARC) - if (check_errno && sparc_regs.psr & PSR_C) { - tcp->u_rval = -1; - u_error = sparc_regs.u_regs[U_REG_O0]; - } - else { - tcp->u_rval = sparc_regs.u_regs[U_REG_O0]; - } -#elif defined(SPARC64) - if (check_errno && sparc_regs.tstate & 0x1100000000UL) { - tcp->u_rval = -1; - u_error = sparc_regs.u_regs[U_REG_O0]; - } - else { - tcp->u_rval = sparc_regs.u_regs[U_REG_O0]; - } -#elif defined(HPPA) - if (check_errno && is_negated_errno(hppa_r28)) { - tcp->u_rval = -1; - u_error = -hppa_r28; - } - else { - tcp->u_rval = hppa_r28; - } -#elif defined(SH) - if (check_errno && is_negated_errno(sh_r0)) { - tcp->u_rval = -1; - u_error = -sh_r0; - } - else { - tcp->u_rval = sh_r0; - } -#elif defined(SH64) - if (check_errno && is_negated_errno(sh64_r9)) { - tcp->u_rval = -1; - u_error = -sh64_r9; - } - else { - tcp->u_rval = sh64_r9; - } -#elif defined(METAG) - /* result pointer in D0Re0 (D0.0) */ - if (check_errno && is_negated_errno(metag_regs.dx[0][0])) { - tcp->u_rval = -1; - u_error = -metag_regs.dx[0][0]; - } - else { - tcp->u_rval = metag_regs.dx[0][0]; - } -#elif defined(CRISV10) || defined(CRISV32) - if (check_errno && cris_r10 && (unsigned) -cris_r10 < nerrnos) { - tcp->u_rval = -1; - u_error = -cris_r10; - } - else { - tcp->u_rval = cris_r10; - } -#elif defined(TILE) - /* - * The standard tile calling convention returns the value (or negative - * errno) in r0, and zero (or positive errno) in r1. - * Until at least kernel 3.8, however, the r1 value is not reflected - * in ptregs at this point, so we use r0 here. - */ - if (check_errno && is_negated_errno(tile_regs.regs[0])) { - tcp->u_rval = -1; - u_error = -tile_regs.regs[0]; - } else { - tcp->u_rval = tile_regs.regs[0]; - } -#elif defined(MICROBLAZE) - if (check_errno && is_negated_errno(microblaze_r3)) { - tcp->u_rval = -1; - u_error = -microblaze_r3; + + return 0; +} + +static int +trace_syscall_entering(struct tcb *tcp, unsigned int *sig) +{ + int res, scno_good; + + scno_good = res = get_scno(tcp); + if (res == 0) + return res; + if (res == 1) + res = get_syscall_args(tcp); + + if (res != 1) { + printleader(tcp); + tprintf("%s(", scno_good == 1 ? tcp->s_ent->sys_name : "????"); + /* + * " " will be added later by the code which + * detects ptrace errors. + */ + goto ret; } - else { - tcp->u_rval = microblaze_r3; + +#ifdef LINUX_MIPSO32 + if (SEN_syscall == tcp->s_ent->sen) + decode_mips_subcall(tcp); +#endif + +#if defined(SYS_socket_subcall) || defined(SYS_ipc_subcall) + switch (tcp->s_ent->sen) { +# ifdef SYS_socket_subcall + case SEN_socketcall: + decode_socket_subcall(tcp); + break; +# endif +# ifdef SYS_ipc_subcall + case SEN_ipc: + decode_ipc_subcall(tcp); + break; +# endif } -#elif defined(OR1K) - if (check_errno && is_negated_errno(or1k_regs.gpr[11])) { - tcp->u_rval = -1; - u_error = -or1k_regs.gpr[11]; +#endif + + /* Restrain from fault injection while the trace executes strace code. */ + if (hide_log(tcp)) { + tcp->qual_flg &= ~QUAL_INJECT; } - else { - tcp->u_rval = or1k_regs.gpr[11]; + + switch (tcp->s_ent->sen) { + case SEN_execve: + case SEN_execveat: +#if defined SPARC || defined SPARC64 + case SEN_execv: +#endif + tcp->flags &= ~TCB_HIDE_LOG; + break; } -#elif defined(XTENSA) - if (check_errno && is_negated_errno(xtensa_a2)) { - tcp->u_rval = -1; - u_error = -xtensa_a2; + + if (!(tcp->qual_flg & QUAL_TRACE) + || (tracing_paths && !pathtrace_match(tcp)) + ) { + tcp->flags |= TCB_INSYSCALL | TCB_FILTERED; + tcp->sys_func_rval = 0; + return 0; } - else { - tcp->u_rval = xtensa_a2; + + tcp->flags &= ~TCB_FILTERED; + + if (hide_log(tcp)) { + res = 0; + goto ret; } -#elif defined(ARC) - if (check_errno && is_negated_errno(arc_regs.scratch.r0)) { - tcp->u_rval = -1; - u_error = -arc_regs.scratch.r0; + + if (tcp->qual_flg & QUAL_INJECT) + tamper_with_syscall_entering(tcp, sig); + + if (cflag == CFLAG_ONLY_STATS) { + res = 0; + goto ret; } - else { - tcp->u_rval = arc_regs.scratch.r0; + +#ifdef USE_LIBUNWIND + if (stack_trace_enabled) { + if (tcp->s_ent->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) + unwind_capture_stacktrace(tcp); } #endif - tcp->u_error = u_error; + + printleader(tcp); + tprintf("%s(", tcp->s_ent->sys_name); + if (tcp->qual_flg & QUAL_RAW) + res = printargs(tcp); + else + res = tcp->s_ent->sys_func(tcp); + + fflush(tcp->outf); + ret: + tcp->flags |= TCB_INSYSCALL; + tcp->sys_func_rval = res; + /* Measure the entrance time as late as possible to avoid errors. */ + if (Tflag || cflag) + gettimeofday(&tcp->etime, NULL); + return res; } -static void -dumpio(struct tcb *tcp) +static bool +syscall_tampered(struct tcb *tcp) { - int (*func)(); - - if (syserror(tcp)) - return; - if ((unsigned long) tcp->u_arg[0] >= num_quals) - return; - func = tcp->s_ent->sys_func; - if (func == printargs) - return; - if (qual_flags[tcp->u_arg[0]] & QUAL_READ) { - if (func == sys_read || - func == sys_pread || - func == sys_recv || - func == sys_recvfrom) - dumpstr(tcp, tcp->u_arg[1], tcp->u_rval); - else if (func == sys_readv) - dumpiov(tcp, tcp->u_arg[2], tcp->u_arg[1]); - return; - } - if (qual_flags[tcp->u_arg[0]] & QUAL_WRITE) { - if (func == sys_write || - func == sys_pwrite || - func == sys_send || - func == sys_sendto) - dumpstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - else if (func == sys_writev) - dumpiov(tcp, tcp->u_arg[2], tcp->u_arg[1]); - return; - } + return tcp->flags & TCB_TAMPERED; } static int @@ -2514,7 +750,8 @@ trace_syscall_exiting(struct tcb *tcp) int sys_res; struct timeval tv; int res; - long u_error; + unsigned long u_error; + const char *u_error_str; /* Measure the exit time as early as possible to avoid errors. */ if (Tflag || cflag) @@ -2531,14 +768,11 @@ trace_syscall_exiting(struct tcb *tcp) update_personality(tcp, tcp->currpers); #endif res = (get_regs_error ? -1 : get_syscall_result(tcp)); - if (res == 1) { - syscall_fixup_on_sysexit(tcp); /* never fails */ - get_error(tcp); /* never fails */ - if (need_fork_exec_workarounds) - syscall_fixup_for_fork_exec(tcp); - if (filtered(tcp) || hide_log_until_execve) - goto ret; - } + if (filtered(tcp) || hide_log(tcp)) + goto ret; + + if (syserror(tcp) && syscall_tampered(tcp)) + tamper_with_syscall_exiting(tcp); if (cflag) { count_syscall(tcp, &tv); @@ -2559,22 +793,23 @@ trace_syscall_exiting(struct tcb *tcp) if ((followfork < 2 && printing_tcp != tcp) || (tcp->flags & TCB_REPRINT)) { tcp->flags &= ~TCB_REPRINT; printleader(tcp); - if (tcp->qual_flg & UNDEFINED_SCNO) - tprintf("<... %s resumed> ", undefined_scno_name(tcp)); - else - tprintf("<... %s resumed> ", tcp->s_ent->sys_name); + tprintf("<... %s resumed> ", tcp->s_ent->sys_name); } printing_tcp = tcp; + tcp->s_prev_ent = NULL; if (res != 1) { /* There was error in one of prior ptrace ops */ tprints(") "); tabto(); tprints("= ? \n"); line_ended(); - tcp->flags &= ~TCB_INSYSCALL; + tcp->flags &= ~(TCB_INSYSCALL | TCB_TAMPERED); + tcp->sys_func_rval = 0; + free_tcb_priv_data(tcp); return res; } + tcp->s_prev_ent = tcp->s_ent; sys_res = 0; if (tcp->qual_flg & QUAL_RAW) { @@ -2590,17 +825,24 @@ trace_syscall_exiting(struct tcb *tcp) */ if (not_failing_only && tcp->u_error) goto ret; /* ignore failed syscalls */ - sys_res = tcp->s_ent->sys_func(tcp); + if (tcp->sys_func_rval & RVAL_DECODED) + sys_res = tcp->sys_func_rval; + else + sys_res = tcp->s_ent->sys_func(tcp); } tprints(") "); tabto(); u_error = tcp->u_error; + if (tcp->qual_flg & QUAL_RAW) { - if (u_error) - tprintf("= -1 (errno %ld)", u_error); - else - tprintf("= %#lx", tcp->u_rval); + if (u_error) { + tprintf("= -1 (errno %lu)", u_error); + } else { + tprintf("= %#" PRI_klx, tcp->u_rval); + } + if (syscall_tampered(tcp)) + tprints(" (INJECTED)"); } else if (!(sys_res & RVAL_NONE) && u_error) { switch (u_error) { @@ -2658,16 +900,17 @@ trace_syscall_exiting(struct tcb *tcp) tprints("= ? ERESTART_RESTARTBLOCK (Interrupted by signal)"); break; default: - if (u_error < 0) - tprintf("= -1 E??? (errno %ld)", u_error); - else if (u_error < nerrnos) - tprintf("= -1 %s (%s)", errnoent[u_error], - strerror(u_error)); + u_error_str = err_name(u_error); + if (u_error_str) + tprintf("= -1 %s (%s)", + u_error_str, strerror(u_error)); else - tprintf("= -1 ERRNO_%ld (%s)", u_error, - strerror(u_error)); + tprintf("= -1 %lu (%s)", + u_error, strerror(u_error)); break; } + if (syscall_tampered(tcp)) + tprintf(" (INJECTED)"); if ((sys_res & RVAL_STR) && tcp->auxstr) tprintf(" (%s)", tcp->auxstr); } @@ -2677,16 +920,33 @@ trace_syscall_exiting(struct tcb *tcp) else { switch (sys_res & RVAL_MASK) { case RVAL_HEX: - tprintf("= %#lx", tcp->u_rval); +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + if (current_wordsize < sizeof(tcp->u_rval)) { + tprintf("= %#x", + (unsigned int) tcp->u_rval); + } else +#endif + { + tprintf("= %#" PRI_klx, tcp->u_rval); + } break; case RVAL_OCTAL: - tprintf("= %#lo", tcp->u_rval); + tprints("= "); + print_numeric_long_umask(tcp->u_rval); break; case RVAL_UDECIMAL: - tprintf("= %lu", tcp->u_rval); +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + if (current_wordsize < sizeof(tcp->u_rval)) { + tprintf("= %u", + (unsigned int) tcp->u_rval); + } else +#endif + { + tprintf("= %" PRI_klu, tcp->u_rval); + } break; case RVAL_DECIMAL: - tprintf("= %ld", tcp->u_rval); + tprintf("= %" PRI_kld, tcp->u_rval); break; case RVAL_FD: if (show_fd_path) { @@ -2694,34 +954,17 @@ trace_syscall_exiting(struct tcb *tcp) printfd(tcp, tcp->u_rval); } else - tprintf("= %ld", tcp->u_rval); - break; -#if defined(LINUX_MIPSN32) || defined(X32) - /* - case RVAL_LHEX: - tprintf("= %#llx", tcp->u_lrval); + tprintf("= %" PRI_kld, tcp->u_rval); break; - case RVAL_LOCTAL: - tprintf("= %#llo", tcp->u_lrval); - break; - */ - case RVAL_LUDECIMAL: - tprintf("= %llu", tcp->u_lrval); - break; - /* - case RVAL_LDECIMAL: - tprintf("= %lld", tcp->u_lrval); - break; - */ -#endif default: - fprintf(stderr, - "invalid rval format\n"); + error_msg("invalid rval format"); break; } } if ((sys_res & RVAL_STR) && tcp->auxstr) tprintf(" (%s)", tcp->auxstr); + if (syscall_tampered(tcp)) + tprints(" (INJECTED)"); } if (Tflag) { tv_sub(&tv, &tv, &tcp->etime); @@ -2738,13 +981,315 @@ trace_syscall_exiting(struct tcb *tcp) #endif ret: - tcp->flags &= ~TCB_INSYSCALL; + tcp->flags &= ~(TCB_INSYSCALL | TCB_TAMPERED); + tcp->sys_func_rval = 0; + free_tcb_priv_data(tcp); return 0; } int -trace_syscall(struct tcb *tcp) +trace_syscall(struct tcb *tcp, unsigned int *signo) { return exiting(tcp) ? - trace_syscall_exiting(tcp) : trace_syscall_entering(tcp); + trace_syscall_exiting(tcp) : trace_syscall_entering(tcp, signo); +} + +bool +is_erestart(struct tcb *tcp) +{ + switch (tcp->u_error) { + case ERESTARTSYS: + case ERESTARTNOINTR: + case ERESTARTNOHAND: + case ERESTART_RESTARTBLOCK: + return true; + default: + return false; + } +} + +static unsigned long saved_u_error; + +void +temporarily_clear_syserror(struct tcb *tcp) +{ + saved_u_error = tcp->u_error; + tcp->u_error = 0; +} + +void +restore_cleared_syserror(struct tcb *tcp) +{ + tcp->u_error = saved_u_error; +} + +/* + * Check the syscall return value register value for whether it is + * a negated errno code indicating an error, or a success return value. + */ +static inline bool +is_negated_errno(kernel_ulong_t val) +{ + /* Linux kernel defines MAX_ERRNO to 4095. */ + kernel_ulong_t max = -(kernel_long_t) 4095; + +#ifndef current_klongsize + if (current_klongsize < sizeof(val)) { + val = (uint32_t) val; + max = (uint32_t) max; + } +#endif /* !current_klongsize */ + + return val >= max; +} + +#include "arch_regs.c" + +#ifdef HAVE_GETRVAL2 +# include "arch_getrval2.c" +#endif + +void +print_pc(struct tcb *tcp) +{ +#if defined ARCH_PC_REG +# define ARCH_GET_PC 0 +#elif defined ARCH_PC_PEEK_ADDR + kernel_ulong_t pc; +# define ARCH_PC_REG pc +# define ARCH_GET_PC upeek(tcp->pid, ARCH_PC_PEEK_ADDR, &pc) +#else +# error Neither ARCH_PC_REG nor ARCH_PC_PEEK_ADDR is defined +#endif + if (get_regs_error || ARCH_GET_PC) + tprints(current_wordsize == 4 ? "[????????] " + : "[????????????????] "); + else + tprintf(current_wordsize == 4 + ? "[%08" PRI_klx "] " : "[%016" PRI_klx "] ", + (kernel_ulong_t) ARCH_PC_REG); +} + +#include "getregs_old.h" + +#undef ptrace_getregset_or_getregs +#undef ptrace_setregset_or_setregs +#ifdef ARCH_REGS_FOR_GETREGSET + +# define ptrace_getregset_or_getregs ptrace_getregset +static long +ptrace_getregset(pid_t pid) +{ +# ifdef ARCH_IOVEC_FOR_GETREGSET + /* variable iovec */ + ARCH_IOVEC_FOR_GETREGSET.iov_len = sizeof(ARCH_REGS_FOR_GETREGSET); + return ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, + &ARCH_IOVEC_FOR_GETREGSET); +# else + /* constant iovec */ + static struct iovec io = { + .iov_base = &ARCH_REGS_FOR_GETREGSET, + .iov_len = sizeof(ARCH_REGS_FOR_GETREGSET) + }; + return ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &io); + +# endif +} + +# ifndef HAVE_GETREGS_OLD +# define ptrace_setregset_or_setregs ptrace_setregset +static int +ptrace_setregset(pid_t pid) +{ +# ifdef ARCH_IOVEC_FOR_GETREGSET + /* variable iovec */ + return ptrace(PTRACE_SETREGSET, pid, NT_PRSTATUS, + &ARCH_IOVEC_FOR_GETREGSET); +# else + /* constant iovec */ + static struct iovec io = { + .iov_base = &ARCH_REGS_FOR_GETREGSET, + .iov_len = sizeof(ARCH_REGS_FOR_GETREGSET) + }; + return ptrace(PTRACE_SETREGSET, pid, NT_PRSTATUS, &io); +# endif +} +# endif /* !HAVE_GETREGS_OLD */ + +#elif defined ARCH_REGS_FOR_GETREGS + +# define ptrace_getregset_or_getregs ptrace_getregs +static long +ptrace_getregs(pid_t pid) +{ +# if defined SPARC || defined SPARC64 + /* SPARC systems have the meaning of data and addr reversed */ + return ptrace(PTRACE_GETREGS, pid, (void *) &ARCH_REGS_FOR_GETREGS, 0); +# else + return ptrace(PTRACE_GETREGS, pid, NULL, &ARCH_REGS_FOR_GETREGS); +# endif +} + +# ifndef HAVE_GETREGS_OLD +# define ptrace_setregset_or_setregs ptrace_setregs +static int +ptrace_setregs(pid_t pid) +{ +# if defined SPARC || defined SPARC64 + /* SPARC systems have the meaning of data and addr reversed */ + return ptrace(PTRACE_SETREGS, pid, (void *) &ARCH_REGS_FOR_GETREGS, 0); +# else + return ptrace(PTRACE_SETREGS, pid, NULL, &ARCH_REGS_FOR_GETREGS); +# endif +} +# endif /* !HAVE_GETREGS_OLD */ + +#endif /* ARCH_REGS_FOR_GETREGSET || ARCH_REGS_FOR_GETREGS */ + +void +get_regs(pid_t pid) +{ +#undef USE_GET_SYSCALL_RESULT_REGS +#ifdef ptrace_getregset_or_getregs + +# ifdef HAVE_GETREGS_OLD + /* + * Try PTRACE_GETREGSET/PTRACE_GETREGS first, + * fallback to getregs_old. + */ + static int use_getregs_old; + if (use_getregs_old < 0) { + get_regs_error = ptrace_getregset_or_getregs(pid); + return; + } else if (use_getregs_old == 0) { + get_regs_error = ptrace_getregset_or_getregs(pid); + if (get_regs_error >= 0) { + use_getregs_old = -1; + return; + } + if (errno == EPERM || errno == ESRCH) + return; + use_getregs_old = 1; + } + get_regs_error = getregs_old(pid); +# else /* !HAVE_GETREGS_OLD */ + /* Assume that PTRACE_GETREGSET/PTRACE_GETREGS works. */ + get_regs_error = ptrace_getregset_or_getregs(pid); +# endif /* !HAVE_GETREGS_OLD */ + +#else /* !ptrace_getregset_or_getregs */ + +# define USE_GET_SYSCALL_RESULT_REGS 1 +# warning get_regs is not implemented for this architecture yet + get_regs_error = 0; + +#endif /* !ptrace_getregset_or_getregs */ +} + +#ifdef ptrace_setregset_or_setregs +static int +set_regs(pid_t pid) +{ + return ptrace_setregset_or_setregs(pid); +} +#endif /* ptrace_setregset_or_setregs */ + +struct sysent_buf { + struct tcb *tcp; + struct_sysent ent; + char buf[sizeof("syscall_%lu") + sizeof(kernel_ulong_t) * 3]; +}; + +static void +free_sysent_buf(void *ptr) +{ + struct sysent_buf *s = ptr; + s->tcp->s_prev_ent = s->tcp->s_ent = NULL; + free(ptr); +} + +/* + * Returns: + * 0: "ignore this ptrace stop", bail out of trace_syscall_entering() silently. + * 1: ok, continue in trace_syscall_entering(). + * other: error, trace_syscall_entering() should print error indicator + * ("????" etc) and bail out. + */ +int +get_scno(struct tcb *tcp) +{ + if (get_regs_error) + return -1; + + int rc = arch_get_scno(tcp); + if (rc != 1) + return rc; + + if (scno_is_valid(tcp->scno)) { + tcp->s_ent = &sysent[tcp->scno]; + tcp->qual_flg = qual_flags(tcp->scno); + } else { + struct sysent_buf *s = xcalloc(1, sizeof(*s)); + + s->tcp = tcp; + s->ent.nargs = MAX_ARGS; + s->ent.sen = SEN_printargs; + s->ent.sys_func = printargs; + s->ent.sys_name = s->buf; + sprintf(s->buf, "syscall_%" PRI_klu, shuffle_scno(tcp->scno)); + + tcp->s_ent = &s->ent; + tcp->qual_flg = QUAL_RAW | DEFAULT_QUAL_FLAGS; + + set_tcb_priv_data(tcp, s, free_sysent_buf); + + if (debug_flag) + error_msg("pid %d invalid syscall %" PRI_kld, + tcp->pid, tcp->scno); + } + return 1; +} + +#ifdef USE_GET_SYSCALL_RESULT_REGS +static int get_syscall_result_regs(struct tcb *); +#endif + +/* Returns: + * 1: ok, continue in trace_syscall_exiting(). + * -1: error, trace_syscall_exiting() should print error indicator + * ("????" etc) and bail out. + */ +static int +get_syscall_result(struct tcb *tcp) +{ +#ifdef USE_GET_SYSCALL_RESULT_REGS + if (get_syscall_result_regs(tcp)) + return -1; +#endif + tcp->u_error = 0; + get_error(tcp, !(tcp->s_ent->sys_flags & SYSCALL_NEVER_FAILS)); + + return 1; +} + +#include "get_scno.c" +#include "set_scno.c" +#include "get_syscall_args.c" +#ifdef USE_GET_SYSCALL_RESULT_REGS +# include "get_syscall_result.c" +#endif +#include "get_error.c" +#include "set_error.c" +#ifdef HAVE_GETREGS_OLD +# include "getregs_old.c" +#endif + +const char * +syscall_name(kernel_ulong_t scno) +{ +#if defined X32_PERSONALITY_NUMBER && defined __X32_SYSCALL_BIT + if (current_personality == X32_PERSONALITY_NUMBER) + scno &= ~__X32_SYSCALL_BIT; +#endif + return scno_is_valid(scno) ? sysent[scno].sys_name: NULL; } diff --git a/sysctl.c b/sysctl.c new file mode 100644 index 00000000..38436931 --- /dev/null +++ b/sysctl.c @@ -0,0 +1,192 @@ +/* + * Copyright (c) 1999 Ulrich Drepper + * Copyright (c) 2005 Roland McGrath + * Copyright (c) 2005-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +#include "xlat/sysctl_root.h" +#include "xlat/sysctl_kern.h" +#include "xlat/sysctl_vm.h" +#include "xlat/sysctl_net.h" +#include "xlat/sysctl_net_core.h" +#include "xlat/sysctl_net_unix.h" +#include "xlat/sysctl_net_ipv4.h" +#include "xlat/sysctl_net_ipv4_route.h" +#include "xlat/sysctl_net_ipv4_conf.h" +#include "xlat/sysctl_net_ipv6.h" +#include "xlat/sysctl_net_ipv6_route.h" + +SYS_FUNC(sysctl) +{ + struct __sysctl_args info; + int *name; + unsigned long size; + + if (umove_or_printaddr(tcp, tcp->u_arg[0], &info)) + return RVAL_DECODED; + + size = sizeof(int) * (unsigned long) info.nlen; + name = (size / sizeof(int) != (unsigned long) info.nlen) ? NULL : malloc(size); + if (name == NULL || + umoven(tcp, (unsigned long) info.name, size, name) < 0) { + free(name); + if (entering(tcp)) + tprintf("{%p, %d, %p, %p, %p, %lu}", + info.name, info.nlen, info.oldval, + info.oldlenp, info.newval, (unsigned long)info.newlen); + return RVAL_DECODED; + } + + if (entering(tcp)) { + unsigned int cnt = 0, max_cnt; + + tprints("{{"); + + if (info.nlen == 0) + goto out; + printxval(sysctl_root, name[0], "CTL_???"); + ++cnt; + + if (info.nlen == 1) + goto out; + switch (name[0]) { + case CTL_KERN: + tprints(", "); + printxval(sysctl_kern, name[1], "KERN_???"); + ++cnt; + break; + case CTL_VM: + tprints(", "); + printxval(sysctl_vm, name[1], "VM_???"); + ++cnt; + break; + case CTL_NET: + tprints(", "); + printxval(sysctl_net, name[1], "NET_???"); + ++cnt; + + if (info.nlen == 2) + goto out; + switch (name[1]) { + case NET_CORE: + tprints(", "); + printxval(sysctl_net_core, name[2], + "NET_CORE_???"); + break; + case NET_UNIX: + tprints(", "); + printxval(sysctl_net_unix, name[2], + "NET_UNIX_???"); + break; + case NET_IPV4: + tprints(", "); + printxval(sysctl_net_ipv4, name[2], + "NET_IPV4_???"); + + if (info.nlen == 3) + goto out; + switch (name[2]) { + case NET_IPV4_ROUTE: + tprints(", "); + printxval(sysctl_net_ipv4_route, + name[3], + "NET_IPV4_ROUTE_???"); + break; + case NET_IPV4_CONF: + tprints(", "); + printxval(sysctl_net_ipv4_conf, + name[3], + "NET_IPV4_CONF_???"); + break; + default: + goto out; + } + break; + case NET_IPV6: + tprints(", "); + printxval(sysctl_net_ipv6, name[2], + "NET_IPV6_???"); + + if (info.nlen == 3) + goto out; + switch (name[2]) { + case NET_IPV6_ROUTE: + tprints(", "); + printxval(sysctl_net_ipv6_route, + name[3], + "NET_IPV6_ROUTE_???"); + break; + default: + goto out; + } + break; + default: + goto out; + } + break; + default: + goto out; + } + out: + max_cnt = info.nlen; + if (abbrev(tcp) && max_cnt > max_strlen) + max_cnt = max_strlen; + while (cnt < max_cnt) + tprintf(", %x", name[cnt++]); + if (cnt < (unsigned) info.nlen) + tprints(", ..."); + tprintf("}, %d, ", info.nlen); + } else { + size_t oldlen = 0; + if (info.oldval == NULL) { + tprints("NULL"); + } else if (umove(tcp, ptr_to_kulong(info.oldlenp), &oldlen) >= 0 + && info.nlen >= 2 + && ((name[0] == CTL_KERN + && (name[1] == KERN_OSRELEASE + || name[1] == KERN_OSTYPE + )))) { + printpath(tcp, ptr_to_kulong(info.oldval)); + } else { + tprintf("%p", info.oldval); + } + tprintf(", %lu, ", (unsigned long)oldlen); + if (info.newval == NULL) + tprints("NULL"); + else if (syserror(tcp)) + tprintf("%p", info.newval); + else + printpath(tcp, ptr_to_kulong(info.newval)); + tprintf(", %lu", (unsigned long)info.newlen); + } + + free(name); + return 0; +} diff --git a/sysent.h b/sysent.h new file mode 100644 index 00000000..aa93bcb8 --- /dev/null +++ b/sysent.h @@ -0,0 +1,25 @@ +#ifndef STRACE_SYSENT_H +#define STRACE_SYSENT_H + +typedef struct sysent { + unsigned nargs; + int sys_flags; + int sen; + int (*sys_func)(); + const char *sys_name; +} struct_sysent; + +#define TRACE_FILE 001 /* Trace file-related syscalls. */ +#define TRACE_IPC 002 /* Trace IPC-related syscalls. */ +#define TRACE_NETWORK 004 /* Trace network-related syscalls. */ +#define TRACE_PROCESS 010 /* Trace process-related syscalls. */ +#define TRACE_SIGNAL 020 /* Trace signal-related syscalls. */ +#define TRACE_DESC 040 /* Trace file descriptor-related syscalls. */ +#define TRACE_MEMORY 0100 /* Trace memory mapping-related syscalls. */ +#define SYSCALL_NEVER_FAILS 0200 /* Syscall is always successful. */ +#define STACKTRACE_INVALIDATE_CACHE 0400 /* Trigger proc/maps cache updating */ +#define STACKTRACE_CAPTURE_ON_ENTER 01000 /* Capture stacktrace on "entering" stage */ +#define TRACE_INDIRECT_SUBCALL 02000 /* Syscall is an indirect socket/ipc subcall. */ +#define COMPAT_SYSCALL_TYPES 04000 /* A compat syscall that uses compat types. */ + +#endif /* !STRACE_SYSENT_H */ diff --git a/sysinfo.c b/sysinfo.c new file mode 100644 index 00000000..a0f29cbf --- /dev/null +++ b/sysinfo.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2012 H.J. Lu + * Copyright (c) 2012 Denys Vlasenko + * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2015 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include DEF_MPERS_TYPE(sysinfo_t) +#include +typedef struct sysinfo sysinfo_t; +#include MPERS_DEFS + +SYS_FUNC(sysinfo) +{ + sysinfo_t si; + + if (entering(tcp)) + return 0; + + if (!umove_or_printaddr(tcp, tcp->u_arg[0], &si)) { + tprintf("{uptime=%llu" + ", loads=[%llu, %llu, %llu]" + ", totalram=%llu" + ", freeram=%llu" + ", sharedram=%llu" + ", bufferram=%llu" + ", totalswap=%llu" + ", freeswap=%llu" + ", procs=%u" + ", totalhigh=%llu" + ", freehigh=%llu" + ", mem_unit=%u" + "}", + zero_extend_signed_to_ull(si.uptime) + , zero_extend_signed_to_ull(si.loads[0]) + , zero_extend_signed_to_ull(si.loads[1]) + , zero_extend_signed_to_ull(si.loads[2]) + , zero_extend_signed_to_ull(si.totalram) + , zero_extend_signed_to_ull(si.freeram) + , zero_extend_signed_to_ull(si.sharedram) + , zero_extend_signed_to_ull(si.bufferram) + , zero_extend_signed_to_ull(si.totalswap) + , zero_extend_signed_to_ull(si.freeswap) + , (unsigned) si.procs + , zero_extend_signed_to_ull(si.totalhigh) + , zero_extend_signed_to_ull(si.freehigh) + , si.mem_unit + ); + } + + return 0; +} diff --git a/syslog.c b/syslog.c new file mode 100644 index 00000000..99063060 --- /dev/null +++ b/syslog.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2012-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +enum { + SYSLOG_ACTION_CLOSE = 0, + SYSLOG_ACTION_OPEN, + SYSLOG_ACTION_READ, + SYSLOG_ACTION_READ_ALL, + SYSLOG_ACTION_READ_CLEAR, + SYSLOG_ACTION_CLEAR, + SYSLOG_ACTION_CONSOLE_OFF, + SYSLOG_ACTION_CONSOLE_ON, + SYSLOG_ACTION_CONSOLE_LEVEL, + SYSLOG_ACTION_SIZE_UNREAD, + SYSLOG_ACTION_SIZE_BUFFER +}; + +#include "xlat/syslog_action_type.h" + +SYS_FUNC(syslog) +{ + int type = tcp->u_arg[0]; + + if (entering(tcp)) { + /* type */ + printxval(syslog_action_type, type, "SYSLOG_ACTION_???"); + tprints(", "); + } + + switch (type) { + case SYSLOG_ACTION_READ: + case SYSLOG_ACTION_READ_ALL: + case SYSLOG_ACTION_READ_CLEAR: + if (entering(tcp)) + return 0; + break; + default: + printaddr(tcp->u_arg[1]); + tprintf(", %" PRI_klu, tcp->u_arg[2]); + return RVAL_DECODED; + } + + /* bufp */ + if (syserror(tcp)) + printaddr(tcp->u_arg[1]); + else + printstrn(tcp, tcp->u_arg[1], tcp->u_rval); + /* len */ + tprintf(", %d", (int) tcp->u_arg[2]); + + return 0; +} diff --git a/sysmips.c b/sysmips.c new file mode 100644 index 00000000..af5ffba0 --- /dev/null +++ b/sysmips.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2001 Wichert Akkerman + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef MIPS + +#ifdef HAVE_LINUX_UTSNAME_H +# include +#endif +#ifdef HAVE_ASM_SYSMIPS_H +# include +#endif + +#ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +#endif + +#include "xlat/sysmips_operations.h" + +SYS_FUNC(sysmips) +{ + printxval64(sysmips_operations, tcp->u_arg[0], "???"); + tprints(", "); + + switch (tcp->u_arg[0]) { + case SETNAME: { + char nodename[__NEW_UTS_LEN + 1]; + + if (!verbose(tcp)) + break; + if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), + nodename) < 0) { + printaddr(tcp->u_arg[1]); + } else { + print_quoted_string(nodename, __NEW_UTS_LEN + 1, + QUOTE_0_TERMINATED); + } + return RVAL_DECODED; + } + case MIPS_ATOMIC_SET: + printaddr(tcp->u_arg[1]); + tprintf(", %#" PRI_klx, tcp->u_arg[2]); + return RVAL_DECODED; + case MIPS_FIXADE: + tprintf("%#" PRI_klx, tcp->u_arg[1]); + return RVAL_DECODED; + } + + tprintf("%" PRI_kld ", %" PRI_kld ", %" PRI_kld, + tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); + return RVAL_DECODED; +} + +#endif /* MIPS */ diff --git a/system.c b/system.c deleted file mode 100644 index 435e2c18..00000000 --- a/system.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * Copyright (c) 1991, 1992 Paul Kranenburg - * Copyright (c) 1993 Branko Lankester - * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey - * Copyright (c) 1996-1999 Wichert Akkerman - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "defs.h" - -#define _LINUX_SOCKET_H -#define _LINUX_FS_H - -#define MS_RDONLY 1 /* Mount read-only */ -#define MS_NOSUID 2 /* Ignore suid and sgid bits */ -#define MS_NODEV 4 /* Disallow access to device special files */ -#define MS_NOEXEC 8 /* Disallow program execution */ -#define MS_SYNCHRONOUS 16 /* Writes are synced at once */ -#define MS_REMOUNT 32 /* Alter flags of a mounted FS */ -#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ -#define MS_DIRSYNC 128 /* Directory modifications are synchronous */ -#define MS_NOATIME 1024 /* Do not update access times. */ -#define MS_NODIRATIME 2048 /* Do not update directory access times */ -#define MS_BIND 4096 -#define MS_MOVE 8192 -#define MS_REC 16384 -#define MS_SILENT 32768 -#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ -#define MS_UNBINDABLE (1<<17) /* change to unbindable */ -#define MS_PRIVATE (1<<18) /* change to private */ -#define MS_SLAVE (1<<19) /* change to slave */ -#define MS_SHARED (1<<20) /* change to shared */ -#define MS_RELATIME (1<<21) -#define MS_KERNMOUNT (1<<22) -#define MS_I_VERSION (1<<23) -#define MS_STRICTATIME (1<<24) -#define MS_NOSEC (1<<28) -#define MS_BORN (1<<29) -#define MS_ACTIVE (1<<30) -#define MS_NOUSER (1<<31) -#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number */ -#define MS_MGC_MSK 0xffff0000 /* Magic flag mask */ - -#include -#include -#include -#ifdef HAVE_LINUX_CAPABILITY_H -# include -#endif -#ifdef HAVE_ASM_CACHECTL_H -# include -#endif -#ifdef HAVE_LINUX_USTNAME_H -# include -#endif -#ifdef HAVE_ASM_SYSMIPS_H -# include -#endif -#include -#include - -#include "xlat/mount_flags.h" - -int -sys_mount(struct tcb *tcp) -{ - if (entering(tcp)) { - int ignore_type = 0, ignore_data = 0; - unsigned long flags = tcp->u_arg[3]; - - /* Discard magic */ - if ((flags & MS_MGC_MSK) == MS_MGC_VAL) - flags &= ~MS_MGC_MSK; - - if (flags & MS_REMOUNT) - ignore_type = 1; - else if (flags & (MS_BIND | MS_MOVE)) - ignore_type = ignore_data = 1; - - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - - if (ignore_type && tcp->u_arg[2]) - tprintf("%#lx", tcp->u_arg[2]); - else - printstr(tcp, tcp->u_arg[2], -1); - tprints(", "); - - printflags(mount_flags, tcp->u_arg[3], "MS_???"); - tprints(", "); - - if (ignore_data && tcp->u_arg[4]) - tprintf("%#lx", tcp->u_arg[4]); - else - printstr(tcp, tcp->u_arg[4], -1); - } - return 0; -} - -#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ -#define MNT_DETACH 0x00000002 /* Just detach from the tree */ -#define MNT_EXPIRE 0x00000004 /* Mark for expiry */ - -#include "xlat/umount_flags.h" - -int -sys_umount2(struct tcb *tcp) -{ - if (entering(tcp)) { - printstr(tcp, tcp->u_arg[0], -1); - tprints(", "); - printflags(umount_flags, tcp->u_arg[1], "MNT_???"); - } - return 0; -} - -/* These are not macros, but enums. We just copy the values by hand - from Linux 2.6.9 here. */ -#include "xlat/personality_options.h" - -int -sys_personality(struct tcb *tcp) -{ - if (entering(tcp)) - printxval(personality_options, tcp->u_arg[0], "PER_???"); - return 0; -} - -enum { - SYSLOG_ACTION_CLOSE = 0, - SYSLOG_ACTION_OPEN, - SYSLOG_ACTION_READ, - SYSLOG_ACTION_READ_ALL, - SYSLOG_ACTION_READ_CLEAR, - SYSLOG_ACTION_CLEAR, - SYSLOG_ACTION_CONSOLE_OFF, - SYSLOG_ACTION_CONSOLE_ON, - SYSLOG_ACTION_CONSOLE_LEVEL, - SYSLOG_ACTION_SIZE_UNREAD, - SYSLOG_ACTION_SIZE_BUFFER -}; - -#include "xlat/syslog_action_type.h" - -int -sys_syslog(struct tcb *tcp) -{ - int type = tcp->u_arg[0]; - - if (entering(tcp)) { - /* type */ - printxval(syslog_action_type, type, "SYSLOG_ACTION_???"); - tprints(", "); - } - - switch (type) { - case SYSLOG_ACTION_READ: - case SYSLOG_ACTION_READ_ALL: - case SYSLOG_ACTION_READ_CLEAR: - if (entering(tcp)) - return 0; - break; - default: - if (entering(tcp)) { - tprintf("%#lx, %lu", - tcp->u_arg[1], tcp->u_arg[2]); - } - return 0; - } - - /* bufp */ - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printstr(tcp, tcp->u_arg[1], tcp->u_rval); - /* len */ - tprintf(", %d", (int) tcp->u_arg[2]); - - return 0; -} - -#ifdef M68K -#include "xlat/cacheflush_scope.h" - -static const struct xlat cacheflush_flags[] = { -#ifdef FLUSH_CACHE_BOTH - XLAT(FLUSH_CACHE_BOTH), -#endif -#ifdef FLUSH_CACHE_DATA - XLAT(FLUSH_CACHE_DATA), -#endif -#ifdef FLUSH_CACHE_INSN - XLAT(FLUSH_CACHE_INSN), -#endif - XLAT_END -}; - -int -sys_cacheflush(struct tcb *tcp) -{ - if (entering(tcp)) { - /* addr */ - tprintf("%#lx, ", tcp->u_arg[0]); - /* scope */ - printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???"); - tprints(", "); - /* flags */ - printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???"); - /* len */ - tprintf(", %lu", tcp->u_arg[3]); - } - return 0; -} -#endif /* M68K */ - -#ifdef BFIN - -#include - -#include "xlat/sram_alloc_flags.h" - -int -sys_sram_alloc(struct tcb *tcp) -{ - if (entering(tcp)) { - /* size */ - tprintf("%lu, ", tcp->u_arg[0]); - /* flags */ - printflags(sram_alloc_flags, tcp->u_arg[1], "???_SRAM"); - } - return 1; -} - -#include - -static const struct xlat cacheflush_flags[] = { - XLAT(ICACHE), - XLAT(DCACHE), - XLAT(BCACHE), - XLAT_END -}; - -int -sys_cacheflush(struct tcb *tcp) -{ - if (entering(tcp)) { - /* start addr */ - tprintf("%#lx, ", tcp->u_arg[0]); - /* length */ - tprintf("%ld, ", tcp->u_arg[1]); - /* flags */ - printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE"); - } - return 0; -} - -#endif - -#ifdef SH -static const struct xlat cacheflush_flags[] = { -#ifdef CACHEFLUSH_D_INVAL - XLAT(CACHEFLUSH_D_INVAL), -#endif -#ifdef CACHEFLUSH_D_WB - XLAT(CACHEFLUSH_D_WB), -#endif -#ifdef CACHEFLUSH_D_PURGE - XLAT(CACHEFLUSH_D_PURGE), -#endif -#ifdef CACHEFLUSH_I - XLAT(CACHEFLUSH_I), -#endif - XLAT_END -}; - -int -sys_cacheflush(struct tcb *tcp) -{ - if (entering(tcp)) { - /* addr */ - tprintf("%#lx, ", tcp->u_arg[0]); - /* len */ - tprintf("%lu, ", tcp->u_arg[1]); - /* flags */ - printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???"); - } - return 0; -} -#endif /* SH */ - -#ifdef SYS_capget - -#include "xlat/capabilities.h" - -#ifndef _LINUX_CAPABILITY_VERSION_1 -# define _LINUX_CAPABILITY_VERSION_1 0x19980330 -#endif -#ifndef _LINUX_CAPABILITY_VERSION_2 -# define _LINUX_CAPABILITY_VERSION_2 0x20071026 -#endif -#ifndef _LINUX_CAPABILITY_VERSION_3 -# define _LINUX_CAPABILITY_VERSION_3 0x20080522 -#endif - -#include "xlat/cap_version.h" - -static void -print_cap_header(struct tcb *tcp, unsigned long addr) -{ - union { cap_user_header_t p; long *a; char *c; } arg; - long a[sizeof(*arg.p) / sizeof(long) + 1]; - arg.a = a; - - if (!addr) - tprints("NULL"); - else if (!verbose(tcp) || - umoven(tcp, addr, sizeof(*arg.p), arg.c) < 0) - tprintf("%#lx", addr); - else { - tprints("{"); - printxval(cap_version, arg.p->version, - "_LINUX_CAPABILITY_VERSION_???"); - tprintf(", %d}", arg.p->pid); - } -} - -static void -print_cap_data(struct tcb *tcp, unsigned long addr) -{ - union { cap_user_data_t p; long *a; char *c; } arg; - long a[sizeof(*arg.p) / sizeof(long) + 1]; - arg.a = a; - - if (!addr) - tprints("NULL"); - else if (!verbose(tcp) || - (exiting(tcp) && syserror(tcp)) || - umoven(tcp, addr, sizeof(*arg.p), arg.c) < 0) - tprintf("%#lx", addr); - else { - tprints("{"); - printflags(capabilities, arg.p->effective, "CAP_???"); - tprints(", "); - printflags(capabilities, arg.p->permitted, "CAP_???"); - tprints(", "); - printflags(capabilities, arg.p->inheritable, "CAP_???"); - tprints("}"); - } -} - -int -sys_capget(struct tcb *tcp) -{ - if (entering(tcp)) { - print_cap_header(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - print_cap_data(tcp, tcp->u_arg[1]); - } - return 0; -} - -int -sys_capset(struct tcb *tcp) -{ - if (entering(tcp)) { - print_cap_header(tcp, tcp->u_arg[0]); - tprints(", "); - print_cap_data(tcp, tcp->u_arg[1]); - } - return 0; -} - -#else - -int sys_capget(struct tcb *tcp) -{ - return printargs(tcp); -} - -int sys_capset(struct tcb *tcp) -{ - return printargs(tcp); -} - -#endif - -#include "xlat/sysctl_root.h" -#include "xlat/sysctl_kern.h" -#include "xlat/sysctl_vm.h" -#include "xlat/sysctl_net.h" -#include "xlat/sysctl_net_core.h" -#include "xlat/sysctl_net_unix.h" -#include "xlat/sysctl_net_ipv4.h" -#include "xlat/sysctl_net_ipv4_route.h" -#include "xlat/sysctl_net_ipv4_conf.h" -#include "xlat/sysctl_net_ipv6.h" -#include "xlat/sysctl_net_ipv6_route.h" - -int -sys_sysctl(struct tcb *tcp) -{ - struct __sysctl_args info; - int *name; - unsigned long size; - - if (umove(tcp, tcp->u_arg[0], &info) < 0) - return printargs(tcp); - - size = sizeof(int) * (unsigned long) info.nlen; - name = (size / sizeof(int) != info.nlen) ? NULL : malloc(size); - if (name == NULL || - umoven(tcp, (unsigned long) info.name, size, (char *) name) < 0) { - free(name); - if (entering(tcp)) - tprintf("{%p, %d, %p, %p, %p, %lu}", - info.name, info.nlen, info.oldval, - info.oldlenp, info.newval, (unsigned long)info.newlen); - return 0; - } - - if (entering(tcp)) { - int cnt = 0, max_cnt; - - tprints("{{"); - - if (info.nlen == 0) - goto out; - printxval(sysctl_root, name[0], "CTL_???"); - ++cnt; - - if (info.nlen == 1) - goto out; - switch (name[0]) { - case CTL_KERN: - tprints(", "); - printxval(sysctl_kern, name[1], "KERN_???"); - ++cnt; - break; - case CTL_VM: - tprints(", "); - printxval(sysctl_vm, name[1], "VM_???"); - ++cnt; - break; - case CTL_NET: - tprints(", "); - printxval(sysctl_net, name[1], "NET_???"); - ++cnt; - - if (info.nlen == 2) - goto out; - switch (name[1]) { - case NET_CORE: - tprints(", "); - printxval(sysctl_net_core, name[2], - "NET_CORE_???"); - break; - case NET_UNIX: - tprints(", "); - printxval(sysctl_net_unix, name[2], - "NET_UNIX_???"); - break; - case NET_IPV4: - tprints(", "); - printxval(sysctl_net_ipv4, name[2], - "NET_IPV4_???"); - - if (info.nlen == 3) - goto out; - switch (name[2]) { - case NET_IPV4_ROUTE: - tprints(", "); - printxval(sysctl_net_ipv4_route, - name[3], - "NET_IPV4_ROUTE_???"); - break; - case NET_IPV4_CONF: - tprints(", "); - printxval(sysctl_net_ipv4_conf, - name[3], - "NET_IPV4_CONF_???"); - break; - default: - goto out; - } - break; - case NET_IPV6: - tprints(", "); - printxval(sysctl_net_ipv6, name[2], - "NET_IPV6_???"); - - if (info.nlen == 3) - goto out; - switch (name[2]) { - case NET_IPV6_ROUTE: - tprints(", "); - printxval(sysctl_net_ipv6_route, - name[3], - "NET_IPV6_ROUTE_???"); - break; - default: - goto out; - } - break; - default: - goto out; - } - break; - default: - goto out; - } - out: - max_cnt = info.nlen; - if (abbrev(tcp) && max_cnt > max_strlen) - max_cnt = max_strlen; - while (cnt < max_cnt) - tprintf(", %x", name[cnt++]); - if (cnt < info.nlen) - tprints(", ..."); - tprintf("}, %d, ", info.nlen); - } else { - size_t oldlen = 0; - if (info.oldval == NULL) { - tprints("NULL"); - } else if (umove(tcp, (long)info.oldlenp, &oldlen) >= 0 - && info.nlen >= 2 - && ((name[0] == CTL_KERN - && (name[1] == KERN_OSRELEASE - || name[1] == KERN_OSTYPE -#ifdef KERN_JAVA_INTERPRETER - || name[1] == KERN_JAVA_INTERPRETER -#endif -#ifdef KERN_JAVA_APPLETVIEWER - || name[1] == KERN_JAVA_APPLETVIEWER -#endif - )))) { - printpath(tcp, (size_t)info.oldval); - } else { - tprintf("%p", info.oldval); - } - tprintf(", %lu, ", (unsigned long)oldlen); - if (info.newval == NULL) - tprints("NULL"); - else if (syserror(tcp)) - tprintf("%p", info.newval); - else - printpath(tcp, (size_t)info.newval); - tprintf(", %lu", (unsigned long)info.newlen); - } - - free(name); - return 0; -} - -#ifdef MIPS - -#ifndef __NEW_UTS_LEN -#define __NEW_UTS_LEN 64 -#endif - -#include "xlat/sysmips_operations.h" - -int sys_sysmips(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(sysmips_operations, tcp->u_arg[0], "???"); - if (!verbose(tcp)) { - tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); - } else if (tcp->u_arg[0] == SETNAME) { - char nodename[__NEW_UTS_LEN + 1]; - if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0) - tprintf(", %#lx", tcp->u_arg[1]); - else - tprintf(", \"%.*s\"", (int)(__NEW_UTS_LEN + 1), nodename); - } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) { - tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); - } else if (tcp->u_arg[0] == MIPS_FIXADE) { - tprintf(", 0x%lx", tcp->u_arg[1]); - } else { - tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); - } - } - - return 0; -} - -#endif /* MIPS */ - -#ifdef OR1K -#define OR1K_ATOMIC_SWAP 1 -#define OR1K_ATOMIC_CMPXCHG 2 -#define OR1K_ATOMIC_XCHG 3 -#define OR1K_ATOMIC_ADD 4 -#define OR1K_ATOMIC_DECPOS 5 -#define OR1K_ATOMIC_AND 6 -#define OR1K_ATOMIC_OR 7 -#define OR1K_ATOMIC_UMAX 8 -#define OR1K_ATOMIC_UMIN 9 - -#include "xlat/atomic_ops.h" - -int sys_or1k_atomic(struct tcb *tcp) -{ - if (entering(tcp)) { - printxval(atomic_ops, tcp->u_arg[0], "???"); - switch(tcp->u_arg[0]) { - case OR1K_ATOMIC_SWAP: - tprintf(", 0x%lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); - break; - case OR1K_ATOMIC_CMPXCHG: - tprintf(", 0x%lx, %#lx, %#lx", tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3]); - break; - - case OR1K_ATOMIC_XCHG: - case OR1K_ATOMIC_ADD: - case OR1K_ATOMIC_AND: - case OR1K_ATOMIC_OR: - case OR1K_ATOMIC_UMAX: - case OR1K_ATOMIC_UMIN: - tprintf(", 0x%lx, %#lx", tcp->u_arg[1], tcp->u_arg[2]); - break; - - case OR1K_ATOMIC_DECPOS: - tprintf(", 0x%lx", tcp->u_arg[1]); - break; - - default: - break; - } - } - - return RVAL_HEX; -} - -#endif /* OR1K */ diff --git a/term.c b/term.c index d1c9b653..d083cdd5 100644 --- a/term.c +++ b/term.c @@ -31,270 +31,261 @@ * the kernel one, and we need to use the kernel layout. */ #include -#ifdef HAVE_SYS_FILIO_H -# include -#endif #include "xlat/tcxonc_options.h" - -#ifdef TCLFLSH #include "xlat/tcflsh_options.h" -#endif - #include "xlat/baud_options.h" #include "xlat/modem_flags.h" -int term_ioctl(struct tcb *tcp, long code, long arg) +static void +decode_termios(struct tcb *const tcp, const kernel_ulong_t addr) { struct termios tios; + int i; + + tprints(", "); + if (umove_or_printaddr(tcp, addr, &tios)) + return; + if (abbrev(tcp)) { + tprints("{"); + printxval(baud_options, tios.c_cflag & CBAUD, "B???"); + tprintf(" %sopost %sisig %sicanon %secho ...}", + (tios.c_oflag & OPOST) ? "" : "-", + (tios.c_lflag & ISIG) ? "" : "-", + (tios.c_lflag & ICANON) ? "" : "-", + (tios.c_lflag & ECHO) ? "" : "-"); + return; + } + tprintf("{c_iflags=%#lx, c_oflags=%#lx, ", + (long) tios.c_iflag, (long) tios.c_oflag); + tprintf("c_cflags=%#lx, c_lflags=%#lx, ", + (long) tios.c_cflag, (long) tios.c_lflag); + tprintf("c_line=%u, ", tios.c_line); + if (!(tios.c_lflag & ICANON)) + tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ", + tios.c_cc[VMIN], tios.c_cc[VTIME]); + tprints("c_cc=\""); + for (i = 0; i < NCCS; i++) + tprintf("\\x%02x", tios.c_cc[i]); + tprints("\"}"); +} + +static void +decode_termio(struct tcb *const tcp, const kernel_ulong_t addr) +{ struct termio tio; + int i; + + tprints(", "); + if (umove_or_printaddr(tcp, addr, &tio)) + return; + if (abbrev(tcp)) { + tprints("{"); + printxval(baud_options, tio.c_cflag & CBAUD, "B???"); + tprintf(" %sopost %sisig %sicanon %secho ...}", + (tio.c_oflag & OPOST) ? "" : "-", + (tio.c_lflag & ISIG) ? "" : "-", + (tio.c_lflag & ICANON) ? "" : "-", + (tio.c_lflag & ECHO) ? "" : "-"); + return; + } + tprintf("{c_iflags=%#lx, c_oflags=%#lx, ", + (long) tio.c_iflag, (long) tio.c_oflag); + tprintf("c_cflags=%#lx, c_lflags=%#lx, ", + (long) tio.c_cflag, (long) tio.c_lflag); + tprintf("c_line=%u, ", tio.c_line); +#ifdef _VMIN + if (!(tio.c_lflag & ICANON)) + tprintf("c_cc[_VMIN]=%d, c_cc[_VTIME]=%d, ", + tio.c_cc[_VMIN], tio.c_cc[_VTIME]); +#else /* !_VMIN */ + if (!(tio.c_lflag & ICANON)) + tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ", + tio.c_cc[VMIN], tio.c_cc[VTIME]); +#endif /* !_VMIN */ + tprints("c_cc=\""); + for (i = 0; i < NCC; i++) + tprintf("\\x%02x", tio.c_cc[i]); + tprints("\"}"); +} + +static void +decode_winsize(struct tcb *const tcp, const kernel_ulong_t addr) +{ struct winsize ws; + + tprints(", "); + if (umove_or_printaddr(tcp, addr, &ws)) + return; + tprintf("{ws_row=%d, ws_col=%d, ws_xpixel=%d, ws_ypixel=%d}", + ws.ws_row, ws.ws_col, ws.ws_xpixel, ws.ws_ypixel); +} + #ifdef TIOCGSIZE - struct ttysize ts; +static void +decode_ttysize(struct tcb *const tcp, const kernel_ulong_t addr) +{ + struct ttysize ts; + + tprints(", "); + if (umove_or_printaddr(tcp, addr, &ts)) + return; + tprintf("{ts_lines=%d, ts_cols=%d}", + ts.ts_lines, ts.ts_cols); +} #endif + +static void +decode_modem_flags(struct tcb *const tcp, const kernel_ulong_t addr) +{ int i; - if (entering(tcp)) - return 0; + tprints(", "); + if (umove_or_printaddr(tcp, addr, &i)) + return; + tprints("["); + printflags(modem_flags, i, "TIOCM_???"); + tprints("]"); +} +int +term_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ switch (code) { - - /* ioctls with termios or termio args */ - -#ifdef TCGETS + /* struct termios */ case TCGETS: - if (syserror(tcp)) +#ifdef TCGETS2 + case TCGETS2: +#endif + case TIOCGLCKTRMIOS: + if (entering(tcp)) return 0; case TCSETS: +#ifdef TCSETS2 + case TCSETS2: +#endif case TCSETSW: +#ifdef TCSETSW2 + case TCSETSW2: +#endif case TCSETSF: - if (!verbose(tcp) || umove(tcp, arg, &tios) < 0) - return 0; - if (abbrev(tcp)) { - tprints(", {"); - printxval(baud_options, tios.c_cflag & CBAUD, "B???"); - tprintf(" %sopost %sisig %sicanon %secho ...}", - (tios.c_oflag & OPOST) ? "" : "-", - (tios.c_lflag & ISIG) ? "" : "-", - (tios.c_lflag & ICANON) ? "" : "-", - (tios.c_lflag & ECHO) ? "" : "-"); - return 1; - } - tprintf(", {c_iflags=%#lx, c_oflags=%#lx, ", - (long) tios.c_iflag, (long) tios.c_oflag); - tprintf("c_cflags=%#lx, c_lflags=%#lx, ", - (long) tios.c_cflag, (long) tios.c_lflag); - tprintf("c_line=%u, ", tios.c_line); - if (!(tios.c_lflag & ICANON)) - tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ", - tios.c_cc[VMIN], tios.c_cc[VTIME]); - tprintf("c_cc=\""); - for (i = 0; i < NCCS; i++) - tprintf("\\x%02x", tios.c_cc[i]); - tprintf("\"}"); - return 1; -#endif /* TCGETS */ +#ifdef TCSETSF2 + case TCSETSF2: +#endif + case TIOCSLCKTRMIOS: + decode_termios(tcp, arg); + break; -#ifdef TCGETA + /* struct termio */ case TCGETA: - if (syserror(tcp)) + if (entering(tcp)) return 0; case TCSETA: case TCSETAW: case TCSETAF: - if (!verbose(tcp) || umove(tcp, arg, &tio) < 0) - return 0; - if (abbrev(tcp)) { - tprints(", {"); - printxval(baud_options, tio.c_cflag & CBAUD, "B???"); - tprintf(" %sopost %sisig %sicanon %secho ...}", - (tio.c_oflag & OPOST) ? "" : "-", - (tio.c_lflag & ISIG) ? "" : "-", - (tio.c_lflag & ICANON) ? "" : "-", - (tio.c_lflag & ECHO) ? "" : "-"); - return 1; - } - tprintf(", {c_iflags=%#lx, c_oflags=%#lx, ", - (long) tio.c_iflag, (long) tio.c_oflag); - tprintf("c_cflags=%#lx, c_lflags=%#lx, ", - (long) tio.c_cflag, (long) tio.c_lflag); - tprintf("c_line=%u, ", tio.c_line); -#ifdef _VMIN - if (!(tio.c_lflag & ICANON)) - tprintf("c_cc[_VMIN]=%d, c_cc[_VTIME]=%d, ", - tio.c_cc[_VMIN], tio.c_cc[_VTIME]); -#else /* !_VMIN */ - if (!(tio.c_lflag & ICANON)) - tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ", - tio.c_cc[VMIN], tio.c_cc[VTIME]); -#endif /* !_VMIN */ - tprintf("c_cc=\""); - for (i = 0; i < NCC; i++) - tprintf("\\x%02x", tio.c_cc[i]); - tprintf("\"}"); - return 1; -#endif /* TCGETA */ + decode_termio(tcp, arg); + break; - /* ioctls with winsize or ttysize args */ - -#ifdef TIOCGWINSZ + /* struct winsize */ case TIOCGWINSZ: - if (syserror(tcp)) + if (entering(tcp)) return 0; case TIOCSWINSZ: - if (!verbose(tcp) || umove(tcp, arg, &ws) < 0) - return 0; - tprintf(", {ws_row=%d, ws_col=%d, ws_xpixel=%d, ws_ypixel=%d}", - ws.ws_row, ws.ws_col, ws.ws_xpixel, ws.ws_ypixel); - return 1; -#endif /* TIOCGWINSZ */ + decode_winsize(tcp, arg); + break; + /* struct ttysize */ #ifdef TIOCGSIZE case TIOCGSIZE: - if (syserror(tcp)) + if (entering(tcp)) return 0; case TIOCSSIZE: - if (!verbose(tcp) || umove(tcp, arg, &ts) < 0) - return 0; - tprintf(", {ts_lines=%d, ts_cols=%d}", - ts.ts_lines, ts.ts_cols); - return 1; + decode_ttysize(tcp, arg); + break; #endif /* ioctls with a direct decodable arg */ -#ifdef TCXONC case TCXONC: tprints(", "); - printxval(tcxonc_options, arg, "TC???"); - return 1; -#endif -#ifdef TCLFLSH + printxval64(tcxonc_options, arg, "TC???"); + break; case TCFLSH: tprints(", "); - printxval(tcflsh_options, arg, "TC???"); - return 1; -#endif -#ifdef TIOCSCTTY + printxval64(tcflsh_options, arg, "TC???"); + break; + case TCSBRK: + case TCSBRKP: case TIOCSCTTY: - tprintf(", %ld", arg); - return 1; -#endif + tprintf(", %d", (int) arg); + break; /* ioctls with an indirect parameter displayed as modem flags */ - -#ifdef TIOCMGET case TIOCMGET: + if (entering(tcp)) + return 0; case TIOCMBIS: case TIOCMBIC: case TIOCMSET: - if (umove(tcp, arg, &i) < 0) - return 0; - tprints(", ["); - printflags(modem_flags, i, "TIOCM_???"); - tprints("]"); - return 1; -#endif /* TIOCMGET */ + decode_modem_flags(tcp, arg); + break; /* ioctls with an indirect parameter displayed in decimal */ - - case TIOCSPGRP: case TIOCGPGRP: -#ifdef TIOCGETPGRP - case TIOCGETPGRP: -#endif -#ifdef TIOCSETPGRP - case TIOCSETPGRP: -#endif -#ifdef FIONREAD + case TIOCGSID: + case TIOCGETD: + case TIOCGSOFTCAR: + case TIOCGPTN: case FIONREAD: -#endif case TIOCOUTQ: -#ifdef FIONBIO - case FIONBIO: -#endif -#ifdef FIOASYNC - case FIOASYNC: -#endif -#ifdef FIOGETOWN - case FIOGETOWN: +#ifdef TIOCGEXCL + case TIOCGEXCL: #endif -#ifdef FIOSETOWN - case FIOSETOWN: +#ifdef TIOCGDEV + case TIOCGDEV: #endif -#ifdef TIOCGETD - case TIOCGETD: -#endif -#ifdef TIOCSETD + if (entering(tcp)) + return 0; + case TIOCSPGRP: case TIOCSETD: -#endif -#ifdef TIOCPKT + case FIONBIO: + case FIOASYNC: case TIOCPKT: -#endif -#ifdef TIOCREMOTE - case TIOCREMOTE: -#endif -#ifdef TIOCUCNTL - case TIOCUCNTL: -#endif -#ifdef TIOCTCNTL - case TIOCTCNTL: -#endif -#ifdef TIOCSIGNAL - case TIOCSIGNAL: -#endif -#ifdef TIOCSSOFTCAR case TIOCSSOFTCAR: -#endif -#ifdef TIOCGSOFTCAR - case TIOCGSOFTCAR: -#endif -#ifdef TIOCISPACE - case TIOCISPACE: -#endif -#ifdef TIOCISIZE - case TIOCISIZE: -#endif -#ifdef TIOCSINTR - case TIOCSINTR: -#endif -#ifdef TIOCSPTLCK case TIOCSPTLCK: -#endif -#ifdef TIOCGPTN - case TIOCGPTN: -#endif tprints(", "); printnum_int(tcp, arg, "%d"); - return 1; + break; /* ioctls with an indirect parameter displayed as a char */ - -#ifdef TIOCSTI case TIOCSTI: -#endif tprints(", "); - printstr(tcp, arg, 1); - return 1; + printstrn(tcp, arg, 1); + break; /* ioctls with no parameters */ -#ifdef TIOCNOTTY + case TIOCSBRK: + case TIOCCBRK: + case TIOCCONS: case TIOCNOTTY: -#endif -#ifdef FIOCLEX + case TIOCEXCL: + case TIOCNXCL: case FIOCLEX: -#endif -#ifdef FIONCLEX case FIONCLEX: +#ifdef TIOCVHANGUP + case TIOCVHANGUP: #endif -#ifdef TIOCCONS - case TIOCCONS: +#ifdef TIOCSSERIAL + case TIOCSSERIAL: #endif - return 1; + break; /* ioctls which are unknown */ default: - return 0; + return RVAL_DECODED; } + + return RVAL_DECODED | 1; } diff --git a/tests-m32/Makefile.am b/tests-m32/Makefile.am new file mode 100644 index 00000000..8d10878b --- /dev/null +++ b/tests-m32/Makefile.am @@ -0,0 +1,962 @@ +# Automake input for strace tests. +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +OS = linux +ARCH = @arch_m32@ +MPERS_NAME = m32 +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -m32 +AM_CFLAGS = $(WARN_CFLAGS) +AM_CPPFLAGS = $(ARCH_MFLAGS) \ + -I$(builddir) \ + -I$(top_builddir)/$(OS)/$(ARCH) \ + -I$(top_srcdir)/$(OS)/$(ARCH) \ + -I$(top_builddir)/$(OS) \ + -I$(top_srcdir)/$(OS) \ + -I$(top_builddir) \ + -I$(top_srcdir) +AM_LDFLAGS = $(ARCH_MFLAGS) + +libtests_a_SOURCES = \ + errno2name.c \ + error_msg.c \ + fill_memory.c \ + get_page_size.c \ + hexdump_strdup.c \ + hexquote_strndup.c \ + inode_of_sockfd.c \ + libmmsg.c \ + libsocketcall.c \ + overflowuid.c \ + pipe_maxfd.c \ + print_quoted_string.c \ + printflags.c \ + printxval.c \ + signal2name.c \ + sprintrc.c \ + tail_alloc.c \ + tests.h \ + tprintf.c \ + # end of libtests_a_SOURCES +libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +check_LIBRARIES = libtests.a +LDADD = libtests.a + +check_PROGRAMS = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + alarm \ + answer \ + attach-f-p \ + attach-f-p-cmd \ + attach-p-cmd-cmd \ + attach-p-cmd-p \ + bpf \ + brk \ + btrfs \ + caps \ + caps-abbrev \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + count-f \ + creat \ + delete_module \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execve-v \ + execveat \ + execveat-v \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + file_handle \ + file_ioctl \ + filter-unavailable \ + finit_module \ + flock \ + fork-f \ + fstat \ + fstat64 \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_dm-v \ + ioctl_evdev \ + ioctl_evdev-v \ + ioctl_loop \ + ioctl_loop-nv \ + ioctl_loop-v \ + ioctl_mtd \ + ioctl_rtc \ + ioctl_rtc-v \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msgbuf \ + ipc_sem \ + ipc_shm \ + kcmp \ + kexec_file_load \ + kexec_load \ + keyctl \ + kill \ + ksysent \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + mbind \ + membarrier \ + memfd_create \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap64 \ + mmsg \ + mmsg-silent \ + mmsg_name \ + mmsg_name-v \ + mount \ + move_pages \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_control-v \ + msg_name \ + munlockall \ + nanosleep \ + net-accept-connect \ + net-icmp_filter \ + net-sockaddr \ + net-y-unix \ + net-yy-inet \ + net-yy-netlink \ + net-yy-unix \ + netlink_inet_diag \ + netlink_netlink_diag \ + netlink_protocol \ + netlink_unix_diag \ + newfstatat \ + nsyscalls \ + old_mmap \ + oldfstat \ + oldlstat \ + oldselect \ + oldstat \ + open \ + openat \ + pause \ + pc \ + perf_event_open \ + perf_event_open_nonverbose \ + perf_event_open_unabbrev \ + personality \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + ppoll \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-seccomp-filter-v \ + prctl-seccomp-strict \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + print_maxfd \ + printstr \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + pwritev \ + qual_fault \ + qual_inject-error-signal \ + qual_inject-retval \ + qual_inject-signal \ + qual_signal \ + quotactl \ + quotactl-v \ + quotactl-xfs \ + quotactl-xfs-v \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + redirect-fds \ + remap_file_pages \ + rename \ + renameat \ + renameat2 \ + request_key \ + restart_syscall \ + rmdir \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + scm_rights \ + seccomp-filter \ + seccomp-filter-v \ + seccomp-strict \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + set_ptracer_any \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal_receive \ + signalfd4 \ + sigreturn \ + sleep \ + socketcall \ + splice \ + stack-fcall \ + stat \ + stat64 \ + statfs \ + statfs64 \ + swap \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + threads-execve \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unix-pair-send-recv \ + unix-pair-sendto-recvfrom \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimes \ + vfork-f \ + vhangup \ + vmsplice \ + wait4 \ + wait4-v \ + waitid \ + waitid-v \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # end of check_PROGRAMS + +attach_f_p_LDADD = -lrt -lpthread $(LDADD) +clock_xettime_LDADD = -lrt $(LDADD) +count_f_LDADD = -lpthread $(LDADD) +filter_unavailable_LDADD = -lpthread $(LDADD) +fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = -lrt $(LDADD) +mq_sendrecv_LDADD = -lrt $(LDADD) +mq_sendrecv_read_LDADD = -lrt $(LDADD) +mq_sendrecv_write_LDADD = -lrt $(LDADD) +newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pc_LDADD = $(dl_LIBS) $(LDADD) +pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +threads_execve_LDADD = -lrt -lpthread $(LDADD) +times_LDADD = -lrt $(LDADD) +truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + +stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + +if USE_LIBUNWIND +LIBUNWIND_TESTS = strace-k.test +else +LIBUNWIND_TESTS = +endif + +DECODER_TESTS = \ + _newselect.test \ + accept.test \ + accept4.test \ + access.test \ + acct.test \ + add_key.test \ + adjtimex.test \ + aio.test \ + alarm.test \ + bpf.test \ + brk.test \ + btrfs-v.test \ + btrfs-vw.test \ + btrfs-w.test \ + btrfs.test \ + caps-abbrev.test \ + caps.test \ + chmod.test \ + chown.test \ + chown32.test \ + chroot.test \ + clock_adjtime.test \ + clock_nanosleep.test \ + clock_xettime.test \ + copy_file_range.test \ + creat.test \ + delete_module.test \ + dup.test \ + dup2.test \ + dup3.test \ + epoll_create.test \ + epoll_create1.test \ + epoll_ctl.test \ + epoll_pwait.test \ + epoll_wait.test \ + erestartsys.test \ + eventfd.test \ + execve-v.test \ + execve.test \ + execveat-v.test \ + execveat.test \ + faccessat.test \ + fadvise64.test \ + fadvise64_64.test \ + fallocate.test \ + fanotify_init.test \ + fanotify_mark.test \ + fchdir.test \ + fchmod.test \ + fchmodat.test \ + fchown.test \ + fchown32.test \ + fchownat.test \ + fcntl.test \ + fcntl64.test \ + fdatasync.test \ + file_handle.test \ + file_ioctl.test \ + finit_module.test \ + flock.test \ + fstat.test \ + fstat64.test \ + fstatat64.test \ + fstatfs.test \ + fstatfs64.test \ + fsync.test \ + ftruncate.test \ + ftruncate64.test \ + futex.test \ + futimesat.test \ + get_mempolicy.test \ + getcpu.test \ + getcwd.test \ + getdents.test \ + getdents64.test \ + getegid.test \ + getegid32.test \ + geteuid.test \ + geteuid32.test \ + getgid.test \ + getgid32.test \ + getgroups.test \ + getgroups32.test \ + getpeername.test \ + getpgrp.test \ + getrandom.test \ + getresgid.test \ + getresgid32.test \ + getresuid.test \ + getresuid32.test \ + getrlimit.test \ + getrusage.test \ + getsid.test \ + getsockname.test \ + getuid.test \ + getuid32.test \ + getxxid.test \ + inet-cmsg.test \ + init_module.test \ + inotify.test \ + inotify_init1.test \ + ioctl.test \ + ioctl_block.test \ + ioctl_dm-v.test \ + ioctl_dm.test \ + ioctl_evdev-v.test \ + ioctl_evdev.test \ + ioctl_loop-nv.test \ + ioctl_loop-v.test \ + ioctl_loop.test \ + ioctl_mtd.test \ + ioctl_rtc-v.test \ + ioctl_rtc.test \ + ioctl_scsi.test \ + ioctl_sg_io_v3.test \ + ioctl_sg_io_v4.test \ + ioctl_sock_gifconf.test \ + ioctl_uffdio.test \ + ioctl_v4l2.test \ + ioperm.test \ + iopl.test \ + ioprio.test \ + ip_mreq.test \ + ipc.test \ + ipc_msg.test \ + ipc_msgbuf.test \ + ipc_sem.test \ + ipc_shm.test \ + kcmp.test \ + kexec_file_load.test \ + kexec_load.test \ + keyctl.test \ + kill.test \ + lchown.test \ + lchown32.test \ + link.test \ + linkat.test \ + llseek.test \ + lookup_dcookie.test \ + lseek.test \ + lstat.test \ + lstat64.test \ + mbind.test \ + membarrier.test \ + memfd_create.test \ + migrate_pages.test \ + mincore.test \ + mkdir.test \ + mkdirat.test \ + mknod.test \ + mknodat.test \ + mlock.test \ + mlock2.test \ + mlockall.test \ + mmap.test \ + mmap64.test \ + mmsg-silent.test \ + mmsg.test \ + mmsg_name-v.test \ + mmsg_name.test \ + mount.test \ + move_pages.test \ + mq.test \ + mq_sendrecv-read.test \ + mq_sendrecv-write.test \ + mq_sendrecv.test \ + msg_control-v.test \ + msg_control.test \ + msg_name.test \ + munlockall.test \ + nanosleep.test \ + net-icmp_filter.test \ + net-sockaddr.test \ + net-y-unix.test \ + net-yy-inet.test \ + net-yy-netlink.test \ + net-yy-unix.test \ + net.test \ + netlink_protocol.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ + oldfstat.test \ + oldlstat.test \ + oldselect.test \ + oldstat.test \ + open.test \ + openat.test \ + pause.test \ + perf_event_open.test \ + perf_event_open_nonverbose.test \ + perf_event_open_unabbrev.test \ + personality.test \ + pipe.test \ + pipe2.test \ + pkey_alloc.test \ + pkey_free.test \ + pkey_mprotect.test \ + poll.test \ + ppoll.test \ + prctl-arg2-intptr.test \ + prctl-dumpable.test \ + prctl-name.test \ + prctl-no-args.test \ + prctl-pdeathsig.test \ + prctl-seccomp-filter-v.test \ + prctl-seccomp-strict.test \ + prctl-securebits.test \ + prctl-tid_address.test \ + prctl-tsc.test \ + pread64-pwrite64.test \ + preadv-pwritev.test \ + preadv.test \ + preadv2-pwritev2.test \ + printstr.test \ + prlimit64.test \ + process_vm_readv.test \ + process_vm_writev.test \ + pselect6.test \ + ptrace.test \ + pwritev.test \ + qual_fault-exit_group.test \ + quotactl-v.test \ + quotactl-xfs-v.test \ + quotactl-xfs.test \ + quotactl.test \ + read-write.test \ + readahead.test \ + readdir.test \ + readlink.test \ + readlinkat.test \ + readv.test \ + reboot.test \ + recvfrom.test \ + recvmmsg-timeout.test \ + recvmsg.test \ + remap_file_pages.test \ + rename.test \ + renameat.test \ + renameat2.test \ + request_key.test \ + rmdir.test \ + rt_sigpending.test \ + rt_sigprocmask.test \ + rt_sigqueueinfo.test \ + rt_sigsuspend.test \ + rt_sigtimedwait.test \ + rt_tgsigqueueinfo.test \ + sched_get_priority_mxx.test \ + sched_rr_get_interval.test \ + sched_xetaffinity.test \ + sched_xetattr.test \ + sched_xetparam.test \ + sched_xetscheduler.test \ + sched_yield.test \ + scm_rights-fd.test \ + seccomp-filter-v.test \ + seccomp-filter.test \ + seccomp-strict.test \ + select.test \ + semop.test \ + sendfile.test \ + sendfile64.test \ + set_mempolicy.test \ + setdomainname.test \ + setfsgid.test \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ + setgid.test \ + setgid32.test \ + setgroups.test \ + setgroups32.test \ + sethostname.test \ + setns.test \ + setregid.test \ + setregid32.test \ + setresgid.test \ + setresgid32.test \ + setresuid.test \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ + setrlimit.test \ + setuid.test \ + setuid32.test \ + shmxt.test \ + shutdown.test \ + sigaction.test \ + sigaltstack.test \ + siginfo.test \ + signalfd4.test \ + sigreturn.test \ + socketcall.test \ + splice.test \ + stat.test \ + stat64.test \ + statfs.test \ + statfs64.test \ + sun_path.test \ + swap.test \ + symlink.test \ + symlinkat.test \ + sync.test \ + sync_file_range.test \ + sync_file_range2.test \ + sysinfo.test \ + syslog.test \ + tee.test \ + time.test \ + timer_create.test \ + timer_xettime.test \ + timerfd_xettime.test \ + times-fail.test \ + times.test \ + truncate.test \ + truncate64.test \ + ugetrlimit.test \ + uio.test \ + umask.test \ + umount.test \ + umount2.test \ + umoven-illptr.test \ + umovestr-illptr.test \ + umovestr.test \ + umovestr2.test \ + umovestr3.test \ + uname.test \ + unix-pair-send-recv.test \ + unix-pair-sendto-recvfrom.test \ + unlink.test \ + unlinkat.test \ + unshare.test \ + userfaultfd.test \ + ustat.test \ + utime.test \ + utimensat.test \ + utimes.test \ + vhangup.test \ + vmsplice.test \ + wait4-v.test \ + wait4.test \ + waitid-v.test \ + waitid.test \ + waitpid.test \ + xattr-strings.test \ + xattr.test \ + xet_robust_list.test \ + xetitimer.test \ + xetpgid.test \ + xetpriority.test \ + xettimeofday.test \ + # end of DECODER_TESTS + +MISC_TESTS = \ + attach-f-p.test \ + attach-p-cmd.test \ + bexecve.test \ + count-f.test \ + count.test \ + detach-running.test \ + detach-sleeping.test \ + detach-stopped.test \ + filter-unavailable.test \ + fork-f.test \ + ksysent.test \ + opipe.test \ + options-syntax.test \ + pc.test \ + qual_fault-syntax.test \ + qual_fault.test \ + qual_inject-error-signal.test \ + qual_inject-retval.test \ + qual_inject-signal.test \ + qual_inject-syntax.test \ + qual_signal.test \ + qual_syscall.test \ + redirect-fds.test \ + redirect.test \ + restart_syscall.test \ + signal_receive.test \ + strace-C.test \ + strace-E.test \ + strace-S.test \ + strace-T.test \ + strace-V.test \ + strace-ff.test \ + strace-r.test \ + strace-t.test \ + strace-tt.test \ + strace-ttt.test \ + threads-execve.test \ + vfork-f.test \ + # end of MISC_TESTS + +TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS) + +XFAIL_TESTS_ = +XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) + +TEST_LOG_COMPILER = env +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh + +@VALGRIND_CHECK_RULES@ +VALGRIND_FLAGS = --quiet +VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp + +EXTRA_DIST = init.sh run.sh match.awk \ + caps-abbrev.awk \ + caps.awk \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + getresugid.c \ + init_delete_module.h \ + ipc.sh \ + ipc_msgbuf.expected \ + ksysent.sed \ + lstatx.c \ + net.expected \ + oldselect.expected \ + pipe.expected \ + ppoll-v.expected \ + ppoll.expected \ + process_vm_readv_writev.c \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + quotactl.h \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaction.awk \ + sigaltstack.expected \ + sockname.c \ + statfs.expected \ + statx.sh \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + struct_flock.c \ + sun_path.expected \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + $(TESTS) + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h + +objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) +$(objects): scno.h + +CLEANFILES = ksysent.h $(TESTS:=.tmp) + +include ../scno.am diff --git a/tests-m32/Makefile.in b/tests-m32/Makefile.in new file mode 100644 index 00000000..77d11da5 --- /dev/null +++ b/tests-m32/Makefile.in @@ -0,0 +1,5714 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automake input for strace tests. +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# scno.h make rules for strace. +# +# Copyright (c) 2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ + access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ + adjtimex$(EXEEXT) aio$(EXEEXT) alarm$(EXEEXT) answer$(EXEEXT) \ + attach-f-p$(EXEEXT) attach-f-p-cmd$(EXEEXT) \ + attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) bpf$(EXEEXT) \ + brk$(EXEEXT) btrfs$(EXEEXT) caps$(EXEEXT) caps-abbrev$(EXEEXT) \ + chmod$(EXEEXT) chown$(EXEEXT) chown32$(EXEEXT) chroot$(EXEEXT) \ + clock_adjtime$(EXEEXT) clock_nanosleep$(EXEEXT) \ + clock_xettime$(EXEEXT) copy_file_range$(EXEEXT) \ + count-f$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ + dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) epoll_create$(EXEEXT) \ + epoll_create1$(EXEEXT) epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) \ + epoll_wait$(EXEEXT) erestartsys$(EXEEXT) eventfd$(EXEEXT) \ + execve$(EXEEXT) execve-v$(EXEEXT) execveat$(EXEEXT) \ + execveat-v$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ + fadvise64_64$(EXEEXT) fallocate$(EXEEXT) \ + fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) fchdir$(EXEEXT) \ + fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \ + fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \ + fcntl64$(EXEEXT) fdatasync$(EXEEXT) file_handle$(EXEEXT) \ + file_ioctl$(EXEEXT) filter-unavailable$(EXEEXT) \ + finit_module$(EXEEXT) flock$(EXEEXT) fork-f$(EXEEXT) \ + fstat$(EXEEXT) fstat64$(EXEEXT) fstatat64$(EXEEXT) \ + fstatfs$(EXEEXT) fstatfs64$(EXEEXT) fsync$(EXEEXT) \ + ftruncate$(EXEEXT) ftruncate64$(EXEEXT) futex$(EXEEXT) \ + futimesat$(EXEEXT) get_mempolicy$(EXEEXT) getcpu$(EXEEXT) \ + getcwd$(EXEEXT) getdents$(EXEEXT) getdents64$(EXEEXT) \ + getegid$(EXEEXT) getegid32$(EXEEXT) geteuid$(EXEEXT) \ + geteuid32$(EXEEXT) getgid$(EXEEXT) getgid32$(EXEEXT) \ + getgroups$(EXEEXT) getgroups32$(EXEEXT) getpeername$(EXEEXT) \ + getpgrp$(EXEEXT) getrandom$(EXEEXT) getresgid$(EXEEXT) \ + getresgid32$(EXEEXT) getresuid$(EXEEXT) getresuid32$(EXEEXT) \ + getrlimit$(EXEEXT) getrusage$(EXEEXT) getsid$(EXEEXT) \ + getsockname$(EXEEXT) getuid$(EXEEXT) getuid32$(EXEEXT) \ + getxxid$(EXEEXT) inet-cmsg$(EXEEXT) init_module$(EXEEXT) \ + inotify$(EXEEXT) inotify_init1$(EXEEXT) ioctl$(EXEEXT) \ + ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) ioctl_dm-v$(EXEEXT) \ + ioctl_evdev$(EXEEXT) ioctl_evdev-v$(EXEEXT) \ + ioctl_loop$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ + ioctl_loop-v$(EXEEXT) ioctl_mtd$(EXEEXT) ioctl_rtc$(EXEEXT) \ + ioctl_rtc-v$(EXEEXT) ioctl_scsi$(EXEEXT) \ + ioctl_sg_io_v3$(EXEEXT) ioctl_sg_io_v4$(EXEEXT) \ + ioctl_sock_gifconf$(EXEEXT) ioctl_uffdio$(EXEEXT) \ + ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) iopl$(EXEEXT) \ + ioprio$(EXEEXT) ip_mreq$(EXEEXT) ipc$(EXEEXT) ipc_msg$(EXEEXT) \ + ipc_msgbuf$(EXEEXT) ipc_sem$(EXEEXT) ipc_shm$(EXEEXT) \ + kcmp$(EXEEXT) kexec_file_load$(EXEEXT) kexec_load$(EXEEXT) \ + keyctl$(EXEEXT) kill$(EXEEXT) ksysent$(EXEEXT) lchown$(EXEEXT) \ + lchown32$(EXEEXT) link$(EXEEXT) linkat$(EXEEXT) \ + llseek$(EXEEXT) lookup_dcookie$(EXEEXT) lseek$(EXEEXT) \ + lstat$(EXEEXT) lstat64$(EXEEXT) mbind$(EXEEXT) \ + membarrier$(EXEEXT) memfd_create$(EXEEXT) \ + migrate_pages$(EXEEXT) mincore$(EXEEXT) mkdir$(EXEEXT) \ + mkdirat$(EXEEXT) mknod$(EXEEXT) mknodat$(EXEEXT) \ + mlock$(EXEEXT) mlock2$(EXEEXT) mlockall$(EXEEXT) mmap$(EXEEXT) \ + mmap64$(EXEEXT) mmsg$(EXEEXT) mmsg-silent$(EXEEXT) \ + mmsg_name$(EXEEXT) mmsg_name-v$(EXEEXT) mount$(EXEEXT) \ + move_pages$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ + mq_sendrecv-read$(EXEEXT) mq_sendrecv-write$(EXEEXT) \ + msg_control$(EXEEXT) msg_control-v$(EXEEXT) msg_name$(EXEEXT) \ + munlockall$(EXEEXT) nanosleep$(EXEEXT) \ + net-accept-connect$(EXEEXT) net-icmp_filter$(EXEEXT) \ + net-sockaddr$(EXEEXT) net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) \ + net-yy-netlink$(EXEEXT) net-yy-unix$(EXEEXT) \ + netlink_inet_diag$(EXEEXT) netlink_netlink_diag$(EXEEXT) \ + netlink_protocol$(EXEEXT) netlink_unix_diag$(EXEEXT) \ + newfstatat$(EXEEXT) nsyscalls$(EXEEXT) old_mmap$(EXEEXT) \ + oldfstat$(EXEEXT) oldlstat$(EXEEXT) oldselect$(EXEEXT) \ + oldstat$(EXEEXT) open$(EXEEXT) openat$(EXEEXT) pause$(EXEEXT) \ + pc$(EXEEXT) perf_event_open$(EXEEXT) \ + perf_event_open_nonverbose$(EXEEXT) \ + perf_event_open_unabbrev$(EXEEXT) personality$(EXEEXT) \ + pipe$(EXEEXT) pipe2$(EXEEXT) pkey_alloc$(EXEEXT) \ + pkey_free$(EXEEXT) pkey_mprotect$(EXEEXT) poll$(EXEEXT) \ + ppoll$(EXEEXT) prctl-arg2-intptr$(EXEEXT) \ + prctl-dumpable$(EXEEXT) prctl-name$(EXEEXT) \ + prctl-no-args$(EXEEXT) prctl-pdeathsig$(EXEEXT) \ + prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ + prctl-securebits$(EXEEXT) prctl-tid_address$(EXEEXT) \ + prctl-tsc$(EXEEXT) pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ + preadv-pwritev$(EXEEXT) preadv2-pwritev2$(EXEEXT) \ + print_maxfd$(EXEEXT) printstr$(EXEEXT) prlimit64$(EXEEXT) \ + process_vm_readv$(EXEEXT) process_vm_writev$(EXEEXT) \ + pselect6$(EXEEXT) ptrace$(EXEEXT) pwritev$(EXEEXT) \ + qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ + qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ + qual_signal$(EXEEXT) quotactl$(EXEEXT) quotactl-v$(EXEEXT) \ + quotactl-xfs$(EXEEXT) quotactl-xfs-v$(EXEEXT) \ + read-write$(EXEEXT) readahead$(EXEEXT) readdir$(EXEEXT) \ + readlink$(EXEEXT) readlinkat$(EXEEXT) readv$(EXEEXT) \ + reboot$(EXEEXT) recvfrom$(EXEEXT) recvmmsg-timeout$(EXEEXT) \ + recvmsg$(EXEEXT) redirect-fds$(EXEEXT) \ + remap_file_pages$(EXEEXT) rename$(EXEEXT) renameat$(EXEEXT) \ + renameat2$(EXEEXT) request_key$(EXEEXT) \ + restart_syscall$(EXEEXT) rmdir$(EXEEXT) rt_sigpending$(EXEEXT) \ + rt_sigprocmask$(EXEEXT) rt_sigqueueinfo$(EXEEXT) \ + rt_sigsuspend$(EXEEXT) rt_sigtimedwait$(EXEEXT) \ + rt_tgsigqueueinfo$(EXEEXT) sched_get_priority_mxx$(EXEEXT) \ + sched_rr_get_interval$(EXEEXT) sched_xetaffinity$(EXEEXT) \ + sched_xetattr$(EXEEXT) sched_xetparam$(EXEEXT) \ + sched_xetscheduler$(EXEEXT) sched_yield$(EXEEXT) \ + scm_rights$(EXEEXT) seccomp-filter$(EXEEXT) \ + seccomp-filter-v$(EXEEXT) seccomp-strict$(EXEEXT) \ + select$(EXEEXT) semop$(EXEEXT) sendfile$(EXEEXT) \ + sendfile64$(EXEEXT) set_mempolicy$(EXEEXT) \ + set_ptracer_any$(EXEEXT) setdomainname$(EXEEXT) \ + setfsgid$(EXEEXT) setfsgid32$(EXEEXT) setfsuid$(EXEEXT) \ + setfsuid32$(EXEEXT) setgid$(EXEEXT) setgid32$(EXEEXT) \ + setgroups$(EXEEXT) setgroups32$(EXEEXT) sethostname$(EXEEXT) \ + setns$(EXEEXT) setregid$(EXEEXT) setregid32$(EXEEXT) \ + setresgid$(EXEEXT) setresgid32$(EXEEXT) setresuid$(EXEEXT) \ + setresuid32$(EXEEXT) setreuid$(EXEEXT) setreuid32$(EXEEXT) \ + setrlimit$(EXEEXT) setuid$(EXEEXT) setuid32$(EXEEXT) \ + shmxt$(EXEEXT) shutdown$(EXEEXT) sigaction$(EXEEXT) \ + sigaltstack$(EXEEXT) siginfo$(EXEEXT) signal_receive$(EXEEXT) \ + signalfd4$(EXEEXT) sigreturn$(EXEEXT) sleep$(EXEEXT) \ + socketcall$(EXEEXT) splice$(EXEEXT) stack-fcall$(EXEEXT) \ + stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ + statfs64$(EXEEXT) swap$(EXEEXT) symlink$(EXEEXT) \ + symlinkat$(EXEEXT) sync$(EXEEXT) sync_file_range$(EXEEXT) \ + sync_file_range2$(EXEEXT) sysinfo$(EXEEXT) syslog$(EXEEXT) \ + tee$(EXEEXT) threads-execve$(EXEEXT) time$(EXEEXT) \ + timer_create$(EXEEXT) timer_xettime$(EXEEXT) \ + timerfd_xettime$(EXEEXT) times$(EXEEXT) times-fail$(EXEEXT) \ + truncate$(EXEEXT) truncate64$(EXEEXT) ugetrlimit$(EXEEXT) \ + uio$(EXEEXT) umask$(EXEEXT) umount$(EXEEXT) umount2$(EXEEXT) \ + umoven-illptr$(EXEEXT) umovestr$(EXEEXT) \ + umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) umovestr3$(EXEEXT) \ + uname$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) unlink$(EXEEXT) \ + unlinkat$(EXEEXT) unshare$(EXEEXT) userfaultfd$(EXEEXT) \ + ustat$(EXEEXT) utime$(EXEEXT) utimensat$(EXEEXT) \ + utimes$(EXEEXT) vfork-f$(EXEEXT) vhangup$(EXEEXT) \ + vmsplice$(EXEEXT) wait4$(EXEEXT) wait4-v$(EXEEXT) \ + waitid$(EXEEXT) waitid-v$(EXEEXT) waitpid$(EXEEXT) \ + xattr$(EXEEXT) xattr-strings$(EXEEXT) xet_robust_list$(EXEEXT) \ + xetitimer$(EXEEXT) xetpgid$(EXEEXT) xetpriority$(EXEEXT) \ + xettimeofday$(EXEEXT) +TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_1) +DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +subdir = tests-m32 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_valgrind_check.m4 \ + $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_warn_cflags.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libtests_a_AR = $(AR) $(ARFLAGS) +libtests_a_LIBADD = +am_libtests_a_OBJECTS = libtests_a-errno2name.$(OBJEXT) \ + libtests_a-error_msg.$(OBJEXT) \ + libtests_a-fill_memory.$(OBJEXT) \ + libtests_a-get_page_size.$(OBJEXT) \ + libtests_a-hexdump_strdup.$(OBJEXT) \ + libtests_a-hexquote_strndup.$(OBJEXT) \ + libtests_a-inode_of_sockfd.$(OBJEXT) \ + libtests_a-libmmsg.$(OBJEXT) \ + libtests_a-libsocketcall.$(OBJEXT) \ + libtests_a-overflowuid.$(OBJEXT) \ + libtests_a-pipe_maxfd.$(OBJEXT) \ + libtests_a-print_quoted_string.$(OBJEXT) \ + libtests_a-printflags.$(OBJEXT) libtests_a-printxval.$(OBJEXT) \ + libtests_a-signal2name.$(OBJEXT) libtests_a-sprintrc.$(OBJEXT) \ + libtests_a-tail_alloc.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) +libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) +_newselect_SOURCES = _newselect.c +_newselect_OBJECTS = _newselect.$(OBJEXT) +_newselect_LDADD = $(LDADD) +_newselect_DEPENDENCIES = libtests.a +accept_SOURCES = accept.c +accept_OBJECTS = accept.$(OBJEXT) +accept_LDADD = $(LDADD) +accept_DEPENDENCIES = libtests.a +accept4_SOURCES = accept4.c +accept4_OBJECTS = accept4.$(OBJEXT) +accept4_LDADD = $(LDADD) +accept4_DEPENDENCIES = libtests.a +access_SOURCES = access.c +access_OBJECTS = access.$(OBJEXT) +access_LDADD = $(LDADD) +access_DEPENDENCIES = libtests.a +acct_SOURCES = acct.c +acct_OBJECTS = acct.$(OBJEXT) +acct_LDADD = $(LDADD) +acct_DEPENDENCIES = libtests.a +add_key_SOURCES = add_key.c +add_key_OBJECTS = add_key.$(OBJEXT) +add_key_LDADD = $(LDADD) +add_key_DEPENDENCIES = libtests.a +adjtimex_SOURCES = adjtimex.c +adjtimex_OBJECTS = adjtimex.$(OBJEXT) +adjtimex_LDADD = $(LDADD) +adjtimex_DEPENDENCIES = libtests.a +aio_SOURCES = aio.c +aio_OBJECTS = aio.$(OBJEXT) +aio_LDADD = $(LDADD) +aio_DEPENDENCIES = libtests.a +alarm_SOURCES = alarm.c +alarm_OBJECTS = alarm.$(OBJEXT) +alarm_LDADD = $(LDADD) +alarm_DEPENDENCIES = libtests.a +answer_SOURCES = answer.c +answer_OBJECTS = answer.$(OBJEXT) +answer_LDADD = $(LDADD) +answer_DEPENDENCIES = libtests.a +attach_f_p_SOURCES = attach-f-p.c +attach_f_p_OBJECTS = attach-f-p.$(OBJEXT) +attach_f_p_DEPENDENCIES = $(LDADD) +attach_f_p_cmd_SOURCES = attach-f-p-cmd.c +attach_f_p_cmd_OBJECTS = attach-f-p-cmd.$(OBJEXT) +attach_f_p_cmd_LDADD = $(LDADD) +attach_f_p_cmd_DEPENDENCIES = libtests.a +attach_p_cmd_cmd_SOURCES = attach-p-cmd-cmd.c +attach_p_cmd_cmd_OBJECTS = attach-p-cmd-cmd.$(OBJEXT) +attach_p_cmd_cmd_LDADD = $(LDADD) +attach_p_cmd_cmd_DEPENDENCIES = libtests.a +attach_p_cmd_p_SOURCES = attach-p-cmd-p.c +attach_p_cmd_p_OBJECTS = attach-p-cmd-p.$(OBJEXT) +attach_p_cmd_p_LDADD = $(LDADD) +attach_p_cmd_p_DEPENDENCIES = libtests.a +bpf_SOURCES = bpf.c +bpf_OBJECTS = bpf.$(OBJEXT) +bpf_LDADD = $(LDADD) +bpf_DEPENDENCIES = libtests.a +brk_SOURCES = brk.c +brk_OBJECTS = brk.$(OBJEXT) +brk_LDADD = $(LDADD) +brk_DEPENDENCIES = libtests.a +btrfs_SOURCES = btrfs.c +btrfs_OBJECTS = btrfs.$(OBJEXT) +btrfs_LDADD = $(LDADD) +btrfs_DEPENDENCIES = libtests.a +caps_SOURCES = caps.c +caps_OBJECTS = caps.$(OBJEXT) +caps_LDADD = $(LDADD) +caps_DEPENDENCIES = libtests.a +caps_abbrev_SOURCES = caps-abbrev.c +caps_abbrev_OBJECTS = caps-abbrev.$(OBJEXT) +caps_abbrev_LDADD = $(LDADD) +caps_abbrev_DEPENDENCIES = libtests.a +chmod_SOURCES = chmod.c +chmod_OBJECTS = chmod.$(OBJEXT) +chmod_LDADD = $(LDADD) +chmod_DEPENDENCIES = libtests.a +chown_SOURCES = chown.c +chown_OBJECTS = chown.$(OBJEXT) +chown_LDADD = $(LDADD) +chown_DEPENDENCIES = libtests.a +chown32_SOURCES = chown32.c +chown32_OBJECTS = chown32.$(OBJEXT) +chown32_LDADD = $(LDADD) +chown32_DEPENDENCIES = libtests.a +chroot_SOURCES = chroot.c +chroot_OBJECTS = chroot.$(OBJEXT) +chroot_LDADD = $(LDADD) +chroot_DEPENDENCIES = libtests.a +clock_adjtime_SOURCES = clock_adjtime.c +clock_adjtime_OBJECTS = clock_adjtime.$(OBJEXT) +clock_adjtime_LDADD = $(LDADD) +clock_adjtime_DEPENDENCIES = libtests.a +clock_nanosleep_SOURCES = clock_nanosleep.c +clock_nanosleep_OBJECTS = clock_nanosleep.$(OBJEXT) +clock_nanosleep_LDADD = $(LDADD) +clock_nanosleep_DEPENDENCIES = libtests.a +clock_xettime_SOURCES = clock_xettime.c +clock_xettime_OBJECTS = clock_xettime.$(OBJEXT) +clock_xettime_DEPENDENCIES = $(LDADD) +copy_file_range_SOURCES = copy_file_range.c +copy_file_range_OBJECTS = copy_file_range.$(OBJEXT) +copy_file_range_LDADD = $(LDADD) +copy_file_range_DEPENDENCIES = libtests.a +count_f_SOURCES = count-f.c +count_f_OBJECTS = count-f.$(OBJEXT) +count_f_DEPENDENCIES = $(LDADD) +creat_SOURCES = creat.c +creat_OBJECTS = creat.$(OBJEXT) +creat_LDADD = $(LDADD) +creat_DEPENDENCIES = libtests.a +delete_module_SOURCES = delete_module.c +delete_module_OBJECTS = delete_module.$(OBJEXT) +delete_module_LDADD = $(LDADD) +delete_module_DEPENDENCIES = libtests.a +dup_SOURCES = dup.c +dup_OBJECTS = dup.$(OBJEXT) +dup_LDADD = $(LDADD) +dup_DEPENDENCIES = libtests.a +dup2_SOURCES = dup2.c +dup2_OBJECTS = dup2.$(OBJEXT) +dup2_LDADD = $(LDADD) +dup2_DEPENDENCIES = libtests.a +dup3_SOURCES = dup3.c +dup3_OBJECTS = dup3.$(OBJEXT) +dup3_LDADD = $(LDADD) +dup3_DEPENDENCIES = libtests.a +epoll_create_SOURCES = epoll_create.c +epoll_create_OBJECTS = epoll_create.$(OBJEXT) +epoll_create_LDADD = $(LDADD) +epoll_create_DEPENDENCIES = libtests.a +epoll_create1_SOURCES = epoll_create1.c +epoll_create1_OBJECTS = epoll_create1.$(OBJEXT) +epoll_create1_LDADD = $(LDADD) +epoll_create1_DEPENDENCIES = libtests.a +epoll_ctl_SOURCES = epoll_ctl.c +epoll_ctl_OBJECTS = epoll_ctl.$(OBJEXT) +epoll_ctl_LDADD = $(LDADD) +epoll_ctl_DEPENDENCIES = libtests.a +epoll_pwait_SOURCES = epoll_pwait.c +epoll_pwait_OBJECTS = epoll_pwait.$(OBJEXT) +epoll_pwait_LDADD = $(LDADD) +epoll_pwait_DEPENDENCIES = libtests.a +epoll_wait_SOURCES = epoll_wait.c +epoll_wait_OBJECTS = epoll_wait.$(OBJEXT) +epoll_wait_LDADD = $(LDADD) +epoll_wait_DEPENDENCIES = libtests.a +erestartsys_SOURCES = erestartsys.c +erestartsys_OBJECTS = erestartsys.$(OBJEXT) +erestartsys_LDADD = $(LDADD) +erestartsys_DEPENDENCIES = libtests.a +eventfd_SOURCES = eventfd.c +eventfd_OBJECTS = eventfd.$(OBJEXT) +eventfd_LDADD = $(LDADD) +eventfd_DEPENDENCIES = libtests.a +execve_SOURCES = execve.c +execve_OBJECTS = execve.$(OBJEXT) +execve_LDADD = $(LDADD) +execve_DEPENDENCIES = libtests.a +execve_v_SOURCES = execve-v.c +execve_v_OBJECTS = execve-v.$(OBJEXT) +execve_v_LDADD = $(LDADD) +execve_v_DEPENDENCIES = libtests.a +execveat_SOURCES = execveat.c +execveat_OBJECTS = execveat.$(OBJEXT) +execveat_LDADD = $(LDADD) +execveat_DEPENDENCIES = libtests.a +execveat_v_SOURCES = execveat-v.c +execveat_v_OBJECTS = execveat-v.$(OBJEXT) +execveat_v_LDADD = $(LDADD) +execveat_v_DEPENDENCIES = libtests.a +faccessat_SOURCES = faccessat.c +faccessat_OBJECTS = faccessat.$(OBJEXT) +faccessat_LDADD = $(LDADD) +faccessat_DEPENDENCIES = libtests.a +fadvise64_SOURCES = fadvise64.c +fadvise64_OBJECTS = fadvise64.$(OBJEXT) +fadvise64_LDADD = $(LDADD) +fadvise64_DEPENDENCIES = libtests.a +fadvise64_64_SOURCES = fadvise64_64.c +fadvise64_64_OBJECTS = fadvise64_64.$(OBJEXT) +fadvise64_64_LDADD = $(LDADD) +fadvise64_64_DEPENDENCIES = libtests.a +fallocate_SOURCES = fallocate.c +fallocate_OBJECTS = fallocate.$(OBJEXT) +fallocate_LDADD = $(LDADD) +fallocate_DEPENDENCIES = libtests.a +fanotify_init_SOURCES = fanotify_init.c +fanotify_init_OBJECTS = fanotify_init.$(OBJEXT) +fanotify_init_LDADD = $(LDADD) +fanotify_init_DEPENDENCIES = libtests.a +fanotify_mark_SOURCES = fanotify_mark.c +fanotify_mark_OBJECTS = fanotify_mark.$(OBJEXT) +fanotify_mark_LDADD = $(LDADD) +fanotify_mark_DEPENDENCIES = libtests.a +fchdir_SOURCES = fchdir.c +fchdir_OBJECTS = fchdir.$(OBJEXT) +fchdir_LDADD = $(LDADD) +fchdir_DEPENDENCIES = libtests.a +fchmod_SOURCES = fchmod.c +fchmod_OBJECTS = fchmod.$(OBJEXT) +fchmod_LDADD = $(LDADD) +fchmod_DEPENDENCIES = libtests.a +fchmodat_SOURCES = fchmodat.c +fchmodat_OBJECTS = fchmodat.$(OBJEXT) +fchmodat_LDADD = $(LDADD) +fchmodat_DEPENDENCIES = libtests.a +fchown_SOURCES = fchown.c +fchown_OBJECTS = fchown.$(OBJEXT) +fchown_LDADD = $(LDADD) +fchown_DEPENDENCIES = libtests.a +fchown32_SOURCES = fchown32.c +fchown32_OBJECTS = fchown32.$(OBJEXT) +fchown32_LDADD = $(LDADD) +fchown32_DEPENDENCIES = libtests.a +fchownat_SOURCES = fchownat.c +fchownat_OBJECTS = fchownat.$(OBJEXT) +fchownat_LDADD = $(LDADD) +fchownat_DEPENDENCIES = libtests.a +fcntl_SOURCES = fcntl.c +fcntl_OBJECTS = fcntl.$(OBJEXT) +fcntl_LDADD = $(LDADD) +fcntl_DEPENDENCIES = libtests.a +fcntl64_SOURCES = fcntl64.c +fcntl64_OBJECTS = fcntl64.$(OBJEXT) +fcntl64_LDADD = $(LDADD) +fcntl64_DEPENDENCIES = libtests.a +fdatasync_SOURCES = fdatasync.c +fdatasync_OBJECTS = fdatasync.$(OBJEXT) +fdatasync_LDADD = $(LDADD) +fdatasync_DEPENDENCIES = libtests.a +file_handle_SOURCES = file_handle.c +file_handle_OBJECTS = file_handle.$(OBJEXT) +file_handle_LDADD = $(LDADD) +file_handle_DEPENDENCIES = libtests.a +file_ioctl_SOURCES = file_ioctl.c +file_ioctl_OBJECTS = file_ioctl.$(OBJEXT) +file_ioctl_LDADD = $(LDADD) +file_ioctl_DEPENDENCIES = libtests.a +filter_unavailable_SOURCES = filter-unavailable.c +filter_unavailable_OBJECTS = filter-unavailable.$(OBJEXT) +filter_unavailable_DEPENDENCIES = $(LDADD) +finit_module_SOURCES = finit_module.c +finit_module_OBJECTS = finit_module.$(OBJEXT) +finit_module_LDADD = $(LDADD) +finit_module_DEPENDENCIES = libtests.a +flock_SOURCES = flock.c +flock_OBJECTS = flock.$(OBJEXT) +flock_LDADD = $(LDADD) +flock_DEPENDENCIES = libtests.a +fork_f_SOURCES = fork-f.c +fork_f_OBJECTS = fork-f.$(OBJEXT) +fork_f_LDADD = $(LDADD) +fork_f_DEPENDENCIES = libtests.a +fstat_SOURCES = fstat.c +fstat_OBJECTS = fstat.$(OBJEXT) +fstat_LDADD = $(LDADD) +fstat_DEPENDENCIES = libtests.a +fstat64_SOURCES = fstat64.c +fstat64_OBJECTS = fstat64-fstat64.$(OBJEXT) +fstat64_LDADD = $(LDADD) +fstat64_DEPENDENCIES = libtests.a +fstatat64_SOURCES = fstatat64.c +fstatat64_OBJECTS = fstatat64-fstatat64.$(OBJEXT) +fstatat64_LDADD = $(LDADD) +fstatat64_DEPENDENCIES = libtests.a +fstatfs_SOURCES = fstatfs.c +fstatfs_OBJECTS = fstatfs.$(OBJEXT) +fstatfs_LDADD = $(LDADD) +fstatfs_DEPENDENCIES = libtests.a +fstatfs64_SOURCES = fstatfs64.c +fstatfs64_OBJECTS = fstatfs64.$(OBJEXT) +fstatfs64_LDADD = $(LDADD) +fstatfs64_DEPENDENCIES = libtests.a +fsync_SOURCES = fsync.c +fsync_OBJECTS = fsync.$(OBJEXT) +fsync_LDADD = $(LDADD) +fsync_DEPENDENCIES = libtests.a +ftruncate_SOURCES = ftruncate.c +ftruncate_OBJECTS = ftruncate.$(OBJEXT) +ftruncate_LDADD = $(LDADD) +ftruncate_DEPENDENCIES = libtests.a +ftruncate64_SOURCES = ftruncate64.c +ftruncate64_OBJECTS = ftruncate64-ftruncate64.$(OBJEXT) +ftruncate64_LDADD = $(LDADD) +ftruncate64_DEPENDENCIES = libtests.a +futex_SOURCES = futex.c +futex_OBJECTS = futex.$(OBJEXT) +futex_LDADD = $(LDADD) +futex_DEPENDENCIES = libtests.a +futimesat_SOURCES = futimesat.c +futimesat_OBJECTS = futimesat.$(OBJEXT) +futimesat_LDADD = $(LDADD) +futimesat_DEPENDENCIES = libtests.a +get_mempolicy_SOURCES = get_mempolicy.c +get_mempolicy_OBJECTS = get_mempolicy.$(OBJEXT) +get_mempolicy_LDADD = $(LDADD) +get_mempolicy_DEPENDENCIES = libtests.a +getcpu_SOURCES = getcpu.c +getcpu_OBJECTS = getcpu.$(OBJEXT) +getcpu_LDADD = $(LDADD) +getcpu_DEPENDENCIES = libtests.a +getcwd_SOURCES = getcwd.c +getcwd_OBJECTS = getcwd.$(OBJEXT) +getcwd_LDADD = $(LDADD) +getcwd_DEPENDENCIES = libtests.a +getdents_SOURCES = getdents.c +getdents_OBJECTS = getdents.$(OBJEXT) +getdents_LDADD = $(LDADD) +getdents_DEPENDENCIES = libtests.a +getdents64_SOURCES = getdents64.c +getdents64_OBJECTS = getdents64.$(OBJEXT) +getdents64_LDADD = $(LDADD) +getdents64_DEPENDENCIES = libtests.a +getegid_SOURCES = getegid.c +getegid_OBJECTS = getegid.$(OBJEXT) +getegid_LDADD = $(LDADD) +getegid_DEPENDENCIES = libtests.a +getegid32_SOURCES = getegid32.c +getegid32_OBJECTS = getegid32.$(OBJEXT) +getegid32_LDADD = $(LDADD) +getegid32_DEPENDENCIES = libtests.a +geteuid_SOURCES = geteuid.c +geteuid_OBJECTS = geteuid.$(OBJEXT) +geteuid_LDADD = $(LDADD) +geteuid_DEPENDENCIES = libtests.a +geteuid32_SOURCES = geteuid32.c +geteuid32_OBJECTS = geteuid32.$(OBJEXT) +geteuid32_LDADD = $(LDADD) +geteuid32_DEPENDENCIES = libtests.a +getgid_SOURCES = getgid.c +getgid_OBJECTS = getgid.$(OBJEXT) +getgid_LDADD = $(LDADD) +getgid_DEPENDENCIES = libtests.a +getgid32_SOURCES = getgid32.c +getgid32_OBJECTS = getgid32.$(OBJEXT) +getgid32_LDADD = $(LDADD) +getgid32_DEPENDENCIES = libtests.a +getgroups_SOURCES = getgroups.c +getgroups_OBJECTS = getgroups.$(OBJEXT) +getgroups_LDADD = $(LDADD) +getgroups_DEPENDENCIES = libtests.a +getgroups32_SOURCES = getgroups32.c +getgroups32_OBJECTS = getgroups32.$(OBJEXT) +getgroups32_LDADD = $(LDADD) +getgroups32_DEPENDENCIES = libtests.a +getpeername_SOURCES = getpeername.c +getpeername_OBJECTS = getpeername.$(OBJEXT) +getpeername_LDADD = $(LDADD) +getpeername_DEPENDENCIES = libtests.a +getpgrp_SOURCES = getpgrp.c +getpgrp_OBJECTS = getpgrp.$(OBJEXT) +getpgrp_LDADD = $(LDADD) +getpgrp_DEPENDENCIES = libtests.a +getrandom_SOURCES = getrandom.c +getrandom_OBJECTS = getrandom.$(OBJEXT) +getrandom_LDADD = $(LDADD) +getrandom_DEPENDENCIES = libtests.a +getresgid_SOURCES = getresgid.c +getresgid_OBJECTS = getresgid.$(OBJEXT) +getresgid_LDADD = $(LDADD) +getresgid_DEPENDENCIES = libtests.a +getresgid32_SOURCES = getresgid32.c +getresgid32_OBJECTS = getresgid32.$(OBJEXT) +getresgid32_LDADD = $(LDADD) +getresgid32_DEPENDENCIES = libtests.a +getresuid_SOURCES = getresuid.c +getresuid_OBJECTS = getresuid.$(OBJEXT) +getresuid_LDADD = $(LDADD) +getresuid_DEPENDENCIES = libtests.a +getresuid32_SOURCES = getresuid32.c +getresuid32_OBJECTS = getresuid32.$(OBJEXT) +getresuid32_LDADD = $(LDADD) +getresuid32_DEPENDENCIES = libtests.a +getrlimit_SOURCES = getrlimit.c +getrlimit_OBJECTS = getrlimit.$(OBJEXT) +getrlimit_LDADD = $(LDADD) +getrlimit_DEPENDENCIES = libtests.a +getrusage_SOURCES = getrusage.c +getrusage_OBJECTS = getrusage.$(OBJEXT) +getrusage_LDADD = $(LDADD) +getrusage_DEPENDENCIES = libtests.a +getsid_SOURCES = getsid.c +getsid_OBJECTS = getsid.$(OBJEXT) +getsid_LDADD = $(LDADD) +getsid_DEPENDENCIES = libtests.a +getsockname_SOURCES = getsockname.c +getsockname_OBJECTS = getsockname.$(OBJEXT) +getsockname_LDADD = $(LDADD) +getsockname_DEPENDENCIES = libtests.a +getuid_SOURCES = getuid.c +getuid_OBJECTS = getuid.$(OBJEXT) +getuid_LDADD = $(LDADD) +getuid_DEPENDENCIES = libtests.a +getuid32_SOURCES = getuid32.c +getuid32_OBJECTS = getuid32.$(OBJEXT) +getuid32_LDADD = $(LDADD) +getuid32_DEPENDENCIES = libtests.a +getxxid_SOURCES = getxxid.c +getxxid_OBJECTS = getxxid.$(OBJEXT) +getxxid_LDADD = $(LDADD) +getxxid_DEPENDENCIES = libtests.a +inet_cmsg_SOURCES = inet-cmsg.c +inet_cmsg_OBJECTS = inet-cmsg.$(OBJEXT) +inet_cmsg_LDADD = $(LDADD) +inet_cmsg_DEPENDENCIES = libtests.a +init_module_SOURCES = init_module.c +init_module_OBJECTS = init_module.$(OBJEXT) +init_module_LDADD = $(LDADD) +init_module_DEPENDENCIES = libtests.a +inotify_SOURCES = inotify.c +inotify_OBJECTS = inotify.$(OBJEXT) +inotify_LDADD = $(LDADD) +inotify_DEPENDENCIES = libtests.a +inotify_init1_SOURCES = inotify_init1.c +inotify_init1_OBJECTS = inotify_init1.$(OBJEXT) +inotify_init1_LDADD = $(LDADD) +inotify_init1_DEPENDENCIES = libtests.a +ioctl_SOURCES = ioctl.c +ioctl_OBJECTS = ioctl.$(OBJEXT) +ioctl_LDADD = $(LDADD) +ioctl_DEPENDENCIES = libtests.a +ioctl_block_SOURCES = ioctl_block.c +ioctl_block_OBJECTS = ioctl_block.$(OBJEXT) +ioctl_block_LDADD = $(LDADD) +ioctl_block_DEPENDENCIES = libtests.a +ioctl_dm_SOURCES = ioctl_dm.c +ioctl_dm_OBJECTS = ioctl_dm.$(OBJEXT) +ioctl_dm_LDADD = $(LDADD) +ioctl_dm_DEPENDENCIES = libtests.a +ioctl_dm_v_SOURCES = ioctl_dm-v.c +ioctl_dm_v_OBJECTS = ioctl_dm-v.$(OBJEXT) +ioctl_dm_v_LDADD = $(LDADD) +ioctl_dm_v_DEPENDENCIES = libtests.a +ioctl_evdev_SOURCES = ioctl_evdev.c +ioctl_evdev_OBJECTS = ioctl_evdev.$(OBJEXT) +ioctl_evdev_LDADD = $(LDADD) +ioctl_evdev_DEPENDENCIES = libtests.a +ioctl_evdev_v_SOURCES = ioctl_evdev-v.c +ioctl_evdev_v_OBJECTS = ioctl_evdev-v.$(OBJEXT) +ioctl_evdev_v_LDADD = $(LDADD) +ioctl_evdev_v_DEPENDENCIES = libtests.a +ioctl_loop_SOURCES = ioctl_loop.c +ioctl_loop_OBJECTS = ioctl_loop.$(OBJEXT) +ioctl_loop_LDADD = $(LDADD) +ioctl_loop_DEPENDENCIES = libtests.a +ioctl_loop_nv_SOURCES = ioctl_loop-nv.c +ioctl_loop_nv_OBJECTS = ioctl_loop-nv.$(OBJEXT) +ioctl_loop_nv_LDADD = $(LDADD) +ioctl_loop_nv_DEPENDENCIES = libtests.a +ioctl_loop_v_SOURCES = ioctl_loop-v.c +ioctl_loop_v_OBJECTS = ioctl_loop-v.$(OBJEXT) +ioctl_loop_v_LDADD = $(LDADD) +ioctl_loop_v_DEPENDENCIES = libtests.a +ioctl_mtd_SOURCES = ioctl_mtd.c +ioctl_mtd_OBJECTS = ioctl_mtd.$(OBJEXT) +ioctl_mtd_LDADD = $(LDADD) +ioctl_mtd_DEPENDENCIES = libtests.a +ioctl_rtc_SOURCES = ioctl_rtc.c +ioctl_rtc_OBJECTS = ioctl_rtc.$(OBJEXT) +ioctl_rtc_LDADD = $(LDADD) +ioctl_rtc_DEPENDENCIES = libtests.a +ioctl_rtc_v_SOURCES = ioctl_rtc-v.c +ioctl_rtc_v_OBJECTS = ioctl_rtc-v.$(OBJEXT) +ioctl_rtc_v_LDADD = $(LDADD) +ioctl_rtc_v_DEPENDENCIES = libtests.a +ioctl_scsi_SOURCES = ioctl_scsi.c +ioctl_scsi_OBJECTS = ioctl_scsi.$(OBJEXT) +ioctl_scsi_LDADD = $(LDADD) +ioctl_scsi_DEPENDENCIES = libtests.a +ioctl_sg_io_v3_SOURCES = ioctl_sg_io_v3.c +ioctl_sg_io_v3_OBJECTS = ioctl_sg_io_v3.$(OBJEXT) +ioctl_sg_io_v3_LDADD = $(LDADD) +ioctl_sg_io_v3_DEPENDENCIES = libtests.a +ioctl_sg_io_v4_SOURCES = ioctl_sg_io_v4.c +ioctl_sg_io_v4_OBJECTS = ioctl_sg_io_v4.$(OBJEXT) +ioctl_sg_io_v4_LDADD = $(LDADD) +ioctl_sg_io_v4_DEPENDENCIES = libtests.a +ioctl_sock_gifconf_SOURCES = ioctl_sock_gifconf.c +ioctl_sock_gifconf_OBJECTS = ioctl_sock_gifconf.$(OBJEXT) +ioctl_sock_gifconf_LDADD = $(LDADD) +ioctl_sock_gifconf_DEPENDENCIES = libtests.a +ioctl_uffdio_SOURCES = ioctl_uffdio.c +ioctl_uffdio_OBJECTS = ioctl_uffdio.$(OBJEXT) +ioctl_uffdio_LDADD = $(LDADD) +ioctl_uffdio_DEPENDENCIES = libtests.a +ioctl_v4l2_SOURCES = ioctl_v4l2.c +ioctl_v4l2_OBJECTS = ioctl_v4l2.$(OBJEXT) +ioctl_v4l2_LDADD = $(LDADD) +ioctl_v4l2_DEPENDENCIES = libtests.a +ioperm_SOURCES = ioperm.c +ioperm_OBJECTS = ioperm.$(OBJEXT) +ioperm_LDADD = $(LDADD) +ioperm_DEPENDENCIES = libtests.a +iopl_SOURCES = iopl.c +iopl_OBJECTS = iopl.$(OBJEXT) +iopl_LDADD = $(LDADD) +iopl_DEPENDENCIES = libtests.a +ioprio_SOURCES = ioprio.c +ioprio_OBJECTS = ioprio.$(OBJEXT) +ioprio_LDADD = $(LDADD) +ioprio_DEPENDENCIES = libtests.a +ip_mreq_SOURCES = ip_mreq.c +ip_mreq_OBJECTS = ip_mreq.$(OBJEXT) +ip_mreq_LDADD = $(LDADD) +ip_mreq_DEPENDENCIES = libtests.a +ipc_SOURCES = ipc.c +ipc_OBJECTS = ipc.$(OBJEXT) +ipc_LDADD = $(LDADD) +ipc_DEPENDENCIES = libtests.a +ipc_msg_SOURCES = ipc_msg.c +ipc_msg_OBJECTS = ipc_msg.$(OBJEXT) +ipc_msg_LDADD = $(LDADD) +ipc_msg_DEPENDENCIES = libtests.a +ipc_msgbuf_SOURCES = ipc_msgbuf.c +ipc_msgbuf_OBJECTS = ipc_msgbuf.$(OBJEXT) +ipc_msgbuf_LDADD = $(LDADD) +ipc_msgbuf_DEPENDENCIES = libtests.a +ipc_sem_SOURCES = ipc_sem.c +ipc_sem_OBJECTS = ipc_sem.$(OBJEXT) +ipc_sem_LDADD = $(LDADD) +ipc_sem_DEPENDENCIES = libtests.a +ipc_shm_SOURCES = ipc_shm.c +ipc_shm_OBJECTS = ipc_shm.$(OBJEXT) +ipc_shm_LDADD = $(LDADD) +ipc_shm_DEPENDENCIES = libtests.a +kcmp_SOURCES = kcmp.c +kcmp_OBJECTS = kcmp.$(OBJEXT) +kcmp_LDADD = $(LDADD) +kcmp_DEPENDENCIES = libtests.a +kexec_file_load_SOURCES = kexec_file_load.c +kexec_file_load_OBJECTS = kexec_file_load.$(OBJEXT) +kexec_file_load_LDADD = $(LDADD) +kexec_file_load_DEPENDENCIES = libtests.a +kexec_load_SOURCES = kexec_load.c +kexec_load_OBJECTS = kexec_load.$(OBJEXT) +kexec_load_LDADD = $(LDADD) +kexec_load_DEPENDENCIES = libtests.a +keyctl_SOURCES = keyctl.c +keyctl_OBJECTS = keyctl.$(OBJEXT) +keyctl_LDADD = $(LDADD) +keyctl_DEPENDENCIES = libtests.a +kill_SOURCES = kill.c +kill_OBJECTS = kill.$(OBJEXT) +kill_LDADD = $(LDADD) +kill_DEPENDENCIES = libtests.a +ksysent_SOURCES = ksysent.c +ksysent_OBJECTS = ksysent.$(OBJEXT) +ksysent_LDADD = $(LDADD) +ksysent_DEPENDENCIES = libtests.a +lchown_SOURCES = lchown.c +lchown_OBJECTS = lchown.$(OBJEXT) +lchown_LDADD = $(LDADD) +lchown_DEPENDENCIES = libtests.a +lchown32_SOURCES = lchown32.c +lchown32_OBJECTS = lchown32.$(OBJEXT) +lchown32_LDADD = $(LDADD) +lchown32_DEPENDENCIES = libtests.a +link_SOURCES = link.c +link_OBJECTS = link.$(OBJEXT) +link_LDADD = $(LDADD) +link_DEPENDENCIES = libtests.a +linkat_SOURCES = linkat.c +linkat_OBJECTS = linkat.$(OBJEXT) +linkat_LDADD = $(LDADD) +linkat_DEPENDENCIES = libtests.a +llseek_SOURCES = llseek.c +llseek_OBJECTS = llseek.$(OBJEXT) +llseek_LDADD = $(LDADD) +llseek_DEPENDENCIES = libtests.a +lookup_dcookie_SOURCES = lookup_dcookie.c +lookup_dcookie_OBJECTS = lookup_dcookie.$(OBJEXT) +lookup_dcookie_LDADD = $(LDADD) +lookup_dcookie_DEPENDENCIES = libtests.a +lseek_SOURCES = lseek.c +lseek_OBJECTS = lseek.$(OBJEXT) +lseek_LDADD = $(LDADD) +lseek_DEPENDENCIES = libtests.a +lstat_SOURCES = lstat.c +lstat_OBJECTS = lstat.$(OBJEXT) +lstat_LDADD = $(LDADD) +lstat_DEPENDENCIES = libtests.a +lstat64_SOURCES = lstat64.c +lstat64_OBJECTS = lstat64-lstat64.$(OBJEXT) +lstat64_LDADD = $(LDADD) +lstat64_DEPENDENCIES = libtests.a +mbind_SOURCES = mbind.c +mbind_OBJECTS = mbind.$(OBJEXT) +mbind_LDADD = $(LDADD) +mbind_DEPENDENCIES = libtests.a +membarrier_SOURCES = membarrier.c +membarrier_OBJECTS = membarrier.$(OBJEXT) +membarrier_LDADD = $(LDADD) +membarrier_DEPENDENCIES = libtests.a +memfd_create_SOURCES = memfd_create.c +memfd_create_OBJECTS = memfd_create.$(OBJEXT) +memfd_create_LDADD = $(LDADD) +memfd_create_DEPENDENCIES = libtests.a +migrate_pages_SOURCES = migrate_pages.c +migrate_pages_OBJECTS = migrate_pages.$(OBJEXT) +migrate_pages_LDADD = $(LDADD) +migrate_pages_DEPENDENCIES = libtests.a +mincore_SOURCES = mincore.c +mincore_OBJECTS = mincore.$(OBJEXT) +mincore_LDADD = $(LDADD) +mincore_DEPENDENCIES = libtests.a +mkdir_SOURCES = mkdir.c +mkdir_OBJECTS = mkdir.$(OBJEXT) +mkdir_LDADD = $(LDADD) +mkdir_DEPENDENCIES = libtests.a +mkdirat_SOURCES = mkdirat.c +mkdirat_OBJECTS = mkdirat.$(OBJEXT) +mkdirat_LDADD = $(LDADD) +mkdirat_DEPENDENCIES = libtests.a +mknod_SOURCES = mknod.c +mknod_OBJECTS = mknod.$(OBJEXT) +mknod_LDADD = $(LDADD) +mknod_DEPENDENCIES = libtests.a +mknodat_SOURCES = mknodat.c +mknodat_OBJECTS = mknodat.$(OBJEXT) +mknodat_LDADD = $(LDADD) +mknodat_DEPENDENCIES = libtests.a +mlock_SOURCES = mlock.c +mlock_OBJECTS = mlock.$(OBJEXT) +mlock_LDADD = $(LDADD) +mlock_DEPENDENCIES = libtests.a +mlock2_SOURCES = mlock2.c +mlock2_OBJECTS = mlock2.$(OBJEXT) +mlock2_LDADD = $(LDADD) +mlock2_DEPENDENCIES = libtests.a +mlockall_SOURCES = mlockall.c +mlockall_OBJECTS = mlockall.$(OBJEXT) +mlockall_LDADD = $(LDADD) +mlockall_DEPENDENCIES = libtests.a +mmap_SOURCES = mmap.c +mmap_OBJECTS = mmap.$(OBJEXT) +mmap_LDADD = $(LDADD) +mmap_DEPENDENCIES = libtests.a +mmap64_SOURCES = mmap64.c +mmap64_OBJECTS = mmap64-mmap64.$(OBJEXT) +mmap64_LDADD = $(LDADD) +mmap64_DEPENDENCIES = libtests.a +mmsg_SOURCES = mmsg.c +mmsg_OBJECTS = mmsg.$(OBJEXT) +mmsg_LDADD = $(LDADD) +mmsg_DEPENDENCIES = libtests.a +mmsg_silent_SOURCES = mmsg-silent.c +mmsg_silent_OBJECTS = mmsg-silent.$(OBJEXT) +mmsg_silent_LDADD = $(LDADD) +mmsg_silent_DEPENDENCIES = libtests.a +mmsg_name_SOURCES = mmsg_name.c +mmsg_name_OBJECTS = mmsg_name.$(OBJEXT) +mmsg_name_LDADD = $(LDADD) +mmsg_name_DEPENDENCIES = libtests.a +mmsg_name_v_SOURCES = mmsg_name-v.c +mmsg_name_v_OBJECTS = mmsg_name-v.$(OBJEXT) +mmsg_name_v_LDADD = $(LDADD) +mmsg_name_v_DEPENDENCIES = libtests.a +mount_SOURCES = mount.c +mount_OBJECTS = mount.$(OBJEXT) +mount_LDADD = $(LDADD) +mount_DEPENDENCIES = libtests.a +move_pages_SOURCES = move_pages.c +move_pages_OBJECTS = move_pages.$(OBJEXT) +move_pages_LDADD = $(LDADD) +move_pages_DEPENDENCIES = libtests.a +mq_SOURCES = mq.c +mq_OBJECTS = mq.$(OBJEXT) +mq_DEPENDENCIES = $(LDADD) +mq_sendrecv_SOURCES = mq_sendrecv.c +mq_sendrecv_OBJECTS = mq_sendrecv.$(OBJEXT) +mq_sendrecv_DEPENDENCIES = $(LDADD) +mq_sendrecv_read_SOURCES = mq_sendrecv-read.c +mq_sendrecv_read_OBJECTS = mq_sendrecv-read.$(OBJEXT) +mq_sendrecv_read_DEPENDENCIES = $(LDADD) +mq_sendrecv_write_SOURCES = mq_sendrecv-write.c +mq_sendrecv_write_OBJECTS = mq_sendrecv-write.$(OBJEXT) +mq_sendrecv_write_DEPENDENCIES = $(LDADD) +msg_control_SOURCES = msg_control.c +msg_control_OBJECTS = msg_control.$(OBJEXT) +msg_control_LDADD = $(LDADD) +msg_control_DEPENDENCIES = libtests.a +msg_control_v_SOURCES = msg_control-v.c +msg_control_v_OBJECTS = msg_control-v.$(OBJEXT) +msg_control_v_LDADD = $(LDADD) +msg_control_v_DEPENDENCIES = libtests.a +msg_name_SOURCES = msg_name.c +msg_name_OBJECTS = msg_name.$(OBJEXT) +msg_name_LDADD = $(LDADD) +msg_name_DEPENDENCIES = libtests.a +munlockall_SOURCES = munlockall.c +munlockall_OBJECTS = munlockall.$(OBJEXT) +munlockall_LDADD = $(LDADD) +munlockall_DEPENDENCIES = libtests.a +nanosleep_SOURCES = nanosleep.c +nanosleep_OBJECTS = nanosleep.$(OBJEXT) +nanosleep_LDADD = $(LDADD) +nanosleep_DEPENDENCIES = libtests.a +net_accept_connect_SOURCES = net-accept-connect.c +net_accept_connect_OBJECTS = net-accept-connect.$(OBJEXT) +net_accept_connect_LDADD = $(LDADD) +net_accept_connect_DEPENDENCIES = libtests.a +net_icmp_filter_SOURCES = net-icmp_filter.c +net_icmp_filter_OBJECTS = net-icmp_filter.$(OBJEXT) +net_icmp_filter_LDADD = $(LDADD) +net_icmp_filter_DEPENDENCIES = libtests.a +net_sockaddr_SOURCES = net-sockaddr.c +net_sockaddr_OBJECTS = net-sockaddr.$(OBJEXT) +net_sockaddr_LDADD = $(LDADD) +net_sockaddr_DEPENDENCIES = libtests.a +net_y_unix_SOURCES = net-y-unix.c +net_y_unix_OBJECTS = net-y-unix.$(OBJEXT) +net_y_unix_LDADD = $(LDADD) +net_y_unix_DEPENDENCIES = libtests.a +net_yy_inet_SOURCES = net-yy-inet.c +net_yy_inet_OBJECTS = net-yy-inet.$(OBJEXT) +net_yy_inet_LDADD = $(LDADD) +net_yy_inet_DEPENDENCIES = libtests.a +net_yy_netlink_SOURCES = net-yy-netlink.c +net_yy_netlink_OBJECTS = net-yy-netlink.$(OBJEXT) +net_yy_netlink_LDADD = $(LDADD) +net_yy_netlink_DEPENDENCIES = libtests.a +net_yy_unix_SOURCES = net-yy-unix.c +net_yy_unix_OBJECTS = net-yy-unix.$(OBJEXT) +net_yy_unix_LDADD = $(LDADD) +net_yy_unix_DEPENDENCIES = libtests.a +netlink_inet_diag_SOURCES = netlink_inet_diag.c +netlink_inet_diag_OBJECTS = netlink_inet_diag.$(OBJEXT) +netlink_inet_diag_LDADD = $(LDADD) +netlink_inet_diag_DEPENDENCIES = libtests.a +netlink_netlink_diag_SOURCES = netlink_netlink_diag.c +netlink_netlink_diag_OBJECTS = netlink_netlink_diag.$(OBJEXT) +netlink_netlink_diag_LDADD = $(LDADD) +netlink_netlink_diag_DEPENDENCIES = libtests.a +netlink_protocol_SOURCES = netlink_protocol.c +netlink_protocol_OBJECTS = netlink_protocol.$(OBJEXT) +netlink_protocol_LDADD = $(LDADD) +netlink_protocol_DEPENDENCIES = libtests.a +netlink_unix_diag_SOURCES = netlink_unix_diag.c +netlink_unix_diag_OBJECTS = netlink_unix_diag.$(OBJEXT) +netlink_unix_diag_LDADD = $(LDADD) +netlink_unix_diag_DEPENDENCIES = libtests.a +newfstatat_SOURCES = newfstatat.c +newfstatat_OBJECTS = newfstatat-newfstatat.$(OBJEXT) +newfstatat_LDADD = $(LDADD) +newfstatat_DEPENDENCIES = libtests.a +nsyscalls_SOURCES = nsyscalls.c +nsyscalls_OBJECTS = nsyscalls.$(OBJEXT) +nsyscalls_LDADD = $(LDADD) +nsyscalls_DEPENDENCIES = libtests.a +old_mmap_SOURCES = old_mmap.c +old_mmap_OBJECTS = old_mmap.$(OBJEXT) +old_mmap_LDADD = $(LDADD) +old_mmap_DEPENDENCIES = libtests.a +oldfstat_SOURCES = oldfstat.c +oldfstat_OBJECTS = oldfstat.$(OBJEXT) +oldfstat_LDADD = $(LDADD) +oldfstat_DEPENDENCIES = libtests.a +oldlstat_SOURCES = oldlstat.c +oldlstat_OBJECTS = oldlstat.$(OBJEXT) +oldlstat_LDADD = $(LDADD) +oldlstat_DEPENDENCIES = libtests.a +oldselect_SOURCES = oldselect.c +oldselect_OBJECTS = oldselect.$(OBJEXT) +oldselect_LDADD = $(LDADD) +oldselect_DEPENDENCIES = libtests.a +oldstat_SOURCES = oldstat.c +oldstat_OBJECTS = oldstat.$(OBJEXT) +oldstat_LDADD = $(LDADD) +oldstat_DEPENDENCIES = libtests.a +open_SOURCES = open.c +open_OBJECTS = open.$(OBJEXT) +open_LDADD = $(LDADD) +open_DEPENDENCIES = libtests.a +openat_SOURCES = openat.c +openat_OBJECTS = openat.$(OBJEXT) +openat_LDADD = $(LDADD) +openat_DEPENDENCIES = libtests.a +pause_SOURCES = pause.c +pause_OBJECTS = pause.$(OBJEXT) +pause_LDADD = $(LDADD) +pause_DEPENDENCIES = libtests.a +pc_SOURCES = pc.c +pc_OBJECTS = pc.$(OBJEXT) +am__DEPENDENCIES_1 = +pc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) +perf_event_open_SOURCES = perf_event_open.c +perf_event_open_OBJECTS = perf_event_open.$(OBJEXT) +perf_event_open_LDADD = $(LDADD) +perf_event_open_DEPENDENCIES = libtests.a +perf_event_open_nonverbose_SOURCES = perf_event_open_nonverbose.c +perf_event_open_nonverbose_OBJECTS = \ + perf_event_open_nonverbose.$(OBJEXT) +perf_event_open_nonverbose_LDADD = $(LDADD) +perf_event_open_nonverbose_DEPENDENCIES = libtests.a +perf_event_open_unabbrev_SOURCES = perf_event_open_unabbrev.c +perf_event_open_unabbrev_OBJECTS = perf_event_open_unabbrev.$(OBJEXT) +perf_event_open_unabbrev_LDADD = $(LDADD) +perf_event_open_unabbrev_DEPENDENCIES = libtests.a +personality_SOURCES = personality.c +personality_OBJECTS = personality.$(OBJEXT) +personality_LDADD = $(LDADD) +personality_DEPENDENCIES = libtests.a +pipe_SOURCES = pipe.c +pipe_OBJECTS = pipe.$(OBJEXT) +pipe_LDADD = $(LDADD) +pipe_DEPENDENCIES = libtests.a +pipe2_SOURCES = pipe2.c +pipe2_OBJECTS = pipe2.$(OBJEXT) +pipe2_LDADD = $(LDADD) +pipe2_DEPENDENCIES = libtests.a +pkey_alloc_SOURCES = pkey_alloc.c +pkey_alloc_OBJECTS = pkey_alloc.$(OBJEXT) +pkey_alloc_LDADD = $(LDADD) +pkey_alloc_DEPENDENCIES = libtests.a +pkey_free_SOURCES = pkey_free.c +pkey_free_OBJECTS = pkey_free.$(OBJEXT) +pkey_free_LDADD = $(LDADD) +pkey_free_DEPENDENCIES = libtests.a +pkey_mprotect_SOURCES = pkey_mprotect.c +pkey_mprotect_OBJECTS = pkey_mprotect.$(OBJEXT) +pkey_mprotect_LDADD = $(LDADD) +pkey_mprotect_DEPENDENCIES = libtests.a +poll_SOURCES = poll.c +poll_OBJECTS = poll.$(OBJEXT) +poll_LDADD = $(LDADD) +poll_DEPENDENCIES = libtests.a +ppoll_SOURCES = ppoll.c +ppoll_OBJECTS = ppoll.$(OBJEXT) +ppoll_LDADD = $(LDADD) +ppoll_DEPENDENCIES = libtests.a +prctl_arg2_intptr_SOURCES = prctl-arg2-intptr.c +prctl_arg2_intptr_OBJECTS = prctl-arg2-intptr.$(OBJEXT) +prctl_arg2_intptr_LDADD = $(LDADD) +prctl_arg2_intptr_DEPENDENCIES = libtests.a +prctl_dumpable_SOURCES = prctl-dumpable.c +prctl_dumpable_OBJECTS = prctl-dumpable.$(OBJEXT) +prctl_dumpable_LDADD = $(LDADD) +prctl_dumpable_DEPENDENCIES = libtests.a +prctl_name_SOURCES = prctl-name.c +prctl_name_OBJECTS = prctl-name.$(OBJEXT) +prctl_name_LDADD = $(LDADD) +prctl_name_DEPENDENCIES = libtests.a +prctl_no_args_SOURCES = prctl-no-args.c +prctl_no_args_OBJECTS = prctl-no-args.$(OBJEXT) +prctl_no_args_LDADD = $(LDADD) +prctl_no_args_DEPENDENCIES = libtests.a +prctl_pdeathsig_SOURCES = prctl-pdeathsig.c +prctl_pdeathsig_OBJECTS = prctl-pdeathsig.$(OBJEXT) +prctl_pdeathsig_LDADD = $(LDADD) +prctl_pdeathsig_DEPENDENCIES = libtests.a +prctl_seccomp_filter_v_SOURCES = prctl-seccomp-filter-v.c +prctl_seccomp_filter_v_OBJECTS = prctl-seccomp-filter-v.$(OBJEXT) +prctl_seccomp_filter_v_LDADD = $(LDADD) +prctl_seccomp_filter_v_DEPENDENCIES = libtests.a +prctl_seccomp_strict_SOURCES = prctl-seccomp-strict.c +prctl_seccomp_strict_OBJECTS = prctl-seccomp-strict.$(OBJEXT) +prctl_seccomp_strict_LDADD = $(LDADD) +prctl_seccomp_strict_DEPENDENCIES = libtests.a +prctl_securebits_SOURCES = prctl-securebits.c +prctl_securebits_OBJECTS = prctl-securebits.$(OBJEXT) +prctl_securebits_LDADD = $(LDADD) +prctl_securebits_DEPENDENCIES = libtests.a +prctl_tid_address_SOURCES = prctl-tid_address.c +prctl_tid_address_OBJECTS = prctl-tid_address.$(OBJEXT) +prctl_tid_address_LDADD = $(LDADD) +prctl_tid_address_DEPENDENCIES = libtests.a +prctl_tsc_SOURCES = prctl-tsc.c +prctl_tsc_OBJECTS = prctl-tsc.$(OBJEXT) +prctl_tsc_LDADD = $(LDADD) +prctl_tsc_DEPENDENCIES = libtests.a +pread64_pwrite64_SOURCES = pread64-pwrite64.c +pread64_pwrite64_OBJECTS = \ + pread64_pwrite64-pread64-pwrite64.$(OBJEXT) +pread64_pwrite64_LDADD = $(LDADD) +pread64_pwrite64_DEPENDENCIES = libtests.a +preadv_SOURCES = preadv.c +preadv_OBJECTS = preadv-preadv.$(OBJEXT) +preadv_LDADD = $(LDADD) +preadv_DEPENDENCIES = libtests.a +preadv_pwritev_SOURCES = preadv-pwritev.c +preadv_pwritev_OBJECTS = preadv_pwritev-preadv-pwritev.$(OBJEXT) +preadv_pwritev_LDADD = $(LDADD) +preadv_pwritev_DEPENDENCIES = libtests.a +preadv2_pwritev2_SOURCES = preadv2-pwritev2.c +preadv2_pwritev2_OBJECTS = preadv2-pwritev2.$(OBJEXT) +preadv2_pwritev2_LDADD = $(LDADD) +preadv2_pwritev2_DEPENDENCIES = libtests.a +print_maxfd_SOURCES = print_maxfd.c +print_maxfd_OBJECTS = print_maxfd.$(OBJEXT) +print_maxfd_LDADD = $(LDADD) +print_maxfd_DEPENDENCIES = libtests.a +printstr_SOURCES = printstr.c +printstr_OBJECTS = printstr.$(OBJEXT) +printstr_LDADD = $(LDADD) +printstr_DEPENDENCIES = libtests.a +prlimit64_SOURCES = prlimit64.c +prlimit64_OBJECTS = prlimit64.$(OBJEXT) +prlimit64_LDADD = $(LDADD) +prlimit64_DEPENDENCIES = libtests.a +process_vm_readv_SOURCES = process_vm_readv.c +process_vm_readv_OBJECTS = process_vm_readv.$(OBJEXT) +process_vm_readv_LDADD = $(LDADD) +process_vm_readv_DEPENDENCIES = libtests.a +process_vm_writev_SOURCES = process_vm_writev.c +process_vm_writev_OBJECTS = process_vm_writev.$(OBJEXT) +process_vm_writev_LDADD = $(LDADD) +process_vm_writev_DEPENDENCIES = libtests.a +pselect6_SOURCES = pselect6.c +pselect6_OBJECTS = pselect6.$(OBJEXT) +pselect6_LDADD = $(LDADD) +pselect6_DEPENDENCIES = libtests.a +ptrace_SOURCES = ptrace.c +ptrace_OBJECTS = ptrace.$(OBJEXT) +ptrace_LDADD = $(LDADD) +ptrace_DEPENDENCIES = libtests.a +pwritev_SOURCES = pwritev.c +pwritev_OBJECTS = pwritev-pwritev.$(OBJEXT) +pwritev_LDADD = $(LDADD) +pwritev_DEPENDENCIES = libtests.a +qual_fault_SOURCES = qual_fault.c +qual_fault_OBJECTS = qual_fault.$(OBJEXT) +qual_fault_LDADD = $(LDADD) +qual_fault_DEPENDENCIES = libtests.a +qual_inject_error_signal_SOURCES = qual_inject-error-signal.c +qual_inject_error_signal_OBJECTS = qual_inject-error-signal.$(OBJEXT) +qual_inject_error_signal_LDADD = $(LDADD) +qual_inject_error_signal_DEPENDENCIES = libtests.a +qual_inject_retval_SOURCES = qual_inject-retval.c +qual_inject_retval_OBJECTS = qual_inject-retval.$(OBJEXT) +qual_inject_retval_LDADD = $(LDADD) +qual_inject_retval_DEPENDENCIES = libtests.a +qual_inject_signal_SOURCES = qual_inject-signal.c +qual_inject_signal_OBJECTS = qual_inject-signal.$(OBJEXT) +qual_inject_signal_LDADD = $(LDADD) +qual_inject_signal_DEPENDENCIES = libtests.a +qual_signal_SOURCES = qual_signal.c +qual_signal_OBJECTS = qual_signal.$(OBJEXT) +qual_signal_LDADD = $(LDADD) +qual_signal_DEPENDENCIES = libtests.a +quotactl_SOURCES = quotactl.c +quotactl_OBJECTS = quotactl.$(OBJEXT) +quotactl_LDADD = $(LDADD) +quotactl_DEPENDENCIES = libtests.a +quotactl_v_SOURCES = quotactl-v.c +quotactl_v_OBJECTS = quotactl-v.$(OBJEXT) +quotactl_v_LDADD = $(LDADD) +quotactl_v_DEPENDENCIES = libtests.a +quotactl_xfs_SOURCES = quotactl-xfs.c +quotactl_xfs_OBJECTS = quotactl-xfs.$(OBJEXT) +quotactl_xfs_LDADD = $(LDADD) +quotactl_xfs_DEPENDENCIES = libtests.a +quotactl_xfs_v_SOURCES = quotactl-xfs-v.c +quotactl_xfs_v_OBJECTS = quotactl-xfs-v.$(OBJEXT) +quotactl_xfs_v_LDADD = $(LDADD) +quotactl_xfs_v_DEPENDENCIES = libtests.a +read_write_SOURCES = read-write.c +read_write_OBJECTS = read-write.$(OBJEXT) +read_write_LDADD = $(LDADD) +read_write_DEPENDENCIES = libtests.a +readahead_SOURCES = readahead.c +readahead_OBJECTS = readahead.$(OBJEXT) +readahead_LDADD = $(LDADD) +readahead_DEPENDENCIES = libtests.a +readdir_SOURCES = readdir.c +readdir_OBJECTS = readdir.$(OBJEXT) +readdir_LDADD = $(LDADD) +readdir_DEPENDENCIES = libtests.a +readlink_SOURCES = readlink.c +readlink_OBJECTS = readlink.$(OBJEXT) +readlink_LDADD = $(LDADD) +readlink_DEPENDENCIES = libtests.a +readlinkat_SOURCES = readlinkat.c +readlinkat_OBJECTS = readlinkat.$(OBJEXT) +readlinkat_LDADD = $(LDADD) +readlinkat_DEPENDENCIES = libtests.a +readv_SOURCES = readv.c +readv_OBJECTS = readv.$(OBJEXT) +readv_LDADD = $(LDADD) +readv_DEPENDENCIES = libtests.a +reboot_SOURCES = reboot.c +reboot_OBJECTS = reboot.$(OBJEXT) +reboot_LDADD = $(LDADD) +reboot_DEPENDENCIES = libtests.a +recvfrom_SOURCES = recvfrom.c +recvfrom_OBJECTS = recvfrom.$(OBJEXT) +recvfrom_LDADD = $(LDADD) +recvfrom_DEPENDENCIES = libtests.a +recvmmsg_timeout_SOURCES = recvmmsg-timeout.c +recvmmsg_timeout_OBJECTS = recvmmsg-timeout.$(OBJEXT) +recvmmsg_timeout_LDADD = $(LDADD) +recvmmsg_timeout_DEPENDENCIES = libtests.a +recvmsg_SOURCES = recvmsg.c +recvmsg_OBJECTS = recvmsg.$(OBJEXT) +recvmsg_LDADD = $(LDADD) +recvmsg_DEPENDENCIES = libtests.a +redirect_fds_SOURCES = redirect-fds.c +redirect_fds_OBJECTS = redirect-fds.$(OBJEXT) +redirect_fds_LDADD = $(LDADD) +redirect_fds_DEPENDENCIES = libtests.a +remap_file_pages_SOURCES = remap_file_pages.c +remap_file_pages_OBJECTS = remap_file_pages.$(OBJEXT) +remap_file_pages_LDADD = $(LDADD) +remap_file_pages_DEPENDENCIES = libtests.a +rename_SOURCES = rename.c +rename_OBJECTS = rename.$(OBJEXT) +rename_LDADD = $(LDADD) +rename_DEPENDENCIES = libtests.a +renameat_SOURCES = renameat.c +renameat_OBJECTS = renameat.$(OBJEXT) +renameat_LDADD = $(LDADD) +renameat_DEPENDENCIES = libtests.a +renameat2_SOURCES = renameat2.c +renameat2_OBJECTS = renameat2.$(OBJEXT) +renameat2_LDADD = $(LDADD) +renameat2_DEPENDENCIES = libtests.a +request_key_SOURCES = request_key.c +request_key_OBJECTS = request_key.$(OBJEXT) +request_key_LDADD = $(LDADD) +request_key_DEPENDENCIES = libtests.a +restart_syscall_SOURCES = restart_syscall.c +restart_syscall_OBJECTS = restart_syscall.$(OBJEXT) +restart_syscall_LDADD = $(LDADD) +restart_syscall_DEPENDENCIES = libtests.a +rmdir_SOURCES = rmdir.c +rmdir_OBJECTS = rmdir.$(OBJEXT) +rmdir_LDADD = $(LDADD) +rmdir_DEPENDENCIES = libtests.a +rt_sigpending_SOURCES = rt_sigpending.c +rt_sigpending_OBJECTS = rt_sigpending.$(OBJEXT) +rt_sigpending_LDADD = $(LDADD) +rt_sigpending_DEPENDENCIES = libtests.a +rt_sigprocmask_SOURCES = rt_sigprocmask.c +rt_sigprocmask_OBJECTS = rt_sigprocmask.$(OBJEXT) +rt_sigprocmask_LDADD = $(LDADD) +rt_sigprocmask_DEPENDENCIES = libtests.a +rt_sigqueueinfo_SOURCES = rt_sigqueueinfo.c +rt_sigqueueinfo_OBJECTS = rt_sigqueueinfo.$(OBJEXT) +rt_sigqueueinfo_LDADD = $(LDADD) +rt_sigqueueinfo_DEPENDENCIES = libtests.a +rt_sigsuspend_SOURCES = rt_sigsuspend.c +rt_sigsuspend_OBJECTS = rt_sigsuspend.$(OBJEXT) +rt_sigsuspend_LDADD = $(LDADD) +rt_sigsuspend_DEPENDENCIES = libtests.a +rt_sigtimedwait_SOURCES = rt_sigtimedwait.c +rt_sigtimedwait_OBJECTS = rt_sigtimedwait.$(OBJEXT) +rt_sigtimedwait_LDADD = $(LDADD) +rt_sigtimedwait_DEPENDENCIES = libtests.a +rt_tgsigqueueinfo_SOURCES = rt_tgsigqueueinfo.c +rt_tgsigqueueinfo_OBJECTS = rt_tgsigqueueinfo.$(OBJEXT) +rt_tgsigqueueinfo_LDADD = $(LDADD) +rt_tgsigqueueinfo_DEPENDENCIES = libtests.a +sched_get_priority_mxx_SOURCES = sched_get_priority_mxx.c +sched_get_priority_mxx_OBJECTS = sched_get_priority_mxx.$(OBJEXT) +sched_get_priority_mxx_LDADD = $(LDADD) +sched_get_priority_mxx_DEPENDENCIES = libtests.a +sched_rr_get_interval_SOURCES = sched_rr_get_interval.c +sched_rr_get_interval_OBJECTS = sched_rr_get_interval.$(OBJEXT) +sched_rr_get_interval_LDADD = $(LDADD) +sched_rr_get_interval_DEPENDENCIES = libtests.a +sched_xetaffinity_SOURCES = sched_xetaffinity.c +sched_xetaffinity_OBJECTS = sched_xetaffinity.$(OBJEXT) +sched_xetaffinity_LDADD = $(LDADD) +sched_xetaffinity_DEPENDENCIES = libtests.a +sched_xetattr_SOURCES = sched_xetattr.c +sched_xetattr_OBJECTS = sched_xetattr.$(OBJEXT) +sched_xetattr_LDADD = $(LDADD) +sched_xetattr_DEPENDENCIES = libtests.a +sched_xetparam_SOURCES = sched_xetparam.c +sched_xetparam_OBJECTS = sched_xetparam.$(OBJEXT) +sched_xetparam_LDADD = $(LDADD) +sched_xetparam_DEPENDENCIES = libtests.a +sched_xetscheduler_SOURCES = sched_xetscheduler.c +sched_xetscheduler_OBJECTS = sched_xetscheduler.$(OBJEXT) +sched_xetscheduler_LDADD = $(LDADD) +sched_xetscheduler_DEPENDENCIES = libtests.a +sched_yield_SOURCES = sched_yield.c +sched_yield_OBJECTS = sched_yield.$(OBJEXT) +sched_yield_LDADD = $(LDADD) +sched_yield_DEPENDENCIES = libtests.a +scm_rights_SOURCES = scm_rights.c +scm_rights_OBJECTS = scm_rights.$(OBJEXT) +scm_rights_LDADD = $(LDADD) +scm_rights_DEPENDENCIES = libtests.a +seccomp_filter_SOURCES = seccomp-filter.c +seccomp_filter_OBJECTS = seccomp-filter.$(OBJEXT) +seccomp_filter_LDADD = $(LDADD) +seccomp_filter_DEPENDENCIES = libtests.a +seccomp_filter_v_SOURCES = seccomp-filter-v.c +seccomp_filter_v_OBJECTS = seccomp-filter-v.$(OBJEXT) +seccomp_filter_v_LDADD = $(LDADD) +seccomp_filter_v_DEPENDENCIES = libtests.a +seccomp_strict_SOURCES = seccomp-strict.c +seccomp_strict_OBJECTS = seccomp-strict.$(OBJEXT) +seccomp_strict_LDADD = $(LDADD) +seccomp_strict_DEPENDENCIES = libtests.a +select_SOURCES = select.c +select_OBJECTS = select.$(OBJEXT) +select_LDADD = $(LDADD) +select_DEPENDENCIES = libtests.a +semop_SOURCES = semop.c +semop_OBJECTS = semop.$(OBJEXT) +semop_LDADD = $(LDADD) +semop_DEPENDENCIES = libtests.a +sendfile_SOURCES = sendfile.c +sendfile_OBJECTS = sendfile.$(OBJEXT) +sendfile_LDADD = $(LDADD) +sendfile_DEPENDENCIES = libtests.a +sendfile64_SOURCES = sendfile64.c +sendfile64_OBJECTS = sendfile64.$(OBJEXT) +sendfile64_LDADD = $(LDADD) +sendfile64_DEPENDENCIES = libtests.a +set_mempolicy_SOURCES = set_mempolicy.c +set_mempolicy_OBJECTS = set_mempolicy.$(OBJEXT) +set_mempolicy_LDADD = $(LDADD) +set_mempolicy_DEPENDENCIES = libtests.a +set_ptracer_any_SOURCES = set_ptracer_any.c +set_ptracer_any_OBJECTS = set_ptracer_any.$(OBJEXT) +set_ptracer_any_LDADD = $(LDADD) +set_ptracer_any_DEPENDENCIES = libtests.a +setdomainname_SOURCES = setdomainname.c +setdomainname_OBJECTS = setdomainname.$(OBJEXT) +setdomainname_LDADD = $(LDADD) +setdomainname_DEPENDENCIES = libtests.a +setfsgid_SOURCES = setfsgid.c +setfsgid_OBJECTS = setfsgid.$(OBJEXT) +setfsgid_LDADD = $(LDADD) +setfsgid_DEPENDENCIES = libtests.a +setfsgid32_SOURCES = setfsgid32.c +setfsgid32_OBJECTS = setfsgid32.$(OBJEXT) +setfsgid32_LDADD = $(LDADD) +setfsgid32_DEPENDENCIES = libtests.a +setfsuid_SOURCES = setfsuid.c +setfsuid_OBJECTS = setfsuid.$(OBJEXT) +setfsuid_LDADD = $(LDADD) +setfsuid_DEPENDENCIES = libtests.a +setfsuid32_SOURCES = setfsuid32.c +setfsuid32_OBJECTS = setfsuid32.$(OBJEXT) +setfsuid32_LDADD = $(LDADD) +setfsuid32_DEPENDENCIES = libtests.a +setgid_SOURCES = setgid.c +setgid_OBJECTS = setgid.$(OBJEXT) +setgid_LDADD = $(LDADD) +setgid_DEPENDENCIES = libtests.a +setgid32_SOURCES = setgid32.c +setgid32_OBJECTS = setgid32.$(OBJEXT) +setgid32_LDADD = $(LDADD) +setgid32_DEPENDENCIES = libtests.a +setgroups_SOURCES = setgroups.c +setgroups_OBJECTS = setgroups.$(OBJEXT) +setgroups_LDADD = $(LDADD) +setgroups_DEPENDENCIES = libtests.a +setgroups32_SOURCES = setgroups32.c +setgroups32_OBJECTS = setgroups32.$(OBJEXT) +setgroups32_LDADD = $(LDADD) +setgroups32_DEPENDENCIES = libtests.a +sethostname_SOURCES = sethostname.c +sethostname_OBJECTS = sethostname.$(OBJEXT) +sethostname_LDADD = $(LDADD) +sethostname_DEPENDENCIES = libtests.a +setns_SOURCES = setns.c +setns_OBJECTS = setns.$(OBJEXT) +setns_LDADD = $(LDADD) +setns_DEPENDENCIES = libtests.a +setregid_SOURCES = setregid.c +setregid_OBJECTS = setregid.$(OBJEXT) +setregid_LDADD = $(LDADD) +setregid_DEPENDENCIES = libtests.a +setregid32_SOURCES = setregid32.c +setregid32_OBJECTS = setregid32.$(OBJEXT) +setregid32_LDADD = $(LDADD) +setregid32_DEPENDENCIES = libtests.a +setresgid_SOURCES = setresgid.c +setresgid_OBJECTS = setresgid.$(OBJEXT) +setresgid_LDADD = $(LDADD) +setresgid_DEPENDENCIES = libtests.a +setresgid32_SOURCES = setresgid32.c +setresgid32_OBJECTS = setresgid32.$(OBJEXT) +setresgid32_LDADD = $(LDADD) +setresgid32_DEPENDENCIES = libtests.a +setresuid_SOURCES = setresuid.c +setresuid_OBJECTS = setresuid.$(OBJEXT) +setresuid_LDADD = $(LDADD) +setresuid_DEPENDENCIES = libtests.a +setresuid32_SOURCES = setresuid32.c +setresuid32_OBJECTS = setresuid32.$(OBJEXT) +setresuid32_LDADD = $(LDADD) +setresuid32_DEPENDENCIES = libtests.a +setreuid_SOURCES = setreuid.c +setreuid_OBJECTS = setreuid.$(OBJEXT) +setreuid_LDADD = $(LDADD) +setreuid_DEPENDENCIES = libtests.a +setreuid32_SOURCES = setreuid32.c +setreuid32_OBJECTS = setreuid32.$(OBJEXT) +setreuid32_LDADD = $(LDADD) +setreuid32_DEPENDENCIES = libtests.a +setrlimit_SOURCES = setrlimit.c +setrlimit_OBJECTS = setrlimit.$(OBJEXT) +setrlimit_LDADD = $(LDADD) +setrlimit_DEPENDENCIES = libtests.a +setuid_SOURCES = setuid.c +setuid_OBJECTS = setuid.$(OBJEXT) +setuid_LDADD = $(LDADD) +setuid_DEPENDENCIES = libtests.a +setuid32_SOURCES = setuid32.c +setuid32_OBJECTS = setuid32.$(OBJEXT) +setuid32_LDADD = $(LDADD) +setuid32_DEPENDENCIES = libtests.a +shmxt_SOURCES = shmxt.c +shmxt_OBJECTS = shmxt.$(OBJEXT) +shmxt_LDADD = $(LDADD) +shmxt_DEPENDENCIES = libtests.a +shutdown_SOURCES = shutdown.c +shutdown_OBJECTS = shutdown.$(OBJEXT) +shutdown_LDADD = $(LDADD) +shutdown_DEPENDENCIES = libtests.a +sigaction_SOURCES = sigaction.c +sigaction_OBJECTS = sigaction.$(OBJEXT) +sigaction_LDADD = $(LDADD) +sigaction_DEPENDENCIES = libtests.a +sigaltstack_SOURCES = sigaltstack.c +sigaltstack_OBJECTS = sigaltstack.$(OBJEXT) +sigaltstack_LDADD = $(LDADD) +sigaltstack_DEPENDENCIES = libtests.a +siginfo_SOURCES = siginfo.c +siginfo_OBJECTS = siginfo.$(OBJEXT) +siginfo_LDADD = $(LDADD) +siginfo_DEPENDENCIES = libtests.a +signal_receive_SOURCES = signal_receive.c +signal_receive_OBJECTS = signal_receive.$(OBJEXT) +signal_receive_LDADD = $(LDADD) +signal_receive_DEPENDENCIES = libtests.a +signalfd4_SOURCES = signalfd4.c +signalfd4_OBJECTS = signalfd4.$(OBJEXT) +signalfd4_LDADD = $(LDADD) +signalfd4_DEPENDENCIES = libtests.a +sigreturn_SOURCES = sigreturn.c +sigreturn_OBJECTS = sigreturn.$(OBJEXT) +sigreturn_LDADD = $(LDADD) +sigreturn_DEPENDENCIES = libtests.a +sleep_SOURCES = sleep.c +sleep_OBJECTS = sleep.$(OBJEXT) +sleep_LDADD = $(LDADD) +sleep_DEPENDENCIES = libtests.a +socketcall_SOURCES = socketcall.c +socketcall_OBJECTS = socketcall.$(OBJEXT) +socketcall_LDADD = $(LDADD) +socketcall_DEPENDENCIES = libtests.a +splice_SOURCES = splice.c +splice_OBJECTS = splice.$(OBJEXT) +splice_LDADD = $(LDADD) +splice_DEPENDENCIES = libtests.a +am_stack_fcall_OBJECTS = stack-fcall.$(OBJEXT) stack-fcall-0.$(OBJEXT) \ + stack-fcall-1.$(OBJEXT) stack-fcall-2.$(OBJEXT) \ + stack-fcall-3.$(OBJEXT) +stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) +stack_fcall_LDADD = $(LDADD) +stack_fcall_DEPENDENCIES = libtests.a +stat_SOURCES = stat.c +stat_OBJECTS = stat.$(OBJEXT) +stat_LDADD = $(LDADD) +stat_DEPENDENCIES = libtests.a +stat64_SOURCES = stat64.c +stat64_OBJECTS = stat64-stat64.$(OBJEXT) +stat64_LDADD = $(LDADD) +stat64_DEPENDENCIES = libtests.a +statfs_SOURCES = statfs.c +statfs_OBJECTS = statfs-statfs.$(OBJEXT) +statfs_LDADD = $(LDADD) +statfs_DEPENDENCIES = libtests.a +statfs64_SOURCES = statfs64.c +statfs64_OBJECTS = statfs64.$(OBJEXT) +statfs64_LDADD = $(LDADD) +statfs64_DEPENDENCIES = libtests.a +swap_SOURCES = swap.c +swap_OBJECTS = swap.$(OBJEXT) +swap_LDADD = $(LDADD) +swap_DEPENDENCIES = libtests.a +symlink_SOURCES = symlink.c +symlink_OBJECTS = symlink.$(OBJEXT) +symlink_LDADD = $(LDADD) +symlink_DEPENDENCIES = libtests.a +symlinkat_SOURCES = symlinkat.c +symlinkat_OBJECTS = symlinkat.$(OBJEXT) +symlinkat_LDADD = $(LDADD) +symlinkat_DEPENDENCIES = libtests.a +sync_SOURCES = sync.c +sync_OBJECTS = sync.$(OBJEXT) +sync_LDADD = $(LDADD) +sync_DEPENDENCIES = libtests.a +sync_file_range_SOURCES = sync_file_range.c +sync_file_range_OBJECTS = sync_file_range.$(OBJEXT) +sync_file_range_LDADD = $(LDADD) +sync_file_range_DEPENDENCIES = libtests.a +sync_file_range2_SOURCES = sync_file_range2.c +sync_file_range2_OBJECTS = sync_file_range2.$(OBJEXT) +sync_file_range2_LDADD = $(LDADD) +sync_file_range2_DEPENDENCIES = libtests.a +sysinfo_SOURCES = sysinfo.c +sysinfo_OBJECTS = sysinfo.$(OBJEXT) +sysinfo_LDADD = $(LDADD) +sysinfo_DEPENDENCIES = libtests.a +syslog_SOURCES = syslog.c +syslog_OBJECTS = syslog.$(OBJEXT) +syslog_LDADD = $(LDADD) +syslog_DEPENDENCIES = libtests.a +tee_SOURCES = tee.c +tee_OBJECTS = tee.$(OBJEXT) +tee_LDADD = $(LDADD) +tee_DEPENDENCIES = libtests.a +threads_execve_SOURCES = threads-execve.c +threads_execve_OBJECTS = threads-execve.$(OBJEXT) +threads_execve_DEPENDENCIES = $(LDADD) +time_SOURCES = time.c +time_OBJECTS = time.$(OBJEXT) +time_LDADD = $(LDADD) +time_DEPENDENCIES = libtests.a +timer_create_SOURCES = timer_create.c +timer_create_OBJECTS = timer_create.$(OBJEXT) +timer_create_LDADD = $(LDADD) +timer_create_DEPENDENCIES = libtests.a +timer_xettime_SOURCES = timer_xettime.c +timer_xettime_OBJECTS = timer_xettime.$(OBJEXT) +timer_xettime_LDADD = $(LDADD) +timer_xettime_DEPENDENCIES = libtests.a +timerfd_xettime_SOURCES = timerfd_xettime.c +timerfd_xettime_OBJECTS = timerfd_xettime.$(OBJEXT) +timerfd_xettime_LDADD = $(LDADD) +timerfd_xettime_DEPENDENCIES = libtests.a +times_SOURCES = times.c +times_OBJECTS = times.$(OBJEXT) +times_DEPENDENCIES = $(LDADD) +times_fail_SOURCES = times-fail.c +times_fail_OBJECTS = times-fail.$(OBJEXT) +times_fail_LDADD = $(LDADD) +times_fail_DEPENDENCIES = libtests.a +truncate_SOURCES = truncate.c +truncate_OBJECTS = truncate.$(OBJEXT) +truncate_LDADD = $(LDADD) +truncate_DEPENDENCIES = libtests.a +truncate64_SOURCES = truncate64.c +truncate64_OBJECTS = truncate64-truncate64.$(OBJEXT) +truncate64_LDADD = $(LDADD) +truncate64_DEPENDENCIES = libtests.a +ugetrlimit_SOURCES = ugetrlimit.c +ugetrlimit_OBJECTS = ugetrlimit.$(OBJEXT) +ugetrlimit_LDADD = $(LDADD) +ugetrlimit_DEPENDENCIES = libtests.a +uio_SOURCES = uio.c +uio_OBJECTS = uio-uio.$(OBJEXT) +uio_LDADD = $(LDADD) +uio_DEPENDENCIES = libtests.a +umask_SOURCES = umask.c +umask_OBJECTS = umask.$(OBJEXT) +umask_LDADD = $(LDADD) +umask_DEPENDENCIES = libtests.a +umount_SOURCES = umount.c +umount_OBJECTS = umount.$(OBJEXT) +umount_LDADD = $(LDADD) +umount_DEPENDENCIES = libtests.a +umount2_SOURCES = umount2.c +umount2_OBJECTS = umount2.$(OBJEXT) +umount2_LDADD = $(LDADD) +umount2_DEPENDENCIES = libtests.a +umoven_illptr_SOURCES = umoven-illptr.c +umoven_illptr_OBJECTS = umoven-illptr.$(OBJEXT) +umoven_illptr_LDADD = $(LDADD) +umoven_illptr_DEPENDENCIES = libtests.a +umovestr_SOURCES = umovestr.c +umovestr_OBJECTS = umovestr.$(OBJEXT) +umovestr_LDADD = $(LDADD) +umovestr_DEPENDENCIES = libtests.a +umovestr_illptr_SOURCES = umovestr-illptr.c +umovestr_illptr_OBJECTS = umovestr-illptr.$(OBJEXT) +umovestr_illptr_LDADD = $(LDADD) +umovestr_illptr_DEPENDENCIES = libtests.a +umovestr2_SOURCES = umovestr2.c +umovestr2_OBJECTS = umovestr2.$(OBJEXT) +umovestr2_LDADD = $(LDADD) +umovestr2_DEPENDENCIES = libtests.a +umovestr3_SOURCES = umovestr3.c +umovestr3_OBJECTS = umovestr3.$(OBJEXT) +umovestr3_LDADD = $(LDADD) +umovestr3_DEPENDENCIES = libtests.a +uname_SOURCES = uname.c +uname_OBJECTS = uname.$(OBJEXT) +uname_LDADD = $(LDADD) +uname_DEPENDENCIES = libtests.a +unix_pair_send_recv_SOURCES = unix-pair-send-recv.c +unix_pair_send_recv_OBJECTS = unix-pair-send-recv.$(OBJEXT) +unix_pair_send_recv_LDADD = $(LDADD) +unix_pair_send_recv_DEPENDENCIES = libtests.a +unix_pair_sendto_recvfrom_SOURCES = unix-pair-sendto-recvfrom.c +unix_pair_sendto_recvfrom_OBJECTS = \ + unix-pair-sendto-recvfrom.$(OBJEXT) +unix_pair_sendto_recvfrom_LDADD = $(LDADD) +unix_pair_sendto_recvfrom_DEPENDENCIES = libtests.a +unlink_SOURCES = unlink.c +unlink_OBJECTS = unlink.$(OBJEXT) +unlink_LDADD = $(LDADD) +unlink_DEPENDENCIES = libtests.a +unlinkat_SOURCES = unlinkat.c +unlinkat_OBJECTS = unlinkat.$(OBJEXT) +unlinkat_LDADD = $(LDADD) +unlinkat_DEPENDENCIES = libtests.a +unshare_SOURCES = unshare.c +unshare_OBJECTS = unshare.$(OBJEXT) +unshare_LDADD = $(LDADD) +unshare_DEPENDENCIES = libtests.a +userfaultfd_SOURCES = userfaultfd.c +userfaultfd_OBJECTS = userfaultfd.$(OBJEXT) +userfaultfd_LDADD = $(LDADD) +userfaultfd_DEPENDENCIES = libtests.a +ustat_SOURCES = ustat.c +ustat_OBJECTS = ustat.$(OBJEXT) +ustat_LDADD = $(LDADD) +ustat_DEPENDENCIES = libtests.a +utime_SOURCES = utime.c +utime_OBJECTS = utime.$(OBJEXT) +utime_LDADD = $(LDADD) +utime_DEPENDENCIES = libtests.a +utimensat_SOURCES = utimensat.c +utimensat_OBJECTS = utimensat.$(OBJEXT) +utimensat_LDADD = $(LDADD) +utimensat_DEPENDENCIES = libtests.a +utimes_SOURCES = utimes.c +utimes_OBJECTS = utimes.$(OBJEXT) +utimes_LDADD = $(LDADD) +utimes_DEPENDENCIES = libtests.a +vfork_f_SOURCES = vfork-f.c +vfork_f_OBJECTS = vfork-f.$(OBJEXT) +vfork_f_LDADD = $(LDADD) +vfork_f_DEPENDENCIES = libtests.a +vhangup_SOURCES = vhangup.c +vhangup_OBJECTS = vhangup.$(OBJEXT) +vhangup_LDADD = $(LDADD) +vhangup_DEPENDENCIES = libtests.a +vmsplice_SOURCES = vmsplice.c +vmsplice_OBJECTS = vmsplice.$(OBJEXT) +vmsplice_LDADD = $(LDADD) +vmsplice_DEPENDENCIES = libtests.a +wait4_SOURCES = wait4.c +wait4_OBJECTS = wait4.$(OBJEXT) +wait4_LDADD = $(LDADD) +wait4_DEPENDENCIES = libtests.a +wait4_v_SOURCES = wait4-v.c +wait4_v_OBJECTS = wait4-v.$(OBJEXT) +wait4_v_LDADD = $(LDADD) +wait4_v_DEPENDENCIES = libtests.a +waitid_SOURCES = waitid.c +waitid_OBJECTS = waitid.$(OBJEXT) +waitid_LDADD = $(LDADD) +waitid_DEPENDENCIES = libtests.a +waitid_v_SOURCES = waitid-v.c +waitid_v_OBJECTS = waitid-v.$(OBJEXT) +waitid_v_LDADD = $(LDADD) +waitid_v_DEPENDENCIES = libtests.a +waitpid_SOURCES = waitpid.c +waitpid_OBJECTS = waitpid.$(OBJEXT) +waitpid_LDADD = $(LDADD) +waitpid_DEPENDENCIES = libtests.a +xattr_SOURCES = xattr.c +xattr_OBJECTS = xattr.$(OBJEXT) +xattr_LDADD = $(LDADD) +xattr_DEPENDENCIES = libtests.a +xattr_strings_SOURCES = xattr-strings.c +xattr_strings_OBJECTS = xattr-strings.$(OBJEXT) +xattr_strings_LDADD = $(LDADD) +xattr_strings_DEPENDENCIES = libtests.a +xet_robust_list_SOURCES = xet_robust_list.c +xet_robust_list_OBJECTS = xet_robust_list.$(OBJEXT) +xet_robust_list_LDADD = $(LDADD) +xet_robust_list_DEPENDENCIES = libtests.a +xetitimer_SOURCES = xetitimer.c +xetitimer_OBJECTS = xetitimer.$(OBJEXT) +xetitimer_LDADD = $(LDADD) +xetitimer_DEPENDENCIES = libtests.a +xetpgid_SOURCES = xetpgid.c +xetpgid_OBJECTS = xetpgid.$(OBJEXT) +xetpgid_LDADD = $(LDADD) +xetpgid_DEPENDENCIES = libtests.a +xetpriority_SOURCES = xetpriority.c +xetpriority_OBJECTS = xetpriority.$(OBJEXT) +xetpriority_LDADD = $(LDADD) +xetpriority_DEPENDENCIES = libtests.a +xettimeofday_SOURCES = xettimeofday.c +xettimeofday_OBJECTS = xettimeofday.$(OBJEXT) +xettimeofday_LDADD = $(LDADD) +xettimeofday_DEPENDENCIES = libtests.a +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ + access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ + attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ + attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ + chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ + clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ + creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ + epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ + erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ + execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ + fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ + fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ + finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ + fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ + futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ + getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ + geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ + getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ + getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ + init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ + ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ + ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ + ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ + ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ + kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ + lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ + migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ + mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ + msg_control.c msg_control-v.c msg_name.c munlockall.c \ + nanosleep.c net-accept-connect.c net-icmp_filter.c \ + net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ + net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ + netlink_protocol.c netlink_unix_diag.c newfstatat.c \ + nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ + oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ + perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ + personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ + pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + prctl-dumpable.c prctl-name.c prctl-no-args.c \ + prctl-pdeathsig.c prctl-seccomp-filter-v.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ + prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ + preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ + process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + pwritev.c qual_fault.c qual_inject-error-signal.c \ + qual_inject-retval.c qual_inject-signal.c qual_signal.c \ + quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ + read-write.c readahead.c readdir.c readlink.c readlinkat.c \ + readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ + redirect-fds.c remap_file_pages.c rename.c renameat.c \ + renameat2.c request_key.c restart_syscall.c rmdir.c \ + rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + sched_get_priority_mxx.c sched_rr_get_interval.c \ + sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ + sched_xetscheduler.c sched_yield.c scm_rights.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ + semop.c sendfile.c sendfile64.c set_mempolicy.c \ + set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ + setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ + setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ + setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ + setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ + shutdown.c sigaction.c sigaltstack.c siginfo.c \ + signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ + splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ + statfs64.c swap.c symlink.c symlinkat.c sync.c \ + sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ + threads-execve.c time.c timer_create.c timer_xettime.c \ + timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ + ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ + umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ + unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ + utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ + waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ + xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c +DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ + access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ + attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ + attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ + chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ + clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ + creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ + epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ + erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ + execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ + fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ + fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ + finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ + fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ + futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ + getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ + geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ + getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ + getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ + init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ + ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ + ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ + ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ + ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ + kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ + lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ + migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ + mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ + msg_control.c msg_control-v.c msg_name.c munlockall.c \ + nanosleep.c net-accept-connect.c net-icmp_filter.c \ + net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ + net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ + netlink_protocol.c netlink_unix_diag.c newfstatat.c \ + nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ + oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ + perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ + personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ + pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + prctl-dumpable.c prctl-name.c prctl-no-args.c \ + prctl-pdeathsig.c prctl-seccomp-filter-v.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ + prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ + preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ + process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + pwritev.c qual_fault.c qual_inject-error-signal.c \ + qual_inject-retval.c qual_inject-signal.c qual_signal.c \ + quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ + read-write.c readahead.c readdir.c readlink.c readlinkat.c \ + readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ + redirect-fds.c remap_file_pages.c rename.c renameat.c \ + renameat2.c request_key.c restart_syscall.c rmdir.c \ + rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + sched_get_priority_mxx.c sched_rr_get_interval.c \ + sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ + sched_xetscheduler.c sched_yield.c scm_rights.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ + semop.c sendfile.c sendfile64.c set_mempolicy.c \ + set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ + setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ + setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ + setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ + setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ + shutdown.c sigaction.c sigaltstack.c siginfo.c \ + signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ + splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ + statfs64.c swap.c symlink.c symlinkat.c sync.c \ + sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ + threads-execve.c time.c timer_create.c timer_xettime.c \ + timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ + ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ + umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ + unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ + utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ + waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ + xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +@USE_LIBUNWIND_TRUE@am__EXEEXT_1 = strace-k.test +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CYGPATH_W = @CYGPATH_W@ +DEB_CHANGELOGTIME = @DEB_CHANGELOGTIME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +EXEEXT = @EXEEXT@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MIPS_ABI = @MIPS_ABI@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +RANLIB = @RANLIB@ +RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +arch = @arch@ +arch_m32 = @arch_m32@ +arch_mx32 = @arch_mx32@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +dl_LIBS = @dl_LIBS@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libunwind_CPPFLAGS = @libunwind_CPPFLAGS@ +libunwind_LDFLAGS = @libunwind_LDFLAGS@ +libunwind_LIBS = @libunwind_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +OS = linux +ARCH = @arch_m32@ +MPERS_NAME = m32 +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -m32 +AM_CFLAGS = $(WARN_CFLAGS) +AM_CPPFLAGS = $(ARCH_MFLAGS) \ + -I$(builddir) \ + -I$(top_builddir)/$(OS)/$(ARCH) \ + -I$(top_srcdir)/$(OS)/$(ARCH) \ + -I$(top_builddir)/$(OS) \ + -I$(top_srcdir)/$(OS) \ + -I$(top_builddir) \ + -I$(top_srcdir) + +AM_LDFLAGS = $(ARCH_MFLAGS) +libtests_a_SOURCES = \ + errno2name.c \ + error_msg.c \ + fill_memory.c \ + get_page_size.c \ + hexdump_strdup.c \ + hexquote_strndup.c \ + inode_of_sockfd.c \ + libmmsg.c \ + libsocketcall.c \ + overflowuid.c \ + pipe_maxfd.c \ + print_quoted_string.c \ + printflags.c \ + printxval.c \ + signal2name.c \ + sprintrc.c \ + tail_alloc.c \ + tests.h \ + tprintf.c \ + # end of libtests_a_SOURCES + +libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +check_LIBRARIES = libtests.a +LDADD = libtests.a +attach_f_p_LDADD = -lrt -lpthread $(LDADD) +clock_xettime_LDADD = -lrt $(LDADD) +count_f_LDADD = -lpthread $(LDADD) +filter_unavailable_LDADD = -lpthread $(LDADD) +fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = -lrt $(LDADD) +mq_sendrecv_LDADD = -lrt $(LDADD) +mq_sendrecv_read_LDADD = -lrt $(LDADD) +mq_sendrecv_write_LDADD = -lrt $(LDADD) +newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pc_LDADD = $(dl_LIBS) $(LDADD) +pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +threads_execve_LDADD = -lrt -lpthread $(LDADD) +times_LDADD = -lrt $(LDADD) +truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + +@USE_LIBUNWIND_FALSE@LIBUNWIND_TESTS = +@USE_LIBUNWIND_TRUE@LIBUNWIND_TESTS = strace-k.test +DECODER_TESTS = \ + _newselect.test \ + accept.test \ + accept4.test \ + access.test \ + acct.test \ + add_key.test \ + adjtimex.test \ + aio.test \ + alarm.test \ + bpf.test \ + brk.test \ + btrfs-v.test \ + btrfs-vw.test \ + btrfs-w.test \ + btrfs.test \ + caps-abbrev.test \ + caps.test \ + chmod.test \ + chown.test \ + chown32.test \ + chroot.test \ + clock_adjtime.test \ + clock_nanosleep.test \ + clock_xettime.test \ + copy_file_range.test \ + creat.test \ + delete_module.test \ + dup.test \ + dup2.test \ + dup3.test \ + epoll_create.test \ + epoll_create1.test \ + epoll_ctl.test \ + epoll_pwait.test \ + epoll_wait.test \ + erestartsys.test \ + eventfd.test \ + execve-v.test \ + execve.test \ + execveat-v.test \ + execveat.test \ + faccessat.test \ + fadvise64.test \ + fadvise64_64.test \ + fallocate.test \ + fanotify_init.test \ + fanotify_mark.test \ + fchdir.test \ + fchmod.test \ + fchmodat.test \ + fchown.test \ + fchown32.test \ + fchownat.test \ + fcntl.test \ + fcntl64.test \ + fdatasync.test \ + file_handle.test \ + file_ioctl.test \ + finit_module.test \ + flock.test \ + fstat.test \ + fstat64.test \ + fstatat64.test \ + fstatfs.test \ + fstatfs64.test \ + fsync.test \ + ftruncate.test \ + ftruncate64.test \ + futex.test \ + futimesat.test \ + get_mempolicy.test \ + getcpu.test \ + getcwd.test \ + getdents.test \ + getdents64.test \ + getegid.test \ + getegid32.test \ + geteuid.test \ + geteuid32.test \ + getgid.test \ + getgid32.test \ + getgroups.test \ + getgroups32.test \ + getpeername.test \ + getpgrp.test \ + getrandom.test \ + getresgid.test \ + getresgid32.test \ + getresuid.test \ + getresuid32.test \ + getrlimit.test \ + getrusage.test \ + getsid.test \ + getsockname.test \ + getuid.test \ + getuid32.test \ + getxxid.test \ + inet-cmsg.test \ + init_module.test \ + inotify.test \ + inotify_init1.test \ + ioctl.test \ + ioctl_block.test \ + ioctl_dm-v.test \ + ioctl_dm.test \ + ioctl_evdev-v.test \ + ioctl_evdev.test \ + ioctl_loop-nv.test \ + ioctl_loop-v.test \ + ioctl_loop.test \ + ioctl_mtd.test \ + ioctl_rtc-v.test \ + ioctl_rtc.test \ + ioctl_scsi.test \ + ioctl_sg_io_v3.test \ + ioctl_sg_io_v4.test \ + ioctl_sock_gifconf.test \ + ioctl_uffdio.test \ + ioctl_v4l2.test \ + ioperm.test \ + iopl.test \ + ioprio.test \ + ip_mreq.test \ + ipc.test \ + ipc_msg.test \ + ipc_msgbuf.test \ + ipc_sem.test \ + ipc_shm.test \ + kcmp.test \ + kexec_file_load.test \ + kexec_load.test \ + keyctl.test \ + kill.test \ + lchown.test \ + lchown32.test \ + link.test \ + linkat.test \ + llseek.test \ + lookup_dcookie.test \ + lseek.test \ + lstat.test \ + lstat64.test \ + mbind.test \ + membarrier.test \ + memfd_create.test \ + migrate_pages.test \ + mincore.test \ + mkdir.test \ + mkdirat.test \ + mknod.test \ + mknodat.test \ + mlock.test \ + mlock2.test \ + mlockall.test \ + mmap.test \ + mmap64.test \ + mmsg-silent.test \ + mmsg.test \ + mmsg_name-v.test \ + mmsg_name.test \ + mount.test \ + move_pages.test \ + mq.test \ + mq_sendrecv-read.test \ + mq_sendrecv-write.test \ + mq_sendrecv.test \ + msg_control-v.test \ + msg_control.test \ + msg_name.test \ + munlockall.test \ + nanosleep.test \ + net-icmp_filter.test \ + net-sockaddr.test \ + net-y-unix.test \ + net-yy-inet.test \ + net-yy-netlink.test \ + net-yy-unix.test \ + net.test \ + netlink_protocol.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ + oldfstat.test \ + oldlstat.test \ + oldselect.test \ + oldstat.test \ + open.test \ + openat.test \ + pause.test \ + perf_event_open.test \ + perf_event_open_nonverbose.test \ + perf_event_open_unabbrev.test \ + personality.test \ + pipe.test \ + pipe2.test \ + pkey_alloc.test \ + pkey_free.test \ + pkey_mprotect.test \ + poll.test \ + ppoll.test \ + prctl-arg2-intptr.test \ + prctl-dumpable.test \ + prctl-name.test \ + prctl-no-args.test \ + prctl-pdeathsig.test \ + prctl-seccomp-filter-v.test \ + prctl-seccomp-strict.test \ + prctl-securebits.test \ + prctl-tid_address.test \ + prctl-tsc.test \ + pread64-pwrite64.test \ + preadv-pwritev.test \ + preadv.test \ + preadv2-pwritev2.test \ + printstr.test \ + prlimit64.test \ + process_vm_readv.test \ + process_vm_writev.test \ + pselect6.test \ + ptrace.test \ + pwritev.test \ + qual_fault-exit_group.test \ + quotactl-v.test \ + quotactl-xfs-v.test \ + quotactl-xfs.test \ + quotactl.test \ + read-write.test \ + readahead.test \ + readdir.test \ + readlink.test \ + readlinkat.test \ + readv.test \ + reboot.test \ + recvfrom.test \ + recvmmsg-timeout.test \ + recvmsg.test \ + remap_file_pages.test \ + rename.test \ + renameat.test \ + renameat2.test \ + request_key.test \ + rmdir.test \ + rt_sigpending.test \ + rt_sigprocmask.test \ + rt_sigqueueinfo.test \ + rt_sigsuspend.test \ + rt_sigtimedwait.test \ + rt_tgsigqueueinfo.test \ + sched_get_priority_mxx.test \ + sched_rr_get_interval.test \ + sched_xetaffinity.test \ + sched_xetattr.test \ + sched_xetparam.test \ + sched_xetscheduler.test \ + sched_yield.test \ + scm_rights-fd.test \ + seccomp-filter-v.test \ + seccomp-filter.test \ + seccomp-strict.test \ + select.test \ + semop.test \ + sendfile.test \ + sendfile64.test \ + set_mempolicy.test \ + setdomainname.test \ + setfsgid.test \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ + setgid.test \ + setgid32.test \ + setgroups.test \ + setgroups32.test \ + sethostname.test \ + setns.test \ + setregid.test \ + setregid32.test \ + setresgid.test \ + setresgid32.test \ + setresuid.test \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ + setrlimit.test \ + setuid.test \ + setuid32.test \ + shmxt.test \ + shutdown.test \ + sigaction.test \ + sigaltstack.test \ + siginfo.test \ + signalfd4.test \ + sigreturn.test \ + socketcall.test \ + splice.test \ + stat.test \ + stat64.test \ + statfs.test \ + statfs64.test \ + sun_path.test \ + swap.test \ + symlink.test \ + symlinkat.test \ + sync.test \ + sync_file_range.test \ + sync_file_range2.test \ + sysinfo.test \ + syslog.test \ + tee.test \ + time.test \ + timer_create.test \ + timer_xettime.test \ + timerfd_xettime.test \ + times-fail.test \ + times.test \ + truncate.test \ + truncate64.test \ + ugetrlimit.test \ + uio.test \ + umask.test \ + umount.test \ + umount2.test \ + umoven-illptr.test \ + umovestr-illptr.test \ + umovestr.test \ + umovestr2.test \ + umovestr3.test \ + uname.test \ + unix-pair-send-recv.test \ + unix-pair-sendto-recvfrom.test \ + unlink.test \ + unlinkat.test \ + unshare.test \ + userfaultfd.test \ + ustat.test \ + utime.test \ + utimensat.test \ + utimes.test \ + vhangup.test \ + vmsplice.test \ + wait4-v.test \ + wait4.test \ + waitid-v.test \ + waitid.test \ + waitpid.test \ + xattr-strings.test \ + xattr.test \ + xet_robust_list.test \ + xetitimer.test \ + xetpgid.test \ + xetpriority.test \ + xettimeofday.test \ + # end of DECODER_TESTS + +MISC_TESTS = \ + attach-f-p.test \ + attach-p-cmd.test \ + bexecve.test \ + count-f.test \ + count.test \ + detach-running.test \ + detach-sleeping.test \ + detach-stopped.test \ + filter-unavailable.test \ + fork-f.test \ + ksysent.test \ + opipe.test \ + options-syntax.test \ + pc.test \ + qual_fault-syntax.test \ + qual_fault.test \ + qual_inject-error-signal.test \ + qual_inject-retval.test \ + qual_inject-signal.test \ + qual_inject-syntax.test \ + qual_signal.test \ + qual_syscall.test \ + redirect-fds.test \ + redirect.test \ + restart_syscall.test \ + signal_receive.test \ + strace-C.test \ + strace-E.test \ + strace-S.test \ + strace-T.test \ + strace-V.test \ + strace-ff.test \ + strace-r.test \ + strace-t.test \ + strace-tt.test \ + strace-ttt.test \ + threads-execve.test \ + vfork-f.test \ + # end of MISC_TESTS + +XFAIL_TESTS_ = +XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +TEST_LOG_COMPILER = env +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +VALGRIND_FLAGS = --quiet +VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp +EXTRA_DIST = init.sh run.sh match.awk \ + caps-abbrev.awk \ + caps.awk \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + getresugid.c \ + init_delete_module.h \ + ipc.sh \ + ipc_msgbuf.expected \ + ksysent.sed \ + lstatx.c \ + net.expected \ + oldselect.expected \ + pipe.expected \ + ppoll-v.expected \ + ppoll.expected \ + process_vm_readv_writev.c \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + quotactl.h \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaction.awk \ + sigaltstack.expected \ + sockname.c \ + statfs.expected \ + statx.sh \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + struct_flock.c \ + sun_path.expected \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + $(TESTS) + +objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) +CLEANFILES = ksysent.h $(TESTS:=.tmp) syscallent.i scno.h +SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) + +digits = [[:digit:]][[:digit:]]* +al_nums = [[:alnum:]_][[:alnum:]_]* +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../scno.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests-m32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tests-m32/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(srcdir)/../scno.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkLIBRARIES: + -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) + +libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) + $(AM_V_at)-rm -f libtests.a + $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) + $(AM_V_at)$(RANLIB) libtests.a + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + +_newselect$(EXEEXT): $(_newselect_OBJECTS) $(_newselect_DEPENDENCIES) $(EXTRA__newselect_DEPENDENCIES) + @rm -f _newselect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(_newselect_OBJECTS) $(_newselect_LDADD) $(LIBS) + +accept$(EXEEXT): $(accept_OBJECTS) $(accept_DEPENDENCIES) $(EXTRA_accept_DEPENDENCIES) + @rm -f accept$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(accept_OBJECTS) $(accept_LDADD) $(LIBS) + +accept4$(EXEEXT): $(accept4_OBJECTS) $(accept4_DEPENDENCIES) $(EXTRA_accept4_DEPENDENCIES) + @rm -f accept4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(accept4_OBJECTS) $(accept4_LDADD) $(LIBS) + +access$(EXEEXT): $(access_OBJECTS) $(access_DEPENDENCIES) $(EXTRA_access_DEPENDENCIES) + @rm -f access$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(access_OBJECTS) $(access_LDADD) $(LIBS) + +acct$(EXEEXT): $(acct_OBJECTS) $(acct_DEPENDENCIES) $(EXTRA_acct_DEPENDENCIES) + @rm -f acct$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(acct_OBJECTS) $(acct_LDADD) $(LIBS) + +add_key$(EXEEXT): $(add_key_OBJECTS) $(add_key_DEPENDENCIES) $(EXTRA_add_key_DEPENDENCIES) + @rm -f add_key$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(add_key_OBJECTS) $(add_key_LDADD) $(LIBS) + +adjtimex$(EXEEXT): $(adjtimex_OBJECTS) $(adjtimex_DEPENDENCIES) $(EXTRA_adjtimex_DEPENDENCIES) + @rm -f adjtimex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(adjtimex_OBJECTS) $(adjtimex_LDADD) $(LIBS) + +aio$(EXEEXT): $(aio_OBJECTS) $(aio_DEPENDENCIES) $(EXTRA_aio_DEPENDENCIES) + @rm -f aio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aio_OBJECTS) $(aio_LDADD) $(LIBS) + +alarm$(EXEEXT): $(alarm_OBJECTS) $(alarm_DEPENDENCIES) $(EXTRA_alarm_DEPENDENCIES) + @rm -f alarm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(alarm_OBJECTS) $(alarm_LDADD) $(LIBS) + +answer$(EXEEXT): $(answer_OBJECTS) $(answer_DEPENDENCIES) $(EXTRA_answer_DEPENDENCIES) + @rm -f answer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(answer_OBJECTS) $(answer_LDADD) $(LIBS) + +attach-f-p$(EXEEXT): $(attach_f_p_OBJECTS) $(attach_f_p_DEPENDENCIES) $(EXTRA_attach_f_p_DEPENDENCIES) + @rm -f attach-f-p$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_f_p_OBJECTS) $(attach_f_p_LDADD) $(LIBS) + +attach-f-p-cmd$(EXEEXT): $(attach_f_p_cmd_OBJECTS) $(attach_f_p_cmd_DEPENDENCIES) $(EXTRA_attach_f_p_cmd_DEPENDENCIES) + @rm -f attach-f-p-cmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_f_p_cmd_OBJECTS) $(attach_f_p_cmd_LDADD) $(LIBS) + +attach-p-cmd-cmd$(EXEEXT): $(attach_p_cmd_cmd_OBJECTS) $(attach_p_cmd_cmd_DEPENDENCIES) $(EXTRA_attach_p_cmd_cmd_DEPENDENCIES) + @rm -f attach-p-cmd-cmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_p_cmd_cmd_OBJECTS) $(attach_p_cmd_cmd_LDADD) $(LIBS) + +attach-p-cmd-p$(EXEEXT): $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_DEPENDENCIES) $(EXTRA_attach_p_cmd_p_DEPENDENCIES) + @rm -f attach-p-cmd-p$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_LDADD) $(LIBS) + +bpf$(EXEEXT): $(bpf_OBJECTS) $(bpf_DEPENDENCIES) $(EXTRA_bpf_DEPENDENCIES) + @rm -f bpf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_OBJECTS) $(bpf_LDADD) $(LIBS) + +brk$(EXEEXT): $(brk_OBJECTS) $(brk_DEPENDENCIES) $(EXTRA_brk_DEPENDENCIES) + @rm -f brk$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(brk_OBJECTS) $(brk_LDADD) $(LIBS) + +btrfs$(EXEEXT): $(btrfs_OBJECTS) $(btrfs_DEPENDENCIES) $(EXTRA_btrfs_DEPENDENCIES) + @rm -f btrfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(btrfs_OBJECTS) $(btrfs_LDADD) $(LIBS) + +caps$(EXEEXT): $(caps_OBJECTS) $(caps_DEPENDENCIES) $(EXTRA_caps_DEPENDENCIES) + @rm -f caps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(caps_OBJECTS) $(caps_LDADD) $(LIBS) + +caps-abbrev$(EXEEXT): $(caps_abbrev_OBJECTS) $(caps_abbrev_DEPENDENCIES) $(EXTRA_caps_abbrev_DEPENDENCIES) + @rm -f caps-abbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(caps_abbrev_OBJECTS) $(caps_abbrev_LDADD) $(LIBS) + +chmod$(EXEEXT): $(chmod_OBJECTS) $(chmod_DEPENDENCIES) $(EXTRA_chmod_DEPENDENCIES) + @rm -f chmod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) + +chown$(EXEEXT): $(chown_OBJECTS) $(chown_DEPENDENCIES) $(EXTRA_chown_DEPENDENCIES) + @rm -f chown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chown_OBJECTS) $(chown_LDADD) $(LIBS) + +chown32$(EXEEXT): $(chown32_OBJECTS) $(chown32_DEPENDENCIES) $(EXTRA_chown32_DEPENDENCIES) + @rm -f chown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chown32_OBJECTS) $(chown32_LDADD) $(LIBS) + +chroot$(EXEEXT): $(chroot_OBJECTS) $(chroot_DEPENDENCIES) $(EXTRA_chroot_DEPENDENCIES) + @rm -f chroot$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chroot_OBJECTS) $(chroot_LDADD) $(LIBS) + +clock_adjtime$(EXEEXT): $(clock_adjtime_OBJECTS) $(clock_adjtime_DEPENDENCIES) $(EXTRA_clock_adjtime_DEPENDENCIES) + @rm -f clock_adjtime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_adjtime_OBJECTS) $(clock_adjtime_LDADD) $(LIBS) + +clock_nanosleep$(EXEEXT): $(clock_nanosleep_OBJECTS) $(clock_nanosleep_DEPENDENCIES) $(EXTRA_clock_nanosleep_DEPENDENCIES) + @rm -f clock_nanosleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_nanosleep_OBJECTS) $(clock_nanosleep_LDADD) $(LIBS) + +clock_xettime$(EXEEXT): $(clock_xettime_OBJECTS) $(clock_xettime_DEPENDENCIES) $(EXTRA_clock_xettime_DEPENDENCIES) + @rm -f clock_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_xettime_OBJECTS) $(clock_xettime_LDADD) $(LIBS) + +copy_file_range$(EXEEXT): $(copy_file_range_OBJECTS) $(copy_file_range_DEPENDENCIES) $(EXTRA_copy_file_range_DEPENDENCIES) + @rm -f copy_file_range$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(copy_file_range_OBJECTS) $(copy_file_range_LDADD) $(LIBS) + +count-f$(EXEEXT): $(count_f_OBJECTS) $(count_f_DEPENDENCIES) $(EXTRA_count_f_DEPENDENCIES) + @rm -f count-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(count_f_OBJECTS) $(count_f_LDADD) $(LIBS) + +creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIES) + @rm -f creat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS) + +delete_module$(EXEEXT): $(delete_module_OBJECTS) $(delete_module_DEPENDENCIES) $(EXTRA_delete_module_DEPENDENCIES) + @rm -f delete_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(delete_module_OBJECTS) $(delete_module_LDADD) $(LIBS) + +dup$(EXEEXT): $(dup_OBJECTS) $(dup_DEPENDENCIES) $(EXTRA_dup_DEPENDENCIES) + @rm -f dup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup_OBJECTS) $(dup_LDADD) $(LIBS) + +dup2$(EXEEXT): $(dup2_OBJECTS) $(dup2_DEPENDENCIES) $(EXTRA_dup2_DEPENDENCIES) + @rm -f dup2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup2_OBJECTS) $(dup2_LDADD) $(LIBS) + +dup3$(EXEEXT): $(dup3_OBJECTS) $(dup3_DEPENDENCIES) $(EXTRA_dup3_DEPENDENCIES) + @rm -f dup3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup3_OBJECTS) $(dup3_LDADD) $(LIBS) + +epoll_create$(EXEEXT): $(epoll_create_OBJECTS) $(epoll_create_DEPENDENCIES) $(EXTRA_epoll_create_DEPENDENCIES) + @rm -f epoll_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_create_OBJECTS) $(epoll_create_LDADD) $(LIBS) + +epoll_create1$(EXEEXT): $(epoll_create1_OBJECTS) $(epoll_create1_DEPENDENCIES) $(EXTRA_epoll_create1_DEPENDENCIES) + @rm -f epoll_create1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_create1_OBJECTS) $(epoll_create1_LDADD) $(LIBS) + +epoll_ctl$(EXEEXT): $(epoll_ctl_OBJECTS) $(epoll_ctl_DEPENDENCIES) $(EXTRA_epoll_ctl_DEPENDENCIES) + @rm -f epoll_ctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_ctl_OBJECTS) $(epoll_ctl_LDADD) $(LIBS) + +epoll_pwait$(EXEEXT): $(epoll_pwait_OBJECTS) $(epoll_pwait_DEPENDENCIES) $(EXTRA_epoll_pwait_DEPENDENCIES) + @rm -f epoll_pwait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_pwait_OBJECTS) $(epoll_pwait_LDADD) $(LIBS) + +epoll_wait$(EXEEXT): $(epoll_wait_OBJECTS) $(epoll_wait_DEPENDENCIES) $(EXTRA_epoll_wait_DEPENDENCIES) + @rm -f epoll_wait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_wait_OBJECTS) $(epoll_wait_LDADD) $(LIBS) + +erestartsys$(EXEEXT): $(erestartsys_OBJECTS) $(erestartsys_DEPENDENCIES) $(EXTRA_erestartsys_DEPENDENCIES) + @rm -f erestartsys$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(erestartsys_OBJECTS) $(erestartsys_LDADD) $(LIBS) + +eventfd$(EXEEXT): $(eventfd_OBJECTS) $(eventfd_DEPENDENCIES) $(EXTRA_eventfd_DEPENDENCIES) + @rm -f eventfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eventfd_OBJECTS) $(eventfd_LDADD) $(LIBS) + +execve$(EXEEXT): $(execve_OBJECTS) $(execve_DEPENDENCIES) $(EXTRA_execve_DEPENDENCIES) + @rm -f execve$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execve_OBJECTS) $(execve_LDADD) $(LIBS) + +execve-v$(EXEEXT): $(execve_v_OBJECTS) $(execve_v_DEPENDENCIES) $(EXTRA_execve_v_DEPENDENCIES) + @rm -f execve-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execve_v_OBJECTS) $(execve_v_LDADD) $(LIBS) + +execveat$(EXEEXT): $(execveat_OBJECTS) $(execveat_DEPENDENCIES) $(EXTRA_execveat_DEPENDENCIES) + @rm -f execveat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execveat_OBJECTS) $(execveat_LDADD) $(LIBS) + +execveat-v$(EXEEXT): $(execveat_v_OBJECTS) $(execveat_v_DEPENDENCIES) $(EXTRA_execveat_v_DEPENDENCIES) + @rm -f execveat-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execveat_v_OBJECTS) $(execveat_v_LDADD) $(LIBS) + +faccessat$(EXEEXT): $(faccessat_OBJECTS) $(faccessat_DEPENDENCIES) $(EXTRA_faccessat_DEPENDENCIES) + @rm -f faccessat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(faccessat_OBJECTS) $(faccessat_LDADD) $(LIBS) + +fadvise64$(EXEEXT): $(fadvise64_OBJECTS) $(fadvise64_DEPENDENCIES) $(EXTRA_fadvise64_DEPENDENCIES) + @rm -f fadvise64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fadvise64_OBJECTS) $(fadvise64_LDADD) $(LIBS) + +fadvise64_64$(EXEEXT): $(fadvise64_64_OBJECTS) $(fadvise64_64_DEPENDENCIES) $(EXTRA_fadvise64_64_DEPENDENCIES) + @rm -f fadvise64_64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fadvise64_64_OBJECTS) $(fadvise64_64_LDADD) $(LIBS) + +fallocate$(EXEEXT): $(fallocate_OBJECTS) $(fallocate_DEPENDENCIES) $(EXTRA_fallocate_DEPENDENCIES) + @rm -f fallocate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fallocate_OBJECTS) $(fallocate_LDADD) $(LIBS) + +fanotify_init$(EXEEXT): $(fanotify_init_OBJECTS) $(fanotify_init_DEPENDENCIES) $(EXTRA_fanotify_init_DEPENDENCIES) + @rm -f fanotify_init$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_init_OBJECTS) $(fanotify_init_LDADD) $(LIBS) + +fanotify_mark$(EXEEXT): $(fanotify_mark_OBJECTS) $(fanotify_mark_DEPENDENCIES) $(EXTRA_fanotify_mark_DEPENDENCIES) + @rm -f fanotify_mark$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_OBJECTS) $(fanotify_mark_LDADD) $(LIBS) + +fchdir$(EXEEXT): $(fchdir_OBJECTS) $(fchdir_DEPENDENCIES) $(EXTRA_fchdir_DEPENDENCIES) + @rm -f fchdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchdir_OBJECTS) $(fchdir_LDADD) $(LIBS) + +fchmod$(EXEEXT): $(fchmod_OBJECTS) $(fchmod_DEPENDENCIES) $(EXTRA_fchmod_DEPENDENCIES) + @rm -f fchmod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchmod_OBJECTS) $(fchmod_LDADD) $(LIBS) + +fchmodat$(EXEEXT): $(fchmodat_OBJECTS) $(fchmodat_DEPENDENCIES) $(EXTRA_fchmodat_DEPENDENCIES) + @rm -f fchmodat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchmodat_OBJECTS) $(fchmodat_LDADD) $(LIBS) + +fchown$(EXEEXT): $(fchown_OBJECTS) $(fchown_DEPENDENCIES) $(EXTRA_fchown_DEPENDENCIES) + @rm -f fchown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchown_OBJECTS) $(fchown_LDADD) $(LIBS) + +fchown32$(EXEEXT): $(fchown32_OBJECTS) $(fchown32_DEPENDENCIES) $(EXTRA_fchown32_DEPENDENCIES) + @rm -f fchown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchown32_OBJECTS) $(fchown32_LDADD) $(LIBS) + +fchownat$(EXEEXT): $(fchownat_OBJECTS) $(fchownat_DEPENDENCIES) $(EXTRA_fchownat_DEPENDENCIES) + @rm -f fchownat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchownat_OBJECTS) $(fchownat_LDADD) $(LIBS) + +fcntl$(EXEEXT): $(fcntl_OBJECTS) $(fcntl_DEPENDENCIES) $(EXTRA_fcntl_DEPENDENCIES) + @rm -f fcntl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fcntl_OBJECTS) $(fcntl_LDADD) $(LIBS) + +fcntl64$(EXEEXT): $(fcntl64_OBJECTS) $(fcntl64_DEPENDENCIES) $(EXTRA_fcntl64_DEPENDENCIES) + @rm -f fcntl64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fcntl64_OBJECTS) $(fcntl64_LDADD) $(LIBS) + +fdatasync$(EXEEXT): $(fdatasync_OBJECTS) $(fdatasync_DEPENDENCIES) $(EXTRA_fdatasync_DEPENDENCIES) + @rm -f fdatasync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fdatasync_OBJECTS) $(fdatasync_LDADD) $(LIBS) + +file_handle$(EXEEXT): $(file_handle_OBJECTS) $(file_handle_DEPENDENCIES) $(EXTRA_file_handle_DEPENDENCIES) + @rm -f file_handle$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_handle_OBJECTS) $(file_handle_LDADD) $(LIBS) + +file_ioctl$(EXEEXT): $(file_ioctl_OBJECTS) $(file_ioctl_DEPENDENCIES) $(EXTRA_file_ioctl_DEPENDENCIES) + @rm -f file_ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_ioctl_OBJECTS) $(file_ioctl_LDADD) $(LIBS) + +filter-unavailable$(EXEEXT): $(filter_unavailable_OBJECTS) $(filter_unavailable_DEPENDENCIES) $(EXTRA_filter_unavailable_DEPENDENCIES) + @rm -f filter-unavailable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(filter_unavailable_OBJECTS) $(filter_unavailable_LDADD) $(LIBS) + +finit_module$(EXEEXT): $(finit_module_OBJECTS) $(finit_module_DEPENDENCIES) $(EXTRA_finit_module_DEPENDENCIES) + @rm -f finit_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(finit_module_OBJECTS) $(finit_module_LDADD) $(LIBS) + +flock$(EXEEXT): $(flock_OBJECTS) $(flock_DEPENDENCIES) $(EXTRA_flock_DEPENDENCIES) + @rm -f flock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(flock_OBJECTS) $(flock_LDADD) $(LIBS) + +fork-f$(EXEEXT): $(fork_f_OBJECTS) $(fork_f_DEPENDENCIES) $(EXTRA_fork_f_DEPENDENCIES) + @rm -f fork-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fork_f_OBJECTS) $(fork_f_LDADD) $(LIBS) + +fstat$(EXEEXT): $(fstat_OBJECTS) $(fstat_DEPENDENCIES) $(EXTRA_fstat_DEPENDENCIES) + @rm -f fstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_OBJECTS) $(fstat_LDADD) $(LIBS) + +fstat64$(EXEEXT): $(fstat64_OBJECTS) $(fstat64_DEPENDENCIES) $(EXTRA_fstat64_DEPENDENCIES) + @rm -f fstat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_OBJECTS) $(fstat64_LDADD) $(LIBS) + +fstatat64$(EXEEXT): $(fstatat64_OBJECTS) $(fstatat64_DEPENDENCIES) $(EXTRA_fstatat64_DEPENDENCIES) + @rm -f fstatat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatat64_OBJECTS) $(fstatat64_LDADD) $(LIBS) + +fstatfs$(EXEEXT): $(fstatfs_OBJECTS) $(fstatfs_DEPENDENCIES) $(EXTRA_fstatfs_DEPENDENCIES) + @rm -f fstatfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatfs_OBJECTS) $(fstatfs_LDADD) $(LIBS) + +fstatfs64$(EXEEXT): $(fstatfs64_OBJECTS) $(fstatfs64_DEPENDENCIES) $(EXTRA_fstatfs64_DEPENDENCIES) + @rm -f fstatfs64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatfs64_OBJECTS) $(fstatfs64_LDADD) $(LIBS) + +fsync$(EXEEXT): $(fsync_OBJECTS) $(fsync_DEPENDENCIES) $(EXTRA_fsync_DEPENDENCIES) + @rm -f fsync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fsync_OBJECTS) $(fsync_LDADD) $(LIBS) + +ftruncate$(EXEEXT): $(ftruncate_OBJECTS) $(ftruncate_DEPENDENCIES) $(EXTRA_ftruncate_DEPENDENCIES) + @rm -f ftruncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ftruncate_OBJECTS) $(ftruncate_LDADD) $(LIBS) + +ftruncate64$(EXEEXT): $(ftruncate64_OBJECTS) $(ftruncate64_DEPENDENCIES) $(EXTRA_ftruncate64_DEPENDENCIES) + @rm -f ftruncate64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ftruncate64_OBJECTS) $(ftruncate64_LDADD) $(LIBS) + +futex$(EXEEXT): $(futex_OBJECTS) $(futex_DEPENDENCIES) $(EXTRA_futex_DEPENDENCIES) + @rm -f futex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(futex_OBJECTS) $(futex_LDADD) $(LIBS) + +futimesat$(EXEEXT): $(futimesat_OBJECTS) $(futimesat_DEPENDENCIES) $(EXTRA_futimesat_DEPENDENCIES) + @rm -f futimesat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(futimesat_OBJECTS) $(futimesat_LDADD) $(LIBS) + +get_mempolicy$(EXEEXT): $(get_mempolicy_OBJECTS) $(get_mempolicy_DEPENDENCIES) $(EXTRA_get_mempolicy_DEPENDENCIES) + @rm -f get_mempolicy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(get_mempolicy_OBJECTS) $(get_mempolicy_LDADD) $(LIBS) + +getcpu$(EXEEXT): $(getcpu_OBJECTS) $(getcpu_DEPENDENCIES) $(EXTRA_getcpu_DEPENDENCIES) + @rm -f getcpu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getcpu_OBJECTS) $(getcpu_LDADD) $(LIBS) + +getcwd$(EXEEXT): $(getcwd_OBJECTS) $(getcwd_DEPENDENCIES) $(EXTRA_getcwd_DEPENDENCIES) + @rm -f getcwd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getcwd_OBJECTS) $(getcwd_LDADD) $(LIBS) + +getdents$(EXEEXT): $(getdents_OBJECTS) $(getdents_DEPENDENCIES) $(EXTRA_getdents_DEPENDENCIES) + @rm -f getdents$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getdents_OBJECTS) $(getdents_LDADD) $(LIBS) + +getdents64$(EXEEXT): $(getdents64_OBJECTS) $(getdents64_DEPENDENCIES) $(EXTRA_getdents64_DEPENDENCIES) + @rm -f getdents64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getdents64_OBJECTS) $(getdents64_LDADD) $(LIBS) + +getegid$(EXEEXT): $(getegid_OBJECTS) $(getegid_DEPENDENCIES) $(EXTRA_getegid_DEPENDENCIES) + @rm -f getegid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getegid_OBJECTS) $(getegid_LDADD) $(LIBS) + +getegid32$(EXEEXT): $(getegid32_OBJECTS) $(getegid32_DEPENDENCIES) $(EXTRA_getegid32_DEPENDENCIES) + @rm -f getegid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getegid32_OBJECTS) $(getegid32_LDADD) $(LIBS) + +geteuid$(EXEEXT): $(geteuid_OBJECTS) $(geteuid_DEPENDENCIES) $(EXTRA_geteuid_DEPENDENCIES) + @rm -f geteuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(geteuid_OBJECTS) $(geteuid_LDADD) $(LIBS) + +geteuid32$(EXEEXT): $(geteuid32_OBJECTS) $(geteuid32_DEPENDENCIES) $(EXTRA_geteuid32_DEPENDENCIES) + @rm -f geteuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(geteuid32_OBJECTS) $(geteuid32_LDADD) $(LIBS) + +getgid$(EXEEXT): $(getgid_OBJECTS) $(getgid_DEPENDENCIES) $(EXTRA_getgid_DEPENDENCIES) + @rm -f getgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgid_OBJECTS) $(getgid_LDADD) $(LIBS) + +getgid32$(EXEEXT): $(getgid32_OBJECTS) $(getgid32_DEPENDENCIES) $(EXTRA_getgid32_DEPENDENCIES) + @rm -f getgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgid32_OBJECTS) $(getgid32_LDADD) $(LIBS) + +getgroups$(EXEEXT): $(getgroups_OBJECTS) $(getgroups_DEPENDENCIES) $(EXTRA_getgroups_DEPENDENCIES) + @rm -f getgroups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgroups_OBJECTS) $(getgroups_LDADD) $(LIBS) + +getgroups32$(EXEEXT): $(getgroups32_OBJECTS) $(getgroups32_DEPENDENCIES) $(EXTRA_getgroups32_DEPENDENCIES) + @rm -f getgroups32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgroups32_OBJECTS) $(getgroups32_LDADD) $(LIBS) + +getpeername$(EXEEXT): $(getpeername_OBJECTS) $(getpeername_DEPENDENCIES) $(EXTRA_getpeername_DEPENDENCIES) + @rm -f getpeername$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpeername_OBJECTS) $(getpeername_LDADD) $(LIBS) + +getpgrp$(EXEEXT): $(getpgrp_OBJECTS) $(getpgrp_DEPENDENCIES) $(EXTRA_getpgrp_DEPENDENCIES) + @rm -f getpgrp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpgrp_OBJECTS) $(getpgrp_LDADD) $(LIBS) + +getrandom$(EXEEXT): $(getrandom_OBJECTS) $(getrandom_DEPENDENCIES) $(EXTRA_getrandom_DEPENDENCIES) + @rm -f getrandom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrandom_OBJECTS) $(getrandom_LDADD) $(LIBS) + +getresgid$(EXEEXT): $(getresgid_OBJECTS) $(getresgid_DEPENDENCIES) $(EXTRA_getresgid_DEPENDENCIES) + @rm -f getresgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresgid_OBJECTS) $(getresgid_LDADD) $(LIBS) + +getresgid32$(EXEEXT): $(getresgid32_OBJECTS) $(getresgid32_DEPENDENCIES) $(EXTRA_getresgid32_DEPENDENCIES) + @rm -f getresgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresgid32_OBJECTS) $(getresgid32_LDADD) $(LIBS) + +getresuid$(EXEEXT): $(getresuid_OBJECTS) $(getresuid_DEPENDENCIES) $(EXTRA_getresuid_DEPENDENCIES) + @rm -f getresuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresuid_OBJECTS) $(getresuid_LDADD) $(LIBS) + +getresuid32$(EXEEXT): $(getresuid32_OBJECTS) $(getresuid32_DEPENDENCIES) $(EXTRA_getresuid32_DEPENDENCIES) + @rm -f getresuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresuid32_OBJECTS) $(getresuid32_LDADD) $(LIBS) + +getrlimit$(EXEEXT): $(getrlimit_OBJECTS) $(getrlimit_DEPENDENCIES) $(EXTRA_getrlimit_DEPENDENCIES) + @rm -f getrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrlimit_OBJECTS) $(getrlimit_LDADD) $(LIBS) + +getrusage$(EXEEXT): $(getrusage_OBJECTS) $(getrusage_DEPENDENCIES) $(EXTRA_getrusage_DEPENDENCIES) + @rm -f getrusage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrusage_OBJECTS) $(getrusage_LDADD) $(LIBS) + +getsid$(EXEEXT): $(getsid_OBJECTS) $(getsid_DEPENDENCIES) $(EXTRA_getsid_DEPENDENCIES) + @rm -f getsid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getsid_OBJECTS) $(getsid_LDADD) $(LIBS) + +getsockname$(EXEEXT): $(getsockname_OBJECTS) $(getsockname_DEPENDENCIES) $(EXTRA_getsockname_DEPENDENCIES) + @rm -f getsockname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getsockname_OBJECTS) $(getsockname_LDADD) $(LIBS) + +getuid$(EXEEXT): $(getuid_OBJECTS) $(getuid_DEPENDENCIES) $(EXTRA_getuid_DEPENDENCIES) + @rm -f getuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getuid_OBJECTS) $(getuid_LDADD) $(LIBS) + +getuid32$(EXEEXT): $(getuid32_OBJECTS) $(getuid32_DEPENDENCIES) $(EXTRA_getuid32_DEPENDENCIES) + @rm -f getuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getuid32_OBJECTS) $(getuid32_LDADD) $(LIBS) + +getxxid$(EXEEXT): $(getxxid_OBJECTS) $(getxxid_DEPENDENCIES) $(EXTRA_getxxid_DEPENDENCIES) + @rm -f getxxid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getxxid_OBJECTS) $(getxxid_LDADD) $(LIBS) + +inet-cmsg$(EXEEXT): $(inet_cmsg_OBJECTS) $(inet_cmsg_DEPENDENCIES) $(EXTRA_inet_cmsg_DEPENDENCIES) + @rm -f inet-cmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inet_cmsg_OBJECTS) $(inet_cmsg_LDADD) $(LIBS) + +init_module$(EXEEXT): $(init_module_OBJECTS) $(init_module_DEPENDENCIES) $(EXTRA_init_module_DEPENDENCIES) + @rm -f init_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(init_module_OBJECTS) $(init_module_LDADD) $(LIBS) + +inotify$(EXEEXT): $(inotify_OBJECTS) $(inotify_DEPENDENCIES) $(EXTRA_inotify_DEPENDENCIES) + @rm -f inotify$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inotify_OBJECTS) $(inotify_LDADD) $(LIBS) + +inotify_init1$(EXEEXT): $(inotify_init1_OBJECTS) $(inotify_init1_DEPENDENCIES) $(EXTRA_inotify_init1_DEPENDENCIES) + @rm -f inotify_init1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inotify_init1_OBJECTS) $(inotify_init1_LDADD) $(LIBS) + +ioctl$(EXEEXT): $(ioctl_OBJECTS) $(ioctl_DEPENDENCIES) $(EXTRA_ioctl_DEPENDENCIES) + @rm -f ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_OBJECTS) $(ioctl_LDADD) $(LIBS) + +ioctl_block$(EXEEXT): $(ioctl_block_OBJECTS) $(ioctl_block_DEPENDENCIES) $(EXTRA_ioctl_block_DEPENDENCIES) + @rm -f ioctl_block$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_block_OBJECTS) $(ioctl_block_LDADD) $(LIBS) + +ioctl_dm$(EXEEXT): $(ioctl_dm_OBJECTS) $(ioctl_dm_DEPENDENCIES) $(EXTRA_ioctl_dm_DEPENDENCIES) + @rm -f ioctl_dm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_dm_OBJECTS) $(ioctl_dm_LDADD) $(LIBS) + +ioctl_dm-v$(EXEEXT): $(ioctl_dm_v_OBJECTS) $(ioctl_dm_v_DEPENDENCIES) $(EXTRA_ioctl_dm_v_DEPENDENCIES) + @rm -f ioctl_dm-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_dm_v_OBJECTS) $(ioctl_dm_v_LDADD) $(LIBS) + +ioctl_evdev$(EXEEXT): $(ioctl_evdev_OBJECTS) $(ioctl_evdev_DEPENDENCIES) $(EXTRA_ioctl_evdev_DEPENDENCIES) + @rm -f ioctl_evdev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_OBJECTS) $(ioctl_evdev_LDADD) $(LIBS) + +ioctl_evdev-v$(EXEEXT): $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_v_DEPENDENCIES) + @rm -f ioctl_evdev-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_LDADD) $(LIBS) + +ioctl_loop$(EXEEXT): $(ioctl_loop_OBJECTS) $(ioctl_loop_DEPENDENCIES) $(EXTRA_ioctl_loop_DEPENDENCIES) + @rm -f ioctl_loop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_OBJECTS) $(ioctl_loop_LDADD) $(LIBS) + +ioctl_loop-nv$(EXEEXT): $(ioctl_loop_nv_OBJECTS) $(ioctl_loop_nv_DEPENDENCIES) $(EXTRA_ioctl_loop_nv_DEPENDENCIES) + @rm -f ioctl_loop-nv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_nv_OBJECTS) $(ioctl_loop_nv_LDADD) $(LIBS) + +ioctl_loop-v$(EXEEXT): $(ioctl_loop_v_OBJECTS) $(ioctl_loop_v_DEPENDENCIES) $(EXTRA_ioctl_loop_v_DEPENDENCIES) + @rm -f ioctl_loop-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_v_OBJECTS) $(ioctl_loop_v_LDADD) $(LIBS) + +ioctl_mtd$(EXEEXT): $(ioctl_mtd_OBJECTS) $(ioctl_mtd_DEPENDENCIES) $(EXTRA_ioctl_mtd_DEPENDENCIES) + @rm -f ioctl_mtd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_mtd_OBJECTS) $(ioctl_mtd_LDADD) $(LIBS) + +ioctl_rtc$(EXEEXT): $(ioctl_rtc_OBJECTS) $(ioctl_rtc_DEPENDENCIES) $(EXTRA_ioctl_rtc_DEPENDENCIES) + @rm -f ioctl_rtc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_rtc_OBJECTS) $(ioctl_rtc_LDADD) $(LIBS) + +ioctl_rtc-v$(EXEEXT): $(ioctl_rtc_v_OBJECTS) $(ioctl_rtc_v_DEPENDENCIES) $(EXTRA_ioctl_rtc_v_DEPENDENCIES) + @rm -f ioctl_rtc-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_rtc_v_OBJECTS) $(ioctl_rtc_v_LDADD) $(LIBS) + +ioctl_scsi$(EXEEXT): $(ioctl_scsi_OBJECTS) $(ioctl_scsi_DEPENDENCIES) $(EXTRA_ioctl_scsi_DEPENDENCIES) + @rm -f ioctl_scsi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_scsi_OBJECTS) $(ioctl_scsi_LDADD) $(LIBS) + +ioctl_sg_io_v3$(EXEEXT): $(ioctl_sg_io_v3_OBJECTS) $(ioctl_sg_io_v3_DEPENDENCIES) $(EXTRA_ioctl_sg_io_v3_DEPENDENCIES) + @rm -f ioctl_sg_io_v3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sg_io_v3_OBJECTS) $(ioctl_sg_io_v3_LDADD) $(LIBS) + +ioctl_sg_io_v4$(EXEEXT): $(ioctl_sg_io_v4_OBJECTS) $(ioctl_sg_io_v4_DEPENDENCIES) $(EXTRA_ioctl_sg_io_v4_DEPENDENCIES) + @rm -f ioctl_sg_io_v4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sg_io_v4_OBJECTS) $(ioctl_sg_io_v4_LDADD) $(LIBS) + +ioctl_sock_gifconf$(EXEEXT): $(ioctl_sock_gifconf_OBJECTS) $(ioctl_sock_gifconf_DEPENDENCIES) $(EXTRA_ioctl_sock_gifconf_DEPENDENCIES) + @rm -f ioctl_sock_gifconf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sock_gifconf_OBJECTS) $(ioctl_sock_gifconf_LDADD) $(LIBS) + +ioctl_uffdio$(EXEEXT): $(ioctl_uffdio_OBJECTS) $(ioctl_uffdio_DEPENDENCIES) $(EXTRA_ioctl_uffdio_DEPENDENCIES) + @rm -f ioctl_uffdio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_uffdio_OBJECTS) $(ioctl_uffdio_LDADD) $(LIBS) + +ioctl_v4l2$(EXEEXT): $(ioctl_v4l2_OBJECTS) $(ioctl_v4l2_DEPENDENCIES) $(EXTRA_ioctl_v4l2_DEPENDENCIES) + @rm -f ioctl_v4l2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_v4l2_OBJECTS) $(ioctl_v4l2_LDADD) $(LIBS) + +ioperm$(EXEEXT): $(ioperm_OBJECTS) $(ioperm_DEPENDENCIES) $(EXTRA_ioperm_DEPENDENCIES) + @rm -f ioperm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioperm_OBJECTS) $(ioperm_LDADD) $(LIBS) + +iopl$(EXEEXT): $(iopl_OBJECTS) $(iopl_DEPENDENCIES) $(EXTRA_iopl_DEPENDENCIES) + @rm -f iopl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(iopl_OBJECTS) $(iopl_LDADD) $(LIBS) + +ioprio$(EXEEXT): $(ioprio_OBJECTS) $(ioprio_DEPENDENCIES) $(EXTRA_ioprio_DEPENDENCIES) + @rm -f ioprio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_OBJECTS) $(ioprio_LDADD) $(LIBS) + +ip_mreq$(EXEEXT): $(ip_mreq_OBJECTS) $(ip_mreq_DEPENDENCIES) $(EXTRA_ip_mreq_DEPENDENCIES) + @rm -f ip_mreq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ip_mreq_OBJECTS) $(ip_mreq_LDADD) $(LIBS) + +ipc$(EXEEXT): $(ipc_OBJECTS) $(ipc_DEPENDENCIES) $(EXTRA_ipc_DEPENDENCIES) + @rm -f ipc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_OBJECTS) $(ipc_LDADD) $(LIBS) + +ipc_msg$(EXEEXT): $(ipc_msg_OBJECTS) $(ipc_msg_DEPENDENCIES) $(EXTRA_ipc_msg_DEPENDENCIES) + @rm -f ipc_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_OBJECTS) $(ipc_msg_LDADD) $(LIBS) + +ipc_msgbuf$(EXEEXT): $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_DEPENDENCIES) $(EXTRA_ipc_msgbuf_DEPENDENCIES) + @rm -f ipc_msgbuf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_LDADD) $(LIBS) + +ipc_sem$(EXEEXT): $(ipc_sem_OBJECTS) $(ipc_sem_DEPENDENCIES) $(EXTRA_ipc_sem_DEPENDENCIES) + @rm -f ipc_sem$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_OBJECTS) $(ipc_sem_LDADD) $(LIBS) + +ipc_shm$(EXEEXT): $(ipc_shm_OBJECTS) $(ipc_shm_DEPENDENCIES) $(EXTRA_ipc_shm_DEPENDENCIES) + @rm -f ipc_shm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_OBJECTS) $(ipc_shm_LDADD) $(LIBS) + +kcmp$(EXEEXT): $(kcmp_OBJECTS) $(kcmp_DEPENDENCIES) $(EXTRA_kcmp_DEPENDENCIES) + @rm -f kcmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kcmp_OBJECTS) $(kcmp_LDADD) $(LIBS) + +kexec_file_load$(EXEEXT): $(kexec_file_load_OBJECTS) $(kexec_file_load_DEPENDENCIES) $(EXTRA_kexec_file_load_DEPENDENCIES) + @rm -f kexec_file_load$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kexec_file_load_OBJECTS) $(kexec_file_load_LDADD) $(LIBS) + +kexec_load$(EXEEXT): $(kexec_load_OBJECTS) $(kexec_load_DEPENDENCIES) $(EXTRA_kexec_load_DEPENDENCIES) + @rm -f kexec_load$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kexec_load_OBJECTS) $(kexec_load_LDADD) $(LIBS) + +keyctl$(EXEEXT): $(keyctl_OBJECTS) $(keyctl_DEPENDENCIES) $(EXTRA_keyctl_DEPENDENCIES) + @rm -f keyctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_OBJECTS) $(keyctl_LDADD) $(LIBS) + +kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) $(EXTRA_kill_DEPENDENCIES) + @rm -f kill$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) + +ksysent$(EXEEXT): $(ksysent_OBJECTS) $(ksysent_DEPENDENCIES) $(EXTRA_ksysent_DEPENDENCIES) + @rm -f ksysent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ksysent_OBJECTS) $(ksysent_LDADD) $(LIBS) + +lchown$(EXEEXT): $(lchown_OBJECTS) $(lchown_DEPENDENCIES) $(EXTRA_lchown_DEPENDENCIES) + @rm -f lchown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lchown_OBJECTS) $(lchown_LDADD) $(LIBS) + +lchown32$(EXEEXT): $(lchown32_OBJECTS) $(lchown32_DEPENDENCIES) $(EXTRA_lchown32_DEPENDENCIES) + @rm -f lchown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lchown32_OBJECTS) $(lchown32_LDADD) $(LIBS) + +link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES) $(EXTRA_link_DEPENDENCIES) + @rm -f link$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(link_OBJECTS) $(link_LDADD) $(LIBS) + +linkat$(EXEEXT): $(linkat_OBJECTS) $(linkat_DEPENDENCIES) $(EXTRA_linkat_DEPENDENCIES) + @rm -f linkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(linkat_OBJECTS) $(linkat_LDADD) $(LIBS) + +llseek$(EXEEXT): $(llseek_OBJECTS) $(llseek_DEPENDENCIES) $(EXTRA_llseek_DEPENDENCIES) + @rm -f llseek$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(llseek_OBJECTS) $(llseek_LDADD) $(LIBS) + +lookup_dcookie$(EXEEXT): $(lookup_dcookie_OBJECTS) $(lookup_dcookie_DEPENDENCIES) $(EXTRA_lookup_dcookie_DEPENDENCIES) + @rm -f lookup_dcookie$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lookup_dcookie_OBJECTS) $(lookup_dcookie_LDADD) $(LIBS) + +lseek$(EXEEXT): $(lseek_OBJECTS) $(lseek_DEPENDENCIES) $(EXTRA_lseek_DEPENDENCIES) + @rm -f lseek$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lseek_OBJECTS) $(lseek_LDADD) $(LIBS) + +lstat$(EXEEXT): $(lstat_OBJECTS) $(lstat_DEPENDENCIES) $(EXTRA_lstat_DEPENDENCIES) + @rm -f lstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lstat_OBJECTS) $(lstat_LDADD) $(LIBS) + +lstat64$(EXEEXT): $(lstat64_OBJECTS) $(lstat64_DEPENDENCIES) $(EXTRA_lstat64_DEPENDENCIES) + @rm -f lstat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lstat64_OBJECTS) $(lstat64_LDADD) $(LIBS) + +mbind$(EXEEXT): $(mbind_OBJECTS) $(mbind_DEPENDENCIES) $(EXTRA_mbind_DEPENDENCIES) + @rm -f mbind$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mbind_OBJECTS) $(mbind_LDADD) $(LIBS) + +membarrier$(EXEEXT): $(membarrier_OBJECTS) $(membarrier_DEPENDENCIES) $(EXTRA_membarrier_DEPENDENCIES) + @rm -f membarrier$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(membarrier_OBJECTS) $(membarrier_LDADD) $(LIBS) + +memfd_create$(EXEEXT): $(memfd_create_OBJECTS) $(memfd_create_DEPENDENCIES) $(EXTRA_memfd_create_DEPENDENCIES) + @rm -f memfd_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_OBJECTS) $(memfd_create_LDADD) $(LIBS) + +migrate_pages$(EXEEXT): $(migrate_pages_OBJECTS) $(migrate_pages_DEPENDENCIES) $(EXTRA_migrate_pages_DEPENDENCIES) + @rm -f migrate_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(migrate_pages_OBJECTS) $(migrate_pages_LDADD) $(LIBS) + +mincore$(EXEEXT): $(mincore_OBJECTS) $(mincore_DEPENDENCIES) $(EXTRA_mincore_DEPENDENCIES) + @rm -f mincore$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mincore_OBJECTS) $(mincore_LDADD) $(LIBS) + +mkdir$(EXEEXT): $(mkdir_OBJECTS) $(mkdir_DEPENDENCIES) $(EXTRA_mkdir_DEPENDENCIES) + @rm -f mkdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) + +mkdirat$(EXEEXT): $(mkdirat_OBJECTS) $(mkdirat_DEPENDENCIES) $(EXTRA_mkdirat_DEPENDENCIES) + @rm -f mkdirat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mkdirat_OBJECTS) $(mkdirat_LDADD) $(LIBS) + +mknod$(EXEEXT): $(mknod_OBJECTS) $(mknod_DEPENDENCIES) $(EXTRA_mknod_DEPENDENCIES) + @rm -f mknod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mknod_OBJECTS) $(mknod_LDADD) $(LIBS) + +mknodat$(EXEEXT): $(mknodat_OBJECTS) $(mknodat_DEPENDENCIES) $(EXTRA_mknodat_DEPENDENCIES) + @rm -f mknodat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mknodat_OBJECTS) $(mknodat_LDADD) $(LIBS) + +mlock$(EXEEXT): $(mlock_OBJECTS) $(mlock_DEPENDENCIES) $(EXTRA_mlock_DEPENDENCIES) + @rm -f mlock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlock_OBJECTS) $(mlock_LDADD) $(LIBS) + +mlock2$(EXEEXT): $(mlock2_OBJECTS) $(mlock2_DEPENDENCIES) $(EXTRA_mlock2_DEPENDENCIES) + @rm -f mlock2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlock2_OBJECTS) $(mlock2_LDADD) $(LIBS) + +mlockall$(EXEEXT): $(mlockall_OBJECTS) $(mlockall_DEPENDENCIES) $(EXTRA_mlockall_DEPENDENCIES) + @rm -f mlockall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlockall_OBJECTS) $(mlockall_LDADD) $(LIBS) + +mmap$(EXEEXT): $(mmap_OBJECTS) $(mmap_DEPENDENCIES) $(EXTRA_mmap_DEPENDENCIES) + @rm -f mmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_OBJECTS) $(mmap_LDADD) $(LIBS) + +mmap64$(EXEEXT): $(mmap64_OBJECTS) $(mmap64_DEPENDENCIES) $(EXTRA_mmap64_DEPENDENCIES) + @rm -f mmap64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_OBJECTS) $(mmap64_LDADD) $(LIBS) + +mmsg$(EXEEXT): $(mmsg_OBJECTS) $(mmsg_DEPENDENCIES) $(EXTRA_mmsg_DEPENDENCIES) + @rm -f mmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_OBJECTS) $(mmsg_LDADD) $(LIBS) + +mmsg-silent$(EXEEXT): $(mmsg_silent_OBJECTS) $(mmsg_silent_DEPENDENCIES) $(EXTRA_mmsg_silent_DEPENDENCIES) + @rm -f mmsg-silent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_silent_OBJECTS) $(mmsg_silent_LDADD) $(LIBS) + +mmsg_name$(EXEEXT): $(mmsg_name_OBJECTS) $(mmsg_name_DEPENDENCIES) $(EXTRA_mmsg_name_DEPENDENCIES) + @rm -f mmsg_name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_name_OBJECTS) $(mmsg_name_LDADD) $(LIBS) + +mmsg_name-v$(EXEEXT): $(mmsg_name_v_OBJECTS) $(mmsg_name_v_DEPENDENCIES) $(EXTRA_mmsg_name_v_DEPENDENCIES) + @rm -f mmsg_name-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_name_v_OBJECTS) $(mmsg_name_v_LDADD) $(LIBS) + +mount$(EXEEXT): $(mount_OBJECTS) $(mount_DEPENDENCIES) $(EXTRA_mount_DEPENDENCIES) + @rm -f mount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_OBJECTS) $(mount_LDADD) $(LIBS) + +move_pages$(EXEEXT): $(move_pages_OBJECTS) $(move_pages_DEPENDENCIES) $(EXTRA_move_pages_DEPENDENCIES) + @rm -f move_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_OBJECTS) $(move_pages_LDADD) $(LIBS) + +mq$(EXEEXT): $(mq_OBJECTS) $(mq_DEPENDENCIES) $(EXTRA_mq_DEPENDENCIES) + @rm -f mq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_OBJECTS) $(mq_LDADD) $(LIBS) + +mq_sendrecv$(EXEEXT): $(mq_sendrecv_OBJECTS) $(mq_sendrecv_DEPENDENCIES) $(EXTRA_mq_sendrecv_DEPENDENCIES) + @rm -f mq_sendrecv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_OBJECTS) $(mq_sendrecv_LDADD) $(LIBS) + +mq_sendrecv-read$(EXEEXT): $(mq_sendrecv_read_OBJECTS) $(mq_sendrecv_read_DEPENDENCIES) $(EXTRA_mq_sendrecv_read_DEPENDENCIES) + @rm -f mq_sendrecv-read$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_read_OBJECTS) $(mq_sendrecv_read_LDADD) $(LIBS) + +mq_sendrecv-write$(EXEEXT): $(mq_sendrecv_write_OBJECTS) $(mq_sendrecv_write_DEPENDENCIES) $(EXTRA_mq_sendrecv_write_DEPENDENCIES) + @rm -f mq_sendrecv-write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_write_OBJECTS) $(mq_sendrecv_write_LDADD) $(LIBS) + +msg_control$(EXEEXT): $(msg_control_OBJECTS) $(msg_control_DEPENDENCIES) $(EXTRA_msg_control_DEPENDENCIES) + @rm -f msg_control$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_control_OBJECTS) $(msg_control_LDADD) $(LIBS) + +msg_control-v$(EXEEXT): $(msg_control_v_OBJECTS) $(msg_control_v_DEPENDENCIES) $(EXTRA_msg_control_v_DEPENDENCIES) + @rm -f msg_control-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_control_v_OBJECTS) $(msg_control_v_LDADD) $(LIBS) + +msg_name$(EXEEXT): $(msg_name_OBJECTS) $(msg_name_DEPENDENCIES) $(EXTRA_msg_name_DEPENDENCIES) + @rm -f msg_name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_name_OBJECTS) $(msg_name_LDADD) $(LIBS) + +munlockall$(EXEEXT): $(munlockall_OBJECTS) $(munlockall_DEPENDENCIES) $(EXTRA_munlockall_DEPENDENCIES) + @rm -f munlockall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(munlockall_OBJECTS) $(munlockall_LDADD) $(LIBS) + +nanosleep$(EXEEXT): $(nanosleep_OBJECTS) $(nanosleep_DEPENDENCIES) $(EXTRA_nanosleep_DEPENDENCIES) + @rm -f nanosleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nanosleep_OBJECTS) $(nanosleep_LDADD) $(LIBS) + +net-accept-connect$(EXEEXT): $(net_accept_connect_OBJECTS) $(net_accept_connect_DEPENDENCIES) $(EXTRA_net_accept_connect_DEPENDENCIES) + @rm -f net-accept-connect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_accept_connect_OBJECTS) $(net_accept_connect_LDADD) $(LIBS) + +net-icmp_filter$(EXEEXT): $(net_icmp_filter_OBJECTS) $(net_icmp_filter_DEPENDENCIES) $(EXTRA_net_icmp_filter_DEPENDENCIES) + @rm -f net-icmp_filter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_icmp_filter_OBJECTS) $(net_icmp_filter_LDADD) $(LIBS) + +net-sockaddr$(EXEEXT): $(net_sockaddr_OBJECTS) $(net_sockaddr_DEPENDENCIES) $(EXTRA_net_sockaddr_DEPENDENCIES) + @rm -f net-sockaddr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_sockaddr_OBJECTS) $(net_sockaddr_LDADD) $(LIBS) + +net-y-unix$(EXEEXT): $(net_y_unix_OBJECTS) $(net_y_unix_DEPENDENCIES) $(EXTRA_net_y_unix_DEPENDENCIES) + @rm -f net-y-unix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_y_unix_OBJECTS) $(net_y_unix_LDADD) $(LIBS) + +net-yy-inet$(EXEEXT): $(net_yy_inet_OBJECTS) $(net_yy_inet_DEPENDENCIES) $(EXTRA_net_yy_inet_DEPENDENCIES) + @rm -f net-yy-inet$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_inet_OBJECTS) $(net_yy_inet_LDADD) $(LIBS) + +net-yy-netlink$(EXEEXT): $(net_yy_netlink_OBJECTS) $(net_yy_netlink_DEPENDENCIES) $(EXTRA_net_yy_netlink_DEPENDENCIES) + @rm -f net-yy-netlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_netlink_OBJECTS) $(net_yy_netlink_LDADD) $(LIBS) + +net-yy-unix$(EXEEXT): $(net_yy_unix_OBJECTS) $(net_yy_unix_DEPENDENCIES) $(EXTRA_net_yy_unix_DEPENDENCIES) + @rm -f net-yy-unix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_unix_OBJECTS) $(net_yy_unix_LDADD) $(LIBS) + +netlink_inet_diag$(EXEEXT): $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_DEPENDENCIES) $(EXTRA_netlink_inet_diag_DEPENDENCIES) + @rm -f netlink_inet_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_LDADD) $(LIBS) + +netlink_netlink_diag$(EXEEXT): $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_DEPENDENCIES) $(EXTRA_netlink_netlink_diag_DEPENDENCIES) + @rm -f netlink_netlink_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_LDADD) $(LIBS) + +netlink_protocol$(EXEEXT): $(netlink_protocol_OBJECTS) $(netlink_protocol_DEPENDENCIES) $(EXTRA_netlink_protocol_DEPENDENCIES) + @rm -f netlink_protocol$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_protocol_OBJECTS) $(netlink_protocol_LDADD) $(LIBS) + +netlink_unix_diag$(EXEEXT): $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_DEPENDENCIES) $(EXTRA_netlink_unix_diag_DEPENDENCIES) + @rm -f netlink_unix_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_LDADD) $(LIBS) + +newfstatat$(EXEEXT): $(newfstatat_OBJECTS) $(newfstatat_DEPENDENCIES) $(EXTRA_newfstatat_DEPENDENCIES) + @rm -f newfstatat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(newfstatat_OBJECTS) $(newfstatat_LDADD) $(LIBS) + +nsyscalls$(EXEEXT): $(nsyscalls_OBJECTS) $(nsyscalls_DEPENDENCIES) $(EXTRA_nsyscalls_DEPENDENCIES) + @rm -f nsyscalls$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nsyscalls_OBJECTS) $(nsyscalls_LDADD) $(LIBS) + +old_mmap$(EXEEXT): $(old_mmap_OBJECTS) $(old_mmap_DEPENDENCIES) $(EXTRA_old_mmap_DEPENDENCIES) + @rm -f old_mmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_OBJECTS) $(old_mmap_LDADD) $(LIBS) + +oldfstat$(EXEEXT): $(oldfstat_OBJECTS) $(oldfstat_DEPENDENCIES) $(EXTRA_oldfstat_DEPENDENCIES) + @rm -f oldfstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldfstat_OBJECTS) $(oldfstat_LDADD) $(LIBS) + +oldlstat$(EXEEXT): $(oldlstat_OBJECTS) $(oldlstat_DEPENDENCIES) $(EXTRA_oldlstat_DEPENDENCIES) + @rm -f oldlstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldlstat_OBJECTS) $(oldlstat_LDADD) $(LIBS) + +oldselect$(EXEEXT): $(oldselect_OBJECTS) $(oldselect_DEPENDENCIES) $(EXTRA_oldselect_DEPENDENCIES) + @rm -f oldselect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_OBJECTS) $(oldselect_LDADD) $(LIBS) + +oldstat$(EXEEXT): $(oldstat_OBJECTS) $(oldstat_DEPENDENCIES) $(EXTRA_oldstat_DEPENDENCIES) + @rm -f oldstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldstat_OBJECTS) $(oldstat_LDADD) $(LIBS) + +open$(EXEEXT): $(open_OBJECTS) $(open_DEPENDENCIES) $(EXTRA_open_DEPENDENCIES) + @rm -f open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(open_OBJECTS) $(open_LDADD) $(LIBS) + +openat$(EXEEXT): $(openat_OBJECTS) $(openat_DEPENDENCIES) $(EXTRA_openat_DEPENDENCIES) + @rm -f openat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(openat_OBJECTS) $(openat_LDADD) $(LIBS) + +pause$(EXEEXT): $(pause_OBJECTS) $(pause_DEPENDENCIES) $(EXTRA_pause_DEPENDENCIES) + @rm -f pause$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pause_OBJECTS) $(pause_LDADD) $(LIBS) + +pc$(EXEEXT): $(pc_OBJECTS) $(pc_DEPENDENCIES) $(EXTRA_pc_DEPENDENCIES) + @rm -f pc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pc_OBJECTS) $(pc_LDADD) $(LIBS) + +perf_event_open$(EXEEXT): $(perf_event_open_OBJECTS) $(perf_event_open_DEPENDENCIES) $(EXTRA_perf_event_open_DEPENDENCIES) + @rm -f perf_event_open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_OBJECTS) $(perf_event_open_LDADD) $(LIBS) + +perf_event_open_nonverbose$(EXEEXT): $(perf_event_open_nonverbose_OBJECTS) $(perf_event_open_nonverbose_DEPENDENCIES) $(EXTRA_perf_event_open_nonverbose_DEPENDENCIES) + @rm -f perf_event_open_nonverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_nonverbose_OBJECTS) $(perf_event_open_nonverbose_LDADD) $(LIBS) + +perf_event_open_unabbrev$(EXEEXT): $(perf_event_open_unabbrev_OBJECTS) $(perf_event_open_unabbrev_DEPENDENCIES) $(EXTRA_perf_event_open_unabbrev_DEPENDENCIES) + @rm -f perf_event_open_unabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_unabbrev_OBJECTS) $(perf_event_open_unabbrev_LDADD) $(LIBS) + +personality$(EXEEXT): $(personality_OBJECTS) $(personality_DEPENDENCIES) $(EXTRA_personality_DEPENDENCIES) + @rm -f personality$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_OBJECTS) $(personality_LDADD) $(LIBS) + +pipe$(EXEEXT): $(pipe_OBJECTS) $(pipe_DEPENDENCIES) $(EXTRA_pipe_DEPENDENCIES) + @rm -f pipe$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pipe_OBJECTS) $(pipe_LDADD) $(LIBS) + +pipe2$(EXEEXT): $(pipe2_OBJECTS) $(pipe2_DEPENDENCIES) $(EXTRA_pipe2_DEPENDENCIES) + @rm -f pipe2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pipe2_OBJECTS) $(pipe2_LDADD) $(LIBS) + +pkey_alloc$(EXEEXT): $(pkey_alloc_OBJECTS) $(pkey_alloc_DEPENDENCIES) $(EXTRA_pkey_alloc_DEPENDENCIES) + @rm -f pkey_alloc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_alloc_OBJECTS) $(pkey_alloc_LDADD) $(LIBS) + +pkey_free$(EXEEXT): $(pkey_free_OBJECTS) $(pkey_free_DEPENDENCIES) $(EXTRA_pkey_free_DEPENDENCIES) + @rm -f pkey_free$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_free_OBJECTS) $(pkey_free_LDADD) $(LIBS) + +pkey_mprotect$(EXEEXT): $(pkey_mprotect_OBJECTS) $(pkey_mprotect_DEPENDENCIES) $(EXTRA_pkey_mprotect_DEPENDENCIES) + @rm -f pkey_mprotect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_mprotect_OBJECTS) $(pkey_mprotect_LDADD) $(LIBS) + +poll$(EXEEXT): $(poll_OBJECTS) $(poll_DEPENDENCIES) $(EXTRA_poll_DEPENDENCIES) + @rm -f poll$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(poll_OBJECTS) $(poll_LDADD) $(LIBS) + +ppoll$(EXEEXT): $(ppoll_OBJECTS) $(ppoll_DEPENDENCIES) $(EXTRA_ppoll_DEPENDENCIES) + @rm -f ppoll$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_OBJECTS) $(ppoll_LDADD) $(LIBS) + +prctl-arg2-intptr$(EXEEXT): $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_DEPENDENCIES) $(EXTRA_prctl_arg2_intptr_DEPENDENCIES) + @rm -f prctl-arg2-intptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_LDADD) $(LIBS) + +prctl-dumpable$(EXEEXT): $(prctl_dumpable_OBJECTS) $(prctl_dumpable_DEPENDENCIES) $(EXTRA_prctl_dumpable_DEPENDENCIES) + @rm -f prctl-dumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_dumpable_OBJECTS) $(prctl_dumpable_LDADD) $(LIBS) + +prctl-name$(EXEEXT): $(prctl_name_OBJECTS) $(prctl_name_DEPENDENCIES) $(EXTRA_prctl_name_DEPENDENCIES) + @rm -f prctl-name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_name_OBJECTS) $(prctl_name_LDADD) $(LIBS) + +prctl-no-args$(EXEEXT): $(prctl_no_args_OBJECTS) $(prctl_no_args_DEPENDENCIES) $(EXTRA_prctl_no_args_DEPENDENCIES) + @rm -f prctl-no-args$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_no_args_OBJECTS) $(prctl_no_args_LDADD) $(LIBS) + +prctl-pdeathsig$(EXEEXT): $(prctl_pdeathsig_OBJECTS) $(prctl_pdeathsig_DEPENDENCIES) $(EXTRA_prctl_pdeathsig_DEPENDENCIES) + @rm -f prctl-pdeathsig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_pdeathsig_OBJECTS) $(prctl_pdeathsig_LDADD) $(LIBS) + +prctl-seccomp-filter-v$(EXEEXT): $(prctl_seccomp_filter_v_OBJECTS) $(prctl_seccomp_filter_v_DEPENDENCIES) $(EXTRA_prctl_seccomp_filter_v_DEPENDENCIES) + @rm -f prctl-seccomp-filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_seccomp_filter_v_OBJECTS) $(prctl_seccomp_filter_v_LDADD) $(LIBS) + +prctl-seccomp-strict$(EXEEXT): $(prctl_seccomp_strict_OBJECTS) $(prctl_seccomp_strict_DEPENDENCIES) $(EXTRA_prctl_seccomp_strict_DEPENDENCIES) + @rm -f prctl-seccomp-strict$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_seccomp_strict_OBJECTS) $(prctl_seccomp_strict_LDADD) $(LIBS) + +prctl-securebits$(EXEEXT): $(prctl_securebits_OBJECTS) $(prctl_securebits_DEPENDENCIES) $(EXTRA_prctl_securebits_DEPENDENCIES) + @rm -f prctl-securebits$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_securebits_OBJECTS) $(prctl_securebits_LDADD) $(LIBS) + +prctl-tid_address$(EXEEXT): $(prctl_tid_address_OBJECTS) $(prctl_tid_address_DEPENDENCIES) $(EXTRA_prctl_tid_address_DEPENDENCIES) + @rm -f prctl-tid_address$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_tid_address_OBJECTS) $(prctl_tid_address_LDADD) $(LIBS) + +prctl-tsc$(EXEEXT): $(prctl_tsc_OBJECTS) $(prctl_tsc_DEPENDENCIES) $(EXTRA_prctl_tsc_DEPENDENCIES) + @rm -f prctl-tsc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_tsc_OBJECTS) $(prctl_tsc_LDADD) $(LIBS) + +pread64-pwrite64$(EXEEXT): $(pread64_pwrite64_OBJECTS) $(pread64_pwrite64_DEPENDENCIES) $(EXTRA_pread64_pwrite64_DEPENDENCIES) + @rm -f pread64-pwrite64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pread64_pwrite64_OBJECTS) $(pread64_pwrite64_LDADD) $(LIBS) + +preadv$(EXEEXT): $(preadv_OBJECTS) $(preadv_DEPENDENCIES) $(EXTRA_preadv_DEPENDENCIES) + @rm -f preadv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv_OBJECTS) $(preadv_LDADD) $(LIBS) + +preadv-pwritev$(EXEEXT): $(preadv_pwritev_OBJECTS) $(preadv_pwritev_DEPENDENCIES) $(EXTRA_preadv_pwritev_DEPENDENCIES) + @rm -f preadv-pwritev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv_pwritev_OBJECTS) $(preadv_pwritev_LDADD) $(LIBS) + +preadv2-pwritev2$(EXEEXT): $(preadv2_pwritev2_OBJECTS) $(preadv2_pwritev2_DEPENDENCIES) $(EXTRA_preadv2_pwritev2_DEPENDENCIES) + @rm -f preadv2-pwritev2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv2_pwritev2_OBJECTS) $(preadv2_pwritev2_LDADD) $(LIBS) + +print_maxfd$(EXEEXT): $(print_maxfd_OBJECTS) $(print_maxfd_DEPENDENCIES) $(EXTRA_print_maxfd_DEPENDENCIES) + @rm -f print_maxfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(print_maxfd_OBJECTS) $(print_maxfd_LDADD) $(LIBS) + +printstr$(EXEEXT): $(printstr_OBJECTS) $(printstr_DEPENDENCIES) $(EXTRA_printstr_DEPENDENCIES) + @rm -f printstr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstr_OBJECTS) $(printstr_LDADD) $(LIBS) + +prlimit64$(EXEEXT): $(prlimit64_OBJECTS) $(prlimit64_DEPENDENCIES) $(EXTRA_prlimit64_DEPENDENCIES) + @rm -f prlimit64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prlimit64_OBJECTS) $(prlimit64_LDADD) $(LIBS) + +process_vm_readv$(EXEEXT): $(process_vm_readv_OBJECTS) $(process_vm_readv_DEPENDENCIES) $(EXTRA_process_vm_readv_DEPENDENCIES) + @rm -f process_vm_readv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(process_vm_readv_OBJECTS) $(process_vm_readv_LDADD) $(LIBS) + +process_vm_writev$(EXEEXT): $(process_vm_writev_OBJECTS) $(process_vm_writev_DEPENDENCIES) $(EXTRA_process_vm_writev_DEPENDENCIES) + @rm -f process_vm_writev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(process_vm_writev_OBJECTS) $(process_vm_writev_LDADD) $(LIBS) + +pselect6$(EXEEXT): $(pselect6_OBJECTS) $(pselect6_DEPENDENCIES) $(EXTRA_pselect6_DEPENDENCIES) + @rm -f pselect6$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pselect6_OBJECTS) $(pselect6_LDADD) $(LIBS) + +ptrace$(EXEEXT): $(ptrace_OBJECTS) $(ptrace_DEPENDENCIES) $(EXTRA_ptrace_DEPENDENCIES) + @rm -f ptrace$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ptrace_OBJECTS) $(ptrace_LDADD) $(LIBS) + +pwritev$(EXEEXT): $(pwritev_OBJECTS) $(pwritev_DEPENDENCIES) $(EXTRA_pwritev_DEPENDENCIES) + @rm -f pwritev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pwritev_OBJECTS) $(pwritev_LDADD) $(LIBS) + +qual_fault$(EXEEXT): $(qual_fault_OBJECTS) $(qual_fault_DEPENDENCIES) $(EXTRA_qual_fault_DEPENDENCIES) + @rm -f qual_fault$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_fault_OBJECTS) $(qual_fault_LDADD) $(LIBS) + +qual_inject-error-signal$(EXEEXT): $(qual_inject_error_signal_OBJECTS) $(qual_inject_error_signal_DEPENDENCIES) $(EXTRA_qual_inject_error_signal_DEPENDENCIES) + @rm -f qual_inject-error-signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_error_signal_OBJECTS) $(qual_inject_error_signal_LDADD) $(LIBS) + +qual_inject-retval$(EXEEXT): $(qual_inject_retval_OBJECTS) $(qual_inject_retval_DEPENDENCIES) $(EXTRA_qual_inject_retval_DEPENDENCIES) + @rm -f qual_inject-retval$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_retval_OBJECTS) $(qual_inject_retval_LDADD) $(LIBS) + +qual_inject-signal$(EXEEXT): $(qual_inject_signal_OBJECTS) $(qual_inject_signal_DEPENDENCIES) $(EXTRA_qual_inject_signal_DEPENDENCIES) + @rm -f qual_inject-signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_signal_OBJECTS) $(qual_inject_signal_LDADD) $(LIBS) + +qual_signal$(EXEEXT): $(qual_signal_OBJECTS) $(qual_signal_DEPENDENCIES) $(EXTRA_qual_signal_DEPENDENCIES) + @rm -f qual_signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_signal_OBJECTS) $(qual_signal_LDADD) $(LIBS) + +quotactl$(EXEEXT): $(quotactl_OBJECTS) $(quotactl_DEPENDENCIES) $(EXTRA_quotactl_DEPENDENCIES) + @rm -f quotactl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_OBJECTS) $(quotactl_LDADD) $(LIBS) + +quotactl-v$(EXEEXT): $(quotactl_v_OBJECTS) $(quotactl_v_DEPENDENCIES) $(EXTRA_quotactl_v_DEPENDENCIES) + @rm -f quotactl-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_v_OBJECTS) $(quotactl_v_LDADD) $(LIBS) + +quotactl-xfs$(EXEEXT): $(quotactl_xfs_OBJECTS) $(quotactl_xfs_DEPENDENCIES) $(EXTRA_quotactl_xfs_DEPENDENCIES) + @rm -f quotactl-xfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_OBJECTS) $(quotactl_xfs_LDADD) $(LIBS) + +quotactl-xfs-v$(EXEEXT): $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_v_DEPENDENCIES) + @rm -f quotactl-xfs-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_LDADD) $(LIBS) + +read-write$(EXEEXT): $(read_write_OBJECTS) $(read_write_DEPENDENCIES) $(EXTRA_read_write_DEPENDENCIES) + @rm -f read-write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(read_write_OBJECTS) $(read_write_LDADD) $(LIBS) + +readahead$(EXEEXT): $(readahead_OBJECTS) $(readahead_DEPENDENCIES) $(EXTRA_readahead_DEPENDENCIES) + @rm -f readahead$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readahead_OBJECTS) $(readahead_LDADD) $(LIBS) + +readdir$(EXEEXT): $(readdir_OBJECTS) $(readdir_DEPENDENCIES) $(EXTRA_readdir_DEPENDENCIES) + @rm -f readdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readdir_OBJECTS) $(readdir_LDADD) $(LIBS) + +readlink$(EXEEXT): $(readlink_OBJECTS) $(readlink_DEPENDENCIES) $(EXTRA_readlink_DEPENDENCIES) + @rm -f readlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readlink_OBJECTS) $(readlink_LDADD) $(LIBS) + +readlinkat$(EXEEXT): $(readlinkat_OBJECTS) $(readlinkat_DEPENDENCIES) $(EXTRA_readlinkat_DEPENDENCIES) + @rm -f readlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readlinkat_OBJECTS) $(readlinkat_LDADD) $(LIBS) + +readv$(EXEEXT): $(readv_OBJECTS) $(readv_DEPENDENCIES) $(EXTRA_readv_DEPENDENCIES) + @rm -f readv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readv_OBJECTS) $(readv_LDADD) $(LIBS) + +reboot$(EXEEXT): $(reboot_OBJECTS) $(reboot_DEPENDENCIES) $(EXTRA_reboot_DEPENDENCIES) + @rm -f reboot$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(reboot_OBJECTS) $(reboot_LDADD) $(LIBS) + +recvfrom$(EXEEXT): $(recvfrom_OBJECTS) $(recvfrom_DEPENDENCIES) $(EXTRA_recvfrom_DEPENDENCIES) + @rm -f recvfrom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvfrom_OBJECTS) $(recvfrom_LDADD) $(LIBS) + +recvmmsg-timeout$(EXEEXT): $(recvmmsg_timeout_OBJECTS) $(recvmmsg_timeout_DEPENDENCIES) $(EXTRA_recvmmsg_timeout_DEPENDENCIES) + @rm -f recvmmsg-timeout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvmmsg_timeout_OBJECTS) $(recvmmsg_timeout_LDADD) $(LIBS) + +recvmsg$(EXEEXT): $(recvmsg_OBJECTS) $(recvmsg_DEPENDENCIES) $(EXTRA_recvmsg_DEPENDENCIES) + @rm -f recvmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvmsg_OBJECTS) $(recvmsg_LDADD) $(LIBS) + +redirect-fds$(EXEEXT): $(redirect_fds_OBJECTS) $(redirect_fds_DEPENDENCIES) $(EXTRA_redirect_fds_DEPENDENCIES) + @rm -f redirect-fds$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(redirect_fds_OBJECTS) $(redirect_fds_LDADD) $(LIBS) + +remap_file_pages$(EXEEXT): $(remap_file_pages_OBJECTS) $(remap_file_pages_DEPENDENCIES) $(EXTRA_remap_file_pages_DEPENDENCIES) + @rm -f remap_file_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_OBJECTS) $(remap_file_pages_LDADD) $(LIBS) + +rename$(EXEEXT): $(rename_OBJECTS) $(rename_DEPENDENCIES) $(EXTRA_rename_DEPENDENCIES) + @rm -f rename$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rename_OBJECTS) $(rename_LDADD) $(LIBS) + +renameat$(EXEEXT): $(renameat_OBJECTS) $(renameat_DEPENDENCIES) $(EXTRA_renameat_DEPENDENCIES) + @rm -f renameat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(renameat_OBJECTS) $(renameat_LDADD) $(LIBS) + +renameat2$(EXEEXT): $(renameat2_OBJECTS) $(renameat2_DEPENDENCIES) $(EXTRA_renameat2_DEPENDENCIES) + @rm -f renameat2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(renameat2_OBJECTS) $(renameat2_LDADD) $(LIBS) + +request_key$(EXEEXT): $(request_key_OBJECTS) $(request_key_DEPENDENCIES) $(EXTRA_request_key_DEPENDENCIES) + @rm -f request_key$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(request_key_OBJECTS) $(request_key_LDADD) $(LIBS) + +restart_syscall$(EXEEXT): $(restart_syscall_OBJECTS) $(restart_syscall_DEPENDENCIES) $(EXTRA_restart_syscall_DEPENDENCIES) + @rm -f restart_syscall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(restart_syscall_OBJECTS) $(restart_syscall_LDADD) $(LIBS) + +rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) $(EXTRA_rmdir_DEPENDENCIES) + @rm -f rmdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) + +rt_sigpending$(EXEEXT): $(rt_sigpending_OBJECTS) $(rt_sigpending_DEPENDENCIES) $(EXTRA_rt_sigpending_DEPENDENCIES) + @rm -f rt_sigpending$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigpending_OBJECTS) $(rt_sigpending_LDADD) $(LIBS) + +rt_sigprocmask$(EXEEXT): $(rt_sigprocmask_OBJECTS) $(rt_sigprocmask_DEPENDENCIES) $(EXTRA_rt_sigprocmask_DEPENDENCIES) + @rm -f rt_sigprocmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigprocmask_OBJECTS) $(rt_sigprocmask_LDADD) $(LIBS) + +rt_sigqueueinfo$(EXEEXT): $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_DEPENDENCIES) $(EXTRA_rt_sigqueueinfo_DEPENDENCIES) + @rm -f rt_sigqueueinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_LDADD) $(LIBS) + +rt_sigsuspend$(EXEEXT): $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_DEPENDENCIES) $(EXTRA_rt_sigsuspend_DEPENDENCIES) + @rm -f rt_sigsuspend$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_LDADD) $(LIBS) + +rt_sigtimedwait$(EXEEXT): $(rt_sigtimedwait_OBJECTS) $(rt_sigtimedwait_DEPENDENCIES) $(EXTRA_rt_sigtimedwait_DEPENDENCIES) + @rm -f rt_sigtimedwait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigtimedwait_OBJECTS) $(rt_sigtimedwait_LDADD) $(LIBS) + +rt_tgsigqueueinfo$(EXEEXT): $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_DEPENDENCIES) $(EXTRA_rt_tgsigqueueinfo_DEPENDENCIES) + @rm -f rt_tgsigqueueinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_LDADD) $(LIBS) + +sched_get_priority_mxx$(EXEEXT): $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_DEPENDENCIES) $(EXTRA_sched_get_priority_mxx_DEPENDENCIES) + @rm -f sched_get_priority_mxx$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_LDADD) $(LIBS) + +sched_rr_get_interval$(EXEEXT): $(sched_rr_get_interval_OBJECTS) $(sched_rr_get_interval_DEPENDENCIES) $(EXTRA_sched_rr_get_interval_DEPENDENCIES) + @rm -f sched_rr_get_interval$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_rr_get_interval_OBJECTS) $(sched_rr_get_interval_LDADD) $(LIBS) + +sched_xetaffinity$(EXEEXT): $(sched_xetaffinity_OBJECTS) $(sched_xetaffinity_DEPENDENCIES) $(EXTRA_sched_xetaffinity_DEPENDENCIES) + @rm -f sched_xetaffinity$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetaffinity_OBJECTS) $(sched_xetaffinity_LDADD) $(LIBS) + +sched_xetattr$(EXEEXT): $(sched_xetattr_OBJECTS) $(sched_xetattr_DEPENDENCIES) $(EXTRA_sched_xetattr_DEPENDENCIES) + @rm -f sched_xetattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetattr_OBJECTS) $(sched_xetattr_LDADD) $(LIBS) + +sched_xetparam$(EXEEXT): $(sched_xetparam_OBJECTS) $(sched_xetparam_DEPENDENCIES) $(EXTRA_sched_xetparam_DEPENDENCIES) + @rm -f sched_xetparam$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetparam_OBJECTS) $(sched_xetparam_LDADD) $(LIBS) + +sched_xetscheduler$(EXEEXT): $(sched_xetscheduler_OBJECTS) $(sched_xetscheduler_DEPENDENCIES) $(EXTRA_sched_xetscheduler_DEPENDENCIES) + @rm -f sched_xetscheduler$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetscheduler_OBJECTS) $(sched_xetscheduler_LDADD) $(LIBS) + +sched_yield$(EXEEXT): $(sched_yield_OBJECTS) $(sched_yield_DEPENDENCIES) $(EXTRA_sched_yield_DEPENDENCIES) + @rm -f sched_yield$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_yield_OBJECTS) $(sched_yield_LDADD) $(LIBS) + +scm_rights$(EXEEXT): $(scm_rights_OBJECTS) $(scm_rights_DEPENDENCIES) $(EXTRA_scm_rights_DEPENDENCIES) + @rm -f scm_rights$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(scm_rights_OBJECTS) $(scm_rights_LDADD) $(LIBS) + +seccomp-filter$(EXEEXT): $(seccomp_filter_OBJECTS) $(seccomp_filter_DEPENDENCIES) $(EXTRA_seccomp_filter_DEPENDENCIES) + @rm -f seccomp-filter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_filter_OBJECTS) $(seccomp_filter_LDADD) $(LIBS) + +seccomp-filter-v$(EXEEXT): $(seccomp_filter_v_OBJECTS) $(seccomp_filter_v_DEPENDENCIES) $(EXTRA_seccomp_filter_v_DEPENDENCIES) + @rm -f seccomp-filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_filter_v_OBJECTS) $(seccomp_filter_v_LDADD) $(LIBS) + +seccomp-strict$(EXEEXT): $(seccomp_strict_OBJECTS) $(seccomp_strict_DEPENDENCIES) $(EXTRA_seccomp_strict_DEPENDENCIES) + @rm -f seccomp-strict$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_strict_OBJECTS) $(seccomp_strict_LDADD) $(LIBS) + +select$(EXEEXT): $(select_OBJECTS) $(select_DEPENDENCIES) $(EXTRA_select_DEPENDENCIES) + @rm -f select$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(select_OBJECTS) $(select_LDADD) $(LIBS) + +semop$(EXEEXT): $(semop_OBJECTS) $(semop_DEPENDENCIES) $(EXTRA_semop_DEPENDENCIES) + @rm -f semop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(semop_OBJECTS) $(semop_LDADD) $(LIBS) + +sendfile$(EXEEXT): $(sendfile_OBJECTS) $(sendfile_DEPENDENCIES) $(EXTRA_sendfile_DEPENDENCIES) + @rm -f sendfile$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sendfile_OBJECTS) $(sendfile_LDADD) $(LIBS) + +sendfile64$(EXEEXT): $(sendfile64_OBJECTS) $(sendfile64_DEPENDENCIES) $(EXTRA_sendfile64_DEPENDENCIES) + @rm -f sendfile64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sendfile64_OBJECTS) $(sendfile64_LDADD) $(LIBS) + +set_mempolicy$(EXEEXT): $(set_mempolicy_OBJECTS) $(set_mempolicy_DEPENDENCIES) $(EXTRA_set_mempolicy_DEPENDENCIES) + @rm -f set_mempolicy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_mempolicy_OBJECTS) $(set_mempolicy_LDADD) $(LIBS) + +set_ptracer_any$(EXEEXT): $(set_ptracer_any_OBJECTS) $(set_ptracer_any_DEPENDENCIES) $(EXTRA_set_ptracer_any_DEPENDENCIES) + @rm -f set_ptracer_any$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_ptracer_any_OBJECTS) $(set_ptracer_any_LDADD) $(LIBS) + +setdomainname$(EXEEXT): $(setdomainname_OBJECTS) $(setdomainname_DEPENDENCIES) $(EXTRA_setdomainname_DEPENDENCIES) + @rm -f setdomainname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setdomainname_OBJECTS) $(setdomainname_LDADD) $(LIBS) + +setfsgid$(EXEEXT): $(setfsgid_OBJECTS) $(setfsgid_DEPENDENCIES) $(EXTRA_setfsgid_DEPENDENCIES) + @rm -f setfsgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsgid_OBJECTS) $(setfsgid_LDADD) $(LIBS) + +setfsgid32$(EXEEXT): $(setfsgid32_OBJECTS) $(setfsgid32_DEPENDENCIES) $(EXTRA_setfsgid32_DEPENDENCIES) + @rm -f setfsgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsgid32_OBJECTS) $(setfsgid32_LDADD) $(LIBS) + +setfsuid$(EXEEXT): $(setfsuid_OBJECTS) $(setfsuid_DEPENDENCIES) $(EXTRA_setfsuid_DEPENDENCIES) + @rm -f setfsuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsuid_OBJECTS) $(setfsuid_LDADD) $(LIBS) + +setfsuid32$(EXEEXT): $(setfsuid32_OBJECTS) $(setfsuid32_DEPENDENCIES) $(EXTRA_setfsuid32_DEPENDENCIES) + @rm -f setfsuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsuid32_OBJECTS) $(setfsuid32_LDADD) $(LIBS) + +setgid$(EXEEXT): $(setgid_OBJECTS) $(setgid_DEPENDENCIES) $(EXTRA_setgid_DEPENDENCIES) + @rm -f setgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgid_OBJECTS) $(setgid_LDADD) $(LIBS) + +setgid32$(EXEEXT): $(setgid32_OBJECTS) $(setgid32_DEPENDENCIES) $(EXTRA_setgid32_DEPENDENCIES) + @rm -f setgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgid32_OBJECTS) $(setgid32_LDADD) $(LIBS) + +setgroups$(EXEEXT): $(setgroups_OBJECTS) $(setgroups_DEPENDENCIES) $(EXTRA_setgroups_DEPENDENCIES) + @rm -f setgroups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgroups_OBJECTS) $(setgroups_LDADD) $(LIBS) + +setgroups32$(EXEEXT): $(setgroups32_OBJECTS) $(setgroups32_DEPENDENCIES) $(EXTRA_setgroups32_DEPENDENCIES) + @rm -f setgroups32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgroups32_OBJECTS) $(setgroups32_LDADD) $(LIBS) + +sethostname$(EXEEXT): $(sethostname_OBJECTS) $(sethostname_DEPENDENCIES) $(EXTRA_sethostname_DEPENDENCIES) + @rm -f sethostname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sethostname_OBJECTS) $(sethostname_LDADD) $(LIBS) + +setns$(EXEEXT): $(setns_OBJECTS) $(setns_DEPENDENCIES) $(EXTRA_setns_DEPENDENCIES) + @rm -f setns$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setns_OBJECTS) $(setns_LDADD) $(LIBS) + +setregid$(EXEEXT): $(setregid_OBJECTS) $(setregid_DEPENDENCIES) $(EXTRA_setregid_DEPENDENCIES) + @rm -f setregid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setregid_OBJECTS) $(setregid_LDADD) $(LIBS) + +setregid32$(EXEEXT): $(setregid32_OBJECTS) $(setregid32_DEPENDENCIES) $(EXTRA_setregid32_DEPENDENCIES) + @rm -f setregid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setregid32_OBJECTS) $(setregid32_LDADD) $(LIBS) + +setresgid$(EXEEXT): $(setresgid_OBJECTS) $(setresgid_DEPENDENCIES) $(EXTRA_setresgid_DEPENDENCIES) + @rm -f setresgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresgid_OBJECTS) $(setresgid_LDADD) $(LIBS) + +setresgid32$(EXEEXT): $(setresgid32_OBJECTS) $(setresgid32_DEPENDENCIES) $(EXTRA_setresgid32_DEPENDENCIES) + @rm -f setresgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresgid32_OBJECTS) $(setresgid32_LDADD) $(LIBS) + +setresuid$(EXEEXT): $(setresuid_OBJECTS) $(setresuid_DEPENDENCIES) $(EXTRA_setresuid_DEPENDENCIES) + @rm -f setresuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresuid_OBJECTS) $(setresuid_LDADD) $(LIBS) + +setresuid32$(EXEEXT): $(setresuid32_OBJECTS) $(setresuid32_DEPENDENCIES) $(EXTRA_setresuid32_DEPENDENCIES) + @rm -f setresuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresuid32_OBJECTS) $(setresuid32_LDADD) $(LIBS) + +setreuid$(EXEEXT): $(setreuid_OBJECTS) $(setreuid_DEPENDENCIES) $(EXTRA_setreuid_DEPENDENCIES) + @rm -f setreuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setreuid_OBJECTS) $(setreuid_LDADD) $(LIBS) + +setreuid32$(EXEEXT): $(setreuid32_OBJECTS) $(setreuid32_DEPENDENCIES) $(EXTRA_setreuid32_DEPENDENCIES) + @rm -f setreuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setreuid32_OBJECTS) $(setreuid32_LDADD) $(LIBS) + +setrlimit$(EXEEXT): $(setrlimit_OBJECTS) $(setrlimit_DEPENDENCIES) $(EXTRA_setrlimit_DEPENDENCIES) + @rm -f setrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_OBJECTS) $(setrlimit_LDADD) $(LIBS) + +setuid$(EXEEXT): $(setuid_OBJECTS) $(setuid_DEPENDENCIES) $(EXTRA_setuid_DEPENDENCIES) + @rm -f setuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setuid_OBJECTS) $(setuid_LDADD) $(LIBS) + +setuid32$(EXEEXT): $(setuid32_OBJECTS) $(setuid32_DEPENDENCIES) $(EXTRA_setuid32_DEPENDENCIES) + @rm -f setuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setuid32_OBJECTS) $(setuid32_LDADD) $(LIBS) + +shmxt$(EXEEXT): $(shmxt_OBJECTS) $(shmxt_DEPENDENCIES) $(EXTRA_shmxt_DEPENDENCIES) + @rm -f shmxt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shmxt_OBJECTS) $(shmxt_LDADD) $(LIBS) + +shutdown$(EXEEXT): $(shutdown_OBJECTS) $(shutdown_DEPENDENCIES) $(EXTRA_shutdown_DEPENDENCIES) + @rm -f shutdown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shutdown_OBJECTS) $(shutdown_LDADD) $(LIBS) + +sigaction$(EXEEXT): $(sigaction_OBJECTS) $(sigaction_DEPENDENCIES) $(EXTRA_sigaction_DEPENDENCIES) + @rm -f sigaction$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigaction_OBJECTS) $(sigaction_LDADD) $(LIBS) + +sigaltstack$(EXEEXT): $(sigaltstack_OBJECTS) $(sigaltstack_DEPENDENCIES) $(EXTRA_sigaltstack_DEPENDENCIES) + @rm -f sigaltstack$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigaltstack_OBJECTS) $(sigaltstack_LDADD) $(LIBS) + +siginfo$(EXEEXT): $(siginfo_OBJECTS) $(siginfo_DEPENDENCIES) $(EXTRA_siginfo_DEPENDENCIES) + @rm -f siginfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(siginfo_OBJECTS) $(siginfo_LDADD) $(LIBS) + +signal_receive$(EXEEXT): $(signal_receive_OBJECTS) $(signal_receive_DEPENDENCIES) $(EXTRA_signal_receive_DEPENDENCIES) + @rm -f signal_receive$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signal_receive_OBJECTS) $(signal_receive_LDADD) $(LIBS) + +signalfd4$(EXEEXT): $(signalfd4_OBJECTS) $(signalfd4_DEPENDENCIES) $(EXTRA_signalfd4_DEPENDENCIES) + @rm -f signalfd4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signalfd4_OBJECTS) $(signalfd4_LDADD) $(LIBS) + +sigreturn$(EXEEXT): $(sigreturn_OBJECTS) $(sigreturn_DEPENDENCIES) $(EXTRA_sigreturn_DEPENDENCIES) + @rm -f sigreturn$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigreturn_OBJECTS) $(sigreturn_LDADD) $(LIBS) + +sleep$(EXEEXT): $(sleep_OBJECTS) $(sleep_DEPENDENCIES) $(EXTRA_sleep_DEPENDENCIES) + @rm -f sleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) + +socketcall$(EXEEXT): $(socketcall_OBJECTS) $(socketcall_DEPENDENCIES) $(EXTRA_socketcall_DEPENDENCIES) + @rm -f socketcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(socketcall_OBJECTS) $(socketcall_LDADD) $(LIBS) + +splice$(EXEEXT): $(splice_OBJECTS) $(splice_DEPENDENCIES) $(EXTRA_splice_DEPENDENCIES) + @rm -f splice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(splice_OBJECTS) $(splice_LDADD) $(LIBS) + +stack-fcall$(EXEEXT): $(stack_fcall_OBJECTS) $(stack_fcall_DEPENDENCIES) $(EXTRA_stack_fcall_DEPENDENCIES) + @rm -f stack-fcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) + +stat$(EXEEXT): $(stat_OBJECTS) $(stat_DEPENDENCIES) $(EXTRA_stat_DEPENDENCIES) + @rm -f stat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) + +stat64$(EXEEXT): $(stat64_OBJECTS) $(stat64_DEPENDENCIES) $(EXTRA_stat64_DEPENDENCIES) + @rm -f stat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stat64_OBJECTS) $(stat64_LDADD) $(LIBS) + +statfs$(EXEEXT): $(statfs_OBJECTS) $(statfs_DEPENDENCIES) $(EXTRA_statfs_DEPENDENCIES) + @rm -f statfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statfs_OBJECTS) $(statfs_LDADD) $(LIBS) + +statfs64$(EXEEXT): $(statfs64_OBJECTS) $(statfs64_DEPENDENCIES) $(EXTRA_statfs64_DEPENDENCIES) + @rm -f statfs64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statfs64_OBJECTS) $(statfs64_LDADD) $(LIBS) + +swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES) $(EXTRA_swap_DEPENDENCIES) + @rm -f swap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(swap_OBJECTS) $(swap_LDADD) $(LIBS) + +symlink$(EXEEXT): $(symlink_OBJECTS) $(symlink_DEPENDENCIES) $(EXTRA_symlink_DEPENDENCIES) + @rm -f symlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(symlink_OBJECTS) $(symlink_LDADD) $(LIBS) + +symlinkat$(EXEEXT): $(symlinkat_OBJECTS) $(symlinkat_DEPENDENCIES) $(EXTRA_symlinkat_DEPENDENCIES) + @rm -f symlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(symlinkat_OBJECTS) $(symlinkat_LDADD) $(LIBS) + +sync$(EXEEXT): $(sync_OBJECTS) $(sync_DEPENDENCIES) $(EXTRA_sync_DEPENDENCIES) + @rm -f sync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_OBJECTS) $(sync_LDADD) $(LIBS) + +sync_file_range$(EXEEXT): $(sync_file_range_OBJECTS) $(sync_file_range_DEPENDENCIES) $(EXTRA_sync_file_range_DEPENDENCIES) + @rm -f sync_file_range$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_file_range_OBJECTS) $(sync_file_range_LDADD) $(LIBS) + +sync_file_range2$(EXEEXT): $(sync_file_range2_OBJECTS) $(sync_file_range2_DEPENDENCIES) $(EXTRA_sync_file_range2_DEPENDENCIES) + @rm -f sync_file_range2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_file_range2_OBJECTS) $(sync_file_range2_LDADD) $(LIBS) + +sysinfo$(EXEEXT): $(sysinfo_OBJECTS) $(sysinfo_DEPENDENCIES) $(EXTRA_sysinfo_DEPENDENCIES) + @rm -f sysinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sysinfo_OBJECTS) $(sysinfo_LDADD) $(LIBS) + +syslog$(EXEEXT): $(syslog_OBJECTS) $(syslog_DEPENDENCIES) $(EXTRA_syslog_DEPENDENCIES) + @rm -f syslog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(syslog_OBJECTS) $(syslog_LDADD) $(LIBS) + +tee$(EXEEXT): $(tee_OBJECTS) $(tee_DEPENDENCIES) $(EXTRA_tee_DEPENDENCIES) + @rm -f tee$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tee_OBJECTS) $(tee_LDADD) $(LIBS) + +threads-execve$(EXEEXT): $(threads_execve_OBJECTS) $(threads_execve_DEPENDENCIES) $(EXTRA_threads_execve_DEPENDENCIES) + @rm -f threads-execve$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(threads_execve_OBJECTS) $(threads_execve_LDADD) $(LIBS) + +time$(EXEEXT): $(time_OBJECTS) $(time_DEPENDENCIES) $(EXTRA_time_DEPENDENCIES) + @rm -f time$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(time_OBJECTS) $(time_LDADD) $(LIBS) + +timer_create$(EXEEXT): $(timer_create_OBJECTS) $(timer_create_DEPENDENCIES) $(EXTRA_timer_create_DEPENDENCIES) + @rm -f timer_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timer_create_OBJECTS) $(timer_create_LDADD) $(LIBS) + +timer_xettime$(EXEEXT): $(timer_xettime_OBJECTS) $(timer_xettime_DEPENDENCIES) $(EXTRA_timer_xettime_DEPENDENCIES) + @rm -f timer_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timer_xettime_OBJECTS) $(timer_xettime_LDADD) $(LIBS) + +timerfd_xettime$(EXEEXT): $(timerfd_xettime_OBJECTS) $(timerfd_xettime_DEPENDENCIES) $(EXTRA_timerfd_xettime_DEPENDENCIES) + @rm -f timerfd_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timerfd_xettime_OBJECTS) $(timerfd_xettime_LDADD) $(LIBS) + +times$(EXEEXT): $(times_OBJECTS) $(times_DEPENDENCIES) $(EXTRA_times_DEPENDENCIES) + @rm -f times$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(times_OBJECTS) $(times_LDADD) $(LIBS) + +times-fail$(EXEEXT): $(times_fail_OBJECTS) $(times_fail_DEPENDENCIES) $(EXTRA_times_fail_DEPENDENCIES) + @rm -f times-fail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(times_fail_OBJECTS) $(times_fail_LDADD) $(LIBS) + +truncate$(EXEEXT): $(truncate_OBJECTS) $(truncate_DEPENDENCIES) $(EXTRA_truncate_DEPENDENCIES) + @rm -f truncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(truncate_OBJECTS) $(truncate_LDADD) $(LIBS) + +truncate64$(EXEEXT): $(truncate64_OBJECTS) $(truncate64_DEPENDENCIES) $(EXTRA_truncate64_DEPENDENCIES) + @rm -f truncate64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(truncate64_OBJECTS) $(truncate64_LDADD) $(LIBS) + +ugetrlimit$(EXEEXT): $(ugetrlimit_OBJECTS) $(ugetrlimit_DEPENDENCIES) $(EXTRA_ugetrlimit_DEPENDENCIES) + @rm -f ugetrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ugetrlimit_OBJECTS) $(ugetrlimit_LDADD) $(LIBS) + +uio$(EXEEXT): $(uio_OBJECTS) $(uio_DEPENDENCIES) $(EXTRA_uio_DEPENDENCIES) + @rm -f uio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(uio_OBJECTS) $(uio_LDADD) $(LIBS) + +umask$(EXEEXT): $(umask_OBJECTS) $(umask_DEPENDENCIES) $(EXTRA_umask_DEPENDENCIES) + @rm -f umask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umask_OBJECTS) $(umask_LDADD) $(LIBS) + +umount$(EXEEXT): $(umount_OBJECTS) $(umount_DEPENDENCIES) $(EXTRA_umount_DEPENDENCIES) + @rm -f umount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umount_OBJECTS) $(umount_LDADD) $(LIBS) + +umount2$(EXEEXT): $(umount2_OBJECTS) $(umount2_DEPENDENCIES) $(EXTRA_umount2_DEPENDENCIES) + @rm -f umount2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umount2_OBJECTS) $(umount2_LDADD) $(LIBS) + +umoven-illptr$(EXEEXT): $(umoven_illptr_OBJECTS) $(umoven_illptr_DEPENDENCIES) $(EXTRA_umoven_illptr_DEPENDENCIES) + @rm -f umoven-illptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umoven_illptr_OBJECTS) $(umoven_illptr_LDADD) $(LIBS) + +umovestr$(EXEEXT): $(umovestr_OBJECTS) $(umovestr_DEPENDENCIES) $(EXTRA_umovestr_DEPENDENCIES) + @rm -f umovestr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr_OBJECTS) $(umovestr_LDADD) $(LIBS) + +umovestr-illptr$(EXEEXT): $(umovestr_illptr_OBJECTS) $(umovestr_illptr_DEPENDENCIES) $(EXTRA_umovestr_illptr_DEPENDENCIES) + @rm -f umovestr-illptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr_illptr_OBJECTS) $(umovestr_illptr_LDADD) $(LIBS) + +umovestr2$(EXEEXT): $(umovestr2_OBJECTS) $(umovestr2_DEPENDENCIES) $(EXTRA_umovestr2_DEPENDENCIES) + @rm -f umovestr2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr2_OBJECTS) $(umovestr2_LDADD) $(LIBS) + +umovestr3$(EXEEXT): $(umovestr3_OBJECTS) $(umovestr3_DEPENDENCIES) $(EXTRA_umovestr3_DEPENDENCIES) + @rm -f umovestr3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr3_OBJECTS) $(umovestr3_LDADD) $(LIBS) + +uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) $(EXTRA_uname_DEPENDENCIES) + @rm -f uname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) + +unix-pair-send-recv$(EXEEXT): $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_DEPENDENCIES) $(EXTRA_unix_pair_send_recv_DEPENDENCIES) + @rm -f unix-pair-send-recv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_LDADD) $(LIBS) + +unix-pair-sendto-recvfrom$(EXEEXT): $(unix_pair_sendto_recvfrom_OBJECTS) $(unix_pair_sendto_recvfrom_DEPENDENCIES) $(EXTRA_unix_pair_sendto_recvfrom_DEPENDENCIES) + @rm -f unix-pair-sendto-recvfrom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unix_pair_sendto_recvfrom_OBJECTS) $(unix_pair_sendto_recvfrom_LDADD) $(LIBS) + +unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) $(EXTRA_unlink_DEPENDENCIES) + @rm -f unlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) + +unlinkat$(EXEEXT): $(unlinkat_OBJECTS) $(unlinkat_DEPENDENCIES) $(EXTRA_unlinkat_DEPENDENCIES) + @rm -f unlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unlinkat_OBJECTS) $(unlinkat_LDADD) $(LIBS) + +unshare$(EXEEXT): $(unshare_OBJECTS) $(unshare_DEPENDENCIES) $(EXTRA_unshare_DEPENDENCIES) + @rm -f unshare$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unshare_OBJECTS) $(unshare_LDADD) $(LIBS) + +userfaultfd$(EXEEXT): $(userfaultfd_OBJECTS) $(userfaultfd_DEPENDENCIES) $(EXTRA_userfaultfd_DEPENDENCIES) + @rm -f userfaultfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(userfaultfd_OBJECTS) $(userfaultfd_LDADD) $(LIBS) + +ustat$(EXEEXT): $(ustat_OBJECTS) $(ustat_DEPENDENCIES) $(EXTRA_ustat_DEPENDENCIES) + @rm -f ustat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ustat_OBJECTS) $(ustat_LDADD) $(LIBS) + +utime$(EXEEXT): $(utime_OBJECTS) $(utime_DEPENDENCIES) $(EXTRA_utime_DEPENDENCIES) + @rm -f utime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utime_OBJECTS) $(utime_LDADD) $(LIBS) + +utimensat$(EXEEXT): $(utimensat_OBJECTS) $(utimensat_DEPENDENCIES) $(EXTRA_utimensat_DEPENDENCIES) + @rm -f utimensat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_OBJECTS) $(utimensat_LDADD) $(LIBS) + +utimes$(EXEEXT): $(utimes_OBJECTS) $(utimes_DEPENDENCIES) $(EXTRA_utimes_DEPENDENCIES) + @rm -f utimes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimes_OBJECTS) $(utimes_LDADD) $(LIBS) + +vfork-f$(EXEEXT): $(vfork_f_OBJECTS) $(vfork_f_DEPENDENCIES) $(EXTRA_vfork_f_DEPENDENCIES) + @rm -f vfork-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfork_f_OBJECTS) $(vfork_f_LDADD) $(LIBS) + +vhangup$(EXEEXT): $(vhangup_OBJECTS) $(vhangup_DEPENDENCIES) $(EXTRA_vhangup_DEPENDENCIES) + @rm -f vhangup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vhangup_OBJECTS) $(vhangup_LDADD) $(LIBS) + +vmsplice$(EXEEXT): $(vmsplice_OBJECTS) $(vmsplice_DEPENDENCIES) $(EXTRA_vmsplice_DEPENDENCIES) + @rm -f vmsplice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vmsplice_OBJECTS) $(vmsplice_LDADD) $(LIBS) + +wait4$(EXEEXT): $(wait4_OBJECTS) $(wait4_DEPENDENCIES) $(EXTRA_wait4_DEPENDENCIES) + @rm -f wait4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wait4_OBJECTS) $(wait4_LDADD) $(LIBS) + +wait4-v$(EXEEXT): $(wait4_v_OBJECTS) $(wait4_v_DEPENDENCIES) $(EXTRA_wait4_v_DEPENDENCIES) + @rm -f wait4-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wait4_v_OBJECTS) $(wait4_v_LDADD) $(LIBS) + +waitid$(EXEEXT): $(waitid_OBJECTS) $(waitid_DEPENDENCIES) $(EXTRA_waitid_DEPENDENCIES) + @rm -f waitid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitid_OBJECTS) $(waitid_LDADD) $(LIBS) + +waitid-v$(EXEEXT): $(waitid_v_OBJECTS) $(waitid_v_DEPENDENCIES) $(EXTRA_waitid_v_DEPENDENCIES) + @rm -f waitid-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitid_v_OBJECTS) $(waitid_v_LDADD) $(LIBS) + +waitpid$(EXEEXT): $(waitpid_OBJECTS) $(waitpid_DEPENDENCIES) $(EXTRA_waitpid_DEPENDENCIES) + @rm -f waitpid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitpid_OBJECTS) $(waitpid_LDADD) $(LIBS) + +xattr$(EXEEXT): $(xattr_OBJECTS) $(xattr_DEPENDENCIES) $(EXTRA_xattr_DEPENDENCIES) + @rm -f xattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xattr_OBJECTS) $(xattr_LDADD) $(LIBS) + +xattr-strings$(EXEEXT): $(xattr_strings_OBJECTS) $(xattr_strings_DEPENDENCIES) $(EXTRA_xattr_strings_DEPENDENCIES) + @rm -f xattr-strings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xattr_strings_OBJECTS) $(xattr_strings_LDADD) $(LIBS) + +xet_robust_list$(EXEEXT): $(xet_robust_list_OBJECTS) $(xet_robust_list_DEPENDENCIES) $(EXTRA_xet_robust_list_DEPENDENCIES) + @rm -f xet_robust_list$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xet_robust_list_OBJECTS) $(xet_robust_list_LDADD) $(LIBS) + +xetitimer$(EXEEXT): $(xetitimer_OBJECTS) $(xetitimer_DEPENDENCIES) $(EXTRA_xetitimer_DEPENDENCIES) + @rm -f xetitimer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetitimer_OBJECTS) $(xetitimer_LDADD) $(LIBS) + +xetpgid$(EXEEXT): $(xetpgid_OBJECTS) $(xetpgid_DEPENDENCIES) $(EXTRA_xetpgid_DEPENDENCIES) + @rm -f xetpgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetpgid_OBJECTS) $(xetpgid_LDADD) $(LIBS) + +xetpriority$(EXEEXT): $(xetpriority_OBJECTS) $(xetpriority_DEPENDENCIES) $(EXTRA_xetpriority_DEPENDENCIES) + @rm -f xetpriority$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetpriority_OBJECTS) $(xetpriority_LDADD) $(LIBS) + +xettimeofday$(EXEEXT): $(xettimeofday_OBJECTS) $(xettimeofday_DEPENDENCIES) $(EXTRA_xettimeofday_DEPENDENCIES) + @rm -f xettimeofday$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xettimeofday_OBJECTS) $(xettimeofday_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +libtests_a-errno2name.o: errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='errno2name.c' object='libtests_a-errno2name.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c + +libtests_a-errno2name.obj: errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.obj -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.obj `if test -f 'errno2name.c'; then $(CYGPATH_W) 'errno2name.c'; else $(CYGPATH_W) '$(srcdir)/errno2name.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='errno2name.c' object='libtests_a-errno2name.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-errno2name.obj `if test -f 'errno2name.c'; then $(CYGPATH_W) 'errno2name.c'; else $(CYGPATH_W) '$(srcdir)/errno2name.c'; fi` + +libtests_a-error_msg.o: error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-error_msg.o -MD -MP -MF $(DEPDIR)/libtests_a-error_msg.Tpo -c -o libtests_a-error_msg.o `test -f 'error_msg.c' || echo '$(srcdir)/'`error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-error_msg.Tpo $(DEPDIR)/libtests_a-error_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_msg.c' object='libtests_a-error_msg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-error_msg.o `test -f 'error_msg.c' || echo '$(srcdir)/'`error_msg.c + +libtests_a-error_msg.obj: error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-error_msg.obj -MD -MP -MF $(DEPDIR)/libtests_a-error_msg.Tpo -c -o libtests_a-error_msg.obj `if test -f 'error_msg.c'; then $(CYGPATH_W) 'error_msg.c'; else $(CYGPATH_W) '$(srcdir)/error_msg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-error_msg.Tpo $(DEPDIR)/libtests_a-error_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_msg.c' object='libtests_a-error_msg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-error_msg.obj `if test -f 'error_msg.c'; then $(CYGPATH_W) 'error_msg.c'; else $(CYGPATH_W) '$(srcdir)/error_msg.c'; fi` + +libtests_a-fill_memory.o: fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-fill_memory.o -MD -MP -MF $(DEPDIR)/libtests_a-fill_memory.Tpo -c -o libtests_a-fill_memory.o `test -f 'fill_memory.c' || echo '$(srcdir)/'`fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-fill_memory.Tpo $(DEPDIR)/libtests_a-fill_memory.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fill_memory.c' object='libtests_a-fill_memory.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-fill_memory.o `test -f 'fill_memory.c' || echo '$(srcdir)/'`fill_memory.c + +libtests_a-fill_memory.obj: fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-fill_memory.obj -MD -MP -MF $(DEPDIR)/libtests_a-fill_memory.Tpo -c -o libtests_a-fill_memory.obj `if test -f 'fill_memory.c'; then $(CYGPATH_W) 'fill_memory.c'; else $(CYGPATH_W) '$(srcdir)/fill_memory.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-fill_memory.Tpo $(DEPDIR)/libtests_a-fill_memory.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fill_memory.c' object='libtests_a-fill_memory.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-fill_memory.obj `if test -f 'fill_memory.c'; then $(CYGPATH_W) 'fill_memory.c'; else $(CYGPATH_W) '$(srcdir)/fill_memory.c'; fi` + +libtests_a-get_page_size.o: get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_page_size.o -MD -MP -MF $(DEPDIR)/libtests_a-get_page_size.Tpo -c -o libtests_a-get_page_size.o `test -f 'get_page_size.c' || echo '$(srcdir)/'`get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_page_size.Tpo $(DEPDIR)/libtests_a-get_page_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_page_size.c' object='libtests_a-get_page_size.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.o `test -f 'get_page_size.c' || echo '$(srcdir)/'`get_page_size.c + +libtests_a-get_page_size.obj: get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_page_size.obj -MD -MP -MF $(DEPDIR)/libtests_a-get_page_size.Tpo -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_page_size.Tpo $(DEPDIR)/libtests_a-get_page_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_page_size.c' object='libtests_a-get_page_size.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` + +libtests_a-hexdump_strdup.o: hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexdump_strdup.c' object='libtests_a-hexdump_strdup.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c + +libtests_a-hexdump_strdup.obj: hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.obj -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.obj `if test -f 'hexdump_strdup.c'; then $(CYGPATH_W) 'hexdump_strdup.c'; else $(CYGPATH_W) '$(srcdir)/hexdump_strdup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexdump_strdup.c' object='libtests_a-hexdump_strdup.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexdump_strdup.obj `if test -f 'hexdump_strdup.c'; then $(CYGPATH_W) 'hexdump_strdup.c'; else $(CYGPATH_W) '$(srcdir)/hexdump_strdup.c'; fi` + +libtests_a-hexquote_strndup.o: hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexquote_strndup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexquote_strndup.Tpo -c -o libtests_a-hexquote_strndup.o `test -f 'hexquote_strndup.c' || echo '$(srcdir)/'`hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexquote_strndup.Tpo $(DEPDIR)/libtests_a-hexquote_strndup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexquote_strndup.c' object='libtests_a-hexquote_strndup.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.o `test -f 'hexquote_strndup.c' || echo '$(srcdir)/'`hexquote_strndup.c + +libtests_a-hexquote_strndup.obj: hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexquote_strndup.obj -MD -MP -MF $(DEPDIR)/libtests_a-hexquote_strndup.Tpo -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexquote_strndup.Tpo $(DEPDIR)/libtests_a-hexquote_strndup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexquote_strndup.c' object='libtests_a-hexquote_strndup.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` + +libtests_a-inode_of_sockfd.o: inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.o -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inode_of_sockfd.c' object='libtests_a-inode_of_sockfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c + +libtests_a-inode_of_sockfd.obj: inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.obj `if test -f 'inode_of_sockfd.c'; then $(CYGPATH_W) 'inode_of_sockfd.c'; else $(CYGPATH_W) '$(srcdir)/inode_of_sockfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inode_of_sockfd.c' object='libtests_a-inode_of_sockfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-inode_of_sockfd.obj `if test -f 'inode_of_sockfd.c'; then $(CYGPATH_W) 'inode_of_sockfd.c'; else $(CYGPATH_W) '$(srcdir)/inode_of_sockfd.c'; fi` + +libtests_a-libmmsg.o: libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libmmsg.o -MD -MP -MF $(DEPDIR)/libtests_a-libmmsg.Tpo -c -o libtests_a-libmmsg.o `test -f 'libmmsg.c' || echo '$(srcdir)/'`libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libmmsg.Tpo $(DEPDIR)/libtests_a-libmmsg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libmmsg.c' object='libtests_a-libmmsg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libmmsg.o `test -f 'libmmsg.c' || echo '$(srcdir)/'`libmmsg.c + +libtests_a-libmmsg.obj: libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libmmsg.obj -MD -MP -MF $(DEPDIR)/libtests_a-libmmsg.Tpo -c -o libtests_a-libmmsg.obj `if test -f 'libmmsg.c'; then $(CYGPATH_W) 'libmmsg.c'; else $(CYGPATH_W) '$(srcdir)/libmmsg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libmmsg.Tpo $(DEPDIR)/libtests_a-libmmsg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libmmsg.c' object='libtests_a-libmmsg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libmmsg.obj `if test -f 'libmmsg.c'; then $(CYGPATH_W) 'libmmsg.c'; else $(CYGPATH_W) '$(srcdir)/libmmsg.c'; fi` + +libtests_a-libsocketcall.o: libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libsocketcall.o -MD -MP -MF $(DEPDIR)/libtests_a-libsocketcall.Tpo -c -o libtests_a-libsocketcall.o `test -f 'libsocketcall.c' || echo '$(srcdir)/'`libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libsocketcall.Tpo $(DEPDIR)/libtests_a-libsocketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libsocketcall.c' object='libtests_a-libsocketcall.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libsocketcall.o `test -f 'libsocketcall.c' || echo '$(srcdir)/'`libsocketcall.c + +libtests_a-libsocketcall.obj: libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libsocketcall.obj -MD -MP -MF $(DEPDIR)/libtests_a-libsocketcall.Tpo -c -o libtests_a-libsocketcall.obj `if test -f 'libsocketcall.c'; then $(CYGPATH_W) 'libsocketcall.c'; else $(CYGPATH_W) '$(srcdir)/libsocketcall.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libsocketcall.Tpo $(DEPDIR)/libtests_a-libsocketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libsocketcall.c' object='libtests_a-libsocketcall.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libsocketcall.obj `if test -f 'libsocketcall.c'; then $(CYGPATH_W) 'libsocketcall.c'; else $(CYGPATH_W) '$(srcdir)/libsocketcall.c'; fi` + +libtests_a-overflowuid.o: overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-overflowuid.o -MD -MP -MF $(DEPDIR)/libtests_a-overflowuid.Tpo -c -o libtests_a-overflowuid.o `test -f 'overflowuid.c' || echo '$(srcdir)/'`overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-overflowuid.Tpo $(DEPDIR)/libtests_a-overflowuid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='overflowuid.c' object='libtests_a-overflowuid.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-overflowuid.o `test -f 'overflowuid.c' || echo '$(srcdir)/'`overflowuid.c + +libtests_a-overflowuid.obj: overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-overflowuid.obj -MD -MP -MF $(DEPDIR)/libtests_a-overflowuid.Tpo -c -o libtests_a-overflowuid.obj `if test -f 'overflowuid.c'; then $(CYGPATH_W) 'overflowuid.c'; else $(CYGPATH_W) '$(srcdir)/overflowuid.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-overflowuid.Tpo $(DEPDIR)/libtests_a-overflowuid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='overflowuid.c' object='libtests_a-overflowuid.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-overflowuid.obj `if test -f 'overflowuid.c'; then $(CYGPATH_W) 'overflowuid.c'; else $(CYGPATH_W) '$(srcdir)/overflowuid.c'; fi` + +libtests_a-pipe_maxfd.o: pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-pipe_maxfd.o -MD -MP -MF $(DEPDIR)/libtests_a-pipe_maxfd.Tpo -c -o libtests_a-pipe_maxfd.o `test -f 'pipe_maxfd.c' || echo '$(srcdir)/'`pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-pipe_maxfd.Tpo $(DEPDIR)/libtests_a-pipe_maxfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe_maxfd.c' object='libtests_a-pipe_maxfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-pipe_maxfd.o `test -f 'pipe_maxfd.c' || echo '$(srcdir)/'`pipe_maxfd.c + +libtests_a-pipe_maxfd.obj: pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-pipe_maxfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-pipe_maxfd.Tpo -c -o libtests_a-pipe_maxfd.obj `if test -f 'pipe_maxfd.c'; then $(CYGPATH_W) 'pipe_maxfd.c'; else $(CYGPATH_W) '$(srcdir)/pipe_maxfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-pipe_maxfd.Tpo $(DEPDIR)/libtests_a-pipe_maxfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe_maxfd.c' object='libtests_a-pipe_maxfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-pipe_maxfd.obj `if test -f 'pipe_maxfd.c'; then $(CYGPATH_W) 'pipe_maxfd.c'; else $(CYGPATH_W) '$(srcdir)/pipe_maxfd.c'; fi` + +libtests_a-print_quoted_string.o: print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_quoted_string.o -MD -MP -MF $(DEPDIR)/libtests_a-print_quoted_string.Tpo -c -o libtests_a-print_quoted_string.o `test -f 'print_quoted_string.c' || echo '$(srcdir)/'`print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_quoted_string.Tpo $(DEPDIR)/libtests_a-print_quoted_string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_quoted_string.c' object='libtests_a-print_quoted_string.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.o `test -f 'print_quoted_string.c' || echo '$(srcdir)/'`print_quoted_string.c + +libtests_a-print_quoted_string.obj: print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_quoted_string.obj -MD -MP -MF $(DEPDIR)/libtests_a-print_quoted_string.Tpo -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_quoted_string.Tpo $(DEPDIR)/libtests_a-print_quoted_string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_quoted_string.c' object='libtests_a-print_quoted_string.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` + +libtests_a-printflags.o: printflags.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.o -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printflags.c' object='libtests_a-printflags.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c + +libtests_a-printflags.obj: printflags.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.obj -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.obj `if test -f 'printflags.c'; then $(CYGPATH_W) 'printflags.c'; else $(CYGPATH_W) '$(srcdir)/printflags.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printflags.c' object='libtests_a-printflags.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printflags.obj `if test -f 'printflags.c'; then $(CYGPATH_W) 'printflags.c'; else $(CYGPATH_W) '$(srcdir)/printflags.c'; fi` + +libtests_a-printxval.o: printxval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printxval.o -MD -MP -MF $(DEPDIR)/libtests_a-printxval.Tpo -c -o libtests_a-printxval.o `test -f 'printxval.c' || echo '$(srcdir)/'`printxval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printxval.Tpo $(DEPDIR)/libtests_a-printxval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printxval.c' object='libtests_a-printxval.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printxval.o `test -f 'printxval.c' || echo '$(srcdir)/'`printxval.c + +libtests_a-printxval.obj: printxval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printxval.obj -MD -MP -MF $(DEPDIR)/libtests_a-printxval.Tpo -c -o libtests_a-printxval.obj `if test -f 'printxval.c'; then $(CYGPATH_W) 'printxval.c'; else $(CYGPATH_W) '$(srcdir)/printxval.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printxval.Tpo $(DEPDIR)/libtests_a-printxval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printxval.c' object='libtests_a-printxval.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printxval.obj `if test -f 'printxval.c'; then $(CYGPATH_W) 'printxval.c'; else $(CYGPATH_W) '$(srcdir)/printxval.c'; fi` + +libtests_a-signal2name.o: signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-signal2name.o -MD -MP -MF $(DEPDIR)/libtests_a-signal2name.Tpo -c -o libtests_a-signal2name.o `test -f 'signal2name.c' || echo '$(srcdir)/'`signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-signal2name.Tpo $(DEPDIR)/libtests_a-signal2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal2name.c' object='libtests_a-signal2name.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.o `test -f 'signal2name.c' || echo '$(srcdir)/'`signal2name.c + +libtests_a-signal2name.obj: signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-signal2name.obj -MD -MP -MF $(DEPDIR)/libtests_a-signal2name.Tpo -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-signal2name.Tpo $(DEPDIR)/libtests_a-signal2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal2name.c' object='libtests_a-signal2name.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` + +libtests_a-sprintrc.o: sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.o -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sprintrc.c' object='libtests_a-sprintrc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c + +libtests_a-sprintrc.obj: sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.obj -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.obj `if test -f 'sprintrc.c'; then $(CYGPATH_W) 'sprintrc.c'; else $(CYGPATH_W) '$(srcdir)/sprintrc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sprintrc.c' object='libtests_a-sprintrc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-sprintrc.obj `if test -f 'sprintrc.c'; then $(CYGPATH_W) 'sprintrc.c'; else $(CYGPATH_W) '$(srcdir)/sprintrc.c'; fi` + +libtests_a-tail_alloc.o: tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tail_alloc.o -MD -MP -MF $(DEPDIR)/libtests_a-tail_alloc.Tpo -c -o libtests_a-tail_alloc.o `test -f 'tail_alloc.c' || echo '$(srcdir)/'`tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tail_alloc.Tpo $(DEPDIR)/libtests_a-tail_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tail_alloc.c' object='libtests_a-tail_alloc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.o `test -f 'tail_alloc.c' || echo '$(srcdir)/'`tail_alloc.c + +libtests_a-tail_alloc.obj: tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tail_alloc.obj -MD -MP -MF $(DEPDIR)/libtests_a-tail_alloc.Tpo -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tail_alloc.Tpo $(DEPDIR)/libtests_a-tail_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tail_alloc.c' object='libtests_a-tail_alloc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` + +libtests_a-tprintf.o: tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.o -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tprintf.c' object='libtests_a-tprintf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c + +libtests_a-tprintf.obj: tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.obj -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.obj `if test -f 'tprintf.c'; then $(CYGPATH_W) 'tprintf.c'; else $(CYGPATH_W) '$(srcdir)/tprintf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tprintf.c' object='libtests_a-tprintf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tprintf.obj `if test -f 'tprintf.c'; then $(CYGPATH_W) 'tprintf.c'; else $(CYGPATH_W) '$(srcdir)/tprintf.c'; fi` + +fstat64-fstat64.o: fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstat64-fstat64.o -MD -MP -MF $(DEPDIR)/fstat64-fstat64.Tpo -c -o fstat64-fstat64.o `test -f 'fstat64.c' || echo '$(srcdir)/'`fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstat64-fstat64.Tpo $(DEPDIR)/fstat64-fstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat64.c' object='fstat64-fstat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstat64-fstat64.o `test -f 'fstat64.c' || echo '$(srcdir)/'`fstat64.c + +fstat64-fstat64.obj: fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstat64-fstat64.obj -MD -MP -MF $(DEPDIR)/fstat64-fstat64.Tpo -c -o fstat64-fstat64.obj `if test -f 'fstat64.c'; then $(CYGPATH_W) 'fstat64.c'; else $(CYGPATH_W) '$(srcdir)/fstat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstat64-fstat64.Tpo $(DEPDIR)/fstat64-fstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat64.c' object='fstat64-fstat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstat64-fstat64.obj `if test -f 'fstat64.c'; then $(CYGPATH_W) 'fstat64.c'; else $(CYGPATH_W) '$(srcdir)/fstat64.c'; fi` + +fstatat64-fstatat64.o: fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstatat64-fstatat64.o -MD -MP -MF $(DEPDIR)/fstatat64-fstatat64.Tpo -c -o fstatat64-fstatat64.o `test -f 'fstatat64.c' || echo '$(srcdir)/'`fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstatat64-fstatat64.Tpo $(DEPDIR)/fstatat64-fstatat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatat64.c' object='fstatat64-fstatat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstatat64-fstatat64.o `test -f 'fstatat64.c' || echo '$(srcdir)/'`fstatat64.c + +fstatat64-fstatat64.obj: fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstatat64-fstatat64.obj -MD -MP -MF $(DEPDIR)/fstatat64-fstatat64.Tpo -c -o fstatat64-fstatat64.obj `if test -f 'fstatat64.c'; then $(CYGPATH_W) 'fstatat64.c'; else $(CYGPATH_W) '$(srcdir)/fstatat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstatat64-fstatat64.Tpo $(DEPDIR)/fstatat64-fstatat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatat64.c' object='fstatat64-fstatat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstatat64-fstatat64.obj `if test -f 'fstatat64.c'; then $(CYGPATH_W) 'fstatat64.c'; else $(CYGPATH_W) '$(srcdir)/fstatat64.c'; fi` + +ftruncate64-ftruncate64.o: ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ftruncate64-ftruncate64.o -MD -MP -MF $(DEPDIR)/ftruncate64-ftruncate64.Tpo -c -o ftruncate64-ftruncate64.o `test -f 'ftruncate64.c' || echo '$(srcdir)/'`ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ftruncate64-ftruncate64.Tpo $(DEPDIR)/ftruncate64-ftruncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftruncate64.c' object='ftruncate64-ftruncate64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ftruncate64-ftruncate64.o `test -f 'ftruncate64.c' || echo '$(srcdir)/'`ftruncate64.c + +ftruncate64-ftruncate64.obj: ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ftruncate64-ftruncate64.obj -MD -MP -MF $(DEPDIR)/ftruncate64-ftruncate64.Tpo -c -o ftruncate64-ftruncate64.obj `if test -f 'ftruncate64.c'; then $(CYGPATH_W) 'ftruncate64.c'; else $(CYGPATH_W) '$(srcdir)/ftruncate64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ftruncate64-ftruncate64.Tpo $(DEPDIR)/ftruncate64-ftruncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftruncate64.c' object='ftruncate64-ftruncate64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ftruncate64-ftruncate64.obj `if test -f 'ftruncate64.c'; then $(CYGPATH_W) 'ftruncate64.c'; else $(CYGPATH_W) '$(srcdir)/ftruncate64.c'; fi` + +lstat64-lstat64.o: lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lstat64-lstat64.o -MD -MP -MF $(DEPDIR)/lstat64-lstat64.Tpo -c -o lstat64-lstat64.o `test -f 'lstat64.c' || echo '$(srcdir)/'`lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lstat64-lstat64.Tpo $(DEPDIR)/lstat64-lstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lstat64.c' object='lstat64-lstat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lstat64-lstat64.o `test -f 'lstat64.c' || echo '$(srcdir)/'`lstat64.c + +lstat64-lstat64.obj: lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lstat64-lstat64.obj -MD -MP -MF $(DEPDIR)/lstat64-lstat64.Tpo -c -o lstat64-lstat64.obj `if test -f 'lstat64.c'; then $(CYGPATH_W) 'lstat64.c'; else $(CYGPATH_W) '$(srcdir)/lstat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lstat64-lstat64.Tpo $(DEPDIR)/lstat64-lstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lstat64.c' object='lstat64-lstat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lstat64-lstat64.obj `if test -f 'lstat64.c'; then $(CYGPATH_W) 'lstat64.c'; else $(CYGPATH_W) '$(srcdir)/lstat64.c'; fi` + +mmap64-mmap64.o: mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64-mmap64.o -MD -MP -MF $(DEPDIR)/mmap64-mmap64.Tpo -c -o mmap64-mmap64.o `test -f 'mmap64.c' || echo '$(srcdir)/'`mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64-mmap64.Tpo $(DEPDIR)/mmap64-mmap64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64.c' object='mmap64-mmap64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.o `test -f 'mmap64.c' || echo '$(srcdir)/'`mmap64.c + +mmap64-mmap64.obj: mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64-mmap64.obj -MD -MP -MF $(DEPDIR)/mmap64-mmap64.Tpo -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64-mmap64.Tpo $(DEPDIR)/mmap64-mmap64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64.c' object='mmap64-mmap64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` + +newfstatat-newfstatat.o: newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.o -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='newfstatat.c' object='newfstatat-newfstatat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c + +newfstatat-newfstatat.obj: newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.obj -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.obj `if test -f 'newfstatat.c'; then $(CYGPATH_W) 'newfstatat.c'; else $(CYGPATH_W) '$(srcdir)/newfstatat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='newfstatat.c' object='newfstatat-newfstatat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o newfstatat-newfstatat.obj `if test -f 'newfstatat.c'; then $(CYGPATH_W) 'newfstatat.c'; else $(CYGPATH_W) '$(srcdir)/newfstatat.c'; fi` + +pread64_pwrite64-pread64-pwrite64.o: pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pread64_pwrite64-pread64-pwrite64.o -MD -MP -MF $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo -c -o pread64_pwrite64-pread64-pwrite64.o `test -f 'pread64-pwrite64.c' || echo '$(srcdir)/'`pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pread64-pwrite64.c' object='pread64_pwrite64-pread64-pwrite64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pread64_pwrite64-pread64-pwrite64.o `test -f 'pread64-pwrite64.c' || echo '$(srcdir)/'`pread64-pwrite64.c + +pread64_pwrite64-pread64-pwrite64.obj: pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pread64_pwrite64-pread64-pwrite64.obj -MD -MP -MF $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo -c -o pread64_pwrite64-pread64-pwrite64.obj `if test -f 'pread64-pwrite64.c'; then $(CYGPATH_W) 'pread64-pwrite64.c'; else $(CYGPATH_W) '$(srcdir)/pread64-pwrite64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pread64-pwrite64.c' object='pread64_pwrite64-pread64-pwrite64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pread64_pwrite64-pread64-pwrite64.obj `if test -f 'pread64-pwrite64.c'; then $(CYGPATH_W) 'pread64-pwrite64.c'; else $(CYGPATH_W) '$(srcdir)/pread64-pwrite64.c'; fi` + +preadv-preadv.o: preadv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv-preadv.o -MD -MP -MF $(DEPDIR)/preadv-preadv.Tpo -c -o preadv-preadv.o `test -f 'preadv.c' || echo '$(srcdir)/'`preadv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv-preadv.Tpo $(DEPDIR)/preadv-preadv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv.c' object='preadv-preadv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv-preadv.o `test -f 'preadv.c' || echo '$(srcdir)/'`preadv.c + +preadv-preadv.obj: preadv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv-preadv.obj -MD -MP -MF $(DEPDIR)/preadv-preadv.Tpo -c -o preadv-preadv.obj `if test -f 'preadv.c'; then $(CYGPATH_W) 'preadv.c'; else $(CYGPATH_W) '$(srcdir)/preadv.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv-preadv.Tpo $(DEPDIR)/preadv-preadv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv.c' object='preadv-preadv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv-preadv.obj `if test -f 'preadv.c'; then $(CYGPATH_W) 'preadv.c'; else $(CYGPATH_W) '$(srcdir)/preadv.c'; fi` + +preadv_pwritev-preadv-pwritev.o: preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv_pwritev-preadv-pwritev.o -MD -MP -MF $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo -c -o preadv_pwritev-preadv-pwritev.o `test -f 'preadv-pwritev.c' || echo '$(srcdir)/'`preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo $(DEPDIR)/preadv_pwritev-preadv-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv-pwritev.c' object='preadv_pwritev-preadv-pwritev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv_pwritev-preadv-pwritev.o `test -f 'preadv-pwritev.c' || echo '$(srcdir)/'`preadv-pwritev.c + +preadv_pwritev-preadv-pwritev.obj: preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv_pwritev-preadv-pwritev.obj -MD -MP -MF $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo -c -o preadv_pwritev-preadv-pwritev.obj `if test -f 'preadv-pwritev.c'; then $(CYGPATH_W) 'preadv-pwritev.c'; else $(CYGPATH_W) '$(srcdir)/preadv-pwritev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo $(DEPDIR)/preadv_pwritev-preadv-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv-pwritev.c' object='preadv_pwritev-preadv-pwritev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv_pwritev-preadv-pwritev.obj `if test -f 'preadv-pwritev.c'; then $(CYGPATH_W) 'preadv-pwritev.c'; else $(CYGPATH_W) '$(srcdir)/preadv-pwritev.c'; fi` + +pwritev-pwritev.o: pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pwritev-pwritev.o -MD -MP -MF $(DEPDIR)/pwritev-pwritev.Tpo -c -o pwritev-pwritev.o `test -f 'pwritev.c' || echo '$(srcdir)/'`pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwritev-pwritev.Tpo $(DEPDIR)/pwritev-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pwritev.c' object='pwritev-pwritev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pwritev-pwritev.o `test -f 'pwritev.c' || echo '$(srcdir)/'`pwritev.c + +pwritev-pwritev.obj: pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pwritev-pwritev.obj -MD -MP -MF $(DEPDIR)/pwritev-pwritev.Tpo -c -o pwritev-pwritev.obj `if test -f 'pwritev.c'; then $(CYGPATH_W) 'pwritev.c'; else $(CYGPATH_W) '$(srcdir)/pwritev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwritev-pwritev.Tpo $(DEPDIR)/pwritev-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pwritev.c' object='pwritev-pwritev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pwritev-pwritev.obj `if test -f 'pwritev.c'; then $(CYGPATH_W) 'pwritev.c'; else $(CYGPATH_W) '$(srcdir)/pwritev.c'; fi` + +stat64-stat64.o: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stat64-stat64.o -MD -MP -MF $(DEPDIR)/stat64-stat64.Tpo -c -o stat64-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat64-stat64.Tpo $(DEPDIR)/stat64-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='stat64-stat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stat64-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c + +stat64-stat64.obj: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stat64-stat64.obj -MD -MP -MF $(DEPDIR)/stat64-stat64.Tpo -c -o stat64-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat64-stat64.Tpo $(DEPDIR)/stat64-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='stat64-stat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stat64-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` + +statfs-statfs.o: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT statfs-statfs.o -MD -MP -MF $(DEPDIR)/statfs-statfs.Tpo -c -o statfs-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/statfs-statfs.Tpo $(DEPDIR)/statfs-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='statfs-statfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o statfs-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c + +statfs-statfs.obj: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT statfs-statfs.obj -MD -MP -MF $(DEPDIR)/statfs-statfs.Tpo -c -o statfs-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/statfs-statfs.Tpo $(DEPDIR)/statfs-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='statfs-statfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o statfs-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` + +truncate64-truncate64.o: truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT truncate64-truncate64.o -MD -MP -MF $(DEPDIR)/truncate64-truncate64.Tpo -c -o truncate64-truncate64.o `test -f 'truncate64.c' || echo '$(srcdir)/'`truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/truncate64-truncate64.Tpo $(DEPDIR)/truncate64-truncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate64.c' object='truncate64-truncate64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o truncate64-truncate64.o `test -f 'truncate64.c' || echo '$(srcdir)/'`truncate64.c + +truncate64-truncate64.obj: truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT truncate64-truncate64.obj -MD -MP -MF $(DEPDIR)/truncate64-truncate64.Tpo -c -o truncate64-truncate64.obj `if test -f 'truncate64.c'; then $(CYGPATH_W) 'truncate64.c'; else $(CYGPATH_W) '$(srcdir)/truncate64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/truncate64-truncate64.Tpo $(DEPDIR)/truncate64-truncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate64.c' object='truncate64-truncate64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o truncate64-truncate64.obj `if test -f 'truncate64.c'; then $(CYGPATH_W) 'truncate64.c'; else $(CYGPATH_W) '$(srcdir)/truncate64.c'; fi` + +uio-uio.o: uio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uio-uio.o -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c + +uio-uio.obj: uio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uio-uio.obj -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` +check-valgrind-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_LIBRARIES) $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +clean: clean-am + +clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \ + check-valgrind-am check-valgrind-local clean \ + clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am + + +@VALGRIND_CHECK_RULES@ + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h +$(objects): scno.h + +syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ + +scno.h: $(top_srcdir)/scno.head syscallent.i + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + cat $< >> $@-t + LC_ALL=C sed -n '$(SCNO_SED)' $(filter-out $<,$^) >> $@-t + mv $@-t $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests-m32/_newselect.c b/tests-m32/_newselect.c new file mode 100644 index 00000000..ae2bc51a --- /dev/null +++ b/tests-m32/_newselect.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR__newselect + +# define TEST_SYSCALL_NR __NR__newselect +# define TEST_SYSCALL_STR "_newselect" +# include "xselect.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR__newselect") + +#endif diff --git a/tests-m32/_newselect.test b/tests-m32/_newselect.test new file mode 100755 index 00000000..3371d4db --- /dev/null +++ b/tests-m32/_newselect.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check _newselect syscall decoding. + +. "${srcdir=.}/select.test" diff --git a/tests-m32/accept.c b/tests-m32/accept.c new file mode 100644 index 00000000..8d42ba15 --- /dev/null +++ b/tests-m32/accept.c @@ -0,0 +1,85 @@ +/* + * Check decoding of accept syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME accept +#endif + +#define TEST_SYSCALL_PREPARE connect_un() +static void connect_un(void); +#include "sockname.c" + +static void +connect_un(void) +{ + int cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd < 0) + perror_msg_and_skip("socket"); + + struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET ".connect" + }; + + (void) unlink(un.sun_path); + if (bind(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + un.sun_path[sizeof(TEST_SOCKET) - 1] = '\0'; + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); +} + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + if (listen(lfd, 16)) + perror_msg_and_skip("listen"); + + test_sockname_syscall(lfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/accept.test b/tests-m32/accept.test new file mode 100755 index 00000000..b5e07904 --- /dev/null +++ b/tests-m32/accept.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of accept syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/accept4.c b/tests-m32/accept4.c new file mode 100644 index 00000000..d26e15c5 --- /dev/null +++ b/tests-m32/accept4.c @@ -0,0 +1,44 @@ +/* + * Check decoding of accept4 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined HAVE_ACCEPT4 && defined O_CLOEXEC + +# define TEST_SYSCALL_NAME accept4 +# define SUFFIX_ARGS , O_CLOEXEC +# define SUFFIX_STR ", SOCK_CLOEXEC" +# include "accept.c" + +#else + +SKIP_MAIN_UNDEFINED("HAVE_ACCEPT4 && O_CLOEXEC") + +#endif diff --git a/tests-m32/accept4.test b/tests-m32/accept4.test new file mode 100755 index 00000000..722f25a5 --- /dev/null +++ b/tests-m32/accept4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of accept4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-m32/access.c b/tests-m32/access.c new file mode 100644 index 00000000..e6f169b2 --- /dev/null +++ b/tests-m32/access.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#ifdef __NR_access + +# include +# include + +int +main(void) +{ + static const char sample[] = "access_sample"; + + long rc = syscall(__NR_access, sample, F_OK); + printf("access(\"%s\", F_OK) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = syscall(__NR_access, sample, R_OK|W_OK|X_OK); + printf("access(\"%s\", R_OK|W_OK|X_OK) = %ld %s (%m)\n", + sample, rc, errno2name()); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_access") + +#endif diff --git a/tests-m32/access.test b/tests-m32/access.test new file mode 100755 index 00000000..3ab2eb4b --- /dev/null +++ b/tests-m32/access.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check access syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -eaccess -a30 $args > "$EXP" + +# Filter out access() calls made by libc. +grep -F access_sample < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/acct.c b/tests-m32/acct.c new file mode 100644 index 00000000..1cc3fa56 --- /dev/null +++ b/tests-m32/acct.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_acct + +# include +# include + +int +main(void) +{ + const char sample[] = "acct_sample"; + + long rc = syscall(__NR_acct, sample); + printf("acct(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR__acct") + +#endif diff --git a/tests-m32/acct.test b/tests-m32/acct.test new file mode 100755 index 00000000..b9bca754 --- /dev/null +++ b/tests-m32/acct.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check acct syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/add_key.c b/tests-m32/add_key.c new file mode 100644 index 00000000..d2696f9b --- /dev/null +++ b/tests-m32/add_key.c @@ -0,0 +1,153 @@ +/* + * Check decoding of add_key syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_add_key + +# include +# include +# include + +void +print_val_str(const void *ptr, const char *str) +{ + if (str) + printf("%s, ", str); + else + printf("%p, ", ptr); +} + +void +do_add_key(const char *type, const char *type_str, const char *desc, + const char *desc_str, const char *payload, const char *payload_str, + size_t plen, int32_t keyring, const char *keyring_str) +{ + long rc = syscall(__NR_add_key, type, desc, payload, plen, keyring); + const char *errstr = sprintrc(rc); + printf("add_key("); + print_val_str(type, type_str); + print_val_str(desc, desc_str); + print_val_str(payload, payload_str); + printf("%zu, ", plen); + if (keyring_str) + printf("%s", keyring_str); + else + printf("%d", keyring); + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char unterminated3[] = + { '\16', '\17', '\20', '\21', '\22' }; + + char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *bogus_payload = tail_memdup(unterminated3, sizeof(unterminated3)); + + unsigned i; + unsigned j; + unsigned k; + unsigned l; + + struct { + const char *type; + const char *str; + } types[] = { + { ARG_STR(NULL) }, + { bogus_type + sizeof(unterminated1), NULL }, + { bogus_type, NULL }, + { ARG_STR("\20\21\22\23\24") }, + { ARG_STR("user") }, + }; + + struct { + const char *desc; + const char *str; + } descs[] = { + { ARG_STR(NULL) }, + { bogus_desc + sizeof(unterminated2), NULL }, + { bogus_desc, NULL }, + { ARG_STR("\25\26\27\30\31") }, + { ARG_STR("desc") }, + { "overly long description", _STR("overly long ") "..." }, + }; + + struct { + const char *pload; + const char *str; + size_t plen; + } payloads[] = { + { ARG_STR(NULL), 0 }, + { bogus_payload + sizeof(unterminated3), NULL, + (size_t) 0xdeadbeefbadc0dedULL }, + { bogus_payload, _STR(""), 0 }, + { bogus_payload, _STR("\16\17\20\21\22"), 5 }, + { bogus_payload, NULL, 10 }, + { "overly long payload", _STR("overly long ") "...", 15 }, + }; + + struct { + uint32_t keyring; + const char *str; + } keyrings[] = { + { ARG_STR(0) }, + { ARG_STR(1234567890) }, + { ARG_STR(-1234567890) }, + { -1, "KEY_SPEC_THREAD_KEYRING" }, + }; + + for (i = 0; i < ARRAY_SIZE(types); i++) + for (j = 0; j < ARRAY_SIZE(descs); j++) + for (k = 0; k < ARRAY_SIZE(payloads); k++) + for (l = 0; l < ARRAY_SIZE(keyrings); l++) + do_add_key(types[i].type, types[i].str, + descs[j].desc, descs[j].str, + payloads[k].pload, + payloads[k].str, + payloads[k].plen, + keyrings[l].keyring, + keyrings[l].str); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_add_key"); + +#endif diff --git a/tests-m32/add_key.test b/tests-m32/add_key.test new file mode 100755 index 00000000..eadd8c2b --- /dev/null +++ b/tests-m32/add_key.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of add_key syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -s12 diff --git a/tests-m32/adjtimex.c b/tests-m32/adjtimex.c new file mode 100644 index 00000000..1638b535 --- /dev/null +++ b/tests-m32/adjtimex.c @@ -0,0 +1,83 @@ +/* + * This file is part of adjtimex strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + adjtimex(NULL); + printf("adjtimex\\(NULL\\) = -1 EFAULT \\(%m\\)\n"); + + struct timex * const tx = tail_alloc(sizeof(*tx)); + memset(tx, 0, sizeof(*tx)); + + int state = adjtimex(tx); + if (state < 0) + perror_msg_and_skip("adjtimex"); + + printf("adjtimex\\(\\{modes=0, offset=%jd, freq=%jd, maxerror=%jd" + ", esterror=%jd, status=%s, constant=%jd, precision=%jd" + ", tolerance=%jd, time=\\{tv_sec=%jd, tv_usec=%jd\\}, tick=%jd, " + "ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd, " + "calcnt=%jd, errcnt=%jd, stbcnt=%jd" +#ifdef HAVE_STRUCT_TIMEX_TAI + ", tai=%d" +#endif + "\\}\\) = %d \\(TIME_[A-Z]+\\)\n", + (intmax_t) tx->offset, + (intmax_t) tx->freq, + (intmax_t) tx->maxerror, + (intmax_t) tx->esterror, + tx->status ? "STA_[A-Z]+(\\|STA_[A-Z]+)*" : "0", + (intmax_t) tx->constant, + (intmax_t) tx->precision, + (intmax_t) tx->tolerance, + (intmax_t) tx->time.tv_sec, + (intmax_t) tx->time.tv_usec, + (intmax_t) tx->tick, + (intmax_t) tx->ppsfreq, + (intmax_t) tx->jitter, + tx->shift, + (intmax_t) tx->stabil, + (intmax_t) tx->jitcnt, + (intmax_t) tx->calcnt, + (intmax_t) tx->errcnt, + (intmax_t) tx->stbcnt, +#ifdef HAVE_STRUCT_TIMEX_TAI + tx->tai, +#endif + state); + + return 0; +} diff --git a/tests-m32/adjtimex.test b/tests-m32/adjtimex.test new file mode 100755 index 00000000..01405501 --- /dev/null +++ b/tests-m32/adjtimex.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check adjtimex syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a 15 -e adjtimex $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/aio.c b/tests-m32/aio.c new file mode 100644 index 00000000..0766d23a --- /dev/null +++ b/tests-m32/aio.c @@ -0,0 +1,368 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#if defined __NR_io_setup \ + && defined __NR_io_submit \ + && defined __NR_io_getevents \ + && defined __NR_io_cancel \ + && defined __NR_io_destroy +# include + +int +main(void) +{ + static const long bogus_ctx = + (long) 0xface1e55deadbeefLL; + + static const char data2[] = + "\0\1\2\3cat test test test 0123456789abcdef"; + + const unsigned int sizeof_data0 = 4096; + const unsigned int sizeof_data1 = 8192; + void *data0 = tail_alloc(sizeof_data0); + void *data1 = tail_alloc(sizeof_data1); + + const struct iocb proto_cb[] = { + { + .aio_data = (unsigned long) 0xfeedface11111111ULL, + .aio_reqprio = 11, + .aio_buf = (unsigned long) data0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = sizeof_data0 + }, + { + .aio_data = (unsigned long) 0xfeedface22222222ULL, + .aio_reqprio = 22, + .aio_buf = (unsigned long) data1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = sizeof_data1 + } + }; + const struct iocb *cb = tail_memdup(proto_cb, sizeof(proto_cb)); + + const struct iovec proto_iov0[] = { + { + .iov_base = data0, + .iov_len = sizeof_data0 / 4 + }, + { + .iov_base = data0 + sizeof_data0 / 4, + .iov_len = sizeof_data0 / 4 * 3 + }, + }; + const struct iovec *iov0 = tail_memdup(proto_iov0, sizeof(proto_iov0)); + + const struct iovec proto_iov1[] = { + { + .iov_base = data1, + .iov_len = sizeof_data1 / 4 + }, + { + .iov_base = data1 + sizeof_data1 / 4, + .iov_len = sizeof_data1 / 4 * 3 + }, + }; + const struct iovec *iov1 = tail_memdup(proto_iov1, sizeof(proto_iov1)); + + const struct iocb proto_cbv[] = { + { + .aio_data = (unsigned long) 0xfeed11111111faceULL, + .aio_lio_opcode = 7, + .aio_reqprio = 111, + .aio_buf = (unsigned long) iov0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = ARRAY_SIZE(proto_iov0) + }, + { + .aio_data = (unsigned long) 0xfeed22222222faceULL, + .aio_lio_opcode = 7, + .aio_reqprio = 222, + .aio_buf = (unsigned long) iov1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = ARRAY_SIZE(proto_iov1) + } + }; + const struct iocb *cbv = tail_memdup(proto_cbv, sizeof(proto_cbv)); + + /* For additional decoder testing */ + const struct iocb proto_cbv2[] = { + { + .aio_data = 0xbadfacedc0ffeeedULL, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 0xf00d, + .aio_reqprio = 0, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + /* In order to make record valid */ + .aio_nbytes = (size_t) 0x1020304050607080ULL, + .aio_offset = 0xdeadda7abadc0dedULL, +# ifdef IOCB_FLAG_RESFD + .aio_flags = 0xfacef157, + .aio_resfd = 0xded1ca7e, +# endif + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0xbadc0ffeedefacedULL, + .aio_nbytes = 0x8090a0b0c0d0e0f0ULL, + .aio_offset = 0xdeadda7abadc0dedULL, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = (unsigned long)data2, + .aio_nbytes = sizeof(data2), + .aio_offset = 0xdeadda7abadc0dedULL, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 8, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + .aio_nbytes = 0x8090a0b0c0d0e0f0ULL, + .aio_offset = 0xdeadda7abadc0dedULL, + }, + }; + const struct iocb *cbv2 = tail_memdup(proto_cbv2, sizeof(proto_cbv2)); + + const struct iocb proto_cbc = { + .aio_data = (unsigned long) 0xdeadbeefbadc0dedULL, + .aio_reqprio = 99, + .aio_fildes = -42 + }; + const struct iocb *cbc = tail_memdup(&proto_cbc, sizeof(proto_cbc)); + + const long proto_cbs[] = { + (long) &cb[0], (long) &cb[1] + }; + const long *cbs = tail_memdup(proto_cbs, sizeof(proto_cbs)); + + const long proto_cbvs[] = { + (long) &cbv[0], (long) &cbv[1], + }; + const long *cbvs = tail_memdup(proto_cbvs, sizeof(proto_cbvs)); + + const long proto_cbvs2[] = { + (long) &cbv2[0], (long) &cbv2[1], (long) &cbv2[2], + (long) &cbv2[3], (long) &cbv2[4], + (long) NULL, (long) 0xffffffffffffffffLL, + }; + const long *cbvs2 = tail_memdup(proto_cbvs2, sizeof(proto_cbvs2)); + + unsigned long *ctx = tail_alloc(sizeof(unsigned long)); + *ctx = 0; + + const unsigned int nr = ARRAY_SIZE(proto_cb); + const unsigned long lnr = (unsigned long) (0xdeadbeef00000000ULL | nr); + + const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); + const struct timespec proto_ts = { .tv_nsec = 123456789 }; + const struct timespec *ts = tail_memdup(&proto_ts, sizeof(proto_ts)); + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_skip("open: %s", "/dev/zero"); + + long rc = syscall(__NR_io_setup, 0xdeadbeef, NULL); + printf("io_setup(%u, NULL) = %s\n", 0xdeadbeef, sprintrc(rc)); + + rc = syscall(__NR_io_setup, lnr, ctx + 1); + printf("io_setup(%u, %p) = %s\n", nr, ctx + 1, sprintrc(rc)); + + if (syscall(__NR_io_setup, lnr, ctx)) + perror_msg_and_skip("io_setup"); + printf("io_setup(%u, [%#lx]) = 0\n", nr, *ctx); + + rc = syscall(__NR_io_submit, bogus_ctx, (long) 0xca7faceddeadf00dLL, + NULL); + printf("io_submit(%#lx, %ld, NULL) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbs + nr); + printf("io_submit(%#lx, %ld, %p) = %s\n", + *ctx, (long) nr, cbs + nr, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, -1L, cbs); + printf("io_submit(%#lx, -1, %p) = %s\n", + *ctx, cbs, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbs); + if (rc != (long) nr) + perror_msg_and_skip("io_submit"); + printf("io_submit(%#lx, %u, [" + "{data=%#" PRI__x64 ", pread, reqprio=11, fildes=0, " + "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, " + "{data=%#" PRI__x64 ", pread, reqprio=22, fildes=0, " + "buf=%p, nbytes=%u, offset=%" PRI__d64 "}" + "]) = %s\n", + *ctx, nr, + cb[0].aio_data, data0, sizeof_data0, cb[0].aio_offset, + cb[1].aio_data, data1, sizeof_data1, cb[1].aio_offset, + sprintrc(rc)); + + rc = syscall(__NR_io_getevents, bogus_ctx, + (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, + ev + 1, NULL); + printf("io_getevents(%#lx, %ld, %ld, %p, NULL) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, + (long) 0xba5e1e505ca571e0LL, ev + 1, sprintrc(rc)); + + rc = syscall(__NR_io_getevents, bogus_ctx, + (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, + NULL, ts + 1); + printf("io_getevents(%#lx, %ld, %ld, NULL, %p) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, + (long) 0xba5e1e505ca571e0LL, ts + 1, sprintrc(rc)); + + rc = syscall(__NR_io_getevents, *ctx, nr, nr + 1, ev, ts); + printf("io_getevents(%#lx, %ld, %ld, [" + "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}, " + "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}" + "], {tv_sec=0, tv_nsec=123456789}) = %s\n", + *ctx, (long) nr, (long) (nr + 1), + cb[0].aio_data, &cb[0], sizeof_data0, + cb[1].aio_data, &cb[1], sizeof_data1, + sprintrc(rc)); + + rc = syscall(__NR_io_cancel, bogus_ctx, NULL, NULL); + printf("io_cancel(%#lx, NULL, NULL) = %s\n", bogus_ctx, sprintrc(rc)); + + rc = syscall(__NR_io_cancel, *ctx, cbc + 1, ev); + printf("io_cancel(%#lx, %p, %p) = %s\n", *ctx, cbc + 1, ev, + sprintrc(rc)); + + rc = syscall(__NR_io_cancel, *ctx, cbc, ev); + printf("io_cancel(%#lx, {data=%#" PRI__x64 + ", pread, reqprio=99, fildes=-42}, %p) = %s\n", + *ctx, cbc->aio_data, ev, sprintrc(rc)); + + rc = syscall(__NR_io_submit, (unsigned long) 0xfacef157beeff00dULL, + (long) 0xdeadc0defacefeedLL, NULL); + printf("io_submit(%#lx, %ld, NULL) = %s\n", + (long) 0xfacef157beeff00dULL, + (long) 0xdeadc0defacefeedLL, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, -1L, cbvs + nr); + printf("io_submit(%#lx, %ld, %p) = %s\n", + *ctx, -1L, cbvs + nr, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); + printf("io_submit(%#lx, %ld, [" + "{data=%#" PRI__x64 ", key=%u, %hu /* SUB_??? */, fildes=%d}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL" + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 +# ifdef IOCB_FLAG_RESFD + ", resfd=%d, flags=%#x" +# endif + "}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d" + ", str=\"\\0\\1\\2\\3%.28s\"..." + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " + "{key=%u, pwritev, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}" + ", {NULL}, {%#lx}, %p]) = %s\n", + *ctx, 1057L, + cbv2[0].aio_data, cbv2[0].aio_key, + cbv2[0].aio_lio_opcode, cbv2[0].aio_fildes, + cbv2[1].aio_key, cbv2[1].aio_reqprio, cbv2[1].aio_fildes, + cbv2[1].aio_nbytes, cbv2[1].aio_offset, +# ifdef IOCB_FLAG_RESFD + cbv2[1].aio_resfd, cbv2[1].aio_flags, +# endif + cbv2[2].aio_key, cbv2[2].aio_reqprio, cbv2[2].aio_fildes, + cbv2[2].aio_buf, cbv2[2].aio_nbytes, cbv2[2].aio_offset, + cbv2[3].aio_key, cbv2[3].aio_reqprio, cbv2[3].aio_fildes, + data2 + 4, cbv2[3].aio_nbytes, cbv2[3].aio_offset, + cbv2[4].aio_key, cbv2[4].aio_reqprio, cbv2[4].aio_fildes, + cbv2[4].aio_buf, cbv2[4].aio_nbytes, cbv2[4].aio_offset, + cbvs2[6], cbvs2 + 7, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbvs); + if (rc != (long) nr) + perror_msg_and_skip("io_submit"); + printf("io_submit(%#lx, %u, [" + "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " + "iovec=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, " + "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " + "iovec=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}" + "]) = %s\n", + *ctx, nr, + cbv[0].aio_data, cbv[0].aio_reqprio, + iov0[0].iov_base, (unsigned int) iov0[0].iov_len, + iov0[1].iov_base, (unsigned int) iov0[1].iov_len, + cbv[0].aio_offset, + cbv[1].aio_data, cbv[1].aio_reqprio, + iov1[0].iov_base, (unsigned int) iov1[0].iov_len, + iov1[1].iov_base, (unsigned int) iov1[1].iov_len, + cbv[1].aio_offset, + sprintrc(rc)); + + rc = syscall(__NR_io_destroy, bogus_ctx); + printf("io_destroy(%#lx) = %s\n", + bogus_ctx, sprintrc(rc)); + + rc = syscall(__NR_io_destroy, *ctx); + printf("io_destroy(%#lx) = %s\n", *ctx, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_*") + +#endif diff --git a/tests-m32/aio.test b/tests-m32/aio.test new file mode 100755 index 00000000..2ba90da8 --- /dev/null +++ b/tests-m32/aio.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check io_* syscalls decoding. + +. "${srcdir=.}/init.sh" + +syscalls=io_setup,io_submit,io_getevents,io_cancel,io_destroy +run_strace_match_diff -a14 -e trace=$syscalls diff --git a/tests-m32/alarm.c b/tests-m32/alarm.c new file mode 100644 index 00000000..291b26ad --- /dev/null +++ b/tests-m32/alarm.c @@ -0,0 +1,52 @@ +/* + * This file is part of alarm strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_alarm + +# include +# include + +int +main(void) +{ + int rc = syscall(__NR_alarm, (unsigned long) 0xffffffff0000002aULL); + printf("alarm(%u) = %d\n", 42, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_alarm") + +#endif diff --git a/tests-m32/alarm.test b/tests-m32/alarm.test new file mode 100755 index 00000000..267b2239 --- /dev/null +++ b/tests-m32/alarm.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check alarm syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/answer.c b/tests-m32/answer.c new file mode 100644 index 00000000..ae3059a4 --- /dev/null +++ b/tests-m32/answer.c @@ -0,0 +1,44 @@ +/* + * Check decoding of fault injected exit_group syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + static const kernel_ulong_t answer = + (kernel_ulong_t) 0xbadc0ded0000002aULL; + + syscall(__NR_exit_group, answer); + syscall(__NR_exit, answer); + + return 1; +} diff --git a/tests-m32/attach-f-p-cmd.c b/tests-m32/attach-f-p-cmd.c new file mode 100644 index 00000000..77594beb --- /dev/null +++ b/tests-m32/attach-f-p-cmd.c @@ -0,0 +1,46 @@ +/* + * This file is part of attach-f-p strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + static const char dir[] = "attach-f-p.test cmd"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + pid, dir, sprintrc(rc), pid); + + return 0; +} diff --git a/tests-m32/attach-f-p.c b/tests-m32/attach-f-p.c new file mode 100644 index 00000000..3f9a7e3e --- /dev/null +++ b/tests-m32/attach-f-p.c @@ -0,0 +1,124 @@ +/* + * This file is part of attach-f-p strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#define N 3 + +typedef union { + void *ptr; + pid_t pid; +} retval_t; + +static const char text_parent[] = "attach-f-p.test parent"; +static const char *child[N] = { + "attach-f-p.test child 0", + "attach-f-p.test child 1", + "attach-f-p.test child 2" +}; +typedef int pipefd[2]; +static pipefd pipes[N]; + +static void * +thread(void *a) +{ + unsigned int no = (long) a; + int i; + + if (read(pipes[no][0], &i, sizeof(i)) != (int) sizeof(i)) + perror_msg_and_fail("read[%u]", no); + assert(chdir(child[no]) == -1); + retval_t retval = { .pid = syscall(__NR_gettid) }; + return retval.ptr; +} + +int +main(void) +{ + pthread_t t[N]; + unsigned int i; + + if (write(1, "", 0) != 0) + perror_msg_and_fail("write"); + + for (i = 0; i < N; ++i) { + if (pipe(pipes[i])) + perror_msg_and_fail("pipe"); + + errno = pthread_create(&t[i], NULL, thread, (void *) (long) i); + if (errno) + perror_msg_and_fail("pthread_create"); + } + + if (write(1, "\n", 1) != 1) + perror_msg_and_fail("write"); + + /* wait for the peer to write to stdout */ + struct stat st; + for (;;) { + if (fstat(1, &st)) + perror_msg_and_fail("fstat"); + if (st.st_size >= 103) + break; + } + + for (i = 0; i < N; ++i) { + /* sleep a bit to let the tracer catch up */ + sleep(1); + if (write(pipes[i][1], &i, sizeof(i)) != (int) sizeof(i)) + perror_msg_and_fail("write[%u]", i); + retval_t retval; + errno = pthread_join(t[i], &retval.ptr); + if (errno) + perror_msg_and_fail("pthread_join"); + errno = ENOENT; + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + retval.pid, child[i], sprintrc(-1), retval.pid); + } + + /* sleep a bit more to let the tracer catch up */ + sleep(1); + + pid_t pid = getpid(); + assert(chdir(text_parent) == -1); + + printf("%-5d chdir(\"%s\") = -1 ENOENT (%m)\n" + "%-5d +++ exited with 0 +++\n", pid, text_parent, pid); + + return 0; +} diff --git a/tests-m32/attach-f-p.test b/tests-m32/attach-f-p.test new file mode 100755 index 00000000..f4170740 --- /dev/null +++ b/tests-m32/attach-f-p.test @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Check that -f -p attaches to threads properly. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -f -p is implemented using /proc/$pid/task/ +[ -d /proc/self/task/ ] || + framework_skip_ '/proc/self/task/ is not available' +run_prog_skip_if_failed \ + kill -0 $$ +run_prog ./attach-f-p-cmd > /dev/null + +rm -f "$OUT" +./set_ptracer_any sh -c "exec ./attach-f-p >> $OUT" > /dev/null & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any sh failed' +done + +run_strace -a32 -f -echdir -p $tracee_pid ./attach-f-p-cmd > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" diff --git a/tests-m32/attach-p-cmd-cmd.c b/tests-m32/attach-p-cmd-cmd.c new file mode 100644 index 00000000..d0f824e9 --- /dev/null +++ b/tests-m32/attach-p-cmd-cmd.c @@ -0,0 +1,55 @@ +/* + * This file is part of attach-p-cmd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + static const char lockdir[] = "attach-p-cmd.test-lock"; + /* wait for the lock directory to be created by peer */ + while (rmdir(lockdir)) { + if (ENOENT != errno) + perror_msg_and_fail("rmdir: %s", lockdir); + } + + static const char dir[] = "attach-p-cmd.test cmd"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + pid, dir, sprintrc(rc), pid); + + return 0; +} diff --git a/tests-m32/attach-p-cmd-p.c b/tests-m32/attach-p-cmd-p.c new file mode 100644 index 00000000..254d19ae --- /dev/null +++ b/tests-m32/attach-p-cmd-p.c @@ -0,0 +1,83 @@ +/* + * This file is part of attach-p-cmd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask = {}; + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + static const char lockdir[] = "attach-p-cmd.test-lock"; + /* create a lock directory */ + if (mkdir(lockdir, 0700)) + perror_msg_and_fail("mkdir: %s", lockdir); + + /* wait for the lock directory to be removed by peer */ + while (mkdir(lockdir, 0700)) { + if (EEXIST != errno) + perror_msg_and_fail("mkdir: %s", lockdir); + } + + /* remove the lock directory */ + if (rmdir(lockdir)) + perror_msg_and_fail("rmdir: %s", lockdir); + + alarm(1); + pause(); + + static const char dir[] = "attach-p-cmd.test -p"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---\n" + "%-5d chdir(\"%s\") = %d %s (%m)\n" + "%-5d +++ exited with 0 +++\n", + pid, pid, dir, rc, errno2name(), pid); + + return 0; +} diff --git a/tests-m32/attach-p-cmd.test b/tests-m32/attach-p-cmd.test new file mode 100755 index 00000000..2068cf1d --- /dev/null +++ b/tests-m32/attach-p-cmd.test @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Check that simultaneous use of -p option and tracing of a command works. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +rm -rf attach-p-cmd.test-lock +rm -f "$OUT" +./set_ptracer_any ./attach-p-cmd-p >> "$OUT" & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any ./attach-p-cmd-p failed' +done + +run_strace -a30 -echdir -p $tracee_pid ./attach-p-cmd-cmd > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" diff --git a/tests-m32/bexecve.test b/tests-m32/bexecve.test new file mode 100755 index 00000000..f1ab04f1 --- /dev/null +++ b/tests-m32/bexecve.test @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Check -bexecve behavior. +# +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_strace_redir() +{ + args="$*" + $STRACE "$@" 2> "$LOG" +} + +run_strace_redir -enone ./set_ptracer_any true || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +run_strace_redir -enone ./set_ptracer_any false +[ $? -eq 1 ] || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +run_strace_redir -bexecve -enone ./set_ptracer_any false || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +pattern_detached='[^:]*strace: Process [1-9][0-9]* detached' +pattern_personality='[^:]*strace: \[ Process PID=[1-9][0-9]* runs in .* mode. \]' + +LC_ALL=C grep -x "$pattern_detached" "$LOG" > /dev/null || + dump_log_and_fail_with "$STRACE $args: output mismatch" + +if LC_ALL=C grep -E -v -x "($pattern_detached|$pattern_personality)" "$LOG" > /dev/null; then + dump_log_and_fail_with "$STRACE $args: unexpected output" +fi + +exit 0 diff --git a/tests-m32/bpf.c b/tests-m32/bpf.c new file mode 100644 index 00000000..7ef16c9f --- /dev/null +++ b/tests-m32/bpf.c @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2015-2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined HAVE_UNION_BPF_ATTR_LOG_BUF && defined __NR_bpf +# include +# include +# include +# include + +static const struct bpf_insn insns[] = { + { .code = BPF_JMP | BPF_EXIT } +}; + +static const char *errstr; +static char log_buf[4096]; + +static long +sys_bpf(kernel_ulong_t cmd, kernel_ulong_t attr, kernel_ulong_t size) +{ + long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + return rc; +} + +static int +map_create(void) +{ + union bpf_attr attr = { + .key_size = 4, + .value_size = 8, + .max_entries = 256 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(BPF_MAP_CREATE, (unsigned long) t_attr, sizeof(attr)); +} + +static int +map_any(int cmd) +{ + union bpf_attr attr = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} + +static int +prog_load(void) +{ + union bpf_attr attr = { + .insn_cnt = sizeof(insns) / sizeof(insns[0]), + .insns = (unsigned long) insns, + .license = (unsigned long) "GPL", + .log_level = 42, + .log_size = sizeof(log_buf), + .log_buf = (unsigned long) log_buf + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(BPF_PROG_LOAD, (unsigned long) t_attr, sizeof(attr)); +} + +/* + * bpf() syscall and its first six commands were introduced in Linux kernel + * 3.18. Some additional commands were added afterwards, so we need to take + * precautions to make sure the tests compile. + * + * BPF_OBJ_PIN and BPF_OBJ_GET commands appear in kernel 4.4. + */ +# ifdef HAVE_UNION_BPF_ATTR_BPF_FD +static int +obj_manage(int cmd) +{ + union bpf_attr attr = { + .pathname = (unsigned long) "/sys/fs/bpf/foo/bar", + .bpf_fd = -1 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} +# endif + +/* BPF_PROG_ATTACH and BPF_PROG_DETACH commands appear in kernel 4.10. */ +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE +static int +prog_cgroup(int cmd) +{ + union bpf_attr attr = { + .target_fd = -1, + .attach_bpf_fd = -1, + .attach_type = 0 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} +# endif + +static unsigned long efault; + +static void +bogus_bpf(int cmd, const char *name) +{ + const unsigned long bogus_size = 1024; + const unsigned long bogus_addr = efault - bogus_size; + + sys_bpf(cmd, efault, 4); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, efault, 4UL, errstr); + + sys_bpf(cmd, efault, bogus_size); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, efault, bogus_size, errstr); + + sys_bpf(cmd, bogus_addr, 0); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, bogus_addr, 0UL, errstr); +} + +#define BOGUS_BPF(cmd) bogus_bpf(cmd, #cmd) + +int +main(void) +{ + efault = (unsigned long) tail_alloc(1) + 1; + + map_create(); + printf("bpf(BPF_MAP_CREATE" + ", {map_type=BPF_MAP_TYPE_UNSPEC, key_size=4" + ", value_size=8, max_entries=256}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_CREATE); + + map_any(BPF_MAP_LOOKUP_ELEM); + printf("bpf(BPF_MAP_LOOKUP_ELEM" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_LOOKUP_ELEM); + + map_any(BPF_MAP_UPDATE_ELEM); + printf("bpf(BPF_MAP_UPDATE_ELEM" + ", {map_fd=-1, key=0xdeadbeef" + ", value=0xbadc0ded, flags=BPF_ANY}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_UPDATE_ELEM); + + map_any(BPF_MAP_DELETE_ELEM); + printf("bpf(BPF_MAP_DELETE_ELEM" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_DELETE_ELEM); + + map_any(BPF_MAP_GET_NEXT_KEY); + printf("bpf(BPF_MAP_GET_NEXT_KEY" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_GET_NEXT_KEY); + + prog_load(); + printf("bpf(BPF_PROG_LOAD" + ", {prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=1, insns=%p" + ", license=\"GPL\", log_level=42, log_size=4096, log_buf=%p" + ", kern_version=0}, %u) = %s\n", + insns, log_buf, (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_LOAD); + +# ifdef HAVE_UNION_BPF_ATTR_BPF_FD + obj_manage(BPF_OBJ_PIN); + printf("bpf(BPF_OBJ_PIN" + ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_OBJ_PIN); + + obj_manage(BPF_OBJ_GET); + printf("bpf(BPF_OBJ_GET" + ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_OBJ_GET); +# endif + +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE + prog_cgroup(BPF_PROG_ATTACH); + printf("bpf(BPF_PROG_ATTACH" + ", {target_fd=-1, attach_bpf_fd=-1" + ", attach_type=BPF_CGROUP_INET_INGRESS}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_ATTACH); + + prog_cgroup(BPF_PROG_DETACH); + printf("bpf(BPF_PROG_DETACH" + ", {target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS}, %u)" + " = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_DETACH); +# endif + + bogus_bpf(0xfacefeed, "0xfacefeed /* BPF_??? */"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_bpf") + +#endif diff --git a/tests-m32/bpf.test b/tests-m32/bpf.test new file mode 100755 index 00000000..adf0d576 --- /dev/null +++ b/tests-m32/bpf.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check bpf syscall decoding. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a20 diff --git a/tests-m32/brk.c b/tests-m32/brk.c new file mode 100644 index 00000000..572ebd61 --- /dev/null +++ b/tests-m32/brk.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_brk + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_brk, NULL); + printf("brk\\(NULL\\) = %#lx\n", rc); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_brk") + +#endif diff --git a/tests-m32/brk.test b/tests-m32/brk.test new file mode 100755 index 00000000..8c0e2e49 --- /dev/null +++ b/tests-m32/brk.test @@ -0,0 +1,10 @@ +#!/bin/sh + +# Check brk syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a10 -ebrk $args > "$EXP" +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-m32/btrfs-v.test b/tests-m32/btrfs-v.test new file mode 100755 index 00000000..1ee17b4b --- /dev/null +++ b/tests-m32/btrfs-v.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check verbose decoding of btrfs ioctl + +. "${srcdir=.}/init.sh" + +run_prog ./btrfs -v > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-m32/btrfs-vw.test b/tests-m32/btrfs-vw.test new file mode 100755 index 00000000..c7e40ad7 --- /dev/null +++ b/tests-m32/btrfs-vw.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check verbose decoding of btrfs ioctl w/ live ioctls. + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-vw" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +run_prog ./btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-m32/btrfs-w.test b/tests-m32/btrfs-w.test new file mode 100755 index 00000000..6238dca8 --- /dev/null +++ b/tests-m32/btrfs-w.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check decoding of btrfs ioctl w/ live ioctls. + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-w" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-m32/btrfs.c b/tests-m32/btrfs.c new file mode 100644 index 00000000..b3e23f80 --- /dev/null +++ b/tests-m32/btrfs.c @@ -0,0 +1,1932 @@ +#include "tests.h" + +#ifdef HAVE_LINUX_BTRFS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "xlat.h" + +#include "xlat/btrfs_balance_args.h" +#include "xlat/btrfs_balance_flags.h" +#include "xlat/btrfs_balance_state.h" +#include "xlat/btrfs_compress_types.h" +#include "xlat/btrfs_defrag_flags.h" +#include "xlat/btrfs_dev_stats_values.h" +#include "xlat/btrfs_dev_stats_flags.h" +#include "xlat/btrfs_qgroup_inherit_flags.h" +#include "xlat/btrfs_qgroup_limit_flags.h" +#include "xlat/btrfs_scrub_flags.h" +#include "xlat/btrfs_send_flags.h" +#include "xlat/btrfs_space_info_flags.h" +#include "xlat/btrfs_snap_flags_v2.h" +#include "xlat/btrfs_tree_objectids.h" +#include "xlat/btrfs_features_compat.h" +#include "xlat/btrfs_features_compat_ro.h" +#include "xlat/btrfs_features_incompat.h" +#include "xlat/btrfs_key_types.h" + +#ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +#endif + +#ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +#endif + +#ifndef BTRFS_NAME_LEN +# define BTRFS_NAME_LEN 255 +#endif + +/* + * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in + * its definition, which isn't exported by the kernel. + */ +typedef __u64 u64; + +static const char *btrfs_test_root; +static int btrfs_test_dir_fd; +static bool verbose = false; +static bool write_ok = false; + +const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { + 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, +}; + +const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210"; + +#ifndef BTRFS_IOC_QUOTA_RESCAN +struct btrfs_ioctl_quota_rescan_args { + uint64_t flags, progress, reserved[6]; +}; +# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ + struct btrfs_ioctl_quota_rescan_args) +# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ + struct btrfs_ioctl_quota_rescan_args) +#endif + +#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +#endif + +#ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags) +# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[2]) +# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[3]) +#endif + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +struct btrfs_ioctl_feature_flags { + uint64_t compat_flags; + uint64_t compat_ro_flags; + uint64_t incompat_flags; +}; +#endif + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +struct btrfs_ioctl_defrag_range_args { + uint64_t start; + uint64_t len; + uint64_t flags; + uint32_t extent_thresh; + uint32_t compress_type; + uint32_t unused[4]; +}; +#endif + +#ifndef FIDEDUPERANGE +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +struct file_dedupe_range_info { + int64_t dest_fd; /* in - destination file */ + uint64_t dest_offset; /* in - start of extent in destination */ + uint64_t bytes_deduped; /* out - total # of bytes we were able + * to dedupe from this file. */ + /* status of this dedupe operation: + * < 0 for error + * == FILE_DEDUPE_RANGE_SAME if dedupe succeeds + * == FILE_DEDUPE_RANGE_DIFFERS if data differs + */ + int32_t status; /* out - see above description */ + uint32_t reserved; /* must be zero */ +}; + +struct file_dedupe_range { + uint64_t src_offset; /* in - start of extent in source */ + uint64_t src_length; /* in - length of extent */ + uint16_t dest_count; /* in - total elements in info array */ + uint16_t reserved1; /* must be zero */ + uint32_t reserved2; /* must be zero */ + struct file_dedupe_range_info info[0]; +}; +#endif + +#ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ + struct btrfs_ioctl_search_args_v2) +struct btrfs_ioctl_search_args_v2 { + struct btrfs_ioctl_search_key key; /* in/out - search parameters */ + uint64_t buf_size; /* in - size of buffer + * out - on EOVERFLOW: needed size + * to store item */ + uint64_t buf[0]; /* out - found items */ +}; +#endif + + +static const char * +maybe_print_uint64max(uint64_t val) +{ + if (val == UINT64_MAX) + return " /* UINT64_MAX */"; + return ""; +} + +/* takes highest valid flag bit */ +static uint64_t +max_flags_plus_one(int bit) +{ + int i; + uint64_t val = 0; + if (bit == -1) + return 1; + for (i = 0; i <= bit + 1 && i < 64; i++) + val |= (1ULL << i); + return val; +} + +/* + * Consumes no arguments, returns nothing: + * + * - BTRFS_IOC_TRANS_START + * - BTRFS_IOC_TRANS_END + */ +static void +btrfs_test_trans_ioctls(void) +{ + ioctl(-1, BTRFS_IOC_TRANS_START, NULL); + printf("ioctl(-1, BTRFS_IOC_TRANS_START) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_TRANS_END, NULL); + printf("ioctl(-1, BTRFS_IOC_TRANS_END) = -1 EBADF (%m)\n"); +} + +/* + * Consumes no arguments, returns nothing: + * - BTRFS_IOC_SYNC + * + * Consumes argument, returns nothing + * - BTRFS_IOC_WAIT_SYNC + */ +static void +btrfs_test_sync_ioctls(void) +{ + uint64_t u64val = 0xdeadbeefbadc0dedULL; + + ioctl(-1, BTRFS_IOC_SYNC, NULL); + printf("ioctl(-1, BTRFS_IOC_SYNC) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL); + printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_WAIT_SYNC, &u64val); + printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, [%" PRIu64 + "]) = -1 EBADF (%m)\n", u64val); + + /* + * The live test of BTRFS_IOC_SYNC happens as a part of the test + * for BTRFS_IOC_LOGICAL_INO + */ +} + +static void +btrfs_print_qgroup_inherit(struct btrfs_qgroup_inherit *inherit) +{ + printf("{flags="); + printflags(btrfs_qgroup_inherit_flags, inherit->flags, + "BTRFS_QGROUP_INHERIT_???"); + printf(", num_qgroups=%" PRI__u64 + ", num_ref_copies=%" PRI__u64 + ", num_excl_copies=%" PRI__u64", lim={flags=", + inherit->num_qgroups, inherit->num_ref_copies, + inherit->num_excl_copies); + printflags(btrfs_qgroup_limit_flags, + inherit->lim.flags, + "BTRFS_QGROUP_LIMIT_???"); + printf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 + ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 + "}, qgroups=", + inherit->lim.max_rfer, inherit->lim.max_excl, + inherit->lim.rsv_rfer, inherit->lim.rsv_excl); + if (verbose) { + unsigned int i; + printf("["); + for (i = 0; i < inherit->num_qgroups; i++) { + if (i > 0) + printf(", "); + printf("%" PRI__u64, inherit->qgroups[i]); + } + printf("]"); + } else + printf("..."); + printf("}"); +} + + +static void +btrfs_print_vol_args_v2(struct btrfs_ioctl_vol_args_v2 *args, int print_qgroups) +{ + printf("{fd=%d, flags=", (int) args->fd); + printflags(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); + + if (args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) { + printf(", size=%" PRI__u64 ", qgroup_inherit=", args->size); + if (args->qgroup_inherit && print_qgroups) + btrfs_print_qgroup_inherit(args->qgroup_inherit); + else if (args->qgroup_inherit) + printf("%p", args->qgroup_inherit); + else + printf("NULL"); + } + printf(", name=\"%s\"}", args->name); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SNAP_CREATE + * - BTRFS_IOC_SUBVOL_CREATE + * - BTRFS_IOC_SNAP_DESTROY + * - BTRFS_IOC_DEFAULT_SUBVOL + * + * Consumes argument, returns u64: + * - BTRFS_IOC_SNAP_CREATE_V2 + * - BTRFS_IOC_SUBVOL_CREATE_V2 + */ + +static void +btrfs_test_subvol_ioctls(void) +{ + const char *subvol_name = "subvol-name"; + char *long_subvol_name; + void *bad_pointer = (void *) (unsigned long) 0xdeadbeeffffffeedULL; + uint64_t u64val = 0xdeadbeefbadc0dedULL; + struct btrfs_ioctl_vol_args vol_args = {}; + struct btrfs_ioctl_vol_args_v2 vol_args_v2 = { + .fd = 2, + .flags = max_flags_plus_one(2), + }; + + long_subvol_name = malloc(BTRFS_PATH_NAME_MAX); + if (!long_subvol_name) + perror_msg_and_fail("malloc failed"); + memset(long_subvol_name, 'f', BTRFS_PATH_NAME_MAX); + long_subvol_name[BTRFS_PATH_NAME_MAX - 1] = '\0'; + + strcpy(vol_args.name, subvol_name); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, " + "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, " + "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + strncpy(vol_args.name, long_subvol_name, BTRFS_PATH_NAME_MAX); + ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + long_subvol_name = realloc(long_subvol_name, BTRFS_SUBVOL_NAME_MAX); + if (!long_subvol_name) + perror_msg_and_fail("realloc failed"); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + + strcpy(vol_args_v2.name, subvol_name); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + strncpy(vol_args_v2.name, long_subvol_name, BTRFS_SUBVOL_NAME_MAX); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + strcpy(vol_args_v2.name, subvol_name); + vol_args_v2.qgroup_inherit = bad_pointer; + + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 0); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 0); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + const unsigned int n_qgroups = 8; + unsigned int i; + struct btrfs_qgroup_inherit *inherit; + vol_args_v2.size = + sizeof(*inherit) + n_qgroups * sizeof(inherit->qgroups[0]); + inherit = tail_alloc(vol_args_v2.size); + + inherit->flags = 0x3; + inherit->num_ref_copies = 0; + inherit->num_excl_copies = 0; + inherit->num_qgroups = n_qgroups; + for (i = 0; i < n_qgroups; i++) + inherit->qgroups[i] = 1ULL << i; + inherit->lim.flags = 0x7f; + inherit->lim.max_rfer = u64val; + inherit->lim.max_excl = u64val; + inherit->lim.rsv_rfer = u64val; + inherit->lim.rsv_excl = u64val; + vol_args_v2.qgroup_inherit = inherit; + + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, &u64val); + printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, [%" + PRIu64 "]) = -1 EBADF (%m)\n", u64val); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, "); + printflags(btrfs_snap_flags_v2, vol_args_v2.flags, + "BTRFS_SUBVOL_???"); + ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, &vol_args_v2.flags); + printf(") = -1 EBADF (%m)\n"); + + if (write_ok) { + struct btrfs_ioctl_vol_args_v2 args_passed; + /* + * Returns transid if flags & BTRFS_SUBVOL_CREATE_ASYNC + * - BTRFS_IOC_SNAP_CREATE_V2 + * - BTRFS_IOC_SUBVOL_CREATE_V2 + */ + int subvolfd; + + strncpy(vol_args_v2.name, subvol_name, + sizeof(vol_args_v2.name)); + vol_args_v2.flags = BTRFS_SUBVOL_CREATE_ASYNC; + vol_args_v2.size = 0; + vol_args_v2.qgroup_inherit = NULL; + args_passed = vol_args_v2; + printf("ioctl(%d, BTRFS_IOC_SUBVOL_CREATE_V2, ", + btrfs_test_dir_fd); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, + &args_passed); + printf(" => {transid=%" PRI__u64"}) = 0\n", + args_passed.transid); + + subvolfd = openat(btrfs_test_dir_fd, subvol_name, + O_RDONLY|O_DIRECTORY); + if (subvolfd < 0) + perror_msg_and_fail("openat(%s) failed", subvol_name); + + strncpy(vol_args_v2.name, long_subvol_name, BTRFS_NAME_LEN); + vol_args_v2.fd = subvolfd; + args_passed = vol_args_v2; + printf("ioctl(%d, BTRFS_IOC_SNAP_CREATE_V2, ", + btrfs_test_dir_fd); + btrfs_print_vol_args_v2(&args_passed, 1); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_CREATE_V2, + &args_passed); + printf(" => {transid=%" PRI__u64"}) = 0\n", + args_passed.transid); + + /* This only works when mounted w/ -ouser_subvol_rm_allowed */ + strncpy(vol_args.name, long_subvol_name, 255); + vol_args.name[255] = 0; + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " + "{fd=%d, name=\"%.*s\"}) = 0\n", + btrfs_test_dir_fd, (int) vol_args.fd, 255, long_subvol_name); + + strcpy(vol_args.name, subvol_name); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " + "{fd=%d, name=\"%s\"}) = 0\n", + btrfs_test_dir_fd, (int) vol_args.fd, subvol_name); + + close(subvolfd); + } + free(long_subvol_name); +} + +static void +btrfs_print_balance_args(struct btrfs_balance_args *args) +{ + printf("{profiles="); + printflags(btrfs_space_info_flags, args->profiles, + "BTRFS_BLOCK_GROUP_???"); + printf(", usage=%"PRI__u64 "%s, devid=%"PRI__u64 "%s, pstart=%"PRI__u64 + "%s, pend=%"PRI__u64 "%s, vstart=%"PRI__u64 "%s, vend=%"PRI__u64 + "%s, target=%"PRI__u64 "%s, flags=", + args->usage, maybe_print_uint64max(args->usage), + args->devid, maybe_print_uint64max(args->devid), + args->pstart, maybe_print_uint64max(args->pstart), + args->pend, maybe_print_uint64max(args->pend), + args->vstart, maybe_print_uint64max(args->vstart), + args->vend, maybe_print_uint64max(args->vend), + args->target, maybe_print_uint64max(args->target)); + printflags(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); + printf("}"); +} + +/* + * Accepts argument, returns nothing + * - BTRFS_IOC_BALANCE + * - BTRFS_IOC_BALANCE_CTL + * + * Accepts argument, returns argument + * - BTRFS_IOC_BALANCE_V2 + */ +static void +btrfs_test_balance_ioctls(void) +{ + struct btrfs_ioctl_balance_args args = { + .flags = 0x3f, + .data = { + .profiles = 0x7, + .flags = 0x7, + .devid = 1, + .pend = -1ULL, + .vend = -1ULL, + }, + + .meta = { + .profiles = 0x38, + .flags = 0x38, + .devid = 1, + }, + + .sys = { + .profiles = 0x1c0 | (1ULL << 48), + .flags = 0x4c0, + .devid = 1, + }, + }; + struct btrfs_ioctl_vol_args vol_args = {}; + + ioctl(-1, BTRFS_IOC_BALANCE_CTL, 1); + printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " + "BTRFS_BALANCE_CTL_PAUSE) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE_CTL, 2); + printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " + "BTRFS_BALANCE_CTL_CANCEL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE, NULL); + printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + + /* struct btrfs_ioctl_balance_args */ + ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, {flags="); + printflags(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + ioctl(-1, BTRFS_IOC_BALANCE_V2, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + args.flags = BTRFS_BALANCE_DATA | BTRFS_BALANCE_METADATA | + BTRFS_BALANCE_SYSTEM; + args.data.flags = 0; + args.data.profiles = 0; + args.meta.flags = 0; + args.meta.profiles = 0; + args.sys.flags = 0; + args.sys.profiles = 0; + printf("ioctl(%d, BTRFS_IOC_BALANCE_V2, {flags=", + btrfs_test_dir_fd); + + printflags(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); + printf("} => {flags="); + printflags(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", state="); + printflags(btrfs_balance_state, args.state, + "BTRFS_BALANCE_STATE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + printf("}) = 0\n"); + } +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_RESIZE + * + * Requires /dev/btrfs-control, consumes argument, returns nothing: + * - BTRFS_IOC_SCAN_DEV + * - BTRFS_IOC_DEVICES_READY + * + */ +static void +btrfs_test_device_ioctls(void) +{ + const char *devid = "1"; + const char *devname = "/dev/sda1"; + struct btrfs_ioctl_vol_args args = { + .fd = 2, + }; + + ioctl(-1, BTRFS_IOC_RESIZE, NULL); + printf("ioctl(-1, BTRFS_IOC_RESIZE, NULL) = -1 EBADF (%m)\n"); + + strcpy(args.name, devid); + ioctl(-1, BTRFS_IOC_RESIZE, &args); + printf("ioctl(-1, BTRFS_IOC_RESIZE, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL) = -1 EBADF (%m)\n"); + + strcpy(args.name, devname); + ioctl(-1, BTRFS_IOC_SCAN_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_ADD_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_ADD_DEV, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_ADD_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_ADD_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_RM_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_RM_DEV, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_RM_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_RM_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_CLONE + * - BTRFS_IOC_CLONE_RANGE + */ +static void +btrfs_test_clone_ioctls(void) +{ + int clone_fd = 4; + struct btrfs_ioctl_clone_range_args args = { + .src_fd = clone_fd, + .src_offset = 4096, + .src_length = 16384, + .dest_offset = 128 * 1024, + }; + + ioctl(-1, BTRFS_IOC_CLONE, clone_fd); + printf("ioctl(-1, BTRFS_IOC_CLONE or FICLONE, %x) = -1 EBADF (%m)\n", + clone_fd); + + ioctl(-1, BTRFS_IOC_CLONE_RANGE, NULL); + printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + "NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_CLONE_RANGE, &args); + printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + "{src_fd=%d, src_offset=%" PRI__u64 ", src_length=%" PRI__u64 + ", dest_offset=%" PRI__u64 "}) = -1 EBADF (%m)\n", + (int) args.src_fd, args.src_offset, args.src_length, + args.dest_offset); +} + +#define BTRFS_COMPRESS_TYPES 2 +#define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) + +static void +btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args) +{ + printf("{start=%" PRIu64", len=%" PRIu64 "%s, flags=", + (uint64_t) args->start, (uint64_t) args->len, + maybe_print_uint64max(args->len)); + + printflags(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); + printf(", extent_thresh=%u, compress_type=", args->extent_thresh); + printxval(btrfs_compress_types, args->compress_type, + "BTRFS_COMPRESS_???"); + printf("}"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_DEFRAG + * - BTRFS_DEFRAG_RANGE + */ +static void +btrfs_test_defrag_ioctls(void) +{ + struct btrfs_ioctl_vol_args vol_args = {}; + struct btrfs_ioctl_defrag_range_args args = { + .start = 0, + .len = -1ULL, + .flags = max_flags_plus_one(1), + .extent_thresh = 128 * 1024, + .compress_type = 2, /* BTRFS_COMPRESS_LZO */ + }; + + /* + * These are documented as using vol_args but don't + * actually consume it. + */ + ioctl(-1, BTRFS_IOC_DEFRAG, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFRAG, &vol_args); + printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + + /* struct btrfs_ioctl_defrag_range_args */ + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); + + args.compress_type = BTRFS_INVALID_COMPRESS; + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); + + args.len--; + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); +} + +static const char * +xlookup(const struct xlat *xlat, const uint64_t val) +{ + for (; xlat->str != NULL; xlat++) + if (xlat->val == val) + return xlat->str; + return NULL; +} + +static void +btrfs_print_objectid(uint64_t objectid) +{ + const char *str = xlookup(btrfs_tree_objectids, objectid); + printf("%" PRIu64, objectid); + if (str) + printf(" /* %s */", str); +} + +static void +btrfs_print_key_type(uint32_t type) +{ + const char *str = xlookup(btrfs_key_types, type); + printf("%u", type); + if (str) + printf(" /* %s */", str); +} + +static void +btrfs_print_search_key(struct btrfs_ioctl_search_key *key) +{ + printf("key={tree_id="); + btrfs_print_objectid(key->tree_id); + if (verbose || key->min_objectid != 256) { + printf(", min_objectid="); + btrfs_print_objectid(key->min_objectid); + } + if (verbose || key->max_objectid != -256ULL) { + printf(", max_objectid="); + btrfs_print_objectid(key->max_objectid); + } + if (key->min_offset) + printf(", min_offset=%" PRI__u64 "%s", + key->min_offset, maybe_print_uint64max(key->min_offset)); + if (key->max_offset) + printf(", max_offset=%" PRI__u64 "%s", + key->max_offset, maybe_print_uint64max(key->max_offset)); + if (key->min_transid) + printf(", min_transid=%" PRI__u64"%s", key->min_transid, + maybe_print_uint64max(key->min_transid)); + if (key->max_transid) + printf(", max_transid=%" PRI__u64"%s", key->max_transid, + maybe_print_uint64max(key->max_transid)); + printf(", min_type="); + btrfs_print_key_type(key->min_type); + printf(", max_type="); + btrfs_print_key_type(key->max_type); + printf(", nr_items=%u}", key->nr_items); +} + +static void +btrfs_print_tree_search_buf(struct btrfs_ioctl_search_key *key, + void *buf, uint64_t buf_size) +{ + if (verbose) { + uint64_t i; + uint64_t off = 0; + printf("["); + for (i = 0; i < key->nr_items; i++) { + struct btrfs_ioctl_search_header *sh; + sh = (typeof(sh))(buf + off); + if (i) + printf(", "); + printf("{transid=%" PRI__u64 ", objectid=", + sh->transid); + btrfs_print_objectid(sh->objectid); + printf(", offset=%" PRI__u64 ", type=", sh->offset); + btrfs_print_key_type(sh->type); + printf(", len=%u}", sh->len); + off += sizeof(*sh) + sh->len; + } + printf("]"); + } else + printf("..."); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_TREE_SEARCH + * - BTRFS_IOC_TREE_SEARCH_V2 + */ +static void +btrfs_test_search_ioctls(void) +{ + struct btrfs_ioctl_search_key key_reference = { + .tree_id = 5, + .min_objectid = 256, + .max_objectid = -1ULL, + .min_offset = 0, + .max_offset = -1ULL, + .min_transid = 0, + .max_transid = -1ULL, + .min_type = 0, + .max_type = -1U, + .nr_items = 10, + }; + struct btrfs_ioctl_search_args search_args; + struct btrfs_ioctl_search_args_v2 search_args_v2 = { + .buf_size = 4096, + }; + + ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL); + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL) = -1 EBADF (%m)\n"); + + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_objectid = 6; + key_reference.max_objectid = 7; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_offset++; + key_reference.max_offset--; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_transid++; + key_reference.max_transid--; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_type = 1; + key_reference.max_type = 12; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + if (btrfs_test_root) { + struct btrfs_ioctl_search_args_v2 *args; + int bufsize = 4096; + + key_reference.tree_id = 5; + key_reference.min_type = 1; + key_reference.max_type = 1; + key_reference.min_objectid = 256; + key_reference.max_objectid = 357; + key_reference.min_offset = 0; + key_reference.max_offset = -1ULL; + + search_args.key = key_reference; + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&search_args.key); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("} => {key={nr_items=%u}, buf=", + search_args.key.nr_items); + btrfs_print_tree_search_buf(&search_args.key, search_args.buf, + sizeof(search_args.buf)); + printf("}) = 0\n"); + + args = malloc(sizeof(*args) + bufsize); + if (!args) + perror_msg_and_fail("malloc failed"); + + args->key = key_reference; + args->buf_size = bufsize; + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&key_reference); + printf(", buf_size=%" PRIu64 "}", (uint64_t) args->buf_size); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); + printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", buf=", + args->key.nr_items, (uint64_t)args->buf_size); + btrfs_print_tree_search_buf(&args->key, args->buf, + args->buf_size); + printf("}) = 0\n"); + + args->key = key_reference; + args->buf_size = sizeof(struct btrfs_ioctl_search_header); + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&args->key); + printf(", buf_size=%" PRIu64 "}", (uint64_t)args->buf_size); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); + printf(" => {buf_size=%" PRIu64 "}) = -1 EOVERFLOW (%m)\n", + (uint64_t)args->buf_size); + free(args); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_INO_LOOKUP + */ +static void +btrfs_test_ino_lookup_ioctl(void) +{ + struct btrfs_ioctl_ino_lookup_args args = { + .treeid = 5, + .objectid = 256, + }; + + ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL); + printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, {treeid="); + btrfs_print_objectid(args.treeid); + printf(", objectid="); + btrfs_print_objectid(args.objectid); + ioctl(-1, BTRFS_IOC_INO_LOOKUP, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (btrfs_test_root) { + printf("ioctl(%d, BTRFS_IOC_INO_LOOKUP, {treeid=", + btrfs_test_dir_fd); + btrfs_print_objectid(args.treeid); + printf(", objectid="); + btrfs_print_objectid(args.objectid); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_LOOKUP, &args); + printf("} => {name=\"%s\"}) = 0\n", args.name); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_SPACE_INFO + */ +static void +btrfs_test_space_info_ioctl(void) +{ + struct btrfs_ioctl_space_args args = {}; + + ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL); + printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SPACE_INFO, &args); + printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", + args.space_slots); + + if (btrfs_test_root) { + struct btrfs_ioctl_space_args args_passed; + struct btrfs_ioctl_space_args *argsp; + args_passed = args; + printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, args_passed.space_slots); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, &args_passed); + printf(" => {total_spaces=%" PRI__u64 "}) = 0\n", + args_passed.total_spaces); + + argsp = malloc(sizeof(args) + + args_passed.total_spaces * sizeof(args.spaces[0])); + if (!argsp) + perror_msg_and_fail("malloc failed"); + + *argsp = args; + argsp->space_slots = args_passed.total_spaces; + printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, argsp->space_slots); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, argsp); + printf(" => {total_spaces=%" PRI__u64 ", spaces=", + argsp->total_spaces); + if (verbose) { + unsigned int i; + printf("["); + for (i = 0; i < argsp->total_spaces; i++) { + struct btrfs_ioctl_space_info *info; + info = &argsp->spaces[i]; + if (i) + printf(", "); + printf("{flags="); + printflags(btrfs_space_info_flags, info->flags, + "BTRFS_SPACE_INFO_???"); + printf(", total_bytes=%" PRI__u64 + ", used_bytes=%" PRI__u64 "}", + info->total_bytes, info->used_bytes); + } + + printf("]"); + } else + printf("..."); + printf("}) = 0\n"); + free(argsp); + } +} + +/* + * Consumes no arguments, returns nothing: + * - BTRFS_IOC_SCRUB_CANCEL + * Consumes argument, returns argument: + - * BTRFS_IOC_SCRUB + - * BTRFS_IOC_SCRUB_PROGRESS + */ +static void +btrfs_test_scrub_ioctls(void) +{ + struct btrfs_ioctl_scrub_args args = { + .devid = 1, + .start = 0, + .end = -1ULL, + .flags = max_flags_plus_one(0), + }; + + ioctl(-1, BTRFS_IOC_SCRUB, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_CANCEL, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB_CANCEL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SCRUB, {devid=%" PRI__u64 ", start=%" + PRI__u64 "%s, end=%" PRI__u64"%s, flags=", + args.devid, args.start, maybe_print_uint64max(args.start), + args.end, maybe_print_uint64max(args.end)); + printflags(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); + ioctl(-1, BTRFS_IOC_SCRUB, &args); + printf("}) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, &args); + printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, " + "{devid=%" PRI__u64 "}) = -1 EBADF (%m)\n", args.devid); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_DEV_INFO + */ +static void +btrfs_test_dev_info_ioctl(void) +{ + struct btrfs_ioctl_dev_info_args args = { + .devid = 1, + }; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); + + ioctl(-1, BTRFS_IOC_DEV_INFO, NULL); + printf("ioctl(-1, BTRFS_IOC_DEV_INFO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEV_INFO, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_INFO, " + "{devid=%" PRI__u64", uuid=%s}) = -1 EBADF (%m)\n", + args.devid, uuid_reference_string); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_INO_PATHS + * - BTRFS_IOC_LOGICAL_INO + */ +static void +btrfs_test_ino_path_ioctls(void) +{ + char buf[16384]; + struct btrfs_ioctl_ino_path_args args = { + .inum = 256, + .size = sizeof(buf), + .fspath = (unsigned long)buf, + }; + + ioctl(-1, BTRFS_IOC_INO_PATHS, NULL); + printf("ioctl(-1, BTRFS_IOC_INO_PATHS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL); + printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_INO_PATHS, &args); + printf("ioctl(-1, BTRFS_IOC_INO_PATHS, " + "{inum=%" PRI__u64", size=%" PRI__u64 + ", fspath=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", + args.inum, args.size, args.fspath); + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 + ", size=%" PRI__u64", inodes=0x%" PRI__x64 + "}) = -1 EBADF (%m)\n", args.inum, args.size, args.fspath); + +#ifdef HAVE_LINUX_FIEMAP_H + if (btrfs_test_root) { + int size; + struct stat si; + int ret; + struct btrfs_data_container *data = (void *)buf; + struct fiemap *fiemap; + int fd; + + ret = fstat(btrfs_test_dir_fd, &si); + if (ret) + perror_msg_and_fail("fstat failed"); + + args.inum = si.st_ino; + printf("ioctl(%d, BTRFS_IOC_INO_PATHS, " + "{inum=%" PRI__u64", size=%" PRI__u64 + ", fspath=0x%" PRI__x64"}", + btrfs_test_dir_fd, args.inum, args.size, + args.fspath); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_PATHS, &args); + printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + data->bytes_left, data->bytes_missing, data->elem_cnt, + data->elem_missed); + if (verbose) { + printf("[\"strace-test\"]"); + } else + printf("..."); + printf("}}) = 0\n"); + + fd = openat(btrfs_test_dir_fd, "file1", O_RDWR|O_CREAT, 0600); + if (fd < 0) + perror_msg_and_fail("openat(file1) failed"); + + ret = fstat(fd, &si); + if (ret) + perror_msg_and_fail("fstat failed"); + + if (write(fd, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd"); + + /* + * Force delalloc so we can actually + * search for the extent. + */ + fsync(fd); + ioctl(fd, BTRFS_IOC_SYNC, NULL); + printf("ioctl(%d, BTRFS_IOC_SYNC) = 0\n", fd); + + size = sizeof(*fiemap) + 2 * sizeof(fiemap->fm_extents[0]); + fiemap = malloc(size); + if (!fiemap) + perror_msg_and_fail("malloc failed"); + memset(fiemap, 0, size); + + fiemap->fm_length = sizeof(buf); + fiemap->fm_extent_count = 2; + + /* This is also a live test for FIEMAP */ + printf("ioctl(%d, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64", fm_flags=", + fd, fiemap->fm_start, fiemap->fm_length); + printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_extent_count=%u}", fiemap->fm_extent_count); + ioctl(fd, FS_IOC_FIEMAP, fiemap); + printf(" => {fm_flags="); + printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_mapped_extents=%u, fm_extents=", + fiemap->fm_mapped_extents); + if (verbose) { + printf("["); + unsigned int i; + for (i = 0; i < fiemap->fm_mapped_extents; i++) { + struct fiemap_extent *fe; + fe = &fiemap->fm_extents[i]; + if (i) + printf(", "); + printf("{fe_logical=%" PRI__u64 + ", fe_physical=%" PRI__u64 + ", fe_length=%" PRI__u64 + ", ", + fe->fe_logical, fe->fe_physical, + fe->fe_length); + printflags(fiemap_extent_flags, fe->fe_flags, + "FIEMAP_EXTENT_???"); + printf("}"); + } + printf("]"); + } else + printf("..."); + printf("}) = 0\n"); + + args.inum = fiemap->fm_extents[0].fe_physical; + printf("ioctl(%d, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 + ", size=%" PRI__u64", inodes=0x%" PRI__x64"}", + fd, args.inum, args.size, args.fspath); + ioctl(fd, BTRFS_IOC_LOGICAL_INO, &args); + printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + data->bytes_left, data->bytes_missing, data->elem_cnt, + data->elem_missed); + if (verbose) { + printf("[{inum=%llu, offset=0, root=5}]", + (unsigned long long) si.st_ino); + } else + printf("..."); + printf("}}) = 0\n"); + close(fd); + free(fiemap); + } +#endif /* HAVE_LINUX_FIEMAP_H */ +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_SET_RECEIVED_SUBVOL + */ +static void +btrfs_test_set_received_subvol_ioctl(void) +{ + struct btrfs_ioctl_received_subvol_args args = { + .stransid = 0x12345, + .stime = { + .sec = 1463193386, + .nsec = 12345, + }, + }; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); + + ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " + "NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, &args); + printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " + "{uuid=%s, stransid=%" PRI__u64", stime=%" PRI__u64 + ".%u, flags=0}) = -1 EBADF (%m)\n", + uuid_reference_string, args.stransid, args.stime.sec, + args.stime.nsec); +} + +/* + * Consumes argument, returns nothing (output is via send_fd) + * - BTRFS_IOC_SEND + */ +static void +btrfs_test_send_ioctl(void) +{ + uint64_t u64_array[2] = { 256, 257 }; + struct btrfs_ioctl_send_args args = { + .send_fd = 4, + .parent_root = 257, + .flags = max_flags_plus_one(2), + }; + + ioctl(-1, BTRFS_IOC_SEND, NULL); + printf("ioctl(-1, BTRFS_IOC_SEND, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SEND, " + "{send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=", + (int) args.send_fd, args.clone_sources_count); + if (verbose) + printf("NULL"); + else + printf("..."); + printf(", parent_root="); + btrfs_print_objectid(args.parent_root); + printf(", flags="); + printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + ioctl(-1, BTRFS_IOC_SEND, &args); + printf("}) = -1 EBADF (%m)\n"); + + args.clone_sources_count = 2; + args.clone_sources = (__u64 *) (void *) u64_array; + + printf("ioctl(-1, BTRFS_IOC_SEND, " + "{send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=", + (int) args.send_fd, args.clone_sources_count); + if (verbose) { + printf("["); + btrfs_print_objectid(u64_array[0]); + printf(", "); + btrfs_print_objectid(u64_array[1]); + printf("]"); + } else + printf("..."); + printf(", parent_root="); + btrfs_print_objectid(args.parent_root); + printf(", flags="); + printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + ioctl(-1, BTRFS_IOC_SEND, &args); + printf("}) = -1 EBADF (%m)\n"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QUOTA_CTL + */ +static void +btrfs_test_quota_ctl_ioctl(void) +{ + struct btrfs_ioctl_quota_ctl_args args = { + .cmd = 1, + }; + + ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_ENABLE}) = -1 EBADF (%m)\n"); + + args.cmd = 2; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_DISABLE}) = -1 EBADF (%m)\n"); + + args.cmd = 3; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_RESCAN__NOTUSED}) = -1 EBADF (%m)\n"); + + args.cmd = 4; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QGROUP_ASSIGN + */ +static void +btrfs_test_qgroup_assign_ioctl(void) +{ + struct btrfs_ioctl_qgroup_assign_args args = { + .assign = 1, + .src = 257, + .dst = 258, + }; + + ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL); + printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, &args); + printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, " + "{assign=%" PRI__u64", src=%" PRI__u64", dst=%" PRI__u64 + "}) = -1 EBADF (%m)\n", args.assign, args.src, args.dst); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QGROUP_CREATE + */ +static void +btrfs_test_qgroup_create_ioctl(void) +{ + struct btrfs_ioctl_qgroup_create_args args = { + .create = 1, + .qgroupid = 257, + }; + + ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL); + printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QGROUP_CREATE, &args); + printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, " + "{create=%" PRI__u64", qgroupid=%" PRI__u64 + "}) = -1 EBADF (%m)\n", args.create, args.qgroupid); +} + +/* + * Consumes nothing, returns nothing: + * - BTRFS_IOC_QUOTA_RESCAN_WAIT + * Consumes argument, returns nothing: + * - BTRFS_IOC_QUOTA_RESCAN + */ +static void +btrfs_test_quota_rescan_ioctl(void) +{ + struct btrfs_ioctl_quota_rescan_args args = { + .progress = 1, + }; + + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, " + "{flags=0}) = -1 EBADF (%m)\n"); + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT) = -1 EBADF (%m)\n"); + +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SET_FSLABEL + * + * Consumes no argument, returns argument: + * - BTRFS_IOC_GET_FS_LABEL + */ +static void +btrfs_test_label_ioctls(void) +{ + char label[BTRFS_LABEL_SIZE] = "btrfs-label"; + + ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SET_FSLABEL, label); + printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, \"%s\") = -1 EBADF (%m)\n", + label); + + if (write_ok) { + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SET_FSLABEL, label); + printf("ioctl(%d, BTRFS_IOC_SET_FSLABEL, \"%s\") = 0\n", + btrfs_test_dir_fd, label); + + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FSLABEL, label); + printf("ioctl(%d, BTRFS_IOC_GET_FSLABEL, \"%s\") = 0\n", + btrfs_test_dir_fd, label); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_GET_DEV_STATS + */ +static void +btrfs_test_get_dev_stats_ioctl(void) +{ + struct btrfs_ioctl_get_dev_stats args = { + .devid = 1, + .nr_items = 5, + .flags = max_flags_plus_one(0), + }; + + ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL); + printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 + ", nr_items=%" PRI__u64", flags=", + args.devid, args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + ioctl(-1, BTRFS_IOC_GET_DEV_STATS, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + unsigned int i; + args.flags = BTRFS_DEV_STATS_RESET; + printf("ioctl(%d, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 + ", nr_items=%" PRI__u64", flags=", + btrfs_test_dir_fd, args.devid, args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_DEV_STATS, &args); + printf("} => {nr_items=%" PRI__u64 ", flags=", + args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + printf(", ["); + for (i = 0; i < args.nr_items; i++) { + const char *name = xlookup(btrfs_dev_stats_values, i); + if (i) + printf(", "); + if (name) + printf("/* %s */ ", name); + printf("%" PRI__u64, args.values[i]); + } + printf("]}) = 0\n"); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_DEV_REPLACE + * + * Test environment for this is more difficult; It's better to do it by hand. + */ +static void +btrfs_test_dev_replace_ioctl(void) +{ + struct btrfs_ioctl_dev_replace_args args = { + .cmd = BTRFS_IOCTL_DEV_REPLACE_CMD_START, + }; + args.start.srcdevid = 1; + strcpy((char *)args.start.srcdev_name, "/dev/sda1"); + strcpy((char *)args.start.tgtdev_name, "/dev/sdb1"); + + /* struct btrfs_ioctl_dev_replace_args */ + ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " + "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_START, start={srcdevid=%" + PRI__u64", cont_reading_from_srcdev_mode=%" PRI__u64 + ", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) = -1 EBADF (%m)\n", + args.start.srcdevid, + args.start.cont_reading_from_srcdev_mode, + (char *)args.start.srcdev_name, + (char *)args.start.tgtdev_name); + + args.cmd = 1; + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " + "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS}) = -1 EBADF (%m)\n"); +} + +static void +btrfs_test_extent_same_ioctl(void) +{ +#ifdef BTRFS_IOC_FILE_EXTENT_SAME + struct file_dedupe_range args = { + .src_offset = 1024, + .src_length = 10240, + }; + struct file_dedupe_range *argsp; + + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, NULL); + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_count=%hu, info=[]", + (uint64_t)args.src_offset, + (uint64_t)args.src_length, args.dest_count); + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, &args); + printf("}) = -1 EBADF (%m)\n"); + + argsp = malloc(sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + if (!argsp) + perror_msg_and_fail("malloc failed"); + memset(argsp, 0, sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + + *argsp = args; + argsp->dest_count = 3; + argsp->info[0].dest_fd = 2; + argsp->info[0].dest_offset = 0; + argsp->info[1].dest_fd = 2; + argsp->info[1].dest_offset = 10240; + argsp->info[2].dest_fd = 2; + argsp->info[2].dest_offset = 20480; + + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_count=%hu, info=", + (int64_t)argsp->src_offset, + (uint64_t)argsp->src_length, argsp->dest_count); + printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 + "}, {dest_fd=%" PRId64 ", dest_offset=%"PRIu64 "}", + (int64_t)argsp->info[0].dest_fd, + (uint64_t)argsp->info[0].dest_offset, + (int64_t)argsp->info[1].dest_fd, + (uint64_t)argsp->info[1].dest_offset); + if (verbose) + printf(", {dest_fd=%" PRId64 ", dest_offset=%" PRIu64 "}", + (int64_t)argsp->info[2].dest_fd, + (uint64_t)argsp->info[2].dest_offset); + else + printf(", ..."); + printf("]"); + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, argsp); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + int fd1, fd2; + char buf[16384]; + + memset(buf, 0, sizeof(buf)); + + fd1 = openat(btrfs_test_dir_fd, "file1", O_RDWR|O_CREAT, 0600); + if (fd1 < 0) + perror_msg_and_fail("open file1 failed"); + + fd2 = openat(btrfs_test_dir_fd, "file2", O_RDWR|O_CREAT, 0600); + if (fd2 < 0) + perror_msg_and_fail("open file2 failed"); + + if (write(fd1, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd1"); + if (write(fd1, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd1"); + if (write(fd2, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd2"); + if (write(fd2, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd2"); + + close(fd2); + fd2 = openat(btrfs_test_dir_fd, "file2", O_RDONLY); + if (fd2 < 0) + perror_msg_and_fail("open file2 failed"); + + memset(argsp, 0, sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + + argsp->src_offset = 0; + argsp->src_length = 4096; + argsp->dest_count = 3; + argsp->info[0].dest_fd = fd2; + argsp->info[0].dest_offset = 0; + argsp->info[1].dest_fd = fd2; + argsp->info[1].dest_offset = 10240; + argsp->info[2].dest_fd = fd2; + argsp->info[2].dest_offset = 20480; + + printf("ioctl(%d, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 ", src_length=%" PRIu64 + ", dest_count=%hu, info=", fd1, + (uint64_t)argsp->src_offset, + (uint64_t)argsp->src_length, argsp->dest_count); + printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 + "}, {dest_fd=%" PRId64 ", dest_offset=%"PRIu64 "}", + (int64_t)argsp->info[0].dest_fd, + (uint64_t)argsp->info[0].dest_offset, + (int64_t)argsp->info[1].dest_fd, + (uint64_t)argsp->info[1].dest_offset); + if (verbose) + printf(", {dest_fd=%" PRId64 + ", dest_offset=%" PRIu64 "}", + (int64_t)argsp->info[2].dest_fd, + (uint64_t)argsp->info[2].dest_offset); + else + printf(", ..."); + + ioctl(fd1, BTRFS_IOC_FILE_EXTENT_SAME, argsp); + printf("]} => {info="); + printf("[{bytes_deduped=%" PRIu64 ", status=%d}, " + "{bytes_deduped=%" PRIu64 ", status=%d}", + (uint64_t)argsp->info[0].bytes_deduped, + argsp->info[0].status, + (uint64_t)argsp->info[1].bytes_deduped, + argsp->info[1].status); + if (verbose) + printf(", {bytes_deduped=%" PRIu64 ", status=%d}", + (uint64_t)argsp->info[2].bytes_deduped, + argsp->info[2].status); + else + printf(", ..."); + printf("]}) = 0\n"); + close(fd1); + close(fd2); + unlinkat(btrfs_test_dir_fd, "file1", 0); + unlinkat(btrfs_test_dir_fd, "file2", 0); + close(fd1); + close(fd2); + } + free(argsp); +#endif /* BTRFS_IOC_FILE_EXTENT_SAME */ +} + +static void +btrfs_print_features(struct btrfs_ioctl_feature_flags *flags) +{ + printf("{compat_flags="); + printflags(btrfs_features_compat, flags->compat_flags, + "BTRFS_FEATURE_COMPAT_???"); + + printf(", compat_ro_flags="); + printflags(btrfs_features_compat_ro, flags->compat_ro_flags, + "BTRFS_FEATURE_COMPAT_RO_???"); + + printf(", incompat_flags="); + printflags(btrfs_features_incompat, flags->incompat_flags, + "BTRFS_FEATURE_INCOMPAT_???"); + printf("}"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SET_FEATURES + * + * Consumes nothing, returns argument: + * - BTRFS_IOC_GET_FEATURES + * - BTRFS_IOC_GET_SUPPORTED_FEATURES + */ +static void +btrfs_test_features_ioctls(void) +{ + struct btrfs_ioctl_feature_flags args[2] = { + { + .compat_flags = max_flags_plus_one(-1), + .incompat_flags = max_flags_plus_one(9), + .compat_ro_flags = max_flags_plus_one(0), + }, { + .compat_flags = max_flags_plus_one(-1), + .incompat_flags = max_flags_plus_one(9), + .compat_ro_flags = max_flags_plus_one(0), + }, + }; + struct btrfs_ioctl_feature_flags supported_features[3]; + + ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, ["); + btrfs_print_features(&args[0]); + printf(", "); + btrfs_print_features(&args[1]); + ioctl(-1, BTRFS_IOC_SET_FEATURES, &args); + printf("]) = -1 EBADF (%m)\n"); + + if (btrfs_test_root) { + printf("ioctl(%d, BTRFS_IOC_GET_FEATURES, ", + btrfs_test_dir_fd); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FEATURES, + &supported_features); + btrfs_print_features(&supported_features[0]); + printf(") = 0\n"); + + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_SUPPORTED_FEATURES, + &supported_features); + printf("ioctl(%d, BTRFS_IOC_GET_SUPPORTED_FEATURES, ", + btrfs_test_dir_fd); + printf("[ /* supported */ "); + btrfs_print_features(&supported_features[0]); + printf(", /* safe to set */ "); + btrfs_print_features(&supported_features[1]); + printf(", /* safe to clear */ "); + btrfs_print_features(&supported_features[2]); + printf("]) = 0\n"); + } +} + +static void +btrfs_test_read_ioctls(void) +{ + static const struct xlat btrfs_read_cmd[] = { + XLAT(BTRFS_IOC_BALANCE_PROGRESS), + XLAT(BTRFS_IOC_FS_INFO), + XLAT(BTRFS_IOC_GET_FEATURES), + XLAT(BTRFS_IOC_GET_FSLABEL), + XLAT(BTRFS_IOC_GET_SUPPORTED_FEATURES), + XLAT(BTRFS_IOC_QGROUP_LIMIT), + XLAT(BTRFS_IOC_QUOTA_RESCAN_STATUS), + XLAT(BTRFS_IOC_START_SYNC), + XLAT(BTRFS_IOC_SUBVOL_GETFLAGS), + }; + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(btrfs_read_cmd); ++i) { + ioctl(-1, (unsigned long) btrfs_read_cmd[i].val, 0); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", btrfs_read_cmd[i].str); + } +} + +int +main(int argc, char *argv[]) +{ + + int opt; + int ret; + const char *path; + + while ((opt = getopt(argc, argv, "wv")) != -1) { + switch (opt) { + case 'v': + /* + * These tests are incomplete, especially when + * printing arrays of objects are involved. + */ + verbose = true; + break; + case 'w': + write_ok = true; + break; + default: + error_msg_and_fail("usage: btrfs [-v] [-w] [path]"); + } + } + + /* + * This will enable optional tests that require a valid file descriptor + */ + if (optind < argc) { + int rootfd; + struct statfs sfi; + path = argv[optind]; + + ret = statfs(path, &sfi); + if (ret) + perror_msg_and_fail("statfs(%s) failed", path); + + if ((unsigned) sfi.f_type != BTRFS_SUPER_MAGIC) + error_msg_and_fail("%s is not a btrfs file system", + path); + + btrfs_test_root = path; + rootfd = open(path, O_RDONLY|O_DIRECTORY); + if (rootfd < 0) + perror_msg_and_fail("open(%s) failed", path); + + ret = mkdirat(rootfd, "strace-test", 0755); + if (ret < 0 && errno != EEXIST) + perror_msg_and_fail("mkdirat(strace-test) failed"); + + btrfs_test_dir_fd = openat(rootfd, "strace-test", + O_RDONLY|O_DIRECTORY); + if (btrfs_test_dir_fd < 0) + perror_msg_and_fail("openat(strace-test) failed"); + close(rootfd); + } else + write_ok = false; + + if (btrfs_test_root) { + fprintf(stderr, "Testing live ioctls on %s (%s)\n", + btrfs_test_root, write_ok ? "read/write" : "read only"); + } + + btrfs_test_read_ioctls(); + btrfs_test_trans_ioctls(); + btrfs_test_sync_ioctls(); + btrfs_test_subvol_ioctls(); + btrfs_test_balance_ioctls(); + btrfs_test_device_ioctls(); + btrfs_test_clone_ioctls(); + btrfs_test_defrag_ioctls(); + btrfs_test_search_ioctls(); + btrfs_test_ino_lookup_ioctl(); + btrfs_test_space_info_ioctl(); + btrfs_test_scrub_ioctls(); + btrfs_test_dev_info_ioctl(); + btrfs_test_ino_path_ioctls(); + btrfs_test_set_received_subvol_ioctl(); + btrfs_test_send_ioctl(); + btrfs_test_quota_ctl_ioctl(); + btrfs_test_qgroup_assign_ioctl(); + btrfs_test_qgroup_create_ioctl(); + btrfs_test_quota_rescan_ioctl(); + btrfs_test_label_ioctls(); + btrfs_test_get_dev_stats_ioctl(); + btrfs_test_dev_replace_ioctl(); + btrfs_test_extent_same_ioctl(); + btrfs_test_features_ioctls(); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_BTRFS_H") + +#endif diff --git a/tests-m32/btrfs.test b/tests-m32/btrfs.test new file mode 100755 index 00000000..2121b5b8 --- /dev/null +++ b/tests-m32/btrfs.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic btrfs ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/caps-abbrev.awk b/tests-m32/caps-abbrev.awk new file mode 100644 index 00000000..86de7f23 --- /dev/null +++ b/tests-m32/caps-abbrev.awk @@ -0,0 +1,52 @@ +#!/bin/gawk +# +# This file is part of caps strace test. +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + cap = "(0|1< +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + cap = "(0|1< + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +extern int capget(int *, int *); +extern int capset(int *, const int *); + +int +main(void) +{ + const int data[] = { 2, 4, 0, 8, 16, 0 }; + const int v1 = 0x19980330; + const int v2 = 0x20071026; + const int v3 = 0x20080522; + + int * const head = tail_alloc(sizeof(int) * 2); + head[0] = v3; + head[1] = 0; + int * const tail_data = tail_alloc(sizeof(data)); + + capget(NULL, NULL); + capget(head + 2, tail_data); + capget(head, tail_data + ARRAY_SIZE(data)); + + if (capget(head, tail_data)) + perror_msg_and_skip("capget"); + if (head[0] != v3) + error_msg_and_skip("capget: v3 expected"); + + memcpy(tail_data, data, sizeof(data)); + + capset(NULL, NULL); + capset(head + 2, tail_data); + + head[0] = 0xbadc0ded; + head[1] = 2718281828U; + capset(head, tail_data + ARRAY_SIZE(data) - 2); + + head[0] = v2; + head[1] = 0; + capset(head, tail_data + ARRAY_SIZE(data) - 5); + + memcpy(tail_data, data, sizeof(data)); + head[0] = v3; + if (capset(head, tail_data) == 0 || errno != EPERM) + perror_msg_and_skip("capset"); + + memset(tail_data, 0, sizeof(data) / 2); + if (capset(head, tail_data) == 0 || errno != EPERM) + perror_msg_and_skip("capset"); + + memcpy(tail_data + ARRAY_SIZE(data) / 2, data, sizeof(data) / 2); + head[0] = v1; + if (capset(head, tail_data + ARRAY_SIZE(data) / 2) == 0 || + errno != EPERM) + perror_msg_and_skip("capset"); + + return 0; +} diff --git a/tests-m32/caps.test b/tests-m32/caps.test new file mode 100755 index 00000000..607a75bb --- /dev/null +++ b/tests-m32/caps.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check capget/capset syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a 19 -e trace=capget,capset $args +match_awk + +exit 0 diff --git a/tests-m32/chmod.c b/tests-m32/chmod.c new file mode 100644 index 00000000..f6f98ece --- /dev/null +++ b/tests-m32/chmod.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2016 Anchit Jain + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_chmod + +#include +#include +#include +#include + +int +main(void) +{ + static const char fname[] = "chmod_test_file"; + + if (open(fname, O_CREAT|O_RDONLY, 0400) < 0) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_chmod, fname, 0600); + printf("chmod(\"%s\", 0600) = %s\n", fname, sprintrc(rc)); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_chmod, fname, 051); + printf("chmod(\"%s\", 051) = %s\n", fname, sprintrc(rc)); + + rc = syscall(__NR_chmod, fname, 004); + printf("chmod(\"%s\", 004) = %s\n", fname, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chmod") + +#endif diff --git a/tests-m32/chmod.test b/tests-m32/chmod.test new file mode 100755 index 00000000..70e561a1 --- /dev/null +++ b/tests-m32/chmod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chmod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/chown.c b/tests-m32/chown.c new file mode 100644 index 00000000..12aa8b71 --- /dev/null +++ b/tests-m32/chown.c @@ -0,0 +1,19 @@ +#include "tests.h" +#include + +#ifdef __NR_chown + +# define SYSCALL_NR __NR_chown +# define SYSCALL_NAME "chown" + +# if defined __NR_chown32 && __NR_chown != __NR_chown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_chown") + +#endif diff --git a/tests-m32/chown.test b/tests-m32/chown.test new file mode 100755 index 00000000..eb356ce4 --- /dev/null +++ b/tests-m32/chown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/chown32.c b/tests-m32/chown32.c new file mode 100644 index 00000000..4fffd769 --- /dev/null +++ b/tests-m32/chown32.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_chown32 + +# define SYSCALL_NR __NR_chown32 +# define SYSCALL_NAME "chown32" +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_chown32") + +#endif diff --git a/tests-m32/chown32.test b/tests-m32/chown32.test new file mode 100755 index 00000000..0fa04c20 --- /dev/null +++ b/tests-m32/chown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-m32/chroot.c b/tests-m32/chroot.c new file mode 100644 index 00000000..a084cf33 --- /dev/null +++ b/tests-m32/chroot.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_chroot + +# include +# include + +int +main(void) +{ + static const char sample[] = "chroot.sample"; + + long rc = syscall(__NR_chroot, sample); + printf("chroot(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chroot") + +#endif diff --git a/tests-m32/chroot.test b/tests-m32/chroot.test new file mode 100755 index 00000000..3b384f5e --- /dev/null +++ b/tests-m32/chroot.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chroot syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/clock_adjtime.c b/tests-m32/clock_adjtime.c new file mode 100644 index 00000000..01089b54 --- /dev/null +++ b/tests-m32/clock_adjtime.c @@ -0,0 +1,60 @@ +/* + * This file is part of clock_adjtime strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_clock_adjtime + +# include +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_clock_adjtime, CLOCK_MONOTONIC, NULL); + printf("clock_adjtime(CLOCK_MONOTONIC, NULL) = %ld %s (%m)\n", + rc, errno2name()); + + void *efault = tail_alloc(1); + + rc = syscall(__NR_clock_adjtime, CLOCK_REALTIME, efault); + printf("clock_adjtime(CLOCK_REALTIME, %p) = %ld %s (%m)\n", + efault, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_clock_adjtime") + +#endif diff --git a/tests-m32/clock_adjtime.test b/tests-m32/clock_adjtime.test new file mode 100755 index 00000000..df2c0601 --- /dev/null +++ b/tests-m32/clock_adjtime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_adjtime syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-m32/clock_nanosleep.c b/tests-m32/clock_nanosleep.c new file mode 100644 index 00000000..98407d7e --- /dev/null +++ b/tests-m32/clock_nanosleep.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } req = { + .ts.tv_nsec = 0xc0de1, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, rem = { + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { + .it_interval.tv_usec = 222222, + .it_value.tv_usec = 111111 + }; + + if (syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, NULL)) + perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "NULL) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + NULL, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0, NULL, %p)" + " = -1 EFAULT (%m)\n", &rem.ts); + + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == 0); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "%p) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + req.ts.tv_nsec = 999999999 + 1; + assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_MONOTONIC, 0" + ", {tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" + ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", + (intmax_t) itv.it_interval.tv_sec, + (intmax_t) itv.it_interval.tv_usec, + (intmax_t) itv.it_value.tv_sec, + (intmax_t) itv.it_value.tv_usec); + + --req.ts.tv_nsec; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "{tv_sec=%jd, tv_nsec=%jd})" + " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, + (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + assert(syscall(__NR_clock_gettime, CLOCK_REALTIME, &req.ts) == 0); + printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + ++req.ts.tv_sec; + rem.ts.tv_sec = 0xc0de4; + rem.ts.tv_nsec = 0xc0de5; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, TIMER_ABSTIME, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=%jd, " + "tv_nsec=%jd}, %p)" + " = ? ERESTARTNOHAND (To be restarted if no handler)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/clock_nanosleep.test b/tests-m32/clock_nanosleep.test new file mode 100755 index 00000000..ec434a60 --- /dev/null +++ b/tests-m32/clock_nanosleep.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_nanosleep, clock_gettime, and setitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=clock_nanosleep,clock_gettime,setitimer diff --git a/tests-m32/clock_xettime.c b/tests-m32/clock_xettime.c new file mode 100644 index 00000000..3ef5695f --- /dev/null +++ b/tests-m32/clock_xettime.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#if defined __NR_clock_getres \ + && defined __NR_clock_gettime \ + && defined __NR_clock_settime + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } t = { + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_clock_getres, CLOCK_REALTIME, &t.ts)) + perror_msg_and_skip("clock_getres CLOCK_REALTIME"); + printf("clock_getres(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + if (syscall(__NR_clock_gettime, CLOCK_PROCESS_CPUTIME_ID, &t.ts)) + perror_msg_and_skip("clock_gettime CLOCK_PROCESS_CPUTIME_ID"); + printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, " + "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + t.ts.tv_sec = 0xdeface1; + t.ts.tv_nsec = 0xdeface2; + if (!syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts)) + error_msg_and_skip("clock_settime CLOCK_THREAD_CPUTIME_ID:" + " EINVAL expected"); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID, {tv_sec=%jd, " + "tv_nsec=%jd}) = -1 EINVAL (%m)\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_clock_getres && __NR_clock_gettime && __NR_clock_settime") + +#endif diff --git a/tests-m32/clock_xettime.test b/tests-m32/clock_xettime.test new file mode 100755 index 00000000..f045a66e --- /dev/null +++ b/tests-m32/clock_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_getres, clock_gettime, and clock_settime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests-m32/copy_file_range.c b/tests-m32/copy_file_range.c new file mode 100644 index 00000000..085010af --- /dev/null +++ b/tests-m32/copy_file_range.c @@ -0,0 +1,66 @@ +/* + * This file is part of copy_file_range strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#if defined __NR_copy_file_range + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffff; + const long int fd_out = (long int) 0xdeadbeeffffffffe; + long long int *const off_in = tail_alloc(sizeof(*off_in)); + long long int *const off_out = tail_alloc(sizeof(*off_out)); + *off_in = 0xdeadbef1facefed1; + *off_out = 0xdeadbef2facefed2; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 0; + + long rc = syscall(__NR_copy_file_range, + fd_in, off_in, fd_out, off_out, len, flags); + printf("copy_file_range(%d, [%lld], %d, [%lld], %zu, %u)" + " = %ld %s (%m)\n", + (int) fd_in, *off_in, (int) fd_out, *off_out, len, flags, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_copy_file_range") + +#endif diff --git a/tests-m32/copy_file_range.test b/tests-m32/copy_file_range.test new file mode 100755 index 00000000..c39f6acd --- /dev/null +++ b/tests-m32/copy_file_range.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check copy_file_range syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/count-f.c b/tests-m32/count-f.c new file mode 100644 index 00000000..6992b16b --- /dev/null +++ b/tests-m32/count-f.c @@ -0,0 +1,102 @@ +/* + * This file is part of count-f strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#define N 32 +#define P 8 +#define T 4 + +static void * +thread(void *arg) +{ + unsigned int i; + + assert(chdir(".") == 0); + for (i = 0; i < N; ++i) { + assert(chdir("") == -1); + assert(chdir(".") == 0); + } + + return NULL; +} + +static int +process(void) +{ + unsigned int i; + pthread_t t[T]; + + for (i = 0; i < T; ++i) { + errno = pthread_create(&t[i], NULL, thread, NULL); + if (errno) + perror_msg_and_fail("pthread_create"); + } + + for (i = 0; i < T; ++i) { + void *retval; + errno = pthread_join(t[i], &retval); + if (errno) + perror_msg_and_fail("pthread_join"); + } + + return 0; +} + +int +main(void) +{ + unsigned int i; + pid_t p[P]; + + for (i = 0; i < P; ++i) { + p[i] = fork(); + if (p[i] < 0) + perror_msg_and_fail("fork"); + if (!p[i]) + return process(); + } + for (i = 0; i < P; ++i) { + int s; + + assert(waitpid(p[i], &s, 0) == p[i]); + assert(WIFEXITED(s)); + if (WEXITSTATUS(s)) + return WEXITSTATUS(s); + } + + return 0; +} diff --git a/tests-m32/count-f.expected b/tests-m32/count-f.expected new file mode 100644 index 00000000..f61ba54e --- /dev/null +++ b/tests-m32/count-f.expected @@ -0,0 +1 @@ +[ ]*[^ ]+ +[^ ]+ +[^ ]+ +2080 +1024 +chdir diff --git a/tests-m32/count-f.test b/tests-m32/count-f.test new file mode 100755 index 00000000..67515efa --- /dev/null +++ b/tests-m32/count-f.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check whether -c counts through forks and clones properly + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -q -f -c $args +match_grep + +exit 0 diff --git a/tests-m32/count.test b/tests-m32/count.test new file mode 100755 index 00000000..e75dc6b0 --- /dev/null +++ b/tests-m32/count.test @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Check whether -c and -w options work. +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +check_prog grep + +grep_log() +{ + local pattern="$1"; shift + + run_strace "$@" ./sleep 1 + + grep nanosleep "$LOG" > /dev/null || + framework_skip_ 'sleep does not use nanosleep' + + LC_ALL=C grep -E -x -e "$pattern" "$LOG" > /dev/null || { + echo "Pattern of expected output: $pattern" + echo 'Actual output:' + dump_log_and_fail_with "$STRACE $args output mismatch" + } +} + +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -enanosleep +grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw +grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -enanosleep + +exit 0 diff --git a/tests-m32/creat.c b/tests-m32/creat.c new file mode 100644 index 00000000..f22fdaaa --- /dev/null +++ b/tests-m32/creat.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_creat + +# define TEST_SYSCALL_NR __NR_creat +# define TEST_SYSCALL_STR "creat" +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_creat") + +#endif diff --git a/tests-m32/creat.test b/tests-m32/creat.test new file mode 100755 index 00000000..069648f7 --- /dev/null +++ b/tests-m32/creat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check creat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/delete_module.c b/tests-m32/delete_module.c new file mode 100644 index 00000000..5a317603 --- /dev/null +++ b/tests-m32/delete_module.c @@ -0,0 +1,115 @@ +/* + * Check decoding of delete_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_delete_module) + +# include +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + static const struct { + kernel_ulong_t val; + const char *str; + unsigned int val_prefix, val_suffix; + } flags[] = { + { ARG_STR(0), 0, 0 }, + { (kernel_ulong_t) 0xffffffff00000000ULL | O_NONBLOCK, + "O_NONBLOCK", 0, 0 }, + { (kernel_ulong_t) 0xbadc0dedfacef157ULL & ~(O_NONBLOCK | O_TRUNC), + " /* O_??? */", 0xfacef157U & ~(O_NONBLOCK | O_TRUNC), 0}, + { (kernel_ulong_t) (0xfacef157deade71cULL & ~O_NONBLOCK) | O_TRUNC, + "O_TRUNC", 0, 0xdeade71c & ~(O_NONBLOCK | O_TRUNC)}, + { -1LL, "O_NONBLOCK|O_TRUNC", 0, -1U & ~(O_NONBLOCK | O_TRUNC)}, + }; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_delete_module, NULL, bogus_zero); + printf("delete_module(NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_delete_module, bogus_param1, flags[0].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"..., %s) = %s\n", flags[0].str, errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_delete_module, bogus_param1, flags[1].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\", %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_delete_module, bogus_param2 + PARAM2_LEN, + flags[2].val); + printf("delete_module(%p, %#x%s) = %s\n", + bogus_param2 + PARAM2_LEN, flags[2].val_prefix, + flags[2].str, sprintrc(rc)); + + rc = syscall(__NR_delete_module, bogus_param2, flags[3].val); + printf("delete_module(%p, %s|%#x) = %s\n", + bogus_param2, flags[3].str, flags[3].val_suffix, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_delete_module, bogus_param2, flags[4].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\", %s|%#x) = %s\n", flags[4].str, flags[4].val_suffix, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_delete_module"); + +#endif diff --git a/tests-m32/delete_module.test b/tests-m32/delete_module.test new file mode 100755 index 00000000..fb86ec9a --- /dev/null +++ b/tests-m32/delete_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of delete_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-m32/detach-running.test b/tests-m32/detach-running.test new file mode 100755 index 00000000..006efb85 --- /dev/null +++ b/tests-m32/detach-running.test @@ -0,0 +1,90 @@ +#!/bin/sh +# +# Ensure that strace can detach from running processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep + +set -e + +./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & + +while ! [ -s "$LOG" ]; do + kill -0 $! 2> /dev/null || + fail_ 'set_ptracer_any sh failed' + $SLEEP_A_BIT +done + +tracee_pid=$! + +cleanup() +{ + set +e + kill $tracee_pid + wait $tracee_pid 2> /dev/null + return 0 +} + +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & + +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } + $SLEEP_A_BIT +done + +kill -INT $! +wait $! + +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" + } + +if [ -f /proc/self/status ]; then + $SLEEP_A_BIT + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*R (running)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' + cleanup + dump_log_and_fail_with 'tracee is not running after detach' + } +fi + +cleanup +exit 0 diff --git a/tests-m32/detach-sleeping.test b/tests-m32/detach-sleeping.test new file mode 100755 index 00000000..54304f31 --- /dev/null +++ b/tests-m32/detach-sleeping.test @@ -0,0 +1,91 @@ +#!/bin/sh +# +# Ensure that strace can detach from sleeping processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep + +set -e + +rm -f "$LOG" +./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & + +while ! [ -s "$LOG" ]; do + kill -0 $! 2> /dev/null || + fail_ 'set_ptracer_any sleep failed' + $SLEEP_A_BIT +done + +tracee_pid=$! + +cleanup() +{ + set +e + kill $tracee_pid + wait $tracee_pid 2> /dev/null + return 0 +} + +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & + +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } + $SLEEP_A_BIT +done + +kill -INT $! +wait $! + +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} + +if [ -f /proc/self/status ]; then + $SLEEP_A_BIT + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*S (sleeping)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' + cleanup + dump_log_and_fail_with 'tracee is not sleeping after detach' + } +fi + +cleanup +exit 0 diff --git a/tests-m32/detach-stopped.test b/tests-m32/detach-stopped.test new file mode 100755 index 00000000..8f480e7f --- /dev/null +++ b/tests-m32/detach-stopped.test @@ -0,0 +1,106 @@ +#!/bin/sh +# +# Ensure that strace can detach from stopped processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep + +$STRACE -d -enone / > /dev/null 2> "$LOG" +if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then + skip_ "PTRACE_SEIZE doesn't work" +fi + +set -e + +rm -f "$LOG" +./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & + +while ! [ -s "$LOG" ]; do + kill -0 $! 2> /dev/null || + fail_ 'set_ptracer_any sleep failed' + $SLEEP_A_BIT +done + +tracee_pid=$! +kill -STOP $tracee_pid + +cleanup() +{ + set +e + kill $tracee_pid + kill -CONT $tracee_pid + wait $tracee_pid 2> /dev/null + return 0 +} + +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & + +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } + $SLEEP_A_BIT +done + +while ! grep -F -e '--- stopped by ' "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p missed stop notifications" + } + $SLEEP_A_BIT +done + +kill -INT $! +wait $! + +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} + +if [ -f /proc/self/status ]; then + $SLEEP_A_BIT + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*T (stopped)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' + cleanup + dump_log_and_fail_with 'tracee is not group-stopped after detach' + } +fi + +cleanup +exit 0 diff --git a/tests-m32/dup.c b/tests-m32/dup.c new file mode 100644 index 00000000..62157e2f --- /dev/null +++ b/tests-m32/dup.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include +#include + +int +main(void) +{ + int rc = dup(-1); + printf("dup(-1) = %d %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/dup.test b/tests-m32/dup.test new file mode 100755 index 00000000..1dc19198 --- /dev/null +++ b/tests-m32/dup.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-m32/dup2.c b/tests-m32/dup2.c new file mode 100644 index 00000000..9f3addfa --- /dev/null +++ b/tests-m32/dup2.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_dup2 + +# include +# include + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_dup2, fd_old, fd_new); + printf("dup2(%d, %d) = %ld %s (%m)\n", + (int) fd_old, (int) fd_new, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_dup2") + +#endif diff --git a/tests-m32/dup2.test b/tests-m32/dup2.test new file mode 100755 index 00000000..509c5db1 --- /dev/null +++ b/tests-m32/dup2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-m32/dup3.c b/tests-m32/dup3.c new file mode 100644 index 00000000..252e8469 --- /dev/null +++ b/tests-m32/dup3.c @@ -0,0 +1,28 @@ +#include "tests.h" +#include +#include + +#if defined __NR_dup3 && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_dup3, fd_old, fd_new, O_CLOEXEC); + printf("dup3(%d, %d, O_CLOEXEC) = %ld %s (%m)\n", + (int) fd_old, (int) fd_new, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_dup3 && && O_CLOEXEC") + +#endif diff --git a/tests-m32/dup3.test b/tests-m32/dup3.test new file mode 100755 index 00000000..293f78f9 --- /dev/null +++ b/tests-m32/dup3.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup3 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/epoll_create.c b/tests-m32/epoll_create.c new file mode 100644 index 00000000..44262c7d --- /dev/null +++ b/tests-m32/epoll_create.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_create + +# include +# include + +int +main(void) +{ + const long int size = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_epoll_create, size); + printf("epoll_create(%d) = %ld %s (%m)\n", + (int) size, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_creat") + +#endif diff --git a/tests-m32/epoll_create.test b/tests-m32/epoll_create.test new file mode 100755 index 00000000..472a9bdb --- /dev/null +++ b/tests-m32/epoll_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_create syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/epoll_create1.c b/tests-m32/epoll_create1.c new file mode 100644 index 00000000..cd905ecb --- /dev/null +++ b/tests-m32/epoll_create1.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_epoll_create1 && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_epoll_create1, O_CLOEXEC); + printf("epoll_create1(EPOLL_CLOEXEC) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK); + printf("epoll_create1(EPOLL_CLOEXEC|%#x) = %s\n", + O_NONBLOCK, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_create1 && O_CLOEXEC") + +#endif diff --git a/tests-m32/epoll_create1.test b/tests-m32/epoll_create1.test new file mode 100755 index 00000000..7a926a97 --- /dev/null +++ b/tests-m32/epoll_create1.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_create1 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/epoll_ctl.c b/tests-m32/epoll_ctl.c new file mode 100644 index 00000000..e6660555 --- /dev/null +++ b/tests-m32/epoll_ctl.c @@ -0,0 +1,45 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_ctl + +# include +# include +# include +# include + +static long +invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev) +{ + op |= (unsigned long) 0xffffffff00000000ULL; + return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev); +} + +int +main(void) +{ + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + ev->events = EPOLLIN; + + long rc = invoke_syscall(-1U, EPOLL_CTL_ADD, -2U, ev); + printf("epoll_ctl(-1, EPOLL_CTL_ADD, -2, {EPOLLIN," + " {u32=%u, u64=%" PRIu64 "}}) = %ld %s (%m)\n", + ev->data.u32, ev->data.u64, rc, errno2name()); + + rc = invoke_syscall(-3U, EPOLL_CTL_DEL, -4U, ev); + printf("epoll_ctl(-3, EPOLL_CTL_DEL, -4, %p) = %ld %s (%m)\n", + ev, rc, errno2name()); + + rc = invoke_syscall(-1UL, EPOLL_CTL_MOD, -16UL, 0); + printf("epoll_ctl(-1, EPOLL_CTL_MOD, -16, NULL) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_ctl") + +#endif diff --git a/tests-m32/epoll_ctl.test b/tests-m32/epoll_ctl.test new file mode 100755 index 00000000..1aded543 --- /dev/null +++ b/tests-m32/epoll_ctl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_ctl syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/epoll_pwait.c b/tests-m32/epoll_pwait.c new file mode 100644 index 00000000..eaaa34d6 --- /dev/null +++ b/tests-m32/epoll_pwait.c @@ -0,0 +1,30 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_pwait + +# include +# include +# include +# include + +int +main(void) +{ + sigset_t set[2]; + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + + long rc = syscall(__NR_epoll_pwait, -1, ev, 1, -2, + set, (kernel_ulong_t) sizeof(set)); + printf("epoll_pwait(-1, %p, 1, -2, %p, %u) = %ld %s (%m)\n", + ev, set, (unsigned) sizeof(set), rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_pwait") + +#endif diff --git a/tests-m32/epoll_pwait.test b/tests-m32/epoll_pwait.test new file mode 100755 index 00000000..c7aeeace --- /dev/null +++ b/tests-m32/epoll_pwait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of epoll_pwait syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/epoll_wait.c b/tests-m32/epoll_wait.c new file mode 100644 index 00000000..038bf1f7 --- /dev/null +++ b/tests-m32/epoll_wait.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_wait + +# include +# include +# include + +int +main(void) +{ + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + + long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2); + printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n", + ev, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_wait") + +#endif diff --git a/tests-m32/epoll_wait.test b/tests-m32/epoll_wait.test new file mode 100755 index 00000000..83ae161f --- /dev/null +++ b/tests-m32/epoll_wait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_wait syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 diff --git a/tests-m32/erestartsys.c b/tests-m32/erestartsys.c new file mode 100644 index 00000000..97c9699c --- /dev/null +++ b/tests-m32/erestartsys.c @@ -0,0 +1,81 @@ +/* + * Check decoding of ERESTARTSYS error code. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static int sv[2]; + +static void +handler(int sig) +{ + close(sv[1]); + sv[1] = -1; +} + +int +main(void) +{ + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + const struct sigaction act = { + .sa_handler = handler, + .sa_flags = SA_RESTART + }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct itimerval itv = { .it_value.tv_usec = 123456 }; + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_fail("setitimer"); + + if (recvfrom(sv[0], &sv[1], sizeof(sv[1]), 0, NULL, NULL)) + perror_msg_and_fail("recvfrom"); + + printf("recvfrom(%d, %p, %d, 0, NULL, NULL) = ? ERESTARTSYS" + " (To be restarted if SA_RESTART is set)\n", + sv[0], &sv[1], (int) sizeof(sv[1])); + printf("recvfrom(%d, \"\", %d, 0, NULL, NULL) = 0\n", + sv[0], (int) sizeof(sv[1])); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/erestartsys.test b/tests-m32/erestartsys.test new file mode 100755 index 00000000..91f711f3 --- /dev/null +++ b/tests-m32/erestartsys.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ERESTARTSYS error code. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests-m32/errno2name.c b/tests-m32/errno2name.c new file mode 100644 index 00000000..4a176993 --- /dev/null +++ b/tests-m32/errno2name.c @@ -0,0 +1,481 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#define CASE(x) case x: return #x + +const char * +errno2name(void) +{ + switch (errno) { + /* names taken from linux/errnoent.h */ +#ifdef E2BIG + CASE(E2BIG); +#endif +#ifdef EACCES + CASE(EACCES); +#endif +#ifdef EADDRINUSE + CASE(EADDRINUSE); +#endif +#ifdef EADDRNOTAVAIL + CASE(EADDRNOTAVAIL); +#endif +#ifdef EADV + CASE(EADV); +#endif +#ifdef EAFNOSUPPORT + CASE(EAFNOSUPPORT); +#endif +#ifdef EAGAIN + CASE(EAGAIN); +#endif +#ifdef EALREADY + CASE(EALREADY); +#endif +#ifdef EBADCOOKIE + CASE(EBADCOOKIE); +#endif +#ifdef EBADE + CASE(EBADE); +#endif +#ifdef EBADF + CASE(EBADF); +#endif +#ifdef EBADFD + CASE(EBADFD); +#endif +#ifdef EBADHANDLE + CASE(EBADHANDLE); +#endif +#ifdef EBADMSG + CASE(EBADMSG); +#endif +#ifdef EBADR + CASE(EBADR); +#endif +#ifdef EBADRQC + CASE(EBADRQC); +#endif +#ifdef EBADSLT + CASE(EBADSLT); +#endif +#ifdef EBADTYPE + CASE(EBADTYPE); +#endif +#ifdef EBFONT + CASE(EBFONT); +#endif +#ifdef EBUSY + CASE(EBUSY); +#endif +#ifdef ECANCELED + CASE(ECANCELED); +#endif +#ifdef ECHILD + CASE(ECHILD); +#endif +#ifdef ECHRNG + CASE(ECHRNG); +#endif +#ifdef ECOMM + CASE(ECOMM); +#endif +#ifdef ECONNABORTED + CASE(ECONNABORTED); +#endif +#ifdef ECONNREFUSED + CASE(ECONNREFUSED); +#endif +#ifdef ECONNRESET + CASE(ECONNRESET); +#endif +#ifdef EDEADLK + CASE(EDEADLK); +#endif +#ifdef EDESTADDRREQ + CASE(EDESTADDRREQ); +#endif +#ifdef EDOM + CASE(EDOM); +#endif +#ifdef EDOTDOT + CASE(EDOTDOT); +#endif +#ifdef EDQUOT + CASE(EDQUOT); +#endif +#ifdef EEXIST + CASE(EEXIST); +#endif +#ifdef EFAULT + CASE(EFAULT); +#endif +#ifdef EFBIG + CASE(EFBIG); +#endif +#ifdef EHOSTDOWN + CASE(EHOSTDOWN); +#endif +#ifdef EHOSTUNREACH + CASE(EHOSTUNREACH); +#endif +#ifdef EHWPOISON + CASE(EHWPOISON); +#endif +#ifdef EIDRM + CASE(EIDRM); +#endif +#ifdef EILSEQ + CASE(EILSEQ); +#endif +#ifdef EINPROGRESS + CASE(EINPROGRESS); +#endif +#ifdef EINTR + CASE(EINTR); +#endif +#ifdef EINVAL + CASE(EINVAL); +#endif +#ifdef EIO + CASE(EIO); +#endif +#ifdef EIOCBQUEUED + CASE(EIOCBQUEUED); +#endif +#ifdef EISCONN + CASE(EISCONN); +#endif +#ifdef EISDIR + CASE(EISDIR); +#endif +#ifdef EISNAM + CASE(EISNAM); +#endif +#ifdef EJUKEBOX + CASE(EJUKEBOX); +#endif +#ifdef EKEYEXPIRED + CASE(EKEYEXPIRED); +#endif +#ifdef EKEYREJECTED + CASE(EKEYREJECTED); +#endif +#ifdef EKEYREVOKED + CASE(EKEYREVOKED); +#endif +#ifdef EL2HLT + CASE(EL2HLT); +#endif +#ifdef EL2NSYNC + CASE(EL2NSYNC); +#endif +#ifdef EL3HLT + CASE(EL3HLT); +#endif +#ifdef EL3RST + CASE(EL3RST); +#endif +#ifdef ELIBACC + CASE(ELIBACC); +#endif +#ifdef ELIBBAD + CASE(ELIBBAD); +#endif +#ifdef ELIBEXEC + CASE(ELIBEXEC); +#endif +#ifdef ELIBMAX + CASE(ELIBMAX); +#endif +#ifdef ELIBSCN + CASE(ELIBSCN); +#endif +#ifdef ELNRNG + CASE(ELNRNG); +#endif +#ifdef ELOOP + CASE(ELOOP); +#endif +#ifdef EMEDIUMTYPE + CASE(EMEDIUMTYPE); +#endif +#ifdef EMFILE + CASE(EMFILE); +#endif +#ifdef EMLINK + CASE(EMLINK); +#endif +#ifdef EMSGSIZE + CASE(EMSGSIZE); +#endif +#ifdef EMULTIHOP + CASE(EMULTIHOP); +#endif +#ifdef ENAMETOOLONG + CASE(ENAMETOOLONG); +#endif +#ifdef ENAVAIL + CASE(ENAVAIL); +#endif +#ifdef ENETDOWN + CASE(ENETDOWN); +#endif +#ifdef ENETRESET + CASE(ENETRESET); +#endif +#ifdef ENETUNREACH + CASE(ENETUNREACH); +#endif +#ifdef ENFILE + CASE(ENFILE); +#endif +#ifdef ENOANO + CASE(ENOANO); +#endif +#ifdef ENOBUFS + CASE(ENOBUFS); +#endif +#ifdef ENOCSI + CASE(ENOCSI); +#endif +#ifdef ENODATA + CASE(ENODATA); +#endif +#ifdef ENODEV + CASE(ENODEV); +#endif +#ifdef ENOENT + CASE(ENOENT); +#endif +#ifdef ENOEXEC + CASE(ENOEXEC); +#endif +#ifdef ENOIOCTLCMD + CASE(ENOIOCTLCMD); +#endif +#ifdef ENOKEY + CASE(ENOKEY); +#endif +#ifdef ENOLCK + CASE(ENOLCK); +#endif +#ifdef ENOLINK + CASE(ENOLINK); +#endif +#ifdef ENOMEDIUM + CASE(ENOMEDIUM); +#endif +#ifdef ENOMEM + CASE(ENOMEM); +#endif +#ifdef ENOMSG + CASE(ENOMSG); +#endif +#ifdef ENONET + CASE(ENONET); +#endif +#ifdef ENOPKG + CASE(ENOPKG); +#endif +#ifdef ENOPROTOOPT + CASE(ENOPROTOOPT); +#endif +#ifdef ENOSPC + CASE(ENOSPC); +#endif +#ifdef ENOSR + CASE(ENOSR); +#endif +#ifdef ENOSTR + CASE(ENOSTR); +#endif +#ifdef ENOSYS + CASE(ENOSYS); +#endif +#ifdef ENOTBLK + CASE(ENOTBLK); +#endif +#ifdef ENOTCONN + CASE(ENOTCONN); +#endif +#ifdef ENOTDIR + CASE(ENOTDIR); +#endif +#ifdef ENOTEMPTY + CASE(ENOTEMPTY); +#endif +#ifdef ENOTNAM + CASE(ENOTNAM); +#endif +#ifdef ENOTRECOVERABLE + CASE(ENOTRECOVERABLE); +#endif +#ifdef ENOTSOCK + CASE(ENOTSOCK); +#endif +#ifdef ENOTSUPP + CASE(ENOTSUPP); +#endif +#ifdef ENOTSYNC + CASE(ENOTSYNC); +#endif +#ifdef ENOTTY + CASE(ENOTTY); +#endif +#ifdef ENOTUNIQ + CASE(ENOTUNIQ); +#endif +#ifdef ENXIO + CASE(ENXIO); +#endif +#ifdef EOPENSTALE + CASE(EOPENSTALE); +#endif +#ifdef EOPNOTSUPP + CASE(EOPNOTSUPP); +#endif +#ifdef EOVERFLOW + CASE(EOVERFLOW); +#endif +#ifdef EOWNERDEAD + CASE(EOWNERDEAD); +#endif +#ifdef EPERM + CASE(EPERM); +#endif +#ifdef EPFNOSUPPORT + CASE(EPFNOSUPPORT); +#endif +#ifdef EPIPE + CASE(EPIPE); +#endif +#ifdef EPROBE_DEFER + CASE(EPROBE_DEFER); +#endif +#ifdef EPROTO + CASE(EPROTO); +#endif +#ifdef EPROTONOSUPPORT + CASE(EPROTONOSUPPORT); +#endif +#ifdef EPROTOTYPE + CASE(EPROTOTYPE); +#endif +#ifdef ERANGE + CASE(ERANGE); +#endif +#ifdef EREMCHG + CASE(EREMCHG); +#endif +#ifdef EREMOTE + CASE(EREMOTE); +#endif +#ifdef EREMOTEIO + CASE(EREMOTEIO); +#endif +#ifdef ERESTART + CASE(ERESTART); +#endif +#ifdef ERESTARTNOHAND + CASE(ERESTARTNOHAND); +#endif +#ifdef ERESTARTNOINTR + CASE(ERESTARTNOINTR); +#endif +#ifdef ERESTARTSYS + CASE(ERESTARTSYS); +#endif +#ifdef ERESTART_RESTARTBLOCK + CASE(ERESTART_RESTARTBLOCK); +#endif +#ifdef ERFKILL + CASE(ERFKILL); +#endif +#ifdef EROFS + CASE(EROFS); +#endif +#ifdef ESERVERFAULT + CASE(ESERVERFAULT); +#endif +#ifdef ESHUTDOWN + CASE(ESHUTDOWN); +#endif +#ifdef ESOCKTNOSUPPORT + CASE(ESOCKTNOSUPPORT); +#endif +#ifdef ESPIPE + CASE(ESPIPE); +#endif +#ifdef ESRCH + CASE(ESRCH); +#endif +#ifdef ESRMNT + CASE(ESRMNT); +#endif +#ifdef ESTALE + CASE(ESTALE); +#endif +#ifdef ESTRPIPE + CASE(ESTRPIPE); +#endif +#ifdef ETIME + CASE(ETIME); +#endif +#ifdef ETIMEDOUT + CASE(ETIMEDOUT); +#endif +#ifdef ETOOMANYREFS + CASE(ETOOMANYREFS); +#endif +#ifdef ETOOSMALL + CASE(ETOOSMALL); +#endif +#ifdef ETXTBSY + CASE(ETXTBSY); +#endif +#ifdef EUCLEAN + CASE(EUCLEAN); +#endif +#ifdef EUNATCH + CASE(EUNATCH); +#endif +#ifdef EUSERS + CASE(EUSERS); +#endif +#ifdef EXDEV + CASE(EXDEV); +#endif +#ifdef EXFULL + CASE(EXFULL); +#endif + default: perror_msg_and_fail("unknown errno %d", errno); + } +} diff --git a/tests-m32/error_msg.c b/tests-m32/error_msg.c new file mode 100644 index 00000000..498a8821 --- /dev/null +++ b/tests-m32/error_msg.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +void +perror_msg_and_fail(const char *fmt, ...) +{ + int err_no = errno; + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + if (err_no) + fprintf(stderr, ": %s\n", strerror(err_no)); + else + putc('\n', stderr); + exit(1); +} + +void +error_msg_and_fail(const char *fmt, ...) +{ + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + putc('\n', stderr); + exit(1); +} + +void +error_msg_and_skip(const char *fmt, ...) +{ + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + putc('\n', stderr); + exit(77); +} + +void +perror_msg_and_skip(const char *fmt, ...) +{ + int err_no = errno; + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + if (err_no) + fprintf(stderr, ": %s\n", strerror(err_no)); + else + putc('\n', stderr); + exit(77); +} diff --git a/tests-m32/eventfd.c b/tests-m32/eventfd.c new file mode 100644 index 00000000..d6ad6492 --- /dev/null +++ b/tests-m32/eventfd.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#if defined __NR_eventfd2 && defined O_CLOEXEC + +int +main(void) +{ + (void) close(0); + if (syscall(__NR_eventfd2, -1L, 1 | O_CLOEXEC | O_NONBLOCK)) + perror_msg_and_skip("eventfd2"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_eventfd2 && O_CLOEXEC") + +#endif diff --git a/tests-m32/eventfd.expected b/tests-m32/eventfd.expected new file mode 100644 index 00000000..c4b45a07 --- /dev/null +++ b/tests-m32/eventfd.expected @@ -0,0 +1,2 @@ +eventfd2(4294967295, EFD_SEMAPHORE|EFD_CLOEXEC|EFD_NONBLOCK) = 0 ++++ exited with 0 +++ diff --git a/tests-m32/eventfd.test b/tests-m32/eventfd.test new file mode 100755 index 00000000..e181ed6e --- /dev/null +++ b/tests-m32/eventfd.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check eventfd2 syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e eventfd2 $args +match_diff + +exit 0 diff --git a/tests-m32/execve-v.c b/tests-m32/execve-v.c new file mode 100644 index 00000000..4506c635 --- /dev/null +++ b/tests-m32/execve-v.c @@ -0,0 +1,3 @@ +/* This file is part of execve-v strace test. */ +#define VERBOSE 1 +#include "execve.c" diff --git a/tests-m32/execve-v.test b/tests-m32/execve-v.test new file mode 100755 index 00000000..cce58601 --- /dev/null +++ b/tests-m32/execve-v.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check verbose decoding of execve syscall. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -veexecve $args > "$EXP" + +# Filter out execve() call made by strace. +grep -F test.execve < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/execve.c b/tests-m32/execve.c new file mode 100644 index 00000000..74749e73 --- /dev/null +++ b/tests-m32/execve.c @@ -0,0 +1,171 @@ +/* + * This file is part of execve strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#define FILENAME "test.execve\nfilename" +#define Q_FILENAME "test.execve\\nfilename" + +static const char * const argv[] = { + FILENAME, "first", "second", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_argv[] = { + Q_FILENAME, "first", "second" +}; + +static const char * const envp[] = { + "foobar=1", "foo\nbar=2", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_envp[] = { + "foobar=1", "foo\\nbar=2" +}; + +int +main(void) +{ + char ** const tail_argv = tail_memdup(argv, sizeof(argv)); + char ** const tail_envp = tail_memdup(envp, sizeof(envp)); + + execve(FILENAME, tail_argv, tail_envp); + printf("execve(\"%s\"" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" +#if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ???]" +#else + ", [/* 5 vars, unterminated */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], + argv[3], argv[4], argv[5] +#if VERBOSE + , q_envp[0], q_envp[1], envp[2], envp[3], envp[4] +#endif + ); + + tail_argv[ARRAY_SIZE(q_argv)] = NULL; + tail_envp[ARRAY_SIZE(q_envp)] = NULL; + + execve(FILENAME, tail_argv, tail_envp); + printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" +#if VERBOSE + ", [\"%s\", \"%s\"]" +#else + ", [/* 2 vars */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2] +#if VERBOSE + , q_envp[0], q_envp[1] +#endif + ); + + execve(FILENAME, tail_argv + 2, tail_envp + 1); + printf("execve(\"%s\", [\"%s\"]" +#if VERBOSE + ", [\"%s\"]" +#else + ", [/* 1 var */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[2] +#if VERBOSE + , q_envp[1] +#endif + ); + + char **const empty = tail_alloc(sizeof(*empty)); + char **const efault = empty + 1; + *empty = NULL; + + execve(FILENAME, empty, empty); + printf("execve(\"%s\", []" +#if VERBOSE + ", []" +#else + ", [/* 0 vars */]" +#endif + ") = -1 ENOENT (%m)\n", Q_FILENAME); + + char str_a[] = "012345678901234567890123456789012"; + char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; +#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) + char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); + char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); + unsigned int i; + for (i = 0; i <= DEFAULT_STRLEN; ++i) { + a[i] = &str_a[i]; + b[i] = &str_b[i]; + } + a[i] = b[i] = NULL; + + execve(FILENAME, a, b); + printf("execve(\"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); + for (i = 1; i < DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf(", \"%s\"", a[i]); +#else + printf(", ..."); +#endif +#if VERBOSE + printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); + for (i = 1; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %u vars */", DEFAULT_STRLEN + 1); +#endif + printf("]) = -1 ENOENT (%m)\n"); + + execve(FILENAME, a + 1, b + 1); + printf("execve(\"%s\", [\"%s\"", Q_FILENAME, a[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf("], [\"%s\"", b[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %d vars */", DEFAULT_STRLEN); +#endif + printf("]) = -1 ENOENT (%m)\n"); + + execve(FILENAME, (char **) tail_argv[ARRAY_SIZE(q_argv)], efault); + printf("execve(\"%s\", NULL, %p) = -1 ENOENT (%m)\n", + Q_FILENAME, efault); + + execve(FILENAME, efault, NULL); + printf("execve(\"%s\", %p, NULL) = -1 ENOENT (%m)\n", + Q_FILENAME, efault); + + return 0; +} diff --git a/tests-m32/execve.test b/tests-m32/execve.test new file mode 100755 index 00000000..263b6fc5 --- /dev/null +++ b/tests-m32/execve.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check execve syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -eexecve $args > "$EXP" + +# Filter out execve() call made by strace. +grep -F test.execve < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/execveat-v.c b/tests-m32/execveat-v.c new file mode 100644 index 00000000..ff4de2e8 --- /dev/null +++ b/tests-m32/execveat-v.c @@ -0,0 +1,3 @@ +/* This file is part of execveat-v strace test. */ +#define VERBOSE 1 +#include "execveat.c" diff --git a/tests-m32/execveat-v.test b/tests-m32/execveat-v.test new file mode 100755 index 00000000..a9052248 --- /dev/null +++ b/tests-m32/execveat-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of execveat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=execveat diff --git a/tests-m32/execveat.c b/tests-m32/execveat.c new file mode 100644 index 00000000..9083830e --- /dev/null +++ b/tests-m32/execveat.c @@ -0,0 +1,188 @@ +/* + * This file is part of execveat strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_execveat + +# include +# include + +# define FILENAME "test.execveat\nfilename" +# define Q_FILENAME "test.execveat\\nfilename" + +static const char * const argv[] = { + FILENAME, "first", "second", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_argv[] = { + Q_FILENAME, "first", "second" +}; + +static const char * const envp[] = { + "foobar=1", "foo\nbar=2", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_envp[] = { + "foobar=1", "foo\\nbar=2" +}; + +int +main(void) +{ + const char ** const tail_argv = tail_memdup(argv, sizeof(argv)); + const char ** const tail_envp = tail_memdup(envp, sizeof(envp)); + + syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); + printf("execveat(AT_FDCWD, \"%s\"" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" +#if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ???]" +#else + ", [/* 5 vars, unterminated */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], + argv[3], argv[4], argv[5], +#if VERBOSE + q_envp[0], q_envp[1], envp[2], envp[3], envp[4], +#endif + errno2name()); + + tail_argv[ARRAY_SIZE(q_argv)] = NULL; + tail_envp[ARRAY_SIZE(q_envp)] = NULL; + + syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]" +#if VERBOSE + ", [\"%s\", \"%s\"]" +#else + ", [/* 2 vars */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], +#if VERBOSE + q_envp[0], q_envp[1], +#endif + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]" +#if VERBOSE + ", [\"%s\"]" +#else + ", [/* 1 var */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[2], +#if VERBOSE + q_envp[1], +#endif + errno2name()); + + char **const empty = tail_alloc(sizeof(*empty)); + char **const efault = empty + 1; + *empty = NULL; + + syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", []" +#if VERBOSE + ", []" +#else + ", [/* 0 vars */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, errno2name()); + + char str_a[] = "012345678901234567890123456789012"; + char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; +#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) + char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); + char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); + unsigned int i; + for (i = 0; i <= DEFAULT_STRLEN; ++i) { + a[i] = &str_a[i]; + b[i] = &str_b[i]; + } + a[i] = b[i] = NULL; + + syscall(__NR_execveat, -100, FILENAME, a, b, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); + for (i = 1; i < DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf(", \"%s\"", a[i]); +#else + printf(", ..."); +#endif +#if VERBOSE + printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); + for (i = 1; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %u vars */", DEFAULT_STRLEN + 1); +#endif + printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, a + 1, b + 1, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf("], [\"%s\"", b[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %d vars */", DEFAULT_STRLEN); +#endif + printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, NULL, efault, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", NULL, %p" + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, efault, errno2name()); + + syscall(__NR_execveat, -100, FILENAME, efault, NULL, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", %p, NULL" + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, efault, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_execveat") + +#endif diff --git a/tests-m32/execveat.test b/tests-m32/execveat.test new file mode 100755 index 00000000..879e03e2 --- /dev/null +++ b/tests-m32/execveat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check execveat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/faccessat.c b/tests-m32/faccessat.c new file mode 100644 index 00000000..ce81349d --- /dev/null +++ b/tests-m32/faccessat.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_faccessat + +# include +# include + +int +main(void) +{ + static const char sample[] = "faccessat.sample"; + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_faccessat, fd, sample, F_OK); + printf("faccessat(%d, \"%s\", F_OK) = %ld %s (%m)\n", + (int) fd, sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_faccessat") + +#endif diff --git a/tests-m32/faccessat.test b/tests-m32/faccessat.test new file mode 100755 index 00000000..61e7e2fd --- /dev/null +++ b/tests-m32/faccessat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check faccessat syscall decoding. + +. "${srcdir=.}/openat.test" diff --git a/tests-m32/fadvise.h b/tests-m32/fadvise.h new file mode 100644 index 00000000..7a75f73b --- /dev/null +++ b/tests-m32/fadvise.h @@ -0,0 +1,57 @@ +/* + * Common definitions for fadvise64 and fadvise64_64 tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_FADVISE_H +#define STRACE_TESTS_FADVISE_H + +# include +# include +# include + +# include "xlat.h" +# include "xlat/advise.h" + +static void do_fadvise(long fd, long long offset, long long llen, long advice); + +int +main(void) +{ + static const long bogus_fd = (long) 0xfeedf00dbeeffaceULL; + static const long long bogus_offset = 0xbadc0dedda7a1057ULL; + static const long long bogus_len = 0xbadfaceca7b0d1e5ULL; + static const long bogus_advice = (long) 0xf00dfeeddeadca75ULL; + + do_fadvise(bogus_fd, bogus_offset, bogus_len, bogus_advice); + + puts("+++ exited with 0 +++"); + return 0; +} + +#endif /* !STRACE_TESTS_FADVISE_H */ diff --git a/tests-m32/fadvise64.c b/tests-m32/fadvise64.c new file mode 100644 index 00000000..930680be --- /dev/null +++ b/tests-m32/fadvise64.c @@ -0,0 +1,76 @@ +/* + * Check decoding of fadvise64 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_fadvise64 + +# include "fadvise.h" + +static void +do_fadvise(long fd, long long offset, long long llen, long advice) +{ + long ret; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + ret = syscall(__NR_fadvise64, fd, offset, llen, advice); + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %llu, ", (int) fd, offset, llen); +# elif defined LINUX_MIPSO32 + ret = syscall(__NR_fadvise64, fd, 0, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen), advice); + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %lld, ", (int) fd, offset, llen); +# else /* LONG_MAX == INT_MAX && !X32 && !LINUX_MIPSN32 */ + long len = (long) llen; +# if defined POWERPC + ret = syscall(__NR_fadvise64, fd, 0, + LL_VAL_TO_PAIR(offset), len, advice); +# else + ret = syscall(__NR_fadvise64, fd, + LL_VAL_TO_PAIR(offset), len, advice); +# endif + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %lu, ", (int) fd, offset, len); +# endif /* LONG_MAX == INT_MAX && !X32 && !LINUX_MIPSN32 */ + printxval(advise, (unsigned) advice, "POSIX_FADV_???"); + printf(") = %s\n", errstr); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fadvise64"); + +#endif diff --git a/tests-m32/fadvise64.test b/tests-m32/fadvise64.test new file mode 100755 index 00000000..9f746720 --- /dev/null +++ b/tests-m32/fadvise64.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of fadvise64 syscall. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e $NAME $args > "$EXP" +check_prog grep +grep -v "^$NAME([0123]," < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/fadvise64_64.c b/tests-m32/fadvise64_64.c new file mode 100644 index 00000000..c23df97f --- /dev/null +++ b/tests-m32/fadvise64_64.c @@ -0,0 +1,74 @@ +/* + * Check decoding of fadvise64_64 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __arm__ +# ifdef __NR_arm_fadvise64_64 +# undef __NR_fadvise64_64 +# define __NR_fadvise64_64 __NR_arm_fadvise64_64 +# endif /* __NR_arm_fadvise64_64 */ +#endif /* __arm__ */ + +#ifdef __NR_fadvise64_64 + +# include "fadvise.h" + +static void +do_fadvise(long fd, long long offset, long long llen, long advice) +{ + long ret; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + ret = syscall(__NR_fadvise64_64, fd, offset, llen, advice); +# elif defined __ARM_EABI__ || defined POWERPC || defined XTENSA + ret = syscall(__NR_fadvise64_64, fd, advice, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen)); +# else + ret = syscall(__NR_fadvise64_64, fd, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen), advice); +# endif + errstr = sprintrc(ret); + + printf("fadvise64_64(%d, %lld, %lld, ", (int) fd, offset, llen); + printxval(advise, (unsigned) advice, "POSIX_FADV_???"); + printf(") = %s\n", errstr); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fadvise64_64"); + +#endif diff --git a/tests-m32/fadvise64_64.test b/tests-m32/fadvise64_64.test new file mode 100755 index 00000000..a50fe2b9 --- /dev/null +++ b/tests-m32/fadvise64_64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of fadvise64_64 syscall. + +. "${srcdir=.}/fadvise64.test" diff --git a/tests-m32/fallocate.c b/tests-m32/fallocate.c new file mode 100644 index 00000000..a31711b3 --- /dev/null +++ b/tests-m32/fallocate.c @@ -0,0 +1,75 @@ +/* + * Check decoding of fallocate syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_fallocate) && defined(HAVE_FALLOCATE) && HAVE_FALLOCATE + +# include +# include +# include + +# include "xlat.h" +# include "xlat/falloc_flags.h" + +int +main(void) +{ + static const int bogus_fd = 0xbeefface; + static const int bogus_mode = 0xdeadca75; + static const off_t bogus_offset = (off_t) 0xbadc0dedda7a1057LLU; + static const off_t bogus_len = (off_t) 0xbadfaceca7b0d1e5LLU; + + long rc = fallocate(bogus_fd, bogus_mode, bogus_offset, bogus_len); + /* + * Workaround a bug fixed by commit glibc-2.11-346-gde240a0. + */ + if (rc > 0) { + errno = rc; + rc = -1; + } + const char *errstr = sprintrc(rc); + + printf("fallocate(%d, ", bogus_fd); + printflags(falloc_flags, (unsigned) bogus_mode, "FALLOC_FL_???"); + printf(", %lld, %lld) = %s\n", + (long long) bogus_offset, (long long) bogus_len, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fallocate && HAVE_FALLOCATE"); + +#endif diff --git a/tests-m32/fallocate.test b/tests-m32/fallocate.test new file mode 100755 index 00000000..405187e5 --- /dev/null +++ b/tests-m32/fallocate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getcwd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/fanotify_init.c b/tests-m32/fanotify_init.c new file mode 100644 index 00000000..c14b4131 --- /dev/null +++ b/tests-m32/fanotify_init.c @@ -0,0 +1,95 @@ +/* + * Check decoding of fanotify_init syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined __NR_fanotify_init + +# include +# include +# include + +/* Performs fanotify_init call via the syscall interface. */ +static void +do_call(kernel_ulong_t flags, const char *flags_str, + kernel_ulong_t event_f_flags, const char *event_f_flags_str) +{ + long rc; + + rc = syscall(__NR_fanotify_init, flags, event_f_flags); + + printf("fanotify_init(%s, %s) = %s\n", + flags_str, event_f_flags_str, sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + + +int +main(void) +{ + static const struct strval flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "FAN_CLASS_NOTIF" }, + { (kernel_ulong_t) 0xffffffff0000000cULL, + "0xc /* FAN_CLASS_??? */" }, + { (kernel_ulong_t) 0xdec0deddefaced04ULL, + "FAN_CLASS_CONTENT|0xefaced00 /* FAN_??? */" }, + { (kernel_ulong_t) 0xffffffffffffffffULL, + "0xc /* FAN_CLASS_??? */|FAN_CLOEXEC|FAN_NONBLOCK|" + "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|0xffffffc0" }, + }; + static const struct strval event_f_flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { (kernel_ulong_t) 0xdeadbeef80000001ULL, + "O_WRONLY|0x80000000" } + }; + + unsigned int i; + unsigned int j; + + + for (i = 0; i < ARRAY_SIZE(flags); i++) + for (j = 0; j < ARRAY_SIZE(event_f_flags); j++) + do_call(flags[i].val, flags[i].str, + event_f_flags[j].val, event_f_flags[j].str); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fanotify_init") + +#endif diff --git a/tests-m32/fanotify_init.test b/tests-m32/fanotify_init.test new file mode 100755 index 00000000..8d26af42 --- /dev/null +++ b/tests-m32/fanotify_init.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fanotify_init syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/fanotify_mark.c b/tests-m32/fanotify_mark.c new file mode 100644 index 00000000..43f285d3 --- /dev/null +++ b/tests-m32/fanotify_mark.c @@ -0,0 +1,182 @@ +/* + * Check decoding of fanotify_mark syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined HAVE_SYS_FANOTIFY_H && defined HAVE_FANOTIFY_MARK && \ + defined __NR_fanotify_mark + +# include +# include +# include +# include + +/* Performs fanotify_mark call via the syscall interface. */ +static void +do_call(kernel_ulong_t fd, kernel_ulong_t flags, const char *flags_str, + uint64_t mask, const char *mask_str, kernel_ulong_t dirfd, + const char *dirfd_str, kernel_ulong_t path, const char *path_str) +{ + long rc; + + rc = syscall(__NR_fanotify_mark, fd, flags, +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + mask, +# else +/* arch/parisc/kernel/sys_parisc32.c, commit ab8a261b */ +# ifdef HPPA + LL_VAL_TO_PAIR((mask << 32) | (mask >> 32)), +# else + LL_VAL_TO_PAIR(mask), +# endif +# endif + dirfd, path); + + printf("fanotify_mark(%d, %s, %s, %s, %s) = %s\n", + (int) fd, flags_str, mask_str, dirfd_str, path_str, + sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + +struct strval64 { + uint64_t val; + const char *str; +}; + +#define STR16 "0123456789abcdef" +#define STR64 STR16 STR16 STR16 STR16 + +int +main(void) +{ + enum { + PATH1_SIZE = 64, + }; + + static const kernel_ulong_t fds[] = { + (kernel_ulong_t) 0xdeadfeed12345678ULL, + (kernel_ulong_t) 0xffffffff00000000ULL, + (kernel_ulong_t) 0xdeb0d1edffffffffULL, + }; + static const struct strval flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "0" }, + { (kernel_ulong_t) 0xdec0deddefaced00ULL, + "0xefaced00 /* FAN_MARK_??? */" }, + { (kernel_ulong_t) 0xda7a105700000040ULL, + "FAN_MARK_IGNORED_SURV_MODIFY" }, + { (kernel_ulong_t) 0xbadc0deddeadfeedULL, + "FAN_MARK_ADD|FAN_MARK_DONT_FOLLOW|FAN_MARK_ONLYDIR|" + "FAN_MARK_IGNORED_MASK|FAN_MARK_IGNORED_SURV_MODIFY|" + "FAN_MARK_FLUSH|0xdeadfe00" }, + }; + static const struct strval64 masks[] = { + { ARG_ULL_STR(0) }, + { 0xdeadfeedfacebeefULL, + "FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_OPEN|" + "FAN_ACCESS_PERM|FAN_ONDIR|FAN_EVENT_ON_CHILD|" + "0xdeadfeedb2ccbec4" }, + { ARG_ULL_STR(0xffffffffb7fcbfc4) " /* FAN_??? */" }, + }; + static const struct strval dirfds[] = { + { (kernel_ulong_t) 0xfacefeed00000001ULL, "1" }, + { (kernel_ulong_t) 0xdec0ded0ffffffffULL, "FAN_NOFD" }, + { (kernel_ulong_t) 0xbadfacedffffff9cULL, "AT_FDCWD" }, + { (kernel_ulong_t) 0xdefaced1beeff00dULL, "-1091571699" }, + }; + static const char str64[] = STR64; + + static char bogus_path1_addr[sizeof("0x") + sizeof(void *) * 2]; + static char bogus_path1_after_addr[sizeof("0x") + sizeof(void *) * 2]; + + char *bogus_path1 = tail_memdup(str64, PATH1_SIZE); + char *bogus_path2 = tail_memdup(str64, sizeof(str64)); + + struct strval paths[] = { + { (kernel_ulong_t) 0, "NULL" }, + { (kernel_ulong_t) (uintptr_t) (bogus_path1 + PATH1_SIZE), + bogus_path1_after_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path1, bogus_path1_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path2, "\"" STR64 "\"" }, + }; + + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + unsigned int m; + int rc; + + + snprintf(bogus_path1_addr, sizeof(bogus_path1_addr), "%p", bogus_path1); + snprintf(bogus_path1_after_addr, sizeof(bogus_path1_after_addr), "%p", + bogus_path1 + PATH1_SIZE); + + rc = fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY | FAN_ONDIR, + -100, "."); + printf("fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY|FAN_ONDIR" + ", AT_FDCWD, \".\") = %s\n", sprintrc(rc)); + + for (i = 0; i < ARRAY_SIZE(fds); i++) { + for (j = 0; j < ARRAY_SIZE(flags); j++) { + for (k = 0; k < ARRAY_SIZE(masks); k++) { + for (l = 0; l < ARRAY_SIZE(dirfds); l++) { + for (m = 0; m < ARRAY_SIZE(paths); m++) + do_call(fds[i], + flags[j].val, + flags[j].str, + masks[k].val, + masks[k].str, + dirfds[l].val, + dirfds[l].str, + paths[m].val, + paths[m].str); + } + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_FANOTIFY_H && HAVE_FANOTIFY_MARK && " + "__NR_fanotify_mark") + +#endif diff --git a/tests-m32/fanotify_mark.test b/tests-m32/fanotify_mark.test new file mode 100755 index 00000000..fd671387 --- /dev/null +++ b/tests-m32/fanotify_mark.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fanotify_mark syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-m32/fchdir.c b/tests-m32/fchdir.c new file mode 100644 index 00000000..3cde5e63 --- /dev/null +++ b/tests-m32/fchdir.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_fchdir + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fchdir, fd); + printf("fchdir(%d) = %ld %s (%m)\n", + (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchdir") + +#endif diff --git a/tests-m32/fchdir.test b/tests-m32/fchdir.test new file mode 100755 index 00000000..3a4296ed --- /dev/null +++ b/tests-m32/fchdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-m32/fchmod.c b/tests-m32/fchmod.c new file mode 100644 index 00000000..932d0830 --- /dev/null +++ b/tests-m32/fchmod.c @@ -0,0 +1,72 @@ +/* + * Check decoding of fchmod syscall. + * + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fchmod + +# include +# include +# include +# include + +int +main(void) +{ + static const char fname[] = "fchmod_test_file"; + + int fd = open(fname, O_CREAT|O_RDONLY, 0400); + if (fd < 0) + perror_msg_and_fail("open"); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + long rc = syscall(__NR_fchmod, fd, 0600); + printf("fchmod(%d, 0600) = %s\n", fd, sprintrc(rc)); + + close(fd); + + rc = syscall(__NR_fchmod, fd, 051); + printf("fchmod(%d, 051) = %s\n", fd, sprintrc(rc)); + + rc = syscall(__NR_fchmod, fd, 004); + printf("fchmod(%d, 004) = %s\n", fd, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchmod") + +#endif diff --git a/tests-m32/fchmod.test b/tests-m32/fchmod.test new file mode 100755 index 00000000..4cb12632 --- /dev/null +++ b/tests-m32/fchmod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchmod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/fchmodat.c b/tests-m32/fchmodat.c new file mode 100644 index 00000000..c52a1cab --- /dev/null +++ b/tests-m32/fchmodat.c @@ -0,0 +1,71 @@ +/* + * Check decoding of fchmodat syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fchmodat + +# include +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "fchmodat_sample"; + + if (open(sample, O_RDONLY | O_CREAT, 0400) < 0) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_fchmodat, -100, sample, 0600); + printf("fchmodat(AT_FDCWD, \"%s\", 0600) = %s\n", + sample, sprintrc(rc)); + + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_fchmodat, -100, sample, 051); + printf("fchmodat(AT_FDCWD, \"%s\", 051) = %s\n", + sample, sprintrc(rc)); + + rc = syscall(__NR_fchmodat, -100, sample, 004); + printf("fchmodat(AT_FDCWD, \"%s\", 004) = %s\n", + sample, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchmodat") + +#endif diff --git a/tests-m32/fchmodat.test b/tests-m32/fchmodat.test new file mode 100755 index 00000000..13cbe806 --- /dev/null +++ b/tests-m32/fchmodat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fchmodat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/fchown.c b/tests-m32/fchown.c new file mode 100644 index 00000000..d7119032 --- /dev/null +++ b/tests-m32/fchown.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_fchown + +# define SYSCALL_NR __NR_fchown +# define SYSCALL_NAME "fchown" +# define ACCESS_BY_DESCRIPTOR + +# if defined __NR_fchown32 && __NR_fchown != __NR_fchown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchown") + +#endif diff --git a/tests-m32/fchown.test b/tests-m32/fchown.test new file mode 100755 index 00000000..63a0f2e3 --- /dev/null +++ b/tests-m32/fchown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-m32/fchown32.c b/tests-m32/fchown32.c new file mode 100644 index 00000000..2d9d60f8 --- /dev/null +++ b/tests-m32/fchown32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_fchown32 + +# define SYSCALL_NR __NR_fchown32 +# define SYSCALL_NAME "fchown32" +# define ACCESS_BY_DESCRIPTOR +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchown32") + +#endif diff --git a/tests-m32/fchown32.test b/tests-m32/fchown32.test new file mode 100755 index 00000000..e837f54e --- /dev/null +++ b/tests-m32/fchown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/fchownat.c b/tests-m32/fchownat.c new file mode 100644 index 00000000..f2f37ae3 --- /dev/null +++ b/tests-m32/fchownat.c @@ -0,0 +1,69 @@ +/* + * Check decoding of fchownat syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_fchownat && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW + +# include +# include + +int +main(void) +{ + static const char sample[] = "fchownat_sample"; + uid_t uid = geteuid(); + uid_t gid = getegid(); + + if (open(sample, O_RDONLY | O_CREAT, 0400) == -1) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_fchownat, AT_FDCWD, sample, uid, gid, 0); + printf("fchownat(AT_FDCWD, \"%s\", %d, %d, 0) = %s\n", + sample, uid, gid, sprintrc(rc)); + + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_fchownat, AT_FDCWD, + sample, -1, -1L, AT_SYMLINK_NOFOLLOW); + printf("fchownat(AT_FDCWD, \"%s\", -1, -1, AT_SYMLINK_NOFOLLOW) = %s\n", + sample, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchownat && AT_FDCWD && AT_SYMLINK_NOFOLLOW") + +#endif diff --git a/tests-m32/fchownat.test b/tests-m32/fchownat.test new file mode 100755 index 00000000..e5d0f285 --- /dev/null +++ b/tests-m32/fchownat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fchownat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/fcntl.c b/tests-m32/fcntl.c new file mode 100644 index 00000000..f060cdf8 --- /dev/null +++ b/tests-m32/fcntl.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fcntl + +# define TEST_SYSCALL_NR __NR_fcntl +# define TEST_SYSCALL_STR "fcntl" +# include "struct_flock.c" + +# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +static void +test_flock64_einval(const int cmd, const char *name) +{ + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, &fl, EINVAL_STR); +} + +static void +test_flock64(void) +{ +/* + * F_[GS]ETOWN_EX had conflicting values with F_[GS]ETLK64 + * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. + */ +#if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 + TEST_FLOCK64_EINVAL(F_SETLK64); +#endif +/* F_GETLK and F_SETLKW64 have conflicting values on mips64 */ +#if !defined(__mips64) || F_GETLK != F_SETLKW64 + TEST_FLOCK64_EINVAL(F_SETLKW64); +#endif +#if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 + TEST_FLOCK64_EINVAL(F_GETLK64); +#endif +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fcntl") + +#endif diff --git a/tests-m32/fcntl.test b/tests-m32/fcntl.test new file mode 100755 index 00000000..9aea122d --- /dev/null +++ b/tests-m32/fcntl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fcntl decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-m32/fcntl64.c b/tests-m32/fcntl64.c new file mode 100644 index 00000000..5ecd6eb9 --- /dev/null +++ b/tests-m32/fcntl64.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fcntl64 + +# define TEST_SYSCALL_NR __NR_fcntl64 +# define TEST_SYSCALL_STR "fcntl64" +# include "struct_flock.c" + +# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +static void +test_flock64_einval(const int cmd, const char *name) +{ + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); +} + +static void +test_flock64(void) +{ + TEST_FLOCK64_EINVAL(F_SETLK64); + TEST_FLOCK64_EINVAL(F_SETLKW64); +# ifdef F_OFD_SETLK + TEST_FLOCK64_EINVAL(F_OFD_SETLK); + TEST_FLOCK64_EINVAL(F_OFD_SETLKW); +# endif + + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_len = FILE_LEN + }; + long rc = invoke_test_syscall(F_SETLK64, &fl); + printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + + if (rc) + return; + + invoke_test_syscall(F_GETLK64, &fl); + printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(F_SETLK64, &fl); + printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fcntl64") + +#endif diff --git a/tests-m32/fcntl64.test b/tests-m32/fcntl64.test new file mode 100755 index 00000000..00ba671a --- /dev/null +++ b/tests-m32/fcntl64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fcntl64 syscall decoding. + +. "${srcdir=.}/fcntl.test" diff --git a/tests-m32/fdatasync.c b/tests-m32/fdatasync.c new file mode 100644 index 00000000..fc82ade3 --- /dev/null +++ b/tests-m32/fdatasync.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_fdatasync + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fdatasync, fd); + printf("fdatasync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fdatasync") + +#endif diff --git a/tests-m32/fdatasync.test b/tests-m32/fdatasync.test new file mode 100755 index 00000000..ff59749f --- /dev/null +++ b/tests-m32/fdatasync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fdatasync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/file_handle.c b/tests-m32/file_handle.c new file mode 100644 index 00000000..a5ad6c73 --- /dev/null +++ b/tests-m32/file_handle.c @@ -0,0 +1,356 @@ +/* + * Check decoding of name_to_handle_at and open_by_handle_at syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_name_to_handle_at && defined __NR_open_by_handle_at + +# include +# include +# include +# include +# include +# include +# include + +enum assert_rc { + ASSERT_NONE, + ASSERT_SUCCESS, + ASSERT_ERROR, +}; + +# ifndef MAX_HANDLE_SZ + +# define MAX_HANDLE_SZ 128 + +struct file_handle { + unsigned int handle_bytes; + int handle_type; + unsigned char f_handle[0]; +}; +# endif /* !MAX_HANDLE_SZ */ + + +void +print_handle_data(unsigned char *bytes, unsigned int size) +{ + unsigned int i; + + if (size > MAX_HANDLE_SZ) + size = MAX_HANDLE_SZ; + + printf("0x"); + for (i = 0; i < size; ++i) + printf("%02x", bytes[i]); +} + +void +do_name_to_handle_at(kernel_ulong_t dirfd, const char *dirfd_str, + kernel_ulong_t pathname, const char *pathname_str, + kernel_ulong_t handle, const char *handle_str, + kernel_ulong_t mount_id, + kernel_ulong_t flags, const char *flags_str, + enum assert_rc assert_rc, long assert_errno) +{ + long rc; + const char *errstr; + + rc = syscall(__NR_name_to_handle_at, dirfd, pathname, handle, mount_id, + flags); + errstr = sprintrc(rc); + + if (assert_rc != ASSERT_NONE) + assert(rc == (assert_rc == ASSERT_SUCCESS ? 0 : -1)); + if (assert_errno) + assert(errno != assert_errno); + + printf("name_to_handle_at(%s, %s, %s", + dirfd_str, pathname_str, handle_str); + + if (rc != -1) { + struct file_handle *fh = + (struct file_handle *) (uintptr_t) handle; + int *mount_id_ptr = (int *) (uintptr_t) mount_id; + + printf(" => %u, handle_type=%d, f_handle=", + fh->handle_bytes, fh->handle_type); + print_handle_data((unsigned char *) fh + + sizeof(struct file_handle), + fh->handle_bytes); + printf("}, [%d]", *mount_id_ptr); + } else { + if (mount_id) + printf(", %#llx", (unsigned long long) mount_id); + else + printf(", NULL"); + } + + printf(", %s) = %s\n", flags_str, errstr); +} + +void +do_open_by_handle_at(kernel_ulong_t mount_fd, + kernel_ulong_t handle, bool valid_handle, bool valid_data, + kernel_ulong_t flags, const char *flags_str) +{ + long rc; + + printf("open_by_handle_at(%d, ", (int) mount_fd); + if (valid_handle) { + struct file_handle *fh = + (struct file_handle *) (uintptr_t) handle; + + printf("{handle_bytes=%u, handle_type=%d", fh->handle_bytes, + fh->handle_type); + + if (valid_data) { + printf(", f_handle="); + print_handle_data((unsigned char *) fh + + sizeof(struct file_handle), + fh->handle_bytes); + } + + printf("}"); + } else { + if (handle) + printf("%#llx", (unsigned long long) handle); + else + printf("NULL"); + } + printf(", %s) = ", flags_str); + + rc = syscall(__NR_open_by_handle_at, mount_fd, handle, flags); + + printf("%s\n", sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + +#define STR16 "0123456789abcdef" +#define STR64 STR16 STR16 STR16 STR16 + +int +main(void) +{ + enum { + PATH1_SIZE = 64, + }; + + static const kernel_ulong_t fdcwd = + (kernel_ulong_t) 0x87654321ffffff9cULL; + static const struct strval dirfds[] = { + { (kernel_ulong_t) 0xdeadca57badda7a1ULL, "-1159878751" }, + { (kernel_ulong_t) 0x12345678ffffff9cULL, "AT_FDCWD" }, + }; + static const struct strval name_flags[] = { + { (kernel_ulong_t) 0xdeadf15700000000ULL, "0" }, + { (kernel_ulong_t) 0xbadc0ded00001000ULL, + "AT_EMPTY_PATH" }, + { (kernel_ulong_t) 0xdeadc0deda7a1457ULL, + "AT_SYMLINK_FOLLOW|AT_EMPTY_PATH|0xda7a0057" }, + { (kernel_ulong_t) 0xdefaced1ffffebffULL, + "0xffffebff /* AT_??? */" }, + }; + static const kernel_ulong_t mount_fds[] = { + (kernel_ulong_t) 0xdeadca5701234567ULL, + (kernel_ulong_t) 0x12345678ffffff9cULL, + }; + static const struct strval open_flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { (kernel_ulong_t) 0xdeadbeef80000001ULL, + "O_WRONLY|0x80000000" } + }; + + static const char str64[] = STR64; + + + char *bogus_path1 = tail_memdup(str64, PATH1_SIZE); + char *bogus_path2 = tail_memdup(str64, sizeof(str64)); + + struct file_handle *handle = + tail_alloc(sizeof(struct file_handle) + MAX_HANDLE_SZ); + struct file_handle *handle_0 = + tail_alloc(sizeof(struct file_handle) + 0); + struct file_handle *handle_8 = + tail_alloc(sizeof(struct file_handle) + 8); + struct file_handle *handle_128 = + tail_alloc(sizeof(struct file_handle) + 128); + struct file_handle *handle_256 = + tail_alloc(sizeof(struct file_handle) + 256); + int *bogus_mount_id = tail_alloc(sizeof(*bogus_mount_id)); + + char handle_0_addr[sizeof("0x") + sizeof(void *) * 2]; + + char bogus_path1_addr[sizeof("0x") + sizeof(void *) * 2]; + char bogus_path1_after_addr[sizeof("0x") + sizeof(void *) * 2]; + + + struct strval paths[] = { + { (kernel_ulong_t) 0, "NULL" }, + { (kernel_ulong_t) (uintptr_t) (bogus_path1 + PATH1_SIZE), + bogus_path1_after_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path1, bogus_path1_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path2, "\"" STR64 "\"" }, + }; + struct strval name_handles[] = { + { (uintptr_t) (handle_0 + sizeof(struct file_handle)), + handle_0_addr }, + { (uintptr_t) handle_0, "{handle_bytes=256}" }, + { (uintptr_t) handle_8, "{handle_bytes=0}" }, + { (uintptr_t) handle_128, "{handle_bytes=128}" }, + { (uintptr_t) handle_256, "{handle_bytes=256}" }, + }; + struct { + kernel_ulong_t addr; + bool valid; + bool valid_data; + } open_handles[] = { + { 0, false, false }, + { (uintptr_t) (handle_0 + sizeof(struct file_handle)), + false, false }, + { (uintptr_t) handle_0 + 4, false, false }, + { (uintptr_t) handle_0, true, false }, + { (uintptr_t) handle_8, true, true }, + { (uintptr_t) handle_128, true, true }, + { (uintptr_t) handle_256, true, true }, + }; + kernel_ulong_t mount_ids[] = { + 0, + (kernel_ulong_t) (uintptr_t) (bogus_mount_id + 1), + (kernel_ulong_t) (uintptr_t) bogus_mount_id, + }; + + const int flags = 0x400; + int mount_id; + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + unsigned int m; + + + snprintf(bogus_path1_addr, sizeof(bogus_path1_addr), "%p", bogus_path1); + snprintf(bogus_path1_after_addr, sizeof(bogus_path1_after_addr), "%p", + bogus_path1 + PATH1_SIZE); + + handle_0->handle_bytes = 256; + handle_8->handle_bytes = 0; + handle_128->handle_bytes = 128; + handle_256->handle_bytes = 256; + + fill_memory((char *) handle_128 + sizeof(struct file_handle), 128); + fill_memory((char *) handle_256 + sizeof(struct file_handle), 256); + + snprintf(handle_0_addr, sizeof(handle_0_addr), "%p", + handle_0 + sizeof(struct file_handle)); + + handle->handle_bytes = 0; + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags | 1) == -1); + if (EINVAL != errno) + perror_msg_and_skip("name_to_handle_at"); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=0}, %p" + ", AT_SYMLINK_FOLLOW|0x1) = -1 EINVAL (%m)\n", &mount_id); + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags) == -1); + if (EOVERFLOW != errno) + perror_msg_and_skip("name_to_handle_at"); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=0 => %u}" + ", %p, AT_SYMLINK_FOLLOW) = -1 EOVERFLOW (%m)\n", + handle->handle_bytes, &mount_id); + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags) == 0); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=%u" + ", handle_type=%d, f_handle=0x", + handle->handle_bytes, handle->handle_type); + for (i = 0; i < handle->handle_bytes; ++i) + printf("%02x", handle->f_handle[i]); + printf("}, [%d], AT_SYMLINK_FOLLOW) = 0\n", mount_id); + + printf("open_by_handle_at(-1, {handle_bytes=%u, handle_type=%d" + ", f_handle=0x", handle->handle_bytes, handle->handle_type); + for (i = 0; i < handle->handle_bytes; ++i) + printf("%02x", handle->f_handle[i]); + int rc = syscall(__NR_open_by_handle_at, -1, handle, + O_RDONLY | O_DIRECTORY); + printf("}, O_RDONLY|O_DIRECTORY) = %d %s (%m)\n", rc, errno2name()); + + for (i = 0; i < ARRAY_SIZE(dirfds); i++) { + for (j = 0; j < ARRAY_SIZE(paths); j++) { + for (k = 0; k < ARRAY_SIZE(name_handles); k++) { + for (l = 0; l < ARRAY_SIZE(mount_ids); l++) { + for (m = 0; m < ARRAY_SIZE(name_flags); + m++) { + do_name_to_handle_at( + dirfds[i].val, + dirfds[i].str, + paths[j].val, + paths[j].str, + name_handles[k].val, + name_handles[k].str, + mount_ids[l], + name_flags[m].val, + name_flags[m].str, + ASSERT_ERROR, 0); + } + } + } + } + } + + for (i = 0; i < ARRAY_SIZE(mount_fds); i++) { + for (j = 0; j < ARRAY_SIZE(open_handles); j++) { + for (k = 0; k < ARRAY_SIZE(open_flags); k++) { + do_open_by_handle_at(mount_fds[i], + open_handles[j].addr, + open_handles[j].valid, + open_handles[j].valid_data, + open_flags[k].val, + open_flags[k].str); + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_name_to_handle_at && __NR_open_by_handle_at") + +#endif diff --git a/tests-m32/file_handle.test b/tests-m32/file_handle.test new file mode 100755 index 00000000..1ccc9d45 --- /dev/null +++ b/tests-m32/file_handle.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check name_to_handle_at and open_by_handle_at syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests-m32/file_ioctl.c b/tests-m32/file_ioctl.c new file mode 100644 index 00000000..0fe17b15 --- /dev/null +++ b/tests-m32/file_ioctl.c @@ -0,0 +1,45 @@ +#include "tests.h" + +#ifdef HAVE_LINUX_FIEMAP_H + +# include +# include +# include +# include +# include "xlat.h" +# include "xlat/fiemap_flags.h" + +static void +test_fiemap(void) +{ + (void) tail_alloc(1); + struct fiemap *const args = tail_alloc(sizeof(*args)); + + printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64", fm_flags=", + args->fm_start, args->fm_length); + printflags(fiemap_flags, args->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_extent_count=%u})", args->fm_extent_count); + ioctl(-1, FS_IOC_FIEMAP, args); + printf(" = -1 EBADF (%m)\n"); + + /* The live version of this test is in btrfs.c */ +} + +/* clone and dedupe ioctls are in btrfs.c since they originated there */ + +int +main(int argc, char *argv[]) +{ + test_fiemap(); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_FIEMAP_H") + +#endif diff --git a/tests-m32/file_ioctl.test b/tests-m32/file_ioctl.test new file mode 100755 index 00000000..7b8b8ce8 --- /dev/null +++ b/tests-m32/file_ioctl.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check FS_IOC_FIEMAP ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/fill_memory.c b/tests-m32/fill_memory.c new file mode 100644 index 00000000..a0aeccba --- /dev/null +++ b/tests-m32/fill_memory.c @@ -0,0 +1,19 @@ +#include "tests.h" + +void +fill_memory_ex(void *ptr, size_t size, unsigned char start, + unsigned char period) +{ + unsigned char *p = ptr; + size_t i; + + for (i = 0; i < size; i++) { + p[i] = start + i % period; + } +} + +void +fill_memory(void *ptr, size_t size) +{ + fill_memory_ex(ptr, size, 0x80, 0x80); +} diff --git a/tests-m32/filter-unavailable.c b/tests-m32/filter-unavailable.c new file mode 100644 index 00000000..6368b2cb --- /dev/null +++ b/tests-m32/filter-unavailable.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#define P 16 +#define T 7 + +static void * +thread(void *arg) +{ + assert(write(1, "", 1) == 1); + pause(); + return arg; +} + +static int +process(void) +{ + int i; + int fds[2]; + pthread_t t; + struct timespec ts = { .tv_nsec = 10000000 }; + + (void) close(0); + (void) close(1); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + for (i = 0; i < T; ++i) + assert(pthread_create(&t, NULL, thread, NULL) == 0); + for (i = 0; i < T; ++i) + assert(read(0, fds, 1) == 1); + + (void) nanosleep(&ts, 0); + return 0; +} + +int +main(void) +{ + int i, s; + pid_t p; + + for (i = 0; i < P; ++i) { + p = fork(); + if (p < 0) + perror_msg_and_fail("fork"); + if (p == 0) + return process(); + assert(waitpid(p, &s, 0) == p); + assert(WIFEXITED(s)); + if (WEXITSTATUS(s)) + return WEXITSTATUS(s); + } + return 0; +} diff --git a/tests-m32/filter-unavailable.expected b/tests-m32/filter-unavailable.expected new file mode 100644 index 00000000..e69de29b diff --git a/tests-m32/filter-unavailable.test b/tests-m32/filter-unavailable.test new file mode 100755 index 00000000..15a9ad1d --- /dev/null +++ b/tests-m32/filter-unavailable.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# check that syscalls are filtered properly + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -qq -f -echdir -esignal=none $args +match_diff + +exit 0 diff --git a/tests-m32/finit_module.c b/tests-m32/finit_module.c new file mode 100644 index 00000000..3f0178f7 --- /dev/null +++ b/tests-m32/finit_module.c @@ -0,0 +1,118 @@ +/* + * Check decoding of finit_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include "scno.h" + +#if defined(__NR_finit_module) + +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xdeb0d1edbeeff00dULL; + + static const struct { + kernel_ulong_t val; + const char *str; + } flags[] = { + { ARG_STR(0) }, + { (kernel_ulong_t) 0xffffffff00000002ULL, + "MODULE_INIT_IGNORE_VERMAGIC" }, + { (kernel_ulong_t) 0xbadc0deddefaced0ULL, + "0xdefaced0 /* MODULE_INIT_??? */" }, + { (kernel_ulong_t) 0xfacef157dec0ded1ULL, + "MODULE_INIT_IGNORE_MODVERSIONS|0xdec0ded0" }, + { -1LL, "MODULE_INIT_IGNORE_MODVERSIONS|" + "MODULE_INIT_IGNORE_VERMAGIC|0xfffffffc" }, + }; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_finit_module, bogus_zero, NULL, bogus_zero); + printf("finit_module(0, NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[0].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"..., %s) = %s\n", flags[0].str, errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[1].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\", %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2 + PARAM2_LEN, + flags[2].val); + printf("finit_module(%d, %p, %s) = %s\n", + (int) bogus_fd, bogus_param2 + PARAM2_LEN, flags[2].str, + sprintrc(rc)); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2, flags[3].val); + printf("finit_module(%d, %p, %s) = %s\n", + (int) bogus_fd, bogus_param2, flags[3].str, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2, flags[4].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\", %s) = %s\n", flags[4].str, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_finit_module"); + +#endif diff --git a/tests-m32/finit_module.test b/tests-m32/finit_module.test new file mode 100755 index 00000000..bd644f38 --- /dev/null +++ b/tests-m32/finit_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of finit_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/flock.c b/tests-m32/flock.c new file mode 100644 index 00000000..c154e437 --- /dev/null +++ b/tests-m32/flock.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_flock + +# include +# include +# include + +int +main(void) +{ + const unsigned long fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_flock, fd, LOCK_SH); + printf("flock(%d, LOCK_SH) = %ld %s (%m)\n", + (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_flock") + +#endif diff --git a/tests-m32/flock.test b/tests-m32/flock.test new file mode 100755 index 00000000..24fcd74c --- /dev/null +++ b/tests-m32/flock.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check flock syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/fork-f.c b/tests-m32/fork-f.c new file mode 100644 index 00000000..11ac3d97 --- /dev/null +++ b/tests-m32/fork-f.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static inline int +logit_(const char *const str) +{ + return !chdir(str); +} + +#define prefix "fork-f." +#define logit(arg) logit_(prefix arg) + +int main(int ac, char **av) +{ + if (ac < 1) + return 1; + if (ac > 1) + return logit("exec"); + + logit("start"); + + int child_wait_fds[2]; + (void) close(0); + if (pipe(child_wait_fds)) + perror_msg_and_fail("pipe"); + + pid_t pid = fork(); + + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + close(child_wait_fds[1]); + + if (read(0, child_wait_fds, sizeof(int))) + _exit(2); + + char *const args[] = { av[0], (char *) "", NULL }; + if (logit("child") || execve(args[0], args, args + 1)) + _exit(2); + } + + close(0); + + logit("parent"); + close(child_wait_fds[1]); + + int status; + assert(wait(&status) == pid); + assert(status == 0); + + pid_t ppid = getpid(); + logit("finish"); + + printf("%-5d chdir(\"%sstart\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sparent\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%schild\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sexec\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sfinish\") = -1 ENOENT (%m)\n", + ppid, prefix, + ppid, prefix, + pid, prefix, + pid, prefix, + ppid, prefix); + return 0; +} diff --git a/tests-m32/fork-f.test b/tests-m32/fork-f.test new file mode 100755 index 00000000..d8ca1e3b --- /dev/null +++ b/tests-m32/fork-f.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check how strace -f follows fork syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e trace=chdir -e signal=none diff --git a/tests-m32/fstat.c b/tests-m32/fstat.c new file mode 100644 index 00000000..12df3e19 --- /dev/null +++ b/tests-m32/fstat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstat + +# define TEST_SYSCALL_NR __NR_fstat +# define TEST_SYSCALL_STR "fstat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstat") + +#endif diff --git a/tests-m32/fstat.test b/tests-m32/fstat.test new file mode 100755 index 00000000..2ba0fbaa --- /dev/null +++ b/tests-m32/fstat.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check fstat syscall decoding. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +syscall=$NAME +run_prog > /dev/null +sample=$syscall.sample +> "$sample" +run_strace -ve$syscall -P$sample -a21 $args > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/fstat64.c b/tests-m32/fstat64.c new file mode 100644 index 00000000..a9c2e072 --- /dev/null +++ b/tests-m32/fstat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstat64 + +# define TEST_SYSCALL_NR __NR_fstat64 +# define TEST_SYSCALL_STR "fstat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstat64") + +#endif diff --git a/tests-m32/fstat64.test b/tests-m32/fstat64.test new file mode 100755 index 00000000..8b4f5ef1 --- /dev/null +++ b/tests-m32/fstat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstat64 syscall decoding. + +. "${srcdir=.}/fstat.test" diff --git a/tests-m32/fstatat.c b/tests-m32/fstatat.c new file mode 100644 index 00000000..66138c25 --- /dev/null +++ b/tests-m32/fstatat.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_FSTATAT + +# define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, AT_FDCWD, sample, pst, AT_SYMLINK_NOFOLLOW) +# define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(AT_FDCWD, \"%s\", ", TEST_SYSCALL_STR, sample) +# define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(", AT_SYMLINK_NOFOLLOW) = %s\n", sprintrc(rc)); \ + } while (0) + +# include "xstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("HAVE_FSTATAT") + +#endif diff --git a/tests-m32/fstatat64.c b/tests-m32/fstatat64.c new file mode 100644 index 00000000..03082a8f --- /dev/null +++ b/tests-m32/fstatat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatat64 + +# define TEST_SYSCALL_NR __NR_fstatat64 +# define TEST_SYSCALL_STR "fstatat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "fstatat.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatat64") + +#endif diff --git a/tests-m32/fstatat64.test b/tests-m32/fstatat64.test new file mode 100755 index 00000000..484008ac --- /dev/null +++ b/tests-m32/fstatat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/fstatfs.c b/tests-m32/fstatfs.c new file mode 100644 index 00000000..9e68c8d3 --- /dev/null +++ b/tests-m32/fstatfs.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatfs + +# define SYSCALL_ARG_FMT "%d" +# define SYSCALL_ARG(file, desc) (desc) +# define SYSCALL_NR __NR_fstatfs +# define SYSCALL_NAME "fstatfs" +# include "xstatfs.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatfs") + +#endif diff --git a/tests-m32/fstatfs.test b/tests-m32/fstatfs.test new file mode 100755 index 00000000..646e66f2 --- /dev/null +++ b/tests-m32/fstatfs.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatfs syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests-m32/fstatfs64.c b/tests-m32/fstatfs64.c new file mode 100644 index 00000000..afc54aa9 --- /dev/null +++ b/tests-m32/fstatfs64.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatfs64 + +# define SYSCALL_ARG_FMT "%d" +# define SYSCALL_ARG(file, desc) (desc) +# define SYSCALL_NR __NR_fstatfs64 +# define SYSCALL_NAME "fstatfs64" +# include "xstatfs64.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatfs64") + +#endif diff --git a/tests-m32/fstatfs64.test b/tests-m32/fstatfs64.test new file mode 100755 index 00000000..179ff1bf --- /dev/null +++ b/tests-m32/fstatfs64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatfs64 syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests-m32/fstatx.c b/tests-m32/fstatx.c new file mode 100644 index 00000000..f88d9a9c --- /dev/null +++ b/tests-m32/fstatx.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define IS_FSTAT 1 +#define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, 0, pst) +#define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(0, ", TEST_SYSCALL_STR) +#define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +#include "xstatx.c" diff --git a/tests-m32/fsync.c b/tests-m32/fsync.c new file mode 100644 index 00000000..2f504106 --- /dev/null +++ b/tests-m32/fsync.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_fsync + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fsync, fd); + printf("fsync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fsync") + +#endif diff --git a/tests-m32/fsync.test b/tests-m32/fsync.test new file mode 100755 index 00000000..a58b67be --- /dev/null +++ b/tests-m32/fsync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fsync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/ftruncate.c b/tests-m32/ftruncate.c new file mode 100644 index 00000000..ee17455f --- /dev/null +++ b/tests-m32/ftruncate.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ftruncate + +# include +# include + +int +main(void) +{ + const kernel_ulong_t len = (kernel_ulong_t) 0xdefaced0badc0deULL; + long rc; + + if (sizeof(len) > sizeof(long)) + rc = ftruncate(-1, len); + else + rc = syscall(__NR_ftruncate, -1L, len); + + printf("ftruncate(-1, %llu) = %ld %s (%m)\n", + (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ftruncate") + +#endif diff --git a/tests-m32/ftruncate.test b/tests-m32/ftruncate.test new file mode 100755 index 00000000..ec8a1e05 --- /dev/null +++ b/tests-m32/ftruncate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ftruncate syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/ftruncate64.c b/tests-m32/ftruncate64.c new file mode 100644 index 00000000..90d9938f --- /dev/null +++ b/tests-m32/ftruncate64.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ftruncate64 + +# include +# include + +int +main(void) +{ + const off_t len = 0xdefaceddeadbeefULL; + + int rc = ftruncate(-1, len); + printf("ftruncate64(-1, %llu) = %d %s (%m)\n", + (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ftruncate64") + +#endif diff --git a/tests-m32/ftruncate64.test b/tests-m32/ftruncate64.test new file mode 100755 index 00000000..90682102 --- /dev/null +++ b/tests-m32/ftruncate64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ftruncate64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/futex.c b/tests-m32/futex.c new file mode 100644 index 00000000..586b95d5 --- /dev/null +++ b/tests-m32/futex.c @@ -0,0 +1,720 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_futex + +# include +# include +# include +# include +# include +# include + +# include + +# ifndef FUTEX_PRIVATE_FLAG +# define FUTEX_PRIVATE_FLAG 128 +# endif +# ifndef FUTEX_CLOCK_REALTIME +# define FUTEX_CLOCK_REALTIME 256 +# endif +# ifndef FUTEX_CMD_MASK +# define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME) +# endif + +# include "xlat.h" +# include "xlat/futexops.h" +# include "xlat/futexwakeops.h" +# include "xlat/futexwakecmps.h" + +static struct timespec *tmout; + +void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, + int *uaddr2, unsigned long val3, int rc) +{ + perror_msg_and_fail("futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", + uaddr, op, (unsigned) val, timeout, uaddr, (unsigned) val3, rc); +} + +# define CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, \ + enosys) \ + do { \ + rc = syscall(__NR_futex, (uaddr), (op), (val), (timeout), \ + (uaddr2), (val3)); \ + /* It is here due to EPERM on WAKE_OP on AArch64 */ \ + if ((rc == -1) && (errno == EPERM)) \ + break; \ + if (enosys && (rc == -1) && (errno == ENOSYS)) \ + break; \ + if (!(check)) \ + futex_error((uaddr), (op), (val), \ + (unsigned long) (timeout), (int *) (uaddr2), \ + (val3), rc); \ + } while (0) + +# define CHECK_FUTEX_ENOSYS(uaddr, op, val, timeout, uaddr2, val3, check) \ + CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, 1) + +# define CHECK_FUTEX(uaddr, op, val, timeout, uaddr2, val3, check) \ + CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, 0) + +enum argmask { + ARG3 = 1 << 0, + ARG4 = 1 << 1, + ARG5 = 1 << 2, + ARG6 = 1 << 3, +}; + +void invalid_op(int *val, int op, uint32_t argmask, ...) +{ + static const unsigned long args[] = { + (unsigned long) 0xface1e55deadbee1ULL, + (unsigned long) 0xface1e56deadbee2ULL, + (unsigned long) 0xface1e57deadbee3ULL, + (unsigned long) 0xface1e58deadbee4ULL, + }; + /* Since timeout value is copied before full op check, we should provide + * some valid timeout address or NULL */ + int cmd = op & FUTEX_CMD_MASK; + bool valid_timeout = (cmd == FUTEX_WAIT) || (cmd == FUTEX_LOCK_PI) || + (cmd == FUTEX_WAIT_BITSET) || (cmd == FUTEX_WAIT_REQUEUE_PI); + bool timeout_is_val2 = (cmd == FUTEX_REQUEUE) || + (cmd == FUTEX_CMP_REQUEUE) || (cmd == FUTEX_WAKE_OP) || + (cmd == FUTEX_CMP_REQUEUE_PI); + const char *fmt; + int saved_errno; + int rc; + int i; + va_list ap; + + + CHECK_FUTEX(val, op, args[0], valid_timeout ? 0 : args[1], args[2], + args[3], (rc == -1) && (errno == ENOSYS)); + saved_errno = errno; + printf("futex(%p, %#x /* FUTEX_??? */", val, op); + + va_start(ap, argmask); + + for (i = 0; i < 4; i++) { + if (argmask & (1 << i)) { + fmt = va_arg(ap, const char *); + + printf(", "); + + if (((1 << i) == ARG3) || ((1 << i) == ARG6) || + (((1 << i) == ARG4) && timeout_is_val2)) + printf(fmt, (unsigned) args[i]); + else + printf(fmt, args[i]); + } + } + + va_end(ap); + + errno = saved_errno; + printf(") = -1 ENOSYS (%m)\n"); +} + +# define CHECK_INVALID_CLOCKRT(op, ...) \ + do { \ + invalid_op(uaddr, FUTEX_CLOCK_REALTIME | (op), __VA_ARGS__); \ + invalid_op(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | \ + (op), __VA_ARGS__); \ + } while (0) + +/* Value which differs from one stored in int *val */ +# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) +# define VAL_PR ((unsigned) VAL) + +# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) +# define VAL2_PR ((unsigned) VAL2) + +# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) +# define VAL3_PR ((unsigned) VAL3) + +int +main(int argc, char *argv[]) +{ + int *uaddr = tail_alloc(sizeof(*uaddr)); + int *uaddr2 = tail_alloc(sizeof(*uaddr2)); + int rc; + unsigned i; + unsigned j; + + uaddr[0] = 0x1deadead; + uaddr2[0] = 0xbadf00d; + + tmout = tail_alloc(sizeof(*tmout)); + tmout->tv_sec = 123; + tmout->tv_nsec = 0xbadc0de; + + /* FUTEX_WAIT - check whether uaddr == val and sleep + * Possible flags: PRIVATE, CLOCK_RT (since 4.5) + * 1. uaddr - futex address + * 2. op - FUTEX_WAIT + * 3. val - expected value + * 4. timeout - address to timespec with timeout + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* uaddr is NULL */ + CHECK_FUTEX(NULL, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + VAL_PR, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* uaddr is faulty */ + CHECK_FUTEX(uaddr + 1, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr + 1, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* timeout is faulty */ + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout + 1, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_WAIT, %u, %p) = %s\n", + uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + + /* uaddr is not as provided; uaddr2 is faulty but ignored */ + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* uaddr is not as provided; uaddr2 is faulty but ignored */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, + uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* Next 2 tests are with CLOCKRT bit set */ + + /* Valid after v4.4-rc2-27-g337f130 */ + CHECK_FUTEX_ENOSYS(uaddr, + FUTEX_CLOCK_REALTIME | FUTEX_WAIT, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, + FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT , + VAL, tmout, uaddr2, 0, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* FUTEX_WAIT_BITSET - FUTEX_WAIT which provides additional bitmask + * which should be matched at least in one bit with + * wake mask in order to wake. + * Possible flags: PRIVATE, CLOCKRT + * 1. uaddr - futex address + * 2. op - FUTEX_TRYLOCK_PI + * 3. val - expected value stored in uaddr + * 4. timeout - timeout + * 5. uaddr2 - not used + * 6. val3 - bitmask + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " + "%#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + + /* val3 of 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " + "%#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, 0, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + + /* Next 3 tests are with CLOCKRT bit set */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, + sprintrc(rc)); + + /* val3 of 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, 0, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | + FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, + sprintrc(rc)); + + /* FUTEX_WAKE - wake val processes waiting for uaddr + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE + * 3. val - how many processes to wake + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* Zero processes to wake is not a good idea, but it should return 0 */ + CHECK_FUTEX(uaddr, FUTEX_WAKE, 0, NULL, NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE, %u) = %s\n", uaddr, 0, sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX(uaddr, FUTEX_WAKE, 10, NULL, NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE, %u) = %s\n", uaddr, 10, sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAKE, 10, NULL, + NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_PRIVATE, %u) = %s\n", uaddr, 10, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE, ARG3, "%u"); + + /* FUTEX_WAKE_BITSET - wake val processes waiting for uaddr which has at + * least one common bit with bitset provided in + * val3. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE + * 3. val - how many processes to wake + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - bitmask + */ + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, + VAL3, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, + VAL3_PR, sprintrc(rc)); + + /* bitset 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, 0, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, 0, + sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAKE_BITSET, 10, + NULL, NULL, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET_PRIVATE, %u, %#x) = %s\n", uaddr, + 10, VAL3_PR, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE_BITSET, ARG3 | ARG6, "%u", "%#x"); + + /* FUTEX_FD - deprecated + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_FD + * 3. val - signal number + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* FUTEX_FD is not implemented since 2.6.26 */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_FD, VAL, NULL, NULL, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_FD, %u) = %s\n", uaddr, VAL_PR, sprintrc(rc)); + + /* FUTEX_FD is not implemented since 2.6.26 */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_FD, VAL, NULL, + NULL, VAL3, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_FD|FUTEX_PRIVATE_FLAG, %u) = %s\n", uaddr, + VAL_PR, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_FD, ARG3, "%u"); + + /* FUTEX_REQUEUE - wake val processes and re-queue rest on uaddr2 + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - another futex address, to re-queue waiting processes on + * 6. val3 - not used + */ + + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3, + (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2, + uaddr2, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u", + "%#lx"); + + /* FUTEX_CMP_REQUEUE - wake val processes and re-queue rest on uaddr2 + * if uaddr has value val3 + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_CMP_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - another futex address, to re-queue waiting processes on + * 6. val3 - expected value stored in uaddr + */ + + /* Comparison re-queue with wrong val value */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + + /* Successful comparison re-queue */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr, + (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + /* Successful comparison re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL, + VAL2, uaddr2, *uaddr, (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", "%u"); + + /* FUTEX_WAKE_OP - wake val processes waiting for uaddr, additionally + * wake val2 processes waiting for uaddr2 in case + * operation encoded in val3 (change of value at uaddr2 + * and comparison of previous value against provided + * constant) succeedes with value at uaddr2. Operation + * result is written to value of uaddr2 (in any case). + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE_OP + * 3. val - how many processes to wake + * 4. val2 - amount of processes to wake in case operation encoded in + * val3 returns true + * 5. uaddr2 - another futex address, for conditional wake of + * additional processes + * 6. val3 - encoded operation: + * 1. bit 31 - if 1 then value stored in field field 4 + * should be interpreted as power of 2. + * 2. 28..30 - arithmetic operation which should be + * applied to previous value stored in + * uaddr2. Values available (from 2005 up to + * 2016): SET. ADD, OR, ANDN, XOR. + * 3. 24..29 - comparison operation which should be + * applied to the old value stored in uaddr2 + * (before arithmetic operation is applied). + * Possible values: EQ, NE, LT, LE, GT, GE. + * 4. 12..23 - Second operand for arithmetic operation. + * If bit 31 is set, it is interpreted as + * power of 2. + * 5. 00..11 - Value against which old value stored in + * uaddr2 is compared. + */ + + static const struct { + uint32_t val; + const char *str; + int err; + const char *errstr; + } wake_ops[] = { + { 0x00000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x00fff000, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" + "0" }, + { 0x00000fff, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|" + "0xfff" }, + { 0x00ffffff, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" + "0xfff" }, + { 0x10000000, "FUTEX_OP_ADD<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x20000000, "FUTEX_OP_OR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x30000000, "FUTEX_OP_ANDN<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x40000000, "FUTEX_OP_XOR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x50000000, "0x5<<28 /* FUTEX_OP_??? */|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + { 0x70000000, "0x7<<28 /* FUTEX_OP_??? */|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + { 0x80000000, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_SET<<28|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0" }, + { 0xa0caffee, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_OR<<28|" + "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee" }, + { 0x01000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_NE<<24|0" }, + { 0x01234567, "FUTEX_OP_SET<<28|0x234<<12|FUTEX_OP_CMP_NE<<24|" + "0x567" }, + { 0x02000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_LT<<24|0" }, + { 0x03000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_LE<<24|0" }, + { 0x04000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GT<<24|0" }, + { 0x05000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GE<<24|0" }, + { 0x06000000, "FUTEX_OP_SET<<28|0<<12|" + "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x07000000, "FUTEX_OP_SET<<28|0<<12|" + "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x08000000, "FUTEX_OP_SET<<28|0<<12|" + "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x0f000000, "FUTEX_OP_SET<<28|0<<12|" + "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0xbadfaced, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_ANDN<<28|" + "0xdfa<<12|0xa<<24 /* FUTEX_OP_CMP_??? */|0xced", + ENOSYS, "ENOSYS" }, + { 0xffffffff, "FUTEX_OP_OPARG_SHIFT<<28|" + "0x7<<28 /* FUTEX_OP_??? */|0xfff<<12|" + "0xf<<24 /* FUTEX_OP_CMP_??? */|0xfff", + ENOSYS, "ENOSYS" }, + }; + + for (i = 0; i < ARRAY_SIZE(wake_ops); i++) { + for (j = 0; j < 2; j++) { + CHECK_FUTEX_ENOSYS(uaddr, + j ? FUTEX_WAKE_OP_PRIVATE : FUTEX_WAKE_OP, + VAL, i, uaddr2, wake_ops[i].val, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s) = " + "%s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, i, + uaddr2, wake_ops[i].str, sprintrc(rc)); + } + } + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE_OP, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", + /* Decoding of the 0xdeadbee4 value */ + "FUTEX_OP_OPARG_SHIFT<<28|0x5<<28 /* FUTEX_OP_??? */|0xadb<<12|" + "0xe<<24 /* FUTEX_OP_CMP_??? */|0xee4"); + + /* FUTEX_LOCK_PI - slow path for mutex lock with process inheritance + * support. Expect that futex has 0 in unlocked case and + * TID of owning process in locked case. Value can also + * contain FUTEX_WAITERS bit signalling the presence of + * waiters queue. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_LOCK_PI + * 3. val - not used + * 4. timeout - timeout + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + *uaddr = getpid(); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_LOCK_PI, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* NULL is passed by invalid_op() in cases valid timeout address is + * needed */ + CHECK_INVALID_CLOCKRT(FUTEX_LOCK_PI, ARG4, "NULL"); + + /* FUTEX_UNLOCK_PI - slow path for mutex unlock with process inheritance + * support. Expected to be called by process in case + * it failed to execute fast path (it usually means + * that FUTEX_WAITERS flag had been set while the lock + * has been held). + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_UNLOCK_PI + * 3. val - not used + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_UNLOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_UNLOCK_PI) = %s\n", uaddr + 1, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_UNLOCK_PI, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr +1, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_UNLOCK_PI, 0); + + /* FUTEX_TRYLOCK_PI - slow path for mutex trylock with process + * inheritance support. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_TRYLOCK_PI + * 3. val - not used + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_TRYLOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_TRYLOCK_PI) = %s\n", uaddr + 1, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_TRYLOCK_PI, + VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_TRYLOCK_PI_PRIVATE) = %s\n", uaddr + 1, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_TRYLOCK_PI, 0); + + /* FUTEX_WAIT_REQUEUE_PI - kernel-side handling of special case when + * processes should be re-queued on PI-aware + * futexes. This is so special since PI futexes + * utilize rt_mutex and it should be at no time + * left free with a wait queue, so this should + * be performed atomically in-kernel. + * Possible flags: PRIVATE, CLOCKRT + * 1. uaddr - futex address + * 2. op - FUTEX_WAIT_REQUEUE_PI + * 3. val - expected value stored in uaddr + * 4. timeout - timeout + * 5. uaddr2 - (PI-aware) futex address to requeue process on + * 6. val3 - not used (in kernel, it always initialized to + * FUTEX_BITSET_MATCH_ANY and passed to + * futex_wait_requeue_pi()) + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, + VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) " + "= %s\n", uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_REQUEUE_PI, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | + FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME, " + "%u, {tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, + sprintrc(rc)); + + /* FUTEX_CMP_REQUEUE_PI - version of FUTEX_CMP_REQUEUE which re-queues + * on PI-aware futex. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_CMP_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - (PI-aware) futex address, to re-queue waiting processes + * on + * 6. val3 - expected value stored in uaddr + */ + + /* All these should fail with EINVAL since we try to re-queue to non-PI + * futex. + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CMP_REQUEUE_PI, VAL, VAL2, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CMP_REQUEUE_PI, VAL, VAL2, uaddr2, + *uaddr, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE_PI, + VAL, VAL2, uaddr2, *uaddr, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE_PI, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", "%u"); + + /* + * Unknown commands + */ + + CHECK_FUTEX(uaddr, 0xd, VAL, tmout + 1, uaddr2 + 1, VAL3, + (rc == -1) && (errno == ENOSYS)); + printf("futex(%p, 0xd /* FUTEX_??? */, %u, %p, %p, %#x) = %s\n", + uaddr, VAL_PR, tmout + 1, uaddr2 + 1, VAL3_PR, sprintrc(rc)); + + CHECK_FUTEX(uaddr, 0xbefeeded, VAL, tmout + 1, uaddr2, VAL3, + (rc == -1) && (errno == ENOSYS)); + printf("futex(%p, 0xbefeeded /* FUTEX_??? */, %u, %p, %p, %#x) = %s\n", + uaddr, VAL_PR, tmout + 1, uaddr2, VAL3_PR, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_futex") + +#endif diff --git a/tests-m32/futex.test b/tests-m32/futex.test new file mode 100755 index 00000000..fc98267a --- /dev/null +++ b/tests-m32/futex.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check futex syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a27 +run_strace_match_diff -v -a27 diff --git a/tests-m32/futimesat.c b/tests-m32/futimesat.c new file mode 100644 index 00000000..c3566291 --- /dev/null +++ b/tests-m32/futimesat.c @@ -0,0 +1,89 @@ +/* + * Check decoding of futimesat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_futimesat + +# include +# include +# include +# include + + +int +main(void) +{ + struct timeval tv; + if (gettimeofday(&tv, NULL)) + perror_msg_and_fail("gettimeofday"); + + static const char sample[] = "futimesat_sample"; + unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U; + + long rc = syscall(__NR_futimesat, dirfd, sample, 0); + printf("futimesat(AT_FDCWD, \"%s\", NULL) = %ld %s (%m)\n", + sample, rc, errno2name()); + + struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); + dirfd = (unsigned long) 0xdeadbeefffffffffULL; + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_usec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_usec = tv.tv_usec + 1; + + rc = syscall(__NR_futimesat, dirfd, 0, ts + 2); + printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n", + (int) dirfd, ts + 2, rc, errno2name()); + + rc = syscall(__NR_futimesat, dirfd, 0, ts + 1); + printf("futimesat(%d, NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " + "%ld %s (%m)\n", (int) dirfd, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + ts + 2, rc, errno2name()); + + (void) close(0); + rc = syscall(__NR_futimesat, 0, "", ts); + printf("futimesat(0, \"\", [{tv_sec=%jd, tv_usec=%jd}, " + "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", + (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_futimesat") + +#endif diff --git a/tests-m32/futimesat.test b/tests-m32/futimesat.test new file mode 100755 index 00000000..3a67c042 --- /dev/null +++ b/tests-m32/futimesat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check futimesat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/get_mempolicy.c b/tests-m32/get_mempolicy.c new file mode 100644 index 00000000..03d1bffc --- /dev/null +++ b/tests-m32/get_mempolicy.c @@ -0,0 +1,135 @@ +/* + * Check decoding of get_mempolicy syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_get_mempolicy + +# include +# include + +# include "xlat.h" +# include "xlat/policies.h" + +# define MAX_STRLEN 3 +# define NLONGS(n) ((n + 8 * sizeof(long) - 2) \ + / (8 * sizeof(long))) + +static void +print_nodes(unsigned long maxnode) +{ + unsigned long *const nodemask = + tail_alloc(sizeof(*nodemask) * NLONGS(maxnode)); + + if (syscall(__NR_get_mempolicy, 0, nodemask, maxnode, 0, 0)) { + printf("get_mempolicy(NULL, %p, %lu, NULL, 0) = -1 %s (%m)\n", + nodemask, maxnode, errno2name()); + return; + } + + printf("get_mempolicy(NULL, ["); + + unsigned int nlongs = NLONGS(maxnode); + unsigned int i; + for (i = 0; i < nlongs; ++i) { + if (i) + fputs(", ", stdout); + if (i >= MAX_STRLEN) { + fputs("...", stdout); + break; + } + printf("%#0*lx", (int) sizeof(*nodemask) * 2 + 2, nodemask[i]); + } + + printf("], %lu, NULL, 0) = 0\n", maxnode); +} + +int +main(void) +{ + long rc; + + if (syscall(__NR_get_mempolicy, 0, 0, 0, 0, 0)) + perror_msg_and_skip("get_mempolicy"); + puts("get_mempolicy(NULL, NULL, 0, NULL, 0) = 0"); + + int *mode = (void *) 0xdefaced1baddeed2; + unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; + const unsigned long *nodemask = (void *) 0xfacedad3bebefed4ULL; + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long flags = -1U; + rc = syscall(__NR_get_mempolicy, mode, nodemask, maxnode, addr, flags); + printf("get_mempolicy(%p, %p, %lu, %#lx, %s|%#lx) = %ld %s (%m)\n", + mode, nodemask, maxnode, addr, + "MPOL_F_NODE|MPOL_F_ADDR", + flags & ~3, rc, errno2name()); + + mode = tail_alloc(sizeof(*mode)); + + rc = syscall(__NR_get_mempolicy, mode, 0, 0, 0, 0); + printf("get_mempolicy(["); + printxval(policies, (unsigned) *mode, "MPOL_???"); + printf("], NULL, 0, NULL, 0) = %ld\n", rc); + + *mode = -1; + rc = syscall(__NR_get_mempolicy, mode, 0, 0, mode - 1, 2); + printf("get_mempolicy(["); + printxval(policies, (unsigned) *mode, "MPOL_???"); + printf("], NULL, 0, %p, MPOL_F_ADDR) = %ld\n", mode - 1, rc); + + maxnode = get_page_size() * 8; + + print_nodes(maxnode); + print_nodes(maxnode + 1); + print_nodes(maxnode + 2); + + maxnode = sizeof(*nodemask) * 8; + print_nodes(maxnode - 1); + print_nodes(maxnode ); + print_nodes(maxnode + 1); + print_nodes(maxnode + 2); + print_nodes(maxnode * 2 - 1); + print_nodes(maxnode * 2 ); + print_nodes(maxnode * 2 + 1); + print_nodes(maxnode * 2 + 2); + print_nodes(maxnode * 3 - 1); + print_nodes(maxnode * 3 ); + print_nodes(maxnode * 3 + 1); + print_nodes(maxnode * 3 + 2); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_mempolicy") + +#endif diff --git a/tests-m32/get_mempolicy.test b/tests-m32/get_mempolicy.test new file mode 100755 index 00000000..92270970 --- /dev/null +++ b/tests-m32/get_mempolicy.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check get_mempolicy syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a38 diff --git a/tests-m32/get_page_size.c b/tests-m32/get_page_size.c new file mode 100644 index 00000000..aeea861c --- /dev/null +++ b/tests-m32/get_page_size.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include + +size_t +get_page_size(void) +{ + static size_t page_size; + + if (!page_size) + page_size = sysconf(_SC_PAGESIZE); + + return page_size; +} diff --git a/tests-m32/getcpu.c b/tests-m32/getcpu.c new file mode 100644 index 00000000..ec671f1e --- /dev/null +++ b/tests-m32/getcpu.c @@ -0,0 +1,76 @@ +/* + * Check decoding of getcpu syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_getcpu + +# include +# include + +int +main(void) +{ + unsigned *bogus_cpu = + (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + unsigned *bogus_node = + (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + unsigned *bogus_tcache = + (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; + + long res; + unsigned *cpu = tail_alloc(sizeof(*cpu)); + unsigned *node = tail_alloc(sizeof(*node)); + long * tcache = tail_alloc(128); + + res = syscall(__NR_getcpu, NULL, NULL, NULL); + printf("getcpu(NULL, NULL, NULL) = %s\n", sprintrc(res)); + + res = syscall(__NR_getcpu, bogus_cpu, bogus_node, bogus_tcache); + printf("getcpu(%p, %p, %p) = %s\n", + bogus_cpu, bogus_node, bogus_tcache, sprintrc(res)); + + res = syscall(__NR_getcpu, cpu, node, tcache); + if (res != 0) + perror_msg_and_skip("getcpu"); + + printf("getcpu([%u], [%u], %p) = 0\n", *cpu, *node, tcache); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getcpu"); + +#endif diff --git a/tests-m32/getcpu.test b/tests-m32/getcpu.test new file mode 100755 index 00000000..fe212658 --- /dev/null +++ b/tests-m32/getcpu.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getcpu syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/getcwd.c b/tests-m32/getcwd.c new file mode 100644 index 00000000..707c25c9 --- /dev/null +++ b/tests-m32/getcwd.c @@ -0,0 +1,46 @@ +#include "tests.h" + +#include + +#ifdef __NR_getcwd + +# include +# include +# include + +int +main(void) +{ + long res; + char cur_dir[PATH_MAX + 1]; + static const size_t bogus_size = (size_t) 0xbadc0deddeadfaceULL; + + res = syscall(__NR_getcwd, cur_dir, sizeof(cur_dir)); + + if (res <= 0) + perror_msg_and_fail("getcwd"); + + printf("getcwd(\""); + print_quoted_string(cur_dir); + printf("\", %zu) = %ld\n", sizeof(cur_dir), res); + + res = syscall(__NR_getcwd, cur_dir, 0); + printf("getcwd(%p, 0) = %s\n", cur_dir, sprintrc(res)); + + res = syscall(__NR_getcwd, NULL, bogus_size); + printf("getcwd(NULL, %zu) = %s\n", bogus_size, sprintrc(res)); + + res = syscall(__NR_getcwd, (void *) -1L, sizeof(cur_dir)); + printf("getcwd(%p, %zu) = %s\n", + (void *) -1L, sizeof(cur_dir), sprintrc(res)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getcwd"); + +#endif diff --git a/tests-m32/getcwd.test b/tests-m32/getcwd.test new file mode 100755 index 00000000..405187e5 --- /dev/null +++ b/tests-m32/getcwd.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getcwd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/getdents.c b/tests-m32/getdents.c new file mode 100644 index 00000000..b787c837 --- /dev/null +++ b/tests-m32/getdents.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getdents + +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +static char buf[8192]; + +static const char * +str_d_type(const unsigned char d_type) +{ + switch (d_type) { + case DT_DIR: + return "DT_DIR"; + case DT_REG: + return "DT_REG"; + default: + return "DT_UNKNOWN"; + } +} +static void +print_dirent(const kernel_dirent *d) +{ + const unsigned int d_name_offset = offsetof(kernel_dirent, d_name); + int d_name_len = d->d_reclen - d_name_offset - 1; + assert(d_name_len > 0); + + printf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=", + (unsigned long long) d->d_ino, + (unsigned long long) d->d_off, d->d_reclen); + + if (d->d_name[0] == '.') + printf("\"%.*s\"", d_name_len, d->d_name); + else + printf("\"%s\"", qname); + + printf(", d_type=%s}", + str_d_type(*((const char *) d + d->d_reclen - 1))); +} + +int +main(int ac, const char **av) +{ + char *dname; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents, (long) 0xdefacedffffffffULL, NULL, + count); + printf("getdents(-1, NULL, %u) = %ld %s (%m)\n", + (unsigned) count, rc, errno2name()); + + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); + while ((rc = syscall(__NR_getdents, 0, buf, count))) { + kernel_dirent *d; + long i; + + if (rc < 0) + perror_msg_and_skip("getdents"); + printf("getdents(0, ["); + for (i = 0; i < rc; i += d->d_reclen) { + d = (kernel_dirent *) &buf[i]; + if (i) + printf(", "); + print_dirent(d); + } + printf("], %u) = %ld\n", (unsigned) count, rc); + } + printf("getdents(0, [], %u) = 0\n", (unsigned) count); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getdents") + +#endif diff --git a/tests-m32/getdents.test b/tests-m32/getdents.test new file mode 100755 index 00000000..23c4ac3a --- /dev/null +++ b/tests-m32/getdents.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check getdents syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a22 -v diff --git a/tests-m32/getdents64.c b/tests-m32/getdents64.c new file mode 100644 index 00000000..9da2a23c --- /dev/null +++ b/tests-m32/getdents64.c @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getdents64 + +# include +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +typedef struct { + uint64_t d_ino; + uint64_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[256]; +} kernel_dirent64; + +static char buf[8192]; + +static const char * +str_d_type(const unsigned char d_type) +{ + switch (d_type) { + case DT_DIR: + return "DT_DIR"; + case DT_REG: + return "DT_REG"; + default: + return "DT_UNKNOWN"; + } +} +static void +print_dirent(const kernel_dirent64 *d) +{ + const unsigned int d_name_offset = offsetof(kernel_dirent64, d_name); + int d_name_len = d->d_reclen - d_name_offset; + assert(d_name_len > 0); + + printf("{d_ino=%" PRIu64 ", d_off=%" PRId64 + ", d_reclen=%u, d_type=%s, d_name=", + d->d_ino, d->d_off, d->d_reclen, str_d_type(d->d_type)); + + if (d->d_name[0] == '.') + printf("\"%.*s\"}", d_name_len, d->d_name); + else + printf("\"%s\"}", qname); +} + +int +main(int ac, const char **av) +{ + char *dname; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents64, (long) 0xdefacedffffffffULL, NULL, + count); + printf("getdents64(-1, NULL, %u) = %ld %s (%m)\n", + (unsigned) count, rc, errno2name()); + + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); + while ((rc = syscall(__NR_getdents64, 0, buf, count))) { + kernel_dirent64 *d; + long i; + + if (rc < 0) + perror_msg_and_skip("getdents64"); + printf("getdents64(0, ["); + for (i = 0; i < rc; i += d->d_reclen) { + d = (kernel_dirent64 *) &buf[i]; + if (i) + printf(", "); + print_dirent(d); + } + printf("], %u) = %ld\n", (unsigned) count, rc); + } + printf("getdents64(0, [], %u) = 0\n", (unsigned) count); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getdents64") + +#endif diff --git a/tests-m32/getdents64.test b/tests-m32/getdents64.test new file mode 100755 index 00000000..401cfc7c --- /dev/null +++ b/tests-m32/getdents64.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check getdents64 syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a24 -v diff --git a/tests-m32/getegid.c b/tests-m32/getegid.c new file mode 100644 index 00000000..98f8b9cb --- /dev/null +++ b/tests-m32/getegid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getegid + +# include +# include + +int +main(void) +{ + printf("getegid() = %ld\n", syscall(__NR_getegid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getegid") + +#endif diff --git a/tests-m32/getegid.test b/tests-m32/getegid.test new file mode 100755 index 00000000..4354158b --- /dev/null +++ b/tests-m32/getegid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getegid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getegid32.c b/tests-m32/getegid32.c new file mode 100644 index 00000000..d9951864 --- /dev/null +++ b/tests-m32/getegid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getegid32 + +# include +# include + +int +main(void) +{ + printf("getegid32() = %ld\n", syscall(__NR_getegid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getegid32") + +#endif diff --git a/tests-m32/getegid32.test b/tests-m32/getegid32.test new file mode 100755 index 00000000..a266620e --- /dev/null +++ b/tests-m32/getegid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getegid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/geteuid.c b/tests-m32/geteuid.c new file mode 100644 index 00000000..ef8269f9 --- /dev/null +++ b/tests-m32/geteuid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_geteuid + +# include +# include + +int +main(void) +{ + printf("geteuid() = %ld\n", syscall(__NR_geteuid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_geteuid") + +#endif diff --git a/tests-m32/geteuid.test b/tests-m32/geteuid.test new file mode 100755 index 00000000..14ff6a69 --- /dev/null +++ b/tests-m32/geteuid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check geteuid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/geteuid32.c b/tests-m32/geteuid32.c new file mode 100644 index 00000000..4341e46f --- /dev/null +++ b/tests-m32/geteuid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_geteuid32 + +# include +# include + +int +main(void) +{ + printf("geteuid32() = %ld\n", syscall(__NR_geteuid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_geteuid32") + +#endif diff --git a/tests-m32/geteuid32.test b/tests-m32/geteuid32.test new file mode 100755 index 00000000..9dd173d9 --- /dev/null +++ b/tests-m32/geteuid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check geteuid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgid.c b/tests-m32/getgid.c new file mode 100644 index 00000000..2e060390 --- /dev/null +++ b/tests-m32/getgid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getgid + +# include +# include + +int +main(void) +{ + printf("getgid() = %ld\n", syscall(__NR_getgid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgid") + +#endif diff --git a/tests-m32/getgid.test b/tests-m32/getgid.test new file mode 100755 index 00000000..f4f0c2e6 --- /dev/null +++ b/tests-m32/getgid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getgid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgid32.c b/tests-m32/getgid32.c new file mode 100644 index 00000000..52e4d76a --- /dev/null +++ b/tests-m32/getgid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getgid32 + +# include +# include + +int +main(void) +{ + printf("getgid32() = %ld\n", syscall(__NR_getgid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgid32") + +#endif diff --git a/tests-m32/getgid32.test b/tests-m32/getgid32.test new file mode 100755 index 00000000..3bc98d1a --- /dev/null +++ b/tests-m32/getgid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getgid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgroups.c b/tests-m32/getgroups.c new file mode 100644 index 00000000..2617303f --- /dev/null +++ b/tests-m32/getgroups.c @@ -0,0 +1,135 @@ +/* + * Check decoding of getgroups/getgroups32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef __NR_getgroups32 + +# define SYSCALL_NR __NR_getgroups32 +# define SYSCALL_NAME "getgroups32" +# define GID_TYPE unsigned int + +#else + +# include "tests.h" +# include + +# ifdef __NR_getgroups + +# define SYSCALL_NR __NR_getgroups +# define SYSCALL_NAME "getgroups" +# if defined __NR_getgroups32 && __NR_getgroups != __NR_getgroups32 +# define GID_TYPE unsigned short +# else +# define GID_TYPE unsigned int +# endif + +# endif + +#endif + +#ifdef GID_TYPE + +# include +# include + +#define MAX_STRLEN 32 +static long ngroups; + +static void +get_groups(const long size, GID_TYPE *const g) +{ + long i = syscall(SYSCALL_NR, size, g); + if (i != ngroups) + perror_msg_and_fail("%s(%#lx, %p)", SYSCALL_NAME, size, g); + + printf("%s(%d, [", SYSCALL_NAME, (int) size); + for (i = 0; i < ngroups; ++i) { + if (i) + printf(", "); + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + printf("%u", (unsigned int) g[i]); + } + printf("]) = %ld\n", ngroups); +} + +int +main(void) +{ + long rc; + + /* check how the first argument is decoded */ + ngroups = syscall(SYSCALL_NR, 0, 0); + printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, ngroups); + if (ngroups < 0) + perror_msg_and_fail(SYSCALL_NAME); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, rc); + + rc = syscall(SYSCALL_NR, -1U, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1L, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + const unsigned int ngroups_max = sysconf(_SC_NGROUPS_MAX); + + rc = syscall(SYSCALL_NR, ngroups_max, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL | ngroups_max, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); + + /* check how the second argument is decoded */ + GID_TYPE *const g1 = + tail_alloc(ngroups ? sizeof(*g1) * ngroups : 1); + GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * (ngroups + 1)); + void *efault = g2 + ngroups + 1; + + get_groups(ngroups, g1); + get_groups(ngroups + 1, g1); + get_groups(ngroups + 1, g2); + + if (ngroups) { + rc = syscall(SYSCALL_NR, ngroups, efault); + printf("%s(%d, %p) = %s\n", + SYSCALL_NAME, (unsigned) ngroups, efault, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgroups") + +#endif diff --git a/tests-m32/getgroups.test b/tests-m32/getgroups.test new file mode 100755 index 00000000..2eb3056d --- /dev/null +++ b/tests-m32/getgroups.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getgroups syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/getgroups32.c b/tests-m32/getgroups32.c new file mode 100644 index 00000000..d0a356de --- /dev/null +++ b/tests-m32/getgroups32.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include + +#ifdef __NR_getgroups32 + +# include "getgroups.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgroups32") + +#endif diff --git a/tests-m32/getgroups32.test b/tests-m32/getgroups32.test new file mode 100755 index 00000000..12a8bcc0 --- /dev/null +++ b/tests-m32/getgroups32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getgroups32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/getpeername.c b/tests-m32/getpeername.c new file mode 100644 index 00000000..c842acec --- /dev/null +++ b/tests-m32/getpeername.c @@ -0,0 +1,63 @@ +/* + * Check decoding of getpeername syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME getpeername +#include "sockname.c" + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + int cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0 || cfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + if (listen(lfd, 1)) + perror_msg_and_skip("listen"); + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); + if (accept(lfd, 0, 0) < 0) + perror_msg_and_skip("accept"); + + test_sockname_syscall(cfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/getpeername.test b/tests-m32/getpeername.test new file mode 100755 index 00000000..81f01bb1 --- /dev/null +++ b/tests-m32/getpeername.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of getpeername syscall. + +. "${srcdir=.}/getsockname.test" diff --git a/tests-m32/getpgrp.c b/tests-m32/getpgrp.c new file mode 100644 index 00000000..8b9d0882 --- /dev/null +++ b/tests-m32/getpgrp.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_getpgrp + +# include +# include + +int +main(void) +{ + printf("getpgrp() = %ld\n", syscall(__NR_getpgrp)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpgrp") + +#endif diff --git a/tests-m32/getpgrp.test b/tests-m32/getpgrp.test new file mode 100755 index 00000000..e116bb51 --- /dev/null +++ b/tests-m32/getpgrp.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpgrp syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/getrandom.c b/tests-m32/getrandom.c new file mode 100644 index 00000000..de1a0874 --- /dev/null +++ b/tests-m32/getrandom.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getrandom + +# include +# include + +int +main(void) +{ + unsigned char buf[4]; + + if (syscall(__NR_getrandom, buf, sizeof(buf) - 1, 0) != sizeof(buf) - 1) + perror_msg_and_skip("getrandom"); + printf("getrandom(\"\\x%02x\\x%02x\\x%02x\", 3, 0) = 3\n", + (int) buf[0], (int) buf[1], (int) buf[2]); + + if (syscall(__NR_getrandom, buf, sizeof(buf), 1) != sizeof(buf)) + perror_msg_and_skip("getrandom"); + printf("getrandom(\"\\x%02x\\x%02x\\x%02x\"..., 4, GRND_NONBLOCK) = 4\n", + (int) buf[0], (int) buf[1], (int) buf[2]); + + if (syscall(__NR_getrandom, buf, sizeof(buf), 0x3003) != -1) + perror_msg_and_skip("getrandom"); + printf("getrandom(%p, 4, GRND_NONBLOCK|GRND_RANDOM|0x3000) = " + "-1 EINVAL (%m)\n", buf); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrandom") + +#endif diff --git a/tests-m32/getrandom.test b/tests-m32/getrandom.test new file mode 100755 index 00000000..ad34048f --- /dev/null +++ b/tests-m32/getrandom.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getrandom syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -s3 diff --git a/tests-m32/getresgid.c b/tests-m32/getresgid.c new file mode 100644 index 00000000..b8c687b1 --- /dev/null +++ b/tests-m32/getresgid.c @@ -0,0 +1,21 @@ +#include "tests.h" +#include + +#ifdef __NR_getresgid + +# define SYSCALL_NR __NR_getresgid +# define SYSCALL_NAME "getresgid" + +# if defined __NR_getresgid32 && __NR_getresgid != __NR_getresgid32 +# define UGID_TYPE short +# else +# define UGID_TYPE int +# endif + +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresgid") + +#endif diff --git a/tests-m32/getresgid.test b/tests-m32/getresgid.test new file mode 100755 index 00000000..9f5186e8 --- /dev/null +++ b/tests-m32/getresgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/getresgid32.c b/tests-m32/getresgid32.c new file mode 100644 index 00000000..71f11344 --- /dev/null +++ b/tests-m32/getresgid32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_getresgid32 + +# define SYSCALL_NR __NR_getresgid32 +# define SYSCALL_NAME "getresgid32" +# define UGID_TYPE int +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresgid32") + +#endif diff --git a/tests-m32/getresgid32.test b/tests-m32/getresgid32.test new file mode 100755 index 00000000..a9798911 --- /dev/null +++ b/tests-m32/getresgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getresugid.c b/tests-m32/getresugid.c new file mode 100644 index 00000000..0ee721cf --- /dev/null +++ b/tests-m32/getresugid.c @@ -0,0 +1,58 @@ +/* + * Check decoding of getresuid/getresgid/getresuid32/getresgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +int +main(void) +{ + unsigned UGID_TYPE *const r = tail_alloc(sizeof(*r)); + unsigned UGID_TYPE *const e = tail_alloc(sizeof(*e)); + unsigned UGID_TYPE *const s = tail_alloc(sizeof(*s)); + + if (syscall(SYSCALL_NR, r, e, s)) + perror_msg_and_fail(SYSCALL_NAME); + + printf("%s([%u], [%u], [%u]) = 0\n", SYSCALL_NAME, + (unsigned) *r, (unsigned) *e, (unsigned) *s); + + assert(syscall(SYSCALL_NR, NULL, e, s) == -1); + printf("%s(NULL, %p, %p) = -1 EFAULT (%m)\n", SYSCALL_NAME, e, s); + + assert(syscall(SYSCALL_NR, r, NULL, s) == -1); + printf("%s(%p, NULL, %p) = -1 EFAULT (%m)\n", SYSCALL_NAME, r, s); + + assert(syscall(SYSCALL_NR, r, e, NULL) == -1); + printf("%s(%p, %p, NULL) = -1 EFAULT (%m)\n", SYSCALL_NAME, r, e); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/getresuid.c b/tests-m32/getresuid.c new file mode 100644 index 00000000..b00f20ba --- /dev/null +++ b/tests-m32/getresuid.c @@ -0,0 +1,21 @@ +#include "tests.h" +#include + +#ifdef __NR_getresuid + +# define SYSCALL_NR __NR_getresuid +# define SYSCALL_NAME "getresuid" + +# if defined __NR_getresuid32 && __NR_getresuid != __NR_getresuid32 +# define UGID_TYPE short +# else +# define UGID_TYPE int +# endif + +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresuid") + +#endif diff --git a/tests-m32/getresuid.test b/tests-m32/getresuid.test new file mode 100755 index 00000000..eee1ac05 --- /dev/null +++ b/tests-m32/getresuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/getresuid32.c b/tests-m32/getresuid32.c new file mode 100644 index 00000000..4c9a83df --- /dev/null +++ b/tests-m32/getresuid32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_getresuid32 + +# define SYSCALL_NR __NR_getresuid32 +# define SYSCALL_NAME "getresuid32" +# define UGID_TYPE int +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresuid32") + +#endif diff --git a/tests-m32/getresuid32.test b/tests-m32/getresuid32.test new file mode 100755 index 00000000..fdc76a31 --- /dev/null +++ b/tests-m32/getresuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getrlimit.c b/tests-m32/getrlimit.c new file mode 100644 index 00000000..bd9d0b0f --- /dev/null +++ b/tests-m32/getrlimit.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_getrlimit + +# define NR_GETRLIMIT __NR_getrlimit +# define STR_GETRLIMIT "getrlimit" +# include "xgetrlimit.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrlimit") + +#endif diff --git a/tests-m32/getrlimit.test b/tests-m32/getrlimit.test new file mode 100755 index 00000000..6fd88aed --- /dev/null +++ b/tests-m32/getrlimit.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of getrlimit syscall. + +. "${srcdir=.}/setrlimit.test" diff --git a/tests-m32/getrusage.c b/tests-m32/getrusage.c new file mode 100644 index 00000000..8b76eff6 --- /dev/null +++ b/tests-m32/getrusage.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getrusage + +# include +# include +# include +# include + +int +main(void) +{ + struct rusage *const usage = tail_alloc(sizeof(struct rusage)); + int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage); + printf("getrusage(RUSAGE_SELF, {ru_utime={tv_sec=%jd, tv_usec=%jd}" + ", ru_stime={tv_sec=%jd, tv_usec=%jd}, ru_maxrss=%lu" + ", ru_ixrss=%lu, ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu" + ", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu" + ", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu" + ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n", + (intmax_t) usage->ru_utime.tv_sec, + (intmax_t) usage->ru_utime.tv_usec, + (intmax_t) usage->ru_stime.tv_sec, + (intmax_t) usage->ru_stime.tv_usec, + usage->ru_maxrss, usage->ru_ixrss, usage->ru_idrss, + usage->ru_isrss, usage->ru_minflt, usage->ru_majflt, + usage->ru_nswap, usage->ru_inblock, usage->ru_oublock, + usage->ru_msgsnd, usage->ru_msgrcv, usage->ru_nsignals, + usage->ru_nvcsw, usage->ru_nivcsw, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrusage") + +#endif diff --git a/tests-m32/getrusage.test b/tests-m32/getrusage.test new file mode 100755 index 00000000..4a3e8ed0 --- /dev/null +++ b/tests-m32/getrusage.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getrusage syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v diff --git a/tests-m32/getsid.c b/tests-m32/getsid.c new file mode 100644 index 00000000..b563de9d --- /dev/null +++ b/tests-m32/getsid.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include +#include + +int +main(void) +{ + pid_t pid = getpid(); + printf("getsid(%d) = %d\n", pid, getsid(pid)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/getsid.test b/tests-m32/getsid.test new file mode 100755 index 00000000..3fcf9799 --- /dev/null +++ b/tests-m32/getsid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getsid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/getsockname.c b/tests-m32/getsockname.c new file mode 100644 index 00000000..66ac4e63 --- /dev/null +++ b/tests-m32/getsockname.c @@ -0,0 +1,56 @@ +/* + * Check decoding of getsockname syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME getsockname +#include "sockname.c" + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + + test_sockname_syscall(lfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/getsockname.test b/tests-m32/getsockname.test new file mode 100755 index 00000000..99b28506 --- /dev/null +++ b/tests-m32/getsockname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getsockname syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getuid.c b/tests-m32/getuid.c new file mode 100644 index 00000000..57311f72 --- /dev/null +++ b/tests-m32/getuid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getuid + +# include +# include + +int +main(void) +{ + printf("getuid() = %ld\n", syscall(__NR_getuid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getuid") + +#endif diff --git a/tests-m32/getuid.test b/tests-m32/getuid.test new file mode 100755 index 00000000..9aaf74ba --- /dev/null +++ b/tests-m32/getuid.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check getuid syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog uniq +run_prog > /dev/null +run_strace -qq -a9 -e$NAME $args > "$EXP" +uniq < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$OUT" "$EXP" diff --git a/tests-m32/getuid32.c b/tests-m32/getuid32.c new file mode 100644 index 00000000..397dd08f --- /dev/null +++ b/tests-m32/getuid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getuid32 + +# include +# include + +int +main(void) +{ + printf("getuid32() = %ld\n", syscall(__NR_getuid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getuid32") + +#endif diff --git a/tests-m32/getuid32.test b/tests-m32/getuid32.test new file mode 100755 index 00000000..ae0c557b --- /dev/null +++ b/tests-m32/getuid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getuid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getxxid.c b/tests-m32/getxxid.c new file mode 100644 index 00000000..6eee52c5 --- /dev/null +++ b/tests-m32/getxxid.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_getxpid && defined __NR_getxuid && defined __NR_getxgid + +# include +# include + +int +main(void) +{ + long id; + pid_t ppid; + + id = syscall(__NR_getxpid); + ppid = getppid(); + printf("getxpid() = %ld (ppid %ld)\n", id, (long) ppid); + printf("getxpid() = %ld (ppid %ld)\n", id, (long) ppid); + + id = syscall(__NR_getxuid); + printf("getxuid() = %ld (euid %ld)\n", id, id); + + id = syscall(__NR_getxgid); + printf("getxgid() = %ld (egid %ld)\n", id, id); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getxpid && __NR_getxuid && __NR_getxgid") + +#endif diff --git a/tests-m32/getxxid.test b/tests-m32/getxxid.test new file mode 100755 index 00000000..9b89d7cf --- /dev/null +++ b/tests-m32/getxxid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getxpid, getxuid, and getxgid syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests-m32/hexdump_strdup.c b/tests-m32/hexdump_strdup.c new file mode 100644 index 00000000..4d6b53f4 --- /dev/null +++ b/tests-m32/hexdump_strdup.c @@ -0,0 +1,66 @@ +/* + * Make a hexdump copy of C string + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +const char * +hexdump_memdup(const char *src, size_t len) +{ + size_t dst_size = 3 * len + 2; + assert(dst_size > len); + + char *dst = malloc(dst_size); + if (!dst) + perror_msg_and_fail("malloc(%zu)", dst_size); + + char *p = dst; + const unsigned char *usrc = (const unsigned char *) src; + size_t i; + for (i = 0; i < len; ++i) { + unsigned int c = usrc[i]; + *(p++) = ' '; + if (i == 8) + *(p++) = ' '; + *(p++) = "0123456789abcdef"[c >> 4]; + *(p++) = "0123456789abcdef"[c & 0xf]; + } + *p = '\0'; + + return dst; +} + +const char * +hexdump_strdup(const char *src) +{ + return hexdump_memdup(src, strlen(src)); +} diff --git a/tests-m32/hexquote_strndup.c b/tests-m32/hexquote_strndup.c new file mode 100644 index 00000000..3ad3970c --- /dev/null +++ b/tests-m32/hexquote_strndup.c @@ -0,0 +1,58 @@ +/* + * Make a hexquoted copy of a string + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +const char * +hexquote_strndup(const char *src, const size_t src_len) +{ + const size_t dst_size = 4 * src_len + 1; + assert(dst_size > src_len); + + char *dst = malloc(dst_size); + if (!dst) + perror_msg_and_fail("malloc(%zu)", dst_size); + + char *p = dst; + size_t i; + for (i = 0; i < src_len; ++i) { + unsigned int c = ((const unsigned char *) src)[i]; + *(p++) = '\\'; + *(p++) = 'x'; + *(p++) = "0123456789abcdef"[c >> 4]; + *(p++) = "0123456789abcdef"[c & 0xf]; + } + *p = '\0'; + + return dst; +} diff --git a/tests-m32/inet-cmsg.c b/tests-m32/inet-cmsg.c new file mode 100644 index 00000000..b530016d --- /dev/null +++ b/tests-m32/inet-cmsg.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +print_pktinfo(const struct cmsghdr *c) +{ + printf("IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex(\"lo\")" + ", ipi_spec_dst=inet_addr(\"127.0.0.1\")" + ", ipi_addr=inet_addr(\"127.0.0.1\")}"); +} + +static void +print_ttl(const struct cmsghdr *c) +{ + const unsigned int *ttl = (const unsigned int *) CMSG_DATA(c); + + printf("IP_TTL, cmsg_data=[%u]", *ttl); +} + +static void +print_tos(const struct cmsghdr *c) +{ + const uint8_t *tos = (const uint8_t *) CMSG_DATA(c); + + printf("IP_TOS, cmsg_data=[%#x]", *tos); +} + +static void +print_opts(const char *name, const struct cmsghdr *c) +{ + const unsigned char *opts = (const unsigned char *) CMSG_DATA(c); + const size_t len = c->cmsg_len - CMSG_ALIGN(sizeof(*c)); + + printf("%s", name); + if (len) { + printf(", cmsg_data=["); + size_t i; + for (i = 0; i < len; ++i) + printf("%s0x%02x", i ? ", " : "", opts[i]); + printf("]"); + } +} + +#ifdef IP_ORIGDSTADDR +static void +print_origdstaddr(const struct cmsghdr *c) +{ + const struct sockaddr_in *sin = + (const struct sockaddr_in *) CMSG_DATA(c); + + printf("IP_ORIGDSTADDR, cmsg_data={sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}", ntohs(sin->sin_port)); +} +#endif + +int +main(void) +{ + int i; + while ((i = open("/dev/null", O_RDWR)) < 3) + assert(i >= 0); + assert(!close(0)); + assert(!close(3)); + + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + }; + socklen_t len = sizeof(addr); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + assert(!getsockname(0, (struct sockaddr *) &addr, &len)); + + assert(socket(AF_INET, SOCK_DGRAM, 0) == 3); + assert(!connect(3, (struct sockaddr *) &addr, len)); + + const int opt_1 = htonl(0x01000000); +#define SETSOCKOPT(fd, name) assert(!setsockopt(fd, IPPROTO_IP, (name), &opt_1, sizeof(opt_1))) + SETSOCKOPT(3, IP_OPTIONS); + SETSOCKOPT(0, IP_PKTINFO); + SETSOCKOPT(0, IP_RECVTTL); + SETSOCKOPT(0, IP_RECVTOS); + SETSOCKOPT(0, IP_RECVOPTS); + SETSOCKOPT(0, IP_RETOPTS); +#ifdef IP_RECVORIGDSTADDR + SETSOCKOPT(0, IP_RECVORIGDSTADDR); +#endif + + static const char data[] = "data"; + const size_t size = sizeof(data) - 1; + assert(send(3, data, size, 0) == (int) size); + assert(!close(3)); + + char buf[size]; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof(buf) + }; + struct cmsghdr control[16]; + struct msghdr mh = { + .msg_name = &addr, + .msg_namelen = len, + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = control, + .msg_controllen = sizeof(control) + }; + + assert(recvmsg(0, &mh, 0) == (int) size); + assert(!close(0)); + + printf("recvmsg(0, {msg_name={sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, msg_namelen=%u" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=1" + ", msg_control=[", + ntohs(addr.sin_port), (unsigned) mh.msg_namelen, + data, (unsigned) size); + + struct cmsghdr *c; + for (c = CMSG_FIRSTHDR(&mh); c; c = CMSG_NXTHDR(&mh, c)) { + if (IPPROTO_IP != c->cmsg_level) + continue; + if (c != control) + printf(", "); + printf("{cmsg_len=%lu, cmsg_level=SOL_IP, cmsg_type=", + (unsigned long) c->cmsg_len); + switch (c->cmsg_type) { + case IP_PKTINFO: + print_pktinfo(c); + break; + case IP_TTL: + print_ttl(c); + break; + case IP_TOS: + print_tos(c); + break; + case IP_RECVOPTS: + print_opts("IP_RECVOPTS", c); + break; + case IP_RETOPTS: + print_opts("IP_RETOPTS", c); + break; +#ifdef IP_ORIGDSTADDR + case IP_ORIGDSTADDR: + print_origdstaddr(c); + break; +#endif + default: + printf("%d", c->cmsg_type); + break; + } + printf("}"); + } + printf("], msg_controllen=%lu, msg_flags=0}, 0) = %u\n", + (unsigned long) mh.msg_controllen, (unsigned) size); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-m32/inet-cmsg.test b/tests-m32/inet-cmsg.test new file mode 100755 index 00000000..52ff5f59 --- /dev/null +++ b/tests-m32/inet-cmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check IPPROTO_IP control messages decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests-m32/init.sh b/tests-m32/init.sh new file mode 100644 index 00000000..f368b98a --- /dev/null +++ b/tests-m32/init.sh @@ -0,0 +1,272 @@ +#!/bin/sh +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ME_="${0##*/}" +LOG="$ME_.tmp" +OUT="$LOG.out" +EXP="$LOG.exp" +NAME="${ME_%.test}" + +warn_() { printf >&2 '%s\n' "$*"; } +fail_() { warn_ "$ME_: failed test: $*"; exit 1; } +skip_() { warn_ "$ME_: skipped test: $*"; exit 77; } +framework_failure_() { warn_ "$ME_: framework failure: $*"; exit 99; } +framework_skip_() { warn_ "$ME_: framework skip: $*"; exit 77; } + +check_prog() +{ + type "$@" > /dev/null 2>&1 || + framework_skip_ "$* is not available" +} + +dump_log_and_fail_with() +{ + cat < "$LOG" + fail_ "$*" +} + +run_prog() +{ + if [ $# -eq 0 ]; then + set -- "./$NAME" + fi + args="$*" + "$@" || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$args exited with code 77" + else + fail_ "$args failed with code $rc" + fi + } +} + + +run_prog_skip_if_failed() +{ + args="$*" + "$@" || framework_skip_ "$args failed with code $?" +} + +run_strace() +{ + > "$LOG" || fail_ "failed to write $LOG" + args="$*" + $STRACE -o "$LOG" "$@" || + dump_log_and_fail_with "$STRACE $args failed with code $?" +} + +run_strace_merge() +{ + rm -f -- "$LOG".[0-9]* + run_strace -ff -tt "$@" + "$srcdir"/../strace-log-merge "$LOG" > "$LOG" || + dump_log_and_fail_with 'strace-log-merge failed with code $?' + rm -f -- "$LOG".[0-9]* +} + +check_gawk() +{ + check_prog gawk + check_prog grep + + local program="$1"; shift + if grep '^@include[[:space:]]' < "$program" > /dev/null; then + gawk '@include "/dev/null"' < /dev/null || + framework_skip_ 'gawk does not support @include' + fi +} + +# Usage: [FILE_TO_CHECK [AWK_PROGRAM [ERROR_MESSAGE [EXTRA_AWK_OPTIONS...]]]] +# Check whether AWK_PROGRAM matches FILE_TO_CHECK using gawk. +# If it doesn't, dump FILE_TO_CHECK and fail with ERROR_MESSAGE. +match_awk() +{ + local output program error + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + program="$srcdir/$NAME.awk" + else + program="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_gawk "$program" + + AWKPATH="$srcdir" gawk -f "$program" "$@" < "$output" || { + cat < "$output" + fail_ "$error" + } +} + +# Usage: [FILE_TO_CHECK [FILE_TO_COMPATE_WITH [ERROR_MESSAGE]]] +# Check whether FILE_TO_CHECK differs from FILE_TO_COMPATE_WITH. +# If it does, dump the difference and fail with ERROR_MESSAGE. +match_diff() +{ + local output expected error + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + expected="$srcdir/$NAME.expected" + else + expected="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_prog diff + + diff -- "$expected" "$output" || + fail_ "$error" +} + +# Usage: [FILE_TO_CHECK [FILE_WITH_PATTERNS [ERROR_MESSAGE]]] +# Check whether all patterns listed in FILE_WITH_PATTERNS +# match FILE_TO_CHECK using egrep. +# If at least one of these patterns does not match, +# dump both files and fail with ERROR_MESSAGE. +match_grep() +{ + local output patterns error pattern cnt failed= + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + patterns="$srcdir/$NAME.expected" + else + patterns="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_prog wc + check_prog grep + + cnt=1 + while read -r pattern; do + LC_ALL=C grep -E -x -e "$pattern" < "$output" > /dev/null || { + test -n "$failed" || { + echo 'Failed patterns of expected output:' + failed=1 + } + printf '#%d: %s\n' "$cnt" "$pattern" + } + cnt=$(($cnt + 1)) + done < "$patterns" + test -z "$failed" || { + echo 'Actual output:' + cat < "$output" + fail_ "$error" + } +} + +# Usage: run_strace_match_diff [args to run_strace] +run_strace_match_diff() +{ + args="$*" + [ -n "$args" -a -z "${args##*-e trace=*}" ] || + set -- -e trace="$NAME" "$@" + run_prog > /dev/null + run_strace "$@" $args > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +# Print kernel version code. +# usage: kernel_version_code $(uname -r) +kernel_version_code() +{ + ( + set -f + IFS=. + set -- $1 + v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0 + v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0 + v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0 + echo "$(($v1 * 65536 + $v2 * 256 + $v3))" + ) +} + +# Usage: require_min_kernel_version_or_skip 3.0 +require_min_kernel_version_or_skip() +{ + local uname_r + uname_r="$(uname -r)" + + [ "$(kernel_version_code "$uname_r")" -ge \ + "$(kernel_version_code "$1")" ] || + skip_ "the kernel release $uname_r is not $1 or newer" +} + +# Usage: grep_pid_status $pid GREP-OPTIONS... +grep_pid_status() +{ + local pid + pid=$1; shift + cat < "/proc/$pid/status" | grep "$@" +} + +check_prog cat +check_prog rm + +rm -f "$LOG" + +[ -n "${STRACE-}" ] || { + STRACE=../strace + case "${LOG_COMPILER-} ${LOG_FLAGS-}" in + *--suppressions=*--error-exitcode=*--tool=*) + # add valgrind command prefix + STRACE="${LOG_COMPILER-} ${LOG_FLAGS-} $STRACE" + ;; + esac +} + +: "${TIMEOUT_DURATION:=60}" +: "${SLEEP_A_BIT:=sleep 1}" + +[ -z "${VERBOSE-}" ] || + set -x diff --git a/tests-m32/init_delete_module.h b/tests-m32/init_delete_module.h new file mode 100644 index 00000000..db550c33 --- /dev/null +++ b/tests-m32/init_delete_module.h @@ -0,0 +1,64 @@ +/* + * Helper header containing common code for finit_module, init_module, + * and delete_module tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_INIT_DELETE_MODULE_H +#define STRACE_TESTS_INIT_DELETE_MODULE_H + +# include +# include + +enum { + PARAM1_LEN = 33, + PARAM2_LEN = 8, + PARAM1_BASE = 0x30, + PARAM2_BASE = 0x80, + MAX_STRLEN = 32, +}; + +static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0xffffffff00000000ULL; + +static void +print_str(unsigned int base, unsigned int len, bool escape) +{ + unsigned int i; + + if (!escape) { + for (i = base; i < (base + len); i++) + putc(i, stdout); + + return; + } + + for (i = base; i < (base + len); i++) + printf("\\%u%u%u", (i >> 6) & 0x3, (i >> 3) & 0x7, i & 0x7); +} + +#endif /* !STRACE_TESTS_INIT_DELETE_MODULE_H */ diff --git a/tests-m32/init_module.c b/tests-m32/init_module.c new file mode 100644 index 00000000..88ef9ec8 --- /dev/null +++ b/tests-m32/init_module.c @@ -0,0 +1,106 @@ +/* + * Check decoding of init_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_init_module) + +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfffffeedfffffaceULL; + static const kernel_ulong_t bogus_len = + (kernel_ulong_t) 0xfffffca7ffffc0deULL; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_init_module, NULL, bogus_zero, NULL); + printf("init_module(NULL, %llu, NULL) = %s\n", + (unsigned long long) bogus_zero, sprintrc(rc)); + + rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); + errstr = sprintrc(rc); + + printf("init_module(%#llx, 0, \"", (unsigned long long) bogus_addr); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"...) = %s\n", errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); + errstr = sprintrc(rc); + + printf("init_module(%#llx, 0, \"", (unsigned long long) bogus_addr); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\") = %s\n", errstr); + + rc = syscall(__NR_init_module, bogus_addr, bogus_len, + bogus_param2 + PARAM2_LEN); + printf("init_module(%#llx, %llu, %p) = %s\n", + (unsigned long long) bogus_addr, (unsigned long long) bogus_len, + bogus_param2 + PARAM2_LEN, sprintrc(rc)); + + rc = syscall(__NR_init_module, NULL, bogus_len, bogus_param2); + printf("init_module(NULL, %llu, %p) = %s\n", + (unsigned long long) bogus_len, bogus_param2, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_init_module, NULL, bogus_len, bogus_param2); + errstr = sprintrc(rc); + + printf("init_module(NULL, %llu, \"", (unsigned long long) bogus_len); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\") = %s\n", errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_init_module"); + +#endif diff --git a/tests-m32/init_module.test b/tests-m32/init_module.test new file mode 100755 index 00000000..ef7c7325 --- /dev/null +++ b/tests-m32/init_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of init_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/inode_of_sockfd.c b/tests-m32/inode_of_sockfd.c new file mode 100644 index 00000000..b227f306 --- /dev/null +++ b/tests-m32/inode_of_sockfd.c @@ -0,0 +1,59 @@ +/* + * This file is part of strace test suite. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +unsigned long +inode_of_sockfd(const int fd) +{ + assert(fd >= 0); + + char linkpath[sizeof("/proc/self/fd/%u") + sizeof(int) * 3]; + assert(snprintf(linkpath, sizeof(linkpath), "/proc/self/fd/%u", fd) + < (int) sizeof(linkpath)); + + char path[PATH_MAX + 1]; + const ssize_t path_len = readlink(linkpath, path, sizeof(path) - 1); + if (path_len < 0) + perror_msg_and_fail("readlink: %s", linkpath); + path[path_len] = '\0'; + + static const char prefix[] = "socket:["; + const size_t prefix_len = sizeof(prefix) - 1; + assert(strncmp(path, prefix, prefix_len) == 0 + && path[path_len - 1] == ']'); + + return strtoul(path + prefix_len, NULL, 10); +} diff --git a/tests-m32/inotify.c b/tests-m32/inotify.c new file mode 100644 index 00000000..925d69ff --- /dev/null +++ b/tests-m32/inotify.c @@ -0,0 +1,90 @@ +/* + * Check decoding of inotify_add_watch and inotify_rm_watch syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_inotify_add_watch) && defined(__NR_inotify_rm_watch) + +# include +# include +# include + +int +main(void) +{ + static const struct { + const char *path; + const char *str; + } bogus_path_str = { + ARG_STR("/abc\1/def\2/ghi\3/jkl\4/mno\5/pqr\6/stu\7/vwx\10") }; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfffffeedfffffaceULL; + static const kernel_ulong_t bogus_mask = + (kernel_ulong_t) 0xffffda7affffdeadULL; + static const char *bogus_mask_str = "IN_ACCESS|IN_ATTRIB|" + "IN_CLOSE_WRITE|IN_OPEN|IN_MOVED_TO|IN_DELETE|IN_DELETE_SELF|" + "IN_MOVE_SELF|IN_Q_OVERFLOW|IN_IGNORED|IN_ONLYDIR|" + "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_ADD|IN_ISDIR|IN_ONESHOT|" + "0x18ff1000"; + + long rc; + char *bogus_path = tail_memdup(bogus_path_str.path, + strlen(bogus_path_str.path) + 1); + + rc = syscall(__NR_inotify_add_watch, 0, NULL, 0); + printf("inotify_add_watch(0, NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_inotify_add_watch, bogus_fd, bogus_path + 4096, 0); + printf("inotify_add_watch(%d, %p, %u) = %s\n", + (int) bogus_fd, bogus_path + 4096, 0, sprintrc(rc)); + + rc = syscall(__NR_inotify_add_watch, bogus_fd, bogus_path, bogus_mask); + printf("inotify_add_watch(%d, %s, %s) = %s\n", + (int) bogus_fd, bogus_path_str.str, bogus_mask_str, + sprintrc(rc)); + + rc = syscall(__NR_inotify_rm_watch, 0, 0); + printf("inotify_rm_watch(0, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_inotify_rm_watch, bogus_fd, bogus_fd); + printf("inotify_rm_watch(%d, %d) = %s\n", + (int) bogus_fd, (int) bogus_fd, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_inotify_add_watch && __NR_inotify_rm_watch"); + +#endif diff --git a/tests-m32/inotify.test b/tests-m32/inotify.test new file mode 100755 index 00000000..436f3bc8 --- /dev/null +++ b/tests-m32/inotify.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of inotify_add_watch and inotify_rm_watch syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=inotify_add_watch,inotify_rm_watch -a23 diff --git a/tests-m32/inotify_init1.c b/tests-m32/inotify_init1.c new file mode 100644 index 00000000..0325150d --- /dev/null +++ b/tests-m32/inotify_init1.c @@ -0,0 +1,80 @@ +/* + * Check decoding of inotify_init1 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_inotify_init1) + +# include +# include +# include + +# ifdef O_CLOEXEC +# define cloexec_flag O_CLOEXEC +# else +# define cloexec_flag 0 +# endif +# define all_flags (O_NONBLOCK | cloexec_flag) + +int +main(void) +{ + static const kernel_ulong_t bogus_flags1 = + (kernel_ulong_t) 0xfacefeeddeadbeefULL | O_NONBLOCK; + static const kernel_ulong_t bogus_flags2 = + (kernel_ulong_t) 0x55555550ff96b77bULL & ~all_flags; + + long rc; + + rc = syscall(__NR_inotify_init1, bogus_flags1); + printf("inotify_init1(IN_NONBLOCK|%s%#x) = %s\n", + bogus_flags1 & cloexec_flag ? "IN_CLOEXEC|" : "", + (unsigned int) (bogus_flags1 & ~all_flags), + sprintrc(rc)); + + rc = syscall(__NR_inotify_init1, bogus_flags2); + printf("inotify_init1(%#x /* IN_??? */) = %s\n", + (unsigned int) bogus_flags2, sprintrc(rc)); + + rc = syscall(__NR_inotify_init1, all_flags); + printf("inotify_init1(IN_NONBLOCK%s) = %s\n", + all_flags & cloexec_flag ? "|IN_CLOEXEC" : "", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_inotify_init1"); + +#endif diff --git a/tests-m32/inotify_init1.test b/tests-m32/inotify_init1.test new file mode 100755 index 00000000..1a7c9261 --- /dev/null +++ b/tests-m32/inotify_init1.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of inotify_init1 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/ioctl.c b/tests-m32/ioctl.c new file mode 100644 index 00000000..92a3191d --- /dev/null +++ b/tests-m32/ioctl.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_LINUX_MMTIMER_H +# include +#endif +#ifdef HAVE_LINUX_HIDDEV_H +# include +#endif +#ifdef HAVE_LINUX_INPUT_H +# include +#endif + +#include + +#if defined MMTIMER_GETRES \ + && defined VIDIOC_ENUMINPUT \ + && defined HIDIOCGVERSION \ + && defined HIDIOCGPHYS \ + && defined EVIOCGBIT \ + && defined EV_KEY + +int +main(void ) +{ + uint64_t data = 0; + +#ifndef POWERPC + struct termios tty; + (void) ioctl(-1, TCGETS, &tty); + printf("ioctl(-1, TCGETS, %p)" + " = -1 EBADF (%m)\n", &tty); +#endif + + (void) ioctl(-1, MMTIMER_GETRES, &data); + printf("ioctl(-1, MMTIMER_GETRES, %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, VIDIOC_ENUMINPUT, 0); + printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL)" + " = -1 EBADF (%m)\n"); + + (void) ioctl(-1, HIDIOCGVERSION, &data); + printf("ioctl(-1, HIDIOCGRDESCSIZE or HIDIOCGVERSION, %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, HIDIOCGPHYS(8), &data); + printf("ioctl(-1, HIDIOCGPHYS(8), %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, EVIOCGBIT(EV_KEY, 8), &data); + printf("ioctl(-1, EVIOCGBIT(EV_KEY, 8), %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, _IOR('M', 13, int), &data); + printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, [MTD_OTP_OFF])" + " = -1 EBADF (%m)\n"); + + (void) ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), (kernel_ulong_t) -1ULL); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), %#lx)" + " = -1 EBADF (%m)\n", -1UL); + + (void) ioctl(-1, _IOR(0xde, 0xad, data), &data); + printf("ioctl(-1, _IOC(_IOC_READ, 0xde, 0xad, 0x8), %p)" + " = -1 EBADF (%m)\n", &data); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("MMTIMER_GETRES && VIDIOC_ENUMINPUT" + " && HIDIOCGVERSION && HIDIOCGPHYS" + " && EVIOCGBIT && EV_KEY") + +#endif diff --git a/tests-m32/ioctl.test b/tests-m32/ioctl.test new file mode 100755 index 00000000..94bc5d42 --- /dev/null +++ b/tests-m32/ioctl.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check ioctl syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-m32/ioctl_block.c b/tests-m32/ioctl_block.c new file mode 100644 index 00000000..f62b0b36 --- /dev/null +++ b/tests-m32/ioctl_block.c @@ -0,0 +1,203 @@ +/* + * This file is part of ioctl_block strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_STRUCT_BLK_USER_TRACE_SETUP +# include +#endif +#include "xlat.h" + +static const unsigned int magic = 0xdeadbeef; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +static struct xlat block_argless[] = { + XLAT(BLKRRPART), + XLAT(BLKFLSBUF), +#ifdef BLKTRACESTART + XLAT(BLKTRACESTART), +#endif +#ifdef BLKTRACESTOP + XLAT(BLKTRACESTOP), +#endif +#ifdef BLKTRACETEARDOWN + XLAT(BLKTRACETEARDOWN), +#endif +}; + +#define TEST_NULL_ARG(cmd) \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) + +int +main(void) +{ + TEST_NULL_ARG(BLKBSZGET); + TEST_NULL_ARG(BLKBSZSET); + TEST_NULL_ARG(BLKFRAGET); + TEST_NULL_ARG(BLKGETSIZE); + TEST_NULL_ARG(BLKGETSIZE64); + TEST_NULL_ARG(BLKPG); + TEST_NULL_ARG(BLKRAGET); + TEST_NULL_ARG(BLKROGET); + TEST_NULL_ARG(BLKROSET); + TEST_NULL_ARG(BLKSECTGET); + TEST_NULL_ARG(BLKSECTGET); + TEST_NULL_ARG(BLKSSZGET); +#ifdef BLKALIGNOFF + TEST_NULL_ARG(BLKALIGNOFF); +#endif +#ifdef BLKDISCARD + TEST_NULL_ARG(BLKDISCARD); +#endif +#ifdef BLKDISCARDZEROES + TEST_NULL_ARG(BLKDISCARDZEROES); +#endif +#ifdef BLKIOMIN + TEST_NULL_ARG(BLKIOMIN); +#endif +#ifdef BLKIOOPT + TEST_NULL_ARG(BLKIOOPT); +#endif +#ifdef BLKPBSZGET + TEST_NULL_ARG(BLKPBSZGET); +#endif +#ifdef BLKROTATIONAL + TEST_NULL_ARG(BLKROTATIONAL); +#endif +#ifdef BLKSECDISCARD + TEST_NULL_ARG(BLKSECDISCARD); +#endif +#ifdef BLKZEROOUT + TEST_NULL_ARG(BLKZEROOUT); +#endif +#if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP + TEST_NULL_ARG(BLKTRACESETUP); +#endif + + ioctl(-1, BLKRASET, lmagic); + printf("ioctl(-1, BLKRASET, %lu) = -1 EBADF (%m)\n", lmagic); + + ioctl(-1, BLKFRASET, lmagic); + printf("ioctl(-1, BLKFRASET, %lu) = -1 EBADF (%m)\n", lmagic); + + int *const val_int = tail_alloc(sizeof(*val_int)); + *val_int = magic; + + ioctl(-1, BLKROSET, val_int); + printf("ioctl(-1, BLKROSET, [%d]) = -1 EBADF (%m)\n", *val_int); + + ioctl(-1, BLKBSZSET, val_int); + printf("ioctl(-1, BLKBSZSET, [%d]) = -1 EBADF (%m)\n", *val_int); + + uint64_t *pair_int64 = tail_alloc(sizeof(*pair_int64) * 2); + pair_int64[0] = 0xdeadbeefbadc0dedULL; + pair_int64[1] = 0xfacefeedcafef00dULL; + +#ifdef BLKDISCARD + ioctl(-1, BLKDISCARD, pair_int64); + printf("ioctl(-1, BLKDISCARD, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + +#ifdef BLKSECDISCARD + ioctl(-1, BLKSECDISCARD, pair_int64); + printf("ioctl(-1, BLKSECDISCARD, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + +#ifdef BLKZEROOUT + ioctl(-1, BLKZEROOUT, pair_int64); + printf("ioctl(-1, BLKZEROOUT, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + + struct blkpg_ioctl_arg *const blkpg = tail_alloc(sizeof(*blkpg)); + blkpg->op = 3; + blkpg->flags = 0xdeadbeef; + blkpg->datalen = 0xbadc0ded; + blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeedULL; + + ioctl(-1, BLKPG, blkpg); + printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + ", data=%#lx}) = -1 EBADF (%m)\n", + "BLKPG_RESIZE_PARTITION", blkpg->flags, blkpg->datalen, + (unsigned long) blkpg->data); + + struct blkpg_partition *const bp = tail_alloc(sizeof(*bp)); + bp->start = 0xfac1fed2dad3bef4ULL; + bp->length = 0xfac5fed6dad7bef8ULL; + bp->pno = magic; + memset(bp->devname, 'A', sizeof(bp->devname)); + memset(bp->volname, 'B', sizeof(bp->volname)); + blkpg->op = 1; + blkpg->data = bp; + + ioctl(-1, BLKPG, blkpg); + printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + ", data={start=%lld, length=%lld, pno=%d" + ", devname=\"%.*s\", volname=\"%.*s\"}})" + " = -1 EBADF (%m)\n", + "BLKPG_ADD_PARTITION", + blkpg->flags, blkpg->datalen, + bp->start, bp->length, bp->pno, + (int) sizeof(bp->devname) - 1, bp->devname, + (int) sizeof(bp->volname) - 1, bp->volname); + +#if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP + struct blk_user_trace_setup *const buts = tail_alloc(sizeof(*buts)); + fill_memory(buts, sizeof(*buts)); + + ioctl(-1, BLKTRACESETUP, buts); + printf("ioctl(-1, BLKTRACESETUP, {act_mask=%hu, buf_size=%u, buf_nr=%u" + ", start_lba=%" PRI__u64 ", end_lba=%" PRI__u64 ", pid=%u})" + " = -1 EBADF (%m)\n", + buts->act_mask, buts->buf_size, buts->buf_nr, + buts->start_lba, buts->end_lba, buts->pid); +#endif + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(block_argless); ++i) { + ioctl(-1, (unsigned long) block_argless[i].val, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", block_argless[i].str); + } + + ioctl(-1, _IOC(_IOC_READ, 0x12, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ, 0x12, 0xfe, 0xff)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_block.test b/tests-m32/ioctl_block.test new file mode 100755 index 00000000..0bf2500f --- /dev/null +++ b/tests-m32/ioctl_block.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of BLK* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_dm-v.c b/tests-m32/ioctl_dm-v.c new file mode 100644 index 00000000..d95058f2 --- /dev/null +++ b/tests-m32/ioctl_dm-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_dm.c" diff --git a/tests-m32/ioctl_dm-v.test b/tests-m32/ioctl_dm-v.test new file mode 100755 index 00000000..ade3b9e8 --- /dev/null +++ b/tests-m32/ioctl_dm-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check unabbreviated decoding of DM* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -s9 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_dm.c b/tests-m32/ioctl_dm.c new file mode 100644 index 00000000..08f036c6 --- /dev/null +++ b/tests-m32/ioctl_dm.c @@ -0,0 +1,774 @@ +/* + * Check decoding of DM_* commands of ioctl syscall. + * + * Copyright (c) 2016 Mikulas Patocka + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_DM_IOCTL_H + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" + +# define ALIGNED_SIZE(s_, t_) \ + (((s_) + (ALIGNOF(t_) - 1UL)) & ~(ALIGNOF(t_) - 1UL)) +# define ALIGNED_OFFSET(t_, m_) \ + ALIGNED_SIZE(offsetof(t_, m_), t_) + +static const char str129[] = STR32 STR32 STR32 STR32 "6"; + +static const __u64 dts_sector_base = (__u64) 0xdeadca75facef157ULL; +static const __u64 dts_sector_step = (__u64) 0x100000001ULL; +static const __u64 dts_length_base = (__u64) 0xbadc0dedda7a1057ULL; +static const __u64 dts_length_step = (__u64) 0x700000007ULL; +static const __s32 dts_status_base = (__s32) 3141592653U; +static const __s32 dts_status_step = 0x1234; + +static const size_t min_sizeof_dm_ioctl = + offsetof(struct dm_ioctl, data); + +static struct s { + struct dm_ioctl ioc; + union { + struct { + struct dm_target_spec target_spec; + char target_params[256]; + } ts; + struct { + struct dm_target_msg target_msg; + char target_string[256]; + } tm; + char string[256]; + } u; +} s; + +struct dm_table_open_test { + struct dm_ioctl ioc; + struct dm_target_spec target0; + char param0[1]; + struct dm_target_spec target1; + char param1[2]; + struct dm_target_spec target2; + char param2[3]; + struct dm_target_spec target3; + char param3[4]; + struct dm_target_spec target4; + char param4[5]; + struct dm_target_spec target5; + char param5[6]; + struct dm_target_spec target6; + char param6[7]; + struct dm_target_spec target7; + char param7[8]; + struct dm_target_spec target8; + char param8[9]; + struct dm_target_spec target9; + char param9[10]; +}; + +struct dm_target_msg_test { + struct dm_ioctl ioc; + struct dm_target_msg msg; +}; + +struct args { + unsigned int arg; + const char *str; + bool has_params; + bool has_event_nr; +}; + + +static void +init_s(struct dm_ioctl *s, size_t size, size_t offs) +{ + memset(s, 0, size); + s->version[0] = DM_VERSION_MAJOR; + s->version[1] = 1; + s->version[2] = 2; + s->data_size = size; + s->data_start = offs; + s->dev = 0x1234; + strcpy(s->name, "nnn"); + strcpy(s->uuid, "uuu"); +} + +static void +init_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) +{ + ptr->sector_start = dts_sector_base + dts_sector_step * id; + ptr->length = dts_length_base + dts_length_step * id; + ptr->status = dts_status_base + dts_status_step * id; + + strncpy(ptr->target_type, str129 + + id % (sizeof(str129) - sizeof(ptr->target_type)), + id % (sizeof(ptr->target_type) + 1)); + if (id % (sizeof(ptr->target_type) + 1) < sizeof(ptr->target_type)) + ptr->target_type[id % (sizeof(ptr->target_type) + 1)] = '\0'; +} + +# if VERBOSE +static void +print_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) +{ + printf("{sector_start=%" PRI__u64 ", length=%" PRI__u64 ", " + "target_type=\"%.*s\", string=", + dts_sector_base + dts_sector_step * id, + dts_length_base + dts_length_step * id, + (int) (id % (sizeof(ptr->target_type) + 1)), + str129 + id % (sizeof(str129) - sizeof(ptr->target_type))); +} +# endif /* VERBOSE */ + +int +main(void) +{ + static kernel_ulong_t dummy_dm_ioctl1 = + _IOC(_IOC_READ, DM_IOCTL, 0, 0x1fff); + static kernel_ulong_t dummy_dm_ioctl2 = + _IOC(_IOC_READ|_IOC_WRITE, DM_IOCTL, 0xed, 0); + static kernel_ulong_t dummy_dm_arg = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + /* We can't check these properly for now */ + static struct args dummy_check_cmds_nodev[] = { + { ARG_STR(DM_REMOVE_ALL), false }, + { ARG_STR(DM_LIST_DEVICES), true }, + { ARG_STR(DM_LIST_VERSIONS), true }, + }; + static struct args dummy_check_cmds[] = { + { ARG_STR(DM_DEV_CREATE), false }, + { ARG_STR(DM_DEV_REMOVE), false, true }, + { ARG_STR(DM_DEV_STATUS), false }, + { ARG_STR(DM_DEV_WAIT), true, true }, + { ARG_STR(DM_TABLE_CLEAR), false }, + { ARG_STR(DM_TABLE_DEPS), true }, + { ARG_STR(DM_TABLE_STATUS), true }, + }; + + struct dm_ioctl *unaligned_dm_arg = + tail_alloc(offsetof(struct dm_ioctl, data)); + struct dm_ioctl *dm_arg = + tail_alloc(ALIGNED_OFFSET(struct dm_ioctl, data)); + struct dm_table_open_test *dm_arg_open1 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, target1)); + struct dm_table_open_test *dm_arg_open2 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, param1)); + struct dm_table_open_test *dm_arg_open3 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, target9)); + struct dm_target_msg_test *dm_arg_msg = + tail_alloc(sizeof(*dm_arg_msg)); + + long rc; + const char *errstr; + unsigned int i; + + + /* Incorrect operation */ + ioctl(-1, _IOW(DM_IOCTL, 0xde, int), dm_arg); + printf("ioctl(-1, _IOC(_IOC_WRITE, %#x, 0xde, %#zx), %p) = " + "-1 EBADF (%m)\n", + DM_IOCTL, sizeof(int), dm_arg); + + ioctl(-1, dummy_dm_ioctl1, 0); + printf("ioctl(-1, _IOC(_IOC_READ, %#x, 0, %#x), 0) = -1 EBADF (%m)\n", + DM_IOCTL, (unsigned int) _IOC_SIZE(dummy_dm_ioctl1)); + + ioctl(-1, dummy_dm_ioctl2, dummy_dm_arg); + printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, %#x, %#x, 0), %#lx) = " + "-1 EBADF (%m)\n", + DM_IOCTL, (unsigned int) _IOC_NR(dummy_dm_ioctl2), + (unsigned long) dummy_dm_arg); + + + /* DM_VERSION */ + /* Incorrect pointer */ + ioctl(-1, DM_VERSION, dm_arg + 1); + printf("ioctl(-1, DM_VERSION, %p) = -1 EBADF (%m)\n", dm_arg + 1); + + /* Incorrect data_size */ + init_s(dm_arg, 0, 0); + ioctl(-1, DM_VERSION, &s); + printf("ioctl(-1, DM_VERSION, %p) = -1 EBADF (%m)\n", &s); + + /* Incorrect version */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->version[0] = 0xbadc0ded; + dm_arg->version[1] = 0xbadc0dee; + dm_arg->version[2] = 0xbadc0def; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u, " + "/* Unsupported device mapper ABI version */ ...}) = " + "-1 EBADF (%m)\n", 0xbadc0ded, 0xbadc0dee, 0xbadc0def); + + /* Incorrect data_size */ + init_s(dm_arg, 14, 64); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14, " + "/* Incorrect data_size */ ...}) = -1 EBADF (%m)\n"); + + /* Unterminated name/uuid */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + strncpy(dm_arg->name, str129, sizeof(dm_arg->name)); + strncpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"%.127s\", uuid=\"%.128s\", " + "flags=0}) = -1 EBADF (%m)\n", + min_sizeof_dm_ioctl, str129, str129); + + /* Normal call */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "-1 EBADF (%m)\n", min_sizeof_dm_ioctl); + + /* Zero dev, name, uuid */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->data_size = 0xfacefeed; + dm_arg->dev = 0; + dm_arg->name[0] = '\0'; + dm_arg->uuid[0] = '\0'; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%u, flags=0}) = " + "-1 EBADF (%m)\n", 0xfacefeed); + + /* Flag */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->flags = 0xffffffff; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=" + "DM_READONLY_FLAG|DM_SUSPEND_FLAG|DM_EXISTS_FLAG|" + "DM_PERSISTENT_DEV_FLAG|DM_STATUS_TABLE_FLAG|" + "DM_ACTIVE_PRESENT_FLAG|DM_INACTIVE_PRESENT_FLAG|" + "DM_BUFFER_FULL_FLAG|DM_SKIP_BDGET_FLAG|DM_SKIP_LOCKFS_FLAG|" + "DM_NOFLUSH_FLAG|DM_QUERY_INACTIVE_TABLE_FLAG|" + "DM_UEVENT_GENERATED_FLAG|DM_UUID_FLAG|DM_SECURE_DATA_FLAG|" + "DM_DATA_OUT_FLAG|DM_DEFERRED_REMOVE|DM_INTERNAL_SUSPEND_FLAG|" + "0xfff80080}) = -1 EBADF (%m)\n", + min_sizeof_dm_ioctl); + + /* Normal call */ + init_s(&s.ioc, sizeof(s.ioc), 0); + ioctl(-1, DM_VERSION, &s); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "-1 EBADF (%m)\n", sizeof(s.ioc)); + + + /* DM_REMOVE_ALL */ + /* DM_LIST_DEVICES */ + /* DM_LIST_VERSIONS */ + for (i = 0; i < ARRAY_SIZE(dummy_check_cmds_nodev); i++) { + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, dummy_check_cmds_nodev[i].arg, dm_arg); + printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " + "flags=0}) = -1 EBADF (%m)\n", + dummy_check_cmds_nodev[i].str, + min_sizeof_dm_ioctl, + dummy_check_cmds_nodev[i].has_params ? + ", data_start=0" : ""); + } + + + /* DM_DEV_CREATE */ + /* DM_DEV_REMOVE */ + /* DM_DEV_STATUS */ + /* DM_DEV_WAIT */ + /* DM_TABLE_CLEAR */ + /* DM_TABLE_DEPS */ + /* DM_TABLE_STATUS */ + for (i = 0; i < ARRAY_SIZE(dummy_check_cmds); i++) { + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, dummy_check_cmds[i].arg, dm_arg); + printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\"%s, " + "flags=0}) = -1 EBADF (%m)\n", + dummy_check_cmds[i].str, min_sizeof_dm_ioctl, + dummy_check_cmds[i].has_params ? ", data_start=0" : "", + dummy_check_cmds[i].has_event_nr ? ", event_nr=0" : ""); + } + + + /* DM_DEV_SUSPEND */ + init_s(&s.ioc, sizeof(s.ioc), 0); + s.ioc.flags = DM_SUSPEND_FLAG; + s.ioc.event_nr = 0xbadc0ded; + ioctl(-1, DM_DEV_SUSPEND, &s); + printf("ioctl(-1, DM_DEV_SUSPEND, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "flags=DM_SUSPEND_FLAG}) = -1 EBADF (%m)\n", sizeof(s.ioc)); + + init_s(&s.ioc, sizeof(s.ioc), 0); + s.ioc.event_nr = 0xbadc0ded; + ioctl(-1, DM_DEV_SUSPEND, &s); + printf("ioctl(-1, DM_DEV_SUSPEND, " + "{version=4.1.2, data_size=%zu, dev=makedev(18, 52), " + "name=\"nnn\", uuid=\"uuu\", event_nr=3134983661, " + "flags=0}) = -1 EBADF (%m)\n", sizeof(s.ioc)); + + + /* DM_TABLE_LOAD */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.target_count = 1; + s.u.ts.target_spec.sector_start = 0x10; + s.u.ts.target_spec.length = 0x20; + s.u.ts.target_spec.next = + sizeof(s.u.ts.target_spec) + sizeof(s.u.ts.target_params); + strcpy(s.u.ts.target_spec.target_type, "tgt"); + strcpy(s.u.ts.target_params, "tparams"); + ioctl(-1, DM_TABLE_LOAD, &s); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=1, flags=0, " +# if VERBOSE + "{sector_start=16, length=32, target_type=\"tgt\", " + "string=\"tparams\"}" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", s.ioc.data_size, s.ioc.data_start); + + /* No targets */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + dm_arg->target_count = 0; + ioctl(-1, DM_TABLE_LOAD, dm_arg); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=0, flags=0}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), min_sizeof_dm_ioctl); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0xfffffff8); + dm_arg->data_size = sizeof(*dm_arg); + dm_arg->target_count = 1234; + ioctl(-1, DM_TABLE_LOAD, dm_arg); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=1234, flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_spec */ ..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", sizeof(*dm_arg), 0xfffffff8); + + /* Inaccessible pointer */ + init_s(&dm_arg_open1->ioc, offsetof(struct dm_table_open_test, target1), + offsetof(struct dm_table_open_test, target1)); + dm_arg_open1->ioc.data_size = sizeof(*dm_arg_open1); + dm_arg_open1->ioc.target_count = 0xdeaddea1; + ioctl(-1, DM_TABLE_LOAD, dm_arg_open1); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=3735936673, flags=0, " +# if VERBOSE + "%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", sizeof(*dm_arg_open1), + offsetof(struct dm_table_open_test, target1) +# if VERBOSE + , (char *) dm_arg_open1 + + offsetof(struct dm_table_open_test, target1) +# endif /* VERBOSE */ + ); + + /* Inaccessible string */ + init_s(&dm_arg_open2->ioc, offsetof(struct dm_table_open_test, param1), + offsetof(struct dm_table_open_test, target1)); + dm_arg_open2->ioc.data_size = sizeof(*dm_arg_open2); + dm_arg_open2->ioc.target_count = 2; + init_dm_target_spec(&dm_arg_open2->target1, 7); + dm_arg_open2->target1.next = + offsetof(struct dm_table_open_test, target3) - + offsetof(struct dm_table_open_test, target1); + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open2); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=2, flags=0, ", + sizeof(*dm_arg_open2), + offsetof(struct dm_table_open_test, target1)); +# if VERBOSE + print_dm_target_spec(&dm_arg_open2->target1, 7); + printf("%p}, %p", + (char *) dm_arg_open2 + + offsetof(struct dm_table_open_test, param1), + (char *) dm_arg_open2 + + offsetof(struct dm_table_open_test, target3)); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + /* Incorrect next */ + init_s(&dm_arg_open3->ioc, offsetof(struct dm_table_open_test, target5), + offsetof(struct dm_table_open_test, target0)); + dm_arg_open3->ioc.target_count = 4; + + init_dm_target_spec(&dm_arg_open3->target0, 9); + dm_arg_open3->target0.next = + offsetof(struct dm_table_open_test, target1) - + offsetof(struct dm_table_open_test, target0); + dm_arg_open3->param0[0] = '\0'; + + init_dm_target_spec(&dm_arg_open3->target1, 15); + dm_arg_open3->target1.next = + offsetof(struct dm_table_open_test, target3) - + offsetof(struct dm_table_open_test, target1); + dm_arg_open3->param1[0] = '\377'; + dm_arg_open3->param1[1] = '\0'; + + init_dm_target_spec(&dm_arg_open3->target3, 42); + dm_arg_open3->target3.next = 0xdeadbeef; + dm_arg_open3->param3[0] = '\1'; + dm_arg_open3->param3[1] = '\2'; + dm_arg_open3->param3[2] = '\0'; + + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open3); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=4, flags=0, ", + offsetof(struct dm_table_open_test, target5), + offsetof(struct dm_table_open_test, target0)); +# if VERBOSE + print_dm_target_spec(&dm_arg_open3->target0, 9); + printf("\"\"}, "); + print_dm_target_spec(&dm_arg_open3->target1, 15); + printf("\"\\377\"}, "); + print_dm_target_spec(&dm_arg_open3->target1, 42); + printf("\"\\1\\2\"}, /* misplaced struct dm_target_spec */ ..."); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + #define FILL_DM_TARGET(id, id_next) \ + do { \ + init_dm_target_spec(&dm_arg_open3->target##id, id); \ + dm_arg_open3->target##id.next = \ + offsetof(struct dm_table_open_test, \ + target##id_next) - \ + offsetof(struct dm_table_open_test, \ + target##id); \ + strncpy(dm_arg_open3->param##id, str129 + id * 2, id); \ + dm_arg_open3->param##id[id] = '\0'; \ + } while (0) + #define PRINT_DM_TARGET(id) \ + do { \ + print_dm_target_spec(&dm_arg_open3->target##id, id); \ + printf("\"%.*s\"}, ", id, str129 + id * 2); \ + } while (0) + + /* max_strlen limit */ + init_s(&dm_arg_open3->ioc, offsetof(struct dm_table_open_test, target9), + offsetof(struct dm_table_open_test, target0)); + dm_arg_open3->ioc.data_size = sizeof(*dm_arg_open3); + dm_arg_open3->ioc.target_count = 0xbadc0ded; + FILL_DM_TARGET(0, 1); + FILL_DM_TARGET(1, 2); + FILL_DM_TARGET(2, 3); + FILL_DM_TARGET(3, 4); + FILL_DM_TARGET(4, 5); + FILL_DM_TARGET(5, 6); + FILL_DM_TARGET(6, 7); + FILL_DM_TARGET(7, 8); + FILL_DM_TARGET(8, 9); + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open3); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=3134983661, flags=0, ", + sizeof(*dm_arg_open3), + offsetof(struct dm_table_open_test, target0)); +# if VERBOSE + PRINT_DM_TARGET(0); + PRINT_DM_TARGET(1); + PRINT_DM_TARGET(2); + PRINT_DM_TARGET(3); + PRINT_DM_TARGET(4); + PRINT_DM_TARGET(5); + PRINT_DM_TARGET(6); + PRINT_DM_TARGET(7); + PRINT_DM_TARGET(8); +# endif /* VERBOSE */ + printf("...}) = %s\n", errstr); + + + /* DM_TARGET_MSG */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.u.tm.target_msg.sector = 0x1234; + strcpy(s.u.string + offsetof(struct dm_target_msg, message), + "long target msg"); + ioctl(-1, DM_TARGET_MSG, &s); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "{sector=4660, message=\"long targ\"...}" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_msg */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), min_sizeof_dm_ioctl); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0xffffffff); + dm_arg->data_size = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_msg */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), 0xffffffff); + + /* Inaccessible pointer */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->data_size = sizeof(*dm_arg) + sizeof(struct dm_target_msg); + dm_arg->data_start = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg) + sizeof(struct dm_target_msg), + sizeof(*dm_arg) +# if VERBOSE + , (char *) dm_arg + sizeof(*dm_arg) +# endif /* VERBOSE */ + ); + + /* Inaccessible string */ + init_s(&dm_arg_msg->ioc, sizeof(*dm_arg_msg), + offsetof(struct dm_target_msg_test, msg)); + dm_arg_msg->ioc.data_size = sizeof(*dm_arg_msg) + 1; + dm_arg_msg->msg.sector = (__u64) 0xdeadbeeffacef157ULL; + rc = ioctl(-1, DM_TARGET_MSG, dm_arg_msg); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + sizeof(*dm_arg_msg) + 1, + offsetof(struct dm_target_msg_test, msg)); +# if VERBOSE + printf("{sector=%" PRI__u64 ", message=%p}", + (__u64) 0xdeadbeeffacef157ULL, + (char *) dm_arg_msg + + offsetof(struct dm_target_msg_test, msg.message)); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + /* Zero-sied string */ + init_s(&dm_arg_msg->ioc, sizeof(*dm_arg_msg), + offsetof(struct dm_target_msg_test, msg)); + dm_arg_msg->msg.sector = (__u64) 0xdeadbeeffacef157ULL; + rc = ioctl(-1, DM_TARGET_MSG, dm_arg_msg); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + sizeof(*dm_arg_msg), offsetof(struct dm_target_msg_test, msg)); +# if VERBOSE + printf("{sector=%" PRI__u64 ", message=\"\"}", + (__u64) 0xdeadbeeffacef157ULL); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + + /* DM_DEV_SET_GEOMETRY */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + strcpy(s.u.string, "10 20 30 40"); + ioctl(-1, DM_DEV_SET_GEOMETRY, &s); + printf("ioctl(-1, DM_DEV_SET_GEOMETRY, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "string=\"10 20 30 \"..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + + /* DM_DEV_RENAME */ + /* Inaccessible data */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + memcpy(unaligned_dm_arg, dm_arg, offsetof(struct dm_ioctl, data)); + ioctl(-1, DM_DEV_RENAME, unaligned_dm_arg); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*unaligned_dm_arg), min_sizeof_dm_ioctl +# if VERBOSE + , (char *) unaligned_dm_arg + min_sizeof_dm_ioctl +# endif /* VERBOSE */ + ); + + /* Incorrect data_start data */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.data_start = 0xdeadbeef; + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=3735928559, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "/* misplaced string */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size); + + /* Strange but still valid data_start */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + /* Curiously, this is a valid structure */ + s.ioc.data_start = offsetof(struct dm_ioctl, name) + 1; + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=\"nn\"" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, + offsetof(struct dm_ioctl, name) + 1); + + /* Correct data */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + strcpy(s.u.string, "new long name"); + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=\"new long \"..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + + /* DM_TABLE_LOAD */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.target_count = -1U; + ioctl(-1, DM_TABLE_LOAD, &s); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=4294967295, flags=0, " +# if VERBOSE + "{sector_start=0, length=0, target_type=\"\", string=\"\"}, " + "/* misplaced struct dm_target_spec */ " +# endif /* VERBOSE */ + "...}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else /* !HAVE_LINUX_DM_IOCTL_H */ + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_DM_IOCTL_H") + +#endif /* HAVE_LINUX_DM_IOCTL_H */ diff --git a/tests-m32/ioctl_dm.test b/tests-m32/ioctl_dm.test new file mode 100755 index 00000000..64852051 --- /dev/null +++ b/tests-m32/ioctl_dm.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of DM* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -s9 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_evdev-v.c b/tests-m32/ioctl_evdev-v.c new file mode 100644 index 00000000..3860716b --- /dev/null +++ b/tests-m32/ioctl_evdev-v.c @@ -0,0 +1,3 @@ +/* This file is part of ioctl_evdev-v strace test. */ +#define VERBOSE 1 +#include "ioctl_evdev.c" diff --git a/tests-m32/ioctl_evdev-v.test b/tests-m32/ioctl_evdev-v.test new file mode 100755 index 00000000..87941010 --- /dev/null +++ b/tests-m32/ioctl_evdev-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check verbose decoding EVIOC* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_evdev.c b/tests-m32/ioctl_evdev.c new file mode 100644 index 00000000..d12323ee --- /dev/null +++ b/tests-m32/ioctl_evdev.c @@ -0,0 +1,278 @@ +/* + * This file is part of ioctl_evdev strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_INPUT_H + +# include +# include +# include +# include +# include +# include + +static const unsigned int magic = 0xdeadbeef; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +# if VERBOSE +static void +print_envelope(const struct ff_envelope *const e) +{ + printf(", envelope={attack_length=%hu, attack_level=%hu" + ", fade_length=%hu, fade_level=%#hx}", + e->attack_length, e->attack_level, + e->fade_length, e->fade_level); +} +# endif /* VERBOSE */ + +static void +print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) +{ + printf("ioctl(-1, EVIOCSFF, {type=%s, id=%" PRIu16 + ", direction=%" PRIu16 ", ", + type_str, ffe->id, ffe->direction); +# if VERBOSE + printf("trigger={button=%hu, interval=%hu}" + ", replay={length=%hu, delay=%hu}", + ffe->trigger.button, ffe->trigger.interval, + ffe->replay.length, ffe->replay.delay); +# endif /* VERBOSE */ +} + +# define TEST_NULL_ARG(cmd) \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) + +int +main(void) +{ + TEST_NULL_ARG(EVIOCGVERSION); + TEST_NULL_ARG(EVIOCGEFFECTS); + TEST_NULL_ARG(EVIOCGID); + TEST_NULL_ARG(EVIOCGKEYCODE); + TEST_NULL_ARG(EVIOCSKEYCODE); + TEST_NULL_ARG(EVIOCSFF); +# ifdef EVIOCGKEYCODE_V2 + TEST_NULL_ARG(EVIOCGKEYCODE_V2); +# endif +# ifdef EVIOCSKEYCODE_V2 + TEST_NULL_ARG(EVIOCSKEYCODE_V2); +# endif +# ifdef EVIOCGREP + TEST_NULL_ARG(EVIOCGREP); +# endif +# ifdef EVIOCSREP + TEST_NULL_ARG(EVIOCSREP); +# endif +# ifdef EVIOCSCLOCKID + TEST_NULL_ARG(EVIOCSCLOCKID); +# endif + + TEST_NULL_ARG(EVIOCGNAME(0)); + TEST_NULL_ARG(EVIOCGPHYS(0)); + TEST_NULL_ARG(EVIOCGUNIQ(0)); + TEST_NULL_ARG(EVIOCGKEY(0)); + TEST_NULL_ARG(EVIOCGLED(0)); +# ifdef EVIOCGMTSLOTS + TEST_NULL_ARG(EVIOCGMTSLOTS(0)); +# endif +# ifdef EVIOCGPROP + TEST_NULL_ARG(EVIOCGPROP(0)); +# endif + TEST_NULL_ARG(EVIOCGSND(0)); +# ifdef EVIOCGSW + TEST_NULL_ARG(EVIOCGSW(0)); +# endif + + TEST_NULL_ARG(EVIOCGABS(ABS_X)); + TEST_NULL_ARG(EVIOCSABS(ABS_X)); + + TEST_NULL_ARG(EVIOCGBIT(EV_SYN, 0)); + TEST_NULL_ARG(EVIOCGBIT(EV_KEY, 1)); + TEST_NULL_ARG(EVIOCGBIT(EV_REL, 2)); + TEST_NULL_ARG(EVIOCGBIT(EV_ABS, 3)); + TEST_NULL_ARG(EVIOCGBIT(EV_MSC, 4)); +# ifdef EV_SW + TEST_NULL_ARG(EVIOCGBIT(EV_SW, 5)); +# endif + TEST_NULL_ARG(EVIOCGBIT(EV_LED, 6)); + TEST_NULL_ARG(EVIOCGBIT(EV_SND, 7)); + TEST_NULL_ARG(EVIOCGBIT(EV_REP, 8)); + TEST_NULL_ARG(EVIOCGBIT(EV_FF, 9)); + TEST_NULL_ARG(EVIOCGBIT(EV_PWR, 10)); + TEST_NULL_ARG(EVIOCGBIT(EV_FF_STATUS, 11)); + + ioctl(-1, EVIOCGBIT(EV_MAX, 42), 0); + printf("ioctl(-1, EVIOCGBIT(%#x /* EV_??? */, 42), NULL)" + " = -1 EBADF (%m)\n", EV_MAX); + + ioctl(-1, EVIOCRMFF, lmagic); + printf("ioctl(-1, EVIOCRMFF, %d) = -1 EBADF (%m)\n", (int) lmagic); + + ioctl(-1, EVIOCGRAB, lmagic); + printf("ioctl(-1, EVIOCGRAB, %lu) = -1 EBADF (%m)\n", lmagic); + +# ifdef EVIOCREVOKE + ioctl(-1, EVIOCREVOKE, lmagic); + printf("ioctl(-1, EVIOCREVOKE, %lu) = -1 EBADF (%m)\n", lmagic); +# endif + + const unsigned int size = get_page_size(); + void *const page = tail_alloc(size); + fill_memory(page, size); + + int *const val_int = tail_alloc(sizeof(*val_int)); + *val_int = magic; + +# ifdef EVIOCSCLOCKID + ioctl(-1, EVIOCSCLOCKID, val_int); + printf("ioctl(-1, EVIOCSCLOCKID, [%u]) = -1 EBADF (%m)\n", *val_int); +# endif + + int *pair_int = tail_alloc(sizeof(*pair_int) * 2); + pair_int[0] = 0xdeadbeef; + pair_int[1] = 0xbadc0ded; + +# ifdef EVIOSGREP + ioctl(-1, EVIOCSREP, pair_int); + printf("ioctl(-1, EVIOCSREP, [%u, %u]) = -1 EBADF (%m)\n", + pair_int[0], pair_int[1]); +# endif + + pair_int[1] = 1; + ioctl(-1, EVIOCSKEYCODE, pair_int); + printf("ioctl(-1, EVIOCSKEYCODE, [%u, %s]) = -1 EBADF (%m)\n", + pair_int[0], "KEY_ESC"); + +# ifdef EVIOCSKEYCODE_V2 + struct input_keymap_entry *const ike = tail_alloc(sizeof(*ike)); + fill_memory(ike, sizeof(*ike)); + ike->keycode = 2; + + ioctl(-1, EVIOCSKEYCODE_V2, ike); + printf("ioctl(-1, EVIOCSKEYCODE_V2, {flags=%" PRIu8 + ", len=%" PRIu8 ", ", ike->flags, ike->len); +# if VERBOSE + printf("index=%" PRIu16 ", keycode=%s, scancode=[", + ike->index, "KEY_1"); + unsigned int i; + for (i = 0; i < ARRAY_SIZE(ike->scancode); ++i) { + if (i > 0) + printf(", "); + printf("%" PRIx8, ike->scancode[i]); + } + printf("]"); +# else + printf("..."); +# endif + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); +# endif + + struct ff_effect *const ffe = tail_alloc(sizeof(*ffe)); + fill_memory(ffe, sizeof(*ffe)); + + ffe->type = FF_CONSTANT; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_CONSTANT"); + +# if VERBOSE + printf(", constant={level=%hd", ffe->u.constant.level); + print_envelope(&ffe->u.constant.envelope); + printf("}"); +# else + printf("..."); +# endif + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + +# if VERBOSE + ffe->type = FF_RAMP; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_RAMP"); + printf(", ramp={start_level=%hd, end_level=%hd", + ffe->u.ramp.start_level, ffe->u.ramp.end_level); + print_envelope(&ffe->u.ramp.envelope); + errno = EBADF; + printf("}}) = -1 EBADF (%m)\n"); + + ffe->type = FF_PERIODIC; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_PERIODIC"); + printf(", periodic={waveform=%hu, period=%hu, magnitude=%hd" + ", offset=%hd, phase=%hu", + ffe->u.periodic.waveform, ffe->u.periodic.period, + ffe->u.periodic.magnitude, ffe->u.periodic.offset, + ffe->u.periodic.phase); + print_envelope(&ffe->u.periodic.envelope); + printf(", custom_len=%u, custom_data=%p}", + ffe->u.periodic.custom_len, ffe->u.periodic.custom_data); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + ffe->type = FF_RUMBLE; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_RUMBLE"); + printf(", rumble={strong_magnitude=%hu, weak_magnitude=%hu}", + ffe->u.rumble.strong_magnitude, ffe->u.rumble.weak_magnitude); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + ffe->type = 0xff; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "0xff /* FF_??? */"); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); +# endif + + ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ, 0x45, 0x1, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_WRITE, 0x45, 0x1, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_WRITE, 0x45, 0x1, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x45, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x45, 0xfe, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x45, 0, 0), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x45, 0, 0)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_INPUT_H") + +#endif diff --git a/tests-m32/ioctl_evdev.test b/tests-m32/ioctl_evdev.test new file mode 100755 index 00000000..7ed2e98a --- /dev/null +++ b/tests-m32/ioctl_evdev.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of EVIOC* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_loop-nv.c b/tests-m32/ioctl_loop-nv.c new file mode 100644 index 00000000..dc6b916d --- /dev/null +++ b/tests-m32/ioctl_loop-nv.c @@ -0,0 +1,2 @@ +#define ABBREV 1 +#include "ioctl_loop.c" diff --git a/tests-m32/ioctl_loop-nv.test b/tests-m32/ioctl_loop-nv.test new file mode 100755 index 00000000..dcc27e1d --- /dev/null +++ b/tests-m32/ioctl_loop-nv.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check non-verbose decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -eioctl -e verbose=none $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_loop-v.c b/tests-m32/ioctl_loop-v.c new file mode 100644 index 00000000..22e75727 --- /dev/null +++ b/tests-m32/ioctl_loop-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_loop.c" diff --git a/tests-m32/ioctl_loop-v.test b/tests-m32/ioctl_loop-v.test new file mode 100755 index 00000000..ff3995d8 --- /dev/null +++ b/tests-m32/ioctl_loop-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check non-abbreviated decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -v -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_loop.c b/tests-m32/ioctl_loop.c new file mode 100644 index 00000000..a95e775d --- /dev/null +++ b/tests-m32/ioctl_loop.c @@ -0,0 +1,322 @@ +/* + * This file is part of ioctl_loop strace test. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "xlat/loop_cmds.h" + +#ifndef ABBREV +# define ABBREV 0 +#endif + +static void +print_loop_info(struct loop_info * const info, bool print_encrypt, + const char *encrypt_type, const char *encrypt_key, + const char *flags) +{ +#if ABBREV + printf("%p", info); +#else + printf("{lo_number=%d", info->lo_number); +# if VERBOSE + printf(", lo_device=makedev(%u, %u), lo_inode=%lu, " + "lo_rdevice=makedev(%u, %u)", + major(info->lo_device), minor(info->lo_device), + info->lo_inode, + major(info->lo_rdevice), minor(info->lo_rdevice)); +# endif /* VERBOSE */ + + printf(", lo_offset=%#x", info->lo_offset); + + if (VERBOSE || print_encrypt) { + printf(", lo_encrypt_type="); + if (encrypt_type) + printf("%s", encrypt_type); + else + printf("%#x /* LO_CRYPT_??? */", info->lo_encrypt_type); + + printf(", lo_encrypt_key_size=%" PRIu32, + (uint32_t) info->lo_encrypt_key_size); + } + + printf(", lo_flags="); + if (flags) + printf("%s", flags); + else + printf("%#x /* LO_FLAGS_??? */", info->lo_flags); + + printf(", lo_name=\"%.*s\"", + (int) sizeof(info->lo_name) - 1, info->lo_name); + + if (VERBOSE || print_encrypt) + printf(", lo_encrypt_key=\"%.*s\"", + encrypt_key ? (int) strlen(encrypt_key) : + (int) sizeof(info->lo_encrypt_key), + encrypt_key ? encrypt_key : + (char *) info->lo_encrypt_key); + +# if VERBOSE + printf(", lo_init=[%#lx, %#lx]" + ", reserved=[%#hhx, %#hhx, %#hhx, %#hhx]}", + info->lo_init[0], info->lo_init[1], + info->reserved[0], info->reserved[1], + info->reserved[2], info->reserved[3]); +# else /* !VERBOSE */ + printf(", ...}"); +# endif /* VERBOSE */ +#endif /* !ABBREV */ +} + +static void +print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, + const char *encrypt_type, const char *encrypt_key, + const char *flags) +{ +#if ABBREV + printf("%p", info64); +#else +# if VERBOSE + printf("{lo_device=makedev(%u, %u), lo_inode=%" PRIu64 + ", lo_rdevice=makedev(%u, %u), lo_offset=%#" PRIx64 + ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32, + major(info64->lo_device), minor(info64->lo_device), + (uint64_t) info64->lo_inode, + major(info64->lo_rdevice), minor(info64->lo_rdevice), + (uint64_t) info64->lo_offset, + (uint64_t) info64->lo_sizelimit, + (uint32_t) info64->lo_number); +# else /* !VERBOSE */ + printf("{lo_offset=%#" PRIx64 ", lo_number=%" PRIu32, + (uint64_t) info64->lo_offset, + (uint32_t) info64->lo_number); +# endif /* VERBOSE */ + + if (VERBOSE || print_encrypt) { + printf(", lo_encrypt_type="); + if (encrypt_type) + printf("%s", encrypt_type); + else + printf("%#x /* LO_CRYPT_??? */", + info64->lo_encrypt_type); + + printf(", lo_encrypt_key_size=%" PRIu32, + info64->lo_encrypt_key_size); + } + + printf(", lo_flags="); + if (flags) + printf("%s", flags); + else + printf("%#x /* LO_FLAGS_??? */", info64->lo_flags); + printf(", lo_file_name=\"%.*s\"", + (int) sizeof(info64->lo_file_name) - 1, info64->lo_file_name); + + if (VERBOSE || print_encrypt) + printf(", lo_crypt_name=\"%.*s\", lo_encrypt_key=\"%.*s\"", + (int) sizeof(info64->lo_crypt_name) - 1, + info64->lo_crypt_name, + encrypt_key ? (int) strlen(encrypt_key) : + (int) sizeof(info64->lo_encrypt_key), + encrypt_key ? encrypt_key : + (char *) info64->lo_encrypt_key); + +# if VERBOSE + printf(", lo_init=[%#" PRIx64 ", %#" PRIx64 "]}", + (uint64_t) info64->lo_init[0], + (uint64_t) info64->lo_init[1]); +# else /* !VERBOSE */ + printf(", ...}"); +# endif /* VERBOSE */ +#endif /* !ABBREV */ +} + +int +main(void) +{ + static const kernel_ulong_t unknown_loop_cmd = + (kernel_ulong_t) 0xbadc0dedfeed4cedULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const kernel_ulong_t kernel_mask = + ((kernel_ulong_t) -1) - ((unsigned long) -1L); + + struct loop_info * const info = tail_alloc(sizeof(*info)); + struct loop_info64 * const info64 = tail_alloc(sizeof(*info64)); + + /* Unknown loop commands */ + ioctl(-1, unknown_loop_cmd, magic); + printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x4c, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_loop_cmd) & _IOC_NONE ? + "|_IOC_NONE" : "", + _IOC_NR((unsigned int) unknown_loop_cmd), + _IOC_SIZE((unsigned int) unknown_loop_cmd), + (unsigned long) magic); + + ioctl(-1, LOOP_SET_DIRECT_IO + 1, magic); + printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + "-1 EBADF (%m)\n", + _IOC_NR(LOOP_SET_DIRECT_IO + 1), + _IOC_SIZE(LOOP_SET_DIRECT_IO + 1), + (unsigned long) magic); + + ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); + printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + "-1 EBADF (%m)\n", + _IOC_NR(LOOP_CTL_GET_FREE + 1), + _IOC_SIZE(LOOP_CTL_GET_FREE + 1), + (unsigned long) magic); + + /* LOOP_SET_FD */ + ioctl(-1, LOOP_SET_FD, magic); + printf("ioctl(-1, LOOP_SET_FD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CLR_FD */ + ioctl(-1, LOOP_CLR_FD); + printf("ioctl(-1, LOOP_CLR_FD) = -1 EBADF (%m)\n"); + + /* LOOP_SET_STATUS */ + ioctl(-1, LOOP_SET_STATUS, NULL); + printf("ioctl(-1, LOOP_SET_STATUS, NULL) = -1 EBADF (%m)\n"); + + fill_memory(info, sizeof(*info)); + info->lo_flags = 0xdeface00; + info->lo_name[0] = '\0'; + info->lo_encrypt_key[0] = '\0'; + info->lo_encrypt_key_size = 1; + + printf("ioctl(-1, LOOP_SET_STATUS, "); + print_loop_info(info, true, NULL, "\\0", NULL); + ioctl(-1, LOOP_SET_STATUS, info); + printf(") = -1 EBADF (%m)\n"); + + fill_memory(info, sizeof(*info)); + info->lo_encrypt_type = LO_CRYPT_NONE; + info->lo_flags = LO_FLAGS_READ_ONLY; + memset(info->lo_name, 'A', sizeof(info->lo_name)); + memset(info->lo_encrypt_key, 'B', sizeof(info->lo_encrypt_key)); + + ioctl(-1, LOOP_SET_STATUS, (void *) info + ALIGNOF(info)); + printf("ioctl(-1, LOOP_SET_STATUS, %p) = -1 EBADF (%m)\n", + (void *) info + ALIGNOF(info)); + + printf("ioctl(-1, LOOP_SET_STATUS, "); + print_loop_info(info, false, "LO_CRYPT_NONE", NULL, + "LO_FLAGS_READ_ONLY"); + ioctl(-1, LOOP_SET_STATUS, info); + printf(") = -1 EBADF (%m)\n"); + + /* LOOP_GET_STATUS */ + ioctl(-1, LOOP_GET_STATUS, NULL); + printf("ioctl(-1, LOOP_GET_STATUS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, LOOP_GET_STATUS, (unsigned long) info | kernel_mask); + printf("ioctl(-1, LOOP_GET_STATUS, %p) = -1 EBADF (%m)\n", info); + + /* LOOP_SET_STATUS64 */ + ioctl(-1, LOOP_SET_STATUS64, NULL); + printf("ioctl(-1, LOOP_SET_STATUS64, NULL) = -1 EBADF (%m)\n"); + + fill_memory(info64, sizeof(*info64)); + info64->lo_flags = 0xdec0de00; + info64->lo_file_name[0] = '\0'; + info64->lo_crypt_name[0] = '\0'; + info64->lo_encrypt_key[0] = '\0'; + info64->lo_encrypt_key_size = 1; + + printf("ioctl(-1, LOOP_SET_STATUS64, "); + print_loop_info64(info64, true, NULL, "\\0", NULL); + ioctl(-1, LOOP_SET_STATUS64, info64); + printf(") = -1 EBADF (%m)\n"); + + fill_memory(info64, sizeof(*info64)); + info64->lo_flags = LO_FLAGS_READ_ONLY; + info64->lo_encrypt_type = LO_CRYPT_NONE; + memset(info64->lo_file_name, 'C', sizeof(info64->lo_file_name)); + memset(info64->lo_crypt_name, 'D', sizeof(info64->lo_crypt_name)); + memset(info64->lo_encrypt_key, 'E', sizeof(info64->lo_encrypt_key)); + + ioctl(-1, LOOP_SET_STATUS64, (void *) info64 + ALIGNOF(info64)); + printf("ioctl(-1, LOOP_SET_STATUS64, %p) = -1 EBADF (%m)\n", + (void *) info64 + ALIGNOF(info64)); + + printf("ioctl(-1, LOOP_SET_STATUS64, "); + print_loop_info64(info64, false, "LO_CRYPT_NONE", NULL, + "LO_FLAGS_READ_ONLY"); + ioctl(-1, LOOP_SET_STATUS64, info64); + printf(") = -1 EBADF (%m)\n"); + + /* LOOP_GET_STATUS64 */ + ioctl(-1, LOOP_GET_STATUS64, NULL); + printf("ioctl(-1, LOOP_GET_STATUS64, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, LOOP_GET_STATUS64, (unsigned long) info64 | kernel_mask); + printf("ioctl(-1, LOOP_GET_STATUS64, %p) = -1 EBADF (%m)\n", info64); + + /* LOOP_CHANGE_FD */ + ioctl(-1, LOOP_CHANGE_FD, magic); + printf("ioctl(-1, LOOP_CHANGE_FD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_SET_CAPACITY */ + ioctl(-1, LOOP_SET_CAPACITY); + printf("ioctl(-1, LOOP_SET_CAPACITY) = -1 EBADF (%m)\n"); + + /* LOOP_SET_DIRECT_IO */ + ioctl(-1, LOOP_SET_DIRECT_IO, magic); + printf("ioctl(-1, LOOP_SET_DIRECT_IO, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + + /* LOOP_CTL_ADD */ + ioctl(-1, LOOP_CTL_ADD, magic); + printf("ioctl(-1, LOOP_CTL_ADD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CTL_REMOVE */ + ioctl(-1, LOOP_CTL_REMOVE, magic); + printf("ioctl(-1, LOOP_CTL_REMOVE, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CTL_GET_FREE */ + ioctl(-1, LOOP_CTL_GET_FREE); + printf("ioctl(-1, LOOP_CTL_GET_FREE) = -1 EBADF (%m)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_loop.test b/tests-m32/ioctl_loop.test new file mode 100755 index 00000000..112cd636 --- /dev/null +++ b/tests-m32/ioctl_loop.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_mtd.c b/tests-m32/ioctl_mtd.c new file mode 100644 index 00000000..a37d5d0f --- /dev/null +++ b/tests-m32/ioctl_mtd.c @@ -0,0 +1,197 @@ +/* + * This file is part of ioctl_mtd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) +# include "mtd-abi.h" +#else +# include +#endif + +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +#define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + if (_IOC_DIR(cmd) == _IOC_WRITE) \ + printf("ioctl(-1, MIXER_WRITE(%u) or %s, NULL)" \ + " = -1 EBADF (%m)\n", \ + (unsigned int) _IOC_NR(cmd), #cmd); \ + else if (_IOC_DIR(cmd) == _IOC_READ) \ + printf("ioctl(-1, MIXER_READ(%u) or %s, NULL)" \ + " = -1 EBADF (%m)\n", \ + (unsigned int) _IOC_NR(cmd), #cmd); \ + else \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +#define TEST_erase_info_user(cmd, eiu) \ + ioctl(-1, cmd, eiu); \ + printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ + " = -1 EBADF (%m)\n", \ + (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ + (unsigned int) _IOC_NR(cmd), #cmd, \ + eiu->start, eiu->length) + +int +main(void) +{ + TEST_NULL_ARG(ECCGETLAYOUT); + TEST_NULL_ARG(ECCGETSTATS); + TEST_NULL_ARG(MEMERASE); + TEST_NULL_ARG(MEMERASE64); + TEST_NULL_ARG(MEMGETBADBLOCK); + TEST_NULL_ARG(MEMGETINFO); + TEST_NULL_ARG(MEMGETOOBSEL); + TEST_NULL_ARG(MEMGETREGIONCOUNT); + TEST_NULL_ARG(MEMISLOCKED); + TEST_NULL_ARG(MEMLOCK); + TEST_NULL_ARG(MEMREADOOB); + TEST_NULL_ARG(MEMREADOOB64); + TEST_NULL_ARG(MEMSETBADBLOCK); + TEST_NULL_ARG(MEMUNLOCK); + TEST_NULL_ARG(MEMWRITE); + TEST_NULL_ARG(MEMWRITEOOB); + TEST_NULL_ARG(MEMWRITEOOB64); + TEST_NULL_ARG(OTPGETREGIONCOUNT); + TEST_NULL_ARG(OTPGETREGIONINFO); + TEST_NULL_ARG(OTPLOCK); + TEST_NULL_ARG(OTPSELECT); + + ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL); + printf("ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL) = -1 EBADF (%m)\n"); + + int *const opt = tail_alloc(sizeof(*opt)); + *opt = MTD_OTP_OFF; + ioctl(-1, OTPSELECT, opt); + printf("ioctl(-1, MIXER_READ(%u) or OTPSELECT, [MTD_OTP_OFF])" + " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPSELECT)); + + uint64_t *const v64 = tail_alloc(sizeof(*v64)); + fill_memory(v64, sizeof(*v64)); + + ioctl(-1, MEMGETBADBLOCK, v64); + printf("ioctl(-1, MIXER_WRITE(%u) or MEMGETBADBLOCK, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMGETBADBLOCK), *v64); + + ioctl(-1, MEMSETBADBLOCK, v64); + printf("ioctl(-1, MIXER_WRITE(%u) or MEMSETBADBLOCK, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMSETBADBLOCK), *v64); + + struct region_info_user *const riu = tail_alloc(sizeof(*riu)); + fill_memory(riu, sizeof(*riu)); + ioctl(-1, MEMGETREGIONINFO, riu); + printf("ioctl(-1, %s, {regionindex=%#x}) = -1 EBADF (%m)\n", + "MEMGETREGIONINFO" +#ifdef __i386__ + " or MTRRIOC_GET_PAGE_ENTRY" +#endif + , riu->regionindex); + + struct erase_info_user *const eiu = tail_alloc(sizeof(*eiu)); + fill_memory(eiu, sizeof(*eiu)); + + TEST_erase_info_user(MEMERASE, eiu); + TEST_erase_info_user(MEMLOCK, eiu); + TEST_erase_info_user(MEMUNLOCK, eiu); + TEST_erase_info_user(MEMISLOCKED, eiu); + + struct erase_info_user64 *const eiu64 = tail_alloc(sizeof(*eiu64)); + fill_memory(eiu64, sizeof(*eiu64)); + ioctl(-1, MEMERASE64, eiu64); + printf("ioctl(-1, MIXER_WRITE(%u) or %s, {start=%#llx, length=%#llx})" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMERASE64), "MEMERASE64", + (unsigned long long) eiu64->start, + (unsigned long long) eiu64->length); + + struct mtd_oob_buf *const oob = tail_alloc(sizeof(*oob)); + fill_memory(oob, sizeof(*oob)); + + ioctl(-1, MEMWRITEOOB, oob); + printf("ioctl(-1, MEMWRITEOOB, {start=%#x, length=%#x, ptr=%p})" + " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); + + ioctl(-1, MEMREADOOB, oob); + printf("ioctl(-1, MEMREADOOB, {start=%#x, length=%#x, ptr=%p})" + " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); + + struct mtd_oob_buf64 *const oob64 = tail_alloc(sizeof(*oob64)); + fill_memory(oob64, sizeof(*oob64)); + + ioctl(-1, MEMWRITEOOB64, oob64); + printf("ioctl(-1, MEMWRITEOOB64" + ", {start=%#llx, length=%#x, usr_ptr=%#llx}) = -1 EBADF (%m)\n", + (unsigned long long) oob64->start, oob64->length, + (unsigned long long) oob64->usr_ptr); + + ioctl(-1, MEMREADOOB64, oob64); + printf("ioctl(-1, MEMREADOOB64" + ", {start=%#llx, length=%#x, usr_ptr=%#llx}) = -1 EBADF (%m)\n", + (unsigned long long) oob64->start, oob64->length, + (unsigned long long) oob64->usr_ptr); + + + struct otp_info *const oi = tail_alloc(sizeof(*oi)); + fill_memory(oi, sizeof(*oi)); + ioctl(-1, OTPLOCK, oi); + printf("ioctl(-1, MIXER_READ(%u) or OTPLOCK" + ", {start=%#x, length=%#x, locked=%u}) = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(OTPLOCK), oi->start, oi->length, oi->locked); + + struct mtd_write_req *const wr = tail_alloc(sizeof(*wr)); + fill_memory(wr, sizeof(*wr)); + wr->mode = MTD_OPS_PLACE_OOB; + ioctl(-1, MEMWRITE, wr); + printf("ioctl(-1, MEMWRITE, {start=%#llx, len=%#llx, ooblen=%#llx" + ", usr_data=%#llx, usr_oob=%#llx, mode=MTD_OPS_PLACE_OOB})" + " = -1 EBADF (%m)\n", + (unsigned long long) wr->start, + (unsigned long long) wr->len, + (unsigned long long) wr->ooblen, + (unsigned long long) wr->usr_data, + (unsigned long long) wr->usr_oob); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x4d, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x4d, 0xfe, 0xff)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_mtd.test b/tests-m32/ioctl_mtd.test new file mode 100755 index 00000000..08428073 --- /dev/null +++ b/tests-m32/ioctl_mtd.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of 'M' type ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_rtc-v.c b/tests-m32/ioctl_rtc-v.c new file mode 100644 index 00000000..62b16155 --- /dev/null +++ b/tests-m32/ioctl_rtc-v.c @@ -0,0 +1,3 @@ +/* This file is part of ioctl_rtc-v strace test. */ +#define VERBOSE 1 +#include "ioctl_rtc.c" diff --git a/tests-m32/ioctl_rtc-v.test b/tests-m32/ioctl_rtc-v.test new file mode 100755 index 00000000..a255322d --- /dev/null +++ b/tests-m32/ioctl_rtc-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check verbose decoding of RTC_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_rtc.c b/tests-m32/ioctl_rtc.c new file mode 100644 index 00000000..49d7ec7b --- /dev/null +++ b/tests-m32/ioctl_rtc.c @@ -0,0 +1,207 @@ +/* + * This file is part of ioctl_rtc strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include "xlat.h" + +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +static void +print_rtc_time(const struct rtc_time *rt) +{ + printf("{tm_sec=%d, tm_min=%d, tm_hour=%d" + ", tm_mday=%d, tm_mon=%d, tm_year=%d", + rt->tm_sec, rt->tm_min, rt->tm_hour, + rt->tm_mday, rt->tm_mon, rt->tm_year); +#if VERBOSE + printf(", tm_wday=%d, tm_yday=%d, tm_isdst=%d}", + rt->tm_wday, rt->tm_yday, rt->tm_isdst); +#else + printf(", ...}"); +#endif +} + +static struct xlat rtc_argless[] = { + XLAT(RTC_AIE_OFF), + XLAT(RTC_PIE_ON), + XLAT(RTC_PIE_OFF), + XLAT(RTC_UIE_ON), + XLAT(RTC_WIE_ON), + XLAT(RTC_WIE_OFF), +#ifdef RTC_VL_CLR + XLAT(RTC_VL_CLR), +#endif +}; + +int +main(void) +{ + const unsigned int size = get_page_size(); + + void *const page = tail_alloc(size); + fill_memory(page, size); + + struct rtc_time *rt = tail_alloc(sizeof(*rt)); + fill_memory(rt, sizeof(*rt)); + + struct rtc_wkalrm *wk = tail_alloc(sizeof(*wk)); + fill_memory(wk, sizeof(*wk)); + + struct rtc_pll_info *pll = tail_alloc(sizeof(*pll)); + fill_memory(pll, sizeof(*pll)); + + /* RTC_ALM_READ */ + ioctl(-1, RTC_ALM_READ, 0); + printf("ioctl(-1, RTC_ALM_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_ALM_READ, page); + printf("ioctl(-1, RTC_ALM_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_RD_TIME */ + ioctl(-1, RTC_RD_TIME, 0); + printf("ioctl(-1, RTC_RD_TIME, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_RD_TIME, page); + printf("ioctl(-1, RTC_RD_TIME, %p) = -1 EBADF (%m)\n", page); + + /* RTC_ALM_SET */ + ioctl(-1, RTC_ALM_SET, 0); + printf("ioctl(-1, RTC_ALM_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_ALM_SET, rt); + printf("ioctl(-1, RTC_ALM_SET, "); + print_rtc_time(rt); + errno = EBADF; + printf(") = -1 EBADF (%m)\n"); + + /* RTC_SET_TIME */ + ioctl(-1, RTC_SET_TIME, 0); + printf("ioctl(-1, RTC_SET_TIME, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_SET_TIME, rt); + printf("ioctl(-1, RTC_SET_TIME, "); + print_rtc_time(rt); + errno = EBADF; + printf(") = -1 EBADF (%m)\n"); + + /* RTC_IRQP_SET */ + ioctl(-1, RTC_IRQP_SET, lmagic); + printf("ioctl(-1, RTC_IRQP_SET, %lu) = -1 EBADF (%m)\n", lmagic); + + /* RTC_EPOCH_SET */ + ioctl(-1, RTC_EPOCH_SET, lmagic); + printf("ioctl(-1, RTC_EPOCH_SET, %lu) = -1 EBADF (%m)\n", lmagic); + + /* RTC_IRQP_READ */ + ioctl(-1, RTC_IRQP_READ, 0); + printf("ioctl(-1, RTC_IRQP_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_IRQP_READ, page); + printf("ioctl(-1, RTC_IRQP_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_EPOCH_READ */ + ioctl(-1, RTC_EPOCH_READ, 0); + printf("ioctl(-1, RTC_EPOCH_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_EPOCH_READ, page); + printf("ioctl(-1, RTC_EPOCH_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_WKALM_RD */ + ioctl(-1, RTC_WKALM_RD, 0); + printf("ioctl(-1, RTC_WKALM_RD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_WKALM_RD, page); + printf("ioctl(-1, RTC_WKALM_RD, %p) = -1 EBADF (%m)\n", page); + + /* RTC_WKALM_SET */ + ioctl(-1, RTC_WKALM_SET, 0); + printf("ioctl(-1, RTC_WKALM_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_WKALM_SET, wk); + printf("ioctl(-1, RTC_WKALM_SET, {enabled=%u, pending=%u, time=", + (unsigned) wk->enabled, (unsigned) wk->pending); + print_rtc_time(&wk->time); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + /* RTC_PLL_GET */ + ioctl(-1, RTC_PLL_GET, 0); + printf("ioctl(-1, RTC_PLL_GET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_PLL_GET, page); + printf("ioctl(-1, RTC_PLL_GET, %p) = -1 EBADF (%m)\n", page); + + /* RTC_PLL_SET */ + ioctl(-1, RTC_PLL_SET, 0); + printf("ioctl(-1, RTC_PLL_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_PLL_SET, pll); + printf("ioctl(-1, RTC_PLL_SET, {pll_ctrl=%d, pll_value=%d" + ", pll_max=%d, pll_min=%d, pll_posmult=%d, pll_negmult=%d" + ", pll_clock=%ld}) = -1 EBADF (%m)\n", + pll->pll_ctrl, pll->pll_value, pll->pll_max, pll->pll_min, + pll->pll_posmult, pll->pll_negmult, pll->pll_clock); + +#ifdef RTC_VL_READ + /* RTC_VL_READ */ + ioctl(-1, RTC_VL_READ, 0); + printf("ioctl(-1, RTC_VL_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_VL_READ, page); + printf("ioctl(-1, RTC_VL_READ, %p) = -1 EBADF (%m)\n", page); +#endif + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(rtc_argless); ++i) { + ioctl(-1, (unsigned long) rtc_argless[i].val, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", rtc_argless[i].str); + } + + ioctl(-1, RTC_UIE_OFF, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "PHN_NOT_OH or RTC_UIE_OFF"); + + ioctl(-1, RTC_AIE_ON, lmagic); +#ifdef HPPA + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "PA_PERF_ON or RTC_AIE_ON"); +#else + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "RTC_AIE_ON"); +#endif + + ioctl(-1, _IO(0x70, 0x40), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", "NVRAM_INIT", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_rtc.test b/tests-m32/ioctl_rtc.test new file mode 100755 index 00000000..4545f2ae --- /dev/null +++ b/tests-m32/ioctl_rtc.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic decoding of RTC_* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_scsi.c b/tests-m32/ioctl_scsi.c new file mode 100644 index 00000000..0db94d84 --- /dev/null +++ b/tests-m32/ioctl_scsi.c @@ -0,0 +1,156 @@ +/* + * Check decoding of SCSI ioctl commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SCSI_SG_H + +# include +# include +# include +# include "xlat/scsi_sg_commands.h" + +# define TEST_NO_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0xdeadbeef); \ + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +# define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +# define TEST_TAKES_INT_BY_VAL(cmd, val) \ + do { \ + ioctl(-1, cmd, val); \ + printf("ioctl(-1, %s, %#x) = -1 EBADF (%m)\n", #cmd, val); \ + } while (0) + +# define TEST_TAKES_INT_BY_PTR(cmd, pint) \ + do { \ + ioctl(-1, cmd, pint); \ + printf("ioctl(-1, %s, [%d]) = -1 EBADF (%m)\n", #cmd, *(pint)); \ + } while (0) + +# define TEST_RETURNS_INT_BY_PTR(cmd, pint) \ + do { \ + ioctl(-1, cmd, pint); \ + printf("ioctl(-1, %s, %p) = -1 EBADF (%m)\n", #cmd, pint); \ + } while (0) + +int +main(void) +{ + int *const pint = tail_alloc(sizeof(*pint)); + *pint = (int) 0xfacefeed; + + TEST_NO_ARG(SG_GET_TIMEOUT); + + TEST_NULL_ARG(SG_SET_TIMEOUT); + TEST_NULL_ARG(SG_EMULATED_HOST); + TEST_NULL_ARG(SG_GET_TRANSFORM); + TEST_NULL_ARG(SG_GET_COMMAND_Q); + TEST_NULL_ARG(SG_SET_COMMAND_Q); + TEST_NULL_ARG(SG_GET_RESERVED_SIZE); + TEST_NULL_ARG(SG_SET_RESERVED_SIZE); + TEST_NULL_ARG(SG_GET_SCSI_ID); + TEST_NULL_ARG(SG_SET_FORCE_LOW_DMA); + TEST_NULL_ARG(SG_GET_LOW_DMA); + TEST_NULL_ARG(SG_SET_FORCE_PACK_ID); + TEST_NULL_ARG(SG_GET_PACK_ID); + TEST_NULL_ARG(SG_GET_NUM_WAITING); + TEST_NULL_ARG(SG_SET_DEBUG); + TEST_NULL_ARG(SG_GET_SG_TABLESIZE); + TEST_NULL_ARG(SG_GET_VERSION_NUM); + TEST_NULL_ARG(SG_NEXT_CMD_LEN); + TEST_NULL_ARG(SG_SCSI_RESET); + TEST_NULL_ARG(SG_IO); + TEST_NULL_ARG(SG_GET_REQUEST_TABLE); + TEST_NULL_ARG(SG_SET_KEEP_ORPHAN); + TEST_NULL_ARG(SG_GET_KEEP_ORPHAN); + TEST_NULL_ARG(SG_GET_ACCESS_COUNT); + + TEST_TAKES_INT_BY_VAL(SG_SET_TRANSFORM, 0); + TEST_TAKES_INT_BY_VAL(SG_SET_TRANSFORM, *pint); + + TEST_TAKES_INT_BY_PTR(SG_NEXT_CMD_LEN, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_COMMAND_Q, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_DEBUG, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_FORCE_LOW_DMA, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_FORCE_PACK_ID, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_KEEP_ORPHAN, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_RESERVED_SIZE, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_TIMEOUT, pint); + + TEST_RETURNS_INT_BY_PTR(SG_EMULATED_HOST, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_ACCESS_COUNT, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_COMMAND_Q, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_KEEP_ORPHAN, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_LOW_DMA, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_NUM_WAITING, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_PACK_ID, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_RESERVED_SIZE, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_SG_TABLESIZE, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_TRANSFORM, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_VERSION_NUM, pint); + + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [%#x /* %s_??? */]) = -1 EBADF (%m)\n", + "SG_SCSI_RESET", *pint, "SG_SCSI_RESET"); + + *pint = 0x100; + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [SG_SCSI_RESET_NO_ESCALATE|SG_SCSI_RESET_NOTHING])" + " = -1 EBADF (%m)\n", "SG_SCSI_RESET"); + + *pint = 1; + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [SG_SCSI_RESET_DEVICE]) = -1 EBADF (%m)\n", + "SG_SCSI_RESET"); + + ioctl(-1, 0x22ff, 0); + printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n"); + + static const unsigned long magic = + (unsigned long) 0xdeadbeeffacefeedULL; + ioctl(-1, 0x22ff, magic); + printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", + magic); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SCSI_SG_H") + +#endif diff --git a/tests-m32/ioctl_scsi.test b/tests-m32/ioctl_scsi.test new file mode 100755 index 00000000..2710f12b --- /dev/null +++ b/tests-m32/ioctl_scsi.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of SCSI ioctl commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sg_io_v3.c b/tests-m32/ioctl_sg_io_v3.c new file mode 100644 index 00000000..ef25795b --- /dev/null +++ b/tests-m32/ioctl_sg_io_v3.c @@ -0,0 +1,418 @@ +/* + * Check decoding of ioctl SG_IO v3 commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SCSI_SG_H + +# include +# include +# include +# include +# include + +int +main(void) +{ + ioctl(-1, SG_IO, 0); + printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); + + struct sg_io_hdr *const sg_io = tail_alloc(sizeof(*sg_io)); + fill_memory(sg_io, sizeof(*sg_io)); + + const void *const efault = sg_io + 1; + ioctl(-1, SG_IO, efault); + printf("ioctl(-1, SG_IO, %p) = -1 EBADF (%m)\n", efault); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->interface_id); + + unsigned int *const piid = tail_alloc(sizeof(*piid)); + *piid = (unsigned char) 'S'; + ioctl(-1, SG_IO, piid); + printf("ioctl(-1, SG_IO, {interface_id='S', %p}) = -1 EBADF (%m)\n", piid + 1); + + sg_io->interface_id = (unsigned char) 'S'; + sg_io->dxfer_direction = -2; + sg_io->flags = -1U; + sg_io->info = -1U; + sg_io->dxferp = (void *) (unsigned long) 0xfacefeedfffffff1ULL; + sg_io->cmdp = (void *) (unsigned long) 0xfacefeedfffffff2ULL; + sg_io->sbp = (void *) (unsigned long) 0xfacefeedfffffff3ULL; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_UNUSED_LUN_INHIBIT" + "|SG_FLAG_MMAP_IO|SG_FLAG_NO_DXFER" + "|SG_FLAG_Q_AT_TAIL|SG_FLAG_Q_AT_HEAD|0xfffeffc8" + ", dxferp=%p" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + sg_io->dxferp, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->dxfer_direction = -3; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_UNUSED_LUN_INHIBIT" + "|SG_FLAG_MMAP_IO|SG_FLAG_NO_DXFER" + "|SG_FLAG_Q_AT_TAIL|SG_FLAG_Q_AT_HEAD|0xfffeffc8" + ", dxferp=%p" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + sg_io->dxferp, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + const struct iovec iov[] = { + { + .iov_base = (void *) efault - 2, + .iov_len = 2 + }, { + .iov_base = (void *) efault - 3, + .iov_len = 4 + } + }; + struct iovec *const t_iov = tail_memdup(iov, sizeof(iov)); + + sg_io->flags = 0x24; + sg_io->info = 1; + sg_io->dxfer_direction = -2; + + sg_io->iovec_count = ARRAY_SIZE(iov); + sg_io->dxfer_len = iov[0].iov_len + iov[1].iov_len - 1; + sg_io->dxferp = t_iov; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_MMAP_IO|SG_FLAG_Q_AT_HEAD" + ", dxferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0x11; + sg_io->dxfer_direction = -3; + sg_io->resid = sg_io->dxfer_len + 1; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_Q_AT_TAIL" + ", dxferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0x10000; + sg_io->info = 0xdeadbeef; + sg_io->iovec_count = 0; + sg_io->dxfer_len = 5; + sg_io->resid = 1; + sg_io->dxferp = (void *) efault - (sg_io->dxfer_len - sg_io->resid); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_NO_DXFER" + ", dxferp=\"\\x%x\\x%x\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + * (unsigned char *) (sg_io->dxferp + 3), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 2; + sg_io->dxfer_direction = -4; + sg_io->dxfer_len = 3; + sg_io->resid = 1; + sg_io->dxferp = (void *) efault - sg_io->dxfer_len; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_UNUSED_LUN_INHIBIT" + ", dxferp=\"\\x%x\\x%x\\x%x\" => dxferp=\"\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0; + sg_io->resid = sg_io->dxfer_len; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=0" + ", dxferp=\"\\x%x\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SCSI_SG_H") + +#endif diff --git a/tests-m32/ioctl_sg_io_v3.test b/tests-m32/ioctl_sg_io_v3.test new file mode 100755 index 00000000..dacacdf4 --- /dev/null +++ b/tests-m32/ioctl_sg_io_v3.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of ioctl SG_IO v3 commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sg_io_v4.c b/tests-m32/ioctl_sg_io_v4.c new file mode 100644 index 00000000..5f899eee --- /dev/null +++ b/tests-m32/ioctl_sg_io_v4.c @@ -0,0 +1,238 @@ +/* + * Check decoding of ioctl SG_IO v4 commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_BSG_H + +# include +# include +# include +# include +# include + +# include "xlat/scsi_sg_commands.h" + +int +main(void) +{ + ioctl(-1, SG_IO, 0); + printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); + + struct sg_io_v4 *const sg_io = tail_alloc(sizeof(*sg_io)); + fill_memory(sg_io, sizeof(*sg_io)); + + const void *const efault = sg_io + 1; + ioctl(-1, SG_IO, efault); + printf("ioctl(-1, SG_IO, %p) = -1 EBADF (%m)\n", efault); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->guard); + + unsigned int *const pguard = tail_alloc(sizeof(*pguard)); + *pguard = (unsigned char) 'Q'; + ioctl(-1, SG_IO, pguard); + printf("ioctl(-1, SG_IO, {guard='Q', %p}) = -1 EBADF (%m)\n", pguard + 1); + + sg_io->guard = (unsigned char) 'Q'; + sg_io->protocol = 0; + sg_io->subprotocol = 1; + sg_io->flags = -1U; + sg_io->info = -1U; + sg_io->request = (kernel_ulong_t) 0xfacefeedfffffff1ULL; + sg_io->response = (kernel_ulong_t) 0xfacefeedfffffff2ULL; + sg_io->dout_xferp = (kernel_ulong_t) 0xfacefeedfffffff3ULL; + sg_io->din_xferp = (kernel_ulong_t) 0xfacefeedfffffff4ULL; + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {guard='Q'" + ", protocol=BSG_PROTOCOL_SCSI" + ", subprotocol=BSG_SUB_PROTOCOL_SCSI_TMF" + ", request_len=%u" + ", request=%#llx" + ", request_tag=%#" PRI__x64 + ", request_attr=%u" + ", request_priority=%u" + ", request_extra=%u" + ", max_response_len=%u" + ", dout_iovec_count=%u" + ", dout_xfer_len=%u" + ", din_iovec_count=%u" + ", din_xfer_len=%u" + ", dout_xferp=%#llx" + ", timeout=%u" + ", flags=BSG_FLAG_Q_AT_TAIL|BSG_FLAG_Q_AT_HEAD|0xffffffcf" + ", usr_ptr=%#" PRI__x64 + ", response_len=%u" + ", response=%#llx" + ", din_xferp=%#llx" + ", driver_status=%#x" + ", transport_status=%#x" + ", device_status=%#x" + ", retry_delay=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + ", duration=%u" + ", response_len=%u" + ", din_resid=%d" + ", dout_resid=%d" + ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", + sg_io->request_len, + (unsigned long long) (kernel_ulong_t) sg_io->request, + sg_io->request_tag, + sg_io->request_attr, + sg_io->request_priority, + sg_io->request_extra, + sg_io->max_response_len, + sg_io->dout_iovec_count, + sg_io->dout_xfer_len, + sg_io->din_iovec_count, + sg_io->din_xfer_len, + (unsigned long long) (kernel_ulong_t) sg_io->dout_xferp, + sg_io->timeout, + sg_io->usr_ptr, + sg_io->response_len, + (unsigned long long) (kernel_ulong_t) sg_io->response, + (unsigned long long) (kernel_ulong_t) sg_io->din_xferp, + sg_io->driver_status, + sg_io->transport_status, + sg_io->device_status, + sg_io->retry_delay, + sg_io->duration, + sg_io->response_len, + sg_io->din_resid, + sg_io->dout_resid, + sg_io->generated_tag); + + const struct iovec iov[] = { + { + .iov_base = (void *) efault - 2, + .iov_len = 2 + }, { + .iov_base = (void *) efault - 3, + .iov_len = 4 + } + }; + const struct iovec *const t_iov = tail_memdup(iov, sizeof(iov)); + sg_io->dout_iovec_count = ARRAY_SIZE(iov); + sg_io->dout_xfer_len = iov[0].iov_len + iov[1].iov_len - 1; + sg_io->dout_xferp = (unsigned long) t_iov; + + sg_io->din_iovec_count = 0; + sg_io->din_xfer_len = 5; + sg_io->din_resid = 1; + sg_io->din_xferp = (unsigned long) efault - + (sg_io->dout_xfer_len - sg_io->din_resid); + + sg_io->request_len = 3; + sg_io->request = (unsigned long) efault - sg_io->request_len; + sg_io->response_len = 2; + sg_io->response = (unsigned long) efault - sg_io->response_len; + + sg_io->flags = 0x20; + sg_io->info = 1; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {guard='Q'" + ", protocol=BSG_PROTOCOL_SCSI" + ", subprotocol=BSG_SUB_PROTOCOL_SCSI_TMF" + ", request_len=%u" + ", request=\"\\x%x\\x%x\\x%x\"" + ", request_tag=%#" PRI__x64 + ", request_attr=%u" + ", request_priority=%u" + ", request_extra=%u" + ", max_response_len=%u" + ", dout_iovec_count=%u" + ", dout_xfer_len=%u" + ", din_iovec_count=%u" + ", din_xfer_len=%u" + ", dout_xferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", timeout=%u, flags=BSG_FLAG_Q_AT_HEAD" + ", usr_ptr=%#" PRI__x64 + ", response_len=%u" + ", response=\"\\x%x\\x%x\"" + ", din_xferp=\"\\x%x\\x%x\\x%x\\x%x\"" + ", driver_status=%#x" + ", transport_status=%#x" + ", device_status=%#x" + ", retry_delay=%u" + ", info=SG_INFO_CHECK" + ", duration=%u" + ", response_len=%u" + ", din_resid=%d" + ", dout_resid=%d" + ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", + sg_io->request_len, + * (unsigned char *) ((unsigned long) sg_io->request + 0), + * (unsigned char *) ((unsigned long) sg_io->request + 1), + * (unsigned char *) ((unsigned long) sg_io->request + 2), + sg_io->request_tag, + sg_io->request_attr, + sg_io->request_priority, + sg_io->request_extra, + sg_io->max_response_len, + sg_io->dout_iovec_count, + sg_io->dout_xfer_len, + sg_io->din_iovec_count, + sg_io->din_xfer_len, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->timeout, + sg_io->usr_ptr, + sg_io->response_len, + * (unsigned char *) ((unsigned long) sg_io->response + 0), + * (unsigned char *) ((unsigned long) sg_io->response + 1), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 0), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 1), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 2), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 3), + sg_io->driver_status, + sg_io->transport_status, + sg_io->device_status, + sg_io->retry_delay, + sg_io->duration, + sg_io->response_len, + sg_io->din_resid, + sg_io->dout_resid, + sg_io->generated_tag); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_BSG_H") + +#endif diff --git a/tests-m32/ioctl_sg_io_v4.test b/tests-m32/ioctl_sg_io_v4.test new file mode 100755 index 00000000..25567224 --- /dev/null +++ b/tests-m32/ioctl_sg_io_v4.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of ioctl SG_IO v4 commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sock_gifconf.c b/tests-m32/ioctl_sock_gifconf.c new file mode 100644 index 00000000..ae0bea4f --- /dev/null +++ b/tests-m32/ioctl_sock_gifconf.c @@ -0,0 +1,182 @@ +/* + * Check decoding of SIOCGIFCONF command of ioctl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_STRLEN 1 + +static void +print_ifc_len(int val) +{ + if (val % (int) sizeof(struct ifreq)) + printf("%d", val); + else + printf("%d * sizeof(struct ifreq)", + val / (int) sizeof(struct ifreq)); +} + +static void +print_ifconf(struct ifconf *ifc, int in_len, char *in_buf, long rc) +{ + if (in_buf) { + printf("{ifc_len="); + print_ifc_len(in_len); + + if (in_len != ifc->ifc_len) { + printf(" => "); + print_ifc_len(ifc->ifc_len); + } + } else { + printf("{ifc_len="); + print_ifc_len(ifc->ifc_len); + } + + printf(", ifc_buf="); + + if ((rc < 0) || !in_buf) { + if (in_buf) + printf("%p", in_buf); + else + printf("NULL"); + } else { + int i; + + printf("["); + for (i = 0; i < (ifc->ifc_len) && + i < (int) (MAX_STRLEN * sizeof(struct ifreq)); + i += sizeof(struct ifreq)) { + struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); + struct sockaddr_in *const sa_in = + (struct sockaddr_in *) &(ifr->ifr_addr); + + if (i) + printf(", "); + printf("{ifr_name=\"%s\", ifr_addr={sa_family=AF_INET, " + "sin_port=htons(%u), sin_addr=inet_addr(\"%s\")}" + "}", ifr->ifr_name, ntohs(sa_in->sin_port), + inet_ntoa(sa_in->sin_addr)); + } + + if ((size_t) (ifc->ifc_len - i) >= sizeof(struct ifreq)) + printf(", ..."); + + printf("]"); + } + + printf("}"); +} + +static void +gifconf_ioctl(int fd, struct ifconf *ifc, bool ifc_valid) +{ + const char * errstr; + int in_len; + char *in_buf; + long rc; + + if (ifc_valid) { + in_len = ifc->ifc_len; + in_buf = ifc->ifc_buf; + } + + rc = ioctl(fd, SIOCGIFCONF, ifc); + errstr = sprintrc(rc); + + printf("ioctl(%d, SIOCGIFCONF, ", fd); + if (ifc_valid) { + print_ifconf(ifc, in_len, in_buf, rc); + } else { + if (ifc) + printf("%p", ifc); + else + printf("NULL"); + } + + printf(") = %s\n", errstr); +} + +int +main(int argc, char *argv[]) +{ + struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); + struct ifconf *ifc = tail_alloc(sizeof(*ifc)); + + struct sockaddr_in addr; + int fd; + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) + perror_msg_and_skip("socket AF_INET"); + + gifconf_ioctl(fd, NULL, false); + gifconf_ioctl(fd, ifc + 1, false); + + ifc->ifc_len = 3141592653U; + ifc->ifc_buf = NULL; + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 0; + ifc->ifc_buf = (char *) (ifr + 2); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 1; + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 1 * sizeof(*ifr); + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 2 * sizeof(*ifr); + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 2 * sizeof(*ifr) + 2; + ifc->ifc_buf = (char *) ifr; + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 3 * sizeof(*ifr) + 4; + ifc->ifc_buf = (char *) ifr; + gifconf_ioctl(fd, ifc, true); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_sock_gifconf.test b/tests-m32/ioctl_sock_gifconf.test new file mode 100755 index 00000000..2e2fc019 --- /dev/null +++ b/tests-m32/ioctl_sock_gifconf.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of SIOCGIFCONF ioctl. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a28 -s1 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_uffdio.c b/tests-m32/ioctl_uffdio.c new file mode 100644 index 00000000..10b8b843 --- /dev/null +++ b/tests-m32/ioctl_uffdio.c @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Red Hat, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_userfaultfd && defined HAVE_LINUX_USERFAULTFD_H + +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +int +main(void) +{ + int rc; + int fd = syscall(__NR_userfaultfd, O_NONBLOCK); + size_t pagesize = getpagesize(); + + if (fd < 0) + perror_msg_and_skip("userfaultfd"); + + /* ---- API ---- */ + struct uffdio_api *api_struct = tail_alloc(sizeof(*api_struct)); + + /* With a bad fd */ + memset(api_struct, 0, sizeof(*api_struct)); + rc = ioctl(-1, UFFDIO_API, api_struct); + printf("ioctl(-1, UFFDIO_API, {api=0, features=0}) = %d %s (%m)\n", + rc, errno2name()); + /* With a bad pointer */ + rc = ioctl(fd, UFFDIO_API, NULL); + printf("ioctl(%d, UFFDIO_API, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + /* Normal call */ + api_struct->api = UFFD_API; + api_struct->features = 0; + rc = ioctl(fd, UFFDIO_API, api_struct); + printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0, " + "features.out=%#" PRIx64 ", " "ioctls=1<<_UFFDIO_REGISTER|" + "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API", + fd, (uint64_t)api_struct->features); + api_struct->ioctls &= ~(1ull<<_UFFDIO_REGISTER| + 1ull<<_UFFDIO_UNREGISTER| + 1ull<<_UFFDIO_API); + if (api_struct->ioctls) + printf("|%#" PRIx64, (uint64_t)api_struct->ioctls); + printf("}) = %d\n", rc); + + /* For the rest of the tests we need some anonymous memory */ + void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1, 0); + if (area1 == MAP_FAILED) + perror_msg_and_fail("mmap area1"); + void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1, 0); + if (area2 == MAP_FAILED) + perror_msg_and_fail("mmap area2"); + madvise(area2, pagesize, MADV_DONTNEED); + *(char *)area1 = 42; + + /* ---- REGISTER ---- */ + struct uffdio_register *register_struct = + tail_alloc(sizeof(*register_struct)); + memset(register_struct, 0, sizeof(*register_struct)); + + rc = ioctl(-1, UFFDIO_REGISTER, register_struct); + printf("ioctl(-1, UFFDIO_REGISTER, {range={start=0, len=0}, " + "mode=0}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_REGISTER, NULL); + printf("ioctl(%d, UFFDIO_REGISTER, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + register_struct->range.start = (uint64_t)(uintptr_t)area2; + register_struct->range.len = pagesize; + register_struct->mode = UFFDIO_REGISTER_MODE_MISSING; + rc = ioctl(fd, UFFDIO_REGISTER, register_struct); + printf("ioctl(%d, UFFDIO_REGISTER, {range={start=%p, len=%#zx}, " + "mode=UFFDIO_REGISTER_MODE_MISSING, ioctls=" + "1<<_UFFDIO_WAKE|1<<_UFFDIO_COPY|1<<_UFFDIO_ZEROPAGE", + fd, area2, pagesize); + register_struct->ioctls &= ~(1ull<<_UFFDIO_WAKE| + 1ull<<_UFFDIO_COPY| + 1ull<<_UFFDIO_ZEROPAGE); + if (register_struct->ioctls) + printf("|%#" PRIx64, (uint64_t)register_struct->ioctls); + printf("}) = %d\n", rc); + + /* With area2 registered we can now do the atomic copies onto it + * but be careful not to access it in any other way otherwise + * userfaultfd will cause us to stall. + */ + /* ---- COPY ---- */ + struct uffdio_copy *copy_struct = tail_alloc(sizeof(*copy_struct)); + + memset(copy_struct, 0, sizeof(*copy_struct)); + rc = ioctl(-1, UFFDIO_COPY, copy_struct); + printf("ioctl(-1, UFFDIO_COPY, {dst=0, src=0, len=0, mode=0" + "}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_COPY, NULL); + printf("ioctl(%d, UFFDIO_COPY, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + copy_struct->dst = (uint64_t)(uintptr_t)area2; + copy_struct->src = (uint64_t)(uintptr_t)area1; + copy_struct->len = pagesize; + copy_struct->mode = UFFDIO_COPY_MODE_DONTWAKE; + rc = ioctl(fd, UFFDIO_COPY, copy_struct); + printf("ioctl(%d, UFFDIO_COPY, {dst=%p, src=%p, len=%#zx," + " mode=UFFDIO_COPY_MODE_DONTWAKE, copy=%#zx}) = %d\n", + fd, area2, area1, pagesize, pagesize, rc); + + /* ---- ZEROPAGE ---- */ + struct uffdio_zeropage *zero_struct = tail_alloc(sizeof(*zero_struct)); + madvise(area2, pagesize, MADV_DONTNEED); + + memset(zero_struct, 0, sizeof(*zero_struct)); + rc = ioctl(-1, UFFDIO_ZEROPAGE, zero_struct); + printf("ioctl(-1, UFFDIO_ZEROPAGE, {range={start=0, len=0}, mode=0" + "}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_ZEROPAGE, NULL); + printf("ioctl(%d, UFFDIO_ZEROPAGE, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + zero_struct->range.start = (uint64_t)(uintptr_t)area2; + zero_struct->range.len = pagesize; + zero_struct->mode = UFFDIO_ZEROPAGE_MODE_DONTWAKE; + rc = ioctl(fd, UFFDIO_ZEROPAGE, zero_struct); + printf("ioctl(%d, UFFDIO_ZEROPAGE, {range={start=%p, len=%#zx}," + " mode=UFFDIO_ZEROPAGE_MODE_DONTWAKE, zeropage=%#zx}) = %d\n", + fd, area2, pagesize, pagesize, rc); + + /* ---- WAKE ---- */ + struct uffdio_range *range_struct = tail_alloc(sizeof(*range_struct)); + memset(range_struct, 0, sizeof(*range_struct)); + + rc = ioctl(-1, UFFDIO_WAKE, range_struct); + printf("ioctl(-1, UFFDIO_WAKE, {start=0, len=0}) = %d %s (%m)\n", + rc, errno2name()); + + rc = ioctl(fd, UFFDIO_WAKE, NULL); + printf("ioctl(%d, UFFDIO_WAKE, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + range_struct->start = (uint64_t)(uintptr_t)area2; + range_struct->len = pagesize; + rc = ioctl(fd, UFFDIO_WAKE, range_struct); + printf("ioctl(%d, UFFDIO_WAKE, {start=%p, len=%#zx}) = %d\n", + fd, area2, pagesize, rc); + + /* ---- UNREGISTER ---- */ + memset(range_struct, 0, sizeof(*range_struct)); + + rc = ioctl(-1, UFFDIO_UNREGISTER, range_struct); + printf("ioctl(-1, UFFDIO_UNREGISTER, {start=0, len=0}) = %d %s (%m)\n", + rc, errno2name()); + + rc = ioctl(fd, UFFDIO_UNREGISTER, NULL); + printf("ioctl(%d, UFFDIO_UNREGISTER, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + range_struct->start = (uint64_t)(uintptr_t)area2; + range_struct->len = pagesize; + rc = ioctl(fd, UFFDIO_UNREGISTER, range_struct); + printf("ioctl(%d, UFFDIO_UNREGISTER, {start=%p, len=%#zx}) = %d\n", + fd, area2, pagesize, rc); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_userfaultfd && HAVE_LINUX_USERFAULTFD_H") + +#endif diff --git a/tests-m32/ioctl_uffdio.test b/tests-m32/ioctl_uffdio.test new file mode 100755 index 00000000..fae9b556 --- /dev/null +++ b/tests-m32/ioctl_uffdio.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check userfaultfd ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_v4l2.c b/tests-m32/ioctl_v4l2.c new file mode 100644 index 00000000..af8c3419 --- /dev/null +++ b/tests-m32/ioctl_v4l2.c @@ -0,0 +1,551 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#if WORDS_BIGENDIAN +# define cc0(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +# define cc3(arg) ((unsigned int) (unsigned char) (arg)) +# define fourcc(a0, a1, a2, a3) \ + ((unsigned int)(a3) | \ + ((unsigned int)(a2) << 8) | \ + ((unsigned int)(a1) << 16) | \ + ((unsigned int)(a0) << 24)) +#else +# define cc0(arg) ((unsigned int) (unsigned char) (arg)) +# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +# define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +# define fourcc(a0, a1, a2, a3) \ + ((unsigned int)(a0) | \ + ((unsigned int)(a1) << 8) | \ + ((unsigned int)(a2) << 16) | \ + ((unsigned int)(a3) << 24)) +#endif + +static const unsigned int magic = 0xdeadbeef; + +int +main(void ) +{ + const unsigned int size = get_page_size(); + void *const page = tail_alloc(size); + fill_memory(page, size); + + unsigned char cc[sizeof(int)] = { 'A', '\'', '\\', '\xfa' }; + + /* VIDIOC_QUERYCAP */ + ioctl(-1, VIDIOC_QUERYCAP, 0); + printf("ioctl(-1, VIDIOC_QUERYCAP, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_QUERYCAP, page); + printf("ioctl(-1, VIDIOC_QUERYCAP, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_ENUM_FMT */ + ioctl(-1, VIDIOC_ENUM_FMT, 0); + printf("ioctl(-1, VIDIOC_ENUM_FMT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_fmtdesc *const p_fmtdesc = tail_alloc(sizeof(*p_fmtdesc)); + p_fmtdesc->index = magic; + p_fmtdesc->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + ioctl(-1, VIDIOC_ENUM_FMT, p_fmtdesc); + printf("ioctl(-1, VIDIOC_ENUM_FMT, {index=%u" + ", type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n", + p_fmtdesc->index); + + /* VIDIOC_G_FMT */ + ioctl(-1, VIDIOC_G_FMT, 0); + printf("ioctl(-1, VIDIOC_G_FMT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_format *const p_format = tail_alloc(sizeof(*p_format)); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n"); + + /* VIDIOC_S_FMT */ + ioctl(-1, VIDIOC_S_FMT, 0); + printf("ioctl(-1, VIDIOC_S_FMT, NULL) = -1 EBADF (%m)\n"); + + p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + p_format->fmt.pix.width = 0xdad1beaf; + p_format->fmt.pix.height = 0xdad2beaf; + p_format->fmt.pix.pixelformat = magic; + p_format->fmt.pix.field = V4L2_FIELD_NONE; + p_format->fmt.pix.bytesperline = 0xdad3beaf; + p_format->fmt.pix.sizeimage = 0xdad4beaf; + p_format->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; + + ioctl(-1, VIDIOC_S_FMT, p_format); + printf("ioctl(-1, VIDIOC_S_FMT, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" + ", fmt.pix={width=%u, height=%u, pixelformat=" + "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" + ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", + p_format->fmt.pix.width, p_format->fmt.pix.height, + cc0(magic), cc1(magic), cc2(magic), cc3(magic), + p_format->fmt.pix.bytesperline, p_format->fmt.pix.sizeimage); + + /* VIDIOC_TRY_FMT */ + ioctl(-1, VIDIOC_TRY_FMT, 0); + printf("ioctl(-1, VIDIOC_TRY_FMT, NULL) = -1 EBADF (%m)\n"); + +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + memset(p_format, -1, sizeof(*p_format)); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + p_format->fmt.pix_mp.width = 0xdad1beaf; + p_format->fmt.pix_mp.height = 0xdad2beaf; + p_format->fmt.pix_mp.pixelformat = magic; + p_format->fmt.pix_mp.field = V4L2_FIELD_NONE; + p_format->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; + unsigned int i; + for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { + p_format->fmt.pix_mp.plane_fmt[i].sizeimage = 0xbadc0de0 | i; + p_format->fmt.pix_mp.plane_fmt[i].bytesperline = 0xdadbeaf0 | i; + } + ioctl(-1, VIDIOC_TRY_FMT, p_format); + printf("ioctl(-1, VIDIOC_TRY_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" + ", fmt.pix_mp={width=%u, height=%u, pixelformat=" + "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", field=V4L2_FIELD_NONE, colorspace=V4L2_COLORSPACE_JPEG" + ", plane_fmt=[", + p_format->fmt.pix_mp.width, p_format->fmt.pix_mp.height, + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { + if (i) + printf(", "); + printf("{sizeimage=%u, bytesperline=%u}", + p_format->fmt.pix_mp.plane_fmt[i].sizeimage, + p_format->fmt.pix_mp.plane_fmt[i].bytesperline); + } + printf("], num_planes=%u}}) = -1 EBADF (%m)\n", + p_format->fmt.pix_mp.num_planes); +#else + struct v4l2_format *const p_v4l2_format = + page + size - sizeof(*p_v4l2_format); + ioctl(-1, VIDIOC_TRY_FMT, p_v4l2_format); + printf("ioctl(-1, VIDIOC_TRY_FMT, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_format->type); +#endif + + /* VIDIOC_REQBUFS */ + ioctl(-1, VIDIOC_REQBUFS, 0); + printf("ioctl(-1, VIDIOC_REQBUFS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_requestbuffers *const p_v4l2_requestbuffers = + page + size - sizeof(*p_v4l2_requestbuffers); + ioctl(-1, VIDIOC_REQBUFS, p_v4l2_requestbuffers); + printf("ioctl(-1, VIDIOC_REQBUFS, {count=%u, type=%#x" + " /* V4L2_BUF_TYPE_??? */, memory=%#x /* V4L2_MEMORY_??? */})" + " = -1 EBADF (%m)\n", + p_v4l2_requestbuffers->count, + p_v4l2_requestbuffers->type, + p_v4l2_requestbuffers->memory); + + /* VIDIOC_QUERYBUF */ + ioctl(-1, VIDIOC_QUERYBUF, 0); + printf("ioctl(-1, VIDIOC_QUERYBUF, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_buffer *const p_v4l2_buffer = + page + size - sizeof(*p_v4l2_buffer); + ioctl(-1, VIDIOC_QUERYBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_QUERYBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", index=%u}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type, p_v4l2_buffer->index); + + /* VIDIOC_QBUF */ + ioctl(-1, VIDIOC_QBUF, 0); + printf("ioctl(-1, VIDIOC_QBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_QBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_QBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", index=%u}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type, p_v4l2_buffer->index); + + /* VIDIOC_DQBUF */ + ioctl(-1, VIDIOC_DQBUF, 0); + printf("ioctl(-1, VIDIOC_DQBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_DQBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_DQBUF, {type=%#x" + " /* V4L2_BUF_TYPE_??? */}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type); + + /* VIDIOC_G_FBUF */ + ioctl(-1, VIDIOC_G_FBUF, 0); + printf("ioctl(-1, VIDIOC_G_FBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_FBUF, page); + printf("ioctl(-1, VIDIOC_G_FBUF, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_FBUF */ + ioctl(-1, VIDIOC_S_FBUF, 0); + printf("ioctl(-1, VIDIOC_S_FBUF, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_framebuffer *const p_v4l2_framebuffer = + page + size - sizeof(*p_v4l2_framebuffer); + ioctl(-1, VIDIOC_S_FBUF, p_v4l2_framebuffer); + printf("ioctl(-1, VIDIOC_S_FBUF, {capability=%#x" + ", flags=%#x, base=%p}) = -1 EBADF (%m)\n", + p_v4l2_framebuffer->capability, + p_v4l2_framebuffer->flags, + p_v4l2_framebuffer->base); + + /* VIDIOC_STREAMON */ + ioctl(-1, VIDIOC_STREAMON, 0); + printf("ioctl(-1, VIDIOC_STREAMON, NULL) = -1 EBADF (%m)\n"); + + int *const p_int = page + size - sizeof(int); + ioctl(-1, VIDIOC_STREAMON, p_int); + printf("ioctl(-1, VIDIOC_STREAMON, [%#x /* V4L2_BUF_TYPE_??? */])" + " = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_STREAMOFF */ + ioctl(-1, VIDIOC_STREAMOFF, 0); + printf("ioctl(-1, VIDIOC_STREAMOFF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_STREAMOFF, p_int); + printf("ioctl(-1, VIDIOC_STREAMOFF, [%#x /* V4L2_BUF_TYPE_??? */])" + " = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_G_PARM */ + ioctl(-1, VIDIOC_G_PARM, 0); + printf("ioctl(-1, VIDIOC_G_PARM, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_streamparm *const p_v4l2_streamparm = + page + size - sizeof(*p_v4l2_streamparm); + ioctl(-1, VIDIOC_G_PARM, p_v4l2_streamparm); + printf("ioctl(-1, VIDIOC_G_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); + + /* VIDIOC_S_PARM */ + ioctl(-1, VIDIOC_S_PARM, 0); + printf("ioctl(-1, VIDIOC_S_PARM, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_PARM, p_v4l2_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); + + struct v4l2_streamparm *const p_streamparm = + tail_alloc(sizeof(*p_streamparm)); + p_streamparm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + p_streamparm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; + p_streamparm->parm.capture.capturemode = V4L2_MODE_HIGHQUALITY; + p_streamparm->parm.capture.timeperframe.numerator = 0xdeadbeef; + p_streamparm->parm.capture.timeperframe.denominator = 0xbadc0ded; + ioctl(-1, VIDIOC_S_PARM, p_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE" + ", parm.capture={capability=V4L2_CAP_TIMEPERFRAME" + ", capturemode=V4L2_MODE_HIGHQUALITY, timeperframe=%u/%u" + ", extendedmode=%u, readbuffers=%u}}) = -1 EBADF (%m)\n", + p_streamparm->parm.capture.timeperframe.numerator, + p_streamparm->parm.capture.timeperframe.denominator, -1U, -1U); + + p_streamparm->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + p_streamparm->parm.output.outputmode = 0; + ioctl(-1, VIDIOC_S_PARM, p_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" + ", parm.output={capability=V4L2_CAP_TIMEPERFRAME" + ", outputmode=0, timeperframe=%u/%u" + ", extendedmode=%u, writebuffers=%u}}) = -1 EBADF (%m)\n", + p_streamparm->parm.output.timeperframe.numerator, + p_streamparm->parm.output.timeperframe.denominator, -1U, -1U); + + /* VIDIOC_G_STD */ + ioctl(-1, VIDIOC_G_STD, 0); + printf("ioctl(-1, VIDIOC_G_STD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_STD, page); + printf("ioctl(-1, VIDIOC_G_STD, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_STD */ + ioctl(-1, VIDIOC_S_STD, 0); + printf("ioctl(-1, VIDIOC_S_STD, NULL) = -1 EBADF (%m)\n"); + + long long *const p_longlong = page + size - sizeof(*p_longlong); + ioctl(-1, VIDIOC_S_STD, p_longlong); + printf("ioctl(-1, VIDIOC_S_STD, [%#llx]) = -1 EBADF (%m)\n", + *p_longlong); + + /* VIDIOC_ENUMSTD */ + ioctl(-1, VIDIOC_ENUMSTD, 0); + printf("ioctl(-1, VIDIOC_ENUMSTD, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_standard *const p_v4l2_standard = + page + size - sizeof(*p_v4l2_standard); + ioctl(-1, VIDIOC_ENUMSTD, p_v4l2_standard); + printf("ioctl(-1, VIDIOC_ENUMSTD, {index=%u}) = -1 EBADF (%m)\n", + p_v4l2_standard->index); + + /* VIDIOC_ENUMINPUT */ + ioctl(-1, VIDIOC_ENUMINPUT, 0); + printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_input *const p_v4l2_input = + page + size - sizeof(*p_v4l2_input); + ioctl(-1, VIDIOC_ENUMINPUT, p_v4l2_input); + printf("ioctl(-1, VIDIOC_ENUMINPUT, {index=%u}) = -1 EBADF (%m)\n", + p_v4l2_input->index); + + /* VIDIOC_G_CTRL */ + ioctl(-1, VIDIOC_G_CTRL, 0); + printf("ioctl(-1, VIDIOC_G_CTRL, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_control *const p_v4l2_control = + page + size - sizeof(*p_v4l2_control); + ioctl(-1, VIDIOC_G_CTRL, p_v4l2_control); + printf("ioctl(-1, VIDIOC_G_CTRL, {id=%#x /* V4L2_CID_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_control->id); + + /* VIDIOC_S_CTRL */ + ioctl(-1, VIDIOC_S_CTRL, 0); + printf("ioctl(-1, VIDIOC_S_CTRL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_CTRL, p_v4l2_control); + printf("ioctl(-1, VIDIOC_S_CTRL, {id=%#x /* V4L2_CID_??? */" + ", value=%d}) = -1 EBADF (%m)\n", + p_v4l2_control->id, p_v4l2_control->value); + + /* VIDIOC_QUERYCTRL */ + ioctl(-1, VIDIOC_QUERYCTRL, 0); + printf("ioctl(-1, VIDIOC_QUERYCTRL, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_queryctrl *const p_v4l2_queryctrl = + page + size - sizeof(*p_v4l2_queryctrl); + ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl); +# ifdef V4L2_CTRL_FLAG_NEXT_CTRL + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL" + "|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n", + p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL); +# else + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id); +# endif + + struct v4l2_queryctrl *const p_queryctrl = + tail_alloc(sizeof(*p_queryctrl)); + p_queryctrl->id = V4L2_CID_SATURATION; + ioctl(-1, VIDIOC_QUERYCTRL, p_queryctrl); + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CID_SATURATION})" + " = -1 EBADF (%m)\n"); + + /* VIDIOC_G_INPUT */ + ioctl(-1, VIDIOC_G_INPUT, 0); + printf("ioctl(-1, VIDIOC_G_INPUT, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_INPUT, page); + printf("ioctl(-1, VIDIOC_G_INPUT, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_INPUT */ + ioctl(-1, VIDIOC_S_INPUT, 0); + printf("ioctl(-1, VIDIOC_S_INPUT, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_INPUT, p_int); + printf("ioctl(-1, VIDIOC_S_INPUT, [%u]) = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_CROPCAP */ + ioctl(-1, VIDIOC_CROPCAP, 0); + printf("ioctl(-1, VIDIOC_CROPCAP, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_cropcap *const p_v4l2_cropcap = + page + size - sizeof(*p_v4l2_cropcap); + ioctl(-1, VIDIOC_CROPCAP, p_v4l2_cropcap); + printf("ioctl(-1, VIDIOC_CROPCAP, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_cropcap->type); + + /* VIDIOC_G_CROP */ + ioctl(-1, VIDIOC_G_CROP, 0); + printf("ioctl(-1, VIDIOC_G_CROP, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_crop *const p_v4l2_crop = + page + size - sizeof(*p_v4l2_crop); + ioctl(-1, VIDIOC_G_CROP, p_v4l2_crop); + printf("ioctl(-1, VIDIOC_G_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_crop->type); + + /* VIDIOC_S_CROP */ + ioctl(-1, VIDIOC_S_CROP, 0); + printf("ioctl(-1, VIDIOC_S_CROP, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_CROP, p_v4l2_crop); + printf("ioctl(-1, VIDIOC_S_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", c={left=%d, top=%d, width=%u, height=%u}}) = -1 EBADF (%m)\n", + p_v4l2_crop->type, + p_v4l2_crop->c.left, + p_v4l2_crop->c.top, + p_v4l2_crop->c.width, + p_v4l2_crop->c.height); + +#ifdef VIDIOC_S_EXT_CTRLS + /* VIDIOC_S_EXT_CTRLS */ + ioctl(-1, VIDIOC_S_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_ext_controls *const p_ext_controls = + tail_alloc(sizeof(*p_ext_controls)); + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; + p_ext_controls->count = 0; + p_ext_controls->controls = (void *) -2UL; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_USER" + ", count=%u}) = -1 EBADF (%m)\n", p_ext_controls->count); + + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_MPEG; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_MPEG" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + +# if HAVE_DECL_V4L2_CTRL_TYPE_STRING + p_ext_controls->count = 2; + p_ext_controls->controls = + tail_alloc(sizeof(*p_ext_controls->controls) * p_ext_controls->count); + p_ext_controls->controls[0].id = V4L2_CID_BRIGHTNESS; + p_ext_controls->controls[0].size = 0; + p_ext_controls->controls[0].value64 = 0xfacefeeddeadbeefULL; + p_ext_controls->controls[1].id = V4L2_CID_CONTRAST; + p_ext_controls->controls[1].size = 2; + p_ext_controls->controls[1].string = + tail_alloc(p_ext_controls->controls[1].size); + + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + "] => controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + "], error_idx=%u}) = -1 EBADF (%m)\n", + p_ext_controls->count, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->error_idx); + + ++p_ext_controls->count; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + ", %p]}) = -1 EBADF (%m)\n", + p_ext_controls->count, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->controls + 2); +# endif /* HAVE_DECL_V4L2_CTRL_TYPE_STRING */ + + /* VIDIOC_TRY_EXT_CTRLS */ + ioctl(-1, VIDIOC_TRY_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_TRY_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; + p_ext_controls->count = magic; + p_ext_controls->controls = (void *) -2UL; + ioctl(-1, VIDIOC_TRY_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_TRY_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_USER, count=%u, controls=%p})" + " = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + + /* VIDIOC_G_EXT_CTRLS */ + ioctl(-1, VIDIOC_G_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_G_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_G_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_USER, count=%u, controls=%p" + ", error_idx=%u}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls, + p_ext_controls->error_idx); +#endif /* VIDIOC_S_EXT_CTRLS */ + +#ifdef VIDIOC_ENUM_FRAMESIZES + ioctl(-1, VIDIOC_ENUM_FRAMESIZES, 0); + printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_frmsizeenum *const p_frmsizeenum = + tail_alloc(sizeof(*p_frmsizeenum)); + p_frmsizeenum->index = magic; + p_frmsizeenum->pixel_format = fourcc(cc[0], cc[1], cc[2], cc[3]); + + ioctl(-1, VIDIOC_ENUM_FRAMESIZES, p_frmsizeenum); + printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, {index=%u" + ", pixel_format=v4l2_fourcc('%c', '\\%c', '\\%c', '\\x%x')})" + " = -1 EBADF (%m)\n", p_frmsizeenum->index, + cc[0], cc[1], cc[2], cc[3]); +#endif /* VIDIOC_ENUM_FRAMESIZES */ + +#ifdef VIDIOC_ENUM_FRAMEINTERVALS + ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, 0); + printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_frmivalenum *const p_v4l2_frmivalenum = + page + size - sizeof(*p_v4l2_frmivalenum); + ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, p_v4l2_frmivalenum); + printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, {index=%u" + ", pixel_format=v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", width=%u, height=%u}) = -1 EBADF (%m)\n", + p_v4l2_frmivalenum->index, + cc0(p_v4l2_frmivalenum->pixel_format), + cc1(p_v4l2_frmivalenum->pixel_format), + cc2(p_v4l2_frmivalenum->pixel_format), + cc3(p_v4l2_frmivalenum->pixel_format), + p_v4l2_frmivalenum->width, + p_v4l2_frmivalenum->height); +#endif /* VIDIOC_ENUM_FRAMEINTERVALS */ + +#ifdef VIDIOC_CREATE_BUFS + ioctl(-1, VIDIOC_CREATE_BUFS, 0); + printf("ioctl(-1, VIDIOC_CREATE_BUFS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_create_buffers *const p_v4l2_create_buffers = + page + size - sizeof(*p_v4l2_create_buffers); + ioctl(-1, VIDIOC_CREATE_BUFS, p_v4l2_create_buffers); + printf("ioctl(-1, VIDIOC_CREATE_BUFS, {count=%u, memory=%#x" + " /* V4L2_MEMORY_??? */, format={type=%#x" + " /* V4L2_BUF_TYPE_??? */}}) = -1 EBADF (%m)\n", + p_v4l2_create_buffers->count, + p_v4l2_create_buffers->memory, + p_v4l2_create_buffers->format.type); +#endif /* VIDIOC_CREATE_BUFS */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_v4l2.test b/tests-m32/ioctl_v4l2.test new file mode 100755 index 00000000..a092a3cd --- /dev/null +++ b/tests-m32/ioctl_v4l2.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic VIDIOC_* ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioperm.c b/tests-m32/ioperm.c new file mode 100644 index 00000000..2f02b523 --- /dev/null +++ b/tests-m32/ioperm.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_ioperm + +# include +# include + +int +main(void) +{ + const unsigned long port = (unsigned long) 0xdeafbeefffffffffULL; + + long rc = syscall(__NR_ioperm, port, 1, 0); + printf("ioperm(%#lx, %#lx, %d) = %ld %s (%m)\n", + port, 1UL, 0, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ioperm") + +#endif diff --git a/tests-m32/ioperm.test b/tests-m32/ioperm.test new file mode 100755 index 00000000..8c1c1cc7 --- /dev/null +++ b/tests-m32/ioperm.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ioperm syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/iopl.c b/tests-m32/iopl.c new file mode 100644 index 00000000..14ec29e3 --- /dev/null +++ b/tests-m32/iopl.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_iopl + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_iopl, 4); + printf("iopl(4) = %ld %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_iopl") + +#endif diff --git a/tests-m32/iopl.test b/tests-m32/iopl.test new file mode 100755 index 00000000..d0b5b113 --- /dev/null +++ b/tests-m32/iopl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check iopl syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-m32/ioprio.c b/tests-m32/ioprio.c new file mode 100644 index 00000000..44ace6c3 --- /dev/null +++ b/tests-m32/ioprio.c @@ -0,0 +1,102 @@ +/* + * Check decoding of ioprio_get and ioprio_set syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_ioprio_get) && defined(__NR_ioprio_set) + +# include +# include + +enum { + IOPRIO_CLASS_NONE, + IOPRIO_CLASS_RT, + IOPRIO_CLASS_BE, + IOPRIO_CLASS_IDLE +}; + +# include "xlat.h" +# include "xlat/ioprio_class.h" + +void +print_ioprio(unsigned long val) +{ + printf(" (IOPRIO_PRIO_VALUE("); + printxval(ioprio_class, val >> 13, "IOPRIO_CLASS_???"); + printf(", %d))", (int) (val & 0x1fff)); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_which = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + static const kernel_ulong_t bogus_who = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_ioprio = + (kernel_ulong_t) 0xdec0ded1facefeedULL; + static const char * const bogus_ioprio_str = + "IOPRIO_PRIO_VALUE(0x7d677 /* IOPRIO_CLASS_??? */, 7917)"; + + long rc; + + rc = syscall(__NR_ioprio_get, bogus_which, bogus_who); + printf("ioprio_get(%#x /* IOPRIO_WHO_??? */, %d) = %s\n", + (int) bogus_which, (int) bogus_who, sprintrc(rc)); + + rc = syscall(__NR_ioprio_get, 1, 0); + printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", sprintrc(rc)); + + if (rc >= -1) + print_ioprio(rc); + + puts(""); + + rc = syscall(__NR_ioprio_set, 2, 0, 8191); + printf("ioprio_set(IOPRIO_WHO_PGRP, 0, " + "IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_ioprio_set, bogus_which, bogus_who, bogus_ioprio); + printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %s) = %s\n", + (int) bogus_which, (int) bogus_who, bogus_ioprio_str, + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ioprio_get && __NR_ioprio_set"); + +#endif diff --git a/tests-m32/ioprio.test b/tests-m32/ioprio.test new file mode 100755 index 00000000..e79310b3 --- /dev/null +++ b/tests-m32/ioprio.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check iprio_get and iprio_set syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests-m32/ip_mreq.c b/tests-m32/ip_mreq.c new file mode 100644 index 00000000..fa0c504b --- /dev/null +++ b/tests-m32/ip_mreq.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \ + && defined IPV6_JOIN_ANYCAST && defined HAVE_IF_INDEXTONAME + +# include +# include +# include +# include +# include + +int +main(void) +{ + static const char multi4addr[] = "224.0.0.3"; + static const char multi6addr[] = "ff01::c"; + static const char interface[] = "127.0.0.1"; + + struct ip_mreq *const m4 = tail_alloc(sizeof(*m4)); + struct ipv6_mreq *const m6 = tail_alloc(sizeof(*m6)); + unsigned int i; + int rc; + + inet_pton(AF_INET, multi4addr, &m4->imr_multiaddr); + inet_pton(AF_INET, interface, &m4->imr_interface); + inet_pton(AF_INET6, multi6addr, &m6->ipv6mr_multiaddr); + + m6->ipv6mr_interface = if_nametoindex("lo"); + if (!m6->ipv6mr_interface) + perror_msg_and_skip("lo"); + + (void) close(0); + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + + struct { + int level; + const char *str_level; + int optname; + const char *str_optname; + void *optval; + unsigned int optsize; + } short_any[] = { + { + ARG_STR(SOL_IP), ARG_STR(IP_ADD_MEMBERSHIP), + m4, sizeof(*m4) + }, + { + ARG_STR(SOL_IP), ARG_STR(IP_DROP_MEMBERSHIP), + m4, sizeof(*m4) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_ADD_MEMBERSHIP), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_DROP_MEMBERSHIP), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_JOIN_ANYCAST), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_LEAVE_ANYCAST), + m6, sizeof(*m6) + } + }; + + for (i = 0; i < ARRAY_SIZE(short_any); ++i) { + rc = setsockopt(0, short_any[i].level, short_any[i].optname, + short_any[i].optval, 1); + printf("setsockopt(0, %s, %s, \"\\%hho\", 1) = %s\n", + short_any[i].str_level, short_any[i].str_optname, + * (unsigned char *) short_any[i].optval, + sprintrc(rc)); + + rc = setsockopt(0, short_any[i].level, short_any[i].optname, + short_any[i].optval + 1, short_any[i].optsize); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + short_any[i].str_level, short_any[i].str_optname, + short_any[i].optval + 1, short_any[i].optsize, + sprintrc(rc)); + } + + struct { + int optname; + const char *str_optname; + } long_ip[] = { + { ARG_STR(IP_ADD_MEMBERSHIP) }, + { ARG_STR(IP_DROP_MEMBERSHIP) } + }, long_ipv6[] = { + { ARG_STR(IPV6_ADD_MEMBERSHIP) }, + { ARG_STR(IPV6_DROP_MEMBERSHIP) }, + { ARG_STR(IPV6_JOIN_ANYCAST) }, + { ARG_STR(IPV6_LEAVE_ANYCAST) } + }; + + for (i = 0; i < ARRAY_SIZE(long_ip); ++i) { + rc = setsockopt(0, SOL_IP, long_ip[i].optname, + m4, sizeof(*m4)); + printf("setsockopt(0, SOL_IP, %s" + ", {imr_multiaddr=inet_addr(\"%s\")" + ", imr_interface=inet_addr(\"%s\")}, %u) = %s\n", + long_ip[i].str_optname, multi4addr, + interface, (unsigned) sizeof(*m4), sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(long_ipv6); ++i) { + rc = setsockopt(0, SOL_IPV6, long_ipv6[i].optname, + m6, sizeof(*m6)); + printf("setsockopt(0, SOL_IPV6, %s" + ", {ipv6mr_multiaddr=inet_pton(\"%s\")" + ", ipv6mr_interface=if_nametoindex(\"lo\")}" + ", %u) = %s\n", + long_ipv6[i].str_optname, multi6addr, + (unsigned) sizeof(*m6), sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("IP_ADD_MEMBERSHIP && IPV6_ADD_MEMBERSHIP" + " && IPV6_JOIN_ANYCAST && HAVE_IF_INDEXTONAME") + +#endif diff --git a/tests-m32/ip_mreq.test b/tests-m32/ip_mreq.test new file mode 100755 index 00000000..d0a9e0f1 --- /dev/null +++ b/tests-m32/ip_mreq.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check {IP,IPV6}_{ADD,DROP}_MEMBERSHIP setsockopt decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-m32/ipc.c b/tests-m32/ipc.c new file mode 100644 index 00000000..c64d3716 --- /dev/null +++ b/tests-m32/ipc.c @@ -0,0 +1,122 @@ +/* + * Check decoding of ipc syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_ipc && defined HAVE_LINUX_IPC_H + +# include +# include +# include +# include + +# ifndef SEMCTL +# define SEMCTL 3 +# endif +# ifndef MSGRCV +# define MSGRCV 12 +# endif + +static int +ipc_call(const unsigned short version, const unsigned short call, + long a1, long a2, long a3, long a4, long a5) +{ + const unsigned long val = + (unsigned long) 0xfacefeed00000000ULL | + (unsigned int) version << 16 | + call; + + return syscall(__NR_ipc, val, a1, a2, a3, a4, a5); +} + +static int +ipc_call0(const unsigned short version, const unsigned short call) +{ + int rc = ipc_call(version, call, 0, 0, 0, 0, 0); + int saved_errno = errno; + printf("ipc("); + if (version) + printf("%hu<<16|", version); + errno = saved_errno; + printf("%hu, 0, 0, 0, 0%s) = %d %s (%m)\n", call, +# ifdef __s390__ + "", +# else + ", 0", +# endif + rc, errno2name()); + return rc; +} + +int +main(void) +{ + void *const efault = tail_alloc(1) + 1; + + int rc = ipc_call(0, SEMCTL, 0, 0, 0, (long) efault, 0); + if (rc != -1 || EFAULT != errno) + perror_msg_and_skip("ipc"); + printf("semctl(0, 0, IPC_RMID, %p) = -1 EFAULT (%m)\n", efault); + + unsigned short call; + for (call = 0; call <= 40; call += 10) { + ipc_call0(0, call); + ipc_call0(42, call); + } + + rc = ipc_call(42, SEMCTL, 0, 0, 0, (long) efault, 0); + int test_version = EFAULT == errno; + if (test_version) + printf("semctl(0, 0, IPC_RMID, %p) = %d %s (%m)\n", + efault, rc, errno2name()); + else + printf("ipc(42<<16|SEMCTL, 0, 0, 0, %p) = %d %s (%m)\n", + efault, rc, errno2name()); + + if (test_version) { + const int msqid = -2; + const long msgsz = -3; + const long msgtyp = 0; + + rc = ipc_call(1, MSGRCV, + msqid, msgsz, IPC_NOWAIT, (long) efault, msgtyp); + printf("msgrcv(%d, %p, %lu, %ld, IPC_NOWAIT) = %d %s (%m)\n", + msqid, efault, msgsz, msgtyp, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ipc && HAVE_LINUX_IPC_H") + +#endif diff --git a/tests-m32/ipc.sh b/tests-m32/ipc.sh new file mode 100644 index 00000000..752d4bb2 --- /dev/null +++ b/tests-m32/ipc.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of ipc syscalls + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -eipc $args > "$OUT" +match_grep "$LOG" "$OUT" + +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/ipc.test b/tests-m32/ipc.test new file mode 100755 index 00000000..aa33fa61 --- /dev/null +++ b/tests-m32/ipc.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ipc syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/ipc_msg.c b/tests-m32/ipc_msg.c new file mode 100644 index 00000000..b4938439 --- /dev/null +++ b/tests-m32/ipc_msg.c @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resource_flags.h" + +/* + * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data + * provided in third argument of msgctl call (in case of IPC_SET cmd) + * which led to segmentation fault. + */ +#undef TEST_MSGCTL_BOGUS_ADDR +#if defined __GLIBC__ && defined POWERPC64 +# if !(defined __GLIBC_MINOR__) \ + || ((__GLIBC__ << 16) + __GLIBC_MINOR__ < (2 << 16) + 23) +# define TEST_MSGCTL_BOGUS_ADDR 0 +# endif +#endif /* __GLIBC__ && POWERPC64 */ + +#ifndef TEST_MSGCTL_BOGUS_ADDR +# define TEST_MSGCTL_BOGUS_ADDR 1 +#endif + +static int id = -1; + +static void +cleanup(void) +{ + msgctl(id, IPC_RMID, NULL); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_msgid = 0xfdb97531; + static const int bogus_cmd = 0xdeadbeef; +#if TEST_MSGCTL_BOGUS_ADDR + static void * const bogus_addr = (void *) -1L; +#endif + static const int bogus_flags = 0xface1e55 & ~IPC_CREAT; + + int rc; + struct msqid_ds ds; + + rc = msgget(bogus_key, bogus_flags); + printf("msgget\\(%#llx, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = msgget(private_key, 0600); + if (id < 0) + perror_msg_and_skip("msgget"); + printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = msgctl(bogus_msgid, bogus_cmd, NULL); + printf("msgctl\\(%d, (IPC_64\\|)?%#x /\\* MSG_\\?\\?\\? \\*/, NULL\\)" + " += %s\n", bogus_msgid, bogus_cmd, sprintrc_grep(rc)); + +#if TEST_MSGCTL_BOGUS_ADDR + rc = msgctl(bogus_msgid, IPC_SET, bogus_addr); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, %p\\) += %s\n", + bogus_msgid, bogus_addr, sprintrc_grep(rc)); +#endif + + if (msgctl(id, IPC_STAT, &ds)) + perror_msg_and_skip("msgctl IPC_STAT"); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u" + ", msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u" + ", msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\n", + id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + (unsigned) ds.msg_perm.mode, (unsigned) ds.msg_perm.__key, + (unsigned) ds.msg_perm.cuid, (unsigned) ds.msg_perm.cgid, + (unsigned) ds.msg_stime, (unsigned) ds.msg_rtime, + (unsigned) ds.msg_ctime, (unsigned) ds.msg_qnum, + (unsigned) ds.msg_qbytes, (unsigned) ds.msg_lspid, + (unsigned) ds.msg_lrpid); + + if (msgctl(id, IPC_SET, &ds)) + perror_msg_and_skip("msgctl IPC_SET"); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o\\}, ...\\}\\) += 0\n", + id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + (unsigned) ds.msg_perm.mode); + + rc = msgctl(0, MSG_INFO, &ds); + printf("msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %s\n", + &ds, sprintrc_grep(rc)); + + rc = msgctl(id, MSG_STAT, &ds); + printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests-m32/ipc_msg.test b/tests-m32/ipc_msg.test new file mode 100755 index 00000000..177495b0 --- /dev/null +++ b/tests-m32/ipc_msg.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc msgget/msgctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_msgbuf.c b/tests-m32/ipc_msgbuf.c new file mode 100644 index 00000000..1c34494d --- /dev/null +++ b/tests-m32/ipc_msgbuf.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#define text_string "STRACE_STRING" +#define msgsz sizeof(text_string) + +static int msqid = -1; + +static void +cleanup(void) +{ + msgctl(msqid, IPC_RMID, 0); + msqid = -1; +} + +int +main (void) +{ + const long mtype = 0xdefaced; + struct { + kernel_long_t mtype; + char mtext[msgsz]; + } msg = { + .mtype = mtype, + .mtext = text_string + }; + msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); + if (msqid == -1) + perror_msg_and_skip("msgget"); + atexit(cleanup); + if (msgsnd(msqid, &msg, msgsz, 0) == -1) + perror_msg_and_skip("msgsnd"); + if (msgrcv(msqid, &msg, msgsz, mtype, 0) != msgsz) + perror_msg_and_skip("msgrcv"); + return 0; +} diff --git a/tests-m32/ipc_msgbuf.expected b/tests-m32/ipc_msgbuf.expected new file mode 100644 index 00000000..880424bf --- /dev/null +++ b/tests-m32/ipc_msgbuf.expected @@ -0,0 +1,4 @@ +msgget\(IPC_PRIVATE, IPC_CREAT\|0700\) += [0-9]* +msgsnd\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 0\) += 0 +msgrcv\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 233811181, 0\) += 14 +msgctl\([0-9]*, (IPC_64\|)?IPC_RMID, NULL\) += 0 diff --git a/tests-m32/ipc_msgbuf.test b/tests-m32/ipc_msgbuf.test new file mode 100755 index 00000000..d0b65d1a --- /dev/null +++ b/tests-m32/ipc_msgbuf.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check msgget, msgsnd, msgrcv, msgctl syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -v -e msgget,msgsnd,msgrcv,msgctl $args +match_grep + +exit 0 diff --git a/tests-m32/ipc_sem.c b/tests-m32/ipc_sem.c new file mode 100644 index 00000000..8f6382cc --- /dev/null +++ b/tests-m32/ipc_sem.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2015 Andreas Schwab + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resource_flags.h" + +union semun { + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO + (Linux-specific) */ +}; + +static int id = -1; + +static void +cleanup(void) +{ + semctl(id, 0, IPC_RMID, 0); + printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_RMID, \\[?NULL\\]?\\) += 0\n", + id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_semid = 0xfdb97531; + static const int bogus_semnum = 0xeca86420; + static const int bogus_size = 0xdec0ded1; + static const int bogus_flags = 0xface1e55; + static const int bogus_cmd = 0xdeadbeef; + static const unsigned long bogus_arg = + (unsigned long) 0xbadc0dedfffffaceULL; + + int rc; + union semun un; + struct semid_ds ds; + struct seminfo info; + + rc = semget(bogus_key, bogus_size, bogus_flags); + printf("semget\\(%#llx, %d, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), bogus_size, + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = semget(private_key, 1, 0600); + if (id < 0) + perror_msg_and_skip("semget"); + printf("semget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = semctl(bogus_semid, bogus_semnum, bogus_cmd, bogus_arg); +#define SEMCTL_BOGUS_ARG_FMT "(%#lx|\\[(%#lx|NULL)\\]|NULL)" + printf("semctl\\(%d, %d, (IPC_64\\|)?%#x /\\* SEM_\\?\\?\\? \\*/" + ", " SEMCTL_BOGUS_ARG_FMT "\\) += %s\n", + bogus_semid, bogus_semnum, bogus_cmd, + bogus_arg, bogus_arg, sprintrc_grep(rc)); + + un.buf = &ds; + if (semctl(id, 0, IPC_STAT, un)) + perror_msg_and_skip("semctl IPC_STAT"); + printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_STAT, \\[?%p\\]?\\) += 0\n", + id, &ds); + + un.__buf = &info; + rc = semctl(0, 0, SEM_INFO, un); + printf("semctl\\(0, 0, (IPC_64\\|)?SEM_INFO, \\[?%p\\]?\\) += %s\n", + &info, sprintrc_grep(rc)); + + un.buf = &ds; + rc = semctl(id, 0, SEM_STAT, un); + printf("semctl\\(%d, 0, (IPC_64\\|)?SEM_STAT, \\[?%p\\]?\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests-m32/ipc_sem.test b/tests-m32/ipc_sem.test new file mode 100755 index 00000000..cc93d07b --- /dev/null +++ b/tests-m32/ipc_sem.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc semget/semctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_shm.c b/tests-m32/ipc_shm.c new file mode 100644 index 00000000..66960ff9 --- /dev/null +++ b/tests-m32/ipc_shm.c @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/shm_resource_flags.h" + +static int id = -1; + +static void +cleanup(void) +{ + shmctl(id, IPC_RMID, NULL); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_id = 0xdefaced1; + static const int bogus_cmd = 0xdefaced2; + static void * const bogus_addr = (void *) -1L; + static const size_t bogus_size = + /* + * musl sets size to SIZE_MAX if size argument is greater than + * PTRDIFF_MAX - musl/src/ipc/shmget.c + */ + #ifdef __GLIBC__ + (size_t) 0xdec0ded1dec0ded2ULL; + #else + (size_t) 0x1e55c0de5dec0dedULL; + #endif + static const int bogus_flags = 0xface1e55; + + int rc; + struct shmid_ds ds; + + rc = shmget(bogus_key, bogus_size, bogus_flags); + printf("shmget\\(%#llx, %zu, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), bogus_size, + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + SHM_HUGETLB & bogus_flags ? "SHM_HUGETLB\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | SHM_HUGETLB), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = shmget(private_key, 1, 0600); + if (id < 0) + perror_msg_and_skip("shmget"); + printf("shmget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = shmctl(bogus_id, bogus_cmd, NULL); + printf("shmctl\\(%d, (IPC_64\\|)?%#x /\\* SHM_\\?\\?\\? \\*/, NULL\\)" + " += %s\n", bogus_id, bogus_cmd, sprintrc_grep(rc)); + + rc = shmctl(bogus_id, IPC_STAT, bogus_addr); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_STAT, %p\\) += %s\n", + bogus_id, bogus_addr, sprintrc_grep(rc)); + + if (shmctl(id, IPC_STAT, &ds)) + perror_msg_and_skip("shmctl IPC_STAT"); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{shm_perm=\\{uid=%u, gid=%u, " + "mode=%#o, key=%u, cuid=%u, cgid=%u\\}, shm_segsz=%u, shm_cpid=%u, " + "shm_lpid=%u, shm_nattch=%u, shm_atime=%u, shm_dtime=%u, " + "shm_ctime=%u\\}\\) += 0\n", + id, (unsigned) ds.shm_perm.uid, (unsigned) ds.shm_perm.gid, + (unsigned) ds.shm_perm.mode, (unsigned) ds.shm_perm.__key, + (unsigned) ds.shm_perm.cuid, (unsigned) ds.shm_perm.cgid, + (unsigned) ds.shm_segsz, (unsigned) ds.shm_cpid, + (unsigned) ds.shm_lpid, (unsigned) ds.shm_nattch, + (unsigned) ds.shm_atime, (unsigned) ds.shm_dtime, + (unsigned) ds. shm_ctime); + + if (shmctl(id, IPC_SET, &ds)) + perror_msg_and_skip("shmctl IPC_SET"); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_SET, \\{shm_perm=\\{uid=%u, gid=%u" + ", mode=%#o\\}, ...\\}\\) += 0\n", + id, (unsigned) ds.shm_perm.uid, (unsigned) ds.shm_perm.gid, + (unsigned) ds.shm_perm.mode); + + rc = shmctl(0, SHM_INFO, &ds); + printf("shmctl\\(0, (IPC_64\\|)?SHM_INFO, %p\\) += %s\n", + &ds, sprintrc_grep(rc)); + + rc = shmctl(id, SHM_STAT, &ds); + printf("shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests-m32/ipc_shm.test b/tests-m32/ipc_shm.test new file mode 100755 index 00000000..a67ea291 --- /dev/null +++ b/tests-m32/ipc_shm.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc shmget/shmctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/kcmp.c b/tests-m32/kcmp.c new file mode 100644 index 00000000..cb497c9f --- /dev/null +++ b/tests-m32/kcmp.c @@ -0,0 +1,103 @@ +/* + * Check decoding of kcmp syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include "scno.h" + +#ifdef __NR_kcmp + +# include +# include + +# define KCMP_FILE 0 +# define KCMP_SYSVSEM 6 + +static void +do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, + const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2) +{ + long rc; + const char *errstr; + + rc = syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2); + errstr = sprintrc(rc); + + printf("kcmp(%d, %d, ", (int) pid1, (int) pid2); + + if (type_str) + printf("%s", type_str); + else + printf("%#x /* KCMP_??? */", (int) type); + + if (type == KCMP_FILE) + printf(", %u, %u", (unsigned) idx1, (unsigned) idx2); + else if (type > KCMP_SYSVSEM) + printf(", %#llx, %#llx", + (unsigned long long) idx1, (unsigned long long) idx2); + + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_pid1 = + (kernel_ulong_t) 0xdeadca75face1057ULL; + static const kernel_ulong_t bogus_pid2 = + (kernel_ulong_t) 0xdefaced1defaced2ULL; + static const kernel_ulong_t bogus_type = + (kernel_ulong_t) 0xbadc0dedda7adeadULL; + static const kernel_ulong_t bogus_idx1 = + (kernel_ulong_t) 0xdec0ded3dec0ded4ULL; + static const kernel_ulong_t bogus_idx2 = + (kernel_ulong_t) 0xba5e1e55deadc0deULL; + + /* Invalid values */ + do_kcmp(bogus_pid1, bogus_pid2, bogus_type, NULL, bogus_idx1, + bogus_idx2); + do_kcmp(0, 0, KCMP_SYSVSEM + 1, NULL, 0, 0); + + /* KCMP_FILE is the only type which has additional args */ + do_kcmp(3141592653U, 2718281828U, ARG_STR(KCMP_FILE), bogus_idx1, + bogus_idx2); + /* Some type without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_SYSVSEM), bogus_idx1, bogus_idx2); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kcmp"); + +#endif diff --git a/tests-m32/kcmp.test b/tests-m32/kcmp.test new file mode 100755 index 00000000..d022aeba --- /dev/null +++ b/tests-m32/kcmp.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kcmp syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/kexec_file_load.c b/tests-m32/kexec_file_load.c new file mode 100644 index 00000000..be90a37d --- /dev/null +++ b/tests-m32/kexec_file_load.c @@ -0,0 +1,127 @@ +/* + * Check decoding of kexec_file_load syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_kexec_file_load + +# include +# include +# include + +struct strval { + kernel_ulong_t val; + const char *str64; + const char *str32; + const char *str; +}; + +#define CMDLINE_STR "deadcodebaddatadefaced"; + +int +main(void) +{ + static const kernel_ulong_t bogus_kernel_fd = + (kernel_ulong_t) 0xdeadca57badda7a1ULL; + static const kernel_ulong_t bogus_initrd_fd = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + static const char cmdline_str[] = CMDLINE_STR; + static const char cmdline_short_str[] = "abcdef"; + + static const kernel_ulong_t cmdline_lens[] = { + 0, + (kernel_ulong_t) 0xcaffeeeddeadbeefULL, + sizeof(cmdline_str), + sizeof(cmdline_str) - 1, + sizeof(cmdline_short_str), + sizeof(cmdline_short_str) - 1, + sizeof(cmdline_short_str) + 1, + }; + static const struct strval flags[] = { + { (kernel_ulong_t) 0xbadc0dedda7a1058ULL, + "0xbadc0ded", "0x", + "da7a1058 /* KEXEC_FILE_??? */" }, + { 0, "", "", "0" }, + { 0xdeadbeef, "", "", "KEXEC_FILE_UNLOAD|KEXEC_FILE_ON_CRASH|" + "KEXEC_FILE_NO_INITRAMFS|0xdeadbee8" }, + }; + + + long rc; + char *cmdline = tail_memdup(cmdline_str, sizeof(cmdline_str)); + char *cmdline_short = + tail_memdup(cmdline_short_str, sizeof(cmdline_short_str)); + char cmdline_ptr[sizeof("0x") + sizeof(void *) * 2]; + char cmdline_short_ptr[sizeof("0x") + sizeof(void *) * 2]; + unsigned int i; + unsigned int j; + + struct strval cmdlines[] = { + { (uintptr_t) NULL, "", "", "NULL" }, + { (uintptr_t) (cmdline + sizeof(cmdline_str)), "", "", + cmdline_ptr }, + { (uintptr_t) cmdline, "", "", "\"deadcodeb\"..." }, + { (uintptr_t) cmdline, "", "", "\"deadcodeb\"..." }, + { (uintptr_t) cmdline_short, "", "", "\"abcdef\\0\"" }, + { (uintptr_t) cmdline_short, "", "", "\"abcdef\"" }, + { (uintptr_t) cmdline_short, "", "", cmdline_short_ptr }, + }; + + + snprintf(cmdline_ptr, sizeof(cmdline_ptr), "%p", + cmdline + sizeof(cmdline_str)); + snprintf(cmdline_short_ptr, sizeof(cmdline_short_ptr), "%p", + cmdline_short); + + for (i = 0; i < ARRAY_SIZE(flags); i++) { + for (j = 0; j < ARRAY_SIZE(cmdlines); j++) { + rc = syscall(__NR_kexec_file_load, bogus_kernel_fd, + bogus_initrd_fd, cmdline_lens[j], + cmdlines[j].val, flags[i].val); + printf("kexec_file_load(%d, %d, %llu, %s, %s%s) = %s\n", + (int) bogus_kernel_fd, (int) bogus_initrd_fd, + (unsigned long long) cmdline_lens[j], + cmdlines[j].str, + sizeof(kernel_ulong_t) == 8 ? flags[i].str64 : + flags[i].str32, flags[i].str, sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kexec_file_load"); + +#endif diff --git a/tests-m32/kexec_file_load.test b/tests-m32/kexec_file_load.test new file mode 100755 index 00000000..c95e1238 --- /dev/null +++ b/tests-m32/kexec_file_load.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kexec_file_load syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-m32/kexec_load.c b/tests-m32/kexec_load.c new file mode 100644 index 00000000..330238de --- /dev/null +++ b/tests-m32/kexec_load.c @@ -0,0 +1,170 @@ +/* + * Check decoding of kexec_load syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_kexec_load + +# include +# include + +struct strval { + kernel_ulong_t val; + const char *str64; + const char *str32; + const char *str; +}; + +struct segm { + void *buf; + size_t bufsz; + void *mem; + size_t memsz; +}; + +int +main(void) +{ + enum { + NUM_SEGMS = 17, + NUM_SEGMS_UNCUT = 5, + NUM_SEGMS_UNCUT_MAX = 9, + NUM_SEGMS_CUT = 12, + SEGMS_ARRAY_SIZE = sizeof(struct segm) * NUM_SEGMS, + }; + + static const kernel_ulong_t bogus_zero = + sizeof(long) < sizeof(kernel_long_t) ? + (kernel_ulong_t) 0xffffffff00000000ULL : 0; + static const kernel_ulong_t bogus_entry = + (kernel_ulong_t) 0xdeadca57badda7a1ULL; + static const kernel_ulong_t bogus_nsegs = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + + static const struct strval flags[] = { + { (kernel_ulong_t) 0xbadc0dedda7a1054ULL, + "0xda7a0000 /* KEXEC_ARCH_??? */|0xbadc0ded0000", + "0xda7a0000 /* KEXEC_ARCH_??? */|0x", + "1054 /* KEXEC_??? */" }, + { 0, "", "", "KEXEC_ARCH_DEFAULT" }, + { 0x2a0003, "", "", + "KEXEC_ARCH_SH|KEXEC_ON_CRASH|KEXEC_PRESERVE_CONTEXT" }, + { 0xdead0000, "", "", "0xdead0000 /* KEXEC_ARCH_??? */" }, + }; + + const char *errstr; + long rc; + struct segm *segms = tail_alloc(SEGMS_ARRAY_SIZE); + unsigned int i; + + fill_memory(segms, SEGMS_ARRAY_SIZE); + segms[0].buf = segms[0].mem = NULL; + + rc = syscall(__NR_kexec_load, bogus_zero, bogus_zero, bogus_zero, + flags[0].val); + printf("kexec_load(NULL, 0, NULL, %s%s) = %s\n", + sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, + flags[0].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, bogus_nsegs, + segms + SEGMS_ARRAY_SIZE, flags[1].val); + printf("kexec_load(%#lx, %lu, %p, %s) = %s\n", + (unsigned long) bogus_entry, (unsigned long) bogus_nsegs, + segms + SEGMS_ARRAY_SIZE, flags[1].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS, + segms, flags[2].val); + printf("kexec_load(%#lx, %lu, %p, %s) = %s\n", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS, + segms, flags[2].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms, flags[3].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [{buf=NULL, bufsz=%zu, mem=NULL, " + "memsz=%zu}, ", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT, + segms[0].bufsz, segms[0].memsz); + for (i = 1; i < NUM_SEGMS_UNCUT_MAX; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("...], %s) = %s\n", flags[3].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms + (NUM_SEGMS - NUM_SEGMS_UNCUT_MAX), + flags[0].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT); + for (i = NUM_SEGMS - NUM_SEGMS_UNCUT_MAX; i < NUM_SEGMS; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("%p], %s%s) = %s\n", + segms + NUM_SEGMS, + sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, + flags[0].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_UNCUT, + segms + (NUM_SEGMS - NUM_SEGMS_UNCUT), + flags[1].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_UNCUT); + for (i = NUM_SEGMS - NUM_SEGMS_UNCUT; i < NUM_SEGMS; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}%s", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz, + (i == NUM_SEGMS - 1) ? "" : ", "); + printf("], %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms + 1, flags[2].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT); + for (i = 1; i < NUM_SEGMS_UNCUT_MAX + 1; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("...], %s) = %s\n", flags[2].str, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kexec_load"); + +#endif diff --git a/tests-m32/kexec_load.test b/tests-m32/kexec_load.test new file mode 100755 index 00000000..4b1511e9 --- /dev/null +++ b/tests-m32/kexec_load.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kexec_load syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-m32/keyctl.c b/tests-m32/keyctl.c new file mode 100644 index 00000000..2e26076b --- /dev/null +++ b/tests-m32/keyctl.c @@ -0,0 +1,820 @@ +/* + * Check decoding of keyctl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_keyctl + +# include +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +/* This check should be before #include "xlat/keyctl_commands.h" */ +# ifndef KEYCTL_DH_COMPUTE +struct keyctl_dh_params { + int32_t private; + int32_t prime; + int32_t base; +}; +# endif + +# include "xlat.h" +# include "xlat/keyctl_commands.h" + +# ifndef KEY_SPEC_REQKEY_AUTH_KEY +# define KEY_SPEC_REQKEY_AUTH_KEY -7 +# endif + +# ifndef KEY_SPEC_REQUESTOR_KEYRING +# define KEY_SPEC_REQUESTOR_KEYRING -8 +# endif + +static const size_t limit = 10; + +/* + * Well, this is true for DESCRIBE and GET_SECURITY, and false for READ and + * DH_COMPUTE and I see no ability to pass this information without + * significantly breaking interface. + */ +bool nul_terminated_buf = true; +bool buf_in_arg = false; + +/* + * When this is called with positive size, the buffer provided is an "out" + * argument and rc contains resulting size (globally defined nul_terminated_buf + * controls whether it is nul-terminated or not). If size is negative, + * it contains "in" argument. + */ +void +print_quoted_string_limit(const char *str, size_t size, long rc) +{ + size_t print_size = ((rc >= 0) && (size > 0)) ? + ((unsigned long) rc > size ? size : + (unsigned long) rc) : size; + size_t limited_size = print_size > limit ? limit : print_size; + + if ((rc == -1) && !buf_in_arg) { + printf("%p", str); + return; + } + + if (!nul_terminated_buf || + (strnlen(str, limited_size) == limited_size)) { + printf("\""); + print_quoted_memory(str, limited_size); + if (print_size > limit) + printf("\"..."); + else + printf("\""); + } else { + printf("\""); + print_quoted_string(str); + printf("\""); + } +} + +static void +print_arg(kernel_ulong_t arg, const char *str, const char *fmt, size_t size, + long rc) +{ + if (size == (size_t) -1) + size = 0; + + if (str) { + printf("%s", str); + } else { + if (size == sizeof(uint64_t)) + printf(fmt, (uint64_t)arg); + else if (size == sizeof(uint32_t)) + printf(fmt, (uint32_t)arg); + else + print_quoted_string_limit((void *) (uintptr_t) arg, + size, rc); + } +} + +/* + * Arguments are passed as sz, val, str, fmt. Arguments are read until 4 + * arguments are retrieved or size of 0 is occurred. + * + * str == NULL && fmt == NULL && sz not in {4, 8} - print_quoted_string_limit is + * used for argument printing. If sz is negative, in argument is assumed, out + * otherwise. + */ +void +do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) +{ + kernel_ulong_t args[4] = { + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, + }; + const char *arg_str[4] = { NULL }; + const char *arg_fmt[4] = { "%llu", "%llu", "%llu", "%llu" }; + size_t arg_sz[4] = { + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + }; + unsigned i; + unsigned cnt = 0; + + va_list ap; + + va_start(ap, cmd_str); + + do { + arg_sz[cnt] = va_arg(ap, size_t); + if (!arg_sz[cnt]) + break; + + if (arg_sz[cnt] == sizeof(uint64_t)) + args[cnt] = va_arg(ap, uint64_t); + else if (arg_sz[cnt] == sizeof(uint32_t)) + args[cnt] = va_arg(ap, uint32_t); + else + args[cnt] = (uintptr_t) va_arg(ap, void *); + + arg_str[cnt] = va_arg(ap, char *); + arg_fmt[cnt] = va_arg(ap, char *); + } while (++cnt < 4); + + long rc = syscall(__NR_keyctl, cmd, args[0], args[1], args[2], args[3]); + const char *errstr = sprintrc(rc); + printf("keyctl(%s", cmd_str); + for (i = 0; i < cnt; i++) { + printf(", "); + print_arg(args[i], arg_str[i], arg_fmt[i], arg_sz[i], rc); + } + printf(") = %s\n", errstr); +} + +int +main(void) +{ + enum { PR_LIMIT = 10, IOV_SIZE = 11, IOV_STR_SIZE = 4096 }; + + static const char *kulong_fmt = + sizeof(kernel_ulong_t) == sizeof(uint64_t) ? "%#llx" : "%#x"; + static const char *ksize_fmt = + sizeof(kernel_ulong_t) == sizeof(uint64_t) ? "%llu" : "%u"; + static const char *ptr_fmt = + sizeof(void *) == sizeof(uint64_t) ? "%#llx" : "%#x"; + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char short_type_str[] = "shrt type"; + static const char short_desc_str[] = "shrt desc"; + static const char long_type_str[] = "overly long key type"; + static const char long_desc_str[] = "overly long key description"; + static const int32_t bogus_key1 = 0xdeadf00d; + static const int32_t bogus_key2 = 0x1eefdead; + static const kernel_ulong_t bogus_key3 = + (kernel_ulong_t) 0xdec0ded1dec0ded2ULL; + static const char *bogus_key3_str = "-557785390"; + + static const struct keyctl_dh_params kcdhp_data = { + KEY_SPEC_GROUP_KEYRING, 1234567890, 3141592653U }; + static const char *kcdhp_str = "{private=KEY_SPEC_GROUP_KEYRING, " + "prime=1234567890, base=-1153374643}"; + + char *bogus_str = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *short_type = tail_memdup(short_type_str, sizeof(short_type_str)); + char *short_desc = tail_memdup(short_desc_str, sizeof(short_desc_str)); + char *long_type = tail_memdup(long_type_str, sizeof(long_type_str)); + char *long_desc = tail_memdup(long_desc_str, sizeof(long_desc_str)); + char *kcdhp = tail_memdup(&kcdhp_data, sizeof(kcdhp_data)); + struct iovec *key_iov = tail_alloc(sizeof(*key_iov) * IOV_SIZE); + char *bogus_buf1 = tail_alloc(9); + char *bogus_buf2 = tail_alloc(256); + char *key_iov_str1; + char *key_iov_str2 = tail_alloc(4096); + ssize_t ret; + ssize_t kis_size = 0; + int i; + + key_iov[0].iov_base = short_type; + key_iov[0].iov_len = sizeof(short_type_str); + key_iov[1].iov_base = long_type; + key_iov[1].iov_len = sizeof(long_type_str); + key_iov[2].iov_base = short_desc; + key_iov[2].iov_len = sizeof(short_desc_str); + key_iov[3].iov_base = long_desc; + key_iov[3].iov_len = sizeof(long_desc_str); + key_iov[4].iov_base = bogus_str; + key_iov[4].iov_len = 32; + + for (i = 5; i < IOV_SIZE; i++) { + key_iov[i].iov_base = + (void *) (uintptr_t) (0xfffffacefffff00dULL + + 0x100000001ULL * i); + key_iov[i].iov_len = (size_t) (0xcaffeeeddefaced7ULL + + 0x100000001ULL * i); + } + + ret = asprintf(&key_iov_str1, "[{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}]", + key_iov[IOV_SIZE - 4].iov_base, + key_iov[IOV_SIZE - 4].iov_len, + key_iov[IOV_SIZE - 3].iov_base, + key_iov[IOV_SIZE - 3].iov_len, + key_iov[IOV_SIZE - 2].iov_base, + key_iov[IOV_SIZE - 2].iov_len, + key_iov[IOV_SIZE - 1].iov_base, + key_iov[IOV_SIZE - 1].iov_len); + + if (ret < 0) + error_msg_and_fail("asprintf"); + + ret = snprintf(key_iov_str2, IOV_STR_SIZE, + "[{iov_base=\"%s\\0\", iov_len=%zu}, " + "{iov_base=\"%.10s\"..., iov_len=%zu}, " + "{iov_base=\"%s\\0\", iov_len=%zu}, " + "{iov_base=\"%.10s\"..., iov_len=%zu}, ", + (char *) key_iov[0].iov_base, key_iov[0].iov_len, + (char *) key_iov[1].iov_base, key_iov[1].iov_len, + (char *) key_iov[2].iov_base, key_iov[2].iov_len, + (char *) key_iov[3].iov_base, key_iov[3].iov_len); + + if ((ret < 0) || (ret >= IOV_STR_SIZE)) + error_msg_and_fail("snprintf"); + + for (i = 4; i < PR_LIMIT; i++) { + kis_size += ret; + + ret = snprintf(key_iov_str2 + kis_size, IOV_STR_SIZE - kis_size, + "{iov_base=%p, iov_len=%zu}, ", + key_iov[i].iov_base, key_iov[i].iov_len); + + if ((ret < 0) || (ret >= (IOV_STR_SIZE - kis_size))) + error_msg_and_fail("snprintf"); + } + + kis_size += ret; + snprintf(key_iov_str2 + kis_size, IOV_STR_SIZE - kis_size, "...]"); + + + /* Invalid command */ + do_keyctl((kernel_ulong_t) 0xbadc0dedfacefeedULL, + "0xfacefeed /* KEYCTL_??? */", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, kulong_fmt); + + + /* GET_KEYRING_ID */ + do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", + NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", + sizeof(int), 3141592653U, NULL, "%d", + NULL, 0UL); + + + /* KEYCTL_JOIN_SESSION_KEYRING */ + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), ARG_STR(NULL), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), bogus_str, NULL, ptr_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), ARG_STR("bogus name"), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), "very long keyring name", "\"very long \"...", + NULL, 0UL); + + + /* KEYCTL_UPDATE */ + + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(short_desc_str) - 1, NULL, + ksize_fmt, + 0UL); + + buf_in_arg = false; + + + /* KEYCTL_REVOKE */ + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_CHOWN */ + do_keyctl(ARG_STR(KEYCTL_CHOWN), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(uid_t), ARG_STR(-1), NULL, + sizeof(gid_t), ARG_STR(-1), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_CHOWN), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(gid_t), 3141592653U, NULL, "%u", 0UL); + + + /* KEYCTL_SETPERM */ + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, + sizeof(uint32_t), 0xffffffffU, + "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" + "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" + "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" + "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" + "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" + "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" + "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" + "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" + "0xc0c0c0c0", NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%#x", 0UL); + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(uint32_t), 0xc0c0c0c0, "0xc0c0c0c0 /* KEY_??? */", + NULL, + 0UL); + + + /* KEYCTL_DESCRIBE */ + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + + /* KEYCTL_CLEAR */ + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_LINK */ + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_UNLINK */ + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_SEARCH */ + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_USER_SESSION_KEYRING), + NULL); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(char *), bogus_desc, NULL, ptr_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_type, NULL, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), 0, NULL, "%d", + sizeof(long_type_str), long_type, NULL, NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + + buf_in_arg = false; + + + /* KEYCTL_READ */ + nul_terminated_buf = false; + + /* Empty result is expected for these */ + bogus_buf1[0] = '\377'; + bogus_buf2[0] = '\377'; + + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + nul_terminated_buf = true; + + /* KEYCTL_INSTANTIATE */ + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), 0, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, + ksize_fmt, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + + buf_in_arg = false; + + + /* KEYCTL_NEGATE */ + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(int32_t), 0, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_SET_REQKEY_KEYRING */ + do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(int32_t), ARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, + 0UL); + /* + * Keep it commented out until proper way of faking syscalls is not + * implemented. + */ + /* do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(int32_t), + ARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ + do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, + "0xbadc0ded /* KEY_REQKEY_DEFL_??? */", NULL, 0UL); + + + /* KEYCTL_SET_TIMEOUT */ + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + 0UL); + + + /* KEYCTL_ASSUME_AUTHORITY */ + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_GET_SECURITY */ + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + + /* KEYCTL_SESSION_TO_PARENT */ + do_keyctl(ARG_STR(KEYCTL_SESSION_TO_PARENT), 0UL); + + + /* KEYCTL_REJECT */ + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", + sizeof(uint32_t), 2718281828U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(uint32_t), ARG_STR(ENODEV), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + + + /* KEYCTL_INSTANTIATE_IOV */ + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), 0, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), key_iov + IOV_SIZE, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(key_iov), key_iov + IOV_SIZE - 4, key_iov_str1, NULL, + sizeof(kernel_ulong_t), (kernel_ulong_t) 4, NULL, + ksize_fmt, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(key_iov), key_iov, key_iov_str2, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) IOV_SIZE, NULL, ksize_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + + + /* KEYCTL_INVALIDATE */ + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_GET_PERSISTENT */ + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), ARG_STR(-1), NULL, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_DH_COMPUTE */ + nul_terminated_buf = false; + + /* Empty result is expected for these */ + bogus_buf1[0] = '\377'; + bogus_buf2[0] = '\377'; + + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(char *), kcdhp + 1, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff157ffffdeadULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -1, NULL, ksize_fmt, 0UL); + + nul_terminated_buf = true; + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_keyctl"); + +#endif diff --git a/tests-m32/keyctl.test b/tests-m32/keyctl.test new file mode 100755 index 00000000..875a82d3 --- /dev/null +++ b/tests-m32/keyctl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of keyctl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 diff --git a/tests-m32/kill.c b/tests-m32/kill.c new file mode 100644 index 00000000..cb884aa1 --- /dev/null +++ b/tests-m32/kill.c @@ -0,0 +1,79 @@ +/* + * Check decoding of kill syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Fei Jie + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_kill + +# include +# include +# include + +static void +handler(int sig) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const int pid = getpid(); + long rc = syscall(__NR_kill, pid, (long) 0xdefaced00000000ULL | SIGALRM); + printf("kill(%d, SIGALRM) = %ld\n", pid, rc); + + const long big_pid = (long) 0xfacefeedbadc0dedULL; + const long big_sig = (long) 0xdeadbeefcafef00dULL; + rc = syscall(__NR_kill, big_pid, big_sig); + printf("kill(%d, %d) = %ld %s (%m)\n", + (int) big_pid, (int) big_sig, rc, errno2name()); + + rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0); + printf("kill(%d, SIG_0) = %ld\n", pid, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kill") + +#endif diff --git a/tests-m32/kill.test b/tests-m32/kill.test new file mode 100755 index 00000000..7a3a51aa --- /dev/null +++ b/tests-m32/kill.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kill syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -esignal=none diff --git a/tests-m32/ksysent.c b/tests-m32/ksysent.c new file mode 100644 index 00000000..8cac93ca --- /dev/null +++ b/tests-m32/ksysent.c @@ -0,0 +1,128 @@ +/* + * Validate syscallent.h file. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "sysent.h" +#include +#include +#include + +#define TD 0 +#define TF 0 +#define TI 0 +#define TN 0 +#define TP 0 +#define TS 0 +#define TM 0 +#define NF 0 +#define MA 0 +#define SI 0 +#define SE 0 +#define CST 0 +#define SEN(arg) 0,0 + +static const struct_sysent syscallent[] = { +#include "syscallent.h" +}; + +typedef const char *pstr_t; +static const pstr_t ksyslist[] = { +#include "ksysent.h" +}; + +int +main(void) +{ + int rc = 0; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(ksyslist); ++i) { + if (!ksyslist[i]) + continue; + if (i >= ARRAY_SIZE(syscallent) || !syscallent[i].sys_name) { + fprintf(stderr, "warning: \"%s\" syscall #%u" + " is missing in syscallent.h\n", + ksyslist[i], i); + continue; + } +#ifdef SYS_socket_nsubcalls + if (i >= SYS_socket_subcall && + i < SYS_socket_subcall + SYS_socket_nsubcalls) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is a socket subcall in syscallent.h\n", + ksyslist[i], i); + rc = 1; + continue; + } +#endif +#ifdef SYS_ipc_nsubcalls + if (i >= SYS_ipc_subcall && + i < SYS_ipc_subcall + SYS_ipc_nsubcalls) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is an ipc subcall in syscallent.h\n", + ksyslist[i], i); + rc = 1; + continue; + } +#endif + if (strcmp(ksyslist[i], syscallent[i].sys_name)) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is \"%s\" in syscallent.h\n", + ksyslist[i], i, syscallent[i].sys_name); + rc = 1; + continue; + } + } + + for (i = 0; i < ARRAY_SIZE(syscallent); ++i) { + if (!syscallent[i].sys_name +#ifdef SYS_socket_nsubcalls + || (i >= SYS_socket_subcall && + i < SYS_socket_subcall + SYS_socket_nsubcalls) +#endif +#ifdef SYS_ipc_nsubcalls + || (i >= SYS_ipc_subcall && + i < SYS_ipc_subcall + SYS_ipc_nsubcalls) +#endif +#ifdef ARM_FIRST_SHUFFLED_SYSCALL + || (i >= ARM_FIRST_SHUFFLED_SYSCALL && + i <= ARM_FIRST_SHUFFLED_SYSCALL + + ARM_LAST_SPECIAL_SYSCALL + 1) +#endif + ) + continue; + if (i >= ARRAY_SIZE(ksyslist) || !ksyslist[i]) { + fprintf(stderr, "note: unknown syscall #%u" + " is \"%s\" in syscallent.h\n", + i, syscallent[i].sys_name); + } + } + + return rc; +} diff --git a/tests-m32/ksysent.sed b/tests-m32/ksysent.sed new file mode 100644 index 00000000..63ded4a9 --- /dev/null +++ b/tests-m32/ksysent.sed @@ -0,0 +1,15 @@ +#!/bin/sed -rnf + +# should not have been exported at all +/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|syscalls|syscall_count|syscall_max|available|reserved|unused)/d + +# should not have been named this way +s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/ + +# legacy names +s/__NR_get_cpu/__NR_getcpu/ +s/__NR_madvise1/__NR_madvise/ +s/__NR_paccept/__NR_accept4/ + +# generate +s/#define[[:space:]]+__NR_([a-z_][^[:space:]]+)([[:space:]].*)?$/#ifdef __NR_\1\n[__NR_\1 \& 0xffff] = "\1",\n#endif/p diff --git a/tests-m32/ksysent.test b/tests-m32/ksysent.test new file mode 100755 index 00000000..80266488 --- /dev/null +++ b/tests-m32/ksysent.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Validate syscallent.h + +./ksysent diff --git a/tests-m32/lchown.c b/tests-m32/lchown.c new file mode 100644 index 00000000..a07c878c --- /dev/null +++ b/tests-m32/lchown.c @@ -0,0 +1,19 @@ +#include "tests.h" +#include + +#ifdef __NR_lchown + +# define SYSCALL_NR __NR_lchown +# define SYSCALL_NAME "lchown" + +# if defined __NR_lchown32 && __NR_lchown != __NR_lchown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lchown") + +#endif diff --git a/tests-m32/lchown.test b/tests-m32/lchown.test new file mode 100755 index 00000000..ceeaa859 --- /dev/null +++ b/tests-m32/lchown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check lchown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 diff --git a/tests-m32/lchown32.c b/tests-m32/lchown32.c new file mode 100644 index 00000000..29cb01db --- /dev/null +++ b/tests-m32/lchown32.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_lchown32 + +# define SYSCALL_NR __NR_lchown32 +# define SYSCALL_NAME "lchown32" +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lchown32") + +#endif diff --git a/tests-m32/lchown32.test b/tests-m32/lchown32.test new file mode 100755 index 00000000..6ee1ac95 --- /dev/null +++ b/tests-m32/lchown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check lchown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-m32/libmmsg.c b/tests-m32/libmmsg.c new file mode 100644 index 00000000..b0db26d2 --- /dev/null +++ b/tests-m32/libmmsg.c @@ -0,0 +1,69 @@ +/* + * Wrappers for recvmmsg and sendmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#ifndef __NR_recvmmsg +# define __NR_recvmmsg -1 +#endif +#define SC_recvmmsg 19 + +#ifndef __NR_sendmmsg +# define __NR_sendmmsg -1 +#endif +#define SC_sendmmsg 20 + +int +recv_mmsg(const int fd, struct mmsghdr *const vec, + const unsigned int vlen, const unsigned int flags, + struct timespec *const timeout) +{ + int rc = socketcall(__NR_recvmmsg, SC_recvmmsg, + fd, (long) vec, vlen, flags, (long) timeout); + + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("recvmmsg"); + + return rc; +} + +int +send_mmsg(const int fd, struct mmsghdr *const vec, + const unsigned int vlen, const unsigned int flags) +{ + int rc = socketcall(__NR_sendmmsg, SC_sendmmsg, + fd, (long) vec, vlen, flags, 0); + + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("sendmmsg"); + + return rc; +} diff --git a/tests-m32/libsocketcall.c b/tests-m32/libsocketcall.c new file mode 100644 index 00000000..04d6710f --- /dev/null +++ b/tests-m32/libsocketcall.c @@ -0,0 +1,69 @@ +/* + * Invoke a socket syscall, either directly or via __NR_socketcall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +/* + * Invoke a socket syscall, either directly or via __NR_socketcall. + * if nr == -1, no direct syscall invocation will be made. + */ +int +socketcall(const int nr, const int call, + long a1, long a2, long a3, long a4, long a5) +{ + int rc = -1; + errno = ENOSYS; + +# ifdef __NR_socketcall + static int have_socketcall = -1; + + if (have_socketcall < 0) { + if (syscall(__NR_socketcall, 0L, 0L, 0L, 0L, 0L) < 0 + && EINVAL == errno) { + have_socketcall = 1; + } else { + have_socketcall = 0; + } + } + + if (have_socketcall) { + const long args[] = { a1, a2, a3, a4, a5 }; + rc = syscall(__NR_socketcall, call, args); + } else +# endif + { + if (nr != -1) + rc = syscall(nr, a1, a2, a3, a4, a5); + } + + return rc; +} diff --git a/tests-m32/link.c b/tests-m32/link.c new file mode 100644 index 00000000..d6550fd3 --- /dev/null +++ b/tests-m32/link.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_link + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "link_sample_old"; + static const char sample_2[] = "link_sample_new"; + + long rc = syscall(__NR_link, sample_1, sample_2); + printf("link(\"%s\", \"%s\") = %ld %s (%m)\n", + sample_1, sample_2, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_link") + +#endif diff --git a/tests-m32/link.test b/tests-m32/link.test new file mode 100755 index 00000000..cfa2b0cc --- /dev/null +++ b/tests-m32/link.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check link syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/linkat.c b/tests-m32/linkat.c new file mode 100644 index 00000000..64b900ea --- /dev/null +++ b/tests-m32/linkat.c @@ -0,0 +1,37 @@ +#include "tests.h" +#include + +#ifdef __NR_linkat + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "linkat_sample_old"; + static const char sample_2[] = "linkat_sample_new"; + const long fd_old = (long) 0xdeadbeefffffffffULL; + const long fd_new = (long) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_linkat, fd_old, sample_1, fd_new, sample_2, 0); + printf("linkat(%d, \"%s\", %d, \"%s\", 0) = %ld %s (%m)\n", + (int) fd_old, sample_1, (int) fd_new, sample_2, + rc, errno2name()); + + rc = syscall(__NR_linkat, -100, sample_1, -100, sample_2, -1L); + printf("linkat(%s, \"%s\", %s, \"%s\", %s) = %ld %s (%m)\n", + "AT_FDCWD", sample_1, "AT_FDCWD", sample_2, + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_linkat") + +#endif diff --git a/tests-m32/linkat.test b/tests-m32/linkat.test new file mode 100755 index 00000000..5627de7f --- /dev/null +++ b/tests-m32/linkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check linkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/llseek.c b/tests-m32/llseek.c new file mode 100644 index 00000000..e687e947 --- /dev/null +++ b/tests-m32/llseek.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR__llseek + +# include +# include + +int +main(void) +{ + const unsigned long high = 0xfacefeed; + const unsigned long low = 0xdeadbeef; + const long long offset = 0xfacefeeddeadbeefLL; + unsigned long long result; + + long rc = syscall(__NR__llseek, -1, high, low, &result, SEEK_SET); + printf("_llseek(-1, %lld, %p, SEEK_SET) = %ld %s (%m)\n", + offset, &result, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR__llseek") + +#endif diff --git a/tests-m32/llseek.test b/tests-m32/llseek.test new file mode 100755 index 00000000..cf1607ed --- /dev/null +++ b/tests-m32/llseek.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check _llseek syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -e_llseek $args > "$EXP" +grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-m32/lookup_dcookie.c b/tests-m32/lookup_dcookie.c new file mode 100644 index 00000000..986180ce --- /dev/null +++ b/tests-m32/lookup_dcookie.c @@ -0,0 +1,96 @@ +/* + * Check decoding of lookup_dcookie syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_lookup_dcookie + +# include +# include +# include +# include + +static void +do_lookup_cookie(uint64_t cookie, char *buf, kernel_ulong_t len) +{ + long rc; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + rc = syscall(__NR_lookup_dcookie, cookie, buf, len); +# else + rc = syscall(__NR_lookup_dcookie, LL_VAL_TO_PAIR(cookie), buf, len); +# endif + + errstr = sprintrc(rc); + printf("lookup_dcookie(%" PRIu64 ", ", cookie); + + /* Here, we trust successful return code */ + if ((rc >= 0) && (rc < (long) INT_MAX)) { + printf("%.*s, ", (int) rc, buf); + } else { + if (buf != NULL) + printf("%p, ", buf); + else + printf("NULL, "); + } + + printf("%" PRIu64 ") = %s\n", (uint64_t) len, errstr); +} + +int +main(void) +{ + enum { BUF_SIZE = 4096 }; + + static const uint64_t bogus_cookie = + (uint64_t) 0xf157feeddeadfaceULL; + static const kernel_ulong_t bogus_len = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + + char *buf = tail_alloc(BUF_SIZE); + + do_lookup_cookie(0, NULL, 0); + do_lookup_cookie(bogus_cookie, buf + BUF_SIZE, bogus_len); + do_lookup_cookie(bogus_cookie, buf, BUF_SIZE); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_lookup_dcookie"); + +#endif diff --git a/tests-m32/lookup_dcookie.test b/tests-m32/lookup_dcookie.test new file mode 100755 index 00000000..47e1c2d6 --- /dev/null +++ b/tests-m32/lookup_dcookie.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of lookup_cookie syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/lseek.c b/tests-m32/lseek.c new file mode 100644 index 00000000..4428c4e9 --- /dev/null +++ b/tests-m32/lseek.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lseek + +# include +# include + +int +main(void) +{ + const kernel_ulong_t offset = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + + if (sizeof(offset) > sizeof(long)) { + /* + * Cannot use syscall because it takes long arguments. + * Let's call lseek with hope it will invoke lseek syscall. + */ + long long rc = lseek(-1, offset, SEEK_SET); + printf("lseek(-1, %lld, SEEK_SET) = %lld %s (%m)\n", + (long long) offset, rc, errno2name()); + } else { + long rc = syscall(__NR_lseek, -1L, offset, SEEK_SET); + printf("lseek(-1, %ld, SEEK_SET) = %ld %s (%m)\n", + (long) offset, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_lseek") + +#endif diff --git a/tests-m32/lseek.test b/tests-m32/lseek.test new file mode 100755 index 00000000..f96a91d1 --- /dev/null +++ b/tests-m32/lseek.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check lseek syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a30 -elseek $args > "$EXP" +grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-m32/lstat.c b/tests-m32/lstat.c new file mode 100644 index 00000000..3754f766 --- /dev/null +++ b/tests-m32/lstat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lstat + +# define TEST_SYSCALL_NR __NR_lstat +# define TEST_SYSCALL_STR "lstat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lstat") + +#endif diff --git a/tests-m32/lstat.test b/tests-m32/lstat.test new file mode 100755 index 00000000..f513bb48 --- /dev/null +++ b/tests-m32/lstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check lstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/lstat64.c b/tests-m32/lstat64.c new file mode 100644 index 00000000..da06609d --- /dev/null +++ b/tests-m32/lstat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lstat64 + +# define TEST_SYSCALL_NR __NR_lstat64 +# define TEST_SYSCALL_STR "lstat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lstat64") + +#endif diff --git a/tests-m32/lstat64.test b/tests-m32/lstat64.test new file mode 100755 index 00000000..fcafe79d --- /dev/null +++ b/tests-m32/lstat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check lstat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/lstatx.c b/tests-m32/lstatx.c new file mode 100644 index 00000000..cdd1124b --- /dev/null +++ b/tests-m32/lstatx.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, sample, pst) +#define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(\"%s\", ", TEST_SYSCALL_STR, sample) +#define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +#include "xstatx.c" diff --git a/tests-m32/match.awk b/tests-m32/match.awk new file mode 100644 index 00000000..abfbae92 --- /dev/null +++ b/tests-m32/match.awk @@ -0,0 +1,53 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# s[] is array of match strings +# r[] is array of match patterns + +NR > lines { next } + +{ + if (s[NR]) { + if ($0 == s[NR]) + next + print "Line " NR " does not match expected string: " s[NR] + } else { + if (match($0, r[NR])) + next + print "Line " NR " does not match expected pattern: " r[NR] + } + + fail = 1 +} + +END { + if (fail == 0 && NR != lines) { + fail = 1 + print "Expected " lines " lines, found " NR " line(s)." + } + exit fail +} diff --git a/tests-m32/mbind.c b/tests-m32/mbind.c new file mode 100644 index 00000000..b0544263 --- /dev/null +++ b/tests-m32/mbind.c @@ -0,0 +1,61 @@ +/* + * Check decoding of mbind syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_mbind + +# include +# include + +int +main(void) +{ + const unsigned long len = (unsigned long) 0xcafef00dbadc0dedULL; + const unsigned long mode = 3; + const unsigned long nodemask = (unsigned long) 0xfacefeedfffffff1ULL; + const unsigned long maxnode = (unsigned long) 0xdeadbeeffffffff2ULL; + const unsigned long flags = -1UL; + + long rc = syscall(__NR_mbind, 0, len, mode, nodemask, maxnode, flags); + printf("mbind(NULL, %lu, %s, %#lx, %lu, %s|%#x) = %ld %s (%m)\n", + len, "MPOL_INTERLEAVE", nodemask, maxnode, + "MPOL_MF_STRICT|MPOL_MF_MOVE|MPOL_MF_MOVE_ALL", + (unsigned) flags & ~7, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mbind") + +#endif diff --git a/tests-m32/mbind.test b/tests-m32/mbind.test new file mode 100755 index 00000000..2a07cac6 --- /dev/null +++ b/tests-m32/mbind.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mbind syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/membarrier.c b/tests-m32/membarrier.c new file mode 100644 index 00000000..330893b6 --- /dev/null +++ b/tests-m32/membarrier.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_membarrier + +# include +# include +# include +# include + +int +main(void) +{ + assert(syscall(__NR_membarrier, 3, 255) == -1); + int saved_errno = errno; + printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n", + sprintrc(-1)); + if (saved_errno != ENOSYS) { + /* the test needs to be updated? */ + assert(syscall(__NR_membarrier, 0, 0) == 1); + puts("membarrier(MEMBARRIER_CMD_QUERY, 0)" + " = 0x1 (MEMBARRIER_CMD_SHARED)"); + } + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_membarrier") + +#endif diff --git a/tests-m32/membarrier.test b/tests-m32/membarrier.test new file mode 100755 index 00000000..ad1f713b --- /dev/null +++ b/tests-m32/membarrier.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check membarrier syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/memfd_create.c b/tests-m32/memfd_create.c new file mode 100644 index 00000000..480fd177 --- /dev/null +++ b/tests-m32/memfd_create.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_memfd_create + +# include +# include + +int +main(void) +{ + static const char text[] = "strace"; + int rc = syscall(__NR_memfd_create, text, 7); + + printf("memfd_create(\"%s\", %s) = %d %s (%m)\n", + text, "MFD_CLOEXEC|MFD_ALLOW_SEALING|0x4", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_memfd_create") + +#endif diff --git a/tests-m32/memfd_create.test b/tests-m32/memfd_create.test new file mode 100755 index 00000000..4361dae4 --- /dev/null +++ b/tests-m32/memfd_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of memfd_create syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/migrate_pages.c b/tests-m32/migrate_pages.c new file mode 100644 index 00000000..4c303e38 --- /dev/null +++ b/tests-m32/migrate_pages.c @@ -0,0 +1,54 @@ +/* + * Check decoding of migrate_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_migrate_pages + +# include +# include + +int +main(void) +{ + const long pid = (long) 0xfacefeedffffffffULL; + long rc = syscall(__NR_migrate_pages, pid, 0, 0, 0); + printf("migrate_pages(%d, 0, NULL, NULL) = %ld %s (%m)\n", + (int) pid, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_migrate_pages") + +#endif diff --git a/tests-m32/migrate_pages.test b/tests-m32/migrate_pages.test new file mode 100755 index 00000000..fad53b79 --- /dev/null +++ b/tests-m32/migrate_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check migrate_pages syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-m32/mincore.c b/tests-m32/mincore.c new file mode 100644 index 00000000..ea2b49e3 --- /dev/null +++ b/tests-m32/mincore.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#define DEFAULT_STRLEN 32 + +static void +print_mincore(const unsigned int pages, void *const addr, + const size_t size, unsigned char *const vec) +{ + unsigned int i; + + if (mincore(addr, size, vec)) + perror_msg_and_skip("mincore"); + + printf("mincore(%p, %zu, [", addr, size); + for (i = 0; i < pages; ++i) { + if (i) + printf(", "); + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } + printf("%u", vec[i] & 1); + } + puts("]) = 0"); +} + +static void +test_mincore(const unsigned int pages) +{ + const size_t page_size = get_page_size(); + const size_t size = pages * page_size; + void *const addr = tail_alloc(size); + unsigned char *const vec = tail_alloc(pages); + + mincore(addr, size, NULL); + printf("mincore(%p, %zu, NULL) = -1 %s (%m)\n", + addr, size, errno2name()); + + print_mincore(pages, addr, size, vec); + if (size) + print_mincore(pages, addr, size - page_size + 1, vec); +} + +int main(void) +{ + test_mincore(1); + test_mincore(2); + test_mincore(DEFAULT_STRLEN); + test_mincore(DEFAULT_STRLEN + 1); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/mincore.test b/tests-m32/mincore.test new file mode 100755 index 00000000..6af9f492 --- /dev/null +++ b/tests-m32/mincore.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mincore syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/mkdir.c b/tests-m32/mkdir.c new file mode 100644 index 00000000..d971b188 --- /dev/null +++ b/tests-m32/mkdir.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_mkdir + +# define TEST_SYSCALL_NR __NR_mkdir +# define TEST_SYSCALL_STR "mkdir" +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_mkdir") + +#endif diff --git a/tests-m32/mkdir.test b/tests-m32/mkdir.test new file mode 100755 index 00000000..38ed6928 --- /dev/null +++ b/tests-m32/mkdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mkdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/mkdirat.c b/tests-m32/mkdirat.c new file mode 100644 index 00000000..6bfe4a5f --- /dev/null +++ b/tests-m32/mkdirat.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_mkdirat + +# define TEST_SYSCALL_NR __NR_mkdirat +# define TEST_SYSCALL_STR "mkdirat" +# define TEST_SYSCALL_PREFIX_ARGS (long int) 0xdeadbeefffffffffULL, +# define TEST_SYSCALL_PREFIX_STR "-1, " +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_mkdirat") + +#endif diff --git a/tests-m32/mkdirat.test b/tests-m32/mkdirat.test new file mode 100755 index 00000000..0fcb841a --- /dev/null +++ b/tests-m32/mkdirat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mkdirat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/mknod.c b/tests-m32/mknod.c new file mode 100644 index 00000000..4cc1c5cb --- /dev/null +++ b/tests-m32/mknod.c @@ -0,0 +1,73 @@ +#include "tests.h" +#include + +#ifdef __NR_mknod + +# include +# include +# include +# include + +static const char sample[] = "mknod"; + +static long +call_mknod(unsigned short mode, unsigned long dev) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + return syscall(__NR_mknod, sample, lmode, dev); +} + +int +main(void) +{ + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + long rc = call_mknod(0, dev); + printf("mknod(\"%s\", 000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(0xffff, dev); + printf("mknod(\"%s\", %#03ho) = %ld %s (%m)\n", + sample, (unsigned short) -1, rc, errno2name()); + + rc = call_mknod(S_IFREG, 0); + printf("mknod(\"%s\", S_IFREG|000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFDIR | 06, 0); + printf("mknod(\"%s\", S_IFDIR|006) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFLNK | 060, 0); + printf("mknod(\"%s\", S_IFLNK|060) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFIFO | 0600, 0); + printf("mknod(\"%s\", S_IFIFO|0600) = %ld %s (%m)\n", + sample, rc, errno2name()); + + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); + + rc = call_mknod(S_IFCHR | 024, dev); + printf("mknod(\"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + sample, rc, errno2name()); + + const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + rc = call_mknod(mode, dev); + printf("mknod(\"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" + ", makedev(%u, %u)) = %ld %s (%m)\n", + sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + major((unsigned) dev), minor((unsigned) dev), + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mknod") + +#endif diff --git a/tests-m32/mknod.test b/tests-m32/mknod.test new file mode 100755 index 00000000..195f1e33 --- /dev/null +++ b/tests-m32/mknod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mknod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/mknodat.c b/tests-m32/mknodat.c new file mode 100644 index 00000000..756e2771 --- /dev/null +++ b/tests-m32/mknodat.c @@ -0,0 +1,74 @@ +#include "tests.h" +#include + +#ifdef __NR_mknodat + +# include +# include +# include +# include + +static const char sample[] = "mknodat_sample"; +static const long int fd = (long int) 0xdeadbeefffffffffULL; + +static long +call_mknodat(unsigned short mode, unsigned long dev) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + return syscall(__NR_mknodat, fd, sample, lmode, dev); +} + +int +main(void) +{ + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + long rc = call_mknodat(0, dev); + printf("mknodat(-1, \"%s\", 000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(0xffff, dev); + printf("mknodat(-1, \"%s\", %#03ho) = %ld %s (%m)\n", + sample, (unsigned short) -1, rc, errno2name()); + + rc = call_mknodat(S_IFREG, 0); + printf("mknodat(-1, \"%s\", S_IFREG|000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFDIR | 06, 0); + printf("mknodat(-1, \"%s\", S_IFDIR|006) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFLNK | 060, 0); + printf("mknodat(-1, \"%s\", S_IFLNK|060) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFIFO | 0600, 0); + printf("mknodat(-1, \"%s\", S_IFIFO|0600) = %ld %s (%m)\n", + sample, rc, errno2name()); + + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); + + rc = call_mknodat(S_IFCHR | 024, dev); + printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + sample, rc, errno2name()); + + const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + rc = call_mknodat(mode, dev); + printf("mknodat(-1, \"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" + ", makedev(%u, %u)) = %ld %s (%m)\n", + sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + major((unsigned) dev), minor((unsigned) dev), + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mknodat") + +#endif diff --git a/tests-m32/mknodat.test b/tests-m32/mknodat.test new file mode 100755 index 00000000..1701a368 --- /dev/null +++ b/tests-m32/mknodat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mknodat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/mlock.c b/tests-m32/mlock.c new file mode 100644 index 00000000..8e9806bd --- /dev/null +++ b/tests-m32/mlock.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#if defined __NR_mlock && defined __NR_munlock + +# include +# include + +int +main(void) +{ + const int size = 1024; + const char *addr = tail_alloc(size); + + long rc = syscall(__NR_mlock, addr, size); + printf("mlock(%p, %d) = %s\n", addr, size, sprintrc(rc)); + + rc = syscall(__NR_munlock, addr, size); + printf("munlock(%p, %d) = %s\n", addr, size, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mlock && __NR_munlock") + +#endif diff --git a/tests-m32/mlock.test b/tests-m32/mlock.test new file mode 100755 index 00000000..9a73a306 --- /dev/null +++ b/tests-m32/mlock.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mlock and munlock syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mlock,munlock -a20 diff --git a/tests-m32/mlock2.c b/tests-m32/mlock2.c new file mode 100644 index 00000000..71a2003e --- /dev/null +++ b/tests-m32/mlock2.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_mlock2 + +# include +# include + +int +main(void) +{ + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long len = (unsigned long) 0xcafef00dbadc0dedULL; + + long rc = syscall(__NR_mlock2, addr, len, -1UL); + printf("mlock2(%#lx, %lu, MLOCK_ONFAULT|0xfffffffe)" + " = %ld %s (%m)\n", addr, len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mlock2") + +#endif diff --git a/tests-m32/mlock2.test b/tests-m32/mlock2.test new file mode 100755 index 00000000..bc412e97 --- /dev/null +++ b/tests-m32/mlock2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mlock2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/mlockall.c b/tests-m32/mlockall.c new file mode 100644 index 00000000..682d070d --- /dev/null +++ b/tests-m32/mlockall.c @@ -0,0 +1,46 @@ +/* + * Check decoding of mlockall syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include + +int +main(void) +{ + int rc = mlockall(0); + printf("mlockall(0) = %s\n", sprintrc(rc)); + + rc = mlockall(MCL_CURRENT); + printf("mlockall(MCL_CURRENT) = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/mlockall.test b/tests-m32/mlockall.test new file mode 100755 index 00000000..d7a6182d --- /dev/null +++ b/tests-m32/mlockall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mlockall syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/mmap.c b/tests-m32/mmap.c new file mode 100644 index 00000000..f726f63e --- /dev/null +++ b/tests-m32/mmap.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +int +main(int ac, char **av) +{ + const char *const name = ac > 1 ? av[1] : "mmap"; + const intmax_t pagesize = get_page_size(); + const unsigned long length1 = pagesize * 6; + const unsigned long length2 = pagesize * 3; + const unsigned long length3 = pagesize * 2; + const int fd = -1; + off_t offset; + void *addr, *p; + +#if ULONG_MAX > 4294967295UL + offset = 0xcafedeadbeef000ULL & -pagesize; + addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); +#else + offset = 0xdeadbeef000ULL & -pagesize; + addr = (void *) (unsigned int) (0xfaced000 & -pagesize); +#endif + const uintmax_t uoffset = + sizeof(offset) == sizeof(int) ? (uintmax_t) (unsigned int) offset + : (uintmax_t) offset; + + (void) close(0); + (void) close(0); + printf("%s(NULL, 0, PROT_NONE, MAP_FILE, 0, 0) = -1 EBADF (%m)\n", + name); + mmap(NULL, 0, PROT_NONE, MAP_FILE, 0, 0); + + p = mmap(addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, offset); + if (MAP_FAILED == p) + perror_msg_and_fail("mmap"); + printf("%s(%p, %lu, PROT_READ|PROT_WRITE, " + "MAP_PRIVATE|MAP_ANONYMOUS, %d, %#jx) = %p\n", + name, addr, length1, fd, uoffset, p); + + if (msync(p, length1, MS_SYNC)) + perror_msg_and_fail("msync"); + printf("msync(%p, %lu, MS_SYNC) = 0\n", p, length1); + + if (mprotect(p, length1, PROT_NONE)) + perror_msg_and_fail("mprotect"); + printf("mprotect(%p, %lu, PROT_NONE) = 0\n", p, length1); + + addr = mremap(p, length1, length2, 0); + if (MAP_FAILED == addr) + perror_msg_and_fail("mremap"); + printf("mremap(%p, %lu, %lu, 0) = %p\n", p, length1, length2, addr); + + p = mremap(addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2); + if (MAP_FAILED == p) + perror_msg_and_fail("mremap"); + printf("mremap(%p, %lu, %lu, MREMAP_MAYMOVE|MREMAP_FIXED" + ", %p) = %p\n", addr, length2, length3, addr + length2, p); + + if (madvise(p, length3, MADV_NORMAL)) + perror_msg_and_fail("madvise"); + printf("madvise(%p, %lu, MADV_NORMAL) = 0\n", p, length3); + + if (munmap(p, length3)) + perror_msg_and_fail("munmap"); + printf("munmap(%p, %lu) = 0\n", p, length3); + + if (mlockall(MCL_FUTURE)) + perror_msg_and_fail("mlockall"); + puts("mlockall(MCL_FUTURE) = 0"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/mmap.test b/tests-m32/mmap.test new file mode 100755 index 00000000..0b87114a --- /dev/null +++ b/tests-m32/mmap.test @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Check mmap/mmap2, madvise, mlockall, mprotect, mremap, msync, and munmap +# syscalls decoding. +# +# Copyright (c) 2015-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_prog grep +check_prog sed +run_prog > /dev/null + +syscall= +for n in mmap mmap2; do + $STRACE -e$n -h > /dev/null && syscall=$syscall,$n +done +run_strace -e$syscall $args > /dev/null + +if grep '^mmap(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then + mmap=mmap +elif grep '^mmap2(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then + mmap=mmap2 +else + dump_log_and_fail_with "mmap/mmap2 not found in $STRACE $args output" +fi + +syscall=$mmap,madvise,mlockall,mprotect,mremap,msync,munmap + +run_prog "./$NAME" $mmap > /dev/null +run_strace -a20 -e$syscall $args > "$EXP" +sed -n "/^$mmap(NULL, 0, PROT_NONE,/,\$p" < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/mmap64.c b/tests-m32/mmap64.c new file mode 100644 index 00000000..b31ce427 --- /dev/null +++ b/tests-m32/mmap64.c @@ -0,0 +1 @@ +#include "mmap.c" diff --git a/tests-m32/mmap64.test b/tests-m32/mmap64.test new file mode 100755 index 00000000..51f1896e --- /dev/null +++ b/tests-m32/mmap64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mmap/mprotect/munmap syscalls decoding. +# Target executable was compiled with -D_FILE_OFFSET_BITS=64. + +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmsg-silent.c b/tests-m32/mmsg-silent.c new file mode 100644 index 00000000..47d0a504 --- /dev/null +++ b/tests-m32/mmsg-silent.c @@ -0,0 +1,63 @@ +/* + * Check silent decoding of sendmmsg and recvmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#include "msghdr.h" + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + char buf = 'A'; + struct iovec iov = { .iov_base = &buf, .iov_len = sizeof(buf) }; + struct mmsghdr mh = { + .msg_hdr = { + .msg_iov = &iov, + .msg_iovlen = 1 + } + }; + + int rc = send_mmsg(fds[1], &mh, 1, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("sendmmsg"); + printf("sendmmsg(%d, %p, 1, MSG_DONTWAIT) = %d\n", fds[1], &mh, rc); + + struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + rc = recv_mmsg(fds[0], &mh, 1, MSG_DONTWAIT, &t); + printf("recvmmsg(%d, %p, 1, MSG_DONTWAIT, %p) = %d\n", + fds[0], &mh, &t, rc); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/mmsg-silent.test b/tests-m32/mmsg-silent.test new file mode 100755 index 00000000..775e0ad3 --- /dev/null +++ b/tests-m32/mmsg-silent.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check silent decoding of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mmsg.c b/tests-m32/mmsg.c new file mode 100644 index 00000000..88805d16 --- /dev/null +++ b/tests-m32/mmsg.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2014 Masatake YAMATO + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#include "msghdr.h" + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, fds)) + perror_msg_and_skip("socketpair"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + const struct iovec w0_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + } + }; + struct iovec *w0_iov = tail_memdup(w0_iov_, sizeof(w0_iov_)); + + const struct iovec w1_iov_[] = { + { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + struct iovec *w1_iov = tail_memdup(w1_iov_, sizeof(w1_iov_)); + + const struct mmsghdr w_mmh_[] = { + { + .msg_hdr = { + .msg_iov = w0_iov, + .msg_iovlen = ARRAY_SIZE(w0_iov_), + } + }, { + .msg_hdr = { + .msg_iov = w1_iov, + .msg_iovlen = ARRAY_SIZE(w1_iov_), + } + } + }; + void *w_mmh = tail_memdup(w_mmh_, sizeof(w_mmh_)); + const unsigned int n_w_mmh = ARRAY_SIZE(w_mmh_); + + int r = send_mmsg(1, w_mmh, n_w_mmh, MSG_DONTROUTE | MSG_NOSIGNAL); + if (r < 0) + perror_msg_and_skip("sendmmsg"); + assert(r == (int) n_w_mmh); + assert(close(1) == 0); + tprintf("sendmmsg(1, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}" + ", {msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}], %u" + ", MSG_DONTROUTE|MSG_NOSIGNAL) = %d\n" + " = %u buffers in vector 0\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " = %u buffers in vector 1\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), + w1_c, LENGTH_OF(w1_c), + ARRAY_SIZE(w0_iov_), + LENGTH_OF(w0_c) + LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w1_iov_), + LENGTH_OF(w2_c), + n_w_mmh, r, + ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, + ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + struct iovec *r0_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = r_len + } + }; + struct iovec *r1_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + const struct mmsghdr r_mmh_[] = { + { + .msg_hdr = { + .msg_iov = r0_iov, + .msg_iovlen = ARRAY_SIZE(r0_iov_), + } + }, { + .msg_hdr = { + .msg_iov = r1_iov, + .msg_iovlen = ARRAY_SIZE(r1_iov_), + } + } + }; + void *r_mmh = tail_memdup(r_mmh_, sizeof(r_mmh_)); + const unsigned int n_r_mmh = ARRAY_SIZE(r_mmh_); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + assert(recv_mmsg(0, r_mmh, n_r_mmh, MSG_DONTWAIT, NULL) == (int) n_r_mmh); + assert(close(0) == 0); + tprintf("recvmmsg(0, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}" + ", {msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}], %u" + ", MSG_DONTWAIT, NULL) = %d\n" + " = %u buffers in vector 0\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " = %u buffers in vector 1\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), + r1_c, r_len, r_len, ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + n_r_mmh, r, + ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), r0_d, r0_c, + ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), r1_d, r1_c); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/mmsg.test b/tests-m32/mmsg.test new file mode 100755 index 00000000..a8148ba8 --- /dev/null +++ b/tests-m32/mmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check how iovecs in struct mmsghdr are decoded. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmmsg,sendmmsg -e read=0 -e write=1 diff --git a/tests-m32/mmsg_name-v.c b/tests-m32/mmsg_name-v.c new file mode 100644 index 00000000..c663536d --- /dev/null +++ b/tests-m32/mmsg_name-v.c @@ -0,0 +1,4 @@ +/* This file is part of mmsg_name-v strace test. */ +#define VERBOSE 1 +#define TEST_NAME "mmsg_name-v" +#include "mmsg_name.c" diff --git a/tests-m32/mmsg_name-v.test b/tests-m32/mmsg_name-v.test new file mode 100755 index 00000000..ab8dfba6 --- /dev/null +++ b/tests-m32/mmsg_name-v.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check verbose decoding of msg_name* fields of struct msghdr array argument +# of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mmsg_name.c b/tests-m32/mmsg_name.c new file mode 100644 index 00000000..a7a55c55 --- /dev/null +++ b/tests-m32/mmsg_name.c @@ -0,0 +1,242 @@ +/* + * Check decoding of msg_name* fields of struct msghdr array argument + * of sendmmsg and recvmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "msghdr.h" + +#define DEFAULT_STRLEN 32 + +#define IOV_MAX1 (IOV_MAX + 1) + +#ifndef TEST_NAME +# define TEST_NAME "mmsg_name" +#endif + +static void +print_msghdr(const struct msghdr *const msg, const int user_msg_namelen) +{ + const struct sockaddr_un *const un = msg->msg_name; + const int offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + + printf("{msg_name="); + if (!un) + printf("NULL"); + else if (user_msg_namelen < offsetof_sun_path) { + printf("%p", un); + } else { + printf("{sa_family=AF_UNIX"); + if (user_msg_namelen > offsetof_sun_path) { + int len = user_msg_namelen < (int) msg->msg_namelen ? + user_msg_namelen : (int) msg->msg_namelen; + len -= offsetof_sun_path; + if (len > (int) sizeof(un->sun_path)) + len = sizeof(un->sun_path); + printf(", sun_path=\"%.*s\"", len, un->sun_path); + } + printf("}"); + } + printf(", msg_namelen="); + if (user_msg_namelen != (int) msg->msg_namelen) { + printf("%d->", user_msg_namelen); + } + printf("%d, msg_iov=[{iov_base=\"%c\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}", + (int) msg->msg_namelen, * (char *) msg->msg_iov[0].iov_base); +} + +static void +test_mmsg_name(const int send_fd, const int recv_fd) +{ + struct sockaddr_un *const send_addr = + tail_alloc(sizeof(*send_addr) * IOV_MAX1); + char *const send_buf = tail_alloc(sizeof(*send_buf) * IOV_MAX1); + struct iovec *const send_iov = tail_alloc(sizeof(*send_iov) * IOV_MAX1); + struct mmsghdr *const send_mh = tail_alloc(sizeof(*send_mh) * IOV_MAX1); + + int i, rc; + + for (i = 0; i < IOV_MAX1; ++i) { + int sun_len = i + 1 > (int) sizeof(send_addr[i].sun_path) + ? (int) sizeof(send_addr[i].sun_path) + : i + 1; + + send_addr[i].sun_family = AF_UNIX; + memset(send_addr[i].sun_path, 'a' + i % 26, sun_len); + + send_buf[i] = '0' + i % 10; + + send_iov[i].iov_base = &send_buf[i]; + send_iov[i].iov_len = sizeof(*send_buf); + + send_mh[i].msg_hdr.msg_iov = &send_iov[i]; + send_mh[i].msg_hdr.msg_iovlen = 1; + send_mh[i].msg_hdr.msg_name = &send_addr[i]; + send_mh[i].msg_hdr.msg_namelen = i + 1; + send_mh[i].msg_hdr.msg_control = 0; + send_mh[i].msg_hdr.msg_controllen = 0; + send_mh[i].msg_hdr.msg_flags = 0; + } + + rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); + int saved_errno = errno; + + printf("sendmmsg(%d, [", send_fd); + for (i = 0; i < IOV_MAX1; ++i) { + if (i) + printf(", "); + if (i >= IOV_MAX +# if !VERBOSE + || i >= DEFAULT_STRLEN +# endif + ) { + printf("..."); + break; + } + printf("{msg_hdr="); + print_msghdr(&send_mh[i].msg_hdr, i + 1); + printf("}"); + } + errno = saved_errno; + printf("], %u, MSG_DONTWAIT) = %d %s (%m)\n", + IOV_MAX1, rc, errno2name()); + + for (i = 0; i < IOV_MAX1; ++i) { + send_mh[i].msg_hdr.msg_name = 0; + send_mh[i].msg_hdr.msg_namelen = 0; + } + + /* + * When recvmmsg is called with a valid descriptor + * but inaccessible memory, it causes segfaults on some architectures. + * As in these cases we test decoding of failed recvmmsg calls, + * it's ok to fail recvmmsg with any reason as long as + * it doesn't read that inaccessible memory. + */ + rc = send_mmsg(-1, &send_mh[IOV_MAX], 2, MSG_DONTWAIT); + saved_errno = errno; + printf("sendmmsg(-1, [{msg_hdr="); + print_msghdr(&send_mh[IOV_MAX].msg_hdr, 0); + errno = saved_errno; + printf("}, %p], %u, MSG_DONTWAIT) = %d %s (%m)\n", + &send_mh[IOV_MAX1], 2, rc, errno2name()); + + rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("sendmmsg"); + + printf("sendmmsg(%d, [", send_fd); + for (i = 0; i < IOV_MAX1; ++i) { + if (i) + printf(", "); + if (i >= IOV_MAX +#if !VERBOSE + || i >= DEFAULT_STRLEN +#endif + ) { + printf("..."); + break; + } + printf("{msg_hdr="); + print_msghdr(&send_mh[i].msg_hdr, 0); + printf("%s}", i < rc ? ", msg_len=1" : ""); + } + printf("], %u, MSG_DONTWAIT) = %d\n", IOV_MAX1, rc); + + struct sockaddr_un *const recv_addr = + tail_alloc(sizeof(*recv_addr) * IOV_MAX1); + char *const recv_buf = tail_alloc(sizeof(*recv_buf) * IOV_MAX1); + struct iovec *const recv_iov = tail_alloc(sizeof(*recv_iov) * IOV_MAX1); + struct mmsghdr *const recv_mh = tail_alloc(sizeof(*recv_mh) * IOV_MAX1); + + for (i = 0; i < IOV_MAX1; ++i) { + recv_iov[i].iov_base = &recv_buf[i]; + recv_iov[i].iov_len = sizeof(*recv_buf); + + recv_mh[i].msg_hdr.msg_name = &recv_addr[i]; + recv_mh[i].msg_hdr.msg_namelen = i; + recv_mh[i].msg_hdr.msg_iov = &recv_iov[i]; + recv_mh[i].msg_hdr.msg_iovlen = 1; + recv_mh[i].msg_hdr.msg_control = 0; + recv_mh[i].msg_hdr.msg_controllen = 0; + recv_mh[i].msg_hdr.msg_flags = 0; + } + + rc = recv_mmsg(recv_fd, recv_mh, IOV_MAX1, MSG_DONTWAIT, 0); + if (rc < 0) + perror_msg_and_skip("recvmmsg"); + + printf("recvmmsg(%d, [", recv_fd); + for (i = 0; i < rc; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("{msg_hdr="); + print_msghdr(&recv_mh[i].msg_hdr, i); + printf(", msg_len=1}"); + } + printf("], %u, MSG_DONTWAIT, NULL) = %d\n", IOV_MAX1, rc); +} + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_NAME "-recvmmsg.test.send.socket" + }; + + (void) unlink(un.sun_path); + if (bind(fds[1], (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + test_mmsg_name(fds[1], fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/mmsg_name.test b/tests-m32/mmsg_name.test new file mode 100755 index 00000000..e18c9722 --- /dev/null +++ b/tests-m32/mmsg_name.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check decoding of msg_name* fields of struct msghdr array argument +# of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mount.c b/tests-m32/mount.c new file mode 100644 index 00000000..cbfe42f8 --- /dev/null +++ b/tests-m32/mount.c @@ -0,0 +1,84 @@ +/* + * Check decoding of mount syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#ifndef MS_MGC_VAL +# define MS_MGC_VAL 0xC0ED0000 +#endif + +#ifndef MS_RELATIME +# define MS_RELATIME (1ul << 21) +#endif + +#define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" + +int +main(void) +{ + static const char source[] = "mount_source"; + static const char target[] = "mount_target"; + static const char fstype[] = "mount_fstype"; + static const char data[] = "mount_data"; + + int rc = mount(source, target, fstype, 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, str_ro_nosuid_nodev_noexec, + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_RELATIME | 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, + str_ro_nosuid_nodev_noexec "|MS_RELATIME", + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_MGC_VAL, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, "MS_MGC_VAL", data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_MGC_VAL | 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, + "MS_MGC_VAL|" str_ro_nosuid_nodev_noexec, + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_REMOUNT, data); + printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, "MS_REMOUNT", data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_BIND, data); + printf("mount(\"%s\", \"%s\", %p, %s, %p) = %d %s (%m)\n", + source, target, fstype, "MS_BIND", data, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/mount.test b/tests-m32/mount.test new file mode 100755 index 00000000..40fdca95 --- /dev/null +++ b/tests-m32/mount.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mount syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/move_pages.c b/tests-m32/move_pages.c new file mode 100644 index 00000000..f4ccafa2 --- /dev/null +++ b/tests-m32/move_pages.c @@ -0,0 +1,239 @@ +/* + * Check decoding of move_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_move_pages + +# include +# include +# include + +# define MAX_STRLEN 3 + +static void +print_page_array(const void **const pages, + const unsigned long count, + const unsigned int offset) +{ + if (!count) { + printf("%s", pages ? "[]" : "NULL"); + return; + } + if (count <= offset) { + printf("%p", pages); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i + offset < count) { + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + } else { + printf("%p", pages + i); + break; + } + const void *const addr = pages[i]; + if (addr) + printf("%p", addr); + else + printf("NULL"); + } + printf("]"); +} + +static void +print_node_array(const int *const nodes, + const unsigned long count, + const unsigned int offset) +{ + if (!count) { + printf("%s", nodes ? "[]" : "NULL"); + return; + } + if (count <= offset) { + printf("%p", nodes); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i + offset < count) { + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + } else { + printf("%p", nodes + i); + break; + } + printf("%d", nodes[i]); + } + printf("]"); +} + +static void +print_status_array(const int *const status, const unsigned long count) +{ + if (!count) { + printf("%s", status ? "[]" : "NULL"); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + if (status[i] >= 0) { + printf("%d", status[i]); + } else { + errno = -status[i]; + printf("%s", errno2name()); + } + } + printf("]"); +} + +static void +print_stat_pages(const unsigned long pid, const unsigned long count, + const void **const pages, int *const status) +{ + const unsigned long flags = (unsigned long) 0xfacefeed00000002ULL; + + long rc = syscall(__NR_move_pages, + pid, count, pages, NULL, status, flags); + const char *errstr = sprintrc(rc); + printf("move_pages(%d, %lu, ", (int) pid, count); + print_page_array(pages, count, 0); + printf(", NULL, "); + if (rc) { + if (count) + printf("%p", status); + else + printf("[]"); + } else { + print_status_array(status, count); + } + printf(", MPOL_MF_MOVE) = %s\n", errstr); +} + +static void +print_move_pages(const unsigned long pid, + unsigned long count, + const unsigned int offset, + const void **const pages, + int *const nodes, + int *const status) +{ + const unsigned long flags = (unsigned long) 0xfacefeed00000004ULL; + count += offset; + + long rc = syscall(__NR_move_pages, + pid, count, pages, nodes, status, flags); + const char *errstr = sprintrc(rc); + printf("move_pages(%d, %lu, ", (int) pid, count); + print_page_array(pages, count, offset); + printf(", "); + print_node_array(nodes, count, offset); + printf(", "); + if (count) + printf("%p", status); + else + printf("[]"); + printf(", MPOL_MF_MOVE_ALL) = %s\n", errstr); +} + +int +main(void) +{ + const unsigned long pid = + (unsigned long) 0xfacefeed00000000ULL | getpid(); + unsigned long count = 1; + const unsigned page_size = get_page_size(); + const void *const page = tail_alloc(page_size); + const void *const efault = page + page_size; + const void **pages = tail_alloc(sizeof(*pages)); + int *nodes = tail_alloc(sizeof(*nodes)); + int *status = tail_alloc(sizeof(*status)); + + print_stat_pages(pid, 0, pages, status); + print_move_pages(pid, 0, 0, pages, nodes, status); + print_move_pages(pid, 0, 1, pages + 1, nodes + 1, status + 1); + + *pages = page; + print_stat_pages(pid, count, pages, status); + *nodes = 0xdeadbee1; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = efault; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee2; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = nodes; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee3; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = status; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee4; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_move_pages") + +#endif diff --git a/tests-m32/move_pages.test b/tests-m32/move_pages.test new file mode 100755 index 00000000..f9577172 --- /dev/null +++ b/tests-m32/move_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of move_pages syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 diff --git a/tests-m32/mq.c b/tests-m32/mq.c new file mode 100644 index 00000000..9c2ffc8e --- /dev/null +++ b/tests-m32/mq.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_MQUEUE_H + +# include +# include +# include +# include +# include +# include + +# define NAME "strace-mq.test" + +int +main (void) +{ + struct mq_attr attr; + (void) close(0); + + if (mq_open("/" NAME, O_CREAT, 0700, NULL)) + perror_msg_and_skip("mq_open"); + printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", NAME); + + if (mq_getattr(0, &attr)) + perror_msg_and_skip("mq_getattr"); + printf("mq_getsetattr(0, NULL, {mq_flags=0, mq_maxmsg=%lld" + ", mq_msgsize=%lld, mq_curmsgs=0}) = 0\n", + (long long) attr.mq_maxmsg, + (long long) attr.mq_msgsize); + + if (mq_setattr(0, &attr, NULL)) + perror_msg_and_skip("mq_setattr"); + printf("mq_getsetattr(0, {mq_flags=0, mq_maxmsg=%lld" + ", mq_msgsize=%lld, mq_curmsgs=0}, NULL) = 0\n", + (long long) attr.mq_maxmsg, + (long long) attr.mq_msgsize); + + if (mq_unlink("/" NAME)) + perror_msg_and_skip("mq_unlink"); + printf("mq_unlink(\"%s\") = 0\n", NAME); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_MQUEUE_H") + +#endif diff --git a/tests-m32/mq.test b/tests-m32/mq.test new file mode 100755 index 00000000..746b07b7 --- /dev/null +++ b/tests-m32/mq.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_getsetattr, and mq_unlink syscalls. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a28 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests-m32/mq_sendrecv-read.c b/tests-m32/mq_sendrecv-read.c new file mode 100644 index 00000000..cc9867b9 --- /dev/null +++ b/tests-m32/mq_sendrecv-read.c @@ -0,0 +1,3 @@ +#define DUMPIO_READ 1 +#define MQ_NAME "mq_sendrecv-read.sample" +#include "mq_sendrecv.c" diff --git a/tests-m32/mq_sendrecv-read.test b/tests-m32/mq_sendrecv-read.test new file mode 100755 index 00000000..eb4ad75e --- /dev/null +++ b/tests-m32/mq_sendrecv-read.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -eread=0 -a14 diff --git a/tests-m32/mq_sendrecv-write.c b/tests-m32/mq_sendrecv-write.c new file mode 100644 index 00000000..ae34ee1a --- /dev/null +++ b/tests-m32/mq_sendrecv-write.c @@ -0,0 +1,3 @@ +#define DUMPIO_WRITE 1 +#define MQ_NAME "mq_sendrecv-write.sample" +#include "mq_sendrecv.c" diff --git a/tests-m32/mq_sendrecv-write.test b/tests-m32/mq_sendrecv-write.test new file mode 100755 index 00000000..38277ec6 --- /dev/null +++ b/tests-m32/mq_sendrecv-write.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -ewrite=0 -a14 diff --git a/tests-m32/mq_sendrecv.c b/tests-m32/mq_sendrecv.c new file mode 100644 index 00000000..c151542c --- /dev/null +++ b/tests-m32/mq_sendrecv.c @@ -0,0 +1,480 @@ +/* + * Check decoding of mq_open, mq_timedsend, mq_notify, mq_timedreceive and + * mq_unlink syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined __NR_mq_open && __NR_mq_timedsend && __NR_mq_timedreceive && \ + __NR_mq_notify && __NR_mq_unlink + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "sigevent.h" + +# ifndef MQ_NAME +# define MQ_NAME "mq_sendrecv.sample" +# endif + +# ifndef DUMPIO_READ +# define DUMPIO_READ 0 +# endif + +# ifndef DUMPIO_WRITE +# define DUMPIO_WRITE 0 +# endif + + +enum { + NUM_ATTRS = 8, + MSG_CUT = 8, + MSG_MAX_UNCUT = 32, + MSG_SIZE = 64, + MSG_START = 0x80, +}; + + +static void +printstr(unsigned char start, unsigned int count) +{ + unsigned int i; + + printf("\""); + for (i = 0; i < count; i++) { + printf("\\%hho", (unsigned char) (start + i)); + } + printf("\""); +} + +#if DUMPIO_READ || DUMPIO_WRITE +static void +dumpstr(unsigned char start, unsigned int count) +{ + unsigned int i; + unsigned int j; + + for (i = 0; i < count; i++) { + if (i < count) { + if (!(i % 16)) + printf(" | %05x ", i); + if (!(i % 8)) + printf(" "); + + printf("%02hhx ", (unsigned char) (start + i)); + } + + if ((i % 16 == 15) || (i == (count - 1))) { + if (i % 16 != 15) + printf("%*s", 3 * (15 - i % 16) + + ((i + 8) % 16) / 8, " "); + + printf(" "); + + for (j = 0; j <= (i % 16); j++) + printf("."); + for (j = i % 16; j < 15; j++) + printf(" "); + + printf(" |\n"); + + } + } +} +#endif /* DUMPIO_READ || DUMPIO_WRITE */ + +static void +cleanup(void) +{ + long rc; + + rc = syscall(__NR_mq_unlink, MQ_NAME); + printf("mq_unlink(\"" MQ_NAME "\") = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); +} + +static void +do_send(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, + bool cropped) +{ + long rc; + long saved_errno; + + do { + rc = syscall(__NR_mq_timedsend, fd, msg, msg_size, 42, + tmout); + saved_errno = errno; + printf("mq_timedsend(%d, ", fd); + printstr(MSG_START, msg_size > MSG_MAX_UNCUT ? MSG_MAX_UNCUT : + msg_size); + if (cropped) + printf("..."); + errno = saved_errno; + printf(", %u, 42, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", msg_size, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + errno = saved_errno; + + if (rc == -1) { + if (errno == EINTR) + continue; + perror_msg_and_skip("mq_timedsend"); + } +# if DUMPIO_WRITE + dumpstr(MSG_START, msg_size); +# endif + } while (rc); +} + +static void +do_recv(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, + bool cropped) +{ + long rc; + long saved_errno; + unsigned prio; + + do { + rc = syscall(__NR_mq_timedreceive, fd, msg, MSG_SIZE, &prio, + tmout); + saved_errno = errno; + printf("mq_timedreceive(%d, ", fd); + if (rc >= 0) { + printstr(MSG_START, rc > MSG_MAX_UNCUT ? MSG_MAX_UNCUT : + rc); + if (cropped) + printf("..."); + } else { + printf("%p", msg); + } + errno = saved_errno; + printf(", %u, [42], {tv_sec=%jd, tv_nsec=%jd}) = %s\n", MSG_SIZE, + (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + errno = saved_errno; + + if (rc == -1) { + if (errno == EINTR) + continue; + perror_msg_and_skip("mq_timedreceive"); + } + if ((rc >= 0) && ((unsigned long) rc != msg_size)) + error_msg_and_skip("mq_timedreceive size mismatch" + ": expected %u, got %ld", + msg_size, rc); +# if DUMPIO_READ + dumpstr(MSG_START, rc); +# endif + } while (rc < 0); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0x8765432100000000ULL; + static const kernel_ulong_t bogus_oflags = + (kernel_ulong_t) 0xdefaced100000003ULL; + static const kernel_ulong_t bogus_mode = + (kernel_ulong_t) 0xdec0deadfacefeedULL; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfeedfacedeadba5eULL; + static const kernel_ulong_t bogus_zero_size = + (sizeof(kernel_ulong_t) > sizeof(int)) ? (kernel_ulong_t) 0 : + (kernel_ulong_t) 0xface1e5500000000ULL; + static const kernel_ulong_t bogus_size = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_prio = + (kernel_ulong_t) 0xdec0ded1defaced3ULL; + static const struct timespec bogus_tmout_data = { + .tv_sec = (time_t) 0xdeadfacebeeff00dLL, + .tv_nsec = (long) 0xfacefee1deadfeedLL, + }; + static const struct timespec future_tmout_data = { + .tv_sec = (time_t) 0x7ea1fade7e57faceLL, + .tv_nsec = 999999999, + };; + struct_sigevent bogus_sev_data = { + .sigev_notify = 0xdefaced, + .sigev_signo = 0xfacefeed, + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL + }; + + const char *errstr; + long rc; + kernel_long_t *bogus_attrs = tail_alloc(sizeof(*bogus_attrs) * + NUM_ATTRS); + char *msg = tail_alloc(MSG_SIZE); + unsigned *bogus_prio_ptr = tail_alloc(sizeof(*bogus_prio_ptr)); + struct timespec *bogus_tmout = tail_memdup(&bogus_tmout_data, + sizeof(*bogus_tmout)); + struct timespec *future_tmout = tail_memdup(&future_tmout_data, + sizeof(*future_tmout)); + struct_sigevent *bogus_sev = tail_memdup(&bogus_sev_data, + sizeof(*bogus_sev)); + int fd = -1; + + + fill_memory_ex(msg, MSG_SIZE, MSG_START, MSG_SIZE); + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + 0xbb, 0x70); + + + /* mq_open */ + + /* Zero values, non-O_CREAT mode */ + rc = syscall(__NR_mq_open, NULL, bogus_zero, bogus_mode, NULL); + printf("mq_open(NULL, O_RDONLY) = %s\n", sprintrc(rc)); + + /* O_CREAT parsing, other flags, bogs values */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + NULL); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, NULL) = %s\n", + msg, (unsigned short) bogus_mode, sprintrc(rc)); + + /* Partially invalid attributes structure */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + bogus_attrs + 1); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, %p) = %s\n", + msg, (unsigned short) bogus_mode, bogus_attrs + 1, sprintrc(rc)); + + /* Valid attributes structure */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + bogus_attrs); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx, " + "mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", + msg, (unsigned short) bogus_mode, + (unsigned long long) (kernel_ulong_t) bogus_attrs[0], + (long long) bogus_attrs[1], + (long long) bogus_attrs[2], + (long long) bogus_attrs[3], sprintrc(rc)); + + + /* mq_timedsend */ + + /* Zero values*/ + rc = syscall(__NR_mq_timedsend, bogus_zero, NULL, bogus_zero_size, + bogus_zero, NULL); + printf("mq_timedsend(0, NULL, 0, 0, NULL) = %s\n", sprintrc(rc)); + + /* Invalid pointers */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE, bogus_size, + bogus_prio, bogus_tmout + 1); + printf("mq_timedsend(%d, %p, %llu, %u, %p) = %s\n", + (int) bogus_fd, msg + MSG_SIZE, (unsigned long long) bogus_size, + (unsigned) bogus_prio, bogus_tmout + 1, sprintrc(rc)); + + /* Partially invalid message (memory only partially available) */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, + MSG_SIZE, bogus_prio, bogus_tmout); + printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + (int) bogus_fd, msg + MSG_SIZE - MSG_CUT, + (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + sprintrc(rc)); + + /* Fully valid message, uncut */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, + MSG_CUT, bogus_prio, bogus_tmout); + errstr = sprintrc(rc); + printf("mq_timedsend(%d, ", (int) bogus_fd); + printstr(MSG_START + MSG_SIZE - MSG_CUT, MSG_CUT); + printf(", %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + (unsigned long long) MSG_CUT, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + errstr); + + /* Partially invalid message, cut at maxstrlen */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_CUT, MSG_SIZE, + bogus_prio, bogus_tmout); + errstr = sprintrc(rc); + printf("mq_timedsend(%d, ", (int) bogus_fd); + printstr(MSG_START + MSG_CUT, MSG_MAX_UNCUT); + printf("..., %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + errstr); + + + /* mq_timedreceive */ + + /* Zero values */ + rc = syscall(__NR_mq_timedreceive, bogus_zero, NULL, bogus_zero_size, + NULL, NULL); + printf("mq_timedreceive(0, NULL, 0, NULL, NULL) = %s\n", sprintrc(rc)); + + /* Invalid addresses */ + rc = syscall(__NR_mq_timedreceive, bogus_fd, msg + MSG_SIZE, bogus_size, + bogus_prio_ptr + 1, bogus_tmout + 1); + printf("mq_timedreceive(%d, %p, %llu, %p, %p) = %s\n", + (int) bogus_fd, msg + MSG_SIZE, (unsigned long long) bogus_size, + bogus_prio_ptr + 1, bogus_tmout + 1, sprintrc(rc)); + + /* Invalid fd, valid msg pointer */ + rc = syscall(__NR_mq_timedreceive, bogus_fd, msg, bogus_size, + bogus_prio_ptr, bogus_tmout); + printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + (int) bogus_fd, msg, (unsigned long long) bogus_size, + bogus_prio_ptr, (intmax_t) bogus_tmout->tv_sec, + (intmax_t) bogus_tmout->tv_nsec, sprintrc(rc)); + + + /* mq_notify */ + + /* Zero values */ + rc = syscall(__NR_mq_notify, bogus_zero, NULL); + printf("mq_notify(0, NULL) = %s\n", sprintrc(rc)); + + /* Invalid pointer */ + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev + 1); + printf("mq_notify(%d, %p) = %s\n", + (int) bogus_fd, bogus_sev + 1, sprintrc(rc)); + + /* Invalid SIGEV_* */ + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=%u, sigev_notify=%#x /* SIGEV_??? */}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_signo, bogus_sev->sigev_notify, + sprintrc(rc)); + + /* SIGEV_NONE */ + bogus_sev->sigev_notify = SIGEV_NONE; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_signo, sprintrc(rc)); + + /* SIGEV_SIGNAL */ + bogus_sev->sigev_notify = SIGEV_SIGNAL; + bogus_sev->sigev_signo = SIGALRM; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, sprintrc(rc)); + + /* SIGEV_THREAD */ + bogus_sev->sigev_notify = SIGEV_THREAD; + bogus_sev->sigev_un.sigev_thread.function = + (unsigned long) 0xdeadbeefbadc0dedULL; + bogus_sev->sigev_un.sigev_thread.attribute = + (unsigned long) 0xcafef00dfacefeedULL; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " + "sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}) = " + "%s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_un.sigev_thread.function, + bogus_sev->sigev_un.sigev_thread.attribute, sprintrc(rc)); + + /* mq_unlink */ + + /* Zero values */ + rc = syscall(__NR_mq_unlink, NULL); + printf("mq_unlink(NULL) = %s\n", sprintrc(rc)); + + /* Invalid ptr */ + rc = syscall(__NR_mq_unlink, msg + MSG_SIZE); + printf("mq_unlink(%p) = %s\n", msg + MSG_SIZE, sprintrc(rc)); + + /* Long unterminated string */ + rc = syscall(__NR_mq_unlink, msg); + errstr = sprintrc(rc); + printf("mq_unlink(%p) = %s\n", msg, errstr); + + + /* Sending and receiving test */ + +# if DUMPIO_READ || DUMPIO_WRITE + close(0); +# endif + bogus_attrs[1] = 2; + bogus_attrs[2] = MSG_SIZE; + fd = rc = syscall(__NR_mq_open, MQ_NAME, + O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); + errstr = sprintrc(rc); + if (rc < 0) + perror_msg_and_skip("mq_open"); + else + atexit(cleanup); +# if DUMPIO_READ || DUMPIO_WRITE + if (fd != 0) + error_msg_and_skip("mq_open returned fd other than 0"); +# endif + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + 0xbb, 0x70); + printf("mq_open(\"" MQ_NAME "\", O_RDWR|O_CREAT|O_NONBLOCK, " + "0700, {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u, " + "mq_curmsgs=%lld}) = %s\n", + (unsigned long long) (kernel_ulong_t) bogus_attrs[0], MSG_SIZE, + (long long) bogus_attrs[3], errstr); + + rc = syscall(__NR_mq_getsetattr, fd, NULL, bogus_attrs); + if (rc < 0) + perror_msg_and_skip("mq_getsetattr"); + if ((bogus_attrs[1] < 2) || (bogus_attrs[2] < MSG_SIZE)) + error_msg_and_skip("mq too small"); + + do_send(fd, msg, MSG_CUT, future_tmout, false); + do_send(fd, msg, MSG_SIZE, future_tmout, true); + + memset(msg, '\0', MSG_SIZE); + do_recv(fd, msg, MSG_CUT, future_tmout, false); + + memset(msg, '\0', MSG_SIZE); + do_recv(fd, msg, MSG_SIZE, future_tmout, true); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mq_open && __NR_mq_timedsend && " + "__NR_mq_timedreceive && __NR_mq_notify && __NR_mq_unlink"); + +#endif diff --git a/tests-m32/mq_sendrecv.test b/tests-m32/mq_sendrecv.test new file mode 100755 index 00000000..67f4d63c --- /dev/null +++ b/tests-m32/mq_sendrecv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -a14 diff --git a/tests-m32/msg_control-v.c b/tests-m32/msg_control-v.c new file mode 100644 index 00000000..b0afa523 --- /dev/null +++ b/tests-m32/msg_control-v.c @@ -0,0 +1,3 @@ +/* This file is part of msg_control-v strace test. */ +#define VERBOSE 1 +#include "msg_control.c" diff --git a/tests-m32/msg_control-v.test b/tests-m32/msg_control-v.test new file mode 100755 index 00000000..41f98428 --- /dev/null +++ b/tests-m32/msg_control-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of struct msghdr ancillary data. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests-m32/msg_control.c b/tests-m32/msg_control.c new file mode 100644 index 00000000..709a3075 --- /dev/null +++ b/tests-m32/msg_control.c @@ -0,0 +1,715 @@ +/* + * Check decoding of struct msghdr ancillary data. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SOL_IP +# define SOL_IP 0 +#endif +#ifndef SOL_TCP +# define SOL_TCP 6 +#endif + +#ifndef SCM_SECURITY +# define SCM_SECURITY 3 +#endif + +#define MIN_SIZE_OF(type, member) \ + (offsetof(type, member) + sizeof(((type *) 0)->member)) + +static struct cmsghdr * +get_cmsghdr(void *const page, const size_t len) +{ + return page - CMSG_ALIGN(len); +} + +#define DEFAULT_STRLEN 32 + +static void +print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len) +{ + size_t nfd = cmsg_len > CMSG_LEN(0) + ? (cmsg_len - CMSG_LEN(0)) / sizeof(int) : 0; + if (!nfd) + return; + + printf(", cmsg_data=["); + int *fdp = (int *) CMSG_DATA(cmsg); + size_t i; + for (i = 0; i < nfd; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("%d", fdp[i]); + } + printf("]"); +} + +static void +test_scm_rights1(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const void *const src, + const size_t cmsg_len) +{ + const size_t aligned_cms_len = + cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); + if (cmsg_len >= CMSG_LEN(0) + && aligned_cms_len + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen); + + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) + cmsg->cmsg_len = cmsg_len; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_level)) + cmsg->cmsg_level = SOL_SOCKET; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_type)) + cmsg->cmsg_type = SCM_RIGHTS; + + size_t src_len = + cmsg_len < msg_controllen ? cmsg_len : msg_controllen; + if (src_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0)); + + mh->msg_control = cmsg; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0"); + if (msg_controllen < CMSG_LEN(0)) { + if (msg_controllen) + printf(", msg_control=%p", cmsg); + } else { + printf(", msg_control=[{cmsg_len=%lu, cmsg_level=SOL_SOCKET" + ", cmsg_type=SCM_RIGHTS", (unsigned long) cmsg_len); + print_fds(cmsg, src_len); + printf("}"); + if (aligned_cms_len < msg_controllen) + printf(", %p", (void *) cmsg + aligned_cms_len); + printf("]"); + } + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_scm_rights2(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const int *const *const src, + const size_t *const cmsg_len) +{ + const size_t aligned_cms_len[2] = { + cmsg_len[0] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[0]) : CMSG_LEN(0), + cmsg_len[1] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[1]) : CMSG_LEN(0) + }; + if (cmsg_len[0] < CMSG_LEN(0) + || aligned_cms_len[0] + CMSG_LEN(0) > msg_controllen + || aligned_cms_len[0] + aligned_cms_len[1] + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *const cmsg[2] = { + get_cmsghdr(page, msg_controllen), + (void *) get_cmsghdr(page, msg_controllen) + aligned_cms_len[0] + }; + cmsg[0]->cmsg_len = cmsg_len[0]; + cmsg[0]->cmsg_level = SOL_SOCKET; + cmsg[0]->cmsg_type = SCM_RIGHTS; + if (cmsg_len[0] > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg[0]), src[0], cmsg_len[0] - CMSG_LEN(0)); + + const size_t msg_controllen1 = msg_controllen - aligned_cms_len[0]; + if (msg_controllen1 >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) + cmsg[1]->cmsg_len = cmsg_len[1]; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_level)) + cmsg[1]->cmsg_level = SOL_SOCKET; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_type)) + cmsg[1]->cmsg_type = SCM_RIGHTS; + size_t src1_len = + cmsg_len[1] < msg_controllen1 ? cmsg_len[1] : msg_controllen1; + if (src1_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg[1]), src[1], src1_len - CMSG_LEN(0)); + + mh->msg_control = cmsg[0]; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%lu" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned long) cmsg_len[0]); + print_fds(cmsg[0], cmsg_len[0]); + printf("}, {cmsg_len=%lu, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned long) cmsg_len[1]); + print_fds(cmsg[1], src1_len); + printf("}"); + if (aligned_cms_len[1] < msg_controllen1) + printf(", %p", (void *) cmsg[1] + aligned_cms_len[1]); + printf("]"); + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_scm_rights3(struct msghdr *const mh, void *const page, const size_t nfds) +{ + const size_t len = CMSG_SPACE(sizeof(int) * nfds); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(int) * nfds); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + int *fdp = (int *) CMSG_DATA(cmsg); + size_t i; + for (i = 0; i < nfds; ++i) + fdp[i] = i; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned) cmsg->cmsg_len); + print_fds(cmsg, cmsg->cmsg_len); + printf("}], msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) len, rc, errno2name()); +} + +static void +print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len) +{ + int n = cmsg_len > CMSG_LEN(0) ? cmsg_len - CMSG_LEN(0) : 0; + if (!n) + return; + + printf(", cmsg_data=\"%.*s\"", n, CMSG_DATA(cmsg)); +} + +static void +test_scm_security(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const void *const src, + const size_t cmsg_len, + const int cmsg_level, + const char *const cmsg_level_str) +{ + const size_t aligned_cms_len = + cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); + if (cmsg_len >= CMSG_LEN(0) + && aligned_cms_len + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen); + + cmsg->cmsg_len = cmsg_len; + cmsg->cmsg_level = cmsg_level; + cmsg->cmsg_type = SCM_SECURITY; + + size_t src_len = + cmsg_len < msg_controllen ? cmsg_len : msg_controllen; + if (src_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0)); + + mh->msg_control = cmsg; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%lu, cmsg_level=%s" + ", cmsg_type=SCM_SECURITY", + (unsigned long) cmsg_len, cmsg_level_str); + print_security(cmsg, src_len); + printf("}"); + if (aligned_cms_len < msg_controllen) + printf(", %p", (void *) cmsg + aligned_cms_len); + printf("]"); + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_unknown_type(struct msghdr *const mh, + void *const page, + const int cmsg_level, + const char *const cmsg_level_str, + const char *const cmsg_type_str) +{ + struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0)); + + cmsg->cmsg_len = CMSG_LEN(0); + cmsg->cmsg_level = cmsg_level; + cmsg->cmsg_type = 0xfacefeed; + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg->cmsg_len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=%s" + ", cmsg_type=%#x /* %s */}], msg_controllen=%u, msg_flags=0}" + ", 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_level_str, cmsg->cmsg_type, + cmsg_type_str, (unsigned) mh->msg_controllen, rc, errno2name()); +} + +static void +test_sol_socket(struct msghdr *const mh, void *const page) +{ + static const int fds0[] = { -10, -11, -12, -13 }; + static const int fds1[] = { -15, -16, -17, -18 }; + size_t msg_controllen, max_msg_controllen; + + max_msg_controllen = CMSG_SPACE(sizeof(fds0)) + sizeof(*fds0) - 1; + for (msg_controllen = 0; + msg_controllen <= max_msg_controllen; + msg_controllen++) { + size_t cmsg_len; + + for (cmsg_len = 0; + cmsg_len <= msg_controllen + CMSG_LEN(0); + cmsg_len++) { + test_scm_rights1(mh, msg_controllen, + page, fds0, cmsg_len); + } + } + + max_msg_controllen = + CMSG_SPACE(sizeof(fds0)) + CMSG_SPACE(sizeof(fds1)) + + sizeof(*fds0) - 1; + for (msg_controllen = CMSG_LEN(0) * 2; + msg_controllen <= max_msg_controllen; + msg_controllen++) { + static const int *const fdps[] = { fds0, fds1 }; + size_t cmsg_len[2]; + + for (cmsg_len[0] = CMSG_LEN(0); + CMSG_ALIGN(cmsg_len[0]) + CMSG_LEN(0) <= msg_controllen + && CMSG_ALIGN(cmsg_len[0]) <= CMSG_SPACE(sizeof(fds0)); + cmsg_len[0]++) { + const size_t msg_controllen1 = + msg_controllen - CMSG_ALIGN(cmsg_len[0]); + + for (cmsg_len[1] = 0; + cmsg_len[1] <= msg_controllen1 + CMSG_LEN(0); + cmsg_len[1]++) { + test_scm_rights2(mh, msg_controllen, + page, fdps, cmsg_len); + } + } + } + + static const char text[16] = "0123456789abcdef"; + max_msg_controllen = CMSG_SPACE(sizeof(text)) + CMSG_LEN(0) - 1; + for (msg_controllen = CMSG_LEN(0); + msg_controllen <= max_msg_controllen; + msg_controllen++) { + size_t cmsg_len; + + for (cmsg_len = 0; + cmsg_len <= msg_controllen + CMSG_LEN(0) + && cmsg_len <= CMSG_LEN(sizeof(text)); + cmsg_len++) { + test_scm_security(mh, msg_controllen, + page, text, cmsg_len, + ARG_STR(SOL_SOCKET)); + } + } + + test_scm_rights3(mh, page, DEFAULT_STRLEN - 1); + test_scm_rights3(mh, page, DEFAULT_STRLEN); + test_scm_rights3(mh, page, DEFAULT_STRLEN + 1); + + test_unknown_type(mh, page, ARG_STR(SOL_SOCKET), "SCM_???"); +} + +static void +test_ip_pktinfo(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct in_pktinfo)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct in_pktinfo *const info = (struct in_pktinfo *) CMSG_DATA(cmsg); +#ifdef HAVE_IF_INDEXTONAME + info->ipi_ifindex = if_nametoindex("lo"); +#else + info->ipi_ifindex = 1; +#endif + info->ipi_spec_dst.s_addr = inet_addr("1.2.3.4"); + info->ipi_addr.s_addr = inet_addr("5.6.7.8"); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={ipi_ifindex=%s" + ", ipi_spec_dst=inet_addr(\"%s\")" + ", ipi_addr=inet_addr(\"%s\")}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, +#ifdef HAVE_IF_INDEXTONAME + "if_nametoindex(\"lo\")", +#else + "1", +#endif + "1.2.3.4", "5.6.7.8", len, rc, errno2name()); +} + +static void +test_ip_uint(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(int)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + unsigned int *u = (void *) CMSG_DATA(cmsg); + *u = 0xfacefeed; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[%u]}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, *u, len, + rc, errno2name()); +} + +static void +test_ip_uint8_t(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(1); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(1); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + *CMSG_DATA(cmsg) = 'A'; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[%#x]}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + (unsigned) (uint8_t) 'A', len, rc, errno2name()); +} + +static void +print_ip_opts(const void *const cmsg_data, const unsigned int data_len) +{ + const unsigned char *const opts = cmsg_data; + unsigned int i; + for (i = 0; i < data_len; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("0x%02x", opts[i]); + } +} + +static void +test_ip_opts(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str, + const unsigned int opts_len) +{ + unsigned int len = CMSG_SPACE(opts_len); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(opts_len); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + unsigned int i; + for (i = 0; i < opts_len; ++i) + CMSG_DATA(cmsg)[i] = 'A' + i; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[", + (unsigned) cmsg->cmsg_len, cmsg_type_str); + print_ip_opts(CMSG_DATA(cmsg), opts_len); + printf("]}], msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + len, rc, errno2name()); +} + +#ifdef IP_CHECKSUM +struct sock_ee { + uint32_t ee_errno; + uint8_t ee_origin; + uint8_t ee_type; + uint8_t ee_code; + uint8_t ee_pad; + uint32_t ee_info; + uint32_t ee_data; + struct sockaddr_in offender; +}; + +static void +test_ip_recverr(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct sock_ee)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sock_ee)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct sock_ee *const e = (struct sock_ee *) CMSG_DATA(cmsg); + e->ee_errno = 0xdeadbeef; + e->ee_origin = 2; + e->ee_type = 3; + e->ee_code = 4; + e->ee_info = 0xfacefeed; + e->ee_data = 0xbadc0ded; + e->offender.sin_family = AF_INET, + e->offender.sin_port = htons(12345), + e->offender.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={ee_errno=%u, ee_origin=%u" + ", ee_type=%u, ee_code=%u, ee_info=%u, ee_data=%u" + ", offender={sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"127.0.0.1\")}}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + e->ee_errno, e->ee_origin, e->ee_type, + e->ee_code, e->ee_info, e->ee_data, + ntohs(e->offender.sin_port), + len, rc, errno2name()); +} +#endif + +#ifdef IP_ORIGDSTADDR +static void +test_ip_origdstaddr(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct sockaddr_in)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sockaddr_in)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct sockaddr_in *const sin = (struct sockaddr_in *) CMSG_DATA(cmsg); + sin->sin_family = AF_INET, + sin->sin_port = htons(12345), + sin->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={sa_family=AF_INET" + ", sin_port=htons(%hu), sin_addr=inet_addr(\"127.0.0.1\")}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + ntohs(sin->sin_port), len, rc, errno2name()); +} +#endif + +static void +test_sol_ip(struct msghdr *const mh, void *const page) +{ + test_ip_pktinfo(mh, page, ARG_STR(IP_PKTINFO)); + test_ip_uint(mh, page, ARG_STR(IP_TTL)); + test_ip_uint8_t(mh, page, ARG_STR(IP_TOS)); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 1); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 2); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 3); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 4); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 5); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 6); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 7); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 8); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN - 1); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN + 1); +#ifdef IP_CHECKSUM + test_ip_recverr(mh, page, ARG_STR(IP_RECVERR)); +#endif +#ifdef IP_ORIGDSTADDR + test_ip_origdstaddr(mh, page, ARG_STR(IP_ORIGDSTADDR)); +#endif +#ifdef IP_CHECKSUM + test_ip_uint(mh, page, ARG_STR(IP_CHECKSUM)); +#endif + test_scm_security(mh, CMSG_LEN(0), page, 0, CMSG_LEN(0), + ARG_STR(SOL_IP)); + test_unknown_type(mh, page, ARG_STR(SOL_IP), "IP_???"); +} + +static void +test_unknown_level(struct msghdr *const mh, void *const page) +{ + struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0)); + + cmsg->cmsg_len = CMSG_LEN(0); + cmsg->cmsg_level = SOL_TCP; + cmsg->cmsg_type = 0xdeadbeef; + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg->cmsg_len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=%s" + ", cmsg_type=%#x}], msg_controllen=%u, msg_flags=0}" + ", 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, "SOL_TCP", cmsg->cmsg_type, + (unsigned) mh->msg_controllen, rc, errno2name()); +} + +static void +test_big_len(struct msghdr *const mh) +{ + int optmem_max; + + if (read_int_from_file("/proc/sys/net/core/optmem_max", &optmem_max) + || optmem_max <= 0 || optmem_max > 0x100000) + optmem_max = sizeof(long long) * (2 * IOV_MAX + 512); + optmem_max = (optmem_max + sizeof(long long) - 1) + & ~(sizeof(long long) - 1); + + const size_t len = optmem_max * 2; + struct cmsghdr *const cmsg = tail_alloc(len); + cmsg->cmsg_len = len; + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + if (EBADF != errno) + perror_msg_and_skip("sendmsg"); + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned) cmsg->cmsg_len); + print_fds(cmsg, optmem_max); + printf("}, ...], msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) len, rc, errno2name()); +} + +int main(int ac, const char **av) +{ + int rc = sendmsg(-1, 0, 0); + printf("sendmsg(-1, NULL, 0) = %d %s (%m)\n", rc, errno2name()); + + struct msghdr *mh = tail_alloc(sizeof(*mh)); + memset(mh, 0, sizeof(*mh)); + test_big_len(mh); + + rc = sendmsg(-1, mh + 1, 0); + printf("sendmsg(-1, %p, 0) = %d %s (%m)\n", + mh + 1, rc, errno2name()); + + void *page = tail_alloc(1) + 1; + mh->msg_control = page; + mh->msg_controllen = CMSG_LEN(0); + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=%p, msg_controllen=%u" + ", msg_flags=0}, 0) = %d %s (%m)\n", + page, (unsigned) CMSG_LEN(0), rc, errno2name()); + + test_sol_socket(mh, page); + test_sol_ip(mh, page); + test_unknown_level(mh, page); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/msg_control.test b/tests-m32/msg_control.test new file mode 100755 index 00000000..809ec7bb --- /dev/null +++ b/tests-m32/msg_control.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of struct msghdr ancillary data. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests-m32/msg_name.c b/tests-m32/msg_name.c new file mode 100644 index 00000000..c2ddda2a --- /dev/null +++ b/tests-m32/msg_name.c @@ -0,0 +1,160 @@ +/* + * Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static int +send_recv(const int send_fd, const int recv_fd, + struct msghdr *const msg, const int flags) +{ + if (send(send_fd, "A", 1, 0) != 1) + perror_msg_and_skip("send"); + return recvmsg(recv_fd, msg, flags); +} + +static void +test_msg_name(const int send_fd, const int recv_fd) +{ + char *const recv_buf = tail_alloc(sizeof(*recv_buf)); + struct iovec *const iov = tail_alloc(sizeof(*iov)); + iov->iov_base = recv_buf; + iov->iov_len = sizeof(*recv_buf); + + struct sockaddr_un *const addr = tail_alloc(sizeof(*addr)); + struct msghdr *const msg = tail_alloc(sizeof(*msg)); + msg->msg_name = addr; + msg->msg_namelen = sizeof(*addr); + msg->msg_iov = iov; + msg->msg_iovlen = 1; + msg->msg_control = 0; + msg->msg_controllen = 0; + msg->msg_flags = 0; + + int rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("recvmsg"); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%s\"}" + ", msg_namelen=%d->%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, addr->sun_path, (int) sizeof(struct sockaddr_un), + (int) msg->msg_namelen, rc); + + memset(addr, 0, sizeof(*addr)); + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%s\"}" + ", msg_namelen=%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, addr->sun_path, (int) msg->msg_namelen, rc); + + msg->msg_name = 0; + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name=NULL, msg_namelen=%d" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, MSG_DONTWAIT) = %d\n", + recv_fd, (int) msg->msg_namelen, rc); + + const size_t offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + msg->msg_name = addr; + msg->msg_namelen = offsetof_sun_path; + memset(addr->sun_path, 'A', sizeof(addr->sun_path)); + + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX}, msg_namelen=%d->%d" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, MSG_DONTWAIT) = %d\n", + recv_fd, (int) offsetof_sun_path, (int) msg->msg_namelen, rc); + + msg->msg_namelen = sizeof(struct sockaddr); + msg->msg_name = ((void *) (addr + 1)) - msg->msg_namelen; + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%.*s\"}" + ", msg_namelen=%d->%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, (int) (sizeof(struct sockaddr) - offsetof_sun_path), + ((struct sockaddr_un *) msg->msg_name)->sun_path, + (int) sizeof(struct sockaddr), (int) msg->msg_namelen, rc); + + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_namelen=%d}, MSG_DONTWAIT) = %d %s (%m)\n", + recv_fd, (int) msg->msg_namelen, rc, errno2name()); + + /* + * When recvmsg is called with a valid descriptor + * but inaccessible memory, it causes segfaults on some architectures. + * As in these cases we test decoding of failed recvmsg calls, + * it's ok to fail recvmsg with any reason as long as + * it doesn't read that inaccessible memory. + */ + + /* + * Sadly, musl recvmsg wrapper blindly dereferences 2nd argument, + * so limit this test to glibc that doesn't. + */ +#ifdef __GLIBC__ + rc = send_recv(send_fd, -1, msg + 1, 0); + printf("recvmsg(-1, %p, 0) = %d %s (%m)\n", + msg + 1, rc, errno2name()); +#endif + + rc = send_recv(send_fd, -1, 0, 0); + printf("recvmsg(-1, NULL, 0) = %d %s (%m)\n", + rc, errno2name()); +} + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = "msg_name-recvmsg.test.send.socket" + }; + + (void) unlink(un.sun_path); + if (bind(fds[1], (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + test_msg_name(fds[1], fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/msg_name.test b/tests-m32/msg_name.test new file mode 100755 index 00000000..ac06dd55 --- /dev/null +++ b/tests-m32/msg_name.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests-m32/munlockall.c b/tests-m32/munlockall.c new file mode 100644 index 00000000..9ac69423 --- /dev/null +++ b/tests-m32/munlockall.c @@ -0,0 +1,13 @@ +#include "tests.h" + +#include +#include + +int +main(void) +{ + printf("munlockall() = %d\n", munlockall()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/munlockall.test b/tests-m32/munlockall.test new file mode 100755 index 00000000..e25d60a8 --- /dev/null +++ b/tests-m32/munlockall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check munlockall syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-m32/nanosleep.c b/tests-m32/nanosleep.c new file mode 100644 index 00000000..9f0e626f --- /dev/null +++ b/tests-m32/nanosleep.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } req = { + .ts.tv_nsec = 0xc0de1, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, rem = { + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + + if (nanosleep(&req.ts, NULL)) + perror_msg_and_fail("nanosleep"); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, NULL) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + assert(nanosleep(NULL, &rem.ts) == -1); + printf("nanosleep(NULL, %p) = -1 EFAULT (%m)\n", &rem.ts); + + if (nanosleep(&req.ts, &rem.ts)) + perror_msg_and_fail("nanosleep"); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + req.ts.tv_nsec = 1000000000; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" + ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", + (intmax_t) itv.it_interval.tv_sec, + (intmax_t) itv.it_interval.tv_usec, + (intmax_t) itv.it_value.tv_sec, + (intmax_t) itv.it_value.tv_usec); + + req.ts.tv_nsec = 999999999; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, {tv_sec=%jd, tv_nsec=%jd})" + " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, + (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nanosleep.test b/tests-m32/nanosleep.test new file mode 100755 index 00000000..055a8dcd --- /dev/null +++ b/tests-m32/nanosleep.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check nanosleep and setitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=nanosleep,setitimer diff --git a/tests-m32/net-accept-connect.c b/tests-m32/net-accept-connect.c new file mode 100644 index 00000000..04c05a60 --- /dev/null +++ b/tests-m32/net-accept-connect.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +handler(int sig) +{ + assert(close(1) == 0); + _exit(0); +} + +int +main(int ac, const char **av) +{ + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + }; + socklen_t len; + + assert(ac == 2); + assert(strlen(av[1]) > 0); + + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (len > sizeof(addr)) + len = sizeof(addr); + + unlink(av[1]); + close(0); + close(1); + + if (socket(AF_UNIX, SOCK_STREAM, 0)) + perror_msg_and_skip("socket"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + + memset(&addr, 0, sizeof addr); + assert(getsockname(0, (struct sockaddr *) &addr, &len) == 0); + if (len > sizeof(addr)) + len = sizeof(addr); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (pid) { + assert(accept(0, (struct sockaddr *) &addr, &len) == 1); + assert(close(0) == 0); + assert(kill(pid, SIGUSR1) == 0); + int status; + assert(waitpid(pid, &status, 0) == pid); + assert(status == 0); + assert(close(1) == 0); + } else { + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGUSR1); + + assert(sigprocmask(SIG_BLOCK, &set, NULL) == 0); + assert(signal(SIGUSR1, handler) != SIG_ERR); + assert(socket(AF_UNIX, SOCK_STREAM, 0) == 1); + assert(close(0) == 0); + assert(connect(1, (struct sockaddr *) &addr, len) == 0); + assert(sigprocmask(SIG_UNBLOCK, &set, NULL) == 0); + assert(pause() == 99); + return 1; + } + + unlink(av[1]); + return 0; +} diff --git a/tests-m32/net-icmp_filter.c b/tests-m32/net-icmp_filter.c new file mode 100644 index 00000000..f3f99f14 --- /dev/null +++ b/tests-m32/net-icmp_filter.c @@ -0,0 +1,84 @@ +/* + * Check decoding of ICMP_FILTER. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + getsockopt(-1, SOL_RAW, ICMP_FILTER, 0, 0); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, NULL) = -1 %s (%m)\n", + errno2name()); + + setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0); + printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0) = -1 %s (%m)\n", + errno2name()); + + socklen_t *const plen = tail_alloc(sizeof(*plen)); + void *const efault = plen + 1; + struct icmp_filter *const f = tail_alloc(sizeof(*f)); + + getsockopt(-1, SOL_RAW, ICMP_FILTER, f, plen); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %p) = -1 %s (%m)\n", + f, plen, errno2name()); + + setsockopt(-1, SOL_RAW, ICMP_FILTER, efault, sizeof(*f)); + printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %u) = -1 %s (%m)\n", + efault, (unsigned) sizeof(*f), errno2name()); + + f->data = ~( + 1< + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include +# include +# include +# include +#endif + +#ifdef HAVE_IF_INDEXTONAME +/* used to conflict with */ +extern unsigned int if_nametoindex(const char *); +#endif + +static void +check_un(void) +{ + struct sockaddr_un *un = tail_alloc(sizeof(*un)); + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + unsigned int len = sizeof(*un); + int ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[1] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%u\"}, %u)" + " = %d EBADF (%m)\n", 0, len, ret); + + un->sun_path[0] = 0; + un->sun_path[2] = 1; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"\\0\\001%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 3, 0, len, ret); + + un = ((void *) un) - 2; + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + len = sizeof(*un) + 2; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 1, 0, len, ret); + + un = ((void *) un) + 4; + un->sun_family = AF_UNIX; + len = sizeof(*un) - 2; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 2, 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 3, 0, len, ret); + + len = sizeof(*un); + ret = connect(-1, (void *) un, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", un, len, ret); + + un = tail_alloc(sizeof(struct sockaddr_storage)); + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + len = sizeof(struct sockaddr_storage) + 1; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 1, 0, len, ret); +} + +static void +check_in(void) +{ + const unsigned short h_port = 12345; + static const char h_addr[] = "12.34.56.78"; + + struct sockaddr_in *in = tail_alloc(sizeof(*in)); + in->sin_family = AF_INET; + in->sin_port = htons(h_port); + in->sin_addr.s_addr = inet_addr(h_addr); + unsigned int len = sizeof(*in); + int ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %d EBADF (%m)\n", + h_port, h_addr, len, ret); + + in = ((void *) in) - 4; + in->sin_family = AF_INET; + in->sin_port = htons(h_port); + in->sin_addr.s_addr = inet_addr(h_addr); + len = sizeof(*in) + 4; + ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %d EBADF (%m)\n", + h_port, h_addr, len, ret); + + in = ((void *) in) + 8; + in->sin_family = AF_INET; + in->sin_port = 0; + in->sin_addr.s_addr = 0; + len = sizeof(*in) - 4; + ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sa_data=\"%s\"}, %u)" + " = %d EBADF (%m)\n", + "\\0\\0\\0\\0\\0\\0\\377\\377\\377\\377", + len, ret); + + len = sizeof(*in); + ret = connect(-1, (void *) in, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in, len, ret); +} + +static void +check_in6_linklocal(struct sockaddr_in6 *const in6, const char *const h_addr) +{ + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + + in6->sin6_scope_id = 0xfacefeed; + unsigned int len = sizeof(*in6); + int ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)" + ", sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + ntohs(in6->sin6_port), h_addr, + ntohl(in6->sin6_flowinfo), in6->sin6_scope_id, len, ret); + +#ifdef HAVE_IF_INDEXTONAME + in6->sin6_scope_id = if_nametoindex("lo"); + if (in6->sin6_scope_id) { + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)" + ", sin6_scope_id=if_nametoindex(\"lo\")}, %u)" + " = %d EBADF (%m)\n", + ntohs(in6->sin6_port), h_addr, + ntohl(in6->sin6_flowinfo), len, ret); + } +#endif +} + +static void +check_in6(void) +{ + const unsigned short h_port = 12345; + const unsigned int h_flowinfo = 1234567890; + static const char h_addr[] = "12:34:56:78:90:ab:cd:ef"; + + struct sockaddr_in6 *in6 = tail_alloc(sizeof(*in6)); + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + in6->sin6_scope_id = 0xfacefeed; + unsigned int len = sizeof(*in6); + int ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + + check_in6_linklocal(in6, "fe80::"); + check_in6_linklocal(in6, "ff42::"); + + in6 = ((void *) in6) - 4; + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + in6->sin6_scope_id = 0xfacefeed; + len = sizeof(*in6) + 4; + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + + in6 = ((void *) in6) + 4 + sizeof(in6->sin6_scope_id); + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + len = sizeof(*in6) - sizeof(in6->sin6_scope_id); + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, len, ret); + + in6 = ((void *) in6) + 4; + in6->sin6_family = AF_INET6; + in6->sin6_port = 0; + in6->sin6_flowinfo = 0; + memset(&in6->sin6_addr, '0', sizeof(in6->sin6_addr) - 4); + len = sizeof(*in6) - sizeof(in6->sin6_scope_id) - 4; + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6" + ", sa_data=\"\\0\\0\\0\\0\\0\\000%.*u\"}, %u)" + " = %d EBADF (%m)\n", + (int) (len - offsetof(struct sockaddr_in6, sin6_addr)), 0, + len, ret); + + len = sizeof(*in6) - sizeof(in6->sin6_scope_id); + ret = connect(-1, (void *) in6, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in6, len, ret); +} + +static void +check_ipx(void) +{ + const unsigned short h_port = 12345; + const unsigned int h_network = 0xfacefeed; + struct sockaddr_ipx c_ipx = { + .sipx_family = AF_IPX, + .sipx_port = htons(h_port), + .sipx_network = htonl(h_network), + .sipx_node = "ABCDEF", + .sipx_type = -1 + }; + void *ipx = tail_memdup(&c_ipx, sizeof(c_ipx)); + unsigned int len = sizeof(c_ipx); + int ret = connect(-1, ipx, len); + printf("connect(-1, {sa_family=AF_IPX, sipx_port=htons(%u)" + ", sipx_network=htonl(%#x)" + ", sipx_node=[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + ", sipx_type=%#02x}, %u) = %d EBADF (%m)\n", + h_port, h_network, + c_ipx.sipx_node[0], c_ipx.sipx_node[1], + c_ipx.sipx_node[2], c_ipx.sipx_node[3], + c_ipx.sipx_node[4], c_ipx.sipx_node[5], + c_ipx.sipx_type, len, ret); +} + +static void +check_nl(void) +{ + struct sockaddr_nl *nl = tail_alloc(sizeof(*nl)); + nl->nl_family = AF_NETLINK; + nl->nl_pid = 1234567890; + nl->nl_groups = 0xfacefeed; + unsigned int len = sizeof(*nl); + int ret = connect(-1, (void *) nl, len); + printf("connect(-1, {sa_family=AF_NETLINK, nl_pid=%d" + ", nl_groups=%#08x}, %u) = %d EBADF (%m)\n", + nl->nl_pid, nl->nl_groups, len, ret); + + nl = ((void *) nl) - 4; + nl->nl_family = AF_NETLINK; + nl->nl_pid = 1234567890; + nl->nl_groups = 0xfacefeed; + len = sizeof(*nl) + 4; + ret = connect(-1, (void *) nl, len); + printf("connect(-1, {sa_family=AF_NETLINK, nl_pid=%d" + ", nl_groups=%#08x}, %u) = %d EBADF (%m)\n", + nl->nl_pid, nl->nl_groups, len, ret); +} + +static void +check_ll(void) +{ + struct sockaddr_ll c_ll = { + .sll_family = AF_PACKET, + .sll_protocol = htons(ETH_P_ALL), + .sll_ifindex = 0xfacefeed, + .sll_hatype = ARPHRD_ETHER, + .sll_pkttype = PACKET_HOST, + .sll_halen = sizeof(c_ll.sll_addr), + .sll_addr = "abcdefgh" + }; + void *ll = tail_memdup(&c_ll, sizeof(c_ll)); + unsigned int len = sizeof(c_ll); + int ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %d EBADF (%m)\n", + c_ll.sll_ifindex, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, ret); + + ((struct sockaddr_ll *) ll)->sll_halen++; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, ...]" + "}, %u) = %d EBADF (%m)\n", + c_ll.sll_ifindex, c_ll.sll_halen + 1, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, ret); + + ((struct sockaddr_ll *) ll)->sll_halen = 0; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" + " = %d EBADF (%m)\n", c_ll.sll_ifindex, len, ret); + +#ifdef HAVE_IF_INDEXTONAME + const int id = if_nametoindex("lo"); + if (id) { + ((struct sockaddr_ll *) ll)->sll_ifindex = id; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=if_nametoindex(\"lo\")" + ", sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" + " = %d EBADF (%m)\n", len, ret); + } +#endif +} + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static void +check_hci(void) +{ + const unsigned short h_port = 12345; + struct sockaddr_hci *hci = tail_alloc(sizeof(*hci)); + hci->hci_family = AF_BLUETOOTH; + hci->hci_dev = htobs(h_port); + hci->hci_channel = HCI_CHANNEL_RAW; + unsigned int len = sizeof(*hci); + int ret = connect(-1, (void *) hci, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" + ", hci_channel=HCI_CHANNEL_RAW}, %u) = %d EBADF (%m)\n", + h_port, len, ret); +} + +static void +check_sco(void) +{ + const struct sockaddr_sco c_sco = { + .sco_family = AF_BLUETOOTH, + .sco_bdaddr.b = "abcdef" + }; + void *sco = tail_memdup(&c_sco, sizeof(c_sco)); + unsigned int len = sizeof(c_sco); + int ret = connect(-1, sco, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + "}, %u) = %d EBADF (%m)\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, ret); +} + +static void +check_rc(void) +{ + const struct sockaddr_rc c_rc = { + .rc_family = AF_BLUETOOTH, + .rc_bdaddr.b = "abcdef", + .rc_channel = 42 + }; + void *rc = tail_memdup(&c_rc, sizeof(c_rc)); + unsigned int len = sizeof(c_rc); + int ret = connect(-1, rc, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", rc_channel=%u}, %u) = %d EBADF (%m)\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, ret); +} + +static void +check_l2(void) +{ + const unsigned short h_psm = 12345; + const unsigned short h_cid = 13579; + const struct sockaddr_l2 c_l2 = { + .l2_family = AF_BLUETOOTH, + .l2_psm = htobs(h_psm), + .l2_bdaddr.b = "abcdef", + .l2_cid = htobs(h_cid), + .l2_bdaddr_type = 42 + }; + void *l2 = tail_memdup(&c_l2, sizeof(c_l2)); + unsigned int len = sizeof(c_l2); + int ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(%hu)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(%hu), l2_bdaddr_type=%u}" + ", %u) = %d EBADF (%m)\n", h_psm, + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + h_cid, c_l2.l2_bdaddr_type, len, ret); +} +#endif + +static void +check_raw(void) +{ + union { + struct sockaddr *sa; + struct sockaddr_storage *st; + } u = { .st = tail_alloc(sizeof(*u.st)) }; + memset(u.st, '0', sizeof(*u.st)); + u.sa->sa_family = 0xff; + unsigned int len = sizeof(*u.st) + 8; + int ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=%#x /* AF_??? */, sa_data=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", u.sa->sa_family, + (int) (sizeof(*u.st) - sizeof(u.sa->sa_family)), 0, len, ret); + + u.sa->sa_family = 0; + len = sizeof(u.sa->sa_family) + 1; + ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=AF_UNSPEC, sa_data=\"0\"}, %u)" + " = %d EBADF (%m)\n", len, ret); + + u.sa->sa_family = AF_BLUETOOTH; + ++len; + ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"00\"}, %u)" + " = %d EBADF (%m)\n", len, ret); +} + +int +main(void) +{ + check_un(); + check_in(); + check_in6(); + check_ipx(); + check_nl(); + check_ll(); +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + check_hci(); + check_sco(); + check_rc(); + check_l2(); +#endif + check_raw(); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-sockaddr.test b/tests-m32/net-sockaddr.test new file mode 100755 index 00000000..cdfe536f --- /dev/null +++ b/tests-m32/net-sockaddr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sockaddr structures. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=connect diff --git a/tests-m32/net-y-unix.c b/tests-m32/net-y-unix.c new file mode 100644 index 00000000..3efc2f64 --- /dev/null +++ b/tests-m32/net-y-unix.c @@ -0,0 +1,235 @@ +/* + * This file is part of net-y-unix strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int ac, const char **av) +{ + assert(ac == 2); + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + unsigned int sun_path_len = strlen(av[1]); + assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (*len > sizeof(addr)) + *len = sizeof(addr); + + int listen_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + listen_fd, listen_inode); + + (void) unlink(av[1]); + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], [%u]) = 0\n", + listen_fd, listen_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], (int) sizeof(addr), (int) *len); + + int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + unsigned long accept_inode = inode_of_sockfd(accept_fd); + printf("accept(%d, {sa_family=AF_UNIX}" + ", [%d->%d]) = %d\n", + listen_fd, listen_inode, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, + av[1], (int) sizeof(addr), (int) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d) = 0\n", connect_fd, connect_inode); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d) = 0\n", accept_fd, accept_inode); + + connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + *optval = 1; + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_SOCKET, SO_PASSCRED, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], %u) = 0\n", + connect_fd, connect_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + listen_fd, listen_inode, av[1], + (int) sizeof(addr), (int) *len); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + accept_inode = inode_of_sockfd(accept_fd); + const char * const sun_path1 = + ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + printf("accept(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = %d\n", + listen_fd, listen_inode, sun_path1, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, av[1], + (int) sizeof(addr), (int) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(connect_fd, accept_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, sun_path1, + (int) sizeof(addr), (int) *len); + + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d) = 0\n", connect_fd, connect_inode); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d) = 0\n", accept_fd, accept_inode); + + assert(unlink(av[1]) == 0); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_inode); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-y-unix.test b/tests-m32/net-y-unix.test new file mode 100755 index 00000000..aec8159f --- /dev/null +++ b/tests-m32/net-y-unix.test @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Check decoding of network syscalls in -y mode. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -y is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed + +addr="$NAME-local-stream" +run_prog "./$NAME" $addr > /dev/null + +run_strace -a20 -y -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/net-yy-inet.c b/tests-m32/net-yy-inet.c new file mode 100644 index 00000000..f76f941d --- /dev/null +++ b/tests-m32/net-yy-inet.c @@ -0,0 +1,173 @@ +/* + * This file is part of net-yy-inet strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + const struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + }; + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = sizeof(addr); + + const int listen_fd = socket(AF_INET, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + const unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + listen_fd, listen_inode); + + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_INET, sin_port=htons(0)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + listen_fd, listen_inode, (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + const unsigned int listen_port = + ntohs(((struct sockaddr_in *) listen_sa) -> sin_port); + printf("getsockname(%d, {sa_family=AF_INET" + ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ", [%u]) = 0\n", + listen_fd, listen_port, listen_port, (unsigned) *len); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_TCP, TCP_MAXSEG, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_TCP, TCP_MAXSEG" + ", [%u], [%u]) = 0\n", + listen_fd, listen_port, *optval, (unsigned) *len); + + const int connect_fd = socket(AF_INET, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + const unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + connect_fd, connect_inode); + + *len = sizeof(addr); + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + connect_fd, connect_inode, listen_port, (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + const int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + const unsigned int connect_port = + ntohs(((struct sockaddr_in *) accept_sa) -> sin_port); + printf("accept(%d, {sa_family=AF_INET" + ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ", [%u]) = %d127.0.0.1:%u]>\n", + listen_fd, listen_port, connect_port, (unsigned) *len, + accept_fd, listen_port, connect_port); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(accept_fd, accept_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d127.0.0.1:%u]>" + ", {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + accept_fd, listen_port, connect_port, connect_port, + (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d127.0.0.1:%u]>" + ", {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + connect_fd, connect_port, listen_port, listen_port, + (unsigned) *len); + + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_TCP, TCP_MAXSEG, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d127.0.0.1:%u]>" + ", SOL_TCP, TCP_MAXSEG, [%u], %u) = 0\n", + connect_fd, connect_port, listen_port, *optval, + (unsigned) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, + MSG_DONTROUTE | MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); + printf("sendto(%d127.0.0.1:%u]>, \"%s\", %u" + ", MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", + connect_fd, connect_port, listen_port, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d127.0.0.1:%u]>) = 0\n", + connect_fd, connect_port, listen_port); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_WAITALL, + NULL, NULL) == sizeof(text) - 1); + printf("recvfrom(%d127.0.0.1:%u]>, \"%s\", %u" + ", MSG_WAITALL, NULL, NULL) = %u\n", + accept_fd, listen_port, connect_port, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d127.0.0.1:%u]>) = 0\n", + accept_fd, listen_port, connect_port); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_port); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-yy-inet.test b/tests-m32/net-yy-inet.test new file mode 100755 index 00000000..2ebf91fa --- /dev/null +++ b/tests-m32/net-yy-inet.test @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Check decoding of ip:port pairs associated with socket descriptors +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_inet_diag + +run_prog "./$NAME" > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/net-yy-netlink.c b/tests-m32/net-yy-netlink.c new file mode 100644 index 00000000..64d0efca --- /dev/null +++ b/tests-m32/net-yy-netlink.c @@ -0,0 +1,84 @@ +/* + * This file is part of net-yy-netlink strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +int +main(void) +{ + unsigned magic = 1234; + struct sockaddr_nl addr = { + .nl_family = AF_NETLINK, + .nl_pid = 1234 + }; + struct sockaddr *const sa = tail_memdup(&addr, sizeof(addr)); + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = sizeof(addr); + + const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); + if (fd < 0) + perror_msg_and_skip("socket"); + const unsigned long inode = inode_of_sockfd(fd); + printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = " + "%d\n", fd, inode); + + if (bind(fd, sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_NETLINK" + ", nl_pid=%u, nl_groups=00000000}, %u) = 0\n", + fd, inode, magic, (unsigned) *len); + + if (getsockname(fd, sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_NETLINK" + ", nl_pid=%u, nl_groups=00000000}, [%u]) = 0\n", + fd, magic, magic, (unsigned) *len); + + if (close(fd)) + perror_msg_and_fail("close"); + printf("close(%d) = 0\n", fd, magic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-yy-netlink.test b/tests-m32/net-yy-netlink.test new file mode 100755 index 00000000..bff1d861 --- /dev/null +++ b/tests-m32/net-yy-netlink.test @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check decoding of protocol:portid pairs associated with socket +# descriptors +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2016 Fabien Siron +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_netlink_diag + +run_prog "./$NAME" > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/net-yy-unix.c b/tests-m32/net-yy-unix.c new file mode 100644 index 00000000..63637bdd --- /dev/null +++ b/tests-m32/net-yy-unix.c @@ -0,0 +1,229 @@ +/* + * This file is part of net-yy-unix strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int ac, const char **av) +{ + assert(ac == 2); + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + unsigned int sun_path_len = strlen(av[1]); + assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (*len > sizeof(addr)) + *len = sizeof(addr); + + int listen_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + listen_fd, listen_inode); + + (void) unlink(av[1]); + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", + listen_fd, listen_inode, av[1]); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], [%u]) = 0\n", + listen_fd, listen_inode, av[1], *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], av[1], (int) sizeof(addr), (int) *len); + + int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + unsigned long accept_inode = inode_of_sockfd(accept_fd); + printf("accept(%d, {sa_family=AF_UNIX}" + ", [%d->%d]) = %d%lu,\"%s\"]>\n", + listen_fd, listen_inode, av[1], (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, av[1]); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d%lu]>, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, + accept_inode, av[1], (int) sizeof(addr), (int) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d%lu]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, connect_inode, av[1], text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d%lu]>) = 0\n", + connect_fd, connect_inode, accept_inode); + + assert(close(accept_fd) == 0); + printf("close(%d%lu,\"%s\"]>) = 0\n", + accept_fd, accept_inode, connect_inode, av[1]); + + connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + *optval = 1; + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_SOCKET, SO_PASSCRED, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], %u) = 0\n", + connect_fd, connect_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], av[1], (int) sizeof(addr), (int) *len); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + accept_inode = inode_of_sockfd(accept_fd); + const char * const sun_path1 = + ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + printf("accept(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = %d%lu,\"%s\"]>\n", + listen_fd, listen_inode, av[1], sun_path1, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, av[1]); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d%lu,@\"%s\"]>, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, + accept_inode, sun_path1, av[1], (int) sizeof(addr), (int) *len); + + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d%lu,@\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, accept_inode, sun_path1, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, connect_inode, av[1], text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d%lu,@\"%s\"]>) = 0\n", + connect_fd, connect_inode, accept_inode, sun_path1); + + assert(close(accept_fd) == 0); + printf("close(%d%lu,\"%s\"]>) = 0\n", + accept_fd, accept_inode, connect_inode, av[1]); + + assert(unlink(av[1]) == 0); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_inode, av[1]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-yy-unix.test b/tests-m32/net-yy-unix.test new file mode 100755 index 00000000..b82761c3 --- /dev/null +++ b/tests-m32/net-yy-unix.test @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check decoding of address information (inode[->peer][,path]) +# associated with unix domain socket descriptors. +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_unix_diag + +addr="$NAME-local-stream" +run_prog "./$NAME" $addr > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/net.expected b/tests-m32/net.expected new file mode 100644 index 00000000..80dd0701 --- /dev/null +++ b/tests-m32/net.expected @@ -0,0 +1,7 @@ +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +socket\(AF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +socket\(AF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +listen\(0, 5\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, \[19\]\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\]\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 diff --git a/tests-m32/net.test b/tests-m32/net.test new file mode 100755 index 00000000..cf943ffa --- /dev/null +++ b/tests-m32/net.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check how network syscalls are traced. + +. "${srcdir=.}/init.sh" + +run_prog ./net-accept-connect net-local-stream +run_strace_merge -enetwork $args +match_grep + +exit 0 diff --git a/tests-m32/netlink_inet_diag.c b/tests-m32/netlink_inet_diag.c new file mode 100644 index 00000000..2332e203 --- /dev/null +++ b/tests-m32/netlink_inet_diag.c @@ -0,0 +1,144 @@ +/* + * This file is part of inet-yy strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +static void +send_query(const int fd, const int family, const int proto) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct inet_diag_req_v2 idr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .idr = { + .sdiag_family = family, + .sdiag_protocol = proto, + .idiag_states = -1 + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct inet_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +int main(void) +{ + struct sockaddr_in addr; + socklen_t len = sizeof(addr); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + close(0); + close(1); + + if (socket(AF_INET, SOCK_STREAM, 0)) + perror_msg_and_skip("socket AF_INET"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1, AF_INET, IPPROTO_TCP); + check_responses(1); + return 0; +} diff --git a/tests-m32/netlink_netlink_diag.c b/tests-m32/netlink_netlink_diag.c new file mode 100644 index 00000000..fc32822b --- /dev/null +++ b/tests-m32/netlink_netlink_diag.c @@ -0,0 +1,147 @@ +/* + * This file is part of net-yy-netlink strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +static void +send_query(const int fd) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct netlink_diag_req ndr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .ndr = { + .sdiag_family = AF_NETLINK, + .sdiag_protocol = NDIAG_PROTO_ALL, + .ndiag_show = NDIAG_SHOW_MEMINFO + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct netlink_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +int main(void) +{ + struct sockaddr_nl addr; + socklen_t len = sizeof(addr); + + memset(&addr, 0, sizeof(addr)); + addr.nl_family = AF_NETLINK; + + close(0); + close(1); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) + perror_msg_and_skip("socket AF_NETLINK"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1); + check_responses(1); + return 0; +} diff --git a/tests-m32/netlink_protocol.c b/tests-m32/netlink_protocol.c new file mode 100644 index 00000000..34e114be --- /dev/null +++ b/tests-m32/netlink_protocol.c @@ -0,0 +1,240 @@ +/* + * Check decoding of netlink protocol. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +# endif + +static void +send_query(const int fd) +{ + static const struct req { + struct nlmsghdr nlh; + const char magic[4]; + } c_req = { + .nlh = { + .nlmsg_len = sizeof(struct req), + .nlmsg_type = NLMSG_NOOP, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .magic = "abcd" + }; + struct req *const req = tail_memdup(&c_req, sizeof(c_req)); + long rc; + const char *errstr; + + /* zero address */ + rc = sendto(fd, NULL, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, NULL, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, (unsigned) sizeof(*req), sprintrc(rc)); + + /* zero length */ + rc = sendto(fd, req, 0, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, \"\", 0, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, sprintrc(rc)); + + /* zero address and length */ + rc = sendto(fd, NULL, 0, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, NULL, 0, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, sprintrc(rc)); + + /* unfetchable struct nlmsghdr */ + const void *const efault = tail_alloc(sizeof(struct nlmsghdr) - 1); + rc = sendto(fd, efault, sizeof(struct nlmsghdr), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, %p, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, efault, (unsigned) sizeof(struct nlmsghdr), sprintrc(rc)); + + /* whole message length < sizeof(struct nlmsghdr) */ + rc = sendto(fd, req->magic, sizeof(req->magic), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, \"abcd\", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, (unsigned) sizeof(req->magic), sprintrc(rc)); + + /* a single message with some data */ + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* a single message without data */ + req->nlh.nlmsg_len = sizeof(req->nlh); + rc = sendto(fd, &req->nlh, sizeof(req->nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(req->nlh), sprintrc(rc)); + + /* nlmsg_len > whole message length */ + req->nlh.nlmsg_len = sizeof(*req) + 8; + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* nlmsg_len < sizeof(struct nlmsghdr) */ + req->nlh.nlmsg_len = 8; + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* a sequence of two nlmsg objects */ + struct reqs { + struct req req1; + char padding[NLMSG_ALIGN(sizeof(struct req)) - sizeof(struct req)]; + struct req req2; + } *const reqs = tail_alloc(sizeof(*reqs)); + memcpy(&reqs->req1, &c_req, sizeof(c_req)); + memcpy(&reqs->req2, &c_req, sizeof(c_req)); + + rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}, \"abcd\"}]" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*reqs), sprintrc(rc)); + + /* unfetchable second struct nlmsghdr */ + void *const efault2 = tail_memdup(&reqs->req1, sizeof(reqs->req1)); + rc = sendto(fd, efault2, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %p], %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + &((struct reqs *) efault2)->req2, (unsigned) sizeof(*reqs), + sprintrc(rc)); + + /* message length is not enough for the second struct nlmsghdr */ + rc = sendto(fd, reqs, sizeof(*reqs) - sizeof(req->nlh), MSG_DONTWAIT, + NULL, 0); + errstr = sprintrc(rc); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, \"", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP); + print_quoted_memory((void *) &reqs->req2.nlh, + sizeof(reqs->req2) - sizeof(req->nlh)); + printf("\"], %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (unsigned) (sizeof(*reqs) - sizeof(req->nlh)), errstr); + + /* second nlmsg_len < sizeof(struct nlmsghdr) */ + reqs->req2.nlh.nlmsg_len = 4; + rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}}], %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*reqs), sprintrc(rc)); + + /* abbreviated output */ +# define DEFAULT_STRLEN 32 +# define ABBREV_LEN (DEFAULT_STRLEN + 1) + const unsigned int msg_len = sizeof(struct nlmsghdr) * ABBREV_LEN; + struct nlmsghdr *const msgs = tail_alloc(msg_len); + unsigned int i; + for (i = 0; i < ABBREV_LEN; ++i) { + msgs[i].nlmsg_len = sizeof(*msgs); + msgs[i].nlmsg_type = NLMSG_NOOP; + msgs[i].nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + msgs[i].nlmsg_seq = i; + msgs[i].nlmsg_pid = 0; + } + + rc = sendto(fd, msgs, msg_len, MSG_DONTWAIT, NULL, 0); + errstr = sprintrc(rc); + printf("sendto(%d, [", fd); + for (i = 0; i < DEFAULT_STRLEN; ++i) { + if (i) + printf(", "); + printf("{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=0}}", + msgs[i].nlmsg_len, NLM_F_DUMP, msgs[i].nlmsg_seq); + } + printf(", ...], %u, MSG_DONTWAIT, NULL, 0) = %s\n", msg_len, errstr); +} + +int main(void) +{ + struct sockaddr_nl addr; + socklen_t len = sizeof(addr); + int fd; + + memset(&addr, 0, sizeof(addr)); + addr.nl_family = AF_NETLINK; + + if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) == -1) + perror_msg_and_skip("socket AF_NETLINK"); + + printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = %d\n", + fd); + if (bind(fd, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}" + ", %u) = 0\n", fd, len); + + char *path; + if (asprintf(&path, "/proc/self/fd/%u", fd) < 0) + perror_msg_and_fail("asprintf"); + char buf[256]; + if (getxattr(path, "system.sockprotoname", buf, sizeof(buf) - 1) < 0) + perror_msg_and_skip("getxattr"); + free(path); + + send_query(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests-m32/netlink_protocol.test b/tests-m32/netlink_protocol.test new file mode 100755 index 00000000..ab2bb1e8 --- /dev/null +++ b/tests-m32/netlink_protocol.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding of netlink protocol. + +. "${srcdir=.}/init.sh" + +# getfdproto is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +run_strace_match_diff -e trace=network diff --git a/tests-m32/netlink_unix_diag.c b/tests-m32/netlink_unix_diag.c new file mode 100644 index 00000000..269adc6f --- /dev/null +++ b/tests-m32/netlink_unix_diag.c @@ -0,0 +1,156 @@ +/* + * This file is part of net-yy-unix strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +static void +send_query(const int fd) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct unix_diag_req udr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP + }, + .udr = { + .sdiag_family = AF_UNIX, + .udiag_states = -1, + .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct unix_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +#define SUN_PATH "netlink_unix_diag_socket" +int main(void) +{ + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = SUN_PATH + }; + socklen_t len = offsetof(struct sockaddr_un, sun_path) + sizeof(SUN_PATH); + + close(0); + close(1); + + (void) unlink(SUN_PATH); + if (socket(AF_UNIX, SOCK_STREAM, 0)) + perror_msg_and_skip("socket AF_UNIX"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + + assert(unlink(SUN_PATH) == 0); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1); + check_responses(1); + return 0; +} diff --git a/tests-m32/newfstatat.c b/tests-m32/newfstatat.c new file mode 100644 index 00000000..b501d880 --- /dev/null +++ b/tests-m32/newfstatat.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_newfstatat + +# define TEST_SYSCALL_NR __NR_newfstatat +# define TEST_SYSCALL_STR "newfstatat" +# include "fstatat.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_newfstatat") + +#endif diff --git a/tests-m32/newfstatat.test b/tests-m32/newfstatat.test new file mode 100755 index 00000000..6d83ec08 --- /dev/null +++ b/tests-m32/newfstatat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check newfstatat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/nsyscalls.c b/tests-m32/nsyscalls.c new file mode 100644 index 00000000..aecf7aa7 --- /dev/null +++ b/tests-m32/nsyscalls.c @@ -0,0 +1,108 @@ +/* + * Check decoding of out-of-range syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "sysent.h" +#include +#include +#include +#include + +#define TD 0 +#define TF 0 +#define TI 0 +#define TN 0 +#define TP 0 +#define TS 0 +#define TM 0 +#define NF 0 +#define MA 0 +#define SI 0 +#define SE 0 +#define CST 0 +#define SEN(arg) 0,0 + +static const struct_sysent syscallent[] = { +#include "syscallent.h" +}; + +#if defined __X32_SYSCALL_BIT && defined __NR_read \ + && (__X32_SYSCALL_BIT & __NR_read) != 0 +# define SYSCALL_BIT __X32_SYSCALL_BIT +#else +# define SYSCALL_BIT 0 +#endif + +static void +test_syscall(const unsigned long nr) +{ + static const kernel_ulong_t a[] = { + (kernel_ulong_t) 0xface0fedbadc0dedULL, + (kernel_ulong_t) 0xface1fedbadc1dedULL, + (kernel_ulong_t) 0xface2fedbadc2dedULL, + (kernel_ulong_t) 0xface3fedbadc3dedULL, + (kernel_ulong_t) 0xface4fedbadc4dedULL, + (kernel_ulong_t) 0xface5fedbadc5dedULL + }; + + long rc = syscall(nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5]); +#ifdef LINUX_MIPSO32 + printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" + " = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5], rc); +#else + printf("syscall_%lu(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" + " = %ld (errno %d)\n", nr, + (unsigned long long) a[0], + (unsigned long long) a[1], + (unsigned long long) a[2], + (unsigned long long) a[3], + (unsigned long long) a[4], + (unsigned long long) a[5], + rc, errno); +#endif +} + +int +main(void) +{ + test_syscall(ARRAY_SIZE(syscallent)); + +#ifdef SYS_socket_subcall + test_syscall(SYS_socket_subcall + 1); +#endif + +#ifdef SYS_ipc_subcall + test_syscall(SYS_ipc_subcall + 1); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nsyscalls.test b/tests-m32/nsyscalls.test new file mode 100755 index 00000000..61f72d52 --- /dev/null +++ b/tests-m32/nsyscalls.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of out-of-range syscalls. + +. "${srcdir=.}/init.sh" + +if [ "$MIPS_ABI" = "o32" ]; then + syscall=syscall +else + syscall=none +fi + +run_strace_match_diff -e trace=$syscall diff --git a/tests-m32/old_mmap.c b/tests-m32/old_mmap.c new file mode 100644 index 00000000..2725fb75 --- /dev/null +++ b/tests-m32/old_mmap.c @@ -0,0 +1,101 @@ +/* + * Check decoding of "old mmap" edition of mmap syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +/* + * On s390x and m68k, this is the mmap syscall used by glibc, so, + * from one side, it's already covered by another test, and, from another side, + * it would require additional efforts to filter out mmap calls made by glibc. + */ + +#if defined __NR_mmap && \ +( defined __arm__ \ + || defined __i386__ \ + || (defined __s390__ && !defined __s390x__) \ +) + +# include +# include +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_mmap, 0); + printf("mmap(NULL) = %ld %s (%m)\n", rc, errno2name()); + + const unsigned int args1_c[6] = { + 0xdeadbeef, /* addr */ + 0xfacefeed, /* len */ + PROT_READ|PROT_EXEC, /* prot */ + MAP_FILE|MAP_FIXED, /* flags */ + -2U, /* fd */ + 0xbadc0ded /* offset */ + }; + const unsigned int page_size = get_page_size(); + const unsigned int args2_c[6] = { + 0, + page_size, + PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1U, + 0xfaced000 & -page_size + }; + void *args = tail_memdup(args1_c, sizeof(args1_c)); + + rc = syscall(__NR_mmap, args); + printf("mmap(%#x, %u, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" + ", %d, %#x) = %ld %s (%m)\n", + args1_c[0], args1_c[1], args1_c[4], args1_c[5], + rc, errno2name()); + + memcpy(args, args2_c, sizeof(args2_c)); + rc = syscall(__NR_mmap, args); + printf("mmap(NULL, %u, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" + ", %d, %#x) = %#lx\n", + args2_c[1], args2_c[4], args2_c[5], rc); + + void *addr = (void *) rc; + if (mprotect(addr, page_size, PROT_NONE)) + perror_msg_and_fail("mprotect(%p, %u, PROT_NONE)", + addr, page_size); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__" + " || (__s390__ && !__s390x__))") + +#endif diff --git a/tests-m32/old_mmap.test b/tests-m32/old_mmap.test new file mode 100755 index 00000000..af776ff7 --- /dev/null +++ b/tests-m32/old_mmap.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of "old mmap" edition of mmap syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap diff --git a/tests-m32/oldfstat.c b/tests-m32/oldfstat.c new file mode 100644 index 00000000..f5a94416 --- /dev/null +++ b/tests-m32/oldfstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldfstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldfstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldfstat +# define TEST_SYSCALL_STR "oldfstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldfstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests-m32/oldfstat.test b/tests-m32/oldfstat.test new file mode 100755 index 00000000..66a10561 --- /dev/null +++ b/tests-m32/oldfstat.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check oldfstat syscall decoding. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +syscall=$NAME +run_prog > /dev/null +sample=$syscall.sample +> "$sample" +run_strace -ve$syscall -P$sample -a21 $args > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/oldlstat.c b/tests-m32/oldlstat.c new file mode 100644 index 00000000..66132370 --- /dev/null +++ b/tests-m32/oldlstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldlstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldlstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldlstat +# define TEST_SYSCALL_STR "oldlstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldlstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests-m32/oldlstat.test b/tests-m32/oldlstat.test new file mode 100755 index 00000000..a0f9ab93 --- /dev/null +++ b/tests-m32/oldlstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check oldlstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/oldselect.c b/tests-m32/oldselect.c new file mode 100644 index 00000000..7413fc33 --- /dev/null +++ b/tests-m32/oldselect.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_select && defined __NR__newselect \ + && __NR_select != __NR__newselect \ + && !defined SPARC + +# include +# include + +int +main(void) +{ + int fds[2]; + fd_set r = {}, w = {}; + struct timeval timeout = { .tv_sec = 0, .tv_usec = 42 }; + long args[] = { + 2, (long) &r, (long) &w, 0, (long) &timeout, + 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded, 0xdeadbeef + }; + + (void) close(0); + (void) close(1); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + FD_SET(0, &w); + FD_SET(1, &r); + if (syscall(__NR_select, args)) + perror_msg_and_skip("select"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect") + +#endif diff --git a/tests-m32/oldselect.expected b/tests-m32/oldselect.expected new file mode 100644 index 00000000..d6e7f3c4 --- /dev/null +++ b/tests-m32/oldselect.expected @@ -0,0 +1,2 @@ +select(2, [1], [0], NULL, {tv_sec=0, tv_usec=42}) = 0 (Timeout) ++++ exited with 0 +++ diff --git a/tests-m32/oldselect.test b/tests-m32/oldselect.test new file mode 100755 index 00000000..35661ad4 --- /dev/null +++ b/tests-m32/oldselect.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check old select syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a34 -eselect $args +match_diff + +exit 0 diff --git a/tests-m32/oldstat.c b/tests-m32/oldstat.c new file mode 100644 index 00000000..d06e2bc6 --- /dev/null +++ b/tests-m32/oldstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldstat +# define TEST_SYSCALL_STR "oldstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 131478418U) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests-m32/oldstat.test b/tests-m32/oldstat.test new file mode 100755 index 00000000..42d70f7f --- /dev/null +++ b/tests-m32/oldstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check oldstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/open.c b/tests-m32/open.c new file mode 100644 index 00000000..01e89b0f --- /dev/null +++ b/tests-m32/open.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_open + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "open.sample"; + + long fd = syscall(__NR_open, sample, O_RDONLY|O_CREAT, 0400); + printf("open(\"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", + sample, sprintrc(fd)); + + if (fd != -1) { + close(fd); + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + fd = syscall(__NR_open, sample, O_RDONLY); + printf("open(\"%s\", O_RDONLY) = %s\n", sample, sprintrc(fd)); + + fd = syscall(__NR_open, sample, O_WRONLY|O_NONBLOCK|0x80000000); + printf("open(\"%s\", O_WRONLY|O_NONBLOCK|0x80000000) = %s\n", + sample, sprintrc(fd)); + } + +#ifdef O_TMPFILE +# if O_TMPFILE == (O_TMPFILE & ~O_DIRECTORY) +# define STR_O_TMPFILE "O_TMPFILE" +# else +# define STR_O_TMPFILE "O_DIRECTORY|O_TMPFILE" +# endif + fd = syscall(__NR_open, sample, O_WRONLY|O_TMPFILE, 0600); + printf("open(\"%s\", O_WRONLY|%s, 0600) = %s\n", + sample, STR_O_TMPFILE, sprintrc(fd)); +#endif /* O_TMPFILE */ + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_open") + +#endif diff --git a/tests-m32/open.test b/tests-m32/open.test new file mode 100755 index 00000000..6df19cb8 --- /dev/null +++ b/tests-m32/open.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check open syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests-m32/openat.c b/tests-m32/openat.c new file mode 100644 index 00000000..1d6765cf --- /dev/null +++ b/tests-m32/openat.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016 Katerina Koukiou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_openat + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "openat.sample"; + + long fd = syscall(__NR_openat, -100, sample, O_RDONLY|O_CREAT, 0400); + printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", + sample, sprintrc(fd)); + + if (fd != -1) { + close(fd); + if (unlink(sample) == -1) + perror_msg_and_fail("unlink"); + + fd = syscall(__NR_openat, -100, sample, O_RDONLY); + printf("openat(AT_FDCWD, \"%s\", O_RDONLY) = %s\n", + sample, sprintrc(fd)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_openat") + +#endif diff --git a/tests-m32/openat.test b/tests-m32/openat.test new file mode 100755 index 00000000..68c4cee1 --- /dev/null +++ b/tests-m32/openat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check openat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -P $NAME.sample diff --git a/tests-m32/opipe.test b/tests-m32/opipe.test new file mode 100755 index 00000000..90e6838a --- /dev/null +++ b/tests-m32/opipe.test @@ -0,0 +1,16 @@ +#!/bin/sh + +# Check how -o '|pipe' works. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog grep chdir $srcdir/umovestr.expected > "$EXP" +run_prog ./umovestr + +> "$LOG" || fail_ "failed to write $LOG" +$STRACE -o "|cat > $LOG && $SLEEP_A_BIT && grep chdir < $LOG > $OUT" -e chdir $args || + dump_log_and_fail_with "$STRACE $args failed" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/options-syntax.test b/tests-m32/options-syntax.test new file mode 100755 index 00000000..592b0e03 --- /dev/null +++ b/tests-m32/options-syntax.test @@ -0,0 +1,148 @@ +#!/bin/sh +# +# Check strace options syntax. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_exit_status_and_stderr() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_diff "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +strace_exp="${STRACE##* }" + +check_e() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$strace_exp: $pattern +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_h() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$strace_exp: $pattern +Try '$strace_exp -h' for more information. +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_e "Invalid process id: '0'" -p 0 +check_e "Invalid process id: '-42'" -p -42 +check_e "Invalid process id: '$$.'" -p $$. +check_e "Invalid process id: 'a'" -p 1,a +check_e "Syscall 'chdir' for -b isn't supported" -b chdir +check_e "Syscall 'chdir' for -b isn't supported" -b execve -b chdir + +check_e "invalid system call '-1'" -e-1 +check_e "invalid system call '-2'" -e -2 +check_e "invalid system call '-3'" -etrace=-3 +check_e "invalid system call '-4'" -e trace=-4 +check_e "invalid system call '-5'" -e trace=1,-5 +check_e "invalid system call '2147483647'" -e 2147483647 +check_e "invalid system call '2147483648'" -e 2147483648 +check_e "invalid system call '4294967295'" -e 4294967295 +check_e "invalid system call '4294967296'" -e 4294967296 + +check_e "invalid descriptor '-1'" -eread=-1 +check_e "invalid descriptor '-42'" -ewrite=-42 +check_e "invalid descriptor '2147483648'" -eread=2147483648 +check_e "invalid descriptor '4294967296'" -ewrite=4294967296 +check_e "invalid descriptor 'foo'" -eread=foo +check_e "invalid descriptor ''" -ewrite= +check_e "invalid descriptor ','" -eread=, +check_e "invalid descriptor '!'" -ewrite='!' +check_e "invalid descriptor '!'" -eread='0,!' +check_e "invalid descriptor '!,'" -ewrite='!,' + +check_h 'must have PROG [ARGS] or -p PID' +check_h 'PROG [ARGS] must be specified with -D' -D -p $$ +check_h '-c and -C are mutually exclusive' -c -C true +check_h '-c and -C are mutually exclusive' -C -c true +check_h '(-c or -C) and -ff are mutually exclusive' -c -ff true +check_h '(-c or -C) and -ff are mutually exclusive' -C -ff true +check_h '-w must be given with (-c or -C)' -w true +check_h 'piping the output and -ff are mutually exclusive' -o '|' -ff true +check_h 'piping the output and -ff are mutually exclusive' -o '!' -ff true +check_h "invalid -a argument: '-42'" -a -42 +check_h "invalid -O argument: '-42'" -O -42 +check_h "invalid -s argument: '-42'" -s -42 +check_h "invalid -I argument: '5'" -I 5 + +if [ -n "${UID-}" ]; then + if [ "${UID-}" = 0 ]; then + umsg="Cannot find user ':nosuchuser:'" + else + umsg='You must be root to use the -u option' + fi + + check_e "$umsg" -u :nosuchuser: true + + for c in i r t T y; do + check_e "-$c has no effect with -c +$strace_exp: $umsg" -u :nosuchuser: -c -$c true + done + check_e "-i has no effect with -c +$strace_exp: -r has no effect with -c +$strace_exp: -t has no effect with -c +$strace_exp: -T has no effect with -c +$strace_exp: -y has no effect with -c +$strace_exp: $umsg" -u :nosuchuser: -cirtTy true + + check_e "-tt has no effect with -r +$strace_exp: $umsg" -u :nosuchuser: -r -tt true +fi + +args='-p 2147483647' +$STRACE $args 2> "$LOG" && + dump_log_and_fail_with \ + "strace $args failed to handle the error properly" + +for cmd in PTRACE_SEIZE PTRACE_ATTACH; do + cat > "$EXP" << __EOF__ +$strace_exp: attach: ptrace($cmd, 2147483647): No such process +__EOF__ + diff -- "$EXP" "$LOG" || + continue + args= + break +done + +[ -z "$args" ] || + dump_log_and_fail_with \ + "strace $args failed to print expected diagnostics" + +rm -f "$EXP" diff --git a/tests-m32/overflowuid.c b/tests-m32/overflowuid.c new file mode 100644 index 00000000..a3c742b4 --- /dev/null +++ b/tests-m32/overflowuid.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +read_int_from_file(const char *const fname, int *const pvalue) +{ + const int fd = open(fname, O_RDONLY); + if (fd < 0) + return -1; + + long lval; + char buf[sizeof(lval) * 3]; + int n = read(fd, buf, sizeof(buf) - 1); + int saved_errno = errno; + close(fd); + + if (n < 0) { + errno = saved_errno; + return -1; + } + + buf[n] = '\0'; + char *endptr = 0; + errno = 0; + lval = strtol(buf, &endptr, 10); + if (!endptr || (*endptr && '\n' != *endptr) +#if INT_MAX < LONG_MAX + || lval > INT_MAX || lval < INT_MIN +#endif + || ERANGE == errno) { + if (!errno) + errno = EINVAL; + return -1; + } + + *pvalue = (int) lval; + return 0; +} + +static void +check_overflow_id(const int id, const char *overflowid) +{ + int n; + + if (read_int_from_file(overflowid, &n)) { + if (ENOENT == errno) + return; + perror_msg_and_fail("read_int_from_file: %s", overflowid); + } + + if (id == n) + error_msg_and_skip("%d matches %s", id, overflowid); +} + +void +check_overflowuid(const int uid) +{ + check_overflow_id(uid, "/proc/sys/kernel/overflowuid"); +} + +void +check_overflowgid(const int gid) +{ + check_overflow_id(gid, "/proc/sys/kernel/overflowgid"); +} diff --git a/tests-m32/pause.c b/tests-m32/pause.c new file mode 100644 index 00000000..86873620 --- /dev/null +++ b/tests-m32/pause.c @@ -0,0 +1,79 @@ +/* + * Check decoding of pause syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Fei Jie + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pause + +# include +# include +# include +# include +# include + +static void +handler(int sig) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct itimerval itv = { .it_value.tv_usec = 123456 }; + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_fail("setitimer"); + + syscall(__NR_pause); + if (errno == ENOSYS) + printf("pause() = -1 ENOSYS (%m)\n"); + else + printf("pause() = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pause") + +#endif diff --git a/tests-m32/pause.test b/tests-m32/pause.test new file mode 100755 index 00000000..c5fdacde --- /dev/null +++ b/tests-m32/pause.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pause syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 -esignal=none diff --git a/tests-m32/pc.c b/tests-m32/pc.c new file mode 100644 index 00000000..f53acd45 --- /dev/null +++ b/tests-m32/pc.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + const unsigned long pagesize = get_page_size(); + +#ifdef __s390__ + /* + * The si_addr field is unreliable: + * https://marc.info/?l=linux-s390&m=142515870124248&w=2 + */ + error_msg_and_skip("s390: si_addr is unreliable"); +#endif + + /* write instruction pointer length to the log */ + assert(write(-1, NULL, 2 * sizeof(void *)) < 0); + + /* just a noticeable line in the log */ + assert(munmap(&main, 0) < 0); + + int pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + const unsigned long mask = ~(pagesize - 1); + unsigned long addr = (unsigned long) &main & mask; + unsigned long size = pagesize << 1; + +#ifdef HAVE_DLADDR + Dl_info info; + if (dladdr(&main, &info)) { + const unsigned long base = + (unsigned long) info.dli_fbase & mask; + if (base < addr) { + size += addr - base; + addr = base; + } + } else +#endif + { + addr -= size; + size <<= 1; + } + + /* SIGSEGV is expected */ + (void) munmap((void *) addr, size); + (void) munmap((void *) addr, size); + error_msg_and_skip("SIGSEGV did not happen"); + } + + int status; + assert(wait(&status) == pid); + assert(WIFSIGNALED(status)); + assert(WTERMSIG(status) == SIGSEGV); + + /* dump process map for debug purposes */ + close(0); + if (!open("/proc/self/maps", O_RDONLY)) + (void) sendfile(1, 0, NULL, pagesize); + + return 0; +} diff --git a/tests-m32/pc.test b/tests-m32/pc.test new file mode 100755 index 00000000..beadb7d7 --- /dev/null +++ b/tests-m32/pc.test @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Check -i option. +# +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_prog sed + +run_prog > /dev/null + +args="-if $args" +$STRACE $args 2> "$LOG" || + dump_log_and_fail_with "$STRACE $args failed" + +len="$(sed -r -n 's/^\[[[:xdigit:]]+\] write\(-1, NULL, ([[:digit:]]{1,2})\)[[:space:]]+= -1 .*/\1/p' "$LOG")" && +[ -n "$len" ] && +pid="$(sed -r -n 's/^\[[[:xdigit:]]{'"$len"'}\] --- SIGCHLD \{si_signo=SIGCHLD, si_code=CLD_(KILLED|DUMPED), si_pid=([[:digit:]]+), .*/\2/p' "$LOG")" && +[ -n "$pid" ] && +ip="$(sed -r -n 's/^\[pid +'"$pid"'\] \[([[:xdigit:]]{'"$len"'})] --- SIGSEGV \{.*\} ---$/\1/p' "$LOG")" && +[ -n "$ip" ] && +addr="$(echo "$ip" |sed -r 's/^0+//')" && +[ -n "$addr" ] || + dump_log_and_fail_with + +EXPECTED="$LOG.expected" +cat > "$EXPECTED" << __EOF__ +\\[[[:xdigit:]]{$len}\\] munmap\\(0x[[:xdigit:]]+, 0\\) += -1 .* +\\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr\\} --- +\\[pid +$pid\\] \\[\\?{$len}\\] \\+\\+\\+ killed by SIGSEGV( \\(core dumped\\))? \\+\\+\\+ +\\[\\?{$len}\\] \\+\\+\\+ exited with 0 \\+\\+\\+ +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" + +exit 0 diff --git a/tests-m32/perf_event_open.c b/tests-m32/perf_event_open.c new file mode 100644 index 00000000..0ffea292 --- /dev/null +++ b/tests-m32/perf_event_open.c @@ -0,0 +1,821 @@ +/* + * Check verbose decoding of perf_event_open syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined(__NR_perf_event_open) && defined(HAVE_LINUX_PERF_EVENT_H) + +# include +# include +# include +# include +# include +# include +# include +# include + +# include + +# include "xlat.h" +# include "xlat/perf_event_open_flags.h" +# include "xlat/perf_attr_size.h" + +# if ULONG_MAX > UINT_MAX /* Poor man's "whether long is 8 bytes?" */ +# define LONG_STR_PREFIX "ffffffff" +# else /* !(ULONG_MAX > UINT_MAX) */ +# define LONG_STR_PREFIX "" +# endif /* ULONG_MAX > UINT_MAX */ + +# ifndef PERF_TYPE_BREAKPOINT +# define PERF_TYPE_BREAKPOINT 5 +# endif + +struct s32_val_str { + int32_t val; + const char *str; +}; + +struct u32_val_str { + uint32_t val; + const char *str; +}; + +struct u64_val_str { + uint64_t val; + const char *str; +}; + +/* In order to avoid endianess-specific hackery */ +struct pea_flags { + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + __reserved_1 :36; +}; + +static const char * +printaddr(void *ptr) +{ + static char buf[sizeof("0x") + sizeof(void *) * 2]; + + if (ptr == NULL) + return "NULL"; + + snprintf(buf, sizeof(buf), "%#lx", (unsigned long)ptr); + + return buf; +} + +/* + * Checklist: + * + * type - 8 IDs + * config - 13 IDs (0..11 + random), depends on type + * sample type - bitmask, up to 20 bits + * read_format - 5 IDs + * bp_type - 6, weird semantics (invalid/unknown) + * branch_sample_type - bitmask, 16 bits + * clockid - 13 values + * + * Unions: + * sample_period/sample_freq + * wakeup_event/wakeup_watermark + * bp_addr/config1 + * bp_len/config2 + */ + +/* + * The main idea behind all those numerous ifdefs is checking against version of + * structure provided in kernel headers and not use one defined in strace + * headers (assume the case when suddenly we add flag without proper update of + * __reserved_1 field or something like this). + */ +static void +print_event_attr(struct perf_event_attr *attr_ptr, size_t size, + const char *type, const char *config, const char *sample_type, + const char *read_format, const char *precise_ip_desc, + const char *bp_type, const char *branch_sample_type, + const char *clockid, uint32_t available_size) +{ + /* + * Currently, strace supports version 5 of the structure, which is + * 112 bytes in size. + */ + enum { + STRACE_PEA_ABBREV_SIZE = + offsetof(struct perf_event_attr, config) + + sizeof(attr_ptr->config), + STRACE_PEA_SIZE = 112, + }; + + uint32_t read_size; + struct perf_event_attr *attr; +# if VERBOSE + uint32_t cutoff; + uint64_t val; + uint64_t use_clockid; + union { + struct pea_flags flags; + uint64_t raw; + } flags_data; +# endif + + read_size = +# if !VERBOSE + STRACE_PEA_ABBREV_SIZE; +# else + size < STRACE_PEA_SIZE ? + (size ? size : PERF_ATTR_SIZE_VER0) : STRACE_PEA_SIZE; +# endif + + if (read_size > available_size) { + printf("%s", printaddr(attr_ptr)); + return; + } + + /* + * Replicate kernel's behaviour regarding copying structure from + * userspace. + */ + attr = calloc(1, STRACE_PEA_SIZE); + + if (!attr) + error_msg_and_fail("calloc"); + + + memcpy(attr, attr_ptr, read_size); + + if (size && (size < PERF_ATTR_SIZE_VER0)) { + printf("%s", printaddr(attr_ptr)); + free(attr); + return; + } + + printf("{type=%s, size=", type); + if (size != attr->size) { + printxval(perf_attr_size, size, "PERF_ATTR_SIZE_???"); + printf(" => "); + } + printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???"); + printf(", config=%s, ", config); + + if (!size) + size = PERF_ATTR_SIZE_VER0; + +# if !VERBOSE + printf("...}"); +# else /* !VERBOSE */ + printf("%s=%" PRI__u64", sample_type=%s, read_format=%s", + attr->freq ? "sample_freq" : "sample_period", + attr->freq ? attr->sample_freq : attr->sample_period, + sample_type, read_format); + + printf(", disabled=%u" + ", inherit=%u" + ", pinned=%u" + ", exclusive=%u" + ", exclusive_user=%u" + ", exclude_kernel=%u" + ", exclude_hv=%u" + ", exclude_idle=%u" + ", mmap=%u" + ", comm=%u" + ", freq=%u" + ", inherit_stat=%u" + ", enable_on_exec=%u" + ", task=%u" + ", watermark=%u", + attr->disabled, + attr->inherit, + attr->pinned, + attr->exclusive, + attr->exclude_user, + attr->exclude_kernel, + attr->exclude_hv, + attr->exclude_idle, + attr->mmap, + attr->comm, + attr->freq, + attr->inherit_stat, + attr->enable_on_exec, + attr->task, + attr->watermark); + + flags_data.raw = ((uint64_t *) attr)[5]; + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP + attr->precise_ip; +# else + flags_data.flags.precise_ip; +# endif + printf(", precise_ip=%" PRIu64 " /* %s */", val, precise_ip_desc); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA + attr->mmap_data; +# else + flags_data.flags.mmap_data; +# endif + printf(", mmap_data=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL + attr->sample_id_all; +# else + flags_data.flags.sample_id_all; +# endif + printf(", sample_id_all=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST + attr->exclude_host; +# else + flags_data.flags.exclude_host; +# endif + printf(", exclude_host=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST + attr->exclude_guest; +# else + flags_data.flags.exclude_guest; +# endif + printf(", exclude_guest=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL + attr->exclude_callchain_kernel; +# else + flags_data.flags.exclude_callchain_kernel; +# endif + printf(", exclude_callchain_kernel=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER + attr->exclude_callchain_user; +# else + flags_data.flags.exclude_callchain_user; +# endif + printf(", exclude_callchain_user=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 + attr->mmap2; +# else + flags_data.flags.mmap2; +# endif + printf(", mmap2=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC + attr->comm_exec; +# else + flags_data.flags.comm_exec; +# endif + printf(", comm_exec=%" PRIu64, val); + + use_clockid = val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID + attr->use_clockid; +# else + flags_data.flags.use_clockid; +# endif + printf(", use_clockid=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH + attr->context_switch; +# else + flags_data.flags.context_switch; +# endif + printf(", context_switch=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD + attr->write_backward; +# else + flags_data.flags.write_backward; +# endif + printf(", write_backward=%" PRIu64, val); + + val = flags_data.flags.__reserved_1; + if (val) + printf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", val); + + printf(", %s=%u", + attr->watermark ? "wakeup_watermark" : "wakeup_events", + attr->watermark ? attr->wakeup_watermark : attr->wakeup_events); + + if (attr->type == PERF_TYPE_BREAKPOINT) + printf(", bp_type=%s", bp_type); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 + attr->config1; +# else + ((uint64_t *) attr)[56 / sizeof(uint64_t)]; +# endif + printf(", %s=%#" PRIx64, + attr->type == PERF_TYPE_BREAKPOINT ? "bp_addr" : "config1", + val); + + /* End of version 0 of the structure */ + if (size <= 64) { + cutoff = 64; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 + attr->config2; +# else + ((uint64_t *) attr)[64 / sizeof(uint64_t)]; +# endif + if (attr->type == PERF_TYPE_BREAKPOINT) + printf(", bp_len=%" PRIu64, val); + else + printf(", config2=%#" PRIx64, val); + + /* End of version 1 of the structure */ + if (size <= 72) { + cutoff = 72; + goto end; + } + + /* + * Print branch sample type only in case PERF_SAMPLE_BRANCH_STACK + * is set in the sample_type field. + */ + if (attr->sample_type & (1 << 11)) + printf(", branch_sample_type=%s", branch_sample_type); + + /* End of version 2 of the structure */ + if (size <= 80) { + cutoff = 80; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER + attr->sample_regs_user; +# else + ((uint64_t *) attr)[80 / sizeof(uint64_t)]; +# endif + printf(", sample_regs_user=%#" PRIx64, val); + + if (size <= 88) { + cutoff = 88; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER + attr->sample_stack_user; +# else + ((uint32_t *) attr)[88 / sizeof(uint32_t)]; +# endif + /* + * Print branch sample type only in case PERF_SAMPLE_STACK_USER + * is set in the sample_type field. + */ + if (attr->sample_type & (1 << 13)) + printf(", sample_stack_user=%#" PRIx32, (uint32_t) val); + + if (size <= 92) { + cutoff = 92; + goto end; + } + + if (use_clockid) + printf(", clockid=%s", clockid); + + /* End of version 3 of the structure */ + if (size <= 96) { + cutoff = 96; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR + attr->sample_regs_intr; +# else + ((uint64_t *) attr)[96 / sizeof(uint64_t)]; +# endif + printf(", sample_regs_intr=%#" PRIx64, val); + + /* End of version 4 of the structure */ + if (size <= 104) { + cutoff =104; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK + attr->aux_watermark; +# else + ((uint32_t *) attr)[104 / sizeof(uint32_t)]; +# endif + printf(", aux_watermark=%" PRIu32, (uint32_t) val); + + if (size <= 108) { + cutoff =108; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK + attr->sample_max_stack; +# else + ((uint16_t *) attr)[108 / sizeof(uint16_t)]; +# endif + printf(", sample_max_stack=%" PRIu16, (uint16_t) val); + + if (size <= 110) { + cutoff =110; + goto end; + } + + cutoff = STRACE_PEA_SIZE; + +end: + if (size > cutoff) + printf(", ..."); + + printf("}"); +# endif /* !VERBOSE */ + + free(attr); +} + +/* These require aligned access, so no byte-grain checks possible */ +# if defined SPARC || defined SPARC64 || defined POWERPC || defined POWERPC64 +# define ATTR_REC(sz) { tail_alloc((sz + 7) & ~7), sz } +# else +# define ATTR_REC(sz) { tail_alloc(sz), sz } +# endif + +# define BRANCH_TYPE_ALL \ + "PERF_SAMPLE_BRANCH_USER|" \ + "PERF_SAMPLE_BRANCH_KERNEL|" \ + "PERF_SAMPLE_BRANCH_HV|" \ + "PERF_SAMPLE_BRANCH_ANY|" \ + "PERF_SAMPLE_BRANCH_ANY_CALL|" \ + "PERF_SAMPLE_BRANCH_ANY_RETURN|" \ + "PERF_SAMPLE_BRANCH_IND_CALL|" \ + "PERF_SAMPLE_BRANCH_ABORT_TX|" \ + "PERF_SAMPLE_BRANCH_IN_TX|" \ + "PERF_SAMPLE_BRANCH_NO_TX|" \ + "PERF_SAMPLE_BRANCH_COND|" \ + "PERF_SAMPLE_BRANCH_CALL_STACK|" \ + "PERF_SAMPLE_BRANCH_IND_JUMP|" \ + "PERF_SAMPLE_BRANCH_CALL|" \ + "PERF_SAMPLE_BRANCH_NO_FLAGS|" \ + "PERF_SAMPLE_BRANCH_NO_CYCLES" + +int +main(void) +{ + static const size_t attr_small_size = PERF_ATTR_SIZE_VER0 - 8; + static const size_t attr_v0_size = PERF_ATTR_SIZE_VER0; + static const size_t attr_v1_size = PERF_ATTR_SIZE_VER1; + static const size_t attr_v2_size = PERF_ATTR_SIZE_VER2; + static const size_t attr_v2_5_size = PERF_ATTR_SIZE_VER2 + 8; + static const size_t attr_v2_75_size = PERF_ATTR_SIZE_VER2 + 12; + static const size_t attr_v3_size = PERF_ATTR_SIZE_VER3; + static const size_t attr_v4_size = PERF_ATTR_SIZE_VER4; + static const size_t attr_v4_5_size = PERF_ATTR_SIZE_VER4 + 4; + static const size_t attr_v4_625_size = PERF_ATTR_SIZE_VER4 + 5; + static const size_t attr_v4_875_size = PERF_ATTR_SIZE_VER4 + 7; + static const size_t attr_v5_size = PERF_ATTR_SIZE_VER5; + static const size_t attr_big_size = PERF_ATTR_SIZE_VER5 + 32; + + static const struct u64_val_str attr_types[] = { + { ARG_STR(PERF_TYPE_HARDWARE) }, + { ARG_STR(PERF_TYPE_SOFTWARE) }, + { ARG_STR(PERF_TYPE_TRACEPOINT) }, + { ARG_STR(PERF_TYPE_HW_CACHE) }, + { ARG_STR(PERF_TYPE_RAW) }, + { ARG_STR(PERF_TYPE_BREAKPOINT) }, + { ARG_STR(0x6) " /* PERF_TYPE_??? */" }, + { ARG_STR(0xdeadc0de) " /* PERF_TYPE_??? */" }, + }; + static const struct u64_val_str + attr_configs[ARRAY_SIZE(attr_types)][3] = { + /* PERF_TYPE_HARDWARE */ { + { 9, "PERF_COUNT_HW_REF_CPU_CYCLES" }, + { 10, "0xa /* PERF_COUNT_HW_??? */" }, + { ARG_ULL_STR(0xfaceca75deadb0d4) + " /* PERF_COUNT_HW_??? */" }, + }, + /* PERF_TYPE_SOFTWARE */ { + { 10, "PERF_COUNT_SW_BPF_OUTPUT" }, + { 11, "0xb /* PERF_COUNT_SW_??? */" }, + { ARG_ULL_STR(0xdec0ded1dec0ded2) + " /* PERF_COUNT_SW_??? */" }, + }, + /* PERF_TYPE_TRACEPOINT */ { + { ARG_STR(0) }, + { 4207856245U, "4207856245" }, + { ARG_ULL_STR(16051074073505095380) }, + }, + /* PERF_TYPE_HW_CACHE */ { + { 0, "PERF_COUNT_HW_CACHE_L1D|" + "PERF_COUNT_HW_CACHE_OP_READ<<8|" + "PERF_COUNT_HW_CACHE_RESULT_ACCESS<<16" }, + { 0x020207, "0x7 /* PERF_COUNT_HW_CACHE_??? */|" + "PERF_COUNT_HW_CACHE_OP_PREFETCH<<8|" + "0x2 /* PERF_COUNT_HW_CACHE_RESULT_??? */<<16" }, + { 0xdeadf157ed010306ULL, "PERF_COUNT_HW_CACHE_NODE|" + "0x3 /* PERF_COUNT_HW_CACHE_OP_??? */<<8|" + "PERF_COUNT_HW_CACHE_RESULT_MISS<<16|" + "0xdeadf157ed<<24 " + "/* PERF_COUNT_HW_CACHE_??? */" }, + }, + /* PERF_TYPE_RAW */ { + { ARG_STR(0) }, + { ARG_STR(0xda7a1057) }, + { ARG_ULL_STR(0xdec0ded7dec0ded8) }, + }, + /* PERF_TYPE_BREAKPOINT */ { + { ARG_STR(0) }, + { ARG_STR(0xbadc0ded) }, + { ARG_ULL_STR(0xdec0ded9dec0deda) }, + }, + /* invalid 1 */ { + { ARG_STR(0) }, + { ARG_STR(0xbeeff00d) }, + { ARG_ULL_STR(0xdec0dedbdec0dedc) }, + }, + /* invalid 2 */ { + { ARG_STR(0) }, + { ARG_STR(0xca75dead) }, + { ARG_ULL_STR(0xdec0dedddec0dede) }, + }, + }; + static const struct u64_val_str sample_types[] = { + { ARG_STR(0) }, + { 0x800, "PERF_SAMPLE_BRANCH_STACK" }, + { ARG_ULL_STR(0xdeadc0deda780000) " /* PERF_SAMPLE_??? */" }, + { 0xffffffffffffffffULL, + "PERF_SAMPLE_IP|PERF_SAMPLE_TID|PERF_SAMPLE_TIME|" + "PERF_SAMPLE_ADDR|PERF_SAMPLE_READ|" + "PERF_SAMPLE_CALLCHAIN|PERF_SAMPLE_ID|PERF_SAMPLE_CPU|" + "PERF_SAMPLE_PERIOD|PERF_SAMPLE_STREAM_ID|" + "PERF_SAMPLE_RAW|PERF_SAMPLE_BRANCH_STACK|" + "PERF_SAMPLE_REGS_USER|PERF_SAMPLE_STACK_USER|" + "PERF_SAMPLE_WEIGHT|PERF_SAMPLE_DATA_SRC|" + "PERF_SAMPLE_IDENTIFIER|PERF_SAMPLE_TRANSACTION|" + "PERF_SAMPLE_REGS_INTR|0xfffffffffff80000" }, + }; + static const struct u64_val_str read_formats[] = { + { ARG_STR(0) }, + { ARG_STR(PERF_FORMAT_TOTAL_TIME_ENABLED) }, + { 0xf, "PERF_FORMAT_TOTAL_TIME_ENABLED|" + "PERF_FORMAT_TOTAL_TIME_RUNNING|" + "PERF_FORMAT_ID|PERF_FORMAT_GROUP" }, + { ARG_ULL_STR(0xdeadf157dec0ded0) " /* PERF_FORMAT_??? */" }, + { 0xffffffffffffffffULL, + "PERF_FORMAT_TOTAL_TIME_ENABLED|" + "PERF_FORMAT_TOTAL_TIME_RUNNING|" + "PERF_FORMAT_ID|PERF_FORMAT_GROUP|" + "0xfffffffffffffff0" }, + }; + static const char *precise_ip_descs[] = { + "arbitrary skid", + "constant skid", + "requested to have 0 skid", + "must have 0 skid", + }; + static const struct u32_val_str bp_types[] = { + { 0, "HW_BREAKPOINT_EMPTY" }, + { 1, "HW_BREAKPOINT_R" }, + { 3, "HW_BREAKPOINT_RW" }, + { 5, "0x5 /* HW_BREAKPOINT_INVALID */" }, + { 8, "0x8 /* HW_BREAKPOINT_??? */" }, + { ARG_STR(0xface1e55) " /* HW_BREAKPOINT_??? */" }, + }; + static const struct u64_val_str branch_sample_types[] = { + { ARG_STR(0) }, + { 0x80, "PERF_SAMPLE_BRANCH_ABORT_TX" }, + { 0xffff, BRANCH_TYPE_ALL }, + { ARG_ULL_STR(0xdeadcaffeeed0000) + " /* PERF_SAMPLE_BRANCH_??? */" }, + { 0xffffffffffffffffULL, + BRANCH_TYPE_ALL "|0xffffffffffff0000" } + }; + static const struct s32_val_str clockids[] = { + { 11, "CLOCK_TAI" }, + { ARG_STR(0xc) " /* CLOCK_??? */" }, + { ARG_STR(0xbeeffeed) " /* CLOCK_??? */" }, + }; + + + struct { + struct perf_event_attr *ptr; + size_t size; + } attrs[] = { + ATTR_REC(sizeof(struct perf_event_attr)), + ATTR_REC(attr_v0_size), + ATTR_REC(attr_v1_size), + ATTR_REC(attr_v2_size), + ATTR_REC(attr_v2_5_size), + ATTR_REC(attr_v2_75_size), + ATTR_REC(attr_v3_size), + ATTR_REC(attr_v4_size), + ATTR_REC(attr_v4_5_size), + ATTR_REC(attr_v4_625_size), + ATTR_REC(attr_v4_875_size), + ATTR_REC(attr_v5_size), + ATTR_REC(attr_big_size), + }; + + struct perf_event_attr *small_attr = tail_alloc(sizeof(*small_attr)); + + struct { + struct perf_event_attr *attr; + pid_t pid; + int cpu; + int group_fd; + unsigned long flags; + const char *flags_str; + } args[] = { + { NULL, 0xfacef00d, 0xbadabba7, -1, + (unsigned long) 0xFFFFFFFFFFFFFFFFLLU, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC|" + "0x" LONG_STR_PREFIX "fffffff0" + }, + { small_attr + 1, 0, 0, 0, + 0, "0" }, + { small_attr, -1, -1, 1, + PERF_FLAG_FD_NO_GROUP | PERF_FLAG_FD_OUTPUT | + PERF_FLAG_PID_CGROUP | PERF_FLAG_FD_CLOEXEC, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC" }, + { (struct perf_event_attr *) (uintptr_t) 0xfffffacefffffeedULL, + -100, 100, 0xface1e55, + PERF_FLAG_FD_CLOEXEC, "PERF_FLAG_FD_CLOEXEC" }, + }; + + size_t i; + int rc; + + fill_memory(small_attr, sizeof(*small_attr)); + small_attr->size = attr_small_size; + + for (i = 0; i < ARRAY_SIZE(args); i++) { + rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, + args[i].cpu, args[i].group_fd, args[i].flags); + printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", + printaddr(args[i].attr), args[i].pid, args[i].cpu, + args[i].group_fd, args[i].flags_str, sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(attrs) * ARRAY_SIZE(attr_types) * + ARRAY_SIZE(attr_configs[0]) + 1; i++) { + struct perf_event_attr *attr = attrs[i % ARRAY_SIZE(attrs)].ptr; + uint32_t size = attrs[i % ARRAY_SIZE(attrs)].size; + unsigned char fill_start = 0x80 + i; + size_t type_idx = i % ARRAY_SIZE(attr_types); + size_t config_idx = i % ARRAY_SIZE(attr_configs[0]); + size_t sample_type_idx = i % ARRAY_SIZE(sample_types); + size_t read_format_idx = i % ARRAY_SIZE(read_formats); + size_t bp_type_idx = (i / ARRAY_SIZE(attr_configs[0])) % + ARRAY_SIZE(bp_types); + size_t branch_sample_type_idx = (i / ARRAY_SIZE(sample_types)) % + ARRAY_SIZE(branch_sample_types); + size_t clockid_idx = i % ARRAY_SIZE(clockids); + size_t args_idx = i % ARRAY_SIZE(args); + const char *ip_desc_str; + + fill_memory_ex(attr, size, fill_start, 0xff); + + attr->type = attr_types[type_idx].val; + attr->size = size; + attr->config = attr_configs[type_idx][config_idx].val; + attr->sample_type = sample_types[sample_type_idx].val; + attr->read_format = read_formats[read_format_idx].val; + + if ((i % 11) == 5) + attr->__reserved_1 = 0; + +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_BP_TYPE + attr->bp_type = +# else + ((uint32_t *) attr)[52 / sizeof(uint32_t)] = +# endif + bp_types[bp_type_idx].val; + + if (size >= 80) +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_BRANCH_SAMPLE_TYPE + attr->branch_sample_type = +# else + ((uint64_t *) attr)[72 / sizeof(uint64_t)] = +# endif + branch_sample_types[branch_sample_type_idx].val; + + if (size >= 96) +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CLOCKID + attr->clockid = +# else + ((uint32_t *) attr)[92 / sizeof(uint32_t)] = +# endif + clockids[clockid_idx].val; + +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP + ip_desc_str = precise_ip_descs[attr->precise_ip]; +# else + union { + struct pea_flags flags; + uint64_t raw; + } flags_data = { .raw = ((uint64_t *) attr)[5] }; + + ip_desc_str = precise_ip_descs[flags_data.flags.precise_ip]; +# endif + + if (i == 0) + attr->size = size + 8; + + if (i == 1) + attr->size = 0; + + rc = syscall(__NR_perf_event_open, attr, args[args_idx].pid, + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags); + + printf("perf_event_open("); + print_event_attr(attr, i ? ((i == 1) ? 0 : size) : size + 8, + attr_types[type_idx].str, + attr_configs[type_idx][config_idx].str, + sample_types[sample_type_idx].str, + read_formats[read_format_idx].str, + ip_desc_str, + bp_types[bp_type_idx].str, + branch_sample_types[branch_sample_type_idx].str, + clockids[clockid_idx].str, size); + printf(", %d, %d, %d, %s) = %s\n", args[args_idx].pid, + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags_str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_perf_event_open && HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-m32/perf_event_open.test b/tests-m32/perf_event_open.test new file mode 100755 index 00000000..499134b4 --- /dev/null +++ b/tests-m32/perf_event_open.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check perf_event_open syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a1 diff --git a/tests-m32/perf_event_open_nonverbose.c b/tests-m32/perf_event_open_nonverbose.c new file mode 100644 index 00000000..45d7c8f2 --- /dev/null +++ b/tests-m32/perf_event_open_nonverbose.c @@ -0,0 +1,113 @@ +/* + * Check decoding of perf_event_open syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined(__NR_perf_event_open) && defined(HAVE_LINUX_PERF_EVENT_H) + +# include +# include +# include + +# include + +# include "xlat.h" +# include "xlat/perf_event_open_flags.h" + +#if ULONG_MAX > UINT_MAX +#define LONG_STR_PREFIX "ffffffff" +#else +#define LONG_STR_PREFIX "" +#endif + +static const char *printaddr(void *ptr) +{ + static char buf[sizeof("0x") + sizeof(void *) * 2]; + + if (ptr == NULL) + return "NULL"; + + snprintf(buf, sizeof(buf), "%#lx", (unsigned long)ptr); + + return buf; +} + +int +main(void) +{ + struct perf_event_attr *attr = tail_alloc(sizeof(*attr)); + + attr->type = PERF_TYPE_HARDWARE; + attr->size = sizeof(*attr); + + struct { + struct perf_event_attr *attr; + pid_t pid; + int cpu; + int group_fd; + unsigned long flags; + const char *flags_str; + } args[] = { + { NULL, 0xfacef00d, 0xbadabba7, -1, + (unsigned long) 0xFFFFFFFFFFFFFFFFLLU, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC|" + "0x" LONG_STR_PREFIX "fffffff0" + }, + { attr + 1, 0, 0, 0, + 0, "0" }, + { attr, -1, -1, 1, + PERF_FLAG_FD_CLOEXEC, "PERF_FLAG_FD_CLOEXEC" }, + { attr - 1, -100, 100, 0xface1e55, + PERF_FLAG_FD_NO_GROUP | PERF_FLAG_FD_OUTPUT | + PERF_FLAG_PID_CGROUP | PERF_FLAG_FD_CLOEXEC, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC" }, + }; + size_t i; + int rc; + + for (i = 0; i < ARRAY_SIZE(args); i++) { + rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, + args[i].cpu, args[i].group_fd, args[i].flags); + printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", + printaddr(args[i].attr), args[i].pid, args[i].cpu, + args[i].group_fd, args[i].flags_str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_perf_event_open && HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-m32/perf_event_open_nonverbose.test b/tests-m32/perf_event_open_nonverbose.test new file mode 100755 index 00000000..404827fe --- /dev/null +++ b/tests-m32/perf_event_open_nonverbose.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of perf_event_open syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests-m32/perf_event_open_unabbrev.c b/tests-m32/perf_event_open_unabbrev.c new file mode 100644 index 00000000..c2f260de --- /dev/null +++ b/tests-m32/perf_event_open_unabbrev.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "perf_event_open.c" diff --git a/tests-m32/perf_event_open_unabbrev.test b/tests-m32/perf_event_open_unabbrev.test new file mode 100755 index 00000000..f17fd17e --- /dev/null +++ b/tests-m32/perf_event_open_unabbrev.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check perf_event_open syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests-m32/personality.c b/tests-m32/personality.c new file mode 100644 index 00000000..7a279a14 --- /dev/null +++ b/tests-m32/personality.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +int main(void) +{ + const unsigned int good_type = PER_BSD; + const char *good_type_str = "PER_BSD"; + + const unsigned int bad_type = 0x1f; + const char *bad_type_str = "0x1f /\\* PER_\\?\\?\\? \\*/"; + + const unsigned int good_flags = + SHORT_INODE | WHOLE_SECONDS | STICKY_TIMEOUTS; + const char *good_flags_str = + "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS"; + + const unsigned int bad_flags = 0x10000; + const char *bad_flags_str = "0x10000"; + + const unsigned int saved_pers = personality(0xffffffff); + printf("personality\\(0xffffffff\\) = %#x \\([^)]*\\)\n", saved_pers); + + /* PER_LINUX */ + personality(PER_LINUX); + printf("personality\\(PER_LINUX\\) = %#x \\([^)]*\\)\n", saved_pers); + + personality(0xffffffff); + puts("personality\\(0xffffffff\\) = 0 \\(PER_LINUX\\)"); + + personality(good_flags); + printf("personality\\(PER_LINUX\\|%s\\) = 0 \\(PER_LINUX\\)\n", + good_flags_str); + + personality(bad_flags); + printf("personality\\(PER_LINUX\\|%s\\)" + " = %#x \\(PER_LINUX\\|%s\\)\n", + bad_flags_str, good_flags, good_flags_str); + + personality(good_flags | bad_flags); + printf("personality\\(PER_LINUX\\|%s\\|%s\\)" + " = %#x \\(PER_LINUX\\|%s\\)\n", + good_flags_str, bad_flags_str, bad_flags, bad_flags_str); + + /* another valid type */ + personality(good_type); + printf("personality\\(%s\\) = %#x \\(PER_LINUX\\|%s\\|%s\\)\n", + good_type_str, good_flags | bad_flags, + good_flags_str, bad_flags_str); + + personality(good_type | good_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", + good_type_str, good_flags_str, good_type, good_type_str); + + personality(good_type | bad_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, bad_flags_str, good_type | good_flags, + good_type_str, good_flags_str); + + personality(good_type | good_flags | bad_flags); + printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, good_flags_str, bad_flags_str, + good_type | bad_flags, + good_type_str, bad_flags_str); + + /* invalid type */ + personality(bad_type); + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\|%s\\)\n", + bad_type_str, good_type | good_flags | bad_flags, + good_type_str, good_flags_str, bad_flags_str); + + personality(bad_type | good_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", + bad_type_str, good_flags_str, bad_type, bad_type_str); + + personality(bad_type | bad_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, bad_flags_str, bad_type | good_flags, + bad_type_str, good_flags_str); + + personality(bad_type | good_flags | bad_flags); + printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, good_flags_str, bad_flags_str, + bad_type | bad_flags, bad_type_str, bad_flags_str); + + personality(saved_pers); + printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\|%s\\)\n", + bad_type | good_flags | bad_flags, + bad_type_str, good_flags_str, bad_flags_str); + + return 0; +} diff --git a/tests-m32/personality.test b/tests-m32/personality.test new file mode 100755 index 00000000..8f8c0adb --- /dev/null +++ b/tests-m32/personality.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check personality syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a20 -epersonality $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/pipe.c b/tests-m32/pipe.c new file mode 100644 index 00000000..41c7f215 --- /dev/null +++ b/tests-m32/pipe.c @@ -0,0 +1,55 @@ +/* + * Check decoding of pipe syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pipe + +# include +# include +# include + +int +main(void) +{ + (void) close(0); + (void) close(1); + int *const fds = tail_alloc(sizeof(*fds) * 2); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pipe") + +#endif diff --git a/tests-m32/pipe.expected b/tests-m32/pipe.expected new file mode 100644 index 00000000..2e46336c --- /dev/null +++ b/tests-m32/pipe.expected @@ -0,0 +1,2 @@ +pipe([0, 1]) = 0 ++++ exited with 0 +++ diff --git a/tests-m32/pipe.test b/tests-m32/pipe.test new file mode 100755 index 00000000..0ae414d4 --- /dev/null +++ b/tests-m32/pipe.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of pipe syscall. +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a13 -epipe $args + +check_prog grep +LC_ALL=C grep -x "pipe(.*" "$LOG" > /dev/null || + skip_ 'test executable does not use pipe syscall' + +match_diff diff --git a/tests-m32/pipe2.c b/tests-m32/pipe2.c new file mode 100644 index 00000000..375ae74f --- /dev/null +++ b/tests-m32/pipe2.c @@ -0,0 +1,71 @@ +/* + * Check decoding of pipe2 syscall. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pipe2 + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0xffffffff00000000ULL; + int *const fds = tail_alloc(sizeof(*fds) * 2); + int *const efault = fds + 1; + long rc; + + rc = syscall(__NR_pipe2, fds, bogus_zero | O_NONBLOCK); + if (rc) + perror_msg_and_skip("pipe2"); + printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]); + + rc = syscall(__NR_pipe2, efault, bogus_zero); + printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(fds); + rc = syscall(__NR_pipe2, ill, 0); + printf("pipe2(%#llx, 0) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pipe2") + +#endif diff --git a/tests-m32/pipe2.test b/tests-m32/pipe2.test new file mode 100755 index 00000000..aff6cd44 --- /dev/null +++ b/tests-m32/pipe2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pipe2 syscall. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a15 diff --git a/tests-m32/pipe_maxfd.c b/tests-m32/pipe_maxfd.c new file mode 100644 index 00000000..a1343f91 --- /dev/null +++ b/tests-m32/pipe_maxfd.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +static void +move_fd(int *from, int *to) +{ + for (; *to > *from; --*to) { + if (dup2(*from, *to) != *to) + continue; + close(*from); + *from = *to; + break; + } +} + +void +pipe_maxfd(int pipefd[2]) +{ + struct rlimit rlim; + if (getrlimit(RLIMIT_NOFILE, &rlim)) + perror_msg_and_fail("getrlimit"); + if (rlim.rlim_cur < rlim.rlim_max) { + struct rlimit rlim_new; + rlim_new.rlim_cur = rlim_new.rlim_max = rlim.rlim_max; + if (!setrlimit(RLIMIT_NOFILE, &rlim_new)) + rlim.rlim_cur = rlim.rlim_max; + } + + if (pipe(pipefd)) + perror_msg_and_fail("pipe"); + + int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < INT_MAX) + ? rlim.rlim_cur - 1 : INT_MAX; + + move_fd(&pipefd[1], &max_fd); + --max_fd; + move_fd(&pipefd[0], &max_fd); +} diff --git a/tests-m32/pkey_alloc.c b/tests-m32/pkey_alloc.c new file mode 100644 index 00000000..45772787 --- /dev/null +++ b/tests-m32/pkey_alloc.c @@ -0,0 +1,84 @@ +/* + * Check decoding of pkey_alloc syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_alloc + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t flags[] = { + 0, + (kernel_ulong_t) 0xbadc0ded00000000ULL, + (kernel_ulong_t) 0xffff0000eeee1111ULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + }; + static const struct { + kernel_ulong_t val; + const char *str; + } rights[] = { + { (kernel_ulong_t) 0xbadc0ded00000002ULL, + sizeof(kernel_ulong_t) > sizeof(int) ? + "PKEY_DISABLE_WRITE|0xbadc0ded00000000" : + "PKEY_DISABLE_WRITE" }, + { 0xdec0ded, "PKEY_DISABLE_ACCESS|0xdec0dec" }, + { 0x3, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE" }, + { ARG_STR(0) }, + { 0xbadc0dec, "0xbadc0dec /* PKEY_??? */" }, + }; + + long rc; + unsigned int i; + unsigned int j; + + for (i = 0; i < ARRAY_SIZE(flags); i++) { + for (j = 0; j < ARRAY_SIZE(rights); j++) { + rc = syscall(__NR_pkey_alloc, flags[i], rights[j].val); + printf("pkey_alloc(%#llx, %s) = %s\n", + (unsigned long long) flags[i], rights[j].str, + sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_alloc"); + +#endif diff --git a/tests-m32/pkey_alloc.test b/tests-m32/pkey_alloc.test new file mode 100755 index 00000000..f168c21a --- /dev/null +++ b/tests-m32/pkey_alloc.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_alloc syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/pkey_free.c b/tests-m32/pkey_free.c new file mode 100644 index 00000000..95a2ad26 --- /dev/null +++ b/tests-m32/pkey_free.c @@ -0,0 +1,67 @@ +/* + * Check decoding of pkey_free syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_free + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t keys[] = { + 0, + 3141592653U, + (kernel_ulong_t) 0xbadc0ded00000000ULL, + (kernel_ulong_t) 0xffff00001111eeeeULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + }; + + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(keys); i++) { + rc = syscall(__NR_pkey_free, keys[i]); + printf("pkey_free(%d) = %s\n", (int) keys[i], sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_free"); + +#endif diff --git a/tests-m32/pkey_free.test b/tests-m32/pkey_free.test new file mode 100755 index 00000000..9c01c3e7 --- /dev/null +++ b/tests-m32/pkey_free.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_free syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-m32/pkey_mprotect.c b/tests-m32/pkey_mprotect.c new file mode 100644 index 00000000..529abd1f --- /dev/null +++ b/tests-m32/pkey_mprotect.c @@ -0,0 +1,120 @@ +/* + * Check decoding of pkey_mprotect syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_mprotect + +# include +# include +# include + +const char * +sprintptr(kernel_ulong_t ptr) +{ + static char buf[sizeof(ptr) * 2 + sizeof("0x")]; + + if (ptr) + snprintf(buf, sizeof(buf), "%#llx", (unsigned long long) ptr); + else + return "NULL"; + + return buf; +} + +int +main(void) +{ + static const kernel_ulong_t ptrs[] = { + 0, + (kernel_ulong_t) 0xfacebeef00000000ULL, + (kernel_ulong_t) 0xbadc0dedda7a1057ULL, + }; + static const kernel_ulong_t sizes[] = { + 0, + (kernel_ulong_t) 0xfacebeef00000000ULL, + (kernel_ulong_t) 0xfedcba9876543210ULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + (kernel_ulong_t) 0xbadc0dedda7a1057ULL, + }; + static const struct { + kernel_ulong_t val; + const char *str; + } prots[] = { + { ARG_STR(PROT_READ) }, + /* For now, only 0x0300001f are used */ + { (kernel_ulong_t) 0xdeadfeed00ca7500ULL, + sizeof(kernel_ulong_t) > sizeof(int) ? + "0xdeadfeed00ca7500 /* PROT_??? */" : + "0xca7500 /* PROT_??? */" }, + { ARG_STR(PROT_READ|PROT_WRITE|0xface00) }, + }; + static const kernel_ulong_t pkeys[] = { + 0, + -1LL, + (kernel_ulong_t) 0xface1e55, + (kernel_ulong_t) 0xbadc0ded00000001, + }; + + long rc; + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + + for (i = 0; i < ARRAY_SIZE(ptrs); i++) { + for (j = 0; j < ARRAY_SIZE(sizes); j++) { + for (k = 0; k < ARRAY_SIZE(prots); k++) { + for (l = 0; l < ARRAY_SIZE(pkeys); l++) { + rc = syscall(__NR_pkey_mprotect, + ptrs[i], sizes[j], + prots[k].val, pkeys[l]); + printf("pkey_mprotect(%s, %llu, %s, %d)" + " = %s\n", + sprintptr(ptrs[i]), + (unsigned long long) sizes[j], + prots[k].str, (int) pkeys[l], + sprintrc(rc)); + } + } + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_mprotect"); + +#endif diff --git a/tests-m32/pkey_mprotect.test b/tests-m32/pkey_mprotect.test new file mode 100755 index 00000000..922d4919 --- /dev/null +++ b/tests-m32/pkey_mprotect.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_mprotect syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-m32/poll.c b/tests-m32/poll.c new file mode 100644 index 00000000..c47c97e5 --- /dev/null +++ b/tests-m32/poll.c @@ -0,0 +1,259 @@ +/* + * This file is part of poll strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_poll + +# include +# include +# include +# include +# include +# include + +#define PRINT_EVENT(flag, member) \ + if (member & flag) { \ + if (member != pfd->member) \ + tprintf("|"); \ + tprintf(#flag); \ + member &= ~flag; \ + } + +static void +print_pollfd_entering(const struct pollfd *const pfd) +{ + tprintf("{fd=%d", pfd->fd); + if (pfd->fd >= 0) { + tprintf(", events="); + short events = pfd->events; + + if (pfd->events) { + PRINT_EVENT(POLLIN, events) + PRINT_EVENT(POLLPRI, events) + PRINT_EVENT(POLLOUT, events) +#ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, events) +#endif +#ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, events) +#endif +#ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, events) +#endif +#ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, events) +#endif + PRINT_EVENT(POLLERR, events) + PRINT_EVENT(POLLHUP, events) + PRINT_EVENT(POLLNVAL, events) + } else + tprintf("0"); + } + tprintf("}"); +} + +static void +print_pollfd_array_entering(const struct pollfd *const pfd, + const unsigned int size, + const unsigned int valid, + const unsigned int abbrev) +{ + tprintf("["); + unsigned int i; + for (i = 0; i < size; ++i) { + if (i) + tprintf(", "); + if (i >= valid) { + tprintf("%p", &pfd[i]); + break; + } + if (i >= abbrev) { + tprintf("..."); + break; + } + print_pollfd_entering(&pfd[i]); + } + tprintf("]"); +} + +static void +print_pollfd_exiting(const struct pollfd *const pfd, + unsigned int *const seen, + const unsigned int abbrev) +{ + if (!pfd->revents || pfd->fd < 0 || *seen > abbrev) + return; + + if (*seen) + tprintf(", "); + ++(*seen); + + if (*seen > abbrev) { + tprintf("..."); + return; + } + tprintf("{fd=%d, revents=", pfd->fd); + short revents = pfd->revents; + + PRINT_EVENT(POLLIN, revents) + PRINT_EVENT(POLLPRI, revents) + PRINT_EVENT(POLLOUT, revents) +#ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, revents) +#endif +#ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, revents) +#endif +#ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, revents) +#endif +#ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, revents) +#endif + PRINT_EVENT(POLLERR, revents) + PRINT_EVENT(POLLHUP, revents) + PRINT_EVENT(POLLNVAL, revents) + tprintf("}"); +} + +static void +print_pollfd_array_exiting(const struct pollfd *const pfd, + const unsigned int size, + const unsigned int abbrev) +{ + tprintf("["); + unsigned int seen = 0; + unsigned int i; + for (i = 0; i < size; ++i) + print_pollfd_exiting(&pfd[i], &seen, abbrev); + tprintf("]"); +} + +int +main(int ac, char **av) +{ + tprintf("%s", ""); + + assert(syscall(__NR_poll, NULL, 42, 0) == -1); + if (ENOSYS == errno) + perror_msg_and_skip("poll"); + tprintf("poll(NULL, 42, 0) = -1 EFAULT (%m)\n"); + + int fds[2]; + if (pipe(fds) || pipe(fds)) + perror_msg_and_fail("pipe"); + + const unsigned int abbrev = (ac > 1) ? atoi(av[1]) : -1; + const struct pollfd pfds0[] = { + { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = fds[0], .events = POLLIN | POLLPRI }, + { .fd = fds[1], .events = POLLOUT }, + { .fd = 2, .events = POLLOUT | POLLWRBAND } + }; + struct pollfd *const tail_fds0 = tail_memdup(pfds0, sizeof(pfds0)); + const int timeout = 42; + int rc = syscall(__NR_poll, tail_fds0, 0, timeout); + assert(rc == 0); + + tprintf("poll([], 0, %d) = %d (Timeout)\n", timeout, rc); + + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 3); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + tail_fds0[0].fd = -1; + tail_fds0[2].fd = -3; + tail_fds0[4].events = 0; + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 2); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + tail_fds0[1].fd = -2; + tail_fds0[4].fd = -5; + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 1); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + struct pollfd pfds1[] = { + { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } + }; + struct pollfd *const tail_fds1 = tail_memdup(pfds1, sizeof(pfds1)); + rc = syscall(__NR_poll, tail_fds1, ARRAY_SIZE(pfds1), timeout); + assert(rc == 0); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds1, ARRAY_SIZE(pfds1), + ARRAY_SIZE(pfds1), abbrev); + tprintf(", %u, %d) = %d (Timeout)\n", ARRAY_SIZE(pfds1), timeout, rc); + + const void *const efault = tail_fds0 + ARRAY_SIZE(pfds0); + rc = syscall(__NR_poll, efault, 1, 0); + assert(rc == -1); + tprintf("poll(%p, 1, 0) = -1 EFAULT (%m)\n", efault); + + const unsigned int valid = 1; + const void *const epfds = tail_fds0 + ARRAY_SIZE(pfds0) - valid; + rc = syscall(__NR_poll, epfds, valid + 1, 0); + assert(rc == -1); + tprintf("poll("); + print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); + errno = EFAULT; + tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_poll") + +#endif diff --git a/tests-m32/poll.test b/tests-m32/poll.test new file mode 100755 index 00000000..b74be29e --- /dev/null +++ b/tests-m32/poll.test @@ -0,0 +1,17 @@ +#!/bin/sh + +# Check poll syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -vepoll $args > "$OUT" +match_diff "$LOG" "$OUT" + +for abbrev in 0 1 2 3 4 5; do + run_prog "./$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev $args > "$OUT" + match_diff "$LOG" "$OUT" +done + +rm -f "$OUT" diff --git a/tests-m32/ppoll-v.expected b/tests-m32/ppoll-v.expected new file mode 100644 index 00000000..31070ad1 --- /dev/null +++ b/tests-m32/ppoll-v.expected @@ -0,0 +1,3 @@ +ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \{fd=3, events=POLLIN\|POLLPRI\}, \{fd=4, events=POLLOUT\}\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) +ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) +ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-m32/ppoll.c b/tests-m32/ppoll.c new file mode 100644 index 00000000..46d7e816 --- /dev/null +++ b/tests-m32/ppoll.c @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +static void +test1(void) +{ + const struct timespec timeout = { .tv_sec = 42, .tv_nsec = 999999999 }; + struct pollfd fds[] = { + { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = 3, .events = POLLIN | POLLPRI }, + { .fd = 4, .events = POLLOUT } + }; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGCHLD); + + int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); + if (rc < 0) + perror_msg_and_skip("ppoll"); + assert(rc == 2); +} + +static void +test2(void) +{ + const struct timespec timeout = { .tv_sec = 0, .tv_nsec = 999 }; + struct pollfd fds[] = { + { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } + }; + + sigset_t mask; + sigfillset(&mask); + sigdelset(&mask, SIGHUP); + sigdelset(&mask, SIGKILL); + sigdelset(&mask, SIGSTOP); + + int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); + if (rc < 0) + perror_msg_and_skip("ppoll"); + assert(rc == 0); +} + +int +main(void) +{ + int fds[2]; + + (void) close(0); + (void) close(1); + (void) close(3); + (void) close(4); + if (pipe(fds) || pipe(fds)) + perror_msg_and_fail("pipe"); + + test1(); + test2(); + + assert(ppoll(NULL, 42, NULL, NULL) < 0); + return 0; +} diff --git a/tests-m32/ppoll.expected b/tests-m32/ppoll.expected new file mode 100644 index 00000000..c38a2062 --- /dev/null +++ b/tests-m32/ppoll.expected @@ -0,0 +1,3 @@ +ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \.\.\.\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) +ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) +ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-m32/ppoll.test b/tests-m32/ppoll.test new file mode 100755 index 00000000..98389ee6 --- /dev/null +++ b/tests-m32/ppoll.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check ppoll syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a30 -s2 -e ppoll $args +match_grep +run_strace -a30 -v -s2 -e ppoll $args +match_grep "$LOG" "$srcdir/$NAME-v.expected" + +exit 0 diff --git a/tests-m32/prctl-arg2-intptr.c b/tests-m32/prctl-arg2-intptr.c new file mode 100644 index 00000000..ee000ebe --- /dev/null +++ b/tests-m32/prctl-arg2-intptr.c @@ -0,0 +1,120 @@ +/* + * Check decoding of prctl operations which use arg2 as pointer to an integer + * value: PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, and PR_GET_FPEXC. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_prctl + +# include +# include +# include +# include + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_addr1 = + (kernel_ulong_t) 0x1e55c0de00000000ULL; + static const kernel_ulong_t bogus_addr2 = + (kernel_ulong_t) 0xfffffffffffffffdULL; + static const kernel_ulong_t bogus_op_bits = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const struct { + kernel_ulong_t val; + const char *str; + } options[] = { + { 37, "PR_GET_CHILD_SUBREAPER" }, + { 19, "PR_GET_ENDIAN" }, + { 9, "PR_GET_FPEMU" }, + { 11, "PR_GET_FPEXC" }, + }; + + unsigned int *ptr = tail_alloc(sizeof(*ptr)); + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(options); ++i) { + prctl(options[i].val | bogus_op_bits, 0); + printf("prctl(%s, NULL) = %s\n", options[i].str, errstr); + + if (bogus_addr1) { + prctl(options[i].val | bogus_op_bits, bogus_addr1); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr1, errstr); + } + + prctl(options[i].val | bogus_op_bits, bogus_addr2); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr2, errstr); + + prctl(options[i].val | bogus_op_bits, (uintptr_t) (ptr + 1)); + printf("prctl(%s, %p) = %s\n", options[i].str, + ptr + 1, errstr); + + rc = prctl(options[i].val | bogus_op_bits, (uintptr_t) ptr); + if (!rc) { + printf("prctl(%s, [%u]) = %s\n", + options[i].str, *ptr, errstr); + } else { + printf("prctl(%s, %p) = %s\n", + options[i].str, ptr, errstr); + } + + if (F8ILL_KULONG_SUPPORTED) { + kernel_ulong_t bogus_addr3 = f8ill_ptr_to_kulong(ptr); + prctl(options[i].val | bogus_op_bits, bogus_addr3); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr3, errstr); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests-m32/prctl-arg2-intptr.test b/tests-m32/prctl-arg2-intptr.test new file mode 100755 index 00000000..bcef8065 --- /dev/null +++ b/tests-m32/prctl-arg2-intptr.test @@ -0,0 +1,14 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, +# and PR_GET_FPEXC operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a25 -eprctl $args > "$EXP" +LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^CEF]|.[^HNP]|..[^DEI])' \ + < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-dumpable.c b/tests-m32/prctl-dumpable.c new file mode 100644 index 00000000..1049bcee --- /dev/null +++ b/tests-m32/prctl-dumpable.c @@ -0,0 +1,106 @@ +/* + * Check decoding of prctl PR_GET_DUMPABLE/PR_SET_DUMPABLE operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE + +# include +# include + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_dumpable1 = + (kernel_ulong_t) 0xdeadc0de00000001ULL; + static const kernel_ulong_t bogus_dumpable2 = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + + static const char * const args[] = { + "SUID_DUMP_DISABLE", + "SUID_DUMP_USER", + "SUID_DUMP_ROOT", + }; + + unsigned int i; + + prctl(PR_SET_DUMPABLE, 3); + printf("prctl(PR_SET_DUMPABLE, 0x3 /* SUID_DUMP_??? */) = %s\n", + errstr); + + prctl(PR_SET_DUMPABLE, bogus_dumpable1); + if (bogus_dumpable1 == 1) { + printf("prctl(PR_SET_DUMPABLE, SUID_DUMP_USER) = %s\n", errstr); + } else { + printf("prctl(PR_SET_DUMPABLE, %#llx /* SUID_DUMP_??? */)" + " = %s\n", + (unsigned long long) bogus_dumpable1, errstr); + } + + prctl(PR_SET_DUMPABLE, bogus_dumpable2); + printf("prctl(PR_SET_DUMPABLE, %#llx /* SUID_DUMP_??? */) = %s\n", + (unsigned long long) bogus_dumpable2, errstr); + + for (i = 0; i < ARRAY_SIZE(args); ++i) { + prctl(PR_SET_DUMPABLE, i); + printf("prctl(PR_SET_DUMPABLE, %s) = %s\n", args[i], errstr); + + long rc = prctl(PR_GET_DUMPABLE, bogus_dumpable2); + if (rc >= 0 && rc < (long) ARRAY_SIZE(args)) { + printf("prctl(PR_GET_DUMPABLE) = %s (%s)\n", + errstr, args[rc]); + } else { + printf("prctl(PR_GET_DUMPABLE) = %s\n", errstr); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE") + +#endif diff --git a/tests-m32/prctl-dumpable.test b/tests-m32/prctl-dumpable.test new file mode 100755 index 00000000..08acb8b9 --- /dev/null +++ b/tests-m32/prctl-dumpable.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_DUMPABLE and PR_SET_DUMPABLE operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^D][^U]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-name.c b/tests-m32/prctl-name.c new file mode 100644 index 00000000..308c275f --- /dev/null +++ b/tests-m32/prctl-name.c @@ -0,0 +1,103 @@ +/* + * Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_GET_NAME && defined PR_SET_NAME + +# include +# include +# include + +int +main(void) +{ + static const char str[] = "0123456789abcdef"; + static const int len = sizeof(str) - 1; + char *name = tail_memdup(str, sizeof(str)); + int i; + int rc; + + rc = prctl(PR_SET_NAME, NULL); + printf("prctl(PR_SET_NAME, NULL) = %s\n", sprintrc(rc)); + + for (i = 0; i <= len; ++i) { + rc = prctl(PR_SET_NAME, name + len - i); + printf("prctl(PR_SET_NAME, \"%.*s\"%s) = %s\n", + i < len - 1 ? i : len - 1, + str + len - i, + i < len - 1 ? "" : "...", + sprintrc(rc)); + } + + *name = -1; + ++name; + memcpy(name, str, len); + + for (i = 0; i <= len; ++i) { + rc = prctl(PR_SET_NAME, name + len - i); + if (i < len - 1) + printf("prctl(PR_SET_NAME, %p) = %s\n", + name + len - i, sprintrc(rc)); + else + printf("prctl(PR_SET_NAME, \"%.*s\"...) = %s\n", + len - 1, str + len - i, sprintrc(rc)); + } + + rc = prctl(PR_GET_NAME, NULL); + printf("prctl(PR_GET_NAME, NULL) = %s\n", sprintrc(rc)); + + for (i = 0; i < len; ++i) { + rc = prctl(PR_GET_NAME, name + len - i); + printf("prctl(PR_GET_NAME, %p) = %s\n", + name + len - i, sprintrc(rc)); + } + + rc = prctl(PR_GET_NAME, name); + if (rc) + printf("prctl(PR_GET_NAME, %p) = %s\n", + name, sprintrc(rc)); + else + printf("prctl(PR_GET_NAME, \"%.*s\") = %s\n", + len - 1, name, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_GET_NAME && PR_SET_NAME") + +#endif diff --git a/tests-m32/prctl-name.test b/tests-m32/prctl-name.test new file mode 100755 index 00000000..071179c5 --- /dev/null +++ b/tests-m32/prctl-name.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +grep -v '^prctl(PR_GET_[^N][^A]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-no-args.c b/tests-m32/prctl-no-args.c new file mode 100644 index 00000000..57e1b733 --- /dev/null +++ b/tests-m32/prctl-no-args.c @@ -0,0 +1,77 @@ +/* + * Check decoding of prctl operations without arguments and return code parsing: + * PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, PR_GET_TIMING, + * PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_prctl + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_op_bits = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xfacefeeddeadbeefULL; + static const struct { + kernel_ulong_t val; + const char *str; + } options[] = { + { 7, "PR_GET_KEEPCAPS" }, + { 13, "PR_GET_TIMING" }, + { 21, "PR_GET_SECCOMP" }, + { 30, "PR_GET_TIMERSLACK" }, + { 31, "PR_TASK_PERF_EVENTS_DISABLE" }, + { 32, "PR_TASK_PERF_EVENTS_ENABLE" }, + }; + + unsigned int *ptr = tail_alloc(sizeof(*ptr)); + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(options); i++) { + long rc = syscall(__NR_prctl, options[i].val | bogus_op_bits, + bogus_arg); + printf("prctl(%s) = %s\n", options[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests-m32/prctl-no-args.test b/tests-m32/prctl-no-args.test new file mode 100755 index 00000000..ce8ca67b --- /dev/null +++ b/tests-m32/prctl-no-args.test @@ -0,0 +1,14 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, +# PR_GET_TIMING, PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE +# operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a21 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^KST][^EI][^CEM]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-pdeathsig.c b/tests-m32/prctl-pdeathsig.c new file mode 100644 index 00000000..c1760307 --- /dev/null +++ b/tests-m32/prctl-pdeathsig.c @@ -0,0 +1,81 @@ +/* + * Check decoding of prctl PR_GET_PDEATHSIG/PR_SET_PDEATHSIG operations. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_PDEATHSIG && defined PR_SET_PDEATHSIG + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_signal = + (kernel_ulong_t) 0xbadc0deddeadfeedULL; + + int *pdeathsig = tail_alloc(sizeof(*pdeathsig)); + long rc; + + rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, bogus_signal); + printf("prctl(PR_SET_PDEATHSIG, %llu) = %s\n", + (unsigned long long) bogus_signal, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, SIGINT); + printf("prctl(PR_SET_PDEATHSIG, SIGINT) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, NULL); + printf("prctl(PR_GET_PDEATHSIG, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, pdeathsig + 1); + printf("prctl(PR_GET_PDEATHSIG, %p) = %s\n", + pdeathsig + 1, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, pdeathsig); + if (rc) { + printf("prctl(PR_GET_PDEATHSIG, %p) = %s\n", + pdeathsig, sprintrc(rc)); + } else { + printf("prctl(PR_GET_PDEATHSIG, [SIGINT]) = %s\n", + sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_PDEATHSIG && PR_SET_PDEATHSIG") + +#endif diff --git a/tests-m32/prctl-pdeathsig.test b/tests-m32/prctl-pdeathsig.test new file mode 100755 index 00000000..2777503a --- /dev/null +++ b/tests-m32/prctl-pdeathsig.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check prctl PR_GET_PDEATHSIG PR_SET_PDEATHSIG decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a30 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^P][^D]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-seccomp-filter-v.c b/tests-m32/prctl-seccomp-filter-v.c new file mode 100644 index 00000000..69316fbe --- /dev/null +++ b/tests-m32/prctl-seccomp-filter-v.c @@ -0,0 +1,145 @@ +/* + * Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef HAVE_PRCTL +# include +#endif +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined HAVE_PRCTL \ + && defined PR_SET_NO_NEW_PRIVS \ + && defined PR_SET_SECCOMP \ + && defined SECCOMP_MODE_FILTER \ + && defined SECCOMP_RET_ERRNO \ + && defined BPF_JUMP \ + && defined BPF_STMT + +#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) + +#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) + +#define SOCK_FILTER_KILL_PROCESS \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) + +#define PRINT_ALLOW_SYSCALL(nr) \ + printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ + __NR_ ## nr) + +#define PRINT_DENY_SYSCALL(nr, err) \ + printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ + __NR_ ## nr, err) + +static const struct sock_filter filter[] = { + /* load syscall number */ + BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), + + /* allow syscalls */ + SOCK_FILTER_ALLOW_SYSCALL(close), + SOCK_FILTER_ALLOW_SYSCALL(exit), + SOCK_FILTER_ALLOW_SYSCALL(exit_group), + + /* deny syscalls */ + SOCK_FILTER_DENY_SYSCALL(sync, EBUSY), + SOCK_FILTER_DENY_SYSCALL(setsid, EPERM), + + /* kill process */ + SOCK_FILTER_KILL_PROCESS +}; + +static const struct sock_fprog prog = { + .len = ARRAY_SIZE(filter), + .filter = (struct sock_filter *) filter, +}; + +int +main(void) +{ + int fds[2]; + + puts("prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) = 0"); + + printf("prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, {len=%u, filter=[", + prog.len); + + printf("BPF_STMT(BPF_LD|BPF_W|BPF_ABS, %#x), ", + (unsigned) offsetof(struct seccomp_data, nr)); + + PRINT_ALLOW_SYSCALL(close); + PRINT_ALLOW_SYSCALL(exit); + PRINT_ALLOW_SYSCALL(exit_group); + + PRINT_DENY_SYSCALL(sync, EBUSY), + PRINT_DENY_SYSCALL(setsid, EPERM), + + printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"); + + puts("]}) = 0"); + puts("+++ exited with 0 +++"); + + fflush(stdout); + close(0); + close(1); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + perror_msg_and_skip("PR_SET_NO_NEW_PRIVS"); + if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) + perror_msg_and_skip("PR_SET_SECCOMP"); + if (close(0) || close(1)) + _exit(77); + + _exit(0); +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_NO_NEW_PRIVS && PR_SET_SECCOMP" + " && SECCOMP_MODE_FILTER && SECCOMP_RET_ERRNO" + " && BPF_JUMP && BPF_STMT") + +#endif diff --git a/tests-m32/prctl-seccomp-filter-v.test b/tests-m32/prctl-seccomp-filter-v.test new file mode 100755 index 00000000..44e4a782 --- /dev/null +++ b/tests-m32/prctl-seccomp-filter-v.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -v -eprctl $args > "$EXP" +grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-seccomp-strict.c b/tests-m32/prctl-seccomp-strict.c new file mode 100644 index 00000000..a78f8173 --- /dev/null +++ b/tests-m32/prctl-seccomp-strict.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_SECCOMP && defined __NR_exit + +# include +# include + +int +main(void) +{ + static const char text1[] = + "prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT) = 0\n"; + static const char text2[] = "+++ exited with 0 +++\n"; + + int rc = prctl(PR_SET_SECCOMP, -1L, 1, 2, 3); + printf("prctl(PR_SET_SECCOMP, %#lx /* SECCOMP_MODE_??? */, 0x1, 0x2, 0x3)" + " = %d %s (%m)\n", -1L, rc, errno2name()); + fflush(stdout); + + rc = prctl(PR_SET_SECCOMP, 1); + if (rc) { + printf("prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT)" + " = %d %s (%m)\n", rc, errno2name()); + fflush(stdout); + rc = 0; + } else { + /* + * If kernel implementaton of SECCOMP_MODE_STRICT is buggy, + * the following syscall will result to SIGKILL. + */ + rc = write(1, text1, LENGTH_OF(text1)) != LENGTH_OF(text1); + } + + rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2); + return !!syscall(__NR_exit, rc); +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_SECCOMP && __NR_exit") + +#endif diff --git a/tests-m32/prctl-seccomp-strict.test b/tests-m32/prctl-seccomp-strict.test new file mode 100755 index 00000000..1f987df7 --- /dev/null +++ b/tests-m32/prctl-seccomp-strict.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check how prctl PR_SET_SECCOMP SECCOMP_MODE_STRICT is decoded. + +. "${srcdir=.}/init.sh" + +check_prog grep +set -- "./$NAME" +"$@" > /dev/null || { + case $? in + 77) skip_ "$* exited with code 77" ;; + 137) framework_skip_ "$* killed by SIGKILL, fix your kernel" ;; + *) fail_ "$args failed" ;; + esac +} +run_strace -eprctl "$@" > "$EXP" +grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-securebits.c b/tests-m32/prctl-securebits.c new file mode 100644 index 00000000..741973af --- /dev/null +++ b/tests-m32/prctl-securebits.c @@ -0,0 +1,106 @@ +/* + * Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_SECUREBITS && defined PR_SET_SECUREBITS + +# include +# include + +# include "xlat.h" +# include "xlat/secbits.h" + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bits1 = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + static const kernel_ulong_t bits2 = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const kernel_ulong_t bits3 = + (kernel_ulong_t) 0xffULL; + + prctl(PR_SET_SECUREBITS, 0); + printf("prctl(PR_SET_SECUREBITS, 0) = %s\n", errstr); + + prctl(PR_SET_SECUREBITS, bits1); + printf("prctl(PR_SET_SECUREBITS, SECBIT_NOROOT|SECBIT_NOROOT_LOCKED|" + "SECBIT_NO_SETUID_FIXUP|SECBIT_NO_SETUID_FIXUP_LOCKED|" + "SECBIT_KEEP_CAPS_LOCKED|SECBIT_NO_CAP_AMBIENT_RAISE|" + "SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED|%#llx) = %s\n", + (unsigned long long) bits1 & ~0xffULL, errstr); + + if (bits2) { + prctl(PR_SET_SECUREBITS, bits2); + printf("prctl(PR_SET_SECUREBITS, %#llx /* SECBIT_??? */)" + " = %s\n", (unsigned long long) bits2, errstr); + } + + prctl(PR_SET_SECUREBITS, bits3); + printf("prctl(PR_SET_SECUREBITS, SECBIT_NOROOT|SECBIT_NOROOT_LOCKED|" + "SECBIT_NO_SETUID_FIXUP|SECBIT_NO_SETUID_FIXUP_LOCKED|" + "SECBIT_KEEP_CAPS|SECBIT_KEEP_CAPS_LOCKED|" + "SECBIT_NO_CAP_AMBIENT_RAISE|SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED)" + " = %s\n", errstr); + + long rc = prctl(PR_GET_SECUREBITS, bits1); + printf("prctl(PR_GET_SECUREBITS) = %s", errstr); + if (rc > 0) { + printf(" ("); + printflags(secbits, rc, NULL); + printf(")"); + } + + puts(""); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_SECUREBITS && PR_SET_SECUREBITS") + +#endif diff --git a/tests-m32/prctl-securebits.test b/tests-m32/prctl-securebits.test new file mode 100755 index 00000000..c91e62a6 --- /dev/null +++ b/tests-m32/prctl-securebits.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a25 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^S][^E][^C][^U]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-tid_address.c b/tests-m32/prctl-tid_address.c new file mode 100644 index 00000000..24e45031 --- /dev/null +++ b/tests-m32/prctl-tid_address.c @@ -0,0 +1,103 @@ +/* + * Check decoding of prctl PR_GET_TID_ADDRESS operation. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined __NR_set_tid_address && \ + defined PR_GET_TID_ADDRESS + +# include +# include +# include + +static const char * +sprintaddr(kernel_ulong_t addr) +{ + static char buf[sizeof("0x") + sizeof(addr) * 2]; + + if (addr) { + snprintf(buf, sizeof(buf), "%#llx", (unsigned long long) addr); + + return buf; + } + + return "NULL"; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfffffffffffffffdULL; + + /* Note that kernel puts kernel-sized pointer even on x32 */ + kernel_ulong_t *ptr = tail_alloc(sizeof(*ptr)); + long rc; + long set_ok; + + *ptr = (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, NULL); + printf("prctl(PR_GET_TID_ADDRESS, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, bogus_addr); + printf("prctl(PR_GET_TID_ADDRESS, %#llx) = %s\n", + (unsigned long long) bogus_addr, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, ptr); + if (rc) { + printf("prctl(PR_GET_TID_ADDRESS, %p) = %s\n", + ptr, sprintrc(rc)); + } else { + printf("prctl(PR_GET_TID_ADDRESS, [%s]) = %s\n", + sprintaddr(*ptr), sprintrc(rc)); + } + + set_ok = syscall(__NR_set_tid_address, bogus_addr); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, ptr); + if (rc) { + printf("prctl(PR_GET_TID_ADDRESS, %p) = %s\n", + ptr, sprintrc(rc)); + } else { + printf("prctl(PR_GET_TID_ADDRESS, [%s]) = %s\n", + sprintaddr(set_ok ? bogus_addr : *ptr), sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && __NR_set_tid_address && PR_GET_TID_ADDRESS") + +#endif diff --git a/tests-m32/prctl-tid_address.test b/tests-m32/prctl-tid_address.test new file mode 100755 index 00000000..dc7b7c32 --- /dev/null +++ b/tests-m32/prctl-tid_address.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_TID_ADDRESS operation. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^T]|.[^I]|..[^D])' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-tsc.c b/tests-m32/prctl-tsc.c new file mode 100644 index 00000000..fd9362d7 --- /dev/null +++ b/tests-m32/prctl-tsc.c @@ -0,0 +1,80 @@ +/* + * Check decoding of prctl PR_GET_TSC/PR_SET_TSC operations. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_TSC && defined PR_SET_TSC + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_tsc = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + + int *tsc = tail_alloc(sizeof(*tsc)); + long rc; + + rc = syscall(__NR_prctl, PR_SET_TSC, 0); + printf("prctl(PR_SET_TSC, 0 /* PR_TSC_??? */) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_TSC, bogus_tsc); + printf("prctl(PR_SET_TSC, %#x /* PR_TSC_??? */) = %s\n", + (unsigned int) bogus_tsc, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_TSC, PR_TSC_SIGSEGV); + printf("prctl(PR_SET_TSC, PR_TSC_SIGSEGV) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, NULL); + printf("prctl(PR_GET_TSC, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, tsc + 1); + printf("prctl(PR_GET_TSC, %p) = %s\n", tsc + 1, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, tsc); + if (rc) + printf("prctl(PR_GET_TSC, %p) = %s\n", tsc, sprintrc(rc)); + else + printf("prctl(PR_GET_TSC, [PR_TSC_SIGSEGV]) = %s\n", + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_TSC && PR_SET_TSC") + +#endif diff --git a/tests-m32/prctl-tsc.test b/tests-m32/prctl-tsc.test new file mode 100755 index 00000000..a906ba89 --- /dev/null +++ b/tests-m32/prctl-tsc.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check prctl PR_GET_TSC PR_SET_TSC decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a24 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^T][^S]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-m32/pread64-pwrite64.c b/tests-m32/pread64-pwrite64.c new file mode 100644 index 00000000..4a0932a9 --- /dev/null +++ b/tests-m32/pread64-pwrite64.c @@ -0,0 +1,223 @@ +/* + * Check decoding of pread64 and pwrite64 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +static void +dump_str(const char *str, const unsigned int len) +{ + static const char dots[16] = "................"; + unsigned int i; + + for (i = 0; i < len; i += 16) { + unsigned int n = len - i > 16 ? 16 : len - i; + const char *dump = hexdump_memdup(str + i, n); + + tprintf(" | %05x %-49s %-16.*s |\n", + i, dump, n, dots); + + free((void *) dump); + } +} + +static void +print_hex(const char *str, const unsigned int len) +{ + const unsigned char *ustr = (const unsigned char *) str; + unsigned int i; + + for (i = 0; i < len; ++i) { + unsigned int c = ustr[i]; + + switch (c) { + case '\t': + tprintf("\\t"); break; + case '\n': + tprintf("\\n"); break; + case '\v': + tprintf("\\v"); break; + case '\f': + tprintf("\\f"); break; + case '\r': + tprintf("\\r"); break; + default: + tprintf("\\%o", ustr[i]); + } + } +} + +static void +test_dump(const unsigned int len) +{ + static char *buf; + + if (buf) { + size_t ps1 = get_page_size() - 1; + buf = (void *) (((size_t) buf + ps1) & ~ps1) - len; + } else { + buf = tail_alloc(len); + } + + const off_t offset = 0xdefaceddeadbeefLL + len; + long rc = pread(0, buf, len, offset); + if (rc != (int) len) + perror_msg_and_fail("pread64: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "pread64", 0); + print_hex(buf, len); + tprintf("\", %d, %lld) = %ld\n", len, (long long) offset, rc); + dump_str(buf, len); + + unsigned int i; + for (i = 0; i < len; ++i) + buf[i] = i; + + rc = pwrite(1, buf, len, offset); + if (rc != (int) len) + perror_msg_and_fail("pwrite64: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "pwrite64", 1); + print_hex(buf, len); + tprintf("\", %d, %lld) = %ld\n", len, (long long) offset, rc); + dump_str(buf, len); + + if (!len) + buf = 0; +} + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "pread64-pwrite64-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + + char *nil = tail_alloc(1); + *nil = '\0'; + + static const char w_c[] = "0123456789abcde"; + const unsigned int w_len = LENGTH_OF(w_c); + const char *w_d = hexdump_strdup(w_c); + const void *w = tail_memdup(w_c, w_len); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + const unsigned int r0_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r0_len); + + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + const unsigned int r1_len = w_len - r0_len; + void *r1 = tail_alloc(w_len); + + void *efault = r1 - get_page_size(); + + long rc; + + rc = pwrite(1, w, 0, 0); + if (rc) + perror_msg_and_fail("pwrite64: expected 0, returned %ld", rc); + tprintf("pwrite64(1, \"\", 0, 0) = 0\n"); + + rc = pwrite(1, efault, 1, 0); + if (rc != -1) + perror_msg_and_fail("pwrite64: expected -1 EFAULT" + ", returned %ld", rc); + tprintf("pwrite64(1, %p, 1, 0) = -1 EFAULT (%m)\n", efault); + + rc = pwrite(1, nil, 1, -3); + if (rc != -1) + perror_msg_and_fail("pwrite64: expected -1, returned %ld", rc); + tprintf("pwrite64(1, \"\\0\", 1, -3) = -1 EINVAL (%m)\n"); + + rc = pwrite(1, w, w_len, 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwrite64: expected %u, returned %ld", + w_len, rc); + tprintf("pwrite64(1, \"%s\", %u, 0) = %ld\n" + " | 00000 %-49s %-16s |\n", + w_c, w_len, rc, w_d, w_c); + close(1); + + rc = pread(0, r0, 0, 0); + if (rc) + perror_msg_and_fail("pread64: expected 0, returned %ld", rc); + tprintf("pread64(0, \"\", 0, 0) = 0\n"); + + rc = pread(0, efault, 1, 0); + if (rc != -1) + perror_msg_and_fail("pread64: expected -1, returned %ld", rc); + tprintf("pread64(0, %p, 1, 0) = -1 EFAULT (%m)\n", efault); + + rc = pread(0, efault, 2, -7); + if (rc != -1) + perror_msg_and_fail("pread64: expected -1, returned %ld", rc); + tprintf("pread64(0, %p, 2, -7) = -1 EINVAL (%m)\n", efault); + + rc = pread(0, r0, r0_len, 0); + if (rc != (int) r0_len) + perror_msg_and_fail("pread64: expected %u, returned %ld", + r0_len, rc); + tprintf("pread64(0, \"%s\", %u, 0) = %ld\n" + " | 00000 %-49s %-16s |\n", + r0_c, r0_len, rc, r0_d, r0_c); + + rc = pread(0, r1, w_len, r0_len); + if (rc != (int) r1_len) + perror_msg_and_fail("pread64: expected %u, returned %ld", + r1_len, rc); + tprintf("pread64(0, \"%s\", %u, %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r1_c, w_len, r0_len, rc, r1_d, r1_c); + close(0); + + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 1) + perror_msg_and_fail("open"); + + unsigned int i; + for (i = 0; i <= 32; ++i) + test_dump(i); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/pread64-pwrite64.test b/tests-m32/pread64-pwrite64.test new file mode 100755 index 00000000..e585406d --- /dev/null +++ b/tests-m32/pread64-pwrite64.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check decoding and dumping of pread64 and pwrite64 syscalls. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +tmpfile=pread64-pwrite64-tmpfile +> $tmpfile + +run_strace_match_diff \ + -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 \ + -P $tmpfile -P /dev/zero -P /dev/null + +rm -f $tmpfile diff --git a/tests-m32/preadv-pwritev.c b/tests-m32/preadv-pwritev.c new file mode 100644 index 00000000..b2d2a824 --- /dev/null +++ b/tests-m32/preadv-pwritev.c @@ -0,0 +1,182 @@ +/* + * Check decoding of preadv and pwritev syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#if defined HAVE_PREADV && defined HAVE_PWRITEV + +# include +# include +# include +# include + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "preadv-pwritev-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + if (unlink(tmp)) + perror_msg_and_fail("unlink: %s", tmp); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + const void *efault = w0 + LENGTH_OF(w0_c); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + long rc; + + rc = pwritev(1, efault, 42, 0); + tprintf("pwritev(1, %p, 42, 0) = %ld %s (%m)\n", + efault, rc, errno2name()); + + rc = preadv(0, efault, 42, 0); + tprintf("preadv(0, %p, 42, 0) = %ld %s (%m)\n", + efault, rc, errno2name()); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + rc = pwritev(1, w_iov, 0, 0); + if (rc) + perror_msg_and_fail("pwritev: expected 0, returned %ld", rc); + tprintf("pwritev(1, [], 0, 0) = 0\n"); + + rc = pwritev(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0)" + " = %ld %s (%m)\n", + w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + rc = pwritev(1, w_iov, ARRAY_SIZE(w_iov_), 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwritev: expected %u, returned %ld", + w_len, rc); + close(1); + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + rc = preadv(0, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv: expected %u, returned %ld", + r_len, rc); + tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = preadv(0, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) w_len - (int) r_len) + perror_msg_and_fail("preadv: expected %d, returned %ld", + (int) w_len - r_len, rc); + tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r_len, w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV && HAVE_PWRITEV") + +#endif diff --git a/tests-m32/preadv-pwritev.test b/tests-m32/preadv-pwritev.test new file mode 100755 index 00000000..cb2a0772 --- /dev/null +++ b/tests-m32/preadv-pwritev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding and dumping of preadv and pwritev syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests-m32/preadv.c b/tests-m32/preadv.c new file mode 100644 index 00000000..fb5d3ad7 --- /dev/null +++ b/tests-m32/preadv.c @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PREADV + +# include +# include +# include +# include + +# define LEN 8 + +static void +print_iov(const struct iovec *iov) +{ + unsigned int i; + unsigned char *buf = iov->iov_base; + + fputs("{iov_base=\"", stdout); + for (i = 0; i < iov->iov_len; ++i) + printf("\\%d", (int) buf[i]); + printf("\", iov_len=%u}", (unsigned) iov->iov_len); +} + +static void +print_iovec(const struct iovec *iov, unsigned int cnt) +{ + unsigned int i; + putchar('['); + for (i = 0; i < cnt; ++i) { + if (i) + fputs(", ", stdout); + print_iov(&iov[i]); + } + putchar(']'); +} + +int +main(void) +{ + const off_t offset = 0xdefaceddeadbeefLL; + char *buf = tail_alloc(LEN); + struct iovec *iov = tail_alloc(sizeof(*iov)); + iov->iov_base = buf; + iov->iov_len = LEN; + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (preadv(0, iov, 1, offset) != LEN) + perror_msg_and_fail("preadv"); + printf("preadv(0, "); + print_iovec(iov, 1); + printf(", 1, %lld) = %u\n", (long long) offset, LEN); + + if (preadv(0, iov, 1, -1) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, [{iov_base=%p, iov_len=%zu}], 1, -1) = " + "-1 EINVAL (%m)\n", iov->iov_base, iov->iov_len); + + if (preadv(0, NULL, 1, -2) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, NULL, 1, -2) = -1 EINVAL (%m)\n"); + + if (preadv(0, iov, 0, -3) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, [], 0, -3) = -1 EINVAL (%m)\n"); + + static const char tmp[] = "preadv-tmpfile"; + int fd = open(tmp, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd < 0) + perror_msg_and_fail("open"); + if (unlink(tmp)) + perror_msg_and_fail("unlink"); + + static const char w[] = "0123456789abcde"; + if (write(fd, w, LENGTH_OF(w)) != LENGTH_OF(w)) + perror_msg_and_fail("write"); + + static const char r0_c[] = "01234567"; + static const char r1_c[] = "89abcde"; + + const unsigned int r_len = (LENGTH_OF(w) + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + long rc; + + rc = preadv(fd, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv: expected %u, returned %ld", + r_len, rc); + printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n", + fd, r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(LENGTH_OF(w)); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = LENGTH_OF(w) + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = preadv(fd, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) LENGTH_OF(w) - (int) r_len) + perror_msg_and_fail("preadv: expected %d, returned %ld", + (int) LENGTH_OF(w) - r_len, rc); + printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n", + fd, r1_c, r_len, LENGTH_OF(w), ARRAY_SIZE(r1_iov_), + r_len, LENGTH_OF(w) - r_len); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV") + +#endif diff --git a/tests-m32/preadv.test b/tests-m32/preadv.test new file mode 100755 index 00000000..d1abdb7d --- /dev/null +++ b/tests-m32/preadv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check preadv syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/preadv2-pwritev2.c b/tests-m32/preadv2-pwritev2.c new file mode 100644 index 00000000..f7c46c0a --- /dev/null +++ b/tests-m32/preadv2-pwritev2.c @@ -0,0 +1,216 @@ +/* + * Check decoding of preadv2 and pwritev2 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#if defined __NR_preadv2 && defined __NR_pwritev2 + +# include +# include +# include +# include +# include + +static int +pr(const int fd, const struct iovec *const vec, + const unsigned long vlen, const unsigned long pos) +{ + return syscall(__NR_preadv2, fd, vec, vlen, pos, 0L, 0L); +} + +static int +pw(const int fd, const struct iovec *const vec, + const unsigned long vlen, const unsigned long pos) +{ + return syscall(__NR_pwritev2, fd, vec, vlen, pos, 0L, 0L); +} + +static void +dumpio(void) +{ + static char tmp[] = "preadv2-pwritev2-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + if (unlink(tmp)) + perror_msg_and_fail("unlink: %s", tmp); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + long rc; + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + rc = pw(1, w_iov, 0, 0); + if (rc) + perror_msg_and_fail("pwritev2: expected 0, returned %ld", rc); + tprintf("pwritev2(1, [], 0, 0, 0) = 0\n"); + + rc = pw(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0, 0)" + " = %ld %s (%m)\n", + w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + rc = pw(1, w_iov, ARRAY_SIZE(w_iov_), 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwritev2: expected %u, returned %ld", + w_len, rc); + close(1); + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + rc = pr(0, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv2: expected %u, returned %ld", + r_len, rc); + tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = pr(0, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) w_len - (int) r_len) + perror_msg_and_fail("preadv2: expected %d, returned %ld", + (int) w_len - r_len, rc); + tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r_len, w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); +} + +int +main(void) +{ + const kernel_ulong_t vlen = (kernel_ulong_t) 0xfac1fed2dad3bef4ULL; + const unsigned long long pos = 0xfac5fed6dad7bef8; + const kernel_ulong_t pos_l = (kernel_ulong_t) pos; + const kernel_ulong_t pos_h = + (sizeof(kernel_ulong_t) == sizeof(long long)) ? + (kernel_ulong_t) 0xbadc0deddeadbeefULL : 0xfac5fed6UL; + int test_dumpio = 1; + + tprintf("%s", ""); + + syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); + if (ENOSYS == errno) + test_dumpio = 0; + tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", + (unsigned long) vlen, pos, errno2name()); + + syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); + if (ENOSYS == errno) + test_dumpio = 0; + tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", + (unsigned long) vlen, pos, errno2name()); + + if (test_dumpio) + dumpio(); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_preadv2 && __NR_pwritev2") + +#endif diff --git a/tests-m32/preadv2-pwritev2.test b/tests-m32/preadv2-pwritev2.test new file mode 100755 index 00000000..5641ef46 --- /dev/null +++ b/tests-m32/preadv2-pwritev2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding and dumping of preadv2 and pwritev2 syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests-m32/print_maxfd.c b/tests-m32/print_maxfd.c new file mode 100644 index 00000000..c3d4ea88 --- /dev/null +++ b/tests-m32/print_maxfd.c @@ -0,0 +1,41 @@ +/* + * Print the maximum descriptor number available. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + int fds[2]; + pipe_maxfd(fds); + printf("%d\n", fds[1]); + return 0; +} diff --git a/tests-m32/print_quoted_string.c b/tests-m32/print_quoted_string.c new file mode 100644 index 00000000..3ad86024 --- /dev/null +++ b/tests-m32/print_quoted_string.c @@ -0,0 +1,75 @@ +#include "tests.h" + +#include +#include +#include + +/* + * Based on string_quote() from util.c. + * Assumes instr is NUL-terminated. + */ + +void +print_quoted_string(const char *instr) +{ + print_quoted_memory(instr, strlen(instr)); +} + +void +print_quoted_memory(const char *instr, const size_t len) +{ + const unsigned char *str = (const unsigned char*) instr; + size_t i; + + for (i = 0; i < len; ++i) { + const int c = str[i]; + switch (c) { + case '\"': + printf("\\\""); + break; + case '\\': + printf("\\\\"); + break; + case '\f': + printf("\\f"); + break; + case '\n': + printf("\\n"); + break; + case '\r': + printf("\\r"); + break; + case '\t': + printf("\\t"); + break; + case '\v': + printf("\\v"); + break; + default: + if (c >= ' ' && c <= 0x7e) + putchar(c); + else { + putchar('\\'); + + char c1 = '0' + (c & 0x7); + char c2 = '0' + ((c >> 3) & 0x7); + char c3 = '0' + (c >> 6); + + if (*str >= '0' && *str <= '9') { + /* Print \octal */ + putchar(c3); + putchar(c2); + } else { + /* Print \[[o]o]o */ + if (c3 != '0') + putchar(c3); + if (c3 != '0' || c2 != '0') + putchar(c2); + } + putchar(c1); + } + break; + } + } + +} diff --git a/tests-m32/printflags.c b/tests-m32/printflags.c new file mode 100644 index 00000000..badc85d3 --- /dev/null +++ b/tests-m32/printflags.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "xlat.h" +#include + +int +printflags(const struct xlat *xlat, unsigned long long flags, + const char *const dflt) +{ + if (flags == 0 && xlat->val == 0 && xlat->str) { + fputs(xlat->str, stdout); + return 1; + } + + int n; + char sep = 0; + for (n = 0; xlat->str; xlat++) { + if (xlat->val && (flags & xlat->val) == xlat->val) { + if (sep) + putc(sep, stdout); + else + sep = '|'; + fputs(xlat->str, stdout); + flags &= ~xlat->val; + n++; + } + } + + if (n) { + if (flags) { + if (sep) + putc(sep, stdout); + printf("%#llx", flags); + n++; + } + } else { + if (flags) { + printf("%#llx", flags); + if (dflt) + printf(" /* %s */", dflt); + } else { + if (dflt) + putc('0', stdout); + } + } + + return n; +} diff --git a/tests-m32/printstr.c b/tests-m32/printstr.c new file mode 100644 index 00000000..330234f1 --- /dev/null +++ b/tests-m32/printstr.c @@ -0,0 +1,69 @@ +/* + * Check decoding of non-NUL-terminated strings when len == -1. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +#define DEFAULT_STRLEN 32 + +int +main(void) +{ + char *const buf = tail_alloc(DEFAULT_STRLEN + 1); + const struct iovec io = { + .iov_base = buf, + .iov_len = -1 + }; + int rc; + + buf[0] = 0; + + tprintf("%s", ""); + + memset(buf + 1, 'X', DEFAULT_STRLEN); + buf[DEFAULT_STRLEN - 1] = 0; + + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=\"\\0%*s\\0\"..., iov_len=%lu}], 1)" + " = %s\n", DEFAULT_STRLEN - 2, buf + 1, -1UL, sprintrc(rc)); + + buf[DEFAULT_STRLEN - 1] = 'X'; + buf[DEFAULT_STRLEN] = 0; + + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=\"\\0%*s\"..., iov_len=%lu}], 1)" + " = %s\n", DEFAULT_STRLEN - 1, buf + 1, -1UL, sprintrc(rc)); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/printstr.test b/tests-m32/printstr.test new file mode 100755 index 00000000..5f164eb7 --- /dev/null +++ b/tests-m32/printstr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of non-NUL-terminated strings when len == -1. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -e trace=writev diff --git a/tests-m32/printxval.c b/tests-m32/printxval.c new file mode 100644 index 00000000..4fb61c84 --- /dev/null +++ b/tests-m32/printxval.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "xlat.h" +#include + +int +printxval(const struct xlat *xlat, unsigned long long val, + const char *const dflt) +{ + for (; xlat->str; xlat++) { + if (xlat->val == val) { + fputs(xlat->str, stdout); + return 1; + } + } + + printf("%#llx", val); + if (dflt) + printf(" /* %s */", dflt); + return 0; +} diff --git a/tests-m32/prlimit64.c b/tests-m32/prlimit64.c new file mode 100644 index 00000000..1e651161 --- /dev/null +++ b/tests-m32/prlimit64.c @@ -0,0 +1,92 @@ +/* + * Check decoding of prlimit64 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_prlimit64 + +# include +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/resources.h" + +const char * +sprint_rlim(uint64_t lim) +{ + if (lim == -1ULL) + return "RLIM64_INFINITY"; + + static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; + static int i; + i &= 1; + if (lim > 1024 && lim % 1024 == 0) + sprintf(buf[i], "%" PRIu64 "*1024", lim / 1024); + else + sprintf(buf[i], "%" PRIu64, lim); + + return buf[i++]; +} + +int +main(void) +{ + unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + uint64_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(__NR_prlimit64, pid, res, 0, rlimit); + if (rc) + printf("prlimit64(%d, %s, NULL, %p) = %ld %s (%m)\n", + (unsigned) pid, xlat->str, rlimit, + rc, errno2name()); + else + printf("prlimit64(%d, %s, NULL" + ", {rlim_cur=%s, rlim_max=%s}) = 0\n", + (unsigned) pid, xlat->str, + sprint_rlim(rlimit[0]), + sprint_rlim(rlimit[1])); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prlimit64") + +#endif diff --git a/tests-m32/prlimit64.test b/tests-m32/prlimit64.test new file mode 100755 index 00000000..2d2240d7 --- /dev/null +++ b/tests-m32/prlimit64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of prlimit64 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/process_vm_readv.c b/tests-m32/process_vm_readv.c new file mode 100644 index 00000000..cfb8f786 --- /dev/null +++ b/tests-m32/process_vm_readv.c @@ -0,0 +1,18 @@ +#include "tests.h" + +#include + +#ifdef __NR_process_vm_readv + +# define OP process_vm_readv +# define OP_NR __NR_process_vm_readv +# define OP_STR "process_vm_readv" +# define OP_WR 0 + +# include "process_vm_readv_writev.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_process_vm_readv"); + +#endif diff --git a/tests-m32/process_vm_readv.test b/tests-m32/process_vm_readv.test new file mode 100755 index 00000000..c092f5a3 --- /dev/null +++ b/tests-m32/process_vm_readv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of process_vm_readv syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a37 diff --git a/tests-m32/process_vm_readv_writev.c b/tests-m32/process_vm_readv_writev.c new file mode 100644 index 00000000..2a089395 --- /dev/null +++ b/tests-m32/process_vm_readv_writev.c @@ -0,0 +1,306 @@ +/* + * Check decoding of process_vm_readv/process_vm_writev syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +#if OP_WR +# define in_iovec rmt_iovec +# define out_iovec lcl_iovec +# define in_iov rmt_iov +# define out_iov lcl_iov +#else +# define in_iovec lcl_iovec +# define out_iovec rmt_iovec +# define in_iov lcl_iov +# define out_iov rmt_iov +#endif + +typedef void (*iov_print_fn)(const struct iovec *, const void *, long); + +enum { MAX_SEGM_COUNT = 2, MAX_STR_LEN = 5 }; + +struct print_iov_arg { + uint32_t count; + uint32_t valid :1, + string :1, + addr_term:1, + check_rc :1; + uint32_t str_segms; + uint8_t str_base[MAX_SEGM_COUNT]; + uint8_t str_size[MAX_SEGM_COUNT]; +}; + +static void +print_iov(const struct iovec *iov, const void *arg_ptr, long rc) +{ + const struct print_iov_arg *arg = arg_ptr; + uint32_t i; + uint32_t num_segm = 0; + uint64_t segm_offs = 0; + + if (!arg || !arg->valid) { + if (iov) + printf("%p", iov); + else + printf("NULL"); + + return; + } + + printf("["); + + for (i = 0; i < arg->count; i++) { + if (i) + printf(", "); + + if (i >= MAX_STR_LEN) { + printf("..."); + break; + } + + printf("{iov_base="); + if (arg->string && (!arg->check_rc || (rc != -1))) { + uint64_t str_left = iov[i].iov_len; + uint64_t pr_count = 0; + + printf("\""); + + while (str_left--) { + static const char oct_str[] = "01234567"; + uint8_t c = arg->str_base[num_segm] + segm_offs; + + if ((num_segm >= arg->str_segms) || + (num_segm >= MAX_SEGM_COUNT)) + error_msg_and_fail("print_iov: segment " + "count overrun"); + + if (pr_count++ < MAX_STR_LEN) + printf("\\%.1s%.1s%d", + (c >> 6) ? + oct_str + (c >> 6) : "", + (c >> 3) ? + oct_str + ((c >> 3) & 7) : "", + c & 7); + + segm_offs++; + + if (segm_offs >= arg->str_size[num_segm]) { + num_segm++; + segm_offs = 0; + } + } + + printf("\""); + + if (pr_count > MAX_STR_LEN) + printf("..."); + } else { + if (iov[i].iov_base) + printf("%p", iov[i].iov_base); + else + printf("NULL"); + } + + printf(", iov_len=%zu}", iov[i].iov_len); + } + + if (arg->addr_term) + printf(", %p", iov + arg->count); + + printf("]"); +} + +static void +do_call(kernel_ulong_t pid, + kernel_ulong_t local_iov, const char *local_arg, + kernel_ulong_t liovcnt, + kernel_ulong_t remote_iov, const char *remote_arg, + kernel_ulong_t riovcnt, + kernel_ulong_t flags, iov_print_fn pr_iov) +{ + long rc; + const char *errstr; + + rc = syscall(OP_NR, pid, local_iov, liovcnt, remote_iov, riovcnt, + flags); + errstr = sprintrc(rc); + + printf("%s(%d, ", OP_STR, (int) pid); + + if (pr_iov) + pr_iov((const struct iovec *) (uintptr_t) local_iov, local_arg, + rc); + else + printf("%s", local_arg); + + printf(", %lu, ", (unsigned long) liovcnt); + + if (pr_iov) + pr_iov((const struct iovec *) (uintptr_t) remote_iov, + remote_arg, rc); + else + printf("%s", remote_arg); + + printf(", %lu, %lu) = %s\n", (unsigned long) riovcnt, + (unsigned long) flags, errstr); +} + +kernel_ulong_t +ptr_cast(void *ptr) +{ + return (kernel_ulong_t) (uintptr_t) ptr; +} + +int +main(void) +{ + enum { + SIZE_11 = 2, + SIZE_12 = 3, + SIZE_13 = 4, + SIZE_1 = SIZE_11 + SIZE_12 + SIZE_13, + SIZE_21 = 5, + SIZE_22 = 6, + SIZE_23 = 7, + SIZE_2 = SIZE_21 + SIZE_22 + SIZE_23, + }; + + enum { + SEGM1_BASE = 0x80, + SEGM2_BASE = 0xA0, + }; + + static const kernel_ulong_t bogus_pid = + (kernel_ulong_t) 0xbadfaceddeadca57ULL; + static const kernel_ulong_t bogus_iovcnt1 = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + static const kernel_ulong_t bogus_iovcnt2 = + (kernel_ulong_t) 0xdec0ded3defaced4ULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xdeadc0deda7adeadULL; + + pid_t my_pid = getpid(); + char *data1_out = tail_alloc(SIZE_1); + char *data2_out = tail_alloc(SIZE_2); + char *data1_in = tail_alloc(SIZE_2); + char *data2_in = tail_alloc(SIZE_1); + + struct iovec bogus_iovec[] = { + { data1_out + SIZE_1, (size_t) 0xdeadfaceca57beefULL }, + { data1_in + SIZE_2, (size_t) 0xbadc0dedda7adeadULL }, + { data2_out + SIZE_2, (size_t) 0xf157facedec0ded1ULL }, + { data2_in + SIZE_1, (size_t) 0xdefaced2bea7be57ULL }, + }; + + struct iovec out_iovec[] = { + { data1_out, SIZE_11 }, + { data1_out + SIZE_11, SIZE_12 }, + { data1_out + SIZE_11 + SIZE_12, SIZE_13 }, + { data2_out, SIZE_21 }, + { data2_out + SIZE_21, SIZE_22 }, + { data2_out + SIZE_21 + SIZE_22, SIZE_23 }, + }; + struct iovec in_iovec[] = { + { data1_in, SIZE_23 }, + { data1_in + SIZE_23, SIZE_22 }, + { data1_in + SIZE_23 + SIZE_22, SIZE_21 }, + { data2_in, SIZE_13 }, + { data2_in + SIZE_13, SIZE_12 }, + { data2_in + SIZE_13 + SIZE_12, SIZE_11 }, + }; + + struct iovec *bogus_iov = tail_memdup(bogus_iovec, sizeof(bogus_iovec)); + struct iovec *lcl_iov = tail_memdup(lcl_iovec, sizeof(lcl_iovec)); + struct iovec *rmt_iov = tail_memdup(rmt_iovec, sizeof(rmt_iovec)); + + struct print_iov_arg bogus_arg = { ARRAY_SIZE(bogus_iovec), 1 }; + struct print_iov_arg lcl_arg = { ARRAY_SIZE(lcl_iovec), 1, 1, 0, 0, + 2, {SEGM1_BASE, SEGM2_BASE}, {SIZE_1, SIZE_2} }; + struct print_iov_arg rmt_arg = { ARRAY_SIZE(rmt_iovec), 1 }; + + struct print_iov_arg bogus_arg_cut = + { ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 }; + struct print_iov_arg lcl_arg_cut = + { ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, + {SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE}, + {SIZE_13, SIZE_2} }; + struct print_iov_arg rmt_arg_cut = + { ARRAY_SIZE(rmt_iovec) - 2, 1 }; + + + fill_memory_ex(data1_out, SIZE_1, SEGM1_BASE, SIZE_1); + fill_memory_ex(data2_out, SIZE_2, SEGM2_BASE, SIZE_2); + + + do_call(bogus_pid, (kernel_ulong_t) (uintptr_t) ARG_STR(NULL), + bogus_iovcnt1, (kernel_ulong_t) (uintptr_t) ARG_STR(NULL), + bogus_iovcnt2, bogus_flags, NULL); + + do_call(my_pid, ptr_cast(bogus_iov + ARRAY_SIZE(bogus_iovec)), + "[]", 0, ptr_cast(in_iov + ARRAY_SIZE(in_iovec)), "[]", + 0, 0, NULL); + do_call(my_pid, ptr_cast(bogus_iov + ARRAY_SIZE(bogus_iovec)), NULL, + bogus_iovcnt1, ptr_cast(in_iov + ARRAY_SIZE(in_iovec)), NULL, + bogus_iovcnt2, 0, print_iov); + + do_call(my_pid, ptr_cast(bogus_iov), (char *) &bogus_arg, + ARRAY_SIZE(bogus_iovec), ptr_cast(rmt_iov + 2), + (char *) &rmt_arg_cut, ARRAY_SIZE(rmt_iovec) - 2, 0, print_iov); + +#if !OP_WR + lcl_arg.check_rc = 1; + lcl_arg_cut.check_rc = 1; +#endif + + do_call(my_pid, ptr_cast(lcl_iov + 2), (char *) &lcl_arg_cut, + ARRAY_SIZE(lcl_iovec) - 1, ptr_cast(bogus_iov + 2), + (char *) &bogus_arg_cut, ARRAY_SIZE(bogus_iovec) - 1, 0, + print_iov); + + lcl_arg_cut.addr_term = 0; + + rmt_arg_cut.addr_term = 1; + rmt_arg_cut.count = 5; + + do_call(my_pid, ptr_cast(lcl_iov + 2), (char *) &lcl_arg_cut, + ARRAY_SIZE(lcl_iovec) - 2, ptr_cast(rmt_iov + 1), + (char *) &rmt_arg_cut, ARRAY_SIZE(rmt_iovec), 0, print_iov); + + /* Correct call */ + do_call(my_pid, ptr_cast(lcl_iov), (char *) &lcl_arg, + ARRAY_SIZE(lcl_iovec), ptr_cast(rmt_iov), (char *) &rmt_arg, + ARRAY_SIZE(rmt_iovec), 0, print_iov); + + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-m32/process_vm_writev.c b/tests-m32/process_vm_writev.c new file mode 100644 index 00000000..6271c01b --- /dev/null +++ b/tests-m32/process_vm_writev.c @@ -0,0 +1,18 @@ +#include "tests.h" + +#include + +#ifdef __NR_process_vm_writev + +# define OP process_vm_writev +# define OP_NR __NR_process_vm_writev +# define OP_STR "process_vm_writev" +# define OP_WR 1 + +# include "process_vm_readv_writev.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_process_vm_writev"); + +#endif diff --git a/tests-m32/process_vm_writev.test b/tests-m32/process_vm_writev.test new file mode 100755 index 00000000..f690e6a9 --- /dev/null +++ b/tests-m32/process_vm_writev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of process_vm_writev syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a38 diff --git a/tests-m32/pselect6.c b/tests-m32/pselect6.c new file mode 100644 index 00000000..f2644853 --- /dev/null +++ b/tests-m32/pselect6.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Based on test by Dr. David Alan Gilbert + */ + +#include "tests.h" +#include "nsig.h" +#include +#include +#include +#include +#include +#include + +#ifdef __NR_pselect6 + +static fd_set set[3][0x1000000 / sizeof(fd_set)]; + +static void +handler(int signo) +{ +} + +int main(int ac, char **av) +{ + int fds[2]; + struct { + struct timespec ts; + int pad[2]; + } tm_in = { + .ts = { .tv_sec = 0xc0de1, .tv_nsec = 0xc0de2 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, tm = tm_in; + sigset_t mask; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + + sigemptyset(&mask); + sigaddset(&mask, SIGHUP); + sigaddset(&mask, SIGCHLD); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + /* + * Start with a nice simple pselect. + */ + FD_SET(fds[0], set[0]); + FD_SET(fds[1], set[0]); + FD_SET(fds[0], set[1]); + FD_SET(fds[1], set[1]); + FD_SET(1, set[2]); + FD_SET(2, set[2]); + int rc = pselect(fds[1] + 1, set[0], set[1], set[2], NULL, NULL); + if (rc < 0) + perror_msg_and_skip("pselect"); + assert(rc == 1); + printf("pselect6(%d, [%d %d], [%d %d], [1 2], NULL, {NULL, %u}) " + "= 1 (out [%d])\n", + fds[1] + 1, fds[0], fds[1], + fds[0], fds[1], + NSIG_BYTES, fds[1]); + + /* + * Another simple one, with a timeout. + */ + FD_SET(1, set[1]); + FD_SET(2, set[1]); + FD_SET(fds[0], set[1]); + FD_SET(fds[1], set[1]); + assert(syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) == 3); + printf("pselect6(%d, NULL, [1 2 %d %d], NULL, " + "{tv_sec=%lld, tv_nsec=%lld}, NULL) = 3 (out [1 2 %d], left " + "{tv_sec=%lld, tv_nsec=%lld})\n", + fds[1] + 1, fds[0], fds[1], + (long long) tm_in.ts.tv_sec, (long long) tm_in.ts.tv_nsec, + fds[1], + (long long) tm.ts.tv_sec, (long long) tm.ts.tv_nsec); + + /* + * Now the crash case that trinity found, negative nfds + * but with a pointer to a large chunk of valid memory. + */ + FD_ZERO(set[0]); + FD_SET(fds[1],set[0]); + assert(pselect(-1, NULL, set[0], NULL, NULL, &mask) == -1); + printf("pselect6(-1, NULL, %p, NULL, NULL, {[HUP CHLD], %u}) " + "= -1 EINVAL (%m)\n", set[0], NSIG_BYTES); + + /* + * Another variant, with nfds exceeding FD_SETSIZE limit. + */ + FD_ZERO(set[0]); + FD_SET(fds[0],set[0]); + FD_ZERO(set[1]); + tm.ts.tv_sec = 0; + tm.ts.tv_nsec = 123; + assert(pselect(FD_SETSIZE + 1, set[0], set[1], NULL, &tm.ts, &mask) == 0); + printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}, " + "{[HUP CHLD], %u}) = 0 (Timeout)\n", + FD_SETSIZE + 1, fds[0], NSIG_BYTES); + + /* + * See how timeouts are decoded. + */ + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(setitimer(ITIMER_REAL, &itv, NULL) == 0); + + tm.ts.tv_nsec = 222222222; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, &mask) == -1); + printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}, " + "{[HUP CHLD], %u}) = " + "? ERESTARTNOHAND (To be restarted if no handler)\n", + NSIG_BYTES); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pselect6") + +#endif diff --git a/tests-m32/pselect6.test b/tests-m32/pselect6.test new file mode 100755 index 00000000..203f8e24 --- /dev/null +++ b/tests-m32/pselect6.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check pselect6 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/ptrace.c b/tests-m32/ptrace.c new file mode 100644 index 00000000..80ce8cbb --- /dev/null +++ b/tests-m32/ptrace.c @@ -0,0 +1,455 @@ +/* + * Check decoding of ptrace syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigprocmask + +# include +# include +# include +# include +# include +# include +# include "ptrace.h" +# include + +static const char *errstr; + +static long +do_ptrace(unsigned long request, unsigned long pid, + unsigned long addr, unsigned long data) +{ + long rc = syscall(__NR_ptrace, request, pid, addr, data); + errstr = sprintrc(rc); + return rc; +} + +static void +test_peeksiginfo(unsigned long pid, const unsigned long bad_request) +{ + do_ptrace(PTRACE_PEEKSIGINFO, pid, 0, bad_request); + printf("ptrace(PTRACE_PEEKSIGINFO, %u, NULL, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + struct { + unsigned long long off; + unsigned int flags, nr; + } *const psi = tail_alloc(sizeof(*psi)); + + psi->off = 0xdeadbeeffacefeedULL; + psi->flags = 1; + psi->nr = 42; + + do_ptrace(PTRACE_PEEKSIGINFO, pid, (unsigned long) psi, bad_request); + printf("ptrace(PTRACE_PEEKSIGINFO, %u, {off=%llu" + ", flags=PTRACE_PEEKSIGINFO_SHARED, nr=%u}, %#lx) = %s\n", + (unsigned) pid, psi->off, psi->nr, bad_request, errstr); + + pid = fork(); + if ((pid_t) pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGALRM); + + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + raise(SIGUSR1); + raise(SIGUSR2); + raise(SIGALRM); + + if (do_ptrace(PTRACE_TRACEME, 0, 0, 0)) + perror_msg_and_fail("child: PTRACE_TRACEME"); + + raise(SIGSTOP); + _exit(0); + } + + const unsigned int nsigs = 4; + const uid_t uid = geteuid(); + siginfo_t *sigs = tail_alloc(sizeof(*sigs) * nsigs); + + psi->off = 0; + psi->flags = 0; + psi->nr = nsigs; + + for (;;) { + int status, tracee, saved; + + errno = 0; + tracee = wait(&status); + if (tracee <= 0) { + if (errno == EINTR) + continue; + saved = errno; + kill (pid, SIGKILL); + errno = saved; + perror_msg_and_fail("wait"); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) + break; + error_msg_and_fail("unexpected exit status %u", + WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) + error_msg_and_fail("unexpected signal %u", + WTERMSIG(status)); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { + kill(pid, SIGKILL); + error_msg_and_fail("unexpected wait status %x", + status); + } + + long rc = do_ptrace(PTRACE_PEEKSIGINFO, pid, + (unsigned long) psi, (unsigned long) sigs); + if (rc < 0) { + printf("ptrace(PTRACE_PEEKSIGINFO, %u" + ", {off=%llu, flags=0, nr=%u}, %p) = %s\n", + (unsigned) pid, psi->off, psi->nr, sigs, + errstr); + } else { + printf("ptrace(PTRACE_PEEKSIGINFO, %u" + ", {off=%llu, flags=0, nr=%u}" + ", [{si_signo=SIGUSR1, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + ", {si_signo=SIGUSR2, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + ", {si_signo=SIGALRM, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + "]) = %s\n", + (unsigned) pid, psi->off, psi->nr, + (unsigned) pid, (unsigned) uid, + (unsigned) pid, (unsigned) uid, + (unsigned) pid, (unsigned) uid, + errstr); + } + + if (do_ptrace(PTRACE_CONT, pid, 0, 0)) { + saved = errno; + kill (pid, SIGKILL); + errno = saved; + perror_msg_and_fail("ptrace"); + } + printf("ptrace(PTRACE_CONT, %ld, NULL, SIG_0) = 0\n", pid); + } +} + +int +main(void) +{ + const unsigned long bad_request = + (unsigned long) 0xdeadbeeffffffeedULL; + const unsigned long bad_data = + (unsigned long) 0xdeadcafefffff00dULL; + const unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + + unsigned int sigset_size; + + for (sigset_size = 1024 / 8; sigset_size; sigset_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, + SIG_SETMASK, NULL, NULL, sigset_size)) + break; + } + if (!sigset_size) + perror_msg_and_fail("rt_sigprocmask"); + + void *const k_set = tail_alloc(sigset_size); + siginfo_t *const sip = tail_alloc(sizeof(*sip)); + + do_ptrace(bad_request, pid, 0, 0); + printf("ptrace(%#lx /* PTRACE_??? */, %u, NULL, NULL) = %s\n", + bad_request, (unsigned) pid, errstr); + + do_ptrace(PTRACE_PEEKDATA, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKDATA, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKDATA, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_PEEKTEXT, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_PEEKUSER, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKUSER, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKUSER, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_POKEUSER, pid, bad_request, bad_data); + printf("ptrace(PTRACE_POKEUSER, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); + + do_ptrace(PTRACE_ATTACH, pid, 0, 0); + printf("ptrace(PTRACE_ATTACH, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_INTERRUPT, pid, 0, 0); + printf("ptrace(PTRACE_INTERRUPT, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_KILL, pid, 0, 0); + printf("ptrace(PTRACE_KILL, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_LISTEN, pid, 0, 0); + printf("ptrace(PTRACE_LISTEN, %u) = %s\n", (unsigned) pid, errstr); + + sigset_t libc_set; + sigemptyset(&libc_set); + sigaddset(&libc_set, SIGUSR1); + memcpy(k_set, &libc_set, sigset_size); + + do_ptrace(PTRACE_SETSIGMASK, pid, sigset_size, (unsigned long) k_set); + printf("ptrace(PTRACE_SETSIGMASK, %u, %u, [USR1]) = %s\n", + (unsigned) pid, sigset_size, errstr); + + do_ptrace(PTRACE_GETSIGMASK, pid, sigset_size, (unsigned long) k_set); + printf("ptrace(PTRACE_GETSIGMASK, %u, %u, %p) = %s\n", + (unsigned) pid, sigset_size, k_set, errstr); + + do_ptrace(PTRACE_SECCOMP_GET_FILTER, pid, 42, 0); + printf("ptrace(PTRACE_SECCOMP_GET_FILTER, %u, 42, NULL) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_GETEVENTMSG, pid, bad_request, bad_data); + printf("ptrace(PTRACE_GETEVENTMSG, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGIO; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_band = -2; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGIO" + ", si_code=POLL_IN, si_errno=ENOENT, si_band=-2}) = %s\n", + (unsigned) pid, bad_request, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGTRAP; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_pid = 2; + sip->si_uid = 3; + sip->si_ptr = (void *) bad_request; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGTRAP" + ", si_code=TRAP_BRKPT, si_errno=ENOENT, si_pid=2, si_uid=3" + ", si_value={int=%d, ptr=%p}}) = %s\n", + (unsigned) pid, bad_request, sip->si_int, sip->si_ptr, + errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGILL; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGILL" + ", si_code=ILL_ILLOPC, si_errno=ENOENT, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_addr, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGFPE; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGFPE" + ", si_code=FPE_INTDIV, si_errno=ENOENT, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_addr, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGBUS; + sip->si_code = 1; + sip->si_errno = -2; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGBUS" + ", si_code=BUS_ADRALN, si_errno=%d, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_errno, sip->si_addr, + errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGPROF; + sip->si_code = 0xbadc0ded; + sip->si_errno = -2; + sip->si_pid = 0; + sip->si_uid = 3; + sip->si_ptr = 0; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGPROF" + ", si_code=%#x, si_errno=%d, si_pid=0, si_uid=3}) = %s\n", + (unsigned) pid, bad_request, sip->si_code, sip->si_errno, + errstr); + +#ifdef HAVE_SIGINFO_T_SI_SYSCALL + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGSYS; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_call_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + sip->si_syscall = -1U; + sip->si_arch = AUDIT_ARCH_X86_64; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGSYS" + ", si_code=SYS_SECCOMP, si_errno=ENOENT, si_call_addr=%p" + ", si_syscall=%u, si_arch=AUDIT_ARCH_X86_64})" + " = %s\n", + (unsigned) pid, bad_request, sip->si_call_addr, sip->si_syscall, + errstr); + + sip->si_errno = 3141592653U; + sip->si_call_addr = NULL; + sip->si_syscall = __NR_read; + sip->si_arch = 0xda7a1057; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGSYS" + ", si_code=SYS_SECCOMP, si_errno=%d, si_call_addr=NULL" + ", si_syscall=__NR_read, si_arch=%#x /* AUDIT_ARCH_??? */})" + " = %s\n", + (unsigned) pid, bad_request, sip->si_errno, sip->si_arch, + errstr); +#endif + +#if defined HAVE_SIGINFO_T_SI_TIMERID && defined HAVE_SIGINFO_T_SI_OVERRUN + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGHUP; + sip->si_code = SI_TIMER; + sip->si_errno = ENOENT; + sip->si_timerid = 0xdeadbeef; + sip->si_overrun = -1; + sip->si_ptr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGHUP" + ", si_code=SI_TIMER, si_errno=ENOENT, si_timerid=%#x" + ", si_overrun=%d, si_value={int=%d, ptr=%p}}) = %s\n", + (unsigned) pid, bad_request, sip->si_timerid, sip->si_overrun, + sip->si_int, sip->si_ptr, errstr); +#endif + + do_ptrace(PTRACE_GETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_GETSIGINFO, %u, %#lx, %p)" + " = %s\n", (unsigned) pid, bad_request, sip, errstr); + + do_ptrace(PTRACE_CONT, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_CONT, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_DETACH, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_DETACH, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_SYSCALL, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SYSCALL, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); + +#ifdef PTRACE_SINGLESTEP + do_ptrace(PTRACE_SINGLESTEP, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_SINGLESTEP, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); +#endif + +#ifdef PTRACE_SINGLEBLOCK + do_ptrace(PTRACE_SINGLEBLOCK, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SINGLEBLOCK, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); +#endif + +#ifdef PTRACE_SYSEMU + do_ptrace(PTRACE_SYSEMU, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_SYSEMU, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); +#endif +#ifdef PTRACE_SYSEMU_SINGLESTEP + do_ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SYSEMU_SINGLESTEP, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); +#endif + + do_ptrace(PTRACE_SETOPTIONS, + pid, 0, PTRACE_O_TRACEFORK|PTRACE_O_TRACECLONE); + printf("ptrace(PTRACE_SETOPTIONS, %u, NULL" + ", PTRACE_O_TRACEFORK|PTRACE_O_TRACECLONE) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_SEIZE, pid, bad_request, PTRACE_O_TRACESYSGOOD); + printf("ptrace(PTRACE_SEIZE, %u, %#lx, PTRACE_O_TRACESYSGOOD) = %s\n", + (unsigned) pid, bad_request, errstr); + + do_ptrace(PTRACE_SETREGSET, pid, 1, bad_request); + printf("ptrace(PTRACE_SETREGSET, %u, NT_PRSTATUS, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + do_ptrace(PTRACE_GETREGSET, pid, 3, bad_request); + printf("ptrace(PTRACE_GETREGSET, %u, NT_PRPSINFO, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + test_peeksiginfo(pid, bad_request); + + do_ptrace(PTRACE_TRACEME, 0, 0, 0); + printf("ptrace(PTRACE_TRACEME) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") + +#endif diff --git a/tests-m32/ptrace.test b/tests-m32/ptrace.test new file mode 100755 index 00000000..5add9be4 --- /dev/null +++ b/tests-m32/ptrace.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ptrace syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e signal=none diff --git a/tests-m32/pwritev.c b/tests-m32/pwritev.c new file mode 100644 index 00000000..58e5b41e --- /dev/null +++ b/tests-m32/pwritev.c @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PWRITEV + +# include +# include +# include +# include + +# define LEN 8 +# define LIM (LEN - 1) + +static void +print_iov(const struct iovec *iov) +{ + unsigned int i; + unsigned char *buf = iov->iov_base; + + fputs("{iov_base=\"", stdout); + for (i = 0; i < iov->iov_len; ++i) { + if (i < LIM) + printf("\\%d", (int) buf[i]); + } + printf("\"%s, iov_len=%u}", + i > LIM ? "..." : "", (unsigned) iov->iov_len); +} + +static void +print_iovec(const struct iovec *iov, unsigned int cnt, unsigned int size) +{ + if (!size) { + printf("%p", iov); + return; + } + unsigned int i; + putchar('['); + for (i = 0; i < cnt; ++i) { + if (i) + fputs(", ", stdout); + if (i == size) { + printf("%p", &iov[i]); + break; + } + if (i == LIM) { + fputs("...", stdout); + break; + } + print_iov(&iov[i]); + } + putchar(']'); +} + +int +main(void) +{ + (void) close(0); + if (open("/dev/null", O_WRONLY)) + perror_msg_and_fail("open"); + + char *buf = tail_alloc(LEN); + unsigned i; + for (i = 0; i < LEN; ++i) + buf[i] = i; + + struct iovec *iov = tail_alloc(sizeof(*iov) * LEN); + for (i = 0; i < LEN; ++i) { + buf[i] = i; + iov[i].iov_base = &buf[i]; + iov[i].iov_len = LEN - i; + } + + const off_t offset = 0xdefaceddeadbeefLL; + long rc; + int written = 0; + for (i = 0; i < LEN; ++i) { + written += iov[i].iov_len; + if (pwritev(0, iov, i + 1, offset + i) != written) + perror_msg_and_fail("pwritev"); + fputs("pwritev(0, ", stdout); + print_iovec(iov, i + 1, LEN); + printf(", %u, %lld) = %d\n", + i + 1, (long long) offset + i, written); + } + + for (i = 0; i <= LEN; ++i) { + unsigned int n = LEN + 1 - i; + fputs("pwritev(0, ", stdout); + print_iovec(iov + i, n, LEN - i); + rc = pwritev(0, iov + i, n, offset + LEN + i); + printf(", %u, %lld) = %ld %s (%m)\n", + n, (long long) offset + LEN + i, rc, errno2name()); + } + + iov->iov_base = iov + LEN * 2; + rc = pwritev(0, iov, 1, -1); + printf("pwritev(0, [{iov_base=%p, iov_len=%d}], 1, -1) = %ld %s (%m)\n", + iov->iov_base, LEN, rc, errno2name()); + + iov += LEN; + rc = pwritev(0, iov, 42, -2); + printf("pwritev(0, %p, 42, -2) = %ld %s (%m)\n", + iov, rc, errno2name()); + + rc = pwritev(0, NULL, 1, -3); + printf("pwritev(0, NULL, 1, -3) = %ld %s (%m)\n", + rc, errno2name()); + + rc = pwritev(0, iov, 0, -4); + printf("pwritev(0, [], 0, -4) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PWRITEV") + +#endif diff --git a/tests-m32/pwritev.test b/tests-m32/pwritev.test new file mode 100755 index 00000000..0aed6835 --- /dev/null +++ b/tests-m32/pwritev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check pwritev syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s7 diff --git a/tests-m32/qual_fault-exit_group.expected b/tests-m32/qual_fault-exit_group.expected new file mode 100644 index 00000000..dd9d4e46 --- /dev/null +++ b/tests-m32/qual_fault-exit_group.expected @@ -0,0 +1,3 @@ +exit_group(42) = -1 ENOSYS (Function not implemented) (INJECTED) +exit(42) = ? ++++ exited with 42 +++ diff --git a/tests-m32/qual_fault-exit_group.test b/tests-m32/qual_fault-exit_group.test new file mode 100755 index 00000000..c98ffc6e --- /dev/null +++ b/tests-m32/qual_fault-exit_group.test @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Check decoding of fault injected exit_group syscall. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/scno_tampering.sh" + +test_with() +{ + > "$LOG" || fail_ "failed to write $LOG" + + $STRACE -o "$LOG" "$@" + rc=$? + [ $rc -eq 42 ] || + dump_log_and_fail_with "$STRACE $* failed with code $rc" + + match_diff +} + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ./answer + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ + -efault=\!process:error=1 ./answer + +test_with -eexit,exit_group -efault=all:error=ENOSYS \ + -efault=exit:error=1:when=2+ ./answer + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ + -efault=\!desc,file,memory,process,signal,network,ipc:error=1 ./answer diff --git a/tests-m32/qual_fault-syntax.test b/tests-m32/qual_fault-syntax.test new file mode 100755 index 00000000..85093fc7 --- /dev/null +++ b/tests-m32/qual_fault-syntax.test @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Check -e fault= syntax. +# +# Copyright (c) 2016=2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# +# F +# F+ +# F+S + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e fault=$* failed to handle an argument error properly" +} + +for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ + invalid_syscall_name \ + invalid_syscall_name:when=3 \ + -1 \!-1 \ + -1:when=4 \ + -2 \ + -2:when=5 \ + 32767 \!32767 \ + 32767:when=6 \ + chdir:42 \!chdir:42 \ + chdir:42:when=7 \ + chdir:invalid \ + chdir:invalid:when=8 \ + chdir:error= \ + chdir:error=:when=10 \ + chdir:error=invalid_error_name \ + chdir:error=invalid_error_name:when=11 \ + chdir:error=-1 \ + chdir:error=-1:when=12 \ + chdir:error=-2 \ + chdir:error=-2:when=13 \ + chdir:error=3+ \ + chdir:error=3+:when=14 \ + chdir:error=4096 \ + chdir:error=4096:when=15 \ + chdir:when=7:error=invalid_error_name \ + chdir:when= \ + chdir:when=:error=19 \ + chdir:when=0 \ + chdir:when=0:error=20 \ + chdir:when=-1 \ + chdir:when=-1:error=21 \ + chdir:when=-2+ \ + chdir:when=-2+:error=22 \ + chdir:when=-3+0 \ + chdir:when=-3+0:error=23 \ + chdir:when=4- \ + chdir:when=4-:error=24 \ + chdir:when=5+- \ + chdir:when=5+-:error=25 \ + chdir:when=6++ \ + chdir:when=6++:error=26 \ + chdir:when=7+0 \ + chdir:when=7+0:error=27 \ + chdir:when=8+-1 \ + chdir:when=8+-1:error=28 \ + chdir:when=9+1+ \ + chdir:when=9+1+:error=29 \ + chdir:when=65536 \ + chdir:when=65536:error=30 \ + chdir:when=1+65536 \ + chdir:when=1+65536:error=31 \ + file,nonsense \ + \!desc,nonsense \ + chdir,nonsense \ + \!chdir,nonsense \ + 1,nonsense \ + \!1,nonsense \ + chdir:retval=0 \ + chdir:signal=1 \ + chdir:error=1:error=2 \ + ; do + $STRACE -e fault="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid fault argument' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests-m32/qual_fault.c b/tests-m32/qual_fault.c new file mode 100644 index 00000000..d26dc7ce --- /dev/null +++ b/tests-m32/qual_fault.c @@ -0,0 +1,148 @@ +/* + * Check that fault injection works properly. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static const int expfd = 4; +static const int gotfd = 5; + +#define DEFAULT_ERRNO ENOSYS + +static const char *errstr; +static int is_raw, err, first, step, iter, try; + +static void +invoke(int fail) +{ + static char buf[sizeof(int) * 3 + 3]; + const struct iovec io = { + .iov_base = buf, + .iov_len = sprintf(buf, "%d.", ++try) + }; + int rc; + + if (!fail) { + rc = write(expfd, io.iov_base, io.iov_len); + if (rc != (int) io.iov_len) + perror_msg_and_fail("write"); + } + + errno = 0; + rc = writev(gotfd, &io, 1); + + if (fail) { + if (!(rc == -1 && errno == err)) + perror_msg_and_fail("expected errno %d" + ", got rc == %d, errno == %d", + err, rc, errno); + + if (is_raw) + tprintf("writev(%#x, %p, 0x1) = -1 (errno %d)" + " (INJECTED)\n", gotfd, &io, err); + else + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" + " = -1 %s (%m) (INJECTED)\n", + gotfd, buf, (int) io.iov_len, errstr); + } else { + if (rc != (int) io.iov_len) + perror_msg_and_fail("expected %d" + ", got rc == %d, errno == %d", + (int) io.iov_len, rc, errno); + + if (is_raw) + tprintf("writev(%#x, %p, 0x1) = %#x\n", gotfd, &io, rc); + else + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" + " = %d\n", + gotfd, buf, (int) io.iov_len, (int) io.iov_len); + } +} + +int +main(int argc, char *argv[]) +{ + struct stat st; + + assert(fstat(expfd, &st) == 0); + assert(fstat(gotfd, &st) == 0); + + assert(argc == 6); + + is_raw = !strcmp("raw", argv[1]); + + errstr = argv[2]; + err = atoi(errstr); + assert(err >= 0); + + if (!err) { + if (!*errstr) + err = DEFAULT_ERRNO; + else if (!strcasecmp(errstr, "EINVAL")) + err = EINVAL; + else + err = ENOSYS; + } + + errno = err; + errstr = errno2name(); + + first = atoi(argv[3]); + step = atoi(argv[4]); + iter = atoi(argv[5]); + + assert(first > 0); + assert(step >= 0); + + tprintf("%s", ""); + + int i; + for (i = 1; i <= iter; ++i) { + int fail = 0; + if (first > 0) { + --first; + if (first == 0) { + fail = 1; + first = step; + } + } + invoke(fail); + } + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/qual_fault.test b/tests-m32/qual_fault.test new file mode 100755 index 00000000..e194a787 --- /dev/null +++ b/tests-m32/qual_fault.test @@ -0,0 +1,104 @@ +#!/bin/sh +# +# Check that fault injection works properly. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/scno_tampering.sh" + +# +# F +# F+ +# F+S + +N=16 + +check_fault_injection() +{ + local trace fault err first step extra + trace=$1; shift + fault=$1; shift + err=$1; shift + first=$1; shift + step=$1; shift + extra="$*" + + local when= + if [ -z "$first$step" ]; then + first=1 + step=1 + else + case "$step" in + '') when=":when=$first"; step=0 ;; + +) when=":when=$first+"; step=1 ;; + *) when=":when=$first+$step" ;; + esac + fi + + local error= + local raw=reg + set -- + case "$err" in + '') ;; + [123456789]*) + error=":error=$err" + raw=raw + set -- -e raw=all + ;; + *) error=":error=$err" ;; + esac + + outexp="$NAME.out.exp" + outgot="$NAME.out.got" + + run_strace -a11 -e trace=$trace \ + "$@" -e fault=$fault$when$error $extra \ + ./$NAME $raw "$err" "$first" "$step" $N \ + > "$EXP" 4> "$outexp" 5> "$outgot" + + match_diff "$EXP" "$LOG" + match_diff "$outexp" "$outgot" + rm -f "$EXP" "$outexp" "$outgot" +} + +for err in '' ENOSYS 22 einval; do + for fault in writev desc,51; do + check_fault_injection \ + writev $fault "$err" '' '' -efault=chdir + check_fault_injection \ + writev $fault "$err" '' '' -efault=chdir -efault=none + for F in 1 2 3 5 7 11; do + check_fault_injection \ + writev $fault "$err" $F '' + check_fault_injection \ + writev $fault "$err" $F + + for S in 1 2 3 5 7 11; do + check_fault_injection \ + writev $fault "$err" $F $S + done + done + done +done diff --git a/tests-m32/qual_inject-error-signal.c b/tests-m32/qual_inject-error-signal.c new file mode 100644 index 00000000..f4ccd824 --- /dev/null +++ b/tests-m32/qual_inject-error-signal.c @@ -0,0 +1,69 @@ +/* + * Check fault injection along with signal injection. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +static struct stat before, after; + +static void +handler(int sig) +{ + if (stat(".", &after)) + syscall(__NR_exit_group, 2); + + if (before.st_dev != after.st_dev || before.st_ino != after.st_ino) + syscall(__NR_exit_group, 3); + + syscall(__NR_exit_group, 0); +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + if (stat(".", &before)) + perror_msg_and_fail("stat"); + + syscall(__NR_chdir, "."); + syscall(__NR_exit_group, 1); + return 1; +} diff --git a/tests-m32/qual_inject-error-signal.expected b/tests-m32/qual_inject-error-signal.expected new file mode 100644 index 00000000..24389b37 --- /dev/null +++ b/tests-m32/qual_inject-error-signal.expected @@ -0,0 +1,4 @@ +chdir(".") = -1 ENOENT (No such file or directory) (INJECTED) +--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_KERNEL} --- +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests-m32/qual_inject-error-signal.test b/tests-m32/qual_inject-error-signal.test new file mode 100755 index 00000000..fcbcc398 --- /dev/null +++ b/tests-m32/qual_inject-error-signal.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check fault injection along with signal injection. +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a12 -echdir,exit_group -einject=chdir:error=ENOENT:signal=USR1 \ + "./$NAME" +match_diff diff --git a/tests-m32/qual_inject-retval.c b/tests-m32/qual_inject-retval.c new file mode 100644 index 00000000..ac9801eb --- /dev/null +++ b/tests-m32/qual_inject-retval.c @@ -0,0 +1,73 @@ +/* + * Check success injection. + * + * Copyright (c) 2017 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_chdir + +# include +# include +# include +# include +# include + +int +main(int argc, char *argv[]) +{ + assert(argc == 2); + + static const char dir[] = ".."; + struct stat before, after; + + if (stat(".", &before)) + perror_msg_and_fail("stat"); + + long rval = syscall(__NR_chdir, dir); + + if (stat(".", &after)) + perror_msg_and_fail("stat"); + + if (before.st_dev != after.st_dev || before.st_ino != after.st_ino) + error_msg_and_fail("syscall succeeded"); + if (atol(argv[1]) != rval) + error_msg_and_fail("expected retval %s, got retval %ld", + argv[1], rval); + + printf("chdir(\"%s\") = %ld (INJECTED)\n", dir, rval); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chdir") + +#endif diff --git a/tests-m32/qual_inject-retval.test b/tests-m32/qual_inject-retval.test new file mode 100755 index 00000000..419030ad --- /dev/null +++ b/tests-m32/qual_inject-retval.test @@ -0,0 +1,21 @@ +#!/bin/sh + +# Check success injection. + +. "${srcdir=.}/scno_tampering.sh" + +check_injection() +{ + local syscall rval + + syscall=chdir + rval="$1"; shift + + run_strace -a12 -e$syscall -einject="$syscall:retval=$rval" "$@" \ + ./qual_inject-retval "$rval" > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +check_injection 0 +check_injection 42 diff --git a/tests-m32/qual_inject-signal.c b/tests-m32/qual_inject-signal.c new file mode 100644 index 00000000..ff56a286 --- /dev/null +++ b/tests-m32/qual_inject-signal.c @@ -0,0 +1,57 @@ +/* + * Check that signal injection works properly. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +static void +handler(int sig) +{ + syscall(__NR_exit_group, 0); +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + syscall(__NR_chdir, "."); + syscall(__NR_exit_group, 1); + return 1; +} diff --git a/tests-m32/qual_inject-signal.expected b/tests-m32/qual_inject-signal.expected new file mode 100644 index 00000000..69a1d979 --- /dev/null +++ b/tests-m32/qual_inject-signal.expected @@ -0,0 +1,4 @@ +chdir(".") = 0 +--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_KERNEL} --- +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests-m32/qual_inject-signal.test b/tests-m32/qual_inject-signal.test new file mode 100755 index 00000000..88002ce9 --- /dev/null +++ b/tests-m32/qual_inject-signal.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check signal injection. +. "${srcdir=.}/init.sh" + +run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1 \ + ./$NAME +match_diff diff --git a/tests-m32/qual_inject-syntax.test b/tests-m32/qual_inject-syntax.test new file mode 100755 index 00000000..a9e44d74 --- /dev/null +++ b/tests-m32/qual_inject-syntax.test @@ -0,0 +1,118 @@ +#!/bin/sh +# +# Check -e inject= syntax. +# +# Copyright (c) 2016-2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# +# F +# F+ +# F+S + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e inject=$* failed to handle an argument error properly" +} + +for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ + invalid_syscall_name \ + invalid_syscall_name:when=3 \ + -1 \!-1 \ + -1:when=4 \ + -2 \ + -2:when=5 \ + 32767 \!32767 \ + 32767:when=6 \ + 42 \ + chdir \ + chdir:42 \!chdir:42 \ + chdir:42:when=7 \ + chdir:invalid \ + chdir:invalid:when=8 \ + chdir:error= \ + chdir:error=:when=10 \ + chdir:error=invalid_error_name \ + chdir:error=invalid_error_name:when=11 \ + chdir:error=-1 \ + chdir:error=-1:when=12 \ + chdir:error=-2 \ + chdir:error=-2:when=13 \ + chdir:error=3+ \ + chdir:error=3+:when=14 \ + chdir:error=4096 \ + chdir:error=4096:when=15 \ + chdir:when=7:error=invalid_error_name \ + chdir:when= \ + chdir:when=:error=19 \ + chdir:when=0 \ + chdir:when=0:error=20 \ + chdir:when=-1 \ + chdir:when=-1:error=21 \ + chdir:when=-2+ \ + chdir:when=-2+:error=22 \ + chdir:when=-3+0 \ + chdir:when=-3+0:error=23 \ + chdir:when=4- \ + chdir:when=4-:error=24 \ + chdir:when=5+- \ + chdir:when=5+-:error=25 \ + chdir:when=6++ \ + chdir:when=6++:error=26 \ + chdir:when=7+0 \ + chdir:when=7+0:error=27 \ + chdir:when=8+-1 \ + chdir:when=8+-1:error=28 \ + chdir:when=9+1+ \ + chdir:when=9+1+:error=29 \ + chdir:when=65536 \ + chdir:when=65536:error=30 \ + chdir:when=1+65536 \ + chdir:when=1+65536:error=31 \ + file,nonsense \ + \!desc,nonsense \ + chdir,nonsense \ + \!chdir,nonsense \ + 1,nonsense \ + \!1,nonsense \ + chdir:retval=-1 \ + chdir:signal=0 \ + chdir:signal=129 \ + chdir:retval=0:retval=1 \ + chdir:error=1:error=2 \ + chdir:retval=0:error=1 \ + chdir:error=1:retval=0 \ + chdir:retval=0:signal=1:error=1 \ + ; do + $STRACE -e inject="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid inject argument' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests-m32/qual_signal.c b/tests-m32/qual_signal.c new file mode 100644 index 00000000..106dabea --- /dev/null +++ b/tests-m32/qual_signal.c @@ -0,0 +1,82 @@ +/* + * Check how strace -e signal=set works. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static pid_t pid; +static uid_t uid; + +static void +handler(int sig) +{ +} + +static void +test_sig(int signo, const char *name) +{ + const struct sigaction act = { .sa_handler = handler }; + + if (sigaction(signo, &act, NULL)) + perror_msg_and_fail("sigaction: %d", signo); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, signo); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask: %d", signo); + + if (kill(pid, signo)) + perror_msg_and_fail("kill(%d, %d)", pid, signo); + + if (name && *name) + printf("--- %s {si_signo=%s, si_code=SI_USER" + ", si_pid=%d, si_uid=%d} ---\n", + name, name, pid, uid); +} + +int +main(int ac, const char **av) +{ + assert(ac & 1); + + pid = getpid(); + uid = geteuid(); + + int i; + for (i = 1; i < ac; i += 2) + test_sig(atoi(av[i]), av[i + 1]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/qual_signal.test b/tests-m32/qual_signal.test new file mode 100755 index 00000000..54a37a30 --- /dev/null +++ b/tests-m32/qual_signal.test @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Check how strace -e signal=set works. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +test_one_sig() +{ + local sigs + sigs="$1"; shift + + run_prog "./$NAME" "$@" > /dev/null + run_strace -e trace=none -e signal="$sigs" "./$NAME" "$@" > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +test_sigs() +{ + local first second sigs + first="$1"; shift + second="$1"; shift + + for sigs; do + test_one_sig "$sigs" 2 "$first" 15 "$second" + done +} + +test_sigs '' '' \ + none '!all' \ + CHLD SIGCHLD ALRM SIGALRM \ + chld sigchld alrm sigalrm \ + CHLD,SIGALRM ALRM,SIGCHLD \ + chld,sigalrm alrm,sigchld \ + 9 9,4 9,4,11 \ + 4,CHLD,11,ALRM,9 \ + '!2,15' '!INT,TERM' '!SIGINT,TERM' '!INT,SIGTERM' '!SIGTERM,SIGINT' \ + '!2,INT,TERM' '!2,SIGTERM' '!SIGINT,15' '!INT,SIGTERM,15' \ + '!2,4,15' '!15,9,2,11,4' + +test_sigs SIGINT '' \ + 2 INT SIGINT \ + CHLD,SIGINT SIGINT,SIGALRM \ + chld,sigint sigint,sigalrm \ + ALRM,2,SIGCHLD \ + '!15' '!TERM' '!SIGTERM' \ + '!15,TERM' '!SIGTERM,15,TERM' \ + '!SIGALRM,TERM' '!CHLD,SIGTERM' \ + '!ALRM,15' '!SIGCHLD,ALRM,SIGTERM,KILL' \ + '!4,15' '!15,9,11,4' + +test_sigs '' SIGTERM \ + 15 TERM SIGTERM \ + CHLD,SIGTERM SIGTERM,SIGALRM \ + chld,sigterm sigterm,sigalrm \ + ALRM,15,SIGCHLD \ + '!2' '!INT' '!SIGINT' \ + '!2,INT' '!SIGINT,2,INT' \ + '!SIGALRM,INT' '!CHLD,SIGINT' \ + '!ALRM,2' '!SIGCHLD,ALRM,SIGINT,KILL' \ + '!4,2' '!2,9,11,4' + +test_sigs SIGINT SIGTERM \ + all '!none' \ + INT,TERM SIGINT,TERM SIGTERM,INT SIGINT,SIGTERM \ + int,term sigint,term sigterm,int sigint,sigterm \ + 2,15 2,TERM SIGTERM,2 TERM,15,SIGINT,2 \ + '!CHLD' '!SIGCHLD' '!ALRM' '!SIGALRM' \ + '!CHLD,SIGALRM' '!ALRM,SIGCHLD' \ + '!9' '!9,4' '!9,4,11' '!4,CHLD,11,ALRM,9' + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e signal=$* failed to handle an argument error properly" +} + +for arg in ' ' invalid_signal_name SIG -1 256 1-1 \ + 1,2,4,8,16,32,64,128,256,512,1024 9,chdir; do + $STRACE -e signal="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid signal' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests-m32/qual_syscall.test b/tests-m32/qual_syscall.test new file mode 100755 index 00000000..f7eb06d5 --- /dev/null +++ b/tests-m32/qual_syscall.test @@ -0,0 +1,59 @@ +#!/bin/sh + +# Check how strace -e abbrev=set, -e raw=set, -e trace=set, +# and -e verbose=set work. + +. "${srcdir=.}/init.sh" + +run_prog ./umovestr +pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0' +pattern_nonabbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' +pattern_nonverbose='execve("\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' +pattern_raw='execve(0x[[:xdigit:]]*, 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' + +check_output_mismatch() +{ + local pattern + pattern="$1"; shift + run_strace "$@" ./umovestr + LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || { + printf '%s\n%s\n' \ + 'Failed patterns of expected output:' "$pattern" + dump_log_and_fail_with "$STRACE $args output mismatch" + } +} + +check_output_mismatch "$pattern_abbrev_verbose" -e execve +LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | +LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +LC_ALL=C grep '^chdir' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +run_strace -e 42 ./umovestr +LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +for a in execve \!chdir all \!none \ + file process \!desc \!ipc \!memory \!network \!signal; do + check_output_mismatch \ + "$pattern_abbrev_verbose" -e abbrev="$a" -e execve + check_output_mismatch \ + "$pattern_raw" -a22 -e raw="$a" -e execve + check_output_mismatch \ + "$pattern_abbrev_verbose" -e verbose="$a" -e execve +done + +for a in \!execve chdir 42 \!all none \ + \!file \!process desc ipc memory network signal; do + check_output_mismatch \ + "$pattern_nonabbrev_verbose" -e abbrev="$a" -e execve + check_output_mismatch \ + "$pattern_abbrev_verbose" -e raw="$a" -e execve + check_output_mismatch \ + "$pattern_nonverbose" -a31 -e verbose="$a" -e execve +done + +exit 0 diff --git a/tests-m32/quotactl-v.c b/tests-m32/quotactl-v.c new file mode 100644 index 00000000..00139649 --- /dev/null +++ b/tests-m32/quotactl-v.c @@ -0,0 +1,3 @@ +/* This file is part of quotactl-v strace test. */ +#define VERBOSE 1 +#include "quotactl.c" diff --git a/tests-m32/quotactl-v.test b/tests-m32/quotactl-v.test new file mode 100755 index 00000000..6adaf82c --- /dev/null +++ b/tests-m32/quotactl-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check non-abbreviated decoding of quotactl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-m32/quotactl-xfs-v.c b/tests-m32/quotactl-xfs-v.c new file mode 100644 index 00000000..21173d63 --- /dev/null +++ b/tests-m32/quotactl-xfs-v.c @@ -0,0 +1,3 @@ +/* This file is part of quotactl-xfs-v strace test. */ +#define VERBOSE 1 +#include "quotactl-xfs.c" diff --git a/tests-m32/quotactl-xfs-v.test b/tests-m32/quotactl-xfs-v.test new file mode 100755 index 00000000..d5ffc7d6 --- /dev/null +++ b/tests-m32/quotactl-xfs-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check non-abbreviated decoding of quotactl xfs subcommands. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-m32/quotactl-xfs.c b/tests-m32/quotactl-xfs.c new file mode 100644 index 00000000..e420d1c9 --- /dev/null +++ b/tests-m32/quotactl-xfs.c @@ -0,0 +1,354 @@ +/* + * Check decoding of quotactl xfs subcommands. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_quotactl) && \ + (defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_SYS_QUOTA_H)) && \ + defined(HAVE_LINUX_DQBLK_XFS_H) + +# include +# include +# include + +# include + +# include "quotactl.h" + +# ifndef Q_GETNEXTQUOTA +# define Q_XGETNEXTQUOTA XQM_CMD(0x9) +# endif /* !Q_GETNEXTQUOTA */ + +# ifndef Q_XGETQSTATV + +# define Q_XGETQSTATV XQM_CMD(8) +# define FS_QSTATV_VERSION1 1 + +struct fs_qfilestatv { + uint64_t qfs_ino; /* inode number */ + uint64_t qfs_nblks; /* number of BBs 512-byte-blks */ + uint32_t qfs_nextents; /* number of extents */ + uint32_t qfs_pad; /* pad for 8-byte alignment */ +}; + +struct fs_quota_statv { + int8_t qs_version; /* version for future changes */ + uint8_t qs_pad1; /* pad for 16bit alignment */ + uint16_t qs_flags; /* XFS_QUOTA_.* flags */ + uint32_t qs_incoredqs; /* number of dquots incore */ + struct fs_qfilestatv qs_uquota; /* user quota information */ + struct fs_qfilestatv qs_gquota; /* group quota information */ + struct fs_qfilestatv qs_pquota; /* project quota information */ + int32_t qs_btimelimit; /* limit for blks timer */ + int32_t qs_itimelimit; /* limit for inodes timer */ + int32_t qs_rtbtimelimit; /* limit for rt blks timer */ + uint16_t qs_bwarnlimit; /* limit for num warnings */ + uint16_t qs_iwarnlimit; /* limit for num warnings */ + uint64_t qs_pad2[8]; /* for future proofing */ +}; + +# endif /* !Q_XGETQSTATV */ + +# include "xlat.h" +# include "xlat/xfs_dqblk_flags.h" +# if VERBOSE +# include "xlat/xfs_quota_flags.h" +# endif + + +void +print_xdisk_quota(int rc, void *ptr, void *arg) +{ + struct fs_disk_quota *dq = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", dq); + return; + } + + PRINT_FIELD_D("{", dq, d_version); + printf(", d_flags="); + printflags(xfs_dqblk_flags, (uint8_t) dq->d_flags, "XFS_???_QUOTA"); + + PRINT_FIELD_X(", ", dq, d_fieldmask); + PRINT_FIELD_U(", ", dq, d_id); + PRINT_FIELD_U(", ", dq, d_blk_hardlimit); + PRINT_FIELD_U(", ", dq, d_blk_softlimit); + PRINT_FIELD_U(", ", dq, d_ino_hardlimit); + PRINT_FIELD_U(", ", dq, d_ino_softlimit); + PRINT_FIELD_U(", ", dq, d_bcount); + PRINT_FIELD_U(", ", dq, d_icount); + +# if VERBOSE + PRINT_FIELD_D(", ", dq, d_itimer); + PRINT_FIELD_D(", ", dq, d_btimer); + PRINT_FIELD_U(", ", dq, d_iwarns); + PRINT_FIELD_U(", ", dq, d_bwarns); + PRINT_FIELD_U(", ", dq, d_rtb_hardlimit); + PRINT_FIELD_U(", ", dq, d_rtb_softlimit); + PRINT_FIELD_U(", ", dq, d_rtbcount); + PRINT_FIELD_D(", ", dq, d_rtbtimer); + PRINT_FIELD_U(", ", dq, d_rtbwarns); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_xquota_stat(int rc, void *ptr, void *arg) +{ + struct fs_quota_stat *qs = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", qs); + return; + } + + PRINT_FIELD_D("{", qs, qs_version); + +# if VERBOSE + printf(", qs_flags="); + printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, ", qs, qs_incoredqs); + PRINT_FIELD_D(", ", qs, qs_btimelimit); + PRINT_FIELD_D(", ", qs, qs_itimelimit); + PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", qs, qs_iwarnlimit); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_xquota_statv(int rc, void *ptr, void *arg) +{ + struct fs_quota_statv *qs = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", qs); + return; + } + + PRINT_FIELD_D("{", qs, qs_version); + +# if VERBOSE + printf(", qs_flags="); + printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", ", qs, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, qs_pquota={", &qs->qs_pquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nextents); + PRINT_FIELD_D("}, ", qs, qs_btimelimit); + PRINT_FIELD_D(", ", qs, qs_itimelimit); + PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", qs, qs_iwarnlimit); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +int +main(void) +{ + char *bogus_special = (char *) tail_alloc(1) + 1; + void *bogus_addr = (char *) tail_alloc(1) + 1; + + char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; + char bogus_addr_str[sizeof(void *) * 2 + sizeof("0x")]; + char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; + + long rc; + struct fs_disk_quota *xdq = tail_alloc(sizeof(*xdq)); + struct fs_quota_stat *xqstat = tail_alloc(sizeof(*xqstat)); + struct fs_quota_statv *xqstatv = tail_alloc(sizeof(*xqstatv)); + uint32_t *flags = tail_alloc(sizeof(*flags)); + char *unterminated = tail_memdup(unterminated_data, + sizeof(unterminated_data)); + + snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", + bogus_special); + snprintf(bogus_addr_str, sizeof(bogus_addr_str), "%p", + bogus_addr); + snprintf(unterminated_str, sizeof(unterminated_str), "%p", + unterminated); + + + /* Q_XQUOTAON */ + + *flags = 0xdeadbeef; + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), flags, + "[XFS_QUOTA_UDQ_ACCT|XFS_QUOTA_UDQ_ENFD" + "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" + "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); + + rc = syscall(__NR_quotactl, QCMD(Q_XQUOTAON, 0xfacefeed), bogus_dev, + bogus_id, bogus_addr); + printf("quotactl(QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)" + ", %s, %p) = %s\n", + QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed)), + bogus_dev_str, bogus_addr, sprintrc(rc)); + + + /* Q_XQUOTAOFF */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAOFF, USRQUOTA)), + bogus_special, bogus_special_str, + bogus_addr, bogus_addr_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAOFF, GRPQUOTA)), + ARG_STR("/dev/bogus/"), + ARG_STR(NULL)); + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + QCMD(Q_XQUOTAOFF, 3), + "QCMD(Q_XQUOTAOFF, 0x3 /* ???QUOTA */)", + ARG_STR("/dev/bogus/"), flags, + "[XFS_QUOTA_UDQ_ACCT|XFS_QUOTA_UDQ_ENFD" + "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" + "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); + + + /* Q_XGETQUOTA */ + + /* Trying our best to get successful result */ + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), getuid(), xdq, print_xdisk_quota, + (intptr_t) 1); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 2); + + + /* Q_XGETNEXTQUOTA */ + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETNEXTQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), 0, xdq, print_xdisk_quota, + (intptr_t) 1); + + + /* Q_XSETQLIM */ + + check_quota(CQF_NONE, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), + bogus_special, bogus_special_str, 0, bogus_addr); + + fill_memory_ex(xdq, sizeof(*xdq), 0x8e, 0x80); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), + bogus_dev, bogus_dev_str, 3141592653U, + xdq, print_xdisk_quota, (intptr_t) 0); + + + /* Q_XGETQSTAT */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstat, print_xquota_stat, (intptr_t) 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + unterminated, unterminated_str, + xqstat + 1, print_xquota_stat, (intptr_t) 2); + + + /* Q_XGETQSTATV */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTATV, GRPQUOTA)), + ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 2); + + + /* Q_XQUOTARM */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTARM, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XQUOTARM, USRQUOTA)), + unterminated, unterminated_str, flags + 1); + + *flags = 0xdeadbeef; + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTARM, GRPQUOTA)), + ARG_STR(NULL), flags, + "[XFS_USER_QUOTA|XFS_PROJ_QUOTA" + "|XFS_GROUP_QUOTA|0xdeadbee8]"); + + + /* Q_XQUOTASYNC */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_XQUOTASYNC, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_XQUOTASYNC, 0xfff), + "QCMD(Q_XQUOTASYNC, 0xff /* ???QUOTA */)", + ARG_STR(NULL)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_quotactl && " + "(HAVE_LINUX_QUOTA_H || HAVE_SYS_QUOTA_H) && " + "HAVE_LINUX_DQBLK_XFS_H"); + +#endif diff --git a/tests-m32/quotactl-xfs.test b/tests-m32/quotactl-xfs.test new file mode 100755 index 00000000..404a7372 --- /dev/null +++ b/tests-m32/quotactl-xfs.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of quotactl xfs subcommands. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=quotactl diff --git a/tests-m32/quotactl.c b/tests-m32/quotactl.c new file mode 100644 index 00000000..3a7c1132 --- /dev/null +++ b/tests-m32/quotactl.c @@ -0,0 +1,320 @@ +/* + * Check decoding of quotactl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_quotactl) && \ + (defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_SYS_QUOTA_H)) + +# include +# include +# include +# include +# include + +# include "quotactl.h" + +# ifndef HAVE_LINUX_QUOTA_H +/* Some dirty hacks in order to make sys/quota.h usable as a backup */ + +# define if_dqblk dqblk +# define if_nextdqblk nextdqblk +# define if_dqinfo dqinfo + +# endif /* !HAVE_LINUX_QUOTA_H */ + +# ifndef Q_GETNEXTQUOTA + +# define Q_GETNEXTQUOTA 0x800009 + +struct if_nextdqblk { + uint64_t dqb_bhardlimit; + uint64_t dqb_bsoftlimit; + uint64_t dqb_curspace; + uint64_t dqb_ihardlimit; + uint64_t dqb_isoftlimit; + uint64_t dqb_curinodes; + uint64_t dqb_btime; + uint64_t dqb_itime; + uint32_t dqb_valid; + uint32_t dqb_id; +}; +# endif /* !Q_GETNEXTQUOTA */ + +# include "xlat.h" +# include "xlat/quota_formats.h" +# include "xlat/if_dqblk_valid.h" +# include "xlat/if_dqinfo_flags.h" +# include "xlat/if_dqinfo_valid.h" + +void +print_dqblk(long rc, void *ptr, void *arg) +{ + struct if_dqblk *db = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", db); + return; + } + + PRINT_FIELD_U("{", db, dqb_bhardlimit); + PRINT_FIELD_U(", ", db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", db, dqb_curspace); + PRINT_FIELD_U(", ", db, dqb_ihardlimit); + PRINT_FIELD_U(", ", db, dqb_isoftlimit); + PRINT_FIELD_U(", ", db, dqb_curinodes); + +# if VERBOSE + PRINT_FIELD_U(", ", db, dqb_btime); + PRINT_FIELD_U(", ", db, dqb_itime); + + printf(", dqb_valid="); + printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_nextdqblk(long rc, void *ptr, void *arg) +{ + struct if_nextdqblk *db = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", db); + return; + } + + PRINT_FIELD_U("{", db, dqb_bhardlimit); + PRINT_FIELD_U(", ", db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", db, dqb_curspace); + PRINT_FIELD_U(", ", db, dqb_ihardlimit); + PRINT_FIELD_U(", ", db, dqb_isoftlimit); + PRINT_FIELD_U(", ", db, dqb_curinodes); + +# if VERBOSE + PRINT_FIELD_U(", ", db, dqb_btime); + PRINT_FIELD_U(", ", db, dqb_itime); + + printf(", dqb_valid="); + printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); + + PRINT_FIELD_U(", ", db, dqb_id); +# else + PRINT_FIELD_U(", ", db, dqb_id); + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_dqinfo(long rc, void *ptr, void *arg) +{ + struct if_dqinfo *di = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", di); + return; + } + + PRINT_FIELD_U("{", di, dqi_bgrace); + PRINT_FIELD_U(", ", di, dqi_igrace); + + printf(", dqi_flags="); + printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); + printf(", dqi_valid="); + printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); + printf("}"); +} + + +int +main(void) +{ + char *bogus_special = (char *) tail_alloc(1) + 1; + void *bogus_addr = (char *) tail_alloc(1) + 1; + + char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; + char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; + + long rc; + char *unterminated = tail_memdup(unterminated_data, + sizeof(unterminated_data)); + struct if_dqblk *dqblk = tail_alloc(sizeof(*dqblk)); + struct if_dqinfo *dqinfo = tail_alloc(sizeof(*dqinfo)); + uint32_t *fmt = tail_alloc(sizeof(*fmt)); + struct if_nextdqblk *nextdqblk = tail_alloc(sizeof(*nextdqblk)); + + + snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", + bogus_special); + snprintf(unterminated_str, sizeof(unterminated_str), "%p", + unterminated); + + + /* Invalid commands */ + + rc = syscall(__NR_quotactl, bogus_cmd, bogus_special, bogus_id, + bogus_addr); + printf("quotactl(QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)" + ", %p, %u, %p) = %s\n", + QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd), + bogus_special, bogus_id, bogus_addr, sprintrc(rc)); + + rc = syscall(__NR_quotactl, 0, NULL, -1, NULL); + printf("quotactl(QCMD(0 /* Q_??? */, USRQUOTA), NULL, -1, NULL) = %s\n", + sprintrc(rc)); + + + /* Q_QUOTAON */ + + check_quota(CQF_ID_STR | CQF_ADDR_STR, + ARG_STR(QCMD(Q_QUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), ARG_STR(QFMT_VFS_OLD), + ARG_STR("/tmp/bogus/")); + + rc = syscall(__NR_quotactl, QCMD(Q_QUOTAON, 0xfacefeed), bogus_dev, + bogus_id, bogus_addr); + printf("quotactl(QCMD(Q_QUOTAON, %#x /* ???QUOTA */)" + ", %s, %#x /* QFMT_VFS_??? */, %p) = %s\n", + QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed)), + bogus_dev_str, bogus_id, bogus_addr, sprintrc(rc)); + + + /* Q_QUOTAOFF */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), + ARG_STR("/dev/bogus/")); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_QUOTAOFF, 3), "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)", + ARG_STR(NULL)); + + + /* Q_GETQUOTA */ + + /* Trying our best to get successful result */ + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), getuid(), dqblk, print_dqblk, + (intptr_t) 1); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 2); + + + /* Q_GETNEXTQUOTA */ + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), 0, nextdqblk, print_nextdqblk, + (intptr_t) 1); + + + /* Q_SETQUOTA */ + + fill_memory(dqblk, sizeof(*dqblk)); + + check_quota(CQF_NONE, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + bogus_special, bogus_special_str, 0, bogus_addr); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + ARG_STR("/dev/bogus/"), 3141592653U, dqblk, print_dqblk, + (intptr_t) 0); + + + /* Q_GETINFO */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + ARG_STR("/dev/sda1"), dqinfo, print_dqinfo, (intptr_t) 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + bogus_special, bogus_special_str, dqinfo, + print_dqinfo, (intptr_t) 2); + + /* Q_SETINFO */ + + fill_memory(dqinfo, sizeof(*dqinfo)); + /* In order to check flag printing correctness */ + dqinfo->dqi_flags = 0xdeadabcd; + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_SETINFO, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_SETINFO, USRQUOTA)), + ARG_STR("/dev/bogus/"), dqinfo, print_dqinfo, (intptr_t) 0); + + + /* Q_GETFMT */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_GETFMT, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_GETFMT, USRQUOTA)), + unterminated, unterminated_str, fmt + 1); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt); + + + /* Q_SYNC */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_SYNC, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_SYNC, 0xfff), "QCMD(Q_SYNC, 0xff /* ???QUOTA */)", + ARG_STR(NULL)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_quotactl && " + "(HAVE_LINUX_QUOTA_H || HAVE_SYS_QUOTA_H)"); + +#endif diff --git a/tests-m32/quotactl.h b/tests-m32/quotactl.h new file mode 100644 index 00000000..31eaec58 --- /dev/null +++ b/tests-m32/quotactl.h @@ -0,0 +1,166 @@ +/* + * Common definitions for Linux and XFS quota tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_QUOTACTL_H +#define STRACE_TESTS_QUOTACTL_H + +# include +# include +# include + +# ifdef HAVE_LINUX_QUOTA_H +/* Broken in CentOS 5: has extern spinlock_t dq_data_lock; declaration */ +# include +# else +# include +/* Broken in some new glibc versions: have Q_GETNEXTQUOTA definition but no + * struct nextdqblk defined. Fixed in glibc-2.24-106-g4d72808. */ +# include +# endif + +# ifndef QCMD_CMD +# define QCMD_CMD(_val) ((unsigned) (_val) >> SUBCMDSHIFT) +# endif /* !QCMD_CMD */ + +# ifndef QCMD_TYPE +# define QCMD_TYPE(_val) ((unsigned) (_val) & SUBCMDMASK) +# endif /* !QCMD_TYPE */ + +# ifndef PRJQUOTA +# define PRJQUOTA 2 +# endif + +# define PRINT_FIELD_D(prefix, where, field) \ + printf("%s%s=%lld", (prefix), #field, \ + sign_extend_unsigned_to_ll((where)->field)) + +# define PRINT_FIELD_U(prefix, where, field) \ + printf("%s%s=%llu", (prefix), #field, \ + zero_extend_signed_to_ull((where)->field)) + +# define PRINT_FIELD_X(prefix, where, field) \ + printf("%s%s=%#llx", (prefix), #field, \ + zero_extend_signed_to_ull((where)->field)) + +typedef void (*print_cb)(long rc, void *addr, void *arg); + +enum check_quotactl_flag_bits { + CQF_ID_SKIP_BIT, + CQF_ID_STR_BIT, + CQF_ADDR_SKIP_BIT, + CQF_ADDR_STR_BIT, + CQF_ADDR_CB_BIT, +}; + +enum check_quotactl_flags { + CQF_NONE, + CQF_ID_SKIP = 1 << CQF_ID_SKIP_BIT, + CQF_ID_STR = 1 << CQF_ID_STR_BIT, + CQF_ADDR_SKIP = 1 << CQF_ADDR_SKIP_BIT, + CQF_ADDR_STR = 1 << CQF_ADDR_STR_BIT, + CQF_ADDR_CB = 1 << CQF_ADDR_CB_BIT, +}; + + +static inline void +check_quota(uint32_t flags, int cmd, const char *cmd_str, + const char *special, const char *special_str, ...) +{ + long rc; + const char *addr_str = NULL; + const char *id_str = NULL; + void *addr = NULL; + print_cb addr_cb = NULL; + void *addr_cb_arg = NULL; + uint32_t id = -1; + + va_list ap; + + va_start(ap, special_str); + + if (!(flags & CQF_ID_SKIP)) { + id = va_arg(ap, uint32_t); + + if (flags & CQF_ID_STR) + id_str = va_arg(ap, const char *); + } + + if (!(flags & CQF_ADDR_SKIP)) { + addr = va_arg(ap, void *); + + if (flags & CQF_ADDR_CB) { + addr_cb = va_arg(ap, print_cb); + addr_cb_arg = va_arg(ap, void *); + } else if (flags & CQF_ADDR_STR) { + addr_str = va_arg(ap, const char *); + } + } + + va_end(ap); + + rc = syscall(__NR_quotactl, cmd, special, id, addr); + printf("quotactl(%s, %s", cmd_str, special_str); + + if (!(flags & CQF_ID_SKIP)) { + if (flags & CQF_ID_STR) { + printf(", %s", id_str); + } else { + if (id == (uint32_t)-1) + printf(", -1"); + else + printf(", %u", id); + } + } + + if (!(flags & CQF_ADDR_SKIP)) { + if (flags & CQF_ADDR_CB) { + printf(", "); + addr_cb(rc, addr, addr_cb_arg); + } else if (flags & CQF_ADDR_STR) { + printf(", %s", addr_str); + } else { + printf(", %p", addr); + } + } + + printf(") = %s\n", sprintrc(rc)); +} + + +static const int bogus_cmd = 0xbadc0ded; +static const int bogus_id = 0xca7faced; + +/* It is invalid anyway due to the slash in the end */ +static const char *bogus_dev = "/dev/bogus/"; +static const char *bogus_dev_str = "\"/dev/bogus/\""; + +static const char unterminated_data[] = { '\1', '\2', '\3' }; + +#endif /* !STRACE_TESTS_QUOTACTL_H */ diff --git a/tests-m32/quotactl.test b/tests-m32/quotactl.test new file mode 100755 index 00000000..d0101f46 --- /dev/null +++ b/tests-m32/quotactl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of quotactl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/read-write.c b/tests-m32/read-write.c new file mode 100644 index 00000000..262e07b5 --- /dev/null +++ b/tests-m32/read-write.c @@ -0,0 +1,224 @@ +/* + * Check decoding and dumping of read and write syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static void +dump_str(const char *str, const unsigned int len) +{ + static const char dots[16] = "................"; + unsigned int i; + + for (i = 0; i < len; i += 16) { + unsigned int n = len - i > 16 ? 16 : len - i; + const char *dump = hexdump_memdup(str + i, n); + + tprintf(" | %05x %-49s %-16.*s |\n", + i, dump, n, dots); + + free((void *) dump); + } +} + +static void +print_hex(const char *str, const unsigned int len) +{ + const unsigned char *ustr = (const unsigned char *) str; + unsigned int i; + + for (i = 0; i < len; ++i) { + unsigned int c = ustr[i]; + + switch (c) { + case '\t': + tprintf("\\t"); break; + case '\n': + tprintf("\\n"); break; + case '\v': + tprintf("\\v"); break; + case '\f': + tprintf("\\f"); break; + case '\r': + tprintf("\\r"); break; + default: + tprintf("\\%o", ustr[i]); + } + } +} + +static long +k_read(unsigned int fd, void *buf, size_t count) +{ + kernel_ulong_t kfd = (kernel_ulong_t) 0xfacefeed00000000ULL | fd; + return syscall(__NR_read, kfd, buf, count); +} + +static long +k_write(unsigned int fd, const void *buf, size_t count) +{ + kernel_ulong_t kfd = (kernel_ulong_t) 0xfacefeed00000000ULL | fd; + return syscall(__NR_write, kfd, buf, count); +} + +static void +test_dump(const unsigned int len) +{ + static char *buf; + + if (buf) { + size_t ps1 = get_page_size() - 1; + buf = (void *) (((size_t) buf + ps1) & ~ps1) - len; + } else { + buf = tail_alloc(len); + } + + long rc = k_read(0, buf, len); + if (rc != (int) len) + perror_msg_and_fail("read: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "read", 0); + print_hex(buf, len); + tprintf("\", %d) = %ld\n", len, rc); + dump_str(buf, len); + + unsigned int i; + for (i = 0; i < len; ++i) + buf[i] = i; + + rc = k_write(1, buf, len); + if (rc != (int) len) + perror_msg_and_fail("write: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "write", 1); + print_hex(buf, len); + tprintf("\", %d) = %ld\n", len, rc); + dump_str(buf, len); + + if (!len) + buf = 0; +} + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "read-write-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + + static const char w_c[] = "0123456789abcde"; + const unsigned int w_len = LENGTH_OF(w_c); + const char *w_d = hexdump_strdup(w_c); + const void *w = tail_memdup(w_c, w_len); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + const unsigned int r0_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r0_len); + + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + const unsigned int r1_len = w_len - r0_len; + void *r1 = tail_alloc(w_len); + + void *efault = r1 - get_page_size(); + + long rc; + + rc = k_write(1, w, 0); + if (rc) + perror_msg_and_fail("write: expected 0, returned %ld", rc); + tprintf("write(1, \"\", 0) = 0\n"); + + rc = k_write(1, efault, 1); + if (rc != -1) + perror_msg_and_fail("write: expected -1 EFAULT" + ", returned %ld", rc); + tprintf("write(1, %p, 1) = -1 EFAULT (%m)\n", efault); + + rc = k_write(1, w, w_len); + if (rc != (int) w_len) + perror_msg_and_fail("write: expected %u, returned %ld", + w_len, rc); + tprintf("write(1, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + w_c, w_len, rc, w_d, w_c); + close(1); + + rc = k_read(0, r0, 0); + if (rc) + perror_msg_and_fail("read: expected 0, returned %ld", rc); + tprintf("read(0, \"\", 0) = 0\n"); + + rc = k_read(0, efault, 1); + if (rc != -1) + perror_msg_and_fail("read: expected -1, returned %ld", rc); + tprintf("read(0, %p, 1) = -1 EFAULT (%m)\n", efault); + + rc = k_read(0, r0, r0_len); + if (rc != (int) r0_len) + perror_msg_and_fail("read: expected %u, returned %ld", + r0_len, rc); + tprintf("read(0, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r0_c, r0_len, rc, r0_d, r0_c); + + rc = k_read(0, r1, w_len); + if (rc != (int) r1_len) + perror_msg_and_fail("read: expected %u, returned %ld", + r1_len, rc); + tprintf("read(0, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r1_c, w_len, rc, r1_d, r1_c); + close(0); + + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 1) + perror_msg_and_fail("open"); + + unsigned int i; + for (i = 0; i <= 32; ++i) + test_dump(i); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/read-write.test b/tests-m32/read-write.test new file mode 100755 index 00000000..3700541f --- /dev/null +++ b/tests-m32/read-write.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check decoding and dumping of read and write syscalls. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +tmpfile=read-write-tmpfile +> $tmpfile + +run_strace_match_diff \ + -a15 -eread=0 -ewrite=1 -e trace=read,write \ + -P $tmpfile -P /dev/zero -P /dev/null + +rm -f $tmpfile diff --git a/tests-m32/readahead.c b/tests-m32/readahead.c new file mode 100644 index 00000000..c11b577d --- /dev/null +++ b/tests-m32/readahead.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef HAVE_READAHEAD +/* Check for glibc readahead argument passing bugs. */ +# ifdef __GLIBC__ +/* + * glibc < 2.8 had an incorrect order of higher and lower parts of offset, + * see https://sourceware.org/bugzilla/show_bug.cgi?id=5208 + */ +# if !(defined __GLIBC_MINOR__ && \ + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) +# undef HAVE_READAHEAD +# endif /* glibc < 2.8 */ +/* + * glibc < 2.25 had an incorrect implementation on mips n64, + * see https://sourceware.org/bugzilla/show_bug.cgi?id=21026 + */ +# if defined LINUX_MIPSN64 && !(defined __GLIBC_MINOR__ && \ + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) +# undef HAVE_READAHEAD +# endif /* LINUX_MIPSN64 && glibc < 2.25 */ +# endif /* __GLIBC__ */ +#endif /* HAVE_READAHEAD */ + +#ifdef HAVE_READAHEAD + +# include +# include + +static const int fds[] = { + -0x80000000, + -100, + -1, + 0, + 1, + 2, + 0x7fffffff, +}; + +static const off64_t offsets[] = { + -0x8000000000000000LL, + -0x5060708090a0b0c0LL, + -1LL, + 0, + 1, + 0xbadfaced, + 0x7fffffffffffffffLL, +}; + +static const unsigned long counts[] = { + 0UL, + 0xdeadca75, + (unsigned long) 0xface1e55beeff00dULL, + (unsigned long) 0xffffffffffffffffULL, +}; + +int +main(void) +{ + unsigned i; + unsigned j; + unsigned k; + ssize_t rc; + + for (i = 0; i < ARRAY_SIZE(fds); i++) + for (j = 0; j < ARRAY_SIZE(offsets); j++) + for (k = 0; k < ARRAY_SIZE(counts); k++) { + rc = readahead(fds[i], offsets[j], counts[k]); + + printf("readahead(%d, %lld, %lu) = %s\n", + fds[i], (long long) offsets[j], + counts[k], sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_READAHEAD") + +#endif diff --git a/tests-m32/readahead.test b/tests-m32/readahead.test new file mode 100755 index 00000000..397c6903 --- /dev/null +++ b/tests-m32/readahead.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check readahead syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests-m32/readdir.c b/tests-m32/readdir.c new file mode 100644 index 00000000..8c483620 --- /dev/null +++ b/tests-m32/readdir.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readdir + +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +int +main(int ac, const char **av) +{ + char *dname; + struct { + unsigned long d_ino; + unsigned long d_off; + unsigned short d_reclen; + char d_name[1024]; + } e; + int rc; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + while ((rc = syscall(__NR_readdir, 0, &e, 1))) { + if (rc < 0) + perror_msg_and_skip("readdir"); + e.d_name[e.d_reclen] = '\0'; + printf("readdir(0, {d_ino=%lu, d_off=%lu, d_reclen=%u" + ", d_name=\"%s\"}) = %d\n", + e.d_ino, e.d_off, e.d_reclen, + e.d_name[0] == '.' ? e.d_name : qname, rc); + } + printf("readdir(0, %p) = 0\n", &e); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readdir") + +#endif diff --git a/tests-m32/readdir.test b/tests-m32/readdir.test new file mode 100755 index 00000000..e3132737 --- /dev/null +++ b/tests-m32/readdir.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check readdir syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a16 diff --git a/tests-m32/readlink.c b/tests-m32/readlink.c new file mode 100644 index 00000000..4ddf5fac --- /dev/null +++ b/tests-m32/readlink.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readlink + +# include +# include + +# define PREFIX "test.readlink" +# define TARGET (PREFIX ".target") +# define LINKPATH (PREFIX ".link") + +int +main(void) +{ + const char * const fname = tail_memdup(LINKPATH, sizeof(LINKPATH)); + const char * const hex_fname = + hexquote_strndup(fname, sizeof(LINKPATH) - 1); + + const unsigned int size = sizeof(TARGET) - 1; + char * const buf = tail_alloc(size); + + (void) unlink(fname); + + long rc = syscall(__NR_readlink, fname, buf, size); + printf("readlink(\"%s\", %p, %u) = -1 ENOENT (%m)\n", + hex_fname, buf, size); + + if (symlink(TARGET, fname)) + perror_msg_and_fail("symlink"); + + rc = syscall(__NR_readlink, fname, buf, size); + if (rc < 0) { + perror("readlink"); + (void) unlink(fname); + return 77; + } + const char * const hex_buf = hexquote_strndup(buf, size); + printf("readlink(\"%s\", \"%s\", %u) = %u\n", + hex_fname, hex_buf, size, size); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readlink") + +#endif diff --git a/tests-m32/readlink.test b/tests-m32/readlink.test new file mode 100755 index 00000000..c026ecbe --- /dev/null +++ b/tests-m32/readlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check readlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests-m32/readlinkat.c b/tests-m32/readlinkat.c new file mode 100644 index 00000000..4d3b516c --- /dev/null +++ b/tests-m32/readlinkat.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readlinkat + +# include +# include + +# define PREFIX "test.readlinkat" +# define TARGET (PREFIX ".target") +# define LINKPATH (PREFIX ".link") + +int +main(void) +{ + const char * const fname = tail_memdup(LINKPATH, sizeof(LINKPATH)); + const char * const hex_fname = + hexquote_strndup(fname, sizeof(LINKPATH) - 1); + + const unsigned int size = sizeof(TARGET) - 1; + char * const buf = tail_alloc(size); + + (void) unlink(fname); + + long rc = syscall(__NR_readlinkat, -100, fname, buf, size); + printf("readlinkat(AT_FDCWD, \"%s\", %p, %u) = -1 ENOENT (%m)\n", + hex_fname, buf, size); + + if (symlink(TARGET, fname)) + perror_msg_and_fail("symlink"); + + rc = syscall(__NR_readlinkat, -100, fname, buf, size); + if (rc < 0) { + perror("readlinkat"); + (void) unlink(fname); + return 77; + } + const char * const hex_buf = hexquote_strndup(buf, size); + printf("readlinkat(AT_FDCWD, \"%s\", \"%s\", %u) = %u\n", + hex_fname, hex_buf, size, size); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readlink") + +#endif diff --git a/tests-m32/readlinkat.test b/tests-m32/readlinkat.test new file mode 100755 index 00000000..229c8e1e --- /dev/null +++ b/tests-m32/readlinkat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check readlinkat syscall decoding. + +. "${srcdir=.}/readlink.test" diff --git a/tests-m32/readv.c b/tests-m32/readv.c new file mode 100644 index 00000000..0e5aab65 --- /dev/null +++ b/tests-m32/readv.c @@ -0,0 +1,157 @@ +/* + * Check decoding of readv and writev syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + pipe_maxfd(fds); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + const void *efault = w0 + LENGTH_OF(w0_c); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + long rc; + + rc = writev(fds[1], efault, 42); + tprintf("writev(%d, %p, 42) = %ld %s (%m)\n", + fds[1], efault, rc, errno2name()); + + rc = readv(fds[0], efault, 42); + tprintf("readv(%d, %p, 42) = %ld %s (%m)\n", + fds[0], efault, rc, errno2name()); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + tprintf("writev(%d, [], 0) = %ld\n", + fds[1], (long) writev(fds[1], w_iov, 0)); + + rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, %p], 2)" + " = %ld %s (%m)\n", + fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + assert(writev(fds[1], w_iov, ARRAY_SIZE(w_iov_)) == (int) w_len); + close(fds[1]); + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + fds[1], w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + assert(readv(fds[0], r_iov, ARRAY_SIZE(r0_iov_)) == (int) r_len); + tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + fds[0], + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + assert(readv(fds[0], r_iov, ARRAY_SIZE(r1_iov_)) == (int) w_len - (int) r_len); + tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + fds[0], r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(fds[0]); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/readv.test b/tests-m32/readv.test new file mode 100755 index 00000000..dc187996 --- /dev/null +++ b/tests-m32/readv.test @@ -0,0 +1,65 @@ +#!/bin/sh +# +# Check decoding and dumping of readv and writev syscalls. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread=all -ewrite='!none' +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread='!none' -ewrite=all +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread=none -ewrite='!all' -eread='!0,1,2' -ewrite='!0,1,2' +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread='!all' -ewrite=none -eread='!0,1,2' -ewrite='!0,1,2' + +wfd="$(./print_maxfd)" +rfd="$(($wfd - 1))" +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="$rfd" -ewrite="$wfd" +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="!$rfd" -ewrite="!$wfd" -eread="$rfd" -ewrite="$wfd" + +rfds='!!!0' +[ $rfd -lt 1023 ] || rfd=1023 +i=0 +while [ $i -lt $rfd ]; do + rfds="$rfds,$i" + i=$(($i + 1)) +done + +wfds='!!!0' +[ $wfd -lt 1023 ] || wfd=1023 +i=0 +while [ $i -lt $wfd ]; do + wfds="$wfds,$i" + i=$(($i + 1)) +done + +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="$rfds" -ewrite="$wfds" diff --git a/tests-m32/reboot.c b/tests-m32/reboot.c new file mode 100644 index 00000000..9b09e647 --- /dev/null +++ b/tests-m32/reboot.c @@ -0,0 +1,37 @@ +#include "tests.h" +#include + +#ifdef __NR_reboot + +# include +# include +# include + +# define INVALID_MAGIC 319887762 +# define INVALID_CMD 0x01234568 + +int +main(void) +{ + static const char buf[] = "reboot"; + long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ + INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); + printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */," + " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n", + INVALID_MAGIC, buf, rc, errno2name()); + + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ + LINUX_REBOOT_MAGIC2, INVALID_CMD); + printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2," + " %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n", + INVALID_CMD, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_reboot") + +#endif diff --git a/tests-m32/reboot.test b/tests-m32/reboot.test new file mode 100755 index 00000000..a97dd21a --- /dev/null +++ b/tests-m32/reboot.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check reboot syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/recvfrom.c b/tests-m32/recvfrom.c new file mode 100644 index 00000000..b12454d2 --- /dev/null +++ b/tests-m32/recvfrom.c @@ -0,0 +1,89 @@ +/* + * Check decoding of sockaddr related arguments of recvfrom syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME recvfrom +#define TEST_SYSCALL_PREPARE send_un() +#define PREFIX_S_ARGS , recv_buf, 1, 0 +#define PREFIX_S_STR ", \"A\", 1, 0" +#define PREFIX_F_ARGS , 0, 1, 0 +#define PREFIX_F_STR ", NULL, 1, 0" +static void send_un(void); +static char recv_buf[1]; +#include "sockname.c" + +static int cfd; + +static void +send_un(void) +{ + if (send(cfd, "A", 1, 0) != 1) + perror_msg_and_skip("send"); +} + +int +main(void) +{ + cfd = socket(AF_UNIX, SOCK_STREAM, 0); + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd < 0 || lfd < 0) + perror_msg_and_skip("socket"); + + struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET ".send" + }; + + (void) unlink(un.sun_path); + if (bind(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + un.sun_path[sizeof(TEST_SOCKET) - 1] = '\0'; + (void) unlink(un.sun_path); + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + + if (listen(lfd, 1)) + perror_msg_and_skip("listen"); + + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); + + int afd = accept(lfd, 0, 0); + if (afd < 0) + perror_msg_and_skip("accept"); + + (void) unlink(un.sun_path); + + test_sockname_syscall(afd); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/recvfrom.test b/tests-m32/recvfrom.test new file mode 100755 index 00000000..9dfbc898 --- /dev/null +++ b/tests-m32/recvfrom.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sockaddr related arguments of recvfrom syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/recvmmsg-timeout.c b/tests-m32/recvmmsg-timeout.c new file mode 100644 index 00000000..7cf064db --- /dev/null +++ b/tests-m32/recvmmsg-timeout.c @@ -0,0 +1,71 @@ +/* + * Check decoding of timeout argument of recvmmsg syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#include "msghdr.h" + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + if (send(fds[1], "A", 1, 0) != 1) + perror_msg_and_skip("send"); + + char buf; + struct iovec iov = { .iov_base = &buf, .iov_len = sizeof(buf) }; + struct mmsghdr mh = { + .msg_hdr = { + .msg_iov = &iov, + .msg_iovlen = 1 + } + }; + struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + + int rc = recv_mmsg(-1, &mh, 1, 0, &t); + printf("recvmmsg(-1, %p, 1, 0, {tv_sec=0, tv_nsec=12345678})" + " = %d %s (%m)\n", &mh, rc, errno2name()); + + rc = recv_mmsg(fds[0], &mh, 1, 0, &t); + if (rc < 0) + perror_msg_and_skip("recvmmsg"); + printf("recvmmsg(%d, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, msg_len=1}], 1, 0" + ", {tv_sec=0, tv_nsec=12345678}) = " + "%d (left {tv_sec=0, tv_nsec=%d})\n", + fds[0], rc, (int) t.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/recvmmsg-timeout.test b/tests-m32/recvmmsg-timeout.test new file mode 100755 index 00000000..36a12221 --- /dev/null +++ b/tests-m32/recvmmsg-timeout.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of timeout argument of recvmmsg syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests-m32/recvmsg.c b/tests-m32/recvmsg.c new file mode 100644 index 00000000..fa41a9d4 --- /dev/null +++ b/tests-m32/recvmsg.c @@ -0,0 +1,160 @@ +/* + * Check decoding of recvmsg and sendmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + const struct msghdr w_mh_ = { + .msg_iov = w_iov, + .msg_iovlen = ARRAY_SIZE(w_iov_) + }; + const struct msghdr *w_mh = tail_memdup(&w_mh_, sizeof(w_mh_)); + + assert(sendmsg(1, w_mh, 0) == (int) w_len); + close(1); + tprintf("sendmsg(1, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}, {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), + w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), + ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, + LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + const struct msghdr r_mh_ = { + .msg_iov = r_iov, + .msg_iovlen = ARRAY_SIZE(r0_iov_) + }; + struct msghdr *r_mh = tail_memdup(&r_mh_, sizeof(r_mh_)); + + assert(recvmsg(0, r_mh, 0) == (int) r_len); + tprintf("recvmsg(0, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + r_mh->msg_iov = r_iov; + r_mh->msg_iovlen = ARRAY_SIZE(r1_iov_); + + assert(recvmsg(0, r_mh, 0) == (int) w_len - (int) r_len); + tprintf("recvmsg(0, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}, {iov_base=\"\", iov_len=%u}]" + ", msg_iovlen=%u, msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/recvmsg.test b/tests-m32/recvmsg.test new file mode 100755 index 00000000..e373a20a --- /dev/null +++ b/tests-m32/recvmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of recvmsg and sendmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests-m32/redirect-fds.c b/tests-m32/redirect-fds.c new file mode 100644 index 00000000..fc1073a7 --- /dev/null +++ b/tests-m32/redirect-fds.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#define N_FDS 3 + +/* + * Do not print any messages, indicate errors with return codes. + */ +static int +check_fd(int fd, const char *fname) +{ + const int should_be_closed = (fname[0] == '\0'); + + struct stat st_fd, st_fn; + + if (fstat(fd, &st_fd)) { + if (!should_be_closed) + return 10 + fd; + } else { + if (should_be_closed) + return 20 + fd; + + if (stat(fname, &st_fn)) + return 30 + fd; + + if (st_fd.st_dev != st_fn.st_dev + || st_fd.st_ino != st_fn.st_ino) + return 40 + fd; + } + + return 0; +} + +int +main(int ac, char **av) +{ + assert(ac == 1 + N_FDS); + + int rc = 0, fd; + for (fd = 1; fd < 1 + N_FDS; ++fd) + if ((rc = check_fd(fd - 1, av[fd]))) + break; + + return rc; +} diff --git a/tests-m32/redirect-fds.test b/tests-m32/redirect-fds.test new file mode 100755 index 00000000..ddef8fab --- /dev/null +++ b/tests-m32/redirect-fds.test @@ -0,0 +1,71 @@ +#!/bin/sh +# +# Check that strace does not leak placeholder descriptors. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +case "$STRACE" in + *valgrind\ *--suppressions=*) + skip_ 'incompatible with valgrind' ;; +esac + +fd0="$LOG.fd0" +fd1="$LOG.fd1" +fd2="$LOG.fd2" + +check_prog touch + +check_fd() +{ + local a1 a2 a3 + a1="$1" + a2="$2" + a3="$3" + + touch "$LOG" "$fd0" || + framework_skip_ 'failed to create files' + + set -- "\"./$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" + eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || + fail_ "$* failed with code $rc" + + set -- "$STRACE" -o"$LOG" -echdir "$@" + eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || + dump_log_and_fail_with "$* failed with code $?" + + rm -f "$LOG" "$fd0" "$fd1" "$fd2" +} + +check_fd "$fd0" "$fd1" "$fd2" +check_fd '' "$fd1" "$fd2" +check_fd "$fd0" '' "$fd2" +check_fd "$fd0" "$fd1" '' +check_fd '' '' "$fd2" +check_fd '' "$fd1" '' +check_fd "$fd0" '' '' +check_fd '' '' '' diff --git a/tests-m32/redirect.test b/tests-m32/redirect.test new file mode 100755 index 00000000..fa0c5369 --- /dev/null +++ b/tests-m32/redirect.test @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Ensure that strace does not retain stdin and stdout descriptors. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep +check_prog yes + +> "$OUT" +> "$LOG" +( + while [ -f "$LOG" ]; do + : + done + $SLEEP_A_BIT & + yes + if kill -0 $! 2> /dev/null; then + wait + else + echo TIMEOUT >> "$OUT" + fi +) | $STRACE -qq -enone -esignal=none \ + sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT" + +if [ -s "$OUT" ]; then + fail_ "$STRACE failed to redirect standard input" +fi + +> "$LOG" +$STRACE -qq -enone -esignal=none \ + sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT" | +( + while [ -f "$LOG" ]; do + : + done + $SLEEP_A_BIT & + cat > /dev/null + if kill -0 $! 2> /dev/null; then + wait + else + echo TIMEOUT >> "$OUT" + fi +) + +if [ -s "$OUT" ]; then + fail_ "$STRACE failed to redirect standard output" +fi + +rm -f -- "$OUT" diff --git a/tests-m32/remap_file_pages.c b/tests-m32/remap_file_pages.c new file mode 100644 index 00000000..452d2de7 --- /dev/null +++ b/tests-m32/remap_file_pages.c @@ -0,0 +1,61 @@ +/* + * Check decoding of remap_file_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_remap_file_pages + +# include +# include +# include + +int +main(void) +{ + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long size = (unsigned long) 0xdefaced1bad2f00dULL; + const unsigned long prot = PROT_READ|PROT_WRITE|PROT_EXEC; + const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deedULL; + const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS; + + long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags); + printf("remap_file_pages(%#lx, %lu, %s, %lu, %s) = %ld %s (%m)\n", + addr, size, "PROT_READ|PROT_WRITE|PROT_EXEC", pgoff, + "MAP_PRIVATE|MAP_ANONYMOUS", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_remap_file_pages") + +#endif diff --git a/tests-m32/remap_file_pages.test b/tests-m32/remap_file_pages.test new file mode 100755 index 00000000..9d51a9a0 --- /dev/null +++ b/tests-m32/remap_file_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check remap_file_pages syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/rename.c b/tests-m32/rename.c new file mode 100644 index 00000000..2a2a4e01 --- /dev/null +++ b/tests-m32/rename.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_rename + +# include +# include + +# define OLD_FILE "rename_old" +# define NEW_FILE "rename_new" + +int +main(void) +{ + long rc = syscall(__NR_rename, OLD_FILE, NEW_FILE); + printf("rename(\"%s\", \"%s\") = %ld %s (%m)\n", + OLD_FILE, NEW_FILE, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rename") + +#endif diff --git a/tests-m32/rename.test b/tests-m32/rename.test new file mode 100755 index 00000000..9067e4cc --- /dev/null +++ b/tests-m32/rename.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rename syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/renameat.c b/tests-m32/renameat.c new file mode 100644 index 00000000..2b874efa --- /dev/null +++ b/tests-m32/renameat.c @@ -0,0 +1,31 @@ +#include "tests.h" +#include + +#ifdef __NR_renameat + +# include +# include + +# define OLD_FILE "renameat_old" +# define NEW_FILE "renameat_new" + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_renameat, fd_old, OLD_FILE, fd_new, NEW_FILE); + printf("renameat(%d, \"%s\", %d, \"%s\") = %ld %s (%m)\n", + (int) fd_old, OLD_FILE, (int) fd_new, NEW_FILE, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_renameat") + +#endif diff --git a/tests-m32/renameat.test b/tests-m32/renameat.test new file mode 100755 index 00000000..9b0a61dd --- /dev/null +++ b/tests-m32/renameat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check renameat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/renameat2.c b/tests-m32/renameat2.c new file mode 100644 index 00000000..33f88988 --- /dev/null +++ b/tests-m32/renameat2.c @@ -0,0 +1,63 @@ +/* + * Check decoding of renameat2 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_renameat2 + +# include +# include + +int +main(void) +{ + static const char oldpath[] = "renameat2_oldpath"; + static const char newpath[] = "renameat2_newpath"; + const unsigned long olddirfd = + (unsigned long) 0xfacefeedffffffff; + const unsigned long newdirfd = + (unsigned long) 0xfacefeed00000000 | -100U; + + long rc = syscall(__NR_renameat2, + olddirfd, oldpath, newdirfd, newpath, 1); + printf("renameat2(%d, \"%s\", AT_FDCWD, \"%s\", RENAME_NOREPLACE)" + " = %ld %s (%m)\n", + (int) olddirfd, oldpath, newpath, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_renameat2") + +#endif diff --git a/tests-m32/renameat2.test b/tests-m32/renameat2.test new file mode 100755 index 00000000..4c176bbd --- /dev/null +++ b/tests-m32/renameat2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check renameat2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/request_key.c b/tests-m32/request_key.c new file mode 100644 index 00000000..fea977b2 --- /dev/null +++ b/tests-m32/request_key.c @@ -0,0 +1,149 @@ +/* + * Check decoding of request_key syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_request_key + +# include +# include +# include + +void +print_val_str(const void *ptr, const char *str) +{ + if (str) + printf("%s, ", str); + else + printf("%p, ", ptr); +} + +void +do_request_key(const char *type, const char *type_str, const char *desc, + const char *desc_str, const char *info, const char *info_str, + int32_t keyring, const char *keyring_str) +{ + long rc = syscall(__NR_request_key, type, desc, info, keyring); + const char *errstr = sprintrc(rc); + printf("request_key("); + print_val_str(type, type_str); + print_val_str(desc, desc_str); + print_val_str(info, info_str); + if (keyring_str) + printf("%s", keyring_str); + else + printf("%d", keyring); + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char unterminated3[] = + { '\16', '\17', '\20', '\21', '\22' }; + + char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *bogus_info = tail_memdup(unterminated3, sizeof(unterminated3)); + + unsigned i; + unsigned j; + unsigned k; + unsigned l; + + struct { + const char *type; + const char *str; + } types[] = { + { ARG_STR(NULL) }, + { bogus_type + sizeof(unterminated1), NULL }, + { bogus_type, NULL }, + { ARG_STR("\20\21\22\23\24") }, + { ARG_STR("user") }, + }; + + struct { + const char *desc; + const char *str; + } descs[] = { + { ARG_STR(NULL) }, + { bogus_desc + sizeof(unterminated2), NULL }, + { bogus_desc, NULL }, + { ARG_STR("\25\26\27\30\31") }, + { ARG_STR("desc") }, + { "overly long description", _STR("overly long ") "..." }, + }; + + struct { + const char *info; + const char *str; + } infos[] = { + { ARG_STR(NULL) }, + { bogus_info + sizeof(unterminated3), NULL }, + { bogus_info, NULL }, + { ARG_STR("\32\33\34\35\36") }, + { ARG_STR("info") }, + { "overly long info", _STR("overly long ") "..." }, + }; + + struct { + uint32_t keyring; + const char *str; + } keyrings[] = { + { ARG_STR(0) }, + { ARG_STR(1234567890) }, + { ARG_STR(-1234567890) }, + { -1, "KEY_SPEC_THREAD_KEYRING" }, + }; + + for (i = 0; i < ARRAY_SIZE(types); i++) + for (j = 0; j < ARRAY_SIZE(descs); j++) + for (k = 0; k < ARRAY_SIZE(infos); k++) + for (l = 0; l < ARRAY_SIZE(keyrings); l++) + do_request_key( + types[i].type, types[i].str, + descs[j].desc, descs[j].str, + infos[k].info, infos[k].str, + keyrings[l].keyring, + keyrings[l].str); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_request_key"); + +#endif diff --git a/tests-m32/request_key.test b/tests-m32/request_key.test new file mode 100755 index 00000000..9812a18e --- /dev/null +++ b/tests-m32/request_key.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of request_key syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -s12 diff --git a/tests-m32/restart_syscall.c b/tests-m32/restart_syscall.c new file mode 100644 index 00000000..e492e62e --- /dev/null +++ b/tests-m32/restart_syscall.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int +main(void) +{ +#if defined __x86_64__ && defined __ILP32__ + /* + * x32 is broken from the beginning: + * https://lkml.org/lkml/2015/11/30/790 + */ + error_msg_and_skip("x32 is broken"); +#else + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = SIG_IGN }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + struct timespec req = { .tv_nsec = 222222222 }, rem; + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + if (nanosleep(&req, &rem)) + perror_msg_and_fail("nanosleep"); + + printf("nanosleep\\(\\{tv_sec=%jd, tv_nsec=%jd\\}, " + "\\{tv_sec=%jd, tv_nsec=%jd\\}\\)" + " = \\? ERESTART_RESTARTBLOCK \\(Interrupted by signal\\)\n", + (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, + (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec); + puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---"); +#ifdef __arm__ +/* old kernels used to overwrite ARM_r0 with -EINTR */ +# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|" +#else +# define ALTERNATIVE_NANOSLEEP_REQ "" +#endif + printf("(nanosleep\\((%s\\{tv_sec=%jd, tv_nsec=%jd\\}), " + "%p|restart_syscall\\(<\\.\\.\\." + " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n", + ALTERNATIVE_NANOSLEEP_REQ, + (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem); + + puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); + return 0; +#endif +} diff --git a/tests-m32/restart_syscall.test b/tests-m32/restart_syscall.test new file mode 100755 index 00000000..6dfda168 --- /dev/null +++ b/tests-m32/restart_syscall.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check how "resuming interrupted nanosleep" works. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +syscalls=nanosleep,restart_syscall +run_strace -a20 -e trace=$syscalls $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/rmdir.c b/tests-m32/rmdir.c new file mode 100644 index 00000000..20952d84 --- /dev/null +++ b/tests-m32/rmdir.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_rmdir + +# include +# include + +int +main(void) +{ + static const char sample[] = "rmdir_sample"; + long rc = syscall(__NR_rmdir, sample); + printf("rmdir(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rmdir") + +#endif diff --git a/tests-m32/rmdir.test b/tests-m32/rmdir.test new file mode 100755 index 00000000..81ee66b8 --- /dev/null +++ b/tests-m32/rmdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rmdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/rt_sigpending.c b/tests-m32/rt_sigpending.c new file mode 100644 index 00000000..accf6913 --- /dev/null +++ b/tests-m32/rt_sigpending.c @@ -0,0 +1,128 @@ +/* + * This file is part of rt_sigpending strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigpending + +# include +# include +# include +# include +# include + +static long +k_sigpending(void *const set, const unsigned long size) +{ + return syscall(__NR_rt_sigpending, set, size); +} + +static void +iterate(const char *const text, unsigned int size, void *set) +{ + for (;;) { + if (k_sigpending(set, size)) { + tprintf("rt_sigpending(%p, %u) = -1 EFAULT (%m)\n", + set, size); + break; + } + if (size) { +#if WORDS_BIGENDIAN + if (size < sizeof(long)) + tprintf("rt_sigpending(%s, %u) = 0\n", + "[]", size); + else +#endif + tprintf("rt_sigpending(%s, %u) = 0\n", + text, size); + } else { + tprintf("rt_sigpending(%p, %u) = 0\n", set, size); + break; + } + size >>= 1; + set += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + + sigemptyset(libc_set); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + memset(k_set, 0, big_size); + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + if (!k_sigpending(k_set, set_size)) + break; + tprintf("rt_sigpending(%p, %u) = -1 EINVAL (%m)\n", + k_set, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigpending"); + tprintf("rt_sigpending(%s, %u) = 0\n", "[]", set_size); + + iterate("[]", set_size >> 1, k_set + (set_size >> 1)); + + void *const efault = k_set + (set_size >> 1); + assert(k_sigpending(efault, set_size) == -1); + tprintf("rt_sigpending(%p, %u) = -1 EFAULT (%m)\n", + efault, set_size); + + sigaddset(libc_set, SIGHUP); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGHUP); + + iterate("[HUP]", set_size, k_set); + + sigaddset(libc_set, SIGINT); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGINT); + + iterate("[HUP INT]", set_size, k_set); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigpending") + +#endif diff --git a/tests-m32/rt_sigpending.test b/tests-m32/rt_sigpending.test new file mode 100755 index 00000000..40c83a81 --- /dev/null +++ b/tests-m32/rt_sigpending.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigpending syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/rt_sigprocmask.c b/tests-m32/rt_sigprocmask.c new file mode 100644 index 00000000..27e357fa --- /dev/null +++ b/tests-m32/rt_sigprocmask.c @@ -0,0 +1,174 @@ +/* + * This file is part of rt_sigprocmask strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigprocmask + +# include +# include +# include +# include +# include + +static long +k_sigprocmask(const unsigned long how, void *const new_set, + void *const old_set, const unsigned long size) +{ + return syscall(__NR_rt_sigprocmask, how, new_set, old_set, size); +} + +static void +iterate(const char *const text, void *set, void *old, unsigned int size) +{ + for (;;) { + if (k_sigprocmask(SIG_UNBLOCK, set, old, size)) { + if (size < sizeof(long)) + tprintf("rt_sigprocmask(SIG_UNBLOCK" + ", %p, %p, %u) = -1 EINVAL (%m)\n", + set, old, size); + else + tprintf("rt_sigprocmask(SIG_UNBLOCK" + ", %s, %p, %u) = -1 EINVAL (%m)\n", + text, old, size); + } else { + tprintf("rt_sigprocmask(SIG_UNBLOCK, %s, [], %u)" + " = 0\n", text, size); + } + if (!size) + break; + size >>= 1; + set += size; + old += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + unsigned int set_size; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!k_sigprocmask(SIG_SETMASK, NULL, NULL, set_size)) + break; + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, NULL, %u)" + " = -1 EINVAL (%m)\n", set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, NULL, %u) = 0\n", + set_size); + + void *const k_set = tail_alloc(set_size); + void *const old_set = tail_alloc(set_size); + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + + memset(k_set, 0, set_size); + if (k_sigprocmask(SIG_SETMASK, k_set, NULL, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, [], NULL, %u) = 0\n", set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set - set_size, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[], [], %u) = 0\n", set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set - set_size, + old_set, set_size << 1) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %p, %p, %u) = -1 EINVAL (%m)\n", + k_set - set_size, old_set, set_size << 1); + + iterate("~[]", k_set - set_size, old_set, set_size >> 1); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_BLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_BLOCK, [HUP], [], %u) = 0\n", set_size); + + memset(libc_set, -1, sizeof(sigset_t)); + sigdelset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[HUP], [HUP], %u) = 0\n", + set_size); + + sigdelset(libc_set, SIGKILL); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[HUP KILL], [HUP], %u) = 0\n", + set_size); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + sigaddset(libc_set, SIGINT); + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_BLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_BLOCK, %s, [HUP], %u) = 0\n", + "[HUP INT QUIT ALRM TERM]", set_size); + + if (k_sigprocmask(SIG_SETMASK, NULL, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, %s, %u) = 0\n", + "[HUP INT QUIT ALRM TERM]", set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set + (set_size >> 1), NULL, + set_size) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %p, NULL, %u) = -1 EFAULT (%m)\n", + k_set + (set_size >> 1), set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set, old_set + (set_size >> 1), + set_size) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %s, %p, %u) = -1 EFAULT (%m)\n", + "[HUP INT QUIT ALRM TERM]", + old_set + (set_size >> 1), set_size); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") + +#endif diff --git a/tests-m32/rt_sigprocmask.test b/tests-m32/rt_sigprocmask.test new file mode 100755 index 00000000..1e60ebde --- /dev/null +++ b/tests-m32/rt_sigprocmask.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigprocmask syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/rt_sigqueueinfo.c b/tests-m32/rt_sigqueueinfo.c new file mode 100644 index 00000000..aba6776c --- /dev/null +++ b/tests-m32/rt_sigqueueinfo.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main (void) +{ + struct sigaction sa = { + .sa_handler = SIG_IGN + }; + union sigval value = { + .sival_ptr = (void *) (unsigned long) 0xdeadbeefbadc0dedULL + }; + pid_t pid = getpid(); + + assert(sigaction(SIGUSR1, &sa, NULL) == 0); + if (sigqueue(pid, SIGUSR1, value)) + perror_msg_and_skip("sigqueue"); + printf("rt_sigqueueinfo(%u, SIGUSR1, {si_signo=SIGUSR1, " + "si_code=SI_QUEUE, si_pid=%u, si_uid=%u, " + "si_value={int=%d, ptr=%p}}) = 0\n", + pid, pid, getuid(), value.sival_int, value.sival_ptr); + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-m32/rt_sigqueueinfo.test b/tests-m32/rt_sigqueueinfo.test new file mode 100755 index 00000000..c03c76f2 --- /dev/null +++ b/tests-m32/rt_sigqueueinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of rt_sigqueueinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/rt_sigsuspend.c b/tests-m32/rt_sigsuspend.c new file mode 100644 index 00000000..73e13364 --- /dev/null +++ b/tests-m32/rt_sigsuspend.c @@ -0,0 +1,165 @@ +/* + * This file is part of rt_sigsuspend strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigsuspend + +# include +# include +# include +# include +# include +# include +# include + +static long +k_sigsuspend(const sigset_t *const set, const unsigned long size) +{ + return syscall(__NR_rt_sigsuspend, set, size); +} + +static void +iterate(const char *const text, const int sig, + const void *const set, unsigned int size) +{ + const void *mask; + + for (mask = set;; size >>= 1, mask += size) { + raise(sig); + assert(k_sigsuspend(mask, size) == -1); + if (EINTR == errno) { + tprintf("rt_sigsuspend(%s, %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", + text, size); + } else { + if (size < sizeof(long)) + tprintf("rt_sigsuspend(%p, %u)" + " = -1 EINVAL (%m)\n", + mask, size); + else + tprintf("rt_sigsuspend(%s, %u)" + " = -1 EINVAL (%m)\n", + set == mask ? text : "~[]", size); + } + if (!size) + break; + } +} + +static void +handler(int signo) +{ +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + memset(k_set, 0, big_size); + + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + sigemptyset(libc_set); + sigaddset(libc_set, SIGUSR1); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct sigaction sa = { + .sa_handler = handler + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGUSR1); + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + assert(k_sigsuspend(k_set, set_size) == -1); + if (EINTR == errno) + break; + tprintf("rt_sigsuspend(%p, %u) = -1 EINVAL (%m)\n", + k_set, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigsuspend"); + tprintf("rt_sigsuspend([], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGUSR2); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([HUP USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigaddset(libc_set, SIGINT); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([HUP INT USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + memset(libc_set, -1, sizeof(*libc_set)); + sigdelset(libc_set, SIGUSR1); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend(~[USR1], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + assert(k_sigsuspend(k_set - set_size, set_size << 1) == -1); + tprintf("rt_sigsuspend(%p, %u) = -1 EINVAL (%m)\n", + k_set - set_size, set_size << 1); + + iterate("~[USR1]", SIGUSR1, k_set, set_size >> 1); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigsuspend") + +#endif diff --git a/tests-m32/rt_sigsuspend.test b/tests-m32/rt_sigsuspend.test new file mode 100755 index 00000000..2e30fd4b --- /dev/null +++ b/tests-m32/rt_sigsuspend.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigsuspend syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -esignal=none diff --git a/tests-m32/rt_sigtimedwait.c b/tests-m32/rt_sigtimedwait.c new file mode 100644 index 00000000..10311e6e --- /dev/null +++ b/tests-m32/rt_sigtimedwait.c @@ -0,0 +1,185 @@ +/* + * This file is part of rt_sigtimedwait strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigtimedwait + +# include +# include +# include +# include +# include +# include +# include + +static long +k_sigtimedwait(const sigset_t *const set, siginfo_t *const info, + const struct timespec *const timeout, const unsigned long size) +{ + return syscall(__NR_rt_sigtimedwait, set, info, timeout, size); +} + +static void +iterate(const char *const text, const void *set, + const struct timespec *const timeout, unsigned int size) +{ + for (;;) { + assert(k_sigtimedwait(set, NULL, timeout, size) == -1); + if (EINTR == errno) { + tprintf("rt_sigtimedwait(%s, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EAGAIN (%m)\n", text, + (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, + size); + } else { + if (size < sizeof(long)) + tprintf("rt_sigtimedwait(%p, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}" + ", %u) = -1 EINVAL (%m)\n", + set, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, size); + else + tprintf("rt_sigtimedwait(%s, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}" + ", %u) = -1 EINVAL (%m)\n", + text, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, size); + } + if (!size) + break; + size >>= 1; + set += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + siginfo_t *const info = tail_alloc(sizeof(*info)); + struct timespec *const timeout = tail_alloc(sizeof(*timeout)); + timeout->tv_sec = 0; + timeout->tv_nsec = 42; + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + memset(k_set, 0, big_size); + + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + if (EAGAIN == errno) + break; + tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EINVAL (%m)\n", + k_set, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigtimedwait"); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + set_size); + + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + sigaddset(libc_set, SIGINT); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + "[HUP INT QUIT ALRM TERM]", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + memset(k_set - set_size, -1, set_size); + assert(k_sigtimedwait(k_set - set_size, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + assert(k_sigtimedwait(k_set - set_size, info, NULL, set_size << 1) == -1); + tprintf("rt_sigtimedwait(%p, %p, NULL, %u) = -1 EINVAL (%m)\n", + k_set - set_size, info, set_size << 1); + + iterate("~[]", k_set - set_size, timeout, set_size >> 1); + + timeout->tv_sec = 1; + raise(SIGALRM); + assert(k_sigtimedwait(k_set, info, timeout, set_size) == SIGALRM); + tprintf("rt_sigtimedwait(%s, {si_signo=%s, si_code=SI_TKILL" + ", si_pid=%d, si_uid=%d}, {tv_sec=%jd, tv_nsec=%jd}, %u) = %d (%s)\n", + "[HUP INT QUIT ALRM TERM]", "SIGALRM", getpid(), getuid(), + (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + set_size, SIGALRM, "SIGALRM"); + + raise(SIGALRM); + assert(k_sigtimedwait(k_set, NULL, NULL, set_size) == SIGALRM); + tprintf("rt_sigtimedwait(%s, NULL, NULL, %u) = %d (%s)\n", + "[HUP INT QUIT ALRM TERM]", set_size, SIGALRM, "SIGALRM"); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigtimedwait") + +#endif diff --git a/tests-m32/rt_sigtimedwait.test b/tests-m32/rt_sigtimedwait.test new file mode 100755 index 00000000..e15fb779 --- /dev/null +++ b/tests-m32/rt_sigtimedwait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigtimedwait syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-m32/rt_tgsigqueueinfo.c b/tests-m32/rt_tgsigqueueinfo.c new file mode 100644 index 00000000..ec093481 --- /dev/null +++ b/tests-m32/rt_tgsigqueueinfo.c @@ -0,0 +1,88 @@ +/* + * This file is part of rt_tgsigqueueinfo strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_tgsigqueueinfo + +# include +# include +# include +# include +# include + +static long +k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info) +{ + return syscall(__NR_rt_tgsigqueueinfo, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | sig, + info); +} + +int +main (void) +{ + const struct sigaction sa = { + .sa_handler = SIG_IGN + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + siginfo_t *const info = tail_alloc(sizeof(*info)); + memset(info, 0, sizeof(*info)); + info->si_signo = SIGUSR1; + info->si_errno = ENOENT; + info->si_code = SI_QUEUE; + info->si_pid = getpid(); + info->si_uid = getuid(); + info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL; + + if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info)) + (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)( + "rt_tgsigqueueinfo"); + + printf("rt_tgsigqueueinfo(%u, %u, %s, {si_signo=%s" + ", si_code=SI_QUEUE, si_errno=ENOENT, si_pid=%u" + ", si_uid=%u, si_value={int=%d, ptr=%p}}) = 0\n", + info->si_pid, info->si_pid, "SIGUSR1", "SIGUSR1", + info->si_pid, info->si_uid, info->si_value.sival_int, + info->si_value.sival_ptr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_tgsigqueueinfo") + +#endif diff --git a/tests-m32/rt_tgsigqueueinfo.test b/tests-m32/rt_tgsigqueueinfo.test new file mode 100755 index 00000000..ab24e2d6 --- /dev/null +++ b/tests-m32/rt_tgsigqueueinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of rt_tgsigqueueinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/run.sh b/tests-m32/run.sh new file mode 100755 index 00000000..02d99123 --- /dev/null +++ b/tests-m32/run.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +. "${srcdir=.}/init.sh" + +$STRACE -V > /dev/null || + framework_failure_ "$STRACE is not available" + +TIMEOUT="timeout -s 9 $TIMEOUT_DURATION" +$TIMEOUT true > /dev/null 2>&1 || + TIMEOUT= + +exec $TIMEOUT "$@" diff --git a/tests-m32/sched_get_priority_mxx.c b/tests-m32/sched_get_priority_mxx.c new file mode 100644 index 00000000..fc14b27c --- /dev/null +++ b/tests-m32/sched_get_priority_mxx.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#if defined(__NR_sched_get_priority_min) \ + && defined(__NR_sched_get_priority_max) + +# include +# include +# include + +int +main(void) +{ + int rc = syscall(__NR_sched_get_priority_min, SCHED_FIFO); + printf("sched_get_priority_min(SCHED_FIFO) = %d\n", rc); + + rc = syscall(__NR_sched_get_priority_max, SCHED_RR); + printf("sched_get_priority_max(SCHED_RR) = %d\n", rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min" + " && defined __NR_sched_get_priority_max"); + +#endif diff --git a/tests-m32/sched_get_priority_mxx.test b/tests-m32/sched_get_priority_mxx.test new file mode 100755 index 00000000..0d1a1a78 --- /dev/null +++ b/tests-m32/sched_get_priority_mxx.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_get_priority_min and sched_get_priority_max syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests-m32/sched_rr_get_interval.c b/tests-m32/sched_rr_get_interval.c new file mode 100644 index 00000000..0aacd2b7 --- /dev/null +++ b/tests-m32/sched_rr_get_interval.c @@ -0,0 +1,42 @@ +#include "tests.h" +#include + +#ifdef __NR_sched_rr_get_interval + +# include +# include +# include +# include + +int +main(void) +{ + struct timespec *const tp = tail_alloc(sizeof(struct timespec)); + long rc; + + rc = syscall(__NR_sched_rr_get_interval, 0, NULL); + printf("sched_rr_get_interval(0, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, 0, tp + 1); + printf("sched_rr_get_interval(0, %p) = %s\n", tp + 1, sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, -1, tp); + printf("sched_rr_get_interval(-1, %p) = %s\n", tp, sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, 0, tp); + if (rc == 0) + printf("sched_rr_get_interval(0, {tv_sec=%jd, tv_nsec=%jd}) = " + "0\n", (intmax_t)tp->tv_sec, (intmax_t)tp->tv_nsec); + else + printf("sched_rr_get_interval(-1, %p) = %s\n", tp, + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_rr_get_interval") + +#endif diff --git a/tests-m32/sched_rr_get_interval.test b/tests-m32/sched_rr_get_interval.test new file mode 100755 index 00000000..828ba5d0 --- /dev/null +++ b/tests-m32/sched_rr_get_interval.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_rr_get_interval syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-m32/sched_xetaffinity.c b/tests-m32/sched_xetaffinity.c new file mode 100644 index 00000000..41a18202 --- /dev/null +++ b/tests-m32/sched_xetaffinity.c @@ -0,0 +1,135 @@ +/* + * This file is part of sched_xetaffinity strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_sched_getaffinity && defined __NR_sched_setaffinity \ + && defined CPU_ISSET_S && defined CPU_ZERO_S && defined CPU_SET_S + +# include +# include +# include +# include + +static const char *errstr; + +static int +getaffinity(unsigned long pid, unsigned long size, void *set) +{ + int rc = syscall(__NR_sched_getaffinity, pid, size, set); + errstr = sprintrc(rc); + return rc; +} + +static int +setaffinity(unsigned long pid, unsigned long size, void *set) +{ + int rc = syscall(__NR_sched_setaffinity, pid, size, set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + unsigned int cpuset_size = 1; + const pid_t pid = getpid(); + + while (cpuset_size) { + assert(getaffinity(pid, cpuset_size, NULL) == -1); + if (EFAULT == errno) + break; + if (EINVAL != errno) + perror_msg_and_skip("sched_getaffinity"); + printf("sched_getaffinity(%d, %u, NULL) = %s\n", + pid, cpuset_size, errstr); + cpuset_size <<= 1; + } + assert(cpuset_size); + printf("sched_getaffinity(%d, %u, NULL) = %s\n", + pid, cpuset_size, errstr); + + cpu_set_t *cpuset = tail_alloc(cpuset_size); + getaffinity(pid, cpuset_size, cpuset + 1); + printf("sched_getaffinity(%d, %u, %p) = %s\n", + pid, cpuset_size, cpuset + 1, errstr); + + int ret_size = getaffinity(pid, cpuset_size, cpuset); + if (ret_size < 0) + perror_msg_and_fail("sched_getaffinity(%d, %u, %p) = %s\n", + pid, (unsigned) cpuset_size, cpuset, errstr); + assert(ret_size <= (int) cpuset_size); + + printf("sched_getaffinity(%d, %u, [", pid, cpuset_size); + const char *sep; + unsigned int i, cpu; + for (i = 0, cpu = 0, sep = ""; i < (unsigned) ret_size * 8; ++i) { + if (CPU_ISSET_S(i, (unsigned) ret_size, cpuset)) { + printf("%s%u", sep, i); + sep = ", "; + cpu = i; + } + } + printf("]) = %s\n", errstr); + + CPU_ZERO_S(cpuset_size, cpuset); + CPU_SET_S(cpu, cpuset_size, cpuset); + if (setaffinity(pid, cpuset_size, cpuset)) + perror_msg_and_skip("sched_setaffinity"); + printf("sched_setaffinity(%d, %u, [%u]) = 0\n", + pid, cpuset_size, cpu); + + const unsigned int big_size = cpuset_size < 128 ? 128 : cpuset_size * 2; + cpuset = tail_alloc(big_size); + ret_size = getaffinity(pid, big_size, cpuset); + if (ret_size < 0) + perror_msg_and_fail("sched_getaffinity(%d, %u, %p) = %s\n", + pid, big_size, cpuset, errstr); + assert(ret_size <= (int) big_size); + printf("sched_getaffinity(%d, %u, [", pid, big_size); + for (i = 0, sep = ""; i < (unsigned) ret_size * 8; ++i) { + if (CPU_ISSET_S(i, (unsigned) ret_size, cpuset)) { + printf("%s%u", sep, i); + sep = ", "; + } + } + printf("]) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getaffinity && __NR_sched_setaffinity" + " && CPU_ISSET_S && CPU_ZERO_S && CPU_SET_S") + +#endif diff --git a/tests-m32/sched_xetaffinity.test b/tests-m32/sched_xetaffinity.test new file mode 100755 index 00000000..246ea21a --- /dev/null +++ b/tests-m32/sched_xetaffinity.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getaffinity and sched_setaffinity syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests-m32/sched_xetattr.c b/tests-m32/sched_xetattr.c new file mode 100644 index 00000000..1b484915 --- /dev/null +++ b/tests-m32/sched_xetattr.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_sched_getattr && defined __NR_sched_setattr + +# include +# include +# include + +int +main(void) +{ + struct { + uint32_t size; + uint32_t sched_policy; + uint64_t sched_flags; + int32_t sched_nice; + uint32_t sched_priority; + uint64_t sched_runtime; + uint64_t sched_deadline; + uint64_t sched_period; + } *sched_attr = tail_alloc(sizeof(*sched_attr)); + + long rc = syscall(__NR_sched_getattr, 0xdeadface, NULL, 0, 0); + printf("sched_getattr\\(%d, NULL, 0, 0\\) += %s\n", + 0xdeadface, sprintrc_grep(rc)); + + rc = syscall(__NR_sched_getattr, -1, + sched_attr, 0xbadfaced, 0xc0defeed); + printf("sched_getattr\\(-1, %p, %u, %u\\) += %s\n", + sched_attr, 0xbadfaced, 0xc0defeed, sprintrc_grep(rc)); + + rc = syscall(__NR_sched_getattr, 0, + sched_attr + 1, sizeof(*sched_attr), 0); + printf("sched_getattr\\(0, %p, %u, 0\\) += %s\n", + sched_attr + 1, (unsigned)sizeof(*sched_attr), + sprintrc_grep(rc)); + + if (syscall(__NR_sched_getattr, 0, sched_attr, sizeof(*sched_attr), 0)) + perror_msg_and_skip("sched_getattr"); + + printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" + ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "\\}, %u, 0\\) += 0\n", + sched_attr->size, + sched_attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period, + (unsigned) sizeof(*sched_attr)); + + sched_attr->sched_flags |= 1; + if (syscall(__NR_sched_setattr, 0, sched_attr, 0)) + perror_msg_and_skip("sched_setattr"); + + printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" + ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n", + sched_attr->size, + "SCHED_FLAG_RESET_ON_FORK", + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period); + + sched_attr->size = 0x90807060; + sched_attr->sched_policy = 0xca7faced; + sched_attr->sched_flags = 0xbadc0ded1057da7aULL; + sched_attr->sched_nice = 0xafbfcfdf; + sched_attr->sched_priority = 0xb8c8d8e8; + sched_attr->sched_runtime = 0xbadcaffedeadf157ULL; + sched_attr->sched_deadline = 0xc0de70a57badac75ULL; + sched_attr->sched_period = 0xded1ca7edda7aca7ULL; + + rc = syscall(__NR_sched_setattr, 0xfacec0de, sched_attr, 0xbeeff00d); + + printf("sched_setattr\\(%d, \\{size=%u, " + "sched_policy=%#x /\\* SCHED_\\?\\?\\? \\*/, " + "sched_flags=%#" PRIx64 " /\\* SCHED_FLAG_\\?\\?\\? \\*/, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, " + "%u\\) += %s\n", + 0xfacec0de, sched_attr->size, + sched_attr->sched_policy, + sched_attr->sched_flags, + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period, 0xbeeff00d, sprintrc_grep(rc)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getattr && __NR_sched_setattr") + +#endif diff --git a/tests-m32/sched_xetattr.test b/tests-m32/sched_xetattr.test new file mode 100755 index 00000000..c2c7914c --- /dev/null +++ b/tests-m32/sched_xetattr.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check sched_getattr and sched_setattr syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e sched_getattr,sched_setattr $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/sched_xetparam.c b/tests-m32/sched_xetparam.c new file mode 100644 index 00000000..e761a9d0 --- /dev/null +++ b/tests-m32/sched_xetparam.c @@ -0,0 +1,33 @@ +#include "tests.h" +#include + +#if defined __NR_sched_getparam && defined __NR_sched_setparam + +# include +# include +# include + +int +main(void) +{ + struct sched_param *const param = + tail_alloc(sizeof(struct sched_param)); + + long rc = syscall(__NR_sched_getparam, 0, param); + printf("sched_getparam(0, [%d]) = %ld\n", + param->sched_priority, rc); + + param->sched_priority = -1; + rc = syscall(__NR_sched_setparam, 0, param); + printf("sched_setparam(0, [%d]) = %ld %s (%m)\n", + param->sched_priority, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getparam && __NR_sched_setparam") + +#endif diff --git a/tests-m32/sched_xetparam.test b/tests-m32/sched_xetparam.test new file mode 100755 index 00000000..c9fede13 --- /dev/null +++ b/tests-m32/sched_xetparam.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getparam and sched_setparam syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests-m32/sched_xetscheduler.c b/tests-m32/sched_xetscheduler.c new file mode 100644 index 00000000..7faee8cd --- /dev/null +++ b/tests-m32/sched_xetscheduler.c @@ -0,0 +1,81 @@ +#include "tests.h" +#include + +#if defined __NR_sched_getscheduler && defined __NR_sched_setscheduler + +# include +# include +# include + +int +main(void) +{ + struct sched_param *const param = tail_alloc(sizeof(struct sched_param)); + long rc = syscall(__NR_sched_getscheduler, 0); + const char *scheduler; + switch (rc) { + case SCHED_FIFO: + scheduler = "SCHED_FIFO"; + break; + case SCHED_RR: + scheduler = "SCHED_RR"; + break; +# ifdef SCHED_BATCH + case SCHED_BATCH: + scheduler = "SCHED_BATCH"; + break; +# endif +# ifdef SCHED_IDLE + case SCHED_IDLE: + scheduler = "SCHED_IDLE"; + break; +# endif +# ifdef SCHED_ISO + case SCHED_ISO: + scheduler = "SCHED_ISO"; + break; +# endif +# ifdef SCHED_DEADLINE + case SCHED_DEADLINE: + scheduler = "SCHED_DEADLINE"; + break; +# endif + default: + scheduler = "SCHED_OTHER"; + } + printf("sched_getscheduler(0) = %ld (%s)\n", + rc, scheduler); + + rc = syscall(__NR_sched_getscheduler, -1); + printf("sched_getscheduler(-1) = %s\n", sprintrc(rc)); + + param->sched_priority = -1; + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, NULL); + printf("sched_setscheduler(0, SCHED_FIFO, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param + 1); + printf("sched_setscheduler(0, SCHED_FIFO, %p) = %s\n", param + 1, + sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, 0xfaceda7a, param); + printf("sched_setscheduler(0, %#x /* SCHED_??? */, [%d]) = %s\n", + 0xfaceda7a, param->sched_priority, sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, -1, SCHED_FIFO, param); + printf("sched_setscheduler(-1, SCHED_FIFO, [%d]) = %s\n", + param->sched_priority, sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param); + printf("sched_setscheduler(0, SCHED_FIFO, [%d]) = %s\n", + param->sched_priority, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getscheduler && __NR_sched_setscheduler") + +#endif diff --git a/tests-m32/sched_xetscheduler.test b/tests-m32/sched_xetscheduler.test new file mode 100755 index 00000000..07c93f31 --- /dev/null +++ b/tests-m32/sched_xetscheduler.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getscheduler and sched_setscheduler syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests-m32/sched_yield.c b/tests-m32/sched_yield.c new file mode 100644 index 00000000..355e7e8d --- /dev/null +++ b/tests-m32/sched_yield.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_sched_yield + +# include +# include + +int +main(void) +{ + printf("sched_yield() = %ld\n", syscall(__NR_sched_yield)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_yield") + +#endif diff --git a/tests-m32/sched_yield.test b/tests-m32/sched_yield.test new file mode 100755 index 00000000..f0c2c303 --- /dev/null +++ b/tests-m32/sched_yield.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_yield syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/scm_rights-fd.test b/tests-m32/scm_rights-fd.test new file mode 100755 index 00000000..8447375f --- /dev/null +++ b/tests-m32/scm_rights-fd.test @@ -0,0 +1,80 @@ +#!/bin/sh +# +# Check how SCM_RIGHTS and SCM_CREDENTIALS control messages are decoded in -y mode. +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -y is implemented using /proc/$pid/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog mkdir +check_prog rm +check_prog seq +check_prog touch + +dir="$LOG.dir" +rm -rf -- "$dir" +mkdir -- "$dir" || + framework_skip_ 'failed to create a directory' + +file="$dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" + +touch -- "$file" || + framework_skip_ 'failed to create a file' + +run_prog ./scm_rights /dev/zero +run_strace -y -x -enetwork $args "$file" + +hex='[[:xdigit:]]' +n='[1-9][0-9]*' +sample="$(for i in $(seq 1 15); do printf '\\\\xf%x' $i; done)" +socket='' + +path6='(/.*/(A\\n){127}Z|\\x2f(\\x'"$hex$hex"')*\\x2f(\\x41\\x0a){127}\\x5a)' +rights_data='\[4, 5, 6<'"$path6"'>\]' +iov='\[\{iov_base="'"$sample"'", iov_len=15\}\]' +ids='\{pid='"$n"', uid=[0-9]+, gid=[0-9]+\}' + +msg_head='\{msg_name=NULL, msg_namelen=0, msg_iov='"$iov"', msg_iovlen=1, msg_control=' +msg_tail=', msg_controllen='"$n"', msg_flags=0' +rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data='"$rights_data"'\}' +creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data='"$ids"'\}' + +EXPECTED="$LOG.expected" + +cat > "$EXPECTED" << __EOF__ +sendmsg\\(3$socket, $msg_head\\[$rights\\]$msg_tail\\}, 0\\) = 15 +recvmsg\\(0$socket, $msg_head\\[$creds, $rights\\]$msg_tail\\}, 0\\) = 15 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" +rm -rf -- "$dir" + +exit 0 diff --git a/tests-m32/scm_rights.c b/tests-m32/scm_rights.c new file mode 100644 index 00000000..42caed7c --- /dev/null +++ b/tests-m32/scm_rights.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int main(int ac, const char **av) +{ + assert(ac > 0); + int fds[ac]; + + static const char sample[] = + "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + const unsigned int data_size = sizeof(sample) - 1; + void *data = tail_alloc(data_size); + memcpy(data, sample, data_size); + + struct iovec *iov = tail_alloc(sizeof(struct iovec)); + iov->iov_base = data; + iov->iov_len = data_size; + + struct msghdr *mh = tail_alloc(sizeof(struct msghdr)); + memset(mh, 0, sizeof(*mh)); + mh->msg_iov = iov; + mh->msg_iovlen = 1; + + int i; + while ((i = open("/dev/null", O_RDWR)) <= ac + 2) + assert(i >= 0); + while (i > 2) + assert(close(i--) == 0); + assert(close(0) == 0); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + int one = 1; + if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one))) + perror_msg_and_skip("setsockopt"); + + assert((fds[0] = open("/dev/null", O_RDWR)) == 4); + for (i = 1; i < ac; ++i) + assert((fds[i] = open(av[i], O_RDONLY)) == i + 4); + + unsigned int cmsg_size = CMSG_SPACE(sizeof(fds)); + struct cmsghdr *cmsg = tail_alloc(cmsg_size); + memset(cmsg, 0, cmsg_size); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(fds)); + memcpy(CMSG_DATA(cmsg), fds, sizeof(fds)); + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg_size; + + assert(sendmsg(sv[1], mh, 0) == (int) data_size); + + assert(close(sv[1]) == 0); + assert(open("/dev/null", O_RDWR) == sv[1]); + + for (i = 0; i < ac; ++i) { + assert(close(fds[i]) == 0); + fds[i] = 0; + } + + cmsg_size += CMSG_SPACE(sizeof(struct ucred)); + cmsg = tail_alloc(cmsg_size); + memset(cmsg, 0, cmsg_size); + mh->msg_control = cmsg; + mh->msg_controllen = cmsg_size; + + assert(recvmsg(0, mh, 0) == (int) data_size); + assert(close(0) == 0); + + return 0; +} diff --git a/tests-m32/scno_tampering.sh b/tests-m32/scno_tampering.sh new file mode 100755 index 00000000..6aa78432 --- /dev/null +++ b/tests-m32/scno_tampering.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Skip the test if arch+kernel combination is not supported. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +uname_r="$(uname -r)" +case "$STRACE_ARCH" in + arm) + # PTRACE_SET_SYSCALL is supported by linux kernel + # starting with commit v2.6.16-rc1~107^2. + require_min_kernel_version_or_skip 2.6.16 ;; + aarch64) + # NT_ARM_SYSTEM_CALL regset is supported by linux kernel + # starting with commit v3.19-rc1~59^2~16. + require_min_kernel_version_or_skip 3.19 ;; + hppa) + # Syscall number and return value modification did not work + # properly before commit v4.5-rc7~31^2~1. + require_min_kernel_version_or_skip 4.5 ;; + sparc*) + # Reloading the syscall number from %g1 register is supported + # by linux kernel starting with commit v4.5-rc7~35^2~3. + require_min_kernel_version_or_skip 4.5 ;; + mips) + # Only the native ABI is supported by the kernel properly, see + # https://sourceforge.net/p/strace/mailman/message/35587571/ + uname_m="$(uname -m)" + case "$MIPS_ABI:$uname_m" in + o32:mips|n64:mips64) ;; + *) skip_ "$MIPS_ABI scno tampering does not work on $uname_m yet" ;; + esac ;; +esac diff --git a/tests-m32/seccomp-filter-v.c b/tests-m32/seccomp-filter-v.c new file mode 100644 index 00000000..dbf686d1 --- /dev/null +++ b/tests-m32/seccomp-filter-v.c @@ -0,0 +1,213 @@ +/* + * Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#ifdef HAVE_PRCTL +# include +#endif +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined __NR_seccomp \ + && defined PR_SET_NO_NEW_PRIVS \ + && defined SECCOMP_SET_MODE_FILTER \ + && defined SECCOMP_RET_ERRNO \ + && defined BPF_JUMP \ + && defined BPF_STMT + +#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) + +#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) + +#define SOCK_FILTER_KILL_PROCESS \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) + +#define PRINT_ALLOW_SYSCALL(nr) \ + tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ + __NR_ ## nr) + +#define PRINT_DENY_SYSCALL(nr, err) \ + tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ + __NR_ ## nr, err) + +static const struct sock_filter filter_c[] = { + /* load syscall number */ + BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), + + /* allow syscalls */ + SOCK_FILTER_ALLOW_SYSCALL(close), + SOCK_FILTER_ALLOW_SYSCALL(exit), + SOCK_FILTER_ALLOW_SYSCALL(exit_group), + + /* deny syscalls */ + SOCK_FILTER_DENY_SYSCALL(sync, EBUSY), + SOCK_FILTER_DENY_SYSCALL(setsid, EPERM), + + /* kill process */ + SOCK_FILTER_KILL_PROCESS +}; + +#ifndef BPF_MAXINSNS +# define BPF_MAXINSNS 4096 +#endif + +int +main(void) +{ + tprintf("%s", ""); + + static const char kill_stmt_txt[] = + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"; + struct sock_filter *const filter = + tail_memdup(filter_c, sizeof(filter_c)); + struct sock_filter *const big_filter = + tail_alloc(sizeof(*big_filter) * (BPF_MAXINSNS + 1)); + struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + perror_msg_and_skip("PR_SET_NO_NEW_PRIVS"); + + prog->filter = filter + ARRAY_SIZE(filter_c); + prog->len = 1; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=1, filter=%p})" + " = -1 EFAULT (%m)\n", prog->filter); + + prog->filter = filter + ARRAY_SIZE(filter_c) - 1; + prog->len = 3; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u" + ", filter=[%s, %p]}) = -1 EFAULT (%m)\n", + prog->len, kill_stmt_txt, filter + ARRAY_SIZE(filter_c)); + + prog->len = 0; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=0, filter=[]})" + " = -1 EINVAL (%m)\n"); + + unsigned int i; + for (i = 0; i <= BPF_MAXINSNS; ++i) { + const struct sock_filter stmt = + BPF_STMT(BPF_CLASS(i), i << 16); + big_filter[i] = stmt; + } + + prog->filter = big_filter; + prog->len = BPF_MAXINSNS + 1; + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=[", + "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", prog->len); + for (i = 0; i < BPF_MAXINSNS; ++i) { + if (i) + tprintf(", "); + switch(BPF_CLASS(i)) { + case BPF_LD: + tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_IMM, %#x)", i << 16); + break; + case BPF_LDX: + tprintf("BPF_STMT(BPF_LDX|BPF_W|BPF_IMM, %#x)", i << 16); + break; + case BPF_ST: + tprintf("BPF_STMT(BPF_ST, %#x)", i << 16); + break; + case BPF_STX: + tprintf("BPF_STMT(BPF_STX, %#x)", i << 16); + break; + case BPF_ALU: + tprintf("BPF_STMT(BPF_ALU|BPF_K|BPF_ADD, %#x)", i << 16); + break; + case BPF_JMP: + tprintf("BPF_STMT(BPF_JMP|BPF_K|BPF_JA, %#x)", i << 16); + break; + case BPF_RET: + tprintf("BPF_STMT(BPF_RET|BPF_K, %#x" + " /* SECCOMP_RET_??? */)", i << 16); + break; + case BPF_MISC: + tprintf("BPF_STMT(BPF_MISC|BPF_TAX, %#x)", i << 16); + break; + } + } + tprintf(", ...]})"); + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); + tprintf(" = -1 EINVAL (%m)\n"); + + prog->filter = filter; + prog->len = ARRAY_SIZE(filter_c); + + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u, filter=[", + prog->len); + + tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_ABS, %#x), ", + (unsigned) offsetof(struct seccomp_data, nr)); + + PRINT_ALLOW_SYSCALL(close); + PRINT_ALLOW_SYSCALL(exit); + PRINT_ALLOW_SYSCALL(exit_group); + + PRINT_DENY_SYSCALL(sync, EBUSY), + PRINT_DENY_SYSCALL(setsid, EPERM), + + tprintf("%s]}) = 0\n+++ exited with 0 +++\n", kill_stmt_txt); + + if (syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog)) + perror_msg_and_skip("SECCOMP_SET_MODE_FILTER"); + + if (close(0) || close(1)) + _exit(77); + + _exit(0); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && PR_SET_NO_NEW_PRIVS" + " && SECCOMP_SET_MODE_FILTER && SECCOMP_RET_ERRNO" + " && BPF_JUMP && BPF_STMT") + +#endif diff --git a/tests-m32/seccomp-filter-v.test b/tests-m32/seccomp-filter-v.test new file mode 100755 index 00000000..f873eb6f --- /dev/null +++ b/tests-m32/seccomp-filter-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=seccomp diff --git a/tests-m32/seccomp-filter.c b/tests-m32/seccomp-filter.c new file mode 100644 index 00000000..d4d76dd3 --- /dev/null +++ b/tests-m32/seccomp-filter.c @@ -0,0 +1,75 @@ +/* + * Check decoding of seccomp SECCOMP_SET_MODE_FILTER. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined __NR_seccomp && defined SECCOMP_SET_MODE_FILTER + +# define N 7 + +int +main(void) +{ + struct sock_filter *const filter = tail_alloc(sizeof(*filter) * N); + const void *const efault = tail_alloc(1); + struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + long rc; + + prog->filter = filter; + prog->len = N; + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); + printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=%p})" + " = %ld %s (%m)\n", "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", + prog->len, prog->filter, rc, errno2name()); + + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -2L, efault); + printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, %p) = %ld %s (%m)\n", + "0xfffffffe /* SECCOMP_FILTER_FLAG_??? */", + efault, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && SECCOMP_SET_MODE_FILTER") + +#endif diff --git a/tests-m32/seccomp-filter.test b/tests-m32/seccomp-filter.test new file mode 100755 index 00000000..65c6d495 --- /dev/null +++ b/tests-m32/seccomp-filter.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of seccomp SECCOMP_SET_MODE_FILTER. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests-m32/seccomp-strict.c b/tests-m32/seccomp-strict.c new file mode 100644 index 00000000..237b0eca --- /dev/null +++ b/tests-m32/seccomp-strict.c @@ -0,0 +1,74 @@ +/* + * Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_seccomp && defined __NR_exit + +# include +# include + +int +main(void) +{ + static const char text1[] = + "seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = 0\n"; + static const char text2[] = "+++ exited with 0 +++\n"; + const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + long rc; + + rc = syscall(__NR_seccomp, -1L, -1L, addr); + printf("seccomp(%#x /* SECCOMP_SET_MODE_??? */, %u, %#llx)" + " = %s\n", -1, -1, (unsigned long long) addr, sprintrc(rc)); + fflush(stdout); + + rc = syscall(__NR_seccomp, 0, 0, 0); + if (rc) { + printf("seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = %s\n", + sprintrc(rc)); + fflush(stdout); + rc = 0; + } else { + /* + * If kernel implementaton of SECCOMP_MODE_STRICT is buggy, + * the following syscall will result to SIGKILL. + */ + rc = write(1, text1, LENGTH_OF(text1)) != LENGTH_OF(text1); + } + + rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2); + return !!syscall(__NR_exit, rc); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && __NR_exit") + +#endif diff --git a/tests-m32/seccomp-strict.test b/tests-m32/seccomp-strict.test new file mode 100755 index 00000000..b354c6a2 --- /dev/null +++ b/tests-m32/seccomp-strict.test @@ -0,0 +1,17 @@ +#!/bin/sh + +# Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. + +. "${srcdir=.}/init.sh" + +set -- "./$NAME" +"$@" > /dev/null || { + case $? in + 77) skip_ "$* exited with code 77" ;; + 137) framework_skip_ "$* killed by SIGKILL, fix your kernel" ;; + *) fail_ "$args failed" ;; + esac +} +run_strace -eseccomp "$@" > "$EXP" +match_diff "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-m32/select.c b/tests-m32/select.c new file mode 100644 index 00000000..b5ff259d --- /dev/null +++ b/tests-m32/select.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_select && !defined __NR__newselect + +# define TEST_SYSCALL_NR __NR_select +# define TEST_SYSCALL_STR "select" +# include "xselect.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && !__NR__newselect") + +#endif diff --git a/tests-m32/select.test b/tests-m32/select.test new file mode 100755 index 00000000..60b88caf --- /dev/null +++ b/tests-m32/select.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check select syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/semop.c b/tests-m32/semop.c new file mode 100644 index 00000000..a2ff2635 --- /dev/null +++ b/tests-m32/semop.c @@ -0,0 +1,119 @@ +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/semop_flags.h" + +union semun +{ + int val; + struct semid_ds *buf; + unsigned short *array; + struct seminfo *__buf; +}; + +static int id = -1; + +static void +cleanup(void) +{ + semctl(id, 0, IPC_RMID, 0); + id = -1; +} + +int +main(void) +{ + static const int bogus_semid = 0xfdb97531; + static void * const bogus_sops = (void *) -1L; + static const size_t bogus_nsops = (size_t) 0xdefaceddeadbeefULL; + + static const struct timespec ts_data = { 1, 123456789 }; + + struct timespec *ts = tail_memdup(&ts_data, sizeof(*ts)); + int rc; + + id = semget(IPC_PRIVATE, 1, 0600); + if (id < 0) + perror_msg_and_skip("semget"); + atexit(cleanup); + + union semun sem_union = { .val = 0 }; + if (semctl(id, 0, SETVAL, sem_union) == -1) + perror_msg_and_skip("semctl"); + + struct sembuf *const sem_b = tail_alloc(sizeof(*sem_b)); + struct sembuf *const sem_b2 = tail_alloc(sizeof(*sem_b2)); + + rc = semop(bogus_semid, NULL, bogus_nsops); + printf("semop(%d, NULL, %u) = %s\n", + bogus_semid, (unsigned) bogus_nsops, sprintrc(rc)); + + rc = semop(bogus_semid, bogus_sops, 1); + printf("semop(%d, %p, %u) = %s\n", + bogus_semid, bogus_sops, 1, sprintrc(rc)); + + sem_b->sem_num = 0; + sem_b->sem_op = 1; + sem_b->sem_flg = SEM_UNDO; + + sem_b2->sem_num = 0xface; + sem_b2->sem_op = 0xf00d; + sem_b2->sem_flg = 0xbeef; + + rc = semop(bogus_semid, sem_b2, 2); + printf("semop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u) = %s\n", + bogus_semid, sem_b2->sem_num, sem_b2->sem_op, + sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", + sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", + sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + sem_b2 + 1, 2, sprintrc(rc)); + + if (semop(id, sem_b, 1)) + perror_msg_and_skip("semop, 1"); + printf("semop(%d, [{0, 1, SEM_UNDO}], 1) = 0\n", id); + + sem_b->sem_op = -1; + if (semop(id, sem_b, 1)) + perror_msg_and_skip("semop, -1"); + printf("semop(%d, [{0, -1, SEM_UNDO}], 1) = 0\n", id); + + rc = semtimedop(bogus_semid, NULL, bogus_nsops, NULL); + printf("semtimedop(%d, NULL, %u, NULL) = %s\n", + bogus_semid, (unsigned) bogus_nsops, sprintrc(rc)); + + rc = semtimedop(id, sem_b + 1, 1, ts + 1); + printf("semtimedop(%d, %p, 1, %p) = %s\n", + id, sem_b + 1, ts + 1, sprintrc(rc)); + + rc = semtimedop(bogus_semid, sem_b2, 2, ts); + printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", + bogus_semid, sem_b2->sem_num, sem_b2->sem_op, + sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", + sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", + sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + sem_b2 + 1, 2, + (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec, + sprintrc(rc)); + + sem_b->sem_op = 1; + if (semtimedop(id, sem_b, 1, NULL)) + perror_msg_and_skip("semtimedop, 1"); + printf("semtimedop(%d, [{0, 1, SEM_UNDO}], 1, NULL) = 0\n", id); + + sem_b->sem_op = -1; + if (semtimedop(id, sem_b, 1, ts)) + perror_msg_and_skip("semtimedop, -1"); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1, " + "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", id, + (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/semop.test b/tests-m32/semop.test new file mode 100755 index 00000000..3e77d2f9 --- /dev/null +++ b/tests-m32/semop.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check semop syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests-m32/sendfile.c b/tests-m32/sendfile.c new file mode 100644 index 00000000..23f096b6 --- /dev/null +++ b/tests-m32/sendfile.c @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sendfile + +# include +# include +# include +# include +# include +# include +# include +# include + +int +main(int ac, const char **av) +{ + assert(ac == 1); + + (void) close(0); + if (open("/dev/zero", O_RDONLY) != 0) + perror_msg_and_skip("open: %s", "/dev/zero"); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + int reg_in = open(av[0], O_RDONLY); + if (reg_in < 0) + perror_msg_and_fail("open: %s", av[0]); + + struct stat stb; + assert(fstat(reg_in, &stb) == 0); + const size_t blen = stb.st_size / 3; + const size_t alen = stb.st_size - blen; + assert(S_ISREG(stb.st_mode) && blen > 0); + + const size_t page_len = get_page_size(); + assert(syscall(__NR_sendfile, 0, 1, NULL, page_len) == -1); + if (EBADF != errno) + perror_msg_and_skip("sendfile"); + printf("sendfile(0, 1, NULL, %lu) = -1 EBADF (%m)\n", + (unsigned long) page_len); + + uint32_t *p_off = tail_alloc(sizeof(uint32_t)); + void *p = p_off + 1; + *p_off = 0; + + assert(syscall(__NR_sendfile, 0, 1, p, page_len) == -1); + printf("sendfile(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", + (unsigned long) p, (unsigned long) page_len); + + assert(syscall(__NR_sendfile, sv[1], reg_in, NULL, alen) + == (long) alen); + printf("sendfile(%d, %d, NULL, %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen); + + p = p_off; + if (syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) != (long) alen) { + printf("sendfile(%d, %d, %#lx, %lu) = -1 EFAULT (%m)\n", + sv[1], reg_in, (unsigned long) p_off, + (unsigned long) alen); + --p_off; + *p_off = 0; + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) + == (long) alen); + } + printf("sendfile(%d, %d, [0] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen, (unsigned long) alen); + + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, stb.st_size + 1) + == (long) blen); + printf("sendfile(%d, %d, [%lu] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) stb.st_size, + (unsigned long) stb.st_size + 1, + (unsigned long) blen); + + if (p_off != p) { + uint64_t *p_off64 = (uint64_t *) p_off; + *p_off64 = 0xcafef00dfacefeedULL; + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off64, 1) == -1); + printf("sendfile(%d, %d, [14627392582579060461], 1)" + " = -1 EINVAL (%m)\n", sv[1], reg_in); + *p_off64 = 0xdefaced; + } else { + *p_off = 0xdefaced; + } + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, 1) == 0); + printf("sendfile(%d, %d, [233811181], 1) = 0\n", + sv[1], reg_in); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sendfile") + +#endif diff --git a/tests-m32/sendfile.test b/tests-m32/sendfile.test new file mode 100755 index 00000000..48dba585 --- /dev/null +++ b/tests-m32/sendfile.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sendfile syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/sendfile64.c b/tests-m32/sendfile64.c new file mode 100644 index 00000000..7208c300 --- /dev/null +++ b/tests-m32/sendfile64.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sendfile64 + +# include +# include +# include +# include +# include +# include +# include +# include + +int +main(int ac, const char **av) +{ + assert(ac == 1); + + (void) close(0); + if (open("/dev/zero", O_RDONLY) != 0) + perror_msg_and_skip("open: %s", "/dev/zero"); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + int reg_in = open(av[0], O_RDONLY); + if (reg_in < 0) + perror_msg_and_fail("open: %s", av[0]); + + struct stat stb; + assert(fstat(reg_in, &stb) == 0); + const size_t blen = stb.st_size / 3; + const size_t alen = stb.st_size - blen; + assert(S_ISREG(stb.st_mode) && blen > 0); + + const size_t page_len = get_page_size(); + assert(syscall(__NR_sendfile64, 0, 1, NULL, page_len) == -1); + if (EBADF != errno) + perror_msg_and_skip("sendfile64"); + printf("sendfile64(0, 1, NULL, %lu) = -1 EBADF (%m)\n", + (unsigned long) page_len); + + uint64_t *p_off = tail_alloc(sizeof(uint64_t)); + void *p = p_off + 1; + *p_off = 0; + + assert(syscall(__NR_sendfile64, 0, 1, p, page_len) == -1); + printf("sendfile64(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", + (unsigned long) p, (unsigned long) page_len); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, NULL, alen) + == (long) alen); + printf("sendfile64(%d, %d, NULL, %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, alen) + == (long) alen); + printf("sendfile64(%d, %d, [0] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen, (unsigned long) alen); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, stb.st_size + 1) + == (long) blen); + printf("sendfile64(%d, %d, [%lu] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) stb.st_size, + (unsigned long) stb.st_size + 1, + (unsigned long) blen); + + *p_off = 0xcafef00dfacefeedULL; + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1); + printf("sendfile64(%d, %d, [14627392582579060461], 1)" + " = -1 EINVAL (%m)\n", sv[1], reg_in); + + *p_off = 0xfacefeed; + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == 0); + printf("sendfile64(%d, %d, [4207869677], 1) = 0\n", sv[1], reg_in); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sendfile64") + +#endif diff --git a/tests-m32/sendfile64.test b/tests-m32/sendfile64.test new file mode 100755 index 00000000..faa05254 --- /dev/null +++ b/tests-m32/sendfile64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sendfile64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 diff --git a/tests-m32/set_mempolicy.c b/tests-m32/set_mempolicy.c new file mode 100644 index 00000000..f3261a09 --- /dev/null +++ b/tests-m32/set_mempolicy.c @@ -0,0 +1,146 @@ +/* + * Check decoding of set_mempolicy syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_set_mempolicy + +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/policies.h" + +# define MAX_STRLEN 3 +# define NLONGS(n) ((n + 8 * sizeof(long) - 2) \ + / (8 * sizeof(long))) + +static void +print_nodes(const unsigned long maxnode, unsigned int offset) +{ + unsigned int nlongs = NLONGS(maxnode); + if (nlongs <= offset) + nlongs = 0; + else + nlongs -= offset; + const unsigned int size = nlongs * sizeof(long); + unsigned long *const nodemask = + tail_alloc(size ? size : (offset ? 1 : 0)); + memset(nodemask, 0, size); + + long rc = syscall(__NR_set_mempolicy, 0, nodemask, maxnode); + const char *errstr = sprintrc(rc); + + fputs("set_mempolicy(MPOL_DEFAULT, ", stdout); + + if (nlongs) { + putc('[', stdout); + unsigned int i; + for (i = 0; i < nlongs + offset; ++i) { + if (i) + fputs(", ", stdout); + if (i < nlongs) { + if (i >= MAX_STRLEN) { + fputs("...", stdout); + break; + } + printf("%#0*lx", (int) sizeof(long) * 2 + 2, + nodemask[i]); + } else { + printf("%p", nodemask + i); + break; + } + } + putc(']', stdout); + } else { + if (maxnode) + printf("%p", nodemask); + else + printf("[]"); + } + + printf(", %lu) = %s\n", maxnode, errstr); +} + +static void +test_offset(const unsigned int offset) +{ + unsigned long maxnode = get_page_size() * 8; + + print_nodes(maxnode, offset); + print_nodes(maxnode + 1, offset); + print_nodes(maxnode + 2, offset); + + maxnode = sizeof(long) * 8; + print_nodes(0, offset); + print_nodes(1, offset); + print_nodes(2, offset); + print_nodes(maxnode - 1, offset); + print_nodes(maxnode , offset); + print_nodes(maxnode + 1, offset); + print_nodes(maxnode + 2, offset); + print_nodes(maxnode * 2 - 1, offset); + print_nodes(maxnode * 2 , offset); + print_nodes(maxnode * 2 + 1, offset); + print_nodes(maxnode * 2 + 2, offset); + print_nodes(maxnode * 3 - 1, offset); + print_nodes(maxnode * 3 , offset); + print_nodes(maxnode * 3 + 1, offset); + print_nodes(maxnode * 3 + 2, offset); + print_nodes(maxnode * 4 + 2, offset); +} + +int +main(void) +{ + if (syscall(__NR_set_mempolicy, 0, 0, 0)) + perror_msg_and_skip("set_mempolicy"); + puts("set_mempolicy(MPOL_DEFAULT, NULL, 0) = 0"); + + const unsigned long *nodemask = (void *) 0xfacefeedfffffffeULL; + const unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; + long rc = syscall(__NR_set_mempolicy, 1, nodemask, maxnode); + printf("set_mempolicy(MPOL_PREFERRED, %p, %lu) = %s\n", + nodemask, maxnode, sprintrc(rc)); + + test_offset(0); + test_offset(1); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_set_mempolicy") + +#endif diff --git a/tests-m32/set_mempolicy.test b/tests-m32/set_mempolicy.test new file mode 100755 index 00000000..0ed6666c --- /dev/null +++ b/tests-m32/set_mempolicy.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check set_mempolicy syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a35 diff --git a/tests-m32/set_ptracer_any.c b/tests-m32/set_ptracer_any.c new file mode 100644 index 00000000..bc2f90ca --- /dev/null +++ b/tests-m32/set_ptracer_any.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#ifdef HAVE_PRCTL +# include +#endif + +int main(int argc, char **argv) +{ + if (argc < 2) + return 99; +#if defined HAVE_PRCTL && defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY + /* Turn off restrictions on tracing if applicable. If the options + * aren't available on this system, that's OK too. */ + (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); +#endif + if (write(1, "\n", 1) != 1) { + perror("write"); + return 99; + } + (void) execvp(argv[1], argv + 1); + perror(argv[1]); + return 99; +} diff --git a/tests-m32/setdomainname.c b/tests-m32/setdomainname.c new file mode 100644 index 00000000..f3e24840 --- /dev/null +++ b/tests-m32/setdomainname.c @@ -0,0 +1,24 @@ +#include "tests.h" +#include + +#ifdef __NR_setdomainname + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_setdomainname, 0, 63); + printf("setdomainname(NULL, 63) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setdomainname") + +#endif diff --git a/tests-m32/setdomainname.test b/tests-m32/setdomainname.test new file mode 100755 index 00000000..2159e7c4 --- /dev/null +++ b/tests-m32/setdomainname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setdomainname syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/setfsgid.c b/tests-m32/setfsgid.c new file mode 100644 index 00000000..871f4b35 --- /dev/null +++ b/tests-m32/setfsgid.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsgid + +# define SYSCALL_NR __NR_setfsgid +# define SYSCALL_NAME "setfsgid" + +# if defined __NR_setfsgid32 && __NR_setfsgid != __NR_setfsgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# endif + +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsgid") + +#endif diff --git a/tests-m32/setfsgid.test b/tests-m32/setfsgid.test new file mode 100755 index 00000000..0ae2b0a2 --- /dev/null +++ b/tests-m32/setfsgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/setfsgid32.c b/tests-m32/setfsgid32.c new file mode 100644 index 00000000..6279abd3 --- /dev/null +++ b/tests-m32/setfsgid32.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsgid32 + +# define SYSCALL_NR __NR_setfsgid32 +# define SYSCALL_NAME "setfsgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsgid32") + +#endif diff --git a/tests-m32/setfsgid32.test b/tests-m32/setfsgid32.test new file mode 100755 index 00000000..9b7a2bf8 --- /dev/null +++ b/tests-m32/setfsgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/setfsugid.c b/tests-m32/setfsugid.c new file mode 100644 index 00000000..79ba34d8 --- /dev/null +++ b/tests-m32/setfsugid.c @@ -0,0 +1,76 @@ +/* + * Check decoding of setfsuid/setfsgid/setfsuid32/setfsgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +void +printuid(unsigned UGID_TYPE id) +{ + if (id == (unsigned UGID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + unsigned int ugid = GETUGID; + + const kernel_ulong_t tests[] = { + ugid, + 0xffff0000U | ugid, + (kernel_ulong_t) 0xffffffff00000000ULL | ugid, + 0xffffU, + -1U, + -1L, + 0xc0deffffU, + 0xfacefeedU, + (long) 0xfacefeeddeadbeefULL + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int num = (unsigned UGID_TYPE) tests[i]; + unsigned int rc; + + rc = syscall(SYSCALL_NR, tests[i]); + printf("%s(", SYSCALL_NAME); + printuid(num); + printf(") = %u\n", rc); + + rc = syscall(SYSCALL_NR, ugid); + printf("%s(%u) = %u\n", SYSCALL_NAME, ugid, rc); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/setfsuid.c b/tests-m32/setfsuid.c new file mode 100644 index 00000000..d6faf971 --- /dev/null +++ b/tests-m32/setfsuid.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsuid + +# define SYSCALL_NR __NR_setfsuid +# define SYSCALL_NAME "setfsuid" + +# if defined __NR_setfsuid32 && __NR_setfsuid != __NR_setfsuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# endif + +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsuid") + +#endif diff --git a/tests-m32/setfsuid.test b/tests-m32/setfsuid.test new file mode 100755 index 00000000..18a10219 --- /dev/null +++ b/tests-m32/setfsuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/setfsuid32.c b/tests-m32/setfsuid32.c new file mode 100644 index 00000000..b71cf235 --- /dev/null +++ b/tests-m32/setfsuid32.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsuid32 + +# define SYSCALL_NR __NR_setfsuid32 +# define SYSCALL_NAME "setfsuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsuid32") + +#endif diff --git a/tests-m32/setfsuid32.test b/tests-m32/setfsuid32.test new file mode 100755 index 00000000..2dce3cc9 --- /dev/null +++ b/tests-m32/setfsuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/setgid.c b/tests-m32/setgid.c new file mode 100644 index 00000000..8794a0a4 --- /dev/null +++ b/tests-m32/setgid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setgid + +# define SYSCALL_NR __NR_setgid +# define SYSCALL_NAME "setgid" + +# if defined __NR_setgid32 && __NR_setgid != __NR_setgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgid") + +#endif diff --git a/tests-m32/setgid.test b/tests-m32/setgid.test new file mode 100755 index 00000000..a3a90041 --- /dev/null +++ b/tests-m32/setgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/setgid32.c b/tests-m32/setgid32.c new file mode 100644 index 00000000..17f43c58 --- /dev/null +++ b/tests-m32/setgid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setgid32 + +# define SYSCALL_NR __NR_setgid32 +# define SYSCALL_NAME "setgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgid32") + +#endif diff --git a/tests-m32/setgid32.test b/tests-m32/setgid32.test new file mode 100755 index 00000000..11a87e12 --- /dev/null +++ b/tests-m32/setgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/setgroups.c b/tests-m32/setgroups.c new file mode 100644 index 00000000..1ec8333f --- /dev/null +++ b/tests-m32/setgroups.c @@ -0,0 +1,190 @@ +/* + * Check decoding of setgroups/setgroups32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef __NR_setgroups32 + +# define SYSCALL_NR __NR_setgroups32 +# define SYSCALL_NAME "setgroups32" +# define GID_TYPE unsigned int + +#else + +# include "tests.h" +# include + +# ifdef __NR_setgroups + +# define SYSCALL_NR __NR_setgroups +# define SYSCALL_NAME "setgroups" +# if defined __NR_setgroups32 && __NR_setgroups != __NR_setgroups32 +# define GID_TYPE unsigned short +# else +# define GID_TYPE unsigned int +# endif + +# endif + +#endif + +#ifdef GID_TYPE + +# include +# include + +void +printuid(GID_TYPE id) +{ + if (id == (GID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + const char *errstr; + + /* check how the first argument is decoded */ + long rc = syscall(SYSCALL_NR, 0, 0); + printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, 0); + printf("%s(1, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000001ULL, 0); + printf("%s(1, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1U, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1L, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + /* check how the second argument is decoded */ + const GID_TYPE *const g1 = tail_alloc(sizeof(*g1)); + GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * 2); + GID_TYPE *const g3 = tail_alloc(sizeof(*g3) * 3); + + rc = syscall(SYSCALL_NR, 0, g1 + 1); + printf("%s(0, []) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, g1); + errstr = sprintrc(rc); + printf("%s(1, [", SYSCALL_NAME); + printuid(*g1); + printf("]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 1, g1 + 1); + printf("%s(1, %p) = %s\n", SYSCALL_NAME, g1 + 1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, -1L); + printf("%s(1, %#lx) = %s\n", SYSCALL_NAME, -1L, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 2, g1); + errstr = sprintrc(rc); + printf("%s(2, [", SYSCALL_NAME); + printuid(*g1); + printf(", %p]) = %s\n", g1 + 1, errstr); + + g2[0] = -2; + g2[1] = -3; + rc = syscall(SYSCALL_NR, 2, g2); + errstr = sprintrc(rc); + printf("%s(2, [", SYSCALL_NAME); + printuid(g2[0]); + printf(", "); + printuid(g2[1]); + printf("]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 3, g2); + errstr = sprintrc(rc); + printf("%s(3, [", SYSCALL_NAME); + printuid(g2[0]); + printf(", "); + printuid(g2[1]); + printf(", %p]) = %s\n", g2 + 2, errstr); + + g3[0] = 0; + g3[1] = 1; + rc = syscall(SYSCALL_NR, 3, g3); + errstr = sprintrc(rc); + printf("%s(3, [", SYSCALL_NAME); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 4, g3); + errstr = sprintrc(rc); + printf("%s(4, [", SYSCALL_NAME); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = sysconf(_SC_NGROUPS_MAX); + const unsigned ngroups_max = rc; + + if ((unsigned long) rc == ngroups_max && (int) ngroups_max > 0) { + rc = syscall(SYSCALL_NR, ngroups_max, g3); + errstr = sprintrc(rc); + printf("%s(%d, [", SYSCALL_NAME, ngroups_max); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + const unsigned long size = + (unsigned long) 0xffffffff00000000ULL | ngroups_max; + rc = syscall(SYSCALL_NR, size, g3); + errstr = sprintrc(rc); + printf("%s(%d, [", SYSCALL_NAME, ngroups_max); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, ngroups_max + 1, g3); + printf("%s(%d, %p) = %s\n", SYSCALL_NAME, + ngroups_max + 1, g3, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgroups") + +#endif diff --git a/tests-m32/setgroups.test b/tests-m32/setgroups.test new file mode 100755 index 00000000..0dcc8f75 --- /dev/null +++ b/tests-m32/setgroups.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgroups syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a17 diff --git a/tests-m32/setgroups32.c b/tests-m32/setgroups32.c new file mode 100644 index 00000000..ecf00bbd --- /dev/null +++ b/tests-m32/setgroups32.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include + +#ifdef __NR_setgroups32 + +# include "setgroups.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgroups32") + +#endif diff --git a/tests-m32/setgroups32.test b/tests-m32/setgroups32.test new file mode 100755 index 00000000..ee4750d1 --- /dev/null +++ b/tests-m32/setgroups32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgroups32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a19 diff --git a/tests-m32/sethostname.c b/tests-m32/sethostname.c new file mode 100644 index 00000000..e1b2f069 --- /dev/null +++ b/tests-m32/sethostname.c @@ -0,0 +1,79 @@ +/* + * Check decoding of sethostname syscall. + * + * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sethostname + +# include +# include + +#ifdef HAVE_LINUX_UTSNAME_H +# include +#endif + +#ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +#endif + +int +main(void) +{ + kernel_ulong_t len; + long rc; + + len = __NEW_UTS_LEN; + rc = syscall(__NR_sethostname, 0, len); + printf("sethostname(NULL, %u) = %s\n", + (unsigned) len, sprintrc(rc)); + + if (F8ILL_KULONG_MASK) { + len |= F8ILL_KULONG_MASK; + rc = syscall(__NR_sethostname, 0, len); + printf("sethostname(NULL, %u) = %s\n", + (unsigned) len, sprintrc(rc)); + } + + len = __NEW_UTS_LEN + 1; + void *const p = tail_alloc(len); + rc = syscall(__NR_sethostname, p, len); + printf("sethostname(%p, %u) = %s\n", + p, (unsigned) len, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sethostname") + +#endif diff --git a/tests-m32/sethostname.test b/tests-m32/sethostname.test new file mode 100755 index 00000000..78f8c58e --- /dev/null +++ b/tests-m32/sethostname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sethostname syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/setns.c b/tests-m32/setns.c new file mode 100644 index 00000000..54a15317 --- /dev/null +++ b/tests-m32/setns.c @@ -0,0 +1,73 @@ +/* + * Check decoding of setns syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_setns + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfeedfacedeadc0deULL; + + static struct { + kernel_ulong_t val; + const char *str; + } nstypes[] = { + { (kernel_ulong_t) 0xdefaced100000000ULL, "0" }, + { (kernel_ulong_t) 0xbadc0dedfeedfaceULL, + "0xfeedface /* CLONE_NEW??? */" }, + { (kernel_ulong_t) 0xca75f15702000000ULL, "CLONE_NEWCGROUP" }, + }; + + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(nstypes); i++) { + rc = syscall(__NR_setns, bogus_fd, nstypes[i].val); + printf("setns(%d, %s) = %s\n", + (int) bogus_fd, nstypes[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setns"); + +#endif diff --git a/tests-m32/setns.test b/tests-m32/setns.test new file mode 100755 index 00000000..e9a905ab --- /dev/null +++ b/tests-m32/setns.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of setns syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/setregid.c b/tests-m32/setregid.c new file mode 100644 index 00000000..e1da7862 --- /dev/null +++ b/tests-m32/setregid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setregid + +# define SYSCALL_NR __NR_setregid +# define SYSCALL_NAME "setregid" + +# if defined __NR_setregid32 && __NR_setregid != __NR_setregid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setregid") + +#endif diff --git a/tests-m32/setregid.test b/tests-m32/setregid.test new file mode 100755 index 00000000..101c7bdf --- /dev/null +++ b/tests-m32/setregid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setregid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/setregid32.c b/tests-m32/setregid32.c new file mode 100644 index 00000000..3cf0daf6 --- /dev/null +++ b/tests-m32/setregid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setregid32 + +# define SYSCALL_NR __NR_setregid32 +# define SYSCALL_NAME "setregid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setregid32") + +#endif diff --git a/tests-m32/setregid32.test b/tests-m32/setregid32.test new file mode 100755 index 00000000..e57e66c4 --- /dev/null +++ b/tests-m32/setregid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setregid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/setresgid.c b/tests-m32/setresgid.c new file mode 100644 index 00000000..8701df8e --- /dev/null +++ b/tests-m32/setresgid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setresgid + +# define SYSCALL_NR __NR_setresgid +# define SYSCALL_NAME "setresgid" + +# if defined __NR_setresgid32 && __NR_setresgid != __NR_setresgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresgid") + +#endif diff --git a/tests-m32/setresgid.test b/tests-m32/setresgid.test new file mode 100755 index 00000000..5a695742 --- /dev/null +++ b/tests-m32/setresgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/setresgid32.c b/tests-m32/setresgid32.c new file mode 100644 index 00000000..dfce4572 --- /dev/null +++ b/tests-m32/setresgid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setresgid32 + +# define SYSCALL_NR __NR_setresgid32 +# define SYSCALL_NAME "setresgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresgid32") + +#endif diff --git a/tests-m32/setresgid32.test b/tests-m32/setresgid32.test new file mode 100755 index 00000000..528b2c9e --- /dev/null +++ b/tests-m32/setresgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/setresugid.c b/tests-m32/setresugid.c new file mode 100644 index 00000000..711bd317 --- /dev/null +++ b/tests-m32/setresugid.c @@ -0,0 +1,113 @@ +/* + * Check decoding of setresuid/setresgid/setresuid32/setresgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +static int +ugid2int(const unsigned UGID_TYPE ugid) +{ + if ((unsigned UGID_TYPE) -1U == ugid) + return -1; + else + return ugid; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf("-1"); + else + printf("%u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int ugid) +{ + return num == ugid || num == -1U; +} + +#define TRIPLE(val) \ + { val, ugid, ugid }, { ugid, val, ugid }, { ugid, ugid, val } + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const struct { + const long r, e, s; + } tests[] = { + { ugid, ugid, ugid }, + TRIPLE((unsigned long) 0xffffffff00000000ULL | ugid), + TRIPLE(-1U), + TRIPLE(-1L), + TRIPLE(0xffff0000U | ugid), + TRIPLE(0xffff), + TRIPLE(0xc0deffffU) + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int rn = ugid2int(tests[i].r); + const unsigned int en = ugid2int(tests[i].e); + const unsigned int sn = ugid2int(tests[i].s); + + if (!num_matches_id(rn, ugid) || + !num_matches_id(en, ugid) || + !num_matches_id(sn, ugid)) + continue; + + if (syscall(SYSCALL_NR, tests[i].r, tests[i].e, tests[i].s)) { + if (!i && ENOSYS == errno) { + printf("%s(%u, %u, %u) = -1 ENOSYS (%m)\n", + SYSCALL_NAME, ugid, ugid, ugid); + break; + } + perror_msg_and_fail("%s(%#lx, %#lx, %#lx)", + SYSCALL_NAME, + tests[i].r, tests[i].e, tests[i].s); + } + + printf("%s(", SYSCALL_NAME); + print_int(rn); + printf(", "); + print_int(en); + printf(", "); + print_int(sn); + printf(") = 0\n"); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/setresuid.c b/tests-m32/setresuid.c new file mode 100644 index 00000000..3a9dbd1f --- /dev/null +++ b/tests-m32/setresuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setresuid + +# define SYSCALL_NR __NR_setresuid +# define SYSCALL_NAME "setresuid" + +# if defined __NR_setresuid32 && __NR_setresuid != __NR_setresuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresuid") + +#endif diff --git a/tests-m32/setresuid.test b/tests-m32/setresuid.test new file mode 100755 index 00000000..f1219e06 --- /dev/null +++ b/tests-m32/setresuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/setresuid32.c b/tests-m32/setresuid32.c new file mode 100644 index 00000000..387268a7 --- /dev/null +++ b/tests-m32/setresuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setresuid32 + +# define SYSCALL_NR __NR_setresuid32 +# define SYSCALL_NAME "setresuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresuid32") + +#endif diff --git a/tests-m32/setresuid32.test b/tests-m32/setresuid32.test new file mode 100755 index 00000000..942a3a65 --- /dev/null +++ b/tests-m32/setresuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/setreugid.c b/tests-m32/setreugid.c new file mode 100644 index 00000000..38c80d57 --- /dev/null +++ b/tests-m32/setreugid.c @@ -0,0 +1,106 @@ +/* + * Check decoding of setreuid/setregid/setreuid32/setregid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +static int +ugid2int(const unsigned UGID_TYPE ugid) +{ + if ((unsigned UGID_TYPE) -1U == ugid) + return -1; + else + return ugid; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf("-1"); + else + printf("%u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int ugid) +{ + return num == ugid || num == -1U; +} + +#define PAIR(val) { val, ugid }, { ugid, val } + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const struct { + const long r, e; + } tests[] = { + { ugid, ugid }, + PAIR((unsigned long) 0xffffffff00000000ULL | ugid), + PAIR(-1U), + PAIR(-1L), + PAIR(0xffff0000U | ugid), + PAIR(0xffff), + PAIR(0xc0deffffU) + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int rn = ugid2int(tests[i].r); + const unsigned int en = ugid2int(tests[i].e); + + if (!num_matches_id(rn, ugid) || !num_matches_id(en, ugid)) + continue; + + if (syscall(SYSCALL_NR, tests[i].r, tests[i].e)) { + if (!i && ENOSYS == errno) { + printf("%s(%u, %u) = -1 ENOSYS (%m)\n", + SYSCALL_NAME, ugid, ugid); + break; + } + perror_msg_and_fail("%s(%#lx, %#lx)", SYSCALL_NAME, + tests[i].r, tests[i].e); + } + + printf("%s(", SYSCALL_NAME); + print_int(rn); + printf(", "); + print_int(en); + printf(") = 0\n"); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/setreuid.c b/tests-m32/setreuid.c new file mode 100644 index 00000000..68e75192 --- /dev/null +++ b/tests-m32/setreuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setreuid + +# define SYSCALL_NR __NR_setreuid +# define SYSCALL_NAME "setreuid" + +# if defined __NR_setreuid32 && __NR_setreuid != __NR_setreuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setreuid") + +#endif diff --git a/tests-m32/setreuid.test b/tests-m32/setreuid.test new file mode 100755 index 00000000..b6db3c1d --- /dev/null +++ b/tests-m32/setreuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setreuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/setreuid32.c b/tests-m32/setreuid32.c new file mode 100644 index 00000000..ba017621 --- /dev/null +++ b/tests-m32/setreuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setreuid32 + +# define SYSCALL_NR __NR_setreuid32 +# define SYSCALL_NAME "setreuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setreuid32") + +#endif diff --git a/tests-m32/setreuid32.test b/tests-m32/setreuid32.test new file mode 100755 index 00000000..23323d47 --- /dev/null +++ b/tests-m32/setreuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setreuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/setrlimit.c b/tests-m32/setrlimit.c new file mode 100644 index 00000000..e93c8e37 --- /dev/null +++ b/tests-m32/setrlimit.c @@ -0,0 +1,70 @@ +/* + * Check decoding of setrlimit syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_setrlimit + +# include "xgetrlimit.c" + +int +main(void) +{ + kernel_ulong_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(__NR_setrlimit, res, 0); + printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); + + struct rlimit libc_rlim = {}; + if (getrlimit((int) res, &libc_rlim)) + continue; + rlimit[0] = libc_rlim.rlim_cur; + rlimit[1] = libc_rlim.rlim_max; + + rc = syscall(__NR_setrlimit, res, rlimit); + const char *errstr = sprintrc(rc); + printf("setrlimit(%s, {rlim_cur=%s, rlim_max=%s}) = %s\n", + xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setrlimit") + +#endif diff --git a/tests-m32/setrlimit.test b/tests-m32/setrlimit.test new file mode 100755 index 00000000..79206089 --- /dev/null +++ b/tests-m32/setrlimit.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getrlimit/ugetrlimit/setrlimit syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/setugid.c b/tests-m32/setugid.c new file mode 100644 index 00000000..aba277c5 --- /dev/null +++ b/tests-m32/setugid.c @@ -0,0 +1,91 @@ +/* + * Check decoding of setuid/setgid/setuid32/setgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +void +printuid(unsigned UGID_TYPE id) +{ + if (id == (unsigned UGID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const long tests[] = { + ugid, + 0xffff0000U | ugid, + (unsigned long) 0xffffffff00000000ULL | ugid, + 0xffffU, + -1U, + -1L + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int num = (unsigned UGID_TYPE) tests[i]; + long expected; + + if (num == ugid) + expected = 0; + else if ((UGID_TYPE) num == (UGID_TYPE) -1U) + expected = -1; + else + continue; + + const long rc = syscall(SYSCALL_NR, tests[i]); + const char *errstr = sprintrc(rc); + + if (rc != expected) { + if (!i && ENOSYS == errno) { + printf("%s(%u) = %s\n", + SYSCALL_NAME, ugid, errstr); + break; + } + perror_msg_and_fail("%s(%#lx) != %ld", + SYSCALL_NAME, tests[i], expected); + } + + printf("%s(", SYSCALL_NAME); + printuid(num); + printf(") = %s\n", errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/setuid.c b/tests-m32/setuid.c new file mode 100644 index 00000000..df2e46b1 --- /dev/null +++ b/tests-m32/setuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setuid + +# define SYSCALL_NR __NR_setuid +# define SYSCALL_NAME "setuid" + +# if defined __NR_setuid32 && __NR_setuid != __NR_setuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setuid") + +#endif diff --git a/tests-m32/setuid.test b/tests-m32/setuid.test new file mode 100755 index 00000000..9279233a --- /dev/null +++ b/tests-m32/setuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/setuid32.c b/tests-m32/setuid32.c new file mode 100644 index 00000000..c837d547 --- /dev/null +++ b/tests-m32/setuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setuid32 + +# define SYSCALL_NR __NR_setuid32 +# define SYSCALL_NAME "setuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setuid32") + +#endif diff --git a/tests-m32/setuid32.test b/tests-m32/setuid32.test new file mode 100755 index 00000000..7998392a --- /dev/null +++ b/tests-m32/setuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/shmxt.c b/tests-m32/shmxt.c new file mode 100644 index 00000000..23cc7ccf --- /dev/null +++ b/tests-m32/shmxt.c @@ -0,0 +1,68 @@ +#include "tests.h" +#include +#include +#include + +static int id = -1; + +static void +cleanup(void) +{ + shmctl(id, IPC_RMID, NULL); + id = -1; +} + +#ifdef __alpha__ +# define SHMAT "osf_shmat" +#else +# define SHMAT "shmat" +#endif + +int +main(void) +{ + static const int bogus_shmid = 0xfdb97531; + static const void * const bogus_shmaddr = + (void *) (unsigned long) 0xdec0ded1dec0ded2ULL; + static const int bogus_shmflg = 0xffffface; + + long rc; + + id = shmget(IPC_PRIVATE, 1, 0600); + if (id < 0) + perror_msg_and_skip("shmget"); + atexit(cleanup); + + rc = (long) shmat(bogus_shmid, bogus_shmaddr, bogus_shmflg); + printf("%s(%d, %p, SHM_REMAP|SHM_RDONLY|SHM_RND|%#x) = %s\n", + SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0x7000, + sprintrc(rc)); + + shmat(id, NULL, SHM_REMAP); + printf("%s(%d, NULL, SHM_REMAP) = -1 %s (%m)\n", + SHMAT, id, errno2name()); + + void *shmaddr = shmat(id, NULL, SHM_RDONLY); + if (shmaddr == (void *)(-1)) + perror_msg_and_skip("shmat SHM_RDONLY"); + printf("%s(%d, NULL, SHM_RDONLY) = %p\n", SHMAT, id, shmaddr); + + rc = shmdt(NULL); + printf("shmdt(NULL) = %s\n", sprintrc(rc)); + + if (shmdt(shmaddr)) + perror_msg_and_skip("shmdt"); + printf("shmdt(%p) = 0\n", shmaddr); + + ++shmaddr; + void *shmaddr2 = shmat(id, shmaddr, SHM_RND); + if (shmaddr2 == (void *)(-1)) + printf("%s(%d, %p, SHM_RND) = -1 %s (%m)\n", + SHMAT, id, shmaddr, errno2name()); + else + printf("%s(%d, %p, SHM_RND) = %p\n", + SHMAT, id, shmaddr, shmaddr2); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/shmxt.test b/tests-m32/shmxt.test new file mode 100755 index 00000000..3757cfa4 --- /dev/null +++ b/tests-m32/shmxt.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check shmat and shmdt syscalls decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha) shmat=osf_shmat ;; + *) shmat=shmat ;; +esac + +run_strace_match_diff -e trace=$shmat,shmdt -a11 diff --git a/tests-m32/shutdown.c b/tests-m32/shutdown.c new file mode 100644 index 00000000..d770c43a --- /dev/null +++ b/tests-m32/shutdown.c @@ -0,0 +1,15 @@ +/* Check decoding of shutdown syscall. */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + int rc = shutdown(-1, SHUT_RDWR); + printf("shutdown(-1, SHUT_RDWR) = %d %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/shutdown.test b/tests-m32/shutdown.test new file mode 100755 index 00000000..22f0d5ab --- /dev/null +++ b/tests-m32/shutdown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of shutdown syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/sigaction.awk b/tests-m32/sigaction.awk new file mode 100644 index 00000000..9c3a9ed3 --- /dev/null +++ b/tests-m32/sigaction.awk @@ -0,0 +1,95 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2016 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + n1[1][1] = n2[1][1] = "SIG_IGN" + n1[1][2] = n2[1][2] = "\\[HUP INT\\]" + n1[1][3] = "SA_RESTORER\\|SA_RESTART" + n2[1][3] = "SA_RESTART" + n1[1][4] = ", sa_restorer=0x[0-9a-f]+" + n2[1][4] = "" + + n1[2][1] = n2[2][1] = "0x[0-9a-f]+" + n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" + n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" + n2[2][3] = "SA_SIGINFO" + n1[2][4] = ", sa_restorer=0x[0-9a-f]+" + n2[2][4] = "" + + n1[3][1] = n2[3][1] = "SIG_DFL" + n1[3][2] = n2[3][2] = "\\[\\]" + n1[3][3] = "SA_RESTORER" + n2[3][3] = "0" + n1[3][4] = ", sa_restorer=0x[0-9a-f]+" + n2[3][4] = "" + + n1[4][1] = n2[4][1] = "SIG_DFL" + n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" + n1[4][3] = "SA_RESTORER" + n2[4][3] = "0" + n1[4][4] = ", sa_restorer=0x[0-9a-f]+" + n2[4][4] = "" + + o1[1][1] = o2[1][1] = "SIG_DFL" + o1[1][2] = o2[1][2] = "\\[\\]" + o1[1][3] = o2[1][3] = "0" + o1[1][4] = o2[1][4] = "" + + for (i = 2; i < 5; i++) { + for (j = 1; j < 5; j++) { + o1[i][j] = n1[i - 1][j] + o2[i][j] = n2[i - 1][j] + } + } + + a1 = "(0x[0-9a-f]+, )?(4|8|16)" + a2 = "(4|8|16)(, 0x[0-9a-f]+)?" + a3 = "0x[0-9a-f]+, (4|8|16)" + + for (i = 1; i < 5; i++) { + r[i] = "^rt_sigaction\\(SIGUSR2, (" \ + "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ + ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ + o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ + o1[i][4] "\\}, " a1 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a2 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a3 ")\\) = 0$" + } + s[5] = "+++ exited with 0 +++" + + lines = 5 + fail = 0 +} + +@include "match.awk" diff --git a/tests-m32/sigaction.c b/tests-m32/sigaction.c new file mode 100644 index 00000000..1c034ff3 --- /dev/null +++ b/tests-m32/sigaction.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +static void handle_signal(int no) +{ + _exit(128 + no); +} + +int +main(void) +{ + struct sigaction sa, sa0; + + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGHUP); + sigaddset(&sa.sa_mask, SIGINT); + sa.sa_flags = SA_RESTART; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = handle_signal; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGQUIT); + sigaddset(&sa.sa_mask, SIGTERM); + sa.sa_flags = SA_SIGINFO; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = SIG_DFL; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sigfillset(&sa.sa_mask); + sigdelset(&sa.sa_mask, SIGHUP); + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + return 0; +} diff --git a/tests-m32/sigaction.test b/tests-m32/sigaction.test new file mode 100755 index 00000000..fcde3baf --- /dev/null +++ b/tests-m32/sigaction.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check rt_sigaction decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -ert_sigaction $args +match_awk + +exit 0 diff --git a/tests-m32/sigaltstack.c b/tests-m32/sigaltstack.c new file mode 100644 index 00000000..884e3c55 --- /dev/null +++ b/tests-m32/sigaltstack.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +int +main(void) +{ + stack_t ss = { + .ss_sp = (void *) 0xbaadf00d, + .ss_flags = SS_DISABLE, + .ss_size = 0xdeadbeef + }; + if (sigaltstack(&ss, (stack_t *) 0)) + perror_msg_and_skip("sigaltstack"); + return 0; +} diff --git a/tests-m32/sigaltstack.expected b/tests-m32/sigaltstack.expected new file mode 100644 index 00000000..be8092ba --- /dev/null +++ b/tests-m32/sigaltstack.expected @@ -0,0 +1,2 @@ +sigaltstack({ss_sp=0xbaadf00d, ss_flags=SS_DISABLE, ss_size=3735928559}, NULL) = 0 ++++ exited with 0 +++ diff --git a/tests-m32/sigaltstack.test b/tests-m32/sigaltstack.test new file mode 100755 index 00000000..ff83c2ea --- /dev/null +++ b/tests-m32/sigaltstack.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check sigaltstack syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e sigaltstack $args +match_diff + +exit 0 diff --git a/tests-m32/siginfo.c b/tests-m32/siginfo.c new file mode 100644 index 00000000..2ecb13fd --- /dev/null +++ b/tests-m32/siginfo.c @@ -0,0 +1,175 @@ +/* + * Check SIGCHLD siginfo_t decoding. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static siginfo_t sinfo; + +static void +handler(int no, siginfo_t *si, void *uc) +{ + memcpy(&sinfo, si, sizeof(sinfo)); +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + assert(sigaction(SIGCHLD, &sa, NULL) == 0); + + sigset_t block_mask, unblock_mask; + assert(sigprocmask(SIG_SETMASK, NULL, &block_mask) == 0); + sigaddset(&block_mask, SIGCHLD); + assert(sigprocmask(SIG_SETMASK, &block_mask, NULL) == 0); + + unblock_mask = block_mask; + sigdelset(&unblock_mask, SIGCHLD); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED" + ", si_pid=%d, si_uid=%u, si_status=%d" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, sinfo.si_status, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + int s; + assert(wait(&s) == pid); + assert(WIFEXITED(s) && WEXITSTATUS(s) == 42); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + char c; + assert(read(0, &c, sizeof(c)) == 1); + (void) raise(SIGUSR1); + return 1; + } + + (void) close(0); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED" + ", si_pid=%d, si_uid=%u, si_status=SIGUSR1" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(wait(&s) == pid); + assert(WIFSIGNALED(s) && WTERMSIG(s) == SIGUSR1); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_STOPPED" + ", si_pid=%d, si_uid=%u, si_status=SIGSTOP" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(kill(pid, SIGCONT) == 0); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_CONTINUED" + ", si_pid=%d, si_uid=%u, si_status=SIGCONT" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED" + ", si_pid=%d, si_uid=%u, si_status=0" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(wait(&s) == pid && s == 0); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/siginfo.test b/tests-m32/siginfo.test new file mode 100755 index 00000000..725f714f --- /dev/null +++ b/tests-m32/siginfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check SIGCHLD siginfo_t decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=none diff --git a/tests-m32/signal2name.c b/tests-m32/signal2name.c new file mode 100644 index 00000000..e301f4ee --- /dev/null +++ b/tests-m32/signal2name.c @@ -0,0 +1,55 @@ +#include "tests.h" +#include + +#define CASE(x) case x: return #x + +const char * +signal2name(int sig) +{ + switch (sig) { + CASE(SIGALRM); + CASE(SIGBUS); + CASE(SIGCHLD); + CASE(SIGCONT); + CASE(SIGFPE); + CASE(SIGHUP); + CASE(SIGILL); + CASE(SIGINT); + CASE(SIGIO); + CASE(SIGPIPE); + CASE(SIGPROF); + CASE(SIGQUIT); + CASE(SIGSEGV); + CASE(SIGSYS); + CASE(SIGTERM); + CASE(SIGTRAP); + CASE(SIGTSTP); + CASE(SIGTTIN); + CASE(SIGTTOU); + CASE(SIGURG); + CASE(SIGUSR1); + CASE(SIGUSR2); + CASE(SIGVTALRM); + CASE(SIGWINCH); + CASE(SIGXCPU); + CASE(SIGXFSZ); +#if defined ALPHA + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGINFO); +#elif defined SPARC || defined SPARC64 + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGLOST); +#elif defined MIPS + CASE(SIGEMT); + CASE(SIGIOT); + CASE(SIGPWR); +#else + CASE(SIGABRT); + CASE(SIGPWR); + CASE(SIGSTKFLT); +#endif + default: perror_msg_and_fail("unknown signal number %d", sig); + } +} diff --git a/tests-m32/signal_receive.c b/tests-m32/signal_receive.c new file mode 100644 index 00000000..1c4293e5 --- /dev/null +++ b/tests-m32/signal_receive.c @@ -0,0 +1,45 @@ +#include "tests.h" +#include +#include +#include + +void sig_print(const char *signame, const int pid, const int uid) +{ + printf("kill(%d, %s) = 0\n" + "--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" + ", si_uid=%d} ---\n", + pid, signame, signame, signame, pid, uid); +} + +static void +handler(int sig) +{ +} + +int +main(void) +{ + int sig, pid = getpid(), uid = getuid(); + const struct sigaction act = { .sa_handler = handler }; + sigset_t mask; + sigemptyset(&mask); + + for (sig = 1; sig <= 31; sig++) { + if( sig != SIGKILL && sig != SIGSTOP) { + sigaction(sig, &act, NULL); + sigaddset(&mask, sig); + } + } + sigprocmask(SIG_UNBLOCK, &mask, NULL); + + for (sig = 1; sig <= 31; sig++) { + if(sig != SIGKILL && sig != SIGSTOP) { + if (kill(pid, sig) != 0) + perror_msg_and_fail("kill: %d", sig); + sig_print(signal2name(sig), pid, uid); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/signal_receive.test b/tests-m32/signal_receive.test new file mode 100755 index 00000000..9685b666 --- /dev/null +++ b/tests-m32/signal_receive.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check whether strace traces signals properly. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -e trace=kill diff --git a/tests-m32/signalfd4.c b/tests-m32/signalfd4.c new file mode 100644 index 00000000..47e49b50 --- /dev/null +++ b/tests-m32/signalfd4.c @@ -0,0 +1,86 @@ +/* + * Check decoding of signalfd4 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_rt_sigprocmask \ + && defined HAVE_SYS_SIGNALFD_H \ + && defined HAVE_SIGNALFD \ + && defined O_CLOEXEC + +# include +# include +# include +# include + +static unsigned int +get_sigset_size(void) +{ + const unsigned int big_size = 1024 / 8; + unsigned int set_size; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, + NULL, NULL, set_size)) + break; + } + + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + + return set_size; +} + +int +main(void) +{ + const char *const sigs = SIGUSR2 < SIGCHLD ? "USR2 CHLD" : "CHLD USR2"; + const unsigned int size = get_sigset_size(); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGCHLD); + + int fd = signalfd(-1, &mask, O_CLOEXEC | O_NONBLOCK); + printf("signalfd4(-1, [%s], %u, SFD_CLOEXEC|SFD_NONBLOCK) = %s\n", + sigs, size, sprintrc(fd)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask && HAVE_SYS_SIGNALFD_H" + " && HAVE_SIGNALFD && O_CLOEXEC") + +#endif diff --git a/tests-m32/signalfd4.test b/tests-m32/signalfd4.test new file mode 100755 index 00000000..a615a5bf --- /dev/null +++ b/tests-m32/signalfd4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of signalfd4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/sigreturn.c b/tests-m32/sigreturn.c new file mode 100644 index 00000000..dace040a --- /dev/null +++ b/tests-m32/sigreturn.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +#else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +#endif + +static void handler(int sig) +{ +} + +int main(void) { + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGCHLD); + sigaddset(&set, RT_0 + 3); + sigaddset(&set, RT_0 + 4); + sigaddset(&set, RT_0 + 5); + sigaddset(&set, RT_0 + 26); + sigaddset(&set, RT_0 + 27); + sigprocmask(SIG_SETMASK, &set, NULL); + signal(SIGUSR1, handler); + raise(SIGUSR1); + return 0; +} diff --git a/tests-m32/sigreturn.test b/tests-m32/sigreturn.test new file mode 100755 index 00000000..f9a612bf --- /dev/null +++ b/tests-m32/sigreturn.test @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Check rt_sigprocmask and sigreturn/rt_sigreturn decoding. +# +# Copyright (c) 2015-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -esignal $args + +mask='\[(USR2 CHLD|CHLD USR2) RT_3 RT_4 RT_5 RT_26 RT_27\]' +rt_sigprocmask='rt_sigprocmask\(SIG_SETMASK, '"$mask"', NULL, [[:digit:]]+\) += 0' +osf_sigprocmask='osf_sigprocmask\(SIG_SETMASK, '"$mask"'\) += 0 +\(old mask \[[^]]*\]\)' +EXPECTED="$LOG.expected" + +cat > "$EXPECTED" << __EOF__ +$rt_sigprocmask|$osf_sigprocmask +(rt_)?sigreturn\\((\\{mask=$mask\\})?\\) += 0 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" + +exit 0 diff --git a/tests-m32/sleep.c b/tests-m32/sleep.c new file mode 100644 index 00000000..f4bce3cd --- /dev/null +++ b/tests-m32/sleep.c @@ -0,0 +1,49 @@ +/* + * A simple nanosleep based sleep(1) replacement. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 2) + error_msg_and_fail("missing operand"); + + if (ac > 2) + error_msg_and_fail("extra operand"); + + struct timespec ts = { atoi(av[1]), 0 }; + + if (nanosleep(&ts, NULL)) + perror_msg_and_fail("nanosleep"); + + return 0; +} diff --git a/tests-m32/socketcall.c b/tests-m32/socketcall.c new file mode 100644 index 00000000..4fe1ea3a --- /dev/null +++ b/tests-m32/socketcall.c @@ -0,0 +1,95 @@ +/* + * Check decoding of socketcall syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_socketcall + +# include +# include +# include + +# include "xlat.h" +# include "xlat/socketcalls.h" + +static const char * +xlookup_uint(const struct xlat *xlat, const unsigned int val) +{ + for (; xlat->str != NULL; xlat++) + if (xlat->val == val) + return xlat->str; + return NULL; +} + +static const int sc_min = 1, sc_max = 20; +static void *efault; + +static void +test_socketcall(const int i, const void *const addr) +{ + const unsigned long call = + (unsigned long) 0xfacefeed00000000ULL | (unsigned int) i; + + long rc = syscall(__NR_socketcall, call, addr); + + if (i < sc_min || i > sc_max) { + printf("socketcall(%d, %p) = %ld %s (%m)\n", + (int) call, addr, rc, errno2name()); + } else if (addr == efault) { + const char *const str = xlookup_uint(socketcalls, i); + assert(str); + printf("socketcall(%s, %p) = %ld %s (%m)\n", + str, addr, rc, errno2name()); + } +} +int +main(void) +{ + assert((unsigned) sc_min == socketcalls[0].val); + assert((unsigned) sc_max == socketcalls[ARRAY_SIZE(socketcalls) - 2].val); + + const unsigned long *const args = tail_alloc(sizeof(*args) * 6); + efault = tail_alloc(1) + 1; + + int i; + for (i = sc_min - 3; i <= sc_max + 3; ++i) { + test_socketcall(i, efault); + test_socketcall(i, args); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_socketcall") + +#endif diff --git a/tests-m32/socketcall.test b/tests-m32/socketcall.test new file mode 100755 index 00000000..959bc83d --- /dev/null +++ b/tests-m32/socketcall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of socketcall syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/sockname.c b/tests-m32/sockname.c new file mode 100644 index 00000000..c5072cac --- /dev/null +++ b/tests-m32/sockname.c @@ -0,0 +1,156 @@ +/* + * Check decoding of sockname family syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef TEST_SYSCALL_NAME +# error TEST_SYSCALL_NAME must be defined +#endif + +#define TEST_SYSCALL_STR__(a) #a +#define TEST_SYSCALL_STR_(a) TEST_SYSCALL_STR__(a) +#define TEST_SYSCALL_STR TEST_SYSCALL_STR_(TEST_SYSCALL_NAME) +#define TEST_SOCKET TEST_SYSCALL_STR ".socket" + +#ifdef TEST_SYSCALL_PREPARE +# define PREPARE_TEST_SYSCALL_INVOCATION do { TEST_SYSCALL_PREPARE; } while (0) +#else +# define PREPARE_TEST_SYSCALL_INVOCATION do {} while (0) +#endif + +#ifndef PREFIX_S_ARGS +# define PREFIX_S_ARGS +#endif +#ifndef PREFIX_F_ARGS +# define PREFIX_F_ARGS +#endif +#ifndef PREFIX_S_STR +# define PREFIX_S_STR "" +#endif +#ifndef PREFIX_F_STR +# define PREFIX_F_STR "" +#endif +#ifndef SUFFIX_ARGS +# define SUFFIX_ARGS +#endif +#ifndef SUFFIX_STR +# define SUFFIX_STR "" +#endif + +static void +test_sockname_syscall(const int fd) +{ + socklen_t *const plen = tail_alloc(sizeof(*plen)); + *plen = sizeof(struct sockaddr_un); + struct sockaddr_un *addr = tail_alloc(*plen); + + PREPARE_TEST_SYSCALL_INVOCATION; + int rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, addr->sun_path, + (int) sizeof(struct sockaddr_un), (int) *plen, SUFFIX_STR, rc); + + memset(addr, 0, sizeof(*addr)); + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", [%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, addr->sun_path, + (int) *plen, SUFFIX_STR, rc); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, 0 SUFFIX_ARGS); + printf("%s(%d%s, %p, NULL%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, SUFFIX_STR, + sprintrc(rc)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, 0, 0 SUFFIX_ARGS); + printf("%s(%d%s, NULL, NULL%s) = %s\n", + TEST_SYSCALL_STR, fd, rc == -1 ? PREFIX_F_STR : PREFIX_S_STR, + SUFFIX_STR, sprintrc(rc)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, + plen + 1 SUFFIX_ARGS); + printf("%s(%d%s, %p, %p%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, + plen + 1, SUFFIX_STR, sprintrc(rc)); + + const size_t offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + *plen = offsetof_sun_path; + memset(addr->sun_path, 'A', sizeof(addr->sun_path)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX}, [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, + (int) offsetof_sun_path, (int) *plen, SUFFIX_STR, rc); + + ++addr; + *plen = sizeof(struct sockaddr); + addr = (void *) addr - *plen; + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%.*s\"}" + ", [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, + (int) (sizeof(struct sockaddr) - offsetof_sun_path), + addr->sun_path, (int) sizeof(struct sockaddr), + (int) *plen, SUFFIX_STR, rc); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, + plen SUFFIX_ARGS); + printf("%s(%d%s, %p, [%d]%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, + *plen, SUFFIX_STR, sprintrc(rc)); +} diff --git a/tests-m32/splice.c b/tests-m32/splice.c new file mode 100644 index 00000000..b6f25256 --- /dev/null +++ b/tests-m32/splice.c @@ -0,0 +1,65 @@ +/* + * This file is part of splice strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_splice + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; + long long int *const off_in = tail_alloc(sizeof(*off_in)); + long long int *const off_out = tail_alloc(sizeof(*off_out)); + *off_in = 0xdeadbef1facefed1ULL; + *off_out = 0xdeadbef2facefed2ULL; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 15; + + long rc = syscall(__NR_splice, + fd_in, off_in, fd_out, off_out, len, flags); + printf("splice(%d, [%lld], %d, [%lld], %zu, %s) = %ld %s (%m)\n", + (int) fd_in, *off_in, (int) fd_out, *off_out, len, + "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_splice") + +#endif diff --git a/tests-m32/splice.test b/tests-m32/splice.test new file mode 100755 index 00000000..cc5c327e --- /dev/null +++ b/tests-m32/splice.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check splice syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/sprintrc.c b/tests-m32/sprintrc.c new file mode 100644 index 00000000..7423afb6 --- /dev/null +++ b/tests-m32/sprintrc.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +enum sprintrc_fmt { + SPRINTRC_FMT_RAW, + SPRINTRC_FMT_GREP, +}; + +/** + * Provides pointer to static string buffer with printed return code in format + * used by strace - with errno and error message. + * + * @param rc Return code. + * @param fmt Output format. Currently, raw (used for diff matching) and grep + * (for extended POSIX regex-based pattern matching) formats are + * supported. + * @return Pointer to (statically allocated) buffer containing decimal + * representation of return code and errno/error message in case @rc + * is equal to -1. + */ +static inline const char * +sprintrc_ex(long rc, enum sprintrc_fmt fmt) +{ + static const char *formats[] = { + [SPRINTRC_FMT_RAW] = "-1 %s (%m)", + [SPRINTRC_FMT_GREP] = "-1 %s \\(%m\\)", + }; + static char buf[4096]; + + if (fmt >= ARRAY_SIZE(formats)) + perror_msg_and_fail("sprintrc_ex: incorrect format provided"); + + if (rc == 0) + return "0"; + + int ret = (rc == -1) + ? snprintf(buf, sizeof(buf), formats[fmt], errno2name()) + : snprintf(buf, sizeof(buf), "%ld", rc); + + if (ret < 0) + perror_msg_and_fail("snprintf"); + if ((size_t) ret >= sizeof(buf)) + error_msg_and_fail("snprintf overflow: got %d, expected" + " no more than %zu", ret, sizeof(buf)); + + return buf; +} + +const char * +sprintrc(long rc) +{ + return sprintrc_ex(rc, SPRINTRC_FMT_RAW); +} + +const char * +sprintrc_grep(long rc) +{ + return sprintrc_ex(rc, SPRINTRC_FMT_GREP); +} diff --git a/tests-m32/stack-fcall-0.c b/tests-m32/stack-fcall-0.c new file mode 100644 index 00000000..12a260de --- /dev/null +++ b/tests-m32/stack-fcall-0.c @@ -0,0 +1,6 @@ +int f1(int i); + +int f0(int i) +{ + return f1(i) - i; +} diff --git a/tests-m32/stack-fcall-1.c b/tests-m32/stack-fcall-1.c new file mode 100644 index 00000000..8716702d --- /dev/null +++ b/tests-m32/stack-fcall-1.c @@ -0,0 +1,6 @@ +int f2(int i); + +int f1(int i) +{ + return f2(i) + i; +} diff --git a/tests-m32/stack-fcall-2.c b/tests-m32/stack-fcall-2.c new file mode 100644 index 00000000..19f8cf83 --- /dev/null +++ b/tests-m32/stack-fcall-2.c @@ -0,0 +1,6 @@ +int f3(int i); + +int f2(int i) +{ + return f3(i) - i; +} diff --git a/tests-m32/stack-fcall-3.c b/tests-m32/stack-fcall-3.c new file mode 100644 index 00000000..3af1667f --- /dev/null +++ b/tests-m32/stack-fcall-3.c @@ -0,0 +1,6 @@ +#include + +int f3(int i) +{ + return getpid() + i; +} diff --git a/tests-m32/stack-fcall.c b/tests-m32/stack-fcall.c new file mode 100644 index 00000000..134d54f6 --- /dev/null +++ b/tests-m32/stack-fcall.c @@ -0,0 +1,7 @@ +int f0(int i); + +int main(int argc, char** argv) +{ + f0(argc); + return 0; +} diff --git a/tests-m32/stat.c b/tests-m32/stat.c new file mode 100644 index 00000000..d4ca7b0b --- /dev/null +++ b/tests-m32/stat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_stat + +# define TEST_SYSCALL_NR __NR_stat +# define TEST_SYSCALL_STR "stat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_stat") + +#endif diff --git a/tests-m32/stat.test b/tests-m32/stat.test new file mode 100755 index 00000000..ba8938c0 --- /dev/null +++ b/tests-m32/stat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check stat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/stat64.c b/tests-m32/stat64.c new file mode 100644 index 00000000..782de33d --- /dev/null +++ b/tests-m32/stat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_stat64 + +# define TEST_SYSCALL_NR __NR_stat64 +# define TEST_SYSCALL_STR "stat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_stat64") + +#endif diff --git a/tests-m32/stat64.test b/tests-m32/stat64.test new file mode 100755 index 00000000..abcfb9ec --- /dev/null +++ b/tests-m32/stat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check stat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-m32/statfs.c b/tests-m32/statfs.c new file mode 100644 index 00000000..6032a668 --- /dev/null +++ b/tests-m32/statfs.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_statfs + +# define SYSCALL_ARG_FMT "\"%s\"" +# define SYSCALL_ARG(file, desc) (file) +# define SYSCALL_NR __NR_statfs +# define SYSCALL_NAME "statfs" +# include "xstatfs.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statfs") + +#endif diff --git a/tests-m32/statfs.expected b/tests-m32/statfs.expected new file mode 100644 index 00000000..11e9f0b1 --- /dev/null +++ b/tests-m32/statfs.expected @@ -0,0 +1 @@ +statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type=PROC_SUPER_MAGIC, f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{val=\[[0-9]+, [0-9]+\]\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=ST_VALID(\|ST_[A-Z]+)*)?\}\) += 0 diff --git a/tests-m32/statfs.test b/tests-m32/statfs.test new file mode 100755 index 00000000..6075576f --- /dev/null +++ b/tests-m32/statfs.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check statfs syscall decoding. + +. "${srcdir=.}/init.sh" + +# this test probes /proc/self/status +[ -f /proc/self/status ] || + framework_skip_ '/proc/self/status is not available' + +run_strace_match_diff -a17 diff --git a/tests-m32/statfs64.c b/tests-m32/statfs64.c new file mode 100644 index 00000000..f46e7670 --- /dev/null +++ b/tests-m32/statfs64.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_statfs64 + +# define SYSCALL_ARG_FMT "\"%s\"" +# define SYSCALL_ARG(file, desc) (file) +# define SYSCALL_NR __NR_statfs64 +# define SYSCALL_NAME "statfs64" +# include "xstatfs64.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statfs64") + +#endif diff --git a/tests-m32/statfs64.test b/tests-m32/statfs64.test new file mode 100755 index 00000000..9c0aa278 --- /dev/null +++ b/tests-m32/statfs64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check statfs64 syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests-m32/statx.sh b/tests-m32/statx.sh new file mode 100755 index 00000000..a630193d --- /dev/null +++ b/tests-m32/statx.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of stat family syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -P $NAME.sample -P /dev/full -a32 diff --git a/tests-m32/strace-C.expected b/tests-m32/strace-C.expected new file mode 100644 index 00000000..832af1f3 --- /dev/null +++ b/tests-m32/strace-C.expected @@ -0,0 +1,3 @@ +nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 +\+\+\+ exited with 0 \+\+\+ +[ ]*[0-9][0-9]*[.][0-9][0-9]* *0[.]0[0-9]* *[0-9][0-9]* *1 *nanosleep diff --git a/tests-m32/strace-C.test b/tests-m32/strace-C.test new file mode 100755 index 00000000..ccca9a09 --- /dev/null +++ b/tests-m32/strace-C.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -C option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -a24 -C -enanosleep ./sleep 1 +match_grep diff --git a/tests-m32/strace-E.expected b/tests-m32/strace-E.expected new file mode 100644 index 00000000..d7823b7a --- /dev/null +++ b/tests-m32/strace-E.expected @@ -0,0 +1 @@ +execve\("\./sleep", \["\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 diff --git a/tests-m32/strace-E.test b/tests-m32/strace-E.test new file mode 100755 index 00000000..d76ec3f5 --- /dev/null +++ b/tests-m32/strace-E.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -E option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 > /dev/null +run_strace -E option_E_var=OPTION_E_VAL -v $args +match_grep diff --git a/tests-m32/strace-S.test b/tests-m32/strace-S.test new file mode 100755 index 00000000..3ea315ce --- /dev/null +++ b/tests-m32/strace-S.test @@ -0,0 +1,32 @@ +#!/bin/sh + +# Check -S option. + +. "${srcdir=.}/init.sh" + +run_prog ./readv > /dev/null + +test_c() +{ + local sortby sortopts sedexpr + sortby="$1"; shift + sortopts="$1"; shift + sedexpr="$1"; shift + + run_strace -c -w -S "$sortby" ./readv > /dev/null + sed -r -n -e "$sedexpr" < "$LOG" > "$OUT" + + [ -s "$OUT" ] || + fail_ "$STRACE $args output mismatch" + LC_ALL=C sort -c $sortopts "$OUT" || { + echo 'Actual output:' + cat < "$LOG" + fail_ "$STRACE $args output not sorted properly" + } +} + +c='[[:space:]]+([^[:space:]]+)' +test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p' +test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p' + +rm -f "$OUT" diff --git a/tests-m32/strace-T.expected b/tests-m32/strace-T.expected new file mode 100644 index 00000000..1ea02046 --- /dev/null +++ b/tests-m32/strace-T.expected @@ -0,0 +1 @@ +nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 <(1\.[01]|0\.9)[[:digit:]]{5}> diff --git a/tests-m32/strace-T.test b/tests-m32/strace-T.test new file mode 100755 index 00000000..7ab84a74 --- /dev/null +++ b/tests-m32/strace-T.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -T option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -a24 -T -enanosleep ./sleep 1 +match_grep diff --git a/tests-m32/strace-V.test b/tests-m32/strace-V.test new file mode 100755 index 00000000..9a051e00 --- /dev/null +++ b/tests-m32/strace-V.test @@ -0,0 +1,24 @@ +#!/bin/sh + +# Check -V option. +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%Y > /dev/null +year="$(date +%Y)" + +run_strace -V > "$LOG" + +getval() +{ + sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' ../config.h +} + +cat > "$EXP" << __EOF__ +$(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION) +Copyright (C) 1991-$year The strace developers <$(getval PACKAGE_URL)>. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +__EOF__ + +match_diff "$EXP" "$LOG" +rm -f "$EXP" diff --git a/tests-m32/strace-ff.expected b/tests-m32/strace-ff.expected new file mode 100644 index 00000000..627a1b4c --- /dev/null +++ b/tests-m32/strace-ff.expected @@ -0,0 +1,2 @@ +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests-m32/strace-ff.test b/tests-m32/strace-ff.test new file mode 100755 index 00000000..2ce06f19 --- /dev/null +++ b/tests-m32/strace-ff.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check -ff option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +./set_ptracer_any ./sleep 1 > "$OUT" & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any sleep failed' +done + +rm -f "$LOG".* +run_strace -a14 -eexit_group -ff -p $tracee_pid + +# check that output matches +match_diff "$LOG.$tracee_pid" + +# check that no other output files have been created +set -- "$LOG".* +[ "$LOG.$tracee_pid" = "$*" ] || + fail_ "too many output files: $*" + +rm -f "$OUT" "$LOG.$tracee_pid" diff --git a/tests-m32/strace-k.test b/tests-m32/strace-k.test new file mode 100755 index 00000000..d5e8ed2b --- /dev/null +++ b/tests-m32/strace-k.test @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Ensure that strace -k works. +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -k is implemented using /proc/$pid/maps +[ -f /proc/self/maps ] || + framework_skip_ '/proc/self/maps is not available' + +check_prog sed +check_prog tr + +run_prog ./stack-fcall +run_strace -e getpid -k $args + +expected='getpid f3 f2 f1 f0 main ' +result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" | + tr '\n' ' ') + +test "$result" = "$expected" || { + echo "expected: \"$expected\"" + echo "result: \"$result\"" + dump_log_and_fail_with "$STRACE $args output mismatch" +} + +exit 0 diff --git a/tests-m32/strace-r.expected b/tests-m32/strace-r.expected new file mode 100644 index 00000000..8009c353 --- /dev/null +++ b/tests-m32/strace-r.expected @@ -0,0 +1,2 @@ +[ ]{5}0\.0{6} execve\("\./sleep", \["\./sleep", "1"\], \[/\* [[:digit:]]+ vars \*/\]\) = 0 +[ ]{5}(1\.[01]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+ diff --git a/tests-m32/strace-r.test b/tests-m32/strace-r.test new file mode 100755 index 00000000..4ba01f12 --- /dev/null +++ b/tests-m32/strace-r.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -r option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -r -eexecve ./sleep 1 +match_grep diff --git a/tests-m32/strace-t.test b/tests-m32/strace-t.test new file mode 100755 index 00000000..1d213e63 --- /dev/null +++ b/tests-m32/strace-t.test @@ -0,0 +1,20 @@ +#!/bin/sh + +# Check -t option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%T > /dev/null +run_prog ./sleep 0 + +t0="$(date +%T)" +run_strace -t -eexecve $args +t1="$(date +%T)" + +EXPECTED="$LOG.expected" +cat > "$EXPECTED" << __EOF__ +($t0|$t1) execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" diff --git a/tests-m32/strace-tt.test b/tests-m32/strace-tt.test new file mode 100755 index 00000000..3f80001e --- /dev/null +++ b/tests-m32/strace-tt.test @@ -0,0 +1,28 @@ +#!/bin/sh + +# Check -tt option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > "$LOG" +run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null +run_prog ./sleep 0 + +s0="$(date +%s)" +run_strace -tt -eexecve $args +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + t="$(date +%T --date "@$s")" + [ -z "$t_reg" ] && t_reg="$t" || t_reg="$t_reg|$t" + s=$(($s + 1)) +done + +cat > "$EXP" << __EOF__ +($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-m32/strace-ttt.test b/tests-m32/strace-ttt.test new file mode 100755 index 00000000..4439715b --- /dev/null +++ b/tests-m32/strace-ttt.test @@ -0,0 +1,26 @@ +#!/bin/sh + +# Check -ttt option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > /dev/null +run_prog ./sleep 0 + +s0="$(date +%s)" +run_strace -ttt -eexecve $args +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + [ -z "$t_reg" ] && t_reg="$s" || t_reg="$t_reg|$s" + s=$(($s + 1)) +done + +cat > "$EXP" << __EOF__ +($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-m32/strace.supp b/tests-m32/strace.supp new file mode 100644 index 00000000..578b0a25 --- /dev/null +++ b/tests-m32/strace.supp @@ -0,0 +1,7 @@ +{ + get_cpuset_size: sched_getaffinity with NULL mask + Memcheck:Param + sched_getaffinity(mask) + fun:sched_getaffinity* + fun:get_cpuset_size +} diff --git a/tests-m32/struct_flock.c b/tests-m32/struct_flock.c new file mode 100644 index 00000000..34cf58e6 --- /dev/null +++ b/tests-m32/struct_flock.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include "flock.h" + +#define FILE_LEN 4096 +#define EINVAL_STR "-1 EINVAL (Invalid argument)" + +#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) + +#ifdef HAVE_TYPEOF +# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) +#else +# define TYPEOF_FLOCK_OFF_T off_t +#endif + +static long +invoke_test_syscall(const unsigned int cmd, void *const p) +{ + const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd; + + return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p); +} + +static void +test_flock_einval(const int cmd, const char *name) +{ + struct_kernel_flock fl = { + .l_type = F_RDLCK, + .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL, + .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); +} + +static void +test_flock(void) +{ + TEST_FLOCK_EINVAL(F_SETLK); + TEST_FLOCK_EINVAL(F_SETLKW); + + struct_kernel_flock fl = { + .l_type = F_RDLCK, + .l_len = FILE_LEN + }; + long rc = invoke_test_syscall(F_SETLK, &fl); + printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + if (rc) + return; + + invoke_test_syscall(F_GETLK, &fl); + printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(F_SETLK, &fl); + printf("%s(0, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +static void +create_sample(void) +{ + char fname[] = TEST_SYSCALL_STR "_XXXXXX"; + + (void) close(0); + if (mkstemp(fname)) + perror_msg_and_fail("mkstemp: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(0, FILE_LEN)) + perror_msg_and_fail("ftruncate"); +} diff --git a/tests-m32/sun_path.expected b/tests-m32/sun_path.expected new file mode 100644 index 00000000..30a11c03 --- /dev/null +++ b/tests-m32/sun_path.expected @@ -0,0 +1,3 @@ +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, 110\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, \[110->111\]\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, 110\) += 0 diff --git a/tests-m32/sun_path.test b/tests-m32/sun_path.test new file mode 100755 index 00000000..728328a8 --- /dev/null +++ b/tests-m32/sun_path.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check how long sun_path addresses are traced. + +. "${srcdir=.}/init.sh" + +run_prog ./net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 +run_strace_merge -ebind,connect,getsockname $args +match_grep + +exit 0 diff --git a/tests-m32/swap.c b/tests-m32/swap.c new file mode 100644 index 00000000..77b25050 --- /dev/null +++ b/tests-m32/swap.c @@ -0,0 +1,51 @@ +#include "tests.h" +#include + +#if defined __NR_swapon && defined __NR_swapoff + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "swap.sample"; + long rc; + + rc = syscall(__NR_swapon, sample, 0); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "0", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, 42); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "42", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, SWAP_FLAG_PREFER); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "SWAP_FLAG_PREFER|0", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, SWAP_FLAG_PREFER | 42); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "SWAP_FLAG_PREFER|42", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, -1L); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, + "SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|SWAP_FLAG_DISCARD_ONCE" + "|SWAP_FLAG_DISCARD_PAGES|0xfff80000|32767", + rc, errno2name()); + + rc = syscall(__NR_swapoff, sample); + printf("swapoff(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_swapon && __NR_swapoff") + +#endif diff --git a/tests-m32/swap.test b/tests-m32/swap.test new file mode 100755 index 00000000..a30e1fd8 --- /dev/null +++ b/tests-m32/swap.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check swapon and swapoff syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests-m32/symlink.c b/tests-m32/symlink.c new file mode 100644 index 00000000..72cb4908 --- /dev/null +++ b/tests-m32/symlink.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_symlink + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "symlink_new"; + static const char sample_2[] = "symlink"; + + long rc = syscall(__NR_symlink, sample_1, sample_2); + printf("symlink(\"%s\", \"%s\") = %ld %s (%m)\n", + sample_1, sample_2, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_symlink") + +#endif diff --git a/tests-m32/symlink.test b/tests-m32/symlink.test new file mode 100755 index 00000000..79b93baa --- /dev/null +++ b/tests-m32/symlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check symlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-m32/symlinkat.c b/tests-m32/symlinkat.c new file mode 100644 index 00000000..6e5d617d --- /dev/null +++ b/tests-m32/symlinkat.c @@ -0,0 +1,28 @@ +#include "tests.h" +#include + +#ifdef __NR_symlinkat + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + static const char oldpath[] = "symlink_old"; + static const char newpath[] = "symlink_new"; + + long rc = syscall(__NR_symlinkat, oldpath, fd, newpath); + printf("symlinkat(\"%s\", %d, \"%s\") = %ld %s (%m)\n", + oldpath, (int) fd, newpath, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_symlinkat") + +#endif diff --git a/tests-m32/symlinkat.test b/tests-m32/symlinkat.test new file mode 100755 index 00000000..d8501ffd --- /dev/null +++ b/tests-m32/symlinkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check symlinkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/sync.c b/tests-m32/sync.c new file mode 100644 index 00000000..e6e7ce37 --- /dev/null +++ b/tests-m32/sync.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_sync + +# include +# include + +int +main(void) +{ + printf("sync() = %ld\n", syscall(__NR_sync)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sync") + +#endif diff --git a/tests-m32/sync.test b/tests-m32/sync.test new file mode 100755 index 00000000..f6bf6c8f --- /dev/null +++ b/tests-m32/sync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a7 diff --git a/tests-m32/sync_file_range.c b/tests-m32/sync_file_range.c new file mode 100644 index 00000000..67d31a89 --- /dev/null +++ b/tests-m32/sync_file_range.c @@ -0,0 +1,63 @@ +/* + * Check decoding of sync_file_range syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined HAVE_SYNC_FILE_RANGE && defined __NR_sync_file_range + +# include + +int +main(void) +{ + const int fd = -1; + const off64_t offset = 0xdeadbeefbadc0dedULL; + const off64_t nbytes = 0xfacefeedcafef00dULL; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); + printf("%s(%d, %lld, %lld, SYNC_FILE_RANGE_WAIT_BEFORE" + "|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER" + "|0xfffffff8) = %d %s (%m)\n", + "sync_file_range", fd, + (long long) offset, + (long long) nbytes, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYNC_FILE_RANGE && __NR_sync_file_range") + +#endif diff --git a/tests-m32/sync_file_range.test b/tests-m32/sync_file_range.test new file mode 100755 index 00000000..6aa86d6c --- /dev/null +++ b/tests-m32/sync_file_range.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync_file_range syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/sync_file_range2.c b/tests-m32/sync_file_range2.c new file mode 100644 index 00000000..6ce7db26 --- /dev/null +++ b/tests-m32/sync_file_range2.c @@ -0,0 +1,63 @@ +/* + * Check decoding of sync_file_range2 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined HAVE_SYNC_FILE_RANGE && defined __NR_sync_file_range2 + +# include + +int +main(void) +{ + const int fd = -1; + const off64_t offset = 0xdeadbeefbadc0ded; + const off64_t nbytes = 0xfacefeedcafef00d; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); + printf("%s(%d, SYNC_FILE_RANGE_WAIT_BEFORE" + "|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER" + "|0xfffffff8, %lld, %lld) = %d %s (%m)\n", + "sync_file_range2", fd, + (long long) offset, + (long long) nbytes, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYNC_FILE_RANGE && __NR_sync_file_range2") + +#endif diff --git a/tests-m32/sync_file_range2.test b/tests-m32/sync_file_range2.test new file mode 100755 index 00000000..0d9945ed --- /dev/null +++ b/tests-m32/sync_file_range2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync_file_range2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/sysinfo.c b/tests-m32/sysinfo.c new file mode 100644 index 00000000..377bdc9c --- /dev/null +++ b/tests-m32/sysinfo.c @@ -0,0 +1,76 @@ +/* + * This file is part of sysinfo strace test. + * + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + sysinfo(NULL); + printf("sysinfo(NULL) = -1 EFAULT (%m)\n"); + + struct sysinfo * const si = tail_alloc(sizeof(*si)); + + if (sysinfo(si)) + perror_msg_and_skip("sysinfo"); + printf("sysinfo({uptime=%llu" + ", loads=[%llu, %llu, %llu]" + ", totalram=%llu" + ", freeram=%llu" + ", sharedram=%llu" + ", bufferram=%llu" + ", totalswap=%llu" + ", freeswap=%llu" + ", procs=%u" + ", totalhigh=%llu" + ", freehigh=%llu" + ", mem_unit=%u" + "}) = 0\n" + , (unsigned long long) si->uptime + , (unsigned long long) si->loads[0] + , (unsigned long long) si->loads[1] + , (unsigned long long) si->loads[2] + , (unsigned long long) si->totalram + , (unsigned long long) si->freeram + , (unsigned long long) si->sharedram + , (unsigned long long) si->bufferram + , (unsigned long long) si->totalswap + , (unsigned long long) si->freeswap + , (unsigned) si->procs + , (unsigned long long) si->totalhigh + , (unsigned long long) si->freehigh + , si->mem_unit + ); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/sysinfo.test b/tests-m32/sysinfo.test new file mode 100755 index 00000000..806d8b61 --- /dev/null +++ b/tests-m32/sysinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sysinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/syslog.c b/tests-m32/syslog.c new file mode 100644 index 00000000..5df96cb8 --- /dev/null +++ b/tests-m32/syslog.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_syslog + +# include +# include + +# define SYSLOG_ACTION_READ 2 + +int +main(void) +{ + const long addr = (long) 0xfacefeeddeadbeefULL; + int rc = syscall(__NR_syslog, SYSLOG_ACTION_READ, addr, -1); + printf("syslog(SYSLOG_ACTION_READ, %#lx, -1) = %d %s (%m)\n", + addr, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_syslog") + +#endif diff --git a/tests-m32/syslog.test b/tests-m32/syslog.test new file mode 100755 index 00000000..1c2158e4 --- /dev/null +++ b/tests-m32/syslog.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check syslog syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/tail_alloc.c b/tests-m32/tail_alloc.c new file mode 100644 index 00000000..08081d4f --- /dev/null +++ b/tests-m32/tail_alloc.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +void * +tail_alloc(const size_t size) +{ + const size_t page_size = get_page_size(); + const size_t len = (size + page_size - 1) & -page_size; + const size_t alloc_size = len + 6 * page_size; + + void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (MAP_FAILED == p) + perror_msg_and_fail("mmap(%zu)", alloc_size); + + void *start_work = p + 3 * page_size; + void *tail_guard = start_work + len; + + if (munmap(p, page_size) || + munmap(p + 2 * page_size, page_size) || + munmap(tail_guard, page_size) || + munmap(tail_guard + 2 * page_size, page_size)) + perror_msg_and_fail("munmap"); + + memset(start_work, 0xff, len); + return tail_guard - size; +} + +void * +tail_memdup(const void *p, const size_t size) +{ + void *dest = tail_alloc(size); + memcpy(dest, p, size); + return dest; +} diff --git a/tests-m32/tee.c b/tests-m32/tee.c new file mode 100644 index 00000000..66d1c94f --- /dev/null +++ b/tests-m32/tee.c @@ -0,0 +1,60 @@ +/* + * This file is part of tee strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_tee + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 15; + + long rc = syscall(__NR_tee, fd_in, fd_out, len, flags); + printf("tee(%d, %d, %zu, %s) = %ld %s (%m)\n", + (int) fd_in, (int) fd_out, len, + "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_tee") + +#endif diff --git a/tests-m32/tee.test b/tests-m32/tee.test new file mode 100755 index 00000000..76b60003 --- /dev/null +++ b/tests-m32/tee.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check tee syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/tests.h b/tests-m32/tests.h new file mode 100644 index 00000000..d4294de9 --- /dev/null +++ b/tests-m32/tests.h @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_H +#define STRACE_TESTS_H + +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif + +# include +# include "kernel_types.h" +# include "gcc_compat.h" + +/* Tests of "strace -v" are expected to define VERBOSE to 1. */ +#ifndef VERBOSE +# define VERBOSE 0 +#endif + +/* Cached sysconf(_SC_PAGESIZE). */ +size_t get_page_size(void); + +/* Print message and strerror(errno) to stderr, then exit(1). */ +void perror_msg_and_fail(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message to stderr, then exit(1). */ +void error_msg_and_fail(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message to stderr, then exit(77). */ +void error_msg_and_skip(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message and strerror(errno) to stderr, then exit(77). */ +void perror_msg_and_skip(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; + +/* + * Allocate memory that ends on the page boundary. + * Pages allocated by this call are preceeded by an unmapped page + * and followed also by an unmapped page. + */ +void *tail_alloc(const size_t) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)); +/* Allocate memory using tail_alloc, then memcpy. */ +void *tail_memdup(const void *, const size_t) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2)); + +/* + * Fill memory (pointed by ptr, having size bytes) with different bytes (with + * values starting with start and resetting every period) in order to catch + * sign, byte order and/or alignment errors. + */ +void fill_memory_ex(void *ptr, size_t size, unsigned char start, + unsigned char period); +/* Shortcut for fill_memory_ex(ptr, size, 0x80, 0x80) */ +void fill_memory(void *ptr, size_t size); + +/* Close stdin, move stdout to a non-standard descriptor, and print. */ +void tprintf(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)); + +/* Make a hexdump copy of C string */ +const char *hexdump_strdup(const char *); + +/* Make a hexdump copy of memory */ +const char *hexdump_memdup(const char *, size_t); + +/* Make a hexquoted copy of a string */ +const char *hexquote_strndup(const char *, size_t); + +/* Return inode number of socket descriptor. */ +unsigned long inode_of_sockfd(int); + +/* Print string in a quoted form. */ +void print_quoted_string(const char *); + +/* Print memory in a quoted form. */ +void print_quoted_memory(const char *, size_t); + +/* Read an int from the file. */ +int read_int_from_file(const char *, int *); + +/* Check whether given uid matches kernel overflowuid. */ +void check_overflowuid(const int); + +/* Check whether given gid matches kernel overflowgid. */ +void check_overflowgid(const int); + +/* Translate errno to its name. */ +const char *errno2name(void); + +/* Translate signal number to its name. */ +const char *signal2name(int); + +/* Print return code and, in case return code is -1, errno information. */ +const char *sprintrc(long rc); +/* sprintrc variant suitable for usage as part of grep pattern. */ +const char *sprintrc_grep(long rc); + +struct xlat; + +/* Print flags in symbolic form according to xlat table. */ +int printflags(const struct xlat *, const unsigned long long, const char *); + +/* Print constant in symbolic form according to xlat table. */ +int printxval(const struct xlat *, const unsigned long long, const char *); + +/* Invoke a socket syscall, either directly or via __NR_socketcall. */ +int socketcall(const int nr, const int call, + long a1, long a2, long a3, long a4, long a5); + +/* Wrappers for recvmmsg and sendmmsg syscalls. */ +struct mmsghdr; +struct timespec; +int recv_mmsg(int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); +int send_mmsg(int, struct mmsghdr *, unsigned int, unsigned int); + +/* Create a pipe with maximized descriptor numbers. */ +void pipe_maxfd(int pipefd[2]); + +#define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) +#define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) + +/* + * For 64-bit kernel_ulong_t and 32-bit pointer, + * return a kernel_ulong_t value by filling higher bits. + * For other architertures, return the original pointer. + */ +static inline kernel_ulong_t +f8ill_ptr_to_kulong(const void *const ptr) +{ + const unsigned long uptr = (unsigned long) ptr; + return F8ILL_KULONG_SUPPORTED + ? F8ILL_KULONG_MASK | uptr : (kernel_ulong_t) uptr; +} + +# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0]))) +# define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1) + +/* Zero-extend a signed integer type to unsigned long long. */ +#define zero_extend_signed_to_ull(v) \ + (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ + sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ + sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ + sizeof(v) == sizeof(long) ? (unsigned long long) (unsigned long) (v) : \ + (unsigned long long) (v)) + +/* Sign-extend an unsigned integer type to long long. */ +#define sign_extend_unsigned_to_ll(v) \ + (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ + sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ + sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ + sizeof(v) == sizeof(long) ? (long long) (long) (v) : \ + (long long) (v)) + +# define SKIP_MAIN_UNDEFINED(arg) \ + int main(void) { error_msg_and_skip("undefined: %s", arg); } + +/* + * The kernel used to define 64-bit types on 64-bit systems on a per-arch + * basis. Some architectures would use unsigned long and others would use + * unsigned long long. These types were exported as part of the + * kernel-userspace ABI and now must be maintained forever. This matches + * what the kernel exports for each architecture so we don't need to cast + * every printing of __u64 or __s64 to stdint types. + */ +# if SIZEOF_LONG == 4 +# define PRI__64 "ll" +# elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC +# define PRI__64 "l" +# else +# define PRI__64 "ll" +# endif + +# define PRI__d64 PRI__64"d" +# define PRI__u64 PRI__64"u" +# define PRI__x64 PRI__64"x" + +# if WORDS_BIGENDIAN +# define LL_PAIR(HI, LO) (HI), (LO) +# else +# define LL_PAIR(HI, LO) (LO), (HI) +# endif +# define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval)) + +# define _STR(_arg) #_arg +# define ARG_STR(_arg) (_arg), #_arg +# define ARG_ULL_STR(_arg) _arg##ULL, #_arg + +#endif /* !STRACE_TESTS_H */ diff --git a/tests-m32/threads-execve.c b/tests-m32/threads-execve.c new file mode 100644 index 00000000..853645ff --- /dev/null +++ b/tests-m32/threads-execve.c @@ -0,0 +1,246 @@ +/* + * Check decoding of threads when a non-leader thread invokes execve. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static pid_t leader; +static pid_t tid; + +static void +handler(int signo) +{ +} + +static unsigned int sigsetsize; +static long +k_sigsuspend(const sigset_t *const set) +{ + return syscall(__NR_rt_sigsuspend, set, sigsetsize); +} + +static pid_t +k_gettid(void) +{ + return syscall(__NR_gettid); +} + +static void +get_sigsetsize(void) +{ + static const struct sigaction sa = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + raise(SIGUSR1); + + sigemptyset(&mask); + for (sigsetsize = sizeof(mask) / sizeof(long); + sigsetsize; sigsetsize >>= 1) { + long rc = k_sigsuspend(&mask); + if (!rc) + error_msg_and_fail("rt_sigsuspend"); + if (EINTR == errno) + break; + printf("%-5d rt_sigsuspend(%p, %u) = %s\n", + leader, &mask, sigsetsize, sprintrc(rc)); + } + if (!sigsetsize) + perror_msg_and_fail("rt_sigsuspend"); + printf("%-5d rt_sigsuspend([], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", leader, sigsetsize); +} + +enum { + ACTION_exit = 0, + ACTION_rt_sigsuspend, + ACTION_nanosleep, + NUMBER_OF_ACTIONS +}; + +static const unsigned int NUMBER_OF_ITERATIONS = 1; +static unsigned int action; +static int fds[2]; + +static unsigned int +arglen(char **args) +{ + char **p; + + for (p = args; *p; ++p) + ; + + return p - args; +} + +static void * +thread(void *arg) +{ + tid = k_gettid(); + + static char buf[sizeof(action) * 3]; + sprintf(buf, "%u", action + 1); + + char **argv = arg; + argv[2] = buf; + + if (read(fds[0], fds, sizeof(fds[0]))) + perror_msg_and_fail("execve"); + + struct timespec ts = { .tv_nsec = 100000000 }; + (void) clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL); + + ts.tv_nsec = 12345; + printf("%-5d nanosleep({tv_sec=0, tv_nsec=%u}, NULL) = 0\n", + tid, (unsigned int) ts.tv_nsec); + + switch (action % NUMBER_OF_ACTIONS) { + case ACTION_exit: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), leader); + break; + case ACTION_rt_sigsuspend: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n" + "%-5d <... rt_sigsuspend resumed>) = ?\n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), + leader); + break; + case ACTION_nanosleep: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n" + "%-5d <... nanosleep resumed> )" + " = ?\n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), + leader); + break; + } + + printf("%-5d +++ superseded by execve in pid %u +++\n" + "%-5d <... execve resumed> ) = 0\n", + leader, tid, + leader); + + (void) nanosleep(&ts, NULL); + execve(argv[0], argv, environ); + perror_msg_and_fail("execve"); +} + +int +main(int ac, char **av) +{ + setvbuf(stdout, NULL, _IONBF, 0); + leader = getpid(); + + if (ac < 3) { + struct timespec ts = { .tv_nsec = 1 }; + if (clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL)) + perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); + + printf("%-5d execve(\"%s\", [\"%s\"], [/* %u vars */]) = 0\n", + leader, av[0], av[0], arglen(environ)); + + get_sigsetsize(); + static char buf[sizeof(sigsetsize) * 3]; + sprintf(buf, "%u", sigsetsize); + + char *argv[] = { av[0], buf, (char *) "0", NULL }; + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */]) = 0\n", + leader, argv[0], argv[0], argv[1], argv[2], + arglen(environ)); + execve(argv[0], argv, environ); + perror_msg_and_fail("execve"); + } + + sigsetsize = atoi(av[1]); + action = atoi(av[2]); + + if (action >= NUMBER_OF_ACTIONS * NUMBER_OF_ITERATIONS) { + printf("%-5d +++ exited with 0 +++\n", leader); + return 0; + } + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pthread_t t; + errno = pthread_create(&t, NULL, thread, av); + if (errno) + perror_msg_and_fail("pthread_create"); + + struct timespec ts = { .tv_sec = 123 }; + sigset_t mask; + sigemptyset(&mask); + + static char leader_str[sizeof(leader) * 3]; + int leader_str_len = + snprintf(leader_str, sizeof(leader_str), "%-5d", leader); + + switch (action % NUMBER_OF_ACTIONS) { + case ACTION_exit: + printf("%s exit(42)%*s= ?\n", leader_str, + (int) sizeof(leader_str) - leader_str_len, " "); + close(fds[1]); + (void) syscall(__NR_exit, 42); + break; + case ACTION_rt_sigsuspend: + printf("%s rt_sigsuspend([], %u \n", + leader_str, sigsetsize); + close(fds[1]); + (void) k_sigsuspend(&mask); + break; + case ACTION_nanosleep: + printf("%s nanosleep({tv_sec=%u, tv_nsec=0}" + ", \n", + leader_str, (unsigned int) ts.tv_sec); + close(fds[1]); + (void) nanosleep(&ts, 0); + break; + } + + return 1; +} diff --git a/tests-m32/threads-execve.test b/tests-m32/threads-execve.test new file mode 100755 index 00000000..4a771467 --- /dev/null +++ b/tests-m32/threads-execve.test @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Check decoding of threads when a non-leader thread invokes execve. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# Check that PTRACE_EVENT_EXEC support in kernel is good enough. +# The kernel before commit v3.1-rc1~308^2~7 reported 0 instead of old pid. +require_min_kernel_version_or_skip 3.1 + +check_prog diff +run_prog > /dev/null + +set -- -a21 -f -esignal=none -e trace=execve,exit,nanosleep,rt_sigsuspend $args + +# Due to probabilistic nature of the test, try it several times. +i=0 +while [ $i -le 9 ]; do + run_strace "$@" > "$EXP" + diff -- "$EXP" "$LOG" || continue + rm -f "$EXP" + exit 0 +done + +fail_ "$STRACE $* output mismatch" diff --git a/tests-m32/time.c b/tests-m32/time.c new file mode 100644 index 00000000..4a5cde9c --- /dev/null +++ b/tests-m32/time.c @@ -0,0 +1,61 @@ +/* + * This file is part of time strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_time + +# include +# include +# include +# include + +int +main(void) +{ + time_t *p = tail_alloc(sizeof(time_t)); + + time_t t = syscall(__NR_time, NULL); + if ((time_t) -1 == t) + perror_msg_and_skip("time"); + printf("time(NULL) = %jd\n", (intmax_t) t); + + t = syscall(__NR_time, p); + printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_time") + +#endif diff --git a/tests-m32/time.test b/tests-m32/time.test new file mode 100755 index 00000000..6ab193a4 --- /dev/null +++ b/tests-m32/time.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check time syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/timer_create.c b/tests-m32/timer_create.c new file mode 100644 index 00000000..1a259627 --- /dev/null +++ b/tests-m32/timer_create.c @@ -0,0 +1,125 @@ +/* + * This file is part of timer_create strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_timer_create + +# include +# include +# include +# include +# include "sigevent.h" + +int +main(void) +{ + syscall(__NR_timer_create, CLOCK_REALTIME, NULL, NULL); + printf("timer_create(CLOCK_REALTIME, NULL, NULL) = -1 %s (%m)\n", + errno2name()); + + int tid[4] = {}; + struct_sigevent sev = { + .sigev_notify = 0xdefaced, + .sigev_signo = 0xfacefeed, + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL + }; + + syscall(__NR_timer_create, CLOCK_REALTIME, &sev, NULL); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, " + "sigev_notify=%#x /* SIGEV_??? */}, NULL) = -1 %s (%m)\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_signo, sev.sigev_notify, + errno2name()); + + sev.sigev_notify = SIGEV_NONE; + if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[0])) + perror_msg_and_skip("timer_create CLOCK_REALTIME"); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, sigev_notify=SIGEV_NONE}, " + "[%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_signo, tid[0]); + + sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_signo = SIGALRM; + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[1])) + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_SIGNAL}, [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, tid[1]); + + sev.sigev_notify = SIGEV_THREAD; + sev.sigev_un.sigev_thread.function = + (unsigned long) 0xdeadbeefbadc0dedULL; + sev.sigev_un.sigev_thread.attribute = + (unsigned long) 0xcafef00dfacefeedULL; + if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[2])) + perror_msg_and_skip("timer_create CLOCK_REALTIME"); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" + ", sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}" + ", [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_un.sigev_thread.function, + sev.sigev_un.sigev_thread.attribute, + tid[2]); + +#ifndef SIGEV_THREAD_ID +# define SIGEV_THREAD_ID 4 +#endif + sev.sigev_notify = SIGEV_THREAD_ID; + sev.sigev_un.tid = getpid(); + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_THREAD_ID, sigev_notify_thread_id=%d}" + ", [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_un.tid, + tid[3]); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timer_create") + +#endif diff --git a/tests-m32/timer_create.test b/tests-m32/timer_create.test new file mode 100755 index 00000000..870a1795 --- /dev/null +++ b/tests-m32/timer_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timer_create syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/timer_xettime.c b/tests-m32/timer_xettime.c new file mode 100644 index 00000000..9eabbf08 --- /dev/null +++ b/tests-m32/timer_xettime.c @@ -0,0 +1,112 @@ +/* + * This file is part of timer_xettime strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_timer_create \ + && defined __NR_timer_gettime \ + && defined __NR_timer_settime + +# include +# include +# include +# include +# include + +int +main(void) +{ + syscall(__NR_timer_settime, 0xdefaced, TIMER_ABSTIME, NULL, NULL); + printf("timer_settime(%d, TIMER_ABSTIME, NULL, NULL)" + " = -1 EINVAL (%m)\n", 0xdefaced); + + int tid; + struct sigevent sev = { .sigev_notify = SIGEV_NONE }; + + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid)) + perror_msg_and_skip("timer_create"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_signo=0" + ", sigev_notify=SIGEV_NONE}, [%d]) = 0\n", tid); + + struct { + struct itimerspec its; + uint32_t pad[4]; + } old = { + .its = { + .it_interval = { 0xdeface5, 0xdeface6 }, + .it_value = { 0xdeface7, 0xdeface8 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .its = { + .it_interval = { 0xdeface1, 0xdeface2 }, + .it_value = { 0xdeface3, 0xdeface4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_timer_settime, tid, 0, &new.its, &old.its)) + perror_msg_and_skip("timer_settime"); + printf("timer_settime(%d, 0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ") = 0\n", + tid, + (intmax_t) new.its.it_interval.tv_sec, + (intmax_t) new.its.it_interval.tv_nsec, + (intmax_t) new.its.it_value.tv_sec, + (intmax_t) new.its.it_value.tv_nsec, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + if (syscall(__NR_timer_gettime, tid, &old.its)) + perror_msg_and_skip("timer_gettime"); + printf("timer_gettime(%d" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + tid, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timer_create && __NR_timer_gettime && __NR_timer_settime") + +#endif diff --git a/tests-m32/timer_xettime.test b/tests-m32/timer_xettime.test new file mode 100755 index 00000000..08bcdd68 --- /dev/null +++ b/tests-m32/timer_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timer_create, timer_settime, and timer_gettime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests-m32/timerfd_xettime.c b/tests-m32/timerfd_xettime.c new file mode 100644 index 00000000..ca7124ec --- /dev/null +++ b/tests-m32/timerfd_xettime.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_timerfd_create \ + && defined __NR_timerfd_gettime \ + && defined __NR_timerfd_settime \ + && defined O_CLOEXEC + +# include +# include +# include +# include + +int +main(void) +{ + (void) close(0); + if (syscall(__NR_timerfd_create, CLOCK_MONOTONIC, O_CLOEXEC | O_NONBLOCK)) + perror_msg_and_skip("timerfd_create"); + puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0"); + + struct { + struct itimerspec its; + uint32_t pad[4]; + } old = { + .its = { + .it_interval = { 0xdeface5, 0xdeface6 }, + .it_value = { 0xdeface7, 0xdeface8 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .its = { + .it_interval = { 0xdeface1, 0xdeface2 }, + .it_value = { 0xdeface3, 0xdeface4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its)) + perror_msg_and_skip("timerfd_settime"); + printf("timerfd_settime(0, 0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ") = 0\n", + (intmax_t) new.its.it_interval.tv_sec, + (intmax_t) new.its.it_interval.tv_nsec, + (intmax_t) new.its.it_value.tv_sec, + (intmax_t) new.its.it_value.tv_nsec, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + if (syscall(__NR_timerfd_gettime, 0, &old.its)) + perror_msg_and_skip("timerfd_gettime"); + printf("timerfd_gettime(0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timerfd_create && __NR_timerfd_gettime" + " && __NR_timerfd_settime && O_CLOEXEC") + +#endif diff --git a/tests-m32/timerfd_xettime.test b/tests-m32/timerfd_xettime.test new file mode 100755 index 00000000..75aa21c2 --- /dev/null +++ b/tests-m32/timerfd_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timerfd_create, timerfd_settime, and timerfd_gettime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests-m32/times-fail.c b/tests-m32/times-fail.c new file mode 100644 index 00000000..cb69bd43 --- /dev/null +++ b/tests-m32/times-fail.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include +#include +#include +#include + +int +main (void) +{ + assert(syscall(__NR_times, 0x42) == -1); + printf("times(0x42) = -1 EFAULT (%m)\n"); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-m32/times-fail.test b/tests-m32/times-fail.test new file mode 100755 index 00000000..ee28a060 --- /dev/null +++ b/tests-m32/times-fail.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of failing times syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -e trace=times diff --git a/tests-m32/times.c b/tests-m32/times.c new file mode 100644 index 00000000..2c7b95e5 --- /dev/null +++ b/tests-m32/times.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2015 Eugene Syromyatnikov + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * This test burns some CPU cycles in user space and kernel space in order to + * get some non-zero values returned by times(2). + */ + +#include "tests.h" +#include +#include +#include +#include + +#include +#include +#include + +enum { + NUM_USER_ITERS = 1000000, + PARENT_CPUTIME_LIMIT_NSEC = 200000000, + CHILD_CPUTIME_LIMIT_NSEC = 300000000 +}; + +int +main (void) +{ + struct timespec ts; + volatile int dummy = 0; + int i = 0; + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + const long cputime_limit = + pid ? PARENT_CPUTIME_LIMIT_NSEC : CHILD_CPUTIME_LIMIT_NSEC; + + /* Enjoying my user time */ + while (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { + if (ts.tv_sec || ts.tv_nsec >= cputime_limit) + break; + + if (i && !(ts.tv_sec || ts.tv_nsec)) + error_msg_and_skip("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 0})"); + + for (i = 0; i < NUM_USER_ITERS; ++i) + ++dummy; + } + + /* Enjoying my system time */ + while (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { + if (ts.tv_sec || ts.tv_nsec >= cputime_limit * 2) + break; + + sched_yield(); + } + + if (pid == 0) { + return 0; + } else { + wait(NULL); + } + + struct tms tbuf; + unsigned long long llres; + + /* + * On systems where user's and kernel's long types are the same, + * prefer direct times syscall over libc's times function because + * the latter is more prone to return value truncation. + */ +#undef USE_LIBC_SYSCALL +#if defined __NR_times && \ + !defined(LINUX_MIPSN32) && \ + !(defined __x86_64__ && defined __ILP32__) +# define USE_LIBC_SYSCALL 1 +#endif + +#if defined USE_LIBC_SYSCALL + long res = syscall(__NR_times, &tbuf); + + if (-1L == res) + perror_msg_and_skip("times"); + else + llres = (unsigned long) res; +#elif defined __NR_times && defined __x86_64__ && defined __ILP32__ + register long arg asm("rdi") = (long) &tbuf; + asm volatile("syscall\n\t" + : "=a"(llres) + : "0"(__NR_times), "r"(arg) + : "memory", "cc", "r11", "cx"); + if (llres > 0xfffffffffffff000) + return 77; +#else + clock_t res = times(&tbuf); + + if ((clock_t) -1 == res) + perror_msg_and_skip("times"); + if (sizeof(res) < sizeof(unsigned long long)) + llres = (unsigned long) res; + else + llres = res; +#endif + + printf("times({tms_utime=%llu, tms_stime=%llu, ", + (unsigned long long) tbuf.tms_utime, + (unsigned long long) tbuf.tms_stime); + printf("tms_cutime=%llu, tms_cstime=%llu}) = %llu\n", + (unsigned long long) tbuf.tms_cutime, + (unsigned long long) tbuf.tms_cstime, + llres); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-m32/times.test b/tests-m32/times.test new file mode 100755 index 00000000..b97e0d33 --- /dev/null +++ b/tests-m32/times.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of times syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/tprintf.c b/tests-m32/tprintf.c new file mode 100644 index 00000000..a759d8af --- /dev/null +++ b/tests-m32/tprintf.c @@ -0,0 +1,90 @@ +/* + * Close stdin, move stdout to a non-standard descriptor, and print. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static ssize_t +write_retry(int fd, const void *buf, size_t count) +{ + ssize_t rc; + + do { + errno = 0; + rc = write(fd, buf, count); + } while (rc == -1 && EINTR == errno); + + if (rc <= 0) + perror_msg_and_fail("write"); + + return rc; +} + +static void +write_loop(int fd, const char *buf, size_t count) +{ + ssize_t offset = 0; + + while (count > 0) { + ssize_t block = write_retry(fd, &buf[offset], count); + + offset += block; + count -= (size_t) block; + } +} + +void +tprintf(const char *fmt, ...) +{ + static int initialized; + if (!initialized) { + assert(dup2(1, 3) == 3); + assert(close(1) == 0); + (void) close(0); + initialized = 1; + } + + va_list p; + va_start(p, fmt); + + static char buf[65536]; + int len = vsnprintf(buf, sizeof(buf), fmt, p); + if (len < 0) + perror_msg_and_fail("vsnprintf"); + assert((unsigned) len < sizeof(buf)); + + write_loop(3, buf, len); + + va_end(p); +} diff --git a/tests-m32/truncate.c b/tests-m32/truncate.c new file mode 100644 index 00000000..d9529334 --- /dev/null +++ b/tests-m32/truncate.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_truncate + +# include +# include + +int +main(void) +{ + static const char fname[] = "truncate\nfilename"; + static const char qname[] = "truncate\\nfilename"; + const kernel_ulong_t len = (kernel_ulong_t) 0xdefaced0badc0deULL; + long rc; + + if (sizeof(len) > sizeof(long)) + rc = truncate(fname, len); + else + rc = syscall(__NR_truncate, fname, len); + + printf("truncate(\"%s\", %llu) = %ld %s (%m)\n", + qname, (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_truncate") + +#endif diff --git a/tests-m32/truncate.test b/tests-m32/truncate.test new file mode 100755 index 00000000..6bf1e702 --- /dev/null +++ b/tests-m32/truncate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check truncate syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/truncate64.c b/tests-m32/truncate64.c new file mode 100644 index 00000000..8c29ea81 --- /dev/null +++ b/tests-m32/truncate64.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_truncate64 + +# include +# include + +int +main(void) +{ + static const char fname[] = "truncate64\nfilename"; + static const char qname[] = "truncate64\\nfilename"; + const off_t len = 0xdefaceddeadbeefULL; + + int rc = truncate(fname, len); + printf("truncate64(\"%s\", %llu) = %d %s (%m)\n", + qname, (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_truncate64") + +#endif diff --git a/tests-m32/truncate64.test b/tests-m32/truncate64.test new file mode 100755 index 00000000..c4668062 --- /dev/null +++ b/tests-m32/truncate64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check truncate64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/ugetrlimit.c b/tests-m32/ugetrlimit.c new file mode 100644 index 00000000..a99e496d --- /dev/null +++ b/tests-m32/ugetrlimit.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_ugetrlimit + +# define NR_GETRLIMIT __NR_ugetrlimit +# define STR_GETRLIMIT "ugetrlimit" +# include "xgetrlimit.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_ugetrlimit") + +#endif diff --git a/tests-m32/ugetrlimit.test b/tests-m32/ugetrlimit.test new file mode 100755 index 00000000..f4648ff1 --- /dev/null +++ b/tests-m32/ugetrlimit.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ugetrlimit syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/uio.c b/tests-m32/uio.c new file mode 100644 index 00000000..6291f972 --- /dev/null +++ b/tests-m32/uio.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#if defined(HAVE_PREADV) && defined(HAVE_PWRITEV) + +# include +# include +# include +# include + +int +main(void) +{ + const off_t offset = 0xdefaceddeadbeefLL; + char buf[4]; + struct iovec iov = { buf, sizeof buf }; + + (void) close(0); + assert(open("/dev/zero", O_RDONLY) == 0); + assert(pread(0, buf, sizeof buf, offset) == 4); + assert(preadv(0, &iov, 1, offset) == 4); + assert(!close(0)); + + assert(open("/dev/null", O_WRONLY) == 0); + assert(pwrite(0, buf, sizeof buf, offset) == 4); + assert(pwritev(0, &iov, 1, offset) == 4); + assert(!close(0)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV && HAVE_PWRITEV") + +#endif diff --git a/tests-m32/uio.expected b/tests-m32/uio.expected new file mode 100644 index 00000000..98d5c06d --- /dev/null +++ b/tests-m32/uio.expected @@ -0,0 +1,4 @@ +pread(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 +preadv\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 +pwrite(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 +pwritev\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 diff --git a/tests-m32/uio.test b/tests-m32/uio.test new file mode 100755 index 00000000..020b97e9 --- /dev/null +++ b/tests-m32/uio.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check how pread/pwrite and preadv/pwritev syscalls are traced. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -edesc $args +match_grep + +exit 0 diff --git a/tests-m32/umask.c b/tests-m32/umask.c new file mode 100644 index 00000000..86903a95 --- /dev/null +++ b/tests-m32/umask.c @@ -0,0 +1,24 @@ +#include +#include + +void +test_umask(const mode_t mode) +{ + mode_t rc = umask(0xffff0000 | mode); + printf("umask(%#03ho) = %#03o\n", (unsigned short) mode, rc); +} + +int +main(void) +{ + test_umask(0); + test_umask(06); + test_umask(026); + test_umask(0126); + test_umask(07777); + test_umask(0107777); + test_umask(-1); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/umask.test b/tests-m32/umask.test new file mode 100755 index 00000000..1351721f --- /dev/null +++ b/tests-m32/umask.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check umask syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-m32/umode_t.c b/tests-m32/umode_t.c new file mode 100644 index 00000000..5041638e --- /dev/null +++ b/tests-m32/umode_t.c @@ -0,0 +1,78 @@ +/* + * Check decoding of umode_t type syscall arguments. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#ifndef TEST_SYSCALL_PREFIX_ARGS +# define TEST_SYSCALL_PREFIX_ARGS +#endif +#ifndef TEST_SYSCALL_PREFIX_STR +# define TEST_SYSCALL_PREFIX_STR "" +#endif + +static const char sample[] = TEST_SYSCALL_STR; + +static void +test_syscall(unsigned short mode) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + long rc = syscall(TEST_SYSCALL_NR, TEST_SYSCALL_PREFIX_ARGS + sample, lmode); + + if (mode <= 07) + printf("%s(%s\"%s\", 00%d) = %ld %s (%m)\n", + sample, TEST_SYSCALL_PREFIX_STR, + sample, (int) mode, rc, errno2name()); + else + printf("%s(%s\"%s\", %#03ho) = %ld %s (%m)\n", + sample, TEST_SYSCALL_PREFIX_STR, + sample, mode, rc, errno2name()); +} + +int +main(void) +{ + test_syscall(0); + test_syscall(0xffff); + test_syscall(06); + test_syscall(060); + test_syscall(0600); + test_syscall(024); + test_syscall(S_IFREG); + test_syscall(S_IFDIR | 06); + test_syscall(S_IFLNK | 060); + test_syscall(S_IFIFO | 0600); + test_syscall(S_IFCHR | 024); + test_syscall((0xffff & ~S_IFMT) | S_IFBLK); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/umount.c b/tests-m32/umount.c new file mode 100644 index 00000000..eda7ae5c --- /dev/null +++ b/tests-m32/umount.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef __NR_oldumount +# define TEST_SYSCALL_STR "oldumount" +#else +# if defined __NR_umount && defined __NR_umount2 +# define __NR_oldumount __NR_umount +# define TEST_SYSCALL_STR "umount" +# endif +#endif + +#ifdef __NR_oldumount + +int +main(void) +{ + static const char sample[] = "umount.sample"; + if (mkdir(sample, 0700)) + perror_msg_and_fail("mkdir: %s", sample); + + long rc = syscall(__NR_oldumount, sample); + printf("%s(\"%s\") = %ld %s (%m)\n", + TEST_SYSCALL_STR, sample, rc, errno2name()); + + if (rmdir(sample)) + perror_msg_and_fail("rmdir: %s", sample); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldumount") + +#endif diff --git a/tests-m32/umount.test b/tests-m32/umount.test new file mode 100755 index 00000000..a5840d54 --- /dev/null +++ b/tests-m32/umount.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check umount syscall decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha) syscall=oldumount ;; + *) syscall=umount ;; +esac +run_strace_match_diff -a24 -s6 -e trace=$syscall diff --git a/tests-m32/umount2.c b/tests-m32/umount2.c new file mode 100644 index 00000000..1a6d8451 --- /dev/null +++ b/tests-m32/umount2.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef __NR_umount2 +# define TEST_SYSCALL_STR "umount2" +#else +# define __NR_umount2 __NR_umount +# define TEST_SYSCALL_STR "umount" +#endif + +int +main(void) +{ + static const char sample[] = "umount2.sample"; + if (mkdir(sample, 0700)) + perror_msg_and_fail("mkdir: %s", sample); + (void) syscall(__NR_umount2, sample, 31); + printf("%s(\"%s\", MNT_FORCE|MNT_DETACH|MNT_EXPIRE|UMOUNT_NOFOLLOW|0x10)" + " = -1 EINVAL (%m)\n", TEST_SYSCALL_STR, sample); + if (rmdir(sample)) + perror_msg_and_fail("rmdir: %s", sample); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/umount2.test b/tests-m32/umount2.test new file mode 100755 index 00000000..c43b38db --- /dev/null +++ b/tests-m32/umount2.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check umount2 syscall decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha|ia64) syscall=umount ;; + *) syscall=umount2 ;; +esac +run_strace_match_diff -s7 -e trace=$syscall diff --git a/tests-m32/umoven-illptr.c b/tests-m32/umoven-illptr.c new file mode 100644 index 00000000..4deee163 --- /dev/null +++ b/tests-m32/umoven-illptr.c @@ -0,0 +1,57 @@ +/* + * Check decoding of invalid pointer by umoven. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + if (F8ILL_KULONG_SUPPORTED) { + struct timespec ts = { 0, 0 }; + const void *const p = tail_memdup(&ts, sizeof(ts)); + + long rc = syscall(__NR_nanosleep, p, NULL); + printf("nanosleep({tv_sec=0, tv_nsec=0}, NULL) = %s\n", + sprintrc(rc)); + + const kernel_ulong_t ill = f8ill_ptr_to_kulong(p); + rc = syscall(__NR_nanosleep, ill, NULL); + printf("nanosleep(%#llx, NULL) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; + } else { + return 77; + } +} diff --git a/tests-m32/umoven-illptr.test b/tests-m32/umoven-illptr.test new file mode 100755 index 00000000..7b8cb314 --- /dev/null +++ b/tests-m32/umoven-illptr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of invalid pointer by umoven. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests-m32/umovestr-illptr.c b/tests-m32/umovestr-illptr.c new file mode 100644 index 00000000..dea6885d --- /dev/null +++ b/tests-m32/umovestr-illptr.c @@ -0,0 +1,53 @@ +/* + * Check decoding of invalid pointer by umovestr. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + if (F8ILL_KULONG_SUPPORTED) { + const void *const p = tail_memdup(".", 2); + long rc = syscall(__NR_chdir, p); + printf("chdir(\".\") = %s\n", sprintrc(rc)); + + const kernel_ulong_t ill = f8ill_ptr_to_kulong(p); + rc = syscall(__NR_chdir, ill); + printf("chdir(%#llx) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; + } else { + return 77; + } +} diff --git a/tests-m32/umovestr-illptr.test b/tests-m32/umovestr-illptr.test new file mode 100755 index 00000000..6f1cc862 --- /dev/null +++ b/tests-m32/umovestr-illptr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of invalid pointer by umovestr. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a11 -e trace=chdir diff --git a/tests-m32/umovestr.c b/tests-m32/umovestr.c new file mode 100644 index 00000000..95fccb67 --- /dev/null +++ b/tests-m32/umovestr.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + const size_t tail_len = 257; + char *addr = tail_alloc(tail_len); + memset(addr, '/', tail_len - 1); + addr[tail_len - 1] = '\0'; + if (chdir(addr)) + perror_msg_and_skip("chdir"); + return 0; +} diff --git a/tests-m32/umovestr.expected b/tests-m32/umovestr.expected new file mode 100644 index 00000000..c26d877e --- /dev/null +++ b/tests-m32/umovestr.expected @@ -0,0 +1,2 @@ +chdir("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////") = 0 ++++ exited with 0 +++ diff --git a/tests-m32/umovestr.test b/tests-m32/umovestr.test new file mode 100755 index 00000000..5ae8ffa9 --- /dev/null +++ b/tests-m32/umovestr.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# umovestr short read regression test + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e chdir $args +match_diff + +exit 0 diff --git a/tests-m32/umovestr2.c b/tests-m32/umovestr2.c new file mode 100644 index 00000000..b2c63d80 --- /dev/null +++ b/tests-m32/umovestr2.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const size_t page_len = get_page_size(); + const size_t tail_len = page_len * 2 - 1; + const size_t str_len = tail_len - 1; + + char *addr = tail_alloc(tail_len); + memset(addr, '0', str_len); + addr[str_len] = '\0'; + + char *argv[] = { NULL }; + char *envp[] = { addr, NULL }; + execve("", argv, envp); + + printf("execve(\"\", [], [\"%0*u\"]) = -1 ENOENT (%m)\n", + (int) str_len, 0); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-m32/umovestr2.test b/tests-m32/umovestr2.test new file mode 100755 index 00000000..5c5d561f --- /dev/null +++ b/tests-m32/umovestr2.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# umovestr short read regression test + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -veexecve -s262144 $args > "$EXP" +check_prog sed +sed 1d < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-m32/umovestr3.c b/tests-m32/umovestr3.c new file mode 100644 index 00000000..cf2fa7d4 --- /dev/null +++ b/tests-m32/umovestr3.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const unsigned int size = PATH_MAX - 1; + const char *p = tail_alloc(size); + const char *const efault = p + size; + + for (; p <= efault; ++p) { + int rc = chdir(p); + printf("chdir(%p) = %d %s (%m)\n", p, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/umovestr3.test b/tests-m32/umovestr3.test new file mode 100755 index 00000000..d5be2832 --- /dev/null +++ b/tests-m32/umovestr3.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# yet another umovestr short read test + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=chdir diff --git a/tests-m32/uname.c b/tests-m32/uname.c new file mode 100644 index 00000000..cd6f51cd --- /dev/null +++ b/tests-m32/uname.c @@ -0,0 +1,44 @@ +#include "tests.h" +#include + +#ifdef __NR_uname + +# include +# include +# include + +int main(int ac, char **av) +{ + int abbrev = ac > 1; + struct utsname *const uname = tail_alloc(sizeof(struct utsname)); + int rc = syscall(__NR_uname, uname); + printf("uname({sysname=\""); + print_quoted_string(uname->sysname); + printf("\", nodename=\""); + print_quoted_string(uname->nodename); + if (abbrev) { + printf("\", ..."); + } else { + printf("\", release=\""); + print_quoted_string(uname->release); + printf("\", version=\""); + print_quoted_string(uname->version); + printf("\", machine=\""); + print_quoted_string(uname->machine); +# ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME + printf("\", domainname=\""); + print_quoted_string(uname->domainname); +# endif + printf("\""); + } + printf("}) = %d\n", rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_uname") + +#endif diff --git a/tests-m32/uname.test b/tests-m32/uname.test new file mode 100755 index 00000000..03fe30cd --- /dev/null +++ b/tests-m32/uname.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check uname syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog uniq + +run_prog > /dev/null +run_strace -v -euname $args > "$EXP" +uniq < "$LOG" > "$OUT" + +run_prog "./$NAME" abbrev > /dev/null +run_strace -euname $args >> "$EXP" +uniq < "$LOG" >> "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$OUT" "$EXP" diff --git a/tests-m32/unix-pair-send-recv.c b/tests-m32/unix-pair-send-recv.c new file mode 100644 index 00000000..d4ac0d23 --- /dev/null +++ b/tests-m32/unix-pair-send-recv.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include + +#ifndef __NR_send +# define __NR_send -1 +#endif +#define SC_send 9 + +#ifndef __NR_recv +# define __NR_recv -1 +#endif +#define SC_recv 10 + +static int +sys_send(int sockfd, const void *buf, size_t len, int flags) +{ + int rc = socketcall(__NR_send, SC_send, + sockfd, (long) buf, len, flags, 0); + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("send"); + return rc; +} + +static int +sys_recv(int sockfd, const void *buf, size_t len, int flags) +{ + int rc = socketcall(__NR_recv, SC_recv, + sockfd, (long) buf, len, flags, 0); + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("recv"); + return rc; +} + +static void +transpose(char *str, const size_t len) +{ + size_t i; + + for (i = 0; i < len / 2; ++i) { + char c = str[i]; + str[i] = str[len - 1 - i]; + str[len - 1 - i] = c; + } +} + +int +main(int ac, char **av) +{ + assert(ac == 2); + const size_t len = strlen(av[1]); + assert(len); + char *const buf0 = tail_alloc(len); + char *const buf1 = tail_alloc(len); + memcpy(buf0, av[1], len); + + (void) close(0); + (void) close(1); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + assert(sys_send(0, buf0, len, MSG_DONTROUTE) == (int) len); + assert(sys_recv(1, buf1, len, MSG_WAITALL) == (int) len); + + transpose(buf1, len); + assert(sys_send(1, buf1, len, MSG_DONTROUTE) == (int) len); + if (close(1)) + perror_msg_and_fail("close(1)"); + + assert(sys_recv(0, buf0, len, MSG_WAITALL) == (int) len); + if (close(0)) + perror_msg_and_fail("close(0)"); + assert(sys_recv(0, NULL, len, MSG_DONTWAIT) == -1); + + return 0; +} diff --git a/tests-m32/unix-pair-send-recv.expected b/tests-m32/unix-pair-send-recv.expected new file mode 100644 index 00000000..39359781 --- /dev/null +++ b/tests-m32/unix-pair-send-recv.expected @@ -0,0 +1,10 @@ +send(0, "abcdefghijklmnopqrstuvwxyz", 26, MSG_DONTROUTE) = 26 + | 00000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop | + | 00010 71 72 73 74 75 76 77 78 79 7a qrstuvwxyz | +recv(1, "abcdefghijklmnopqrstuvwxyz", 26, MSG_WAITALL) = 26 +send(1, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_DONTROUTE) = 26 +recv(0, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_WAITALL) = 26 + | 00000 7a 79 78 77 76 75 74 73 72 71 70 6f 6e 6d 6c 6b zyxwvutsrqponmlk | + | 00010 6a 69 68 67 66 65 64 63 62 61 jihgfedcba | +recv(0, NULL, 26, MSG_DONTWAIT) = -1 EBADF (Bad file descriptor) ++++ exited with 0 +++ diff --git a/tests-m32/unix-pair-send-recv.test b/tests-m32/unix-pair-send-recv.test new file mode 100755 index 00000000..4defdebb --- /dev/null +++ b/tests-m32/unix-pair-send-recv.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding and dumping of send and recv syscalls. + +. "${srcdir=.}/init.sh" + +run_prog ./unix-pair-send-recv abcdefghijklmnopqrstuvwxyz +run_strace -a32 -esignal=none -esend,recv -eread=0 -ewrite=0 $args +match_diff + +exit 0 diff --git a/tests-m32/unix-pair-sendto-recvfrom.c b/tests-m32/unix-pair-sendto-recvfrom.c new file mode 100644 index 00000000..cea382c9 --- /dev/null +++ b/tests-m32/unix-pair-sendto-recvfrom.c @@ -0,0 +1,87 @@ +/* + * Check decoding and dumping of sendto and recvfrom syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static void +transpose(char *str, int len) +{ + int i; + + for (i = 0; i < len / 2; ++i) { + char c = str[i]; + str[i] = str[len - 1 - i]; + str[len - 1 - i] = c; + } +} + +int +main(int ac, char **av) +{ + assert(ac == 2); + const int len = strlen(av[1]); + assert(len); + + (void) close(0); + (void) close(1); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (pid) { + assert(close(1) == 0); + transpose(av[1], len); + assert(sendto(0, av[1], len, MSG_DONTROUTE, NULL, 0) == len); + assert(recvfrom(0, av[1], len, MSG_WAITALL, NULL, NULL) == len); + assert(close(0) == 0); + + int status; + assert(waitpid(pid, &status, 0) == pid); + assert(status == 0); + } else { + assert(close(0) == 0); + assert(recvfrom(1, av[1], len, MSG_WAITALL, NULL, NULL) == len); + transpose(av[1], len); + assert(sendto(1, av[1], len, MSG_DONTROUTE, NULL, 0) == len); + assert(recvfrom(1, av[1], len, MSG_WAITALL, NULL, NULL) == 0); + assert(close(1) == 0); + } + + return 0; +} diff --git a/tests-m32/unix-pair-sendto-recvfrom.expected b/tests-m32/unix-pair-sendto-recvfrom.expected new file mode 100644 index 00000000..f8fd2449 --- /dev/null +++ b/tests-m32/unix-pair-sendto-recvfrom.expected @@ -0,0 +1,7 @@ +sendto(0, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_DONTROUTE, NULL, 0) = 26 + | 00000 7a 79 78 77 76 75 74 73 72 71 70 6f 6e 6d 6c 6b zyxwvutsrqponmlk | + | 00010 6a 69 68 67 66 65 64 63 62 61 jihgfedcba | +recvfrom(0, "abcdefghijklmnopqrstuvwxyz", 26, MSG_WAITALL, NULL, NULL) = 26 + | 00000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop | + | 00010 71 72 73 74 75 76 77 78 79 7a qrstuvwxyz | ++++ exited with 0 +++ diff --git a/tests-m32/unix-pair-sendto-recvfrom.test b/tests-m32/unix-pair-sendto-recvfrom.test new file mode 100755 index 00000000..21afe236 --- /dev/null +++ b/tests-m32/unix-pair-sendto-recvfrom.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding and dumping of sendto and recvfrom syscalls. + +. "${srcdir=.}/init.sh" + +run_prog ./unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz +run_strace -esignal=none -esendto,recvfrom -eread=0 -ewrite=0 $args +match_diff + +exit 0 diff --git a/tests-m32/unlink.c b/tests-m32/unlink.c new file mode 100644 index 00000000..bbb1de15 --- /dev/null +++ b/tests-m32/unlink.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_unlink + +# include +# include + +int +main(void) +{ + static const char sample[] = "unlink_sample"; + + long rc = syscall(__NR_unlink, sample); + printf("unlink(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unlink") + +#endif diff --git a/tests-m32/unlink.test b/tests-m32/unlink.test new file mode 100755 index 00000000..09bf79a7 --- /dev/null +++ b/tests-m32/unlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check unlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/unlinkat.c b/tests-m32/unlinkat.c new file mode 100644 index 00000000..22c3de39 --- /dev/null +++ b/tests-m32/unlinkat.c @@ -0,0 +1,34 @@ +#include "tests.h" +#include + +#ifdef __NR_unlinkat + +# include +# include + +int +main(void) +{ + static const char sample[] = "unlinkat_sample"; + const long fd = (long) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_unlinkat, fd, sample, 0); + printf("unlinkat(%d, \"%s\", 0) = %ld %s (%m)\n", + (int) fd, sample, rc, errno2name()); + + rc = syscall(__NR_unlinkat, -100, sample, -1L); + printf("unlinkat(%s, \"%s\", %s) = %ld %s (%m)\n", + "AT_FDCWD", sample, + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unlinkat") + +#endif diff --git a/tests-m32/unlinkat.test b/tests-m32/unlinkat.test new file mode 100755 index 00000000..864261f7 --- /dev/null +++ b/tests-m32/unlinkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check unlinkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/unshare.c b/tests-m32/unshare.c new file mode 100644 index 00000000..5aedde47 --- /dev/null +++ b/tests-m32/unshare.c @@ -0,0 +1,80 @@ +/* + * Check decoding of unshare syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_unshare + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xbadc0ded0000000fULL; + + static struct { + kernel_ulong_t val; + const char *str; + } unshare_flags[] = { + { ARG_STR(0) }, + { 0xdeadca75, + "CLONE_THREAD|CLONE_FS|CLONE_SIGHAND|CLONE_SYSVSEM|" + "CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET|CLONE_NEWUSER|" + "CLONE_NEWCGROUP|0x80a8c075" }, + { 0x2000000, "CLONE_NEWCGROUP" }, + { ARG_STR(0x81f8f0ff) " /* CLONE_??? */" }, + }; + + long rc; + unsigned int i; + + rc = syscall(__NR_unshare, bogus_flags); + printf("unshare(%#llx /* CLONE_??? */) = %s\n", + (unsigned long long) bogus_flags, sprintrc(rc)); + + for (i = 0; i < ARRAY_SIZE(unshare_flags); i++) { + rc = syscall(__NR_unshare, unshare_flags[i].val); + printf("unshare(%s) = %s\n", + unshare_flags[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unshare"); + +#endif diff --git a/tests-m32/unshare.test b/tests-m32/unshare.test new file mode 100755 index 00000000..ccb9575e --- /dev/null +++ b/tests-m32/unshare.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of setns syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-m32/userfaultfd.c b/tests-m32/userfaultfd.c new file mode 100644 index 00000000..60432fa3 --- /dev/null +++ b/tests-m32/userfaultfd.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined __NR_userfaultfd && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_userfaultfd, 1 | O_NONBLOCK | O_CLOEXEC); + printf("userfaultfd(O_NONBLOCK|O_CLOEXEC|0x1) = %ld %s (%m)\n", + rc, errno2name()); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_userfaultfd && O_CLOEXEC") + +#endif diff --git a/tests-m32/userfaultfd.test b/tests-m32/userfaultfd.test new file mode 100755 index 00000000..af8b6fbe --- /dev/null +++ b/tests-m32/userfaultfd.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check userfaultfd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-m32/ustat.c b/tests-m32/ustat.c new file mode 100644 index 00000000..57bb29c2 --- /dev/null +++ b/tests-m32/ustat.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ustat + +# include +# include +# include +# include +# ifdef HAVE_USTAT_H +# include +# endif + +int +main(void) +{ + const kernel_ulong_t magic = (kernel_ulong_t) 0xfacefeedffffffff; + unsigned long long buf[4]; + unsigned int dev; + long rc; + +# ifdef HAVE_USTAT_H + struct ustat *const ust = tail_alloc(sizeof(*ust)); + struct stat st; + if (stat(".", &st)) + perror_msg_and_fail("stat"); + + dev = (unsigned int) st.st_dev; + rc = syscall(__NR_ustat, dev, ust); + if (rc) + printf("ustat(makedev(%u, %u), %p) = %s\n", + major(dev), minor(dev), ust, sprintrc(rc)); + else + printf("ustat(makedev(%u, %u)" + ", {f_tfree=%llu, f_tinode=%llu}) = 0\n", + major(dev), minor(dev), + zero_extend_signed_to_ull(ust->f_tfree), + zero_extend_signed_to_ull(ust->f_tinode)); +# endif /* HAVE_USTAT_H */ + + dev = (unsigned int) magic; + rc = syscall(__NR_ustat, magic, 0); + printf("ustat(makedev(%u, %u), NULL) = %s\n", + major(dev), minor(dev), sprintrc(rc)); + + rc = syscall(__NR_ustat, magic, buf); + printf("ustat(makedev(%u, %u), %p) = %s\n", + major(dev), minor(dev), buf, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ustat") + +#endif diff --git a/tests-m32/ustat.test b/tests-m32/ustat.test new file mode 100755 index 00000000..60a88e0a --- /dev/null +++ b/tests-m32/ustat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ustat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-m32/utime.c b/tests-m32/utime.c new file mode 100644 index 00000000..8fd594f0 --- /dev/null +++ b/tests-m32/utime.c @@ -0,0 +1,97 @@ +/* + * Check decoding of utime syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_utime + +# include +# include +# include +# include +# include + + +static void +print_tm(const struct tm * const p) +{ + char buf[256]; + + strftime(buf, sizeof(buf), "%FT%T%z", p); + + printf("%s", buf); +} + +static long +k_utime(const void *const filename, const void *const times) +{ + return syscall(__NR_utime, filename, times); +} + +int +main(void) +{ + static const char *const dummy_str = "dummy filename"; + + const time_t t = time(NULL); + const struct tm * const p = localtime(&t); + const struct utimbuf u = { .actime = t, .modtime = t }; + const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u)); + const char *const dummy_filename = + tail_memdup(dummy_str, sizeof(dummy_str) - 1); + + long rc = k_utime("", NULL); + printf("utime(\"\", NULL) = %s\n", sprintrc(rc)); + + rc = k_utime(dummy_filename + sizeof(dummy_str), tail_u + 1); + printf("utime(%p, %p) = %s\n", dummy_filename + sizeof(dummy_str), + tail_u + 1, sprintrc(rc)); + + rc = k_utime(dummy_filename, (struct tm *) tail_u + 1); + printf("utime(%p, %p) = %s\n", + dummy_filename, (struct tm *) tail_u + 1, sprintrc(rc)); + + rc = k_utime("utime\nfilename", tail_u); + const char *errstr = sprintrc(rc); + printf("utime(\"utime\\nfilename\", {actime="); + print_tm(p); + printf(", modtime="); + print_tm(p); + printf("}) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_utime") + +#endif diff --git a/tests-m32/utime.test b/tests-m32/utime.test new file mode 100755 index 00000000..bd64c532 --- /dev/null +++ b/tests-m32/utime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of utime syscall. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a 16 -e trace=utime diff --git a/tests-m32/utimensat.c b/tests-m32/utimensat.c new file mode 100644 index 00000000..6d9faac2 --- /dev/null +++ b/tests-m32/utimensat.c @@ -0,0 +1,101 @@ +/* + * This file is part of utimensat strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#if defined HAVE_UTIMENSAT \ + && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW \ + && defined UTIME_NOW && defined UTIME_OMIT + +static void +print_ts(const struct timespec *ts) +{ + printf("{tv_sec=%ju, tv_nsec=%ju}", (uintmax_t) ts->tv_sec, + (uintmax_t) ts->tv_nsec); +} + +int +main(void) +{ + static const char fname[] = "utimensat\nfilename"; + + assert(utimensat(AT_FDCWD, fname, NULL, 0) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + + #define PREFIX "utimensat(AT_FDCWD, \"utimensat\\nfilename\", " + printf(PREFIX "NULL, 0) = -1 ENOENT (%m)\n"); + + struct timeval tv; + struct timespec ts[2]; + + if (gettimeofday(&tv, NULL)) + perror_msg_and_skip("gettimeofday"); + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_nsec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_nsec = tv.tv_usec + 1; + + printf(PREFIX "["); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], AT_SYMLINK_NOFOLLOW) = -1 ENOENT "); + + assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + printf("(%m)\n"); + + ts[0].tv_nsec = UTIME_NOW; + ts[1].tv_nsec = UTIME_OMIT; + assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + printf(PREFIX "[UTIME_NOW, UTIME_OMIT], AT_SYMLINK_NOFOLLOW)" + " = -1 ENOENT (%m)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_UTIMENSAT && AT_FDCWD && AT_SYMLINK_NOFOLLOW" + " && UTIME_NOW && UTIME_OMIT") + +#endif diff --git a/tests-m32/utimensat.test b/tests-m32/utimensat.test new file mode 100755 index 00000000..52e3f316 --- /dev/null +++ b/tests-m32/utimensat.test @@ -0,0 +1,20 @@ +#!/bin/sh + +# Check decoding of utimensat syscall. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e utimensat $args > "$OUT" + +check_prog grep +LC_ALL=C grep -x "utimensat(.*" "$LOG" > /dev/null || { + rm -f "$OUT" + skip_ 'test executable does not use utimensat syscall' +} + +match_diff "$LOG" "$OUT" + +rm -f "$OUT" + +exit 0 diff --git a/tests-m32/utimes.c b/tests-m32/utimes.c new file mode 100644 index 00000000..bbfa0310 --- /dev/null +++ b/tests-m32/utimes.c @@ -0,0 +1,84 @@ +/* + * Check decoding of utimes syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_utimes + +# include +# include +# include +# include + +int +main(void) +{ + struct timeval tv; + if (gettimeofday(&tv, NULL)) + perror_msg_and_fail("gettimeofday"); + + static const char sample[] = "utimes_sample"; + + long rc = syscall(__NR_utimes, sample, 0); + printf("utimes(\"%s\", NULL) = %ld %s (%m)\n", + sample, rc, errno2name()); + + struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_usec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_usec = tv.tv_usec + 1; + + rc = syscall(__NR_utimes, 0, ts + 2); + printf("utimes(NULL, %p) = %ld %s (%m)\n", ts + 2, rc, errno2name()); + + rc = syscall(__NR_utimes, 0, ts + 1); + printf("utimes(NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " + "%ld %s (%m)\n", + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + ts + 2, rc, errno2name()); + + rc = syscall(__NR_utimes, "", ts); + printf("utimes(\"\", [{tv_sec=%jd, tv_usec=%jd}, " + "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", + (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_utimes") + +#endif diff --git a/tests-m32/utimes.test b/tests-m32/utimes.test new file mode 100755 index 00000000..99143a0b --- /dev/null +++ b/tests-m32/utimes.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check utimes syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/vfork-f.c b/tests-m32/vfork-f.c new file mode 100644 index 00000000..b14e4b49 --- /dev/null +++ b/tests-m32/vfork-f.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static inline int +logit_(const char *const str) +{ + return !chdir(str); +} + +#define prefix "vfork-f." +#define logit(arg) logit_(prefix arg) + +int main(int ac, char **av) +{ + if (ac < 1) + return 1; + if (ac > 1) { + if (read(0, &ac, sizeof(int))) + return 2; + return logit("exec"); + } + + logit("start"); + + int child_wait_fds[2]; + (void) close(0); + if (pipe(child_wait_fds)) + perror_msg_and_fail("pipe"); + if (fcntl(child_wait_fds[1], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + + int parent_wait_fds[2]; + if (pipe(parent_wait_fds)) + perror_msg_and_fail("pipe"); + if (fcntl(parent_wait_fds[0], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + if (fcntl(parent_wait_fds[1], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + + char *const args[] = { av[0], (char *) "", NULL }; + pid_t pid = vfork(); + + if (pid < 0) + perror_msg_and_fail("vfork"); + + if (!pid) { + if (logit("child") || execve(args[0], args, args + 1)) + _exit(2); + } + + close(0); + close(parent_wait_fds[1]); + + if (read(parent_wait_fds[0], &parent_wait_fds[1], sizeof(int))) + perror_msg_and_fail("read"); + logit("parent"); + close(child_wait_fds[1]); + + int status; + assert(wait(&status) == pid); + assert(status == 0); + + pid_t ppid = getpid(); + logit("finish"); + + printf("%-5d chdir(\"%sstart\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%schild\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sparent\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sexec\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sfinish\") = -1 ENOENT (%m)\n", + ppid, prefix, + pid, prefix, + ppid, prefix, + pid, prefix, + ppid, prefix); + return 0; +} diff --git a/tests-m32/vfork-f.test b/tests-m32/vfork-f.test new file mode 100755 index 00000000..ff4422b2 --- /dev/null +++ b/tests-m32/vfork-f.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check how strace -f follows vfork syscall. + +. "${srcdir=.}/fork-f.test" diff --git a/tests-m32/vhangup.c b/tests-m32/vhangup.c new file mode 100644 index 00000000..e7ddabba --- /dev/null +++ b/tests-m32/vhangup.c @@ -0,0 +1,34 @@ +#include "tests.h" +#include + +#ifdef __NR_vhangup + +# include +# include + +int +main(void) +{ + if (setsid() == -1) + perror_msg_and_skip("setsid"); + + long rc = syscall(__NR_vhangup); + + /* + * On setsid() success, the new session has no controlling terminal, + * therefore a subsequent vhangup() has nothing to hangup. + * + * The system call, however, returns 0 iff the calling process + * has CAP_SYS_TTY_CONFIG capability. + */ + printf("vhangup() = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_vhangup") + +#endif diff --git a/tests-m32/vhangup.test b/tests-m32/vhangup.test new file mode 100755 index 00000000..8fe1cacb --- /dev/null +++ b/tests-m32/vhangup.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check vhangup syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a10 diff --git a/tests-m32/vmsplice.c b/tests-m32/vmsplice.c new file mode 100644 index 00000000..f29962e3 --- /dev/null +++ b/tests-m32/vmsplice.c @@ -0,0 +1,107 @@ +/* + * This file is part of vmsplice strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_vmsplice + +# include +# include +# include +# include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + const struct iovec iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *iov = tail_memdup(iov_, sizeof(iov_)); + const unsigned int len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + tprintf("vmsplice(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, %s) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(iov_), + "SPLICE_F_NONBLOCK", len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const long rc = syscall(__NR_vmsplice, 1, iov, ARRAY_SIZE(iov_), 2); + if (rc < 0) + perror_msg_and_skip("vmsplice"); + assert(rc == (int) len); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_vmsplice") + +#endif diff --git a/tests-m32/vmsplice.test b/tests-m32/vmsplice.test new file mode 100755 index 00000000..8a80650e --- /dev/null +++ b/tests-m32/vmsplice.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of vmsplice syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=1 diff --git a/tests-m32/wait4-v.c b/tests-m32/wait4-v.c new file mode 100644 index 00000000..8c0c9f59 --- /dev/null +++ b/tests-m32/wait4-v.c @@ -0,0 +1,3 @@ +/* This file is part of wait4-v strace test. */ +#define VERBOSE 1 +#include "wait4.c" diff --git a/tests-m32/wait4-v.test b/tests-m32/wait4-v.test new file mode 100755 index 00000000..58e55f25 --- /dev/null +++ b/tests-m32/wait4-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of wait4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests-m32/wait4.c b/tests-m32/wait4.c new file mode 100644 index 00000000..ccb3ebb9 --- /dev/null +++ b/tests-m32/wait4.c @@ -0,0 +1,199 @@ +/* + * Check decoding of wait4 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static const char * +sprint_rusage(const struct rusage *const ru) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{ru_utime={tv_sec=%lu, tv_usec=%lu}" + ", ru_stime={tv_sec=%lu, tv_usec=%lu}" +#if VERBOSE + ", ru_maxrss=%lu" + ", ru_ixrss=%lu" + ", ru_idrss=%lu" + ", ru_isrss=%lu" + ", ru_minflt=%lu" + ", ru_majflt=%lu" + ", ru_nswap=%lu" + ", ru_inblock=%lu" + ", ru_oublock=%lu" + ", ru_msgsnd=%lu" + ", ru_msgrcv=%lu" + ", ru_nsignals=%lu" + ", ru_nvcsw=%lu" + ", ru_nivcsw=%lu}" +#else + ", ...}" +#endif + , (long) ru->ru_utime.tv_sec + , (long) ru->ru_utime.tv_usec + , (long) ru->ru_stime.tv_sec + , (long) ru->ru_stime.tv_usec +#if VERBOSE + , (long) ru->ru_maxrss + , (long) ru->ru_ixrss + , (long) ru->ru_idrss + , (long) ru->ru_isrss + , (long) ru->ru_minflt + , (long) ru->ru_majflt + , (long) ru->ru_nswap + , (long) ru->ru_inblock + , (long) ru->ru_oublock + , (long) ru->ru_msgsnd + , (long) ru->ru_msgrcv + , (long) ru->ru_nsignals + , (long) ru->ru_nvcsw + , (long) ru->ru_nivcsw +#endif + ); + return buf; +} + +static pid_t +do_wait4(pid_t pid, int *wstatus, int options, struct rusage *ru) +{ + sigset_t mask = {}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); + pid_t rc = wait4(pid, wstatus, options, ru); + assert(sigprocmask(SIG_UNBLOCK, &mask, NULL) == 0); + return rc; +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid; + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + int *const s = tail_alloc(sizeof(*s)); + if (wait4(pid, s, WNOHANG|__WALL, NULL)) + perror_msg_and_fail("wait4 #1"); + tprintf("wait4(%d, %p, WNOHANG|__WALL, NULL) = 0\n", pid, s); + + struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + if (wait4(pid, s, WNOHANG|__WALL, rusage)) + perror_msg_and_fail("wait4 #2"); + tprintf("wait4(%d, %p, WNOHANG|__WALL, %p) = 0\n", pid, s, rusage); + + assert(write(1, "", 1) == 1); + (void) close(1); + + assert(do_wait4(pid, s, 0, rusage) == pid); + assert(WIFEXITED(*s) && WEXITSTATUS(*s) == 42); + tprintf("wait4(%d, [{WIFEXITED(s) && WEXITSTATUS(s) == 42}], 0, %s)" + " = %d\n", pid, sprint_rusage(rusage), pid); + + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) raise(SIGUSR1); + return 1; + } + + assert(do_wait4(pid, s, __WALL, rusage) == pid); + assert(WIFSIGNALED(*s) && WTERMSIG(*s) == SIGUSR1); + tprintf("wait4(%d, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGUSR1}]" + ", __WALL, %s) = %d\n", pid, sprint_rusage(rusage), pid); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + assert(do_wait4(pid, s, WSTOPPED, rusage) == pid); + assert(WIFSTOPPED(*s) && WSTOPSIG(*s) == SIGSTOP); + tprintf("wait4(%d, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSTOP}]" + ", WSTOPPED, %s) = %d\n", pid, sprint_rusage(rusage), pid); + + if (kill(pid, SIGCONT)) + perror_msg_and_fail("kill(SIGCONT)"); + +#if defined WCONTINUED && defined WIFCONTINUED + assert(do_wait4(pid, s, WCONTINUED, rusage) == pid); + assert(WIFCONTINUED(*s)); + tprintf("wait4(%d, [{WIFCONTINUED(s)}], WCONTINUED" + ", %s) = %d\n", pid, sprint_rusage(rusage), pid); +#endif /* WCONTINUED && WIFCONTINUED */ + + assert(write(1, "", 1) == 1); + (void) close(1); + + assert(do_wait4(pid, s, 0, rusage) == pid); + assert(WIFEXITED(*s) && WEXITSTATUS(*s) == 0); + tprintf("wait4(%d, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0" + ", %s) = %d\n", pid, sprint_rusage(rusage), pid); + + assert(wait4(-1, s, WNOHANG|WSTOPPED|__WALL, rusage) == -1); + tprintf("wait4(-1, %p, WNOHANG|WSTOPPED|__WALL, %p) = -1 %s (%m)\n", + s, rusage, errno2name()); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/wait4.test b/tests-m32/wait4.test new file mode 100755 index 00000000..6338d1f6 --- /dev/null +++ b/tests-m32/wait4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of wait4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/waitid-v.c b/tests-m32/waitid-v.c new file mode 100644 index 00000000..15a8010c --- /dev/null +++ b/tests-m32/waitid-v.c @@ -0,0 +1,3 @@ +/* This file is part of waitid-v strace test. */ +#define VERBOSE 1 +#include "waitid.c" diff --git a/tests-m32/waitid-v.test b/tests-m32/waitid-v.test new file mode 100755 index 00000000..eb498cb0 --- /dev/null +++ b/tests-m32/waitid-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of waitid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests-m32/waitid.c b/tests-m32/waitid.c new file mode 100644 index 00000000..6a102990 --- /dev/null +++ b/tests-m32/waitid.c @@ -0,0 +1,263 @@ +/* + * Check decoding of waitid syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static const char * +sprint_rusage(const struct rusage *const ru) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{ru_utime={tv_sec=%lld, tv_usec=%lld}" + ", ru_stime={tv_sec=%lld, tv_usec=%lld}" +#if VERBOSE + ", ru_maxrss=%llu" + ", ru_ixrss=%llu" + ", ru_idrss=%llu" + ", ru_isrss=%llu" + ", ru_minflt=%llu" + ", ru_majflt=%llu" + ", ru_nswap=%llu" + ", ru_inblock=%llu" + ", ru_oublock=%llu" + ", ru_msgsnd=%llu" + ", ru_msgrcv=%llu" + ", ru_nsignals=%llu" + ", ru_nvcsw=%llu" + ", ru_nivcsw=%llu}" +#else + ", ...}" +#endif + , (long long) ru->ru_utime.tv_sec + , (long long) ru->ru_utime.tv_usec + , (long long) ru->ru_stime.tv_sec + , (long long) ru->ru_stime.tv_usec +#if VERBOSE + , zero_extend_signed_to_ull(ru->ru_maxrss) + , zero_extend_signed_to_ull(ru->ru_ixrss) + , zero_extend_signed_to_ull(ru->ru_idrss) + , zero_extend_signed_to_ull(ru->ru_isrss) + , zero_extend_signed_to_ull(ru->ru_minflt) + , zero_extend_signed_to_ull(ru->ru_majflt) + , zero_extend_signed_to_ull(ru->ru_nswap) + , zero_extend_signed_to_ull(ru->ru_inblock) + , zero_extend_signed_to_ull(ru->ru_oublock) + , zero_extend_signed_to_ull(ru->ru_msgsnd) + , zero_extend_signed_to_ull(ru->ru_msgrcv) + , zero_extend_signed_to_ull(ru->ru_nsignals) + , zero_extend_signed_to_ull(ru->ru_nvcsw) + , zero_extend_signed_to_ull(ru->ru_nivcsw) +#endif + ); + return buf; +} + +#define CASE(x) case x: return #x + +static const char * +si_code_2_name(const int code) +{ + switch (code) { +#ifdef CLD_EXITED + CASE(CLD_EXITED); +#endif +#ifdef CLD_KILLED + CASE(CLD_KILLED); +#endif +#ifdef CLD_DUMPED + CASE(CLD_DUMPED); +#endif +#ifdef CLD_TRAPPED + CASE(CLD_TRAPPED); +#endif +#ifdef CLD_STOPPED + CASE(CLD_STOPPED); +#endif +#ifdef CLD_CONTINUED + CASE(CLD_CONTINUED); +#endif + default: perror_msg_and_fail("unknown si_code %d", code); + } +} + +static const char * +sprint_siginfo(const siginfo_t *const si, const char *const status_text) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{si_signo=SIGCHLD" + ", si_code=%s" + ", si_pid=%u" + ", si_uid=%u" + ", si_status=%s" + ", si_utime=%llu" + ", si_stime=%llu}", + si_code_2_name(si->si_code), + si->si_pid, + si->si_uid, + status_text, + zero_extend_signed_to_ull(si->si_utime), + zero_extend_signed_to_ull(si->si_stime)); + return buf; +} + +static unsigned long +poison(unsigned int v) +{ + return (unsigned long) 0xfacefeed00000000ULL | v; +} + +static long +do_waitid(const unsigned int idtype, + const unsigned int id, + const siginfo_t *const infop, + const unsigned int options, + const struct rusage *const rusage) +{ + sigset_t mask = {}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); + long rc = syscall(__NR_waitid, poison(idtype), poison(id), + infop, poison(options), rusage); + assert(sigprocmask(SIG_UNBLOCK, &mask, NULL) == 0); + return rc; +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid; + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + if (do_waitid(P_PID, pid, 0, WNOHANG|WEXITED, 0)) + perror_msg_and_fail("waitid #1"); + tprintf("waitid(P_PID, %d, NULL, WNOHANG|WEXITED, NULL) = 0\n", pid); + + siginfo_t *const sinfo = tail_alloc(sizeof(*sinfo)); + memset(sinfo, 0, sizeof(*sinfo)); + struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + if (do_waitid(P_PID, pid, sinfo, WNOHANG|WEXITED|WSTOPPED, rusage)) + perror_msg_and_fail("waitid #2"); + tprintf("waitid(P_PID, %d, {}, WNOHANG|WEXITED|WSTOPPED, %s) = 0\n", + pid, sprint_rusage(rusage)); + + assert(write(1, "", 1) == 1); + (void) close(1); + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #3"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "42"), sprint_rusage(rusage)); + + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) raise(SIGUSR1); + return 1; + } + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #4"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGUSR1"), sprint_rusage(rusage)); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + if (do_waitid(P_PID, pid, sinfo, WSTOPPED, rusage)) + perror_msg_and_fail("waitid #5"); + tprintf("waitid(P_PID, %d, %s, WSTOPPED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGSTOP"), sprint_rusage(rusage)); + + if (kill(pid, SIGCONT)) + perror_msg_and_fail("kill(SIGCONT)"); + +#if defined WCONTINUED + if (do_waitid(P_PID, pid, sinfo, WCONTINUED, rusage)) + perror_msg_and_fail("waitid #6"); + tprintf("waitid(P_PID, %d, %s, WCONTINUED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGCONT"), sprint_rusage(rusage)); +#endif /* WCONTINUED */ + + assert(write(1, "", 1) == 1); + (void) close(1); + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #7"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "0"), sprint_rusage(rusage)); + + long rc = do_waitid(P_ALL, -1, sinfo, WEXITED|WSTOPPED, rusage); + tprintf("waitid(P_ALL, -1, %p, WEXITED|WSTOPPED, %p)" + " = %ld %s (%m)\n", sinfo, rusage, rc, errno2name()); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/waitid.test b/tests-m32/waitid.test new file mode 100755 index 00000000..3bcba3ab --- /dev/null +++ b/tests-m32/waitid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of waitid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/waitpid.c b/tests-m32/waitpid.c new file mode 100644 index 00000000..2e22e245 --- /dev/null +++ b/tests-m32/waitpid.c @@ -0,0 +1,56 @@ +/* + * Check decoding of waitpid syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_waitpid + +# include +# include +# include + +int +main(void) +{ + unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + long rc = syscall(__NR_waitpid, pid, 0L, (unsigned long) WNOHANG); + printf("waitpid(%d, NULL, WNOHANG) = %ld %s (%m)\n", + (int) pid, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_waitpid") + +#endif diff --git a/tests-m32/waitpid.test b/tests-m32/waitpid.test new file mode 100755 index 00000000..93807d1f --- /dev/null +++ b/tests-m32/waitpid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of waitpid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/xattr-strings.c b/tests-m32/xattr-strings.c new file mode 100644 index 00000000..310929a9 --- /dev/null +++ b/tests-m32/xattr-strings.c @@ -0,0 +1,30 @@ +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include + +int +main(void) +{ + static const char name[] = "strace.test"; + static const char c_value[] = "foobar"; + + const char *const z_value = tail_memdup(c_value, sizeof(c_value)); + long rc; + + rc = fsetxattr(-1, name, z_value, sizeof(c_value), XATTR_REPLACE); + printf("fsetxattr(-1, \"%.*s\"..., \"%.*s\"..., %u, XATTR_REPLACE) = %s\n", + 4, name, 4, c_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests-m32/xattr-strings.test b/tests-m32/xattr-strings.test new file mode 100755 index 00000000..25ef360b --- /dev/null +++ b/tests-m32/xattr-strings.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check *xattr syscalls decoding when limiting string size. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests-m32/xattr.c b/tests-m32/xattr.c new file mode 100644 index 00000000..a772eced --- /dev/null +++ b/tests-m32/xattr.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include + +# ifndef XATTR_SIZE_MAX +# define XATTR_SIZE_MAX 65536 +# endif + +#define DEFAULT_STRLEN 32 + +int +main(void) +{ + static const char name[] = "strace.test"; + static const char c_value[] = "foo\0bar"; + static const char q_value[] = "foo\\0bar"; + + const char *const z_value = tail_memdup(c_value, sizeof(c_value)); + char *const efault = tail_alloc(1) + 1; + const char *const value = tail_memdup(c_value, sizeof(c_value) - 1); + char *const big = tail_alloc(XATTR_SIZE_MAX + 1); + long rc; + const char *errstr; + + rc = fsetxattr(-1, 0, 0, 0, XATTR_CREATE); + printf("fsetxattr(-1, NULL, NULL, 0, XATTR_CREATE) = %s\n", + sprintrc(rc)); + + rc = fsetxattr(-1, 0, z_value, 0, XATTR_CREATE); + printf("fsetxattr(-1, NULL, \"\", 0, XATTR_CREATE) = %s\n", + sprintrc(rc)); + + rc = fsetxattr(-1, name, big, XATTR_SIZE_MAX + 1, XATTR_CREATE); + printf("fsetxattr(-1, \"%s\", %p, %u, XATTR_CREATE) = %s\n", + name, big, XATTR_SIZE_MAX + 1, sprintrc(rc)); + + rc = fsetxattr(-1, name, value, sizeof(c_value), XATTR_CREATE); + printf("fsetxattr(-1, \"%s\", %p, %u, XATTR_CREATE) = %s\n", + name, value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = fsetxattr(-1, name, z_value, sizeof(c_value), XATTR_REPLACE); + printf("fsetxattr(-1, \"%s\", \"%s\", %u, XATTR_REPLACE) = %s\n", + name, q_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = fsetxattr(-1, name, value, sizeof(c_value) - 1, XATTR_CREATE|XATTR_REPLACE); + printf("fsetxattr(-1, \"%s\", \"%s\", %u, XATTR_CREATE|XATTR_REPLACE)" + " = %s\n", + name, q_value, (unsigned) sizeof(c_value) - 1, sprintrc(rc)); + + rc = setxattr(".", name, z_value, sizeof(c_value), XATTR_CREATE); + printf("setxattr(\".\", \"%s\", \"%s\", %u, XATTR_CREATE) = %s\n", + name, q_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = lsetxattr(".", name, value, sizeof(c_value) - 1, XATTR_CREATE); + printf("lsetxattr(\".\", \"%s\", \"%s\", %u, XATTR_CREATE) = %s\n", + name, q_value, (unsigned) sizeof(c_value) - 1, sprintrc(rc)); + + rc = fgetxattr(-1, name, efault, 4); + printf("fgetxattr(-1, \"%s\", %p, 4) = %s\n", + name, efault, sprintrc(rc)); + + rc = getxattr(".", name, big, XATTR_SIZE_MAX + 1); + printf("getxattr(\".\", \"%s\", %p, %u) = %s\n", + name, big, XATTR_SIZE_MAX + 1, sprintrc(rc)); + + rc = lgetxattr(".", name, big + 1, XATTR_SIZE_MAX); + printf("lgetxattr(\".\", \"%s\", %p, %u) = %s\n", + name, big + 1, XATTR_SIZE_MAX, sprintrc(rc)); + + rc = flistxattr(-1, efault, 4); + printf("flistxattr(-1, %p, 4) = %s\n", efault, sprintrc(rc)); + + rc = llistxattr("", efault + 1, 4); + printf("llistxattr(\"\", %p, 4) = %s\n", efault + 1, sprintrc(rc)); + + rc = listxattr(".", big, 0); + printf("listxattr(\".\", %p, 0) = %s\n", big, sprintrc(rc)); + + rc = listxattr(".", big, XATTR_SIZE_MAX + 1); + errstr = sprintrc(rc); + printf("listxattr(\".\", "); + if (rc < 0) + printf("%p", big); + else { + const int ellipsis = rc > DEFAULT_STRLEN; + + putchar('"'); + print_quoted_memory(big, ellipsis ? DEFAULT_STRLEN : rc); + putchar('"'); + if (ellipsis) + fputs("...", stdout); + } + printf(", %u) = %s\n", XATTR_SIZE_MAX + 1, errstr); + + rc = fremovexattr(-1, name); + printf("fremovexattr(-1, \"%s\") = %s\n", name, sprintrc(rc)); + + rc = removexattr(".", name); + printf("removexattr(\".\", \"%s\") = %s\n", name, sprintrc(rc)); + + rc = lremovexattr(".", name); + printf("lremovexattr(\".\", \"%s\") = %s\n", name, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests-m32/xattr.test b/tests-m32/xattr.test new file mode 100755 index 00000000..8c7a87b9 --- /dev/null +++ b/tests-m32/xattr.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check *xattr syscalls decoding. + +. "${srcdir=.}/init.sh" + +syscalls= +for n in getxattr setxattr listxattr removexattr; do + syscalls="$syscalls,${n},f${n},l${n}" +done + +run_strace_match_diff -a22 -e trace=$syscalls diff --git a/tests-m32/xchownx.c b/tests-m32/xchownx.c new file mode 100644 index 00000000..fe582835 --- /dev/null +++ b/tests-m32/xchownx.c @@ -0,0 +1,152 @@ +/* + * Check decoding of chown/chown32/lchown/lchown32/fchown/fchown32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#ifdef UGID_TYPE_IS_SHORT +# define UGID_TYPE short +# define GETEUID syscall(__NR_geteuid) +# define GETEGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUID(arg) check_overflowuid(arg) +# define CHECK_OVERFLOWGID(arg) check_overflowgid(arg) +#else +# define UGID_TYPE int +# define GETEUID geteuid() +# define GETEGID getegid() +# define CHECK_OVERFLOWUID(arg) +# define CHECK_OVERFLOWGID(arg) +#endif + +#define UNLINK_SAMPLE \ + if (unlink(sample)) perror_msg_and_fail("unlink") +#define CLOSE_SAMPLE \ + if (close(fd)) perror_msg_and_fail("close") + +#ifdef ACCESS_BY_DESCRIPTOR +# define SYSCALL_ARG1 fd +# define FMT_ARG1 "%d" +# define EOK_CMD CLOSE_SAMPLE +# define CLEANUP_CMD UNLINK_SAMPLE +#else +# define SYSCALL_ARG1 sample +# define FMT_ARG1 "\"%s\"" +# define EOK_CMD UNLINK_SAMPLE +# define CLEANUP_CMD CLOSE_SAMPLE +#endif + +static int +ugid2int(const unsigned UGID_TYPE id) +{ + if ((unsigned UGID_TYPE) -1U == id) + return -1; + else + return id; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf(", -1"); + else + printf(", %u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int id) +{ + return num == id || num == -1U; +} + +#define PAIR(val) { val, gid }, { uid, val } + +int +main(void) +{ + static const char sample[] = SYSCALL_NAME "_sample"; + + unsigned int uid = GETEUID; + CHECK_OVERFLOWUID(uid); + unsigned int gid = GETEGID; + CHECK_OVERFLOWUID(gid); + + const struct { + const long uid, gid; + } tests[] = { + { uid, gid }, + { (unsigned long) 0xffffffff00000000ULL | uid, gid }, + { uid, (unsigned long) 0xffffffff00000000ULL | gid }, + PAIR(-1U), + PAIR(-1L), + { 0xffff0000U | uid, gid }, + { uid, 0xffff0000U | gid }, + PAIR(0xffff), + PAIR(0xc0deffffU), + PAIR(0xfacefeedU), + PAIR((long) 0xfacefeeddeadbeefULL) + }; + + int fd = open(sample, O_RDONLY | O_CREAT, 0400); + if (fd < 0) + perror_msg_and_fail("open"); + + CLEANUP_CMD; + + unsigned int i; + long expected = 0; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int unum = ugid2int(tests[i].uid); + const unsigned int gnum = ugid2int(tests[i].gid); + + if (num_matches_id(unum, uid) && + num_matches_id(gnum, gid)) { + if (expected) + continue; + } else { + if (!expected) { + expected = -1; + EOK_CMD; + } + } + + const long rc = syscall(SYSCALL_NR, SYSCALL_ARG1, + tests[i].uid, tests[i].gid); + const char *errstr = sprintrc(rc); + printf("%s(" FMT_ARG1, SYSCALL_NAME, SYSCALL_ARG1); + print_int(unum); + print_int(gnum); + printf(") = %s\n", errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/xet_robust_list.c b/tests-m32/xet_robust_list.c new file mode 100644 index 00000000..211dec45 --- /dev/null +++ b/tests-m32/xet_robust_list.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_get_robust_list && defined __NR_set_robust_list + +# include +# include + +static const char * +sprintaddr(void *addr) +{ + static char buf[sizeof(addr) * 2 + sizeof("0x")]; + + if (!addr) + return "NULL"; + else + snprintf(buf, sizeof(buf), "%p", addr); + + return buf; +} + +int +main(void) +{ + const pid_t pid = getpid(); + const long long_pid = (unsigned long) (0xdeadbeef00000000LL | pid); + void **p_head = tail_alloc(sizeof(void *)); + size_t *p_len = tail_alloc(sizeof(size_t)); + + if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) + perror_msg_and_skip("get_robust_list"); + printf("get_robust_list(%d, [%s], [%lu]) = 0\n", + (int) pid, sprintaddr(*p_head), (unsigned long) *p_len); + + void *head = tail_alloc(*p_len); + if (syscall(__NR_set_robust_list, head, *p_len)) + perror_msg_and_skip("set_robust_list"); + printf("set_robust_list(%p, %lu) = 0\n", + head, (unsigned long) *p_len); + + if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) + perror_msg_and_skip("get_robust_list"); + printf("get_robust_list(%d, [%s], [%lu]) = 0\n", + (int) pid, sprintaddr(*p_head), (unsigned long) *p_len); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_robust_list && __NR_set_robust_list") + +#endif diff --git a/tests-m32/xet_robust_list.test b/tests-m32/xet_robust_list.test new file mode 100755 index 00000000..8a3a3820 --- /dev/null +++ b/tests-m32/xet_robust_list.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check get_robust_list and set_robust_list syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests-m32/xetitimer.c b/tests-m32/xetitimer.c new file mode 100644 index 00000000..4b17edd3 --- /dev/null +++ b/tests-m32/xetitimer.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + struct { + struct itimerval itv; + uint32_t pad[4]; + } old = { + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .itv = { + .it_interval = { 0xc0de1, 0xc0de2 }, + .it_value = { 0xc0de3, 0xc0de4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (setitimer(ITIMER_REAL, &new.itv, &old.itv)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", + (intmax_t) new.itv.it_interval.tv_sec, + (intmax_t) new.itv.it_interval.tv_usec, + (intmax_t) new.itv.it_value.tv_sec, + (intmax_t) new.itv.it_value.tv_usec, + (intmax_t) old.itv.it_interval.tv_sec, + (intmax_t) old.itv.it_interval.tv_usec, + (intmax_t) old.itv.it_value.tv_sec, + (intmax_t) old.itv.it_value.tv_usec); + + if (getitimer(ITIMER_REAL, &old.itv)) + perror_msg_and_skip("getitimer"); + printf("getitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", + (intmax_t) old.itv.it_interval.tv_sec, + (intmax_t) old.itv.it_interval.tv_usec, + (intmax_t) old.itv.it_value.tv_sec, + (intmax_t) old.itv.it_value.tv_usec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/xetitimer.test b/tests-m32/xetitimer.test new file mode 100755 index 00000000..4aa00cce --- /dev/null +++ b/tests-m32/xetitimer.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setitimer and getitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setitimer,getitimer diff --git a/tests-m32/xetpgid.c b/tests-m32/xetpgid.c new file mode 100644 index 00000000..24e0d7f0 --- /dev/null +++ b/tests-m32/xetpgid.c @@ -0,0 +1,59 @@ +/* + * This file is part of xetpgid strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_getpgid && defined __NR_setpgid + +# include +# include + +int +main(void) +{ + const int pid = getpid(); + long rc = syscall(__NR_getpgid, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("getpgid(%d) = %ld\n", pid, rc); + + rc = syscall(__NR_setpgid, + (unsigned long) 0xffffffff00000000ULL, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("setpgid(0, %d) = %ld\n", pid, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpgid && __NR_setpgid") + +#endif diff --git a/tests-m32/xetpgid.test b/tests-m32/xetpgid.test new file mode 100755 index 00000000..07f4f9e8 --- /dev/null +++ b/tests-m32/xetpgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpgid and setpgid syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests-m32/xetpriority.c b/tests-m32/xetpriority.c new file mode 100644 index 00000000..ed552598 --- /dev/null +++ b/tests-m32/xetpriority.c @@ -0,0 +1,31 @@ +#include "tests.h" +#include + +#if defined __NR_getpriority && defined __NR_setpriority + +# include +# include +# include + +int +main(void) +{ + const int pid = getpid(); + long rc = syscall(__NR_getpriority, PRIO_PROCESS, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc); + + rc = syscall(__NR_setpriority, PRIO_PROCESS, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL); + printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpriority && _NR_setpriority") + +#endif diff --git a/tests-m32/xetpriority.test b/tests-m32/xetpriority.test new file mode 100755 index 00000000..2c84ba41 --- /dev/null +++ b/tests-m32/xetpriority.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpriority and setpriority syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests-m32/xettimeofday.c b/tests-m32/xettimeofday.c new file mode 100644 index 00000000..d36c57b4 --- /dev/null +++ b/tests-m32/xettimeofday.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + struct { + struct timeval tv; + uint32_t pad0[2]; + struct timezone tz; + uint32_t pad1[2]; + } t = { + .pad0 = { 0xdeadbeef, 0xbadc0ded }, + .pad1 = { 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_gettimeofday, &t.tv, NULL)) + perror_msg_and_skip("gettimeofday"); + printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}, NULL) = 0\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec); + + if (syscall(__NR_gettimeofday, &t.tv, &t.tz)) + perror_msg_and_skip("gettimeofday"); + printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = 0\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, + t.tz.tz_minuteswest, t.tz.tz_dsttime); + + t.tv.tv_sec = -1; + t.tv.tv_usec = 1000000000; + assert(syscall(__NR_settimeofday, &t.tv, &t.tz) == -1); + printf("settimeofday({tv_sec=%jd, tv_usec=%jd}" + ", {tz_minuteswest=%d, tz_dsttime=%d})" + " = -1 EINVAL (%m)\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, + t.tz.tz_minuteswest, t.tz.tz_dsttime); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/xettimeofday.test b/tests-m32/xettimeofday.test new file mode 100755 index 00000000..68764e46 --- /dev/null +++ b/tests-m32/xettimeofday.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check gettimeofday and settimeofday syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-m32/xgetrlimit.c b/tests-m32/xgetrlimit.c new file mode 100644 index 00000000..78d9cb99 --- /dev/null +++ b/tests-m32/xgetrlimit.c @@ -0,0 +1,91 @@ +/* + * Check decoding of getrlimit/ugetrlimit syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resources.h" + +const char * +sprint_rlim(kernel_ulong_t lim) +{ + if (sizeof(lim) == sizeof(uint64_t)) { + if (lim == (kernel_ulong_t) -1ULL) + return "RLIM64_INFINITY"; + } else { + if (lim == (kernel_ulong_t) -1U) + return "RLIM_INFINITY"; + } + + static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; + static int i; + i &= 1; + if (lim > 1024 && lim % 1024 == 0) + sprintf(buf[i], "%llu*1024", (unsigned long long) lim / 1024); + else + sprintf(buf[i], "%llu", (unsigned long long) lim); + + return buf[i++]; +} + +#ifdef NR_GETRLIMIT + +int +main(void) +{ + kernel_ulong_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(NR_GETRLIMIT, res, 0); + if (rc && ENOSYS == errno) + perror_msg_and_skip(STR_GETRLIMIT); + printf("%s(%s, NULL) = %ld %s (%m)\n", + STR_GETRLIMIT, xlat->str, rc, errno2name()); + + rc = syscall(NR_GETRLIMIT, res, rlimit); + if (rc) + printf("%s(%s, NULL) = %ld %s (%m)\n", + STR_GETRLIMIT, xlat->str, rc, errno2name()); + else + printf("%s(%s, {rlim_cur=%s, rlim_max=%s})" + " = 0\n", STR_GETRLIMIT, xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1])); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#endif /* NR_GETRLIMIT */ diff --git a/tests-m32/xselect.c b/tests-m32/xselect.c new file mode 100644 index 00000000..39e87ac7 --- /dev/null +++ b/tests-m32/xselect.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Based on test by Dr. David Alan Gilbert + */ + +#include +#include +#include +#include + +static fd_set set[0x1000000 / sizeof(fd_set)]; + +int main(void) +{ + int fds[2]; + struct { + struct timeval tv; + int pad[2]; + } tm_in = { + .tv = { .tv_sec = 0xc0de1, .tv_usec = 0xc0de2 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, tm = tm_in; + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + /* + * Start with a nice simple select. + */ + FD_ZERO(set); + FD_SET(fds[0], set); + FD_SET(fds[1], set); + int rc = syscall(TEST_SYSCALL_NR, fds[1] + 1, set, set, set, NULL); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + assert(rc == 1); + printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", + TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1]); + + /* + * Another simple one, with a timeout. + */ + FD_SET(1, set); + FD_SET(2, set); + FD_SET(fds[0], set); + FD_SET(fds[1], set); + assert(syscall(TEST_SYSCALL_NR, fds[1] + 1, NULL, set, NULL, &tm.tv) == 3); + printf("%s(%d, NULL, [1 2 %d %d], NULL, {tv_sec=%lld, tv_usec=%lld})" + " = 3 (out [1 2 %d], left {tv_sec=%lld, tv_usec=%lld})\n", + TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], + (long long) tm_in.tv.tv_sec, (long long) tm_in.tv.tv_usec, + fds[1], + (long long) tm.tv.tv_sec, (long long) tm.tv.tv_usec); + + /* + * Now the crash case that trinity found, negative nfds + * but with a pointer to a large chunk of valid memory. + */ + FD_ZERO(set); + FD_SET(fds[1],set); + assert(syscall(TEST_SYSCALL_NR, -1, NULL, set, NULL, NULL) == -1); + printf("%s(-1, NULL, %p, NULL, NULL) = -1 EINVAL (%m)\n", + TEST_SYSCALL_STR, set); + + /* + * Another variant, with nfds exceeding FD_SETSIZE limit. + */ + FD_ZERO(set); + FD_SET(fds[0],set); + tm.tv.tv_sec = 0; + tm.tv.tv_usec = 123; + assert(syscall(TEST_SYSCALL_NR, FD_SETSIZE + 1, set, set + 1, NULL, &tm.tv) == 0); + printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=123}) = 0 (Timeout)\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/xstatfs.c b/tests-m32/xstatfs.c new file mode 100644 index 00000000..26c43dee --- /dev/null +++ b/tests-m32/xstatfs.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define SYSCALL_INVOKE(file, desc, ptr, size) \ + syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), ptr) +#define PRINT_SYSCALL_HEADER(file, desc, size) \ + printf("%s(" SYSCALL_ARG_FMT ", ", SYSCALL_NAME, SYSCALL_ARG(file, desc)) + +#define STRUCT_STATFS struct statfs +#ifdef HAVE_STRUCT_STATFS_F_FRSIZE +# define PRINT_F_FRSIZE +#endif +#ifdef HAVE_STRUCT_STATFS_F_FLAGS +# define PRINT_F_FLAGS +#endif +#if defined HAVE_STRUCT_STATFS_F_FSID_VAL +# define PRINT_F_FSID f_fsid.val +#elif defined HAVE_STRUCT_STATFS_F_FSID___VAL +# define PRINT_F_FSID f_fsid.__val +#endif + +#include "xstatfsx.c" diff --git a/tests-m32/xstatfs64.c b/tests-m32/xstatfs64.c new file mode 100644 index 00000000..8f50de29 --- /dev/null +++ b/tests-m32/xstatfs64.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define SYSCALL_INVOKE(file, desc, ptr, size) \ + syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), size, ptr) +#define PRINT_SYSCALL_HEADER(file, desc, size) \ + printf("%s(" SYSCALL_ARG_FMT ", %u, ", SYSCALL_NAME, \ + SYSCALL_ARG(file, desc), (unsigned) size) + +#define STRUCT_STATFS struct statfs64 +#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE +# define PRINT_F_FRSIZE +#endif +#ifdef HAVE_STRUCT_STATFS64_F_FLAGS +# define PRINT_F_FLAGS +#endif +#if defined HAVE_STRUCT_STATFS64_F_FSID_VAL +# define PRINT_F_FSID f_fsid.val +#elif defined HAVE_STRUCT_STATFS64_F_FSID___VAL +# define PRINT_F_FSID f_fsid.__val +#endif +#define CHECK_ODD_SIZE + +#include "xstatfsx.c" diff --git a/tests-m32/xstatfsx.c b/tests-m32/xstatfsx.c new file mode 100644 index 00000000..d8288f1f --- /dev/null +++ b/tests-m32/xstatfsx.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include + +#include "xlat.h" +#include "xlat/fsmagic.h" +#include "xlat/statfs_flags.h" + +#define PRINT_NUM(arg) \ + if (sizeof(b->arg) == sizeof(int)) \ + printf(", %s=%u", #arg, (unsigned int) b->arg); \ + else if (sizeof(b->arg) == sizeof(long)) \ + printf(", %s=%lu", #arg, (unsigned long) b->arg); \ + else \ + printf(", %s=%llu", #arg, (unsigned long long) b->arg) + +static void +print_statfs_type(const char *const prefix, const unsigned int magic) +{ + fputs(prefix, stdout); + unsigned int i; + for (i = 0; i < ARRAY_SIZE(fsmagic); ++i) + if (magic == fsmagic[i].val) { + fputs(fsmagic[i].str, stdout); + return; + } + printf("%#x", magic); +} + +static void +print_statfs(const char *const sample, const char *magic_str) +{ + int fd = open(sample, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", sample); + + STRUCT_STATFS *const b = tail_alloc(sizeof(*b)); + long rc = SYSCALL_INVOKE(sample, fd, b, sizeof(*b)); + if (rc) + perror_msg_and_skip(SYSCALL_NAME); + + PRINT_SYSCALL_HEADER(sample, fd, sizeof(*b)); + if (magic_str) + printf("{f_type=%s", magic_str); + else + print_statfs_type("{f_type=", b->f_type); + PRINT_NUM(f_bsize); + PRINT_NUM(f_blocks); + PRINT_NUM(f_bfree); + PRINT_NUM(f_bavail); + PRINT_NUM(f_files); + PRINT_NUM(f_ffree); +#ifdef PRINT_F_FSID + printf(", f_fsid={val=[%u, %u]}", + (unsigned) b->PRINT_F_FSID[0], (unsigned) b->PRINT_F_FSID[1]); +#endif + PRINT_NUM(f_namelen); +#ifdef PRINT_F_FRSIZE + PRINT_NUM(f_frsize); +#endif +#ifdef PRINT_F_FLAGS + if (b->f_flags & ST_VALID) { + printf(", f_flags="); + printflags(statfs_flags, b->f_flags, "ST_???"); + } +#endif + printf("}) = 0\n"); +} + +int +main(void) +{ + print_statfs("/proc/self/status", "PROC_SUPER_MAGIC"); + + print_statfs(".", NULL); + + long rc = SYSCALL_INVOKE("", -1, 0, sizeof(STRUCT_STATFS)); + const char *errstr = sprintrc(rc); + PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS)); + printf("NULL) = %s\n", errstr); + +#ifdef CHECK_ODD_SIZE + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + rc = SYSCALL_INVOKE("", -1, addr, sizeof(STRUCT_STATFS) + 1); + errstr = sprintrc(rc); + PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS) + 1); + printf("%#lx) = %s\n", addr, errstr); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/xstatx.c b/tests-m32/xstatx.c new file mode 100644 index 00000000..0d5fca87 --- /dev/null +++ b/tests-m32/xstatx.c @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if defined HAVE_FTRUNCATE && defined HAVE_FUTIMENS + +# ifndef TEST_SYSCALL_STR +# error TEST_SYSCALL_STR must be defined +# endif +# ifndef TEST_SYSCALL_INVOKE +# error TEST_SYSCALL_INVOKE must be defined +# endif +# ifndef PRINT_SYSCALL_HEADER +# error PRINT_SYSCALL_HEADER must be defined +# endif +# ifndef PRINT_SYSCALL_FOOTER +# error PRINT_SYSCALL_FOOTER must be defined +# endif + +# include +# include +# include +# include +# include +# include + +static void +print_time(const time_t t) +{ + if (!t) { + printf("0"); + return; + } + + struct tm *p = localtime(&t); + + if (p) { + char buf[256]; + + strftime(buf, sizeof(buf), "%FT%T%z", p); + + printf("%s", buf); + } else { + printf("%llu", zero_extend_signed_to_ull(t)); + } +} + +# ifndef STRUCT_STAT +# define STRUCT_STAT struct stat +# define STRUCT_STAT_STR "struct stat" +# define STRUCT_STAT_IS_STAT64 0 +# endif +# ifndef SAMPLE_SIZE +# define SAMPLE_SIZE ((libc_off_t) 43147718418ULL) +# endif + +typedef off_t libc_off_t; + +# define stat libc_stat +# define stat64 libc_stat64 +# include +# include +# undef stat +# undef stat64 + +# undef st_atime +# undef st_mtime +# undef st_ctime +# include "asm_stat.h" + +# if STRUCT_STAT_IS_STAT64 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# if defined MPERS_IS_m32 +# ifdef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined MPERS_IS_mx32 +# ifdef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined HAVE_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif /* MPERS_IS_m32 || MPERS_IS_mx32 || HAVE_STRUCT_STAT64_ST_MTIME_NSEC */ +# else /* !STRUCT_STAT_IS_STAT64 */ +# if defined MPERS_IS_m32 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined MPERS_IS_mx32 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# endif /* MPERS_IS_m32 || MPERS_IS_mx32 */ +# endif /* STRUCT_STAT_IS_STAT64 */ + +# ifndef TEST_BOGUS_STRUCT_STAT +# define TEST_BOGUS_STRUCT_STAT 1 +# endif + +# ifndef IS_FSTAT +# define IS_FSTAT 0 +# endif + +# ifndef OLD_STAT +# define OLD_STAT 0 +# endif + +static void +print_ftype(const unsigned int mode) +{ + if (S_ISREG(mode)) + printf("S_IFREG"); + else if (S_ISDIR(mode)) + printf("S_IFDIR"); + else if (S_ISCHR(mode)) + printf("S_IFCHR"); + else if (S_ISBLK(mode)) + printf("S_IFBLK"); + else + printf("%#o", mode & S_IFMT); +} + +static void +print_perms(const unsigned int mode) +{ + printf("%#o", mode & ~S_IFMT); +} + +static void +print_stat(const STRUCT_STAT *st) +{ + printf("{st_dev=makedev(%u, %u)", + (unsigned int) major(zero_extend_signed_to_ull(st->st_dev)), + (unsigned int) minor(zero_extend_signed_to_ull(st->st_dev))); + printf(", st_ino=%llu", zero_extend_signed_to_ull(st->st_ino)); + printf(", st_mode="); + print_ftype(st->st_mode); + printf("|"); + print_perms(st->st_mode); + printf(", st_nlink=%llu", zero_extend_signed_to_ull(st->st_nlink)); + printf(", st_uid=%llu", zero_extend_signed_to_ull(st->st_uid)); + printf(", st_gid=%llu", zero_extend_signed_to_ull(st->st_gid)); +# if OLD_STAT + printf(", st_blksize=0, st_blocks=0"); +# else /* !OLD_STAT */ + printf(", st_blksize=%llu", zero_extend_signed_to_ull(st->st_blksize)); + printf(", st_blocks=%llu", zero_extend_signed_to_ull(st->st_blocks)); +# endif /* OLD_STAT */ + + switch (st->st_mode & S_IFMT) { + case S_IFCHR: case S_IFBLK: + printf(", st_rdev=makedev(%u, %u)", + (unsigned int) major(zero_extend_signed_to_ull(st->st_rdev)), + (unsigned int) minor(zero_extend_signed_to_ull(st->st_rdev))); + break; + default: + printf(", st_size=%llu", zero_extend_signed_to_ull(st->st_size)); + } + + printf(", st_atime="); + print_time(sign_extend_unsigned_to_ll(st->st_atime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_atime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_atime_nsec)); +# endif + printf(", st_mtime="); + print_time(sign_extend_unsigned_to_ll(st->st_mtime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_mtime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_mtime_nsec)); +# endif + printf(", st_ctime="); + print_time(sign_extend_unsigned_to_ll(st->st_ctime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_ctime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_ctime_nsec)); +# endif + printf("}"); +} + +static int +create_sample(const char *fname, const libc_off_t size) +{ + static const struct timespec ts[] = { + {-10843, 135}, {-10841, 246} + }; + + (void) close(0); + if (open(fname, O_RDWR | O_CREAT | O_TRUNC, 0640)) { + perror(fname); + return 77; + } + if (ftruncate(0, size)) { + perror("ftruncate"); + return 77; + } + if (futimens(0, ts)) { + perror("futimens"); + return 77; + } + return 0; +} + +int +main(void) +{ +# if !IS_FSTAT + static const char full[] = "/dev/full"; +# endif + static const char sample[] = TEST_SYSCALL_STR ".sample"; + STRUCT_STAT st[2]; + + int rc; + + rc = create_sample(sample, SAMPLE_SIZE); + if (rc) { + (void) unlink(sample); + return rc; + } + +# if TEST_BOGUS_STRUCT_STAT + STRUCT_STAT *st_cut = tail_alloc(sizeof(long) * 4); + rc = TEST_SYSCALL_INVOKE(sample, st_cut); + PRINT_SYSCALL_HEADER(sample); + printf("%p", st_cut); + PRINT_SYSCALL_FOOTER(rc); +# endif + +# if !IS_FSTAT + rc = TEST_SYSCALL_INVOKE(full, st); + PRINT_SYSCALL_HEADER(full); + if (rc) + printf("%p", st); + else + print_stat(st); + PRINT_SYSCALL_FOOTER(rc); +# endif + + if ((rc = TEST_SYSCALL_INVOKE(sample, st))) { +# if OLD_STAT + if (errno != EOVERFLOW) +# endif + { + perror(TEST_SYSCALL_STR); + (void) unlink(sample); + return 77; + } + } + (void) unlink(sample); + if (!rc && zero_extend_signed_to_ull(SAMPLE_SIZE) != + zero_extend_signed_to_ull(st[0].st_size)) { + fprintf(stderr, "Size mismatch: " + "requested size(%llu) != st_size(%llu)\n", + zero_extend_signed_to_ull(SAMPLE_SIZE), + zero_extend_signed_to_ull(st[0].st_size)); + fprintf(stderr, "The most likely reason for this is incorrect" + " definition of %s.\n" + "Here is some diagnostics that might help:\n", + STRUCT_STAT_STR); + +#define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ + fprintf(stderr, "offsetof(%s, %s) = %zu" \ + ", sizeof(%s) = %zu\n", \ + STRUCT_STAT_STR, #member, \ + offsetof(STRUCT_STAT, member), \ + #member, sizeof((object).member)) + + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_dev); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_ino); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_mode); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_nlink); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_uid); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_gid); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_rdev); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_size); +# if !OLD_STAT + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blksize); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blocks); +# endif /* !OLD_STAT */ + + return 1; + } + + PRINT_SYSCALL_HEADER(sample); + if (rc) + printf("%p", st); + else + print_stat(st); + PRINT_SYSCALL_FOOTER(rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_FTRUNCATE && HAVE_FUTIMENS") + +#endif diff --git a/tests-mx32/Makefile.am b/tests-mx32/Makefile.am new file mode 100644 index 00000000..58efd3e2 --- /dev/null +++ b/tests-mx32/Makefile.am @@ -0,0 +1,962 @@ +# Automake input for strace tests. +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +OS = linux +ARCH = @arch_mx32@ +MPERS_NAME = mx32 +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -mx32 +AM_CFLAGS = $(WARN_CFLAGS) +AM_CPPFLAGS = $(ARCH_MFLAGS) \ + -I$(builddir) \ + -I$(top_builddir)/$(OS)/$(ARCH) \ + -I$(top_srcdir)/$(OS)/$(ARCH) \ + -I$(top_builddir)/$(OS) \ + -I$(top_srcdir)/$(OS) \ + -I$(top_builddir) \ + -I$(top_srcdir) +AM_LDFLAGS = $(ARCH_MFLAGS) + +libtests_a_SOURCES = \ + errno2name.c \ + error_msg.c \ + fill_memory.c \ + get_page_size.c \ + hexdump_strdup.c \ + hexquote_strndup.c \ + inode_of_sockfd.c \ + libmmsg.c \ + libsocketcall.c \ + overflowuid.c \ + pipe_maxfd.c \ + print_quoted_string.c \ + printflags.c \ + printxval.c \ + signal2name.c \ + sprintrc.c \ + tail_alloc.c \ + tests.h \ + tprintf.c \ + # end of libtests_a_SOURCES +libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +check_LIBRARIES = libtests.a +LDADD = libtests.a + +check_PROGRAMS = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + alarm \ + answer \ + attach-f-p \ + attach-f-p-cmd \ + attach-p-cmd-cmd \ + attach-p-cmd-p \ + bpf \ + brk \ + btrfs \ + caps \ + caps-abbrev \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + count-f \ + creat \ + delete_module \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execve-v \ + execveat \ + execveat-v \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + file_handle \ + file_ioctl \ + filter-unavailable \ + finit_module \ + flock \ + fork-f \ + fstat \ + fstat64 \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_dm-v \ + ioctl_evdev \ + ioctl_evdev-v \ + ioctl_loop \ + ioctl_loop-nv \ + ioctl_loop-v \ + ioctl_mtd \ + ioctl_rtc \ + ioctl_rtc-v \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msgbuf \ + ipc_sem \ + ipc_shm \ + kcmp \ + kexec_file_load \ + kexec_load \ + keyctl \ + kill \ + ksysent \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + mbind \ + membarrier \ + memfd_create \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap64 \ + mmsg \ + mmsg-silent \ + mmsg_name \ + mmsg_name-v \ + mount \ + move_pages \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_control-v \ + msg_name \ + munlockall \ + nanosleep \ + net-accept-connect \ + net-icmp_filter \ + net-sockaddr \ + net-y-unix \ + net-yy-inet \ + net-yy-netlink \ + net-yy-unix \ + netlink_inet_diag \ + netlink_netlink_diag \ + netlink_protocol \ + netlink_unix_diag \ + newfstatat \ + nsyscalls \ + old_mmap \ + oldfstat \ + oldlstat \ + oldselect \ + oldstat \ + open \ + openat \ + pause \ + pc \ + perf_event_open \ + perf_event_open_nonverbose \ + perf_event_open_unabbrev \ + personality \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + ppoll \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-seccomp-filter-v \ + prctl-seccomp-strict \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + print_maxfd \ + printstr \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + pwritev \ + qual_fault \ + qual_inject-error-signal \ + qual_inject-retval \ + qual_inject-signal \ + qual_signal \ + quotactl \ + quotactl-v \ + quotactl-xfs \ + quotactl-xfs-v \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + redirect-fds \ + remap_file_pages \ + rename \ + renameat \ + renameat2 \ + request_key \ + restart_syscall \ + rmdir \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + scm_rights \ + seccomp-filter \ + seccomp-filter-v \ + seccomp-strict \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + set_ptracer_any \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal_receive \ + signalfd4 \ + sigreturn \ + sleep \ + socketcall \ + splice \ + stack-fcall \ + stat \ + stat64 \ + statfs \ + statfs64 \ + swap \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + threads-execve \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unix-pair-send-recv \ + unix-pair-sendto-recvfrom \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimes \ + vfork-f \ + vhangup \ + vmsplice \ + wait4 \ + wait4-v \ + waitid \ + waitid-v \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # end of check_PROGRAMS + +attach_f_p_LDADD = -lrt -lpthread $(LDADD) +clock_xettime_LDADD = -lrt $(LDADD) +count_f_LDADD = -lpthread $(LDADD) +filter_unavailable_LDADD = -lpthread $(LDADD) +fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = -lrt $(LDADD) +mq_sendrecv_LDADD = -lrt $(LDADD) +mq_sendrecv_read_LDADD = -lrt $(LDADD) +mq_sendrecv_write_LDADD = -lrt $(LDADD) +newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pc_LDADD = $(dl_LIBS) $(LDADD) +pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +threads_execve_LDADD = -lrt -lpthread $(LDADD) +times_LDADD = -lrt $(LDADD) +truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + +stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + +if USE_LIBUNWIND +LIBUNWIND_TESTS = strace-k.test +else +LIBUNWIND_TESTS = +endif + +DECODER_TESTS = \ + _newselect.test \ + accept.test \ + accept4.test \ + access.test \ + acct.test \ + add_key.test \ + adjtimex.test \ + aio.test \ + alarm.test \ + bpf.test \ + brk.test \ + btrfs-v.test \ + btrfs-vw.test \ + btrfs-w.test \ + btrfs.test \ + caps-abbrev.test \ + caps.test \ + chmod.test \ + chown.test \ + chown32.test \ + chroot.test \ + clock_adjtime.test \ + clock_nanosleep.test \ + clock_xettime.test \ + copy_file_range.test \ + creat.test \ + delete_module.test \ + dup.test \ + dup2.test \ + dup3.test \ + epoll_create.test \ + epoll_create1.test \ + epoll_ctl.test \ + epoll_pwait.test \ + epoll_wait.test \ + erestartsys.test \ + eventfd.test \ + execve-v.test \ + execve.test \ + execveat-v.test \ + execveat.test \ + faccessat.test \ + fadvise64.test \ + fadvise64_64.test \ + fallocate.test \ + fanotify_init.test \ + fanotify_mark.test \ + fchdir.test \ + fchmod.test \ + fchmodat.test \ + fchown.test \ + fchown32.test \ + fchownat.test \ + fcntl.test \ + fcntl64.test \ + fdatasync.test \ + file_handle.test \ + file_ioctl.test \ + finit_module.test \ + flock.test \ + fstat.test \ + fstat64.test \ + fstatat64.test \ + fstatfs.test \ + fstatfs64.test \ + fsync.test \ + ftruncate.test \ + ftruncate64.test \ + futex.test \ + futimesat.test \ + get_mempolicy.test \ + getcpu.test \ + getcwd.test \ + getdents.test \ + getdents64.test \ + getegid.test \ + getegid32.test \ + geteuid.test \ + geteuid32.test \ + getgid.test \ + getgid32.test \ + getgroups.test \ + getgroups32.test \ + getpeername.test \ + getpgrp.test \ + getrandom.test \ + getresgid.test \ + getresgid32.test \ + getresuid.test \ + getresuid32.test \ + getrlimit.test \ + getrusage.test \ + getsid.test \ + getsockname.test \ + getuid.test \ + getuid32.test \ + getxxid.test \ + inet-cmsg.test \ + init_module.test \ + inotify.test \ + inotify_init1.test \ + ioctl.test \ + ioctl_block.test \ + ioctl_dm-v.test \ + ioctl_dm.test \ + ioctl_evdev-v.test \ + ioctl_evdev.test \ + ioctl_loop-nv.test \ + ioctl_loop-v.test \ + ioctl_loop.test \ + ioctl_mtd.test \ + ioctl_rtc-v.test \ + ioctl_rtc.test \ + ioctl_scsi.test \ + ioctl_sg_io_v3.test \ + ioctl_sg_io_v4.test \ + ioctl_sock_gifconf.test \ + ioctl_uffdio.test \ + ioctl_v4l2.test \ + ioperm.test \ + iopl.test \ + ioprio.test \ + ip_mreq.test \ + ipc.test \ + ipc_msg.test \ + ipc_msgbuf.test \ + ipc_sem.test \ + ipc_shm.test \ + kcmp.test \ + kexec_file_load.test \ + kexec_load.test \ + keyctl.test \ + kill.test \ + lchown.test \ + lchown32.test \ + link.test \ + linkat.test \ + llseek.test \ + lookup_dcookie.test \ + lseek.test \ + lstat.test \ + lstat64.test \ + mbind.test \ + membarrier.test \ + memfd_create.test \ + migrate_pages.test \ + mincore.test \ + mkdir.test \ + mkdirat.test \ + mknod.test \ + mknodat.test \ + mlock.test \ + mlock2.test \ + mlockall.test \ + mmap.test \ + mmap64.test \ + mmsg-silent.test \ + mmsg.test \ + mmsg_name-v.test \ + mmsg_name.test \ + mount.test \ + move_pages.test \ + mq.test \ + mq_sendrecv-read.test \ + mq_sendrecv-write.test \ + mq_sendrecv.test \ + msg_control-v.test \ + msg_control.test \ + msg_name.test \ + munlockall.test \ + nanosleep.test \ + net-icmp_filter.test \ + net-sockaddr.test \ + net-y-unix.test \ + net-yy-inet.test \ + net-yy-netlink.test \ + net-yy-unix.test \ + net.test \ + netlink_protocol.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ + oldfstat.test \ + oldlstat.test \ + oldselect.test \ + oldstat.test \ + open.test \ + openat.test \ + pause.test \ + perf_event_open.test \ + perf_event_open_nonverbose.test \ + perf_event_open_unabbrev.test \ + personality.test \ + pipe.test \ + pipe2.test \ + pkey_alloc.test \ + pkey_free.test \ + pkey_mprotect.test \ + poll.test \ + ppoll.test \ + prctl-arg2-intptr.test \ + prctl-dumpable.test \ + prctl-name.test \ + prctl-no-args.test \ + prctl-pdeathsig.test \ + prctl-seccomp-filter-v.test \ + prctl-seccomp-strict.test \ + prctl-securebits.test \ + prctl-tid_address.test \ + prctl-tsc.test \ + pread64-pwrite64.test \ + preadv-pwritev.test \ + preadv.test \ + preadv2-pwritev2.test \ + printstr.test \ + prlimit64.test \ + process_vm_readv.test \ + process_vm_writev.test \ + pselect6.test \ + ptrace.test \ + pwritev.test \ + qual_fault-exit_group.test \ + quotactl-v.test \ + quotactl-xfs-v.test \ + quotactl-xfs.test \ + quotactl.test \ + read-write.test \ + readahead.test \ + readdir.test \ + readlink.test \ + readlinkat.test \ + readv.test \ + reboot.test \ + recvfrom.test \ + recvmmsg-timeout.test \ + recvmsg.test \ + remap_file_pages.test \ + rename.test \ + renameat.test \ + renameat2.test \ + request_key.test \ + rmdir.test \ + rt_sigpending.test \ + rt_sigprocmask.test \ + rt_sigqueueinfo.test \ + rt_sigsuspend.test \ + rt_sigtimedwait.test \ + rt_tgsigqueueinfo.test \ + sched_get_priority_mxx.test \ + sched_rr_get_interval.test \ + sched_xetaffinity.test \ + sched_xetattr.test \ + sched_xetparam.test \ + sched_xetscheduler.test \ + sched_yield.test \ + scm_rights-fd.test \ + seccomp-filter-v.test \ + seccomp-filter.test \ + seccomp-strict.test \ + select.test \ + semop.test \ + sendfile.test \ + sendfile64.test \ + set_mempolicy.test \ + setdomainname.test \ + setfsgid.test \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ + setgid.test \ + setgid32.test \ + setgroups.test \ + setgroups32.test \ + sethostname.test \ + setns.test \ + setregid.test \ + setregid32.test \ + setresgid.test \ + setresgid32.test \ + setresuid.test \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ + setrlimit.test \ + setuid.test \ + setuid32.test \ + shmxt.test \ + shutdown.test \ + sigaction.test \ + sigaltstack.test \ + siginfo.test \ + signalfd4.test \ + sigreturn.test \ + socketcall.test \ + splice.test \ + stat.test \ + stat64.test \ + statfs.test \ + statfs64.test \ + sun_path.test \ + swap.test \ + symlink.test \ + symlinkat.test \ + sync.test \ + sync_file_range.test \ + sync_file_range2.test \ + sysinfo.test \ + syslog.test \ + tee.test \ + time.test \ + timer_create.test \ + timer_xettime.test \ + timerfd_xettime.test \ + times-fail.test \ + times.test \ + truncate.test \ + truncate64.test \ + ugetrlimit.test \ + uio.test \ + umask.test \ + umount.test \ + umount2.test \ + umoven-illptr.test \ + umovestr-illptr.test \ + umovestr.test \ + umovestr2.test \ + umovestr3.test \ + uname.test \ + unix-pair-send-recv.test \ + unix-pair-sendto-recvfrom.test \ + unlink.test \ + unlinkat.test \ + unshare.test \ + userfaultfd.test \ + ustat.test \ + utime.test \ + utimensat.test \ + utimes.test \ + vhangup.test \ + vmsplice.test \ + wait4-v.test \ + wait4.test \ + waitid-v.test \ + waitid.test \ + waitpid.test \ + xattr-strings.test \ + xattr.test \ + xet_robust_list.test \ + xetitimer.test \ + xetpgid.test \ + xetpriority.test \ + xettimeofday.test \ + # end of DECODER_TESTS + +MISC_TESTS = \ + attach-f-p.test \ + attach-p-cmd.test \ + bexecve.test \ + count-f.test \ + count.test \ + detach-running.test \ + detach-sleeping.test \ + detach-stopped.test \ + filter-unavailable.test \ + fork-f.test \ + ksysent.test \ + opipe.test \ + options-syntax.test \ + pc.test \ + qual_fault-syntax.test \ + qual_fault.test \ + qual_inject-error-signal.test \ + qual_inject-retval.test \ + qual_inject-signal.test \ + qual_inject-syntax.test \ + qual_signal.test \ + qual_syscall.test \ + redirect-fds.test \ + redirect.test \ + restart_syscall.test \ + signal_receive.test \ + strace-C.test \ + strace-E.test \ + strace-S.test \ + strace-T.test \ + strace-V.test \ + strace-ff.test \ + strace-r.test \ + strace-t.test \ + strace-tt.test \ + strace-ttt.test \ + threads-execve.test \ + vfork-f.test \ + # end of MISC_TESTS + +TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS) + +XFAIL_TESTS_ = +XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) + +TEST_LOG_COMPILER = env +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh + +@VALGRIND_CHECK_RULES@ +VALGRIND_FLAGS = --quiet +VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp + +EXTRA_DIST = init.sh run.sh match.awk \ + caps-abbrev.awk \ + caps.awk \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + getresugid.c \ + init_delete_module.h \ + ipc.sh \ + ipc_msgbuf.expected \ + ksysent.sed \ + lstatx.c \ + net.expected \ + oldselect.expected \ + pipe.expected \ + ppoll-v.expected \ + ppoll.expected \ + process_vm_readv_writev.c \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + quotactl.h \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaction.awk \ + sigaltstack.expected \ + sockname.c \ + statfs.expected \ + statx.sh \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + struct_flock.c \ + sun_path.expected \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + $(TESTS) + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h + +objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) +$(objects): scno.h + +CLEANFILES = ksysent.h $(TESTS:=.tmp) + +include ../scno.am diff --git a/tests-mx32/Makefile.in b/tests-mx32/Makefile.in new file mode 100644 index 00000000..47838a3f --- /dev/null +++ b/tests-mx32/Makefile.in @@ -0,0 +1,5714 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automake input for strace tests. +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# scno.h make rules for strace. +# +# Copyright (c) 2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ + access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ + adjtimex$(EXEEXT) aio$(EXEEXT) alarm$(EXEEXT) answer$(EXEEXT) \ + attach-f-p$(EXEEXT) attach-f-p-cmd$(EXEEXT) \ + attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) bpf$(EXEEXT) \ + brk$(EXEEXT) btrfs$(EXEEXT) caps$(EXEEXT) caps-abbrev$(EXEEXT) \ + chmod$(EXEEXT) chown$(EXEEXT) chown32$(EXEEXT) chroot$(EXEEXT) \ + clock_adjtime$(EXEEXT) clock_nanosleep$(EXEEXT) \ + clock_xettime$(EXEEXT) copy_file_range$(EXEEXT) \ + count-f$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ + dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) epoll_create$(EXEEXT) \ + epoll_create1$(EXEEXT) epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) \ + epoll_wait$(EXEEXT) erestartsys$(EXEEXT) eventfd$(EXEEXT) \ + execve$(EXEEXT) execve-v$(EXEEXT) execveat$(EXEEXT) \ + execveat-v$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ + fadvise64_64$(EXEEXT) fallocate$(EXEEXT) \ + fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) fchdir$(EXEEXT) \ + fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \ + fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \ + fcntl64$(EXEEXT) fdatasync$(EXEEXT) file_handle$(EXEEXT) \ + file_ioctl$(EXEEXT) filter-unavailable$(EXEEXT) \ + finit_module$(EXEEXT) flock$(EXEEXT) fork-f$(EXEEXT) \ + fstat$(EXEEXT) fstat64$(EXEEXT) fstatat64$(EXEEXT) \ + fstatfs$(EXEEXT) fstatfs64$(EXEEXT) fsync$(EXEEXT) \ + ftruncate$(EXEEXT) ftruncate64$(EXEEXT) futex$(EXEEXT) \ + futimesat$(EXEEXT) get_mempolicy$(EXEEXT) getcpu$(EXEEXT) \ + getcwd$(EXEEXT) getdents$(EXEEXT) getdents64$(EXEEXT) \ + getegid$(EXEEXT) getegid32$(EXEEXT) geteuid$(EXEEXT) \ + geteuid32$(EXEEXT) getgid$(EXEEXT) getgid32$(EXEEXT) \ + getgroups$(EXEEXT) getgroups32$(EXEEXT) getpeername$(EXEEXT) \ + getpgrp$(EXEEXT) getrandom$(EXEEXT) getresgid$(EXEEXT) \ + getresgid32$(EXEEXT) getresuid$(EXEEXT) getresuid32$(EXEEXT) \ + getrlimit$(EXEEXT) getrusage$(EXEEXT) getsid$(EXEEXT) \ + getsockname$(EXEEXT) getuid$(EXEEXT) getuid32$(EXEEXT) \ + getxxid$(EXEEXT) inet-cmsg$(EXEEXT) init_module$(EXEEXT) \ + inotify$(EXEEXT) inotify_init1$(EXEEXT) ioctl$(EXEEXT) \ + ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) ioctl_dm-v$(EXEEXT) \ + ioctl_evdev$(EXEEXT) ioctl_evdev-v$(EXEEXT) \ + ioctl_loop$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ + ioctl_loop-v$(EXEEXT) ioctl_mtd$(EXEEXT) ioctl_rtc$(EXEEXT) \ + ioctl_rtc-v$(EXEEXT) ioctl_scsi$(EXEEXT) \ + ioctl_sg_io_v3$(EXEEXT) ioctl_sg_io_v4$(EXEEXT) \ + ioctl_sock_gifconf$(EXEEXT) ioctl_uffdio$(EXEEXT) \ + ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) iopl$(EXEEXT) \ + ioprio$(EXEEXT) ip_mreq$(EXEEXT) ipc$(EXEEXT) ipc_msg$(EXEEXT) \ + ipc_msgbuf$(EXEEXT) ipc_sem$(EXEEXT) ipc_shm$(EXEEXT) \ + kcmp$(EXEEXT) kexec_file_load$(EXEEXT) kexec_load$(EXEEXT) \ + keyctl$(EXEEXT) kill$(EXEEXT) ksysent$(EXEEXT) lchown$(EXEEXT) \ + lchown32$(EXEEXT) link$(EXEEXT) linkat$(EXEEXT) \ + llseek$(EXEEXT) lookup_dcookie$(EXEEXT) lseek$(EXEEXT) \ + lstat$(EXEEXT) lstat64$(EXEEXT) mbind$(EXEEXT) \ + membarrier$(EXEEXT) memfd_create$(EXEEXT) \ + migrate_pages$(EXEEXT) mincore$(EXEEXT) mkdir$(EXEEXT) \ + mkdirat$(EXEEXT) mknod$(EXEEXT) mknodat$(EXEEXT) \ + mlock$(EXEEXT) mlock2$(EXEEXT) mlockall$(EXEEXT) mmap$(EXEEXT) \ + mmap64$(EXEEXT) mmsg$(EXEEXT) mmsg-silent$(EXEEXT) \ + mmsg_name$(EXEEXT) mmsg_name-v$(EXEEXT) mount$(EXEEXT) \ + move_pages$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ + mq_sendrecv-read$(EXEEXT) mq_sendrecv-write$(EXEEXT) \ + msg_control$(EXEEXT) msg_control-v$(EXEEXT) msg_name$(EXEEXT) \ + munlockall$(EXEEXT) nanosleep$(EXEEXT) \ + net-accept-connect$(EXEEXT) net-icmp_filter$(EXEEXT) \ + net-sockaddr$(EXEEXT) net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) \ + net-yy-netlink$(EXEEXT) net-yy-unix$(EXEEXT) \ + netlink_inet_diag$(EXEEXT) netlink_netlink_diag$(EXEEXT) \ + netlink_protocol$(EXEEXT) netlink_unix_diag$(EXEEXT) \ + newfstatat$(EXEEXT) nsyscalls$(EXEEXT) old_mmap$(EXEEXT) \ + oldfstat$(EXEEXT) oldlstat$(EXEEXT) oldselect$(EXEEXT) \ + oldstat$(EXEEXT) open$(EXEEXT) openat$(EXEEXT) pause$(EXEEXT) \ + pc$(EXEEXT) perf_event_open$(EXEEXT) \ + perf_event_open_nonverbose$(EXEEXT) \ + perf_event_open_unabbrev$(EXEEXT) personality$(EXEEXT) \ + pipe$(EXEEXT) pipe2$(EXEEXT) pkey_alloc$(EXEEXT) \ + pkey_free$(EXEEXT) pkey_mprotect$(EXEEXT) poll$(EXEEXT) \ + ppoll$(EXEEXT) prctl-arg2-intptr$(EXEEXT) \ + prctl-dumpable$(EXEEXT) prctl-name$(EXEEXT) \ + prctl-no-args$(EXEEXT) prctl-pdeathsig$(EXEEXT) \ + prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ + prctl-securebits$(EXEEXT) prctl-tid_address$(EXEEXT) \ + prctl-tsc$(EXEEXT) pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ + preadv-pwritev$(EXEEXT) preadv2-pwritev2$(EXEEXT) \ + print_maxfd$(EXEEXT) printstr$(EXEEXT) prlimit64$(EXEEXT) \ + process_vm_readv$(EXEEXT) process_vm_writev$(EXEEXT) \ + pselect6$(EXEEXT) ptrace$(EXEEXT) pwritev$(EXEEXT) \ + qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ + qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ + qual_signal$(EXEEXT) quotactl$(EXEEXT) quotactl-v$(EXEEXT) \ + quotactl-xfs$(EXEEXT) quotactl-xfs-v$(EXEEXT) \ + read-write$(EXEEXT) readahead$(EXEEXT) readdir$(EXEEXT) \ + readlink$(EXEEXT) readlinkat$(EXEEXT) readv$(EXEEXT) \ + reboot$(EXEEXT) recvfrom$(EXEEXT) recvmmsg-timeout$(EXEEXT) \ + recvmsg$(EXEEXT) redirect-fds$(EXEEXT) \ + remap_file_pages$(EXEEXT) rename$(EXEEXT) renameat$(EXEEXT) \ + renameat2$(EXEEXT) request_key$(EXEEXT) \ + restart_syscall$(EXEEXT) rmdir$(EXEEXT) rt_sigpending$(EXEEXT) \ + rt_sigprocmask$(EXEEXT) rt_sigqueueinfo$(EXEEXT) \ + rt_sigsuspend$(EXEEXT) rt_sigtimedwait$(EXEEXT) \ + rt_tgsigqueueinfo$(EXEEXT) sched_get_priority_mxx$(EXEEXT) \ + sched_rr_get_interval$(EXEEXT) sched_xetaffinity$(EXEEXT) \ + sched_xetattr$(EXEEXT) sched_xetparam$(EXEEXT) \ + sched_xetscheduler$(EXEEXT) sched_yield$(EXEEXT) \ + scm_rights$(EXEEXT) seccomp-filter$(EXEEXT) \ + seccomp-filter-v$(EXEEXT) seccomp-strict$(EXEEXT) \ + select$(EXEEXT) semop$(EXEEXT) sendfile$(EXEEXT) \ + sendfile64$(EXEEXT) set_mempolicy$(EXEEXT) \ + set_ptracer_any$(EXEEXT) setdomainname$(EXEEXT) \ + setfsgid$(EXEEXT) setfsgid32$(EXEEXT) setfsuid$(EXEEXT) \ + setfsuid32$(EXEEXT) setgid$(EXEEXT) setgid32$(EXEEXT) \ + setgroups$(EXEEXT) setgroups32$(EXEEXT) sethostname$(EXEEXT) \ + setns$(EXEEXT) setregid$(EXEEXT) setregid32$(EXEEXT) \ + setresgid$(EXEEXT) setresgid32$(EXEEXT) setresuid$(EXEEXT) \ + setresuid32$(EXEEXT) setreuid$(EXEEXT) setreuid32$(EXEEXT) \ + setrlimit$(EXEEXT) setuid$(EXEEXT) setuid32$(EXEEXT) \ + shmxt$(EXEEXT) shutdown$(EXEEXT) sigaction$(EXEEXT) \ + sigaltstack$(EXEEXT) siginfo$(EXEEXT) signal_receive$(EXEEXT) \ + signalfd4$(EXEEXT) sigreturn$(EXEEXT) sleep$(EXEEXT) \ + socketcall$(EXEEXT) splice$(EXEEXT) stack-fcall$(EXEEXT) \ + stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ + statfs64$(EXEEXT) swap$(EXEEXT) symlink$(EXEEXT) \ + symlinkat$(EXEEXT) sync$(EXEEXT) sync_file_range$(EXEEXT) \ + sync_file_range2$(EXEEXT) sysinfo$(EXEEXT) syslog$(EXEEXT) \ + tee$(EXEEXT) threads-execve$(EXEEXT) time$(EXEEXT) \ + timer_create$(EXEEXT) timer_xettime$(EXEEXT) \ + timerfd_xettime$(EXEEXT) times$(EXEEXT) times-fail$(EXEEXT) \ + truncate$(EXEEXT) truncate64$(EXEEXT) ugetrlimit$(EXEEXT) \ + uio$(EXEEXT) umask$(EXEEXT) umount$(EXEEXT) umount2$(EXEEXT) \ + umoven-illptr$(EXEEXT) umovestr$(EXEEXT) \ + umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) umovestr3$(EXEEXT) \ + uname$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) unlink$(EXEEXT) \ + unlinkat$(EXEEXT) unshare$(EXEEXT) userfaultfd$(EXEEXT) \ + ustat$(EXEEXT) utime$(EXEEXT) utimensat$(EXEEXT) \ + utimes$(EXEEXT) vfork-f$(EXEEXT) vhangup$(EXEEXT) \ + vmsplice$(EXEEXT) wait4$(EXEEXT) wait4-v$(EXEEXT) \ + waitid$(EXEEXT) waitid-v$(EXEEXT) waitpid$(EXEEXT) \ + xattr$(EXEEXT) xattr-strings$(EXEEXT) xet_robust_list$(EXEEXT) \ + xetitimer$(EXEEXT) xetpgid$(EXEEXT) xetpriority$(EXEEXT) \ + xettimeofday$(EXEEXT) +TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_1) +DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +subdir = tests-mx32 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_valgrind_check.m4 \ + $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_warn_cflags.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libtests_a_AR = $(AR) $(ARFLAGS) +libtests_a_LIBADD = +am_libtests_a_OBJECTS = libtests_a-errno2name.$(OBJEXT) \ + libtests_a-error_msg.$(OBJEXT) \ + libtests_a-fill_memory.$(OBJEXT) \ + libtests_a-get_page_size.$(OBJEXT) \ + libtests_a-hexdump_strdup.$(OBJEXT) \ + libtests_a-hexquote_strndup.$(OBJEXT) \ + libtests_a-inode_of_sockfd.$(OBJEXT) \ + libtests_a-libmmsg.$(OBJEXT) \ + libtests_a-libsocketcall.$(OBJEXT) \ + libtests_a-overflowuid.$(OBJEXT) \ + libtests_a-pipe_maxfd.$(OBJEXT) \ + libtests_a-print_quoted_string.$(OBJEXT) \ + libtests_a-printflags.$(OBJEXT) libtests_a-printxval.$(OBJEXT) \ + libtests_a-signal2name.$(OBJEXT) libtests_a-sprintrc.$(OBJEXT) \ + libtests_a-tail_alloc.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) +libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) +_newselect_SOURCES = _newselect.c +_newselect_OBJECTS = _newselect.$(OBJEXT) +_newselect_LDADD = $(LDADD) +_newselect_DEPENDENCIES = libtests.a +accept_SOURCES = accept.c +accept_OBJECTS = accept.$(OBJEXT) +accept_LDADD = $(LDADD) +accept_DEPENDENCIES = libtests.a +accept4_SOURCES = accept4.c +accept4_OBJECTS = accept4.$(OBJEXT) +accept4_LDADD = $(LDADD) +accept4_DEPENDENCIES = libtests.a +access_SOURCES = access.c +access_OBJECTS = access.$(OBJEXT) +access_LDADD = $(LDADD) +access_DEPENDENCIES = libtests.a +acct_SOURCES = acct.c +acct_OBJECTS = acct.$(OBJEXT) +acct_LDADD = $(LDADD) +acct_DEPENDENCIES = libtests.a +add_key_SOURCES = add_key.c +add_key_OBJECTS = add_key.$(OBJEXT) +add_key_LDADD = $(LDADD) +add_key_DEPENDENCIES = libtests.a +adjtimex_SOURCES = adjtimex.c +adjtimex_OBJECTS = adjtimex.$(OBJEXT) +adjtimex_LDADD = $(LDADD) +adjtimex_DEPENDENCIES = libtests.a +aio_SOURCES = aio.c +aio_OBJECTS = aio.$(OBJEXT) +aio_LDADD = $(LDADD) +aio_DEPENDENCIES = libtests.a +alarm_SOURCES = alarm.c +alarm_OBJECTS = alarm.$(OBJEXT) +alarm_LDADD = $(LDADD) +alarm_DEPENDENCIES = libtests.a +answer_SOURCES = answer.c +answer_OBJECTS = answer.$(OBJEXT) +answer_LDADD = $(LDADD) +answer_DEPENDENCIES = libtests.a +attach_f_p_SOURCES = attach-f-p.c +attach_f_p_OBJECTS = attach-f-p.$(OBJEXT) +attach_f_p_DEPENDENCIES = $(LDADD) +attach_f_p_cmd_SOURCES = attach-f-p-cmd.c +attach_f_p_cmd_OBJECTS = attach-f-p-cmd.$(OBJEXT) +attach_f_p_cmd_LDADD = $(LDADD) +attach_f_p_cmd_DEPENDENCIES = libtests.a +attach_p_cmd_cmd_SOURCES = attach-p-cmd-cmd.c +attach_p_cmd_cmd_OBJECTS = attach-p-cmd-cmd.$(OBJEXT) +attach_p_cmd_cmd_LDADD = $(LDADD) +attach_p_cmd_cmd_DEPENDENCIES = libtests.a +attach_p_cmd_p_SOURCES = attach-p-cmd-p.c +attach_p_cmd_p_OBJECTS = attach-p-cmd-p.$(OBJEXT) +attach_p_cmd_p_LDADD = $(LDADD) +attach_p_cmd_p_DEPENDENCIES = libtests.a +bpf_SOURCES = bpf.c +bpf_OBJECTS = bpf.$(OBJEXT) +bpf_LDADD = $(LDADD) +bpf_DEPENDENCIES = libtests.a +brk_SOURCES = brk.c +brk_OBJECTS = brk.$(OBJEXT) +brk_LDADD = $(LDADD) +brk_DEPENDENCIES = libtests.a +btrfs_SOURCES = btrfs.c +btrfs_OBJECTS = btrfs.$(OBJEXT) +btrfs_LDADD = $(LDADD) +btrfs_DEPENDENCIES = libtests.a +caps_SOURCES = caps.c +caps_OBJECTS = caps.$(OBJEXT) +caps_LDADD = $(LDADD) +caps_DEPENDENCIES = libtests.a +caps_abbrev_SOURCES = caps-abbrev.c +caps_abbrev_OBJECTS = caps-abbrev.$(OBJEXT) +caps_abbrev_LDADD = $(LDADD) +caps_abbrev_DEPENDENCIES = libtests.a +chmod_SOURCES = chmod.c +chmod_OBJECTS = chmod.$(OBJEXT) +chmod_LDADD = $(LDADD) +chmod_DEPENDENCIES = libtests.a +chown_SOURCES = chown.c +chown_OBJECTS = chown.$(OBJEXT) +chown_LDADD = $(LDADD) +chown_DEPENDENCIES = libtests.a +chown32_SOURCES = chown32.c +chown32_OBJECTS = chown32.$(OBJEXT) +chown32_LDADD = $(LDADD) +chown32_DEPENDENCIES = libtests.a +chroot_SOURCES = chroot.c +chroot_OBJECTS = chroot.$(OBJEXT) +chroot_LDADD = $(LDADD) +chroot_DEPENDENCIES = libtests.a +clock_adjtime_SOURCES = clock_adjtime.c +clock_adjtime_OBJECTS = clock_adjtime.$(OBJEXT) +clock_adjtime_LDADD = $(LDADD) +clock_adjtime_DEPENDENCIES = libtests.a +clock_nanosleep_SOURCES = clock_nanosleep.c +clock_nanosleep_OBJECTS = clock_nanosleep.$(OBJEXT) +clock_nanosleep_LDADD = $(LDADD) +clock_nanosleep_DEPENDENCIES = libtests.a +clock_xettime_SOURCES = clock_xettime.c +clock_xettime_OBJECTS = clock_xettime.$(OBJEXT) +clock_xettime_DEPENDENCIES = $(LDADD) +copy_file_range_SOURCES = copy_file_range.c +copy_file_range_OBJECTS = copy_file_range.$(OBJEXT) +copy_file_range_LDADD = $(LDADD) +copy_file_range_DEPENDENCIES = libtests.a +count_f_SOURCES = count-f.c +count_f_OBJECTS = count-f.$(OBJEXT) +count_f_DEPENDENCIES = $(LDADD) +creat_SOURCES = creat.c +creat_OBJECTS = creat.$(OBJEXT) +creat_LDADD = $(LDADD) +creat_DEPENDENCIES = libtests.a +delete_module_SOURCES = delete_module.c +delete_module_OBJECTS = delete_module.$(OBJEXT) +delete_module_LDADD = $(LDADD) +delete_module_DEPENDENCIES = libtests.a +dup_SOURCES = dup.c +dup_OBJECTS = dup.$(OBJEXT) +dup_LDADD = $(LDADD) +dup_DEPENDENCIES = libtests.a +dup2_SOURCES = dup2.c +dup2_OBJECTS = dup2.$(OBJEXT) +dup2_LDADD = $(LDADD) +dup2_DEPENDENCIES = libtests.a +dup3_SOURCES = dup3.c +dup3_OBJECTS = dup3.$(OBJEXT) +dup3_LDADD = $(LDADD) +dup3_DEPENDENCIES = libtests.a +epoll_create_SOURCES = epoll_create.c +epoll_create_OBJECTS = epoll_create.$(OBJEXT) +epoll_create_LDADD = $(LDADD) +epoll_create_DEPENDENCIES = libtests.a +epoll_create1_SOURCES = epoll_create1.c +epoll_create1_OBJECTS = epoll_create1.$(OBJEXT) +epoll_create1_LDADD = $(LDADD) +epoll_create1_DEPENDENCIES = libtests.a +epoll_ctl_SOURCES = epoll_ctl.c +epoll_ctl_OBJECTS = epoll_ctl.$(OBJEXT) +epoll_ctl_LDADD = $(LDADD) +epoll_ctl_DEPENDENCIES = libtests.a +epoll_pwait_SOURCES = epoll_pwait.c +epoll_pwait_OBJECTS = epoll_pwait.$(OBJEXT) +epoll_pwait_LDADD = $(LDADD) +epoll_pwait_DEPENDENCIES = libtests.a +epoll_wait_SOURCES = epoll_wait.c +epoll_wait_OBJECTS = epoll_wait.$(OBJEXT) +epoll_wait_LDADD = $(LDADD) +epoll_wait_DEPENDENCIES = libtests.a +erestartsys_SOURCES = erestartsys.c +erestartsys_OBJECTS = erestartsys.$(OBJEXT) +erestartsys_LDADD = $(LDADD) +erestartsys_DEPENDENCIES = libtests.a +eventfd_SOURCES = eventfd.c +eventfd_OBJECTS = eventfd.$(OBJEXT) +eventfd_LDADD = $(LDADD) +eventfd_DEPENDENCIES = libtests.a +execve_SOURCES = execve.c +execve_OBJECTS = execve.$(OBJEXT) +execve_LDADD = $(LDADD) +execve_DEPENDENCIES = libtests.a +execve_v_SOURCES = execve-v.c +execve_v_OBJECTS = execve-v.$(OBJEXT) +execve_v_LDADD = $(LDADD) +execve_v_DEPENDENCIES = libtests.a +execveat_SOURCES = execveat.c +execveat_OBJECTS = execveat.$(OBJEXT) +execveat_LDADD = $(LDADD) +execveat_DEPENDENCIES = libtests.a +execveat_v_SOURCES = execveat-v.c +execveat_v_OBJECTS = execveat-v.$(OBJEXT) +execveat_v_LDADD = $(LDADD) +execveat_v_DEPENDENCIES = libtests.a +faccessat_SOURCES = faccessat.c +faccessat_OBJECTS = faccessat.$(OBJEXT) +faccessat_LDADD = $(LDADD) +faccessat_DEPENDENCIES = libtests.a +fadvise64_SOURCES = fadvise64.c +fadvise64_OBJECTS = fadvise64.$(OBJEXT) +fadvise64_LDADD = $(LDADD) +fadvise64_DEPENDENCIES = libtests.a +fadvise64_64_SOURCES = fadvise64_64.c +fadvise64_64_OBJECTS = fadvise64_64.$(OBJEXT) +fadvise64_64_LDADD = $(LDADD) +fadvise64_64_DEPENDENCIES = libtests.a +fallocate_SOURCES = fallocate.c +fallocate_OBJECTS = fallocate.$(OBJEXT) +fallocate_LDADD = $(LDADD) +fallocate_DEPENDENCIES = libtests.a +fanotify_init_SOURCES = fanotify_init.c +fanotify_init_OBJECTS = fanotify_init.$(OBJEXT) +fanotify_init_LDADD = $(LDADD) +fanotify_init_DEPENDENCIES = libtests.a +fanotify_mark_SOURCES = fanotify_mark.c +fanotify_mark_OBJECTS = fanotify_mark.$(OBJEXT) +fanotify_mark_LDADD = $(LDADD) +fanotify_mark_DEPENDENCIES = libtests.a +fchdir_SOURCES = fchdir.c +fchdir_OBJECTS = fchdir.$(OBJEXT) +fchdir_LDADD = $(LDADD) +fchdir_DEPENDENCIES = libtests.a +fchmod_SOURCES = fchmod.c +fchmod_OBJECTS = fchmod.$(OBJEXT) +fchmod_LDADD = $(LDADD) +fchmod_DEPENDENCIES = libtests.a +fchmodat_SOURCES = fchmodat.c +fchmodat_OBJECTS = fchmodat.$(OBJEXT) +fchmodat_LDADD = $(LDADD) +fchmodat_DEPENDENCIES = libtests.a +fchown_SOURCES = fchown.c +fchown_OBJECTS = fchown.$(OBJEXT) +fchown_LDADD = $(LDADD) +fchown_DEPENDENCIES = libtests.a +fchown32_SOURCES = fchown32.c +fchown32_OBJECTS = fchown32.$(OBJEXT) +fchown32_LDADD = $(LDADD) +fchown32_DEPENDENCIES = libtests.a +fchownat_SOURCES = fchownat.c +fchownat_OBJECTS = fchownat.$(OBJEXT) +fchownat_LDADD = $(LDADD) +fchownat_DEPENDENCIES = libtests.a +fcntl_SOURCES = fcntl.c +fcntl_OBJECTS = fcntl.$(OBJEXT) +fcntl_LDADD = $(LDADD) +fcntl_DEPENDENCIES = libtests.a +fcntl64_SOURCES = fcntl64.c +fcntl64_OBJECTS = fcntl64.$(OBJEXT) +fcntl64_LDADD = $(LDADD) +fcntl64_DEPENDENCIES = libtests.a +fdatasync_SOURCES = fdatasync.c +fdatasync_OBJECTS = fdatasync.$(OBJEXT) +fdatasync_LDADD = $(LDADD) +fdatasync_DEPENDENCIES = libtests.a +file_handle_SOURCES = file_handle.c +file_handle_OBJECTS = file_handle.$(OBJEXT) +file_handle_LDADD = $(LDADD) +file_handle_DEPENDENCIES = libtests.a +file_ioctl_SOURCES = file_ioctl.c +file_ioctl_OBJECTS = file_ioctl.$(OBJEXT) +file_ioctl_LDADD = $(LDADD) +file_ioctl_DEPENDENCIES = libtests.a +filter_unavailable_SOURCES = filter-unavailable.c +filter_unavailable_OBJECTS = filter-unavailable.$(OBJEXT) +filter_unavailable_DEPENDENCIES = $(LDADD) +finit_module_SOURCES = finit_module.c +finit_module_OBJECTS = finit_module.$(OBJEXT) +finit_module_LDADD = $(LDADD) +finit_module_DEPENDENCIES = libtests.a +flock_SOURCES = flock.c +flock_OBJECTS = flock.$(OBJEXT) +flock_LDADD = $(LDADD) +flock_DEPENDENCIES = libtests.a +fork_f_SOURCES = fork-f.c +fork_f_OBJECTS = fork-f.$(OBJEXT) +fork_f_LDADD = $(LDADD) +fork_f_DEPENDENCIES = libtests.a +fstat_SOURCES = fstat.c +fstat_OBJECTS = fstat.$(OBJEXT) +fstat_LDADD = $(LDADD) +fstat_DEPENDENCIES = libtests.a +fstat64_SOURCES = fstat64.c +fstat64_OBJECTS = fstat64-fstat64.$(OBJEXT) +fstat64_LDADD = $(LDADD) +fstat64_DEPENDENCIES = libtests.a +fstatat64_SOURCES = fstatat64.c +fstatat64_OBJECTS = fstatat64-fstatat64.$(OBJEXT) +fstatat64_LDADD = $(LDADD) +fstatat64_DEPENDENCIES = libtests.a +fstatfs_SOURCES = fstatfs.c +fstatfs_OBJECTS = fstatfs.$(OBJEXT) +fstatfs_LDADD = $(LDADD) +fstatfs_DEPENDENCIES = libtests.a +fstatfs64_SOURCES = fstatfs64.c +fstatfs64_OBJECTS = fstatfs64.$(OBJEXT) +fstatfs64_LDADD = $(LDADD) +fstatfs64_DEPENDENCIES = libtests.a +fsync_SOURCES = fsync.c +fsync_OBJECTS = fsync.$(OBJEXT) +fsync_LDADD = $(LDADD) +fsync_DEPENDENCIES = libtests.a +ftruncate_SOURCES = ftruncate.c +ftruncate_OBJECTS = ftruncate.$(OBJEXT) +ftruncate_LDADD = $(LDADD) +ftruncate_DEPENDENCIES = libtests.a +ftruncate64_SOURCES = ftruncate64.c +ftruncate64_OBJECTS = ftruncate64-ftruncate64.$(OBJEXT) +ftruncate64_LDADD = $(LDADD) +ftruncate64_DEPENDENCIES = libtests.a +futex_SOURCES = futex.c +futex_OBJECTS = futex.$(OBJEXT) +futex_LDADD = $(LDADD) +futex_DEPENDENCIES = libtests.a +futimesat_SOURCES = futimesat.c +futimesat_OBJECTS = futimesat.$(OBJEXT) +futimesat_LDADD = $(LDADD) +futimesat_DEPENDENCIES = libtests.a +get_mempolicy_SOURCES = get_mempolicy.c +get_mempolicy_OBJECTS = get_mempolicy.$(OBJEXT) +get_mempolicy_LDADD = $(LDADD) +get_mempolicy_DEPENDENCIES = libtests.a +getcpu_SOURCES = getcpu.c +getcpu_OBJECTS = getcpu.$(OBJEXT) +getcpu_LDADD = $(LDADD) +getcpu_DEPENDENCIES = libtests.a +getcwd_SOURCES = getcwd.c +getcwd_OBJECTS = getcwd.$(OBJEXT) +getcwd_LDADD = $(LDADD) +getcwd_DEPENDENCIES = libtests.a +getdents_SOURCES = getdents.c +getdents_OBJECTS = getdents.$(OBJEXT) +getdents_LDADD = $(LDADD) +getdents_DEPENDENCIES = libtests.a +getdents64_SOURCES = getdents64.c +getdents64_OBJECTS = getdents64.$(OBJEXT) +getdents64_LDADD = $(LDADD) +getdents64_DEPENDENCIES = libtests.a +getegid_SOURCES = getegid.c +getegid_OBJECTS = getegid.$(OBJEXT) +getegid_LDADD = $(LDADD) +getegid_DEPENDENCIES = libtests.a +getegid32_SOURCES = getegid32.c +getegid32_OBJECTS = getegid32.$(OBJEXT) +getegid32_LDADD = $(LDADD) +getegid32_DEPENDENCIES = libtests.a +geteuid_SOURCES = geteuid.c +geteuid_OBJECTS = geteuid.$(OBJEXT) +geteuid_LDADD = $(LDADD) +geteuid_DEPENDENCIES = libtests.a +geteuid32_SOURCES = geteuid32.c +geteuid32_OBJECTS = geteuid32.$(OBJEXT) +geteuid32_LDADD = $(LDADD) +geteuid32_DEPENDENCIES = libtests.a +getgid_SOURCES = getgid.c +getgid_OBJECTS = getgid.$(OBJEXT) +getgid_LDADD = $(LDADD) +getgid_DEPENDENCIES = libtests.a +getgid32_SOURCES = getgid32.c +getgid32_OBJECTS = getgid32.$(OBJEXT) +getgid32_LDADD = $(LDADD) +getgid32_DEPENDENCIES = libtests.a +getgroups_SOURCES = getgroups.c +getgroups_OBJECTS = getgroups.$(OBJEXT) +getgroups_LDADD = $(LDADD) +getgroups_DEPENDENCIES = libtests.a +getgroups32_SOURCES = getgroups32.c +getgroups32_OBJECTS = getgroups32.$(OBJEXT) +getgroups32_LDADD = $(LDADD) +getgroups32_DEPENDENCIES = libtests.a +getpeername_SOURCES = getpeername.c +getpeername_OBJECTS = getpeername.$(OBJEXT) +getpeername_LDADD = $(LDADD) +getpeername_DEPENDENCIES = libtests.a +getpgrp_SOURCES = getpgrp.c +getpgrp_OBJECTS = getpgrp.$(OBJEXT) +getpgrp_LDADD = $(LDADD) +getpgrp_DEPENDENCIES = libtests.a +getrandom_SOURCES = getrandom.c +getrandom_OBJECTS = getrandom.$(OBJEXT) +getrandom_LDADD = $(LDADD) +getrandom_DEPENDENCIES = libtests.a +getresgid_SOURCES = getresgid.c +getresgid_OBJECTS = getresgid.$(OBJEXT) +getresgid_LDADD = $(LDADD) +getresgid_DEPENDENCIES = libtests.a +getresgid32_SOURCES = getresgid32.c +getresgid32_OBJECTS = getresgid32.$(OBJEXT) +getresgid32_LDADD = $(LDADD) +getresgid32_DEPENDENCIES = libtests.a +getresuid_SOURCES = getresuid.c +getresuid_OBJECTS = getresuid.$(OBJEXT) +getresuid_LDADD = $(LDADD) +getresuid_DEPENDENCIES = libtests.a +getresuid32_SOURCES = getresuid32.c +getresuid32_OBJECTS = getresuid32.$(OBJEXT) +getresuid32_LDADD = $(LDADD) +getresuid32_DEPENDENCIES = libtests.a +getrlimit_SOURCES = getrlimit.c +getrlimit_OBJECTS = getrlimit.$(OBJEXT) +getrlimit_LDADD = $(LDADD) +getrlimit_DEPENDENCIES = libtests.a +getrusage_SOURCES = getrusage.c +getrusage_OBJECTS = getrusage.$(OBJEXT) +getrusage_LDADD = $(LDADD) +getrusage_DEPENDENCIES = libtests.a +getsid_SOURCES = getsid.c +getsid_OBJECTS = getsid.$(OBJEXT) +getsid_LDADD = $(LDADD) +getsid_DEPENDENCIES = libtests.a +getsockname_SOURCES = getsockname.c +getsockname_OBJECTS = getsockname.$(OBJEXT) +getsockname_LDADD = $(LDADD) +getsockname_DEPENDENCIES = libtests.a +getuid_SOURCES = getuid.c +getuid_OBJECTS = getuid.$(OBJEXT) +getuid_LDADD = $(LDADD) +getuid_DEPENDENCIES = libtests.a +getuid32_SOURCES = getuid32.c +getuid32_OBJECTS = getuid32.$(OBJEXT) +getuid32_LDADD = $(LDADD) +getuid32_DEPENDENCIES = libtests.a +getxxid_SOURCES = getxxid.c +getxxid_OBJECTS = getxxid.$(OBJEXT) +getxxid_LDADD = $(LDADD) +getxxid_DEPENDENCIES = libtests.a +inet_cmsg_SOURCES = inet-cmsg.c +inet_cmsg_OBJECTS = inet-cmsg.$(OBJEXT) +inet_cmsg_LDADD = $(LDADD) +inet_cmsg_DEPENDENCIES = libtests.a +init_module_SOURCES = init_module.c +init_module_OBJECTS = init_module.$(OBJEXT) +init_module_LDADD = $(LDADD) +init_module_DEPENDENCIES = libtests.a +inotify_SOURCES = inotify.c +inotify_OBJECTS = inotify.$(OBJEXT) +inotify_LDADD = $(LDADD) +inotify_DEPENDENCIES = libtests.a +inotify_init1_SOURCES = inotify_init1.c +inotify_init1_OBJECTS = inotify_init1.$(OBJEXT) +inotify_init1_LDADD = $(LDADD) +inotify_init1_DEPENDENCIES = libtests.a +ioctl_SOURCES = ioctl.c +ioctl_OBJECTS = ioctl.$(OBJEXT) +ioctl_LDADD = $(LDADD) +ioctl_DEPENDENCIES = libtests.a +ioctl_block_SOURCES = ioctl_block.c +ioctl_block_OBJECTS = ioctl_block.$(OBJEXT) +ioctl_block_LDADD = $(LDADD) +ioctl_block_DEPENDENCIES = libtests.a +ioctl_dm_SOURCES = ioctl_dm.c +ioctl_dm_OBJECTS = ioctl_dm.$(OBJEXT) +ioctl_dm_LDADD = $(LDADD) +ioctl_dm_DEPENDENCIES = libtests.a +ioctl_dm_v_SOURCES = ioctl_dm-v.c +ioctl_dm_v_OBJECTS = ioctl_dm-v.$(OBJEXT) +ioctl_dm_v_LDADD = $(LDADD) +ioctl_dm_v_DEPENDENCIES = libtests.a +ioctl_evdev_SOURCES = ioctl_evdev.c +ioctl_evdev_OBJECTS = ioctl_evdev.$(OBJEXT) +ioctl_evdev_LDADD = $(LDADD) +ioctl_evdev_DEPENDENCIES = libtests.a +ioctl_evdev_v_SOURCES = ioctl_evdev-v.c +ioctl_evdev_v_OBJECTS = ioctl_evdev-v.$(OBJEXT) +ioctl_evdev_v_LDADD = $(LDADD) +ioctl_evdev_v_DEPENDENCIES = libtests.a +ioctl_loop_SOURCES = ioctl_loop.c +ioctl_loop_OBJECTS = ioctl_loop.$(OBJEXT) +ioctl_loop_LDADD = $(LDADD) +ioctl_loop_DEPENDENCIES = libtests.a +ioctl_loop_nv_SOURCES = ioctl_loop-nv.c +ioctl_loop_nv_OBJECTS = ioctl_loop-nv.$(OBJEXT) +ioctl_loop_nv_LDADD = $(LDADD) +ioctl_loop_nv_DEPENDENCIES = libtests.a +ioctl_loop_v_SOURCES = ioctl_loop-v.c +ioctl_loop_v_OBJECTS = ioctl_loop-v.$(OBJEXT) +ioctl_loop_v_LDADD = $(LDADD) +ioctl_loop_v_DEPENDENCIES = libtests.a +ioctl_mtd_SOURCES = ioctl_mtd.c +ioctl_mtd_OBJECTS = ioctl_mtd.$(OBJEXT) +ioctl_mtd_LDADD = $(LDADD) +ioctl_mtd_DEPENDENCIES = libtests.a +ioctl_rtc_SOURCES = ioctl_rtc.c +ioctl_rtc_OBJECTS = ioctl_rtc.$(OBJEXT) +ioctl_rtc_LDADD = $(LDADD) +ioctl_rtc_DEPENDENCIES = libtests.a +ioctl_rtc_v_SOURCES = ioctl_rtc-v.c +ioctl_rtc_v_OBJECTS = ioctl_rtc-v.$(OBJEXT) +ioctl_rtc_v_LDADD = $(LDADD) +ioctl_rtc_v_DEPENDENCIES = libtests.a +ioctl_scsi_SOURCES = ioctl_scsi.c +ioctl_scsi_OBJECTS = ioctl_scsi.$(OBJEXT) +ioctl_scsi_LDADD = $(LDADD) +ioctl_scsi_DEPENDENCIES = libtests.a +ioctl_sg_io_v3_SOURCES = ioctl_sg_io_v3.c +ioctl_sg_io_v3_OBJECTS = ioctl_sg_io_v3.$(OBJEXT) +ioctl_sg_io_v3_LDADD = $(LDADD) +ioctl_sg_io_v3_DEPENDENCIES = libtests.a +ioctl_sg_io_v4_SOURCES = ioctl_sg_io_v4.c +ioctl_sg_io_v4_OBJECTS = ioctl_sg_io_v4.$(OBJEXT) +ioctl_sg_io_v4_LDADD = $(LDADD) +ioctl_sg_io_v4_DEPENDENCIES = libtests.a +ioctl_sock_gifconf_SOURCES = ioctl_sock_gifconf.c +ioctl_sock_gifconf_OBJECTS = ioctl_sock_gifconf.$(OBJEXT) +ioctl_sock_gifconf_LDADD = $(LDADD) +ioctl_sock_gifconf_DEPENDENCIES = libtests.a +ioctl_uffdio_SOURCES = ioctl_uffdio.c +ioctl_uffdio_OBJECTS = ioctl_uffdio.$(OBJEXT) +ioctl_uffdio_LDADD = $(LDADD) +ioctl_uffdio_DEPENDENCIES = libtests.a +ioctl_v4l2_SOURCES = ioctl_v4l2.c +ioctl_v4l2_OBJECTS = ioctl_v4l2.$(OBJEXT) +ioctl_v4l2_LDADD = $(LDADD) +ioctl_v4l2_DEPENDENCIES = libtests.a +ioperm_SOURCES = ioperm.c +ioperm_OBJECTS = ioperm.$(OBJEXT) +ioperm_LDADD = $(LDADD) +ioperm_DEPENDENCIES = libtests.a +iopl_SOURCES = iopl.c +iopl_OBJECTS = iopl.$(OBJEXT) +iopl_LDADD = $(LDADD) +iopl_DEPENDENCIES = libtests.a +ioprio_SOURCES = ioprio.c +ioprio_OBJECTS = ioprio.$(OBJEXT) +ioprio_LDADD = $(LDADD) +ioprio_DEPENDENCIES = libtests.a +ip_mreq_SOURCES = ip_mreq.c +ip_mreq_OBJECTS = ip_mreq.$(OBJEXT) +ip_mreq_LDADD = $(LDADD) +ip_mreq_DEPENDENCIES = libtests.a +ipc_SOURCES = ipc.c +ipc_OBJECTS = ipc.$(OBJEXT) +ipc_LDADD = $(LDADD) +ipc_DEPENDENCIES = libtests.a +ipc_msg_SOURCES = ipc_msg.c +ipc_msg_OBJECTS = ipc_msg.$(OBJEXT) +ipc_msg_LDADD = $(LDADD) +ipc_msg_DEPENDENCIES = libtests.a +ipc_msgbuf_SOURCES = ipc_msgbuf.c +ipc_msgbuf_OBJECTS = ipc_msgbuf.$(OBJEXT) +ipc_msgbuf_LDADD = $(LDADD) +ipc_msgbuf_DEPENDENCIES = libtests.a +ipc_sem_SOURCES = ipc_sem.c +ipc_sem_OBJECTS = ipc_sem.$(OBJEXT) +ipc_sem_LDADD = $(LDADD) +ipc_sem_DEPENDENCIES = libtests.a +ipc_shm_SOURCES = ipc_shm.c +ipc_shm_OBJECTS = ipc_shm.$(OBJEXT) +ipc_shm_LDADD = $(LDADD) +ipc_shm_DEPENDENCIES = libtests.a +kcmp_SOURCES = kcmp.c +kcmp_OBJECTS = kcmp.$(OBJEXT) +kcmp_LDADD = $(LDADD) +kcmp_DEPENDENCIES = libtests.a +kexec_file_load_SOURCES = kexec_file_load.c +kexec_file_load_OBJECTS = kexec_file_load.$(OBJEXT) +kexec_file_load_LDADD = $(LDADD) +kexec_file_load_DEPENDENCIES = libtests.a +kexec_load_SOURCES = kexec_load.c +kexec_load_OBJECTS = kexec_load.$(OBJEXT) +kexec_load_LDADD = $(LDADD) +kexec_load_DEPENDENCIES = libtests.a +keyctl_SOURCES = keyctl.c +keyctl_OBJECTS = keyctl.$(OBJEXT) +keyctl_LDADD = $(LDADD) +keyctl_DEPENDENCIES = libtests.a +kill_SOURCES = kill.c +kill_OBJECTS = kill.$(OBJEXT) +kill_LDADD = $(LDADD) +kill_DEPENDENCIES = libtests.a +ksysent_SOURCES = ksysent.c +ksysent_OBJECTS = ksysent.$(OBJEXT) +ksysent_LDADD = $(LDADD) +ksysent_DEPENDENCIES = libtests.a +lchown_SOURCES = lchown.c +lchown_OBJECTS = lchown.$(OBJEXT) +lchown_LDADD = $(LDADD) +lchown_DEPENDENCIES = libtests.a +lchown32_SOURCES = lchown32.c +lchown32_OBJECTS = lchown32.$(OBJEXT) +lchown32_LDADD = $(LDADD) +lchown32_DEPENDENCIES = libtests.a +link_SOURCES = link.c +link_OBJECTS = link.$(OBJEXT) +link_LDADD = $(LDADD) +link_DEPENDENCIES = libtests.a +linkat_SOURCES = linkat.c +linkat_OBJECTS = linkat.$(OBJEXT) +linkat_LDADD = $(LDADD) +linkat_DEPENDENCIES = libtests.a +llseek_SOURCES = llseek.c +llseek_OBJECTS = llseek.$(OBJEXT) +llseek_LDADD = $(LDADD) +llseek_DEPENDENCIES = libtests.a +lookup_dcookie_SOURCES = lookup_dcookie.c +lookup_dcookie_OBJECTS = lookup_dcookie.$(OBJEXT) +lookup_dcookie_LDADD = $(LDADD) +lookup_dcookie_DEPENDENCIES = libtests.a +lseek_SOURCES = lseek.c +lseek_OBJECTS = lseek.$(OBJEXT) +lseek_LDADD = $(LDADD) +lseek_DEPENDENCIES = libtests.a +lstat_SOURCES = lstat.c +lstat_OBJECTS = lstat.$(OBJEXT) +lstat_LDADD = $(LDADD) +lstat_DEPENDENCIES = libtests.a +lstat64_SOURCES = lstat64.c +lstat64_OBJECTS = lstat64-lstat64.$(OBJEXT) +lstat64_LDADD = $(LDADD) +lstat64_DEPENDENCIES = libtests.a +mbind_SOURCES = mbind.c +mbind_OBJECTS = mbind.$(OBJEXT) +mbind_LDADD = $(LDADD) +mbind_DEPENDENCIES = libtests.a +membarrier_SOURCES = membarrier.c +membarrier_OBJECTS = membarrier.$(OBJEXT) +membarrier_LDADD = $(LDADD) +membarrier_DEPENDENCIES = libtests.a +memfd_create_SOURCES = memfd_create.c +memfd_create_OBJECTS = memfd_create.$(OBJEXT) +memfd_create_LDADD = $(LDADD) +memfd_create_DEPENDENCIES = libtests.a +migrate_pages_SOURCES = migrate_pages.c +migrate_pages_OBJECTS = migrate_pages.$(OBJEXT) +migrate_pages_LDADD = $(LDADD) +migrate_pages_DEPENDENCIES = libtests.a +mincore_SOURCES = mincore.c +mincore_OBJECTS = mincore.$(OBJEXT) +mincore_LDADD = $(LDADD) +mincore_DEPENDENCIES = libtests.a +mkdir_SOURCES = mkdir.c +mkdir_OBJECTS = mkdir.$(OBJEXT) +mkdir_LDADD = $(LDADD) +mkdir_DEPENDENCIES = libtests.a +mkdirat_SOURCES = mkdirat.c +mkdirat_OBJECTS = mkdirat.$(OBJEXT) +mkdirat_LDADD = $(LDADD) +mkdirat_DEPENDENCIES = libtests.a +mknod_SOURCES = mknod.c +mknod_OBJECTS = mknod.$(OBJEXT) +mknod_LDADD = $(LDADD) +mknod_DEPENDENCIES = libtests.a +mknodat_SOURCES = mknodat.c +mknodat_OBJECTS = mknodat.$(OBJEXT) +mknodat_LDADD = $(LDADD) +mknodat_DEPENDENCIES = libtests.a +mlock_SOURCES = mlock.c +mlock_OBJECTS = mlock.$(OBJEXT) +mlock_LDADD = $(LDADD) +mlock_DEPENDENCIES = libtests.a +mlock2_SOURCES = mlock2.c +mlock2_OBJECTS = mlock2.$(OBJEXT) +mlock2_LDADD = $(LDADD) +mlock2_DEPENDENCIES = libtests.a +mlockall_SOURCES = mlockall.c +mlockall_OBJECTS = mlockall.$(OBJEXT) +mlockall_LDADD = $(LDADD) +mlockall_DEPENDENCIES = libtests.a +mmap_SOURCES = mmap.c +mmap_OBJECTS = mmap.$(OBJEXT) +mmap_LDADD = $(LDADD) +mmap_DEPENDENCIES = libtests.a +mmap64_SOURCES = mmap64.c +mmap64_OBJECTS = mmap64-mmap64.$(OBJEXT) +mmap64_LDADD = $(LDADD) +mmap64_DEPENDENCIES = libtests.a +mmsg_SOURCES = mmsg.c +mmsg_OBJECTS = mmsg.$(OBJEXT) +mmsg_LDADD = $(LDADD) +mmsg_DEPENDENCIES = libtests.a +mmsg_silent_SOURCES = mmsg-silent.c +mmsg_silent_OBJECTS = mmsg-silent.$(OBJEXT) +mmsg_silent_LDADD = $(LDADD) +mmsg_silent_DEPENDENCIES = libtests.a +mmsg_name_SOURCES = mmsg_name.c +mmsg_name_OBJECTS = mmsg_name.$(OBJEXT) +mmsg_name_LDADD = $(LDADD) +mmsg_name_DEPENDENCIES = libtests.a +mmsg_name_v_SOURCES = mmsg_name-v.c +mmsg_name_v_OBJECTS = mmsg_name-v.$(OBJEXT) +mmsg_name_v_LDADD = $(LDADD) +mmsg_name_v_DEPENDENCIES = libtests.a +mount_SOURCES = mount.c +mount_OBJECTS = mount.$(OBJEXT) +mount_LDADD = $(LDADD) +mount_DEPENDENCIES = libtests.a +move_pages_SOURCES = move_pages.c +move_pages_OBJECTS = move_pages.$(OBJEXT) +move_pages_LDADD = $(LDADD) +move_pages_DEPENDENCIES = libtests.a +mq_SOURCES = mq.c +mq_OBJECTS = mq.$(OBJEXT) +mq_DEPENDENCIES = $(LDADD) +mq_sendrecv_SOURCES = mq_sendrecv.c +mq_sendrecv_OBJECTS = mq_sendrecv.$(OBJEXT) +mq_sendrecv_DEPENDENCIES = $(LDADD) +mq_sendrecv_read_SOURCES = mq_sendrecv-read.c +mq_sendrecv_read_OBJECTS = mq_sendrecv-read.$(OBJEXT) +mq_sendrecv_read_DEPENDENCIES = $(LDADD) +mq_sendrecv_write_SOURCES = mq_sendrecv-write.c +mq_sendrecv_write_OBJECTS = mq_sendrecv-write.$(OBJEXT) +mq_sendrecv_write_DEPENDENCIES = $(LDADD) +msg_control_SOURCES = msg_control.c +msg_control_OBJECTS = msg_control.$(OBJEXT) +msg_control_LDADD = $(LDADD) +msg_control_DEPENDENCIES = libtests.a +msg_control_v_SOURCES = msg_control-v.c +msg_control_v_OBJECTS = msg_control-v.$(OBJEXT) +msg_control_v_LDADD = $(LDADD) +msg_control_v_DEPENDENCIES = libtests.a +msg_name_SOURCES = msg_name.c +msg_name_OBJECTS = msg_name.$(OBJEXT) +msg_name_LDADD = $(LDADD) +msg_name_DEPENDENCIES = libtests.a +munlockall_SOURCES = munlockall.c +munlockall_OBJECTS = munlockall.$(OBJEXT) +munlockall_LDADD = $(LDADD) +munlockall_DEPENDENCIES = libtests.a +nanosleep_SOURCES = nanosleep.c +nanosleep_OBJECTS = nanosleep.$(OBJEXT) +nanosleep_LDADD = $(LDADD) +nanosleep_DEPENDENCIES = libtests.a +net_accept_connect_SOURCES = net-accept-connect.c +net_accept_connect_OBJECTS = net-accept-connect.$(OBJEXT) +net_accept_connect_LDADD = $(LDADD) +net_accept_connect_DEPENDENCIES = libtests.a +net_icmp_filter_SOURCES = net-icmp_filter.c +net_icmp_filter_OBJECTS = net-icmp_filter.$(OBJEXT) +net_icmp_filter_LDADD = $(LDADD) +net_icmp_filter_DEPENDENCIES = libtests.a +net_sockaddr_SOURCES = net-sockaddr.c +net_sockaddr_OBJECTS = net-sockaddr.$(OBJEXT) +net_sockaddr_LDADD = $(LDADD) +net_sockaddr_DEPENDENCIES = libtests.a +net_y_unix_SOURCES = net-y-unix.c +net_y_unix_OBJECTS = net-y-unix.$(OBJEXT) +net_y_unix_LDADD = $(LDADD) +net_y_unix_DEPENDENCIES = libtests.a +net_yy_inet_SOURCES = net-yy-inet.c +net_yy_inet_OBJECTS = net-yy-inet.$(OBJEXT) +net_yy_inet_LDADD = $(LDADD) +net_yy_inet_DEPENDENCIES = libtests.a +net_yy_netlink_SOURCES = net-yy-netlink.c +net_yy_netlink_OBJECTS = net-yy-netlink.$(OBJEXT) +net_yy_netlink_LDADD = $(LDADD) +net_yy_netlink_DEPENDENCIES = libtests.a +net_yy_unix_SOURCES = net-yy-unix.c +net_yy_unix_OBJECTS = net-yy-unix.$(OBJEXT) +net_yy_unix_LDADD = $(LDADD) +net_yy_unix_DEPENDENCIES = libtests.a +netlink_inet_diag_SOURCES = netlink_inet_diag.c +netlink_inet_diag_OBJECTS = netlink_inet_diag.$(OBJEXT) +netlink_inet_diag_LDADD = $(LDADD) +netlink_inet_diag_DEPENDENCIES = libtests.a +netlink_netlink_diag_SOURCES = netlink_netlink_diag.c +netlink_netlink_diag_OBJECTS = netlink_netlink_diag.$(OBJEXT) +netlink_netlink_diag_LDADD = $(LDADD) +netlink_netlink_diag_DEPENDENCIES = libtests.a +netlink_protocol_SOURCES = netlink_protocol.c +netlink_protocol_OBJECTS = netlink_protocol.$(OBJEXT) +netlink_protocol_LDADD = $(LDADD) +netlink_protocol_DEPENDENCIES = libtests.a +netlink_unix_diag_SOURCES = netlink_unix_diag.c +netlink_unix_diag_OBJECTS = netlink_unix_diag.$(OBJEXT) +netlink_unix_diag_LDADD = $(LDADD) +netlink_unix_diag_DEPENDENCIES = libtests.a +newfstatat_SOURCES = newfstatat.c +newfstatat_OBJECTS = newfstatat-newfstatat.$(OBJEXT) +newfstatat_LDADD = $(LDADD) +newfstatat_DEPENDENCIES = libtests.a +nsyscalls_SOURCES = nsyscalls.c +nsyscalls_OBJECTS = nsyscalls.$(OBJEXT) +nsyscalls_LDADD = $(LDADD) +nsyscalls_DEPENDENCIES = libtests.a +old_mmap_SOURCES = old_mmap.c +old_mmap_OBJECTS = old_mmap.$(OBJEXT) +old_mmap_LDADD = $(LDADD) +old_mmap_DEPENDENCIES = libtests.a +oldfstat_SOURCES = oldfstat.c +oldfstat_OBJECTS = oldfstat.$(OBJEXT) +oldfstat_LDADD = $(LDADD) +oldfstat_DEPENDENCIES = libtests.a +oldlstat_SOURCES = oldlstat.c +oldlstat_OBJECTS = oldlstat.$(OBJEXT) +oldlstat_LDADD = $(LDADD) +oldlstat_DEPENDENCIES = libtests.a +oldselect_SOURCES = oldselect.c +oldselect_OBJECTS = oldselect.$(OBJEXT) +oldselect_LDADD = $(LDADD) +oldselect_DEPENDENCIES = libtests.a +oldstat_SOURCES = oldstat.c +oldstat_OBJECTS = oldstat.$(OBJEXT) +oldstat_LDADD = $(LDADD) +oldstat_DEPENDENCIES = libtests.a +open_SOURCES = open.c +open_OBJECTS = open.$(OBJEXT) +open_LDADD = $(LDADD) +open_DEPENDENCIES = libtests.a +openat_SOURCES = openat.c +openat_OBJECTS = openat.$(OBJEXT) +openat_LDADD = $(LDADD) +openat_DEPENDENCIES = libtests.a +pause_SOURCES = pause.c +pause_OBJECTS = pause.$(OBJEXT) +pause_LDADD = $(LDADD) +pause_DEPENDENCIES = libtests.a +pc_SOURCES = pc.c +pc_OBJECTS = pc.$(OBJEXT) +am__DEPENDENCIES_1 = +pc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) +perf_event_open_SOURCES = perf_event_open.c +perf_event_open_OBJECTS = perf_event_open.$(OBJEXT) +perf_event_open_LDADD = $(LDADD) +perf_event_open_DEPENDENCIES = libtests.a +perf_event_open_nonverbose_SOURCES = perf_event_open_nonverbose.c +perf_event_open_nonverbose_OBJECTS = \ + perf_event_open_nonverbose.$(OBJEXT) +perf_event_open_nonverbose_LDADD = $(LDADD) +perf_event_open_nonverbose_DEPENDENCIES = libtests.a +perf_event_open_unabbrev_SOURCES = perf_event_open_unabbrev.c +perf_event_open_unabbrev_OBJECTS = perf_event_open_unabbrev.$(OBJEXT) +perf_event_open_unabbrev_LDADD = $(LDADD) +perf_event_open_unabbrev_DEPENDENCIES = libtests.a +personality_SOURCES = personality.c +personality_OBJECTS = personality.$(OBJEXT) +personality_LDADD = $(LDADD) +personality_DEPENDENCIES = libtests.a +pipe_SOURCES = pipe.c +pipe_OBJECTS = pipe.$(OBJEXT) +pipe_LDADD = $(LDADD) +pipe_DEPENDENCIES = libtests.a +pipe2_SOURCES = pipe2.c +pipe2_OBJECTS = pipe2.$(OBJEXT) +pipe2_LDADD = $(LDADD) +pipe2_DEPENDENCIES = libtests.a +pkey_alloc_SOURCES = pkey_alloc.c +pkey_alloc_OBJECTS = pkey_alloc.$(OBJEXT) +pkey_alloc_LDADD = $(LDADD) +pkey_alloc_DEPENDENCIES = libtests.a +pkey_free_SOURCES = pkey_free.c +pkey_free_OBJECTS = pkey_free.$(OBJEXT) +pkey_free_LDADD = $(LDADD) +pkey_free_DEPENDENCIES = libtests.a +pkey_mprotect_SOURCES = pkey_mprotect.c +pkey_mprotect_OBJECTS = pkey_mprotect.$(OBJEXT) +pkey_mprotect_LDADD = $(LDADD) +pkey_mprotect_DEPENDENCIES = libtests.a +poll_SOURCES = poll.c +poll_OBJECTS = poll.$(OBJEXT) +poll_LDADD = $(LDADD) +poll_DEPENDENCIES = libtests.a +ppoll_SOURCES = ppoll.c +ppoll_OBJECTS = ppoll.$(OBJEXT) +ppoll_LDADD = $(LDADD) +ppoll_DEPENDENCIES = libtests.a +prctl_arg2_intptr_SOURCES = prctl-arg2-intptr.c +prctl_arg2_intptr_OBJECTS = prctl-arg2-intptr.$(OBJEXT) +prctl_arg2_intptr_LDADD = $(LDADD) +prctl_arg2_intptr_DEPENDENCIES = libtests.a +prctl_dumpable_SOURCES = prctl-dumpable.c +prctl_dumpable_OBJECTS = prctl-dumpable.$(OBJEXT) +prctl_dumpable_LDADD = $(LDADD) +prctl_dumpable_DEPENDENCIES = libtests.a +prctl_name_SOURCES = prctl-name.c +prctl_name_OBJECTS = prctl-name.$(OBJEXT) +prctl_name_LDADD = $(LDADD) +prctl_name_DEPENDENCIES = libtests.a +prctl_no_args_SOURCES = prctl-no-args.c +prctl_no_args_OBJECTS = prctl-no-args.$(OBJEXT) +prctl_no_args_LDADD = $(LDADD) +prctl_no_args_DEPENDENCIES = libtests.a +prctl_pdeathsig_SOURCES = prctl-pdeathsig.c +prctl_pdeathsig_OBJECTS = prctl-pdeathsig.$(OBJEXT) +prctl_pdeathsig_LDADD = $(LDADD) +prctl_pdeathsig_DEPENDENCIES = libtests.a +prctl_seccomp_filter_v_SOURCES = prctl-seccomp-filter-v.c +prctl_seccomp_filter_v_OBJECTS = prctl-seccomp-filter-v.$(OBJEXT) +prctl_seccomp_filter_v_LDADD = $(LDADD) +prctl_seccomp_filter_v_DEPENDENCIES = libtests.a +prctl_seccomp_strict_SOURCES = prctl-seccomp-strict.c +prctl_seccomp_strict_OBJECTS = prctl-seccomp-strict.$(OBJEXT) +prctl_seccomp_strict_LDADD = $(LDADD) +prctl_seccomp_strict_DEPENDENCIES = libtests.a +prctl_securebits_SOURCES = prctl-securebits.c +prctl_securebits_OBJECTS = prctl-securebits.$(OBJEXT) +prctl_securebits_LDADD = $(LDADD) +prctl_securebits_DEPENDENCIES = libtests.a +prctl_tid_address_SOURCES = prctl-tid_address.c +prctl_tid_address_OBJECTS = prctl-tid_address.$(OBJEXT) +prctl_tid_address_LDADD = $(LDADD) +prctl_tid_address_DEPENDENCIES = libtests.a +prctl_tsc_SOURCES = prctl-tsc.c +prctl_tsc_OBJECTS = prctl-tsc.$(OBJEXT) +prctl_tsc_LDADD = $(LDADD) +prctl_tsc_DEPENDENCIES = libtests.a +pread64_pwrite64_SOURCES = pread64-pwrite64.c +pread64_pwrite64_OBJECTS = \ + pread64_pwrite64-pread64-pwrite64.$(OBJEXT) +pread64_pwrite64_LDADD = $(LDADD) +pread64_pwrite64_DEPENDENCIES = libtests.a +preadv_SOURCES = preadv.c +preadv_OBJECTS = preadv-preadv.$(OBJEXT) +preadv_LDADD = $(LDADD) +preadv_DEPENDENCIES = libtests.a +preadv_pwritev_SOURCES = preadv-pwritev.c +preadv_pwritev_OBJECTS = preadv_pwritev-preadv-pwritev.$(OBJEXT) +preadv_pwritev_LDADD = $(LDADD) +preadv_pwritev_DEPENDENCIES = libtests.a +preadv2_pwritev2_SOURCES = preadv2-pwritev2.c +preadv2_pwritev2_OBJECTS = preadv2-pwritev2.$(OBJEXT) +preadv2_pwritev2_LDADD = $(LDADD) +preadv2_pwritev2_DEPENDENCIES = libtests.a +print_maxfd_SOURCES = print_maxfd.c +print_maxfd_OBJECTS = print_maxfd.$(OBJEXT) +print_maxfd_LDADD = $(LDADD) +print_maxfd_DEPENDENCIES = libtests.a +printstr_SOURCES = printstr.c +printstr_OBJECTS = printstr.$(OBJEXT) +printstr_LDADD = $(LDADD) +printstr_DEPENDENCIES = libtests.a +prlimit64_SOURCES = prlimit64.c +prlimit64_OBJECTS = prlimit64.$(OBJEXT) +prlimit64_LDADD = $(LDADD) +prlimit64_DEPENDENCIES = libtests.a +process_vm_readv_SOURCES = process_vm_readv.c +process_vm_readv_OBJECTS = process_vm_readv.$(OBJEXT) +process_vm_readv_LDADD = $(LDADD) +process_vm_readv_DEPENDENCIES = libtests.a +process_vm_writev_SOURCES = process_vm_writev.c +process_vm_writev_OBJECTS = process_vm_writev.$(OBJEXT) +process_vm_writev_LDADD = $(LDADD) +process_vm_writev_DEPENDENCIES = libtests.a +pselect6_SOURCES = pselect6.c +pselect6_OBJECTS = pselect6.$(OBJEXT) +pselect6_LDADD = $(LDADD) +pselect6_DEPENDENCIES = libtests.a +ptrace_SOURCES = ptrace.c +ptrace_OBJECTS = ptrace.$(OBJEXT) +ptrace_LDADD = $(LDADD) +ptrace_DEPENDENCIES = libtests.a +pwritev_SOURCES = pwritev.c +pwritev_OBJECTS = pwritev-pwritev.$(OBJEXT) +pwritev_LDADD = $(LDADD) +pwritev_DEPENDENCIES = libtests.a +qual_fault_SOURCES = qual_fault.c +qual_fault_OBJECTS = qual_fault.$(OBJEXT) +qual_fault_LDADD = $(LDADD) +qual_fault_DEPENDENCIES = libtests.a +qual_inject_error_signal_SOURCES = qual_inject-error-signal.c +qual_inject_error_signal_OBJECTS = qual_inject-error-signal.$(OBJEXT) +qual_inject_error_signal_LDADD = $(LDADD) +qual_inject_error_signal_DEPENDENCIES = libtests.a +qual_inject_retval_SOURCES = qual_inject-retval.c +qual_inject_retval_OBJECTS = qual_inject-retval.$(OBJEXT) +qual_inject_retval_LDADD = $(LDADD) +qual_inject_retval_DEPENDENCIES = libtests.a +qual_inject_signal_SOURCES = qual_inject-signal.c +qual_inject_signal_OBJECTS = qual_inject-signal.$(OBJEXT) +qual_inject_signal_LDADD = $(LDADD) +qual_inject_signal_DEPENDENCIES = libtests.a +qual_signal_SOURCES = qual_signal.c +qual_signal_OBJECTS = qual_signal.$(OBJEXT) +qual_signal_LDADD = $(LDADD) +qual_signal_DEPENDENCIES = libtests.a +quotactl_SOURCES = quotactl.c +quotactl_OBJECTS = quotactl.$(OBJEXT) +quotactl_LDADD = $(LDADD) +quotactl_DEPENDENCIES = libtests.a +quotactl_v_SOURCES = quotactl-v.c +quotactl_v_OBJECTS = quotactl-v.$(OBJEXT) +quotactl_v_LDADD = $(LDADD) +quotactl_v_DEPENDENCIES = libtests.a +quotactl_xfs_SOURCES = quotactl-xfs.c +quotactl_xfs_OBJECTS = quotactl-xfs.$(OBJEXT) +quotactl_xfs_LDADD = $(LDADD) +quotactl_xfs_DEPENDENCIES = libtests.a +quotactl_xfs_v_SOURCES = quotactl-xfs-v.c +quotactl_xfs_v_OBJECTS = quotactl-xfs-v.$(OBJEXT) +quotactl_xfs_v_LDADD = $(LDADD) +quotactl_xfs_v_DEPENDENCIES = libtests.a +read_write_SOURCES = read-write.c +read_write_OBJECTS = read-write.$(OBJEXT) +read_write_LDADD = $(LDADD) +read_write_DEPENDENCIES = libtests.a +readahead_SOURCES = readahead.c +readahead_OBJECTS = readahead.$(OBJEXT) +readahead_LDADD = $(LDADD) +readahead_DEPENDENCIES = libtests.a +readdir_SOURCES = readdir.c +readdir_OBJECTS = readdir.$(OBJEXT) +readdir_LDADD = $(LDADD) +readdir_DEPENDENCIES = libtests.a +readlink_SOURCES = readlink.c +readlink_OBJECTS = readlink.$(OBJEXT) +readlink_LDADD = $(LDADD) +readlink_DEPENDENCIES = libtests.a +readlinkat_SOURCES = readlinkat.c +readlinkat_OBJECTS = readlinkat.$(OBJEXT) +readlinkat_LDADD = $(LDADD) +readlinkat_DEPENDENCIES = libtests.a +readv_SOURCES = readv.c +readv_OBJECTS = readv.$(OBJEXT) +readv_LDADD = $(LDADD) +readv_DEPENDENCIES = libtests.a +reboot_SOURCES = reboot.c +reboot_OBJECTS = reboot.$(OBJEXT) +reboot_LDADD = $(LDADD) +reboot_DEPENDENCIES = libtests.a +recvfrom_SOURCES = recvfrom.c +recvfrom_OBJECTS = recvfrom.$(OBJEXT) +recvfrom_LDADD = $(LDADD) +recvfrom_DEPENDENCIES = libtests.a +recvmmsg_timeout_SOURCES = recvmmsg-timeout.c +recvmmsg_timeout_OBJECTS = recvmmsg-timeout.$(OBJEXT) +recvmmsg_timeout_LDADD = $(LDADD) +recvmmsg_timeout_DEPENDENCIES = libtests.a +recvmsg_SOURCES = recvmsg.c +recvmsg_OBJECTS = recvmsg.$(OBJEXT) +recvmsg_LDADD = $(LDADD) +recvmsg_DEPENDENCIES = libtests.a +redirect_fds_SOURCES = redirect-fds.c +redirect_fds_OBJECTS = redirect-fds.$(OBJEXT) +redirect_fds_LDADD = $(LDADD) +redirect_fds_DEPENDENCIES = libtests.a +remap_file_pages_SOURCES = remap_file_pages.c +remap_file_pages_OBJECTS = remap_file_pages.$(OBJEXT) +remap_file_pages_LDADD = $(LDADD) +remap_file_pages_DEPENDENCIES = libtests.a +rename_SOURCES = rename.c +rename_OBJECTS = rename.$(OBJEXT) +rename_LDADD = $(LDADD) +rename_DEPENDENCIES = libtests.a +renameat_SOURCES = renameat.c +renameat_OBJECTS = renameat.$(OBJEXT) +renameat_LDADD = $(LDADD) +renameat_DEPENDENCIES = libtests.a +renameat2_SOURCES = renameat2.c +renameat2_OBJECTS = renameat2.$(OBJEXT) +renameat2_LDADD = $(LDADD) +renameat2_DEPENDENCIES = libtests.a +request_key_SOURCES = request_key.c +request_key_OBJECTS = request_key.$(OBJEXT) +request_key_LDADD = $(LDADD) +request_key_DEPENDENCIES = libtests.a +restart_syscall_SOURCES = restart_syscall.c +restart_syscall_OBJECTS = restart_syscall.$(OBJEXT) +restart_syscall_LDADD = $(LDADD) +restart_syscall_DEPENDENCIES = libtests.a +rmdir_SOURCES = rmdir.c +rmdir_OBJECTS = rmdir.$(OBJEXT) +rmdir_LDADD = $(LDADD) +rmdir_DEPENDENCIES = libtests.a +rt_sigpending_SOURCES = rt_sigpending.c +rt_sigpending_OBJECTS = rt_sigpending.$(OBJEXT) +rt_sigpending_LDADD = $(LDADD) +rt_sigpending_DEPENDENCIES = libtests.a +rt_sigprocmask_SOURCES = rt_sigprocmask.c +rt_sigprocmask_OBJECTS = rt_sigprocmask.$(OBJEXT) +rt_sigprocmask_LDADD = $(LDADD) +rt_sigprocmask_DEPENDENCIES = libtests.a +rt_sigqueueinfo_SOURCES = rt_sigqueueinfo.c +rt_sigqueueinfo_OBJECTS = rt_sigqueueinfo.$(OBJEXT) +rt_sigqueueinfo_LDADD = $(LDADD) +rt_sigqueueinfo_DEPENDENCIES = libtests.a +rt_sigsuspend_SOURCES = rt_sigsuspend.c +rt_sigsuspend_OBJECTS = rt_sigsuspend.$(OBJEXT) +rt_sigsuspend_LDADD = $(LDADD) +rt_sigsuspend_DEPENDENCIES = libtests.a +rt_sigtimedwait_SOURCES = rt_sigtimedwait.c +rt_sigtimedwait_OBJECTS = rt_sigtimedwait.$(OBJEXT) +rt_sigtimedwait_LDADD = $(LDADD) +rt_sigtimedwait_DEPENDENCIES = libtests.a +rt_tgsigqueueinfo_SOURCES = rt_tgsigqueueinfo.c +rt_tgsigqueueinfo_OBJECTS = rt_tgsigqueueinfo.$(OBJEXT) +rt_tgsigqueueinfo_LDADD = $(LDADD) +rt_tgsigqueueinfo_DEPENDENCIES = libtests.a +sched_get_priority_mxx_SOURCES = sched_get_priority_mxx.c +sched_get_priority_mxx_OBJECTS = sched_get_priority_mxx.$(OBJEXT) +sched_get_priority_mxx_LDADD = $(LDADD) +sched_get_priority_mxx_DEPENDENCIES = libtests.a +sched_rr_get_interval_SOURCES = sched_rr_get_interval.c +sched_rr_get_interval_OBJECTS = sched_rr_get_interval.$(OBJEXT) +sched_rr_get_interval_LDADD = $(LDADD) +sched_rr_get_interval_DEPENDENCIES = libtests.a +sched_xetaffinity_SOURCES = sched_xetaffinity.c +sched_xetaffinity_OBJECTS = sched_xetaffinity.$(OBJEXT) +sched_xetaffinity_LDADD = $(LDADD) +sched_xetaffinity_DEPENDENCIES = libtests.a +sched_xetattr_SOURCES = sched_xetattr.c +sched_xetattr_OBJECTS = sched_xetattr.$(OBJEXT) +sched_xetattr_LDADD = $(LDADD) +sched_xetattr_DEPENDENCIES = libtests.a +sched_xetparam_SOURCES = sched_xetparam.c +sched_xetparam_OBJECTS = sched_xetparam.$(OBJEXT) +sched_xetparam_LDADD = $(LDADD) +sched_xetparam_DEPENDENCIES = libtests.a +sched_xetscheduler_SOURCES = sched_xetscheduler.c +sched_xetscheduler_OBJECTS = sched_xetscheduler.$(OBJEXT) +sched_xetscheduler_LDADD = $(LDADD) +sched_xetscheduler_DEPENDENCIES = libtests.a +sched_yield_SOURCES = sched_yield.c +sched_yield_OBJECTS = sched_yield.$(OBJEXT) +sched_yield_LDADD = $(LDADD) +sched_yield_DEPENDENCIES = libtests.a +scm_rights_SOURCES = scm_rights.c +scm_rights_OBJECTS = scm_rights.$(OBJEXT) +scm_rights_LDADD = $(LDADD) +scm_rights_DEPENDENCIES = libtests.a +seccomp_filter_SOURCES = seccomp-filter.c +seccomp_filter_OBJECTS = seccomp-filter.$(OBJEXT) +seccomp_filter_LDADD = $(LDADD) +seccomp_filter_DEPENDENCIES = libtests.a +seccomp_filter_v_SOURCES = seccomp-filter-v.c +seccomp_filter_v_OBJECTS = seccomp-filter-v.$(OBJEXT) +seccomp_filter_v_LDADD = $(LDADD) +seccomp_filter_v_DEPENDENCIES = libtests.a +seccomp_strict_SOURCES = seccomp-strict.c +seccomp_strict_OBJECTS = seccomp-strict.$(OBJEXT) +seccomp_strict_LDADD = $(LDADD) +seccomp_strict_DEPENDENCIES = libtests.a +select_SOURCES = select.c +select_OBJECTS = select.$(OBJEXT) +select_LDADD = $(LDADD) +select_DEPENDENCIES = libtests.a +semop_SOURCES = semop.c +semop_OBJECTS = semop.$(OBJEXT) +semop_LDADD = $(LDADD) +semop_DEPENDENCIES = libtests.a +sendfile_SOURCES = sendfile.c +sendfile_OBJECTS = sendfile.$(OBJEXT) +sendfile_LDADD = $(LDADD) +sendfile_DEPENDENCIES = libtests.a +sendfile64_SOURCES = sendfile64.c +sendfile64_OBJECTS = sendfile64.$(OBJEXT) +sendfile64_LDADD = $(LDADD) +sendfile64_DEPENDENCIES = libtests.a +set_mempolicy_SOURCES = set_mempolicy.c +set_mempolicy_OBJECTS = set_mempolicy.$(OBJEXT) +set_mempolicy_LDADD = $(LDADD) +set_mempolicy_DEPENDENCIES = libtests.a +set_ptracer_any_SOURCES = set_ptracer_any.c +set_ptracer_any_OBJECTS = set_ptracer_any.$(OBJEXT) +set_ptracer_any_LDADD = $(LDADD) +set_ptracer_any_DEPENDENCIES = libtests.a +setdomainname_SOURCES = setdomainname.c +setdomainname_OBJECTS = setdomainname.$(OBJEXT) +setdomainname_LDADD = $(LDADD) +setdomainname_DEPENDENCIES = libtests.a +setfsgid_SOURCES = setfsgid.c +setfsgid_OBJECTS = setfsgid.$(OBJEXT) +setfsgid_LDADD = $(LDADD) +setfsgid_DEPENDENCIES = libtests.a +setfsgid32_SOURCES = setfsgid32.c +setfsgid32_OBJECTS = setfsgid32.$(OBJEXT) +setfsgid32_LDADD = $(LDADD) +setfsgid32_DEPENDENCIES = libtests.a +setfsuid_SOURCES = setfsuid.c +setfsuid_OBJECTS = setfsuid.$(OBJEXT) +setfsuid_LDADD = $(LDADD) +setfsuid_DEPENDENCIES = libtests.a +setfsuid32_SOURCES = setfsuid32.c +setfsuid32_OBJECTS = setfsuid32.$(OBJEXT) +setfsuid32_LDADD = $(LDADD) +setfsuid32_DEPENDENCIES = libtests.a +setgid_SOURCES = setgid.c +setgid_OBJECTS = setgid.$(OBJEXT) +setgid_LDADD = $(LDADD) +setgid_DEPENDENCIES = libtests.a +setgid32_SOURCES = setgid32.c +setgid32_OBJECTS = setgid32.$(OBJEXT) +setgid32_LDADD = $(LDADD) +setgid32_DEPENDENCIES = libtests.a +setgroups_SOURCES = setgroups.c +setgroups_OBJECTS = setgroups.$(OBJEXT) +setgroups_LDADD = $(LDADD) +setgroups_DEPENDENCIES = libtests.a +setgroups32_SOURCES = setgroups32.c +setgroups32_OBJECTS = setgroups32.$(OBJEXT) +setgroups32_LDADD = $(LDADD) +setgroups32_DEPENDENCIES = libtests.a +sethostname_SOURCES = sethostname.c +sethostname_OBJECTS = sethostname.$(OBJEXT) +sethostname_LDADD = $(LDADD) +sethostname_DEPENDENCIES = libtests.a +setns_SOURCES = setns.c +setns_OBJECTS = setns.$(OBJEXT) +setns_LDADD = $(LDADD) +setns_DEPENDENCIES = libtests.a +setregid_SOURCES = setregid.c +setregid_OBJECTS = setregid.$(OBJEXT) +setregid_LDADD = $(LDADD) +setregid_DEPENDENCIES = libtests.a +setregid32_SOURCES = setregid32.c +setregid32_OBJECTS = setregid32.$(OBJEXT) +setregid32_LDADD = $(LDADD) +setregid32_DEPENDENCIES = libtests.a +setresgid_SOURCES = setresgid.c +setresgid_OBJECTS = setresgid.$(OBJEXT) +setresgid_LDADD = $(LDADD) +setresgid_DEPENDENCIES = libtests.a +setresgid32_SOURCES = setresgid32.c +setresgid32_OBJECTS = setresgid32.$(OBJEXT) +setresgid32_LDADD = $(LDADD) +setresgid32_DEPENDENCIES = libtests.a +setresuid_SOURCES = setresuid.c +setresuid_OBJECTS = setresuid.$(OBJEXT) +setresuid_LDADD = $(LDADD) +setresuid_DEPENDENCIES = libtests.a +setresuid32_SOURCES = setresuid32.c +setresuid32_OBJECTS = setresuid32.$(OBJEXT) +setresuid32_LDADD = $(LDADD) +setresuid32_DEPENDENCIES = libtests.a +setreuid_SOURCES = setreuid.c +setreuid_OBJECTS = setreuid.$(OBJEXT) +setreuid_LDADD = $(LDADD) +setreuid_DEPENDENCIES = libtests.a +setreuid32_SOURCES = setreuid32.c +setreuid32_OBJECTS = setreuid32.$(OBJEXT) +setreuid32_LDADD = $(LDADD) +setreuid32_DEPENDENCIES = libtests.a +setrlimit_SOURCES = setrlimit.c +setrlimit_OBJECTS = setrlimit.$(OBJEXT) +setrlimit_LDADD = $(LDADD) +setrlimit_DEPENDENCIES = libtests.a +setuid_SOURCES = setuid.c +setuid_OBJECTS = setuid.$(OBJEXT) +setuid_LDADD = $(LDADD) +setuid_DEPENDENCIES = libtests.a +setuid32_SOURCES = setuid32.c +setuid32_OBJECTS = setuid32.$(OBJEXT) +setuid32_LDADD = $(LDADD) +setuid32_DEPENDENCIES = libtests.a +shmxt_SOURCES = shmxt.c +shmxt_OBJECTS = shmxt.$(OBJEXT) +shmxt_LDADD = $(LDADD) +shmxt_DEPENDENCIES = libtests.a +shutdown_SOURCES = shutdown.c +shutdown_OBJECTS = shutdown.$(OBJEXT) +shutdown_LDADD = $(LDADD) +shutdown_DEPENDENCIES = libtests.a +sigaction_SOURCES = sigaction.c +sigaction_OBJECTS = sigaction.$(OBJEXT) +sigaction_LDADD = $(LDADD) +sigaction_DEPENDENCIES = libtests.a +sigaltstack_SOURCES = sigaltstack.c +sigaltstack_OBJECTS = sigaltstack.$(OBJEXT) +sigaltstack_LDADD = $(LDADD) +sigaltstack_DEPENDENCIES = libtests.a +siginfo_SOURCES = siginfo.c +siginfo_OBJECTS = siginfo.$(OBJEXT) +siginfo_LDADD = $(LDADD) +siginfo_DEPENDENCIES = libtests.a +signal_receive_SOURCES = signal_receive.c +signal_receive_OBJECTS = signal_receive.$(OBJEXT) +signal_receive_LDADD = $(LDADD) +signal_receive_DEPENDENCIES = libtests.a +signalfd4_SOURCES = signalfd4.c +signalfd4_OBJECTS = signalfd4.$(OBJEXT) +signalfd4_LDADD = $(LDADD) +signalfd4_DEPENDENCIES = libtests.a +sigreturn_SOURCES = sigreturn.c +sigreturn_OBJECTS = sigreturn.$(OBJEXT) +sigreturn_LDADD = $(LDADD) +sigreturn_DEPENDENCIES = libtests.a +sleep_SOURCES = sleep.c +sleep_OBJECTS = sleep.$(OBJEXT) +sleep_LDADD = $(LDADD) +sleep_DEPENDENCIES = libtests.a +socketcall_SOURCES = socketcall.c +socketcall_OBJECTS = socketcall.$(OBJEXT) +socketcall_LDADD = $(LDADD) +socketcall_DEPENDENCIES = libtests.a +splice_SOURCES = splice.c +splice_OBJECTS = splice.$(OBJEXT) +splice_LDADD = $(LDADD) +splice_DEPENDENCIES = libtests.a +am_stack_fcall_OBJECTS = stack-fcall.$(OBJEXT) stack-fcall-0.$(OBJEXT) \ + stack-fcall-1.$(OBJEXT) stack-fcall-2.$(OBJEXT) \ + stack-fcall-3.$(OBJEXT) +stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) +stack_fcall_LDADD = $(LDADD) +stack_fcall_DEPENDENCIES = libtests.a +stat_SOURCES = stat.c +stat_OBJECTS = stat.$(OBJEXT) +stat_LDADD = $(LDADD) +stat_DEPENDENCIES = libtests.a +stat64_SOURCES = stat64.c +stat64_OBJECTS = stat64-stat64.$(OBJEXT) +stat64_LDADD = $(LDADD) +stat64_DEPENDENCIES = libtests.a +statfs_SOURCES = statfs.c +statfs_OBJECTS = statfs-statfs.$(OBJEXT) +statfs_LDADD = $(LDADD) +statfs_DEPENDENCIES = libtests.a +statfs64_SOURCES = statfs64.c +statfs64_OBJECTS = statfs64.$(OBJEXT) +statfs64_LDADD = $(LDADD) +statfs64_DEPENDENCIES = libtests.a +swap_SOURCES = swap.c +swap_OBJECTS = swap.$(OBJEXT) +swap_LDADD = $(LDADD) +swap_DEPENDENCIES = libtests.a +symlink_SOURCES = symlink.c +symlink_OBJECTS = symlink.$(OBJEXT) +symlink_LDADD = $(LDADD) +symlink_DEPENDENCIES = libtests.a +symlinkat_SOURCES = symlinkat.c +symlinkat_OBJECTS = symlinkat.$(OBJEXT) +symlinkat_LDADD = $(LDADD) +symlinkat_DEPENDENCIES = libtests.a +sync_SOURCES = sync.c +sync_OBJECTS = sync.$(OBJEXT) +sync_LDADD = $(LDADD) +sync_DEPENDENCIES = libtests.a +sync_file_range_SOURCES = sync_file_range.c +sync_file_range_OBJECTS = sync_file_range.$(OBJEXT) +sync_file_range_LDADD = $(LDADD) +sync_file_range_DEPENDENCIES = libtests.a +sync_file_range2_SOURCES = sync_file_range2.c +sync_file_range2_OBJECTS = sync_file_range2.$(OBJEXT) +sync_file_range2_LDADD = $(LDADD) +sync_file_range2_DEPENDENCIES = libtests.a +sysinfo_SOURCES = sysinfo.c +sysinfo_OBJECTS = sysinfo.$(OBJEXT) +sysinfo_LDADD = $(LDADD) +sysinfo_DEPENDENCIES = libtests.a +syslog_SOURCES = syslog.c +syslog_OBJECTS = syslog.$(OBJEXT) +syslog_LDADD = $(LDADD) +syslog_DEPENDENCIES = libtests.a +tee_SOURCES = tee.c +tee_OBJECTS = tee.$(OBJEXT) +tee_LDADD = $(LDADD) +tee_DEPENDENCIES = libtests.a +threads_execve_SOURCES = threads-execve.c +threads_execve_OBJECTS = threads-execve.$(OBJEXT) +threads_execve_DEPENDENCIES = $(LDADD) +time_SOURCES = time.c +time_OBJECTS = time.$(OBJEXT) +time_LDADD = $(LDADD) +time_DEPENDENCIES = libtests.a +timer_create_SOURCES = timer_create.c +timer_create_OBJECTS = timer_create.$(OBJEXT) +timer_create_LDADD = $(LDADD) +timer_create_DEPENDENCIES = libtests.a +timer_xettime_SOURCES = timer_xettime.c +timer_xettime_OBJECTS = timer_xettime.$(OBJEXT) +timer_xettime_LDADD = $(LDADD) +timer_xettime_DEPENDENCIES = libtests.a +timerfd_xettime_SOURCES = timerfd_xettime.c +timerfd_xettime_OBJECTS = timerfd_xettime.$(OBJEXT) +timerfd_xettime_LDADD = $(LDADD) +timerfd_xettime_DEPENDENCIES = libtests.a +times_SOURCES = times.c +times_OBJECTS = times.$(OBJEXT) +times_DEPENDENCIES = $(LDADD) +times_fail_SOURCES = times-fail.c +times_fail_OBJECTS = times-fail.$(OBJEXT) +times_fail_LDADD = $(LDADD) +times_fail_DEPENDENCIES = libtests.a +truncate_SOURCES = truncate.c +truncate_OBJECTS = truncate.$(OBJEXT) +truncate_LDADD = $(LDADD) +truncate_DEPENDENCIES = libtests.a +truncate64_SOURCES = truncate64.c +truncate64_OBJECTS = truncate64-truncate64.$(OBJEXT) +truncate64_LDADD = $(LDADD) +truncate64_DEPENDENCIES = libtests.a +ugetrlimit_SOURCES = ugetrlimit.c +ugetrlimit_OBJECTS = ugetrlimit.$(OBJEXT) +ugetrlimit_LDADD = $(LDADD) +ugetrlimit_DEPENDENCIES = libtests.a +uio_SOURCES = uio.c +uio_OBJECTS = uio-uio.$(OBJEXT) +uio_LDADD = $(LDADD) +uio_DEPENDENCIES = libtests.a +umask_SOURCES = umask.c +umask_OBJECTS = umask.$(OBJEXT) +umask_LDADD = $(LDADD) +umask_DEPENDENCIES = libtests.a +umount_SOURCES = umount.c +umount_OBJECTS = umount.$(OBJEXT) +umount_LDADD = $(LDADD) +umount_DEPENDENCIES = libtests.a +umount2_SOURCES = umount2.c +umount2_OBJECTS = umount2.$(OBJEXT) +umount2_LDADD = $(LDADD) +umount2_DEPENDENCIES = libtests.a +umoven_illptr_SOURCES = umoven-illptr.c +umoven_illptr_OBJECTS = umoven-illptr.$(OBJEXT) +umoven_illptr_LDADD = $(LDADD) +umoven_illptr_DEPENDENCIES = libtests.a +umovestr_SOURCES = umovestr.c +umovestr_OBJECTS = umovestr.$(OBJEXT) +umovestr_LDADD = $(LDADD) +umovestr_DEPENDENCIES = libtests.a +umovestr_illptr_SOURCES = umovestr-illptr.c +umovestr_illptr_OBJECTS = umovestr-illptr.$(OBJEXT) +umovestr_illptr_LDADD = $(LDADD) +umovestr_illptr_DEPENDENCIES = libtests.a +umovestr2_SOURCES = umovestr2.c +umovestr2_OBJECTS = umovestr2.$(OBJEXT) +umovestr2_LDADD = $(LDADD) +umovestr2_DEPENDENCIES = libtests.a +umovestr3_SOURCES = umovestr3.c +umovestr3_OBJECTS = umovestr3.$(OBJEXT) +umovestr3_LDADD = $(LDADD) +umovestr3_DEPENDENCIES = libtests.a +uname_SOURCES = uname.c +uname_OBJECTS = uname.$(OBJEXT) +uname_LDADD = $(LDADD) +uname_DEPENDENCIES = libtests.a +unix_pair_send_recv_SOURCES = unix-pair-send-recv.c +unix_pair_send_recv_OBJECTS = unix-pair-send-recv.$(OBJEXT) +unix_pair_send_recv_LDADD = $(LDADD) +unix_pair_send_recv_DEPENDENCIES = libtests.a +unix_pair_sendto_recvfrom_SOURCES = unix-pair-sendto-recvfrom.c +unix_pair_sendto_recvfrom_OBJECTS = \ + unix-pair-sendto-recvfrom.$(OBJEXT) +unix_pair_sendto_recvfrom_LDADD = $(LDADD) +unix_pair_sendto_recvfrom_DEPENDENCIES = libtests.a +unlink_SOURCES = unlink.c +unlink_OBJECTS = unlink.$(OBJEXT) +unlink_LDADD = $(LDADD) +unlink_DEPENDENCIES = libtests.a +unlinkat_SOURCES = unlinkat.c +unlinkat_OBJECTS = unlinkat.$(OBJEXT) +unlinkat_LDADD = $(LDADD) +unlinkat_DEPENDENCIES = libtests.a +unshare_SOURCES = unshare.c +unshare_OBJECTS = unshare.$(OBJEXT) +unshare_LDADD = $(LDADD) +unshare_DEPENDENCIES = libtests.a +userfaultfd_SOURCES = userfaultfd.c +userfaultfd_OBJECTS = userfaultfd.$(OBJEXT) +userfaultfd_LDADD = $(LDADD) +userfaultfd_DEPENDENCIES = libtests.a +ustat_SOURCES = ustat.c +ustat_OBJECTS = ustat.$(OBJEXT) +ustat_LDADD = $(LDADD) +ustat_DEPENDENCIES = libtests.a +utime_SOURCES = utime.c +utime_OBJECTS = utime.$(OBJEXT) +utime_LDADD = $(LDADD) +utime_DEPENDENCIES = libtests.a +utimensat_SOURCES = utimensat.c +utimensat_OBJECTS = utimensat.$(OBJEXT) +utimensat_LDADD = $(LDADD) +utimensat_DEPENDENCIES = libtests.a +utimes_SOURCES = utimes.c +utimes_OBJECTS = utimes.$(OBJEXT) +utimes_LDADD = $(LDADD) +utimes_DEPENDENCIES = libtests.a +vfork_f_SOURCES = vfork-f.c +vfork_f_OBJECTS = vfork-f.$(OBJEXT) +vfork_f_LDADD = $(LDADD) +vfork_f_DEPENDENCIES = libtests.a +vhangup_SOURCES = vhangup.c +vhangup_OBJECTS = vhangup.$(OBJEXT) +vhangup_LDADD = $(LDADD) +vhangup_DEPENDENCIES = libtests.a +vmsplice_SOURCES = vmsplice.c +vmsplice_OBJECTS = vmsplice.$(OBJEXT) +vmsplice_LDADD = $(LDADD) +vmsplice_DEPENDENCIES = libtests.a +wait4_SOURCES = wait4.c +wait4_OBJECTS = wait4.$(OBJEXT) +wait4_LDADD = $(LDADD) +wait4_DEPENDENCIES = libtests.a +wait4_v_SOURCES = wait4-v.c +wait4_v_OBJECTS = wait4-v.$(OBJEXT) +wait4_v_LDADD = $(LDADD) +wait4_v_DEPENDENCIES = libtests.a +waitid_SOURCES = waitid.c +waitid_OBJECTS = waitid.$(OBJEXT) +waitid_LDADD = $(LDADD) +waitid_DEPENDENCIES = libtests.a +waitid_v_SOURCES = waitid-v.c +waitid_v_OBJECTS = waitid-v.$(OBJEXT) +waitid_v_LDADD = $(LDADD) +waitid_v_DEPENDENCIES = libtests.a +waitpid_SOURCES = waitpid.c +waitpid_OBJECTS = waitpid.$(OBJEXT) +waitpid_LDADD = $(LDADD) +waitpid_DEPENDENCIES = libtests.a +xattr_SOURCES = xattr.c +xattr_OBJECTS = xattr.$(OBJEXT) +xattr_LDADD = $(LDADD) +xattr_DEPENDENCIES = libtests.a +xattr_strings_SOURCES = xattr-strings.c +xattr_strings_OBJECTS = xattr-strings.$(OBJEXT) +xattr_strings_LDADD = $(LDADD) +xattr_strings_DEPENDENCIES = libtests.a +xet_robust_list_SOURCES = xet_robust_list.c +xet_robust_list_OBJECTS = xet_robust_list.$(OBJEXT) +xet_robust_list_LDADD = $(LDADD) +xet_robust_list_DEPENDENCIES = libtests.a +xetitimer_SOURCES = xetitimer.c +xetitimer_OBJECTS = xetitimer.$(OBJEXT) +xetitimer_LDADD = $(LDADD) +xetitimer_DEPENDENCIES = libtests.a +xetpgid_SOURCES = xetpgid.c +xetpgid_OBJECTS = xetpgid.$(OBJEXT) +xetpgid_LDADD = $(LDADD) +xetpgid_DEPENDENCIES = libtests.a +xetpriority_SOURCES = xetpriority.c +xetpriority_OBJECTS = xetpriority.$(OBJEXT) +xetpriority_LDADD = $(LDADD) +xetpriority_DEPENDENCIES = libtests.a +xettimeofday_SOURCES = xettimeofday.c +xettimeofday_OBJECTS = xettimeofday.$(OBJEXT) +xettimeofday_LDADD = $(LDADD) +xettimeofday_DEPENDENCIES = libtests.a +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ + access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ + attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ + attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ + chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ + clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ + creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ + epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ + erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ + execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ + fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ + fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ + finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ + fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ + futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ + getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ + geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ + getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ + getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ + init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ + ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ + ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ + ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ + ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ + kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ + lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ + migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ + mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ + msg_control.c msg_control-v.c msg_name.c munlockall.c \ + nanosleep.c net-accept-connect.c net-icmp_filter.c \ + net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ + net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ + netlink_protocol.c netlink_unix_diag.c newfstatat.c \ + nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ + oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ + perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ + personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ + pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + prctl-dumpable.c prctl-name.c prctl-no-args.c \ + prctl-pdeathsig.c prctl-seccomp-filter-v.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ + prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ + preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ + process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + pwritev.c qual_fault.c qual_inject-error-signal.c \ + qual_inject-retval.c qual_inject-signal.c qual_signal.c \ + quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ + read-write.c readahead.c readdir.c readlink.c readlinkat.c \ + readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ + redirect-fds.c remap_file_pages.c rename.c renameat.c \ + renameat2.c request_key.c restart_syscall.c rmdir.c \ + rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + sched_get_priority_mxx.c sched_rr_get_interval.c \ + sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ + sched_xetscheduler.c sched_yield.c scm_rights.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ + semop.c sendfile.c sendfile64.c set_mempolicy.c \ + set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ + setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ + setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ + setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ + setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ + shutdown.c sigaction.c sigaltstack.c siginfo.c \ + signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ + splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ + statfs64.c swap.c symlink.c symlinkat.c sync.c \ + sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ + threads-execve.c time.c timer_create.c timer_xettime.c \ + timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ + ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ + umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ + unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ + utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ + waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ + xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c +DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ + access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ + attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ + attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ + chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ + clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ + creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ + epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ + erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ + execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ + fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ + fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ + finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ + fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ + futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ + getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ + geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ + getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ + getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ + init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ + ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ + ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ + ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ + ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ + kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ + lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ + migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ + mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ + msg_control.c msg_control-v.c msg_name.c munlockall.c \ + nanosleep.c net-accept-connect.c net-icmp_filter.c \ + net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ + net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ + netlink_protocol.c netlink_unix_diag.c newfstatat.c \ + nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ + oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ + perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ + personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ + pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + prctl-dumpable.c prctl-name.c prctl-no-args.c \ + prctl-pdeathsig.c prctl-seccomp-filter-v.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ + prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ + preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ + process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + pwritev.c qual_fault.c qual_inject-error-signal.c \ + qual_inject-retval.c qual_inject-signal.c qual_signal.c \ + quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ + read-write.c readahead.c readdir.c readlink.c readlinkat.c \ + readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ + redirect-fds.c remap_file_pages.c rename.c renameat.c \ + renameat2.c request_key.c restart_syscall.c rmdir.c \ + rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + sched_get_priority_mxx.c sched_rr_get_interval.c \ + sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ + sched_xetscheduler.c sched_yield.c scm_rights.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ + semop.c sendfile.c sendfile64.c set_mempolicy.c \ + set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ + setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ + setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ + setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ + setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ + shutdown.c sigaction.c sigaltstack.c siginfo.c \ + signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ + splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ + statfs64.c swap.c symlink.c symlinkat.c sync.c \ + sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ + threads-execve.c time.c timer_create.c timer_xettime.c \ + timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ + ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ + umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ + unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ + utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ + waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ + xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +@USE_LIBUNWIND_TRUE@am__EXEEXT_1 = strace-k.test +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CYGPATH_W = @CYGPATH_W@ +DEB_CHANGELOGTIME = @DEB_CHANGELOGTIME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +EXEEXT = @EXEEXT@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MIPS_ABI = @MIPS_ABI@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +RANLIB = @RANLIB@ +RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +arch = @arch@ +arch_m32 = @arch_m32@ +arch_mx32 = @arch_mx32@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +dl_LIBS = @dl_LIBS@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libunwind_CPPFLAGS = @libunwind_CPPFLAGS@ +libunwind_LDFLAGS = @libunwind_LDFLAGS@ +libunwind_LIBS = @libunwind_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +OS = linux +ARCH = @arch_mx32@ +MPERS_NAME = mx32 +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -mx32 +AM_CFLAGS = $(WARN_CFLAGS) +AM_CPPFLAGS = $(ARCH_MFLAGS) \ + -I$(builddir) \ + -I$(top_builddir)/$(OS)/$(ARCH) \ + -I$(top_srcdir)/$(OS)/$(ARCH) \ + -I$(top_builddir)/$(OS) \ + -I$(top_srcdir)/$(OS) \ + -I$(top_builddir) \ + -I$(top_srcdir) + +AM_LDFLAGS = $(ARCH_MFLAGS) +libtests_a_SOURCES = \ + errno2name.c \ + error_msg.c \ + fill_memory.c \ + get_page_size.c \ + hexdump_strdup.c \ + hexquote_strndup.c \ + inode_of_sockfd.c \ + libmmsg.c \ + libsocketcall.c \ + overflowuid.c \ + pipe_maxfd.c \ + print_quoted_string.c \ + printflags.c \ + printxval.c \ + signal2name.c \ + sprintrc.c \ + tail_alloc.c \ + tests.h \ + tprintf.c \ + # end of libtests_a_SOURCES + +libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +check_LIBRARIES = libtests.a +LDADD = libtests.a +attach_f_p_LDADD = -lrt -lpthread $(LDADD) +clock_xettime_LDADD = -lrt $(LDADD) +count_f_LDADD = -lpthread $(LDADD) +filter_unavailable_LDADD = -lpthread $(LDADD) +fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = -lrt $(LDADD) +mq_sendrecv_LDADD = -lrt $(LDADD) +mq_sendrecv_read_LDADD = -lrt $(LDADD) +mq_sendrecv_write_LDADD = -lrt $(LDADD) +newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pc_LDADD = $(dl_LIBS) $(LDADD) +pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +threads_execve_LDADD = -lrt -lpthread $(LDADD) +times_LDADD = -lrt $(LDADD) +truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + +@USE_LIBUNWIND_FALSE@LIBUNWIND_TESTS = +@USE_LIBUNWIND_TRUE@LIBUNWIND_TESTS = strace-k.test +DECODER_TESTS = \ + _newselect.test \ + accept.test \ + accept4.test \ + access.test \ + acct.test \ + add_key.test \ + adjtimex.test \ + aio.test \ + alarm.test \ + bpf.test \ + brk.test \ + btrfs-v.test \ + btrfs-vw.test \ + btrfs-w.test \ + btrfs.test \ + caps-abbrev.test \ + caps.test \ + chmod.test \ + chown.test \ + chown32.test \ + chroot.test \ + clock_adjtime.test \ + clock_nanosleep.test \ + clock_xettime.test \ + copy_file_range.test \ + creat.test \ + delete_module.test \ + dup.test \ + dup2.test \ + dup3.test \ + epoll_create.test \ + epoll_create1.test \ + epoll_ctl.test \ + epoll_pwait.test \ + epoll_wait.test \ + erestartsys.test \ + eventfd.test \ + execve-v.test \ + execve.test \ + execveat-v.test \ + execveat.test \ + faccessat.test \ + fadvise64.test \ + fadvise64_64.test \ + fallocate.test \ + fanotify_init.test \ + fanotify_mark.test \ + fchdir.test \ + fchmod.test \ + fchmodat.test \ + fchown.test \ + fchown32.test \ + fchownat.test \ + fcntl.test \ + fcntl64.test \ + fdatasync.test \ + file_handle.test \ + file_ioctl.test \ + finit_module.test \ + flock.test \ + fstat.test \ + fstat64.test \ + fstatat64.test \ + fstatfs.test \ + fstatfs64.test \ + fsync.test \ + ftruncate.test \ + ftruncate64.test \ + futex.test \ + futimesat.test \ + get_mempolicy.test \ + getcpu.test \ + getcwd.test \ + getdents.test \ + getdents64.test \ + getegid.test \ + getegid32.test \ + geteuid.test \ + geteuid32.test \ + getgid.test \ + getgid32.test \ + getgroups.test \ + getgroups32.test \ + getpeername.test \ + getpgrp.test \ + getrandom.test \ + getresgid.test \ + getresgid32.test \ + getresuid.test \ + getresuid32.test \ + getrlimit.test \ + getrusage.test \ + getsid.test \ + getsockname.test \ + getuid.test \ + getuid32.test \ + getxxid.test \ + inet-cmsg.test \ + init_module.test \ + inotify.test \ + inotify_init1.test \ + ioctl.test \ + ioctl_block.test \ + ioctl_dm-v.test \ + ioctl_dm.test \ + ioctl_evdev-v.test \ + ioctl_evdev.test \ + ioctl_loop-nv.test \ + ioctl_loop-v.test \ + ioctl_loop.test \ + ioctl_mtd.test \ + ioctl_rtc-v.test \ + ioctl_rtc.test \ + ioctl_scsi.test \ + ioctl_sg_io_v3.test \ + ioctl_sg_io_v4.test \ + ioctl_sock_gifconf.test \ + ioctl_uffdio.test \ + ioctl_v4l2.test \ + ioperm.test \ + iopl.test \ + ioprio.test \ + ip_mreq.test \ + ipc.test \ + ipc_msg.test \ + ipc_msgbuf.test \ + ipc_sem.test \ + ipc_shm.test \ + kcmp.test \ + kexec_file_load.test \ + kexec_load.test \ + keyctl.test \ + kill.test \ + lchown.test \ + lchown32.test \ + link.test \ + linkat.test \ + llseek.test \ + lookup_dcookie.test \ + lseek.test \ + lstat.test \ + lstat64.test \ + mbind.test \ + membarrier.test \ + memfd_create.test \ + migrate_pages.test \ + mincore.test \ + mkdir.test \ + mkdirat.test \ + mknod.test \ + mknodat.test \ + mlock.test \ + mlock2.test \ + mlockall.test \ + mmap.test \ + mmap64.test \ + mmsg-silent.test \ + mmsg.test \ + mmsg_name-v.test \ + mmsg_name.test \ + mount.test \ + move_pages.test \ + mq.test \ + mq_sendrecv-read.test \ + mq_sendrecv-write.test \ + mq_sendrecv.test \ + msg_control-v.test \ + msg_control.test \ + msg_name.test \ + munlockall.test \ + nanosleep.test \ + net-icmp_filter.test \ + net-sockaddr.test \ + net-y-unix.test \ + net-yy-inet.test \ + net-yy-netlink.test \ + net-yy-unix.test \ + net.test \ + netlink_protocol.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ + oldfstat.test \ + oldlstat.test \ + oldselect.test \ + oldstat.test \ + open.test \ + openat.test \ + pause.test \ + perf_event_open.test \ + perf_event_open_nonverbose.test \ + perf_event_open_unabbrev.test \ + personality.test \ + pipe.test \ + pipe2.test \ + pkey_alloc.test \ + pkey_free.test \ + pkey_mprotect.test \ + poll.test \ + ppoll.test \ + prctl-arg2-intptr.test \ + prctl-dumpable.test \ + prctl-name.test \ + prctl-no-args.test \ + prctl-pdeathsig.test \ + prctl-seccomp-filter-v.test \ + prctl-seccomp-strict.test \ + prctl-securebits.test \ + prctl-tid_address.test \ + prctl-tsc.test \ + pread64-pwrite64.test \ + preadv-pwritev.test \ + preadv.test \ + preadv2-pwritev2.test \ + printstr.test \ + prlimit64.test \ + process_vm_readv.test \ + process_vm_writev.test \ + pselect6.test \ + ptrace.test \ + pwritev.test \ + qual_fault-exit_group.test \ + quotactl-v.test \ + quotactl-xfs-v.test \ + quotactl-xfs.test \ + quotactl.test \ + read-write.test \ + readahead.test \ + readdir.test \ + readlink.test \ + readlinkat.test \ + readv.test \ + reboot.test \ + recvfrom.test \ + recvmmsg-timeout.test \ + recvmsg.test \ + remap_file_pages.test \ + rename.test \ + renameat.test \ + renameat2.test \ + request_key.test \ + rmdir.test \ + rt_sigpending.test \ + rt_sigprocmask.test \ + rt_sigqueueinfo.test \ + rt_sigsuspend.test \ + rt_sigtimedwait.test \ + rt_tgsigqueueinfo.test \ + sched_get_priority_mxx.test \ + sched_rr_get_interval.test \ + sched_xetaffinity.test \ + sched_xetattr.test \ + sched_xetparam.test \ + sched_xetscheduler.test \ + sched_yield.test \ + scm_rights-fd.test \ + seccomp-filter-v.test \ + seccomp-filter.test \ + seccomp-strict.test \ + select.test \ + semop.test \ + sendfile.test \ + sendfile64.test \ + set_mempolicy.test \ + setdomainname.test \ + setfsgid.test \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ + setgid.test \ + setgid32.test \ + setgroups.test \ + setgroups32.test \ + sethostname.test \ + setns.test \ + setregid.test \ + setregid32.test \ + setresgid.test \ + setresgid32.test \ + setresuid.test \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ + setrlimit.test \ + setuid.test \ + setuid32.test \ + shmxt.test \ + shutdown.test \ + sigaction.test \ + sigaltstack.test \ + siginfo.test \ + signalfd4.test \ + sigreturn.test \ + socketcall.test \ + splice.test \ + stat.test \ + stat64.test \ + statfs.test \ + statfs64.test \ + sun_path.test \ + swap.test \ + symlink.test \ + symlinkat.test \ + sync.test \ + sync_file_range.test \ + sync_file_range2.test \ + sysinfo.test \ + syslog.test \ + tee.test \ + time.test \ + timer_create.test \ + timer_xettime.test \ + timerfd_xettime.test \ + times-fail.test \ + times.test \ + truncate.test \ + truncate64.test \ + ugetrlimit.test \ + uio.test \ + umask.test \ + umount.test \ + umount2.test \ + umoven-illptr.test \ + umovestr-illptr.test \ + umovestr.test \ + umovestr2.test \ + umovestr3.test \ + uname.test \ + unix-pair-send-recv.test \ + unix-pair-sendto-recvfrom.test \ + unlink.test \ + unlinkat.test \ + unshare.test \ + userfaultfd.test \ + ustat.test \ + utime.test \ + utimensat.test \ + utimes.test \ + vhangup.test \ + vmsplice.test \ + wait4-v.test \ + wait4.test \ + waitid-v.test \ + waitid.test \ + waitpid.test \ + xattr-strings.test \ + xattr.test \ + xet_robust_list.test \ + xetitimer.test \ + xetpgid.test \ + xetpriority.test \ + xettimeofday.test \ + # end of DECODER_TESTS + +MISC_TESTS = \ + attach-f-p.test \ + attach-p-cmd.test \ + bexecve.test \ + count-f.test \ + count.test \ + detach-running.test \ + detach-sleeping.test \ + detach-stopped.test \ + filter-unavailable.test \ + fork-f.test \ + ksysent.test \ + opipe.test \ + options-syntax.test \ + pc.test \ + qual_fault-syntax.test \ + qual_fault.test \ + qual_inject-error-signal.test \ + qual_inject-retval.test \ + qual_inject-signal.test \ + qual_inject-syntax.test \ + qual_signal.test \ + qual_syscall.test \ + redirect-fds.test \ + redirect.test \ + restart_syscall.test \ + signal_receive.test \ + strace-C.test \ + strace-E.test \ + strace-S.test \ + strace-T.test \ + strace-V.test \ + strace-ff.test \ + strace-r.test \ + strace-t.test \ + strace-tt.test \ + strace-ttt.test \ + threads-execve.test \ + vfork-f.test \ + # end of MISC_TESTS + +XFAIL_TESTS_ = +XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +TEST_LOG_COMPILER = env +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +VALGRIND_FLAGS = --quiet +VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp +EXTRA_DIST = init.sh run.sh match.awk \ + caps-abbrev.awk \ + caps.awk \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + getresugid.c \ + init_delete_module.h \ + ipc.sh \ + ipc_msgbuf.expected \ + ksysent.sed \ + lstatx.c \ + net.expected \ + oldselect.expected \ + pipe.expected \ + ppoll-v.expected \ + ppoll.expected \ + process_vm_readv_writev.c \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + quotactl.h \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaction.awk \ + sigaltstack.expected \ + sockname.c \ + statfs.expected \ + statx.sh \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + struct_flock.c \ + sun_path.expected \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + $(TESTS) + +objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) +CLEANFILES = ksysent.h $(TESTS:=.tmp) syscallent.i scno.h +SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) + +digits = [[:digit:]][[:digit:]]* +al_nums = [[:alnum:]_][[:alnum:]_]* +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../scno.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests-mx32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tests-mx32/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(srcdir)/../scno.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkLIBRARIES: + -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) + +libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) + $(AM_V_at)-rm -f libtests.a + $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) + $(AM_V_at)$(RANLIB) libtests.a + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + +_newselect$(EXEEXT): $(_newselect_OBJECTS) $(_newselect_DEPENDENCIES) $(EXTRA__newselect_DEPENDENCIES) + @rm -f _newselect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(_newselect_OBJECTS) $(_newselect_LDADD) $(LIBS) + +accept$(EXEEXT): $(accept_OBJECTS) $(accept_DEPENDENCIES) $(EXTRA_accept_DEPENDENCIES) + @rm -f accept$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(accept_OBJECTS) $(accept_LDADD) $(LIBS) + +accept4$(EXEEXT): $(accept4_OBJECTS) $(accept4_DEPENDENCIES) $(EXTRA_accept4_DEPENDENCIES) + @rm -f accept4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(accept4_OBJECTS) $(accept4_LDADD) $(LIBS) + +access$(EXEEXT): $(access_OBJECTS) $(access_DEPENDENCIES) $(EXTRA_access_DEPENDENCIES) + @rm -f access$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(access_OBJECTS) $(access_LDADD) $(LIBS) + +acct$(EXEEXT): $(acct_OBJECTS) $(acct_DEPENDENCIES) $(EXTRA_acct_DEPENDENCIES) + @rm -f acct$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(acct_OBJECTS) $(acct_LDADD) $(LIBS) + +add_key$(EXEEXT): $(add_key_OBJECTS) $(add_key_DEPENDENCIES) $(EXTRA_add_key_DEPENDENCIES) + @rm -f add_key$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(add_key_OBJECTS) $(add_key_LDADD) $(LIBS) + +adjtimex$(EXEEXT): $(adjtimex_OBJECTS) $(adjtimex_DEPENDENCIES) $(EXTRA_adjtimex_DEPENDENCIES) + @rm -f adjtimex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(adjtimex_OBJECTS) $(adjtimex_LDADD) $(LIBS) + +aio$(EXEEXT): $(aio_OBJECTS) $(aio_DEPENDENCIES) $(EXTRA_aio_DEPENDENCIES) + @rm -f aio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aio_OBJECTS) $(aio_LDADD) $(LIBS) + +alarm$(EXEEXT): $(alarm_OBJECTS) $(alarm_DEPENDENCIES) $(EXTRA_alarm_DEPENDENCIES) + @rm -f alarm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(alarm_OBJECTS) $(alarm_LDADD) $(LIBS) + +answer$(EXEEXT): $(answer_OBJECTS) $(answer_DEPENDENCIES) $(EXTRA_answer_DEPENDENCIES) + @rm -f answer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(answer_OBJECTS) $(answer_LDADD) $(LIBS) + +attach-f-p$(EXEEXT): $(attach_f_p_OBJECTS) $(attach_f_p_DEPENDENCIES) $(EXTRA_attach_f_p_DEPENDENCIES) + @rm -f attach-f-p$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_f_p_OBJECTS) $(attach_f_p_LDADD) $(LIBS) + +attach-f-p-cmd$(EXEEXT): $(attach_f_p_cmd_OBJECTS) $(attach_f_p_cmd_DEPENDENCIES) $(EXTRA_attach_f_p_cmd_DEPENDENCIES) + @rm -f attach-f-p-cmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_f_p_cmd_OBJECTS) $(attach_f_p_cmd_LDADD) $(LIBS) + +attach-p-cmd-cmd$(EXEEXT): $(attach_p_cmd_cmd_OBJECTS) $(attach_p_cmd_cmd_DEPENDENCIES) $(EXTRA_attach_p_cmd_cmd_DEPENDENCIES) + @rm -f attach-p-cmd-cmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_p_cmd_cmd_OBJECTS) $(attach_p_cmd_cmd_LDADD) $(LIBS) + +attach-p-cmd-p$(EXEEXT): $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_DEPENDENCIES) $(EXTRA_attach_p_cmd_p_DEPENDENCIES) + @rm -f attach-p-cmd-p$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_LDADD) $(LIBS) + +bpf$(EXEEXT): $(bpf_OBJECTS) $(bpf_DEPENDENCIES) $(EXTRA_bpf_DEPENDENCIES) + @rm -f bpf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_OBJECTS) $(bpf_LDADD) $(LIBS) + +brk$(EXEEXT): $(brk_OBJECTS) $(brk_DEPENDENCIES) $(EXTRA_brk_DEPENDENCIES) + @rm -f brk$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(brk_OBJECTS) $(brk_LDADD) $(LIBS) + +btrfs$(EXEEXT): $(btrfs_OBJECTS) $(btrfs_DEPENDENCIES) $(EXTRA_btrfs_DEPENDENCIES) + @rm -f btrfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(btrfs_OBJECTS) $(btrfs_LDADD) $(LIBS) + +caps$(EXEEXT): $(caps_OBJECTS) $(caps_DEPENDENCIES) $(EXTRA_caps_DEPENDENCIES) + @rm -f caps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(caps_OBJECTS) $(caps_LDADD) $(LIBS) + +caps-abbrev$(EXEEXT): $(caps_abbrev_OBJECTS) $(caps_abbrev_DEPENDENCIES) $(EXTRA_caps_abbrev_DEPENDENCIES) + @rm -f caps-abbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(caps_abbrev_OBJECTS) $(caps_abbrev_LDADD) $(LIBS) + +chmod$(EXEEXT): $(chmod_OBJECTS) $(chmod_DEPENDENCIES) $(EXTRA_chmod_DEPENDENCIES) + @rm -f chmod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) + +chown$(EXEEXT): $(chown_OBJECTS) $(chown_DEPENDENCIES) $(EXTRA_chown_DEPENDENCIES) + @rm -f chown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chown_OBJECTS) $(chown_LDADD) $(LIBS) + +chown32$(EXEEXT): $(chown32_OBJECTS) $(chown32_DEPENDENCIES) $(EXTRA_chown32_DEPENDENCIES) + @rm -f chown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chown32_OBJECTS) $(chown32_LDADD) $(LIBS) + +chroot$(EXEEXT): $(chroot_OBJECTS) $(chroot_DEPENDENCIES) $(EXTRA_chroot_DEPENDENCIES) + @rm -f chroot$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chroot_OBJECTS) $(chroot_LDADD) $(LIBS) + +clock_adjtime$(EXEEXT): $(clock_adjtime_OBJECTS) $(clock_adjtime_DEPENDENCIES) $(EXTRA_clock_adjtime_DEPENDENCIES) + @rm -f clock_adjtime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_adjtime_OBJECTS) $(clock_adjtime_LDADD) $(LIBS) + +clock_nanosleep$(EXEEXT): $(clock_nanosleep_OBJECTS) $(clock_nanosleep_DEPENDENCIES) $(EXTRA_clock_nanosleep_DEPENDENCIES) + @rm -f clock_nanosleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_nanosleep_OBJECTS) $(clock_nanosleep_LDADD) $(LIBS) + +clock_xettime$(EXEEXT): $(clock_xettime_OBJECTS) $(clock_xettime_DEPENDENCIES) $(EXTRA_clock_xettime_DEPENDENCIES) + @rm -f clock_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_xettime_OBJECTS) $(clock_xettime_LDADD) $(LIBS) + +copy_file_range$(EXEEXT): $(copy_file_range_OBJECTS) $(copy_file_range_DEPENDENCIES) $(EXTRA_copy_file_range_DEPENDENCIES) + @rm -f copy_file_range$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(copy_file_range_OBJECTS) $(copy_file_range_LDADD) $(LIBS) + +count-f$(EXEEXT): $(count_f_OBJECTS) $(count_f_DEPENDENCIES) $(EXTRA_count_f_DEPENDENCIES) + @rm -f count-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(count_f_OBJECTS) $(count_f_LDADD) $(LIBS) + +creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIES) + @rm -f creat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS) + +delete_module$(EXEEXT): $(delete_module_OBJECTS) $(delete_module_DEPENDENCIES) $(EXTRA_delete_module_DEPENDENCIES) + @rm -f delete_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(delete_module_OBJECTS) $(delete_module_LDADD) $(LIBS) + +dup$(EXEEXT): $(dup_OBJECTS) $(dup_DEPENDENCIES) $(EXTRA_dup_DEPENDENCIES) + @rm -f dup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup_OBJECTS) $(dup_LDADD) $(LIBS) + +dup2$(EXEEXT): $(dup2_OBJECTS) $(dup2_DEPENDENCIES) $(EXTRA_dup2_DEPENDENCIES) + @rm -f dup2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup2_OBJECTS) $(dup2_LDADD) $(LIBS) + +dup3$(EXEEXT): $(dup3_OBJECTS) $(dup3_DEPENDENCIES) $(EXTRA_dup3_DEPENDENCIES) + @rm -f dup3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup3_OBJECTS) $(dup3_LDADD) $(LIBS) + +epoll_create$(EXEEXT): $(epoll_create_OBJECTS) $(epoll_create_DEPENDENCIES) $(EXTRA_epoll_create_DEPENDENCIES) + @rm -f epoll_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_create_OBJECTS) $(epoll_create_LDADD) $(LIBS) + +epoll_create1$(EXEEXT): $(epoll_create1_OBJECTS) $(epoll_create1_DEPENDENCIES) $(EXTRA_epoll_create1_DEPENDENCIES) + @rm -f epoll_create1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_create1_OBJECTS) $(epoll_create1_LDADD) $(LIBS) + +epoll_ctl$(EXEEXT): $(epoll_ctl_OBJECTS) $(epoll_ctl_DEPENDENCIES) $(EXTRA_epoll_ctl_DEPENDENCIES) + @rm -f epoll_ctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_ctl_OBJECTS) $(epoll_ctl_LDADD) $(LIBS) + +epoll_pwait$(EXEEXT): $(epoll_pwait_OBJECTS) $(epoll_pwait_DEPENDENCIES) $(EXTRA_epoll_pwait_DEPENDENCIES) + @rm -f epoll_pwait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_pwait_OBJECTS) $(epoll_pwait_LDADD) $(LIBS) + +epoll_wait$(EXEEXT): $(epoll_wait_OBJECTS) $(epoll_wait_DEPENDENCIES) $(EXTRA_epoll_wait_DEPENDENCIES) + @rm -f epoll_wait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_wait_OBJECTS) $(epoll_wait_LDADD) $(LIBS) + +erestartsys$(EXEEXT): $(erestartsys_OBJECTS) $(erestartsys_DEPENDENCIES) $(EXTRA_erestartsys_DEPENDENCIES) + @rm -f erestartsys$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(erestartsys_OBJECTS) $(erestartsys_LDADD) $(LIBS) + +eventfd$(EXEEXT): $(eventfd_OBJECTS) $(eventfd_DEPENDENCIES) $(EXTRA_eventfd_DEPENDENCIES) + @rm -f eventfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eventfd_OBJECTS) $(eventfd_LDADD) $(LIBS) + +execve$(EXEEXT): $(execve_OBJECTS) $(execve_DEPENDENCIES) $(EXTRA_execve_DEPENDENCIES) + @rm -f execve$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execve_OBJECTS) $(execve_LDADD) $(LIBS) + +execve-v$(EXEEXT): $(execve_v_OBJECTS) $(execve_v_DEPENDENCIES) $(EXTRA_execve_v_DEPENDENCIES) + @rm -f execve-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execve_v_OBJECTS) $(execve_v_LDADD) $(LIBS) + +execveat$(EXEEXT): $(execveat_OBJECTS) $(execveat_DEPENDENCIES) $(EXTRA_execveat_DEPENDENCIES) + @rm -f execveat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execveat_OBJECTS) $(execveat_LDADD) $(LIBS) + +execveat-v$(EXEEXT): $(execveat_v_OBJECTS) $(execveat_v_DEPENDENCIES) $(EXTRA_execveat_v_DEPENDENCIES) + @rm -f execveat-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execveat_v_OBJECTS) $(execveat_v_LDADD) $(LIBS) + +faccessat$(EXEEXT): $(faccessat_OBJECTS) $(faccessat_DEPENDENCIES) $(EXTRA_faccessat_DEPENDENCIES) + @rm -f faccessat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(faccessat_OBJECTS) $(faccessat_LDADD) $(LIBS) + +fadvise64$(EXEEXT): $(fadvise64_OBJECTS) $(fadvise64_DEPENDENCIES) $(EXTRA_fadvise64_DEPENDENCIES) + @rm -f fadvise64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fadvise64_OBJECTS) $(fadvise64_LDADD) $(LIBS) + +fadvise64_64$(EXEEXT): $(fadvise64_64_OBJECTS) $(fadvise64_64_DEPENDENCIES) $(EXTRA_fadvise64_64_DEPENDENCIES) + @rm -f fadvise64_64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fadvise64_64_OBJECTS) $(fadvise64_64_LDADD) $(LIBS) + +fallocate$(EXEEXT): $(fallocate_OBJECTS) $(fallocate_DEPENDENCIES) $(EXTRA_fallocate_DEPENDENCIES) + @rm -f fallocate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fallocate_OBJECTS) $(fallocate_LDADD) $(LIBS) + +fanotify_init$(EXEEXT): $(fanotify_init_OBJECTS) $(fanotify_init_DEPENDENCIES) $(EXTRA_fanotify_init_DEPENDENCIES) + @rm -f fanotify_init$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_init_OBJECTS) $(fanotify_init_LDADD) $(LIBS) + +fanotify_mark$(EXEEXT): $(fanotify_mark_OBJECTS) $(fanotify_mark_DEPENDENCIES) $(EXTRA_fanotify_mark_DEPENDENCIES) + @rm -f fanotify_mark$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_OBJECTS) $(fanotify_mark_LDADD) $(LIBS) + +fchdir$(EXEEXT): $(fchdir_OBJECTS) $(fchdir_DEPENDENCIES) $(EXTRA_fchdir_DEPENDENCIES) + @rm -f fchdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchdir_OBJECTS) $(fchdir_LDADD) $(LIBS) + +fchmod$(EXEEXT): $(fchmod_OBJECTS) $(fchmod_DEPENDENCIES) $(EXTRA_fchmod_DEPENDENCIES) + @rm -f fchmod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchmod_OBJECTS) $(fchmod_LDADD) $(LIBS) + +fchmodat$(EXEEXT): $(fchmodat_OBJECTS) $(fchmodat_DEPENDENCIES) $(EXTRA_fchmodat_DEPENDENCIES) + @rm -f fchmodat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchmodat_OBJECTS) $(fchmodat_LDADD) $(LIBS) + +fchown$(EXEEXT): $(fchown_OBJECTS) $(fchown_DEPENDENCIES) $(EXTRA_fchown_DEPENDENCIES) + @rm -f fchown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchown_OBJECTS) $(fchown_LDADD) $(LIBS) + +fchown32$(EXEEXT): $(fchown32_OBJECTS) $(fchown32_DEPENDENCIES) $(EXTRA_fchown32_DEPENDENCIES) + @rm -f fchown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchown32_OBJECTS) $(fchown32_LDADD) $(LIBS) + +fchownat$(EXEEXT): $(fchownat_OBJECTS) $(fchownat_DEPENDENCIES) $(EXTRA_fchownat_DEPENDENCIES) + @rm -f fchownat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchownat_OBJECTS) $(fchownat_LDADD) $(LIBS) + +fcntl$(EXEEXT): $(fcntl_OBJECTS) $(fcntl_DEPENDENCIES) $(EXTRA_fcntl_DEPENDENCIES) + @rm -f fcntl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fcntl_OBJECTS) $(fcntl_LDADD) $(LIBS) + +fcntl64$(EXEEXT): $(fcntl64_OBJECTS) $(fcntl64_DEPENDENCIES) $(EXTRA_fcntl64_DEPENDENCIES) + @rm -f fcntl64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fcntl64_OBJECTS) $(fcntl64_LDADD) $(LIBS) + +fdatasync$(EXEEXT): $(fdatasync_OBJECTS) $(fdatasync_DEPENDENCIES) $(EXTRA_fdatasync_DEPENDENCIES) + @rm -f fdatasync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fdatasync_OBJECTS) $(fdatasync_LDADD) $(LIBS) + +file_handle$(EXEEXT): $(file_handle_OBJECTS) $(file_handle_DEPENDENCIES) $(EXTRA_file_handle_DEPENDENCIES) + @rm -f file_handle$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_handle_OBJECTS) $(file_handle_LDADD) $(LIBS) + +file_ioctl$(EXEEXT): $(file_ioctl_OBJECTS) $(file_ioctl_DEPENDENCIES) $(EXTRA_file_ioctl_DEPENDENCIES) + @rm -f file_ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_ioctl_OBJECTS) $(file_ioctl_LDADD) $(LIBS) + +filter-unavailable$(EXEEXT): $(filter_unavailable_OBJECTS) $(filter_unavailable_DEPENDENCIES) $(EXTRA_filter_unavailable_DEPENDENCIES) + @rm -f filter-unavailable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(filter_unavailable_OBJECTS) $(filter_unavailable_LDADD) $(LIBS) + +finit_module$(EXEEXT): $(finit_module_OBJECTS) $(finit_module_DEPENDENCIES) $(EXTRA_finit_module_DEPENDENCIES) + @rm -f finit_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(finit_module_OBJECTS) $(finit_module_LDADD) $(LIBS) + +flock$(EXEEXT): $(flock_OBJECTS) $(flock_DEPENDENCIES) $(EXTRA_flock_DEPENDENCIES) + @rm -f flock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(flock_OBJECTS) $(flock_LDADD) $(LIBS) + +fork-f$(EXEEXT): $(fork_f_OBJECTS) $(fork_f_DEPENDENCIES) $(EXTRA_fork_f_DEPENDENCIES) + @rm -f fork-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fork_f_OBJECTS) $(fork_f_LDADD) $(LIBS) + +fstat$(EXEEXT): $(fstat_OBJECTS) $(fstat_DEPENDENCIES) $(EXTRA_fstat_DEPENDENCIES) + @rm -f fstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_OBJECTS) $(fstat_LDADD) $(LIBS) + +fstat64$(EXEEXT): $(fstat64_OBJECTS) $(fstat64_DEPENDENCIES) $(EXTRA_fstat64_DEPENDENCIES) + @rm -f fstat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_OBJECTS) $(fstat64_LDADD) $(LIBS) + +fstatat64$(EXEEXT): $(fstatat64_OBJECTS) $(fstatat64_DEPENDENCIES) $(EXTRA_fstatat64_DEPENDENCIES) + @rm -f fstatat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatat64_OBJECTS) $(fstatat64_LDADD) $(LIBS) + +fstatfs$(EXEEXT): $(fstatfs_OBJECTS) $(fstatfs_DEPENDENCIES) $(EXTRA_fstatfs_DEPENDENCIES) + @rm -f fstatfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatfs_OBJECTS) $(fstatfs_LDADD) $(LIBS) + +fstatfs64$(EXEEXT): $(fstatfs64_OBJECTS) $(fstatfs64_DEPENDENCIES) $(EXTRA_fstatfs64_DEPENDENCIES) + @rm -f fstatfs64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatfs64_OBJECTS) $(fstatfs64_LDADD) $(LIBS) + +fsync$(EXEEXT): $(fsync_OBJECTS) $(fsync_DEPENDENCIES) $(EXTRA_fsync_DEPENDENCIES) + @rm -f fsync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fsync_OBJECTS) $(fsync_LDADD) $(LIBS) + +ftruncate$(EXEEXT): $(ftruncate_OBJECTS) $(ftruncate_DEPENDENCIES) $(EXTRA_ftruncate_DEPENDENCIES) + @rm -f ftruncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ftruncate_OBJECTS) $(ftruncate_LDADD) $(LIBS) + +ftruncate64$(EXEEXT): $(ftruncate64_OBJECTS) $(ftruncate64_DEPENDENCIES) $(EXTRA_ftruncate64_DEPENDENCIES) + @rm -f ftruncate64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ftruncate64_OBJECTS) $(ftruncate64_LDADD) $(LIBS) + +futex$(EXEEXT): $(futex_OBJECTS) $(futex_DEPENDENCIES) $(EXTRA_futex_DEPENDENCIES) + @rm -f futex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(futex_OBJECTS) $(futex_LDADD) $(LIBS) + +futimesat$(EXEEXT): $(futimesat_OBJECTS) $(futimesat_DEPENDENCIES) $(EXTRA_futimesat_DEPENDENCIES) + @rm -f futimesat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(futimesat_OBJECTS) $(futimesat_LDADD) $(LIBS) + +get_mempolicy$(EXEEXT): $(get_mempolicy_OBJECTS) $(get_mempolicy_DEPENDENCIES) $(EXTRA_get_mempolicy_DEPENDENCIES) + @rm -f get_mempolicy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(get_mempolicy_OBJECTS) $(get_mempolicy_LDADD) $(LIBS) + +getcpu$(EXEEXT): $(getcpu_OBJECTS) $(getcpu_DEPENDENCIES) $(EXTRA_getcpu_DEPENDENCIES) + @rm -f getcpu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getcpu_OBJECTS) $(getcpu_LDADD) $(LIBS) + +getcwd$(EXEEXT): $(getcwd_OBJECTS) $(getcwd_DEPENDENCIES) $(EXTRA_getcwd_DEPENDENCIES) + @rm -f getcwd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getcwd_OBJECTS) $(getcwd_LDADD) $(LIBS) + +getdents$(EXEEXT): $(getdents_OBJECTS) $(getdents_DEPENDENCIES) $(EXTRA_getdents_DEPENDENCIES) + @rm -f getdents$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getdents_OBJECTS) $(getdents_LDADD) $(LIBS) + +getdents64$(EXEEXT): $(getdents64_OBJECTS) $(getdents64_DEPENDENCIES) $(EXTRA_getdents64_DEPENDENCIES) + @rm -f getdents64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getdents64_OBJECTS) $(getdents64_LDADD) $(LIBS) + +getegid$(EXEEXT): $(getegid_OBJECTS) $(getegid_DEPENDENCIES) $(EXTRA_getegid_DEPENDENCIES) + @rm -f getegid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getegid_OBJECTS) $(getegid_LDADD) $(LIBS) + +getegid32$(EXEEXT): $(getegid32_OBJECTS) $(getegid32_DEPENDENCIES) $(EXTRA_getegid32_DEPENDENCIES) + @rm -f getegid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getegid32_OBJECTS) $(getegid32_LDADD) $(LIBS) + +geteuid$(EXEEXT): $(geteuid_OBJECTS) $(geteuid_DEPENDENCIES) $(EXTRA_geteuid_DEPENDENCIES) + @rm -f geteuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(geteuid_OBJECTS) $(geteuid_LDADD) $(LIBS) + +geteuid32$(EXEEXT): $(geteuid32_OBJECTS) $(geteuid32_DEPENDENCIES) $(EXTRA_geteuid32_DEPENDENCIES) + @rm -f geteuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(geteuid32_OBJECTS) $(geteuid32_LDADD) $(LIBS) + +getgid$(EXEEXT): $(getgid_OBJECTS) $(getgid_DEPENDENCIES) $(EXTRA_getgid_DEPENDENCIES) + @rm -f getgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgid_OBJECTS) $(getgid_LDADD) $(LIBS) + +getgid32$(EXEEXT): $(getgid32_OBJECTS) $(getgid32_DEPENDENCIES) $(EXTRA_getgid32_DEPENDENCIES) + @rm -f getgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgid32_OBJECTS) $(getgid32_LDADD) $(LIBS) + +getgroups$(EXEEXT): $(getgroups_OBJECTS) $(getgroups_DEPENDENCIES) $(EXTRA_getgroups_DEPENDENCIES) + @rm -f getgroups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgroups_OBJECTS) $(getgroups_LDADD) $(LIBS) + +getgroups32$(EXEEXT): $(getgroups32_OBJECTS) $(getgroups32_DEPENDENCIES) $(EXTRA_getgroups32_DEPENDENCIES) + @rm -f getgroups32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgroups32_OBJECTS) $(getgroups32_LDADD) $(LIBS) + +getpeername$(EXEEXT): $(getpeername_OBJECTS) $(getpeername_DEPENDENCIES) $(EXTRA_getpeername_DEPENDENCIES) + @rm -f getpeername$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpeername_OBJECTS) $(getpeername_LDADD) $(LIBS) + +getpgrp$(EXEEXT): $(getpgrp_OBJECTS) $(getpgrp_DEPENDENCIES) $(EXTRA_getpgrp_DEPENDENCIES) + @rm -f getpgrp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpgrp_OBJECTS) $(getpgrp_LDADD) $(LIBS) + +getrandom$(EXEEXT): $(getrandom_OBJECTS) $(getrandom_DEPENDENCIES) $(EXTRA_getrandom_DEPENDENCIES) + @rm -f getrandom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrandom_OBJECTS) $(getrandom_LDADD) $(LIBS) + +getresgid$(EXEEXT): $(getresgid_OBJECTS) $(getresgid_DEPENDENCIES) $(EXTRA_getresgid_DEPENDENCIES) + @rm -f getresgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresgid_OBJECTS) $(getresgid_LDADD) $(LIBS) + +getresgid32$(EXEEXT): $(getresgid32_OBJECTS) $(getresgid32_DEPENDENCIES) $(EXTRA_getresgid32_DEPENDENCIES) + @rm -f getresgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresgid32_OBJECTS) $(getresgid32_LDADD) $(LIBS) + +getresuid$(EXEEXT): $(getresuid_OBJECTS) $(getresuid_DEPENDENCIES) $(EXTRA_getresuid_DEPENDENCIES) + @rm -f getresuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresuid_OBJECTS) $(getresuid_LDADD) $(LIBS) + +getresuid32$(EXEEXT): $(getresuid32_OBJECTS) $(getresuid32_DEPENDENCIES) $(EXTRA_getresuid32_DEPENDENCIES) + @rm -f getresuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresuid32_OBJECTS) $(getresuid32_LDADD) $(LIBS) + +getrlimit$(EXEEXT): $(getrlimit_OBJECTS) $(getrlimit_DEPENDENCIES) $(EXTRA_getrlimit_DEPENDENCIES) + @rm -f getrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrlimit_OBJECTS) $(getrlimit_LDADD) $(LIBS) + +getrusage$(EXEEXT): $(getrusage_OBJECTS) $(getrusage_DEPENDENCIES) $(EXTRA_getrusage_DEPENDENCIES) + @rm -f getrusage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrusage_OBJECTS) $(getrusage_LDADD) $(LIBS) + +getsid$(EXEEXT): $(getsid_OBJECTS) $(getsid_DEPENDENCIES) $(EXTRA_getsid_DEPENDENCIES) + @rm -f getsid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getsid_OBJECTS) $(getsid_LDADD) $(LIBS) + +getsockname$(EXEEXT): $(getsockname_OBJECTS) $(getsockname_DEPENDENCIES) $(EXTRA_getsockname_DEPENDENCIES) + @rm -f getsockname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getsockname_OBJECTS) $(getsockname_LDADD) $(LIBS) + +getuid$(EXEEXT): $(getuid_OBJECTS) $(getuid_DEPENDENCIES) $(EXTRA_getuid_DEPENDENCIES) + @rm -f getuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getuid_OBJECTS) $(getuid_LDADD) $(LIBS) + +getuid32$(EXEEXT): $(getuid32_OBJECTS) $(getuid32_DEPENDENCIES) $(EXTRA_getuid32_DEPENDENCIES) + @rm -f getuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getuid32_OBJECTS) $(getuid32_LDADD) $(LIBS) + +getxxid$(EXEEXT): $(getxxid_OBJECTS) $(getxxid_DEPENDENCIES) $(EXTRA_getxxid_DEPENDENCIES) + @rm -f getxxid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getxxid_OBJECTS) $(getxxid_LDADD) $(LIBS) + +inet-cmsg$(EXEEXT): $(inet_cmsg_OBJECTS) $(inet_cmsg_DEPENDENCIES) $(EXTRA_inet_cmsg_DEPENDENCIES) + @rm -f inet-cmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inet_cmsg_OBJECTS) $(inet_cmsg_LDADD) $(LIBS) + +init_module$(EXEEXT): $(init_module_OBJECTS) $(init_module_DEPENDENCIES) $(EXTRA_init_module_DEPENDENCIES) + @rm -f init_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(init_module_OBJECTS) $(init_module_LDADD) $(LIBS) + +inotify$(EXEEXT): $(inotify_OBJECTS) $(inotify_DEPENDENCIES) $(EXTRA_inotify_DEPENDENCIES) + @rm -f inotify$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inotify_OBJECTS) $(inotify_LDADD) $(LIBS) + +inotify_init1$(EXEEXT): $(inotify_init1_OBJECTS) $(inotify_init1_DEPENDENCIES) $(EXTRA_inotify_init1_DEPENDENCIES) + @rm -f inotify_init1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inotify_init1_OBJECTS) $(inotify_init1_LDADD) $(LIBS) + +ioctl$(EXEEXT): $(ioctl_OBJECTS) $(ioctl_DEPENDENCIES) $(EXTRA_ioctl_DEPENDENCIES) + @rm -f ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_OBJECTS) $(ioctl_LDADD) $(LIBS) + +ioctl_block$(EXEEXT): $(ioctl_block_OBJECTS) $(ioctl_block_DEPENDENCIES) $(EXTRA_ioctl_block_DEPENDENCIES) + @rm -f ioctl_block$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_block_OBJECTS) $(ioctl_block_LDADD) $(LIBS) + +ioctl_dm$(EXEEXT): $(ioctl_dm_OBJECTS) $(ioctl_dm_DEPENDENCIES) $(EXTRA_ioctl_dm_DEPENDENCIES) + @rm -f ioctl_dm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_dm_OBJECTS) $(ioctl_dm_LDADD) $(LIBS) + +ioctl_dm-v$(EXEEXT): $(ioctl_dm_v_OBJECTS) $(ioctl_dm_v_DEPENDENCIES) $(EXTRA_ioctl_dm_v_DEPENDENCIES) + @rm -f ioctl_dm-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_dm_v_OBJECTS) $(ioctl_dm_v_LDADD) $(LIBS) + +ioctl_evdev$(EXEEXT): $(ioctl_evdev_OBJECTS) $(ioctl_evdev_DEPENDENCIES) $(EXTRA_ioctl_evdev_DEPENDENCIES) + @rm -f ioctl_evdev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_OBJECTS) $(ioctl_evdev_LDADD) $(LIBS) + +ioctl_evdev-v$(EXEEXT): $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_v_DEPENDENCIES) + @rm -f ioctl_evdev-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_LDADD) $(LIBS) + +ioctl_loop$(EXEEXT): $(ioctl_loop_OBJECTS) $(ioctl_loop_DEPENDENCIES) $(EXTRA_ioctl_loop_DEPENDENCIES) + @rm -f ioctl_loop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_OBJECTS) $(ioctl_loop_LDADD) $(LIBS) + +ioctl_loop-nv$(EXEEXT): $(ioctl_loop_nv_OBJECTS) $(ioctl_loop_nv_DEPENDENCIES) $(EXTRA_ioctl_loop_nv_DEPENDENCIES) + @rm -f ioctl_loop-nv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_nv_OBJECTS) $(ioctl_loop_nv_LDADD) $(LIBS) + +ioctl_loop-v$(EXEEXT): $(ioctl_loop_v_OBJECTS) $(ioctl_loop_v_DEPENDENCIES) $(EXTRA_ioctl_loop_v_DEPENDENCIES) + @rm -f ioctl_loop-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_v_OBJECTS) $(ioctl_loop_v_LDADD) $(LIBS) + +ioctl_mtd$(EXEEXT): $(ioctl_mtd_OBJECTS) $(ioctl_mtd_DEPENDENCIES) $(EXTRA_ioctl_mtd_DEPENDENCIES) + @rm -f ioctl_mtd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_mtd_OBJECTS) $(ioctl_mtd_LDADD) $(LIBS) + +ioctl_rtc$(EXEEXT): $(ioctl_rtc_OBJECTS) $(ioctl_rtc_DEPENDENCIES) $(EXTRA_ioctl_rtc_DEPENDENCIES) + @rm -f ioctl_rtc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_rtc_OBJECTS) $(ioctl_rtc_LDADD) $(LIBS) + +ioctl_rtc-v$(EXEEXT): $(ioctl_rtc_v_OBJECTS) $(ioctl_rtc_v_DEPENDENCIES) $(EXTRA_ioctl_rtc_v_DEPENDENCIES) + @rm -f ioctl_rtc-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_rtc_v_OBJECTS) $(ioctl_rtc_v_LDADD) $(LIBS) + +ioctl_scsi$(EXEEXT): $(ioctl_scsi_OBJECTS) $(ioctl_scsi_DEPENDENCIES) $(EXTRA_ioctl_scsi_DEPENDENCIES) + @rm -f ioctl_scsi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_scsi_OBJECTS) $(ioctl_scsi_LDADD) $(LIBS) + +ioctl_sg_io_v3$(EXEEXT): $(ioctl_sg_io_v3_OBJECTS) $(ioctl_sg_io_v3_DEPENDENCIES) $(EXTRA_ioctl_sg_io_v3_DEPENDENCIES) + @rm -f ioctl_sg_io_v3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sg_io_v3_OBJECTS) $(ioctl_sg_io_v3_LDADD) $(LIBS) + +ioctl_sg_io_v4$(EXEEXT): $(ioctl_sg_io_v4_OBJECTS) $(ioctl_sg_io_v4_DEPENDENCIES) $(EXTRA_ioctl_sg_io_v4_DEPENDENCIES) + @rm -f ioctl_sg_io_v4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sg_io_v4_OBJECTS) $(ioctl_sg_io_v4_LDADD) $(LIBS) + +ioctl_sock_gifconf$(EXEEXT): $(ioctl_sock_gifconf_OBJECTS) $(ioctl_sock_gifconf_DEPENDENCIES) $(EXTRA_ioctl_sock_gifconf_DEPENDENCIES) + @rm -f ioctl_sock_gifconf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sock_gifconf_OBJECTS) $(ioctl_sock_gifconf_LDADD) $(LIBS) + +ioctl_uffdio$(EXEEXT): $(ioctl_uffdio_OBJECTS) $(ioctl_uffdio_DEPENDENCIES) $(EXTRA_ioctl_uffdio_DEPENDENCIES) + @rm -f ioctl_uffdio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_uffdio_OBJECTS) $(ioctl_uffdio_LDADD) $(LIBS) + +ioctl_v4l2$(EXEEXT): $(ioctl_v4l2_OBJECTS) $(ioctl_v4l2_DEPENDENCIES) $(EXTRA_ioctl_v4l2_DEPENDENCIES) + @rm -f ioctl_v4l2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_v4l2_OBJECTS) $(ioctl_v4l2_LDADD) $(LIBS) + +ioperm$(EXEEXT): $(ioperm_OBJECTS) $(ioperm_DEPENDENCIES) $(EXTRA_ioperm_DEPENDENCIES) + @rm -f ioperm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioperm_OBJECTS) $(ioperm_LDADD) $(LIBS) + +iopl$(EXEEXT): $(iopl_OBJECTS) $(iopl_DEPENDENCIES) $(EXTRA_iopl_DEPENDENCIES) + @rm -f iopl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(iopl_OBJECTS) $(iopl_LDADD) $(LIBS) + +ioprio$(EXEEXT): $(ioprio_OBJECTS) $(ioprio_DEPENDENCIES) $(EXTRA_ioprio_DEPENDENCIES) + @rm -f ioprio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_OBJECTS) $(ioprio_LDADD) $(LIBS) + +ip_mreq$(EXEEXT): $(ip_mreq_OBJECTS) $(ip_mreq_DEPENDENCIES) $(EXTRA_ip_mreq_DEPENDENCIES) + @rm -f ip_mreq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ip_mreq_OBJECTS) $(ip_mreq_LDADD) $(LIBS) + +ipc$(EXEEXT): $(ipc_OBJECTS) $(ipc_DEPENDENCIES) $(EXTRA_ipc_DEPENDENCIES) + @rm -f ipc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_OBJECTS) $(ipc_LDADD) $(LIBS) + +ipc_msg$(EXEEXT): $(ipc_msg_OBJECTS) $(ipc_msg_DEPENDENCIES) $(EXTRA_ipc_msg_DEPENDENCIES) + @rm -f ipc_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_OBJECTS) $(ipc_msg_LDADD) $(LIBS) + +ipc_msgbuf$(EXEEXT): $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_DEPENDENCIES) $(EXTRA_ipc_msgbuf_DEPENDENCIES) + @rm -f ipc_msgbuf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_LDADD) $(LIBS) + +ipc_sem$(EXEEXT): $(ipc_sem_OBJECTS) $(ipc_sem_DEPENDENCIES) $(EXTRA_ipc_sem_DEPENDENCIES) + @rm -f ipc_sem$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_OBJECTS) $(ipc_sem_LDADD) $(LIBS) + +ipc_shm$(EXEEXT): $(ipc_shm_OBJECTS) $(ipc_shm_DEPENDENCIES) $(EXTRA_ipc_shm_DEPENDENCIES) + @rm -f ipc_shm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_OBJECTS) $(ipc_shm_LDADD) $(LIBS) + +kcmp$(EXEEXT): $(kcmp_OBJECTS) $(kcmp_DEPENDENCIES) $(EXTRA_kcmp_DEPENDENCIES) + @rm -f kcmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kcmp_OBJECTS) $(kcmp_LDADD) $(LIBS) + +kexec_file_load$(EXEEXT): $(kexec_file_load_OBJECTS) $(kexec_file_load_DEPENDENCIES) $(EXTRA_kexec_file_load_DEPENDENCIES) + @rm -f kexec_file_load$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kexec_file_load_OBJECTS) $(kexec_file_load_LDADD) $(LIBS) + +kexec_load$(EXEEXT): $(kexec_load_OBJECTS) $(kexec_load_DEPENDENCIES) $(EXTRA_kexec_load_DEPENDENCIES) + @rm -f kexec_load$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kexec_load_OBJECTS) $(kexec_load_LDADD) $(LIBS) + +keyctl$(EXEEXT): $(keyctl_OBJECTS) $(keyctl_DEPENDENCIES) $(EXTRA_keyctl_DEPENDENCIES) + @rm -f keyctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_OBJECTS) $(keyctl_LDADD) $(LIBS) + +kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) $(EXTRA_kill_DEPENDENCIES) + @rm -f kill$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) + +ksysent$(EXEEXT): $(ksysent_OBJECTS) $(ksysent_DEPENDENCIES) $(EXTRA_ksysent_DEPENDENCIES) + @rm -f ksysent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ksysent_OBJECTS) $(ksysent_LDADD) $(LIBS) + +lchown$(EXEEXT): $(lchown_OBJECTS) $(lchown_DEPENDENCIES) $(EXTRA_lchown_DEPENDENCIES) + @rm -f lchown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lchown_OBJECTS) $(lchown_LDADD) $(LIBS) + +lchown32$(EXEEXT): $(lchown32_OBJECTS) $(lchown32_DEPENDENCIES) $(EXTRA_lchown32_DEPENDENCIES) + @rm -f lchown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lchown32_OBJECTS) $(lchown32_LDADD) $(LIBS) + +link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES) $(EXTRA_link_DEPENDENCIES) + @rm -f link$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(link_OBJECTS) $(link_LDADD) $(LIBS) + +linkat$(EXEEXT): $(linkat_OBJECTS) $(linkat_DEPENDENCIES) $(EXTRA_linkat_DEPENDENCIES) + @rm -f linkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(linkat_OBJECTS) $(linkat_LDADD) $(LIBS) + +llseek$(EXEEXT): $(llseek_OBJECTS) $(llseek_DEPENDENCIES) $(EXTRA_llseek_DEPENDENCIES) + @rm -f llseek$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(llseek_OBJECTS) $(llseek_LDADD) $(LIBS) + +lookup_dcookie$(EXEEXT): $(lookup_dcookie_OBJECTS) $(lookup_dcookie_DEPENDENCIES) $(EXTRA_lookup_dcookie_DEPENDENCIES) + @rm -f lookup_dcookie$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lookup_dcookie_OBJECTS) $(lookup_dcookie_LDADD) $(LIBS) + +lseek$(EXEEXT): $(lseek_OBJECTS) $(lseek_DEPENDENCIES) $(EXTRA_lseek_DEPENDENCIES) + @rm -f lseek$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lseek_OBJECTS) $(lseek_LDADD) $(LIBS) + +lstat$(EXEEXT): $(lstat_OBJECTS) $(lstat_DEPENDENCIES) $(EXTRA_lstat_DEPENDENCIES) + @rm -f lstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lstat_OBJECTS) $(lstat_LDADD) $(LIBS) + +lstat64$(EXEEXT): $(lstat64_OBJECTS) $(lstat64_DEPENDENCIES) $(EXTRA_lstat64_DEPENDENCIES) + @rm -f lstat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lstat64_OBJECTS) $(lstat64_LDADD) $(LIBS) + +mbind$(EXEEXT): $(mbind_OBJECTS) $(mbind_DEPENDENCIES) $(EXTRA_mbind_DEPENDENCIES) + @rm -f mbind$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mbind_OBJECTS) $(mbind_LDADD) $(LIBS) + +membarrier$(EXEEXT): $(membarrier_OBJECTS) $(membarrier_DEPENDENCIES) $(EXTRA_membarrier_DEPENDENCIES) + @rm -f membarrier$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(membarrier_OBJECTS) $(membarrier_LDADD) $(LIBS) + +memfd_create$(EXEEXT): $(memfd_create_OBJECTS) $(memfd_create_DEPENDENCIES) $(EXTRA_memfd_create_DEPENDENCIES) + @rm -f memfd_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_OBJECTS) $(memfd_create_LDADD) $(LIBS) + +migrate_pages$(EXEEXT): $(migrate_pages_OBJECTS) $(migrate_pages_DEPENDENCIES) $(EXTRA_migrate_pages_DEPENDENCIES) + @rm -f migrate_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(migrate_pages_OBJECTS) $(migrate_pages_LDADD) $(LIBS) + +mincore$(EXEEXT): $(mincore_OBJECTS) $(mincore_DEPENDENCIES) $(EXTRA_mincore_DEPENDENCIES) + @rm -f mincore$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mincore_OBJECTS) $(mincore_LDADD) $(LIBS) + +mkdir$(EXEEXT): $(mkdir_OBJECTS) $(mkdir_DEPENDENCIES) $(EXTRA_mkdir_DEPENDENCIES) + @rm -f mkdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) + +mkdirat$(EXEEXT): $(mkdirat_OBJECTS) $(mkdirat_DEPENDENCIES) $(EXTRA_mkdirat_DEPENDENCIES) + @rm -f mkdirat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mkdirat_OBJECTS) $(mkdirat_LDADD) $(LIBS) + +mknod$(EXEEXT): $(mknod_OBJECTS) $(mknod_DEPENDENCIES) $(EXTRA_mknod_DEPENDENCIES) + @rm -f mknod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mknod_OBJECTS) $(mknod_LDADD) $(LIBS) + +mknodat$(EXEEXT): $(mknodat_OBJECTS) $(mknodat_DEPENDENCIES) $(EXTRA_mknodat_DEPENDENCIES) + @rm -f mknodat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mknodat_OBJECTS) $(mknodat_LDADD) $(LIBS) + +mlock$(EXEEXT): $(mlock_OBJECTS) $(mlock_DEPENDENCIES) $(EXTRA_mlock_DEPENDENCIES) + @rm -f mlock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlock_OBJECTS) $(mlock_LDADD) $(LIBS) + +mlock2$(EXEEXT): $(mlock2_OBJECTS) $(mlock2_DEPENDENCIES) $(EXTRA_mlock2_DEPENDENCIES) + @rm -f mlock2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlock2_OBJECTS) $(mlock2_LDADD) $(LIBS) + +mlockall$(EXEEXT): $(mlockall_OBJECTS) $(mlockall_DEPENDENCIES) $(EXTRA_mlockall_DEPENDENCIES) + @rm -f mlockall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlockall_OBJECTS) $(mlockall_LDADD) $(LIBS) + +mmap$(EXEEXT): $(mmap_OBJECTS) $(mmap_DEPENDENCIES) $(EXTRA_mmap_DEPENDENCIES) + @rm -f mmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_OBJECTS) $(mmap_LDADD) $(LIBS) + +mmap64$(EXEEXT): $(mmap64_OBJECTS) $(mmap64_DEPENDENCIES) $(EXTRA_mmap64_DEPENDENCIES) + @rm -f mmap64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_OBJECTS) $(mmap64_LDADD) $(LIBS) + +mmsg$(EXEEXT): $(mmsg_OBJECTS) $(mmsg_DEPENDENCIES) $(EXTRA_mmsg_DEPENDENCIES) + @rm -f mmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_OBJECTS) $(mmsg_LDADD) $(LIBS) + +mmsg-silent$(EXEEXT): $(mmsg_silent_OBJECTS) $(mmsg_silent_DEPENDENCIES) $(EXTRA_mmsg_silent_DEPENDENCIES) + @rm -f mmsg-silent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_silent_OBJECTS) $(mmsg_silent_LDADD) $(LIBS) + +mmsg_name$(EXEEXT): $(mmsg_name_OBJECTS) $(mmsg_name_DEPENDENCIES) $(EXTRA_mmsg_name_DEPENDENCIES) + @rm -f mmsg_name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_name_OBJECTS) $(mmsg_name_LDADD) $(LIBS) + +mmsg_name-v$(EXEEXT): $(mmsg_name_v_OBJECTS) $(mmsg_name_v_DEPENDENCIES) $(EXTRA_mmsg_name_v_DEPENDENCIES) + @rm -f mmsg_name-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_name_v_OBJECTS) $(mmsg_name_v_LDADD) $(LIBS) + +mount$(EXEEXT): $(mount_OBJECTS) $(mount_DEPENDENCIES) $(EXTRA_mount_DEPENDENCIES) + @rm -f mount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_OBJECTS) $(mount_LDADD) $(LIBS) + +move_pages$(EXEEXT): $(move_pages_OBJECTS) $(move_pages_DEPENDENCIES) $(EXTRA_move_pages_DEPENDENCIES) + @rm -f move_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_OBJECTS) $(move_pages_LDADD) $(LIBS) + +mq$(EXEEXT): $(mq_OBJECTS) $(mq_DEPENDENCIES) $(EXTRA_mq_DEPENDENCIES) + @rm -f mq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_OBJECTS) $(mq_LDADD) $(LIBS) + +mq_sendrecv$(EXEEXT): $(mq_sendrecv_OBJECTS) $(mq_sendrecv_DEPENDENCIES) $(EXTRA_mq_sendrecv_DEPENDENCIES) + @rm -f mq_sendrecv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_OBJECTS) $(mq_sendrecv_LDADD) $(LIBS) + +mq_sendrecv-read$(EXEEXT): $(mq_sendrecv_read_OBJECTS) $(mq_sendrecv_read_DEPENDENCIES) $(EXTRA_mq_sendrecv_read_DEPENDENCIES) + @rm -f mq_sendrecv-read$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_read_OBJECTS) $(mq_sendrecv_read_LDADD) $(LIBS) + +mq_sendrecv-write$(EXEEXT): $(mq_sendrecv_write_OBJECTS) $(mq_sendrecv_write_DEPENDENCIES) $(EXTRA_mq_sendrecv_write_DEPENDENCIES) + @rm -f mq_sendrecv-write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_write_OBJECTS) $(mq_sendrecv_write_LDADD) $(LIBS) + +msg_control$(EXEEXT): $(msg_control_OBJECTS) $(msg_control_DEPENDENCIES) $(EXTRA_msg_control_DEPENDENCIES) + @rm -f msg_control$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_control_OBJECTS) $(msg_control_LDADD) $(LIBS) + +msg_control-v$(EXEEXT): $(msg_control_v_OBJECTS) $(msg_control_v_DEPENDENCIES) $(EXTRA_msg_control_v_DEPENDENCIES) + @rm -f msg_control-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_control_v_OBJECTS) $(msg_control_v_LDADD) $(LIBS) + +msg_name$(EXEEXT): $(msg_name_OBJECTS) $(msg_name_DEPENDENCIES) $(EXTRA_msg_name_DEPENDENCIES) + @rm -f msg_name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_name_OBJECTS) $(msg_name_LDADD) $(LIBS) + +munlockall$(EXEEXT): $(munlockall_OBJECTS) $(munlockall_DEPENDENCIES) $(EXTRA_munlockall_DEPENDENCIES) + @rm -f munlockall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(munlockall_OBJECTS) $(munlockall_LDADD) $(LIBS) + +nanosleep$(EXEEXT): $(nanosleep_OBJECTS) $(nanosleep_DEPENDENCIES) $(EXTRA_nanosleep_DEPENDENCIES) + @rm -f nanosleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nanosleep_OBJECTS) $(nanosleep_LDADD) $(LIBS) + +net-accept-connect$(EXEEXT): $(net_accept_connect_OBJECTS) $(net_accept_connect_DEPENDENCIES) $(EXTRA_net_accept_connect_DEPENDENCIES) + @rm -f net-accept-connect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_accept_connect_OBJECTS) $(net_accept_connect_LDADD) $(LIBS) + +net-icmp_filter$(EXEEXT): $(net_icmp_filter_OBJECTS) $(net_icmp_filter_DEPENDENCIES) $(EXTRA_net_icmp_filter_DEPENDENCIES) + @rm -f net-icmp_filter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_icmp_filter_OBJECTS) $(net_icmp_filter_LDADD) $(LIBS) + +net-sockaddr$(EXEEXT): $(net_sockaddr_OBJECTS) $(net_sockaddr_DEPENDENCIES) $(EXTRA_net_sockaddr_DEPENDENCIES) + @rm -f net-sockaddr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_sockaddr_OBJECTS) $(net_sockaddr_LDADD) $(LIBS) + +net-y-unix$(EXEEXT): $(net_y_unix_OBJECTS) $(net_y_unix_DEPENDENCIES) $(EXTRA_net_y_unix_DEPENDENCIES) + @rm -f net-y-unix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_y_unix_OBJECTS) $(net_y_unix_LDADD) $(LIBS) + +net-yy-inet$(EXEEXT): $(net_yy_inet_OBJECTS) $(net_yy_inet_DEPENDENCIES) $(EXTRA_net_yy_inet_DEPENDENCIES) + @rm -f net-yy-inet$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_inet_OBJECTS) $(net_yy_inet_LDADD) $(LIBS) + +net-yy-netlink$(EXEEXT): $(net_yy_netlink_OBJECTS) $(net_yy_netlink_DEPENDENCIES) $(EXTRA_net_yy_netlink_DEPENDENCIES) + @rm -f net-yy-netlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_netlink_OBJECTS) $(net_yy_netlink_LDADD) $(LIBS) + +net-yy-unix$(EXEEXT): $(net_yy_unix_OBJECTS) $(net_yy_unix_DEPENDENCIES) $(EXTRA_net_yy_unix_DEPENDENCIES) + @rm -f net-yy-unix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_unix_OBJECTS) $(net_yy_unix_LDADD) $(LIBS) + +netlink_inet_diag$(EXEEXT): $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_DEPENDENCIES) $(EXTRA_netlink_inet_diag_DEPENDENCIES) + @rm -f netlink_inet_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_LDADD) $(LIBS) + +netlink_netlink_diag$(EXEEXT): $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_DEPENDENCIES) $(EXTRA_netlink_netlink_diag_DEPENDENCIES) + @rm -f netlink_netlink_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_LDADD) $(LIBS) + +netlink_protocol$(EXEEXT): $(netlink_protocol_OBJECTS) $(netlink_protocol_DEPENDENCIES) $(EXTRA_netlink_protocol_DEPENDENCIES) + @rm -f netlink_protocol$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_protocol_OBJECTS) $(netlink_protocol_LDADD) $(LIBS) + +netlink_unix_diag$(EXEEXT): $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_DEPENDENCIES) $(EXTRA_netlink_unix_diag_DEPENDENCIES) + @rm -f netlink_unix_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_LDADD) $(LIBS) + +newfstatat$(EXEEXT): $(newfstatat_OBJECTS) $(newfstatat_DEPENDENCIES) $(EXTRA_newfstatat_DEPENDENCIES) + @rm -f newfstatat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(newfstatat_OBJECTS) $(newfstatat_LDADD) $(LIBS) + +nsyscalls$(EXEEXT): $(nsyscalls_OBJECTS) $(nsyscalls_DEPENDENCIES) $(EXTRA_nsyscalls_DEPENDENCIES) + @rm -f nsyscalls$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nsyscalls_OBJECTS) $(nsyscalls_LDADD) $(LIBS) + +old_mmap$(EXEEXT): $(old_mmap_OBJECTS) $(old_mmap_DEPENDENCIES) $(EXTRA_old_mmap_DEPENDENCIES) + @rm -f old_mmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_OBJECTS) $(old_mmap_LDADD) $(LIBS) + +oldfstat$(EXEEXT): $(oldfstat_OBJECTS) $(oldfstat_DEPENDENCIES) $(EXTRA_oldfstat_DEPENDENCIES) + @rm -f oldfstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldfstat_OBJECTS) $(oldfstat_LDADD) $(LIBS) + +oldlstat$(EXEEXT): $(oldlstat_OBJECTS) $(oldlstat_DEPENDENCIES) $(EXTRA_oldlstat_DEPENDENCIES) + @rm -f oldlstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldlstat_OBJECTS) $(oldlstat_LDADD) $(LIBS) + +oldselect$(EXEEXT): $(oldselect_OBJECTS) $(oldselect_DEPENDENCIES) $(EXTRA_oldselect_DEPENDENCIES) + @rm -f oldselect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_OBJECTS) $(oldselect_LDADD) $(LIBS) + +oldstat$(EXEEXT): $(oldstat_OBJECTS) $(oldstat_DEPENDENCIES) $(EXTRA_oldstat_DEPENDENCIES) + @rm -f oldstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldstat_OBJECTS) $(oldstat_LDADD) $(LIBS) + +open$(EXEEXT): $(open_OBJECTS) $(open_DEPENDENCIES) $(EXTRA_open_DEPENDENCIES) + @rm -f open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(open_OBJECTS) $(open_LDADD) $(LIBS) + +openat$(EXEEXT): $(openat_OBJECTS) $(openat_DEPENDENCIES) $(EXTRA_openat_DEPENDENCIES) + @rm -f openat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(openat_OBJECTS) $(openat_LDADD) $(LIBS) + +pause$(EXEEXT): $(pause_OBJECTS) $(pause_DEPENDENCIES) $(EXTRA_pause_DEPENDENCIES) + @rm -f pause$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pause_OBJECTS) $(pause_LDADD) $(LIBS) + +pc$(EXEEXT): $(pc_OBJECTS) $(pc_DEPENDENCIES) $(EXTRA_pc_DEPENDENCIES) + @rm -f pc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pc_OBJECTS) $(pc_LDADD) $(LIBS) + +perf_event_open$(EXEEXT): $(perf_event_open_OBJECTS) $(perf_event_open_DEPENDENCIES) $(EXTRA_perf_event_open_DEPENDENCIES) + @rm -f perf_event_open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_OBJECTS) $(perf_event_open_LDADD) $(LIBS) + +perf_event_open_nonverbose$(EXEEXT): $(perf_event_open_nonverbose_OBJECTS) $(perf_event_open_nonverbose_DEPENDENCIES) $(EXTRA_perf_event_open_nonverbose_DEPENDENCIES) + @rm -f perf_event_open_nonverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_nonverbose_OBJECTS) $(perf_event_open_nonverbose_LDADD) $(LIBS) + +perf_event_open_unabbrev$(EXEEXT): $(perf_event_open_unabbrev_OBJECTS) $(perf_event_open_unabbrev_DEPENDENCIES) $(EXTRA_perf_event_open_unabbrev_DEPENDENCIES) + @rm -f perf_event_open_unabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_unabbrev_OBJECTS) $(perf_event_open_unabbrev_LDADD) $(LIBS) + +personality$(EXEEXT): $(personality_OBJECTS) $(personality_DEPENDENCIES) $(EXTRA_personality_DEPENDENCIES) + @rm -f personality$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_OBJECTS) $(personality_LDADD) $(LIBS) + +pipe$(EXEEXT): $(pipe_OBJECTS) $(pipe_DEPENDENCIES) $(EXTRA_pipe_DEPENDENCIES) + @rm -f pipe$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pipe_OBJECTS) $(pipe_LDADD) $(LIBS) + +pipe2$(EXEEXT): $(pipe2_OBJECTS) $(pipe2_DEPENDENCIES) $(EXTRA_pipe2_DEPENDENCIES) + @rm -f pipe2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pipe2_OBJECTS) $(pipe2_LDADD) $(LIBS) + +pkey_alloc$(EXEEXT): $(pkey_alloc_OBJECTS) $(pkey_alloc_DEPENDENCIES) $(EXTRA_pkey_alloc_DEPENDENCIES) + @rm -f pkey_alloc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_alloc_OBJECTS) $(pkey_alloc_LDADD) $(LIBS) + +pkey_free$(EXEEXT): $(pkey_free_OBJECTS) $(pkey_free_DEPENDENCIES) $(EXTRA_pkey_free_DEPENDENCIES) + @rm -f pkey_free$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_free_OBJECTS) $(pkey_free_LDADD) $(LIBS) + +pkey_mprotect$(EXEEXT): $(pkey_mprotect_OBJECTS) $(pkey_mprotect_DEPENDENCIES) $(EXTRA_pkey_mprotect_DEPENDENCIES) + @rm -f pkey_mprotect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_mprotect_OBJECTS) $(pkey_mprotect_LDADD) $(LIBS) + +poll$(EXEEXT): $(poll_OBJECTS) $(poll_DEPENDENCIES) $(EXTRA_poll_DEPENDENCIES) + @rm -f poll$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(poll_OBJECTS) $(poll_LDADD) $(LIBS) + +ppoll$(EXEEXT): $(ppoll_OBJECTS) $(ppoll_DEPENDENCIES) $(EXTRA_ppoll_DEPENDENCIES) + @rm -f ppoll$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_OBJECTS) $(ppoll_LDADD) $(LIBS) + +prctl-arg2-intptr$(EXEEXT): $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_DEPENDENCIES) $(EXTRA_prctl_arg2_intptr_DEPENDENCIES) + @rm -f prctl-arg2-intptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_LDADD) $(LIBS) + +prctl-dumpable$(EXEEXT): $(prctl_dumpable_OBJECTS) $(prctl_dumpable_DEPENDENCIES) $(EXTRA_prctl_dumpable_DEPENDENCIES) + @rm -f prctl-dumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_dumpable_OBJECTS) $(prctl_dumpable_LDADD) $(LIBS) + +prctl-name$(EXEEXT): $(prctl_name_OBJECTS) $(prctl_name_DEPENDENCIES) $(EXTRA_prctl_name_DEPENDENCIES) + @rm -f prctl-name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_name_OBJECTS) $(prctl_name_LDADD) $(LIBS) + +prctl-no-args$(EXEEXT): $(prctl_no_args_OBJECTS) $(prctl_no_args_DEPENDENCIES) $(EXTRA_prctl_no_args_DEPENDENCIES) + @rm -f prctl-no-args$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_no_args_OBJECTS) $(prctl_no_args_LDADD) $(LIBS) + +prctl-pdeathsig$(EXEEXT): $(prctl_pdeathsig_OBJECTS) $(prctl_pdeathsig_DEPENDENCIES) $(EXTRA_prctl_pdeathsig_DEPENDENCIES) + @rm -f prctl-pdeathsig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_pdeathsig_OBJECTS) $(prctl_pdeathsig_LDADD) $(LIBS) + +prctl-seccomp-filter-v$(EXEEXT): $(prctl_seccomp_filter_v_OBJECTS) $(prctl_seccomp_filter_v_DEPENDENCIES) $(EXTRA_prctl_seccomp_filter_v_DEPENDENCIES) + @rm -f prctl-seccomp-filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_seccomp_filter_v_OBJECTS) $(prctl_seccomp_filter_v_LDADD) $(LIBS) + +prctl-seccomp-strict$(EXEEXT): $(prctl_seccomp_strict_OBJECTS) $(prctl_seccomp_strict_DEPENDENCIES) $(EXTRA_prctl_seccomp_strict_DEPENDENCIES) + @rm -f prctl-seccomp-strict$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_seccomp_strict_OBJECTS) $(prctl_seccomp_strict_LDADD) $(LIBS) + +prctl-securebits$(EXEEXT): $(prctl_securebits_OBJECTS) $(prctl_securebits_DEPENDENCIES) $(EXTRA_prctl_securebits_DEPENDENCIES) + @rm -f prctl-securebits$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_securebits_OBJECTS) $(prctl_securebits_LDADD) $(LIBS) + +prctl-tid_address$(EXEEXT): $(prctl_tid_address_OBJECTS) $(prctl_tid_address_DEPENDENCIES) $(EXTRA_prctl_tid_address_DEPENDENCIES) + @rm -f prctl-tid_address$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_tid_address_OBJECTS) $(prctl_tid_address_LDADD) $(LIBS) + +prctl-tsc$(EXEEXT): $(prctl_tsc_OBJECTS) $(prctl_tsc_DEPENDENCIES) $(EXTRA_prctl_tsc_DEPENDENCIES) + @rm -f prctl-tsc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_tsc_OBJECTS) $(prctl_tsc_LDADD) $(LIBS) + +pread64-pwrite64$(EXEEXT): $(pread64_pwrite64_OBJECTS) $(pread64_pwrite64_DEPENDENCIES) $(EXTRA_pread64_pwrite64_DEPENDENCIES) + @rm -f pread64-pwrite64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pread64_pwrite64_OBJECTS) $(pread64_pwrite64_LDADD) $(LIBS) + +preadv$(EXEEXT): $(preadv_OBJECTS) $(preadv_DEPENDENCIES) $(EXTRA_preadv_DEPENDENCIES) + @rm -f preadv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv_OBJECTS) $(preadv_LDADD) $(LIBS) + +preadv-pwritev$(EXEEXT): $(preadv_pwritev_OBJECTS) $(preadv_pwritev_DEPENDENCIES) $(EXTRA_preadv_pwritev_DEPENDENCIES) + @rm -f preadv-pwritev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv_pwritev_OBJECTS) $(preadv_pwritev_LDADD) $(LIBS) + +preadv2-pwritev2$(EXEEXT): $(preadv2_pwritev2_OBJECTS) $(preadv2_pwritev2_DEPENDENCIES) $(EXTRA_preadv2_pwritev2_DEPENDENCIES) + @rm -f preadv2-pwritev2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv2_pwritev2_OBJECTS) $(preadv2_pwritev2_LDADD) $(LIBS) + +print_maxfd$(EXEEXT): $(print_maxfd_OBJECTS) $(print_maxfd_DEPENDENCIES) $(EXTRA_print_maxfd_DEPENDENCIES) + @rm -f print_maxfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(print_maxfd_OBJECTS) $(print_maxfd_LDADD) $(LIBS) + +printstr$(EXEEXT): $(printstr_OBJECTS) $(printstr_DEPENDENCIES) $(EXTRA_printstr_DEPENDENCIES) + @rm -f printstr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstr_OBJECTS) $(printstr_LDADD) $(LIBS) + +prlimit64$(EXEEXT): $(prlimit64_OBJECTS) $(prlimit64_DEPENDENCIES) $(EXTRA_prlimit64_DEPENDENCIES) + @rm -f prlimit64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prlimit64_OBJECTS) $(prlimit64_LDADD) $(LIBS) + +process_vm_readv$(EXEEXT): $(process_vm_readv_OBJECTS) $(process_vm_readv_DEPENDENCIES) $(EXTRA_process_vm_readv_DEPENDENCIES) + @rm -f process_vm_readv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(process_vm_readv_OBJECTS) $(process_vm_readv_LDADD) $(LIBS) + +process_vm_writev$(EXEEXT): $(process_vm_writev_OBJECTS) $(process_vm_writev_DEPENDENCIES) $(EXTRA_process_vm_writev_DEPENDENCIES) + @rm -f process_vm_writev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(process_vm_writev_OBJECTS) $(process_vm_writev_LDADD) $(LIBS) + +pselect6$(EXEEXT): $(pselect6_OBJECTS) $(pselect6_DEPENDENCIES) $(EXTRA_pselect6_DEPENDENCIES) + @rm -f pselect6$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pselect6_OBJECTS) $(pselect6_LDADD) $(LIBS) + +ptrace$(EXEEXT): $(ptrace_OBJECTS) $(ptrace_DEPENDENCIES) $(EXTRA_ptrace_DEPENDENCIES) + @rm -f ptrace$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ptrace_OBJECTS) $(ptrace_LDADD) $(LIBS) + +pwritev$(EXEEXT): $(pwritev_OBJECTS) $(pwritev_DEPENDENCIES) $(EXTRA_pwritev_DEPENDENCIES) + @rm -f pwritev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pwritev_OBJECTS) $(pwritev_LDADD) $(LIBS) + +qual_fault$(EXEEXT): $(qual_fault_OBJECTS) $(qual_fault_DEPENDENCIES) $(EXTRA_qual_fault_DEPENDENCIES) + @rm -f qual_fault$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_fault_OBJECTS) $(qual_fault_LDADD) $(LIBS) + +qual_inject-error-signal$(EXEEXT): $(qual_inject_error_signal_OBJECTS) $(qual_inject_error_signal_DEPENDENCIES) $(EXTRA_qual_inject_error_signal_DEPENDENCIES) + @rm -f qual_inject-error-signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_error_signal_OBJECTS) $(qual_inject_error_signal_LDADD) $(LIBS) + +qual_inject-retval$(EXEEXT): $(qual_inject_retval_OBJECTS) $(qual_inject_retval_DEPENDENCIES) $(EXTRA_qual_inject_retval_DEPENDENCIES) + @rm -f qual_inject-retval$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_retval_OBJECTS) $(qual_inject_retval_LDADD) $(LIBS) + +qual_inject-signal$(EXEEXT): $(qual_inject_signal_OBJECTS) $(qual_inject_signal_DEPENDENCIES) $(EXTRA_qual_inject_signal_DEPENDENCIES) + @rm -f qual_inject-signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_signal_OBJECTS) $(qual_inject_signal_LDADD) $(LIBS) + +qual_signal$(EXEEXT): $(qual_signal_OBJECTS) $(qual_signal_DEPENDENCIES) $(EXTRA_qual_signal_DEPENDENCIES) + @rm -f qual_signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_signal_OBJECTS) $(qual_signal_LDADD) $(LIBS) + +quotactl$(EXEEXT): $(quotactl_OBJECTS) $(quotactl_DEPENDENCIES) $(EXTRA_quotactl_DEPENDENCIES) + @rm -f quotactl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_OBJECTS) $(quotactl_LDADD) $(LIBS) + +quotactl-v$(EXEEXT): $(quotactl_v_OBJECTS) $(quotactl_v_DEPENDENCIES) $(EXTRA_quotactl_v_DEPENDENCIES) + @rm -f quotactl-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_v_OBJECTS) $(quotactl_v_LDADD) $(LIBS) + +quotactl-xfs$(EXEEXT): $(quotactl_xfs_OBJECTS) $(quotactl_xfs_DEPENDENCIES) $(EXTRA_quotactl_xfs_DEPENDENCIES) + @rm -f quotactl-xfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_OBJECTS) $(quotactl_xfs_LDADD) $(LIBS) + +quotactl-xfs-v$(EXEEXT): $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_v_DEPENDENCIES) + @rm -f quotactl-xfs-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_LDADD) $(LIBS) + +read-write$(EXEEXT): $(read_write_OBJECTS) $(read_write_DEPENDENCIES) $(EXTRA_read_write_DEPENDENCIES) + @rm -f read-write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(read_write_OBJECTS) $(read_write_LDADD) $(LIBS) + +readahead$(EXEEXT): $(readahead_OBJECTS) $(readahead_DEPENDENCIES) $(EXTRA_readahead_DEPENDENCIES) + @rm -f readahead$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readahead_OBJECTS) $(readahead_LDADD) $(LIBS) + +readdir$(EXEEXT): $(readdir_OBJECTS) $(readdir_DEPENDENCIES) $(EXTRA_readdir_DEPENDENCIES) + @rm -f readdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readdir_OBJECTS) $(readdir_LDADD) $(LIBS) + +readlink$(EXEEXT): $(readlink_OBJECTS) $(readlink_DEPENDENCIES) $(EXTRA_readlink_DEPENDENCIES) + @rm -f readlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readlink_OBJECTS) $(readlink_LDADD) $(LIBS) + +readlinkat$(EXEEXT): $(readlinkat_OBJECTS) $(readlinkat_DEPENDENCIES) $(EXTRA_readlinkat_DEPENDENCIES) + @rm -f readlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readlinkat_OBJECTS) $(readlinkat_LDADD) $(LIBS) + +readv$(EXEEXT): $(readv_OBJECTS) $(readv_DEPENDENCIES) $(EXTRA_readv_DEPENDENCIES) + @rm -f readv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readv_OBJECTS) $(readv_LDADD) $(LIBS) + +reboot$(EXEEXT): $(reboot_OBJECTS) $(reboot_DEPENDENCIES) $(EXTRA_reboot_DEPENDENCIES) + @rm -f reboot$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(reboot_OBJECTS) $(reboot_LDADD) $(LIBS) + +recvfrom$(EXEEXT): $(recvfrom_OBJECTS) $(recvfrom_DEPENDENCIES) $(EXTRA_recvfrom_DEPENDENCIES) + @rm -f recvfrom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvfrom_OBJECTS) $(recvfrom_LDADD) $(LIBS) + +recvmmsg-timeout$(EXEEXT): $(recvmmsg_timeout_OBJECTS) $(recvmmsg_timeout_DEPENDENCIES) $(EXTRA_recvmmsg_timeout_DEPENDENCIES) + @rm -f recvmmsg-timeout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvmmsg_timeout_OBJECTS) $(recvmmsg_timeout_LDADD) $(LIBS) + +recvmsg$(EXEEXT): $(recvmsg_OBJECTS) $(recvmsg_DEPENDENCIES) $(EXTRA_recvmsg_DEPENDENCIES) + @rm -f recvmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvmsg_OBJECTS) $(recvmsg_LDADD) $(LIBS) + +redirect-fds$(EXEEXT): $(redirect_fds_OBJECTS) $(redirect_fds_DEPENDENCIES) $(EXTRA_redirect_fds_DEPENDENCIES) + @rm -f redirect-fds$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(redirect_fds_OBJECTS) $(redirect_fds_LDADD) $(LIBS) + +remap_file_pages$(EXEEXT): $(remap_file_pages_OBJECTS) $(remap_file_pages_DEPENDENCIES) $(EXTRA_remap_file_pages_DEPENDENCIES) + @rm -f remap_file_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_OBJECTS) $(remap_file_pages_LDADD) $(LIBS) + +rename$(EXEEXT): $(rename_OBJECTS) $(rename_DEPENDENCIES) $(EXTRA_rename_DEPENDENCIES) + @rm -f rename$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rename_OBJECTS) $(rename_LDADD) $(LIBS) + +renameat$(EXEEXT): $(renameat_OBJECTS) $(renameat_DEPENDENCIES) $(EXTRA_renameat_DEPENDENCIES) + @rm -f renameat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(renameat_OBJECTS) $(renameat_LDADD) $(LIBS) + +renameat2$(EXEEXT): $(renameat2_OBJECTS) $(renameat2_DEPENDENCIES) $(EXTRA_renameat2_DEPENDENCIES) + @rm -f renameat2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(renameat2_OBJECTS) $(renameat2_LDADD) $(LIBS) + +request_key$(EXEEXT): $(request_key_OBJECTS) $(request_key_DEPENDENCIES) $(EXTRA_request_key_DEPENDENCIES) + @rm -f request_key$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(request_key_OBJECTS) $(request_key_LDADD) $(LIBS) + +restart_syscall$(EXEEXT): $(restart_syscall_OBJECTS) $(restart_syscall_DEPENDENCIES) $(EXTRA_restart_syscall_DEPENDENCIES) + @rm -f restart_syscall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(restart_syscall_OBJECTS) $(restart_syscall_LDADD) $(LIBS) + +rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) $(EXTRA_rmdir_DEPENDENCIES) + @rm -f rmdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) + +rt_sigpending$(EXEEXT): $(rt_sigpending_OBJECTS) $(rt_sigpending_DEPENDENCIES) $(EXTRA_rt_sigpending_DEPENDENCIES) + @rm -f rt_sigpending$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigpending_OBJECTS) $(rt_sigpending_LDADD) $(LIBS) + +rt_sigprocmask$(EXEEXT): $(rt_sigprocmask_OBJECTS) $(rt_sigprocmask_DEPENDENCIES) $(EXTRA_rt_sigprocmask_DEPENDENCIES) + @rm -f rt_sigprocmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigprocmask_OBJECTS) $(rt_sigprocmask_LDADD) $(LIBS) + +rt_sigqueueinfo$(EXEEXT): $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_DEPENDENCIES) $(EXTRA_rt_sigqueueinfo_DEPENDENCIES) + @rm -f rt_sigqueueinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_LDADD) $(LIBS) + +rt_sigsuspend$(EXEEXT): $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_DEPENDENCIES) $(EXTRA_rt_sigsuspend_DEPENDENCIES) + @rm -f rt_sigsuspend$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_LDADD) $(LIBS) + +rt_sigtimedwait$(EXEEXT): $(rt_sigtimedwait_OBJECTS) $(rt_sigtimedwait_DEPENDENCIES) $(EXTRA_rt_sigtimedwait_DEPENDENCIES) + @rm -f rt_sigtimedwait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigtimedwait_OBJECTS) $(rt_sigtimedwait_LDADD) $(LIBS) + +rt_tgsigqueueinfo$(EXEEXT): $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_DEPENDENCIES) $(EXTRA_rt_tgsigqueueinfo_DEPENDENCIES) + @rm -f rt_tgsigqueueinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_LDADD) $(LIBS) + +sched_get_priority_mxx$(EXEEXT): $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_DEPENDENCIES) $(EXTRA_sched_get_priority_mxx_DEPENDENCIES) + @rm -f sched_get_priority_mxx$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_LDADD) $(LIBS) + +sched_rr_get_interval$(EXEEXT): $(sched_rr_get_interval_OBJECTS) $(sched_rr_get_interval_DEPENDENCIES) $(EXTRA_sched_rr_get_interval_DEPENDENCIES) + @rm -f sched_rr_get_interval$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_rr_get_interval_OBJECTS) $(sched_rr_get_interval_LDADD) $(LIBS) + +sched_xetaffinity$(EXEEXT): $(sched_xetaffinity_OBJECTS) $(sched_xetaffinity_DEPENDENCIES) $(EXTRA_sched_xetaffinity_DEPENDENCIES) + @rm -f sched_xetaffinity$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetaffinity_OBJECTS) $(sched_xetaffinity_LDADD) $(LIBS) + +sched_xetattr$(EXEEXT): $(sched_xetattr_OBJECTS) $(sched_xetattr_DEPENDENCIES) $(EXTRA_sched_xetattr_DEPENDENCIES) + @rm -f sched_xetattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetattr_OBJECTS) $(sched_xetattr_LDADD) $(LIBS) + +sched_xetparam$(EXEEXT): $(sched_xetparam_OBJECTS) $(sched_xetparam_DEPENDENCIES) $(EXTRA_sched_xetparam_DEPENDENCIES) + @rm -f sched_xetparam$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetparam_OBJECTS) $(sched_xetparam_LDADD) $(LIBS) + +sched_xetscheduler$(EXEEXT): $(sched_xetscheduler_OBJECTS) $(sched_xetscheduler_DEPENDENCIES) $(EXTRA_sched_xetscheduler_DEPENDENCIES) + @rm -f sched_xetscheduler$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetscheduler_OBJECTS) $(sched_xetscheduler_LDADD) $(LIBS) + +sched_yield$(EXEEXT): $(sched_yield_OBJECTS) $(sched_yield_DEPENDENCIES) $(EXTRA_sched_yield_DEPENDENCIES) + @rm -f sched_yield$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_yield_OBJECTS) $(sched_yield_LDADD) $(LIBS) + +scm_rights$(EXEEXT): $(scm_rights_OBJECTS) $(scm_rights_DEPENDENCIES) $(EXTRA_scm_rights_DEPENDENCIES) + @rm -f scm_rights$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(scm_rights_OBJECTS) $(scm_rights_LDADD) $(LIBS) + +seccomp-filter$(EXEEXT): $(seccomp_filter_OBJECTS) $(seccomp_filter_DEPENDENCIES) $(EXTRA_seccomp_filter_DEPENDENCIES) + @rm -f seccomp-filter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_filter_OBJECTS) $(seccomp_filter_LDADD) $(LIBS) + +seccomp-filter-v$(EXEEXT): $(seccomp_filter_v_OBJECTS) $(seccomp_filter_v_DEPENDENCIES) $(EXTRA_seccomp_filter_v_DEPENDENCIES) + @rm -f seccomp-filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_filter_v_OBJECTS) $(seccomp_filter_v_LDADD) $(LIBS) + +seccomp-strict$(EXEEXT): $(seccomp_strict_OBJECTS) $(seccomp_strict_DEPENDENCIES) $(EXTRA_seccomp_strict_DEPENDENCIES) + @rm -f seccomp-strict$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_strict_OBJECTS) $(seccomp_strict_LDADD) $(LIBS) + +select$(EXEEXT): $(select_OBJECTS) $(select_DEPENDENCIES) $(EXTRA_select_DEPENDENCIES) + @rm -f select$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(select_OBJECTS) $(select_LDADD) $(LIBS) + +semop$(EXEEXT): $(semop_OBJECTS) $(semop_DEPENDENCIES) $(EXTRA_semop_DEPENDENCIES) + @rm -f semop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(semop_OBJECTS) $(semop_LDADD) $(LIBS) + +sendfile$(EXEEXT): $(sendfile_OBJECTS) $(sendfile_DEPENDENCIES) $(EXTRA_sendfile_DEPENDENCIES) + @rm -f sendfile$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sendfile_OBJECTS) $(sendfile_LDADD) $(LIBS) + +sendfile64$(EXEEXT): $(sendfile64_OBJECTS) $(sendfile64_DEPENDENCIES) $(EXTRA_sendfile64_DEPENDENCIES) + @rm -f sendfile64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sendfile64_OBJECTS) $(sendfile64_LDADD) $(LIBS) + +set_mempolicy$(EXEEXT): $(set_mempolicy_OBJECTS) $(set_mempolicy_DEPENDENCIES) $(EXTRA_set_mempolicy_DEPENDENCIES) + @rm -f set_mempolicy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_mempolicy_OBJECTS) $(set_mempolicy_LDADD) $(LIBS) + +set_ptracer_any$(EXEEXT): $(set_ptracer_any_OBJECTS) $(set_ptracer_any_DEPENDENCIES) $(EXTRA_set_ptracer_any_DEPENDENCIES) + @rm -f set_ptracer_any$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_ptracer_any_OBJECTS) $(set_ptracer_any_LDADD) $(LIBS) + +setdomainname$(EXEEXT): $(setdomainname_OBJECTS) $(setdomainname_DEPENDENCIES) $(EXTRA_setdomainname_DEPENDENCIES) + @rm -f setdomainname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setdomainname_OBJECTS) $(setdomainname_LDADD) $(LIBS) + +setfsgid$(EXEEXT): $(setfsgid_OBJECTS) $(setfsgid_DEPENDENCIES) $(EXTRA_setfsgid_DEPENDENCIES) + @rm -f setfsgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsgid_OBJECTS) $(setfsgid_LDADD) $(LIBS) + +setfsgid32$(EXEEXT): $(setfsgid32_OBJECTS) $(setfsgid32_DEPENDENCIES) $(EXTRA_setfsgid32_DEPENDENCIES) + @rm -f setfsgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsgid32_OBJECTS) $(setfsgid32_LDADD) $(LIBS) + +setfsuid$(EXEEXT): $(setfsuid_OBJECTS) $(setfsuid_DEPENDENCIES) $(EXTRA_setfsuid_DEPENDENCIES) + @rm -f setfsuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsuid_OBJECTS) $(setfsuid_LDADD) $(LIBS) + +setfsuid32$(EXEEXT): $(setfsuid32_OBJECTS) $(setfsuid32_DEPENDENCIES) $(EXTRA_setfsuid32_DEPENDENCIES) + @rm -f setfsuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsuid32_OBJECTS) $(setfsuid32_LDADD) $(LIBS) + +setgid$(EXEEXT): $(setgid_OBJECTS) $(setgid_DEPENDENCIES) $(EXTRA_setgid_DEPENDENCIES) + @rm -f setgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgid_OBJECTS) $(setgid_LDADD) $(LIBS) + +setgid32$(EXEEXT): $(setgid32_OBJECTS) $(setgid32_DEPENDENCIES) $(EXTRA_setgid32_DEPENDENCIES) + @rm -f setgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgid32_OBJECTS) $(setgid32_LDADD) $(LIBS) + +setgroups$(EXEEXT): $(setgroups_OBJECTS) $(setgroups_DEPENDENCIES) $(EXTRA_setgroups_DEPENDENCIES) + @rm -f setgroups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgroups_OBJECTS) $(setgroups_LDADD) $(LIBS) + +setgroups32$(EXEEXT): $(setgroups32_OBJECTS) $(setgroups32_DEPENDENCIES) $(EXTRA_setgroups32_DEPENDENCIES) + @rm -f setgroups32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgroups32_OBJECTS) $(setgroups32_LDADD) $(LIBS) + +sethostname$(EXEEXT): $(sethostname_OBJECTS) $(sethostname_DEPENDENCIES) $(EXTRA_sethostname_DEPENDENCIES) + @rm -f sethostname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sethostname_OBJECTS) $(sethostname_LDADD) $(LIBS) + +setns$(EXEEXT): $(setns_OBJECTS) $(setns_DEPENDENCIES) $(EXTRA_setns_DEPENDENCIES) + @rm -f setns$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setns_OBJECTS) $(setns_LDADD) $(LIBS) + +setregid$(EXEEXT): $(setregid_OBJECTS) $(setregid_DEPENDENCIES) $(EXTRA_setregid_DEPENDENCIES) + @rm -f setregid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setregid_OBJECTS) $(setregid_LDADD) $(LIBS) + +setregid32$(EXEEXT): $(setregid32_OBJECTS) $(setregid32_DEPENDENCIES) $(EXTRA_setregid32_DEPENDENCIES) + @rm -f setregid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setregid32_OBJECTS) $(setregid32_LDADD) $(LIBS) + +setresgid$(EXEEXT): $(setresgid_OBJECTS) $(setresgid_DEPENDENCIES) $(EXTRA_setresgid_DEPENDENCIES) + @rm -f setresgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresgid_OBJECTS) $(setresgid_LDADD) $(LIBS) + +setresgid32$(EXEEXT): $(setresgid32_OBJECTS) $(setresgid32_DEPENDENCIES) $(EXTRA_setresgid32_DEPENDENCIES) + @rm -f setresgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresgid32_OBJECTS) $(setresgid32_LDADD) $(LIBS) + +setresuid$(EXEEXT): $(setresuid_OBJECTS) $(setresuid_DEPENDENCIES) $(EXTRA_setresuid_DEPENDENCIES) + @rm -f setresuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresuid_OBJECTS) $(setresuid_LDADD) $(LIBS) + +setresuid32$(EXEEXT): $(setresuid32_OBJECTS) $(setresuid32_DEPENDENCIES) $(EXTRA_setresuid32_DEPENDENCIES) + @rm -f setresuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresuid32_OBJECTS) $(setresuid32_LDADD) $(LIBS) + +setreuid$(EXEEXT): $(setreuid_OBJECTS) $(setreuid_DEPENDENCIES) $(EXTRA_setreuid_DEPENDENCIES) + @rm -f setreuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setreuid_OBJECTS) $(setreuid_LDADD) $(LIBS) + +setreuid32$(EXEEXT): $(setreuid32_OBJECTS) $(setreuid32_DEPENDENCIES) $(EXTRA_setreuid32_DEPENDENCIES) + @rm -f setreuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setreuid32_OBJECTS) $(setreuid32_LDADD) $(LIBS) + +setrlimit$(EXEEXT): $(setrlimit_OBJECTS) $(setrlimit_DEPENDENCIES) $(EXTRA_setrlimit_DEPENDENCIES) + @rm -f setrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_OBJECTS) $(setrlimit_LDADD) $(LIBS) + +setuid$(EXEEXT): $(setuid_OBJECTS) $(setuid_DEPENDENCIES) $(EXTRA_setuid_DEPENDENCIES) + @rm -f setuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setuid_OBJECTS) $(setuid_LDADD) $(LIBS) + +setuid32$(EXEEXT): $(setuid32_OBJECTS) $(setuid32_DEPENDENCIES) $(EXTRA_setuid32_DEPENDENCIES) + @rm -f setuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setuid32_OBJECTS) $(setuid32_LDADD) $(LIBS) + +shmxt$(EXEEXT): $(shmxt_OBJECTS) $(shmxt_DEPENDENCIES) $(EXTRA_shmxt_DEPENDENCIES) + @rm -f shmxt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shmxt_OBJECTS) $(shmxt_LDADD) $(LIBS) + +shutdown$(EXEEXT): $(shutdown_OBJECTS) $(shutdown_DEPENDENCIES) $(EXTRA_shutdown_DEPENDENCIES) + @rm -f shutdown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shutdown_OBJECTS) $(shutdown_LDADD) $(LIBS) + +sigaction$(EXEEXT): $(sigaction_OBJECTS) $(sigaction_DEPENDENCIES) $(EXTRA_sigaction_DEPENDENCIES) + @rm -f sigaction$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigaction_OBJECTS) $(sigaction_LDADD) $(LIBS) + +sigaltstack$(EXEEXT): $(sigaltstack_OBJECTS) $(sigaltstack_DEPENDENCIES) $(EXTRA_sigaltstack_DEPENDENCIES) + @rm -f sigaltstack$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigaltstack_OBJECTS) $(sigaltstack_LDADD) $(LIBS) + +siginfo$(EXEEXT): $(siginfo_OBJECTS) $(siginfo_DEPENDENCIES) $(EXTRA_siginfo_DEPENDENCIES) + @rm -f siginfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(siginfo_OBJECTS) $(siginfo_LDADD) $(LIBS) + +signal_receive$(EXEEXT): $(signal_receive_OBJECTS) $(signal_receive_DEPENDENCIES) $(EXTRA_signal_receive_DEPENDENCIES) + @rm -f signal_receive$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signal_receive_OBJECTS) $(signal_receive_LDADD) $(LIBS) + +signalfd4$(EXEEXT): $(signalfd4_OBJECTS) $(signalfd4_DEPENDENCIES) $(EXTRA_signalfd4_DEPENDENCIES) + @rm -f signalfd4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signalfd4_OBJECTS) $(signalfd4_LDADD) $(LIBS) + +sigreturn$(EXEEXT): $(sigreturn_OBJECTS) $(sigreturn_DEPENDENCIES) $(EXTRA_sigreturn_DEPENDENCIES) + @rm -f sigreturn$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigreturn_OBJECTS) $(sigreturn_LDADD) $(LIBS) + +sleep$(EXEEXT): $(sleep_OBJECTS) $(sleep_DEPENDENCIES) $(EXTRA_sleep_DEPENDENCIES) + @rm -f sleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) + +socketcall$(EXEEXT): $(socketcall_OBJECTS) $(socketcall_DEPENDENCIES) $(EXTRA_socketcall_DEPENDENCIES) + @rm -f socketcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(socketcall_OBJECTS) $(socketcall_LDADD) $(LIBS) + +splice$(EXEEXT): $(splice_OBJECTS) $(splice_DEPENDENCIES) $(EXTRA_splice_DEPENDENCIES) + @rm -f splice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(splice_OBJECTS) $(splice_LDADD) $(LIBS) + +stack-fcall$(EXEEXT): $(stack_fcall_OBJECTS) $(stack_fcall_DEPENDENCIES) $(EXTRA_stack_fcall_DEPENDENCIES) + @rm -f stack-fcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) + +stat$(EXEEXT): $(stat_OBJECTS) $(stat_DEPENDENCIES) $(EXTRA_stat_DEPENDENCIES) + @rm -f stat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) + +stat64$(EXEEXT): $(stat64_OBJECTS) $(stat64_DEPENDENCIES) $(EXTRA_stat64_DEPENDENCIES) + @rm -f stat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stat64_OBJECTS) $(stat64_LDADD) $(LIBS) + +statfs$(EXEEXT): $(statfs_OBJECTS) $(statfs_DEPENDENCIES) $(EXTRA_statfs_DEPENDENCIES) + @rm -f statfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statfs_OBJECTS) $(statfs_LDADD) $(LIBS) + +statfs64$(EXEEXT): $(statfs64_OBJECTS) $(statfs64_DEPENDENCIES) $(EXTRA_statfs64_DEPENDENCIES) + @rm -f statfs64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statfs64_OBJECTS) $(statfs64_LDADD) $(LIBS) + +swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES) $(EXTRA_swap_DEPENDENCIES) + @rm -f swap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(swap_OBJECTS) $(swap_LDADD) $(LIBS) + +symlink$(EXEEXT): $(symlink_OBJECTS) $(symlink_DEPENDENCIES) $(EXTRA_symlink_DEPENDENCIES) + @rm -f symlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(symlink_OBJECTS) $(symlink_LDADD) $(LIBS) + +symlinkat$(EXEEXT): $(symlinkat_OBJECTS) $(symlinkat_DEPENDENCIES) $(EXTRA_symlinkat_DEPENDENCIES) + @rm -f symlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(symlinkat_OBJECTS) $(symlinkat_LDADD) $(LIBS) + +sync$(EXEEXT): $(sync_OBJECTS) $(sync_DEPENDENCIES) $(EXTRA_sync_DEPENDENCIES) + @rm -f sync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_OBJECTS) $(sync_LDADD) $(LIBS) + +sync_file_range$(EXEEXT): $(sync_file_range_OBJECTS) $(sync_file_range_DEPENDENCIES) $(EXTRA_sync_file_range_DEPENDENCIES) + @rm -f sync_file_range$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_file_range_OBJECTS) $(sync_file_range_LDADD) $(LIBS) + +sync_file_range2$(EXEEXT): $(sync_file_range2_OBJECTS) $(sync_file_range2_DEPENDENCIES) $(EXTRA_sync_file_range2_DEPENDENCIES) + @rm -f sync_file_range2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_file_range2_OBJECTS) $(sync_file_range2_LDADD) $(LIBS) + +sysinfo$(EXEEXT): $(sysinfo_OBJECTS) $(sysinfo_DEPENDENCIES) $(EXTRA_sysinfo_DEPENDENCIES) + @rm -f sysinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sysinfo_OBJECTS) $(sysinfo_LDADD) $(LIBS) + +syslog$(EXEEXT): $(syslog_OBJECTS) $(syslog_DEPENDENCIES) $(EXTRA_syslog_DEPENDENCIES) + @rm -f syslog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(syslog_OBJECTS) $(syslog_LDADD) $(LIBS) + +tee$(EXEEXT): $(tee_OBJECTS) $(tee_DEPENDENCIES) $(EXTRA_tee_DEPENDENCIES) + @rm -f tee$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tee_OBJECTS) $(tee_LDADD) $(LIBS) + +threads-execve$(EXEEXT): $(threads_execve_OBJECTS) $(threads_execve_DEPENDENCIES) $(EXTRA_threads_execve_DEPENDENCIES) + @rm -f threads-execve$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(threads_execve_OBJECTS) $(threads_execve_LDADD) $(LIBS) + +time$(EXEEXT): $(time_OBJECTS) $(time_DEPENDENCIES) $(EXTRA_time_DEPENDENCIES) + @rm -f time$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(time_OBJECTS) $(time_LDADD) $(LIBS) + +timer_create$(EXEEXT): $(timer_create_OBJECTS) $(timer_create_DEPENDENCIES) $(EXTRA_timer_create_DEPENDENCIES) + @rm -f timer_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timer_create_OBJECTS) $(timer_create_LDADD) $(LIBS) + +timer_xettime$(EXEEXT): $(timer_xettime_OBJECTS) $(timer_xettime_DEPENDENCIES) $(EXTRA_timer_xettime_DEPENDENCIES) + @rm -f timer_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timer_xettime_OBJECTS) $(timer_xettime_LDADD) $(LIBS) + +timerfd_xettime$(EXEEXT): $(timerfd_xettime_OBJECTS) $(timerfd_xettime_DEPENDENCIES) $(EXTRA_timerfd_xettime_DEPENDENCIES) + @rm -f timerfd_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timerfd_xettime_OBJECTS) $(timerfd_xettime_LDADD) $(LIBS) + +times$(EXEEXT): $(times_OBJECTS) $(times_DEPENDENCIES) $(EXTRA_times_DEPENDENCIES) + @rm -f times$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(times_OBJECTS) $(times_LDADD) $(LIBS) + +times-fail$(EXEEXT): $(times_fail_OBJECTS) $(times_fail_DEPENDENCIES) $(EXTRA_times_fail_DEPENDENCIES) + @rm -f times-fail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(times_fail_OBJECTS) $(times_fail_LDADD) $(LIBS) + +truncate$(EXEEXT): $(truncate_OBJECTS) $(truncate_DEPENDENCIES) $(EXTRA_truncate_DEPENDENCIES) + @rm -f truncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(truncate_OBJECTS) $(truncate_LDADD) $(LIBS) + +truncate64$(EXEEXT): $(truncate64_OBJECTS) $(truncate64_DEPENDENCIES) $(EXTRA_truncate64_DEPENDENCIES) + @rm -f truncate64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(truncate64_OBJECTS) $(truncate64_LDADD) $(LIBS) + +ugetrlimit$(EXEEXT): $(ugetrlimit_OBJECTS) $(ugetrlimit_DEPENDENCIES) $(EXTRA_ugetrlimit_DEPENDENCIES) + @rm -f ugetrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ugetrlimit_OBJECTS) $(ugetrlimit_LDADD) $(LIBS) + +uio$(EXEEXT): $(uio_OBJECTS) $(uio_DEPENDENCIES) $(EXTRA_uio_DEPENDENCIES) + @rm -f uio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(uio_OBJECTS) $(uio_LDADD) $(LIBS) + +umask$(EXEEXT): $(umask_OBJECTS) $(umask_DEPENDENCIES) $(EXTRA_umask_DEPENDENCIES) + @rm -f umask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umask_OBJECTS) $(umask_LDADD) $(LIBS) + +umount$(EXEEXT): $(umount_OBJECTS) $(umount_DEPENDENCIES) $(EXTRA_umount_DEPENDENCIES) + @rm -f umount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umount_OBJECTS) $(umount_LDADD) $(LIBS) + +umount2$(EXEEXT): $(umount2_OBJECTS) $(umount2_DEPENDENCIES) $(EXTRA_umount2_DEPENDENCIES) + @rm -f umount2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umount2_OBJECTS) $(umount2_LDADD) $(LIBS) + +umoven-illptr$(EXEEXT): $(umoven_illptr_OBJECTS) $(umoven_illptr_DEPENDENCIES) $(EXTRA_umoven_illptr_DEPENDENCIES) + @rm -f umoven-illptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umoven_illptr_OBJECTS) $(umoven_illptr_LDADD) $(LIBS) + +umovestr$(EXEEXT): $(umovestr_OBJECTS) $(umovestr_DEPENDENCIES) $(EXTRA_umovestr_DEPENDENCIES) + @rm -f umovestr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr_OBJECTS) $(umovestr_LDADD) $(LIBS) + +umovestr-illptr$(EXEEXT): $(umovestr_illptr_OBJECTS) $(umovestr_illptr_DEPENDENCIES) $(EXTRA_umovestr_illptr_DEPENDENCIES) + @rm -f umovestr-illptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr_illptr_OBJECTS) $(umovestr_illptr_LDADD) $(LIBS) + +umovestr2$(EXEEXT): $(umovestr2_OBJECTS) $(umovestr2_DEPENDENCIES) $(EXTRA_umovestr2_DEPENDENCIES) + @rm -f umovestr2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr2_OBJECTS) $(umovestr2_LDADD) $(LIBS) + +umovestr3$(EXEEXT): $(umovestr3_OBJECTS) $(umovestr3_DEPENDENCIES) $(EXTRA_umovestr3_DEPENDENCIES) + @rm -f umovestr3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr3_OBJECTS) $(umovestr3_LDADD) $(LIBS) + +uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) $(EXTRA_uname_DEPENDENCIES) + @rm -f uname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) + +unix-pair-send-recv$(EXEEXT): $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_DEPENDENCIES) $(EXTRA_unix_pair_send_recv_DEPENDENCIES) + @rm -f unix-pair-send-recv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_LDADD) $(LIBS) + +unix-pair-sendto-recvfrom$(EXEEXT): $(unix_pair_sendto_recvfrom_OBJECTS) $(unix_pair_sendto_recvfrom_DEPENDENCIES) $(EXTRA_unix_pair_sendto_recvfrom_DEPENDENCIES) + @rm -f unix-pair-sendto-recvfrom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unix_pair_sendto_recvfrom_OBJECTS) $(unix_pair_sendto_recvfrom_LDADD) $(LIBS) + +unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) $(EXTRA_unlink_DEPENDENCIES) + @rm -f unlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) + +unlinkat$(EXEEXT): $(unlinkat_OBJECTS) $(unlinkat_DEPENDENCIES) $(EXTRA_unlinkat_DEPENDENCIES) + @rm -f unlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unlinkat_OBJECTS) $(unlinkat_LDADD) $(LIBS) + +unshare$(EXEEXT): $(unshare_OBJECTS) $(unshare_DEPENDENCIES) $(EXTRA_unshare_DEPENDENCIES) + @rm -f unshare$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unshare_OBJECTS) $(unshare_LDADD) $(LIBS) + +userfaultfd$(EXEEXT): $(userfaultfd_OBJECTS) $(userfaultfd_DEPENDENCIES) $(EXTRA_userfaultfd_DEPENDENCIES) + @rm -f userfaultfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(userfaultfd_OBJECTS) $(userfaultfd_LDADD) $(LIBS) + +ustat$(EXEEXT): $(ustat_OBJECTS) $(ustat_DEPENDENCIES) $(EXTRA_ustat_DEPENDENCIES) + @rm -f ustat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ustat_OBJECTS) $(ustat_LDADD) $(LIBS) + +utime$(EXEEXT): $(utime_OBJECTS) $(utime_DEPENDENCIES) $(EXTRA_utime_DEPENDENCIES) + @rm -f utime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utime_OBJECTS) $(utime_LDADD) $(LIBS) + +utimensat$(EXEEXT): $(utimensat_OBJECTS) $(utimensat_DEPENDENCIES) $(EXTRA_utimensat_DEPENDENCIES) + @rm -f utimensat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_OBJECTS) $(utimensat_LDADD) $(LIBS) + +utimes$(EXEEXT): $(utimes_OBJECTS) $(utimes_DEPENDENCIES) $(EXTRA_utimes_DEPENDENCIES) + @rm -f utimes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimes_OBJECTS) $(utimes_LDADD) $(LIBS) + +vfork-f$(EXEEXT): $(vfork_f_OBJECTS) $(vfork_f_DEPENDENCIES) $(EXTRA_vfork_f_DEPENDENCIES) + @rm -f vfork-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfork_f_OBJECTS) $(vfork_f_LDADD) $(LIBS) + +vhangup$(EXEEXT): $(vhangup_OBJECTS) $(vhangup_DEPENDENCIES) $(EXTRA_vhangup_DEPENDENCIES) + @rm -f vhangup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vhangup_OBJECTS) $(vhangup_LDADD) $(LIBS) + +vmsplice$(EXEEXT): $(vmsplice_OBJECTS) $(vmsplice_DEPENDENCIES) $(EXTRA_vmsplice_DEPENDENCIES) + @rm -f vmsplice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vmsplice_OBJECTS) $(vmsplice_LDADD) $(LIBS) + +wait4$(EXEEXT): $(wait4_OBJECTS) $(wait4_DEPENDENCIES) $(EXTRA_wait4_DEPENDENCIES) + @rm -f wait4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wait4_OBJECTS) $(wait4_LDADD) $(LIBS) + +wait4-v$(EXEEXT): $(wait4_v_OBJECTS) $(wait4_v_DEPENDENCIES) $(EXTRA_wait4_v_DEPENDENCIES) + @rm -f wait4-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wait4_v_OBJECTS) $(wait4_v_LDADD) $(LIBS) + +waitid$(EXEEXT): $(waitid_OBJECTS) $(waitid_DEPENDENCIES) $(EXTRA_waitid_DEPENDENCIES) + @rm -f waitid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitid_OBJECTS) $(waitid_LDADD) $(LIBS) + +waitid-v$(EXEEXT): $(waitid_v_OBJECTS) $(waitid_v_DEPENDENCIES) $(EXTRA_waitid_v_DEPENDENCIES) + @rm -f waitid-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitid_v_OBJECTS) $(waitid_v_LDADD) $(LIBS) + +waitpid$(EXEEXT): $(waitpid_OBJECTS) $(waitpid_DEPENDENCIES) $(EXTRA_waitpid_DEPENDENCIES) + @rm -f waitpid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitpid_OBJECTS) $(waitpid_LDADD) $(LIBS) + +xattr$(EXEEXT): $(xattr_OBJECTS) $(xattr_DEPENDENCIES) $(EXTRA_xattr_DEPENDENCIES) + @rm -f xattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xattr_OBJECTS) $(xattr_LDADD) $(LIBS) + +xattr-strings$(EXEEXT): $(xattr_strings_OBJECTS) $(xattr_strings_DEPENDENCIES) $(EXTRA_xattr_strings_DEPENDENCIES) + @rm -f xattr-strings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xattr_strings_OBJECTS) $(xattr_strings_LDADD) $(LIBS) + +xet_robust_list$(EXEEXT): $(xet_robust_list_OBJECTS) $(xet_robust_list_DEPENDENCIES) $(EXTRA_xet_robust_list_DEPENDENCIES) + @rm -f xet_robust_list$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xet_robust_list_OBJECTS) $(xet_robust_list_LDADD) $(LIBS) + +xetitimer$(EXEEXT): $(xetitimer_OBJECTS) $(xetitimer_DEPENDENCIES) $(EXTRA_xetitimer_DEPENDENCIES) + @rm -f xetitimer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetitimer_OBJECTS) $(xetitimer_LDADD) $(LIBS) + +xetpgid$(EXEEXT): $(xetpgid_OBJECTS) $(xetpgid_DEPENDENCIES) $(EXTRA_xetpgid_DEPENDENCIES) + @rm -f xetpgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetpgid_OBJECTS) $(xetpgid_LDADD) $(LIBS) + +xetpriority$(EXEEXT): $(xetpriority_OBJECTS) $(xetpriority_DEPENDENCIES) $(EXTRA_xetpriority_DEPENDENCIES) + @rm -f xetpriority$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetpriority_OBJECTS) $(xetpriority_LDADD) $(LIBS) + +xettimeofday$(EXEEXT): $(xettimeofday_OBJECTS) $(xettimeofday_DEPENDENCIES) $(EXTRA_xettimeofday_DEPENDENCIES) + @rm -f xettimeofday$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xettimeofday_OBJECTS) $(xettimeofday_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +libtests_a-errno2name.o: errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='errno2name.c' object='libtests_a-errno2name.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c + +libtests_a-errno2name.obj: errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.obj -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.obj `if test -f 'errno2name.c'; then $(CYGPATH_W) 'errno2name.c'; else $(CYGPATH_W) '$(srcdir)/errno2name.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='errno2name.c' object='libtests_a-errno2name.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-errno2name.obj `if test -f 'errno2name.c'; then $(CYGPATH_W) 'errno2name.c'; else $(CYGPATH_W) '$(srcdir)/errno2name.c'; fi` + +libtests_a-error_msg.o: error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-error_msg.o -MD -MP -MF $(DEPDIR)/libtests_a-error_msg.Tpo -c -o libtests_a-error_msg.o `test -f 'error_msg.c' || echo '$(srcdir)/'`error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-error_msg.Tpo $(DEPDIR)/libtests_a-error_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_msg.c' object='libtests_a-error_msg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-error_msg.o `test -f 'error_msg.c' || echo '$(srcdir)/'`error_msg.c + +libtests_a-error_msg.obj: error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-error_msg.obj -MD -MP -MF $(DEPDIR)/libtests_a-error_msg.Tpo -c -o libtests_a-error_msg.obj `if test -f 'error_msg.c'; then $(CYGPATH_W) 'error_msg.c'; else $(CYGPATH_W) '$(srcdir)/error_msg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-error_msg.Tpo $(DEPDIR)/libtests_a-error_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_msg.c' object='libtests_a-error_msg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-error_msg.obj `if test -f 'error_msg.c'; then $(CYGPATH_W) 'error_msg.c'; else $(CYGPATH_W) '$(srcdir)/error_msg.c'; fi` + +libtests_a-fill_memory.o: fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-fill_memory.o -MD -MP -MF $(DEPDIR)/libtests_a-fill_memory.Tpo -c -o libtests_a-fill_memory.o `test -f 'fill_memory.c' || echo '$(srcdir)/'`fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-fill_memory.Tpo $(DEPDIR)/libtests_a-fill_memory.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fill_memory.c' object='libtests_a-fill_memory.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-fill_memory.o `test -f 'fill_memory.c' || echo '$(srcdir)/'`fill_memory.c + +libtests_a-fill_memory.obj: fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-fill_memory.obj -MD -MP -MF $(DEPDIR)/libtests_a-fill_memory.Tpo -c -o libtests_a-fill_memory.obj `if test -f 'fill_memory.c'; then $(CYGPATH_W) 'fill_memory.c'; else $(CYGPATH_W) '$(srcdir)/fill_memory.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-fill_memory.Tpo $(DEPDIR)/libtests_a-fill_memory.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fill_memory.c' object='libtests_a-fill_memory.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-fill_memory.obj `if test -f 'fill_memory.c'; then $(CYGPATH_W) 'fill_memory.c'; else $(CYGPATH_W) '$(srcdir)/fill_memory.c'; fi` + +libtests_a-get_page_size.o: get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_page_size.o -MD -MP -MF $(DEPDIR)/libtests_a-get_page_size.Tpo -c -o libtests_a-get_page_size.o `test -f 'get_page_size.c' || echo '$(srcdir)/'`get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_page_size.Tpo $(DEPDIR)/libtests_a-get_page_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_page_size.c' object='libtests_a-get_page_size.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.o `test -f 'get_page_size.c' || echo '$(srcdir)/'`get_page_size.c + +libtests_a-get_page_size.obj: get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_page_size.obj -MD -MP -MF $(DEPDIR)/libtests_a-get_page_size.Tpo -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_page_size.Tpo $(DEPDIR)/libtests_a-get_page_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_page_size.c' object='libtests_a-get_page_size.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` + +libtests_a-hexdump_strdup.o: hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexdump_strdup.c' object='libtests_a-hexdump_strdup.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c + +libtests_a-hexdump_strdup.obj: hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.obj -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.obj `if test -f 'hexdump_strdup.c'; then $(CYGPATH_W) 'hexdump_strdup.c'; else $(CYGPATH_W) '$(srcdir)/hexdump_strdup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexdump_strdup.c' object='libtests_a-hexdump_strdup.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexdump_strdup.obj `if test -f 'hexdump_strdup.c'; then $(CYGPATH_W) 'hexdump_strdup.c'; else $(CYGPATH_W) '$(srcdir)/hexdump_strdup.c'; fi` + +libtests_a-hexquote_strndup.o: hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexquote_strndup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexquote_strndup.Tpo -c -o libtests_a-hexquote_strndup.o `test -f 'hexquote_strndup.c' || echo '$(srcdir)/'`hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexquote_strndup.Tpo $(DEPDIR)/libtests_a-hexquote_strndup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexquote_strndup.c' object='libtests_a-hexquote_strndup.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.o `test -f 'hexquote_strndup.c' || echo '$(srcdir)/'`hexquote_strndup.c + +libtests_a-hexquote_strndup.obj: hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexquote_strndup.obj -MD -MP -MF $(DEPDIR)/libtests_a-hexquote_strndup.Tpo -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexquote_strndup.Tpo $(DEPDIR)/libtests_a-hexquote_strndup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexquote_strndup.c' object='libtests_a-hexquote_strndup.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` + +libtests_a-inode_of_sockfd.o: inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.o -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inode_of_sockfd.c' object='libtests_a-inode_of_sockfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c + +libtests_a-inode_of_sockfd.obj: inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.obj `if test -f 'inode_of_sockfd.c'; then $(CYGPATH_W) 'inode_of_sockfd.c'; else $(CYGPATH_W) '$(srcdir)/inode_of_sockfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inode_of_sockfd.c' object='libtests_a-inode_of_sockfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-inode_of_sockfd.obj `if test -f 'inode_of_sockfd.c'; then $(CYGPATH_W) 'inode_of_sockfd.c'; else $(CYGPATH_W) '$(srcdir)/inode_of_sockfd.c'; fi` + +libtests_a-libmmsg.o: libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libmmsg.o -MD -MP -MF $(DEPDIR)/libtests_a-libmmsg.Tpo -c -o libtests_a-libmmsg.o `test -f 'libmmsg.c' || echo '$(srcdir)/'`libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libmmsg.Tpo $(DEPDIR)/libtests_a-libmmsg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libmmsg.c' object='libtests_a-libmmsg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libmmsg.o `test -f 'libmmsg.c' || echo '$(srcdir)/'`libmmsg.c + +libtests_a-libmmsg.obj: libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libmmsg.obj -MD -MP -MF $(DEPDIR)/libtests_a-libmmsg.Tpo -c -o libtests_a-libmmsg.obj `if test -f 'libmmsg.c'; then $(CYGPATH_W) 'libmmsg.c'; else $(CYGPATH_W) '$(srcdir)/libmmsg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libmmsg.Tpo $(DEPDIR)/libtests_a-libmmsg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libmmsg.c' object='libtests_a-libmmsg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libmmsg.obj `if test -f 'libmmsg.c'; then $(CYGPATH_W) 'libmmsg.c'; else $(CYGPATH_W) '$(srcdir)/libmmsg.c'; fi` + +libtests_a-libsocketcall.o: libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libsocketcall.o -MD -MP -MF $(DEPDIR)/libtests_a-libsocketcall.Tpo -c -o libtests_a-libsocketcall.o `test -f 'libsocketcall.c' || echo '$(srcdir)/'`libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libsocketcall.Tpo $(DEPDIR)/libtests_a-libsocketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libsocketcall.c' object='libtests_a-libsocketcall.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libsocketcall.o `test -f 'libsocketcall.c' || echo '$(srcdir)/'`libsocketcall.c + +libtests_a-libsocketcall.obj: libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libsocketcall.obj -MD -MP -MF $(DEPDIR)/libtests_a-libsocketcall.Tpo -c -o libtests_a-libsocketcall.obj `if test -f 'libsocketcall.c'; then $(CYGPATH_W) 'libsocketcall.c'; else $(CYGPATH_W) '$(srcdir)/libsocketcall.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libsocketcall.Tpo $(DEPDIR)/libtests_a-libsocketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libsocketcall.c' object='libtests_a-libsocketcall.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libsocketcall.obj `if test -f 'libsocketcall.c'; then $(CYGPATH_W) 'libsocketcall.c'; else $(CYGPATH_W) '$(srcdir)/libsocketcall.c'; fi` + +libtests_a-overflowuid.o: overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-overflowuid.o -MD -MP -MF $(DEPDIR)/libtests_a-overflowuid.Tpo -c -o libtests_a-overflowuid.o `test -f 'overflowuid.c' || echo '$(srcdir)/'`overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-overflowuid.Tpo $(DEPDIR)/libtests_a-overflowuid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='overflowuid.c' object='libtests_a-overflowuid.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-overflowuid.o `test -f 'overflowuid.c' || echo '$(srcdir)/'`overflowuid.c + +libtests_a-overflowuid.obj: overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-overflowuid.obj -MD -MP -MF $(DEPDIR)/libtests_a-overflowuid.Tpo -c -o libtests_a-overflowuid.obj `if test -f 'overflowuid.c'; then $(CYGPATH_W) 'overflowuid.c'; else $(CYGPATH_W) '$(srcdir)/overflowuid.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-overflowuid.Tpo $(DEPDIR)/libtests_a-overflowuid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='overflowuid.c' object='libtests_a-overflowuid.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-overflowuid.obj `if test -f 'overflowuid.c'; then $(CYGPATH_W) 'overflowuid.c'; else $(CYGPATH_W) '$(srcdir)/overflowuid.c'; fi` + +libtests_a-pipe_maxfd.o: pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-pipe_maxfd.o -MD -MP -MF $(DEPDIR)/libtests_a-pipe_maxfd.Tpo -c -o libtests_a-pipe_maxfd.o `test -f 'pipe_maxfd.c' || echo '$(srcdir)/'`pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-pipe_maxfd.Tpo $(DEPDIR)/libtests_a-pipe_maxfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe_maxfd.c' object='libtests_a-pipe_maxfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-pipe_maxfd.o `test -f 'pipe_maxfd.c' || echo '$(srcdir)/'`pipe_maxfd.c + +libtests_a-pipe_maxfd.obj: pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-pipe_maxfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-pipe_maxfd.Tpo -c -o libtests_a-pipe_maxfd.obj `if test -f 'pipe_maxfd.c'; then $(CYGPATH_W) 'pipe_maxfd.c'; else $(CYGPATH_W) '$(srcdir)/pipe_maxfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-pipe_maxfd.Tpo $(DEPDIR)/libtests_a-pipe_maxfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe_maxfd.c' object='libtests_a-pipe_maxfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-pipe_maxfd.obj `if test -f 'pipe_maxfd.c'; then $(CYGPATH_W) 'pipe_maxfd.c'; else $(CYGPATH_W) '$(srcdir)/pipe_maxfd.c'; fi` + +libtests_a-print_quoted_string.o: print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_quoted_string.o -MD -MP -MF $(DEPDIR)/libtests_a-print_quoted_string.Tpo -c -o libtests_a-print_quoted_string.o `test -f 'print_quoted_string.c' || echo '$(srcdir)/'`print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_quoted_string.Tpo $(DEPDIR)/libtests_a-print_quoted_string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_quoted_string.c' object='libtests_a-print_quoted_string.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.o `test -f 'print_quoted_string.c' || echo '$(srcdir)/'`print_quoted_string.c + +libtests_a-print_quoted_string.obj: print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_quoted_string.obj -MD -MP -MF $(DEPDIR)/libtests_a-print_quoted_string.Tpo -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_quoted_string.Tpo $(DEPDIR)/libtests_a-print_quoted_string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_quoted_string.c' object='libtests_a-print_quoted_string.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` + +libtests_a-printflags.o: printflags.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.o -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printflags.c' object='libtests_a-printflags.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c + +libtests_a-printflags.obj: printflags.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.obj -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.obj `if test -f 'printflags.c'; then $(CYGPATH_W) 'printflags.c'; else $(CYGPATH_W) '$(srcdir)/printflags.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printflags.c' object='libtests_a-printflags.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printflags.obj `if test -f 'printflags.c'; then $(CYGPATH_W) 'printflags.c'; else $(CYGPATH_W) '$(srcdir)/printflags.c'; fi` + +libtests_a-printxval.o: printxval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printxval.o -MD -MP -MF $(DEPDIR)/libtests_a-printxval.Tpo -c -o libtests_a-printxval.o `test -f 'printxval.c' || echo '$(srcdir)/'`printxval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printxval.Tpo $(DEPDIR)/libtests_a-printxval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printxval.c' object='libtests_a-printxval.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printxval.o `test -f 'printxval.c' || echo '$(srcdir)/'`printxval.c + +libtests_a-printxval.obj: printxval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printxval.obj -MD -MP -MF $(DEPDIR)/libtests_a-printxval.Tpo -c -o libtests_a-printxval.obj `if test -f 'printxval.c'; then $(CYGPATH_W) 'printxval.c'; else $(CYGPATH_W) '$(srcdir)/printxval.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printxval.Tpo $(DEPDIR)/libtests_a-printxval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printxval.c' object='libtests_a-printxval.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printxval.obj `if test -f 'printxval.c'; then $(CYGPATH_W) 'printxval.c'; else $(CYGPATH_W) '$(srcdir)/printxval.c'; fi` + +libtests_a-signal2name.o: signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-signal2name.o -MD -MP -MF $(DEPDIR)/libtests_a-signal2name.Tpo -c -o libtests_a-signal2name.o `test -f 'signal2name.c' || echo '$(srcdir)/'`signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-signal2name.Tpo $(DEPDIR)/libtests_a-signal2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal2name.c' object='libtests_a-signal2name.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.o `test -f 'signal2name.c' || echo '$(srcdir)/'`signal2name.c + +libtests_a-signal2name.obj: signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-signal2name.obj -MD -MP -MF $(DEPDIR)/libtests_a-signal2name.Tpo -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-signal2name.Tpo $(DEPDIR)/libtests_a-signal2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal2name.c' object='libtests_a-signal2name.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` + +libtests_a-sprintrc.o: sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.o -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sprintrc.c' object='libtests_a-sprintrc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c + +libtests_a-sprintrc.obj: sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.obj -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.obj `if test -f 'sprintrc.c'; then $(CYGPATH_W) 'sprintrc.c'; else $(CYGPATH_W) '$(srcdir)/sprintrc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sprintrc.c' object='libtests_a-sprintrc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-sprintrc.obj `if test -f 'sprintrc.c'; then $(CYGPATH_W) 'sprintrc.c'; else $(CYGPATH_W) '$(srcdir)/sprintrc.c'; fi` + +libtests_a-tail_alloc.o: tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tail_alloc.o -MD -MP -MF $(DEPDIR)/libtests_a-tail_alloc.Tpo -c -o libtests_a-tail_alloc.o `test -f 'tail_alloc.c' || echo '$(srcdir)/'`tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tail_alloc.Tpo $(DEPDIR)/libtests_a-tail_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tail_alloc.c' object='libtests_a-tail_alloc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.o `test -f 'tail_alloc.c' || echo '$(srcdir)/'`tail_alloc.c + +libtests_a-tail_alloc.obj: tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tail_alloc.obj -MD -MP -MF $(DEPDIR)/libtests_a-tail_alloc.Tpo -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tail_alloc.Tpo $(DEPDIR)/libtests_a-tail_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tail_alloc.c' object='libtests_a-tail_alloc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` + +libtests_a-tprintf.o: tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.o -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tprintf.c' object='libtests_a-tprintf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c + +libtests_a-tprintf.obj: tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.obj -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.obj `if test -f 'tprintf.c'; then $(CYGPATH_W) 'tprintf.c'; else $(CYGPATH_W) '$(srcdir)/tprintf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tprintf.c' object='libtests_a-tprintf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tprintf.obj `if test -f 'tprintf.c'; then $(CYGPATH_W) 'tprintf.c'; else $(CYGPATH_W) '$(srcdir)/tprintf.c'; fi` + +fstat64-fstat64.o: fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstat64-fstat64.o -MD -MP -MF $(DEPDIR)/fstat64-fstat64.Tpo -c -o fstat64-fstat64.o `test -f 'fstat64.c' || echo '$(srcdir)/'`fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstat64-fstat64.Tpo $(DEPDIR)/fstat64-fstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat64.c' object='fstat64-fstat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstat64-fstat64.o `test -f 'fstat64.c' || echo '$(srcdir)/'`fstat64.c + +fstat64-fstat64.obj: fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstat64-fstat64.obj -MD -MP -MF $(DEPDIR)/fstat64-fstat64.Tpo -c -o fstat64-fstat64.obj `if test -f 'fstat64.c'; then $(CYGPATH_W) 'fstat64.c'; else $(CYGPATH_W) '$(srcdir)/fstat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstat64-fstat64.Tpo $(DEPDIR)/fstat64-fstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat64.c' object='fstat64-fstat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstat64-fstat64.obj `if test -f 'fstat64.c'; then $(CYGPATH_W) 'fstat64.c'; else $(CYGPATH_W) '$(srcdir)/fstat64.c'; fi` + +fstatat64-fstatat64.o: fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstatat64-fstatat64.o -MD -MP -MF $(DEPDIR)/fstatat64-fstatat64.Tpo -c -o fstatat64-fstatat64.o `test -f 'fstatat64.c' || echo '$(srcdir)/'`fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstatat64-fstatat64.Tpo $(DEPDIR)/fstatat64-fstatat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatat64.c' object='fstatat64-fstatat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstatat64-fstatat64.o `test -f 'fstatat64.c' || echo '$(srcdir)/'`fstatat64.c + +fstatat64-fstatat64.obj: fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstatat64-fstatat64.obj -MD -MP -MF $(DEPDIR)/fstatat64-fstatat64.Tpo -c -o fstatat64-fstatat64.obj `if test -f 'fstatat64.c'; then $(CYGPATH_W) 'fstatat64.c'; else $(CYGPATH_W) '$(srcdir)/fstatat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstatat64-fstatat64.Tpo $(DEPDIR)/fstatat64-fstatat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatat64.c' object='fstatat64-fstatat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstatat64-fstatat64.obj `if test -f 'fstatat64.c'; then $(CYGPATH_W) 'fstatat64.c'; else $(CYGPATH_W) '$(srcdir)/fstatat64.c'; fi` + +ftruncate64-ftruncate64.o: ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ftruncate64-ftruncate64.o -MD -MP -MF $(DEPDIR)/ftruncate64-ftruncate64.Tpo -c -o ftruncate64-ftruncate64.o `test -f 'ftruncate64.c' || echo '$(srcdir)/'`ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ftruncate64-ftruncate64.Tpo $(DEPDIR)/ftruncate64-ftruncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftruncate64.c' object='ftruncate64-ftruncate64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ftruncate64-ftruncate64.o `test -f 'ftruncate64.c' || echo '$(srcdir)/'`ftruncate64.c + +ftruncate64-ftruncate64.obj: ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ftruncate64-ftruncate64.obj -MD -MP -MF $(DEPDIR)/ftruncate64-ftruncate64.Tpo -c -o ftruncate64-ftruncate64.obj `if test -f 'ftruncate64.c'; then $(CYGPATH_W) 'ftruncate64.c'; else $(CYGPATH_W) '$(srcdir)/ftruncate64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ftruncate64-ftruncate64.Tpo $(DEPDIR)/ftruncate64-ftruncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftruncate64.c' object='ftruncate64-ftruncate64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ftruncate64-ftruncate64.obj `if test -f 'ftruncate64.c'; then $(CYGPATH_W) 'ftruncate64.c'; else $(CYGPATH_W) '$(srcdir)/ftruncate64.c'; fi` + +lstat64-lstat64.o: lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lstat64-lstat64.o -MD -MP -MF $(DEPDIR)/lstat64-lstat64.Tpo -c -o lstat64-lstat64.o `test -f 'lstat64.c' || echo '$(srcdir)/'`lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lstat64-lstat64.Tpo $(DEPDIR)/lstat64-lstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lstat64.c' object='lstat64-lstat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lstat64-lstat64.o `test -f 'lstat64.c' || echo '$(srcdir)/'`lstat64.c + +lstat64-lstat64.obj: lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lstat64-lstat64.obj -MD -MP -MF $(DEPDIR)/lstat64-lstat64.Tpo -c -o lstat64-lstat64.obj `if test -f 'lstat64.c'; then $(CYGPATH_W) 'lstat64.c'; else $(CYGPATH_W) '$(srcdir)/lstat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lstat64-lstat64.Tpo $(DEPDIR)/lstat64-lstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lstat64.c' object='lstat64-lstat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lstat64-lstat64.obj `if test -f 'lstat64.c'; then $(CYGPATH_W) 'lstat64.c'; else $(CYGPATH_W) '$(srcdir)/lstat64.c'; fi` + +mmap64-mmap64.o: mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64-mmap64.o -MD -MP -MF $(DEPDIR)/mmap64-mmap64.Tpo -c -o mmap64-mmap64.o `test -f 'mmap64.c' || echo '$(srcdir)/'`mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64-mmap64.Tpo $(DEPDIR)/mmap64-mmap64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64.c' object='mmap64-mmap64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.o `test -f 'mmap64.c' || echo '$(srcdir)/'`mmap64.c + +mmap64-mmap64.obj: mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64-mmap64.obj -MD -MP -MF $(DEPDIR)/mmap64-mmap64.Tpo -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64-mmap64.Tpo $(DEPDIR)/mmap64-mmap64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64.c' object='mmap64-mmap64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` + +newfstatat-newfstatat.o: newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.o -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='newfstatat.c' object='newfstatat-newfstatat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c + +newfstatat-newfstatat.obj: newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.obj -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.obj `if test -f 'newfstatat.c'; then $(CYGPATH_W) 'newfstatat.c'; else $(CYGPATH_W) '$(srcdir)/newfstatat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='newfstatat.c' object='newfstatat-newfstatat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o newfstatat-newfstatat.obj `if test -f 'newfstatat.c'; then $(CYGPATH_W) 'newfstatat.c'; else $(CYGPATH_W) '$(srcdir)/newfstatat.c'; fi` + +pread64_pwrite64-pread64-pwrite64.o: pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pread64_pwrite64-pread64-pwrite64.o -MD -MP -MF $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo -c -o pread64_pwrite64-pread64-pwrite64.o `test -f 'pread64-pwrite64.c' || echo '$(srcdir)/'`pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pread64-pwrite64.c' object='pread64_pwrite64-pread64-pwrite64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pread64_pwrite64-pread64-pwrite64.o `test -f 'pread64-pwrite64.c' || echo '$(srcdir)/'`pread64-pwrite64.c + +pread64_pwrite64-pread64-pwrite64.obj: pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pread64_pwrite64-pread64-pwrite64.obj -MD -MP -MF $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo -c -o pread64_pwrite64-pread64-pwrite64.obj `if test -f 'pread64-pwrite64.c'; then $(CYGPATH_W) 'pread64-pwrite64.c'; else $(CYGPATH_W) '$(srcdir)/pread64-pwrite64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pread64-pwrite64.c' object='pread64_pwrite64-pread64-pwrite64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pread64_pwrite64-pread64-pwrite64.obj `if test -f 'pread64-pwrite64.c'; then $(CYGPATH_W) 'pread64-pwrite64.c'; else $(CYGPATH_W) '$(srcdir)/pread64-pwrite64.c'; fi` + +preadv-preadv.o: preadv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv-preadv.o -MD -MP -MF $(DEPDIR)/preadv-preadv.Tpo -c -o preadv-preadv.o `test -f 'preadv.c' || echo '$(srcdir)/'`preadv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv-preadv.Tpo $(DEPDIR)/preadv-preadv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv.c' object='preadv-preadv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv-preadv.o `test -f 'preadv.c' || echo '$(srcdir)/'`preadv.c + +preadv-preadv.obj: preadv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv-preadv.obj -MD -MP -MF $(DEPDIR)/preadv-preadv.Tpo -c -o preadv-preadv.obj `if test -f 'preadv.c'; then $(CYGPATH_W) 'preadv.c'; else $(CYGPATH_W) '$(srcdir)/preadv.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv-preadv.Tpo $(DEPDIR)/preadv-preadv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv.c' object='preadv-preadv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv-preadv.obj `if test -f 'preadv.c'; then $(CYGPATH_W) 'preadv.c'; else $(CYGPATH_W) '$(srcdir)/preadv.c'; fi` + +preadv_pwritev-preadv-pwritev.o: preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv_pwritev-preadv-pwritev.o -MD -MP -MF $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo -c -o preadv_pwritev-preadv-pwritev.o `test -f 'preadv-pwritev.c' || echo '$(srcdir)/'`preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo $(DEPDIR)/preadv_pwritev-preadv-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv-pwritev.c' object='preadv_pwritev-preadv-pwritev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv_pwritev-preadv-pwritev.o `test -f 'preadv-pwritev.c' || echo '$(srcdir)/'`preadv-pwritev.c + +preadv_pwritev-preadv-pwritev.obj: preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv_pwritev-preadv-pwritev.obj -MD -MP -MF $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo -c -o preadv_pwritev-preadv-pwritev.obj `if test -f 'preadv-pwritev.c'; then $(CYGPATH_W) 'preadv-pwritev.c'; else $(CYGPATH_W) '$(srcdir)/preadv-pwritev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo $(DEPDIR)/preadv_pwritev-preadv-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv-pwritev.c' object='preadv_pwritev-preadv-pwritev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv_pwritev-preadv-pwritev.obj `if test -f 'preadv-pwritev.c'; then $(CYGPATH_W) 'preadv-pwritev.c'; else $(CYGPATH_W) '$(srcdir)/preadv-pwritev.c'; fi` + +pwritev-pwritev.o: pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pwritev-pwritev.o -MD -MP -MF $(DEPDIR)/pwritev-pwritev.Tpo -c -o pwritev-pwritev.o `test -f 'pwritev.c' || echo '$(srcdir)/'`pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwritev-pwritev.Tpo $(DEPDIR)/pwritev-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pwritev.c' object='pwritev-pwritev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pwritev-pwritev.o `test -f 'pwritev.c' || echo '$(srcdir)/'`pwritev.c + +pwritev-pwritev.obj: pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pwritev-pwritev.obj -MD -MP -MF $(DEPDIR)/pwritev-pwritev.Tpo -c -o pwritev-pwritev.obj `if test -f 'pwritev.c'; then $(CYGPATH_W) 'pwritev.c'; else $(CYGPATH_W) '$(srcdir)/pwritev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwritev-pwritev.Tpo $(DEPDIR)/pwritev-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pwritev.c' object='pwritev-pwritev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pwritev-pwritev.obj `if test -f 'pwritev.c'; then $(CYGPATH_W) 'pwritev.c'; else $(CYGPATH_W) '$(srcdir)/pwritev.c'; fi` + +stat64-stat64.o: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stat64-stat64.o -MD -MP -MF $(DEPDIR)/stat64-stat64.Tpo -c -o stat64-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat64-stat64.Tpo $(DEPDIR)/stat64-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='stat64-stat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stat64-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c + +stat64-stat64.obj: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stat64-stat64.obj -MD -MP -MF $(DEPDIR)/stat64-stat64.Tpo -c -o stat64-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat64-stat64.Tpo $(DEPDIR)/stat64-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='stat64-stat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stat64-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` + +statfs-statfs.o: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT statfs-statfs.o -MD -MP -MF $(DEPDIR)/statfs-statfs.Tpo -c -o statfs-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/statfs-statfs.Tpo $(DEPDIR)/statfs-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='statfs-statfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o statfs-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c + +statfs-statfs.obj: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT statfs-statfs.obj -MD -MP -MF $(DEPDIR)/statfs-statfs.Tpo -c -o statfs-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/statfs-statfs.Tpo $(DEPDIR)/statfs-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='statfs-statfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o statfs-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` + +truncate64-truncate64.o: truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT truncate64-truncate64.o -MD -MP -MF $(DEPDIR)/truncate64-truncate64.Tpo -c -o truncate64-truncate64.o `test -f 'truncate64.c' || echo '$(srcdir)/'`truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/truncate64-truncate64.Tpo $(DEPDIR)/truncate64-truncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate64.c' object='truncate64-truncate64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o truncate64-truncate64.o `test -f 'truncate64.c' || echo '$(srcdir)/'`truncate64.c + +truncate64-truncate64.obj: truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT truncate64-truncate64.obj -MD -MP -MF $(DEPDIR)/truncate64-truncate64.Tpo -c -o truncate64-truncate64.obj `if test -f 'truncate64.c'; then $(CYGPATH_W) 'truncate64.c'; else $(CYGPATH_W) '$(srcdir)/truncate64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/truncate64-truncate64.Tpo $(DEPDIR)/truncate64-truncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate64.c' object='truncate64-truncate64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o truncate64-truncate64.obj `if test -f 'truncate64.c'; then $(CYGPATH_W) 'truncate64.c'; else $(CYGPATH_W) '$(srcdir)/truncate64.c'; fi` + +uio-uio.o: uio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uio-uio.o -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c + +uio-uio.obj: uio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uio-uio.obj -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` +check-valgrind-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_LIBRARIES) $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +clean: clean-am + +clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \ + check-valgrind-am check-valgrind-local clean \ + clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am + + +@VALGRIND_CHECK_RULES@ + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h +$(objects): scno.h + +syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ + +scno.h: $(top_srcdir)/scno.head syscallent.i + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + cat $< >> $@-t + LC_ALL=C sed -n '$(SCNO_SED)' $(filter-out $<,$^) >> $@-t + mv $@-t $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests-mx32/_newselect.c b/tests-mx32/_newselect.c new file mode 100644 index 00000000..ae2bc51a --- /dev/null +++ b/tests-mx32/_newselect.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR__newselect + +# define TEST_SYSCALL_NR __NR__newselect +# define TEST_SYSCALL_STR "_newselect" +# include "xselect.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR__newselect") + +#endif diff --git a/tests-mx32/_newselect.test b/tests-mx32/_newselect.test new file mode 100755 index 00000000..3371d4db --- /dev/null +++ b/tests-mx32/_newselect.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check _newselect syscall decoding. + +. "${srcdir=.}/select.test" diff --git a/tests-mx32/accept.c b/tests-mx32/accept.c new file mode 100644 index 00000000..8d42ba15 --- /dev/null +++ b/tests-mx32/accept.c @@ -0,0 +1,85 @@ +/* + * Check decoding of accept syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME accept +#endif + +#define TEST_SYSCALL_PREPARE connect_un() +static void connect_un(void); +#include "sockname.c" + +static void +connect_un(void) +{ + int cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd < 0) + perror_msg_and_skip("socket"); + + struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET ".connect" + }; + + (void) unlink(un.sun_path); + if (bind(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + un.sun_path[sizeof(TEST_SOCKET) - 1] = '\0'; + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); +} + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + if (listen(lfd, 16)) + perror_msg_and_skip("listen"); + + test_sockname_syscall(lfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/accept.test b/tests-mx32/accept.test new file mode 100755 index 00000000..b5e07904 --- /dev/null +++ b/tests-mx32/accept.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of accept syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/accept4.c b/tests-mx32/accept4.c new file mode 100644 index 00000000..d26e15c5 --- /dev/null +++ b/tests-mx32/accept4.c @@ -0,0 +1,44 @@ +/* + * Check decoding of accept4 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined HAVE_ACCEPT4 && defined O_CLOEXEC + +# define TEST_SYSCALL_NAME accept4 +# define SUFFIX_ARGS , O_CLOEXEC +# define SUFFIX_STR ", SOCK_CLOEXEC" +# include "accept.c" + +#else + +SKIP_MAIN_UNDEFINED("HAVE_ACCEPT4 && O_CLOEXEC") + +#endif diff --git a/tests-mx32/accept4.test b/tests-mx32/accept4.test new file mode 100755 index 00000000..722f25a5 --- /dev/null +++ b/tests-mx32/accept4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of accept4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-mx32/access.c b/tests-mx32/access.c new file mode 100644 index 00000000..e6f169b2 --- /dev/null +++ b/tests-mx32/access.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#ifdef __NR_access + +# include +# include + +int +main(void) +{ + static const char sample[] = "access_sample"; + + long rc = syscall(__NR_access, sample, F_OK); + printf("access(\"%s\", F_OK) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = syscall(__NR_access, sample, R_OK|W_OK|X_OK); + printf("access(\"%s\", R_OK|W_OK|X_OK) = %ld %s (%m)\n", + sample, rc, errno2name()); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_access") + +#endif diff --git a/tests-mx32/access.test b/tests-mx32/access.test new file mode 100755 index 00000000..3ab2eb4b --- /dev/null +++ b/tests-mx32/access.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check access syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -eaccess -a30 $args > "$EXP" + +# Filter out access() calls made by libc. +grep -F access_sample < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/acct.c b/tests-mx32/acct.c new file mode 100644 index 00000000..1cc3fa56 --- /dev/null +++ b/tests-mx32/acct.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_acct + +# include +# include + +int +main(void) +{ + const char sample[] = "acct_sample"; + + long rc = syscall(__NR_acct, sample); + printf("acct(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR__acct") + +#endif diff --git a/tests-mx32/acct.test b/tests-mx32/acct.test new file mode 100755 index 00000000..b9bca754 --- /dev/null +++ b/tests-mx32/acct.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check acct syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/add_key.c b/tests-mx32/add_key.c new file mode 100644 index 00000000..d2696f9b --- /dev/null +++ b/tests-mx32/add_key.c @@ -0,0 +1,153 @@ +/* + * Check decoding of add_key syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_add_key + +# include +# include +# include + +void +print_val_str(const void *ptr, const char *str) +{ + if (str) + printf("%s, ", str); + else + printf("%p, ", ptr); +} + +void +do_add_key(const char *type, const char *type_str, const char *desc, + const char *desc_str, const char *payload, const char *payload_str, + size_t plen, int32_t keyring, const char *keyring_str) +{ + long rc = syscall(__NR_add_key, type, desc, payload, plen, keyring); + const char *errstr = sprintrc(rc); + printf("add_key("); + print_val_str(type, type_str); + print_val_str(desc, desc_str); + print_val_str(payload, payload_str); + printf("%zu, ", plen); + if (keyring_str) + printf("%s", keyring_str); + else + printf("%d", keyring); + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char unterminated3[] = + { '\16', '\17', '\20', '\21', '\22' }; + + char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *bogus_payload = tail_memdup(unterminated3, sizeof(unterminated3)); + + unsigned i; + unsigned j; + unsigned k; + unsigned l; + + struct { + const char *type; + const char *str; + } types[] = { + { ARG_STR(NULL) }, + { bogus_type + sizeof(unterminated1), NULL }, + { bogus_type, NULL }, + { ARG_STR("\20\21\22\23\24") }, + { ARG_STR("user") }, + }; + + struct { + const char *desc; + const char *str; + } descs[] = { + { ARG_STR(NULL) }, + { bogus_desc + sizeof(unterminated2), NULL }, + { bogus_desc, NULL }, + { ARG_STR("\25\26\27\30\31") }, + { ARG_STR("desc") }, + { "overly long description", _STR("overly long ") "..." }, + }; + + struct { + const char *pload; + const char *str; + size_t plen; + } payloads[] = { + { ARG_STR(NULL), 0 }, + { bogus_payload + sizeof(unterminated3), NULL, + (size_t) 0xdeadbeefbadc0dedULL }, + { bogus_payload, _STR(""), 0 }, + { bogus_payload, _STR("\16\17\20\21\22"), 5 }, + { bogus_payload, NULL, 10 }, + { "overly long payload", _STR("overly long ") "...", 15 }, + }; + + struct { + uint32_t keyring; + const char *str; + } keyrings[] = { + { ARG_STR(0) }, + { ARG_STR(1234567890) }, + { ARG_STR(-1234567890) }, + { -1, "KEY_SPEC_THREAD_KEYRING" }, + }; + + for (i = 0; i < ARRAY_SIZE(types); i++) + for (j = 0; j < ARRAY_SIZE(descs); j++) + for (k = 0; k < ARRAY_SIZE(payloads); k++) + for (l = 0; l < ARRAY_SIZE(keyrings); l++) + do_add_key(types[i].type, types[i].str, + descs[j].desc, descs[j].str, + payloads[k].pload, + payloads[k].str, + payloads[k].plen, + keyrings[l].keyring, + keyrings[l].str); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_add_key"); + +#endif diff --git a/tests-mx32/add_key.test b/tests-mx32/add_key.test new file mode 100755 index 00000000..eadd8c2b --- /dev/null +++ b/tests-mx32/add_key.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of add_key syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -s12 diff --git a/tests-mx32/adjtimex.c b/tests-mx32/adjtimex.c new file mode 100644 index 00000000..1638b535 --- /dev/null +++ b/tests-mx32/adjtimex.c @@ -0,0 +1,83 @@ +/* + * This file is part of adjtimex strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + adjtimex(NULL); + printf("adjtimex\\(NULL\\) = -1 EFAULT \\(%m\\)\n"); + + struct timex * const tx = tail_alloc(sizeof(*tx)); + memset(tx, 0, sizeof(*tx)); + + int state = adjtimex(tx); + if (state < 0) + perror_msg_and_skip("adjtimex"); + + printf("adjtimex\\(\\{modes=0, offset=%jd, freq=%jd, maxerror=%jd" + ", esterror=%jd, status=%s, constant=%jd, precision=%jd" + ", tolerance=%jd, time=\\{tv_sec=%jd, tv_usec=%jd\\}, tick=%jd, " + "ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd, " + "calcnt=%jd, errcnt=%jd, stbcnt=%jd" +#ifdef HAVE_STRUCT_TIMEX_TAI + ", tai=%d" +#endif + "\\}\\) = %d \\(TIME_[A-Z]+\\)\n", + (intmax_t) tx->offset, + (intmax_t) tx->freq, + (intmax_t) tx->maxerror, + (intmax_t) tx->esterror, + tx->status ? "STA_[A-Z]+(\\|STA_[A-Z]+)*" : "0", + (intmax_t) tx->constant, + (intmax_t) tx->precision, + (intmax_t) tx->tolerance, + (intmax_t) tx->time.tv_sec, + (intmax_t) tx->time.tv_usec, + (intmax_t) tx->tick, + (intmax_t) tx->ppsfreq, + (intmax_t) tx->jitter, + tx->shift, + (intmax_t) tx->stabil, + (intmax_t) tx->jitcnt, + (intmax_t) tx->calcnt, + (intmax_t) tx->errcnt, + (intmax_t) tx->stbcnt, +#ifdef HAVE_STRUCT_TIMEX_TAI + tx->tai, +#endif + state); + + return 0; +} diff --git a/tests-mx32/adjtimex.test b/tests-mx32/adjtimex.test new file mode 100755 index 00000000..01405501 --- /dev/null +++ b/tests-mx32/adjtimex.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check adjtimex syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a 15 -e adjtimex $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/aio.c b/tests-mx32/aio.c new file mode 100644 index 00000000..0766d23a --- /dev/null +++ b/tests-mx32/aio.c @@ -0,0 +1,368 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#if defined __NR_io_setup \ + && defined __NR_io_submit \ + && defined __NR_io_getevents \ + && defined __NR_io_cancel \ + && defined __NR_io_destroy +# include + +int +main(void) +{ + static const long bogus_ctx = + (long) 0xface1e55deadbeefLL; + + static const char data2[] = + "\0\1\2\3cat test test test 0123456789abcdef"; + + const unsigned int sizeof_data0 = 4096; + const unsigned int sizeof_data1 = 8192; + void *data0 = tail_alloc(sizeof_data0); + void *data1 = tail_alloc(sizeof_data1); + + const struct iocb proto_cb[] = { + { + .aio_data = (unsigned long) 0xfeedface11111111ULL, + .aio_reqprio = 11, + .aio_buf = (unsigned long) data0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = sizeof_data0 + }, + { + .aio_data = (unsigned long) 0xfeedface22222222ULL, + .aio_reqprio = 22, + .aio_buf = (unsigned long) data1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = sizeof_data1 + } + }; + const struct iocb *cb = tail_memdup(proto_cb, sizeof(proto_cb)); + + const struct iovec proto_iov0[] = { + { + .iov_base = data0, + .iov_len = sizeof_data0 / 4 + }, + { + .iov_base = data0 + sizeof_data0 / 4, + .iov_len = sizeof_data0 / 4 * 3 + }, + }; + const struct iovec *iov0 = tail_memdup(proto_iov0, sizeof(proto_iov0)); + + const struct iovec proto_iov1[] = { + { + .iov_base = data1, + .iov_len = sizeof_data1 / 4 + }, + { + .iov_base = data1 + sizeof_data1 / 4, + .iov_len = sizeof_data1 / 4 * 3 + }, + }; + const struct iovec *iov1 = tail_memdup(proto_iov1, sizeof(proto_iov1)); + + const struct iocb proto_cbv[] = { + { + .aio_data = (unsigned long) 0xfeed11111111faceULL, + .aio_lio_opcode = 7, + .aio_reqprio = 111, + .aio_buf = (unsigned long) iov0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = ARRAY_SIZE(proto_iov0) + }, + { + .aio_data = (unsigned long) 0xfeed22222222faceULL, + .aio_lio_opcode = 7, + .aio_reqprio = 222, + .aio_buf = (unsigned long) iov1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = ARRAY_SIZE(proto_iov1) + } + }; + const struct iocb *cbv = tail_memdup(proto_cbv, sizeof(proto_cbv)); + + /* For additional decoder testing */ + const struct iocb proto_cbv2[] = { + { + .aio_data = 0xbadfacedc0ffeeedULL, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 0xf00d, + .aio_reqprio = 0, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + /* In order to make record valid */ + .aio_nbytes = (size_t) 0x1020304050607080ULL, + .aio_offset = 0xdeadda7abadc0dedULL, +# ifdef IOCB_FLAG_RESFD + .aio_flags = 0xfacef157, + .aio_resfd = 0xded1ca7e, +# endif + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0xbadc0ffeedefacedULL, + .aio_nbytes = 0x8090a0b0c0d0e0f0ULL, + .aio_offset = 0xdeadda7abadc0dedULL, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = (unsigned long)data2, + .aio_nbytes = sizeof(data2), + .aio_offset = 0xdeadda7abadc0dedULL, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 8, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + .aio_nbytes = 0x8090a0b0c0d0e0f0ULL, + .aio_offset = 0xdeadda7abadc0dedULL, + }, + }; + const struct iocb *cbv2 = tail_memdup(proto_cbv2, sizeof(proto_cbv2)); + + const struct iocb proto_cbc = { + .aio_data = (unsigned long) 0xdeadbeefbadc0dedULL, + .aio_reqprio = 99, + .aio_fildes = -42 + }; + const struct iocb *cbc = tail_memdup(&proto_cbc, sizeof(proto_cbc)); + + const long proto_cbs[] = { + (long) &cb[0], (long) &cb[1] + }; + const long *cbs = tail_memdup(proto_cbs, sizeof(proto_cbs)); + + const long proto_cbvs[] = { + (long) &cbv[0], (long) &cbv[1], + }; + const long *cbvs = tail_memdup(proto_cbvs, sizeof(proto_cbvs)); + + const long proto_cbvs2[] = { + (long) &cbv2[0], (long) &cbv2[1], (long) &cbv2[2], + (long) &cbv2[3], (long) &cbv2[4], + (long) NULL, (long) 0xffffffffffffffffLL, + }; + const long *cbvs2 = tail_memdup(proto_cbvs2, sizeof(proto_cbvs2)); + + unsigned long *ctx = tail_alloc(sizeof(unsigned long)); + *ctx = 0; + + const unsigned int nr = ARRAY_SIZE(proto_cb); + const unsigned long lnr = (unsigned long) (0xdeadbeef00000000ULL | nr); + + const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); + const struct timespec proto_ts = { .tv_nsec = 123456789 }; + const struct timespec *ts = tail_memdup(&proto_ts, sizeof(proto_ts)); + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_skip("open: %s", "/dev/zero"); + + long rc = syscall(__NR_io_setup, 0xdeadbeef, NULL); + printf("io_setup(%u, NULL) = %s\n", 0xdeadbeef, sprintrc(rc)); + + rc = syscall(__NR_io_setup, lnr, ctx + 1); + printf("io_setup(%u, %p) = %s\n", nr, ctx + 1, sprintrc(rc)); + + if (syscall(__NR_io_setup, lnr, ctx)) + perror_msg_and_skip("io_setup"); + printf("io_setup(%u, [%#lx]) = 0\n", nr, *ctx); + + rc = syscall(__NR_io_submit, bogus_ctx, (long) 0xca7faceddeadf00dLL, + NULL); + printf("io_submit(%#lx, %ld, NULL) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbs + nr); + printf("io_submit(%#lx, %ld, %p) = %s\n", + *ctx, (long) nr, cbs + nr, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, -1L, cbs); + printf("io_submit(%#lx, -1, %p) = %s\n", + *ctx, cbs, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbs); + if (rc != (long) nr) + perror_msg_and_skip("io_submit"); + printf("io_submit(%#lx, %u, [" + "{data=%#" PRI__x64 ", pread, reqprio=11, fildes=0, " + "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, " + "{data=%#" PRI__x64 ", pread, reqprio=22, fildes=0, " + "buf=%p, nbytes=%u, offset=%" PRI__d64 "}" + "]) = %s\n", + *ctx, nr, + cb[0].aio_data, data0, sizeof_data0, cb[0].aio_offset, + cb[1].aio_data, data1, sizeof_data1, cb[1].aio_offset, + sprintrc(rc)); + + rc = syscall(__NR_io_getevents, bogus_ctx, + (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, + ev + 1, NULL); + printf("io_getevents(%#lx, %ld, %ld, %p, NULL) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, + (long) 0xba5e1e505ca571e0LL, ev + 1, sprintrc(rc)); + + rc = syscall(__NR_io_getevents, bogus_ctx, + (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, + NULL, ts + 1); + printf("io_getevents(%#lx, %ld, %ld, NULL, %p) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, + (long) 0xba5e1e505ca571e0LL, ts + 1, sprintrc(rc)); + + rc = syscall(__NR_io_getevents, *ctx, nr, nr + 1, ev, ts); + printf("io_getevents(%#lx, %ld, %ld, [" + "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}, " + "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}" + "], {tv_sec=0, tv_nsec=123456789}) = %s\n", + *ctx, (long) nr, (long) (nr + 1), + cb[0].aio_data, &cb[0], sizeof_data0, + cb[1].aio_data, &cb[1], sizeof_data1, + sprintrc(rc)); + + rc = syscall(__NR_io_cancel, bogus_ctx, NULL, NULL); + printf("io_cancel(%#lx, NULL, NULL) = %s\n", bogus_ctx, sprintrc(rc)); + + rc = syscall(__NR_io_cancel, *ctx, cbc + 1, ev); + printf("io_cancel(%#lx, %p, %p) = %s\n", *ctx, cbc + 1, ev, + sprintrc(rc)); + + rc = syscall(__NR_io_cancel, *ctx, cbc, ev); + printf("io_cancel(%#lx, {data=%#" PRI__x64 + ", pread, reqprio=99, fildes=-42}, %p) = %s\n", + *ctx, cbc->aio_data, ev, sprintrc(rc)); + + rc = syscall(__NR_io_submit, (unsigned long) 0xfacef157beeff00dULL, + (long) 0xdeadc0defacefeedLL, NULL); + printf("io_submit(%#lx, %ld, NULL) = %s\n", + (long) 0xfacef157beeff00dULL, + (long) 0xdeadc0defacefeedLL, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, -1L, cbvs + nr); + printf("io_submit(%#lx, %ld, %p) = %s\n", + *ctx, -1L, cbvs + nr, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); + printf("io_submit(%#lx, %ld, [" + "{data=%#" PRI__x64 ", key=%u, %hu /* SUB_??? */, fildes=%d}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL" + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 +# ifdef IOCB_FLAG_RESFD + ", resfd=%d, flags=%#x" +# endif + "}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d" + ", str=\"\\0\\1\\2\\3%.28s\"..." + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " + "{key=%u, pwritev, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}" + ", {NULL}, {%#lx}, %p]) = %s\n", + *ctx, 1057L, + cbv2[0].aio_data, cbv2[0].aio_key, + cbv2[0].aio_lio_opcode, cbv2[0].aio_fildes, + cbv2[1].aio_key, cbv2[1].aio_reqprio, cbv2[1].aio_fildes, + cbv2[1].aio_nbytes, cbv2[1].aio_offset, +# ifdef IOCB_FLAG_RESFD + cbv2[1].aio_resfd, cbv2[1].aio_flags, +# endif + cbv2[2].aio_key, cbv2[2].aio_reqprio, cbv2[2].aio_fildes, + cbv2[2].aio_buf, cbv2[2].aio_nbytes, cbv2[2].aio_offset, + cbv2[3].aio_key, cbv2[3].aio_reqprio, cbv2[3].aio_fildes, + data2 + 4, cbv2[3].aio_nbytes, cbv2[3].aio_offset, + cbv2[4].aio_key, cbv2[4].aio_reqprio, cbv2[4].aio_fildes, + cbv2[4].aio_buf, cbv2[4].aio_nbytes, cbv2[4].aio_offset, + cbvs2[6], cbvs2 + 7, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbvs); + if (rc != (long) nr) + perror_msg_and_skip("io_submit"); + printf("io_submit(%#lx, %u, [" + "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " + "iovec=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, " + "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " + "iovec=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}" + "]) = %s\n", + *ctx, nr, + cbv[0].aio_data, cbv[0].aio_reqprio, + iov0[0].iov_base, (unsigned int) iov0[0].iov_len, + iov0[1].iov_base, (unsigned int) iov0[1].iov_len, + cbv[0].aio_offset, + cbv[1].aio_data, cbv[1].aio_reqprio, + iov1[0].iov_base, (unsigned int) iov1[0].iov_len, + iov1[1].iov_base, (unsigned int) iov1[1].iov_len, + cbv[1].aio_offset, + sprintrc(rc)); + + rc = syscall(__NR_io_destroy, bogus_ctx); + printf("io_destroy(%#lx) = %s\n", + bogus_ctx, sprintrc(rc)); + + rc = syscall(__NR_io_destroy, *ctx); + printf("io_destroy(%#lx) = %s\n", *ctx, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_*") + +#endif diff --git a/tests-mx32/aio.test b/tests-mx32/aio.test new file mode 100755 index 00000000..2ba90da8 --- /dev/null +++ b/tests-mx32/aio.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check io_* syscalls decoding. + +. "${srcdir=.}/init.sh" + +syscalls=io_setup,io_submit,io_getevents,io_cancel,io_destroy +run_strace_match_diff -a14 -e trace=$syscalls diff --git a/tests-mx32/alarm.c b/tests-mx32/alarm.c new file mode 100644 index 00000000..291b26ad --- /dev/null +++ b/tests-mx32/alarm.c @@ -0,0 +1,52 @@ +/* + * This file is part of alarm strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_alarm + +# include +# include + +int +main(void) +{ + int rc = syscall(__NR_alarm, (unsigned long) 0xffffffff0000002aULL); + printf("alarm(%u) = %d\n", 42, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_alarm") + +#endif diff --git a/tests-mx32/alarm.test b/tests-mx32/alarm.test new file mode 100755 index 00000000..267b2239 --- /dev/null +++ b/tests-mx32/alarm.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check alarm syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/answer.c b/tests-mx32/answer.c new file mode 100644 index 00000000..ae3059a4 --- /dev/null +++ b/tests-mx32/answer.c @@ -0,0 +1,44 @@ +/* + * Check decoding of fault injected exit_group syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + static const kernel_ulong_t answer = + (kernel_ulong_t) 0xbadc0ded0000002aULL; + + syscall(__NR_exit_group, answer); + syscall(__NR_exit, answer); + + return 1; +} diff --git a/tests-mx32/attach-f-p-cmd.c b/tests-mx32/attach-f-p-cmd.c new file mode 100644 index 00000000..77594beb --- /dev/null +++ b/tests-mx32/attach-f-p-cmd.c @@ -0,0 +1,46 @@ +/* + * This file is part of attach-f-p strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + static const char dir[] = "attach-f-p.test cmd"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + pid, dir, sprintrc(rc), pid); + + return 0; +} diff --git a/tests-mx32/attach-f-p.c b/tests-mx32/attach-f-p.c new file mode 100644 index 00000000..3f9a7e3e --- /dev/null +++ b/tests-mx32/attach-f-p.c @@ -0,0 +1,124 @@ +/* + * This file is part of attach-f-p strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#define N 3 + +typedef union { + void *ptr; + pid_t pid; +} retval_t; + +static const char text_parent[] = "attach-f-p.test parent"; +static const char *child[N] = { + "attach-f-p.test child 0", + "attach-f-p.test child 1", + "attach-f-p.test child 2" +}; +typedef int pipefd[2]; +static pipefd pipes[N]; + +static void * +thread(void *a) +{ + unsigned int no = (long) a; + int i; + + if (read(pipes[no][0], &i, sizeof(i)) != (int) sizeof(i)) + perror_msg_and_fail("read[%u]", no); + assert(chdir(child[no]) == -1); + retval_t retval = { .pid = syscall(__NR_gettid) }; + return retval.ptr; +} + +int +main(void) +{ + pthread_t t[N]; + unsigned int i; + + if (write(1, "", 0) != 0) + perror_msg_and_fail("write"); + + for (i = 0; i < N; ++i) { + if (pipe(pipes[i])) + perror_msg_and_fail("pipe"); + + errno = pthread_create(&t[i], NULL, thread, (void *) (long) i); + if (errno) + perror_msg_and_fail("pthread_create"); + } + + if (write(1, "\n", 1) != 1) + perror_msg_and_fail("write"); + + /* wait for the peer to write to stdout */ + struct stat st; + for (;;) { + if (fstat(1, &st)) + perror_msg_and_fail("fstat"); + if (st.st_size >= 103) + break; + } + + for (i = 0; i < N; ++i) { + /* sleep a bit to let the tracer catch up */ + sleep(1); + if (write(pipes[i][1], &i, sizeof(i)) != (int) sizeof(i)) + perror_msg_and_fail("write[%u]", i); + retval_t retval; + errno = pthread_join(t[i], &retval.ptr); + if (errno) + perror_msg_and_fail("pthread_join"); + errno = ENOENT; + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + retval.pid, child[i], sprintrc(-1), retval.pid); + } + + /* sleep a bit more to let the tracer catch up */ + sleep(1); + + pid_t pid = getpid(); + assert(chdir(text_parent) == -1); + + printf("%-5d chdir(\"%s\") = -1 ENOENT (%m)\n" + "%-5d +++ exited with 0 +++\n", pid, text_parent, pid); + + return 0; +} diff --git a/tests-mx32/attach-f-p.test b/tests-mx32/attach-f-p.test new file mode 100755 index 00000000..f4170740 --- /dev/null +++ b/tests-mx32/attach-f-p.test @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Check that -f -p attaches to threads properly. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -f -p is implemented using /proc/$pid/task/ +[ -d /proc/self/task/ ] || + framework_skip_ '/proc/self/task/ is not available' +run_prog_skip_if_failed \ + kill -0 $$ +run_prog ./attach-f-p-cmd > /dev/null + +rm -f "$OUT" +./set_ptracer_any sh -c "exec ./attach-f-p >> $OUT" > /dev/null & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any sh failed' +done + +run_strace -a32 -f -echdir -p $tracee_pid ./attach-f-p-cmd > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" diff --git a/tests-mx32/attach-p-cmd-cmd.c b/tests-mx32/attach-p-cmd-cmd.c new file mode 100644 index 00000000..d0f824e9 --- /dev/null +++ b/tests-mx32/attach-p-cmd-cmd.c @@ -0,0 +1,55 @@ +/* + * This file is part of attach-p-cmd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + static const char lockdir[] = "attach-p-cmd.test-lock"; + /* wait for the lock directory to be created by peer */ + while (rmdir(lockdir)) { + if (ENOENT != errno) + perror_msg_and_fail("rmdir: %s", lockdir); + } + + static const char dir[] = "attach-p-cmd.test cmd"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + pid, dir, sprintrc(rc), pid); + + return 0; +} diff --git a/tests-mx32/attach-p-cmd-p.c b/tests-mx32/attach-p-cmd-p.c new file mode 100644 index 00000000..254d19ae --- /dev/null +++ b/tests-mx32/attach-p-cmd-p.c @@ -0,0 +1,83 @@ +/* + * This file is part of attach-p-cmd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask = {}; + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + static const char lockdir[] = "attach-p-cmd.test-lock"; + /* create a lock directory */ + if (mkdir(lockdir, 0700)) + perror_msg_and_fail("mkdir: %s", lockdir); + + /* wait for the lock directory to be removed by peer */ + while (mkdir(lockdir, 0700)) { + if (EEXIST != errno) + perror_msg_and_fail("mkdir: %s", lockdir); + } + + /* remove the lock directory */ + if (rmdir(lockdir)) + perror_msg_and_fail("rmdir: %s", lockdir); + + alarm(1); + pause(); + + static const char dir[] = "attach-p-cmd.test -p"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---\n" + "%-5d chdir(\"%s\") = %d %s (%m)\n" + "%-5d +++ exited with 0 +++\n", + pid, pid, dir, rc, errno2name(), pid); + + return 0; +} diff --git a/tests-mx32/attach-p-cmd.test b/tests-mx32/attach-p-cmd.test new file mode 100755 index 00000000..2068cf1d --- /dev/null +++ b/tests-mx32/attach-p-cmd.test @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Check that simultaneous use of -p option and tracing of a command works. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +rm -rf attach-p-cmd.test-lock +rm -f "$OUT" +./set_ptracer_any ./attach-p-cmd-p >> "$OUT" & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any ./attach-p-cmd-p failed' +done + +run_strace -a30 -echdir -p $tracee_pid ./attach-p-cmd-cmd > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" diff --git a/tests-mx32/bexecve.test b/tests-mx32/bexecve.test new file mode 100755 index 00000000..f1ab04f1 --- /dev/null +++ b/tests-mx32/bexecve.test @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Check -bexecve behavior. +# +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_strace_redir() +{ + args="$*" + $STRACE "$@" 2> "$LOG" +} + +run_strace_redir -enone ./set_ptracer_any true || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +run_strace_redir -enone ./set_ptracer_any false +[ $? -eq 1 ] || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +run_strace_redir -bexecve -enone ./set_ptracer_any false || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +pattern_detached='[^:]*strace: Process [1-9][0-9]* detached' +pattern_personality='[^:]*strace: \[ Process PID=[1-9][0-9]* runs in .* mode. \]' + +LC_ALL=C grep -x "$pattern_detached" "$LOG" > /dev/null || + dump_log_and_fail_with "$STRACE $args: output mismatch" + +if LC_ALL=C grep -E -v -x "($pattern_detached|$pattern_personality)" "$LOG" > /dev/null; then + dump_log_and_fail_with "$STRACE $args: unexpected output" +fi + +exit 0 diff --git a/tests-mx32/bpf.c b/tests-mx32/bpf.c new file mode 100644 index 00000000..7ef16c9f --- /dev/null +++ b/tests-mx32/bpf.c @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2015-2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined HAVE_UNION_BPF_ATTR_LOG_BUF && defined __NR_bpf +# include +# include +# include +# include + +static const struct bpf_insn insns[] = { + { .code = BPF_JMP | BPF_EXIT } +}; + +static const char *errstr; +static char log_buf[4096]; + +static long +sys_bpf(kernel_ulong_t cmd, kernel_ulong_t attr, kernel_ulong_t size) +{ + long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + return rc; +} + +static int +map_create(void) +{ + union bpf_attr attr = { + .key_size = 4, + .value_size = 8, + .max_entries = 256 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(BPF_MAP_CREATE, (unsigned long) t_attr, sizeof(attr)); +} + +static int +map_any(int cmd) +{ + union bpf_attr attr = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} + +static int +prog_load(void) +{ + union bpf_attr attr = { + .insn_cnt = sizeof(insns) / sizeof(insns[0]), + .insns = (unsigned long) insns, + .license = (unsigned long) "GPL", + .log_level = 42, + .log_size = sizeof(log_buf), + .log_buf = (unsigned long) log_buf + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(BPF_PROG_LOAD, (unsigned long) t_attr, sizeof(attr)); +} + +/* + * bpf() syscall and its first six commands were introduced in Linux kernel + * 3.18. Some additional commands were added afterwards, so we need to take + * precautions to make sure the tests compile. + * + * BPF_OBJ_PIN and BPF_OBJ_GET commands appear in kernel 4.4. + */ +# ifdef HAVE_UNION_BPF_ATTR_BPF_FD +static int +obj_manage(int cmd) +{ + union bpf_attr attr = { + .pathname = (unsigned long) "/sys/fs/bpf/foo/bar", + .bpf_fd = -1 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} +# endif + +/* BPF_PROG_ATTACH and BPF_PROG_DETACH commands appear in kernel 4.10. */ +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE +static int +prog_cgroup(int cmd) +{ + union bpf_attr attr = { + .target_fd = -1, + .attach_bpf_fd = -1, + .attach_type = 0 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} +# endif + +static unsigned long efault; + +static void +bogus_bpf(int cmd, const char *name) +{ + const unsigned long bogus_size = 1024; + const unsigned long bogus_addr = efault - bogus_size; + + sys_bpf(cmd, efault, 4); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, efault, 4UL, errstr); + + sys_bpf(cmd, efault, bogus_size); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, efault, bogus_size, errstr); + + sys_bpf(cmd, bogus_addr, 0); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, bogus_addr, 0UL, errstr); +} + +#define BOGUS_BPF(cmd) bogus_bpf(cmd, #cmd) + +int +main(void) +{ + efault = (unsigned long) tail_alloc(1) + 1; + + map_create(); + printf("bpf(BPF_MAP_CREATE" + ", {map_type=BPF_MAP_TYPE_UNSPEC, key_size=4" + ", value_size=8, max_entries=256}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_CREATE); + + map_any(BPF_MAP_LOOKUP_ELEM); + printf("bpf(BPF_MAP_LOOKUP_ELEM" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_LOOKUP_ELEM); + + map_any(BPF_MAP_UPDATE_ELEM); + printf("bpf(BPF_MAP_UPDATE_ELEM" + ", {map_fd=-1, key=0xdeadbeef" + ", value=0xbadc0ded, flags=BPF_ANY}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_UPDATE_ELEM); + + map_any(BPF_MAP_DELETE_ELEM); + printf("bpf(BPF_MAP_DELETE_ELEM" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_DELETE_ELEM); + + map_any(BPF_MAP_GET_NEXT_KEY); + printf("bpf(BPF_MAP_GET_NEXT_KEY" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_GET_NEXT_KEY); + + prog_load(); + printf("bpf(BPF_PROG_LOAD" + ", {prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=1, insns=%p" + ", license=\"GPL\", log_level=42, log_size=4096, log_buf=%p" + ", kern_version=0}, %u) = %s\n", + insns, log_buf, (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_LOAD); + +# ifdef HAVE_UNION_BPF_ATTR_BPF_FD + obj_manage(BPF_OBJ_PIN); + printf("bpf(BPF_OBJ_PIN" + ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_OBJ_PIN); + + obj_manage(BPF_OBJ_GET); + printf("bpf(BPF_OBJ_GET" + ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_OBJ_GET); +# endif + +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE + prog_cgroup(BPF_PROG_ATTACH); + printf("bpf(BPF_PROG_ATTACH" + ", {target_fd=-1, attach_bpf_fd=-1" + ", attach_type=BPF_CGROUP_INET_INGRESS}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_ATTACH); + + prog_cgroup(BPF_PROG_DETACH); + printf("bpf(BPF_PROG_DETACH" + ", {target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS}, %u)" + " = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_DETACH); +# endif + + bogus_bpf(0xfacefeed, "0xfacefeed /* BPF_??? */"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_bpf") + +#endif diff --git a/tests-mx32/bpf.test b/tests-mx32/bpf.test new file mode 100755 index 00000000..adf0d576 --- /dev/null +++ b/tests-mx32/bpf.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check bpf syscall decoding. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a20 diff --git a/tests-mx32/brk.c b/tests-mx32/brk.c new file mode 100644 index 00000000..572ebd61 --- /dev/null +++ b/tests-mx32/brk.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_brk + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_brk, NULL); + printf("brk\\(NULL\\) = %#lx\n", rc); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_brk") + +#endif diff --git a/tests-mx32/brk.test b/tests-mx32/brk.test new file mode 100755 index 00000000..8c0e2e49 --- /dev/null +++ b/tests-mx32/brk.test @@ -0,0 +1,10 @@ +#!/bin/sh + +# Check brk syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a10 -ebrk $args > "$EXP" +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-mx32/btrfs-v.test b/tests-mx32/btrfs-v.test new file mode 100755 index 00000000..1ee17b4b --- /dev/null +++ b/tests-mx32/btrfs-v.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check verbose decoding of btrfs ioctl + +. "${srcdir=.}/init.sh" + +run_prog ./btrfs -v > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-mx32/btrfs-vw.test b/tests-mx32/btrfs-vw.test new file mode 100755 index 00000000..c7e40ad7 --- /dev/null +++ b/tests-mx32/btrfs-vw.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check verbose decoding of btrfs ioctl w/ live ioctls. + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-vw" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +run_prog ./btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-mx32/btrfs-w.test b/tests-mx32/btrfs-w.test new file mode 100755 index 00000000..6238dca8 --- /dev/null +++ b/tests-mx32/btrfs-w.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check decoding of btrfs ioctl w/ live ioctls. + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-w" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-mx32/btrfs.c b/tests-mx32/btrfs.c new file mode 100644 index 00000000..b3e23f80 --- /dev/null +++ b/tests-mx32/btrfs.c @@ -0,0 +1,1932 @@ +#include "tests.h" + +#ifdef HAVE_LINUX_BTRFS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "xlat.h" + +#include "xlat/btrfs_balance_args.h" +#include "xlat/btrfs_balance_flags.h" +#include "xlat/btrfs_balance_state.h" +#include "xlat/btrfs_compress_types.h" +#include "xlat/btrfs_defrag_flags.h" +#include "xlat/btrfs_dev_stats_values.h" +#include "xlat/btrfs_dev_stats_flags.h" +#include "xlat/btrfs_qgroup_inherit_flags.h" +#include "xlat/btrfs_qgroup_limit_flags.h" +#include "xlat/btrfs_scrub_flags.h" +#include "xlat/btrfs_send_flags.h" +#include "xlat/btrfs_space_info_flags.h" +#include "xlat/btrfs_snap_flags_v2.h" +#include "xlat/btrfs_tree_objectids.h" +#include "xlat/btrfs_features_compat.h" +#include "xlat/btrfs_features_compat_ro.h" +#include "xlat/btrfs_features_incompat.h" +#include "xlat/btrfs_key_types.h" + +#ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +#endif + +#ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +#endif + +#ifndef BTRFS_NAME_LEN +# define BTRFS_NAME_LEN 255 +#endif + +/* + * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in + * its definition, which isn't exported by the kernel. + */ +typedef __u64 u64; + +static const char *btrfs_test_root; +static int btrfs_test_dir_fd; +static bool verbose = false; +static bool write_ok = false; + +const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { + 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, +}; + +const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210"; + +#ifndef BTRFS_IOC_QUOTA_RESCAN +struct btrfs_ioctl_quota_rescan_args { + uint64_t flags, progress, reserved[6]; +}; +# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ + struct btrfs_ioctl_quota_rescan_args) +# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ + struct btrfs_ioctl_quota_rescan_args) +#endif + +#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +#endif + +#ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags) +# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[2]) +# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[3]) +#endif + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +struct btrfs_ioctl_feature_flags { + uint64_t compat_flags; + uint64_t compat_ro_flags; + uint64_t incompat_flags; +}; +#endif + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +struct btrfs_ioctl_defrag_range_args { + uint64_t start; + uint64_t len; + uint64_t flags; + uint32_t extent_thresh; + uint32_t compress_type; + uint32_t unused[4]; +}; +#endif + +#ifndef FIDEDUPERANGE +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +struct file_dedupe_range_info { + int64_t dest_fd; /* in - destination file */ + uint64_t dest_offset; /* in - start of extent in destination */ + uint64_t bytes_deduped; /* out - total # of bytes we were able + * to dedupe from this file. */ + /* status of this dedupe operation: + * < 0 for error + * == FILE_DEDUPE_RANGE_SAME if dedupe succeeds + * == FILE_DEDUPE_RANGE_DIFFERS if data differs + */ + int32_t status; /* out - see above description */ + uint32_t reserved; /* must be zero */ +}; + +struct file_dedupe_range { + uint64_t src_offset; /* in - start of extent in source */ + uint64_t src_length; /* in - length of extent */ + uint16_t dest_count; /* in - total elements in info array */ + uint16_t reserved1; /* must be zero */ + uint32_t reserved2; /* must be zero */ + struct file_dedupe_range_info info[0]; +}; +#endif + +#ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ + struct btrfs_ioctl_search_args_v2) +struct btrfs_ioctl_search_args_v2 { + struct btrfs_ioctl_search_key key; /* in/out - search parameters */ + uint64_t buf_size; /* in - size of buffer + * out - on EOVERFLOW: needed size + * to store item */ + uint64_t buf[0]; /* out - found items */ +}; +#endif + + +static const char * +maybe_print_uint64max(uint64_t val) +{ + if (val == UINT64_MAX) + return " /* UINT64_MAX */"; + return ""; +} + +/* takes highest valid flag bit */ +static uint64_t +max_flags_plus_one(int bit) +{ + int i; + uint64_t val = 0; + if (bit == -1) + return 1; + for (i = 0; i <= bit + 1 && i < 64; i++) + val |= (1ULL << i); + return val; +} + +/* + * Consumes no arguments, returns nothing: + * + * - BTRFS_IOC_TRANS_START + * - BTRFS_IOC_TRANS_END + */ +static void +btrfs_test_trans_ioctls(void) +{ + ioctl(-1, BTRFS_IOC_TRANS_START, NULL); + printf("ioctl(-1, BTRFS_IOC_TRANS_START) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_TRANS_END, NULL); + printf("ioctl(-1, BTRFS_IOC_TRANS_END) = -1 EBADF (%m)\n"); +} + +/* + * Consumes no arguments, returns nothing: + * - BTRFS_IOC_SYNC + * + * Consumes argument, returns nothing + * - BTRFS_IOC_WAIT_SYNC + */ +static void +btrfs_test_sync_ioctls(void) +{ + uint64_t u64val = 0xdeadbeefbadc0dedULL; + + ioctl(-1, BTRFS_IOC_SYNC, NULL); + printf("ioctl(-1, BTRFS_IOC_SYNC) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL); + printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_WAIT_SYNC, &u64val); + printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, [%" PRIu64 + "]) = -1 EBADF (%m)\n", u64val); + + /* + * The live test of BTRFS_IOC_SYNC happens as a part of the test + * for BTRFS_IOC_LOGICAL_INO + */ +} + +static void +btrfs_print_qgroup_inherit(struct btrfs_qgroup_inherit *inherit) +{ + printf("{flags="); + printflags(btrfs_qgroup_inherit_flags, inherit->flags, + "BTRFS_QGROUP_INHERIT_???"); + printf(", num_qgroups=%" PRI__u64 + ", num_ref_copies=%" PRI__u64 + ", num_excl_copies=%" PRI__u64", lim={flags=", + inherit->num_qgroups, inherit->num_ref_copies, + inherit->num_excl_copies); + printflags(btrfs_qgroup_limit_flags, + inherit->lim.flags, + "BTRFS_QGROUP_LIMIT_???"); + printf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 + ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 + "}, qgroups=", + inherit->lim.max_rfer, inherit->lim.max_excl, + inherit->lim.rsv_rfer, inherit->lim.rsv_excl); + if (verbose) { + unsigned int i; + printf("["); + for (i = 0; i < inherit->num_qgroups; i++) { + if (i > 0) + printf(", "); + printf("%" PRI__u64, inherit->qgroups[i]); + } + printf("]"); + } else + printf("..."); + printf("}"); +} + + +static void +btrfs_print_vol_args_v2(struct btrfs_ioctl_vol_args_v2 *args, int print_qgroups) +{ + printf("{fd=%d, flags=", (int) args->fd); + printflags(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); + + if (args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) { + printf(", size=%" PRI__u64 ", qgroup_inherit=", args->size); + if (args->qgroup_inherit && print_qgroups) + btrfs_print_qgroup_inherit(args->qgroup_inherit); + else if (args->qgroup_inherit) + printf("%p", args->qgroup_inherit); + else + printf("NULL"); + } + printf(", name=\"%s\"}", args->name); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SNAP_CREATE + * - BTRFS_IOC_SUBVOL_CREATE + * - BTRFS_IOC_SNAP_DESTROY + * - BTRFS_IOC_DEFAULT_SUBVOL + * + * Consumes argument, returns u64: + * - BTRFS_IOC_SNAP_CREATE_V2 + * - BTRFS_IOC_SUBVOL_CREATE_V2 + */ + +static void +btrfs_test_subvol_ioctls(void) +{ + const char *subvol_name = "subvol-name"; + char *long_subvol_name; + void *bad_pointer = (void *) (unsigned long) 0xdeadbeeffffffeedULL; + uint64_t u64val = 0xdeadbeefbadc0dedULL; + struct btrfs_ioctl_vol_args vol_args = {}; + struct btrfs_ioctl_vol_args_v2 vol_args_v2 = { + .fd = 2, + .flags = max_flags_plus_one(2), + }; + + long_subvol_name = malloc(BTRFS_PATH_NAME_MAX); + if (!long_subvol_name) + perror_msg_and_fail("malloc failed"); + memset(long_subvol_name, 'f', BTRFS_PATH_NAME_MAX); + long_subvol_name[BTRFS_PATH_NAME_MAX - 1] = '\0'; + + strcpy(vol_args.name, subvol_name); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, " + "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, " + "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + strncpy(vol_args.name, long_subvol_name, BTRFS_PATH_NAME_MAX); + ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + long_subvol_name = realloc(long_subvol_name, BTRFS_SUBVOL_NAME_MAX); + if (!long_subvol_name) + perror_msg_and_fail("realloc failed"); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + + strcpy(vol_args_v2.name, subvol_name); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + strncpy(vol_args_v2.name, long_subvol_name, BTRFS_SUBVOL_NAME_MAX); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + strcpy(vol_args_v2.name, subvol_name); + vol_args_v2.qgroup_inherit = bad_pointer; + + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 0); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 0); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + const unsigned int n_qgroups = 8; + unsigned int i; + struct btrfs_qgroup_inherit *inherit; + vol_args_v2.size = + sizeof(*inherit) + n_qgroups * sizeof(inherit->qgroups[0]); + inherit = tail_alloc(vol_args_v2.size); + + inherit->flags = 0x3; + inherit->num_ref_copies = 0; + inherit->num_excl_copies = 0; + inherit->num_qgroups = n_qgroups; + for (i = 0; i < n_qgroups; i++) + inherit->qgroups[i] = 1ULL << i; + inherit->lim.flags = 0x7f; + inherit->lim.max_rfer = u64val; + inherit->lim.max_excl = u64val; + inherit->lim.rsv_rfer = u64val; + inherit->lim.rsv_excl = u64val; + vol_args_v2.qgroup_inherit = inherit; + + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, &u64val); + printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, [%" + PRIu64 "]) = -1 EBADF (%m)\n", u64val); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, "); + printflags(btrfs_snap_flags_v2, vol_args_v2.flags, + "BTRFS_SUBVOL_???"); + ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, &vol_args_v2.flags); + printf(") = -1 EBADF (%m)\n"); + + if (write_ok) { + struct btrfs_ioctl_vol_args_v2 args_passed; + /* + * Returns transid if flags & BTRFS_SUBVOL_CREATE_ASYNC + * - BTRFS_IOC_SNAP_CREATE_V2 + * - BTRFS_IOC_SUBVOL_CREATE_V2 + */ + int subvolfd; + + strncpy(vol_args_v2.name, subvol_name, + sizeof(vol_args_v2.name)); + vol_args_v2.flags = BTRFS_SUBVOL_CREATE_ASYNC; + vol_args_v2.size = 0; + vol_args_v2.qgroup_inherit = NULL; + args_passed = vol_args_v2; + printf("ioctl(%d, BTRFS_IOC_SUBVOL_CREATE_V2, ", + btrfs_test_dir_fd); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, + &args_passed); + printf(" => {transid=%" PRI__u64"}) = 0\n", + args_passed.transid); + + subvolfd = openat(btrfs_test_dir_fd, subvol_name, + O_RDONLY|O_DIRECTORY); + if (subvolfd < 0) + perror_msg_and_fail("openat(%s) failed", subvol_name); + + strncpy(vol_args_v2.name, long_subvol_name, BTRFS_NAME_LEN); + vol_args_v2.fd = subvolfd; + args_passed = vol_args_v2; + printf("ioctl(%d, BTRFS_IOC_SNAP_CREATE_V2, ", + btrfs_test_dir_fd); + btrfs_print_vol_args_v2(&args_passed, 1); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_CREATE_V2, + &args_passed); + printf(" => {transid=%" PRI__u64"}) = 0\n", + args_passed.transid); + + /* This only works when mounted w/ -ouser_subvol_rm_allowed */ + strncpy(vol_args.name, long_subvol_name, 255); + vol_args.name[255] = 0; + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " + "{fd=%d, name=\"%.*s\"}) = 0\n", + btrfs_test_dir_fd, (int) vol_args.fd, 255, long_subvol_name); + + strcpy(vol_args.name, subvol_name); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " + "{fd=%d, name=\"%s\"}) = 0\n", + btrfs_test_dir_fd, (int) vol_args.fd, subvol_name); + + close(subvolfd); + } + free(long_subvol_name); +} + +static void +btrfs_print_balance_args(struct btrfs_balance_args *args) +{ + printf("{profiles="); + printflags(btrfs_space_info_flags, args->profiles, + "BTRFS_BLOCK_GROUP_???"); + printf(", usage=%"PRI__u64 "%s, devid=%"PRI__u64 "%s, pstart=%"PRI__u64 + "%s, pend=%"PRI__u64 "%s, vstart=%"PRI__u64 "%s, vend=%"PRI__u64 + "%s, target=%"PRI__u64 "%s, flags=", + args->usage, maybe_print_uint64max(args->usage), + args->devid, maybe_print_uint64max(args->devid), + args->pstart, maybe_print_uint64max(args->pstart), + args->pend, maybe_print_uint64max(args->pend), + args->vstart, maybe_print_uint64max(args->vstart), + args->vend, maybe_print_uint64max(args->vend), + args->target, maybe_print_uint64max(args->target)); + printflags(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); + printf("}"); +} + +/* + * Accepts argument, returns nothing + * - BTRFS_IOC_BALANCE + * - BTRFS_IOC_BALANCE_CTL + * + * Accepts argument, returns argument + * - BTRFS_IOC_BALANCE_V2 + */ +static void +btrfs_test_balance_ioctls(void) +{ + struct btrfs_ioctl_balance_args args = { + .flags = 0x3f, + .data = { + .profiles = 0x7, + .flags = 0x7, + .devid = 1, + .pend = -1ULL, + .vend = -1ULL, + }, + + .meta = { + .profiles = 0x38, + .flags = 0x38, + .devid = 1, + }, + + .sys = { + .profiles = 0x1c0 | (1ULL << 48), + .flags = 0x4c0, + .devid = 1, + }, + }; + struct btrfs_ioctl_vol_args vol_args = {}; + + ioctl(-1, BTRFS_IOC_BALANCE_CTL, 1); + printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " + "BTRFS_BALANCE_CTL_PAUSE) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE_CTL, 2); + printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " + "BTRFS_BALANCE_CTL_CANCEL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE, NULL); + printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + + /* struct btrfs_ioctl_balance_args */ + ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, {flags="); + printflags(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + ioctl(-1, BTRFS_IOC_BALANCE_V2, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + args.flags = BTRFS_BALANCE_DATA | BTRFS_BALANCE_METADATA | + BTRFS_BALANCE_SYSTEM; + args.data.flags = 0; + args.data.profiles = 0; + args.meta.flags = 0; + args.meta.profiles = 0; + args.sys.flags = 0; + args.sys.profiles = 0; + printf("ioctl(%d, BTRFS_IOC_BALANCE_V2, {flags=", + btrfs_test_dir_fd); + + printflags(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); + printf("} => {flags="); + printflags(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", state="); + printflags(btrfs_balance_state, args.state, + "BTRFS_BALANCE_STATE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + printf("}) = 0\n"); + } +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_RESIZE + * + * Requires /dev/btrfs-control, consumes argument, returns nothing: + * - BTRFS_IOC_SCAN_DEV + * - BTRFS_IOC_DEVICES_READY + * + */ +static void +btrfs_test_device_ioctls(void) +{ + const char *devid = "1"; + const char *devname = "/dev/sda1"; + struct btrfs_ioctl_vol_args args = { + .fd = 2, + }; + + ioctl(-1, BTRFS_IOC_RESIZE, NULL); + printf("ioctl(-1, BTRFS_IOC_RESIZE, NULL) = -1 EBADF (%m)\n"); + + strcpy(args.name, devid); + ioctl(-1, BTRFS_IOC_RESIZE, &args); + printf("ioctl(-1, BTRFS_IOC_RESIZE, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL) = -1 EBADF (%m)\n"); + + strcpy(args.name, devname); + ioctl(-1, BTRFS_IOC_SCAN_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_ADD_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_ADD_DEV, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_ADD_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_ADD_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_RM_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_RM_DEV, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_RM_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_RM_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_CLONE + * - BTRFS_IOC_CLONE_RANGE + */ +static void +btrfs_test_clone_ioctls(void) +{ + int clone_fd = 4; + struct btrfs_ioctl_clone_range_args args = { + .src_fd = clone_fd, + .src_offset = 4096, + .src_length = 16384, + .dest_offset = 128 * 1024, + }; + + ioctl(-1, BTRFS_IOC_CLONE, clone_fd); + printf("ioctl(-1, BTRFS_IOC_CLONE or FICLONE, %x) = -1 EBADF (%m)\n", + clone_fd); + + ioctl(-1, BTRFS_IOC_CLONE_RANGE, NULL); + printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + "NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_CLONE_RANGE, &args); + printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + "{src_fd=%d, src_offset=%" PRI__u64 ", src_length=%" PRI__u64 + ", dest_offset=%" PRI__u64 "}) = -1 EBADF (%m)\n", + (int) args.src_fd, args.src_offset, args.src_length, + args.dest_offset); +} + +#define BTRFS_COMPRESS_TYPES 2 +#define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) + +static void +btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args) +{ + printf("{start=%" PRIu64", len=%" PRIu64 "%s, flags=", + (uint64_t) args->start, (uint64_t) args->len, + maybe_print_uint64max(args->len)); + + printflags(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); + printf(", extent_thresh=%u, compress_type=", args->extent_thresh); + printxval(btrfs_compress_types, args->compress_type, + "BTRFS_COMPRESS_???"); + printf("}"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_DEFRAG + * - BTRFS_DEFRAG_RANGE + */ +static void +btrfs_test_defrag_ioctls(void) +{ + struct btrfs_ioctl_vol_args vol_args = {}; + struct btrfs_ioctl_defrag_range_args args = { + .start = 0, + .len = -1ULL, + .flags = max_flags_plus_one(1), + .extent_thresh = 128 * 1024, + .compress_type = 2, /* BTRFS_COMPRESS_LZO */ + }; + + /* + * These are documented as using vol_args but don't + * actually consume it. + */ + ioctl(-1, BTRFS_IOC_DEFRAG, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFRAG, &vol_args); + printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + + /* struct btrfs_ioctl_defrag_range_args */ + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); + + args.compress_type = BTRFS_INVALID_COMPRESS; + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); + + args.len--; + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); +} + +static const char * +xlookup(const struct xlat *xlat, const uint64_t val) +{ + for (; xlat->str != NULL; xlat++) + if (xlat->val == val) + return xlat->str; + return NULL; +} + +static void +btrfs_print_objectid(uint64_t objectid) +{ + const char *str = xlookup(btrfs_tree_objectids, objectid); + printf("%" PRIu64, objectid); + if (str) + printf(" /* %s */", str); +} + +static void +btrfs_print_key_type(uint32_t type) +{ + const char *str = xlookup(btrfs_key_types, type); + printf("%u", type); + if (str) + printf(" /* %s */", str); +} + +static void +btrfs_print_search_key(struct btrfs_ioctl_search_key *key) +{ + printf("key={tree_id="); + btrfs_print_objectid(key->tree_id); + if (verbose || key->min_objectid != 256) { + printf(", min_objectid="); + btrfs_print_objectid(key->min_objectid); + } + if (verbose || key->max_objectid != -256ULL) { + printf(", max_objectid="); + btrfs_print_objectid(key->max_objectid); + } + if (key->min_offset) + printf(", min_offset=%" PRI__u64 "%s", + key->min_offset, maybe_print_uint64max(key->min_offset)); + if (key->max_offset) + printf(", max_offset=%" PRI__u64 "%s", + key->max_offset, maybe_print_uint64max(key->max_offset)); + if (key->min_transid) + printf(", min_transid=%" PRI__u64"%s", key->min_transid, + maybe_print_uint64max(key->min_transid)); + if (key->max_transid) + printf(", max_transid=%" PRI__u64"%s", key->max_transid, + maybe_print_uint64max(key->max_transid)); + printf(", min_type="); + btrfs_print_key_type(key->min_type); + printf(", max_type="); + btrfs_print_key_type(key->max_type); + printf(", nr_items=%u}", key->nr_items); +} + +static void +btrfs_print_tree_search_buf(struct btrfs_ioctl_search_key *key, + void *buf, uint64_t buf_size) +{ + if (verbose) { + uint64_t i; + uint64_t off = 0; + printf("["); + for (i = 0; i < key->nr_items; i++) { + struct btrfs_ioctl_search_header *sh; + sh = (typeof(sh))(buf + off); + if (i) + printf(", "); + printf("{transid=%" PRI__u64 ", objectid=", + sh->transid); + btrfs_print_objectid(sh->objectid); + printf(", offset=%" PRI__u64 ", type=", sh->offset); + btrfs_print_key_type(sh->type); + printf(", len=%u}", sh->len); + off += sizeof(*sh) + sh->len; + } + printf("]"); + } else + printf("..."); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_TREE_SEARCH + * - BTRFS_IOC_TREE_SEARCH_V2 + */ +static void +btrfs_test_search_ioctls(void) +{ + struct btrfs_ioctl_search_key key_reference = { + .tree_id = 5, + .min_objectid = 256, + .max_objectid = -1ULL, + .min_offset = 0, + .max_offset = -1ULL, + .min_transid = 0, + .max_transid = -1ULL, + .min_type = 0, + .max_type = -1U, + .nr_items = 10, + }; + struct btrfs_ioctl_search_args search_args; + struct btrfs_ioctl_search_args_v2 search_args_v2 = { + .buf_size = 4096, + }; + + ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL); + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL) = -1 EBADF (%m)\n"); + + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_objectid = 6; + key_reference.max_objectid = 7; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_offset++; + key_reference.max_offset--; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_transid++; + key_reference.max_transid--; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_type = 1; + key_reference.max_type = 12; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + if (btrfs_test_root) { + struct btrfs_ioctl_search_args_v2 *args; + int bufsize = 4096; + + key_reference.tree_id = 5; + key_reference.min_type = 1; + key_reference.max_type = 1; + key_reference.min_objectid = 256; + key_reference.max_objectid = 357; + key_reference.min_offset = 0; + key_reference.max_offset = -1ULL; + + search_args.key = key_reference; + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&search_args.key); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("} => {key={nr_items=%u}, buf=", + search_args.key.nr_items); + btrfs_print_tree_search_buf(&search_args.key, search_args.buf, + sizeof(search_args.buf)); + printf("}) = 0\n"); + + args = malloc(sizeof(*args) + bufsize); + if (!args) + perror_msg_and_fail("malloc failed"); + + args->key = key_reference; + args->buf_size = bufsize; + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&key_reference); + printf(", buf_size=%" PRIu64 "}", (uint64_t) args->buf_size); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); + printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", buf=", + args->key.nr_items, (uint64_t)args->buf_size); + btrfs_print_tree_search_buf(&args->key, args->buf, + args->buf_size); + printf("}) = 0\n"); + + args->key = key_reference; + args->buf_size = sizeof(struct btrfs_ioctl_search_header); + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&args->key); + printf(", buf_size=%" PRIu64 "}", (uint64_t)args->buf_size); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); + printf(" => {buf_size=%" PRIu64 "}) = -1 EOVERFLOW (%m)\n", + (uint64_t)args->buf_size); + free(args); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_INO_LOOKUP + */ +static void +btrfs_test_ino_lookup_ioctl(void) +{ + struct btrfs_ioctl_ino_lookup_args args = { + .treeid = 5, + .objectid = 256, + }; + + ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL); + printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, {treeid="); + btrfs_print_objectid(args.treeid); + printf(", objectid="); + btrfs_print_objectid(args.objectid); + ioctl(-1, BTRFS_IOC_INO_LOOKUP, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (btrfs_test_root) { + printf("ioctl(%d, BTRFS_IOC_INO_LOOKUP, {treeid=", + btrfs_test_dir_fd); + btrfs_print_objectid(args.treeid); + printf(", objectid="); + btrfs_print_objectid(args.objectid); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_LOOKUP, &args); + printf("} => {name=\"%s\"}) = 0\n", args.name); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_SPACE_INFO + */ +static void +btrfs_test_space_info_ioctl(void) +{ + struct btrfs_ioctl_space_args args = {}; + + ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL); + printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SPACE_INFO, &args); + printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", + args.space_slots); + + if (btrfs_test_root) { + struct btrfs_ioctl_space_args args_passed; + struct btrfs_ioctl_space_args *argsp; + args_passed = args; + printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, args_passed.space_slots); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, &args_passed); + printf(" => {total_spaces=%" PRI__u64 "}) = 0\n", + args_passed.total_spaces); + + argsp = malloc(sizeof(args) + + args_passed.total_spaces * sizeof(args.spaces[0])); + if (!argsp) + perror_msg_and_fail("malloc failed"); + + *argsp = args; + argsp->space_slots = args_passed.total_spaces; + printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, argsp->space_slots); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, argsp); + printf(" => {total_spaces=%" PRI__u64 ", spaces=", + argsp->total_spaces); + if (verbose) { + unsigned int i; + printf("["); + for (i = 0; i < argsp->total_spaces; i++) { + struct btrfs_ioctl_space_info *info; + info = &argsp->spaces[i]; + if (i) + printf(", "); + printf("{flags="); + printflags(btrfs_space_info_flags, info->flags, + "BTRFS_SPACE_INFO_???"); + printf(", total_bytes=%" PRI__u64 + ", used_bytes=%" PRI__u64 "}", + info->total_bytes, info->used_bytes); + } + + printf("]"); + } else + printf("..."); + printf("}) = 0\n"); + free(argsp); + } +} + +/* + * Consumes no arguments, returns nothing: + * - BTRFS_IOC_SCRUB_CANCEL + * Consumes argument, returns argument: + - * BTRFS_IOC_SCRUB + - * BTRFS_IOC_SCRUB_PROGRESS + */ +static void +btrfs_test_scrub_ioctls(void) +{ + struct btrfs_ioctl_scrub_args args = { + .devid = 1, + .start = 0, + .end = -1ULL, + .flags = max_flags_plus_one(0), + }; + + ioctl(-1, BTRFS_IOC_SCRUB, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_CANCEL, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB_CANCEL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SCRUB, {devid=%" PRI__u64 ", start=%" + PRI__u64 "%s, end=%" PRI__u64"%s, flags=", + args.devid, args.start, maybe_print_uint64max(args.start), + args.end, maybe_print_uint64max(args.end)); + printflags(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); + ioctl(-1, BTRFS_IOC_SCRUB, &args); + printf("}) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, &args); + printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, " + "{devid=%" PRI__u64 "}) = -1 EBADF (%m)\n", args.devid); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_DEV_INFO + */ +static void +btrfs_test_dev_info_ioctl(void) +{ + struct btrfs_ioctl_dev_info_args args = { + .devid = 1, + }; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); + + ioctl(-1, BTRFS_IOC_DEV_INFO, NULL); + printf("ioctl(-1, BTRFS_IOC_DEV_INFO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEV_INFO, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_INFO, " + "{devid=%" PRI__u64", uuid=%s}) = -1 EBADF (%m)\n", + args.devid, uuid_reference_string); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_INO_PATHS + * - BTRFS_IOC_LOGICAL_INO + */ +static void +btrfs_test_ino_path_ioctls(void) +{ + char buf[16384]; + struct btrfs_ioctl_ino_path_args args = { + .inum = 256, + .size = sizeof(buf), + .fspath = (unsigned long)buf, + }; + + ioctl(-1, BTRFS_IOC_INO_PATHS, NULL); + printf("ioctl(-1, BTRFS_IOC_INO_PATHS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL); + printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_INO_PATHS, &args); + printf("ioctl(-1, BTRFS_IOC_INO_PATHS, " + "{inum=%" PRI__u64", size=%" PRI__u64 + ", fspath=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", + args.inum, args.size, args.fspath); + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 + ", size=%" PRI__u64", inodes=0x%" PRI__x64 + "}) = -1 EBADF (%m)\n", args.inum, args.size, args.fspath); + +#ifdef HAVE_LINUX_FIEMAP_H + if (btrfs_test_root) { + int size; + struct stat si; + int ret; + struct btrfs_data_container *data = (void *)buf; + struct fiemap *fiemap; + int fd; + + ret = fstat(btrfs_test_dir_fd, &si); + if (ret) + perror_msg_and_fail("fstat failed"); + + args.inum = si.st_ino; + printf("ioctl(%d, BTRFS_IOC_INO_PATHS, " + "{inum=%" PRI__u64", size=%" PRI__u64 + ", fspath=0x%" PRI__x64"}", + btrfs_test_dir_fd, args.inum, args.size, + args.fspath); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_PATHS, &args); + printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + data->bytes_left, data->bytes_missing, data->elem_cnt, + data->elem_missed); + if (verbose) { + printf("[\"strace-test\"]"); + } else + printf("..."); + printf("}}) = 0\n"); + + fd = openat(btrfs_test_dir_fd, "file1", O_RDWR|O_CREAT, 0600); + if (fd < 0) + perror_msg_and_fail("openat(file1) failed"); + + ret = fstat(fd, &si); + if (ret) + perror_msg_and_fail("fstat failed"); + + if (write(fd, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd"); + + /* + * Force delalloc so we can actually + * search for the extent. + */ + fsync(fd); + ioctl(fd, BTRFS_IOC_SYNC, NULL); + printf("ioctl(%d, BTRFS_IOC_SYNC) = 0\n", fd); + + size = sizeof(*fiemap) + 2 * sizeof(fiemap->fm_extents[0]); + fiemap = malloc(size); + if (!fiemap) + perror_msg_and_fail("malloc failed"); + memset(fiemap, 0, size); + + fiemap->fm_length = sizeof(buf); + fiemap->fm_extent_count = 2; + + /* This is also a live test for FIEMAP */ + printf("ioctl(%d, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64", fm_flags=", + fd, fiemap->fm_start, fiemap->fm_length); + printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_extent_count=%u}", fiemap->fm_extent_count); + ioctl(fd, FS_IOC_FIEMAP, fiemap); + printf(" => {fm_flags="); + printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_mapped_extents=%u, fm_extents=", + fiemap->fm_mapped_extents); + if (verbose) { + printf("["); + unsigned int i; + for (i = 0; i < fiemap->fm_mapped_extents; i++) { + struct fiemap_extent *fe; + fe = &fiemap->fm_extents[i]; + if (i) + printf(", "); + printf("{fe_logical=%" PRI__u64 + ", fe_physical=%" PRI__u64 + ", fe_length=%" PRI__u64 + ", ", + fe->fe_logical, fe->fe_physical, + fe->fe_length); + printflags(fiemap_extent_flags, fe->fe_flags, + "FIEMAP_EXTENT_???"); + printf("}"); + } + printf("]"); + } else + printf("..."); + printf("}) = 0\n"); + + args.inum = fiemap->fm_extents[0].fe_physical; + printf("ioctl(%d, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 + ", size=%" PRI__u64", inodes=0x%" PRI__x64"}", + fd, args.inum, args.size, args.fspath); + ioctl(fd, BTRFS_IOC_LOGICAL_INO, &args); + printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + data->bytes_left, data->bytes_missing, data->elem_cnt, + data->elem_missed); + if (verbose) { + printf("[{inum=%llu, offset=0, root=5}]", + (unsigned long long) si.st_ino); + } else + printf("..."); + printf("}}) = 0\n"); + close(fd); + free(fiemap); + } +#endif /* HAVE_LINUX_FIEMAP_H */ +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_SET_RECEIVED_SUBVOL + */ +static void +btrfs_test_set_received_subvol_ioctl(void) +{ + struct btrfs_ioctl_received_subvol_args args = { + .stransid = 0x12345, + .stime = { + .sec = 1463193386, + .nsec = 12345, + }, + }; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); + + ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " + "NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, &args); + printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " + "{uuid=%s, stransid=%" PRI__u64", stime=%" PRI__u64 + ".%u, flags=0}) = -1 EBADF (%m)\n", + uuid_reference_string, args.stransid, args.stime.sec, + args.stime.nsec); +} + +/* + * Consumes argument, returns nothing (output is via send_fd) + * - BTRFS_IOC_SEND + */ +static void +btrfs_test_send_ioctl(void) +{ + uint64_t u64_array[2] = { 256, 257 }; + struct btrfs_ioctl_send_args args = { + .send_fd = 4, + .parent_root = 257, + .flags = max_flags_plus_one(2), + }; + + ioctl(-1, BTRFS_IOC_SEND, NULL); + printf("ioctl(-1, BTRFS_IOC_SEND, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SEND, " + "{send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=", + (int) args.send_fd, args.clone_sources_count); + if (verbose) + printf("NULL"); + else + printf("..."); + printf(", parent_root="); + btrfs_print_objectid(args.parent_root); + printf(", flags="); + printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + ioctl(-1, BTRFS_IOC_SEND, &args); + printf("}) = -1 EBADF (%m)\n"); + + args.clone_sources_count = 2; + args.clone_sources = (__u64 *) (void *) u64_array; + + printf("ioctl(-1, BTRFS_IOC_SEND, " + "{send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=", + (int) args.send_fd, args.clone_sources_count); + if (verbose) { + printf("["); + btrfs_print_objectid(u64_array[0]); + printf(", "); + btrfs_print_objectid(u64_array[1]); + printf("]"); + } else + printf("..."); + printf(", parent_root="); + btrfs_print_objectid(args.parent_root); + printf(", flags="); + printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + ioctl(-1, BTRFS_IOC_SEND, &args); + printf("}) = -1 EBADF (%m)\n"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QUOTA_CTL + */ +static void +btrfs_test_quota_ctl_ioctl(void) +{ + struct btrfs_ioctl_quota_ctl_args args = { + .cmd = 1, + }; + + ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_ENABLE}) = -1 EBADF (%m)\n"); + + args.cmd = 2; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_DISABLE}) = -1 EBADF (%m)\n"); + + args.cmd = 3; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_RESCAN__NOTUSED}) = -1 EBADF (%m)\n"); + + args.cmd = 4; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QGROUP_ASSIGN + */ +static void +btrfs_test_qgroup_assign_ioctl(void) +{ + struct btrfs_ioctl_qgroup_assign_args args = { + .assign = 1, + .src = 257, + .dst = 258, + }; + + ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL); + printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, &args); + printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, " + "{assign=%" PRI__u64", src=%" PRI__u64", dst=%" PRI__u64 + "}) = -1 EBADF (%m)\n", args.assign, args.src, args.dst); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QGROUP_CREATE + */ +static void +btrfs_test_qgroup_create_ioctl(void) +{ + struct btrfs_ioctl_qgroup_create_args args = { + .create = 1, + .qgroupid = 257, + }; + + ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL); + printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QGROUP_CREATE, &args); + printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, " + "{create=%" PRI__u64", qgroupid=%" PRI__u64 + "}) = -1 EBADF (%m)\n", args.create, args.qgroupid); +} + +/* + * Consumes nothing, returns nothing: + * - BTRFS_IOC_QUOTA_RESCAN_WAIT + * Consumes argument, returns nothing: + * - BTRFS_IOC_QUOTA_RESCAN + */ +static void +btrfs_test_quota_rescan_ioctl(void) +{ + struct btrfs_ioctl_quota_rescan_args args = { + .progress = 1, + }; + + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, " + "{flags=0}) = -1 EBADF (%m)\n"); + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT) = -1 EBADF (%m)\n"); + +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SET_FSLABEL + * + * Consumes no argument, returns argument: + * - BTRFS_IOC_GET_FS_LABEL + */ +static void +btrfs_test_label_ioctls(void) +{ + char label[BTRFS_LABEL_SIZE] = "btrfs-label"; + + ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SET_FSLABEL, label); + printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, \"%s\") = -1 EBADF (%m)\n", + label); + + if (write_ok) { + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SET_FSLABEL, label); + printf("ioctl(%d, BTRFS_IOC_SET_FSLABEL, \"%s\") = 0\n", + btrfs_test_dir_fd, label); + + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FSLABEL, label); + printf("ioctl(%d, BTRFS_IOC_GET_FSLABEL, \"%s\") = 0\n", + btrfs_test_dir_fd, label); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_GET_DEV_STATS + */ +static void +btrfs_test_get_dev_stats_ioctl(void) +{ + struct btrfs_ioctl_get_dev_stats args = { + .devid = 1, + .nr_items = 5, + .flags = max_flags_plus_one(0), + }; + + ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL); + printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 + ", nr_items=%" PRI__u64", flags=", + args.devid, args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + ioctl(-1, BTRFS_IOC_GET_DEV_STATS, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + unsigned int i; + args.flags = BTRFS_DEV_STATS_RESET; + printf("ioctl(%d, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 + ", nr_items=%" PRI__u64", flags=", + btrfs_test_dir_fd, args.devid, args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_DEV_STATS, &args); + printf("} => {nr_items=%" PRI__u64 ", flags=", + args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + printf(", ["); + for (i = 0; i < args.nr_items; i++) { + const char *name = xlookup(btrfs_dev_stats_values, i); + if (i) + printf(", "); + if (name) + printf("/* %s */ ", name); + printf("%" PRI__u64, args.values[i]); + } + printf("]}) = 0\n"); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_DEV_REPLACE + * + * Test environment for this is more difficult; It's better to do it by hand. + */ +static void +btrfs_test_dev_replace_ioctl(void) +{ + struct btrfs_ioctl_dev_replace_args args = { + .cmd = BTRFS_IOCTL_DEV_REPLACE_CMD_START, + }; + args.start.srcdevid = 1; + strcpy((char *)args.start.srcdev_name, "/dev/sda1"); + strcpy((char *)args.start.tgtdev_name, "/dev/sdb1"); + + /* struct btrfs_ioctl_dev_replace_args */ + ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " + "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_START, start={srcdevid=%" + PRI__u64", cont_reading_from_srcdev_mode=%" PRI__u64 + ", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) = -1 EBADF (%m)\n", + args.start.srcdevid, + args.start.cont_reading_from_srcdev_mode, + (char *)args.start.srcdev_name, + (char *)args.start.tgtdev_name); + + args.cmd = 1; + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " + "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS}) = -1 EBADF (%m)\n"); +} + +static void +btrfs_test_extent_same_ioctl(void) +{ +#ifdef BTRFS_IOC_FILE_EXTENT_SAME + struct file_dedupe_range args = { + .src_offset = 1024, + .src_length = 10240, + }; + struct file_dedupe_range *argsp; + + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, NULL); + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_count=%hu, info=[]", + (uint64_t)args.src_offset, + (uint64_t)args.src_length, args.dest_count); + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, &args); + printf("}) = -1 EBADF (%m)\n"); + + argsp = malloc(sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + if (!argsp) + perror_msg_and_fail("malloc failed"); + memset(argsp, 0, sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + + *argsp = args; + argsp->dest_count = 3; + argsp->info[0].dest_fd = 2; + argsp->info[0].dest_offset = 0; + argsp->info[1].dest_fd = 2; + argsp->info[1].dest_offset = 10240; + argsp->info[2].dest_fd = 2; + argsp->info[2].dest_offset = 20480; + + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_count=%hu, info=", + (int64_t)argsp->src_offset, + (uint64_t)argsp->src_length, argsp->dest_count); + printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 + "}, {dest_fd=%" PRId64 ", dest_offset=%"PRIu64 "}", + (int64_t)argsp->info[0].dest_fd, + (uint64_t)argsp->info[0].dest_offset, + (int64_t)argsp->info[1].dest_fd, + (uint64_t)argsp->info[1].dest_offset); + if (verbose) + printf(", {dest_fd=%" PRId64 ", dest_offset=%" PRIu64 "}", + (int64_t)argsp->info[2].dest_fd, + (uint64_t)argsp->info[2].dest_offset); + else + printf(", ..."); + printf("]"); + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, argsp); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + int fd1, fd2; + char buf[16384]; + + memset(buf, 0, sizeof(buf)); + + fd1 = openat(btrfs_test_dir_fd, "file1", O_RDWR|O_CREAT, 0600); + if (fd1 < 0) + perror_msg_and_fail("open file1 failed"); + + fd2 = openat(btrfs_test_dir_fd, "file2", O_RDWR|O_CREAT, 0600); + if (fd2 < 0) + perror_msg_and_fail("open file2 failed"); + + if (write(fd1, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd1"); + if (write(fd1, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd1"); + if (write(fd2, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd2"); + if (write(fd2, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd2"); + + close(fd2); + fd2 = openat(btrfs_test_dir_fd, "file2", O_RDONLY); + if (fd2 < 0) + perror_msg_and_fail("open file2 failed"); + + memset(argsp, 0, sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + + argsp->src_offset = 0; + argsp->src_length = 4096; + argsp->dest_count = 3; + argsp->info[0].dest_fd = fd2; + argsp->info[0].dest_offset = 0; + argsp->info[1].dest_fd = fd2; + argsp->info[1].dest_offset = 10240; + argsp->info[2].dest_fd = fd2; + argsp->info[2].dest_offset = 20480; + + printf("ioctl(%d, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 ", src_length=%" PRIu64 + ", dest_count=%hu, info=", fd1, + (uint64_t)argsp->src_offset, + (uint64_t)argsp->src_length, argsp->dest_count); + printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 + "}, {dest_fd=%" PRId64 ", dest_offset=%"PRIu64 "}", + (int64_t)argsp->info[0].dest_fd, + (uint64_t)argsp->info[0].dest_offset, + (int64_t)argsp->info[1].dest_fd, + (uint64_t)argsp->info[1].dest_offset); + if (verbose) + printf(", {dest_fd=%" PRId64 + ", dest_offset=%" PRIu64 "}", + (int64_t)argsp->info[2].dest_fd, + (uint64_t)argsp->info[2].dest_offset); + else + printf(", ..."); + + ioctl(fd1, BTRFS_IOC_FILE_EXTENT_SAME, argsp); + printf("]} => {info="); + printf("[{bytes_deduped=%" PRIu64 ", status=%d}, " + "{bytes_deduped=%" PRIu64 ", status=%d}", + (uint64_t)argsp->info[0].bytes_deduped, + argsp->info[0].status, + (uint64_t)argsp->info[1].bytes_deduped, + argsp->info[1].status); + if (verbose) + printf(", {bytes_deduped=%" PRIu64 ", status=%d}", + (uint64_t)argsp->info[2].bytes_deduped, + argsp->info[2].status); + else + printf(", ..."); + printf("]}) = 0\n"); + close(fd1); + close(fd2); + unlinkat(btrfs_test_dir_fd, "file1", 0); + unlinkat(btrfs_test_dir_fd, "file2", 0); + close(fd1); + close(fd2); + } + free(argsp); +#endif /* BTRFS_IOC_FILE_EXTENT_SAME */ +} + +static void +btrfs_print_features(struct btrfs_ioctl_feature_flags *flags) +{ + printf("{compat_flags="); + printflags(btrfs_features_compat, flags->compat_flags, + "BTRFS_FEATURE_COMPAT_???"); + + printf(", compat_ro_flags="); + printflags(btrfs_features_compat_ro, flags->compat_ro_flags, + "BTRFS_FEATURE_COMPAT_RO_???"); + + printf(", incompat_flags="); + printflags(btrfs_features_incompat, flags->incompat_flags, + "BTRFS_FEATURE_INCOMPAT_???"); + printf("}"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SET_FEATURES + * + * Consumes nothing, returns argument: + * - BTRFS_IOC_GET_FEATURES + * - BTRFS_IOC_GET_SUPPORTED_FEATURES + */ +static void +btrfs_test_features_ioctls(void) +{ + struct btrfs_ioctl_feature_flags args[2] = { + { + .compat_flags = max_flags_plus_one(-1), + .incompat_flags = max_flags_plus_one(9), + .compat_ro_flags = max_flags_plus_one(0), + }, { + .compat_flags = max_flags_plus_one(-1), + .incompat_flags = max_flags_plus_one(9), + .compat_ro_flags = max_flags_plus_one(0), + }, + }; + struct btrfs_ioctl_feature_flags supported_features[3]; + + ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, ["); + btrfs_print_features(&args[0]); + printf(", "); + btrfs_print_features(&args[1]); + ioctl(-1, BTRFS_IOC_SET_FEATURES, &args); + printf("]) = -1 EBADF (%m)\n"); + + if (btrfs_test_root) { + printf("ioctl(%d, BTRFS_IOC_GET_FEATURES, ", + btrfs_test_dir_fd); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FEATURES, + &supported_features); + btrfs_print_features(&supported_features[0]); + printf(") = 0\n"); + + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_SUPPORTED_FEATURES, + &supported_features); + printf("ioctl(%d, BTRFS_IOC_GET_SUPPORTED_FEATURES, ", + btrfs_test_dir_fd); + printf("[ /* supported */ "); + btrfs_print_features(&supported_features[0]); + printf(", /* safe to set */ "); + btrfs_print_features(&supported_features[1]); + printf(", /* safe to clear */ "); + btrfs_print_features(&supported_features[2]); + printf("]) = 0\n"); + } +} + +static void +btrfs_test_read_ioctls(void) +{ + static const struct xlat btrfs_read_cmd[] = { + XLAT(BTRFS_IOC_BALANCE_PROGRESS), + XLAT(BTRFS_IOC_FS_INFO), + XLAT(BTRFS_IOC_GET_FEATURES), + XLAT(BTRFS_IOC_GET_FSLABEL), + XLAT(BTRFS_IOC_GET_SUPPORTED_FEATURES), + XLAT(BTRFS_IOC_QGROUP_LIMIT), + XLAT(BTRFS_IOC_QUOTA_RESCAN_STATUS), + XLAT(BTRFS_IOC_START_SYNC), + XLAT(BTRFS_IOC_SUBVOL_GETFLAGS), + }; + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(btrfs_read_cmd); ++i) { + ioctl(-1, (unsigned long) btrfs_read_cmd[i].val, 0); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", btrfs_read_cmd[i].str); + } +} + +int +main(int argc, char *argv[]) +{ + + int opt; + int ret; + const char *path; + + while ((opt = getopt(argc, argv, "wv")) != -1) { + switch (opt) { + case 'v': + /* + * These tests are incomplete, especially when + * printing arrays of objects are involved. + */ + verbose = true; + break; + case 'w': + write_ok = true; + break; + default: + error_msg_and_fail("usage: btrfs [-v] [-w] [path]"); + } + } + + /* + * This will enable optional tests that require a valid file descriptor + */ + if (optind < argc) { + int rootfd; + struct statfs sfi; + path = argv[optind]; + + ret = statfs(path, &sfi); + if (ret) + perror_msg_and_fail("statfs(%s) failed", path); + + if ((unsigned) sfi.f_type != BTRFS_SUPER_MAGIC) + error_msg_and_fail("%s is not a btrfs file system", + path); + + btrfs_test_root = path; + rootfd = open(path, O_RDONLY|O_DIRECTORY); + if (rootfd < 0) + perror_msg_and_fail("open(%s) failed", path); + + ret = mkdirat(rootfd, "strace-test", 0755); + if (ret < 0 && errno != EEXIST) + perror_msg_and_fail("mkdirat(strace-test) failed"); + + btrfs_test_dir_fd = openat(rootfd, "strace-test", + O_RDONLY|O_DIRECTORY); + if (btrfs_test_dir_fd < 0) + perror_msg_and_fail("openat(strace-test) failed"); + close(rootfd); + } else + write_ok = false; + + if (btrfs_test_root) { + fprintf(stderr, "Testing live ioctls on %s (%s)\n", + btrfs_test_root, write_ok ? "read/write" : "read only"); + } + + btrfs_test_read_ioctls(); + btrfs_test_trans_ioctls(); + btrfs_test_sync_ioctls(); + btrfs_test_subvol_ioctls(); + btrfs_test_balance_ioctls(); + btrfs_test_device_ioctls(); + btrfs_test_clone_ioctls(); + btrfs_test_defrag_ioctls(); + btrfs_test_search_ioctls(); + btrfs_test_ino_lookup_ioctl(); + btrfs_test_space_info_ioctl(); + btrfs_test_scrub_ioctls(); + btrfs_test_dev_info_ioctl(); + btrfs_test_ino_path_ioctls(); + btrfs_test_set_received_subvol_ioctl(); + btrfs_test_send_ioctl(); + btrfs_test_quota_ctl_ioctl(); + btrfs_test_qgroup_assign_ioctl(); + btrfs_test_qgroup_create_ioctl(); + btrfs_test_quota_rescan_ioctl(); + btrfs_test_label_ioctls(); + btrfs_test_get_dev_stats_ioctl(); + btrfs_test_dev_replace_ioctl(); + btrfs_test_extent_same_ioctl(); + btrfs_test_features_ioctls(); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_BTRFS_H") + +#endif diff --git a/tests-mx32/btrfs.test b/tests-mx32/btrfs.test new file mode 100755 index 00000000..2121b5b8 --- /dev/null +++ b/tests-mx32/btrfs.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic btrfs ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/caps-abbrev.awk b/tests-mx32/caps-abbrev.awk new file mode 100644 index 00000000..86de7f23 --- /dev/null +++ b/tests-mx32/caps-abbrev.awk @@ -0,0 +1,52 @@ +#!/bin/gawk +# +# This file is part of caps strace test. +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + cap = "(0|1< +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + cap = "(0|1< + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +extern int capget(int *, int *); +extern int capset(int *, const int *); + +int +main(void) +{ + const int data[] = { 2, 4, 0, 8, 16, 0 }; + const int v1 = 0x19980330; + const int v2 = 0x20071026; + const int v3 = 0x20080522; + + int * const head = tail_alloc(sizeof(int) * 2); + head[0] = v3; + head[1] = 0; + int * const tail_data = tail_alloc(sizeof(data)); + + capget(NULL, NULL); + capget(head + 2, tail_data); + capget(head, tail_data + ARRAY_SIZE(data)); + + if (capget(head, tail_data)) + perror_msg_and_skip("capget"); + if (head[0] != v3) + error_msg_and_skip("capget: v3 expected"); + + memcpy(tail_data, data, sizeof(data)); + + capset(NULL, NULL); + capset(head + 2, tail_data); + + head[0] = 0xbadc0ded; + head[1] = 2718281828U; + capset(head, tail_data + ARRAY_SIZE(data) - 2); + + head[0] = v2; + head[1] = 0; + capset(head, tail_data + ARRAY_SIZE(data) - 5); + + memcpy(tail_data, data, sizeof(data)); + head[0] = v3; + if (capset(head, tail_data) == 0 || errno != EPERM) + perror_msg_and_skip("capset"); + + memset(tail_data, 0, sizeof(data) / 2); + if (capset(head, tail_data) == 0 || errno != EPERM) + perror_msg_and_skip("capset"); + + memcpy(tail_data + ARRAY_SIZE(data) / 2, data, sizeof(data) / 2); + head[0] = v1; + if (capset(head, tail_data + ARRAY_SIZE(data) / 2) == 0 || + errno != EPERM) + perror_msg_and_skip("capset"); + + return 0; +} diff --git a/tests-mx32/caps.test b/tests-mx32/caps.test new file mode 100755 index 00000000..607a75bb --- /dev/null +++ b/tests-mx32/caps.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check capget/capset syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a 19 -e trace=capget,capset $args +match_awk + +exit 0 diff --git a/tests-mx32/chmod.c b/tests-mx32/chmod.c new file mode 100644 index 00000000..f6f98ece --- /dev/null +++ b/tests-mx32/chmod.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2016 Anchit Jain + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_chmod + +#include +#include +#include +#include + +int +main(void) +{ + static const char fname[] = "chmod_test_file"; + + if (open(fname, O_CREAT|O_RDONLY, 0400) < 0) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_chmod, fname, 0600); + printf("chmod(\"%s\", 0600) = %s\n", fname, sprintrc(rc)); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_chmod, fname, 051); + printf("chmod(\"%s\", 051) = %s\n", fname, sprintrc(rc)); + + rc = syscall(__NR_chmod, fname, 004); + printf("chmod(\"%s\", 004) = %s\n", fname, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chmod") + +#endif diff --git a/tests-mx32/chmod.test b/tests-mx32/chmod.test new file mode 100755 index 00000000..70e561a1 --- /dev/null +++ b/tests-mx32/chmod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chmod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/chown.c b/tests-mx32/chown.c new file mode 100644 index 00000000..12aa8b71 --- /dev/null +++ b/tests-mx32/chown.c @@ -0,0 +1,19 @@ +#include "tests.h" +#include + +#ifdef __NR_chown + +# define SYSCALL_NR __NR_chown +# define SYSCALL_NAME "chown" + +# if defined __NR_chown32 && __NR_chown != __NR_chown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_chown") + +#endif diff --git a/tests-mx32/chown.test b/tests-mx32/chown.test new file mode 100755 index 00000000..eb356ce4 --- /dev/null +++ b/tests-mx32/chown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/chown32.c b/tests-mx32/chown32.c new file mode 100644 index 00000000..4fffd769 --- /dev/null +++ b/tests-mx32/chown32.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_chown32 + +# define SYSCALL_NR __NR_chown32 +# define SYSCALL_NAME "chown32" +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_chown32") + +#endif diff --git a/tests-mx32/chown32.test b/tests-mx32/chown32.test new file mode 100755 index 00000000..0fa04c20 --- /dev/null +++ b/tests-mx32/chown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-mx32/chroot.c b/tests-mx32/chroot.c new file mode 100644 index 00000000..a084cf33 --- /dev/null +++ b/tests-mx32/chroot.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_chroot + +# include +# include + +int +main(void) +{ + static const char sample[] = "chroot.sample"; + + long rc = syscall(__NR_chroot, sample); + printf("chroot(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chroot") + +#endif diff --git a/tests-mx32/chroot.test b/tests-mx32/chroot.test new file mode 100755 index 00000000..3b384f5e --- /dev/null +++ b/tests-mx32/chroot.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chroot syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/clock_adjtime.c b/tests-mx32/clock_adjtime.c new file mode 100644 index 00000000..01089b54 --- /dev/null +++ b/tests-mx32/clock_adjtime.c @@ -0,0 +1,60 @@ +/* + * This file is part of clock_adjtime strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_clock_adjtime + +# include +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_clock_adjtime, CLOCK_MONOTONIC, NULL); + printf("clock_adjtime(CLOCK_MONOTONIC, NULL) = %ld %s (%m)\n", + rc, errno2name()); + + void *efault = tail_alloc(1); + + rc = syscall(__NR_clock_adjtime, CLOCK_REALTIME, efault); + printf("clock_adjtime(CLOCK_REALTIME, %p) = %ld %s (%m)\n", + efault, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_clock_adjtime") + +#endif diff --git a/tests-mx32/clock_adjtime.test b/tests-mx32/clock_adjtime.test new file mode 100755 index 00000000..df2c0601 --- /dev/null +++ b/tests-mx32/clock_adjtime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_adjtime syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-mx32/clock_nanosleep.c b/tests-mx32/clock_nanosleep.c new file mode 100644 index 00000000..98407d7e --- /dev/null +++ b/tests-mx32/clock_nanosleep.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } req = { + .ts.tv_nsec = 0xc0de1, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, rem = { + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { + .it_interval.tv_usec = 222222, + .it_value.tv_usec = 111111 + }; + + if (syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, NULL)) + perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "NULL) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + NULL, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0, NULL, %p)" + " = -1 EFAULT (%m)\n", &rem.ts); + + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == 0); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "%p) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + req.ts.tv_nsec = 999999999 + 1; + assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_MONOTONIC, 0" + ", {tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" + ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", + (intmax_t) itv.it_interval.tv_sec, + (intmax_t) itv.it_interval.tv_usec, + (intmax_t) itv.it_value.tv_sec, + (intmax_t) itv.it_value.tv_usec); + + --req.ts.tv_nsec; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "{tv_sec=%jd, tv_nsec=%jd})" + " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, + (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + assert(syscall(__NR_clock_gettime, CLOCK_REALTIME, &req.ts) == 0); + printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + ++req.ts.tv_sec; + rem.ts.tv_sec = 0xc0de4; + rem.ts.tv_nsec = 0xc0de5; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, TIMER_ABSTIME, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=%jd, " + "tv_nsec=%jd}, %p)" + " = ? ERESTARTNOHAND (To be restarted if no handler)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/clock_nanosleep.test b/tests-mx32/clock_nanosleep.test new file mode 100755 index 00000000..ec434a60 --- /dev/null +++ b/tests-mx32/clock_nanosleep.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_nanosleep, clock_gettime, and setitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=clock_nanosleep,clock_gettime,setitimer diff --git a/tests-mx32/clock_xettime.c b/tests-mx32/clock_xettime.c new file mode 100644 index 00000000..3ef5695f --- /dev/null +++ b/tests-mx32/clock_xettime.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#if defined __NR_clock_getres \ + && defined __NR_clock_gettime \ + && defined __NR_clock_settime + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } t = { + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_clock_getres, CLOCK_REALTIME, &t.ts)) + perror_msg_and_skip("clock_getres CLOCK_REALTIME"); + printf("clock_getres(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + if (syscall(__NR_clock_gettime, CLOCK_PROCESS_CPUTIME_ID, &t.ts)) + perror_msg_and_skip("clock_gettime CLOCK_PROCESS_CPUTIME_ID"); + printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, " + "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + t.ts.tv_sec = 0xdeface1; + t.ts.tv_nsec = 0xdeface2; + if (!syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts)) + error_msg_and_skip("clock_settime CLOCK_THREAD_CPUTIME_ID:" + " EINVAL expected"); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID, {tv_sec=%jd, " + "tv_nsec=%jd}) = -1 EINVAL (%m)\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_clock_getres && __NR_clock_gettime && __NR_clock_settime") + +#endif diff --git a/tests-mx32/clock_xettime.test b/tests-mx32/clock_xettime.test new file mode 100755 index 00000000..f045a66e --- /dev/null +++ b/tests-mx32/clock_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_getres, clock_gettime, and clock_settime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests-mx32/copy_file_range.c b/tests-mx32/copy_file_range.c new file mode 100644 index 00000000..085010af --- /dev/null +++ b/tests-mx32/copy_file_range.c @@ -0,0 +1,66 @@ +/* + * This file is part of copy_file_range strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#if defined __NR_copy_file_range + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffff; + const long int fd_out = (long int) 0xdeadbeeffffffffe; + long long int *const off_in = tail_alloc(sizeof(*off_in)); + long long int *const off_out = tail_alloc(sizeof(*off_out)); + *off_in = 0xdeadbef1facefed1; + *off_out = 0xdeadbef2facefed2; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 0; + + long rc = syscall(__NR_copy_file_range, + fd_in, off_in, fd_out, off_out, len, flags); + printf("copy_file_range(%d, [%lld], %d, [%lld], %zu, %u)" + " = %ld %s (%m)\n", + (int) fd_in, *off_in, (int) fd_out, *off_out, len, flags, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_copy_file_range") + +#endif diff --git a/tests-mx32/copy_file_range.test b/tests-mx32/copy_file_range.test new file mode 100755 index 00000000..c39f6acd --- /dev/null +++ b/tests-mx32/copy_file_range.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check copy_file_range syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/count-f.c b/tests-mx32/count-f.c new file mode 100644 index 00000000..6992b16b --- /dev/null +++ b/tests-mx32/count-f.c @@ -0,0 +1,102 @@ +/* + * This file is part of count-f strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#define N 32 +#define P 8 +#define T 4 + +static void * +thread(void *arg) +{ + unsigned int i; + + assert(chdir(".") == 0); + for (i = 0; i < N; ++i) { + assert(chdir("") == -1); + assert(chdir(".") == 0); + } + + return NULL; +} + +static int +process(void) +{ + unsigned int i; + pthread_t t[T]; + + for (i = 0; i < T; ++i) { + errno = pthread_create(&t[i], NULL, thread, NULL); + if (errno) + perror_msg_and_fail("pthread_create"); + } + + for (i = 0; i < T; ++i) { + void *retval; + errno = pthread_join(t[i], &retval); + if (errno) + perror_msg_and_fail("pthread_join"); + } + + return 0; +} + +int +main(void) +{ + unsigned int i; + pid_t p[P]; + + for (i = 0; i < P; ++i) { + p[i] = fork(); + if (p[i] < 0) + perror_msg_and_fail("fork"); + if (!p[i]) + return process(); + } + for (i = 0; i < P; ++i) { + int s; + + assert(waitpid(p[i], &s, 0) == p[i]); + assert(WIFEXITED(s)); + if (WEXITSTATUS(s)) + return WEXITSTATUS(s); + } + + return 0; +} diff --git a/tests-mx32/count-f.expected b/tests-mx32/count-f.expected new file mode 100644 index 00000000..f61ba54e --- /dev/null +++ b/tests-mx32/count-f.expected @@ -0,0 +1 @@ +[ ]*[^ ]+ +[^ ]+ +[^ ]+ +2080 +1024 +chdir diff --git a/tests-mx32/count-f.test b/tests-mx32/count-f.test new file mode 100755 index 00000000..67515efa --- /dev/null +++ b/tests-mx32/count-f.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check whether -c counts through forks and clones properly + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -q -f -c $args +match_grep + +exit 0 diff --git a/tests-mx32/count.test b/tests-mx32/count.test new file mode 100755 index 00000000..e75dc6b0 --- /dev/null +++ b/tests-mx32/count.test @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Check whether -c and -w options work. +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +check_prog grep + +grep_log() +{ + local pattern="$1"; shift + + run_strace "$@" ./sleep 1 + + grep nanosleep "$LOG" > /dev/null || + framework_skip_ 'sleep does not use nanosleep' + + LC_ALL=C grep -E -x -e "$pattern" "$LOG" > /dev/null || { + echo "Pattern of expected output: $pattern" + echo 'Actual output:' + dump_log_and_fail_with "$STRACE $args output mismatch" + } +} + +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -enanosleep +grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw +grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -enanosleep + +exit 0 diff --git a/tests-mx32/creat.c b/tests-mx32/creat.c new file mode 100644 index 00000000..f22fdaaa --- /dev/null +++ b/tests-mx32/creat.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_creat + +# define TEST_SYSCALL_NR __NR_creat +# define TEST_SYSCALL_STR "creat" +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_creat") + +#endif diff --git a/tests-mx32/creat.test b/tests-mx32/creat.test new file mode 100755 index 00000000..069648f7 --- /dev/null +++ b/tests-mx32/creat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check creat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/delete_module.c b/tests-mx32/delete_module.c new file mode 100644 index 00000000..5a317603 --- /dev/null +++ b/tests-mx32/delete_module.c @@ -0,0 +1,115 @@ +/* + * Check decoding of delete_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_delete_module) + +# include +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + static const struct { + kernel_ulong_t val; + const char *str; + unsigned int val_prefix, val_suffix; + } flags[] = { + { ARG_STR(0), 0, 0 }, + { (kernel_ulong_t) 0xffffffff00000000ULL | O_NONBLOCK, + "O_NONBLOCK", 0, 0 }, + { (kernel_ulong_t) 0xbadc0dedfacef157ULL & ~(O_NONBLOCK | O_TRUNC), + " /* O_??? */", 0xfacef157U & ~(O_NONBLOCK | O_TRUNC), 0}, + { (kernel_ulong_t) (0xfacef157deade71cULL & ~O_NONBLOCK) | O_TRUNC, + "O_TRUNC", 0, 0xdeade71c & ~(O_NONBLOCK | O_TRUNC)}, + { -1LL, "O_NONBLOCK|O_TRUNC", 0, -1U & ~(O_NONBLOCK | O_TRUNC)}, + }; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_delete_module, NULL, bogus_zero); + printf("delete_module(NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_delete_module, bogus_param1, flags[0].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"..., %s) = %s\n", flags[0].str, errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_delete_module, bogus_param1, flags[1].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\", %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_delete_module, bogus_param2 + PARAM2_LEN, + flags[2].val); + printf("delete_module(%p, %#x%s) = %s\n", + bogus_param2 + PARAM2_LEN, flags[2].val_prefix, + flags[2].str, sprintrc(rc)); + + rc = syscall(__NR_delete_module, bogus_param2, flags[3].val); + printf("delete_module(%p, %s|%#x) = %s\n", + bogus_param2, flags[3].str, flags[3].val_suffix, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_delete_module, bogus_param2, flags[4].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\", %s|%#x) = %s\n", flags[4].str, flags[4].val_suffix, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_delete_module"); + +#endif diff --git a/tests-mx32/delete_module.test b/tests-mx32/delete_module.test new file mode 100755 index 00000000..fb86ec9a --- /dev/null +++ b/tests-mx32/delete_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of delete_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-mx32/detach-running.test b/tests-mx32/detach-running.test new file mode 100755 index 00000000..006efb85 --- /dev/null +++ b/tests-mx32/detach-running.test @@ -0,0 +1,90 @@ +#!/bin/sh +# +# Ensure that strace can detach from running processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep + +set -e + +./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & + +while ! [ -s "$LOG" ]; do + kill -0 $! 2> /dev/null || + fail_ 'set_ptracer_any sh failed' + $SLEEP_A_BIT +done + +tracee_pid=$! + +cleanup() +{ + set +e + kill $tracee_pid + wait $tracee_pid 2> /dev/null + return 0 +} + +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & + +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } + $SLEEP_A_BIT +done + +kill -INT $! +wait $! + +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" + } + +if [ -f /proc/self/status ]; then + $SLEEP_A_BIT + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*R (running)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' + cleanup + dump_log_and_fail_with 'tracee is not running after detach' + } +fi + +cleanup +exit 0 diff --git a/tests-mx32/detach-sleeping.test b/tests-mx32/detach-sleeping.test new file mode 100755 index 00000000..54304f31 --- /dev/null +++ b/tests-mx32/detach-sleeping.test @@ -0,0 +1,91 @@ +#!/bin/sh +# +# Ensure that strace can detach from sleeping processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep + +set -e + +rm -f "$LOG" +./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & + +while ! [ -s "$LOG" ]; do + kill -0 $! 2> /dev/null || + fail_ 'set_ptracer_any sleep failed' + $SLEEP_A_BIT +done + +tracee_pid=$! + +cleanup() +{ + set +e + kill $tracee_pid + wait $tracee_pid 2> /dev/null + return 0 +} + +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & + +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } + $SLEEP_A_BIT +done + +kill -INT $! +wait $! + +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} + +if [ -f /proc/self/status ]; then + $SLEEP_A_BIT + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*S (sleeping)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' + cleanup + dump_log_and_fail_with 'tracee is not sleeping after detach' + } +fi + +cleanup +exit 0 diff --git a/tests-mx32/detach-stopped.test b/tests-mx32/detach-stopped.test new file mode 100755 index 00000000..8f480e7f --- /dev/null +++ b/tests-mx32/detach-stopped.test @@ -0,0 +1,106 @@ +#!/bin/sh +# +# Ensure that strace can detach from stopped processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep + +$STRACE -d -enone / > /dev/null 2> "$LOG" +if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then + skip_ "PTRACE_SEIZE doesn't work" +fi + +set -e + +rm -f "$LOG" +./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & + +while ! [ -s "$LOG" ]; do + kill -0 $! 2> /dev/null || + fail_ 'set_ptracer_any sleep failed' + $SLEEP_A_BIT +done + +tracee_pid=$! +kill -STOP $tracee_pid + +cleanup() +{ + set +e + kill $tracee_pid + kill -CONT $tracee_pid + wait $tracee_pid 2> /dev/null + return 0 +} + +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & + +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } + $SLEEP_A_BIT +done + +while ! grep -F -e '--- stopped by ' "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p missed stop notifications" + } + $SLEEP_A_BIT +done + +kill -INT $! +wait $! + +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} + +if [ -f /proc/self/status ]; then + $SLEEP_A_BIT + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*T (stopped)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' + cleanup + dump_log_and_fail_with 'tracee is not group-stopped after detach' + } +fi + +cleanup +exit 0 diff --git a/tests-mx32/dup.c b/tests-mx32/dup.c new file mode 100644 index 00000000..62157e2f --- /dev/null +++ b/tests-mx32/dup.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include +#include + +int +main(void) +{ + int rc = dup(-1); + printf("dup(-1) = %d %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/dup.test b/tests-mx32/dup.test new file mode 100755 index 00000000..1dc19198 --- /dev/null +++ b/tests-mx32/dup.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-mx32/dup2.c b/tests-mx32/dup2.c new file mode 100644 index 00000000..9f3addfa --- /dev/null +++ b/tests-mx32/dup2.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_dup2 + +# include +# include + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_dup2, fd_old, fd_new); + printf("dup2(%d, %d) = %ld %s (%m)\n", + (int) fd_old, (int) fd_new, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_dup2") + +#endif diff --git a/tests-mx32/dup2.test b/tests-mx32/dup2.test new file mode 100755 index 00000000..509c5db1 --- /dev/null +++ b/tests-mx32/dup2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-mx32/dup3.c b/tests-mx32/dup3.c new file mode 100644 index 00000000..252e8469 --- /dev/null +++ b/tests-mx32/dup3.c @@ -0,0 +1,28 @@ +#include "tests.h" +#include +#include + +#if defined __NR_dup3 && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_dup3, fd_old, fd_new, O_CLOEXEC); + printf("dup3(%d, %d, O_CLOEXEC) = %ld %s (%m)\n", + (int) fd_old, (int) fd_new, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_dup3 && && O_CLOEXEC") + +#endif diff --git a/tests-mx32/dup3.test b/tests-mx32/dup3.test new file mode 100755 index 00000000..293f78f9 --- /dev/null +++ b/tests-mx32/dup3.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup3 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/epoll_create.c b/tests-mx32/epoll_create.c new file mode 100644 index 00000000..44262c7d --- /dev/null +++ b/tests-mx32/epoll_create.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_create + +# include +# include + +int +main(void) +{ + const long int size = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_epoll_create, size); + printf("epoll_create(%d) = %ld %s (%m)\n", + (int) size, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_creat") + +#endif diff --git a/tests-mx32/epoll_create.test b/tests-mx32/epoll_create.test new file mode 100755 index 00000000..472a9bdb --- /dev/null +++ b/tests-mx32/epoll_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_create syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/epoll_create1.c b/tests-mx32/epoll_create1.c new file mode 100644 index 00000000..cd905ecb --- /dev/null +++ b/tests-mx32/epoll_create1.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_epoll_create1 && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_epoll_create1, O_CLOEXEC); + printf("epoll_create1(EPOLL_CLOEXEC) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK); + printf("epoll_create1(EPOLL_CLOEXEC|%#x) = %s\n", + O_NONBLOCK, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_create1 && O_CLOEXEC") + +#endif diff --git a/tests-mx32/epoll_create1.test b/tests-mx32/epoll_create1.test new file mode 100755 index 00000000..7a926a97 --- /dev/null +++ b/tests-mx32/epoll_create1.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_create1 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/epoll_ctl.c b/tests-mx32/epoll_ctl.c new file mode 100644 index 00000000..e6660555 --- /dev/null +++ b/tests-mx32/epoll_ctl.c @@ -0,0 +1,45 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_ctl + +# include +# include +# include +# include + +static long +invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev) +{ + op |= (unsigned long) 0xffffffff00000000ULL; + return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev); +} + +int +main(void) +{ + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + ev->events = EPOLLIN; + + long rc = invoke_syscall(-1U, EPOLL_CTL_ADD, -2U, ev); + printf("epoll_ctl(-1, EPOLL_CTL_ADD, -2, {EPOLLIN," + " {u32=%u, u64=%" PRIu64 "}}) = %ld %s (%m)\n", + ev->data.u32, ev->data.u64, rc, errno2name()); + + rc = invoke_syscall(-3U, EPOLL_CTL_DEL, -4U, ev); + printf("epoll_ctl(-3, EPOLL_CTL_DEL, -4, %p) = %ld %s (%m)\n", + ev, rc, errno2name()); + + rc = invoke_syscall(-1UL, EPOLL_CTL_MOD, -16UL, 0); + printf("epoll_ctl(-1, EPOLL_CTL_MOD, -16, NULL) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_ctl") + +#endif diff --git a/tests-mx32/epoll_ctl.test b/tests-mx32/epoll_ctl.test new file mode 100755 index 00000000..1aded543 --- /dev/null +++ b/tests-mx32/epoll_ctl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_ctl syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/epoll_pwait.c b/tests-mx32/epoll_pwait.c new file mode 100644 index 00000000..eaaa34d6 --- /dev/null +++ b/tests-mx32/epoll_pwait.c @@ -0,0 +1,30 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_pwait + +# include +# include +# include +# include + +int +main(void) +{ + sigset_t set[2]; + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + + long rc = syscall(__NR_epoll_pwait, -1, ev, 1, -2, + set, (kernel_ulong_t) sizeof(set)); + printf("epoll_pwait(-1, %p, 1, -2, %p, %u) = %ld %s (%m)\n", + ev, set, (unsigned) sizeof(set), rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_pwait") + +#endif diff --git a/tests-mx32/epoll_pwait.test b/tests-mx32/epoll_pwait.test new file mode 100755 index 00000000..c7aeeace --- /dev/null +++ b/tests-mx32/epoll_pwait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of epoll_pwait syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/epoll_wait.c b/tests-mx32/epoll_wait.c new file mode 100644 index 00000000..038bf1f7 --- /dev/null +++ b/tests-mx32/epoll_wait.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_wait + +# include +# include +# include + +int +main(void) +{ + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + + long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2); + printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n", + ev, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_wait") + +#endif diff --git a/tests-mx32/epoll_wait.test b/tests-mx32/epoll_wait.test new file mode 100755 index 00000000..83ae161f --- /dev/null +++ b/tests-mx32/epoll_wait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_wait syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 diff --git a/tests-mx32/erestartsys.c b/tests-mx32/erestartsys.c new file mode 100644 index 00000000..97c9699c --- /dev/null +++ b/tests-mx32/erestartsys.c @@ -0,0 +1,81 @@ +/* + * Check decoding of ERESTARTSYS error code. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static int sv[2]; + +static void +handler(int sig) +{ + close(sv[1]); + sv[1] = -1; +} + +int +main(void) +{ + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + const struct sigaction act = { + .sa_handler = handler, + .sa_flags = SA_RESTART + }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct itimerval itv = { .it_value.tv_usec = 123456 }; + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_fail("setitimer"); + + if (recvfrom(sv[0], &sv[1], sizeof(sv[1]), 0, NULL, NULL)) + perror_msg_and_fail("recvfrom"); + + printf("recvfrom(%d, %p, %d, 0, NULL, NULL) = ? ERESTARTSYS" + " (To be restarted if SA_RESTART is set)\n", + sv[0], &sv[1], (int) sizeof(sv[1])); + printf("recvfrom(%d, \"\", %d, 0, NULL, NULL) = 0\n", + sv[0], (int) sizeof(sv[1])); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/erestartsys.test b/tests-mx32/erestartsys.test new file mode 100755 index 00000000..91f711f3 --- /dev/null +++ b/tests-mx32/erestartsys.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ERESTARTSYS error code. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests-mx32/errno2name.c b/tests-mx32/errno2name.c new file mode 100644 index 00000000..4a176993 --- /dev/null +++ b/tests-mx32/errno2name.c @@ -0,0 +1,481 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#define CASE(x) case x: return #x + +const char * +errno2name(void) +{ + switch (errno) { + /* names taken from linux/errnoent.h */ +#ifdef E2BIG + CASE(E2BIG); +#endif +#ifdef EACCES + CASE(EACCES); +#endif +#ifdef EADDRINUSE + CASE(EADDRINUSE); +#endif +#ifdef EADDRNOTAVAIL + CASE(EADDRNOTAVAIL); +#endif +#ifdef EADV + CASE(EADV); +#endif +#ifdef EAFNOSUPPORT + CASE(EAFNOSUPPORT); +#endif +#ifdef EAGAIN + CASE(EAGAIN); +#endif +#ifdef EALREADY + CASE(EALREADY); +#endif +#ifdef EBADCOOKIE + CASE(EBADCOOKIE); +#endif +#ifdef EBADE + CASE(EBADE); +#endif +#ifdef EBADF + CASE(EBADF); +#endif +#ifdef EBADFD + CASE(EBADFD); +#endif +#ifdef EBADHANDLE + CASE(EBADHANDLE); +#endif +#ifdef EBADMSG + CASE(EBADMSG); +#endif +#ifdef EBADR + CASE(EBADR); +#endif +#ifdef EBADRQC + CASE(EBADRQC); +#endif +#ifdef EBADSLT + CASE(EBADSLT); +#endif +#ifdef EBADTYPE + CASE(EBADTYPE); +#endif +#ifdef EBFONT + CASE(EBFONT); +#endif +#ifdef EBUSY + CASE(EBUSY); +#endif +#ifdef ECANCELED + CASE(ECANCELED); +#endif +#ifdef ECHILD + CASE(ECHILD); +#endif +#ifdef ECHRNG + CASE(ECHRNG); +#endif +#ifdef ECOMM + CASE(ECOMM); +#endif +#ifdef ECONNABORTED + CASE(ECONNABORTED); +#endif +#ifdef ECONNREFUSED + CASE(ECONNREFUSED); +#endif +#ifdef ECONNRESET + CASE(ECONNRESET); +#endif +#ifdef EDEADLK + CASE(EDEADLK); +#endif +#ifdef EDESTADDRREQ + CASE(EDESTADDRREQ); +#endif +#ifdef EDOM + CASE(EDOM); +#endif +#ifdef EDOTDOT + CASE(EDOTDOT); +#endif +#ifdef EDQUOT + CASE(EDQUOT); +#endif +#ifdef EEXIST + CASE(EEXIST); +#endif +#ifdef EFAULT + CASE(EFAULT); +#endif +#ifdef EFBIG + CASE(EFBIG); +#endif +#ifdef EHOSTDOWN + CASE(EHOSTDOWN); +#endif +#ifdef EHOSTUNREACH + CASE(EHOSTUNREACH); +#endif +#ifdef EHWPOISON + CASE(EHWPOISON); +#endif +#ifdef EIDRM + CASE(EIDRM); +#endif +#ifdef EILSEQ + CASE(EILSEQ); +#endif +#ifdef EINPROGRESS + CASE(EINPROGRESS); +#endif +#ifdef EINTR + CASE(EINTR); +#endif +#ifdef EINVAL + CASE(EINVAL); +#endif +#ifdef EIO + CASE(EIO); +#endif +#ifdef EIOCBQUEUED + CASE(EIOCBQUEUED); +#endif +#ifdef EISCONN + CASE(EISCONN); +#endif +#ifdef EISDIR + CASE(EISDIR); +#endif +#ifdef EISNAM + CASE(EISNAM); +#endif +#ifdef EJUKEBOX + CASE(EJUKEBOX); +#endif +#ifdef EKEYEXPIRED + CASE(EKEYEXPIRED); +#endif +#ifdef EKEYREJECTED + CASE(EKEYREJECTED); +#endif +#ifdef EKEYREVOKED + CASE(EKEYREVOKED); +#endif +#ifdef EL2HLT + CASE(EL2HLT); +#endif +#ifdef EL2NSYNC + CASE(EL2NSYNC); +#endif +#ifdef EL3HLT + CASE(EL3HLT); +#endif +#ifdef EL3RST + CASE(EL3RST); +#endif +#ifdef ELIBACC + CASE(ELIBACC); +#endif +#ifdef ELIBBAD + CASE(ELIBBAD); +#endif +#ifdef ELIBEXEC + CASE(ELIBEXEC); +#endif +#ifdef ELIBMAX + CASE(ELIBMAX); +#endif +#ifdef ELIBSCN + CASE(ELIBSCN); +#endif +#ifdef ELNRNG + CASE(ELNRNG); +#endif +#ifdef ELOOP + CASE(ELOOP); +#endif +#ifdef EMEDIUMTYPE + CASE(EMEDIUMTYPE); +#endif +#ifdef EMFILE + CASE(EMFILE); +#endif +#ifdef EMLINK + CASE(EMLINK); +#endif +#ifdef EMSGSIZE + CASE(EMSGSIZE); +#endif +#ifdef EMULTIHOP + CASE(EMULTIHOP); +#endif +#ifdef ENAMETOOLONG + CASE(ENAMETOOLONG); +#endif +#ifdef ENAVAIL + CASE(ENAVAIL); +#endif +#ifdef ENETDOWN + CASE(ENETDOWN); +#endif +#ifdef ENETRESET + CASE(ENETRESET); +#endif +#ifdef ENETUNREACH + CASE(ENETUNREACH); +#endif +#ifdef ENFILE + CASE(ENFILE); +#endif +#ifdef ENOANO + CASE(ENOANO); +#endif +#ifdef ENOBUFS + CASE(ENOBUFS); +#endif +#ifdef ENOCSI + CASE(ENOCSI); +#endif +#ifdef ENODATA + CASE(ENODATA); +#endif +#ifdef ENODEV + CASE(ENODEV); +#endif +#ifdef ENOENT + CASE(ENOENT); +#endif +#ifdef ENOEXEC + CASE(ENOEXEC); +#endif +#ifdef ENOIOCTLCMD + CASE(ENOIOCTLCMD); +#endif +#ifdef ENOKEY + CASE(ENOKEY); +#endif +#ifdef ENOLCK + CASE(ENOLCK); +#endif +#ifdef ENOLINK + CASE(ENOLINK); +#endif +#ifdef ENOMEDIUM + CASE(ENOMEDIUM); +#endif +#ifdef ENOMEM + CASE(ENOMEM); +#endif +#ifdef ENOMSG + CASE(ENOMSG); +#endif +#ifdef ENONET + CASE(ENONET); +#endif +#ifdef ENOPKG + CASE(ENOPKG); +#endif +#ifdef ENOPROTOOPT + CASE(ENOPROTOOPT); +#endif +#ifdef ENOSPC + CASE(ENOSPC); +#endif +#ifdef ENOSR + CASE(ENOSR); +#endif +#ifdef ENOSTR + CASE(ENOSTR); +#endif +#ifdef ENOSYS + CASE(ENOSYS); +#endif +#ifdef ENOTBLK + CASE(ENOTBLK); +#endif +#ifdef ENOTCONN + CASE(ENOTCONN); +#endif +#ifdef ENOTDIR + CASE(ENOTDIR); +#endif +#ifdef ENOTEMPTY + CASE(ENOTEMPTY); +#endif +#ifdef ENOTNAM + CASE(ENOTNAM); +#endif +#ifdef ENOTRECOVERABLE + CASE(ENOTRECOVERABLE); +#endif +#ifdef ENOTSOCK + CASE(ENOTSOCK); +#endif +#ifdef ENOTSUPP + CASE(ENOTSUPP); +#endif +#ifdef ENOTSYNC + CASE(ENOTSYNC); +#endif +#ifdef ENOTTY + CASE(ENOTTY); +#endif +#ifdef ENOTUNIQ + CASE(ENOTUNIQ); +#endif +#ifdef ENXIO + CASE(ENXIO); +#endif +#ifdef EOPENSTALE + CASE(EOPENSTALE); +#endif +#ifdef EOPNOTSUPP + CASE(EOPNOTSUPP); +#endif +#ifdef EOVERFLOW + CASE(EOVERFLOW); +#endif +#ifdef EOWNERDEAD + CASE(EOWNERDEAD); +#endif +#ifdef EPERM + CASE(EPERM); +#endif +#ifdef EPFNOSUPPORT + CASE(EPFNOSUPPORT); +#endif +#ifdef EPIPE + CASE(EPIPE); +#endif +#ifdef EPROBE_DEFER + CASE(EPROBE_DEFER); +#endif +#ifdef EPROTO + CASE(EPROTO); +#endif +#ifdef EPROTONOSUPPORT + CASE(EPROTONOSUPPORT); +#endif +#ifdef EPROTOTYPE + CASE(EPROTOTYPE); +#endif +#ifdef ERANGE + CASE(ERANGE); +#endif +#ifdef EREMCHG + CASE(EREMCHG); +#endif +#ifdef EREMOTE + CASE(EREMOTE); +#endif +#ifdef EREMOTEIO + CASE(EREMOTEIO); +#endif +#ifdef ERESTART + CASE(ERESTART); +#endif +#ifdef ERESTARTNOHAND + CASE(ERESTARTNOHAND); +#endif +#ifdef ERESTARTNOINTR + CASE(ERESTARTNOINTR); +#endif +#ifdef ERESTARTSYS + CASE(ERESTARTSYS); +#endif +#ifdef ERESTART_RESTARTBLOCK + CASE(ERESTART_RESTARTBLOCK); +#endif +#ifdef ERFKILL + CASE(ERFKILL); +#endif +#ifdef EROFS + CASE(EROFS); +#endif +#ifdef ESERVERFAULT + CASE(ESERVERFAULT); +#endif +#ifdef ESHUTDOWN + CASE(ESHUTDOWN); +#endif +#ifdef ESOCKTNOSUPPORT + CASE(ESOCKTNOSUPPORT); +#endif +#ifdef ESPIPE + CASE(ESPIPE); +#endif +#ifdef ESRCH + CASE(ESRCH); +#endif +#ifdef ESRMNT + CASE(ESRMNT); +#endif +#ifdef ESTALE + CASE(ESTALE); +#endif +#ifdef ESTRPIPE + CASE(ESTRPIPE); +#endif +#ifdef ETIME + CASE(ETIME); +#endif +#ifdef ETIMEDOUT + CASE(ETIMEDOUT); +#endif +#ifdef ETOOMANYREFS + CASE(ETOOMANYREFS); +#endif +#ifdef ETOOSMALL + CASE(ETOOSMALL); +#endif +#ifdef ETXTBSY + CASE(ETXTBSY); +#endif +#ifdef EUCLEAN + CASE(EUCLEAN); +#endif +#ifdef EUNATCH + CASE(EUNATCH); +#endif +#ifdef EUSERS + CASE(EUSERS); +#endif +#ifdef EXDEV + CASE(EXDEV); +#endif +#ifdef EXFULL + CASE(EXFULL); +#endif + default: perror_msg_and_fail("unknown errno %d", errno); + } +} diff --git a/tests-mx32/error_msg.c b/tests-mx32/error_msg.c new file mode 100644 index 00000000..498a8821 --- /dev/null +++ b/tests-mx32/error_msg.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +void +perror_msg_and_fail(const char *fmt, ...) +{ + int err_no = errno; + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + if (err_no) + fprintf(stderr, ": %s\n", strerror(err_no)); + else + putc('\n', stderr); + exit(1); +} + +void +error_msg_and_fail(const char *fmt, ...) +{ + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + putc('\n', stderr); + exit(1); +} + +void +error_msg_and_skip(const char *fmt, ...) +{ + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + putc('\n', stderr); + exit(77); +} + +void +perror_msg_and_skip(const char *fmt, ...) +{ + int err_no = errno; + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + if (err_no) + fprintf(stderr, ": %s\n", strerror(err_no)); + else + putc('\n', stderr); + exit(77); +} diff --git a/tests-mx32/eventfd.c b/tests-mx32/eventfd.c new file mode 100644 index 00000000..d6ad6492 --- /dev/null +++ b/tests-mx32/eventfd.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#if defined __NR_eventfd2 && defined O_CLOEXEC + +int +main(void) +{ + (void) close(0); + if (syscall(__NR_eventfd2, -1L, 1 | O_CLOEXEC | O_NONBLOCK)) + perror_msg_and_skip("eventfd2"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_eventfd2 && O_CLOEXEC") + +#endif diff --git a/tests-mx32/eventfd.expected b/tests-mx32/eventfd.expected new file mode 100644 index 00000000..c4b45a07 --- /dev/null +++ b/tests-mx32/eventfd.expected @@ -0,0 +1,2 @@ +eventfd2(4294967295, EFD_SEMAPHORE|EFD_CLOEXEC|EFD_NONBLOCK) = 0 ++++ exited with 0 +++ diff --git a/tests-mx32/eventfd.test b/tests-mx32/eventfd.test new file mode 100755 index 00000000..e181ed6e --- /dev/null +++ b/tests-mx32/eventfd.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check eventfd2 syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e eventfd2 $args +match_diff + +exit 0 diff --git a/tests-mx32/execve-v.c b/tests-mx32/execve-v.c new file mode 100644 index 00000000..4506c635 --- /dev/null +++ b/tests-mx32/execve-v.c @@ -0,0 +1,3 @@ +/* This file is part of execve-v strace test. */ +#define VERBOSE 1 +#include "execve.c" diff --git a/tests-mx32/execve-v.test b/tests-mx32/execve-v.test new file mode 100755 index 00000000..cce58601 --- /dev/null +++ b/tests-mx32/execve-v.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check verbose decoding of execve syscall. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -veexecve $args > "$EXP" + +# Filter out execve() call made by strace. +grep -F test.execve < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/execve.c b/tests-mx32/execve.c new file mode 100644 index 00000000..74749e73 --- /dev/null +++ b/tests-mx32/execve.c @@ -0,0 +1,171 @@ +/* + * This file is part of execve strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#define FILENAME "test.execve\nfilename" +#define Q_FILENAME "test.execve\\nfilename" + +static const char * const argv[] = { + FILENAME, "first", "second", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_argv[] = { + Q_FILENAME, "first", "second" +}; + +static const char * const envp[] = { + "foobar=1", "foo\nbar=2", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_envp[] = { + "foobar=1", "foo\\nbar=2" +}; + +int +main(void) +{ + char ** const tail_argv = tail_memdup(argv, sizeof(argv)); + char ** const tail_envp = tail_memdup(envp, sizeof(envp)); + + execve(FILENAME, tail_argv, tail_envp); + printf("execve(\"%s\"" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" +#if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ???]" +#else + ", [/* 5 vars, unterminated */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], + argv[3], argv[4], argv[5] +#if VERBOSE + , q_envp[0], q_envp[1], envp[2], envp[3], envp[4] +#endif + ); + + tail_argv[ARRAY_SIZE(q_argv)] = NULL; + tail_envp[ARRAY_SIZE(q_envp)] = NULL; + + execve(FILENAME, tail_argv, tail_envp); + printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" +#if VERBOSE + ", [\"%s\", \"%s\"]" +#else + ", [/* 2 vars */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2] +#if VERBOSE + , q_envp[0], q_envp[1] +#endif + ); + + execve(FILENAME, tail_argv + 2, tail_envp + 1); + printf("execve(\"%s\", [\"%s\"]" +#if VERBOSE + ", [\"%s\"]" +#else + ", [/* 1 var */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[2] +#if VERBOSE + , q_envp[1] +#endif + ); + + char **const empty = tail_alloc(sizeof(*empty)); + char **const efault = empty + 1; + *empty = NULL; + + execve(FILENAME, empty, empty); + printf("execve(\"%s\", []" +#if VERBOSE + ", []" +#else + ", [/* 0 vars */]" +#endif + ") = -1 ENOENT (%m)\n", Q_FILENAME); + + char str_a[] = "012345678901234567890123456789012"; + char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; +#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) + char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); + char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); + unsigned int i; + for (i = 0; i <= DEFAULT_STRLEN; ++i) { + a[i] = &str_a[i]; + b[i] = &str_b[i]; + } + a[i] = b[i] = NULL; + + execve(FILENAME, a, b); + printf("execve(\"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); + for (i = 1; i < DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf(", \"%s\"", a[i]); +#else + printf(", ..."); +#endif +#if VERBOSE + printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); + for (i = 1; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %u vars */", DEFAULT_STRLEN + 1); +#endif + printf("]) = -1 ENOENT (%m)\n"); + + execve(FILENAME, a + 1, b + 1); + printf("execve(\"%s\", [\"%s\"", Q_FILENAME, a[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf("], [\"%s\"", b[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %d vars */", DEFAULT_STRLEN); +#endif + printf("]) = -1 ENOENT (%m)\n"); + + execve(FILENAME, (char **) tail_argv[ARRAY_SIZE(q_argv)], efault); + printf("execve(\"%s\", NULL, %p) = -1 ENOENT (%m)\n", + Q_FILENAME, efault); + + execve(FILENAME, efault, NULL); + printf("execve(\"%s\", %p, NULL) = -1 ENOENT (%m)\n", + Q_FILENAME, efault); + + return 0; +} diff --git a/tests-mx32/execve.test b/tests-mx32/execve.test new file mode 100755 index 00000000..263b6fc5 --- /dev/null +++ b/tests-mx32/execve.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check execve syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -eexecve $args > "$EXP" + +# Filter out execve() call made by strace. +grep -F test.execve < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/execveat-v.c b/tests-mx32/execveat-v.c new file mode 100644 index 00000000..ff4de2e8 --- /dev/null +++ b/tests-mx32/execveat-v.c @@ -0,0 +1,3 @@ +/* This file is part of execveat-v strace test. */ +#define VERBOSE 1 +#include "execveat.c" diff --git a/tests-mx32/execveat-v.test b/tests-mx32/execveat-v.test new file mode 100755 index 00000000..a9052248 --- /dev/null +++ b/tests-mx32/execveat-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of execveat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=execveat diff --git a/tests-mx32/execveat.c b/tests-mx32/execveat.c new file mode 100644 index 00000000..9083830e --- /dev/null +++ b/tests-mx32/execveat.c @@ -0,0 +1,188 @@ +/* + * This file is part of execveat strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_execveat + +# include +# include + +# define FILENAME "test.execveat\nfilename" +# define Q_FILENAME "test.execveat\\nfilename" + +static const char * const argv[] = { + FILENAME, "first", "second", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_argv[] = { + Q_FILENAME, "first", "second" +}; + +static const char * const envp[] = { + "foobar=1", "foo\nbar=2", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_envp[] = { + "foobar=1", "foo\\nbar=2" +}; + +int +main(void) +{ + const char ** const tail_argv = tail_memdup(argv, sizeof(argv)); + const char ** const tail_envp = tail_memdup(envp, sizeof(envp)); + + syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); + printf("execveat(AT_FDCWD, \"%s\"" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" +#if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ???]" +#else + ", [/* 5 vars, unterminated */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], + argv[3], argv[4], argv[5], +#if VERBOSE + q_envp[0], q_envp[1], envp[2], envp[3], envp[4], +#endif + errno2name()); + + tail_argv[ARRAY_SIZE(q_argv)] = NULL; + tail_envp[ARRAY_SIZE(q_envp)] = NULL; + + syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]" +#if VERBOSE + ", [\"%s\", \"%s\"]" +#else + ", [/* 2 vars */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], +#if VERBOSE + q_envp[0], q_envp[1], +#endif + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]" +#if VERBOSE + ", [\"%s\"]" +#else + ", [/* 1 var */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[2], +#if VERBOSE + q_envp[1], +#endif + errno2name()); + + char **const empty = tail_alloc(sizeof(*empty)); + char **const efault = empty + 1; + *empty = NULL; + + syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", []" +#if VERBOSE + ", []" +#else + ", [/* 0 vars */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, errno2name()); + + char str_a[] = "012345678901234567890123456789012"; + char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; +#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) + char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); + char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); + unsigned int i; + for (i = 0; i <= DEFAULT_STRLEN; ++i) { + a[i] = &str_a[i]; + b[i] = &str_b[i]; + } + a[i] = b[i] = NULL; + + syscall(__NR_execveat, -100, FILENAME, a, b, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); + for (i = 1; i < DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf(", \"%s\"", a[i]); +#else + printf(", ..."); +#endif +#if VERBOSE + printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); + for (i = 1; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %u vars */", DEFAULT_STRLEN + 1); +#endif + printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, a + 1, b + 1, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf("], [\"%s\"", b[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %d vars */", DEFAULT_STRLEN); +#endif + printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, NULL, efault, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", NULL, %p" + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, efault, errno2name()); + + syscall(__NR_execveat, -100, FILENAME, efault, NULL, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", %p, NULL" + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, efault, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_execveat") + +#endif diff --git a/tests-mx32/execveat.test b/tests-mx32/execveat.test new file mode 100755 index 00000000..879e03e2 --- /dev/null +++ b/tests-mx32/execveat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check execveat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/faccessat.c b/tests-mx32/faccessat.c new file mode 100644 index 00000000..ce81349d --- /dev/null +++ b/tests-mx32/faccessat.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_faccessat + +# include +# include + +int +main(void) +{ + static const char sample[] = "faccessat.sample"; + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_faccessat, fd, sample, F_OK); + printf("faccessat(%d, \"%s\", F_OK) = %ld %s (%m)\n", + (int) fd, sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_faccessat") + +#endif diff --git a/tests-mx32/faccessat.test b/tests-mx32/faccessat.test new file mode 100755 index 00000000..61e7e2fd --- /dev/null +++ b/tests-mx32/faccessat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check faccessat syscall decoding. + +. "${srcdir=.}/openat.test" diff --git a/tests-mx32/fadvise.h b/tests-mx32/fadvise.h new file mode 100644 index 00000000..7a75f73b --- /dev/null +++ b/tests-mx32/fadvise.h @@ -0,0 +1,57 @@ +/* + * Common definitions for fadvise64 and fadvise64_64 tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_FADVISE_H +#define STRACE_TESTS_FADVISE_H + +# include +# include +# include + +# include "xlat.h" +# include "xlat/advise.h" + +static void do_fadvise(long fd, long long offset, long long llen, long advice); + +int +main(void) +{ + static const long bogus_fd = (long) 0xfeedf00dbeeffaceULL; + static const long long bogus_offset = 0xbadc0dedda7a1057ULL; + static const long long bogus_len = 0xbadfaceca7b0d1e5ULL; + static const long bogus_advice = (long) 0xf00dfeeddeadca75ULL; + + do_fadvise(bogus_fd, bogus_offset, bogus_len, bogus_advice); + + puts("+++ exited with 0 +++"); + return 0; +} + +#endif /* !STRACE_TESTS_FADVISE_H */ diff --git a/tests-mx32/fadvise64.c b/tests-mx32/fadvise64.c new file mode 100644 index 00000000..930680be --- /dev/null +++ b/tests-mx32/fadvise64.c @@ -0,0 +1,76 @@ +/* + * Check decoding of fadvise64 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_fadvise64 + +# include "fadvise.h" + +static void +do_fadvise(long fd, long long offset, long long llen, long advice) +{ + long ret; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + ret = syscall(__NR_fadvise64, fd, offset, llen, advice); + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %llu, ", (int) fd, offset, llen); +# elif defined LINUX_MIPSO32 + ret = syscall(__NR_fadvise64, fd, 0, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen), advice); + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %lld, ", (int) fd, offset, llen); +# else /* LONG_MAX == INT_MAX && !X32 && !LINUX_MIPSN32 */ + long len = (long) llen; +# if defined POWERPC + ret = syscall(__NR_fadvise64, fd, 0, + LL_VAL_TO_PAIR(offset), len, advice); +# else + ret = syscall(__NR_fadvise64, fd, + LL_VAL_TO_PAIR(offset), len, advice); +# endif + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %lu, ", (int) fd, offset, len); +# endif /* LONG_MAX == INT_MAX && !X32 && !LINUX_MIPSN32 */ + printxval(advise, (unsigned) advice, "POSIX_FADV_???"); + printf(") = %s\n", errstr); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fadvise64"); + +#endif diff --git a/tests-mx32/fadvise64.test b/tests-mx32/fadvise64.test new file mode 100755 index 00000000..9f746720 --- /dev/null +++ b/tests-mx32/fadvise64.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of fadvise64 syscall. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e $NAME $args > "$EXP" +check_prog grep +grep -v "^$NAME([0123]," < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/fadvise64_64.c b/tests-mx32/fadvise64_64.c new file mode 100644 index 00000000..c23df97f --- /dev/null +++ b/tests-mx32/fadvise64_64.c @@ -0,0 +1,74 @@ +/* + * Check decoding of fadvise64_64 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __arm__ +# ifdef __NR_arm_fadvise64_64 +# undef __NR_fadvise64_64 +# define __NR_fadvise64_64 __NR_arm_fadvise64_64 +# endif /* __NR_arm_fadvise64_64 */ +#endif /* __arm__ */ + +#ifdef __NR_fadvise64_64 + +# include "fadvise.h" + +static void +do_fadvise(long fd, long long offset, long long llen, long advice) +{ + long ret; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + ret = syscall(__NR_fadvise64_64, fd, offset, llen, advice); +# elif defined __ARM_EABI__ || defined POWERPC || defined XTENSA + ret = syscall(__NR_fadvise64_64, fd, advice, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen)); +# else + ret = syscall(__NR_fadvise64_64, fd, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen), advice); +# endif + errstr = sprintrc(ret); + + printf("fadvise64_64(%d, %lld, %lld, ", (int) fd, offset, llen); + printxval(advise, (unsigned) advice, "POSIX_FADV_???"); + printf(") = %s\n", errstr); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fadvise64_64"); + +#endif diff --git a/tests-mx32/fadvise64_64.test b/tests-mx32/fadvise64_64.test new file mode 100755 index 00000000..a50fe2b9 --- /dev/null +++ b/tests-mx32/fadvise64_64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of fadvise64_64 syscall. + +. "${srcdir=.}/fadvise64.test" diff --git a/tests-mx32/fallocate.c b/tests-mx32/fallocate.c new file mode 100644 index 00000000..a31711b3 --- /dev/null +++ b/tests-mx32/fallocate.c @@ -0,0 +1,75 @@ +/* + * Check decoding of fallocate syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_fallocate) && defined(HAVE_FALLOCATE) && HAVE_FALLOCATE + +# include +# include +# include + +# include "xlat.h" +# include "xlat/falloc_flags.h" + +int +main(void) +{ + static const int bogus_fd = 0xbeefface; + static const int bogus_mode = 0xdeadca75; + static const off_t bogus_offset = (off_t) 0xbadc0dedda7a1057LLU; + static const off_t bogus_len = (off_t) 0xbadfaceca7b0d1e5LLU; + + long rc = fallocate(bogus_fd, bogus_mode, bogus_offset, bogus_len); + /* + * Workaround a bug fixed by commit glibc-2.11-346-gde240a0. + */ + if (rc > 0) { + errno = rc; + rc = -1; + } + const char *errstr = sprintrc(rc); + + printf("fallocate(%d, ", bogus_fd); + printflags(falloc_flags, (unsigned) bogus_mode, "FALLOC_FL_???"); + printf(", %lld, %lld) = %s\n", + (long long) bogus_offset, (long long) bogus_len, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fallocate && HAVE_FALLOCATE"); + +#endif diff --git a/tests-mx32/fallocate.test b/tests-mx32/fallocate.test new file mode 100755 index 00000000..405187e5 --- /dev/null +++ b/tests-mx32/fallocate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getcwd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/fanotify_init.c b/tests-mx32/fanotify_init.c new file mode 100644 index 00000000..c14b4131 --- /dev/null +++ b/tests-mx32/fanotify_init.c @@ -0,0 +1,95 @@ +/* + * Check decoding of fanotify_init syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined __NR_fanotify_init + +# include +# include +# include + +/* Performs fanotify_init call via the syscall interface. */ +static void +do_call(kernel_ulong_t flags, const char *flags_str, + kernel_ulong_t event_f_flags, const char *event_f_flags_str) +{ + long rc; + + rc = syscall(__NR_fanotify_init, flags, event_f_flags); + + printf("fanotify_init(%s, %s) = %s\n", + flags_str, event_f_flags_str, sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + + +int +main(void) +{ + static const struct strval flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "FAN_CLASS_NOTIF" }, + { (kernel_ulong_t) 0xffffffff0000000cULL, + "0xc /* FAN_CLASS_??? */" }, + { (kernel_ulong_t) 0xdec0deddefaced04ULL, + "FAN_CLASS_CONTENT|0xefaced00 /* FAN_??? */" }, + { (kernel_ulong_t) 0xffffffffffffffffULL, + "0xc /* FAN_CLASS_??? */|FAN_CLOEXEC|FAN_NONBLOCK|" + "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|0xffffffc0" }, + }; + static const struct strval event_f_flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { (kernel_ulong_t) 0xdeadbeef80000001ULL, + "O_WRONLY|0x80000000" } + }; + + unsigned int i; + unsigned int j; + + + for (i = 0; i < ARRAY_SIZE(flags); i++) + for (j = 0; j < ARRAY_SIZE(event_f_flags); j++) + do_call(flags[i].val, flags[i].str, + event_f_flags[j].val, event_f_flags[j].str); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fanotify_init") + +#endif diff --git a/tests-mx32/fanotify_init.test b/tests-mx32/fanotify_init.test new file mode 100755 index 00000000..8d26af42 --- /dev/null +++ b/tests-mx32/fanotify_init.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fanotify_init syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/fanotify_mark.c b/tests-mx32/fanotify_mark.c new file mode 100644 index 00000000..43f285d3 --- /dev/null +++ b/tests-mx32/fanotify_mark.c @@ -0,0 +1,182 @@ +/* + * Check decoding of fanotify_mark syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined HAVE_SYS_FANOTIFY_H && defined HAVE_FANOTIFY_MARK && \ + defined __NR_fanotify_mark + +# include +# include +# include +# include + +/* Performs fanotify_mark call via the syscall interface. */ +static void +do_call(kernel_ulong_t fd, kernel_ulong_t flags, const char *flags_str, + uint64_t mask, const char *mask_str, kernel_ulong_t dirfd, + const char *dirfd_str, kernel_ulong_t path, const char *path_str) +{ + long rc; + + rc = syscall(__NR_fanotify_mark, fd, flags, +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + mask, +# else +/* arch/parisc/kernel/sys_parisc32.c, commit ab8a261b */ +# ifdef HPPA + LL_VAL_TO_PAIR((mask << 32) | (mask >> 32)), +# else + LL_VAL_TO_PAIR(mask), +# endif +# endif + dirfd, path); + + printf("fanotify_mark(%d, %s, %s, %s, %s) = %s\n", + (int) fd, flags_str, mask_str, dirfd_str, path_str, + sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + +struct strval64 { + uint64_t val; + const char *str; +}; + +#define STR16 "0123456789abcdef" +#define STR64 STR16 STR16 STR16 STR16 + +int +main(void) +{ + enum { + PATH1_SIZE = 64, + }; + + static const kernel_ulong_t fds[] = { + (kernel_ulong_t) 0xdeadfeed12345678ULL, + (kernel_ulong_t) 0xffffffff00000000ULL, + (kernel_ulong_t) 0xdeb0d1edffffffffULL, + }; + static const struct strval flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "0" }, + { (kernel_ulong_t) 0xdec0deddefaced00ULL, + "0xefaced00 /* FAN_MARK_??? */" }, + { (kernel_ulong_t) 0xda7a105700000040ULL, + "FAN_MARK_IGNORED_SURV_MODIFY" }, + { (kernel_ulong_t) 0xbadc0deddeadfeedULL, + "FAN_MARK_ADD|FAN_MARK_DONT_FOLLOW|FAN_MARK_ONLYDIR|" + "FAN_MARK_IGNORED_MASK|FAN_MARK_IGNORED_SURV_MODIFY|" + "FAN_MARK_FLUSH|0xdeadfe00" }, + }; + static const struct strval64 masks[] = { + { ARG_ULL_STR(0) }, + { 0xdeadfeedfacebeefULL, + "FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_OPEN|" + "FAN_ACCESS_PERM|FAN_ONDIR|FAN_EVENT_ON_CHILD|" + "0xdeadfeedb2ccbec4" }, + { ARG_ULL_STR(0xffffffffb7fcbfc4) " /* FAN_??? */" }, + }; + static const struct strval dirfds[] = { + { (kernel_ulong_t) 0xfacefeed00000001ULL, "1" }, + { (kernel_ulong_t) 0xdec0ded0ffffffffULL, "FAN_NOFD" }, + { (kernel_ulong_t) 0xbadfacedffffff9cULL, "AT_FDCWD" }, + { (kernel_ulong_t) 0xdefaced1beeff00dULL, "-1091571699" }, + }; + static const char str64[] = STR64; + + static char bogus_path1_addr[sizeof("0x") + sizeof(void *) * 2]; + static char bogus_path1_after_addr[sizeof("0x") + sizeof(void *) * 2]; + + char *bogus_path1 = tail_memdup(str64, PATH1_SIZE); + char *bogus_path2 = tail_memdup(str64, sizeof(str64)); + + struct strval paths[] = { + { (kernel_ulong_t) 0, "NULL" }, + { (kernel_ulong_t) (uintptr_t) (bogus_path1 + PATH1_SIZE), + bogus_path1_after_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path1, bogus_path1_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path2, "\"" STR64 "\"" }, + }; + + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + unsigned int m; + int rc; + + + snprintf(bogus_path1_addr, sizeof(bogus_path1_addr), "%p", bogus_path1); + snprintf(bogus_path1_after_addr, sizeof(bogus_path1_after_addr), "%p", + bogus_path1 + PATH1_SIZE); + + rc = fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY | FAN_ONDIR, + -100, "."); + printf("fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY|FAN_ONDIR" + ", AT_FDCWD, \".\") = %s\n", sprintrc(rc)); + + for (i = 0; i < ARRAY_SIZE(fds); i++) { + for (j = 0; j < ARRAY_SIZE(flags); j++) { + for (k = 0; k < ARRAY_SIZE(masks); k++) { + for (l = 0; l < ARRAY_SIZE(dirfds); l++) { + for (m = 0; m < ARRAY_SIZE(paths); m++) + do_call(fds[i], + flags[j].val, + flags[j].str, + masks[k].val, + masks[k].str, + dirfds[l].val, + dirfds[l].str, + paths[m].val, + paths[m].str); + } + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_FANOTIFY_H && HAVE_FANOTIFY_MARK && " + "__NR_fanotify_mark") + +#endif diff --git a/tests-mx32/fanotify_mark.test b/tests-mx32/fanotify_mark.test new file mode 100755 index 00000000..fd671387 --- /dev/null +++ b/tests-mx32/fanotify_mark.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fanotify_mark syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-mx32/fchdir.c b/tests-mx32/fchdir.c new file mode 100644 index 00000000..3cde5e63 --- /dev/null +++ b/tests-mx32/fchdir.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_fchdir + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fchdir, fd); + printf("fchdir(%d) = %ld %s (%m)\n", + (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchdir") + +#endif diff --git a/tests-mx32/fchdir.test b/tests-mx32/fchdir.test new file mode 100755 index 00000000..3a4296ed --- /dev/null +++ b/tests-mx32/fchdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-mx32/fchmod.c b/tests-mx32/fchmod.c new file mode 100644 index 00000000..932d0830 --- /dev/null +++ b/tests-mx32/fchmod.c @@ -0,0 +1,72 @@ +/* + * Check decoding of fchmod syscall. + * + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fchmod + +# include +# include +# include +# include + +int +main(void) +{ + static const char fname[] = "fchmod_test_file"; + + int fd = open(fname, O_CREAT|O_RDONLY, 0400); + if (fd < 0) + perror_msg_and_fail("open"); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + long rc = syscall(__NR_fchmod, fd, 0600); + printf("fchmod(%d, 0600) = %s\n", fd, sprintrc(rc)); + + close(fd); + + rc = syscall(__NR_fchmod, fd, 051); + printf("fchmod(%d, 051) = %s\n", fd, sprintrc(rc)); + + rc = syscall(__NR_fchmod, fd, 004); + printf("fchmod(%d, 004) = %s\n", fd, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchmod") + +#endif diff --git a/tests-mx32/fchmod.test b/tests-mx32/fchmod.test new file mode 100755 index 00000000..4cb12632 --- /dev/null +++ b/tests-mx32/fchmod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchmod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/fchmodat.c b/tests-mx32/fchmodat.c new file mode 100644 index 00000000..c52a1cab --- /dev/null +++ b/tests-mx32/fchmodat.c @@ -0,0 +1,71 @@ +/* + * Check decoding of fchmodat syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fchmodat + +# include +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "fchmodat_sample"; + + if (open(sample, O_RDONLY | O_CREAT, 0400) < 0) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_fchmodat, -100, sample, 0600); + printf("fchmodat(AT_FDCWD, \"%s\", 0600) = %s\n", + sample, sprintrc(rc)); + + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_fchmodat, -100, sample, 051); + printf("fchmodat(AT_FDCWD, \"%s\", 051) = %s\n", + sample, sprintrc(rc)); + + rc = syscall(__NR_fchmodat, -100, sample, 004); + printf("fchmodat(AT_FDCWD, \"%s\", 004) = %s\n", + sample, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchmodat") + +#endif diff --git a/tests-mx32/fchmodat.test b/tests-mx32/fchmodat.test new file mode 100755 index 00000000..13cbe806 --- /dev/null +++ b/tests-mx32/fchmodat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fchmodat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/fchown.c b/tests-mx32/fchown.c new file mode 100644 index 00000000..d7119032 --- /dev/null +++ b/tests-mx32/fchown.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_fchown + +# define SYSCALL_NR __NR_fchown +# define SYSCALL_NAME "fchown" +# define ACCESS_BY_DESCRIPTOR + +# if defined __NR_fchown32 && __NR_fchown != __NR_fchown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchown") + +#endif diff --git a/tests-mx32/fchown.test b/tests-mx32/fchown.test new file mode 100755 index 00000000..63a0f2e3 --- /dev/null +++ b/tests-mx32/fchown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-mx32/fchown32.c b/tests-mx32/fchown32.c new file mode 100644 index 00000000..2d9d60f8 --- /dev/null +++ b/tests-mx32/fchown32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_fchown32 + +# define SYSCALL_NR __NR_fchown32 +# define SYSCALL_NAME "fchown32" +# define ACCESS_BY_DESCRIPTOR +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchown32") + +#endif diff --git a/tests-mx32/fchown32.test b/tests-mx32/fchown32.test new file mode 100755 index 00000000..e837f54e --- /dev/null +++ b/tests-mx32/fchown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/fchownat.c b/tests-mx32/fchownat.c new file mode 100644 index 00000000..f2f37ae3 --- /dev/null +++ b/tests-mx32/fchownat.c @@ -0,0 +1,69 @@ +/* + * Check decoding of fchownat syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_fchownat && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW + +# include +# include + +int +main(void) +{ + static const char sample[] = "fchownat_sample"; + uid_t uid = geteuid(); + uid_t gid = getegid(); + + if (open(sample, O_RDONLY | O_CREAT, 0400) == -1) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_fchownat, AT_FDCWD, sample, uid, gid, 0); + printf("fchownat(AT_FDCWD, \"%s\", %d, %d, 0) = %s\n", + sample, uid, gid, sprintrc(rc)); + + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_fchownat, AT_FDCWD, + sample, -1, -1L, AT_SYMLINK_NOFOLLOW); + printf("fchownat(AT_FDCWD, \"%s\", -1, -1, AT_SYMLINK_NOFOLLOW) = %s\n", + sample, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchownat && AT_FDCWD && AT_SYMLINK_NOFOLLOW") + +#endif diff --git a/tests-mx32/fchownat.test b/tests-mx32/fchownat.test new file mode 100755 index 00000000..e5d0f285 --- /dev/null +++ b/tests-mx32/fchownat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fchownat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/fcntl.c b/tests-mx32/fcntl.c new file mode 100644 index 00000000..f060cdf8 --- /dev/null +++ b/tests-mx32/fcntl.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fcntl + +# define TEST_SYSCALL_NR __NR_fcntl +# define TEST_SYSCALL_STR "fcntl" +# include "struct_flock.c" + +# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +static void +test_flock64_einval(const int cmd, const char *name) +{ + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, &fl, EINVAL_STR); +} + +static void +test_flock64(void) +{ +/* + * F_[GS]ETOWN_EX had conflicting values with F_[GS]ETLK64 + * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. + */ +#if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 + TEST_FLOCK64_EINVAL(F_SETLK64); +#endif +/* F_GETLK and F_SETLKW64 have conflicting values on mips64 */ +#if !defined(__mips64) || F_GETLK != F_SETLKW64 + TEST_FLOCK64_EINVAL(F_SETLKW64); +#endif +#if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 + TEST_FLOCK64_EINVAL(F_GETLK64); +#endif +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fcntl") + +#endif diff --git a/tests-mx32/fcntl.test b/tests-mx32/fcntl.test new file mode 100755 index 00000000..9aea122d --- /dev/null +++ b/tests-mx32/fcntl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fcntl decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-mx32/fcntl64.c b/tests-mx32/fcntl64.c new file mode 100644 index 00000000..5ecd6eb9 --- /dev/null +++ b/tests-mx32/fcntl64.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fcntl64 + +# define TEST_SYSCALL_NR __NR_fcntl64 +# define TEST_SYSCALL_STR "fcntl64" +# include "struct_flock.c" + +# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +static void +test_flock64_einval(const int cmd, const char *name) +{ + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); +} + +static void +test_flock64(void) +{ + TEST_FLOCK64_EINVAL(F_SETLK64); + TEST_FLOCK64_EINVAL(F_SETLKW64); +# ifdef F_OFD_SETLK + TEST_FLOCK64_EINVAL(F_OFD_SETLK); + TEST_FLOCK64_EINVAL(F_OFD_SETLKW); +# endif + + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_len = FILE_LEN + }; + long rc = invoke_test_syscall(F_SETLK64, &fl); + printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + + if (rc) + return; + + invoke_test_syscall(F_GETLK64, &fl); + printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(F_SETLK64, &fl); + printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fcntl64") + +#endif diff --git a/tests-mx32/fcntl64.test b/tests-mx32/fcntl64.test new file mode 100755 index 00000000..00ba671a --- /dev/null +++ b/tests-mx32/fcntl64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fcntl64 syscall decoding. + +. "${srcdir=.}/fcntl.test" diff --git a/tests-mx32/fdatasync.c b/tests-mx32/fdatasync.c new file mode 100644 index 00000000..fc82ade3 --- /dev/null +++ b/tests-mx32/fdatasync.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_fdatasync + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fdatasync, fd); + printf("fdatasync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fdatasync") + +#endif diff --git a/tests-mx32/fdatasync.test b/tests-mx32/fdatasync.test new file mode 100755 index 00000000..ff59749f --- /dev/null +++ b/tests-mx32/fdatasync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fdatasync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/file_handle.c b/tests-mx32/file_handle.c new file mode 100644 index 00000000..a5ad6c73 --- /dev/null +++ b/tests-mx32/file_handle.c @@ -0,0 +1,356 @@ +/* + * Check decoding of name_to_handle_at and open_by_handle_at syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_name_to_handle_at && defined __NR_open_by_handle_at + +# include +# include +# include +# include +# include +# include +# include + +enum assert_rc { + ASSERT_NONE, + ASSERT_SUCCESS, + ASSERT_ERROR, +}; + +# ifndef MAX_HANDLE_SZ + +# define MAX_HANDLE_SZ 128 + +struct file_handle { + unsigned int handle_bytes; + int handle_type; + unsigned char f_handle[0]; +}; +# endif /* !MAX_HANDLE_SZ */ + + +void +print_handle_data(unsigned char *bytes, unsigned int size) +{ + unsigned int i; + + if (size > MAX_HANDLE_SZ) + size = MAX_HANDLE_SZ; + + printf("0x"); + for (i = 0; i < size; ++i) + printf("%02x", bytes[i]); +} + +void +do_name_to_handle_at(kernel_ulong_t dirfd, const char *dirfd_str, + kernel_ulong_t pathname, const char *pathname_str, + kernel_ulong_t handle, const char *handle_str, + kernel_ulong_t mount_id, + kernel_ulong_t flags, const char *flags_str, + enum assert_rc assert_rc, long assert_errno) +{ + long rc; + const char *errstr; + + rc = syscall(__NR_name_to_handle_at, dirfd, pathname, handle, mount_id, + flags); + errstr = sprintrc(rc); + + if (assert_rc != ASSERT_NONE) + assert(rc == (assert_rc == ASSERT_SUCCESS ? 0 : -1)); + if (assert_errno) + assert(errno != assert_errno); + + printf("name_to_handle_at(%s, %s, %s", + dirfd_str, pathname_str, handle_str); + + if (rc != -1) { + struct file_handle *fh = + (struct file_handle *) (uintptr_t) handle; + int *mount_id_ptr = (int *) (uintptr_t) mount_id; + + printf(" => %u, handle_type=%d, f_handle=", + fh->handle_bytes, fh->handle_type); + print_handle_data((unsigned char *) fh + + sizeof(struct file_handle), + fh->handle_bytes); + printf("}, [%d]", *mount_id_ptr); + } else { + if (mount_id) + printf(", %#llx", (unsigned long long) mount_id); + else + printf(", NULL"); + } + + printf(", %s) = %s\n", flags_str, errstr); +} + +void +do_open_by_handle_at(kernel_ulong_t mount_fd, + kernel_ulong_t handle, bool valid_handle, bool valid_data, + kernel_ulong_t flags, const char *flags_str) +{ + long rc; + + printf("open_by_handle_at(%d, ", (int) mount_fd); + if (valid_handle) { + struct file_handle *fh = + (struct file_handle *) (uintptr_t) handle; + + printf("{handle_bytes=%u, handle_type=%d", fh->handle_bytes, + fh->handle_type); + + if (valid_data) { + printf(", f_handle="); + print_handle_data((unsigned char *) fh + + sizeof(struct file_handle), + fh->handle_bytes); + } + + printf("}"); + } else { + if (handle) + printf("%#llx", (unsigned long long) handle); + else + printf("NULL"); + } + printf(", %s) = ", flags_str); + + rc = syscall(__NR_open_by_handle_at, mount_fd, handle, flags); + + printf("%s\n", sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + +#define STR16 "0123456789abcdef" +#define STR64 STR16 STR16 STR16 STR16 + +int +main(void) +{ + enum { + PATH1_SIZE = 64, + }; + + static const kernel_ulong_t fdcwd = + (kernel_ulong_t) 0x87654321ffffff9cULL; + static const struct strval dirfds[] = { + { (kernel_ulong_t) 0xdeadca57badda7a1ULL, "-1159878751" }, + { (kernel_ulong_t) 0x12345678ffffff9cULL, "AT_FDCWD" }, + }; + static const struct strval name_flags[] = { + { (kernel_ulong_t) 0xdeadf15700000000ULL, "0" }, + { (kernel_ulong_t) 0xbadc0ded00001000ULL, + "AT_EMPTY_PATH" }, + { (kernel_ulong_t) 0xdeadc0deda7a1457ULL, + "AT_SYMLINK_FOLLOW|AT_EMPTY_PATH|0xda7a0057" }, + { (kernel_ulong_t) 0xdefaced1ffffebffULL, + "0xffffebff /* AT_??? */" }, + }; + static const kernel_ulong_t mount_fds[] = { + (kernel_ulong_t) 0xdeadca5701234567ULL, + (kernel_ulong_t) 0x12345678ffffff9cULL, + }; + static const struct strval open_flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { (kernel_ulong_t) 0xdeadbeef80000001ULL, + "O_WRONLY|0x80000000" } + }; + + static const char str64[] = STR64; + + + char *bogus_path1 = tail_memdup(str64, PATH1_SIZE); + char *bogus_path2 = tail_memdup(str64, sizeof(str64)); + + struct file_handle *handle = + tail_alloc(sizeof(struct file_handle) + MAX_HANDLE_SZ); + struct file_handle *handle_0 = + tail_alloc(sizeof(struct file_handle) + 0); + struct file_handle *handle_8 = + tail_alloc(sizeof(struct file_handle) + 8); + struct file_handle *handle_128 = + tail_alloc(sizeof(struct file_handle) + 128); + struct file_handle *handle_256 = + tail_alloc(sizeof(struct file_handle) + 256); + int *bogus_mount_id = tail_alloc(sizeof(*bogus_mount_id)); + + char handle_0_addr[sizeof("0x") + sizeof(void *) * 2]; + + char bogus_path1_addr[sizeof("0x") + sizeof(void *) * 2]; + char bogus_path1_after_addr[sizeof("0x") + sizeof(void *) * 2]; + + + struct strval paths[] = { + { (kernel_ulong_t) 0, "NULL" }, + { (kernel_ulong_t) (uintptr_t) (bogus_path1 + PATH1_SIZE), + bogus_path1_after_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path1, bogus_path1_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path2, "\"" STR64 "\"" }, + }; + struct strval name_handles[] = { + { (uintptr_t) (handle_0 + sizeof(struct file_handle)), + handle_0_addr }, + { (uintptr_t) handle_0, "{handle_bytes=256}" }, + { (uintptr_t) handle_8, "{handle_bytes=0}" }, + { (uintptr_t) handle_128, "{handle_bytes=128}" }, + { (uintptr_t) handle_256, "{handle_bytes=256}" }, + }; + struct { + kernel_ulong_t addr; + bool valid; + bool valid_data; + } open_handles[] = { + { 0, false, false }, + { (uintptr_t) (handle_0 + sizeof(struct file_handle)), + false, false }, + { (uintptr_t) handle_0 + 4, false, false }, + { (uintptr_t) handle_0, true, false }, + { (uintptr_t) handle_8, true, true }, + { (uintptr_t) handle_128, true, true }, + { (uintptr_t) handle_256, true, true }, + }; + kernel_ulong_t mount_ids[] = { + 0, + (kernel_ulong_t) (uintptr_t) (bogus_mount_id + 1), + (kernel_ulong_t) (uintptr_t) bogus_mount_id, + }; + + const int flags = 0x400; + int mount_id; + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + unsigned int m; + + + snprintf(bogus_path1_addr, sizeof(bogus_path1_addr), "%p", bogus_path1); + snprintf(bogus_path1_after_addr, sizeof(bogus_path1_after_addr), "%p", + bogus_path1 + PATH1_SIZE); + + handle_0->handle_bytes = 256; + handle_8->handle_bytes = 0; + handle_128->handle_bytes = 128; + handle_256->handle_bytes = 256; + + fill_memory((char *) handle_128 + sizeof(struct file_handle), 128); + fill_memory((char *) handle_256 + sizeof(struct file_handle), 256); + + snprintf(handle_0_addr, sizeof(handle_0_addr), "%p", + handle_0 + sizeof(struct file_handle)); + + handle->handle_bytes = 0; + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags | 1) == -1); + if (EINVAL != errno) + perror_msg_and_skip("name_to_handle_at"); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=0}, %p" + ", AT_SYMLINK_FOLLOW|0x1) = -1 EINVAL (%m)\n", &mount_id); + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags) == -1); + if (EOVERFLOW != errno) + perror_msg_and_skip("name_to_handle_at"); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=0 => %u}" + ", %p, AT_SYMLINK_FOLLOW) = -1 EOVERFLOW (%m)\n", + handle->handle_bytes, &mount_id); + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags) == 0); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=%u" + ", handle_type=%d, f_handle=0x", + handle->handle_bytes, handle->handle_type); + for (i = 0; i < handle->handle_bytes; ++i) + printf("%02x", handle->f_handle[i]); + printf("}, [%d], AT_SYMLINK_FOLLOW) = 0\n", mount_id); + + printf("open_by_handle_at(-1, {handle_bytes=%u, handle_type=%d" + ", f_handle=0x", handle->handle_bytes, handle->handle_type); + for (i = 0; i < handle->handle_bytes; ++i) + printf("%02x", handle->f_handle[i]); + int rc = syscall(__NR_open_by_handle_at, -1, handle, + O_RDONLY | O_DIRECTORY); + printf("}, O_RDONLY|O_DIRECTORY) = %d %s (%m)\n", rc, errno2name()); + + for (i = 0; i < ARRAY_SIZE(dirfds); i++) { + for (j = 0; j < ARRAY_SIZE(paths); j++) { + for (k = 0; k < ARRAY_SIZE(name_handles); k++) { + for (l = 0; l < ARRAY_SIZE(mount_ids); l++) { + for (m = 0; m < ARRAY_SIZE(name_flags); + m++) { + do_name_to_handle_at( + dirfds[i].val, + dirfds[i].str, + paths[j].val, + paths[j].str, + name_handles[k].val, + name_handles[k].str, + mount_ids[l], + name_flags[m].val, + name_flags[m].str, + ASSERT_ERROR, 0); + } + } + } + } + } + + for (i = 0; i < ARRAY_SIZE(mount_fds); i++) { + for (j = 0; j < ARRAY_SIZE(open_handles); j++) { + for (k = 0; k < ARRAY_SIZE(open_flags); k++) { + do_open_by_handle_at(mount_fds[i], + open_handles[j].addr, + open_handles[j].valid, + open_handles[j].valid_data, + open_flags[k].val, + open_flags[k].str); + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_name_to_handle_at && __NR_open_by_handle_at") + +#endif diff --git a/tests-mx32/file_handle.test b/tests-mx32/file_handle.test new file mode 100755 index 00000000..1ccc9d45 --- /dev/null +++ b/tests-mx32/file_handle.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check name_to_handle_at and open_by_handle_at syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests-mx32/file_ioctl.c b/tests-mx32/file_ioctl.c new file mode 100644 index 00000000..0fe17b15 --- /dev/null +++ b/tests-mx32/file_ioctl.c @@ -0,0 +1,45 @@ +#include "tests.h" + +#ifdef HAVE_LINUX_FIEMAP_H + +# include +# include +# include +# include +# include "xlat.h" +# include "xlat/fiemap_flags.h" + +static void +test_fiemap(void) +{ + (void) tail_alloc(1); + struct fiemap *const args = tail_alloc(sizeof(*args)); + + printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64", fm_flags=", + args->fm_start, args->fm_length); + printflags(fiemap_flags, args->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_extent_count=%u})", args->fm_extent_count); + ioctl(-1, FS_IOC_FIEMAP, args); + printf(" = -1 EBADF (%m)\n"); + + /* The live version of this test is in btrfs.c */ +} + +/* clone and dedupe ioctls are in btrfs.c since they originated there */ + +int +main(int argc, char *argv[]) +{ + test_fiemap(); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_FIEMAP_H") + +#endif diff --git a/tests-mx32/file_ioctl.test b/tests-mx32/file_ioctl.test new file mode 100755 index 00000000..7b8b8ce8 --- /dev/null +++ b/tests-mx32/file_ioctl.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check FS_IOC_FIEMAP ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/fill_memory.c b/tests-mx32/fill_memory.c new file mode 100644 index 00000000..a0aeccba --- /dev/null +++ b/tests-mx32/fill_memory.c @@ -0,0 +1,19 @@ +#include "tests.h" + +void +fill_memory_ex(void *ptr, size_t size, unsigned char start, + unsigned char period) +{ + unsigned char *p = ptr; + size_t i; + + for (i = 0; i < size; i++) { + p[i] = start + i % period; + } +} + +void +fill_memory(void *ptr, size_t size) +{ + fill_memory_ex(ptr, size, 0x80, 0x80); +} diff --git a/tests-mx32/filter-unavailable.c b/tests-mx32/filter-unavailable.c new file mode 100644 index 00000000..6368b2cb --- /dev/null +++ b/tests-mx32/filter-unavailable.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#define P 16 +#define T 7 + +static void * +thread(void *arg) +{ + assert(write(1, "", 1) == 1); + pause(); + return arg; +} + +static int +process(void) +{ + int i; + int fds[2]; + pthread_t t; + struct timespec ts = { .tv_nsec = 10000000 }; + + (void) close(0); + (void) close(1); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + for (i = 0; i < T; ++i) + assert(pthread_create(&t, NULL, thread, NULL) == 0); + for (i = 0; i < T; ++i) + assert(read(0, fds, 1) == 1); + + (void) nanosleep(&ts, 0); + return 0; +} + +int +main(void) +{ + int i, s; + pid_t p; + + for (i = 0; i < P; ++i) { + p = fork(); + if (p < 0) + perror_msg_and_fail("fork"); + if (p == 0) + return process(); + assert(waitpid(p, &s, 0) == p); + assert(WIFEXITED(s)); + if (WEXITSTATUS(s)) + return WEXITSTATUS(s); + } + return 0; +} diff --git a/tests-mx32/filter-unavailable.expected b/tests-mx32/filter-unavailable.expected new file mode 100644 index 00000000..e69de29b diff --git a/tests-mx32/filter-unavailable.test b/tests-mx32/filter-unavailable.test new file mode 100755 index 00000000..15a9ad1d --- /dev/null +++ b/tests-mx32/filter-unavailable.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# check that syscalls are filtered properly + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -qq -f -echdir -esignal=none $args +match_diff + +exit 0 diff --git a/tests-mx32/finit_module.c b/tests-mx32/finit_module.c new file mode 100644 index 00000000..3f0178f7 --- /dev/null +++ b/tests-mx32/finit_module.c @@ -0,0 +1,118 @@ +/* + * Check decoding of finit_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include "scno.h" + +#if defined(__NR_finit_module) + +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xdeb0d1edbeeff00dULL; + + static const struct { + kernel_ulong_t val; + const char *str; + } flags[] = { + { ARG_STR(0) }, + { (kernel_ulong_t) 0xffffffff00000002ULL, + "MODULE_INIT_IGNORE_VERMAGIC" }, + { (kernel_ulong_t) 0xbadc0deddefaced0ULL, + "0xdefaced0 /* MODULE_INIT_??? */" }, + { (kernel_ulong_t) 0xfacef157dec0ded1ULL, + "MODULE_INIT_IGNORE_MODVERSIONS|0xdec0ded0" }, + { -1LL, "MODULE_INIT_IGNORE_MODVERSIONS|" + "MODULE_INIT_IGNORE_VERMAGIC|0xfffffffc" }, + }; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_finit_module, bogus_zero, NULL, bogus_zero); + printf("finit_module(0, NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[0].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"..., %s) = %s\n", flags[0].str, errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[1].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\", %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2 + PARAM2_LEN, + flags[2].val); + printf("finit_module(%d, %p, %s) = %s\n", + (int) bogus_fd, bogus_param2 + PARAM2_LEN, flags[2].str, + sprintrc(rc)); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2, flags[3].val); + printf("finit_module(%d, %p, %s) = %s\n", + (int) bogus_fd, bogus_param2, flags[3].str, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2, flags[4].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\", %s) = %s\n", flags[4].str, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_finit_module"); + +#endif diff --git a/tests-mx32/finit_module.test b/tests-mx32/finit_module.test new file mode 100755 index 00000000..bd644f38 --- /dev/null +++ b/tests-mx32/finit_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of finit_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/flock.c b/tests-mx32/flock.c new file mode 100644 index 00000000..c154e437 --- /dev/null +++ b/tests-mx32/flock.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_flock + +# include +# include +# include + +int +main(void) +{ + const unsigned long fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_flock, fd, LOCK_SH); + printf("flock(%d, LOCK_SH) = %ld %s (%m)\n", + (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_flock") + +#endif diff --git a/tests-mx32/flock.test b/tests-mx32/flock.test new file mode 100755 index 00000000..24fcd74c --- /dev/null +++ b/tests-mx32/flock.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check flock syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/fork-f.c b/tests-mx32/fork-f.c new file mode 100644 index 00000000..11ac3d97 --- /dev/null +++ b/tests-mx32/fork-f.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static inline int +logit_(const char *const str) +{ + return !chdir(str); +} + +#define prefix "fork-f." +#define logit(arg) logit_(prefix arg) + +int main(int ac, char **av) +{ + if (ac < 1) + return 1; + if (ac > 1) + return logit("exec"); + + logit("start"); + + int child_wait_fds[2]; + (void) close(0); + if (pipe(child_wait_fds)) + perror_msg_and_fail("pipe"); + + pid_t pid = fork(); + + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + close(child_wait_fds[1]); + + if (read(0, child_wait_fds, sizeof(int))) + _exit(2); + + char *const args[] = { av[0], (char *) "", NULL }; + if (logit("child") || execve(args[0], args, args + 1)) + _exit(2); + } + + close(0); + + logit("parent"); + close(child_wait_fds[1]); + + int status; + assert(wait(&status) == pid); + assert(status == 0); + + pid_t ppid = getpid(); + logit("finish"); + + printf("%-5d chdir(\"%sstart\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sparent\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%schild\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sexec\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sfinish\") = -1 ENOENT (%m)\n", + ppid, prefix, + ppid, prefix, + pid, prefix, + pid, prefix, + ppid, prefix); + return 0; +} diff --git a/tests-mx32/fork-f.test b/tests-mx32/fork-f.test new file mode 100755 index 00000000..d8ca1e3b --- /dev/null +++ b/tests-mx32/fork-f.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check how strace -f follows fork syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e trace=chdir -e signal=none diff --git a/tests-mx32/fstat.c b/tests-mx32/fstat.c new file mode 100644 index 00000000..12df3e19 --- /dev/null +++ b/tests-mx32/fstat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstat + +# define TEST_SYSCALL_NR __NR_fstat +# define TEST_SYSCALL_STR "fstat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstat") + +#endif diff --git a/tests-mx32/fstat.test b/tests-mx32/fstat.test new file mode 100755 index 00000000..2ba0fbaa --- /dev/null +++ b/tests-mx32/fstat.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check fstat syscall decoding. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +syscall=$NAME +run_prog > /dev/null +sample=$syscall.sample +> "$sample" +run_strace -ve$syscall -P$sample -a21 $args > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/fstat64.c b/tests-mx32/fstat64.c new file mode 100644 index 00000000..a9c2e072 --- /dev/null +++ b/tests-mx32/fstat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstat64 + +# define TEST_SYSCALL_NR __NR_fstat64 +# define TEST_SYSCALL_STR "fstat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstat64") + +#endif diff --git a/tests-mx32/fstat64.test b/tests-mx32/fstat64.test new file mode 100755 index 00000000..8b4f5ef1 --- /dev/null +++ b/tests-mx32/fstat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstat64 syscall decoding. + +. "${srcdir=.}/fstat.test" diff --git a/tests-mx32/fstatat.c b/tests-mx32/fstatat.c new file mode 100644 index 00000000..66138c25 --- /dev/null +++ b/tests-mx32/fstatat.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_FSTATAT + +# define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, AT_FDCWD, sample, pst, AT_SYMLINK_NOFOLLOW) +# define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(AT_FDCWD, \"%s\", ", TEST_SYSCALL_STR, sample) +# define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(", AT_SYMLINK_NOFOLLOW) = %s\n", sprintrc(rc)); \ + } while (0) + +# include "xstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("HAVE_FSTATAT") + +#endif diff --git a/tests-mx32/fstatat64.c b/tests-mx32/fstatat64.c new file mode 100644 index 00000000..03082a8f --- /dev/null +++ b/tests-mx32/fstatat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatat64 + +# define TEST_SYSCALL_NR __NR_fstatat64 +# define TEST_SYSCALL_STR "fstatat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "fstatat.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatat64") + +#endif diff --git a/tests-mx32/fstatat64.test b/tests-mx32/fstatat64.test new file mode 100755 index 00000000..484008ac --- /dev/null +++ b/tests-mx32/fstatat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/fstatfs.c b/tests-mx32/fstatfs.c new file mode 100644 index 00000000..9e68c8d3 --- /dev/null +++ b/tests-mx32/fstatfs.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatfs + +# define SYSCALL_ARG_FMT "%d" +# define SYSCALL_ARG(file, desc) (desc) +# define SYSCALL_NR __NR_fstatfs +# define SYSCALL_NAME "fstatfs" +# include "xstatfs.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatfs") + +#endif diff --git a/tests-mx32/fstatfs.test b/tests-mx32/fstatfs.test new file mode 100755 index 00000000..646e66f2 --- /dev/null +++ b/tests-mx32/fstatfs.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatfs syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests-mx32/fstatfs64.c b/tests-mx32/fstatfs64.c new file mode 100644 index 00000000..afc54aa9 --- /dev/null +++ b/tests-mx32/fstatfs64.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatfs64 + +# define SYSCALL_ARG_FMT "%d" +# define SYSCALL_ARG(file, desc) (desc) +# define SYSCALL_NR __NR_fstatfs64 +# define SYSCALL_NAME "fstatfs64" +# include "xstatfs64.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatfs64") + +#endif diff --git a/tests-mx32/fstatfs64.test b/tests-mx32/fstatfs64.test new file mode 100755 index 00000000..179ff1bf --- /dev/null +++ b/tests-mx32/fstatfs64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatfs64 syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests-mx32/fstatx.c b/tests-mx32/fstatx.c new file mode 100644 index 00000000..f88d9a9c --- /dev/null +++ b/tests-mx32/fstatx.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define IS_FSTAT 1 +#define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, 0, pst) +#define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(0, ", TEST_SYSCALL_STR) +#define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +#include "xstatx.c" diff --git a/tests-mx32/fsync.c b/tests-mx32/fsync.c new file mode 100644 index 00000000..2f504106 --- /dev/null +++ b/tests-mx32/fsync.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_fsync + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fsync, fd); + printf("fsync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fsync") + +#endif diff --git a/tests-mx32/fsync.test b/tests-mx32/fsync.test new file mode 100755 index 00000000..a58b67be --- /dev/null +++ b/tests-mx32/fsync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fsync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/ftruncate.c b/tests-mx32/ftruncate.c new file mode 100644 index 00000000..ee17455f --- /dev/null +++ b/tests-mx32/ftruncate.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ftruncate + +# include +# include + +int +main(void) +{ + const kernel_ulong_t len = (kernel_ulong_t) 0xdefaced0badc0deULL; + long rc; + + if (sizeof(len) > sizeof(long)) + rc = ftruncate(-1, len); + else + rc = syscall(__NR_ftruncate, -1L, len); + + printf("ftruncate(-1, %llu) = %ld %s (%m)\n", + (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ftruncate") + +#endif diff --git a/tests-mx32/ftruncate.test b/tests-mx32/ftruncate.test new file mode 100755 index 00000000..ec8a1e05 --- /dev/null +++ b/tests-mx32/ftruncate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ftruncate syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/ftruncate64.c b/tests-mx32/ftruncate64.c new file mode 100644 index 00000000..90d9938f --- /dev/null +++ b/tests-mx32/ftruncate64.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ftruncate64 + +# include +# include + +int +main(void) +{ + const off_t len = 0xdefaceddeadbeefULL; + + int rc = ftruncate(-1, len); + printf("ftruncate64(-1, %llu) = %d %s (%m)\n", + (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ftruncate64") + +#endif diff --git a/tests-mx32/ftruncate64.test b/tests-mx32/ftruncate64.test new file mode 100755 index 00000000..90682102 --- /dev/null +++ b/tests-mx32/ftruncate64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ftruncate64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/futex.c b/tests-mx32/futex.c new file mode 100644 index 00000000..586b95d5 --- /dev/null +++ b/tests-mx32/futex.c @@ -0,0 +1,720 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_futex + +# include +# include +# include +# include +# include +# include + +# include + +# ifndef FUTEX_PRIVATE_FLAG +# define FUTEX_PRIVATE_FLAG 128 +# endif +# ifndef FUTEX_CLOCK_REALTIME +# define FUTEX_CLOCK_REALTIME 256 +# endif +# ifndef FUTEX_CMD_MASK +# define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME) +# endif + +# include "xlat.h" +# include "xlat/futexops.h" +# include "xlat/futexwakeops.h" +# include "xlat/futexwakecmps.h" + +static struct timespec *tmout; + +void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, + int *uaddr2, unsigned long val3, int rc) +{ + perror_msg_and_fail("futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", + uaddr, op, (unsigned) val, timeout, uaddr, (unsigned) val3, rc); +} + +# define CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, \ + enosys) \ + do { \ + rc = syscall(__NR_futex, (uaddr), (op), (val), (timeout), \ + (uaddr2), (val3)); \ + /* It is here due to EPERM on WAKE_OP on AArch64 */ \ + if ((rc == -1) && (errno == EPERM)) \ + break; \ + if (enosys && (rc == -1) && (errno == ENOSYS)) \ + break; \ + if (!(check)) \ + futex_error((uaddr), (op), (val), \ + (unsigned long) (timeout), (int *) (uaddr2), \ + (val3), rc); \ + } while (0) + +# define CHECK_FUTEX_ENOSYS(uaddr, op, val, timeout, uaddr2, val3, check) \ + CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, 1) + +# define CHECK_FUTEX(uaddr, op, val, timeout, uaddr2, val3, check) \ + CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, 0) + +enum argmask { + ARG3 = 1 << 0, + ARG4 = 1 << 1, + ARG5 = 1 << 2, + ARG6 = 1 << 3, +}; + +void invalid_op(int *val, int op, uint32_t argmask, ...) +{ + static const unsigned long args[] = { + (unsigned long) 0xface1e55deadbee1ULL, + (unsigned long) 0xface1e56deadbee2ULL, + (unsigned long) 0xface1e57deadbee3ULL, + (unsigned long) 0xface1e58deadbee4ULL, + }; + /* Since timeout value is copied before full op check, we should provide + * some valid timeout address or NULL */ + int cmd = op & FUTEX_CMD_MASK; + bool valid_timeout = (cmd == FUTEX_WAIT) || (cmd == FUTEX_LOCK_PI) || + (cmd == FUTEX_WAIT_BITSET) || (cmd == FUTEX_WAIT_REQUEUE_PI); + bool timeout_is_val2 = (cmd == FUTEX_REQUEUE) || + (cmd == FUTEX_CMP_REQUEUE) || (cmd == FUTEX_WAKE_OP) || + (cmd == FUTEX_CMP_REQUEUE_PI); + const char *fmt; + int saved_errno; + int rc; + int i; + va_list ap; + + + CHECK_FUTEX(val, op, args[0], valid_timeout ? 0 : args[1], args[2], + args[3], (rc == -1) && (errno == ENOSYS)); + saved_errno = errno; + printf("futex(%p, %#x /* FUTEX_??? */", val, op); + + va_start(ap, argmask); + + for (i = 0; i < 4; i++) { + if (argmask & (1 << i)) { + fmt = va_arg(ap, const char *); + + printf(", "); + + if (((1 << i) == ARG3) || ((1 << i) == ARG6) || + (((1 << i) == ARG4) && timeout_is_val2)) + printf(fmt, (unsigned) args[i]); + else + printf(fmt, args[i]); + } + } + + va_end(ap); + + errno = saved_errno; + printf(") = -1 ENOSYS (%m)\n"); +} + +# define CHECK_INVALID_CLOCKRT(op, ...) \ + do { \ + invalid_op(uaddr, FUTEX_CLOCK_REALTIME | (op), __VA_ARGS__); \ + invalid_op(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | \ + (op), __VA_ARGS__); \ + } while (0) + +/* Value which differs from one stored in int *val */ +# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) +# define VAL_PR ((unsigned) VAL) + +# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) +# define VAL2_PR ((unsigned) VAL2) + +# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) +# define VAL3_PR ((unsigned) VAL3) + +int +main(int argc, char *argv[]) +{ + int *uaddr = tail_alloc(sizeof(*uaddr)); + int *uaddr2 = tail_alloc(sizeof(*uaddr2)); + int rc; + unsigned i; + unsigned j; + + uaddr[0] = 0x1deadead; + uaddr2[0] = 0xbadf00d; + + tmout = tail_alloc(sizeof(*tmout)); + tmout->tv_sec = 123; + tmout->tv_nsec = 0xbadc0de; + + /* FUTEX_WAIT - check whether uaddr == val and sleep + * Possible flags: PRIVATE, CLOCK_RT (since 4.5) + * 1. uaddr - futex address + * 2. op - FUTEX_WAIT + * 3. val - expected value + * 4. timeout - address to timespec with timeout + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* uaddr is NULL */ + CHECK_FUTEX(NULL, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + VAL_PR, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* uaddr is faulty */ + CHECK_FUTEX(uaddr + 1, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr + 1, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* timeout is faulty */ + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout + 1, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_WAIT, %u, %p) = %s\n", + uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + + /* uaddr is not as provided; uaddr2 is faulty but ignored */ + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* uaddr is not as provided; uaddr2 is faulty but ignored */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, + uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* Next 2 tests are with CLOCKRT bit set */ + + /* Valid after v4.4-rc2-27-g337f130 */ + CHECK_FUTEX_ENOSYS(uaddr, + FUTEX_CLOCK_REALTIME | FUTEX_WAIT, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, + FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT , + VAL, tmout, uaddr2, 0, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* FUTEX_WAIT_BITSET - FUTEX_WAIT which provides additional bitmask + * which should be matched at least in one bit with + * wake mask in order to wake. + * Possible flags: PRIVATE, CLOCKRT + * 1. uaddr - futex address + * 2. op - FUTEX_TRYLOCK_PI + * 3. val - expected value stored in uaddr + * 4. timeout - timeout + * 5. uaddr2 - not used + * 6. val3 - bitmask + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " + "%#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + + /* val3 of 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " + "%#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, 0, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + + /* Next 3 tests are with CLOCKRT bit set */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, + sprintrc(rc)); + + /* val3 of 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, 0, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | + FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, + sprintrc(rc)); + + /* FUTEX_WAKE - wake val processes waiting for uaddr + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE + * 3. val - how many processes to wake + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* Zero processes to wake is not a good idea, but it should return 0 */ + CHECK_FUTEX(uaddr, FUTEX_WAKE, 0, NULL, NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE, %u) = %s\n", uaddr, 0, sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX(uaddr, FUTEX_WAKE, 10, NULL, NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE, %u) = %s\n", uaddr, 10, sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAKE, 10, NULL, + NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_PRIVATE, %u) = %s\n", uaddr, 10, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE, ARG3, "%u"); + + /* FUTEX_WAKE_BITSET - wake val processes waiting for uaddr which has at + * least one common bit with bitset provided in + * val3. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE + * 3. val - how many processes to wake + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - bitmask + */ + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, + VAL3, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, + VAL3_PR, sprintrc(rc)); + + /* bitset 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, 0, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, 0, + sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAKE_BITSET, 10, + NULL, NULL, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET_PRIVATE, %u, %#x) = %s\n", uaddr, + 10, VAL3_PR, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE_BITSET, ARG3 | ARG6, "%u", "%#x"); + + /* FUTEX_FD - deprecated + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_FD + * 3. val - signal number + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* FUTEX_FD is not implemented since 2.6.26 */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_FD, VAL, NULL, NULL, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_FD, %u) = %s\n", uaddr, VAL_PR, sprintrc(rc)); + + /* FUTEX_FD is not implemented since 2.6.26 */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_FD, VAL, NULL, + NULL, VAL3, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_FD|FUTEX_PRIVATE_FLAG, %u) = %s\n", uaddr, + VAL_PR, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_FD, ARG3, "%u"); + + /* FUTEX_REQUEUE - wake val processes and re-queue rest on uaddr2 + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - another futex address, to re-queue waiting processes on + * 6. val3 - not used + */ + + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3, + (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2, + uaddr2, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u", + "%#lx"); + + /* FUTEX_CMP_REQUEUE - wake val processes and re-queue rest on uaddr2 + * if uaddr has value val3 + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_CMP_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - another futex address, to re-queue waiting processes on + * 6. val3 - expected value stored in uaddr + */ + + /* Comparison re-queue with wrong val value */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + + /* Successful comparison re-queue */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr, + (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + /* Successful comparison re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL, + VAL2, uaddr2, *uaddr, (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", "%u"); + + /* FUTEX_WAKE_OP - wake val processes waiting for uaddr, additionally + * wake val2 processes waiting for uaddr2 in case + * operation encoded in val3 (change of value at uaddr2 + * and comparison of previous value against provided + * constant) succeedes with value at uaddr2. Operation + * result is written to value of uaddr2 (in any case). + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE_OP + * 3. val - how many processes to wake + * 4. val2 - amount of processes to wake in case operation encoded in + * val3 returns true + * 5. uaddr2 - another futex address, for conditional wake of + * additional processes + * 6. val3 - encoded operation: + * 1. bit 31 - if 1 then value stored in field field 4 + * should be interpreted as power of 2. + * 2. 28..30 - arithmetic operation which should be + * applied to previous value stored in + * uaddr2. Values available (from 2005 up to + * 2016): SET. ADD, OR, ANDN, XOR. + * 3. 24..29 - comparison operation which should be + * applied to the old value stored in uaddr2 + * (before arithmetic operation is applied). + * Possible values: EQ, NE, LT, LE, GT, GE. + * 4. 12..23 - Second operand for arithmetic operation. + * If bit 31 is set, it is interpreted as + * power of 2. + * 5. 00..11 - Value against which old value stored in + * uaddr2 is compared. + */ + + static const struct { + uint32_t val; + const char *str; + int err; + const char *errstr; + } wake_ops[] = { + { 0x00000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x00fff000, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" + "0" }, + { 0x00000fff, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|" + "0xfff" }, + { 0x00ffffff, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" + "0xfff" }, + { 0x10000000, "FUTEX_OP_ADD<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x20000000, "FUTEX_OP_OR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x30000000, "FUTEX_OP_ANDN<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x40000000, "FUTEX_OP_XOR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x50000000, "0x5<<28 /* FUTEX_OP_??? */|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + { 0x70000000, "0x7<<28 /* FUTEX_OP_??? */|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + { 0x80000000, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_SET<<28|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0" }, + { 0xa0caffee, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_OR<<28|" + "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee" }, + { 0x01000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_NE<<24|0" }, + { 0x01234567, "FUTEX_OP_SET<<28|0x234<<12|FUTEX_OP_CMP_NE<<24|" + "0x567" }, + { 0x02000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_LT<<24|0" }, + { 0x03000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_LE<<24|0" }, + { 0x04000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GT<<24|0" }, + { 0x05000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GE<<24|0" }, + { 0x06000000, "FUTEX_OP_SET<<28|0<<12|" + "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x07000000, "FUTEX_OP_SET<<28|0<<12|" + "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x08000000, "FUTEX_OP_SET<<28|0<<12|" + "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x0f000000, "FUTEX_OP_SET<<28|0<<12|" + "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0xbadfaced, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_ANDN<<28|" + "0xdfa<<12|0xa<<24 /* FUTEX_OP_CMP_??? */|0xced", + ENOSYS, "ENOSYS" }, + { 0xffffffff, "FUTEX_OP_OPARG_SHIFT<<28|" + "0x7<<28 /* FUTEX_OP_??? */|0xfff<<12|" + "0xf<<24 /* FUTEX_OP_CMP_??? */|0xfff", + ENOSYS, "ENOSYS" }, + }; + + for (i = 0; i < ARRAY_SIZE(wake_ops); i++) { + for (j = 0; j < 2; j++) { + CHECK_FUTEX_ENOSYS(uaddr, + j ? FUTEX_WAKE_OP_PRIVATE : FUTEX_WAKE_OP, + VAL, i, uaddr2, wake_ops[i].val, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s) = " + "%s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, i, + uaddr2, wake_ops[i].str, sprintrc(rc)); + } + } + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE_OP, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", + /* Decoding of the 0xdeadbee4 value */ + "FUTEX_OP_OPARG_SHIFT<<28|0x5<<28 /* FUTEX_OP_??? */|0xadb<<12|" + "0xe<<24 /* FUTEX_OP_CMP_??? */|0xee4"); + + /* FUTEX_LOCK_PI - slow path for mutex lock with process inheritance + * support. Expect that futex has 0 in unlocked case and + * TID of owning process in locked case. Value can also + * contain FUTEX_WAITERS bit signalling the presence of + * waiters queue. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_LOCK_PI + * 3. val - not used + * 4. timeout - timeout + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + *uaddr = getpid(); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_LOCK_PI, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* NULL is passed by invalid_op() in cases valid timeout address is + * needed */ + CHECK_INVALID_CLOCKRT(FUTEX_LOCK_PI, ARG4, "NULL"); + + /* FUTEX_UNLOCK_PI - slow path for mutex unlock with process inheritance + * support. Expected to be called by process in case + * it failed to execute fast path (it usually means + * that FUTEX_WAITERS flag had been set while the lock + * has been held). + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_UNLOCK_PI + * 3. val - not used + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_UNLOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_UNLOCK_PI) = %s\n", uaddr + 1, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_UNLOCK_PI, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr +1, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_UNLOCK_PI, 0); + + /* FUTEX_TRYLOCK_PI - slow path for mutex trylock with process + * inheritance support. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_TRYLOCK_PI + * 3. val - not used + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_TRYLOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_TRYLOCK_PI) = %s\n", uaddr + 1, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_TRYLOCK_PI, + VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_TRYLOCK_PI_PRIVATE) = %s\n", uaddr + 1, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_TRYLOCK_PI, 0); + + /* FUTEX_WAIT_REQUEUE_PI - kernel-side handling of special case when + * processes should be re-queued on PI-aware + * futexes. This is so special since PI futexes + * utilize rt_mutex and it should be at no time + * left free with a wait queue, so this should + * be performed atomically in-kernel. + * Possible flags: PRIVATE, CLOCKRT + * 1. uaddr - futex address + * 2. op - FUTEX_WAIT_REQUEUE_PI + * 3. val - expected value stored in uaddr + * 4. timeout - timeout + * 5. uaddr2 - (PI-aware) futex address to requeue process on + * 6. val3 - not used (in kernel, it always initialized to + * FUTEX_BITSET_MATCH_ANY and passed to + * futex_wait_requeue_pi()) + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, + VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) " + "= %s\n", uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_REQUEUE_PI, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | + FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME, " + "%u, {tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, + sprintrc(rc)); + + /* FUTEX_CMP_REQUEUE_PI - version of FUTEX_CMP_REQUEUE which re-queues + * on PI-aware futex. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_CMP_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - (PI-aware) futex address, to re-queue waiting processes + * on + * 6. val3 - expected value stored in uaddr + */ + + /* All these should fail with EINVAL since we try to re-queue to non-PI + * futex. + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CMP_REQUEUE_PI, VAL, VAL2, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CMP_REQUEUE_PI, VAL, VAL2, uaddr2, + *uaddr, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE_PI, + VAL, VAL2, uaddr2, *uaddr, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE_PI, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", "%u"); + + /* + * Unknown commands + */ + + CHECK_FUTEX(uaddr, 0xd, VAL, tmout + 1, uaddr2 + 1, VAL3, + (rc == -1) && (errno == ENOSYS)); + printf("futex(%p, 0xd /* FUTEX_??? */, %u, %p, %p, %#x) = %s\n", + uaddr, VAL_PR, tmout + 1, uaddr2 + 1, VAL3_PR, sprintrc(rc)); + + CHECK_FUTEX(uaddr, 0xbefeeded, VAL, tmout + 1, uaddr2, VAL3, + (rc == -1) && (errno == ENOSYS)); + printf("futex(%p, 0xbefeeded /* FUTEX_??? */, %u, %p, %p, %#x) = %s\n", + uaddr, VAL_PR, tmout + 1, uaddr2, VAL3_PR, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_futex") + +#endif diff --git a/tests-mx32/futex.test b/tests-mx32/futex.test new file mode 100755 index 00000000..fc98267a --- /dev/null +++ b/tests-mx32/futex.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check futex syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a27 +run_strace_match_diff -v -a27 diff --git a/tests-mx32/futimesat.c b/tests-mx32/futimesat.c new file mode 100644 index 00000000..c3566291 --- /dev/null +++ b/tests-mx32/futimesat.c @@ -0,0 +1,89 @@ +/* + * Check decoding of futimesat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_futimesat + +# include +# include +# include +# include + + +int +main(void) +{ + struct timeval tv; + if (gettimeofday(&tv, NULL)) + perror_msg_and_fail("gettimeofday"); + + static const char sample[] = "futimesat_sample"; + unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U; + + long rc = syscall(__NR_futimesat, dirfd, sample, 0); + printf("futimesat(AT_FDCWD, \"%s\", NULL) = %ld %s (%m)\n", + sample, rc, errno2name()); + + struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); + dirfd = (unsigned long) 0xdeadbeefffffffffULL; + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_usec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_usec = tv.tv_usec + 1; + + rc = syscall(__NR_futimesat, dirfd, 0, ts + 2); + printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n", + (int) dirfd, ts + 2, rc, errno2name()); + + rc = syscall(__NR_futimesat, dirfd, 0, ts + 1); + printf("futimesat(%d, NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " + "%ld %s (%m)\n", (int) dirfd, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + ts + 2, rc, errno2name()); + + (void) close(0); + rc = syscall(__NR_futimesat, 0, "", ts); + printf("futimesat(0, \"\", [{tv_sec=%jd, tv_usec=%jd}, " + "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", + (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_futimesat") + +#endif diff --git a/tests-mx32/futimesat.test b/tests-mx32/futimesat.test new file mode 100755 index 00000000..3a67c042 --- /dev/null +++ b/tests-mx32/futimesat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check futimesat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/get_mempolicy.c b/tests-mx32/get_mempolicy.c new file mode 100644 index 00000000..03d1bffc --- /dev/null +++ b/tests-mx32/get_mempolicy.c @@ -0,0 +1,135 @@ +/* + * Check decoding of get_mempolicy syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_get_mempolicy + +# include +# include + +# include "xlat.h" +# include "xlat/policies.h" + +# define MAX_STRLEN 3 +# define NLONGS(n) ((n + 8 * sizeof(long) - 2) \ + / (8 * sizeof(long))) + +static void +print_nodes(unsigned long maxnode) +{ + unsigned long *const nodemask = + tail_alloc(sizeof(*nodemask) * NLONGS(maxnode)); + + if (syscall(__NR_get_mempolicy, 0, nodemask, maxnode, 0, 0)) { + printf("get_mempolicy(NULL, %p, %lu, NULL, 0) = -1 %s (%m)\n", + nodemask, maxnode, errno2name()); + return; + } + + printf("get_mempolicy(NULL, ["); + + unsigned int nlongs = NLONGS(maxnode); + unsigned int i; + for (i = 0; i < nlongs; ++i) { + if (i) + fputs(", ", stdout); + if (i >= MAX_STRLEN) { + fputs("...", stdout); + break; + } + printf("%#0*lx", (int) sizeof(*nodemask) * 2 + 2, nodemask[i]); + } + + printf("], %lu, NULL, 0) = 0\n", maxnode); +} + +int +main(void) +{ + long rc; + + if (syscall(__NR_get_mempolicy, 0, 0, 0, 0, 0)) + perror_msg_and_skip("get_mempolicy"); + puts("get_mempolicy(NULL, NULL, 0, NULL, 0) = 0"); + + int *mode = (void *) 0xdefaced1baddeed2; + unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; + const unsigned long *nodemask = (void *) 0xfacedad3bebefed4ULL; + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long flags = -1U; + rc = syscall(__NR_get_mempolicy, mode, nodemask, maxnode, addr, flags); + printf("get_mempolicy(%p, %p, %lu, %#lx, %s|%#lx) = %ld %s (%m)\n", + mode, nodemask, maxnode, addr, + "MPOL_F_NODE|MPOL_F_ADDR", + flags & ~3, rc, errno2name()); + + mode = tail_alloc(sizeof(*mode)); + + rc = syscall(__NR_get_mempolicy, mode, 0, 0, 0, 0); + printf("get_mempolicy(["); + printxval(policies, (unsigned) *mode, "MPOL_???"); + printf("], NULL, 0, NULL, 0) = %ld\n", rc); + + *mode = -1; + rc = syscall(__NR_get_mempolicy, mode, 0, 0, mode - 1, 2); + printf("get_mempolicy(["); + printxval(policies, (unsigned) *mode, "MPOL_???"); + printf("], NULL, 0, %p, MPOL_F_ADDR) = %ld\n", mode - 1, rc); + + maxnode = get_page_size() * 8; + + print_nodes(maxnode); + print_nodes(maxnode + 1); + print_nodes(maxnode + 2); + + maxnode = sizeof(*nodemask) * 8; + print_nodes(maxnode - 1); + print_nodes(maxnode ); + print_nodes(maxnode + 1); + print_nodes(maxnode + 2); + print_nodes(maxnode * 2 - 1); + print_nodes(maxnode * 2 ); + print_nodes(maxnode * 2 + 1); + print_nodes(maxnode * 2 + 2); + print_nodes(maxnode * 3 - 1); + print_nodes(maxnode * 3 ); + print_nodes(maxnode * 3 + 1); + print_nodes(maxnode * 3 + 2); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_mempolicy") + +#endif diff --git a/tests-mx32/get_mempolicy.test b/tests-mx32/get_mempolicy.test new file mode 100755 index 00000000..92270970 --- /dev/null +++ b/tests-mx32/get_mempolicy.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check get_mempolicy syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a38 diff --git a/tests-mx32/get_page_size.c b/tests-mx32/get_page_size.c new file mode 100644 index 00000000..aeea861c --- /dev/null +++ b/tests-mx32/get_page_size.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include + +size_t +get_page_size(void) +{ + static size_t page_size; + + if (!page_size) + page_size = sysconf(_SC_PAGESIZE); + + return page_size; +} diff --git a/tests-mx32/getcpu.c b/tests-mx32/getcpu.c new file mode 100644 index 00000000..ec671f1e --- /dev/null +++ b/tests-mx32/getcpu.c @@ -0,0 +1,76 @@ +/* + * Check decoding of getcpu syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_getcpu + +# include +# include + +int +main(void) +{ + unsigned *bogus_cpu = + (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + unsigned *bogus_node = + (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + unsigned *bogus_tcache = + (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; + + long res; + unsigned *cpu = tail_alloc(sizeof(*cpu)); + unsigned *node = tail_alloc(sizeof(*node)); + long * tcache = tail_alloc(128); + + res = syscall(__NR_getcpu, NULL, NULL, NULL); + printf("getcpu(NULL, NULL, NULL) = %s\n", sprintrc(res)); + + res = syscall(__NR_getcpu, bogus_cpu, bogus_node, bogus_tcache); + printf("getcpu(%p, %p, %p) = %s\n", + bogus_cpu, bogus_node, bogus_tcache, sprintrc(res)); + + res = syscall(__NR_getcpu, cpu, node, tcache); + if (res != 0) + perror_msg_and_skip("getcpu"); + + printf("getcpu([%u], [%u], %p) = 0\n", *cpu, *node, tcache); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getcpu"); + +#endif diff --git a/tests-mx32/getcpu.test b/tests-mx32/getcpu.test new file mode 100755 index 00000000..fe212658 --- /dev/null +++ b/tests-mx32/getcpu.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getcpu syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/getcwd.c b/tests-mx32/getcwd.c new file mode 100644 index 00000000..707c25c9 --- /dev/null +++ b/tests-mx32/getcwd.c @@ -0,0 +1,46 @@ +#include "tests.h" + +#include + +#ifdef __NR_getcwd + +# include +# include +# include + +int +main(void) +{ + long res; + char cur_dir[PATH_MAX + 1]; + static const size_t bogus_size = (size_t) 0xbadc0deddeadfaceULL; + + res = syscall(__NR_getcwd, cur_dir, sizeof(cur_dir)); + + if (res <= 0) + perror_msg_and_fail("getcwd"); + + printf("getcwd(\""); + print_quoted_string(cur_dir); + printf("\", %zu) = %ld\n", sizeof(cur_dir), res); + + res = syscall(__NR_getcwd, cur_dir, 0); + printf("getcwd(%p, 0) = %s\n", cur_dir, sprintrc(res)); + + res = syscall(__NR_getcwd, NULL, bogus_size); + printf("getcwd(NULL, %zu) = %s\n", bogus_size, sprintrc(res)); + + res = syscall(__NR_getcwd, (void *) -1L, sizeof(cur_dir)); + printf("getcwd(%p, %zu) = %s\n", + (void *) -1L, sizeof(cur_dir), sprintrc(res)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getcwd"); + +#endif diff --git a/tests-mx32/getcwd.test b/tests-mx32/getcwd.test new file mode 100755 index 00000000..405187e5 --- /dev/null +++ b/tests-mx32/getcwd.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getcwd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/getdents.c b/tests-mx32/getdents.c new file mode 100644 index 00000000..b787c837 --- /dev/null +++ b/tests-mx32/getdents.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getdents + +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +static char buf[8192]; + +static const char * +str_d_type(const unsigned char d_type) +{ + switch (d_type) { + case DT_DIR: + return "DT_DIR"; + case DT_REG: + return "DT_REG"; + default: + return "DT_UNKNOWN"; + } +} +static void +print_dirent(const kernel_dirent *d) +{ + const unsigned int d_name_offset = offsetof(kernel_dirent, d_name); + int d_name_len = d->d_reclen - d_name_offset - 1; + assert(d_name_len > 0); + + printf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=", + (unsigned long long) d->d_ino, + (unsigned long long) d->d_off, d->d_reclen); + + if (d->d_name[0] == '.') + printf("\"%.*s\"", d_name_len, d->d_name); + else + printf("\"%s\"", qname); + + printf(", d_type=%s}", + str_d_type(*((const char *) d + d->d_reclen - 1))); +} + +int +main(int ac, const char **av) +{ + char *dname; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents, (long) 0xdefacedffffffffULL, NULL, + count); + printf("getdents(-1, NULL, %u) = %ld %s (%m)\n", + (unsigned) count, rc, errno2name()); + + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); + while ((rc = syscall(__NR_getdents, 0, buf, count))) { + kernel_dirent *d; + long i; + + if (rc < 0) + perror_msg_and_skip("getdents"); + printf("getdents(0, ["); + for (i = 0; i < rc; i += d->d_reclen) { + d = (kernel_dirent *) &buf[i]; + if (i) + printf(", "); + print_dirent(d); + } + printf("], %u) = %ld\n", (unsigned) count, rc); + } + printf("getdents(0, [], %u) = 0\n", (unsigned) count); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getdents") + +#endif diff --git a/tests-mx32/getdents.test b/tests-mx32/getdents.test new file mode 100755 index 00000000..23c4ac3a --- /dev/null +++ b/tests-mx32/getdents.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check getdents syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a22 -v diff --git a/tests-mx32/getdents64.c b/tests-mx32/getdents64.c new file mode 100644 index 00000000..9da2a23c --- /dev/null +++ b/tests-mx32/getdents64.c @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getdents64 + +# include +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +typedef struct { + uint64_t d_ino; + uint64_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[256]; +} kernel_dirent64; + +static char buf[8192]; + +static const char * +str_d_type(const unsigned char d_type) +{ + switch (d_type) { + case DT_DIR: + return "DT_DIR"; + case DT_REG: + return "DT_REG"; + default: + return "DT_UNKNOWN"; + } +} +static void +print_dirent(const kernel_dirent64 *d) +{ + const unsigned int d_name_offset = offsetof(kernel_dirent64, d_name); + int d_name_len = d->d_reclen - d_name_offset; + assert(d_name_len > 0); + + printf("{d_ino=%" PRIu64 ", d_off=%" PRId64 + ", d_reclen=%u, d_type=%s, d_name=", + d->d_ino, d->d_off, d->d_reclen, str_d_type(d->d_type)); + + if (d->d_name[0] == '.') + printf("\"%.*s\"}", d_name_len, d->d_name); + else + printf("\"%s\"}", qname); +} + +int +main(int ac, const char **av) +{ + char *dname; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents64, (long) 0xdefacedffffffffULL, NULL, + count); + printf("getdents64(-1, NULL, %u) = %ld %s (%m)\n", + (unsigned) count, rc, errno2name()); + + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); + while ((rc = syscall(__NR_getdents64, 0, buf, count))) { + kernel_dirent64 *d; + long i; + + if (rc < 0) + perror_msg_and_skip("getdents64"); + printf("getdents64(0, ["); + for (i = 0; i < rc; i += d->d_reclen) { + d = (kernel_dirent64 *) &buf[i]; + if (i) + printf(", "); + print_dirent(d); + } + printf("], %u) = %ld\n", (unsigned) count, rc); + } + printf("getdents64(0, [], %u) = 0\n", (unsigned) count); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getdents64") + +#endif diff --git a/tests-mx32/getdents64.test b/tests-mx32/getdents64.test new file mode 100755 index 00000000..401cfc7c --- /dev/null +++ b/tests-mx32/getdents64.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check getdents64 syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a24 -v diff --git a/tests-mx32/getegid.c b/tests-mx32/getegid.c new file mode 100644 index 00000000..98f8b9cb --- /dev/null +++ b/tests-mx32/getegid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getegid + +# include +# include + +int +main(void) +{ + printf("getegid() = %ld\n", syscall(__NR_getegid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getegid") + +#endif diff --git a/tests-mx32/getegid.test b/tests-mx32/getegid.test new file mode 100755 index 00000000..4354158b --- /dev/null +++ b/tests-mx32/getegid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getegid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getegid32.c b/tests-mx32/getegid32.c new file mode 100644 index 00000000..d9951864 --- /dev/null +++ b/tests-mx32/getegid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getegid32 + +# include +# include + +int +main(void) +{ + printf("getegid32() = %ld\n", syscall(__NR_getegid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getegid32") + +#endif diff --git a/tests-mx32/getegid32.test b/tests-mx32/getegid32.test new file mode 100755 index 00000000..a266620e --- /dev/null +++ b/tests-mx32/getegid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getegid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/geteuid.c b/tests-mx32/geteuid.c new file mode 100644 index 00000000..ef8269f9 --- /dev/null +++ b/tests-mx32/geteuid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_geteuid + +# include +# include + +int +main(void) +{ + printf("geteuid() = %ld\n", syscall(__NR_geteuid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_geteuid") + +#endif diff --git a/tests-mx32/geteuid.test b/tests-mx32/geteuid.test new file mode 100755 index 00000000..14ff6a69 --- /dev/null +++ b/tests-mx32/geteuid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check geteuid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/geteuid32.c b/tests-mx32/geteuid32.c new file mode 100644 index 00000000..4341e46f --- /dev/null +++ b/tests-mx32/geteuid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_geteuid32 + +# include +# include + +int +main(void) +{ + printf("geteuid32() = %ld\n", syscall(__NR_geteuid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_geteuid32") + +#endif diff --git a/tests-mx32/geteuid32.test b/tests-mx32/geteuid32.test new file mode 100755 index 00000000..9dd173d9 --- /dev/null +++ b/tests-mx32/geteuid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check geteuid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgid.c b/tests-mx32/getgid.c new file mode 100644 index 00000000..2e060390 --- /dev/null +++ b/tests-mx32/getgid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getgid + +# include +# include + +int +main(void) +{ + printf("getgid() = %ld\n", syscall(__NR_getgid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgid") + +#endif diff --git a/tests-mx32/getgid.test b/tests-mx32/getgid.test new file mode 100755 index 00000000..f4f0c2e6 --- /dev/null +++ b/tests-mx32/getgid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getgid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgid32.c b/tests-mx32/getgid32.c new file mode 100644 index 00000000..52e4d76a --- /dev/null +++ b/tests-mx32/getgid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getgid32 + +# include +# include + +int +main(void) +{ + printf("getgid32() = %ld\n", syscall(__NR_getgid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgid32") + +#endif diff --git a/tests-mx32/getgid32.test b/tests-mx32/getgid32.test new file mode 100755 index 00000000..3bc98d1a --- /dev/null +++ b/tests-mx32/getgid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getgid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgroups.c b/tests-mx32/getgroups.c new file mode 100644 index 00000000..2617303f --- /dev/null +++ b/tests-mx32/getgroups.c @@ -0,0 +1,135 @@ +/* + * Check decoding of getgroups/getgroups32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef __NR_getgroups32 + +# define SYSCALL_NR __NR_getgroups32 +# define SYSCALL_NAME "getgroups32" +# define GID_TYPE unsigned int + +#else + +# include "tests.h" +# include + +# ifdef __NR_getgroups + +# define SYSCALL_NR __NR_getgroups +# define SYSCALL_NAME "getgroups" +# if defined __NR_getgroups32 && __NR_getgroups != __NR_getgroups32 +# define GID_TYPE unsigned short +# else +# define GID_TYPE unsigned int +# endif + +# endif + +#endif + +#ifdef GID_TYPE + +# include +# include + +#define MAX_STRLEN 32 +static long ngroups; + +static void +get_groups(const long size, GID_TYPE *const g) +{ + long i = syscall(SYSCALL_NR, size, g); + if (i != ngroups) + perror_msg_and_fail("%s(%#lx, %p)", SYSCALL_NAME, size, g); + + printf("%s(%d, [", SYSCALL_NAME, (int) size); + for (i = 0; i < ngroups; ++i) { + if (i) + printf(", "); + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + printf("%u", (unsigned int) g[i]); + } + printf("]) = %ld\n", ngroups); +} + +int +main(void) +{ + long rc; + + /* check how the first argument is decoded */ + ngroups = syscall(SYSCALL_NR, 0, 0); + printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, ngroups); + if (ngroups < 0) + perror_msg_and_fail(SYSCALL_NAME); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, rc); + + rc = syscall(SYSCALL_NR, -1U, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1L, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + const unsigned int ngroups_max = sysconf(_SC_NGROUPS_MAX); + + rc = syscall(SYSCALL_NR, ngroups_max, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL | ngroups_max, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); + + /* check how the second argument is decoded */ + GID_TYPE *const g1 = + tail_alloc(ngroups ? sizeof(*g1) * ngroups : 1); + GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * (ngroups + 1)); + void *efault = g2 + ngroups + 1; + + get_groups(ngroups, g1); + get_groups(ngroups + 1, g1); + get_groups(ngroups + 1, g2); + + if (ngroups) { + rc = syscall(SYSCALL_NR, ngroups, efault); + printf("%s(%d, %p) = %s\n", + SYSCALL_NAME, (unsigned) ngroups, efault, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgroups") + +#endif diff --git a/tests-mx32/getgroups.test b/tests-mx32/getgroups.test new file mode 100755 index 00000000..2eb3056d --- /dev/null +++ b/tests-mx32/getgroups.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getgroups syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/getgroups32.c b/tests-mx32/getgroups32.c new file mode 100644 index 00000000..d0a356de --- /dev/null +++ b/tests-mx32/getgroups32.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include + +#ifdef __NR_getgroups32 + +# include "getgroups.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgroups32") + +#endif diff --git a/tests-mx32/getgroups32.test b/tests-mx32/getgroups32.test new file mode 100755 index 00000000..12a8bcc0 --- /dev/null +++ b/tests-mx32/getgroups32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getgroups32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/getpeername.c b/tests-mx32/getpeername.c new file mode 100644 index 00000000..c842acec --- /dev/null +++ b/tests-mx32/getpeername.c @@ -0,0 +1,63 @@ +/* + * Check decoding of getpeername syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME getpeername +#include "sockname.c" + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + int cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0 || cfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + if (listen(lfd, 1)) + perror_msg_and_skip("listen"); + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); + if (accept(lfd, 0, 0) < 0) + perror_msg_and_skip("accept"); + + test_sockname_syscall(cfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/getpeername.test b/tests-mx32/getpeername.test new file mode 100755 index 00000000..81f01bb1 --- /dev/null +++ b/tests-mx32/getpeername.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of getpeername syscall. + +. "${srcdir=.}/getsockname.test" diff --git a/tests-mx32/getpgrp.c b/tests-mx32/getpgrp.c new file mode 100644 index 00000000..8b9d0882 --- /dev/null +++ b/tests-mx32/getpgrp.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_getpgrp + +# include +# include + +int +main(void) +{ + printf("getpgrp() = %ld\n", syscall(__NR_getpgrp)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpgrp") + +#endif diff --git a/tests-mx32/getpgrp.test b/tests-mx32/getpgrp.test new file mode 100755 index 00000000..e116bb51 --- /dev/null +++ b/tests-mx32/getpgrp.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpgrp syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/getrandom.c b/tests-mx32/getrandom.c new file mode 100644 index 00000000..de1a0874 --- /dev/null +++ b/tests-mx32/getrandom.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getrandom + +# include +# include + +int +main(void) +{ + unsigned char buf[4]; + + if (syscall(__NR_getrandom, buf, sizeof(buf) - 1, 0) != sizeof(buf) - 1) + perror_msg_and_skip("getrandom"); + printf("getrandom(\"\\x%02x\\x%02x\\x%02x\", 3, 0) = 3\n", + (int) buf[0], (int) buf[1], (int) buf[2]); + + if (syscall(__NR_getrandom, buf, sizeof(buf), 1) != sizeof(buf)) + perror_msg_and_skip("getrandom"); + printf("getrandom(\"\\x%02x\\x%02x\\x%02x\"..., 4, GRND_NONBLOCK) = 4\n", + (int) buf[0], (int) buf[1], (int) buf[2]); + + if (syscall(__NR_getrandom, buf, sizeof(buf), 0x3003) != -1) + perror_msg_and_skip("getrandom"); + printf("getrandom(%p, 4, GRND_NONBLOCK|GRND_RANDOM|0x3000) = " + "-1 EINVAL (%m)\n", buf); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrandom") + +#endif diff --git a/tests-mx32/getrandom.test b/tests-mx32/getrandom.test new file mode 100755 index 00000000..ad34048f --- /dev/null +++ b/tests-mx32/getrandom.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getrandom syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -s3 diff --git a/tests-mx32/getresgid.c b/tests-mx32/getresgid.c new file mode 100644 index 00000000..b8c687b1 --- /dev/null +++ b/tests-mx32/getresgid.c @@ -0,0 +1,21 @@ +#include "tests.h" +#include + +#ifdef __NR_getresgid + +# define SYSCALL_NR __NR_getresgid +# define SYSCALL_NAME "getresgid" + +# if defined __NR_getresgid32 && __NR_getresgid != __NR_getresgid32 +# define UGID_TYPE short +# else +# define UGID_TYPE int +# endif + +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresgid") + +#endif diff --git a/tests-mx32/getresgid.test b/tests-mx32/getresgid.test new file mode 100755 index 00000000..9f5186e8 --- /dev/null +++ b/tests-mx32/getresgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/getresgid32.c b/tests-mx32/getresgid32.c new file mode 100644 index 00000000..71f11344 --- /dev/null +++ b/tests-mx32/getresgid32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_getresgid32 + +# define SYSCALL_NR __NR_getresgid32 +# define SYSCALL_NAME "getresgid32" +# define UGID_TYPE int +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresgid32") + +#endif diff --git a/tests-mx32/getresgid32.test b/tests-mx32/getresgid32.test new file mode 100755 index 00000000..a9798911 --- /dev/null +++ b/tests-mx32/getresgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getresugid.c b/tests-mx32/getresugid.c new file mode 100644 index 00000000..0ee721cf --- /dev/null +++ b/tests-mx32/getresugid.c @@ -0,0 +1,58 @@ +/* + * Check decoding of getresuid/getresgid/getresuid32/getresgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +int +main(void) +{ + unsigned UGID_TYPE *const r = tail_alloc(sizeof(*r)); + unsigned UGID_TYPE *const e = tail_alloc(sizeof(*e)); + unsigned UGID_TYPE *const s = tail_alloc(sizeof(*s)); + + if (syscall(SYSCALL_NR, r, e, s)) + perror_msg_and_fail(SYSCALL_NAME); + + printf("%s([%u], [%u], [%u]) = 0\n", SYSCALL_NAME, + (unsigned) *r, (unsigned) *e, (unsigned) *s); + + assert(syscall(SYSCALL_NR, NULL, e, s) == -1); + printf("%s(NULL, %p, %p) = -1 EFAULT (%m)\n", SYSCALL_NAME, e, s); + + assert(syscall(SYSCALL_NR, r, NULL, s) == -1); + printf("%s(%p, NULL, %p) = -1 EFAULT (%m)\n", SYSCALL_NAME, r, s); + + assert(syscall(SYSCALL_NR, r, e, NULL) == -1); + printf("%s(%p, %p, NULL) = -1 EFAULT (%m)\n", SYSCALL_NAME, r, e); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/getresuid.c b/tests-mx32/getresuid.c new file mode 100644 index 00000000..b00f20ba --- /dev/null +++ b/tests-mx32/getresuid.c @@ -0,0 +1,21 @@ +#include "tests.h" +#include + +#ifdef __NR_getresuid + +# define SYSCALL_NR __NR_getresuid +# define SYSCALL_NAME "getresuid" + +# if defined __NR_getresuid32 && __NR_getresuid != __NR_getresuid32 +# define UGID_TYPE short +# else +# define UGID_TYPE int +# endif + +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresuid") + +#endif diff --git a/tests-mx32/getresuid.test b/tests-mx32/getresuid.test new file mode 100755 index 00000000..eee1ac05 --- /dev/null +++ b/tests-mx32/getresuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/getresuid32.c b/tests-mx32/getresuid32.c new file mode 100644 index 00000000..4c9a83df --- /dev/null +++ b/tests-mx32/getresuid32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_getresuid32 + +# define SYSCALL_NR __NR_getresuid32 +# define SYSCALL_NAME "getresuid32" +# define UGID_TYPE int +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresuid32") + +#endif diff --git a/tests-mx32/getresuid32.test b/tests-mx32/getresuid32.test new file mode 100755 index 00000000..fdc76a31 --- /dev/null +++ b/tests-mx32/getresuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getrlimit.c b/tests-mx32/getrlimit.c new file mode 100644 index 00000000..bd9d0b0f --- /dev/null +++ b/tests-mx32/getrlimit.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_getrlimit + +# define NR_GETRLIMIT __NR_getrlimit +# define STR_GETRLIMIT "getrlimit" +# include "xgetrlimit.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrlimit") + +#endif diff --git a/tests-mx32/getrlimit.test b/tests-mx32/getrlimit.test new file mode 100755 index 00000000..6fd88aed --- /dev/null +++ b/tests-mx32/getrlimit.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of getrlimit syscall. + +. "${srcdir=.}/setrlimit.test" diff --git a/tests-mx32/getrusage.c b/tests-mx32/getrusage.c new file mode 100644 index 00000000..8b76eff6 --- /dev/null +++ b/tests-mx32/getrusage.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getrusage + +# include +# include +# include +# include + +int +main(void) +{ + struct rusage *const usage = tail_alloc(sizeof(struct rusage)); + int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage); + printf("getrusage(RUSAGE_SELF, {ru_utime={tv_sec=%jd, tv_usec=%jd}" + ", ru_stime={tv_sec=%jd, tv_usec=%jd}, ru_maxrss=%lu" + ", ru_ixrss=%lu, ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu" + ", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu" + ", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu" + ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n", + (intmax_t) usage->ru_utime.tv_sec, + (intmax_t) usage->ru_utime.tv_usec, + (intmax_t) usage->ru_stime.tv_sec, + (intmax_t) usage->ru_stime.tv_usec, + usage->ru_maxrss, usage->ru_ixrss, usage->ru_idrss, + usage->ru_isrss, usage->ru_minflt, usage->ru_majflt, + usage->ru_nswap, usage->ru_inblock, usage->ru_oublock, + usage->ru_msgsnd, usage->ru_msgrcv, usage->ru_nsignals, + usage->ru_nvcsw, usage->ru_nivcsw, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrusage") + +#endif diff --git a/tests-mx32/getrusage.test b/tests-mx32/getrusage.test new file mode 100755 index 00000000..4a3e8ed0 --- /dev/null +++ b/tests-mx32/getrusage.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getrusage syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v diff --git a/tests-mx32/getsid.c b/tests-mx32/getsid.c new file mode 100644 index 00000000..b563de9d --- /dev/null +++ b/tests-mx32/getsid.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include +#include + +int +main(void) +{ + pid_t pid = getpid(); + printf("getsid(%d) = %d\n", pid, getsid(pid)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/getsid.test b/tests-mx32/getsid.test new file mode 100755 index 00000000..3fcf9799 --- /dev/null +++ b/tests-mx32/getsid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getsid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/getsockname.c b/tests-mx32/getsockname.c new file mode 100644 index 00000000..66ac4e63 --- /dev/null +++ b/tests-mx32/getsockname.c @@ -0,0 +1,56 @@ +/* + * Check decoding of getsockname syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME getsockname +#include "sockname.c" + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + + test_sockname_syscall(lfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/getsockname.test b/tests-mx32/getsockname.test new file mode 100755 index 00000000..99b28506 --- /dev/null +++ b/tests-mx32/getsockname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getsockname syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getuid.c b/tests-mx32/getuid.c new file mode 100644 index 00000000..57311f72 --- /dev/null +++ b/tests-mx32/getuid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getuid + +# include +# include + +int +main(void) +{ + printf("getuid() = %ld\n", syscall(__NR_getuid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getuid") + +#endif diff --git a/tests-mx32/getuid.test b/tests-mx32/getuid.test new file mode 100755 index 00000000..9aaf74ba --- /dev/null +++ b/tests-mx32/getuid.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check getuid syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog uniq +run_prog > /dev/null +run_strace -qq -a9 -e$NAME $args > "$EXP" +uniq < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$OUT" "$EXP" diff --git a/tests-mx32/getuid32.c b/tests-mx32/getuid32.c new file mode 100644 index 00000000..397dd08f --- /dev/null +++ b/tests-mx32/getuid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getuid32 + +# include +# include + +int +main(void) +{ + printf("getuid32() = %ld\n", syscall(__NR_getuid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getuid32") + +#endif diff --git a/tests-mx32/getuid32.test b/tests-mx32/getuid32.test new file mode 100755 index 00000000..ae0c557b --- /dev/null +++ b/tests-mx32/getuid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getuid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getxxid.c b/tests-mx32/getxxid.c new file mode 100644 index 00000000..6eee52c5 --- /dev/null +++ b/tests-mx32/getxxid.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_getxpid && defined __NR_getxuid && defined __NR_getxgid + +# include +# include + +int +main(void) +{ + long id; + pid_t ppid; + + id = syscall(__NR_getxpid); + ppid = getppid(); + printf("getxpid() = %ld (ppid %ld)\n", id, (long) ppid); + printf("getxpid() = %ld (ppid %ld)\n", id, (long) ppid); + + id = syscall(__NR_getxuid); + printf("getxuid() = %ld (euid %ld)\n", id, id); + + id = syscall(__NR_getxgid); + printf("getxgid() = %ld (egid %ld)\n", id, id); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getxpid && __NR_getxuid && __NR_getxgid") + +#endif diff --git a/tests-mx32/getxxid.test b/tests-mx32/getxxid.test new file mode 100755 index 00000000..9b89d7cf --- /dev/null +++ b/tests-mx32/getxxid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getxpid, getxuid, and getxgid syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests-mx32/hexdump_strdup.c b/tests-mx32/hexdump_strdup.c new file mode 100644 index 00000000..4d6b53f4 --- /dev/null +++ b/tests-mx32/hexdump_strdup.c @@ -0,0 +1,66 @@ +/* + * Make a hexdump copy of C string + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +const char * +hexdump_memdup(const char *src, size_t len) +{ + size_t dst_size = 3 * len + 2; + assert(dst_size > len); + + char *dst = malloc(dst_size); + if (!dst) + perror_msg_and_fail("malloc(%zu)", dst_size); + + char *p = dst; + const unsigned char *usrc = (const unsigned char *) src; + size_t i; + for (i = 0; i < len; ++i) { + unsigned int c = usrc[i]; + *(p++) = ' '; + if (i == 8) + *(p++) = ' '; + *(p++) = "0123456789abcdef"[c >> 4]; + *(p++) = "0123456789abcdef"[c & 0xf]; + } + *p = '\0'; + + return dst; +} + +const char * +hexdump_strdup(const char *src) +{ + return hexdump_memdup(src, strlen(src)); +} diff --git a/tests-mx32/hexquote_strndup.c b/tests-mx32/hexquote_strndup.c new file mode 100644 index 00000000..3ad3970c --- /dev/null +++ b/tests-mx32/hexquote_strndup.c @@ -0,0 +1,58 @@ +/* + * Make a hexquoted copy of a string + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +const char * +hexquote_strndup(const char *src, const size_t src_len) +{ + const size_t dst_size = 4 * src_len + 1; + assert(dst_size > src_len); + + char *dst = malloc(dst_size); + if (!dst) + perror_msg_and_fail("malloc(%zu)", dst_size); + + char *p = dst; + size_t i; + for (i = 0; i < src_len; ++i) { + unsigned int c = ((const unsigned char *) src)[i]; + *(p++) = '\\'; + *(p++) = 'x'; + *(p++) = "0123456789abcdef"[c >> 4]; + *(p++) = "0123456789abcdef"[c & 0xf]; + } + *p = '\0'; + + return dst; +} diff --git a/tests-mx32/inet-cmsg.c b/tests-mx32/inet-cmsg.c new file mode 100644 index 00000000..b530016d --- /dev/null +++ b/tests-mx32/inet-cmsg.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +print_pktinfo(const struct cmsghdr *c) +{ + printf("IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex(\"lo\")" + ", ipi_spec_dst=inet_addr(\"127.0.0.1\")" + ", ipi_addr=inet_addr(\"127.0.0.1\")}"); +} + +static void +print_ttl(const struct cmsghdr *c) +{ + const unsigned int *ttl = (const unsigned int *) CMSG_DATA(c); + + printf("IP_TTL, cmsg_data=[%u]", *ttl); +} + +static void +print_tos(const struct cmsghdr *c) +{ + const uint8_t *tos = (const uint8_t *) CMSG_DATA(c); + + printf("IP_TOS, cmsg_data=[%#x]", *tos); +} + +static void +print_opts(const char *name, const struct cmsghdr *c) +{ + const unsigned char *opts = (const unsigned char *) CMSG_DATA(c); + const size_t len = c->cmsg_len - CMSG_ALIGN(sizeof(*c)); + + printf("%s", name); + if (len) { + printf(", cmsg_data=["); + size_t i; + for (i = 0; i < len; ++i) + printf("%s0x%02x", i ? ", " : "", opts[i]); + printf("]"); + } +} + +#ifdef IP_ORIGDSTADDR +static void +print_origdstaddr(const struct cmsghdr *c) +{ + const struct sockaddr_in *sin = + (const struct sockaddr_in *) CMSG_DATA(c); + + printf("IP_ORIGDSTADDR, cmsg_data={sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}", ntohs(sin->sin_port)); +} +#endif + +int +main(void) +{ + int i; + while ((i = open("/dev/null", O_RDWR)) < 3) + assert(i >= 0); + assert(!close(0)); + assert(!close(3)); + + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + }; + socklen_t len = sizeof(addr); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + assert(!getsockname(0, (struct sockaddr *) &addr, &len)); + + assert(socket(AF_INET, SOCK_DGRAM, 0) == 3); + assert(!connect(3, (struct sockaddr *) &addr, len)); + + const int opt_1 = htonl(0x01000000); +#define SETSOCKOPT(fd, name) assert(!setsockopt(fd, IPPROTO_IP, (name), &opt_1, sizeof(opt_1))) + SETSOCKOPT(3, IP_OPTIONS); + SETSOCKOPT(0, IP_PKTINFO); + SETSOCKOPT(0, IP_RECVTTL); + SETSOCKOPT(0, IP_RECVTOS); + SETSOCKOPT(0, IP_RECVOPTS); + SETSOCKOPT(0, IP_RETOPTS); +#ifdef IP_RECVORIGDSTADDR + SETSOCKOPT(0, IP_RECVORIGDSTADDR); +#endif + + static const char data[] = "data"; + const size_t size = sizeof(data) - 1; + assert(send(3, data, size, 0) == (int) size); + assert(!close(3)); + + char buf[size]; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof(buf) + }; + struct cmsghdr control[16]; + struct msghdr mh = { + .msg_name = &addr, + .msg_namelen = len, + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = control, + .msg_controllen = sizeof(control) + }; + + assert(recvmsg(0, &mh, 0) == (int) size); + assert(!close(0)); + + printf("recvmsg(0, {msg_name={sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, msg_namelen=%u" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=1" + ", msg_control=[", + ntohs(addr.sin_port), (unsigned) mh.msg_namelen, + data, (unsigned) size); + + struct cmsghdr *c; + for (c = CMSG_FIRSTHDR(&mh); c; c = CMSG_NXTHDR(&mh, c)) { + if (IPPROTO_IP != c->cmsg_level) + continue; + if (c != control) + printf(", "); + printf("{cmsg_len=%lu, cmsg_level=SOL_IP, cmsg_type=", + (unsigned long) c->cmsg_len); + switch (c->cmsg_type) { + case IP_PKTINFO: + print_pktinfo(c); + break; + case IP_TTL: + print_ttl(c); + break; + case IP_TOS: + print_tos(c); + break; + case IP_RECVOPTS: + print_opts("IP_RECVOPTS", c); + break; + case IP_RETOPTS: + print_opts("IP_RETOPTS", c); + break; +#ifdef IP_ORIGDSTADDR + case IP_ORIGDSTADDR: + print_origdstaddr(c); + break; +#endif + default: + printf("%d", c->cmsg_type); + break; + } + printf("}"); + } + printf("], msg_controllen=%lu, msg_flags=0}, 0) = %u\n", + (unsigned long) mh.msg_controllen, (unsigned) size); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-mx32/inet-cmsg.test b/tests-mx32/inet-cmsg.test new file mode 100755 index 00000000..52ff5f59 --- /dev/null +++ b/tests-mx32/inet-cmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check IPPROTO_IP control messages decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests-mx32/init.sh b/tests-mx32/init.sh new file mode 100644 index 00000000..f368b98a --- /dev/null +++ b/tests-mx32/init.sh @@ -0,0 +1,272 @@ +#!/bin/sh +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ME_="${0##*/}" +LOG="$ME_.tmp" +OUT="$LOG.out" +EXP="$LOG.exp" +NAME="${ME_%.test}" + +warn_() { printf >&2 '%s\n' "$*"; } +fail_() { warn_ "$ME_: failed test: $*"; exit 1; } +skip_() { warn_ "$ME_: skipped test: $*"; exit 77; } +framework_failure_() { warn_ "$ME_: framework failure: $*"; exit 99; } +framework_skip_() { warn_ "$ME_: framework skip: $*"; exit 77; } + +check_prog() +{ + type "$@" > /dev/null 2>&1 || + framework_skip_ "$* is not available" +} + +dump_log_and_fail_with() +{ + cat < "$LOG" + fail_ "$*" +} + +run_prog() +{ + if [ $# -eq 0 ]; then + set -- "./$NAME" + fi + args="$*" + "$@" || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$args exited with code 77" + else + fail_ "$args failed with code $rc" + fi + } +} + + +run_prog_skip_if_failed() +{ + args="$*" + "$@" || framework_skip_ "$args failed with code $?" +} + +run_strace() +{ + > "$LOG" || fail_ "failed to write $LOG" + args="$*" + $STRACE -o "$LOG" "$@" || + dump_log_and_fail_with "$STRACE $args failed with code $?" +} + +run_strace_merge() +{ + rm -f -- "$LOG".[0-9]* + run_strace -ff -tt "$@" + "$srcdir"/../strace-log-merge "$LOG" > "$LOG" || + dump_log_and_fail_with 'strace-log-merge failed with code $?' + rm -f -- "$LOG".[0-9]* +} + +check_gawk() +{ + check_prog gawk + check_prog grep + + local program="$1"; shift + if grep '^@include[[:space:]]' < "$program" > /dev/null; then + gawk '@include "/dev/null"' < /dev/null || + framework_skip_ 'gawk does not support @include' + fi +} + +# Usage: [FILE_TO_CHECK [AWK_PROGRAM [ERROR_MESSAGE [EXTRA_AWK_OPTIONS...]]]] +# Check whether AWK_PROGRAM matches FILE_TO_CHECK using gawk. +# If it doesn't, dump FILE_TO_CHECK and fail with ERROR_MESSAGE. +match_awk() +{ + local output program error + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + program="$srcdir/$NAME.awk" + else + program="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_gawk "$program" + + AWKPATH="$srcdir" gawk -f "$program" "$@" < "$output" || { + cat < "$output" + fail_ "$error" + } +} + +# Usage: [FILE_TO_CHECK [FILE_TO_COMPATE_WITH [ERROR_MESSAGE]]] +# Check whether FILE_TO_CHECK differs from FILE_TO_COMPATE_WITH. +# If it does, dump the difference and fail with ERROR_MESSAGE. +match_diff() +{ + local output expected error + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + expected="$srcdir/$NAME.expected" + else + expected="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_prog diff + + diff -- "$expected" "$output" || + fail_ "$error" +} + +# Usage: [FILE_TO_CHECK [FILE_WITH_PATTERNS [ERROR_MESSAGE]]] +# Check whether all patterns listed in FILE_WITH_PATTERNS +# match FILE_TO_CHECK using egrep. +# If at least one of these patterns does not match, +# dump both files and fail with ERROR_MESSAGE. +match_grep() +{ + local output patterns error pattern cnt failed= + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + patterns="$srcdir/$NAME.expected" + else + patterns="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_prog wc + check_prog grep + + cnt=1 + while read -r pattern; do + LC_ALL=C grep -E -x -e "$pattern" < "$output" > /dev/null || { + test -n "$failed" || { + echo 'Failed patterns of expected output:' + failed=1 + } + printf '#%d: %s\n' "$cnt" "$pattern" + } + cnt=$(($cnt + 1)) + done < "$patterns" + test -z "$failed" || { + echo 'Actual output:' + cat < "$output" + fail_ "$error" + } +} + +# Usage: run_strace_match_diff [args to run_strace] +run_strace_match_diff() +{ + args="$*" + [ -n "$args" -a -z "${args##*-e trace=*}" ] || + set -- -e trace="$NAME" "$@" + run_prog > /dev/null + run_strace "$@" $args > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +# Print kernel version code. +# usage: kernel_version_code $(uname -r) +kernel_version_code() +{ + ( + set -f + IFS=. + set -- $1 + v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0 + v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0 + v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0 + echo "$(($v1 * 65536 + $v2 * 256 + $v3))" + ) +} + +# Usage: require_min_kernel_version_or_skip 3.0 +require_min_kernel_version_or_skip() +{ + local uname_r + uname_r="$(uname -r)" + + [ "$(kernel_version_code "$uname_r")" -ge \ + "$(kernel_version_code "$1")" ] || + skip_ "the kernel release $uname_r is not $1 or newer" +} + +# Usage: grep_pid_status $pid GREP-OPTIONS... +grep_pid_status() +{ + local pid + pid=$1; shift + cat < "/proc/$pid/status" | grep "$@" +} + +check_prog cat +check_prog rm + +rm -f "$LOG" + +[ -n "${STRACE-}" ] || { + STRACE=../strace + case "${LOG_COMPILER-} ${LOG_FLAGS-}" in + *--suppressions=*--error-exitcode=*--tool=*) + # add valgrind command prefix + STRACE="${LOG_COMPILER-} ${LOG_FLAGS-} $STRACE" + ;; + esac +} + +: "${TIMEOUT_DURATION:=60}" +: "${SLEEP_A_BIT:=sleep 1}" + +[ -z "${VERBOSE-}" ] || + set -x diff --git a/tests-mx32/init_delete_module.h b/tests-mx32/init_delete_module.h new file mode 100644 index 00000000..db550c33 --- /dev/null +++ b/tests-mx32/init_delete_module.h @@ -0,0 +1,64 @@ +/* + * Helper header containing common code for finit_module, init_module, + * and delete_module tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_INIT_DELETE_MODULE_H +#define STRACE_TESTS_INIT_DELETE_MODULE_H + +# include +# include + +enum { + PARAM1_LEN = 33, + PARAM2_LEN = 8, + PARAM1_BASE = 0x30, + PARAM2_BASE = 0x80, + MAX_STRLEN = 32, +}; + +static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0xffffffff00000000ULL; + +static void +print_str(unsigned int base, unsigned int len, bool escape) +{ + unsigned int i; + + if (!escape) { + for (i = base; i < (base + len); i++) + putc(i, stdout); + + return; + } + + for (i = base; i < (base + len); i++) + printf("\\%u%u%u", (i >> 6) & 0x3, (i >> 3) & 0x7, i & 0x7); +} + +#endif /* !STRACE_TESTS_INIT_DELETE_MODULE_H */ diff --git a/tests-mx32/init_module.c b/tests-mx32/init_module.c new file mode 100644 index 00000000..88ef9ec8 --- /dev/null +++ b/tests-mx32/init_module.c @@ -0,0 +1,106 @@ +/* + * Check decoding of init_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_init_module) + +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfffffeedfffffaceULL; + static const kernel_ulong_t bogus_len = + (kernel_ulong_t) 0xfffffca7ffffc0deULL; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_init_module, NULL, bogus_zero, NULL); + printf("init_module(NULL, %llu, NULL) = %s\n", + (unsigned long long) bogus_zero, sprintrc(rc)); + + rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); + errstr = sprintrc(rc); + + printf("init_module(%#llx, 0, \"", (unsigned long long) bogus_addr); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"...) = %s\n", errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); + errstr = sprintrc(rc); + + printf("init_module(%#llx, 0, \"", (unsigned long long) bogus_addr); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\") = %s\n", errstr); + + rc = syscall(__NR_init_module, bogus_addr, bogus_len, + bogus_param2 + PARAM2_LEN); + printf("init_module(%#llx, %llu, %p) = %s\n", + (unsigned long long) bogus_addr, (unsigned long long) bogus_len, + bogus_param2 + PARAM2_LEN, sprintrc(rc)); + + rc = syscall(__NR_init_module, NULL, bogus_len, bogus_param2); + printf("init_module(NULL, %llu, %p) = %s\n", + (unsigned long long) bogus_len, bogus_param2, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_init_module, NULL, bogus_len, bogus_param2); + errstr = sprintrc(rc); + + printf("init_module(NULL, %llu, \"", (unsigned long long) bogus_len); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\") = %s\n", errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_init_module"); + +#endif diff --git a/tests-mx32/init_module.test b/tests-mx32/init_module.test new file mode 100755 index 00000000..ef7c7325 --- /dev/null +++ b/tests-mx32/init_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of init_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/inode_of_sockfd.c b/tests-mx32/inode_of_sockfd.c new file mode 100644 index 00000000..b227f306 --- /dev/null +++ b/tests-mx32/inode_of_sockfd.c @@ -0,0 +1,59 @@ +/* + * This file is part of strace test suite. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +unsigned long +inode_of_sockfd(const int fd) +{ + assert(fd >= 0); + + char linkpath[sizeof("/proc/self/fd/%u") + sizeof(int) * 3]; + assert(snprintf(linkpath, sizeof(linkpath), "/proc/self/fd/%u", fd) + < (int) sizeof(linkpath)); + + char path[PATH_MAX + 1]; + const ssize_t path_len = readlink(linkpath, path, sizeof(path) - 1); + if (path_len < 0) + perror_msg_and_fail("readlink: %s", linkpath); + path[path_len] = '\0'; + + static const char prefix[] = "socket:["; + const size_t prefix_len = sizeof(prefix) - 1; + assert(strncmp(path, prefix, prefix_len) == 0 + && path[path_len - 1] == ']'); + + return strtoul(path + prefix_len, NULL, 10); +} diff --git a/tests-mx32/inotify.c b/tests-mx32/inotify.c new file mode 100644 index 00000000..925d69ff --- /dev/null +++ b/tests-mx32/inotify.c @@ -0,0 +1,90 @@ +/* + * Check decoding of inotify_add_watch and inotify_rm_watch syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_inotify_add_watch) && defined(__NR_inotify_rm_watch) + +# include +# include +# include + +int +main(void) +{ + static const struct { + const char *path; + const char *str; + } bogus_path_str = { + ARG_STR("/abc\1/def\2/ghi\3/jkl\4/mno\5/pqr\6/stu\7/vwx\10") }; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfffffeedfffffaceULL; + static const kernel_ulong_t bogus_mask = + (kernel_ulong_t) 0xffffda7affffdeadULL; + static const char *bogus_mask_str = "IN_ACCESS|IN_ATTRIB|" + "IN_CLOSE_WRITE|IN_OPEN|IN_MOVED_TO|IN_DELETE|IN_DELETE_SELF|" + "IN_MOVE_SELF|IN_Q_OVERFLOW|IN_IGNORED|IN_ONLYDIR|" + "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_ADD|IN_ISDIR|IN_ONESHOT|" + "0x18ff1000"; + + long rc; + char *bogus_path = tail_memdup(bogus_path_str.path, + strlen(bogus_path_str.path) + 1); + + rc = syscall(__NR_inotify_add_watch, 0, NULL, 0); + printf("inotify_add_watch(0, NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_inotify_add_watch, bogus_fd, bogus_path + 4096, 0); + printf("inotify_add_watch(%d, %p, %u) = %s\n", + (int) bogus_fd, bogus_path + 4096, 0, sprintrc(rc)); + + rc = syscall(__NR_inotify_add_watch, bogus_fd, bogus_path, bogus_mask); + printf("inotify_add_watch(%d, %s, %s) = %s\n", + (int) bogus_fd, bogus_path_str.str, bogus_mask_str, + sprintrc(rc)); + + rc = syscall(__NR_inotify_rm_watch, 0, 0); + printf("inotify_rm_watch(0, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_inotify_rm_watch, bogus_fd, bogus_fd); + printf("inotify_rm_watch(%d, %d) = %s\n", + (int) bogus_fd, (int) bogus_fd, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_inotify_add_watch && __NR_inotify_rm_watch"); + +#endif diff --git a/tests-mx32/inotify.test b/tests-mx32/inotify.test new file mode 100755 index 00000000..436f3bc8 --- /dev/null +++ b/tests-mx32/inotify.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of inotify_add_watch and inotify_rm_watch syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=inotify_add_watch,inotify_rm_watch -a23 diff --git a/tests-mx32/inotify_init1.c b/tests-mx32/inotify_init1.c new file mode 100644 index 00000000..0325150d --- /dev/null +++ b/tests-mx32/inotify_init1.c @@ -0,0 +1,80 @@ +/* + * Check decoding of inotify_init1 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_inotify_init1) + +# include +# include +# include + +# ifdef O_CLOEXEC +# define cloexec_flag O_CLOEXEC +# else +# define cloexec_flag 0 +# endif +# define all_flags (O_NONBLOCK | cloexec_flag) + +int +main(void) +{ + static const kernel_ulong_t bogus_flags1 = + (kernel_ulong_t) 0xfacefeeddeadbeefULL | O_NONBLOCK; + static const kernel_ulong_t bogus_flags2 = + (kernel_ulong_t) 0x55555550ff96b77bULL & ~all_flags; + + long rc; + + rc = syscall(__NR_inotify_init1, bogus_flags1); + printf("inotify_init1(IN_NONBLOCK|%s%#x) = %s\n", + bogus_flags1 & cloexec_flag ? "IN_CLOEXEC|" : "", + (unsigned int) (bogus_flags1 & ~all_flags), + sprintrc(rc)); + + rc = syscall(__NR_inotify_init1, bogus_flags2); + printf("inotify_init1(%#x /* IN_??? */) = %s\n", + (unsigned int) bogus_flags2, sprintrc(rc)); + + rc = syscall(__NR_inotify_init1, all_flags); + printf("inotify_init1(IN_NONBLOCK%s) = %s\n", + all_flags & cloexec_flag ? "|IN_CLOEXEC" : "", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_inotify_init1"); + +#endif diff --git a/tests-mx32/inotify_init1.test b/tests-mx32/inotify_init1.test new file mode 100755 index 00000000..1a7c9261 --- /dev/null +++ b/tests-mx32/inotify_init1.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of inotify_init1 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/ioctl.c b/tests-mx32/ioctl.c new file mode 100644 index 00000000..92a3191d --- /dev/null +++ b/tests-mx32/ioctl.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_LINUX_MMTIMER_H +# include +#endif +#ifdef HAVE_LINUX_HIDDEV_H +# include +#endif +#ifdef HAVE_LINUX_INPUT_H +# include +#endif + +#include + +#if defined MMTIMER_GETRES \ + && defined VIDIOC_ENUMINPUT \ + && defined HIDIOCGVERSION \ + && defined HIDIOCGPHYS \ + && defined EVIOCGBIT \ + && defined EV_KEY + +int +main(void ) +{ + uint64_t data = 0; + +#ifndef POWERPC + struct termios tty; + (void) ioctl(-1, TCGETS, &tty); + printf("ioctl(-1, TCGETS, %p)" + " = -1 EBADF (%m)\n", &tty); +#endif + + (void) ioctl(-1, MMTIMER_GETRES, &data); + printf("ioctl(-1, MMTIMER_GETRES, %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, VIDIOC_ENUMINPUT, 0); + printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL)" + " = -1 EBADF (%m)\n"); + + (void) ioctl(-1, HIDIOCGVERSION, &data); + printf("ioctl(-1, HIDIOCGRDESCSIZE or HIDIOCGVERSION, %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, HIDIOCGPHYS(8), &data); + printf("ioctl(-1, HIDIOCGPHYS(8), %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, EVIOCGBIT(EV_KEY, 8), &data); + printf("ioctl(-1, EVIOCGBIT(EV_KEY, 8), %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, _IOR('M', 13, int), &data); + printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, [MTD_OTP_OFF])" + " = -1 EBADF (%m)\n"); + + (void) ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), (kernel_ulong_t) -1ULL); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), %#lx)" + " = -1 EBADF (%m)\n", -1UL); + + (void) ioctl(-1, _IOR(0xde, 0xad, data), &data); + printf("ioctl(-1, _IOC(_IOC_READ, 0xde, 0xad, 0x8), %p)" + " = -1 EBADF (%m)\n", &data); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("MMTIMER_GETRES && VIDIOC_ENUMINPUT" + " && HIDIOCGVERSION && HIDIOCGPHYS" + " && EVIOCGBIT && EV_KEY") + +#endif diff --git a/tests-mx32/ioctl.test b/tests-mx32/ioctl.test new file mode 100755 index 00000000..94bc5d42 --- /dev/null +++ b/tests-mx32/ioctl.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check ioctl syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-mx32/ioctl_block.c b/tests-mx32/ioctl_block.c new file mode 100644 index 00000000..f62b0b36 --- /dev/null +++ b/tests-mx32/ioctl_block.c @@ -0,0 +1,203 @@ +/* + * This file is part of ioctl_block strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_STRUCT_BLK_USER_TRACE_SETUP +# include +#endif +#include "xlat.h" + +static const unsigned int magic = 0xdeadbeef; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +static struct xlat block_argless[] = { + XLAT(BLKRRPART), + XLAT(BLKFLSBUF), +#ifdef BLKTRACESTART + XLAT(BLKTRACESTART), +#endif +#ifdef BLKTRACESTOP + XLAT(BLKTRACESTOP), +#endif +#ifdef BLKTRACETEARDOWN + XLAT(BLKTRACETEARDOWN), +#endif +}; + +#define TEST_NULL_ARG(cmd) \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) + +int +main(void) +{ + TEST_NULL_ARG(BLKBSZGET); + TEST_NULL_ARG(BLKBSZSET); + TEST_NULL_ARG(BLKFRAGET); + TEST_NULL_ARG(BLKGETSIZE); + TEST_NULL_ARG(BLKGETSIZE64); + TEST_NULL_ARG(BLKPG); + TEST_NULL_ARG(BLKRAGET); + TEST_NULL_ARG(BLKROGET); + TEST_NULL_ARG(BLKROSET); + TEST_NULL_ARG(BLKSECTGET); + TEST_NULL_ARG(BLKSECTGET); + TEST_NULL_ARG(BLKSSZGET); +#ifdef BLKALIGNOFF + TEST_NULL_ARG(BLKALIGNOFF); +#endif +#ifdef BLKDISCARD + TEST_NULL_ARG(BLKDISCARD); +#endif +#ifdef BLKDISCARDZEROES + TEST_NULL_ARG(BLKDISCARDZEROES); +#endif +#ifdef BLKIOMIN + TEST_NULL_ARG(BLKIOMIN); +#endif +#ifdef BLKIOOPT + TEST_NULL_ARG(BLKIOOPT); +#endif +#ifdef BLKPBSZGET + TEST_NULL_ARG(BLKPBSZGET); +#endif +#ifdef BLKROTATIONAL + TEST_NULL_ARG(BLKROTATIONAL); +#endif +#ifdef BLKSECDISCARD + TEST_NULL_ARG(BLKSECDISCARD); +#endif +#ifdef BLKZEROOUT + TEST_NULL_ARG(BLKZEROOUT); +#endif +#if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP + TEST_NULL_ARG(BLKTRACESETUP); +#endif + + ioctl(-1, BLKRASET, lmagic); + printf("ioctl(-1, BLKRASET, %lu) = -1 EBADF (%m)\n", lmagic); + + ioctl(-1, BLKFRASET, lmagic); + printf("ioctl(-1, BLKFRASET, %lu) = -1 EBADF (%m)\n", lmagic); + + int *const val_int = tail_alloc(sizeof(*val_int)); + *val_int = magic; + + ioctl(-1, BLKROSET, val_int); + printf("ioctl(-1, BLKROSET, [%d]) = -1 EBADF (%m)\n", *val_int); + + ioctl(-1, BLKBSZSET, val_int); + printf("ioctl(-1, BLKBSZSET, [%d]) = -1 EBADF (%m)\n", *val_int); + + uint64_t *pair_int64 = tail_alloc(sizeof(*pair_int64) * 2); + pair_int64[0] = 0xdeadbeefbadc0dedULL; + pair_int64[1] = 0xfacefeedcafef00dULL; + +#ifdef BLKDISCARD + ioctl(-1, BLKDISCARD, pair_int64); + printf("ioctl(-1, BLKDISCARD, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + +#ifdef BLKSECDISCARD + ioctl(-1, BLKSECDISCARD, pair_int64); + printf("ioctl(-1, BLKSECDISCARD, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + +#ifdef BLKZEROOUT + ioctl(-1, BLKZEROOUT, pair_int64); + printf("ioctl(-1, BLKZEROOUT, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + + struct blkpg_ioctl_arg *const blkpg = tail_alloc(sizeof(*blkpg)); + blkpg->op = 3; + blkpg->flags = 0xdeadbeef; + blkpg->datalen = 0xbadc0ded; + blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeedULL; + + ioctl(-1, BLKPG, blkpg); + printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + ", data=%#lx}) = -1 EBADF (%m)\n", + "BLKPG_RESIZE_PARTITION", blkpg->flags, blkpg->datalen, + (unsigned long) blkpg->data); + + struct blkpg_partition *const bp = tail_alloc(sizeof(*bp)); + bp->start = 0xfac1fed2dad3bef4ULL; + bp->length = 0xfac5fed6dad7bef8ULL; + bp->pno = magic; + memset(bp->devname, 'A', sizeof(bp->devname)); + memset(bp->volname, 'B', sizeof(bp->volname)); + blkpg->op = 1; + blkpg->data = bp; + + ioctl(-1, BLKPG, blkpg); + printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + ", data={start=%lld, length=%lld, pno=%d" + ", devname=\"%.*s\", volname=\"%.*s\"}})" + " = -1 EBADF (%m)\n", + "BLKPG_ADD_PARTITION", + blkpg->flags, blkpg->datalen, + bp->start, bp->length, bp->pno, + (int) sizeof(bp->devname) - 1, bp->devname, + (int) sizeof(bp->volname) - 1, bp->volname); + +#if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP + struct blk_user_trace_setup *const buts = tail_alloc(sizeof(*buts)); + fill_memory(buts, sizeof(*buts)); + + ioctl(-1, BLKTRACESETUP, buts); + printf("ioctl(-1, BLKTRACESETUP, {act_mask=%hu, buf_size=%u, buf_nr=%u" + ", start_lba=%" PRI__u64 ", end_lba=%" PRI__u64 ", pid=%u})" + " = -1 EBADF (%m)\n", + buts->act_mask, buts->buf_size, buts->buf_nr, + buts->start_lba, buts->end_lba, buts->pid); +#endif + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(block_argless); ++i) { + ioctl(-1, (unsigned long) block_argless[i].val, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", block_argless[i].str); + } + + ioctl(-1, _IOC(_IOC_READ, 0x12, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ, 0x12, 0xfe, 0xff)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_block.test b/tests-mx32/ioctl_block.test new file mode 100755 index 00000000..0bf2500f --- /dev/null +++ b/tests-mx32/ioctl_block.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of BLK* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_dm-v.c b/tests-mx32/ioctl_dm-v.c new file mode 100644 index 00000000..d95058f2 --- /dev/null +++ b/tests-mx32/ioctl_dm-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_dm.c" diff --git a/tests-mx32/ioctl_dm-v.test b/tests-mx32/ioctl_dm-v.test new file mode 100755 index 00000000..ade3b9e8 --- /dev/null +++ b/tests-mx32/ioctl_dm-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check unabbreviated decoding of DM* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -s9 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_dm.c b/tests-mx32/ioctl_dm.c new file mode 100644 index 00000000..08f036c6 --- /dev/null +++ b/tests-mx32/ioctl_dm.c @@ -0,0 +1,774 @@ +/* + * Check decoding of DM_* commands of ioctl syscall. + * + * Copyright (c) 2016 Mikulas Patocka + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_DM_IOCTL_H + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" + +# define ALIGNED_SIZE(s_, t_) \ + (((s_) + (ALIGNOF(t_) - 1UL)) & ~(ALIGNOF(t_) - 1UL)) +# define ALIGNED_OFFSET(t_, m_) \ + ALIGNED_SIZE(offsetof(t_, m_), t_) + +static const char str129[] = STR32 STR32 STR32 STR32 "6"; + +static const __u64 dts_sector_base = (__u64) 0xdeadca75facef157ULL; +static const __u64 dts_sector_step = (__u64) 0x100000001ULL; +static const __u64 dts_length_base = (__u64) 0xbadc0dedda7a1057ULL; +static const __u64 dts_length_step = (__u64) 0x700000007ULL; +static const __s32 dts_status_base = (__s32) 3141592653U; +static const __s32 dts_status_step = 0x1234; + +static const size_t min_sizeof_dm_ioctl = + offsetof(struct dm_ioctl, data); + +static struct s { + struct dm_ioctl ioc; + union { + struct { + struct dm_target_spec target_spec; + char target_params[256]; + } ts; + struct { + struct dm_target_msg target_msg; + char target_string[256]; + } tm; + char string[256]; + } u; +} s; + +struct dm_table_open_test { + struct dm_ioctl ioc; + struct dm_target_spec target0; + char param0[1]; + struct dm_target_spec target1; + char param1[2]; + struct dm_target_spec target2; + char param2[3]; + struct dm_target_spec target3; + char param3[4]; + struct dm_target_spec target4; + char param4[5]; + struct dm_target_spec target5; + char param5[6]; + struct dm_target_spec target6; + char param6[7]; + struct dm_target_spec target7; + char param7[8]; + struct dm_target_spec target8; + char param8[9]; + struct dm_target_spec target9; + char param9[10]; +}; + +struct dm_target_msg_test { + struct dm_ioctl ioc; + struct dm_target_msg msg; +}; + +struct args { + unsigned int arg; + const char *str; + bool has_params; + bool has_event_nr; +}; + + +static void +init_s(struct dm_ioctl *s, size_t size, size_t offs) +{ + memset(s, 0, size); + s->version[0] = DM_VERSION_MAJOR; + s->version[1] = 1; + s->version[2] = 2; + s->data_size = size; + s->data_start = offs; + s->dev = 0x1234; + strcpy(s->name, "nnn"); + strcpy(s->uuid, "uuu"); +} + +static void +init_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) +{ + ptr->sector_start = dts_sector_base + dts_sector_step * id; + ptr->length = dts_length_base + dts_length_step * id; + ptr->status = dts_status_base + dts_status_step * id; + + strncpy(ptr->target_type, str129 + + id % (sizeof(str129) - sizeof(ptr->target_type)), + id % (sizeof(ptr->target_type) + 1)); + if (id % (sizeof(ptr->target_type) + 1) < sizeof(ptr->target_type)) + ptr->target_type[id % (sizeof(ptr->target_type) + 1)] = '\0'; +} + +# if VERBOSE +static void +print_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) +{ + printf("{sector_start=%" PRI__u64 ", length=%" PRI__u64 ", " + "target_type=\"%.*s\", string=", + dts_sector_base + dts_sector_step * id, + dts_length_base + dts_length_step * id, + (int) (id % (sizeof(ptr->target_type) + 1)), + str129 + id % (sizeof(str129) - sizeof(ptr->target_type))); +} +# endif /* VERBOSE */ + +int +main(void) +{ + static kernel_ulong_t dummy_dm_ioctl1 = + _IOC(_IOC_READ, DM_IOCTL, 0, 0x1fff); + static kernel_ulong_t dummy_dm_ioctl2 = + _IOC(_IOC_READ|_IOC_WRITE, DM_IOCTL, 0xed, 0); + static kernel_ulong_t dummy_dm_arg = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + /* We can't check these properly for now */ + static struct args dummy_check_cmds_nodev[] = { + { ARG_STR(DM_REMOVE_ALL), false }, + { ARG_STR(DM_LIST_DEVICES), true }, + { ARG_STR(DM_LIST_VERSIONS), true }, + }; + static struct args dummy_check_cmds[] = { + { ARG_STR(DM_DEV_CREATE), false }, + { ARG_STR(DM_DEV_REMOVE), false, true }, + { ARG_STR(DM_DEV_STATUS), false }, + { ARG_STR(DM_DEV_WAIT), true, true }, + { ARG_STR(DM_TABLE_CLEAR), false }, + { ARG_STR(DM_TABLE_DEPS), true }, + { ARG_STR(DM_TABLE_STATUS), true }, + }; + + struct dm_ioctl *unaligned_dm_arg = + tail_alloc(offsetof(struct dm_ioctl, data)); + struct dm_ioctl *dm_arg = + tail_alloc(ALIGNED_OFFSET(struct dm_ioctl, data)); + struct dm_table_open_test *dm_arg_open1 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, target1)); + struct dm_table_open_test *dm_arg_open2 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, param1)); + struct dm_table_open_test *dm_arg_open3 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, target9)); + struct dm_target_msg_test *dm_arg_msg = + tail_alloc(sizeof(*dm_arg_msg)); + + long rc; + const char *errstr; + unsigned int i; + + + /* Incorrect operation */ + ioctl(-1, _IOW(DM_IOCTL, 0xde, int), dm_arg); + printf("ioctl(-1, _IOC(_IOC_WRITE, %#x, 0xde, %#zx), %p) = " + "-1 EBADF (%m)\n", + DM_IOCTL, sizeof(int), dm_arg); + + ioctl(-1, dummy_dm_ioctl1, 0); + printf("ioctl(-1, _IOC(_IOC_READ, %#x, 0, %#x), 0) = -1 EBADF (%m)\n", + DM_IOCTL, (unsigned int) _IOC_SIZE(dummy_dm_ioctl1)); + + ioctl(-1, dummy_dm_ioctl2, dummy_dm_arg); + printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, %#x, %#x, 0), %#lx) = " + "-1 EBADF (%m)\n", + DM_IOCTL, (unsigned int) _IOC_NR(dummy_dm_ioctl2), + (unsigned long) dummy_dm_arg); + + + /* DM_VERSION */ + /* Incorrect pointer */ + ioctl(-1, DM_VERSION, dm_arg + 1); + printf("ioctl(-1, DM_VERSION, %p) = -1 EBADF (%m)\n", dm_arg + 1); + + /* Incorrect data_size */ + init_s(dm_arg, 0, 0); + ioctl(-1, DM_VERSION, &s); + printf("ioctl(-1, DM_VERSION, %p) = -1 EBADF (%m)\n", &s); + + /* Incorrect version */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->version[0] = 0xbadc0ded; + dm_arg->version[1] = 0xbadc0dee; + dm_arg->version[2] = 0xbadc0def; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u, " + "/* Unsupported device mapper ABI version */ ...}) = " + "-1 EBADF (%m)\n", 0xbadc0ded, 0xbadc0dee, 0xbadc0def); + + /* Incorrect data_size */ + init_s(dm_arg, 14, 64); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14, " + "/* Incorrect data_size */ ...}) = -1 EBADF (%m)\n"); + + /* Unterminated name/uuid */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + strncpy(dm_arg->name, str129, sizeof(dm_arg->name)); + strncpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"%.127s\", uuid=\"%.128s\", " + "flags=0}) = -1 EBADF (%m)\n", + min_sizeof_dm_ioctl, str129, str129); + + /* Normal call */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "-1 EBADF (%m)\n", min_sizeof_dm_ioctl); + + /* Zero dev, name, uuid */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->data_size = 0xfacefeed; + dm_arg->dev = 0; + dm_arg->name[0] = '\0'; + dm_arg->uuid[0] = '\0'; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%u, flags=0}) = " + "-1 EBADF (%m)\n", 0xfacefeed); + + /* Flag */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->flags = 0xffffffff; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=" + "DM_READONLY_FLAG|DM_SUSPEND_FLAG|DM_EXISTS_FLAG|" + "DM_PERSISTENT_DEV_FLAG|DM_STATUS_TABLE_FLAG|" + "DM_ACTIVE_PRESENT_FLAG|DM_INACTIVE_PRESENT_FLAG|" + "DM_BUFFER_FULL_FLAG|DM_SKIP_BDGET_FLAG|DM_SKIP_LOCKFS_FLAG|" + "DM_NOFLUSH_FLAG|DM_QUERY_INACTIVE_TABLE_FLAG|" + "DM_UEVENT_GENERATED_FLAG|DM_UUID_FLAG|DM_SECURE_DATA_FLAG|" + "DM_DATA_OUT_FLAG|DM_DEFERRED_REMOVE|DM_INTERNAL_SUSPEND_FLAG|" + "0xfff80080}) = -1 EBADF (%m)\n", + min_sizeof_dm_ioctl); + + /* Normal call */ + init_s(&s.ioc, sizeof(s.ioc), 0); + ioctl(-1, DM_VERSION, &s); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "-1 EBADF (%m)\n", sizeof(s.ioc)); + + + /* DM_REMOVE_ALL */ + /* DM_LIST_DEVICES */ + /* DM_LIST_VERSIONS */ + for (i = 0; i < ARRAY_SIZE(dummy_check_cmds_nodev); i++) { + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, dummy_check_cmds_nodev[i].arg, dm_arg); + printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " + "flags=0}) = -1 EBADF (%m)\n", + dummy_check_cmds_nodev[i].str, + min_sizeof_dm_ioctl, + dummy_check_cmds_nodev[i].has_params ? + ", data_start=0" : ""); + } + + + /* DM_DEV_CREATE */ + /* DM_DEV_REMOVE */ + /* DM_DEV_STATUS */ + /* DM_DEV_WAIT */ + /* DM_TABLE_CLEAR */ + /* DM_TABLE_DEPS */ + /* DM_TABLE_STATUS */ + for (i = 0; i < ARRAY_SIZE(dummy_check_cmds); i++) { + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, dummy_check_cmds[i].arg, dm_arg); + printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\"%s, " + "flags=0}) = -1 EBADF (%m)\n", + dummy_check_cmds[i].str, min_sizeof_dm_ioctl, + dummy_check_cmds[i].has_params ? ", data_start=0" : "", + dummy_check_cmds[i].has_event_nr ? ", event_nr=0" : ""); + } + + + /* DM_DEV_SUSPEND */ + init_s(&s.ioc, sizeof(s.ioc), 0); + s.ioc.flags = DM_SUSPEND_FLAG; + s.ioc.event_nr = 0xbadc0ded; + ioctl(-1, DM_DEV_SUSPEND, &s); + printf("ioctl(-1, DM_DEV_SUSPEND, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "flags=DM_SUSPEND_FLAG}) = -1 EBADF (%m)\n", sizeof(s.ioc)); + + init_s(&s.ioc, sizeof(s.ioc), 0); + s.ioc.event_nr = 0xbadc0ded; + ioctl(-1, DM_DEV_SUSPEND, &s); + printf("ioctl(-1, DM_DEV_SUSPEND, " + "{version=4.1.2, data_size=%zu, dev=makedev(18, 52), " + "name=\"nnn\", uuid=\"uuu\", event_nr=3134983661, " + "flags=0}) = -1 EBADF (%m)\n", sizeof(s.ioc)); + + + /* DM_TABLE_LOAD */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.target_count = 1; + s.u.ts.target_spec.sector_start = 0x10; + s.u.ts.target_spec.length = 0x20; + s.u.ts.target_spec.next = + sizeof(s.u.ts.target_spec) + sizeof(s.u.ts.target_params); + strcpy(s.u.ts.target_spec.target_type, "tgt"); + strcpy(s.u.ts.target_params, "tparams"); + ioctl(-1, DM_TABLE_LOAD, &s); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=1, flags=0, " +# if VERBOSE + "{sector_start=16, length=32, target_type=\"tgt\", " + "string=\"tparams\"}" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", s.ioc.data_size, s.ioc.data_start); + + /* No targets */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + dm_arg->target_count = 0; + ioctl(-1, DM_TABLE_LOAD, dm_arg); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=0, flags=0}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), min_sizeof_dm_ioctl); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0xfffffff8); + dm_arg->data_size = sizeof(*dm_arg); + dm_arg->target_count = 1234; + ioctl(-1, DM_TABLE_LOAD, dm_arg); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=1234, flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_spec */ ..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", sizeof(*dm_arg), 0xfffffff8); + + /* Inaccessible pointer */ + init_s(&dm_arg_open1->ioc, offsetof(struct dm_table_open_test, target1), + offsetof(struct dm_table_open_test, target1)); + dm_arg_open1->ioc.data_size = sizeof(*dm_arg_open1); + dm_arg_open1->ioc.target_count = 0xdeaddea1; + ioctl(-1, DM_TABLE_LOAD, dm_arg_open1); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=3735936673, flags=0, " +# if VERBOSE + "%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", sizeof(*dm_arg_open1), + offsetof(struct dm_table_open_test, target1) +# if VERBOSE + , (char *) dm_arg_open1 + + offsetof(struct dm_table_open_test, target1) +# endif /* VERBOSE */ + ); + + /* Inaccessible string */ + init_s(&dm_arg_open2->ioc, offsetof(struct dm_table_open_test, param1), + offsetof(struct dm_table_open_test, target1)); + dm_arg_open2->ioc.data_size = sizeof(*dm_arg_open2); + dm_arg_open2->ioc.target_count = 2; + init_dm_target_spec(&dm_arg_open2->target1, 7); + dm_arg_open2->target1.next = + offsetof(struct dm_table_open_test, target3) - + offsetof(struct dm_table_open_test, target1); + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open2); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=2, flags=0, ", + sizeof(*dm_arg_open2), + offsetof(struct dm_table_open_test, target1)); +# if VERBOSE + print_dm_target_spec(&dm_arg_open2->target1, 7); + printf("%p}, %p", + (char *) dm_arg_open2 + + offsetof(struct dm_table_open_test, param1), + (char *) dm_arg_open2 + + offsetof(struct dm_table_open_test, target3)); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + /* Incorrect next */ + init_s(&dm_arg_open3->ioc, offsetof(struct dm_table_open_test, target5), + offsetof(struct dm_table_open_test, target0)); + dm_arg_open3->ioc.target_count = 4; + + init_dm_target_spec(&dm_arg_open3->target0, 9); + dm_arg_open3->target0.next = + offsetof(struct dm_table_open_test, target1) - + offsetof(struct dm_table_open_test, target0); + dm_arg_open3->param0[0] = '\0'; + + init_dm_target_spec(&dm_arg_open3->target1, 15); + dm_arg_open3->target1.next = + offsetof(struct dm_table_open_test, target3) - + offsetof(struct dm_table_open_test, target1); + dm_arg_open3->param1[0] = '\377'; + dm_arg_open3->param1[1] = '\0'; + + init_dm_target_spec(&dm_arg_open3->target3, 42); + dm_arg_open3->target3.next = 0xdeadbeef; + dm_arg_open3->param3[0] = '\1'; + dm_arg_open3->param3[1] = '\2'; + dm_arg_open3->param3[2] = '\0'; + + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open3); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=4, flags=0, ", + offsetof(struct dm_table_open_test, target5), + offsetof(struct dm_table_open_test, target0)); +# if VERBOSE + print_dm_target_spec(&dm_arg_open3->target0, 9); + printf("\"\"}, "); + print_dm_target_spec(&dm_arg_open3->target1, 15); + printf("\"\\377\"}, "); + print_dm_target_spec(&dm_arg_open3->target1, 42); + printf("\"\\1\\2\"}, /* misplaced struct dm_target_spec */ ..."); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + #define FILL_DM_TARGET(id, id_next) \ + do { \ + init_dm_target_spec(&dm_arg_open3->target##id, id); \ + dm_arg_open3->target##id.next = \ + offsetof(struct dm_table_open_test, \ + target##id_next) - \ + offsetof(struct dm_table_open_test, \ + target##id); \ + strncpy(dm_arg_open3->param##id, str129 + id * 2, id); \ + dm_arg_open3->param##id[id] = '\0'; \ + } while (0) + #define PRINT_DM_TARGET(id) \ + do { \ + print_dm_target_spec(&dm_arg_open3->target##id, id); \ + printf("\"%.*s\"}, ", id, str129 + id * 2); \ + } while (0) + + /* max_strlen limit */ + init_s(&dm_arg_open3->ioc, offsetof(struct dm_table_open_test, target9), + offsetof(struct dm_table_open_test, target0)); + dm_arg_open3->ioc.data_size = sizeof(*dm_arg_open3); + dm_arg_open3->ioc.target_count = 0xbadc0ded; + FILL_DM_TARGET(0, 1); + FILL_DM_TARGET(1, 2); + FILL_DM_TARGET(2, 3); + FILL_DM_TARGET(3, 4); + FILL_DM_TARGET(4, 5); + FILL_DM_TARGET(5, 6); + FILL_DM_TARGET(6, 7); + FILL_DM_TARGET(7, 8); + FILL_DM_TARGET(8, 9); + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open3); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=3134983661, flags=0, ", + sizeof(*dm_arg_open3), + offsetof(struct dm_table_open_test, target0)); +# if VERBOSE + PRINT_DM_TARGET(0); + PRINT_DM_TARGET(1); + PRINT_DM_TARGET(2); + PRINT_DM_TARGET(3); + PRINT_DM_TARGET(4); + PRINT_DM_TARGET(5); + PRINT_DM_TARGET(6); + PRINT_DM_TARGET(7); + PRINT_DM_TARGET(8); +# endif /* VERBOSE */ + printf("...}) = %s\n", errstr); + + + /* DM_TARGET_MSG */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.u.tm.target_msg.sector = 0x1234; + strcpy(s.u.string + offsetof(struct dm_target_msg, message), + "long target msg"); + ioctl(-1, DM_TARGET_MSG, &s); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "{sector=4660, message=\"long targ\"...}" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_msg */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), min_sizeof_dm_ioctl); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0xffffffff); + dm_arg->data_size = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_msg */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), 0xffffffff); + + /* Inaccessible pointer */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->data_size = sizeof(*dm_arg) + sizeof(struct dm_target_msg); + dm_arg->data_start = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg) + sizeof(struct dm_target_msg), + sizeof(*dm_arg) +# if VERBOSE + , (char *) dm_arg + sizeof(*dm_arg) +# endif /* VERBOSE */ + ); + + /* Inaccessible string */ + init_s(&dm_arg_msg->ioc, sizeof(*dm_arg_msg), + offsetof(struct dm_target_msg_test, msg)); + dm_arg_msg->ioc.data_size = sizeof(*dm_arg_msg) + 1; + dm_arg_msg->msg.sector = (__u64) 0xdeadbeeffacef157ULL; + rc = ioctl(-1, DM_TARGET_MSG, dm_arg_msg); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + sizeof(*dm_arg_msg) + 1, + offsetof(struct dm_target_msg_test, msg)); +# if VERBOSE + printf("{sector=%" PRI__u64 ", message=%p}", + (__u64) 0xdeadbeeffacef157ULL, + (char *) dm_arg_msg + + offsetof(struct dm_target_msg_test, msg.message)); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + /* Zero-sied string */ + init_s(&dm_arg_msg->ioc, sizeof(*dm_arg_msg), + offsetof(struct dm_target_msg_test, msg)); + dm_arg_msg->msg.sector = (__u64) 0xdeadbeeffacef157ULL; + rc = ioctl(-1, DM_TARGET_MSG, dm_arg_msg); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + sizeof(*dm_arg_msg), offsetof(struct dm_target_msg_test, msg)); +# if VERBOSE + printf("{sector=%" PRI__u64 ", message=\"\"}", + (__u64) 0xdeadbeeffacef157ULL); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + + /* DM_DEV_SET_GEOMETRY */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + strcpy(s.u.string, "10 20 30 40"); + ioctl(-1, DM_DEV_SET_GEOMETRY, &s); + printf("ioctl(-1, DM_DEV_SET_GEOMETRY, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "string=\"10 20 30 \"..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + + /* DM_DEV_RENAME */ + /* Inaccessible data */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + memcpy(unaligned_dm_arg, dm_arg, offsetof(struct dm_ioctl, data)); + ioctl(-1, DM_DEV_RENAME, unaligned_dm_arg); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*unaligned_dm_arg), min_sizeof_dm_ioctl +# if VERBOSE + , (char *) unaligned_dm_arg + min_sizeof_dm_ioctl +# endif /* VERBOSE */ + ); + + /* Incorrect data_start data */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.data_start = 0xdeadbeef; + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=3735928559, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "/* misplaced string */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size); + + /* Strange but still valid data_start */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + /* Curiously, this is a valid structure */ + s.ioc.data_start = offsetof(struct dm_ioctl, name) + 1; + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=\"nn\"" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, + offsetof(struct dm_ioctl, name) + 1); + + /* Correct data */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + strcpy(s.u.string, "new long name"); + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=\"new long \"..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + + /* DM_TABLE_LOAD */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.target_count = -1U; + ioctl(-1, DM_TABLE_LOAD, &s); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=4294967295, flags=0, " +# if VERBOSE + "{sector_start=0, length=0, target_type=\"\", string=\"\"}, " + "/* misplaced struct dm_target_spec */ " +# endif /* VERBOSE */ + "...}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else /* !HAVE_LINUX_DM_IOCTL_H */ + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_DM_IOCTL_H") + +#endif /* HAVE_LINUX_DM_IOCTL_H */ diff --git a/tests-mx32/ioctl_dm.test b/tests-mx32/ioctl_dm.test new file mode 100755 index 00000000..64852051 --- /dev/null +++ b/tests-mx32/ioctl_dm.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of DM* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -s9 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_evdev-v.c b/tests-mx32/ioctl_evdev-v.c new file mode 100644 index 00000000..3860716b --- /dev/null +++ b/tests-mx32/ioctl_evdev-v.c @@ -0,0 +1,3 @@ +/* This file is part of ioctl_evdev-v strace test. */ +#define VERBOSE 1 +#include "ioctl_evdev.c" diff --git a/tests-mx32/ioctl_evdev-v.test b/tests-mx32/ioctl_evdev-v.test new file mode 100755 index 00000000..87941010 --- /dev/null +++ b/tests-mx32/ioctl_evdev-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check verbose decoding EVIOC* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_evdev.c b/tests-mx32/ioctl_evdev.c new file mode 100644 index 00000000..d12323ee --- /dev/null +++ b/tests-mx32/ioctl_evdev.c @@ -0,0 +1,278 @@ +/* + * This file is part of ioctl_evdev strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_INPUT_H + +# include +# include +# include +# include +# include +# include + +static const unsigned int magic = 0xdeadbeef; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +# if VERBOSE +static void +print_envelope(const struct ff_envelope *const e) +{ + printf(", envelope={attack_length=%hu, attack_level=%hu" + ", fade_length=%hu, fade_level=%#hx}", + e->attack_length, e->attack_level, + e->fade_length, e->fade_level); +} +# endif /* VERBOSE */ + +static void +print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) +{ + printf("ioctl(-1, EVIOCSFF, {type=%s, id=%" PRIu16 + ", direction=%" PRIu16 ", ", + type_str, ffe->id, ffe->direction); +# if VERBOSE + printf("trigger={button=%hu, interval=%hu}" + ", replay={length=%hu, delay=%hu}", + ffe->trigger.button, ffe->trigger.interval, + ffe->replay.length, ffe->replay.delay); +# endif /* VERBOSE */ +} + +# define TEST_NULL_ARG(cmd) \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) + +int +main(void) +{ + TEST_NULL_ARG(EVIOCGVERSION); + TEST_NULL_ARG(EVIOCGEFFECTS); + TEST_NULL_ARG(EVIOCGID); + TEST_NULL_ARG(EVIOCGKEYCODE); + TEST_NULL_ARG(EVIOCSKEYCODE); + TEST_NULL_ARG(EVIOCSFF); +# ifdef EVIOCGKEYCODE_V2 + TEST_NULL_ARG(EVIOCGKEYCODE_V2); +# endif +# ifdef EVIOCSKEYCODE_V2 + TEST_NULL_ARG(EVIOCSKEYCODE_V2); +# endif +# ifdef EVIOCGREP + TEST_NULL_ARG(EVIOCGREP); +# endif +# ifdef EVIOCSREP + TEST_NULL_ARG(EVIOCSREP); +# endif +# ifdef EVIOCSCLOCKID + TEST_NULL_ARG(EVIOCSCLOCKID); +# endif + + TEST_NULL_ARG(EVIOCGNAME(0)); + TEST_NULL_ARG(EVIOCGPHYS(0)); + TEST_NULL_ARG(EVIOCGUNIQ(0)); + TEST_NULL_ARG(EVIOCGKEY(0)); + TEST_NULL_ARG(EVIOCGLED(0)); +# ifdef EVIOCGMTSLOTS + TEST_NULL_ARG(EVIOCGMTSLOTS(0)); +# endif +# ifdef EVIOCGPROP + TEST_NULL_ARG(EVIOCGPROP(0)); +# endif + TEST_NULL_ARG(EVIOCGSND(0)); +# ifdef EVIOCGSW + TEST_NULL_ARG(EVIOCGSW(0)); +# endif + + TEST_NULL_ARG(EVIOCGABS(ABS_X)); + TEST_NULL_ARG(EVIOCSABS(ABS_X)); + + TEST_NULL_ARG(EVIOCGBIT(EV_SYN, 0)); + TEST_NULL_ARG(EVIOCGBIT(EV_KEY, 1)); + TEST_NULL_ARG(EVIOCGBIT(EV_REL, 2)); + TEST_NULL_ARG(EVIOCGBIT(EV_ABS, 3)); + TEST_NULL_ARG(EVIOCGBIT(EV_MSC, 4)); +# ifdef EV_SW + TEST_NULL_ARG(EVIOCGBIT(EV_SW, 5)); +# endif + TEST_NULL_ARG(EVIOCGBIT(EV_LED, 6)); + TEST_NULL_ARG(EVIOCGBIT(EV_SND, 7)); + TEST_NULL_ARG(EVIOCGBIT(EV_REP, 8)); + TEST_NULL_ARG(EVIOCGBIT(EV_FF, 9)); + TEST_NULL_ARG(EVIOCGBIT(EV_PWR, 10)); + TEST_NULL_ARG(EVIOCGBIT(EV_FF_STATUS, 11)); + + ioctl(-1, EVIOCGBIT(EV_MAX, 42), 0); + printf("ioctl(-1, EVIOCGBIT(%#x /* EV_??? */, 42), NULL)" + " = -1 EBADF (%m)\n", EV_MAX); + + ioctl(-1, EVIOCRMFF, lmagic); + printf("ioctl(-1, EVIOCRMFF, %d) = -1 EBADF (%m)\n", (int) lmagic); + + ioctl(-1, EVIOCGRAB, lmagic); + printf("ioctl(-1, EVIOCGRAB, %lu) = -1 EBADF (%m)\n", lmagic); + +# ifdef EVIOCREVOKE + ioctl(-1, EVIOCREVOKE, lmagic); + printf("ioctl(-1, EVIOCREVOKE, %lu) = -1 EBADF (%m)\n", lmagic); +# endif + + const unsigned int size = get_page_size(); + void *const page = tail_alloc(size); + fill_memory(page, size); + + int *const val_int = tail_alloc(sizeof(*val_int)); + *val_int = magic; + +# ifdef EVIOCSCLOCKID + ioctl(-1, EVIOCSCLOCKID, val_int); + printf("ioctl(-1, EVIOCSCLOCKID, [%u]) = -1 EBADF (%m)\n", *val_int); +# endif + + int *pair_int = tail_alloc(sizeof(*pair_int) * 2); + pair_int[0] = 0xdeadbeef; + pair_int[1] = 0xbadc0ded; + +# ifdef EVIOSGREP + ioctl(-1, EVIOCSREP, pair_int); + printf("ioctl(-1, EVIOCSREP, [%u, %u]) = -1 EBADF (%m)\n", + pair_int[0], pair_int[1]); +# endif + + pair_int[1] = 1; + ioctl(-1, EVIOCSKEYCODE, pair_int); + printf("ioctl(-1, EVIOCSKEYCODE, [%u, %s]) = -1 EBADF (%m)\n", + pair_int[0], "KEY_ESC"); + +# ifdef EVIOCSKEYCODE_V2 + struct input_keymap_entry *const ike = tail_alloc(sizeof(*ike)); + fill_memory(ike, sizeof(*ike)); + ike->keycode = 2; + + ioctl(-1, EVIOCSKEYCODE_V2, ike); + printf("ioctl(-1, EVIOCSKEYCODE_V2, {flags=%" PRIu8 + ", len=%" PRIu8 ", ", ike->flags, ike->len); +# if VERBOSE + printf("index=%" PRIu16 ", keycode=%s, scancode=[", + ike->index, "KEY_1"); + unsigned int i; + for (i = 0; i < ARRAY_SIZE(ike->scancode); ++i) { + if (i > 0) + printf(", "); + printf("%" PRIx8, ike->scancode[i]); + } + printf("]"); +# else + printf("..."); +# endif + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); +# endif + + struct ff_effect *const ffe = tail_alloc(sizeof(*ffe)); + fill_memory(ffe, sizeof(*ffe)); + + ffe->type = FF_CONSTANT; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_CONSTANT"); + +# if VERBOSE + printf(", constant={level=%hd", ffe->u.constant.level); + print_envelope(&ffe->u.constant.envelope); + printf("}"); +# else + printf("..."); +# endif + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + +# if VERBOSE + ffe->type = FF_RAMP; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_RAMP"); + printf(", ramp={start_level=%hd, end_level=%hd", + ffe->u.ramp.start_level, ffe->u.ramp.end_level); + print_envelope(&ffe->u.ramp.envelope); + errno = EBADF; + printf("}}) = -1 EBADF (%m)\n"); + + ffe->type = FF_PERIODIC; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_PERIODIC"); + printf(", periodic={waveform=%hu, period=%hu, magnitude=%hd" + ", offset=%hd, phase=%hu", + ffe->u.periodic.waveform, ffe->u.periodic.period, + ffe->u.periodic.magnitude, ffe->u.periodic.offset, + ffe->u.periodic.phase); + print_envelope(&ffe->u.periodic.envelope); + printf(", custom_len=%u, custom_data=%p}", + ffe->u.periodic.custom_len, ffe->u.periodic.custom_data); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + ffe->type = FF_RUMBLE; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_RUMBLE"); + printf(", rumble={strong_magnitude=%hu, weak_magnitude=%hu}", + ffe->u.rumble.strong_magnitude, ffe->u.rumble.weak_magnitude); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + ffe->type = 0xff; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "0xff /* FF_??? */"); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); +# endif + + ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ, 0x45, 0x1, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_WRITE, 0x45, 0x1, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_WRITE, 0x45, 0x1, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x45, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x45, 0xfe, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x45, 0, 0), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x45, 0, 0)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_INPUT_H") + +#endif diff --git a/tests-mx32/ioctl_evdev.test b/tests-mx32/ioctl_evdev.test new file mode 100755 index 00000000..7ed2e98a --- /dev/null +++ b/tests-mx32/ioctl_evdev.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of EVIOC* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_loop-nv.c b/tests-mx32/ioctl_loop-nv.c new file mode 100644 index 00000000..dc6b916d --- /dev/null +++ b/tests-mx32/ioctl_loop-nv.c @@ -0,0 +1,2 @@ +#define ABBREV 1 +#include "ioctl_loop.c" diff --git a/tests-mx32/ioctl_loop-nv.test b/tests-mx32/ioctl_loop-nv.test new file mode 100755 index 00000000..dcc27e1d --- /dev/null +++ b/tests-mx32/ioctl_loop-nv.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check non-verbose decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -eioctl -e verbose=none $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_loop-v.c b/tests-mx32/ioctl_loop-v.c new file mode 100644 index 00000000..22e75727 --- /dev/null +++ b/tests-mx32/ioctl_loop-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_loop.c" diff --git a/tests-mx32/ioctl_loop-v.test b/tests-mx32/ioctl_loop-v.test new file mode 100755 index 00000000..ff3995d8 --- /dev/null +++ b/tests-mx32/ioctl_loop-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check non-abbreviated decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -v -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_loop.c b/tests-mx32/ioctl_loop.c new file mode 100644 index 00000000..a95e775d --- /dev/null +++ b/tests-mx32/ioctl_loop.c @@ -0,0 +1,322 @@ +/* + * This file is part of ioctl_loop strace test. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "xlat/loop_cmds.h" + +#ifndef ABBREV +# define ABBREV 0 +#endif + +static void +print_loop_info(struct loop_info * const info, bool print_encrypt, + const char *encrypt_type, const char *encrypt_key, + const char *flags) +{ +#if ABBREV + printf("%p", info); +#else + printf("{lo_number=%d", info->lo_number); +# if VERBOSE + printf(", lo_device=makedev(%u, %u), lo_inode=%lu, " + "lo_rdevice=makedev(%u, %u)", + major(info->lo_device), minor(info->lo_device), + info->lo_inode, + major(info->lo_rdevice), minor(info->lo_rdevice)); +# endif /* VERBOSE */ + + printf(", lo_offset=%#x", info->lo_offset); + + if (VERBOSE || print_encrypt) { + printf(", lo_encrypt_type="); + if (encrypt_type) + printf("%s", encrypt_type); + else + printf("%#x /* LO_CRYPT_??? */", info->lo_encrypt_type); + + printf(", lo_encrypt_key_size=%" PRIu32, + (uint32_t) info->lo_encrypt_key_size); + } + + printf(", lo_flags="); + if (flags) + printf("%s", flags); + else + printf("%#x /* LO_FLAGS_??? */", info->lo_flags); + + printf(", lo_name=\"%.*s\"", + (int) sizeof(info->lo_name) - 1, info->lo_name); + + if (VERBOSE || print_encrypt) + printf(", lo_encrypt_key=\"%.*s\"", + encrypt_key ? (int) strlen(encrypt_key) : + (int) sizeof(info->lo_encrypt_key), + encrypt_key ? encrypt_key : + (char *) info->lo_encrypt_key); + +# if VERBOSE + printf(", lo_init=[%#lx, %#lx]" + ", reserved=[%#hhx, %#hhx, %#hhx, %#hhx]}", + info->lo_init[0], info->lo_init[1], + info->reserved[0], info->reserved[1], + info->reserved[2], info->reserved[3]); +# else /* !VERBOSE */ + printf(", ...}"); +# endif /* VERBOSE */ +#endif /* !ABBREV */ +} + +static void +print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, + const char *encrypt_type, const char *encrypt_key, + const char *flags) +{ +#if ABBREV + printf("%p", info64); +#else +# if VERBOSE + printf("{lo_device=makedev(%u, %u), lo_inode=%" PRIu64 + ", lo_rdevice=makedev(%u, %u), lo_offset=%#" PRIx64 + ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32, + major(info64->lo_device), minor(info64->lo_device), + (uint64_t) info64->lo_inode, + major(info64->lo_rdevice), minor(info64->lo_rdevice), + (uint64_t) info64->lo_offset, + (uint64_t) info64->lo_sizelimit, + (uint32_t) info64->lo_number); +# else /* !VERBOSE */ + printf("{lo_offset=%#" PRIx64 ", lo_number=%" PRIu32, + (uint64_t) info64->lo_offset, + (uint32_t) info64->lo_number); +# endif /* VERBOSE */ + + if (VERBOSE || print_encrypt) { + printf(", lo_encrypt_type="); + if (encrypt_type) + printf("%s", encrypt_type); + else + printf("%#x /* LO_CRYPT_??? */", + info64->lo_encrypt_type); + + printf(", lo_encrypt_key_size=%" PRIu32, + info64->lo_encrypt_key_size); + } + + printf(", lo_flags="); + if (flags) + printf("%s", flags); + else + printf("%#x /* LO_FLAGS_??? */", info64->lo_flags); + printf(", lo_file_name=\"%.*s\"", + (int) sizeof(info64->lo_file_name) - 1, info64->lo_file_name); + + if (VERBOSE || print_encrypt) + printf(", lo_crypt_name=\"%.*s\", lo_encrypt_key=\"%.*s\"", + (int) sizeof(info64->lo_crypt_name) - 1, + info64->lo_crypt_name, + encrypt_key ? (int) strlen(encrypt_key) : + (int) sizeof(info64->lo_encrypt_key), + encrypt_key ? encrypt_key : + (char *) info64->lo_encrypt_key); + +# if VERBOSE + printf(", lo_init=[%#" PRIx64 ", %#" PRIx64 "]}", + (uint64_t) info64->lo_init[0], + (uint64_t) info64->lo_init[1]); +# else /* !VERBOSE */ + printf(", ...}"); +# endif /* VERBOSE */ +#endif /* !ABBREV */ +} + +int +main(void) +{ + static const kernel_ulong_t unknown_loop_cmd = + (kernel_ulong_t) 0xbadc0dedfeed4cedULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const kernel_ulong_t kernel_mask = + ((kernel_ulong_t) -1) - ((unsigned long) -1L); + + struct loop_info * const info = tail_alloc(sizeof(*info)); + struct loop_info64 * const info64 = tail_alloc(sizeof(*info64)); + + /* Unknown loop commands */ + ioctl(-1, unknown_loop_cmd, magic); + printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x4c, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_loop_cmd) & _IOC_NONE ? + "|_IOC_NONE" : "", + _IOC_NR((unsigned int) unknown_loop_cmd), + _IOC_SIZE((unsigned int) unknown_loop_cmd), + (unsigned long) magic); + + ioctl(-1, LOOP_SET_DIRECT_IO + 1, magic); + printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + "-1 EBADF (%m)\n", + _IOC_NR(LOOP_SET_DIRECT_IO + 1), + _IOC_SIZE(LOOP_SET_DIRECT_IO + 1), + (unsigned long) magic); + + ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); + printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + "-1 EBADF (%m)\n", + _IOC_NR(LOOP_CTL_GET_FREE + 1), + _IOC_SIZE(LOOP_CTL_GET_FREE + 1), + (unsigned long) magic); + + /* LOOP_SET_FD */ + ioctl(-1, LOOP_SET_FD, magic); + printf("ioctl(-1, LOOP_SET_FD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CLR_FD */ + ioctl(-1, LOOP_CLR_FD); + printf("ioctl(-1, LOOP_CLR_FD) = -1 EBADF (%m)\n"); + + /* LOOP_SET_STATUS */ + ioctl(-1, LOOP_SET_STATUS, NULL); + printf("ioctl(-1, LOOP_SET_STATUS, NULL) = -1 EBADF (%m)\n"); + + fill_memory(info, sizeof(*info)); + info->lo_flags = 0xdeface00; + info->lo_name[0] = '\0'; + info->lo_encrypt_key[0] = '\0'; + info->lo_encrypt_key_size = 1; + + printf("ioctl(-1, LOOP_SET_STATUS, "); + print_loop_info(info, true, NULL, "\\0", NULL); + ioctl(-1, LOOP_SET_STATUS, info); + printf(") = -1 EBADF (%m)\n"); + + fill_memory(info, sizeof(*info)); + info->lo_encrypt_type = LO_CRYPT_NONE; + info->lo_flags = LO_FLAGS_READ_ONLY; + memset(info->lo_name, 'A', sizeof(info->lo_name)); + memset(info->lo_encrypt_key, 'B', sizeof(info->lo_encrypt_key)); + + ioctl(-1, LOOP_SET_STATUS, (void *) info + ALIGNOF(info)); + printf("ioctl(-1, LOOP_SET_STATUS, %p) = -1 EBADF (%m)\n", + (void *) info + ALIGNOF(info)); + + printf("ioctl(-1, LOOP_SET_STATUS, "); + print_loop_info(info, false, "LO_CRYPT_NONE", NULL, + "LO_FLAGS_READ_ONLY"); + ioctl(-1, LOOP_SET_STATUS, info); + printf(") = -1 EBADF (%m)\n"); + + /* LOOP_GET_STATUS */ + ioctl(-1, LOOP_GET_STATUS, NULL); + printf("ioctl(-1, LOOP_GET_STATUS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, LOOP_GET_STATUS, (unsigned long) info | kernel_mask); + printf("ioctl(-1, LOOP_GET_STATUS, %p) = -1 EBADF (%m)\n", info); + + /* LOOP_SET_STATUS64 */ + ioctl(-1, LOOP_SET_STATUS64, NULL); + printf("ioctl(-1, LOOP_SET_STATUS64, NULL) = -1 EBADF (%m)\n"); + + fill_memory(info64, sizeof(*info64)); + info64->lo_flags = 0xdec0de00; + info64->lo_file_name[0] = '\0'; + info64->lo_crypt_name[0] = '\0'; + info64->lo_encrypt_key[0] = '\0'; + info64->lo_encrypt_key_size = 1; + + printf("ioctl(-1, LOOP_SET_STATUS64, "); + print_loop_info64(info64, true, NULL, "\\0", NULL); + ioctl(-1, LOOP_SET_STATUS64, info64); + printf(") = -1 EBADF (%m)\n"); + + fill_memory(info64, sizeof(*info64)); + info64->lo_flags = LO_FLAGS_READ_ONLY; + info64->lo_encrypt_type = LO_CRYPT_NONE; + memset(info64->lo_file_name, 'C', sizeof(info64->lo_file_name)); + memset(info64->lo_crypt_name, 'D', sizeof(info64->lo_crypt_name)); + memset(info64->lo_encrypt_key, 'E', sizeof(info64->lo_encrypt_key)); + + ioctl(-1, LOOP_SET_STATUS64, (void *) info64 + ALIGNOF(info64)); + printf("ioctl(-1, LOOP_SET_STATUS64, %p) = -1 EBADF (%m)\n", + (void *) info64 + ALIGNOF(info64)); + + printf("ioctl(-1, LOOP_SET_STATUS64, "); + print_loop_info64(info64, false, "LO_CRYPT_NONE", NULL, + "LO_FLAGS_READ_ONLY"); + ioctl(-1, LOOP_SET_STATUS64, info64); + printf(") = -1 EBADF (%m)\n"); + + /* LOOP_GET_STATUS64 */ + ioctl(-1, LOOP_GET_STATUS64, NULL); + printf("ioctl(-1, LOOP_GET_STATUS64, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, LOOP_GET_STATUS64, (unsigned long) info64 | kernel_mask); + printf("ioctl(-1, LOOP_GET_STATUS64, %p) = -1 EBADF (%m)\n", info64); + + /* LOOP_CHANGE_FD */ + ioctl(-1, LOOP_CHANGE_FD, magic); + printf("ioctl(-1, LOOP_CHANGE_FD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_SET_CAPACITY */ + ioctl(-1, LOOP_SET_CAPACITY); + printf("ioctl(-1, LOOP_SET_CAPACITY) = -1 EBADF (%m)\n"); + + /* LOOP_SET_DIRECT_IO */ + ioctl(-1, LOOP_SET_DIRECT_IO, magic); + printf("ioctl(-1, LOOP_SET_DIRECT_IO, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + + /* LOOP_CTL_ADD */ + ioctl(-1, LOOP_CTL_ADD, magic); + printf("ioctl(-1, LOOP_CTL_ADD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CTL_REMOVE */ + ioctl(-1, LOOP_CTL_REMOVE, magic); + printf("ioctl(-1, LOOP_CTL_REMOVE, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CTL_GET_FREE */ + ioctl(-1, LOOP_CTL_GET_FREE); + printf("ioctl(-1, LOOP_CTL_GET_FREE) = -1 EBADF (%m)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_loop.test b/tests-mx32/ioctl_loop.test new file mode 100755 index 00000000..112cd636 --- /dev/null +++ b/tests-mx32/ioctl_loop.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_mtd.c b/tests-mx32/ioctl_mtd.c new file mode 100644 index 00000000..a37d5d0f --- /dev/null +++ b/tests-mx32/ioctl_mtd.c @@ -0,0 +1,197 @@ +/* + * This file is part of ioctl_mtd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) +# include "mtd-abi.h" +#else +# include +#endif + +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +#define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + if (_IOC_DIR(cmd) == _IOC_WRITE) \ + printf("ioctl(-1, MIXER_WRITE(%u) or %s, NULL)" \ + " = -1 EBADF (%m)\n", \ + (unsigned int) _IOC_NR(cmd), #cmd); \ + else if (_IOC_DIR(cmd) == _IOC_READ) \ + printf("ioctl(-1, MIXER_READ(%u) or %s, NULL)" \ + " = -1 EBADF (%m)\n", \ + (unsigned int) _IOC_NR(cmd), #cmd); \ + else \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +#define TEST_erase_info_user(cmd, eiu) \ + ioctl(-1, cmd, eiu); \ + printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ + " = -1 EBADF (%m)\n", \ + (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ + (unsigned int) _IOC_NR(cmd), #cmd, \ + eiu->start, eiu->length) + +int +main(void) +{ + TEST_NULL_ARG(ECCGETLAYOUT); + TEST_NULL_ARG(ECCGETSTATS); + TEST_NULL_ARG(MEMERASE); + TEST_NULL_ARG(MEMERASE64); + TEST_NULL_ARG(MEMGETBADBLOCK); + TEST_NULL_ARG(MEMGETINFO); + TEST_NULL_ARG(MEMGETOOBSEL); + TEST_NULL_ARG(MEMGETREGIONCOUNT); + TEST_NULL_ARG(MEMISLOCKED); + TEST_NULL_ARG(MEMLOCK); + TEST_NULL_ARG(MEMREADOOB); + TEST_NULL_ARG(MEMREADOOB64); + TEST_NULL_ARG(MEMSETBADBLOCK); + TEST_NULL_ARG(MEMUNLOCK); + TEST_NULL_ARG(MEMWRITE); + TEST_NULL_ARG(MEMWRITEOOB); + TEST_NULL_ARG(MEMWRITEOOB64); + TEST_NULL_ARG(OTPGETREGIONCOUNT); + TEST_NULL_ARG(OTPGETREGIONINFO); + TEST_NULL_ARG(OTPLOCK); + TEST_NULL_ARG(OTPSELECT); + + ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL); + printf("ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL) = -1 EBADF (%m)\n"); + + int *const opt = tail_alloc(sizeof(*opt)); + *opt = MTD_OTP_OFF; + ioctl(-1, OTPSELECT, opt); + printf("ioctl(-1, MIXER_READ(%u) or OTPSELECT, [MTD_OTP_OFF])" + " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPSELECT)); + + uint64_t *const v64 = tail_alloc(sizeof(*v64)); + fill_memory(v64, sizeof(*v64)); + + ioctl(-1, MEMGETBADBLOCK, v64); + printf("ioctl(-1, MIXER_WRITE(%u) or MEMGETBADBLOCK, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMGETBADBLOCK), *v64); + + ioctl(-1, MEMSETBADBLOCK, v64); + printf("ioctl(-1, MIXER_WRITE(%u) or MEMSETBADBLOCK, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMSETBADBLOCK), *v64); + + struct region_info_user *const riu = tail_alloc(sizeof(*riu)); + fill_memory(riu, sizeof(*riu)); + ioctl(-1, MEMGETREGIONINFO, riu); + printf("ioctl(-1, %s, {regionindex=%#x}) = -1 EBADF (%m)\n", + "MEMGETREGIONINFO" +#ifdef __i386__ + " or MTRRIOC_GET_PAGE_ENTRY" +#endif + , riu->regionindex); + + struct erase_info_user *const eiu = tail_alloc(sizeof(*eiu)); + fill_memory(eiu, sizeof(*eiu)); + + TEST_erase_info_user(MEMERASE, eiu); + TEST_erase_info_user(MEMLOCK, eiu); + TEST_erase_info_user(MEMUNLOCK, eiu); + TEST_erase_info_user(MEMISLOCKED, eiu); + + struct erase_info_user64 *const eiu64 = tail_alloc(sizeof(*eiu64)); + fill_memory(eiu64, sizeof(*eiu64)); + ioctl(-1, MEMERASE64, eiu64); + printf("ioctl(-1, MIXER_WRITE(%u) or %s, {start=%#llx, length=%#llx})" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMERASE64), "MEMERASE64", + (unsigned long long) eiu64->start, + (unsigned long long) eiu64->length); + + struct mtd_oob_buf *const oob = tail_alloc(sizeof(*oob)); + fill_memory(oob, sizeof(*oob)); + + ioctl(-1, MEMWRITEOOB, oob); + printf("ioctl(-1, MEMWRITEOOB, {start=%#x, length=%#x, ptr=%p})" + " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); + + ioctl(-1, MEMREADOOB, oob); + printf("ioctl(-1, MEMREADOOB, {start=%#x, length=%#x, ptr=%p})" + " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); + + struct mtd_oob_buf64 *const oob64 = tail_alloc(sizeof(*oob64)); + fill_memory(oob64, sizeof(*oob64)); + + ioctl(-1, MEMWRITEOOB64, oob64); + printf("ioctl(-1, MEMWRITEOOB64" + ", {start=%#llx, length=%#x, usr_ptr=%#llx}) = -1 EBADF (%m)\n", + (unsigned long long) oob64->start, oob64->length, + (unsigned long long) oob64->usr_ptr); + + ioctl(-1, MEMREADOOB64, oob64); + printf("ioctl(-1, MEMREADOOB64" + ", {start=%#llx, length=%#x, usr_ptr=%#llx}) = -1 EBADF (%m)\n", + (unsigned long long) oob64->start, oob64->length, + (unsigned long long) oob64->usr_ptr); + + + struct otp_info *const oi = tail_alloc(sizeof(*oi)); + fill_memory(oi, sizeof(*oi)); + ioctl(-1, OTPLOCK, oi); + printf("ioctl(-1, MIXER_READ(%u) or OTPLOCK" + ", {start=%#x, length=%#x, locked=%u}) = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(OTPLOCK), oi->start, oi->length, oi->locked); + + struct mtd_write_req *const wr = tail_alloc(sizeof(*wr)); + fill_memory(wr, sizeof(*wr)); + wr->mode = MTD_OPS_PLACE_OOB; + ioctl(-1, MEMWRITE, wr); + printf("ioctl(-1, MEMWRITE, {start=%#llx, len=%#llx, ooblen=%#llx" + ", usr_data=%#llx, usr_oob=%#llx, mode=MTD_OPS_PLACE_OOB})" + " = -1 EBADF (%m)\n", + (unsigned long long) wr->start, + (unsigned long long) wr->len, + (unsigned long long) wr->ooblen, + (unsigned long long) wr->usr_data, + (unsigned long long) wr->usr_oob); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x4d, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x4d, 0xfe, 0xff)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_mtd.test b/tests-mx32/ioctl_mtd.test new file mode 100755 index 00000000..08428073 --- /dev/null +++ b/tests-mx32/ioctl_mtd.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of 'M' type ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_rtc-v.c b/tests-mx32/ioctl_rtc-v.c new file mode 100644 index 00000000..62b16155 --- /dev/null +++ b/tests-mx32/ioctl_rtc-v.c @@ -0,0 +1,3 @@ +/* This file is part of ioctl_rtc-v strace test. */ +#define VERBOSE 1 +#include "ioctl_rtc.c" diff --git a/tests-mx32/ioctl_rtc-v.test b/tests-mx32/ioctl_rtc-v.test new file mode 100755 index 00000000..a255322d --- /dev/null +++ b/tests-mx32/ioctl_rtc-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check verbose decoding of RTC_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_rtc.c b/tests-mx32/ioctl_rtc.c new file mode 100644 index 00000000..49d7ec7b --- /dev/null +++ b/tests-mx32/ioctl_rtc.c @@ -0,0 +1,207 @@ +/* + * This file is part of ioctl_rtc strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include "xlat.h" + +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +static void +print_rtc_time(const struct rtc_time *rt) +{ + printf("{tm_sec=%d, tm_min=%d, tm_hour=%d" + ", tm_mday=%d, tm_mon=%d, tm_year=%d", + rt->tm_sec, rt->tm_min, rt->tm_hour, + rt->tm_mday, rt->tm_mon, rt->tm_year); +#if VERBOSE + printf(", tm_wday=%d, tm_yday=%d, tm_isdst=%d}", + rt->tm_wday, rt->tm_yday, rt->tm_isdst); +#else + printf(", ...}"); +#endif +} + +static struct xlat rtc_argless[] = { + XLAT(RTC_AIE_OFF), + XLAT(RTC_PIE_ON), + XLAT(RTC_PIE_OFF), + XLAT(RTC_UIE_ON), + XLAT(RTC_WIE_ON), + XLAT(RTC_WIE_OFF), +#ifdef RTC_VL_CLR + XLAT(RTC_VL_CLR), +#endif +}; + +int +main(void) +{ + const unsigned int size = get_page_size(); + + void *const page = tail_alloc(size); + fill_memory(page, size); + + struct rtc_time *rt = tail_alloc(sizeof(*rt)); + fill_memory(rt, sizeof(*rt)); + + struct rtc_wkalrm *wk = tail_alloc(sizeof(*wk)); + fill_memory(wk, sizeof(*wk)); + + struct rtc_pll_info *pll = tail_alloc(sizeof(*pll)); + fill_memory(pll, sizeof(*pll)); + + /* RTC_ALM_READ */ + ioctl(-1, RTC_ALM_READ, 0); + printf("ioctl(-1, RTC_ALM_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_ALM_READ, page); + printf("ioctl(-1, RTC_ALM_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_RD_TIME */ + ioctl(-1, RTC_RD_TIME, 0); + printf("ioctl(-1, RTC_RD_TIME, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_RD_TIME, page); + printf("ioctl(-1, RTC_RD_TIME, %p) = -1 EBADF (%m)\n", page); + + /* RTC_ALM_SET */ + ioctl(-1, RTC_ALM_SET, 0); + printf("ioctl(-1, RTC_ALM_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_ALM_SET, rt); + printf("ioctl(-1, RTC_ALM_SET, "); + print_rtc_time(rt); + errno = EBADF; + printf(") = -1 EBADF (%m)\n"); + + /* RTC_SET_TIME */ + ioctl(-1, RTC_SET_TIME, 0); + printf("ioctl(-1, RTC_SET_TIME, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_SET_TIME, rt); + printf("ioctl(-1, RTC_SET_TIME, "); + print_rtc_time(rt); + errno = EBADF; + printf(") = -1 EBADF (%m)\n"); + + /* RTC_IRQP_SET */ + ioctl(-1, RTC_IRQP_SET, lmagic); + printf("ioctl(-1, RTC_IRQP_SET, %lu) = -1 EBADF (%m)\n", lmagic); + + /* RTC_EPOCH_SET */ + ioctl(-1, RTC_EPOCH_SET, lmagic); + printf("ioctl(-1, RTC_EPOCH_SET, %lu) = -1 EBADF (%m)\n", lmagic); + + /* RTC_IRQP_READ */ + ioctl(-1, RTC_IRQP_READ, 0); + printf("ioctl(-1, RTC_IRQP_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_IRQP_READ, page); + printf("ioctl(-1, RTC_IRQP_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_EPOCH_READ */ + ioctl(-1, RTC_EPOCH_READ, 0); + printf("ioctl(-1, RTC_EPOCH_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_EPOCH_READ, page); + printf("ioctl(-1, RTC_EPOCH_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_WKALM_RD */ + ioctl(-1, RTC_WKALM_RD, 0); + printf("ioctl(-1, RTC_WKALM_RD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_WKALM_RD, page); + printf("ioctl(-1, RTC_WKALM_RD, %p) = -1 EBADF (%m)\n", page); + + /* RTC_WKALM_SET */ + ioctl(-1, RTC_WKALM_SET, 0); + printf("ioctl(-1, RTC_WKALM_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_WKALM_SET, wk); + printf("ioctl(-1, RTC_WKALM_SET, {enabled=%u, pending=%u, time=", + (unsigned) wk->enabled, (unsigned) wk->pending); + print_rtc_time(&wk->time); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + /* RTC_PLL_GET */ + ioctl(-1, RTC_PLL_GET, 0); + printf("ioctl(-1, RTC_PLL_GET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_PLL_GET, page); + printf("ioctl(-1, RTC_PLL_GET, %p) = -1 EBADF (%m)\n", page); + + /* RTC_PLL_SET */ + ioctl(-1, RTC_PLL_SET, 0); + printf("ioctl(-1, RTC_PLL_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_PLL_SET, pll); + printf("ioctl(-1, RTC_PLL_SET, {pll_ctrl=%d, pll_value=%d" + ", pll_max=%d, pll_min=%d, pll_posmult=%d, pll_negmult=%d" + ", pll_clock=%ld}) = -1 EBADF (%m)\n", + pll->pll_ctrl, pll->pll_value, pll->pll_max, pll->pll_min, + pll->pll_posmult, pll->pll_negmult, pll->pll_clock); + +#ifdef RTC_VL_READ + /* RTC_VL_READ */ + ioctl(-1, RTC_VL_READ, 0); + printf("ioctl(-1, RTC_VL_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_VL_READ, page); + printf("ioctl(-1, RTC_VL_READ, %p) = -1 EBADF (%m)\n", page); +#endif + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(rtc_argless); ++i) { + ioctl(-1, (unsigned long) rtc_argless[i].val, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", rtc_argless[i].str); + } + + ioctl(-1, RTC_UIE_OFF, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "PHN_NOT_OH or RTC_UIE_OFF"); + + ioctl(-1, RTC_AIE_ON, lmagic); +#ifdef HPPA + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "PA_PERF_ON or RTC_AIE_ON"); +#else + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "RTC_AIE_ON"); +#endif + + ioctl(-1, _IO(0x70, 0x40), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", "NVRAM_INIT", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_rtc.test b/tests-mx32/ioctl_rtc.test new file mode 100755 index 00000000..4545f2ae --- /dev/null +++ b/tests-mx32/ioctl_rtc.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic decoding of RTC_* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_scsi.c b/tests-mx32/ioctl_scsi.c new file mode 100644 index 00000000..0db94d84 --- /dev/null +++ b/tests-mx32/ioctl_scsi.c @@ -0,0 +1,156 @@ +/* + * Check decoding of SCSI ioctl commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SCSI_SG_H + +# include +# include +# include +# include "xlat/scsi_sg_commands.h" + +# define TEST_NO_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0xdeadbeef); \ + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +# define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +# define TEST_TAKES_INT_BY_VAL(cmd, val) \ + do { \ + ioctl(-1, cmd, val); \ + printf("ioctl(-1, %s, %#x) = -1 EBADF (%m)\n", #cmd, val); \ + } while (0) + +# define TEST_TAKES_INT_BY_PTR(cmd, pint) \ + do { \ + ioctl(-1, cmd, pint); \ + printf("ioctl(-1, %s, [%d]) = -1 EBADF (%m)\n", #cmd, *(pint)); \ + } while (0) + +# define TEST_RETURNS_INT_BY_PTR(cmd, pint) \ + do { \ + ioctl(-1, cmd, pint); \ + printf("ioctl(-1, %s, %p) = -1 EBADF (%m)\n", #cmd, pint); \ + } while (0) + +int +main(void) +{ + int *const pint = tail_alloc(sizeof(*pint)); + *pint = (int) 0xfacefeed; + + TEST_NO_ARG(SG_GET_TIMEOUT); + + TEST_NULL_ARG(SG_SET_TIMEOUT); + TEST_NULL_ARG(SG_EMULATED_HOST); + TEST_NULL_ARG(SG_GET_TRANSFORM); + TEST_NULL_ARG(SG_GET_COMMAND_Q); + TEST_NULL_ARG(SG_SET_COMMAND_Q); + TEST_NULL_ARG(SG_GET_RESERVED_SIZE); + TEST_NULL_ARG(SG_SET_RESERVED_SIZE); + TEST_NULL_ARG(SG_GET_SCSI_ID); + TEST_NULL_ARG(SG_SET_FORCE_LOW_DMA); + TEST_NULL_ARG(SG_GET_LOW_DMA); + TEST_NULL_ARG(SG_SET_FORCE_PACK_ID); + TEST_NULL_ARG(SG_GET_PACK_ID); + TEST_NULL_ARG(SG_GET_NUM_WAITING); + TEST_NULL_ARG(SG_SET_DEBUG); + TEST_NULL_ARG(SG_GET_SG_TABLESIZE); + TEST_NULL_ARG(SG_GET_VERSION_NUM); + TEST_NULL_ARG(SG_NEXT_CMD_LEN); + TEST_NULL_ARG(SG_SCSI_RESET); + TEST_NULL_ARG(SG_IO); + TEST_NULL_ARG(SG_GET_REQUEST_TABLE); + TEST_NULL_ARG(SG_SET_KEEP_ORPHAN); + TEST_NULL_ARG(SG_GET_KEEP_ORPHAN); + TEST_NULL_ARG(SG_GET_ACCESS_COUNT); + + TEST_TAKES_INT_BY_VAL(SG_SET_TRANSFORM, 0); + TEST_TAKES_INT_BY_VAL(SG_SET_TRANSFORM, *pint); + + TEST_TAKES_INT_BY_PTR(SG_NEXT_CMD_LEN, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_COMMAND_Q, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_DEBUG, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_FORCE_LOW_DMA, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_FORCE_PACK_ID, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_KEEP_ORPHAN, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_RESERVED_SIZE, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_TIMEOUT, pint); + + TEST_RETURNS_INT_BY_PTR(SG_EMULATED_HOST, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_ACCESS_COUNT, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_COMMAND_Q, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_KEEP_ORPHAN, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_LOW_DMA, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_NUM_WAITING, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_PACK_ID, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_RESERVED_SIZE, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_SG_TABLESIZE, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_TRANSFORM, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_VERSION_NUM, pint); + + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [%#x /* %s_??? */]) = -1 EBADF (%m)\n", + "SG_SCSI_RESET", *pint, "SG_SCSI_RESET"); + + *pint = 0x100; + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [SG_SCSI_RESET_NO_ESCALATE|SG_SCSI_RESET_NOTHING])" + " = -1 EBADF (%m)\n", "SG_SCSI_RESET"); + + *pint = 1; + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [SG_SCSI_RESET_DEVICE]) = -1 EBADF (%m)\n", + "SG_SCSI_RESET"); + + ioctl(-1, 0x22ff, 0); + printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n"); + + static const unsigned long magic = + (unsigned long) 0xdeadbeeffacefeedULL; + ioctl(-1, 0x22ff, magic); + printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", + magic); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SCSI_SG_H") + +#endif diff --git a/tests-mx32/ioctl_scsi.test b/tests-mx32/ioctl_scsi.test new file mode 100755 index 00000000..2710f12b --- /dev/null +++ b/tests-mx32/ioctl_scsi.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of SCSI ioctl commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sg_io_v3.c b/tests-mx32/ioctl_sg_io_v3.c new file mode 100644 index 00000000..ef25795b --- /dev/null +++ b/tests-mx32/ioctl_sg_io_v3.c @@ -0,0 +1,418 @@ +/* + * Check decoding of ioctl SG_IO v3 commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SCSI_SG_H + +# include +# include +# include +# include +# include + +int +main(void) +{ + ioctl(-1, SG_IO, 0); + printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); + + struct sg_io_hdr *const sg_io = tail_alloc(sizeof(*sg_io)); + fill_memory(sg_io, sizeof(*sg_io)); + + const void *const efault = sg_io + 1; + ioctl(-1, SG_IO, efault); + printf("ioctl(-1, SG_IO, %p) = -1 EBADF (%m)\n", efault); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->interface_id); + + unsigned int *const piid = tail_alloc(sizeof(*piid)); + *piid = (unsigned char) 'S'; + ioctl(-1, SG_IO, piid); + printf("ioctl(-1, SG_IO, {interface_id='S', %p}) = -1 EBADF (%m)\n", piid + 1); + + sg_io->interface_id = (unsigned char) 'S'; + sg_io->dxfer_direction = -2; + sg_io->flags = -1U; + sg_io->info = -1U; + sg_io->dxferp = (void *) (unsigned long) 0xfacefeedfffffff1ULL; + sg_io->cmdp = (void *) (unsigned long) 0xfacefeedfffffff2ULL; + sg_io->sbp = (void *) (unsigned long) 0xfacefeedfffffff3ULL; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_UNUSED_LUN_INHIBIT" + "|SG_FLAG_MMAP_IO|SG_FLAG_NO_DXFER" + "|SG_FLAG_Q_AT_TAIL|SG_FLAG_Q_AT_HEAD|0xfffeffc8" + ", dxferp=%p" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + sg_io->dxferp, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->dxfer_direction = -3; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_UNUSED_LUN_INHIBIT" + "|SG_FLAG_MMAP_IO|SG_FLAG_NO_DXFER" + "|SG_FLAG_Q_AT_TAIL|SG_FLAG_Q_AT_HEAD|0xfffeffc8" + ", dxferp=%p" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + sg_io->dxferp, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + const struct iovec iov[] = { + { + .iov_base = (void *) efault - 2, + .iov_len = 2 + }, { + .iov_base = (void *) efault - 3, + .iov_len = 4 + } + }; + struct iovec *const t_iov = tail_memdup(iov, sizeof(iov)); + + sg_io->flags = 0x24; + sg_io->info = 1; + sg_io->dxfer_direction = -2; + + sg_io->iovec_count = ARRAY_SIZE(iov); + sg_io->dxfer_len = iov[0].iov_len + iov[1].iov_len - 1; + sg_io->dxferp = t_iov; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_MMAP_IO|SG_FLAG_Q_AT_HEAD" + ", dxferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0x11; + sg_io->dxfer_direction = -3; + sg_io->resid = sg_io->dxfer_len + 1; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_Q_AT_TAIL" + ", dxferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0x10000; + sg_io->info = 0xdeadbeef; + sg_io->iovec_count = 0; + sg_io->dxfer_len = 5; + sg_io->resid = 1; + sg_io->dxferp = (void *) efault - (sg_io->dxfer_len - sg_io->resid); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_NO_DXFER" + ", dxferp=\"\\x%x\\x%x\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + * (unsigned char *) (sg_io->dxferp + 3), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 2; + sg_io->dxfer_direction = -4; + sg_io->dxfer_len = 3; + sg_io->resid = 1; + sg_io->dxferp = (void *) efault - sg_io->dxfer_len; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_UNUSED_LUN_INHIBIT" + ", dxferp=\"\\x%x\\x%x\\x%x\" => dxferp=\"\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0; + sg_io->resid = sg_io->dxfer_len; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=0" + ", dxferp=\"\\x%x\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SCSI_SG_H") + +#endif diff --git a/tests-mx32/ioctl_sg_io_v3.test b/tests-mx32/ioctl_sg_io_v3.test new file mode 100755 index 00000000..dacacdf4 --- /dev/null +++ b/tests-mx32/ioctl_sg_io_v3.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of ioctl SG_IO v3 commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sg_io_v4.c b/tests-mx32/ioctl_sg_io_v4.c new file mode 100644 index 00000000..5f899eee --- /dev/null +++ b/tests-mx32/ioctl_sg_io_v4.c @@ -0,0 +1,238 @@ +/* + * Check decoding of ioctl SG_IO v4 commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_BSG_H + +# include +# include +# include +# include +# include + +# include "xlat/scsi_sg_commands.h" + +int +main(void) +{ + ioctl(-1, SG_IO, 0); + printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); + + struct sg_io_v4 *const sg_io = tail_alloc(sizeof(*sg_io)); + fill_memory(sg_io, sizeof(*sg_io)); + + const void *const efault = sg_io + 1; + ioctl(-1, SG_IO, efault); + printf("ioctl(-1, SG_IO, %p) = -1 EBADF (%m)\n", efault); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->guard); + + unsigned int *const pguard = tail_alloc(sizeof(*pguard)); + *pguard = (unsigned char) 'Q'; + ioctl(-1, SG_IO, pguard); + printf("ioctl(-1, SG_IO, {guard='Q', %p}) = -1 EBADF (%m)\n", pguard + 1); + + sg_io->guard = (unsigned char) 'Q'; + sg_io->protocol = 0; + sg_io->subprotocol = 1; + sg_io->flags = -1U; + sg_io->info = -1U; + sg_io->request = (kernel_ulong_t) 0xfacefeedfffffff1ULL; + sg_io->response = (kernel_ulong_t) 0xfacefeedfffffff2ULL; + sg_io->dout_xferp = (kernel_ulong_t) 0xfacefeedfffffff3ULL; + sg_io->din_xferp = (kernel_ulong_t) 0xfacefeedfffffff4ULL; + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {guard='Q'" + ", protocol=BSG_PROTOCOL_SCSI" + ", subprotocol=BSG_SUB_PROTOCOL_SCSI_TMF" + ", request_len=%u" + ", request=%#llx" + ", request_tag=%#" PRI__x64 + ", request_attr=%u" + ", request_priority=%u" + ", request_extra=%u" + ", max_response_len=%u" + ", dout_iovec_count=%u" + ", dout_xfer_len=%u" + ", din_iovec_count=%u" + ", din_xfer_len=%u" + ", dout_xferp=%#llx" + ", timeout=%u" + ", flags=BSG_FLAG_Q_AT_TAIL|BSG_FLAG_Q_AT_HEAD|0xffffffcf" + ", usr_ptr=%#" PRI__x64 + ", response_len=%u" + ", response=%#llx" + ", din_xferp=%#llx" + ", driver_status=%#x" + ", transport_status=%#x" + ", device_status=%#x" + ", retry_delay=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + ", duration=%u" + ", response_len=%u" + ", din_resid=%d" + ", dout_resid=%d" + ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", + sg_io->request_len, + (unsigned long long) (kernel_ulong_t) sg_io->request, + sg_io->request_tag, + sg_io->request_attr, + sg_io->request_priority, + sg_io->request_extra, + sg_io->max_response_len, + sg_io->dout_iovec_count, + sg_io->dout_xfer_len, + sg_io->din_iovec_count, + sg_io->din_xfer_len, + (unsigned long long) (kernel_ulong_t) sg_io->dout_xferp, + sg_io->timeout, + sg_io->usr_ptr, + sg_io->response_len, + (unsigned long long) (kernel_ulong_t) sg_io->response, + (unsigned long long) (kernel_ulong_t) sg_io->din_xferp, + sg_io->driver_status, + sg_io->transport_status, + sg_io->device_status, + sg_io->retry_delay, + sg_io->duration, + sg_io->response_len, + sg_io->din_resid, + sg_io->dout_resid, + sg_io->generated_tag); + + const struct iovec iov[] = { + { + .iov_base = (void *) efault - 2, + .iov_len = 2 + }, { + .iov_base = (void *) efault - 3, + .iov_len = 4 + } + }; + const struct iovec *const t_iov = tail_memdup(iov, sizeof(iov)); + sg_io->dout_iovec_count = ARRAY_SIZE(iov); + sg_io->dout_xfer_len = iov[0].iov_len + iov[1].iov_len - 1; + sg_io->dout_xferp = (unsigned long) t_iov; + + sg_io->din_iovec_count = 0; + sg_io->din_xfer_len = 5; + sg_io->din_resid = 1; + sg_io->din_xferp = (unsigned long) efault - + (sg_io->dout_xfer_len - sg_io->din_resid); + + sg_io->request_len = 3; + sg_io->request = (unsigned long) efault - sg_io->request_len; + sg_io->response_len = 2; + sg_io->response = (unsigned long) efault - sg_io->response_len; + + sg_io->flags = 0x20; + sg_io->info = 1; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {guard='Q'" + ", protocol=BSG_PROTOCOL_SCSI" + ", subprotocol=BSG_SUB_PROTOCOL_SCSI_TMF" + ", request_len=%u" + ", request=\"\\x%x\\x%x\\x%x\"" + ", request_tag=%#" PRI__x64 + ", request_attr=%u" + ", request_priority=%u" + ", request_extra=%u" + ", max_response_len=%u" + ", dout_iovec_count=%u" + ", dout_xfer_len=%u" + ", din_iovec_count=%u" + ", din_xfer_len=%u" + ", dout_xferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", timeout=%u, flags=BSG_FLAG_Q_AT_HEAD" + ", usr_ptr=%#" PRI__x64 + ", response_len=%u" + ", response=\"\\x%x\\x%x\"" + ", din_xferp=\"\\x%x\\x%x\\x%x\\x%x\"" + ", driver_status=%#x" + ", transport_status=%#x" + ", device_status=%#x" + ", retry_delay=%u" + ", info=SG_INFO_CHECK" + ", duration=%u" + ", response_len=%u" + ", din_resid=%d" + ", dout_resid=%d" + ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", + sg_io->request_len, + * (unsigned char *) ((unsigned long) sg_io->request + 0), + * (unsigned char *) ((unsigned long) sg_io->request + 1), + * (unsigned char *) ((unsigned long) sg_io->request + 2), + sg_io->request_tag, + sg_io->request_attr, + sg_io->request_priority, + sg_io->request_extra, + sg_io->max_response_len, + sg_io->dout_iovec_count, + sg_io->dout_xfer_len, + sg_io->din_iovec_count, + sg_io->din_xfer_len, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->timeout, + sg_io->usr_ptr, + sg_io->response_len, + * (unsigned char *) ((unsigned long) sg_io->response + 0), + * (unsigned char *) ((unsigned long) sg_io->response + 1), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 0), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 1), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 2), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 3), + sg_io->driver_status, + sg_io->transport_status, + sg_io->device_status, + sg_io->retry_delay, + sg_io->duration, + sg_io->response_len, + sg_io->din_resid, + sg_io->dout_resid, + sg_io->generated_tag); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_BSG_H") + +#endif diff --git a/tests-mx32/ioctl_sg_io_v4.test b/tests-mx32/ioctl_sg_io_v4.test new file mode 100755 index 00000000..25567224 --- /dev/null +++ b/tests-mx32/ioctl_sg_io_v4.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of ioctl SG_IO v4 commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sock_gifconf.c b/tests-mx32/ioctl_sock_gifconf.c new file mode 100644 index 00000000..ae0bea4f --- /dev/null +++ b/tests-mx32/ioctl_sock_gifconf.c @@ -0,0 +1,182 @@ +/* + * Check decoding of SIOCGIFCONF command of ioctl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_STRLEN 1 + +static void +print_ifc_len(int val) +{ + if (val % (int) sizeof(struct ifreq)) + printf("%d", val); + else + printf("%d * sizeof(struct ifreq)", + val / (int) sizeof(struct ifreq)); +} + +static void +print_ifconf(struct ifconf *ifc, int in_len, char *in_buf, long rc) +{ + if (in_buf) { + printf("{ifc_len="); + print_ifc_len(in_len); + + if (in_len != ifc->ifc_len) { + printf(" => "); + print_ifc_len(ifc->ifc_len); + } + } else { + printf("{ifc_len="); + print_ifc_len(ifc->ifc_len); + } + + printf(", ifc_buf="); + + if ((rc < 0) || !in_buf) { + if (in_buf) + printf("%p", in_buf); + else + printf("NULL"); + } else { + int i; + + printf("["); + for (i = 0; i < (ifc->ifc_len) && + i < (int) (MAX_STRLEN * sizeof(struct ifreq)); + i += sizeof(struct ifreq)) { + struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); + struct sockaddr_in *const sa_in = + (struct sockaddr_in *) &(ifr->ifr_addr); + + if (i) + printf(", "); + printf("{ifr_name=\"%s\", ifr_addr={sa_family=AF_INET, " + "sin_port=htons(%u), sin_addr=inet_addr(\"%s\")}" + "}", ifr->ifr_name, ntohs(sa_in->sin_port), + inet_ntoa(sa_in->sin_addr)); + } + + if ((size_t) (ifc->ifc_len - i) >= sizeof(struct ifreq)) + printf(", ..."); + + printf("]"); + } + + printf("}"); +} + +static void +gifconf_ioctl(int fd, struct ifconf *ifc, bool ifc_valid) +{ + const char * errstr; + int in_len; + char *in_buf; + long rc; + + if (ifc_valid) { + in_len = ifc->ifc_len; + in_buf = ifc->ifc_buf; + } + + rc = ioctl(fd, SIOCGIFCONF, ifc); + errstr = sprintrc(rc); + + printf("ioctl(%d, SIOCGIFCONF, ", fd); + if (ifc_valid) { + print_ifconf(ifc, in_len, in_buf, rc); + } else { + if (ifc) + printf("%p", ifc); + else + printf("NULL"); + } + + printf(") = %s\n", errstr); +} + +int +main(int argc, char *argv[]) +{ + struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); + struct ifconf *ifc = tail_alloc(sizeof(*ifc)); + + struct sockaddr_in addr; + int fd; + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) + perror_msg_and_skip("socket AF_INET"); + + gifconf_ioctl(fd, NULL, false); + gifconf_ioctl(fd, ifc + 1, false); + + ifc->ifc_len = 3141592653U; + ifc->ifc_buf = NULL; + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 0; + ifc->ifc_buf = (char *) (ifr + 2); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 1; + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 1 * sizeof(*ifr); + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 2 * sizeof(*ifr); + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 2 * sizeof(*ifr) + 2; + ifc->ifc_buf = (char *) ifr; + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 3 * sizeof(*ifr) + 4; + ifc->ifc_buf = (char *) ifr; + gifconf_ioctl(fd, ifc, true); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_sock_gifconf.test b/tests-mx32/ioctl_sock_gifconf.test new file mode 100755 index 00000000..2e2fc019 --- /dev/null +++ b/tests-mx32/ioctl_sock_gifconf.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of SIOCGIFCONF ioctl. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a28 -s1 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_uffdio.c b/tests-mx32/ioctl_uffdio.c new file mode 100644 index 00000000..10b8b843 --- /dev/null +++ b/tests-mx32/ioctl_uffdio.c @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Red Hat, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_userfaultfd && defined HAVE_LINUX_USERFAULTFD_H + +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +int +main(void) +{ + int rc; + int fd = syscall(__NR_userfaultfd, O_NONBLOCK); + size_t pagesize = getpagesize(); + + if (fd < 0) + perror_msg_and_skip("userfaultfd"); + + /* ---- API ---- */ + struct uffdio_api *api_struct = tail_alloc(sizeof(*api_struct)); + + /* With a bad fd */ + memset(api_struct, 0, sizeof(*api_struct)); + rc = ioctl(-1, UFFDIO_API, api_struct); + printf("ioctl(-1, UFFDIO_API, {api=0, features=0}) = %d %s (%m)\n", + rc, errno2name()); + /* With a bad pointer */ + rc = ioctl(fd, UFFDIO_API, NULL); + printf("ioctl(%d, UFFDIO_API, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + /* Normal call */ + api_struct->api = UFFD_API; + api_struct->features = 0; + rc = ioctl(fd, UFFDIO_API, api_struct); + printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0, " + "features.out=%#" PRIx64 ", " "ioctls=1<<_UFFDIO_REGISTER|" + "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API", + fd, (uint64_t)api_struct->features); + api_struct->ioctls &= ~(1ull<<_UFFDIO_REGISTER| + 1ull<<_UFFDIO_UNREGISTER| + 1ull<<_UFFDIO_API); + if (api_struct->ioctls) + printf("|%#" PRIx64, (uint64_t)api_struct->ioctls); + printf("}) = %d\n", rc); + + /* For the rest of the tests we need some anonymous memory */ + void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1, 0); + if (area1 == MAP_FAILED) + perror_msg_and_fail("mmap area1"); + void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1, 0); + if (area2 == MAP_FAILED) + perror_msg_and_fail("mmap area2"); + madvise(area2, pagesize, MADV_DONTNEED); + *(char *)area1 = 42; + + /* ---- REGISTER ---- */ + struct uffdio_register *register_struct = + tail_alloc(sizeof(*register_struct)); + memset(register_struct, 0, sizeof(*register_struct)); + + rc = ioctl(-1, UFFDIO_REGISTER, register_struct); + printf("ioctl(-1, UFFDIO_REGISTER, {range={start=0, len=0}, " + "mode=0}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_REGISTER, NULL); + printf("ioctl(%d, UFFDIO_REGISTER, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + register_struct->range.start = (uint64_t)(uintptr_t)area2; + register_struct->range.len = pagesize; + register_struct->mode = UFFDIO_REGISTER_MODE_MISSING; + rc = ioctl(fd, UFFDIO_REGISTER, register_struct); + printf("ioctl(%d, UFFDIO_REGISTER, {range={start=%p, len=%#zx}, " + "mode=UFFDIO_REGISTER_MODE_MISSING, ioctls=" + "1<<_UFFDIO_WAKE|1<<_UFFDIO_COPY|1<<_UFFDIO_ZEROPAGE", + fd, area2, pagesize); + register_struct->ioctls &= ~(1ull<<_UFFDIO_WAKE| + 1ull<<_UFFDIO_COPY| + 1ull<<_UFFDIO_ZEROPAGE); + if (register_struct->ioctls) + printf("|%#" PRIx64, (uint64_t)register_struct->ioctls); + printf("}) = %d\n", rc); + + /* With area2 registered we can now do the atomic copies onto it + * but be careful not to access it in any other way otherwise + * userfaultfd will cause us to stall. + */ + /* ---- COPY ---- */ + struct uffdio_copy *copy_struct = tail_alloc(sizeof(*copy_struct)); + + memset(copy_struct, 0, sizeof(*copy_struct)); + rc = ioctl(-1, UFFDIO_COPY, copy_struct); + printf("ioctl(-1, UFFDIO_COPY, {dst=0, src=0, len=0, mode=0" + "}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_COPY, NULL); + printf("ioctl(%d, UFFDIO_COPY, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + copy_struct->dst = (uint64_t)(uintptr_t)area2; + copy_struct->src = (uint64_t)(uintptr_t)area1; + copy_struct->len = pagesize; + copy_struct->mode = UFFDIO_COPY_MODE_DONTWAKE; + rc = ioctl(fd, UFFDIO_COPY, copy_struct); + printf("ioctl(%d, UFFDIO_COPY, {dst=%p, src=%p, len=%#zx," + " mode=UFFDIO_COPY_MODE_DONTWAKE, copy=%#zx}) = %d\n", + fd, area2, area1, pagesize, pagesize, rc); + + /* ---- ZEROPAGE ---- */ + struct uffdio_zeropage *zero_struct = tail_alloc(sizeof(*zero_struct)); + madvise(area2, pagesize, MADV_DONTNEED); + + memset(zero_struct, 0, sizeof(*zero_struct)); + rc = ioctl(-1, UFFDIO_ZEROPAGE, zero_struct); + printf("ioctl(-1, UFFDIO_ZEROPAGE, {range={start=0, len=0}, mode=0" + "}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_ZEROPAGE, NULL); + printf("ioctl(%d, UFFDIO_ZEROPAGE, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + zero_struct->range.start = (uint64_t)(uintptr_t)area2; + zero_struct->range.len = pagesize; + zero_struct->mode = UFFDIO_ZEROPAGE_MODE_DONTWAKE; + rc = ioctl(fd, UFFDIO_ZEROPAGE, zero_struct); + printf("ioctl(%d, UFFDIO_ZEROPAGE, {range={start=%p, len=%#zx}," + " mode=UFFDIO_ZEROPAGE_MODE_DONTWAKE, zeropage=%#zx}) = %d\n", + fd, area2, pagesize, pagesize, rc); + + /* ---- WAKE ---- */ + struct uffdio_range *range_struct = tail_alloc(sizeof(*range_struct)); + memset(range_struct, 0, sizeof(*range_struct)); + + rc = ioctl(-1, UFFDIO_WAKE, range_struct); + printf("ioctl(-1, UFFDIO_WAKE, {start=0, len=0}) = %d %s (%m)\n", + rc, errno2name()); + + rc = ioctl(fd, UFFDIO_WAKE, NULL); + printf("ioctl(%d, UFFDIO_WAKE, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + range_struct->start = (uint64_t)(uintptr_t)area2; + range_struct->len = pagesize; + rc = ioctl(fd, UFFDIO_WAKE, range_struct); + printf("ioctl(%d, UFFDIO_WAKE, {start=%p, len=%#zx}) = %d\n", + fd, area2, pagesize, rc); + + /* ---- UNREGISTER ---- */ + memset(range_struct, 0, sizeof(*range_struct)); + + rc = ioctl(-1, UFFDIO_UNREGISTER, range_struct); + printf("ioctl(-1, UFFDIO_UNREGISTER, {start=0, len=0}) = %d %s (%m)\n", + rc, errno2name()); + + rc = ioctl(fd, UFFDIO_UNREGISTER, NULL); + printf("ioctl(%d, UFFDIO_UNREGISTER, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + range_struct->start = (uint64_t)(uintptr_t)area2; + range_struct->len = pagesize; + rc = ioctl(fd, UFFDIO_UNREGISTER, range_struct); + printf("ioctl(%d, UFFDIO_UNREGISTER, {start=%p, len=%#zx}) = %d\n", + fd, area2, pagesize, rc); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_userfaultfd && HAVE_LINUX_USERFAULTFD_H") + +#endif diff --git a/tests-mx32/ioctl_uffdio.test b/tests-mx32/ioctl_uffdio.test new file mode 100755 index 00000000..fae9b556 --- /dev/null +++ b/tests-mx32/ioctl_uffdio.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check userfaultfd ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_v4l2.c b/tests-mx32/ioctl_v4l2.c new file mode 100644 index 00000000..af8c3419 --- /dev/null +++ b/tests-mx32/ioctl_v4l2.c @@ -0,0 +1,551 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#if WORDS_BIGENDIAN +# define cc0(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +# define cc3(arg) ((unsigned int) (unsigned char) (arg)) +# define fourcc(a0, a1, a2, a3) \ + ((unsigned int)(a3) | \ + ((unsigned int)(a2) << 8) | \ + ((unsigned int)(a1) << 16) | \ + ((unsigned int)(a0) << 24)) +#else +# define cc0(arg) ((unsigned int) (unsigned char) (arg)) +# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +# define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +# define fourcc(a0, a1, a2, a3) \ + ((unsigned int)(a0) | \ + ((unsigned int)(a1) << 8) | \ + ((unsigned int)(a2) << 16) | \ + ((unsigned int)(a3) << 24)) +#endif + +static const unsigned int magic = 0xdeadbeef; + +int +main(void ) +{ + const unsigned int size = get_page_size(); + void *const page = tail_alloc(size); + fill_memory(page, size); + + unsigned char cc[sizeof(int)] = { 'A', '\'', '\\', '\xfa' }; + + /* VIDIOC_QUERYCAP */ + ioctl(-1, VIDIOC_QUERYCAP, 0); + printf("ioctl(-1, VIDIOC_QUERYCAP, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_QUERYCAP, page); + printf("ioctl(-1, VIDIOC_QUERYCAP, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_ENUM_FMT */ + ioctl(-1, VIDIOC_ENUM_FMT, 0); + printf("ioctl(-1, VIDIOC_ENUM_FMT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_fmtdesc *const p_fmtdesc = tail_alloc(sizeof(*p_fmtdesc)); + p_fmtdesc->index = magic; + p_fmtdesc->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + ioctl(-1, VIDIOC_ENUM_FMT, p_fmtdesc); + printf("ioctl(-1, VIDIOC_ENUM_FMT, {index=%u" + ", type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n", + p_fmtdesc->index); + + /* VIDIOC_G_FMT */ + ioctl(-1, VIDIOC_G_FMT, 0); + printf("ioctl(-1, VIDIOC_G_FMT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_format *const p_format = tail_alloc(sizeof(*p_format)); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n"); + + /* VIDIOC_S_FMT */ + ioctl(-1, VIDIOC_S_FMT, 0); + printf("ioctl(-1, VIDIOC_S_FMT, NULL) = -1 EBADF (%m)\n"); + + p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + p_format->fmt.pix.width = 0xdad1beaf; + p_format->fmt.pix.height = 0xdad2beaf; + p_format->fmt.pix.pixelformat = magic; + p_format->fmt.pix.field = V4L2_FIELD_NONE; + p_format->fmt.pix.bytesperline = 0xdad3beaf; + p_format->fmt.pix.sizeimage = 0xdad4beaf; + p_format->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; + + ioctl(-1, VIDIOC_S_FMT, p_format); + printf("ioctl(-1, VIDIOC_S_FMT, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" + ", fmt.pix={width=%u, height=%u, pixelformat=" + "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" + ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", + p_format->fmt.pix.width, p_format->fmt.pix.height, + cc0(magic), cc1(magic), cc2(magic), cc3(magic), + p_format->fmt.pix.bytesperline, p_format->fmt.pix.sizeimage); + + /* VIDIOC_TRY_FMT */ + ioctl(-1, VIDIOC_TRY_FMT, 0); + printf("ioctl(-1, VIDIOC_TRY_FMT, NULL) = -1 EBADF (%m)\n"); + +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + memset(p_format, -1, sizeof(*p_format)); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + p_format->fmt.pix_mp.width = 0xdad1beaf; + p_format->fmt.pix_mp.height = 0xdad2beaf; + p_format->fmt.pix_mp.pixelformat = magic; + p_format->fmt.pix_mp.field = V4L2_FIELD_NONE; + p_format->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; + unsigned int i; + for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { + p_format->fmt.pix_mp.plane_fmt[i].sizeimage = 0xbadc0de0 | i; + p_format->fmt.pix_mp.plane_fmt[i].bytesperline = 0xdadbeaf0 | i; + } + ioctl(-1, VIDIOC_TRY_FMT, p_format); + printf("ioctl(-1, VIDIOC_TRY_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" + ", fmt.pix_mp={width=%u, height=%u, pixelformat=" + "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", field=V4L2_FIELD_NONE, colorspace=V4L2_COLORSPACE_JPEG" + ", plane_fmt=[", + p_format->fmt.pix_mp.width, p_format->fmt.pix_mp.height, + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { + if (i) + printf(", "); + printf("{sizeimage=%u, bytesperline=%u}", + p_format->fmt.pix_mp.plane_fmt[i].sizeimage, + p_format->fmt.pix_mp.plane_fmt[i].bytesperline); + } + printf("], num_planes=%u}}) = -1 EBADF (%m)\n", + p_format->fmt.pix_mp.num_planes); +#else + struct v4l2_format *const p_v4l2_format = + page + size - sizeof(*p_v4l2_format); + ioctl(-1, VIDIOC_TRY_FMT, p_v4l2_format); + printf("ioctl(-1, VIDIOC_TRY_FMT, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_format->type); +#endif + + /* VIDIOC_REQBUFS */ + ioctl(-1, VIDIOC_REQBUFS, 0); + printf("ioctl(-1, VIDIOC_REQBUFS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_requestbuffers *const p_v4l2_requestbuffers = + page + size - sizeof(*p_v4l2_requestbuffers); + ioctl(-1, VIDIOC_REQBUFS, p_v4l2_requestbuffers); + printf("ioctl(-1, VIDIOC_REQBUFS, {count=%u, type=%#x" + " /* V4L2_BUF_TYPE_??? */, memory=%#x /* V4L2_MEMORY_??? */})" + " = -1 EBADF (%m)\n", + p_v4l2_requestbuffers->count, + p_v4l2_requestbuffers->type, + p_v4l2_requestbuffers->memory); + + /* VIDIOC_QUERYBUF */ + ioctl(-1, VIDIOC_QUERYBUF, 0); + printf("ioctl(-1, VIDIOC_QUERYBUF, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_buffer *const p_v4l2_buffer = + page + size - sizeof(*p_v4l2_buffer); + ioctl(-1, VIDIOC_QUERYBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_QUERYBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", index=%u}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type, p_v4l2_buffer->index); + + /* VIDIOC_QBUF */ + ioctl(-1, VIDIOC_QBUF, 0); + printf("ioctl(-1, VIDIOC_QBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_QBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_QBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", index=%u}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type, p_v4l2_buffer->index); + + /* VIDIOC_DQBUF */ + ioctl(-1, VIDIOC_DQBUF, 0); + printf("ioctl(-1, VIDIOC_DQBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_DQBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_DQBUF, {type=%#x" + " /* V4L2_BUF_TYPE_??? */}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type); + + /* VIDIOC_G_FBUF */ + ioctl(-1, VIDIOC_G_FBUF, 0); + printf("ioctl(-1, VIDIOC_G_FBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_FBUF, page); + printf("ioctl(-1, VIDIOC_G_FBUF, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_FBUF */ + ioctl(-1, VIDIOC_S_FBUF, 0); + printf("ioctl(-1, VIDIOC_S_FBUF, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_framebuffer *const p_v4l2_framebuffer = + page + size - sizeof(*p_v4l2_framebuffer); + ioctl(-1, VIDIOC_S_FBUF, p_v4l2_framebuffer); + printf("ioctl(-1, VIDIOC_S_FBUF, {capability=%#x" + ", flags=%#x, base=%p}) = -1 EBADF (%m)\n", + p_v4l2_framebuffer->capability, + p_v4l2_framebuffer->flags, + p_v4l2_framebuffer->base); + + /* VIDIOC_STREAMON */ + ioctl(-1, VIDIOC_STREAMON, 0); + printf("ioctl(-1, VIDIOC_STREAMON, NULL) = -1 EBADF (%m)\n"); + + int *const p_int = page + size - sizeof(int); + ioctl(-1, VIDIOC_STREAMON, p_int); + printf("ioctl(-1, VIDIOC_STREAMON, [%#x /* V4L2_BUF_TYPE_??? */])" + " = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_STREAMOFF */ + ioctl(-1, VIDIOC_STREAMOFF, 0); + printf("ioctl(-1, VIDIOC_STREAMOFF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_STREAMOFF, p_int); + printf("ioctl(-1, VIDIOC_STREAMOFF, [%#x /* V4L2_BUF_TYPE_??? */])" + " = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_G_PARM */ + ioctl(-1, VIDIOC_G_PARM, 0); + printf("ioctl(-1, VIDIOC_G_PARM, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_streamparm *const p_v4l2_streamparm = + page + size - sizeof(*p_v4l2_streamparm); + ioctl(-1, VIDIOC_G_PARM, p_v4l2_streamparm); + printf("ioctl(-1, VIDIOC_G_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); + + /* VIDIOC_S_PARM */ + ioctl(-1, VIDIOC_S_PARM, 0); + printf("ioctl(-1, VIDIOC_S_PARM, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_PARM, p_v4l2_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); + + struct v4l2_streamparm *const p_streamparm = + tail_alloc(sizeof(*p_streamparm)); + p_streamparm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + p_streamparm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; + p_streamparm->parm.capture.capturemode = V4L2_MODE_HIGHQUALITY; + p_streamparm->parm.capture.timeperframe.numerator = 0xdeadbeef; + p_streamparm->parm.capture.timeperframe.denominator = 0xbadc0ded; + ioctl(-1, VIDIOC_S_PARM, p_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE" + ", parm.capture={capability=V4L2_CAP_TIMEPERFRAME" + ", capturemode=V4L2_MODE_HIGHQUALITY, timeperframe=%u/%u" + ", extendedmode=%u, readbuffers=%u}}) = -1 EBADF (%m)\n", + p_streamparm->parm.capture.timeperframe.numerator, + p_streamparm->parm.capture.timeperframe.denominator, -1U, -1U); + + p_streamparm->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + p_streamparm->parm.output.outputmode = 0; + ioctl(-1, VIDIOC_S_PARM, p_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" + ", parm.output={capability=V4L2_CAP_TIMEPERFRAME" + ", outputmode=0, timeperframe=%u/%u" + ", extendedmode=%u, writebuffers=%u}}) = -1 EBADF (%m)\n", + p_streamparm->parm.output.timeperframe.numerator, + p_streamparm->parm.output.timeperframe.denominator, -1U, -1U); + + /* VIDIOC_G_STD */ + ioctl(-1, VIDIOC_G_STD, 0); + printf("ioctl(-1, VIDIOC_G_STD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_STD, page); + printf("ioctl(-1, VIDIOC_G_STD, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_STD */ + ioctl(-1, VIDIOC_S_STD, 0); + printf("ioctl(-1, VIDIOC_S_STD, NULL) = -1 EBADF (%m)\n"); + + long long *const p_longlong = page + size - sizeof(*p_longlong); + ioctl(-1, VIDIOC_S_STD, p_longlong); + printf("ioctl(-1, VIDIOC_S_STD, [%#llx]) = -1 EBADF (%m)\n", + *p_longlong); + + /* VIDIOC_ENUMSTD */ + ioctl(-1, VIDIOC_ENUMSTD, 0); + printf("ioctl(-1, VIDIOC_ENUMSTD, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_standard *const p_v4l2_standard = + page + size - sizeof(*p_v4l2_standard); + ioctl(-1, VIDIOC_ENUMSTD, p_v4l2_standard); + printf("ioctl(-1, VIDIOC_ENUMSTD, {index=%u}) = -1 EBADF (%m)\n", + p_v4l2_standard->index); + + /* VIDIOC_ENUMINPUT */ + ioctl(-1, VIDIOC_ENUMINPUT, 0); + printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_input *const p_v4l2_input = + page + size - sizeof(*p_v4l2_input); + ioctl(-1, VIDIOC_ENUMINPUT, p_v4l2_input); + printf("ioctl(-1, VIDIOC_ENUMINPUT, {index=%u}) = -1 EBADF (%m)\n", + p_v4l2_input->index); + + /* VIDIOC_G_CTRL */ + ioctl(-1, VIDIOC_G_CTRL, 0); + printf("ioctl(-1, VIDIOC_G_CTRL, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_control *const p_v4l2_control = + page + size - sizeof(*p_v4l2_control); + ioctl(-1, VIDIOC_G_CTRL, p_v4l2_control); + printf("ioctl(-1, VIDIOC_G_CTRL, {id=%#x /* V4L2_CID_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_control->id); + + /* VIDIOC_S_CTRL */ + ioctl(-1, VIDIOC_S_CTRL, 0); + printf("ioctl(-1, VIDIOC_S_CTRL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_CTRL, p_v4l2_control); + printf("ioctl(-1, VIDIOC_S_CTRL, {id=%#x /* V4L2_CID_??? */" + ", value=%d}) = -1 EBADF (%m)\n", + p_v4l2_control->id, p_v4l2_control->value); + + /* VIDIOC_QUERYCTRL */ + ioctl(-1, VIDIOC_QUERYCTRL, 0); + printf("ioctl(-1, VIDIOC_QUERYCTRL, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_queryctrl *const p_v4l2_queryctrl = + page + size - sizeof(*p_v4l2_queryctrl); + ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl); +# ifdef V4L2_CTRL_FLAG_NEXT_CTRL + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL" + "|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n", + p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL); +# else + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id); +# endif + + struct v4l2_queryctrl *const p_queryctrl = + tail_alloc(sizeof(*p_queryctrl)); + p_queryctrl->id = V4L2_CID_SATURATION; + ioctl(-1, VIDIOC_QUERYCTRL, p_queryctrl); + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CID_SATURATION})" + " = -1 EBADF (%m)\n"); + + /* VIDIOC_G_INPUT */ + ioctl(-1, VIDIOC_G_INPUT, 0); + printf("ioctl(-1, VIDIOC_G_INPUT, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_INPUT, page); + printf("ioctl(-1, VIDIOC_G_INPUT, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_INPUT */ + ioctl(-1, VIDIOC_S_INPUT, 0); + printf("ioctl(-1, VIDIOC_S_INPUT, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_INPUT, p_int); + printf("ioctl(-1, VIDIOC_S_INPUT, [%u]) = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_CROPCAP */ + ioctl(-1, VIDIOC_CROPCAP, 0); + printf("ioctl(-1, VIDIOC_CROPCAP, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_cropcap *const p_v4l2_cropcap = + page + size - sizeof(*p_v4l2_cropcap); + ioctl(-1, VIDIOC_CROPCAP, p_v4l2_cropcap); + printf("ioctl(-1, VIDIOC_CROPCAP, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_cropcap->type); + + /* VIDIOC_G_CROP */ + ioctl(-1, VIDIOC_G_CROP, 0); + printf("ioctl(-1, VIDIOC_G_CROP, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_crop *const p_v4l2_crop = + page + size - sizeof(*p_v4l2_crop); + ioctl(-1, VIDIOC_G_CROP, p_v4l2_crop); + printf("ioctl(-1, VIDIOC_G_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_crop->type); + + /* VIDIOC_S_CROP */ + ioctl(-1, VIDIOC_S_CROP, 0); + printf("ioctl(-1, VIDIOC_S_CROP, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_CROP, p_v4l2_crop); + printf("ioctl(-1, VIDIOC_S_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", c={left=%d, top=%d, width=%u, height=%u}}) = -1 EBADF (%m)\n", + p_v4l2_crop->type, + p_v4l2_crop->c.left, + p_v4l2_crop->c.top, + p_v4l2_crop->c.width, + p_v4l2_crop->c.height); + +#ifdef VIDIOC_S_EXT_CTRLS + /* VIDIOC_S_EXT_CTRLS */ + ioctl(-1, VIDIOC_S_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_ext_controls *const p_ext_controls = + tail_alloc(sizeof(*p_ext_controls)); + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; + p_ext_controls->count = 0; + p_ext_controls->controls = (void *) -2UL; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_USER" + ", count=%u}) = -1 EBADF (%m)\n", p_ext_controls->count); + + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_MPEG; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_MPEG" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + +# if HAVE_DECL_V4L2_CTRL_TYPE_STRING + p_ext_controls->count = 2; + p_ext_controls->controls = + tail_alloc(sizeof(*p_ext_controls->controls) * p_ext_controls->count); + p_ext_controls->controls[0].id = V4L2_CID_BRIGHTNESS; + p_ext_controls->controls[0].size = 0; + p_ext_controls->controls[0].value64 = 0xfacefeeddeadbeefULL; + p_ext_controls->controls[1].id = V4L2_CID_CONTRAST; + p_ext_controls->controls[1].size = 2; + p_ext_controls->controls[1].string = + tail_alloc(p_ext_controls->controls[1].size); + + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + "] => controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + "], error_idx=%u}) = -1 EBADF (%m)\n", + p_ext_controls->count, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->error_idx); + + ++p_ext_controls->count; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + ", %p]}) = -1 EBADF (%m)\n", + p_ext_controls->count, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->controls + 2); +# endif /* HAVE_DECL_V4L2_CTRL_TYPE_STRING */ + + /* VIDIOC_TRY_EXT_CTRLS */ + ioctl(-1, VIDIOC_TRY_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_TRY_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; + p_ext_controls->count = magic; + p_ext_controls->controls = (void *) -2UL; + ioctl(-1, VIDIOC_TRY_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_TRY_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_USER, count=%u, controls=%p})" + " = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + + /* VIDIOC_G_EXT_CTRLS */ + ioctl(-1, VIDIOC_G_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_G_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_G_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_USER, count=%u, controls=%p" + ", error_idx=%u}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls, + p_ext_controls->error_idx); +#endif /* VIDIOC_S_EXT_CTRLS */ + +#ifdef VIDIOC_ENUM_FRAMESIZES + ioctl(-1, VIDIOC_ENUM_FRAMESIZES, 0); + printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_frmsizeenum *const p_frmsizeenum = + tail_alloc(sizeof(*p_frmsizeenum)); + p_frmsizeenum->index = magic; + p_frmsizeenum->pixel_format = fourcc(cc[0], cc[1], cc[2], cc[3]); + + ioctl(-1, VIDIOC_ENUM_FRAMESIZES, p_frmsizeenum); + printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, {index=%u" + ", pixel_format=v4l2_fourcc('%c', '\\%c', '\\%c', '\\x%x')})" + " = -1 EBADF (%m)\n", p_frmsizeenum->index, + cc[0], cc[1], cc[2], cc[3]); +#endif /* VIDIOC_ENUM_FRAMESIZES */ + +#ifdef VIDIOC_ENUM_FRAMEINTERVALS + ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, 0); + printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_frmivalenum *const p_v4l2_frmivalenum = + page + size - sizeof(*p_v4l2_frmivalenum); + ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, p_v4l2_frmivalenum); + printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, {index=%u" + ", pixel_format=v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", width=%u, height=%u}) = -1 EBADF (%m)\n", + p_v4l2_frmivalenum->index, + cc0(p_v4l2_frmivalenum->pixel_format), + cc1(p_v4l2_frmivalenum->pixel_format), + cc2(p_v4l2_frmivalenum->pixel_format), + cc3(p_v4l2_frmivalenum->pixel_format), + p_v4l2_frmivalenum->width, + p_v4l2_frmivalenum->height); +#endif /* VIDIOC_ENUM_FRAMEINTERVALS */ + +#ifdef VIDIOC_CREATE_BUFS + ioctl(-1, VIDIOC_CREATE_BUFS, 0); + printf("ioctl(-1, VIDIOC_CREATE_BUFS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_create_buffers *const p_v4l2_create_buffers = + page + size - sizeof(*p_v4l2_create_buffers); + ioctl(-1, VIDIOC_CREATE_BUFS, p_v4l2_create_buffers); + printf("ioctl(-1, VIDIOC_CREATE_BUFS, {count=%u, memory=%#x" + " /* V4L2_MEMORY_??? */, format={type=%#x" + " /* V4L2_BUF_TYPE_??? */}}) = -1 EBADF (%m)\n", + p_v4l2_create_buffers->count, + p_v4l2_create_buffers->memory, + p_v4l2_create_buffers->format.type); +#endif /* VIDIOC_CREATE_BUFS */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_v4l2.test b/tests-mx32/ioctl_v4l2.test new file mode 100755 index 00000000..a092a3cd --- /dev/null +++ b/tests-mx32/ioctl_v4l2.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic VIDIOC_* ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioperm.c b/tests-mx32/ioperm.c new file mode 100644 index 00000000..2f02b523 --- /dev/null +++ b/tests-mx32/ioperm.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_ioperm + +# include +# include + +int +main(void) +{ + const unsigned long port = (unsigned long) 0xdeafbeefffffffffULL; + + long rc = syscall(__NR_ioperm, port, 1, 0); + printf("ioperm(%#lx, %#lx, %d) = %ld %s (%m)\n", + port, 1UL, 0, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ioperm") + +#endif diff --git a/tests-mx32/ioperm.test b/tests-mx32/ioperm.test new file mode 100755 index 00000000..8c1c1cc7 --- /dev/null +++ b/tests-mx32/ioperm.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ioperm syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/iopl.c b/tests-mx32/iopl.c new file mode 100644 index 00000000..14ec29e3 --- /dev/null +++ b/tests-mx32/iopl.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_iopl + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_iopl, 4); + printf("iopl(4) = %ld %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_iopl") + +#endif diff --git a/tests-mx32/iopl.test b/tests-mx32/iopl.test new file mode 100755 index 00000000..d0b5b113 --- /dev/null +++ b/tests-mx32/iopl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check iopl syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-mx32/ioprio.c b/tests-mx32/ioprio.c new file mode 100644 index 00000000..44ace6c3 --- /dev/null +++ b/tests-mx32/ioprio.c @@ -0,0 +1,102 @@ +/* + * Check decoding of ioprio_get and ioprio_set syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_ioprio_get) && defined(__NR_ioprio_set) + +# include +# include + +enum { + IOPRIO_CLASS_NONE, + IOPRIO_CLASS_RT, + IOPRIO_CLASS_BE, + IOPRIO_CLASS_IDLE +}; + +# include "xlat.h" +# include "xlat/ioprio_class.h" + +void +print_ioprio(unsigned long val) +{ + printf(" (IOPRIO_PRIO_VALUE("); + printxval(ioprio_class, val >> 13, "IOPRIO_CLASS_???"); + printf(", %d))", (int) (val & 0x1fff)); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_which = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + static const kernel_ulong_t bogus_who = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_ioprio = + (kernel_ulong_t) 0xdec0ded1facefeedULL; + static const char * const bogus_ioprio_str = + "IOPRIO_PRIO_VALUE(0x7d677 /* IOPRIO_CLASS_??? */, 7917)"; + + long rc; + + rc = syscall(__NR_ioprio_get, bogus_which, bogus_who); + printf("ioprio_get(%#x /* IOPRIO_WHO_??? */, %d) = %s\n", + (int) bogus_which, (int) bogus_who, sprintrc(rc)); + + rc = syscall(__NR_ioprio_get, 1, 0); + printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", sprintrc(rc)); + + if (rc >= -1) + print_ioprio(rc); + + puts(""); + + rc = syscall(__NR_ioprio_set, 2, 0, 8191); + printf("ioprio_set(IOPRIO_WHO_PGRP, 0, " + "IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_ioprio_set, bogus_which, bogus_who, bogus_ioprio); + printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %s) = %s\n", + (int) bogus_which, (int) bogus_who, bogus_ioprio_str, + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ioprio_get && __NR_ioprio_set"); + +#endif diff --git a/tests-mx32/ioprio.test b/tests-mx32/ioprio.test new file mode 100755 index 00000000..e79310b3 --- /dev/null +++ b/tests-mx32/ioprio.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check iprio_get and iprio_set syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests-mx32/ip_mreq.c b/tests-mx32/ip_mreq.c new file mode 100644 index 00000000..fa0c504b --- /dev/null +++ b/tests-mx32/ip_mreq.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \ + && defined IPV6_JOIN_ANYCAST && defined HAVE_IF_INDEXTONAME + +# include +# include +# include +# include +# include + +int +main(void) +{ + static const char multi4addr[] = "224.0.0.3"; + static const char multi6addr[] = "ff01::c"; + static const char interface[] = "127.0.0.1"; + + struct ip_mreq *const m4 = tail_alloc(sizeof(*m4)); + struct ipv6_mreq *const m6 = tail_alloc(sizeof(*m6)); + unsigned int i; + int rc; + + inet_pton(AF_INET, multi4addr, &m4->imr_multiaddr); + inet_pton(AF_INET, interface, &m4->imr_interface); + inet_pton(AF_INET6, multi6addr, &m6->ipv6mr_multiaddr); + + m6->ipv6mr_interface = if_nametoindex("lo"); + if (!m6->ipv6mr_interface) + perror_msg_and_skip("lo"); + + (void) close(0); + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + + struct { + int level; + const char *str_level; + int optname; + const char *str_optname; + void *optval; + unsigned int optsize; + } short_any[] = { + { + ARG_STR(SOL_IP), ARG_STR(IP_ADD_MEMBERSHIP), + m4, sizeof(*m4) + }, + { + ARG_STR(SOL_IP), ARG_STR(IP_DROP_MEMBERSHIP), + m4, sizeof(*m4) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_ADD_MEMBERSHIP), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_DROP_MEMBERSHIP), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_JOIN_ANYCAST), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_LEAVE_ANYCAST), + m6, sizeof(*m6) + } + }; + + for (i = 0; i < ARRAY_SIZE(short_any); ++i) { + rc = setsockopt(0, short_any[i].level, short_any[i].optname, + short_any[i].optval, 1); + printf("setsockopt(0, %s, %s, \"\\%hho\", 1) = %s\n", + short_any[i].str_level, short_any[i].str_optname, + * (unsigned char *) short_any[i].optval, + sprintrc(rc)); + + rc = setsockopt(0, short_any[i].level, short_any[i].optname, + short_any[i].optval + 1, short_any[i].optsize); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + short_any[i].str_level, short_any[i].str_optname, + short_any[i].optval + 1, short_any[i].optsize, + sprintrc(rc)); + } + + struct { + int optname; + const char *str_optname; + } long_ip[] = { + { ARG_STR(IP_ADD_MEMBERSHIP) }, + { ARG_STR(IP_DROP_MEMBERSHIP) } + }, long_ipv6[] = { + { ARG_STR(IPV6_ADD_MEMBERSHIP) }, + { ARG_STR(IPV6_DROP_MEMBERSHIP) }, + { ARG_STR(IPV6_JOIN_ANYCAST) }, + { ARG_STR(IPV6_LEAVE_ANYCAST) } + }; + + for (i = 0; i < ARRAY_SIZE(long_ip); ++i) { + rc = setsockopt(0, SOL_IP, long_ip[i].optname, + m4, sizeof(*m4)); + printf("setsockopt(0, SOL_IP, %s" + ", {imr_multiaddr=inet_addr(\"%s\")" + ", imr_interface=inet_addr(\"%s\")}, %u) = %s\n", + long_ip[i].str_optname, multi4addr, + interface, (unsigned) sizeof(*m4), sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(long_ipv6); ++i) { + rc = setsockopt(0, SOL_IPV6, long_ipv6[i].optname, + m6, sizeof(*m6)); + printf("setsockopt(0, SOL_IPV6, %s" + ", {ipv6mr_multiaddr=inet_pton(\"%s\")" + ", ipv6mr_interface=if_nametoindex(\"lo\")}" + ", %u) = %s\n", + long_ipv6[i].str_optname, multi6addr, + (unsigned) sizeof(*m6), sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("IP_ADD_MEMBERSHIP && IPV6_ADD_MEMBERSHIP" + " && IPV6_JOIN_ANYCAST && HAVE_IF_INDEXTONAME") + +#endif diff --git a/tests-mx32/ip_mreq.test b/tests-mx32/ip_mreq.test new file mode 100755 index 00000000..d0a9e0f1 --- /dev/null +++ b/tests-mx32/ip_mreq.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check {IP,IPV6}_{ADD,DROP}_MEMBERSHIP setsockopt decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-mx32/ipc.c b/tests-mx32/ipc.c new file mode 100644 index 00000000..c64d3716 --- /dev/null +++ b/tests-mx32/ipc.c @@ -0,0 +1,122 @@ +/* + * Check decoding of ipc syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_ipc && defined HAVE_LINUX_IPC_H + +# include +# include +# include +# include + +# ifndef SEMCTL +# define SEMCTL 3 +# endif +# ifndef MSGRCV +# define MSGRCV 12 +# endif + +static int +ipc_call(const unsigned short version, const unsigned short call, + long a1, long a2, long a3, long a4, long a5) +{ + const unsigned long val = + (unsigned long) 0xfacefeed00000000ULL | + (unsigned int) version << 16 | + call; + + return syscall(__NR_ipc, val, a1, a2, a3, a4, a5); +} + +static int +ipc_call0(const unsigned short version, const unsigned short call) +{ + int rc = ipc_call(version, call, 0, 0, 0, 0, 0); + int saved_errno = errno; + printf("ipc("); + if (version) + printf("%hu<<16|", version); + errno = saved_errno; + printf("%hu, 0, 0, 0, 0%s) = %d %s (%m)\n", call, +# ifdef __s390__ + "", +# else + ", 0", +# endif + rc, errno2name()); + return rc; +} + +int +main(void) +{ + void *const efault = tail_alloc(1) + 1; + + int rc = ipc_call(0, SEMCTL, 0, 0, 0, (long) efault, 0); + if (rc != -1 || EFAULT != errno) + perror_msg_and_skip("ipc"); + printf("semctl(0, 0, IPC_RMID, %p) = -1 EFAULT (%m)\n", efault); + + unsigned short call; + for (call = 0; call <= 40; call += 10) { + ipc_call0(0, call); + ipc_call0(42, call); + } + + rc = ipc_call(42, SEMCTL, 0, 0, 0, (long) efault, 0); + int test_version = EFAULT == errno; + if (test_version) + printf("semctl(0, 0, IPC_RMID, %p) = %d %s (%m)\n", + efault, rc, errno2name()); + else + printf("ipc(42<<16|SEMCTL, 0, 0, 0, %p) = %d %s (%m)\n", + efault, rc, errno2name()); + + if (test_version) { + const int msqid = -2; + const long msgsz = -3; + const long msgtyp = 0; + + rc = ipc_call(1, MSGRCV, + msqid, msgsz, IPC_NOWAIT, (long) efault, msgtyp); + printf("msgrcv(%d, %p, %lu, %ld, IPC_NOWAIT) = %d %s (%m)\n", + msqid, efault, msgsz, msgtyp, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ipc && HAVE_LINUX_IPC_H") + +#endif diff --git a/tests-mx32/ipc.sh b/tests-mx32/ipc.sh new file mode 100644 index 00000000..752d4bb2 --- /dev/null +++ b/tests-mx32/ipc.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of ipc syscalls + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -eipc $args > "$OUT" +match_grep "$LOG" "$OUT" + +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/ipc.test b/tests-mx32/ipc.test new file mode 100755 index 00000000..aa33fa61 --- /dev/null +++ b/tests-mx32/ipc.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ipc syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/ipc_msg.c b/tests-mx32/ipc_msg.c new file mode 100644 index 00000000..b4938439 --- /dev/null +++ b/tests-mx32/ipc_msg.c @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resource_flags.h" + +/* + * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data + * provided in third argument of msgctl call (in case of IPC_SET cmd) + * which led to segmentation fault. + */ +#undef TEST_MSGCTL_BOGUS_ADDR +#if defined __GLIBC__ && defined POWERPC64 +# if !(defined __GLIBC_MINOR__) \ + || ((__GLIBC__ << 16) + __GLIBC_MINOR__ < (2 << 16) + 23) +# define TEST_MSGCTL_BOGUS_ADDR 0 +# endif +#endif /* __GLIBC__ && POWERPC64 */ + +#ifndef TEST_MSGCTL_BOGUS_ADDR +# define TEST_MSGCTL_BOGUS_ADDR 1 +#endif + +static int id = -1; + +static void +cleanup(void) +{ + msgctl(id, IPC_RMID, NULL); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_msgid = 0xfdb97531; + static const int bogus_cmd = 0xdeadbeef; +#if TEST_MSGCTL_BOGUS_ADDR + static void * const bogus_addr = (void *) -1L; +#endif + static const int bogus_flags = 0xface1e55 & ~IPC_CREAT; + + int rc; + struct msqid_ds ds; + + rc = msgget(bogus_key, bogus_flags); + printf("msgget\\(%#llx, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = msgget(private_key, 0600); + if (id < 0) + perror_msg_and_skip("msgget"); + printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = msgctl(bogus_msgid, bogus_cmd, NULL); + printf("msgctl\\(%d, (IPC_64\\|)?%#x /\\* MSG_\\?\\?\\? \\*/, NULL\\)" + " += %s\n", bogus_msgid, bogus_cmd, sprintrc_grep(rc)); + +#if TEST_MSGCTL_BOGUS_ADDR + rc = msgctl(bogus_msgid, IPC_SET, bogus_addr); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, %p\\) += %s\n", + bogus_msgid, bogus_addr, sprintrc_grep(rc)); +#endif + + if (msgctl(id, IPC_STAT, &ds)) + perror_msg_and_skip("msgctl IPC_STAT"); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u" + ", msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u" + ", msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\n", + id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + (unsigned) ds.msg_perm.mode, (unsigned) ds.msg_perm.__key, + (unsigned) ds.msg_perm.cuid, (unsigned) ds.msg_perm.cgid, + (unsigned) ds.msg_stime, (unsigned) ds.msg_rtime, + (unsigned) ds.msg_ctime, (unsigned) ds.msg_qnum, + (unsigned) ds.msg_qbytes, (unsigned) ds.msg_lspid, + (unsigned) ds.msg_lrpid); + + if (msgctl(id, IPC_SET, &ds)) + perror_msg_and_skip("msgctl IPC_SET"); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o\\}, ...\\}\\) += 0\n", + id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + (unsigned) ds.msg_perm.mode); + + rc = msgctl(0, MSG_INFO, &ds); + printf("msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %s\n", + &ds, sprintrc_grep(rc)); + + rc = msgctl(id, MSG_STAT, &ds); + printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests-mx32/ipc_msg.test b/tests-mx32/ipc_msg.test new file mode 100755 index 00000000..177495b0 --- /dev/null +++ b/tests-mx32/ipc_msg.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc msgget/msgctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_msgbuf.c b/tests-mx32/ipc_msgbuf.c new file mode 100644 index 00000000..1c34494d --- /dev/null +++ b/tests-mx32/ipc_msgbuf.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#define text_string "STRACE_STRING" +#define msgsz sizeof(text_string) + +static int msqid = -1; + +static void +cleanup(void) +{ + msgctl(msqid, IPC_RMID, 0); + msqid = -1; +} + +int +main (void) +{ + const long mtype = 0xdefaced; + struct { + kernel_long_t mtype; + char mtext[msgsz]; + } msg = { + .mtype = mtype, + .mtext = text_string + }; + msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); + if (msqid == -1) + perror_msg_and_skip("msgget"); + atexit(cleanup); + if (msgsnd(msqid, &msg, msgsz, 0) == -1) + perror_msg_and_skip("msgsnd"); + if (msgrcv(msqid, &msg, msgsz, mtype, 0) != msgsz) + perror_msg_and_skip("msgrcv"); + return 0; +} diff --git a/tests-mx32/ipc_msgbuf.expected b/tests-mx32/ipc_msgbuf.expected new file mode 100644 index 00000000..880424bf --- /dev/null +++ b/tests-mx32/ipc_msgbuf.expected @@ -0,0 +1,4 @@ +msgget\(IPC_PRIVATE, IPC_CREAT\|0700\) += [0-9]* +msgsnd\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 0\) += 0 +msgrcv\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 233811181, 0\) += 14 +msgctl\([0-9]*, (IPC_64\|)?IPC_RMID, NULL\) += 0 diff --git a/tests-mx32/ipc_msgbuf.test b/tests-mx32/ipc_msgbuf.test new file mode 100755 index 00000000..d0b65d1a --- /dev/null +++ b/tests-mx32/ipc_msgbuf.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check msgget, msgsnd, msgrcv, msgctl syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -v -e msgget,msgsnd,msgrcv,msgctl $args +match_grep + +exit 0 diff --git a/tests-mx32/ipc_sem.c b/tests-mx32/ipc_sem.c new file mode 100644 index 00000000..8f6382cc --- /dev/null +++ b/tests-mx32/ipc_sem.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2015 Andreas Schwab + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resource_flags.h" + +union semun { + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO + (Linux-specific) */ +}; + +static int id = -1; + +static void +cleanup(void) +{ + semctl(id, 0, IPC_RMID, 0); + printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_RMID, \\[?NULL\\]?\\) += 0\n", + id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_semid = 0xfdb97531; + static const int bogus_semnum = 0xeca86420; + static const int bogus_size = 0xdec0ded1; + static const int bogus_flags = 0xface1e55; + static const int bogus_cmd = 0xdeadbeef; + static const unsigned long bogus_arg = + (unsigned long) 0xbadc0dedfffffaceULL; + + int rc; + union semun un; + struct semid_ds ds; + struct seminfo info; + + rc = semget(bogus_key, bogus_size, bogus_flags); + printf("semget\\(%#llx, %d, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), bogus_size, + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = semget(private_key, 1, 0600); + if (id < 0) + perror_msg_and_skip("semget"); + printf("semget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = semctl(bogus_semid, bogus_semnum, bogus_cmd, bogus_arg); +#define SEMCTL_BOGUS_ARG_FMT "(%#lx|\\[(%#lx|NULL)\\]|NULL)" + printf("semctl\\(%d, %d, (IPC_64\\|)?%#x /\\* SEM_\\?\\?\\? \\*/" + ", " SEMCTL_BOGUS_ARG_FMT "\\) += %s\n", + bogus_semid, bogus_semnum, bogus_cmd, + bogus_arg, bogus_arg, sprintrc_grep(rc)); + + un.buf = &ds; + if (semctl(id, 0, IPC_STAT, un)) + perror_msg_and_skip("semctl IPC_STAT"); + printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_STAT, \\[?%p\\]?\\) += 0\n", + id, &ds); + + un.__buf = &info; + rc = semctl(0, 0, SEM_INFO, un); + printf("semctl\\(0, 0, (IPC_64\\|)?SEM_INFO, \\[?%p\\]?\\) += %s\n", + &info, sprintrc_grep(rc)); + + un.buf = &ds; + rc = semctl(id, 0, SEM_STAT, un); + printf("semctl\\(%d, 0, (IPC_64\\|)?SEM_STAT, \\[?%p\\]?\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests-mx32/ipc_sem.test b/tests-mx32/ipc_sem.test new file mode 100755 index 00000000..cc93d07b --- /dev/null +++ b/tests-mx32/ipc_sem.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc semget/semctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_shm.c b/tests-mx32/ipc_shm.c new file mode 100644 index 00000000..66960ff9 --- /dev/null +++ b/tests-mx32/ipc_shm.c @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/shm_resource_flags.h" + +static int id = -1; + +static void +cleanup(void) +{ + shmctl(id, IPC_RMID, NULL); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_id = 0xdefaced1; + static const int bogus_cmd = 0xdefaced2; + static void * const bogus_addr = (void *) -1L; + static const size_t bogus_size = + /* + * musl sets size to SIZE_MAX if size argument is greater than + * PTRDIFF_MAX - musl/src/ipc/shmget.c + */ + #ifdef __GLIBC__ + (size_t) 0xdec0ded1dec0ded2ULL; + #else + (size_t) 0x1e55c0de5dec0dedULL; + #endif + static const int bogus_flags = 0xface1e55; + + int rc; + struct shmid_ds ds; + + rc = shmget(bogus_key, bogus_size, bogus_flags); + printf("shmget\\(%#llx, %zu, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), bogus_size, + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + SHM_HUGETLB & bogus_flags ? "SHM_HUGETLB\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | SHM_HUGETLB), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = shmget(private_key, 1, 0600); + if (id < 0) + perror_msg_and_skip("shmget"); + printf("shmget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = shmctl(bogus_id, bogus_cmd, NULL); + printf("shmctl\\(%d, (IPC_64\\|)?%#x /\\* SHM_\\?\\?\\? \\*/, NULL\\)" + " += %s\n", bogus_id, bogus_cmd, sprintrc_grep(rc)); + + rc = shmctl(bogus_id, IPC_STAT, bogus_addr); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_STAT, %p\\) += %s\n", + bogus_id, bogus_addr, sprintrc_grep(rc)); + + if (shmctl(id, IPC_STAT, &ds)) + perror_msg_and_skip("shmctl IPC_STAT"); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{shm_perm=\\{uid=%u, gid=%u, " + "mode=%#o, key=%u, cuid=%u, cgid=%u\\}, shm_segsz=%u, shm_cpid=%u, " + "shm_lpid=%u, shm_nattch=%u, shm_atime=%u, shm_dtime=%u, " + "shm_ctime=%u\\}\\) += 0\n", + id, (unsigned) ds.shm_perm.uid, (unsigned) ds.shm_perm.gid, + (unsigned) ds.shm_perm.mode, (unsigned) ds.shm_perm.__key, + (unsigned) ds.shm_perm.cuid, (unsigned) ds.shm_perm.cgid, + (unsigned) ds.shm_segsz, (unsigned) ds.shm_cpid, + (unsigned) ds.shm_lpid, (unsigned) ds.shm_nattch, + (unsigned) ds.shm_atime, (unsigned) ds.shm_dtime, + (unsigned) ds. shm_ctime); + + if (shmctl(id, IPC_SET, &ds)) + perror_msg_and_skip("shmctl IPC_SET"); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_SET, \\{shm_perm=\\{uid=%u, gid=%u" + ", mode=%#o\\}, ...\\}\\) += 0\n", + id, (unsigned) ds.shm_perm.uid, (unsigned) ds.shm_perm.gid, + (unsigned) ds.shm_perm.mode); + + rc = shmctl(0, SHM_INFO, &ds); + printf("shmctl\\(0, (IPC_64\\|)?SHM_INFO, %p\\) += %s\n", + &ds, sprintrc_grep(rc)); + + rc = shmctl(id, SHM_STAT, &ds); + printf("shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests-mx32/ipc_shm.test b/tests-mx32/ipc_shm.test new file mode 100755 index 00000000..a67ea291 --- /dev/null +++ b/tests-mx32/ipc_shm.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc shmget/shmctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/kcmp.c b/tests-mx32/kcmp.c new file mode 100644 index 00000000..cb497c9f --- /dev/null +++ b/tests-mx32/kcmp.c @@ -0,0 +1,103 @@ +/* + * Check decoding of kcmp syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include "scno.h" + +#ifdef __NR_kcmp + +# include +# include + +# define KCMP_FILE 0 +# define KCMP_SYSVSEM 6 + +static void +do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, + const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2) +{ + long rc; + const char *errstr; + + rc = syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2); + errstr = sprintrc(rc); + + printf("kcmp(%d, %d, ", (int) pid1, (int) pid2); + + if (type_str) + printf("%s", type_str); + else + printf("%#x /* KCMP_??? */", (int) type); + + if (type == KCMP_FILE) + printf(", %u, %u", (unsigned) idx1, (unsigned) idx2); + else if (type > KCMP_SYSVSEM) + printf(", %#llx, %#llx", + (unsigned long long) idx1, (unsigned long long) idx2); + + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_pid1 = + (kernel_ulong_t) 0xdeadca75face1057ULL; + static const kernel_ulong_t bogus_pid2 = + (kernel_ulong_t) 0xdefaced1defaced2ULL; + static const kernel_ulong_t bogus_type = + (kernel_ulong_t) 0xbadc0dedda7adeadULL; + static const kernel_ulong_t bogus_idx1 = + (kernel_ulong_t) 0xdec0ded3dec0ded4ULL; + static const kernel_ulong_t bogus_idx2 = + (kernel_ulong_t) 0xba5e1e55deadc0deULL; + + /* Invalid values */ + do_kcmp(bogus_pid1, bogus_pid2, bogus_type, NULL, bogus_idx1, + bogus_idx2); + do_kcmp(0, 0, KCMP_SYSVSEM + 1, NULL, 0, 0); + + /* KCMP_FILE is the only type which has additional args */ + do_kcmp(3141592653U, 2718281828U, ARG_STR(KCMP_FILE), bogus_idx1, + bogus_idx2); + /* Some type without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_SYSVSEM), bogus_idx1, bogus_idx2); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kcmp"); + +#endif diff --git a/tests-mx32/kcmp.test b/tests-mx32/kcmp.test new file mode 100755 index 00000000..d022aeba --- /dev/null +++ b/tests-mx32/kcmp.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kcmp syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/kexec_file_load.c b/tests-mx32/kexec_file_load.c new file mode 100644 index 00000000..be90a37d --- /dev/null +++ b/tests-mx32/kexec_file_load.c @@ -0,0 +1,127 @@ +/* + * Check decoding of kexec_file_load syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_kexec_file_load + +# include +# include +# include + +struct strval { + kernel_ulong_t val; + const char *str64; + const char *str32; + const char *str; +}; + +#define CMDLINE_STR "deadcodebaddatadefaced"; + +int +main(void) +{ + static const kernel_ulong_t bogus_kernel_fd = + (kernel_ulong_t) 0xdeadca57badda7a1ULL; + static const kernel_ulong_t bogus_initrd_fd = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + static const char cmdline_str[] = CMDLINE_STR; + static const char cmdline_short_str[] = "abcdef"; + + static const kernel_ulong_t cmdline_lens[] = { + 0, + (kernel_ulong_t) 0xcaffeeeddeadbeefULL, + sizeof(cmdline_str), + sizeof(cmdline_str) - 1, + sizeof(cmdline_short_str), + sizeof(cmdline_short_str) - 1, + sizeof(cmdline_short_str) + 1, + }; + static const struct strval flags[] = { + { (kernel_ulong_t) 0xbadc0dedda7a1058ULL, + "0xbadc0ded", "0x", + "da7a1058 /* KEXEC_FILE_??? */" }, + { 0, "", "", "0" }, + { 0xdeadbeef, "", "", "KEXEC_FILE_UNLOAD|KEXEC_FILE_ON_CRASH|" + "KEXEC_FILE_NO_INITRAMFS|0xdeadbee8" }, + }; + + + long rc; + char *cmdline = tail_memdup(cmdline_str, sizeof(cmdline_str)); + char *cmdline_short = + tail_memdup(cmdline_short_str, sizeof(cmdline_short_str)); + char cmdline_ptr[sizeof("0x") + sizeof(void *) * 2]; + char cmdline_short_ptr[sizeof("0x") + sizeof(void *) * 2]; + unsigned int i; + unsigned int j; + + struct strval cmdlines[] = { + { (uintptr_t) NULL, "", "", "NULL" }, + { (uintptr_t) (cmdline + sizeof(cmdline_str)), "", "", + cmdline_ptr }, + { (uintptr_t) cmdline, "", "", "\"deadcodeb\"..." }, + { (uintptr_t) cmdline, "", "", "\"deadcodeb\"..." }, + { (uintptr_t) cmdline_short, "", "", "\"abcdef\\0\"" }, + { (uintptr_t) cmdline_short, "", "", "\"abcdef\"" }, + { (uintptr_t) cmdline_short, "", "", cmdline_short_ptr }, + }; + + + snprintf(cmdline_ptr, sizeof(cmdline_ptr), "%p", + cmdline + sizeof(cmdline_str)); + snprintf(cmdline_short_ptr, sizeof(cmdline_short_ptr), "%p", + cmdline_short); + + for (i = 0; i < ARRAY_SIZE(flags); i++) { + for (j = 0; j < ARRAY_SIZE(cmdlines); j++) { + rc = syscall(__NR_kexec_file_load, bogus_kernel_fd, + bogus_initrd_fd, cmdline_lens[j], + cmdlines[j].val, flags[i].val); + printf("kexec_file_load(%d, %d, %llu, %s, %s%s) = %s\n", + (int) bogus_kernel_fd, (int) bogus_initrd_fd, + (unsigned long long) cmdline_lens[j], + cmdlines[j].str, + sizeof(kernel_ulong_t) == 8 ? flags[i].str64 : + flags[i].str32, flags[i].str, sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kexec_file_load"); + +#endif diff --git a/tests-mx32/kexec_file_load.test b/tests-mx32/kexec_file_load.test new file mode 100755 index 00000000..c95e1238 --- /dev/null +++ b/tests-mx32/kexec_file_load.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kexec_file_load syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-mx32/kexec_load.c b/tests-mx32/kexec_load.c new file mode 100644 index 00000000..330238de --- /dev/null +++ b/tests-mx32/kexec_load.c @@ -0,0 +1,170 @@ +/* + * Check decoding of kexec_load syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_kexec_load + +# include +# include + +struct strval { + kernel_ulong_t val; + const char *str64; + const char *str32; + const char *str; +}; + +struct segm { + void *buf; + size_t bufsz; + void *mem; + size_t memsz; +}; + +int +main(void) +{ + enum { + NUM_SEGMS = 17, + NUM_SEGMS_UNCUT = 5, + NUM_SEGMS_UNCUT_MAX = 9, + NUM_SEGMS_CUT = 12, + SEGMS_ARRAY_SIZE = sizeof(struct segm) * NUM_SEGMS, + }; + + static const kernel_ulong_t bogus_zero = + sizeof(long) < sizeof(kernel_long_t) ? + (kernel_ulong_t) 0xffffffff00000000ULL : 0; + static const kernel_ulong_t bogus_entry = + (kernel_ulong_t) 0xdeadca57badda7a1ULL; + static const kernel_ulong_t bogus_nsegs = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + + static const struct strval flags[] = { + { (kernel_ulong_t) 0xbadc0dedda7a1054ULL, + "0xda7a0000 /* KEXEC_ARCH_??? */|0xbadc0ded0000", + "0xda7a0000 /* KEXEC_ARCH_??? */|0x", + "1054 /* KEXEC_??? */" }, + { 0, "", "", "KEXEC_ARCH_DEFAULT" }, + { 0x2a0003, "", "", + "KEXEC_ARCH_SH|KEXEC_ON_CRASH|KEXEC_PRESERVE_CONTEXT" }, + { 0xdead0000, "", "", "0xdead0000 /* KEXEC_ARCH_??? */" }, + }; + + const char *errstr; + long rc; + struct segm *segms = tail_alloc(SEGMS_ARRAY_SIZE); + unsigned int i; + + fill_memory(segms, SEGMS_ARRAY_SIZE); + segms[0].buf = segms[0].mem = NULL; + + rc = syscall(__NR_kexec_load, bogus_zero, bogus_zero, bogus_zero, + flags[0].val); + printf("kexec_load(NULL, 0, NULL, %s%s) = %s\n", + sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, + flags[0].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, bogus_nsegs, + segms + SEGMS_ARRAY_SIZE, flags[1].val); + printf("kexec_load(%#lx, %lu, %p, %s) = %s\n", + (unsigned long) bogus_entry, (unsigned long) bogus_nsegs, + segms + SEGMS_ARRAY_SIZE, flags[1].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS, + segms, flags[2].val); + printf("kexec_load(%#lx, %lu, %p, %s) = %s\n", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS, + segms, flags[2].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms, flags[3].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [{buf=NULL, bufsz=%zu, mem=NULL, " + "memsz=%zu}, ", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT, + segms[0].bufsz, segms[0].memsz); + for (i = 1; i < NUM_SEGMS_UNCUT_MAX; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("...], %s) = %s\n", flags[3].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms + (NUM_SEGMS - NUM_SEGMS_UNCUT_MAX), + flags[0].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT); + for (i = NUM_SEGMS - NUM_SEGMS_UNCUT_MAX; i < NUM_SEGMS; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("%p], %s%s) = %s\n", + segms + NUM_SEGMS, + sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, + flags[0].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_UNCUT, + segms + (NUM_SEGMS - NUM_SEGMS_UNCUT), + flags[1].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_UNCUT); + for (i = NUM_SEGMS - NUM_SEGMS_UNCUT; i < NUM_SEGMS; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}%s", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz, + (i == NUM_SEGMS - 1) ? "" : ", "); + printf("], %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms + 1, flags[2].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT); + for (i = 1; i < NUM_SEGMS_UNCUT_MAX + 1; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("...], %s) = %s\n", flags[2].str, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kexec_load"); + +#endif diff --git a/tests-mx32/kexec_load.test b/tests-mx32/kexec_load.test new file mode 100755 index 00000000..4b1511e9 --- /dev/null +++ b/tests-mx32/kexec_load.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kexec_load syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-mx32/keyctl.c b/tests-mx32/keyctl.c new file mode 100644 index 00000000..2e26076b --- /dev/null +++ b/tests-mx32/keyctl.c @@ -0,0 +1,820 @@ +/* + * Check decoding of keyctl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_keyctl + +# include +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +/* This check should be before #include "xlat/keyctl_commands.h" */ +# ifndef KEYCTL_DH_COMPUTE +struct keyctl_dh_params { + int32_t private; + int32_t prime; + int32_t base; +}; +# endif + +# include "xlat.h" +# include "xlat/keyctl_commands.h" + +# ifndef KEY_SPEC_REQKEY_AUTH_KEY +# define KEY_SPEC_REQKEY_AUTH_KEY -7 +# endif + +# ifndef KEY_SPEC_REQUESTOR_KEYRING +# define KEY_SPEC_REQUESTOR_KEYRING -8 +# endif + +static const size_t limit = 10; + +/* + * Well, this is true for DESCRIBE and GET_SECURITY, and false for READ and + * DH_COMPUTE and I see no ability to pass this information without + * significantly breaking interface. + */ +bool nul_terminated_buf = true; +bool buf_in_arg = false; + +/* + * When this is called with positive size, the buffer provided is an "out" + * argument and rc contains resulting size (globally defined nul_terminated_buf + * controls whether it is nul-terminated or not). If size is negative, + * it contains "in" argument. + */ +void +print_quoted_string_limit(const char *str, size_t size, long rc) +{ + size_t print_size = ((rc >= 0) && (size > 0)) ? + ((unsigned long) rc > size ? size : + (unsigned long) rc) : size; + size_t limited_size = print_size > limit ? limit : print_size; + + if ((rc == -1) && !buf_in_arg) { + printf("%p", str); + return; + } + + if (!nul_terminated_buf || + (strnlen(str, limited_size) == limited_size)) { + printf("\""); + print_quoted_memory(str, limited_size); + if (print_size > limit) + printf("\"..."); + else + printf("\""); + } else { + printf("\""); + print_quoted_string(str); + printf("\""); + } +} + +static void +print_arg(kernel_ulong_t arg, const char *str, const char *fmt, size_t size, + long rc) +{ + if (size == (size_t) -1) + size = 0; + + if (str) { + printf("%s", str); + } else { + if (size == sizeof(uint64_t)) + printf(fmt, (uint64_t)arg); + else if (size == sizeof(uint32_t)) + printf(fmt, (uint32_t)arg); + else + print_quoted_string_limit((void *) (uintptr_t) arg, + size, rc); + } +} + +/* + * Arguments are passed as sz, val, str, fmt. Arguments are read until 4 + * arguments are retrieved or size of 0 is occurred. + * + * str == NULL && fmt == NULL && sz not in {4, 8} - print_quoted_string_limit is + * used for argument printing. If sz is negative, in argument is assumed, out + * otherwise. + */ +void +do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) +{ + kernel_ulong_t args[4] = { + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, + }; + const char *arg_str[4] = { NULL }; + const char *arg_fmt[4] = { "%llu", "%llu", "%llu", "%llu" }; + size_t arg_sz[4] = { + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + }; + unsigned i; + unsigned cnt = 0; + + va_list ap; + + va_start(ap, cmd_str); + + do { + arg_sz[cnt] = va_arg(ap, size_t); + if (!arg_sz[cnt]) + break; + + if (arg_sz[cnt] == sizeof(uint64_t)) + args[cnt] = va_arg(ap, uint64_t); + else if (arg_sz[cnt] == sizeof(uint32_t)) + args[cnt] = va_arg(ap, uint32_t); + else + args[cnt] = (uintptr_t) va_arg(ap, void *); + + arg_str[cnt] = va_arg(ap, char *); + arg_fmt[cnt] = va_arg(ap, char *); + } while (++cnt < 4); + + long rc = syscall(__NR_keyctl, cmd, args[0], args[1], args[2], args[3]); + const char *errstr = sprintrc(rc); + printf("keyctl(%s", cmd_str); + for (i = 0; i < cnt; i++) { + printf(", "); + print_arg(args[i], arg_str[i], arg_fmt[i], arg_sz[i], rc); + } + printf(") = %s\n", errstr); +} + +int +main(void) +{ + enum { PR_LIMIT = 10, IOV_SIZE = 11, IOV_STR_SIZE = 4096 }; + + static const char *kulong_fmt = + sizeof(kernel_ulong_t) == sizeof(uint64_t) ? "%#llx" : "%#x"; + static const char *ksize_fmt = + sizeof(kernel_ulong_t) == sizeof(uint64_t) ? "%llu" : "%u"; + static const char *ptr_fmt = + sizeof(void *) == sizeof(uint64_t) ? "%#llx" : "%#x"; + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char short_type_str[] = "shrt type"; + static const char short_desc_str[] = "shrt desc"; + static const char long_type_str[] = "overly long key type"; + static const char long_desc_str[] = "overly long key description"; + static const int32_t bogus_key1 = 0xdeadf00d; + static const int32_t bogus_key2 = 0x1eefdead; + static const kernel_ulong_t bogus_key3 = + (kernel_ulong_t) 0xdec0ded1dec0ded2ULL; + static const char *bogus_key3_str = "-557785390"; + + static const struct keyctl_dh_params kcdhp_data = { + KEY_SPEC_GROUP_KEYRING, 1234567890, 3141592653U }; + static const char *kcdhp_str = "{private=KEY_SPEC_GROUP_KEYRING, " + "prime=1234567890, base=-1153374643}"; + + char *bogus_str = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *short_type = tail_memdup(short_type_str, sizeof(short_type_str)); + char *short_desc = tail_memdup(short_desc_str, sizeof(short_desc_str)); + char *long_type = tail_memdup(long_type_str, sizeof(long_type_str)); + char *long_desc = tail_memdup(long_desc_str, sizeof(long_desc_str)); + char *kcdhp = tail_memdup(&kcdhp_data, sizeof(kcdhp_data)); + struct iovec *key_iov = tail_alloc(sizeof(*key_iov) * IOV_SIZE); + char *bogus_buf1 = tail_alloc(9); + char *bogus_buf2 = tail_alloc(256); + char *key_iov_str1; + char *key_iov_str2 = tail_alloc(4096); + ssize_t ret; + ssize_t kis_size = 0; + int i; + + key_iov[0].iov_base = short_type; + key_iov[0].iov_len = sizeof(short_type_str); + key_iov[1].iov_base = long_type; + key_iov[1].iov_len = sizeof(long_type_str); + key_iov[2].iov_base = short_desc; + key_iov[2].iov_len = sizeof(short_desc_str); + key_iov[3].iov_base = long_desc; + key_iov[3].iov_len = sizeof(long_desc_str); + key_iov[4].iov_base = bogus_str; + key_iov[4].iov_len = 32; + + for (i = 5; i < IOV_SIZE; i++) { + key_iov[i].iov_base = + (void *) (uintptr_t) (0xfffffacefffff00dULL + + 0x100000001ULL * i); + key_iov[i].iov_len = (size_t) (0xcaffeeeddefaced7ULL + + 0x100000001ULL * i); + } + + ret = asprintf(&key_iov_str1, "[{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}]", + key_iov[IOV_SIZE - 4].iov_base, + key_iov[IOV_SIZE - 4].iov_len, + key_iov[IOV_SIZE - 3].iov_base, + key_iov[IOV_SIZE - 3].iov_len, + key_iov[IOV_SIZE - 2].iov_base, + key_iov[IOV_SIZE - 2].iov_len, + key_iov[IOV_SIZE - 1].iov_base, + key_iov[IOV_SIZE - 1].iov_len); + + if (ret < 0) + error_msg_and_fail("asprintf"); + + ret = snprintf(key_iov_str2, IOV_STR_SIZE, + "[{iov_base=\"%s\\0\", iov_len=%zu}, " + "{iov_base=\"%.10s\"..., iov_len=%zu}, " + "{iov_base=\"%s\\0\", iov_len=%zu}, " + "{iov_base=\"%.10s\"..., iov_len=%zu}, ", + (char *) key_iov[0].iov_base, key_iov[0].iov_len, + (char *) key_iov[1].iov_base, key_iov[1].iov_len, + (char *) key_iov[2].iov_base, key_iov[2].iov_len, + (char *) key_iov[3].iov_base, key_iov[3].iov_len); + + if ((ret < 0) || (ret >= IOV_STR_SIZE)) + error_msg_and_fail("snprintf"); + + for (i = 4; i < PR_LIMIT; i++) { + kis_size += ret; + + ret = snprintf(key_iov_str2 + kis_size, IOV_STR_SIZE - kis_size, + "{iov_base=%p, iov_len=%zu}, ", + key_iov[i].iov_base, key_iov[i].iov_len); + + if ((ret < 0) || (ret >= (IOV_STR_SIZE - kis_size))) + error_msg_and_fail("snprintf"); + } + + kis_size += ret; + snprintf(key_iov_str2 + kis_size, IOV_STR_SIZE - kis_size, "...]"); + + + /* Invalid command */ + do_keyctl((kernel_ulong_t) 0xbadc0dedfacefeedULL, + "0xfacefeed /* KEYCTL_??? */", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, kulong_fmt); + + + /* GET_KEYRING_ID */ + do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", + NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", + sizeof(int), 3141592653U, NULL, "%d", + NULL, 0UL); + + + /* KEYCTL_JOIN_SESSION_KEYRING */ + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), ARG_STR(NULL), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), bogus_str, NULL, ptr_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), ARG_STR("bogus name"), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), "very long keyring name", "\"very long \"...", + NULL, 0UL); + + + /* KEYCTL_UPDATE */ + + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(short_desc_str) - 1, NULL, + ksize_fmt, + 0UL); + + buf_in_arg = false; + + + /* KEYCTL_REVOKE */ + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_CHOWN */ + do_keyctl(ARG_STR(KEYCTL_CHOWN), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(uid_t), ARG_STR(-1), NULL, + sizeof(gid_t), ARG_STR(-1), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_CHOWN), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(gid_t), 3141592653U, NULL, "%u", 0UL); + + + /* KEYCTL_SETPERM */ + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, + sizeof(uint32_t), 0xffffffffU, + "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" + "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" + "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" + "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" + "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" + "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" + "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" + "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" + "0xc0c0c0c0", NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%#x", 0UL); + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(uint32_t), 0xc0c0c0c0, "0xc0c0c0c0 /* KEY_??? */", + NULL, + 0UL); + + + /* KEYCTL_DESCRIBE */ + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + + /* KEYCTL_CLEAR */ + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_LINK */ + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_UNLINK */ + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_SEARCH */ + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_USER_SESSION_KEYRING), + NULL); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(char *), bogus_desc, NULL, ptr_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_type, NULL, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), 0, NULL, "%d", + sizeof(long_type_str), long_type, NULL, NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + + buf_in_arg = false; + + + /* KEYCTL_READ */ + nul_terminated_buf = false; + + /* Empty result is expected for these */ + bogus_buf1[0] = '\377'; + bogus_buf2[0] = '\377'; + + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + nul_terminated_buf = true; + + /* KEYCTL_INSTANTIATE */ + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), 0, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, + ksize_fmt, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + + buf_in_arg = false; + + + /* KEYCTL_NEGATE */ + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(int32_t), 0, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_SET_REQKEY_KEYRING */ + do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(int32_t), ARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, + 0UL); + /* + * Keep it commented out until proper way of faking syscalls is not + * implemented. + */ + /* do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(int32_t), + ARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ + do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, + "0xbadc0ded /* KEY_REQKEY_DEFL_??? */", NULL, 0UL); + + + /* KEYCTL_SET_TIMEOUT */ + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + 0UL); + + + /* KEYCTL_ASSUME_AUTHORITY */ + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_GET_SECURITY */ + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + + /* KEYCTL_SESSION_TO_PARENT */ + do_keyctl(ARG_STR(KEYCTL_SESSION_TO_PARENT), 0UL); + + + /* KEYCTL_REJECT */ + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", + sizeof(uint32_t), 2718281828U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(uint32_t), ARG_STR(ENODEV), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + + + /* KEYCTL_INSTANTIATE_IOV */ + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), 0, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), key_iov + IOV_SIZE, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(key_iov), key_iov + IOV_SIZE - 4, key_iov_str1, NULL, + sizeof(kernel_ulong_t), (kernel_ulong_t) 4, NULL, + ksize_fmt, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(key_iov), key_iov, key_iov_str2, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) IOV_SIZE, NULL, ksize_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + + + /* KEYCTL_INVALIDATE */ + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_GET_PERSISTENT */ + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), ARG_STR(-1), NULL, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_DH_COMPUTE */ + nul_terminated_buf = false; + + /* Empty result is expected for these */ + bogus_buf1[0] = '\377'; + bogus_buf2[0] = '\377'; + + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(char *), kcdhp + 1, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff157ffffdeadULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -1, NULL, ksize_fmt, 0UL); + + nul_terminated_buf = true; + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_keyctl"); + +#endif diff --git a/tests-mx32/keyctl.test b/tests-mx32/keyctl.test new file mode 100755 index 00000000..875a82d3 --- /dev/null +++ b/tests-mx32/keyctl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of keyctl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 diff --git a/tests-mx32/kill.c b/tests-mx32/kill.c new file mode 100644 index 00000000..cb884aa1 --- /dev/null +++ b/tests-mx32/kill.c @@ -0,0 +1,79 @@ +/* + * Check decoding of kill syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Fei Jie + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_kill + +# include +# include +# include + +static void +handler(int sig) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const int pid = getpid(); + long rc = syscall(__NR_kill, pid, (long) 0xdefaced00000000ULL | SIGALRM); + printf("kill(%d, SIGALRM) = %ld\n", pid, rc); + + const long big_pid = (long) 0xfacefeedbadc0dedULL; + const long big_sig = (long) 0xdeadbeefcafef00dULL; + rc = syscall(__NR_kill, big_pid, big_sig); + printf("kill(%d, %d) = %ld %s (%m)\n", + (int) big_pid, (int) big_sig, rc, errno2name()); + + rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0); + printf("kill(%d, SIG_0) = %ld\n", pid, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kill") + +#endif diff --git a/tests-mx32/kill.test b/tests-mx32/kill.test new file mode 100755 index 00000000..7a3a51aa --- /dev/null +++ b/tests-mx32/kill.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kill syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -esignal=none diff --git a/tests-mx32/ksysent.c b/tests-mx32/ksysent.c new file mode 100644 index 00000000..8cac93ca --- /dev/null +++ b/tests-mx32/ksysent.c @@ -0,0 +1,128 @@ +/* + * Validate syscallent.h file. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "sysent.h" +#include +#include +#include + +#define TD 0 +#define TF 0 +#define TI 0 +#define TN 0 +#define TP 0 +#define TS 0 +#define TM 0 +#define NF 0 +#define MA 0 +#define SI 0 +#define SE 0 +#define CST 0 +#define SEN(arg) 0,0 + +static const struct_sysent syscallent[] = { +#include "syscallent.h" +}; + +typedef const char *pstr_t; +static const pstr_t ksyslist[] = { +#include "ksysent.h" +}; + +int +main(void) +{ + int rc = 0; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(ksyslist); ++i) { + if (!ksyslist[i]) + continue; + if (i >= ARRAY_SIZE(syscallent) || !syscallent[i].sys_name) { + fprintf(stderr, "warning: \"%s\" syscall #%u" + " is missing in syscallent.h\n", + ksyslist[i], i); + continue; + } +#ifdef SYS_socket_nsubcalls + if (i >= SYS_socket_subcall && + i < SYS_socket_subcall + SYS_socket_nsubcalls) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is a socket subcall in syscallent.h\n", + ksyslist[i], i); + rc = 1; + continue; + } +#endif +#ifdef SYS_ipc_nsubcalls + if (i >= SYS_ipc_subcall && + i < SYS_ipc_subcall + SYS_ipc_nsubcalls) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is an ipc subcall in syscallent.h\n", + ksyslist[i], i); + rc = 1; + continue; + } +#endif + if (strcmp(ksyslist[i], syscallent[i].sys_name)) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is \"%s\" in syscallent.h\n", + ksyslist[i], i, syscallent[i].sys_name); + rc = 1; + continue; + } + } + + for (i = 0; i < ARRAY_SIZE(syscallent); ++i) { + if (!syscallent[i].sys_name +#ifdef SYS_socket_nsubcalls + || (i >= SYS_socket_subcall && + i < SYS_socket_subcall + SYS_socket_nsubcalls) +#endif +#ifdef SYS_ipc_nsubcalls + || (i >= SYS_ipc_subcall && + i < SYS_ipc_subcall + SYS_ipc_nsubcalls) +#endif +#ifdef ARM_FIRST_SHUFFLED_SYSCALL + || (i >= ARM_FIRST_SHUFFLED_SYSCALL && + i <= ARM_FIRST_SHUFFLED_SYSCALL + + ARM_LAST_SPECIAL_SYSCALL + 1) +#endif + ) + continue; + if (i >= ARRAY_SIZE(ksyslist) || !ksyslist[i]) { + fprintf(stderr, "note: unknown syscall #%u" + " is \"%s\" in syscallent.h\n", + i, syscallent[i].sys_name); + } + } + + return rc; +} diff --git a/tests-mx32/ksysent.sed b/tests-mx32/ksysent.sed new file mode 100644 index 00000000..63ded4a9 --- /dev/null +++ b/tests-mx32/ksysent.sed @@ -0,0 +1,15 @@ +#!/bin/sed -rnf + +# should not have been exported at all +/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|syscalls|syscall_count|syscall_max|available|reserved|unused)/d + +# should not have been named this way +s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/ + +# legacy names +s/__NR_get_cpu/__NR_getcpu/ +s/__NR_madvise1/__NR_madvise/ +s/__NR_paccept/__NR_accept4/ + +# generate +s/#define[[:space:]]+__NR_([a-z_][^[:space:]]+)([[:space:]].*)?$/#ifdef __NR_\1\n[__NR_\1 \& 0xffff] = "\1",\n#endif/p diff --git a/tests-mx32/ksysent.test b/tests-mx32/ksysent.test new file mode 100755 index 00000000..80266488 --- /dev/null +++ b/tests-mx32/ksysent.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Validate syscallent.h + +./ksysent diff --git a/tests-mx32/lchown.c b/tests-mx32/lchown.c new file mode 100644 index 00000000..a07c878c --- /dev/null +++ b/tests-mx32/lchown.c @@ -0,0 +1,19 @@ +#include "tests.h" +#include + +#ifdef __NR_lchown + +# define SYSCALL_NR __NR_lchown +# define SYSCALL_NAME "lchown" + +# if defined __NR_lchown32 && __NR_lchown != __NR_lchown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lchown") + +#endif diff --git a/tests-mx32/lchown.test b/tests-mx32/lchown.test new file mode 100755 index 00000000..ceeaa859 --- /dev/null +++ b/tests-mx32/lchown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check lchown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 diff --git a/tests-mx32/lchown32.c b/tests-mx32/lchown32.c new file mode 100644 index 00000000..29cb01db --- /dev/null +++ b/tests-mx32/lchown32.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_lchown32 + +# define SYSCALL_NR __NR_lchown32 +# define SYSCALL_NAME "lchown32" +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lchown32") + +#endif diff --git a/tests-mx32/lchown32.test b/tests-mx32/lchown32.test new file mode 100755 index 00000000..6ee1ac95 --- /dev/null +++ b/tests-mx32/lchown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check lchown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-mx32/libmmsg.c b/tests-mx32/libmmsg.c new file mode 100644 index 00000000..b0db26d2 --- /dev/null +++ b/tests-mx32/libmmsg.c @@ -0,0 +1,69 @@ +/* + * Wrappers for recvmmsg and sendmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#ifndef __NR_recvmmsg +# define __NR_recvmmsg -1 +#endif +#define SC_recvmmsg 19 + +#ifndef __NR_sendmmsg +# define __NR_sendmmsg -1 +#endif +#define SC_sendmmsg 20 + +int +recv_mmsg(const int fd, struct mmsghdr *const vec, + const unsigned int vlen, const unsigned int flags, + struct timespec *const timeout) +{ + int rc = socketcall(__NR_recvmmsg, SC_recvmmsg, + fd, (long) vec, vlen, flags, (long) timeout); + + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("recvmmsg"); + + return rc; +} + +int +send_mmsg(const int fd, struct mmsghdr *const vec, + const unsigned int vlen, const unsigned int flags) +{ + int rc = socketcall(__NR_sendmmsg, SC_sendmmsg, + fd, (long) vec, vlen, flags, 0); + + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("sendmmsg"); + + return rc; +} diff --git a/tests-mx32/libsocketcall.c b/tests-mx32/libsocketcall.c new file mode 100644 index 00000000..04d6710f --- /dev/null +++ b/tests-mx32/libsocketcall.c @@ -0,0 +1,69 @@ +/* + * Invoke a socket syscall, either directly or via __NR_socketcall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +/* + * Invoke a socket syscall, either directly or via __NR_socketcall. + * if nr == -1, no direct syscall invocation will be made. + */ +int +socketcall(const int nr, const int call, + long a1, long a2, long a3, long a4, long a5) +{ + int rc = -1; + errno = ENOSYS; + +# ifdef __NR_socketcall + static int have_socketcall = -1; + + if (have_socketcall < 0) { + if (syscall(__NR_socketcall, 0L, 0L, 0L, 0L, 0L) < 0 + && EINVAL == errno) { + have_socketcall = 1; + } else { + have_socketcall = 0; + } + } + + if (have_socketcall) { + const long args[] = { a1, a2, a3, a4, a5 }; + rc = syscall(__NR_socketcall, call, args); + } else +# endif + { + if (nr != -1) + rc = syscall(nr, a1, a2, a3, a4, a5); + } + + return rc; +} diff --git a/tests-mx32/link.c b/tests-mx32/link.c new file mode 100644 index 00000000..d6550fd3 --- /dev/null +++ b/tests-mx32/link.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_link + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "link_sample_old"; + static const char sample_2[] = "link_sample_new"; + + long rc = syscall(__NR_link, sample_1, sample_2); + printf("link(\"%s\", \"%s\") = %ld %s (%m)\n", + sample_1, sample_2, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_link") + +#endif diff --git a/tests-mx32/link.test b/tests-mx32/link.test new file mode 100755 index 00000000..cfa2b0cc --- /dev/null +++ b/tests-mx32/link.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check link syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/linkat.c b/tests-mx32/linkat.c new file mode 100644 index 00000000..64b900ea --- /dev/null +++ b/tests-mx32/linkat.c @@ -0,0 +1,37 @@ +#include "tests.h" +#include + +#ifdef __NR_linkat + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "linkat_sample_old"; + static const char sample_2[] = "linkat_sample_new"; + const long fd_old = (long) 0xdeadbeefffffffffULL; + const long fd_new = (long) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_linkat, fd_old, sample_1, fd_new, sample_2, 0); + printf("linkat(%d, \"%s\", %d, \"%s\", 0) = %ld %s (%m)\n", + (int) fd_old, sample_1, (int) fd_new, sample_2, + rc, errno2name()); + + rc = syscall(__NR_linkat, -100, sample_1, -100, sample_2, -1L); + printf("linkat(%s, \"%s\", %s, \"%s\", %s) = %ld %s (%m)\n", + "AT_FDCWD", sample_1, "AT_FDCWD", sample_2, + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_linkat") + +#endif diff --git a/tests-mx32/linkat.test b/tests-mx32/linkat.test new file mode 100755 index 00000000..5627de7f --- /dev/null +++ b/tests-mx32/linkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check linkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/llseek.c b/tests-mx32/llseek.c new file mode 100644 index 00000000..e687e947 --- /dev/null +++ b/tests-mx32/llseek.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR__llseek + +# include +# include + +int +main(void) +{ + const unsigned long high = 0xfacefeed; + const unsigned long low = 0xdeadbeef; + const long long offset = 0xfacefeeddeadbeefLL; + unsigned long long result; + + long rc = syscall(__NR__llseek, -1, high, low, &result, SEEK_SET); + printf("_llseek(-1, %lld, %p, SEEK_SET) = %ld %s (%m)\n", + offset, &result, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR__llseek") + +#endif diff --git a/tests-mx32/llseek.test b/tests-mx32/llseek.test new file mode 100755 index 00000000..cf1607ed --- /dev/null +++ b/tests-mx32/llseek.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check _llseek syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -e_llseek $args > "$EXP" +grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-mx32/lookup_dcookie.c b/tests-mx32/lookup_dcookie.c new file mode 100644 index 00000000..986180ce --- /dev/null +++ b/tests-mx32/lookup_dcookie.c @@ -0,0 +1,96 @@ +/* + * Check decoding of lookup_dcookie syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_lookup_dcookie + +# include +# include +# include +# include + +static void +do_lookup_cookie(uint64_t cookie, char *buf, kernel_ulong_t len) +{ + long rc; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + rc = syscall(__NR_lookup_dcookie, cookie, buf, len); +# else + rc = syscall(__NR_lookup_dcookie, LL_VAL_TO_PAIR(cookie), buf, len); +# endif + + errstr = sprintrc(rc); + printf("lookup_dcookie(%" PRIu64 ", ", cookie); + + /* Here, we trust successful return code */ + if ((rc >= 0) && (rc < (long) INT_MAX)) { + printf("%.*s, ", (int) rc, buf); + } else { + if (buf != NULL) + printf("%p, ", buf); + else + printf("NULL, "); + } + + printf("%" PRIu64 ") = %s\n", (uint64_t) len, errstr); +} + +int +main(void) +{ + enum { BUF_SIZE = 4096 }; + + static const uint64_t bogus_cookie = + (uint64_t) 0xf157feeddeadfaceULL; + static const kernel_ulong_t bogus_len = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + + char *buf = tail_alloc(BUF_SIZE); + + do_lookup_cookie(0, NULL, 0); + do_lookup_cookie(bogus_cookie, buf + BUF_SIZE, bogus_len); + do_lookup_cookie(bogus_cookie, buf, BUF_SIZE); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_lookup_dcookie"); + +#endif diff --git a/tests-mx32/lookup_dcookie.test b/tests-mx32/lookup_dcookie.test new file mode 100755 index 00000000..47e1c2d6 --- /dev/null +++ b/tests-mx32/lookup_dcookie.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of lookup_cookie syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/lseek.c b/tests-mx32/lseek.c new file mode 100644 index 00000000..4428c4e9 --- /dev/null +++ b/tests-mx32/lseek.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lseek + +# include +# include + +int +main(void) +{ + const kernel_ulong_t offset = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + + if (sizeof(offset) > sizeof(long)) { + /* + * Cannot use syscall because it takes long arguments. + * Let's call lseek with hope it will invoke lseek syscall. + */ + long long rc = lseek(-1, offset, SEEK_SET); + printf("lseek(-1, %lld, SEEK_SET) = %lld %s (%m)\n", + (long long) offset, rc, errno2name()); + } else { + long rc = syscall(__NR_lseek, -1L, offset, SEEK_SET); + printf("lseek(-1, %ld, SEEK_SET) = %ld %s (%m)\n", + (long) offset, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_lseek") + +#endif diff --git a/tests-mx32/lseek.test b/tests-mx32/lseek.test new file mode 100755 index 00000000..f96a91d1 --- /dev/null +++ b/tests-mx32/lseek.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check lseek syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a30 -elseek $args > "$EXP" +grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-mx32/lstat.c b/tests-mx32/lstat.c new file mode 100644 index 00000000..3754f766 --- /dev/null +++ b/tests-mx32/lstat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lstat + +# define TEST_SYSCALL_NR __NR_lstat +# define TEST_SYSCALL_STR "lstat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lstat") + +#endif diff --git a/tests-mx32/lstat.test b/tests-mx32/lstat.test new file mode 100755 index 00000000..f513bb48 --- /dev/null +++ b/tests-mx32/lstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check lstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/lstat64.c b/tests-mx32/lstat64.c new file mode 100644 index 00000000..da06609d --- /dev/null +++ b/tests-mx32/lstat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lstat64 + +# define TEST_SYSCALL_NR __NR_lstat64 +# define TEST_SYSCALL_STR "lstat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lstat64") + +#endif diff --git a/tests-mx32/lstat64.test b/tests-mx32/lstat64.test new file mode 100755 index 00000000..fcafe79d --- /dev/null +++ b/tests-mx32/lstat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check lstat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/lstatx.c b/tests-mx32/lstatx.c new file mode 100644 index 00000000..cdd1124b --- /dev/null +++ b/tests-mx32/lstatx.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, sample, pst) +#define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(\"%s\", ", TEST_SYSCALL_STR, sample) +#define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +#include "xstatx.c" diff --git a/tests-mx32/match.awk b/tests-mx32/match.awk new file mode 100644 index 00000000..abfbae92 --- /dev/null +++ b/tests-mx32/match.awk @@ -0,0 +1,53 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# s[] is array of match strings +# r[] is array of match patterns + +NR > lines { next } + +{ + if (s[NR]) { + if ($0 == s[NR]) + next + print "Line " NR " does not match expected string: " s[NR] + } else { + if (match($0, r[NR])) + next + print "Line " NR " does not match expected pattern: " r[NR] + } + + fail = 1 +} + +END { + if (fail == 0 && NR != lines) { + fail = 1 + print "Expected " lines " lines, found " NR " line(s)." + } + exit fail +} diff --git a/tests-mx32/mbind.c b/tests-mx32/mbind.c new file mode 100644 index 00000000..b0544263 --- /dev/null +++ b/tests-mx32/mbind.c @@ -0,0 +1,61 @@ +/* + * Check decoding of mbind syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_mbind + +# include +# include + +int +main(void) +{ + const unsigned long len = (unsigned long) 0xcafef00dbadc0dedULL; + const unsigned long mode = 3; + const unsigned long nodemask = (unsigned long) 0xfacefeedfffffff1ULL; + const unsigned long maxnode = (unsigned long) 0xdeadbeeffffffff2ULL; + const unsigned long flags = -1UL; + + long rc = syscall(__NR_mbind, 0, len, mode, nodemask, maxnode, flags); + printf("mbind(NULL, %lu, %s, %#lx, %lu, %s|%#x) = %ld %s (%m)\n", + len, "MPOL_INTERLEAVE", nodemask, maxnode, + "MPOL_MF_STRICT|MPOL_MF_MOVE|MPOL_MF_MOVE_ALL", + (unsigned) flags & ~7, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mbind") + +#endif diff --git a/tests-mx32/mbind.test b/tests-mx32/mbind.test new file mode 100755 index 00000000..2a07cac6 --- /dev/null +++ b/tests-mx32/mbind.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mbind syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/membarrier.c b/tests-mx32/membarrier.c new file mode 100644 index 00000000..330893b6 --- /dev/null +++ b/tests-mx32/membarrier.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_membarrier + +# include +# include +# include +# include + +int +main(void) +{ + assert(syscall(__NR_membarrier, 3, 255) == -1); + int saved_errno = errno; + printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n", + sprintrc(-1)); + if (saved_errno != ENOSYS) { + /* the test needs to be updated? */ + assert(syscall(__NR_membarrier, 0, 0) == 1); + puts("membarrier(MEMBARRIER_CMD_QUERY, 0)" + " = 0x1 (MEMBARRIER_CMD_SHARED)"); + } + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_membarrier") + +#endif diff --git a/tests-mx32/membarrier.test b/tests-mx32/membarrier.test new file mode 100755 index 00000000..ad1f713b --- /dev/null +++ b/tests-mx32/membarrier.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check membarrier syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/memfd_create.c b/tests-mx32/memfd_create.c new file mode 100644 index 00000000..480fd177 --- /dev/null +++ b/tests-mx32/memfd_create.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_memfd_create + +# include +# include + +int +main(void) +{ + static const char text[] = "strace"; + int rc = syscall(__NR_memfd_create, text, 7); + + printf("memfd_create(\"%s\", %s) = %d %s (%m)\n", + text, "MFD_CLOEXEC|MFD_ALLOW_SEALING|0x4", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_memfd_create") + +#endif diff --git a/tests-mx32/memfd_create.test b/tests-mx32/memfd_create.test new file mode 100755 index 00000000..4361dae4 --- /dev/null +++ b/tests-mx32/memfd_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of memfd_create syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/migrate_pages.c b/tests-mx32/migrate_pages.c new file mode 100644 index 00000000..4c303e38 --- /dev/null +++ b/tests-mx32/migrate_pages.c @@ -0,0 +1,54 @@ +/* + * Check decoding of migrate_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_migrate_pages + +# include +# include + +int +main(void) +{ + const long pid = (long) 0xfacefeedffffffffULL; + long rc = syscall(__NR_migrate_pages, pid, 0, 0, 0); + printf("migrate_pages(%d, 0, NULL, NULL) = %ld %s (%m)\n", + (int) pid, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_migrate_pages") + +#endif diff --git a/tests-mx32/migrate_pages.test b/tests-mx32/migrate_pages.test new file mode 100755 index 00000000..fad53b79 --- /dev/null +++ b/tests-mx32/migrate_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check migrate_pages syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-mx32/mincore.c b/tests-mx32/mincore.c new file mode 100644 index 00000000..ea2b49e3 --- /dev/null +++ b/tests-mx32/mincore.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#define DEFAULT_STRLEN 32 + +static void +print_mincore(const unsigned int pages, void *const addr, + const size_t size, unsigned char *const vec) +{ + unsigned int i; + + if (mincore(addr, size, vec)) + perror_msg_and_skip("mincore"); + + printf("mincore(%p, %zu, [", addr, size); + for (i = 0; i < pages; ++i) { + if (i) + printf(", "); + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } + printf("%u", vec[i] & 1); + } + puts("]) = 0"); +} + +static void +test_mincore(const unsigned int pages) +{ + const size_t page_size = get_page_size(); + const size_t size = pages * page_size; + void *const addr = tail_alloc(size); + unsigned char *const vec = tail_alloc(pages); + + mincore(addr, size, NULL); + printf("mincore(%p, %zu, NULL) = -1 %s (%m)\n", + addr, size, errno2name()); + + print_mincore(pages, addr, size, vec); + if (size) + print_mincore(pages, addr, size - page_size + 1, vec); +} + +int main(void) +{ + test_mincore(1); + test_mincore(2); + test_mincore(DEFAULT_STRLEN); + test_mincore(DEFAULT_STRLEN + 1); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/mincore.test b/tests-mx32/mincore.test new file mode 100755 index 00000000..6af9f492 --- /dev/null +++ b/tests-mx32/mincore.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mincore syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/mkdir.c b/tests-mx32/mkdir.c new file mode 100644 index 00000000..d971b188 --- /dev/null +++ b/tests-mx32/mkdir.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_mkdir + +# define TEST_SYSCALL_NR __NR_mkdir +# define TEST_SYSCALL_STR "mkdir" +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_mkdir") + +#endif diff --git a/tests-mx32/mkdir.test b/tests-mx32/mkdir.test new file mode 100755 index 00000000..38ed6928 --- /dev/null +++ b/tests-mx32/mkdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mkdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/mkdirat.c b/tests-mx32/mkdirat.c new file mode 100644 index 00000000..6bfe4a5f --- /dev/null +++ b/tests-mx32/mkdirat.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_mkdirat + +# define TEST_SYSCALL_NR __NR_mkdirat +# define TEST_SYSCALL_STR "mkdirat" +# define TEST_SYSCALL_PREFIX_ARGS (long int) 0xdeadbeefffffffffULL, +# define TEST_SYSCALL_PREFIX_STR "-1, " +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_mkdirat") + +#endif diff --git a/tests-mx32/mkdirat.test b/tests-mx32/mkdirat.test new file mode 100755 index 00000000..0fcb841a --- /dev/null +++ b/tests-mx32/mkdirat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mkdirat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/mknod.c b/tests-mx32/mknod.c new file mode 100644 index 00000000..4cc1c5cb --- /dev/null +++ b/tests-mx32/mknod.c @@ -0,0 +1,73 @@ +#include "tests.h" +#include + +#ifdef __NR_mknod + +# include +# include +# include +# include + +static const char sample[] = "mknod"; + +static long +call_mknod(unsigned short mode, unsigned long dev) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + return syscall(__NR_mknod, sample, lmode, dev); +} + +int +main(void) +{ + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + long rc = call_mknod(0, dev); + printf("mknod(\"%s\", 000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(0xffff, dev); + printf("mknod(\"%s\", %#03ho) = %ld %s (%m)\n", + sample, (unsigned short) -1, rc, errno2name()); + + rc = call_mknod(S_IFREG, 0); + printf("mknod(\"%s\", S_IFREG|000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFDIR | 06, 0); + printf("mknod(\"%s\", S_IFDIR|006) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFLNK | 060, 0); + printf("mknod(\"%s\", S_IFLNK|060) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFIFO | 0600, 0); + printf("mknod(\"%s\", S_IFIFO|0600) = %ld %s (%m)\n", + sample, rc, errno2name()); + + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); + + rc = call_mknod(S_IFCHR | 024, dev); + printf("mknod(\"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + sample, rc, errno2name()); + + const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + rc = call_mknod(mode, dev); + printf("mknod(\"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" + ", makedev(%u, %u)) = %ld %s (%m)\n", + sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + major((unsigned) dev), minor((unsigned) dev), + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mknod") + +#endif diff --git a/tests-mx32/mknod.test b/tests-mx32/mknod.test new file mode 100755 index 00000000..195f1e33 --- /dev/null +++ b/tests-mx32/mknod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mknod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/mknodat.c b/tests-mx32/mknodat.c new file mode 100644 index 00000000..756e2771 --- /dev/null +++ b/tests-mx32/mknodat.c @@ -0,0 +1,74 @@ +#include "tests.h" +#include + +#ifdef __NR_mknodat + +# include +# include +# include +# include + +static const char sample[] = "mknodat_sample"; +static const long int fd = (long int) 0xdeadbeefffffffffULL; + +static long +call_mknodat(unsigned short mode, unsigned long dev) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + return syscall(__NR_mknodat, fd, sample, lmode, dev); +} + +int +main(void) +{ + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + long rc = call_mknodat(0, dev); + printf("mknodat(-1, \"%s\", 000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(0xffff, dev); + printf("mknodat(-1, \"%s\", %#03ho) = %ld %s (%m)\n", + sample, (unsigned short) -1, rc, errno2name()); + + rc = call_mknodat(S_IFREG, 0); + printf("mknodat(-1, \"%s\", S_IFREG|000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFDIR | 06, 0); + printf("mknodat(-1, \"%s\", S_IFDIR|006) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFLNK | 060, 0); + printf("mknodat(-1, \"%s\", S_IFLNK|060) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFIFO | 0600, 0); + printf("mknodat(-1, \"%s\", S_IFIFO|0600) = %ld %s (%m)\n", + sample, rc, errno2name()); + + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); + + rc = call_mknodat(S_IFCHR | 024, dev); + printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + sample, rc, errno2name()); + + const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + rc = call_mknodat(mode, dev); + printf("mknodat(-1, \"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" + ", makedev(%u, %u)) = %ld %s (%m)\n", + sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + major((unsigned) dev), minor((unsigned) dev), + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mknodat") + +#endif diff --git a/tests-mx32/mknodat.test b/tests-mx32/mknodat.test new file mode 100755 index 00000000..1701a368 --- /dev/null +++ b/tests-mx32/mknodat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mknodat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/mlock.c b/tests-mx32/mlock.c new file mode 100644 index 00000000..8e9806bd --- /dev/null +++ b/tests-mx32/mlock.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#if defined __NR_mlock && defined __NR_munlock + +# include +# include + +int +main(void) +{ + const int size = 1024; + const char *addr = tail_alloc(size); + + long rc = syscall(__NR_mlock, addr, size); + printf("mlock(%p, %d) = %s\n", addr, size, sprintrc(rc)); + + rc = syscall(__NR_munlock, addr, size); + printf("munlock(%p, %d) = %s\n", addr, size, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mlock && __NR_munlock") + +#endif diff --git a/tests-mx32/mlock.test b/tests-mx32/mlock.test new file mode 100755 index 00000000..9a73a306 --- /dev/null +++ b/tests-mx32/mlock.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mlock and munlock syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mlock,munlock -a20 diff --git a/tests-mx32/mlock2.c b/tests-mx32/mlock2.c new file mode 100644 index 00000000..71a2003e --- /dev/null +++ b/tests-mx32/mlock2.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_mlock2 + +# include +# include + +int +main(void) +{ + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long len = (unsigned long) 0xcafef00dbadc0dedULL; + + long rc = syscall(__NR_mlock2, addr, len, -1UL); + printf("mlock2(%#lx, %lu, MLOCK_ONFAULT|0xfffffffe)" + " = %ld %s (%m)\n", addr, len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mlock2") + +#endif diff --git a/tests-mx32/mlock2.test b/tests-mx32/mlock2.test new file mode 100755 index 00000000..bc412e97 --- /dev/null +++ b/tests-mx32/mlock2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mlock2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/mlockall.c b/tests-mx32/mlockall.c new file mode 100644 index 00000000..682d070d --- /dev/null +++ b/tests-mx32/mlockall.c @@ -0,0 +1,46 @@ +/* + * Check decoding of mlockall syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include + +int +main(void) +{ + int rc = mlockall(0); + printf("mlockall(0) = %s\n", sprintrc(rc)); + + rc = mlockall(MCL_CURRENT); + printf("mlockall(MCL_CURRENT) = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/mlockall.test b/tests-mx32/mlockall.test new file mode 100755 index 00000000..d7a6182d --- /dev/null +++ b/tests-mx32/mlockall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mlockall syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/mmap.c b/tests-mx32/mmap.c new file mode 100644 index 00000000..f726f63e --- /dev/null +++ b/tests-mx32/mmap.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +int +main(int ac, char **av) +{ + const char *const name = ac > 1 ? av[1] : "mmap"; + const intmax_t pagesize = get_page_size(); + const unsigned long length1 = pagesize * 6; + const unsigned long length2 = pagesize * 3; + const unsigned long length3 = pagesize * 2; + const int fd = -1; + off_t offset; + void *addr, *p; + +#if ULONG_MAX > 4294967295UL + offset = 0xcafedeadbeef000ULL & -pagesize; + addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); +#else + offset = 0xdeadbeef000ULL & -pagesize; + addr = (void *) (unsigned int) (0xfaced000 & -pagesize); +#endif + const uintmax_t uoffset = + sizeof(offset) == sizeof(int) ? (uintmax_t) (unsigned int) offset + : (uintmax_t) offset; + + (void) close(0); + (void) close(0); + printf("%s(NULL, 0, PROT_NONE, MAP_FILE, 0, 0) = -1 EBADF (%m)\n", + name); + mmap(NULL, 0, PROT_NONE, MAP_FILE, 0, 0); + + p = mmap(addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, offset); + if (MAP_FAILED == p) + perror_msg_and_fail("mmap"); + printf("%s(%p, %lu, PROT_READ|PROT_WRITE, " + "MAP_PRIVATE|MAP_ANONYMOUS, %d, %#jx) = %p\n", + name, addr, length1, fd, uoffset, p); + + if (msync(p, length1, MS_SYNC)) + perror_msg_and_fail("msync"); + printf("msync(%p, %lu, MS_SYNC) = 0\n", p, length1); + + if (mprotect(p, length1, PROT_NONE)) + perror_msg_and_fail("mprotect"); + printf("mprotect(%p, %lu, PROT_NONE) = 0\n", p, length1); + + addr = mremap(p, length1, length2, 0); + if (MAP_FAILED == addr) + perror_msg_and_fail("mremap"); + printf("mremap(%p, %lu, %lu, 0) = %p\n", p, length1, length2, addr); + + p = mremap(addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2); + if (MAP_FAILED == p) + perror_msg_and_fail("mremap"); + printf("mremap(%p, %lu, %lu, MREMAP_MAYMOVE|MREMAP_FIXED" + ", %p) = %p\n", addr, length2, length3, addr + length2, p); + + if (madvise(p, length3, MADV_NORMAL)) + perror_msg_and_fail("madvise"); + printf("madvise(%p, %lu, MADV_NORMAL) = 0\n", p, length3); + + if (munmap(p, length3)) + perror_msg_and_fail("munmap"); + printf("munmap(%p, %lu) = 0\n", p, length3); + + if (mlockall(MCL_FUTURE)) + perror_msg_and_fail("mlockall"); + puts("mlockall(MCL_FUTURE) = 0"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/mmap.test b/tests-mx32/mmap.test new file mode 100755 index 00000000..0b87114a --- /dev/null +++ b/tests-mx32/mmap.test @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Check mmap/mmap2, madvise, mlockall, mprotect, mremap, msync, and munmap +# syscalls decoding. +# +# Copyright (c) 2015-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_prog grep +check_prog sed +run_prog > /dev/null + +syscall= +for n in mmap mmap2; do + $STRACE -e$n -h > /dev/null && syscall=$syscall,$n +done +run_strace -e$syscall $args > /dev/null + +if grep '^mmap(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then + mmap=mmap +elif grep '^mmap2(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then + mmap=mmap2 +else + dump_log_and_fail_with "mmap/mmap2 not found in $STRACE $args output" +fi + +syscall=$mmap,madvise,mlockall,mprotect,mremap,msync,munmap + +run_prog "./$NAME" $mmap > /dev/null +run_strace -a20 -e$syscall $args > "$EXP" +sed -n "/^$mmap(NULL, 0, PROT_NONE,/,\$p" < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/mmap64.c b/tests-mx32/mmap64.c new file mode 100644 index 00000000..b31ce427 --- /dev/null +++ b/tests-mx32/mmap64.c @@ -0,0 +1 @@ +#include "mmap.c" diff --git a/tests-mx32/mmap64.test b/tests-mx32/mmap64.test new file mode 100755 index 00000000..51f1896e --- /dev/null +++ b/tests-mx32/mmap64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mmap/mprotect/munmap syscalls decoding. +# Target executable was compiled with -D_FILE_OFFSET_BITS=64. + +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmsg-silent.c b/tests-mx32/mmsg-silent.c new file mode 100644 index 00000000..47d0a504 --- /dev/null +++ b/tests-mx32/mmsg-silent.c @@ -0,0 +1,63 @@ +/* + * Check silent decoding of sendmmsg and recvmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#include "msghdr.h" + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + char buf = 'A'; + struct iovec iov = { .iov_base = &buf, .iov_len = sizeof(buf) }; + struct mmsghdr mh = { + .msg_hdr = { + .msg_iov = &iov, + .msg_iovlen = 1 + } + }; + + int rc = send_mmsg(fds[1], &mh, 1, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("sendmmsg"); + printf("sendmmsg(%d, %p, 1, MSG_DONTWAIT) = %d\n", fds[1], &mh, rc); + + struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + rc = recv_mmsg(fds[0], &mh, 1, MSG_DONTWAIT, &t); + printf("recvmmsg(%d, %p, 1, MSG_DONTWAIT, %p) = %d\n", + fds[0], &mh, &t, rc); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/mmsg-silent.test b/tests-mx32/mmsg-silent.test new file mode 100755 index 00000000..775e0ad3 --- /dev/null +++ b/tests-mx32/mmsg-silent.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check silent decoding of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mmsg.c b/tests-mx32/mmsg.c new file mode 100644 index 00000000..88805d16 --- /dev/null +++ b/tests-mx32/mmsg.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2014 Masatake YAMATO + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#include "msghdr.h" + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, fds)) + perror_msg_and_skip("socketpair"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + const struct iovec w0_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + } + }; + struct iovec *w0_iov = tail_memdup(w0_iov_, sizeof(w0_iov_)); + + const struct iovec w1_iov_[] = { + { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + struct iovec *w1_iov = tail_memdup(w1_iov_, sizeof(w1_iov_)); + + const struct mmsghdr w_mmh_[] = { + { + .msg_hdr = { + .msg_iov = w0_iov, + .msg_iovlen = ARRAY_SIZE(w0_iov_), + } + }, { + .msg_hdr = { + .msg_iov = w1_iov, + .msg_iovlen = ARRAY_SIZE(w1_iov_), + } + } + }; + void *w_mmh = tail_memdup(w_mmh_, sizeof(w_mmh_)); + const unsigned int n_w_mmh = ARRAY_SIZE(w_mmh_); + + int r = send_mmsg(1, w_mmh, n_w_mmh, MSG_DONTROUTE | MSG_NOSIGNAL); + if (r < 0) + perror_msg_and_skip("sendmmsg"); + assert(r == (int) n_w_mmh); + assert(close(1) == 0); + tprintf("sendmmsg(1, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}" + ", {msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}], %u" + ", MSG_DONTROUTE|MSG_NOSIGNAL) = %d\n" + " = %u buffers in vector 0\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " = %u buffers in vector 1\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), + w1_c, LENGTH_OF(w1_c), + ARRAY_SIZE(w0_iov_), + LENGTH_OF(w0_c) + LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w1_iov_), + LENGTH_OF(w2_c), + n_w_mmh, r, + ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, + ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + struct iovec *r0_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = r_len + } + }; + struct iovec *r1_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + const struct mmsghdr r_mmh_[] = { + { + .msg_hdr = { + .msg_iov = r0_iov, + .msg_iovlen = ARRAY_SIZE(r0_iov_), + } + }, { + .msg_hdr = { + .msg_iov = r1_iov, + .msg_iovlen = ARRAY_SIZE(r1_iov_), + } + } + }; + void *r_mmh = tail_memdup(r_mmh_, sizeof(r_mmh_)); + const unsigned int n_r_mmh = ARRAY_SIZE(r_mmh_); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + assert(recv_mmsg(0, r_mmh, n_r_mmh, MSG_DONTWAIT, NULL) == (int) n_r_mmh); + assert(close(0) == 0); + tprintf("recvmmsg(0, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}" + ", {msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}], %u" + ", MSG_DONTWAIT, NULL) = %d\n" + " = %u buffers in vector 0\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " = %u buffers in vector 1\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), + r1_c, r_len, r_len, ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + n_r_mmh, r, + ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), r0_d, r0_c, + ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), r1_d, r1_c); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/mmsg.test b/tests-mx32/mmsg.test new file mode 100755 index 00000000..a8148ba8 --- /dev/null +++ b/tests-mx32/mmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check how iovecs in struct mmsghdr are decoded. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmmsg,sendmmsg -e read=0 -e write=1 diff --git a/tests-mx32/mmsg_name-v.c b/tests-mx32/mmsg_name-v.c new file mode 100644 index 00000000..c663536d --- /dev/null +++ b/tests-mx32/mmsg_name-v.c @@ -0,0 +1,4 @@ +/* This file is part of mmsg_name-v strace test. */ +#define VERBOSE 1 +#define TEST_NAME "mmsg_name-v" +#include "mmsg_name.c" diff --git a/tests-mx32/mmsg_name-v.test b/tests-mx32/mmsg_name-v.test new file mode 100755 index 00000000..ab8dfba6 --- /dev/null +++ b/tests-mx32/mmsg_name-v.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check verbose decoding of msg_name* fields of struct msghdr array argument +# of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mmsg_name.c b/tests-mx32/mmsg_name.c new file mode 100644 index 00000000..a7a55c55 --- /dev/null +++ b/tests-mx32/mmsg_name.c @@ -0,0 +1,242 @@ +/* + * Check decoding of msg_name* fields of struct msghdr array argument + * of sendmmsg and recvmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "msghdr.h" + +#define DEFAULT_STRLEN 32 + +#define IOV_MAX1 (IOV_MAX + 1) + +#ifndef TEST_NAME +# define TEST_NAME "mmsg_name" +#endif + +static void +print_msghdr(const struct msghdr *const msg, const int user_msg_namelen) +{ + const struct sockaddr_un *const un = msg->msg_name; + const int offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + + printf("{msg_name="); + if (!un) + printf("NULL"); + else if (user_msg_namelen < offsetof_sun_path) { + printf("%p", un); + } else { + printf("{sa_family=AF_UNIX"); + if (user_msg_namelen > offsetof_sun_path) { + int len = user_msg_namelen < (int) msg->msg_namelen ? + user_msg_namelen : (int) msg->msg_namelen; + len -= offsetof_sun_path; + if (len > (int) sizeof(un->sun_path)) + len = sizeof(un->sun_path); + printf(", sun_path=\"%.*s\"", len, un->sun_path); + } + printf("}"); + } + printf(", msg_namelen="); + if (user_msg_namelen != (int) msg->msg_namelen) { + printf("%d->", user_msg_namelen); + } + printf("%d, msg_iov=[{iov_base=\"%c\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}", + (int) msg->msg_namelen, * (char *) msg->msg_iov[0].iov_base); +} + +static void +test_mmsg_name(const int send_fd, const int recv_fd) +{ + struct sockaddr_un *const send_addr = + tail_alloc(sizeof(*send_addr) * IOV_MAX1); + char *const send_buf = tail_alloc(sizeof(*send_buf) * IOV_MAX1); + struct iovec *const send_iov = tail_alloc(sizeof(*send_iov) * IOV_MAX1); + struct mmsghdr *const send_mh = tail_alloc(sizeof(*send_mh) * IOV_MAX1); + + int i, rc; + + for (i = 0; i < IOV_MAX1; ++i) { + int sun_len = i + 1 > (int) sizeof(send_addr[i].sun_path) + ? (int) sizeof(send_addr[i].sun_path) + : i + 1; + + send_addr[i].sun_family = AF_UNIX; + memset(send_addr[i].sun_path, 'a' + i % 26, sun_len); + + send_buf[i] = '0' + i % 10; + + send_iov[i].iov_base = &send_buf[i]; + send_iov[i].iov_len = sizeof(*send_buf); + + send_mh[i].msg_hdr.msg_iov = &send_iov[i]; + send_mh[i].msg_hdr.msg_iovlen = 1; + send_mh[i].msg_hdr.msg_name = &send_addr[i]; + send_mh[i].msg_hdr.msg_namelen = i + 1; + send_mh[i].msg_hdr.msg_control = 0; + send_mh[i].msg_hdr.msg_controllen = 0; + send_mh[i].msg_hdr.msg_flags = 0; + } + + rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); + int saved_errno = errno; + + printf("sendmmsg(%d, [", send_fd); + for (i = 0; i < IOV_MAX1; ++i) { + if (i) + printf(", "); + if (i >= IOV_MAX +# if !VERBOSE + || i >= DEFAULT_STRLEN +# endif + ) { + printf("..."); + break; + } + printf("{msg_hdr="); + print_msghdr(&send_mh[i].msg_hdr, i + 1); + printf("}"); + } + errno = saved_errno; + printf("], %u, MSG_DONTWAIT) = %d %s (%m)\n", + IOV_MAX1, rc, errno2name()); + + for (i = 0; i < IOV_MAX1; ++i) { + send_mh[i].msg_hdr.msg_name = 0; + send_mh[i].msg_hdr.msg_namelen = 0; + } + + /* + * When recvmmsg is called with a valid descriptor + * but inaccessible memory, it causes segfaults on some architectures. + * As in these cases we test decoding of failed recvmmsg calls, + * it's ok to fail recvmmsg with any reason as long as + * it doesn't read that inaccessible memory. + */ + rc = send_mmsg(-1, &send_mh[IOV_MAX], 2, MSG_DONTWAIT); + saved_errno = errno; + printf("sendmmsg(-1, [{msg_hdr="); + print_msghdr(&send_mh[IOV_MAX].msg_hdr, 0); + errno = saved_errno; + printf("}, %p], %u, MSG_DONTWAIT) = %d %s (%m)\n", + &send_mh[IOV_MAX1], 2, rc, errno2name()); + + rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("sendmmsg"); + + printf("sendmmsg(%d, [", send_fd); + for (i = 0; i < IOV_MAX1; ++i) { + if (i) + printf(", "); + if (i >= IOV_MAX +#if !VERBOSE + || i >= DEFAULT_STRLEN +#endif + ) { + printf("..."); + break; + } + printf("{msg_hdr="); + print_msghdr(&send_mh[i].msg_hdr, 0); + printf("%s}", i < rc ? ", msg_len=1" : ""); + } + printf("], %u, MSG_DONTWAIT) = %d\n", IOV_MAX1, rc); + + struct sockaddr_un *const recv_addr = + tail_alloc(sizeof(*recv_addr) * IOV_MAX1); + char *const recv_buf = tail_alloc(sizeof(*recv_buf) * IOV_MAX1); + struct iovec *const recv_iov = tail_alloc(sizeof(*recv_iov) * IOV_MAX1); + struct mmsghdr *const recv_mh = tail_alloc(sizeof(*recv_mh) * IOV_MAX1); + + for (i = 0; i < IOV_MAX1; ++i) { + recv_iov[i].iov_base = &recv_buf[i]; + recv_iov[i].iov_len = sizeof(*recv_buf); + + recv_mh[i].msg_hdr.msg_name = &recv_addr[i]; + recv_mh[i].msg_hdr.msg_namelen = i; + recv_mh[i].msg_hdr.msg_iov = &recv_iov[i]; + recv_mh[i].msg_hdr.msg_iovlen = 1; + recv_mh[i].msg_hdr.msg_control = 0; + recv_mh[i].msg_hdr.msg_controllen = 0; + recv_mh[i].msg_hdr.msg_flags = 0; + } + + rc = recv_mmsg(recv_fd, recv_mh, IOV_MAX1, MSG_DONTWAIT, 0); + if (rc < 0) + perror_msg_and_skip("recvmmsg"); + + printf("recvmmsg(%d, [", recv_fd); + for (i = 0; i < rc; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("{msg_hdr="); + print_msghdr(&recv_mh[i].msg_hdr, i); + printf(", msg_len=1}"); + } + printf("], %u, MSG_DONTWAIT, NULL) = %d\n", IOV_MAX1, rc); +} + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_NAME "-recvmmsg.test.send.socket" + }; + + (void) unlink(un.sun_path); + if (bind(fds[1], (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + test_mmsg_name(fds[1], fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/mmsg_name.test b/tests-mx32/mmsg_name.test new file mode 100755 index 00000000..e18c9722 --- /dev/null +++ b/tests-mx32/mmsg_name.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check decoding of msg_name* fields of struct msghdr array argument +# of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mount.c b/tests-mx32/mount.c new file mode 100644 index 00000000..cbfe42f8 --- /dev/null +++ b/tests-mx32/mount.c @@ -0,0 +1,84 @@ +/* + * Check decoding of mount syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#ifndef MS_MGC_VAL +# define MS_MGC_VAL 0xC0ED0000 +#endif + +#ifndef MS_RELATIME +# define MS_RELATIME (1ul << 21) +#endif + +#define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" + +int +main(void) +{ + static const char source[] = "mount_source"; + static const char target[] = "mount_target"; + static const char fstype[] = "mount_fstype"; + static const char data[] = "mount_data"; + + int rc = mount(source, target, fstype, 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, str_ro_nosuid_nodev_noexec, + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_RELATIME | 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, + str_ro_nosuid_nodev_noexec "|MS_RELATIME", + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_MGC_VAL, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, "MS_MGC_VAL", data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_MGC_VAL | 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, + "MS_MGC_VAL|" str_ro_nosuid_nodev_noexec, + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_REMOUNT, data); + printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, "MS_REMOUNT", data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_BIND, data); + printf("mount(\"%s\", \"%s\", %p, %s, %p) = %d %s (%m)\n", + source, target, fstype, "MS_BIND", data, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/mount.test b/tests-mx32/mount.test new file mode 100755 index 00000000..40fdca95 --- /dev/null +++ b/tests-mx32/mount.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mount syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/move_pages.c b/tests-mx32/move_pages.c new file mode 100644 index 00000000..f4ccafa2 --- /dev/null +++ b/tests-mx32/move_pages.c @@ -0,0 +1,239 @@ +/* + * Check decoding of move_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_move_pages + +# include +# include +# include + +# define MAX_STRLEN 3 + +static void +print_page_array(const void **const pages, + const unsigned long count, + const unsigned int offset) +{ + if (!count) { + printf("%s", pages ? "[]" : "NULL"); + return; + } + if (count <= offset) { + printf("%p", pages); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i + offset < count) { + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + } else { + printf("%p", pages + i); + break; + } + const void *const addr = pages[i]; + if (addr) + printf("%p", addr); + else + printf("NULL"); + } + printf("]"); +} + +static void +print_node_array(const int *const nodes, + const unsigned long count, + const unsigned int offset) +{ + if (!count) { + printf("%s", nodes ? "[]" : "NULL"); + return; + } + if (count <= offset) { + printf("%p", nodes); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i + offset < count) { + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + } else { + printf("%p", nodes + i); + break; + } + printf("%d", nodes[i]); + } + printf("]"); +} + +static void +print_status_array(const int *const status, const unsigned long count) +{ + if (!count) { + printf("%s", status ? "[]" : "NULL"); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + if (status[i] >= 0) { + printf("%d", status[i]); + } else { + errno = -status[i]; + printf("%s", errno2name()); + } + } + printf("]"); +} + +static void +print_stat_pages(const unsigned long pid, const unsigned long count, + const void **const pages, int *const status) +{ + const unsigned long flags = (unsigned long) 0xfacefeed00000002ULL; + + long rc = syscall(__NR_move_pages, + pid, count, pages, NULL, status, flags); + const char *errstr = sprintrc(rc); + printf("move_pages(%d, %lu, ", (int) pid, count); + print_page_array(pages, count, 0); + printf(", NULL, "); + if (rc) { + if (count) + printf("%p", status); + else + printf("[]"); + } else { + print_status_array(status, count); + } + printf(", MPOL_MF_MOVE) = %s\n", errstr); +} + +static void +print_move_pages(const unsigned long pid, + unsigned long count, + const unsigned int offset, + const void **const pages, + int *const nodes, + int *const status) +{ + const unsigned long flags = (unsigned long) 0xfacefeed00000004ULL; + count += offset; + + long rc = syscall(__NR_move_pages, + pid, count, pages, nodes, status, flags); + const char *errstr = sprintrc(rc); + printf("move_pages(%d, %lu, ", (int) pid, count); + print_page_array(pages, count, offset); + printf(", "); + print_node_array(nodes, count, offset); + printf(", "); + if (count) + printf("%p", status); + else + printf("[]"); + printf(", MPOL_MF_MOVE_ALL) = %s\n", errstr); +} + +int +main(void) +{ + const unsigned long pid = + (unsigned long) 0xfacefeed00000000ULL | getpid(); + unsigned long count = 1; + const unsigned page_size = get_page_size(); + const void *const page = tail_alloc(page_size); + const void *const efault = page + page_size; + const void **pages = tail_alloc(sizeof(*pages)); + int *nodes = tail_alloc(sizeof(*nodes)); + int *status = tail_alloc(sizeof(*status)); + + print_stat_pages(pid, 0, pages, status); + print_move_pages(pid, 0, 0, pages, nodes, status); + print_move_pages(pid, 0, 1, pages + 1, nodes + 1, status + 1); + + *pages = page; + print_stat_pages(pid, count, pages, status); + *nodes = 0xdeadbee1; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = efault; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee2; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = nodes; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee3; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = status; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee4; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_move_pages") + +#endif diff --git a/tests-mx32/move_pages.test b/tests-mx32/move_pages.test new file mode 100755 index 00000000..f9577172 --- /dev/null +++ b/tests-mx32/move_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of move_pages syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 diff --git a/tests-mx32/mq.c b/tests-mx32/mq.c new file mode 100644 index 00000000..9c2ffc8e --- /dev/null +++ b/tests-mx32/mq.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_MQUEUE_H + +# include +# include +# include +# include +# include +# include + +# define NAME "strace-mq.test" + +int +main (void) +{ + struct mq_attr attr; + (void) close(0); + + if (mq_open("/" NAME, O_CREAT, 0700, NULL)) + perror_msg_and_skip("mq_open"); + printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", NAME); + + if (mq_getattr(0, &attr)) + perror_msg_and_skip("mq_getattr"); + printf("mq_getsetattr(0, NULL, {mq_flags=0, mq_maxmsg=%lld" + ", mq_msgsize=%lld, mq_curmsgs=0}) = 0\n", + (long long) attr.mq_maxmsg, + (long long) attr.mq_msgsize); + + if (mq_setattr(0, &attr, NULL)) + perror_msg_and_skip("mq_setattr"); + printf("mq_getsetattr(0, {mq_flags=0, mq_maxmsg=%lld" + ", mq_msgsize=%lld, mq_curmsgs=0}, NULL) = 0\n", + (long long) attr.mq_maxmsg, + (long long) attr.mq_msgsize); + + if (mq_unlink("/" NAME)) + perror_msg_and_skip("mq_unlink"); + printf("mq_unlink(\"%s\") = 0\n", NAME); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_MQUEUE_H") + +#endif diff --git a/tests-mx32/mq.test b/tests-mx32/mq.test new file mode 100755 index 00000000..746b07b7 --- /dev/null +++ b/tests-mx32/mq.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_getsetattr, and mq_unlink syscalls. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a28 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests-mx32/mq_sendrecv-read.c b/tests-mx32/mq_sendrecv-read.c new file mode 100644 index 00000000..cc9867b9 --- /dev/null +++ b/tests-mx32/mq_sendrecv-read.c @@ -0,0 +1,3 @@ +#define DUMPIO_READ 1 +#define MQ_NAME "mq_sendrecv-read.sample" +#include "mq_sendrecv.c" diff --git a/tests-mx32/mq_sendrecv-read.test b/tests-mx32/mq_sendrecv-read.test new file mode 100755 index 00000000..eb4ad75e --- /dev/null +++ b/tests-mx32/mq_sendrecv-read.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -eread=0 -a14 diff --git a/tests-mx32/mq_sendrecv-write.c b/tests-mx32/mq_sendrecv-write.c new file mode 100644 index 00000000..ae34ee1a --- /dev/null +++ b/tests-mx32/mq_sendrecv-write.c @@ -0,0 +1,3 @@ +#define DUMPIO_WRITE 1 +#define MQ_NAME "mq_sendrecv-write.sample" +#include "mq_sendrecv.c" diff --git a/tests-mx32/mq_sendrecv-write.test b/tests-mx32/mq_sendrecv-write.test new file mode 100755 index 00000000..38277ec6 --- /dev/null +++ b/tests-mx32/mq_sendrecv-write.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -ewrite=0 -a14 diff --git a/tests-mx32/mq_sendrecv.c b/tests-mx32/mq_sendrecv.c new file mode 100644 index 00000000..c151542c --- /dev/null +++ b/tests-mx32/mq_sendrecv.c @@ -0,0 +1,480 @@ +/* + * Check decoding of mq_open, mq_timedsend, mq_notify, mq_timedreceive and + * mq_unlink syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined __NR_mq_open && __NR_mq_timedsend && __NR_mq_timedreceive && \ + __NR_mq_notify && __NR_mq_unlink + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "sigevent.h" + +# ifndef MQ_NAME +# define MQ_NAME "mq_sendrecv.sample" +# endif + +# ifndef DUMPIO_READ +# define DUMPIO_READ 0 +# endif + +# ifndef DUMPIO_WRITE +# define DUMPIO_WRITE 0 +# endif + + +enum { + NUM_ATTRS = 8, + MSG_CUT = 8, + MSG_MAX_UNCUT = 32, + MSG_SIZE = 64, + MSG_START = 0x80, +}; + + +static void +printstr(unsigned char start, unsigned int count) +{ + unsigned int i; + + printf("\""); + for (i = 0; i < count; i++) { + printf("\\%hho", (unsigned char) (start + i)); + } + printf("\""); +} + +#if DUMPIO_READ || DUMPIO_WRITE +static void +dumpstr(unsigned char start, unsigned int count) +{ + unsigned int i; + unsigned int j; + + for (i = 0; i < count; i++) { + if (i < count) { + if (!(i % 16)) + printf(" | %05x ", i); + if (!(i % 8)) + printf(" "); + + printf("%02hhx ", (unsigned char) (start + i)); + } + + if ((i % 16 == 15) || (i == (count - 1))) { + if (i % 16 != 15) + printf("%*s", 3 * (15 - i % 16) + + ((i + 8) % 16) / 8, " "); + + printf(" "); + + for (j = 0; j <= (i % 16); j++) + printf("."); + for (j = i % 16; j < 15; j++) + printf(" "); + + printf(" |\n"); + + } + } +} +#endif /* DUMPIO_READ || DUMPIO_WRITE */ + +static void +cleanup(void) +{ + long rc; + + rc = syscall(__NR_mq_unlink, MQ_NAME); + printf("mq_unlink(\"" MQ_NAME "\") = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); +} + +static void +do_send(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, + bool cropped) +{ + long rc; + long saved_errno; + + do { + rc = syscall(__NR_mq_timedsend, fd, msg, msg_size, 42, + tmout); + saved_errno = errno; + printf("mq_timedsend(%d, ", fd); + printstr(MSG_START, msg_size > MSG_MAX_UNCUT ? MSG_MAX_UNCUT : + msg_size); + if (cropped) + printf("..."); + errno = saved_errno; + printf(", %u, 42, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", msg_size, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + errno = saved_errno; + + if (rc == -1) { + if (errno == EINTR) + continue; + perror_msg_and_skip("mq_timedsend"); + } +# if DUMPIO_WRITE + dumpstr(MSG_START, msg_size); +# endif + } while (rc); +} + +static void +do_recv(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, + bool cropped) +{ + long rc; + long saved_errno; + unsigned prio; + + do { + rc = syscall(__NR_mq_timedreceive, fd, msg, MSG_SIZE, &prio, + tmout); + saved_errno = errno; + printf("mq_timedreceive(%d, ", fd); + if (rc >= 0) { + printstr(MSG_START, rc > MSG_MAX_UNCUT ? MSG_MAX_UNCUT : + rc); + if (cropped) + printf("..."); + } else { + printf("%p", msg); + } + errno = saved_errno; + printf(", %u, [42], {tv_sec=%jd, tv_nsec=%jd}) = %s\n", MSG_SIZE, + (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + errno = saved_errno; + + if (rc == -1) { + if (errno == EINTR) + continue; + perror_msg_and_skip("mq_timedreceive"); + } + if ((rc >= 0) && ((unsigned long) rc != msg_size)) + error_msg_and_skip("mq_timedreceive size mismatch" + ": expected %u, got %ld", + msg_size, rc); +# if DUMPIO_READ + dumpstr(MSG_START, rc); +# endif + } while (rc < 0); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0x8765432100000000ULL; + static const kernel_ulong_t bogus_oflags = + (kernel_ulong_t) 0xdefaced100000003ULL; + static const kernel_ulong_t bogus_mode = + (kernel_ulong_t) 0xdec0deadfacefeedULL; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfeedfacedeadba5eULL; + static const kernel_ulong_t bogus_zero_size = + (sizeof(kernel_ulong_t) > sizeof(int)) ? (kernel_ulong_t) 0 : + (kernel_ulong_t) 0xface1e5500000000ULL; + static const kernel_ulong_t bogus_size = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_prio = + (kernel_ulong_t) 0xdec0ded1defaced3ULL; + static const struct timespec bogus_tmout_data = { + .tv_sec = (time_t) 0xdeadfacebeeff00dLL, + .tv_nsec = (long) 0xfacefee1deadfeedLL, + }; + static const struct timespec future_tmout_data = { + .tv_sec = (time_t) 0x7ea1fade7e57faceLL, + .tv_nsec = 999999999, + };; + struct_sigevent bogus_sev_data = { + .sigev_notify = 0xdefaced, + .sigev_signo = 0xfacefeed, + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL + }; + + const char *errstr; + long rc; + kernel_long_t *bogus_attrs = tail_alloc(sizeof(*bogus_attrs) * + NUM_ATTRS); + char *msg = tail_alloc(MSG_SIZE); + unsigned *bogus_prio_ptr = tail_alloc(sizeof(*bogus_prio_ptr)); + struct timespec *bogus_tmout = tail_memdup(&bogus_tmout_data, + sizeof(*bogus_tmout)); + struct timespec *future_tmout = tail_memdup(&future_tmout_data, + sizeof(*future_tmout)); + struct_sigevent *bogus_sev = tail_memdup(&bogus_sev_data, + sizeof(*bogus_sev)); + int fd = -1; + + + fill_memory_ex(msg, MSG_SIZE, MSG_START, MSG_SIZE); + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + 0xbb, 0x70); + + + /* mq_open */ + + /* Zero values, non-O_CREAT mode */ + rc = syscall(__NR_mq_open, NULL, bogus_zero, bogus_mode, NULL); + printf("mq_open(NULL, O_RDONLY) = %s\n", sprintrc(rc)); + + /* O_CREAT parsing, other flags, bogs values */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + NULL); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, NULL) = %s\n", + msg, (unsigned short) bogus_mode, sprintrc(rc)); + + /* Partially invalid attributes structure */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + bogus_attrs + 1); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, %p) = %s\n", + msg, (unsigned short) bogus_mode, bogus_attrs + 1, sprintrc(rc)); + + /* Valid attributes structure */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + bogus_attrs); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx, " + "mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", + msg, (unsigned short) bogus_mode, + (unsigned long long) (kernel_ulong_t) bogus_attrs[0], + (long long) bogus_attrs[1], + (long long) bogus_attrs[2], + (long long) bogus_attrs[3], sprintrc(rc)); + + + /* mq_timedsend */ + + /* Zero values*/ + rc = syscall(__NR_mq_timedsend, bogus_zero, NULL, bogus_zero_size, + bogus_zero, NULL); + printf("mq_timedsend(0, NULL, 0, 0, NULL) = %s\n", sprintrc(rc)); + + /* Invalid pointers */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE, bogus_size, + bogus_prio, bogus_tmout + 1); + printf("mq_timedsend(%d, %p, %llu, %u, %p) = %s\n", + (int) bogus_fd, msg + MSG_SIZE, (unsigned long long) bogus_size, + (unsigned) bogus_prio, bogus_tmout + 1, sprintrc(rc)); + + /* Partially invalid message (memory only partially available) */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, + MSG_SIZE, bogus_prio, bogus_tmout); + printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + (int) bogus_fd, msg + MSG_SIZE - MSG_CUT, + (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + sprintrc(rc)); + + /* Fully valid message, uncut */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, + MSG_CUT, bogus_prio, bogus_tmout); + errstr = sprintrc(rc); + printf("mq_timedsend(%d, ", (int) bogus_fd); + printstr(MSG_START + MSG_SIZE - MSG_CUT, MSG_CUT); + printf(", %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + (unsigned long long) MSG_CUT, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + errstr); + + /* Partially invalid message, cut at maxstrlen */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_CUT, MSG_SIZE, + bogus_prio, bogus_tmout); + errstr = sprintrc(rc); + printf("mq_timedsend(%d, ", (int) bogus_fd); + printstr(MSG_START + MSG_CUT, MSG_MAX_UNCUT); + printf("..., %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + errstr); + + + /* mq_timedreceive */ + + /* Zero values */ + rc = syscall(__NR_mq_timedreceive, bogus_zero, NULL, bogus_zero_size, + NULL, NULL); + printf("mq_timedreceive(0, NULL, 0, NULL, NULL) = %s\n", sprintrc(rc)); + + /* Invalid addresses */ + rc = syscall(__NR_mq_timedreceive, bogus_fd, msg + MSG_SIZE, bogus_size, + bogus_prio_ptr + 1, bogus_tmout + 1); + printf("mq_timedreceive(%d, %p, %llu, %p, %p) = %s\n", + (int) bogus_fd, msg + MSG_SIZE, (unsigned long long) bogus_size, + bogus_prio_ptr + 1, bogus_tmout + 1, sprintrc(rc)); + + /* Invalid fd, valid msg pointer */ + rc = syscall(__NR_mq_timedreceive, bogus_fd, msg, bogus_size, + bogus_prio_ptr, bogus_tmout); + printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + (int) bogus_fd, msg, (unsigned long long) bogus_size, + bogus_prio_ptr, (intmax_t) bogus_tmout->tv_sec, + (intmax_t) bogus_tmout->tv_nsec, sprintrc(rc)); + + + /* mq_notify */ + + /* Zero values */ + rc = syscall(__NR_mq_notify, bogus_zero, NULL); + printf("mq_notify(0, NULL) = %s\n", sprintrc(rc)); + + /* Invalid pointer */ + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev + 1); + printf("mq_notify(%d, %p) = %s\n", + (int) bogus_fd, bogus_sev + 1, sprintrc(rc)); + + /* Invalid SIGEV_* */ + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=%u, sigev_notify=%#x /* SIGEV_??? */}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_signo, bogus_sev->sigev_notify, + sprintrc(rc)); + + /* SIGEV_NONE */ + bogus_sev->sigev_notify = SIGEV_NONE; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_signo, sprintrc(rc)); + + /* SIGEV_SIGNAL */ + bogus_sev->sigev_notify = SIGEV_SIGNAL; + bogus_sev->sigev_signo = SIGALRM; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, sprintrc(rc)); + + /* SIGEV_THREAD */ + bogus_sev->sigev_notify = SIGEV_THREAD; + bogus_sev->sigev_un.sigev_thread.function = + (unsigned long) 0xdeadbeefbadc0dedULL; + bogus_sev->sigev_un.sigev_thread.attribute = + (unsigned long) 0xcafef00dfacefeedULL; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " + "sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}) = " + "%s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_un.sigev_thread.function, + bogus_sev->sigev_un.sigev_thread.attribute, sprintrc(rc)); + + /* mq_unlink */ + + /* Zero values */ + rc = syscall(__NR_mq_unlink, NULL); + printf("mq_unlink(NULL) = %s\n", sprintrc(rc)); + + /* Invalid ptr */ + rc = syscall(__NR_mq_unlink, msg + MSG_SIZE); + printf("mq_unlink(%p) = %s\n", msg + MSG_SIZE, sprintrc(rc)); + + /* Long unterminated string */ + rc = syscall(__NR_mq_unlink, msg); + errstr = sprintrc(rc); + printf("mq_unlink(%p) = %s\n", msg, errstr); + + + /* Sending and receiving test */ + +# if DUMPIO_READ || DUMPIO_WRITE + close(0); +# endif + bogus_attrs[1] = 2; + bogus_attrs[2] = MSG_SIZE; + fd = rc = syscall(__NR_mq_open, MQ_NAME, + O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); + errstr = sprintrc(rc); + if (rc < 0) + perror_msg_and_skip("mq_open"); + else + atexit(cleanup); +# if DUMPIO_READ || DUMPIO_WRITE + if (fd != 0) + error_msg_and_skip("mq_open returned fd other than 0"); +# endif + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + 0xbb, 0x70); + printf("mq_open(\"" MQ_NAME "\", O_RDWR|O_CREAT|O_NONBLOCK, " + "0700, {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u, " + "mq_curmsgs=%lld}) = %s\n", + (unsigned long long) (kernel_ulong_t) bogus_attrs[0], MSG_SIZE, + (long long) bogus_attrs[3], errstr); + + rc = syscall(__NR_mq_getsetattr, fd, NULL, bogus_attrs); + if (rc < 0) + perror_msg_and_skip("mq_getsetattr"); + if ((bogus_attrs[1] < 2) || (bogus_attrs[2] < MSG_SIZE)) + error_msg_and_skip("mq too small"); + + do_send(fd, msg, MSG_CUT, future_tmout, false); + do_send(fd, msg, MSG_SIZE, future_tmout, true); + + memset(msg, '\0', MSG_SIZE); + do_recv(fd, msg, MSG_CUT, future_tmout, false); + + memset(msg, '\0', MSG_SIZE); + do_recv(fd, msg, MSG_SIZE, future_tmout, true); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mq_open && __NR_mq_timedsend && " + "__NR_mq_timedreceive && __NR_mq_notify && __NR_mq_unlink"); + +#endif diff --git a/tests-mx32/mq_sendrecv.test b/tests-mx32/mq_sendrecv.test new file mode 100755 index 00000000..67f4d63c --- /dev/null +++ b/tests-mx32/mq_sendrecv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -a14 diff --git a/tests-mx32/msg_control-v.c b/tests-mx32/msg_control-v.c new file mode 100644 index 00000000..b0afa523 --- /dev/null +++ b/tests-mx32/msg_control-v.c @@ -0,0 +1,3 @@ +/* This file is part of msg_control-v strace test. */ +#define VERBOSE 1 +#include "msg_control.c" diff --git a/tests-mx32/msg_control-v.test b/tests-mx32/msg_control-v.test new file mode 100755 index 00000000..41f98428 --- /dev/null +++ b/tests-mx32/msg_control-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of struct msghdr ancillary data. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests-mx32/msg_control.c b/tests-mx32/msg_control.c new file mode 100644 index 00000000..709a3075 --- /dev/null +++ b/tests-mx32/msg_control.c @@ -0,0 +1,715 @@ +/* + * Check decoding of struct msghdr ancillary data. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SOL_IP +# define SOL_IP 0 +#endif +#ifndef SOL_TCP +# define SOL_TCP 6 +#endif + +#ifndef SCM_SECURITY +# define SCM_SECURITY 3 +#endif + +#define MIN_SIZE_OF(type, member) \ + (offsetof(type, member) + sizeof(((type *) 0)->member)) + +static struct cmsghdr * +get_cmsghdr(void *const page, const size_t len) +{ + return page - CMSG_ALIGN(len); +} + +#define DEFAULT_STRLEN 32 + +static void +print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len) +{ + size_t nfd = cmsg_len > CMSG_LEN(0) + ? (cmsg_len - CMSG_LEN(0)) / sizeof(int) : 0; + if (!nfd) + return; + + printf(", cmsg_data=["); + int *fdp = (int *) CMSG_DATA(cmsg); + size_t i; + for (i = 0; i < nfd; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("%d", fdp[i]); + } + printf("]"); +} + +static void +test_scm_rights1(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const void *const src, + const size_t cmsg_len) +{ + const size_t aligned_cms_len = + cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); + if (cmsg_len >= CMSG_LEN(0) + && aligned_cms_len + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen); + + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) + cmsg->cmsg_len = cmsg_len; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_level)) + cmsg->cmsg_level = SOL_SOCKET; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_type)) + cmsg->cmsg_type = SCM_RIGHTS; + + size_t src_len = + cmsg_len < msg_controllen ? cmsg_len : msg_controllen; + if (src_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0)); + + mh->msg_control = cmsg; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0"); + if (msg_controllen < CMSG_LEN(0)) { + if (msg_controllen) + printf(", msg_control=%p", cmsg); + } else { + printf(", msg_control=[{cmsg_len=%lu, cmsg_level=SOL_SOCKET" + ", cmsg_type=SCM_RIGHTS", (unsigned long) cmsg_len); + print_fds(cmsg, src_len); + printf("}"); + if (aligned_cms_len < msg_controllen) + printf(", %p", (void *) cmsg + aligned_cms_len); + printf("]"); + } + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_scm_rights2(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const int *const *const src, + const size_t *const cmsg_len) +{ + const size_t aligned_cms_len[2] = { + cmsg_len[0] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[0]) : CMSG_LEN(0), + cmsg_len[1] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[1]) : CMSG_LEN(0) + }; + if (cmsg_len[0] < CMSG_LEN(0) + || aligned_cms_len[0] + CMSG_LEN(0) > msg_controllen + || aligned_cms_len[0] + aligned_cms_len[1] + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *const cmsg[2] = { + get_cmsghdr(page, msg_controllen), + (void *) get_cmsghdr(page, msg_controllen) + aligned_cms_len[0] + }; + cmsg[0]->cmsg_len = cmsg_len[0]; + cmsg[0]->cmsg_level = SOL_SOCKET; + cmsg[0]->cmsg_type = SCM_RIGHTS; + if (cmsg_len[0] > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg[0]), src[0], cmsg_len[0] - CMSG_LEN(0)); + + const size_t msg_controllen1 = msg_controllen - aligned_cms_len[0]; + if (msg_controllen1 >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) + cmsg[1]->cmsg_len = cmsg_len[1]; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_level)) + cmsg[1]->cmsg_level = SOL_SOCKET; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_type)) + cmsg[1]->cmsg_type = SCM_RIGHTS; + size_t src1_len = + cmsg_len[1] < msg_controllen1 ? cmsg_len[1] : msg_controllen1; + if (src1_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg[1]), src[1], src1_len - CMSG_LEN(0)); + + mh->msg_control = cmsg[0]; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%lu" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned long) cmsg_len[0]); + print_fds(cmsg[0], cmsg_len[0]); + printf("}, {cmsg_len=%lu, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned long) cmsg_len[1]); + print_fds(cmsg[1], src1_len); + printf("}"); + if (aligned_cms_len[1] < msg_controllen1) + printf(", %p", (void *) cmsg[1] + aligned_cms_len[1]); + printf("]"); + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_scm_rights3(struct msghdr *const mh, void *const page, const size_t nfds) +{ + const size_t len = CMSG_SPACE(sizeof(int) * nfds); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(int) * nfds); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + int *fdp = (int *) CMSG_DATA(cmsg); + size_t i; + for (i = 0; i < nfds; ++i) + fdp[i] = i; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned) cmsg->cmsg_len); + print_fds(cmsg, cmsg->cmsg_len); + printf("}], msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) len, rc, errno2name()); +} + +static void +print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len) +{ + int n = cmsg_len > CMSG_LEN(0) ? cmsg_len - CMSG_LEN(0) : 0; + if (!n) + return; + + printf(", cmsg_data=\"%.*s\"", n, CMSG_DATA(cmsg)); +} + +static void +test_scm_security(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const void *const src, + const size_t cmsg_len, + const int cmsg_level, + const char *const cmsg_level_str) +{ + const size_t aligned_cms_len = + cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); + if (cmsg_len >= CMSG_LEN(0) + && aligned_cms_len + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen); + + cmsg->cmsg_len = cmsg_len; + cmsg->cmsg_level = cmsg_level; + cmsg->cmsg_type = SCM_SECURITY; + + size_t src_len = + cmsg_len < msg_controllen ? cmsg_len : msg_controllen; + if (src_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0)); + + mh->msg_control = cmsg; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%lu, cmsg_level=%s" + ", cmsg_type=SCM_SECURITY", + (unsigned long) cmsg_len, cmsg_level_str); + print_security(cmsg, src_len); + printf("}"); + if (aligned_cms_len < msg_controllen) + printf(", %p", (void *) cmsg + aligned_cms_len); + printf("]"); + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_unknown_type(struct msghdr *const mh, + void *const page, + const int cmsg_level, + const char *const cmsg_level_str, + const char *const cmsg_type_str) +{ + struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0)); + + cmsg->cmsg_len = CMSG_LEN(0); + cmsg->cmsg_level = cmsg_level; + cmsg->cmsg_type = 0xfacefeed; + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg->cmsg_len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=%s" + ", cmsg_type=%#x /* %s */}], msg_controllen=%u, msg_flags=0}" + ", 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_level_str, cmsg->cmsg_type, + cmsg_type_str, (unsigned) mh->msg_controllen, rc, errno2name()); +} + +static void +test_sol_socket(struct msghdr *const mh, void *const page) +{ + static const int fds0[] = { -10, -11, -12, -13 }; + static const int fds1[] = { -15, -16, -17, -18 }; + size_t msg_controllen, max_msg_controllen; + + max_msg_controllen = CMSG_SPACE(sizeof(fds0)) + sizeof(*fds0) - 1; + for (msg_controllen = 0; + msg_controllen <= max_msg_controllen; + msg_controllen++) { + size_t cmsg_len; + + for (cmsg_len = 0; + cmsg_len <= msg_controllen + CMSG_LEN(0); + cmsg_len++) { + test_scm_rights1(mh, msg_controllen, + page, fds0, cmsg_len); + } + } + + max_msg_controllen = + CMSG_SPACE(sizeof(fds0)) + CMSG_SPACE(sizeof(fds1)) + + sizeof(*fds0) - 1; + for (msg_controllen = CMSG_LEN(0) * 2; + msg_controllen <= max_msg_controllen; + msg_controllen++) { + static const int *const fdps[] = { fds0, fds1 }; + size_t cmsg_len[2]; + + for (cmsg_len[0] = CMSG_LEN(0); + CMSG_ALIGN(cmsg_len[0]) + CMSG_LEN(0) <= msg_controllen + && CMSG_ALIGN(cmsg_len[0]) <= CMSG_SPACE(sizeof(fds0)); + cmsg_len[0]++) { + const size_t msg_controllen1 = + msg_controllen - CMSG_ALIGN(cmsg_len[0]); + + for (cmsg_len[1] = 0; + cmsg_len[1] <= msg_controllen1 + CMSG_LEN(0); + cmsg_len[1]++) { + test_scm_rights2(mh, msg_controllen, + page, fdps, cmsg_len); + } + } + } + + static const char text[16] = "0123456789abcdef"; + max_msg_controllen = CMSG_SPACE(sizeof(text)) + CMSG_LEN(0) - 1; + for (msg_controllen = CMSG_LEN(0); + msg_controllen <= max_msg_controllen; + msg_controllen++) { + size_t cmsg_len; + + for (cmsg_len = 0; + cmsg_len <= msg_controllen + CMSG_LEN(0) + && cmsg_len <= CMSG_LEN(sizeof(text)); + cmsg_len++) { + test_scm_security(mh, msg_controllen, + page, text, cmsg_len, + ARG_STR(SOL_SOCKET)); + } + } + + test_scm_rights3(mh, page, DEFAULT_STRLEN - 1); + test_scm_rights3(mh, page, DEFAULT_STRLEN); + test_scm_rights3(mh, page, DEFAULT_STRLEN + 1); + + test_unknown_type(mh, page, ARG_STR(SOL_SOCKET), "SCM_???"); +} + +static void +test_ip_pktinfo(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct in_pktinfo)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct in_pktinfo *const info = (struct in_pktinfo *) CMSG_DATA(cmsg); +#ifdef HAVE_IF_INDEXTONAME + info->ipi_ifindex = if_nametoindex("lo"); +#else + info->ipi_ifindex = 1; +#endif + info->ipi_spec_dst.s_addr = inet_addr("1.2.3.4"); + info->ipi_addr.s_addr = inet_addr("5.6.7.8"); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={ipi_ifindex=%s" + ", ipi_spec_dst=inet_addr(\"%s\")" + ", ipi_addr=inet_addr(\"%s\")}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, +#ifdef HAVE_IF_INDEXTONAME + "if_nametoindex(\"lo\")", +#else + "1", +#endif + "1.2.3.4", "5.6.7.8", len, rc, errno2name()); +} + +static void +test_ip_uint(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(int)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + unsigned int *u = (void *) CMSG_DATA(cmsg); + *u = 0xfacefeed; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[%u]}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, *u, len, + rc, errno2name()); +} + +static void +test_ip_uint8_t(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(1); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(1); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + *CMSG_DATA(cmsg) = 'A'; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[%#x]}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + (unsigned) (uint8_t) 'A', len, rc, errno2name()); +} + +static void +print_ip_opts(const void *const cmsg_data, const unsigned int data_len) +{ + const unsigned char *const opts = cmsg_data; + unsigned int i; + for (i = 0; i < data_len; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("0x%02x", opts[i]); + } +} + +static void +test_ip_opts(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str, + const unsigned int opts_len) +{ + unsigned int len = CMSG_SPACE(opts_len); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(opts_len); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + unsigned int i; + for (i = 0; i < opts_len; ++i) + CMSG_DATA(cmsg)[i] = 'A' + i; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[", + (unsigned) cmsg->cmsg_len, cmsg_type_str); + print_ip_opts(CMSG_DATA(cmsg), opts_len); + printf("]}], msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + len, rc, errno2name()); +} + +#ifdef IP_CHECKSUM +struct sock_ee { + uint32_t ee_errno; + uint8_t ee_origin; + uint8_t ee_type; + uint8_t ee_code; + uint8_t ee_pad; + uint32_t ee_info; + uint32_t ee_data; + struct sockaddr_in offender; +}; + +static void +test_ip_recverr(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct sock_ee)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sock_ee)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct sock_ee *const e = (struct sock_ee *) CMSG_DATA(cmsg); + e->ee_errno = 0xdeadbeef; + e->ee_origin = 2; + e->ee_type = 3; + e->ee_code = 4; + e->ee_info = 0xfacefeed; + e->ee_data = 0xbadc0ded; + e->offender.sin_family = AF_INET, + e->offender.sin_port = htons(12345), + e->offender.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={ee_errno=%u, ee_origin=%u" + ", ee_type=%u, ee_code=%u, ee_info=%u, ee_data=%u" + ", offender={sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"127.0.0.1\")}}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + e->ee_errno, e->ee_origin, e->ee_type, + e->ee_code, e->ee_info, e->ee_data, + ntohs(e->offender.sin_port), + len, rc, errno2name()); +} +#endif + +#ifdef IP_ORIGDSTADDR +static void +test_ip_origdstaddr(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct sockaddr_in)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sockaddr_in)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct sockaddr_in *const sin = (struct sockaddr_in *) CMSG_DATA(cmsg); + sin->sin_family = AF_INET, + sin->sin_port = htons(12345), + sin->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={sa_family=AF_INET" + ", sin_port=htons(%hu), sin_addr=inet_addr(\"127.0.0.1\")}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + ntohs(sin->sin_port), len, rc, errno2name()); +} +#endif + +static void +test_sol_ip(struct msghdr *const mh, void *const page) +{ + test_ip_pktinfo(mh, page, ARG_STR(IP_PKTINFO)); + test_ip_uint(mh, page, ARG_STR(IP_TTL)); + test_ip_uint8_t(mh, page, ARG_STR(IP_TOS)); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 1); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 2); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 3); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 4); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 5); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 6); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 7); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 8); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN - 1); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN + 1); +#ifdef IP_CHECKSUM + test_ip_recverr(mh, page, ARG_STR(IP_RECVERR)); +#endif +#ifdef IP_ORIGDSTADDR + test_ip_origdstaddr(mh, page, ARG_STR(IP_ORIGDSTADDR)); +#endif +#ifdef IP_CHECKSUM + test_ip_uint(mh, page, ARG_STR(IP_CHECKSUM)); +#endif + test_scm_security(mh, CMSG_LEN(0), page, 0, CMSG_LEN(0), + ARG_STR(SOL_IP)); + test_unknown_type(mh, page, ARG_STR(SOL_IP), "IP_???"); +} + +static void +test_unknown_level(struct msghdr *const mh, void *const page) +{ + struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0)); + + cmsg->cmsg_len = CMSG_LEN(0); + cmsg->cmsg_level = SOL_TCP; + cmsg->cmsg_type = 0xdeadbeef; + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg->cmsg_len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=%s" + ", cmsg_type=%#x}], msg_controllen=%u, msg_flags=0}" + ", 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, "SOL_TCP", cmsg->cmsg_type, + (unsigned) mh->msg_controllen, rc, errno2name()); +} + +static void +test_big_len(struct msghdr *const mh) +{ + int optmem_max; + + if (read_int_from_file("/proc/sys/net/core/optmem_max", &optmem_max) + || optmem_max <= 0 || optmem_max > 0x100000) + optmem_max = sizeof(long long) * (2 * IOV_MAX + 512); + optmem_max = (optmem_max + sizeof(long long) - 1) + & ~(sizeof(long long) - 1); + + const size_t len = optmem_max * 2; + struct cmsghdr *const cmsg = tail_alloc(len); + cmsg->cmsg_len = len; + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + if (EBADF != errno) + perror_msg_and_skip("sendmsg"); + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned) cmsg->cmsg_len); + print_fds(cmsg, optmem_max); + printf("}, ...], msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) len, rc, errno2name()); +} + +int main(int ac, const char **av) +{ + int rc = sendmsg(-1, 0, 0); + printf("sendmsg(-1, NULL, 0) = %d %s (%m)\n", rc, errno2name()); + + struct msghdr *mh = tail_alloc(sizeof(*mh)); + memset(mh, 0, sizeof(*mh)); + test_big_len(mh); + + rc = sendmsg(-1, mh + 1, 0); + printf("sendmsg(-1, %p, 0) = %d %s (%m)\n", + mh + 1, rc, errno2name()); + + void *page = tail_alloc(1) + 1; + mh->msg_control = page; + mh->msg_controllen = CMSG_LEN(0); + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=%p, msg_controllen=%u" + ", msg_flags=0}, 0) = %d %s (%m)\n", + page, (unsigned) CMSG_LEN(0), rc, errno2name()); + + test_sol_socket(mh, page); + test_sol_ip(mh, page); + test_unknown_level(mh, page); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/msg_control.test b/tests-mx32/msg_control.test new file mode 100755 index 00000000..809ec7bb --- /dev/null +++ b/tests-mx32/msg_control.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of struct msghdr ancillary data. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests-mx32/msg_name.c b/tests-mx32/msg_name.c new file mode 100644 index 00000000..c2ddda2a --- /dev/null +++ b/tests-mx32/msg_name.c @@ -0,0 +1,160 @@ +/* + * Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static int +send_recv(const int send_fd, const int recv_fd, + struct msghdr *const msg, const int flags) +{ + if (send(send_fd, "A", 1, 0) != 1) + perror_msg_and_skip("send"); + return recvmsg(recv_fd, msg, flags); +} + +static void +test_msg_name(const int send_fd, const int recv_fd) +{ + char *const recv_buf = tail_alloc(sizeof(*recv_buf)); + struct iovec *const iov = tail_alloc(sizeof(*iov)); + iov->iov_base = recv_buf; + iov->iov_len = sizeof(*recv_buf); + + struct sockaddr_un *const addr = tail_alloc(sizeof(*addr)); + struct msghdr *const msg = tail_alloc(sizeof(*msg)); + msg->msg_name = addr; + msg->msg_namelen = sizeof(*addr); + msg->msg_iov = iov; + msg->msg_iovlen = 1; + msg->msg_control = 0; + msg->msg_controllen = 0; + msg->msg_flags = 0; + + int rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("recvmsg"); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%s\"}" + ", msg_namelen=%d->%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, addr->sun_path, (int) sizeof(struct sockaddr_un), + (int) msg->msg_namelen, rc); + + memset(addr, 0, sizeof(*addr)); + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%s\"}" + ", msg_namelen=%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, addr->sun_path, (int) msg->msg_namelen, rc); + + msg->msg_name = 0; + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name=NULL, msg_namelen=%d" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, MSG_DONTWAIT) = %d\n", + recv_fd, (int) msg->msg_namelen, rc); + + const size_t offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + msg->msg_name = addr; + msg->msg_namelen = offsetof_sun_path; + memset(addr->sun_path, 'A', sizeof(addr->sun_path)); + + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX}, msg_namelen=%d->%d" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, MSG_DONTWAIT) = %d\n", + recv_fd, (int) offsetof_sun_path, (int) msg->msg_namelen, rc); + + msg->msg_namelen = sizeof(struct sockaddr); + msg->msg_name = ((void *) (addr + 1)) - msg->msg_namelen; + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%.*s\"}" + ", msg_namelen=%d->%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, (int) (sizeof(struct sockaddr) - offsetof_sun_path), + ((struct sockaddr_un *) msg->msg_name)->sun_path, + (int) sizeof(struct sockaddr), (int) msg->msg_namelen, rc); + + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_namelen=%d}, MSG_DONTWAIT) = %d %s (%m)\n", + recv_fd, (int) msg->msg_namelen, rc, errno2name()); + + /* + * When recvmsg is called with a valid descriptor + * but inaccessible memory, it causes segfaults on some architectures. + * As in these cases we test decoding of failed recvmsg calls, + * it's ok to fail recvmsg with any reason as long as + * it doesn't read that inaccessible memory. + */ + + /* + * Sadly, musl recvmsg wrapper blindly dereferences 2nd argument, + * so limit this test to glibc that doesn't. + */ +#ifdef __GLIBC__ + rc = send_recv(send_fd, -1, msg + 1, 0); + printf("recvmsg(-1, %p, 0) = %d %s (%m)\n", + msg + 1, rc, errno2name()); +#endif + + rc = send_recv(send_fd, -1, 0, 0); + printf("recvmsg(-1, NULL, 0) = %d %s (%m)\n", + rc, errno2name()); +} + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = "msg_name-recvmsg.test.send.socket" + }; + + (void) unlink(un.sun_path); + if (bind(fds[1], (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + test_msg_name(fds[1], fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/msg_name.test b/tests-mx32/msg_name.test new file mode 100755 index 00000000..ac06dd55 --- /dev/null +++ b/tests-mx32/msg_name.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests-mx32/munlockall.c b/tests-mx32/munlockall.c new file mode 100644 index 00000000..9ac69423 --- /dev/null +++ b/tests-mx32/munlockall.c @@ -0,0 +1,13 @@ +#include "tests.h" + +#include +#include + +int +main(void) +{ + printf("munlockall() = %d\n", munlockall()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/munlockall.test b/tests-mx32/munlockall.test new file mode 100755 index 00000000..e25d60a8 --- /dev/null +++ b/tests-mx32/munlockall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check munlockall syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-mx32/nanosleep.c b/tests-mx32/nanosleep.c new file mode 100644 index 00000000..9f0e626f --- /dev/null +++ b/tests-mx32/nanosleep.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } req = { + .ts.tv_nsec = 0xc0de1, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, rem = { + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + + if (nanosleep(&req.ts, NULL)) + perror_msg_and_fail("nanosleep"); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, NULL) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + assert(nanosleep(NULL, &rem.ts) == -1); + printf("nanosleep(NULL, %p) = -1 EFAULT (%m)\n", &rem.ts); + + if (nanosleep(&req.ts, &rem.ts)) + perror_msg_and_fail("nanosleep"); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + req.ts.tv_nsec = 1000000000; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" + ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", + (intmax_t) itv.it_interval.tv_sec, + (intmax_t) itv.it_interval.tv_usec, + (intmax_t) itv.it_value.tv_sec, + (intmax_t) itv.it_value.tv_usec); + + req.ts.tv_nsec = 999999999; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, {tv_sec=%jd, tv_nsec=%jd})" + " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, + (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nanosleep.test b/tests-mx32/nanosleep.test new file mode 100755 index 00000000..055a8dcd --- /dev/null +++ b/tests-mx32/nanosleep.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check nanosleep and setitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=nanosleep,setitimer diff --git a/tests-mx32/net-accept-connect.c b/tests-mx32/net-accept-connect.c new file mode 100644 index 00000000..04c05a60 --- /dev/null +++ b/tests-mx32/net-accept-connect.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +handler(int sig) +{ + assert(close(1) == 0); + _exit(0); +} + +int +main(int ac, const char **av) +{ + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + }; + socklen_t len; + + assert(ac == 2); + assert(strlen(av[1]) > 0); + + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (len > sizeof(addr)) + len = sizeof(addr); + + unlink(av[1]); + close(0); + close(1); + + if (socket(AF_UNIX, SOCK_STREAM, 0)) + perror_msg_and_skip("socket"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + + memset(&addr, 0, sizeof addr); + assert(getsockname(0, (struct sockaddr *) &addr, &len) == 0); + if (len > sizeof(addr)) + len = sizeof(addr); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (pid) { + assert(accept(0, (struct sockaddr *) &addr, &len) == 1); + assert(close(0) == 0); + assert(kill(pid, SIGUSR1) == 0); + int status; + assert(waitpid(pid, &status, 0) == pid); + assert(status == 0); + assert(close(1) == 0); + } else { + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGUSR1); + + assert(sigprocmask(SIG_BLOCK, &set, NULL) == 0); + assert(signal(SIGUSR1, handler) != SIG_ERR); + assert(socket(AF_UNIX, SOCK_STREAM, 0) == 1); + assert(close(0) == 0); + assert(connect(1, (struct sockaddr *) &addr, len) == 0); + assert(sigprocmask(SIG_UNBLOCK, &set, NULL) == 0); + assert(pause() == 99); + return 1; + } + + unlink(av[1]); + return 0; +} diff --git a/tests-mx32/net-icmp_filter.c b/tests-mx32/net-icmp_filter.c new file mode 100644 index 00000000..f3f99f14 --- /dev/null +++ b/tests-mx32/net-icmp_filter.c @@ -0,0 +1,84 @@ +/* + * Check decoding of ICMP_FILTER. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + getsockopt(-1, SOL_RAW, ICMP_FILTER, 0, 0); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, NULL) = -1 %s (%m)\n", + errno2name()); + + setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0); + printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0) = -1 %s (%m)\n", + errno2name()); + + socklen_t *const plen = tail_alloc(sizeof(*plen)); + void *const efault = plen + 1; + struct icmp_filter *const f = tail_alloc(sizeof(*f)); + + getsockopt(-1, SOL_RAW, ICMP_FILTER, f, plen); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %p) = -1 %s (%m)\n", + f, plen, errno2name()); + + setsockopt(-1, SOL_RAW, ICMP_FILTER, efault, sizeof(*f)); + printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %u) = -1 %s (%m)\n", + efault, (unsigned) sizeof(*f), errno2name()); + + f->data = ~( + 1< + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include +# include +# include +# include +#endif + +#ifdef HAVE_IF_INDEXTONAME +/* used to conflict with */ +extern unsigned int if_nametoindex(const char *); +#endif + +static void +check_un(void) +{ + struct sockaddr_un *un = tail_alloc(sizeof(*un)); + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + unsigned int len = sizeof(*un); + int ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[1] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%u\"}, %u)" + " = %d EBADF (%m)\n", 0, len, ret); + + un->sun_path[0] = 0; + un->sun_path[2] = 1; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"\\0\\001%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 3, 0, len, ret); + + un = ((void *) un) - 2; + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + len = sizeof(*un) + 2; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 1, 0, len, ret); + + un = ((void *) un) + 4; + un->sun_family = AF_UNIX; + len = sizeof(*un) - 2; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 2, 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 3, 0, len, ret); + + len = sizeof(*un); + ret = connect(-1, (void *) un, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", un, len, ret); + + un = tail_alloc(sizeof(struct sockaddr_storage)); + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + len = sizeof(struct sockaddr_storage) + 1; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 1, 0, len, ret); +} + +static void +check_in(void) +{ + const unsigned short h_port = 12345; + static const char h_addr[] = "12.34.56.78"; + + struct sockaddr_in *in = tail_alloc(sizeof(*in)); + in->sin_family = AF_INET; + in->sin_port = htons(h_port); + in->sin_addr.s_addr = inet_addr(h_addr); + unsigned int len = sizeof(*in); + int ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %d EBADF (%m)\n", + h_port, h_addr, len, ret); + + in = ((void *) in) - 4; + in->sin_family = AF_INET; + in->sin_port = htons(h_port); + in->sin_addr.s_addr = inet_addr(h_addr); + len = sizeof(*in) + 4; + ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %d EBADF (%m)\n", + h_port, h_addr, len, ret); + + in = ((void *) in) + 8; + in->sin_family = AF_INET; + in->sin_port = 0; + in->sin_addr.s_addr = 0; + len = sizeof(*in) - 4; + ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sa_data=\"%s\"}, %u)" + " = %d EBADF (%m)\n", + "\\0\\0\\0\\0\\0\\0\\377\\377\\377\\377", + len, ret); + + len = sizeof(*in); + ret = connect(-1, (void *) in, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in, len, ret); +} + +static void +check_in6_linklocal(struct sockaddr_in6 *const in6, const char *const h_addr) +{ + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + + in6->sin6_scope_id = 0xfacefeed; + unsigned int len = sizeof(*in6); + int ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)" + ", sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + ntohs(in6->sin6_port), h_addr, + ntohl(in6->sin6_flowinfo), in6->sin6_scope_id, len, ret); + +#ifdef HAVE_IF_INDEXTONAME + in6->sin6_scope_id = if_nametoindex("lo"); + if (in6->sin6_scope_id) { + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)" + ", sin6_scope_id=if_nametoindex(\"lo\")}, %u)" + " = %d EBADF (%m)\n", + ntohs(in6->sin6_port), h_addr, + ntohl(in6->sin6_flowinfo), len, ret); + } +#endif +} + +static void +check_in6(void) +{ + const unsigned short h_port = 12345; + const unsigned int h_flowinfo = 1234567890; + static const char h_addr[] = "12:34:56:78:90:ab:cd:ef"; + + struct sockaddr_in6 *in6 = tail_alloc(sizeof(*in6)); + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + in6->sin6_scope_id = 0xfacefeed; + unsigned int len = sizeof(*in6); + int ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + + check_in6_linklocal(in6, "fe80::"); + check_in6_linklocal(in6, "ff42::"); + + in6 = ((void *) in6) - 4; + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + in6->sin6_scope_id = 0xfacefeed; + len = sizeof(*in6) + 4; + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + + in6 = ((void *) in6) + 4 + sizeof(in6->sin6_scope_id); + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + len = sizeof(*in6) - sizeof(in6->sin6_scope_id); + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, len, ret); + + in6 = ((void *) in6) + 4; + in6->sin6_family = AF_INET6; + in6->sin6_port = 0; + in6->sin6_flowinfo = 0; + memset(&in6->sin6_addr, '0', sizeof(in6->sin6_addr) - 4); + len = sizeof(*in6) - sizeof(in6->sin6_scope_id) - 4; + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6" + ", sa_data=\"\\0\\0\\0\\0\\0\\000%.*u\"}, %u)" + " = %d EBADF (%m)\n", + (int) (len - offsetof(struct sockaddr_in6, sin6_addr)), 0, + len, ret); + + len = sizeof(*in6) - sizeof(in6->sin6_scope_id); + ret = connect(-1, (void *) in6, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in6, len, ret); +} + +static void +check_ipx(void) +{ + const unsigned short h_port = 12345; + const unsigned int h_network = 0xfacefeed; + struct sockaddr_ipx c_ipx = { + .sipx_family = AF_IPX, + .sipx_port = htons(h_port), + .sipx_network = htonl(h_network), + .sipx_node = "ABCDEF", + .sipx_type = -1 + }; + void *ipx = tail_memdup(&c_ipx, sizeof(c_ipx)); + unsigned int len = sizeof(c_ipx); + int ret = connect(-1, ipx, len); + printf("connect(-1, {sa_family=AF_IPX, sipx_port=htons(%u)" + ", sipx_network=htonl(%#x)" + ", sipx_node=[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + ", sipx_type=%#02x}, %u) = %d EBADF (%m)\n", + h_port, h_network, + c_ipx.sipx_node[0], c_ipx.sipx_node[1], + c_ipx.sipx_node[2], c_ipx.sipx_node[3], + c_ipx.sipx_node[4], c_ipx.sipx_node[5], + c_ipx.sipx_type, len, ret); +} + +static void +check_nl(void) +{ + struct sockaddr_nl *nl = tail_alloc(sizeof(*nl)); + nl->nl_family = AF_NETLINK; + nl->nl_pid = 1234567890; + nl->nl_groups = 0xfacefeed; + unsigned int len = sizeof(*nl); + int ret = connect(-1, (void *) nl, len); + printf("connect(-1, {sa_family=AF_NETLINK, nl_pid=%d" + ", nl_groups=%#08x}, %u) = %d EBADF (%m)\n", + nl->nl_pid, nl->nl_groups, len, ret); + + nl = ((void *) nl) - 4; + nl->nl_family = AF_NETLINK; + nl->nl_pid = 1234567890; + nl->nl_groups = 0xfacefeed; + len = sizeof(*nl) + 4; + ret = connect(-1, (void *) nl, len); + printf("connect(-1, {sa_family=AF_NETLINK, nl_pid=%d" + ", nl_groups=%#08x}, %u) = %d EBADF (%m)\n", + nl->nl_pid, nl->nl_groups, len, ret); +} + +static void +check_ll(void) +{ + struct sockaddr_ll c_ll = { + .sll_family = AF_PACKET, + .sll_protocol = htons(ETH_P_ALL), + .sll_ifindex = 0xfacefeed, + .sll_hatype = ARPHRD_ETHER, + .sll_pkttype = PACKET_HOST, + .sll_halen = sizeof(c_ll.sll_addr), + .sll_addr = "abcdefgh" + }; + void *ll = tail_memdup(&c_ll, sizeof(c_ll)); + unsigned int len = sizeof(c_ll); + int ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %d EBADF (%m)\n", + c_ll.sll_ifindex, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, ret); + + ((struct sockaddr_ll *) ll)->sll_halen++; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, ...]" + "}, %u) = %d EBADF (%m)\n", + c_ll.sll_ifindex, c_ll.sll_halen + 1, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, ret); + + ((struct sockaddr_ll *) ll)->sll_halen = 0; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" + " = %d EBADF (%m)\n", c_ll.sll_ifindex, len, ret); + +#ifdef HAVE_IF_INDEXTONAME + const int id = if_nametoindex("lo"); + if (id) { + ((struct sockaddr_ll *) ll)->sll_ifindex = id; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=if_nametoindex(\"lo\")" + ", sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" + " = %d EBADF (%m)\n", len, ret); + } +#endif +} + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static void +check_hci(void) +{ + const unsigned short h_port = 12345; + struct sockaddr_hci *hci = tail_alloc(sizeof(*hci)); + hci->hci_family = AF_BLUETOOTH; + hci->hci_dev = htobs(h_port); + hci->hci_channel = HCI_CHANNEL_RAW; + unsigned int len = sizeof(*hci); + int ret = connect(-1, (void *) hci, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" + ", hci_channel=HCI_CHANNEL_RAW}, %u) = %d EBADF (%m)\n", + h_port, len, ret); +} + +static void +check_sco(void) +{ + const struct sockaddr_sco c_sco = { + .sco_family = AF_BLUETOOTH, + .sco_bdaddr.b = "abcdef" + }; + void *sco = tail_memdup(&c_sco, sizeof(c_sco)); + unsigned int len = sizeof(c_sco); + int ret = connect(-1, sco, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + "}, %u) = %d EBADF (%m)\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, ret); +} + +static void +check_rc(void) +{ + const struct sockaddr_rc c_rc = { + .rc_family = AF_BLUETOOTH, + .rc_bdaddr.b = "abcdef", + .rc_channel = 42 + }; + void *rc = tail_memdup(&c_rc, sizeof(c_rc)); + unsigned int len = sizeof(c_rc); + int ret = connect(-1, rc, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", rc_channel=%u}, %u) = %d EBADF (%m)\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, ret); +} + +static void +check_l2(void) +{ + const unsigned short h_psm = 12345; + const unsigned short h_cid = 13579; + const struct sockaddr_l2 c_l2 = { + .l2_family = AF_BLUETOOTH, + .l2_psm = htobs(h_psm), + .l2_bdaddr.b = "abcdef", + .l2_cid = htobs(h_cid), + .l2_bdaddr_type = 42 + }; + void *l2 = tail_memdup(&c_l2, sizeof(c_l2)); + unsigned int len = sizeof(c_l2); + int ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(%hu)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(%hu), l2_bdaddr_type=%u}" + ", %u) = %d EBADF (%m)\n", h_psm, + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + h_cid, c_l2.l2_bdaddr_type, len, ret); +} +#endif + +static void +check_raw(void) +{ + union { + struct sockaddr *sa; + struct sockaddr_storage *st; + } u = { .st = tail_alloc(sizeof(*u.st)) }; + memset(u.st, '0', sizeof(*u.st)); + u.sa->sa_family = 0xff; + unsigned int len = sizeof(*u.st) + 8; + int ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=%#x /* AF_??? */, sa_data=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", u.sa->sa_family, + (int) (sizeof(*u.st) - sizeof(u.sa->sa_family)), 0, len, ret); + + u.sa->sa_family = 0; + len = sizeof(u.sa->sa_family) + 1; + ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=AF_UNSPEC, sa_data=\"0\"}, %u)" + " = %d EBADF (%m)\n", len, ret); + + u.sa->sa_family = AF_BLUETOOTH; + ++len; + ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"00\"}, %u)" + " = %d EBADF (%m)\n", len, ret); +} + +int +main(void) +{ + check_un(); + check_in(); + check_in6(); + check_ipx(); + check_nl(); + check_ll(); +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + check_hci(); + check_sco(); + check_rc(); + check_l2(); +#endif + check_raw(); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-sockaddr.test b/tests-mx32/net-sockaddr.test new file mode 100755 index 00000000..cdfe536f --- /dev/null +++ b/tests-mx32/net-sockaddr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sockaddr structures. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=connect diff --git a/tests-mx32/net-y-unix.c b/tests-mx32/net-y-unix.c new file mode 100644 index 00000000..3efc2f64 --- /dev/null +++ b/tests-mx32/net-y-unix.c @@ -0,0 +1,235 @@ +/* + * This file is part of net-y-unix strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int ac, const char **av) +{ + assert(ac == 2); + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + unsigned int sun_path_len = strlen(av[1]); + assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (*len > sizeof(addr)) + *len = sizeof(addr); + + int listen_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + listen_fd, listen_inode); + + (void) unlink(av[1]); + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], [%u]) = 0\n", + listen_fd, listen_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], (int) sizeof(addr), (int) *len); + + int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + unsigned long accept_inode = inode_of_sockfd(accept_fd); + printf("accept(%d, {sa_family=AF_UNIX}" + ", [%d->%d]) = %d\n", + listen_fd, listen_inode, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, + av[1], (int) sizeof(addr), (int) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d) = 0\n", connect_fd, connect_inode); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d) = 0\n", accept_fd, accept_inode); + + connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + *optval = 1; + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_SOCKET, SO_PASSCRED, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], %u) = 0\n", + connect_fd, connect_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + listen_fd, listen_inode, av[1], + (int) sizeof(addr), (int) *len); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + accept_inode = inode_of_sockfd(accept_fd); + const char * const sun_path1 = + ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + printf("accept(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = %d\n", + listen_fd, listen_inode, sun_path1, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, av[1], + (int) sizeof(addr), (int) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(connect_fd, accept_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, sun_path1, + (int) sizeof(addr), (int) *len); + + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d) = 0\n", connect_fd, connect_inode); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d) = 0\n", accept_fd, accept_inode); + + assert(unlink(av[1]) == 0); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_inode); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-y-unix.test b/tests-mx32/net-y-unix.test new file mode 100755 index 00000000..aec8159f --- /dev/null +++ b/tests-mx32/net-y-unix.test @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Check decoding of network syscalls in -y mode. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -y is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed + +addr="$NAME-local-stream" +run_prog "./$NAME" $addr > /dev/null + +run_strace -a20 -y -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net-yy-inet.c b/tests-mx32/net-yy-inet.c new file mode 100644 index 00000000..f76f941d --- /dev/null +++ b/tests-mx32/net-yy-inet.c @@ -0,0 +1,173 @@ +/* + * This file is part of net-yy-inet strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + const struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + }; + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = sizeof(addr); + + const int listen_fd = socket(AF_INET, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + const unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + listen_fd, listen_inode); + + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_INET, sin_port=htons(0)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + listen_fd, listen_inode, (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + const unsigned int listen_port = + ntohs(((struct sockaddr_in *) listen_sa) -> sin_port); + printf("getsockname(%d, {sa_family=AF_INET" + ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ", [%u]) = 0\n", + listen_fd, listen_port, listen_port, (unsigned) *len); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_TCP, TCP_MAXSEG, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_TCP, TCP_MAXSEG" + ", [%u], [%u]) = 0\n", + listen_fd, listen_port, *optval, (unsigned) *len); + + const int connect_fd = socket(AF_INET, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + const unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + connect_fd, connect_inode); + + *len = sizeof(addr); + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + connect_fd, connect_inode, listen_port, (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + const int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + const unsigned int connect_port = + ntohs(((struct sockaddr_in *) accept_sa) -> sin_port); + printf("accept(%d, {sa_family=AF_INET" + ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ", [%u]) = %d127.0.0.1:%u]>\n", + listen_fd, listen_port, connect_port, (unsigned) *len, + accept_fd, listen_port, connect_port); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(accept_fd, accept_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d127.0.0.1:%u]>" + ", {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + accept_fd, listen_port, connect_port, connect_port, + (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d127.0.0.1:%u]>" + ", {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + connect_fd, connect_port, listen_port, listen_port, + (unsigned) *len); + + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_TCP, TCP_MAXSEG, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d127.0.0.1:%u]>" + ", SOL_TCP, TCP_MAXSEG, [%u], %u) = 0\n", + connect_fd, connect_port, listen_port, *optval, + (unsigned) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, + MSG_DONTROUTE | MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); + printf("sendto(%d127.0.0.1:%u]>, \"%s\", %u" + ", MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", + connect_fd, connect_port, listen_port, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d127.0.0.1:%u]>) = 0\n", + connect_fd, connect_port, listen_port); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_WAITALL, + NULL, NULL) == sizeof(text) - 1); + printf("recvfrom(%d127.0.0.1:%u]>, \"%s\", %u" + ", MSG_WAITALL, NULL, NULL) = %u\n", + accept_fd, listen_port, connect_port, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d127.0.0.1:%u]>) = 0\n", + accept_fd, listen_port, connect_port); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_port); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-yy-inet.test b/tests-mx32/net-yy-inet.test new file mode 100755 index 00000000..2ebf91fa --- /dev/null +++ b/tests-mx32/net-yy-inet.test @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Check decoding of ip:port pairs associated with socket descriptors +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_inet_diag + +run_prog "./$NAME" > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net-yy-netlink.c b/tests-mx32/net-yy-netlink.c new file mode 100644 index 00000000..64d0efca --- /dev/null +++ b/tests-mx32/net-yy-netlink.c @@ -0,0 +1,84 @@ +/* + * This file is part of net-yy-netlink strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +int +main(void) +{ + unsigned magic = 1234; + struct sockaddr_nl addr = { + .nl_family = AF_NETLINK, + .nl_pid = 1234 + }; + struct sockaddr *const sa = tail_memdup(&addr, sizeof(addr)); + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = sizeof(addr); + + const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); + if (fd < 0) + perror_msg_and_skip("socket"); + const unsigned long inode = inode_of_sockfd(fd); + printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = " + "%d\n", fd, inode); + + if (bind(fd, sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_NETLINK" + ", nl_pid=%u, nl_groups=00000000}, %u) = 0\n", + fd, inode, magic, (unsigned) *len); + + if (getsockname(fd, sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_NETLINK" + ", nl_pid=%u, nl_groups=00000000}, [%u]) = 0\n", + fd, magic, magic, (unsigned) *len); + + if (close(fd)) + perror_msg_and_fail("close"); + printf("close(%d) = 0\n", fd, magic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-yy-netlink.test b/tests-mx32/net-yy-netlink.test new file mode 100755 index 00000000..bff1d861 --- /dev/null +++ b/tests-mx32/net-yy-netlink.test @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check decoding of protocol:portid pairs associated with socket +# descriptors +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2016 Fabien Siron +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_netlink_diag + +run_prog "./$NAME" > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net-yy-unix.c b/tests-mx32/net-yy-unix.c new file mode 100644 index 00000000..63637bdd --- /dev/null +++ b/tests-mx32/net-yy-unix.c @@ -0,0 +1,229 @@ +/* + * This file is part of net-yy-unix strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int ac, const char **av) +{ + assert(ac == 2); + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + unsigned int sun_path_len = strlen(av[1]); + assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (*len > sizeof(addr)) + *len = sizeof(addr); + + int listen_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + listen_fd, listen_inode); + + (void) unlink(av[1]); + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", + listen_fd, listen_inode, av[1]); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], [%u]) = 0\n", + listen_fd, listen_inode, av[1], *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], av[1], (int) sizeof(addr), (int) *len); + + int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + unsigned long accept_inode = inode_of_sockfd(accept_fd); + printf("accept(%d, {sa_family=AF_UNIX}" + ", [%d->%d]) = %d%lu,\"%s\"]>\n", + listen_fd, listen_inode, av[1], (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, av[1]); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d%lu]>, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, + accept_inode, av[1], (int) sizeof(addr), (int) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d%lu]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, connect_inode, av[1], text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d%lu]>) = 0\n", + connect_fd, connect_inode, accept_inode); + + assert(close(accept_fd) == 0); + printf("close(%d%lu,\"%s\"]>) = 0\n", + accept_fd, accept_inode, connect_inode, av[1]); + + connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + *optval = 1; + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_SOCKET, SO_PASSCRED, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], %u) = 0\n", + connect_fd, connect_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], av[1], (int) sizeof(addr), (int) *len); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + accept_inode = inode_of_sockfd(accept_fd); + const char * const sun_path1 = + ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + printf("accept(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = %d%lu,\"%s\"]>\n", + listen_fd, listen_inode, av[1], sun_path1, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, av[1]); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d%lu,@\"%s\"]>, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, + accept_inode, sun_path1, av[1], (int) sizeof(addr), (int) *len); + + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d%lu,@\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, accept_inode, sun_path1, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, connect_inode, av[1], text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d%lu,@\"%s\"]>) = 0\n", + connect_fd, connect_inode, accept_inode, sun_path1); + + assert(close(accept_fd) == 0); + printf("close(%d%lu,\"%s\"]>) = 0\n", + accept_fd, accept_inode, connect_inode, av[1]); + + assert(unlink(av[1]) == 0); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_inode, av[1]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-yy-unix.test b/tests-mx32/net-yy-unix.test new file mode 100755 index 00000000..b82761c3 --- /dev/null +++ b/tests-mx32/net-yy-unix.test @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check decoding of address information (inode[->peer][,path]) +# associated with unix domain socket descriptors. +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_unix_diag + +addr="$NAME-local-stream" +run_prog "./$NAME" $addr > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net.expected b/tests-mx32/net.expected new file mode 100644 index 00000000..80dd0701 --- /dev/null +++ b/tests-mx32/net.expected @@ -0,0 +1,7 @@ +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +socket\(AF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +socket\(AF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +listen\(0, 5\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, \[19\]\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\]\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 diff --git a/tests-mx32/net.test b/tests-mx32/net.test new file mode 100755 index 00000000..cf943ffa --- /dev/null +++ b/tests-mx32/net.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check how network syscalls are traced. + +. "${srcdir=.}/init.sh" + +run_prog ./net-accept-connect net-local-stream +run_strace_merge -enetwork $args +match_grep + +exit 0 diff --git a/tests-mx32/netlink_inet_diag.c b/tests-mx32/netlink_inet_diag.c new file mode 100644 index 00000000..2332e203 --- /dev/null +++ b/tests-mx32/netlink_inet_diag.c @@ -0,0 +1,144 @@ +/* + * This file is part of inet-yy strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +static void +send_query(const int fd, const int family, const int proto) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct inet_diag_req_v2 idr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .idr = { + .sdiag_family = family, + .sdiag_protocol = proto, + .idiag_states = -1 + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct inet_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +int main(void) +{ + struct sockaddr_in addr; + socklen_t len = sizeof(addr); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + close(0); + close(1); + + if (socket(AF_INET, SOCK_STREAM, 0)) + perror_msg_and_skip("socket AF_INET"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1, AF_INET, IPPROTO_TCP); + check_responses(1); + return 0; +} diff --git a/tests-mx32/netlink_netlink_diag.c b/tests-mx32/netlink_netlink_diag.c new file mode 100644 index 00000000..fc32822b --- /dev/null +++ b/tests-mx32/netlink_netlink_diag.c @@ -0,0 +1,147 @@ +/* + * This file is part of net-yy-netlink strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +static void +send_query(const int fd) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct netlink_diag_req ndr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .ndr = { + .sdiag_family = AF_NETLINK, + .sdiag_protocol = NDIAG_PROTO_ALL, + .ndiag_show = NDIAG_SHOW_MEMINFO + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct netlink_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +int main(void) +{ + struct sockaddr_nl addr; + socklen_t len = sizeof(addr); + + memset(&addr, 0, sizeof(addr)); + addr.nl_family = AF_NETLINK; + + close(0); + close(1); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) + perror_msg_and_skip("socket AF_NETLINK"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1); + check_responses(1); + return 0; +} diff --git a/tests-mx32/netlink_protocol.c b/tests-mx32/netlink_protocol.c new file mode 100644 index 00000000..34e114be --- /dev/null +++ b/tests-mx32/netlink_protocol.c @@ -0,0 +1,240 @@ +/* + * Check decoding of netlink protocol. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +# endif + +static void +send_query(const int fd) +{ + static const struct req { + struct nlmsghdr nlh; + const char magic[4]; + } c_req = { + .nlh = { + .nlmsg_len = sizeof(struct req), + .nlmsg_type = NLMSG_NOOP, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .magic = "abcd" + }; + struct req *const req = tail_memdup(&c_req, sizeof(c_req)); + long rc; + const char *errstr; + + /* zero address */ + rc = sendto(fd, NULL, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, NULL, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, (unsigned) sizeof(*req), sprintrc(rc)); + + /* zero length */ + rc = sendto(fd, req, 0, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, \"\", 0, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, sprintrc(rc)); + + /* zero address and length */ + rc = sendto(fd, NULL, 0, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, NULL, 0, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, sprintrc(rc)); + + /* unfetchable struct nlmsghdr */ + const void *const efault = tail_alloc(sizeof(struct nlmsghdr) - 1); + rc = sendto(fd, efault, sizeof(struct nlmsghdr), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, %p, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, efault, (unsigned) sizeof(struct nlmsghdr), sprintrc(rc)); + + /* whole message length < sizeof(struct nlmsghdr) */ + rc = sendto(fd, req->magic, sizeof(req->magic), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, \"abcd\", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, (unsigned) sizeof(req->magic), sprintrc(rc)); + + /* a single message with some data */ + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* a single message without data */ + req->nlh.nlmsg_len = sizeof(req->nlh); + rc = sendto(fd, &req->nlh, sizeof(req->nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(req->nlh), sprintrc(rc)); + + /* nlmsg_len > whole message length */ + req->nlh.nlmsg_len = sizeof(*req) + 8; + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* nlmsg_len < sizeof(struct nlmsghdr) */ + req->nlh.nlmsg_len = 8; + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* a sequence of two nlmsg objects */ + struct reqs { + struct req req1; + char padding[NLMSG_ALIGN(sizeof(struct req)) - sizeof(struct req)]; + struct req req2; + } *const reqs = tail_alloc(sizeof(*reqs)); + memcpy(&reqs->req1, &c_req, sizeof(c_req)); + memcpy(&reqs->req2, &c_req, sizeof(c_req)); + + rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}, \"abcd\"}]" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*reqs), sprintrc(rc)); + + /* unfetchable second struct nlmsghdr */ + void *const efault2 = tail_memdup(&reqs->req1, sizeof(reqs->req1)); + rc = sendto(fd, efault2, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %p], %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + &((struct reqs *) efault2)->req2, (unsigned) sizeof(*reqs), + sprintrc(rc)); + + /* message length is not enough for the second struct nlmsghdr */ + rc = sendto(fd, reqs, sizeof(*reqs) - sizeof(req->nlh), MSG_DONTWAIT, + NULL, 0); + errstr = sprintrc(rc); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, \"", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP); + print_quoted_memory((void *) &reqs->req2.nlh, + sizeof(reqs->req2) - sizeof(req->nlh)); + printf("\"], %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (unsigned) (sizeof(*reqs) - sizeof(req->nlh)), errstr); + + /* second nlmsg_len < sizeof(struct nlmsghdr) */ + reqs->req2.nlh.nlmsg_len = 4; + rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}}], %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*reqs), sprintrc(rc)); + + /* abbreviated output */ +# define DEFAULT_STRLEN 32 +# define ABBREV_LEN (DEFAULT_STRLEN + 1) + const unsigned int msg_len = sizeof(struct nlmsghdr) * ABBREV_LEN; + struct nlmsghdr *const msgs = tail_alloc(msg_len); + unsigned int i; + for (i = 0; i < ABBREV_LEN; ++i) { + msgs[i].nlmsg_len = sizeof(*msgs); + msgs[i].nlmsg_type = NLMSG_NOOP; + msgs[i].nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + msgs[i].nlmsg_seq = i; + msgs[i].nlmsg_pid = 0; + } + + rc = sendto(fd, msgs, msg_len, MSG_DONTWAIT, NULL, 0); + errstr = sprintrc(rc); + printf("sendto(%d, [", fd); + for (i = 0; i < DEFAULT_STRLEN; ++i) { + if (i) + printf(", "); + printf("{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=0}}", + msgs[i].nlmsg_len, NLM_F_DUMP, msgs[i].nlmsg_seq); + } + printf(", ...], %u, MSG_DONTWAIT, NULL, 0) = %s\n", msg_len, errstr); +} + +int main(void) +{ + struct sockaddr_nl addr; + socklen_t len = sizeof(addr); + int fd; + + memset(&addr, 0, sizeof(addr)); + addr.nl_family = AF_NETLINK; + + if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) == -1) + perror_msg_and_skip("socket AF_NETLINK"); + + printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = %d\n", + fd); + if (bind(fd, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}" + ", %u) = 0\n", fd, len); + + char *path; + if (asprintf(&path, "/proc/self/fd/%u", fd) < 0) + perror_msg_and_fail("asprintf"); + char buf[256]; + if (getxattr(path, "system.sockprotoname", buf, sizeof(buf) - 1) < 0) + perror_msg_and_skip("getxattr"); + free(path); + + send_query(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests-mx32/netlink_protocol.test b/tests-mx32/netlink_protocol.test new file mode 100755 index 00000000..ab2bb1e8 --- /dev/null +++ b/tests-mx32/netlink_protocol.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding of netlink protocol. + +. "${srcdir=.}/init.sh" + +# getfdproto is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +run_strace_match_diff -e trace=network diff --git a/tests-mx32/netlink_unix_diag.c b/tests-mx32/netlink_unix_diag.c new file mode 100644 index 00000000..269adc6f --- /dev/null +++ b/tests-mx32/netlink_unix_diag.c @@ -0,0 +1,156 @@ +/* + * This file is part of net-yy-unix strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +static void +send_query(const int fd) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct unix_diag_req udr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP + }, + .udr = { + .sdiag_family = AF_UNIX, + .udiag_states = -1, + .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct unix_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +#define SUN_PATH "netlink_unix_diag_socket" +int main(void) +{ + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = SUN_PATH + }; + socklen_t len = offsetof(struct sockaddr_un, sun_path) + sizeof(SUN_PATH); + + close(0); + close(1); + + (void) unlink(SUN_PATH); + if (socket(AF_UNIX, SOCK_STREAM, 0)) + perror_msg_and_skip("socket AF_UNIX"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + + assert(unlink(SUN_PATH) == 0); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1); + check_responses(1); + return 0; +} diff --git a/tests-mx32/newfstatat.c b/tests-mx32/newfstatat.c new file mode 100644 index 00000000..b501d880 --- /dev/null +++ b/tests-mx32/newfstatat.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_newfstatat + +# define TEST_SYSCALL_NR __NR_newfstatat +# define TEST_SYSCALL_STR "newfstatat" +# include "fstatat.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_newfstatat") + +#endif diff --git a/tests-mx32/newfstatat.test b/tests-mx32/newfstatat.test new file mode 100755 index 00000000..6d83ec08 --- /dev/null +++ b/tests-mx32/newfstatat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check newfstatat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/nsyscalls.c b/tests-mx32/nsyscalls.c new file mode 100644 index 00000000..aecf7aa7 --- /dev/null +++ b/tests-mx32/nsyscalls.c @@ -0,0 +1,108 @@ +/* + * Check decoding of out-of-range syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "sysent.h" +#include +#include +#include +#include + +#define TD 0 +#define TF 0 +#define TI 0 +#define TN 0 +#define TP 0 +#define TS 0 +#define TM 0 +#define NF 0 +#define MA 0 +#define SI 0 +#define SE 0 +#define CST 0 +#define SEN(arg) 0,0 + +static const struct_sysent syscallent[] = { +#include "syscallent.h" +}; + +#if defined __X32_SYSCALL_BIT && defined __NR_read \ + && (__X32_SYSCALL_BIT & __NR_read) != 0 +# define SYSCALL_BIT __X32_SYSCALL_BIT +#else +# define SYSCALL_BIT 0 +#endif + +static void +test_syscall(const unsigned long nr) +{ + static const kernel_ulong_t a[] = { + (kernel_ulong_t) 0xface0fedbadc0dedULL, + (kernel_ulong_t) 0xface1fedbadc1dedULL, + (kernel_ulong_t) 0xface2fedbadc2dedULL, + (kernel_ulong_t) 0xface3fedbadc3dedULL, + (kernel_ulong_t) 0xface4fedbadc4dedULL, + (kernel_ulong_t) 0xface5fedbadc5dedULL + }; + + long rc = syscall(nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5]); +#ifdef LINUX_MIPSO32 + printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" + " = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5], rc); +#else + printf("syscall_%lu(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" + " = %ld (errno %d)\n", nr, + (unsigned long long) a[0], + (unsigned long long) a[1], + (unsigned long long) a[2], + (unsigned long long) a[3], + (unsigned long long) a[4], + (unsigned long long) a[5], + rc, errno); +#endif +} + +int +main(void) +{ + test_syscall(ARRAY_SIZE(syscallent)); + +#ifdef SYS_socket_subcall + test_syscall(SYS_socket_subcall + 1); +#endif + +#ifdef SYS_ipc_subcall + test_syscall(SYS_ipc_subcall + 1); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nsyscalls.test b/tests-mx32/nsyscalls.test new file mode 100755 index 00000000..61f72d52 --- /dev/null +++ b/tests-mx32/nsyscalls.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of out-of-range syscalls. + +. "${srcdir=.}/init.sh" + +if [ "$MIPS_ABI" = "o32" ]; then + syscall=syscall +else + syscall=none +fi + +run_strace_match_diff -e trace=$syscall diff --git a/tests-mx32/old_mmap.c b/tests-mx32/old_mmap.c new file mode 100644 index 00000000..2725fb75 --- /dev/null +++ b/tests-mx32/old_mmap.c @@ -0,0 +1,101 @@ +/* + * Check decoding of "old mmap" edition of mmap syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +/* + * On s390x and m68k, this is the mmap syscall used by glibc, so, + * from one side, it's already covered by another test, and, from another side, + * it would require additional efforts to filter out mmap calls made by glibc. + */ + +#if defined __NR_mmap && \ +( defined __arm__ \ + || defined __i386__ \ + || (defined __s390__ && !defined __s390x__) \ +) + +# include +# include +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_mmap, 0); + printf("mmap(NULL) = %ld %s (%m)\n", rc, errno2name()); + + const unsigned int args1_c[6] = { + 0xdeadbeef, /* addr */ + 0xfacefeed, /* len */ + PROT_READ|PROT_EXEC, /* prot */ + MAP_FILE|MAP_FIXED, /* flags */ + -2U, /* fd */ + 0xbadc0ded /* offset */ + }; + const unsigned int page_size = get_page_size(); + const unsigned int args2_c[6] = { + 0, + page_size, + PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1U, + 0xfaced000 & -page_size + }; + void *args = tail_memdup(args1_c, sizeof(args1_c)); + + rc = syscall(__NR_mmap, args); + printf("mmap(%#x, %u, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" + ", %d, %#x) = %ld %s (%m)\n", + args1_c[0], args1_c[1], args1_c[4], args1_c[5], + rc, errno2name()); + + memcpy(args, args2_c, sizeof(args2_c)); + rc = syscall(__NR_mmap, args); + printf("mmap(NULL, %u, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" + ", %d, %#x) = %#lx\n", + args2_c[1], args2_c[4], args2_c[5], rc); + + void *addr = (void *) rc; + if (mprotect(addr, page_size, PROT_NONE)) + perror_msg_and_fail("mprotect(%p, %u, PROT_NONE)", + addr, page_size); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__" + " || (__s390__ && !__s390x__))") + +#endif diff --git a/tests-mx32/old_mmap.test b/tests-mx32/old_mmap.test new file mode 100755 index 00000000..af776ff7 --- /dev/null +++ b/tests-mx32/old_mmap.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of "old mmap" edition of mmap syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap diff --git a/tests-mx32/oldfstat.c b/tests-mx32/oldfstat.c new file mode 100644 index 00000000..f5a94416 --- /dev/null +++ b/tests-mx32/oldfstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldfstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldfstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldfstat +# define TEST_SYSCALL_STR "oldfstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldfstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests-mx32/oldfstat.test b/tests-mx32/oldfstat.test new file mode 100755 index 00000000..66a10561 --- /dev/null +++ b/tests-mx32/oldfstat.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check oldfstat syscall decoding. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +syscall=$NAME +run_prog > /dev/null +sample=$syscall.sample +> "$sample" +run_strace -ve$syscall -P$sample -a21 $args > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/oldlstat.c b/tests-mx32/oldlstat.c new file mode 100644 index 00000000..66132370 --- /dev/null +++ b/tests-mx32/oldlstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldlstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldlstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldlstat +# define TEST_SYSCALL_STR "oldlstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldlstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests-mx32/oldlstat.test b/tests-mx32/oldlstat.test new file mode 100755 index 00000000..a0f9ab93 --- /dev/null +++ b/tests-mx32/oldlstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check oldlstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/oldselect.c b/tests-mx32/oldselect.c new file mode 100644 index 00000000..7413fc33 --- /dev/null +++ b/tests-mx32/oldselect.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_select && defined __NR__newselect \ + && __NR_select != __NR__newselect \ + && !defined SPARC + +# include +# include + +int +main(void) +{ + int fds[2]; + fd_set r = {}, w = {}; + struct timeval timeout = { .tv_sec = 0, .tv_usec = 42 }; + long args[] = { + 2, (long) &r, (long) &w, 0, (long) &timeout, + 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded, 0xdeadbeef + }; + + (void) close(0); + (void) close(1); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + FD_SET(0, &w); + FD_SET(1, &r); + if (syscall(__NR_select, args)) + perror_msg_and_skip("select"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect") + +#endif diff --git a/tests-mx32/oldselect.expected b/tests-mx32/oldselect.expected new file mode 100644 index 00000000..d6e7f3c4 --- /dev/null +++ b/tests-mx32/oldselect.expected @@ -0,0 +1,2 @@ +select(2, [1], [0], NULL, {tv_sec=0, tv_usec=42}) = 0 (Timeout) ++++ exited with 0 +++ diff --git a/tests-mx32/oldselect.test b/tests-mx32/oldselect.test new file mode 100755 index 00000000..35661ad4 --- /dev/null +++ b/tests-mx32/oldselect.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check old select syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a34 -eselect $args +match_diff + +exit 0 diff --git a/tests-mx32/oldstat.c b/tests-mx32/oldstat.c new file mode 100644 index 00000000..d06e2bc6 --- /dev/null +++ b/tests-mx32/oldstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldstat +# define TEST_SYSCALL_STR "oldstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 131478418U) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests-mx32/oldstat.test b/tests-mx32/oldstat.test new file mode 100755 index 00000000..42d70f7f --- /dev/null +++ b/tests-mx32/oldstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check oldstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/open.c b/tests-mx32/open.c new file mode 100644 index 00000000..01e89b0f --- /dev/null +++ b/tests-mx32/open.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_open + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "open.sample"; + + long fd = syscall(__NR_open, sample, O_RDONLY|O_CREAT, 0400); + printf("open(\"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", + sample, sprintrc(fd)); + + if (fd != -1) { + close(fd); + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + fd = syscall(__NR_open, sample, O_RDONLY); + printf("open(\"%s\", O_RDONLY) = %s\n", sample, sprintrc(fd)); + + fd = syscall(__NR_open, sample, O_WRONLY|O_NONBLOCK|0x80000000); + printf("open(\"%s\", O_WRONLY|O_NONBLOCK|0x80000000) = %s\n", + sample, sprintrc(fd)); + } + +#ifdef O_TMPFILE +# if O_TMPFILE == (O_TMPFILE & ~O_DIRECTORY) +# define STR_O_TMPFILE "O_TMPFILE" +# else +# define STR_O_TMPFILE "O_DIRECTORY|O_TMPFILE" +# endif + fd = syscall(__NR_open, sample, O_WRONLY|O_TMPFILE, 0600); + printf("open(\"%s\", O_WRONLY|%s, 0600) = %s\n", + sample, STR_O_TMPFILE, sprintrc(fd)); +#endif /* O_TMPFILE */ + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_open") + +#endif diff --git a/tests-mx32/open.test b/tests-mx32/open.test new file mode 100755 index 00000000..6df19cb8 --- /dev/null +++ b/tests-mx32/open.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check open syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests-mx32/openat.c b/tests-mx32/openat.c new file mode 100644 index 00000000..1d6765cf --- /dev/null +++ b/tests-mx32/openat.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016 Katerina Koukiou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_openat + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "openat.sample"; + + long fd = syscall(__NR_openat, -100, sample, O_RDONLY|O_CREAT, 0400); + printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", + sample, sprintrc(fd)); + + if (fd != -1) { + close(fd); + if (unlink(sample) == -1) + perror_msg_and_fail("unlink"); + + fd = syscall(__NR_openat, -100, sample, O_RDONLY); + printf("openat(AT_FDCWD, \"%s\", O_RDONLY) = %s\n", + sample, sprintrc(fd)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_openat") + +#endif diff --git a/tests-mx32/openat.test b/tests-mx32/openat.test new file mode 100755 index 00000000..68c4cee1 --- /dev/null +++ b/tests-mx32/openat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check openat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -P $NAME.sample diff --git a/tests-mx32/opipe.test b/tests-mx32/opipe.test new file mode 100755 index 00000000..90e6838a --- /dev/null +++ b/tests-mx32/opipe.test @@ -0,0 +1,16 @@ +#!/bin/sh + +# Check how -o '|pipe' works. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog grep chdir $srcdir/umovestr.expected > "$EXP" +run_prog ./umovestr + +> "$LOG" || fail_ "failed to write $LOG" +$STRACE -o "|cat > $LOG && $SLEEP_A_BIT && grep chdir < $LOG > $OUT" -e chdir $args || + dump_log_and_fail_with "$STRACE $args failed" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/options-syntax.test b/tests-mx32/options-syntax.test new file mode 100755 index 00000000..592b0e03 --- /dev/null +++ b/tests-mx32/options-syntax.test @@ -0,0 +1,148 @@ +#!/bin/sh +# +# Check strace options syntax. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_exit_status_and_stderr() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_diff "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +strace_exp="${STRACE##* }" + +check_e() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$strace_exp: $pattern +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_h() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$strace_exp: $pattern +Try '$strace_exp -h' for more information. +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_e "Invalid process id: '0'" -p 0 +check_e "Invalid process id: '-42'" -p -42 +check_e "Invalid process id: '$$.'" -p $$. +check_e "Invalid process id: 'a'" -p 1,a +check_e "Syscall 'chdir' for -b isn't supported" -b chdir +check_e "Syscall 'chdir' for -b isn't supported" -b execve -b chdir + +check_e "invalid system call '-1'" -e-1 +check_e "invalid system call '-2'" -e -2 +check_e "invalid system call '-3'" -etrace=-3 +check_e "invalid system call '-4'" -e trace=-4 +check_e "invalid system call '-5'" -e trace=1,-5 +check_e "invalid system call '2147483647'" -e 2147483647 +check_e "invalid system call '2147483648'" -e 2147483648 +check_e "invalid system call '4294967295'" -e 4294967295 +check_e "invalid system call '4294967296'" -e 4294967296 + +check_e "invalid descriptor '-1'" -eread=-1 +check_e "invalid descriptor '-42'" -ewrite=-42 +check_e "invalid descriptor '2147483648'" -eread=2147483648 +check_e "invalid descriptor '4294967296'" -ewrite=4294967296 +check_e "invalid descriptor 'foo'" -eread=foo +check_e "invalid descriptor ''" -ewrite= +check_e "invalid descriptor ','" -eread=, +check_e "invalid descriptor '!'" -ewrite='!' +check_e "invalid descriptor '!'" -eread='0,!' +check_e "invalid descriptor '!,'" -ewrite='!,' + +check_h 'must have PROG [ARGS] or -p PID' +check_h 'PROG [ARGS] must be specified with -D' -D -p $$ +check_h '-c and -C are mutually exclusive' -c -C true +check_h '-c and -C are mutually exclusive' -C -c true +check_h '(-c or -C) and -ff are mutually exclusive' -c -ff true +check_h '(-c or -C) and -ff are mutually exclusive' -C -ff true +check_h '-w must be given with (-c or -C)' -w true +check_h 'piping the output and -ff are mutually exclusive' -o '|' -ff true +check_h 'piping the output and -ff are mutually exclusive' -o '!' -ff true +check_h "invalid -a argument: '-42'" -a -42 +check_h "invalid -O argument: '-42'" -O -42 +check_h "invalid -s argument: '-42'" -s -42 +check_h "invalid -I argument: '5'" -I 5 + +if [ -n "${UID-}" ]; then + if [ "${UID-}" = 0 ]; then + umsg="Cannot find user ':nosuchuser:'" + else + umsg='You must be root to use the -u option' + fi + + check_e "$umsg" -u :nosuchuser: true + + for c in i r t T y; do + check_e "-$c has no effect with -c +$strace_exp: $umsg" -u :nosuchuser: -c -$c true + done + check_e "-i has no effect with -c +$strace_exp: -r has no effect with -c +$strace_exp: -t has no effect with -c +$strace_exp: -T has no effect with -c +$strace_exp: -y has no effect with -c +$strace_exp: $umsg" -u :nosuchuser: -cirtTy true + + check_e "-tt has no effect with -r +$strace_exp: $umsg" -u :nosuchuser: -r -tt true +fi + +args='-p 2147483647' +$STRACE $args 2> "$LOG" && + dump_log_and_fail_with \ + "strace $args failed to handle the error properly" + +for cmd in PTRACE_SEIZE PTRACE_ATTACH; do + cat > "$EXP" << __EOF__ +$strace_exp: attach: ptrace($cmd, 2147483647): No such process +__EOF__ + diff -- "$EXP" "$LOG" || + continue + args= + break +done + +[ -z "$args" ] || + dump_log_and_fail_with \ + "strace $args failed to print expected diagnostics" + +rm -f "$EXP" diff --git a/tests-mx32/overflowuid.c b/tests-mx32/overflowuid.c new file mode 100644 index 00000000..a3c742b4 --- /dev/null +++ b/tests-mx32/overflowuid.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +read_int_from_file(const char *const fname, int *const pvalue) +{ + const int fd = open(fname, O_RDONLY); + if (fd < 0) + return -1; + + long lval; + char buf[sizeof(lval) * 3]; + int n = read(fd, buf, sizeof(buf) - 1); + int saved_errno = errno; + close(fd); + + if (n < 0) { + errno = saved_errno; + return -1; + } + + buf[n] = '\0'; + char *endptr = 0; + errno = 0; + lval = strtol(buf, &endptr, 10); + if (!endptr || (*endptr && '\n' != *endptr) +#if INT_MAX < LONG_MAX + || lval > INT_MAX || lval < INT_MIN +#endif + || ERANGE == errno) { + if (!errno) + errno = EINVAL; + return -1; + } + + *pvalue = (int) lval; + return 0; +} + +static void +check_overflow_id(const int id, const char *overflowid) +{ + int n; + + if (read_int_from_file(overflowid, &n)) { + if (ENOENT == errno) + return; + perror_msg_and_fail("read_int_from_file: %s", overflowid); + } + + if (id == n) + error_msg_and_skip("%d matches %s", id, overflowid); +} + +void +check_overflowuid(const int uid) +{ + check_overflow_id(uid, "/proc/sys/kernel/overflowuid"); +} + +void +check_overflowgid(const int gid) +{ + check_overflow_id(gid, "/proc/sys/kernel/overflowgid"); +} diff --git a/tests-mx32/pause.c b/tests-mx32/pause.c new file mode 100644 index 00000000..86873620 --- /dev/null +++ b/tests-mx32/pause.c @@ -0,0 +1,79 @@ +/* + * Check decoding of pause syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Fei Jie + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pause + +# include +# include +# include +# include +# include + +static void +handler(int sig) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct itimerval itv = { .it_value.tv_usec = 123456 }; + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_fail("setitimer"); + + syscall(__NR_pause); + if (errno == ENOSYS) + printf("pause() = -1 ENOSYS (%m)\n"); + else + printf("pause() = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pause") + +#endif diff --git a/tests-mx32/pause.test b/tests-mx32/pause.test new file mode 100755 index 00000000..c5fdacde --- /dev/null +++ b/tests-mx32/pause.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pause syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 -esignal=none diff --git a/tests-mx32/pc.c b/tests-mx32/pc.c new file mode 100644 index 00000000..f53acd45 --- /dev/null +++ b/tests-mx32/pc.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + const unsigned long pagesize = get_page_size(); + +#ifdef __s390__ + /* + * The si_addr field is unreliable: + * https://marc.info/?l=linux-s390&m=142515870124248&w=2 + */ + error_msg_and_skip("s390: si_addr is unreliable"); +#endif + + /* write instruction pointer length to the log */ + assert(write(-1, NULL, 2 * sizeof(void *)) < 0); + + /* just a noticeable line in the log */ + assert(munmap(&main, 0) < 0); + + int pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + const unsigned long mask = ~(pagesize - 1); + unsigned long addr = (unsigned long) &main & mask; + unsigned long size = pagesize << 1; + +#ifdef HAVE_DLADDR + Dl_info info; + if (dladdr(&main, &info)) { + const unsigned long base = + (unsigned long) info.dli_fbase & mask; + if (base < addr) { + size += addr - base; + addr = base; + } + } else +#endif + { + addr -= size; + size <<= 1; + } + + /* SIGSEGV is expected */ + (void) munmap((void *) addr, size); + (void) munmap((void *) addr, size); + error_msg_and_skip("SIGSEGV did not happen"); + } + + int status; + assert(wait(&status) == pid); + assert(WIFSIGNALED(status)); + assert(WTERMSIG(status) == SIGSEGV); + + /* dump process map for debug purposes */ + close(0); + if (!open("/proc/self/maps", O_RDONLY)) + (void) sendfile(1, 0, NULL, pagesize); + + return 0; +} diff --git a/tests-mx32/pc.test b/tests-mx32/pc.test new file mode 100755 index 00000000..beadb7d7 --- /dev/null +++ b/tests-mx32/pc.test @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Check -i option. +# +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_prog sed + +run_prog > /dev/null + +args="-if $args" +$STRACE $args 2> "$LOG" || + dump_log_and_fail_with "$STRACE $args failed" + +len="$(sed -r -n 's/^\[[[:xdigit:]]+\] write\(-1, NULL, ([[:digit:]]{1,2})\)[[:space:]]+= -1 .*/\1/p' "$LOG")" && +[ -n "$len" ] && +pid="$(sed -r -n 's/^\[[[:xdigit:]]{'"$len"'}\] --- SIGCHLD \{si_signo=SIGCHLD, si_code=CLD_(KILLED|DUMPED), si_pid=([[:digit:]]+), .*/\2/p' "$LOG")" && +[ -n "$pid" ] && +ip="$(sed -r -n 's/^\[pid +'"$pid"'\] \[([[:xdigit:]]{'"$len"'})] --- SIGSEGV \{.*\} ---$/\1/p' "$LOG")" && +[ -n "$ip" ] && +addr="$(echo "$ip" |sed -r 's/^0+//')" && +[ -n "$addr" ] || + dump_log_and_fail_with + +EXPECTED="$LOG.expected" +cat > "$EXPECTED" << __EOF__ +\\[[[:xdigit:]]{$len}\\] munmap\\(0x[[:xdigit:]]+, 0\\) += -1 .* +\\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr\\} --- +\\[pid +$pid\\] \\[\\?{$len}\\] \\+\\+\\+ killed by SIGSEGV( \\(core dumped\\))? \\+\\+\\+ +\\[\\?{$len}\\] \\+\\+\\+ exited with 0 \\+\\+\\+ +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" + +exit 0 diff --git a/tests-mx32/perf_event_open.c b/tests-mx32/perf_event_open.c new file mode 100644 index 00000000..0ffea292 --- /dev/null +++ b/tests-mx32/perf_event_open.c @@ -0,0 +1,821 @@ +/* + * Check verbose decoding of perf_event_open syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined(__NR_perf_event_open) && defined(HAVE_LINUX_PERF_EVENT_H) + +# include +# include +# include +# include +# include +# include +# include +# include + +# include + +# include "xlat.h" +# include "xlat/perf_event_open_flags.h" +# include "xlat/perf_attr_size.h" + +# if ULONG_MAX > UINT_MAX /* Poor man's "whether long is 8 bytes?" */ +# define LONG_STR_PREFIX "ffffffff" +# else /* !(ULONG_MAX > UINT_MAX) */ +# define LONG_STR_PREFIX "" +# endif /* ULONG_MAX > UINT_MAX */ + +# ifndef PERF_TYPE_BREAKPOINT +# define PERF_TYPE_BREAKPOINT 5 +# endif + +struct s32_val_str { + int32_t val; + const char *str; +}; + +struct u32_val_str { + uint32_t val; + const char *str; +}; + +struct u64_val_str { + uint64_t val; + const char *str; +}; + +/* In order to avoid endianess-specific hackery */ +struct pea_flags { + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + __reserved_1 :36; +}; + +static const char * +printaddr(void *ptr) +{ + static char buf[sizeof("0x") + sizeof(void *) * 2]; + + if (ptr == NULL) + return "NULL"; + + snprintf(buf, sizeof(buf), "%#lx", (unsigned long)ptr); + + return buf; +} + +/* + * Checklist: + * + * type - 8 IDs + * config - 13 IDs (0..11 + random), depends on type + * sample type - bitmask, up to 20 bits + * read_format - 5 IDs + * bp_type - 6, weird semantics (invalid/unknown) + * branch_sample_type - bitmask, 16 bits + * clockid - 13 values + * + * Unions: + * sample_period/sample_freq + * wakeup_event/wakeup_watermark + * bp_addr/config1 + * bp_len/config2 + */ + +/* + * The main idea behind all those numerous ifdefs is checking against version of + * structure provided in kernel headers and not use one defined in strace + * headers (assume the case when suddenly we add flag without proper update of + * __reserved_1 field or something like this). + */ +static void +print_event_attr(struct perf_event_attr *attr_ptr, size_t size, + const char *type, const char *config, const char *sample_type, + const char *read_format, const char *precise_ip_desc, + const char *bp_type, const char *branch_sample_type, + const char *clockid, uint32_t available_size) +{ + /* + * Currently, strace supports version 5 of the structure, which is + * 112 bytes in size. + */ + enum { + STRACE_PEA_ABBREV_SIZE = + offsetof(struct perf_event_attr, config) + + sizeof(attr_ptr->config), + STRACE_PEA_SIZE = 112, + }; + + uint32_t read_size; + struct perf_event_attr *attr; +# if VERBOSE + uint32_t cutoff; + uint64_t val; + uint64_t use_clockid; + union { + struct pea_flags flags; + uint64_t raw; + } flags_data; +# endif + + read_size = +# if !VERBOSE + STRACE_PEA_ABBREV_SIZE; +# else + size < STRACE_PEA_SIZE ? + (size ? size : PERF_ATTR_SIZE_VER0) : STRACE_PEA_SIZE; +# endif + + if (read_size > available_size) { + printf("%s", printaddr(attr_ptr)); + return; + } + + /* + * Replicate kernel's behaviour regarding copying structure from + * userspace. + */ + attr = calloc(1, STRACE_PEA_SIZE); + + if (!attr) + error_msg_and_fail("calloc"); + + + memcpy(attr, attr_ptr, read_size); + + if (size && (size < PERF_ATTR_SIZE_VER0)) { + printf("%s", printaddr(attr_ptr)); + free(attr); + return; + } + + printf("{type=%s, size=", type); + if (size != attr->size) { + printxval(perf_attr_size, size, "PERF_ATTR_SIZE_???"); + printf(" => "); + } + printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???"); + printf(", config=%s, ", config); + + if (!size) + size = PERF_ATTR_SIZE_VER0; + +# if !VERBOSE + printf("...}"); +# else /* !VERBOSE */ + printf("%s=%" PRI__u64", sample_type=%s, read_format=%s", + attr->freq ? "sample_freq" : "sample_period", + attr->freq ? attr->sample_freq : attr->sample_period, + sample_type, read_format); + + printf(", disabled=%u" + ", inherit=%u" + ", pinned=%u" + ", exclusive=%u" + ", exclusive_user=%u" + ", exclude_kernel=%u" + ", exclude_hv=%u" + ", exclude_idle=%u" + ", mmap=%u" + ", comm=%u" + ", freq=%u" + ", inherit_stat=%u" + ", enable_on_exec=%u" + ", task=%u" + ", watermark=%u", + attr->disabled, + attr->inherit, + attr->pinned, + attr->exclusive, + attr->exclude_user, + attr->exclude_kernel, + attr->exclude_hv, + attr->exclude_idle, + attr->mmap, + attr->comm, + attr->freq, + attr->inherit_stat, + attr->enable_on_exec, + attr->task, + attr->watermark); + + flags_data.raw = ((uint64_t *) attr)[5]; + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP + attr->precise_ip; +# else + flags_data.flags.precise_ip; +# endif + printf(", precise_ip=%" PRIu64 " /* %s */", val, precise_ip_desc); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA + attr->mmap_data; +# else + flags_data.flags.mmap_data; +# endif + printf(", mmap_data=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL + attr->sample_id_all; +# else + flags_data.flags.sample_id_all; +# endif + printf(", sample_id_all=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST + attr->exclude_host; +# else + flags_data.flags.exclude_host; +# endif + printf(", exclude_host=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST + attr->exclude_guest; +# else + flags_data.flags.exclude_guest; +# endif + printf(", exclude_guest=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL + attr->exclude_callchain_kernel; +# else + flags_data.flags.exclude_callchain_kernel; +# endif + printf(", exclude_callchain_kernel=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER + attr->exclude_callchain_user; +# else + flags_data.flags.exclude_callchain_user; +# endif + printf(", exclude_callchain_user=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 + attr->mmap2; +# else + flags_data.flags.mmap2; +# endif + printf(", mmap2=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC + attr->comm_exec; +# else + flags_data.flags.comm_exec; +# endif + printf(", comm_exec=%" PRIu64, val); + + use_clockid = val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID + attr->use_clockid; +# else + flags_data.flags.use_clockid; +# endif + printf(", use_clockid=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH + attr->context_switch; +# else + flags_data.flags.context_switch; +# endif + printf(", context_switch=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD + attr->write_backward; +# else + flags_data.flags.write_backward; +# endif + printf(", write_backward=%" PRIu64, val); + + val = flags_data.flags.__reserved_1; + if (val) + printf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", val); + + printf(", %s=%u", + attr->watermark ? "wakeup_watermark" : "wakeup_events", + attr->watermark ? attr->wakeup_watermark : attr->wakeup_events); + + if (attr->type == PERF_TYPE_BREAKPOINT) + printf(", bp_type=%s", bp_type); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 + attr->config1; +# else + ((uint64_t *) attr)[56 / sizeof(uint64_t)]; +# endif + printf(", %s=%#" PRIx64, + attr->type == PERF_TYPE_BREAKPOINT ? "bp_addr" : "config1", + val); + + /* End of version 0 of the structure */ + if (size <= 64) { + cutoff = 64; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 + attr->config2; +# else + ((uint64_t *) attr)[64 / sizeof(uint64_t)]; +# endif + if (attr->type == PERF_TYPE_BREAKPOINT) + printf(", bp_len=%" PRIu64, val); + else + printf(", config2=%#" PRIx64, val); + + /* End of version 1 of the structure */ + if (size <= 72) { + cutoff = 72; + goto end; + } + + /* + * Print branch sample type only in case PERF_SAMPLE_BRANCH_STACK + * is set in the sample_type field. + */ + if (attr->sample_type & (1 << 11)) + printf(", branch_sample_type=%s", branch_sample_type); + + /* End of version 2 of the structure */ + if (size <= 80) { + cutoff = 80; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER + attr->sample_regs_user; +# else + ((uint64_t *) attr)[80 / sizeof(uint64_t)]; +# endif + printf(", sample_regs_user=%#" PRIx64, val); + + if (size <= 88) { + cutoff = 88; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER + attr->sample_stack_user; +# else + ((uint32_t *) attr)[88 / sizeof(uint32_t)]; +# endif + /* + * Print branch sample type only in case PERF_SAMPLE_STACK_USER + * is set in the sample_type field. + */ + if (attr->sample_type & (1 << 13)) + printf(", sample_stack_user=%#" PRIx32, (uint32_t) val); + + if (size <= 92) { + cutoff = 92; + goto end; + } + + if (use_clockid) + printf(", clockid=%s", clockid); + + /* End of version 3 of the structure */ + if (size <= 96) { + cutoff = 96; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR + attr->sample_regs_intr; +# else + ((uint64_t *) attr)[96 / sizeof(uint64_t)]; +# endif + printf(", sample_regs_intr=%#" PRIx64, val); + + /* End of version 4 of the structure */ + if (size <= 104) { + cutoff =104; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK + attr->aux_watermark; +# else + ((uint32_t *) attr)[104 / sizeof(uint32_t)]; +# endif + printf(", aux_watermark=%" PRIu32, (uint32_t) val); + + if (size <= 108) { + cutoff =108; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK + attr->sample_max_stack; +# else + ((uint16_t *) attr)[108 / sizeof(uint16_t)]; +# endif + printf(", sample_max_stack=%" PRIu16, (uint16_t) val); + + if (size <= 110) { + cutoff =110; + goto end; + } + + cutoff = STRACE_PEA_SIZE; + +end: + if (size > cutoff) + printf(", ..."); + + printf("}"); +# endif /* !VERBOSE */ + + free(attr); +} + +/* These require aligned access, so no byte-grain checks possible */ +# if defined SPARC || defined SPARC64 || defined POWERPC || defined POWERPC64 +# define ATTR_REC(sz) { tail_alloc((sz + 7) & ~7), sz } +# else +# define ATTR_REC(sz) { tail_alloc(sz), sz } +# endif + +# define BRANCH_TYPE_ALL \ + "PERF_SAMPLE_BRANCH_USER|" \ + "PERF_SAMPLE_BRANCH_KERNEL|" \ + "PERF_SAMPLE_BRANCH_HV|" \ + "PERF_SAMPLE_BRANCH_ANY|" \ + "PERF_SAMPLE_BRANCH_ANY_CALL|" \ + "PERF_SAMPLE_BRANCH_ANY_RETURN|" \ + "PERF_SAMPLE_BRANCH_IND_CALL|" \ + "PERF_SAMPLE_BRANCH_ABORT_TX|" \ + "PERF_SAMPLE_BRANCH_IN_TX|" \ + "PERF_SAMPLE_BRANCH_NO_TX|" \ + "PERF_SAMPLE_BRANCH_COND|" \ + "PERF_SAMPLE_BRANCH_CALL_STACK|" \ + "PERF_SAMPLE_BRANCH_IND_JUMP|" \ + "PERF_SAMPLE_BRANCH_CALL|" \ + "PERF_SAMPLE_BRANCH_NO_FLAGS|" \ + "PERF_SAMPLE_BRANCH_NO_CYCLES" + +int +main(void) +{ + static const size_t attr_small_size = PERF_ATTR_SIZE_VER0 - 8; + static const size_t attr_v0_size = PERF_ATTR_SIZE_VER0; + static const size_t attr_v1_size = PERF_ATTR_SIZE_VER1; + static const size_t attr_v2_size = PERF_ATTR_SIZE_VER2; + static const size_t attr_v2_5_size = PERF_ATTR_SIZE_VER2 + 8; + static const size_t attr_v2_75_size = PERF_ATTR_SIZE_VER2 + 12; + static const size_t attr_v3_size = PERF_ATTR_SIZE_VER3; + static const size_t attr_v4_size = PERF_ATTR_SIZE_VER4; + static const size_t attr_v4_5_size = PERF_ATTR_SIZE_VER4 + 4; + static const size_t attr_v4_625_size = PERF_ATTR_SIZE_VER4 + 5; + static const size_t attr_v4_875_size = PERF_ATTR_SIZE_VER4 + 7; + static const size_t attr_v5_size = PERF_ATTR_SIZE_VER5; + static const size_t attr_big_size = PERF_ATTR_SIZE_VER5 + 32; + + static const struct u64_val_str attr_types[] = { + { ARG_STR(PERF_TYPE_HARDWARE) }, + { ARG_STR(PERF_TYPE_SOFTWARE) }, + { ARG_STR(PERF_TYPE_TRACEPOINT) }, + { ARG_STR(PERF_TYPE_HW_CACHE) }, + { ARG_STR(PERF_TYPE_RAW) }, + { ARG_STR(PERF_TYPE_BREAKPOINT) }, + { ARG_STR(0x6) " /* PERF_TYPE_??? */" }, + { ARG_STR(0xdeadc0de) " /* PERF_TYPE_??? */" }, + }; + static const struct u64_val_str + attr_configs[ARRAY_SIZE(attr_types)][3] = { + /* PERF_TYPE_HARDWARE */ { + { 9, "PERF_COUNT_HW_REF_CPU_CYCLES" }, + { 10, "0xa /* PERF_COUNT_HW_??? */" }, + { ARG_ULL_STR(0xfaceca75deadb0d4) + " /* PERF_COUNT_HW_??? */" }, + }, + /* PERF_TYPE_SOFTWARE */ { + { 10, "PERF_COUNT_SW_BPF_OUTPUT" }, + { 11, "0xb /* PERF_COUNT_SW_??? */" }, + { ARG_ULL_STR(0xdec0ded1dec0ded2) + " /* PERF_COUNT_SW_??? */" }, + }, + /* PERF_TYPE_TRACEPOINT */ { + { ARG_STR(0) }, + { 4207856245U, "4207856245" }, + { ARG_ULL_STR(16051074073505095380) }, + }, + /* PERF_TYPE_HW_CACHE */ { + { 0, "PERF_COUNT_HW_CACHE_L1D|" + "PERF_COUNT_HW_CACHE_OP_READ<<8|" + "PERF_COUNT_HW_CACHE_RESULT_ACCESS<<16" }, + { 0x020207, "0x7 /* PERF_COUNT_HW_CACHE_??? */|" + "PERF_COUNT_HW_CACHE_OP_PREFETCH<<8|" + "0x2 /* PERF_COUNT_HW_CACHE_RESULT_??? */<<16" }, + { 0xdeadf157ed010306ULL, "PERF_COUNT_HW_CACHE_NODE|" + "0x3 /* PERF_COUNT_HW_CACHE_OP_??? */<<8|" + "PERF_COUNT_HW_CACHE_RESULT_MISS<<16|" + "0xdeadf157ed<<24 " + "/* PERF_COUNT_HW_CACHE_??? */" }, + }, + /* PERF_TYPE_RAW */ { + { ARG_STR(0) }, + { ARG_STR(0xda7a1057) }, + { ARG_ULL_STR(0xdec0ded7dec0ded8) }, + }, + /* PERF_TYPE_BREAKPOINT */ { + { ARG_STR(0) }, + { ARG_STR(0xbadc0ded) }, + { ARG_ULL_STR(0xdec0ded9dec0deda) }, + }, + /* invalid 1 */ { + { ARG_STR(0) }, + { ARG_STR(0xbeeff00d) }, + { ARG_ULL_STR(0xdec0dedbdec0dedc) }, + }, + /* invalid 2 */ { + { ARG_STR(0) }, + { ARG_STR(0xca75dead) }, + { ARG_ULL_STR(0xdec0dedddec0dede) }, + }, + }; + static const struct u64_val_str sample_types[] = { + { ARG_STR(0) }, + { 0x800, "PERF_SAMPLE_BRANCH_STACK" }, + { ARG_ULL_STR(0xdeadc0deda780000) " /* PERF_SAMPLE_??? */" }, + { 0xffffffffffffffffULL, + "PERF_SAMPLE_IP|PERF_SAMPLE_TID|PERF_SAMPLE_TIME|" + "PERF_SAMPLE_ADDR|PERF_SAMPLE_READ|" + "PERF_SAMPLE_CALLCHAIN|PERF_SAMPLE_ID|PERF_SAMPLE_CPU|" + "PERF_SAMPLE_PERIOD|PERF_SAMPLE_STREAM_ID|" + "PERF_SAMPLE_RAW|PERF_SAMPLE_BRANCH_STACK|" + "PERF_SAMPLE_REGS_USER|PERF_SAMPLE_STACK_USER|" + "PERF_SAMPLE_WEIGHT|PERF_SAMPLE_DATA_SRC|" + "PERF_SAMPLE_IDENTIFIER|PERF_SAMPLE_TRANSACTION|" + "PERF_SAMPLE_REGS_INTR|0xfffffffffff80000" }, + }; + static const struct u64_val_str read_formats[] = { + { ARG_STR(0) }, + { ARG_STR(PERF_FORMAT_TOTAL_TIME_ENABLED) }, + { 0xf, "PERF_FORMAT_TOTAL_TIME_ENABLED|" + "PERF_FORMAT_TOTAL_TIME_RUNNING|" + "PERF_FORMAT_ID|PERF_FORMAT_GROUP" }, + { ARG_ULL_STR(0xdeadf157dec0ded0) " /* PERF_FORMAT_??? */" }, + { 0xffffffffffffffffULL, + "PERF_FORMAT_TOTAL_TIME_ENABLED|" + "PERF_FORMAT_TOTAL_TIME_RUNNING|" + "PERF_FORMAT_ID|PERF_FORMAT_GROUP|" + "0xfffffffffffffff0" }, + }; + static const char *precise_ip_descs[] = { + "arbitrary skid", + "constant skid", + "requested to have 0 skid", + "must have 0 skid", + }; + static const struct u32_val_str bp_types[] = { + { 0, "HW_BREAKPOINT_EMPTY" }, + { 1, "HW_BREAKPOINT_R" }, + { 3, "HW_BREAKPOINT_RW" }, + { 5, "0x5 /* HW_BREAKPOINT_INVALID */" }, + { 8, "0x8 /* HW_BREAKPOINT_??? */" }, + { ARG_STR(0xface1e55) " /* HW_BREAKPOINT_??? */" }, + }; + static const struct u64_val_str branch_sample_types[] = { + { ARG_STR(0) }, + { 0x80, "PERF_SAMPLE_BRANCH_ABORT_TX" }, + { 0xffff, BRANCH_TYPE_ALL }, + { ARG_ULL_STR(0xdeadcaffeeed0000) + " /* PERF_SAMPLE_BRANCH_??? */" }, + { 0xffffffffffffffffULL, + BRANCH_TYPE_ALL "|0xffffffffffff0000" } + }; + static const struct s32_val_str clockids[] = { + { 11, "CLOCK_TAI" }, + { ARG_STR(0xc) " /* CLOCK_??? */" }, + { ARG_STR(0xbeeffeed) " /* CLOCK_??? */" }, + }; + + + struct { + struct perf_event_attr *ptr; + size_t size; + } attrs[] = { + ATTR_REC(sizeof(struct perf_event_attr)), + ATTR_REC(attr_v0_size), + ATTR_REC(attr_v1_size), + ATTR_REC(attr_v2_size), + ATTR_REC(attr_v2_5_size), + ATTR_REC(attr_v2_75_size), + ATTR_REC(attr_v3_size), + ATTR_REC(attr_v4_size), + ATTR_REC(attr_v4_5_size), + ATTR_REC(attr_v4_625_size), + ATTR_REC(attr_v4_875_size), + ATTR_REC(attr_v5_size), + ATTR_REC(attr_big_size), + }; + + struct perf_event_attr *small_attr = tail_alloc(sizeof(*small_attr)); + + struct { + struct perf_event_attr *attr; + pid_t pid; + int cpu; + int group_fd; + unsigned long flags; + const char *flags_str; + } args[] = { + { NULL, 0xfacef00d, 0xbadabba7, -1, + (unsigned long) 0xFFFFFFFFFFFFFFFFLLU, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC|" + "0x" LONG_STR_PREFIX "fffffff0" + }, + { small_attr + 1, 0, 0, 0, + 0, "0" }, + { small_attr, -1, -1, 1, + PERF_FLAG_FD_NO_GROUP | PERF_FLAG_FD_OUTPUT | + PERF_FLAG_PID_CGROUP | PERF_FLAG_FD_CLOEXEC, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC" }, + { (struct perf_event_attr *) (uintptr_t) 0xfffffacefffffeedULL, + -100, 100, 0xface1e55, + PERF_FLAG_FD_CLOEXEC, "PERF_FLAG_FD_CLOEXEC" }, + }; + + size_t i; + int rc; + + fill_memory(small_attr, sizeof(*small_attr)); + small_attr->size = attr_small_size; + + for (i = 0; i < ARRAY_SIZE(args); i++) { + rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, + args[i].cpu, args[i].group_fd, args[i].flags); + printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", + printaddr(args[i].attr), args[i].pid, args[i].cpu, + args[i].group_fd, args[i].flags_str, sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(attrs) * ARRAY_SIZE(attr_types) * + ARRAY_SIZE(attr_configs[0]) + 1; i++) { + struct perf_event_attr *attr = attrs[i % ARRAY_SIZE(attrs)].ptr; + uint32_t size = attrs[i % ARRAY_SIZE(attrs)].size; + unsigned char fill_start = 0x80 + i; + size_t type_idx = i % ARRAY_SIZE(attr_types); + size_t config_idx = i % ARRAY_SIZE(attr_configs[0]); + size_t sample_type_idx = i % ARRAY_SIZE(sample_types); + size_t read_format_idx = i % ARRAY_SIZE(read_formats); + size_t bp_type_idx = (i / ARRAY_SIZE(attr_configs[0])) % + ARRAY_SIZE(bp_types); + size_t branch_sample_type_idx = (i / ARRAY_SIZE(sample_types)) % + ARRAY_SIZE(branch_sample_types); + size_t clockid_idx = i % ARRAY_SIZE(clockids); + size_t args_idx = i % ARRAY_SIZE(args); + const char *ip_desc_str; + + fill_memory_ex(attr, size, fill_start, 0xff); + + attr->type = attr_types[type_idx].val; + attr->size = size; + attr->config = attr_configs[type_idx][config_idx].val; + attr->sample_type = sample_types[sample_type_idx].val; + attr->read_format = read_formats[read_format_idx].val; + + if ((i % 11) == 5) + attr->__reserved_1 = 0; + +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_BP_TYPE + attr->bp_type = +# else + ((uint32_t *) attr)[52 / sizeof(uint32_t)] = +# endif + bp_types[bp_type_idx].val; + + if (size >= 80) +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_BRANCH_SAMPLE_TYPE + attr->branch_sample_type = +# else + ((uint64_t *) attr)[72 / sizeof(uint64_t)] = +# endif + branch_sample_types[branch_sample_type_idx].val; + + if (size >= 96) +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CLOCKID + attr->clockid = +# else + ((uint32_t *) attr)[92 / sizeof(uint32_t)] = +# endif + clockids[clockid_idx].val; + +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP + ip_desc_str = precise_ip_descs[attr->precise_ip]; +# else + union { + struct pea_flags flags; + uint64_t raw; + } flags_data = { .raw = ((uint64_t *) attr)[5] }; + + ip_desc_str = precise_ip_descs[flags_data.flags.precise_ip]; +# endif + + if (i == 0) + attr->size = size + 8; + + if (i == 1) + attr->size = 0; + + rc = syscall(__NR_perf_event_open, attr, args[args_idx].pid, + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags); + + printf("perf_event_open("); + print_event_attr(attr, i ? ((i == 1) ? 0 : size) : size + 8, + attr_types[type_idx].str, + attr_configs[type_idx][config_idx].str, + sample_types[sample_type_idx].str, + read_formats[read_format_idx].str, + ip_desc_str, + bp_types[bp_type_idx].str, + branch_sample_types[branch_sample_type_idx].str, + clockids[clockid_idx].str, size); + printf(", %d, %d, %d, %s) = %s\n", args[args_idx].pid, + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags_str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_perf_event_open && HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-mx32/perf_event_open.test b/tests-mx32/perf_event_open.test new file mode 100755 index 00000000..499134b4 --- /dev/null +++ b/tests-mx32/perf_event_open.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check perf_event_open syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a1 diff --git a/tests-mx32/perf_event_open_nonverbose.c b/tests-mx32/perf_event_open_nonverbose.c new file mode 100644 index 00000000..45d7c8f2 --- /dev/null +++ b/tests-mx32/perf_event_open_nonverbose.c @@ -0,0 +1,113 @@ +/* + * Check decoding of perf_event_open syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined(__NR_perf_event_open) && defined(HAVE_LINUX_PERF_EVENT_H) + +# include +# include +# include + +# include + +# include "xlat.h" +# include "xlat/perf_event_open_flags.h" + +#if ULONG_MAX > UINT_MAX +#define LONG_STR_PREFIX "ffffffff" +#else +#define LONG_STR_PREFIX "" +#endif + +static const char *printaddr(void *ptr) +{ + static char buf[sizeof("0x") + sizeof(void *) * 2]; + + if (ptr == NULL) + return "NULL"; + + snprintf(buf, sizeof(buf), "%#lx", (unsigned long)ptr); + + return buf; +} + +int +main(void) +{ + struct perf_event_attr *attr = tail_alloc(sizeof(*attr)); + + attr->type = PERF_TYPE_HARDWARE; + attr->size = sizeof(*attr); + + struct { + struct perf_event_attr *attr; + pid_t pid; + int cpu; + int group_fd; + unsigned long flags; + const char *flags_str; + } args[] = { + { NULL, 0xfacef00d, 0xbadabba7, -1, + (unsigned long) 0xFFFFFFFFFFFFFFFFLLU, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC|" + "0x" LONG_STR_PREFIX "fffffff0" + }, + { attr + 1, 0, 0, 0, + 0, "0" }, + { attr, -1, -1, 1, + PERF_FLAG_FD_CLOEXEC, "PERF_FLAG_FD_CLOEXEC" }, + { attr - 1, -100, 100, 0xface1e55, + PERF_FLAG_FD_NO_GROUP | PERF_FLAG_FD_OUTPUT | + PERF_FLAG_PID_CGROUP | PERF_FLAG_FD_CLOEXEC, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC" }, + }; + size_t i; + int rc; + + for (i = 0; i < ARRAY_SIZE(args); i++) { + rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, + args[i].cpu, args[i].group_fd, args[i].flags); + printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", + printaddr(args[i].attr), args[i].pid, args[i].cpu, + args[i].group_fd, args[i].flags_str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_perf_event_open && HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-mx32/perf_event_open_nonverbose.test b/tests-mx32/perf_event_open_nonverbose.test new file mode 100755 index 00000000..404827fe --- /dev/null +++ b/tests-mx32/perf_event_open_nonverbose.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of perf_event_open syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests-mx32/perf_event_open_unabbrev.c b/tests-mx32/perf_event_open_unabbrev.c new file mode 100644 index 00000000..c2f260de --- /dev/null +++ b/tests-mx32/perf_event_open_unabbrev.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "perf_event_open.c" diff --git a/tests-mx32/perf_event_open_unabbrev.test b/tests-mx32/perf_event_open_unabbrev.test new file mode 100755 index 00000000..f17fd17e --- /dev/null +++ b/tests-mx32/perf_event_open_unabbrev.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check perf_event_open syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests-mx32/personality.c b/tests-mx32/personality.c new file mode 100644 index 00000000..7a279a14 --- /dev/null +++ b/tests-mx32/personality.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +int main(void) +{ + const unsigned int good_type = PER_BSD; + const char *good_type_str = "PER_BSD"; + + const unsigned int bad_type = 0x1f; + const char *bad_type_str = "0x1f /\\* PER_\\?\\?\\? \\*/"; + + const unsigned int good_flags = + SHORT_INODE | WHOLE_SECONDS | STICKY_TIMEOUTS; + const char *good_flags_str = + "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS"; + + const unsigned int bad_flags = 0x10000; + const char *bad_flags_str = "0x10000"; + + const unsigned int saved_pers = personality(0xffffffff); + printf("personality\\(0xffffffff\\) = %#x \\([^)]*\\)\n", saved_pers); + + /* PER_LINUX */ + personality(PER_LINUX); + printf("personality\\(PER_LINUX\\) = %#x \\([^)]*\\)\n", saved_pers); + + personality(0xffffffff); + puts("personality\\(0xffffffff\\) = 0 \\(PER_LINUX\\)"); + + personality(good_flags); + printf("personality\\(PER_LINUX\\|%s\\) = 0 \\(PER_LINUX\\)\n", + good_flags_str); + + personality(bad_flags); + printf("personality\\(PER_LINUX\\|%s\\)" + " = %#x \\(PER_LINUX\\|%s\\)\n", + bad_flags_str, good_flags, good_flags_str); + + personality(good_flags | bad_flags); + printf("personality\\(PER_LINUX\\|%s\\|%s\\)" + " = %#x \\(PER_LINUX\\|%s\\)\n", + good_flags_str, bad_flags_str, bad_flags, bad_flags_str); + + /* another valid type */ + personality(good_type); + printf("personality\\(%s\\) = %#x \\(PER_LINUX\\|%s\\|%s\\)\n", + good_type_str, good_flags | bad_flags, + good_flags_str, bad_flags_str); + + personality(good_type | good_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", + good_type_str, good_flags_str, good_type, good_type_str); + + personality(good_type | bad_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, bad_flags_str, good_type | good_flags, + good_type_str, good_flags_str); + + personality(good_type | good_flags | bad_flags); + printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, good_flags_str, bad_flags_str, + good_type | bad_flags, + good_type_str, bad_flags_str); + + /* invalid type */ + personality(bad_type); + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\|%s\\)\n", + bad_type_str, good_type | good_flags | bad_flags, + good_type_str, good_flags_str, bad_flags_str); + + personality(bad_type | good_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", + bad_type_str, good_flags_str, bad_type, bad_type_str); + + personality(bad_type | bad_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, bad_flags_str, bad_type | good_flags, + bad_type_str, good_flags_str); + + personality(bad_type | good_flags | bad_flags); + printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, good_flags_str, bad_flags_str, + bad_type | bad_flags, bad_type_str, bad_flags_str); + + personality(saved_pers); + printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\|%s\\)\n", + bad_type | good_flags | bad_flags, + bad_type_str, good_flags_str, bad_flags_str); + + return 0; +} diff --git a/tests-mx32/personality.test b/tests-mx32/personality.test new file mode 100755 index 00000000..8f8c0adb --- /dev/null +++ b/tests-mx32/personality.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check personality syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a20 -epersonality $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/pipe.c b/tests-mx32/pipe.c new file mode 100644 index 00000000..41c7f215 --- /dev/null +++ b/tests-mx32/pipe.c @@ -0,0 +1,55 @@ +/* + * Check decoding of pipe syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pipe + +# include +# include +# include + +int +main(void) +{ + (void) close(0); + (void) close(1); + int *const fds = tail_alloc(sizeof(*fds) * 2); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pipe") + +#endif diff --git a/tests-mx32/pipe.expected b/tests-mx32/pipe.expected new file mode 100644 index 00000000..2e46336c --- /dev/null +++ b/tests-mx32/pipe.expected @@ -0,0 +1,2 @@ +pipe([0, 1]) = 0 ++++ exited with 0 +++ diff --git a/tests-mx32/pipe.test b/tests-mx32/pipe.test new file mode 100755 index 00000000..0ae414d4 --- /dev/null +++ b/tests-mx32/pipe.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of pipe syscall. +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a13 -epipe $args + +check_prog grep +LC_ALL=C grep -x "pipe(.*" "$LOG" > /dev/null || + skip_ 'test executable does not use pipe syscall' + +match_diff diff --git a/tests-mx32/pipe2.c b/tests-mx32/pipe2.c new file mode 100644 index 00000000..375ae74f --- /dev/null +++ b/tests-mx32/pipe2.c @@ -0,0 +1,71 @@ +/* + * Check decoding of pipe2 syscall. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pipe2 + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0xffffffff00000000ULL; + int *const fds = tail_alloc(sizeof(*fds) * 2); + int *const efault = fds + 1; + long rc; + + rc = syscall(__NR_pipe2, fds, bogus_zero | O_NONBLOCK); + if (rc) + perror_msg_and_skip("pipe2"); + printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]); + + rc = syscall(__NR_pipe2, efault, bogus_zero); + printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(fds); + rc = syscall(__NR_pipe2, ill, 0); + printf("pipe2(%#llx, 0) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pipe2") + +#endif diff --git a/tests-mx32/pipe2.test b/tests-mx32/pipe2.test new file mode 100755 index 00000000..aff6cd44 --- /dev/null +++ b/tests-mx32/pipe2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pipe2 syscall. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a15 diff --git a/tests-mx32/pipe_maxfd.c b/tests-mx32/pipe_maxfd.c new file mode 100644 index 00000000..a1343f91 --- /dev/null +++ b/tests-mx32/pipe_maxfd.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +static void +move_fd(int *from, int *to) +{ + for (; *to > *from; --*to) { + if (dup2(*from, *to) != *to) + continue; + close(*from); + *from = *to; + break; + } +} + +void +pipe_maxfd(int pipefd[2]) +{ + struct rlimit rlim; + if (getrlimit(RLIMIT_NOFILE, &rlim)) + perror_msg_and_fail("getrlimit"); + if (rlim.rlim_cur < rlim.rlim_max) { + struct rlimit rlim_new; + rlim_new.rlim_cur = rlim_new.rlim_max = rlim.rlim_max; + if (!setrlimit(RLIMIT_NOFILE, &rlim_new)) + rlim.rlim_cur = rlim.rlim_max; + } + + if (pipe(pipefd)) + perror_msg_and_fail("pipe"); + + int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < INT_MAX) + ? rlim.rlim_cur - 1 : INT_MAX; + + move_fd(&pipefd[1], &max_fd); + --max_fd; + move_fd(&pipefd[0], &max_fd); +} diff --git a/tests-mx32/pkey_alloc.c b/tests-mx32/pkey_alloc.c new file mode 100644 index 00000000..45772787 --- /dev/null +++ b/tests-mx32/pkey_alloc.c @@ -0,0 +1,84 @@ +/* + * Check decoding of pkey_alloc syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_alloc + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t flags[] = { + 0, + (kernel_ulong_t) 0xbadc0ded00000000ULL, + (kernel_ulong_t) 0xffff0000eeee1111ULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + }; + static const struct { + kernel_ulong_t val; + const char *str; + } rights[] = { + { (kernel_ulong_t) 0xbadc0ded00000002ULL, + sizeof(kernel_ulong_t) > sizeof(int) ? + "PKEY_DISABLE_WRITE|0xbadc0ded00000000" : + "PKEY_DISABLE_WRITE" }, + { 0xdec0ded, "PKEY_DISABLE_ACCESS|0xdec0dec" }, + { 0x3, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE" }, + { ARG_STR(0) }, + { 0xbadc0dec, "0xbadc0dec /* PKEY_??? */" }, + }; + + long rc; + unsigned int i; + unsigned int j; + + for (i = 0; i < ARRAY_SIZE(flags); i++) { + for (j = 0; j < ARRAY_SIZE(rights); j++) { + rc = syscall(__NR_pkey_alloc, flags[i], rights[j].val); + printf("pkey_alloc(%#llx, %s) = %s\n", + (unsigned long long) flags[i], rights[j].str, + sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_alloc"); + +#endif diff --git a/tests-mx32/pkey_alloc.test b/tests-mx32/pkey_alloc.test new file mode 100755 index 00000000..f168c21a --- /dev/null +++ b/tests-mx32/pkey_alloc.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_alloc syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/pkey_free.c b/tests-mx32/pkey_free.c new file mode 100644 index 00000000..95a2ad26 --- /dev/null +++ b/tests-mx32/pkey_free.c @@ -0,0 +1,67 @@ +/* + * Check decoding of pkey_free syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_free + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t keys[] = { + 0, + 3141592653U, + (kernel_ulong_t) 0xbadc0ded00000000ULL, + (kernel_ulong_t) 0xffff00001111eeeeULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + }; + + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(keys); i++) { + rc = syscall(__NR_pkey_free, keys[i]); + printf("pkey_free(%d) = %s\n", (int) keys[i], sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_free"); + +#endif diff --git a/tests-mx32/pkey_free.test b/tests-mx32/pkey_free.test new file mode 100755 index 00000000..9c01c3e7 --- /dev/null +++ b/tests-mx32/pkey_free.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_free syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-mx32/pkey_mprotect.c b/tests-mx32/pkey_mprotect.c new file mode 100644 index 00000000..529abd1f --- /dev/null +++ b/tests-mx32/pkey_mprotect.c @@ -0,0 +1,120 @@ +/* + * Check decoding of pkey_mprotect syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_mprotect + +# include +# include +# include + +const char * +sprintptr(kernel_ulong_t ptr) +{ + static char buf[sizeof(ptr) * 2 + sizeof("0x")]; + + if (ptr) + snprintf(buf, sizeof(buf), "%#llx", (unsigned long long) ptr); + else + return "NULL"; + + return buf; +} + +int +main(void) +{ + static const kernel_ulong_t ptrs[] = { + 0, + (kernel_ulong_t) 0xfacebeef00000000ULL, + (kernel_ulong_t) 0xbadc0dedda7a1057ULL, + }; + static const kernel_ulong_t sizes[] = { + 0, + (kernel_ulong_t) 0xfacebeef00000000ULL, + (kernel_ulong_t) 0xfedcba9876543210ULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + (kernel_ulong_t) 0xbadc0dedda7a1057ULL, + }; + static const struct { + kernel_ulong_t val; + const char *str; + } prots[] = { + { ARG_STR(PROT_READ) }, + /* For now, only 0x0300001f are used */ + { (kernel_ulong_t) 0xdeadfeed00ca7500ULL, + sizeof(kernel_ulong_t) > sizeof(int) ? + "0xdeadfeed00ca7500 /* PROT_??? */" : + "0xca7500 /* PROT_??? */" }, + { ARG_STR(PROT_READ|PROT_WRITE|0xface00) }, + }; + static const kernel_ulong_t pkeys[] = { + 0, + -1LL, + (kernel_ulong_t) 0xface1e55, + (kernel_ulong_t) 0xbadc0ded00000001, + }; + + long rc; + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + + for (i = 0; i < ARRAY_SIZE(ptrs); i++) { + for (j = 0; j < ARRAY_SIZE(sizes); j++) { + for (k = 0; k < ARRAY_SIZE(prots); k++) { + for (l = 0; l < ARRAY_SIZE(pkeys); l++) { + rc = syscall(__NR_pkey_mprotect, + ptrs[i], sizes[j], + prots[k].val, pkeys[l]); + printf("pkey_mprotect(%s, %llu, %s, %d)" + " = %s\n", + sprintptr(ptrs[i]), + (unsigned long long) sizes[j], + prots[k].str, (int) pkeys[l], + sprintrc(rc)); + } + } + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_mprotect"); + +#endif diff --git a/tests-mx32/pkey_mprotect.test b/tests-mx32/pkey_mprotect.test new file mode 100755 index 00000000..922d4919 --- /dev/null +++ b/tests-mx32/pkey_mprotect.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_mprotect syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-mx32/poll.c b/tests-mx32/poll.c new file mode 100644 index 00000000..c47c97e5 --- /dev/null +++ b/tests-mx32/poll.c @@ -0,0 +1,259 @@ +/* + * This file is part of poll strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_poll + +# include +# include +# include +# include +# include +# include + +#define PRINT_EVENT(flag, member) \ + if (member & flag) { \ + if (member != pfd->member) \ + tprintf("|"); \ + tprintf(#flag); \ + member &= ~flag; \ + } + +static void +print_pollfd_entering(const struct pollfd *const pfd) +{ + tprintf("{fd=%d", pfd->fd); + if (pfd->fd >= 0) { + tprintf(", events="); + short events = pfd->events; + + if (pfd->events) { + PRINT_EVENT(POLLIN, events) + PRINT_EVENT(POLLPRI, events) + PRINT_EVENT(POLLOUT, events) +#ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, events) +#endif +#ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, events) +#endif +#ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, events) +#endif +#ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, events) +#endif + PRINT_EVENT(POLLERR, events) + PRINT_EVENT(POLLHUP, events) + PRINT_EVENT(POLLNVAL, events) + } else + tprintf("0"); + } + tprintf("}"); +} + +static void +print_pollfd_array_entering(const struct pollfd *const pfd, + const unsigned int size, + const unsigned int valid, + const unsigned int abbrev) +{ + tprintf("["); + unsigned int i; + for (i = 0; i < size; ++i) { + if (i) + tprintf(", "); + if (i >= valid) { + tprintf("%p", &pfd[i]); + break; + } + if (i >= abbrev) { + tprintf("..."); + break; + } + print_pollfd_entering(&pfd[i]); + } + tprintf("]"); +} + +static void +print_pollfd_exiting(const struct pollfd *const pfd, + unsigned int *const seen, + const unsigned int abbrev) +{ + if (!pfd->revents || pfd->fd < 0 || *seen > abbrev) + return; + + if (*seen) + tprintf(", "); + ++(*seen); + + if (*seen > abbrev) { + tprintf("..."); + return; + } + tprintf("{fd=%d, revents=", pfd->fd); + short revents = pfd->revents; + + PRINT_EVENT(POLLIN, revents) + PRINT_EVENT(POLLPRI, revents) + PRINT_EVENT(POLLOUT, revents) +#ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, revents) +#endif +#ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, revents) +#endif +#ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, revents) +#endif +#ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, revents) +#endif + PRINT_EVENT(POLLERR, revents) + PRINT_EVENT(POLLHUP, revents) + PRINT_EVENT(POLLNVAL, revents) + tprintf("}"); +} + +static void +print_pollfd_array_exiting(const struct pollfd *const pfd, + const unsigned int size, + const unsigned int abbrev) +{ + tprintf("["); + unsigned int seen = 0; + unsigned int i; + for (i = 0; i < size; ++i) + print_pollfd_exiting(&pfd[i], &seen, abbrev); + tprintf("]"); +} + +int +main(int ac, char **av) +{ + tprintf("%s", ""); + + assert(syscall(__NR_poll, NULL, 42, 0) == -1); + if (ENOSYS == errno) + perror_msg_and_skip("poll"); + tprintf("poll(NULL, 42, 0) = -1 EFAULT (%m)\n"); + + int fds[2]; + if (pipe(fds) || pipe(fds)) + perror_msg_and_fail("pipe"); + + const unsigned int abbrev = (ac > 1) ? atoi(av[1]) : -1; + const struct pollfd pfds0[] = { + { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = fds[0], .events = POLLIN | POLLPRI }, + { .fd = fds[1], .events = POLLOUT }, + { .fd = 2, .events = POLLOUT | POLLWRBAND } + }; + struct pollfd *const tail_fds0 = tail_memdup(pfds0, sizeof(pfds0)); + const int timeout = 42; + int rc = syscall(__NR_poll, tail_fds0, 0, timeout); + assert(rc == 0); + + tprintf("poll([], 0, %d) = %d (Timeout)\n", timeout, rc); + + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 3); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + tail_fds0[0].fd = -1; + tail_fds0[2].fd = -3; + tail_fds0[4].events = 0; + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 2); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + tail_fds0[1].fd = -2; + tail_fds0[4].fd = -5; + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 1); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + struct pollfd pfds1[] = { + { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } + }; + struct pollfd *const tail_fds1 = tail_memdup(pfds1, sizeof(pfds1)); + rc = syscall(__NR_poll, tail_fds1, ARRAY_SIZE(pfds1), timeout); + assert(rc == 0); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds1, ARRAY_SIZE(pfds1), + ARRAY_SIZE(pfds1), abbrev); + tprintf(", %u, %d) = %d (Timeout)\n", ARRAY_SIZE(pfds1), timeout, rc); + + const void *const efault = tail_fds0 + ARRAY_SIZE(pfds0); + rc = syscall(__NR_poll, efault, 1, 0); + assert(rc == -1); + tprintf("poll(%p, 1, 0) = -1 EFAULT (%m)\n", efault); + + const unsigned int valid = 1; + const void *const epfds = tail_fds0 + ARRAY_SIZE(pfds0) - valid; + rc = syscall(__NR_poll, epfds, valid + 1, 0); + assert(rc == -1); + tprintf("poll("); + print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); + errno = EFAULT; + tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_poll") + +#endif diff --git a/tests-mx32/poll.test b/tests-mx32/poll.test new file mode 100755 index 00000000..b74be29e --- /dev/null +++ b/tests-mx32/poll.test @@ -0,0 +1,17 @@ +#!/bin/sh + +# Check poll syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -vepoll $args > "$OUT" +match_diff "$LOG" "$OUT" + +for abbrev in 0 1 2 3 4 5; do + run_prog "./$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev $args > "$OUT" + match_diff "$LOG" "$OUT" +done + +rm -f "$OUT" diff --git a/tests-mx32/ppoll-v.expected b/tests-mx32/ppoll-v.expected new file mode 100644 index 00000000..31070ad1 --- /dev/null +++ b/tests-mx32/ppoll-v.expected @@ -0,0 +1,3 @@ +ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \{fd=3, events=POLLIN\|POLLPRI\}, \{fd=4, events=POLLOUT\}\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) +ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) +ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-mx32/ppoll.c b/tests-mx32/ppoll.c new file mode 100644 index 00000000..46d7e816 --- /dev/null +++ b/tests-mx32/ppoll.c @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +static void +test1(void) +{ + const struct timespec timeout = { .tv_sec = 42, .tv_nsec = 999999999 }; + struct pollfd fds[] = { + { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = 3, .events = POLLIN | POLLPRI }, + { .fd = 4, .events = POLLOUT } + }; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGCHLD); + + int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); + if (rc < 0) + perror_msg_and_skip("ppoll"); + assert(rc == 2); +} + +static void +test2(void) +{ + const struct timespec timeout = { .tv_sec = 0, .tv_nsec = 999 }; + struct pollfd fds[] = { + { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } + }; + + sigset_t mask; + sigfillset(&mask); + sigdelset(&mask, SIGHUP); + sigdelset(&mask, SIGKILL); + sigdelset(&mask, SIGSTOP); + + int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); + if (rc < 0) + perror_msg_and_skip("ppoll"); + assert(rc == 0); +} + +int +main(void) +{ + int fds[2]; + + (void) close(0); + (void) close(1); + (void) close(3); + (void) close(4); + if (pipe(fds) || pipe(fds)) + perror_msg_and_fail("pipe"); + + test1(); + test2(); + + assert(ppoll(NULL, 42, NULL, NULL) < 0); + return 0; +} diff --git a/tests-mx32/ppoll.expected b/tests-mx32/ppoll.expected new file mode 100644 index 00000000..c38a2062 --- /dev/null +++ b/tests-mx32/ppoll.expected @@ -0,0 +1,3 @@ +ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \.\.\.\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) +ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) +ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-mx32/ppoll.test b/tests-mx32/ppoll.test new file mode 100755 index 00000000..98389ee6 --- /dev/null +++ b/tests-mx32/ppoll.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check ppoll syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a30 -s2 -e ppoll $args +match_grep +run_strace -a30 -v -s2 -e ppoll $args +match_grep "$LOG" "$srcdir/$NAME-v.expected" + +exit 0 diff --git a/tests-mx32/prctl-arg2-intptr.c b/tests-mx32/prctl-arg2-intptr.c new file mode 100644 index 00000000..ee000ebe --- /dev/null +++ b/tests-mx32/prctl-arg2-intptr.c @@ -0,0 +1,120 @@ +/* + * Check decoding of prctl operations which use arg2 as pointer to an integer + * value: PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, and PR_GET_FPEXC. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_prctl + +# include +# include +# include +# include + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_addr1 = + (kernel_ulong_t) 0x1e55c0de00000000ULL; + static const kernel_ulong_t bogus_addr2 = + (kernel_ulong_t) 0xfffffffffffffffdULL; + static const kernel_ulong_t bogus_op_bits = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const struct { + kernel_ulong_t val; + const char *str; + } options[] = { + { 37, "PR_GET_CHILD_SUBREAPER" }, + { 19, "PR_GET_ENDIAN" }, + { 9, "PR_GET_FPEMU" }, + { 11, "PR_GET_FPEXC" }, + }; + + unsigned int *ptr = tail_alloc(sizeof(*ptr)); + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(options); ++i) { + prctl(options[i].val | bogus_op_bits, 0); + printf("prctl(%s, NULL) = %s\n", options[i].str, errstr); + + if (bogus_addr1) { + prctl(options[i].val | bogus_op_bits, bogus_addr1); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr1, errstr); + } + + prctl(options[i].val | bogus_op_bits, bogus_addr2); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr2, errstr); + + prctl(options[i].val | bogus_op_bits, (uintptr_t) (ptr + 1)); + printf("prctl(%s, %p) = %s\n", options[i].str, + ptr + 1, errstr); + + rc = prctl(options[i].val | bogus_op_bits, (uintptr_t) ptr); + if (!rc) { + printf("prctl(%s, [%u]) = %s\n", + options[i].str, *ptr, errstr); + } else { + printf("prctl(%s, %p) = %s\n", + options[i].str, ptr, errstr); + } + + if (F8ILL_KULONG_SUPPORTED) { + kernel_ulong_t bogus_addr3 = f8ill_ptr_to_kulong(ptr); + prctl(options[i].val | bogus_op_bits, bogus_addr3); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr3, errstr); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests-mx32/prctl-arg2-intptr.test b/tests-mx32/prctl-arg2-intptr.test new file mode 100755 index 00000000..bcef8065 --- /dev/null +++ b/tests-mx32/prctl-arg2-intptr.test @@ -0,0 +1,14 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, +# and PR_GET_FPEXC operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a25 -eprctl $args > "$EXP" +LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^CEF]|.[^HNP]|..[^DEI])' \ + < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-dumpable.c b/tests-mx32/prctl-dumpable.c new file mode 100644 index 00000000..1049bcee --- /dev/null +++ b/tests-mx32/prctl-dumpable.c @@ -0,0 +1,106 @@ +/* + * Check decoding of prctl PR_GET_DUMPABLE/PR_SET_DUMPABLE operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE + +# include +# include + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_dumpable1 = + (kernel_ulong_t) 0xdeadc0de00000001ULL; + static const kernel_ulong_t bogus_dumpable2 = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + + static const char * const args[] = { + "SUID_DUMP_DISABLE", + "SUID_DUMP_USER", + "SUID_DUMP_ROOT", + }; + + unsigned int i; + + prctl(PR_SET_DUMPABLE, 3); + printf("prctl(PR_SET_DUMPABLE, 0x3 /* SUID_DUMP_??? */) = %s\n", + errstr); + + prctl(PR_SET_DUMPABLE, bogus_dumpable1); + if (bogus_dumpable1 == 1) { + printf("prctl(PR_SET_DUMPABLE, SUID_DUMP_USER) = %s\n", errstr); + } else { + printf("prctl(PR_SET_DUMPABLE, %#llx /* SUID_DUMP_??? */)" + " = %s\n", + (unsigned long long) bogus_dumpable1, errstr); + } + + prctl(PR_SET_DUMPABLE, bogus_dumpable2); + printf("prctl(PR_SET_DUMPABLE, %#llx /* SUID_DUMP_??? */) = %s\n", + (unsigned long long) bogus_dumpable2, errstr); + + for (i = 0; i < ARRAY_SIZE(args); ++i) { + prctl(PR_SET_DUMPABLE, i); + printf("prctl(PR_SET_DUMPABLE, %s) = %s\n", args[i], errstr); + + long rc = prctl(PR_GET_DUMPABLE, bogus_dumpable2); + if (rc >= 0 && rc < (long) ARRAY_SIZE(args)) { + printf("prctl(PR_GET_DUMPABLE) = %s (%s)\n", + errstr, args[rc]); + } else { + printf("prctl(PR_GET_DUMPABLE) = %s\n", errstr); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE") + +#endif diff --git a/tests-mx32/prctl-dumpable.test b/tests-mx32/prctl-dumpable.test new file mode 100755 index 00000000..08acb8b9 --- /dev/null +++ b/tests-mx32/prctl-dumpable.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_DUMPABLE and PR_SET_DUMPABLE operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^D][^U]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-name.c b/tests-mx32/prctl-name.c new file mode 100644 index 00000000..308c275f --- /dev/null +++ b/tests-mx32/prctl-name.c @@ -0,0 +1,103 @@ +/* + * Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_GET_NAME && defined PR_SET_NAME + +# include +# include +# include + +int +main(void) +{ + static const char str[] = "0123456789abcdef"; + static const int len = sizeof(str) - 1; + char *name = tail_memdup(str, sizeof(str)); + int i; + int rc; + + rc = prctl(PR_SET_NAME, NULL); + printf("prctl(PR_SET_NAME, NULL) = %s\n", sprintrc(rc)); + + for (i = 0; i <= len; ++i) { + rc = prctl(PR_SET_NAME, name + len - i); + printf("prctl(PR_SET_NAME, \"%.*s\"%s) = %s\n", + i < len - 1 ? i : len - 1, + str + len - i, + i < len - 1 ? "" : "...", + sprintrc(rc)); + } + + *name = -1; + ++name; + memcpy(name, str, len); + + for (i = 0; i <= len; ++i) { + rc = prctl(PR_SET_NAME, name + len - i); + if (i < len - 1) + printf("prctl(PR_SET_NAME, %p) = %s\n", + name + len - i, sprintrc(rc)); + else + printf("prctl(PR_SET_NAME, \"%.*s\"...) = %s\n", + len - 1, str + len - i, sprintrc(rc)); + } + + rc = prctl(PR_GET_NAME, NULL); + printf("prctl(PR_GET_NAME, NULL) = %s\n", sprintrc(rc)); + + for (i = 0; i < len; ++i) { + rc = prctl(PR_GET_NAME, name + len - i); + printf("prctl(PR_GET_NAME, %p) = %s\n", + name + len - i, sprintrc(rc)); + } + + rc = prctl(PR_GET_NAME, name); + if (rc) + printf("prctl(PR_GET_NAME, %p) = %s\n", + name, sprintrc(rc)); + else + printf("prctl(PR_GET_NAME, \"%.*s\") = %s\n", + len - 1, name, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_GET_NAME && PR_SET_NAME") + +#endif diff --git a/tests-mx32/prctl-name.test b/tests-mx32/prctl-name.test new file mode 100755 index 00000000..071179c5 --- /dev/null +++ b/tests-mx32/prctl-name.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +grep -v '^prctl(PR_GET_[^N][^A]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-no-args.c b/tests-mx32/prctl-no-args.c new file mode 100644 index 00000000..57e1b733 --- /dev/null +++ b/tests-mx32/prctl-no-args.c @@ -0,0 +1,77 @@ +/* + * Check decoding of prctl operations without arguments and return code parsing: + * PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, PR_GET_TIMING, + * PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_prctl + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_op_bits = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xfacefeeddeadbeefULL; + static const struct { + kernel_ulong_t val; + const char *str; + } options[] = { + { 7, "PR_GET_KEEPCAPS" }, + { 13, "PR_GET_TIMING" }, + { 21, "PR_GET_SECCOMP" }, + { 30, "PR_GET_TIMERSLACK" }, + { 31, "PR_TASK_PERF_EVENTS_DISABLE" }, + { 32, "PR_TASK_PERF_EVENTS_ENABLE" }, + }; + + unsigned int *ptr = tail_alloc(sizeof(*ptr)); + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(options); i++) { + long rc = syscall(__NR_prctl, options[i].val | bogus_op_bits, + bogus_arg); + printf("prctl(%s) = %s\n", options[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests-mx32/prctl-no-args.test b/tests-mx32/prctl-no-args.test new file mode 100755 index 00000000..ce8ca67b --- /dev/null +++ b/tests-mx32/prctl-no-args.test @@ -0,0 +1,14 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, +# PR_GET_TIMING, PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE +# operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a21 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^KST][^EI][^CEM]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-pdeathsig.c b/tests-mx32/prctl-pdeathsig.c new file mode 100644 index 00000000..c1760307 --- /dev/null +++ b/tests-mx32/prctl-pdeathsig.c @@ -0,0 +1,81 @@ +/* + * Check decoding of prctl PR_GET_PDEATHSIG/PR_SET_PDEATHSIG operations. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_PDEATHSIG && defined PR_SET_PDEATHSIG + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_signal = + (kernel_ulong_t) 0xbadc0deddeadfeedULL; + + int *pdeathsig = tail_alloc(sizeof(*pdeathsig)); + long rc; + + rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, bogus_signal); + printf("prctl(PR_SET_PDEATHSIG, %llu) = %s\n", + (unsigned long long) bogus_signal, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, SIGINT); + printf("prctl(PR_SET_PDEATHSIG, SIGINT) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, NULL); + printf("prctl(PR_GET_PDEATHSIG, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, pdeathsig + 1); + printf("prctl(PR_GET_PDEATHSIG, %p) = %s\n", + pdeathsig + 1, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, pdeathsig); + if (rc) { + printf("prctl(PR_GET_PDEATHSIG, %p) = %s\n", + pdeathsig, sprintrc(rc)); + } else { + printf("prctl(PR_GET_PDEATHSIG, [SIGINT]) = %s\n", + sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_PDEATHSIG && PR_SET_PDEATHSIG") + +#endif diff --git a/tests-mx32/prctl-pdeathsig.test b/tests-mx32/prctl-pdeathsig.test new file mode 100755 index 00000000..2777503a --- /dev/null +++ b/tests-mx32/prctl-pdeathsig.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check prctl PR_GET_PDEATHSIG PR_SET_PDEATHSIG decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a30 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^P][^D]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-seccomp-filter-v.c b/tests-mx32/prctl-seccomp-filter-v.c new file mode 100644 index 00000000..69316fbe --- /dev/null +++ b/tests-mx32/prctl-seccomp-filter-v.c @@ -0,0 +1,145 @@ +/* + * Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef HAVE_PRCTL +# include +#endif +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined HAVE_PRCTL \ + && defined PR_SET_NO_NEW_PRIVS \ + && defined PR_SET_SECCOMP \ + && defined SECCOMP_MODE_FILTER \ + && defined SECCOMP_RET_ERRNO \ + && defined BPF_JUMP \ + && defined BPF_STMT + +#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) + +#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) + +#define SOCK_FILTER_KILL_PROCESS \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) + +#define PRINT_ALLOW_SYSCALL(nr) \ + printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ + __NR_ ## nr) + +#define PRINT_DENY_SYSCALL(nr, err) \ + printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ + __NR_ ## nr, err) + +static const struct sock_filter filter[] = { + /* load syscall number */ + BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), + + /* allow syscalls */ + SOCK_FILTER_ALLOW_SYSCALL(close), + SOCK_FILTER_ALLOW_SYSCALL(exit), + SOCK_FILTER_ALLOW_SYSCALL(exit_group), + + /* deny syscalls */ + SOCK_FILTER_DENY_SYSCALL(sync, EBUSY), + SOCK_FILTER_DENY_SYSCALL(setsid, EPERM), + + /* kill process */ + SOCK_FILTER_KILL_PROCESS +}; + +static const struct sock_fprog prog = { + .len = ARRAY_SIZE(filter), + .filter = (struct sock_filter *) filter, +}; + +int +main(void) +{ + int fds[2]; + + puts("prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) = 0"); + + printf("prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, {len=%u, filter=[", + prog.len); + + printf("BPF_STMT(BPF_LD|BPF_W|BPF_ABS, %#x), ", + (unsigned) offsetof(struct seccomp_data, nr)); + + PRINT_ALLOW_SYSCALL(close); + PRINT_ALLOW_SYSCALL(exit); + PRINT_ALLOW_SYSCALL(exit_group); + + PRINT_DENY_SYSCALL(sync, EBUSY), + PRINT_DENY_SYSCALL(setsid, EPERM), + + printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"); + + puts("]}) = 0"); + puts("+++ exited with 0 +++"); + + fflush(stdout); + close(0); + close(1); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + perror_msg_and_skip("PR_SET_NO_NEW_PRIVS"); + if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) + perror_msg_and_skip("PR_SET_SECCOMP"); + if (close(0) || close(1)) + _exit(77); + + _exit(0); +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_NO_NEW_PRIVS && PR_SET_SECCOMP" + " && SECCOMP_MODE_FILTER && SECCOMP_RET_ERRNO" + " && BPF_JUMP && BPF_STMT") + +#endif diff --git a/tests-mx32/prctl-seccomp-filter-v.test b/tests-mx32/prctl-seccomp-filter-v.test new file mode 100755 index 00000000..44e4a782 --- /dev/null +++ b/tests-mx32/prctl-seccomp-filter-v.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -v -eprctl $args > "$EXP" +grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-seccomp-strict.c b/tests-mx32/prctl-seccomp-strict.c new file mode 100644 index 00000000..a78f8173 --- /dev/null +++ b/tests-mx32/prctl-seccomp-strict.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_SECCOMP && defined __NR_exit + +# include +# include + +int +main(void) +{ + static const char text1[] = + "prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT) = 0\n"; + static const char text2[] = "+++ exited with 0 +++\n"; + + int rc = prctl(PR_SET_SECCOMP, -1L, 1, 2, 3); + printf("prctl(PR_SET_SECCOMP, %#lx /* SECCOMP_MODE_??? */, 0x1, 0x2, 0x3)" + " = %d %s (%m)\n", -1L, rc, errno2name()); + fflush(stdout); + + rc = prctl(PR_SET_SECCOMP, 1); + if (rc) { + printf("prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT)" + " = %d %s (%m)\n", rc, errno2name()); + fflush(stdout); + rc = 0; + } else { + /* + * If kernel implementaton of SECCOMP_MODE_STRICT is buggy, + * the following syscall will result to SIGKILL. + */ + rc = write(1, text1, LENGTH_OF(text1)) != LENGTH_OF(text1); + } + + rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2); + return !!syscall(__NR_exit, rc); +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_SECCOMP && __NR_exit") + +#endif diff --git a/tests-mx32/prctl-seccomp-strict.test b/tests-mx32/prctl-seccomp-strict.test new file mode 100755 index 00000000..1f987df7 --- /dev/null +++ b/tests-mx32/prctl-seccomp-strict.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check how prctl PR_SET_SECCOMP SECCOMP_MODE_STRICT is decoded. + +. "${srcdir=.}/init.sh" + +check_prog grep +set -- "./$NAME" +"$@" > /dev/null || { + case $? in + 77) skip_ "$* exited with code 77" ;; + 137) framework_skip_ "$* killed by SIGKILL, fix your kernel" ;; + *) fail_ "$args failed" ;; + esac +} +run_strace -eprctl "$@" > "$EXP" +grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-securebits.c b/tests-mx32/prctl-securebits.c new file mode 100644 index 00000000..741973af --- /dev/null +++ b/tests-mx32/prctl-securebits.c @@ -0,0 +1,106 @@ +/* + * Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_SECUREBITS && defined PR_SET_SECUREBITS + +# include +# include + +# include "xlat.h" +# include "xlat/secbits.h" + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bits1 = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + static const kernel_ulong_t bits2 = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const kernel_ulong_t bits3 = + (kernel_ulong_t) 0xffULL; + + prctl(PR_SET_SECUREBITS, 0); + printf("prctl(PR_SET_SECUREBITS, 0) = %s\n", errstr); + + prctl(PR_SET_SECUREBITS, bits1); + printf("prctl(PR_SET_SECUREBITS, SECBIT_NOROOT|SECBIT_NOROOT_LOCKED|" + "SECBIT_NO_SETUID_FIXUP|SECBIT_NO_SETUID_FIXUP_LOCKED|" + "SECBIT_KEEP_CAPS_LOCKED|SECBIT_NO_CAP_AMBIENT_RAISE|" + "SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED|%#llx) = %s\n", + (unsigned long long) bits1 & ~0xffULL, errstr); + + if (bits2) { + prctl(PR_SET_SECUREBITS, bits2); + printf("prctl(PR_SET_SECUREBITS, %#llx /* SECBIT_??? */)" + " = %s\n", (unsigned long long) bits2, errstr); + } + + prctl(PR_SET_SECUREBITS, bits3); + printf("prctl(PR_SET_SECUREBITS, SECBIT_NOROOT|SECBIT_NOROOT_LOCKED|" + "SECBIT_NO_SETUID_FIXUP|SECBIT_NO_SETUID_FIXUP_LOCKED|" + "SECBIT_KEEP_CAPS|SECBIT_KEEP_CAPS_LOCKED|" + "SECBIT_NO_CAP_AMBIENT_RAISE|SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED)" + " = %s\n", errstr); + + long rc = prctl(PR_GET_SECUREBITS, bits1); + printf("prctl(PR_GET_SECUREBITS) = %s", errstr); + if (rc > 0) { + printf(" ("); + printflags(secbits, rc, NULL); + printf(")"); + } + + puts(""); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_SECUREBITS && PR_SET_SECUREBITS") + +#endif diff --git a/tests-mx32/prctl-securebits.test b/tests-mx32/prctl-securebits.test new file mode 100755 index 00000000..c91e62a6 --- /dev/null +++ b/tests-mx32/prctl-securebits.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a25 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^S][^E][^C][^U]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-tid_address.c b/tests-mx32/prctl-tid_address.c new file mode 100644 index 00000000..24e45031 --- /dev/null +++ b/tests-mx32/prctl-tid_address.c @@ -0,0 +1,103 @@ +/* + * Check decoding of prctl PR_GET_TID_ADDRESS operation. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined __NR_set_tid_address && \ + defined PR_GET_TID_ADDRESS + +# include +# include +# include + +static const char * +sprintaddr(kernel_ulong_t addr) +{ + static char buf[sizeof("0x") + sizeof(addr) * 2]; + + if (addr) { + snprintf(buf, sizeof(buf), "%#llx", (unsigned long long) addr); + + return buf; + } + + return "NULL"; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfffffffffffffffdULL; + + /* Note that kernel puts kernel-sized pointer even on x32 */ + kernel_ulong_t *ptr = tail_alloc(sizeof(*ptr)); + long rc; + long set_ok; + + *ptr = (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, NULL); + printf("prctl(PR_GET_TID_ADDRESS, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, bogus_addr); + printf("prctl(PR_GET_TID_ADDRESS, %#llx) = %s\n", + (unsigned long long) bogus_addr, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, ptr); + if (rc) { + printf("prctl(PR_GET_TID_ADDRESS, %p) = %s\n", + ptr, sprintrc(rc)); + } else { + printf("prctl(PR_GET_TID_ADDRESS, [%s]) = %s\n", + sprintaddr(*ptr), sprintrc(rc)); + } + + set_ok = syscall(__NR_set_tid_address, bogus_addr); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, ptr); + if (rc) { + printf("prctl(PR_GET_TID_ADDRESS, %p) = %s\n", + ptr, sprintrc(rc)); + } else { + printf("prctl(PR_GET_TID_ADDRESS, [%s]) = %s\n", + sprintaddr(set_ok ? bogus_addr : *ptr), sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && __NR_set_tid_address && PR_GET_TID_ADDRESS") + +#endif diff --git a/tests-mx32/prctl-tid_address.test b/tests-mx32/prctl-tid_address.test new file mode 100755 index 00000000..dc7b7c32 --- /dev/null +++ b/tests-mx32/prctl-tid_address.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_TID_ADDRESS operation. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^T]|.[^I]|..[^D])' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-tsc.c b/tests-mx32/prctl-tsc.c new file mode 100644 index 00000000..fd9362d7 --- /dev/null +++ b/tests-mx32/prctl-tsc.c @@ -0,0 +1,80 @@ +/* + * Check decoding of prctl PR_GET_TSC/PR_SET_TSC operations. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_TSC && defined PR_SET_TSC + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_tsc = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + + int *tsc = tail_alloc(sizeof(*tsc)); + long rc; + + rc = syscall(__NR_prctl, PR_SET_TSC, 0); + printf("prctl(PR_SET_TSC, 0 /* PR_TSC_??? */) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_TSC, bogus_tsc); + printf("prctl(PR_SET_TSC, %#x /* PR_TSC_??? */) = %s\n", + (unsigned int) bogus_tsc, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_TSC, PR_TSC_SIGSEGV); + printf("prctl(PR_SET_TSC, PR_TSC_SIGSEGV) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, NULL); + printf("prctl(PR_GET_TSC, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, tsc + 1); + printf("prctl(PR_GET_TSC, %p) = %s\n", tsc + 1, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, tsc); + if (rc) + printf("prctl(PR_GET_TSC, %p) = %s\n", tsc, sprintrc(rc)); + else + printf("prctl(PR_GET_TSC, [PR_TSC_SIGSEGV]) = %s\n", + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_TSC && PR_SET_TSC") + +#endif diff --git a/tests-mx32/prctl-tsc.test b/tests-mx32/prctl-tsc.test new file mode 100755 index 00000000..a906ba89 --- /dev/null +++ b/tests-mx32/prctl-tsc.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check prctl PR_GET_TSC PR_SET_TSC decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a24 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^T][^S]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests-mx32/pread64-pwrite64.c b/tests-mx32/pread64-pwrite64.c new file mode 100644 index 00000000..4a0932a9 --- /dev/null +++ b/tests-mx32/pread64-pwrite64.c @@ -0,0 +1,223 @@ +/* + * Check decoding of pread64 and pwrite64 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +static void +dump_str(const char *str, const unsigned int len) +{ + static const char dots[16] = "................"; + unsigned int i; + + for (i = 0; i < len; i += 16) { + unsigned int n = len - i > 16 ? 16 : len - i; + const char *dump = hexdump_memdup(str + i, n); + + tprintf(" | %05x %-49s %-16.*s |\n", + i, dump, n, dots); + + free((void *) dump); + } +} + +static void +print_hex(const char *str, const unsigned int len) +{ + const unsigned char *ustr = (const unsigned char *) str; + unsigned int i; + + for (i = 0; i < len; ++i) { + unsigned int c = ustr[i]; + + switch (c) { + case '\t': + tprintf("\\t"); break; + case '\n': + tprintf("\\n"); break; + case '\v': + tprintf("\\v"); break; + case '\f': + tprintf("\\f"); break; + case '\r': + tprintf("\\r"); break; + default: + tprintf("\\%o", ustr[i]); + } + } +} + +static void +test_dump(const unsigned int len) +{ + static char *buf; + + if (buf) { + size_t ps1 = get_page_size() - 1; + buf = (void *) (((size_t) buf + ps1) & ~ps1) - len; + } else { + buf = tail_alloc(len); + } + + const off_t offset = 0xdefaceddeadbeefLL + len; + long rc = pread(0, buf, len, offset); + if (rc != (int) len) + perror_msg_and_fail("pread64: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "pread64", 0); + print_hex(buf, len); + tprintf("\", %d, %lld) = %ld\n", len, (long long) offset, rc); + dump_str(buf, len); + + unsigned int i; + for (i = 0; i < len; ++i) + buf[i] = i; + + rc = pwrite(1, buf, len, offset); + if (rc != (int) len) + perror_msg_and_fail("pwrite64: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "pwrite64", 1); + print_hex(buf, len); + tprintf("\", %d, %lld) = %ld\n", len, (long long) offset, rc); + dump_str(buf, len); + + if (!len) + buf = 0; +} + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "pread64-pwrite64-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + + char *nil = tail_alloc(1); + *nil = '\0'; + + static const char w_c[] = "0123456789abcde"; + const unsigned int w_len = LENGTH_OF(w_c); + const char *w_d = hexdump_strdup(w_c); + const void *w = tail_memdup(w_c, w_len); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + const unsigned int r0_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r0_len); + + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + const unsigned int r1_len = w_len - r0_len; + void *r1 = tail_alloc(w_len); + + void *efault = r1 - get_page_size(); + + long rc; + + rc = pwrite(1, w, 0, 0); + if (rc) + perror_msg_and_fail("pwrite64: expected 0, returned %ld", rc); + tprintf("pwrite64(1, \"\", 0, 0) = 0\n"); + + rc = pwrite(1, efault, 1, 0); + if (rc != -1) + perror_msg_and_fail("pwrite64: expected -1 EFAULT" + ", returned %ld", rc); + tprintf("pwrite64(1, %p, 1, 0) = -1 EFAULT (%m)\n", efault); + + rc = pwrite(1, nil, 1, -3); + if (rc != -1) + perror_msg_and_fail("pwrite64: expected -1, returned %ld", rc); + tprintf("pwrite64(1, \"\\0\", 1, -3) = -1 EINVAL (%m)\n"); + + rc = pwrite(1, w, w_len, 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwrite64: expected %u, returned %ld", + w_len, rc); + tprintf("pwrite64(1, \"%s\", %u, 0) = %ld\n" + " | 00000 %-49s %-16s |\n", + w_c, w_len, rc, w_d, w_c); + close(1); + + rc = pread(0, r0, 0, 0); + if (rc) + perror_msg_and_fail("pread64: expected 0, returned %ld", rc); + tprintf("pread64(0, \"\", 0, 0) = 0\n"); + + rc = pread(0, efault, 1, 0); + if (rc != -1) + perror_msg_and_fail("pread64: expected -1, returned %ld", rc); + tprintf("pread64(0, %p, 1, 0) = -1 EFAULT (%m)\n", efault); + + rc = pread(0, efault, 2, -7); + if (rc != -1) + perror_msg_and_fail("pread64: expected -1, returned %ld", rc); + tprintf("pread64(0, %p, 2, -7) = -1 EINVAL (%m)\n", efault); + + rc = pread(0, r0, r0_len, 0); + if (rc != (int) r0_len) + perror_msg_and_fail("pread64: expected %u, returned %ld", + r0_len, rc); + tprintf("pread64(0, \"%s\", %u, 0) = %ld\n" + " | 00000 %-49s %-16s |\n", + r0_c, r0_len, rc, r0_d, r0_c); + + rc = pread(0, r1, w_len, r0_len); + if (rc != (int) r1_len) + perror_msg_and_fail("pread64: expected %u, returned %ld", + r1_len, rc); + tprintf("pread64(0, \"%s\", %u, %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r1_c, w_len, r0_len, rc, r1_d, r1_c); + close(0); + + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 1) + perror_msg_and_fail("open"); + + unsigned int i; + for (i = 0; i <= 32; ++i) + test_dump(i); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/pread64-pwrite64.test b/tests-mx32/pread64-pwrite64.test new file mode 100755 index 00000000..e585406d --- /dev/null +++ b/tests-mx32/pread64-pwrite64.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check decoding and dumping of pread64 and pwrite64 syscalls. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +tmpfile=pread64-pwrite64-tmpfile +> $tmpfile + +run_strace_match_diff \ + -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 \ + -P $tmpfile -P /dev/zero -P /dev/null + +rm -f $tmpfile diff --git a/tests-mx32/preadv-pwritev.c b/tests-mx32/preadv-pwritev.c new file mode 100644 index 00000000..b2d2a824 --- /dev/null +++ b/tests-mx32/preadv-pwritev.c @@ -0,0 +1,182 @@ +/* + * Check decoding of preadv and pwritev syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#if defined HAVE_PREADV && defined HAVE_PWRITEV + +# include +# include +# include +# include + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "preadv-pwritev-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + if (unlink(tmp)) + perror_msg_and_fail("unlink: %s", tmp); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + const void *efault = w0 + LENGTH_OF(w0_c); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + long rc; + + rc = pwritev(1, efault, 42, 0); + tprintf("pwritev(1, %p, 42, 0) = %ld %s (%m)\n", + efault, rc, errno2name()); + + rc = preadv(0, efault, 42, 0); + tprintf("preadv(0, %p, 42, 0) = %ld %s (%m)\n", + efault, rc, errno2name()); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + rc = pwritev(1, w_iov, 0, 0); + if (rc) + perror_msg_and_fail("pwritev: expected 0, returned %ld", rc); + tprintf("pwritev(1, [], 0, 0) = 0\n"); + + rc = pwritev(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0)" + " = %ld %s (%m)\n", + w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + rc = pwritev(1, w_iov, ARRAY_SIZE(w_iov_), 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwritev: expected %u, returned %ld", + w_len, rc); + close(1); + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + rc = preadv(0, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv: expected %u, returned %ld", + r_len, rc); + tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = preadv(0, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) w_len - (int) r_len) + perror_msg_and_fail("preadv: expected %d, returned %ld", + (int) w_len - r_len, rc); + tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r_len, w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV && HAVE_PWRITEV") + +#endif diff --git a/tests-mx32/preadv-pwritev.test b/tests-mx32/preadv-pwritev.test new file mode 100755 index 00000000..cb2a0772 --- /dev/null +++ b/tests-mx32/preadv-pwritev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding and dumping of preadv and pwritev syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests-mx32/preadv.c b/tests-mx32/preadv.c new file mode 100644 index 00000000..fb5d3ad7 --- /dev/null +++ b/tests-mx32/preadv.c @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PREADV + +# include +# include +# include +# include + +# define LEN 8 + +static void +print_iov(const struct iovec *iov) +{ + unsigned int i; + unsigned char *buf = iov->iov_base; + + fputs("{iov_base=\"", stdout); + for (i = 0; i < iov->iov_len; ++i) + printf("\\%d", (int) buf[i]); + printf("\", iov_len=%u}", (unsigned) iov->iov_len); +} + +static void +print_iovec(const struct iovec *iov, unsigned int cnt) +{ + unsigned int i; + putchar('['); + for (i = 0; i < cnt; ++i) { + if (i) + fputs(", ", stdout); + print_iov(&iov[i]); + } + putchar(']'); +} + +int +main(void) +{ + const off_t offset = 0xdefaceddeadbeefLL; + char *buf = tail_alloc(LEN); + struct iovec *iov = tail_alloc(sizeof(*iov)); + iov->iov_base = buf; + iov->iov_len = LEN; + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (preadv(0, iov, 1, offset) != LEN) + perror_msg_and_fail("preadv"); + printf("preadv(0, "); + print_iovec(iov, 1); + printf(", 1, %lld) = %u\n", (long long) offset, LEN); + + if (preadv(0, iov, 1, -1) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, [{iov_base=%p, iov_len=%zu}], 1, -1) = " + "-1 EINVAL (%m)\n", iov->iov_base, iov->iov_len); + + if (preadv(0, NULL, 1, -2) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, NULL, 1, -2) = -1 EINVAL (%m)\n"); + + if (preadv(0, iov, 0, -3) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, [], 0, -3) = -1 EINVAL (%m)\n"); + + static const char tmp[] = "preadv-tmpfile"; + int fd = open(tmp, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd < 0) + perror_msg_and_fail("open"); + if (unlink(tmp)) + perror_msg_and_fail("unlink"); + + static const char w[] = "0123456789abcde"; + if (write(fd, w, LENGTH_OF(w)) != LENGTH_OF(w)) + perror_msg_and_fail("write"); + + static const char r0_c[] = "01234567"; + static const char r1_c[] = "89abcde"; + + const unsigned int r_len = (LENGTH_OF(w) + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + long rc; + + rc = preadv(fd, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv: expected %u, returned %ld", + r_len, rc); + printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n", + fd, r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(LENGTH_OF(w)); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = LENGTH_OF(w) + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = preadv(fd, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) LENGTH_OF(w) - (int) r_len) + perror_msg_and_fail("preadv: expected %d, returned %ld", + (int) LENGTH_OF(w) - r_len, rc); + printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n", + fd, r1_c, r_len, LENGTH_OF(w), ARRAY_SIZE(r1_iov_), + r_len, LENGTH_OF(w) - r_len); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV") + +#endif diff --git a/tests-mx32/preadv.test b/tests-mx32/preadv.test new file mode 100755 index 00000000..d1abdb7d --- /dev/null +++ b/tests-mx32/preadv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check preadv syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/preadv2-pwritev2.c b/tests-mx32/preadv2-pwritev2.c new file mode 100644 index 00000000..f7c46c0a --- /dev/null +++ b/tests-mx32/preadv2-pwritev2.c @@ -0,0 +1,216 @@ +/* + * Check decoding of preadv2 and pwritev2 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#if defined __NR_preadv2 && defined __NR_pwritev2 + +# include +# include +# include +# include +# include + +static int +pr(const int fd, const struct iovec *const vec, + const unsigned long vlen, const unsigned long pos) +{ + return syscall(__NR_preadv2, fd, vec, vlen, pos, 0L, 0L); +} + +static int +pw(const int fd, const struct iovec *const vec, + const unsigned long vlen, const unsigned long pos) +{ + return syscall(__NR_pwritev2, fd, vec, vlen, pos, 0L, 0L); +} + +static void +dumpio(void) +{ + static char tmp[] = "preadv2-pwritev2-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + if (unlink(tmp)) + perror_msg_and_fail("unlink: %s", tmp); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + long rc; + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + rc = pw(1, w_iov, 0, 0); + if (rc) + perror_msg_and_fail("pwritev2: expected 0, returned %ld", rc); + tprintf("pwritev2(1, [], 0, 0, 0) = 0\n"); + + rc = pw(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0, 0)" + " = %ld %s (%m)\n", + w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + rc = pw(1, w_iov, ARRAY_SIZE(w_iov_), 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwritev2: expected %u, returned %ld", + w_len, rc); + close(1); + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + rc = pr(0, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv2: expected %u, returned %ld", + r_len, rc); + tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = pr(0, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) w_len - (int) r_len) + perror_msg_and_fail("preadv2: expected %d, returned %ld", + (int) w_len - r_len, rc); + tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r_len, w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); +} + +int +main(void) +{ + const kernel_ulong_t vlen = (kernel_ulong_t) 0xfac1fed2dad3bef4ULL; + const unsigned long long pos = 0xfac5fed6dad7bef8; + const kernel_ulong_t pos_l = (kernel_ulong_t) pos; + const kernel_ulong_t pos_h = + (sizeof(kernel_ulong_t) == sizeof(long long)) ? + (kernel_ulong_t) 0xbadc0deddeadbeefULL : 0xfac5fed6UL; + int test_dumpio = 1; + + tprintf("%s", ""); + + syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); + if (ENOSYS == errno) + test_dumpio = 0; + tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", + (unsigned long) vlen, pos, errno2name()); + + syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); + if (ENOSYS == errno) + test_dumpio = 0; + tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", + (unsigned long) vlen, pos, errno2name()); + + if (test_dumpio) + dumpio(); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_preadv2 && __NR_pwritev2") + +#endif diff --git a/tests-mx32/preadv2-pwritev2.test b/tests-mx32/preadv2-pwritev2.test new file mode 100755 index 00000000..5641ef46 --- /dev/null +++ b/tests-mx32/preadv2-pwritev2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding and dumping of preadv2 and pwritev2 syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests-mx32/print_maxfd.c b/tests-mx32/print_maxfd.c new file mode 100644 index 00000000..c3d4ea88 --- /dev/null +++ b/tests-mx32/print_maxfd.c @@ -0,0 +1,41 @@ +/* + * Print the maximum descriptor number available. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + int fds[2]; + pipe_maxfd(fds); + printf("%d\n", fds[1]); + return 0; +} diff --git a/tests-mx32/print_quoted_string.c b/tests-mx32/print_quoted_string.c new file mode 100644 index 00000000..3ad86024 --- /dev/null +++ b/tests-mx32/print_quoted_string.c @@ -0,0 +1,75 @@ +#include "tests.h" + +#include +#include +#include + +/* + * Based on string_quote() from util.c. + * Assumes instr is NUL-terminated. + */ + +void +print_quoted_string(const char *instr) +{ + print_quoted_memory(instr, strlen(instr)); +} + +void +print_quoted_memory(const char *instr, const size_t len) +{ + const unsigned char *str = (const unsigned char*) instr; + size_t i; + + for (i = 0; i < len; ++i) { + const int c = str[i]; + switch (c) { + case '\"': + printf("\\\""); + break; + case '\\': + printf("\\\\"); + break; + case '\f': + printf("\\f"); + break; + case '\n': + printf("\\n"); + break; + case '\r': + printf("\\r"); + break; + case '\t': + printf("\\t"); + break; + case '\v': + printf("\\v"); + break; + default: + if (c >= ' ' && c <= 0x7e) + putchar(c); + else { + putchar('\\'); + + char c1 = '0' + (c & 0x7); + char c2 = '0' + ((c >> 3) & 0x7); + char c3 = '0' + (c >> 6); + + if (*str >= '0' && *str <= '9') { + /* Print \octal */ + putchar(c3); + putchar(c2); + } else { + /* Print \[[o]o]o */ + if (c3 != '0') + putchar(c3); + if (c3 != '0' || c2 != '0') + putchar(c2); + } + putchar(c1); + } + break; + } + } + +} diff --git a/tests-mx32/printflags.c b/tests-mx32/printflags.c new file mode 100644 index 00000000..badc85d3 --- /dev/null +++ b/tests-mx32/printflags.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "xlat.h" +#include + +int +printflags(const struct xlat *xlat, unsigned long long flags, + const char *const dflt) +{ + if (flags == 0 && xlat->val == 0 && xlat->str) { + fputs(xlat->str, stdout); + return 1; + } + + int n; + char sep = 0; + for (n = 0; xlat->str; xlat++) { + if (xlat->val && (flags & xlat->val) == xlat->val) { + if (sep) + putc(sep, stdout); + else + sep = '|'; + fputs(xlat->str, stdout); + flags &= ~xlat->val; + n++; + } + } + + if (n) { + if (flags) { + if (sep) + putc(sep, stdout); + printf("%#llx", flags); + n++; + } + } else { + if (flags) { + printf("%#llx", flags); + if (dflt) + printf(" /* %s */", dflt); + } else { + if (dflt) + putc('0', stdout); + } + } + + return n; +} diff --git a/tests-mx32/printstr.c b/tests-mx32/printstr.c new file mode 100644 index 00000000..330234f1 --- /dev/null +++ b/tests-mx32/printstr.c @@ -0,0 +1,69 @@ +/* + * Check decoding of non-NUL-terminated strings when len == -1. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +#define DEFAULT_STRLEN 32 + +int +main(void) +{ + char *const buf = tail_alloc(DEFAULT_STRLEN + 1); + const struct iovec io = { + .iov_base = buf, + .iov_len = -1 + }; + int rc; + + buf[0] = 0; + + tprintf("%s", ""); + + memset(buf + 1, 'X', DEFAULT_STRLEN); + buf[DEFAULT_STRLEN - 1] = 0; + + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=\"\\0%*s\\0\"..., iov_len=%lu}], 1)" + " = %s\n", DEFAULT_STRLEN - 2, buf + 1, -1UL, sprintrc(rc)); + + buf[DEFAULT_STRLEN - 1] = 'X'; + buf[DEFAULT_STRLEN] = 0; + + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=\"\\0%*s\"..., iov_len=%lu}], 1)" + " = %s\n", DEFAULT_STRLEN - 1, buf + 1, -1UL, sprintrc(rc)); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/printstr.test b/tests-mx32/printstr.test new file mode 100755 index 00000000..5f164eb7 --- /dev/null +++ b/tests-mx32/printstr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of non-NUL-terminated strings when len == -1. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -e trace=writev diff --git a/tests-mx32/printxval.c b/tests-mx32/printxval.c new file mode 100644 index 00000000..4fb61c84 --- /dev/null +++ b/tests-mx32/printxval.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "xlat.h" +#include + +int +printxval(const struct xlat *xlat, unsigned long long val, + const char *const dflt) +{ + for (; xlat->str; xlat++) { + if (xlat->val == val) { + fputs(xlat->str, stdout); + return 1; + } + } + + printf("%#llx", val); + if (dflt) + printf(" /* %s */", dflt); + return 0; +} diff --git a/tests-mx32/prlimit64.c b/tests-mx32/prlimit64.c new file mode 100644 index 00000000..1e651161 --- /dev/null +++ b/tests-mx32/prlimit64.c @@ -0,0 +1,92 @@ +/* + * Check decoding of prlimit64 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_prlimit64 + +# include +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/resources.h" + +const char * +sprint_rlim(uint64_t lim) +{ + if (lim == -1ULL) + return "RLIM64_INFINITY"; + + static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; + static int i; + i &= 1; + if (lim > 1024 && lim % 1024 == 0) + sprintf(buf[i], "%" PRIu64 "*1024", lim / 1024); + else + sprintf(buf[i], "%" PRIu64, lim); + + return buf[i++]; +} + +int +main(void) +{ + unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + uint64_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(__NR_prlimit64, pid, res, 0, rlimit); + if (rc) + printf("prlimit64(%d, %s, NULL, %p) = %ld %s (%m)\n", + (unsigned) pid, xlat->str, rlimit, + rc, errno2name()); + else + printf("prlimit64(%d, %s, NULL" + ", {rlim_cur=%s, rlim_max=%s}) = 0\n", + (unsigned) pid, xlat->str, + sprint_rlim(rlimit[0]), + sprint_rlim(rlimit[1])); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prlimit64") + +#endif diff --git a/tests-mx32/prlimit64.test b/tests-mx32/prlimit64.test new file mode 100755 index 00000000..2d2240d7 --- /dev/null +++ b/tests-mx32/prlimit64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of prlimit64 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/process_vm_readv.c b/tests-mx32/process_vm_readv.c new file mode 100644 index 00000000..cfb8f786 --- /dev/null +++ b/tests-mx32/process_vm_readv.c @@ -0,0 +1,18 @@ +#include "tests.h" + +#include + +#ifdef __NR_process_vm_readv + +# define OP process_vm_readv +# define OP_NR __NR_process_vm_readv +# define OP_STR "process_vm_readv" +# define OP_WR 0 + +# include "process_vm_readv_writev.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_process_vm_readv"); + +#endif diff --git a/tests-mx32/process_vm_readv.test b/tests-mx32/process_vm_readv.test new file mode 100755 index 00000000..c092f5a3 --- /dev/null +++ b/tests-mx32/process_vm_readv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of process_vm_readv syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a37 diff --git a/tests-mx32/process_vm_readv_writev.c b/tests-mx32/process_vm_readv_writev.c new file mode 100644 index 00000000..2a089395 --- /dev/null +++ b/tests-mx32/process_vm_readv_writev.c @@ -0,0 +1,306 @@ +/* + * Check decoding of process_vm_readv/process_vm_writev syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +#if OP_WR +# define in_iovec rmt_iovec +# define out_iovec lcl_iovec +# define in_iov rmt_iov +# define out_iov lcl_iov +#else +# define in_iovec lcl_iovec +# define out_iovec rmt_iovec +# define in_iov lcl_iov +# define out_iov rmt_iov +#endif + +typedef void (*iov_print_fn)(const struct iovec *, const void *, long); + +enum { MAX_SEGM_COUNT = 2, MAX_STR_LEN = 5 }; + +struct print_iov_arg { + uint32_t count; + uint32_t valid :1, + string :1, + addr_term:1, + check_rc :1; + uint32_t str_segms; + uint8_t str_base[MAX_SEGM_COUNT]; + uint8_t str_size[MAX_SEGM_COUNT]; +}; + +static void +print_iov(const struct iovec *iov, const void *arg_ptr, long rc) +{ + const struct print_iov_arg *arg = arg_ptr; + uint32_t i; + uint32_t num_segm = 0; + uint64_t segm_offs = 0; + + if (!arg || !arg->valid) { + if (iov) + printf("%p", iov); + else + printf("NULL"); + + return; + } + + printf("["); + + for (i = 0; i < arg->count; i++) { + if (i) + printf(", "); + + if (i >= MAX_STR_LEN) { + printf("..."); + break; + } + + printf("{iov_base="); + if (arg->string && (!arg->check_rc || (rc != -1))) { + uint64_t str_left = iov[i].iov_len; + uint64_t pr_count = 0; + + printf("\""); + + while (str_left--) { + static const char oct_str[] = "01234567"; + uint8_t c = arg->str_base[num_segm] + segm_offs; + + if ((num_segm >= arg->str_segms) || + (num_segm >= MAX_SEGM_COUNT)) + error_msg_and_fail("print_iov: segment " + "count overrun"); + + if (pr_count++ < MAX_STR_LEN) + printf("\\%.1s%.1s%d", + (c >> 6) ? + oct_str + (c >> 6) : "", + (c >> 3) ? + oct_str + ((c >> 3) & 7) : "", + c & 7); + + segm_offs++; + + if (segm_offs >= arg->str_size[num_segm]) { + num_segm++; + segm_offs = 0; + } + } + + printf("\""); + + if (pr_count > MAX_STR_LEN) + printf("..."); + } else { + if (iov[i].iov_base) + printf("%p", iov[i].iov_base); + else + printf("NULL"); + } + + printf(", iov_len=%zu}", iov[i].iov_len); + } + + if (arg->addr_term) + printf(", %p", iov + arg->count); + + printf("]"); +} + +static void +do_call(kernel_ulong_t pid, + kernel_ulong_t local_iov, const char *local_arg, + kernel_ulong_t liovcnt, + kernel_ulong_t remote_iov, const char *remote_arg, + kernel_ulong_t riovcnt, + kernel_ulong_t flags, iov_print_fn pr_iov) +{ + long rc; + const char *errstr; + + rc = syscall(OP_NR, pid, local_iov, liovcnt, remote_iov, riovcnt, + flags); + errstr = sprintrc(rc); + + printf("%s(%d, ", OP_STR, (int) pid); + + if (pr_iov) + pr_iov((const struct iovec *) (uintptr_t) local_iov, local_arg, + rc); + else + printf("%s", local_arg); + + printf(", %lu, ", (unsigned long) liovcnt); + + if (pr_iov) + pr_iov((const struct iovec *) (uintptr_t) remote_iov, + remote_arg, rc); + else + printf("%s", remote_arg); + + printf(", %lu, %lu) = %s\n", (unsigned long) riovcnt, + (unsigned long) flags, errstr); +} + +kernel_ulong_t +ptr_cast(void *ptr) +{ + return (kernel_ulong_t) (uintptr_t) ptr; +} + +int +main(void) +{ + enum { + SIZE_11 = 2, + SIZE_12 = 3, + SIZE_13 = 4, + SIZE_1 = SIZE_11 + SIZE_12 + SIZE_13, + SIZE_21 = 5, + SIZE_22 = 6, + SIZE_23 = 7, + SIZE_2 = SIZE_21 + SIZE_22 + SIZE_23, + }; + + enum { + SEGM1_BASE = 0x80, + SEGM2_BASE = 0xA0, + }; + + static const kernel_ulong_t bogus_pid = + (kernel_ulong_t) 0xbadfaceddeadca57ULL; + static const kernel_ulong_t bogus_iovcnt1 = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + static const kernel_ulong_t bogus_iovcnt2 = + (kernel_ulong_t) 0xdec0ded3defaced4ULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xdeadc0deda7adeadULL; + + pid_t my_pid = getpid(); + char *data1_out = tail_alloc(SIZE_1); + char *data2_out = tail_alloc(SIZE_2); + char *data1_in = tail_alloc(SIZE_2); + char *data2_in = tail_alloc(SIZE_1); + + struct iovec bogus_iovec[] = { + { data1_out + SIZE_1, (size_t) 0xdeadfaceca57beefULL }, + { data1_in + SIZE_2, (size_t) 0xbadc0dedda7adeadULL }, + { data2_out + SIZE_2, (size_t) 0xf157facedec0ded1ULL }, + { data2_in + SIZE_1, (size_t) 0xdefaced2bea7be57ULL }, + }; + + struct iovec out_iovec[] = { + { data1_out, SIZE_11 }, + { data1_out + SIZE_11, SIZE_12 }, + { data1_out + SIZE_11 + SIZE_12, SIZE_13 }, + { data2_out, SIZE_21 }, + { data2_out + SIZE_21, SIZE_22 }, + { data2_out + SIZE_21 + SIZE_22, SIZE_23 }, + }; + struct iovec in_iovec[] = { + { data1_in, SIZE_23 }, + { data1_in + SIZE_23, SIZE_22 }, + { data1_in + SIZE_23 + SIZE_22, SIZE_21 }, + { data2_in, SIZE_13 }, + { data2_in + SIZE_13, SIZE_12 }, + { data2_in + SIZE_13 + SIZE_12, SIZE_11 }, + }; + + struct iovec *bogus_iov = tail_memdup(bogus_iovec, sizeof(bogus_iovec)); + struct iovec *lcl_iov = tail_memdup(lcl_iovec, sizeof(lcl_iovec)); + struct iovec *rmt_iov = tail_memdup(rmt_iovec, sizeof(rmt_iovec)); + + struct print_iov_arg bogus_arg = { ARRAY_SIZE(bogus_iovec), 1 }; + struct print_iov_arg lcl_arg = { ARRAY_SIZE(lcl_iovec), 1, 1, 0, 0, + 2, {SEGM1_BASE, SEGM2_BASE}, {SIZE_1, SIZE_2} }; + struct print_iov_arg rmt_arg = { ARRAY_SIZE(rmt_iovec), 1 }; + + struct print_iov_arg bogus_arg_cut = + { ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 }; + struct print_iov_arg lcl_arg_cut = + { ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, + {SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE}, + {SIZE_13, SIZE_2} }; + struct print_iov_arg rmt_arg_cut = + { ARRAY_SIZE(rmt_iovec) - 2, 1 }; + + + fill_memory_ex(data1_out, SIZE_1, SEGM1_BASE, SIZE_1); + fill_memory_ex(data2_out, SIZE_2, SEGM2_BASE, SIZE_2); + + + do_call(bogus_pid, (kernel_ulong_t) (uintptr_t) ARG_STR(NULL), + bogus_iovcnt1, (kernel_ulong_t) (uintptr_t) ARG_STR(NULL), + bogus_iovcnt2, bogus_flags, NULL); + + do_call(my_pid, ptr_cast(bogus_iov + ARRAY_SIZE(bogus_iovec)), + "[]", 0, ptr_cast(in_iov + ARRAY_SIZE(in_iovec)), "[]", + 0, 0, NULL); + do_call(my_pid, ptr_cast(bogus_iov + ARRAY_SIZE(bogus_iovec)), NULL, + bogus_iovcnt1, ptr_cast(in_iov + ARRAY_SIZE(in_iovec)), NULL, + bogus_iovcnt2, 0, print_iov); + + do_call(my_pid, ptr_cast(bogus_iov), (char *) &bogus_arg, + ARRAY_SIZE(bogus_iovec), ptr_cast(rmt_iov + 2), + (char *) &rmt_arg_cut, ARRAY_SIZE(rmt_iovec) - 2, 0, print_iov); + +#if !OP_WR + lcl_arg.check_rc = 1; + lcl_arg_cut.check_rc = 1; +#endif + + do_call(my_pid, ptr_cast(lcl_iov + 2), (char *) &lcl_arg_cut, + ARRAY_SIZE(lcl_iovec) - 1, ptr_cast(bogus_iov + 2), + (char *) &bogus_arg_cut, ARRAY_SIZE(bogus_iovec) - 1, 0, + print_iov); + + lcl_arg_cut.addr_term = 0; + + rmt_arg_cut.addr_term = 1; + rmt_arg_cut.count = 5; + + do_call(my_pid, ptr_cast(lcl_iov + 2), (char *) &lcl_arg_cut, + ARRAY_SIZE(lcl_iovec) - 2, ptr_cast(rmt_iov + 1), + (char *) &rmt_arg_cut, ARRAY_SIZE(rmt_iovec), 0, print_iov); + + /* Correct call */ + do_call(my_pid, ptr_cast(lcl_iov), (char *) &lcl_arg, + ARRAY_SIZE(lcl_iovec), ptr_cast(rmt_iov), (char *) &rmt_arg, + ARRAY_SIZE(rmt_iovec), 0, print_iov); + + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-mx32/process_vm_writev.c b/tests-mx32/process_vm_writev.c new file mode 100644 index 00000000..6271c01b --- /dev/null +++ b/tests-mx32/process_vm_writev.c @@ -0,0 +1,18 @@ +#include "tests.h" + +#include + +#ifdef __NR_process_vm_writev + +# define OP process_vm_writev +# define OP_NR __NR_process_vm_writev +# define OP_STR "process_vm_writev" +# define OP_WR 1 + +# include "process_vm_readv_writev.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_process_vm_writev"); + +#endif diff --git a/tests-mx32/process_vm_writev.test b/tests-mx32/process_vm_writev.test new file mode 100755 index 00000000..f690e6a9 --- /dev/null +++ b/tests-mx32/process_vm_writev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of process_vm_writev syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a38 diff --git a/tests-mx32/pselect6.c b/tests-mx32/pselect6.c new file mode 100644 index 00000000..f2644853 --- /dev/null +++ b/tests-mx32/pselect6.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Based on test by Dr. David Alan Gilbert + */ + +#include "tests.h" +#include "nsig.h" +#include +#include +#include +#include +#include +#include + +#ifdef __NR_pselect6 + +static fd_set set[3][0x1000000 / sizeof(fd_set)]; + +static void +handler(int signo) +{ +} + +int main(int ac, char **av) +{ + int fds[2]; + struct { + struct timespec ts; + int pad[2]; + } tm_in = { + .ts = { .tv_sec = 0xc0de1, .tv_nsec = 0xc0de2 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, tm = tm_in; + sigset_t mask; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + + sigemptyset(&mask); + sigaddset(&mask, SIGHUP); + sigaddset(&mask, SIGCHLD); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + /* + * Start with a nice simple pselect. + */ + FD_SET(fds[0], set[0]); + FD_SET(fds[1], set[0]); + FD_SET(fds[0], set[1]); + FD_SET(fds[1], set[1]); + FD_SET(1, set[2]); + FD_SET(2, set[2]); + int rc = pselect(fds[1] + 1, set[0], set[1], set[2], NULL, NULL); + if (rc < 0) + perror_msg_and_skip("pselect"); + assert(rc == 1); + printf("pselect6(%d, [%d %d], [%d %d], [1 2], NULL, {NULL, %u}) " + "= 1 (out [%d])\n", + fds[1] + 1, fds[0], fds[1], + fds[0], fds[1], + NSIG_BYTES, fds[1]); + + /* + * Another simple one, with a timeout. + */ + FD_SET(1, set[1]); + FD_SET(2, set[1]); + FD_SET(fds[0], set[1]); + FD_SET(fds[1], set[1]); + assert(syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) == 3); + printf("pselect6(%d, NULL, [1 2 %d %d], NULL, " + "{tv_sec=%lld, tv_nsec=%lld}, NULL) = 3 (out [1 2 %d], left " + "{tv_sec=%lld, tv_nsec=%lld})\n", + fds[1] + 1, fds[0], fds[1], + (long long) tm_in.ts.tv_sec, (long long) tm_in.ts.tv_nsec, + fds[1], + (long long) tm.ts.tv_sec, (long long) tm.ts.tv_nsec); + + /* + * Now the crash case that trinity found, negative nfds + * but with a pointer to a large chunk of valid memory. + */ + FD_ZERO(set[0]); + FD_SET(fds[1],set[0]); + assert(pselect(-1, NULL, set[0], NULL, NULL, &mask) == -1); + printf("pselect6(-1, NULL, %p, NULL, NULL, {[HUP CHLD], %u}) " + "= -1 EINVAL (%m)\n", set[0], NSIG_BYTES); + + /* + * Another variant, with nfds exceeding FD_SETSIZE limit. + */ + FD_ZERO(set[0]); + FD_SET(fds[0],set[0]); + FD_ZERO(set[1]); + tm.ts.tv_sec = 0; + tm.ts.tv_nsec = 123; + assert(pselect(FD_SETSIZE + 1, set[0], set[1], NULL, &tm.ts, &mask) == 0); + printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}, " + "{[HUP CHLD], %u}) = 0 (Timeout)\n", + FD_SETSIZE + 1, fds[0], NSIG_BYTES); + + /* + * See how timeouts are decoded. + */ + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(setitimer(ITIMER_REAL, &itv, NULL) == 0); + + tm.ts.tv_nsec = 222222222; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, &mask) == -1); + printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}, " + "{[HUP CHLD], %u}) = " + "? ERESTARTNOHAND (To be restarted if no handler)\n", + NSIG_BYTES); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pselect6") + +#endif diff --git a/tests-mx32/pselect6.test b/tests-mx32/pselect6.test new file mode 100755 index 00000000..203f8e24 --- /dev/null +++ b/tests-mx32/pselect6.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check pselect6 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/ptrace.c b/tests-mx32/ptrace.c new file mode 100644 index 00000000..80ce8cbb --- /dev/null +++ b/tests-mx32/ptrace.c @@ -0,0 +1,455 @@ +/* + * Check decoding of ptrace syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigprocmask + +# include +# include +# include +# include +# include +# include +# include "ptrace.h" +# include + +static const char *errstr; + +static long +do_ptrace(unsigned long request, unsigned long pid, + unsigned long addr, unsigned long data) +{ + long rc = syscall(__NR_ptrace, request, pid, addr, data); + errstr = sprintrc(rc); + return rc; +} + +static void +test_peeksiginfo(unsigned long pid, const unsigned long bad_request) +{ + do_ptrace(PTRACE_PEEKSIGINFO, pid, 0, bad_request); + printf("ptrace(PTRACE_PEEKSIGINFO, %u, NULL, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + struct { + unsigned long long off; + unsigned int flags, nr; + } *const psi = tail_alloc(sizeof(*psi)); + + psi->off = 0xdeadbeeffacefeedULL; + psi->flags = 1; + psi->nr = 42; + + do_ptrace(PTRACE_PEEKSIGINFO, pid, (unsigned long) psi, bad_request); + printf("ptrace(PTRACE_PEEKSIGINFO, %u, {off=%llu" + ", flags=PTRACE_PEEKSIGINFO_SHARED, nr=%u}, %#lx) = %s\n", + (unsigned) pid, psi->off, psi->nr, bad_request, errstr); + + pid = fork(); + if ((pid_t) pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGALRM); + + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + raise(SIGUSR1); + raise(SIGUSR2); + raise(SIGALRM); + + if (do_ptrace(PTRACE_TRACEME, 0, 0, 0)) + perror_msg_and_fail("child: PTRACE_TRACEME"); + + raise(SIGSTOP); + _exit(0); + } + + const unsigned int nsigs = 4; + const uid_t uid = geteuid(); + siginfo_t *sigs = tail_alloc(sizeof(*sigs) * nsigs); + + psi->off = 0; + psi->flags = 0; + psi->nr = nsigs; + + for (;;) { + int status, tracee, saved; + + errno = 0; + tracee = wait(&status); + if (tracee <= 0) { + if (errno == EINTR) + continue; + saved = errno; + kill (pid, SIGKILL); + errno = saved; + perror_msg_and_fail("wait"); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) + break; + error_msg_and_fail("unexpected exit status %u", + WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) + error_msg_and_fail("unexpected signal %u", + WTERMSIG(status)); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { + kill(pid, SIGKILL); + error_msg_and_fail("unexpected wait status %x", + status); + } + + long rc = do_ptrace(PTRACE_PEEKSIGINFO, pid, + (unsigned long) psi, (unsigned long) sigs); + if (rc < 0) { + printf("ptrace(PTRACE_PEEKSIGINFO, %u" + ", {off=%llu, flags=0, nr=%u}, %p) = %s\n", + (unsigned) pid, psi->off, psi->nr, sigs, + errstr); + } else { + printf("ptrace(PTRACE_PEEKSIGINFO, %u" + ", {off=%llu, flags=0, nr=%u}" + ", [{si_signo=SIGUSR1, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + ", {si_signo=SIGUSR2, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + ", {si_signo=SIGALRM, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + "]) = %s\n", + (unsigned) pid, psi->off, psi->nr, + (unsigned) pid, (unsigned) uid, + (unsigned) pid, (unsigned) uid, + (unsigned) pid, (unsigned) uid, + errstr); + } + + if (do_ptrace(PTRACE_CONT, pid, 0, 0)) { + saved = errno; + kill (pid, SIGKILL); + errno = saved; + perror_msg_and_fail("ptrace"); + } + printf("ptrace(PTRACE_CONT, %ld, NULL, SIG_0) = 0\n", pid); + } +} + +int +main(void) +{ + const unsigned long bad_request = + (unsigned long) 0xdeadbeeffffffeedULL; + const unsigned long bad_data = + (unsigned long) 0xdeadcafefffff00dULL; + const unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + + unsigned int sigset_size; + + for (sigset_size = 1024 / 8; sigset_size; sigset_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, + SIG_SETMASK, NULL, NULL, sigset_size)) + break; + } + if (!sigset_size) + perror_msg_and_fail("rt_sigprocmask"); + + void *const k_set = tail_alloc(sigset_size); + siginfo_t *const sip = tail_alloc(sizeof(*sip)); + + do_ptrace(bad_request, pid, 0, 0); + printf("ptrace(%#lx /* PTRACE_??? */, %u, NULL, NULL) = %s\n", + bad_request, (unsigned) pid, errstr); + + do_ptrace(PTRACE_PEEKDATA, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKDATA, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKDATA, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_PEEKTEXT, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_PEEKUSER, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKUSER, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKUSER, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_POKEUSER, pid, bad_request, bad_data); + printf("ptrace(PTRACE_POKEUSER, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); + + do_ptrace(PTRACE_ATTACH, pid, 0, 0); + printf("ptrace(PTRACE_ATTACH, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_INTERRUPT, pid, 0, 0); + printf("ptrace(PTRACE_INTERRUPT, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_KILL, pid, 0, 0); + printf("ptrace(PTRACE_KILL, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_LISTEN, pid, 0, 0); + printf("ptrace(PTRACE_LISTEN, %u) = %s\n", (unsigned) pid, errstr); + + sigset_t libc_set; + sigemptyset(&libc_set); + sigaddset(&libc_set, SIGUSR1); + memcpy(k_set, &libc_set, sigset_size); + + do_ptrace(PTRACE_SETSIGMASK, pid, sigset_size, (unsigned long) k_set); + printf("ptrace(PTRACE_SETSIGMASK, %u, %u, [USR1]) = %s\n", + (unsigned) pid, sigset_size, errstr); + + do_ptrace(PTRACE_GETSIGMASK, pid, sigset_size, (unsigned long) k_set); + printf("ptrace(PTRACE_GETSIGMASK, %u, %u, %p) = %s\n", + (unsigned) pid, sigset_size, k_set, errstr); + + do_ptrace(PTRACE_SECCOMP_GET_FILTER, pid, 42, 0); + printf("ptrace(PTRACE_SECCOMP_GET_FILTER, %u, 42, NULL) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_GETEVENTMSG, pid, bad_request, bad_data); + printf("ptrace(PTRACE_GETEVENTMSG, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGIO; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_band = -2; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGIO" + ", si_code=POLL_IN, si_errno=ENOENT, si_band=-2}) = %s\n", + (unsigned) pid, bad_request, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGTRAP; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_pid = 2; + sip->si_uid = 3; + sip->si_ptr = (void *) bad_request; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGTRAP" + ", si_code=TRAP_BRKPT, si_errno=ENOENT, si_pid=2, si_uid=3" + ", si_value={int=%d, ptr=%p}}) = %s\n", + (unsigned) pid, bad_request, sip->si_int, sip->si_ptr, + errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGILL; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGILL" + ", si_code=ILL_ILLOPC, si_errno=ENOENT, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_addr, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGFPE; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGFPE" + ", si_code=FPE_INTDIV, si_errno=ENOENT, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_addr, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGBUS; + sip->si_code = 1; + sip->si_errno = -2; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGBUS" + ", si_code=BUS_ADRALN, si_errno=%d, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_errno, sip->si_addr, + errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGPROF; + sip->si_code = 0xbadc0ded; + sip->si_errno = -2; + sip->si_pid = 0; + sip->si_uid = 3; + sip->si_ptr = 0; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGPROF" + ", si_code=%#x, si_errno=%d, si_pid=0, si_uid=3}) = %s\n", + (unsigned) pid, bad_request, sip->si_code, sip->si_errno, + errstr); + +#ifdef HAVE_SIGINFO_T_SI_SYSCALL + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGSYS; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_call_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + sip->si_syscall = -1U; + sip->si_arch = AUDIT_ARCH_X86_64; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGSYS" + ", si_code=SYS_SECCOMP, si_errno=ENOENT, si_call_addr=%p" + ", si_syscall=%u, si_arch=AUDIT_ARCH_X86_64})" + " = %s\n", + (unsigned) pid, bad_request, sip->si_call_addr, sip->si_syscall, + errstr); + + sip->si_errno = 3141592653U; + sip->si_call_addr = NULL; + sip->si_syscall = __NR_read; + sip->si_arch = 0xda7a1057; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGSYS" + ", si_code=SYS_SECCOMP, si_errno=%d, si_call_addr=NULL" + ", si_syscall=__NR_read, si_arch=%#x /* AUDIT_ARCH_??? */})" + " = %s\n", + (unsigned) pid, bad_request, sip->si_errno, sip->si_arch, + errstr); +#endif + +#if defined HAVE_SIGINFO_T_SI_TIMERID && defined HAVE_SIGINFO_T_SI_OVERRUN + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGHUP; + sip->si_code = SI_TIMER; + sip->si_errno = ENOENT; + sip->si_timerid = 0xdeadbeef; + sip->si_overrun = -1; + sip->si_ptr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGHUP" + ", si_code=SI_TIMER, si_errno=ENOENT, si_timerid=%#x" + ", si_overrun=%d, si_value={int=%d, ptr=%p}}) = %s\n", + (unsigned) pid, bad_request, sip->si_timerid, sip->si_overrun, + sip->si_int, sip->si_ptr, errstr); +#endif + + do_ptrace(PTRACE_GETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_GETSIGINFO, %u, %#lx, %p)" + " = %s\n", (unsigned) pid, bad_request, sip, errstr); + + do_ptrace(PTRACE_CONT, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_CONT, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_DETACH, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_DETACH, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_SYSCALL, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SYSCALL, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); + +#ifdef PTRACE_SINGLESTEP + do_ptrace(PTRACE_SINGLESTEP, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_SINGLESTEP, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); +#endif + +#ifdef PTRACE_SINGLEBLOCK + do_ptrace(PTRACE_SINGLEBLOCK, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SINGLEBLOCK, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); +#endif + +#ifdef PTRACE_SYSEMU + do_ptrace(PTRACE_SYSEMU, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_SYSEMU, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); +#endif +#ifdef PTRACE_SYSEMU_SINGLESTEP + do_ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SYSEMU_SINGLESTEP, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); +#endif + + do_ptrace(PTRACE_SETOPTIONS, + pid, 0, PTRACE_O_TRACEFORK|PTRACE_O_TRACECLONE); + printf("ptrace(PTRACE_SETOPTIONS, %u, NULL" + ", PTRACE_O_TRACEFORK|PTRACE_O_TRACECLONE) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_SEIZE, pid, bad_request, PTRACE_O_TRACESYSGOOD); + printf("ptrace(PTRACE_SEIZE, %u, %#lx, PTRACE_O_TRACESYSGOOD) = %s\n", + (unsigned) pid, bad_request, errstr); + + do_ptrace(PTRACE_SETREGSET, pid, 1, bad_request); + printf("ptrace(PTRACE_SETREGSET, %u, NT_PRSTATUS, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + do_ptrace(PTRACE_GETREGSET, pid, 3, bad_request); + printf("ptrace(PTRACE_GETREGSET, %u, NT_PRPSINFO, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + test_peeksiginfo(pid, bad_request); + + do_ptrace(PTRACE_TRACEME, 0, 0, 0); + printf("ptrace(PTRACE_TRACEME) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") + +#endif diff --git a/tests-mx32/ptrace.test b/tests-mx32/ptrace.test new file mode 100755 index 00000000..5add9be4 --- /dev/null +++ b/tests-mx32/ptrace.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ptrace syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e signal=none diff --git a/tests-mx32/pwritev.c b/tests-mx32/pwritev.c new file mode 100644 index 00000000..58e5b41e --- /dev/null +++ b/tests-mx32/pwritev.c @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PWRITEV + +# include +# include +# include +# include + +# define LEN 8 +# define LIM (LEN - 1) + +static void +print_iov(const struct iovec *iov) +{ + unsigned int i; + unsigned char *buf = iov->iov_base; + + fputs("{iov_base=\"", stdout); + for (i = 0; i < iov->iov_len; ++i) { + if (i < LIM) + printf("\\%d", (int) buf[i]); + } + printf("\"%s, iov_len=%u}", + i > LIM ? "..." : "", (unsigned) iov->iov_len); +} + +static void +print_iovec(const struct iovec *iov, unsigned int cnt, unsigned int size) +{ + if (!size) { + printf("%p", iov); + return; + } + unsigned int i; + putchar('['); + for (i = 0; i < cnt; ++i) { + if (i) + fputs(", ", stdout); + if (i == size) { + printf("%p", &iov[i]); + break; + } + if (i == LIM) { + fputs("...", stdout); + break; + } + print_iov(&iov[i]); + } + putchar(']'); +} + +int +main(void) +{ + (void) close(0); + if (open("/dev/null", O_WRONLY)) + perror_msg_and_fail("open"); + + char *buf = tail_alloc(LEN); + unsigned i; + for (i = 0; i < LEN; ++i) + buf[i] = i; + + struct iovec *iov = tail_alloc(sizeof(*iov) * LEN); + for (i = 0; i < LEN; ++i) { + buf[i] = i; + iov[i].iov_base = &buf[i]; + iov[i].iov_len = LEN - i; + } + + const off_t offset = 0xdefaceddeadbeefLL; + long rc; + int written = 0; + for (i = 0; i < LEN; ++i) { + written += iov[i].iov_len; + if (pwritev(0, iov, i + 1, offset + i) != written) + perror_msg_and_fail("pwritev"); + fputs("pwritev(0, ", stdout); + print_iovec(iov, i + 1, LEN); + printf(", %u, %lld) = %d\n", + i + 1, (long long) offset + i, written); + } + + for (i = 0; i <= LEN; ++i) { + unsigned int n = LEN + 1 - i; + fputs("pwritev(0, ", stdout); + print_iovec(iov + i, n, LEN - i); + rc = pwritev(0, iov + i, n, offset + LEN + i); + printf(", %u, %lld) = %ld %s (%m)\n", + n, (long long) offset + LEN + i, rc, errno2name()); + } + + iov->iov_base = iov + LEN * 2; + rc = pwritev(0, iov, 1, -1); + printf("pwritev(0, [{iov_base=%p, iov_len=%d}], 1, -1) = %ld %s (%m)\n", + iov->iov_base, LEN, rc, errno2name()); + + iov += LEN; + rc = pwritev(0, iov, 42, -2); + printf("pwritev(0, %p, 42, -2) = %ld %s (%m)\n", + iov, rc, errno2name()); + + rc = pwritev(0, NULL, 1, -3); + printf("pwritev(0, NULL, 1, -3) = %ld %s (%m)\n", + rc, errno2name()); + + rc = pwritev(0, iov, 0, -4); + printf("pwritev(0, [], 0, -4) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PWRITEV") + +#endif diff --git a/tests-mx32/pwritev.test b/tests-mx32/pwritev.test new file mode 100755 index 00000000..0aed6835 --- /dev/null +++ b/tests-mx32/pwritev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check pwritev syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s7 diff --git a/tests-mx32/qual_fault-exit_group.expected b/tests-mx32/qual_fault-exit_group.expected new file mode 100644 index 00000000..dd9d4e46 --- /dev/null +++ b/tests-mx32/qual_fault-exit_group.expected @@ -0,0 +1,3 @@ +exit_group(42) = -1 ENOSYS (Function not implemented) (INJECTED) +exit(42) = ? ++++ exited with 42 +++ diff --git a/tests-mx32/qual_fault-exit_group.test b/tests-mx32/qual_fault-exit_group.test new file mode 100755 index 00000000..c98ffc6e --- /dev/null +++ b/tests-mx32/qual_fault-exit_group.test @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Check decoding of fault injected exit_group syscall. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/scno_tampering.sh" + +test_with() +{ + > "$LOG" || fail_ "failed to write $LOG" + + $STRACE -o "$LOG" "$@" + rc=$? + [ $rc -eq 42 ] || + dump_log_and_fail_with "$STRACE $* failed with code $rc" + + match_diff +} + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ./answer + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ + -efault=\!process:error=1 ./answer + +test_with -eexit,exit_group -efault=all:error=ENOSYS \ + -efault=exit:error=1:when=2+ ./answer + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ + -efault=\!desc,file,memory,process,signal,network,ipc:error=1 ./answer diff --git a/tests-mx32/qual_fault-syntax.test b/tests-mx32/qual_fault-syntax.test new file mode 100755 index 00000000..85093fc7 --- /dev/null +++ b/tests-mx32/qual_fault-syntax.test @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Check -e fault= syntax. +# +# Copyright (c) 2016=2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# +# F +# F+ +# F+S + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e fault=$* failed to handle an argument error properly" +} + +for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ + invalid_syscall_name \ + invalid_syscall_name:when=3 \ + -1 \!-1 \ + -1:when=4 \ + -2 \ + -2:when=5 \ + 32767 \!32767 \ + 32767:when=6 \ + chdir:42 \!chdir:42 \ + chdir:42:when=7 \ + chdir:invalid \ + chdir:invalid:when=8 \ + chdir:error= \ + chdir:error=:when=10 \ + chdir:error=invalid_error_name \ + chdir:error=invalid_error_name:when=11 \ + chdir:error=-1 \ + chdir:error=-1:when=12 \ + chdir:error=-2 \ + chdir:error=-2:when=13 \ + chdir:error=3+ \ + chdir:error=3+:when=14 \ + chdir:error=4096 \ + chdir:error=4096:when=15 \ + chdir:when=7:error=invalid_error_name \ + chdir:when= \ + chdir:when=:error=19 \ + chdir:when=0 \ + chdir:when=0:error=20 \ + chdir:when=-1 \ + chdir:when=-1:error=21 \ + chdir:when=-2+ \ + chdir:when=-2+:error=22 \ + chdir:when=-3+0 \ + chdir:when=-3+0:error=23 \ + chdir:when=4- \ + chdir:when=4-:error=24 \ + chdir:when=5+- \ + chdir:when=5+-:error=25 \ + chdir:when=6++ \ + chdir:when=6++:error=26 \ + chdir:when=7+0 \ + chdir:when=7+0:error=27 \ + chdir:when=8+-1 \ + chdir:when=8+-1:error=28 \ + chdir:when=9+1+ \ + chdir:when=9+1+:error=29 \ + chdir:when=65536 \ + chdir:when=65536:error=30 \ + chdir:when=1+65536 \ + chdir:when=1+65536:error=31 \ + file,nonsense \ + \!desc,nonsense \ + chdir,nonsense \ + \!chdir,nonsense \ + 1,nonsense \ + \!1,nonsense \ + chdir:retval=0 \ + chdir:signal=1 \ + chdir:error=1:error=2 \ + ; do + $STRACE -e fault="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid fault argument' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests-mx32/qual_fault.c b/tests-mx32/qual_fault.c new file mode 100644 index 00000000..d26dc7ce --- /dev/null +++ b/tests-mx32/qual_fault.c @@ -0,0 +1,148 @@ +/* + * Check that fault injection works properly. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static const int expfd = 4; +static const int gotfd = 5; + +#define DEFAULT_ERRNO ENOSYS + +static const char *errstr; +static int is_raw, err, first, step, iter, try; + +static void +invoke(int fail) +{ + static char buf[sizeof(int) * 3 + 3]; + const struct iovec io = { + .iov_base = buf, + .iov_len = sprintf(buf, "%d.", ++try) + }; + int rc; + + if (!fail) { + rc = write(expfd, io.iov_base, io.iov_len); + if (rc != (int) io.iov_len) + perror_msg_and_fail("write"); + } + + errno = 0; + rc = writev(gotfd, &io, 1); + + if (fail) { + if (!(rc == -1 && errno == err)) + perror_msg_and_fail("expected errno %d" + ", got rc == %d, errno == %d", + err, rc, errno); + + if (is_raw) + tprintf("writev(%#x, %p, 0x1) = -1 (errno %d)" + " (INJECTED)\n", gotfd, &io, err); + else + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" + " = -1 %s (%m) (INJECTED)\n", + gotfd, buf, (int) io.iov_len, errstr); + } else { + if (rc != (int) io.iov_len) + perror_msg_and_fail("expected %d" + ", got rc == %d, errno == %d", + (int) io.iov_len, rc, errno); + + if (is_raw) + tprintf("writev(%#x, %p, 0x1) = %#x\n", gotfd, &io, rc); + else + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" + " = %d\n", + gotfd, buf, (int) io.iov_len, (int) io.iov_len); + } +} + +int +main(int argc, char *argv[]) +{ + struct stat st; + + assert(fstat(expfd, &st) == 0); + assert(fstat(gotfd, &st) == 0); + + assert(argc == 6); + + is_raw = !strcmp("raw", argv[1]); + + errstr = argv[2]; + err = atoi(errstr); + assert(err >= 0); + + if (!err) { + if (!*errstr) + err = DEFAULT_ERRNO; + else if (!strcasecmp(errstr, "EINVAL")) + err = EINVAL; + else + err = ENOSYS; + } + + errno = err; + errstr = errno2name(); + + first = atoi(argv[3]); + step = atoi(argv[4]); + iter = atoi(argv[5]); + + assert(first > 0); + assert(step >= 0); + + tprintf("%s", ""); + + int i; + for (i = 1; i <= iter; ++i) { + int fail = 0; + if (first > 0) { + --first; + if (first == 0) { + fail = 1; + first = step; + } + } + invoke(fail); + } + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/qual_fault.test b/tests-mx32/qual_fault.test new file mode 100755 index 00000000..e194a787 --- /dev/null +++ b/tests-mx32/qual_fault.test @@ -0,0 +1,104 @@ +#!/bin/sh +# +# Check that fault injection works properly. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/scno_tampering.sh" + +# +# F +# F+ +# F+S + +N=16 + +check_fault_injection() +{ + local trace fault err first step extra + trace=$1; shift + fault=$1; shift + err=$1; shift + first=$1; shift + step=$1; shift + extra="$*" + + local when= + if [ -z "$first$step" ]; then + first=1 + step=1 + else + case "$step" in + '') when=":when=$first"; step=0 ;; + +) when=":when=$first+"; step=1 ;; + *) when=":when=$first+$step" ;; + esac + fi + + local error= + local raw=reg + set -- + case "$err" in + '') ;; + [123456789]*) + error=":error=$err" + raw=raw + set -- -e raw=all + ;; + *) error=":error=$err" ;; + esac + + outexp="$NAME.out.exp" + outgot="$NAME.out.got" + + run_strace -a11 -e trace=$trace \ + "$@" -e fault=$fault$when$error $extra \ + ./$NAME $raw "$err" "$first" "$step" $N \ + > "$EXP" 4> "$outexp" 5> "$outgot" + + match_diff "$EXP" "$LOG" + match_diff "$outexp" "$outgot" + rm -f "$EXP" "$outexp" "$outgot" +} + +for err in '' ENOSYS 22 einval; do + for fault in writev desc,51; do + check_fault_injection \ + writev $fault "$err" '' '' -efault=chdir + check_fault_injection \ + writev $fault "$err" '' '' -efault=chdir -efault=none + for F in 1 2 3 5 7 11; do + check_fault_injection \ + writev $fault "$err" $F '' + check_fault_injection \ + writev $fault "$err" $F + + for S in 1 2 3 5 7 11; do + check_fault_injection \ + writev $fault "$err" $F $S + done + done + done +done diff --git a/tests-mx32/qual_inject-error-signal.c b/tests-mx32/qual_inject-error-signal.c new file mode 100644 index 00000000..f4ccd824 --- /dev/null +++ b/tests-mx32/qual_inject-error-signal.c @@ -0,0 +1,69 @@ +/* + * Check fault injection along with signal injection. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +static struct stat before, after; + +static void +handler(int sig) +{ + if (stat(".", &after)) + syscall(__NR_exit_group, 2); + + if (before.st_dev != after.st_dev || before.st_ino != after.st_ino) + syscall(__NR_exit_group, 3); + + syscall(__NR_exit_group, 0); +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + if (stat(".", &before)) + perror_msg_and_fail("stat"); + + syscall(__NR_chdir, "."); + syscall(__NR_exit_group, 1); + return 1; +} diff --git a/tests-mx32/qual_inject-error-signal.expected b/tests-mx32/qual_inject-error-signal.expected new file mode 100644 index 00000000..24389b37 --- /dev/null +++ b/tests-mx32/qual_inject-error-signal.expected @@ -0,0 +1,4 @@ +chdir(".") = -1 ENOENT (No such file or directory) (INJECTED) +--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_KERNEL} --- +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests-mx32/qual_inject-error-signal.test b/tests-mx32/qual_inject-error-signal.test new file mode 100755 index 00000000..fcbcc398 --- /dev/null +++ b/tests-mx32/qual_inject-error-signal.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check fault injection along with signal injection. +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a12 -echdir,exit_group -einject=chdir:error=ENOENT:signal=USR1 \ + "./$NAME" +match_diff diff --git a/tests-mx32/qual_inject-retval.c b/tests-mx32/qual_inject-retval.c new file mode 100644 index 00000000..ac9801eb --- /dev/null +++ b/tests-mx32/qual_inject-retval.c @@ -0,0 +1,73 @@ +/* + * Check success injection. + * + * Copyright (c) 2017 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_chdir + +# include +# include +# include +# include +# include + +int +main(int argc, char *argv[]) +{ + assert(argc == 2); + + static const char dir[] = ".."; + struct stat before, after; + + if (stat(".", &before)) + perror_msg_and_fail("stat"); + + long rval = syscall(__NR_chdir, dir); + + if (stat(".", &after)) + perror_msg_and_fail("stat"); + + if (before.st_dev != after.st_dev || before.st_ino != after.st_ino) + error_msg_and_fail("syscall succeeded"); + if (atol(argv[1]) != rval) + error_msg_and_fail("expected retval %s, got retval %ld", + argv[1], rval); + + printf("chdir(\"%s\") = %ld (INJECTED)\n", dir, rval); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chdir") + +#endif diff --git a/tests-mx32/qual_inject-retval.test b/tests-mx32/qual_inject-retval.test new file mode 100755 index 00000000..419030ad --- /dev/null +++ b/tests-mx32/qual_inject-retval.test @@ -0,0 +1,21 @@ +#!/bin/sh + +# Check success injection. + +. "${srcdir=.}/scno_tampering.sh" + +check_injection() +{ + local syscall rval + + syscall=chdir + rval="$1"; shift + + run_strace -a12 -e$syscall -einject="$syscall:retval=$rval" "$@" \ + ./qual_inject-retval "$rval" > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +check_injection 0 +check_injection 42 diff --git a/tests-mx32/qual_inject-signal.c b/tests-mx32/qual_inject-signal.c new file mode 100644 index 00000000..ff56a286 --- /dev/null +++ b/tests-mx32/qual_inject-signal.c @@ -0,0 +1,57 @@ +/* + * Check that signal injection works properly. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +static void +handler(int sig) +{ + syscall(__NR_exit_group, 0); +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + syscall(__NR_chdir, "."); + syscall(__NR_exit_group, 1); + return 1; +} diff --git a/tests-mx32/qual_inject-signal.expected b/tests-mx32/qual_inject-signal.expected new file mode 100644 index 00000000..69a1d979 --- /dev/null +++ b/tests-mx32/qual_inject-signal.expected @@ -0,0 +1,4 @@ +chdir(".") = 0 +--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_KERNEL} --- +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests-mx32/qual_inject-signal.test b/tests-mx32/qual_inject-signal.test new file mode 100755 index 00000000..88002ce9 --- /dev/null +++ b/tests-mx32/qual_inject-signal.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check signal injection. +. "${srcdir=.}/init.sh" + +run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1 \ + ./$NAME +match_diff diff --git a/tests-mx32/qual_inject-syntax.test b/tests-mx32/qual_inject-syntax.test new file mode 100755 index 00000000..a9e44d74 --- /dev/null +++ b/tests-mx32/qual_inject-syntax.test @@ -0,0 +1,118 @@ +#!/bin/sh +# +# Check -e inject= syntax. +# +# Copyright (c) 2016-2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# +# F +# F+ +# F+S + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e inject=$* failed to handle an argument error properly" +} + +for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ + invalid_syscall_name \ + invalid_syscall_name:when=3 \ + -1 \!-1 \ + -1:when=4 \ + -2 \ + -2:when=5 \ + 32767 \!32767 \ + 32767:when=6 \ + 42 \ + chdir \ + chdir:42 \!chdir:42 \ + chdir:42:when=7 \ + chdir:invalid \ + chdir:invalid:when=8 \ + chdir:error= \ + chdir:error=:when=10 \ + chdir:error=invalid_error_name \ + chdir:error=invalid_error_name:when=11 \ + chdir:error=-1 \ + chdir:error=-1:when=12 \ + chdir:error=-2 \ + chdir:error=-2:when=13 \ + chdir:error=3+ \ + chdir:error=3+:when=14 \ + chdir:error=4096 \ + chdir:error=4096:when=15 \ + chdir:when=7:error=invalid_error_name \ + chdir:when= \ + chdir:when=:error=19 \ + chdir:when=0 \ + chdir:when=0:error=20 \ + chdir:when=-1 \ + chdir:when=-1:error=21 \ + chdir:when=-2+ \ + chdir:when=-2+:error=22 \ + chdir:when=-3+0 \ + chdir:when=-3+0:error=23 \ + chdir:when=4- \ + chdir:when=4-:error=24 \ + chdir:when=5+- \ + chdir:when=5+-:error=25 \ + chdir:when=6++ \ + chdir:when=6++:error=26 \ + chdir:when=7+0 \ + chdir:when=7+0:error=27 \ + chdir:when=8+-1 \ + chdir:when=8+-1:error=28 \ + chdir:when=9+1+ \ + chdir:when=9+1+:error=29 \ + chdir:when=65536 \ + chdir:when=65536:error=30 \ + chdir:when=1+65536 \ + chdir:when=1+65536:error=31 \ + file,nonsense \ + \!desc,nonsense \ + chdir,nonsense \ + \!chdir,nonsense \ + 1,nonsense \ + \!1,nonsense \ + chdir:retval=-1 \ + chdir:signal=0 \ + chdir:signal=129 \ + chdir:retval=0:retval=1 \ + chdir:error=1:error=2 \ + chdir:retval=0:error=1 \ + chdir:error=1:retval=0 \ + chdir:retval=0:signal=1:error=1 \ + ; do + $STRACE -e inject="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid inject argument' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests-mx32/qual_signal.c b/tests-mx32/qual_signal.c new file mode 100644 index 00000000..106dabea --- /dev/null +++ b/tests-mx32/qual_signal.c @@ -0,0 +1,82 @@ +/* + * Check how strace -e signal=set works. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static pid_t pid; +static uid_t uid; + +static void +handler(int sig) +{ +} + +static void +test_sig(int signo, const char *name) +{ + const struct sigaction act = { .sa_handler = handler }; + + if (sigaction(signo, &act, NULL)) + perror_msg_and_fail("sigaction: %d", signo); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, signo); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask: %d", signo); + + if (kill(pid, signo)) + perror_msg_and_fail("kill(%d, %d)", pid, signo); + + if (name && *name) + printf("--- %s {si_signo=%s, si_code=SI_USER" + ", si_pid=%d, si_uid=%d} ---\n", + name, name, pid, uid); +} + +int +main(int ac, const char **av) +{ + assert(ac & 1); + + pid = getpid(); + uid = geteuid(); + + int i; + for (i = 1; i < ac; i += 2) + test_sig(atoi(av[i]), av[i + 1]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/qual_signal.test b/tests-mx32/qual_signal.test new file mode 100755 index 00000000..54a37a30 --- /dev/null +++ b/tests-mx32/qual_signal.test @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Check how strace -e signal=set works. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +test_one_sig() +{ + local sigs + sigs="$1"; shift + + run_prog "./$NAME" "$@" > /dev/null + run_strace -e trace=none -e signal="$sigs" "./$NAME" "$@" > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +test_sigs() +{ + local first second sigs + first="$1"; shift + second="$1"; shift + + for sigs; do + test_one_sig "$sigs" 2 "$first" 15 "$second" + done +} + +test_sigs '' '' \ + none '!all' \ + CHLD SIGCHLD ALRM SIGALRM \ + chld sigchld alrm sigalrm \ + CHLD,SIGALRM ALRM,SIGCHLD \ + chld,sigalrm alrm,sigchld \ + 9 9,4 9,4,11 \ + 4,CHLD,11,ALRM,9 \ + '!2,15' '!INT,TERM' '!SIGINT,TERM' '!INT,SIGTERM' '!SIGTERM,SIGINT' \ + '!2,INT,TERM' '!2,SIGTERM' '!SIGINT,15' '!INT,SIGTERM,15' \ + '!2,4,15' '!15,9,2,11,4' + +test_sigs SIGINT '' \ + 2 INT SIGINT \ + CHLD,SIGINT SIGINT,SIGALRM \ + chld,sigint sigint,sigalrm \ + ALRM,2,SIGCHLD \ + '!15' '!TERM' '!SIGTERM' \ + '!15,TERM' '!SIGTERM,15,TERM' \ + '!SIGALRM,TERM' '!CHLD,SIGTERM' \ + '!ALRM,15' '!SIGCHLD,ALRM,SIGTERM,KILL' \ + '!4,15' '!15,9,11,4' + +test_sigs '' SIGTERM \ + 15 TERM SIGTERM \ + CHLD,SIGTERM SIGTERM,SIGALRM \ + chld,sigterm sigterm,sigalrm \ + ALRM,15,SIGCHLD \ + '!2' '!INT' '!SIGINT' \ + '!2,INT' '!SIGINT,2,INT' \ + '!SIGALRM,INT' '!CHLD,SIGINT' \ + '!ALRM,2' '!SIGCHLD,ALRM,SIGINT,KILL' \ + '!4,2' '!2,9,11,4' + +test_sigs SIGINT SIGTERM \ + all '!none' \ + INT,TERM SIGINT,TERM SIGTERM,INT SIGINT,SIGTERM \ + int,term sigint,term sigterm,int sigint,sigterm \ + 2,15 2,TERM SIGTERM,2 TERM,15,SIGINT,2 \ + '!CHLD' '!SIGCHLD' '!ALRM' '!SIGALRM' \ + '!CHLD,SIGALRM' '!ALRM,SIGCHLD' \ + '!9' '!9,4' '!9,4,11' '!4,CHLD,11,ALRM,9' + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e signal=$* failed to handle an argument error properly" +} + +for arg in ' ' invalid_signal_name SIG -1 256 1-1 \ + 1,2,4,8,16,32,64,128,256,512,1024 9,chdir; do + $STRACE -e signal="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid signal' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests-mx32/qual_syscall.test b/tests-mx32/qual_syscall.test new file mode 100755 index 00000000..f7eb06d5 --- /dev/null +++ b/tests-mx32/qual_syscall.test @@ -0,0 +1,59 @@ +#!/bin/sh + +# Check how strace -e abbrev=set, -e raw=set, -e trace=set, +# and -e verbose=set work. + +. "${srcdir=.}/init.sh" + +run_prog ./umovestr +pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0' +pattern_nonabbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' +pattern_nonverbose='execve("\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' +pattern_raw='execve(0x[[:xdigit:]]*, 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' + +check_output_mismatch() +{ + local pattern + pattern="$1"; shift + run_strace "$@" ./umovestr + LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || { + printf '%s\n%s\n' \ + 'Failed patterns of expected output:' "$pattern" + dump_log_and_fail_with "$STRACE $args output mismatch" + } +} + +check_output_mismatch "$pattern_abbrev_verbose" -e execve +LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | +LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +LC_ALL=C grep '^chdir' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +run_strace -e 42 ./umovestr +LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +for a in execve \!chdir all \!none \ + file process \!desc \!ipc \!memory \!network \!signal; do + check_output_mismatch \ + "$pattern_abbrev_verbose" -e abbrev="$a" -e execve + check_output_mismatch \ + "$pattern_raw" -a22 -e raw="$a" -e execve + check_output_mismatch \ + "$pattern_abbrev_verbose" -e verbose="$a" -e execve +done + +for a in \!execve chdir 42 \!all none \ + \!file \!process desc ipc memory network signal; do + check_output_mismatch \ + "$pattern_nonabbrev_verbose" -e abbrev="$a" -e execve + check_output_mismatch \ + "$pattern_abbrev_verbose" -e raw="$a" -e execve + check_output_mismatch \ + "$pattern_nonverbose" -a31 -e verbose="$a" -e execve +done + +exit 0 diff --git a/tests-mx32/quotactl-v.c b/tests-mx32/quotactl-v.c new file mode 100644 index 00000000..00139649 --- /dev/null +++ b/tests-mx32/quotactl-v.c @@ -0,0 +1,3 @@ +/* This file is part of quotactl-v strace test. */ +#define VERBOSE 1 +#include "quotactl.c" diff --git a/tests-mx32/quotactl-v.test b/tests-mx32/quotactl-v.test new file mode 100755 index 00000000..6adaf82c --- /dev/null +++ b/tests-mx32/quotactl-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check non-abbreviated decoding of quotactl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-mx32/quotactl-xfs-v.c b/tests-mx32/quotactl-xfs-v.c new file mode 100644 index 00000000..21173d63 --- /dev/null +++ b/tests-mx32/quotactl-xfs-v.c @@ -0,0 +1,3 @@ +/* This file is part of quotactl-xfs-v strace test. */ +#define VERBOSE 1 +#include "quotactl-xfs.c" diff --git a/tests-mx32/quotactl-xfs-v.test b/tests-mx32/quotactl-xfs-v.test new file mode 100755 index 00000000..d5ffc7d6 --- /dev/null +++ b/tests-mx32/quotactl-xfs-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check non-abbreviated decoding of quotactl xfs subcommands. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-mx32/quotactl-xfs.c b/tests-mx32/quotactl-xfs.c new file mode 100644 index 00000000..e420d1c9 --- /dev/null +++ b/tests-mx32/quotactl-xfs.c @@ -0,0 +1,354 @@ +/* + * Check decoding of quotactl xfs subcommands. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_quotactl) && \ + (defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_SYS_QUOTA_H)) && \ + defined(HAVE_LINUX_DQBLK_XFS_H) + +# include +# include +# include + +# include + +# include "quotactl.h" + +# ifndef Q_GETNEXTQUOTA +# define Q_XGETNEXTQUOTA XQM_CMD(0x9) +# endif /* !Q_GETNEXTQUOTA */ + +# ifndef Q_XGETQSTATV + +# define Q_XGETQSTATV XQM_CMD(8) +# define FS_QSTATV_VERSION1 1 + +struct fs_qfilestatv { + uint64_t qfs_ino; /* inode number */ + uint64_t qfs_nblks; /* number of BBs 512-byte-blks */ + uint32_t qfs_nextents; /* number of extents */ + uint32_t qfs_pad; /* pad for 8-byte alignment */ +}; + +struct fs_quota_statv { + int8_t qs_version; /* version for future changes */ + uint8_t qs_pad1; /* pad for 16bit alignment */ + uint16_t qs_flags; /* XFS_QUOTA_.* flags */ + uint32_t qs_incoredqs; /* number of dquots incore */ + struct fs_qfilestatv qs_uquota; /* user quota information */ + struct fs_qfilestatv qs_gquota; /* group quota information */ + struct fs_qfilestatv qs_pquota; /* project quota information */ + int32_t qs_btimelimit; /* limit for blks timer */ + int32_t qs_itimelimit; /* limit for inodes timer */ + int32_t qs_rtbtimelimit; /* limit for rt blks timer */ + uint16_t qs_bwarnlimit; /* limit for num warnings */ + uint16_t qs_iwarnlimit; /* limit for num warnings */ + uint64_t qs_pad2[8]; /* for future proofing */ +}; + +# endif /* !Q_XGETQSTATV */ + +# include "xlat.h" +# include "xlat/xfs_dqblk_flags.h" +# if VERBOSE +# include "xlat/xfs_quota_flags.h" +# endif + + +void +print_xdisk_quota(int rc, void *ptr, void *arg) +{ + struct fs_disk_quota *dq = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", dq); + return; + } + + PRINT_FIELD_D("{", dq, d_version); + printf(", d_flags="); + printflags(xfs_dqblk_flags, (uint8_t) dq->d_flags, "XFS_???_QUOTA"); + + PRINT_FIELD_X(", ", dq, d_fieldmask); + PRINT_FIELD_U(", ", dq, d_id); + PRINT_FIELD_U(", ", dq, d_blk_hardlimit); + PRINT_FIELD_U(", ", dq, d_blk_softlimit); + PRINT_FIELD_U(", ", dq, d_ino_hardlimit); + PRINT_FIELD_U(", ", dq, d_ino_softlimit); + PRINT_FIELD_U(", ", dq, d_bcount); + PRINT_FIELD_U(", ", dq, d_icount); + +# if VERBOSE + PRINT_FIELD_D(", ", dq, d_itimer); + PRINT_FIELD_D(", ", dq, d_btimer); + PRINT_FIELD_U(", ", dq, d_iwarns); + PRINT_FIELD_U(", ", dq, d_bwarns); + PRINT_FIELD_U(", ", dq, d_rtb_hardlimit); + PRINT_FIELD_U(", ", dq, d_rtb_softlimit); + PRINT_FIELD_U(", ", dq, d_rtbcount); + PRINT_FIELD_D(", ", dq, d_rtbtimer); + PRINT_FIELD_U(", ", dq, d_rtbwarns); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_xquota_stat(int rc, void *ptr, void *arg) +{ + struct fs_quota_stat *qs = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", qs); + return; + } + + PRINT_FIELD_D("{", qs, qs_version); + +# if VERBOSE + printf(", qs_flags="); + printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, ", qs, qs_incoredqs); + PRINT_FIELD_D(", ", qs, qs_btimelimit); + PRINT_FIELD_D(", ", qs, qs_itimelimit); + PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", qs, qs_iwarnlimit); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_xquota_statv(int rc, void *ptr, void *arg) +{ + struct fs_quota_statv *qs = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", qs); + return; + } + + PRINT_FIELD_D("{", qs, qs_version); + +# if VERBOSE + printf(", qs_flags="); + printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", ", qs, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, qs_pquota={", &qs->qs_pquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nextents); + PRINT_FIELD_D("}, ", qs, qs_btimelimit); + PRINT_FIELD_D(", ", qs, qs_itimelimit); + PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", qs, qs_iwarnlimit); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +int +main(void) +{ + char *bogus_special = (char *) tail_alloc(1) + 1; + void *bogus_addr = (char *) tail_alloc(1) + 1; + + char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; + char bogus_addr_str[sizeof(void *) * 2 + sizeof("0x")]; + char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; + + long rc; + struct fs_disk_quota *xdq = tail_alloc(sizeof(*xdq)); + struct fs_quota_stat *xqstat = tail_alloc(sizeof(*xqstat)); + struct fs_quota_statv *xqstatv = tail_alloc(sizeof(*xqstatv)); + uint32_t *flags = tail_alloc(sizeof(*flags)); + char *unterminated = tail_memdup(unterminated_data, + sizeof(unterminated_data)); + + snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", + bogus_special); + snprintf(bogus_addr_str, sizeof(bogus_addr_str), "%p", + bogus_addr); + snprintf(unterminated_str, sizeof(unterminated_str), "%p", + unterminated); + + + /* Q_XQUOTAON */ + + *flags = 0xdeadbeef; + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), flags, + "[XFS_QUOTA_UDQ_ACCT|XFS_QUOTA_UDQ_ENFD" + "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" + "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); + + rc = syscall(__NR_quotactl, QCMD(Q_XQUOTAON, 0xfacefeed), bogus_dev, + bogus_id, bogus_addr); + printf("quotactl(QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)" + ", %s, %p) = %s\n", + QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed)), + bogus_dev_str, bogus_addr, sprintrc(rc)); + + + /* Q_XQUOTAOFF */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAOFF, USRQUOTA)), + bogus_special, bogus_special_str, + bogus_addr, bogus_addr_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAOFF, GRPQUOTA)), + ARG_STR("/dev/bogus/"), + ARG_STR(NULL)); + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + QCMD(Q_XQUOTAOFF, 3), + "QCMD(Q_XQUOTAOFF, 0x3 /* ???QUOTA */)", + ARG_STR("/dev/bogus/"), flags, + "[XFS_QUOTA_UDQ_ACCT|XFS_QUOTA_UDQ_ENFD" + "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" + "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); + + + /* Q_XGETQUOTA */ + + /* Trying our best to get successful result */ + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), getuid(), xdq, print_xdisk_quota, + (intptr_t) 1); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 2); + + + /* Q_XGETNEXTQUOTA */ + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETNEXTQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), 0, xdq, print_xdisk_quota, + (intptr_t) 1); + + + /* Q_XSETQLIM */ + + check_quota(CQF_NONE, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), + bogus_special, bogus_special_str, 0, bogus_addr); + + fill_memory_ex(xdq, sizeof(*xdq), 0x8e, 0x80); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), + bogus_dev, bogus_dev_str, 3141592653U, + xdq, print_xdisk_quota, (intptr_t) 0); + + + /* Q_XGETQSTAT */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstat, print_xquota_stat, (intptr_t) 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + unterminated, unterminated_str, + xqstat + 1, print_xquota_stat, (intptr_t) 2); + + + /* Q_XGETQSTATV */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTATV, GRPQUOTA)), + ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 2); + + + /* Q_XQUOTARM */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTARM, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XQUOTARM, USRQUOTA)), + unterminated, unterminated_str, flags + 1); + + *flags = 0xdeadbeef; + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTARM, GRPQUOTA)), + ARG_STR(NULL), flags, + "[XFS_USER_QUOTA|XFS_PROJ_QUOTA" + "|XFS_GROUP_QUOTA|0xdeadbee8]"); + + + /* Q_XQUOTASYNC */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_XQUOTASYNC, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_XQUOTASYNC, 0xfff), + "QCMD(Q_XQUOTASYNC, 0xff /* ???QUOTA */)", + ARG_STR(NULL)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_quotactl && " + "(HAVE_LINUX_QUOTA_H || HAVE_SYS_QUOTA_H) && " + "HAVE_LINUX_DQBLK_XFS_H"); + +#endif diff --git a/tests-mx32/quotactl-xfs.test b/tests-mx32/quotactl-xfs.test new file mode 100755 index 00000000..404a7372 --- /dev/null +++ b/tests-mx32/quotactl-xfs.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of quotactl xfs subcommands. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=quotactl diff --git a/tests-mx32/quotactl.c b/tests-mx32/quotactl.c new file mode 100644 index 00000000..3a7c1132 --- /dev/null +++ b/tests-mx32/quotactl.c @@ -0,0 +1,320 @@ +/* + * Check decoding of quotactl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_quotactl) && \ + (defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_SYS_QUOTA_H)) + +# include +# include +# include +# include +# include + +# include "quotactl.h" + +# ifndef HAVE_LINUX_QUOTA_H +/* Some dirty hacks in order to make sys/quota.h usable as a backup */ + +# define if_dqblk dqblk +# define if_nextdqblk nextdqblk +# define if_dqinfo dqinfo + +# endif /* !HAVE_LINUX_QUOTA_H */ + +# ifndef Q_GETNEXTQUOTA + +# define Q_GETNEXTQUOTA 0x800009 + +struct if_nextdqblk { + uint64_t dqb_bhardlimit; + uint64_t dqb_bsoftlimit; + uint64_t dqb_curspace; + uint64_t dqb_ihardlimit; + uint64_t dqb_isoftlimit; + uint64_t dqb_curinodes; + uint64_t dqb_btime; + uint64_t dqb_itime; + uint32_t dqb_valid; + uint32_t dqb_id; +}; +# endif /* !Q_GETNEXTQUOTA */ + +# include "xlat.h" +# include "xlat/quota_formats.h" +# include "xlat/if_dqblk_valid.h" +# include "xlat/if_dqinfo_flags.h" +# include "xlat/if_dqinfo_valid.h" + +void +print_dqblk(long rc, void *ptr, void *arg) +{ + struct if_dqblk *db = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", db); + return; + } + + PRINT_FIELD_U("{", db, dqb_bhardlimit); + PRINT_FIELD_U(", ", db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", db, dqb_curspace); + PRINT_FIELD_U(", ", db, dqb_ihardlimit); + PRINT_FIELD_U(", ", db, dqb_isoftlimit); + PRINT_FIELD_U(", ", db, dqb_curinodes); + +# if VERBOSE + PRINT_FIELD_U(", ", db, dqb_btime); + PRINT_FIELD_U(", ", db, dqb_itime); + + printf(", dqb_valid="); + printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_nextdqblk(long rc, void *ptr, void *arg) +{ + struct if_nextdqblk *db = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", db); + return; + } + + PRINT_FIELD_U("{", db, dqb_bhardlimit); + PRINT_FIELD_U(", ", db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", db, dqb_curspace); + PRINT_FIELD_U(", ", db, dqb_ihardlimit); + PRINT_FIELD_U(", ", db, dqb_isoftlimit); + PRINT_FIELD_U(", ", db, dqb_curinodes); + +# if VERBOSE + PRINT_FIELD_U(", ", db, dqb_btime); + PRINT_FIELD_U(", ", db, dqb_itime); + + printf(", dqb_valid="); + printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); + + PRINT_FIELD_U(", ", db, dqb_id); +# else + PRINT_FIELD_U(", ", db, dqb_id); + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_dqinfo(long rc, void *ptr, void *arg) +{ + struct if_dqinfo *di = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", di); + return; + } + + PRINT_FIELD_U("{", di, dqi_bgrace); + PRINT_FIELD_U(", ", di, dqi_igrace); + + printf(", dqi_flags="); + printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); + printf(", dqi_valid="); + printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); + printf("}"); +} + + +int +main(void) +{ + char *bogus_special = (char *) tail_alloc(1) + 1; + void *bogus_addr = (char *) tail_alloc(1) + 1; + + char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; + char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; + + long rc; + char *unterminated = tail_memdup(unterminated_data, + sizeof(unterminated_data)); + struct if_dqblk *dqblk = tail_alloc(sizeof(*dqblk)); + struct if_dqinfo *dqinfo = tail_alloc(sizeof(*dqinfo)); + uint32_t *fmt = tail_alloc(sizeof(*fmt)); + struct if_nextdqblk *nextdqblk = tail_alloc(sizeof(*nextdqblk)); + + + snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", + bogus_special); + snprintf(unterminated_str, sizeof(unterminated_str), "%p", + unterminated); + + + /* Invalid commands */ + + rc = syscall(__NR_quotactl, bogus_cmd, bogus_special, bogus_id, + bogus_addr); + printf("quotactl(QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)" + ", %p, %u, %p) = %s\n", + QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd), + bogus_special, bogus_id, bogus_addr, sprintrc(rc)); + + rc = syscall(__NR_quotactl, 0, NULL, -1, NULL); + printf("quotactl(QCMD(0 /* Q_??? */, USRQUOTA), NULL, -1, NULL) = %s\n", + sprintrc(rc)); + + + /* Q_QUOTAON */ + + check_quota(CQF_ID_STR | CQF_ADDR_STR, + ARG_STR(QCMD(Q_QUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), ARG_STR(QFMT_VFS_OLD), + ARG_STR("/tmp/bogus/")); + + rc = syscall(__NR_quotactl, QCMD(Q_QUOTAON, 0xfacefeed), bogus_dev, + bogus_id, bogus_addr); + printf("quotactl(QCMD(Q_QUOTAON, %#x /* ???QUOTA */)" + ", %s, %#x /* QFMT_VFS_??? */, %p) = %s\n", + QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed)), + bogus_dev_str, bogus_id, bogus_addr, sprintrc(rc)); + + + /* Q_QUOTAOFF */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), + ARG_STR("/dev/bogus/")); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_QUOTAOFF, 3), "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)", + ARG_STR(NULL)); + + + /* Q_GETQUOTA */ + + /* Trying our best to get successful result */ + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), getuid(), dqblk, print_dqblk, + (intptr_t) 1); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 2); + + + /* Q_GETNEXTQUOTA */ + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), 0, nextdqblk, print_nextdqblk, + (intptr_t) 1); + + + /* Q_SETQUOTA */ + + fill_memory(dqblk, sizeof(*dqblk)); + + check_quota(CQF_NONE, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + bogus_special, bogus_special_str, 0, bogus_addr); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + ARG_STR("/dev/bogus/"), 3141592653U, dqblk, print_dqblk, + (intptr_t) 0); + + + /* Q_GETINFO */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + ARG_STR("/dev/sda1"), dqinfo, print_dqinfo, (intptr_t) 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + bogus_special, bogus_special_str, dqinfo, + print_dqinfo, (intptr_t) 2); + + /* Q_SETINFO */ + + fill_memory(dqinfo, sizeof(*dqinfo)); + /* In order to check flag printing correctness */ + dqinfo->dqi_flags = 0xdeadabcd; + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_SETINFO, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_SETINFO, USRQUOTA)), + ARG_STR("/dev/bogus/"), dqinfo, print_dqinfo, (intptr_t) 0); + + + /* Q_GETFMT */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_GETFMT, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_GETFMT, USRQUOTA)), + unterminated, unterminated_str, fmt + 1); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt); + + + /* Q_SYNC */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_SYNC, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_SYNC, 0xfff), "QCMD(Q_SYNC, 0xff /* ???QUOTA */)", + ARG_STR(NULL)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_quotactl && " + "(HAVE_LINUX_QUOTA_H || HAVE_SYS_QUOTA_H)"); + +#endif diff --git a/tests-mx32/quotactl.h b/tests-mx32/quotactl.h new file mode 100644 index 00000000..31eaec58 --- /dev/null +++ b/tests-mx32/quotactl.h @@ -0,0 +1,166 @@ +/* + * Common definitions for Linux and XFS quota tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_QUOTACTL_H +#define STRACE_TESTS_QUOTACTL_H + +# include +# include +# include + +# ifdef HAVE_LINUX_QUOTA_H +/* Broken in CentOS 5: has extern spinlock_t dq_data_lock; declaration */ +# include +# else +# include +/* Broken in some new glibc versions: have Q_GETNEXTQUOTA definition but no + * struct nextdqblk defined. Fixed in glibc-2.24-106-g4d72808. */ +# include +# endif + +# ifndef QCMD_CMD +# define QCMD_CMD(_val) ((unsigned) (_val) >> SUBCMDSHIFT) +# endif /* !QCMD_CMD */ + +# ifndef QCMD_TYPE +# define QCMD_TYPE(_val) ((unsigned) (_val) & SUBCMDMASK) +# endif /* !QCMD_TYPE */ + +# ifndef PRJQUOTA +# define PRJQUOTA 2 +# endif + +# define PRINT_FIELD_D(prefix, where, field) \ + printf("%s%s=%lld", (prefix), #field, \ + sign_extend_unsigned_to_ll((where)->field)) + +# define PRINT_FIELD_U(prefix, where, field) \ + printf("%s%s=%llu", (prefix), #field, \ + zero_extend_signed_to_ull((where)->field)) + +# define PRINT_FIELD_X(prefix, where, field) \ + printf("%s%s=%#llx", (prefix), #field, \ + zero_extend_signed_to_ull((where)->field)) + +typedef void (*print_cb)(long rc, void *addr, void *arg); + +enum check_quotactl_flag_bits { + CQF_ID_SKIP_BIT, + CQF_ID_STR_BIT, + CQF_ADDR_SKIP_BIT, + CQF_ADDR_STR_BIT, + CQF_ADDR_CB_BIT, +}; + +enum check_quotactl_flags { + CQF_NONE, + CQF_ID_SKIP = 1 << CQF_ID_SKIP_BIT, + CQF_ID_STR = 1 << CQF_ID_STR_BIT, + CQF_ADDR_SKIP = 1 << CQF_ADDR_SKIP_BIT, + CQF_ADDR_STR = 1 << CQF_ADDR_STR_BIT, + CQF_ADDR_CB = 1 << CQF_ADDR_CB_BIT, +}; + + +static inline void +check_quota(uint32_t flags, int cmd, const char *cmd_str, + const char *special, const char *special_str, ...) +{ + long rc; + const char *addr_str = NULL; + const char *id_str = NULL; + void *addr = NULL; + print_cb addr_cb = NULL; + void *addr_cb_arg = NULL; + uint32_t id = -1; + + va_list ap; + + va_start(ap, special_str); + + if (!(flags & CQF_ID_SKIP)) { + id = va_arg(ap, uint32_t); + + if (flags & CQF_ID_STR) + id_str = va_arg(ap, const char *); + } + + if (!(flags & CQF_ADDR_SKIP)) { + addr = va_arg(ap, void *); + + if (flags & CQF_ADDR_CB) { + addr_cb = va_arg(ap, print_cb); + addr_cb_arg = va_arg(ap, void *); + } else if (flags & CQF_ADDR_STR) { + addr_str = va_arg(ap, const char *); + } + } + + va_end(ap); + + rc = syscall(__NR_quotactl, cmd, special, id, addr); + printf("quotactl(%s, %s", cmd_str, special_str); + + if (!(flags & CQF_ID_SKIP)) { + if (flags & CQF_ID_STR) { + printf(", %s", id_str); + } else { + if (id == (uint32_t)-1) + printf(", -1"); + else + printf(", %u", id); + } + } + + if (!(flags & CQF_ADDR_SKIP)) { + if (flags & CQF_ADDR_CB) { + printf(", "); + addr_cb(rc, addr, addr_cb_arg); + } else if (flags & CQF_ADDR_STR) { + printf(", %s", addr_str); + } else { + printf(", %p", addr); + } + } + + printf(") = %s\n", sprintrc(rc)); +} + + +static const int bogus_cmd = 0xbadc0ded; +static const int bogus_id = 0xca7faced; + +/* It is invalid anyway due to the slash in the end */ +static const char *bogus_dev = "/dev/bogus/"; +static const char *bogus_dev_str = "\"/dev/bogus/\""; + +static const char unterminated_data[] = { '\1', '\2', '\3' }; + +#endif /* !STRACE_TESTS_QUOTACTL_H */ diff --git a/tests-mx32/quotactl.test b/tests-mx32/quotactl.test new file mode 100755 index 00000000..d0101f46 --- /dev/null +++ b/tests-mx32/quotactl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of quotactl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/read-write.c b/tests-mx32/read-write.c new file mode 100644 index 00000000..262e07b5 --- /dev/null +++ b/tests-mx32/read-write.c @@ -0,0 +1,224 @@ +/* + * Check decoding and dumping of read and write syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static void +dump_str(const char *str, const unsigned int len) +{ + static const char dots[16] = "................"; + unsigned int i; + + for (i = 0; i < len; i += 16) { + unsigned int n = len - i > 16 ? 16 : len - i; + const char *dump = hexdump_memdup(str + i, n); + + tprintf(" | %05x %-49s %-16.*s |\n", + i, dump, n, dots); + + free((void *) dump); + } +} + +static void +print_hex(const char *str, const unsigned int len) +{ + const unsigned char *ustr = (const unsigned char *) str; + unsigned int i; + + for (i = 0; i < len; ++i) { + unsigned int c = ustr[i]; + + switch (c) { + case '\t': + tprintf("\\t"); break; + case '\n': + tprintf("\\n"); break; + case '\v': + tprintf("\\v"); break; + case '\f': + tprintf("\\f"); break; + case '\r': + tprintf("\\r"); break; + default: + tprintf("\\%o", ustr[i]); + } + } +} + +static long +k_read(unsigned int fd, void *buf, size_t count) +{ + kernel_ulong_t kfd = (kernel_ulong_t) 0xfacefeed00000000ULL | fd; + return syscall(__NR_read, kfd, buf, count); +} + +static long +k_write(unsigned int fd, const void *buf, size_t count) +{ + kernel_ulong_t kfd = (kernel_ulong_t) 0xfacefeed00000000ULL | fd; + return syscall(__NR_write, kfd, buf, count); +} + +static void +test_dump(const unsigned int len) +{ + static char *buf; + + if (buf) { + size_t ps1 = get_page_size() - 1; + buf = (void *) (((size_t) buf + ps1) & ~ps1) - len; + } else { + buf = tail_alloc(len); + } + + long rc = k_read(0, buf, len); + if (rc != (int) len) + perror_msg_and_fail("read: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "read", 0); + print_hex(buf, len); + tprintf("\", %d) = %ld\n", len, rc); + dump_str(buf, len); + + unsigned int i; + for (i = 0; i < len; ++i) + buf[i] = i; + + rc = k_write(1, buf, len); + if (rc != (int) len) + perror_msg_and_fail("write: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "write", 1); + print_hex(buf, len); + tprintf("\", %d) = %ld\n", len, rc); + dump_str(buf, len); + + if (!len) + buf = 0; +} + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "read-write-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + + static const char w_c[] = "0123456789abcde"; + const unsigned int w_len = LENGTH_OF(w_c); + const char *w_d = hexdump_strdup(w_c); + const void *w = tail_memdup(w_c, w_len); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + const unsigned int r0_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r0_len); + + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + const unsigned int r1_len = w_len - r0_len; + void *r1 = tail_alloc(w_len); + + void *efault = r1 - get_page_size(); + + long rc; + + rc = k_write(1, w, 0); + if (rc) + perror_msg_and_fail("write: expected 0, returned %ld", rc); + tprintf("write(1, \"\", 0) = 0\n"); + + rc = k_write(1, efault, 1); + if (rc != -1) + perror_msg_and_fail("write: expected -1 EFAULT" + ", returned %ld", rc); + tprintf("write(1, %p, 1) = -1 EFAULT (%m)\n", efault); + + rc = k_write(1, w, w_len); + if (rc != (int) w_len) + perror_msg_and_fail("write: expected %u, returned %ld", + w_len, rc); + tprintf("write(1, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + w_c, w_len, rc, w_d, w_c); + close(1); + + rc = k_read(0, r0, 0); + if (rc) + perror_msg_and_fail("read: expected 0, returned %ld", rc); + tprintf("read(0, \"\", 0) = 0\n"); + + rc = k_read(0, efault, 1); + if (rc != -1) + perror_msg_and_fail("read: expected -1, returned %ld", rc); + tprintf("read(0, %p, 1) = -1 EFAULT (%m)\n", efault); + + rc = k_read(0, r0, r0_len); + if (rc != (int) r0_len) + perror_msg_and_fail("read: expected %u, returned %ld", + r0_len, rc); + tprintf("read(0, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r0_c, r0_len, rc, r0_d, r0_c); + + rc = k_read(0, r1, w_len); + if (rc != (int) r1_len) + perror_msg_and_fail("read: expected %u, returned %ld", + r1_len, rc); + tprintf("read(0, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r1_c, w_len, rc, r1_d, r1_c); + close(0); + + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 1) + perror_msg_and_fail("open"); + + unsigned int i; + for (i = 0; i <= 32; ++i) + test_dump(i); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/read-write.test b/tests-mx32/read-write.test new file mode 100755 index 00000000..3700541f --- /dev/null +++ b/tests-mx32/read-write.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check decoding and dumping of read and write syscalls. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +tmpfile=read-write-tmpfile +> $tmpfile + +run_strace_match_diff \ + -a15 -eread=0 -ewrite=1 -e trace=read,write \ + -P $tmpfile -P /dev/zero -P /dev/null + +rm -f $tmpfile diff --git a/tests-mx32/readahead.c b/tests-mx32/readahead.c new file mode 100644 index 00000000..c11b577d --- /dev/null +++ b/tests-mx32/readahead.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef HAVE_READAHEAD +/* Check for glibc readahead argument passing bugs. */ +# ifdef __GLIBC__ +/* + * glibc < 2.8 had an incorrect order of higher and lower parts of offset, + * see https://sourceware.org/bugzilla/show_bug.cgi?id=5208 + */ +# if !(defined __GLIBC_MINOR__ && \ + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) +# undef HAVE_READAHEAD +# endif /* glibc < 2.8 */ +/* + * glibc < 2.25 had an incorrect implementation on mips n64, + * see https://sourceware.org/bugzilla/show_bug.cgi?id=21026 + */ +# if defined LINUX_MIPSN64 && !(defined __GLIBC_MINOR__ && \ + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) +# undef HAVE_READAHEAD +# endif /* LINUX_MIPSN64 && glibc < 2.25 */ +# endif /* __GLIBC__ */ +#endif /* HAVE_READAHEAD */ + +#ifdef HAVE_READAHEAD + +# include +# include + +static const int fds[] = { + -0x80000000, + -100, + -1, + 0, + 1, + 2, + 0x7fffffff, +}; + +static const off64_t offsets[] = { + -0x8000000000000000LL, + -0x5060708090a0b0c0LL, + -1LL, + 0, + 1, + 0xbadfaced, + 0x7fffffffffffffffLL, +}; + +static const unsigned long counts[] = { + 0UL, + 0xdeadca75, + (unsigned long) 0xface1e55beeff00dULL, + (unsigned long) 0xffffffffffffffffULL, +}; + +int +main(void) +{ + unsigned i; + unsigned j; + unsigned k; + ssize_t rc; + + for (i = 0; i < ARRAY_SIZE(fds); i++) + for (j = 0; j < ARRAY_SIZE(offsets); j++) + for (k = 0; k < ARRAY_SIZE(counts); k++) { + rc = readahead(fds[i], offsets[j], counts[k]); + + printf("readahead(%d, %lld, %lu) = %s\n", + fds[i], (long long) offsets[j], + counts[k], sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_READAHEAD") + +#endif diff --git a/tests-mx32/readahead.test b/tests-mx32/readahead.test new file mode 100755 index 00000000..397c6903 --- /dev/null +++ b/tests-mx32/readahead.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check readahead syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests-mx32/readdir.c b/tests-mx32/readdir.c new file mode 100644 index 00000000..8c483620 --- /dev/null +++ b/tests-mx32/readdir.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readdir + +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +int +main(int ac, const char **av) +{ + char *dname; + struct { + unsigned long d_ino; + unsigned long d_off; + unsigned short d_reclen; + char d_name[1024]; + } e; + int rc; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + while ((rc = syscall(__NR_readdir, 0, &e, 1))) { + if (rc < 0) + perror_msg_and_skip("readdir"); + e.d_name[e.d_reclen] = '\0'; + printf("readdir(0, {d_ino=%lu, d_off=%lu, d_reclen=%u" + ", d_name=\"%s\"}) = %d\n", + e.d_ino, e.d_off, e.d_reclen, + e.d_name[0] == '.' ? e.d_name : qname, rc); + } + printf("readdir(0, %p) = 0\n", &e); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readdir") + +#endif diff --git a/tests-mx32/readdir.test b/tests-mx32/readdir.test new file mode 100755 index 00000000..e3132737 --- /dev/null +++ b/tests-mx32/readdir.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check readdir syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a16 diff --git a/tests-mx32/readlink.c b/tests-mx32/readlink.c new file mode 100644 index 00000000..4ddf5fac --- /dev/null +++ b/tests-mx32/readlink.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readlink + +# include +# include + +# define PREFIX "test.readlink" +# define TARGET (PREFIX ".target") +# define LINKPATH (PREFIX ".link") + +int +main(void) +{ + const char * const fname = tail_memdup(LINKPATH, sizeof(LINKPATH)); + const char * const hex_fname = + hexquote_strndup(fname, sizeof(LINKPATH) - 1); + + const unsigned int size = sizeof(TARGET) - 1; + char * const buf = tail_alloc(size); + + (void) unlink(fname); + + long rc = syscall(__NR_readlink, fname, buf, size); + printf("readlink(\"%s\", %p, %u) = -1 ENOENT (%m)\n", + hex_fname, buf, size); + + if (symlink(TARGET, fname)) + perror_msg_and_fail("symlink"); + + rc = syscall(__NR_readlink, fname, buf, size); + if (rc < 0) { + perror("readlink"); + (void) unlink(fname); + return 77; + } + const char * const hex_buf = hexquote_strndup(buf, size); + printf("readlink(\"%s\", \"%s\", %u) = %u\n", + hex_fname, hex_buf, size, size); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readlink") + +#endif diff --git a/tests-mx32/readlink.test b/tests-mx32/readlink.test new file mode 100755 index 00000000..c026ecbe --- /dev/null +++ b/tests-mx32/readlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check readlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests-mx32/readlinkat.c b/tests-mx32/readlinkat.c new file mode 100644 index 00000000..4d3b516c --- /dev/null +++ b/tests-mx32/readlinkat.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readlinkat + +# include +# include + +# define PREFIX "test.readlinkat" +# define TARGET (PREFIX ".target") +# define LINKPATH (PREFIX ".link") + +int +main(void) +{ + const char * const fname = tail_memdup(LINKPATH, sizeof(LINKPATH)); + const char * const hex_fname = + hexquote_strndup(fname, sizeof(LINKPATH) - 1); + + const unsigned int size = sizeof(TARGET) - 1; + char * const buf = tail_alloc(size); + + (void) unlink(fname); + + long rc = syscall(__NR_readlinkat, -100, fname, buf, size); + printf("readlinkat(AT_FDCWD, \"%s\", %p, %u) = -1 ENOENT (%m)\n", + hex_fname, buf, size); + + if (symlink(TARGET, fname)) + perror_msg_and_fail("symlink"); + + rc = syscall(__NR_readlinkat, -100, fname, buf, size); + if (rc < 0) { + perror("readlinkat"); + (void) unlink(fname); + return 77; + } + const char * const hex_buf = hexquote_strndup(buf, size); + printf("readlinkat(AT_FDCWD, \"%s\", \"%s\", %u) = %u\n", + hex_fname, hex_buf, size, size); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readlink") + +#endif diff --git a/tests-mx32/readlinkat.test b/tests-mx32/readlinkat.test new file mode 100755 index 00000000..229c8e1e --- /dev/null +++ b/tests-mx32/readlinkat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check readlinkat syscall decoding. + +. "${srcdir=.}/readlink.test" diff --git a/tests-mx32/readv.c b/tests-mx32/readv.c new file mode 100644 index 00000000..0e5aab65 --- /dev/null +++ b/tests-mx32/readv.c @@ -0,0 +1,157 @@ +/* + * Check decoding of readv and writev syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + pipe_maxfd(fds); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + const void *efault = w0 + LENGTH_OF(w0_c); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + long rc; + + rc = writev(fds[1], efault, 42); + tprintf("writev(%d, %p, 42) = %ld %s (%m)\n", + fds[1], efault, rc, errno2name()); + + rc = readv(fds[0], efault, 42); + tprintf("readv(%d, %p, 42) = %ld %s (%m)\n", + fds[0], efault, rc, errno2name()); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + tprintf("writev(%d, [], 0) = %ld\n", + fds[1], (long) writev(fds[1], w_iov, 0)); + + rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, %p], 2)" + " = %ld %s (%m)\n", + fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + assert(writev(fds[1], w_iov, ARRAY_SIZE(w_iov_)) == (int) w_len); + close(fds[1]); + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + fds[1], w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + assert(readv(fds[0], r_iov, ARRAY_SIZE(r0_iov_)) == (int) r_len); + tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + fds[0], + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + assert(readv(fds[0], r_iov, ARRAY_SIZE(r1_iov_)) == (int) w_len - (int) r_len); + tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + fds[0], r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(fds[0]); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/readv.test b/tests-mx32/readv.test new file mode 100755 index 00000000..dc187996 --- /dev/null +++ b/tests-mx32/readv.test @@ -0,0 +1,65 @@ +#!/bin/sh +# +# Check decoding and dumping of readv and writev syscalls. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread=all -ewrite='!none' +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread='!none' -ewrite=all +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread=none -ewrite='!all' -eread='!0,1,2' -ewrite='!0,1,2' +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread='!all' -ewrite=none -eread='!0,1,2' -ewrite='!0,1,2' + +wfd="$(./print_maxfd)" +rfd="$(($wfd - 1))" +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="$rfd" -ewrite="$wfd" +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="!$rfd" -ewrite="!$wfd" -eread="$rfd" -ewrite="$wfd" + +rfds='!!!0' +[ $rfd -lt 1023 ] || rfd=1023 +i=0 +while [ $i -lt $rfd ]; do + rfds="$rfds,$i" + i=$(($i + 1)) +done + +wfds='!!!0' +[ $wfd -lt 1023 ] || wfd=1023 +i=0 +while [ $i -lt $wfd ]; do + wfds="$wfds,$i" + i=$(($i + 1)) +done + +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="$rfds" -ewrite="$wfds" diff --git a/tests-mx32/reboot.c b/tests-mx32/reboot.c new file mode 100644 index 00000000..9b09e647 --- /dev/null +++ b/tests-mx32/reboot.c @@ -0,0 +1,37 @@ +#include "tests.h" +#include + +#ifdef __NR_reboot + +# include +# include +# include + +# define INVALID_MAGIC 319887762 +# define INVALID_CMD 0x01234568 + +int +main(void) +{ + static const char buf[] = "reboot"; + long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ + INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); + printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */," + " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n", + INVALID_MAGIC, buf, rc, errno2name()); + + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ + LINUX_REBOOT_MAGIC2, INVALID_CMD); + printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2," + " %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n", + INVALID_CMD, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_reboot") + +#endif diff --git a/tests-mx32/reboot.test b/tests-mx32/reboot.test new file mode 100755 index 00000000..a97dd21a --- /dev/null +++ b/tests-mx32/reboot.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check reboot syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/recvfrom.c b/tests-mx32/recvfrom.c new file mode 100644 index 00000000..b12454d2 --- /dev/null +++ b/tests-mx32/recvfrom.c @@ -0,0 +1,89 @@ +/* + * Check decoding of sockaddr related arguments of recvfrom syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME recvfrom +#define TEST_SYSCALL_PREPARE send_un() +#define PREFIX_S_ARGS , recv_buf, 1, 0 +#define PREFIX_S_STR ", \"A\", 1, 0" +#define PREFIX_F_ARGS , 0, 1, 0 +#define PREFIX_F_STR ", NULL, 1, 0" +static void send_un(void); +static char recv_buf[1]; +#include "sockname.c" + +static int cfd; + +static void +send_un(void) +{ + if (send(cfd, "A", 1, 0) != 1) + perror_msg_and_skip("send"); +} + +int +main(void) +{ + cfd = socket(AF_UNIX, SOCK_STREAM, 0); + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd < 0 || lfd < 0) + perror_msg_and_skip("socket"); + + struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET ".send" + }; + + (void) unlink(un.sun_path); + if (bind(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + un.sun_path[sizeof(TEST_SOCKET) - 1] = '\0'; + (void) unlink(un.sun_path); + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + + if (listen(lfd, 1)) + perror_msg_and_skip("listen"); + + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); + + int afd = accept(lfd, 0, 0); + if (afd < 0) + perror_msg_and_skip("accept"); + + (void) unlink(un.sun_path); + + test_sockname_syscall(afd); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/recvfrom.test b/tests-mx32/recvfrom.test new file mode 100755 index 00000000..9dfbc898 --- /dev/null +++ b/tests-mx32/recvfrom.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sockaddr related arguments of recvfrom syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/recvmmsg-timeout.c b/tests-mx32/recvmmsg-timeout.c new file mode 100644 index 00000000..7cf064db --- /dev/null +++ b/tests-mx32/recvmmsg-timeout.c @@ -0,0 +1,71 @@ +/* + * Check decoding of timeout argument of recvmmsg syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#include "msghdr.h" + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + if (send(fds[1], "A", 1, 0) != 1) + perror_msg_and_skip("send"); + + char buf; + struct iovec iov = { .iov_base = &buf, .iov_len = sizeof(buf) }; + struct mmsghdr mh = { + .msg_hdr = { + .msg_iov = &iov, + .msg_iovlen = 1 + } + }; + struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + + int rc = recv_mmsg(-1, &mh, 1, 0, &t); + printf("recvmmsg(-1, %p, 1, 0, {tv_sec=0, tv_nsec=12345678})" + " = %d %s (%m)\n", &mh, rc, errno2name()); + + rc = recv_mmsg(fds[0], &mh, 1, 0, &t); + if (rc < 0) + perror_msg_and_skip("recvmmsg"); + printf("recvmmsg(%d, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, msg_len=1}], 1, 0" + ", {tv_sec=0, tv_nsec=12345678}) = " + "%d (left {tv_sec=0, tv_nsec=%d})\n", + fds[0], rc, (int) t.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/recvmmsg-timeout.test b/tests-mx32/recvmmsg-timeout.test new file mode 100755 index 00000000..36a12221 --- /dev/null +++ b/tests-mx32/recvmmsg-timeout.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of timeout argument of recvmmsg syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests-mx32/recvmsg.c b/tests-mx32/recvmsg.c new file mode 100644 index 00000000..fa41a9d4 --- /dev/null +++ b/tests-mx32/recvmsg.c @@ -0,0 +1,160 @@ +/* + * Check decoding of recvmsg and sendmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + const struct msghdr w_mh_ = { + .msg_iov = w_iov, + .msg_iovlen = ARRAY_SIZE(w_iov_) + }; + const struct msghdr *w_mh = tail_memdup(&w_mh_, sizeof(w_mh_)); + + assert(sendmsg(1, w_mh, 0) == (int) w_len); + close(1); + tprintf("sendmsg(1, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}, {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), + w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), + ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, + LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + const struct msghdr r_mh_ = { + .msg_iov = r_iov, + .msg_iovlen = ARRAY_SIZE(r0_iov_) + }; + struct msghdr *r_mh = tail_memdup(&r_mh_, sizeof(r_mh_)); + + assert(recvmsg(0, r_mh, 0) == (int) r_len); + tprintf("recvmsg(0, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + r_mh->msg_iov = r_iov; + r_mh->msg_iovlen = ARRAY_SIZE(r1_iov_); + + assert(recvmsg(0, r_mh, 0) == (int) w_len - (int) r_len); + tprintf("recvmsg(0, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}, {iov_base=\"\", iov_len=%u}]" + ", msg_iovlen=%u, msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/recvmsg.test b/tests-mx32/recvmsg.test new file mode 100755 index 00000000..e373a20a --- /dev/null +++ b/tests-mx32/recvmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of recvmsg and sendmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests-mx32/redirect-fds.c b/tests-mx32/redirect-fds.c new file mode 100644 index 00000000..fc1073a7 --- /dev/null +++ b/tests-mx32/redirect-fds.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#define N_FDS 3 + +/* + * Do not print any messages, indicate errors with return codes. + */ +static int +check_fd(int fd, const char *fname) +{ + const int should_be_closed = (fname[0] == '\0'); + + struct stat st_fd, st_fn; + + if (fstat(fd, &st_fd)) { + if (!should_be_closed) + return 10 + fd; + } else { + if (should_be_closed) + return 20 + fd; + + if (stat(fname, &st_fn)) + return 30 + fd; + + if (st_fd.st_dev != st_fn.st_dev + || st_fd.st_ino != st_fn.st_ino) + return 40 + fd; + } + + return 0; +} + +int +main(int ac, char **av) +{ + assert(ac == 1 + N_FDS); + + int rc = 0, fd; + for (fd = 1; fd < 1 + N_FDS; ++fd) + if ((rc = check_fd(fd - 1, av[fd]))) + break; + + return rc; +} diff --git a/tests-mx32/redirect-fds.test b/tests-mx32/redirect-fds.test new file mode 100755 index 00000000..ddef8fab --- /dev/null +++ b/tests-mx32/redirect-fds.test @@ -0,0 +1,71 @@ +#!/bin/sh +# +# Check that strace does not leak placeholder descriptors. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +case "$STRACE" in + *valgrind\ *--suppressions=*) + skip_ 'incompatible with valgrind' ;; +esac + +fd0="$LOG.fd0" +fd1="$LOG.fd1" +fd2="$LOG.fd2" + +check_prog touch + +check_fd() +{ + local a1 a2 a3 + a1="$1" + a2="$2" + a3="$3" + + touch "$LOG" "$fd0" || + framework_skip_ 'failed to create files' + + set -- "\"./$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" + eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || + fail_ "$* failed with code $rc" + + set -- "$STRACE" -o"$LOG" -echdir "$@" + eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || + dump_log_and_fail_with "$* failed with code $?" + + rm -f "$LOG" "$fd0" "$fd1" "$fd2" +} + +check_fd "$fd0" "$fd1" "$fd2" +check_fd '' "$fd1" "$fd2" +check_fd "$fd0" '' "$fd2" +check_fd "$fd0" "$fd1" '' +check_fd '' '' "$fd2" +check_fd '' "$fd1" '' +check_fd "$fd0" '' '' +check_fd '' '' '' diff --git a/tests-mx32/redirect.test b/tests-mx32/redirect.test new file mode 100755 index 00000000..fa0c5369 --- /dev/null +++ b/tests-mx32/redirect.test @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Ensure that strace does not retain stdin and stdout descriptors. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep +check_prog yes + +> "$OUT" +> "$LOG" +( + while [ -f "$LOG" ]; do + : + done + $SLEEP_A_BIT & + yes + if kill -0 $! 2> /dev/null; then + wait + else + echo TIMEOUT >> "$OUT" + fi +) | $STRACE -qq -enone -esignal=none \ + sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT" + +if [ -s "$OUT" ]; then + fail_ "$STRACE failed to redirect standard input" +fi + +> "$LOG" +$STRACE -qq -enone -esignal=none \ + sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT" | +( + while [ -f "$LOG" ]; do + : + done + $SLEEP_A_BIT & + cat > /dev/null + if kill -0 $! 2> /dev/null; then + wait + else + echo TIMEOUT >> "$OUT" + fi +) + +if [ -s "$OUT" ]; then + fail_ "$STRACE failed to redirect standard output" +fi + +rm -f -- "$OUT" diff --git a/tests-mx32/remap_file_pages.c b/tests-mx32/remap_file_pages.c new file mode 100644 index 00000000..452d2de7 --- /dev/null +++ b/tests-mx32/remap_file_pages.c @@ -0,0 +1,61 @@ +/* + * Check decoding of remap_file_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_remap_file_pages + +# include +# include +# include + +int +main(void) +{ + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long size = (unsigned long) 0xdefaced1bad2f00dULL; + const unsigned long prot = PROT_READ|PROT_WRITE|PROT_EXEC; + const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deedULL; + const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS; + + long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags); + printf("remap_file_pages(%#lx, %lu, %s, %lu, %s) = %ld %s (%m)\n", + addr, size, "PROT_READ|PROT_WRITE|PROT_EXEC", pgoff, + "MAP_PRIVATE|MAP_ANONYMOUS", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_remap_file_pages") + +#endif diff --git a/tests-mx32/remap_file_pages.test b/tests-mx32/remap_file_pages.test new file mode 100755 index 00000000..9d51a9a0 --- /dev/null +++ b/tests-mx32/remap_file_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check remap_file_pages syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/rename.c b/tests-mx32/rename.c new file mode 100644 index 00000000..2a2a4e01 --- /dev/null +++ b/tests-mx32/rename.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_rename + +# include +# include + +# define OLD_FILE "rename_old" +# define NEW_FILE "rename_new" + +int +main(void) +{ + long rc = syscall(__NR_rename, OLD_FILE, NEW_FILE); + printf("rename(\"%s\", \"%s\") = %ld %s (%m)\n", + OLD_FILE, NEW_FILE, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rename") + +#endif diff --git a/tests-mx32/rename.test b/tests-mx32/rename.test new file mode 100755 index 00000000..9067e4cc --- /dev/null +++ b/tests-mx32/rename.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rename syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/renameat.c b/tests-mx32/renameat.c new file mode 100644 index 00000000..2b874efa --- /dev/null +++ b/tests-mx32/renameat.c @@ -0,0 +1,31 @@ +#include "tests.h" +#include + +#ifdef __NR_renameat + +# include +# include + +# define OLD_FILE "renameat_old" +# define NEW_FILE "renameat_new" + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_renameat, fd_old, OLD_FILE, fd_new, NEW_FILE); + printf("renameat(%d, \"%s\", %d, \"%s\") = %ld %s (%m)\n", + (int) fd_old, OLD_FILE, (int) fd_new, NEW_FILE, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_renameat") + +#endif diff --git a/tests-mx32/renameat.test b/tests-mx32/renameat.test new file mode 100755 index 00000000..9b0a61dd --- /dev/null +++ b/tests-mx32/renameat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check renameat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/renameat2.c b/tests-mx32/renameat2.c new file mode 100644 index 00000000..33f88988 --- /dev/null +++ b/tests-mx32/renameat2.c @@ -0,0 +1,63 @@ +/* + * Check decoding of renameat2 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_renameat2 + +# include +# include + +int +main(void) +{ + static const char oldpath[] = "renameat2_oldpath"; + static const char newpath[] = "renameat2_newpath"; + const unsigned long olddirfd = + (unsigned long) 0xfacefeedffffffff; + const unsigned long newdirfd = + (unsigned long) 0xfacefeed00000000 | -100U; + + long rc = syscall(__NR_renameat2, + olddirfd, oldpath, newdirfd, newpath, 1); + printf("renameat2(%d, \"%s\", AT_FDCWD, \"%s\", RENAME_NOREPLACE)" + " = %ld %s (%m)\n", + (int) olddirfd, oldpath, newpath, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_renameat2") + +#endif diff --git a/tests-mx32/renameat2.test b/tests-mx32/renameat2.test new file mode 100755 index 00000000..4c176bbd --- /dev/null +++ b/tests-mx32/renameat2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check renameat2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/request_key.c b/tests-mx32/request_key.c new file mode 100644 index 00000000..fea977b2 --- /dev/null +++ b/tests-mx32/request_key.c @@ -0,0 +1,149 @@ +/* + * Check decoding of request_key syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_request_key + +# include +# include +# include + +void +print_val_str(const void *ptr, const char *str) +{ + if (str) + printf("%s, ", str); + else + printf("%p, ", ptr); +} + +void +do_request_key(const char *type, const char *type_str, const char *desc, + const char *desc_str, const char *info, const char *info_str, + int32_t keyring, const char *keyring_str) +{ + long rc = syscall(__NR_request_key, type, desc, info, keyring); + const char *errstr = sprintrc(rc); + printf("request_key("); + print_val_str(type, type_str); + print_val_str(desc, desc_str); + print_val_str(info, info_str); + if (keyring_str) + printf("%s", keyring_str); + else + printf("%d", keyring); + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char unterminated3[] = + { '\16', '\17', '\20', '\21', '\22' }; + + char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *bogus_info = tail_memdup(unterminated3, sizeof(unterminated3)); + + unsigned i; + unsigned j; + unsigned k; + unsigned l; + + struct { + const char *type; + const char *str; + } types[] = { + { ARG_STR(NULL) }, + { bogus_type + sizeof(unterminated1), NULL }, + { bogus_type, NULL }, + { ARG_STR("\20\21\22\23\24") }, + { ARG_STR("user") }, + }; + + struct { + const char *desc; + const char *str; + } descs[] = { + { ARG_STR(NULL) }, + { bogus_desc + sizeof(unterminated2), NULL }, + { bogus_desc, NULL }, + { ARG_STR("\25\26\27\30\31") }, + { ARG_STR("desc") }, + { "overly long description", _STR("overly long ") "..." }, + }; + + struct { + const char *info; + const char *str; + } infos[] = { + { ARG_STR(NULL) }, + { bogus_info + sizeof(unterminated3), NULL }, + { bogus_info, NULL }, + { ARG_STR("\32\33\34\35\36") }, + { ARG_STR("info") }, + { "overly long info", _STR("overly long ") "..." }, + }; + + struct { + uint32_t keyring; + const char *str; + } keyrings[] = { + { ARG_STR(0) }, + { ARG_STR(1234567890) }, + { ARG_STR(-1234567890) }, + { -1, "KEY_SPEC_THREAD_KEYRING" }, + }; + + for (i = 0; i < ARRAY_SIZE(types); i++) + for (j = 0; j < ARRAY_SIZE(descs); j++) + for (k = 0; k < ARRAY_SIZE(infos); k++) + for (l = 0; l < ARRAY_SIZE(keyrings); l++) + do_request_key( + types[i].type, types[i].str, + descs[j].desc, descs[j].str, + infos[k].info, infos[k].str, + keyrings[l].keyring, + keyrings[l].str); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_request_key"); + +#endif diff --git a/tests-mx32/request_key.test b/tests-mx32/request_key.test new file mode 100755 index 00000000..9812a18e --- /dev/null +++ b/tests-mx32/request_key.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of request_key syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -s12 diff --git a/tests-mx32/restart_syscall.c b/tests-mx32/restart_syscall.c new file mode 100644 index 00000000..e492e62e --- /dev/null +++ b/tests-mx32/restart_syscall.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int +main(void) +{ +#if defined __x86_64__ && defined __ILP32__ + /* + * x32 is broken from the beginning: + * https://lkml.org/lkml/2015/11/30/790 + */ + error_msg_and_skip("x32 is broken"); +#else + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = SIG_IGN }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + struct timespec req = { .tv_nsec = 222222222 }, rem; + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + if (nanosleep(&req, &rem)) + perror_msg_and_fail("nanosleep"); + + printf("nanosleep\\(\\{tv_sec=%jd, tv_nsec=%jd\\}, " + "\\{tv_sec=%jd, tv_nsec=%jd\\}\\)" + " = \\? ERESTART_RESTARTBLOCK \\(Interrupted by signal\\)\n", + (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, + (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec); + puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---"); +#ifdef __arm__ +/* old kernels used to overwrite ARM_r0 with -EINTR */ +# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|" +#else +# define ALTERNATIVE_NANOSLEEP_REQ "" +#endif + printf("(nanosleep\\((%s\\{tv_sec=%jd, tv_nsec=%jd\\}), " + "%p|restart_syscall\\(<\\.\\.\\." + " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n", + ALTERNATIVE_NANOSLEEP_REQ, + (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem); + + puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); + return 0; +#endif +} diff --git a/tests-mx32/restart_syscall.test b/tests-mx32/restart_syscall.test new file mode 100755 index 00000000..6dfda168 --- /dev/null +++ b/tests-mx32/restart_syscall.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check how "resuming interrupted nanosleep" works. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +syscalls=nanosleep,restart_syscall +run_strace -a20 -e trace=$syscalls $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/rmdir.c b/tests-mx32/rmdir.c new file mode 100644 index 00000000..20952d84 --- /dev/null +++ b/tests-mx32/rmdir.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_rmdir + +# include +# include + +int +main(void) +{ + static const char sample[] = "rmdir_sample"; + long rc = syscall(__NR_rmdir, sample); + printf("rmdir(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rmdir") + +#endif diff --git a/tests-mx32/rmdir.test b/tests-mx32/rmdir.test new file mode 100755 index 00000000..81ee66b8 --- /dev/null +++ b/tests-mx32/rmdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rmdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/rt_sigpending.c b/tests-mx32/rt_sigpending.c new file mode 100644 index 00000000..accf6913 --- /dev/null +++ b/tests-mx32/rt_sigpending.c @@ -0,0 +1,128 @@ +/* + * This file is part of rt_sigpending strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigpending + +# include +# include +# include +# include +# include + +static long +k_sigpending(void *const set, const unsigned long size) +{ + return syscall(__NR_rt_sigpending, set, size); +} + +static void +iterate(const char *const text, unsigned int size, void *set) +{ + for (;;) { + if (k_sigpending(set, size)) { + tprintf("rt_sigpending(%p, %u) = -1 EFAULT (%m)\n", + set, size); + break; + } + if (size) { +#if WORDS_BIGENDIAN + if (size < sizeof(long)) + tprintf("rt_sigpending(%s, %u) = 0\n", + "[]", size); + else +#endif + tprintf("rt_sigpending(%s, %u) = 0\n", + text, size); + } else { + tprintf("rt_sigpending(%p, %u) = 0\n", set, size); + break; + } + size >>= 1; + set += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + + sigemptyset(libc_set); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + memset(k_set, 0, big_size); + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + if (!k_sigpending(k_set, set_size)) + break; + tprintf("rt_sigpending(%p, %u) = -1 EINVAL (%m)\n", + k_set, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigpending"); + tprintf("rt_sigpending(%s, %u) = 0\n", "[]", set_size); + + iterate("[]", set_size >> 1, k_set + (set_size >> 1)); + + void *const efault = k_set + (set_size >> 1); + assert(k_sigpending(efault, set_size) == -1); + tprintf("rt_sigpending(%p, %u) = -1 EFAULT (%m)\n", + efault, set_size); + + sigaddset(libc_set, SIGHUP); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGHUP); + + iterate("[HUP]", set_size, k_set); + + sigaddset(libc_set, SIGINT); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGINT); + + iterate("[HUP INT]", set_size, k_set); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigpending") + +#endif diff --git a/tests-mx32/rt_sigpending.test b/tests-mx32/rt_sigpending.test new file mode 100755 index 00000000..40c83a81 --- /dev/null +++ b/tests-mx32/rt_sigpending.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigpending syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/rt_sigprocmask.c b/tests-mx32/rt_sigprocmask.c new file mode 100644 index 00000000..27e357fa --- /dev/null +++ b/tests-mx32/rt_sigprocmask.c @@ -0,0 +1,174 @@ +/* + * This file is part of rt_sigprocmask strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigprocmask + +# include +# include +# include +# include +# include + +static long +k_sigprocmask(const unsigned long how, void *const new_set, + void *const old_set, const unsigned long size) +{ + return syscall(__NR_rt_sigprocmask, how, new_set, old_set, size); +} + +static void +iterate(const char *const text, void *set, void *old, unsigned int size) +{ + for (;;) { + if (k_sigprocmask(SIG_UNBLOCK, set, old, size)) { + if (size < sizeof(long)) + tprintf("rt_sigprocmask(SIG_UNBLOCK" + ", %p, %p, %u) = -1 EINVAL (%m)\n", + set, old, size); + else + tprintf("rt_sigprocmask(SIG_UNBLOCK" + ", %s, %p, %u) = -1 EINVAL (%m)\n", + text, old, size); + } else { + tprintf("rt_sigprocmask(SIG_UNBLOCK, %s, [], %u)" + " = 0\n", text, size); + } + if (!size) + break; + size >>= 1; + set += size; + old += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + unsigned int set_size; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!k_sigprocmask(SIG_SETMASK, NULL, NULL, set_size)) + break; + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, NULL, %u)" + " = -1 EINVAL (%m)\n", set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, NULL, %u) = 0\n", + set_size); + + void *const k_set = tail_alloc(set_size); + void *const old_set = tail_alloc(set_size); + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + + memset(k_set, 0, set_size); + if (k_sigprocmask(SIG_SETMASK, k_set, NULL, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, [], NULL, %u) = 0\n", set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set - set_size, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[], [], %u) = 0\n", set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set - set_size, + old_set, set_size << 1) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %p, %p, %u) = -1 EINVAL (%m)\n", + k_set - set_size, old_set, set_size << 1); + + iterate("~[]", k_set - set_size, old_set, set_size >> 1); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_BLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_BLOCK, [HUP], [], %u) = 0\n", set_size); + + memset(libc_set, -1, sizeof(sigset_t)); + sigdelset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[HUP], [HUP], %u) = 0\n", + set_size); + + sigdelset(libc_set, SIGKILL); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[HUP KILL], [HUP], %u) = 0\n", + set_size); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + sigaddset(libc_set, SIGINT); + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_BLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_BLOCK, %s, [HUP], %u) = 0\n", + "[HUP INT QUIT ALRM TERM]", set_size); + + if (k_sigprocmask(SIG_SETMASK, NULL, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, %s, %u) = 0\n", + "[HUP INT QUIT ALRM TERM]", set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set + (set_size >> 1), NULL, + set_size) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %p, NULL, %u) = -1 EFAULT (%m)\n", + k_set + (set_size >> 1), set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set, old_set + (set_size >> 1), + set_size) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %s, %p, %u) = -1 EFAULT (%m)\n", + "[HUP INT QUIT ALRM TERM]", + old_set + (set_size >> 1), set_size); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") + +#endif diff --git a/tests-mx32/rt_sigprocmask.test b/tests-mx32/rt_sigprocmask.test new file mode 100755 index 00000000..1e60ebde --- /dev/null +++ b/tests-mx32/rt_sigprocmask.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigprocmask syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/rt_sigqueueinfo.c b/tests-mx32/rt_sigqueueinfo.c new file mode 100644 index 00000000..aba6776c --- /dev/null +++ b/tests-mx32/rt_sigqueueinfo.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main (void) +{ + struct sigaction sa = { + .sa_handler = SIG_IGN + }; + union sigval value = { + .sival_ptr = (void *) (unsigned long) 0xdeadbeefbadc0dedULL + }; + pid_t pid = getpid(); + + assert(sigaction(SIGUSR1, &sa, NULL) == 0); + if (sigqueue(pid, SIGUSR1, value)) + perror_msg_and_skip("sigqueue"); + printf("rt_sigqueueinfo(%u, SIGUSR1, {si_signo=SIGUSR1, " + "si_code=SI_QUEUE, si_pid=%u, si_uid=%u, " + "si_value={int=%d, ptr=%p}}) = 0\n", + pid, pid, getuid(), value.sival_int, value.sival_ptr); + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-mx32/rt_sigqueueinfo.test b/tests-mx32/rt_sigqueueinfo.test new file mode 100755 index 00000000..c03c76f2 --- /dev/null +++ b/tests-mx32/rt_sigqueueinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of rt_sigqueueinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/rt_sigsuspend.c b/tests-mx32/rt_sigsuspend.c new file mode 100644 index 00000000..73e13364 --- /dev/null +++ b/tests-mx32/rt_sigsuspend.c @@ -0,0 +1,165 @@ +/* + * This file is part of rt_sigsuspend strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigsuspend + +# include +# include +# include +# include +# include +# include +# include + +static long +k_sigsuspend(const sigset_t *const set, const unsigned long size) +{ + return syscall(__NR_rt_sigsuspend, set, size); +} + +static void +iterate(const char *const text, const int sig, + const void *const set, unsigned int size) +{ + const void *mask; + + for (mask = set;; size >>= 1, mask += size) { + raise(sig); + assert(k_sigsuspend(mask, size) == -1); + if (EINTR == errno) { + tprintf("rt_sigsuspend(%s, %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", + text, size); + } else { + if (size < sizeof(long)) + tprintf("rt_sigsuspend(%p, %u)" + " = -1 EINVAL (%m)\n", + mask, size); + else + tprintf("rt_sigsuspend(%s, %u)" + " = -1 EINVAL (%m)\n", + set == mask ? text : "~[]", size); + } + if (!size) + break; + } +} + +static void +handler(int signo) +{ +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + memset(k_set, 0, big_size); + + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + sigemptyset(libc_set); + sigaddset(libc_set, SIGUSR1); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct sigaction sa = { + .sa_handler = handler + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGUSR1); + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + assert(k_sigsuspend(k_set, set_size) == -1); + if (EINTR == errno) + break; + tprintf("rt_sigsuspend(%p, %u) = -1 EINVAL (%m)\n", + k_set, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigsuspend"); + tprintf("rt_sigsuspend([], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGUSR2); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([HUP USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigaddset(libc_set, SIGINT); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([HUP INT USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + memset(libc_set, -1, sizeof(*libc_set)); + sigdelset(libc_set, SIGUSR1); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend(~[USR1], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + assert(k_sigsuspend(k_set - set_size, set_size << 1) == -1); + tprintf("rt_sigsuspend(%p, %u) = -1 EINVAL (%m)\n", + k_set - set_size, set_size << 1); + + iterate("~[USR1]", SIGUSR1, k_set, set_size >> 1); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigsuspend") + +#endif diff --git a/tests-mx32/rt_sigsuspend.test b/tests-mx32/rt_sigsuspend.test new file mode 100755 index 00000000..2e30fd4b --- /dev/null +++ b/tests-mx32/rt_sigsuspend.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigsuspend syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -esignal=none diff --git a/tests-mx32/rt_sigtimedwait.c b/tests-mx32/rt_sigtimedwait.c new file mode 100644 index 00000000..10311e6e --- /dev/null +++ b/tests-mx32/rt_sigtimedwait.c @@ -0,0 +1,185 @@ +/* + * This file is part of rt_sigtimedwait strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigtimedwait + +# include +# include +# include +# include +# include +# include +# include + +static long +k_sigtimedwait(const sigset_t *const set, siginfo_t *const info, + const struct timespec *const timeout, const unsigned long size) +{ + return syscall(__NR_rt_sigtimedwait, set, info, timeout, size); +} + +static void +iterate(const char *const text, const void *set, + const struct timespec *const timeout, unsigned int size) +{ + for (;;) { + assert(k_sigtimedwait(set, NULL, timeout, size) == -1); + if (EINTR == errno) { + tprintf("rt_sigtimedwait(%s, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EAGAIN (%m)\n", text, + (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, + size); + } else { + if (size < sizeof(long)) + tprintf("rt_sigtimedwait(%p, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}" + ", %u) = -1 EINVAL (%m)\n", + set, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, size); + else + tprintf("rt_sigtimedwait(%s, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}" + ", %u) = -1 EINVAL (%m)\n", + text, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, size); + } + if (!size) + break; + size >>= 1; + set += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + siginfo_t *const info = tail_alloc(sizeof(*info)); + struct timespec *const timeout = tail_alloc(sizeof(*timeout)); + timeout->tv_sec = 0; + timeout->tv_nsec = 42; + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + memset(k_set, 0, big_size); + + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + if (EAGAIN == errno) + break; + tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EINVAL (%m)\n", + k_set, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigtimedwait"); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + set_size); + + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + sigaddset(libc_set, SIGINT); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + "[HUP INT QUIT ALRM TERM]", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + memset(k_set - set_size, -1, set_size); + assert(k_sigtimedwait(k_set - set_size, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + assert(k_sigtimedwait(k_set - set_size, info, NULL, set_size << 1) == -1); + tprintf("rt_sigtimedwait(%p, %p, NULL, %u) = -1 EINVAL (%m)\n", + k_set - set_size, info, set_size << 1); + + iterate("~[]", k_set - set_size, timeout, set_size >> 1); + + timeout->tv_sec = 1; + raise(SIGALRM); + assert(k_sigtimedwait(k_set, info, timeout, set_size) == SIGALRM); + tprintf("rt_sigtimedwait(%s, {si_signo=%s, si_code=SI_TKILL" + ", si_pid=%d, si_uid=%d}, {tv_sec=%jd, tv_nsec=%jd}, %u) = %d (%s)\n", + "[HUP INT QUIT ALRM TERM]", "SIGALRM", getpid(), getuid(), + (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + set_size, SIGALRM, "SIGALRM"); + + raise(SIGALRM); + assert(k_sigtimedwait(k_set, NULL, NULL, set_size) == SIGALRM); + tprintf("rt_sigtimedwait(%s, NULL, NULL, %u) = %d (%s)\n", + "[HUP INT QUIT ALRM TERM]", set_size, SIGALRM, "SIGALRM"); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigtimedwait") + +#endif diff --git a/tests-mx32/rt_sigtimedwait.test b/tests-mx32/rt_sigtimedwait.test new file mode 100755 index 00000000..e15fb779 --- /dev/null +++ b/tests-mx32/rt_sigtimedwait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigtimedwait syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-mx32/rt_tgsigqueueinfo.c b/tests-mx32/rt_tgsigqueueinfo.c new file mode 100644 index 00000000..ec093481 --- /dev/null +++ b/tests-mx32/rt_tgsigqueueinfo.c @@ -0,0 +1,88 @@ +/* + * This file is part of rt_tgsigqueueinfo strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_tgsigqueueinfo + +# include +# include +# include +# include +# include + +static long +k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info) +{ + return syscall(__NR_rt_tgsigqueueinfo, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | sig, + info); +} + +int +main (void) +{ + const struct sigaction sa = { + .sa_handler = SIG_IGN + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + siginfo_t *const info = tail_alloc(sizeof(*info)); + memset(info, 0, sizeof(*info)); + info->si_signo = SIGUSR1; + info->si_errno = ENOENT; + info->si_code = SI_QUEUE; + info->si_pid = getpid(); + info->si_uid = getuid(); + info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL; + + if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info)) + (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)( + "rt_tgsigqueueinfo"); + + printf("rt_tgsigqueueinfo(%u, %u, %s, {si_signo=%s" + ", si_code=SI_QUEUE, si_errno=ENOENT, si_pid=%u" + ", si_uid=%u, si_value={int=%d, ptr=%p}}) = 0\n", + info->si_pid, info->si_pid, "SIGUSR1", "SIGUSR1", + info->si_pid, info->si_uid, info->si_value.sival_int, + info->si_value.sival_ptr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_tgsigqueueinfo") + +#endif diff --git a/tests-mx32/rt_tgsigqueueinfo.test b/tests-mx32/rt_tgsigqueueinfo.test new file mode 100755 index 00000000..ab24e2d6 --- /dev/null +++ b/tests-mx32/rt_tgsigqueueinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of rt_tgsigqueueinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/run.sh b/tests-mx32/run.sh new file mode 100755 index 00000000..02d99123 --- /dev/null +++ b/tests-mx32/run.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +. "${srcdir=.}/init.sh" + +$STRACE -V > /dev/null || + framework_failure_ "$STRACE is not available" + +TIMEOUT="timeout -s 9 $TIMEOUT_DURATION" +$TIMEOUT true > /dev/null 2>&1 || + TIMEOUT= + +exec $TIMEOUT "$@" diff --git a/tests-mx32/sched_get_priority_mxx.c b/tests-mx32/sched_get_priority_mxx.c new file mode 100644 index 00000000..fc14b27c --- /dev/null +++ b/tests-mx32/sched_get_priority_mxx.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#if defined(__NR_sched_get_priority_min) \ + && defined(__NR_sched_get_priority_max) + +# include +# include +# include + +int +main(void) +{ + int rc = syscall(__NR_sched_get_priority_min, SCHED_FIFO); + printf("sched_get_priority_min(SCHED_FIFO) = %d\n", rc); + + rc = syscall(__NR_sched_get_priority_max, SCHED_RR); + printf("sched_get_priority_max(SCHED_RR) = %d\n", rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min" + " && defined __NR_sched_get_priority_max"); + +#endif diff --git a/tests-mx32/sched_get_priority_mxx.test b/tests-mx32/sched_get_priority_mxx.test new file mode 100755 index 00000000..0d1a1a78 --- /dev/null +++ b/tests-mx32/sched_get_priority_mxx.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_get_priority_min and sched_get_priority_max syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests-mx32/sched_rr_get_interval.c b/tests-mx32/sched_rr_get_interval.c new file mode 100644 index 00000000..0aacd2b7 --- /dev/null +++ b/tests-mx32/sched_rr_get_interval.c @@ -0,0 +1,42 @@ +#include "tests.h" +#include + +#ifdef __NR_sched_rr_get_interval + +# include +# include +# include +# include + +int +main(void) +{ + struct timespec *const tp = tail_alloc(sizeof(struct timespec)); + long rc; + + rc = syscall(__NR_sched_rr_get_interval, 0, NULL); + printf("sched_rr_get_interval(0, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, 0, tp + 1); + printf("sched_rr_get_interval(0, %p) = %s\n", tp + 1, sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, -1, tp); + printf("sched_rr_get_interval(-1, %p) = %s\n", tp, sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, 0, tp); + if (rc == 0) + printf("sched_rr_get_interval(0, {tv_sec=%jd, tv_nsec=%jd}) = " + "0\n", (intmax_t)tp->tv_sec, (intmax_t)tp->tv_nsec); + else + printf("sched_rr_get_interval(-1, %p) = %s\n", tp, + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_rr_get_interval") + +#endif diff --git a/tests-mx32/sched_rr_get_interval.test b/tests-mx32/sched_rr_get_interval.test new file mode 100755 index 00000000..828ba5d0 --- /dev/null +++ b/tests-mx32/sched_rr_get_interval.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_rr_get_interval syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-mx32/sched_xetaffinity.c b/tests-mx32/sched_xetaffinity.c new file mode 100644 index 00000000..41a18202 --- /dev/null +++ b/tests-mx32/sched_xetaffinity.c @@ -0,0 +1,135 @@ +/* + * This file is part of sched_xetaffinity strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_sched_getaffinity && defined __NR_sched_setaffinity \ + && defined CPU_ISSET_S && defined CPU_ZERO_S && defined CPU_SET_S + +# include +# include +# include +# include + +static const char *errstr; + +static int +getaffinity(unsigned long pid, unsigned long size, void *set) +{ + int rc = syscall(__NR_sched_getaffinity, pid, size, set); + errstr = sprintrc(rc); + return rc; +} + +static int +setaffinity(unsigned long pid, unsigned long size, void *set) +{ + int rc = syscall(__NR_sched_setaffinity, pid, size, set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + unsigned int cpuset_size = 1; + const pid_t pid = getpid(); + + while (cpuset_size) { + assert(getaffinity(pid, cpuset_size, NULL) == -1); + if (EFAULT == errno) + break; + if (EINVAL != errno) + perror_msg_and_skip("sched_getaffinity"); + printf("sched_getaffinity(%d, %u, NULL) = %s\n", + pid, cpuset_size, errstr); + cpuset_size <<= 1; + } + assert(cpuset_size); + printf("sched_getaffinity(%d, %u, NULL) = %s\n", + pid, cpuset_size, errstr); + + cpu_set_t *cpuset = tail_alloc(cpuset_size); + getaffinity(pid, cpuset_size, cpuset + 1); + printf("sched_getaffinity(%d, %u, %p) = %s\n", + pid, cpuset_size, cpuset + 1, errstr); + + int ret_size = getaffinity(pid, cpuset_size, cpuset); + if (ret_size < 0) + perror_msg_and_fail("sched_getaffinity(%d, %u, %p) = %s\n", + pid, (unsigned) cpuset_size, cpuset, errstr); + assert(ret_size <= (int) cpuset_size); + + printf("sched_getaffinity(%d, %u, [", pid, cpuset_size); + const char *sep; + unsigned int i, cpu; + for (i = 0, cpu = 0, sep = ""; i < (unsigned) ret_size * 8; ++i) { + if (CPU_ISSET_S(i, (unsigned) ret_size, cpuset)) { + printf("%s%u", sep, i); + sep = ", "; + cpu = i; + } + } + printf("]) = %s\n", errstr); + + CPU_ZERO_S(cpuset_size, cpuset); + CPU_SET_S(cpu, cpuset_size, cpuset); + if (setaffinity(pid, cpuset_size, cpuset)) + perror_msg_and_skip("sched_setaffinity"); + printf("sched_setaffinity(%d, %u, [%u]) = 0\n", + pid, cpuset_size, cpu); + + const unsigned int big_size = cpuset_size < 128 ? 128 : cpuset_size * 2; + cpuset = tail_alloc(big_size); + ret_size = getaffinity(pid, big_size, cpuset); + if (ret_size < 0) + perror_msg_and_fail("sched_getaffinity(%d, %u, %p) = %s\n", + pid, big_size, cpuset, errstr); + assert(ret_size <= (int) big_size); + printf("sched_getaffinity(%d, %u, [", pid, big_size); + for (i = 0, sep = ""; i < (unsigned) ret_size * 8; ++i) { + if (CPU_ISSET_S(i, (unsigned) ret_size, cpuset)) { + printf("%s%u", sep, i); + sep = ", "; + } + } + printf("]) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getaffinity && __NR_sched_setaffinity" + " && CPU_ISSET_S && CPU_ZERO_S && CPU_SET_S") + +#endif diff --git a/tests-mx32/sched_xetaffinity.test b/tests-mx32/sched_xetaffinity.test new file mode 100755 index 00000000..246ea21a --- /dev/null +++ b/tests-mx32/sched_xetaffinity.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getaffinity and sched_setaffinity syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests-mx32/sched_xetattr.c b/tests-mx32/sched_xetattr.c new file mode 100644 index 00000000..1b484915 --- /dev/null +++ b/tests-mx32/sched_xetattr.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_sched_getattr && defined __NR_sched_setattr + +# include +# include +# include + +int +main(void) +{ + struct { + uint32_t size; + uint32_t sched_policy; + uint64_t sched_flags; + int32_t sched_nice; + uint32_t sched_priority; + uint64_t sched_runtime; + uint64_t sched_deadline; + uint64_t sched_period; + } *sched_attr = tail_alloc(sizeof(*sched_attr)); + + long rc = syscall(__NR_sched_getattr, 0xdeadface, NULL, 0, 0); + printf("sched_getattr\\(%d, NULL, 0, 0\\) += %s\n", + 0xdeadface, sprintrc_grep(rc)); + + rc = syscall(__NR_sched_getattr, -1, + sched_attr, 0xbadfaced, 0xc0defeed); + printf("sched_getattr\\(-1, %p, %u, %u\\) += %s\n", + sched_attr, 0xbadfaced, 0xc0defeed, sprintrc_grep(rc)); + + rc = syscall(__NR_sched_getattr, 0, + sched_attr + 1, sizeof(*sched_attr), 0); + printf("sched_getattr\\(0, %p, %u, 0\\) += %s\n", + sched_attr + 1, (unsigned)sizeof(*sched_attr), + sprintrc_grep(rc)); + + if (syscall(__NR_sched_getattr, 0, sched_attr, sizeof(*sched_attr), 0)) + perror_msg_and_skip("sched_getattr"); + + printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" + ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "\\}, %u, 0\\) += 0\n", + sched_attr->size, + sched_attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period, + (unsigned) sizeof(*sched_attr)); + + sched_attr->sched_flags |= 1; + if (syscall(__NR_sched_setattr, 0, sched_attr, 0)) + perror_msg_and_skip("sched_setattr"); + + printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" + ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n", + sched_attr->size, + "SCHED_FLAG_RESET_ON_FORK", + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period); + + sched_attr->size = 0x90807060; + sched_attr->sched_policy = 0xca7faced; + sched_attr->sched_flags = 0xbadc0ded1057da7aULL; + sched_attr->sched_nice = 0xafbfcfdf; + sched_attr->sched_priority = 0xb8c8d8e8; + sched_attr->sched_runtime = 0xbadcaffedeadf157ULL; + sched_attr->sched_deadline = 0xc0de70a57badac75ULL; + sched_attr->sched_period = 0xded1ca7edda7aca7ULL; + + rc = syscall(__NR_sched_setattr, 0xfacec0de, sched_attr, 0xbeeff00d); + + printf("sched_setattr\\(%d, \\{size=%u, " + "sched_policy=%#x /\\* SCHED_\\?\\?\\? \\*/, " + "sched_flags=%#" PRIx64 " /\\* SCHED_FLAG_\\?\\?\\? \\*/, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, " + "%u\\) += %s\n", + 0xfacec0de, sched_attr->size, + sched_attr->sched_policy, + sched_attr->sched_flags, + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period, 0xbeeff00d, sprintrc_grep(rc)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getattr && __NR_sched_setattr") + +#endif diff --git a/tests-mx32/sched_xetattr.test b/tests-mx32/sched_xetattr.test new file mode 100755 index 00000000..c2c7914c --- /dev/null +++ b/tests-mx32/sched_xetattr.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check sched_getattr and sched_setattr syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e sched_getattr,sched_setattr $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/sched_xetparam.c b/tests-mx32/sched_xetparam.c new file mode 100644 index 00000000..e761a9d0 --- /dev/null +++ b/tests-mx32/sched_xetparam.c @@ -0,0 +1,33 @@ +#include "tests.h" +#include + +#if defined __NR_sched_getparam && defined __NR_sched_setparam + +# include +# include +# include + +int +main(void) +{ + struct sched_param *const param = + tail_alloc(sizeof(struct sched_param)); + + long rc = syscall(__NR_sched_getparam, 0, param); + printf("sched_getparam(0, [%d]) = %ld\n", + param->sched_priority, rc); + + param->sched_priority = -1; + rc = syscall(__NR_sched_setparam, 0, param); + printf("sched_setparam(0, [%d]) = %ld %s (%m)\n", + param->sched_priority, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getparam && __NR_sched_setparam") + +#endif diff --git a/tests-mx32/sched_xetparam.test b/tests-mx32/sched_xetparam.test new file mode 100755 index 00000000..c9fede13 --- /dev/null +++ b/tests-mx32/sched_xetparam.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getparam and sched_setparam syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests-mx32/sched_xetscheduler.c b/tests-mx32/sched_xetscheduler.c new file mode 100644 index 00000000..7faee8cd --- /dev/null +++ b/tests-mx32/sched_xetscheduler.c @@ -0,0 +1,81 @@ +#include "tests.h" +#include + +#if defined __NR_sched_getscheduler && defined __NR_sched_setscheduler + +# include +# include +# include + +int +main(void) +{ + struct sched_param *const param = tail_alloc(sizeof(struct sched_param)); + long rc = syscall(__NR_sched_getscheduler, 0); + const char *scheduler; + switch (rc) { + case SCHED_FIFO: + scheduler = "SCHED_FIFO"; + break; + case SCHED_RR: + scheduler = "SCHED_RR"; + break; +# ifdef SCHED_BATCH + case SCHED_BATCH: + scheduler = "SCHED_BATCH"; + break; +# endif +# ifdef SCHED_IDLE + case SCHED_IDLE: + scheduler = "SCHED_IDLE"; + break; +# endif +# ifdef SCHED_ISO + case SCHED_ISO: + scheduler = "SCHED_ISO"; + break; +# endif +# ifdef SCHED_DEADLINE + case SCHED_DEADLINE: + scheduler = "SCHED_DEADLINE"; + break; +# endif + default: + scheduler = "SCHED_OTHER"; + } + printf("sched_getscheduler(0) = %ld (%s)\n", + rc, scheduler); + + rc = syscall(__NR_sched_getscheduler, -1); + printf("sched_getscheduler(-1) = %s\n", sprintrc(rc)); + + param->sched_priority = -1; + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, NULL); + printf("sched_setscheduler(0, SCHED_FIFO, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param + 1); + printf("sched_setscheduler(0, SCHED_FIFO, %p) = %s\n", param + 1, + sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, 0xfaceda7a, param); + printf("sched_setscheduler(0, %#x /* SCHED_??? */, [%d]) = %s\n", + 0xfaceda7a, param->sched_priority, sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, -1, SCHED_FIFO, param); + printf("sched_setscheduler(-1, SCHED_FIFO, [%d]) = %s\n", + param->sched_priority, sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param); + printf("sched_setscheduler(0, SCHED_FIFO, [%d]) = %s\n", + param->sched_priority, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getscheduler && __NR_sched_setscheduler") + +#endif diff --git a/tests-mx32/sched_xetscheduler.test b/tests-mx32/sched_xetscheduler.test new file mode 100755 index 00000000..07c93f31 --- /dev/null +++ b/tests-mx32/sched_xetscheduler.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getscheduler and sched_setscheduler syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests-mx32/sched_yield.c b/tests-mx32/sched_yield.c new file mode 100644 index 00000000..355e7e8d --- /dev/null +++ b/tests-mx32/sched_yield.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_sched_yield + +# include +# include + +int +main(void) +{ + printf("sched_yield() = %ld\n", syscall(__NR_sched_yield)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_yield") + +#endif diff --git a/tests-mx32/sched_yield.test b/tests-mx32/sched_yield.test new file mode 100755 index 00000000..f0c2c303 --- /dev/null +++ b/tests-mx32/sched_yield.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_yield syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/scm_rights-fd.test b/tests-mx32/scm_rights-fd.test new file mode 100755 index 00000000..8447375f --- /dev/null +++ b/tests-mx32/scm_rights-fd.test @@ -0,0 +1,80 @@ +#!/bin/sh +# +# Check how SCM_RIGHTS and SCM_CREDENTIALS control messages are decoded in -y mode. +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -y is implemented using /proc/$pid/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog mkdir +check_prog rm +check_prog seq +check_prog touch + +dir="$LOG.dir" +rm -rf -- "$dir" +mkdir -- "$dir" || + framework_skip_ 'failed to create a directory' + +file="$dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" + +touch -- "$file" || + framework_skip_ 'failed to create a file' + +run_prog ./scm_rights /dev/zero +run_strace -y -x -enetwork $args "$file" + +hex='[[:xdigit:]]' +n='[1-9][0-9]*' +sample="$(for i in $(seq 1 15); do printf '\\\\xf%x' $i; done)" +socket='' + +path6='(/.*/(A\\n){127}Z|\\x2f(\\x'"$hex$hex"')*\\x2f(\\x41\\x0a){127}\\x5a)' +rights_data='\[4, 5, 6<'"$path6"'>\]' +iov='\[\{iov_base="'"$sample"'", iov_len=15\}\]' +ids='\{pid='"$n"', uid=[0-9]+, gid=[0-9]+\}' + +msg_head='\{msg_name=NULL, msg_namelen=0, msg_iov='"$iov"', msg_iovlen=1, msg_control=' +msg_tail=', msg_controllen='"$n"', msg_flags=0' +rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data='"$rights_data"'\}' +creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data='"$ids"'\}' + +EXPECTED="$LOG.expected" + +cat > "$EXPECTED" << __EOF__ +sendmsg\\(3$socket, $msg_head\\[$rights\\]$msg_tail\\}, 0\\) = 15 +recvmsg\\(0$socket, $msg_head\\[$creds, $rights\\]$msg_tail\\}, 0\\) = 15 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" +rm -rf -- "$dir" + +exit 0 diff --git a/tests-mx32/scm_rights.c b/tests-mx32/scm_rights.c new file mode 100644 index 00000000..42caed7c --- /dev/null +++ b/tests-mx32/scm_rights.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int main(int ac, const char **av) +{ + assert(ac > 0); + int fds[ac]; + + static const char sample[] = + "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + const unsigned int data_size = sizeof(sample) - 1; + void *data = tail_alloc(data_size); + memcpy(data, sample, data_size); + + struct iovec *iov = tail_alloc(sizeof(struct iovec)); + iov->iov_base = data; + iov->iov_len = data_size; + + struct msghdr *mh = tail_alloc(sizeof(struct msghdr)); + memset(mh, 0, sizeof(*mh)); + mh->msg_iov = iov; + mh->msg_iovlen = 1; + + int i; + while ((i = open("/dev/null", O_RDWR)) <= ac + 2) + assert(i >= 0); + while (i > 2) + assert(close(i--) == 0); + assert(close(0) == 0); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + int one = 1; + if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one))) + perror_msg_and_skip("setsockopt"); + + assert((fds[0] = open("/dev/null", O_RDWR)) == 4); + for (i = 1; i < ac; ++i) + assert((fds[i] = open(av[i], O_RDONLY)) == i + 4); + + unsigned int cmsg_size = CMSG_SPACE(sizeof(fds)); + struct cmsghdr *cmsg = tail_alloc(cmsg_size); + memset(cmsg, 0, cmsg_size); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(fds)); + memcpy(CMSG_DATA(cmsg), fds, sizeof(fds)); + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg_size; + + assert(sendmsg(sv[1], mh, 0) == (int) data_size); + + assert(close(sv[1]) == 0); + assert(open("/dev/null", O_RDWR) == sv[1]); + + for (i = 0; i < ac; ++i) { + assert(close(fds[i]) == 0); + fds[i] = 0; + } + + cmsg_size += CMSG_SPACE(sizeof(struct ucred)); + cmsg = tail_alloc(cmsg_size); + memset(cmsg, 0, cmsg_size); + mh->msg_control = cmsg; + mh->msg_controllen = cmsg_size; + + assert(recvmsg(0, mh, 0) == (int) data_size); + assert(close(0) == 0); + + return 0; +} diff --git a/tests-mx32/scno_tampering.sh b/tests-mx32/scno_tampering.sh new file mode 100755 index 00000000..6aa78432 --- /dev/null +++ b/tests-mx32/scno_tampering.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Skip the test if arch+kernel combination is not supported. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +uname_r="$(uname -r)" +case "$STRACE_ARCH" in + arm) + # PTRACE_SET_SYSCALL is supported by linux kernel + # starting with commit v2.6.16-rc1~107^2. + require_min_kernel_version_or_skip 2.6.16 ;; + aarch64) + # NT_ARM_SYSTEM_CALL regset is supported by linux kernel + # starting with commit v3.19-rc1~59^2~16. + require_min_kernel_version_or_skip 3.19 ;; + hppa) + # Syscall number and return value modification did not work + # properly before commit v4.5-rc7~31^2~1. + require_min_kernel_version_or_skip 4.5 ;; + sparc*) + # Reloading the syscall number from %g1 register is supported + # by linux kernel starting with commit v4.5-rc7~35^2~3. + require_min_kernel_version_or_skip 4.5 ;; + mips) + # Only the native ABI is supported by the kernel properly, see + # https://sourceforge.net/p/strace/mailman/message/35587571/ + uname_m="$(uname -m)" + case "$MIPS_ABI:$uname_m" in + o32:mips|n64:mips64) ;; + *) skip_ "$MIPS_ABI scno tampering does not work on $uname_m yet" ;; + esac ;; +esac diff --git a/tests-mx32/seccomp-filter-v.c b/tests-mx32/seccomp-filter-v.c new file mode 100644 index 00000000..dbf686d1 --- /dev/null +++ b/tests-mx32/seccomp-filter-v.c @@ -0,0 +1,213 @@ +/* + * Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#ifdef HAVE_PRCTL +# include +#endif +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined __NR_seccomp \ + && defined PR_SET_NO_NEW_PRIVS \ + && defined SECCOMP_SET_MODE_FILTER \ + && defined SECCOMP_RET_ERRNO \ + && defined BPF_JUMP \ + && defined BPF_STMT + +#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) + +#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) + +#define SOCK_FILTER_KILL_PROCESS \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) + +#define PRINT_ALLOW_SYSCALL(nr) \ + tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ + __NR_ ## nr) + +#define PRINT_DENY_SYSCALL(nr, err) \ + tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ + __NR_ ## nr, err) + +static const struct sock_filter filter_c[] = { + /* load syscall number */ + BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), + + /* allow syscalls */ + SOCK_FILTER_ALLOW_SYSCALL(close), + SOCK_FILTER_ALLOW_SYSCALL(exit), + SOCK_FILTER_ALLOW_SYSCALL(exit_group), + + /* deny syscalls */ + SOCK_FILTER_DENY_SYSCALL(sync, EBUSY), + SOCK_FILTER_DENY_SYSCALL(setsid, EPERM), + + /* kill process */ + SOCK_FILTER_KILL_PROCESS +}; + +#ifndef BPF_MAXINSNS +# define BPF_MAXINSNS 4096 +#endif + +int +main(void) +{ + tprintf("%s", ""); + + static const char kill_stmt_txt[] = + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"; + struct sock_filter *const filter = + tail_memdup(filter_c, sizeof(filter_c)); + struct sock_filter *const big_filter = + tail_alloc(sizeof(*big_filter) * (BPF_MAXINSNS + 1)); + struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + perror_msg_and_skip("PR_SET_NO_NEW_PRIVS"); + + prog->filter = filter + ARRAY_SIZE(filter_c); + prog->len = 1; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=1, filter=%p})" + " = -1 EFAULT (%m)\n", prog->filter); + + prog->filter = filter + ARRAY_SIZE(filter_c) - 1; + prog->len = 3; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u" + ", filter=[%s, %p]}) = -1 EFAULT (%m)\n", + prog->len, kill_stmt_txt, filter + ARRAY_SIZE(filter_c)); + + prog->len = 0; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=0, filter=[]})" + " = -1 EINVAL (%m)\n"); + + unsigned int i; + for (i = 0; i <= BPF_MAXINSNS; ++i) { + const struct sock_filter stmt = + BPF_STMT(BPF_CLASS(i), i << 16); + big_filter[i] = stmt; + } + + prog->filter = big_filter; + prog->len = BPF_MAXINSNS + 1; + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=[", + "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", prog->len); + for (i = 0; i < BPF_MAXINSNS; ++i) { + if (i) + tprintf(", "); + switch(BPF_CLASS(i)) { + case BPF_LD: + tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_IMM, %#x)", i << 16); + break; + case BPF_LDX: + tprintf("BPF_STMT(BPF_LDX|BPF_W|BPF_IMM, %#x)", i << 16); + break; + case BPF_ST: + tprintf("BPF_STMT(BPF_ST, %#x)", i << 16); + break; + case BPF_STX: + tprintf("BPF_STMT(BPF_STX, %#x)", i << 16); + break; + case BPF_ALU: + tprintf("BPF_STMT(BPF_ALU|BPF_K|BPF_ADD, %#x)", i << 16); + break; + case BPF_JMP: + tprintf("BPF_STMT(BPF_JMP|BPF_K|BPF_JA, %#x)", i << 16); + break; + case BPF_RET: + tprintf("BPF_STMT(BPF_RET|BPF_K, %#x" + " /* SECCOMP_RET_??? */)", i << 16); + break; + case BPF_MISC: + tprintf("BPF_STMT(BPF_MISC|BPF_TAX, %#x)", i << 16); + break; + } + } + tprintf(", ...]})"); + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); + tprintf(" = -1 EINVAL (%m)\n"); + + prog->filter = filter; + prog->len = ARRAY_SIZE(filter_c); + + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u, filter=[", + prog->len); + + tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_ABS, %#x), ", + (unsigned) offsetof(struct seccomp_data, nr)); + + PRINT_ALLOW_SYSCALL(close); + PRINT_ALLOW_SYSCALL(exit); + PRINT_ALLOW_SYSCALL(exit_group); + + PRINT_DENY_SYSCALL(sync, EBUSY), + PRINT_DENY_SYSCALL(setsid, EPERM), + + tprintf("%s]}) = 0\n+++ exited with 0 +++\n", kill_stmt_txt); + + if (syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog)) + perror_msg_and_skip("SECCOMP_SET_MODE_FILTER"); + + if (close(0) || close(1)) + _exit(77); + + _exit(0); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && PR_SET_NO_NEW_PRIVS" + " && SECCOMP_SET_MODE_FILTER && SECCOMP_RET_ERRNO" + " && BPF_JUMP && BPF_STMT") + +#endif diff --git a/tests-mx32/seccomp-filter-v.test b/tests-mx32/seccomp-filter-v.test new file mode 100755 index 00000000..f873eb6f --- /dev/null +++ b/tests-mx32/seccomp-filter-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=seccomp diff --git a/tests-mx32/seccomp-filter.c b/tests-mx32/seccomp-filter.c new file mode 100644 index 00000000..d4d76dd3 --- /dev/null +++ b/tests-mx32/seccomp-filter.c @@ -0,0 +1,75 @@ +/* + * Check decoding of seccomp SECCOMP_SET_MODE_FILTER. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined __NR_seccomp && defined SECCOMP_SET_MODE_FILTER + +# define N 7 + +int +main(void) +{ + struct sock_filter *const filter = tail_alloc(sizeof(*filter) * N); + const void *const efault = tail_alloc(1); + struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + long rc; + + prog->filter = filter; + prog->len = N; + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); + printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=%p})" + " = %ld %s (%m)\n", "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", + prog->len, prog->filter, rc, errno2name()); + + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -2L, efault); + printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, %p) = %ld %s (%m)\n", + "0xfffffffe /* SECCOMP_FILTER_FLAG_??? */", + efault, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && SECCOMP_SET_MODE_FILTER") + +#endif diff --git a/tests-mx32/seccomp-filter.test b/tests-mx32/seccomp-filter.test new file mode 100755 index 00000000..65c6d495 --- /dev/null +++ b/tests-mx32/seccomp-filter.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of seccomp SECCOMP_SET_MODE_FILTER. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests-mx32/seccomp-strict.c b/tests-mx32/seccomp-strict.c new file mode 100644 index 00000000..237b0eca --- /dev/null +++ b/tests-mx32/seccomp-strict.c @@ -0,0 +1,74 @@ +/* + * Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_seccomp && defined __NR_exit + +# include +# include + +int +main(void) +{ + static const char text1[] = + "seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = 0\n"; + static const char text2[] = "+++ exited with 0 +++\n"; + const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + long rc; + + rc = syscall(__NR_seccomp, -1L, -1L, addr); + printf("seccomp(%#x /* SECCOMP_SET_MODE_??? */, %u, %#llx)" + " = %s\n", -1, -1, (unsigned long long) addr, sprintrc(rc)); + fflush(stdout); + + rc = syscall(__NR_seccomp, 0, 0, 0); + if (rc) { + printf("seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = %s\n", + sprintrc(rc)); + fflush(stdout); + rc = 0; + } else { + /* + * If kernel implementaton of SECCOMP_MODE_STRICT is buggy, + * the following syscall will result to SIGKILL. + */ + rc = write(1, text1, LENGTH_OF(text1)) != LENGTH_OF(text1); + } + + rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2); + return !!syscall(__NR_exit, rc); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && __NR_exit") + +#endif diff --git a/tests-mx32/seccomp-strict.test b/tests-mx32/seccomp-strict.test new file mode 100755 index 00000000..b354c6a2 --- /dev/null +++ b/tests-mx32/seccomp-strict.test @@ -0,0 +1,17 @@ +#!/bin/sh + +# Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. + +. "${srcdir=.}/init.sh" + +set -- "./$NAME" +"$@" > /dev/null || { + case $? in + 77) skip_ "$* exited with code 77" ;; + 137) framework_skip_ "$* killed by SIGKILL, fix your kernel" ;; + *) fail_ "$args failed" ;; + esac +} +run_strace -eseccomp "$@" > "$EXP" +match_diff "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-mx32/select.c b/tests-mx32/select.c new file mode 100644 index 00000000..b5ff259d --- /dev/null +++ b/tests-mx32/select.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_select && !defined __NR__newselect + +# define TEST_SYSCALL_NR __NR_select +# define TEST_SYSCALL_STR "select" +# include "xselect.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && !__NR__newselect") + +#endif diff --git a/tests-mx32/select.test b/tests-mx32/select.test new file mode 100755 index 00000000..60b88caf --- /dev/null +++ b/tests-mx32/select.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check select syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/semop.c b/tests-mx32/semop.c new file mode 100644 index 00000000..a2ff2635 --- /dev/null +++ b/tests-mx32/semop.c @@ -0,0 +1,119 @@ +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/semop_flags.h" + +union semun +{ + int val; + struct semid_ds *buf; + unsigned short *array; + struct seminfo *__buf; +}; + +static int id = -1; + +static void +cleanup(void) +{ + semctl(id, 0, IPC_RMID, 0); + id = -1; +} + +int +main(void) +{ + static const int bogus_semid = 0xfdb97531; + static void * const bogus_sops = (void *) -1L; + static const size_t bogus_nsops = (size_t) 0xdefaceddeadbeefULL; + + static const struct timespec ts_data = { 1, 123456789 }; + + struct timespec *ts = tail_memdup(&ts_data, sizeof(*ts)); + int rc; + + id = semget(IPC_PRIVATE, 1, 0600); + if (id < 0) + perror_msg_and_skip("semget"); + atexit(cleanup); + + union semun sem_union = { .val = 0 }; + if (semctl(id, 0, SETVAL, sem_union) == -1) + perror_msg_and_skip("semctl"); + + struct sembuf *const sem_b = tail_alloc(sizeof(*sem_b)); + struct sembuf *const sem_b2 = tail_alloc(sizeof(*sem_b2)); + + rc = semop(bogus_semid, NULL, bogus_nsops); + printf("semop(%d, NULL, %u) = %s\n", + bogus_semid, (unsigned) bogus_nsops, sprintrc(rc)); + + rc = semop(bogus_semid, bogus_sops, 1); + printf("semop(%d, %p, %u) = %s\n", + bogus_semid, bogus_sops, 1, sprintrc(rc)); + + sem_b->sem_num = 0; + sem_b->sem_op = 1; + sem_b->sem_flg = SEM_UNDO; + + sem_b2->sem_num = 0xface; + sem_b2->sem_op = 0xf00d; + sem_b2->sem_flg = 0xbeef; + + rc = semop(bogus_semid, sem_b2, 2); + printf("semop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u) = %s\n", + bogus_semid, sem_b2->sem_num, sem_b2->sem_op, + sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", + sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", + sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + sem_b2 + 1, 2, sprintrc(rc)); + + if (semop(id, sem_b, 1)) + perror_msg_and_skip("semop, 1"); + printf("semop(%d, [{0, 1, SEM_UNDO}], 1) = 0\n", id); + + sem_b->sem_op = -1; + if (semop(id, sem_b, 1)) + perror_msg_and_skip("semop, -1"); + printf("semop(%d, [{0, -1, SEM_UNDO}], 1) = 0\n", id); + + rc = semtimedop(bogus_semid, NULL, bogus_nsops, NULL); + printf("semtimedop(%d, NULL, %u, NULL) = %s\n", + bogus_semid, (unsigned) bogus_nsops, sprintrc(rc)); + + rc = semtimedop(id, sem_b + 1, 1, ts + 1); + printf("semtimedop(%d, %p, 1, %p) = %s\n", + id, sem_b + 1, ts + 1, sprintrc(rc)); + + rc = semtimedop(bogus_semid, sem_b2, 2, ts); + printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", + bogus_semid, sem_b2->sem_num, sem_b2->sem_op, + sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", + sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", + sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + sem_b2 + 1, 2, + (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec, + sprintrc(rc)); + + sem_b->sem_op = 1; + if (semtimedop(id, sem_b, 1, NULL)) + perror_msg_and_skip("semtimedop, 1"); + printf("semtimedop(%d, [{0, 1, SEM_UNDO}], 1, NULL) = 0\n", id); + + sem_b->sem_op = -1; + if (semtimedop(id, sem_b, 1, ts)) + perror_msg_and_skip("semtimedop, -1"); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1, " + "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", id, + (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/semop.test b/tests-mx32/semop.test new file mode 100755 index 00000000..3e77d2f9 --- /dev/null +++ b/tests-mx32/semop.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check semop syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests-mx32/sendfile.c b/tests-mx32/sendfile.c new file mode 100644 index 00000000..23f096b6 --- /dev/null +++ b/tests-mx32/sendfile.c @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sendfile + +# include +# include +# include +# include +# include +# include +# include +# include + +int +main(int ac, const char **av) +{ + assert(ac == 1); + + (void) close(0); + if (open("/dev/zero", O_RDONLY) != 0) + perror_msg_and_skip("open: %s", "/dev/zero"); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + int reg_in = open(av[0], O_RDONLY); + if (reg_in < 0) + perror_msg_and_fail("open: %s", av[0]); + + struct stat stb; + assert(fstat(reg_in, &stb) == 0); + const size_t blen = stb.st_size / 3; + const size_t alen = stb.st_size - blen; + assert(S_ISREG(stb.st_mode) && blen > 0); + + const size_t page_len = get_page_size(); + assert(syscall(__NR_sendfile, 0, 1, NULL, page_len) == -1); + if (EBADF != errno) + perror_msg_and_skip("sendfile"); + printf("sendfile(0, 1, NULL, %lu) = -1 EBADF (%m)\n", + (unsigned long) page_len); + + uint32_t *p_off = tail_alloc(sizeof(uint32_t)); + void *p = p_off + 1; + *p_off = 0; + + assert(syscall(__NR_sendfile, 0, 1, p, page_len) == -1); + printf("sendfile(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", + (unsigned long) p, (unsigned long) page_len); + + assert(syscall(__NR_sendfile, sv[1], reg_in, NULL, alen) + == (long) alen); + printf("sendfile(%d, %d, NULL, %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen); + + p = p_off; + if (syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) != (long) alen) { + printf("sendfile(%d, %d, %#lx, %lu) = -1 EFAULT (%m)\n", + sv[1], reg_in, (unsigned long) p_off, + (unsigned long) alen); + --p_off; + *p_off = 0; + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) + == (long) alen); + } + printf("sendfile(%d, %d, [0] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen, (unsigned long) alen); + + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, stb.st_size + 1) + == (long) blen); + printf("sendfile(%d, %d, [%lu] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) stb.st_size, + (unsigned long) stb.st_size + 1, + (unsigned long) blen); + + if (p_off != p) { + uint64_t *p_off64 = (uint64_t *) p_off; + *p_off64 = 0xcafef00dfacefeedULL; + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off64, 1) == -1); + printf("sendfile(%d, %d, [14627392582579060461], 1)" + " = -1 EINVAL (%m)\n", sv[1], reg_in); + *p_off64 = 0xdefaced; + } else { + *p_off = 0xdefaced; + } + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, 1) == 0); + printf("sendfile(%d, %d, [233811181], 1) = 0\n", + sv[1], reg_in); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sendfile") + +#endif diff --git a/tests-mx32/sendfile.test b/tests-mx32/sendfile.test new file mode 100755 index 00000000..48dba585 --- /dev/null +++ b/tests-mx32/sendfile.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sendfile syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/sendfile64.c b/tests-mx32/sendfile64.c new file mode 100644 index 00000000..7208c300 --- /dev/null +++ b/tests-mx32/sendfile64.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sendfile64 + +# include +# include +# include +# include +# include +# include +# include +# include + +int +main(int ac, const char **av) +{ + assert(ac == 1); + + (void) close(0); + if (open("/dev/zero", O_RDONLY) != 0) + perror_msg_and_skip("open: %s", "/dev/zero"); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + int reg_in = open(av[0], O_RDONLY); + if (reg_in < 0) + perror_msg_and_fail("open: %s", av[0]); + + struct stat stb; + assert(fstat(reg_in, &stb) == 0); + const size_t blen = stb.st_size / 3; + const size_t alen = stb.st_size - blen; + assert(S_ISREG(stb.st_mode) && blen > 0); + + const size_t page_len = get_page_size(); + assert(syscall(__NR_sendfile64, 0, 1, NULL, page_len) == -1); + if (EBADF != errno) + perror_msg_and_skip("sendfile64"); + printf("sendfile64(0, 1, NULL, %lu) = -1 EBADF (%m)\n", + (unsigned long) page_len); + + uint64_t *p_off = tail_alloc(sizeof(uint64_t)); + void *p = p_off + 1; + *p_off = 0; + + assert(syscall(__NR_sendfile64, 0, 1, p, page_len) == -1); + printf("sendfile64(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", + (unsigned long) p, (unsigned long) page_len); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, NULL, alen) + == (long) alen); + printf("sendfile64(%d, %d, NULL, %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, alen) + == (long) alen); + printf("sendfile64(%d, %d, [0] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen, (unsigned long) alen); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, stb.st_size + 1) + == (long) blen); + printf("sendfile64(%d, %d, [%lu] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) stb.st_size, + (unsigned long) stb.st_size + 1, + (unsigned long) blen); + + *p_off = 0xcafef00dfacefeedULL; + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1); + printf("sendfile64(%d, %d, [14627392582579060461], 1)" + " = -1 EINVAL (%m)\n", sv[1], reg_in); + + *p_off = 0xfacefeed; + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == 0); + printf("sendfile64(%d, %d, [4207869677], 1) = 0\n", sv[1], reg_in); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sendfile64") + +#endif diff --git a/tests-mx32/sendfile64.test b/tests-mx32/sendfile64.test new file mode 100755 index 00000000..faa05254 --- /dev/null +++ b/tests-mx32/sendfile64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sendfile64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 diff --git a/tests-mx32/set_mempolicy.c b/tests-mx32/set_mempolicy.c new file mode 100644 index 00000000..f3261a09 --- /dev/null +++ b/tests-mx32/set_mempolicy.c @@ -0,0 +1,146 @@ +/* + * Check decoding of set_mempolicy syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_set_mempolicy + +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/policies.h" + +# define MAX_STRLEN 3 +# define NLONGS(n) ((n + 8 * sizeof(long) - 2) \ + / (8 * sizeof(long))) + +static void +print_nodes(const unsigned long maxnode, unsigned int offset) +{ + unsigned int nlongs = NLONGS(maxnode); + if (nlongs <= offset) + nlongs = 0; + else + nlongs -= offset; + const unsigned int size = nlongs * sizeof(long); + unsigned long *const nodemask = + tail_alloc(size ? size : (offset ? 1 : 0)); + memset(nodemask, 0, size); + + long rc = syscall(__NR_set_mempolicy, 0, nodemask, maxnode); + const char *errstr = sprintrc(rc); + + fputs("set_mempolicy(MPOL_DEFAULT, ", stdout); + + if (nlongs) { + putc('[', stdout); + unsigned int i; + for (i = 0; i < nlongs + offset; ++i) { + if (i) + fputs(", ", stdout); + if (i < nlongs) { + if (i >= MAX_STRLEN) { + fputs("...", stdout); + break; + } + printf("%#0*lx", (int) sizeof(long) * 2 + 2, + nodemask[i]); + } else { + printf("%p", nodemask + i); + break; + } + } + putc(']', stdout); + } else { + if (maxnode) + printf("%p", nodemask); + else + printf("[]"); + } + + printf(", %lu) = %s\n", maxnode, errstr); +} + +static void +test_offset(const unsigned int offset) +{ + unsigned long maxnode = get_page_size() * 8; + + print_nodes(maxnode, offset); + print_nodes(maxnode + 1, offset); + print_nodes(maxnode + 2, offset); + + maxnode = sizeof(long) * 8; + print_nodes(0, offset); + print_nodes(1, offset); + print_nodes(2, offset); + print_nodes(maxnode - 1, offset); + print_nodes(maxnode , offset); + print_nodes(maxnode + 1, offset); + print_nodes(maxnode + 2, offset); + print_nodes(maxnode * 2 - 1, offset); + print_nodes(maxnode * 2 , offset); + print_nodes(maxnode * 2 + 1, offset); + print_nodes(maxnode * 2 + 2, offset); + print_nodes(maxnode * 3 - 1, offset); + print_nodes(maxnode * 3 , offset); + print_nodes(maxnode * 3 + 1, offset); + print_nodes(maxnode * 3 + 2, offset); + print_nodes(maxnode * 4 + 2, offset); +} + +int +main(void) +{ + if (syscall(__NR_set_mempolicy, 0, 0, 0)) + perror_msg_and_skip("set_mempolicy"); + puts("set_mempolicy(MPOL_DEFAULT, NULL, 0) = 0"); + + const unsigned long *nodemask = (void *) 0xfacefeedfffffffeULL; + const unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; + long rc = syscall(__NR_set_mempolicy, 1, nodemask, maxnode); + printf("set_mempolicy(MPOL_PREFERRED, %p, %lu) = %s\n", + nodemask, maxnode, sprintrc(rc)); + + test_offset(0); + test_offset(1); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_set_mempolicy") + +#endif diff --git a/tests-mx32/set_mempolicy.test b/tests-mx32/set_mempolicy.test new file mode 100755 index 00000000..0ed6666c --- /dev/null +++ b/tests-mx32/set_mempolicy.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check set_mempolicy syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a35 diff --git a/tests-mx32/set_ptracer_any.c b/tests-mx32/set_ptracer_any.c new file mode 100644 index 00000000..bc2f90ca --- /dev/null +++ b/tests-mx32/set_ptracer_any.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#ifdef HAVE_PRCTL +# include +#endif + +int main(int argc, char **argv) +{ + if (argc < 2) + return 99; +#if defined HAVE_PRCTL && defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY + /* Turn off restrictions on tracing if applicable. If the options + * aren't available on this system, that's OK too. */ + (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); +#endif + if (write(1, "\n", 1) != 1) { + perror("write"); + return 99; + } + (void) execvp(argv[1], argv + 1); + perror(argv[1]); + return 99; +} diff --git a/tests-mx32/setdomainname.c b/tests-mx32/setdomainname.c new file mode 100644 index 00000000..f3e24840 --- /dev/null +++ b/tests-mx32/setdomainname.c @@ -0,0 +1,24 @@ +#include "tests.h" +#include + +#ifdef __NR_setdomainname + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_setdomainname, 0, 63); + printf("setdomainname(NULL, 63) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setdomainname") + +#endif diff --git a/tests-mx32/setdomainname.test b/tests-mx32/setdomainname.test new file mode 100755 index 00000000..2159e7c4 --- /dev/null +++ b/tests-mx32/setdomainname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setdomainname syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/setfsgid.c b/tests-mx32/setfsgid.c new file mode 100644 index 00000000..871f4b35 --- /dev/null +++ b/tests-mx32/setfsgid.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsgid + +# define SYSCALL_NR __NR_setfsgid +# define SYSCALL_NAME "setfsgid" + +# if defined __NR_setfsgid32 && __NR_setfsgid != __NR_setfsgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# endif + +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsgid") + +#endif diff --git a/tests-mx32/setfsgid.test b/tests-mx32/setfsgid.test new file mode 100755 index 00000000..0ae2b0a2 --- /dev/null +++ b/tests-mx32/setfsgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/setfsgid32.c b/tests-mx32/setfsgid32.c new file mode 100644 index 00000000..6279abd3 --- /dev/null +++ b/tests-mx32/setfsgid32.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsgid32 + +# define SYSCALL_NR __NR_setfsgid32 +# define SYSCALL_NAME "setfsgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsgid32") + +#endif diff --git a/tests-mx32/setfsgid32.test b/tests-mx32/setfsgid32.test new file mode 100755 index 00000000..9b7a2bf8 --- /dev/null +++ b/tests-mx32/setfsgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/setfsugid.c b/tests-mx32/setfsugid.c new file mode 100644 index 00000000..79ba34d8 --- /dev/null +++ b/tests-mx32/setfsugid.c @@ -0,0 +1,76 @@ +/* + * Check decoding of setfsuid/setfsgid/setfsuid32/setfsgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +void +printuid(unsigned UGID_TYPE id) +{ + if (id == (unsigned UGID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + unsigned int ugid = GETUGID; + + const kernel_ulong_t tests[] = { + ugid, + 0xffff0000U | ugid, + (kernel_ulong_t) 0xffffffff00000000ULL | ugid, + 0xffffU, + -1U, + -1L, + 0xc0deffffU, + 0xfacefeedU, + (long) 0xfacefeeddeadbeefULL + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int num = (unsigned UGID_TYPE) tests[i]; + unsigned int rc; + + rc = syscall(SYSCALL_NR, tests[i]); + printf("%s(", SYSCALL_NAME); + printuid(num); + printf(") = %u\n", rc); + + rc = syscall(SYSCALL_NR, ugid); + printf("%s(%u) = %u\n", SYSCALL_NAME, ugid, rc); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/setfsuid.c b/tests-mx32/setfsuid.c new file mode 100644 index 00000000..d6faf971 --- /dev/null +++ b/tests-mx32/setfsuid.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsuid + +# define SYSCALL_NR __NR_setfsuid +# define SYSCALL_NAME "setfsuid" + +# if defined __NR_setfsuid32 && __NR_setfsuid != __NR_setfsuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# endif + +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsuid") + +#endif diff --git a/tests-mx32/setfsuid.test b/tests-mx32/setfsuid.test new file mode 100755 index 00000000..18a10219 --- /dev/null +++ b/tests-mx32/setfsuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/setfsuid32.c b/tests-mx32/setfsuid32.c new file mode 100644 index 00000000..b71cf235 --- /dev/null +++ b/tests-mx32/setfsuid32.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsuid32 + +# define SYSCALL_NR __NR_setfsuid32 +# define SYSCALL_NAME "setfsuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsuid32") + +#endif diff --git a/tests-mx32/setfsuid32.test b/tests-mx32/setfsuid32.test new file mode 100755 index 00000000..2dce3cc9 --- /dev/null +++ b/tests-mx32/setfsuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/setgid.c b/tests-mx32/setgid.c new file mode 100644 index 00000000..8794a0a4 --- /dev/null +++ b/tests-mx32/setgid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setgid + +# define SYSCALL_NR __NR_setgid +# define SYSCALL_NAME "setgid" + +# if defined __NR_setgid32 && __NR_setgid != __NR_setgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgid") + +#endif diff --git a/tests-mx32/setgid.test b/tests-mx32/setgid.test new file mode 100755 index 00000000..a3a90041 --- /dev/null +++ b/tests-mx32/setgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/setgid32.c b/tests-mx32/setgid32.c new file mode 100644 index 00000000..17f43c58 --- /dev/null +++ b/tests-mx32/setgid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setgid32 + +# define SYSCALL_NR __NR_setgid32 +# define SYSCALL_NAME "setgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgid32") + +#endif diff --git a/tests-mx32/setgid32.test b/tests-mx32/setgid32.test new file mode 100755 index 00000000..11a87e12 --- /dev/null +++ b/tests-mx32/setgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/setgroups.c b/tests-mx32/setgroups.c new file mode 100644 index 00000000..1ec8333f --- /dev/null +++ b/tests-mx32/setgroups.c @@ -0,0 +1,190 @@ +/* + * Check decoding of setgroups/setgroups32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef __NR_setgroups32 + +# define SYSCALL_NR __NR_setgroups32 +# define SYSCALL_NAME "setgroups32" +# define GID_TYPE unsigned int + +#else + +# include "tests.h" +# include + +# ifdef __NR_setgroups + +# define SYSCALL_NR __NR_setgroups +# define SYSCALL_NAME "setgroups" +# if defined __NR_setgroups32 && __NR_setgroups != __NR_setgroups32 +# define GID_TYPE unsigned short +# else +# define GID_TYPE unsigned int +# endif + +# endif + +#endif + +#ifdef GID_TYPE + +# include +# include + +void +printuid(GID_TYPE id) +{ + if (id == (GID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + const char *errstr; + + /* check how the first argument is decoded */ + long rc = syscall(SYSCALL_NR, 0, 0); + printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, 0); + printf("%s(1, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000001ULL, 0); + printf("%s(1, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1U, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1L, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + /* check how the second argument is decoded */ + const GID_TYPE *const g1 = tail_alloc(sizeof(*g1)); + GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * 2); + GID_TYPE *const g3 = tail_alloc(sizeof(*g3) * 3); + + rc = syscall(SYSCALL_NR, 0, g1 + 1); + printf("%s(0, []) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, g1); + errstr = sprintrc(rc); + printf("%s(1, [", SYSCALL_NAME); + printuid(*g1); + printf("]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 1, g1 + 1); + printf("%s(1, %p) = %s\n", SYSCALL_NAME, g1 + 1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, -1L); + printf("%s(1, %#lx) = %s\n", SYSCALL_NAME, -1L, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 2, g1); + errstr = sprintrc(rc); + printf("%s(2, [", SYSCALL_NAME); + printuid(*g1); + printf(", %p]) = %s\n", g1 + 1, errstr); + + g2[0] = -2; + g2[1] = -3; + rc = syscall(SYSCALL_NR, 2, g2); + errstr = sprintrc(rc); + printf("%s(2, [", SYSCALL_NAME); + printuid(g2[0]); + printf(", "); + printuid(g2[1]); + printf("]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 3, g2); + errstr = sprintrc(rc); + printf("%s(3, [", SYSCALL_NAME); + printuid(g2[0]); + printf(", "); + printuid(g2[1]); + printf(", %p]) = %s\n", g2 + 2, errstr); + + g3[0] = 0; + g3[1] = 1; + rc = syscall(SYSCALL_NR, 3, g3); + errstr = sprintrc(rc); + printf("%s(3, [", SYSCALL_NAME); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 4, g3); + errstr = sprintrc(rc); + printf("%s(4, [", SYSCALL_NAME); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = sysconf(_SC_NGROUPS_MAX); + const unsigned ngroups_max = rc; + + if ((unsigned long) rc == ngroups_max && (int) ngroups_max > 0) { + rc = syscall(SYSCALL_NR, ngroups_max, g3); + errstr = sprintrc(rc); + printf("%s(%d, [", SYSCALL_NAME, ngroups_max); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + const unsigned long size = + (unsigned long) 0xffffffff00000000ULL | ngroups_max; + rc = syscall(SYSCALL_NR, size, g3); + errstr = sprintrc(rc); + printf("%s(%d, [", SYSCALL_NAME, ngroups_max); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, ngroups_max + 1, g3); + printf("%s(%d, %p) = %s\n", SYSCALL_NAME, + ngroups_max + 1, g3, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgroups") + +#endif diff --git a/tests-mx32/setgroups.test b/tests-mx32/setgroups.test new file mode 100755 index 00000000..0dcc8f75 --- /dev/null +++ b/tests-mx32/setgroups.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgroups syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a17 diff --git a/tests-mx32/setgroups32.c b/tests-mx32/setgroups32.c new file mode 100644 index 00000000..ecf00bbd --- /dev/null +++ b/tests-mx32/setgroups32.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include + +#ifdef __NR_setgroups32 + +# include "setgroups.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgroups32") + +#endif diff --git a/tests-mx32/setgroups32.test b/tests-mx32/setgroups32.test new file mode 100755 index 00000000..ee4750d1 --- /dev/null +++ b/tests-mx32/setgroups32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgroups32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a19 diff --git a/tests-mx32/sethostname.c b/tests-mx32/sethostname.c new file mode 100644 index 00000000..e1b2f069 --- /dev/null +++ b/tests-mx32/sethostname.c @@ -0,0 +1,79 @@ +/* + * Check decoding of sethostname syscall. + * + * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sethostname + +# include +# include + +#ifdef HAVE_LINUX_UTSNAME_H +# include +#endif + +#ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +#endif + +int +main(void) +{ + kernel_ulong_t len; + long rc; + + len = __NEW_UTS_LEN; + rc = syscall(__NR_sethostname, 0, len); + printf("sethostname(NULL, %u) = %s\n", + (unsigned) len, sprintrc(rc)); + + if (F8ILL_KULONG_MASK) { + len |= F8ILL_KULONG_MASK; + rc = syscall(__NR_sethostname, 0, len); + printf("sethostname(NULL, %u) = %s\n", + (unsigned) len, sprintrc(rc)); + } + + len = __NEW_UTS_LEN + 1; + void *const p = tail_alloc(len); + rc = syscall(__NR_sethostname, p, len); + printf("sethostname(%p, %u) = %s\n", + p, (unsigned) len, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sethostname") + +#endif diff --git a/tests-mx32/sethostname.test b/tests-mx32/sethostname.test new file mode 100755 index 00000000..78f8c58e --- /dev/null +++ b/tests-mx32/sethostname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sethostname syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/setns.c b/tests-mx32/setns.c new file mode 100644 index 00000000..54a15317 --- /dev/null +++ b/tests-mx32/setns.c @@ -0,0 +1,73 @@ +/* + * Check decoding of setns syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_setns + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfeedfacedeadc0deULL; + + static struct { + kernel_ulong_t val; + const char *str; + } nstypes[] = { + { (kernel_ulong_t) 0xdefaced100000000ULL, "0" }, + { (kernel_ulong_t) 0xbadc0dedfeedfaceULL, + "0xfeedface /* CLONE_NEW??? */" }, + { (kernel_ulong_t) 0xca75f15702000000ULL, "CLONE_NEWCGROUP" }, + }; + + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(nstypes); i++) { + rc = syscall(__NR_setns, bogus_fd, nstypes[i].val); + printf("setns(%d, %s) = %s\n", + (int) bogus_fd, nstypes[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setns"); + +#endif diff --git a/tests-mx32/setns.test b/tests-mx32/setns.test new file mode 100755 index 00000000..e9a905ab --- /dev/null +++ b/tests-mx32/setns.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of setns syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/setregid.c b/tests-mx32/setregid.c new file mode 100644 index 00000000..e1da7862 --- /dev/null +++ b/tests-mx32/setregid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setregid + +# define SYSCALL_NR __NR_setregid +# define SYSCALL_NAME "setregid" + +# if defined __NR_setregid32 && __NR_setregid != __NR_setregid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setregid") + +#endif diff --git a/tests-mx32/setregid.test b/tests-mx32/setregid.test new file mode 100755 index 00000000..101c7bdf --- /dev/null +++ b/tests-mx32/setregid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setregid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/setregid32.c b/tests-mx32/setregid32.c new file mode 100644 index 00000000..3cf0daf6 --- /dev/null +++ b/tests-mx32/setregid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setregid32 + +# define SYSCALL_NR __NR_setregid32 +# define SYSCALL_NAME "setregid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setregid32") + +#endif diff --git a/tests-mx32/setregid32.test b/tests-mx32/setregid32.test new file mode 100755 index 00000000..e57e66c4 --- /dev/null +++ b/tests-mx32/setregid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setregid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/setresgid.c b/tests-mx32/setresgid.c new file mode 100644 index 00000000..8701df8e --- /dev/null +++ b/tests-mx32/setresgid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setresgid + +# define SYSCALL_NR __NR_setresgid +# define SYSCALL_NAME "setresgid" + +# if defined __NR_setresgid32 && __NR_setresgid != __NR_setresgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresgid") + +#endif diff --git a/tests-mx32/setresgid.test b/tests-mx32/setresgid.test new file mode 100755 index 00000000..5a695742 --- /dev/null +++ b/tests-mx32/setresgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/setresgid32.c b/tests-mx32/setresgid32.c new file mode 100644 index 00000000..dfce4572 --- /dev/null +++ b/tests-mx32/setresgid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setresgid32 + +# define SYSCALL_NR __NR_setresgid32 +# define SYSCALL_NAME "setresgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresgid32") + +#endif diff --git a/tests-mx32/setresgid32.test b/tests-mx32/setresgid32.test new file mode 100755 index 00000000..528b2c9e --- /dev/null +++ b/tests-mx32/setresgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/setresugid.c b/tests-mx32/setresugid.c new file mode 100644 index 00000000..711bd317 --- /dev/null +++ b/tests-mx32/setresugid.c @@ -0,0 +1,113 @@ +/* + * Check decoding of setresuid/setresgid/setresuid32/setresgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +static int +ugid2int(const unsigned UGID_TYPE ugid) +{ + if ((unsigned UGID_TYPE) -1U == ugid) + return -1; + else + return ugid; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf("-1"); + else + printf("%u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int ugid) +{ + return num == ugid || num == -1U; +} + +#define TRIPLE(val) \ + { val, ugid, ugid }, { ugid, val, ugid }, { ugid, ugid, val } + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const struct { + const long r, e, s; + } tests[] = { + { ugid, ugid, ugid }, + TRIPLE((unsigned long) 0xffffffff00000000ULL | ugid), + TRIPLE(-1U), + TRIPLE(-1L), + TRIPLE(0xffff0000U | ugid), + TRIPLE(0xffff), + TRIPLE(0xc0deffffU) + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int rn = ugid2int(tests[i].r); + const unsigned int en = ugid2int(tests[i].e); + const unsigned int sn = ugid2int(tests[i].s); + + if (!num_matches_id(rn, ugid) || + !num_matches_id(en, ugid) || + !num_matches_id(sn, ugid)) + continue; + + if (syscall(SYSCALL_NR, tests[i].r, tests[i].e, tests[i].s)) { + if (!i && ENOSYS == errno) { + printf("%s(%u, %u, %u) = -1 ENOSYS (%m)\n", + SYSCALL_NAME, ugid, ugid, ugid); + break; + } + perror_msg_and_fail("%s(%#lx, %#lx, %#lx)", + SYSCALL_NAME, + tests[i].r, tests[i].e, tests[i].s); + } + + printf("%s(", SYSCALL_NAME); + print_int(rn); + printf(", "); + print_int(en); + printf(", "); + print_int(sn); + printf(") = 0\n"); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/setresuid.c b/tests-mx32/setresuid.c new file mode 100644 index 00000000..3a9dbd1f --- /dev/null +++ b/tests-mx32/setresuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setresuid + +# define SYSCALL_NR __NR_setresuid +# define SYSCALL_NAME "setresuid" + +# if defined __NR_setresuid32 && __NR_setresuid != __NR_setresuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresuid") + +#endif diff --git a/tests-mx32/setresuid.test b/tests-mx32/setresuid.test new file mode 100755 index 00000000..f1219e06 --- /dev/null +++ b/tests-mx32/setresuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/setresuid32.c b/tests-mx32/setresuid32.c new file mode 100644 index 00000000..387268a7 --- /dev/null +++ b/tests-mx32/setresuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setresuid32 + +# define SYSCALL_NR __NR_setresuid32 +# define SYSCALL_NAME "setresuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresuid32") + +#endif diff --git a/tests-mx32/setresuid32.test b/tests-mx32/setresuid32.test new file mode 100755 index 00000000..942a3a65 --- /dev/null +++ b/tests-mx32/setresuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/setreugid.c b/tests-mx32/setreugid.c new file mode 100644 index 00000000..38c80d57 --- /dev/null +++ b/tests-mx32/setreugid.c @@ -0,0 +1,106 @@ +/* + * Check decoding of setreuid/setregid/setreuid32/setregid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +static int +ugid2int(const unsigned UGID_TYPE ugid) +{ + if ((unsigned UGID_TYPE) -1U == ugid) + return -1; + else + return ugid; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf("-1"); + else + printf("%u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int ugid) +{ + return num == ugid || num == -1U; +} + +#define PAIR(val) { val, ugid }, { ugid, val } + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const struct { + const long r, e; + } tests[] = { + { ugid, ugid }, + PAIR((unsigned long) 0xffffffff00000000ULL | ugid), + PAIR(-1U), + PAIR(-1L), + PAIR(0xffff0000U | ugid), + PAIR(0xffff), + PAIR(0xc0deffffU) + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int rn = ugid2int(tests[i].r); + const unsigned int en = ugid2int(tests[i].e); + + if (!num_matches_id(rn, ugid) || !num_matches_id(en, ugid)) + continue; + + if (syscall(SYSCALL_NR, tests[i].r, tests[i].e)) { + if (!i && ENOSYS == errno) { + printf("%s(%u, %u) = -1 ENOSYS (%m)\n", + SYSCALL_NAME, ugid, ugid); + break; + } + perror_msg_and_fail("%s(%#lx, %#lx)", SYSCALL_NAME, + tests[i].r, tests[i].e); + } + + printf("%s(", SYSCALL_NAME); + print_int(rn); + printf(", "); + print_int(en); + printf(") = 0\n"); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/setreuid.c b/tests-mx32/setreuid.c new file mode 100644 index 00000000..68e75192 --- /dev/null +++ b/tests-mx32/setreuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setreuid + +# define SYSCALL_NR __NR_setreuid +# define SYSCALL_NAME "setreuid" + +# if defined __NR_setreuid32 && __NR_setreuid != __NR_setreuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setreuid") + +#endif diff --git a/tests-mx32/setreuid.test b/tests-mx32/setreuid.test new file mode 100755 index 00000000..b6db3c1d --- /dev/null +++ b/tests-mx32/setreuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setreuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/setreuid32.c b/tests-mx32/setreuid32.c new file mode 100644 index 00000000..ba017621 --- /dev/null +++ b/tests-mx32/setreuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setreuid32 + +# define SYSCALL_NR __NR_setreuid32 +# define SYSCALL_NAME "setreuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setreuid32") + +#endif diff --git a/tests-mx32/setreuid32.test b/tests-mx32/setreuid32.test new file mode 100755 index 00000000..23323d47 --- /dev/null +++ b/tests-mx32/setreuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setreuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/setrlimit.c b/tests-mx32/setrlimit.c new file mode 100644 index 00000000..e93c8e37 --- /dev/null +++ b/tests-mx32/setrlimit.c @@ -0,0 +1,70 @@ +/* + * Check decoding of setrlimit syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_setrlimit + +# include "xgetrlimit.c" + +int +main(void) +{ + kernel_ulong_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(__NR_setrlimit, res, 0); + printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); + + struct rlimit libc_rlim = {}; + if (getrlimit((int) res, &libc_rlim)) + continue; + rlimit[0] = libc_rlim.rlim_cur; + rlimit[1] = libc_rlim.rlim_max; + + rc = syscall(__NR_setrlimit, res, rlimit); + const char *errstr = sprintrc(rc); + printf("setrlimit(%s, {rlim_cur=%s, rlim_max=%s}) = %s\n", + xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setrlimit") + +#endif diff --git a/tests-mx32/setrlimit.test b/tests-mx32/setrlimit.test new file mode 100755 index 00000000..79206089 --- /dev/null +++ b/tests-mx32/setrlimit.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getrlimit/ugetrlimit/setrlimit syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/setugid.c b/tests-mx32/setugid.c new file mode 100644 index 00000000..aba277c5 --- /dev/null +++ b/tests-mx32/setugid.c @@ -0,0 +1,91 @@ +/* + * Check decoding of setuid/setgid/setuid32/setgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +void +printuid(unsigned UGID_TYPE id) +{ + if (id == (unsigned UGID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const long tests[] = { + ugid, + 0xffff0000U | ugid, + (unsigned long) 0xffffffff00000000ULL | ugid, + 0xffffU, + -1U, + -1L + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int num = (unsigned UGID_TYPE) tests[i]; + long expected; + + if (num == ugid) + expected = 0; + else if ((UGID_TYPE) num == (UGID_TYPE) -1U) + expected = -1; + else + continue; + + const long rc = syscall(SYSCALL_NR, tests[i]); + const char *errstr = sprintrc(rc); + + if (rc != expected) { + if (!i && ENOSYS == errno) { + printf("%s(%u) = %s\n", + SYSCALL_NAME, ugid, errstr); + break; + } + perror_msg_and_fail("%s(%#lx) != %ld", + SYSCALL_NAME, tests[i], expected); + } + + printf("%s(", SYSCALL_NAME); + printuid(num); + printf(") = %s\n", errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/setuid.c b/tests-mx32/setuid.c new file mode 100644 index 00000000..df2e46b1 --- /dev/null +++ b/tests-mx32/setuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setuid + +# define SYSCALL_NR __NR_setuid +# define SYSCALL_NAME "setuid" + +# if defined __NR_setuid32 && __NR_setuid != __NR_setuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setuid") + +#endif diff --git a/tests-mx32/setuid.test b/tests-mx32/setuid.test new file mode 100755 index 00000000..9279233a --- /dev/null +++ b/tests-mx32/setuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/setuid32.c b/tests-mx32/setuid32.c new file mode 100644 index 00000000..c837d547 --- /dev/null +++ b/tests-mx32/setuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setuid32 + +# define SYSCALL_NR __NR_setuid32 +# define SYSCALL_NAME "setuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setuid32") + +#endif diff --git a/tests-mx32/setuid32.test b/tests-mx32/setuid32.test new file mode 100755 index 00000000..7998392a --- /dev/null +++ b/tests-mx32/setuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/shmxt.c b/tests-mx32/shmxt.c new file mode 100644 index 00000000..23cc7ccf --- /dev/null +++ b/tests-mx32/shmxt.c @@ -0,0 +1,68 @@ +#include "tests.h" +#include +#include +#include + +static int id = -1; + +static void +cleanup(void) +{ + shmctl(id, IPC_RMID, NULL); + id = -1; +} + +#ifdef __alpha__ +# define SHMAT "osf_shmat" +#else +# define SHMAT "shmat" +#endif + +int +main(void) +{ + static const int bogus_shmid = 0xfdb97531; + static const void * const bogus_shmaddr = + (void *) (unsigned long) 0xdec0ded1dec0ded2ULL; + static const int bogus_shmflg = 0xffffface; + + long rc; + + id = shmget(IPC_PRIVATE, 1, 0600); + if (id < 0) + perror_msg_and_skip("shmget"); + atexit(cleanup); + + rc = (long) shmat(bogus_shmid, bogus_shmaddr, bogus_shmflg); + printf("%s(%d, %p, SHM_REMAP|SHM_RDONLY|SHM_RND|%#x) = %s\n", + SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0x7000, + sprintrc(rc)); + + shmat(id, NULL, SHM_REMAP); + printf("%s(%d, NULL, SHM_REMAP) = -1 %s (%m)\n", + SHMAT, id, errno2name()); + + void *shmaddr = shmat(id, NULL, SHM_RDONLY); + if (shmaddr == (void *)(-1)) + perror_msg_and_skip("shmat SHM_RDONLY"); + printf("%s(%d, NULL, SHM_RDONLY) = %p\n", SHMAT, id, shmaddr); + + rc = shmdt(NULL); + printf("shmdt(NULL) = %s\n", sprintrc(rc)); + + if (shmdt(shmaddr)) + perror_msg_and_skip("shmdt"); + printf("shmdt(%p) = 0\n", shmaddr); + + ++shmaddr; + void *shmaddr2 = shmat(id, shmaddr, SHM_RND); + if (shmaddr2 == (void *)(-1)) + printf("%s(%d, %p, SHM_RND) = -1 %s (%m)\n", + SHMAT, id, shmaddr, errno2name()); + else + printf("%s(%d, %p, SHM_RND) = %p\n", + SHMAT, id, shmaddr, shmaddr2); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/shmxt.test b/tests-mx32/shmxt.test new file mode 100755 index 00000000..3757cfa4 --- /dev/null +++ b/tests-mx32/shmxt.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check shmat and shmdt syscalls decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha) shmat=osf_shmat ;; + *) shmat=shmat ;; +esac + +run_strace_match_diff -e trace=$shmat,shmdt -a11 diff --git a/tests-mx32/shutdown.c b/tests-mx32/shutdown.c new file mode 100644 index 00000000..d770c43a --- /dev/null +++ b/tests-mx32/shutdown.c @@ -0,0 +1,15 @@ +/* Check decoding of shutdown syscall. */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + int rc = shutdown(-1, SHUT_RDWR); + printf("shutdown(-1, SHUT_RDWR) = %d %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/shutdown.test b/tests-mx32/shutdown.test new file mode 100755 index 00000000..22f0d5ab --- /dev/null +++ b/tests-mx32/shutdown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of shutdown syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/sigaction.awk b/tests-mx32/sigaction.awk new file mode 100644 index 00000000..9c3a9ed3 --- /dev/null +++ b/tests-mx32/sigaction.awk @@ -0,0 +1,95 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2016 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + n1[1][1] = n2[1][1] = "SIG_IGN" + n1[1][2] = n2[1][2] = "\\[HUP INT\\]" + n1[1][3] = "SA_RESTORER\\|SA_RESTART" + n2[1][3] = "SA_RESTART" + n1[1][4] = ", sa_restorer=0x[0-9a-f]+" + n2[1][4] = "" + + n1[2][1] = n2[2][1] = "0x[0-9a-f]+" + n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" + n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" + n2[2][3] = "SA_SIGINFO" + n1[2][4] = ", sa_restorer=0x[0-9a-f]+" + n2[2][4] = "" + + n1[3][1] = n2[3][1] = "SIG_DFL" + n1[3][2] = n2[3][2] = "\\[\\]" + n1[3][3] = "SA_RESTORER" + n2[3][3] = "0" + n1[3][4] = ", sa_restorer=0x[0-9a-f]+" + n2[3][4] = "" + + n1[4][1] = n2[4][1] = "SIG_DFL" + n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" + n1[4][3] = "SA_RESTORER" + n2[4][3] = "0" + n1[4][4] = ", sa_restorer=0x[0-9a-f]+" + n2[4][4] = "" + + o1[1][1] = o2[1][1] = "SIG_DFL" + o1[1][2] = o2[1][2] = "\\[\\]" + o1[1][3] = o2[1][3] = "0" + o1[1][4] = o2[1][4] = "" + + for (i = 2; i < 5; i++) { + for (j = 1; j < 5; j++) { + o1[i][j] = n1[i - 1][j] + o2[i][j] = n2[i - 1][j] + } + } + + a1 = "(0x[0-9a-f]+, )?(4|8|16)" + a2 = "(4|8|16)(, 0x[0-9a-f]+)?" + a3 = "0x[0-9a-f]+, (4|8|16)" + + for (i = 1; i < 5; i++) { + r[i] = "^rt_sigaction\\(SIGUSR2, (" \ + "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ + ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ + o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ + o1[i][4] "\\}, " a1 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a2 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a3 ")\\) = 0$" + } + s[5] = "+++ exited with 0 +++" + + lines = 5 + fail = 0 +} + +@include "match.awk" diff --git a/tests-mx32/sigaction.c b/tests-mx32/sigaction.c new file mode 100644 index 00000000..1c034ff3 --- /dev/null +++ b/tests-mx32/sigaction.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +static void handle_signal(int no) +{ + _exit(128 + no); +} + +int +main(void) +{ + struct sigaction sa, sa0; + + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGHUP); + sigaddset(&sa.sa_mask, SIGINT); + sa.sa_flags = SA_RESTART; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = handle_signal; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGQUIT); + sigaddset(&sa.sa_mask, SIGTERM); + sa.sa_flags = SA_SIGINFO; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = SIG_DFL; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sigfillset(&sa.sa_mask); + sigdelset(&sa.sa_mask, SIGHUP); + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + return 0; +} diff --git a/tests-mx32/sigaction.test b/tests-mx32/sigaction.test new file mode 100755 index 00000000..fcde3baf --- /dev/null +++ b/tests-mx32/sigaction.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check rt_sigaction decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -ert_sigaction $args +match_awk + +exit 0 diff --git a/tests-mx32/sigaltstack.c b/tests-mx32/sigaltstack.c new file mode 100644 index 00000000..884e3c55 --- /dev/null +++ b/tests-mx32/sigaltstack.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +int +main(void) +{ + stack_t ss = { + .ss_sp = (void *) 0xbaadf00d, + .ss_flags = SS_DISABLE, + .ss_size = 0xdeadbeef + }; + if (sigaltstack(&ss, (stack_t *) 0)) + perror_msg_and_skip("sigaltstack"); + return 0; +} diff --git a/tests-mx32/sigaltstack.expected b/tests-mx32/sigaltstack.expected new file mode 100644 index 00000000..be8092ba --- /dev/null +++ b/tests-mx32/sigaltstack.expected @@ -0,0 +1,2 @@ +sigaltstack({ss_sp=0xbaadf00d, ss_flags=SS_DISABLE, ss_size=3735928559}, NULL) = 0 ++++ exited with 0 +++ diff --git a/tests-mx32/sigaltstack.test b/tests-mx32/sigaltstack.test new file mode 100755 index 00000000..ff83c2ea --- /dev/null +++ b/tests-mx32/sigaltstack.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check sigaltstack syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e sigaltstack $args +match_diff + +exit 0 diff --git a/tests-mx32/siginfo.c b/tests-mx32/siginfo.c new file mode 100644 index 00000000..2ecb13fd --- /dev/null +++ b/tests-mx32/siginfo.c @@ -0,0 +1,175 @@ +/* + * Check SIGCHLD siginfo_t decoding. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static siginfo_t sinfo; + +static void +handler(int no, siginfo_t *si, void *uc) +{ + memcpy(&sinfo, si, sizeof(sinfo)); +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + assert(sigaction(SIGCHLD, &sa, NULL) == 0); + + sigset_t block_mask, unblock_mask; + assert(sigprocmask(SIG_SETMASK, NULL, &block_mask) == 0); + sigaddset(&block_mask, SIGCHLD); + assert(sigprocmask(SIG_SETMASK, &block_mask, NULL) == 0); + + unblock_mask = block_mask; + sigdelset(&unblock_mask, SIGCHLD); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED" + ", si_pid=%d, si_uid=%u, si_status=%d" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, sinfo.si_status, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + int s; + assert(wait(&s) == pid); + assert(WIFEXITED(s) && WEXITSTATUS(s) == 42); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + char c; + assert(read(0, &c, sizeof(c)) == 1); + (void) raise(SIGUSR1); + return 1; + } + + (void) close(0); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED" + ", si_pid=%d, si_uid=%u, si_status=SIGUSR1" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(wait(&s) == pid); + assert(WIFSIGNALED(s) && WTERMSIG(s) == SIGUSR1); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_STOPPED" + ", si_pid=%d, si_uid=%u, si_status=SIGSTOP" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(kill(pid, SIGCONT) == 0); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_CONTINUED" + ", si_pid=%d, si_uid=%u, si_status=SIGCONT" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED" + ", si_pid=%d, si_uid=%u, si_status=0" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(wait(&s) == pid && s == 0); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/siginfo.test b/tests-mx32/siginfo.test new file mode 100755 index 00000000..725f714f --- /dev/null +++ b/tests-mx32/siginfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check SIGCHLD siginfo_t decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=none diff --git a/tests-mx32/signal2name.c b/tests-mx32/signal2name.c new file mode 100644 index 00000000..e301f4ee --- /dev/null +++ b/tests-mx32/signal2name.c @@ -0,0 +1,55 @@ +#include "tests.h" +#include + +#define CASE(x) case x: return #x + +const char * +signal2name(int sig) +{ + switch (sig) { + CASE(SIGALRM); + CASE(SIGBUS); + CASE(SIGCHLD); + CASE(SIGCONT); + CASE(SIGFPE); + CASE(SIGHUP); + CASE(SIGILL); + CASE(SIGINT); + CASE(SIGIO); + CASE(SIGPIPE); + CASE(SIGPROF); + CASE(SIGQUIT); + CASE(SIGSEGV); + CASE(SIGSYS); + CASE(SIGTERM); + CASE(SIGTRAP); + CASE(SIGTSTP); + CASE(SIGTTIN); + CASE(SIGTTOU); + CASE(SIGURG); + CASE(SIGUSR1); + CASE(SIGUSR2); + CASE(SIGVTALRM); + CASE(SIGWINCH); + CASE(SIGXCPU); + CASE(SIGXFSZ); +#if defined ALPHA + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGINFO); +#elif defined SPARC || defined SPARC64 + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGLOST); +#elif defined MIPS + CASE(SIGEMT); + CASE(SIGIOT); + CASE(SIGPWR); +#else + CASE(SIGABRT); + CASE(SIGPWR); + CASE(SIGSTKFLT); +#endif + default: perror_msg_and_fail("unknown signal number %d", sig); + } +} diff --git a/tests-mx32/signal_receive.c b/tests-mx32/signal_receive.c new file mode 100644 index 00000000..1c4293e5 --- /dev/null +++ b/tests-mx32/signal_receive.c @@ -0,0 +1,45 @@ +#include "tests.h" +#include +#include +#include + +void sig_print(const char *signame, const int pid, const int uid) +{ + printf("kill(%d, %s) = 0\n" + "--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" + ", si_uid=%d} ---\n", + pid, signame, signame, signame, pid, uid); +} + +static void +handler(int sig) +{ +} + +int +main(void) +{ + int sig, pid = getpid(), uid = getuid(); + const struct sigaction act = { .sa_handler = handler }; + sigset_t mask; + sigemptyset(&mask); + + for (sig = 1; sig <= 31; sig++) { + if( sig != SIGKILL && sig != SIGSTOP) { + sigaction(sig, &act, NULL); + sigaddset(&mask, sig); + } + } + sigprocmask(SIG_UNBLOCK, &mask, NULL); + + for (sig = 1; sig <= 31; sig++) { + if(sig != SIGKILL && sig != SIGSTOP) { + if (kill(pid, sig) != 0) + perror_msg_and_fail("kill: %d", sig); + sig_print(signal2name(sig), pid, uid); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/signal_receive.test b/tests-mx32/signal_receive.test new file mode 100755 index 00000000..9685b666 --- /dev/null +++ b/tests-mx32/signal_receive.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check whether strace traces signals properly. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -e trace=kill diff --git a/tests-mx32/signalfd4.c b/tests-mx32/signalfd4.c new file mode 100644 index 00000000..47e49b50 --- /dev/null +++ b/tests-mx32/signalfd4.c @@ -0,0 +1,86 @@ +/* + * Check decoding of signalfd4 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_rt_sigprocmask \ + && defined HAVE_SYS_SIGNALFD_H \ + && defined HAVE_SIGNALFD \ + && defined O_CLOEXEC + +# include +# include +# include +# include + +static unsigned int +get_sigset_size(void) +{ + const unsigned int big_size = 1024 / 8; + unsigned int set_size; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, + NULL, NULL, set_size)) + break; + } + + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + + return set_size; +} + +int +main(void) +{ + const char *const sigs = SIGUSR2 < SIGCHLD ? "USR2 CHLD" : "CHLD USR2"; + const unsigned int size = get_sigset_size(); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGCHLD); + + int fd = signalfd(-1, &mask, O_CLOEXEC | O_NONBLOCK); + printf("signalfd4(-1, [%s], %u, SFD_CLOEXEC|SFD_NONBLOCK) = %s\n", + sigs, size, sprintrc(fd)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask && HAVE_SYS_SIGNALFD_H" + " && HAVE_SIGNALFD && O_CLOEXEC") + +#endif diff --git a/tests-mx32/signalfd4.test b/tests-mx32/signalfd4.test new file mode 100755 index 00000000..a615a5bf --- /dev/null +++ b/tests-mx32/signalfd4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of signalfd4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/sigreturn.c b/tests-mx32/sigreturn.c new file mode 100644 index 00000000..dace040a --- /dev/null +++ b/tests-mx32/sigreturn.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +#else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +#endif + +static void handler(int sig) +{ +} + +int main(void) { + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGCHLD); + sigaddset(&set, RT_0 + 3); + sigaddset(&set, RT_0 + 4); + sigaddset(&set, RT_0 + 5); + sigaddset(&set, RT_0 + 26); + sigaddset(&set, RT_0 + 27); + sigprocmask(SIG_SETMASK, &set, NULL); + signal(SIGUSR1, handler); + raise(SIGUSR1); + return 0; +} diff --git a/tests-mx32/sigreturn.test b/tests-mx32/sigreturn.test new file mode 100755 index 00000000..f9a612bf --- /dev/null +++ b/tests-mx32/sigreturn.test @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Check rt_sigprocmask and sigreturn/rt_sigreturn decoding. +# +# Copyright (c) 2015-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -esignal $args + +mask='\[(USR2 CHLD|CHLD USR2) RT_3 RT_4 RT_5 RT_26 RT_27\]' +rt_sigprocmask='rt_sigprocmask\(SIG_SETMASK, '"$mask"', NULL, [[:digit:]]+\) += 0' +osf_sigprocmask='osf_sigprocmask\(SIG_SETMASK, '"$mask"'\) += 0 +\(old mask \[[^]]*\]\)' +EXPECTED="$LOG.expected" + +cat > "$EXPECTED" << __EOF__ +$rt_sigprocmask|$osf_sigprocmask +(rt_)?sigreturn\\((\\{mask=$mask\\})?\\) += 0 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" + +exit 0 diff --git a/tests-mx32/sleep.c b/tests-mx32/sleep.c new file mode 100644 index 00000000..f4bce3cd --- /dev/null +++ b/tests-mx32/sleep.c @@ -0,0 +1,49 @@ +/* + * A simple nanosleep based sleep(1) replacement. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 2) + error_msg_and_fail("missing operand"); + + if (ac > 2) + error_msg_and_fail("extra operand"); + + struct timespec ts = { atoi(av[1]), 0 }; + + if (nanosleep(&ts, NULL)) + perror_msg_and_fail("nanosleep"); + + return 0; +} diff --git a/tests-mx32/socketcall.c b/tests-mx32/socketcall.c new file mode 100644 index 00000000..4fe1ea3a --- /dev/null +++ b/tests-mx32/socketcall.c @@ -0,0 +1,95 @@ +/* + * Check decoding of socketcall syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_socketcall + +# include +# include +# include + +# include "xlat.h" +# include "xlat/socketcalls.h" + +static const char * +xlookup_uint(const struct xlat *xlat, const unsigned int val) +{ + for (; xlat->str != NULL; xlat++) + if (xlat->val == val) + return xlat->str; + return NULL; +} + +static const int sc_min = 1, sc_max = 20; +static void *efault; + +static void +test_socketcall(const int i, const void *const addr) +{ + const unsigned long call = + (unsigned long) 0xfacefeed00000000ULL | (unsigned int) i; + + long rc = syscall(__NR_socketcall, call, addr); + + if (i < sc_min || i > sc_max) { + printf("socketcall(%d, %p) = %ld %s (%m)\n", + (int) call, addr, rc, errno2name()); + } else if (addr == efault) { + const char *const str = xlookup_uint(socketcalls, i); + assert(str); + printf("socketcall(%s, %p) = %ld %s (%m)\n", + str, addr, rc, errno2name()); + } +} +int +main(void) +{ + assert((unsigned) sc_min == socketcalls[0].val); + assert((unsigned) sc_max == socketcalls[ARRAY_SIZE(socketcalls) - 2].val); + + const unsigned long *const args = tail_alloc(sizeof(*args) * 6); + efault = tail_alloc(1) + 1; + + int i; + for (i = sc_min - 3; i <= sc_max + 3; ++i) { + test_socketcall(i, efault); + test_socketcall(i, args); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_socketcall") + +#endif diff --git a/tests-mx32/socketcall.test b/tests-mx32/socketcall.test new file mode 100755 index 00000000..959bc83d --- /dev/null +++ b/tests-mx32/socketcall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of socketcall syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/sockname.c b/tests-mx32/sockname.c new file mode 100644 index 00000000..c5072cac --- /dev/null +++ b/tests-mx32/sockname.c @@ -0,0 +1,156 @@ +/* + * Check decoding of sockname family syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef TEST_SYSCALL_NAME +# error TEST_SYSCALL_NAME must be defined +#endif + +#define TEST_SYSCALL_STR__(a) #a +#define TEST_SYSCALL_STR_(a) TEST_SYSCALL_STR__(a) +#define TEST_SYSCALL_STR TEST_SYSCALL_STR_(TEST_SYSCALL_NAME) +#define TEST_SOCKET TEST_SYSCALL_STR ".socket" + +#ifdef TEST_SYSCALL_PREPARE +# define PREPARE_TEST_SYSCALL_INVOCATION do { TEST_SYSCALL_PREPARE; } while (0) +#else +# define PREPARE_TEST_SYSCALL_INVOCATION do {} while (0) +#endif + +#ifndef PREFIX_S_ARGS +# define PREFIX_S_ARGS +#endif +#ifndef PREFIX_F_ARGS +# define PREFIX_F_ARGS +#endif +#ifndef PREFIX_S_STR +# define PREFIX_S_STR "" +#endif +#ifndef PREFIX_F_STR +# define PREFIX_F_STR "" +#endif +#ifndef SUFFIX_ARGS +# define SUFFIX_ARGS +#endif +#ifndef SUFFIX_STR +# define SUFFIX_STR "" +#endif + +static void +test_sockname_syscall(const int fd) +{ + socklen_t *const plen = tail_alloc(sizeof(*plen)); + *plen = sizeof(struct sockaddr_un); + struct sockaddr_un *addr = tail_alloc(*plen); + + PREPARE_TEST_SYSCALL_INVOCATION; + int rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, addr->sun_path, + (int) sizeof(struct sockaddr_un), (int) *plen, SUFFIX_STR, rc); + + memset(addr, 0, sizeof(*addr)); + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", [%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, addr->sun_path, + (int) *plen, SUFFIX_STR, rc); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, 0 SUFFIX_ARGS); + printf("%s(%d%s, %p, NULL%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, SUFFIX_STR, + sprintrc(rc)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, 0, 0 SUFFIX_ARGS); + printf("%s(%d%s, NULL, NULL%s) = %s\n", + TEST_SYSCALL_STR, fd, rc == -1 ? PREFIX_F_STR : PREFIX_S_STR, + SUFFIX_STR, sprintrc(rc)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, + plen + 1 SUFFIX_ARGS); + printf("%s(%d%s, %p, %p%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, + plen + 1, SUFFIX_STR, sprintrc(rc)); + + const size_t offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + *plen = offsetof_sun_path; + memset(addr->sun_path, 'A', sizeof(addr->sun_path)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX}, [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, + (int) offsetof_sun_path, (int) *plen, SUFFIX_STR, rc); + + ++addr; + *plen = sizeof(struct sockaddr); + addr = (void *) addr - *plen; + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%.*s\"}" + ", [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, + (int) (sizeof(struct sockaddr) - offsetof_sun_path), + addr->sun_path, (int) sizeof(struct sockaddr), + (int) *plen, SUFFIX_STR, rc); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, + plen SUFFIX_ARGS); + printf("%s(%d%s, %p, [%d]%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, + *plen, SUFFIX_STR, sprintrc(rc)); +} diff --git a/tests-mx32/splice.c b/tests-mx32/splice.c new file mode 100644 index 00000000..b6f25256 --- /dev/null +++ b/tests-mx32/splice.c @@ -0,0 +1,65 @@ +/* + * This file is part of splice strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_splice + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; + long long int *const off_in = tail_alloc(sizeof(*off_in)); + long long int *const off_out = tail_alloc(sizeof(*off_out)); + *off_in = 0xdeadbef1facefed1ULL; + *off_out = 0xdeadbef2facefed2ULL; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 15; + + long rc = syscall(__NR_splice, + fd_in, off_in, fd_out, off_out, len, flags); + printf("splice(%d, [%lld], %d, [%lld], %zu, %s) = %ld %s (%m)\n", + (int) fd_in, *off_in, (int) fd_out, *off_out, len, + "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_splice") + +#endif diff --git a/tests-mx32/splice.test b/tests-mx32/splice.test new file mode 100755 index 00000000..cc5c327e --- /dev/null +++ b/tests-mx32/splice.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check splice syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/sprintrc.c b/tests-mx32/sprintrc.c new file mode 100644 index 00000000..7423afb6 --- /dev/null +++ b/tests-mx32/sprintrc.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +enum sprintrc_fmt { + SPRINTRC_FMT_RAW, + SPRINTRC_FMT_GREP, +}; + +/** + * Provides pointer to static string buffer with printed return code in format + * used by strace - with errno and error message. + * + * @param rc Return code. + * @param fmt Output format. Currently, raw (used for diff matching) and grep + * (for extended POSIX regex-based pattern matching) formats are + * supported. + * @return Pointer to (statically allocated) buffer containing decimal + * representation of return code and errno/error message in case @rc + * is equal to -1. + */ +static inline const char * +sprintrc_ex(long rc, enum sprintrc_fmt fmt) +{ + static const char *formats[] = { + [SPRINTRC_FMT_RAW] = "-1 %s (%m)", + [SPRINTRC_FMT_GREP] = "-1 %s \\(%m\\)", + }; + static char buf[4096]; + + if (fmt >= ARRAY_SIZE(formats)) + perror_msg_and_fail("sprintrc_ex: incorrect format provided"); + + if (rc == 0) + return "0"; + + int ret = (rc == -1) + ? snprintf(buf, sizeof(buf), formats[fmt], errno2name()) + : snprintf(buf, sizeof(buf), "%ld", rc); + + if (ret < 0) + perror_msg_and_fail("snprintf"); + if ((size_t) ret >= sizeof(buf)) + error_msg_and_fail("snprintf overflow: got %d, expected" + " no more than %zu", ret, sizeof(buf)); + + return buf; +} + +const char * +sprintrc(long rc) +{ + return sprintrc_ex(rc, SPRINTRC_FMT_RAW); +} + +const char * +sprintrc_grep(long rc) +{ + return sprintrc_ex(rc, SPRINTRC_FMT_GREP); +} diff --git a/tests-mx32/stack-fcall-0.c b/tests-mx32/stack-fcall-0.c new file mode 100644 index 00000000..12a260de --- /dev/null +++ b/tests-mx32/stack-fcall-0.c @@ -0,0 +1,6 @@ +int f1(int i); + +int f0(int i) +{ + return f1(i) - i; +} diff --git a/tests-mx32/stack-fcall-1.c b/tests-mx32/stack-fcall-1.c new file mode 100644 index 00000000..8716702d --- /dev/null +++ b/tests-mx32/stack-fcall-1.c @@ -0,0 +1,6 @@ +int f2(int i); + +int f1(int i) +{ + return f2(i) + i; +} diff --git a/tests-mx32/stack-fcall-2.c b/tests-mx32/stack-fcall-2.c new file mode 100644 index 00000000..19f8cf83 --- /dev/null +++ b/tests-mx32/stack-fcall-2.c @@ -0,0 +1,6 @@ +int f3(int i); + +int f2(int i) +{ + return f3(i) - i; +} diff --git a/tests-mx32/stack-fcall-3.c b/tests-mx32/stack-fcall-3.c new file mode 100644 index 00000000..3af1667f --- /dev/null +++ b/tests-mx32/stack-fcall-3.c @@ -0,0 +1,6 @@ +#include + +int f3(int i) +{ + return getpid() + i; +} diff --git a/tests-mx32/stack-fcall.c b/tests-mx32/stack-fcall.c new file mode 100644 index 00000000..134d54f6 --- /dev/null +++ b/tests-mx32/stack-fcall.c @@ -0,0 +1,7 @@ +int f0(int i); + +int main(int argc, char** argv) +{ + f0(argc); + return 0; +} diff --git a/tests-mx32/stat.c b/tests-mx32/stat.c new file mode 100644 index 00000000..d4ca7b0b --- /dev/null +++ b/tests-mx32/stat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_stat + +# define TEST_SYSCALL_NR __NR_stat +# define TEST_SYSCALL_STR "stat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_stat") + +#endif diff --git a/tests-mx32/stat.test b/tests-mx32/stat.test new file mode 100755 index 00000000..ba8938c0 --- /dev/null +++ b/tests-mx32/stat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check stat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/stat64.c b/tests-mx32/stat64.c new file mode 100644 index 00000000..782de33d --- /dev/null +++ b/tests-mx32/stat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_stat64 + +# define TEST_SYSCALL_NR __NR_stat64 +# define TEST_SYSCALL_STR "stat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_stat64") + +#endif diff --git a/tests-mx32/stat64.test b/tests-mx32/stat64.test new file mode 100755 index 00000000..abcfb9ec --- /dev/null +++ b/tests-mx32/stat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check stat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/statfs.c b/tests-mx32/statfs.c new file mode 100644 index 00000000..6032a668 --- /dev/null +++ b/tests-mx32/statfs.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_statfs + +# define SYSCALL_ARG_FMT "\"%s\"" +# define SYSCALL_ARG(file, desc) (file) +# define SYSCALL_NR __NR_statfs +# define SYSCALL_NAME "statfs" +# include "xstatfs.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statfs") + +#endif diff --git a/tests-mx32/statfs.expected b/tests-mx32/statfs.expected new file mode 100644 index 00000000..11e9f0b1 --- /dev/null +++ b/tests-mx32/statfs.expected @@ -0,0 +1 @@ +statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type=PROC_SUPER_MAGIC, f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{val=\[[0-9]+, [0-9]+\]\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=ST_VALID(\|ST_[A-Z]+)*)?\}\) += 0 diff --git a/tests-mx32/statfs.test b/tests-mx32/statfs.test new file mode 100755 index 00000000..6075576f --- /dev/null +++ b/tests-mx32/statfs.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check statfs syscall decoding. + +. "${srcdir=.}/init.sh" + +# this test probes /proc/self/status +[ -f /proc/self/status ] || + framework_skip_ '/proc/self/status is not available' + +run_strace_match_diff -a17 diff --git a/tests-mx32/statfs64.c b/tests-mx32/statfs64.c new file mode 100644 index 00000000..f46e7670 --- /dev/null +++ b/tests-mx32/statfs64.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_statfs64 + +# define SYSCALL_ARG_FMT "\"%s\"" +# define SYSCALL_ARG(file, desc) (file) +# define SYSCALL_NR __NR_statfs64 +# define SYSCALL_NAME "statfs64" +# include "xstatfs64.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statfs64") + +#endif diff --git a/tests-mx32/statfs64.test b/tests-mx32/statfs64.test new file mode 100755 index 00000000..9c0aa278 --- /dev/null +++ b/tests-mx32/statfs64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check statfs64 syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests-mx32/statx.sh b/tests-mx32/statx.sh new file mode 100755 index 00000000..a630193d --- /dev/null +++ b/tests-mx32/statx.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of stat family syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -P $NAME.sample -P /dev/full -a32 diff --git a/tests-mx32/strace-C.expected b/tests-mx32/strace-C.expected new file mode 100644 index 00000000..832af1f3 --- /dev/null +++ b/tests-mx32/strace-C.expected @@ -0,0 +1,3 @@ +nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 +\+\+\+ exited with 0 \+\+\+ +[ ]*[0-9][0-9]*[.][0-9][0-9]* *0[.]0[0-9]* *[0-9][0-9]* *1 *nanosleep diff --git a/tests-mx32/strace-C.test b/tests-mx32/strace-C.test new file mode 100755 index 00000000..ccca9a09 --- /dev/null +++ b/tests-mx32/strace-C.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -C option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -a24 -C -enanosleep ./sleep 1 +match_grep diff --git a/tests-mx32/strace-E.expected b/tests-mx32/strace-E.expected new file mode 100644 index 00000000..d7823b7a --- /dev/null +++ b/tests-mx32/strace-E.expected @@ -0,0 +1 @@ +execve\("\./sleep", \["\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 diff --git a/tests-mx32/strace-E.test b/tests-mx32/strace-E.test new file mode 100755 index 00000000..d76ec3f5 --- /dev/null +++ b/tests-mx32/strace-E.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -E option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 > /dev/null +run_strace -E option_E_var=OPTION_E_VAL -v $args +match_grep diff --git a/tests-mx32/strace-S.test b/tests-mx32/strace-S.test new file mode 100755 index 00000000..3ea315ce --- /dev/null +++ b/tests-mx32/strace-S.test @@ -0,0 +1,32 @@ +#!/bin/sh + +# Check -S option. + +. "${srcdir=.}/init.sh" + +run_prog ./readv > /dev/null + +test_c() +{ + local sortby sortopts sedexpr + sortby="$1"; shift + sortopts="$1"; shift + sedexpr="$1"; shift + + run_strace -c -w -S "$sortby" ./readv > /dev/null + sed -r -n -e "$sedexpr" < "$LOG" > "$OUT" + + [ -s "$OUT" ] || + fail_ "$STRACE $args output mismatch" + LC_ALL=C sort -c $sortopts "$OUT" || { + echo 'Actual output:' + cat < "$LOG" + fail_ "$STRACE $args output not sorted properly" + } +} + +c='[[:space:]]+([^[:space:]]+)' +test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p' +test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p' + +rm -f "$OUT" diff --git a/tests-mx32/strace-T.expected b/tests-mx32/strace-T.expected new file mode 100644 index 00000000..1ea02046 --- /dev/null +++ b/tests-mx32/strace-T.expected @@ -0,0 +1 @@ +nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 <(1\.[01]|0\.9)[[:digit:]]{5}> diff --git a/tests-mx32/strace-T.test b/tests-mx32/strace-T.test new file mode 100755 index 00000000..7ab84a74 --- /dev/null +++ b/tests-mx32/strace-T.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -T option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -a24 -T -enanosleep ./sleep 1 +match_grep diff --git a/tests-mx32/strace-V.test b/tests-mx32/strace-V.test new file mode 100755 index 00000000..9a051e00 --- /dev/null +++ b/tests-mx32/strace-V.test @@ -0,0 +1,24 @@ +#!/bin/sh + +# Check -V option. +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%Y > /dev/null +year="$(date +%Y)" + +run_strace -V > "$LOG" + +getval() +{ + sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' ../config.h +} + +cat > "$EXP" << __EOF__ +$(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION) +Copyright (C) 1991-$year The strace developers <$(getval PACKAGE_URL)>. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +__EOF__ + +match_diff "$EXP" "$LOG" +rm -f "$EXP" diff --git a/tests-mx32/strace-ff.expected b/tests-mx32/strace-ff.expected new file mode 100644 index 00000000..627a1b4c --- /dev/null +++ b/tests-mx32/strace-ff.expected @@ -0,0 +1,2 @@ +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests-mx32/strace-ff.test b/tests-mx32/strace-ff.test new file mode 100755 index 00000000..2ce06f19 --- /dev/null +++ b/tests-mx32/strace-ff.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check -ff option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +./set_ptracer_any ./sleep 1 > "$OUT" & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any sleep failed' +done + +rm -f "$LOG".* +run_strace -a14 -eexit_group -ff -p $tracee_pid + +# check that output matches +match_diff "$LOG.$tracee_pid" + +# check that no other output files have been created +set -- "$LOG".* +[ "$LOG.$tracee_pid" = "$*" ] || + fail_ "too many output files: $*" + +rm -f "$OUT" "$LOG.$tracee_pid" diff --git a/tests-mx32/strace-k.test b/tests-mx32/strace-k.test new file mode 100755 index 00000000..d5e8ed2b --- /dev/null +++ b/tests-mx32/strace-k.test @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Ensure that strace -k works. +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -k is implemented using /proc/$pid/maps +[ -f /proc/self/maps ] || + framework_skip_ '/proc/self/maps is not available' + +check_prog sed +check_prog tr + +run_prog ./stack-fcall +run_strace -e getpid -k $args + +expected='getpid f3 f2 f1 f0 main ' +result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" | + tr '\n' ' ') + +test "$result" = "$expected" || { + echo "expected: \"$expected\"" + echo "result: \"$result\"" + dump_log_and_fail_with "$STRACE $args output mismatch" +} + +exit 0 diff --git a/tests-mx32/strace-r.expected b/tests-mx32/strace-r.expected new file mode 100644 index 00000000..8009c353 --- /dev/null +++ b/tests-mx32/strace-r.expected @@ -0,0 +1,2 @@ +[ ]{5}0\.0{6} execve\("\./sleep", \["\./sleep", "1"\], \[/\* [[:digit:]]+ vars \*/\]\) = 0 +[ ]{5}(1\.[01]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+ diff --git a/tests-mx32/strace-r.test b/tests-mx32/strace-r.test new file mode 100755 index 00000000..4ba01f12 --- /dev/null +++ b/tests-mx32/strace-r.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -r option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -r -eexecve ./sleep 1 +match_grep diff --git a/tests-mx32/strace-t.test b/tests-mx32/strace-t.test new file mode 100755 index 00000000..1d213e63 --- /dev/null +++ b/tests-mx32/strace-t.test @@ -0,0 +1,20 @@ +#!/bin/sh + +# Check -t option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%T > /dev/null +run_prog ./sleep 0 + +t0="$(date +%T)" +run_strace -t -eexecve $args +t1="$(date +%T)" + +EXPECTED="$LOG.expected" +cat > "$EXPECTED" << __EOF__ +($t0|$t1) execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" diff --git a/tests-mx32/strace-tt.test b/tests-mx32/strace-tt.test new file mode 100755 index 00000000..3f80001e --- /dev/null +++ b/tests-mx32/strace-tt.test @@ -0,0 +1,28 @@ +#!/bin/sh + +# Check -tt option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > "$LOG" +run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null +run_prog ./sleep 0 + +s0="$(date +%s)" +run_strace -tt -eexecve $args +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + t="$(date +%T --date "@$s")" + [ -z "$t_reg" ] && t_reg="$t" || t_reg="$t_reg|$t" + s=$(($s + 1)) +done + +cat > "$EXP" << __EOF__ +($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-mx32/strace-ttt.test b/tests-mx32/strace-ttt.test new file mode 100755 index 00000000..4439715b --- /dev/null +++ b/tests-mx32/strace-ttt.test @@ -0,0 +1,26 @@ +#!/bin/sh + +# Check -ttt option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > /dev/null +run_prog ./sleep 0 + +s0="$(date +%s)" +run_strace -ttt -eexecve $args +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + [ -z "$t_reg" ] && t_reg="$s" || t_reg="$t_reg|$s" + s=$(($s + 1)) +done + +cat > "$EXP" << __EOF__ +($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests-mx32/strace.supp b/tests-mx32/strace.supp new file mode 100644 index 00000000..578b0a25 --- /dev/null +++ b/tests-mx32/strace.supp @@ -0,0 +1,7 @@ +{ + get_cpuset_size: sched_getaffinity with NULL mask + Memcheck:Param + sched_getaffinity(mask) + fun:sched_getaffinity* + fun:get_cpuset_size +} diff --git a/tests-mx32/struct_flock.c b/tests-mx32/struct_flock.c new file mode 100644 index 00000000..34cf58e6 --- /dev/null +++ b/tests-mx32/struct_flock.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include "flock.h" + +#define FILE_LEN 4096 +#define EINVAL_STR "-1 EINVAL (Invalid argument)" + +#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) + +#ifdef HAVE_TYPEOF +# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) +#else +# define TYPEOF_FLOCK_OFF_T off_t +#endif + +static long +invoke_test_syscall(const unsigned int cmd, void *const p) +{ + const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd; + + return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p); +} + +static void +test_flock_einval(const int cmd, const char *name) +{ + struct_kernel_flock fl = { + .l_type = F_RDLCK, + .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL, + .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); +} + +static void +test_flock(void) +{ + TEST_FLOCK_EINVAL(F_SETLK); + TEST_FLOCK_EINVAL(F_SETLKW); + + struct_kernel_flock fl = { + .l_type = F_RDLCK, + .l_len = FILE_LEN + }; + long rc = invoke_test_syscall(F_SETLK, &fl); + printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + if (rc) + return; + + invoke_test_syscall(F_GETLK, &fl); + printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(F_SETLK, &fl); + printf("%s(0, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +static void +create_sample(void) +{ + char fname[] = TEST_SYSCALL_STR "_XXXXXX"; + + (void) close(0); + if (mkstemp(fname)) + perror_msg_and_fail("mkstemp: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(0, FILE_LEN)) + perror_msg_and_fail("ftruncate"); +} diff --git a/tests-mx32/sun_path.expected b/tests-mx32/sun_path.expected new file mode 100644 index 00000000..30a11c03 --- /dev/null +++ b/tests-mx32/sun_path.expected @@ -0,0 +1,3 @@ +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, 110\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, \[110->111\]\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, 110\) += 0 diff --git a/tests-mx32/sun_path.test b/tests-mx32/sun_path.test new file mode 100755 index 00000000..728328a8 --- /dev/null +++ b/tests-mx32/sun_path.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check how long sun_path addresses are traced. + +. "${srcdir=.}/init.sh" + +run_prog ./net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 +run_strace_merge -ebind,connect,getsockname $args +match_grep + +exit 0 diff --git a/tests-mx32/swap.c b/tests-mx32/swap.c new file mode 100644 index 00000000..77b25050 --- /dev/null +++ b/tests-mx32/swap.c @@ -0,0 +1,51 @@ +#include "tests.h" +#include + +#if defined __NR_swapon && defined __NR_swapoff + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "swap.sample"; + long rc; + + rc = syscall(__NR_swapon, sample, 0); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "0", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, 42); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "42", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, SWAP_FLAG_PREFER); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "SWAP_FLAG_PREFER|0", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, SWAP_FLAG_PREFER | 42); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "SWAP_FLAG_PREFER|42", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, -1L); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, + "SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|SWAP_FLAG_DISCARD_ONCE" + "|SWAP_FLAG_DISCARD_PAGES|0xfff80000|32767", + rc, errno2name()); + + rc = syscall(__NR_swapoff, sample); + printf("swapoff(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_swapon && __NR_swapoff") + +#endif diff --git a/tests-mx32/swap.test b/tests-mx32/swap.test new file mode 100755 index 00000000..a30e1fd8 --- /dev/null +++ b/tests-mx32/swap.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check swapon and swapoff syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests-mx32/symlink.c b/tests-mx32/symlink.c new file mode 100644 index 00000000..72cb4908 --- /dev/null +++ b/tests-mx32/symlink.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_symlink + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "symlink_new"; + static const char sample_2[] = "symlink"; + + long rc = syscall(__NR_symlink, sample_1, sample_2); + printf("symlink(\"%s\", \"%s\") = %ld %s (%m)\n", + sample_1, sample_2, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_symlink") + +#endif diff --git a/tests-mx32/symlink.test b/tests-mx32/symlink.test new file mode 100755 index 00000000..79b93baa --- /dev/null +++ b/tests-mx32/symlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check symlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-mx32/symlinkat.c b/tests-mx32/symlinkat.c new file mode 100644 index 00000000..6e5d617d --- /dev/null +++ b/tests-mx32/symlinkat.c @@ -0,0 +1,28 @@ +#include "tests.h" +#include + +#ifdef __NR_symlinkat + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + static const char oldpath[] = "symlink_old"; + static const char newpath[] = "symlink_new"; + + long rc = syscall(__NR_symlinkat, oldpath, fd, newpath); + printf("symlinkat(\"%s\", %d, \"%s\") = %ld %s (%m)\n", + oldpath, (int) fd, newpath, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_symlinkat") + +#endif diff --git a/tests-mx32/symlinkat.test b/tests-mx32/symlinkat.test new file mode 100755 index 00000000..d8501ffd --- /dev/null +++ b/tests-mx32/symlinkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check symlinkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/sync.c b/tests-mx32/sync.c new file mode 100644 index 00000000..e6e7ce37 --- /dev/null +++ b/tests-mx32/sync.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_sync + +# include +# include + +int +main(void) +{ + printf("sync() = %ld\n", syscall(__NR_sync)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sync") + +#endif diff --git a/tests-mx32/sync.test b/tests-mx32/sync.test new file mode 100755 index 00000000..f6bf6c8f --- /dev/null +++ b/tests-mx32/sync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a7 diff --git a/tests-mx32/sync_file_range.c b/tests-mx32/sync_file_range.c new file mode 100644 index 00000000..67d31a89 --- /dev/null +++ b/tests-mx32/sync_file_range.c @@ -0,0 +1,63 @@ +/* + * Check decoding of sync_file_range syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined HAVE_SYNC_FILE_RANGE && defined __NR_sync_file_range + +# include + +int +main(void) +{ + const int fd = -1; + const off64_t offset = 0xdeadbeefbadc0dedULL; + const off64_t nbytes = 0xfacefeedcafef00dULL; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); + printf("%s(%d, %lld, %lld, SYNC_FILE_RANGE_WAIT_BEFORE" + "|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER" + "|0xfffffff8) = %d %s (%m)\n", + "sync_file_range", fd, + (long long) offset, + (long long) nbytes, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYNC_FILE_RANGE && __NR_sync_file_range") + +#endif diff --git a/tests-mx32/sync_file_range.test b/tests-mx32/sync_file_range.test new file mode 100755 index 00000000..6aa86d6c --- /dev/null +++ b/tests-mx32/sync_file_range.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync_file_range syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/sync_file_range2.c b/tests-mx32/sync_file_range2.c new file mode 100644 index 00000000..6ce7db26 --- /dev/null +++ b/tests-mx32/sync_file_range2.c @@ -0,0 +1,63 @@ +/* + * Check decoding of sync_file_range2 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined HAVE_SYNC_FILE_RANGE && defined __NR_sync_file_range2 + +# include + +int +main(void) +{ + const int fd = -1; + const off64_t offset = 0xdeadbeefbadc0ded; + const off64_t nbytes = 0xfacefeedcafef00d; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); + printf("%s(%d, SYNC_FILE_RANGE_WAIT_BEFORE" + "|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER" + "|0xfffffff8, %lld, %lld) = %d %s (%m)\n", + "sync_file_range2", fd, + (long long) offset, + (long long) nbytes, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYNC_FILE_RANGE && __NR_sync_file_range2") + +#endif diff --git a/tests-mx32/sync_file_range2.test b/tests-mx32/sync_file_range2.test new file mode 100755 index 00000000..0d9945ed --- /dev/null +++ b/tests-mx32/sync_file_range2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync_file_range2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/sysinfo.c b/tests-mx32/sysinfo.c new file mode 100644 index 00000000..377bdc9c --- /dev/null +++ b/tests-mx32/sysinfo.c @@ -0,0 +1,76 @@ +/* + * This file is part of sysinfo strace test. + * + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + sysinfo(NULL); + printf("sysinfo(NULL) = -1 EFAULT (%m)\n"); + + struct sysinfo * const si = tail_alloc(sizeof(*si)); + + if (sysinfo(si)) + perror_msg_and_skip("sysinfo"); + printf("sysinfo({uptime=%llu" + ", loads=[%llu, %llu, %llu]" + ", totalram=%llu" + ", freeram=%llu" + ", sharedram=%llu" + ", bufferram=%llu" + ", totalswap=%llu" + ", freeswap=%llu" + ", procs=%u" + ", totalhigh=%llu" + ", freehigh=%llu" + ", mem_unit=%u" + "}) = 0\n" + , (unsigned long long) si->uptime + , (unsigned long long) si->loads[0] + , (unsigned long long) si->loads[1] + , (unsigned long long) si->loads[2] + , (unsigned long long) si->totalram + , (unsigned long long) si->freeram + , (unsigned long long) si->sharedram + , (unsigned long long) si->bufferram + , (unsigned long long) si->totalswap + , (unsigned long long) si->freeswap + , (unsigned) si->procs + , (unsigned long long) si->totalhigh + , (unsigned long long) si->freehigh + , si->mem_unit + ); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/sysinfo.test b/tests-mx32/sysinfo.test new file mode 100755 index 00000000..806d8b61 --- /dev/null +++ b/tests-mx32/sysinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sysinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/syslog.c b/tests-mx32/syslog.c new file mode 100644 index 00000000..5df96cb8 --- /dev/null +++ b/tests-mx32/syslog.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_syslog + +# include +# include + +# define SYSLOG_ACTION_READ 2 + +int +main(void) +{ + const long addr = (long) 0xfacefeeddeadbeefULL; + int rc = syscall(__NR_syslog, SYSLOG_ACTION_READ, addr, -1); + printf("syslog(SYSLOG_ACTION_READ, %#lx, -1) = %d %s (%m)\n", + addr, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_syslog") + +#endif diff --git a/tests-mx32/syslog.test b/tests-mx32/syslog.test new file mode 100755 index 00000000..1c2158e4 --- /dev/null +++ b/tests-mx32/syslog.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check syslog syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/tail_alloc.c b/tests-mx32/tail_alloc.c new file mode 100644 index 00000000..08081d4f --- /dev/null +++ b/tests-mx32/tail_alloc.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +void * +tail_alloc(const size_t size) +{ + const size_t page_size = get_page_size(); + const size_t len = (size + page_size - 1) & -page_size; + const size_t alloc_size = len + 6 * page_size; + + void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (MAP_FAILED == p) + perror_msg_and_fail("mmap(%zu)", alloc_size); + + void *start_work = p + 3 * page_size; + void *tail_guard = start_work + len; + + if (munmap(p, page_size) || + munmap(p + 2 * page_size, page_size) || + munmap(tail_guard, page_size) || + munmap(tail_guard + 2 * page_size, page_size)) + perror_msg_and_fail("munmap"); + + memset(start_work, 0xff, len); + return tail_guard - size; +} + +void * +tail_memdup(const void *p, const size_t size) +{ + void *dest = tail_alloc(size); + memcpy(dest, p, size); + return dest; +} diff --git a/tests-mx32/tee.c b/tests-mx32/tee.c new file mode 100644 index 00000000..66d1c94f --- /dev/null +++ b/tests-mx32/tee.c @@ -0,0 +1,60 @@ +/* + * This file is part of tee strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_tee + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 15; + + long rc = syscall(__NR_tee, fd_in, fd_out, len, flags); + printf("tee(%d, %d, %zu, %s) = %ld %s (%m)\n", + (int) fd_in, (int) fd_out, len, + "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_tee") + +#endif diff --git a/tests-mx32/tee.test b/tests-mx32/tee.test new file mode 100755 index 00000000..76b60003 --- /dev/null +++ b/tests-mx32/tee.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check tee syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/tests.h b/tests-mx32/tests.h new file mode 100644 index 00000000..d4294de9 --- /dev/null +++ b/tests-mx32/tests.h @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_H +#define STRACE_TESTS_H + +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif + +# include +# include "kernel_types.h" +# include "gcc_compat.h" + +/* Tests of "strace -v" are expected to define VERBOSE to 1. */ +#ifndef VERBOSE +# define VERBOSE 0 +#endif + +/* Cached sysconf(_SC_PAGESIZE). */ +size_t get_page_size(void); + +/* Print message and strerror(errno) to stderr, then exit(1). */ +void perror_msg_and_fail(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message to stderr, then exit(1). */ +void error_msg_and_fail(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message to stderr, then exit(77). */ +void error_msg_and_skip(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message and strerror(errno) to stderr, then exit(77). */ +void perror_msg_and_skip(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; + +/* + * Allocate memory that ends on the page boundary. + * Pages allocated by this call are preceeded by an unmapped page + * and followed also by an unmapped page. + */ +void *tail_alloc(const size_t) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)); +/* Allocate memory using tail_alloc, then memcpy. */ +void *tail_memdup(const void *, const size_t) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2)); + +/* + * Fill memory (pointed by ptr, having size bytes) with different bytes (with + * values starting with start and resetting every period) in order to catch + * sign, byte order and/or alignment errors. + */ +void fill_memory_ex(void *ptr, size_t size, unsigned char start, + unsigned char period); +/* Shortcut for fill_memory_ex(ptr, size, 0x80, 0x80) */ +void fill_memory(void *ptr, size_t size); + +/* Close stdin, move stdout to a non-standard descriptor, and print. */ +void tprintf(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)); + +/* Make a hexdump copy of C string */ +const char *hexdump_strdup(const char *); + +/* Make a hexdump copy of memory */ +const char *hexdump_memdup(const char *, size_t); + +/* Make a hexquoted copy of a string */ +const char *hexquote_strndup(const char *, size_t); + +/* Return inode number of socket descriptor. */ +unsigned long inode_of_sockfd(int); + +/* Print string in a quoted form. */ +void print_quoted_string(const char *); + +/* Print memory in a quoted form. */ +void print_quoted_memory(const char *, size_t); + +/* Read an int from the file. */ +int read_int_from_file(const char *, int *); + +/* Check whether given uid matches kernel overflowuid. */ +void check_overflowuid(const int); + +/* Check whether given gid matches kernel overflowgid. */ +void check_overflowgid(const int); + +/* Translate errno to its name. */ +const char *errno2name(void); + +/* Translate signal number to its name. */ +const char *signal2name(int); + +/* Print return code and, in case return code is -1, errno information. */ +const char *sprintrc(long rc); +/* sprintrc variant suitable for usage as part of grep pattern. */ +const char *sprintrc_grep(long rc); + +struct xlat; + +/* Print flags in symbolic form according to xlat table. */ +int printflags(const struct xlat *, const unsigned long long, const char *); + +/* Print constant in symbolic form according to xlat table. */ +int printxval(const struct xlat *, const unsigned long long, const char *); + +/* Invoke a socket syscall, either directly or via __NR_socketcall. */ +int socketcall(const int nr, const int call, + long a1, long a2, long a3, long a4, long a5); + +/* Wrappers for recvmmsg and sendmmsg syscalls. */ +struct mmsghdr; +struct timespec; +int recv_mmsg(int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); +int send_mmsg(int, struct mmsghdr *, unsigned int, unsigned int); + +/* Create a pipe with maximized descriptor numbers. */ +void pipe_maxfd(int pipefd[2]); + +#define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) +#define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) + +/* + * For 64-bit kernel_ulong_t and 32-bit pointer, + * return a kernel_ulong_t value by filling higher bits. + * For other architertures, return the original pointer. + */ +static inline kernel_ulong_t +f8ill_ptr_to_kulong(const void *const ptr) +{ + const unsigned long uptr = (unsigned long) ptr; + return F8ILL_KULONG_SUPPORTED + ? F8ILL_KULONG_MASK | uptr : (kernel_ulong_t) uptr; +} + +# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0]))) +# define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1) + +/* Zero-extend a signed integer type to unsigned long long. */ +#define zero_extend_signed_to_ull(v) \ + (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ + sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ + sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ + sizeof(v) == sizeof(long) ? (unsigned long long) (unsigned long) (v) : \ + (unsigned long long) (v)) + +/* Sign-extend an unsigned integer type to long long. */ +#define sign_extend_unsigned_to_ll(v) \ + (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ + sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ + sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ + sizeof(v) == sizeof(long) ? (long long) (long) (v) : \ + (long long) (v)) + +# define SKIP_MAIN_UNDEFINED(arg) \ + int main(void) { error_msg_and_skip("undefined: %s", arg); } + +/* + * The kernel used to define 64-bit types on 64-bit systems on a per-arch + * basis. Some architectures would use unsigned long and others would use + * unsigned long long. These types were exported as part of the + * kernel-userspace ABI and now must be maintained forever. This matches + * what the kernel exports for each architecture so we don't need to cast + * every printing of __u64 or __s64 to stdint types. + */ +# if SIZEOF_LONG == 4 +# define PRI__64 "ll" +# elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC +# define PRI__64 "l" +# else +# define PRI__64 "ll" +# endif + +# define PRI__d64 PRI__64"d" +# define PRI__u64 PRI__64"u" +# define PRI__x64 PRI__64"x" + +# if WORDS_BIGENDIAN +# define LL_PAIR(HI, LO) (HI), (LO) +# else +# define LL_PAIR(HI, LO) (LO), (HI) +# endif +# define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval)) + +# define _STR(_arg) #_arg +# define ARG_STR(_arg) (_arg), #_arg +# define ARG_ULL_STR(_arg) _arg##ULL, #_arg + +#endif /* !STRACE_TESTS_H */ diff --git a/tests-mx32/threads-execve.c b/tests-mx32/threads-execve.c new file mode 100644 index 00000000..853645ff --- /dev/null +++ b/tests-mx32/threads-execve.c @@ -0,0 +1,246 @@ +/* + * Check decoding of threads when a non-leader thread invokes execve. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static pid_t leader; +static pid_t tid; + +static void +handler(int signo) +{ +} + +static unsigned int sigsetsize; +static long +k_sigsuspend(const sigset_t *const set) +{ + return syscall(__NR_rt_sigsuspend, set, sigsetsize); +} + +static pid_t +k_gettid(void) +{ + return syscall(__NR_gettid); +} + +static void +get_sigsetsize(void) +{ + static const struct sigaction sa = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + raise(SIGUSR1); + + sigemptyset(&mask); + for (sigsetsize = sizeof(mask) / sizeof(long); + sigsetsize; sigsetsize >>= 1) { + long rc = k_sigsuspend(&mask); + if (!rc) + error_msg_and_fail("rt_sigsuspend"); + if (EINTR == errno) + break; + printf("%-5d rt_sigsuspend(%p, %u) = %s\n", + leader, &mask, sigsetsize, sprintrc(rc)); + } + if (!sigsetsize) + perror_msg_and_fail("rt_sigsuspend"); + printf("%-5d rt_sigsuspend([], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", leader, sigsetsize); +} + +enum { + ACTION_exit = 0, + ACTION_rt_sigsuspend, + ACTION_nanosleep, + NUMBER_OF_ACTIONS +}; + +static const unsigned int NUMBER_OF_ITERATIONS = 1; +static unsigned int action; +static int fds[2]; + +static unsigned int +arglen(char **args) +{ + char **p; + + for (p = args; *p; ++p) + ; + + return p - args; +} + +static void * +thread(void *arg) +{ + tid = k_gettid(); + + static char buf[sizeof(action) * 3]; + sprintf(buf, "%u", action + 1); + + char **argv = arg; + argv[2] = buf; + + if (read(fds[0], fds, sizeof(fds[0]))) + perror_msg_and_fail("execve"); + + struct timespec ts = { .tv_nsec = 100000000 }; + (void) clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL); + + ts.tv_nsec = 12345; + printf("%-5d nanosleep({tv_sec=0, tv_nsec=%u}, NULL) = 0\n", + tid, (unsigned int) ts.tv_nsec); + + switch (action % NUMBER_OF_ACTIONS) { + case ACTION_exit: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), leader); + break; + case ACTION_rt_sigsuspend: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n" + "%-5d <... rt_sigsuspend resumed>) = ?\n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), + leader); + break; + case ACTION_nanosleep: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n" + "%-5d <... nanosleep resumed> )" + " = ?\n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), + leader); + break; + } + + printf("%-5d +++ superseded by execve in pid %u +++\n" + "%-5d <... execve resumed> ) = 0\n", + leader, tid, + leader); + + (void) nanosleep(&ts, NULL); + execve(argv[0], argv, environ); + perror_msg_and_fail("execve"); +} + +int +main(int ac, char **av) +{ + setvbuf(stdout, NULL, _IONBF, 0); + leader = getpid(); + + if (ac < 3) { + struct timespec ts = { .tv_nsec = 1 }; + if (clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL)) + perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); + + printf("%-5d execve(\"%s\", [\"%s\"], [/* %u vars */]) = 0\n", + leader, av[0], av[0], arglen(environ)); + + get_sigsetsize(); + static char buf[sizeof(sigsetsize) * 3]; + sprintf(buf, "%u", sigsetsize); + + char *argv[] = { av[0], buf, (char *) "0", NULL }; + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */]) = 0\n", + leader, argv[0], argv[0], argv[1], argv[2], + arglen(environ)); + execve(argv[0], argv, environ); + perror_msg_and_fail("execve"); + } + + sigsetsize = atoi(av[1]); + action = atoi(av[2]); + + if (action >= NUMBER_OF_ACTIONS * NUMBER_OF_ITERATIONS) { + printf("%-5d +++ exited with 0 +++\n", leader); + return 0; + } + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pthread_t t; + errno = pthread_create(&t, NULL, thread, av); + if (errno) + perror_msg_and_fail("pthread_create"); + + struct timespec ts = { .tv_sec = 123 }; + sigset_t mask; + sigemptyset(&mask); + + static char leader_str[sizeof(leader) * 3]; + int leader_str_len = + snprintf(leader_str, sizeof(leader_str), "%-5d", leader); + + switch (action % NUMBER_OF_ACTIONS) { + case ACTION_exit: + printf("%s exit(42)%*s= ?\n", leader_str, + (int) sizeof(leader_str) - leader_str_len, " "); + close(fds[1]); + (void) syscall(__NR_exit, 42); + break; + case ACTION_rt_sigsuspend: + printf("%s rt_sigsuspend([], %u \n", + leader_str, sigsetsize); + close(fds[1]); + (void) k_sigsuspend(&mask); + break; + case ACTION_nanosleep: + printf("%s nanosleep({tv_sec=%u, tv_nsec=0}" + ", \n", + leader_str, (unsigned int) ts.tv_sec); + close(fds[1]); + (void) nanosleep(&ts, 0); + break; + } + + return 1; +} diff --git a/tests-mx32/threads-execve.test b/tests-mx32/threads-execve.test new file mode 100755 index 00000000..4a771467 --- /dev/null +++ b/tests-mx32/threads-execve.test @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Check decoding of threads when a non-leader thread invokes execve. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# Check that PTRACE_EVENT_EXEC support in kernel is good enough. +# The kernel before commit v3.1-rc1~308^2~7 reported 0 instead of old pid. +require_min_kernel_version_or_skip 3.1 + +check_prog diff +run_prog > /dev/null + +set -- -a21 -f -esignal=none -e trace=execve,exit,nanosleep,rt_sigsuspend $args + +# Due to probabilistic nature of the test, try it several times. +i=0 +while [ $i -le 9 ]; do + run_strace "$@" > "$EXP" + diff -- "$EXP" "$LOG" || continue + rm -f "$EXP" + exit 0 +done + +fail_ "$STRACE $* output mismatch" diff --git a/tests-mx32/time.c b/tests-mx32/time.c new file mode 100644 index 00000000..4a5cde9c --- /dev/null +++ b/tests-mx32/time.c @@ -0,0 +1,61 @@ +/* + * This file is part of time strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_time + +# include +# include +# include +# include + +int +main(void) +{ + time_t *p = tail_alloc(sizeof(time_t)); + + time_t t = syscall(__NR_time, NULL); + if ((time_t) -1 == t) + perror_msg_and_skip("time"); + printf("time(NULL) = %jd\n", (intmax_t) t); + + t = syscall(__NR_time, p); + printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_time") + +#endif diff --git a/tests-mx32/time.test b/tests-mx32/time.test new file mode 100755 index 00000000..6ab193a4 --- /dev/null +++ b/tests-mx32/time.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check time syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/timer_create.c b/tests-mx32/timer_create.c new file mode 100644 index 00000000..1a259627 --- /dev/null +++ b/tests-mx32/timer_create.c @@ -0,0 +1,125 @@ +/* + * This file is part of timer_create strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_timer_create + +# include +# include +# include +# include +# include "sigevent.h" + +int +main(void) +{ + syscall(__NR_timer_create, CLOCK_REALTIME, NULL, NULL); + printf("timer_create(CLOCK_REALTIME, NULL, NULL) = -1 %s (%m)\n", + errno2name()); + + int tid[4] = {}; + struct_sigevent sev = { + .sigev_notify = 0xdefaced, + .sigev_signo = 0xfacefeed, + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL + }; + + syscall(__NR_timer_create, CLOCK_REALTIME, &sev, NULL); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, " + "sigev_notify=%#x /* SIGEV_??? */}, NULL) = -1 %s (%m)\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_signo, sev.sigev_notify, + errno2name()); + + sev.sigev_notify = SIGEV_NONE; + if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[0])) + perror_msg_and_skip("timer_create CLOCK_REALTIME"); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, sigev_notify=SIGEV_NONE}, " + "[%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_signo, tid[0]); + + sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_signo = SIGALRM; + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[1])) + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_SIGNAL}, [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, tid[1]); + + sev.sigev_notify = SIGEV_THREAD; + sev.sigev_un.sigev_thread.function = + (unsigned long) 0xdeadbeefbadc0dedULL; + sev.sigev_un.sigev_thread.attribute = + (unsigned long) 0xcafef00dfacefeedULL; + if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[2])) + perror_msg_and_skip("timer_create CLOCK_REALTIME"); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" + ", sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}" + ", [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_un.sigev_thread.function, + sev.sigev_un.sigev_thread.attribute, + tid[2]); + +#ifndef SIGEV_THREAD_ID +# define SIGEV_THREAD_ID 4 +#endif + sev.sigev_notify = SIGEV_THREAD_ID; + sev.sigev_un.tid = getpid(); + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_THREAD_ID, sigev_notify_thread_id=%d}" + ", [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_un.tid, + tid[3]); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timer_create") + +#endif diff --git a/tests-mx32/timer_create.test b/tests-mx32/timer_create.test new file mode 100755 index 00000000..870a1795 --- /dev/null +++ b/tests-mx32/timer_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timer_create syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/timer_xettime.c b/tests-mx32/timer_xettime.c new file mode 100644 index 00000000..9eabbf08 --- /dev/null +++ b/tests-mx32/timer_xettime.c @@ -0,0 +1,112 @@ +/* + * This file is part of timer_xettime strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_timer_create \ + && defined __NR_timer_gettime \ + && defined __NR_timer_settime + +# include +# include +# include +# include +# include + +int +main(void) +{ + syscall(__NR_timer_settime, 0xdefaced, TIMER_ABSTIME, NULL, NULL); + printf("timer_settime(%d, TIMER_ABSTIME, NULL, NULL)" + " = -1 EINVAL (%m)\n", 0xdefaced); + + int tid; + struct sigevent sev = { .sigev_notify = SIGEV_NONE }; + + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid)) + perror_msg_and_skip("timer_create"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_signo=0" + ", sigev_notify=SIGEV_NONE}, [%d]) = 0\n", tid); + + struct { + struct itimerspec its; + uint32_t pad[4]; + } old = { + .its = { + .it_interval = { 0xdeface5, 0xdeface6 }, + .it_value = { 0xdeface7, 0xdeface8 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .its = { + .it_interval = { 0xdeface1, 0xdeface2 }, + .it_value = { 0xdeface3, 0xdeface4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_timer_settime, tid, 0, &new.its, &old.its)) + perror_msg_and_skip("timer_settime"); + printf("timer_settime(%d, 0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ") = 0\n", + tid, + (intmax_t) new.its.it_interval.tv_sec, + (intmax_t) new.its.it_interval.tv_nsec, + (intmax_t) new.its.it_value.tv_sec, + (intmax_t) new.its.it_value.tv_nsec, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + if (syscall(__NR_timer_gettime, tid, &old.its)) + perror_msg_and_skip("timer_gettime"); + printf("timer_gettime(%d" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + tid, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timer_create && __NR_timer_gettime && __NR_timer_settime") + +#endif diff --git a/tests-mx32/timer_xettime.test b/tests-mx32/timer_xettime.test new file mode 100755 index 00000000..08bcdd68 --- /dev/null +++ b/tests-mx32/timer_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timer_create, timer_settime, and timer_gettime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests-mx32/timerfd_xettime.c b/tests-mx32/timerfd_xettime.c new file mode 100644 index 00000000..ca7124ec --- /dev/null +++ b/tests-mx32/timerfd_xettime.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_timerfd_create \ + && defined __NR_timerfd_gettime \ + && defined __NR_timerfd_settime \ + && defined O_CLOEXEC + +# include +# include +# include +# include + +int +main(void) +{ + (void) close(0); + if (syscall(__NR_timerfd_create, CLOCK_MONOTONIC, O_CLOEXEC | O_NONBLOCK)) + perror_msg_and_skip("timerfd_create"); + puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0"); + + struct { + struct itimerspec its; + uint32_t pad[4]; + } old = { + .its = { + .it_interval = { 0xdeface5, 0xdeface6 }, + .it_value = { 0xdeface7, 0xdeface8 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .its = { + .it_interval = { 0xdeface1, 0xdeface2 }, + .it_value = { 0xdeface3, 0xdeface4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its)) + perror_msg_and_skip("timerfd_settime"); + printf("timerfd_settime(0, 0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ") = 0\n", + (intmax_t) new.its.it_interval.tv_sec, + (intmax_t) new.its.it_interval.tv_nsec, + (intmax_t) new.its.it_value.tv_sec, + (intmax_t) new.its.it_value.tv_nsec, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + if (syscall(__NR_timerfd_gettime, 0, &old.its)) + perror_msg_and_skip("timerfd_gettime"); + printf("timerfd_gettime(0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timerfd_create && __NR_timerfd_gettime" + " && __NR_timerfd_settime && O_CLOEXEC") + +#endif diff --git a/tests-mx32/timerfd_xettime.test b/tests-mx32/timerfd_xettime.test new file mode 100755 index 00000000..75aa21c2 --- /dev/null +++ b/tests-mx32/timerfd_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timerfd_create, timerfd_settime, and timerfd_gettime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests-mx32/times-fail.c b/tests-mx32/times-fail.c new file mode 100644 index 00000000..cb69bd43 --- /dev/null +++ b/tests-mx32/times-fail.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include +#include +#include +#include + +int +main (void) +{ + assert(syscall(__NR_times, 0x42) == -1); + printf("times(0x42) = -1 EFAULT (%m)\n"); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-mx32/times-fail.test b/tests-mx32/times-fail.test new file mode 100755 index 00000000..ee28a060 --- /dev/null +++ b/tests-mx32/times-fail.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of failing times syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -e trace=times diff --git a/tests-mx32/times.c b/tests-mx32/times.c new file mode 100644 index 00000000..2c7b95e5 --- /dev/null +++ b/tests-mx32/times.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2015 Eugene Syromyatnikov + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * This test burns some CPU cycles in user space and kernel space in order to + * get some non-zero values returned by times(2). + */ + +#include "tests.h" +#include +#include +#include +#include + +#include +#include +#include + +enum { + NUM_USER_ITERS = 1000000, + PARENT_CPUTIME_LIMIT_NSEC = 200000000, + CHILD_CPUTIME_LIMIT_NSEC = 300000000 +}; + +int +main (void) +{ + struct timespec ts; + volatile int dummy = 0; + int i = 0; + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + const long cputime_limit = + pid ? PARENT_CPUTIME_LIMIT_NSEC : CHILD_CPUTIME_LIMIT_NSEC; + + /* Enjoying my user time */ + while (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { + if (ts.tv_sec || ts.tv_nsec >= cputime_limit) + break; + + if (i && !(ts.tv_sec || ts.tv_nsec)) + error_msg_and_skip("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 0})"); + + for (i = 0; i < NUM_USER_ITERS; ++i) + ++dummy; + } + + /* Enjoying my system time */ + while (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { + if (ts.tv_sec || ts.tv_nsec >= cputime_limit * 2) + break; + + sched_yield(); + } + + if (pid == 0) { + return 0; + } else { + wait(NULL); + } + + struct tms tbuf; + unsigned long long llres; + + /* + * On systems where user's and kernel's long types are the same, + * prefer direct times syscall over libc's times function because + * the latter is more prone to return value truncation. + */ +#undef USE_LIBC_SYSCALL +#if defined __NR_times && \ + !defined(LINUX_MIPSN32) && \ + !(defined __x86_64__ && defined __ILP32__) +# define USE_LIBC_SYSCALL 1 +#endif + +#if defined USE_LIBC_SYSCALL + long res = syscall(__NR_times, &tbuf); + + if (-1L == res) + perror_msg_and_skip("times"); + else + llres = (unsigned long) res; +#elif defined __NR_times && defined __x86_64__ && defined __ILP32__ + register long arg asm("rdi") = (long) &tbuf; + asm volatile("syscall\n\t" + : "=a"(llres) + : "0"(__NR_times), "r"(arg) + : "memory", "cc", "r11", "cx"); + if (llres > 0xfffffffffffff000) + return 77; +#else + clock_t res = times(&tbuf); + + if ((clock_t) -1 == res) + perror_msg_and_skip("times"); + if (sizeof(res) < sizeof(unsigned long long)) + llres = (unsigned long) res; + else + llres = res; +#endif + + printf("times({tms_utime=%llu, tms_stime=%llu, ", + (unsigned long long) tbuf.tms_utime, + (unsigned long long) tbuf.tms_stime); + printf("tms_cutime=%llu, tms_cstime=%llu}) = %llu\n", + (unsigned long long) tbuf.tms_cutime, + (unsigned long long) tbuf.tms_cstime, + llres); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-mx32/times.test b/tests-mx32/times.test new file mode 100755 index 00000000..b97e0d33 --- /dev/null +++ b/tests-mx32/times.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of times syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/tprintf.c b/tests-mx32/tprintf.c new file mode 100644 index 00000000..a759d8af --- /dev/null +++ b/tests-mx32/tprintf.c @@ -0,0 +1,90 @@ +/* + * Close stdin, move stdout to a non-standard descriptor, and print. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static ssize_t +write_retry(int fd, const void *buf, size_t count) +{ + ssize_t rc; + + do { + errno = 0; + rc = write(fd, buf, count); + } while (rc == -1 && EINTR == errno); + + if (rc <= 0) + perror_msg_and_fail("write"); + + return rc; +} + +static void +write_loop(int fd, const char *buf, size_t count) +{ + ssize_t offset = 0; + + while (count > 0) { + ssize_t block = write_retry(fd, &buf[offset], count); + + offset += block; + count -= (size_t) block; + } +} + +void +tprintf(const char *fmt, ...) +{ + static int initialized; + if (!initialized) { + assert(dup2(1, 3) == 3); + assert(close(1) == 0); + (void) close(0); + initialized = 1; + } + + va_list p; + va_start(p, fmt); + + static char buf[65536]; + int len = vsnprintf(buf, sizeof(buf), fmt, p); + if (len < 0) + perror_msg_and_fail("vsnprintf"); + assert((unsigned) len < sizeof(buf)); + + write_loop(3, buf, len); + + va_end(p); +} diff --git a/tests-mx32/truncate.c b/tests-mx32/truncate.c new file mode 100644 index 00000000..d9529334 --- /dev/null +++ b/tests-mx32/truncate.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_truncate + +# include +# include + +int +main(void) +{ + static const char fname[] = "truncate\nfilename"; + static const char qname[] = "truncate\\nfilename"; + const kernel_ulong_t len = (kernel_ulong_t) 0xdefaced0badc0deULL; + long rc; + + if (sizeof(len) > sizeof(long)) + rc = truncate(fname, len); + else + rc = syscall(__NR_truncate, fname, len); + + printf("truncate(\"%s\", %llu) = %ld %s (%m)\n", + qname, (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_truncate") + +#endif diff --git a/tests-mx32/truncate.test b/tests-mx32/truncate.test new file mode 100755 index 00000000..6bf1e702 --- /dev/null +++ b/tests-mx32/truncate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check truncate syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/truncate64.c b/tests-mx32/truncate64.c new file mode 100644 index 00000000..8c29ea81 --- /dev/null +++ b/tests-mx32/truncate64.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_truncate64 + +# include +# include + +int +main(void) +{ + static const char fname[] = "truncate64\nfilename"; + static const char qname[] = "truncate64\\nfilename"; + const off_t len = 0xdefaceddeadbeefULL; + + int rc = truncate(fname, len); + printf("truncate64(\"%s\", %llu) = %d %s (%m)\n", + qname, (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_truncate64") + +#endif diff --git a/tests-mx32/truncate64.test b/tests-mx32/truncate64.test new file mode 100755 index 00000000..c4668062 --- /dev/null +++ b/tests-mx32/truncate64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check truncate64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/ugetrlimit.c b/tests-mx32/ugetrlimit.c new file mode 100644 index 00000000..a99e496d --- /dev/null +++ b/tests-mx32/ugetrlimit.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_ugetrlimit + +# define NR_GETRLIMIT __NR_ugetrlimit +# define STR_GETRLIMIT "ugetrlimit" +# include "xgetrlimit.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_ugetrlimit") + +#endif diff --git a/tests-mx32/ugetrlimit.test b/tests-mx32/ugetrlimit.test new file mode 100755 index 00000000..f4648ff1 --- /dev/null +++ b/tests-mx32/ugetrlimit.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ugetrlimit syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/uio.c b/tests-mx32/uio.c new file mode 100644 index 00000000..6291f972 --- /dev/null +++ b/tests-mx32/uio.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#if defined(HAVE_PREADV) && defined(HAVE_PWRITEV) + +# include +# include +# include +# include + +int +main(void) +{ + const off_t offset = 0xdefaceddeadbeefLL; + char buf[4]; + struct iovec iov = { buf, sizeof buf }; + + (void) close(0); + assert(open("/dev/zero", O_RDONLY) == 0); + assert(pread(0, buf, sizeof buf, offset) == 4); + assert(preadv(0, &iov, 1, offset) == 4); + assert(!close(0)); + + assert(open("/dev/null", O_WRONLY) == 0); + assert(pwrite(0, buf, sizeof buf, offset) == 4); + assert(pwritev(0, &iov, 1, offset) == 4); + assert(!close(0)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV && HAVE_PWRITEV") + +#endif diff --git a/tests-mx32/uio.expected b/tests-mx32/uio.expected new file mode 100644 index 00000000..98d5c06d --- /dev/null +++ b/tests-mx32/uio.expected @@ -0,0 +1,4 @@ +pread(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 +preadv\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 +pwrite(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 +pwritev\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 diff --git a/tests-mx32/uio.test b/tests-mx32/uio.test new file mode 100755 index 00000000..020b97e9 --- /dev/null +++ b/tests-mx32/uio.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check how pread/pwrite and preadv/pwritev syscalls are traced. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -edesc $args +match_grep + +exit 0 diff --git a/tests-mx32/umask.c b/tests-mx32/umask.c new file mode 100644 index 00000000..86903a95 --- /dev/null +++ b/tests-mx32/umask.c @@ -0,0 +1,24 @@ +#include +#include + +void +test_umask(const mode_t mode) +{ + mode_t rc = umask(0xffff0000 | mode); + printf("umask(%#03ho) = %#03o\n", (unsigned short) mode, rc); +} + +int +main(void) +{ + test_umask(0); + test_umask(06); + test_umask(026); + test_umask(0126); + test_umask(07777); + test_umask(0107777); + test_umask(-1); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/umask.test b/tests-mx32/umask.test new file mode 100755 index 00000000..1351721f --- /dev/null +++ b/tests-mx32/umask.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check umask syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-mx32/umode_t.c b/tests-mx32/umode_t.c new file mode 100644 index 00000000..5041638e --- /dev/null +++ b/tests-mx32/umode_t.c @@ -0,0 +1,78 @@ +/* + * Check decoding of umode_t type syscall arguments. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#ifndef TEST_SYSCALL_PREFIX_ARGS +# define TEST_SYSCALL_PREFIX_ARGS +#endif +#ifndef TEST_SYSCALL_PREFIX_STR +# define TEST_SYSCALL_PREFIX_STR "" +#endif + +static const char sample[] = TEST_SYSCALL_STR; + +static void +test_syscall(unsigned short mode) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + long rc = syscall(TEST_SYSCALL_NR, TEST_SYSCALL_PREFIX_ARGS + sample, lmode); + + if (mode <= 07) + printf("%s(%s\"%s\", 00%d) = %ld %s (%m)\n", + sample, TEST_SYSCALL_PREFIX_STR, + sample, (int) mode, rc, errno2name()); + else + printf("%s(%s\"%s\", %#03ho) = %ld %s (%m)\n", + sample, TEST_SYSCALL_PREFIX_STR, + sample, mode, rc, errno2name()); +} + +int +main(void) +{ + test_syscall(0); + test_syscall(0xffff); + test_syscall(06); + test_syscall(060); + test_syscall(0600); + test_syscall(024); + test_syscall(S_IFREG); + test_syscall(S_IFDIR | 06); + test_syscall(S_IFLNK | 060); + test_syscall(S_IFIFO | 0600); + test_syscall(S_IFCHR | 024); + test_syscall((0xffff & ~S_IFMT) | S_IFBLK); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/umount.c b/tests-mx32/umount.c new file mode 100644 index 00000000..eda7ae5c --- /dev/null +++ b/tests-mx32/umount.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef __NR_oldumount +# define TEST_SYSCALL_STR "oldumount" +#else +# if defined __NR_umount && defined __NR_umount2 +# define __NR_oldumount __NR_umount +# define TEST_SYSCALL_STR "umount" +# endif +#endif + +#ifdef __NR_oldumount + +int +main(void) +{ + static const char sample[] = "umount.sample"; + if (mkdir(sample, 0700)) + perror_msg_and_fail("mkdir: %s", sample); + + long rc = syscall(__NR_oldumount, sample); + printf("%s(\"%s\") = %ld %s (%m)\n", + TEST_SYSCALL_STR, sample, rc, errno2name()); + + if (rmdir(sample)) + perror_msg_and_fail("rmdir: %s", sample); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldumount") + +#endif diff --git a/tests-mx32/umount.test b/tests-mx32/umount.test new file mode 100755 index 00000000..a5840d54 --- /dev/null +++ b/tests-mx32/umount.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check umount syscall decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha) syscall=oldumount ;; + *) syscall=umount ;; +esac +run_strace_match_diff -a24 -s6 -e trace=$syscall diff --git a/tests-mx32/umount2.c b/tests-mx32/umount2.c new file mode 100644 index 00000000..1a6d8451 --- /dev/null +++ b/tests-mx32/umount2.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef __NR_umount2 +# define TEST_SYSCALL_STR "umount2" +#else +# define __NR_umount2 __NR_umount +# define TEST_SYSCALL_STR "umount" +#endif + +int +main(void) +{ + static const char sample[] = "umount2.sample"; + if (mkdir(sample, 0700)) + perror_msg_and_fail("mkdir: %s", sample); + (void) syscall(__NR_umount2, sample, 31); + printf("%s(\"%s\", MNT_FORCE|MNT_DETACH|MNT_EXPIRE|UMOUNT_NOFOLLOW|0x10)" + " = -1 EINVAL (%m)\n", TEST_SYSCALL_STR, sample); + if (rmdir(sample)) + perror_msg_and_fail("rmdir: %s", sample); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/umount2.test b/tests-mx32/umount2.test new file mode 100755 index 00000000..c43b38db --- /dev/null +++ b/tests-mx32/umount2.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check umount2 syscall decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha|ia64) syscall=umount ;; + *) syscall=umount2 ;; +esac +run_strace_match_diff -s7 -e trace=$syscall diff --git a/tests-mx32/umoven-illptr.c b/tests-mx32/umoven-illptr.c new file mode 100644 index 00000000..4deee163 --- /dev/null +++ b/tests-mx32/umoven-illptr.c @@ -0,0 +1,57 @@ +/* + * Check decoding of invalid pointer by umoven. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + if (F8ILL_KULONG_SUPPORTED) { + struct timespec ts = { 0, 0 }; + const void *const p = tail_memdup(&ts, sizeof(ts)); + + long rc = syscall(__NR_nanosleep, p, NULL); + printf("nanosleep({tv_sec=0, tv_nsec=0}, NULL) = %s\n", + sprintrc(rc)); + + const kernel_ulong_t ill = f8ill_ptr_to_kulong(p); + rc = syscall(__NR_nanosleep, ill, NULL); + printf("nanosleep(%#llx, NULL) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; + } else { + return 77; + } +} diff --git a/tests-mx32/umoven-illptr.test b/tests-mx32/umoven-illptr.test new file mode 100755 index 00000000..7b8cb314 --- /dev/null +++ b/tests-mx32/umoven-illptr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of invalid pointer by umoven. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests-mx32/umovestr-illptr.c b/tests-mx32/umovestr-illptr.c new file mode 100644 index 00000000..dea6885d --- /dev/null +++ b/tests-mx32/umovestr-illptr.c @@ -0,0 +1,53 @@ +/* + * Check decoding of invalid pointer by umovestr. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + if (F8ILL_KULONG_SUPPORTED) { + const void *const p = tail_memdup(".", 2); + long rc = syscall(__NR_chdir, p); + printf("chdir(\".\") = %s\n", sprintrc(rc)); + + const kernel_ulong_t ill = f8ill_ptr_to_kulong(p); + rc = syscall(__NR_chdir, ill); + printf("chdir(%#llx) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; + } else { + return 77; + } +} diff --git a/tests-mx32/umovestr-illptr.test b/tests-mx32/umovestr-illptr.test new file mode 100755 index 00000000..6f1cc862 --- /dev/null +++ b/tests-mx32/umovestr-illptr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of invalid pointer by umovestr. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a11 -e trace=chdir diff --git a/tests-mx32/umovestr.c b/tests-mx32/umovestr.c new file mode 100644 index 00000000..95fccb67 --- /dev/null +++ b/tests-mx32/umovestr.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + const size_t tail_len = 257; + char *addr = tail_alloc(tail_len); + memset(addr, '/', tail_len - 1); + addr[tail_len - 1] = '\0'; + if (chdir(addr)) + perror_msg_and_skip("chdir"); + return 0; +} diff --git a/tests-mx32/umovestr.expected b/tests-mx32/umovestr.expected new file mode 100644 index 00000000..c26d877e --- /dev/null +++ b/tests-mx32/umovestr.expected @@ -0,0 +1,2 @@ +chdir("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////") = 0 ++++ exited with 0 +++ diff --git a/tests-mx32/umovestr.test b/tests-mx32/umovestr.test new file mode 100755 index 00000000..5ae8ffa9 --- /dev/null +++ b/tests-mx32/umovestr.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# umovestr short read regression test + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e chdir $args +match_diff + +exit 0 diff --git a/tests-mx32/umovestr2.c b/tests-mx32/umovestr2.c new file mode 100644 index 00000000..b2c63d80 --- /dev/null +++ b/tests-mx32/umovestr2.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const size_t page_len = get_page_size(); + const size_t tail_len = page_len * 2 - 1; + const size_t str_len = tail_len - 1; + + char *addr = tail_alloc(tail_len); + memset(addr, '0', str_len); + addr[str_len] = '\0'; + + char *argv[] = { NULL }; + char *envp[] = { addr, NULL }; + execve("", argv, envp); + + printf("execve(\"\", [], [\"%0*u\"]) = -1 ENOENT (%m)\n", + (int) str_len, 0); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-mx32/umovestr2.test b/tests-mx32/umovestr2.test new file mode 100755 index 00000000..5c5d561f --- /dev/null +++ b/tests-mx32/umovestr2.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# umovestr short read regression test + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -veexecve -s262144 $args > "$EXP" +check_prog sed +sed 1d < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests-mx32/umovestr3.c b/tests-mx32/umovestr3.c new file mode 100644 index 00000000..cf2fa7d4 --- /dev/null +++ b/tests-mx32/umovestr3.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const unsigned int size = PATH_MAX - 1; + const char *p = tail_alloc(size); + const char *const efault = p + size; + + for (; p <= efault; ++p) { + int rc = chdir(p); + printf("chdir(%p) = %d %s (%m)\n", p, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/umovestr3.test b/tests-mx32/umovestr3.test new file mode 100755 index 00000000..d5be2832 --- /dev/null +++ b/tests-mx32/umovestr3.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# yet another umovestr short read test + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=chdir diff --git a/tests-mx32/uname.c b/tests-mx32/uname.c new file mode 100644 index 00000000..cd6f51cd --- /dev/null +++ b/tests-mx32/uname.c @@ -0,0 +1,44 @@ +#include "tests.h" +#include + +#ifdef __NR_uname + +# include +# include +# include + +int main(int ac, char **av) +{ + int abbrev = ac > 1; + struct utsname *const uname = tail_alloc(sizeof(struct utsname)); + int rc = syscall(__NR_uname, uname); + printf("uname({sysname=\""); + print_quoted_string(uname->sysname); + printf("\", nodename=\""); + print_quoted_string(uname->nodename); + if (abbrev) { + printf("\", ..."); + } else { + printf("\", release=\""); + print_quoted_string(uname->release); + printf("\", version=\""); + print_quoted_string(uname->version); + printf("\", machine=\""); + print_quoted_string(uname->machine); +# ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME + printf("\", domainname=\""); + print_quoted_string(uname->domainname); +# endif + printf("\""); + } + printf("}) = %d\n", rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_uname") + +#endif diff --git a/tests-mx32/uname.test b/tests-mx32/uname.test new file mode 100755 index 00000000..03fe30cd --- /dev/null +++ b/tests-mx32/uname.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check uname syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog uniq + +run_prog > /dev/null +run_strace -v -euname $args > "$EXP" +uniq < "$LOG" > "$OUT" + +run_prog "./$NAME" abbrev > /dev/null +run_strace -euname $args >> "$EXP" +uniq < "$LOG" >> "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$OUT" "$EXP" diff --git a/tests-mx32/unix-pair-send-recv.c b/tests-mx32/unix-pair-send-recv.c new file mode 100644 index 00000000..d4ac0d23 --- /dev/null +++ b/tests-mx32/unix-pair-send-recv.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include + +#ifndef __NR_send +# define __NR_send -1 +#endif +#define SC_send 9 + +#ifndef __NR_recv +# define __NR_recv -1 +#endif +#define SC_recv 10 + +static int +sys_send(int sockfd, const void *buf, size_t len, int flags) +{ + int rc = socketcall(__NR_send, SC_send, + sockfd, (long) buf, len, flags, 0); + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("send"); + return rc; +} + +static int +sys_recv(int sockfd, const void *buf, size_t len, int flags) +{ + int rc = socketcall(__NR_recv, SC_recv, + sockfd, (long) buf, len, flags, 0); + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("recv"); + return rc; +} + +static void +transpose(char *str, const size_t len) +{ + size_t i; + + for (i = 0; i < len / 2; ++i) { + char c = str[i]; + str[i] = str[len - 1 - i]; + str[len - 1 - i] = c; + } +} + +int +main(int ac, char **av) +{ + assert(ac == 2); + const size_t len = strlen(av[1]); + assert(len); + char *const buf0 = tail_alloc(len); + char *const buf1 = tail_alloc(len); + memcpy(buf0, av[1], len); + + (void) close(0); + (void) close(1); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + assert(sys_send(0, buf0, len, MSG_DONTROUTE) == (int) len); + assert(sys_recv(1, buf1, len, MSG_WAITALL) == (int) len); + + transpose(buf1, len); + assert(sys_send(1, buf1, len, MSG_DONTROUTE) == (int) len); + if (close(1)) + perror_msg_and_fail("close(1)"); + + assert(sys_recv(0, buf0, len, MSG_WAITALL) == (int) len); + if (close(0)) + perror_msg_and_fail("close(0)"); + assert(sys_recv(0, NULL, len, MSG_DONTWAIT) == -1); + + return 0; +} diff --git a/tests-mx32/unix-pair-send-recv.expected b/tests-mx32/unix-pair-send-recv.expected new file mode 100644 index 00000000..39359781 --- /dev/null +++ b/tests-mx32/unix-pair-send-recv.expected @@ -0,0 +1,10 @@ +send(0, "abcdefghijklmnopqrstuvwxyz", 26, MSG_DONTROUTE) = 26 + | 00000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop | + | 00010 71 72 73 74 75 76 77 78 79 7a qrstuvwxyz | +recv(1, "abcdefghijklmnopqrstuvwxyz", 26, MSG_WAITALL) = 26 +send(1, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_DONTROUTE) = 26 +recv(0, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_WAITALL) = 26 + | 00000 7a 79 78 77 76 75 74 73 72 71 70 6f 6e 6d 6c 6b zyxwvutsrqponmlk | + | 00010 6a 69 68 67 66 65 64 63 62 61 jihgfedcba | +recv(0, NULL, 26, MSG_DONTWAIT) = -1 EBADF (Bad file descriptor) ++++ exited with 0 +++ diff --git a/tests-mx32/unix-pair-send-recv.test b/tests-mx32/unix-pair-send-recv.test new file mode 100755 index 00000000..4defdebb --- /dev/null +++ b/tests-mx32/unix-pair-send-recv.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding and dumping of send and recv syscalls. + +. "${srcdir=.}/init.sh" + +run_prog ./unix-pair-send-recv abcdefghijklmnopqrstuvwxyz +run_strace -a32 -esignal=none -esend,recv -eread=0 -ewrite=0 $args +match_diff + +exit 0 diff --git a/tests-mx32/unix-pair-sendto-recvfrom.c b/tests-mx32/unix-pair-sendto-recvfrom.c new file mode 100644 index 00000000..cea382c9 --- /dev/null +++ b/tests-mx32/unix-pair-sendto-recvfrom.c @@ -0,0 +1,87 @@ +/* + * Check decoding and dumping of sendto and recvfrom syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static void +transpose(char *str, int len) +{ + int i; + + for (i = 0; i < len / 2; ++i) { + char c = str[i]; + str[i] = str[len - 1 - i]; + str[len - 1 - i] = c; + } +} + +int +main(int ac, char **av) +{ + assert(ac == 2); + const int len = strlen(av[1]); + assert(len); + + (void) close(0); + (void) close(1); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (pid) { + assert(close(1) == 0); + transpose(av[1], len); + assert(sendto(0, av[1], len, MSG_DONTROUTE, NULL, 0) == len); + assert(recvfrom(0, av[1], len, MSG_WAITALL, NULL, NULL) == len); + assert(close(0) == 0); + + int status; + assert(waitpid(pid, &status, 0) == pid); + assert(status == 0); + } else { + assert(close(0) == 0); + assert(recvfrom(1, av[1], len, MSG_WAITALL, NULL, NULL) == len); + transpose(av[1], len); + assert(sendto(1, av[1], len, MSG_DONTROUTE, NULL, 0) == len); + assert(recvfrom(1, av[1], len, MSG_WAITALL, NULL, NULL) == 0); + assert(close(1) == 0); + } + + return 0; +} diff --git a/tests-mx32/unix-pair-sendto-recvfrom.expected b/tests-mx32/unix-pair-sendto-recvfrom.expected new file mode 100644 index 00000000..f8fd2449 --- /dev/null +++ b/tests-mx32/unix-pair-sendto-recvfrom.expected @@ -0,0 +1,7 @@ +sendto(0, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_DONTROUTE, NULL, 0) = 26 + | 00000 7a 79 78 77 76 75 74 73 72 71 70 6f 6e 6d 6c 6b zyxwvutsrqponmlk | + | 00010 6a 69 68 67 66 65 64 63 62 61 jihgfedcba | +recvfrom(0, "abcdefghijklmnopqrstuvwxyz", 26, MSG_WAITALL, NULL, NULL) = 26 + | 00000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop | + | 00010 71 72 73 74 75 76 77 78 79 7a qrstuvwxyz | ++++ exited with 0 +++ diff --git a/tests-mx32/unix-pair-sendto-recvfrom.test b/tests-mx32/unix-pair-sendto-recvfrom.test new file mode 100755 index 00000000..21afe236 --- /dev/null +++ b/tests-mx32/unix-pair-sendto-recvfrom.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding and dumping of sendto and recvfrom syscalls. + +. "${srcdir=.}/init.sh" + +run_prog ./unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz +run_strace -esignal=none -esendto,recvfrom -eread=0 -ewrite=0 $args +match_diff + +exit 0 diff --git a/tests-mx32/unlink.c b/tests-mx32/unlink.c new file mode 100644 index 00000000..bbb1de15 --- /dev/null +++ b/tests-mx32/unlink.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_unlink + +# include +# include + +int +main(void) +{ + static const char sample[] = "unlink_sample"; + + long rc = syscall(__NR_unlink, sample); + printf("unlink(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unlink") + +#endif diff --git a/tests-mx32/unlink.test b/tests-mx32/unlink.test new file mode 100755 index 00000000..09bf79a7 --- /dev/null +++ b/tests-mx32/unlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check unlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/unlinkat.c b/tests-mx32/unlinkat.c new file mode 100644 index 00000000..22c3de39 --- /dev/null +++ b/tests-mx32/unlinkat.c @@ -0,0 +1,34 @@ +#include "tests.h" +#include + +#ifdef __NR_unlinkat + +# include +# include + +int +main(void) +{ + static const char sample[] = "unlinkat_sample"; + const long fd = (long) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_unlinkat, fd, sample, 0); + printf("unlinkat(%d, \"%s\", 0) = %ld %s (%m)\n", + (int) fd, sample, rc, errno2name()); + + rc = syscall(__NR_unlinkat, -100, sample, -1L); + printf("unlinkat(%s, \"%s\", %s) = %ld %s (%m)\n", + "AT_FDCWD", sample, + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unlinkat") + +#endif diff --git a/tests-mx32/unlinkat.test b/tests-mx32/unlinkat.test new file mode 100755 index 00000000..864261f7 --- /dev/null +++ b/tests-mx32/unlinkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check unlinkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/unshare.c b/tests-mx32/unshare.c new file mode 100644 index 00000000..5aedde47 --- /dev/null +++ b/tests-mx32/unshare.c @@ -0,0 +1,80 @@ +/* + * Check decoding of unshare syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_unshare + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xbadc0ded0000000fULL; + + static struct { + kernel_ulong_t val; + const char *str; + } unshare_flags[] = { + { ARG_STR(0) }, + { 0xdeadca75, + "CLONE_THREAD|CLONE_FS|CLONE_SIGHAND|CLONE_SYSVSEM|" + "CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET|CLONE_NEWUSER|" + "CLONE_NEWCGROUP|0x80a8c075" }, + { 0x2000000, "CLONE_NEWCGROUP" }, + { ARG_STR(0x81f8f0ff) " /* CLONE_??? */" }, + }; + + long rc; + unsigned int i; + + rc = syscall(__NR_unshare, bogus_flags); + printf("unshare(%#llx /* CLONE_??? */) = %s\n", + (unsigned long long) bogus_flags, sprintrc(rc)); + + for (i = 0; i < ARRAY_SIZE(unshare_flags); i++) { + rc = syscall(__NR_unshare, unshare_flags[i].val); + printf("unshare(%s) = %s\n", + unshare_flags[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unshare"); + +#endif diff --git a/tests-mx32/unshare.test b/tests-mx32/unshare.test new file mode 100755 index 00000000..ccb9575e --- /dev/null +++ b/tests-mx32/unshare.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of setns syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-mx32/userfaultfd.c b/tests-mx32/userfaultfd.c new file mode 100644 index 00000000..60432fa3 --- /dev/null +++ b/tests-mx32/userfaultfd.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined __NR_userfaultfd && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_userfaultfd, 1 | O_NONBLOCK | O_CLOEXEC); + printf("userfaultfd(O_NONBLOCK|O_CLOEXEC|0x1) = %ld %s (%m)\n", + rc, errno2name()); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_userfaultfd && O_CLOEXEC") + +#endif diff --git a/tests-mx32/userfaultfd.test b/tests-mx32/userfaultfd.test new file mode 100755 index 00000000..af8b6fbe --- /dev/null +++ b/tests-mx32/userfaultfd.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check userfaultfd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-mx32/ustat.c b/tests-mx32/ustat.c new file mode 100644 index 00000000..57bb29c2 --- /dev/null +++ b/tests-mx32/ustat.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ustat + +# include +# include +# include +# include +# ifdef HAVE_USTAT_H +# include +# endif + +int +main(void) +{ + const kernel_ulong_t magic = (kernel_ulong_t) 0xfacefeedffffffff; + unsigned long long buf[4]; + unsigned int dev; + long rc; + +# ifdef HAVE_USTAT_H + struct ustat *const ust = tail_alloc(sizeof(*ust)); + struct stat st; + if (stat(".", &st)) + perror_msg_and_fail("stat"); + + dev = (unsigned int) st.st_dev; + rc = syscall(__NR_ustat, dev, ust); + if (rc) + printf("ustat(makedev(%u, %u), %p) = %s\n", + major(dev), minor(dev), ust, sprintrc(rc)); + else + printf("ustat(makedev(%u, %u)" + ", {f_tfree=%llu, f_tinode=%llu}) = 0\n", + major(dev), minor(dev), + zero_extend_signed_to_ull(ust->f_tfree), + zero_extend_signed_to_ull(ust->f_tinode)); +# endif /* HAVE_USTAT_H */ + + dev = (unsigned int) magic; + rc = syscall(__NR_ustat, magic, 0); + printf("ustat(makedev(%u, %u), NULL) = %s\n", + major(dev), minor(dev), sprintrc(rc)); + + rc = syscall(__NR_ustat, magic, buf); + printf("ustat(makedev(%u, %u), %p) = %s\n", + major(dev), minor(dev), buf, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ustat") + +#endif diff --git a/tests-mx32/ustat.test b/tests-mx32/ustat.test new file mode 100755 index 00000000..60a88e0a --- /dev/null +++ b/tests-mx32/ustat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ustat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-mx32/utime.c b/tests-mx32/utime.c new file mode 100644 index 00000000..8fd594f0 --- /dev/null +++ b/tests-mx32/utime.c @@ -0,0 +1,97 @@ +/* + * Check decoding of utime syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_utime + +# include +# include +# include +# include +# include + + +static void +print_tm(const struct tm * const p) +{ + char buf[256]; + + strftime(buf, sizeof(buf), "%FT%T%z", p); + + printf("%s", buf); +} + +static long +k_utime(const void *const filename, const void *const times) +{ + return syscall(__NR_utime, filename, times); +} + +int +main(void) +{ + static const char *const dummy_str = "dummy filename"; + + const time_t t = time(NULL); + const struct tm * const p = localtime(&t); + const struct utimbuf u = { .actime = t, .modtime = t }; + const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u)); + const char *const dummy_filename = + tail_memdup(dummy_str, sizeof(dummy_str) - 1); + + long rc = k_utime("", NULL); + printf("utime(\"\", NULL) = %s\n", sprintrc(rc)); + + rc = k_utime(dummy_filename + sizeof(dummy_str), tail_u + 1); + printf("utime(%p, %p) = %s\n", dummy_filename + sizeof(dummy_str), + tail_u + 1, sprintrc(rc)); + + rc = k_utime(dummy_filename, (struct tm *) tail_u + 1); + printf("utime(%p, %p) = %s\n", + dummy_filename, (struct tm *) tail_u + 1, sprintrc(rc)); + + rc = k_utime("utime\nfilename", tail_u); + const char *errstr = sprintrc(rc); + printf("utime(\"utime\\nfilename\", {actime="); + print_tm(p); + printf(", modtime="); + print_tm(p); + printf("}) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_utime") + +#endif diff --git a/tests-mx32/utime.test b/tests-mx32/utime.test new file mode 100755 index 00000000..bd64c532 --- /dev/null +++ b/tests-mx32/utime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of utime syscall. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a 16 -e trace=utime diff --git a/tests-mx32/utimensat.c b/tests-mx32/utimensat.c new file mode 100644 index 00000000..6d9faac2 --- /dev/null +++ b/tests-mx32/utimensat.c @@ -0,0 +1,101 @@ +/* + * This file is part of utimensat strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#if defined HAVE_UTIMENSAT \ + && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW \ + && defined UTIME_NOW && defined UTIME_OMIT + +static void +print_ts(const struct timespec *ts) +{ + printf("{tv_sec=%ju, tv_nsec=%ju}", (uintmax_t) ts->tv_sec, + (uintmax_t) ts->tv_nsec); +} + +int +main(void) +{ + static const char fname[] = "utimensat\nfilename"; + + assert(utimensat(AT_FDCWD, fname, NULL, 0) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + + #define PREFIX "utimensat(AT_FDCWD, \"utimensat\\nfilename\", " + printf(PREFIX "NULL, 0) = -1 ENOENT (%m)\n"); + + struct timeval tv; + struct timespec ts[2]; + + if (gettimeofday(&tv, NULL)) + perror_msg_and_skip("gettimeofday"); + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_nsec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_nsec = tv.tv_usec + 1; + + printf(PREFIX "["); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], AT_SYMLINK_NOFOLLOW) = -1 ENOENT "); + + assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + printf("(%m)\n"); + + ts[0].tv_nsec = UTIME_NOW; + ts[1].tv_nsec = UTIME_OMIT; + assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + printf(PREFIX "[UTIME_NOW, UTIME_OMIT], AT_SYMLINK_NOFOLLOW)" + " = -1 ENOENT (%m)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_UTIMENSAT && AT_FDCWD && AT_SYMLINK_NOFOLLOW" + " && UTIME_NOW && UTIME_OMIT") + +#endif diff --git a/tests-mx32/utimensat.test b/tests-mx32/utimensat.test new file mode 100755 index 00000000..52e3f316 --- /dev/null +++ b/tests-mx32/utimensat.test @@ -0,0 +1,20 @@ +#!/bin/sh + +# Check decoding of utimensat syscall. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e utimensat $args > "$OUT" + +check_prog grep +LC_ALL=C grep -x "utimensat(.*" "$LOG" > /dev/null || { + rm -f "$OUT" + skip_ 'test executable does not use utimensat syscall' +} + +match_diff "$LOG" "$OUT" + +rm -f "$OUT" + +exit 0 diff --git a/tests-mx32/utimes.c b/tests-mx32/utimes.c new file mode 100644 index 00000000..bbfa0310 --- /dev/null +++ b/tests-mx32/utimes.c @@ -0,0 +1,84 @@ +/* + * Check decoding of utimes syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_utimes + +# include +# include +# include +# include + +int +main(void) +{ + struct timeval tv; + if (gettimeofday(&tv, NULL)) + perror_msg_and_fail("gettimeofday"); + + static const char sample[] = "utimes_sample"; + + long rc = syscall(__NR_utimes, sample, 0); + printf("utimes(\"%s\", NULL) = %ld %s (%m)\n", + sample, rc, errno2name()); + + struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_usec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_usec = tv.tv_usec + 1; + + rc = syscall(__NR_utimes, 0, ts + 2); + printf("utimes(NULL, %p) = %ld %s (%m)\n", ts + 2, rc, errno2name()); + + rc = syscall(__NR_utimes, 0, ts + 1); + printf("utimes(NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " + "%ld %s (%m)\n", + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + ts + 2, rc, errno2name()); + + rc = syscall(__NR_utimes, "", ts); + printf("utimes(\"\", [{tv_sec=%jd, tv_usec=%jd}, " + "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", + (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_utimes") + +#endif diff --git a/tests-mx32/utimes.test b/tests-mx32/utimes.test new file mode 100755 index 00000000..99143a0b --- /dev/null +++ b/tests-mx32/utimes.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check utimes syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/vfork-f.c b/tests-mx32/vfork-f.c new file mode 100644 index 00000000..b14e4b49 --- /dev/null +++ b/tests-mx32/vfork-f.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static inline int +logit_(const char *const str) +{ + return !chdir(str); +} + +#define prefix "vfork-f." +#define logit(arg) logit_(prefix arg) + +int main(int ac, char **av) +{ + if (ac < 1) + return 1; + if (ac > 1) { + if (read(0, &ac, sizeof(int))) + return 2; + return logit("exec"); + } + + logit("start"); + + int child_wait_fds[2]; + (void) close(0); + if (pipe(child_wait_fds)) + perror_msg_and_fail("pipe"); + if (fcntl(child_wait_fds[1], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + + int parent_wait_fds[2]; + if (pipe(parent_wait_fds)) + perror_msg_and_fail("pipe"); + if (fcntl(parent_wait_fds[0], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + if (fcntl(parent_wait_fds[1], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + + char *const args[] = { av[0], (char *) "", NULL }; + pid_t pid = vfork(); + + if (pid < 0) + perror_msg_and_fail("vfork"); + + if (!pid) { + if (logit("child") || execve(args[0], args, args + 1)) + _exit(2); + } + + close(0); + close(parent_wait_fds[1]); + + if (read(parent_wait_fds[0], &parent_wait_fds[1], sizeof(int))) + perror_msg_and_fail("read"); + logit("parent"); + close(child_wait_fds[1]); + + int status; + assert(wait(&status) == pid); + assert(status == 0); + + pid_t ppid = getpid(); + logit("finish"); + + printf("%-5d chdir(\"%sstart\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%schild\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sparent\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sexec\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sfinish\") = -1 ENOENT (%m)\n", + ppid, prefix, + pid, prefix, + ppid, prefix, + pid, prefix, + ppid, prefix); + return 0; +} diff --git a/tests-mx32/vfork-f.test b/tests-mx32/vfork-f.test new file mode 100755 index 00000000..ff4422b2 --- /dev/null +++ b/tests-mx32/vfork-f.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check how strace -f follows vfork syscall. + +. "${srcdir=.}/fork-f.test" diff --git a/tests-mx32/vhangup.c b/tests-mx32/vhangup.c new file mode 100644 index 00000000..e7ddabba --- /dev/null +++ b/tests-mx32/vhangup.c @@ -0,0 +1,34 @@ +#include "tests.h" +#include + +#ifdef __NR_vhangup + +# include +# include + +int +main(void) +{ + if (setsid() == -1) + perror_msg_and_skip("setsid"); + + long rc = syscall(__NR_vhangup); + + /* + * On setsid() success, the new session has no controlling terminal, + * therefore a subsequent vhangup() has nothing to hangup. + * + * The system call, however, returns 0 iff the calling process + * has CAP_SYS_TTY_CONFIG capability. + */ + printf("vhangup() = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_vhangup") + +#endif diff --git a/tests-mx32/vhangup.test b/tests-mx32/vhangup.test new file mode 100755 index 00000000..8fe1cacb --- /dev/null +++ b/tests-mx32/vhangup.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check vhangup syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a10 diff --git a/tests-mx32/vmsplice.c b/tests-mx32/vmsplice.c new file mode 100644 index 00000000..f29962e3 --- /dev/null +++ b/tests-mx32/vmsplice.c @@ -0,0 +1,107 @@ +/* + * This file is part of vmsplice strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_vmsplice + +# include +# include +# include +# include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + const struct iovec iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *iov = tail_memdup(iov_, sizeof(iov_)); + const unsigned int len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + tprintf("vmsplice(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, %s) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(iov_), + "SPLICE_F_NONBLOCK", len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const long rc = syscall(__NR_vmsplice, 1, iov, ARRAY_SIZE(iov_), 2); + if (rc < 0) + perror_msg_and_skip("vmsplice"); + assert(rc == (int) len); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_vmsplice") + +#endif diff --git a/tests-mx32/vmsplice.test b/tests-mx32/vmsplice.test new file mode 100755 index 00000000..8a80650e --- /dev/null +++ b/tests-mx32/vmsplice.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of vmsplice syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=1 diff --git a/tests-mx32/wait4-v.c b/tests-mx32/wait4-v.c new file mode 100644 index 00000000..8c0c9f59 --- /dev/null +++ b/tests-mx32/wait4-v.c @@ -0,0 +1,3 @@ +/* This file is part of wait4-v strace test. */ +#define VERBOSE 1 +#include "wait4.c" diff --git a/tests-mx32/wait4-v.test b/tests-mx32/wait4-v.test new file mode 100755 index 00000000..58e55f25 --- /dev/null +++ b/tests-mx32/wait4-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of wait4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests-mx32/wait4.c b/tests-mx32/wait4.c new file mode 100644 index 00000000..ccb3ebb9 --- /dev/null +++ b/tests-mx32/wait4.c @@ -0,0 +1,199 @@ +/* + * Check decoding of wait4 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static const char * +sprint_rusage(const struct rusage *const ru) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{ru_utime={tv_sec=%lu, tv_usec=%lu}" + ", ru_stime={tv_sec=%lu, tv_usec=%lu}" +#if VERBOSE + ", ru_maxrss=%lu" + ", ru_ixrss=%lu" + ", ru_idrss=%lu" + ", ru_isrss=%lu" + ", ru_minflt=%lu" + ", ru_majflt=%lu" + ", ru_nswap=%lu" + ", ru_inblock=%lu" + ", ru_oublock=%lu" + ", ru_msgsnd=%lu" + ", ru_msgrcv=%lu" + ", ru_nsignals=%lu" + ", ru_nvcsw=%lu" + ", ru_nivcsw=%lu}" +#else + ", ...}" +#endif + , (long) ru->ru_utime.tv_sec + , (long) ru->ru_utime.tv_usec + , (long) ru->ru_stime.tv_sec + , (long) ru->ru_stime.tv_usec +#if VERBOSE + , (long) ru->ru_maxrss + , (long) ru->ru_ixrss + , (long) ru->ru_idrss + , (long) ru->ru_isrss + , (long) ru->ru_minflt + , (long) ru->ru_majflt + , (long) ru->ru_nswap + , (long) ru->ru_inblock + , (long) ru->ru_oublock + , (long) ru->ru_msgsnd + , (long) ru->ru_msgrcv + , (long) ru->ru_nsignals + , (long) ru->ru_nvcsw + , (long) ru->ru_nivcsw +#endif + ); + return buf; +} + +static pid_t +do_wait4(pid_t pid, int *wstatus, int options, struct rusage *ru) +{ + sigset_t mask = {}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); + pid_t rc = wait4(pid, wstatus, options, ru); + assert(sigprocmask(SIG_UNBLOCK, &mask, NULL) == 0); + return rc; +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid; + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + int *const s = tail_alloc(sizeof(*s)); + if (wait4(pid, s, WNOHANG|__WALL, NULL)) + perror_msg_and_fail("wait4 #1"); + tprintf("wait4(%d, %p, WNOHANG|__WALL, NULL) = 0\n", pid, s); + + struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + if (wait4(pid, s, WNOHANG|__WALL, rusage)) + perror_msg_and_fail("wait4 #2"); + tprintf("wait4(%d, %p, WNOHANG|__WALL, %p) = 0\n", pid, s, rusage); + + assert(write(1, "", 1) == 1); + (void) close(1); + + assert(do_wait4(pid, s, 0, rusage) == pid); + assert(WIFEXITED(*s) && WEXITSTATUS(*s) == 42); + tprintf("wait4(%d, [{WIFEXITED(s) && WEXITSTATUS(s) == 42}], 0, %s)" + " = %d\n", pid, sprint_rusage(rusage), pid); + + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) raise(SIGUSR1); + return 1; + } + + assert(do_wait4(pid, s, __WALL, rusage) == pid); + assert(WIFSIGNALED(*s) && WTERMSIG(*s) == SIGUSR1); + tprintf("wait4(%d, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGUSR1}]" + ", __WALL, %s) = %d\n", pid, sprint_rusage(rusage), pid); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + assert(do_wait4(pid, s, WSTOPPED, rusage) == pid); + assert(WIFSTOPPED(*s) && WSTOPSIG(*s) == SIGSTOP); + tprintf("wait4(%d, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSTOP}]" + ", WSTOPPED, %s) = %d\n", pid, sprint_rusage(rusage), pid); + + if (kill(pid, SIGCONT)) + perror_msg_and_fail("kill(SIGCONT)"); + +#if defined WCONTINUED && defined WIFCONTINUED + assert(do_wait4(pid, s, WCONTINUED, rusage) == pid); + assert(WIFCONTINUED(*s)); + tprintf("wait4(%d, [{WIFCONTINUED(s)}], WCONTINUED" + ", %s) = %d\n", pid, sprint_rusage(rusage), pid); +#endif /* WCONTINUED && WIFCONTINUED */ + + assert(write(1, "", 1) == 1); + (void) close(1); + + assert(do_wait4(pid, s, 0, rusage) == pid); + assert(WIFEXITED(*s) && WEXITSTATUS(*s) == 0); + tprintf("wait4(%d, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0" + ", %s) = %d\n", pid, sprint_rusage(rusage), pid); + + assert(wait4(-1, s, WNOHANG|WSTOPPED|__WALL, rusage) == -1); + tprintf("wait4(-1, %p, WNOHANG|WSTOPPED|__WALL, %p) = -1 %s (%m)\n", + s, rusage, errno2name()); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/wait4.test b/tests-mx32/wait4.test new file mode 100755 index 00000000..6338d1f6 --- /dev/null +++ b/tests-mx32/wait4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of wait4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/waitid-v.c b/tests-mx32/waitid-v.c new file mode 100644 index 00000000..15a8010c --- /dev/null +++ b/tests-mx32/waitid-v.c @@ -0,0 +1,3 @@ +/* This file is part of waitid-v strace test. */ +#define VERBOSE 1 +#include "waitid.c" diff --git a/tests-mx32/waitid-v.test b/tests-mx32/waitid-v.test new file mode 100755 index 00000000..eb498cb0 --- /dev/null +++ b/tests-mx32/waitid-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of waitid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests-mx32/waitid.c b/tests-mx32/waitid.c new file mode 100644 index 00000000..6a102990 --- /dev/null +++ b/tests-mx32/waitid.c @@ -0,0 +1,263 @@ +/* + * Check decoding of waitid syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static const char * +sprint_rusage(const struct rusage *const ru) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{ru_utime={tv_sec=%lld, tv_usec=%lld}" + ", ru_stime={tv_sec=%lld, tv_usec=%lld}" +#if VERBOSE + ", ru_maxrss=%llu" + ", ru_ixrss=%llu" + ", ru_idrss=%llu" + ", ru_isrss=%llu" + ", ru_minflt=%llu" + ", ru_majflt=%llu" + ", ru_nswap=%llu" + ", ru_inblock=%llu" + ", ru_oublock=%llu" + ", ru_msgsnd=%llu" + ", ru_msgrcv=%llu" + ", ru_nsignals=%llu" + ", ru_nvcsw=%llu" + ", ru_nivcsw=%llu}" +#else + ", ...}" +#endif + , (long long) ru->ru_utime.tv_sec + , (long long) ru->ru_utime.tv_usec + , (long long) ru->ru_stime.tv_sec + , (long long) ru->ru_stime.tv_usec +#if VERBOSE + , zero_extend_signed_to_ull(ru->ru_maxrss) + , zero_extend_signed_to_ull(ru->ru_ixrss) + , zero_extend_signed_to_ull(ru->ru_idrss) + , zero_extend_signed_to_ull(ru->ru_isrss) + , zero_extend_signed_to_ull(ru->ru_minflt) + , zero_extend_signed_to_ull(ru->ru_majflt) + , zero_extend_signed_to_ull(ru->ru_nswap) + , zero_extend_signed_to_ull(ru->ru_inblock) + , zero_extend_signed_to_ull(ru->ru_oublock) + , zero_extend_signed_to_ull(ru->ru_msgsnd) + , zero_extend_signed_to_ull(ru->ru_msgrcv) + , zero_extend_signed_to_ull(ru->ru_nsignals) + , zero_extend_signed_to_ull(ru->ru_nvcsw) + , zero_extend_signed_to_ull(ru->ru_nivcsw) +#endif + ); + return buf; +} + +#define CASE(x) case x: return #x + +static const char * +si_code_2_name(const int code) +{ + switch (code) { +#ifdef CLD_EXITED + CASE(CLD_EXITED); +#endif +#ifdef CLD_KILLED + CASE(CLD_KILLED); +#endif +#ifdef CLD_DUMPED + CASE(CLD_DUMPED); +#endif +#ifdef CLD_TRAPPED + CASE(CLD_TRAPPED); +#endif +#ifdef CLD_STOPPED + CASE(CLD_STOPPED); +#endif +#ifdef CLD_CONTINUED + CASE(CLD_CONTINUED); +#endif + default: perror_msg_and_fail("unknown si_code %d", code); + } +} + +static const char * +sprint_siginfo(const siginfo_t *const si, const char *const status_text) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{si_signo=SIGCHLD" + ", si_code=%s" + ", si_pid=%u" + ", si_uid=%u" + ", si_status=%s" + ", si_utime=%llu" + ", si_stime=%llu}", + si_code_2_name(si->si_code), + si->si_pid, + si->si_uid, + status_text, + zero_extend_signed_to_ull(si->si_utime), + zero_extend_signed_to_ull(si->si_stime)); + return buf; +} + +static unsigned long +poison(unsigned int v) +{ + return (unsigned long) 0xfacefeed00000000ULL | v; +} + +static long +do_waitid(const unsigned int idtype, + const unsigned int id, + const siginfo_t *const infop, + const unsigned int options, + const struct rusage *const rusage) +{ + sigset_t mask = {}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); + long rc = syscall(__NR_waitid, poison(idtype), poison(id), + infop, poison(options), rusage); + assert(sigprocmask(SIG_UNBLOCK, &mask, NULL) == 0); + return rc; +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid; + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + if (do_waitid(P_PID, pid, 0, WNOHANG|WEXITED, 0)) + perror_msg_and_fail("waitid #1"); + tprintf("waitid(P_PID, %d, NULL, WNOHANG|WEXITED, NULL) = 0\n", pid); + + siginfo_t *const sinfo = tail_alloc(sizeof(*sinfo)); + memset(sinfo, 0, sizeof(*sinfo)); + struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + if (do_waitid(P_PID, pid, sinfo, WNOHANG|WEXITED|WSTOPPED, rusage)) + perror_msg_and_fail("waitid #2"); + tprintf("waitid(P_PID, %d, {}, WNOHANG|WEXITED|WSTOPPED, %s) = 0\n", + pid, sprint_rusage(rusage)); + + assert(write(1, "", 1) == 1); + (void) close(1); + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #3"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "42"), sprint_rusage(rusage)); + + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) raise(SIGUSR1); + return 1; + } + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #4"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGUSR1"), sprint_rusage(rusage)); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + if (do_waitid(P_PID, pid, sinfo, WSTOPPED, rusage)) + perror_msg_and_fail("waitid #5"); + tprintf("waitid(P_PID, %d, %s, WSTOPPED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGSTOP"), sprint_rusage(rusage)); + + if (kill(pid, SIGCONT)) + perror_msg_and_fail("kill(SIGCONT)"); + +#if defined WCONTINUED + if (do_waitid(P_PID, pid, sinfo, WCONTINUED, rusage)) + perror_msg_and_fail("waitid #6"); + tprintf("waitid(P_PID, %d, %s, WCONTINUED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGCONT"), sprint_rusage(rusage)); +#endif /* WCONTINUED */ + + assert(write(1, "", 1) == 1); + (void) close(1); + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #7"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "0"), sprint_rusage(rusage)); + + long rc = do_waitid(P_ALL, -1, sinfo, WEXITED|WSTOPPED, rusage); + tprintf("waitid(P_ALL, -1, %p, WEXITED|WSTOPPED, %p)" + " = %ld %s (%m)\n", sinfo, rusage, rc, errno2name()); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/waitid.test b/tests-mx32/waitid.test new file mode 100755 index 00000000..3bcba3ab --- /dev/null +++ b/tests-mx32/waitid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of waitid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/waitpid.c b/tests-mx32/waitpid.c new file mode 100644 index 00000000..2e22e245 --- /dev/null +++ b/tests-mx32/waitpid.c @@ -0,0 +1,56 @@ +/* + * Check decoding of waitpid syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_waitpid + +# include +# include +# include + +int +main(void) +{ + unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + long rc = syscall(__NR_waitpid, pid, 0L, (unsigned long) WNOHANG); + printf("waitpid(%d, NULL, WNOHANG) = %ld %s (%m)\n", + (int) pid, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_waitpid") + +#endif diff --git a/tests-mx32/waitpid.test b/tests-mx32/waitpid.test new file mode 100755 index 00000000..93807d1f --- /dev/null +++ b/tests-mx32/waitpid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of waitpid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/xattr-strings.c b/tests-mx32/xattr-strings.c new file mode 100644 index 00000000..310929a9 --- /dev/null +++ b/tests-mx32/xattr-strings.c @@ -0,0 +1,30 @@ +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include + +int +main(void) +{ + static const char name[] = "strace.test"; + static const char c_value[] = "foobar"; + + const char *const z_value = tail_memdup(c_value, sizeof(c_value)); + long rc; + + rc = fsetxattr(-1, name, z_value, sizeof(c_value), XATTR_REPLACE); + printf("fsetxattr(-1, \"%.*s\"..., \"%.*s\"..., %u, XATTR_REPLACE) = %s\n", + 4, name, 4, c_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests-mx32/xattr-strings.test b/tests-mx32/xattr-strings.test new file mode 100755 index 00000000..25ef360b --- /dev/null +++ b/tests-mx32/xattr-strings.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check *xattr syscalls decoding when limiting string size. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests-mx32/xattr.c b/tests-mx32/xattr.c new file mode 100644 index 00000000..a772eced --- /dev/null +++ b/tests-mx32/xattr.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include + +# ifndef XATTR_SIZE_MAX +# define XATTR_SIZE_MAX 65536 +# endif + +#define DEFAULT_STRLEN 32 + +int +main(void) +{ + static const char name[] = "strace.test"; + static const char c_value[] = "foo\0bar"; + static const char q_value[] = "foo\\0bar"; + + const char *const z_value = tail_memdup(c_value, sizeof(c_value)); + char *const efault = tail_alloc(1) + 1; + const char *const value = tail_memdup(c_value, sizeof(c_value) - 1); + char *const big = tail_alloc(XATTR_SIZE_MAX + 1); + long rc; + const char *errstr; + + rc = fsetxattr(-1, 0, 0, 0, XATTR_CREATE); + printf("fsetxattr(-1, NULL, NULL, 0, XATTR_CREATE) = %s\n", + sprintrc(rc)); + + rc = fsetxattr(-1, 0, z_value, 0, XATTR_CREATE); + printf("fsetxattr(-1, NULL, \"\", 0, XATTR_CREATE) = %s\n", + sprintrc(rc)); + + rc = fsetxattr(-1, name, big, XATTR_SIZE_MAX + 1, XATTR_CREATE); + printf("fsetxattr(-1, \"%s\", %p, %u, XATTR_CREATE) = %s\n", + name, big, XATTR_SIZE_MAX + 1, sprintrc(rc)); + + rc = fsetxattr(-1, name, value, sizeof(c_value), XATTR_CREATE); + printf("fsetxattr(-1, \"%s\", %p, %u, XATTR_CREATE) = %s\n", + name, value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = fsetxattr(-1, name, z_value, sizeof(c_value), XATTR_REPLACE); + printf("fsetxattr(-1, \"%s\", \"%s\", %u, XATTR_REPLACE) = %s\n", + name, q_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = fsetxattr(-1, name, value, sizeof(c_value) - 1, XATTR_CREATE|XATTR_REPLACE); + printf("fsetxattr(-1, \"%s\", \"%s\", %u, XATTR_CREATE|XATTR_REPLACE)" + " = %s\n", + name, q_value, (unsigned) sizeof(c_value) - 1, sprintrc(rc)); + + rc = setxattr(".", name, z_value, sizeof(c_value), XATTR_CREATE); + printf("setxattr(\".\", \"%s\", \"%s\", %u, XATTR_CREATE) = %s\n", + name, q_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = lsetxattr(".", name, value, sizeof(c_value) - 1, XATTR_CREATE); + printf("lsetxattr(\".\", \"%s\", \"%s\", %u, XATTR_CREATE) = %s\n", + name, q_value, (unsigned) sizeof(c_value) - 1, sprintrc(rc)); + + rc = fgetxattr(-1, name, efault, 4); + printf("fgetxattr(-1, \"%s\", %p, 4) = %s\n", + name, efault, sprintrc(rc)); + + rc = getxattr(".", name, big, XATTR_SIZE_MAX + 1); + printf("getxattr(\".\", \"%s\", %p, %u) = %s\n", + name, big, XATTR_SIZE_MAX + 1, sprintrc(rc)); + + rc = lgetxattr(".", name, big + 1, XATTR_SIZE_MAX); + printf("lgetxattr(\".\", \"%s\", %p, %u) = %s\n", + name, big + 1, XATTR_SIZE_MAX, sprintrc(rc)); + + rc = flistxattr(-1, efault, 4); + printf("flistxattr(-1, %p, 4) = %s\n", efault, sprintrc(rc)); + + rc = llistxattr("", efault + 1, 4); + printf("llistxattr(\"\", %p, 4) = %s\n", efault + 1, sprintrc(rc)); + + rc = listxattr(".", big, 0); + printf("listxattr(\".\", %p, 0) = %s\n", big, sprintrc(rc)); + + rc = listxattr(".", big, XATTR_SIZE_MAX + 1); + errstr = sprintrc(rc); + printf("listxattr(\".\", "); + if (rc < 0) + printf("%p", big); + else { + const int ellipsis = rc > DEFAULT_STRLEN; + + putchar('"'); + print_quoted_memory(big, ellipsis ? DEFAULT_STRLEN : rc); + putchar('"'); + if (ellipsis) + fputs("...", stdout); + } + printf(", %u) = %s\n", XATTR_SIZE_MAX + 1, errstr); + + rc = fremovexattr(-1, name); + printf("fremovexattr(-1, \"%s\") = %s\n", name, sprintrc(rc)); + + rc = removexattr(".", name); + printf("removexattr(\".\", \"%s\") = %s\n", name, sprintrc(rc)); + + rc = lremovexattr(".", name); + printf("lremovexattr(\".\", \"%s\") = %s\n", name, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests-mx32/xattr.test b/tests-mx32/xattr.test new file mode 100755 index 00000000..8c7a87b9 --- /dev/null +++ b/tests-mx32/xattr.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check *xattr syscalls decoding. + +. "${srcdir=.}/init.sh" + +syscalls= +for n in getxattr setxattr listxattr removexattr; do + syscalls="$syscalls,${n},f${n},l${n}" +done + +run_strace_match_diff -a22 -e trace=$syscalls diff --git a/tests-mx32/xchownx.c b/tests-mx32/xchownx.c new file mode 100644 index 00000000..fe582835 --- /dev/null +++ b/tests-mx32/xchownx.c @@ -0,0 +1,152 @@ +/* + * Check decoding of chown/chown32/lchown/lchown32/fchown/fchown32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#ifdef UGID_TYPE_IS_SHORT +# define UGID_TYPE short +# define GETEUID syscall(__NR_geteuid) +# define GETEGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUID(arg) check_overflowuid(arg) +# define CHECK_OVERFLOWGID(arg) check_overflowgid(arg) +#else +# define UGID_TYPE int +# define GETEUID geteuid() +# define GETEGID getegid() +# define CHECK_OVERFLOWUID(arg) +# define CHECK_OVERFLOWGID(arg) +#endif + +#define UNLINK_SAMPLE \ + if (unlink(sample)) perror_msg_and_fail("unlink") +#define CLOSE_SAMPLE \ + if (close(fd)) perror_msg_and_fail("close") + +#ifdef ACCESS_BY_DESCRIPTOR +# define SYSCALL_ARG1 fd +# define FMT_ARG1 "%d" +# define EOK_CMD CLOSE_SAMPLE +# define CLEANUP_CMD UNLINK_SAMPLE +#else +# define SYSCALL_ARG1 sample +# define FMT_ARG1 "\"%s\"" +# define EOK_CMD UNLINK_SAMPLE +# define CLEANUP_CMD CLOSE_SAMPLE +#endif + +static int +ugid2int(const unsigned UGID_TYPE id) +{ + if ((unsigned UGID_TYPE) -1U == id) + return -1; + else + return id; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf(", -1"); + else + printf(", %u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int id) +{ + return num == id || num == -1U; +} + +#define PAIR(val) { val, gid }, { uid, val } + +int +main(void) +{ + static const char sample[] = SYSCALL_NAME "_sample"; + + unsigned int uid = GETEUID; + CHECK_OVERFLOWUID(uid); + unsigned int gid = GETEGID; + CHECK_OVERFLOWUID(gid); + + const struct { + const long uid, gid; + } tests[] = { + { uid, gid }, + { (unsigned long) 0xffffffff00000000ULL | uid, gid }, + { uid, (unsigned long) 0xffffffff00000000ULL | gid }, + PAIR(-1U), + PAIR(-1L), + { 0xffff0000U | uid, gid }, + { uid, 0xffff0000U | gid }, + PAIR(0xffff), + PAIR(0xc0deffffU), + PAIR(0xfacefeedU), + PAIR((long) 0xfacefeeddeadbeefULL) + }; + + int fd = open(sample, O_RDONLY | O_CREAT, 0400); + if (fd < 0) + perror_msg_and_fail("open"); + + CLEANUP_CMD; + + unsigned int i; + long expected = 0; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int unum = ugid2int(tests[i].uid); + const unsigned int gnum = ugid2int(tests[i].gid); + + if (num_matches_id(unum, uid) && + num_matches_id(gnum, gid)) { + if (expected) + continue; + } else { + if (!expected) { + expected = -1; + EOK_CMD; + } + } + + const long rc = syscall(SYSCALL_NR, SYSCALL_ARG1, + tests[i].uid, tests[i].gid); + const char *errstr = sprintrc(rc); + printf("%s(" FMT_ARG1, SYSCALL_NAME, SYSCALL_ARG1); + print_int(unum); + print_int(gnum); + printf(") = %s\n", errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/xet_robust_list.c b/tests-mx32/xet_robust_list.c new file mode 100644 index 00000000..211dec45 --- /dev/null +++ b/tests-mx32/xet_robust_list.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_get_robust_list && defined __NR_set_robust_list + +# include +# include + +static const char * +sprintaddr(void *addr) +{ + static char buf[sizeof(addr) * 2 + sizeof("0x")]; + + if (!addr) + return "NULL"; + else + snprintf(buf, sizeof(buf), "%p", addr); + + return buf; +} + +int +main(void) +{ + const pid_t pid = getpid(); + const long long_pid = (unsigned long) (0xdeadbeef00000000LL | pid); + void **p_head = tail_alloc(sizeof(void *)); + size_t *p_len = tail_alloc(sizeof(size_t)); + + if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) + perror_msg_and_skip("get_robust_list"); + printf("get_robust_list(%d, [%s], [%lu]) = 0\n", + (int) pid, sprintaddr(*p_head), (unsigned long) *p_len); + + void *head = tail_alloc(*p_len); + if (syscall(__NR_set_robust_list, head, *p_len)) + perror_msg_and_skip("set_robust_list"); + printf("set_robust_list(%p, %lu) = 0\n", + head, (unsigned long) *p_len); + + if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) + perror_msg_and_skip("get_robust_list"); + printf("get_robust_list(%d, [%s], [%lu]) = 0\n", + (int) pid, sprintaddr(*p_head), (unsigned long) *p_len); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_robust_list && __NR_set_robust_list") + +#endif diff --git a/tests-mx32/xet_robust_list.test b/tests-mx32/xet_robust_list.test new file mode 100755 index 00000000..8a3a3820 --- /dev/null +++ b/tests-mx32/xet_robust_list.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check get_robust_list and set_robust_list syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests-mx32/xetitimer.c b/tests-mx32/xetitimer.c new file mode 100644 index 00000000..4b17edd3 --- /dev/null +++ b/tests-mx32/xetitimer.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + struct { + struct itimerval itv; + uint32_t pad[4]; + } old = { + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .itv = { + .it_interval = { 0xc0de1, 0xc0de2 }, + .it_value = { 0xc0de3, 0xc0de4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (setitimer(ITIMER_REAL, &new.itv, &old.itv)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", + (intmax_t) new.itv.it_interval.tv_sec, + (intmax_t) new.itv.it_interval.tv_usec, + (intmax_t) new.itv.it_value.tv_sec, + (intmax_t) new.itv.it_value.tv_usec, + (intmax_t) old.itv.it_interval.tv_sec, + (intmax_t) old.itv.it_interval.tv_usec, + (intmax_t) old.itv.it_value.tv_sec, + (intmax_t) old.itv.it_value.tv_usec); + + if (getitimer(ITIMER_REAL, &old.itv)) + perror_msg_and_skip("getitimer"); + printf("getitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", + (intmax_t) old.itv.it_interval.tv_sec, + (intmax_t) old.itv.it_interval.tv_usec, + (intmax_t) old.itv.it_value.tv_sec, + (intmax_t) old.itv.it_value.tv_usec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/xetitimer.test b/tests-mx32/xetitimer.test new file mode 100755 index 00000000..4aa00cce --- /dev/null +++ b/tests-mx32/xetitimer.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setitimer and getitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setitimer,getitimer diff --git a/tests-mx32/xetpgid.c b/tests-mx32/xetpgid.c new file mode 100644 index 00000000..24e0d7f0 --- /dev/null +++ b/tests-mx32/xetpgid.c @@ -0,0 +1,59 @@ +/* + * This file is part of xetpgid strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_getpgid && defined __NR_setpgid + +# include +# include + +int +main(void) +{ + const int pid = getpid(); + long rc = syscall(__NR_getpgid, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("getpgid(%d) = %ld\n", pid, rc); + + rc = syscall(__NR_setpgid, + (unsigned long) 0xffffffff00000000ULL, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("setpgid(0, %d) = %ld\n", pid, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpgid && __NR_setpgid") + +#endif diff --git a/tests-mx32/xetpgid.test b/tests-mx32/xetpgid.test new file mode 100755 index 00000000..07f4f9e8 --- /dev/null +++ b/tests-mx32/xetpgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpgid and setpgid syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests-mx32/xetpriority.c b/tests-mx32/xetpriority.c new file mode 100644 index 00000000..ed552598 --- /dev/null +++ b/tests-mx32/xetpriority.c @@ -0,0 +1,31 @@ +#include "tests.h" +#include + +#if defined __NR_getpriority && defined __NR_setpriority + +# include +# include +# include + +int +main(void) +{ + const int pid = getpid(); + long rc = syscall(__NR_getpriority, PRIO_PROCESS, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc); + + rc = syscall(__NR_setpriority, PRIO_PROCESS, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL); + printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpriority && _NR_setpriority") + +#endif diff --git a/tests-mx32/xetpriority.test b/tests-mx32/xetpriority.test new file mode 100755 index 00000000..2c84ba41 --- /dev/null +++ b/tests-mx32/xetpriority.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpriority and setpriority syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests-mx32/xettimeofday.c b/tests-mx32/xettimeofday.c new file mode 100644 index 00000000..d36c57b4 --- /dev/null +++ b/tests-mx32/xettimeofday.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + struct { + struct timeval tv; + uint32_t pad0[2]; + struct timezone tz; + uint32_t pad1[2]; + } t = { + .pad0 = { 0xdeadbeef, 0xbadc0ded }, + .pad1 = { 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_gettimeofday, &t.tv, NULL)) + perror_msg_and_skip("gettimeofday"); + printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}, NULL) = 0\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec); + + if (syscall(__NR_gettimeofday, &t.tv, &t.tz)) + perror_msg_and_skip("gettimeofday"); + printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = 0\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, + t.tz.tz_minuteswest, t.tz.tz_dsttime); + + t.tv.tv_sec = -1; + t.tv.tv_usec = 1000000000; + assert(syscall(__NR_settimeofday, &t.tv, &t.tz) == -1); + printf("settimeofday({tv_sec=%jd, tv_usec=%jd}" + ", {tz_minuteswest=%d, tz_dsttime=%d})" + " = -1 EINVAL (%m)\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, + t.tz.tz_minuteswest, t.tz.tz_dsttime); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/xettimeofday.test b/tests-mx32/xettimeofday.test new file mode 100755 index 00000000..68764e46 --- /dev/null +++ b/tests-mx32/xettimeofday.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check gettimeofday and settimeofday syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-mx32/xgetrlimit.c b/tests-mx32/xgetrlimit.c new file mode 100644 index 00000000..78d9cb99 --- /dev/null +++ b/tests-mx32/xgetrlimit.c @@ -0,0 +1,91 @@ +/* + * Check decoding of getrlimit/ugetrlimit syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resources.h" + +const char * +sprint_rlim(kernel_ulong_t lim) +{ + if (sizeof(lim) == sizeof(uint64_t)) { + if (lim == (kernel_ulong_t) -1ULL) + return "RLIM64_INFINITY"; + } else { + if (lim == (kernel_ulong_t) -1U) + return "RLIM_INFINITY"; + } + + static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; + static int i; + i &= 1; + if (lim > 1024 && lim % 1024 == 0) + sprintf(buf[i], "%llu*1024", (unsigned long long) lim / 1024); + else + sprintf(buf[i], "%llu", (unsigned long long) lim); + + return buf[i++]; +} + +#ifdef NR_GETRLIMIT + +int +main(void) +{ + kernel_ulong_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(NR_GETRLIMIT, res, 0); + if (rc && ENOSYS == errno) + perror_msg_and_skip(STR_GETRLIMIT); + printf("%s(%s, NULL) = %ld %s (%m)\n", + STR_GETRLIMIT, xlat->str, rc, errno2name()); + + rc = syscall(NR_GETRLIMIT, res, rlimit); + if (rc) + printf("%s(%s, NULL) = %ld %s (%m)\n", + STR_GETRLIMIT, xlat->str, rc, errno2name()); + else + printf("%s(%s, {rlim_cur=%s, rlim_max=%s})" + " = 0\n", STR_GETRLIMIT, xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1])); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#endif /* NR_GETRLIMIT */ diff --git a/tests-mx32/xselect.c b/tests-mx32/xselect.c new file mode 100644 index 00000000..39e87ac7 --- /dev/null +++ b/tests-mx32/xselect.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Based on test by Dr. David Alan Gilbert + */ + +#include +#include +#include +#include + +static fd_set set[0x1000000 / sizeof(fd_set)]; + +int main(void) +{ + int fds[2]; + struct { + struct timeval tv; + int pad[2]; + } tm_in = { + .tv = { .tv_sec = 0xc0de1, .tv_usec = 0xc0de2 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, tm = tm_in; + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + /* + * Start with a nice simple select. + */ + FD_ZERO(set); + FD_SET(fds[0], set); + FD_SET(fds[1], set); + int rc = syscall(TEST_SYSCALL_NR, fds[1] + 1, set, set, set, NULL); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + assert(rc == 1); + printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", + TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1]); + + /* + * Another simple one, with a timeout. + */ + FD_SET(1, set); + FD_SET(2, set); + FD_SET(fds[0], set); + FD_SET(fds[1], set); + assert(syscall(TEST_SYSCALL_NR, fds[1] + 1, NULL, set, NULL, &tm.tv) == 3); + printf("%s(%d, NULL, [1 2 %d %d], NULL, {tv_sec=%lld, tv_usec=%lld})" + " = 3 (out [1 2 %d], left {tv_sec=%lld, tv_usec=%lld})\n", + TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], + (long long) tm_in.tv.tv_sec, (long long) tm_in.tv.tv_usec, + fds[1], + (long long) tm.tv.tv_sec, (long long) tm.tv.tv_usec); + + /* + * Now the crash case that trinity found, negative nfds + * but with a pointer to a large chunk of valid memory. + */ + FD_ZERO(set); + FD_SET(fds[1],set); + assert(syscall(TEST_SYSCALL_NR, -1, NULL, set, NULL, NULL) == -1); + printf("%s(-1, NULL, %p, NULL, NULL) = -1 EINVAL (%m)\n", + TEST_SYSCALL_STR, set); + + /* + * Another variant, with nfds exceeding FD_SETSIZE limit. + */ + FD_ZERO(set); + FD_SET(fds[0],set); + tm.tv.tv_sec = 0; + tm.tv.tv_usec = 123; + assert(syscall(TEST_SYSCALL_NR, FD_SETSIZE + 1, set, set + 1, NULL, &tm.tv) == 0); + printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=123}) = 0 (Timeout)\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/xstatfs.c b/tests-mx32/xstatfs.c new file mode 100644 index 00000000..26c43dee --- /dev/null +++ b/tests-mx32/xstatfs.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define SYSCALL_INVOKE(file, desc, ptr, size) \ + syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), ptr) +#define PRINT_SYSCALL_HEADER(file, desc, size) \ + printf("%s(" SYSCALL_ARG_FMT ", ", SYSCALL_NAME, SYSCALL_ARG(file, desc)) + +#define STRUCT_STATFS struct statfs +#ifdef HAVE_STRUCT_STATFS_F_FRSIZE +# define PRINT_F_FRSIZE +#endif +#ifdef HAVE_STRUCT_STATFS_F_FLAGS +# define PRINT_F_FLAGS +#endif +#if defined HAVE_STRUCT_STATFS_F_FSID_VAL +# define PRINT_F_FSID f_fsid.val +#elif defined HAVE_STRUCT_STATFS_F_FSID___VAL +# define PRINT_F_FSID f_fsid.__val +#endif + +#include "xstatfsx.c" diff --git a/tests-mx32/xstatfs64.c b/tests-mx32/xstatfs64.c new file mode 100644 index 00000000..8f50de29 --- /dev/null +++ b/tests-mx32/xstatfs64.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define SYSCALL_INVOKE(file, desc, ptr, size) \ + syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), size, ptr) +#define PRINT_SYSCALL_HEADER(file, desc, size) \ + printf("%s(" SYSCALL_ARG_FMT ", %u, ", SYSCALL_NAME, \ + SYSCALL_ARG(file, desc), (unsigned) size) + +#define STRUCT_STATFS struct statfs64 +#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE +# define PRINT_F_FRSIZE +#endif +#ifdef HAVE_STRUCT_STATFS64_F_FLAGS +# define PRINT_F_FLAGS +#endif +#if defined HAVE_STRUCT_STATFS64_F_FSID_VAL +# define PRINT_F_FSID f_fsid.val +#elif defined HAVE_STRUCT_STATFS64_F_FSID___VAL +# define PRINT_F_FSID f_fsid.__val +#endif +#define CHECK_ODD_SIZE + +#include "xstatfsx.c" diff --git a/tests-mx32/xstatfsx.c b/tests-mx32/xstatfsx.c new file mode 100644 index 00000000..d8288f1f --- /dev/null +++ b/tests-mx32/xstatfsx.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include + +#include "xlat.h" +#include "xlat/fsmagic.h" +#include "xlat/statfs_flags.h" + +#define PRINT_NUM(arg) \ + if (sizeof(b->arg) == sizeof(int)) \ + printf(", %s=%u", #arg, (unsigned int) b->arg); \ + else if (sizeof(b->arg) == sizeof(long)) \ + printf(", %s=%lu", #arg, (unsigned long) b->arg); \ + else \ + printf(", %s=%llu", #arg, (unsigned long long) b->arg) + +static void +print_statfs_type(const char *const prefix, const unsigned int magic) +{ + fputs(prefix, stdout); + unsigned int i; + for (i = 0; i < ARRAY_SIZE(fsmagic); ++i) + if (magic == fsmagic[i].val) { + fputs(fsmagic[i].str, stdout); + return; + } + printf("%#x", magic); +} + +static void +print_statfs(const char *const sample, const char *magic_str) +{ + int fd = open(sample, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", sample); + + STRUCT_STATFS *const b = tail_alloc(sizeof(*b)); + long rc = SYSCALL_INVOKE(sample, fd, b, sizeof(*b)); + if (rc) + perror_msg_and_skip(SYSCALL_NAME); + + PRINT_SYSCALL_HEADER(sample, fd, sizeof(*b)); + if (magic_str) + printf("{f_type=%s", magic_str); + else + print_statfs_type("{f_type=", b->f_type); + PRINT_NUM(f_bsize); + PRINT_NUM(f_blocks); + PRINT_NUM(f_bfree); + PRINT_NUM(f_bavail); + PRINT_NUM(f_files); + PRINT_NUM(f_ffree); +#ifdef PRINT_F_FSID + printf(", f_fsid={val=[%u, %u]}", + (unsigned) b->PRINT_F_FSID[0], (unsigned) b->PRINT_F_FSID[1]); +#endif + PRINT_NUM(f_namelen); +#ifdef PRINT_F_FRSIZE + PRINT_NUM(f_frsize); +#endif +#ifdef PRINT_F_FLAGS + if (b->f_flags & ST_VALID) { + printf(", f_flags="); + printflags(statfs_flags, b->f_flags, "ST_???"); + } +#endif + printf("}) = 0\n"); +} + +int +main(void) +{ + print_statfs("/proc/self/status", "PROC_SUPER_MAGIC"); + + print_statfs(".", NULL); + + long rc = SYSCALL_INVOKE("", -1, 0, sizeof(STRUCT_STATFS)); + const char *errstr = sprintrc(rc); + PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS)); + printf("NULL) = %s\n", errstr); + +#ifdef CHECK_ODD_SIZE + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + rc = SYSCALL_INVOKE("", -1, addr, sizeof(STRUCT_STATFS) + 1); + errstr = sprintrc(rc); + PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS) + 1); + printf("%#lx) = %s\n", addr, errstr); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/xstatx.c b/tests-mx32/xstatx.c new file mode 100644 index 00000000..0d5fca87 --- /dev/null +++ b/tests-mx32/xstatx.c @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if defined HAVE_FTRUNCATE && defined HAVE_FUTIMENS + +# ifndef TEST_SYSCALL_STR +# error TEST_SYSCALL_STR must be defined +# endif +# ifndef TEST_SYSCALL_INVOKE +# error TEST_SYSCALL_INVOKE must be defined +# endif +# ifndef PRINT_SYSCALL_HEADER +# error PRINT_SYSCALL_HEADER must be defined +# endif +# ifndef PRINT_SYSCALL_FOOTER +# error PRINT_SYSCALL_FOOTER must be defined +# endif + +# include +# include +# include +# include +# include +# include + +static void +print_time(const time_t t) +{ + if (!t) { + printf("0"); + return; + } + + struct tm *p = localtime(&t); + + if (p) { + char buf[256]; + + strftime(buf, sizeof(buf), "%FT%T%z", p); + + printf("%s", buf); + } else { + printf("%llu", zero_extend_signed_to_ull(t)); + } +} + +# ifndef STRUCT_STAT +# define STRUCT_STAT struct stat +# define STRUCT_STAT_STR "struct stat" +# define STRUCT_STAT_IS_STAT64 0 +# endif +# ifndef SAMPLE_SIZE +# define SAMPLE_SIZE ((libc_off_t) 43147718418ULL) +# endif + +typedef off_t libc_off_t; + +# define stat libc_stat +# define stat64 libc_stat64 +# include +# include +# undef stat +# undef stat64 + +# undef st_atime +# undef st_mtime +# undef st_ctime +# include "asm_stat.h" + +# if STRUCT_STAT_IS_STAT64 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# if defined MPERS_IS_m32 +# ifdef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined MPERS_IS_mx32 +# ifdef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined HAVE_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif /* MPERS_IS_m32 || MPERS_IS_mx32 || HAVE_STRUCT_STAT64_ST_MTIME_NSEC */ +# else /* !STRUCT_STAT_IS_STAT64 */ +# if defined MPERS_IS_m32 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined MPERS_IS_mx32 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# endif /* MPERS_IS_m32 || MPERS_IS_mx32 */ +# endif /* STRUCT_STAT_IS_STAT64 */ + +# ifndef TEST_BOGUS_STRUCT_STAT +# define TEST_BOGUS_STRUCT_STAT 1 +# endif + +# ifndef IS_FSTAT +# define IS_FSTAT 0 +# endif + +# ifndef OLD_STAT +# define OLD_STAT 0 +# endif + +static void +print_ftype(const unsigned int mode) +{ + if (S_ISREG(mode)) + printf("S_IFREG"); + else if (S_ISDIR(mode)) + printf("S_IFDIR"); + else if (S_ISCHR(mode)) + printf("S_IFCHR"); + else if (S_ISBLK(mode)) + printf("S_IFBLK"); + else + printf("%#o", mode & S_IFMT); +} + +static void +print_perms(const unsigned int mode) +{ + printf("%#o", mode & ~S_IFMT); +} + +static void +print_stat(const STRUCT_STAT *st) +{ + printf("{st_dev=makedev(%u, %u)", + (unsigned int) major(zero_extend_signed_to_ull(st->st_dev)), + (unsigned int) minor(zero_extend_signed_to_ull(st->st_dev))); + printf(", st_ino=%llu", zero_extend_signed_to_ull(st->st_ino)); + printf(", st_mode="); + print_ftype(st->st_mode); + printf("|"); + print_perms(st->st_mode); + printf(", st_nlink=%llu", zero_extend_signed_to_ull(st->st_nlink)); + printf(", st_uid=%llu", zero_extend_signed_to_ull(st->st_uid)); + printf(", st_gid=%llu", zero_extend_signed_to_ull(st->st_gid)); +# if OLD_STAT + printf(", st_blksize=0, st_blocks=0"); +# else /* !OLD_STAT */ + printf(", st_blksize=%llu", zero_extend_signed_to_ull(st->st_blksize)); + printf(", st_blocks=%llu", zero_extend_signed_to_ull(st->st_blocks)); +# endif /* OLD_STAT */ + + switch (st->st_mode & S_IFMT) { + case S_IFCHR: case S_IFBLK: + printf(", st_rdev=makedev(%u, %u)", + (unsigned int) major(zero_extend_signed_to_ull(st->st_rdev)), + (unsigned int) minor(zero_extend_signed_to_ull(st->st_rdev))); + break; + default: + printf(", st_size=%llu", zero_extend_signed_to_ull(st->st_size)); + } + + printf(", st_atime="); + print_time(sign_extend_unsigned_to_ll(st->st_atime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_atime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_atime_nsec)); +# endif + printf(", st_mtime="); + print_time(sign_extend_unsigned_to_ll(st->st_mtime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_mtime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_mtime_nsec)); +# endif + printf(", st_ctime="); + print_time(sign_extend_unsigned_to_ll(st->st_ctime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_ctime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_ctime_nsec)); +# endif + printf("}"); +} + +static int +create_sample(const char *fname, const libc_off_t size) +{ + static const struct timespec ts[] = { + {-10843, 135}, {-10841, 246} + }; + + (void) close(0); + if (open(fname, O_RDWR | O_CREAT | O_TRUNC, 0640)) { + perror(fname); + return 77; + } + if (ftruncate(0, size)) { + perror("ftruncate"); + return 77; + } + if (futimens(0, ts)) { + perror("futimens"); + return 77; + } + return 0; +} + +int +main(void) +{ +# if !IS_FSTAT + static const char full[] = "/dev/full"; +# endif + static const char sample[] = TEST_SYSCALL_STR ".sample"; + STRUCT_STAT st[2]; + + int rc; + + rc = create_sample(sample, SAMPLE_SIZE); + if (rc) { + (void) unlink(sample); + return rc; + } + +# if TEST_BOGUS_STRUCT_STAT + STRUCT_STAT *st_cut = tail_alloc(sizeof(long) * 4); + rc = TEST_SYSCALL_INVOKE(sample, st_cut); + PRINT_SYSCALL_HEADER(sample); + printf("%p", st_cut); + PRINT_SYSCALL_FOOTER(rc); +# endif + +# if !IS_FSTAT + rc = TEST_SYSCALL_INVOKE(full, st); + PRINT_SYSCALL_HEADER(full); + if (rc) + printf("%p", st); + else + print_stat(st); + PRINT_SYSCALL_FOOTER(rc); +# endif + + if ((rc = TEST_SYSCALL_INVOKE(sample, st))) { +# if OLD_STAT + if (errno != EOVERFLOW) +# endif + { + perror(TEST_SYSCALL_STR); + (void) unlink(sample); + return 77; + } + } + (void) unlink(sample); + if (!rc && zero_extend_signed_to_ull(SAMPLE_SIZE) != + zero_extend_signed_to_ull(st[0].st_size)) { + fprintf(stderr, "Size mismatch: " + "requested size(%llu) != st_size(%llu)\n", + zero_extend_signed_to_ull(SAMPLE_SIZE), + zero_extend_signed_to_ull(st[0].st_size)); + fprintf(stderr, "The most likely reason for this is incorrect" + " definition of %s.\n" + "Here is some diagnostics that might help:\n", + STRUCT_STAT_STR); + +#define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ + fprintf(stderr, "offsetof(%s, %s) = %zu" \ + ", sizeof(%s) = %zu\n", \ + STRUCT_STAT_STR, #member, \ + offsetof(STRUCT_STAT, member), \ + #member, sizeof((object).member)) + + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_dev); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_ino); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_mode); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_nlink); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_uid); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_gid); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_rdev); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_size); +# if !OLD_STAT + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blksize); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blocks); +# endif /* !OLD_STAT */ + + return 1; + } + + PRINT_SYSCALL_HEADER(sample); + if (rc) + printf("%p", st); + else + print_stat(st); + PRINT_SYSCALL_FOOTER(rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_FTRUNCATE && HAVE_FUTIMENS") + +#endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 922452ab..311d3bb3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,39 +1,962 @@ # Automake input for strace tests. +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +OS = linux +ARCH = @arch@ +MPERS_NAME = +ARCH_MFLAGS = AM_CFLAGS = $(WARN_CFLAGS) +AM_CPPFLAGS = $(ARCH_MFLAGS) \ + -I$(builddir) \ + -I$(top_builddir)/$(OS)/$(ARCH) \ + -I$(top_srcdir)/$(OS)/$(ARCH) \ + -I$(top_builddir)/$(OS) \ + -I$(top_srcdir)/$(OS) \ + -I$(top_builddir) \ + -I$(top_srcdir) +AM_LDFLAGS = $(ARCH_MFLAGS) + +libtests_a_SOURCES = \ + errno2name.c \ + error_msg.c \ + fill_memory.c \ + get_page_size.c \ + hexdump_strdup.c \ + hexquote_strndup.c \ + inode_of_sockfd.c \ + libmmsg.c \ + libsocketcall.c \ + overflowuid.c \ + pipe_maxfd.c \ + print_quoted_string.c \ + printflags.c \ + printxval.c \ + signal2name.c \ + sprintrc.c \ + tail_alloc.c \ + tests.h \ + tprintf.c \ + # end of libtests_a_SOURCES +libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +check_LIBRARIES = libtests.a +LDADD = libtests.a check_PROGRAMS = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + alarm \ + answer \ + attach-f-p \ + attach-f-p-cmd \ + attach-p-cmd-cmd \ + attach-p-cmd-p \ + bpf \ + brk \ + btrfs \ + caps \ + caps-abbrev \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + count-f \ + creat \ + delete_module \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execve-v \ + execveat \ + execveat-v \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + file_handle \ + file_ioctl \ + filter-unavailable \ + finit_module \ + flock \ + fork-f \ + fstat \ + fstat64 \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_dm-v \ + ioctl_evdev \ + ioctl_evdev-v \ + ioctl_loop \ + ioctl_loop-nv \ + ioctl_loop-v \ + ioctl_mtd \ + ioctl_rtc \ + ioctl_rtc-v \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msgbuf \ + ipc_sem \ + ipc_shm \ + kcmp \ + kexec_file_load \ + kexec_load \ + keyctl \ + kill \ + ksysent \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + mbind \ + membarrier \ + memfd_create \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap64 \ + mmsg \ + mmsg-silent \ + mmsg_name \ + mmsg_name-v \ + mount \ + move_pages \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_control-v \ + msg_name \ + munlockall \ + nanosleep \ net-accept-connect \ + net-icmp_filter \ + net-sockaddr \ + net-y-unix \ + net-yy-inet \ + net-yy-netlink \ + net-yy-unix \ + netlink_inet_diag \ + netlink_netlink_diag \ + netlink_protocol \ + netlink_unix_diag \ + newfstatat \ + nsyscalls \ + old_mmap \ + oldfstat \ + oldlstat \ + oldselect \ + oldstat \ + open \ + openat \ + pause \ + pc \ + perf_event_open \ + perf_event_open_nonverbose \ + perf_event_open_unabbrev \ + personality \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + ppoll \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-seccomp-filter-v \ + prctl-seccomp-strict \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + print_maxfd \ + printstr \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + pwritev \ + qual_fault \ + qual_inject-error-signal \ + qual_inject-retval \ + qual_inject-signal \ + qual_signal \ + quotactl \ + quotactl-v \ + quotactl-xfs \ + quotactl-xfs-v \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + redirect-fds \ + remap_file_pages \ + rename \ + renameat \ + renameat2 \ + request_key \ + restart_syscall \ + rmdir \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ scm_rights \ + seccomp-filter \ + seccomp-filter-v \ + seccomp-strict \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ set_ptracer_any \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ sigaction \ + sigaltstack \ + siginfo \ + signal_receive \ + signalfd4 \ + sigreturn \ + sleep \ + socketcall \ + splice \ stack-fcall \ - uio + stat \ + stat64 \ + statfs \ + statfs64 \ + swap \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + threads-execve \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unix-pair-send-recv \ + unix-pair-sendto-recvfrom \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimes \ + vfork-f \ + vhangup \ + vmsplice \ + wait4 \ + wait4-v \ + waitid \ + waitid-v \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # end of check_PROGRAMS + +attach_f_p_LDADD = -lrt -lpthread $(LDADD) +clock_xettime_LDADD = -lrt $(LDADD) +count_f_LDADD = -lpthread $(LDADD) +filter_unavailable_LDADD = -lpthread $(LDADD) +fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = -lrt $(LDADD) +mq_sendrecv_LDADD = -lrt $(LDADD) +mq_sendrecv_read_LDADD = -lrt $(LDADD) +mq_sendrecv_write_LDADD = -lrt $(LDADD) +newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pc_LDADD = $(dl_LIBS) $(LDADD) +pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +threads_execve_LDADD = -lrt -lpthread $(LDADD) +times_LDADD = -lrt $(LDADD) +truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -uio_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -TESTS = \ - ptrace_setoptions.test \ - strace-f.test \ - qual_syscall.test \ +if USE_LIBUNWIND +LIBUNWIND_TESTS = strace-k.test +else +LIBUNWIND_TESTS = +endif + +DECODER_TESTS = \ + _newselect.test \ + accept.test \ + accept4.test \ + access.test \ + acct.test \ + add_key.test \ + adjtimex.test \ + aio.test \ + alarm.test \ + bpf.test \ + brk.test \ + btrfs-v.test \ + btrfs-vw.test \ + btrfs-w.test \ + btrfs.test \ + caps-abbrev.test \ + caps.test \ + chmod.test \ + chown.test \ + chown32.test \ + chroot.test \ + clock_adjtime.test \ + clock_nanosleep.test \ + clock_xettime.test \ + copy_file_range.test \ + creat.test \ + delete_module.test \ + dup.test \ + dup2.test \ + dup3.test \ + epoll_create.test \ + epoll_create1.test \ + epoll_ctl.test \ + epoll_pwait.test \ + epoll_wait.test \ + erestartsys.test \ + eventfd.test \ + execve-v.test \ + execve.test \ + execveat-v.test \ + execveat.test \ + faccessat.test \ + fadvise64.test \ + fadvise64_64.test \ + fallocate.test \ + fanotify_init.test \ + fanotify_mark.test \ + fchdir.test \ + fchmod.test \ + fchmodat.test \ + fchown.test \ + fchown32.test \ + fchownat.test \ + fcntl.test \ + fcntl64.test \ + fdatasync.test \ + file_handle.test \ + file_ioctl.test \ + finit_module.test \ + flock.test \ + fstat.test \ + fstat64.test \ + fstatat64.test \ + fstatfs.test \ + fstatfs64.test \ + fsync.test \ + ftruncate.test \ + ftruncate64.test \ + futex.test \ + futimesat.test \ + get_mempolicy.test \ + getcpu.test \ + getcwd.test \ + getdents.test \ + getdents64.test \ + getegid.test \ + getegid32.test \ + geteuid.test \ + geteuid32.test \ + getgid.test \ + getgid32.test \ + getgroups.test \ + getgroups32.test \ + getpeername.test \ + getpgrp.test \ + getrandom.test \ + getresgid.test \ + getresgid32.test \ + getresuid.test \ + getresuid32.test \ + getrlimit.test \ + getrusage.test \ + getsid.test \ + getsockname.test \ + getuid.test \ + getuid32.test \ + getxxid.test \ + inet-cmsg.test \ + init_module.test \ + inotify.test \ + inotify_init1.test \ + ioctl.test \ + ioctl_block.test \ + ioctl_dm-v.test \ + ioctl_dm.test \ + ioctl_evdev-v.test \ + ioctl_evdev.test \ + ioctl_loop-nv.test \ + ioctl_loop-v.test \ + ioctl_loop.test \ + ioctl_mtd.test \ + ioctl_rtc-v.test \ + ioctl_rtc.test \ + ioctl_scsi.test \ + ioctl_sg_io_v3.test \ + ioctl_sg_io_v4.test \ + ioctl_sock_gifconf.test \ + ioctl_uffdio.test \ + ioctl_v4l2.test \ + ioperm.test \ + iopl.test \ + ioprio.test \ + ip_mreq.test \ + ipc.test \ + ipc_msg.test \ + ipc_msgbuf.test \ + ipc_sem.test \ + ipc_shm.test \ + kcmp.test \ + kexec_file_load.test \ + kexec_load.test \ + keyctl.test \ + kill.test \ + lchown.test \ + lchown32.test \ + link.test \ + linkat.test \ + llseek.test \ + lookup_dcookie.test \ + lseek.test \ + lstat.test \ + lstat64.test \ + mbind.test \ + membarrier.test \ + memfd_create.test \ + migrate_pages.test \ + mincore.test \ + mkdir.test \ + mkdirat.test \ + mknod.test \ + mknodat.test \ + mlock.test \ + mlock2.test \ + mlockall.test \ + mmap.test \ + mmap64.test \ + mmsg-silent.test \ + mmsg.test \ + mmsg_name-v.test \ + mmsg_name.test \ + mount.test \ + move_pages.test \ + mq.test \ + mq_sendrecv-read.test \ + mq_sendrecv-write.test \ + mq_sendrecv.test \ + msg_control-v.test \ + msg_control.test \ + msg_name.test \ + munlockall.test \ + nanosleep.test \ + net-icmp_filter.test \ + net-sockaddr.test \ + net-y-unix.test \ + net-yy-inet.test \ + net-yy-netlink.test \ + net-yy-unix.test \ + net.test \ + netlink_protocol.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ + oldfstat.test \ + oldlstat.test \ + oldselect.test \ + oldstat.test \ + open.test \ + openat.test \ + pause.test \ + perf_event_open.test \ + perf_event_open_nonverbose.test \ + perf_event_open_unabbrev.test \ + personality.test \ + pipe.test \ + pipe2.test \ + pkey_alloc.test \ + pkey_free.test \ + pkey_mprotect.test \ + poll.test \ + ppoll.test \ + prctl-arg2-intptr.test \ + prctl-dumpable.test \ + prctl-name.test \ + prctl-no-args.test \ + prctl-pdeathsig.test \ + prctl-seccomp-filter-v.test \ + prctl-seccomp-strict.test \ + prctl-securebits.test \ + prctl-tid_address.test \ + prctl-tsc.test \ + pread64-pwrite64.test \ + preadv-pwritev.test \ + preadv.test \ + preadv2-pwritev2.test \ + printstr.test \ + prlimit64.test \ + process_vm_readv.test \ + process_vm_writev.test \ + pselect6.test \ + ptrace.test \ + pwritev.test \ + qual_fault-exit_group.test \ + quotactl-v.test \ + quotactl-xfs-v.test \ + quotactl-xfs.test \ + quotactl.test \ + read-write.test \ + readahead.test \ + readdir.test \ + readlink.test \ + readlinkat.test \ + readv.test \ + reboot.test \ + recvfrom.test \ + recvmmsg-timeout.test \ + recvmsg.test \ + remap_file_pages.test \ + rename.test \ + renameat.test \ + renameat2.test \ + request_key.test \ + rmdir.test \ + rt_sigpending.test \ + rt_sigprocmask.test \ + rt_sigqueueinfo.test \ + rt_sigsuspend.test \ + rt_sigtimedwait.test \ + rt_tgsigqueueinfo.test \ + sched_get_priority_mxx.test \ + sched_rr_get_interval.test \ + sched_xetaffinity.test \ + sched_xetattr.test \ + sched_xetparam.test \ + sched_xetscheduler.test \ + sched_yield.test \ scm_rights-fd.test \ + seccomp-filter-v.test \ + seccomp-filter.test \ + seccomp-strict.test \ + select.test \ + semop.test \ + sendfile.test \ + sendfile64.test \ + set_mempolicy.test \ + setdomainname.test \ + setfsgid.test \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ + setgid.test \ + setgid32.test \ + setgroups.test \ + setgroups32.test \ + sethostname.test \ + setns.test \ + setregid.test \ + setregid32.test \ + setresgid.test \ + setresgid32.test \ + setresuid.test \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ + setrlimit.test \ + setuid.test \ + setuid32.test \ + shmxt.test \ + shutdown.test \ sigaction.test \ + sigaltstack.test \ + siginfo.test \ + signalfd4.test \ + sigreturn.test \ + socketcall.test \ + splice.test \ stat.test \ - net.test \ - net-fd.test \ + stat64.test \ + statfs.test \ + statfs64.test \ + sun_path.test \ + swap.test \ + symlink.test \ + symlinkat.test \ + sync.test \ + sync_file_range.test \ + sync_file_range2.test \ + sysinfo.test \ + syslog.test \ + tee.test \ + time.test \ + timer_create.test \ + timer_xettime.test \ + timerfd_xettime.test \ + times-fail.test \ + times.test \ + truncate.test \ + truncate64.test \ + ugetrlimit.test \ uio.test \ + umask.test \ + umount.test \ + umount2.test \ + umoven-illptr.test \ + umovestr-illptr.test \ + umovestr.test \ + umovestr2.test \ + umovestr3.test \ + uname.test \ + unix-pair-send-recv.test \ + unix-pair-sendto-recvfrom.test \ + unlink.test \ + unlinkat.test \ + unshare.test \ + userfaultfd.test \ + ustat.test \ + utime.test \ + utimensat.test \ + utimes.test \ + vhangup.test \ + vmsplice.test \ + wait4-v.test \ + wait4.test \ + waitid-v.test \ + waitid.test \ + waitpid.test \ + xattr-strings.test \ + xattr.test \ + xet_robust_list.test \ + xetitimer.test \ + xetpgid.test \ + xetpriority.test \ + xettimeofday.test \ + # end of DECODER_TESTS + +MISC_TESTS = \ + attach-f-p.test \ + attach-p-cmd.test \ + bexecve.test \ + count-f.test \ count.test \ + detach-running.test \ detach-sleeping.test \ detach-stopped.test \ - detach-running.test \ - strace-k.test + filter-unavailable.test \ + fork-f.test \ + ksysent.test \ + opipe.test \ + options-syntax.test \ + pc.test \ + qual_fault-syntax.test \ + qual_fault.test \ + qual_inject-error-signal.test \ + qual_inject-retval.test \ + qual_inject-signal.test \ + qual_inject-syntax.test \ + qual_signal.test \ + qual_syscall.test \ + redirect-fds.test \ + redirect.test \ + restart_syscall.test \ + signal_receive.test \ + strace-C.test \ + strace-E.test \ + strace-S.test \ + strace-T.test \ + strace-V.test \ + strace-ff.test \ + strace-r.test \ + strace-t.test \ + strace-tt.test \ + strace-ttt.test \ + threads-execve.test \ + vfork-f.test \ + # end of MISC_TESTS + +TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS) + +XFAIL_TESTS_ = +XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) + +TEST_LOG_COMPILER = env +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh + +@VALGRIND_CHECK_RULES@ +VALGRIND_FLAGS = --quiet +VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp + +EXTRA_DIST = init.sh run.sh match.awk \ + caps-abbrev.awk \ + caps.awk \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + getresugid.c \ + init_delete_module.h \ + ipc.sh \ + ipc_msgbuf.expected \ + ksysent.sed \ + lstatx.c \ + net.expected \ + oldselect.expected \ + pipe.expected \ + ppoll-v.expected \ + ppoll.expected \ + process_vm_readv_writev.c \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + quotactl.h \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaction.awk \ + sigaltstack.expected \ + sockname.c \ + statfs.expected \ + statx.sh \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + struct_flock.c \ + sun_path.expected \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + $(TESTS) + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 -net-fd.log: net.log +ksysent.$(OBJEXT): ksysent.h -TEST_LOG_COMPILER = $(srcdir)/run.sh +objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) +$(objects): scno.h -EXTRA_DIST = init.sh run.sh sigaction.awk $(TESTS) +CLEANFILES = ksysent.h $(TESTS:=.tmp) -CLEANFILES = $(TESTS:=.tmp) +include ../scno.am diff --git a/tests/Makefile.in b/tests/Makefile.in index 2945d914..3a4d792a 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -15,6 +15,58 @@ @SET_MAKE@ # Automake input for strace tests. +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# scno.h make rules for strace. +# +# Copyright (c) 2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -79,45 +131,1678 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = net-accept-connect$(EXEEXT) scm_rights$(EXEEXT) \ - set_ptracer_any$(EXEEXT) sigaction$(EXEEXT) \ - stack-fcall$(EXEEXT) uio$(EXEEXT) +check_PROGRAMS = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ + access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ + adjtimex$(EXEEXT) aio$(EXEEXT) alarm$(EXEEXT) answer$(EXEEXT) \ + attach-f-p$(EXEEXT) attach-f-p-cmd$(EXEEXT) \ + attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) bpf$(EXEEXT) \ + brk$(EXEEXT) btrfs$(EXEEXT) caps$(EXEEXT) caps-abbrev$(EXEEXT) \ + chmod$(EXEEXT) chown$(EXEEXT) chown32$(EXEEXT) chroot$(EXEEXT) \ + clock_adjtime$(EXEEXT) clock_nanosleep$(EXEEXT) \ + clock_xettime$(EXEEXT) copy_file_range$(EXEEXT) \ + count-f$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ + dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) epoll_create$(EXEEXT) \ + epoll_create1$(EXEEXT) epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) \ + epoll_wait$(EXEEXT) erestartsys$(EXEEXT) eventfd$(EXEEXT) \ + execve$(EXEEXT) execve-v$(EXEEXT) execveat$(EXEEXT) \ + execveat-v$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ + fadvise64_64$(EXEEXT) fallocate$(EXEEXT) \ + fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) fchdir$(EXEEXT) \ + fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \ + fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \ + fcntl64$(EXEEXT) fdatasync$(EXEEXT) file_handle$(EXEEXT) \ + file_ioctl$(EXEEXT) filter-unavailable$(EXEEXT) \ + finit_module$(EXEEXT) flock$(EXEEXT) fork-f$(EXEEXT) \ + fstat$(EXEEXT) fstat64$(EXEEXT) fstatat64$(EXEEXT) \ + fstatfs$(EXEEXT) fstatfs64$(EXEEXT) fsync$(EXEEXT) \ + ftruncate$(EXEEXT) ftruncate64$(EXEEXT) futex$(EXEEXT) \ + futimesat$(EXEEXT) get_mempolicy$(EXEEXT) getcpu$(EXEEXT) \ + getcwd$(EXEEXT) getdents$(EXEEXT) getdents64$(EXEEXT) \ + getegid$(EXEEXT) getegid32$(EXEEXT) geteuid$(EXEEXT) \ + geteuid32$(EXEEXT) getgid$(EXEEXT) getgid32$(EXEEXT) \ + getgroups$(EXEEXT) getgroups32$(EXEEXT) getpeername$(EXEEXT) \ + getpgrp$(EXEEXT) getrandom$(EXEEXT) getresgid$(EXEEXT) \ + getresgid32$(EXEEXT) getresuid$(EXEEXT) getresuid32$(EXEEXT) \ + getrlimit$(EXEEXT) getrusage$(EXEEXT) getsid$(EXEEXT) \ + getsockname$(EXEEXT) getuid$(EXEEXT) getuid32$(EXEEXT) \ + getxxid$(EXEEXT) inet-cmsg$(EXEEXT) init_module$(EXEEXT) \ + inotify$(EXEEXT) inotify_init1$(EXEEXT) ioctl$(EXEEXT) \ + ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) ioctl_dm-v$(EXEEXT) \ + ioctl_evdev$(EXEEXT) ioctl_evdev-v$(EXEEXT) \ + ioctl_loop$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ + ioctl_loop-v$(EXEEXT) ioctl_mtd$(EXEEXT) ioctl_rtc$(EXEEXT) \ + ioctl_rtc-v$(EXEEXT) ioctl_scsi$(EXEEXT) \ + ioctl_sg_io_v3$(EXEEXT) ioctl_sg_io_v4$(EXEEXT) \ + ioctl_sock_gifconf$(EXEEXT) ioctl_uffdio$(EXEEXT) \ + ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) iopl$(EXEEXT) \ + ioprio$(EXEEXT) ip_mreq$(EXEEXT) ipc$(EXEEXT) ipc_msg$(EXEEXT) \ + ipc_msgbuf$(EXEEXT) ipc_sem$(EXEEXT) ipc_shm$(EXEEXT) \ + kcmp$(EXEEXT) kexec_file_load$(EXEEXT) kexec_load$(EXEEXT) \ + keyctl$(EXEEXT) kill$(EXEEXT) ksysent$(EXEEXT) lchown$(EXEEXT) \ + lchown32$(EXEEXT) link$(EXEEXT) linkat$(EXEEXT) \ + llseek$(EXEEXT) lookup_dcookie$(EXEEXT) lseek$(EXEEXT) \ + lstat$(EXEEXT) lstat64$(EXEEXT) mbind$(EXEEXT) \ + membarrier$(EXEEXT) memfd_create$(EXEEXT) \ + migrate_pages$(EXEEXT) mincore$(EXEEXT) mkdir$(EXEEXT) \ + mkdirat$(EXEEXT) mknod$(EXEEXT) mknodat$(EXEEXT) \ + mlock$(EXEEXT) mlock2$(EXEEXT) mlockall$(EXEEXT) mmap$(EXEEXT) \ + mmap64$(EXEEXT) mmsg$(EXEEXT) mmsg-silent$(EXEEXT) \ + mmsg_name$(EXEEXT) mmsg_name-v$(EXEEXT) mount$(EXEEXT) \ + move_pages$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ + mq_sendrecv-read$(EXEEXT) mq_sendrecv-write$(EXEEXT) \ + msg_control$(EXEEXT) msg_control-v$(EXEEXT) msg_name$(EXEEXT) \ + munlockall$(EXEEXT) nanosleep$(EXEEXT) \ + net-accept-connect$(EXEEXT) net-icmp_filter$(EXEEXT) \ + net-sockaddr$(EXEEXT) net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) \ + net-yy-netlink$(EXEEXT) net-yy-unix$(EXEEXT) \ + netlink_inet_diag$(EXEEXT) netlink_netlink_diag$(EXEEXT) \ + netlink_protocol$(EXEEXT) netlink_unix_diag$(EXEEXT) \ + newfstatat$(EXEEXT) nsyscalls$(EXEEXT) old_mmap$(EXEEXT) \ + oldfstat$(EXEEXT) oldlstat$(EXEEXT) oldselect$(EXEEXT) \ + oldstat$(EXEEXT) open$(EXEEXT) openat$(EXEEXT) pause$(EXEEXT) \ + pc$(EXEEXT) perf_event_open$(EXEEXT) \ + perf_event_open_nonverbose$(EXEEXT) \ + perf_event_open_unabbrev$(EXEEXT) personality$(EXEEXT) \ + pipe$(EXEEXT) pipe2$(EXEEXT) pkey_alloc$(EXEEXT) \ + pkey_free$(EXEEXT) pkey_mprotect$(EXEEXT) poll$(EXEEXT) \ + ppoll$(EXEEXT) prctl-arg2-intptr$(EXEEXT) \ + prctl-dumpable$(EXEEXT) prctl-name$(EXEEXT) \ + prctl-no-args$(EXEEXT) prctl-pdeathsig$(EXEEXT) \ + prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ + prctl-securebits$(EXEEXT) prctl-tid_address$(EXEEXT) \ + prctl-tsc$(EXEEXT) pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ + preadv-pwritev$(EXEEXT) preadv2-pwritev2$(EXEEXT) \ + print_maxfd$(EXEEXT) printstr$(EXEEXT) prlimit64$(EXEEXT) \ + process_vm_readv$(EXEEXT) process_vm_writev$(EXEEXT) \ + pselect6$(EXEEXT) ptrace$(EXEEXT) pwritev$(EXEEXT) \ + qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ + qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ + qual_signal$(EXEEXT) quotactl$(EXEEXT) quotactl-v$(EXEEXT) \ + quotactl-xfs$(EXEEXT) quotactl-xfs-v$(EXEEXT) \ + read-write$(EXEEXT) readahead$(EXEEXT) readdir$(EXEEXT) \ + readlink$(EXEEXT) readlinkat$(EXEEXT) readv$(EXEEXT) \ + reboot$(EXEEXT) recvfrom$(EXEEXT) recvmmsg-timeout$(EXEEXT) \ + recvmsg$(EXEEXT) redirect-fds$(EXEEXT) \ + remap_file_pages$(EXEEXT) rename$(EXEEXT) renameat$(EXEEXT) \ + renameat2$(EXEEXT) request_key$(EXEEXT) \ + restart_syscall$(EXEEXT) rmdir$(EXEEXT) rt_sigpending$(EXEEXT) \ + rt_sigprocmask$(EXEEXT) rt_sigqueueinfo$(EXEEXT) \ + rt_sigsuspend$(EXEEXT) rt_sigtimedwait$(EXEEXT) \ + rt_tgsigqueueinfo$(EXEEXT) sched_get_priority_mxx$(EXEEXT) \ + sched_rr_get_interval$(EXEEXT) sched_xetaffinity$(EXEEXT) \ + sched_xetattr$(EXEEXT) sched_xetparam$(EXEEXT) \ + sched_xetscheduler$(EXEEXT) sched_yield$(EXEEXT) \ + scm_rights$(EXEEXT) seccomp-filter$(EXEEXT) \ + seccomp-filter-v$(EXEEXT) seccomp-strict$(EXEEXT) \ + select$(EXEEXT) semop$(EXEEXT) sendfile$(EXEEXT) \ + sendfile64$(EXEEXT) set_mempolicy$(EXEEXT) \ + set_ptracer_any$(EXEEXT) setdomainname$(EXEEXT) \ + setfsgid$(EXEEXT) setfsgid32$(EXEEXT) setfsuid$(EXEEXT) \ + setfsuid32$(EXEEXT) setgid$(EXEEXT) setgid32$(EXEEXT) \ + setgroups$(EXEEXT) setgroups32$(EXEEXT) sethostname$(EXEEXT) \ + setns$(EXEEXT) setregid$(EXEEXT) setregid32$(EXEEXT) \ + setresgid$(EXEEXT) setresgid32$(EXEEXT) setresuid$(EXEEXT) \ + setresuid32$(EXEEXT) setreuid$(EXEEXT) setreuid32$(EXEEXT) \ + setrlimit$(EXEEXT) setuid$(EXEEXT) setuid32$(EXEEXT) \ + shmxt$(EXEEXT) shutdown$(EXEEXT) sigaction$(EXEEXT) \ + sigaltstack$(EXEEXT) siginfo$(EXEEXT) signal_receive$(EXEEXT) \ + signalfd4$(EXEEXT) sigreturn$(EXEEXT) sleep$(EXEEXT) \ + socketcall$(EXEEXT) splice$(EXEEXT) stack-fcall$(EXEEXT) \ + stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ + statfs64$(EXEEXT) swap$(EXEEXT) symlink$(EXEEXT) \ + symlinkat$(EXEEXT) sync$(EXEEXT) sync_file_range$(EXEEXT) \ + sync_file_range2$(EXEEXT) sysinfo$(EXEEXT) syslog$(EXEEXT) \ + tee$(EXEEXT) threads-execve$(EXEEXT) time$(EXEEXT) \ + timer_create$(EXEEXT) timer_xettime$(EXEEXT) \ + timerfd_xettime$(EXEEXT) times$(EXEEXT) times-fail$(EXEEXT) \ + truncate$(EXEEXT) truncate64$(EXEEXT) ugetrlimit$(EXEEXT) \ + uio$(EXEEXT) umask$(EXEEXT) umount$(EXEEXT) umount2$(EXEEXT) \ + umoven-illptr$(EXEEXT) umovestr$(EXEEXT) \ + umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) umovestr3$(EXEEXT) \ + uname$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) unlink$(EXEEXT) \ + unlinkat$(EXEEXT) unshare$(EXEEXT) userfaultfd$(EXEEXT) \ + ustat$(EXEEXT) utime$(EXEEXT) utimensat$(EXEEXT) \ + utimes$(EXEEXT) vfork-f$(EXEEXT) vhangup$(EXEEXT) \ + vmsplice$(EXEEXT) wait4$(EXEEXT) wait4-v$(EXEEXT) \ + waitid$(EXEEXT) waitid-v$(EXEEXT) waitpid$(EXEEXT) \ + xattr$(EXEEXT) xattr-strings$(EXEEXT) xet_robust_list$(EXEEXT) \ + xetitimer$(EXEEXT) xetpgid$(EXEEXT) xetpriority$(EXEEXT) \ + xettimeofday$(EXEEXT) +TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_1) +DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver subdir = tests -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/includedir.m4 \ - $(top_srcdir)/m4/long_long.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/statfs.m4 $(top_srcdir)/m4/warnings.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_valgrind_check.m4 \ + $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_warn_cflags.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libtests_a_AR = $(AR) $(ARFLAGS) +libtests_a_LIBADD = +am_libtests_a_OBJECTS = libtests_a-errno2name.$(OBJEXT) \ + libtests_a-error_msg.$(OBJEXT) \ + libtests_a-fill_memory.$(OBJEXT) \ + libtests_a-get_page_size.$(OBJEXT) \ + libtests_a-hexdump_strdup.$(OBJEXT) \ + libtests_a-hexquote_strndup.$(OBJEXT) \ + libtests_a-inode_of_sockfd.$(OBJEXT) \ + libtests_a-libmmsg.$(OBJEXT) \ + libtests_a-libsocketcall.$(OBJEXT) \ + libtests_a-overflowuid.$(OBJEXT) \ + libtests_a-pipe_maxfd.$(OBJEXT) \ + libtests_a-print_quoted_string.$(OBJEXT) \ + libtests_a-printflags.$(OBJEXT) libtests_a-printxval.$(OBJEXT) \ + libtests_a-signal2name.$(OBJEXT) libtests_a-sprintrc.$(OBJEXT) \ + libtests_a-tail_alloc.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) +libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) +_newselect_SOURCES = _newselect.c +_newselect_OBJECTS = _newselect.$(OBJEXT) +_newselect_LDADD = $(LDADD) +_newselect_DEPENDENCIES = libtests.a +accept_SOURCES = accept.c +accept_OBJECTS = accept.$(OBJEXT) +accept_LDADD = $(LDADD) +accept_DEPENDENCIES = libtests.a +accept4_SOURCES = accept4.c +accept4_OBJECTS = accept4.$(OBJEXT) +accept4_LDADD = $(LDADD) +accept4_DEPENDENCIES = libtests.a +access_SOURCES = access.c +access_OBJECTS = access.$(OBJEXT) +access_LDADD = $(LDADD) +access_DEPENDENCIES = libtests.a +acct_SOURCES = acct.c +acct_OBJECTS = acct.$(OBJEXT) +acct_LDADD = $(LDADD) +acct_DEPENDENCIES = libtests.a +add_key_SOURCES = add_key.c +add_key_OBJECTS = add_key.$(OBJEXT) +add_key_LDADD = $(LDADD) +add_key_DEPENDENCIES = libtests.a +adjtimex_SOURCES = adjtimex.c +adjtimex_OBJECTS = adjtimex.$(OBJEXT) +adjtimex_LDADD = $(LDADD) +adjtimex_DEPENDENCIES = libtests.a +aio_SOURCES = aio.c +aio_OBJECTS = aio.$(OBJEXT) +aio_LDADD = $(LDADD) +aio_DEPENDENCIES = libtests.a +alarm_SOURCES = alarm.c +alarm_OBJECTS = alarm.$(OBJEXT) +alarm_LDADD = $(LDADD) +alarm_DEPENDENCIES = libtests.a +answer_SOURCES = answer.c +answer_OBJECTS = answer.$(OBJEXT) +answer_LDADD = $(LDADD) +answer_DEPENDENCIES = libtests.a +attach_f_p_SOURCES = attach-f-p.c +attach_f_p_OBJECTS = attach-f-p.$(OBJEXT) +attach_f_p_DEPENDENCIES = $(LDADD) +attach_f_p_cmd_SOURCES = attach-f-p-cmd.c +attach_f_p_cmd_OBJECTS = attach-f-p-cmd.$(OBJEXT) +attach_f_p_cmd_LDADD = $(LDADD) +attach_f_p_cmd_DEPENDENCIES = libtests.a +attach_p_cmd_cmd_SOURCES = attach-p-cmd-cmd.c +attach_p_cmd_cmd_OBJECTS = attach-p-cmd-cmd.$(OBJEXT) +attach_p_cmd_cmd_LDADD = $(LDADD) +attach_p_cmd_cmd_DEPENDENCIES = libtests.a +attach_p_cmd_p_SOURCES = attach-p-cmd-p.c +attach_p_cmd_p_OBJECTS = attach-p-cmd-p.$(OBJEXT) +attach_p_cmd_p_LDADD = $(LDADD) +attach_p_cmd_p_DEPENDENCIES = libtests.a +bpf_SOURCES = bpf.c +bpf_OBJECTS = bpf.$(OBJEXT) +bpf_LDADD = $(LDADD) +bpf_DEPENDENCIES = libtests.a +brk_SOURCES = brk.c +brk_OBJECTS = brk.$(OBJEXT) +brk_LDADD = $(LDADD) +brk_DEPENDENCIES = libtests.a +btrfs_SOURCES = btrfs.c +btrfs_OBJECTS = btrfs.$(OBJEXT) +btrfs_LDADD = $(LDADD) +btrfs_DEPENDENCIES = libtests.a +caps_SOURCES = caps.c +caps_OBJECTS = caps.$(OBJEXT) +caps_LDADD = $(LDADD) +caps_DEPENDENCIES = libtests.a +caps_abbrev_SOURCES = caps-abbrev.c +caps_abbrev_OBJECTS = caps-abbrev.$(OBJEXT) +caps_abbrev_LDADD = $(LDADD) +caps_abbrev_DEPENDENCIES = libtests.a +chmod_SOURCES = chmod.c +chmod_OBJECTS = chmod.$(OBJEXT) +chmod_LDADD = $(LDADD) +chmod_DEPENDENCIES = libtests.a +chown_SOURCES = chown.c +chown_OBJECTS = chown.$(OBJEXT) +chown_LDADD = $(LDADD) +chown_DEPENDENCIES = libtests.a +chown32_SOURCES = chown32.c +chown32_OBJECTS = chown32.$(OBJEXT) +chown32_LDADD = $(LDADD) +chown32_DEPENDENCIES = libtests.a +chroot_SOURCES = chroot.c +chroot_OBJECTS = chroot.$(OBJEXT) +chroot_LDADD = $(LDADD) +chroot_DEPENDENCIES = libtests.a +clock_adjtime_SOURCES = clock_adjtime.c +clock_adjtime_OBJECTS = clock_adjtime.$(OBJEXT) +clock_adjtime_LDADD = $(LDADD) +clock_adjtime_DEPENDENCIES = libtests.a +clock_nanosleep_SOURCES = clock_nanosleep.c +clock_nanosleep_OBJECTS = clock_nanosleep.$(OBJEXT) +clock_nanosleep_LDADD = $(LDADD) +clock_nanosleep_DEPENDENCIES = libtests.a +clock_xettime_SOURCES = clock_xettime.c +clock_xettime_OBJECTS = clock_xettime.$(OBJEXT) +clock_xettime_DEPENDENCIES = $(LDADD) +copy_file_range_SOURCES = copy_file_range.c +copy_file_range_OBJECTS = copy_file_range.$(OBJEXT) +copy_file_range_LDADD = $(LDADD) +copy_file_range_DEPENDENCIES = libtests.a +count_f_SOURCES = count-f.c +count_f_OBJECTS = count-f.$(OBJEXT) +count_f_DEPENDENCIES = $(LDADD) +creat_SOURCES = creat.c +creat_OBJECTS = creat.$(OBJEXT) +creat_LDADD = $(LDADD) +creat_DEPENDENCIES = libtests.a +delete_module_SOURCES = delete_module.c +delete_module_OBJECTS = delete_module.$(OBJEXT) +delete_module_LDADD = $(LDADD) +delete_module_DEPENDENCIES = libtests.a +dup_SOURCES = dup.c +dup_OBJECTS = dup.$(OBJEXT) +dup_LDADD = $(LDADD) +dup_DEPENDENCIES = libtests.a +dup2_SOURCES = dup2.c +dup2_OBJECTS = dup2.$(OBJEXT) +dup2_LDADD = $(LDADD) +dup2_DEPENDENCIES = libtests.a +dup3_SOURCES = dup3.c +dup3_OBJECTS = dup3.$(OBJEXT) +dup3_LDADD = $(LDADD) +dup3_DEPENDENCIES = libtests.a +epoll_create_SOURCES = epoll_create.c +epoll_create_OBJECTS = epoll_create.$(OBJEXT) +epoll_create_LDADD = $(LDADD) +epoll_create_DEPENDENCIES = libtests.a +epoll_create1_SOURCES = epoll_create1.c +epoll_create1_OBJECTS = epoll_create1.$(OBJEXT) +epoll_create1_LDADD = $(LDADD) +epoll_create1_DEPENDENCIES = libtests.a +epoll_ctl_SOURCES = epoll_ctl.c +epoll_ctl_OBJECTS = epoll_ctl.$(OBJEXT) +epoll_ctl_LDADD = $(LDADD) +epoll_ctl_DEPENDENCIES = libtests.a +epoll_pwait_SOURCES = epoll_pwait.c +epoll_pwait_OBJECTS = epoll_pwait.$(OBJEXT) +epoll_pwait_LDADD = $(LDADD) +epoll_pwait_DEPENDENCIES = libtests.a +epoll_wait_SOURCES = epoll_wait.c +epoll_wait_OBJECTS = epoll_wait.$(OBJEXT) +epoll_wait_LDADD = $(LDADD) +epoll_wait_DEPENDENCIES = libtests.a +erestartsys_SOURCES = erestartsys.c +erestartsys_OBJECTS = erestartsys.$(OBJEXT) +erestartsys_LDADD = $(LDADD) +erestartsys_DEPENDENCIES = libtests.a +eventfd_SOURCES = eventfd.c +eventfd_OBJECTS = eventfd.$(OBJEXT) +eventfd_LDADD = $(LDADD) +eventfd_DEPENDENCIES = libtests.a +execve_SOURCES = execve.c +execve_OBJECTS = execve.$(OBJEXT) +execve_LDADD = $(LDADD) +execve_DEPENDENCIES = libtests.a +execve_v_SOURCES = execve-v.c +execve_v_OBJECTS = execve-v.$(OBJEXT) +execve_v_LDADD = $(LDADD) +execve_v_DEPENDENCIES = libtests.a +execveat_SOURCES = execveat.c +execveat_OBJECTS = execveat.$(OBJEXT) +execveat_LDADD = $(LDADD) +execveat_DEPENDENCIES = libtests.a +execveat_v_SOURCES = execveat-v.c +execveat_v_OBJECTS = execveat-v.$(OBJEXT) +execveat_v_LDADD = $(LDADD) +execveat_v_DEPENDENCIES = libtests.a +faccessat_SOURCES = faccessat.c +faccessat_OBJECTS = faccessat.$(OBJEXT) +faccessat_LDADD = $(LDADD) +faccessat_DEPENDENCIES = libtests.a +fadvise64_SOURCES = fadvise64.c +fadvise64_OBJECTS = fadvise64.$(OBJEXT) +fadvise64_LDADD = $(LDADD) +fadvise64_DEPENDENCIES = libtests.a +fadvise64_64_SOURCES = fadvise64_64.c +fadvise64_64_OBJECTS = fadvise64_64.$(OBJEXT) +fadvise64_64_LDADD = $(LDADD) +fadvise64_64_DEPENDENCIES = libtests.a +fallocate_SOURCES = fallocate.c +fallocate_OBJECTS = fallocate.$(OBJEXT) +fallocate_LDADD = $(LDADD) +fallocate_DEPENDENCIES = libtests.a +fanotify_init_SOURCES = fanotify_init.c +fanotify_init_OBJECTS = fanotify_init.$(OBJEXT) +fanotify_init_LDADD = $(LDADD) +fanotify_init_DEPENDENCIES = libtests.a +fanotify_mark_SOURCES = fanotify_mark.c +fanotify_mark_OBJECTS = fanotify_mark.$(OBJEXT) +fanotify_mark_LDADD = $(LDADD) +fanotify_mark_DEPENDENCIES = libtests.a +fchdir_SOURCES = fchdir.c +fchdir_OBJECTS = fchdir.$(OBJEXT) +fchdir_LDADD = $(LDADD) +fchdir_DEPENDENCIES = libtests.a +fchmod_SOURCES = fchmod.c +fchmod_OBJECTS = fchmod.$(OBJEXT) +fchmod_LDADD = $(LDADD) +fchmod_DEPENDENCIES = libtests.a +fchmodat_SOURCES = fchmodat.c +fchmodat_OBJECTS = fchmodat.$(OBJEXT) +fchmodat_LDADD = $(LDADD) +fchmodat_DEPENDENCIES = libtests.a +fchown_SOURCES = fchown.c +fchown_OBJECTS = fchown.$(OBJEXT) +fchown_LDADD = $(LDADD) +fchown_DEPENDENCIES = libtests.a +fchown32_SOURCES = fchown32.c +fchown32_OBJECTS = fchown32.$(OBJEXT) +fchown32_LDADD = $(LDADD) +fchown32_DEPENDENCIES = libtests.a +fchownat_SOURCES = fchownat.c +fchownat_OBJECTS = fchownat.$(OBJEXT) +fchownat_LDADD = $(LDADD) +fchownat_DEPENDENCIES = libtests.a +fcntl_SOURCES = fcntl.c +fcntl_OBJECTS = fcntl.$(OBJEXT) +fcntl_LDADD = $(LDADD) +fcntl_DEPENDENCIES = libtests.a +fcntl64_SOURCES = fcntl64.c +fcntl64_OBJECTS = fcntl64.$(OBJEXT) +fcntl64_LDADD = $(LDADD) +fcntl64_DEPENDENCIES = libtests.a +fdatasync_SOURCES = fdatasync.c +fdatasync_OBJECTS = fdatasync.$(OBJEXT) +fdatasync_LDADD = $(LDADD) +fdatasync_DEPENDENCIES = libtests.a +file_handle_SOURCES = file_handle.c +file_handle_OBJECTS = file_handle.$(OBJEXT) +file_handle_LDADD = $(LDADD) +file_handle_DEPENDENCIES = libtests.a +file_ioctl_SOURCES = file_ioctl.c +file_ioctl_OBJECTS = file_ioctl.$(OBJEXT) +file_ioctl_LDADD = $(LDADD) +file_ioctl_DEPENDENCIES = libtests.a +filter_unavailable_SOURCES = filter-unavailable.c +filter_unavailable_OBJECTS = filter-unavailable.$(OBJEXT) +filter_unavailable_DEPENDENCIES = $(LDADD) +finit_module_SOURCES = finit_module.c +finit_module_OBJECTS = finit_module.$(OBJEXT) +finit_module_LDADD = $(LDADD) +finit_module_DEPENDENCIES = libtests.a +flock_SOURCES = flock.c +flock_OBJECTS = flock.$(OBJEXT) +flock_LDADD = $(LDADD) +flock_DEPENDENCIES = libtests.a +fork_f_SOURCES = fork-f.c +fork_f_OBJECTS = fork-f.$(OBJEXT) +fork_f_LDADD = $(LDADD) +fork_f_DEPENDENCIES = libtests.a +fstat_SOURCES = fstat.c +fstat_OBJECTS = fstat.$(OBJEXT) +fstat_LDADD = $(LDADD) +fstat_DEPENDENCIES = libtests.a +fstat64_SOURCES = fstat64.c +fstat64_OBJECTS = fstat64-fstat64.$(OBJEXT) +fstat64_LDADD = $(LDADD) +fstat64_DEPENDENCIES = libtests.a +fstatat64_SOURCES = fstatat64.c +fstatat64_OBJECTS = fstatat64-fstatat64.$(OBJEXT) +fstatat64_LDADD = $(LDADD) +fstatat64_DEPENDENCIES = libtests.a +fstatfs_SOURCES = fstatfs.c +fstatfs_OBJECTS = fstatfs.$(OBJEXT) +fstatfs_LDADD = $(LDADD) +fstatfs_DEPENDENCIES = libtests.a +fstatfs64_SOURCES = fstatfs64.c +fstatfs64_OBJECTS = fstatfs64.$(OBJEXT) +fstatfs64_LDADD = $(LDADD) +fstatfs64_DEPENDENCIES = libtests.a +fsync_SOURCES = fsync.c +fsync_OBJECTS = fsync.$(OBJEXT) +fsync_LDADD = $(LDADD) +fsync_DEPENDENCIES = libtests.a +ftruncate_SOURCES = ftruncate.c +ftruncate_OBJECTS = ftruncate.$(OBJEXT) +ftruncate_LDADD = $(LDADD) +ftruncate_DEPENDENCIES = libtests.a +ftruncate64_SOURCES = ftruncate64.c +ftruncate64_OBJECTS = ftruncate64-ftruncate64.$(OBJEXT) +ftruncate64_LDADD = $(LDADD) +ftruncate64_DEPENDENCIES = libtests.a +futex_SOURCES = futex.c +futex_OBJECTS = futex.$(OBJEXT) +futex_LDADD = $(LDADD) +futex_DEPENDENCIES = libtests.a +futimesat_SOURCES = futimesat.c +futimesat_OBJECTS = futimesat.$(OBJEXT) +futimesat_LDADD = $(LDADD) +futimesat_DEPENDENCIES = libtests.a +get_mempolicy_SOURCES = get_mempolicy.c +get_mempolicy_OBJECTS = get_mempolicy.$(OBJEXT) +get_mempolicy_LDADD = $(LDADD) +get_mempolicy_DEPENDENCIES = libtests.a +getcpu_SOURCES = getcpu.c +getcpu_OBJECTS = getcpu.$(OBJEXT) +getcpu_LDADD = $(LDADD) +getcpu_DEPENDENCIES = libtests.a +getcwd_SOURCES = getcwd.c +getcwd_OBJECTS = getcwd.$(OBJEXT) +getcwd_LDADD = $(LDADD) +getcwd_DEPENDENCIES = libtests.a +getdents_SOURCES = getdents.c +getdents_OBJECTS = getdents.$(OBJEXT) +getdents_LDADD = $(LDADD) +getdents_DEPENDENCIES = libtests.a +getdents64_SOURCES = getdents64.c +getdents64_OBJECTS = getdents64.$(OBJEXT) +getdents64_LDADD = $(LDADD) +getdents64_DEPENDENCIES = libtests.a +getegid_SOURCES = getegid.c +getegid_OBJECTS = getegid.$(OBJEXT) +getegid_LDADD = $(LDADD) +getegid_DEPENDENCIES = libtests.a +getegid32_SOURCES = getegid32.c +getegid32_OBJECTS = getegid32.$(OBJEXT) +getegid32_LDADD = $(LDADD) +getegid32_DEPENDENCIES = libtests.a +geteuid_SOURCES = geteuid.c +geteuid_OBJECTS = geteuid.$(OBJEXT) +geteuid_LDADD = $(LDADD) +geteuid_DEPENDENCIES = libtests.a +geteuid32_SOURCES = geteuid32.c +geteuid32_OBJECTS = geteuid32.$(OBJEXT) +geteuid32_LDADD = $(LDADD) +geteuid32_DEPENDENCIES = libtests.a +getgid_SOURCES = getgid.c +getgid_OBJECTS = getgid.$(OBJEXT) +getgid_LDADD = $(LDADD) +getgid_DEPENDENCIES = libtests.a +getgid32_SOURCES = getgid32.c +getgid32_OBJECTS = getgid32.$(OBJEXT) +getgid32_LDADD = $(LDADD) +getgid32_DEPENDENCIES = libtests.a +getgroups_SOURCES = getgroups.c +getgroups_OBJECTS = getgroups.$(OBJEXT) +getgroups_LDADD = $(LDADD) +getgroups_DEPENDENCIES = libtests.a +getgroups32_SOURCES = getgroups32.c +getgroups32_OBJECTS = getgroups32.$(OBJEXT) +getgroups32_LDADD = $(LDADD) +getgroups32_DEPENDENCIES = libtests.a +getpeername_SOURCES = getpeername.c +getpeername_OBJECTS = getpeername.$(OBJEXT) +getpeername_LDADD = $(LDADD) +getpeername_DEPENDENCIES = libtests.a +getpgrp_SOURCES = getpgrp.c +getpgrp_OBJECTS = getpgrp.$(OBJEXT) +getpgrp_LDADD = $(LDADD) +getpgrp_DEPENDENCIES = libtests.a +getrandom_SOURCES = getrandom.c +getrandom_OBJECTS = getrandom.$(OBJEXT) +getrandom_LDADD = $(LDADD) +getrandom_DEPENDENCIES = libtests.a +getresgid_SOURCES = getresgid.c +getresgid_OBJECTS = getresgid.$(OBJEXT) +getresgid_LDADD = $(LDADD) +getresgid_DEPENDENCIES = libtests.a +getresgid32_SOURCES = getresgid32.c +getresgid32_OBJECTS = getresgid32.$(OBJEXT) +getresgid32_LDADD = $(LDADD) +getresgid32_DEPENDENCIES = libtests.a +getresuid_SOURCES = getresuid.c +getresuid_OBJECTS = getresuid.$(OBJEXT) +getresuid_LDADD = $(LDADD) +getresuid_DEPENDENCIES = libtests.a +getresuid32_SOURCES = getresuid32.c +getresuid32_OBJECTS = getresuid32.$(OBJEXT) +getresuid32_LDADD = $(LDADD) +getresuid32_DEPENDENCIES = libtests.a +getrlimit_SOURCES = getrlimit.c +getrlimit_OBJECTS = getrlimit.$(OBJEXT) +getrlimit_LDADD = $(LDADD) +getrlimit_DEPENDENCIES = libtests.a +getrusage_SOURCES = getrusage.c +getrusage_OBJECTS = getrusage.$(OBJEXT) +getrusage_LDADD = $(LDADD) +getrusage_DEPENDENCIES = libtests.a +getsid_SOURCES = getsid.c +getsid_OBJECTS = getsid.$(OBJEXT) +getsid_LDADD = $(LDADD) +getsid_DEPENDENCIES = libtests.a +getsockname_SOURCES = getsockname.c +getsockname_OBJECTS = getsockname.$(OBJEXT) +getsockname_LDADD = $(LDADD) +getsockname_DEPENDENCIES = libtests.a +getuid_SOURCES = getuid.c +getuid_OBJECTS = getuid.$(OBJEXT) +getuid_LDADD = $(LDADD) +getuid_DEPENDENCIES = libtests.a +getuid32_SOURCES = getuid32.c +getuid32_OBJECTS = getuid32.$(OBJEXT) +getuid32_LDADD = $(LDADD) +getuid32_DEPENDENCIES = libtests.a +getxxid_SOURCES = getxxid.c +getxxid_OBJECTS = getxxid.$(OBJEXT) +getxxid_LDADD = $(LDADD) +getxxid_DEPENDENCIES = libtests.a +inet_cmsg_SOURCES = inet-cmsg.c +inet_cmsg_OBJECTS = inet-cmsg.$(OBJEXT) +inet_cmsg_LDADD = $(LDADD) +inet_cmsg_DEPENDENCIES = libtests.a +init_module_SOURCES = init_module.c +init_module_OBJECTS = init_module.$(OBJEXT) +init_module_LDADD = $(LDADD) +init_module_DEPENDENCIES = libtests.a +inotify_SOURCES = inotify.c +inotify_OBJECTS = inotify.$(OBJEXT) +inotify_LDADD = $(LDADD) +inotify_DEPENDENCIES = libtests.a +inotify_init1_SOURCES = inotify_init1.c +inotify_init1_OBJECTS = inotify_init1.$(OBJEXT) +inotify_init1_LDADD = $(LDADD) +inotify_init1_DEPENDENCIES = libtests.a +ioctl_SOURCES = ioctl.c +ioctl_OBJECTS = ioctl.$(OBJEXT) +ioctl_LDADD = $(LDADD) +ioctl_DEPENDENCIES = libtests.a +ioctl_block_SOURCES = ioctl_block.c +ioctl_block_OBJECTS = ioctl_block.$(OBJEXT) +ioctl_block_LDADD = $(LDADD) +ioctl_block_DEPENDENCIES = libtests.a +ioctl_dm_SOURCES = ioctl_dm.c +ioctl_dm_OBJECTS = ioctl_dm.$(OBJEXT) +ioctl_dm_LDADD = $(LDADD) +ioctl_dm_DEPENDENCIES = libtests.a +ioctl_dm_v_SOURCES = ioctl_dm-v.c +ioctl_dm_v_OBJECTS = ioctl_dm-v.$(OBJEXT) +ioctl_dm_v_LDADD = $(LDADD) +ioctl_dm_v_DEPENDENCIES = libtests.a +ioctl_evdev_SOURCES = ioctl_evdev.c +ioctl_evdev_OBJECTS = ioctl_evdev.$(OBJEXT) +ioctl_evdev_LDADD = $(LDADD) +ioctl_evdev_DEPENDENCIES = libtests.a +ioctl_evdev_v_SOURCES = ioctl_evdev-v.c +ioctl_evdev_v_OBJECTS = ioctl_evdev-v.$(OBJEXT) +ioctl_evdev_v_LDADD = $(LDADD) +ioctl_evdev_v_DEPENDENCIES = libtests.a +ioctl_loop_SOURCES = ioctl_loop.c +ioctl_loop_OBJECTS = ioctl_loop.$(OBJEXT) +ioctl_loop_LDADD = $(LDADD) +ioctl_loop_DEPENDENCIES = libtests.a +ioctl_loop_nv_SOURCES = ioctl_loop-nv.c +ioctl_loop_nv_OBJECTS = ioctl_loop-nv.$(OBJEXT) +ioctl_loop_nv_LDADD = $(LDADD) +ioctl_loop_nv_DEPENDENCIES = libtests.a +ioctl_loop_v_SOURCES = ioctl_loop-v.c +ioctl_loop_v_OBJECTS = ioctl_loop-v.$(OBJEXT) +ioctl_loop_v_LDADD = $(LDADD) +ioctl_loop_v_DEPENDENCIES = libtests.a +ioctl_mtd_SOURCES = ioctl_mtd.c +ioctl_mtd_OBJECTS = ioctl_mtd.$(OBJEXT) +ioctl_mtd_LDADD = $(LDADD) +ioctl_mtd_DEPENDENCIES = libtests.a +ioctl_rtc_SOURCES = ioctl_rtc.c +ioctl_rtc_OBJECTS = ioctl_rtc.$(OBJEXT) +ioctl_rtc_LDADD = $(LDADD) +ioctl_rtc_DEPENDENCIES = libtests.a +ioctl_rtc_v_SOURCES = ioctl_rtc-v.c +ioctl_rtc_v_OBJECTS = ioctl_rtc-v.$(OBJEXT) +ioctl_rtc_v_LDADD = $(LDADD) +ioctl_rtc_v_DEPENDENCIES = libtests.a +ioctl_scsi_SOURCES = ioctl_scsi.c +ioctl_scsi_OBJECTS = ioctl_scsi.$(OBJEXT) +ioctl_scsi_LDADD = $(LDADD) +ioctl_scsi_DEPENDENCIES = libtests.a +ioctl_sg_io_v3_SOURCES = ioctl_sg_io_v3.c +ioctl_sg_io_v3_OBJECTS = ioctl_sg_io_v3.$(OBJEXT) +ioctl_sg_io_v3_LDADD = $(LDADD) +ioctl_sg_io_v3_DEPENDENCIES = libtests.a +ioctl_sg_io_v4_SOURCES = ioctl_sg_io_v4.c +ioctl_sg_io_v4_OBJECTS = ioctl_sg_io_v4.$(OBJEXT) +ioctl_sg_io_v4_LDADD = $(LDADD) +ioctl_sg_io_v4_DEPENDENCIES = libtests.a +ioctl_sock_gifconf_SOURCES = ioctl_sock_gifconf.c +ioctl_sock_gifconf_OBJECTS = ioctl_sock_gifconf.$(OBJEXT) +ioctl_sock_gifconf_LDADD = $(LDADD) +ioctl_sock_gifconf_DEPENDENCIES = libtests.a +ioctl_uffdio_SOURCES = ioctl_uffdio.c +ioctl_uffdio_OBJECTS = ioctl_uffdio.$(OBJEXT) +ioctl_uffdio_LDADD = $(LDADD) +ioctl_uffdio_DEPENDENCIES = libtests.a +ioctl_v4l2_SOURCES = ioctl_v4l2.c +ioctl_v4l2_OBJECTS = ioctl_v4l2.$(OBJEXT) +ioctl_v4l2_LDADD = $(LDADD) +ioctl_v4l2_DEPENDENCIES = libtests.a +ioperm_SOURCES = ioperm.c +ioperm_OBJECTS = ioperm.$(OBJEXT) +ioperm_LDADD = $(LDADD) +ioperm_DEPENDENCIES = libtests.a +iopl_SOURCES = iopl.c +iopl_OBJECTS = iopl.$(OBJEXT) +iopl_LDADD = $(LDADD) +iopl_DEPENDENCIES = libtests.a +ioprio_SOURCES = ioprio.c +ioprio_OBJECTS = ioprio.$(OBJEXT) +ioprio_LDADD = $(LDADD) +ioprio_DEPENDENCIES = libtests.a +ip_mreq_SOURCES = ip_mreq.c +ip_mreq_OBJECTS = ip_mreq.$(OBJEXT) +ip_mreq_LDADD = $(LDADD) +ip_mreq_DEPENDENCIES = libtests.a +ipc_SOURCES = ipc.c +ipc_OBJECTS = ipc.$(OBJEXT) +ipc_LDADD = $(LDADD) +ipc_DEPENDENCIES = libtests.a +ipc_msg_SOURCES = ipc_msg.c +ipc_msg_OBJECTS = ipc_msg.$(OBJEXT) +ipc_msg_LDADD = $(LDADD) +ipc_msg_DEPENDENCIES = libtests.a +ipc_msgbuf_SOURCES = ipc_msgbuf.c +ipc_msgbuf_OBJECTS = ipc_msgbuf.$(OBJEXT) +ipc_msgbuf_LDADD = $(LDADD) +ipc_msgbuf_DEPENDENCIES = libtests.a +ipc_sem_SOURCES = ipc_sem.c +ipc_sem_OBJECTS = ipc_sem.$(OBJEXT) +ipc_sem_LDADD = $(LDADD) +ipc_sem_DEPENDENCIES = libtests.a +ipc_shm_SOURCES = ipc_shm.c +ipc_shm_OBJECTS = ipc_shm.$(OBJEXT) +ipc_shm_LDADD = $(LDADD) +ipc_shm_DEPENDENCIES = libtests.a +kcmp_SOURCES = kcmp.c +kcmp_OBJECTS = kcmp.$(OBJEXT) +kcmp_LDADD = $(LDADD) +kcmp_DEPENDENCIES = libtests.a +kexec_file_load_SOURCES = kexec_file_load.c +kexec_file_load_OBJECTS = kexec_file_load.$(OBJEXT) +kexec_file_load_LDADD = $(LDADD) +kexec_file_load_DEPENDENCIES = libtests.a +kexec_load_SOURCES = kexec_load.c +kexec_load_OBJECTS = kexec_load.$(OBJEXT) +kexec_load_LDADD = $(LDADD) +kexec_load_DEPENDENCIES = libtests.a +keyctl_SOURCES = keyctl.c +keyctl_OBJECTS = keyctl.$(OBJEXT) +keyctl_LDADD = $(LDADD) +keyctl_DEPENDENCIES = libtests.a +kill_SOURCES = kill.c +kill_OBJECTS = kill.$(OBJEXT) +kill_LDADD = $(LDADD) +kill_DEPENDENCIES = libtests.a +ksysent_SOURCES = ksysent.c +ksysent_OBJECTS = ksysent.$(OBJEXT) +ksysent_LDADD = $(LDADD) +ksysent_DEPENDENCIES = libtests.a +lchown_SOURCES = lchown.c +lchown_OBJECTS = lchown.$(OBJEXT) +lchown_LDADD = $(LDADD) +lchown_DEPENDENCIES = libtests.a +lchown32_SOURCES = lchown32.c +lchown32_OBJECTS = lchown32.$(OBJEXT) +lchown32_LDADD = $(LDADD) +lchown32_DEPENDENCIES = libtests.a +link_SOURCES = link.c +link_OBJECTS = link.$(OBJEXT) +link_LDADD = $(LDADD) +link_DEPENDENCIES = libtests.a +linkat_SOURCES = linkat.c +linkat_OBJECTS = linkat.$(OBJEXT) +linkat_LDADD = $(LDADD) +linkat_DEPENDENCIES = libtests.a +llseek_SOURCES = llseek.c +llseek_OBJECTS = llseek.$(OBJEXT) +llseek_LDADD = $(LDADD) +llseek_DEPENDENCIES = libtests.a +lookup_dcookie_SOURCES = lookup_dcookie.c +lookup_dcookie_OBJECTS = lookup_dcookie.$(OBJEXT) +lookup_dcookie_LDADD = $(LDADD) +lookup_dcookie_DEPENDENCIES = libtests.a +lseek_SOURCES = lseek.c +lseek_OBJECTS = lseek.$(OBJEXT) +lseek_LDADD = $(LDADD) +lseek_DEPENDENCIES = libtests.a +lstat_SOURCES = lstat.c +lstat_OBJECTS = lstat.$(OBJEXT) +lstat_LDADD = $(LDADD) +lstat_DEPENDENCIES = libtests.a +lstat64_SOURCES = lstat64.c +lstat64_OBJECTS = lstat64-lstat64.$(OBJEXT) +lstat64_LDADD = $(LDADD) +lstat64_DEPENDENCIES = libtests.a +mbind_SOURCES = mbind.c +mbind_OBJECTS = mbind.$(OBJEXT) +mbind_LDADD = $(LDADD) +mbind_DEPENDENCIES = libtests.a +membarrier_SOURCES = membarrier.c +membarrier_OBJECTS = membarrier.$(OBJEXT) +membarrier_LDADD = $(LDADD) +membarrier_DEPENDENCIES = libtests.a +memfd_create_SOURCES = memfd_create.c +memfd_create_OBJECTS = memfd_create.$(OBJEXT) +memfd_create_LDADD = $(LDADD) +memfd_create_DEPENDENCIES = libtests.a +migrate_pages_SOURCES = migrate_pages.c +migrate_pages_OBJECTS = migrate_pages.$(OBJEXT) +migrate_pages_LDADD = $(LDADD) +migrate_pages_DEPENDENCIES = libtests.a +mincore_SOURCES = mincore.c +mincore_OBJECTS = mincore.$(OBJEXT) +mincore_LDADD = $(LDADD) +mincore_DEPENDENCIES = libtests.a +mkdir_SOURCES = mkdir.c +mkdir_OBJECTS = mkdir.$(OBJEXT) +mkdir_LDADD = $(LDADD) +mkdir_DEPENDENCIES = libtests.a +mkdirat_SOURCES = mkdirat.c +mkdirat_OBJECTS = mkdirat.$(OBJEXT) +mkdirat_LDADD = $(LDADD) +mkdirat_DEPENDENCIES = libtests.a +mknod_SOURCES = mknod.c +mknod_OBJECTS = mknod.$(OBJEXT) +mknod_LDADD = $(LDADD) +mknod_DEPENDENCIES = libtests.a +mknodat_SOURCES = mknodat.c +mknodat_OBJECTS = mknodat.$(OBJEXT) +mknodat_LDADD = $(LDADD) +mknodat_DEPENDENCIES = libtests.a +mlock_SOURCES = mlock.c +mlock_OBJECTS = mlock.$(OBJEXT) +mlock_LDADD = $(LDADD) +mlock_DEPENDENCIES = libtests.a +mlock2_SOURCES = mlock2.c +mlock2_OBJECTS = mlock2.$(OBJEXT) +mlock2_LDADD = $(LDADD) +mlock2_DEPENDENCIES = libtests.a +mlockall_SOURCES = mlockall.c +mlockall_OBJECTS = mlockall.$(OBJEXT) +mlockall_LDADD = $(LDADD) +mlockall_DEPENDENCIES = libtests.a +mmap_SOURCES = mmap.c +mmap_OBJECTS = mmap.$(OBJEXT) +mmap_LDADD = $(LDADD) +mmap_DEPENDENCIES = libtests.a +mmap64_SOURCES = mmap64.c +mmap64_OBJECTS = mmap64-mmap64.$(OBJEXT) +mmap64_LDADD = $(LDADD) +mmap64_DEPENDENCIES = libtests.a +mmsg_SOURCES = mmsg.c +mmsg_OBJECTS = mmsg.$(OBJEXT) +mmsg_LDADD = $(LDADD) +mmsg_DEPENDENCIES = libtests.a +mmsg_silent_SOURCES = mmsg-silent.c +mmsg_silent_OBJECTS = mmsg-silent.$(OBJEXT) +mmsg_silent_LDADD = $(LDADD) +mmsg_silent_DEPENDENCIES = libtests.a +mmsg_name_SOURCES = mmsg_name.c +mmsg_name_OBJECTS = mmsg_name.$(OBJEXT) +mmsg_name_LDADD = $(LDADD) +mmsg_name_DEPENDENCIES = libtests.a +mmsg_name_v_SOURCES = mmsg_name-v.c +mmsg_name_v_OBJECTS = mmsg_name-v.$(OBJEXT) +mmsg_name_v_LDADD = $(LDADD) +mmsg_name_v_DEPENDENCIES = libtests.a +mount_SOURCES = mount.c +mount_OBJECTS = mount.$(OBJEXT) +mount_LDADD = $(LDADD) +mount_DEPENDENCIES = libtests.a +move_pages_SOURCES = move_pages.c +move_pages_OBJECTS = move_pages.$(OBJEXT) +move_pages_LDADD = $(LDADD) +move_pages_DEPENDENCIES = libtests.a +mq_SOURCES = mq.c +mq_OBJECTS = mq.$(OBJEXT) +mq_DEPENDENCIES = $(LDADD) +mq_sendrecv_SOURCES = mq_sendrecv.c +mq_sendrecv_OBJECTS = mq_sendrecv.$(OBJEXT) +mq_sendrecv_DEPENDENCIES = $(LDADD) +mq_sendrecv_read_SOURCES = mq_sendrecv-read.c +mq_sendrecv_read_OBJECTS = mq_sendrecv-read.$(OBJEXT) +mq_sendrecv_read_DEPENDENCIES = $(LDADD) +mq_sendrecv_write_SOURCES = mq_sendrecv-write.c +mq_sendrecv_write_OBJECTS = mq_sendrecv-write.$(OBJEXT) +mq_sendrecv_write_DEPENDENCIES = $(LDADD) +msg_control_SOURCES = msg_control.c +msg_control_OBJECTS = msg_control.$(OBJEXT) +msg_control_LDADD = $(LDADD) +msg_control_DEPENDENCIES = libtests.a +msg_control_v_SOURCES = msg_control-v.c +msg_control_v_OBJECTS = msg_control-v.$(OBJEXT) +msg_control_v_LDADD = $(LDADD) +msg_control_v_DEPENDENCIES = libtests.a +msg_name_SOURCES = msg_name.c +msg_name_OBJECTS = msg_name.$(OBJEXT) +msg_name_LDADD = $(LDADD) +msg_name_DEPENDENCIES = libtests.a +munlockall_SOURCES = munlockall.c +munlockall_OBJECTS = munlockall.$(OBJEXT) +munlockall_LDADD = $(LDADD) +munlockall_DEPENDENCIES = libtests.a +nanosleep_SOURCES = nanosleep.c +nanosleep_OBJECTS = nanosleep.$(OBJEXT) +nanosleep_LDADD = $(LDADD) +nanosleep_DEPENDENCIES = libtests.a net_accept_connect_SOURCES = net-accept-connect.c net_accept_connect_OBJECTS = net-accept-connect.$(OBJEXT) net_accept_connect_LDADD = $(LDADD) +net_accept_connect_DEPENDENCIES = libtests.a +net_icmp_filter_SOURCES = net-icmp_filter.c +net_icmp_filter_OBJECTS = net-icmp_filter.$(OBJEXT) +net_icmp_filter_LDADD = $(LDADD) +net_icmp_filter_DEPENDENCIES = libtests.a +net_sockaddr_SOURCES = net-sockaddr.c +net_sockaddr_OBJECTS = net-sockaddr.$(OBJEXT) +net_sockaddr_LDADD = $(LDADD) +net_sockaddr_DEPENDENCIES = libtests.a +net_y_unix_SOURCES = net-y-unix.c +net_y_unix_OBJECTS = net-y-unix.$(OBJEXT) +net_y_unix_LDADD = $(LDADD) +net_y_unix_DEPENDENCIES = libtests.a +net_yy_inet_SOURCES = net-yy-inet.c +net_yy_inet_OBJECTS = net-yy-inet.$(OBJEXT) +net_yy_inet_LDADD = $(LDADD) +net_yy_inet_DEPENDENCIES = libtests.a +net_yy_netlink_SOURCES = net-yy-netlink.c +net_yy_netlink_OBJECTS = net-yy-netlink.$(OBJEXT) +net_yy_netlink_LDADD = $(LDADD) +net_yy_netlink_DEPENDENCIES = libtests.a +net_yy_unix_SOURCES = net-yy-unix.c +net_yy_unix_OBJECTS = net-yy-unix.$(OBJEXT) +net_yy_unix_LDADD = $(LDADD) +net_yy_unix_DEPENDENCIES = libtests.a +netlink_inet_diag_SOURCES = netlink_inet_diag.c +netlink_inet_diag_OBJECTS = netlink_inet_diag.$(OBJEXT) +netlink_inet_diag_LDADD = $(LDADD) +netlink_inet_diag_DEPENDENCIES = libtests.a +netlink_netlink_diag_SOURCES = netlink_netlink_diag.c +netlink_netlink_diag_OBJECTS = netlink_netlink_diag.$(OBJEXT) +netlink_netlink_diag_LDADD = $(LDADD) +netlink_netlink_diag_DEPENDENCIES = libtests.a +netlink_protocol_SOURCES = netlink_protocol.c +netlink_protocol_OBJECTS = netlink_protocol.$(OBJEXT) +netlink_protocol_LDADD = $(LDADD) +netlink_protocol_DEPENDENCIES = libtests.a +netlink_unix_diag_SOURCES = netlink_unix_diag.c +netlink_unix_diag_OBJECTS = netlink_unix_diag.$(OBJEXT) +netlink_unix_diag_LDADD = $(LDADD) +netlink_unix_diag_DEPENDENCIES = libtests.a +newfstatat_SOURCES = newfstatat.c +newfstatat_OBJECTS = newfstatat-newfstatat.$(OBJEXT) +newfstatat_LDADD = $(LDADD) +newfstatat_DEPENDENCIES = libtests.a +nsyscalls_SOURCES = nsyscalls.c +nsyscalls_OBJECTS = nsyscalls.$(OBJEXT) +nsyscalls_LDADD = $(LDADD) +nsyscalls_DEPENDENCIES = libtests.a +old_mmap_SOURCES = old_mmap.c +old_mmap_OBJECTS = old_mmap.$(OBJEXT) +old_mmap_LDADD = $(LDADD) +old_mmap_DEPENDENCIES = libtests.a +oldfstat_SOURCES = oldfstat.c +oldfstat_OBJECTS = oldfstat.$(OBJEXT) +oldfstat_LDADD = $(LDADD) +oldfstat_DEPENDENCIES = libtests.a +oldlstat_SOURCES = oldlstat.c +oldlstat_OBJECTS = oldlstat.$(OBJEXT) +oldlstat_LDADD = $(LDADD) +oldlstat_DEPENDENCIES = libtests.a +oldselect_SOURCES = oldselect.c +oldselect_OBJECTS = oldselect.$(OBJEXT) +oldselect_LDADD = $(LDADD) +oldselect_DEPENDENCIES = libtests.a +oldstat_SOURCES = oldstat.c +oldstat_OBJECTS = oldstat.$(OBJEXT) +oldstat_LDADD = $(LDADD) +oldstat_DEPENDENCIES = libtests.a +open_SOURCES = open.c +open_OBJECTS = open.$(OBJEXT) +open_LDADD = $(LDADD) +open_DEPENDENCIES = libtests.a +openat_SOURCES = openat.c +openat_OBJECTS = openat.$(OBJEXT) +openat_LDADD = $(LDADD) +openat_DEPENDENCIES = libtests.a +pause_SOURCES = pause.c +pause_OBJECTS = pause.$(OBJEXT) +pause_LDADD = $(LDADD) +pause_DEPENDENCIES = libtests.a +pc_SOURCES = pc.c +pc_OBJECTS = pc.$(OBJEXT) +am__DEPENDENCIES_1 = +pc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) +perf_event_open_SOURCES = perf_event_open.c +perf_event_open_OBJECTS = perf_event_open.$(OBJEXT) +perf_event_open_LDADD = $(LDADD) +perf_event_open_DEPENDENCIES = libtests.a +perf_event_open_nonverbose_SOURCES = perf_event_open_nonverbose.c +perf_event_open_nonverbose_OBJECTS = \ + perf_event_open_nonverbose.$(OBJEXT) +perf_event_open_nonverbose_LDADD = $(LDADD) +perf_event_open_nonverbose_DEPENDENCIES = libtests.a +perf_event_open_unabbrev_SOURCES = perf_event_open_unabbrev.c +perf_event_open_unabbrev_OBJECTS = perf_event_open_unabbrev.$(OBJEXT) +perf_event_open_unabbrev_LDADD = $(LDADD) +perf_event_open_unabbrev_DEPENDENCIES = libtests.a +personality_SOURCES = personality.c +personality_OBJECTS = personality.$(OBJEXT) +personality_LDADD = $(LDADD) +personality_DEPENDENCIES = libtests.a +pipe_SOURCES = pipe.c +pipe_OBJECTS = pipe.$(OBJEXT) +pipe_LDADD = $(LDADD) +pipe_DEPENDENCIES = libtests.a +pipe2_SOURCES = pipe2.c +pipe2_OBJECTS = pipe2.$(OBJEXT) +pipe2_LDADD = $(LDADD) +pipe2_DEPENDENCIES = libtests.a +pkey_alloc_SOURCES = pkey_alloc.c +pkey_alloc_OBJECTS = pkey_alloc.$(OBJEXT) +pkey_alloc_LDADD = $(LDADD) +pkey_alloc_DEPENDENCIES = libtests.a +pkey_free_SOURCES = pkey_free.c +pkey_free_OBJECTS = pkey_free.$(OBJEXT) +pkey_free_LDADD = $(LDADD) +pkey_free_DEPENDENCIES = libtests.a +pkey_mprotect_SOURCES = pkey_mprotect.c +pkey_mprotect_OBJECTS = pkey_mprotect.$(OBJEXT) +pkey_mprotect_LDADD = $(LDADD) +pkey_mprotect_DEPENDENCIES = libtests.a +poll_SOURCES = poll.c +poll_OBJECTS = poll.$(OBJEXT) +poll_LDADD = $(LDADD) +poll_DEPENDENCIES = libtests.a +ppoll_SOURCES = ppoll.c +ppoll_OBJECTS = ppoll.$(OBJEXT) +ppoll_LDADD = $(LDADD) +ppoll_DEPENDENCIES = libtests.a +prctl_arg2_intptr_SOURCES = prctl-arg2-intptr.c +prctl_arg2_intptr_OBJECTS = prctl-arg2-intptr.$(OBJEXT) +prctl_arg2_intptr_LDADD = $(LDADD) +prctl_arg2_intptr_DEPENDENCIES = libtests.a +prctl_dumpable_SOURCES = prctl-dumpable.c +prctl_dumpable_OBJECTS = prctl-dumpable.$(OBJEXT) +prctl_dumpable_LDADD = $(LDADD) +prctl_dumpable_DEPENDENCIES = libtests.a +prctl_name_SOURCES = prctl-name.c +prctl_name_OBJECTS = prctl-name.$(OBJEXT) +prctl_name_LDADD = $(LDADD) +prctl_name_DEPENDENCIES = libtests.a +prctl_no_args_SOURCES = prctl-no-args.c +prctl_no_args_OBJECTS = prctl-no-args.$(OBJEXT) +prctl_no_args_LDADD = $(LDADD) +prctl_no_args_DEPENDENCIES = libtests.a +prctl_pdeathsig_SOURCES = prctl-pdeathsig.c +prctl_pdeathsig_OBJECTS = prctl-pdeathsig.$(OBJEXT) +prctl_pdeathsig_LDADD = $(LDADD) +prctl_pdeathsig_DEPENDENCIES = libtests.a +prctl_seccomp_filter_v_SOURCES = prctl-seccomp-filter-v.c +prctl_seccomp_filter_v_OBJECTS = prctl-seccomp-filter-v.$(OBJEXT) +prctl_seccomp_filter_v_LDADD = $(LDADD) +prctl_seccomp_filter_v_DEPENDENCIES = libtests.a +prctl_seccomp_strict_SOURCES = prctl-seccomp-strict.c +prctl_seccomp_strict_OBJECTS = prctl-seccomp-strict.$(OBJEXT) +prctl_seccomp_strict_LDADD = $(LDADD) +prctl_seccomp_strict_DEPENDENCIES = libtests.a +prctl_securebits_SOURCES = prctl-securebits.c +prctl_securebits_OBJECTS = prctl-securebits.$(OBJEXT) +prctl_securebits_LDADD = $(LDADD) +prctl_securebits_DEPENDENCIES = libtests.a +prctl_tid_address_SOURCES = prctl-tid_address.c +prctl_tid_address_OBJECTS = prctl-tid_address.$(OBJEXT) +prctl_tid_address_LDADD = $(LDADD) +prctl_tid_address_DEPENDENCIES = libtests.a +prctl_tsc_SOURCES = prctl-tsc.c +prctl_tsc_OBJECTS = prctl-tsc.$(OBJEXT) +prctl_tsc_LDADD = $(LDADD) +prctl_tsc_DEPENDENCIES = libtests.a +pread64_pwrite64_SOURCES = pread64-pwrite64.c +pread64_pwrite64_OBJECTS = \ + pread64_pwrite64-pread64-pwrite64.$(OBJEXT) +pread64_pwrite64_LDADD = $(LDADD) +pread64_pwrite64_DEPENDENCIES = libtests.a +preadv_SOURCES = preadv.c +preadv_OBJECTS = preadv-preadv.$(OBJEXT) +preadv_LDADD = $(LDADD) +preadv_DEPENDENCIES = libtests.a +preadv_pwritev_SOURCES = preadv-pwritev.c +preadv_pwritev_OBJECTS = preadv_pwritev-preadv-pwritev.$(OBJEXT) +preadv_pwritev_LDADD = $(LDADD) +preadv_pwritev_DEPENDENCIES = libtests.a +preadv2_pwritev2_SOURCES = preadv2-pwritev2.c +preadv2_pwritev2_OBJECTS = preadv2-pwritev2.$(OBJEXT) +preadv2_pwritev2_LDADD = $(LDADD) +preadv2_pwritev2_DEPENDENCIES = libtests.a +print_maxfd_SOURCES = print_maxfd.c +print_maxfd_OBJECTS = print_maxfd.$(OBJEXT) +print_maxfd_LDADD = $(LDADD) +print_maxfd_DEPENDENCIES = libtests.a +printstr_SOURCES = printstr.c +printstr_OBJECTS = printstr.$(OBJEXT) +printstr_LDADD = $(LDADD) +printstr_DEPENDENCIES = libtests.a +prlimit64_SOURCES = prlimit64.c +prlimit64_OBJECTS = prlimit64.$(OBJEXT) +prlimit64_LDADD = $(LDADD) +prlimit64_DEPENDENCIES = libtests.a +process_vm_readv_SOURCES = process_vm_readv.c +process_vm_readv_OBJECTS = process_vm_readv.$(OBJEXT) +process_vm_readv_LDADD = $(LDADD) +process_vm_readv_DEPENDENCIES = libtests.a +process_vm_writev_SOURCES = process_vm_writev.c +process_vm_writev_OBJECTS = process_vm_writev.$(OBJEXT) +process_vm_writev_LDADD = $(LDADD) +process_vm_writev_DEPENDENCIES = libtests.a +pselect6_SOURCES = pselect6.c +pselect6_OBJECTS = pselect6.$(OBJEXT) +pselect6_LDADD = $(LDADD) +pselect6_DEPENDENCIES = libtests.a +ptrace_SOURCES = ptrace.c +ptrace_OBJECTS = ptrace.$(OBJEXT) +ptrace_LDADD = $(LDADD) +ptrace_DEPENDENCIES = libtests.a +pwritev_SOURCES = pwritev.c +pwritev_OBJECTS = pwritev-pwritev.$(OBJEXT) +pwritev_LDADD = $(LDADD) +pwritev_DEPENDENCIES = libtests.a +qual_fault_SOURCES = qual_fault.c +qual_fault_OBJECTS = qual_fault.$(OBJEXT) +qual_fault_LDADD = $(LDADD) +qual_fault_DEPENDENCIES = libtests.a +qual_inject_error_signal_SOURCES = qual_inject-error-signal.c +qual_inject_error_signal_OBJECTS = qual_inject-error-signal.$(OBJEXT) +qual_inject_error_signal_LDADD = $(LDADD) +qual_inject_error_signal_DEPENDENCIES = libtests.a +qual_inject_retval_SOURCES = qual_inject-retval.c +qual_inject_retval_OBJECTS = qual_inject-retval.$(OBJEXT) +qual_inject_retval_LDADD = $(LDADD) +qual_inject_retval_DEPENDENCIES = libtests.a +qual_inject_signal_SOURCES = qual_inject-signal.c +qual_inject_signal_OBJECTS = qual_inject-signal.$(OBJEXT) +qual_inject_signal_LDADD = $(LDADD) +qual_inject_signal_DEPENDENCIES = libtests.a +qual_signal_SOURCES = qual_signal.c +qual_signal_OBJECTS = qual_signal.$(OBJEXT) +qual_signal_LDADD = $(LDADD) +qual_signal_DEPENDENCIES = libtests.a +quotactl_SOURCES = quotactl.c +quotactl_OBJECTS = quotactl.$(OBJEXT) +quotactl_LDADD = $(LDADD) +quotactl_DEPENDENCIES = libtests.a +quotactl_v_SOURCES = quotactl-v.c +quotactl_v_OBJECTS = quotactl-v.$(OBJEXT) +quotactl_v_LDADD = $(LDADD) +quotactl_v_DEPENDENCIES = libtests.a +quotactl_xfs_SOURCES = quotactl-xfs.c +quotactl_xfs_OBJECTS = quotactl-xfs.$(OBJEXT) +quotactl_xfs_LDADD = $(LDADD) +quotactl_xfs_DEPENDENCIES = libtests.a +quotactl_xfs_v_SOURCES = quotactl-xfs-v.c +quotactl_xfs_v_OBJECTS = quotactl-xfs-v.$(OBJEXT) +quotactl_xfs_v_LDADD = $(LDADD) +quotactl_xfs_v_DEPENDENCIES = libtests.a +read_write_SOURCES = read-write.c +read_write_OBJECTS = read-write.$(OBJEXT) +read_write_LDADD = $(LDADD) +read_write_DEPENDENCIES = libtests.a +readahead_SOURCES = readahead.c +readahead_OBJECTS = readahead.$(OBJEXT) +readahead_LDADD = $(LDADD) +readahead_DEPENDENCIES = libtests.a +readdir_SOURCES = readdir.c +readdir_OBJECTS = readdir.$(OBJEXT) +readdir_LDADD = $(LDADD) +readdir_DEPENDENCIES = libtests.a +readlink_SOURCES = readlink.c +readlink_OBJECTS = readlink.$(OBJEXT) +readlink_LDADD = $(LDADD) +readlink_DEPENDENCIES = libtests.a +readlinkat_SOURCES = readlinkat.c +readlinkat_OBJECTS = readlinkat.$(OBJEXT) +readlinkat_LDADD = $(LDADD) +readlinkat_DEPENDENCIES = libtests.a +readv_SOURCES = readv.c +readv_OBJECTS = readv.$(OBJEXT) +readv_LDADD = $(LDADD) +readv_DEPENDENCIES = libtests.a +reboot_SOURCES = reboot.c +reboot_OBJECTS = reboot.$(OBJEXT) +reboot_LDADD = $(LDADD) +reboot_DEPENDENCIES = libtests.a +recvfrom_SOURCES = recvfrom.c +recvfrom_OBJECTS = recvfrom.$(OBJEXT) +recvfrom_LDADD = $(LDADD) +recvfrom_DEPENDENCIES = libtests.a +recvmmsg_timeout_SOURCES = recvmmsg-timeout.c +recvmmsg_timeout_OBJECTS = recvmmsg-timeout.$(OBJEXT) +recvmmsg_timeout_LDADD = $(LDADD) +recvmmsg_timeout_DEPENDENCIES = libtests.a +recvmsg_SOURCES = recvmsg.c +recvmsg_OBJECTS = recvmsg.$(OBJEXT) +recvmsg_LDADD = $(LDADD) +recvmsg_DEPENDENCIES = libtests.a +redirect_fds_SOURCES = redirect-fds.c +redirect_fds_OBJECTS = redirect-fds.$(OBJEXT) +redirect_fds_LDADD = $(LDADD) +redirect_fds_DEPENDENCIES = libtests.a +remap_file_pages_SOURCES = remap_file_pages.c +remap_file_pages_OBJECTS = remap_file_pages.$(OBJEXT) +remap_file_pages_LDADD = $(LDADD) +remap_file_pages_DEPENDENCIES = libtests.a +rename_SOURCES = rename.c +rename_OBJECTS = rename.$(OBJEXT) +rename_LDADD = $(LDADD) +rename_DEPENDENCIES = libtests.a +renameat_SOURCES = renameat.c +renameat_OBJECTS = renameat.$(OBJEXT) +renameat_LDADD = $(LDADD) +renameat_DEPENDENCIES = libtests.a +renameat2_SOURCES = renameat2.c +renameat2_OBJECTS = renameat2.$(OBJEXT) +renameat2_LDADD = $(LDADD) +renameat2_DEPENDENCIES = libtests.a +request_key_SOURCES = request_key.c +request_key_OBJECTS = request_key.$(OBJEXT) +request_key_LDADD = $(LDADD) +request_key_DEPENDENCIES = libtests.a +restart_syscall_SOURCES = restart_syscall.c +restart_syscall_OBJECTS = restart_syscall.$(OBJEXT) +restart_syscall_LDADD = $(LDADD) +restart_syscall_DEPENDENCIES = libtests.a +rmdir_SOURCES = rmdir.c +rmdir_OBJECTS = rmdir.$(OBJEXT) +rmdir_LDADD = $(LDADD) +rmdir_DEPENDENCIES = libtests.a +rt_sigpending_SOURCES = rt_sigpending.c +rt_sigpending_OBJECTS = rt_sigpending.$(OBJEXT) +rt_sigpending_LDADD = $(LDADD) +rt_sigpending_DEPENDENCIES = libtests.a +rt_sigprocmask_SOURCES = rt_sigprocmask.c +rt_sigprocmask_OBJECTS = rt_sigprocmask.$(OBJEXT) +rt_sigprocmask_LDADD = $(LDADD) +rt_sigprocmask_DEPENDENCIES = libtests.a +rt_sigqueueinfo_SOURCES = rt_sigqueueinfo.c +rt_sigqueueinfo_OBJECTS = rt_sigqueueinfo.$(OBJEXT) +rt_sigqueueinfo_LDADD = $(LDADD) +rt_sigqueueinfo_DEPENDENCIES = libtests.a +rt_sigsuspend_SOURCES = rt_sigsuspend.c +rt_sigsuspend_OBJECTS = rt_sigsuspend.$(OBJEXT) +rt_sigsuspend_LDADD = $(LDADD) +rt_sigsuspend_DEPENDENCIES = libtests.a +rt_sigtimedwait_SOURCES = rt_sigtimedwait.c +rt_sigtimedwait_OBJECTS = rt_sigtimedwait.$(OBJEXT) +rt_sigtimedwait_LDADD = $(LDADD) +rt_sigtimedwait_DEPENDENCIES = libtests.a +rt_tgsigqueueinfo_SOURCES = rt_tgsigqueueinfo.c +rt_tgsigqueueinfo_OBJECTS = rt_tgsigqueueinfo.$(OBJEXT) +rt_tgsigqueueinfo_LDADD = $(LDADD) +rt_tgsigqueueinfo_DEPENDENCIES = libtests.a +sched_get_priority_mxx_SOURCES = sched_get_priority_mxx.c +sched_get_priority_mxx_OBJECTS = sched_get_priority_mxx.$(OBJEXT) +sched_get_priority_mxx_LDADD = $(LDADD) +sched_get_priority_mxx_DEPENDENCIES = libtests.a +sched_rr_get_interval_SOURCES = sched_rr_get_interval.c +sched_rr_get_interval_OBJECTS = sched_rr_get_interval.$(OBJEXT) +sched_rr_get_interval_LDADD = $(LDADD) +sched_rr_get_interval_DEPENDENCIES = libtests.a +sched_xetaffinity_SOURCES = sched_xetaffinity.c +sched_xetaffinity_OBJECTS = sched_xetaffinity.$(OBJEXT) +sched_xetaffinity_LDADD = $(LDADD) +sched_xetaffinity_DEPENDENCIES = libtests.a +sched_xetattr_SOURCES = sched_xetattr.c +sched_xetattr_OBJECTS = sched_xetattr.$(OBJEXT) +sched_xetattr_LDADD = $(LDADD) +sched_xetattr_DEPENDENCIES = libtests.a +sched_xetparam_SOURCES = sched_xetparam.c +sched_xetparam_OBJECTS = sched_xetparam.$(OBJEXT) +sched_xetparam_LDADD = $(LDADD) +sched_xetparam_DEPENDENCIES = libtests.a +sched_xetscheduler_SOURCES = sched_xetscheduler.c +sched_xetscheduler_OBJECTS = sched_xetscheduler.$(OBJEXT) +sched_xetscheduler_LDADD = $(LDADD) +sched_xetscheduler_DEPENDENCIES = libtests.a +sched_yield_SOURCES = sched_yield.c +sched_yield_OBJECTS = sched_yield.$(OBJEXT) +sched_yield_LDADD = $(LDADD) +sched_yield_DEPENDENCIES = libtests.a scm_rights_SOURCES = scm_rights.c scm_rights_OBJECTS = scm_rights.$(OBJEXT) scm_rights_LDADD = $(LDADD) +scm_rights_DEPENDENCIES = libtests.a +seccomp_filter_SOURCES = seccomp-filter.c +seccomp_filter_OBJECTS = seccomp-filter.$(OBJEXT) +seccomp_filter_LDADD = $(LDADD) +seccomp_filter_DEPENDENCIES = libtests.a +seccomp_filter_v_SOURCES = seccomp-filter-v.c +seccomp_filter_v_OBJECTS = seccomp-filter-v.$(OBJEXT) +seccomp_filter_v_LDADD = $(LDADD) +seccomp_filter_v_DEPENDENCIES = libtests.a +seccomp_strict_SOURCES = seccomp-strict.c +seccomp_strict_OBJECTS = seccomp-strict.$(OBJEXT) +seccomp_strict_LDADD = $(LDADD) +seccomp_strict_DEPENDENCIES = libtests.a +select_SOURCES = select.c +select_OBJECTS = select.$(OBJEXT) +select_LDADD = $(LDADD) +select_DEPENDENCIES = libtests.a +semop_SOURCES = semop.c +semop_OBJECTS = semop.$(OBJEXT) +semop_LDADD = $(LDADD) +semop_DEPENDENCIES = libtests.a +sendfile_SOURCES = sendfile.c +sendfile_OBJECTS = sendfile.$(OBJEXT) +sendfile_LDADD = $(LDADD) +sendfile_DEPENDENCIES = libtests.a +sendfile64_SOURCES = sendfile64.c +sendfile64_OBJECTS = sendfile64.$(OBJEXT) +sendfile64_LDADD = $(LDADD) +sendfile64_DEPENDENCIES = libtests.a +set_mempolicy_SOURCES = set_mempolicy.c +set_mempolicy_OBJECTS = set_mempolicy.$(OBJEXT) +set_mempolicy_LDADD = $(LDADD) +set_mempolicy_DEPENDENCIES = libtests.a set_ptracer_any_SOURCES = set_ptracer_any.c set_ptracer_any_OBJECTS = set_ptracer_any.$(OBJEXT) set_ptracer_any_LDADD = $(LDADD) +set_ptracer_any_DEPENDENCIES = libtests.a +setdomainname_SOURCES = setdomainname.c +setdomainname_OBJECTS = setdomainname.$(OBJEXT) +setdomainname_LDADD = $(LDADD) +setdomainname_DEPENDENCIES = libtests.a +setfsgid_SOURCES = setfsgid.c +setfsgid_OBJECTS = setfsgid.$(OBJEXT) +setfsgid_LDADD = $(LDADD) +setfsgid_DEPENDENCIES = libtests.a +setfsgid32_SOURCES = setfsgid32.c +setfsgid32_OBJECTS = setfsgid32.$(OBJEXT) +setfsgid32_LDADD = $(LDADD) +setfsgid32_DEPENDENCIES = libtests.a +setfsuid_SOURCES = setfsuid.c +setfsuid_OBJECTS = setfsuid.$(OBJEXT) +setfsuid_LDADD = $(LDADD) +setfsuid_DEPENDENCIES = libtests.a +setfsuid32_SOURCES = setfsuid32.c +setfsuid32_OBJECTS = setfsuid32.$(OBJEXT) +setfsuid32_LDADD = $(LDADD) +setfsuid32_DEPENDENCIES = libtests.a +setgid_SOURCES = setgid.c +setgid_OBJECTS = setgid.$(OBJEXT) +setgid_LDADD = $(LDADD) +setgid_DEPENDENCIES = libtests.a +setgid32_SOURCES = setgid32.c +setgid32_OBJECTS = setgid32.$(OBJEXT) +setgid32_LDADD = $(LDADD) +setgid32_DEPENDENCIES = libtests.a +setgroups_SOURCES = setgroups.c +setgroups_OBJECTS = setgroups.$(OBJEXT) +setgroups_LDADD = $(LDADD) +setgroups_DEPENDENCIES = libtests.a +setgroups32_SOURCES = setgroups32.c +setgroups32_OBJECTS = setgroups32.$(OBJEXT) +setgroups32_LDADD = $(LDADD) +setgroups32_DEPENDENCIES = libtests.a +sethostname_SOURCES = sethostname.c +sethostname_OBJECTS = sethostname.$(OBJEXT) +sethostname_LDADD = $(LDADD) +sethostname_DEPENDENCIES = libtests.a +setns_SOURCES = setns.c +setns_OBJECTS = setns.$(OBJEXT) +setns_LDADD = $(LDADD) +setns_DEPENDENCIES = libtests.a +setregid_SOURCES = setregid.c +setregid_OBJECTS = setregid.$(OBJEXT) +setregid_LDADD = $(LDADD) +setregid_DEPENDENCIES = libtests.a +setregid32_SOURCES = setregid32.c +setregid32_OBJECTS = setregid32.$(OBJEXT) +setregid32_LDADD = $(LDADD) +setregid32_DEPENDENCIES = libtests.a +setresgid_SOURCES = setresgid.c +setresgid_OBJECTS = setresgid.$(OBJEXT) +setresgid_LDADD = $(LDADD) +setresgid_DEPENDENCIES = libtests.a +setresgid32_SOURCES = setresgid32.c +setresgid32_OBJECTS = setresgid32.$(OBJEXT) +setresgid32_LDADD = $(LDADD) +setresgid32_DEPENDENCIES = libtests.a +setresuid_SOURCES = setresuid.c +setresuid_OBJECTS = setresuid.$(OBJEXT) +setresuid_LDADD = $(LDADD) +setresuid_DEPENDENCIES = libtests.a +setresuid32_SOURCES = setresuid32.c +setresuid32_OBJECTS = setresuid32.$(OBJEXT) +setresuid32_LDADD = $(LDADD) +setresuid32_DEPENDENCIES = libtests.a +setreuid_SOURCES = setreuid.c +setreuid_OBJECTS = setreuid.$(OBJEXT) +setreuid_LDADD = $(LDADD) +setreuid_DEPENDENCIES = libtests.a +setreuid32_SOURCES = setreuid32.c +setreuid32_OBJECTS = setreuid32.$(OBJEXT) +setreuid32_LDADD = $(LDADD) +setreuid32_DEPENDENCIES = libtests.a +setrlimit_SOURCES = setrlimit.c +setrlimit_OBJECTS = setrlimit.$(OBJEXT) +setrlimit_LDADD = $(LDADD) +setrlimit_DEPENDENCIES = libtests.a +setuid_SOURCES = setuid.c +setuid_OBJECTS = setuid.$(OBJEXT) +setuid_LDADD = $(LDADD) +setuid_DEPENDENCIES = libtests.a +setuid32_SOURCES = setuid32.c +setuid32_OBJECTS = setuid32.$(OBJEXT) +setuid32_LDADD = $(LDADD) +setuid32_DEPENDENCIES = libtests.a +shmxt_SOURCES = shmxt.c +shmxt_OBJECTS = shmxt.$(OBJEXT) +shmxt_LDADD = $(LDADD) +shmxt_DEPENDENCIES = libtests.a +shutdown_SOURCES = shutdown.c +shutdown_OBJECTS = shutdown.$(OBJEXT) +shutdown_LDADD = $(LDADD) +shutdown_DEPENDENCIES = libtests.a sigaction_SOURCES = sigaction.c sigaction_OBJECTS = sigaction.$(OBJEXT) sigaction_LDADD = $(LDADD) +sigaction_DEPENDENCIES = libtests.a +sigaltstack_SOURCES = sigaltstack.c +sigaltstack_OBJECTS = sigaltstack.$(OBJEXT) +sigaltstack_LDADD = $(LDADD) +sigaltstack_DEPENDENCIES = libtests.a +siginfo_SOURCES = siginfo.c +siginfo_OBJECTS = siginfo.$(OBJEXT) +siginfo_LDADD = $(LDADD) +siginfo_DEPENDENCIES = libtests.a +signal_receive_SOURCES = signal_receive.c +signal_receive_OBJECTS = signal_receive.$(OBJEXT) +signal_receive_LDADD = $(LDADD) +signal_receive_DEPENDENCIES = libtests.a +signalfd4_SOURCES = signalfd4.c +signalfd4_OBJECTS = signalfd4.$(OBJEXT) +signalfd4_LDADD = $(LDADD) +signalfd4_DEPENDENCIES = libtests.a +sigreturn_SOURCES = sigreturn.c +sigreturn_OBJECTS = sigreturn.$(OBJEXT) +sigreturn_LDADD = $(LDADD) +sigreturn_DEPENDENCIES = libtests.a +sleep_SOURCES = sleep.c +sleep_OBJECTS = sleep.$(OBJEXT) +sleep_LDADD = $(LDADD) +sleep_DEPENDENCIES = libtests.a +socketcall_SOURCES = socketcall.c +socketcall_OBJECTS = socketcall.$(OBJEXT) +socketcall_LDADD = $(LDADD) +socketcall_DEPENDENCIES = libtests.a +splice_SOURCES = splice.c +splice_OBJECTS = splice.$(OBJEXT) +splice_LDADD = $(LDADD) +splice_DEPENDENCIES = libtests.a am_stack_fcall_OBJECTS = stack-fcall.$(OBJEXT) stack-fcall-0.$(OBJEXT) \ stack-fcall-1.$(OBJEXT) stack-fcall-2.$(OBJEXT) \ stack-fcall-3.$(OBJEXT) stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) stack_fcall_LDADD = $(LDADD) +stack_fcall_DEPENDENCIES = libtests.a +stat_SOURCES = stat.c +stat_OBJECTS = stat.$(OBJEXT) +stat_LDADD = $(LDADD) +stat_DEPENDENCIES = libtests.a +stat64_SOURCES = stat64.c +stat64_OBJECTS = stat64-stat64.$(OBJEXT) +stat64_LDADD = $(LDADD) +stat64_DEPENDENCIES = libtests.a +statfs_SOURCES = statfs.c +statfs_OBJECTS = statfs-statfs.$(OBJEXT) +statfs_LDADD = $(LDADD) +statfs_DEPENDENCIES = libtests.a +statfs64_SOURCES = statfs64.c +statfs64_OBJECTS = statfs64.$(OBJEXT) +statfs64_LDADD = $(LDADD) +statfs64_DEPENDENCIES = libtests.a +swap_SOURCES = swap.c +swap_OBJECTS = swap.$(OBJEXT) +swap_LDADD = $(LDADD) +swap_DEPENDENCIES = libtests.a +symlink_SOURCES = symlink.c +symlink_OBJECTS = symlink.$(OBJEXT) +symlink_LDADD = $(LDADD) +symlink_DEPENDENCIES = libtests.a +symlinkat_SOURCES = symlinkat.c +symlinkat_OBJECTS = symlinkat.$(OBJEXT) +symlinkat_LDADD = $(LDADD) +symlinkat_DEPENDENCIES = libtests.a +sync_SOURCES = sync.c +sync_OBJECTS = sync.$(OBJEXT) +sync_LDADD = $(LDADD) +sync_DEPENDENCIES = libtests.a +sync_file_range_SOURCES = sync_file_range.c +sync_file_range_OBJECTS = sync_file_range.$(OBJEXT) +sync_file_range_LDADD = $(LDADD) +sync_file_range_DEPENDENCIES = libtests.a +sync_file_range2_SOURCES = sync_file_range2.c +sync_file_range2_OBJECTS = sync_file_range2.$(OBJEXT) +sync_file_range2_LDADD = $(LDADD) +sync_file_range2_DEPENDENCIES = libtests.a +sysinfo_SOURCES = sysinfo.c +sysinfo_OBJECTS = sysinfo.$(OBJEXT) +sysinfo_LDADD = $(LDADD) +sysinfo_DEPENDENCIES = libtests.a +syslog_SOURCES = syslog.c +syslog_OBJECTS = syslog.$(OBJEXT) +syslog_LDADD = $(LDADD) +syslog_DEPENDENCIES = libtests.a +tee_SOURCES = tee.c +tee_OBJECTS = tee.$(OBJEXT) +tee_LDADD = $(LDADD) +tee_DEPENDENCIES = libtests.a +threads_execve_SOURCES = threads-execve.c +threads_execve_OBJECTS = threads-execve.$(OBJEXT) +threads_execve_DEPENDENCIES = $(LDADD) +time_SOURCES = time.c +time_OBJECTS = time.$(OBJEXT) +time_LDADD = $(LDADD) +time_DEPENDENCIES = libtests.a +timer_create_SOURCES = timer_create.c +timer_create_OBJECTS = timer_create.$(OBJEXT) +timer_create_LDADD = $(LDADD) +timer_create_DEPENDENCIES = libtests.a +timer_xettime_SOURCES = timer_xettime.c +timer_xettime_OBJECTS = timer_xettime.$(OBJEXT) +timer_xettime_LDADD = $(LDADD) +timer_xettime_DEPENDENCIES = libtests.a +timerfd_xettime_SOURCES = timerfd_xettime.c +timerfd_xettime_OBJECTS = timerfd_xettime.$(OBJEXT) +timerfd_xettime_LDADD = $(LDADD) +timerfd_xettime_DEPENDENCIES = libtests.a +times_SOURCES = times.c +times_OBJECTS = times.$(OBJEXT) +times_DEPENDENCIES = $(LDADD) +times_fail_SOURCES = times-fail.c +times_fail_OBJECTS = times-fail.$(OBJEXT) +times_fail_LDADD = $(LDADD) +times_fail_DEPENDENCIES = libtests.a +truncate_SOURCES = truncate.c +truncate_OBJECTS = truncate.$(OBJEXT) +truncate_LDADD = $(LDADD) +truncate_DEPENDENCIES = libtests.a +truncate64_SOURCES = truncate64.c +truncate64_OBJECTS = truncate64-truncate64.$(OBJEXT) +truncate64_LDADD = $(LDADD) +truncate64_DEPENDENCIES = libtests.a +ugetrlimit_SOURCES = ugetrlimit.c +ugetrlimit_OBJECTS = ugetrlimit.$(OBJEXT) +ugetrlimit_LDADD = $(LDADD) +ugetrlimit_DEPENDENCIES = libtests.a uio_SOURCES = uio.c uio_OBJECTS = uio-uio.$(OBJEXT) uio_LDADD = $(LDADD) -uio_LINK = $(CCLD) $(uio_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ - $@ +uio_DEPENDENCIES = libtests.a +umask_SOURCES = umask.c +umask_OBJECTS = umask.$(OBJEXT) +umask_LDADD = $(LDADD) +umask_DEPENDENCIES = libtests.a +umount_SOURCES = umount.c +umount_OBJECTS = umount.$(OBJEXT) +umount_LDADD = $(LDADD) +umount_DEPENDENCIES = libtests.a +umount2_SOURCES = umount2.c +umount2_OBJECTS = umount2.$(OBJEXT) +umount2_LDADD = $(LDADD) +umount2_DEPENDENCIES = libtests.a +umoven_illptr_SOURCES = umoven-illptr.c +umoven_illptr_OBJECTS = umoven-illptr.$(OBJEXT) +umoven_illptr_LDADD = $(LDADD) +umoven_illptr_DEPENDENCIES = libtests.a +umovestr_SOURCES = umovestr.c +umovestr_OBJECTS = umovestr.$(OBJEXT) +umovestr_LDADD = $(LDADD) +umovestr_DEPENDENCIES = libtests.a +umovestr_illptr_SOURCES = umovestr-illptr.c +umovestr_illptr_OBJECTS = umovestr-illptr.$(OBJEXT) +umovestr_illptr_LDADD = $(LDADD) +umovestr_illptr_DEPENDENCIES = libtests.a +umovestr2_SOURCES = umovestr2.c +umovestr2_OBJECTS = umovestr2.$(OBJEXT) +umovestr2_LDADD = $(LDADD) +umovestr2_DEPENDENCIES = libtests.a +umovestr3_SOURCES = umovestr3.c +umovestr3_OBJECTS = umovestr3.$(OBJEXT) +umovestr3_LDADD = $(LDADD) +umovestr3_DEPENDENCIES = libtests.a +uname_SOURCES = uname.c +uname_OBJECTS = uname.$(OBJEXT) +uname_LDADD = $(LDADD) +uname_DEPENDENCIES = libtests.a +unix_pair_send_recv_SOURCES = unix-pair-send-recv.c +unix_pair_send_recv_OBJECTS = unix-pair-send-recv.$(OBJEXT) +unix_pair_send_recv_LDADD = $(LDADD) +unix_pair_send_recv_DEPENDENCIES = libtests.a +unix_pair_sendto_recvfrom_SOURCES = unix-pair-sendto-recvfrom.c +unix_pair_sendto_recvfrom_OBJECTS = \ + unix-pair-sendto-recvfrom.$(OBJEXT) +unix_pair_sendto_recvfrom_LDADD = $(LDADD) +unix_pair_sendto_recvfrom_DEPENDENCIES = libtests.a +unlink_SOURCES = unlink.c +unlink_OBJECTS = unlink.$(OBJEXT) +unlink_LDADD = $(LDADD) +unlink_DEPENDENCIES = libtests.a +unlinkat_SOURCES = unlinkat.c +unlinkat_OBJECTS = unlinkat.$(OBJEXT) +unlinkat_LDADD = $(LDADD) +unlinkat_DEPENDENCIES = libtests.a +unshare_SOURCES = unshare.c +unshare_OBJECTS = unshare.$(OBJEXT) +unshare_LDADD = $(LDADD) +unshare_DEPENDENCIES = libtests.a +userfaultfd_SOURCES = userfaultfd.c +userfaultfd_OBJECTS = userfaultfd.$(OBJEXT) +userfaultfd_LDADD = $(LDADD) +userfaultfd_DEPENDENCIES = libtests.a +ustat_SOURCES = ustat.c +ustat_OBJECTS = ustat.$(OBJEXT) +ustat_LDADD = $(LDADD) +ustat_DEPENDENCIES = libtests.a +utime_SOURCES = utime.c +utime_OBJECTS = utime.$(OBJEXT) +utime_LDADD = $(LDADD) +utime_DEPENDENCIES = libtests.a +utimensat_SOURCES = utimensat.c +utimensat_OBJECTS = utimensat.$(OBJEXT) +utimensat_LDADD = $(LDADD) +utimensat_DEPENDENCIES = libtests.a +utimes_SOURCES = utimes.c +utimes_OBJECTS = utimes.$(OBJEXT) +utimes_LDADD = $(LDADD) +utimes_DEPENDENCIES = libtests.a +vfork_f_SOURCES = vfork-f.c +vfork_f_OBJECTS = vfork-f.$(OBJEXT) +vfork_f_LDADD = $(LDADD) +vfork_f_DEPENDENCIES = libtests.a +vhangup_SOURCES = vhangup.c +vhangup_OBJECTS = vhangup.$(OBJEXT) +vhangup_LDADD = $(LDADD) +vhangup_DEPENDENCIES = libtests.a +vmsplice_SOURCES = vmsplice.c +vmsplice_OBJECTS = vmsplice.$(OBJEXT) +vmsplice_LDADD = $(LDADD) +vmsplice_DEPENDENCIES = libtests.a +wait4_SOURCES = wait4.c +wait4_OBJECTS = wait4.$(OBJEXT) +wait4_LDADD = $(LDADD) +wait4_DEPENDENCIES = libtests.a +wait4_v_SOURCES = wait4-v.c +wait4_v_OBJECTS = wait4-v.$(OBJEXT) +wait4_v_LDADD = $(LDADD) +wait4_v_DEPENDENCIES = libtests.a +waitid_SOURCES = waitid.c +waitid_OBJECTS = waitid.$(OBJEXT) +waitid_LDADD = $(LDADD) +waitid_DEPENDENCIES = libtests.a +waitid_v_SOURCES = waitid-v.c +waitid_v_OBJECTS = waitid-v.$(OBJEXT) +waitid_v_LDADD = $(LDADD) +waitid_v_DEPENDENCIES = libtests.a +waitpid_SOURCES = waitpid.c +waitpid_OBJECTS = waitpid.$(OBJEXT) +waitpid_LDADD = $(LDADD) +waitpid_DEPENDENCIES = libtests.a +xattr_SOURCES = xattr.c +xattr_OBJECTS = xattr.$(OBJEXT) +xattr_LDADD = $(LDADD) +xattr_DEPENDENCIES = libtests.a +xattr_strings_SOURCES = xattr-strings.c +xattr_strings_OBJECTS = xattr-strings.$(OBJEXT) +xattr_strings_LDADD = $(LDADD) +xattr_strings_DEPENDENCIES = libtests.a +xet_robust_list_SOURCES = xet_robust_list.c +xet_robust_list_OBJECTS = xet_robust_list.$(OBJEXT) +xet_robust_list_LDADD = $(LDADD) +xet_robust_list_DEPENDENCIES = libtests.a +xetitimer_SOURCES = xetitimer.c +xetitimer_OBJECTS = xetitimer.$(OBJEXT) +xetitimer_LDADD = $(LDADD) +xetitimer_DEPENDENCIES = libtests.a +xetpgid_SOURCES = xetpgid.c +xetpgid_OBJECTS = xetpgid.$(OBJEXT) +xetpgid_LDADD = $(LDADD) +xetpgid_DEPENDENCIES = libtests.a +xetpriority_SOURCES = xetpriority.c +xetpriority_OBJECTS = xetpriority.$(OBJEXT) +xetpriority_LDADD = $(LDADD) +xetpriority_DEPENDENCIES = libtests.a +xettimeofday_SOURCES = xettimeofday.c +xettimeofday_OBJECTS = xettimeofday.$(OBJEXT) +xettimeofday_LDADD = $(LDADD) +xettimeofday_DEPENDENCIES = libtests.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -130,7 +1815,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -150,15 +1835,182 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = net-accept-connect.c scm_rights.c set_ptracer_any.c \ - sigaction.c $(stack_fcall_SOURCES) uio.c -DIST_SOURCES = net-accept-connect.c scm_rights.c set_ptracer_any.c \ - sigaction.c $(stack_fcall_SOURCES) uio.c +SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ + access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ + attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ + attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ + chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ + clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ + creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ + epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ + erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ + execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ + fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ + fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ + finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ + fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ + futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ + getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ + geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ + getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ + getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ + init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ + ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ + ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ + ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ + ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ + kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ + lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ + migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ + mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ + msg_control.c msg_control-v.c msg_name.c munlockall.c \ + nanosleep.c net-accept-connect.c net-icmp_filter.c \ + net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ + net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ + netlink_protocol.c netlink_unix_diag.c newfstatat.c \ + nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ + oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ + perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ + personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ + pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + prctl-dumpable.c prctl-name.c prctl-no-args.c \ + prctl-pdeathsig.c prctl-seccomp-filter-v.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ + prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ + preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ + process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + pwritev.c qual_fault.c qual_inject-error-signal.c \ + qual_inject-retval.c qual_inject-signal.c qual_signal.c \ + quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ + read-write.c readahead.c readdir.c readlink.c readlinkat.c \ + readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ + redirect-fds.c remap_file_pages.c rename.c renameat.c \ + renameat2.c request_key.c restart_syscall.c rmdir.c \ + rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + sched_get_priority_mxx.c sched_rr_get_interval.c \ + sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ + sched_xetscheduler.c sched_yield.c scm_rights.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ + semop.c sendfile.c sendfile64.c set_mempolicy.c \ + set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ + setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ + setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ + setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ + setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ + shutdown.c sigaction.c sigaltstack.c siginfo.c \ + signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ + splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ + statfs64.c swap.c symlink.c symlinkat.c sync.c \ + sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ + threads-execve.c time.c timer_create.c timer_xettime.c \ + timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ + ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ + umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ + unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ + utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ + waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ + xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c +DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ + access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ + attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ + attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ + chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ + clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ + creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ + epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ + erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ + execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ + fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ + fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ + finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ + fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ + futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ + getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ + geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ + getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ + getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ + init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ + ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ + ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ + ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ + ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ + kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ + lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ + migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ + mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ + msg_control.c msg_control-v.c msg_name.c munlockall.c \ + nanosleep.c net-accept-connect.c net-icmp_filter.c \ + net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ + net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ + netlink_protocol.c netlink_unix_diag.c newfstatat.c \ + nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ + oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ + perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ + personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ + pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + prctl-dumpable.c prctl-name.c prctl-no-args.c \ + prctl-pdeathsig.c prctl-seccomp-filter-v.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ + prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ + preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ + process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + pwritev.c qual_fault.c qual_inject-error-signal.c \ + qual_inject-retval.c qual_inject-signal.c qual_signal.c \ + quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ + read-write.c readahead.c readdir.c readlink.c readlinkat.c \ + readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ + redirect-fds.c remap_file_pages.c rename.c renameat.c \ + renameat2.c request_key.c restart_syscall.c rmdir.c \ + rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + sched_get_priority_mxx.c sched_rr_get_interval.c \ + sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ + sched_xetscheduler.c sched_yield.c scm_rights.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ + semop.c sendfile.c sendfile64.c set_mempolicy.c \ + set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ + setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ + setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ + setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ + setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ + shutdown.c sigaction.c sigaltstack.c siginfo.c \ + signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ + splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ + statfs64.c swap.c symlink.c symlinkat.c sync.c \ + sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ + threads-execve.c time.c timer_create.c timer_xettime.c \ + timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ + ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ + umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ + unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ + utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ + waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ + xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = check-valgrind-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -362,6 +2214,7 @@ am__set_TESTS_bases = \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck +@USE_LIBUNWIND_TRUE@am__EXEEXT_1 = strace-k.test TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test am__test_logs1 = $(TESTS:=.log) @@ -388,31 +2241,52 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ CYGPATH_W = @CYGPATH_W@ +DEB_CHANGELOGTIME = @DEB_CHANGELOGTIME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ EXEEXT = @EXEEXT@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MIPS_ABI = @MIPS_ABI@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -424,22 +2298,31 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +RANLIB = @RANLIB@ +RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ arch = @arch@ +arch_m32 = @arch_m32@ +arch_mx32 = @arch_mx32@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -449,6 +2332,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +dl_LIBS = @dl_LIBS@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -483,35 +2367,553 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +OS = linux +ARCH = @arch@ +MPERS_NAME = +ARCH_MFLAGS = AM_CFLAGS = $(WARN_CFLAGS) -uio_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64 +AM_CPPFLAGS = $(ARCH_MFLAGS) \ + -I$(builddir) \ + -I$(top_builddir)/$(OS)/$(ARCH) \ + -I$(top_srcdir)/$(OS)/$(ARCH) \ + -I$(top_builddir)/$(OS) \ + -I$(top_srcdir)/$(OS) \ + -I$(top_builddir) \ + -I$(top_srcdir) + +AM_LDFLAGS = $(ARCH_MFLAGS) +libtests_a_SOURCES = \ + errno2name.c \ + error_msg.c \ + fill_memory.c \ + get_page_size.c \ + hexdump_strdup.c \ + hexquote_strndup.c \ + inode_of_sockfd.c \ + libmmsg.c \ + libsocketcall.c \ + overflowuid.c \ + pipe_maxfd.c \ + print_quoted_string.c \ + printflags.c \ + printxval.c \ + signal2name.c \ + sprintrc.c \ + tail_alloc.c \ + tests.h \ + tprintf.c \ + # end of libtests_a_SOURCES + +libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +check_LIBRARIES = libtests.a +LDADD = libtests.a +attach_f_p_LDADD = -lrt -lpthread $(LDADD) +clock_xettime_LDADD = -lrt $(LDADD) +count_f_LDADD = -lpthread $(LDADD) +filter_unavailable_LDADD = -lpthread $(LDADD) +fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = -lrt $(LDADD) +mq_sendrecv_LDADD = -lrt $(LDADD) +mq_sendrecv_read_LDADD = -lrt $(LDADD) +mq_sendrecv_write_LDADD = -lrt $(LDADD) +newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pc_LDADD = $(dl_LIBS) $(LDADD) +pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +threads_execve_LDADD = -lrt -lpthread $(LDADD) +times_LDADD = -lrt $(LDADD) +truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -TESTS = \ - ptrace_setoptions.test \ - strace-f.test \ - qual_syscall.test \ +@USE_LIBUNWIND_FALSE@LIBUNWIND_TESTS = +@USE_LIBUNWIND_TRUE@LIBUNWIND_TESTS = strace-k.test +DECODER_TESTS = \ + _newselect.test \ + accept.test \ + accept4.test \ + access.test \ + acct.test \ + add_key.test \ + adjtimex.test \ + aio.test \ + alarm.test \ + bpf.test \ + brk.test \ + btrfs-v.test \ + btrfs-vw.test \ + btrfs-w.test \ + btrfs.test \ + caps-abbrev.test \ + caps.test \ + chmod.test \ + chown.test \ + chown32.test \ + chroot.test \ + clock_adjtime.test \ + clock_nanosleep.test \ + clock_xettime.test \ + copy_file_range.test \ + creat.test \ + delete_module.test \ + dup.test \ + dup2.test \ + dup3.test \ + epoll_create.test \ + epoll_create1.test \ + epoll_ctl.test \ + epoll_pwait.test \ + epoll_wait.test \ + erestartsys.test \ + eventfd.test \ + execve-v.test \ + execve.test \ + execveat-v.test \ + execveat.test \ + faccessat.test \ + fadvise64.test \ + fadvise64_64.test \ + fallocate.test \ + fanotify_init.test \ + fanotify_mark.test \ + fchdir.test \ + fchmod.test \ + fchmodat.test \ + fchown.test \ + fchown32.test \ + fchownat.test \ + fcntl.test \ + fcntl64.test \ + fdatasync.test \ + file_handle.test \ + file_ioctl.test \ + finit_module.test \ + flock.test \ + fstat.test \ + fstat64.test \ + fstatat64.test \ + fstatfs.test \ + fstatfs64.test \ + fsync.test \ + ftruncate.test \ + ftruncate64.test \ + futex.test \ + futimesat.test \ + get_mempolicy.test \ + getcpu.test \ + getcwd.test \ + getdents.test \ + getdents64.test \ + getegid.test \ + getegid32.test \ + geteuid.test \ + geteuid32.test \ + getgid.test \ + getgid32.test \ + getgroups.test \ + getgroups32.test \ + getpeername.test \ + getpgrp.test \ + getrandom.test \ + getresgid.test \ + getresgid32.test \ + getresuid.test \ + getresuid32.test \ + getrlimit.test \ + getrusage.test \ + getsid.test \ + getsockname.test \ + getuid.test \ + getuid32.test \ + getxxid.test \ + inet-cmsg.test \ + init_module.test \ + inotify.test \ + inotify_init1.test \ + ioctl.test \ + ioctl_block.test \ + ioctl_dm-v.test \ + ioctl_dm.test \ + ioctl_evdev-v.test \ + ioctl_evdev.test \ + ioctl_loop-nv.test \ + ioctl_loop-v.test \ + ioctl_loop.test \ + ioctl_mtd.test \ + ioctl_rtc-v.test \ + ioctl_rtc.test \ + ioctl_scsi.test \ + ioctl_sg_io_v3.test \ + ioctl_sg_io_v4.test \ + ioctl_sock_gifconf.test \ + ioctl_uffdio.test \ + ioctl_v4l2.test \ + ioperm.test \ + iopl.test \ + ioprio.test \ + ip_mreq.test \ + ipc.test \ + ipc_msg.test \ + ipc_msgbuf.test \ + ipc_sem.test \ + ipc_shm.test \ + kcmp.test \ + kexec_file_load.test \ + kexec_load.test \ + keyctl.test \ + kill.test \ + lchown.test \ + lchown32.test \ + link.test \ + linkat.test \ + llseek.test \ + lookup_dcookie.test \ + lseek.test \ + lstat.test \ + lstat64.test \ + mbind.test \ + membarrier.test \ + memfd_create.test \ + migrate_pages.test \ + mincore.test \ + mkdir.test \ + mkdirat.test \ + mknod.test \ + mknodat.test \ + mlock.test \ + mlock2.test \ + mlockall.test \ + mmap.test \ + mmap64.test \ + mmsg-silent.test \ + mmsg.test \ + mmsg_name-v.test \ + mmsg_name.test \ + mount.test \ + move_pages.test \ + mq.test \ + mq_sendrecv-read.test \ + mq_sendrecv-write.test \ + mq_sendrecv.test \ + msg_control-v.test \ + msg_control.test \ + msg_name.test \ + munlockall.test \ + nanosleep.test \ + net-icmp_filter.test \ + net-sockaddr.test \ + net-y-unix.test \ + net-yy-inet.test \ + net-yy-netlink.test \ + net-yy-unix.test \ + net.test \ + netlink_protocol.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ + oldfstat.test \ + oldlstat.test \ + oldselect.test \ + oldstat.test \ + open.test \ + openat.test \ + pause.test \ + perf_event_open.test \ + perf_event_open_nonverbose.test \ + perf_event_open_unabbrev.test \ + personality.test \ + pipe.test \ + pipe2.test \ + pkey_alloc.test \ + pkey_free.test \ + pkey_mprotect.test \ + poll.test \ + ppoll.test \ + prctl-arg2-intptr.test \ + prctl-dumpable.test \ + prctl-name.test \ + prctl-no-args.test \ + prctl-pdeathsig.test \ + prctl-seccomp-filter-v.test \ + prctl-seccomp-strict.test \ + prctl-securebits.test \ + prctl-tid_address.test \ + prctl-tsc.test \ + pread64-pwrite64.test \ + preadv-pwritev.test \ + preadv.test \ + preadv2-pwritev2.test \ + printstr.test \ + prlimit64.test \ + process_vm_readv.test \ + process_vm_writev.test \ + pselect6.test \ + ptrace.test \ + pwritev.test \ + qual_fault-exit_group.test \ + quotactl-v.test \ + quotactl-xfs-v.test \ + quotactl-xfs.test \ + quotactl.test \ + read-write.test \ + readahead.test \ + readdir.test \ + readlink.test \ + readlinkat.test \ + readv.test \ + reboot.test \ + recvfrom.test \ + recvmmsg-timeout.test \ + recvmsg.test \ + remap_file_pages.test \ + rename.test \ + renameat.test \ + renameat2.test \ + request_key.test \ + rmdir.test \ + rt_sigpending.test \ + rt_sigprocmask.test \ + rt_sigqueueinfo.test \ + rt_sigsuspend.test \ + rt_sigtimedwait.test \ + rt_tgsigqueueinfo.test \ + sched_get_priority_mxx.test \ + sched_rr_get_interval.test \ + sched_xetaffinity.test \ + sched_xetattr.test \ + sched_xetparam.test \ + sched_xetscheduler.test \ + sched_yield.test \ scm_rights-fd.test \ + seccomp-filter-v.test \ + seccomp-filter.test \ + seccomp-strict.test \ + select.test \ + semop.test \ + sendfile.test \ + sendfile64.test \ + set_mempolicy.test \ + setdomainname.test \ + setfsgid.test \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ + setgid.test \ + setgid32.test \ + setgroups.test \ + setgroups32.test \ + sethostname.test \ + setns.test \ + setregid.test \ + setregid32.test \ + setresgid.test \ + setresgid32.test \ + setresuid.test \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ + setrlimit.test \ + setuid.test \ + setuid32.test \ + shmxt.test \ + shutdown.test \ sigaction.test \ + sigaltstack.test \ + siginfo.test \ + signalfd4.test \ + sigreturn.test \ + socketcall.test \ + splice.test \ stat.test \ - net.test \ - net-fd.test \ + stat64.test \ + statfs.test \ + statfs64.test \ + sun_path.test \ + swap.test \ + symlink.test \ + symlinkat.test \ + sync.test \ + sync_file_range.test \ + sync_file_range2.test \ + sysinfo.test \ + syslog.test \ + tee.test \ + time.test \ + timer_create.test \ + timer_xettime.test \ + timerfd_xettime.test \ + times-fail.test \ + times.test \ + truncate.test \ + truncate64.test \ + ugetrlimit.test \ uio.test \ + umask.test \ + umount.test \ + umount2.test \ + umoven-illptr.test \ + umovestr-illptr.test \ + umovestr.test \ + umovestr2.test \ + umovestr3.test \ + uname.test \ + unix-pair-send-recv.test \ + unix-pair-sendto-recvfrom.test \ + unlink.test \ + unlinkat.test \ + unshare.test \ + userfaultfd.test \ + ustat.test \ + utime.test \ + utimensat.test \ + utimes.test \ + vhangup.test \ + vmsplice.test \ + wait4-v.test \ + wait4.test \ + waitid-v.test \ + waitid.test \ + waitpid.test \ + xattr-strings.test \ + xattr.test \ + xet_robust_list.test \ + xetitimer.test \ + xetpgid.test \ + xetpriority.test \ + xettimeofday.test \ + # end of DECODER_TESTS + +MISC_TESTS = \ + attach-f-p.test \ + attach-p-cmd.test \ + bexecve.test \ + count-f.test \ count.test \ + detach-running.test \ detach-sleeping.test \ detach-stopped.test \ - detach-running.test \ - strace-k.test + filter-unavailable.test \ + fork-f.test \ + ksysent.test \ + opipe.test \ + options-syntax.test \ + pc.test \ + qual_fault-syntax.test \ + qual_fault.test \ + qual_inject-error-signal.test \ + qual_inject-retval.test \ + qual_inject-signal.test \ + qual_inject-syntax.test \ + qual_signal.test \ + qual_syscall.test \ + redirect-fds.test \ + redirect.test \ + restart_syscall.test \ + signal_receive.test \ + strace-C.test \ + strace-E.test \ + strace-S.test \ + strace-T.test \ + strace-V.test \ + strace-ff.test \ + strace-r.test \ + strace-t.test \ + strace-tt.test \ + strace-ttt.test \ + threads-execve.test \ + vfork-f.test \ + # end of MISC_TESTS + +XFAIL_TESTS_ = +XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +TEST_LOG_COMPILER = env +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +VALGRIND_FLAGS = --quiet +VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp +EXTRA_DIST = init.sh run.sh match.awk \ + caps-abbrev.awk \ + caps.awk \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + getresugid.c \ + init_delete_module.h \ + ipc.sh \ + ipc_msgbuf.expected \ + ksysent.sed \ + lstatx.c \ + net.expected \ + oldselect.expected \ + pipe.expected \ + ppoll-v.expected \ + ppoll.expected \ + process_vm_readv_writev.c \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + quotactl.h \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaction.awk \ + sigaltstack.expected \ + sockname.c \ + statfs.expected \ + statx.sh \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + struct_flock.c \ + sun_path.expected \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + $(TESTS) + +objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) +CLEANFILES = ksysent.h $(TESTS:=.tmp) syscallent.i scno.h +SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -TEST_LOG_COMPILER = $(srcdir)/run.sh -EXTRA_DIST = init.sh run.sh sigaction.awk $(TESTS) -CLEANFILES = $(TESTS:=.tmp) +digits = [[:digit:]][[:digit:]]* +al_nums = [[:alnum:]_][[:alnum:]_]* +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p all: all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../scno.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -532,6 +2934,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/../scno.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -542,279 +2945,2580 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-checkLIBRARIES: + -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) + +libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) + $(AM_V_at)-rm -f libtests.a + $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) + $(AM_V_at)$(RANLIB) libtests.a + clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) -net-accept-connect$(EXEEXT): $(net_accept_connect_OBJECTS) $(net_accept_connect_DEPENDENCIES) $(EXTRA_net_accept_connect_DEPENDENCIES) - @rm -f net-accept-connect$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(net_accept_connect_OBJECTS) $(net_accept_connect_LDADD) $(LIBS) +_newselect$(EXEEXT): $(_newselect_OBJECTS) $(_newselect_DEPENDENCIES) $(EXTRA__newselect_DEPENDENCIES) + @rm -f _newselect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(_newselect_OBJECTS) $(_newselect_LDADD) $(LIBS) -scm_rights$(EXEEXT): $(scm_rights_OBJECTS) $(scm_rights_DEPENDENCIES) $(EXTRA_scm_rights_DEPENDENCIES) - @rm -f scm_rights$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(scm_rights_OBJECTS) $(scm_rights_LDADD) $(LIBS) +accept$(EXEEXT): $(accept_OBJECTS) $(accept_DEPENDENCIES) $(EXTRA_accept_DEPENDENCIES) + @rm -f accept$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(accept_OBJECTS) $(accept_LDADD) $(LIBS) -set_ptracer_any$(EXEEXT): $(set_ptracer_any_OBJECTS) $(set_ptracer_any_DEPENDENCIES) $(EXTRA_set_ptracer_any_DEPENDENCIES) - @rm -f set_ptracer_any$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(set_ptracer_any_OBJECTS) $(set_ptracer_any_LDADD) $(LIBS) +accept4$(EXEEXT): $(accept4_OBJECTS) $(accept4_DEPENDENCIES) $(EXTRA_accept4_DEPENDENCIES) + @rm -f accept4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(accept4_OBJECTS) $(accept4_LDADD) $(LIBS) -sigaction$(EXEEXT): $(sigaction_OBJECTS) $(sigaction_DEPENDENCIES) $(EXTRA_sigaction_DEPENDENCIES) - @rm -f sigaction$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(sigaction_OBJECTS) $(sigaction_LDADD) $(LIBS) +access$(EXEEXT): $(access_OBJECTS) $(access_DEPENDENCIES) $(EXTRA_access_DEPENDENCIES) + @rm -f access$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(access_OBJECTS) $(access_LDADD) $(LIBS) -stack-fcall$(EXEEXT): $(stack_fcall_OBJECTS) $(stack_fcall_DEPENDENCIES) $(EXTRA_stack_fcall_DEPENDENCIES) - @rm -f stack-fcall$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) +acct$(EXEEXT): $(acct_OBJECTS) $(acct_DEPENDENCIES) $(EXTRA_acct_DEPENDENCIES) + @rm -f acct$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(acct_OBJECTS) $(acct_LDADD) $(LIBS) -uio$(EXEEXT): $(uio_OBJECTS) $(uio_DEPENDENCIES) $(EXTRA_uio_DEPENDENCIES) - @rm -f uio$(EXEEXT) - $(AM_V_CCLD)$(uio_LINK) $(uio_OBJECTS) $(uio_LDADD) $(LIBS) +add_key$(EXEEXT): $(add_key_OBJECTS) $(add_key_DEPENDENCIES) $(EXTRA_add_key_DEPENDENCIES) + @rm -f add_key$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(add_key_OBJECTS) $(add_key_LDADD) $(LIBS) -mostlyclean-compile: - -rm -f *.$(OBJEXT) +adjtimex$(EXEEXT): $(adjtimex_OBJECTS) $(adjtimex_DEPENDENCIES) $(EXTRA_adjtimex_DEPENDENCIES) + @rm -f adjtimex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(adjtimex_OBJECTS) $(adjtimex_LDADD) $(LIBS) -distclean-compile: - -rm -f *.tab.c +aio$(EXEEXT): $(aio_OBJECTS) $(aio_DEPENDENCIES) $(EXTRA_aio_DEPENDENCIES) + @rm -f aio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aio_OBJECTS) $(aio_LDADD) $(LIBS) -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ +alarm$(EXEEXT): $(alarm_OBJECTS) $(alarm_DEPENDENCIES) $(EXTRA_alarm_DEPENDENCIES) + @rm -f alarm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(alarm_OBJECTS) $(alarm_LDADD) $(LIBS) -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +answer$(EXEEXT): $(answer_OBJECTS) $(answer_DEPENDENCIES) $(EXTRA_answer_DEPENDENCIES) + @rm -f answer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(answer_OBJECTS) $(answer_LDADD) $(LIBS) -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +attach-f-p$(EXEEXT): $(attach_f_p_OBJECTS) $(attach_f_p_DEPENDENCIES) $(EXTRA_attach_f_p_DEPENDENCIES) + @rm -f attach-f-p$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_f_p_OBJECTS) $(attach_f_p_LDADD) $(LIBS) -uio-uio.o: uio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uio_CFLAGS) $(CFLAGS) -MT uio-uio.o -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uio_CFLAGS) $(CFLAGS) -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c +attach-f-p-cmd$(EXEEXT): $(attach_f_p_cmd_OBJECTS) $(attach_f_p_cmd_DEPENDENCIES) $(EXTRA_attach_f_p_cmd_DEPENDENCIES) + @rm -f attach-f-p-cmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_f_p_cmd_OBJECTS) $(attach_f_p_cmd_LDADD) $(LIBS) -uio-uio.obj: uio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uio_CFLAGS) $(CFLAGS) -MT uio-uio.obj -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uio_CFLAGS) $(CFLAGS) -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` +attach-p-cmd-cmd$(EXEEXT): $(attach_p_cmd_cmd_OBJECTS) $(attach_p_cmd_cmd_DEPENDENCIES) $(EXTRA_attach_p_cmd_cmd_DEPENDENCIES) + @rm -f attach-p-cmd-cmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_p_cmd_cmd_OBJECTS) $(attach_p_cmd_cmd_LDADD) $(LIBS) -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags +attach-p-cmd-p$(EXEEXT): $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_DEPENDENCIES) $(EXTRA_attach_p_cmd_p_DEPENDENCIES) + @rm -f attach-p-cmd-p$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_LDADD) $(LIBS) -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am +bpf$(EXEEXT): $(bpf_OBJECTS) $(bpf_DEPENDENCIES) $(EXTRA_bpf_DEPENDENCIES) + @rm -f bpf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_OBJECTS) $(bpf_LDADD) $(LIBS) -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique +brk$(EXEEXT): $(brk_OBJECTS) $(brk_DEPENDENCIES) $(EXTRA_brk_DEPENDENCIES) + @rm -f brk$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(brk_OBJECTS) $(brk_LDADD) $(LIBS) -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am +btrfs$(EXEEXT): $(btrfs_OBJECTS) $(btrfs_DEPENDENCIES) $(EXTRA_btrfs_DEPENDENCIES) + @rm -f btrfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(btrfs_OBJECTS) $(btrfs_LDADD) $(LIBS) -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files +caps$(EXEEXT): $(caps_OBJECTS) $(caps_DEPENDENCIES) $(EXTRA_caps_DEPENDENCIES) + @rm -f caps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(caps_OBJECTS) $(caps_LDADD) $(LIBS) -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +caps-abbrev$(EXEEXT): $(caps_abbrev_OBJECTS) $(caps_abbrev_DEPENDENCIES) $(EXTRA_caps_abbrev_DEPENDENCIES) + @rm -f caps-abbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(caps_abbrev_OBJECTS) $(caps_abbrev_LDADD) $(LIBS) -# Recover from deleted '.trs' file; this should ensure that -# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create -# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells -# to avoid problems with "make -n". -.log.trs: - rm -f $< $@ - $(MAKE) $(AM_MAKEFLAGS) $< +chmod$(EXEEXT): $(chmod_OBJECTS) $(chmod_DEPENDENCIES) $(EXTRA_chmod_DEPENDENCIES) + @rm -f chmod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) -# Leading 'am--fnord' is there to ensure the list of targets does not -# expand to empty, as could happen e.g. with make check TESTS=''. -am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) -am--force-recheck: - @: +chown$(EXEEXT): $(chown_OBJECTS) $(chown_DEPENDENCIES) $(EXTRA_chown_DEPENDENCIES) + @rm -f chown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chown_OBJECTS) $(chown_LDADD) $(LIBS) -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - if test -n "$$redo_bases"; then \ - redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ - redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ - if $(am__make_dryrun); then :; else \ - rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ - fi; \ - fi; \ - if test -n "$$am__remaking_logs"; then \ - echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ - "recursion detected" >&2; \ - else \ - am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ - fi; \ - if $(am__make_dryrun); then :; else \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; \ - fi - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done \ - | $(am__create_global_log); \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ - fi; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 +chown32$(EXEEXT): $(chown32_OBJECTS) $(chown32_DEPENDENCIES) $(EXTRA_chown32_DEPENDENCIES) + @rm -f chown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chown32_OBJECTS) $(chown32_LDADD) $(LIBS) -check-TESTS: - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -recheck: all $(check_PROGRAMS) - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - bases=`for i in $$bases; do echo $$i; done \ - | $(am__list_recheck_tests)` || exit 1; \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ - am__force_recheck=am--force-recheck \ - TEST_LOGS="$$log_list"; \ - exit $$? -.test.log: - @p='$<'; \ - $(am__set_b); \ - $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -@am__EXEEXT_TRUE@.test$(EXEEXT).log: +chroot$(EXEEXT): $(chroot_OBJECTS) $(chroot_DEPENDENCIES) $(EXTRA_chroot_DEPENDENCIES) + @rm -f chroot$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chroot_OBJECTS) $(chroot_LDADD) $(LIBS) + +clock_adjtime$(EXEEXT): $(clock_adjtime_OBJECTS) $(clock_adjtime_DEPENDENCIES) $(EXTRA_clock_adjtime_DEPENDENCIES) + @rm -f clock_adjtime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_adjtime_OBJECTS) $(clock_adjtime_LDADD) $(LIBS) + +clock_nanosleep$(EXEEXT): $(clock_nanosleep_OBJECTS) $(clock_nanosleep_DEPENDENCIES) $(EXTRA_clock_nanosleep_DEPENDENCIES) + @rm -f clock_nanosleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_nanosleep_OBJECTS) $(clock_nanosleep_LDADD) $(LIBS) + +clock_xettime$(EXEEXT): $(clock_xettime_OBJECTS) $(clock_xettime_DEPENDENCIES) $(EXTRA_clock_xettime_DEPENDENCIES) + @rm -f clock_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clock_xettime_OBJECTS) $(clock_xettime_LDADD) $(LIBS) + +copy_file_range$(EXEEXT): $(copy_file_range_OBJECTS) $(copy_file_range_DEPENDENCIES) $(EXTRA_copy_file_range_DEPENDENCIES) + @rm -f copy_file_range$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(copy_file_range_OBJECTS) $(copy_file_range_LDADD) $(LIBS) + +count-f$(EXEEXT): $(count_f_OBJECTS) $(count_f_DEPENDENCIES) $(EXTRA_count_f_DEPENDENCIES) + @rm -f count-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(count_f_OBJECTS) $(count_f_LDADD) $(LIBS) + +creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIES) + @rm -f creat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS) + +delete_module$(EXEEXT): $(delete_module_OBJECTS) $(delete_module_DEPENDENCIES) $(EXTRA_delete_module_DEPENDENCIES) + @rm -f delete_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(delete_module_OBJECTS) $(delete_module_LDADD) $(LIBS) + +dup$(EXEEXT): $(dup_OBJECTS) $(dup_DEPENDENCIES) $(EXTRA_dup_DEPENDENCIES) + @rm -f dup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup_OBJECTS) $(dup_LDADD) $(LIBS) + +dup2$(EXEEXT): $(dup2_OBJECTS) $(dup2_DEPENDENCIES) $(EXTRA_dup2_DEPENDENCIES) + @rm -f dup2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup2_OBJECTS) $(dup2_LDADD) $(LIBS) + +dup3$(EXEEXT): $(dup3_OBJECTS) $(dup3_DEPENDENCIES) $(EXTRA_dup3_DEPENDENCIES) + @rm -f dup3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dup3_OBJECTS) $(dup3_LDADD) $(LIBS) + +epoll_create$(EXEEXT): $(epoll_create_OBJECTS) $(epoll_create_DEPENDENCIES) $(EXTRA_epoll_create_DEPENDENCIES) + @rm -f epoll_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_create_OBJECTS) $(epoll_create_LDADD) $(LIBS) + +epoll_create1$(EXEEXT): $(epoll_create1_OBJECTS) $(epoll_create1_DEPENDENCIES) $(EXTRA_epoll_create1_DEPENDENCIES) + @rm -f epoll_create1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_create1_OBJECTS) $(epoll_create1_LDADD) $(LIBS) + +epoll_ctl$(EXEEXT): $(epoll_ctl_OBJECTS) $(epoll_ctl_DEPENDENCIES) $(EXTRA_epoll_ctl_DEPENDENCIES) + @rm -f epoll_ctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_ctl_OBJECTS) $(epoll_ctl_LDADD) $(LIBS) + +epoll_pwait$(EXEEXT): $(epoll_pwait_OBJECTS) $(epoll_pwait_DEPENDENCIES) $(EXTRA_epoll_pwait_DEPENDENCIES) + @rm -f epoll_pwait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_pwait_OBJECTS) $(epoll_pwait_LDADD) $(LIBS) + +epoll_wait$(EXEEXT): $(epoll_wait_OBJECTS) $(epoll_wait_DEPENDENCIES) $(EXTRA_epoll_wait_DEPENDENCIES) + @rm -f epoll_wait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(epoll_wait_OBJECTS) $(epoll_wait_LDADD) $(LIBS) + +erestartsys$(EXEEXT): $(erestartsys_OBJECTS) $(erestartsys_DEPENDENCIES) $(EXTRA_erestartsys_DEPENDENCIES) + @rm -f erestartsys$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(erestartsys_OBJECTS) $(erestartsys_LDADD) $(LIBS) + +eventfd$(EXEEXT): $(eventfd_OBJECTS) $(eventfd_DEPENDENCIES) $(EXTRA_eventfd_DEPENDENCIES) + @rm -f eventfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eventfd_OBJECTS) $(eventfd_LDADD) $(LIBS) + +execve$(EXEEXT): $(execve_OBJECTS) $(execve_DEPENDENCIES) $(EXTRA_execve_DEPENDENCIES) + @rm -f execve$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execve_OBJECTS) $(execve_LDADD) $(LIBS) + +execve-v$(EXEEXT): $(execve_v_OBJECTS) $(execve_v_DEPENDENCIES) $(EXTRA_execve_v_DEPENDENCIES) + @rm -f execve-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execve_v_OBJECTS) $(execve_v_LDADD) $(LIBS) + +execveat$(EXEEXT): $(execveat_OBJECTS) $(execveat_DEPENDENCIES) $(EXTRA_execveat_DEPENDENCIES) + @rm -f execveat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execveat_OBJECTS) $(execveat_LDADD) $(LIBS) + +execveat-v$(EXEEXT): $(execveat_v_OBJECTS) $(execveat_v_DEPENDENCIES) $(EXTRA_execveat_v_DEPENDENCIES) + @rm -f execveat-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(execveat_v_OBJECTS) $(execveat_v_LDADD) $(LIBS) + +faccessat$(EXEEXT): $(faccessat_OBJECTS) $(faccessat_DEPENDENCIES) $(EXTRA_faccessat_DEPENDENCIES) + @rm -f faccessat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(faccessat_OBJECTS) $(faccessat_LDADD) $(LIBS) + +fadvise64$(EXEEXT): $(fadvise64_OBJECTS) $(fadvise64_DEPENDENCIES) $(EXTRA_fadvise64_DEPENDENCIES) + @rm -f fadvise64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fadvise64_OBJECTS) $(fadvise64_LDADD) $(LIBS) + +fadvise64_64$(EXEEXT): $(fadvise64_64_OBJECTS) $(fadvise64_64_DEPENDENCIES) $(EXTRA_fadvise64_64_DEPENDENCIES) + @rm -f fadvise64_64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fadvise64_64_OBJECTS) $(fadvise64_64_LDADD) $(LIBS) + +fallocate$(EXEEXT): $(fallocate_OBJECTS) $(fallocate_DEPENDENCIES) $(EXTRA_fallocate_DEPENDENCIES) + @rm -f fallocate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fallocate_OBJECTS) $(fallocate_LDADD) $(LIBS) + +fanotify_init$(EXEEXT): $(fanotify_init_OBJECTS) $(fanotify_init_DEPENDENCIES) $(EXTRA_fanotify_init_DEPENDENCIES) + @rm -f fanotify_init$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_init_OBJECTS) $(fanotify_init_LDADD) $(LIBS) + +fanotify_mark$(EXEEXT): $(fanotify_mark_OBJECTS) $(fanotify_mark_DEPENDENCIES) $(EXTRA_fanotify_mark_DEPENDENCIES) + @rm -f fanotify_mark$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_OBJECTS) $(fanotify_mark_LDADD) $(LIBS) + +fchdir$(EXEEXT): $(fchdir_OBJECTS) $(fchdir_DEPENDENCIES) $(EXTRA_fchdir_DEPENDENCIES) + @rm -f fchdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchdir_OBJECTS) $(fchdir_LDADD) $(LIBS) + +fchmod$(EXEEXT): $(fchmod_OBJECTS) $(fchmod_DEPENDENCIES) $(EXTRA_fchmod_DEPENDENCIES) + @rm -f fchmod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchmod_OBJECTS) $(fchmod_LDADD) $(LIBS) + +fchmodat$(EXEEXT): $(fchmodat_OBJECTS) $(fchmodat_DEPENDENCIES) $(EXTRA_fchmodat_DEPENDENCIES) + @rm -f fchmodat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchmodat_OBJECTS) $(fchmodat_LDADD) $(LIBS) + +fchown$(EXEEXT): $(fchown_OBJECTS) $(fchown_DEPENDENCIES) $(EXTRA_fchown_DEPENDENCIES) + @rm -f fchown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchown_OBJECTS) $(fchown_LDADD) $(LIBS) + +fchown32$(EXEEXT): $(fchown32_OBJECTS) $(fchown32_DEPENDENCIES) $(EXTRA_fchown32_DEPENDENCIES) + @rm -f fchown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchown32_OBJECTS) $(fchown32_LDADD) $(LIBS) + +fchownat$(EXEEXT): $(fchownat_OBJECTS) $(fchownat_DEPENDENCIES) $(EXTRA_fchownat_DEPENDENCIES) + @rm -f fchownat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fchownat_OBJECTS) $(fchownat_LDADD) $(LIBS) + +fcntl$(EXEEXT): $(fcntl_OBJECTS) $(fcntl_DEPENDENCIES) $(EXTRA_fcntl_DEPENDENCIES) + @rm -f fcntl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fcntl_OBJECTS) $(fcntl_LDADD) $(LIBS) + +fcntl64$(EXEEXT): $(fcntl64_OBJECTS) $(fcntl64_DEPENDENCIES) $(EXTRA_fcntl64_DEPENDENCIES) + @rm -f fcntl64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fcntl64_OBJECTS) $(fcntl64_LDADD) $(LIBS) + +fdatasync$(EXEEXT): $(fdatasync_OBJECTS) $(fdatasync_DEPENDENCIES) $(EXTRA_fdatasync_DEPENDENCIES) + @rm -f fdatasync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fdatasync_OBJECTS) $(fdatasync_LDADD) $(LIBS) + +file_handle$(EXEEXT): $(file_handle_OBJECTS) $(file_handle_DEPENDENCIES) $(EXTRA_file_handle_DEPENDENCIES) + @rm -f file_handle$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_handle_OBJECTS) $(file_handle_LDADD) $(LIBS) + +file_ioctl$(EXEEXT): $(file_ioctl_OBJECTS) $(file_ioctl_DEPENDENCIES) $(EXTRA_file_ioctl_DEPENDENCIES) + @rm -f file_ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_ioctl_OBJECTS) $(file_ioctl_LDADD) $(LIBS) + +filter-unavailable$(EXEEXT): $(filter_unavailable_OBJECTS) $(filter_unavailable_DEPENDENCIES) $(EXTRA_filter_unavailable_DEPENDENCIES) + @rm -f filter-unavailable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(filter_unavailable_OBJECTS) $(filter_unavailable_LDADD) $(LIBS) + +finit_module$(EXEEXT): $(finit_module_OBJECTS) $(finit_module_DEPENDENCIES) $(EXTRA_finit_module_DEPENDENCIES) + @rm -f finit_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(finit_module_OBJECTS) $(finit_module_LDADD) $(LIBS) + +flock$(EXEEXT): $(flock_OBJECTS) $(flock_DEPENDENCIES) $(EXTRA_flock_DEPENDENCIES) + @rm -f flock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(flock_OBJECTS) $(flock_LDADD) $(LIBS) + +fork-f$(EXEEXT): $(fork_f_OBJECTS) $(fork_f_DEPENDENCIES) $(EXTRA_fork_f_DEPENDENCIES) + @rm -f fork-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fork_f_OBJECTS) $(fork_f_LDADD) $(LIBS) + +fstat$(EXEEXT): $(fstat_OBJECTS) $(fstat_DEPENDENCIES) $(EXTRA_fstat_DEPENDENCIES) + @rm -f fstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_OBJECTS) $(fstat_LDADD) $(LIBS) + +fstat64$(EXEEXT): $(fstat64_OBJECTS) $(fstat64_DEPENDENCIES) $(EXTRA_fstat64_DEPENDENCIES) + @rm -f fstat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_OBJECTS) $(fstat64_LDADD) $(LIBS) + +fstatat64$(EXEEXT): $(fstatat64_OBJECTS) $(fstatat64_DEPENDENCIES) $(EXTRA_fstatat64_DEPENDENCIES) + @rm -f fstatat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatat64_OBJECTS) $(fstatat64_LDADD) $(LIBS) + +fstatfs$(EXEEXT): $(fstatfs_OBJECTS) $(fstatfs_DEPENDENCIES) $(EXTRA_fstatfs_DEPENDENCIES) + @rm -f fstatfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatfs_OBJECTS) $(fstatfs_LDADD) $(LIBS) + +fstatfs64$(EXEEXT): $(fstatfs64_OBJECTS) $(fstatfs64_DEPENDENCIES) $(EXTRA_fstatfs64_DEPENDENCIES) + @rm -f fstatfs64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstatfs64_OBJECTS) $(fstatfs64_LDADD) $(LIBS) + +fsync$(EXEEXT): $(fsync_OBJECTS) $(fsync_DEPENDENCIES) $(EXTRA_fsync_DEPENDENCIES) + @rm -f fsync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fsync_OBJECTS) $(fsync_LDADD) $(LIBS) + +ftruncate$(EXEEXT): $(ftruncate_OBJECTS) $(ftruncate_DEPENDENCIES) $(EXTRA_ftruncate_DEPENDENCIES) + @rm -f ftruncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ftruncate_OBJECTS) $(ftruncate_LDADD) $(LIBS) + +ftruncate64$(EXEEXT): $(ftruncate64_OBJECTS) $(ftruncate64_DEPENDENCIES) $(EXTRA_ftruncate64_DEPENDENCIES) + @rm -f ftruncate64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ftruncate64_OBJECTS) $(ftruncate64_LDADD) $(LIBS) + +futex$(EXEEXT): $(futex_OBJECTS) $(futex_DEPENDENCIES) $(EXTRA_futex_DEPENDENCIES) + @rm -f futex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(futex_OBJECTS) $(futex_LDADD) $(LIBS) + +futimesat$(EXEEXT): $(futimesat_OBJECTS) $(futimesat_DEPENDENCIES) $(EXTRA_futimesat_DEPENDENCIES) + @rm -f futimesat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(futimesat_OBJECTS) $(futimesat_LDADD) $(LIBS) + +get_mempolicy$(EXEEXT): $(get_mempolicy_OBJECTS) $(get_mempolicy_DEPENDENCIES) $(EXTRA_get_mempolicy_DEPENDENCIES) + @rm -f get_mempolicy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(get_mempolicy_OBJECTS) $(get_mempolicy_LDADD) $(LIBS) + +getcpu$(EXEEXT): $(getcpu_OBJECTS) $(getcpu_DEPENDENCIES) $(EXTRA_getcpu_DEPENDENCIES) + @rm -f getcpu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getcpu_OBJECTS) $(getcpu_LDADD) $(LIBS) + +getcwd$(EXEEXT): $(getcwd_OBJECTS) $(getcwd_DEPENDENCIES) $(EXTRA_getcwd_DEPENDENCIES) + @rm -f getcwd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getcwd_OBJECTS) $(getcwd_LDADD) $(LIBS) + +getdents$(EXEEXT): $(getdents_OBJECTS) $(getdents_DEPENDENCIES) $(EXTRA_getdents_DEPENDENCIES) + @rm -f getdents$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getdents_OBJECTS) $(getdents_LDADD) $(LIBS) + +getdents64$(EXEEXT): $(getdents64_OBJECTS) $(getdents64_DEPENDENCIES) $(EXTRA_getdents64_DEPENDENCIES) + @rm -f getdents64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getdents64_OBJECTS) $(getdents64_LDADD) $(LIBS) + +getegid$(EXEEXT): $(getegid_OBJECTS) $(getegid_DEPENDENCIES) $(EXTRA_getegid_DEPENDENCIES) + @rm -f getegid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getegid_OBJECTS) $(getegid_LDADD) $(LIBS) + +getegid32$(EXEEXT): $(getegid32_OBJECTS) $(getegid32_DEPENDENCIES) $(EXTRA_getegid32_DEPENDENCIES) + @rm -f getegid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getegid32_OBJECTS) $(getegid32_LDADD) $(LIBS) + +geteuid$(EXEEXT): $(geteuid_OBJECTS) $(geteuid_DEPENDENCIES) $(EXTRA_geteuid_DEPENDENCIES) + @rm -f geteuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(geteuid_OBJECTS) $(geteuid_LDADD) $(LIBS) + +geteuid32$(EXEEXT): $(geteuid32_OBJECTS) $(geteuid32_DEPENDENCIES) $(EXTRA_geteuid32_DEPENDENCIES) + @rm -f geteuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(geteuid32_OBJECTS) $(geteuid32_LDADD) $(LIBS) + +getgid$(EXEEXT): $(getgid_OBJECTS) $(getgid_DEPENDENCIES) $(EXTRA_getgid_DEPENDENCIES) + @rm -f getgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgid_OBJECTS) $(getgid_LDADD) $(LIBS) + +getgid32$(EXEEXT): $(getgid32_OBJECTS) $(getgid32_DEPENDENCIES) $(EXTRA_getgid32_DEPENDENCIES) + @rm -f getgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgid32_OBJECTS) $(getgid32_LDADD) $(LIBS) + +getgroups$(EXEEXT): $(getgroups_OBJECTS) $(getgroups_DEPENDENCIES) $(EXTRA_getgroups_DEPENDENCIES) + @rm -f getgroups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgroups_OBJECTS) $(getgroups_LDADD) $(LIBS) + +getgroups32$(EXEEXT): $(getgroups32_OBJECTS) $(getgroups32_DEPENDENCIES) $(EXTRA_getgroups32_DEPENDENCIES) + @rm -f getgroups32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getgroups32_OBJECTS) $(getgroups32_LDADD) $(LIBS) + +getpeername$(EXEEXT): $(getpeername_OBJECTS) $(getpeername_DEPENDENCIES) $(EXTRA_getpeername_DEPENDENCIES) + @rm -f getpeername$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpeername_OBJECTS) $(getpeername_LDADD) $(LIBS) + +getpgrp$(EXEEXT): $(getpgrp_OBJECTS) $(getpgrp_DEPENDENCIES) $(EXTRA_getpgrp_DEPENDENCIES) + @rm -f getpgrp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpgrp_OBJECTS) $(getpgrp_LDADD) $(LIBS) + +getrandom$(EXEEXT): $(getrandom_OBJECTS) $(getrandom_DEPENDENCIES) $(EXTRA_getrandom_DEPENDENCIES) + @rm -f getrandom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrandom_OBJECTS) $(getrandom_LDADD) $(LIBS) + +getresgid$(EXEEXT): $(getresgid_OBJECTS) $(getresgid_DEPENDENCIES) $(EXTRA_getresgid_DEPENDENCIES) + @rm -f getresgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresgid_OBJECTS) $(getresgid_LDADD) $(LIBS) + +getresgid32$(EXEEXT): $(getresgid32_OBJECTS) $(getresgid32_DEPENDENCIES) $(EXTRA_getresgid32_DEPENDENCIES) + @rm -f getresgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresgid32_OBJECTS) $(getresgid32_LDADD) $(LIBS) + +getresuid$(EXEEXT): $(getresuid_OBJECTS) $(getresuid_DEPENDENCIES) $(EXTRA_getresuid_DEPENDENCIES) + @rm -f getresuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresuid_OBJECTS) $(getresuid_LDADD) $(LIBS) + +getresuid32$(EXEEXT): $(getresuid32_OBJECTS) $(getresuid32_DEPENDENCIES) $(EXTRA_getresuid32_DEPENDENCIES) + @rm -f getresuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getresuid32_OBJECTS) $(getresuid32_LDADD) $(LIBS) + +getrlimit$(EXEEXT): $(getrlimit_OBJECTS) $(getrlimit_DEPENDENCIES) $(EXTRA_getrlimit_DEPENDENCIES) + @rm -f getrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrlimit_OBJECTS) $(getrlimit_LDADD) $(LIBS) + +getrusage$(EXEEXT): $(getrusage_OBJECTS) $(getrusage_DEPENDENCIES) $(EXTRA_getrusage_DEPENDENCIES) + @rm -f getrusage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getrusage_OBJECTS) $(getrusage_LDADD) $(LIBS) + +getsid$(EXEEXT): $(getsid_OBJECTS) $(getsid_DEPENDENCIES) $(EXTRA_getsid_DEPENDENCIES) + @rm -f getsid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getsid_OBJECTS) $(getsid_LDADD) $(LIBS) + +getsockname$(EXEEXT): $(getsockname_OBJECTS) $(getsockname_DEPENDENCIES) $(EXTRA_getsockname_DEPENDENCIES) + @rm -f getsockname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getsockname_OBJECTS) $(getsockname_LDADD) $(LIBS) + +getuid$(EXEEXT): $(getuid_OBJECTS) $(getuid_DEPENDENCIES) $(EXTRA_getuid_DEPENDENCIES) + @rm -f getuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getuid_OBJECTS) $(getuid_LDADD) $(LIBS) + +getuid32$(EXEEXT): $(getuid32_OBJECTS) $(getuid32_DEPENDENCIES) $(EXTRA_getuid32_DEPENDENCIES) + @rm -f getuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getuid32_OBJECTS) $(getuid32_LDADD) $(LIBS) + +getxxid$(EXEEXT): $(getxxid_OBJECTS) $(getxxid_DEPENDENCIES) $(EXTRA_getxxid_DEPENDENCIES) + @rm -f getxxid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getxxid_OBJECTS) $(getxxid_LDADD) $(LIBS) + +inet-cmsg$(EXEEXT): $(inet_cmsg_OBJECTS) $(inet_cmsg_DEPENDENCIES) $(EXTRA_inet_cmsg_DEPENDENCIES) + @rm -f inet-cmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inet_cmsg_OBJECTS) $(inet_cmsg_LDADD) $(LIBS) + +init_module$(EXEEXT): $(init_module_OBJECTS) $(init_module_DEPENDENCIES) $(EXTRA_init_module_DEPENDENCIES) + @rm -f init_module$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(init_module_OBJECTS) $(init_module_LDADD) $(LIBS) + +inotify$(EXEEXT): $(inotify_OBJECTS) $(inotify_DEPENDENCIES) $(EXTRA_inotify_DEPENDENCIES) + @rm -f inotify$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inotify_OBJECTS) $(inotify_LDADD) $(LIBS) + +inotify_init1$(EXEEXT): $(inotify_init1_OBJECTS) $(inotify_init1_DEPENDENCIES) $(EXTRA_inotify_init1_DEPENDENCIES) + @rm -f inotify_init1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inotify_init1_OBJECTS) $(inotify_init1_LDADD) $(LIBS) + +ioctl$(EXEEXT): $(ioctl_OBJECTS) $(ioctl_DEPENDENCIES) $(EXTRA_ioctl_DEPENDENCIES) + @rm -f ioctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_OBJECTS) $(ioctl_LDADD) $(LIBS) + +ioctl_block$(EXEEXT): $(ioctl_block_OBJECTS) $(ioctl_block_DEPENDENCIES) $(EXTRA_ioctl_block_DEPENDENCIES) + @rm -f ioctl_block$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_block_OBJECTS) $(ioctl_block_LDADD) $(LIBS) + +ioctl_dm$(EXEEXT): $(ioctl_dm_OBJECTS) $(ioctl_dm_DEPENDENCIES) $(EXTRA_ioctl_dm_DEPENDENCIES) + @rm -f ioctl_dm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_dm_OBJECTS) $(ioctl_dm_LDADD) $(LIBS) + +ioctl_dm-v$(EXEEXT): $(ioctl_dm_v_OBJECTS) $(ioctl_dm_v_DEPENDENCIES) $(EXTRA_ioctl_dm_v_DEPENDENCIES) + @rm -f ioctl_dm-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_dm_v_OBJECTS) $(ioctl_dm_v_LDADD) $(LIBS) + +ioctl_evdev$(EXEEXT): $(ioctl_evdev_OBJECTS) $(ioctl_evdev_DEPENDENCIES) $(EXTRA_ioctl_evdev_DEPENDENCIES) + @rm -f ioctl_evdev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_OBJECTS) $(ioctl_evdev_LDADD) $(LIBS) + +ioctl_evdev-v$(EXEEXT): $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_v_DEPENDENCIES) + @rm -f ioctl_evdev-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_LDADD) $(LIBS) + +ioctl_loop$(EXEEXT): $(ioctl_loop_OBJECTS) $(ioctl_loop_DEPENDENCIES) $(EXTRA_ioctl_loop_DEPENDENCIES) + @rm -f ioctl_loop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_OBJECTS) $(ioctl_loop_LDADD) $(LIBS) + +ioctl_loop-nv$(EXEEXT): $(ioctl_loop_nv_OBJECTS) $(ioctl_loop_nv_DEPENDENCIES) $(EXTRA_ioctl_loop_nv_DEPENDENCIES) + @rm -f ioctl_loop-nv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_nv_OBJECTS) $(ioctl_loop_nv_LDADD) $(LIBS) + +ioctl_loop-v$(EXEEXT): $(ioctl_loop_v_OBJECTS) $(ioctl_loop_v_DEPENDENCIES) $(EXTRA_ioctl_loop_v_DEPENDENCIES) + @rm -f ioctl_loop-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_loop_v_OBJECTS) $(ioctl_loop_v_LDADD) $(LIBS) + +ioctl_mtd$(EXEEXT): $(ioctl_mtd_OBJECTS) $(ioctl_mtd_DEPENDENCIES) $(EXTRA_ioctl_mtd_DEPENDENCIES) + @rm -f ioctl_mtd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_mtd_OBJECTS) $(ioctl_mtd_LDADD) $(LIBS) + +ioctl_rtc$(EXEEXT): $(ioctl_rtc_OBJECTS) $(ioctl_rtc_DEPENDENCIES) $(EXTRA_ioctl_rtc_DEPENDENCIES) + @rm -f ioctl_rtc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_rtc_OBJECTS) $(ioctl_rtc_LDADD) $(LIBS) + +ioctl_rtc-v$(EXEEXT): $(ioctl_rtc_v_OBJECTS) $(ioctl_rtc_v_DEPENDENCIES) $(EXTRA_ioctl_rtc_v_DEPENDENCIES) + @rm -f ioctl_rtc-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_rtc_v_OBJECTS) $(ioctl_rtc_v_LDADD) $(LIBS) + +ioctl_scsi$(EXEEXT): $(ioctl_scsi_OBJECTS) $(ioctl_scsi_DEPENDENCIES) $(EXTRA_ioctl_scsi_DEPENDENCIES) + @rm -f ioctl_scsi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_scsi_OBJECTS) $(ioctl_scsi_LDADD) $(LIBS) + +ioctl_sg_io_v3$(EXEEXT): $(ioctl_sg_io_v3_OBJECTS) $(ioctl_sg_io_v3_DEPENDENCIES) $(EXTRA_ioctl_sg_io_v3_DEPENDENCIES) + @rm -f ioctl_sg_io_v3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sg_io_v3_OBJECTS) $(ioctl_sg_io_v3_LDADD) $(LIBS) + +ioctl_sg_io_v4$(EXEEXT): $(ioctl_sg_io_v4_OBJECTS) $(ioctl_sg_io_v4_DEPENDENCIES) $(EXTRA_ioctl_sg_io_v4_DEPENDENCIES) + @rm -f ioctl_sg_io_v4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sg_io_v4_OBJECTS) $(ioctl_sg_io_v4_LDADD) $(LIBS) + +ioctl_sock_gifconf$(EXEEXT): $(ioctl_sock_gifconf_OBJECTS) $(ioctl_sock_gifconf_DEPENDENCIES) $(EXTRA_ioctl_sock_gifconf_DEPENDENCIES) + @rm -f ioctl_sock_gifconf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_sock_gifconf_OBJECTS) $(ioctl_sock_gifconf_LDADD) $(LIBS) + +ioctl_uffdio$(EXEEXT): $(ioctl_uffdio_OBJECTS) $(ioctl_uffdio_DEPENDENCIES) $(EXTRA_ioctl_uffdio_DEPENDENCIES) + @rm -f ioctl_uffdio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_uffdio_OBJECTS) $(ioctl_uffdio_LDADD) $(LIBS) + +ioctl_v4l2$(EXEEXT): $(ioctl_v4l2_OBJECTS) $(ioctl_v4l2_DEPENDENCIES) $(EXTRA_ioctl_v4l2_DEPENDENCIES) + @rm -f ioctl_v4l2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_v4l2_OBJECTS) $(ioctl_v4l2_LDADD) $(LIBS) + +ioperm$(EXEEXT): $(ioperm_OBJECTS) $(ioperm_DEPENDENCIES) $(EXTRA_ioperm_DEPENDENCIES) + @rm -f ioperm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioperm_OBJECTS) $(ioperm_LDADD) $(LIBS) + +iopl$(EXEEXT): $(iopl_OBJECTS) $(iopl_DEPENDENCIES) $(EXTRA_iopl_DEPENDENCIES) + @rm -f iopl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(iopl_OBJECTS) $(iopl_LDADD) $(LIBS) + +ioprio$(EXEEXT): $(ioprio_OBJECTS) $(ioprio_DEPENDENCIES) $(EXTRA_ioprio_DEPENDENCIES) + @rm -f ioprio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_OBJECTS) $(ioprio_LDADD) $(LIBS) + +ip_mreq$(EXEEXT): $(ip_mreq_OBJECTS) $(ip_mreq_DEPENDENCIES) $(EXTRA_ip_mreq_DEPENDENCIES) + @rm -f ip_mreq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ip_mreq_OBJECTS) $(ip_mreq_LDADD) $(LIBS) + +ipc$(EXEEXT): $(ipc_OBJECTS) $(ipc_DEPENDENCIES) $(EXTRA_ipc_DEPENDENCIES) + @rm -f ipc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_OBJECTS) $(ipc_LDADD) $(LIBS) + +ipc_msg$(EXEEXT): $(ipc_msg_OBJECTS) $(ipc_msg_DEPENDENCIES) $(EXTRA_ipc_msg_DEPENDENCIES) + @rm -f ipc_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_OBJECTS) $(ipc_msg_LDADD) $(LIBS) + +ipc_msgbuf$(EXEEXT): $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_DEPENDENCIES) $(EXTRA_ipc_msgbuf_DEPENDENCIES) + @rm -f ipc_msgbuf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_LDADD) $(LIBS) + +ipc_sem$(EXEEXT): $(ipc_sem_OBJECTS) $(ipc_sem_DEPENDENCIES) $(EXTRA_ipc_sem_DEPENDENCIES) + @rm -f ipc_sem$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_OBJECTS) $(ipc_sem_LDADD) $(LIBS) + +ipc_shm$(EXEEXT): $(ipc_shm_OBJECTS) $(ipc_shm_DEPENDENCIES) $(EXTRA_ipc_shm_DEPENDENCIES) + @rm -f ipc_shm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_OBJECTS) $(ipc_shm_LDADD) $(LIBS) + +kcmp$(EXEEXT): $(kcmp_OBJECTS) $(kcmp_DEPENDENCIES) $(EXTRA_kcmp_DEPENDENCIES) + @rm -f kcmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kcmp_OBJECTS) $(kcmp_LDADD) $(LIBS) + +kexec_file_load$(EXEEXT): $(kexec_file_load_OBJECTS) $(kexec_file_load_DEPENDENCIES) $(EXTRA_kexec_file_load_DEPENDENCIES) + @rm -f kexec_file_load$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kexec_file_load_OBJECTS) $(kexec_file_load_LDADD) $(LIBS) + +kexec_load$(EXEEXT): $(kexec_load_OBJECTS) $(kexec_load_DEPENDENCIES) $(EXTRA_kexec_load_DEPENDENCIES) + @rm -f kexec_load$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kexec_load_OBJECTS) $(kexec_load_LDADD) $(LIBS) + +keyctl$(EXEEXT): $(keyctl_OBJECTS) $(keyctl_DEPENDENCIES) $(EXTRA_keyctl_DEPENDENCIES) + @rm -f keyctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_OBJECTS) $(keyctl_LDADD) $(LIBS) + +kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) $(EXTRA_kill_DEPENDENCIES) + @rm -f kill$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) + +ksysent$(EXEEXT): $(ksysent_OBJECTS) $(ksysent_DEPENDENCIES) $(EXTRA_ksysent_DEPENDENCIES) + @rm -f ksysent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ksysent_OBJECTS) $(ksysent_LDADD) $(LIBS) + +lchown$(EXEEXT): $(lchown_OBJECTS) $(lchown_DEPENDENCIES) $(EXTRA_lchown_DEPENDENCIES) + @rm -f lchown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lchown_OBJECTS) $(lchown_LDADD) $(LIBS) + +lchown32$(EXEEXT): $(lchown32_OBJECTS) $(lchown32_DEPENDENCIES) $(EXTRA_lchown32_DEPENDENCIES) + @rm -f lchown32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lchown32_OBJECTS) $(lchown32_LDADD) $(LIBS) + +link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES) $(EXTRA_link_DEPENDENCIES) + @rm -f link$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(link_OBJECTS) $(link_LDADD) $(LIBS) + +linkat$(EXEEXT): $(linkat_OBJECTS) $(linkat_DEPENDENCIES) $(EXTRA_linkat_DEPENDENCIES) + @rm -f linkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(linkat_OBJECTS) $(linkat_LDADD) $(LIBS) + +llseek$(EXEEXT): $(llseek_OBJECTS) $(llseek_DEPENDENCIES) $(EXTRA_llseek_DEPENDENCIES) + @rm -f llseek$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(llseek_OBJECTS) $(llseek_LDADD) $(LIBS) + +lookup_dcookie$(EXEEXT): $(lookup_dcookie_OBJECTS) $(lookup_dcookie_DEPENDENCIES) $(EXTRA_lookup_dcookie_DEPENDENCIES) + @rm -f lookup_dcookie$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lookup_dcookie_OBJECTS) $(lookup_dcookie_LDADD) $(LIBS) + +lseek$(EXEEXT): $(lseek_OBJECTS) $(lseek_DEPENDENCIES) $(EXTRA_lseek_DEPENDENCIES) + @rm -f lseek$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lseek_OBJECTS) $(lseek_LDADD) $(LIBS) + +lstat$(EXEEXT): $(lstat_OBJECTS) $(lstat_DEPENDENCIES) $(EXTRA_lstat_DEPENDENCIES) + @rm -f lstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lstat_OBJECTS) $(lstat_LDADD) $(LIBS) + +lstat64$(EXEEXT): $(lstat64_OBJECTS) $(lstat64_DEPENDENCIES) $(EXTRA_lstat64_DEPENDENCIES) + @rm -f lstat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lstat64_OBJECTS) $(lstat64_LDADD) $(LIBS) + +mbind$(EXEEXT): $(mbind_OBJECTS) $(mbind_DEPENDENCIES) $(EXTRA_mbind_DEPENDENCIES) + @rm -f mbind$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mbind_OBJECTS) $(mbind_LDADD) $(LIBS) + +membarrier$(EXEEXT): $(membarrier_OBJECTS) $(membarrier_DEPENDENCIES) $(EXTRA_membarrier_DEPENDENCIES) + @rm -f membarrier$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(membarrier_OBJECTS) $(membarrier_LDADD) $(LIBS) + +memfd_create$(EXEEXT): $(memfd_create_OBJECTS) $(memfd_create_DEPENDENCIES) $(EXTRA_memfd_create_DEPENDENCIES) + @rm -f memfd_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_OBJECTS) $(memfd_create_LDADD) $(LIBS) + +migrate_pages$(EXEEXT): $(migrate_pages_OBJECTS) $(migrate_pages_DEPENDENCIES) $(EXTRA_migrate_pages_DEPENDENCIES) + @rm -f migrate_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(migrate_pages_OBJECTS) $(migrate_pages_LDADD) $(LIBS) + +mincore$(EXEEXT): $(mincore_OBJECTS) $(mincore_DEPENDENCIES) $(EXTRA_mincore_DEPENDENCIES) + @rm -f mincore$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mincore_OBJECTS) $(mincore_LDADD) $(LIBS) + +mkdir$(EXEEXT): $(mkdir_OBJECTS) $(mkdir_DEPENDENCIES) $(EXTRA_mkdir_DEPENDENCIES) + @rm -f mkdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) + +mkdirat$(EXEEXT): $(mkdirat_OBJECTS) $(mkdirat_DEPENDENCIES) $(EXTRA_mkdirat_DEPENDENCIES) + @rm -f mkdirat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mkdirat_OBJECTS) $(mkdirat_LDADD) $(LIBS) + +mknod$(EXEEXT): $(mknod_OBJECTS) $(mknod_DEPENDENCIES) $(EXTRA_mknod_DEPENDENCIES) + @rm -f mknod$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mknod_OBJECTS) $(mknod_LDADD) $(LIBS) + +mknodat$(EXEEXT): $(mknodat_OBJECTS) $(mknodat_DEPENDENCIES) $(EXTRA_mknodat_DEPENDENCIES) + @rm -f mknodat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mknodat_OBJECTS) $(mknodat_LDADD) $(LIBS) + +mlock$(EXEEXT): $(mlock_OBJECTS) $(mlock_DEPENDENCIES) $(EXTRA_mlock_DEPENDENCIES) + @rm -f mlock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlock_OBJECTS) $(mlock_LDADD) $(LIBS) + +mlock2$(EXEEXT): $(mlock2_OBJECTS) $(mlock2_DEPENDENCIES) $(EXTRA_mlock2_DEPENDENCIES) + @rm -f mlock2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlock2_OBJECTS) $(mlock2_LDADD) $(LIBS) + +mlockall$(EXEEXT): $(mlockall_OBJECTS) $(mlockall_DEPENDENCIES) $(EXTRA_mlockall_DEPENDENCIES) + @rm -f mlockall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mlockall_OBJECTS) $(mlockall_LDADD) $(LIBS) + +mmap$(EXEEXT): $(mmap_OBJECTS) $(mmap_DEPENDENCIES) $(EXTRA_mmap_DEPENDENCIES) + @rm -f mmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_OBJECTS) $(mmap_LDADD) $(LIBS) + +mmap64$(EXEEXT): $(mmap64_OBJECTS) $(mmap64_DEPENDENCIES) $(EXTRA_mmap64_DEPENDENCIES) + @rm -f mmap64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_OBJECTS) $(mmap64_LDADD) $(LIBS) + +mmsg$(EXEEXT): $(mmsg_OBJECTS) $(mmsg_DEPENDENCIES) $(EXTRA_mmsg_DEPENDENCIES) + @rm -f mmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_OBJECTS) $(mmsg_LDADD) $(LIBS) + +mmsg-silent$(EXEEXT): $(mmsg_silent_OBJECTS) $(mmsg_silent_DEPENDENCIES) $(EXTRA_mmsg_silent_DEPENDENCIES) + @rm -f mmsg-silent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_silent_OBJECTS) $(mmsg_silent_LDADD) $(LIBS) + +mmsg_name$(EXEEXT): $(mmsg_name_OBJECTS) $(mmsg_name_DEPENDENCIES) $(EXTRA_mmsg_name_DEPENDENCIES) + @rm -f mmsg_name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_name_OBJECTS) $(mmsg_name_LDADD) $(LIBS) + +mmsg_name-v$(EXEEXT): $(mmsg_name_v_OBJECTS) $(mmsg_name_v_DEPENDENCIES) $(EXTRA_mmsg_name_v_DEPENDENCIES) + @rm -f mmsg_name-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmsg_name_v_OBJECTS) $(mmsg_name_v_LDADD) $(LIBS) + +mount$(EXEEXT): $(mount_OBJECTS) $(mount_DEPENDENCIES) $(EXTRA_mount_DEPENDENCIES) + @rm -f mount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_OBJECTS) $(mount_LDADD) $(LIBS) + +move_pages$(EXEEXT): $(move_pages_OBJECTS) $(move_pages_DEPENDENCIES) $(EXTRA_move_pages_DEPENDENCIES) + @rm -f move_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_OBJECTS) $(move_pages_LDADD) $(LIBS) + +mq$(EXEEXT): $(mq_OBJECTS) $(mq_DEPENDENCIES) $(EXTRA_mq_DEPENDENCIES) + @rm -f mq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_OBJECTS) $(mq_LDADD) $(LIBS) + +mq_sendrecv$(EXEEXT): $(mq_sendrecv_OBJECTS) $(mq_sendrecv_DEPENDENCIES) $(EXTRA_mq_sendrecv_DEPENDENCIES) + @rm -f mq_sendrecv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_OBJECTS) $(mq_sendrecv_LDADD) $(LIBS) + +mq_sendrecv-read$(EXEEXT): $(mq_sendrecv_read_OBJECTS) $(mq_sendrecv_read_DEPENDENCIES) $(EXTRA_mq_sendrecv_read_DEPENDENCIES) + @rm -f mq_sendrecv-read$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_read_OBJECTS) $(mq_sendrecv_read_LDADD) $(LIBS) + +mq_sendrecv-write$(EXEEXT): $(mq_sendrecv_write_OBJECTS) $(mq_sendrecv_write_DEPENDENCIES) $(EXTRA_mq_sendrecv_write_DEPENDENCIES) + @rm -f mq_sendrecv-write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mq_sendrecv_write_OBJECTS) $(mq_sendrecv_write_LDADD) $(LIBS) + +msg_control$(EXEEXT): $(msg_control_OBJECTS) $(msg_control_DEPENDENCIES) $(EXTRA_msg_control_DEPENDENCIES) + @rm -f msg_control$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_control_OBJECTS) $(msg_control_LDADD) $(LIBS) + +msg_control-v$(EXEEXT): $(msg_control_v_OBJECTS) $(msg_control_v_DEPENDENCIES) $(EXTRA_msg_control_v_DEPENDENCIES) + @rm -f msg_control-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_control_v_OBJECTS) $(msg_control_v_LDADD) $(LIBS) + +msg_name$(EXEEXT): $(msg_name_OBJECTS) $(msg_name_DEPENDENCIES) $(EXTRA_msg_name_DEPENDENCIES) + @rm -f msg_name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(msg_name_OBJECTS) $(msg_name_LDADD) $(LIBS) + +munlockall$(EXEEXT): $(munlockall_OBJECTS) $(munlockall_DEPENDENCIES) $(EXTRA_munlockall_DEPENDENCIES) + @rm -f munlockall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(munlockall_OBJECTS) $(munlockall_LDADD) $(LIBS) + +nanosleep$(EXEEXT): $(nanosleep_OBJECTS) $(nanosleep_DEPENDENCIES) $(EXTRA_nanosleep_DEPENDENCIES) + @rm -f nanosleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nanosleep_OBJECTS) $(nanosleep_LDADD) $(LIBS) + +net-accept-connect$(EXEEXT): $(net_accept_connect_OBJECTS) $(net_accept_connect_DEPENDENCIES) $(EXTRA_net_accept_connect_DEPENDENCIES) + @rm -f net-accept-connect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_accept_connect_OBJECTS) $(net_accept_connect_LDADD) $(LIBS) + +net-icmp_filter$(EXEEXT): $(net_icmp_filter_OBJECTS) $(net_icmp_filter_DEPENDENCIES) $(EXTRA_net_icmp_filter_DEPENDENCIES) + @rm -f net-icmp_filter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_icmp_filter_OBJECTS) $(net_icmp_filter_LDADD) $(LIBS) + +net-sockaddr$(EXEEXT): $(net_sockaddr_OBJECTS) $(net_sockaddr_DEPENDENCIES) $(EXTRA_net_sockaddr_DEPENDENCIES) + @rm -f net-sockaddr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_sockaddr_OBJECTS) $(net_sockaddr_LDADD) $(LIBS) + +net-y-unix$(EXEEXT): $(net_y_unix_OBJECTS) $(net_y_unix_DEPENDENCIES) $(EXTRA_net_y_unix_DEPENDENCIES) + @rm -f net-y-unix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_y_unix_OBJECTS) $(net_y_unix_LDADD) $(LIBS) + +net-yy-inet$(EXEEXT): $(net_yy_inet_OBJECTS) $(net_yy_inet_DEPENDENCIES) $(EXTRA_net_yy_inet_DEPENDENCIES) + @rm -f net-yy-inet$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_inet_OBJECTS) $(net_yy_inet_LDADD) $(LIBS) + +net-yy-netlink$(EXEEXT): $(net_yy_netlink_OBJECTS) $(net_yy_netlink_DEPENDENCIES) $(EXTRA_net_yy_netlink_DEPENDENCIES) + @rm -f net-yy-netlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_netlink_OBJECTS) $(net_yy_netlink_LDADD) $(LIBS) + +net-yy-unix$(EXEEXT): $(net_yy_unix_OBJECTS) $(net_yy_unix_DEPENDENCIES) $(EXTRA_net_yy_unix_DEPENDENCIES) + @rm -f net-yy-unix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_unix_OBJECTS) $(net_yy_unix_LDADD) $(LIBS) + +netlink_inet_diag$(EXEEXT): $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_DEPENDENCIES) $(EXTRA_netlink_inet_diag_DEPENDENCIES) + @rm -f netlink_inet_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_LDADD) $(LIBS) + +netlink_netlink_diag$(EXEEXT): $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_DEPENDENCIES) $(EXTRA_netlink_netlink_diag_DEPENDENCIES) + @rm -f netlink_netlink_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_LDADD) $(LIBS) + +netlink_protocol$(EXEEXT): $(netlink_protocol_OBJECTS) $(netlink_protocol_DEPENDENCIES) $(EXTRA_netlink_protocol_DEPENDENCIES) + @rm -f netlink_protocol$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_protocol_OBJECTS) $(netlink_protocol_LDADD) $(LIBS) + +netlink_unix_diag$(EXEEXT): $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_DEPENDENCIES) $(EXTRA_netlink_unix_diag_DEPENDENCIES) + @rm -f netlink_unix_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_LDADD) $(LIBS) + +newfstatat$(EXEEXT): $(newfstatat_OBJECTS) $(newfstatat_DEPENDENCIES) $(EXTRA_newfstatat_DEPENDENCIES) + @rm -f newfstatat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(newfstatat_OBJECTS) $(newfstatat_LDADD) $(LIBS) + +nsyscalls$(EXEEXT): $(nsyscalls_OBJECTS) $(nsyscalls_DEPENDENCIES) $(EXTRA_nsyscalls_DEPENDENCIES) + @rm -f nsyscalls$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nsyscalls_OBJECTS) $(nsyscalls_LDADD) $(LIBS) + +old_mmap$(EXEEXT): $(old_mmap_OBJECTS) $(old_mmap_DEPENDENCIES) $(EXTRA_old_mmap_DEPENDENCIES) + @rm -f old_mmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_OBJECTS) $(old_mmap_LDADD) $(LIBS) + +oldfstat$(EXEEXT): $(oldfstat_OBJECTS) $(oldfstat_DEPENDENCIES) $(EXTRA_oldfstat_DEPENDENCIES) + @rm -f oldfstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldfstat_OBJECTS) $(oldfstat_LDADD) $(LIBS) + +oldlstat$(EXEEXT): $(oldlstat_OBJECTS) $(oldlstat_DEPENDENCIES) $(EXTRA_oldlstat_DEPENDENCIES) + @rm -f oldlstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldlstat_OBJECTS) $(oldlstat_LDADD) $(LIBS) + +oldselect$(EXEEXT): $(oldselect_OBJECTS) $(oldselect_DEPENDENCIES) $(EXTRA_oldselect_DEPENDENCIES) + @rm -f oldselect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_OBJECTS) $(oldselect_LDADD) $(LIBS) + +oldstat$(EXEEXT): $(oldstat_OBJECTS) $(oldstat_DEPENDENCIES) $(EXTRA_oldstat_DEPENDENCIES) + @rm -f oldstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldstat_OBJECTS) $(oldstat_LDADD) $(LIBS) + +open$(EXEEXT): $(open_OBJECTS) $(open_DEPENDENCIES) $(EXTRA_open_DEPENDENCIES) + @rm -f open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(open_OBJECTS) $(open_LDADD) $(LIBS) + +openat$(EXEEXT): $(openat_OBJECTS) $(openat_DEPENDENCIES) $(EXTRA_openat_DEPENDENCIES) + @rm -f openat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(openat_OBJECTS) $(openat_LDADD) $(LIBS) + +pause$(EXEEXT): $(pause_OBJECTS) $(pause_DEPENDENCIES) $(EXTRA_pause_DEPENDENCIES) + @rm -f pause$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pause_OBJECTS) $(pause_LDADD) $(LIBS) + +pc$(EXEEXT): $(pc_OBJECTS) $(pc_DEPENDENCIES) $(EXTRA_pc_DEPENDENCIES) + @rm -f pc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pc_OBJECTS) $(pc_LDADD) $(LIBS) + +perf_event_open$(EXEEXT): $(perf_event_open_OBJECTS) $(perf_event_open_DEPENDENCIES) $(EXTRA_perf_event_open_DEPENDENCIES) + @rm -f perf_event_open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_OBJECTS) $(perf_event_open_LDADD) $(LIBS) + +perf_event_open_nonverbose$(EXEEXT): $(perf_event_open_nonverbose_OBJECTS) $(perf_event_open_nonverbose_DEPENDENCIES) $(EXTRA_perf_event_open_nonverbose_DEPENDENCIES) + @rm -f perf_event_open_nonverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_nonverbose_OBJECTS) $(perf_event_open_nonverbose_LDADD) $(LIBS) + +perf_event_open_unabbrev$(EXEEXT): $(perf_event_open_unabbrev_OBJECTS) $(perf_event_open_unabbrev_DEPENDENCIES) $(EXTRA_perf_event_open_unabbrev_DEPENDENCIES) + @rm -f perf_event_open_unabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_event_open_unabbrev_OBJECTS) $(perf_event_open_unabbrev_LDADD) $(LIBS) + +personality$(EXEEXT): $(personality_OBJECTS) $(personality_DEPENDENCIES) $(EXTRA_personality_DEPENDENCIES) + @rm -f personality$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_OBJECTS) $(personality_LDADD) $(LIBS) + +pipe$(EXEEXT): $(pipe_OBJECTS) $(pipe_DEPENDENCIES) $(EXTRA_pipe_DEPENDENCIES) + @rm -f pipe$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pipe_OBJECTS) $(pipe_LDADD) $(LIBS) + +pipe2$(EXEEXT): $(pipe2_OBJECTS) $(pipe2_DEPENDENCIES) $(EXTRA_pipe2_DEPENDENCIES) + @rm -f pipe2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pipe2_OBJECTS) $(pipe2_LDADD) $(LIBS) + +pkey_alloc$(EXEEXT): $(pkey_alloc_OBJECTS) $(pkey_alloc_DEPENDENCIES) $(EXTRA_pkey_alloc_DEPENDENCIES) + @rm -f pkey_alloc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_alloc_OBJECTS) $(pkey_alloc_LDADD) $(LIBS) + +pkey_free$(EXEEXT): $(pkey_free_OBJECTS) $(pkey_free_DEPENDENCIES) $(EXTRA_pkey_free_DEPENDENCIES) + @rm -f pkey_free$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_free_OBJECTS) $(pkey_free_LDADD) $(LIBS) + +pkey_mprotect$(EXEEXT): $(pkey_mprotect_OBJECTS) $(pkey_mprotect_DEPENDENCIES) $(EXTRA_pkey_mprotect_DEPENDENCIES) + @rm -f pkey_mprotect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pkey_mprotect_OBJECTS) $(pkey_mprotect_LDADD) $(LIBS) + +poll$(EXEEXT): $(poll_OBJECTS) $(poll_DEPENDENCIES) $(EXTRA_poll_DEPENDENCIES) + @rm -f poll$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(poll_OBJECTS) $(poll_LDADD) $(LIBS) + +ppoll$(EXEEXT): $(ppoll_OBJECTS) $(ppoll_DEPENDENCIES) $(EXTRA_ppoll_DEPENDENCIES) + @rm -f ppoll$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_OBJECTS) $(ppoll_LDADD) $(LIBS) + +prctl-arg2-intptr$(EXEEXT): $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_DEPENDENCIES) $(EXTRA_prctl_arg2_intptr_DEPENDENCIES) + @rm -f prctl-arg2-intptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_LDADD) $(LIBS) + +prctl-dumpable$(EXEEXT): $(prctl_dumpable_OBJECTS) $(prctl_dumpable_DEPENDENCIES) $(EXTRA_prctl_dumpable_DEPENDENCIES) + @rm -f prctl-dumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_dumpable_OBJECTS) $(prctl_dumpable_LDADD) $(LIBS) + +prctl-name$(EXEEXT): $(prctl_name_OBJECTS) $(prctl_name_DEPENDENCIES) $(EXTRA_prctl_name_DEPENDENCIES) + @rm -f prctl-name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_name_OBJECTS) $(prctl_name_LDADD) $(LIBS) + +prctl-no-args$(EXEEXT): $(prctl_no_args_OBJECTS) $(prctl_no_args_DEPENDENCIES) $(EXTRA_prctl_no_args_DEPENDENCIES) + @rm -f prctl-no-args$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_no_args_OBJECTS) $(prctl_no_args_LDADD) $(LIBS) + +prctl-pdeathsig$(EXEEXT): $(prctl_pdeathsig_OBJECTS) $(prctl_pdeathsig_DEPENDENCIES) $(EXTRA_prctl_pdeathsig_DEPENDENCIES) + @rm -f prctl-pdeathsig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_pdeathsig_OBJECTS) $(prctl_pdeathsig_LDADD) $(LIBS) + +prctl-seccomp-filter-v$(EXEEXT): $(prctl_seccomp_filter_v_OBJECTS) $(prctl_seccomp_filter_v_DEPENDENCIES) $(EXTRA_prctl_seccomp_filter_v_DEPENDENCIES) + @rm -f prctl-seccomp-filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_seccomp_filter_v_OBJECTS) $(prctl_seccomp_filter_v_LDADD) $(LIBS) + +prctl-seccomp-strict$(EXEEXT): $(prctl_seccomp_strict_OBJECTS) $(prctl_seccomp_strict_DEPENDENCIES) $(EXTRA_prctl_seccomp_strict_DEPENDENCIES) + @rm -f prctl-seccomp-strict$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_seccomp_strict_OBJECTS) $(prctl_seccomp_strict_LDADD) $(LIBS) + +prctl-securebits$(EXEEXT): $(prctl_securebits_OBJECTS) $(prctl_securebits_DEPENDENCIES) $(EXTRA_prctl_securebits_DEPENDENCIES) + @rm -f prctl-securebits$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_securebits_OBJECTS) $(prctl_securebits_LDADD) $(LIBS) + +prctl-tid_address$(EXEEXT): $(prctl_tid_address_OBJECTS) $(prctl_tid_address_DEPENDENCIES) $(EXTRA_prctl_tid_address_DEPENDENCIES) + @rm -f prctl-tid_address$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_tid_address_OBJECTS) $(prctl_tid_address_LDADD) $(LIBS) + +prctl-tsc$(EXEEXT): $(prctl_tsc_OBJECTS) $(prctl_tsc_DEPENDENCIES) $(EXTRA_prctl_tsc_DEPENDENCIES) + @rm -f prctl-tsc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_tsc_OBJECTS) $(prctl_tsc_LDADD) $(LIBS) + +pread64-pwrite64$(EXEEXT): $(pread64_pwrite64_OBJECTS) $(pread64_pwrite64_DEPENDENCIES) $(EXTRA_pread64_pwrite64_DEPENDENCIES) + @rm -f pread64-pwrite64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pread64_pwrite64_OBJECTS) $(pread64_pwrite64_LDADD) $(LIBS) + +preadv$(EXEEXT): $(preadv_OBJECTS) $(preadv_DEPENDENCIES) $(EXTRA_preadv_DEPENDENCIES) + @rm -f preadv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv_OBJECTS) $(preadv_LDADD) $(LIBS) + +preadv-pwritev$(EXEEXT): $(preadv_pwritev_OBJECTS) $(preadv_pwritev_DEPENDENCIES) $(EXTRA_preadv_pwritev_DEPENDENCIES) + @rm -f preadv-pwritev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv_pwritev_OBJECTS) $(preadv_pwritev_LDADD) $(LIBS) + +preadv2-pwritev2$(EXEEXT): $(preadv2_pwritev2_OBJECTS) $(preadv2_pwritev2_DEPENDENCIES) $(EXTRA_preadv2_pwritev2_DEPENDENCIES) + @rm -f preadv2-pwritev2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(preadv2_pwritev2_OBJECTS) $(preadv2_pwritev2_LDADD) $(LIBS) + +print_maxfd$(EXEEXT): $(print_maxfd_OBJECTS) $(print_maxfd_DEPENDENCIES) $(EXTRA_print_maxfd_DEPENDENCIES) + @rm -f print_maxfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(print_maxfd_OBJECTS) $(print_maxfd_LDADD) $(LIBS) + +printstr$(EXEEXT): $(printstr_OBJECTS) $(printstr_DEPENDENCIES) $(EXTRA_printstr_DEPENDENCIES) + @rm -f printstr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstr_OBJECTS) $(printstr_LDADD) $(LIBS) + +prlimit64$(EXEEXT): $(prlimit64_OBJECTS) $(prlimit64_DEPENDENCIES) $(EXTRA_prlimit64_DEPENDENCIES) + @rm -f prlimit64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prlimit64_OBJECTS) $(prlimit64_LDADD) $(LIBS) + +process_vm_readv$(EXEEXT): $(process_vm_readv_OBJECTS) $(process_vm_readv_DEPENDENCIES) $(EXTRA_process_vm_readv_DEPENDENCIES) + @rm -f process_vm_readv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(process_vm_readv_OBJECTS) $(process_vm_readv_LDADD) $(LIBS) + +process_vm_writev$(EXEEXT): $(process_vm_writev_OBJECTS) $(process_vm_writev_DEPENDENCIES) $(EXTRA_process_vm_writev_DEPENDENCIES) + @rm -f process_vm_writev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(process_vm_writev_OBJECTS) $(process_vm_writev_LDADD) $(LIBS) + +pselect6$(EXEEXT): $(pselect6_OBJECTS) $(pselect6_DEPENDENCIES) $(EXTRA_pselect6_DEPENDENCIES) + @rm -f pselect6$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pselect6_OBJECTS) $(pselect6_LDADD) $(LIBS) + +ptrace$(EXEEXT): $(ptrace_OBJECTS) $(ptrace_DEPENDENCIES) $(EXTRA_ptrace_DEPENDENCIES) + @rm -f ptrace$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ptrace_OBJECTS) $(ptrace_LDADD) $(LIBS) + +pwritev$(EXEEXT): $(pwritev_OBJECTS) $(pwritev_DEPENDENCIES) $(EXTRA_pwritev_DEPENDENCIES) + @rm -f pwritev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pwritev_OBJECTS) $(pwritev_LDADD) $(LIBS) + +qual_fault$(EXEEXT): $(qual_fault_OBJECTS) $(qual_fault_DEPENDENCIES) $(EXTRA_qual_fault_DEPENDENCIES) + @rm -f qual_fault$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_fault_OBJECTS) $(qual_fault_LDADD) $(LIBS) + +qual_inject-error-signal$(EXEEXT): $(qual_inject_error_signal_OBJECTS) $(qual_inject_error_signal_DEPENDENCIES) $(EXTRA_qual_inject_error_signal_DEPENDENCIES) + @rm -f qual_inject-error-signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_error_signal_OBJECTS) $(qual_inject_error_signal_LDADD) $(LIBS) + +qual_inject-retval$(EXEEXT): $(qual_inject_retval_OBJECTS) $(qual_inject_retval_DEPENDENCIES) $(EXTRA_qual_inject_retval_DEPENDENCIES) + @rm -f qual_inject-retval$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_retval_OBJECTS) $(qual_inject_retval_LDADD) $(LIBS) + +qual_inject-signal$(EXEEXT): $(qual_inject_signal_OBJECTS) $(qual_inject_signal_DEPENDENCIES) $(EXTRA_qual_inject_signal_DEPENDENCIES) + @rm -f qual_inject-signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_inject_signal_OBJECTS) $(qual_inject_signal_LDADD) $(LIBS) + +qual_signal$(EXEEXT): $(qual_signal_OBJECTS) $(qual_signal_DEPENDENCIES) $(EXTRA_qual_signal_DEPENDENCIES) + @rm -f qual_signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(qual_signal_OBJECTS) $(qual_signal_LDADD) $(LIBS) + +quotactl$(EXEEXT): $(quotactl_OBJECTS) $(quotactl_DEPENDENCIES) $(EXTRA_quotactl_DEPENDENCIES) + @rm -f quotactl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_OBJECTS) $(quotactl_LDADD) $(LIBS) + +quotactl-v$(EXEEXT): $(quotactl_v_OBJECTS) $(quotactl_v_DEPENDENCIES) $(EXTRA_quotactl_v_DEPENDENCIES) + @rm -f quotactl-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_v_OBJECTS) $(quotactl_v_LDADD) $(LIBS) + +quotactl-xfs$(EXEEXT): $(quotactl_xfs_OBJECTS) $(quotactl_xfs_DEPENDENCIES) $(EXTRA_quotactl_xfs_DEPENDENCIES) + @rm -f quotactl-xfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_OBJECTS) $(quotactl_xfs_LDADD) $(LIBS) + +quotactl-xfs-v$(EXEEXT): $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_v_DEPENDENCIES) + @rm -f quotactl-xfs-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_LDADD) $(LIBS) + +read-write$(EXEEXT): $(read_write_OBJECTS) $(read_write_DEPENDENCIES) $(EXTRA_read_write_DEPENDENCIES) + @rm -f read-write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(read_write_OBJECTS) $(read_write_LDADD) $(LIBS) + +readahead$(EXEEXT): $(readahead_OBJECTS) $(readahead_DEPENDENCIES) $(EXTRA_readahead_DEPENDENCIES) + @rm -f readahead$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readahead_OBJECTS) $(readahead_LDADD) $(LIBS) + +readdir$(EXEEXT): $(readdir_OBJECTS) $(readdir_DEPENDENCIES) $(EXTRA_readdir_DEPENDENCIES) + @rm -f readdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readdir_OBJECTS) $(readdir_LDADD) $(LIBS) + +readlink$(EXEEXT): $(readlink_OBJECTS) $(readlink_DEPENDENCIES) $(EXTRA_readlink_DEPENDENCIES) + @rm -f readlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readlink_OBJECTS) $(readlink_LDADD) $(LIBS) + +readlinkat$(EXEEXT): $(readlinkat_OBJECTS) $(readlinkat_DEPENDENCIES) $(EXTRA_readlinkat_DEPENDENCIES) + @rm -f readlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readlinkat_OBJECTS) $(readlinkat_LDADD) $(LIBS) + +readv$(EXEEXT): $(readv_OBJECTS) $(readv_DEPENDENCIES) $(EXTRA_readv_DEPENDENCIES) + @rm -f readv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(readv_OBJECTS) $(readv_LDADD) $(LIBS) + +reboot$(EXEEXT): $(reboot_OBJECTS) $(reboot_DEPENDENCIES) $(EXTRA_reboot_DEPENDENCIES) + @rm -f reboot$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(reboot_OBJECTS) $(reboot_LDADD) $(LIBS) + +recvfrom$(EXEEXT): $(recvfrom_OBJECTS) $(recvfrom_DEPENDENCIES) $(EXTRA_recvfrom_DEPENDENCIES) + @rm -f recvfrom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvfrom_OBJECTS) $(recvfrom_LDADD) $(LIBS) + +recvmmsg-timeout$(EXEEXT): $(recvmmsg_timeout_OBJECTS) $(recvmmsg_timeout_DEPENDENCIES) $(EXTRA_recvmmsg_timeout_DEPENDENCIES) + @rm -f recvmmsg-timeout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvmmsg_timeout_OBJECTS) $(recvmmsg_timeout_LDADD) $(LIBS) + +recvmsg$(EXEEXT): $(recvmsg_OBJECTS) $(recvmsg_DEPENDENCIES) $(EXTRA_recvmsg_DEPENDENCIES) + @rm -f recvmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recvmsg_OBJECTS) $(recvmsg_LDADD) $(LIBS) + +redirect-fds$(EXEEXT): $(redirect_fds_OBJECTS) $(redirect_fds_DEPENDENCIES) $(EXTRA_redirect_fds_DEPENDENCIES) + @rm -f redirect-fds$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(redirect_fds_OBJECTS) $(redirect_fds_LDADD) $(LIBS) + +remap_file_pages$(EXEEXT): $(remap_file_pages_OBJECTS) $(remap_file_pages_DEPENDENCIES) $(EXTRA_remap_file_pages_DEPENDENCIES) + @rm -f remap_file_pages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_OBJECTS) $(remap_file_pages_LDADD) $(LIBS) + +rename$(EXEEXT): $(rename_OBJECTS) $(rename_DEPENDENCIES) $(EXTRA_rename_DEPENDENCIES) + @rm -f rename$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rename_OBJECTS) $(rename_LDADD) $(LIBS) + +renameat$(EXEEXT): $(renameat_OBJECTS) $(renameat_DEPENDENCIES) $(EXTRA_renameat_DEPENDENCIES) + @rm -f renameat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(renameat_OBJECTS) $(renameat_LDADD) $(LIBS) + +renameat2$(EXEEXT): $(renameat2_OBJECTS) $(renameat2_DEPENDENCIES) $(EXTRA_renameat2_DEPENDENCIES) + @rm -f renameat2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(renameat2_OBJECTS) $(renameat2_LDADD) $(LIBS) + +request_key$(EXEEXT): $(request_key_OBJECTS) $(request_key_DEPENDENCIES) $(EXTRA_request_key_DEPENDENCIES) + @rm -f request_key$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(request_key_OBJECTS) $(request_key_LDADD) $(LIBS) + +restart_syscall$(EXEEXT): $(restart_syscall_OBJECTS) $(restart_syscall_DEPENDENCIES) $(EXTRA_restart_syscall_DEPENDENCIES) + @rm -f restart_syscall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(restart_syscall_OBJECTS) $(restart_syscall_LDADD) $(LIBS) + +rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) $(EXTRA_rmdir_DEPENDENCIES) + @rm -f rmdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) + +rt_sigpending$(EXEEXT): $(rt_sigpending_OBJECTS) $(rt_sigpending_DEPENDENCIES) $(EXTRA_rt_sigpending_DEPENDENCIES) + @rm -f rt_sigpending$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigpending_OBJECTS) $(rt_sigpending_LDADD) $(LIBS) + +rt_sigprocmask$(EXEEXT): $(rt_sigprocmask_OBJECTS) $(rt_sigprocmask_DEPENDENCIES) $(EXTRA_rt_sigprocmask_DEPENDENCIES) + @rm -f rt_sigprocmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigprocmask_OBJECTS) $(rt_sigprocmask_LDADD) $(LIBS) + +rt_sigqueueinfo$(EXEEXT): $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_DEPENDENCIES) $(EXTRA_rt_sigqueueinfo_DEPENDENCIES) + @rm -f rt_sigqueueinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_LDADD) $(LIBS) + +rt_sigsuspend$(EXEEXT): $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_DEPENDENCIES) $(EXTRA_rt_sigsuspend_DEPENDENCIES) + @rm -f rt_sigsuspend$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_LDADD) $(LIBS) + +rt_sigtimedwait$(EXEEXT): $(rt_sigtimedwait_OBJECTS) $(rt_sigtimedwait_DEPENDENCIES) $(EXTRA_rt_sigtimedwait_DEPENDENCIES) + @rm -f rt_sigtimedwait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigtimedwait_OBJECTS) $(rt_sigtimedwait_LDADD) $(LIBS) + +rt_tgsigqueueinfo$(EXEEXT): $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_DEPENDENCIES) $(EXTRA_rt_tgsigqueueinfo_DEPENDENCIES) + @rm -f rt_tgsigqueueinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_LDADD) $(LIBS) + +sched_get_priority_mxx$(EXEEXT): $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_DEPENDENCIES) $(EXTRA_sched_get_priority_mxx_DEPENDENCIES) + @rm -f sched_get_priority_mxx$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_LDADD) $(LIBS) + +sched_rr_get_interval$(EXEEXT): $(sched_rr_get_interval_OBJECTS) $(sched_rr_get_interval_DEPENDENCIES) $(EXTRA_sched_rr_get_interval_DEPENDENCIES) + @rm -f sched_rr_get_interval$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_rr_get_interval_OBJECTS) $(sched_rr_get_interval_LDADD) $(LIBS) + +sched_xetaffinity$(EXEEXT): $(sched_xetaffinity_OBJECTS) $(sched_xetaffinity_DEPENDENCIES) $(EXTRA_sched_xetaffinity_DEPENDENCIES) + @rm -f sched_xetaffinity$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetaffinity_OBJECTS) $(sched_xetaffinity_LDADD) $(LIBS) + +sched_xetattr$(EXEEXT): $(sched_xetattr_OBJECTS) $(sched_xetattr_DEPENDENCIES) $(EXTRA_sched_xetattr_DEPENDENCIES) + @rm -f sched_xetattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetattr_OBJECTS) $(sched_xetattr_LDADD) $(LIBS) + +sched_xetparam$(EXEEXT): $(sched_xetparam_OBJECTS) $(sched_xetparam_DEPENDENCIES) $(EXTRA_sched_xetparam_DEPENDENCIES) + @rm -f sched_xetparam$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetparam_OBJECTS) $(sched_xetparam_LDADD) $(LIBS) + +sched_xetscheduler$(EXEEXT): $(sched_xetscheduler_OBJECTS) $(sched_xetscheduler_DEPENDENCIES) $(EXTRA_sched_xetscheduler_DEPENDENCIES) + @rm -f sched_xetscheduler$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_xetscheduler_OBJECTS) $(sched_xetscheduler_LDADD) $(LIBS) + +sched_yield$(EXEEXT): $(sched_yield_OBJECTS) $(sched_yield_DEPENDENCIES) $(EXTRA_sched_yield_DEPENDENCIES) + @rm -f sched_yield$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sched_yield_OBJECTS) $(sched_yield_LDADD) $(LIBS) + +scm_rights$(EXEEXT): $(scm_rights_OBJECTS) $(scm_rights_DEPENDENCIES) $(EXTRA_scm_rights_DEPENDENCIES) + @rm -f scm_rights$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(scm_rights_OBJECTS) $(scm_rights_LDADD) $(LIBS) + +seccomp-filter$(EXEEXT): $(seccomp_filter_OBJECTS) $(seccomp_filter_DEPENDENCIES) $(EXTRA_seccomp_filter_DEPENDENCIES) + @rm -f seccomp-filter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_filter_OBJECTS) $(seccomp_filter_LDADD) $(LIBS) + +seccomp-filter-v$(EXEEXT): $(seccomp_filter_v_OBJECTS) $(seccomp_filter_v_DEPENDENCIES) $(EXTRA_seccomp_filter_v_DEPENDENCIES) + @rm -f seccomp-filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_filter_v_OBJECTS) $(seccomp_filter_v_LDADD) $(LIBS) + +seccomp-strict$(EXEEXT): $(seccomp_strict_OBJECTS) $(seccomp_strict_DEPENDENCIES) $(EXTRA_seccomp_strict_DEPENDENCIES) + @rm -f seccomp-strict$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_strict_OBJECTS) $(seccomp_strict_LDADD) $(LIBS) + +select$(EXEEXT): $(select_OBJECTS) $(select_DEPENDENCIES) $(EXTRA_select_DEPENDENCIES) + @rm -f select$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(select_OBJECTS) $(select_LDADD) $(LIBS) + +semop$(EXEEXT): $(semop_OBJECTS) $(semop_DEPENDENCIES) $(EXTRA_semop_DEPENDENCIES) + @rm -f semop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(semop_OBJECTS) $(semop_LDADD) $(LIBS) + +sendfile$(EXEEXT): $(sendfile_OBJECTS) $(sendfile_DEPENDENCIES) $(EXTRA_sendfile_DEPENDENCIES) + @rm -f sendfile$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sendfile_OBJECTS) $(sendfile_LDADD) $(LIBS) + +sendfile64$(EXEEXT): $(sendfile64_OBJECTS) $(sendfile64_DEPENDENCIES) $(EXTRA_sendfile64_DEPENDENCIES) + @rm -f sendfile64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sendfile64_OBJECTS) $(sendfile64_LDADD) $(LIBS) + +set_mempolicy$(EXEEXT): $(set_mempolicy_OBJECTS) $(set_mempolicy_DEPENDENCIES) $(EXTRA_set_mempolicy_DEPENDENCIES) + @rm -f set_mempolicy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_mempolicy_OBJECTS) $(set_mempolicy_LDADD) $(LIBS) + +set_ptracer_any$(EXEEXT): $(set_ptracer_any_OBJECTS) $(set_ptracer_any_DEPENDENCIES) $(EXTRA_set_ptracer_any_DEPENDENCIES) + @rm -f set_ptracer_any$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_ptracer_any_OBJECTS) $(set_ptracer_any_LDADD) $(LIBS) + +setdomainname$(EXEEXT): $(setdomainname_OBJECTS) $(setdomainname_DEPENDENCIES) $(EXTRA_setdomainname_DEPENDENCIES) + @rm -f setdomainname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setdomainname_OBJECTS) $(setdomainname_LDADD) $(LIBS) + +setfsgid$(EXEEXT): $(setfsgid_OBJECTS) $(setfsgid_DEPENDENCIES) $(EXTRA_setfsgid_DEPENDENCIES) + @rm -f setfsgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsgid_OBJECTS) $(setfsgid_LDADD) $(LIBS) + +setfsgid32$(EXEEXT): $(setfsgid32_OBJECTS) $(setfsgid32_DEPENDENCIES) $(EXTRA_setfsgid32_DEPENDENCIES) + @rm -f setfsgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsgid32_OBJECTS) $(setfsgid32_LDADD) $(LIBS) + +setfsuid$(EXEEXT): $(setfsuid_OBJECTS) $(setfsuid_DEPENDENCIES) $(EXTRA_setfsuid_DEPENDENCIES) + @rm -f setfsuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsuid_OBJECTS) $(setfsuid_LDADD) $(LIBS) + +setfsuid32$(EXEEXT): $(setfsuid32_OBJECTS) $(setfsuid32_DEPENDENCIES) $(EXTRA_setfsuid32_DEPENDENCIES) + @rm -f setfsuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setfsuid32_OBJECTS) $(setfsuid32_LDADD) $(LIBS) + +setgid$(EXEEXT): $(setgid_OBJECTS) $(setgid_DEPENDENCIES) $(EXTRA_setgid_DEPENDENCIES) + @rm -f setgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgid_OBJECTS) $(setgid_LDADD) $(LIBS) + +setgid32$(EXEEXT): $(setgid32_OBJECTS) $(setgid32_DEPENDENCIES) $(EXTRA_setgid32_DEPENDENCIES) + @rm -f setgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgid32_OBJECTS) $(setgid32_LDADD) $(LIBS) + +setgroups$(EXEEXT): $(setgroups_OBJECTS) $(setgroups_DEPENDENCIES) $(EXTRA_setgroups_DEPENDENCIES) + @rm -f setgroups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgroups_OBJECTS) $(setgroups_LDADD) $(LIBS) + +setgroups32$(EXEEXT): $(setgroups32_OBJECTS) $(setgroups32_DEPENDENCIES) $(EXTRA_setgroups32_DEPENDENCIES) + @rm -f setgroups32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setgroups32_OBJECTS) $(setgroups32_LDADD) $(LIBS) + +sethostname$(EXEEXT): $(sethostname_OBJECTS) $(sethostname_DEPENDENCIES) $(EXTRA_sethostname_DEPENDENCIES) + @rm -f sethostname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sethostname_OBJECTS) $(sethostname_LDADD) $(LIBS) + +setns$(EXEEXT): $(setns_OBJECTS) $(setns_DEPENDENCIES) $(EXTRA_setns_DEPENDENCIES) + @rm -f setns$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setns_OBJECTS) $(setns_LDADD) $(LIBS) + +setregid$(EXEEXT): $(setregid_OBJECTS) $(setregid_DEPENDENCIES) $(EXTRA_setregid_DEPENDENCIES) + @rm -f setregid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setregid_OBJECTS) $(setregid_LDADD) $(LIBS) + +setregid32$(EXEEXT): $(setregid32_OBJECTS) $(setregid32_DEPENDENCIES) $(EXTRA_setregid32_DEPENDENCIES) + @rm -f setregid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setregid32_OBJECTS) $(setregid32_LDADD) $(LIBS) + +setresgid$(EXEEXT): $(setresgid_OBJECTS) $(setresgid_DEPENDENCIES) $(EXTRA_setresgid_DEPENDENCIES) + @rm -f setresgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresgid_OBJECTS) $(setresgid_LDADD) $(LIBS) + +setresgid32$(EXEEXT): $(setresgid32_OBJECTS) $(setresgid32_DEPENDENCIES) $(EXTRA_setresgid32_DEPENDENCIES) + @rm -f setresgid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresgid32_OBJECTS) $(setresgid32_LDADD) $(LIBS) + +setresuid$(EXEEXT): $(setresuid_OBJECTS) $(setresuid_DEPENDENCIES) $(EXTRA_setresuid_DEPENDENCIES) + @rm -f setresuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresuid_OBJECTS) $(setresuid_LDADD) $(LIBS) + +setresuid32$(EXEEXT): $(setresuid32_OBJECTS) $(setresuid32_DEPENDENCIES) $(EXTRA_setresuid32_DEPENDENCIES) + @rm -f setresuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setresuid32_OBJECTS) $(setresuid32_LDADD) $(LIBS) + +setreuid$(EXEEXT): $(setreuid_OBJECTS) $(setreuid_DEPENDENCIES) $(EXTRA_setreuid_DEPENDENCIES) + @rm -f setreuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setreuid_OBJECTS) $(setreuid_LDADD) $(LIBS) + +setreuid32$(EXEEXT): $(setreuid32_OBJECTS) $(setreuid32_DEPENDENCIES) $(EXTRA_setreuid32_DEPENDENCIES) + @rm -f setreuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setreuid32_OBJECTS) $(setreuid32_LDADD) $(LIBS) + +setrlimit$(EXEEXT): $(setrlimit_OBJECTS) $(setrlimit_DEPENDENCIES) $(EXTRA_setrlimit_DEPENDENCIES) + @rm -f setrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_OBJECTS) $(setrlimit_LDADD) $(LIBS) + +setuid$(EXEEXT): $(setuid_OBJECTS) $(setuid_DEPENDENCIES) $(EXTRA_setuid_DEPENDENCIES) + @rm -f setuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setuid_OBJECTS) $(setuid_LDADD) $(LIBS) + +setuid32$(EXEEXT): $(setuid32_OBJECTS) $(setuid32_DEPENDENCIES) $(EXTRA_setuid32_DEPENDENCIES) + @rm -f setuid32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setuid32_OBJECTS) $(setuid32_LDADD) $(LIBS) + +shmxt$(EXEEXT): $(shmxt_OBJECTS) $(shmxt_DEPENDENCIES) $(EXTRA_shmxt_DEPENDENCIES) + @rm -f shmxt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shmxt_OBJECTS) $(shmxt_LDADD) $(LIBS) + +shutdown$(EXEEXT): $(shutdown_OBJECTS) $(shutdown_DEPENDENCIES) $(EXTRA_shutdown_DEPENDENCIES) + @rm -f shutdown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shutdown_OBJECTS) $(shutdown_LDADD) $(LIBS) + +sigaction$(EXEEXT): $(sigaction_OBJECTS) $(sigaction_DEPENDENCIES) $(EXTRA_sigaction_DEPENDENCIES) + @rm -f sigaction$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigaction_OBJECTS) $(sigaction_LDADD) $(LIBS) + +sigaltstack$(EXEEXT): $(sigaltstack_OBJECTS) $(sigaltstack_DEPENDENCIES) $(EXTRA_sigaltstack_DEPENDENCIES) + @rm -f sigaltstack$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigaltstack_OBJECTS) $(sigaltstack_LDADD) $(LIBS) + +siginfo$(EXEEXT): $(siginfo_OBJECTS) $(siginfo_DEPENDENCIES) $(EXTRA_siginfo_DEPENDENCIES) + @rm -f siginfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(siginfo_OBJECTS) $(siginfo_LDADD) $(LIBS) + +signal_receive$(EXEEXT): $(signal_receive_OBJECTS) $(signal_receive_DEPENDENCIES) $(EXTRA_signal_receive_DEPENDENCIES) + @rm -f signal_receive$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signal_receive_OBJECTS) $(signal_receive_LDADD) $(LIBS) + +signalfd4$(EXEEXT): $(signalfd4_OBJECTS) $(signalfd4_DEPENDENCIES) $(EXTRA_signalfd4_DEPENDENCIES) + @rm -f signalfd4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signalfd4_OBJECTS) $(signalfd4_LDADD) $(LIBS) + +sigreturn$(EXEEXT): $(sigreturn_OBJECTS) $(sigreturn_DEPENDENCIES) $(EXTRA_sigreturn_DEPENDENCIES) + @rm -f sigreturn$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigreturn_OBJECTS) $(sigreturn_LDADD) $(LIBS) + +sleep$(EXEEXT): $(sleep_OBJECTS) $(sleep_DEPENDENCIES) $(EXTRA_sleep_DEPENDENCIES) + @rm -f sleep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) + +socketcall$(EXEEXT): $(socketcall_OBJECTS) $(socketcall_DEPENDENCIES) $(EXTRA_socketcall_DEPENDENCIES) + @rm -f socketcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(socketcall_OBJECTS) $(socketcall_LDADD) $(LIBS) + +splice$(EXEEXT): $(splice_OBJECTS) $(splice_DEPENDENCIES) $(EXTRA_splice_DEPENDENCIES) + @rm -f splice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(splice_OBJECTS) $(splice_LDADD) $(LIBS) + +stack-fcall$(EXEEXT): $(stack_fcall_OBJECTS) $(stack_fcall_DEPENDENCIES) $(EXTRA_stack_fcall_DEPENDENCIES) + @rm -f stack-fcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) + +stat$(EXEEXT): $(stat_OBJECTS) $(stat_DEPENDENCIES) $(EXTRA_stat_DEPENDENCIES) + @rm -f stat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) + +stat64$(EXEEXT): $(stat64_OBJECTS) $(stat64_DEPENDENCIES) $(EXTRA_stat64_DEPENDENCIES) + @rm -f stat64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stat64_OBJECTS) $(stat64_LDADD) $(LIBS) + +statfs$(EXEEXT): $(statfs_OBJECTS) $(statfs_DEPENDENCIES) $(EXTRA_statfs_DEPENDENCIES) + @rm -f statfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statfs_OBJECTS) $(statfs_LDADD) $(LIBS) + +statfs64$(EXEEXT): $(statfs64_OBJECTS) $(statfs64_DEPENDENCIES) $(EXTRA_statfs64_DEPENDENCIES) + @rm -f statfs64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statfs64_OBJECTS) $(statfs64_LDADD) $(LIBS) + +swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES) $(EXTRA_swap_DEPENDENCIES) + @rm -f swap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(swap_OBJECTS) $(swap_LDADD) $(LIBS) + +symlink$(EXEEXT): $(symlink_OBJECTS) $(symlink_DEPENDENCIES) $(EXTRA_symlink_DEPENDENCIES) + @rm -f symlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(symlink_OBJECTS) $(symlink_LDADD) $(LIBS) + +symlinkat$(EXEEXT): $(symlinkat_OBJECTS) $(symlinkat_DEPENDENCIES) $(EXTRA_symlinkat_DEPENDENCIES) + @rm -f symlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(symlinkat_OBJECTS) $(symlinkat_LDADD) $(LIBS) + +sync$(EXEEXT): $(sync_OBJECTS) $(sync_DEPENDENCIES) $(EXTRA_sync_DEPENDENCIES) + @rm -f sync$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_OBJECTS) $(sync_LDADD) $(LIBS) + +sync_file_range$(EXEEXT): $(sync_file_range_OBJECTS) $(sync_file_range_DEPENDENCIES) $(EXTRA_sync_file_range_DEPENDENCIES) + @rm -f sync_file_range$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_file_range_OBJECTS) $(sync_file_range_LDADD) $(LIBS) + +sync_file_range2$(EXEEXT): $(sync_file_range2_OBJECTS) $(sync_file_range2_DEPENDENCIES) $(EXTRA_sync_file_range2_DEPENDENCIES) + @rm -f sync_file_range2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_file_range2_OBJECTS) $(sync_file_range2_LDADD) $(LIBS) + +sysinfo$(EXEEXT): $(sysinfo_OBJECTS) $(sysinfo_DEPENDENCIES) $(EXTRA_sysinfo_DEPENDENCIES) + @rm -f sysinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sysinfo_OBJECTS) $(sysinfo_LDADD) $(LIBS) + +syslog$(EXEEXT): $(syslog_OBJECTS) $(syslog_DEPENDENCIES) $(EXTRA_syslog_DEPENDENCIES) + @rm -f syslog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(syslog_OBJECTS) $(syslog_LDADD) $(LIBS) + +tee$(EXEEXT): $(tee_OBJECTS) $(tee_DEPENDENCIES) $(EXTRA_tee_DEPENDENCIES) + @rm -f tee$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tee_OBJECTS) $(tee_LDADD) $(LIBS) + +threads-execve$(EXEEXT): $(threads_execve_OBJECTS) $(threads_execve_DEPENDENCIES) $(EXTRA_threads_execve_DEPENDENCIES) + @rm -f threads-execve$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(threads_execve_OBJECTS) $(threads_execve_LDADD) $(LIBS) + +time$(EXEEXT): $(time_OBJECTS) $(time_DEPENDENCIES) $(EXTRA_time_DEPENDENCIES) + @rm -f time$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(time_OBJECTS) $(time_LDADD) $(LIBS) + +timer_create$(EXEEXT): $(timer_create_OBJECTS) $(timer_create_DEPENDENCIES) $(EXTRA_timer_create_DEPENDENCIES) + @rm -f timer_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timer_create_OBJECTS) $(timer_create_LDADD) $(LIBS) + +timer_xettime$(EXEEXT): $(timer_xettime_OBJECTS) $(timer_xettime_DEPENDENCIES) $(EXTRA_timer_xettime_DEPENDENCIES) + @rm -f timer_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timer_xettime_OBJECTS) $(timer_xettime_LDADD) $(LIBS) + +timerfd_xettime$(EXEEXT): $(timerfd_xettime_OBJECTS) $(timerfd_xettime_DEPENDENCIES) $(EXTRA_timerfd_xettime_DEPENDENCIES) + @rm -f timerfd_xettime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timerfd_xettime_OBJECTS) $(timerfd_xettime_LDADD) $(LIBS) + +times$(EXEEXT): $(times_OBJECTS) $(times_DEPENDENCIES) $(EXTRA_times_DEPENDENCIES) + @rm -f times$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(times_OBJECTS) $(times_LDADD) $(LIBS) + +times-fail$(EXEEXT): $(times_fail_OBJECTS) $(times_fail_DEPENDENCIES) $(EXTRA_times_fail_DEPENDENCIES) + @rm -f times-fail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(times_fail_OBJECTS) $(times_fail_LDADD) $(LIBS) + +truncate$(EXEEXT): $(truncate_OBJECTS) $(truncate_DEPENDENCIES) $(EXTRA_truncate_DEPENDENCIES) + @rm -f truncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(truncate_OBJECTS) $(truncate_LDADD) $(LIBS) + +truncate64$(EXEEXT): $(truncate64_OBJECTS) $(truncate64_DEPENDENCIES) $(EXTRA_truncate64_DEPENDENCIES) + @rm -f truncate64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(truncate64_OBJECTS) $(truncate64_LDADD) $(LIBS) + +ugetrlimit$(EXEEXT): $(ugetrlimit_OBJECTS) $(ugetrlimit_DEPENDENCIES) $(EXTRA_ugetrlimit_DEPENDENCIES) + @rm -f ugetrlimit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ugetrlimit_OBJECTS) $(ugetrlimit_LDADD) $(LIBS) + +uio$(EXEEXT): $(uio_OBJECTS) $(uio_DEPENDENCIES) $(EXTRA_uio_DEPENDENCIES) + @rm -f uio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(uio_OBJECTS) $(uio_LDADD) $(LIBS) + +umask$(EXEEXT): $(umask_OBJECTS) $(umask_DEPENDENCIES) $(EXTRA_umask_DEPENDENCIES) + @rm -f umask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umask_OBJECTS) $(umask_LDADD) $(LIBS) + +umount$(EXEEXT): $(umount_OBJECTS) $(umount_DEPENDENCIES) $(EXTRA_umount_DEPENDENCIES) + @rm -f umount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umount_OBJECTS) $(umount_LDADD) $(LIBS) + +umount2$(EXEEXT): $(umount2_OBJECTS) $(umount2_DEPENDENCIES) $(EXTRA_umount2_DEPENDENCIES) + @rm -f umount2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umount2_OBJECTS) $(umount2_LDADD) $(LIBS) + +umoven-illptr$(EXEEXT): $(umoven_illptr_OBJECTS) $(umoven_illptr_DEPENDENCIES) $(EXTRA_umoven_illptr_DEPENDENCIES) + @rm -f umoven-illptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umoven_illptr_OBJECTS) $(umoven_illptr_LDADD) $(LIBS) + +umovestr$(EXEEXT): $(umovestr_OBJECTS) $(umovestr_DEPENDENCIES) $(EXTRA_umovestr_DEPENDENCIES) + @rm -f umovestr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr_OBJECTS) $(umovestr_LDADD) $(LIBS) + +umovestr-illptr$(EXEEXT): $(umovestr_illptr_OBJECTS) $(umovestr_illptr_DEPENDENCIES) $(EXTRA_umovestr_illptr_DEPENDENCIES) + @rm -f umovestr-illptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr_illptr_OBJECTS) $(umovestr_illptr_LDADD) $(LIBS) + +umovestr2$(EXEEXT): $(umovestr2_OBJECTS) $(umovestr2_DEPENDENCIES) $(EXTRA_umovestr2_DEPENDENCIES) + @rm -f umovestr2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr2_OBJECTS) $(umovestr2_LDADD) $(LIBS) + +umovestr3$(EXEEXT): $(umovestr3_OBJECTS) $(umovestr3_DEPENDENCIES) $(EXTRA_umovestr3_DEPENDENCIES) + @rm -f umovestr3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(umovestr3_OBJECTS) $(umovestr3_LDADD) $(LIBS) + +uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) $(EXTRA_uname_DEPENDENCIES) + @rm -f uname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) + +unix-pair-send-recv$(EXEEXT): $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_DEPENDENCIES) $(EXTRA_unix_pair_send_recv_DEPENDENCIES) + @rm -f unix-pair-send-recv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_LDADD) $(LIBS) + +unix-pair-sendto-recvfrom$(EXEEXT): $(unix_pair_sendto_recvfrom_OBJECTS) $(unix_pair_sendto_recvfrom_DEPENDENCIES) $(EXTRA_unix_pair_sendto_recvfrom_DEPENDENCIES) + @rm -f unix-pair-sendto-recvfrom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unix_pair_sendto_recvfrom_OBJECTS) $(unix_pair_sendto_recvfrom_LDADD) $(LIBS) + +unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) $(EXTRA_unlink_DEPENDENCIES) + @rm -f unlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) + +unlinkat$(EXEEXT): $(unlinkat_OBJECTS) $(unlinkat_DEPENDENCIES) $(EXTRA_unlinkat_DEPENDENCIES) + @rm -f unlinkat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unlinkat_OBJECTS) $(unlinkat_LDADD) $(LIBS) + +unshare$(EXEEXT): $(unshare_OBJECTS) $(unshare_DEPENDENCIES) $(EXTRA_unshare_DEPENDENCIES) + @rm -f unshare$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unshare_OBJECTS) $(unshare_LDADD) $(LIBS) + +userfaultfd$(EXEEXT): $(userfaultfd_OBJECTS) $(userfaultfd_DEPENDENCIES) $(EXTRA_userfaultfd_DEPENDENCIES) + @rm -f userfaultfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(userfaultfd_OBJECTS) $(userfaultfd_LDADD) $(LIBS) + +ustat$(EXEEXT): $(ustat_OBJECTS) $(ustat_DEPENDENCIES) $(EXTRA_ustat_DEPENDENCIES) + @rm -f ustat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ustat_OBJECTS) $(ustat_LDADD) $(LIBS) + +utime$(EXEEXT): $(utime_OBJECTS) $(utime_DEPENDENCIES) $(EXTRA_utime_DEPENDENCIES) + @rm -f utime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utime_OBJECTS) $(utime_LDADD) $(LIBS) + +utimensat$(EXEEXT): $(utimensat_OBJECTS) $(utimensat_DEPENDENCIES) $(EXTRA_utimensat_DEPENDENCIES) + @rm -f utimensat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_OBJECTS) $(utimensat_LDADD) $(LIBS) + +utimes$(EXEEXT): $(utimes_OBJECTS) $(utimes_DEPENDENCIES) $(EXTRA_utimes_DEPENDENCIES) + @rm -f utimes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimes_OBJECTS) $(utimes_LDADD) $(LIBS) + +vfork-f$(EXEEXT): $(vfork_f_OBJECTS) $(vfork_f_DEPENDENCIES) $(EXTRA_vfork_f_DEPENDENCIES) + @rm -f vfork-f$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfork_f_OBJECTS) $(vfork_f_LDADD) $(LIBS) + +vhangup$(EXEEXT): $(vhangup_OBJECTS) $(vhangup_DEPENDENCIES) $(EXTRA_vhangup_DEPENDENCIES) + @rm -f vhangup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vhangup_OBJECTS) $(vhangup_LDADD) $(LIBS) + +vmsplice$(EXEEXT): $(vmsplice_OBJECTS) $(vmsplice_DEPENDENCIES) $(EXTRA_vmsplice_DEPENDENCIES) + @rm -f vmsplice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vmsplice_OBJECTS) $(vmsplice_LDADD) $(LIBS) + +wait4$(EXEEXT): $(wait4_OBJECTS) $(wait4_DEPENDENCIES) $(EXTRA_wait4_DEPENDENCIES) + @rm -f wait4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wait4_OBJECTS) $(wait4_LDADD) $(LIBS) + +wait4-v$(EXEEXT): $(wait4_v_OBJECTS) $(wait4_v_DEPENDENCIES) $(EXTRA_wait4_v_DEPENDENCIES) + @rm -f wait4-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wait4_v_OBJECTS) $(wait4_v_LDADD) $(LIBS) + +waitid$(EXEEXT): $(waitid_OBJECTS) $(waitid_DEPENDENCIES) $(EXTRA_waitid_DEPENDENCIES) + @rm -f waitid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitid_OBJECTS) $(waitid_LDADD) $(LIBS) + +waitid-v$(EXEEXT): $(waitid_v_OBJECTS) $(waitid_v_DEPENDENCIES) $(EXTRA_waitid_v_DEPENDENCIES) + @rm -f waitid-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitid_v_OBJECTS) $(waitid_v_LDADD) $(LIBS) + +waitpid$(EXEEXT): $(waitpid_OBJECTS) $(waitpid_DEPENDENCIES) $(EXTRA_waitpid_DEPENDENCIES) + @rm -f waitpid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(waitpid_OBJECTS) $(waitpid_LDADD) $(LIBS) + +xattr$(EXEEXT): $(xattr_OBJECTS) $(xattr_DEPENDENCIES) $(EXTRA_xattr_DEPENDENCIES) + @rm -f xattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xattr_OBJECTS) $(xattr_LDADD) $(LIBS) + +xattr-strings$(EXEEXT): $(xattr_strings_OBJECTS) $(xattr_strings_DEPENDENCIES) $(EXTRA_xattr_strings_DEPENDENCIES) + @rm -f xattr-strings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xattr_strings_OBJECTS) $(xattr_strings_LDADD) $(LIBS) + +xet_robust_list$(EXEEXT): $(xet_robust_list_OBJECTS) $(xet_robust_list_DEPENDENCIES) $(EXTRA_xet_robust_list_DEPENDENCIES) + @rm -f xet_robust_list$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xet_robust_list_OBJECTS) $(xet_robust_list_LDADD) $(LIBS) + +xetitimer$(EXEEXT): $(xetitimer_OBJECTS) $(xetitimer_DEPENDENCIES) $(EXTRA_xetitimer_DEPENDENCIES) + @rm -f xetitimer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetitimer_OBJECTS) $(xetitimer_LDADD) $(LIBS) + +xetpgid$(EXEEXT): $(xetpgid_OBJECTS) $(xetpgid_DEPENDENCIES) $(EXTRA_xetpgid_DEPENDENCIES) + @rm -f xetpgid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetpgid_OBJECTS) $(xetpgid_LDADD) $(LIBS) + +xetpriority$(EXEEXT): $(xetpriority_OBJECTS) $(xetpriority_DEPENDENCIES) $(EXTRA_xetpriority_DEPENDENCIES) + @rm -f xetpriority$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xetpriority_OBJECTS) $(xetpriority_LDADD) $(LIBS) + +xettimeofday$(EXEEXT): $(xettimeofday_OBJECTS) $(xettimeofday_DEPENDENCIES) $(EXTRA_xettimeofday_DEPENDENCIES) + @rm -f xettimeofday$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xettimeofday_OBJECTS) $(xettimeofday_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +libtests_a-errno2name.o: errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='errno2name.c' object='libtests_a-errno2name.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c + +libtests_a-errno2name.obj: errno2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.obj -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.obj `if test -f 'errno2name.c'; then $(CYGPATH_W) 'errno2name.c'; else $(CYGPATH_W) '$(srcdir)/errno2name.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='errno2name.c' object='libtests_a-errno2name.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-errno2name.obj `if test -f 'errno2name.c'; then $(CYGPATH_W) 'errno2name.c'; else $(CYGPATH_W) '$(srcdir)/errno2name.c'; fi` + +libtests_a-error_msg.o: error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-error_msg.o -MD -MP -MF $(DEPDIR)/libtests_a-error_msg.Tpo -c -o libtests_a-error_msg.o `test -f 'error_msg.c' || echo '$(srcdir)/'`error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-error_msg.Tpo $(DEPDIR)/libtests_a-error_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_msg.c' object='libtests_a-error_msg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-error_msg.o `test -f 'error_msg.c' || echo '$(srcdir)/'`error_msg.c + +libtests_a-error_msg.obj: error_msg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-error_msg.obj -MD -MP -MF $(DEPDIR)/libtests_a-error_msg.Tpo -c -o libtests_a-error_msg.obj `if test -f 'error_msg.c'; then $(CYGPATH_W) 'error_msg.c'; else $(CYGPATH_W) '$(srcdir)/error_msg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-error_msg.Tpo $(DEPDIR)/libtests_a-error_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_msg.c' object='libtests_a-error_msg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-error_msg.obj `if test -f 'error_msg.c'; then $(CYGPATH_W) 'error_msg.c'; else $(CYGPATH_W) '$(srcdir)/error_msg.c'; fi` + +libtests_a-fill_memory.o: fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-fill_memory.o -MD -MP -MF $(DEPDIR)/libtests_a-fill_memory.Tpo -c -o libtests_a-fill_memory.o `test -f 'fill_memory.c' || echo '$(srcdir)/'`fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-fill_memory.Tpo $(DEPDIR)/libtests_a-fill_memory.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fill_memory.c' object='libtests_a-fill_memory.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-fill_memory.o `test -f 'fill_memory.c' || echo '$(srcdir)/'`fill_memory.c + +libtests_a-fill_memory.obj: fill_memory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-fill_memory.obj -MD -MP -MF $(DEPDIR)/libtests_a-fill_memory.Tpo -c -o libtests_a-fill_memory.obj `if test -f 'fill_memory.c'; then $(CYGPATH_W) 'fill_memory.c'; else $(CYGPATH_W) '$(srcdir)/fill_memory.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-fill_memory.Tpo $(DEPDIR)/libtests_a-fill_memory.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fill_memory.c' object='libtests_a-fill_memory.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-fill_memory.obj `if test -f 'fill_memory.c'; then $(CYGPATH_W) 'fill_memory.c'; else $(CYGPATH_W) '$(srcdir)/fill_memory.c'; fi` + +libtests_a-get_page_size.o: get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_page_size.o -MD -MP -MF $(DEPDIR)/libtests_a-get_page_size.Tpo -c -o libtests_a-get_page_size.o `test -f 'get_page_size.c' || echo '$(srcdir)/'`get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_page_size.Tpo $(DEPDIR)/libtests_a-get_page_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_page_size.c' object='libtests_a-get_page_size.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.o `test -f 'get_page_size.c' || echo '$(srcdir)/'`get_page_size.c + +libtests_a-get_page_size.obj: get_page_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_page_size.obj -MD -MP -MF $(DEPDIR)/libtests_a-get_page_size.Tpo -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_page_size.Tpo $(DEPDIR)/libtests_a-get_page_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_page_size.c' object='libtests_a-get_page_size.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` + +libtests_a-hexdump_strdup.o: hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexdump_strdup.c' object='libtests_a-hexdump_strdup.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c + +libtests_a-hexdump_strdup.obj: hexdump_strdup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.obj -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.obj `if test -f 'hexdump_strdup.c'; then $(CYGPATH_W) 'hexdump_strdup.c'; else $(CYGPATH_W) '$(srcdir)/hexdump_strdup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexdump_strdup.c' object='libtests_a-hexdump_strdup.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexdump_strdup.obj `if test -f 'hexdump_strdup.c'; then $(CYGPATH_W) 'hexdump_strdup.c'; else $(CYGPATH_W) '$(srcdir)/hexdump_strdup.c'; fi` + +libtests_a-hexquote_strndup.o: hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexquote_strndup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexquote_strndup.Tpo -c -o libtests_a-hexquote_strndup.o `test -f 'hexquote_strndup.c' || echo '$(srcdir)/'`hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexquote_strndup.Tpo $(DEPDIR)/libtests_a-hexquote_strndup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexquote_strndup.c' object='libtests_a-hexquote_strndup.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.o `test -f 'hexquote_strndup.c' || echo '$(srcdir)/'`hexquote_strndup.c + +libtests_a-hexquote_strndup.obj: hexquote_strndup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexquote_strndup.obj -MD -MP -MF $(DEPDIR)/libtests_a-hexquote_strndup.Tpo -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexquote_strndup.Tpo $(DEPDIR)/libtests_a-hexquote_strndup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hexquote_strndup.c' object='libtests_a-hexquote_strndup.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` + +libtests_a-inode_of_sockfd.o: inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.o -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inode_of_sockfd.c' object='libtests_a-inode_of_sockfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c + +libtests_a-inode_of_sockfd.obj: inode_of_sockfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.obj `if test -f 'inode_of_sockfd.c'; then $(CYGPATH_W) 'inode_of_sockfd.c'; else $(CYGPATH_W) '$(srcdir)/inode_of_sockfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inode_of_sockfd.c' object='libtests_a-inode_of_sockfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-inode_of_sockfd.obj `if test -f 'inode_of_sockfd.c'; then $(CYGPATH_W) 'inode_of_sockfd.c'; else $(CYGPATH_W) '$(srcdir)/inode_of_sockfd.c'; fi` + +libtests_a-libmmsg.o: libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libmmsg.o -MD -MP -MF $(DEPDIR)/libtests_a-libmmsg.Tpo -c -o libtests_a-libmmsg.o `test -f 'libmmsg.c' || echo '$(srcdir)/'`libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libmmsg.Tpo $(DEPDIR)/libtests_a-libmmsg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libmmsg.c' object='libtests_a-libmmsg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libmmsg.o `test -f 'libmmsg.c' || echo '$(srcdir)/'`libmmsg.c + +libtests_a-libmmsg.obj: libmmsg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libmmsg.obj -MD -MP -MF $(DEPDIR)/libtests_a-libmmsg.Tpo -c -o libtests_a-libmmsg.obj `if test -f 'libmmsg.c'; then $(CYGPATH_W) 'libmmsg.c'; else $(CYGPATH_W) '$(srcdir)/libmmsg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libmmsg.Tpo $(DEPDIR)/libtests_a-libmmsg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libmmsg.c' object='libtests_a-libmmsg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libmmsg.obj `if test -f 'libmmsg.c'; then $(CYGPATH_W) 'libmmsg.c'; else $(CYGPATH_W) '$(srcdir)/libmmsg.c'; fi` + +libtests_a-libsocketcall.o: libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libsocketcall.o -MD -MP -MF $(DEPDIR)/libtests_a-libsocketcall.Tpo -c -o libtests_a-libsocketcall.o `test -f 'libsocketcall.c' || echo '$(srcdir)/'`libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libsocketcall.Tpo $(DEPDIR)/libtests_a-libsocketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libsocketcall.c' object='libtests_a-libsocketcall.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libsocketcall.o `test -f 'libsocketcall.c' || echo '$(srcdir)/'`libsocketcall.c + +libtests_a-libsocketcall.obj: libsocketcall.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-libsocketcall.obj -MD -MP -MF $(DEPDIR)/libtests_a-libsocketcall.Tpo -c -o libtests_a-libsocketcall.obj `if test -f 'libsocketcall.c'; then $(CYGPATH_W) 'libsocketcall.c'; else $(CYGPATH_W) '$(srcdir)/libsocketcall.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-libsocketcall.Tpo $(DEPDIR)/libtests_a-libsocketcall.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libsocketcall.c' object='libtests_a-libsocketcall.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-libsocketcall.obj `if test -f 'libsocketcall.c'; then $(CYGPATH_W) 'libsocketcall.c'; else $(CYGPATH_W) '$(srcdir)/libsocketcall.c'; fi` + +libtests_a-overflowuid.o: overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-overflowuid.o -MD -MP -MF $(DEPDIR)/libtests_a-overflowuid.Tpo -c -o libtests_a-overflowuid.o `test -f 'overflowuid.c' || echo '$(srcdir)/'`overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-overflowuid.Tpo $(DEPDIR)/libtests_a-overflowuid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='overflowuid.c' object='libtests_a-overflowuid.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-overflowuid.o `test -f 'overflowuid.c' || echo '$(srcdir)/'`overflowuid.c + +libtests_a-overflowuid.obj: overflowuid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-overflowuid.obj -MD -MP -MF $(DEPDIR)/libtests_a-overflowuid.Tpo -c -o libtests_a-overflowuid.obj `if test -f 'overflowuid.c'; then $(CYGPATH_W) 'overflowuid.c'; else $(CYGPATH_W) '$(srcdir)/overflowuid.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-overflowuid.Tpo $(DEPDIR)/libtests_a-overflowuid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='overflowuid.c' object='libtests_a-overflowuid.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-overflowuid.obj `if test -f 'overflowuid.c'; then $(CYGPATH_W) 'overflowuid.c'; else $(CYGPATH_W) '$(srcdir)/overflowuid.c'; fi` + +libtests_a-pipe_maxfd.o: pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-pipe_maxfd.o -MD -MP -MF $(DEPDIR)/libtests_a-pipe_maxfd.Tpo -c -o libtests_a-pipe_maxfd.o `test -f 'pipe_maxfd.c' || echo '$(srcdir)/'`pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-pipe_maxfd.Tpo $(DEPDIR)/libtests_a-pipe_maxfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe_maxfd.c' object='libtests_a-pipe_maxfd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-pipe_maxfd.o `test -f 'pipe_maxfd.c' || echo '$(srcdir)/'`pipe_maxfd.c + +libtests_a-pipe_maxfd.obj: pipe_maxfd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-pipe_maxfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-pipe_maxfd.Tpo -c -o libtests_a-pipe_maxfd.obj `if test -f 'pipe_maxfd.c'; then $(CYGPATH_W) 'pipe_maxfd.c'; else $(CYGPATH_W) '$(srcdir)/pipe_maxfd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-pipe_maxfd.Tpo $(DEPDIR)/libtests_a-pipe_maxfd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe_maxfd.c' object='libtests_a-pipe_maxfd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-pipe_maxfd.obj `if test -f 'pipe_maxfd.c'; then $(CYGPATH_W) 'pipe_maxfd.c'; else $(CYGPATH_W) '$(srcdir)/pipe_maxfd.c'; fi` + +libtests_a-print_quoted_string.o: print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_quoted_string.o -MD -MP -MF $(DEPDIR)/libtests_a-print_quoted_string.Tpo -c -o libtests_a-print_quoted_string.o `test -f 'print_quoted_string.c' || echo '$(srcdir)/'`print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_quoted_string.Tpo $(DEPDIR)/libtests_a-print_quoted_string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_quoted_string.c' object='libtests_a-print_quoted_string.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.o `test -f 'print_quoted_string.c' || echo '$(srcdir)/'`print_quoted_string.c + +libtests_a-print_quoted_string.obj: print_quoted_string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_quoted_string.obj -MD -MP -MF $(DEPDIR)/libtests_a-print_quoted_string.Tpo -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_quoted_string.Tpo $(DEPDIR)/libtests_a-print_quoted_string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_quoted_string.c' object='libtests_a-print_quoted_string.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` + +libtests_a-printflags.o: printflags.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.o -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printflags.c' object='libtests_a-printflags.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c + +libtests_a-printflags.obj: printflags.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.obj -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.obj `if test -f 'printflags.c'; then $(CYGPATH_W) 'printflags.c'; else $(CYGPATH_W) '$(srcdir)/printflags.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printflags.c' object='libtests_a-printflags.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printflags.obj `if test -f 'printflags.c'; then $(CYGPATH_W) 'printflags.c'; else $(CYGPATH_W) '$(srcdir)/printflags.c'; fi` + +libtests_a-printxval.o: printxval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printxval.o -MD -MP -MF $(DEPDIR)/libtests_a-printxval.Tpo -c -o libtests_a-printxval.o `test -f 'printxval.c' || echo '$(srcdir)/'`printxval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printxval.Tpo $(DEPDIR)/libtests_a-printxval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printxval.c' object='libtests_a-printxval.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printxval.o `test -f 'printxval.c' || echo '$(srcdir)/'`printxval.c + +libtests_a-printxval.obj: printxval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printxval.obj -MD -MP -MF $(DEPDIR)/libtests_a-printxval.Tpo -c -o libtests_a-printxval.obj `if test -f 'printxval.c'; then $(CYGPATH_W) 'printxval.c'; else $(CYGPATH_W) '$(srcdir)/printxval.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printxval.Tpo $(DEPDIR)/libtests_a-printxval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printxval.c' object='libtests_a-printxval.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-printxval.obj `if test -f 'printxval.c'; then $(CYGPATH_W) 'printxval.c'; else $(CYGPATH_W) '$(srcdir)/printxval.c'; fi` + +libtests_a-signal2name.o: signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-signal2name.o -MD -MP -MF $(DEPDIR)/libtests_a-signal2name.Tpo -c -o libtests_a-signal2name.o `test -f 'signal2name.c' || echo '$(srcdir)/'`signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-signal2name.Tpo $(DEPDIR)/libtests_a-signal2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal2name.c' object='libtests_a-signal2name.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.o `test -f 'signal2name.c' || echo '$(srcdir)/'`signal2name.c + +libtests_a-signal2name.obj: signal2name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-signal2name.obj -MD -MP -MF $(DEPDIR)/libtests_a-signal2name.Tpo -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-signal2name.Tpo $(DEPDIR)/libtests_a-signal2name.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal2name.c' object='libtests_a-signal2name.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` + +libtests_a-sprintrc.o: sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.o -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sprintrc.c' object='libtests_a-sprintrc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c + +libtests_a-sprintrc.obj: sprintrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.obj -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.obj `if test -f 'sprintrc.c'; then $(CYGPATH_W) 'sprintrc.c'; else $(CYGPATH_W) '$(srcdir)/sprintrc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sprintrc.c' object='libtests_a-sprintrc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-sprintrc.obj `if test -f 'sprintrc.c'; then $(CYGPATH_W) 'sprintrc.c'; else $(CYGPATH_W) '$(srcdir)/sprintrc.c'; fi` + +libtests_a-tail_alloc.o: tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tail_alloc.o -MD -MP -MF $(DEPDIR)/libtests_a-tail_alloc.Tpo -c -o libtests_a-tail_alloc.o `test -f 'tail_alloc.c' || echo '$(srcdir)/'`tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tail_alloc.Tpo $(DEPDIR)/libtests_a-tail_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tail_alloc.c' object='libtests_a-tail_alloc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.o `test -f 'tail_alloc.c' || echo '$(srcdir)/'`tail_alloc.c + +libtests_a-tail_alloc.obj: tail_alloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tail_alloc.obj -MD -MP -MF $(DEPDIR)/libtests_a-tail_alloc.Tpo -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tail_alloc.Tpo $(DEPDIR)/libtests_a-tail_alloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tail_alloc.c' object='libtests_a-tail_alloc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` + +libtests_a-tprintf.o: tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.o -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tprintf.c' object='libtests_a-tprintf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c + +libtests_a-tprintf.obj: tprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.obj -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.obj `if test -f 'tprintf.c'; then $(CYGPATH_W) 'tprintf.c'; else $(CYGPATH_W) '$(srcdir)/tprintf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tprintf.c' object='libtests_a-tprintf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tprintf.obj `if test -f 'tprintf.c'; then $(CYGPATH_W) 'tprintf.c'; else $(CYGPATH_W) '$(srcdir)/tprintf.c'; fi` + +fstat64-fstat64.o: fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstat64-fstat64.o -MD -MP -MF $(DEPDIR)/fstat64-fstat64.Tpo -c -o fstat64-fstat64.o `test -f 'fstat64.c' || echo '$(srcdir)/'`fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstat64-fstat64.Tpo $(DEPDIR)/fstat64-fstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat64.c' object='fstat64-fstat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstat64-fstat64.o `test -f 'fstat64.c' || echo '$(srcdir)/'`fstat64.c + +fstat64-fstat64.obj: fstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstat64-fstat64.obj -MD -MP -MF $(DEPDIR)/fstat64-fstat64.Tpo -c -o fstat64-fstat64.obj `if test -f 'fstat64.c'; then $(CYGPATH_W) 'fstat64.c'; else $(CYGPATH_W) '$(srcdir)/fstat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstat64-fstat64.Tpo $(DEPDIR)/fstat64-fstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat64.c' object='fstat64-fstat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstat64-fstat64.obj `if test -f 'fstat64.c'; then $(CYGPATH_W) 'fstat64.c'; else $(CYGPATH_W) '$(srcdir)/fstat64.c'; fi` + +fstatat64-fstatat64.o: fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstatat64-fstatat64.o -MD -MP -MF $(DEPDIR)/fstatat64-fstatat64.Tpo -c -o fstatat64-fstatat64.o `test -f 'fstatat64.c' || echo '$(srcdir)/'`fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstatat64-fstatat64.Tpo $(DEPDIR)/fstatat64-fstatat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatat64.c' object='fstatat64-fstatat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstatat64-fstatat64.o `test -f 'fstatat64.c' || echo '$(srcdir)/'`fstatat64.c + +fstatat64-fstatat64.obj: fstatat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fstatat64-fstatat64.obj -MD -MP -MF $(DEPDIR)/fstatat64-fstatat64.Tpo -c -o fstatat64-fstatat64.obj `if test -f 'fstatat64.c'; then $(CYGPATH_W) 'fstatat64.c'; else $(CYGPATH_W) '$(srcdir)/fstatat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstatat64-fstatat64.Tpo $(DEPDIR)/fstatat64-fstatat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatat64.c' object='fstatat64-fstatat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstatat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fstatat64-fstatat64.obj `if test -f 'fstatat64.c'; then $(CYGPATH_W) 'fstatat64.c'; else $(CYGPATH_W) '$(srcdir)/fstatat64.c'; fi` + +ftruncate64-ftruncate64.o: ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ftruncate64-ftruncate64.o -MD -MP -MF $(DEPDIR)/ftruncate64-ftruncate64.Tpo -c -o ftruncate64-ftruncate64.o `test -f 'ftruncate64.c' || echo '$(srcdir)/'`ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ftruncate64-ftruncate64.Tpo $(DEPDIR)/ftruncate64-ftruncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftruncate64.c' object='ftruncate64-ftruncate64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ftruncate64-ftruncate64.o `test -f 'ftruncate64.c' || echo '$(srcdir)/'`ftruncate64.c + +ftruncate64-ftruncate64.obj: ftruncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ftruncate64-ftruncate64.obj -MD -MP -MF $(DEPDIR)/ftruncate64-ftruncate64.Tpo -c -o ftruncate64-ftruncate64.obj `if test -f 'ftruncate64.c'; then $(CYGPATH_W) 'ftruncate64.c'; else $(CYGPATH_W) '$(srcdir)/ftruncate64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ftruncate64-ftruncate64.Tpo $(DEPDIR)/ftruncate64-ftruncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftruncate64.c' object='ftruncate64-ftruncate64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ftruncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ftruncate64-ftruncate64.obj `if test -f 'ftruncate64.c'; then $(CYGPATH_W) 'ftruncate64.c'; else $(CYGPATH_W) '$(srcdir)/ftruncate64.c'; fi` + +lstat64-lstat64.o: lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lstat64-lstat64.o -MD -MP -MF $(DEPDIR)/lstat64-lstat64.Tpo -c -o lstat64-lstat64.o `test -f 'lstat64.c' || echo '$(srcdir)/'`lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lstat64-lstat64.Tpo $(DEPDIR)/lstat64-lstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lstat64.c' object='lstat64-lstat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lstat64-lstat64.o `test -f 'lstat64.c' || echo '$(srcdir)/'`lstat64.c + +lstat64-lstat64.obj: lstat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lstat64-lstat64.obj -MD -MP -MF $(DEPDIR)/lstat64-lstat64.Tpo -c -o lstat64-lstat64.obj `if test -f 'lstat64.c'; then $(CYGPATH_W) 'lstat64.c'; else $(CYGPATH_W) '$(srcdir)/lstat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lstat64-lstat64.Tpo $(DEPDIR)/lstat64-lstat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lstat64.c' object='lstat64-lstat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lstat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lstat64-lstat64.obj `if test -f 'lstat64.c'; then $(CYGPATH_W) 'lstat64.c'; else $(CYGPATH_W) '$(srcdir)/lstat64.c'; fi` + +mmap64-mmap64.o: mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64-mmap64.o -MD -MP -MF $(DEPDIR)/mmap64-mmap64.Tpo -c -o mmap64-mmap64.o `test -f 'mmap64.c' || echo '$(srcdir)/'`mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64-mmap64.Tpo $(DEPDIR)/mmap64-mmap64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64.c' object='mmap64-mmap64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.o `test -f 'mmap64.c' || echo '$(srcdir)/'`mmap64.c + +mmap64-mmap64.obj: mmap64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64-mmap64.obj -MD -MP -MF $(DEPDIR)/mmap64-mmap64.Tpo -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64-mmap64.Tpo $(DEPDIR)/mmap64-mmap64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64.c' object='mmap64-mmap64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` + +newfstatat-newfstatat.o: newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.o -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='newfstatat.c' object='newfstatat-newfstatat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c + +newfstatat-newfstatat.obj: newfstatat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.obj -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.obj `if test -f 'newfstatat.c'; then $(CYGPATH_W) 'newfstatat.c'; else $(CYGPATH_W) '$(srcdir)/newfstatat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='newfstatat.c' object='newfstatat-newfstatat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o newfstatat-newfstatat.obj `if test -f 'newfstatat.c'; then $(CYGPATH_W) 'newfstatat.c'; else $(CYGPATH_W) '$(srcdir)/newfstatat.c'; fi` + +pread64_pwrite64-pread64-pwrite64.o: pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pread64_pwrite64-pread64-pwrite64.o -MD -MP -MF $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo -c -o pread64_pwrite64-pread64-pwrite64.o `test -f 'pread64-pwrite64.c' || echo '$(srcdir)/'`pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pread64-pwrite64.c' object='pread64_pwrite64-pread64-pwrite64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pread64_pwrite64-pread64-pwrite64.o `test -f 'pread64-pwrite64.c' || echo '$(srcdir)/'`pread64-pwrite64.c + +pread64_pwrite64-pread64-pwrite64.obj: pread64-pwrite64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pread64_pwrite64-pread64-pwrite64.obj -MD -MP -MF $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo -c -o pread64_pwrite64-pread64-pwrite64.obj `if test -f 'pread64-pwrite64.c'; then $(CYGPATH_W) 'pread64-pwrite64.c'; else $(CYGPATH_W) '$(srcdir)/pread64-pwrite64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Tpo $(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pread64-pwrite64.c' object='pread64_pwrite64-pread64-pwrite64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pread64_pwrite64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pread64_pwrite64-pread64-pwrite64.obj `if test -f 'pread64-pwrite64.c'; then $(CYGPATH_W) 'pread64-pwrite64.c'; else $(CYGPATH_W) '$(srcdir)/pread64-pwrite64.c'; fi` + +preadv-preadv.o: preadv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv-preadv.o -MD -MP -MF $(DEPDIR)/preadv-preadv.Tpo -c -o preadv-preadv.o `test -f 'preadv.c' || echo '$(srcdir)/'`preadv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv-preadv.Tpo $(DEPDIR)/preadv-preadv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv.c' object='preadv-preadv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv-preadv.o `test -f 'preadv.c' || echo '$(srcdir)/'`preadv.c + +preadv-preadv.obj: preadv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv-preadv.obj -MD -MP -MF $(DEPDIR)/preadv-preadv.Tpo -c -o preadv-preadv.obj `if test -f 'preadv.c'; then $(CYGPATH_W) 'preadv.c'; else $(CYGPATH_W) '$(srcdir)/preadv.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv-preadv.Tpo $(DEPDIR)/preadv-preadv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv.c' object='preadv-preadv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv-preadv.obj `if test -f 'preadv.c'; then $(CYGPATH_W) 'preadv.c'; else $(CYGPATH_W) '$(srcdir)/preadv.c'; fi` + +preadv_pwritev-preadv-pwritev.o: preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv_pwritev-preadv-pwritev.o -MD -MP -MF $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo -c -o preadv_pwritev-preadv-pwritev.o `test -f 'preadv-pwritev.c' || echo '$(srcdir)/'`preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo $(DEPDIR)/preadv_pwritev-preadv-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv-pwritev.c' object='preadv_pwritev-preadv-pwritev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv_pwritev-preadv-pwritev.o `test -f 'preadv-pwritev.c' || echo '$(srcdir)/'`preadv-pwritev.c + +preadv_pwritev-preadv-pwritev.obj: preadv-pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT preadv_pwritev-preadv-pwritev.obj -MD -MP -MF $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo -c -o preadv_pwritev-preadv-pwritev.obj `if test -f 'preadv-pwritev.c'; then $(CYGPATH_W) 'preadv-pwritev.c'; else $(CYGPATH_W) '$(srcdir)/preadv-pwritev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/preadv_pwritev-preadv-pwritev.Tpo $(DEPDIR)/preadv_pwritev-preadv-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preadv-pwritev.c' object='preadv_pwritev-preadv-pwritev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(preadv_pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o preadv_pwritev-preadv-pwritev.obj `if test -f 'preadv-pwritev.c'; then $(CYGPATH_W) 'preadv-pwritev.c'; else $(CYGPATH_W) '$(srcdir)/preadv-pwritev.c'; fi` + +pwritev-pwritev.o: pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pwritev-pwritev.o -MD -MP -MF $(DEPDIR)/pwritev-pwritev.Tpo -c -o pwritev-pwritev.o `test -f 'pwritev.c' || echo '$(srcdir)/'`pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwritev-pwritev.Tpo $(DEPDIR)/pwritev-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pwritev.c' object='pwritev-pwritev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pwritev-pwritev.o `test -f 'pwritev.c' || echo '$(srcdir)/'`pwritev.c + +pwritev-pwritev.obj: pwritev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pwritev-pwritev.obj -MD -MP -MF $(DEPDIR)/pwritev-pwritev.Tpo -c -o pwritev-pwritev.obj `if test -f 'pwritev.c'; then $(CYGPATH_W) 'pwritev.c'; else $(CYGPATH_W) '$(srcdir)/pwritev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwritev-pwritev.Tpo $(DEPDIR)/pwritev-pwritev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pwritev.c' object='pwritev-pwritev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pwritev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pwritev-pwritev.obj `if test -f 'pwritev.c'; then $(CYGPATH_W) 'pwritev.c'; else $(CYGPATH_W) '$(srcdir)/pwritev.c'; fi` + +stat64-stat64.o: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stat64-stat64.o -MD -MP -MF $(DEPDIR)/stat64-stat64.Tpo -c -o stat64-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat64-stat64.Tpo $(DEPDIR)/stat64-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='stat64-stat64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stat64-stat64.o `test -f 'stat64.c' || echo '$(srcdir)/'`stat64.c + +stat64-stat64.obj: stat64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stat64-stat64.obj -MD -MP -MF $(DEPDIR)/stat64-stat64.Tpo -c -o stat64-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat64-stat64.Tpo $(DEPDIR)/stat64-stat64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat64.c' object='stat64-stat64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stat64-stat64.obj `if test -f 'stat64.c'; then $(CYGPATH_W) 'stat64.c'; else $(CYGPATH_W) '$(srcdir)/stat64.c'; fi` + +statfs-statfs.o: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT statfs-statfs.o -MD -MP -MF $(DEPDIR)/statfs-statfs.Tpo -c -o statfs-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/statfs-statfs.Tpo $(DEPDIR)/statfs-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='statfs-statfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o statfs-statfs.o `test -f 'statfs.c' || echo '$(srcdir)/'`statfs.c + +statfs-statfs.obj: statfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT statfs-statfs.obj -MD -MP -MF $(DEPDIR)/statfs-statfs.Tpo -c -o statfs-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/statfs-statfs.Tpo $(DEPDIR)/statfs-statfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statfs.c' object='statfs-statfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(statfs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o statfs-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` + +truncate64-truncate64.o: truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT truncate64-truncate64.o -MD -MP -MF $(DEPDIR)/truncate64-truncate64.Tpo -c -o truncate64-truncate64.o `test -f 'truncate64.c' || echo '$(srcdir)/'`truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/truncate64-truncate64.Tpo $(DEPDIR)/truncate64-truncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate64.c' object='truncate64-truncate64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o truncate64-truncate64.o `test -f 'truncate64.c' || echo '$(srcdir)/'`truncate64.c + +truncate64-truncate64.obj: truncate64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT truncate64-truncate64.obj -MD -MP -MF $(DEPDIR)/truncate64-truncate64.Tpo -c -o truncate64-truncate64.obj `if test -f 'truncate64.c'; then $(CYGPATH_W) 'truncate64.c'; else $(CYGPATH_W) '$(srcdir)/truncate64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/truncate64-truncate64.Tpo $(DEPDIR)/truncate64-truncate64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='truncate64.c' object='truncate64-truncate64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(truncate64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o truncate64-truncate64.obj `if test -f 'truncate64.c'; then $(CYGPATH_W) 'truncate64.c'; else $(CYGPATH_W) '$(srcdir)/truncate64.c'; fi` + +uio-uio.o: uio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uio-uio.o -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.o `test -f 'uio.c' || echo '$(srcdir)/'`uio.c + +uio-uio.obj: uio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uio-uio.obj -MD -MP -MF $(DEPDIR)/uio-uio.Tpo -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uio-uio.Tpo $(DEPDIR)/uio-uio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uio.c' object='uio-uio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` +check-valgrind-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_LIBRARIES) $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @@ -853,7 +5557,7 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile @@ -892,9 +5596,14 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am +clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -963,21 +5672,42 @@ uninstall-am: .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am - - -net-fd.log: net.log +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \ + check-valgrind-am check-valgrind-local clean \ + clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am + + +@VALGRIND_CHECK_RULES@ + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h +$(objects): scno.h + +syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ + +scno.h: $(top_srcdir)/scno.head syscallent.i + echo '/* Generated by Makefile from $^; do not edit. */' > $@-t + cat $< >> $@-t + LC_ALL=C sed -n '$(SCNO_SED)' $(filter-out $<,$^) >> $@-t + mv $@-t $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/tests/_newselect.c b/tests/_newselect.c new file mode 100644 index 00000000..ae2bc51a --- /dev/null +++ b/tests/_newselect.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR__newselect + +# define TEST_SYSCALL_NR __NR__newselect +# define TEST_SYSCALL_STR "_newselect" +# include "xselect.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR__newselect") + +#endif diff --git a/tests/_newselect.test b/tests/_newselect.test new file mode 100755 index 00000000..3371d4db --- /dev/null +++ b/tests/_newselect.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check _newselect syscall decoding. + +. "${srcdir=.}/select.test" diff --git a/tests/accept.c b/tests/accept.c new file mode 100644 index 00000000..8d42ba15 --- /dev/null +++ b/tests/accept.c @@ -0,0 +1,85 @@ +/* + * Check decoding of accept syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME accept +#endif + +#define TEST_SYSCALL_PREPARE connect_un() +static void connect_un(void); +#include "sockname.c" + +static void +connect_un(void) +{ + int cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd < 0) + perror_msg_and_skip("socket"); + + struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET ".connect" + }; + + (void) unlink(un.sun_path); + if (bind(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + un.sun_path[sizeof(TEST_SOCKET) - 1] = '\0'; + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); +} + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + if (listen(lfd, 16)) + perror_msg_and_skip("listen"); + + test_sockname_syscall(lfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/accept.test b/tests/accept.test new file mode 100755 index 00000000..b5e07904 --- /dev/null +++ b/tests/accept.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of accept syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/accept4.c b/tests/accept4.c new file mode 100644 index 00000000..d26e15c5 --- /dev/null +++ b/tests/accept4.c @@ -0,0 +1,44 @@ +/* + * Check decoding of accept4 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined HAVE_ACCEPT4 && defined O_CLOEXEC + +# define TEST_SYSCALL_NAME accept4 +# define SUFFIX_ARGS , O_CLOEXEC +# define SUFFIX_STR ", SOCK_CLOEXEC" +# include "accept.c" + +#else + +SKIP_MAIN_UNDEFINED("HAVE_ACCEPT4 && O_CLOEXEC") + +#endif diff --git a/tests/accept4.test b/tests/accept4.test new file mode 100755 index 00000000..722f25a5 --- /dev/null +++ b/tests/accept4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of accept4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests/access.c b/tests/access.c new file mode 100644 index 00000000..e6f169b2 --- /dev/null +++ b/tests/access.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#ifdef __NR_access + +# include +# include + +int +main(void) +{ + static const char sample[] = "access_sample"; + + long rc = syscall(__NR_access, sample, F_OK); + printf("access(\"%s\", F_OK) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = syscall(__NR_access, sample, R_OK|W_OK|X_OK); + printf("access(\"%s\", R_OK|W_OK|X_OK) = %ld %s (%m)\n", + sample, rc, errno2name()); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_access") + +#endif diff --git a/tests/access.test b/tests/access.test new file mode 100755 index 00000000..3ab2eb4b --- /dev/null +++ b/tests/access.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check access syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -eaccess -a30 $args > "$EXP" + +# Filter out access() calls made by libc. +grep -F access_sample < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/acct.c b/tests/acct.c new file mode 100644 index 00000000..1cc3fa56 --- /dev/null +++ b/tests/acct.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_acct + +# include +# include + +int +main(void) +{ + const char sample[] = "acct_sample"; + + long rc = syscall(__NR_acct, sample); + printf("acct(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR__acct") + +#endif diff --git a/tests/acct.test b/tests/acct.test new file mode 100755 index 00000000..b9bca754 --- /dev/null +++ b/tests/acct.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check acct syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/add_key.c b/tests/add_key.c new file mode 100644 index 00000000..d2696f9b --- /dev/null +++ b/tests/add_key.c @@ -0,0 +1,153 @@ +/* + * Check decoding of add_key syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_add_key + +# include +# include +# include + +void +print_val_str(const void *ptr, const char *str) +{ + if (str) + printf("%s, ", str); + else + printf("%p, ", ptr); +} + +void +do_add_key(const char *type, const char *type_str, const char *desc, + const char *desc_str, const char *payload, const char *payload_str, + size_t plen, int32_t keyring, const char *keyring_str) +{ + long rc = syscall(__NR_add_key, type, desc, payload, plen, keyring); + const char *errstr = sprintrc(rc); + printf("add_key("); + print_val_str(type, type_str); + print_val_str(desc, desc_str); + print_val_str(payload, payload_str); + printf("%zu, ", plen); + if (keyring_str) + printf("%s", keyring_str); + else + printf("%d", keyring); + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char unterminated3[] = + { '\16', '\17', '\20', '\21', '\22' }; + + char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *bogus_payload = tail_memdup(unterminated3, sizeof(unterminated3)); + + unsigned i; + unsigned j; + unsigned k; + unsigned l; + + struct { + const char *type; + const char *str; + } types[] = { + { ARG_STR(NULL) }, + { bogus_type + sizeof(unterminated1), NULL }, + { bogus_type, NULL }, + { ARG_STR("\20\21\22\23\24") }, + { ARG_STR("user") }, + }; + + struct { + const char *desc; + const char *str; + } descs[] = { + { ARG_STR(NULL) }, + { bogus_desc + sizeof(unterminated2), NULL }, + { bogus_desc, NULL }, + { ARG_STR("\25\26\27\30\31") }, + { ARG_STR("desc") }, + { "overly long description", _STR("overly long ") "..." }, + }; + + struct { + const char *pload; + const char *str; + size_t plen; + } payloads[] = { + { ARG_STR(NULL), 0 }, + { bogus_payload + sizeof(unterminated3), NULL, + (size_t) 0xdeadbeefbadc0dedULL }, + { bogus_payload, _STR(""), 0 }, + { bogus_payload, _STR("\16\17\20\21\22"), 5 }, + { bogus_payload, NULL, 10 }, + { "overly long payload", _STR("overly long ") "...", 15 }, + }; + + struct { + uint32_t keyring; + const char *str; + } keyrings[] = { + { ARG_STR(0) }, + { ARG_STR(1234567890) }, + { ARG_STR(-1234567890) }, + { -1, "KEY_SPEC_THREAD_KEYRING" }, + }; + + for (i = 0; i < ARRAY_SIZE(types); i++) + for (j = 0; j < ARRAY_SIZE(descs); j++) + for (k = 0; k < ARRAY_SIZE(payloads); k++) + for (l = 0; l < ARRAY_SIZE(keyrings); l++) + do_add_key(types[i].type, types[i].str, + descs[j].desc, descs[j].str, + payloads[k].pload, + payloads[k].str, + payloads[k].plen, + keyrings[l].keyring, + keyrings[l].str); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_add_key"); + +#endif diff --git a/tests/add_key.test b/tests/add_key.test new file mode 100755 index 00000000..eadd8c2b --- /dev/null +++ b/tests/add_key.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of add_key syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -s12 diff --git a/tests/adjtimex.c b/tests/adjtimex.c new file mode 100644 index 00000000..1638b535 --- /dev/null +++ b/tests/adjtimex.c @@ -0,0 +1,83 @@ +/* + * This file is part of adjtimex strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + adjtimex(NULL); + printf("adjtimex\\(NULL\\) = -1 EFAULT \\(%m\\)\n"); + + struct timex * const tx = tail_alloc(sizeof(*tx)); + memset(tx, 0, sizeof(*tx)); + + int state = adjtimex(tx); + if (state < 0) + perror_msg_and_skip("adjtimex"); + + printf("adjtimex\\(\\{modes=0, offset=%jd, freq=%jd, maxerror=%jd" + ", esterror=%jd, status=%s, constant=%jd, precision=%jd" + ", tolerance=%jd, time=\\{tv_sec=%jd, tv_usec=%jd\\}, tick=%jd, " + "ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd, " + "calcnt=%jd, errcnt=%jd, stbcnt=%jd" +#ifdef HAVE_STRUCT_TIMEX_TAI + ", tai=%d" +#endif + "\\}\\) = %d \\(TIME_[A-Z]+\\)\n", + (intmax_t) tx->offset, + (intmax_t) tx->freq, + (intmax_t) tx->maxerror, + (intmax_t) tx->esterror, + tx->status ? "STA_[A-Z]+(\\|STA_[A-Z]+)*" : "0", + (intmax_t) tx->constant, + (intmax_t) tx->precision, + (intmax_t) tx->tolerance, + (intmax_t) tx->time.tv_sec, + (intmax_t) tx->time.tv_usec, + (intmax_t) tx->tick, + (intmax_t) tx->ppsfreq, + (intmax_t) tx->jitter, + tx->shift, + (intmax_t) tx->stabil, + (intmax_t) tx->jitcnt, + (intmax_t) tx->calcnt, + (intmax_t) tx->errcnt, + (intmax_t) tx->stbcnt, +#ifdef HAVE_STRUCT_TIMEX_TAI + tx->tai, +#endif + state); + + return 0; +} diff --git a/tests/adjtimex.test b/tests/adjtimex.test new file mode 100755 index 00000000..01405501 --- /dev/null +++ b/tests/adjtimex.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check adjtimex syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a 15 -e adjtimex $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests/aio.c b/tests/aio.c new file mode 100644 index 00000000..0766d23a --- /dev/null +++ b/tests/aio.c @@ -0,0 +1,368 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#if defined __NR_io_setup \ + && defined __NR_io_submit \ + && defined __NR_io_getevents \ + && defined __NR_io_cancel \ + && defined __NR_io_destroy +# include + +int +main(void) +{ + static const long bogus_ctx = + (long) 0xface1e55deadbeefLL; + + static const char data2[] = + "\0\1\2\3cat test test test 0123456789abcdef"; + + const unsigned int sizeof_data0 = 4096; + const unsigned int sizeof_data1 = 8192; + void *data0 = tail_alloc(sizeof_data0); + void *data1 = tail_alloc(sizeof_data1); + + const struct iocb proto_cb[] = { + { + .aio_data = (unsigned long) 0xfeedface11111111ULL, + .aio_reqprio = 11, + .aio_buf = (unsigned long) data0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = sizeof_data0 + }, + { + .aio_data = (unsigned long) 0xfeedface22222222ULL, + .aio_reqprio = 22, + .aio_buf = (unsigned long) data1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = sizeof_data1 + } + }; + const struct iocb *cb = tail_memdup(proto_cb, sizeof(proto_cb)); + + const struct iovec proto_iov0[] = { + { + .iov_base = data0, + .iov_len = sizeof_data0 / 4 + }, + { + .iov_base = data0 + sizeof_data0 / 4, + .iov_len = sizeof_data0 / 4 * 3 + }, + }; + const struct iovec *iov0 = tail_memdup(proto_iov0, sizeof(proto_iov0)); + + const struct iovec proto_iov1[] = { + { + .iov_base = data1, + .iov_len = sizeof_data1 / 4 + }, + { + .iov_base = data1 + sizeof_data1 / 4, + .iov_len = sizeof_data1 / 4 * 3 + }, + }; + const struct iovec *iov1 = tail_memdup(proto_iov1, sizeof(proto_iov1)); + + const struct iocb proto_cbv[] = { + { + .aio_data = (unsigned long) 0xfeed11111111faceULL, + .aio_lio_opcode = 7, + .aio_reqprio = 111, + .aio_buf = (unsigned long) iov0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = ARRAY_SIZE(proto_iov0) + }, + { + .aio_data = (unsigned long) 0xfeed22222222faceULL, + .aio_lio_opcode = 7, + .aio_reqprio = 222, + .aio_buf = (unsigned long) iov1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = ARRAY_SIZE(proto_iov1) + } + }; + const struct iocb *cbv = tail_memdup(proto_cbv, sizeof(proto_cbv)); + + /* For additional decoder testing */ + const struct iocb proto_cbv2[] = { + { + .aio_data = 0xbadfacedc0ffeeedULL, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 0xf00d, + .aio_reqprio = 0, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + /* In order to make record valid */ + .aio_nbytes = (size_t) 0x1020304050607080ULL, + .aio_offset = 0xdeadda7abadc0dedULL, +# ifdef IOCB_FLAG_RESFD + .aio_flags = 0xfacef157, + .aio_resfd = 0xded1ca7e, +# endif + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0xbadc0ffeedefacedULL, + .aio_nbytes = 0x8090a0b0c0d0e0f0ULL, + .aio_offset = 0xdeadda7abadc0dedULL, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 1, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = (unsigned long)data2, + .aio_nbytes = sizeof(data2), + .aio_offset = 0xdeadda7abadc0dedULL, + }, + { + .aio_data = 0, + .aio_key = 0xdefaced0, + .aio_lio_opcode = 8, + .aio_reqprio = 0xbeef, + .aio_fildes = 0xdefaced1, + .aio_buf = 0, + .aio_nbytes = 0x8090a0b0c0d0e0f0ULL, + .aio_offset = 0xdeadda7abadc0dedULL, + }, + }; + const struct iocb *cbv2 = tail_memdup(proto_cbv2, sizeof(proto_cbv2)); + + const struct iocb proto_cbc = { + .aio_data = (unsigned long) 0xdeadbeefbadc0dedULL, + .aio_reqprio = 99, + .aio_fildes = -42 + }; + const struct iocb *cbc = tail_memdup(&proto_cbc, sizeof(proto_cbc)); + + const long proto_cbs[] = { + (long) &cb[0], (long) &cb[1] + }; + const long *cbs = tail_memdup(proto_cbs, sizeof(proto_cbs)); + + const long proto_cbvs[] = { + (long) &cbv[0], (long) &cbv[1], + }; + const long *cbvs = tail_memdup(proto_cbvs, sizeof(proto_cbvs)); + + const long proto_cbvs2[] = { + (long) &cbv2[0], (long) &cbv2[1], (long) &cbv2[2], + (long) &cbv2[3], (long) &cbv2[4], + (long) NULL, (long) 0xffffffffffffffffLL, + }; + const long *cbvs2 = tail_memdup(proto_cbvs2, sizeof(proto_cbvs2)); + + unsigned long *ctx = tail_alloc(sizeof(unsigned long)); + *ctx = 0; + + const unsigned int nr = ARRAY_SIZE(proto_cb); + const unsigned long lnr = (unsigned long) (0xdeadbeef00000000ULL | nr); + + const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); + const struct timespec proto_ts = { .tv_nsec = 123456789 }; + const struct timespec *ts = tail_memdup(&proto_ts, sizeof(proto_ts)); + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_skip("open: %s", "/dev/zero"); + + long rc = syscall(__NR_io_setup, 0xdeadbeef, NULL); + printf("io_setup(%u, NULL) = %s\n", 0xdeadbeef, sprintrc(rc)); + + rc = syscall(__NR_io_setup, lnr, ctx + 1); + printf("io_setup(%u, %p) = %s\n", nr, ctx + 1, sprintrc(rc)); + + if (syscall(__NR_io_setup, lnr, ctx)) + perror_msg_and_skip("io_setup"); + printf("io_setup(%u, [%#lx]) = 0\n", nr, *ctx); + + rc = syscall(__NR_io_submit, bogus_ctx, (long) 0xca7faceddeadf00dLL, + NULL); + printf("io_submit(%#lx, %ld, NULL) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbs + nr); + printf("io_submit(%#lx, %ld, %p) = %s\n", + *ctx, (long) nr, cbs + nr, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, -1L, cbs); + printf("io_submit(%#lx, -1, %p) = %s\n", + *ctx, cbs, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbs); + if (rc != (long) nr) + perror_msg_and_skip("io_submit"); + printf("io_submit(%#lx, %u, [" + "{data=%#" PRI__x64 ", pread, reqprio=11, fildes=0, " + "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, " + "{data=%#" PRI__x64 ", pread, reqprio=22, fildes=0, " + "buf=%p, nbytes=%u, offset=%" PRI__d64 "}" + "]) = %s\n", + *ctx, nr, + cb[0].aio_data, data0, sizeof_data0, cb[0].aio_offset, + cb[1].aio_data, data1, sizeof_data1, cb[1].aio_offset, + sprintrc(rc)); + + rc = syscall(__NR_io_getevents, bogus_ctx, + (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, + ev + 1, NULL); + printf("io_getevents(%#lx, %ld, %ld, %p, NULL) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, + (long) 0xba5e1e505ca571e0LL, ev + 1, sprintrc(rc)); + + rc = syscall(__NR_io_getevents, bogus_ctx, + (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, + NULL, ts + 1); + printf("io_getevents(%#lx, %ld, %ld, NULL, %p) = %s\n", + bogus_ctx, (long) 0xca7faceddeadf00dLL, + (long) 0xba5e1e505ca571e0LL, ts + 1, sprintrc(rc)); + + rc = syscall(__NR_io_getevents, *ctx, nr, nr + 1, ev, ts); + printf("io_getevents(%#lx, %ld, %ld, [" + "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}, " + "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}" + "], {tv_sec=0, tv_nsec=123456789}) = %s\n", + *ctx, (long) nr, (long) (nr + 1), + cb[0].aio_data, &cb[0], sizeof_data0, + cb[1].aio_data, &cb[1], sizeof_data1, + sprintrc(rc)); + + rc = syscall(__NR_io_cancel, bogus_ctx, NULL, NULL); + printf("io_cancel(%#lx, NULL, NULL) = %s\n", bogus_ctx, sprintrc(rc)); + + rc = syscall(__NR_io_cancel, *ctx, cbc + 1, ev); + printf("io_cancel(%#lx, %p, %p) = %s\n", *ctx, cbc + 1, ev, + sprintrc(rc)); + + rc = syscall(__NR_io_cancel, *ctx, cbc, ev); + printf("io_cancel(%#lx, {data=%#" PRI__x64 + ", pread, reqprio=99, fildes=-42}, %p) = %s\n", + *ctx, cbc->aio_data, ev, sprintrc(rc)); + + rc = syscall(__NR_io_submit, (unsigned long) 0xfacef157beeff00dULL, + (long) 0xdeadc0defacefeedLL, NULL); + printf("io_submit(%#lx, %ld, NULL) = %s\n", + (long) 0xfacef157beeff00dULL, + (long) 0xdeadc0defacefeedLL, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, -1L, cbvs + nr); + printf("io_submit(%#lx, %ld, %p) = %s\n", + *ctx, -1L, cbvs + nr, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); + printf("io_submit(%#lx, %ld, [" + "{data=%#" PRI__x64 ", key=%u, %hu /* SUB_??? */, fildes=%d}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL" + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 +# ifdef IOCB_FLAG_RESFD + ", resfd=%d, flags=%#x" +# endif + "}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " + "{key=%u, pwrite, reqprio=%hd, fildes=%d" + ", str=\"\\0\\1\\2\\3%.28s\"..." + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " + "{key=%u, pwritev, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 + ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}" + ", {NULL}, {%#lx}, %p]) = %s\n", + *ctx, 1057L, + cbv2[0].aio_data, cbv2[0].aio_key, + cbv2[0].aio_lio_opcode, cbv2[0].aio_fildes, + cbv2[1].aio_key, cbv2[1].aio_reqprio, cbv2[1].aio_fildes, + cbv2[1].aio_nbytes, cbv2[1].aio_offset, +# ifdef IOCB_FLAG_RESFD + cbv2[1].aio_resfd, cbv2[1].aio_flags, +# endif + cbv2[2].aio_key, cbv2[2].aio_reqprio, cbv2[2].aio_fildes, + cbv2[2].aio_buf, cbv2[2].aio_nbytes, cbv2[2].aio_offset, + cbv2[3].aio_key, cbv2[3].aio_reqprio, cbv2[3].aio_fildes, + data2 + 4, cbv2[3].aio_nbytes, cbv2[3].aio_offset, + cbv2[4].aio_key, cbv2[4].aio_reqprio, cbv2[4].aio_fildes, + cbv2[4].aio_buf, cbv2[4].aio_nbytes, cbv2[4].aio_offset, + cbvs2[6], cbvs2 + 7, sprintrc(rc)); + + rc = syscall(__NR_io_submit, *ctx, nr, cbvs); + if (rc != (long) nr) + perror_msg_and_skip("io_submit"); + printf("io_submit(%#lx, %u, [" + "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " + "iovec=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, " + "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " + "iovec=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}" + "]) = %s\n", + *ctx, nr, + cbv[0].aio_data, cbv[0].aio_reqprio, + iov0[0].iov_base, (unsigned int) iov0[0].iov_len, + iov0[1].iov_base, (unsigned int) iov0[1].iov_len, + cbv[0].aio_offset, + cbv[1].aio_data, cbv[1].aio_reqprio, + iov1[0].iov_base, (unsigned int) iov1[0].iov_len, + iov1[1].iov_base, (unsigned int) iov1[1].iov_len, + cbv[1].aio_offset, + sprintrc(rc)); + + rc = syscall(__NR_io_destroy, bogus_ctx); + printf("io_destroy(%#lx) = %s\n", + bogus_ctx, sprintrc(rc)); + + rc = syscall(__NR_io_destroy, *ctx); + printf("io_destroy(%#lx) = %s\n", *ctx, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_*") + +#endif diff --git a/tests/aio.test b/tests/aio.test new file mode 100755 index 00000000..2ba90da8 --- /dev/null +++ b/tests/aio.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check io_* syscalls decoding. + +. "${srcdir=.}/init.sh" + +syscalls=io_setup,io_submit,io_getevents,io_cancel,io_destroy +run_strace_match_diff -a14 -e trace=$syscalls diff --git a/tests/alarm.c b/tests/alarm.c new file mode 100644 index 00000000..291b26ad --- /dev/null +++ b/tests/alarm.c @@ -0,0 +1,52 @@ +/* + * This file is part of alarm strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_alarm + +# include +# include + +int +main(void) +{ + int rc = syscall(__NR_alarm, (unsigned long) 0xffffffff0000002aULL); + printf("alarm(%u) = %d\n", 42, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_alarm") + +#endif diff --git a/tests/alarm.test b/tests/alarm.test new file mode 100755 index 00000000..267b2239 --- /dev/null +++ b/tests/alarm.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check alarm syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/answer.c b/tests/answer.c new file mode 100644 index 00000000..ae3059a4 --- /dev/null +++ b/tests/answer.c @@ -0,0 +1,44 @@ +/* + * Check decoding of fault injected exit_group syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + static const kernel_ulong_t answer = + (kernel_ulong_t) 0xbadc0ded0000002aULL; + + syscall(__NR_exit_group, answer); + syscall(__NR_exit, answer); + + return 1; +} diff --git a/tests/attach-f-p-cmd.c b/tests/attach-f-p-cmd.c new file mode 100644 index 00000000..77594beb --- /dev/null +++ b/tests/attach-f-p-cmd.c @@ -0,0 +1,46 @@ +/* + * This file is part of attach-f-p strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + static const char dir[] = "attach-f-p.test cmd"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + pid, dir, sprintrc(rc), pid); + + return 0; +} diff --git a/tests/attach-f-p.c b/tests/attach-f-p.c new file mode 100644 index 00000000..3f9a7e3e --- /dev/null +++ b/tests/attach-f-p.c @@ -0,0 +1,124 @@ +/* + * This file is part of attach-f-p strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#define N 3 + +typedef union { + void *ptr; + pid_t pid; +} retval_t; + +static const char text_parent[] = "attach-f-p.test parent"; +static const char *child[N] = { + "attach-f-p.test child 0", + "attach-f-p.test child 1", + "attach-f-p.test child 2" +}; +typedef int pipefd[2]; +static pipefd pipes[N]; + +static void * +thread(void *a) +{ + unsigned int no = (long) a; + int i; + + if (read(pipes[no][0], &i, sizeof(i)) != (int) sizeof(i)) + perror_msg_and_fail("read[%u]", no); + assert(chdir(child[no]) == -1); + retval_t retval = { .pid = syscall(__NR_gettid) }; + return retval.ptr; +} + +int +main(void) +{ + pthread_t t[N]; + unsigned int i; + + if (write(1, "", 0) != 0) + perror_msg_and_fail("write"); + + for (i = 0; i < N; ++i) { + if (pipe(pipes[i])) + perror_msg_and_fail("pipe"); + + errno = pthread_create(&t[i], NULL, thread, (void *) (long) i); + if (errno) + perror_msg_and_fail("pthread_create"); + } + + if (write(1, "\n", 1) != 1) + perror_msg_and_fail("write"); + + /* wait for the peer to write to stdout */ + struct stat st; + for (;;) { + if (fstat(1, &st)) + perror_msg_and_fail("fstat"); + if (st.st_size >= 103) + break; + } + + for (i = 0; i < N; ++i) { + /* sleep a bit to let the tracer catch up */ + sleep(1); + if (write(pipes[i][1], &i, sizeof(i)) != (int) sizeof(i)) + perror_msg_and_fail("write[%u]", i); + retval_t retval; + errno = pthread_join(t[i], &retval.ptr); + if (errno) + perror_msg_and_fail("pthread_join"); + errno = ENOENT; + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + retval.pid, child[i], sprintrc(-1), retval.pid); + } + + /* sleep a bit more to let the tracer catch up */ + sleep(1); + + pid_t pid = getpid(); + assert(chdir(text_parent) == -1); + + printf("%-5d chdir(\"%s\") = -1 ENOENT (%m)\n" + "%-5d +++ exited with 0 +++\n", pid, text_parent, pid); + + return 0; +} diff --git a/tests/attach-f-p.test b/tests/attach-f-p.test new file mode 100755 index 00000000..f4170740 --- /dev/null +++ b/tests/attach-f-p.test @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Check that -f -p attaches to threads properly. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -f -p is implemented using /proc/$pid/task/ +[ -d /proc/self/task/ ] || + framework_skip_ '/proc/self/task/ is not available' +run_prog_skip_if_failed \ + kill -0 $$ +run_prog ./attach-f-p-cmd > /dev/null + +rm -f "$OUT" +./set_ptracer_any sh -c "exec ./attach-f-p >> $OUT" > /dev/null & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any sh failed' +done + +run_strace -a32 -f -echdir -p $tracee_pid ./attach-f-p-cmd > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" diff --git a/tests/attach-p-cmd-cmd.c b/tests/attach-p-cmd-cmd.c new file mode 100644 index 00000000..d0f824e9 --- /dev/null +++ b/tests/attach-p-cmd-cmd.c @@ -0,0 +1,55 @@ +/* + * This file is part of attach-p-cmd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + static const char lockdir[] = "attach-p-cmd.test-lock"; + /* wait for the lock directory to be created by peer */ + while (rmdir(lockdir)) { + if (ENOENT != errno) + perror_msg_and_fail("rmdir: %s", lockdir); + } + + static const char dir[] = "attach-p-cmd.test cmd"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d chdir(\"%s\") = %s\n" + "%-5d +++ exited with 0 +++\n", + pid, dir, sprintrc(rc), pid); + + return 0; +} diff --git a/tests/attach-p-cmd-p.c b/tests/attach-p-cmd-p.c new file mode 100644 index 00000000..254d19ae --- /dev/null +++ b/tests/attach-p-cmd-p.c @@ -0,0 +1,83 @@ +/* + * This file is part of attach-p-cmd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask = {}; + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + static const char lockdir[] = "attach-p-cmd.test-lock"; + /* create a lock directory */ + if (mkdir(lockdir, 0700)) + perror_msg_and_fail("mkdir: %s", lockdir); + + /* wait for the lock directory to be removed by peer */ + while (mkdir(lockdir, 0700)) { + if (EEXIST != errno) + perror_msg_and_fail("mkdir: %s", lockdir); + } + + /* remove the lock directory */ + if (rmdir(lockdir)) + perror_msg_and_fail("rmdir: %s", lockdir); + + alarm(1); + pause(); + + static const char dir[] = "attach-p-cmd.test -p"; + pid_t pid = getpid(); + int rc = chdir(dir); + + printf("%-5d --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---\n" + "%-5d chdir(\"%s\") = %d %s (%m)\n" + "%-5d +++ exited with 0 +++\n", + pid, pid, dir, rc, errno2name(), pid); + + return 0; +} diff --git a/tests/attach-p-cmd.test b/tests/attach-p-cmd.test new file mode 100755 index 00000000..2068cf1d --- /dev/null +++ b/tests/attach-p-cmd.test @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Check that simultaneous use of -p option and tracing of a command works. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +rm -rf attach-p-cmd.test-lock +rm -f "$OUT" +./set_ptracer_any ./attach-p-cmd-p >> "$OUT" & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any ./attach-p-cmd-p failed' +done + +run_strace -a30 -echdir -p $tracee_pid ./attach-p-cmd-cmd > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" diff --git a/tests/bexecve.test b/tests/bexecve.test new file mode 100755 index 00000000..f1ab04f1 --- /dev/null +++ b/tests/bexecve.test @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Check -bexecve behavior. +# +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_strace_redir() +{ + args="$*" + $STRACE "$@" 2> "$LOG" +} + +run_strace_redir -enone ./set_ptracer_any true || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +run_strace_redir -enone ./set_ptracer_any false +[ $? -eq 1 ] || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +run_strace_redir -bexecve -enone ./set_ptracer_any false || + dump_log_and_fail_with "$STRACE $args: unexpected exit status" + +pattern_detached='[^:]*strace: Process [1-9][0-9]* detached' +pattern_personality='[^:]*strace: \[ Process PID=[1-9][0-9]* runs in .* mode. \]' + +LC_ALL=C grep -x "$pattern_detached" "$LOG" > /dev/null || + dump_log_and_fail_with "$STRACE $args: output mismatch" + +if LC_ALL=C grep -E -v -x "($pattern_detached|$pattern_personality)" "$LOG" > /dev/null; then + dump_log_and_fail_with "$STRACE $args: unexpected output" +fi + +exit 0 diff --git a/tests/bpf.c b/tests/bpf.c new file mode 100644 index 00000000..7ef16c9f --- /dev/null +++ b/tests/bpf.c @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2015-2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined HAVE_UNION_BPF_ATTR_LOG_BUF && defined __NR_bpf +# include +# include +# include +# include + +static const struct bpf_insn insns[] = { + { .code = BPF_JMP | BPF_EXIT } +}; + +static const char *errstr; +static char log_buf[4096]; + +static long +sys_bpf(kernel_ulong_t cmd, kernel_ulong_t attr, kernel_ulong_t size) +{ + long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + return rc; +} + +static int +map_create(void) +{ + union bpf_attr attr = { + .key_size = 4, + .value_size = 8, + .max_entries = 256 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(BPF_MAP_CREATE, (unsigned long) t_attr, sizeof(attr)); +} + +static int +map_any(int cmd) +{ + union bpf_attr attr = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} + +static int +prog_load(void) +{ + union bpf_attr attr = { + .insn_cnt = sizeof(insns) / sizeof(insns[0]), + .insns = (unsigned long) insns, + .license = (unsigned long) "GPL", + .log_level = 42, + .log_size = sizeof(log_buf), + .log_buf = (unsigned long) log_buf + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(BPF_PROG_LOAD, (unsigned long) t_attr, sizeof(attr)); +} + +/* + * bpf() syscall and its first six commands were introduced in Linux kernel + * 3.18. Some additional commands were added afterwards, so we need to take + * precautions to make sure the tests compile. + * + * BPF_OBJ_PIN and BPF_OBJ_GET commands appear in kernel 4.4. + */ +# ifdef HAVE_UNION_BPF_ATTR_BPF_FD +static int +obj_manage(int cmd) +{ + union bpf_attr attr = { + .pathname = (unsigned long) "/sys/fs/bpf/foo/bar", + .bpf_fd = -1 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} +# endif + +/* BPF_PROG_ATTACH and BPF_PROG_DETACH commands appear in kernel 4.10. */ +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE +static int +prog_cgroup(int cmd) +{ + union bpf_attr attr = { + .target_fd = -1, + .attach_bpf_fd = -1, + .attach_type = 0 + }; + void *const t_attr = tail_memdup(&attr, sizeof(attr)); + return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); +} +# endif + +static unsigned long efault; + +static void +bogus_bpf(int cmd, const char *name) +{ + const unsigned long bogus_size = 1024; + const unsigned long bogus_addr = efault - bogus_size; + + sys_bpf(cmd, efault, 4); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, efault, 4UL, errstr); + + sys_bpf(cmd, efault, bogus_size); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, efault, bogus_size, errstr); + + sys_bpf(cmd, bogus_addr, 0); + printf("bpf(%s, %#lx, %lu) = %s\n", + name, bogus_addr, 0UL, errstr); +} + +#define BOGUS_BPF(cmd) bogus_bpf(cmd, #cmd) + +int +main(void) +{ + efault = (unsigned long) tail_alloc(1) + 1; + + map_create(); + printf("bpf(BPF_MAP_CREATE" + ", {map_type=BPF_MAP_TYPE_UNSPEC, key_size=4" + ", value_size=8, max_entries=256}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_CREATE); + + map_any(BPF_MAP_LOOKUP_ELEM); + printf("bpf(BPF_MAP_LOOKUP_ELEM" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_LOOKUP_ELEM); + + map_any(BPF_MAP_UPDATE_ELEM); + printf("bpf(BPF_MAP_UPDATE_ELEM" + ", {map_fd=-1, key=0xdeadbeef" + ", value=0xbadc0ded, flags=BPF_ANY}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_UPDATE_ELEM); + + map_any(BPF_MAP_DELETE_ELEM); + printf("bpf(BPF_MAP_DELETE_ELEM" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_DELETE_ELEM); + + map_any(BPF_MAP_GET_NEXT_KEY); + printf("bpf(BPF_MAP_GET_NEXT_KEY" + ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_MAP_GET_NEXT_KEY); + + prog_load(); + printf("bpf(BPF_PROG_LOAD" + ", {prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=1, insns=%p" + ", license=\"GPL\", log_level=42, log_size=4096, log_buf=%p" + ", kern_version=0}, %u) = %s\n", + insns, log_buf, (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_LOAD); + +# ifdef HAVE_UNION_BPF_ATTR_BPF_FD + obj_manage(BPF_OBJ_PIN); + printf("bpf(BPF_OBJ_PIN" + ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_OBJ_PIN); + + obj_manage(BPF_OBJ_GET); + printf("bpf(BPF_OBJ_GET" + ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_OBJ_GET); +# endif + +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE + prog_cgroup(BPF_PROG_ATTACH); + printf("bpf(BPF_PROG_ATTACH" + ", {target_fd=-1, attach_bpf_fd=-1" + ", attach_type=BPF_CGROUP_INET_INGRESS}, %u) = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_ATTACH); + + prog_cgroup(BPF_PROG_DETACH); + printf("bpf(BPF_PROG_DETACH" + ", {target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS}, %u)" + " = %s\n", + (unsigned) sizeof(union bpf_attr), errstr); + BOGUS_BPF(BPF_PROG_DETACH); +# endif + + bogus_bpf(0xfacefeed, "0xfacefeed /* BPF_??? */"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_bpf") + +#endif diff --git a/tests/bpf.test b/tests/bpf.test new file mode 100755 index 00000000..adf0d576 --- /dev/null +++ b/tests/bpf.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check bpf syscall decoding. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a20 diff --git a/tests/brk.c b/tests/brk.c new file mode 100644 index 00000000..572ebd61 --- /dev/null +++ b/tests/brk.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_brk + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_brk, NULL); + printf("brk\\(NULL\\) = %#lx\n", rc); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_brk") + +#endif diff --git a/tests/brk.test b/tests/brk.test new file mode 100755 index 00000000..8c0e2e49 --- /dev/null +++ b/tests/brk.test @@ -0,0 +1,10 @@ +#!/bin/sh + +# Check brk syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a10 -ebrk $args > "$EXP" +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests/btrfs-v.test b/tests/btrfs-v.test new file mode 100755 index 00000000..1ee17b4b --- /dev/null +++ b/tests/btrfs-v.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check verbose decoding of btrfs ioctl + +. "${srcdir=.}/init.sh" + +run_prog ./btrfs -v > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests/btrfs-vw.test b/tests/btrfs-vw.test new file mode 100755 index 00000000..c7e40ad7 --- /dev/null +++ b/tests/btrfs-vw.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check verbose decoding of btrfs ioctl w/ live ioctls. + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-vw" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +run_prog ./btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests/btrfs-w.test b/tests/btrfs-w.test new file mode 100755 index 00000000..6238dca8 --- /dev/null +++ b/tests/btrfs-w.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check decoding of btrfs ioctl w/ live ioctls. + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-w" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests/btrfs.c b/tests/btrfs.c new file mode 100644 index 00000000..b3e23f80 --- /dev/null +++ b/tests/btrfs.c @@ -0,0 +1,1932 @@ +#include "tests.h" + +#ifdef HAVE_LINUX_BTRFS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "xlat.h" + +#include "xlat/btrfs_balance_args.h" +#include "xlat/btrfs_balance_flags.h" +#include "xlat/btrfs_balance_state.h" +#include "xlat/btrfs_compress_types.h" +#include "xlat/btrfs_defrag_flags.h" +#include "xlat/btrfs_dev_stats_values.h" +#include "xlat/btrfs_dev_stats_flags.h" +#include "xlat/btrfs_qgroup_inherit_flags.h" +#include "xlat/btrfs_qgroup_limit_flags.h" +#include "xlat/btrfs_scrub_flags.h" +#include "xlat/btrfs_send_flags.h" +#include "xlat/btrfs_space_info_flags.h" +#include "xlat/btrfs_snap_flags_v2.h" +#include "xlat/btrfs_tree_objectids.h" +#include "xlat/btrfs_features_compat.h" +#include "xlat/btrfs_features_compat_ro.h" +#include "xlat/btrfs_features_incompat.h" +#include "xlat/btrfs_key_types.h" + +#ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +#endif + +#ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +#endif + +#ifndef BTRFS_NAME_LEN +# define BTRFS_NAME_LEN 255 +#endif + +/* + * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in + * its definition, which isn't exported by the kernel. + */ +typedef __u64 u64; + +static const char *btrfs_test_root; +static int btrfs_test_dir_fd; +static bool verbose = false; +static bool write_ok = false; + +const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { + 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, +}; + +const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210"; + +#ifndef BTRFS_IOC_QUOTA_RESCAN +struct btrfs_ioctl_quota_rescan_args { + uint64_t flags, progress, reserved[6]; +}; +# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ + struct btrfs_ioctl_quota_rescan_args) +# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ + struct btrfs_ioctl_quota_rescan_args) +#endif + +#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +#endif + +#ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags) +# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[2]) +# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ + struct btrfs_ioctl_feature_flags[3]) +#endif + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +struct btrfs_ioctl_feature_flags { + uint64_t compat_flags; + uint64_t compat_ro_flags; + uint64_t incompat_flags; +}; +#endif + +#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +struct btrfs_ioctl_defrag_range_args { + uint64_t start; + uint64_t len; + uint64_t flags; + uint32_t extent_thresh; + uint32_t compress_type; + uint32_t unused[4]; +}; +#endif + +#ifndef FIDEDUPERANGE +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +struct file_dedupe_range_info { + int64_t dest_fd; /* in - destination file */ + uint64_t dest_offset; /* in - start of extent in destination */ + uint64_t bytes_deduped; /* out - total # of bytes we were able + * to dedupe from this file. */ + /* status of this dedupe operation: + * < 0 for error + * == FILE_DEDUPE_RANGE_SAME if dedupe succeeds + * == FILE_DEDUPE_RANGE_DIFFERS if data differs + */ + int32_t status; /* out - see above description */ + uint32_t reserved; /* must be zero */ +}; + +struct file_dedupe_range { + uint64_t src_offset; /* in - start of extent in source */ + uint64_t src_length; /* in - length of extent */ + uint16_t dest_count; /* in - total elements in info array */ + uint16_t reserved1; /* must be zero */ + uint32_t reserved2; /* must be zero */ + struct file_dedupe_range_info info[0]; +}; +#endif + +#ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ + struct btrfs_ioctl_search_args_v2) +struct btrfs_ioctl_search_args_v2 { + struct btrfs_ioctl_search_key key; /* in/out - search parameters */ + uint64_t buf_size; /* in - size of buffer + * out - on EOVERFLOW: needed size + * to store item */ + uint64_t buf[0]; /* out - found items */ +}; +#endif + + +static const char * +maybe_print_uint64max(uint64_t val) +{ + if (val == UINT64_MAX) + return " /* UINT64_MAX */"; + return ""; +} + +/* takes highest valid flag bit */ +static uint64_t +max_flags_plus_one(int bit) +{ + int i; + uint64_t val = 0; + if (bit == -1) + return 1; + for (i = 0; i <= bit + 1 && i < 64; i++) + val |= (1ULL << i); + return val; +} + +/* + * Consumes no arguments, returns nothing: + * + * - BTRFS_IOC_TRANS_START + * - BTRFS_IOC_TRANS_END + */ +static void +btrfs_test_trans_ioctls(void) +{ + ioctl(-1, BTRFS_IOC_TRANS_START, NULL); + printf("ioctl(-1, BTRFS_IOC_TRANS_START) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_TRANS_END, NULL); + printf("ioctl(-1, BTRFS_IOC_TRANS_END) = -1 EBADF (%m)\n"); +} + +/* + * Consumes no arguments, returns nothing: + * - BTRFS_IOC_SYNC + * + * Consumes argument, returns nothing + * - BTRFS_IOC_WAIT_SYNC + */ +static void +btrfs_test_sync_ioctls(void) +{ + uint64_t u64val = 0xdeadbeefbadc0dedULL; + + ioctl(-1, BTRFS_IOC_SYNC, NULL); + printf("ioctl(-1, BTRFS_IOC_SYNC) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL); + printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_WAIT_SYNC, &u64val); + printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, [%" PRIu64 + "]) = -1 EBADF (%m)\n", u64val); + + /* + * The live test of BTRFS_IOC_SYNC happens as a part of the test + * for BTRFS_IOC_LOGICAL_INO + */ +} + +static void +btrfs_print_qgroup_inherit(struct btrfs_qgroup_inherit *inherit) +{ + printf("{flags="); + printflags(btrfs_qgroup_inherit_flags, inherit->flags, + "BTRFS_QGROUP_INHERIT_???"); + printf(", num_qgroups=%" PRI__u64 + ", num_ref_copies=%" PRI__u64 + ", num_excl_copies=%" PRI__u64", lim={flags=", + inherit->num_qgroups, inherit->num_ref_copies, + inherit->num_excl_copies); + printflags(btrfs_qgroup_limit_flags, + inherit->lim.flags, + "BTRFS_QGROUP_LIMIT_???"); + printf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 + ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 + "}, qgroups=", + inherit->lim.max_rfer, inherit->lim.max_excl, + inherit->lim.rsv_rfer, inherit->lim.rsv_excl); + if (verbose) { + unsigned int i; + printf("["); + for (i = 0; i < inherit->num_qgroups; i++) { + if (i > 0) + printf(", "); + printf("%" PRI__u64, inherit->qgroups[i]); + } + printf("]"); + } else + printf("..."); + printf("}"); +} + + +static void +btrfs_print_vol_args_v2(struct btrfs_ioctl_vol_args_v2 *args, int print_qgroups) +{ + printf("{fd=%d, flags=", (int) args->fd); + printflags(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); + + if (args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) { + printf(", size=%" PRI__u64 ", qgroup_inherit=", args->size); + if (args->qgroup_inherit && print_qgroups) + btrfs_print_qgroup_inherit(args->qgroup_inherit); + else if (args->qgroup_inherit) + printf("%p", args->qgroup_inherit); + else + printf("NULL"); + } + printf(", name=\"%s\"}", args->name); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SNAP_CREATE + * - BTRFS_IOC_SUBVOL_CREATE + * - BTRFS_IOC_SNAP_DESTROY + * - BTRFS_IOC_DEFAULT_SUBVOL + * + * Consumes argument, returns u64: + * - BTRFS_IOC_SNAP_CREATE_V2 + * - BTRFS_IOC_SUBVOL_CREATE_V2 + */ + +static void +btrfs_test_subvol_ioctls(void) +{ + const char *subvol_name = "subvol-name"; + char *long_subvol_name; + void *bad_pointer = (void *) (unsigned long) 0xdeadbeeffffffeedULL; + uint64_t u64val = 0xdeadbeefbadc0dedULL; + struct btrfs_ioctl_vol_args vol_args = {}; + struct btrfs_ioctl_vol_args_v2 vol_args_v2 = { + .fd = 2, + .flags = max_flags_plus_one(2), + }; + + long_subvol_name = malloc(BTRFS_PATH_NAME_MAX); + if (!long_subvol_name) + perror_msg_and_fail("malloc failed"); + memset(long_subvol_name, 'f', BTRFS_PATH_NAME_MAX); + long_subvol_name[BTRFS_PATH_NAME_MAX - 1] = '\0'; + + strcpy(vol_args.name, subvol_name); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, " + "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, " + "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + strncpy(vol_args.name, long_subvol_name, BTRFS_PATH_NAME_MAX); + ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," + " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + + long_subvol_name = realloc(long_subvol_name, BTRFS_SUBVOL_NAME_MAX); + if (!long_subvol_name) + perror_msg_and_fail("realloc failed"); + + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + + strcpy(vol_args_v2.name, subvol_name); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + strncpy(vol_args_v2.name, long_subvol_name, BTRFS_SUBVOL_NAME_MAX); + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + strcpy(vol_args_v2.name, subvol_name); + vol_args_v2.qgroup_inherit = bad_pointer; + + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 0); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 0); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + const unsigned int n_qgroups = 8; + unsigned int i; + struct btrfs_qgroup_inherit *inherit; + vol_args_v2.size = + sizeof(*inherit) + n_qgroups * sizeof(inherit->qgroups[0]); + inherit = tail_alloc(vol_args_v2.size); + + inherit->flags = 0x3; + inherit->num_ref_copies = 0; + inherit->num_excl_copies = 0; + inherit->num_qgroups = n_qgroups; + for (i = 0; i < n_qgroups; i++) + inherit->qgroups[i] = 1ULL << i; + inherit->lim.flags = 0x7f; + inherit->lim.max_rfer = u64val; + inherit->lim.max_excl = u64val; + inherit->lim.rsv_rfer = u64val; + inherit->lim.rsv_excl = u64val; + vol_args_v2.qgroup_inherit = inherit; + + printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); + printf(") = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, &u64val); + printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, [%" + PRIu64 "]) = -1 EBADF (%m)\n", u64val); + + printf("ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, "); + printflags(btrfs_snap_flags_v2, vol_args_v2.flags, + "BTRFS_SUBVOL_???"); + ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, &vol_args_v2.flags); + printf(") = -1 EBADF (%m)\n"); + + if (write_ok) { + struct btrfs_ioctl_vol_args_v2 args_passed; + /* + * Returns transid if flags & BTRFS_SUBVOL_CREATE_ASYNC + * - BTRFS_IOC_SNAP_CREATE_V2 + * - BTRFS_IOC_SUBVOL_CREATE_V2 + */ + int subvolfd; + + strncpy(vol_args_v2.name, subvol_name, + sizeof(vol_args_v2.name)); + vol_args_v2.flags = BTRFS_SUBVOL_CREATE_ASYNC; + vol_args_v2.size = 0; + vol_args_v2.qgroup_inherit = NULL; + args_passed = vol_args_v2; + printf("ioctl(%d, BTRFS_IOC_SUBVOL_CREATE_V2, ", + btrfs_test_dir_fd); + btrfs_print_vol_args_v2(&vol_args_v2, 1); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, + &args_passed); + printf(" => {transid=%" PRI__u64"}) = 0\n", + args_passed.transid); + + subvolfd = openat(btrfs_test_dir_fd, subvol_name, + O_RDONLY|O_DIRECTORY); + if (subvolfd < 0) + perror_msg_and_fail("openat(%s) failed", subvol_name); + + strncpy(vol_args_v2.name, long_subvol_name, BTRFS_NAME_LEN); + vol_args_v2.fd = subvolfd; + args_passed = vol_args_v2; + printf("ioctl(%d, BTRFS_IOC_SNAP_CREATE_V2, ", + btrfs_test_dir_fd); + btrfs_print_vol_args_v2(&args_passed, 1); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_CREATE_V2, + &args_passed); + printf(" => {transid=%" PRI__u64"}) = 0\n", + args_passed.transid); + + /* This only works when mounted w/ -ouser_subvol_rm_allowed */ + strncpy(vol_args.name, long_subvol_name, 255); + vol_args.name[255] = 0; + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " + "{fd=%d, name=\"%.*s\"}) = 0\n", + btrfs_test_dir_fd, (int) vol_args.fd, 255, long_subvol_name); + + strcpy(vol_args.name, subvol_name); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); + printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " + "{fd=%d, name=\"%s\"}) = 0\n", + btrfs_test_dir_fd, (int) vol_args.fd, subvol_name); + + close(subvolfd); + } + free(long_subvol_name); +} + +static void +btrfs_print_balance_args(struct btrfs_balance_args *args) +{ + printf("{profiles="); + printflags(btrfs_space_info_flags, args->profiles, + "BTRFS_BLOCK_GROUP_???"); + printf(", usage=%"PRI__u64 "%s, devid=%"PRI__u64 "%s, pstart=%"PRI__u64 + "%s, pend=%"PRI__u64 "%s, vstart=%"PRI__u64 "%s, vend=%"PRI__u64 + "%s, target=%"PRI__u64 "%s, flags=", + args->usage, maybe_print_uint64max(args->usage), + args->devid, maybe_print_uint64max(args->devid), + args->pstart, maybe_print_uint64max(args->pstart), + args->pend, maybe_print_uint64max(args->pend), + args->vstart, maybe_print_uint64max(args->vstart), + args->vend, maybe_print_uint64max(args->vend), + args->target, maybe_print_uint64max(args->target)); + printflags(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); + printf("}"); +} + +/* + * Accepts argument, returns nothing + * - BTRFS_IOC_BALANCE + * - BTRFS_IOC_BALANCE_CTL + * + * Accepts argument, returns argument + * - BTRFS_IOC_BALANCE_V2 + */ +static void +btrfs_test_balance_ioctls(void) +{ + struct btrfs_ioctl_balance_args args = { + .flags = 0x3f, + .data = { + .profiles = 0x7, + .flags = 0x7, + .devid = 1, + .pend = -1ULL, + .vend = -1ULL, + }, + + .meta = { + .profiles = 0x38, + .flags = 0x38, + .devid = 1, + }, + + .sys = { + .profiles = 0x1c0 | (1ULL << 48), + .flags = 0x4c0, + .devid = 1, + }, + }; + struct btrfs_ioctl_vol_args vol_args = {}; + + ioctl(-1, BTRFS_IOC_BALANCE_CTL, 1); + printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " + "BTRFS_BALANCE_CTL_PAUSE) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE_CTL, 2); + printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " + "BTRFS_BALANCE_CTL_CANCEL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE, NULL); + printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_BALANCE, &vol_args); + printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + + /* struct btrfs_ioctl_balance_args */ + ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, {flags="); + printflags(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + ioctl(-1, BTRFS_IOC_BALANCE_V2, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + args.flags = BTRFS_BALANCE_DATA | BTRFS_BALANCE_METADATA | + BTRFS_BALANCE_SYSTEM; + args.data.flags = 0; + args.data.profiles = 0; + args.meta.flags = 0; + args.meta.profiles = 0; + args.sys.flags = 0; + args.sys.profiles = 0; + printf("ioctl(%d, BTRFS_IOC_BALANCE_V2, {flags=", + btrfs_test_dir_fd); + + printflags(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); + printf("} => {flags="); + printflags(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", state="); + printflags(btrfs_balance_state, args.state, + "BTRFS_BALANCE_STATE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + printf("}) = 0\n"); + } +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_RESIZE + * + * Requires /dev/btrfs-control, consumes argument, returns nothing: + * - BTRFS_IOC_SCAN_DEV + * - BTRFS_IOC_DEVICES_READY + * + */ +static void +btrfs_test_device_ioctls(void) +{ + const char *devid = "1"; + const char *devname = "/dev/sda1"; + struct btrfs_ioctl_vol_args args = { + .fd = 2, + }; + + ioctl(-1, BTRFS_IOC_RESIZE, NULL); + printf("ioctl(-1, BTRFS_IOC_RESIZE, NULL) = -1 EBADF (%m)\n"); + + strcpy(args.name, devid); + ioctl(-1, BTRFS_IOC_RESIZE, &args); + printf("ioctl(-1, BTRFS_IOC_RESIZE, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL) = -1 EBADF (%m)\n"); + + strcpy(args.name, devname); + ioctl(-1, BTRFS_IOC_SCAN_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_ADD_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_ADD_DEV, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_ADD_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_ADD_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + + ioctl(-1, BTRFS_IOC_RM_DEV, NULL); + printf("ioctl(-1, BTRFS_IOC_RM_DEV, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_RM_DEV, &args); + printf("ioctl(-1, BTRFS_IOC_RM_DEV, " + "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + (int) args.fd, args.name); + +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_CLONE + * - BTRFS_IOC_CLONE_RANGE + */ +static void +btrfs_test_clone_ioctls(void) +{ + int clone_fd = 4; + struct btrfs_ioctl_clone_range_args args = { + .src_fd = clone_fd, + .src_offset = 4096, + .src_length = 16384, + .dest_offset = 128 * 1024, + }; + + ioctl(-1, BTRFS_IOC_CLONE, clone_fd); + printf("ioctl(-1, BTRFS_IOC_CLONE or FICLONE, %x) = -1 EBADF (%m)\n", + clone_fd); + + ioctl(-1, BTRFS_IOC_CLONE_RANGE, NULL); + printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + "NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_CLONE_RANGE, &args); + printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + "{src_fd=%d, src_offset=%" PRI__u64 ", src_length=%" PRI__u64 + ", dest_offset=%" PRI__u64 "}) = -1 EBADF (%m)\n", + (int) args.src_fd, args.src_offset, args.src_length, + args.dest_offset); +} + +#define BTRFS_COMPRESS_TYPES 2 +#define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) + +static void +btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args) +{ + printf("{start=%" PRIu64", len=%" PRIu64 "%s, flags=", + (uint64_t) args->start, (uint64_t) args->len, + maybe_print_uint64max(args->len)); + + printflags(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); + printf(", extent_thresh=%u, compress_type=", args->extent_thresh); + printxval(btrfs_compress_types, args->compress_type, + "BTRFS_COMPRESS_???"); + printf("}"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_DEFRAG + * - BTRFS_DEFRAG_RANGE + */ +static void +btrfs_test_defrag_ioctls(void) +{ + struct btrfs_ioctl_vol_args vol_args = {}; + struct btrfs_ioctl_defrag_range_args args = { + .start = 0, + .len = -1ULL, + .flags = max_flags_plus_one(1), + .extent_thresh = 128 * 1024, + .compress_type = 2, /* BTRFS_COMPRESS_LZO */ + }; + + /* + * These are documented as using vol_args but don't + * actually consume it. + */ + ioctl(-1, BTRFS_IOC_DEFRAG, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEFRAG, &vol_args); + printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + + /* struct btrfs_ioctl_defrag_range_args */ + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL); + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); + + args.compress_type = BTRFS_INVALID_COMPRESS; + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); + + args.len--; + printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); + btrfs_print_defrag_range_args(&args); + ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); + printf(") = -1 EBADF (%m)\n"); +} + +static const char * +xlookup(const struct xlat *xlat, const uint64_t val) +{ + for (; xlat->str != NULL; xlat++) + if (xlat->val == val) + return xlat->str; + return NULL; +} + +static void +btrfs_print_objectid(uint64_t objectid) +{ + const char *str = xlookup(btrfs_tree_objectids, objectid); + printf("%" PRIu64, objectid); + if (str) + printf(" /* %s */", str); +} + +static void +btrfs_print_key_type(uint32_t type) +{ + const char *str = xlookup(btrfs_key_types, type); + printf("%u", type); + if (str) + printf(" /* %s */", str); +} + +static void +btrfs_print_search_key(struct btrfs_ioctl_search_key *key) +{ + printf("key={tree_id="); + btrfs_print_objectid(key->tree_id); + if (verbose || key->min_objectid != 256) { + printf(", min_objectid="); + btrfs_print_objectid(key->min_objectid); + } + if (verbose || key->max_objectid != -256ULL) { + printf(", max_objectid="); + btrfs_print_objectid(key->max_objectid); + } + if (key->min_offset) + printf(", min_offset=%" PRI__u64 "%s", + key->min_offset, maybe_print_uint64max(key->min_offset)); + if (key->max_offset) + printf(", max_offset=%" PRI__u64 "%s", + key->max_offset, maybe_print_uint64max(key->max_offset)); + if (key->min_transid) + printf(", min_transid=%" PRI__u64"%s", key->min_transid, + maybe_print_uint64max(key->min_transid)); + if (key->max_transid) + printf(", max_transid=%" PRI__u64"%s", key->max_transid, + maybe_print_uint64max(key->max_transid)); + printf(", min_type="); + btrfs_print_key_type(key->min_type); + printf(", max_type="); + btrfs_print_key_type(key->max_type); + printf(", nr_items=%u}", key->nr_items); +} + +static void +btrfs_print_tree_search_buf(struct btrfs_ioctl_search_key *key, + void *buf, uint64_t buf_size) +{ + if (verbose) { + uint64_t i; + uint64_t off = 0; + printf("["); + for (i = 0; i < key->nr_items; i++) { + struct btrfs_ioctl_search_header *sh; + sh = (typeof(sh))(buf + off); + if (i) + printf(", "); + printf("{transid=%" PRI__u64 ", objectid=", + sh->transid); + btrfs_print_objectid(sh->objectid); + printf(", offset=%" PRI__u64 ", type=", sh->offset); + btrfs_print_key_type(sh->type); + printf(", len=%u}", sh->len); + off += sizeof(*sh) + sh->len; + } + printf("]"); + } else + printf("..."); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_TREE_SEARCH + * - BTRFS_IOC_TREE_SEARCH_V2 + */ +static void +btrfs_test_search_ioctls(void) +{ + struct btrfs_ioctl_search_key key_reference = { + .tree_id = 5, + .min_objectid = 256, + .max_objectid = -1ULL, + .min_offset = 0, + .max_offset = -1ULL, + .min_transid = 0, + .max_transid = -1ULL, + .min_type = 0, + .max_type = -1U, + .nr_items = 10, + }; + struct btrfs_ioctl_search_args search_args; + struct btrfs_ioctl_search_args_v2 search_args_v2 = { + .buf_size = 4096, + }; + + ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL); + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL); + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL) = -1 EBADF (%m)\n"); + + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_objectid = 6; + key_reference.max_objectid = 7; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_offset++; + key_reference.max_offset--; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_transid++; + key_reference.max_transid--; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + key_reference.min_type = 1; + key_reference.max_type = 12; + search_args.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + btrfs_print_search_key(&search_args.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("}) = -1 EBADF (%m)\n"); + + search_args_v2.key = key_reference; + printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + btrfs_print_search_key(&search_args_v2.key); + ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); + printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", + (uint64_t)search_args_v2.buf_size); + + if (btrfs_test_root) { + struct btrfs_ioctl_search_args_v2 *args; + int bufsize = 4096; + + key_reference.tree_id = 5; + key_reference.min_type = 1; + key_reference.max_type = 1; + key_reference.min_objectid = 256; + key_reference.max_objectid = 357; + key_reference.min_offset = 0; + key_reference.max_offset = -1ULL; + + search_args.key = key_reference; + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&search_args.key); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH, &search_args); + printf("} => {key={nr_items=%u}, buf=", + search_args.key.nr_items); + btrfs_print_tree_search_buf(&search_args.key, search_args.buf, + sizeof(search_args.buf)); + printf("}) = 0\n"); + + args = malloc(sizeof(*args) + bufsize); + if (!args) + perror_msg_and_fail("malloc failed"); + + args->key = key_reference; + args->buf_size = bufsize; + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&key_reference); + printf(", buf_size=%" PRIu64 "}", (uint64_t) args->buf_size); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); + printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", buf=", + args->key.nr_items, (uint64_t)args->buf_size); + btrfs_print_tree_search_buf(&args->key, args->buf, + args->buf_size); + printf("}) = 0\n"); + + args->key = key_reference; + args->buf_size = sizeof(struct btrfs_ioctl_search_header); + printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", + btrfs_test_dir_fd); + btrfs_print_search_key(&args->key); + printf(", buf_size=%" PRIu64 "}", (uint64_t)args->buf_size); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); + printf(" => {buf_size=%" PRIu64 "}) = -1 EOVERFLOW (%m)\n", + (uint64_t)args->buf_size); + free(args); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_INO_LOOKUP + */ +static void +btrfs_test_ino_lookup_ioctl(void) +{ + struct btrfs_ioctl_ino_lookup_args args = { + .treeid = 5, + .objectid = 256, + }; + + ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL); + printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, {treeid="); + btrfs_print_objectid(args.treeid); + printf(", objectid="); + btrfs_print_objectid(args.objectid); + ioctl(-1, BTRFS_IOC_INO_LOOKUP, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (btrfs_test_root) { + printf("ioctl(%d, BTRFS_IOC_INO_LOOKUP, {treeid=", + btrfs_test_dir_fd); + btrfs_print_objectid(args.treeid); + printf(", objectid="); + btrfs_print_objectid(args.objectid); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_LOOKUP, &args); + printf("} => {name=\"%s\"}) = 0\n", args.name); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_SPACE_INFO + */ +static void +btrfs_test_space_info_ioctl(void) +{ + struct btrfs_ioctl_space_args args = {}; + + ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL); + printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SPACE_INFO, &args); + printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", + args.space_slots); + + if (btrfs_test_root) { + struct btrfs_ioctl_space_args args_passed; + struct btrfs_ioctl_space_args *argsp; + args_passed = args; + printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, args_passed.space_slots); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, &args_passed); + printf(" => {total_spaces=%" PRI__u64 "}) = 0\n", + args_passed.total_spaces); + + argsp = malloc(sizeof(args) + + args_passed.total_spaces * sizeof(args.spaces[0])); + if (!argsp) + perror_msg_and_fail("malloc failed"); + + *argsp = args; + argsp->space_slots = args_passed.total_spaces; + printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " + "{space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, argsp->space_slots); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, argsp); + printf(" => {total_spaces=%" PRI__u64 ", spaces=", + argsp->total_spaces); + if (verbose) { + unsigned int i; + printf("["); + for (i = 0; i < argsp->total_spaces; i++) { + struct btrfs_ioctl_space_info *info; + info = &argsp->spaces[i]; + if (i) + printf(", "); + printf("{flags="); + printflags(btrfs_space_info_flags, info->flags, + "BTRFS_SPACE_INFO_???"); + printf(", total_bytes=%" PRI__u64 + ", used_bytes=%" PRI__u64 "}", + info->total_bytes, info->used_bytes); + } + + printf("]"); + } else + printf("..."); + printf("}) = 0\n"); + free(argsp); + } +} + +/* + * Consumes no arguments, returns nothing: + * - BTRFS_IOC_SCRUB_CANCEL + * Consumes argument, returns argument: + - * BTRFS_IOC_SCRUB + - * BTRFS_IOC_SCRUB_PROGRESS + */ +static void +btrfs_test_scrub_ioctls(void) +{ + struct btrfs_ioctl_scrub_args args = { + .devid = 1, + .start = 0, + .end = -1ULL, + .flags = max_flags_plus_one(0), + }; + + ioctl(-1, BTRFS_IOC_SCRUB, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_CANCEL, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB_CANCEL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SCRUB, {devid=%" PRI__u64 ", start=%" + PRI__u64 "%s, end=%" PRI__u64"%s, flags=", + args.devid, args.start, maybe_print_uint64max(args.start), + args.end, maybe_print_uint64max(args.end)); + printflags(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); + ioctl(-1, BTRFS_IOC_SCRUB, &args); + printf("}) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL); + printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, &args); + printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, " + "{devid=%" PRI__u64 "}) = -1 EBADF (%m)\n", args.devid); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_DEV_INFO + */ +static void +btrfs_test_dev_info_ioctl(void) +{ + struct btrfs_ioctl_dev_info_args args = { + .devid = 1, + }; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); + + ioctl(-1, BTRFS_IOC_DEV_INFO, NULL); + printf("ioctl(-1, BTRFS_IOC_DEV_INFO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEV_INFO, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_INFO, " + "{devid=%" PRI__u64", uuid=%s}) = -1 EBADF (%m)\n", + args.devid, uuid_reference_string); +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_INO_PATHS + * - BTRFS_IOC_LOGICAL_INO + */ +static void +btrfs_test_ino_path_ioctls(void) +{ + char buf[16384]; + struct btrfs_ioctl_ino_path_args args = { + .inum = 256, + .size = sizeof(buf), + .fspath = (unsigned long)buf, + }; + + ioctl(-1, BTRFS_IOC_INO_PATHS, NULL); + printf("ioctl(-1, BTRFS_IOC_INO_PATHS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL); + printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_INO_PATHS, &args); + printf("ioctl(-1, BTRFS_IOC_INO_PATHS, " + "{inum=%" PRI__u64", size=%" PRI__u64 + ", fspath=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", + args.inum, args.size, args.fspath); + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 + ", size=%" PRI__u64", inodes=0x%" PRI__x64 + "}) = -1 EBADF (%m)\n", args.inum, args.size, args.fspath); + +#ifdef HAVE_LINUX_FIEMAP_H + if (btrfs_test_root) { + int size; + struct stat si; + int ret; + struct btrfs_data_container *data = (void *)buf; + struct fiemap *fiemap; + int fd; + + ret = fstat(btrfs_test_dir_fd, &si); + if (ret) + perror_msg_and_fail("fstat failed"); + + args.inum = si.st_ino; + printf("ioctl(%d, BTRFS_IOC_INO_PATHS, " + "{inum=%" PRI__u64", size=%" PRI__u64 + ", fspath=0x%" PRI__x64"}", + btrfs_test_dir_fd, args.inum, args.size, + args.fspath); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_PATHS, &args); + printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + data->bytes_left, data->bytes_missing, data->elem_cnt, + data->elem_missed); + if (verbose) { + printf("[\"strace-test\"]"); + } else + printf("..."); + printf("}}) = 0\n"); + + fd = openat(btrfs_test_dir_fd, "file1", O_RDWR|O_CREAT, 0600); + if (fd < 0) + perror_msg_and_fail("openat(file1) failed"); + + ret = fstat(fd, &si); + if (ret) + perror_msg_and_fail("fstat failed"); + + if (write(fd, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd"); + + /* + * Force delalloc so we can actually + * search for the extent. + */ + fsync(fd); + ioctl(fd, BTRFS_IOC_SYNC, NULL); + printf("ioctl(%d, BTRFS_IOC_SYNC) = 0\n", fd); + + size = sizeof(*fiemap) + 2 * sizeof(fiemap->fm_extents[0]); + fiemap = malloc(size); + if (!fiemap) + perror_msg_and_fail("malloc failed"); + memset(fiemap, 0, size); + + fiemap->fm_length = sizeof(buf); + fiemap->fm_extent_count = 2; + + /* This is also a live test for FIEMAP */ + printf("ioctl(%d, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64", fm_flags=", + fd, fiemap->fm_start, fiemap->fm_length); + printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_extent_count=%u}", fiemap->fm_extent_count); + ioctl(fd, FS_IOC_FIEMAP, fiemap); + printf(" => {fm_flags="); + printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_mapped_extents=%u, fm_extents=", + fiemap->fm_mapped_extents); + if (verbose) { + printf("["); + unsigned int i; + for (i = 0; i < fiemap->fm_mapped_extents; i++) { + struct fiemap_extent *fe; + fe = &fiemap->fm_extents[i]; + if (i) + printf(", "); + printf("{fe_logical=%" PRI__u64 + ", fe_physical=%" PRI__u64 + ", fe_length=%" PRI__u64 + ", ", + fe->fe_logical, fe->fe_physical, + fe->fe_length); + printflags(fiemap_extent_flags, fe->fe_flags, + "FIEMAP_EXTENT_???"); + printf("}"); + } + printf("]"); + } else + printf("..."); + printf("}) = 0\n"); + + args.inum = fiemap->fm_extents[0].fe_physical; + printf("ioctl(%d, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 + ", size=%" PRI__u64", inodes=0x%" PRI__x64"}", + fd, args.inum, args.size, args.fspath); + ioctl(fd, BTRFS_IOC_LOGICAL_INO, &args); + printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + data->bytes_left, data->bytes_missing, data->elem_cnt, + data->elem_missed); + if (verbose) { + printf("[{inum=%llu, offset=0, root=5}]", + (unsigned long long) si.st_ino); + } else + printf("..."); + printf("}}) = 0\n"); + close(fd); + free(fiemap); + } +#endif /* HAVE_LINUX_FIEMAP_H */ +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_SET_RECEIVED_SUBVOL + */ +static void +btrfs_test_set_received_subvol_ioctl(void) +{ + struct btrfs_ioctl_received_subvol_args args = { + .stransid = 0x12345, + .stime = { + .sec = 1463193386, + .nsec = 12345, + }, + }; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); + + ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " + "NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, &args); + printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " + "{uuid=%s, stransid=%" PRI__u64", stime=%" PRI__u64 + ".%u, flags=0}) = -1 EBADF (%m)\n", + uuid_reference_string, args.stransid, args.stime.sec, + args.stime.nsec); +} + +/* + * Consumes argument, returns nothing (output is via send_fd) + * - BTRFS_IOC_SEND + */ +static void +btrfs_test_send_ioctl(void) +{ + uint64_t u64_array[2] = { 256, 257 }; + struct btrfs_ioctl_send_args args = { + .send_fd = 4, + .parent_root = 257, + .flags = max_flags_plus_one(2), + }; + + ioctl(-1, BTRFS_IOC_SEND, NULL); + printf("ioctl(-1, BTRFS_IOC_SEND, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SEND, " + "{send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=", + (int) args.send_fd, args.clone_sources_count); + if (verbose) + printf("NULL"); + else + printf("..."); + printf(", parent_root="); + btrfs_print_objectid(args.parent_root); + printf(", flags="); + printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + ioctl(-1, BTRFS_IOC_SEND, &args); + printf("}) = -1 EBADF (%m)\n"); + + args.clone_sources_count = 2; + args.clone_sources = (__u64 *) (void *) u64_array; + + printf("ioctl(-1, BTRFS_IOC_SEND, " + "{send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=", + (int) args.send_fd, args.clone_sources_count); + if (verbose) { + printf("["); + btrfs_print_objectid(u64_array[0]); + printf(", "); + btrfs_print_objectid(u64_array[1]); + printf("]"); + } else + printf("..."); + printf(", parent_root="); + btrfs_print_objectid(args.parent_root); + printf(", flags="); + printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + ioctl(-1, BTRFS_IOC_SEND, &args); + printf("}) = -1 EBADF (%m)\n"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QUOTA_CTL + */ +static void +btrfs_test_quota_ctl_ioctl(void) +{ + struct btrfs_ioctl_quota_ctl_args args = { + .cmd = 1, + }; + + ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_ENABLE}) = -1 EBADF (%m)\n"); + + args.cmd = 2; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_DISABLE}) = -1 EBADF (%m)\n"); + + args.cmd = 3; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "BTRFS_QUOTA_CTL_RESCAN__NOTUSED}) = -1 EBADF (%m)\n"); + + args.cmd = 4; + ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " + "0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QGROUP_ASSIGN + */ +static void +btrfs_test_qgroup_assign_ioctl(void) +{ + struct btrfs_ioctl_qgroup_assign_args args = { + .assign = 1, + .src = 257, + .dst = 258, + }; + + ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL); + printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, &args); + printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, " + "{assign=%" PRI__u64", src=%" PRI__u64", dst=%" PRI__u64 + "}) = -1 EBADF (%m)\n", args.assign, args.src, args.dst); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_QGROUP_CREATE + */ +static void +btrfs_test_qgroup_create_ioctl(void) +{ + struct btrfs_ioctl_qgroup_create_args args = { + .create = 1, + .qgroupid = 257, + }; + + ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL); + printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QGROUP_CREATE, &args); + printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, " + "{create=%" PRI__u64", qgroupid=%" PRI__u64 + "}) = -1 EBADF (%m)\n", args.create, args.qgroupid); +} + +/* + * Consumes nothing, returns nothing: + * - BTRFS_IOC_QUOTA_RESCAN_WAIT + * Consumes argument, returns nothing: + * - BTRFS_IOC_QUOTA_RESCAN + */ +static void +btrfs_test_quota_rescan_ioctl(void) +{ + struct btrfs_ioctl_quota_rescan_args args = { + .progress = 1, + }; + + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, &args); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, " + "{flags=0}) = -1 EBADF (%m)\n"); + ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT, NULL); + printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT) = -1 EBADF (%m)\n"); + +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SET_FSLABEL + * + * Consumes no argument, returns argument: + * - BTRFS_IOC_GET_FS_LABEL + */ +static void +btrfs_test_label_ioctls(void) +{ + char label[BTRFS_LABEL_SIZE] = "btrfs-label"; + + ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_SET_FSLABEL, label); + printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, \"%s\") = -1 EBADF (%m)\n", + label); + + if (write_ok) { + ioctl(btrfs_test_dir_fd, BTRFS_IOC_SET_FSLABEL, label); + printf("ioctl(%d, BTRFS_IOC_SET_FSLABEL, \"%s\") = 0\n", + btrfs_test_dir_fd, label); + + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FSLABEL, label); + printf("ioctl(%d, BTRFS_IOC_GET_FSLABEL, \"%s\") = 0\n", + btrfs_test_dir_fd, label); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_GET_DEV_STATS + */ +static void +btrfs_test_get_dev_stats_ioctl(void) +{ + struct btrfs_ioctl_get_dev_stats args = { + .devid = 1, + .nr_items = 5, + .flags = max_flags_plus_one(0), + }; + + ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL); + printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 + ", nr_items=%" PRI__u64", flags=", + args.devid, args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + ioctl(-1, BTRFS_IOC_GET_DEV_STATS, &args); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + unsigned int i; + args.flags = BTRFS_DEV_STATS_RESET; + printf("ioctl(%d, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 + ", nr_items=%" PRI__u64", flags=", + btrfs_test_dir_fd, args.devid, args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_DEV_STATS, &args); + printf("} => {nr_items=%" PRI__u64 ", flags=", + args.nr_items); + printflags(btrfs_dev_stats_flags, args.flags, + "BTRFS_DEV_STATS_???"); + printf(", ["); + for (i = 0; i < args.nr_items; i++) { + const char *name = xlookup(btrfs_dev_stats_values, i); + if (i) + printf(", "); + if (name) + printf("/* %s */ ", name); + printf("%" PRI__u64, args.values[i]); + } + printf("]}) = 0\n"); + } +} + +/* + * Consumes argument, returns argument: + * - BTRFS_IOC_DEV_REPLACE + * + * Test environment for this is more difficult; It's better to do it by hand. + */ +static void +btrfs_test_dev_replace_ioctl(void) +{ + struct btrfs_ioctl_dev_replace_args args = { + .cmd = BTRFS_IOCTL_DEV_REPLACE_CMD_START, + }; + args.start.srcdevid = 1; + strcpy((char *)args.start.srcdev_name, "/dev/sda1"); + strcpy((char *)args.start.tgtdev_name, "/dev/sdb1"); + + /* struct btrfs_ioctl_dev_replace_args */ + ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " + "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_START, start={srcdevid=%" + PRI__u64", cont_reading_from_srcdev_mode=%" PRI__u64 + ", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) = -1 EBADF (%m)\n", + args.start.srcdevid, + args.start.cont_reading_from_srcdev_mode, + (char *)args.start.srcdev_name, + (char *)args.start.tgtdev_name); + + args.cmd = 1; + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " + "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS}) = -1 EBADF (%m)\n"); +} + +static void +btrfs_test_extent_same_ioctl(void) +{ +#ifdef BTRFS_IOC_FILE_EXTENT_SAME + struct file_dedupe_range args = { + .src_offset = 1024, + .src_length = 10240, + }; + struct file_dedupe_range *argsp; + + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, NULL); + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_count=%hu, info=[]", + (uint64_t)args.src_offset, + (uint64_t)args.src_length, args.dest_count); + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, &args); + printf("}) = -1 EBADF (%m)\n"); + + argsp = malloc(sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + if (!argsp) + perror_msg_and_fail("malloc failed"); + memset(argsp, 0, sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + + *argsp = args; + argsp->dest_count = 3; + argsp->info[0].dest_fd = 2; + argsp->info[0].dest_offset = 0; + argsp->info[1].dest_fd = 2; + argsp->info[1].dest_offset = 10240; + argsp->info[2].dest_fd = 2; + argsp->info[2].dest_offset = 20480; + + printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 + ", src_length=%" PRIu64 + ", dest_count=%hu, info=", + (int64_t)argsp->src_offset, + (uint64_t)argsp->src_length, argsp->dest_count); + printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 + "}, {dest_fd=%" PRId64 ", dest_offset=%"PRIu64 "}", + (int64_t)argsp->info[0].dest_fd, + (uint64_t)argsp->info[0].dest_offset, + (int64_t)argsp->info[1].dest_fd, + (uint64_t)argsp->info[1].dest_offset); + if (verbose) + printf(", {dest_fd=%" PRId64 ", dest_offset=%" PRIu64 "}", + (int64_t)argsp->info[2].dest_fd, + (uint64_t)argsp->info[2].dest_offset); + else + printf(", ..."); + printf("]"); + ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, argsp); + printf("}) = -1 EBADF (%m)\n"); + + if (write_ok) { + int fd1, fd2; + char buf[16384]; + + memset(buf, 0, sizeof(buf)); + + fd1 = openat(btrfs_test_dir_fd, "file1", O_RDWR|O_CREAT, 0600); + if (fd1 < 0) + perror_msg_and_fail("open file1 failed"); + + fd2 = openat(btrfs_test_dir_fd, "file2", O_RDWR|O_CREAT, 0600); + if (fd2 < 0) + perror_msg_and_fail("open file2 failed"); + + if (write(fd1, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd1"); + if (write(fd1, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd1"); + if (write(fd2, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd2"); + if (write(fd2, buf, sizeof(buf)) < 0) + perror_msg_and_fail("write: fd2"); + + close(fd2); + fd2 = openat(btrfs_test_dir_fd, "file2", O_RDONLY); + if (fd2 < 0) + perror_msg_and_fail("open file2 failed"); + + memset(argsp, 0, sizeof(*argsp) + sizeof(argsp->info[0]) * 3); + + argsp->src_offset = 0; + argsp->src_length = 4096; + argsp->dest_count = 3; + argsp->info[0].dest_fd = fd2; + argsp->info[0].dest_offset = 0; + argsp->info[1].dest_fd = fd2; + argsp->info[1].dest_offset = 10240; + argsp->info[2].dest_fd = fd2; + argsp->info[2].dest_offset = 20480; + + printf("ioctl(%d, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + "{src_offset=%" PRIu64 ", src_length=%" PRIu64 + ", dest_count=%hu, info=", fd1, + (uint64_t)argsp->src_offset, + (uint64_t)argsp->src_length, argsp->dest_count); + printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 + "}, {dest_fd=%" PRId64 ", dest_offset=%"PRIu64 "}", + (int64_t)argsp->info[0].dest_fd, + (uint64_t)argsp->info[0].dest_offset, + (int64_t)argsp->info[1].dest_fd, + (uint64_t)argsp->info[1].dest_offset); + if (verbose) + printf(", {dest_fd=%" PRId64 + ", dest_offset=%" PRIu64 "}", + (int64_t)argsp->info[2].dest_fd, + (uint64_t)argsp->info[2].dest_offset); + else + printf(", ..."); + + ioctl(fd1, BTRFS_IOC_FILE_EXTENT_SAME, argsp); + printf("]} => {info="); + printf("[{bytes_deduped=%" PRIu64 ", status=%d}, " + "{bytes_deduped=%" PRIu64 ", status=%d}", + (uint64_t)argsp->info[0].bytes_deduped, + argsp->info[0].status, + (uint64_t)argsp->info[1].bytes_deduped, + argsp->info[1].status); + if (verbose) + printf(", {bytes_deduped=%" PRIu64 ", status=%d}", + (uint64_t)argsp->info[2].bytes_deduped, + argsp->info[2].status); + else + printf(", ..."); + printf("]}) = 0\n"); + close(fd1); + close(fd2); + unlinkat(btrfs_test_dir_fd, "file1", 0); + unlinkat(btrfs_test_dir_fd, "file2", 0); + close(fd1); + close(fd2); + } + free(argsp); +#endif /* BTRFS_IOC_FILE_EXTENT_SAME */ +} + +static void +btrfs_print_features(struct btrfs_ioctl_feature_flags *flags) +{ + printf("{compat_flags="); + printflags(btrfs_features_compat, flags->compat_flags, + "BTRFS_FEATURE_COMPAT_???"); + + printf(", compat_ro_flags="); + printflags(btrfs_features_compat_ro, flags->compat_ro_flags, + "BTRFS_FEATURE_COMPAT_RO_???"); + + printf(", incompat_flags="); + printflags(btrfs_features_incompat, flags->incompat_flags, + "BTRFS_FEATURE_INCOMPAT_???"); + printf("}"); +} + +/* + * Consumes argument, returns nothing: + * - BTRFS_IOC_SET_FEATURES + * + * Consumes nothing, returns argument: + * - BTRFS_IOC_GET_FEATURES + * - BTRFS_IOC_GET_SUPPORTED_FEATURES + */ +static void +btrfs_test_features_ioctls(void) +{ + struct btrfs_ioctl_feature_flags args[2] = { + { + .compat_flags = max_flags_plus_one(-1), + .incompat_flags = max_flags_plus_one(9), + .compat_ro_flags = max_flags_plus_one(0), + }, { + .compat_flags = max_flags_plus_one(-1), + .incompat_flags = max_flags_plus_one(9), + .compat_ro_flags = max_flags_plus_one(0), + }, + }; + struct btrfs_ioctl_feature_flags supported_features[3]; + + ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL); + printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL) = -1 EBADF (%m)\n"); + + printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, ["); + btrfs_print_features(&args[0]); + printf(", "); + btrfs_print_features(&args[1]); + ioctl(-1, BTRFS_IOC_SET_FEATURES, &args); + printf("]) = -1 EBADF (%m)\n"); + + if (btrfs_test_root) { + printf("ioctl(%d, BTRFS_IOC_GET_FEATURES, ", + btrfs_test_dir_fd); + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FEATURES, + &supported_features); + btrfs_print_features(&supported_features[0]); + printf(") = 0\n"); + + ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_SUPPORTED_FEATURES, + &supported_features); + printf("ioctl(%d, BTRFS_IOC_GET_SUPPORTED_FEATURES, ", + btrfs_test_dir_fd); + printf("[ /* supported */ "); + btrfs_print_features(&supported_features[0]); + printf(", /* safe to set */ "); + btrfs_print_features(&supported_features[1]); + printf(", /* safe to clear */ "); + btrfs_print_features(&supported_features[2]); + printf("]) = 0\n"); + } +} + +static void +btrfs_test_read_ioctls(void) +{ + static const struct xlat btrfs_read_cmd[] = { + XLAT(BTRFS_IOC_BALANCE_PROGRESS), + XLAT(BTRFS_IOC_FS_INFO), + XLAT(BTRFS_IOC_GET_FEATURES), + XLAT(BTRFS_IOC_GET_FSLABEL), + XLAT(BTRFS_IOC_GET_SUPPORTED_FEATURES), + XLAT(BTRFS_IOC_QGROUP_LIMIT), + XLAT(BTRFS_IOC_QUOTA_RESCAN_STATUS), + XLAT(BTRFS_IOC_START_SYNC), + XLAT(BTRFS_IOC_SUBVOL_GETFLAGS), + }; + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(btrfs_read_cmd); ++i) { + ioctl(-1, (unsigned long) btrfs_read_cmd[i].val, 0); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", btrfs_read_cmd[i].str); + } +} + +int +main(int argc, char *argv[]) +{ + + int opt; + int ret; + const char *path; + + while ((opt = getopt(argc, argv, "wv")) != -1) { + switch (opt) { + case 'v': + /* + * These tests are incomplete, especially when + * printing arrays of objects are involved. + */ + verbose = true; + break; + case 'w': + write_ok = true; + break; + default: + error_msg_and_fail("usage: btrfs [-v] [-w] [path]"); + } + } + + /* + * This will enable optional tests that require a valid file descriptor + */ + if (optind < argc) { + int rootfd; + struct statfs sfi; + path = argv[optind]; + + ret = statfs(path, &sfi); + if (ret) + perror_msg_and_fail("statfs(%s) failed", path); + + if ((unsigned) sfi.f_type != BTRFS_SUPER_MAGIC) + error_msg_and_fail("%s is not a btrfs file system", + path); + + btrfs_test_root = path; + rootfd = open(path, O_RDONLY|O_DIRECTORY); + if (rootfd < 0) + perror_msg_and_fail("open(%s) failed", path); + + ret = mkdirat(rootfd, "strace-test", 0755); + if (ret < 0 && errno != EEXIST) + perror_msg_and_fail("mkdirat(strace-test) failed"); + + btrfs_test_dir_fd = openat(rootfd, "strace-test", + O_RDONLY|O_DIRECTORY); + if (btrfs_test_dir_fd < 0) + perror_msg_and_fail("openat(strace-test) failed"); + close(rootfd); + } else + write_ok = false; + + if (btrfs_test_root) { + fprintf(stderr, "Testing live ioctls on %s (%s)\n", + btrfs_test_root, write_ok ? "read/write" : "read only"); + } + + btrfs_test_read_ioctls(); + btrfs_test_trans_ioctls(); + btrfs_test_sync_ioctls(); + btrfs_test_subvol_ioctls(); + btrfs_test_balance_ioctls(); + btrfs_test_device_ioctls(); + btrfs_test_clone_ioctls(); + btrfs_test_defrag_ioctls(); + btrfs_test_search_ioctls(); + btrfs_test_ino_lookup_ioctl(); + btrfs_test_space_info_ioctl(); + btrfs_test_scrub_ioctls(); + btrfs_test_dev_info_ioctl(); + btrfs_test_ino_path_ioctls(); + btrfs_test_set_received_subvol_ioctl(); + btrfs_test_send_ioctl(); + btrfs_test_quota_ctl_ioctl(); + btrfs_test_qgroup_assign_ioctl(); + btrfs_test_qgroup_create_ioctl(); + btrfs_test_quota_rescan_ioctl(); + btrfs_test_label_ioctls(); + btrfs_test_get_dev_stats_ioctl(); + btrfs_test_dev_replace_ioctl(); + btrfs_test_extent_same_ioctl(); + btrfs_test_features_ioctls(); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_BTRFS_H") + +#endif diff --git a/tests/btrfs.test b/tests/btrfs.test new file mode 100755 index 00000000..2121b5b8 --- /dev/null +++ b/tests/btrfs.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic btrfs ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/caps-abbrev.awk b/tests/caps-abbrev.awk new file mode 100644 index 00000000..86de7f23 --- /dev/null +++ b/tests/caps-abbrev.awk @@ -0,0 +1,52 @@ +#!/bin/gawk +# +# This file is part of caps strace test. +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + cap = "(0|1< +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + cap = "(0|1< + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +extern int capget(int *, int *); +extern int capset(int *, const int *); + +int +main(void) +{ + const int data[] = { 2, 4, 0, 8, 16, 0 }; + const int v1 = 0x19980330; + const int v2 = 0x20071026; + const int v3 = 0x20080522; + + int * const head = tail_alloc(sizeof(int) * 2); + head[0] = v3; + head[1] = 0; + int * const tail_data = tail_alloc(sizeof(data)); + + capget(NULL, NULL); + capget(head + 2, tail_data); + capget(head, tail_data + ARRAY_SIZE(data)); + + if (capget(head, tail_data)) + perror_msg_and_skip("capget"); + if (head[0] != v3) + error_msg_and_skip("capget: v3 expected"); + + memcpy(tail_data, data, sizeof(data)); + + capset(NULL, NULL); + capset(head + 2, tail_data); + + head[0] = 0xbadc0ded; + head[1] = 2718281828U; + capset(head, tail_data + ARRAY_SIZE(data) - 2); + + head[0] = v2; + head[1] = 0; + capset(head, tail_data + ARRAY_SIZE(data) - 5); + + memcpy(tail_data, data, sizeof(data)); + head[0] = v3; + if (capset(head, tail_data) == 0 || errno != EPERM) + perror_msg_and_skip("capset"); + + memset(tail_data, 0, sizeof(data) / 2); + if (capset(head, tail_data) == 0 || errno != EPERM) + perror_msg_and_skip("capset"); + + memcpy(tail_data + ARRAY_SIZE(data) / 2, data, sizeof(data) / 2); + head[0] = v1; + if (capset(head, tail_data + ARRAY_SIZE(data) / 2) == 0 || + errno != EPERM) + perror_msg_and_skip("capset"); + + return 0; +} diff --git a/tests/caps.test b/tests/caps.test new file mode 100755 index 00000000..607a75bb --- /dev/null +++ b/tests/caps.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check capget/capset syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a 19 -e trace=capget,capset $args +match_awk + +exit 0 diff --git a/tests/chmod.c b/tests/chmod.c new file mode 100644 index 00000000..f6f98ece --- /dev/null +++ b/tests/chmod.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2016 Anchit Jain + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_chmod + +#include +#include +#include +#include + +int +main(void) +{ + static const char fname[] = "chmod_test_file"; + + if (open(fname, O_CREAT|O_RDONLY, 0400) < 0) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_chmod, fname, 0600); + printf("chmod(\"%s\", 0600) = %s\n", fname, sprintrc(rc)); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_chmod, fname, 051); + printf("chmod(\"%s\", 051) = %s\n", fname, sprintrc(rc)); + + rc = syscall(__NR_chmod, fname, 004); + printf("chmod(\"%s\", 004) = %s\n", fname, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chmod") + +#endif diff --git a/tests/chmod.test b/tests/chmod.test new file mode 100755 index 00000000..70e561a1 --- /dev/null +++ b/tests/chmod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chmod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/chown.c b/tests/chown.c new file mode 100644 index 00000000..12aa8b71 --- /dev/null +++ b/tests/chown.c @@ -0,0 +1,19 @@ +#include "tests.h" +#include + +#ifdef __NR_chown + +# define SYSCALL_NR __NR_chown +# define SYSCALL_NAME "chown" + +# if defined __NR_chown32 && __NR_chown != __NR_chown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_chown") + +#endif diff --git a/tests/chown.test b/tests/chown.test new file mode 100755 index 00000000..eb356ce4 --- /dev/null +++ b/tests/chown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/chown32.c b/tests/chown32.c new file mode 100644 index 00000000..4fffd769 --- /dev/null +++ b/tests/chown32.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_chown32 + +# define SYSCALL_NR __NR_chown32 +# define SYSCALL_NAME "chown32" +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_chown32") + +#endif diff --git a/tests/chown32.test b/tests/chown32.test new file mode 100755 index 00000000..0fa04c20 --- /dev/null +++ b/tests/chown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests/chroot.c b/tests/chroot.c new file mode 100644 index 00000000..a084cf33 --- /dev/null +++ b/tests/chroot.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_chroot + +# include +# include + +int +main(void) +{ + static const char sample[] = "chroot.sample"; + + long rc = syscall(__NR_chroot, sample); + printf("chroot(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chroot") + +#endif diff --git a/tests/chroot.test b/tests/chroot.test new file mode 100755 index 00000000..3b384f5e --- /dev/null +++ b/tests/chroot.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check chroot syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/clock_adjtime.c b/tests/clock_adjtime.c new file mode 100644 index 00000000..01089b54 --- /dev/null +++ b/tests/clock_adjtime.c @@ -0,0 +1,60 @@ +/* + * This file is part of clock_adjtime strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_clock_adjtime + +# include +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_clock_adjtime, CLOCK_MONOTONIC, NULL); + printf("clock_adjtime(CLOCK_MONOTONIC, NULL) = %ld %s (%m)\n", + rc, errno2name()); + + void *efault = tail_alloc(1); + + rc = syscall(__NR_clock_adjtime, CLOCK_REALTIME, efault); + printf("clock_adjtime(CLOCK_REALTIME, %p) = %ld %s (%m)\n", + efault, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_clock_adjtime") + +#endif diff --git a/tests/clock_adjtime.test b/tests/clock_adjtime.test new file mode 100755 index 00000000..df2c0601 --- /dev/null +++ b/tests/clock_adjtime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_adjtime syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests/clock_nanosleep.c b/tests/clock_nanosleep.c new file mode 100644 index 00000000..98407d7e --- /dev/null +++ b/tests/clock_nanosleep.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } req = { + .ts.tv_nsec = 0xc0de1, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, rem = { + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { + .it_interval.tv_usec = 222222, + .it_value.tv_usec = 111111 + }; + + if (syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, NULL)) + perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "NULL) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + NULL, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0, NULL, %p)" + " = -1 EFAULT (%m)\n", &rem.ts); + + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == 0); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "%p) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + req.ts.tv_nsec = 999999999 + 1; + assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_MONOTONIC, 0" + ", {tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" + ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", + (intmax_t) itv.it_interval.tv_sec, + (intmax_t) itv.it_interval.tv_usec, + (intmax_t) itv.it_value.tv_sec, + (intmax_t) itv.it_value.tv_usec); + + --req.ts.tv_nsec; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " + "{tv_sec=%jd, tv_nsec=%jd})" + " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, + (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + assert(syscall(__NR_clock_gettime, CLOCK_REALTIME, &req.ts) == 0); + printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + ++req.ts.tv_sec; + rem.ts.tv_sec = 0xc0de4; + rem.ts.tv_nsec = 0xc0de5; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, TIMER_ABSTIME, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=%jd, " + "tv_nsec=%jd}, %p)" + " = ? ERESTARTNOHAND (To be restarted if no handler)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/clock_nanosleep.test b/tests/clock_nanosleep.test new file mode 100755 index 00000000..ec434a60 --- /dev/null +++ b/tests/clock_nanosleep.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_nanosleep, clock_gettime, and setitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=clock_nanosleep,clock_gettime,setitimer diff --git a/tests/clock_xettime.c b/tests/clock_xettime.c new file mode 100644 index 00000000..3ef5695f --- /dev/null +++ b/tests/clock_xettime.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#if defined __NR_clock_getres \ + && defined __NR_clock_gettime \ + && defined __NR_clock_settime + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } t = { + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_clock_getres, CLOCK_REALTIME, &t.ts)) + perror_msg_and_skip("clock_getres CLOCK_REALTIME"); + printf("clock_getres(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + if (syscall(__NR_clock_gettime, CLOCK_PROCESS_CPUTIME_ID, &t.ts)) + perror_msg_and_skip("clock_gettime CLOCK_PROCESS_CPUTIME_ID"); + printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, " + "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + t.ts.tv_sec = 0xdeface1; + t.ts.tv_nsec = 0xdeface2; + if (!syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts)) + error_msg_and_skip("clock_settime CLOCK_THREAD_CPUTIME_ID:" + " EINVAL expected"); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID, {tv_sec=%jd, " + "tv_nsec=%jd}) = -1 EINVAL (%m)\n", + (intmax_t) t.ts.tv_sec, + (intmax_t) t.ts.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_clock_getres && __NR_clock_gettime && __NR_clock_settime") + +#endif diff --git a/tests/clock_xettime.test b/tests/clock_xettime.test new file mode 100755 index 00000000..f045a66e --- /dev/null +++ b/tests/clock_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check clock_getres, clock_gettime, and clock_settime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests/copy_file_range.c b/tests/copy_file_range.c new file mode 100644 index 00000000..085010af --- /dev/null +++ b/tests/copy_file_range.c @@ -0,0 +1,66 @@ +/* + * This file is part of copy_file_range strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#if defined __NR_copy_file_range + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffff; + const long int fd_out = (long int) 0xdeadbeeffffffffe; + long long int *const off_in = tail_alloc(sizeof(*off_in)); + long long int *const off_out = tail_alloc(sizeof(*off_out)); + *off_in = 0xdeadbef1facefed1; + *off_out = 0xdeadbef2facefed2; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 0; + + long rc = syscall(__NR_copy_file_range, + fd_in, off_in, fd_out, off_out, len, flags); + printf("copy_file_range(%d, [%lld], %d, [%lld], %zu, %u)" + " = %ld %s (%m)\n", + (int) fd_in, *off_in, (int) fd_out, *off_out, len, flags, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_copy_file_range") + +#endif diff --git a/tests/copy_file_range.test b/tests/copy_file_range.test new file mode 100755 index 00000000..c39f6acd --- /dev/null +++ b/tests/copy_file_range.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check copy_file_range syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/count-f.c b/tests/count-f.c new file mode 100644 index 00000000..6992b16b --- /dev/null +++ b/tests/count-f.c @@ -0,0 +1,102 @@ +/* + * This file is part of count-f strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#define N 32 +#define P 8 +#define T 4 + +static void * +thread(void *arg) +{ + unsigned int i; + + assert(chdir(".") == 0); + for (i = 0; i < N; ++i) { + assert(chdir("") == -1); + assert(chdir(".") == 0); + } + + return NULL; +} + +static int +process(void) +{ + unsigned int i; + pthread_t t[T]; + + for (i = 0; i < T; ++i) { + errno = pthread_create(&t[i], NULL, thread, NULL); + if (errno) + perror_msg_and_fail("pthread_create"); + } + + for (i = 0; i < T; ++i) { + void *retval; + errno = pthread_join(t[i], &retval); + if (errno) + perror_msg_and_fail("pthread_join"); + } + + return 0; +} + +int +main(void) +{ + unsigned int i; + pid_t p[P]; + + for (i = 0; i < P; ++i) { + p[i] = fork(); + if (p[i] < 0) + perror_msg_and_fail("fork"); + if (!p[i]) + return process(); + } + for (i = 0; i < P; ++i) { + int s; + + assert(waitpid(p[i], &s, 0) == p[i]); + assert(WIFEXITED(s)); + if (WEXITSTATUS(s)) + return WEXITSTATUS(s); + } + + return 0; +} diff --git a/tests/count-f.expected b/tests/count-f.expected new file mode 100644 index 00000000..f61ba54e --- /dev/null +++ b/tests/count-f.expected @@ -0,0 +1 @@ +[ ]*[^ ]+ +[^ ]+ +[^ ]+ +2080 +1024 +chdir diff --git a/tests/count-f.test b/tests/count-f.test new file mode 100755 index 00000000..67515efa --- /dev/null +++ b/tests/count-f.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check whether -c counts through forks and clones properly + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -q -f -c $args +match_grep + +exit 0 diff --git a/tests/count.test b/tests/count.test index e9eafd91..e75dc6b0 100755 --- a/tests/count.test +++ b/tests/count.test @@ -1,44 +1,56 @@ #!/bin/sh - +# # Check whether -c and -w options work. +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . "${srcdir=.}/init.sh" -check_prog sleep +run_prog ./sleep 0 check_prog grep -make_log() -{ - $STRACE $args > $LOG 2>&1 || { - cat $LOG - fail_ "$STRACE $args failed" - } -} - grep_log() { - LC_ALL=C grep -E -x -e "$*" $LOG > /dev/null || { - cat $LOG - fail_ "unexpected output from $STRACE $args" - } -} + local pattern="$1"; shift -args='-c sleep 1' -make_log -grep nanosleep $LOG > /dev/null || - skip_ 'sleep does not use nanosleep' -grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' + run_strace "$@" ./sleep 1 -args='-c -enanosleep sleep 1' -make_log -grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' + grep nanosleep "$LOG" > /dev/null || + framework_skip_ 'sleep does not use nanosleep' -args='-cw sleep 1' -make_log -grep_log ' *[^ ]+ +(1\.0|0\.99)[^n]*nanosleep' + LC_ALL=C grep -E -x -e "$pattern" "$LOG" > /dev/null || { + echo "Pattern of expected output: $pattern" + echo 'Actual output:' + dump_log_and_fail_with "$STRACE $args output mismatch" + } +} -args='-cw -enanosleep sleep 1' -make_log -grep_log '100\.00 +(1\.0|0\.99)[^n]*nanosleep' +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -enanosleep +grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw +grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -enanosleep exit 0 diff --git a/tests/creat.c b/tests/creat.c new file mode 100644 index 00000000..f22fdaaa --- /dev/null +++ b/tests/creat.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_creat + +# define TEST_SYSCALL_NR __NR_creat +# define TEST_SYSCALL_STR "creat" +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_creat") + +#endif diff --git a/tests/creat.test b/tests/creat.test new file mode 100755 index 00000000..069648f7 --- /dev/null +++ b/tests/creat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check creat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/delete_module.c b/tests/delete_module.c new file mode 100644 index 00000000..5a317603 --- /dev/null +++ b/tests/delete_module.c @@ -0,0 +1,115 @@ +/* + * Check decoding of delete_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_delete_module) + +# include +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + static const struct { + kernel_ulong_t val; + const char *str; + unsigned int val_prefix, val_suffix; + } flags[] = { + { ARG_STR(0), 0, 0 }, + { (kernel_ulong_t) 0xffffffff00000000ULL | O_NONBLOCK, + "O_NONBLOCK", 0, 0 }, + { (kernel_ulong_t) 0xbadc0dedfacef157ULL & ~(O_NONBLOCK | O_TRUNC), + " /* O_??? */", 0xfacef157U & ~(O_NONBLOCK | O_TRUNC), 0}, + { (kernel_ulong_t) (0xfacef157deade71cULL & ~O_NONBLOCK) | O_TRUNC, + "O_TRUNC", 0, 0xdeade71c & ~(O_NONBLOCK | O_TRUNC)}, + { -1LL, "O_NONBLOCK|O_TRUNC", 0, -1U & ~(O_NONBLOCK | O_TRUNC)}, + }; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_delete_module, NULL, bogus_zero); + printf("delete_module(NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_delete_module, bogus_param1, flags[0].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"..., %s) = %s\n", flags[0].str, errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_delete_module, bogus_param1, flags[1].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\", %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_delete_module, bogus_param2 + PARAM2_LEN, + flags[2].val); + printf("delete_module(%p, %#x%s) = %s\n", + bogus_param2 + PARAM2_LEN, flags[2].val_prefix, + flags[2].str, sprintrc(rc)); + + rc = syscall(__NR_delete_module, bogus_param2, flags[3].val); + printf("delete_module(%p, %s|%#x) = %s\n", + bogus_param2, flags[3].str, flags[3].val_suffix, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_delete_module, bogus_param2, flags[4].val); + errstr = sprintrc(rc); + + printf("delete_module(\""); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\", %s|%#x) = %s\n", flags[4].str, flags[4].val_suffix, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_delete_module"); + +#endif diff --git a/tests/delete_module.test b/tests/delete_module.test new file mode 100755 index 00000000..fb86ec9a --- /dev/null +++ b/tests/delete_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of delete_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests/detach-running.test b/tests/detach-running.test index e3b33f9c..006efb85 100755 --- a/tests/detach-running.test +++ b/tests/detach-running.test @@ -1,17 +1,44 @@ #!/bin/sh - +# # Ensure that strace can detach from running processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . "${srcdir=.}/init.sh" +run_prog_skip_if_failed \ + kill -0 $$ + check_prog sleep -check_prog grep set -e ./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & -while ! [ -s $LOG ]; do +while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || fail_ 'set_ptracer_any sh failed' $SLEEP_A_BIT @@ -27,30 +54,35 @@ cleanup() return 0 } -rm -f $LOG -$STRACE -p $tracee_pid 2> $LOG & +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & -while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do - kill -0 $! 2> /dev/null || - { cat $LOG; cleanup; fail_ 'strace -p does not work'; } +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } $SLEEP_A_BIT done kill -INT $! wait $! -grep -F "Process $tracee_pid detached" $LOG > /dev/null || - { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; } +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" + } if [ -f /proc/self/status ]; then $SLEEP_A_BIT - test -d /proc/$tracee_pid || - { cat $LOG; cleanup; fail_ 'tracee died after detach'; } - grep '^State:.*R (running)' < /proc/$tracee_pid/status > /dev/null || { - cat $LOG - grep '^State:' < /proc/$tracee_pid/status + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*R (running)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' cleanup - fail_ 'tracee is not running after detach' + dump_log_and_fail_with 'tracee is not running after detach' } fi diff --git a/tests/detach-sleeping.test b/tests/detach-sleeping.test index 241d5157..54304f31 100755 --- a/tests/detach-sleeping.test +++ b/tests/detach-sleeping.test @@ -1,18 +1,45 @@ #!/bin/sh - +# # Ensure that strace can detach from sleeping processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . "${srcdir=.}/init.sh" +run_prog_skip_if_failed \ + kill -0 $$ + check_prog sleep -check_prog grep set -e -rm -f $LOG -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > $LOG & +rm -f "$LOG" +./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & -while ! [ -s $LOG ]; do +while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || fail_ 'set_ptracer_any sleep failed' $SLEEP_A_BIT @@ -28,30 +55,35 @@ cleanup() return 0 } -rm -f $LOG -$STRACE -p $tracee_pid 2> $LOG & +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & -while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do - kill -0 $! 2> /dev/null || - { cat $LOG; cleanup; fail_ 'strace -p does not work'; } +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } $SLEEP_A_BIT done kill -INT $! wait $! -grep -F "Process $tracee_pid detached" $LOG > /dev/null || - { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; } +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} if [ -f /proc/self/status ]; then $SLEEP_A_BIT - test -d /proc/$tracee_pid || - { cat $LOG; cleanup; fail_ 'tracee died after detach'; } - grep '^State:.*S (sleeping)' < /proc/$tracee_pid/status > /dev/null || { - cat $LOG - grep '^State:' < /proc/$tracee_pid/status + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*S (sleeping)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' cleanup - fail_ 'tracee is not sleeping after detach' + dump_log_and_fail_with 'tracee is not sleeping after detach' } fi diff --git a/tests/detach-stopped.test b/tests/detach-stopped.test index c41bc047..8f480e7f 100755 --- a/tests/detach-stopped.test +++ b/tests/detach-stopped.test @@ -1,23 +1,50 @@ #!/bin/sh - +# # Ensure that strace can detach from stopped processes. +# +# Copyright (c) 2013-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . "${srcdir=.}/init.sh" +run_prog_skip_if_failed \ + kill -0 $$ + check_prog sleep -check_prog grep -$STRACE -d -enone / > /dev/null 2> $LOG -if grep -F -x "PTRACE_SEIZE doesn't work" $LOG > /dev/null; then +$STRACE -d -enone / > /dev/null 2> "$LOG" +if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then skip_ "PTRACE_SEIZE doesn't work" fi set -e -rm -f $LOG -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > $LOG & +rm -f "$LOG" +./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & -while ! [ -s $LOG ]; do +while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || fail_ 'set_ptracer_any sleep failed' $SLEEP_A_BIT @@ -35,36 +62,43 @@ cleanup() return 0 } -rm -f $LOG -$STRACE -p $tracee_pid 2> $LOG & +rm -f "$LOG" +$STRACE -p $tracee_pid 2> "$LOG" & -while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do - kill -0 $! 2> /dev/null || - { cat $LOG; cleanup; fail_ 'strace -p does not work'; } +while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to attach" + } $SLEEP_A_BIT done -while ! grep -F -e '--- stopped by ' $LOG > /dev/null; do - kill -0 $! 2> /dev/null || - { cat $LOG; cleanup; fail_ 'strace -p does not work'; } +while ! grep -F -e '--- stopped by ' "$LOG" > /dev/null; do + kill -0 $! 2> /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p missed stop notifications" + } $SLEEP_A_BIT done kill -INT $! wait $! -grep -F "Process $tracee_pid detached" $LOG > /dev/null || - { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; } +grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} if [ -f /proc/self/status ]; then $SLEEP_A_BIT - test -d /proc/$tracee_pid || - { cat $LOG; cleanup; fail_ 'tracee died after detach'; } - grep '^State:.*T (stopped)' < /proc/$tracee_pid/status > /dev/null || { - cat $LOG - grep '^State:' < /proc/$tracee_pid/status + test -d /proc/$tracee_pid || { + cleanup + dump_log_and_fail_with 'tracee died after detach' + } + grep_pid_status "$tracee_pid" '^State:.*T (stopped)' > /dev/null || { + grep_pid_status "$tracee_pid" '^State:' cleanup - fail_ 'tracee is not group-stopped after detach' + dump_log_and_fail_with 'tracee is not group-stopped after detach' } fi diff --git a/tests/dup.c b/tests/dup.c new file mode 100644 index 00000000..62157e2f --- /dev/null +++ b/tests/dup.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include +#include + +int +main(void) +{ + int rc = dup(-1); + printf("dup(-1) = %d %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/dup.test b/tests/dup.test new file mode 100755 index 00000000..1dc19198 --- /dev/null +++ b/tests/dup.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests/dup2.c b/tests/dup2.c new file mode 100644 index 00000000..9f3addfa --- /dev/null +++ b/tests/dup2.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_dup2 + +# include +# include + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_dup2, fd_old, fd_new); + printf("dup2(%d, %d) = %ld %s (%m)\n", + (int) fd_old, (int) fd_new, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_dup2") + +#endif diff --git a/tests/dup2.test b/tests/dup2.test new file mode 100755 index 00000000..509c5db1 --- /dev/null +++ b/tests/dup2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests/dup3.c b/tests/dup3.c new file mode 100644 index 00000000..252e8469 --- /dev/null +++ b/tests/dup3.c @@ -0,0 +1,28 @@ +#include "tests.h" +#include +#include + +#if defined __NR_dup3 && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_dup3, fd_old, fd_new, O_CLOEXEC); + printf("dup3(%d, %d, O_CLOEXEC) = %ld %s (%m)\n", + (int) fd_old, (int) fd_new, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_dup3 && && O_CLOEXEC") + +#endif diff --git a/tests/dup3.test b/tests/dup3.test new file mode 100755 index 00000000..293f78f9 --- /dev/null +++ b/tests/dup3.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check dup3 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/epoll_create.c b/tests/epoll_create.c new file mode 100644 index 00000000..44262c7d --- /dev/null +++ b/tests/epoll_create.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_create + +# include +# include + +int +main(void) +{ + const long int size = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_epoll_create, size); + printf("epoll_create(%d) = %ld %s (%m)\n", + (int) size, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_creat") + +#endif diff --git a/tests/epoll_create.test b/tests/epoll_create.test new file mode 100755 index 00000000..472a9bdb --- /dev/null +++ b/tests/epoll_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_create syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/epoll_create1.c b/tests/epoll_create1.c new file mode 100644 index 00000000..cd905ecb --- /dev/null +++ b/tests/epoll_create1.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_epoll_create1 && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_epoll_create1, O_CLOEXEC); + printf("epoll_create1(EPOLL_CLOEXEC) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK); + printf("epoll_create1(EPOLL_CLOEXEC|%#x) = %s\n", + O_NONBLOCK, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_create1 && O_CLOEXEC") + +#endif diff --git a/tests/epoll_create1.test b/tests/epoll_create1.test new file mode 100755 index 00000000..7a926a97 --- /dev/null +++ b/tests/epoll_create1.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_create1 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/epoll_ctl.c b/tests/epoll_ctl.c new file mode 100644 index 00000000..e6660555 --- /dev/null +++ b/tests/epoll_ctl.c @@ -0,0 +1,45 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_ctl + +# include +# include +# include +# include + +static long +invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev) +{ + op |= (unsigned long) 0xffffffff00000000ULL; + return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev); +} + +int +main(void) +{ + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + ev->events = EPOLLIN; + + long rc = invoke_syscall(-1U, EPOLL_CTL_ADD, -2U, ev); + printf("epoll_ctl(-1, EPOLL_CTL_ADD, -2, {EPOLLIN," + " {u32=%u, u64=%" PRIu64 "}}) = %ld %s (%m)\n", + ev->data.u32, ev->data.u64, rc, errno2name()); + + rc = invoke_syscall(-3U, EPOLL_CTL_DEL, -4U, ev); + printf("epoll_ctl(-3, EPOLL_CTL_DEL, -4, %p) = %ld %s (%m)\n", + ev, rc, errno2name()); + + rc = invoke_syscall(-1UL, EPOLL_CTL_MOD, -16UL, 0); + printf("epoll_ctl(-1, EPOLL_CTL_MOD, -16, NULL) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_ctl") + +#endif diff --git a/tests/epoll_ctl.test b/tests/epoll_ctl.test new file mode 100755 index 00000000..1aded543 --- /dev/null +++ b/tests/epoll_ctl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_ctl syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/epoll_pwait.c b/tests/epoll_pwait.c new file mode 100644 index 00000000..eaaa34d6 --- /dev/null +++ b/tests/epoll_pwait.c @@ -0,0 +1,30 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_pwait + +# include +# include +# include +# include + +int +main(void) +{ + sigset_t set[2]; + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + + long rc = syscall(__NR_epoll_pwait, -1, ev, 1, -2, + set, (kernel_ulong_t) sizeof(set)); + printf("epoll_pwait(-1, %p, 1, -2, %p, %u) = %ld %s (%m)\n", + ev, set, (unsigned) sizeof(set), rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_pwait") + +#endif diff --git a/tests/epoll_pwait.test b/tests/epoll_pwait.test new file mode 100755 index 00000000..c7aeeace --- /dev/null +++ b/tests/epoll_pwait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of epoll_pwait syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/epoll_wait.c b/tests/epoll_wait.c new file mode 100644 index 00000000..038bf1f7 --- /dev/null +++ b/tests/epoll_wait.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_epoll_wait + +# include +# include +# include + +int +main(void) +{ + struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + + long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2); + printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n", + ev, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_epoll_wait") + +#endif diff --git a/tests/epoll_wait.test b/tests/epoll_wait.test new file mode 100755 index 00000000..83ae161f --- /dev/null +++ b/tests/epoll_wait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check epoll_wait syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 diff --git a/tests/erestartsys.c b/tests/erestartsys.c new file mode 100644 index 00000000..97c9699c --- /dev/null +++ b/tests/erestartsys.c @@ -0,0 +1,81 @@ +/* + * Check decoding of ERESTARTSYS error code. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static int sv[2]; + +static void +handler(int sig) +{ + close(sv[1]); + sv[1] = -1; +} + +int +main(void) +{ + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + const struct sigaction act = { + .sa_handler = handler, + .sa_flags = SA_RESTART + }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct itimerval itv = { .it_value.tv_usec = 123456 }; + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_fail("setitimer"); + + if (recvfrom(sv[0], &sv[1], sizeof(sv[1]), 0, NULL, NULL)) + perror_msg_and_fail("recvfrom"); + + printf("recvfrom(%d, %p, %d, 0, NULL, NULL) = ? ERESTARTSYS" + " (To be restarted if SA_RESTART is set)\n", + sv[0], &sv[1], (int) sizeof(sv[1])); + printf("recvfrom(%d, \"\", %d, 0, NULL, NULL) = 0\n", + sv[0], (int) sizeof(sv[1])); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/erestartsys.test b/tests/erestartsys.test new file mode 100755 index 00000000..91f711f3 --- /dev/null +++ b/tests/erestartsys.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ERESTARTSYS error code. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests/errno2name.c b/tests/errno2name.c new file mode 100644 index 00000000..4a176993 --- /dev/null +++ b/tests/errno2name.c @@ -0,0 +1,481 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#define CASE(x) case x: return #x + +const char * +errno2name(void) +{ + switch (errno) { + /* names taken from linux/errnoent.h */ +#ifdef E2BIG + CASE(E2BIG); +#endif +#ifdef EACCES + CASE(EACCES); +#endif +#ifdef EADDRINUSE + CASE(EADDRINUSE); +#endif +#ifdef EADDRNOTAVAIL + CASE(EADDRNOTAVAIL); +#endif +#ifdef EADV + CASE(EADV); +#endif +#ifdef EAFNOSUPPORT + CASE(EAFNOSUPPORT); +#endif +#ifdef EAGAIN + CASE(EAGAIN); +#endif +#ifdef EALREADY + CASE(EALREADY); +#endif +#ifdef EBADCOOKIE + CASE(EBADCOOKIE); +#endif +#ifdef EBADE + CASE(EBADE); +#endif +#ifdef EBADF + CASE(EBADF); +#endif +#ifdef EBADFD + CASE(EBADFD); +#endif +#ifdef EBADHANDLE + CASE(EBADHANDLE); +#endif +#ifdef EBADMSG + CASE(EBADMSG); +#endif +#ifdef EBADR + CASE(EBADR); +#endif +#ifdef EBADRQC + CASE(EBADRQC); +#endif +#ifdef EBADSLT + CASE(EBADSLT); +#endif +#ifdef EBADTYPE + CASE(EBADTYPE); +#endif +#ifdef EBFONT + CASE(EBFONT); +#endif +#ifdef EBUSY + CASE(EBUSY); +#endif +#ifdef ECANCELED + CASE(ECANCELED); +#endif +#ifdef ECHILD + CASE(ECHILD); +#endif +#ifdef ECHRNG + CASE(ECHRNG); +#endif +#ifdef ECOMM + CASE(ECOMM); +#endif +#ifdef ECONNABORTED + CASE(ECONNABORTED); +#endif +#ifdef ECONNREFUSED + CASE(ECONNREFUSED); +#endif +#ifdef ECONNRESET + CASE(ECONNRESET); +#endif +#ifdef EDEADLK + CASE(EDEADLK); +#endif +#ifdef EDESTADDRREQ + CASE(EDESTADDRREQ); +#endif +#ifdef EDOM + CASE(EDOM); +#endif +#ifdef EDOTDOT + CASE(EDOTDOT); +#endif +#ifdef EDQUOT + CASE(EDQUOT); +#endif +#ifdef EEXIST + CASE(EEXIST); +#endif +#ifdef EFAULT + CASE(EFAULT); +#endif +#ifdef EFBIG + CASE(EFBIG); +#endif +#ifdef EHOSTDOWN + CASE(EHOSTDOWN); +#endif +#ifdef EHOSTUNREACH + CASE(EHOSTUNREACH); +#endif +#ifdef EHWPOISON + CASE(EHWPOISON); +#endif +#ifdef EIDRM + CASE(EIDRM); +#endif +#ifdef EILSEQ + CASE(EILSEQ); +#endif +#ifdef EINPROGRESS + CASE(EINPROGRESS); +#endif +#ifdef EINTR + CASE(EINTR); +#endif +#ifdef EINVAL + CASE(EINVAL); +#endif +#ifdef EIO + CASE(EIO); +#endif +#ifdef EIOCBQUEUED + CASE(EIOCBQUEUED); +#endif +#ifdef EISCONN + CASE(EISCONN); +#endif +#ifdef EISDIR + CASE(EISDIR); +#endif +#ifdef EISNAM + CASE(EISNAM); +#endif +#ifdef EJUKEBOX + CASE(EJUKEBOX); +#endif +#ifdef EKEYEXPIRED + CASE(EKEYEXPIRED); +#endif +#ifdef EKEYREJECTED + CASE(EKEYREJECTED); +#endif +#ifdef EKEYREVOKED + CASE(EKEYREVOKED); +#endif +#ifdef EL2HLT + CASE(EL2HLT); +#endif +#ifdef EL2NSYNC + CASE(EL2NSYNC); +#endif +#ifdef EL3HLT + CASE(EL3HLT); +#endif +#ifdef EL3RST + CASE(EL3RST); +#endif +#ifdef ELIBACC + CASE(ELIBACC); +#endif +#ifdef ELIBBAD + CASE(ELIBBAD); +#endif +#ifdef ELIBEXEC + CASE(ELIBEXEC); +#endif +#ifdef ELIBMAX + CASE(ELIBMAX); +#endif +#ifdef ELIBSCN + CASE(ELIBSCN); +#endif +#ifdef ELNRNG + CASE(ELNRNG); +#endif +#ifdef ELOOP + CASE(ELOOP); +#endif +#ifdef EMEDIUMTYPE + CASE(EMEDIUMTYPE); +#endif +#ifdef EMFILE + CASE(EMFILE); +#endif +#ifdef EMLINK + CASE(EMLINK); +#endif +#ifdef EMSGSIZE + CASE(EMSGSIZE); +#endif +#ifdef EMULTIHOP + CASE(EMULTIHOP); +#endif +#ifdef ENAMETOOLONG + CASE(ENAMETOOLONG); +#endif +#ifdef ENAVAIL + CASE(ENAVAIL); +#endif +#ifdef ENETDOWN + CASE(ENETDOWN); +#endif +#ifdef ENETRESET + CASE(ENETRESET); +#endif +#ifdef ENETUNREACH + CASE(ENETUNREACH); +#endif +#ifdef ENFILE + CASE(ENFILE); +#endif +#ifdef ENOANO + CASE(ENOANO); +#endif +#ifdef ENOBUFS + CASE(ENOBUFS); +#endif +#ifdef ENOCSI + CASE(ENOCSI); +#endif +#ifdef ENODATA + CASE(ENODATA); +#endif +#ifdef ENODEV + CASE(ENODEV); +#endif +#ifdef ENOENT + CASE(ENOENT); +#endif +#ifdef ENOEXEC + CASE(ENOEXEC); +#endif +#ifdef ENOIOCTLCMD + CASE(ENOIOCTLCMD); +#endif +#ifdef ENOKEY + CASE(ENOKEY); +#endif +#ifdef ENOLCK + CASE(ENOLCK); +#endif +#ifdef ENOLINK + CASE(ENOLINK); +#endif +#ifdef ENOMEDIUM + CASE(ENOMEDIUM); +#endif +#ifdef ENOMEM + CASE(ENOMEM); +#endif +#ifdef ENOMSG + CASE(ENOMSG); +#endif +#ifdef ENONET + CASE(ENONET); +#endif +#ifdef ENOPKG + CASE(ENOPKG); +#endif +#ifdef ENOPROTOOPT + CASE(ENOPROTOOPT); +#endif +#ifdef ENOSPC + CASE(ENOSPC); +#endif +#ifdef ENOSR + CASE(ENOSR); +#endif +#ifdef ENOSTR + CASE(ENOSTR); +#endif +#ifdef ENOSYS + CASE(ENOSYS); +#endif +#ifdef ENOTBLK + CASE(ENOTBLK); +#endif +#ifdef ENOTCONN + CASE(ENOTCONN); +#endif +#ifdef ENOTDIR + CASE(ENOTDIR); +#endif +#ifdef ENOTEMPTY + CASE(ENOTEMPTY); +#endif +#ifdef ENOTNAM + CASE(ENOTNAM); +#endif +#ifdef ENOTRECOVERABLE + CASE(ENOTRECOVERABLE); +#endif +#ifdef ENOTSOCK + CASE(ENOTSOCK); +#endif +#ifdef ENOTSUPP + CASE(ENOTSUPP); +#endif +#ifdef ENOTSYNC + CASE(ENOTSYNC); +#endif +#ifdef ENOTTY + CASE(ENOTTY); +#endif +#ifdef ENOTUNIQ + CASE(ENOTUNIQ); +#endif +#ifdef ENXIO + CASE(ENXIO); +#endif +#ifdef EOPENSTALE + CASE(EOPENSTALE); +#endif +#ifdef EOPNOTSUPP + CASE(EOPNOTSUPP); +#endif +#ifdef EOVERFLOW + CASE(EOVERFLOW); +#endif +#ifdef EOWNERDEAD + CASE(EOWNERDEAD); +#endif +#ifdef EPERM + CASE(EPERM); +#endif +#ifdef EPFNOSUPPORT + CASE(EPFNOSUPPORT); +#endif +#ifdef EPIPE + CASE(EPIPE); +#endif +#ifdef EPROBE_DEFER + CASE(EPROBE_DEFER); +#endif +#ifdef EPROTO + CASE(EPROTO); +#endif +#ifdef EPROTONOSUPPORT + CASE(EPROTONOSUPPORT); +#endif +#ifdef EPROTOTYPE + CASE(EPROTOTYPE); +#endif +#ifdef ERANGE + CASE(ERANGE); +#endif +#ifdef EREMCHG + CASE(EREMCHG); +#endif +#ifdef EREMOTE + CASE(EREMOTE); +#endif +#ifdef EREMOTEIO + CASE(EREMOTEIO); +#endif +#ifdef ERESTART + CASE(ERESTART); +#endif +#ifdef ERESTARTNOHAND + CASE(ERESTARTNOHAND); +#endif +#ifdef ERESTARTNOINTR + CASE(ERESTARTNOINTR); +#endif +#ifdef ERESTARTSYS + CASE(ERESTARTSYS); +#endif +#ifdef ERESTART_RESTARTBLOCK + CASE(ERESTART_RESTARTBLOCK); +#endif +#ifdef ERFKILL + CASE(ERFKILL); +#endif +#ifdef EROFS + CASE(EROFS); +#endif +#ifdef ESERVERFAULT + CASE(ESERVERFAULT); +#endif +#ifdef ESHUTDOWN + CASE(ESHUTDOWN); +#endif +#ifdef ESOCKTNOSUPPORT + CASE(ESOCKTNOSUPPORT); +#endif +#ifdef ESPIPE + CASE(ESPIPE); +#endif +#ifdef ESRCH + CASE(ESRCH); +#endif +#ifdef ESRMNT + CASE(ESRMNT); +#endif +#ifdef ESTALE + CASE(ESTALE); +#endif +#ifdef ESTRPIPE + CASE(ESTRPIPE); +#endif +#ifdef ETIME + CASE(ETIME); +#endif +#ifdef ETIMEDOUT + CASE(ETIMEDOUT); +#endif +#ifdef ETOOMANYREFS + CASE(ETOOMANYREFS); +#endif +#ifdef ETOOSMALL + CASE(ETOOSMALL); +#endif +#ifdef ETXTBSY + CASE(ETXTBSY); +#endif +#ifdef EUCLEAN + CASE(EUCLEAN); +#endif +#ifdef EUNATCH + CASE(EUNATCH); +#endif +#ifdef EUSERS + CASE(EUSERS); +#endif +#ifdef EXDEV + CASE(EXDEV); +#endif +#ifdef EXFULL + CASE(EXFULL); +#endif + default: perror_msg_and_fail("unknown errno %d", errno); + } +} diff --git a/tests/error_msg.c b/tests/error_msg.c new file mode 100644 index 00000000..498a8821 --- /dev/null +++ b/tests/error_msg.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +void +perror_msg_and_fail(const char *fmt, ...) +{ + int err_no = errno; + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + if (err_no) + fprintf(stderr, ": %s\n", strerror(err_no)); + else + putc('\n', stderr); + exit(1); +} + +void +error_msg_and_fail(const char *fmt, ...) +{ + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + putc('\n', stderr); + exit(1); +} + +void +error_msg_and_skip(const char *fmt, ...) +{ + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + putc('\n', stderr); + exit(77); +} + +void +perror_msg_and_skip(const char *fmt, ...) +{ + int err_no = errno; + va_list p; + + va_start(p, fmt); + vfprintf(stderr, fmt, p); + if (err_no) + fprintf(stderr, ": %s\n", strerror(err_no)); + else + putc('\n', stderr); + exit(77); +} diff --git a/tests/eventfd.c b/tests/eventfd.c new file mode 100644 index 00000000..d6ad6492 --- /dev/null +++ b/tests/eventfd.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#if defined __NR_eventfd2 && defined O_CLOEXEC + +int +main(void) +{ + (void) close(0); + if (syscall(__NR_eventfd2, -1L, 1 | O_CLOEXEC | O_NONBLOCK)) + perror_msg_and_skip("eventfd2"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_eventfd2 && O_CLOEXEC") + +#endif diff --git a/tests/eventfd.expected b/tests/eventfd.expected new file mode 100644 index 00000000..c4b45a07 --- /dev/null +++ b/tests/eventfd.expected @@ -0,0 +1,2 @@ +eventfd2(4294967295, EFD_SEMAPHORE|EFD_CLOEXEC|EFD_NONBLOCK) = 0 ++++ exited with 0 +++ diff --git a/tests/eventfd.test b/tests/eventfd.test new file mode 100755 index 00000000..e181ed6e --- /dev/null +++ b/tests/eventfd.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check eventfd2 syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e eventfd2 $args +match_diff + +exit 0 diff --git a/tests/execve-v.c b/tests/execve-v.c new file mode 100644 index 00000000..4506c635 --- /dev/null +++ b/tests/execve-v.c @@ -0,0 +1,3 @@ +/* This file is part of execve-v strace test. */ +#define VERBOSE 1 +#include "execve.c" diff --git a/tests/execve-v.test b/tests/execve-v.test new file mode 100755 index 00000000..cce58601 --- /dev/null +++ b/tests/execve-v.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check verbose decoding of execve syscall. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -veexecve $args > "$EXP" + +# Filter out execve() call made by strace. +grep -F test.execve < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/execve.c b/tests/execve.c new file mode 100644 index 00000000..74749e73 --- /dev/null +++ b/tests/execve.c @@ -0,0 +1,171 @@ +/* + * This file is part of execve strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#define FILENAME "test.execve\nfilename" +#define Q_FILENAME "test.execve\\nfilename" + +static const char * const argv[] = { + FILENAME, "first", "second", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_argv[] = { + Q_FILENAME, "first", "second" +}; + +static const char * const envp[] = { + "foobar=1", "foo\nbar=2", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_envp[] = { + "foobar=1", "foo\\nbar=2" +}; + +int +main(void) +{ + char ** const tail_argv = tail_memdup(argv, sizeof(argv)); + char ** const tail_envp = tail_memdup(envp, sizeof(envp)); + + execve(FILENAME, tail_argv, tail_envp); + printf("execve(\"%s\"" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" +#if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ???]" +#else + ", [/* 5 vars, unterminated */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], + argv[3], argv[4], argv[5] +#if VERBOSE + , q_envp[0], q_envp[1], envp[2], envp[3], envp[4] +#endif + ); + + tail_argv[ARRAY_SIZE(q_argv)] = NULL; + tail_envp[ARRAY_SIZE(q_envp)] = NULL; + + execve(FILENAME, tail_argv, tail_envp); + printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" +#if VERBOSE + ", [\"%s\", \"%s\"]" +#else + ", [/* 2 vars */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2] +#if VERBOSE + , q_envp[0], q_envp[1] +#endif + ); + + execve(FILENAME, tail_argv + 2, tail_envp + 1); + printf("execve(\"%s\", [\"%s\"]" +#if VERBOSE + ", [\"%s\"]" +#else + ", [/* 1 var */]" +#endif + ") = -1 ENOENT (%m)\n", + Q_FILENAME, q_argv[2] +#if VERBOSE + , q_envp[1] +#endif + ); + + char **const empty = tail_alloc(sizeof(*empty)); + char **const efault = empty + 1; + *empty = NULL; + + execve(FILENAME, empty, empty); + printf("execve(\"%s\", []" +#if VERBOSE + ", []" +#else + ", [/* 0 vars */]" +#endif + ") = -1 ENOENT (%m)\n", Q_FILENAME); + + char str_a[] = "012345678901234567890123456789012"; + char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; +#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) + char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); + char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); + unsigned int i; + for (i = 0; i <= DEFAULT_STRLEN; ++i) { + a[i] = &str_a[i]; + b[i] = &str_b[i]; + } + a[i] = b[i] = NULL; + + execve(FILENAME, a, b); + printf("execve(\"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); + for (i = 1; i < DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf(", \"%s\"", a[i]); +#else + printf(", ..."); +#endif +#if VERBOSE + printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); + for (i = 1; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %u vars */", DEFAULT_STRLEN + 1); +#endif + printf("]) = -1 ENOENT (%m)\n"); + + execve(FILENAME, a + 1, b + 1); + printf("execve(\"%s\", [\"%s\"", Q_FILENAME, a[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf("], [\"%s\"", b[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %d vars */", DEFAULT_STRLEN); +#endif + printf("]) = -1 ENOENT (%m)\n"); + + execve(FILENAME, (char **) tail_argv[ARRAY_SIZE(q_argv)], efault); + printf("execve(\"%s\", NULL, %p) = -1 ENOENT (%m)\n", + Q_FILENAME, efault); + + execve(FILENAME, efault, NULL); + printf("execve(\"%s\", %p, NULL) = -1 ENOENT (%m)\n", + Q_FILENAME, efault); + + return 0; +} diff --git a/tests/execve.test b/tests/execve.test new file mode 100755 index 00000000..263b6fc5 --- /dev/null +++ b/tests/execve.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check execve syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -eexecve $args > "$EXP" + +# Filter out execve() call made by strace. +grep -F test.execve < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/execveat-v.c b/tests/execveat-v.c new file mode 100644 index 00000000..ff4de2e8 --- /dev/null +++ b/tests/execveat-v.c @@ -0,0 +1,3 @@ +/* This file is part of execveat-v strace test. */ +#define VERBOSE 1 +#include "execveat.c" diff --git a/tests/execveat-v.test b/tests/execveat-v.test new file mode 100755 index 00000000..a9052248 --- /dev/null +++ b/tests/execveat-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of execveat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=execveat diff --git a/tests/execveat.c b/tests/execveat.c new file mode 100644 index 00000000..9083830e --- /dev/null +++ b/tests/execveat.c @@ -0,0 +1,188 @@ +/* + * This file is part of execveat strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_execveat + +# include +# include + +# define FILENAME "test.execveat\nfilename" +# define Q_FILENAME "test.execveat\\nfilename" + +static const char * const argv[] = { + FILENAME, "first", "second", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_argv[] = { + Q_FILENAME, "first", "second" +}; + +static const char * const envp[] = { + "foobar=1", "foo\nbar=2", (const char *) -1L, + (const char *) -2L, (const char *) -3L +}; +static const char * const q_envp[] = { + "foobar=1", "foo\\nbar=2" +}; + +int +main(void) +{ + const char ** const tail_argv = tail_memdup(argv, sizeof(argv)); + const char ** const tail_envp = tail_memdup(envp, sizeof(envp)); + + syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); + printf("execveat(AT_FDCWD, \"%s\"" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" +#if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ???]" +#else + ", [/* 5 vars, unterminated */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], + argv[3], argv[4], argv[5], +#if VERBOSE + q_envp[0], q_envp[1], envp[2], envp[3], envp[4], +#endif + errno2name()); + + tail_argv[ARRAY_SIZE(q_argv)] = NULL; + tail_envp[ARRAY_SIZE(q_envp)] = NULL; + + syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]" +#if VERBOSE + ", [\"%s\", \"%s\"]" +#else + ", [/* 2 vars */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], +#if VERBOSE + q_envp[0], q_envp[1], +#endif + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]" +#if VERBOSE + ", [\"%s\"]" +#else + ", [/* 1 var */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, q_argv[2], +#if VERBOSE + q_envp[1], +#endif + errno2name()); + + char **const empty = tail_alloc(sizeof(*empty)); + char **const efault = empty + 1; + *empty = NULL; + + syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", []" +#if VERBOSE + ", []" +#else + ", [/* 0 vars */]" +#endif + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, errno2name()); + + char str_a[] = "012345678901234567890123456789012"; + char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; +#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) + char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); + char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); + unsigned int i; + for (i = 0; i <= DEFAULT_STRLEN; ++i) { + a[i] = &str_a[i]; + b[i] = &str_b[i]; + } + a[i] = b[i] = NULL; + + syscall(__NR_execveat, -100, FILENAME, a, b, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); + for (i = 1; i < DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf(", \"%s\"", a[i]); +#else + printf(", ..."); +#endif +#if VERBOSE + printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); + for (i = 1; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %u vars */", DEFAULT_STRLEN + 1); +#endif + printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, a + 1, b + 1, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", a[i]); +#if VERBOSE + printf("], [\"%s\"", b[1]); + for (i = 2; i <= DEFAULT_STRLEN; ++i) + printf(", \"%s\"", b[i]); +#else + printf("], [/* %d vars */", DEFAULT_STRLEN); +#endif + printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + errno2name()); + + syscall(__NR_execveat, -100, FILENAME, NULL, efault, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", NULL, %p" + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, efault, errno2name()); + + syscall(__NR_execveat, -100, FILENAME, efault, NULL, 0x1100); + printf("execveat(AT_FDCWD, \"%s\", %p, NULL" + ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + Q_FILENAME, efault, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_execveat") + +#endif diff --git a/tests/execveat.test b/tests/execveat.test new file mode 100755 index 00000000..879e03e2 --- /dev/null +++ b/tests/execveat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check execveat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/faccessat.c b/tests/faccessat.c new file mode 100644 index 00000000..ce81349d --- /dev/null +++ b/tests/faccessat.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_faccessat + +# include +# include + +int +main(void) +{ + static const char sample[] = "faccessat.sample"; + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_faccessat, fd, sample, F_OK); + printf("faccessat(%d, \"%s\", F_OK) = %ld %s (%m)\n", + (int) fd, sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_faccessat") + +#endif diff --git a/tests/faccessat.test b/tests/faccessat.test new file mode 100755 index 00000000..61e7e2fd --- /dev/null +++ b/tests/faccessat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check faccessat syscall decoding. + +. "${srcdir=.}/openat.test" diff --git a/tests/fadvise.h b/tests/fadvise.h new file mode 100644 index 00000000..7a75f73b --- /dev/null +++ b/tests/fadvise.h @@ -0,0 +1,57 @@ +/* + * Common definitions for fadvise64 and fadvise64_64 tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_FADVISE_H +#define STRACE_TESTS_FADVISE_H + +# include +# include +# include + +# include "xlat.h" +# include "xlat/advise.h" + +static void do_fadvise(long fd, long long offset, long long llen, long advice); + +int +main(void) +{ + static const long bogus_fd = (long) 0xfeedf00dbeeffaceULL; + static const long long bogus_offset = 0xbadc0dedda7a1057ULL; + static const long long bogus_len = 0xbadfaceca7b0d1e5ULL; + static const long bogus_advice = (long) 0xf00dfeeddeadca75ULL; + + do_fadvise(bogus_fd, bogus_offset, bogus_len, bogus_advice); + + puts("+++ exited with 0 +++"); + return 0; +} + +#endif /* !STRACE_TESTS_FADVISE_H */ diff --git a/tests/fadvise64.c b/tests/fadvise64.c new file mode 100644 index 00000000..930680be --- /dev/null +++ b/tests/fadvise64.c @@ -0,0 +1,76 @@ +/* + * Check decoding of fadvise64 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_fadvise64 + +# include "fadvise.h" + +static void +do_fadvise(long fd, long long offset, long long llen, long advice) +{ + long ret; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + ret = syscall(__NR_fadvise64, fd, offset, llen, advice); + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %llu, ", (int) fd, offset, llen); +# elif defined LINUX_MIPSO32 + ret = syscall(__NR_fadvise64, fd, 0, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen), advice); + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %lld, ", (int) fd, offset, llen); +# else /* LONG_MAX == INT_MAX && !X32 && !LINUX_MIPSN32 */ + long len = (long) llen; +# if defined POWERPC + ret = syscall(__NR_fadvise64, fd, 0, + LL_VAL_TO_PAIR(offset), len, advice); +# else + ret = syscall(__NR_fadvise64, fd, + LL_VAL_TO_PAIR(offset), len, advice); +# endif + errstr = sprintrc(ret); + printf("fadvise64(%d, %lld, %lu, ", (int) fd, offset, len); +# endif /* LONG_MAX == INT_MAX && !X32 && !LINUX_MIPSN32 */ + printxval(advise, (unsigned) advice, "POSIX_FADV_???"); + printf(") = %s\n", errstr); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fadvise64"); + +#endif diff --git a/tests/fadvise64.test b/tests/fadvise64.test new file mode 100755 index 00000000..9f746720 --- /dev/null +++ b/tests/fadvise64.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of fadvise64 syscall. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e $NAME $args > "$EXP" +check_prog grep +grep -v "^$NAME([0123]," < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/fadvise64_64.c b/tests/fadvise64_64.c new file mode 100644 index 00000000..c23df97f --- /dev/null +++ b/tests/fadvise64_64.c @@ -0,0 +1,74 @@ +/* + * Check decoding of fadvise64_64 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __arm__ +# ifdef __NR_arm_fadvise64_64 +# undef __NR_fadvise64_64 +# define __NR_fadvise64_64 __NR_arm_fadvise64_64 +# endif /* __NR_arm_fadvise64_64 */ +#endif /* __arm__ */ + +#ifdef __NR_fadvise64_64 + +# include "fadvise.h" + +static void +do_fadvise(long fd, long long offset, long long llen, long advice) +{ + long ret; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + ret = syscall(__NR_fadvise64_64, fd, offset, llen, advice); +# elif defined __ARM_EABI__ || defined POWERPC || defined XTENSA + ret = syscall(__NR_fadvise64_64, fd, advice, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen)); +# else + ret = syscall(__NR_fadvise64_64, fd, + LL_VAL_TO_PAIR(offset), LL_VAL_TO_PAIR(llen), advice); +# endif + errstr = sprintrc(ret); + + printf("fadvise64_64(%d, %lld, %lld, ", (int) fd, offset, llen); + printxval(advise, (unsigned) advice, "POSIX_FADV_???"); + printf(") = %s\n", errstr); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fadvise64_64"); + +#endif diff --git a/tests/fadvise64_64.test b/tests/fadvise64_64.test new file mode 100755 index 00000000..a50fe2b9 --- /dev/null +++ b/tests/fadvise64_64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of fadvise64_64 syscall. + +. "${srcdir=.}/fadvise64.test" diff --git a/tests/fallocate.c b/tests/fallocate.c new file mode 100644 index 00000000..a31711b3 --- /dev/null +++ b/tests/fallocate.c @@ -0,0 +1,75 @@ +/* + * Check decoding of fallocate syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_fallocate) && defined(HAVE_FALLOCATE) && HAVE_FALLOCATE + +# include +# include +# include + +# include "xlat.h" +# include "xlat/falloc_flags.h" + +int +main(void) +{ + static const int bogus_fd = 0xbeefface; + static const int bogus_mode = 0xdeadca75; + static const off_t bogus_offset = (off_t) 0xbadc0dedda7a1057LLU; + static const off_t bogus_len = (off_t) 0xbadfaceca7b0d1e5LLU; + + long rc = fallocate(bogus_fd, bogus_mode, bogus_offset, bogus_len); + /* + * Workaround a bug fixed by commit glibc-2.11-346-gde240a0. + */ + if (rc > 0) { + errno = rc; + rc = -1; + } + const char *errstr = sprintrc(rc); + + printf("fallocate(%d, ", bogus_fd); + printflags(falloc_flags, (unsigned) bogus_mode, "FALLOC_FL_???"); + printf(", %lld, %lld) = %s\n", + (long long) bogus_offset, (long long) bogus_len, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fallocate && HAVE_FALLOCATE"); + +#endif diff --git a/tests/fallocate.test b/tests/fallocate.test new file mode 100755 index 00000000..405187e5 --- /dev/null +++ b/tests/fallocate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getcwd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/fanotify_init.c b/tests/fanotify_init.c new file mode 100644 index 00000000..c14b4131 --- /dev/null +++ b/tests/fanotify_init.c @@ -0,0 +1,95 @@ +/* + * Check decoding of fanotify_init syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined __NR_fanotify_init + +# include +# include +# include + +/* Performs fanotify_init call via the syscall interface. */ +static void +do_call(kernel_ulong_t flags, const char *flags_str, + kernel_ulong_t event_f_flags, const char *event_f_flags_str) +{ + long rc; + + rc = syscall(__NR_fanotify_init, flags, event_f_flags); + + printf("fanotify_init(%s, %s) = %s\n", + flags_str, event_f_flags_str, sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + + +int +main(void) +{ + static const struct strval flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "FAN_CLASS_NOTIF" }, + { (kernel_ulong_t) 0xffffffff0000000cULL, + "0xc /* FAN_CLASS_??? */" }, + { (kernel_ulong_t) 0xdec0deddefaced04ULL, + "FAN_CLASS_CONTENT|0xefaced00 /* FAN_??? */" }, + { (kernel_ulong_t) 0xffffffffffffffffULL, + "0xc /* FAN_CLASS_??? */|FAN_CLOEXEC|FAN_NONBLOCK|" + "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|0xffffffc0" }, + }; + static const struct strval event_f_flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { (kernel_ulong_t) 0xdeadbeef80000001ULL, + "O_WRONLY|0x80000000" } + }; + + unsigned int i; + unsigned int j; + + + for (i = 0; i < ARRAY_SIZE(flags); i++) + for (j = 0; j < ARRAY_SIZE(event_f_flags); j++) + do_call(flags[i].val, flags[i].str, + event_f_flags[j].val, event_f_flags[j].str); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fanotify_init") + +#endif diff --git a/tests/fanotify_init.test b/tests/fanotify_init.test new file mode 100755 index 00000000..8d26af42 --- /dev/null +++ b/tests/fanotify_init.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fanotify_init syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/fanotify_mark.c b/tests/fanotify_mark.c new file mode 100644 index 00000000..43f285d3 --- /dev/null +++ b/tests/fanotify_mark.c @@ -0,0 +1,182 @@ +/* + * Check decoding of fanotify_mark syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined HAVE_SYS_FANOTIFY_H && defined HAVE_FANOTIFY_MARK && \ + defined __NR_fanotify_mark + +# include +# include +# include +# include + +/* Performs fanotify_mark call via the syscall interface. */ +static void +do_call(kernel_ulong_t fd, kernel_ulong_t flags, const char *flags_str, + uint64_t mask, const char *mask_str, kernel_ulong_t dirfd, + const char *dirfd_str, kernel_ulong_t path, const char *path_str) +{ + long rc; + + rc = syscall(__NR_fanotify_mark, fd, flags, +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + mask, +# else +/* arch/parisc/kernel/sys_parisc32.c, commit ab8a261b */ +# ifdef HPPA + LL_VAL_TO_PAIR((mask << 32) | (mask >> 32)), +# else + LL_VAL_TO_PAIR(mask), +# endif +# endif + dirfd, path); + + printf("fanotify_mark(%d, %s, %s, %s, %s) = %s\n", + (int) fd, flags_str, mask_str, dirfd_str, path_str, + sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + +struct strval64 { + uint64_t val; + const char *str; +}; + +#define STR16 "0123456789abcdef" +#define STR64 STR16 STR16 STR16 STR16 + +int +main(void) +{ + enum { + PATH1_SIZE = 64, + }; + + static const kernel_ulong_t fds[] = { + (kernel_ulong_t) 0xdeadfeed12345678ULL, + (kernel_ulong_t) 0xffffffff00000000ULL, + (kernel_ulong_t) 0xdeb0d1edffffffffULL, + }; + static const struct strval flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "0" }, + { (kernel_ulong_t) 0xdec0deddefaced00ULL, + "0xefaced00 /* FAN_MARK_??? */" }, + { (kernel_ulong_t) 0xda7a105700000040ULL, + "FAN_MARK_IGNORED_SURV_MODIFY" }, + { (kernel_ulong_t) 0xbadc0deddeadfeedULL, + "FAN_MARK_ADD|FAN_MARK_DONT_FOLLOW|FAN_MARK_ONLYDIR|" + "FAN_MARK_IGNORED_MASK|FAN_MARK_IGNORED_SURV_MODIFY|" + "FAN_MARK_FLUSH|0xdeadfe00" }, + }; + static const struct strval64 masks[] = { + { ARG_ULL_STR(0) }, + { 0xdeadfeedfacebeefULL, + "FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_OPEN|" + "FAN_ACCESS_PERM|FAN_ONDIR|FAN_EVENT_ON_CHILD|" + "0xdeadfeedb2ccbec4" }, + { ARG_ULL_STR(0xffffffffb7fcbfc4) " /* FAN_??? */" }, + }; + static const struct strval dirfds[] = { + { (kernel_ulong_t) 0xfacefeed00000001ULL, "1" }, + { (kernel_ulong_t) 0xdec0ded0ffffffffULL, "FAN_NOFD" }, + { (kernel_ulong_t) 0xbadfacedffffff9cULL, "AT_FDCWD" }, + { (kernel_ulong_t) 0xdefaced1beeff00dULL, "-1091571699" }, + }; + static const char str64[] = STR64; + + static char bogus_path1_addr[sizeof("0x") + sizeof(void *) * 2]; + static char bogus_path1_after_addr[sizeof("0x") + sizeof(void *) * 2]; + + char *bogus_path1 = tail_memdup(str64, PATH1_SIZE); + char *bogus_path2 = tail_memdup(str64, sizeof(str64)); + + struct strval paths[] = { + { (kernel_ulong_t) 0, "NULL" }, + { (kernel_ulong_t) (uintptr_t) (bogus_path1 + PATH1_SIZE), + bogus_path1_after_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path1, bogus_path1_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path2, "\"" STR64 "\"" }, + }; + + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + unsigned int m; + int rc; + + + snprintf(bogus_path1_addr, sizeof(bogus_path1_addr), "%p", bogus_path1); + snprintf(bogus_path1_after_addr, sizeof(bogus_path1_after_addr), "%p", + bogus_path1 + PATH1_SIZE); + + rc = fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY | FAN_ONDIR, + -100, "."); + printf("fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY|FAN_ONDIR" + ", AT_FDCWD, \".\") = %s\n", sprintrc(rc)); + + for (i = 0; i < ARRAY_SIZE(fds); i++) { + for (j = 0; j < ARRAY_SIZE(flags); j++) { + for (k = 0; k < ARRAY_SIZE(masks); k++) { + for (l = 0; l < ARRAY_SIZE(dirfds); l++) { + for (m = 0; m < ARRAY_SIZE(paths); m++) + do_call(fds[i], + flags[j].val, + flags[j].str, + masks[k].val, + masks[k].str, + dirfds[l].val, + dirfds[l].str, + paths[m].val, + paths[m].str); + } + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_FANOTIFY_H && HAVE_FANOTIFY_MARK && " + "__NR_fanotify_mark") + +#endif diff --git a/tests/fanotify_mark.test b/tests/fanotify_mark.test new file mode 100755 index 00000000..fd671387 --- /dev/null +++ b/tests/fanotify_mark.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fanotify_mark syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests/fchdir.c b/tests/fchdir.c new file mode 100644 index 00000000..3cde5e63 --- /dev/null +++ b/tests/fchdir.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_fchdir + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fchdir, fd); + printf("fchdir(%d) = %ld %s (%m)\n", + (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchdir") + +#endif diff --git a/tests/fchdir.test b/tests/fchdir.test new file mode 100755 index 00000000..3a4296ed --- /dev/null +++ b/tests/fchdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests/fchmod.c b/tests/fchmod.c new file mode 100644 index 00000000..932d0830 --- /dev/null +++ b/tests/fchmod.c @@ -0,0 +1,72 @@ +/* + * Check decoding of fchmod syscall. + * + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fchmod + +# include +# include +# include +# include + +int +main(void) +{ + static const char fname[] = "fchmod_test_file"; + + int fd = open(fname, O_CREAT|O_RDONLY, 0400); + if (fd < 0) + perror_msg_and_fail("open"); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + long rc = syscall(__NR_fchmod, fd, 0600); + printf("fchmod(%d, 0600) = %s\n", fd, sprintrc(rc)); + + close(fd); + + rc = syscall(__NR_fchmod, fd, 051); + printf("fchmod(%d, 051) = %s\n", fd, sprintrc(rc)); + + rc = syscall(__NR_fchmod, fd, 004); + printf("fchmod(%d, 004) = %s\n", fd, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchmod") + +#endif diff --git a/tests/fchmod.test b/tests/fchmod.test new file mode 100755 index 00000000..4cb12632 --- /dev/null +++ b/tests/fchmod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchmod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/fchmodat.c b/tests/fchmodat.c new file mode 100644 index 00000000..c52a1cab --- /dev/null +++ b/tests/fchmodat.c @@ -0,0 +1,71 @@ +/* + * Check decoding of fchmodat syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fchmodat + +# include +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "fchmodat_sample"; + + if (open(sample, O_RDONLY | O_CREAT, 0400) < 0) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_fchmodat, -100, sample, 0600); + printf("fchmodat(AT_FDCWD, \"%s\", 0600) = %s\n", + sample, sprintrc(rc)); + + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_fchmodat, -100, sample, 051); + printf("fchmodat(AT_FDCWD, \"%s\", 051) = %s\n", + sample, sprintrc(rc)); + + rc = syscall(__NR_fchmodat, -100, sample, 004); + printf("fchmodat(AT_FDCWD, \"%s\", 004) = %s\n", + sample, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchmodat") + +#endif diff --git a/tests/fchmodat.test b/tests/fchmodat.test new file mode 100755 index 00000000..13cbe806 --- /dev/null +++ b/tests/fchmodat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fchmodat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/fchown.c b/tests/fchown.c new file mode 100644 index 00000000..d7119032 --- /dev/null +++ b/tests/fchown.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_fchown + +# define SYSCALL_NR __NR_fchown +# define SYSCALL_NAME "fchown" +# define ACCESS_BY_DESCRIPTOR + +# if defined __NR_fchown32 && __NR_fchown != __NR_fchown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchown") + +#endif diff --git a/tests/fchown.test b/tests/fchown.test new file mode 100755 index 00000000..63a0f2e3 --- /dev/null +++ b/tests/fchown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests/fchown32.c b/tests/fchown32.c new file mode 100644 index 00000000..2d9d60f8 --- /dev/null +++ b/tests/fchown32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_fchown32 + +# define SYSCALL_NR __NR_fchown32 +# define SYSCALL_NAME "fchown32" +# define ACCESS_BY_DESCRIPTOR +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchown32") + +#endif diff --git a/tests/fchown32.test b/tests/fchown32.test new file mode 100755 index 00000000..e837f54e --- /dev/null +++ b/tests/fchown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fchown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/fchownat.c b/tests/fchownat.c new file mode 100644 index 00000000..f2f37ae3 --- /dev/null +++ b/tests/fchownat.c @@ -0,0 +1,69 @@ +/* + * Check decoding of fchownat syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_fchownat && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW + +# include +# include + +int +main(void) +{ + static const char sample[] = "fchownat_sample"; + uid_t uid = geteuid(); + uid_t gid = getegid(); + + if (open(sample, O_RDONLY | O_CREAT, 0400) == -1) + perror_msg_and_fail("open"); + + long rc = syscall(__NR_fchownat, AT_FDCWD, sample, uid, gid, 0); + printf("fchownat(AT_FDCWD, \"%s\", %d, %d, 0) = %s\n", + sample, uid, gid, sprintrc(rc)); + + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + rc = syscall(__NR_fchownat, AT_FDCWD, + sample, -1, -1L, AT_SYMLINK_NOFOLLOW); + printf("fchownat(AT_FDCWD, \"%s\", -1, -1, AT_SYMLINK_NOFOLLOW) = %s\n", + sample, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fchownat && AT_FDCWD && AT_SYMLINK_NOFOLLOW") + +#endif diff --git a/tests/fchownat.test b/tests/fchownat.test new file mode 100755 index 00000000..e5d0f285 --- /dev/null +++ b/tests/fchownat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of fchownat syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/fcntl.c b/tests/fcntl.c new file mode 100644 index 00000000..f060cdf8 --- /dev/null +++ b/tests/fcntl.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fcntl + +# define TEST_SYSCALL_NR __NR_fcntl +# define TEST_SYSCALL_STR "fcntl" +# include "struct_flock.c" + +# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +static void +test_flock64_einval(const int cmd, const char *name) +{ + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, &fl, EINVAL_STR); +} + +static void +test_flock64(void) +{ +/* + * F_[GS]ETOWN_EX had conflicting values with F_[GS]ETLK64 + * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. + */ +#if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 + TEST_FLOCK64_EINVAL(F_SETLK64); +#endif +/* F_GETLK and F_SETLKW64 have conflicting values on mips64 */ +#if !defined(__mips64) || F_GETLK != F_SETLKW64 + TEST_FLOCK64_EINVAL(F_SETLKW64); +#endif +#if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 + TEST_FLOCK64_EINVAL(F_GETLK64); +#endif +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fcntl") + +#endif diff --git a/tests/fcntl.test b/tests/fcntl.test new file mode 100755 index 00000000..9aea122d --- /dev/null +++ b/tests/fcntl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fcntl decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests/fcntl64.c b/tests/fcntl64.c new file mode 100644 index 00000000..5ecd6eb9 --- /dev/null +++ b/tests/fcntl64.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fcntl64 + +# define TEST_SYSCALL_NR __NR_fcntl64 +# define TEST_SYSCALL_STR "fcntl64" +# include "struct_flock.c" + +# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +static void +test_flock64_einval(const int cmd, const char *name) +{ + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); +} + +static void +test_flock64(void) +{ + TEST_FLOCK64_EINVAL(F_SETLK64); + TEST_FLOCK64_EINVAL(F_SETLKW64); +# ifdef F_OFD_SETLK + TEST_FLOCK64_EINVAL(F_OFD_SETLK); + TEST_FLOCK64_EINVAL(F_OFD_SETLKW); +# endif + + struct_kernel_flock64 fl = { + .l_type = F_RDLCK, + .l_len = FILE_LEN + }; + long rc = invoke_test_syscall(F_SETLK64, &fl); + printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + + if (rc) + return; + + invoke_test_syscall(F_GETLK64, &fl); + printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(F_SETLK64, &fl); + printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fcntl64") + +#endif diff --git a/tests/fcntl64.test b/tests/fcntl64.test new file mode 100755 index 00000000..00ba671a --- /dev/null +++ b/tests/fcntl64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fcntl64 syscall decoding. + +. "${srcdir=.}/fcntl.test" diff --git a/tests/fdatasync.c b/tests/fdatasync.c new file mode 100644 index 00000000..fc82ade3 --- /dev/null +++ b/tests/fdatasync.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_fdatasync + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fdatasync, fd); + printf("fdatasync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fdatasync") + +#endif diff --git a/tests/fdatasync.test b/tests/fdatasync.test new file mode 100755 index 00000000..ff59749f --- /dev/null +++ b/tests/fdatasync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fdatasync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/file_handle.c b/tests/file_handle.c new file mode 100644 index 00000000..a5ad6c73 --- /dev/null +++ b/tests/file_handle.c @@ -0,0 +1,356 @@ +/* + * Check decoding of name_to_handle_at and open_by_handle_at syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_name_to_handle_at && defined __NR_open_by_handle_at + +# include +# include +# include +# include +# include +# include +# include + +enum assert_rc { + ASSERT_NONE, + ASSERT_SUCCESS, + ASSERT_ERROR, +}; + +# ifndef MAX_HANDLE_SZ + +# define MAX_HANDLE_SZ 128 + +struct file_handle { + unsigned int handle_bytes; + int handle_type; + unsigned char f_handle[0]; +}; +# endif /* !MAX_HANDLE_SZ */ + + +void +print_handle_data(unsigned char *bytes, unsigned int size) +{ + unsigned int i; + + if (size > MAX_HANDLE_SZ) + size = MAX_HANDLE_SZ; + + printf("0x"); + for (i = 0; i < size; ++i) + printf("%02x", bytes[i]); +} + +void +do_name_to_handle_at(kernel_ulong_t dirfd, const char *dirfd_str, + kernel_ulong_t pathname, const char *pathname_str, + kernel_ulong_t handle, const char *handle_str, + kernel_ulong_t mount_id, + kernel_ulong_t flags, const char *flags_str, + enum assert_rc assert_rc, long assert_errno) +{ + long rc; + const char *errstr; + + rc = syscall(__NR_name_to_handle_at, dirfd, pathname, handle, mount_id, + flags); + errstr = sprintrc(rc); + + if (assert_rc != ASSERT_NONE) + assert(rc == (assert_rc == ASSERT_SUCCESS ? 0 : -1)); + if (assert_errno) + assert(errno != assert_errno); + + printf("name_to_handle_at(%s, %s, %s", + dirfd_str, pathname_str, handle_str); + + if (rc != -1) { + struct file_handle *fh = + (struct file_handle *) (uintptr_t) handle; + int *mount_id_ptr = (int *) (uintptr_t) mount_id; + + printf(" => %u, handle_type=%d, f_handle=", + fh->handle_bytes, fh->handle_type); + print_handle_data((unsigned char *) fh + + sizeof(struct file_handle), + fh->handle_bytes); + printf("}, [%d]", *mount_id_ptr); + } else { + if (mount_id) + printf(", %#llx", (unsigned long long) mount_id); + else + printf(", NULL"); + } + + printf(", %s) = %s\n", flags_str, errstr); +} + +void +do_open_by_handle_at(kernel_ulong_t mount_fd, + kernel_ulong_t handle, bool valid_handle, bool valid_data, + kernel_ulong_t flags, const char *flags_str) +{ + long rc; + + printf("open_by_handle_at(%d, ", (int) mount_fd); + if (valid_handle) { + struct file_handle *fh = + (struct file_handle *) (uintptr_t) handle; + + printf("{handle_bytes=%u, handle_type=%d", fh->handle_bytes, + fh->handle_type); + + if (valid_data) { + printf(", f_handle="); + print_handle_data((unsigned char *) fh + + sizeof(struct file_handle), + fh->handle_bytes); + } + + printf("}"); + } else { + if (handle) + printf("%#llx", (unsigned long long) handle); + else + printf("NULL"); + } + printf(", %s) = ", flags_str); + + rc = syscall(__NR_open_by_handle_at, mount_fd, handle, flags); + + printf("%s\n", sprintrc(rc)); +} + +struct strval { + kernel_ulong_t val; + const char *str; +}; + +#define STR16 "0123456789abcdef" +#define STR64 STR16 STR16 STR16 STR16 + +int +main(void) +{ + enum { + PATH1_SIZE = 64, + }; + + static const kernel_ulong_t fdcwd = + (kernel_ulong_t) 0x87654321ffffff9cULL; + static const struct strval dirfds[] = { + { (kernel_ulong_t) 0xdeadca57badda7a1ULL, "-1159878751" }, + { (kernel_ulong_t) 0x12345678ffffff9cULL, "AT_FDCWD" }, + }; + static const struct strval name_flags[] = { + { (kernel_ulong_t) 0xdeadf15700000000ULL, "0" }, + { (kernel_ulong_t) 0xbadc0ded00001000ULL, + "AT_EMPTY_PATH" }, + { (kernel_ulong_t) 0xdeadc0deda7a1457ULL, + "AT_SYMLINK_FOLLOW|AT_EMPTY_PATH|0xda7a0057" }, + { (kernel_ulong_t) 0xdefaced1ffffebffULL, + "0xffffebff /* AT_??? */" }, + }; + static const kernel_ulong_t mount_fds[] = { + (kernel_ulong_t) 0xdeadca5701234567ULL, + (kernel_ulong_t) 0x12345678ffffff9cULL, + }; + static const struct strval open_flags[] = { + { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { (kernel_ulong_t) 0xdeadbeef80000001ULL, + "O_WRONLY|0x80000000" } + }; + + static const char str64[] = STR64; + + + char *bogus_path1 = tail_memdup(str64, PATH1_SIZE); + char *bogus_path2 = tail_memdup(str64, sizeof(str64)); + + struct file_handle *handle = + tail_alloc(sizeof(struct file_handle) + MAX_HANDLE_SZ); + struct file_handle *handle_0 = + tail_alloc(sizeof(struct file_handle) + 0); + struct file_handle *handle_8 = + tail_alloc(sizeof(struct file_handle) + 8); + struct file_handle *handle_128 = + tail_alloc(sizeof(struct file_handle) + 128); + struct file_handle *handle_256 = + tail_alloc(sizeof(struct file_handle) + 256); + int *bogus_mount_id = tail_alloc(sizeof(*bogus_mount_id)); + + char handle_0_addr[sizeof("0x") + sizeof(void *) * 2]; + + char bogus_path1_addr[sizeof("0x") + sizeof(void *) * 2]; + char bogus_path1_after_addr[sizeof("0x") + sizeof(void *) * 2]; + + + struct strval paths[] = { + { (kernel_ulong_t) 0, "NULL" }, + { (kernel_ulong_t) (uintptr_t) (bogus_path1 + PATH1_SIZE), + bogus_path1_after_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path1, bogus_path1_addr }, + { (kernel_ulong_t) (uintptr_t) bogus_path2, "\"" STR64 "\"" }, + }; + struct strval name_handles[] = { + { (uintptr_t) (handle_0 + sizeof(struct file_handle)), + handle_0_addr }, + { (uintptr_t) handle_0, "{handle_bytes=256}" }, + { (uintptr_t) handle_8, "{handle_bytes=0}" }, + { (uintptr_t) handle_128, "{handle_bytes=128}" }, + { (uintptr_t) handle_256, "{handle_bytes=256}" }, + }; + struct { + kernel_ulong_t addr; + bool valid; + bool valid_data; + } open_handles[] = { + { 0, false, false }, + { (uintptr_t) (handle_0 + sizeof(struct file_handle)), + false, false }, + { (uintptr_t) handle_0 + 4, false, false }, + { (uintptr_t) handle_0, true, false }, + { (uintptr_t) handle_8, true, true }, + { (uintptr_t) handle_128, true, true }, + { (uintptr_t) handle_256, true, true }, + }; + kernel_ulong_t mount_ids[] = { + 0, + (kernel_ulong_t) (uintptr_t) (bogus_mount_id + 1), + (kernel_ulong_t) (uintptr_t) bogus_mount_id, + }; + + const int flags = 0x400; + int mount_id; + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + unsigned int m; + + + snprintf(bogus_path1_addr, sizeof(bogus_path1_addr), "%p", bogus_path1); + snprintf(bogus_path1_after_addr, sizeof(bogus_path1_after_addr), "%p", + bogus_path1 + PATH1_SIZE); + + handle_0->handle_bytes = 256; + handle_8->handle_bytes = 0; + handle_128->handle_bytes = 128; + handle_256->handle_bytes = 256; + + fill_memory((char *) handle_128 + sizeof(struct file_handle), 128); + fill_memory((char *) handle_256 + sizeof(struct file_handle), 256); + + snprintf(handle_0_addr, sizeof(handle_0_addr), "%p", + handle_0 + sizeof(struct file_handle)); + + handle->handle_bytes = 0; + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags | 1) == -1); + if (EINVAL != errno) + perror_msg_and_skip("name_to_handle_at"); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=0}, %p" + ", AT_SYMLINK_FOLLOW|0x1) = -1 EINVAL (%m)\n", &mount_id); + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags) == -1); + if (EOVERFLOW != errno) + perror_msg_and_skip("name_to_handle_at"); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=0 => %u}" + ", %p, AT_SYMLINK_FOLLOW) = -1 EOVERFLOW (%m)\n", + handle->handle_bytes, &mount_id); + + assert(syscall(__NR_name_to_handle_at, fdcwd, ".", handle, &mount_id, + flags) == 0); + printf("name_to_handle_at(AT_FDCWD, \".\", {handle_bytes=%u" + ", handle_type=%d, f_handle=0x", + handle->handle_bytes, handle->handle_type); + for (i = 0; i < handle->handle_bytes; ++i) + printf("%02x", handle->f_handle[i]); + printf("}, [%d], AT_SYMLINK_FOLLOW) = 0\n", mount_id); + + printf("open_by_handle_at(-1, {handle_bytes=%u, handle_type=%d" + ", f_handle=0x", handle->handle_bytes, handle->handle_type); + for (i = 0; i < handle->handle_bytes; ++i) + printf("%02x", handle->f_handle[i]); + int rc = syscall(__NR_open_by_handle_at, -1, handle, + O_RDONLY | O_DIRECTORY); + printf("}, O_RDONLY|O_DIRECTORY) = %d %s (%m)\n", rc, errno2name()); + + for (i = 0; i < ARRAY_SIZE(dirfds); i++) { + for (j = 0; j < ARRAY_SIZE(paths); j++) { + for (k = 0; k < ARRAY_SIZE(name_handles); k++) { + for (l = 0; l < ARRAY_SIZE(mount_ids); l++) { + for (m = 0; m < ARRAY_SIZE(name_flags); + m++) { + do_name_to_handle_at( + dirfds[i].val, + dirfds[i].str, + paths[j].val, + paths[j].str, + name_handles[k].val, + name_handles[k].str, + mount_ids[l], + name_flags[m].val, + name_flags[m].str, + ASSERT_ERROR, 0); + } + } + } + } + } + + for (i = 0; i < ARRAY_SIZE(mount_fds); i++) { + for (j = 0; j < ARRAY_SIZE(open_handles); j++) { + for (k = 0; k < ARRAY_SIZE(open_flags); k++) { + do_open_by_handle_at(mount_fds[i], + open_handles[j].addr, + open_handles[j].valid, + open_handles[j].valid_data, + open_flags[k].val, + open_flags[k].str); + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_name_to_handle_at && __NR_open_by_handle_at") + +#endif diff --git a/tests/file_handle.test b/tests/file_handle.test new file mode 100755 index 00000000..1ccc9d45 --- /dev/null +++ b/tests/file_handle.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check name_to_handle_at and open_by_handle_at syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests/file_ioctl.c b/tests/file_ioctl.c new file mode 100644 index 00000000..0fe17b15 --- /dev/null +++ b/tests/file_ioctl.c @@ -0,0 +1,45 @@ +#include "tests.h" + +#ifdef HAVE_LINUX_FIEMAP_H + +# include +# include +# include +# include +# include "xlat.h" +# include "xlat/fiemap_flags.h" + +static void +test_fiemap(void) +{ + (void) tail_alloc(1); + struct fiemap *const args = tail_alloc(sizeof(*args)); + + printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64", fm_flags=", + args->fm_start, args->fm_length); + printflags(fiemap_flags, args->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_extent_count=%u})", args->fm_extent_count); + ioctl(-1, FS_IOC_FIEMAP, args); + printf(" = -1 EBADF (%m)\n"); + + /* The live version of this test is in btrfs.c */ +} + +/* clone and dedupe ioctls are in btrfs.c since they originated there */ + +int +main(int argc, char *argv[]) +{ + test_fiemap(); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_FIEMAP_H") + +#endif diff --git a/tests/file_ioctl.test b/tests/file_ioctl.test new file mode 100755 index 00000000..7b8b8ce8 --- /dev/null +++ b/tests/file_ioctl.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check FS_IOC_FIEMAP ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/fill_memory.c b/tests/fill_memory.c new file mode 100644 index 00000000..a0aeccba --- /dev/null +++ b/tests/fill_memory.c @@ -0,0 +1,19 @@ +#include "tests.h" + +void +fill_memory_ex(void *ptr, size_t size, unsigned char start, + unsigned char period) +{ + unsigned char *p = ptr; + size_t i; + + for (i = 0; i < size; i++) { + p[i] = start + i % period; + } +} + +void +fill_memory(void *ptr, size_t size) +{ + fill_memory_ex(ptr, size, 0x80, 0x80); +} diff --git a/tests/filter-unavailable.c b/tests/filter-unavailable.c new file mode 100644 index 00000000..6368b2cb --- /dev/null +++ b/tests/filter-unavailable.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#define P 16 +#define T 7 + +static void * +thread(void *arg) +{ + assert(write(1, "", 1) == 1); + pause(); + return arg; +} + +static int +process(void) +{ + int i; + int fds[2]; + pthread_t t; + struct timespec ts = { .tv_nsec = 10000000 }; + + (void) close(0); + (void) close(1); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + for (i = 0; i < T; ++i) + assert(pthread_create(&t, NULL, thread, NULL) == 0); + for (i = 0; i < T; ++i) + assert(read(0, fds, 1) == 1); + + (void) nanosleep(&ts, 0); + return 0; +} + +int +main(void) +{ + int i, s; + pid_t p; + + for (i = 0; i < P; ++i) { + p = fork(); + if (p < 0) + perror_msg_and_fail("fork"); + if (p == 0) + return process(); + assert(waitpid(p, &s, 0) == p); + assert(WIFEXITED(s)); + if (WEXITSTATUS(s)) + return WEXITSTATUS(s); + } + return 0; +} diff --git a/tests/filter-unavailable.expected b/tests/filter-unavailable.expected new file mode 100644 index 00000000..e69de29b diff --git a/tests/filter-unavailable.test b/tests/filter-unavailable.test new file mode 100755 index 00000000..15a9ad1d --- /dev/null +++ b/tests/filter-unavailable.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# check that syscalls are filtered properly + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -qq -f -echdir -esignal=none $args +match_diff + +exit 0 diff --git a/tests/finit_module.c b/tests/finit_module.c new file mode 100644 index 00000000..3f0178f7 --- /dev/null +++ b/tests/finit_module.c @@ -0,0 +1,118 @@ +/* + * Check decoding of finit_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include "scno.h" + +#if defined(__NR_finit_module) + +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xdeb0d1edbeeff00dULL; + + static const struct { + kernel_ulong_t val; + const char *str; + } flags[] = { + { ARG_STR(0) }, + { (kernel_ulong_t) 0xffffffff00000002ULL, + "MODULE_INIT_IGNORE_VERMAGIC" }, + { (kernel_ulong_t) 0xbadc0deddefaced0ULL, + "0xdefaced0 /* MODULE_INIT_??? */" }, + { (kernel_ulong_t) 0xfacef157dec0ded1ULL, + "MODULE_INIT_IGNORE_MODVERSIONS|0xdec0ded0" }, + { -1LL, "MODULE_INIT_IGNORE_MODVERSIONS|" + "MODULE_INIT_IGNORE_VERMAGIC|0xfffffffc" }, + }; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_finit_module, bogus_zero, NULL, bogus_zero); + printf("finit_module(0, NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[0].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"..., %s) = %s\n", flags[0].str, errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[1].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\", %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2 + PARAM2_LEN, + flags[2].val); + printf("finit_module(%d, %p, %s) = %s\n", + (int) bogus_fd, bogus_param2 + PARAM2_LEN, flags[2].str, + sprintrc(rc)); + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2, flags[3].val); + printf("finit_module(%d, %p, %s) = %s\n", + (int) bogus_fd, bogus_param2, flags[3].str, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_finit_module, bogus_fd, bogus_param2, flags[4].val); + errstr = sprintrc(rc); + + printf("finit_module(%d, \"", (int) bogus_fd); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\", %s) = %s\n", flags[4].str, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_finit_module"); + +#endif diff --git a/tests/finit_module.test b/tests/finit_module.test new file mode 100755 index 00000000..bd644f38 --- /dev/null +++ b/tests/finit_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of finit_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/flock.c b/tests/flock.c new file mode 100644 index 00000000..c154e437 --- /dev/null +++ b/tests/flock.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_flock + +# include +# include +# include + +int +main(void) +{ + const unsigned long fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_flock, fd, LOCK_SH); + printf("flock(%d, LOCK_SH) = %ld %s (%m)\n", + (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_flock") + +#endif diff --git a/tests/flock.test b/tests/flock.test new file mode 100755 index 00000000..24fcd74c --- /dev/null +++ b/tests/flock.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check flock syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/fork-f.c b/tests/fork-f.c new file mode 100644 index 00000000..11ac3d97 --- /dev/null +++ b/tests/fork-f.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static inline int +logit_(const char *const str) +{ + return !chdir(str); +} + +#define prefix "fork-f." +#define logit(arg) logit_(prefix arg) + +int main(int ac, char **av) +{ + if (ac < 1) + return 1; + if (ac > 1) + return logit("exec"); + + logit("start"); + + int child_wait_fds[2]; + (void) close(0); + if (pipe(child_wait_fds)) + perror_msg_and_fail("pipe"); + + pid_t pid = fork(); + + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + close(child_wait_fds[1]); + + if (read(0, child_wait_fds, sizeof(int))) + _exit(2); + + char *const args[] = { av[0], (char *) "", NULL }; + if (logit("child") || execve(args[0], args, args + 1)) + _exit(2); + } + + close(0); + + logit("parent"); + close(child_wait_fds[1]); + + int status; + assert(wait(&status) == pid); + assert(status == 0); + + pid_t ppid = getpid(); + logit("finish"); + + printf("%-5d chdir(\"%sstart\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sparent\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%schild\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sexec\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sfinish\") = -1 ENOENT (%m)\n", + ppid, prefix, + ppid, prefix, + pid, prefix, + pid, prefix, + ppid, prefix); + return 0; +} diff --git a/tests/fork-f.test b/tests/fork-f.test new file mode 100755 index 00000000..d8ca1e3b --- /dev/null +++ b/tests/fork-f.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check how strace -f follows fork syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e trace=chdir -e signal=none diff --git a/tests/fstat.c b/tests/fstat.c new file mode 100644 index 00000000..12df3e19 --- /dev/null +++ b/tests/fstat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstat + +# define TEST_SYSCALL_NR __NR_fstat +# define TEST_SYSCALL_STR "fstat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstat") + +#endif diff --git a/tests/fstat.test b/tests/fstat.test new file mode 100755 index 00000000..2ba0fbaa --- /dev/null +++ b/tests/fstat.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check fstat syscall decoding. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +syscall=$NAME +run_prog > /dev/null +sample=$syscall.sample +> "$sample" +run_strace -ve$syscall -P$sample -a21 $args > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests/fstat64.c b/tests/fstat64.c new file mode 100644 index 00000000..a9c2e072 --- /dev/null +++ b/tests/fstat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstat64 + +# define TEST_SYSCALL_NR __NR_fstat64 +# define TEST_SYSCALL_STR "fstat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstat64") + +#endif diff --git a/tests/fstat64.test b/tests/fstat64.test new file mode 100755 index 00000000..8b4f5ef1 --- /dev/null +++ b/tests/fstat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstat64 syscall decoding. + +. "${srcdir=.}/fstat.test" diff --git a/tests/fstatat.c b/tests/fstatat.c new file mode 100644 index 00000000..66138c25 --- /dev/null +++ b/tests/fstatat.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_FSTATAT + +# define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, AT_FDCWD, sample, pst, AT_SYMLINK_NOFOLLOW) +# define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(AT_FDCWD, \"%s\", ", TEST_SYSCALL_STR, sample) +# define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(", AT_SYMLINK_NOFOLLOW) = %s\n", sprintrc(rc)); \ + } while (0) + +# include "xstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("HAVE_FSTATAT") + +#endif diff --git a/tests/fstatat64.c b/tests/fstatat64.c new file mode 100644 index 00000000..03082a8f --- /dev/null +++ b/tests/fstatat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatat64 + +# define TEST_SYSCALL_NR __NR_fstatat64 +# define TEST_SYSCALL_STR "fstatat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "fstatat.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatat64") + +#endif diff --git a/tests/fstatat64.test b/tests/fstatat64.test new file mode 100755 index 00000000..484008ac --- /dev/null +++ b/tests/fstatat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests/fstatfs.c b/tests/fstatfs.c new file mode 100644 index 00000000..9e68c8d3 --- /dev/null +++ b/tests/fstatfs.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatfs + +# define SYSCALL_ARG_FMT "%d" +# define SYSCALL_ARG(file, desc) (desc) +# define SYSCALL_NR __NR_fstatfs +# define SYSCALL_NAME "fstatfs" +# include "xstatfs.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatfs") + +#endif diff --git a/tests/fstatfs.test b/tests/fstatfs.test new file mode 100755 index 00000000..646e66f2 --- /dev/null +++ b/tests/fstatfs.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatfs syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests/fstatfs64.c b/tests/fstatfs64.c new file mode 100644 index 00000000..afc54aa9 --- /dev/null +++ b/tests/fstatfs64.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_fstatfs64 + +# define SYSCALL_ARG_FMT "%d" +# define SYSCALL_ARG(file, desc) (desc) +# define SYSCALL_NR __NR_fstatfs64 +# define SYSCALL_NAME "fstatfs64" +# include "xstatfs64.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_fstatfs64") + +#endif diff --git a/tests/fstatfs64.test b/tests/fstatfs64.test new file mode 100755 index 00000000..179ff1bf --- /dev/null +++ b/tests/fstatfs64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check fstatfs64 syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests/fstatx.c b/tests/fstatx.c new file mode 100644 index 00000000..f88d9a9c --- /dev/null +++ b/tests/fstatx.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define IS_FSTAT 1 +#define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, 0, pst) +#define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(0, ", TEST_SYSCALL_STR) +#define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +#include "xstatx.c" diff --git a/tests/fsync.c b/tests/fsync.c new file mode 100644 index 00000000..2f504106 --- /dev/null +++ b/tests/fsync.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_fsync + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_fsync, fd); + printf("fsync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_fsync") + +#endif diff --git a/tests/fsync.test b/tests/fsync.test new file mode 100755 index 00000000..a58b67be --- /dev/null +++ b/tests/fsync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check fsync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/ftruncate.c b/tests/ftruncate.c new file mode 100644 index 00000000..ee17455f --- /dev/null +++ b/tests/ftruncate.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ftruncate + +# include +# include + +int +main(void) +{ + const kernel_ulong_t len = (kernel_ulong_t) 0xdefaced0badc0deULL; + long rc; + + if (sizeof(len) > sizeof(long)) + rc = ftruncate(-1, len); + else + rc = syscall(__NR_ftruncate, -1L, len); + + printf("ftruncate(-1, %llu) = %ld %s (%m)\n", + (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ftruncate") + +#endif diff --git a/tests/ftruncate.test b/tests/ftruncate.test new file mode 100755 index 00000000..ec8a1e05 --- /dev/null +++ b/tests/ftruncate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ftruncate syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/ftruncate64.c b/tests/ftruncate64.c new file mode 100644 index 00000000..90d9938f --- /dev/null +++ b/tests/ftruncate64.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ftruncate64 + +# include +# include + +int +main(void) +{ + const off_t len = 0xdefaceddeadbeefULL; + + int rc = ftruncate(-1, len); + printf("ftruncate64(-1, %llu) = %d %s (%m)\n", + (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ftruncate64") + +#endif diff --git a/tests/ftruncate64.test b/tests/ftruncate64.test new file mode 100755 index 00000000..90682102 --- /dev/null +++ b/tests/ftruncate64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ftruncate64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/futex.c b/tests/futex.c new file mode 100644 index 00000000..586b95d5 --- /dev/null +++ b/tests/futex.c @@ -0,0 +1,720 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_futex + +# include +# include +# include +# include +# include +# include + +# include + +# ifndef FUTEX_PRIVATE_FLAG +# define FUTEX_PRIVATE_FLAG 128 +# endif +# ifndef FUTEX_CLOCK_REALTIME +# define FUTEX_CLOCK_REALTIME 256 +# endif +# ifndef FUTEX_CMD_MASK +# define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME) +# endif + +# include "xlat.h" +# include "xlat/futexops.h" +# include "xlat/futexwakeops.h" +# include "xlat/futexwakecmps.h" + +static struct timespec *tmout; + +void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, + int *uaddr2, unsigned long val3, int rc) +{ + perror_msg_and_fail("futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", + uaddr, op, (unsigned) val, timeout, uaddr, (unsigned) val3, rc); +} + +# define CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, \ + enosys) \ + do { \ + rc = syscall(__NR_futex, (uaddr), (op), (val), (timeout), \ + (uaddr2), (val3)); \ + /* It is here due to EPERM on WAKE_OP on AArch64 */ \ + if ((rc == -1) && (errno == EPERM)) \ + break; \ + if (enosys && (rc == -1) && (errno == ENOSYS)) \ + break; \ + if (!(check)) \ + futex_error((uaddr), (op), (val), \ + (unsigned long) (timeout), (int *) (uaddr2), \ + (val3), rc); \ + } while (0) + +# define CHECK_FUTEX_ENOSYS(uaddr, op, val, timeout, uaddr2, val3, check) \ + CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, 1) + +# define CHECK_FUTEX(uaddr, op, val, timeout, uaddr2, val3, check) \ + CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, 0) + +enum argmask { + ARG3 = 1 << 0, + ARG4 = 1 << 1, + ARG5 = 1 << 2, + ARG6 = 1 << 3, +}; + +void invalid_op(int *val, int op, uint32_t argmask, ...) +{ + static const unsigned long args[] = { + (unsigned long) 0xface1e55deadbee1ULL, + (unsigned long) 0xface1e56deadbee2ULL, + (unsigned long) 0xface1e57deadbee3ULL, + (unsigned long) 0xface1e58deadbee4ULL, + }; + /* Since timeout value is copied before full op check, we should provide + * some valid timeout address or NULL */ + int cmd = op & FUTEX_CMD_MASK; + bool valid_timeout = (cmd == FUTEX_WAIT) || (cmd == FUTEX_LOCK_PI) || + (cmd == FUTEX_WAIT_BITSET) || (cmd == FUTEX_WAIT_REQUEUE_PI); + bool timeout_is_val2 = (cmd == FUTEX_REQUEUE) || + (cmd == FUTEX_CMP_REQUEUE) || (cmd == FUTEX_WAKE_OP) || + (cmd == FUTEX_CMP_REQUEUE_PI); + const char *fmt; + int saved_errno; + int rc; + int i; + va_list ap; + + + CHECK_FUTEX(val, op, args[0], valid_timeout ? 0 : args[1], args[2], + args[3], (rc == -1) && (errno == ENOSYS)); + saved_errno = errno; + printf("futex(%p, %#x /* FUTEX_??? */", val, op); + + va_start(ap, argmask); + + for (i = 0; i < 4; i++) { + if (argmask & (1 << i)) { + fmt = va_arg(ap, const char *); + + printf(", "); + + if (((1 << i) == ARG3) || ((1 << i) == ARG6) || + (((1 << i) == ARG4) && timeout_is_val2)) + printf(fmt, (unsigned) args[i]); + else + printf(fmt, args[i]); + } + } + + va_end(ap); + + errno = saved_errno; + printf(") = -1 ENOSYS (%m)\n"); +} + +# define CHECK_INVALID_CLOCKRT(op, ...) \ + do { \ + invalid_op(uaddr, FUTEX_CLOCK_REALTIME | (op), __VA_ARGS__); \ + invalid_op(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | \ + (op), __VA_ARGS__); \ + } while (0) + +/* Value which differs from one stored in int *val */ +# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) +# define VAL_PR ((unsigned) VAL) + +# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) +# define VAL2_PR ((unsigned) VAL2) + +# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) +# define VAL3_PR ((unsigned) VAL3) + +int +main(int argc, char *argv[]) +{ + int *uaddr = tail_alloc(sizeof(*uaddr)); + int *uaddr2 = tail_alloc(sizeof(*uaddr2)); + int rc; + unsigned i; + unsigned j; + + uaddr[0] = 0x1deadead; + uaddr2[0] = 0xbadf00d; + + tmout = tail_alloc(sizeof(*tmout)); + tmout->tv_sec = 123; + tmout->tv_nsec = 0xbadc0de; + + /* FUTEX_WAIT - check whether uaddr == val and sleep + * Possible flags: PRIVATE, CLOCK_RT (since 4.5) + * 1. uaddr - futex address + * 2. op - FUTEX_WAIT + * 3. val - expected value + * 4. timeout - address to timespec with timeout + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* uaddr is NULL */ + CHECK_FUTEX(NULL, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + VAL_PR, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* uaddr is faulty */ + CHECK_FUTEX(uaddr + 1, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr + 1, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* timeout is faulty */ + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout + 1, uaddr2, VAL3, + (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_WAIT, %u, %p) = %s\n", + uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + + /* uaddr is not as provided; uaddr2 is faulty but ignored */ + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* uaddr is not as provided; uaddr2 is faulty but ignored */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, + uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + + /* Next 2 tests are with CLOCKRT bit set */ + + /* Valid after v4.4-rc2-27-g337f130 */ + CHECK_FUTEX_ENOSYS(uaddr, + FUTEX_CLOCK_REALTIME | FUTEX_WAIT, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, + FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT , + VAL, tmout, uaddr2, 0, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* FUTEX_WAIT_BITSET - FUTEX_WAIT which provides additional bitmask + * which should be matched at least in one bit with + * wake mask in order to wake. + * Possible flags: PRIVATE, CLOCKRT + * 1. uaddr - futex address + * 2. op - FUTEX_TRYLOCK_PI + * 3. val - expected value stored in uaddr + * 4. timeout - timeout + * 5. uaddr2 - not used + * 6. val3 - bitmask + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " + "%#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + + /* val3 of 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " + "%#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, 0, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + + /* Next 3 tests are with CLOCKRT bit set */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, + sprintrc(rc)); + + /* val3 of 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, + tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, 0, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | + FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, + sprintrc(rc)); + + /* FUTEX_WAKE - wake val processes waiting for uaddr + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE + * 3. val - how many processes to wake + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* Zero processes to wake is not a good idea, but it should return 0 */ + CHECK_FUTEX(uaddr, FUTEX_WAKE, 0, NULL, NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE, %u) = %s\n", uaddr, 0, sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX(uaddr, FUTEX_WAKE, 10, NULL, NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE, %u) = %s\n", uaddr, 10, sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAKE, 10, NULL, + NULL, 0, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_PRIVATE, %u) = %s\n", uaddr, 10, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE, ARG3, "%u"); + + /* FUTEX_WAKE_BITSET - wake val processes waiting for uaddr which has at + * least one common bit with bitset provided in + * val3. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE + * 3. val - how many processes to wake + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - bitmask + */ + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, + VAL3, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, + VAL3_PR, sprintrc(rc)); + + /* bitset 0 is invalid */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, 0, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, 0, + sprintrc(rc)); + + /* Trying to wake some processes, but there's nothing to wake */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAKE_BITSET, 10, + NULL, NULL, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET_PRIVATE, %u, %#x) = %s\n", uaddr, + 10, VAL3_PR, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE_BITSET, ARG3 | ARG6, "%u", "%#x"); + + /* FUTEX_FD - deprecated + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_FD + * 3. val - signal number + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + /* FUTEX_FD is not implemented since 2.6.26 */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_FD, VAL, NULL, NULL, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_FD, %u) = %s\n", uaddr, VAL_PR, sprintrc(rc)); + + /* FUTEX_FD is not implemented since 2.6.26 */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_FD, VAL, NULL, + NULL, VAL3, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_FD|FUTEX_PRIVATE_FLAG, %u) = %s\n", uaddr, + VAL_PR, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_FD, ARG3, "%u"); + + /* FUTEX_REQUEUE - wake val processes and re-queue rest on uaddr2 + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - another futex address, to re-queue waiting processes on + * 6. val3 - not used + */ + + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3, + (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2, + uaddr2, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u", + "%#lx"); + + /* FUTEX_CMP_REQUEUE - wake val processes and re-queue rest on uaddr2 + * if uaddr has value val3 + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_CMP_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - another futex address, to re-queue waiting processes on + * 6. val3 - expected value stored in uaddr + */ + + /* Comparison re-queue with wrong val value */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + + /* Successful comparison re-queue */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr, + (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + /* Successful comparison re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL, + VAL2, uaddr2, *uaddr, (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", "%u"); + + /* FUTEX_WAKE_OP - wake val processes waiting for uaddr, additionally + * wake val2 processes waiting for uaddr2 in case + * operation encoded in val3 (change of value at uaddr2 + * and comparison of previous value against provided + * constant) succeedes with value at uaddr2. Operation + * result is written to value of uaddr2 (in any case). + * 1. uaddr - futex address + * 2. op - FUTEX_WAKE_OP + * 3. val - how many processes to wake + * 4. val2 - amount of processes to wake in case operation encoded in + * val3 returns true + * 5. uaddr2 - another futex address, for conditional wake of + * additional processes + * 6. val3 - encoded operation: + * 1. bit 31 - if 1 then value stored in field field 4 + * should be interpreted as power of 2. + * 2. 28..30 - arithmetic operation which should be + * applied to previous value stored in + * uaddr2. Values available (from 2005 up to + * 2016): SET. ADD, OR, ANDN, XOR. + * 3. 24..29 - comparison operation which should be + * applied to the old value stored in uaddr2 + * (before arithmetic operation is applied). + * Possible values: EQ, NE, LT, LE, GT, GE. + * 4. 12..23 - Second operand for arithmetic operation. + * If bit 31 is set, it is interpreted as + * power of 2. + * 5. 00..11 - Value against which old value stored in + * uaddr2 is compared. + */ + + static const struct { + uint32_t val; + const char *str; + int err; + const char *errstr; + } wake_ops[] = { + { 0x00000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x00fff000, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" + "0" }, + { 0x00000fff, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|" + "0xfff" }, + { 0x00ffffff, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" + "0xfff" }, + { 0x10000000, "FUTEX_OP_ADD<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x20000000, "FUTEX_OP_OR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x30000000, "FUTEX_OP_ANDN<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x40000000, "FUTEX_OP_XOR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, + { 0x50000000, "0x5<<28 /* FUTEX_OP_??? */|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + { 0x70000000, "0x7<<28 /* FUTEX_OP_??? */|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + { 0x80000000, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_SET<<28|0<<12|" + "FUTEX_OP_CMP_EQ<<24|0" }, + { 0xa0caffee, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_OR<<28|" + "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee" }, + { 0x01000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_NE<<24|0" }, + { 0x01234567, "FUTEX_OP_SET<<28|0x234<<12|FUTEX_OP_CMP_NE<<24|" + "0x567" }, + { 0x02000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_LT<<24|0" }, + { 0x03000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_LE<<24|0" }, + { 0x04000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GT<<24|0" }, + { 0x05000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GE<<24|0" }, + { 0x06000000, "FUTEX_OP_SET<<28|0<<12|" + "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x07000000, "FUTEX_OP_SET<<28|0<<12|" + "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x08000000, "FUTEX_OP_SET<<28|0<<12|" + "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0x0f000000, "FUTEX_OP_SET<<28|0<<12|" + "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + { 0xbadfaced, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_ANDN<<28|" + "0xdfa<<12|0xa<<24 /* FUTEX_OP_CMP_??? */|0xced", + ENOSYS, "ENOSYS" }, + { 0xffffffff, "FUTEX_OP_OPARG_SHIFT<<28|" + "0x7<<28 /* FUTEX_OP_??? */|0xfff<<12|" + "0xf<<24 /* FUTEX_OP_CMP_??? */|0xfff", + ENOSYS, "ENOSYS" }, + }; + + for (i = 0; i < ARRAY_SIZE(wake_ops); i++) { + for (j = 0; j < 2; j++) { + CHECK_FUTEX_ENOSYS(uaddr, + j ? FUTEX_WAKE_OP_PRIVATE : FUTEX_WAKE_OP, + VAL, i, uaddr2, wake_ops[i].val, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s) = " + "%s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, i, + uaddr2, wake_ops[i].str, sprintrc(rc)); + } + } + + CHECK_INVALID_CLOCKRT(FUTEX_WAKE_OP, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", + /* Decoding of the 0xdeadbee4 value */ + "FUTEX_OP_OPARG_SHIFT<<28|0x5<<28 /* FUTEX_OP_??? */|0xadb<<12|" + "0xe<<24 /* FUTEX_OP_CMP_??? */|0xee4"); + + /* FUTEX_LOCK_PI - slow path for mutex lock with process inheritance + * support. Expect that futex has 0 in unlocked case and + * TID of owning process in locked case. Value can also + * contain FUTEX_WAITERS bit signalling the presence of + * waiters queue. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_LOCK_PI + * 3. val - not used + * 4. timeout - timeout + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + *uaddr = getpid(); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_LOCK_PI, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + + /* NULL is passed by invalid_op() in cases valid timeout address is + * needed */ + CHECK_INVALID_CLOCKRT(FUTEX_LOCK_PI, ARG4, "NULL"); + + /* FUTEX_UNLOCK_PI - slow path for mutex unlock with process inheritance + * support. Expected to be called by process in case + * it failed to execute fast path (it usually means + * that FUTEX_WAITERS flag had been set while the lock + * has been held). + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_UNLOCK_PI + * 3. val - not used + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_UNLOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_UNLOCK_PI) = %s\n", uaddr + 1, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_UNLOCK_PI, VAL, + tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr +1, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_UNLOCK_PI, 0); + + /* FUTEX_TRYLOCK_PI - slow path for mutex trylock with process + * inheritance support. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_TRYLOCK_PI + * 3. val - not used + * 4. timeout - not used + * 5. uaddr2 - not used + * 6. val3 - not used + */ + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_TRYLOCK_PI, VAL, tmout, uaddr2 + 1, + VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_TRYLOCK_PI) = %s\n", uaddr + 1, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_TRYLOCK_PI, + VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); + printf("futex(%p, FUTEX_TRYLOCK_PI_PRIVATE) = %s\n", uaddr + 1, + sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_TRYLOCK_PI, 0); + + /* FUTEX_WAIT_REQUEUE_PI - kernel-side handling of special case when + * processes should be re-queued on PI-aware + * futexes. This is so special since PI futexes + * utilize rt_mutex and it should be at no time + * left free with a wait queue, so this should + * be performed atomically in-kernel. + * Possible flags: PRIVATE, CLOCKRT + * 1. uaddr - futex address + * 2. op - FUTEX_WAIT_REQUEUE_PI + * 3. val - expected value stored in uaddr + * 4. timeout - timeout + * 5. uaddr2 - (PI-aware) futex address to requeue process on + * 6. val3 - not used (in kernel, it always initialized to + * FUTEX_BITSET_MATCH_ANY and passed to + * futex_wait_requeue_pi()) + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, + VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", + uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) " + "= %s\n", uaddr, VAL_PR, (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_REQUEUE_PI, + VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u, " + "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | + FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME, " + "%u, {tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, + sprintrc(rc)); + + /* FUTEX_CMP_REQUEUE_PI - version of FUTEX_CMP_REQUEUE which re-queues + * on PI-aware futex. + * Possible flags: PRIVATE + * 1. uaddr - futex address + * 2. op - FUTEX_CMP_REQUEUE + * 3. val - how many processes to wake + * 4. val2 - amount of processes to re-queue on uadr2 + * 5. uaddr2 - (PI-aware) futex address, to re-queue waiting processes + * on + * 6. val3 - expected value stored in uaddr + */ + + /* All these should fail with EINVAL since we try to re-queue to non-PI + * futex. + */ + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CMP_REQUEUE_PI, VAL, VAL2, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CMP_REQUEUE_PI, VAL, VAL2, uaddr2, + *uaddr, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE_PI, + VAL, VAL2, uaddr2, *uaddr, (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PI_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE_PI, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", "%u"); + + /* + * Unknown commands + */ + + CHECK_FUTEX(uaddr, 0xd, VAL, tmout + 1, uaddr2 + 1, VAL3, + (rc == -1) && (errno == ENOSYS)); + printf("futex(%p, 0xd /* FUTEX_??? */, %u, %p, %p, %#x) = %s\n", + uaddr, VAL_PR, tmout + 1, uaddr2 + 1, VAL3_PR, sprintrc(rc)); + + CHECK_FUTEX(uaddr, 0xbefeeded, VAL, tmout + 1, uaddr2, VAL3, + (rc == -1) && (errno == ENOSYS)); + printf("futex(%p, 0xbefeeded /* FUTEX_??? */, %u, %p, %p, %#x) = %s\n", + uaddr, VAL_PR, tmout + 1, uaddr2, VAL3_PR, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_futex") + +#endif diff --git a/tests/futex.test b/tests/futex.test new file mode 100755 index 00000000..fc98267a --- /dev/null +++ b/tests/futex.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check futex syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a27 +run_strace_match_diff -v -a27 diff --git a/tests/futimesat.c b/tests/futimesat.c new file mode 100644 index 00000000..c3566291 --- /dev/null +++ b/tests/futimesat.c @@ -0,0 +1,89 @@ +/* + * Check decoding of futimesat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_futimesat + +# include +# include +# include +# include + + +int +main(void) +{ + struct timeval tv; + if (gettimeofday(&tv, NULL)) + perror_msg_and_fail("gettimeofday"); + + static const char sample[] = "futimesat_sample"; + unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U; + + long rc = syscall(__NR_futimesat, dirfd, sample, 0); + printf("futimesat(AT_FDCWD, \"%s\", NULL) = %ld %s (%m)\n", + sample, rc, errno2name()); + + struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); + dirfd = (unsigned long) 0xdeadbeefffffffffULL; + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_usec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_usec = tv.tv_usec + 1; + + rc = syscall(__NR_futimesat, dirfd, 0, ts + 2); + printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n", + (int) dirfd, ts + 2, rc, errno2name()); + + rc = syscall(__NR_futimesat, dirfd, 0, ts + 1); + printf("futimesat(%d, NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " + "%ld %s (%m)\n", (int) dirfd, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + ts + 2, rc, errno2name()); + + (void) close(0); + rc = syscall(__NR_futimesat, 0, "", ts); + printf("futimesat(0, \"\", [{tv_sec=%jd, tv_usec=%jd}, " + "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", + (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_futimesat") + +#endif diff --git a/tests/futimesat.test b/tests/futimesat.test new file mode 100755 index 00000000..3a67c042 --- /dev/null +++ b/tests/futimesat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check futimesat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/get_mempolicy.c b/tests/get_mempolicy.c new file mode 100644 index 00000000..03d1bffc --- /dev/null +++ b/tests/get_mempolicy.c @@ -0,0 +1,135 @@ +/* + * Check decoding of get_mempolicy syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_get_mempolicy + +# include +# include + +# include "xlat.h" +# include "xlat/policies.h" + +# define MAX_STRLEN 3 +# define NLONGS(n) ((n + 8 * sizeof(long) - 2) \ + / (8 * sizeof(long))) + +static void +print_nodes(unsigned long maxnode) +{ + unsigned long *const nodemask = + tail_alloc(sizeof(*nodemask) * NLONGS(maxnode)); + + if (syscall(__NR_get_mempolicy, 0, nodemask, maxnode, 0, 0)) { + printf("get_mempolicy(NULL, %p, %lu, NULL, 0) = -1 %s (%m)\n", + nodemask, maxnode, errno2name()); + return; + } + + printf("get_mempolicy(NULL, ["); + + unsigned int nlongs = NLONGS(maxnode); + unsigned int i; + for (i = 0; i < nlongs; ++i) { + if (i) + fputs(", ", stdout); + if (i >= MAX_STRLEN) { + fputs("...", stdout); + break; + } + printf("%#0*lx", (int) sizeof(*nodemask) * 2 + 2, nodemask[i]); + } + + printf("], %lu, NULL, 0) = 0\n", maxnode); +} + +int +main(void) +{ + long rc; + + if (syscall(__NR_get_mempolicy, 0, 0, 0, 0, 0)) + perror_msg_and_skip("get_mempolicy"); + puts("get_mempolicy(NULL, NULL, 0, NULL, 0) = 0"); + + int *mode = (void *) 0xdefaced1baddeed2; + unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; + const unsigned long *nodemask = (void *) 0xfacedad3bebefed4ULL; + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long flags = -1U; + rc = syscall(__NR_get_mempolicy, mode, nodemask, maxnode, addr, flags); + printf("get_mempolicy(%p, %p, %lu, %#lx, %s|%#lx) = %ld %s (%m)\n", + mode, nodemask, maxnode, addr, + "MPOL_F_NODE|MPOL_F_ADDR", + flags & ~3, rc, errno2name()); + + mode = tail_alloc(sizeof(*mode)); + + rc = syscall(__NR_get_mempolicy, mode, 0, 0, 0, 0); + printf("get_mempolicy(["); + printxval(policies, (unsigned) *mode, "MPOL_???"); + printf("], NULL, 0, NULL, 0) = %ld\n", rc); + + *mode = -1; + rc = syscall(__NR_get_mempolicy, mode, 0, 0, mode - 1, 2); + printf("get_mempolicy(["); + printxval(policies, (unsigned) *mode, "MPOL_???"); + printf("], NULL, 0, %p, MPOL_F_ADDR) = %ld\n", mode - 1, rc); + + maxnode = get_page_size() * 8; + + print_nodes(maxnode); + print_nodes(maxnode + 1); + print_nodes(maxnode + 2); + + maxnode = sizeof(*nodemask) * 8; + print_nodes(maxnode - 1); + print_nodes(maxnode ); + print_nodes(maxnode + 1); + print_nodes(maxnode + 2); + print_nodes(maxnode * 2 - 1); + print_nodes(maxnode * 2 ); + print_nodes(maxnode * 2 + 1); + print_nodes(maxnode * 2 + 2); + print_nodes(maxnode * 3 - 1); + print_nodes(maxnode * 3 ); + print_nodes(maxnode * 3 + 1); + print_nodes(maxnode * 3 + 2); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_mempolicy") + +#endif diff --git a/tests/get_mempolicy.test b/tests/get_mempolicy.test new file mode 100755 index 00000000..92270970 --- /dev/null +++ b/tests/get_mempolicy.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check get_mempolicy syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a38 diff --git a/tests/get_page_size.c b/tests/get_page_size.c new file mode 100644 index 00000000..aeea861c --- /dev/null +++ b/tests/get_page_size.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include + +size_t +get_page_size(void) +{ + static size_t page_size; + + if (!page_size) + page_size = sysconf(_SC_PAGESIZE); + + return page_size; +} diff --git a/tests/getcpu.c b/tests/getcpu.c new file mode 100644 index 00000000..ec671f1e --- /dev/null +++ b/tests/getcpu.c @@ -0,0 +1,76 @@ +/* + * Check decoding of getcpu syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_getcpu + +# include +# include + +int +main(void) +{ + unsigned *bogus_cpu = + (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + unsigned *bogus_node = + (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + unsigned *bogus_tcache = + (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; + + long res; + unsigned *cpu = tail_alloc(sizeof(*cpu)); + unsigned *node = tail_alloc(sizeof(*node)); + long * tcache = tail_alloc(128); + + res = syscall(__NR_getcpu, NULL, NULL, NULL); + printf("getcpu(NULL, NULL, NULL) = %s\n", sprintrc(res)); + + res = syscall(__NR_getcpu, bogus_cpu, bogus_node, bogus_tcache); + printf("getcpu(%p, %p, %p) = %s\n", + bogus_cpu, bogus_node, bogus_tcache, sprintrc(res)); + + res = syscall(__NR_getcpu, cpu, node, tcache); + if (res != 0) + perror_msg_and_skip("getcpu"); + + printf("getcpu([%u], [%u], %p) = 0\n", *cpu, *node, tcache); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getcpu"); + +#endif diff --git a/tests/getcpu.test b/tests/getcpu.test new file mode 100755 index 00000000..fe212658 --- /dev/null +++ b/tests/getcpu.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getcpu syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/getcwd.c b/tests/getcwd.c new file mode 100644 index 00000000..707c25c9 --- /dev/null +++ b/tests/getcwd.c @@ -0,0 +1,46 @@ +#include "tests.h" + +#include + +#ifdef __NR_getcwd + +# include +# include +# include + +int +main(void) +{ + long res; + char cur_dir[PATH_MAX + 1]; + static const size_t bogus_size = (size_t) 0xbadc0deddeadfaceULL; + + res = syscall(__NR_getcwd, cur_dir, sizeof(cur_dir)); + + if (res <= 0) + perror_msg_and_fail("getcwd"); + + printf("getcwd(\""); + print_quoted_string(cur_dir); + printf("\", %zu) = %ld\n", sizeof(cur_dir), res); + + res = syscall(__NR_getcwd, cur_dir, 0); + printf("getcwd(%p, 0) = %s\n", cur_dir, sprintrc(res)); + + res = syscall(__NR_getcwd, NULL, bogus_size); + printf("getcwd(NULL, %zu) = %s\n", bogus_size, sprintrc(res)); + + res = syscall(__NR_getcwd, (void *) -1L, sizeof(cur_dir)); + printf("getcwd(%p, %zu) = %s\n", + (void *) -1L, sizeof(cur_dir), sprintrc(res)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getcwd"); + +#endif diff --git a/tests/getcwd.test b/tests/getcwd.test new file mode 100755 index 00000000..405187e5 --- /dev/null +++ b/tests/getcwd.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getcwd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/getdents.c b/tests/getdents.c new file mode 100644 index 00000000..b787c837 --- /dev/null +++ b/tests/getdents.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getdents + +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +static char buf[8192]; + +static const char * +str_d_type(const unsigned char d_type) +{ + switch (d_type) { + case DT_DIR: + return "DT_DIR"; + case DT_REG: + return "DT_REG"; + default: + return "DT_UNKNOWN"; + } +} +static void +print_dirent(const kernel_dirent *d) +{ + const unsigned int d_name_offset = offsetof(kernel_dirent, d_name); + int d_name_len = d->d_reclen - d_name_offset - 1; + assert(d_name_len > 0); + + printf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=", + (unsigned long long) d->d_ino, + (unsigned long long) d->d_off, d->d_reclen); + + if (d->d_name[0] == '.') + printf("\"%.*s\"", d_name_len, d->d_name); + else + printf("\"%s\"", qname); + + printf(", d_type=%s}", + str_d_type(*((const char *) d + d->d_reclen - 1))); +} + +int +main(int ac, const char **av) +{ + char *dname; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents, (long) 0xdefacedffffffffULL, NULL, + count); + printf("getdents(-1, NULL, %u) = %ld %s (%m)\n", + (unsigned) count, rc, errno2name()); + + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); + while ((rc = syscall(__NR_getdents, 0, buf, count))) { + kernel_dirent *d; + long i; + + if (rc < 0) + perror_msg_and_skip("getdents"); + printf("getdents(0, ["); + for (i = 0; i < rc; i += d->d_reclen) { + d = (kernel_dirent *) &buf[i]; + if (i) + printf(", "); + print_dirent(d); + } + printf("], %u) = %ld\n", (unsigned) count, rc); + } + printf("getdents(0, [], %u) = 0\n", (unsigned) count); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getdents") + +#endif diff --git a/tests/getdents.test b/tests/getdents.test new file mode 100755 index 00000000..23c4ac3a --- /dev/null +++ b/tests/getdents.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check getdents syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a22 -v diff --git a/tests/getdents64.c b/tests/getdents64.c new file mode 100644 index 00000000..9da2a23c --- /dev/null +++ b/tests/getdents64.c @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getdents64 + +# include +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +typedef struct { + uint64_t d_ino; + uint64_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[256]; +} kernel_dirent64; + +static char buf[8192]; + +static const char * +str_d_type(const unsigned char d_type) +{ + switch (d_type) { + case DT_DIR: + return "DT_DIR"; + case DT_REG: + return "DT_REG"; + default: + return "DT_UNKNOWN"; + } +} +static void +print_dirent(const kernel_dirent64 *d) +{ + const unsigned int d_name_offset = offsetof(kernel_dirent64, d_name); + int d_name_len = d->d_reclen - d_name_offset; + assert(d_name_len > 0); + + printf("{d_ino=%" PRIu64 ", d_off=%" PRId64 + ", d_reclen=%u, d_type=%s, d_name=", + d->d_ino, d->d_off, d->d_reclen, str_d_type(d->d_type)); + + if (d->d_name[0] == '.') + printf("\"%.*s\"}", d_name_len, d->d_name); + else + printf("\"%s\"}", qname); +} + +int +main(int ac, const char **av) +{ + char *dname; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents64, (long) 0xdefacedffffffffULL, NULL, + count); + printf("getdents64(-1, NULL, %u) = %ld %s (%m)\n", + (unsigned) count, rc, errno2name()); + + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); + while ((rc = syscall(__NR_getdents64, 0, buf, count))) { + kernel_dirent64 *d; + long i; + + if (rc < 0) + perror_msg_and_skip("getdents64"); + printf("getdents64(0, ["); + for (i = 0; i < rc; i += d->d_reclen) { + d = (kernel_dirent64 *) &buf[i]; + if (i) + printf(", "); + print_dirent(d); + } + printf("], %u) = %ld\n", (unsigned) count, rc); + } + printf("getdents64(0, [], %u) = 0\n", (unsigned) count); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getdents64") + +#endif diff --git a/tests/getdents64.test b/tests/getdents64.test new file mode 100755 index 00000000..401cfc7c --- /dev/null +++ b/tests/getdents64.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check getdents64 syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a24 -v diff --git a/tests/getegid.c b/tests/getegid.c new file mode 100644 index 00000000..98f8b9cb --- /dev/null +++ b/tests/getegid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getegid + +# include +# include + +int +main(void) +{ + printf("getegid() = %ld\n", syscall(__NR_getegid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getegid") + +#endif diff --git a/tests/getegid.test b/tests/getegid.test new file mode 100755 index 00000000..4354158b --- /dev/null +++ b/tests/getegid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getegid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests/getegid32.c b/tests/getegid32.c new file mode 100644 index 00000000..d9951864 --- /dev/null +++ b/tests/getegid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getegid32 + +# include +# include + +int +main(void) +{ + printf("getegid32() = %ld\n", syscall(__NR_getegid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getegid32") + +#endif diff --git a/tests/getegid32.test b/tests/getegid32.test new file mode 100755 index 00000000..a266620e --- /dev/null +++ b/tests/getegid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getegid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests/geteuid.c b/tests/geteuid.c new file mode 100644 index 00000000..ef8269f9 --- /dev/null +++ b/tests/geteuid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_geteuid + +# include +# include + +int +main(void) +{ + printf("geteuid() = %ld\n", syscall(__NR_geteuid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_geteuid") + +#endif diff --git a/tests/geteuid.test b/tests/geteuid.test new file mode 100755 index 00000000..14ff6a69 --- /dev/null +++ b/tests/geteuid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check geteuid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests/geteuid32.c b/tests/geteuid32.c new file mode 100644 index 00000000..4341e46f --- /dev/null +++ b/tests/geteuid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_geteuid32 + +# include +# include + +int +main(void) +{ + printf("geteuid32() = %ld\n", syscall(__NR_geteuid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_geteuid32") + +#endif diff --git a/tests/geteuid32.test b/tests/geteuid32.test new file mode 100755 index 00000000..9dd173d9 --- /dev/null +++ b/tests/geteuid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check geteuid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests/getgid.c b/tests/getgid.c new file mode 100644 index 00000000..2e060390 --- /dev/null +++ b/tests/getgid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getgid + +# include +# include + +int +main(void) +{ + printf("getgid() = %ld\n", syscall(__NR_getgid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgid") + +#endif diff --git a/tests/getgid.test b/tests/getgid.test new file mode 100755 index 00000000..f4f0c2e6 --- /dev/null +++ b/tests/getgid.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getgid syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests/getgid32.c b/tests/getgid32.c new file mode 100644 index 00000000..52e4d76a --- /dev/null +++ b/tests/getgid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getgid32 + +# include +# include + +int +main(void) +{ + printf("getgid32() = %ld\n", syscall(__NR_getgid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgid32") + +#endif diff --git a/tests/getgid32.test b/tests/getgid32.test new file mode 100755 index 00000000..3bc98d1a --- /dev/null +++ b/tests/getgid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getgid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests/getgroups.c b/tests/getgroups.c new file mode 100644 index 00000000..2617303f --- /dev/null +++ b/tests/getgroups.c @@ -0,0 +1,135 @@ +/* + * Check decoding of getgroups/getgroups32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef __NR_getgroups32 + +# define SYSCALL_NR __NR_getgroups32 +# define SYSCALL_NAME "getgroups32" +# define GID_TYPE unsigned int + +#else + +# include "tests.h" +# include + +# ifdef __NR_getgroups + +# define SYSCALL_NR __NR_getgroups +# define SYSCALL_NAME "getgroups" +# if defined __NR_getgroups32 && __NR_getgroups != __NR_getgroups32 +# define GID_TYPE unsigned short +# else +# define GID_TYPE unsigned int +# endif + +# endif + +#endif + +#ifdef GID_TYPE + +# include +# include + +#define MAX_STRLEN 32 +static long ngroups; + +static void +get_groups(const long size, GID_TYPE *const g) +{ + long i = syscall(SYSCALL_NR, size, g); + if (i != ngroups) + perror_msg_and_fail("%s(%#lx, %p)", SYSCALL_NAME, size, g); + + printf("%s(%d, [", SYSCALL_NAME, (int) size); + for (i = 0; i < ngroups; ++i) { + if (i) + printf(", "); + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + printf("%u", (unsigned int) g[i]); + } + printf("]) = %ld\n", ngroups); +} + +int +main(void) +{ + long rc; + + /* check how the first argument is decoded */ + ngroups = syscall(SYSCALL_NR, 0, 0); + printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, ngroups); + if (ngroups < 0) + perror_msg_and_fail(SYSCALL_NAME); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, rc); + + rc = syscall(SYSCALL_NR, -1U, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1L, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + const unsigned int ngroups_max = sysconf(_SC_NGROUPS_MAX); + + rc = syscall(SYSCALL_NR, ngroups_max, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL | ngroups_max, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); + + /* check how the second argument is decoded */ + GID_TYPE *const g1 = + tail_alloc(ngroups ? sizeof(*g1) * ngroups : 1); + GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * (ngroups + 1)); + void *efault = g2 + ngroups + 1; + + get_groups(ngroups, g1); + get_groups(ngroups + 1, g1); + get_groups(ngroups + 1, g2); + + if (ngroups) { + rc = syscall(SYSCALL_NR, ngroups, efault); + printf("%s(%d, %p) = %s\n", + SYSCALL_NAME, (unsigned) ngroups, efault, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgroups") + +#endif diff --git a/tests/getgroups.test b/tests/getgroups.test new file mode 100755 index 00000000..2eb3056d --- /dev/null +++ b/tests/getgroups.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getgroups syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/getgroups32.c b/tests/getgroups32.c new file mode 100644 index 00000000..d0a356de --- /dev/null +++ b/tests/getgroups32.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include + +#ifdef __NR_getgroups32 + +# include "getgroups.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getgroups32") + +#endif diff --git a/tests/getgroups32.test b/tests/getgroups32.test new file mode 100755 index 00000000..12a8bcc0 --- /dev/null +++ b/tests/getgroups32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getgroups32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/getpeername.c b/tests/getpeername.c new file mode 100644 index 00000000..c842acec --- /dev/null +++ b/tests/getpeername.c @@ -0,0 +1,63 @@ +/* + * Check decoding of getpeername syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME getpeername +#include "sockname.c" + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + int cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0 || cfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + if (listen(lfd, 1)) + perror_msg_and_skip("listen"); + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); + if (accept(lfd, 0, 0) < 0) + perror_msg_and_skip("accept"); + + test_sockname_syscall(cfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/getpeername.test b/tests/getpeername.test new file mode 100755 index 00000000..81f01bb1 --- /dev/null +++ b/tests/getpeername.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of getpeername syscall. + +. "${srcdir=.}/getsockname.test" diff --git a/tests/getpgrp.c b/tests/getpgrp.c new file mode 100644 index 00000000..8b9d0882 --- /dev/null +++ b/tests/getpgrp.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_getpgrp + +# include +# include + +int +main(void) +{ + printf("getpgrp() = %ld\n", syscall(__NR_getpgrp)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpgrp") + +#endif diff --git a/tests/getpgrp.test b/tests/getpgrp.test new file mode 100755 index 00000000..e116bb51 --- /dev/null +++ b/tests/getpgrp.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpgrp syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/getrandom.c b/tests/getrandom.c new file mode 100644 index 00000000..de1a0874 --- /dev/null +++ b/tests/getrandom.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getrandom + +# include +# include + +int +main(void) +{ + unsigned char buf[4]; + + if (syscall(__NR_getrandom, buf, sizeof(buf) - 1, 0) != sizeof(buf) - 1) + perror_msg_and_skip("getrandom"); + printf("getrandom(\"\\x%02x\\x%02x\\x%02x\", 3, 0) = 3\n", + (int) buf[0], (int) buf[1], (int) buf[2]); + + if (syscall(__NR_getrandom, buf, sizeof(buf), 1) != sizeof(buf)) + perror_msg_and_skip("getrandom"); + printf("getrandom(\"\\x%02x\\x%02x\\x%02x\"..., 4, GRND_NONBLOCK) = 4\n", + (int) buf[0], (int) buf[1], (int) buf[2]); + + if (syscall(__NR_getrandom, buf, sizeof(buf), 0x3003) != -1) + perror_msg_and_skip("getrandom"); + printf("getrandom(%p, 4, GRND_NONBLOCK|GRND_RANDOM|0x3000) = " + "-1 EINVAL (%m)\n", buf); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrandom") + +#endif diff --git a/tests/getrandom.test b/tests/getrandom.test new file mode 100755 index 00000000..ad34048f --- /dev/null +++ b/tests/getrandom.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getrandom syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -s3 diff --git a/tests/getresgid.c b/tests/getresgid.c new file mode 100644 index 00000000..b8c687b1 --- /dev/null +++ b/tests/getresgid.c @@ -0,0 +1,21 @@ +#include "tests.h" +#include + +#ifdef __NR_getresgid + +# define SYSCALL_NR __NR_getresgid +# define SYSCALL_NAME "getresgid" + +# if defined __NR_getresgid32 && __NR_getresgid != __NR_getresgid32 +# define UGID_TYPE short +# else +# define UGID_TYPE int +# endif + +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresgid") + +#endif diff --git a/tests/getresgid.test b/tests/getresgid.test new file mode 100755 index 00000000..9f5186e8 --- /dev/null +++ b/tests/getresgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/getresgid32.c b/tests/getresgid32.c new file mode 100644 index 00000000..71f11344 --- /dev/null +++ b/tests/getresgid32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_getresgid32 + +# define SYSCALL_NR __NR_getresgid32 +# define SYSCALL_NAME "getresgid32" +# define UGID_TYPE int +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresgid32") + +#endif diff --git a/tests/getresgid32.test b/tests/getresgid32.test new file mode 100755 index 00000000..a9798911 --- /dev/null +++ b/tests/getresgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getresugid.c b/tests/getresugid.c new file mode 100644 index 00000000..0ee721cf --- /dev/null +++ b/tests/getresugid.c @@ -0,0 +1,58 @@ +/* + * Check decoding of getresuid/getresgid/getresuid32/getresgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +int +main(void) +{ + unsigned UGID_TYPE *const r = tail_alloc(sizeof(*r)); + unsigned UGID_TYPE *const e = tail_alloc(sizeof(*e)); + unsigned UGID_TYPE *const s = tail_alloc(sizeof(*s)); + + if (syscall(SYSCALL_NR, r, e, s)) + perror_msg_and_fail(SYSCALL_NAME); + + printf("%s([%u], [%u], [%u]) = 0\n", SYSCALL_NAME, + (unsigned) *r, (unsigned) *e, (unsigned) *s); + + assert(syscall(SYSCALL_NR, NULL, e, s) == -1); + printf("%s(NULL, %p, %p) = -1 EFAULT (%m)\n", SYSCALL_NAME, e, s); + + assert(syscall(SYSCALL_NR, r, NULL, s) == -1); + printf("%s(%p, NULL, %p) = -1 EFAULT (%m)\n", SYSCALL_NAME, r, s); + + assert(syscall(SYSCALL_NR, r, e, NULL) == -1); + printf("%s(%p, %p, NULL) = -1 EFAULT (%m)\n", SYSCALL_NAME, r, e); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/getresuid.c b/tests/getresuid.c new file mode 100644 index 00000000..b00f20ba --- /dev/null +++ b/tests/getresuid.c @@ -0,0 +1,21 @@ +#include "tests.h" +#include + +#ifdef __NR_getresuid + +# define SYSCALL_NR __NR_getresuid +# define SYSCALL_NAME "getresuid" + +# if defined __NR_getresuid32 && __NR_getresuid != __NR_getresuid32 +# define UGID_TYPE short +# else +# define UGID_TYPE int +# endif + +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresuid") + +#endif diff --git a/tests/getresuid.test b/tests/getresuid.test new file mode 100755 index 00000000..eee1ac05 --- /dev/null +++ b/tests/getresuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/getresuid32.c b/tests/getresuid32.c new file mode 100644 index 00000000..4c9a83df --- /dev/null +++ b/tests/getresuid32.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +#ifdef __NR_getresuid32 + +# define SYSCALL_NR __NR_getresuid32 +# define SYSCALL_NAME "getresuid32" +# define UGID_TYPE int +# include "getresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getresuid32") + +#endif diff --git a/tests/getresuid32.test b/tests/getresuid32.test new file mode 100755 index 00000000..fdc76a31 --- /dev/null +++ b/tests/getresuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getresuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getrlimit.c b/tests/getrlimit.c new file mode 100644 index 00000000..bd9d0b0f --- /dev/null +++ b/tests/getrlimit.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_getrlimit + +# define NR_GETRLIMIT __NR_getrlimit +# define STR_GETRLIMIT "getrlimit" +# include "xgetrlimit.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrlimit") + +#endif diff --git a/tests/getrlimit.test b/tests/getrlimit.test new file mode 100755 index 00000000..6fd88aed --- /dev/null +++ b/tests/getrlimit.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of getrlimit syscall. + +. "${srcdir=.}/setrlimit.test" diff --git a/tests/getrusage.c b/tests/getrusage.c new file mode 100644 index 00000000..8b76eff6 --- /dev/null +++ b/tests/getrusage.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_getrusage + +# include +# include +# include +# include + +int +main(void) +{ + struct rusage *const usage = tail_alloc(sizeof(struct rusage)); + int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage); + printf("getrusage(RUSAGE_SELF, {ru_utime={tv_sec=%jd, tv_usec=%jd}" + ", ru_stime={tv_sec=%jd, tv_usec=%jd}, ru_maxrss=%lu" + ", ru_ixrss=%lu, ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu" + ", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu" + ", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu" + ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n", + (intmax_t) usage->ru_utime.tv_sec, + (intmax_t) usage->ru_utime.tv_usec, + (intmax_t) usage->ru_stime.tv_sec, + (intmax_t) usage->ru_stime.tv_usec, + usage->ru_maxrss, usage->ru_ixrss, usage->ru_idrss, + usage->ru_isrss, usage->ru_minflt, usage->ru_majflt, + usage->ru_nswap, usage->ru_inblock, usage->ru_oublock, + usage->ru_msgsnd, usage->ru_msgrcv, usage->ru_nsignals, + usage->ru_nvcsw, usage->ru_nivcsw, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getrusage") + +#endif diff --git a/tests/getrusage.test b/tests/getrusage.test new file mode 100755 index 00000000..4a3e8ed0 --- /dev/null +++ b/tests/getrusage.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getrusage syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v diff --git a/tests/getsid.c b/tests/getsid.c new file mode 100644 index 00000000..b563de9d --- /dev/null +++ b/tests/getsid.c @@ -0,0 +1,13 @@ +#include "tests.h" +#include +#include + +int +main(void) +{ + pid_t pid = getpid(); + printf("getsid(%d) = %d\n", pid, getsid(pid)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/getsid.test b/tests/getsid.test new file mode 100755 index 00000000..3fcf9799 --- /dev/null +++ b/tests/getsid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getsid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/getsockname.c b/tests/getsockname.c new file mode 100644 index 00000000..66ac4e63 --- /dev/null +++ b/tests/getsockname.c @@ -0,0 +1,56 @@ +/* + * Check decoding of getsockname syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME getsockname +#include "sockname.c" + +int +main(void) +{ + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (lfd < 0) + perror_msg_and_skip("socket"); + + (void) unlink(TEST_SOCKET); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + + test_sockname_syscall(lfd); + + (void) unlink(TEST_SOCKET); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/getsockname.test b/tests/getsockname.test new file mode 100755 index 00000000..99b28506 --- /dev/null +++ b/tests/getsockname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getsockname syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getuid.c b/tests/getuid.c new file mode 100644 index 00000000..57311f72 --- /dev/null +++ b/tests/getuid.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getuid + +# include +# include + +int +main(void) +{ + printf("getuid() = %ld\n", syscall(__NR_getuid)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getuid") + +#endif diff --git a/tests/getuid.test b/tests/getuid.test new file mode 100755 index 00000000..9aaf74ba --- /dev/null +++ b/tests/getuid.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check getuid syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog uniq +run_prog > /dev/null +run_strace -qq -a9 -e$NAME $args > "$EXP" +uniq < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$OUT" "$EXP" diff --git a/tests/getuid32.c b/tests/getuid32.c new file mode 100644 index 00000000..397dd08f --- /dev/null +++ b/tests/getuid32.c @@ -0,0 +1,20 @@ +#include "tests.h" +#include + +#ifdef __NR_getuid32 + +# include +# include + +int +main(void) +{ + printf("getuid32() = %ld\n", syscall(__NR_getuid32)); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getuid32") + +#endif diff --git a/tests/getuid32.test b/tests/getuid32.test new file mode 100755 index 00000000..ae0c557b --- /dev/null +++ b/tests/getuid32.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check getuid32 syscall decoding. + +. "${srcdir=.}/getuid.test" diff --git a/tests/getxxid.c b/tests/getxxid.c new file mode 100644 index 00000000..6eee52c5 --- /dev/null +++ b/tests/getxxid.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_getxpid && defined __NR_getxuid && defined __NR_getxgid + +# include +# include + +int +main(void) +{ + long id; + pid_t ppid; + + id = syscall(__NR_getxpid); + ppid = getppid(); + printf("getxpid() = %ld (ppid %ld)\n", id, (long) ppid); + printf("getxpid() = %ld (ppid %ld)\n", id, (long) ppid); + + id = syscall(__NR_getxuid); + printf("getxuid() = %ld (euid %ld)\n", id, id); + + id = syscall(__NR_getxgid); + printf("getxgid() = %ld (egid %ld)\n", id, id); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getxpid && __NR_getxuid && __NR_getxgid") + +#endif diff --git a/tests/getxxid.test b/tests/getxxid.test new file mode 100755 index 00000000..9b89d7cf --- /dev/null +++ b/tests/getxxid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getxpid, getxuid, and getxgid syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests/hexdump_strdup.c b/tests/hexdump_strdup.c new file mode 100644 index 00000000..4d6b53f4 --- /dev/null +++ b/tests/hexdump_strdup.c @@ -0,0 +1,66 @@ +/* + * Make a hexdump copy of C string + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +const char * +hexdump_memdup(const char *src, size_t len) +{ + size_t dst_size = 3 * len + 2; + assert(dst_size > len); + + char *dst = malloc(dst_size); + if (!dst) + perror_msg_and_fail("malloc(%zu)", dst_size); + + char *p = dst; + const unsigned char *usrc = (const unsigned char *) src; + size_t i; + for (i = 0; i < len; ++i) { + unsigned int c = usrc[i]; + *(p++) = ' '; + if (i == 8) + *(p++) = ' '; + *(p++) = "0123456789abcdef"[c >> 4]; + *(p++) = "0123456789abcdef"[c & 0xf]; + } + *p = '\0'; + + return dst; +} + +const char * +hexdump_strdup(const char *src) +{ + return hexdump_memdup(src, strlen(src)); +} diff --git a/tests/hexquote_strndup.c b/tests/hexquote_strndup.c new file mode 100644 index 00000000..3ad3970c --- /dev/null +++ b/tests/hexquote_strndup.c @@ -0,0 +1,58 @@ +/* + * Make a hexquoted copy of a string + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +const char * +hexquote_strndup(const char *src, const size_t src_len) +{ + const size_t dst_size = 4 * src_len + 1; + assert(dst_size > src_len); + + char *dst = malloc(dst_size); + if (!dst) + perror_msg_and_fail("malloc(%zu)", dst_size); + + char *p = dst; + size_t i; + for (i = 0; i < src_len; ++i) { + unsigned int c = ((const unsigned char *) src)[i]; + *(p++) = '\\'; + *(p++) = 'x'; + *(p++) = "0123456789abcdef"[c >> 4]; + *(p++) = "0123456789abcdef"[c & 0xf]; + } + *p = '\0'; + + return dst; +} diff --git a/tests/inet-cmsg.c b/tests/inet-cmsg.c new file mode 100644 index 00000000..b530016d --- /dev/null +++ b/tests/inet-cmsg.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void +print_pktinfo(const struct cmsghdr *c) +{ + printf("IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex(\"lo\")" + ", ipi_spec_dst=inet_addr(\"127.0.0.1\")" + ", ipi_addr=inet_addr(\"127.0.0.1\")}"); +} + +static void +print_ttl(const struct cmsghdr *c) +{ + const unsigned int *ttl = (const unsigned int *) CMSG_DATA(c); + + printf("IP_TTL, cmsg_data=[%u]", *ttl); +} + +static void +print_tos(const struct cmsghdr *c) +{ + const uint8_t *tos = (const uint8_t *) CMSG_DATA(c); + + printf("IP_TOS, cmsg_data=[%#x]", *tos); +} + +static void +print_opts(const char *name, const struct cmsghdr *c) +{ + const unsigned char *opts = (const unsigned char *) CMSG_DATA(c); + const size_t len = c->cmsg_len - CMSG_ALIGN(sizeof(*c)); + + printf("%s", name); + if (len) { + printf(", cmsg_data=["); + size_t i; + for (i = 0; i < len; ++i) + printf("%s0x%02x", i ? ", " : "", opts[i]); + printf("]"); + } +} + +#ifdef IP_ORIGDSTADDR +static void +print_origdstaddr(const struct cmsghdr *c) +{ + const struct sockaddr_in *sin = + (const struct sockaddr_in *) CMSG_DATA(c); + + printf("IP_ORIGDSTADDR, cmsg_data={sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}", ntohs(sin->sin_port)); +} +#endif + +int +main(void) +{ + int i; + while ((i = open("/dev/null", O_RDWR)) < 3) + assert(i >= 0); + assert(!close(0)); + assert(!close(3)); + + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + }; + socklen_t len = sizeof(addr); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + assert(!getsockname(0, (struct sockaddr *) &addr, &len)); + + assert(socket(AF_INET, SOCK_DGRAM, 0) == 3); + assert(!connect(3, (struct sockaddr *) &addr, len)); + + const int opt_1 = htonl(0x01000000); +#define SETSOCKOPT(fd, name) assert(!setsockopt(fd, IPPROTO_IP, (name), &opt_1, sizeof(opt_1))) + SETSOCKOPT(3, IP_OPTIONS); + SETSOCKOPT(0, IP_PKTINFO); + SETSOCKOPT(0, IP_RECVTTL); + SETSOCKOPT(0, IP_RECVTOS); + SETSOCKOPT(0, IP_RECVOPTS); + SETSOCKOPT(0, IP_RETOPTS); +#ifdef IP_RECVORIGDSTADDR + SETSOCKOPT(0, IP_RECVORIGDSTADDR); +#endif + + static const char data[] = "data"; + const size_t size = sizeof(data) - 1; + assert(send(3, data, size, 0) == (int) size); + assert(!close(3)); + + char buf[size]; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof(buf) + }; + struct cmsghdr control[16]; + struct msghdr mh = { + .msg_name = &addr, + .msg_namelen = len, + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = control, + .msg_controllen = sizeof(control) + }; + + assert(recvmsg(0, &mh, 0) == (int) size); + assert(!close(0)); + + printf("recvmsg(0, {msg_name={sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, msg_namelen=%u" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=1" + ", msg_control=[", + ntohs(addr.sin_port), (unsigned) mh.msg_namelen, + data, (unsigned) size); + + struct cmsghdr *c; + for (c = CMSG_FIRSTHDR(&mh); c; c = CMSG_NXTHDR(&mh, c)) { + if (IPPROTO_IP != c->cmsg_level) + continue; + if (c != control) + printf(", "); + printf("{cmsg_len=%lu, cmsg_level=SOL_IP, cmsg_type=", + (unsigned long) c->cmsg_len); + switch (c->cmsg_type) { + case IP_PKTINFO: + print_pktinfo(c); + break; + case IP_TTL: + print_ttl(c); + break; + case IP_TOS: + print_tos(c); + break; + case IP_RECVOPTS: + print_opts("IP_RECVOPTS", c); + break; + case IP_RETOPTS: + print_opts("IP_RETOPTS", c); + break; +#ifdef IP_ORIGDSTADDR + case IP_ORIGDSTADDR: + print_origdstaddr(c); + break; +#endif + default: + printf("%d", c->cmsg_type); + break; + } + printf("}"); + } + printf("], msg_controllen=%lu, msg_flags=0}, 0) = %u\n", + (unsigned long) mh.msg_controllen, (unsigned) size); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests/inet-cmsg.test b/tests/inet-cmsg.test new file mode 100755 index 00000000..52ff5f59 --- /dev/null +++ b/tests/inet-cmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check IPPROTO_IP control messages decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests/init.sh b/tests/init.sh index 3976a1ea..f368b98a 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,9 +1,35 @@ #!/bin/sh +# +# Copyright (c) 2011-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ME_="${0##*/}" - LOG="$ME_.tmp" -rm -f "$LOG" +OUT="$LOG.out" +EXP="$LOG.exp" +NAME="${ME_%.test}" warn_() { printf >&2 '%s\n' "$*"; } fail_() { warn_ "$ME_: failed test: $*"; exit 1; } @@ -17,6 +43,230 @@ check_prog() framework_skip_ "$* is not available" } -: "${STRACE:=../strace}" +dump_log_and_fail_with() +{ + cat < "$LOG" + fail_ "$*" +} + +run_prog() +{ + if [ $# -eq 0 ]; then + set -- "./$NAME" + fi + args="$*" + "$@" || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$args exited with code 77" + else + fail_ "$args failed with code $rc" + fi + } +} + + +run_prog_skip_if_failed() +{ + args="$*" + "$@" || framework_skip_ "$args failed with code $?" +} + +run_strace() +{ + > "$LOG" || fail_ "failed to write $LOG" + args="$*" + $STRACE -o "$LOG" "$@" || + dump_log_and_fail_with "$STRACE $args failed with code $?" +} + +run_strace_merge() +{ + rm -f -- "$LOG".[0-9]* + run_strace -ff -tt "$@" + "$srcdir"/../strace-log-merge "$LOG" > "$LOG" || + dump_log_and_fail_with 'strace-log-merge failed with code $?' + rm -f -- "$LOG".[0-9]* +} + +check_gawk() +{ + check_prog gawk + check_prog grep + + local program="$1"; shift + if grep '^@include[[:space:]]' < "$program" > /dev/null; then + gawk '@include "/dev/null"' < /dev/null || + framework_skip_ 'gawk does not support @include' + fi +} + +# Usage: [FILE_TO_CHECK [AWK_PROGRAM [ERROR_MESSAGE [EXTRA_AWK_OPTIONS...]]]] +# Check whether AWK_PROGRAM matches FILE_TO_CHECK using gawk. +# If it doesn't, dump FILE_TO_CHECK and fail with ERROR_MESSAGE. +match_awk() +{ + local output program error + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + program="$srcdir/$NAME.awk" + else + program="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_gawk "$program" + + AWKPATH="$srcdir" gawk -f "$program" "$@" < "$output" || { + cat < "$output" + fail_ "$error" + } +} + +# Usage: [FILE_TO_CHECK [FILE_TO_COMPATE_WITH [ERROR_MESSAGE]]] +# Check whether FILE_TO_CHECK differs from FILE_TO_COMPATE_WITH. +# If it does, dump the difference and fail with ERROR_MESSAGE. +match_diff() +{ + local output expected error + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + expected="$srcdir/$NAME.expected" + else + expected="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_prog diff + + diff -- "$expected" "$output" || + fail_ "$error" +} + +# Usage: [FILE_TO_CHECK [FILE_WITH_PATTERNS [ERROR_MESSAGE]]] +# Check whether all patterns listed in FILE_WITH_PATTERNS +# match FILE_TO_CHECK using egrep. +# If at least one of these patterns does not match, +# dump both files and fail with ERROR_MESSAGE. +match_grep() +{ + local output patterns error pattern cnt failed= + if [ $# -eq 0 ]; then + output="$LOG" + else + output="$1"; shift + fi + if [ $# -eq 0 ]; then + patterns="$srcdir/$NAME.expected" + else + patterns="$1"; shift + fi + if [ $# -eq 0 ]; then + error="$STRACE $args output mismatch" + else + error="$1"; shift + fi + + check_prog wc + check_prog grep + + cnt=1 + while read -r pattern; do + LC_ALL=C grep -E -x -e "$pattern" < "$output" > /dev/null || { + test -n "$failed" || { + echo 'Failed patterns of expected output:' + failed=1 + } + printf '#%d: %s\n' "$cnt" "$pattern" + } + cnt=$(($cnt + 1)) + done < "$patterns" + test -z "$failed" || { + echo 'Actual output:' + cat < "$output" + fail_ "$error" + } +} + +# Usage: run_strace_match_diff [args to run_strace] +run_strace_match_diff() +{ + args="$*" + [ -n "$args" -a -z "${args##*-e trace=*}" ] || + set -- -e trace="$NAME" "$@" + run_prog > /dev/null + run_strace "$@" $args > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +# Print kernel version code. +# usage: kernel_version_code $(uname -r) +kernel_version_code() +{ + ( + set -f + IFS=. + set -- $1 + v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0 + v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0 + v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0 + echo "$(($v1 * 65536 + $v2 * 256 + $v3))" + ) +} + +# Usage: require_min_kernel_version_or_skip 3.0 +require_min_kernel_version_or_skip() +{ + local uname_r + uname_r="$(uname -r)" + + [ "$(kernel_version_code "$uname_r")" -ge \ + "$(kernel_version_code "$1")" ] || + skip_ "the kernel release $uname_r is not $1 or newer" +} + +# Usage: grep_pid_status $pid GREP-OPTIONS... +grep_pid_status() +{ + local pid + pid=$1; shift + cat < "/proc/$pid/status" | grep "$@" +} + +check_prog cat +check_prog rm + +rm -f "$LOG" + +[ -n "${STRACE-}" ] || { + STRACE=../strace + case "${LOG_COMPILER-} ${LOG_FLAGS-}" in + *--suppressions=*--error-exitcode=*--tool=*) + # add valgrind command prefix + STRACE="${LOG_COMPILER-} ${LOG_FLAGS-} $STRACE" + ;; + esac +} + : "${TIMEOUT_DURATION:=60}" : "${SLEEP_A_BIT:=sleep 1}" + +[ -z "${VERBOSE-}" ] || + set -x diff --git a/tests/init_delete_module.h b/tests/init_delete_module.h new file mode 100644 index 00000000..db550c33 --- /dev/null +++ b/tests/init_delete_module.h @@ -0,0 +1,64 @@ +/* + * Helper header containing common code for finit_module, init_module, + * and delete_module tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_INIT_DELETE_MODULE_H +#define STRACE_TESTS_INIT_DELETE_MODULE_H + +# include +# include + +enum { + PARAM1_LEN = 33, + PARAM2_LEN = 8, + PARAM1_BASE = 0x30, + PARAM2_BASE = 0x80, + MAX_STRLEN = 32, +}; + +static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0xffffffff00000000ULL; + +static void +print_str(unsigned int base, unsigned int len, bool escape) +{ + unsigned int i; + + if (!escape) { + for (i = base; i < (base + len); i++) + putc(i, stdout); + + return; + } + + for (i = base; i < (base + len); i++) + printf("\\%u%u%u", (i >> 6) & 0x3, (i >> 3) & 0x7, i & 0x7); +} + +#endif /* !STRACE_TESTS_INIT_DELETE_MODULE_H */ diff --git a/tests/init_module.c b/tests/init_module.c new file mode 100644 index 00000000..88ef9ec8 --- /dev/null +++ b/tests/init_module.c @@ -0,0 +1,106 @@ +/* + * Check decoding of init_module syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_init_module) + +# include +# include + +# include "init_delete_module.h" + +int +main(void) +{ + + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfffffeedfffffaceULL; + static const kernel_ulong_t bogus_len = + (kernel_ulong_t) 0xfffffca7ffffc0deULL; + + long rc; + char *bogus_param1 = tail_alloc(PARAM1_LEN); + char *bogus_param2 = tail_alloc(PARAM2_LEN); + const char *errstr; + + fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); + fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); + + rc = syscall(__NR_init_module, NULL, bogus_zero, NULL); + printf("init_module(NULL, %llu, NULL) = %s\n", + (unsigned long long) bogus_zero, sprintrc(rc)); + + rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); + errstr = sprintrc(rc); + + printf("init_module(%#llx, 0, \"", (unsigned long long) bogus_addr); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\"...) = %s\n", errstr); + + bogus_param1[PARAM1_LEN - 1] = '\0'; + + rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); + errstr = sprintrc(rc); + + printf("init_module(%#llx, 0, \"", (unsigned long long) bogus_addr); + print_str(PARAM1_BASE, MAX_STRLEN, false); + printf("\") = %s\n", errstr); + + rc = syscall(__NR_init_module, bogus_addr, bogus_len, + bogus_param2 + PARAM2_LEN); + printf("init_module(%#llx, %llu, %p) = %s\n", + (unsigned long long) bogus_addr, (unsigned long long) bogus_len, + bogus_param2 + PARAM2_LEN, sprintrc(rc)); + + rc = syscall(__NR_init_module, NULL, bogus_len, bogus_param2); + printf("init_module(NULL, %llu, %p) = %s\n", + (unsigned long long) bogus_len, bogus_param2, sprintrc(rc)); + + bogus_param2[PARAM2_LEN - 1] = '\0'; + + rc = syscall(__NR_init_module, NULL, bogus_len, bogus_param2); + errstr = sprintrc(rc); + + printf("init_module(NULL, %llu, \"", (unsigned long long) bogus_len); + print_str(PARAM2_BASE, PARAM2_LEN - 1, true); + printf("\") = %s\n", errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_init_module"); + +#endif diff --git a/tests/init_module.test b/tests/init_module.test new file mode 100755 index 00000000..ef7c7325 --- /dev/null +++ b/tests/init_module.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of init_module syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/inode_of_sockfd.c b/tests/inode_of_sockfd.c new file mode 100644 index 00000000..b227f306 --- /dev/null +++ b/tests/inode_of_sockfd.c @@ -0,0 +1,59 @@ +/* + * This file is part of strace test suite. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +unsigned long +inode_of_sockfd(const int fd) +{ + assert(fd >= 0); + + char linkpath[sizeof("/proc/self/fd/%u") + sizeof(int) * 3]; + assert(snprintf(linkpath, sizeof(linkpath), "/proc/self/fd/%u", fd) + < (int) sizeof(linkpath)); + + char path[PATH_MAX + 1]; + const ssize_t path_len = readlink(linkpath, path, sizeof(path) - 1); + if (path_len < 0) + perror_msg_and_fail("readlink: %s", linkpath); + path[path_len] = '\0'; + + static const char prefix[] = "socket:["; + const size_t prefix_len = sizeof(prefix) - 1; + assert(strncmp(path, prefix, prefix_len) == 0 + && path[path_len - 1] == ']'); + + return strtoul(path + prefix_len, NULL, 10); +} diff --git a/tests/inotify.c b/tests/inotify.c new file mode 100644 index 00000000..925d69ff --- /dev/null +++ b/tests/inotify.c @@ -0,0 +1,90 @@ +/* + * Check decoding of inotify_add_watch and inotify_rm_watch syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_inotify_add_watch) && defined(__NR_inotify_rm_watch) + +# include +# include +# include + +int +main(void) +{ + static const struct { + const char *path; + const char *str; + } bogus_path_str = { + ARG_STR("/abc\1/def\2/ghi\3/jkl\4/mno\5/pqr\6/stu\7/vwx\10") }; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfffffeedfffffaceULL; + static const kernel_ulong_t bogus_mask = + (kernel_ulong_t) 0xffffda7affffdeadULL; + static const char *bogus_mask_str = "IN_ACCESS|IN_ATTRIB|" + "IN_CLOSE_WRITE|IN_OPEN|IN_MOVED_TO|IN_DELETE|IN_DELETE_SELF|" + "IN_MOVE_SELF|IN_Q_OVERFLOW|IN_IGNORED|IN_ONLYDIR|" + "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_ADD|IN_ISDIR|IN_ONESHOT|" + "0x18ff1000"; + + long rc; + char *bogus_path = tail_memdup(bogus_path_str.path, + strlen(bogus_path_str.path) + 1); + + rc = syscall(__NR_inotify_add_watch, 0, NULL, 0); + printf("inotify_add_watch(0, NULL, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_inotify_add_watch, bogus_fd, bogus_path + 4096, 0); + printf("inotify_add_watch(%d, %p, %u) = %s\n", + (int) bogus_fd, bogus_path + 4096, 0, sprintrc(rc)); + + rc = syscall(__NR_inotify_add_watch, bogus_fd, bogus_path, bogus_mask); + printf("inotify_add_watch(%d, %s, %s) = %s\n", + (int) bogus_fd, bogus_path_str.str, bogus_mask_str, + sprintrc(rc)); + + rc = syscall(__NR_inotify_rm_watch, 0, 0); + printf("inotify_rm_watch(0, 0) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_inotify_rm_watch, bogus_fd, bogus_fd); + printf("inotify_rm_watch(%d, %d) = %s\n", + (int) bogus_fd, (int) bogus_fd, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_inotify_add_watch && __NR_inotify_rm_watch"); + +#endif diff --git a/tests/inotify.test b/tests/inotify.test new file mode 100755 index 00000000..436f3bc8 --- /dev/null +++ b/tests/inotify.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of inotify_add_watch and inotify_rm_watch syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=inotify_add_watch,inotify_rm_watch -a23 diff --git a/tests/inotify_init1.c b/tests/inotify_init1.c new file mode 100644 index 00000000..0325150d --- /dev/null +++ b/tests/inotify_init1.c @@ -0,0 +1,80 @@ +/* + * Check decoding of inotify_init1 syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_inotify_init1) + +# include +# include +# include + +# ifdef O_CLOEXEC +# define cloexec_flag O_CLOEXEC +# else +# define cloexec_flag 0 +# endif +# define all_flags (O_NONBLOCK | cloexec_flag) + +int +main(void) +{ + static const kernel_ulong_t bogus_flags1 = + (kernel_ulong_t) 0xfacefeeddeadbeefULL | O_NONBLOCK; + static const kernel_ulong_t bogus_flags2 = + (kernel_ulong_t) 0x55555550ff96b77bULL & ~all_flags; + + long rc; + + rc = syscall(__NR_inotify_init1, bogus_flags1); + printf("inotify_init1(IN_NONBLOCK|%s%#x) = %s\n", + bogus_flags1 & cloexec_flag ? "IN_CLOEXEC|" : "", + (unsigned int) (bogus_flags1 & ~all_flags), + sprintrc(rc)); + + rc = syscall(__NR_inotify_init1, bogus_flags2); + printf("inotify_init1(%#x /* IN_??? */) = %s\n", + (unsigned int) bogus_flags2, sprintrc(rc)); + + rc = syscall(__NR_inotify_init1, all_flags); + printf("inotify_init1(IN_NONBLOCK%s) = %s\n", + all_flags & cloexec_flag ? "|IN_CLOEXEC" : "", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_inotify_init1"); + +#endif diff --git a/tests/inotify_init1.test b/tests/inotify_init1.test new file mode 100755 index 00000000..1a7c9261 --- /dev/null +++ b/tests/inotify_init1.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of inotify_init1 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/ioctl.c b/tests/ioctl.c new file mode 100644 index 00000000..92a3191d --- /dev/null +++ b/tests/ioctl.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_LINUX_MMTIMER_H +# include +#endif +#ifdef HAVE_LINUX_HIDDEV_H +# include +#endif +#ifdef HAVE_LINUX_INPUT_H +# include +#endif + +#include + +#if defined MMTIMER_GETRES \ + && defined VIDIOC_ENUMINPUT \ + && defined HIDIOCGVERSION \ + && defined HIDIOCGPHYS \ + && defined EVIOCGBIT \ + && defined EV_KEY + +int +main(void ) +{ + uint64_t data = 0; + +#ifndef POWERPC + struct termios tty; + (void) ioctl(-1, TCGETS, &tty); + printf("ioctl(-1, TCGETS, %p)" + " = -1 EBADF (%m)\n", &tty); +#endif + + (void) ioctl(-1, MMTIMER_GETRES, &data); + printf("ioctl(-1, MMTIMER_GETRES, %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, VIDIOC_ENUMINPUT, 0); + printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL)" + " = -1 EBADF (%m)\n"); + + (void) ioctl(-1, HIDIOCGVERSION, &data); + printf("ioctl(-1, HIDIOCGRDESCSIZE or HIDIOCGVERSION, %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, HIDIOCGPHYS(8), &data); + printf("ioctl(-1, HIDIOCGPHYS(8), %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, EVIOCGBIT(EV_KEY, 8), &data); + printf("ioctl(-1, EVIOCGBIT(EV_KEY, 8), %p)" + " = -1 EBADF (%m)\n", &data); + + (void) ioctl(-1, _IOR('M', 13, int), &data); + printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, [MTD_OTP_OFF])" + " = -1 EBADF (%m)\n"); + + (void) ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), (kernel_ulong_t) -1ULL); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), %#lx)" + " = -1 EBADF (%m)\n", -1UL); + + (void) ioctl(-1, _IOR(0xde, 0xad, data), &data); + printf("ioctl(-1, _IOC(_IOC_READ, 0xde, 0xad, 0x8), %p)" + " = -1 EBADF (%m)\n", &data); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("MMTIMER_GETRES && VIDIOC_ENUMINPUT" + " && HIDIOCGVERSION && HIDIOCGPHYS" + " && EVIOCGBIT && EV_KEY") + +#endif diff --git a/tests/ioctl.test b/tests/ioctl.test new file mode 100755 index 00000000..94bc5d42 --- /dev/null +++ b/tests/ioctl.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check ioctl syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests/ioctl_block.c b/tests/ioctl_block.c new file mode 100644 index 00000000..f62b0b36 --- /dev/null +++ b/tests/ioctl_block.c @@ -0,0 +1,203 @@ +/* + * This file is part of ioctl_block strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_STRUCT_BLK_USER_TRACE_SETUP +# include +#endif +#include "xlat.h" + +static const unsigned int magic = 0xdeadbeef; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +static struct xlat block_argless[] = { + XLAT(BLKRRPART), + XLAT(BLKFLSBUF), +#ifdef BLKTRACESTART + XLAT(BLKTRACESTART), +#endif +#ifdef BLKTRACESTOP + XLAT(BLKTRACESTOP), +#endif +#ifdef BLKTRACETEARDOWN + XLAT(BLKTRACETEARDOWN), +#endif +}; + +#define TEST_NULL_ARG(cmd) \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) + +int +main(void) +{ + TEST_NULL_ARG(BLKBSZGET); + TEST_NULL_ARG(BLKBSZSET); + TEST_NULL_ARG(BLKFRAGET); + TEST_NULL_ARG(BLKGETSIZE); + TEST_NULL_ARG(BLKGETSIZE64); + TEST_NULL_ARG(BLKPG); + TEST_NULL_ARG(BLKRAGET); + TEST_NULL_ARG(BLKROGET); + TEST_NULL_ARG(BLKROSET); + TEST_NULL_ARG(BLKSECTGET); + TEST_NULL_ARG(BLKSECTGET); + TEST_NULL_ARG(BLKSSZGET); +#ifdef BLKALIGNOFF + TEST_NULL_ARG(BLKALIGNOFF); +#endif +#ifdef BLKDISCARD + TEST_NULL_ARG(BLKDISCARD); +#endif +#ifdef BLKDISCARDZEROES + TEST_NULL_ARG(BLKDISCARDZEROES); +#endif +#ifdef BLKIOMIN + TEST_NULL_ARG(BLKIOMIN); +#endif +#ifdef BLKIOOPT + TEST_NULL_ARG(BLKIOOPT); +#endif +#ifdef BLKPBSZGET + TEST_NULL_ARG(BLKPBSZGET); +#endif +#ifdef BLKROTATIONAL + TEST_NULL_ARG(BLKROTATIONAL); +#endif +#ifdef BLKSECDISCARD + TEST_NULL_ARG(BLKSECDISCARD); +#endif +#ifdef BLKZEROOUT + TEST_NULL_ARG(BLKZEROOUT); +#endif +#if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP + TEST_NULL_ARG(BLKTRACESETUP); +#endif + + ioctl(-1, BLKRASET, lmagic); + printf("ioctl(-1, BLKRASET, %lu) = -1 EBADF (%m)\n", lmagic); + + ioctl(-1, BLKFRASET, lmagic); + printf("ioctl(-1, BLKFRASET, %lu) = -1 EBADF (%m)\n", lmagic); + + int *const val_int = tail_alloc(sizeof(*val_int)); + *val_int = magic; + + ioctl(-1, BLKROSET, val_int); + printf("ioctl(-1, BLKROSET, [%d]) = -1 EBADF (%m)\n", *val_int); + + ioctl(-1, BLKBSZSET, val_int); + printf("ioctl(-1, BLKBSZSET, [%d]) = -1 EBADF (%m)\n", *val_int); + + uint64_t *pair_int64 = tail_alloc(sizeof(*pair_int64) * 2); + pair_int64[0] = 0xdeadbeefbadc0dedULL; + pair_int64[1] = 0xfacefeedcafef00dULL; + +#ifdef BLKDISCARD + ioctl(-1, BLKDISCARD, pair_int64); + printf("ioctl(-1, BLKDISCARD, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + +#ifdef BLKSECDISCARD + ioctl(-1, BLKSECDISCARD, pair_int64); + printf("ioctl(-1, BLKSECDISCARD, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + +#ifdef BLKZEROOUT + ioctl(-1, BLKZEROOUT, pair_int64); + printf("ioctl(-1, BLKZEROOUT, [%" PRIu64 ", %" PRIu64 "])" + " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); +#endif + + struct blkpg_ioctl_arg *const blkpg = tail_alloc(sizeof(*blkpg)); + blkpg->op = 3; + blkpg->flags = 0xdeadbeef; + blkpg->datalen = 0xbadc0ded; + blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeedULL; + + ioctl(-1, BLKPG, blkpg); + printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + ", data=%#lx}) = -1 EBADF (%m)\n", + "BLKPG_RESIZE_PARTITION", blkpg->flags, blkpg->datalen, + (unsigned long) blkpg->data); + + struct blkpg_partition *const bp = tail_alloc(sizeof(*bp)); + bp->start = 0xfac1fed2dad3bef4ULL; + bp->length = 0xfac5fed6dad7bef8ULL; + bp->pno = magic; + memset(bp->devname, 'A', sizeof(bp->devname)); + memset(bp->volname, 'B', sizeof(bp->volname)); + blkpg->op = 1; + blkpg->data = bp; + + ioctl(-1, BLKPG, blkpg); + printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + ", data={start=%lld, length=%lld, pno=%d" + ", devname=\"%.*s\", volname=\"%.*s\"}})" + " = -1 EBADF (%m)\n", + "BLKPG_ADD_PARTITION", + blkpg->flags, blkpg->datalen, + bp->start, bp->length, bp->pno, + (int) sizeof(bp->devname) - 1, bp->devname, + (int) sizeof(bp->volname) - 1, bp->volname); + +#if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP + struct blk_user_trace_setup *const buts = tail_alloc(sizeof(*buts)); + fill_memory(buts, sizeof(*buts)); + + ioctl(-1, BLKTRACESETUP, buts); + printf("ioctl(-1, BLKTRACESETUP, {act_mask=%hu, buf_size=%u, buf_nr=%u" + ", start_lba=%" PRI__u64 ", end_lba=%" PRI__u64 ", pid=%u})" + " = -1 EBADF (%m)\n", + buts->act_mask, buts->buf_size, buts->buf_nr, + buts->start_lba, buts->end_lba, buts->pid); +#endif + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(block_argless); ++i) { + ioctl(-1, (unsigned long) block_argless[i].val, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", block_argless[i].str); + } + + ioctl(-1, _IOC(_IOC_READ, 0x12, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ, 0x12, 0xfe, 0xff)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_block.test b/tests/ioctl_block.test new file mode 100755 index 00000000..0bf2500f --- /dev/null +++ b/tests/ioctl_block.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of BLK* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_dm-v.c b/tests/ioctl_dm-v.c new file mode 100644 index 00000000..d95058f2 --- /dev/null +++ b/tests/ioctl_dm-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_dm.c" diff --git a/tests/ioctl_dm-v.test b/tests/ioctl_dm-v.test new file mode 100755 index 00000000..ade3b9e8 --- /dev/null +++ b/tests/ioctl_dm-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check unabbreviated decoding of DM* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -s9 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_dm.c b/tests/ioctl_dm.c new file mode 100644 index 00000000..08f036c6 --- /dev/null +++ b/tests/ioctl_dm.c @@ -0,0 +1,774 @@ +/* + * Check decoding of DM_* commands of ioctl syscall. + * + * Copyright (c) 2016 Mikulas Patocka + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_DM_IOCTL_H + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" + +# define ALIGNED_SIZE(s_, t_) \ + (((s_) + (ALIGNOF(t_) - 1UL)) & ~(ALIGNOF(t_) - 1UL)) +# define ALIGNED_OFFSET(t_, m_) \ + ALIGNED_SIZE(offsetof(t_, m_), t_) + +static const char str129[] = STR32 STR32 STR32 STR32 "6"; + +static const __u64 dts_sector_base = (__u64) 0xdeadca75facef157ULL; +static const __u64 dts_sector_step = (__u64) 0x100000001ULL; +static const __u64 dts_length_base = (__u64) 0xbadc0dedda7a1057ULL; +static const __u64 dts_length_step = (__u64) 0x700000007ULL; +static const __s32 dts_status_base = (__s32) 3141592653U; +static const __s32 dts_status_step = 0x1234; + +static const size_t min_sizeof_dm_ioctl = + offsetof(struct dm_ioctl, data); + +static struct s { + struct dm_ioctl ioc; + union { + struct { + struct dm_target_spec target_spec; + char target_params[256]; + } ts; + struct { + struct dm_target_msg target_msg; + char target_string[256]; + } tm; + char string[256]; + } u; +} s; + +struct dm_table_open_test { + struct dm_ioctl ioc; + struct dm_target_spec target0; + char param0[1]; + struct dm_target_spec target1; + char param1[2]; + struct dm_target_spec target2; + char param2[3]; + struct dm_target_spec target3; + char param3[4]; + struct dm_target_spec target4; + char param4[5]; + struct dm_target_spec target5; + char param5[6]; + struct dm_target_spec target6; + char param6[7]; + struct dm_target_spec target7; + char param7[8]; + struct dm_target_spec target8; + char param8[9]; + struct dm_target_spec target9; + char param9[10]; +}; + +struct dm_target_msg_test { + struct dm_ioctl ioc; + struct dm_target_msg msg; +}; + +struct args { + unsigned int arg; + const char *str; + bool has_params; + bool has_event_nr; +}; + + +static void +init_s(struct dm_ioctl *s, size_t size, size_t offs) +{ + memset(s, 0, size); + s->version[0] = DM_VERSION_MAJOR; + s->version[1] = 1; + s->version[2] = 2; + s->data_size = size; + s->data_start = offs; + s->dev = 0x1234; + strcpy(s->name, "nnn"); + strcpy(s->uuid, "uuu"); +} + +static void +init_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) +{ + ptr->sector_start = dts_sector_base + dts_sector_step * id; + ptr->length = dts_length_base + dts_length_step * id; + ptr->status = dts_status_base + dts_status_step * id; + + strncpy(ptr->target_type, str129 + + id % (sizeof(str129) - sizeof(ptr->target_type)), + id % (sizeof(ptr->target_type) + 1)); + if (id % (sizeof(ptr->target_type) + 1) < sizeof(ptr->target_type)) + ptr->target_type[id % (sizeof(ptr->target_type) + 1)] = '\0'; +} + +# if VERBOSE +static void +print_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) +{ + printf("{sector_start=%" PRI__u64 ", length=%" PRI__u64 ", " + "target_type=\"%.*s\", string=", + dts_sector_base + dts_sector_step * id, + dts_length_base + dts_length_step * id, + (int) (id % (sizeof(ptr->target_type) + 1)), + str129 + id % (sizeof(str129) - sizeof(ptr->target_type))); +} +# endif /* VERBOSE */ + +int +main(void) +{ + static kernel_ulong_t dummy_dm_ioctl1 = + _IOC(_IOC_READ, DM_IOCTL, 0, 0x1fff); + static kernel_ulong_t dummy_dm_ioctl2 = + _IOC(_IOC_READ|_IOC_WRITE, DM_IOCTL, 0xed, 0); + static kernel_ulong_t dummy_dm_arg = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + /* We can't check these properly for now */ + static struct args dummy_check_cmds_nodev[] = { + { ARG_STR(DM_REMOVE_ALL), false }, + { ARG_STR(DM_LIST_DEVICES), true }, + { ARG_STR(DM_LIST_VERSIONS), true }, + }; + static struct args dummy_check_cmds[] = { + { ARG_STR(DM_DEV_CREATE), false }, + { ARG_STR(DM_DEV_REMOVE), false, true }, + { ARG_STR(DM_DEV_STATUS), false }, + { ARG_STR(DM_DEV_WAIT), true, true }, + { ARG_STR(DM_TABLE_CLEAR), false }, + { ARG_STR(DM_TABLE_DEPS), true }, + { ARG_STR(DM_TABLE_STATUS), true }, + }; + + struct dm_ioctl *unaligned_dm_arg = + tail_alloc(offsetof(struct dm_ioctl, data)); + struct dm_ioctl *dm_arg = + tail_alloc(ALIGNED_OFFSET(struct dm_ioctl, data)); + struct dm_table_open_test *dm_arg_open1 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, target1)); + struct dm_table_open_test *dm_arg_open2 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, param1)); + struct dm_table_open_test *dm_arg_open3 = + tail_alloc(ALIGNED_OFFSET(struct dm_table_open_test, target9)); + struct dm_target_msg_test *dm_arg_msg = + tail_alloc(sizeof(*dm_arg_msg)); + + long rc; + const char *errstr; + unsigned int i; + + + /* Incorrect operation */ + ioctl(-1, _IOW(DM_IOCTL, 0xde, int), dm_arg); + printf("ioctl(-1, _IOC(_IOC_WRITE, %#x, 0xde, %#zx), %p) = " + "-1 EBADF (%m)\n", + DM_IOCTL, sizeof(int), dm_arg); + + ioctl(-1, dummy_dm_ioctl1, 0); + printf("ioctl(-1, _IOC(_IOC_READ, %#x, 0, %#x), 0) = -1 EBADF (%m)\n", + DM_IOCTL, (unsigned int) _IOC_SIZE(dummy_dm_ioctl1)); + + ioctl(-1, dummy_dm_ioctl2, dummy_dm_arg); + printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, %#x, %#x, 0), %#lx) = " + "-1 EBADF (%m)\n", + DM_IOCTL, (unsigned int) _IOC_NR(dummy_dm_ioctl2), + (unsigned long) dummy_dm_arg); + + + /* DM_VERSION */ + /* Incorrect pointer */ + ioctl(-1, DM_VERSION, dm_arg + 1); + printf("ioctl(-1, DM_VERSION, %p) = -1 EBADF (%m)\n", dm_arg + 1); + + /* Incorrect data_size */ + init_s(dm_arg, 0, 0); + ioctl(-1, DM_VERSION, &s); + printf("ioctl(-1, DM_VERSION, %p) = -1 EBADF (%m)\n", &s); + + /* Incorrect version */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->version[0] = 0xbadc0ded; + dm_arg->version[1] = 0xbadc0dee; + dm_arg->version[2] = 0xbadc0def; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u, " + "/* Unsupported device mapper ABI version */ ...}) = " + "-1 EBADF (%m)\n", 0xbadc0ded, 0xbadc0dee, 0xbadc0def); + + /* Incorrect data_size */ + init_s(dm_arg, 14, 64); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14, " + "/* Incorrect data_size */ ...}) = -1 EBADF (%m)\n"); + + /* Unterminated name/uuid */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + strncpy(dm_arg->name, str129, sizeof(dm_arg->name)); + strncpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"%.127s\", uuid=\"%.128s\", " + "flags=0}) = -1 EBADF (%m)\n", + min_sizeof_dm_ioctl, str129, str129); + + /* Normal call */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "-1 EBADF (%m)\n", min_sizeof_dm_ioctl); + + /* Zero dev, name, uuid */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->data_size = 0xfacefeed; + dm_arg->dev = 0; + dm_arg->name[0] = '\0'; + dm_arg->uuid[0] = '\0'; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%u, flags=0}) = " + "-1 EBADF (%m)\n", 0xfacefeed); + + /* Flag */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->flags = 0xffffffff; + ioctl(-1, DM_VERSION, dm_arg); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=" + "DM_READONLY_FLAG|DM_SUSPEND_FLAG|DM_EXISTS_FLAG|" + "DM_PERSISTENT_DEV_FLAG|DM_STATUS_TABLE_FLAG|" + "DM_ACTIVE_PRESENT_FLAG|DM_INACTIVE_PRESENT_FLAG|" + "DM_BUFFER_FULL_FLAG|DM_SKIP_BDGET_FLAG|DM_SKIP_LOCKFS_FLAG|" + "DM_NOFLUSH_FLAG|DM_QUERY_INACTIVE_TABLE_FLAG|" + "DM_UEVENT_GENERATED_FLAG|DM_UUID_FLAG|DM_SECURE_DATA_FLAG|" + "DM_DATA_OUT_FLAG|DM_DEFERRED_REMOVE|DM_INTERNAL_SUSPEND_FLAG|" + "0xfff80080}) = -1 EBADF (%m)\n", + min_sizeof_dm_ioctl); + + /* Normal call */ + init_s(&s.ioc, sizeof(s.ioc), 0); + ioctl(-1, DM_VERSION, &s); + printf("ioctl(-1, DM_VERSION, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "-1 EBADF (%m)\n", sizeof(s.ioc)); + + + /* DM_REMOVE_ALL */ + /* DM_LIST_DEVICES */ + /* DM_LIST_VERSIONS */ + for (i = 0; i < ARRAY_SIZE(dummy_check_cmds_nodev); i++) { + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, dummy_check_cmds_nodev[i].arg, dm_arg); + printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " + "flags=0}) = -1 EBADF (%m)\n", + dummy_check_cmds_nodev[i].str, + min_sizeof_dm_ioctl, + dummy_check_cmds_nodev[i].has_params ? + ", data_start=0" : ""); + } + + + /* DM_DEV_CREATE */ + /* DM_DEV_REMOVE */ + /* DM_DEV_STATUS */ + /* DM_DEV_WAIT */ + /* DM_TABLE_CLEAR */ + /* DM_TABLE_DEPS */ + /* DM_TABLE_STATUS */ + for (i = 0; i < ARRAY_SIZE(dummy_check_cmds); i++) { + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + ioctl(-1, dummy_check_cmds[i].arg, dm_arg); + printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\"%s, " + "flags=0}) = -1 EBADF (%m)\n", + dummy_check_cmds[i].str, min_sizeof_dm_ioctl, + dummy_check_cmds[i].has_params ? ", data_start=0" : "", + dummy_check_cmds[i].has_event_nr ? ", event_nr=0" : ""); + } + + + /* DM_DEV_SUSPEND */ + init_s(&s.ioc, sizeof(s.ioc), 0); + s.ioc.flags = DM_SUSPEND_FLAG; + s.ioc.event_nr = 0xbadc0ded; + ioctl(-1, DM_DEV_SUSPEND, &s); + printf("ioctl(-1, DM_DEV_SUSPEND, " + "{version=4.1.2, data_size=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "flags=DM_SUSPEND_FLAG}) = -1 EBADF (%m)\n", sizeof(s.ioc)); + + init_s(&s.ioc, sizeof(s.ioc), 0); + s.ioc.event_nr = 0xbadc0ded; + ioctl(-1, DM_DEV_SUSPEND, &s); + printf("ioctl(-1, DM_DEV_SUSPEND, " + "{version=4.1.2, data_size=%zu, dev=makedev(18, 52), " + "name=\"nnn\", uuid=\"uuu\", event_nr=3134983661, " + "flags=0}) = -1 EBADF (%m)\n", sizeof(s.ioc)); + + + /* DM_TABLE_LOAD */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.target_count = 1; + s.u.ts.target_spec.sector_start = 0x10; + s.u.ts.target_spec.length = 0x20; + s.u.ts.target_spec.next = + sizeof(s.u.ts.target_spec) + sizeof(s.u.ts.target_params); + strcpy(s.u.ts.target_spec.target_type, "tgt"); + strcpy(s.u.ts.target_params, "tparams"); + ioctl(-1, DM_TABLE_LOAD, &s); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=1, flags=0, " +# if VERBOSE + "{sector_start=16, length=32, target_type=\"tgt\", " + "string=\"tparams\"}" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", s.ioc.data_size, s.ioc.data_start); + + /* No targets */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + dm_arg->target_count = 0; + ioctl(-1, DM_TABLE_LOAD, dm_arg); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=0, flags=0}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), min_sizeof_dm_ioctl); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0xfffffff8); + dm_arg->data_size = sizeof(*dm_arg); + dm_arg->target_count = 1234; + ioctl(-1, DM_TABLE_LOAD, dm_arg); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=1234, flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_spec */ ..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", sizeof(*dm_arg), 0xfffffff8); + + /* Inaccessible pointer */ + init_s(&dm_arg_open1->ioc, offsetof(struct dm_table_open_test, target1), + offsetof(struct dm_table_open_test, target1)); + dm_arg_open1->ioc.data_size = sizeof(*dm_arg_open1); + dm_arg_open1->ioc.target_count = 0xdeaddea1; + ioctl(-1, DM_TABLE_LOAD, dm_arg_open1); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=3735936673, flags=0, " +# if VERBOSE + "%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", sizeof(*dm_arg_open1), + offsetof(struct dm_table_open_test, target1) +# if VERBOSE + , (char *) dm_arg_open1 + + offsetof(struct dm_table_open_test, target1) +# endif /* VERBOSE */ + ); + + /* Inaccessible string */ + init_s(&dm_arg_open2->ioc, offsetof(struct dm_table_open_test, param1), + offsetof(struct dm_table_open_test, target1)); + dm_arg_open2->ioc.data_size = sizeof(*dm_arg_open2); + dm_arg_open2->ioc.target_count = 2; + init_dm_target_spec(&dm_arg_open2->target1, 7); + dm_arg_open2->target1.next = + offsetof(struct dm_table_open_test, target3) - + offsetof(struct dm_table_open_test, target1); + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open2); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=2, flags=0, ", + sizeof(*dm_arg_open2), + offsetof(struct dm_table_open_test, target1)); +# if VERBOSE + print_dm_target_spec(&dm_arg_open2->target1, 7); + printf("%p}, %p", + (char *) dm_arg_open2 + + offsetof(struct dm_table_open_test, param1), + (char *) dm_arg_open2 + + offsetof(struct dm_table_open_test, target3)); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + /* Incorrect next */ + init_s(&dm_arg_open3->ioc, offsetof(struct dm_table_open_test, target5), + offsetof(struct dm_table_open_test, target0)); + dm_arg_open3->ioc.target_count = 4; + + init_dm_target_spec(&dm_arg_open3->target0, 9); + dm_arg_open3->target0.next = + offsetof(struct dm_table_open_test, target1) - + offsetof(struct dm_table_open_test, target0); + dm_arg_open3->param0[0] = '\0'; + + init_dm_target_spec(&dm_arg_open3->target1, 15); + dm_arg_open3->target1.next = + offsetof(struct dm_table_open_test, target3) - + offsetof(struct dm_table_open_test, target1); + dm_arg_open3->param1[0] = '\377'; + dm_arg_open3->param1[1] = '\0'; + + init_dm_target_spec(&dm_arg_open3->target3, 42); + dm_arg_open3->target3.next = 0xdeadbeef; + dm_arg_open3->param3[0] = '\1'; + dm_arg_open3->param3[1] = '\2'; + dm_arg_open3->param3[2] = '\0'; + + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open3); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=4, flags=0, ", + offsetof(struct dm_table_open_test, target5), + offsetof(struct dm_table_open_test, target0)); +# if VERBOSE + print_dm_target_spec(&dm_arg_open3->target0, 9); + printf("\"\"}, "); + print_dm_target_spec(&dm_arg_open3->target1, 15); + printf("\"\\377\"}, "); + print_dm_target_spec(&dm_arg_open3->target1, 42); + printf("\"\\1\\2\"}, /* misplaced struct dm_target_spec */ ..."); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + #define FILL_DM_TARGET(id, id_next) \ + do { \ + init_dm_target_spec(&dm_arg_open3->target##id, id); \ + dm_arg_open3->target##id.next = \ + offsetof(struct dm_table_open_test, \ + target##id_next) - \ + offsetof(struct dm_table_open_test, \ + target##id); \ + strncpy(dm_arg_open3->param##id, str129 + id * 2, id); \ + dm_arg_open3->param##id[id] = '\0'; \ + } while (0) + #define PRINT_DM_TARGET(id) \ + do { \ + print_dm_target_spec(&dm_arg_open3->target##id, id); \ + printf("\"%.*s\"}, ", id, str129 + id * 2); \ + } while (0) + + /* max_strlen limit */ + init_s(&dm_arg_open3->ioc, offsetof(struct dm_table_open_test, target9), + offsetof(struct dm_table_open_test, target0)); + dm_arg_open3->ioc.data_size = sizeof(*dm_arg_open3); + dm_arg_open3->ioc.target_count = 0xbadc0ded; + FILL_DM_TARGET(0, 1); + FILL_DM_TARGET(1, 2); + FILL_DM_TARGET(2, 3); + FILL_DM_TARGET(3, 4); + FILL_DM_TARGET(4, 5); + FILL_DM_TARGET(5, 6); + FILL_DM_TARGET(6, 7); + FILL_DM_TARGET(7, 8); + FILL_DM_TARGET(8, 9); + rc = ioctl(-1, DM_TABLE_LOAD, dm_arg_open3); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=3134983661, flags=0, ", + sizeof(*dm_arg_open3), + offsetof(struct dm_table_open_test, target0)); +# if VERBOSE + PRINT_DM_TARGET(0); + PRINT_DM_TARGET(1); + PRINT_DM_TARGET(2); + PRINT_DM_TARGET(3); + PRINT_DM_TARGET(4); + PRINT_DM_TARGET(5); + PRINT_DM_TARGET(6); + PRINT_DM_TARGET(7); + PRINT_DM_TARGET(8); +# endif /* VERBOSE */ + printf("...}) = %s\n", errstr); + + + /* DM_TARGET_MSG */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.u.tm.target_msg.sector = 0x1234; + strcpy(s.u.string + offsetof(struct dm_target_msg, message), + "long target msg"); + ioctl(-1, DM_TARGET_MSG, &s); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "{sector=4660, message=\"long targ\"...}" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_msg */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), min_sizeof_dm_ioctl); + + /* Invalid data_start */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0xffffffff); + dm_arg->data_size = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "/* misplaced struct dm_target_msg */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg), 0xffffffff); + + /* Inaccessible pointer */ + init_s(dm_arg, min_sizeof_dm_ioctl, 0); + dm_arg->data_size = sizeof(*dm_arg) + sizeof(struct dm_target_msg); + dm_arg->data_start = sizeof(*dm_arg); + ioctl(-1, DM_TARGET_MSG, dm_arg); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*dm_arg) + sizeof(struct dm_target_msg), + sizeof(*dm_arg) +# if VERBOSE + , (char *) dm_arg + sizeof(*dm_arg) +# endif /* VERBOSE */ + ); + + /* Inaccessible string */ + init_s(&dm_arg_msg->ioc, sizeof(*dm_arg_msg), + offsetof(struct dm_target_msg_test, msg)); + dm_arg_msg->ioc.data_size = sizeof(*dm_arg_msg) + 1; + dm_arg_msg->msg.sector = (__u64) 0xdeadbeeffacef157ULL; + rc = ioctl(-1, DM_TARGET_MSG, dm_arg_msg); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + sizeof(*dm_arg_msg) + 1, + offsetof(struct dm_target_msg_test, msg)); +# if VERBOSE + printf("{sector=%" PRI__u64 ", message=%p}", + (__u64) 0xdeadbeeffacef157ULL, + (char *) dm_arg_msg + + offsetof(struct dm_target_msg_test, msg.message)); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + /* Zero-sied string */ + init_s(&dm_arg_msg->ioc, sizeof(*dm_arg_msg), + offsetof(struct dm_target_msg_test, msg)); + dm_arg_msg->msg.sector = (__u64) 0xdeadbeeffacef157ULL; + rc = ioctl(-1, DM_TARGET_MSG, dm_arg_msg); + errstr = sprintrc(rc); + printf("ioctl(-1, DM_TARGET_MSG, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + sizeof(*dm_arg_msg), offsetof(struct dm_target_msg_test, msg)); +# if VERBOSE + printf("{sector=%" PRI__u64 ", message=\"\"}", + (__u64) 0xdeadbeeffacef157ULL); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + printf("}) = %s\n", errstr); + + + /* DM_DEV_SET_GEOMETRY */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + strcpy(s.u.string, "10 20 30 40"); + ioctl(-1, DM_DEV_SET_GEOMETRY, &s); + printf("ioctl(-1, DM_DEV_SET_GEOMETRY, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " +# if VERBOSE + "string=\"10 20 30 \"..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + + /* DM_DEV_RENAME */ + /* Inaccessible data */ + init_s(dm_arg, min_sizeof_dm_ioctl, min_sizeof_dm_ioctl); + dm_arg->data_size = sizeof(*dm_arg); + memcpy(unaligned_dm_arg, dm_arg, offsetof(struct dm_ioctl, data)); + ioctl(-1, DM_DEV_RENAME, unaligned_dm_arg); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%zu, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=%p" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + sizeof(*unaligned_dm_arg), min_sizeof_dm_ioctl +# if VERBOSE + , (char *) unaligned_dm_arg + min_sizeof_dm_ioctl +# endif /* VERBOSE */ + ); + + /* Incorrect data_start data */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.data_start = 0xdeadbeef; + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=3735928559, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "/* misplaced string */" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size); + + /* Strange but still valid data_start */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + /* Curiously, this is a valid structure */ + s.ioc.data_start = offsetof(struct dm_ioctl, name) + 1; + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=%zu, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=\"nn\"" +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, + offsetof(struct dm_ioctl, name) + 1); + + /* Correct data */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + strcpy(s.u.string, "new long name"); + ioctl(-1, DM_DEV_RENAME, &s); + printf("ioctl(-1, DM_DEV_RENAME, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "flags=0, " +# if VERBOSE + "string=\"new long \"..." +# else /* !VERBOSE */ + "..." +# endif /* VERBOSE */ + "}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + + /* DM_TABLE_LOAD */ + init_s(&s.ioc, sizeof(s), offsetof(struct s, u)); + s.ioc.target_count = -1U; + ioctl(-1, DM_TABLE_LOAD, &s); + printf("ioctl(-1, DM_TABLE_LOAD, " + "{version=4.1.2, data_size=%u, data_start=%u, " + "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "target_count=4294967295, flags=0, " +# if VERBOSE + "{sector_start=0, length=0, target_type=\"\", string=\"\"}, " + "/* misplaced struct dm_target_spec */ " +# endif /* VERBOSE */ + "...}) = -1 EBADF (%m)\n", + s.ioc.data_size, s.ioc.data_start); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else /* !HAVE_LINUX_DM_IOCTL_H */ + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_DM_IOCTL_H") + +#endif /* HAVE_LINUX_DM_IOCTL_H */ diff --git a/tests/ioctl_dm.test b/tests/ioctl_dm.test new file mode 100755 index 00000000..64852051 --- /dev/null +++ b/tests/ioctl_dm.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of DM* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -s9 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_evdev-v.c b/tests/ioctl_evdev-v.c new file mode 100644 index 00000000..3860716b --- /dev/null +++ b/tests/ioctl_evdev-v.c @@ -0,0 +1,3 @@ +/* This file is part of ioctl_evdev-v strace test. */ +#define VERBOSE 1 +#include "ioctl_evdev.c" diff --git a/tests/ioctl_evdev-v.test b/tests/ioctl_evdev-v.test new file mode 100755 index 00000000..87941010 --- /dev/null +++ b/tests/ioctl_evdev-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check verbose decoding EVIOC* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_evdev.c b/tests/ioctl_evdev.c new file mode 100644 index 00000000..d12323ee --- /dev/null +++ b/tests/ioctl_evdev.c @@ -0,0 +1,278 @@ +/* + * This file is part of ioctl_evdev strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_INPUT_H + +# include +# include +# include +# include +# include +# include + +static const unsigned int magic = 0xdeadbeef; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +# if VERBOSE +static void +print_envelope(const struct ff_envelope *const e) +{ + printf(", envelope={attack_length=%hu, attack_level=%hu" + ", fade_length=%hu, fade_level=%#hx}", + e->attack_length, e->attack_level, + e->fade_length, e->fade_level); +} +# endif /* VERBOSE */ + +static void +print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) +{ + printf("ioctl(-1, EVIOCSFF, {type=%s, id=%" PRIu16 + ", direction=%" PRIu16 ", ", + type_str, ffe->id, ffe->direction); +# if VERBOSE + printf("trigger={button=%hu, interval=%hu}" + ", replay={length=%hu, delay=%hu}", + ffe->trigger.button, ffe->trigger.interval, + ffe->replay.length, ffe->replay.delay); +# endif /* VERBOSE */ +} + +# define TEST_NULL_ARG(cmd) \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) + +int +main(void) +{ + TEST_NULL_ARG(EVIOCGVERSION); + TEST_NULL_ARG(EVIOCGEFFECTS); + TEST_NULL_ARG(EVIOCGID); + TEST_NULL_ARG(EVIOCGKEYCODE); + TEST_NULL_ARG(EVIOCSKEYCODE); + TEST_NULL_ARG(EVIOCSFF); +# ifdef EVIOCGKEYCODE_V2 + TEST_NULL_ARG(EVIOCGKEYCODE_V2); +# endif +# ifdef EVIOCSKEYCODE_V2 + TEST_NULL_ARG(EVIOCSKEYCODE_V2); +# endif +# ifdef EVIOCGREP + TEST_NULL_ARG(EVIOCGREP); +# endif +# ifdef EVIOCSREP + TEST_NULL_ARG(EVIOCSREP); +# endif +# ifdef EVIOCSCLOCKID + TEST_NULL_ARG(EVIOCSCLOCKID); +# endif + + TEST_NULL_ARG(EVIOCGNAME(0)); + TEST_NULL_ARG(EVIOCGPHYS(0)); + TEST_NULL_ARG(EVIOCGUNIQ(0)); + TEST_NULL_ARG(EVIOCGKEY(0)); + TEST_NULL_ARG(EVIOCGLED(0)); +# ifdef EVIOCGMTSLOTS + TEST_NULL_ARG(EVIOCGMTSLOTS(0)); +# endif +# ifdef EVIOCGPROP + TEST_NULL_ARG(EVIOCGPROP(0)); +# endif + TEST_NULL_ARG(EVIOCGSND(0)); +# ifdef EVIOCGSW + TEST_NULL_ARG(EVIOCGSW(0)); +# endif + + TEST_NULL_ARG(EVIOCGABS(ABS_X)); + TEST_NULL_ARG(EVIOCSABS(ABS_X)); + + TEST_NULL_ARG(EVIOCGBIT(EV_SYN, 0)); + TEST_NULL_ARG(EVIOCGBIT(EV_KEY, 1)); + TEST_NULL_ARG(EVIOCGBIT(EV_REL, 2)); + TEST_NULL_ARG(EVIOCGBIT(EV_ABS, 3)); + TEST_NULL_ARG(EVIOCGBIT(EV_MSC, 4)); +# ifdef EV_SW + TEST_NULL_ARG(EVIOCGBIT(EV_SW, 5)); +# endif + TEST_NULL_ARG(EVIOCGBIT(EV_LED, 6)); + TEST_NULL_ARG(EVIOCGBIT(EV_SND, 7)); + TEST_NULL_ARG(EVIOCGBIT(EV_REP, 8)); + TEST_NULL_ARG(EVIOCGBIT(EV_FF, 9)); + TEST_NULL_ARG(EVIOCGBIT(EV_PWR, 10)); + TEST_NULL_ARG(EVIOCGBIT(EV_FF_STATUS, 11)); + + ioctl(-1, EVIOCGBIT(EV_MAX, 42), 0); + printf("ioctl(-1, EVIOCGBIT(%#x /* EV_??? */, 42), NULL)" + " = -1 EBADF (%m)\n", EV_MAX); + + ioctl(-1, EVIOCRMFF, lmagic); + printf("ioctl(-1, EVIOCRMFF, %d) = -1 EBADF (%m)\n", (int) lmagic); + + ioctl(-1, EVIOCGRAB, lmagic); + printf("ioctl(-1, EVIOCGRAB, %lu) = -1 EBADF (%m)\n", lmagic); + +# ifdef EVIOCREVOKE + ioctl(-1, EVIOCREVOKE, lmagic); + printf("ioctl(-1, EVIOCREVOKE, %lu) = -1 EBADF (%m)\n", lmagic); +# endif + + const unsigned int size = get_page_size(); + void *const page = tail_alloc(size); + fill_memory(page, size); + + int *const val_int = tail_alloc(sizeof(*val_int)); + *val_int = magic; + +# ifdef EVIOCSCLOCKID + ioctl(-1, EVIOCSCLOCKID, val_int); + printf("ioctl(-1, EVIOCSCLOCKID, [%u]) = -1 EBADF (%m)\n", *val_int); +# endif + + int *pair_int = tail_alloc(sizeof(*pair_int) * 2); + pair_int[0] = 0xdeadbeef; + pair_int[1] = 0xbadc0ded; + +# ifdef EVIOSGREP + ioctl(-1, EVIOCSREP, pair_int); + printf("ioctl(-1, EVIOCSREP, [%u, %u]) = -1 EBADF (%m)\n", + pair_int[0], pair_int[1]); +# endif + + pair_int[1] = 1; + ioctl(-1, EVIOCSKEYCODE, pair_int); + printf("ioctl(-1, EVIOCSKEYCODE, [%u, %s]) = -1 EBADF (%m)\n", + pair_int[0], "KEY_ESC"); + +# ifdef EVIOCSKEYCODE_V2 + struct input_keymap_entry *const ike = tail_alloc(sizeof(*ike)); + fill_memory(ike, sizeof(*ike)); + ike->keycode = 2; + + ioctl(-1, EVIOCSKEYCODE_V2, ike); + printf("ioctl(-1, EVIOCSKEYCODE_V2, {flags=%" PRIu8 + ", len=%" PRIu8 ", ", ike->flags, ike->len); +# if VERBOSE + printf("index=%" PRIu16 ", keycode=%s, scancode=[", + ike->index, "KEY_1"); + unsigned int i; + for (i = 0; i < ARRAY_SIZE(ike->scancode); ++i) { + if (i > 0) + printf(", "); + printf("%" PRIx8, ike->scancode[i]); + } + printf("]"); +# else + printf("..."); +# endif + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); +# endif + + struct ff_effect *const ffe = tail_alloc(sizeof(*ffe)); + fill_memory(ffe, sizeof(*ffe)); + + ffe->type = FF_CONSTANT; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_CONSTANT"); + +# if VERBOSE + printf(", constant={level=%hd", ffe->u.constant.level); + print_envelope(&ffe->u.constant.envelope); + printf("}"); +# else + printf("..."); +# endif + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + +# if VERBOSE + ffe->type = FF_RAMP; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_RAMP"); + printf(", ramp={start_level=%hd, end_level=%hd", + ffe->u.ramp.start_level, ffe->u.ramp.end_level); + print_envelope(&ffe->u.ramp.envelope); + errno = EBADF; + printf("}}) = -1 EBADF (%m)\n"); + + ffe->type = FF_PERIODIC; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_PERIODIC"); + printf(", periodic={waveform=%hu, period=%hu, magnitude=%hd" + ", offset=%hd, phase=%hu", + ffe->u.periodic.waveform, ffe->u.periodic.period, + ffe->u.periodic.magnitude, ffe->u.periodic.offset, + ffe->u.periodic.phase); + print_envelope(&ffe->u.periodic.envelope); + printf(", custom_len=%u, custom_data=%p}", + ffe->u.periodic.custom_len, ffe->u.periodic.custom_data); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + ffe->type = FF_RUMBLE; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "FF_RUMBLE"); + printf(", rumble={strong_magnitude=%hu, weak_magnitude=%hu}", + ffe->u.rumble.strong_magnitude, ffe->u.rumble.weak_magnitude); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + ffe->type = 0xff; + ioctl(-1, EVIOCSFF, ffe); + print_ffe_common(ffe, "0xff /* FF_??? */"); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); +# endif + + ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ, 0x45, 0x1, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_WRITE, 0x45, 0x1, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_WRITE, 0x45, 0x1, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x45, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x45, 0xfe, 0xff)", lmagic); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x45, 0, 0), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x45, 0, 0)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_INPUT_H") + +#endif diff --git a/tests/ioctl_evdev.test b/tests/ioctl_evdev.test new file mode 100755 index 00000000..7ed2e98a --- /dev/null +++ b/tests/ioctl_evdev.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of EVIOC* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_loop-nv.c b/tests/ioctl_loop-nv.c new file mode 100644 index 00000000..dc6b916d --- /dev/null +++ b/tests/ioctl_loop-nv.c @@ -0,0 +1,2 @@ +#define ABBREV 1 +#include "ioctl_loop.c" diff --git a/tests/ioctl_loop-nv.test b/tests/ioctl_loop-nv.test new file mode 100755 index 00000000..dcc27e1d --- /dev/null +++ b/tests/ioctl_loop-nv.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check non-verbose decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -eioctl -e verbose=none $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_loop-v.c b/tests/ioctl_loop-v.c new file mode 100644 index 00000000..22e75727 --- /dev/null +++ b/tests/ioctl_loop-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_loop.c" diff --git a/tests/ioctl_loop-v.test b/tests/ioctl_loop-v.test new file mode 100755 index 00000000..ff3995d8 --- /dev/null +++ b/tests/ioctl_loop-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check non-abbreviated decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -v -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_loop.c b/tests/ioctl_loop.c new file mode 100644 index 00000000..a95e775d --- /dev/null +++ b/tests/ioctl_loop.c @@ -0,0 +1,322 @@ +/* + * This file is part of ioctl_loop strace test. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "xlat/loop_cmds.h" + +#ifndef ABBREV +# define ABBREV 0 +#endif + +static void +print_loop_info(struct loop_info * const info, bool print_encrypt, + const char *encrypt_type, const char *encrypt_key, + const char *flags) +{ +#if ABBREV + printf("%p", info); +#else + printf("{lo_number=%d", info->lo_number); +# if VERBOSE + printf(", lo_device=makedev(%u, %u), lo_inode=%lu, " + "lo_rdevice=makedev(%u, %u)", + major(info->lo_device), minor(info->lo_device), + info->lo_inode, + major(info->lo_rdevice), minor(info->lo_rdevice)); +# endif /* VERBOSE */ + + printf(", lo_offset=%#x", info->lo_offset); + + if (VERBOSE || print_encrypt) { + printf(", lo_encrypt_type="); + if (encrypt_type) + printf("%s", encrypt_type); + else + printf("%#x /* LO_CRYPT_??? */", info->lo_encrypt_type); + + printf(", lo_encrypt_key_size=%" PRIu32, + (uint32_t) info->lo_encrypt_key_size); + } + + printf(", lo_flags="); + if (flags) + printf("%s", flags); + else + printf("%#x /* LO_FLAGS_??? */", info->lo_flags); + + printf(", lo_name=\"%.*s\"", + (int) sizeof(info->lo_name) - 1, info->lo_name); + + if (VERBOSE || print_encrypt) + printf(", lo_encrypt_key=\"%.*s\"", + encrypt_key ? (int) strlen(encrypt_key) : + (int) sizeof(info->lo_encrypt_key), + encrypt_key ? encrypt_key : + (char *) info->lo_encrypt_key); + +# if VERBOSE + printf(", lo_init=[%#lx, %#lx]" + ", reserved=[%#hhx, %#hhx, %#hhx, %#hhx]}", + info->lo_init[0], info->lo_init[1], + info->reserved[0], info->reserved[1], + info->reserved[2], info->reserved[3]); +# else /* !VERBOSE */ + printf(", ...}"); +# endif /* VERBOSE */ +#endif /* !ABBREV */ +} + +static void +print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, + const char *encrypt_type, const char *encrypt_key, + const char *flags) +{ +#if ABBREV + printf("%p", info64); +#else +# if VERBOSE + printf("{lo_device=makedev(%u, %u), lo_inode=%" PRIu64 + ", lo_rdevice=makedev(%u, %u), lo_offset=%#" PRIx64 + ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32, + major(info64->lo_device), minor(info64->lo_device), + (uint64_t) info64->lo_inode, + major(info64->lo_rdevice), minor(info64->lo_rdevice), + (uint64_t) info64->lo_offset, + (uint64_t) info64->lo_sizelimit, + (uint32_t) info64->lo_number); +# else /* !VERBOSE */ + printf("{lo_offset=%#" PRIx64 ", lo_number=%" PRIu32, + (uint64_t) info64->lo_offset, + (uint32_t) info64->lo_number); +# endif /* VERBOSE */ + + if (VERBOSE || print_encrypt) { + printf(", lo_encrypt_type="); + if (encrypt_type) + printf("%s", encrypt_type); + else + printf("%#x /* LO_CRYPT_??? */", + info64->lo_encrypt_type); + + printf(", lo_encrypt_key_size=%" PRIu32, + info64->lo_encrypt_key_size); + } + + printf(", lo_flags="); + if (flags) + printf("%s", flags); + else + printf("%#x /* LO_FLAGS_??? */", info64->lo_flags); + printf(", lo_file_name=\"%.*s\"", + (int) sizeof(info64->lo_file_name) - 1, info64->lo_file_name); + + if (VERBOSE || print_encrypt) + printf(", lo_crypt_name=\"%.*s\", lo_encrypt_key=\"%.*s\"", + (int) sizeof(info64->lo_crypt_name) - 1, + info64->lo_crypt_name, + encrypt_key ? (int) strlen(encrypt_key) : + (int) sizeof(info64->lo_encrypt_key), + encrypt_key ? encrypt_key : + (char *) info64->lo_encrypt_key); + +# if VERBOSE + printf(", lo_init=[%#" PRIx64 ", %#" PRIx64 "]}", + (uint64_t) info64->lo_init[0], + (uint64_t) info64->lo_init[1]); +# else /* !VERBOSE */ + printf(", ...}"); +# endif /* VERBOSE */ +#endif /* !ABBREV */ +} + +int +main(void) +{ + static const kernel_ulong_t unknown_loop_cmd = + (kernel_ulong_t) 0xbadc0dedfeed4cedULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const kernel_ulong_t kernel_mask = + ((kernel_ulong_t) -1) - ((unsigned long) -1L); + + struct loop_info * const info = tail_alloc(sizeof(*info)); + struct loop_info64 * const info64 = tail_alloc(sizeof(*info64)); + + /* Unknown loop commands */ + ioctl(-1, unknown_loop_cmd, magic); + printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x4c, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_loop_cmd) & _IOC_NONE ? + "|_IOC_NONE" : "", + _IOC_NR((unsigned int) unknown_loop_cmd), + _IOC_SIZE((unsigned int) unknown_loop_cmd), + (unsigned long) magic); + + ioctl(-1, LOOP_SET_DIRECT_IO + 1, magic); + printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + "-1 EBADF (%m)\n", + _IOC_NR(LOOP_SET_DIRECT_IO + 1), + _IOC_SIZE(LOOP_SET_DIRECT_IO + 1), + (unsigned long) magic); + + ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); + printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + "-1 EBADF (%m)\n", + _IOC_NR(LOOP_CTL_GET_FREE + 1), + _IOC_SIZE(LOOP_CTL_GET_FREE + 1), + (unsigned long) magic); + + /* LOOP_SET_FD */ + ioctl(-1, LOOP_SET_FD, magic); + printf("ioctl(-1, LOOP_SET_FD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CLR_FD */ + ioctl(-1, LOOP_CLR_FD); + printf("ioctl(-1, LOOP_CLR_FD) = -1 EBADF (%m)\n"); + + /* LOOP_SET_STATUS */ + ioctl(-1, LOOP_SET_STATUS, NULL); + printf("ioctl(-1, LOOP_SET_STATUS, NULL) = -1 EBADF (%m)\n"); + + fill_memory(info, sizeof(*info)); + info->lo_flags = 0xdeface00; + info->lo_name[0] = '\0'; + info->lo_encrypt_key[0] = '\0'; + info->lo_encrypt_key_size = 1; + + printf("ioctl(-1, LOOP_SET_STATUS, "); + print_loop_info(info, true, NULL, "\\0", NULL); + ioctl(-1, LOOP_SET_STATUS, info); + printf(") = -1 EBADF (%m)\n"); + + fill_memory(info, sizeof(*info)); + info->lo_encrypt_type = LO_CRYPT_NONE; + info->lo_flags = LO_FLAGS_READ_ONLY; + memset(info->lo_name, 'A', sizeof(info->lo_name)); + memset(info->lo_encrypt_key, 'B', sizeof(info->lo_encrypt_key)); + + ioctl(-1, LOOP_SET_STATUS, (void *) info + ALIGNOF(info)); + printf("ioctl(-1, LOOP_SET_STATUS, %p) = -1 EBADF (%m)\n", + (void *) info + ALIGNOF(info)); + + printf("ioctl(-1, LOOP_SET_STATUS, "); + print_loop_info(info, false, "LO_CRYPT_NONE", NULL, + "LO_FLAGS_READ_ONLY"); + ioctl(-1, LOOP_SET_STATUS, info); + printf(") = -1 EBADF (%m)\n"); + + /* LOOP_GET_STATUS */ + ioctl(-1, LOOP_GET_STATUS, NULL); + printf("ioctl(-1, LOOP_GET_STATUS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, LOOP_GET_STATUS, (unsigned long) info | kernel_mask); + printf("ioctl(-1, LOOP_GET_STATUS, %p) = -1 EBADF (%m)\n", info); + + /* LOOP_SET_STATUS64 */ + ioctl(-1, LOOP_SET_STATUS64, NULL); + printf("ioctl(-1, LOOP_SET_STATUS64, NULL) = -1 EBADF (%m)\n"); + + fill_memory(info64, sizeof(*info64)); + info64->lo_flags = 0xdec0de00; + info64->lo_file_name[0] = '\0'; + info64->lo_crypt_name[0] = '\0'; + info64->lo_encrypt_key[0] = '\0'; + info64->lo_encrypt_key_size = 1; + + printf("ioctl(-1, LOOP_SET_STATUS64, "); + print_loop_info64(info64, true, NULL, "\\0", NULL); + ioctl(-1, LOOP_SET_STATUS64, info64); + printf(") = -1 EBADF (%m)\n"); + + fill_memory(info64, sizeof(*info64)); + info64->lo_flags = LO_FLAGS_READ_ONLY; + info64->lo_encrypt_type = LO_CRYPT_NONE; + memset(info64->lo_file_name, 'C', sizeof(info64->lo_file_name)); + memset(info64->lo_crypt_name, 'D', sizeof(info64->lo_crypt_name)); + memset(info64->lo_encrypt_key, 'E', sizeof(info64->lo_encrypt_key)); + + ioctl(-1, LOOP_SET_STATUS64, (void *) info64 + ALIGNOF(info64)); + printf("ioctl(-1, LOOP_SET_STATUS64, %p) = -1 EBADF (%m)\n", + (void *) info64 + ALIGNOF(info64)); + + printf("ioctl(-1, LOOP_SET_STATUS64, "); + print_loop_info64(info64, false, "LO_CRYPT_NONE", NULL, + "LO_FLAGS_READ_ONLY"); + ioctl(-1, LOOP_SET_STATUS64, info64); + printf(") = -1 EBADF (%m)\n"); + + /* LOOP_GET_STATUS64 */ + ioctl(-1, LOOP_GET_STATUS64, NULL); + printf("ioctl(-1, LOOP_GET_STATUS64, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, LOOP_GET_STATUS64, (unsigned long) info64 | kernel_mask); + printf("ioctl(-1, LOOP_GET_STATUS64, %p) = -1 EBADF (%m)\n", info64); + + /* LOOP_CHANGE_FD */ + ioctl(-1, LOOP_CHANGE_FD, magic); + printf("ioctl(-1, LOOP_CHANGE_FD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_SET_CAPACITY */ + ioctl(-1, LOOP_SET_CAPACITY); + printf("ioctl(-1, LOOP_SET_CAPACITY) = -1 EBADF (%m)\n"); + + /* LOOP_SET_DIRECT_IO */ + ioctl(-1, LOOP_SET_DIRECT_IO, magic); + printf("ioctl(-1, LOOP_SET_DIRECT_IO, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + + /* LOOP_CTL_ADD */ + ioctl(-1, LOOP_CTL_ADD, magic); + printf("ioctl(-1, LOOP_CTL_ADD, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CTL_REMOVE */ + ioctl(-1, LOOP_CTL_REMOVE, magic); + printf("ioctl(-1, LOOP_CTL_REMOVE, %d) = -1 EBADF (%m)\n", + (unsigned int) magic); + + /* LOOP_CTL_GET_FREE */ + ioctl(-1, LOOP_CTL_GET_FREE); + printf("ioctl(-1, LOOP_CTL_GET_FREE) = -1 EBADF (%m)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_loop.test b/tests/ioctl_loop.test new file mode 100755 index 00000000..112cd636 --- /dev/null +++ b/tests/ioctl_loop.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of LOOP_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a22 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_mtd.c b/tests/ioctl_mtd.c new file mode 100644 index 00000000..a37d5d0f --- /dev/null +++ b/tests/ioctl_mtd.c @@ -0,0 +1,197 @@ +/* + * This file is part of ioctl_mtd strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) +# include "mtd-abi.h" +#else +# include +#endif + +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +#define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + if (_IOC_DIR(cmd) == _IOC_WRITE) \ + printf("ioctl(-1, MIXER_WRITE(%u) or %s, NULL)" \ + " = -1 EBADF (%m)\n", \ + (unsigned int) _IOC_NR(cmd), #cmd); \ + else if (_IOC_DIR(cmd) == _IOC_READ) \ + printf("ioctl(-1, MIXER_READ(%u) or %s, NULL)" \ + " = -1 EBADF (%m)\n", \ + (unsigned int) _IOC_NR(cmd), #cmd); \ + else \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +#define TEST_erase_info_user(cmd, eiu) \ + ioctl(-1, cmd, eiu); \ + printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ + " = -1 EBADF (%m)\n", \ + (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ + (unsigned int) _IOC_NR(cmd), #cmd, \ + eiu->start, eiu->length) + +int +main(void) +{ + TEST_NULL_ARG(ECCGETLAYOUT); + TEST_NULL_ARG(ECCGETSTATS); + TEST_NULL_ARG(MEMERASE); + TEST_NULL_ARG(MEMERASE64); + TEST_NULL_ARG(MEMGETBADBLOCK); + TEST_NULL_ARG(MEMGETINFO); + TEST_NULL_ARG(MEMGETOOBSEL); + TEST_NULL_ARG(MEMGETREGIONCOUNT); + TEST_NULL_ARG(MEMISLOCKED); + TEST_NULL_ARG(MEMLOCK); + TEST_NULL_ARG(MEMREADOOB); + TEST_NULL_ARG(MEMREADOOB64); + TEST_NULL_ARG(MEMSETBADBLOCK); + TEST_NULL_ARG(MEMUNLOCK); + TEST_NULL_ARG(MEMWRITE); + TEST_NULL_ARG(MEMWRITEOOB); + TEST_NULL_ARG(MEMWRITEOOB64); + TEST_NULL_ARG(OTPGETREGIONCOUNT); + TEST_NULL_ARG(OTPGETREGIONINFO); + TEST_NULL_ARG(OTPLOCK); + TEST_NULL_ARG(OTPSELECT); + + ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL); + printf("ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL) = -1 EBADF (%m)\n"); + + int *const opt = tail_alloc(sizeof(*opt)); + *opt = MTD_OTP_OFF; + ioctl(-1, OTPSELECT, opt); + printf("ioctl(-1, MIXER_READ(%u) or OTPSELECT, [MTD_OTP_OFF])" + " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPSELECT)); + + uint64_t *const v64 = tail_alloc(sizeof(*v64)); + fill_memory(v64, sizeof(*v64)); + + ioctl(-1, MEMGETBADBLOCK, v64); + printf("ioctl(-1, MIXER_WRITE(%u) or MEMGETBADBLOCK, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMGETBADBLOCK), *v64); + + ioctl(-1, MEMSETBADBLOCK, v64); + printf("ioctl(-1, MIXER_WRITE(%u) or MEMSETBADBLOCK, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMSETBADBLOCK), *v64); + + struct region_info_user *const riu = tail_alloc(sizeof(*riu)); + fill_memory(riu, sizeof(*riu)); + ioctl(-1, MEMGETREGIONINFO, riu); + printf("ioctl(-1, %s, {regionindex=%#x}) = -1 EBADF (%m)\n", + "MEMGETREGIONINFO" +#ifdef __i386__ + " or MTRRIOC_GET_PAGE_ENTRY" +#endif + , riu->regionindex); + + struct erase_info_user *const eiu = tail_alloc(sizeof(*eiu)); + fill_memory(eiu, sizeof(*eiu)); + + TEST_erase_info_user(MEMERASE, eiu); + TEST_erase_info_user(MEMLOCK, eiu); + TEST_erase_info_user(MEMUNLOCK, eiu); + TEST_erase_info_user(MEMISLOCKED, eiu); + + struct erase_info_user64 *const eiu64 = tail_alloc(sizeof(*eiu64)); + fill_memory(eiu64, sizeof(*eiu64)); + ioctl(-1, MEMERASE64, eiu64); + printf("ioctl(-1, MIXER_WRITE(%u) or %s, {start=%#llx, length=%#llx})" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(MEMERASE64), "MEMERASE64", + (unsigned long long) eiu64->start, + (unsigned long long) eiu64->length); + + struct mtd_oob_buf *const oob = tail_alloc(sizeof(*oob)); + fill_memory(oob, sizeof(*oob)); + + ioctl(-1, MEMWRITEOOB, oob); + printf("ioctl(-1, MEMWRITEOOB, {start=%#x, length=%#x, ptr=%p})" + " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); + + ioctl(-1, MEMREADOOB, oob); + printf("ioctl(-1, MEMREADOOB, {start=%#x, length=%#x, ptr=%p})" + " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); + + struct mtd_oob_buf64 *const oob64 = tail_alloc(sizeof(*oob64)); + fill_memory(oob64, sizeof(*oob64)); + + ioctl(-1, MEMWRITEOOB64, oob64); + printf("ioctl(-1, MEMWRITEOOB64" + ", {start=%#llx, length=%#x, usr_ptr=%#llx}) = -1 EBADF (%m)\n", + (unsigned long long) oob64->start, oob64->length, + (unsigned long long) oob64->usr_ptr); + + ioctl(-1, MEMREADOOB64, oob64); + printf("ioctl(-1, MEMREADOOB64" + ", {start=%#llx, length=%#x, usr_ptr=%#llx}) = -1 EBADF (%m)\n", + (unsigned long long) oob64->start, oob64->length, + (unsigned long long) oob64->usr_ptr); + + + struct otp_info *const oi = tail_alloc(sizeof(*oi)); + fill_memory(oi, sizeof(*oi)); + ioctl(-1, OTPLOCK, oi); + printf("ioctl(-1, MIXER_READ(%u) or OTPLOCK" + ", {start=%#x, length=%#x, locked=%u}) = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(OTPLOCK), oi->start, oi->length, oi->locked); + + struct mtd_write_req *const wr = tail_alloc(sizeof(*wr)); + fill_memory(wr, sizeof(*wr)); + wr->mode = MTD_OPS_PLACE_OOB; + ioctl(-1, MEMWRITE, wr); + printf("ioctl(-1, MEMWRITE, {start=%#llx, len=%#llx, ooblen=%#llx" + ", usr_data=%#llx, usr_oob=%#llx, mode=MTD_OPS_PLACE_OOB})" + " = -1 EBADF (%m)\n", + (unsigned long long) wr->start, + (unsigned long long) wr->len, + (unsigned long long) wr->ooblen, + (unsigned long long) wr->usr_data, + (unsigned long long) wr->usr_oob); + + ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x4d, 0xfe, 0xff), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", + "_IOC(_IOC_READ|_IOC_WRITE, 0x4d, 0xfe, 0xff)", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_mtd.test b/tests/ioctl_mtd.test new file mode 100755 index 00000000..08428073 --- /dev/null +++ b/tests/ioctl_mtd.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of 'M' type ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_rtc-v.c b/tests/ioctl_rtc-v.c new file mode 100644 index 00000000..62b16155 --- /dev/null +++ b/tests/ioctl_rtc-v.c @@ -0,0 +1,3 @@ +/* This file is part of ioctl_rtc-v strace test. */ +#define VERBOSE 1 +#include "ioctl_rtc.c" diff --git a/tests/ioctl_rtc-v.test b/tests/ioctl_rtc-v.test new file mode 100755 index 00000000..a255322d --- /dev/null +++ b/tests/ioctl_rtc-v.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check verbose decoding of RTC_* ioctls. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -veioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_rtc.c b/tests/ioctl_rtc.c new file mode 100644 index 00000000..49d7ec7b --- /dev/null +++ b/tests/ioctl_rtc.c @@ -0,0 +1,207 @@ +/* + * This file is part of ioctl_rtc strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include "xlat.h" + +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; + +static void +print_rtc_time(const struct rtc_time *rt) +{ + printf("{tm_sec=%d, tm_min=%d, tm_hour=%d" + ", tm_mday=%d, tm_mon=%d, tm_year=%d", + rt->tm_sec, rt->tm_min, rt->tm_hour, + rt->tm_mday, rt->tm_mon, rt->tm_year); +#if VERBOSE + printf(", tm_wday=%d, tm_yday=%d, tm_isdst=%d}", + rt->tm_wday, rt->tm_yday, rt->tm_isdst); +#else + printf(", ...}"); +#endif +} + +static struct xlat rtc_argless[] = { + XLAT(RTC_AIE_OFF), + XLAT(RTC_PIE_ON), + XLAT(RTC_PIE_OFF), + XLAT(RTC_UIE_ON), + XLAT(RTC_WIE_ON), + XLAT(RTC_WIE_OFF), +#ifdef RTC_VL_CLR + XLAT(RTC_VL_CLR), +#endif +}; + +int +main(void) +{ + const unsigned int size = get_page_size(); + + void *const page = tail_alloc(size); + fill_memory(page, size); + + struct rtc_time *rt = tail_alloc(sizeof(*rt)); + fill_memory(rt, sizeof(*rt)); + + struct rtc_wkalrm *wk = tail_alloc(sizeof(*wk)); + fill_memory(wk, sizeof(*wk)); + + struct rtc_pll_info *pll = tail_alloc(sizeof(*pll)); + fill_memory(pll, sizeof(*pll)); + + /* RTC_ALM_READ */ + ioctl(-1, RTC_ALM_READ, 0); + printf("ioctl(-1, RTC_ALM_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_ALM_READ, page); + printf("ioctl(-1, RTC_ALM_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_RD_TIME */ + ioctl(-1, RTC_RD_TIME, 0); + printf("ioctl(-1, RTC_RD_TIME, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_RD_TIME, page); + printf("ioctl(-1, RTC_RD_TIME, %p) = -1 EBADF (%m)\n", page); + + /* RTC_ALM_SET */ + ioctl(-1, RTC_ALM_SET, 0); + printf("ioctl(-1, RTC_ALM_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_ALM_SET, rt); + printf("ioctl(-1, RTC_ALM_SET, "); + print_rtc_time(rt); + errno = EBADF; + printf(") = -1 EBADF (%m)\n"); + + /* RTC_SET_TIME */ + ioctl(-1, RTC_SET_TIME, 0); + printf("ioctl(-1, RTC_SET_TIME, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_SET_TIME, rt); + printf("ioctl(-1, RTC_SET_TIME, "); + print_rtc_time(rt); + errno = EBADF; + printf(") = -1 EBADF (%m)\n"); + + /* RTC_IRQP_SET */ + ioctl(-1, RTC_IRQP_SET, lmagic); + printf("ioctl(-1, RTC_IRQP_SET, %lu) = -1 EBADF (%m)\n", lmagic); + + /* RTC_EPOCH_SET */ + ioctl(-1, RTC_EPOCH_SET, lmagic); + printf("ioctl(-1, RTC_EPOCH_SET, %lu) = -1 EBADF (%m)\n", lmagic); + + /* RTC_IRQP_READ */ + ioctl(-1, RTC_IRQP_READ, 0); + printf("ioctl(-1, RTC_IRQP_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_IRQP_READ, page); + printf("ioctl(-1, RTC_IRQP_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_EPOCH_READ */ + ioctl(-1, RTC_EPOCH_READ, 0); + printf("ioctl(-1, RTC_EPOCH_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_EPOCH_READ, page); + printf("ioctl(-1, RTC_EPOCH_READ, %p) = -1 EBADF (%m)\n", page); + + /* RTC_WKALM_RD */ + ioctl(-1, RTC_WKALM_RD, 0); + printf("ioctl(-1, RTC_WKALM_RD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_WKALM_RD, page); + printf("ioctl(-1, RTC_WKALM_RD, %p) = -1 EBADF (%m)\n", page); + + /* RTC_WKALM_SET */ + ioctl(-1, RTC_WKALM_SET, 0); + printf("ioctl(-1, RTC_WKALM_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_WKALM_SET, wk); + printf("ioctl(-1, RTC_WKALM_SET, {enabled=%u, pending=%u, time=", + (unsigned) wk->enabled, (unsigned) wk->pending); + print_rtc_time(&wk->time); + errno = EBADF; + printf("}) = -1 EBADF (%m)\n"); + + /* RTC_PLL_GET */ + ioctl(-1, RTC_PLL_GET, 0); + printf("ioctl(-1, RTC_PLL_GET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_PLL_GET, page); + printf("ioctl(-1, RTC_PLL_GET, %p) = -1 EBADF (%m)\n", page); + + /* RTC_PLL_SET */ + ioctl(-1, RTC_PLL_SET, 0); + printf("ioctl(-1, RTC_PLL_SET, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_PLL_SET, pll); + printf("ioctl(-1, RTC_PLL_SET, {pll_ctrl=%d, pll_value=%d" + ", pll_max=%d, pll_min=%d, pll_posmult=%d, pll_negmult=%d" + ", pll_clock=%ld}) = -1 EBADF (%m)\n", + pll->pll_ctrl, pll->pll_value, pll->pll_max, pll->pll_min, + pll->pll_posmult, pll->pll_negmult, pll->pll_clock); + +#ifdef RTC_VL_READ + /* RTC_VL_READ */ + ioctl(-1, RTC_VL_READ, 0); + printf("ioctl(-1, RTC_VL_READ, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, RTC_VL_READ, page); + printf("ioctl(-1, RTC_VL_READ, %p) = -1 EBADF (%m)\n", page); +#endif + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(rtc_argless); ++i) { + ioctl(-1, (unsigned long) rtc_argless[i].val, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", rtc_argless[i].str); + } + + ioctl(-1, RTC_UIE_OFF, lmagic); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "PHN_NOT_OH or RTC_UIE_OFF"); + + ioctl(-1, RTC_AIE_ON, lmagic); +#ifdef HPPA + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "PA_PERF_ON or RTC_AIE_ON"); +#else + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", "RTC_AIE_ON"); +#endif + + ioctl(-1, _IO(0x70, 0x40), lmagic); + printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", "NVRAM_INIT", lmagic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_rtc.test b/tests/ioctl_rtc.test new file mode 100755 index 00000000..4545f2ae --- /dev/null +++ b/tests/ioctl_rtc.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic decoding of RTC_* ioctls. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_scsi.c b/tests/ioctl_scsi.c new file mode 100644 index 00000000..0db94d84 --- /dev/null +++ b/tests/ioctl_scsi.c @@ -0,0 +1,156 @@ +/* + * Check decoding of SCSI ioctl commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SCSI_SG_H + +# include +# include +# include +# include "xlat/scsi_sg_commands.h" + +# define TEST_NO_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0xdeadbeef); \ + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +# define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) + +# define TEST_TAKES_INT_BY_VAL(cmd, val) \ + do { \ + ioctl(-1, cmd, val); \ + printf("ioctl(-1, %s, %#x) = -1 EBADF (%m)\n", #cmd, val); \ + } while (0) + +# define TEST_TAKES_INT_BY_PTR(cmd, pint) \ + do { \ + ioctl(-1, cmd, pint); \ + printf("ioctl(-1, %s, [%d]) = -1 EBADF (%m)\n", #cmd, *(pint)); \ + } while (0) + +# define TEST_RETURNS_INT_BY_PTR(cmd, pint) \ + do { \ + ioctl(-1, cmd, pint); \ + printf("ioctl(-1, %s, %p) = -1 EBADF (%m)\n", #cmd, pint); \ + } while (0) + +int +main(void) +{ + int *const pint = tail_alloc(sizeof(*pint)); + *pint = (int) 0xfacefeed; + + TEST_NO_ARG(SG_GET_TIMEOUT); + + TEST_NULL_ARG(SG_SET_TIMEOUT); + TEST_NULL_ARG(SG_EMULATED_HOST); + TEST_NULL_ARG(SG_GET_TRANSFORM); + TEST_NULL_ARG(SG_GET_COMMAND_Q); + TEST_NULL_ARG(SG_SET_COMMAND_Q); + TEST_NULL_ARG(SG_GET_RESERVED_SIZE); + TEST_NULL_ARG(SG_SET_RESERVED_SIZE); + TEST_NULL_ARG(SG_GET_SCSI_ID); + TEST_NULL_ARG(SG_SET_FORCE_LOW_DMA); + TEST_NULL_ARG(SG_GET_LOW_DMA); + TEST_NULL_ARG(SG_SET_FORCE_PACK_ID); + TEST_NULL_ARG(SG_GET_PACK_ID); + TEST_NULL_ARG(SG_GET_NUM_WAITING); + TEST_NULL_ARG(SG_SET_DEBUG); + TEST_NULL_ARG(SG_GET_SG_TABLESIZE); + TEST_NULL_ARG(SG_GET_VERSION_NUM); + TEST_NULL_ARG(SG_NEXT_CMD_LEN); + TEST_NULL_ARG(SG_SCSI_RESET); + TEST_NULL_ARG(SG_IO); + TEST_NULL_ARG(SG_GET_REQUEST_TABLE); + TEST_NULL_ARG(SG_SET_KEEP_ORPHAN); + TEST_NULL_ARG(SG_GET_KEEP_ORPHAN); + TEST_NULL_ARG(SG_GET_ACCESS_COUNT); + + TEST_TAKES_INT_BY_VAL(SG_SET_TRANSFORM, 0); + TEST_TAKES_INT_BY_VAL(SG_SET_TRANSFORM, *pint); + + TEST_TAKES_INT_BY_PTR(SG_NEXT_CMD_LEN, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_COMMAND_Q, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_DEBUG, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_FORCE_LOW_DMA, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_FORCE_PACK_ID, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_KEEP_ORPHAN, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_RESERVED_SIZE, pint); + TEST_TAKES_INT_BY_PTR(SG_SET_TIMEOUT, pint); + + TEST_RETURNS_INT_BY_PTR(SG_EMULATED_HOST, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_ACCESS_COUNT, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_COMMAND_Q, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_KEEP_ORPHAN, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_LOW_DMA, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_NUM_WAITING, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_PACK_ID, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_RESERVED_SIZE, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_SG_TABLESIZE, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_TRANSFORM, pint); + TEST_RETURNS_INT_BY_PTR(SG_GET_VERSION_NUM, pint); + + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [%#x /* %s_??? */]) = -1 EBADF (%m)\n", + "SG_SCSI_RESET", *pint, "SG_SCSI_RESET"); + + *pint = 0x100; + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [SG_SCSI_RESET_NO_ESCALATE|SG_SCSI_RESET_NOTHING])" + " = -1 EBADF (%m)\n", "SG_SCSI_RESET"); + + *pint = 1; + ioctl(-1, SG_SCSI_RESET, pint); + printf("ioctl(-1, %s, [SG_SCSI_RESET_DEVICE]) = -1 EBADF (%m)\n", + "SG_SCSI_RESET"); + + ioctl(-1, 0x22ff, 0); + printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n"); + + static const unsigned long magic = + (unsigned long) 0xdeadbeeffacefeedULL; + ioctl(-1, 0x22ff, magic); + printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", + magic); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SCSI_SG_H") + +#endif diff --git a/tests/ioctl_scsi.test b/tests/ioctl_scsi.test new file mode 100755 index 00000000..2710f12b --- /dev/null +++ b/tests/ioctl_scsi.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of SCSI ioctl commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sg_io_v3.c b/tests/ioctl_sg_io_v3.c new file mode 100644 index 00000000..ef25795b --- /dev/null +++ b/tests/ioctl_sg_io_v3.c @@ -0,0 +1,418 @@ +/* + * Check decoding of ioctl SG_IO v3 commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SCSI_SG_H + +# include +# include +# include +# include +# include + +int +main(void) +{ + ioctl(-1, SG_IO, 0); + printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); + + struct sg_io_hdr *const sg_io = tail_alloc(sizeof(*sg_io)); + fill_memory(sg_io, sizeof(*sg_io)); + + const void *const efault = sg_io + 1; + ioctl(-1, SG_IO, efault); + printf("ioctl(-1, SG_IO, %p) = -1 EBADF (%m)\n", efault); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->interface_id); + + unsigned int *const piid = tail_alloc(sizeof(*piid)); + *piid = (unsigned char) 'S'; + ioctl(-1, SG_IO, piid); + printf("ioctl(-1, SG_IO, {interface_id='S', %p}) = -1 EBADF (%m)\n", piid + 1); + + sg_io->interface_id = (unsigned char) 'S'; + sg_io->dxfer_direction = -2; + sg_io->flags = -1U; + sg_io->info = -1U; + sg_io->dxferp = (void *) (unsigned long) 0xfacefeedfffffff1ULL; + sg_io->cmdp = (void *) (unsigned long) 0xfacefeedfffffff2ULL; + sg_io->sbp = (void *) (unsigned long) 0xfacefeedfffffff3ULL; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_UNUSED_LUN_INHIBIT" + "|SG_FLAG_MMAP_IO|SG_FLAG_NO_DXFER" + "|SG_FLAG_Q_AT_TAIL|SG_FLAG_Q_AT_HEAD|0xfffeffc8" + ", dxferp=%p" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + sg_io->dxferp, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->dxfer_direction = -3; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_UNUSED_LUN_INHIBIT" + "|SG_FLAG_MMAP_IO|SG_FLAG_NO_DXFER" + "|SG_FLAG_Q_AT_TAIL|SG_FLAG_Q_AT_HEAD|0xfffeffc8" + ", dxferp=%p" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + sg_io->dxferp, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + const struct iovec iov[] = { + { + .iov_base = (void *) efault - 2, + .iov_len = 2 + }, { + .iov_base = (void *) efault - 3, + .iov_len = 4 + } + }; + struct iovec *const t_iov = tail_memdup(iov, sizeof(iov)); + + sg_io->flags = 0x24; + sg_io->info = 1; + sg_io->dxfer_direction = -2; + + sg_io->iovec_count = ARRAY_SIZE(iov); + sg_io->dxfer_len = iov[0].iov_len + iov[1].iov_len - 1; + sg_io->dxferp = t_iov; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_MMAP_IO|SG_FLAG_Q_AT_HEAD" + ", dxferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0x11; + sg_io->dxfer_direction = -3; + sg_io->resid = sg_io->dxfer_len + 1; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_DIRECT_IO|SG_FLAG_Q_AT_TAIL" + ", dxferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0x10000; + sg_io->info = 0xdeadbeef; + sg_io->iovec_count = 0; + sg_io->dxfer_len = 5; + sg_io->resid = 1; + sg_io->dxferp = (void *) efault - (sg_io->dxfer_len - sg_io->resid); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_NO_DXFER" + ", dxferp=\"\\x%x\\x%x\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + * (unsigned char *) (sg_io->dxferp + 3), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 2; + sg_io->dxfer_direction = -4; + sg_io->dxfer_len = 3; + sg_io->resid = 1; + sg_io->dxferp = (void *) efault - sg_io->dxfer_len; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=SG_FLAG_UNUSED_LUN_INHIBIT" + ", dxferp=\"\\x%x\\x%x\\x%x\" => dxferp=\"\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + sg_io->flags = 0; + sg_io->resid = sg_io->dxfer_len; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {interface_id='S'" + ", dxfer_direction=SG_DXFER_TO_FROM_DEV" + ", cmd_len=%u" + ", cmdp=%p" + ", mx_sb_len=%u" + ", iovec_count=%u" + ", dxfer_len=%u" + ", timeout=%u" + ", flags=0" + ", dxferp=\"\\x%x\\x%x\\x%x\"" + ", status=%#x" + ", masked_status=%#x" + ", msg_status=%#x" + ", sb_len_wr=%u" + ", sbp=%p" + ", host_status=%#x" + ", driver_status=%#x" + ", resid=%d" + ", duration=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xdeadbee8" + "}) = -1 EBADF (%m)\n", + sg_io->cmd_len, + sg_io->cmdp, + sg_io->mx_sb_len, + sg_io->iovec_count, + sg_io->dxfer_len, + sg_io->timeout, + * (unsigned char *) (sg_io->dxferp + 0), + * (unsigned char *) (sg_io->dxferp + 1), + * (unsigned char *) (sg_io->dxferp + 2), + sg_io->status, + sg_io->masked_status, + sg_io->msg_status, + sg_io->sb_len_wr, + sg_io->sbp, + sg_io->host_status, + sg_io->driver_status, + sg_io->resid, + sg_io->duration); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SCSI_SG_H") + +#endif diff --git a/tests/ioctl_sg_io_v3.test b/tests/ioctl_sg_io_v3.test new file mode 100755 index 00000000..dacacdf4 --- /dev/null +++ b/tests/ioctl_sg_io_v3.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of ioctl SG_IO v3 commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sg_io_v4.c b/tests/ioctl_sg_io_v4.c new file mode 100644 index 00000000..5f899eee --- /dev/null +++ b/tests/ioctl_sg_io_v4.c @@ -0,0 +1,238 @@ +/* + * Check decoding of ioctl SG_IO v4 commands. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_BSG_H + +# include +# include +# include +# include +# include + +# include "xlat/scsi_sg_commands.h" + +int +main(void) +{ + ioctl(-1, SG_IO, 0); + printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); + + struct sg_io_v4 *const sg_io = tail_alloc(sizeof(*sg_io)); + fill_memory(sg_io, sizeof(*sg_io)); + + const void *const efault = sg_io + 1; + ioctl(-1, SG_IO, efault); + printf("ioctl(-1, SG_IO, %p) = -1 EBADF (%m)\n", efault); + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->guard); + + unsigned int *const pguard = tail_alloc(sizeof(*pguard)); + *pguard = (unsigned char) 'Q'; + ioctl(-1, SG_IO, pguard); + printf("ioctl(-1, SG_IO, {guard='Q', %p}) = -1 EBADF (%m)\n", pguard + 1); + + sg_io->guard = (unsigned char) 'Q'; + sg_io->protocol = 0; + sg_io->subprotocol = 1; + sg_io->flags = -1U; + sg_io->info = -1U; + sg_io->request = (kernel_ulong_t) 0xfacefeedfffffff1ULL; + sg_io->response = (kernel_ulong_t) 0xfacefeedfffffff2ULL; + sg_io->dout_xferp = (kernel_ulong_t) 0xfacefeedfffffff3ULL; + sg_io->din_xferp = (kernel_ulong_t) 0xfacefeedfffffff4ULL; + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {guard='Q'" + ", protocol=BSG_PROTOCOL_SCSI" + ", subprotocol=BSG_SUB_PROTOCOL_SCSI_TMF" + ", request_len=%u" + ", request=%#llx" + ", request_tag=%#" PRI__x64 + ", request_attr=%u" + ", request_priority=%u" + ", request_extra=%u" + ", max_response_len=%u" + ", dout_iovec_count=%u" + ", dout_xfer_len=%u" + ", din_iovec_count=%u" + ", din_xfer_len=%u" + ", dout_xferp=%#llx" + ", timeout=%u" + ", flags=BSG_FLAG_Q_AT_TAIL|BSG_FLAG_Q_AT_HEAD|0xffffffcf" + ", usr_ptr=%#" PRI__x64 + ", response_len=%u" + ", response=%#llx" + ", din_xferp=%#llx" + ", driver_status=%#x" + ", transport_status=%#x" + ", device_status=%#x" + ", retry_delay=%u" + ", info=SG_INFO_CHECK|SG_INFO_DIRECT_IO|SG_INFO_MIXED_IO|0xfffffff8" + ", duration=%u" + ", response_len=%u" + ", din_resid=%d" + ", dout_resid=%d" + ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", + sg_io->request_len, + (unsigned long long) (kernel_ulong_t) sg_io->request, + sg_io->request_tag, + sg_io->request_attr, + sg_io->request_priority, + sg_io->request_extra, + sg_io->max_response_len, + sg_io->dout_iovec_count, + sg_io->dout_xfer_len, + sg_io->din_iovec_count, + sg_io->din_xfer_len, + (unsigned long long) (kernel_ulong_t) sg_io->dout_xferp, + sg_io->timeout, + sg_io->usr_ptr, + sg_io->response_len, + (unsigned long long) (kernel_ulong_t) sg_io->response, + (unsigned long long) (kernel_ulong_t) sg_io->din_xferp, + sg_io->driver_status, + sg_io->transport_status, + sg_io->device_status, + sg_io->retry_delay, + sg_io->duration, + sg_io->response_len, + sg_io->din_resid, + sg_io->dout_resid, + sg_io->generated_tag); + + const struct iovec iov[] = { + { + .iov_base = (void *) efault - 2, + .iov_len = 2 + }, { + .iov_base = (void *) efault - 3, + .iov_len = 4 + } + }; + const struct iovec *const t_iov = tail_memdup(iov, sizeof(iov)); + sg_io->dout_iovec_count = ARRAY_SIZE(iov); + sg_io->dout_xfer_len = iov[0].iov_len + iov[1].iov_len - 1; + sg_io->dout_xferp = (unsigned long) t_iov; + + sg_io->din_iovec_count = 0; + sg_io->din_xfer_len = 5; + sg_io->din_resid = 1; + sg_io->din_xferp = (unsigned long) efault - + (sg_io->dout_xfer_len - sg_io->din_resid); + + sg_io->request_len = 3; + sg_io->request = (unsigned long) efault - sg_io->request_len; + sg_io->response_len = 2; + sg_io->response = (unsigned long) efault - sg_io->response_len; + + sg_io->flags = 0x20; + sg_io->info = 1; + + ioctl(-1, SG_IO, sg_io); + printf("ioctl(-1, SG_IO, {guard='Q'" + ", protocol=BSG_PROTOCOL_SCSI" + ", subprotocol=BSG_SUB_PROTOCOL_SCSI_TMF" + ", request_len=%u" + ", request=\"\\x%x\\x%x\\x%x\"" + ", request_tag=%#" PRI__x64 + ", request_attr=%u" + ", request_priority=%u" + ", request_extra=%u" + ", max_response_len=%u" + ", dout_iovec_count=%u" + ", dout_xfer_len=%u" + ", din_iovec_count=%u" + ", din_xfer_len=%u" + ", dout_xferp=[{iov_base=\"\\%o\\%o\", iov_len=%u}" + ", {iov_base=\"\\%o\\%o\\%o\", iov_len=%u}]" + ", timeout=%u, flags=BSG_FLAG_Q_AT_HEAD" + ", usr_ptr=%#" PRI__x64 + ", response_len=%u" + ", response=\"\\x%x\\x%x\"" + ", din_xferp=\"\\x%x\\x%x\\x%x\\x%x\"" + ", driver_status=%#x" + ", transport_status=%#x" + ", device_status=%#x" + ", retry_delay=%u" + ", info=SG_INFO_CHECK" + ", duration=%u" + ", response_len=%u" + ", din_resid=%d" + ", dout_resid=%d" + ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", + sg_io->request_len, + * (unsigned char *) ((unsigned long) sg_io->request + 0), + * (unsigned char *) ((unsigned long) sg_io->request + 1), + * (unsigned char *) ((unsigned long) sg_io->request + 2), + sg_io->request_tag, + sg_io->request_attr, + sg_io->request_priority, + sg_io->request_extra, + sg_io->max_response_len, + sg_io->dout_iovec_count, + sg_io->dout_xfer_len, + sg_io->din_iovec_count, + sg_io->din_xfer_len, + * (unsigned char *) (iov[0].iov_base + 0), + * (unsigned char *) (iov[0].iov_base + 1), + (unsigned int) iov[0].iov_len, + * (unsigned char *) (iov[1].iov_base + 0), + * (unsigned char *) (iov[1].iov_base + 1), + * (unsigned char *) (iov[1].iov_base + 2), + (unsigned int) iov[1].iov_len, + sg_io->timeout, + sg_io->usr_ptr, + sg_io->response_len, + * (unsigned char *) ((unsigned long) sg_io->response + 0), + * (unsigned char *) ((unsigned long) sg_io->response + 1), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 0), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 1), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 2), + * (unsigned char *) ((unsigned long) sg_io->din_xferp + 3), + sg_io->driver_status, + sg_io->transport_status, + sg_io->device_status, + sg_io->retry_delay, + sg_io->duration, + sg_io->response_len, + sg_io->din_resid, + sg_io->dout_resid, + sg_io->generated_tag); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_BSG_H") + +#endif diff --git a/tests/ioctl_sg_io_v4.test b/tests/ioctl_sg_io_v4.test new file mode 100755 index 00000000..25567224 --- /dev/null +++ b/tests/ioctl_sg_io_v4.test @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check decoding of ioctl SG_IO v4 commands. +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sock_gifconf.c b/tests/ioctl_sock_gifconf.c new file mode 100644 index 00000000..ae0bea4f --- /dev/null +++ b/tests/ioctl_sock_gifconf.c @@ -0,0 +1,182 @@ +/* + * Check decoding of SIOCGIFCONF command of ioctl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_STRLEN 1 + +static void +print_ifc_len(int val) +{ + if (val % (int) sizeof(struct ifreq)) + printf("%d", val); + else + printf("%d * sizeof(struct ifreq)", + val / (int) sizeof(struct ifreq)); +} + +static void +print_ifconf(struct ifconf *ifc, int in_len, char *in_buf, long rc) +{ + if (in_buf) { + printf("{ifc_len="); + print_ifc_len(in_len); + + if (in_len != ifc->ifc_len) { + printf(" => "); + print_ifc_len(ifc->ifc_len); + } + } else { + printf("{ifc_len="); + print_ifc_len(ifc->ifc_len); + } + + printf(", ifc_buf="); + + if ((rc < 0) || !in_buf) { + if (in_buf) + printf("%p", in_buf); + else + printf("NULL"); + } else { + int i; + + printf("["); + for (i = 0; i < (ifc->ifc_len) && + i < (int) (MAX_STRLEN * sizeof(struct ifreq)); + i += sizeof(struct ifreq)) { + struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); + struct sockaddr_in *const sa_in = + (struct sockaddr_in *) &(ifr->ifr_addr); + + if (i) + printf(", "); + printf("{ifr_name=\"%s\", ifr_addr={sa_family=AF_INET, " + "sin_port=htons(%u), sin_addr=inet_addr(\"%s\")}" + "}", ifr->ifr_name, ntohs(sa_in->sin_port), + inet_ntoa(sa_in->sin_addr)); + } + + if ((size_t) (ifc->ifc_len - i) >= sizeof(struct ifreq)) + printf(", ..."); + + printf("]"); + } + + printf("}"); +} + +static void +gifconf_ioctl(int fd, struct ifconf *ifc, bool ifc_valid) +{ + const char * errstr; + int in_len; + char *in_buf; + long rc; + + if (ifc_valid) { + in_len = ifc->ifc_len; + in_buf = ifc->ifc_buf; + } + + rc = ioctl(fd, SIOCGIFCONF, ifc); + errstr = sprintrc(rc); + + printf("ioctl(%d, SIOCGIFCONF, ", fd); + if (ifc_valid) { + print_ifconf(ifc, in_len, in_buf, rc); + } else { + if (ifc) + printf("%p", ifc); + else + printf("NULL"); + } + + printf(") = %s\n", errstr); +} + +int +main(int argc, char *argv[]) +{ + struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); + struct ifconf *ifc = tail_alloc(sizeof(*ifc)); + + struct sockaddr_in addr; + int fd; + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) + perror_msg_and_skip("socket AF_INET"); + + gifconf_ioctl(fd, NULL, false); + gifconf_ioctl(fd, ifc + 1, false); + + ifc->ifc_len = 3141592653U; + ifc->ifc_buf = NULL; + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 0; + ifc->ifc_buf = (char *) (ifr + 2); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 1; + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 1 * sizeof(*ifr); + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 2 * sizeof(*ifr); + ifc->ifc_buf = (char *) (ifr + 1); + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 2 * sizeof(*ifr) + 2; + ifc->ifc_buf = (char *) ifr; + gifconf_ioctl(fd, ifc, true); + + ifc->ifc_len = 3 * sizeof(*ifr) + 4; + ifc->ifc_buf = (char *) ifr; + gifconf_ioctl(fd, ifc, true); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_sock_gifconf.test b/tests/ioctl_sock_gifconf.test new file mode 100755 index 00000000..2e2fc019 --- /dev/null +++ b/tests/ioctl_sock_gifconf.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of SIOCGIFCONF ioctl. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a28 -s1 -eioctl $args > "$EXP" +check_prog grep +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_uffdio.c b/tests/ioctl_uffdio.c new file mode 100644 index 00000000..10b8b843 --- /dev/null +++ b/tests/ioctl_uffdio.c @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Red Hat, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_userfaultfd && defined HAVE_LINUX_USERFAULTFD_H + +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +int +main(void) +{ + int rc; + int fd = syscall(__NR_userfaultfd, O_NONBLOCK); + size_t pagesize = getpagesize(); + + if (fd < 0) + perror_msg_and_skip("userfaultfd"); + + /* ---- API ---- */ + struct uffdio_api *api_struct = tail_alloc(sizeof(*api_struct)); + + /* With a bad fd */ + memset(api_struct, 0, sizeof(*api_struct)); + rc = ioctl(-1, UFFDIO_API, api_struct); + printf("ioctl(-1, UFFDIO_API, {api=0, features=0}) = %d %s (%m)\n", + rc, errno2name()); + /* With a bad pointer */ + rc = ioctl(fd, UFFDIO_API, NULL); + printf("ioctl(%d, UFFDIO_API, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + /* Normal call */ + api_struct->api = UFFD_API; + api_struct->features = 0; + rc = ioctl(fd, UFFDIO_API, api_struct); + printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0, " + "features.out=%#" PRIx64 ", " "ioctls=1<<_UFFDIO_REGISTER|" + "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API", + fd, (uint64_t)api_struct->features); + api_struct->ioctls &= ~(1ull<<_UFFDIO_REGISTER| + 1ull<<_UFFDIO_UNREGISTER| + 1ull<<_UFFDIO_API); + if (api_struct->ioctls) + printf("|%#" PRIx64, (uint64_t)api_struct->ioctls); + printf("}) = %d\n", rc); + + /* For the rest of the tests we need some anonymous memory */ + void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1, 0); + if (area1 == MAP_FAILED) + perror_msg_and_fail("mmap area1"); + void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1, 0); + if (area2 == MAP_FAILED) + perror_msg_and_fail("mmap area2"); + madvise(area2, pagesize, MADV_DONTNEED); + *(char *)area1 = 42; + + /* ---- REGISTER ---- */ + struct uffdio_register *register_struct = + tail_alloc(sizeof(*register_struct)); + memset(register_struct, 0, sizeof(*register_struct)); + + rc = ioctl(-1, UFFDIO_REGISTER, register_struct); + printf("ioctl(-1, UFFDIO_REGISTER, {range={start=0, len=0}, " + "mode=0}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_REGISTER, NULL); + printf("ioctl(%d, UFFDIO_REGISTER, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + register_struct->range.start = (uint64_t)(uintptr_t)area2; + register_struct->range.len = pagesize; + register_struct->mode = UFFDIO_REGISTER_MODE_MISSING; + rc = ioctl(fd, UFFDIO_REGISTER, register_struct); + printf("ioctl(%d, UFFDIO_REGISTER, {range={start=%p, len=%#zx}, " + "mode=UFFDIO_REGISTER_MODE_MISSING, ioctls=" + "1<<_UFFDIO_WAKE|1<<_UFFDIO_COPY|1<<_UFFDIO_ZEROPAGE", + fd, area2, pagesize); + register_struct->ioctls &= ~(1ull<<_UFFDIO_WAKE| + 1ull<<_UFFDIO_COPY| + 1ull<<_UFFDIO_ZEROPAGE); + if (register_struct->ioctls) + printf("|%#" PRIx64, (uint64_t)register_struct->ioctls); + printf("}) = %d\n", rc); + + /* With area2 registered we can now do the atomic copies onto it + * but be careful not to access it in any other way otherwise + * userfaultfd will cause us to stall. + */ + /* ---- COPY ---- */ + struct uffdio_copy *copy_struct = tail_alloc(sizeof(*copy_struct)); + + memset(copy_struct, 0, sizeof(*copy_struct)); + rc = ioctl(-1, UFFDIO_COPY, copy_struct); + printf("ioctl(-1, UFFDIO_COPY, {dst=0, src=0, len=0, mode=0" + "}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_COPY, NULL); + printf("ioctl(%d, UFFDIO_COPY, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + copy_struct->dst = (uint64_t)(uintptr_t)area2; + copy_struct->src = (uint64_t)(uintptr_t)area1; + copy_struct->len = pagesize; + copy_struct->mode = UFFDIO_COPY_MODE_DONTWAKE; + rc = ioctl(fd, UFFDIO_COPY, copy_struct); + printf("ioctl(%d, UFFDIO_COPY, {dst=%p, src=%p, len=%#zx," + " mode=UFFDIO_COPY_MODE_DONTWAKE, copy=%#zx}) = %d\n", + fd, area2, area1, pagesize, pagesize, rc); + + /* ---- ZEROPAGE ---- */ + struct uffdio_zeropage *zero_struct = tail_alloc(sizeof(*zero_struct)); + madvise(area2, pagesize, MADV_DONTNEED); + + memset(zero_struct, 0, sizeof(*zero_struct)); + rc = ioctl(-1, UFFDIO_ZEROPAGE, zero_struct); + printf("ioctl(-1, UFFDIO_ZEROPAGE, {range={start=0, len=0}, mode=0" + "}) = %d %s (%m)\n", rc, errno2name()); + + rc = ioctl(fd, UFFDIO_ZEROPAGE, NULL); + printf("ioctl(%d, UFFDIO_ZEROPAGE, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + zero_struct->range.start = (uint64_t)(uintptr_t)area2; + zero_struct->range.len = pagesize; + zero_struct->mode = UFFDIO_ZEROPAGE_MODE_DONTWAKE; + rc = ioctl(fd, UFFDIO_ZEROPAGE, zero_struct); + printf("ioctl(%d, UFFDIO_ZEROPAGE, {range={start=%p, len=%#zx}," + " mode=UFFDIO_ZEROPAGE_MODE_DONTWAKE, zeropage=%#zx}) = %d\n", + fd, area2, pagesize, pagesize, rc); + + /* ---- WAKE ---- */ + struct uffdio_range *range_struct = tail_alloc(sizeof(*range_struct)); + memset(range_struct, 0, sizeof(*range_struct)); + + rc = ioctl(-1, UFFDIO_WAKE, range_struct); + printf("ioctl(-1, UFFDIO_WAKE, {start=0, len=0}) = %d %s (%m)\n", + rc, errno2name()); + + rc = ioctl(fd, UFFDIO_WAKE, NULL); + printf("ioctl(%d, UFFDIO_WAKE, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + range_struct->start = (uint64_t)(uintptr_t)area2; + range_struct->len = pagesize; + rc = ioctl(fd, UFFDIO_WAKE, range_struct); + printf("ioctl(%d, UFFDIO_WAKE, {start=%p, len=%#zx}) = %d\n", + fd, area2, pagesize, rc); + + /* ---- UNREGISTER ---- */ + memset(range_struct, 0, sizeof(*range_struct)); + + rc = ioctl(-1, UFFDIO_UNREGISTER, range_struct); + printf("ioctl(-1, UFFDIO_UNREGISTER, {start=0, len=0}) = %d %s (%m)\n", + rc, errno2name()); + + rc = ioctl(fd, UFFDIO_UNREGISTER, NULL); + printf("ioctl(%d, UFFDIO_UNREGISTER, NULL) = %d %s (%m)\n", + fd, rc, errno2name()); + + range_struct->start = (uint64_t)(uintptr_t)area2; + range_struct->len = pagesize; + rc = ioctl(fd, UFFDIO_UNREGISTER, range_struct); + printf("ioctl(%d, UFFDIO_UNREGISTER, {start=%p, len=%#zx}) = %d\n", + fd, area2, pagesize, rc); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_userfaultfd && HAVE_LINUX_USERFAULTFD_H") + +#endif diff --git a/tests/ioctl_uffdio.test b/tests/ioctl_uffdio.test new file mode 100755 index 00000000..fae9b556 --- /dev/null +++ b/tests/ioctl_uffdio.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check userfaultfd ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_v4l2.c b/tests/ioctl_v4l2.c new file mode 100644 index 00000000..af8c3419 --- /dev/null +++ b/tests/ioctl_v4l2.c @@ -0,0 +1,551 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#if WORDS_BIGENDIAN +# define cc0(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +# define cc3(arg) ((unsigned int) (unsigned char) (arg)) +# define fourcc(a0, a1, a2, a3) \ + ((unsigned int)(a3) | \ + ((unsigned int)(a2) << 8) | \ + ((unsigned int)(a1) << 16) | \ + ((unsigned int)(a0) << 24)) +#else +# define cc0(arg) ((unsigned int) (unsigned char) (arg)) +# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +# define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +# define fourcc(a0, a1, a2, a3) \ + ((unsigned int)(a0) | \ + ((unsigned int)(a1) << 8) | \ + ((unsigned int)(a2) << 16) | \ + ((unsigned int)(a3) << 24)) +#endif + +static const unsigned int magic = 0xdeadbeef; + +int +main(void ) +{ + const unsigned int size = get_page_size(); + void *const page = tail_alloc(size); + fill_memory(page, size); + + unsigned char cc[sizeof(int)] = { 'A', '\'', '\\', '\xfa' }; + + /* VIDIOC_QUERYCAP */ + ioctl(-1, VIDIOC_QUERYCAP, 0); + printf("ioctl(-1, VIDIOC_QUERYCAP, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_QUERYCAP, page); + printf("ioctl(-1, VIDIOC_QUERYCAP, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_ENUM_FMT */ + ioctl(-1, VIDIOC_ENUM_FMT, 0); + printf("ioctl(-1, VIDIOC_ENUM_FMT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_fmtdesc *const p_fmtdesc = tail_alloc(sizeof(*p_fmtdesc)); + p_fmtdesc->index = magic; + p_fmtdesc->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + ioctl(-1, VIDIOC_ENUM_FMT, p_fmtdesc); + printf("ioctl(-1, VIDIOC_ENUM_FMT, {index=%u" + ", type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n", + p_fmtdesc->index); + + /* VIDIOC_G_FMT */ + ioctl(-1, VIDIOC_G_FMT, 0); + printf("ioctl(-1, VIDIOC_G_FMT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_format *const p_format = tail_alloc(sizeof(*p_format)); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n"); + + /* VIDIOC_S_FMT */ + ioctl(-1, VIDIOC_S_FMT, 0); + printf("ioctl(-1, VIDIOC_S_FMT, NULL) = -1 EBADF (%m)\n"); + + p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + p_format->fmt.pix.width = 0xdad1beaf; + p_format->fmt.pix.height = 0xdad2beaf; + p_format->fmt.pix.pixelformat = magic; + p_format->fmt.pix.field = V4L2_FIELD_NONE; + p_format->fmt.pix.bytesperline = 0xdad3beaf; + p_format->fmt.pix.sizeimage = 0xdad4beaf; + p_format->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; + + ioctl(-1, VIDIOC_S_FMT, p_format); + printf("ioctl(-1, VIDIOC_S_FMT, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" + ", fmt.pix={width=%u, height=%u, pixelformat=" + "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" + ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", + p_format->fmt.pix.width, p_format->fmt.pix.height, + cc0(magic), cc1(magic), cc2(magic), cc3(magic), + p_format->fmt.pix.bytesperline, p_format->fmt.pix.sizeimage); + + /* VIDIOC_TRY_FMT */ + ioctl(-1, VIDIOC_TRY_FMT, 0); + printf("ioctl(-1, VIDIOC_TRY_FMT, NULL) = -1 EBADF (%m)\n"); + +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + memset(p_format, -1, sizeof(*p_format)); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + p_format->fmt.pix_mp.width = 0xdad1beaf; + p_format->fmt.pix_mp.height = 0xdad2beaf; + p_format->fmt.pix_mp.pixelformat = magic; + p_format->fmt.pix_mp.field = V4L2_FIELD_NONE; + p_format->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; + unsigned int i; + for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { + p_format->fmt.pix_mp.plane_fmt[i].sizeimage = 0xbadc0de0 | i; + p_format->fmt.pix_mp.plane_fmt[i].bytesperline = 0xdadbeaf0 | i; + } + ioctl(-1, VIDIOC_TRY_FMT, p_format); + printf("ioctl(-1, VIDIOC_TRY_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" + ", fmt.pix_mp={width=%u, height=%u, pixelformat=" + "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", field=V4L2_FIELD_NONE, colorspace=V4L2_COLORSPACE_JPEG" + ", plane_fmt=[", + p_format->fmt.pix_mp.width, p_format->fmt.pix_mp.height, + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { + if (i) + printf(", "); + printf("{sizeimage=%u, bytesperline=%u}", + p_format->fmt.pix_mp.plane_fmt[i].sizeimage, + p_format->fmt.pix_mp.plane_fmt[i].bytesperline); + } + printf("], num_planes=%u}}) = -1 EBADF (%m)\n", + p_format->fmt.pix_mp.num_planes); +#else + struct v4l2_format *const p_v4l2_format = + page + size - sizeof(*p_v4l2_format); + ioctl(-1, VIDIOC_TRY_FMT, p_v4l2_format); + printf("ioctl(-1, VIDIOC_TRY_FMT, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_format->type); +#endif + + /* VIDIOC_REQBUFS */ + ioctl(-1, VIDIOC_REQBUFS, 0); + printf("ioctl(-1, VIDIOC_REQBUFS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_requestbuffers *const p_v4l2_requestbuffers = + page + size - sizeof(*p_v4l2_requestbuffers); + ioctl(-1, VIDIOC_REQBUFS, p_v4l2_requestbuffers); + printf("ioctl(-1, VIDIOC_REQBUFS, {count=%u, type=%#x" + " /* V4L2_BUF_TYPE_??? */, memory=%#x /* V4L2_MEMORY_??? */})" + " = -1 EBADF (%m)\n", + p_v4l2_requestbuffers->count, + p_v4l2_requestbuffers->type, + p_v4l2_requestbuffers->memory); + + /* VIDIOC_QUERYBUF */ + ioctl(-1, VIDIOC_QUERYBUF, 0); + printf("ioctl(-1, VIDIOC_QUERYBUF, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_buffer *const p_v4l2_buffer = + page + size - sizeof(*p_v4l2_buffer); + ioctl(-1, VIDIOC_QUERYBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_QUERYBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", index=%u}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type, p_v4l2_buffer->index); + + /* VIDIOC_QBUF */ + ioctl(-1, VIDIOC_QBUF, 0); + printf("ioctl(-1, VIDIOC_QBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_QBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_QBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", index=%u}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type, p_v4l2_buffer->index); + + /* VIDIOC_DQBUF */ + ioctl(-1, VIDIOC_DQBUF, 0); + printf("ioctl(-1, VIDIOC_DQBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_DQBUF, p_v4l2_buffer); + printf("ioctl(-1, VIDIOC_DQBUF, {type=%#x" + " /* V4L2_BUF_TYPE_??? */}) = -1 EBADF (%m)\n", + p_v4l2_buffer->type); + + /* VIDIOC_G_FBUF */ + ioctl(-1, VIDIOC_G_FBUF, 0); + printf("ioctl(-1, VIDIOC_G_FBUF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_FBUF, page); + printf("ioctl(-1, VIDIOC_G_FBUF, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_FBUF */ + ioctl(-1, VIDIOC_S_FBUF, 0); + printf("ioctl(-1, VIDIOC_S_FBUF, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_framebuffer *const p_v4l2_framebuffer = + page + size - sizeof(*p_v4l2_framebuffer); + ioctl(-1, VIDIOC_S_FBUF, p_v4l2_framebuffer); + printf("ioctl(-1, VIDIOC_S_FBUF, {capability=%#x" + ", flags=%#x, base=%p}) = -1 EBADF (%m)\n", + p_v4l2_framebuffer->capability, + p_v4l2_framebuffer->flags, + p_v4l2_framebuffer->base); + + /* VIDIOC_STREAMON */ + ioctl(-1, VIDIOC_STREAMON, 0); + printf("ioctl(-1, VIDIOC_STREAMON, NULL) = -1 EBADF (%m)\n"); + + int *const p_int = page + size - sizeof(int); + ioctl(-1, VIDIOC_STREAMON, p_int); + printf("ioctl(-1, VIDIOC_STREAMON, [%#x /* V4L2_BUF_TYPE_??? */])" + " = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_STREAMOFF */ + ioctl(-1, VIDIOC_STREAMOFF, 0); + printf("ioctl(-1, VIDIOC_STREAMOFF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_STREAMOFF, p_int); + printf("ioctl(-1, VIDIOC_STREAMOFF, [%#x /* V4L2_BUF_TYPE_??? */])" + " = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_G_PARM */ + ioctl(-1, VIDIOC_G_PARM, 0); + printf("ioctl(-1, VIDIOC_G_PARM, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_streamparm *const p_v4l2_streamparm = + page + size - sizeof(*p_v4l2_streamparm); + ioctl(-1, VIDIOC_G_PARM, p_v4l2_streamparm); + printf("ioctl(-1, VIDIOC_G_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); + + /* VIDIOC_S_PARM */ + ioctl(-1, VIDIOC_S_PARM, 0); + printf("ioctl(-1, VIDIOC_S_PARM, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_PARM, p_v4l2_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); + + struct v4l2_streamparm *const p_streamparm = + tail_alloc(sizeof(*p_streamparm)); + p_streamparm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + p_streamparm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; + p_streamparm->parm.capture.capturemode = V4L2_MODE_HIGHQUALITY; + p_streamparm->parm.capture.timeperframe.numerator = 0xdeadbeef; + p_streamparm->parm.capture.timeperframe.denominator = 0xbadc0ded; + ioctl(-1, VIDIOC_S_PARM, p_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE" + ", parm.capture={capability=V4L2_CAP_TIMEPERFRAME" + ", capturemode=V4L2_MODE_HIGHQUALITY, timeperframe=%u/%u" + ", extendedmode=%u, readbuffers=%u}}) = -1 EBADF (%m)\n", + p_streamparm->parm.capture.timeperframe.numerator, + p_streamparm->parm.capture.timeperframe.denominator, -1U, -1U); + + p_streamparm->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + p_streamparm->parm.output.outputmode = 0; + ioctl(-1, VIDIOC_S_PARM, p_streamparm); + printf("ioctl(-1, VIDIOC_S_PARM, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" + ", parm.output={capability=V4L2_CAP_TIMEPERFRAME" + ", outputmode=0, timeperframe=%u/%u" + ", extendedmode=%u, writebuffers=%u}}) = -1 EBADF (%m)\n", + p_streamparm->parm.output.timeperframe.numerator, + p_streamparm->parm.output.timeperframe.denominator, -1U, -1U); + + /* VIDIOC_G_STD */ + ioctl(-1, VIDIOC_G_STD, 0); + printf("ioctl(-1, VIDIOC_G_STD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_STD, page); + printf("ioctl(-1, VIDIOC_G_STD, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_STD */ + ioctl(-1, VIDIOC_S_STD, 0); + printf("ioctl(-1, VIDIOC_S_STD, NULL) = -1 EBADF (%m)\n"); + + long long *const p_longlong = page + size - sizeof(*p_longlong); + ioctl(-1, VIDIOC_S_STD, p_longlong); + printf("ioctl(-1, VIDIOC_S_STD, [%#llx]) = -1 EBADF (%m)\n", + *p_longlong); + + /* VIDIOC_ENUMSTD */ + ioctl(-1, VIDIOC_ENUMSTD, 0); + printf("ioctl(-1, VIDIOC_ENUMSTD, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_standard *const p_v4l2_standard = + page + size - sizeof(*p_v4l2_standard); + ioctl(-1, VIDIOC_ENUMSTD, p_v4l2_standard); + printf("ioctl(-1, VIDIOC_ENUMSTD, {index=%u}) = -1 EBADF (%m)\n", + p_v4l2_standard->index); + + /* VIDIOC_ENUMINPUT */ + ioctl(-1, VIDIOC_ENUMINPUT, 0); + printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_input *const p_v4l2_input = + page + size - sizeof(*p_v4l2_input); + ioctl(-1, VIDIOC_ENUMINPUT, p_v4l2_input); + printf("ioctl(-1, VIDIOC_ENUMINPUT, {index=%u}) = -1 EBADF (%m)\n", + p_v4l2_input->index); + + /* VIDIOC_G_CTRL */ + ioctl(-1, VIDIOC_G_CTRL, 0); + printf("ioctl(-1, VIDIOC_G_CTRL, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_control *const p_v4l2_control = + page + size - sizeof(*p_v4l2_control); + ioctl(-1, VIDIOC_G_CTRL, p_v4l2_control); + printf("ioctl(-1, VIDIOC_G_CTRL, {id=%#x /* V4L2_CID_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_control->id); + + /* VIDIOC_S_CTRL */ + ioctl(-1, VIDIOC_S_CTRL, 0); + printf("ioctl(-1, VIDIOC_S_CTRL, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_CTRL, p_v4l2_control); + printf("ioctl(-1, VIDIOC_S_CTRL, {id=%#x /* V4L2_CID_??? */" + ", value=%d}) = -1 EBADF (%m)\n", + p_v4l2_control->id, p_v4l2_control->value); + + /* VIDIOC_QUERYCTRL */ + ioctl(-1, VIDIOC_QUERYCTRL, 0); + printf("ioctl(-1, VIDIOC_QUERYCTRL, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_queryctrl *const p_v4l2_queryctrl = + page + size - sizeof(*p_v4l2_queryctrl); + ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl); +# ifdef V4L2_CTRL_FLAG_NEXT_CTRL + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL" + "|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n", + p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL); +# else + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id); +# endif + + struct v4l2_queryctrl *const p_queryctrl = + tail_alloc(sizeof(*p_queryctrl)); + p_queryctrl->id = V4L2_CID_SATURATION; + ioctl(-1, VIDIOC_QUERYCTRL, p_queryctrl); + printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CID_SATURATION})" + " = -1 EBADF (%m)\n"); + + /* VIDIOC_G_INPUT */ + ioctl(-1, VIDIOC_G_INPUT, 0); + printf("ioctl(-1, VIDIOC_G_INPUT, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_INPUT, page); + printf("ioctl(-1, VIDIOC_G_INPUT, %p) = -1 EBADF (%m)\n", page); + + /* VIDIOC_S_INPUT */ + ioctl(-1, VIDIOC_S_INPUT, 0); + printf("ioctl(-1, VIDIOC_S_INPUT, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_INPUT, p_int); + printf("ioctl(-1, VIDIOC_S_INPUT, [%u]) = -1 EBADF (%m)\n", *p_int); + + /* VIDIOC_CROPCAP */ + ioctl(-1, VIDIOC_CROPCAP, 0); + printf("ioctl(-1, VIDIOC_CROPCAP, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_cropcap *const p_v4l2_cropcap = + page + size - sizeof(*p_v4l2_cropcap); + ioctl(-1, VIDIOC_CROPCAP, p_v4l2_cropcap); + printf("ioctl(-1, VIDIOC_CROPCAP, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_cropcap->type); + + /* VIDIOC_G_CROP */ + ioctl(-1, VIDIOC_G_CROP, 0); + printf("ioctl(-1, VIDIOC_G_CROP, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_crop *const p_v4l2_crop = + page + size - sizeof(*p_v4l2_crop); + ioctl(-1, VIDIOC_G_CROP, p_v4l2_crop); + printf("ioctl(-1, VIDIOC_G_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */})" + " = -1 EBADF (%m)\n", p_v4l2_crop->type); + + /* VIDIOC_S_CROP */ + ioctl(-1, VIDIOC_S_CROP, 0); + printf("ioctl(-1, VIDIOC_S_CROP, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_S_CROP, p_v4l2_crop); + printf("ioctl(-1, VIDIOC_S_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */" + ", c={left=%d, top=%d, width=%u, height=%u}}) = -1 EBADF (%m)\n", + p_v4l2_crop->type, + p_v4l2_crop->c.left, + p_v4l2_crop->c.top, + p_v4l2_crop->c.width, + p_v4l2_crop->c.height); + +#ifdef VIDIOC_S_EXT_CTRLS + /* VIDIOC_S_EXT_CTRLS */ + ioctl(-1, VIDIOC_S_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_ext_controls *const p_ext_controls = + tail_alloc(sizeof(*p_ext_controls)); + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; + p_ext_controls->count = 0; + p_ext_controls->controls = (void *) -2UL; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_USER" + ", count=%u}) = -1 EBADF (%m)\n", p_ext_controls->count); + + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_MPEG; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_MPEG" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + +# if HAVE_DECL_V4L2_CTRL_TYPE_STRING + p_ext_controls->count = 2; + p_ext_controls->controls = + tail_alloc(sizeof(*p_ext_controls->controls) * p_ext_controls->count); + p_ext_controls->controls[0].id = V4L2_CID_BRIGHTNESS; + p_ext_controls->controls[0].size = 0; + p_ext_controls->controls[0].value64 = 0xfacefeeddeadbeefULL; + p_ext_controls->controls[1].id = V4L2_CID_CONTRAST; + p_ext_controls->controls[1].size = 2; + p_ext_controls->controls[1].string = + tail_alloc(p_ext_controls->controls[1].size); + + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + "] => controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + "], error_idx=%u}) = -1 EBADF (%m)\n", + p_ext_controls->count, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->error_idx); + + ++p_ext_controls->count; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" + "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" + ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" + ", %p]}) = -1 EBADF (%m)\n", + p_ext_controls->count, + p_ext_controls->controls[0].value, + (long long) p_ext_controls->controls[0].value64, + p_ext_controls->controls + 2); +# endif /* HAVE_DECL_V4L2_CTRL_TYPE_STRING */ + + /* VIDIOC_TRY_EXT_CTRLS */ + ioctl(-1, VIDIOC_TRY_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_TRY_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; + p_ext_controls->count = magic; + p_ext_controls->controls = (void *) -2UL; + ioctl(-1, VIDIOC_TRY_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_TRY_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_USER, count=%u, controls=%p})" + " = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + + /* VIDIOC_G_EXT_CTRLS */ + ioctl(-1, VIDIOC_G_EXT_CTRLS, 0); + printf("ioctl(-1, VIDIOC_G_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, VIDIOC_G_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_G_EXT_CTRLS" + ", {ctrl_class=V4L2_CTRL_CLASS_USER, count=%u, controls=%p" + ", error_idx=%u}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls, + p_ext_controls->error_idx); +#endif /* VIDIOC_S_EXT_CTRLS */ + +#ifdef VIDIOC_ENUM_FRAMESIZES + ioctl(-1, VIDIOC_ENUM_FRAMESIZES, 0); + printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_frmsizeenum *const p_frmsizeenum = + tail_alloc(sizeof(*p_frmsizeenum)); + p_frmsizeenum->index = magic; + p_frmsizeenum->pixel_format = fourcc(cc[0], cc[1], cc[2], cc[3]); + + ioctl(-1, VIDIOC_ENUM_FRAMESIZES, p_frmsizeenum); + printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, {index=%u" + ", pixel_format=v4l2_fourcc('%c', '\\%c', '\\%c', '\\x%x')})" + " = -1 EBADF (%m)\n", p_frmsizeenum->index, + cc[0], cc[1], cc[2], cc[3]); +#endif /* VIDIOC_ENUM_FRAMESIZES */ + +#ifdef VIDIOC_ENUM_FRAMEINTERVALS + ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, 0); + printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_frmivalenum *const p_v4l2_frmivalenum = + page + size - sizeof(*p_v4l2_frmivalenum); + ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, p_v4l2_frmivalenum); + printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, {index=%u" + ", pixel_format=v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" + ", width=%u, height=%u}) = -1 EBADF (%m)\n", + p_v4l2_frmivalenum->index, + cc0(p_v4l2_frmivalenum->pixel_format), + cc1(p_v4l2_frmivalenum->pixel_format), + cc2(p_v4l2_frmivalenum->pixel_format), + cc3(p_v4l2_frmivalenum->pixel_format), + p_v4l2_frmivalenum->width, + p_v4l2_frmivalenum->height); +#endif /* VIDIOC_ENUM_FRAMEINTERVALS */ + +#ifdef VIDIOC_CREATE_BUFS + ioctl(-1, VIDIOC_CREATE_BUFS, 0); + printf("ioctl(-1, VIDIOC_CREATE_BUFS, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_create_buffers *const p_v4l2_create_buffers = + page + size - sizeof(*p_v4l2_create_buffers); + ioctl(-1, VIDIOC_CREATE_BUFS, p_v4l2_create_buffers); + printf("ioctl(-1, VIDIOC_CREATE_BUFS, {count=%u, memory=%#x" + " /* V4L2_MEMORY_??? */, format={type=%#x" + " /* V4L2_BUF_TYPE_??? */}}) = -1 EBADF (%m)\n", + p_v4l2_create_buffers->count, + p_v4l2_create_buffers->memory, + p_v4l2_create_buffers->format.type); +#endif /* VIDIOC_CREATE_BUFS */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_v4l2.test b/tests/ioctl_v4l2.test new file mode 100755 index 00000000..a092a3cd --- /dev/null +++ b/tests/ioctl_v4l2.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check basic VIDIOC_* ioctl decoding. + +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioperm.c b/tests/ioperm.c new file mode 100644 index 00000000..2f02b523 --- /dev/null +++ b/tests/ioperm.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_ioperm + +# include +# include + +int +main(void) +{ + const unsigned long port = (unsigned long) 0xdeafbeefffffffffULL; + + long rc = syscall(__NR_ioperm, port, 1, 0); + printf("ioperm(%#lx, %#lx, %d) = %ld %s (%m)\n", + port, 1UL, 0, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ioperm") + +#endif diff --git a/tests/ioperm.test b/tests/ioperm.test new file mode 100755 index 00000000..8c1c1cc7 --- /dev/null +++ b/tests/ioperm.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ioperm syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/iopl.c b/tests/iopl.c new file mode 100644 index 00000000..14ec29e3 --- /dev/null +++ b/tests/iopl.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_iopl + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_iopl, 4); + printf("iopl(4) = %ld %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_iopl") + +#endif diff --git a/tests/iopl.test b/tests/iopl.test new file mode 100755 index 00000000..d0b5b113 --- /dev/null +++ b/tests/iopl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check iopl syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests/ioprio.c b/tests/ioprio.c new file mode 100644 index 00000000..44ace6c3 --- /dev/null +++ b/tests/ioprio.c @@ -0,0 +1,102 @@ +/* + * Check decoding of ioprio_get and ioprio_set syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_ioprio_get) && defined(__NR_ioprio_set) + +# include +# include + +enum { + IOPRIO_CLASS_NONE, + IOPRIO_CLASS_RT, + IOPRIO_CLASS_BE, + IOPRIO_CLASS_IDLE +}; + +# include "xlat.h" +# include "xlat/ioprio_class.h" + +void +print_ioprio(unsigned long val) +{ + printf(" (IOPRIO_PRIO_VALUE("); + printxval(ioprio_class, val >> 13, "IOPRIO_CLASS_???"); + printf(", %d))", (int) (val & 0x1fff)); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_which = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + static const kernel_ulong_t bogus_who = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_ioprio = + (kernel_ulong_t) 0xdec0ded1facefeedULL; + static const char * const bogus_ioprio_str = + "IOPRIO_PRIO_VALUE(0x7d677 /* IOPRIO_CLASS_??? */, 7917)"; + + long rc; + + rc = syscall(__NR_ioprio_get, bogus_which, bogus_who); + printf("ioprio_get(%#x /* IOPRIO_WHO_??? */, %d) = %s\n", + (int) bogus_which, (int) bogus_who, sprintrc(rc)); + + rc = syscall(__NR_ioprio_get, 1, 0); + printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", sprintrc(rc)); + + if (rc >= -1) + print_ioprio(rc); + + puts(""); + + rc = syscall(__NR_ioprio_set, 2, 0, 8191); + printf("ioprio_set(IOPRIO_WHO_PGRP, 0, " + "IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_ioprio_set, bogus_which, bogus_who, bogus_ioprio); + printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %s) = %s\n", + (int) bogus_which, (int) bogus_who, bogus_ioprio_str, + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ioprio_get && __NR_ioprio_set"); + +#endif diff --git a/tests/ioprio.test b/tests/ioprio.test new file mode 100755 index 00000000..e79310b3 --- /dev/null +++ b/tests/ioprio.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check iprio_get and iprio_set syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests/ip_mreq.c b/tests/ip_mreq.c new file mode 100644 index 00000000..fa0c504b --- /dev/null +++ b/tests/ip_mreq.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \ + && defined IPV6_JOIN_ANYCAST && defined HAVE_IF_INDEXTONAME + +# include +# include +# include +# include +# include + +int +main(void) +{ + static const char multi4addr[] = "224.0.0.3"; + static const char multi6addr[] = "ff01::c"; + static const char interface[] = "127.0.0.1"; + + struct ip_mreq *const m4 = tail_alloc(sizeof(*m4)); + struct ipv6_mreq *const m6 = tail_alloc(sizeof(*m6)); + unsigned int i; + int rc; + + inet_pton(AF_INET, multi4addr, &m4->imr_multiaddr); + inet_pton(AF_INET, interface, &m4->imr_interface); + inet_pton(AF_INET6, multi6addr, &m6->ipv6mr_multiaddr); + + m6->ipv6mr_interface = if_nametoindex("lo"); + if (!m6->ipv6mr_interface) + perror_msg_and_skip("lo"); + + (void) close(0); + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + + struct { + int level; + const char *str_level; + int optname; + const char *str_optname; + void *optval; + unsigned int optsize; + } short_any[] = { + { + ARG_STR(SOL_IP), ARG_STR(IP_ADD_MEMBERSHIP), + m4, sizeof(*m4) + }, + { + ARG_STR(SOL_IP), ARG_STR(IP_DROP_MEMBERSHIP), + m4, sizeof(*m4) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_ADD_MEMBERSHIP), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_DROP_MEMBERSHIP), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_JOIN_ANYCAST), + m6, sizeof(*m6) + }, + { + ARG_STR(SOL_IPV6), ARG_STR(IPV6_LEAVE_ANYCAST), + m6, sizeof(*m6) + } + }; + + for (i = 0; i < ARRAY_SIZE(short_any); ++i) { + rc = setsockopt(0, short_any[i].level, short_any[i].optname, + short_any[i].optval, 1); + printf("setsockopt(0, %s, %s, \"\\%hho\", 1) = %s\n", + short_any[i].str_level, short_any[i].str_optname, + * (unsigned char *) short_any[i].optval, + sprintrc(rc)); + + rc = setsockopt(0, short_any[i].level, short_any[i].optname, + short_any[i].optval + 1, short_any[i].optsize); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + short_any[i].str_level, short_any[i].str_optname, + short_any[i].optval + 1, short_any[i].optsize, + sprintrc(rc)); + } + + struct { + int optname; + const char *str_optname; + } long_ip[] = { + { ARG_STR(IP_ADD_MEMBERSHIP) }, + { ARG_STR(IP_DROP_MEMBERSHIP) } + }, long_ipv6[] = { + { ARG_STR(IPV6_ADD_MEMBERSHIP) }, + { ARG_STR(IPV6_DROP_MEMBERSHIP) }, + { ARG_STR(IPV6_JOIN_ANYCAST) }, + { ARG_STR(IPV6_LEAVE_ANYCAST) } + }; + + for (i = 0; i < ARRAY_SIZE(long_ip); ++i) { + rc = setsockopt(0, SOL_IP, long_ip[i].optname, + m4, sizeof(*m4)); + printf("setsockopt(0, SOL_IP, %s" + ", {imr_multiaddr=inet_addr(\"%s\")" + ", imr_interface=inet_addr(\"%s\")}, %u) = %s\n", + long_ip[i].str_optname, multi4addr, + interface, (unsigned) sizeof(*m4), sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(long_ipv6); ++i) { + rc = setsockopt(0, SOL_IPV6, long_ipv6[i].optname, + m6, sizeof(*m6)); + printf("setsockopt(0, SOL_IPV6, %s" + ", {ipv6mr_multiaddr=inet_pton(\"%s\")" + ", ipv6mr_interface=if_nametoindex(\"lo\")}" + ", %u) = %s\n", + long_ipv6[i].str_optname, multi6addr, + (unsigned) sizeof(*m6), sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("IP_ADD_MEMBERSHIP && IPV6_ADD_MEMBERSHIP" + " && IPV6_JOIN_ANYCAST && HAVE_IF_INDEXTONAME") + +#endif diff --git a/tests/ip_mreq.test b/tests/ip_mreq.test new file mode 100755 index 00000000..d0a9e0f1 --- /dev/null +++ b/tests/ip_mreq.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check {IP,IPV6}_{ADD,DROP}_MEMBERSHIP setsockopt decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests/ipc.c b/tests/ipc.c new file mode 100644 index 00000000..c64d3716 --- /dev/null +++ b/tests/ipc.c @@ -0,0 +1,122 @@ +/* + * Check decoding of ipc syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_ipc && defined HAVE_LINUX_IPC_H + +# include +# include +# include +# include + +# ifndef SEMCTL +# define SEMCTL 3 +# endif +# ifndef MSGRCV +# define MSGRCV 12 +# endif + +static int +ipc_call(const unsigned short version, const unsigned short call, + long a1, long a2, long a3, long a4, long a5) +{ + const unsigned long val = + (unsigned long) 0xfacefeed00000000ULL | + (unsigned int) version << 16 | + call; + + return syscall(__NR_ipc, val, a1, a2, a3, a4, a5); +} + +static int +ipc_call0(const unsigned short version, const unsigned short call) +{ + int rc = ipc_call(version, call, 0, 0, 0, 0, 0); + int saved_errno = errno; + printf("ipc("); + if (version) + printf("%hu<<16|", version); + errno = saved_errno; + printf("%hu, 0, 0, 0, 0%s) = %d %s (%m)\n", call, +# ifdef __s390__ + "", +# else + ", 0", +# endif + rc, errno2name()); + return rc; +} + +int +main(void) +{ + void *const efault = tail_alloc(1) + 1; + + int rc = ipc_call(0, SEMCTL, 0, 0, 0, (long) efault, 0); + if (rc != -1 || EFAULT != errno) + perror_msg_and_skip("ipc"); + printf("semctl(0, 0, IPC_RMID, %p) = -1 EFAULT (%m)\n", efault); + + unsigned short call; + for (call = 0; call <= 40; call += 10) { + ipc_call0(0, call); + ipc_call0(42, call); + } + + rc = ipc_call(42, SEMCTL, 0, 0, 0, (long) efault, 0); + int test_version = EFAULT == errno; + if (test_version) + printf("semctl(0, 0, IPC_RMID, %p) = %d %s (%m)\n", + efault, rc, errno2name()); + else + printf("ipc(42<<16|SEMCTL, 0, 0, 0, %p) = %d %s (%m)\n", + efault, rc, errno2name()); + + if (test_version) { + const int msqid = -2; + const long msgsz = -3; + const long msgtyp = 0; + + rc = ipc_call(1, MSGRCV, + msqid, msgsz, IPC_NOWAIT, (long) efault, msgtyp); + printf("msgrcv(%d, %p, %lu, %ld, IPC_NOWAIT) = %d %s (%m)\n", + msqid, efault, msgsz, msgtyp, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ipc && HAVE_LINUX_IPC_H") + +#endif diff --git a/tests/ipc.sh b/tests/ipc.sh new file mode 100644 index 00000000..752d4bb2 --- /dev/null +++ b/tests/ipc.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of ipc syscalls + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -eipc $args > "$OUT" +match_grep "$LOG" "$OUT" + +rm -f "$OUT" + +exit 0 diff --git a/tests/ipc.test b/tests/ipc.test new file mode 100755 index 00000000..aa33fa61 --- /dev/null +++ b/tests/ipc.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ipc syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/ipc_msg.c b/tests/ipc_msg.c new file mode 100644 index 00000000..b4938439 --- /dev/null +++ b/tests/ipc_msg.c @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resource_flags.h" + +/* + * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data + * provided in third argument of msgctl call (in case of IPC_SET cmd) + * which led to segmentation fault. + */ +#undef TEST_MSGCTL_BOGUS_ADDR +#if defined __GLIBC__ && defined POWERPC64 +# if !(defined __GLIBC_MINOR__) \ + || ((__GLIBC__ << 16) + __GLIBC_MINOR__ < (2 << 16) + 23) +# define TEST_MSGCTL_BOGUS_ADDR 0 +# endif +#endif /* __GLIBC__ && POWERPC64 */ + +#ifndef TEST_MSGCTL_BOGUS_ADDR +# define TEST_MSGCTL_BOGUS_ADDR 1 +#endif + +static int id = -1; + +static void +cleanup(void) +{ + msgctl(id, IPC_RMID, NULL); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_msgid = 0xfdb97531; + static const int bogus_cmd = 0xdeadbeef; +#if TEST_MSGCTL_BOGUS_ADDR + static void * const bogus_addr = (void *) -1L; +#endif + static const int bogus_flags = 0xface1e55 & ~IPC_CREAT; + + int rc; + struct msqid_ds ds; + + rc = msgget(bogus_key, bogus_flags); + printf("msgget\\(%#llx, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = msgget(private_key, 0600); + if (id < 0) + perror_msg_and_skip("msgget"); + printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = msgctl(bogus_msgid, bogus_cmd, NULL); + printf("msgctl\\(%d, (IPC_64\\|)?%#x /\\* MSG_\\?\\?\\? \\*/, NULL\\)" + " += %s\n", bogus_msgid, bogus_cmd, sprintrc_grep(rc)); + +#if TEST_MSGCTL_BOGUS_ADDR + rc = msgctl(bogus_msgid, IPC_SET, bogus_addr); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, %p\\) += %s\n", + bogus_msgid, bogus_addr, sprintrc_grep(rc)); +#endif + + if (msgctl(id, IPC_STAT, &ds)) + perror_msg_and_skip("msgctl IPC_STAT"); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u" + ", msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u" + ", msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\n", + id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + (unsigned) ds.msg_perm.mode, (unsigned) ds.msg_perm.__key, + (unsigned) ds.msg_perm.cuid, (unsigned) ds.msg_perm.cgid, + (unsigned) ds.msg_stime, (unsigned) ds.msg_rtime, + (unsigned) ds.msg_ctime, (unsigned) ds.msg_qnum, + (unsigned) ds.msg_qbytes, (unsigned) ds.msg_lspid, + (unsigned) ds.msg_lrpid); + + if (msgctl(id, IPC_SET, &ds)) + perror_msg_and_skip("msgctl IPC_SET"); + printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o\\}, ...\\}\\) += 0\n", + id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + (unsigned) ds.msg_perm.mode); + + rc = msgctl(0, MSG_INFO, &ds); + printf("msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %s\n", + &ds, sprintrc_grep(rc)); + + rc = msgctl(id, MSG_STAT, &ds); + printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests/ipc_msg.test b/tests/ipc_msg.test new file mode 100755 index 00000000..177495b0 --- /dev/null +++ b/tests/ipc_msg.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc msgget/msgctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_msgbuf.c b/tests/ipc_msgbuf.c new file mode 100644 index 00000000..1c34494d --- /dev/null +++ b/tests/ipc_msgbuf.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#define text_string "STRACE_STRING" +#define msgsz sizeof(text_string) + +static int msqid = -1; + +static void +cleanup(void) +{ + msgctl(msqid, IPC_RMID, 0); + msqid = -1; +} + +int +main (void) +{ + const long mtype = 0xdefaced; + struct { + kernel_long_t mtype; + char mtext[msgsz]; + } msg = { + .mtype = mtype, + .mtext = text_string + }; + msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); + if (msqid == -1) + perror_msg_and_skip("msgget"); + atexit(cleanup); + if (msgsnd(msqid, &msg, msgsz, 0) == -1) + perror_msg_and_skip("msgsnd"); + if (msgrcv(msqid, &msg, msgsz, mtype, 0) != msgsz) + perror_msg_and_skip("msgrcv"); + return 0; +} diff --git a/tests/ipc_msgbuf.expected b/tests/ipc_msgbuf.expected new file mode 100644 index 00000000..880424bf --- /dev/null +++ b/tests/ipc_msgbuf.expected @@ -0,0 +1,4 @@ +msgget\(IPC_PRIVATE, IPC_CREAT\|0700\) += [0-9]* +msgsnd\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 0\) += 0 +msgrcv\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 233811181, 0\) += 14 +msgctl\([0-9]*, (IPC_64\|)?IPC_RMID, NULL\) += 0 diff --git a/tests/ipc_msgbuf.test b/tests/ipc_msgbuf.test new file mode 100755 index 00000000..d0b65d1a --- /dev/null +++ b/tests/ipc_msgbuf.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check msgget, msgsnd, msgrcv, msgctl syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -v -e msgget,msgsnd,msgrcv,msgctl $args +match_grep + +exit 0 diff --git a/tests/ipc_sem.c b/tests/ipc_sem.c new file mode 100644 index 00000000..8f6382cc --- /dev/null +++ b/tests/ipc_sem.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2015 Andreas Schwab + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resource_flags.h" + +union semun { + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO + (Linux-specific) */ +}; + +static int id = -1; + +static void +cleanup(void) +{ + semctl(id, 0, IPC_RMID, 0); + printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_RMID, \\[?NULL\\]?\\) += 0\n", + id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_semid = 0xfdb97531; + static const int bogus_semnum = 0xeca86420; + static const int bogus_size = 0xdec0ded1; + static const int bogus_flags = 0xface1e55; + static const int bogus_cmd = 0xdeadbeef; + static const unsigned long bogus_arg = + (unsigned long) 0xbadc0dedfffffaceULL; + + int rc; + union semun un; + struct semid_ds ds; + struct seminfo info; + + rc = semget(bogus_key, bogus_size, bogus_flags); + printf("semget\\(%#llx, %d, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), bogus_size, + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = semget(private_key, 1, 0600); + if (id < 0) + perror_msg_and_skip("semget"); + printf("semget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = semctl(bogus_semid, bogus_semnum, bogus_cmd, bogus_arg); +#define SEMCTL_BOGUS_ARG_FMT "(%#lx|\\[(%#lx|NULL)\\]|NULL)" + printf("semctl\\(%d, %d, (IPC_64\\|)?%#x /\\* SEM_\\?\\?\\? \\*/" + ", " SEMCTL_BOGUS_ARG_FMT "\\) += %s\n", + bogus_semid, bogus_semnum, bogus_cmd, + bogus_arg, bogus_arg, sprintrc_grep(rc)); + + un.buf = &ds; + if (semctl(id, 0, IPC_STAT, un)) + perror_msg_and_skip("semctl IPC_STAT"); + printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_STAT, \\[?%p\\]?\\) += 0\n", + id, &ds); + + un.__buf = &info; + rc = semctl(0, 0, SEM_INFO, un); + printf("semctl\\(0, 0, (IPC_64\\|)?SEM_INFO, \\[?%p\\]?\\) += %s\n", + &info, sprintrc_grep(rc)); + + un.buf = &ds; + rc = semctl(id, 0, SEM_STAT, un); + printf("semctl\\(%d, 0, (IPC_64\\|)?SEM_STAT, \\[?%p\\]?\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests/ipc_sem.test b/tests/ipc_sem.test new file mode 100755 index 00000000..cc93d07b --- /dev/null +++ b/tests/ipc_sem.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc semget/semctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_shm.c b/tests/ipc_shm.c new file mode 100644 index 00000000..66960ff9 --- /dev/null +++ b/tests/ipc_shm.c @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/shm_resource_flags.h" + +static int id = -1; + +static void +cleanup(void) +{ + shmctl(id, IPC_RMID, NULL); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + id = -1; +} + +int +main(void) +{ + static const key_t private_key = + (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); + static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const int bogus_id = 0xdefaced1; + static const int bogus_cmd = 0xdefaced2; + static void * const bogus_addr = (void *) -1L; + static const size_t bogus_size = + /* + * musl sets size to SIZE_MAX if size argument is greater than + * PTRDIFF_MAX - musl/src/ipc/shmget.c + */ + #ifdef __GLIBC__ + (size_t) 0xdec0ded1dec0ded2ULL; + #else + (size_t) 0x1e55c0de5dec0dedULL; + #endif + static const int bogus_flags = 0xface1e55; + + int rc; + struct shmid_ds ds; + + rc = shmget(bogus_key, bogus_size, bogus_flags); + printf("shmget\\(%#llx, %zu, %s%s%s%#x\\|%#04o\\) += %s\n", + zero_extend_signed_to_ull(bogus_key), bogus_size, + IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", + IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", + SHM_HUGETLB & bogus_flags ? "SHM_HUGETLB\\|" : "", + bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | SHM_HUGETLB), + bogus_flags & 0777, sprintrc_grep(rc)); + + id = shmget(private_key, 1, 0600); + if (id < 0) + perror_msg_and_skip("shmget"); + printf("shmget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + atexit(cleanup); + + rc = shmctl(bogus_id, bogus_cmd, NULL); + printf("shmctl\\(%d, (IPC_64\\|)?%#x /\\* SHM_\\?\\?\\? \\*/, NULL\\)" + " += %s\n", bogus_id, bogus_cmd, sprintrc_grep(rc)); + + rc = shmctl(bogus_id, IPC_STAT, bogus_addr); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_STAT, %p\\) += %s\n", + bogus_id, bogus_addr, sprintrc_grep(rc)); + + if (shmctl(id, IPC_STAT, &ds)) + perror_msg_and_skip("shmctl IPC_STAT"); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{shm_perm=\\{uid=%u, gid=%u, " + "mode=%#o, key=%u, cuid=%u, cgid=%u\\}, shm_segsz=%u, shm_cpid=%u, " + "shm_lpid=%u, shm_nattch=%u, shm_atime=%u, shm_dtime=%u, " + "shm_ctime=%u\\}\\) += 0\n", + id, (unsigned) ds.shm_perm.uid, (unsigned) ds.shm_perm.gid, + (unsigned) ds.shm_perm.mode, (unsigned) ds.shm_perm.__key, + (unsigned) ds.shm_perm.cuid, (unsigned) ds.shm_perm.cgid, + (unsigned) ds.shm_segsz, (unsigned) ds.shm_cpid, + (unsigned) ds.shm_lpid, (unsigned) ds.shm_nattch, + (unsigned) ds.shm_atime, (unsigned) ds.shm_dtime, + (unsigned) ds. shm_ctime); + + if (shmctl(id, IPC_SET, &ds)) + perror_msg_and_skip("shmctl IPC_SET"); + printf("shmctl\\(%d, (IPC_64\\|)?IPC_SET, \\{shm_perm=\\{uid=%u, gid=%u" + ", mode=%#o\\}, ...\\}\\) += 0\n", + id, (unsigned) ds.shm_perm.uid, (unsigned) ds.shm_perm.gid, + (unsigned) ds.shm_perm.mode); + + rc = shmctl(0, SHM_INFO, &ds); + printf("shmctl\\(0, (IPC_64\\|)?SHM_INFO, %p\\) += %s\n", + &ds, sprintrc_grep(rc)); + + rc = shmctl(id, SHM_STAT, &ds); + printf("shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += %s\n", + id, &ds, sprintrc_grep(rc)); + + return 0; +} diff --git a/tests/ipc_shm.test b/tests/ipc_shm.test new file mode 100755 index 00000000..a67ea291 --- /dev/null +++ b/tests/ipc_shm.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check decoding of ipc shmget/shmctl syscalls + +. "${srcdir=.}/ipc.sh" diff --git a/tests/kcmp.c b/tests/kcmp.c new file mode 100644 index 00000000..cb497c9f --- /dev/null +++ b/tests/kcmp.c @@ -0,0 +1,103 @@ +/* + * Check decoding of kcmp syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include "scno.h" + +#ifdef __NR_kcmp + +# include +# include + +# define KCMP_FILE 0 +# define KCMP_SYSVSEM 6 + +static void +do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, + const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2) +{ + long rc; + const char *errstr; + + rc = syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2); + errstr = sprintrc(rc); + + printf("kcmp(%d, %d, ", (int) pid1, (int) pid2); + + if (type_str) + printf("%s", type_str); + else + printf("%#x /* KCMP_??? */", (int) type); + + if (type == KCMP_FILE) + printf(", %u, %u", (unsigned) idx1, (unsigned) idx2); + else if (type > KCMP_SYSVSEM) + printf(", %#llx, %#llx", + (unsigned long long) idx1, (unsigned long long) idx2); + + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_pid1 = + (kernel_ulong_t) 0xdeadca75face1057ULL; + static const kernel_ulong_t bogus_pid2 = + (kernel_ulong_t) 0xdefaced1defaced2ULL; + static const kernel_ulong_t bogus_type = + (kernel_ulong_t) 0xbadc0dedda7adeadULL; + static const kernel_ulong_t bogus_idx1 = + (kernel_ulong_t) 0xdec0ded3dec0ded4ULL; + static const kernel_ulong_t bogus_idx2 = + (kernel_ulong_t) 0xba5e1e55deadc0deULL; + + /* Invalid values */ + do_kcmp(bogus_pid1, bogus_pid2, bogus_type, NULL, bogus_idx1, + bogus_idx2); + do_kcmp(0, 0, KCMP_SYSVSEM + 1, NULL, 0, 0); + + /* KCMP_FILE is the only type which has additional args */ + do_kcmp(3141592653U, 2718281828U, ARG_STR(KCMP_FILE), bogus_idx1, + bogus_idx2); + /* Some type without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_SYSVSEM), bogus_idx1, bogus_idx2); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kcmp"); + +#endif diff --git a/tests/kcmp.test b/tests/kcmp.test new file mode 100755 index 00000000..d022aeba --- /dev/null +++ b/tests/kcmp.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kcmp syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/kexec_file_load.c b/tests/kexec_file_load.c new file mode 100644 index 00000000..be90a37d --- /dev/null +++ b/tests/kexec_file_load.c @@ -0,0 +1,127 @@ +/* + * Check decoding of kexec_file_load syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_kexec_file_load + +# include +# include +# include + +struct strval { + kernel_ulong_t val; + const char *str64; + const char *str32; + const char *str; +}; + +#define CMDLINE_STR "deadcodebaddatadefaced"; + +int +main(void) +{ + static const kernel_ulong_t bogus_kernel_fd = + (kernel_ulong_t) 0xdeadca57badda7a1ULL; + static const kernel_ulong_t bogus_initrd_fd = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + static const char cmdline_str[] = CMDLINE_STR; + static const char cmdline_short_str[] = "abcdef"; + + static const kernel_ulong_t cmdline_lens[] = { + 0, + (kernel_ulong_t) 0xcaffeeeddeadbeefULL, + sizeof(cmdline_str), + sizeof(cmdline_str) - 1, + sizeof(cmdline_short_str), + sizeof(cmdline_short_str) - 1, + sizeof(cmdline_short_str) + 1, + }; + static const struct strval flags[] = { + { (kernel_ulong_t) 0xbadc0dedda7a1058ULL, + "0xbadc0ded", "0x", + "da7a1058 /* KEXEC_FILE_??? */" }, + { 0, "", "", "0" }, + { 0xdeadbeef, "", "", "KEXEC_FILE_UNLOAD|KEXEC_FILE_ON_CRASH|" + "KEXEC_FILE_NO_INITRAMFS|0xdeadbee8" }, + }; + + + long rc; + char *cmdline = tail_memdup(cmdline_str, sizeof(cmdline_str)); + char *cmdline_short = + tail_memdup(cmdline_short_str, sizeof(cmdline_short_str)); + char cmdline_ptr[sizeof("0x") + sizeof(void *) * 2]; + char cmdline_short_ptr[sizeof("0x") + sizeof(void *) * 2]; + unsigned int i; + unsigned int j; + + struct strval cmdlines[] = { + { (uintptr_t) NULL, "", "", "NULL" }, + { (uintptr_t) (cmdline + sizeof(cmdline_str)), "", "", + cmdline_ptr }, + { (uintptr_t) cmdline, "", "", "\"deadcodeb\"..." }, + { (uintptr_t) cmdline, "", "", "\"deadcodeb\"..." }, + { (uintptr_t) cmdline_short, "", "", "\"abcdef\\0\"" }, + { (uintptr_t) cmdline_short, "", "", "\"abcdef\"" }, + { (uintptr_t) cmdline_short, "", "", cmdline_short_ptr }, + }; + + + snprintf(cmdline_ptr, sizeof(cmdline_ptr), "%p", + cmdline + sizeof(cmdline_str)); + snprintf(cmdline_short_ptr, sizeof(cmdline_short_ptr), "%p", + cmdline_short); + + for (i = 0; i < ARRAY_SIZE(flags); i++) { + for (j = 0; j < ARRAY_SIZE(cmdlines); j++) { + rc = syscall(__NR_kexec_file_load, bogus_kernel_fd, + bogus_initrd_fd, cmdline_lens[j], + cmdlines[j].val, flags[i].val); + printf("kexec_file_load(%d, %d, %llu, %s, %s%s) = %s\n", + (int) bogus_kernel_fd, (int) bogus_initrd_fd, + (unsigned long long) cmdline_lens[j], + cmdlines[j].str, + sizeof(kernel_ulong_t) == 8 ? flags[i].str64 : + flags[i].str32, flags[i].str, sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kexec_file_load"); + +#endif diff --git a/tests/kexec_file_load.test b/tests/kexec_file_load.test new file mode 100755 index 00000000..c95e1238 --- /dev/null +++ b/tests/kexec_file_load.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kexec_file_load syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests/kexec_load.c b/tests/kexec_load.c new file mode 100644 index 00000000..330238de --- /dev/null +++ b/tests/kexec_load.c @@ -0,0 +1,170 @@ +/* + * Check decoding of kexec_load syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_kexec_load + +# include +# include + +struct strval { + kernel_ulong_t val; + const char *str64; + const char *str32; + const char *str; +}; + +struct segm { + void *buf; + size_t bufsz; + void *mem; + size_t memsz; +}; + +int +main(void) +{ + enum { + NUM_SEGMS = 17, + NUM_SEGMS_UNCUT = 5, + NUM_SEGMS_UNCUT_MAX = 9, + NUM_SEGMS_CUT = 12, + SEGMS_ARRAY_SIZE = sizeof(struct segm) * NUM_SEGMS, + }; + + static const kernel_ulong_t bogus_zero = + sizeof(long) < sizeof(kernel_long_t) ? + (kernel_ulong_t) 0xffffffff00000000ULL : 0; + static const kernel_ulong_t bogus_entry = + (kernel_ulong_t) 0xdeadca57badda7a1ULL; + static const kernel_ulong_t bogus_nsegs = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + + static const struct strval flags[] = { + { (kernel_ulong_t) 0xbadc0dedda7a1054ULL, + "0xda7a0000 /* KEXEC_ARCH_??? */|0xbadc0ded0000", + "0xda7a0000 /* KEXEC_ARCH_??? */|0x", + "1054 /* KEXEC_??? */" }, + { 0, "", "", "KEXEC_ARCH_DEFAULT" }, + { 0x2a0003, "", "", + "KEXEC_ARCH_SH|KEXEC_ON_CRASH|KEXEC_PRESERVE_CONTEXT" }, + { 0xdead0000, "", "", "0xdead0000 /* KEXEC_ARCH_??? */" }, + }; + + const char *errstr; + long rc; + struct segm *segms = tail_alloc(SEGMS_ARRAY_SIZE); + unsigned int i; + + fill_memory(segms, SEGMS_ARRAY_SIZE); + segms[0].buf = segms[0].mem = NULL; + + rc = syscall(__NR_kexec_load, bogus_zero, bogus_zero, bogus_zero, + flags[0].val); + printf("kexec_load(NULL, 0, NULL, %s%s) = %s\n", + sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, + flags[0].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, bogus_nsegs, + segms + SEGMS_ARRAY_SIZE, flags[1].val); + printf("kexec_load(%#lx, %lu, %p, %s) = %s\n", + (unsigned long) bogus_entry, (unsigned long) bogus_nsegs, + segms + SEGMS_ARRAY_SIZE, flags[1].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS, + segms, flags[2].val); + printf("kexec_load(%#lx, %lu, %p, %s) = %s\n", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS, + segms, flags[2].str, sprintrc(rc)); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms, flags[3].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [{buf=NULL, bufsz=%zu, mem=NULL, " + "memsz=%zu}, ", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT, + segms[0].bufsz, segms[0].memsz); + for (i = 1; i < NUM_SEGMS_UNCUT_MAX; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("...], %s) = %s\n", flags[3].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms + (NUM_SEGMS - NUM_SEGMS_UNCUT_MAX), + flags[0].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT); + for (i = NUM_SEGMS - NUM_SEGMS_UNCUT_MAX; i < NUM_SEGMS; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("%p], %s%s) = %s\n", + segms + NUM_SEGMS, + sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, + flags[0].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_UNCUT, + segms + (NUM_SEGMS - NUM_SEGMS_UNCUT), + flags[1].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_UNCUT); + for (i = NUM_SEGMS - NUM_SEGMS_UNCUT; i < NUM_SEGMS; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}%s", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz, + (i == NUM_SEGMS - 1) ? "" : ", "); + printf("], %s) = %s\n", flags[1].str, errstr); + + rc = syscall(__NR_kexec_load, bogus_entry, NUM_SEGMS_CUT, + segms + 1, flags[2].val); + errstr = sprintrc(rc); + printf("kexec_load(%#lx, %lu, [", + (unsigned long) bogus_entry, (unsigned long) NUM_SEGMS_CUT); + for (i = 1; i < NUM_SEGMS_UNCUT_MAX + 1; i++) + printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", + segms[i].buf, segms[i].bufsz, + segms[i].mem, segms[i].memsz); + printf("...], %s) = %s\n", flags[2].str, errstr); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kexec_load"); + +#endif diff --git a/tests/kexec_load.test b/tests/kexec_load.test new file mode 100755 index 00000000..4b1511e9 --- /dev/null +++ b/tests/kexec_load.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kexec_load syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests/keyctl.c b/tests/keyctl.c new file mode 100644 index 00000000..2e26076b --- /dev/null +++ b/tests/keyctl.c @@ -0,0 +1,820 @@ +/* + * Check decoding of keyctl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_keyctl + +# include +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +/* This check should be before #include "xlat/keyctl_commands.h" */ +# ifndef KEYCTL_DH_COMPUTE +struct keyctl_dh_params { + int32_t private; + int32_t prime; + int32_t base; +}; +# endif + +# include "xlat.h" +# include "xlat/keyctl_commands.h" + +# ifndef KEY_SPEC_REQKEY_AUTH_KEY +# define KEY_SPEC_REQKEY_AUTH_KEY -7 +# endif + +# ifndef KEY_SPEC_REQUESTOR_KEYRING +# define KEY_SPEC_REQUESTOR_KEYRING -8 +# endif + +static const size_t limit = 10; + +/* + * Well, this is true for DESCRIBE and GET_SECURITY, and false for READ and + * DH_COMPUTE and I see no ability to pass this information without + * significantly breaking interface. + */ +bool nul_terminated_buf = true; +bool buf_in_arg = false; + +/* + * When this is called with positive size, the buffer provided is an "out" + * argument and rc contains resulting size (globally defined nul_terminated_buf + * controls whether it is nul-terminated or not). If size is negative, + * it contains "in" argument. + */ +void +print_quoted_string_limit(const char *str, size_t size, long rc) +{ + size_t print_size = ((rc >= 0) && (size > 0)) ? + ((unsigned long) rc > size ? size : + (unsigned long) rc) : size; + size_t limited_size = print_size > limit ? limit : print_size; + + if ((rc == -1) && !buf_in_arg) { + printf("%p", str); + return; + } + + if (!nul_terminated_buf || + (strnlen(str, limited_size) == limited_size)) { + printf("\""); + print_quoted_memory(str, limited_size); + if (print_size > limit) + printf("\"..."); + else + printf("\""); + } else { + printf("\""); + print_quoted_string(str); + printf("\""); + } +} + +static void +print_arg(kernel_ulong_t arg, const char *str, const char *fmt, size_t size, + long rc) +{ + if (size == (size_t) -1) + size = 0; + + if (str) { + printf("%s", str); + } else { + if (size == sizeof(uint64_t)) + printf(fmt, (uint64_t)arg); + else if (size == sizeof(uint32_t)) + printf(fmt, (uint32_t)arg); + else + print_quoted_string_limit((void *) (uintptr_t) arg, + size, rc); + } +} + +/* + * Arguments are passed as sz, val, str, fmt. Arguments are read until 4 + * arguments are retrieved or size of 0 is occurred. + * + * str == NULL && fmt == NULL && sz not in {4, 8} - print_quoted_string_limit is + * used for argument printing. If sz is negative, in argument is assumed, out + * otherwise. + */ +void +do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) +{ + kernel_ulong_t args[4] = { + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, + }; + const char *arg_str[4] = { NULL }; + const char *arg_fmt[4] = { "%llu", "%llu", "%llu", "%llu" }; + size_t arg_sz[4] = { + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + sizeof(kernel_ulong_t), + }; + unsigned i; + unsigned cnt = 0; + + va_list ap; + + va_start(ap, cmd_str); + + do { + arg_sz[cnt] = va_arg(ap, size_t); + if (!arg_sz[cnt]) + break; + + if (arg_sz[cnt] == sizeof(uint64_t)) + args[cnt] = va_arg(ap, uint64_t); + else if (arg_sz[cnt] == sizeof(uint32_t)) + args[cnt] = va_arg(ap, uint32_t); + else + args[cnt] = (uintptr_t) va_arg(ap, void *); + + arg_str[cnt] = va_arg(ap, char *); + arg_fmt[cnt] = va_arg(ap, char *); + } while (++cnt < 4); + + long rc = syscall(__NR_keyctl, cmd, args[0], args[1], args[2], args[3]); + const char *errstr = sprintrc(rc); + printf("keyctl(%s", cmd_str); + for (i = 0; i < cnt; i++) { + printf(", "); + print_arg(args[i], arg_str[i], arg_fmt[i], arg_sz[i], rc); + } + printf(") = %s\n", errstr); +} + +int +main(void) +{ + enum { PR_LIMIT = 10, IOV_SIZE = 11, IOV_STR_SIZE = 4096 }; + + static const char *kulong_fmt = + sizeof(kernel_ulong_t) == sizeof(uint64_t) ? "%#llx" : "%#x"; + static const char *ksize_fmt = + sizeof(kernel_ulong_t) == sizeof(uint64_t) ? "%llu" : "%u"; + static const char *ptr_fmt = + sizeof(void *) == sizeof(uint64_t) ? "%#llx" : "%#x"; + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char short_type_str[] = "shrt type"; + static const char short_desc_str[] = "shrt desc"; + static const char long_type_str[] = "overly long key type"; + static const char long_desc_str[] = "overly long key description"; + static const int32_t bogus_key1 = 0xdeadf00d; + static const int32_t bogus_key2 = 0x1eefdead; + static const kernel_ulong_t bogus_key3 = + (kernel_ulong_t) 0xdec0ded1dec0ded2ULL; + static const char *bogus_key3_str = "-557785390"; + + static const struct keyctl_dh_params kcdhp_data = { + KEY_SPEC_GROUP_KEYRING, 1234567890, 3141592653U }; + static const char *kcdhp_str = "{private=KEY_SPEC_GROUP_KEYRING, " + "prime=1234567890, base=-1153374643}"; + + char *bogus_str = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *short_type = tail_memdup(short_type_str, sizeof(short_type_str)); + char *short_desc = tail_memdup(short_desc_str, sizeof(short_desc_str)); + char *long_type = tail_memdup(long_type_str, sizeof(long_type_str)); + char *long_desc = tail_memdup(long_desc_str, sizeof(long_desc_str)); + char *kcdhp = tail_memdup(&kcdhp_data, sizeof(kcdhp_data)); + struct iovec *key_iov = tail_alloc(sizeof(*key_iov) * IOV_SIZE); + char *bogus_buf1 = tail_alloc(9); + char *bogus_buf2 = tail_alloc(256); + char *key_iov_str1; + char *key_iov_str2 = tail_alloc(4096); + ssize_t ret; + ssize_t kis_size = 0; + int i; + + key_iov[0].iov_base = short_type; + key_iov[0].iov_len = sizeof(short_type_str); + key_iov[1].iov_base = long_type; + key_iov[1].iov_len = sizeof(long_type_str); + key_iov[2].iov_base = short_desc; + key_iov[2].iov_len = sizeof(short_desc_str); + key_iov[3].iov_base = long_desc; + key_iov[3].iov_len = sizeof(long_desc_str); + key_iov[4].iov_base = bogus_str; + key_iov[4].iov_len = 32; + + for (i = 5; i < IOV_SIZE; i++) { + key_iov[i].iov_base = + (void *) (uintptr_t) (0xfffffacefffff00dULL + + 0x100000001ULL * i); + key_iov[i].iov_len = (size_t) (0xcaffeeeddefaced7ULL + + 0x100000001ULL * i); + } + + ret = asprintf(&key_iov_str1, "[{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}, " + "{iov_base=%p, iov_len=%zu}]", + key_iov[IOV_SIZE - 4].iov_base, + key_iov[IOV_SIZE - 4].iov_len, + key_iov[IOV_SIZE - 3].iov_base, + key_iov[IOV_SIZE - 3].iov_len, + key_iov[IOV_SIZE - 2].iov_base, + key_iov[IOV_SIZE - 2].iov_len, + key_iov[IOV_SIZE - 1].iov_base, + key_iov[IOV_SIZE - 1].iov_len); + + if (ret < 0) + error_msg_and_fail("asprintf"); + + ret = snprintf(key_iov_str2, IOV_STR_SIZE, + "[{iov_base=\"%s\\0\", iov_len=%zu}, " + "{iov_base=\"%.10s\"..., iov_len=%zu}, " + "{iov_base=\"%s\\0\", iov_len=%zu}, " + "{iov_base=\"%.10s\"..., iov_len=%zu}, ", + (char *) key_iov[0].iov_base, key_iov[0].iov_len, + (char *) key_iov[1].iov_base, key_iov[1].iov_len, + (char *) key_iov[2].iov_base, key_iov[2].iov_len, + (char *) key_iov[3].iov_base, key_iov[3].iov_len); + + if ((ret < 0) || (ret >= IOV_STR_SIZE)) + error_msg_and_fail("snprintf"); + + for (i = 4; i < PR_LIMIT; i++) { + kis_size += ret; + + ret = snprintf(key_iov_str2 + kis_size, IOV_STR_SIZE - kis_size, + "{iov_base=%p, iov_len=%zu}, ", + key_iov[i].iov_base, key_iov[i].iov_len); + + if ((ret < 0) || (ret >= (IOV_STR_SIZE - kis_size))) + error_msg_and_fail("snprintf"); + } + + kis_size += ret; + snprintf(key_iov_str2 + kis_size, IOV_STR_SIZE - kis_size, "...]"); + + + /* Invalid command */ + do_keyctl((kernel_ulong_t) 0xbadc0dedfacefeedULL, + "0xfacefeed /* KEYCTL_??? */", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, kulong_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, kulong_fmt); + + + /* GET_KEYRING_ID */ + do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", + NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", + sizeof(int), 3141592653U, NULL, "%d", + NULL, 0UL); + + + /* KEYCTL_JOIN_SESSION_KEYRING */ + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), ARG_STR(NULL), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), bogus_str, NULL, ptr_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), ARG_STR("bogus name"), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), + sizeof(char *), "very long keyring name", "\"very long \"...", + NULL, 0UL); + + + /* KEYCTL_UPDATE */ + + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UPDATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(short_desc_str) - 1, NULL, + ksize_fmt, + 0UL); + + buf_in_arg = false; + + + /* KEYCTL_REVOKE */ + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_REVOKE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_CHOWN */ + do_keyctl(ARG_STR(KEYCTL_CHOWN), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(uid_t), ARG_STR(-1), NULL, + sizeof(gid_t), ARG_STR(-1), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_CHOWN), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(gid_t), 3141592653U, NULL, "%u", 0UL); + + + /* KEYCTL_SETPERM */ + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, + sizeof(uint32_t), 0xffffffffU, + "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" + "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" + "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" + "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" + "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" + "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" + "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" + "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" + "0xc0c0c0c0", NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%#x", 0UL); + do_keyctl(ARG_STR(KEYCTL_SETPERM), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(uint32_t), 0xc0c0c0c0, "0xc0c0c0c0 /* KEY_??? */", + NULL, + 0UL); + + + /* KEYCTL_DESCRIBE */ + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DESCRIBE), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + + /* KEYCTL_CLEAR */ + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_CLEAR), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_LINK */ + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_LINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_UNLINK */ + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_UNLINK), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_SEARCH */ + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_USER_SESSION_KEYRING), + NULL); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(char *), bogus_desc, NULL, ptr_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_type, NULL, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_SEARCH), + sizeof(int32_t), 0, NULL, "%d", + sizeof(long_type_str), long_type, NULL, NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + + buf_in_arg = false; + + + /* KEYCTL_READ */ + nul_terminated_buf = false; + + /* Empty result is expected for these */ + bogus_buf1[0] = '\377'; + bogus_buf2[0] = '\377'; + + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_READ), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + nul_terminated_buf = true; + + /* KEYCTL_INSTANTIATE */ + buf_in_arg = true; + + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), 0, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, + ksize_fmt, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + + buf_in_arg = false; + + + /* KEYCTL_NEGATE */ + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(int32_t), 0, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_NEGATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_SET_REQKEY_KEYRING */ + do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(int32_t), ARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, + 0UL); + /* + * Keep it commented out until proper way of faking syscalls is not + * implemented. + */ + /* do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(int32_t), + ARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ + do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, + "0xbadc0ded /* KEY_REQKEY_DEFL_??? */", NULL, 0UL); + + + /* KEYCTL_SET_TIMEOUT */ + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + 0UL); + + + /* KEYCTL_ASSUME_AUTHORITY */ + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_GET_SECURITY */ + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), + sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + + + /* KEYCTL_SESSION_TO_PARENT */ + do_keyctl(ARG_STR(KEYCTL_SESSION_TO_PARENT), 0UL); + + + /* KEYCTL_REJECT */ + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), 0, NULL, "%d", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(uint32_t), 0, NULL, "%u", + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(uint32_t), 3141592653U, NULL, "%u", + sizeof(uint32_t), 2718281828U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_REJECT), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + sizeof(uint32_t), ARG_STR(ENODEV), NULL, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + + + /* KEYCTL_INSTANTIATE_IOV */ + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), 0, NULL, "%d", + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(int32_t), 0, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key1, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), key_iov + IOV_SIZE, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(int32_t), bogus_key2, NULL, "%d"); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(key_iov), key_iov + IOV_SIZE - 4, key_iov_str1, NULL, + sizeof(kernel_ulong_t), (kernel_ulong_t) 4, NULL, + ksize_fmt, + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(key_iov), key_iov, key_iov_str2, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) IOV_SIZE, NULL, ksize_fmt, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + + + /* KEYCTL_INVALIDATE */ + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_INVALIDATE), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_GET_PERSISTENT */ + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), ARG_STR(-1), NULL, + sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), + sizeof(uid_t), 2718281828U, NULL, "%u", + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + 0UL); + + + /* KEYCTL_DH_COMPUTE */ + nul_terminated_buf = false; + + /* Empty result is expected for these */ + bogus_buf1[0] = '\377'; + bogus_buf2[0] = '\377'; + + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(char *), kcdhp + 1, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff157ffffdeadULL, NULL, ptr_fmt, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), + (kernel_ulong_t) -1, NULL, ksize_fmt, 0UL); + + nul_terminated_buf = true; + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_keyctl"); + +#endif diff --git a/tests/keyctl.test b/tests/keyctl.test new file mode 100755 index 00000000..875a82d3 --- /dev/null +++ b/tests/keyctl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of keyctl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 diff --git a/tests/kill.c b/tests/kill.c new file mode 100644 index 00000000..cb884aa1 --- /dev/null +++ b/tests/kill.c @@ -0,0 +1,79 @@ +/* + * Check decoding of kill syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Fei Jie + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_kill + +# include +# include +# include + +static void +handler(int sig) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const int pid = getpid(); + long rc = syscall(__NR_kill, pid, (long) 0xdefaced00000000ULL | SIGALRM); + printf("kill(%d, SIGALRM) = %ld\n", pid, rc); + + const long big_pid = (long) 0xfacefeedbadc0dedULL; + const long big_sig = (long) 0xdeadbeefcafef00dULL; + rc = syscall(__NR_kill, big_pid, big_sig); + printf("kill(%d, %d) = %ld %s (%m)\n", + (int) big_pid, (int) big_sig, rc, errno2name()); + + rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0); + printf("kill(%d, SIG_0) = %ld\n", pid, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kill") + +#endif diff --git a/tests/kill.test b/tests/kill.test new file mode 100755 index 00000000..7a3a51aa --- /dev/null +++ b/tests/kill.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of kill syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -esignal=none diff --git a/tests/ksysent.c b/tests/ksysent.c new file mode 100644 index 00000000..8cac93ca --- /dev/null +++ b/tests/ksysent.c @@ -0,0 +1,128 @@ +/* + * Validate syscallent.h file. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "sysent.h" +#include +#include +#include + +#define TD 0 +#define TF 0 +#define TI 0 +#define TN 0 +#define TP 0 +#define TS 0 +#define TM 0 +#define NF 0 +#define MA 0 +#define SI 0 +#define SE 0 +#define CST 0 +#define SEN(arg) 0,0 + +static const struct_sysent syscallent[] = { +#include "syscallent.h" +}; + +typedef const char *pstr_t; +static const pstr_t ksyslist[] = { +#include "ksysent.h" +}; + +int +main(void) +{ + int rc = 0; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(ksyslist); ++i) { + if (!ksyslist[i]) + continue; + if (i >= ARRAY_SIZE(syscallent) || !syscallent[i].sys_name) { + fprintf(stderr, "warning: \"%s\" syscall #%u" + " is missing in syscallent.h\n", + ksyslist[i], i); + continue; + } +#ifdef SYS_socket_nsubcalls + if (i >= SYS_socket_subcall && + i < SYS_socket_subcall + SYS_socket_nsubcalls) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is a socket subcall in syscallent.h\n", + ksyslist[i], i); + rc = 1; + continue; + } +#endif +#ifdef SYS_ipc_nsubcalls + if (i >= SYS_ipc_subcall && + i < SYS_ipc_subcall + SYS_ipc_nsubcalls) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is an ipc subcall in syscallent.h\n", + ksyslist[i], i); + rc = 1; + continue; + } +#endif + if (strcmp(ksyslist[i], syscallent[i].sys_name)) { + fprintf(stderr, "error: \"%s\" syscall #%u" + " is \"%s\" in syscallent.h\n", + ksyslist[i], i, syscallent[i].sys_name); + rc = 1; + continue; + } + } + + for (i = 0; i < ARRAY_SIZE(syscallent); ++i) { + if (!syscallent[i].sys_name +#ifdef SYS_socket_nsubcalls + || (i >= SYS_socket_subcall && + i < SYS_socket_subcall + SYS_socket_nsubcalls) +#endif +#ifdef SYS_ipc_nsubcalls + || (i >= SYS_ipc_subcall && + i < SYS_ipc_subcall + SYS_ipc_nsubcalls) +#endif +#ifdef ARM_FIRST_SHUFFLED_SYSCALL + || (i >= ARM_FIRST_SHUFFLED_SYSCALL && + i <= ARM_FIRST_SHUFFLED_SYSCALL + + ARM_LAST_SPECIAL_SYSCALL + 1) +#endif + ) + continue; + if (i >= ARRAY_SIZE(ksyslist) || !ksyslist[i]) { + fprintf(stderr, "note: unknown syscall #%u" + " is \"%s\" in syscallent.h\n", + i, syscallent[i].sys_name); + } + } + + return rc; +} diff --git a/tests/ksysent.sed b/tests/ksysent.sed new file mode 100644 index 00000000..63ded4a9 --- /dev/null +++ b/tests/ksysent.sed @@ -0,0 +1,15 @@ +#!/bin/sed -rnf + +# should not have been exported at all +/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|syscalls|syscall_count|syscall_max|available|reserved|unused)/d + +# should not have been named this way +s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/ + +# legacy names +s/__NR_get_cpu/__NR_getcpu/ +s/__NR_madvise1/__NR_madvise/ +s/__NR_paccept/__NR_accept4/ + +# generate +s/#define[[:space:]]+__NR_([a-z_][^[:space:]]+)([[:space:]].*)?$/#ifdef __NR_\1\n[__NR_\1 \& 0xffff] = "\1",\n#endif/p diff --git a/tests/ksysent.test b/tests/ksysent.test new file mode 100755 index 00000000..80266488 --- /dev/null +++ b/tests/ksysent.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Validate syscallent.h + +./ksysent diff --git a/tests/lchown.c b/tests/lchown.c new file mode 100644 index 00000000..a07c878c --- /dev/null +++ b/tests/lchown.c @@ -0,0 +1,19 @@ +#include "tests.h" +#include + +#ifdef __NR_lchown + +# define SYSCALL_NR __NR_lchown +# define SYSCALL_NAME "lchown" + +# if defined __NR_lchown32 && __NR_lchown != __NR_lchown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lchown") + +#endif diff --git a/tests/lchown.test b/tests/lchown.test new file mode 100755 index 00000000..ceeaa859 --- /dev/null +++ b/tests/lchown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check lchown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 diff --git a/tests/lchown32.c b/tests/lchown32.c new file mode 100644 index 00000000..29cb01db --- /dev/null +++ b/tests/lchown32.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_lchown32 + +# define SYSCALL_NR __NR_lchown32 +# define SYSCALL_NAME "lchown32" +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lchown32") + +#endif diff --git a/tests/lchown32.test b/tests/lchown32.test new file mode 100755 index 00000000..6ee1ac95 --- /dev/null +++ b/tests/lchown32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check lchown32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests/libmmsg.c b/tests/libmmsg.c new file mode 100644 index 00000000..b0db26d2 --- /dev/null +++ b/tests/libmmsg.c @@ -0,0 +1,69 @@ +/* + * Wrappers for recvmmsg and sendmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#ifndef __NR_recvmmsg +# define __NR_recvmmsg -1 +#endif +#define SC_recvmmsg 19 + +#ifndef __NR_sendmmsg +# define __NR_sendmmsg -1 +#endif +#define SC_sendmmsg 20 + +int +recv_mmsg(const int fd, struct mmsghdr *const vec, + const unsigned int vlen, const unsigned int flags, + struct timespec *const timeout) +{ + int rc = socketcall(__NR_recvmmsg, SC_recvmmsg, + fd, (long) vec, vlen, flags, (long) timeout); + + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("recvmmsg"); + + return rc; +} + +int +send_mmsg(const int fd, struct mmsghdr *const vec, + const unsigned int vlen, const unsigned int flags) +{ + int rc = socketcall(__NR_sendmmsg, SC_sendmmsg, + fd, (long) vec, vlen, flags, 0); + + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("sendmmsg"); + + return rc; +} diff --git a/tests/libsocketcall.c b/tests/libsocketcall.c new file mode 100644 index 00000000..04d6710f --- /dev/null +++ b/tests/libsocketcall.c @@ -0,0 +1,69 @@ +/* + * Invoke a socket syscall, either directly or via __NR_socketcall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +/* + * Invoke a socket syscall, either directly or via __NR_socketcall. + * if nr == -1, no direct syscall invocation will be made. + */ +int +socketcall(const int nr, const int call, + long a1, long a2, long a3, long a4, long a5) +{ + int rc = -1; + errno = ENOSYS; + +# ifdef __NR_socketcall + static int have_socketcall = -1; + + if (have_socketcall < 0) { + if (syscall(__NR_socketcall, 0L, 0L, 0L, 0L, 0L) < 0 + && EINVAL == errno) { + have_socketcall = 1; + } else { + have_socketcall = 0; + } + } + + if (have_socketcall) { + const long args[] = { a1, a2, a3, a4, a5 }; + rc = syscall(__NR_socketcall, call, args); + } else +# endif + { + if (nr != -1) + rc = syscall(nr, a1, a2, a3, a4, a5); + } + + return rc; +} diff --git a/tests/link.c b/tests/link.c new file mode 100644 index 00000000..d6550fd3 --- /dev/null +++ b/tests/link.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_link + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "link_sample_old"; + static const char sample_2[] = "link_sample_new"; + + long rc = syscall(__NR_link, sample_1, sample_2); + printf("link(\"%s\", \"%s\") = %ld %s (%m)\n", + sample_1, sample_2, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_link") + +#endif diff --git a/tests/link.test b/tests/link.test new file mode 100755 index 00000000..cfa2b0cc --- /dev/null +++ b/tests/link.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check link syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/linkat.c b/tests/linkat.c new file mode 100644 index 00000000..64b900ea --- /dev/null +++ b/tests/linkat.c @@ -0,0 +1,37 @@ +#include "tests.h" +#include + +#ifdef __NR_linkat + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "linkat_sample_old"; + static const char sample_2[] = "linkat_sample_new"; + const long fd_old = (long) 0xdeadbeefffffffffULL; + const long fd_new = (long) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_linkat, fd_old, sample_1, fd_new, sample_2, 0); + printf("linkat(%d, \"%s\", %d, \"%s\", 0) = %ld %s (%m)\n", + (int) fd_old, sample_1, (int) fd_new, sample_2, + rc, errno2name()); + + rc = syscall(__NR_linkat, -100, sample_1, -100, sample_2, -1L); + printf("linkat(%s, \"%s\", %s, \"%s\", %s) = %ld %s (%m)\n", + "AT_FDCWD", sample_1, "AT_FDCWD", sample_2, + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_linkat") + +#endif diff --git a/tests/linkat.test b/tests/linkat.test new file mode 100755 index 00000000..5627de7f --- /dev/null +++ b/tests/linkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check linkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/llseek.c b/tests/llseek.c new file mode 100644 index 00000000..e687e947 --- /dev/null +++ b/tests/llseek.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR__llseek + +# include +# include + +int +main(void) +{ + const unsigned long high = 0xfacefeed; + const unsigned long low = 0xdeadbeef; + const long long offset = 0xfacefeeddeadbeefLL; + unsigned long long result; + + long rc = syscall(__NR__llseek, -1, high, low, &result, SEEK_SET); + printf("_llseek(-1, %lld, %p, SEEK_SET) = %ld %s (%m)\n", + offset, &result, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR__llseek") + +#endif diff --git a/tests/llseek.test b/tests/llseek.test new file mode 100755 index 00000000..cf1607ed --- /dev/null +++ b/tests/llseek.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check _llseek syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -e_llseek $args > "$EXP" +grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests/lookup_dcookie.c b/tests/lookup_dcookie.c new file mode 100644 index 00000000..986180ce --- /dev/null +++ b/tests/lookup_dcookie.c @@ -0,0 +1,96 @@ +/* + * Check decoding of lookup_dcookie syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_lookup_dcookie + +# include +# include +# include +# include + +static void +do_lookup_cookie(uint64_t cookie, char *buf, kernel_ulong_t len) +{ + long rc; + const char *errstr; + +# if (LONG_MAX > INT_MAX) \ + || (defined __x86_64__ && defined __ILP32__) \ + || defined LINUX_MIPSN32 + rc = syscall(__NR_lookup_dcookie, cookie, buf, len); +# else + rc = syscall(__NR_lookup_dcookie, LL_VAL_TO_PAIR(cookie), buf, len); +# endif + + errstr = sprintrc(rc); + printf("lookup_dcookie(%" PRIu64 ", ", cookie); + + /* Here, we trust successful return code */ + if ((rc >= 0) && (rc < (long) INT_MAX)) { + printf("%.*s, ", (int) rc, buf); + } else { + if (buf != NULL) + printf("%p, ", buf); + else + printf("NULL, "); + } + + printf("%" PRIu64 ") = %s\n", (uint64_t) len, errstr); +} + +int +main(void) +{ + enum { BUF_SIZE = 4096 }; + + static const uint64_t bogus_cookie = + (uint64_t) 0xf157feeddeadfaceULL; + static const kernel_ulong_t bogus_len = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + + char *buf = tail_alloc(BUF_SIZE); + + do_lookup_cookie(0, NULL, 0); + do_lookup_cookie(bogus_cookie, buf + BUF_SIZE, bogus_len); + do_lookup_cookie(bogus_cookie, buf, BUF_SIZE); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_lookup_dcookie"); + +#endif diff --git a/tests/lookup_dcookie.test b/tests/lookup_dcookie.test new file mode 100755 index 00000000..47e1c2d6 --- /dev/null +++ b/tests/lookup_dcookie.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of lookup_cookie syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/lseek.c b/tests/lseek.c new file mode 100644 index 00000000..4428c4e9 --- /dev/null +++ b/tests/lseek.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lseek + +# include +# include + +int +main(void) +{ + const kernel_ulong_t offset = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + + if (sizeof(offset) > sizeof(long)) { + /* + * Cannot use syscall because it takes long arguments. + * Let's call lseek with hope it will invoke lseek syscall. + */ + long long rc = lseek(-1, offset, SEEK_SET); + printf("lseek(-1, %lld, SEEK_SET) = %lld %s (%m)\n", + (long long) offset, rc, errno2name()); + } else { + long rc = syscall(__NR_lseek, -1L, offset, SEEK_SET); + printf("lseek(-1, %ld, SEEK_SET) = %ld %s (%m)\n", + (long) offset, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_lseek") + +#endif diff --git a/tests/lseek.test b/tests/lseek.test new file mode 100755 index 00000000..f96a91d1 --- /dev/null +++ b/tests/lseek.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check lseek syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a30 -elseek $args > "$EXP" +grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests/lstat.c b/tests/lstat.c new file mode 100644 index 00000000..3754f766 --- /dev/null +++ b/tests/lstat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lstat + +# define TEST_SYSCALL_NR __NR_lstat +# define TEST_SYSCALL_STR "lstat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lstat") + +#endif diff --git a/tests/lstat.test b/tests/lstat.test new file mode 100755 index 00000000..f513bb48 --- /dev/null +++ b/tests/lstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check lstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests/lstat64.c b/tests/lstat64.c new file mode 100644 index 00000000..da06609d --- /dev/null +++ b/tests/lstat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_lstat64 + +# define TEST_SYSCALL_NR __NR_lstat64 +# define TEST_SYSCALL_STR "lstat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lstat64") + +#endif diff --git a/tests/lstat64.test b/tests/lstat64.test new file mode 100755 index 00000000..fcafe79d --- /dev/null +++ b/tests/lstat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check lstat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests/lstatx.c b/tests/lstatx.c new file mode 100644 index 00000000..cdd1124b --- /dev/null +++ b/tests/lstatx.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(TEST_SYSCALL_NR, sample, pst) +#define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(\"%s\", ", TEST_SYSCALL_STR, sample) +#define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +#include "xstatx.c" diff --git a/tests/match.awk b/tests/match.awk new file mode 100644 index 00000000..abfbae92 --- /dev/null +++ b/tests/match.awk @@ -0,0 +1,53 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# s[] is array of match strings +# r[] is array of match patterns + +NR > lines { next } + +{ + if (s[NR]) { + if ($0 == s[NR]) + next + print "Line " NR " does not match expected string: " s[NR] + } else { + if (match($0, r[NR])) + next + print "Line " NR " does not match expected pattern: " r[NR] + } + + fail = 1 +} + +END { + if (fail == 0 && NR != lines) { + fail = 1 + print "Expected " lines " lines, found " NR " line(s)." + } + exit fail +} diff --git a/tests/mbind.c b/tests/mbind.c new file mode 100644 index 00000000..b0544263 --- /dev/null +++ b/tests/mbind.c @@ -0,0 +1,61 @@ +/* + * Check decoding of mbind syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_mbind + +# include +# include + +int +main(void) +{ + const unsigned long len = (unsigned long) 0xcafef00dbadc0dedULL; + const unsigned long mode = 3; + const unsigned long nodemask = (unsigned long) 0xfacefeedfffffff1ULL; + const unsigned long maxnode = (unsigned long) 0xdeadbeeffffffff2ULL; + const unsigned long flags = -1UL; + + long rc = syscall(__NR_mbind, 0, len, mode, nodemask, maxnode, flags); + printf("mbind(NULL, %lu, %s, %#lx, %lu, %s|%#x) = %ld %s (%m)\n", + len, "MPOL_INTERLEAVE", nodemask, maxnode, + "MPOL_MF_STRICT|MPOL_MF_MOVE|MPOL_MF_MOVE_ALL", + (unsigned) flags & ~7, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mbind") + +#endif diff --git a/tests/mbind.test b/tests/mbind.test new file mode 100755 index 00000000..2a07cac6 --- /dev/null +++ b/tests/mbind.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mbind syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/membarrier.c b/tests/membarrier.c new file mode 100644 index 00000000..330893b6 --- /dev/null +++ b/tests/membarrier.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_membarrier + +# include +# include +# include +# include + +int +main(void) +{ + assert(syscall(__NR_membarrier, 3, 255) == -1); + int saved_errno = errno; + printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n", + sprintrc(-1)); + if (saved_errno != ENOSYS) { + /* the test needs to be updated? */ + assert(syscall(__NR_membarrier, 0, 0) == 1); + puts("membarrier(MEMBARRIER_CMD_QUERY, 0)" + " = 0x1 (MEMBARRIER_CMD_SHARED)"); + } + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_membarrier") + +#endif diff --git a/tests/membarrier.test b/tests/membarrier.test new file mode 100755 index 00000000..ad1f713b --- /dev/null +++ b/tests/membarrier.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check membarrier syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/memfd_create.c b/tests/memfd_create.c new file mode 100644 index 00000000..480fd177 --- /dev/null +++ b/tests/memfd_create.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_memfd_create + +# include +# include + +int +main(void) +{ + static const char text[] = "strace"; + int rc = syscall(__NR_memfd_create, text, 7); + + printf("memfd_create(\"%s\", %s) = %d %s (%m)\n", + text, "MFD_CLOEXEC|MFD_ALLOW_SEALING|0x4", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_memfd_create") + +#endif diff --git a/tests/memfd_create.test b/tests/memfd_create.test new file mode 100755 index 00000000..4361dae4 --- /dev/null +++ b/tests/memfd_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of memfd_create syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/migrate_pages.c b/tests/migrate_pages.c new file mode 100644 index 00000000..4c303e38 --- /dev/null +++ b/tests/migrate_pages.c @@ -0,0 +1,54 @@ +/* + * Check decoding of migrate_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_migrate_pages + +# include +# include + +int +main(void) +{ + const long pid = (long) 0xfacefeedffffffffULL; + long rc = syscall(__NR_migrate_pages, pid, 0, 0, 0); + printf("migrate_pages(%d, 0, NULL, NULL) = %ld %s (%m)\n", + (int) pid, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_migrate_pages") + +#endif diff --git a/tests/migrate_pages.test b/tests/migrate_pages.test new file mode 100755 index 00000000..fad53b79 --- /dev/null +++ b/tests/migrate_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check migrate_pages syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests/mincore.c b/tests/mincore.c new file mode 100644 index 00000000..ea2b49e3 --- /dev/null +++ b/tests/mincore.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#define DEFAULT_STRLEN 32 + +static void +print_mincore(const unsigned int pages, void *const addr, + const size_t size, unsigned char *const vec) +{ + unsigned int i; + + if (mincore(addr, size, vec)) + perror_msg_and_skip("mincore"); + + printf("mincore(%p, %zu, [", addr, size); + for (i = 0; i < pages; ++i) { + if (i) + printf(", "); + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } + printf("%u", vec[i] & 1); + } + puts("]) = 0"); +} + +static void +test_mincore(const unsigned int pages) +{ + const size_t page_size = get_page_size(); + const size_t size = pages * page_size; + void *const addr = tail_alloc(size); + unsigned char *const vec = tail_alloc(pages); + + mincore(addr, size, NULL); + printf("mincore(%p, %zu, NULL) = -1 %s (%m)\n", + addr, size, errno2name()); + + print_mincore(pages, addr, size, vec); + if (size) + print_mincore(pages, addr, size - page_size + 1, vec); +} + +int main(void) +{ + test_mincore(1); + test_mincore(2); + test_mincore(DEFAULT_STRLEN); + test_mincore(DEFAULT_STRLEN + 1); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/mincore.test b/tests/mincore.test new file mode 100755 index 00000000..6af9f492 --- /dev/null +++ b/tests/mincore.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mincore syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/mkdir.c b/tests/mkdir.c new file mode 100644 index 00000000..d971b188 --- /dev/null +++ b/tests/mkdir.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_mkdir + +# define TEST_SYSCALL_NR __NR_mkdir +# define TEST_SYSCALL_STR "mkdir" +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_mkdir") + +#endif diff --git a/tests/mkdir.test b/tests/mkdir.test new file mode 100755 index 00000000..38ed6928 --- /dev/null +++ b/tests/mkdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mkdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/mkdirat.c b/tests/mkdirat.c new file mode 100644 index 00000000..6bfe4a5f --- /dev/null +++ b/tests/mkdirat.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_mkdirat + +# define TEST_SYSCALL_NR __NR_mkdirat +# define TEST_SYSCALL_STR "mkdirat" +# define TEST_SYSCALL_PREFIX_ARGS (long int) 0xdeadbeefffffffffULL, +# define TEST_SYSCALL_PREFIX_STR "-1, " +# include "umode_t.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_mkdirat") + +#endif diff --git a/tests/mkdirat.test b/tests/mkdirat.test new file mode 100755 index 00000000..0fcb841a --- /dev/null +++ b/tests/mkdirat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mkdirat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/mknod.c b/tests/mknod.c new file mode 100644 index 00000000..4cc1c5cb --- /dev/null +++ b/tests/mknod.c @@ -0,0 +1,73 @@ +#include "tests.h" +#include + +#ifdef __NR_mknod + +# include +# include +# include +# include + +static const char sample[] = "mknod"; + +static long +call_mknod(unsigned short mode, unsigned long dev) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + return syscall(__NR_mknod, sample, lmode, dev); +} + +int +main(void) +{ + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + long rc = call_mknod(0, dev); + printf("mknod(\"%s\", 000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(0xffff, dev); + printf("mknod(\"%s\", %#03ho) = %ld %s (%m)\n", + sample, (unsigned short) -1, rc, errno2name()); + + rc = call_mknod(S_IFREG, 0); + printf("mknod(\"%s\", S_IFREG|000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFDIR | 06, 0); + printf("mknod(\"%s\", S_IFDIR|006) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFLNK | 060, 0); + printf("mknod(\"%s\", S_IFLNK|060) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknod(S_IFIFO | 0600, 0); + printf("mknod(\"%s\", S_IFIFO|0600) = %ld %s (%m)\n", + sample, rc, errno2name()); + + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); + + rc = call_mknod(S_IFCHR | 024, dev); + printf("mknod(\"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + sample, rc, errno2name()); + + const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + rc = call_mknod(mode, dev); + printf("mknod(\"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" + ", makedev(%u, %u)) = %ld %s (%m)\n", + sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + major((unsigned) dev), minor((unsigned) dev), + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mknod") + +#endif diff --git a/tests/mknod.test b/tests/mknod.test new file mode 100755 index 00000000..195f1e33 --- /dev/null +++ b/tests/mknod.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mknod syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/mknodat.c b/tests/mknodat.c new file mode 100644 index 00000000..756e2771 --- /dev/null +++ b/tests/mknodat.c @@ -0,0 +1,74 @@ +#include "tests.h" +#include + +#ifdef __NR_mknodat + +# include +# include +# include +# include + +static const char sample[] = "mknodat_sample"; +static const long int fd = (long int) 0xdeadbeefffffffffULL; + +static long +call_mknodat(unsigned short mode, unsigned long dev) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + return syscall(__NR_mknodat, fd, sample, lmode, dev); +} + +int +main(void) +{ + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + long rc = call_mknodat(0, dev); + printf("mknodat(-1, \"%s\", 000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(0xffff, dev); + printf("mknodat(-1, \"%s\", %#03ho) = %ld %s (%m)\n", + sample, (unsigned short) -1, rc, errno2name()); + + rc = call_mknodat(S_IFREG, 0); + printf("mknodat(-1, \"%s\", S_IFREG|000) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFDIR | 06, 0); + printf("mknodat(-1, \"%s\", S_IFDIR|006) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFLNK | 060, 0); + printf("mknodat(-1, \"%s\", S_IFLNK|060) = %ld %s (%m)\n", + sample, rc, errno2name()); + + rc = call_mknodat(S_IFIFO | 0600, 0); + printf("mknodat(-1, \"%s\", S_IFIFO|0600) = %ld %s (%m)\n", + sample, rc, errno2name()); + + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); + + rc = call_mknodat(S_IFCHR | 024, dev); + printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + sample, rc, errno2name()); + + const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; + + rc = call_mknodat(mode, dev); + printf("mknodat(-1, \"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" + ", makedev(%u, %u)) = %ld %s (%m)\n", + sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + major((unsigned) dev), minor((unsigned) dev), + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mknodat") + +#endif diff --git a/tests/mknodat.test b/tests/mknodat.test new file mode 100755 index 00000000..1701a368 --- /dev/null +++ b/tests/mknodat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mknodat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/mlock.c b/tests/mlock.c new file mode 100644 index 00000000..8e9806bd --- /dev/null +++ b/tests/mlock.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#if defined __NR_mlock && defined __NR_munlock + +# include +# include + +int +main(void) +{ + const int size = 1024; + const char *addr = tail_alloc(size); + + long rc = syscall(__NR_mlock, addr, size); + printf("mlock(%p, %d) = %s\n", addr, size, sprintrc(rc)); + + rc = syscall(__NR_munlock, addr, size); + printf("munlock(%p, %d) = %s\n", addr, size, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mlock && __NR_munlock") + +#endif diff --git a/tests/mlock.test b/tests/mlock.test new file mode 100755 index 00000000..9a73a306 --- /dev/null +++ b/tests/mlock.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mlock and munlock syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mlock,munlock -a20 diff --git a/tests/mlock2.c b/tests/mlock2.c new file mode 100644 index 00000000..71a2003e --- /dev/null +++ b/tests/mlock2.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_mlock2 + +# include +# include + +int +main(void) +{ + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long len = (unsigned long) 0xcafef00dbadc0dedULL; + + long rc = syscall(__NR_mlock2, addr, len, -1UL); + printf("mlock2(%#lx, %lu, MLOCK_ONFAULT|0xfffffffe)" + " = %ld %s (%m)\n", addr, len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mlock2") + +#endif diff --git a/tests/mlock2.test b/tests/mlock2.test new file mode 100755 index 00000000..bc412e97 --- /dev/null +++ b/tests/mlock2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mlock2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/mlockall.c b/tests/mlockall.c new file mode 100644 index 00000000..682d070d --- /dev/null +++ b/tests/mlockall.c @@ -0,0 +1,46 @@ +/* + * Check decoding of mlockall syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include + +int +main(void) +{ + int rc = mlockall(0); + printf("mlockall(0) = %s\n", sprintrc(rc)); + + rc = mlockall(MCL_CURRENT); + printf("mlockall(MCL_CURRENT) = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/mlockall.test b/tests/mlockall.test new file mode 100755 index 00000000..d7a6182d --- /dev/null +++ b/tests/mlockall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mlockall syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/mmap.c b/tests/mmap.c new file mode 100644 index 00000000..f726f63e --- /dev/null +++ b/tests/mmap.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +int +main(int ac, char **av) +{ + const char *const name = ac > 1 ? av[1] : "mmap"; + const intmax_t pagesize = get_page_size(); + const unsigned long length1 = pagesize * 6; + const unsigned long length2 = pagesize * 3; + const unsigned long length3 = pagesize * 2; + const int fd = -1; + off_t offset; + void *addr, *p; + +#if ULONG_MAX > 4294967295UL + offset = 0xcafedeadbeef000ULL & -pagesize; + addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); +#else + offset = 0xdeadbeef000ULL & -pagesize; + addr = (void *) (unsigned int) (0xfaced000 & -pagesize); +#endif + const uintmax_t uoffset = + sizeof(offset) == sizeof(int) ? (uintmax_t) (unsigned int) offset + : (uintmax_t) offset; + + (void) close(0); + (void) close(0); + printf("%s(NULL, 0, PROT_NONE, MAP_FILE, 0, 0) = -1 EBADF (%m)\n", + name); + mmap(NULL, 0, PROT_NONE, MAP_FILE, 0, 0); + + p = mmap(addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, offset); + if (MAP_FAILED == p) + perror_msg_and_fail("mmap"); + printf("%s(%p, %lu, PROT_READ|PROT_WRITE, " + "MAP_PRIVATE|MAP_ANONYMOUS, %d, %#jx) = %p\n", + name, addr, length1, fd, uoffset, p); + + if (msync(p, length1, MS_SYNC)) + perror_msg_and_fail("msync"); + printf("msync(%p, %lu, MS_SYNC) = 0\n", p, length1); + + if (mprotect(p, length1, PROT_NONE)) + perror_msg_and_fail("mprotect"); + printf("mprotect(%p, %lu, PROT_NONE) = 0\n", p, length1); + + addr = mremap(p, length1, length2, 0); + if (MAP_FAILED == addr) + perror_msg_and_fail("mremap"); + printf("mremap(%p, %lu, %lu, 0) = %p\n", p, length1, length2, addr); + + p = mremap(addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2); + if (MAP_FAILED == p) + perror_msg_and_fail("mremap"); + printf("mremap(%p, %lu, %lu, MREMAP_MAYMOVE|MREMAP_FIXED" + ", %p) = %p\n", addr, length2, length3, addr + length2, p); + + if (madvise(p, length3, MADV_NORMAL)) + perror_msg_and_fail("madvise"); + printf("madvise(%p, %lu, MADV_NORMAL) = 0\n", p, length3); + + if (munmap(p, length3)) + perror_msg_and_fail("munmap"); + printf("munmap(%p, %lu) = 0\n", p, length3); + + if (mlockall(MCL_FUTURE)) + perror_msg_and_fail("mlockall"); + puts("mlockall(MCL_FUTURE) = 0"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/mmap.test b/tests/mmap.test new file mode 100755 index 00000000..0b87114a --- /dev/null +++ b/tests/mmap.test @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Check mmap/mmap2, madvise, mlockall, mprotect, mremap, msync, and munmap +# syscalls decoding. +# +# Copyright (c) 2015-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_prog grep +check_prog sed +run_prog > /dev/null + +syscall= +for n in mmap mmap2; do + $STRACE -e$n -h > /dev/null && syscall=$syscall,$n +done +run_strace -e$syscall $args > /dev/null + +if grep '^mmap(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then + mmap=mmap +elif grep '^mmap2(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then + mmap=mmap2 +else + dump_log_and_fail_with "mmap/mmap2 not found in $STRACE $args output" +fi + +syscall=$mmap,madvise,mlockall,mprotect,mremap,msync,munmap + +run_prog "./$NAME" $mmap > /dev/null +run_strace -a20 -e$syscall $args > "$EXP" +sed -n "/^$mmap(NULL, 0, PROT_NONE,/,\$p" < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/mmap64.c b/tests/mmap64.c new file mode 100644 index 00000000..b31ce427 --- /dev/null +++ b/tests/mmap64.c @@ -0,0 +1 @@ +#include "mmap.c" diff --git a/tests/mmap64.test b/tests/mmap64.test new file mode 100755 index 00000000..51f1896e --- /dev/null +++ b/tests/mmap64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check mmap/mprotect/munmap syscalls decoding. +# Target executable was compiled with -D_FILE_OFFSET_BITS=64. + +. "${srcdir=.}/mmap.test" diff --git a/tests/mmsg-silent.c b/tests/mmsg-silent.c new file mode 100644 index 00000000..47d0a504 --- /dev/null +++ b/tests/mmsg-silent.c @@ -0,0 +1,63 @@ +/* + * Check silent decoding of sendmmsg and recvmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#include "msghdr.h" + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + char buf = 'A'; + struct iovec iov = { .iov_base = &buf, .iov_len = sizeof(buf) }; + struct mmsghdr mh = { + .msg_hdr = { + .msg_iov = &iov, + .msg_iovlen = 1 + } + }; + + int rc = send_mmsg(fds[1], &mh, 1, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("sendmmsg"); + printf("sendmmsg(%d, %p, 1, MSG_DONTWAIT) = %d\n", fds[1], &mh, rc); + + struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + rc = recv_mmsg(fds[0], &mh, 1, MSG_DONTWAIT, &t); + printf("recvmmsg(%d, %p, 1, MSG_DONTWAIT, %p) = %d\n", + fds[0], &mh, &t, rc); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/mmsg-silent.test b/tests/mmsg-silent.test new file mode 100755 index 00000000..775e0ad3 --- /dev/null +++ b/tests/mmsg-silent.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check silent decoding of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests/mmsg.c b/tests/mmsg.c new file mode 100644 index 00000000..88805d16 --- /dev/null +++ b/tests/mmsg.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2014 Masatake YAMATO + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#include "msghdr.h" + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, fds)) + perror_msg_and_skip("socketpair"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + const struct iovec w0_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + } + }; + struct iovec *w0_iov = tail_memdup(w0_iov_, sizeof(w0_iov_)); + + const struct iovec w1_iov_[] = { + { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + struct iovec *w1_iov = tail_memdup(w1_iov_, sizeof(w1_iov_)); + + const struct mmsghdr w_mmh_[] = { + { + .msg_hdr = { + .msg_iov = w0_iov, + .msg_iovlen = ARRAY_SIZE(w0_iov_), + } + }, { + .msg_hdr = { + .msg_iov = w1_iov, + .msg_iovlen = ARRAY_SIZE(w1_iov_), + } + } + }; + void *w_mmh = tail_memdup(w_mmh_, sizeof(w_mmh_)); + const unsigned int n_w_mmh = ARRAY_SIZE(w_mmh_); + + int r = send_mmsg(1, w_mmh, n_w_mmh, MSG_DONTROUTE | MSG_NOSIGNAL); + if (r < 0) + perror_msg_and_skip("sendmmsg"); + assert(r == (int) n_w_mmh); + assert(close(1) == 0); + tprintf("sendmmsg(1, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}" + ", {msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}], %u" + ", MSG_DONTROUTE|MSG_NOSIGNAL) = %d\n" + " = %u buffers in vector 0\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " = %u buffers in vector 1\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), + w1_c, LENGTH_OF(w1_c), + ARRAY_SIZE(w0_iov_), + LENGTH_OF(w0_c) + LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w1_iov_), + LENGTH_OF(w2_c), + n_w_mmh, r, + ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, + ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + struct iovec *r0_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = r_len + } + }; + struct iovec *r1_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + const struct mmsghdr r_mmh_[] = { + { + .msg_hdr = { + .msg_iov = r0_iov, + .msg_iovlen = ARRAY_SIZE(r0_iov_), + } + }, { + .msg_hdr = { + .msg_iov = r1_iov, + .msg_iovlen = ARRAY_SIZE(r1_iov_), + } + } + }; + void *r_mmh = tail_memdup(r_mmh_, sizeof(r_mmh_)); + const unsigned int n_r_mmh = ARRAY_SIZE(r_mmh_); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + assert(recv_mmsg(0, r_mmh, n_r_mmh, MSG_DONTWAIT, NULL) == (int) n_r_mmh); + assert(close(0) == 0); + tprintf("recvmmsg(0, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}" + ", {msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, msg_len=%u}], %u" + ", MSG_DONTWAIT, NULL) = %d\n" + " = %u buffers in vector 0\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " = %u buffers in vector 1\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), + r1_c, r_len, r_len, ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + n_r_mmh, r, + ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), r0_d, r0_c, + ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), r1_d, r1_c); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/mmsg.test b/tests/mmsg.test new file mode 100755 index 00000000..a8148ba8 --- /dev/null +++ b/tests/mmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check how iovecs in struct mmsghdr are decoded. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmmsg,sendmmsg -e read=0 -e write=1 diff --git a/tests/mmsg_name-v.c b/tests/mmsg_name-v.c new file mode 100644 index 00000000..c663536d --- /dev/null +++ b/tests/mmsg_name-v.c @@ -0,0 +1,4 @@ +/* This file is part of mmsg_name-v strace test. */ +#define VERBOSE 1 +#define TEST_NAME "mmsg_name-v" +#include "mmsg_name.c" diff --git a/tests/mmsg_name-v.test b/tests/mmsg_name-v.test new file mode 100755 index 00000000..ab8dfba6 --- /dev/null +++ b/tests/mmsg_name-v.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check verbose decoding of msg_name* fields of struct msghdr array argument +# of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests/mmsg_name.c b/tests/mmsg_name.c new file mode 100644 index 00000000..a7a55c55 --- /dev/null +++ b/tests/mmsg_name.c @@ -0,0 +1,242 @@ +/* + * Check decoding of msg_name* fields of struct msghdr array argument + * of sendmmsg and recvmmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "msghdr.h" + +#define DEFAULT_STRLEN 32 + +#define IOV_MAX1 (IOV_MAX + 1) + +#ifndef TEST_NAME +# define TEST_NAME "mmsg_name" +#endif + +static void +print_msghdr(const struct msghdr *const msg, const int user_msg_namelen) +{ + const struct sockaddr_un *const un = msg->msg_name; + const int offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + + printf("{msg_name="); + if (!un) + printf("NULL"); + else if (user_msg_namelen < offsetof_sun_path) { + printf("%p", un); + } else { + printf("{sa_family=AF_UNIX"); + if (user_msg_namelen > offsetof_sun_path) { + int len = user_msg_namelen < (int) msg->msg_namelen ? + user_msg_namelen : (int) msg->msg_namelen; + len -= offsetof_sun_path; + if (len > (int) sizeof(un->sun_path)) + len = sizeof(un->sun_path); + printf(", sun_path=\"%.*s\"", len, un->sun_path); + } + printf("}"); + } + printf(", msg_namelen="); + if (user_msg_namelen != (int) msg->msg_namelen) { + printf("%d->", user_msg_namelen); + } + printf("%d, msg_iov=[{iov_base=\"%c\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}", + (int) msg->msg_namelen, * (char *) msg->msg_iov[0].iov_base); +} + +static void +test_mmsg_name(const int send_fd, const int recv_fd) +{ + struct sockaddr_un *const send_addr = + tail_alloc(sizeof(*send_addr) * IOV_MAX1); + char *const send_buf = tail_alloc(sizeof(*send_buf) * IOV_MAX1); + struct iovec *const send_iov = tail_alloc(sizeof(*send_iov) * IOV_MAX1); + struct mmsghdr *const send_mh = tail_alloc(sizeof(*send_mh) * IOV_MAX1); + + int i, rc; + + for (i = 0; i < IOV_MAX1; ++i) { + int sun_len = i + 1 > (int) sizeof(send_addr[i].sun_path) + ? (int) sizeof(send_addr[i].sun_path) + : i + 1; + + send_addr[i].sun_family = AF_UNIX; + memset(send_addr[i].sun_path, 'a' + i % 26, sun_len); + + send_buf[i] = '0' + i % 10; + + send_iov[i].iov_base = &send_buf[i]; + send_iov[i].iov_len = sizeof(*send_buf); + + send_mh[i].msg_hdr.msg_iov = &send_iov[i]; + send_mh[i].msg_hdr.msg_iovlen = 1; + send_mh[i].msg_hdr.msg_name = &send_addr[i]; + send_mh[i].msg_hdr.msg_namelen = i + 1; + send_mh[i].msg_hdr.msg_control = 0; + send_mh[i].msg_hdr.msg_controllen = 0; + send_mh[i].msg_hdr.msg_flags = 0; + } + + rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); + int saved_errno = errno; + + printf("sendmmsg(%d, [", send_fd); + for (i = 0; i < IOV_MAX1; ++i) { + if (i) + printf(", "); + if (i >= IOV_MAX +# if !VERBOSE + || i >= DEFAULT_STRLEN +# endif + ) { + printf("..."); + break; + } + printf("{msg_hdr="); + print_msghdr(&send_mh[i].msg_hdr, i + 1); + printf("}"); + } + errno = saved_errno; + printf("], %u, MSG_DONTWAIT) = %d %s (%m)\n", + IOV_MAX1, rc, errno2name()); + + for (i = 0; i < IOV_MAX1; ++i) { + send_mh[i].msg_hdr.msg_name = 0; + send_mh[i].msg_hdr.msg_namelen = 0; + } + + /* + * When recvmmsg is called with a valid descriptor + * but inaccessible memory, it causes segfaults on some architectures. + * As in these cases we test decoding of failed recvmmsg calls, + * it's ok to fail recvmmsg with any reason as long as + * it doesn't read that inaccessible memory. + */ + rc = send_mmsg(-1, &send_mh[IOV_MAX], 2, MSG_DONTWAIT); + saved_errno = errno; + printf("sendmmsg(-1, [{msg_hdr="); + print_msghdr(&send_mh[IOV_MAX].msg_hdr, 0); + errno = saved_errno; + printf("}, %p], %u, MSG_DONTWAIT) = %d %s (%m)\n", + &send_mh[IOV_MAX1], 2, rc, errno2name()); + + rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("sendmmsg"); + + printf("sendmmsg(%d, [", send_fd); + for (i = 0; i < IOV_MAX1; ++i) { + if (i) + printf(", "); + if (i >= IOV_MAX +#if !VERBOSE + || i >= DEFAULT_STRLEN +#endif + ) { + printf("..."); + break; + } + printf("{msg_hdr="); + print_msghdr(&send_mh[i].msg_hdr, 0); + printf("%s}", i < rc ? ", msg_len=1" : ""); + } + printf("], %u, MSG_DONTWAIT) = %d\n", IOV_MAX1, rc); + + struct sockaddr_un *const recv_addr = + tail_alloc(sizeof(*recv_addr) * IOV_MAX1); + char *const recv_buf = tail_alloc(sizeof(*recv_buf) * IOV_MAX1); + struct iovec *const recv_iov = tail_alloc(sizeof(*recv_iov) * IOV_MAX1); + struct mmsghdr *const recv_mh = tail_alloc(sizeof(*recv_mh) * IOV_MAX1); + + for (i = 0; i < IOV_MAX1; ++i) { + recv_iov[i].iov_base = &recv_buf[i]; + recv_iov[i].iov_len = sizeof(*recv_buf); + + recv_mh[i].msg_hdr.msg_name = &recv_addr[i]; + recv_mh[i].msg_hdr.msg_namelen = i; + recv_mh[i].msg_hdr.msg_iov = &recv_iov[i]; + recv_mh[i].msg_hdr.msg_iovlen = 1; + recv_mh[i].msg_hdr.msg_control = 0; + recv_mh[i].msg_hdr.msg_controllen = 0; + recv_mh[i].msg_hdr.msg_flags = 0; + } + + rc = recv_mmsg(recv_fd, recv_mh, IOV_MAX1, MSG_DONTWAIT, 0); + if (rc < 0) + perror_msg_and_skip("recvmmsg"); + + printf("recvmmsg(%d, [", recv_fd); + for (i = 0; i < rc; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("{msg_hdr="); + print_msghdr(&recv_mh[i].msg_hdr, i); + printf(", msg_len=1}"); + } + printf("], %u, MSG_DONTWAIT, NULL) = %d\n", IOV_MAX1, rc); +} + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_NAME "-recvmmsg.test.send.socket" + }; + + (void) unlink(un.sun_path); + if (bind(fds[1], (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + test_mmsg_name(fds[1], fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/mmsg_name.test b/tests/mmsg_name.test new file mode 100755 index 00000000..e18c9722 --- /dev/null +++ b/tests/mmsg_name.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check decoding of msg_name* fields of struct msghdr array argument +# of sendmmsg and recvmmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests/mount.c b/tests/mount.c new file mode 100644 index 00000000..cbfe42f8 --- /dev/null +++ b/tests/mount.c @@ -0,0 +1,84 @@ +/* + * Check decoding of mount syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#ifndef MS_MGC_VAL +# define MS_MGC_VAL 0xC0ED0000 +#endif + +#ifndef MS_RELATIME +# define MS_RELATIME (1ul << 21) +#endif + +#define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" + +int +main(void) +{ + static const char source[] = "mount_source"; + static const char target[] = "mount_target"; + static const char fstype[] = "mount_fstype"; + static const char data[] = "mount_data"; + + int rc = mount(source, target, fstype, 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, str_ro_nosuid_nodev_noexec, + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_RELATIME | 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, + str_ro_nosuid_nodev_noexec "|MS_RELATIME", + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_MGC_VAL, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, "MS_MGC_VAL", data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_MGC_VAL | 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, + "MS_MGC_VAL|" str_ro_nosuid_nodev_noexec, + data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_REMOUNT, data); + printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %d %s (%m)\n", + source, target, fstype, "MS_REMOUNT", data, rc, errno2name()); + + rc = mount(source, target, fstype, MS_BIND, data); + printf("mount(\"%s\", \"%s\", %p, %s, %p) = %d %s (%m)\n", + source, target, fstype, "MS_BIND", data, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/mount.test b/tests/mount.test new file mode 100755 index 00000000..40fdca95 --- /dev/null +++ b/tests/mount.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mount syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/move_pages.c b/tests/move_pages.c new file mode 100644 index 00000000..f4ccafa2 --- /dev/null +++ b/tests/move_pages.c @@ -0,0 +1,239 @@ +/* + * Check decoding of move_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_move_pages + +# include +# include +# include + +# define MAX_STRLEN 3 + +static void +print_page_array(const void **const pages, + const unsigned long count, + const unsigned int offset) +{ + if (!count) { + printf("%s", pages ? "[]" : "NULL"); + return; + } + if (count <= offset) { + printf("%p", pages); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i + offset < count) { + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + } else { + printf("%p", pages + i); + break; + } + const void *const addr = pages[i]; + if (addr) + printf("%p", addr); + else + printf("NULL"); + } + printf("]"); +} + +static void +print_node_array(const int *const nodes, + const unsigned long count, + const unsigned int offset) +{ + if (!count) { + printf("%s", nodes ? "[]" : "NULL"); + return; + } + if (count <= offset) { + printf("%p", nodes); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i + offset < count) { + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + } else { + printf("%p", nodes + i); + break; + } + printf("%d", nodes[i]); + } + printf("]"); +} + +static void +print_status_array(const int *const status, const unsigned long count) +{ + if (!count) { + printf("%s", status ? "[]" : "NULL"); + return; + } + printf("["); + unsigned long i; + for (i = 0; i < count; ++i) { + if (i) + printf(", "); + if (i >= MAX_STRLEN) { + printf("..."); + break; + } + if (status[i] >= 0) { + printf("%d", status[i]); + } else { + errno = -status[i]; + printf("%s", errno2name()); + } + } + printf("]"); +} + +static void +print_stat_pages(const unsigned long pid, const unsigned long count, + const void **const pages, int *const status) +{ + const unsigned long flags = (unsigned long) 0xfacefeed00000002ULL; + + long rc = syscall(__NR_move_pages, + pid, count, pages, NULL, status, flags); + const char *errstr = sprintrc(rc); + printf("move_pages(%d, %lu, ", (int) pid, count); + print_page_array(pages, count, 0); + printf(", NULL, "); + if (rc) { + if (count) + printf("%p", status); + else + printf("[]"); + } else { + print_status_array(status, count); + } + printf(", MPOL_MF_MOVE) = %s\n", errstr); +} + +static void +print_move_pages(const unsigned long pid, + unsigned long count, + const unsigned int offset, + const void **const pages, + int *const nodes, + int *const status) +{ + const unsigned long flags = (unsigned long) 0xfacefeed00000004ULL; + count += offset; + + long rc = syscall(__NR_move_pages, + pid, count, pages, nodes, status, flags); + const char *errstr = sprintrc(rc); + printf("move_pages(%d, %lu, ", (int) pid, count); + print_page_array(pages, count, offset); + printf(", "); + print_node_array(nodes, count, offset); + printf(", "); + if (count) + printf("%p", status); + else + printf("[]"); + printf(", MPOL_MF_MOVE_ALL) = %s\n", errstr); +} + +int +main(void) +{ + const unsigned long pid = + (unsigned long) 0xfacefeed00000000ULL | getpid(); + unsigned long count = 1; + const unsigned page_size = get_page_size(); + const void *const page = tail_alloc(page_size); + const void *const efault = page + page_size; + const void **pages = tail_alloc(sizeof(*pages)); + int *nodes = tail_alloc(sizeof(*nodes)); + int *status = tail_alloc(sizeof(*status)); + + print_stat_pages(pid, 0, pages, status); + print_move_pages(pid, 0, 0, pages, nodes, status); + print_move_pages(pid, 0, 1, pages + 1, nodes + 1, status + 1); + + *pages = page; + print_stat_pages(pid, count, pages, status); + *nodes = 0xdeadbee1; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = efault; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee2; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = nodes; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee3; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + ++count; + --status; + *(--pages) = status; + print_stat_pages(pid, count, pages, status); + *(--nodes) = 0xdeadbee4; + print_move_pages(pid, count, 0, pages, nodes, status); + print_move_pages(pid, count, 1, pages, nodes, status); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_move_pages") + +#endif diff --git a/tests/move_pages.test b/tests/move_pages.test new file mode 100755 index 00000000..f9577172 --- /dev/null +++ b/tests/move_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of move_pages syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 diff --git a/tests/mq.c b/tests/mq.c new file mode 100644 index 00000000..9c2ffc8e --- /dev/null +++ b/tests/mq.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_MQUEUE_H + +# include +# include +# include +# include +# include +# include + +# define NAME "strace-mq.test" + +int +main (void) +{ + struct mq_attr attr; + (void) close(0); + + if (mq_open("/" NAME, O_CREAT, 0700, NULL)) + perror_msg_and_skip("mq_open"); + printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", NAME); + + if (mq_getattr(0, &attr)) + perror_msg_and_skip("mq_getattr"); + printf("mq_getsetattr(0, NULL, {mq_flags=0, mq_maxmsg=%lld" + ", mq_msgsize=%lld, mq_curmsgs=0}) = 0\n", + (long long) attr.mq_maxmsg, + (long long) attr.mq_msgsize); + + if (mq_setattr(0, &attr, NULL)) + perror_msg_and_skip("mq_setattr"); + printf("mq_getsetattr(0, {mq_flags=0, mq_maxmsg=%lld" + ", mq_msgsize=%lld, mq_curmsgs=0}, NULL) = 0\n", + (long long) attr.mq_maxmsg, + (long long) attr.mq_msgsize); + + if (mq_unlink("/" NAME)) + perror_msg_and_skip("mq_unlink"); + printf("mq_unlink(\"%s\") = 0\n", NAME); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_MQUEUE_H") + +#endif diff --git a/tests/mq.test b/tests/mq.test new file mode 100755 index 00000000..746b07b7 --- /dev/null +++ b/tests/mq.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_getsetattr, and mq_unlink syscalls. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a28 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests/mq_sendrecv-read.c b/tests/mq_sendrecv-read.c new file mode 100644 index 00000000..cc9867b9 --- /dev/null +++ b/tests/mq_sendrecv-read.c @@ -0,0 +1,3 @@ +#define DUMPIO_READ 1 +#define MQ_NAME "mq_sendrecv-read.sample" +#include "mq_sendrecv.c" diff --git a/tests/mq_sendrecv-read.test b/tests/mq_sendrecv-read.test new file mode 100755 index 00000000..eb4ad75e --- /dev/null +++ b/tests/mq_sendrecv-read.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -eread=0 -a14 diff --git a/tests/mq_sendrecv-write.c b/tests/mq_sendrecv-write.c new file mode 100644 index 00000000..ae34ee1a --- /dev/null +++ b/tests/mq_sendrecv-write.c @@ -0,0 +1,3 @@ +#define DUMPIO_WRITE 1 +#define MQ_NAME "mq_sendrecv-write.sample" +#include "mq_sendrecv.c" diff --git a/tests/mq_sendrecv-write.test b/tests/mq_sendrecv-write.test new file mode 100755 index 00000000..38277ec6 --- /dev/null +++ b/tests/mq_sendrecv-write.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -ewrite=0 -a14 diff --git a/tests/mq_sendrecv.c b/tests/mq_sendrecv.c new file mode 100644 index 00000000..c151542c --- /dev/null +++ b/tests/mq_sendrecv.c @@ -0,0 +1,480 @@ +/* + * Check decoding of mq_open, mq_timedsend, mq_notify, mq_timedreceive and + * mq_unlink syscalls. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined __NR_mq_open && __NR_mq_timedsend && __NR_mq_timedreceive && \ + __NR_mq_notify && __NR_mq_unlink + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "sigevent.h" + +# ifndef MQ_NAME +# define MQ_NAME "mq_sendrecv.sample" +# endif + +# ifndef DUMPIO_READ +# define DUMPIO_READ 0 +# endif + +# ifndef DUMPIO_WRITE +# define DUMPIO_WRITE 0 +# endif + + +enum { + NUM_ATTRS = 8, + MSG_CUT = 8, + MSG_MAX_UNCUT = 32, + MSG_SIZE = 64, + MSG_START = 0x80, +}; + + +static void +printstr(unsigned char start, unsigned int count) +{ + unsigned int i; + + printf("\""); + for (i = 0; i < count; i++) { + printf("\\%hho", (unsigned char) (start + i)); + } + printf("\""); +} + +#if DUMPIO_READ || DUMPIO_WRITE +static void +dumpstr(unsigned char start, unsigned int count) +{ + unsigned int i; + unsigned int j; + + for (i = 0; i < count; i++) { + if (i < count) { + if (!(i % 16)) + printf(" | %05x ", i); + if (!(i % 8)) + printf(" "); + + printf("%02hhx ", (unsigned char) (start + i)); + } + + if ((i % 16 == 15) || (i == (count - 1))) { + if (i % 16 != 15) + printf("%*s", 3 * (15 - i % 16) + + ((i + 8) % 16) / 8, " "); + + printf(" "); + + for (j = 0; j <= (i % 16); j++) + printf("."); + for (j = i % 16; j < 15; j++) + printf(" "); + + printf(" |\n"); + + } + } +} +#endif /* DUMPIO_READ || DUMPIO_WRITE */ + +static void +cleanup(void) +{ + long rc; + + rc = syscall(__NR_mq_unlink, MQ_NAME); + printf("mq_unlink(\"" MQ_NAME "\") = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); +} + +static void +do_send(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, + bool cropped) +{ + long rc; + long saved_errno; + + do { + rc = syscall(__NR_mq_timedsend, fd, msg, msg_size, 42, + tmout); + saved_errno = errno; + printf("mq_timedsend(%d, ", fd); + printstr(MSG_START, msg_size > MSG_MAX_UNCUT ? MSG_MAX_UNCUT : + msg_size); + if (cropped) + printf("..."); + errno = saved_errno; + printf(", %u, 42, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", msg_size, + (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, + sprintrc(rc)); + errno = saved_errno; + + if (rc == -1) { + if (errno == EINTR) + continue; + perror_msg_and_skip("mq_timedsend"); + } +# if DUMPIO_WRITE + dumpstr(MSG_START, msg_size); +# endif + } while (rc); +} + +static void +do_recv(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, + bool cropped) +{ + long rc; + long saved_errno; + unsigned prio; + + do { + rc = syscall(__NR_mq_timedreceive, fd, msg, MSG_SIZE, &prio, + tmout); + saved_errno = errno; + printf("mq_timedreceive(%d, ", fd); + if (rc >= 0) { + printstr(MSG_START, rc > MSG_MAX_UNCUT ? MSG_MAX_UNCUT : + rc); + if (cropped) + printf("..."); + } else { + printf("%p", msg); + } + errno = saved_errno; + printf(", %u, [42], {tv_sec=%jd, tv_nsec=%jd}) = %s\n", MSG_SIZE, + (intmax_t) tmout->tv_sec, + (intmax_t) tmout->tv_nsec, sprintrc(rc)); + errno = saved_errno; + + if (rc == -1) { + if (errno == EINTR) + continue; + perror_msg_and_skip("mq_timedreceive"); + } + if ((rc >= 0) && ((unsigned long) rc != msg_size)) + error_msg_and_skip("mq_timedreceive size mismatch" + ": expected %u, got %ld", + msg_size, rc); +# if DUMPIO_READ + dumpstr(MSG_START, rc); +# endif + } while (rc < 0); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0x8765432100000000ULL; + static const kernel_ulong_t bogus_oflags = + (kernel_ulong_t) 0xdefaced100000003ULL; + static const kernel_ulong_t bogus_mode = + (kernel_ulong_t) 0xdec0deadfacefeedULL; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfeedfacedeadba5eULL; + static const kernel_ulong_t bogus_zero_size = + (sizeof(kernel_ulong_t) > sizeof(int)) ? (kernel_ulong_t) 0 : + (kernel_ulong_t) 0xface1e5500000000ULL; + static const kernel_ulong_t bogus_size = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_prio = + (kernel_ulong_t) 0xdec0ded1defaced3ULL; + static const struct timespec bogus_tmout_data = { + .tv_sec = (time_t) 0xdeadfacebeeff00dLL, + .tv_nsec = (long) 0xfacefee1deadfeedLL, + }; + static const struct timespec future_tmout_data = { + .tv_sec = (time_t) 0x7ea1fade7e57faceLL, + .tv_nsec = 999999999, + };; + struct_sigevent bogus_sev_data = { + .sigev_notify = 0xdefaced, + .sigev_signo = 0xfacefeed, + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL + }; + + const char *errstr; + long rc; + kernel_long_t *bogus_attrs = tail_alloc(sizeof(*bogus_attrs) * + NUM_ATTRS); + char *msg = tail_alloc(MSG_SIZE); + unsigned *bogus_prio_ptr = tail_alloc(sizeof(*bogus_prio_ptr)); + struct timespec *bogus_tmout = tail_memdup(&bogus_tmout_data, + sizeof(*bogus_tmout)); + struct timespec *future_tmout = tail_memdup(&future_tmout_data, + sizeof(*future_tmout)); + struct_sigevent *bogus_sev = tail_memdup(&bogus_sev_data, + sizeof(*bogus_sev)); + int fd = -1; + + + fill_memory_ex(msg, MSG_SIZE, MSG_START, MSG_SIZE); + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + 0xbb, 0x70); + + + /* mq_open */ + + /* Zero values, non-O_CREAT mode */ + rc = syscall(__NR_mq_open, NULL, bogus_zero, bogus_mode, NULL); + printf("mq_open(NULL, O_RDONLY) = %s\n", sprintrc(rc)); + + /* O_CREAT parsing, other flags, bogs values */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + NULL); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, NULL) = %s\n", + msg, (unsigned short) bogus_mode, sprintrc(rc)); + + /* Partially invalid attributes structure */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + bogus_attrs + 1); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, %p) = %s\n", + msg, (unsigned short) bogus_mode, bogus_attrs + 1, sprintrc(rc)); + + /* Valid attributes structure */ + rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, + bogus_attrs); + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx, " + "mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", + msg, (unsigned short) bogus_mode, + (unsigned long long) (kernel_ulong_t) bogus_attrs[0], + (long long) bogus_attrs[1], + (long long) bogus_attrs[2], + (long long) bogus_attrs[3], sprintrc(rc)); + + + /* mq_timedsend */ + + /* Zero values*/ + rc = syscall(__NR_mq_timedsend, bogus_zero, NULL, bogus_zero_size, + bogus_zero, NULL); + printf("mq_timedsend(0, NULL, 0, 0, NULL) = %s\n", sprintrc(rc)); + + /* Invalid pointers */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE, bogus_size, + bogus_prio, bogus_tmout + 1); + printf("mq_timedsend(%d, %p, %llu, %u, %p) = %s\n", + (int) bogus_fd, msg + MSG_SIZE, (unsigned long long) bogus_size, + (unsigned) bogus_prio, bogus_tmout + 1, sprintrc(rc)); + + /* Partially invalid message (memory only partially available) */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, + MSG_SIZE, bogus_prio, bogus_tmout); + printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + (int) bogus_fd, msg + MSG_SIZE - MSG_CUT, + (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + sprintrc(rc)); + + /* Fully valid message, uncut */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, + MSG_CUT, bogus_prio, bogus_tmout); + errstr = sprintrc(rc); + printf("mq_timedsend(%d, ", (int) bogus_fd); + printstr(MSG_START + MSG_SIZE - MSG_CUT, MSG_CUT); + printf(", %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + (unsigned long long) MSG_CUT, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + errstr); + + /* Partially invalid message, cut at maxstrlen */ + rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_CUT, MSG_SIZE, + bogus_prio, bogus_tmout); + errstr = sprintrc(rc); + printf("mq_timedsend(%d, ", (int) bogus_fd); + printstr(MSG_START + MSG_CUT, MSG_MAX_UNCUT); + printf("..., %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, + (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, + errstr); + + + /* mq_timedreceive */ + + /* Zero values */ + rc = syscall(__NR_mq_timedreceive, bogus_zero, NULL, bogus_zero_size, + NULL, NULL); + printf("mq_timedreceive(0, NULL, 0, NULL, NULL) = %s\n", sprintrc(rc)); + + /* Invalid addresses */ + rc = syscall(__NR_mq_timedreceive, bogus_fd, msg + MSG_SIZE, bogus_size, + bogus_prio_ptr + 1, bogus_tmout + 1); + printf("mq_timedreceive(%d, %p, %llu, %p, %p) = %s\n", + (int) bogus_fd, msg + MSG_SIZE, (unsigned long long) bogus_size, + bogus_prio_ptr + 1, bogus_tmout + 1, sprintrc(rc)); + + /* Invalid fd, valid msg pointer */ + rc = syscall(__NR_mq_timedreceive, bogus_fd, msg, bogus_size, + bogus_prio_ptr, bogus_tmout); + printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%jd, tv_nsec=%jd}) = " + "%s\n", + (int) bogus_fd, msg, (unsigned long long) bogus_size, + bogus_prio_ptr, (intmax_t) bogus_tmout->tv_sec, + (intmax_t) bogus_tmout->tv_nsec, sprintrc(rc)); + + + /* mq_notify */ + + /* Zero values */ + rc = syscall(__NR_mq_notify, bogus_zero, NULL); + printf("mq_notify(0, NULL) = %s\n", sprintrc(rc)); + + /* Invalid pointer */ + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev + 1); + printf("mq_notify(%d, %p) = %s\n", + (int) bogus_fd, bogus_sev + 1, sprintrc(rc)); + + /* Invalid SIGEV_* */ + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=%u, sigev_notify=%#x /* SIGEV_??? */}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_signo, bogus_sev->sigev_notify, + sprintrc(rc)); + + /* SIGEV_NONE */ + bogus_sev->sigev_notify = SIGEV_NONE; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_signo, sprintrc(rc)); + + /* SIGEV_SIGNAL */ + bogus_sev->sigev_notify = SIGEV_SIGNAL; + bogus_sev->sigev_signo = SIGALRM; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, sprintrc(rc)); + + /* SIGEV_THREAD */ + bogus_sev->sigev_notify = SIGEV_THREAD; + bogus_sev->sigev_un.sigev_thread.function = + (unsigned long) 0xdeadbeefbadc0dedULL; + bogus_sev->sigev_un.sigev_thread.attribute = + (unsigned long) 0xcafef00dfacefeedULL; + rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " + "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " + "sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}) = " + "%s\n", + (int) bogus_fd, bogus_sev->sigev_value.sival_int, + bogus_sev->sigev_value.sival_ptr, + bogus_sev->sigev_un.sigev_thread.function, + bogus_sev->sigev_un.sigev_thread.attribute, sprintrc(rc)); + + /* mq_unlink */ + + /* Zero values */ + rc = syscall(__NR_mq_unlink, NULL); + printf("mq_unlink(NULL) = %s\n", sprintrc(rc)); + + /* Invalid ptr */ + rc = syscall(__NR_mq_unlink, msg + MSG_SIZE); + printf("mq_unlink(%p) = %s\n", msg + MSG_SIZE, sprintrc(rc)); + + /* Long unterminated string */ + rc = syscall(__NR_mq_unlink, msg); + errstr = sprintrc(rc); + printf("mq_unlink(%p) = %s\n", msg, errstr); + + + /* Sending and receiving test */ + +# if DUMPIO_READ || DUMPIO_WRITE + close(0); +# endif + bogus_attrs[1] = 2; + bogus_attrs[2] = MSG_SIZE; + fd = rc = syscall(__NR_mq_open, MQ_NAME, + O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); + errstr = sprintrc(rc); + if (rc < 0) + perror_msg_and_skip("mq_open"); + else + atexit(cleanup); +# if DUMPIO_READ || DUMPIO_WRITE + if (fd != 0) + error_msg_and_skip("mq_open returned fd other than 0"); +# endif + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + 0xbb, 0x70); + printf("mq_open(\"" MQ_NAME "\", O_RDWR|O_CREAT|O_NONBLOCK, " + "0700, {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u, " + "mq_curmsgs=%lld}) = %s\n", + (unsigned long long) (kernel_ulong_t) bogus_attrs[0], MSG_SIZE, + (long long) bogus_attrs[3], errstr); + + rc = syscall(__NR_mq_getsetattr, fd, NULL, bogus_attrs); + if (rc < 0) + perror_msg_and_skip("mq_getsetattr"); + if ((bogus_attrs[1] < 2) || (bogus_attrs[2] < MSG_SIZE)) + error_msg_and_skip("mq too small"); + + do_send(fd, msg, MSG_CUT, future_tmout, false); + do_send(fd, msg, MSG_SIZE, future_tmout, true); + + memset(msg, '\0', MSG_SIZE); + do_recv(fd, msg, MSG_CUT, future_tmout, false); + + memset(msg, '\0', MSG_SIZE); + do_recv(fd, msg, MSG_SIZE, future_tmout, true); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mq_open && __NR_mq_timedsend && " + "__NR_mq_timedreceive && __NR_mq_notify && __NR_mq_unlink"); + +#endif diff --git a/tests/mq_sendrecv.test b/tests/mq_sendrecv.test new file mode 100755 index 00000000..67f4d63c --- /dev/null +++ b/tests/mq_sendrecv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -a14 diff --git a/tests/msg_control-v.c b/tests/msg_control-v.c new file mode 100644 index 00000000..b0afa523 --- /dev/null +++ b/tests/msg_control-v.c @@ -0,0 +1,3 @@ +/* This file is part of msg_control-v strace test. */ +#define VERBOSE 1 +#include "msg_control.c" diff --git a/tests/msg_control-v.test b/tests/msg_control-v.test new file mode 100755 index 00000000..41f98428 --- /dev/null +++ b/tests/msg_control-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of struct msghdr ancillary data. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests/msg_control.c b/tests/msg_control.c new file mode 100644 index 00000000..709a3075 --- /dev/null +++ b/tests/msg_control.c @@ -0,0 +1,715 @@ +/* + * Check decoding of struct msghdr ancillary data. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SOL_IP +# define SOL_IP 0 +#endif +#ifndef SOL_TCP +# define SOL_TCP 6 +#endif + +#ifndef SCM_SECURITY +# define SCM_SECURITY 3 +#endif + +#define MIN_SIZE_OF(type, member) \ + (offsetof(type, member) + sizeof(((type *) 0)->member)) + +static struct cmsghdr * +get_cmsghdr(void *const page, const size_t len) +{ + return page - CMSG_ALIGN(len); +} + +#define DEFAULT_STRLEN 32 + +static void +print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len) +{ + size_t nfd = cmsg_len > CMSG_LEN(0) + ? (cmsg_len - CMSG_LEN(0)) / sizeof(int) : 0; + if (!nfd) + return; + + printf(", cmsg_data=["); + int *fdp = (int *) CMSG_DATA(cmsg); + size_t i; + for (i = 0; i < nfd; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("%d", fdp[i]); + } + printf("]"); +} + +static void +test_scm_rights1(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const void *const src, + const size_t cmsg_len) +{ + const size_t aligned_cms_len = + cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); + if (cmsg_len >= CMSG_LEN(0) + && aligned_cms_len + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen); + + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) + cmsg->cmsg_len = cmsg_len; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_level)) + cmsg->cmsg_level = SOL_SOCKET; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_type)) + cmsg->cmsg_type = SCM_RIGHTS; + + size_t src_len = + cmsg_len < msg_controllen ? cmsg_len : msg_controllen; + if (src_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0)); + + mh->msg_control = cmsg; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0"); + if (msg_controllen < CMSG_LEN(0)) { + if (msg_controllen) + printf(", msg_control=%p", cmsg); + } else { + printf(", msg_control=[{cmsg_len=%lu, cmsg_level=SOL_SOCKET" + ", cmsg_type=SCM_RIGHTS", (unsigned long) cmsg_len); + print_fds(cmsg, src_len); + printf("}"); + if (aligned_cms_len < msg_controllen) + printf(", %p", (void *) cmsg + aligned_cms_len); + printf("]"); + } + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_scm_rights2(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const int *const *const src, + const size_t *const cmsg_len) +{ + const size_t aligned_cms_len[2] = { + cmsg_len[0] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[0]) : CMSG_LEN(0), + cmsg_len[1] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[1]) : CMSG_LEN(0) + }; + if (cmsg_len[0] < CMSG_LEN(0) + || aligned_cms_len[0] + CMSG_LEN(0) > msg_controllen + || aligned_cms_len[0] + aligned_cms_len[1] + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *const cmsg[2] = { + get_cmsghdr(page, msg_controllen), + (void *) get_cmsghdr(page, msg_controllen) + aligned_cms_len[0] + }; + cmsg[0]->cmsg_len = cmsg_len[0]; + cmsg[0]->cmsg_level = SOL_SOCKET; + cmsg[0]->cmsg_type = SCM_RIGHTS; + if (cmsg_len[0] > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg[0]), src[0], cmsg_len[0] - CMSG_LEN(0)); + + const size_t msg_controllen1 = msg_controllen - aligned_cms_len[0]; + if (msg_controllen1 >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) + cmsg[1]->cmsg_len = cmsg_len[1]; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_level)) + cmsg[1]->cmsg_level = SOL_SOCKET; + if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_type)) + cmsg[1]->cmsg_type = SCM_RIGHTS; + size_t src1_len = + cmsg_len[1] < msg_controllen1 ? cmsg_len[1] : msg_controllen1; + if (src1_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg[1]), src[1], src1_len - CMSG_LEN(0)); + + mh->msg_control = cmsg[0]; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%lu" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned long) cmsg_len[0]); + print_fds(cmsg[0], cmsg_len[0]); + printf("}, {cmsg_len=%lu, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned long) cmsg_len[1]); + print_fds(cmsg[1], src1_len); + printf("}"); + if (aligned_cms_len[1] < msg_controllen1) + printf(", %p", (void *) cmsg[1] + aligned_cms_len[1]); + printf("]"); + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_scm_rights3(struct msghdr *const mh, void *const page, const size_t nfds) +{ + const size_t len = CMSG_SPACE(sizeof(int) * nfds); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(int) * nfds); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + int *fdp = (int *) CMSG_DATA(cmsg); + size_t i; + for (i = 0; i < nfds; ++i) + fdp[i] = i; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned) cmsg->cmsg_len); + print_fds(cmsg, cmsg->cmsg_len); + printf("}], msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) len, rc, errno2name()); +} + +static void +print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len) +{ + int n = cmsg_len > CMSG_LEN(0) ? cmsg_len - CMSG_LEN(0) : 0; + if (!n) + return; + + printf(", cmsg_data=\"%.*s\"", n, CMSG_DATA(cmsg)); +} + +static void +test_scm_security(struct msghdr *const mh, + const size_t msg_controllen, + void *const page, + const void *const src, + const size_t cmsg_len, + const int cmsg_level, + const char *const cmsg_level_str) +{ + const size_t aligned_cms_len = + cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); + if (cmsg_len >= CMSG_LEN(0) + && aligned_cms_len + CMSG_LEN(0) <= msg_controllen) + return; + + struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen); + + cmsg->cmsg_len = cmsg_len; + cmsg->cmsg_level = cmsg_level; + cmsg->cmsg_type = SCM_SECURITY; + + size_t src_len = + cmsg_len < msg_controllen ? cmsg_len : msg_controllen; + if (src_len > CMSG_LEN(0)) + memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0)); + + mh->msg_control = cmsg; + mh->msg_controllen = msg_controllen; + + int rc = sendmsg(-1, mh, 0); + int saved_errno = errno; + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%lu, cmsg_level=%s" + ", cmsg_type=SCM_SECURITY", + (unsigned long) cmsg_len, cmsg_level_str); + print_security(cmsg, src_len); + printf("}"); + if (aligned_cms_len < msg_controllen) + printf(", %p", (void *) cmsg + aligned_cms_len); + printf("]"); + + errno = saved_errno; + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) msg_controllen, rc, errno2name()); +} + +static void +test_unknown_type(struct msghdr *const mh, + void *const page, + const int cmsg_level, + const char *const cmsg_level_str, + const char *const cmsg_type_str) +{ + struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0)); + + cmsg->cmsg_len = CMSG_LEN(0); + cmsg->cmsg_level = cmsg_level; + cmsg->cmsg_type = 0xfacefeed; + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg->cmsg_len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=%s" + ", cmsg_type=%#x /* %s */}], msg_controllen=%u, msg_flags=0}" + ", 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_level_str, cmsg->cmsg_type, + cmsg_type_str, (unsigned) mh->msg_controllen, rc, errno2name()); +} + +static void +test_sol_socket(struct msghdr *const mh, void *const page) +{ + static const int fds0[] = { -10, -11, -12, -13 }; + static const int fds1[] = { -15, -16, -17, -18 }; + size_t msg_controllen, max_msg_controllen; + + max_msg_controllen = CMSG_SPACE(sizeof(fds0)) + sizeof(*fds0) - 1; + for (msg_controllen = 0; + msg_controllen <= max_msg_controllen; + msg_controllen++) { + size_t cmsg_len; + + for (cmsg_len = 0; + cmsg_len <= msg_controllen + CMSG_LEN(0); + cmsg_len++) { + test_scm_rights1(mh, msg_controllen, + page, fds0, cmsg_len); + } + } + + max_msg_controllen = + CMSG_SPACE(sizeof(fds0)) + CMSG_SPACE(sizeof(fds1)) + + sizeof(*fds0) - 1; + for (msg_controllen = CMSG_LEN(0) * 2; + msg_controllen <= max_msg_controllen; + msg_controllen++) { + static const int *const fdps[] = { fds0, fds1 }; + size_t cmsg_len[2]; + + for (cmsg_len[0] = CMSG_LEN(0); + CMSG_ALIGN(cmsg_len[0]) + CMSG_LEN(0) <= msg_controllen + && CMSG_ALIGN(cmsg_len[0]) <= CMSG_SPACE(sizeof(fds0)); + cmsg_len[0]++) { + const size_t msg_controllen1 = + msg_controllen - CMSG_ALIGN(cmsg_len[0]); + + for (cmsg_len[1] = 0; + cmsg_len[1] <= msg_controllen1 + CMSG_LEN(0); + cmsg_len[1]++) { + test_scm_rights2(mh, msg_controllen, + page, fdps, cmsg_len); + } + } + } + + static const char text[16] = "0123456789abcdef"; + max_msg_controllen = CMSG_SPACE(sizeof(text)) + CMSG_LEN(0) - 1; + for (msg_controllen = CMSG_LEN(0); + msg_controllen <= max_msg_controllen; + msg_controllen++) { + size_t cmsg_len; + + for (cmsg_len = 0; + cmsg_len <= msg_controllen + CMSG_LEN(0) + && cmsg_len <= CMSG_LEN(sizeof(text)); + cmsg_len++) { + test_scm_security(mh, msg_controllen, + page, text, cmsg_len, + ARG_STR(SOL_SOCKET)); + } + } + + test_scm_rights3(mh, page, DEFAULT_STRLEN - 1); + test_scm_rights3(mh, page, DEFAULT_STRLEN); + test_scm_rights3(mh, page, DEFAULT_STRLEN + 1); + + test_unknown_type(mh, page, ARG_STR(SOL_SOCKET), "SCM_???"); +} + +static void +test_ip_pktinfo(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct in_pktinfo)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct in_pktinfo *const info = (struct in_pktinfo *) CMSG_DATA(cmsg); +#ifdef HAVE_IF_INDEXTONAME + info->ipi_ifindex = if_nametoindex("lo"); +#else + info->ipi_ifindex = 1; +#endif + info->ipi_spec_dst.s_addr = inet_addr("1.2.3.4"); + info->ipi_addr.s_addr = inet_addr("5.6.7.8"); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={ipi_ifindex=%s" + ", ipi_spec_dst=inet_addr(\"%s\")" + ", ipi_addr=inet_addr(\"%s\")}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, +#ifdef HAVE_IF_INDEXTONAME + "if_nametoindex(\"lo\")", +#else + "1", +#endif + "1.2.3.4", "5.6.7.8", len, rc, errno2name()); +} + +static void +test_ip_uint(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(int)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + unsigned int *u = (void *) CMSG_DATA(cmsg); + *u = 0xfacefeed; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[%u]}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, *u, len, + rc, errno2name()); +} + +static void +test_ip_uint8_t(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(1); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(1); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + *CMSG_DATA(cmsg) = 'A'; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[%#x]}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + (unsigned) (uint8_t) 'A', len, rc, errno2name()); +} + +static void +print_ip_opts(const void *const cmsg_data, const unsigned int data_len) +{ + const unsigned char *const opts = cmsg_data; + unsigned int i; + for (i = 0; i < data_len; ++i) { + if (i) + printf(", "); +#if !VERBOSE + if (i >= DEFAULT_STRLEN) { + printf("..."); + break; + } +#endif + printf("0x%02x", opts[i]); + } +} + +static void +test_ip_opts(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str, + const unsigned int opts_len) +{ + unsigned int len = CMSG_SPACE(opts_len); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(opts_len); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + unsigned int i; + for (i = 0; i < opts_len; ++i) + CMSG_DATA(cmsg)[i] = 'A' + i; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_IP, cmsg_type=%s, cmsg_data=[", + (unsigned) cmsg->cmsg_len, cmsg_type_str); + print_ip_opts(CMSG_DATA(cmsg), opts_len); + printf("]}], msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + len, rc, errno2name()); +} + +#ifdef IP_CHECKSUM +struct sock_ee { + uint32_t ee_errno; + uint8_t ee_origin; + uint8_t ee_type; + uint8_t ee_code; + uint8_t ee_pad; + uint32_t ee_info; + uint32_t ee_data; + struct sockaddr_in offender; +}; + +static void +test_ip_recverr(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct sock_ee)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sock_ee)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct sock_ee *const e = (struct sock_ee *) CMSG_DATA(cmsg); + e->ee_errno = 0xdeadbeef; + e->ee_origin = 2; + e->ee_type = 3; + e->ee_code = 4; + e->ee_info = 0xfacefeed; + e->ee_data = 0xbadc0ded; + e->offender.sin_family = AF_INET, + e->offender.sin_port = htons(12345), + e->offender.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={ee_errno=%u, ee_origin=%u" + ", ee_type=%u, ee_code=%u, ee_info=%u, ee_data=%u" + ", offender={sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"127.0.0.1\")}}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + e->ee_errno, e->ee_origin, e->ee_type, + e->ee_code, e->ee_info, e->ee_data, + ntohs(e->offender.sin_port), + len, rc, errno2name()); +} +#endif + +#ifdef IP_ORIGDSTADDR +static void +test_ip_origdstaddr(struct msghdr *const mh, void *const page, + const int cmsg_type, const char *const cmsg_type_str) +{ + const unsigned int len = CMSG_SPACE(sizeof(struct sockaddr_in)); + struct cmsghdr *const cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sockaddr_in)); + cmsg->cmsg_level = SOL_IP; + cmsg->cmsg_type = cmsg_type; + + struct sockaddr_in *const sin = (struct sockaddr_in *) CMSG_DATA(cmsg); + sin->sin_family = AF_INET, + sin->sin_port = htons(12345), + sin->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=SOL_IP" + ", cmsg_type=%s, cmsg_data={sa_family=AF_INET" + ", sin_port=htons(%hu), sin_addr=inet_addr(\"127.0.0.1\")}}]" + ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, cmsg_type_str, + ntohs(sin->sin_port), len, rc, errno2name()); +} +#endif + +static void +test_sol_ip(struct msghdr *const mh, void *const page) +{ + test_ip_pktinfo(mh, page, ARG_STR(IP_PKTINFO)); + test_ip_uint(mh, page, ARG_STR(IP_TTL)); + test_ip_uint8_t(mh, page, ARG_STR(IP_TOS)); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 1); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 2); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 3); + test_ip_opts(mh, page, ARG_STR(IP_RECVOPTS), 4); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 5); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 6); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 7); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), 8); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN - 1); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN); + test_ip_opts(mh, page, ARG_STR(IP_RETOPTS), DEFAULT_STRLEN + 1); +#ifdef IP_CHECKSUM + test_ip_recverr(mh, page, ARG_STR(IP_RECVERR)); +#endif +#ifdef IP_ORIGDSTADDR + test_ip_origdstaddr(mh, page, ARG_STR(IP_ORIGDSTADDR)); +#endif +#ifdef IP_CHECKSUM + test_ip_uint(mh, page, ARG_STR(IP_CHECKSUM)); +#endif + test_scm_security(mh, CMSG_LEN(0), page, 0, CMSG_LEN(0), + ARG_STR(SOL_IP)); + test_unknown_type(mh, page, ARG_STR(SOL_IP), "IP_???"); +} + +static void +test_unknown_level(struct msghdr *const mh, void *const page) +{ + struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0)); + + cmsg->cmsg_len = CMSG_LEN(0); + cmsg->cmsg_level = SOL_TCP; + cmsg->cmsg_type = 0xdeadbeef; + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg->cmsg_len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u, cmsg_level=%s" + ", cmsg_type=%#x}], msg_controllen=%u, msg_flags=0}" + ", 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, "SOL_TCP", cmsg->cmsg_type, + (unsigned) mh->msg_controllen, rc, errno2name()); +} + +static void +test_big_len(struct msghdr *const mh) +{ + int optmem_max; + + if (read_int_from_file("/proc/sys/net/core/optmem_max", &optmem_max) + || optmem_max <= 0 || optmem_max > 0x100000) + optmem_max = sizeof(long long) * (2 * IOV_MAX + 512); + optmem_max = (optmem_max + sizeof(long long) - 1) + & ~(sizeof(long long) - 1); + + const size_t len = optmem_max * 2; + struct cmsghdr *const cmsg = tail_alloc(len); + cmsg->cmsg_len = len; + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + if (EBADF != errno) + perror_msg_and_skip("sendmsg"); + + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS", + (unsigned) cmsg->cmsg_len); + print_fds(cmsg, optmem_max); + printf("}, ...], msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned long) len, rc, errno2name()); +} + +int main(int ac, const char **av) +{ + int rc = sendmsg(-1, 0, 0); + printf("sendmsg(-1, NULL, 0) = %d %s (%m)\n", rc, errno2name()); + + struct msghdr *mh = tail_alloc(sizeof(*mh)); + memset(mh, 0, sizeof(*mh)); + test_big_len(mh); + + rc = sendmsg(-1, mh + 1, 0); + printf("sendmsg(-1, %p, 0) = %d %s (%m)\n", + mh + 1, rc, errno2name()); + + void *page = tail_alloc(1) + 1; + mh->msg_control = page; + mh->msg_controllen = CMSG_LEN(0); + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=%p, msg_controllen=%u" + ", msg_flags=0}, 0) = %d %s (%m)\n", + page, (unsigned) CMSG_LEN(0), rc, errno2name()); + + test_sol_socket(mh, page); + test_sol_ip(mh, page); + test_unknown_level(mh, page); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/msg_control.test b/tests/msg_control.test new file mode 100755 index 00000000..809ec7bb --- /dev/null +++ b/tests/msg_control.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of struct msghdr ancillary data. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests/msg_name.c b/tests/msg_name.c new file mode 100644 index 00000000..c2ddda2a --- /dev/null +++ b/tests/msg_name.c @@ -0,0 +1,160 @@ +/* + * Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static int +send_recv(const int send_fd, const int recv_fd, + struct msghdr *const msg, const int flags) +{ + if (send(send_fd, "A", 1, 0) != 1) + perror_msg_and_skip("send"); + return recvmsg(recv_fd, msg, flags); +} + +static void +test_msg_name(const int send_fd, const int recv_fd) +{ + char *const recv_buf = tail_alloc(sizeof(*recv_buf)); + struct iovec *const iov = tail_alloc(sizeof(*iov)); + iov->iov_base = recv_buf; + iov->iov_len = sizeof(*recv_buf); + + struct sockaddr_un *const addr = tail_alloc(sizeof(*addr)); + struct msghdr *const msg = tail_alloc(sizeof(*msg)); + msg->msg_name = addr; + msg->msg_namelen = sizeof(*addr); + msg->msg_iov = iov; + msg->msg_iovlen = 1; + msg->msg_control = 0; + msg->msg_controllen = 0; + msg->msg_flags = 0; + + int rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + if (rc < 0) + perror_msg_and_skip("recvmsg"); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%s\"}" + ", msg_namelen=%d->%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, addr->sun_path, (int) sizeof(struct sockaddr_un), + (int) msg->msg_namelen, rc); + + memset(addr, 0, sizeof(*addr)); + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%s\"}" + ", msg_namelen=%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, addr->sun_path, (int) msg->msg_namelen, rc); + + msg->msg_name = 0; + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name=NULL, msg_namelen=%d" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, MSG_DONTWAIT) = %d\n", + recv_fd, (int) msg->msg_namelen, rc); + + const size_t offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + msg->msg_name = addr; + msg->msg_namelen = offsetof_sun_path; + memset(addr->sun_path, 'A', sizeof(addr->sun_path)); + + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX}, msg_namelen=%d->%d" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, MSG_DONTWAIT) = %d\n", + recv_fd, (int) offsetof_sun_path, (int) msg->msg_namelen, rc); + + msg->msg_namelen = sizeof(struct sockaddr); + msg->msg_name = ((void *) (addr + 1)) - msg->msg_namelen; + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_name={sa_family=AF_UNIX, sun_path=\"%.*s\"}" + ", msg_namelen=%d->%d, msg_iov=[{iov_base=\"A\", iov_len=1}]" + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT)" + " = %d\n", + recv_fd, (int) (sizeof(struct sockaddr) - offsetof_sun_path), + ((struct sockaddr_un *) msg->msg_name)->sun_path, + (int) sizeof(struct sockaddr), (int) msg->msg_namelen, rc); + + rc = send_recv(send_fd, recv_fd, msg, MSG_DONTWAIT); + printf("recvmsg(%d, {msg_namelen=%d}, MSG_DONTWAIT) = %d %s (%m)\n", + recv_fd, (int) msg->msg_namelen, rc, errno2name()); + + /* + * When recvmsg is called with a valid descriptor + * but inaccessible memory, it causes segfaults on some architectures. + * As in these cases we test decoding of failed recvmsg calls, + * it's ok to fail recvmsg with any reason as long as + * it doesn't read that inaccessible memory. + */ + + /* + * Sadly, musl recvmsg wrapper blindly dereferences 2nd argument, + * so limit this test to glibc that doesn't. + */ +#ifdef __GLIBC__ + rc = send_recv(send_fd, -1, msg + 1, 0); + printf("recvmsg(-1, %p, 0) = %d %s (%m)\n", + msg + 1, rc, errno2name()); +#endif + + rc = send_recv(send_fd, -1, 0, 0); + printf("recvmsg(-1, NULL, 0) = %d %s (%m)\n", + rc, errno2name()); +} + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + const struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = "msg_name-recvmsg.test.send.socket" + }; + + (void) unlink(un.sun_path); + if (bind(fds[1], (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + test_msg_name(fds[1], fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/msg_name.test b/tests/msg_name.test new file mode 100755 index 00000000..ac06dd55 --- /dev/null +++ b/tests/msg_name.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests/munlockall.c b/tests/munlockall.c new file mode 100644 index 00000000..9ac69423 --- /dev/null +++ b/tests/munlockall.c @@ -0,0 +1,13 @@ +#include "tests.h" + +#include +#include + +int +main(void) +{ + printf("munlockall() = %d\n", munlockall()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/munlockall.test b/tests/munlockall.test new file mode 100755 index 00000000..e25d60a8 --- /dev/null +++ b/tests/munlockall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check munlockall syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests/nanosleep.c b/tests/nanosleep.c new file mode 100644 index 00000000..9f0e626f --- /dev/null +++ b/tests/nanosleep.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static void +handler(int signo) +{ +} + +int +main(void) +{ + struct { + struct timespec ts; + uint32_t pad[2]; + } req = { + .ts.tv_nsec = 0xc0de1, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, rem = { + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + + if (nanosleep(&req.ts, NULL)) + perror_msg_and_fail("nanosleep"); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, NULL) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + + assert(nanosleep(NULL, &rem.ts) == -1); + printf("nanosleep(NULL, %p) = -1 EFAULT (%m)\n", &rem.ts); + + if (nanosleep(&req.ts, &rem.ts)) + perror_msg_and_fail("nanosleep"); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = 0\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + req.ts.tv_nsec = 1000000000; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" + ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", + (intmax_t) itv.it_interval.tv_sec, + (intmax_t) itv.it_interval.tv_usec, + (intmax_t) itv.it_value.tv_sec, + (intmax_t) itv.it_value.tv_usec); + + req.ts.tv_nsec = 999999999; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, {tv_sec=%jd, tv_nsec=%jd})" + " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", + (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, + (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nanosleep.test b/tests/nanosleep.test new file mode 100755 index 00000000..055a8dcd --- /dev/null +++ b/tests/nanosleep.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check nanosleep and setitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=nanosleep,setitimer diff --git a/tests/net-accept-connect.c b/tests/net-accept-connect.c index 5af7d81b..04c05a60 100644 --- a/tests/net-accept-connect.c +++ b/tests/net-accept-connect.c @@ -1,49 +1,106 @@ +/* + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" #include #include #include +#include #include #include #include #include -#define SUN_PATH "local-stream" -int main(void) +static void +handler(int sig) +{ + assert(close(1) == 0); + _exit(0); +} + +int +main(int ac, const char **av) { struct sockaddr_un addr = { .sun_family = AF_UNIX, - .sun_path = SUN_PATH }; - socklen_t len = offsetof(struct sockaddr_un, sun_path) + sizeof SUN_PATH; + socklen_t len; - unlink(SUN_PATH); + assert(ac == 2); + assert(strlen(av[1]) > 0); + + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (len > sizeof(addr)) + len = sizeof(addr); + + unlink(av[1]); close(0); close(1); - assert(socket(PF_LOCAL, SOCK_STREAM, 0) == 0); - assert(bind(0, (struct sockaddr *) &addr, len) == 0); - assert(listen(0, 5) == 0); + if (socket(AF_UNIX, SOCK_STREAM, 0)) + perror_msg_and_skip("socket"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); memset(&addr, 0, sizeof addr); assert(getsockname(0, (struct sockaddr *) &addr, &len) == 0); + if (len > sizeof(addr)) + len = sizeof(addr); pid_t pid = fork(); - assert(pid >= 0); + if (pid < 0) + perror_msg_and_fail("fork"); if (pid) { assert(accept(0, (struct sockaddr *) &addr, &len) == 1); assert(close(0) == 0); + assert(kill(pid, SIGUSR1) == 0); int status; assert(waitpid(pid, &status, 0) == pid); assert(status == 0); assert(close(1) == 0); } else { - assert(socket(PF_LOCAL, SOCK_STREAM, 0) == 1); + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGUSR1); + + assert(sigprocmask(SIG_BLOCK, &set, NULL) == 0); + assert(signal(SIGUSR1, handler) != SIG_ERR); + assert(socket(AF_UNIX, SOCK_STREAM, 0) == 1); assert(close(0) == 0); assert(connect(1, (struct sockaddr *) &addr, len) == 0); - assert(close(1) == 0); - return 0; + assert(sigprocmask(SIG_UNBLOCK, &set, NULL) == 0); + assert(pause() == 99); + return 1; } - unlink(SUN_PATH); + unlink(av[1]); return 0; } diff --git a/tests/net-fd.test b/tests/net-fd.test deleted file mode 100755 index fc0d3cd0..00000000 --- a/tests/net-fd.test +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -# Check how network syscalls are traced when decoding socket descriptors - -. "${srcdir=.}/init.sh" - -# strace -y is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -check_prog grep -check_prog rm - -rm -f $LOG.* - -./net-accept-connect || - fail_ 'net-accept-connect failed' - -# using -y to test socket descriptors 'paths' decoding -args="-tt -ff -y -o $LOG -enetwork ./net-accept-connect" -$STRACE $args || - fail_ "strace $args failed" - -"$srcdir"/../strace-log-merge $LOG > $LOG || { - cat $LOG - fail_ 'strace-log-merge failed' -} - -rm -f $LOG.* - -grep_log() -{ - local syscall="$1"; shift - local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +' - - LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || { - cat $LOG - fail_ "strace -enetwork failed to trace \"$syscall\" properly" - } -} -grep_log bind '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0' -grep_log listen '\(0, 5\) += 0' -grep_log getsockname '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, \[15\]\) += 0' -grep_log accept '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), NULL\}, \[2\]\) += 1' -grep_log connect '\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0' - -exit 0 diff --git a/tests/net-icmp_filter.c b/tests/net-icmp_filter.c new file mode 100644 index 00000000..f3f99f14 --- /dev/null +++ b/tests/net-icmp_filter.c @@ -0,0 +1,84 @@ +/* + * Check decoding of ICMP_FILTER. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + getsockopt(-1, SOL_RAW, ICMP_FILTER, 0, 0); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, NULL) = -1 %s (%m)\n", + errno2name()); + + setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0); + printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0) = -1 %s (%m)\n", + errno2name()); + + socklen_t *const plen = tail_alloc(sizeof(*plen)); + void *const efault = plen + 1; + struct icmp_filter *const f = tail_alloc(sizeof(*f)); + + getsockopt(-1, SOL_RAW, ICMP_FILTER, f, plen); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %p) = -1 %s (%m)\n", + f, plen, errno2name()); + + setsockopt(-1, SOL_RAW, ICMP_FILTER, efault, sizeof(*f)); + printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %u) = -1 %s (%m)\n", + efault, (unsigned) sizeof(*f), errno2name()); + + f->data = ~( + 1< + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include +# include +# include +# include +#endif + +#ifdef HAVE_IF_INDEXTONAME +/* used to conflict with */ +extern unsigned int if_nametoindex(const char *); +#endif + +static void +check_un(void) +{ + struct sockaddr_un *un = tail_alloc(sizeof(*un)); + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + unsigned int len = sizeof(*un); + int ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[1] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%u\"}, %u)" + " = %d EBADF (%m)\n", 0, len, ret); + + un->sun_path[0] = 0; + un->sun_path[2] = 1; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"\\0\\001%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 3, 0, len, ret); + + un = ((void *) un) - 2; + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + len = sizeof(*un) + 2; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 1, 0, len, ret); + + un = ((void *) un) + 4; + un->sun_family = AF_UNIX; + len = sizeof(*un) - 2; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 2, 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 3, 0, len, ret); + + len = sizeof(*un); + ret = connect(-1, (void *) un, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", un, len, ret); + + un = tail_alloc(sizeof(struct sockaddr_storage)); + un->sun_family = AF_UNIX; + memset(un->sun_path, '0', sizeof(un->sun_path)); + len = sizeof(struct sockaddr_storage) + 1; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path), 0, len, ret); + + un->sun_path[0] = 0; + ret = connect(-1, (void *) un, len); + printf("connect(-1, {sa_family=AF_UNIX, sun_path=@\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", + (int) sizeof(un->sun_path) - 1, 0, len, ret); +} + +static void +check_in(void) +{ + const unsigned short h_port = 12345; + static const char h_addr[] = "12.34.56.78"; + + struct sockaddr_in *in = tail_alloc(sizeof(*in)); + in->sin_family = AF_INET; + in->sin_port = htons(h_port); + in->sin_addr.s_addr = inet_addr(h_addr); + unsigned int len = sizeof(*in); + int ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %d EBADF (%m)\n", + h_port, h_addr, len, ret); + + in = ((void *) in) - 4; + in->sin_family = AF_INET; + in->sin_port = htons(h_port); + in->sin_addr.s_addr = inet_addr(h_addr); + len = sizeof(*in) + 4; + ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %d EBADF (%m)\n", + h_port, h_addr, len, ret); + + in = ((void *) in) + 8; + in->sin_family = AF_INET; + in->sin_port = 0; + in->sin_addr.s_addr = 0; + len = sizeof(*in) - 4; + ret = connect(-1, (void *) in, len); + printf("connect(-1, {sa_family=AF_INET, sa_data=\"%s\"}, %u)" + " = %d EBADF (%m)\n", + "\\0\\0\\0\\0\\0\\0\\377\\377\\377\\377", + len, ret); + + len = sizeof(*in); + ret = connect(-1, (void *) in, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in, len, ret); +} + +static void +check_in6_linklocal(struct sockaddr_in6 *const in6, const char *const h_addr) +{ + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + + in6->sin6_scope_id = 0xfacefeed; + unsigned int len = sizeof(*in6); + int ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)" + ", sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + ntohs(in6->sin6_port), h_addr, + ntohl(in6->sin6_flowinfo), in6->sin6_scope_id, len, ret); + +#ifdef HAVE_IF_INDEXTONAME + in6->sin6_scope_id = if_nametoindex("lo"); + if (in6->sin6_scope_id) { + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)" + ", sin6_scope_id=if_nametoindex(\"lo\")}, %u)" + " = %d EBADF (%m)\n", + ntohs(in6->sin6_port), h_addr, + ntohl(in6->sin6_flowinfo), len, ret); + } +#endif +} + +static void +check_in6(void) +{ + const unsigned short h_port = 12345; + const unsigned int h_flowinfo = 1234567890; + static const char h_addr[] = "12:34:56:78:90:ab:cd:ef"; + + struct sockaddr_in6 *in6 = tail_alloc(sizeof(*in6)); + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + in6->sin6_scope_id = 0xfacefeed; + unsigned int len = sizeof(*in6); + int ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + + check_in6_linklocal(in6, "fe80::"); + check_in6_linklocal(in6, "ff42::"); + + in6 = ((void *) in6) - 4; + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + in6->sin6_scope_id = 0xfacefeed; + len = sizeof(*in6) + 4; + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + + in6 = ((void *) in6) + 4 + sizeof(in6->sin6_scope_id); + in6->sin6_family = AF_INET6; + in6->sin6_port = htons(h_port); + in6->sin6_flowinfo = htonl(h_flowinfo); + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + len = sizeof(*in6) - sizeof(in6->sin6_scope_id); + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_flowinfo=htonl(%u)}, %u)" + " = %d EBADF (%m)\n", + h_port, h_addr, h_flowinfo, len, ret); + + in6 = ((void *) in6) + 4; + in6->sin6_family = AF_INET6; + in6->sin6_port = 0; + in6->sin6_flowinfo = 0; + memset(&in6->sin6_addr, '0', sizeof(in6->sin6_addr) - 4); + len = sizeof(*in6) - sizeof(in6->sin6_scope_id) - 4; + ret = connect(-1, (void *) in6, len); + printf("connect(-1, {sa_family=AF_INET6" + ", sa_data=\"\\0\\0\\0\\0\\0\\000%.*u\"}, %u)" + " = %d EBADF (%m)\n", + (int) (len - offsetof(struct sockaddr_in6, sin6_addr)), 0, + len, ret); + + len = sizeof(*in6) - sizeof(in6->sin6_scope_id); + ret = connect(-1, (void *) in6, len); + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in6, len, ret); +} + +static void +check_ipx(void) +{ + const unsigned short h_port = 12345; + const unsigned int h_network = 0xfacefeed; + struct sockaddr_ipx c_ipx = { + .sipx_family = AF_IPX, + .sipx_port = htons(h_port), + .sipx_network = htonl(h_network), + .sipx_node = "ABCDEF", + .sipx_type = -1 + }; + void *ipx = tail_memdup(&c_ipx, sizeof(c_ipx)); + unsigned int len = sizeof(c_ipx); + int ret = connect(-1, ipx, len); + printf("connect(-1, {sa_family=AF_IPX, sipx_port=htons(%u)" + ", sipx_network=htonl(%#x)" + ", sipx_node=[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + ", sipx_type=%#02x}, %u) = %d EBADF (%m)\n", + h_port, h_network, + c_ipx.sipx_node[0], c_ipx.sipx_node[1], + c_ipx.sipx_node[2], c_ipx.sipx_node[3], + c_ipx.sipx_node[4], c_ipx.sipx_node[5], + c_ipx.sipx_type, len, ret); +} + +static void +check_nl(void) +{ + struct sockaddr_nl *nl = tail_alloc(sizeof(*nl)); + nl->nl_family = AF_NETLINK; + nl->nl_pid = 1234567890; + nl->nl_groups = 0xfacefeed; + unsigned int len = sizeof(*nl); + int ret = connect(-1, (void *) nl, len); + printf("connect(-1, {sa_family=AF_NETLINK, nl_pid=%d" + ", nl_groups=%#08x}, %u) = %d EBADF (%m)\n", + nl->nl_pid, nl->nl_groups, len, ret); + + nl = ((void *) nl) - 4; + nl->nl_family = AF_NETLINK; + nl->nl_pid = 1234567890; + nl->nl_groups = 0xfacefeed; + len = sizeof(*nl) + 4; + ret = connect(-1, (void *) nl, len); + printf("connect(-1, {sa_family=AF_NETLINK, nl_pid=%d" + ", nl_groups=%#08x}, %u) = %d EBADF (%m)\n", + nl->nl_pid, nl->nl_groups, len, ret); +} + +static void +check_ll(void) +{ + struct sockaddr_ll c_ll = { + .sll_family = AF_PACKET, + .sll_protocol = htons(ETH_P_ALL), + .sll_ifindex = 0xfacefeed, + .sll_hatype = ARPHRD_ETHER, + .sll_pkttype = PACKET_HOST, + .sll_halen = sizeof(c_ll.sll_addr), + .sll_addr = "abcdefgh" + }; + void *ll = tail_memdup(&c_ll, sizeof(c_ll)); + unsigned int len = sizeof(c_ll); + int ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %d EBADF (%m)\n", + c_ll.sll_ifindex, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, ret); + + ((struct sockaddr_ll *) ll)->sll_halen++; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, ...]" + "}, %u) = %d EBADF (%m)\n", + c_ll.sll_ifindex, c_ll.sll_halen + 1, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, ret); + + ((struct sockaddr_ll *) ll)->sll_halen = 0; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" + " = %d EBADF (%m)\n", c_ll.sll_ifindex, len, ret); + +#ifdef HAVE_IF_INDEXTONAME + const int id = if_nametoindex("lo"); + if (id) { + ((struct sockaddr_ll *) ll)->sll_ifindex = id; + ret = connect(-1, ll, len); + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=if_nametoindex(\"lo\")" + ", sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" + " = %d EBADF (%m)\n", len, ret); + } +#endif +} + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static void +check_hci(void) +{ + const unsigned short h_port = 12345; + struct sockaddr_hci *hci = tail_alloc(sizeof(*hci)); + hci->hci_family = AF_BLUETOOTH; + hci->hci_dev = htobs(h_port); + hci->hci_channel = HCI_CHANNEL_RAW; + unsigned int len = sizeof(*hci); + int ret = connect(-1, (void *) hci, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" + ", hci_channel=HCI_CHANNEL_RAW}, %u) = %d EBADF (%m)\n", + h_port, len, ret); +} + +static void +check_sco(void) +{ + const struct sockaddr_sco c_sco = { + .sco_family = AF_BLUETOOTH, + .sco_bdaddr.b = "abcdef" + }; + void *sco = tail_memdup(&c_sco, sizeof(c_sco)); + unsigned int len = sizeof(c_sco); + int ret = connect(-1, sco, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + "}, %u) = %d EBADF (%m)\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, ret); +} + +static void +check_rc(void) +{ + const struct sockaddr_rc c_rc = { + .rc_family = AF_BLUETOOTH, + .rc_bdaddr.b = "abcdef", + .rc_channel = 42 + }; + void *rc = tail_memdup(&c_rc, sizeof(c_rc)); + unsigned int len = sizeof(c_rc); + int ret = connect(-1, rc, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", rc_channel=%u}, %u) = %d EBADF (%m)\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, ret); +} + +static void +check_l2(void) +{ + const unsigned short h_psm = 12345; + const unsigned short h_cid = 13579; + const struct sockaddr_l2 c_l2 = { + .l2_family = AF_BLUETOOTH, + .l2_psm = htobs(h_psm), + .l2_bdaddr.b = "abcdef", + .l2_cid = htobs(h_cid), + .l2_bdaddr_type = 42 + }; + void *l2 = tail_memdup(&c_l2, sizeof(c_l2)); + unsigned int len = sizeof(c_l2); + int ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(%hu)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(%hu), l2_bdaddr_type=%u}" + ", %u) = %d EBADF (%m)\n", h_psm, + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + h_cid, c_l2.l2_bdaddr_type, len, ret); +} +#endif + +static void +check_raw(void) +{ + union { + struct sockaddr *sa; + struct sockaddr_storage *st; + } u = { .st = tail_alloc(sizeof(*u.st)) }; + memset(u.st, '0', sizeof(*u.st)); + u.sa->sa_family = 0xff; + unsigned int len = sizeof(*u.st) + 8; + int ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=%#x /* AF_??? */, sa_data=\"%.*u\"}" + ", %u) = %d EBADF (%m)\n", u.sa->sa_family, + (int) (sizeof(*u.st) - sizeof(u.sa->sa_family)), 0, len, ret); + + u.sa->sa_family = 0; + len = sizeof(u.sa->sa_family) + 1; + ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=AF_UNSPEC, sa_data=\"0\"}, %u)" + " = %d EBADF (%m)\n", len, ret); + + u.sa->sa_family = AF_BLUETOOTH; + ++len; + ret = connect(-1, (void *) u.st, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"00\"}, %u)" + " = %d EBADF (%m)\n", len, ret); +} + +int +main(void) +{ + check_un(); + check_in(); + check_in6(); + check_ipx(); + check_nl(); + check_ll(); +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + check_hci(); + check_sco(); + check_rc(); + check_l2(); +#endif + check_raw(); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-sockaddr.test b/tests/net-sockaddr.test new file mode 100755 index 00000000..cdfe536f --- /dev/null +++ b/tests/net-sockaddr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sockaddr structures. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=connect diff --git a/tests/net-y-unix.c b/tests/net-y-unix.c new file mode 100644 index 00000000..3efc2f64 --- /dev/null +++ b/tests/net-y-unix.c @@ -0,0 +1,235 @@ +/* + * This file is part of net-y-unix strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int ac, const char **av) +{ + assert(ac == 2); + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + unsigned int sun_path_len = strlen(av[1]); + assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (*len > sizeof(addr)) + *len = sizeof(addr); + + int listen_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + listen_fd, listen_inode); + + (void) unlink(av[1]); + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], [%u]) = 0\n", + listen_fd, listen_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], (int) sizeof(addr), (int) *len); + + int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + unsigned long accept_inode = inode_of_sockfd(accept_fd); + printf("accept(%d, {sa_family=AF_UNIX}" + ", [%d->%d]) = %d\n", + listen_fd, listen_inode, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, + av[1], (int) sizeof(addr), (int) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d) = 0\n", connect_fd, connect_inode); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d) = 0\n", accept_fd, accept_inode); + + connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + *optval = 1; + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_SOCKET, SO_PASSCRED, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], %u) = 0\n", + connect_fd, connect_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + listen_fd, listen_inode, av[1], + (int) sizeof(addr), (int) *len); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + accept_inode = inode_of_sockfd(accept_fd); + const char * const sun_path1 = + ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + printf("accept(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = %d\n", + listen_fd, listen_inode, sun_path1, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, av[1], + (int) sizeof(addr), (int) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(connect_fd, accept_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, sun_path1, + (int) sizeof(addr), (int) *len); + + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d) = 0\n", connect_fd, connect_inode); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d) = 0\n", accept_fd, accept_inode); + + assert(unlink(av[1]) == 0); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_inode); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-y-unix.test b/tests/net-y-unix.test new file mode 100755 index 00000000..aec8159f --- /dev/null +++ b/tests/net-y-unix.test @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Check decoding of network syscalls in -y mode. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -y is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed + +addr="$NAME-local-stream" +run_prog "./$NAME" $addr > /dev/null + +run_strace -a20 -y -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/net-yy-inet.c b/tests/net-yy-inet.c new file mode 100644 index 00000000..f76f941d --- /dev/null +++ b/tests/net-yy-inet.c @@ -0,0 +1,173 @@ +/* + * This file is part of net-yy-inet strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + const struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + }; + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = sizeof(addr); + + const int listen_fd = socket(AF_INET, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + const unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + listen_fd, listen_inode); + + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_INET, sin_port=htons(0)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + listen_fd, listen_inode, (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + const unsigned int listen_port = + ntohs(((struct sockaddr_in *) listen_sa) -> sin_port); + printf("getsockname(%d, {sa_family=AF_INET" + ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ", [%u]) = 0\n", + listen_fd, listen_port, listen_port, (unsigned) *len); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_TCP, TCP_MAXSEG, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_TCP, TCP_MAXSEG" + ", [%u], [%u]) = 0\n", + listen_fd, listen_port, *optval, (unsigned) *len); + + const int connect_fd = socket(AF_INET, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + const unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + connect_fd, connect_inode); + + *len = sizeof(addr); + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + connect_fd, connect_inode, listen_port, (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + const int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + const unsigned int connect_port = + ntohs(((struct sockaddr_in *) accept_sa) -> sin_port); + printf("accept(%d, {sa_family=AF_INET" + ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ", [%u]) = %d127.0.0.1:%u]>\n", + listen_fd, listen_port, connect_port, (unsigned) *len, + accept_fd, listen_port, connect_port); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(accept_fd, accept_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d127.0.0.1:%u]>" + ", {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + accept_fd, listen_port, connect_port, connect_port, + (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d127.0.0.1:%u]>" + ", {sa_family=AF_INET, sin_port=htons(%u)" + ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + connect_fd, connect_port, listen_port, listen_port, + (unsigned) *len); + + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_TCP, TCP_MAXSEG, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d127.0.0.1:%u]>" + ", SOL_TCP, TCP_MAXSEG, [%u], %u) = 0\n", + connect_fd, connect_port, listen_port, *optval, + (unsigned) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, + MSG_DONTROUTE | MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); + printf("sendto(%d127.0.0.1:%u]>, \"%s\", %u" + ", MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", + connect_fd, connect_port, listen_port, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d127.0.0.1:%u]>) = 0\n", + connect_fd, connect_port, listen_port); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_WAITALL, + NULL, NULL) == sizeof(text) - 1); + printf("recvfrom(%d127.0.0.1:%u]>, \"%s\", %u" + ", MSG_WAITALL, NULL, NULL) = %u\n", + accept_fd, listen_port, connect_port, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(accept_fd) == 0); + printf("close(%d127.0.0.1:%u]>) = 0\n", + accept_fd, listen_port, connect_port); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_port); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-yy-inet.test b/tests/net-yy-inet.test new file mode 100755 index 00000000..2ebf91fa --- /dev/null +++ b/tests/net-yy-inet.test @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Check decoding of ip:port pairs associated with socket descriptors +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_inet_diag + +run_prog "./$NAME" > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/net-yy-netlink.c b/tests/net-yy-netlink.c new file mode 100644 index 00000000..64d0efca --- /dev/null +++ b/tests/net-yy-netlink.c @@ -0,0 +1,84 @@ +/* + * This file is part of net-yy-netlink strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +int +main(void) +{ + unsigned magic = 1234; + struct sockaddr_nl addr = { + .nl_family = AF_NETLINK, + .nl_pid = 1234 + }; + struct sockaddr *const sa = tail_memdup(&addr, sizeof(addr)); + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = sizeof(addr); + + const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); + if (fd < 0) + perror_msg_and_skip("socket"); + const unsigned long inode = inode_of_sockfd(fd); + printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = " + "%d\n", fd, inode); + + if (bind(fd, sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_NETLINK" + ", nl_pid=%u, nl_groups=00000000}, %u) = 0\n", + fd, inode, magic, (unsigned) *len); + + if (getsockname(fd, sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_NETLINK" + ", nl_pid=%u, nl_groups=00000000}, [%u]) = 0\n", + fd, magic, magic, (unsigned) *len); + + if (close(fd)) + perror_msg_and_fail("close"); + printf("close(%d) = 0\n", fd, magic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-yy-netlink.test b/tests/net-yy-netlink.test new file mode 100755 index 00000000..bff1d861 --- /dev/null +++ b/tests/net-yy-netlink.test @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check decoding of protocol:portid pairs associated with socket +# descriptors +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2016 Fabien Siron +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_netlink_diag + +run_prog "./$NAME" > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/net-yy-unix.c b/tests/net-yy-unix.c new file mode 100644 index 00000000..63637bdd --- /dev/null +++ b/tests/net-yy-unix.c @@ -0,0 +1,229 @@ +/* + * This file is part of net-yy-unix strace test. + * + * Copyright (c) 2013-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int ac, const char **av) +{ + assert(ac == 2); + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + unsigned int sun_path_len = strlen(av[1]); + assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); + strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); + + socklen_t * const len = tail_alloc(sizeof(socklen_t)); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + if (*len > sizeof(addr)) + *len = sizeof(addr); + + int listen_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (listen_fd < 0) + perror_msg_and_skip("socket"); + unsigned long listen_inode = inode_of_sockfd(listen_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + listen_fd, listen_inode); + + (void) unlink(av[1]); + if (bind(listen_fd, listen_sa, *len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + + if (listen(listen_fd, 1)) + perror_msg_and_skip("listen"); + printf("listen(%d, 1) = 0\n", + listen_fd, listen_inode, av[1]); + + unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + *len = sizeof(*optval); + if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) + perror_msg_and_fail("getsockopt"); + printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], [%u]) = 0\n", + listen_fd, listen_inode, av[1], *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], av[1], (int) sizeof(addr), (int) *len); + + int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + unsigned long connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + int accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + unsigned long accept_inode = inode_of_sockfd(accept_fd); + printf("accept(%d, {sa_family=AF_UNIX}" + ", [%d->%d]) = %d%lu,\"%s\"]>\n", + listen_fd, listen_inode, av[1], (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, av[1]); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d%lu]>, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", + connect_fd, connect_inode, + accept_inode, av[1], (int) sizeof(addr), (int) *len); + + char text[] = "text"; + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d%lu]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, accept_inode, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, connect_inode, av[1], text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d%lu]>) = 0\n", + connect_fd, connect_inode, accept_inode); + + assert(close(accept_fd) == 0); + printf("close(%d%lu,\"%s\"]>) = 0\n", + accept_fd, accept_inode, connect_inode, av[1]); + + connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect_fd < 0) + perror_msg_and_fail("socket"); + connect_inode = inode_of_sockfd(connect_fd); + printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", + connect_fd, connect_inode); + + *optval = 1; + *len = sizeof(*optval); + if (setsockopt(connect_fd, SOL_SOCKET, SO_PASSCRED, optval, *len)) + perror_msg_and_fail("setsockopt"); + printf("setsockopt(%d, SOL_SOCKET, SO_PASSCRED" + ", [%u], %u) = 0\n", + connect_fd, connect_inode, *optval, (unsigned) *len); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getsockname(listen_fd, listen_sa, len)) + perror_msg_and_fail("getsockname"); + printf("getsockname(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, + av[1], av[1], (int) sizeof(addr), (int) *len); + + if (connect(connect_fd, listen_sa, *len)) + perror_msg_and_fail("connect"); + printf("connect(%d, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, %u) = 0\n", + connect_fd, connect_inode, av[1], (unsigned) *len); + + memset(accept_sa, 0, sizeof(addr)); + *len = sizeof(addr); + accept_fd = accept(listen_fd, accept_sa, len); + if (accept_fd < 0) + perror_msg_and_fail("accept"); + accept_inode = inode_of_sockfd(accept_fd); + const char * const sun_path1 = + ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + printf("accept(%d, {sa_family=AF_UNIX" + ", sun_path=@\"%s\"}, [%d->%d]) = %d%lu,\"%s\"]>\n", + listen_fd, listen_inode, av[1], sun_path1, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, av[1]); + + memset(listen_sa, 0, sizeof(addr)); + *len = sizeof(addr); + if (getpeername(connect_fd, listen_sa, len)) + perror_msg_and_fail("getpeername"); + printf("getpeername(%d%lu,@\"%s\"]>, {sa_family=AF_UNIX" + ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, + accept_inode, sun_path1, av[1], (int) sizeof(addr), (int) *len); + + assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) + == sizeof(text) - 1); + printf("sendto(%d%lu,@\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, 0) = %u\n", + connect_fd, connect_inode, accept_inode, sun_path1, text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, NULL) + == sizeof(text) - 1); + printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" + ", NULL, NULL) = %u\n", + accept_fd, accept_inode, connect_inode, av[1], text, + (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); + + assert(close(connect_fd) == 0); + printf("close(%d%lu,@\"%s\"]>) = 0\n", + connect_fd, connect_inode, accept_inode, sun_path1); + + assert(close(accept_fd) == 0); + printf("close(%d%lu,\"%s\"]>) = 0\n", + accept_fd, accept_inode, connect_inode, av[1]); + + assert(unlink(av[1]) == 0); + + assert(close(listen_fd) == 0); + printf("close(%d) = 0\n", + listen_fd, listen_inode, av[1]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-yy-unix.test b/tests/net-yy-unix.test new file mode 100755 index 00000000..b82761c3 --- /dev/null +++ b/tests/net-yy-unix.test @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check decoding of address information (inode[->peer][,path]) +# associated with unix domain socket descriptors. +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# strace -yy is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +check_prog sed +run_prog ./netlink_unix_diag + +addr="$NAME-local-stream" +run_prog "./$NAME" $addr > /dev/null + +run_strace -a22 -yy -eclose,network $args > "$EXP" +# Filter out close() calls made by ld.so and libc. +sed -n '/socket/,$p' < "$LOG" > "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/net.expected b/tests/net.expected new file mode 100644 index 00000000..80dd0701 --- /dev/null +++ b/tests/net.expected @@ -0,0 +1,7 @@ +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +socket\(AF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +socket\(AF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +listen\(0, 5\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, \[19\]\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\]\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 diff --git a/tests/net.test b/tests/net.test index de1dae14..cf943ffa 100755 --- a/tests/net.test +++ b/tests/net.test @@ -4,42 +4,8 @@ . "${srcdir=.}/init.sh" -check_prog grep -check_prog rm - -rm -f $LOG.* - -./net-accept-connect || - fail_ 'net-accept-connect failed' - -args="-tt -ff -o $LOG -enetwork ./net-accept-connect" -$STRACE $args || - fail_ "strace $args failed" - -"$srcdir"/../strace-log-merge $LOG > $LOG || { - cat $LOG - fail_ 'strace-log-merge failed' -} - -rm -f $LOG.* - -grep_log() -{ - local syscall="$1"; shift - local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +' - - LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || { - cat $LOG - fail_ "strace -enetwork failed to trace \"$syscall\" properly" - } -} - -grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0' -grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1' -grep_log bind '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0' -grep_log listen '\(0, 5\) += 0' -grep_log getsockname '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, \[15\]\) += 0' -grep_log accept '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), NULL\}, \[2\]\) += 1' -grep_log connect '\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0' +run_prog ./net-accept-connect net-local-stream +run_strace_merge -enetwork $args +match_grep exit 0 diff --git a/tests/netlink_inet_diag.c b/tests/netlink_inet_diag.c new file mode 100644 index 00000000..2332e203 --- /dev/null +++ b/tests/netlink_inet_diag.c @@ -0,0 +1,144 @@ +/* + * This file is part of inet-yy strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +static void +send_query(const int fd, const int family, const int proto) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct inet_diag_req_v2 idr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .idr = { + .sdiag_family = family, + .sdiag_protocol = proto, + .idiag_states = -1 + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct inet_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +int main(void) +{ + struct sockaddr_in addr; + socklen_t len = sizeof(addr); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + close(0); + close(1); + + if (socket(AF_INET, SOCK_STREAM, 0)) + perror_msg_and_skip("socket AF_INET"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1, AF_INET, IPPROTO_TCP); + check_responses(1); + return 0; +} diff --git a/tests/netlink_netlink_diag.c b/tests/netlink_netlink_diag.c new file mode 100644 index 00000000..fc32822b --- /dev/null +++ b/tests/netlink_netlink_diag.c @@ -0,0 +1,147 @@ +/* + * This file is part of net-yy-netlink strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +static void +send_query(const int fd) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct netlink_diag_req ndr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .ndr = { + .sdiag_family = AF_NETLINK, + .sdiag_protocol = NDIAG_PROTO_ALL, + .ndiag_show = NDIAG_SHOW_MEMINFO + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct netlink_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +int main(void) +{ + struct sockaddr_nl addr; + socklen_t len = sizeof(addr); + + memset(&addr, 0, sizeof(addr)); + addr.nl_family = AF_NETLINK; + + close(0); + close(1); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) + perror_msg_and_skip("socket AF_NETLINK"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1); + check_responses(1); + return 0; +} diff --git a/tests/netlink_protocol.c b/tests/netlink_protocol.c new file mode 100644 index 00000000..34e114be --- /dev/null +++ b/tests/netlink_protocol.c @@ -0,0 +1,240 @@ +/* + * Check decoding of netlink protocol. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016 Fabien Siron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +# endif + +static void +send_query(const int fd) +{ + static const struct req { + struct nlmsghdr nlh; + const char magic[4]; + } c_req = { + .nlh = { + .nlmsg_len = sizeof(struct req), + .nlmsg_type = NLMSG_NOOP, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .magic = "abcd" + }; + struct req *const req = tail_memdup(&c_req, sizeof(c_req)); + long rc; + const char *errstr; + + /* zero address */ + rc = sendto(fd, NULL, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, NULL, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, (unsigned) sizeof(*req), sprintrc(rc)); + + /* zero length */ + rc = sendto(fd, req, 0, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, \"\", 0, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, sprintrc(rc)); + + /* zero address and length */ + rc = sendto(fd, NULL, 0, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, NULL, 0, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, sprintrc(rc)); + + /* unfetchable struct nlmsghdr */ + const void *const efault = tail_alloc(sizeof(struct nlmsghdr) - 1); + rc = sendto(fd, efault, sizeof(struct nlmsghdr), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, %p, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, efault, (unsigned) sizeof(struct nlmsghdr), sprintrc(rc)); + + /* whole message length < sizeof(struct nlmsghdr) */ + rc = sendto(fd, req->magic, sizeof(req->magic), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, \"abcd\", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, (unsigned) sizeof(req->magic), sprintrc(rc)); + + /* a single message with some data */ + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* a single message without data */ + req->nlh.nlmsg_len = sizeof(req->nlh); + rc = sendto(fd, &req->nlh, sizeof(req->nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(req->nlh), sprintrc(rc)); + + /* nlmsg_len > whole message length */ + req->nlh.nlmsg_len = sizeof(*req) + 8; + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* nlmsg_len < sizeof(struct nlmsghdr) */ + req->nlh.nlmsg_len = 8; + rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req->nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*req), sprintrc(rc)); + + /* a sequence of two nlmsg objects */ + struct reqs { + struct req req1; + char padding[NLMSG_ALIGN(sizeof(struct req)) - sizeof(struct req)]; + struct req req2; + } *const reqs = tail_alloc(sizeof(*reqs)); + memcpy(&reqs->req1, &c_req, sizeof(c_req)); + memcpy(&reqs->req2, &c_req, sizeof(c_req)); + + rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}, \"abcd\"}]" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*reqs), sprintrc(rc)); + + /* unfetchable second struct nlmsghdr */ + void *const efault2 = tail_memdup(&reqs->req1, sizeof(reqs->req1)); + rc = sendto(fd, efault2, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, %p], %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + &((struct reqs *) efault2)->req2, (unsigned) sizeof(*reqs), + sprintrc(rc)); + + /* message length is not enough for the second struct nlmsghdr */ + rc = sendto(fd, reqs, sizeof(*reqs) - sizeof(req->nlh), MSG_DONTWAIT, + NULL, 0); + errstr = sprintrc(rc); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, \"", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP); + print_quoted_memory((void *) &reqs->req2.nlh, + sizeof(reqs->req2) - sizeof(req->nlh)); + printf("\"], %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (unsigned) (sizeof(*reqs) - sizeof(req->nlh)), errstr); + + /* second nlmsg_len < sizeof(struct nlmsghdr) */ + reqs->req2.nlh.nlmsg_len = 4; + rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}}], %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, + reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, + (unsigned) sizeof(*reqs), sprintrc(rc)); + + /* abbreviated output */ +# define DEFAULT_STRLEN 32 +# define ABBREV_LEN (DEFAULT_STRLEN + 1) + const unsigned int msg_len = sizeof(struct nlmsghdr) * ABBREV_LEN; + struct nlmsghdr *const msgs = tail_alloc(msg_len); + unsigned int i; + for (i = 0; i < ABBREV_LEN; ++i) { + msgs[i].nlmsg_len = sizeof(*msgs); + msgs[i].nlmsg_type = NLMSG_NOOP; + msgs[i].nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + msgs[i].nlmsg_seq = i; + msgs[i].nlmsg_pid = 0; + } + + rc = sendto(fd, msgs, msg_len, MSG_DONTWAIT, NULL, 0); + errstr = sprintrc(rc); + printf("sendto(%d, [", fd); + for (i = 0; i < DEFAULT_STRLEN; ++i) { + if (i) + printf(", "); + printf("{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=0}}", + msgs[i].nlmsg_len, NLM_F_DUMP, msgs[i].nlmsg_seq); + } + printf(", ...], %u, MSG_DONTWAIT, NULL, 0) = %s\n", msg_len, errstr); +} + +int main(void) +{ + struct sockaddr_nl addr; + socklen_t len = sizeof(addr); + int fd; + + memset(&addr, 0, sizeof(addr)); + addr.nl_family = AF_NETLINK; + + if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) == -1) + perror_msg_and_skip("socket AF_NETLINK"); + + printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = %d\n", + fd); + if (bind(fd, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + printf("bind(%d, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}" + ", %u) = 0\n", fd, len); + + char *path; + if (asprintf(&path, "/proc/self/fd/%u", fd) < 0) + perror_msg_and_fail("asprintf"); + char buf[256]; + if (getxattr(path, "system.sockprotoname", buf, sizeof(buf) - 1) < 0) + perror_msg_and_skip("getxattr"); + free(path); + + send_query(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests/netlink_protocol.test b/tests/netlink_protocol.test new file mode 100755 index 00000000..ab2bb1e8 --- /dev/null +++ b/tests/netlink_protocol.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding of netlink protocol. + +. "${srcdir=.}/init.sh" + +# getfdproto is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +run_strace_match_diff -e trace=network diff --git a/tests/netlink_unix_diag.c b/tests/netlink_unix_diag.c new file mode 100644 index 00000000..269adc6f --- /dev/null +++ b/tests/netlink_unix_diag.c @@ -0,0 +1,156 @@ +/* + * This file is part of net-yy-unix strace test. + * + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG +# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG +#endif + +static void +send_query(const int fd) +{ + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct { + struct nlmsghdr nlh; + struct unix_diag_req udr; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP + }, + .udr = { + .sdiag_family = AF_UNIX, + .udiag_states = -1, + .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER + } + }; + struct iovec iov = { + .iov_base = &req, + .iov_len = sizeof(req) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + if (sendmsg(fd, &msg, 0) <= 0) + perror_msg_and_skip("sendmsg"); +} + +static void +check_responses(const int fd) +{ + static union { + struct nlmsghdr hdr; + long buf[8192 / sizeof(long)]; + } hdr_buf; + + struct sockaddr_nl nladdr = { + .nl_family = AF_NETLINK + }; + struct iovec iov = { + .iov_base = hdr_buf.buf, + .iov_len = sizeof(hdr_buf.buf) + }; + struct msghdr msg = { + .msg_name = (void *) &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1 + }; + + ssize_t ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + perror_msg_and_skip("recvmsg"); + + struct nlmsghdr *h = &hdr_buf.hdr; + if (!NLMSG_OK(h, ret)) + error_msg_and_skip("!NLMSG_OK"); + if (h->nlmsg_type == NLMSG_ERROR) { + const struct nlmsgerr *err = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) + error_msg_and_skip("NLMSG_ERROR"); + errno = -err->error; + perror_msg_and_skip("NLMSG_ERROR"); + } + if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + error_msg_and_skip("unexpected nlmsg_type %u", + (unsigned) h->nlmsg_type); + + const struct unix_diag_msg *diag = NLMSG_DATA(h); + if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) + error_msg_and_skip("short response"); +} + +#define SUN_PATH "netlink_unix_diag_socket" +int main(void) +{ + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = SUN_PATH + }; + socklen_t len = offsetof(struct sockaddr_un, sun_path) + sizeof(SUN_PATH); + + close(0); + close(1); + + (void) unlink(SUN_PATH); + if (socket(AF_UNIX, SOCK_STREAM, 0)) + perror_msg_and_skip("socket AF_UNIX"); + if (bind(0, (struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind"); + if (listen(0, 5)) + perror_msg_and_skip("listen"); + + assert(unlink(SUN_PATH) == 0); + + if (socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) != 1) + perror_msg_and_skip("socket AF_NETLINK"); + + send_query(1); + check_responses(1); + return 0; +} diff --git a/tests/newfstatat.c b/tests/newfstatat.c new file mode 100644 index 00000000..b501d880 --- /dev/null +++ b/tests/newfstatat.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_newfstatat + +# define TEST_SYSCALL_NR __NR_newfstatat +# define TEST_SYSCALL_STR "newfstatat" +# include "fstatat.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_newfstatat") + +#endif diff --git a/tests/newfstatat.test b/tests/newfstatat.test new file mode 100755 index 00000000..6d83ec08 --- /dev/null +++ b/tests/newfstatat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check newfstatat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests/nsyscalls.c b/tests/nsyscalls.c new file mode 100644 index 00000000..aecf7aa7 --- /dev/null +++ b/tests/nsyscalls.c @@ -0,0 +1,108 @@ +/* + * Check decoding of out-of-range syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "sysent.h" +#include +#include +#include +#include + +#define TD 0 +#define TF 0 +#define TI 0 +#define TN 0 +#define TP 0 +#define TS 0 +#define TM 0 +#define NF 0 +#define MA 0 +#define SI 0 +#define SE 0 +#define CST 0 +#define SEN(arg) 0,0 + +static const struct_sysent syscallent[] = { +#include "syscallent.h" +}; + +#if defined __X32_SYSCALL_BIT && defined __NR_read \ + && (__X32_SYSCALL_BIT & __NR_read) != 0 +# define SYSCALL_BIT __X32_SYSCALL_BIT +#else +# define SYSCALL_BIT 0 +#endif + +static void +test_syscall(const unsigned long nr) +{ + static const kernel_ulong_t a[] = { + (kernel_ulong_t) 0xface0fedbadc0dedULL, + (kernel_ulong_t) 0xface1fedbadc1dedULL, + (kernel_ulong_t) 0xface2fedbadc2dedULL, + (kernel_ulong_t) 0xface3fedbadc3dedULL, + (kernel_ulong_t) 0xface4fedbadc4dedULL, + (kernel_ulong_t) 0xface5fedbadc5dedULL + }; + + long rc = syscall(nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5]); +#ifdef LINUX_MIPSO32 + printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" + " = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5], rc); +#else + printf("syscall_%lu(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" + " = %ld (errno %d)\n", nr, + (unsigned long long) a[0], + (unsigned long long) a[1], + (unsigned long long) a[2], + (unsigned long long) a[3], + (unsigned long long) a[4], + (unsigned long long) a[5], + rc, errno); +#endif +} + +int +main(void) +{ + test_syscall(ARRAY_SIZE(syscallent)); + +#ifdef SYS_socket_subcall + test_syscall(SYS_socket_subcall + 1); +#endif + +#ifdef SYS_ipc_subcall + test_syscall(SYS_ipc_subcall + 1); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nsyscalls.test b/tests/nsyscalls.test new file mode 100755 index 00000000..61f72d52 --- /dev/null +++ b/tests/nsyscalls.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of out-of-range syscalls. + +. "${srcdir=.}/init.sh" + +if [ "$MIPS_ABI" = "o32" ]; then + syscall=syscall +else + syscall=none +fi + +run_strace_match_diff -e trace=$syscall diff --git a/tests/old_mmap.c b/tests/old_mmap.c new file mode 100644 index 00000000..2725fb75 --- /dev/null +++ b/tests/old_mmap.c @@ -0,0 +1,101 @@ +/* + * Check decoding of "old mmap" edition of mmap syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +/* + * On s390x and m68k, this is the mmap syscall used by glibc, so, + * from one side, it's already covered by another test, and, from another side, + * it would require additional efforts to filter out mmap calls made by glibc. + */ + +#if defined __NR_mmap && \ +( defined __arm__ \ + || defined __i386__ \ + || (defined __s390__ && !defined __s390x__) \ +) + +# include +# include +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_mmap, 0); + printf("mmap(NULL) = %ld %s (%m)\n", rc, errno2name()); + + const unsigned int args1_c[6] = { + 0xdeadbeef, /* addr */ + 0xfacefeed, /* len */ + PROT_READ|PROT_EXEC, /* prot */ + MAP_FILE|MAP_FIXED, /* flags */ + -2U, /* fd */ + 0xbadc0ded /* offset */ + }; + const unsigned int page_size = get_page_size(); + const unsigned int args2_c[6] = { + 0, + page_size, + PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, + -1U, + 0xfaced000 & -page_size + }; + void *args = tail_memdup(args1_c, sizeof(args1_c)); + + rc = syscall(__NR_mmap, args); + printf("mmap(%#x, %u, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" + ", %d, %#x) = %ld %s (%m)\n", + args1_c[0], args1_c[1], args1_c[4], args1_c[5], + rc, errno2name()); + + memcpy(args, args2_c, sizeof(args2_c)); + rc = syscall(__NR_mmap, args); + printf("mmap(NULL, %u, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" + ", %d, %#x) = %#lx\n", + args2_c[1], args2_c[4], args2_c[5], rc); + + void *addr = (void *) rc; + if (mprotect(addr, page_size, PROT_NONE)) + perror_msg_and_fail("mprotect(%p, %u, PROT_NONE)", + addr, page_size); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__" + " || (__s390__ && !__s390x__))") + +#endif diff --git a/tests/old_mmap.test b/tests/old_mmap.test new file mode 100755 index 00000000..af776ff7 --- /dev/null +++ b/tests/old_mmap.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of "old mmap" edition of mmap syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap diff --git a/tests/oldfstat.c b/tests/oldfstat.c new file mode 100644 index 00000000..f5a94416 --- /dev/null +++ b/tests/oldfstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldfstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldfstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldfstat +# define TEST_SYSCALL_STR "oldfstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) +# include "fstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldfstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests/oldfstat.test b/tests/oldfstat.test new file mode 100755 index 00000000..66a10561 --- /dev/null +++ b/tests/oldfstat.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check oldfstat syscall decoding. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +syscall=$NAME +run_prog > /dev/null +sample=$syscall.sample +> "$sample" +run_strace -ve$syscall -P$sample -a21 $args > "$OUT" +match_diff "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests/oldlstat.c b/tests/oldlstat.c new file mode 100644 index 00000000..66132370 --- /dev/null +++ b/tests/oldlstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldlstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldlstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldlstat +# define TEST_SYSCALL_STR "oldlstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldlstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests/oldlstat.test b/tests/oldlstat.test new file mode 100755 index 00000000..a0f9ab93 --- /dev/null +++ b/tests/oldlstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check oldlstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests/oldselect.c b/tests/oldselect.c new file mode 100644 index 00000000..7413fc33 --- /dev/null +++ b/tests/oldselect.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_select && defined __NR__newselect \ + && __NR_select != __NR__newselect \ + && !defined SPARC + +# include +# include + +int +main(void) +{ + int fds[2]; + fd_set r = {}, w = {}; + struct timeval timeout = { .tv_sec = 0, .tv_usec = 42 }; + long args[] = { + 2, (long) &r, (long) &w, 0, (long) &timeout, + 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded, 0xdeadbeef + }; + + (void) close(0); + (void) close(1); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + FD_SET(0, &w); + FD_SET(1, &r); + if (syscall(__NR_select, args)) + perror_msg_and_skip("select"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect") + +#endif diff --git a/tests/oldselect.expected b/tests/oldselect.expected new file mode 100644 index 00000000..d6e7f3c4 --- /dev/null +++ b/tests/oldselect.expected @@ -0,0 +1,2 @@ +select(2, [1], [0], NULL, {tv_sec=0, tv_usec=42}) = 0 (Timeout) ++++ exited with 0 +++ diff --git a/tests/oldselect.test b/tests/oldselect.test new file mode 100755 index 00000000..35661ad4 --- /dev/null +++ b/tests/oldselect.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check old select syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a34 -eselect $args +match_diff + +exit 0 diff --git a/tests/oldstat.c b/tests/oldstat.c new file mode 100644 index 00000000..d06e2bc6 --- /dev/null +++ b/tests/oldstat.c @@ -0,0 +1,49 @@ +/* + * Check decoding of oldstat syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_oldstat && HAVE_STRUCT___OLD_KERNEL_STAT + +# define OLD_STAT 1 +# define TEST_SYSCALL_NR __NR_oldstat +# define TEST_SYSCALL_STR "oldstat" +# define STRUCT_STAT struct __old_kernel_stat +# define STRUCT_STAT_STR "struct __old_kernel_stat" +# define STRUCT_STAT_IS_STAT64 0 +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 131478418U) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldstat && HAVE_STRUCT___OLD_KERNEL_STAT") + +#endif diff --git a/tests/oldstat.test b/tests/oldstat.test new file mode 100755 index 00000000..42d70f7f --- /dev/null +++ b/tests/oldstat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check oldstat syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests/open.c b/tests/open.c new file mode 100644 index 00000000..01e89b0f --- /dev/null +++ b/tests/open.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_open + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "open.sample"; + + long fd = syscall(__NR_open, sample, O_RDONLY|O_CREAT, 0400); + printf("open(\"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", + sample, sprintrc(fd)); + + if (fd != -1) { + close(fd); + if (unlink(sample)) + perror_msg_and_fail("unlink"); + + fd = syscall(__NR_open, sample, O_RDONLY); + printf("open(\"%s\", O_RDONLY) = %s\n", sample, sprintrc(fd)); + + fd = syscall(__NR_open, sample, O_WRONLY|O_NONBLOCK|0x80000000); + printf("open(\"%s\", O_WRONLY|O_NONBLOCK|0x80000000) = %s\n", + sample, sprintrc(fd)); + } + +#ifdef O_TMPFILE +# if O_TMPFILE == (O_TMPFILE & ~O_DIRECTORY) +# define STR_O_TMPFILE "O_TMPFILE" +# else +# define STR_O_TMPFILE "O_DIRECTORY|O_TMPFILE" +# endif + fd = syscall(__NR_open, sample, O_WRONLY|O_TMPFILE, 0600); + printf("open(\"%s\", O_WRONLY|%s, 0600) = %s\n", + sample, STR_O_TMPFILE, sprintrc(fd)); +#endif /* O_TMPFILE */ + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_open") + +#endif diff --git a/tests/open.test b/tests/open.test new file mode 100755 index 00000000..6df19cb8 --- /dev/null +++ b/tests/open.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check open syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests/openat.c b/tests/openat.c new file mode 100644 index 00000000..1d6765cf --- /dev/null +++ b/tests/openat.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016 Katerina Koukiou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_openat + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "openat.sample"; + + long fd = syscall(__NR_openat, -100, sample, O_RDONLY|O_CREAT, 0400); + printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", + sample, sprintrc(fd)); + + if (fd != -1) { + close(fd); + if (unlink(sample) == -1) + perror_msg_and_fail("unlink"); + + fd = syscall(__NR_openat, -100, sample, O_RDONLY); + printf("openat(AT_FDCWD, \"%s\", O_RDONLY) = %s\n", + sample, sprintrc(fd)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_openat") + +#endif diff --git a/tests/openat.test b/tests/openat.test new file mode 100755 index 00000000..68c4cee1 --- /dev/null +++ b/tests/openat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check openat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -P $NAME.sample diff --git a/tests/opipe.test b/tests/opipe.test new file mode 100755 index 00000000..90e6838a --- /dev/null +++ b/tests/opipe.test @@ -0,0 +1,16 @@ +#!/bin/sh + +# Check how -o '|pipe' works. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog grep chdir $srcdir/umovestr.expected > "$EXP" +run_prog ./umovestr + +> "$LOG" || fail_ "failed to write $LOG" +$STRACE -o "|cat > $LOG && $SLEEP_A_BIT && grep chdir < $LOG > $OUT" -e chdir $args || + dump_log_and_fail_with "$STRACE $args failed" + +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/options-syntax.test b/tests/options-syntax.test new file mode 100755 index 00000000..592b0e03 --- /dev/null +++ b/tests/options-syntax.test @@ -0,0 +1,148 @@ +#!/bin/sh +# +# Check strace options syntax. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_exit_status_and_stderr() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_diff "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +strace_exp="${STRACE##* }" + +check_e() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$strace_exp: $pattern +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_h() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$strace_exp: $pattern +Try '$strace_exp -h' for more information. +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_e "Invalid process id: '0'" -p 0 +check_e "Invalid process id: '-42'" -p -42 +check_e "Invalid process id: '$$.'" -p $$. +check_e "Invalid process id: 'a'" -p 1,a +check_e "Syscall 'chdir' for -b isn't supported" -b chdir +check_e "Syscall 'chdir' for -b isn't supported" -b execve -b chdir + +check_e "invalid system call '-1'" -e-1 +check_e "invalid system call '-2'" -e -2 +check_e "invalid system call '-3'" -etrace=-3 +check_e "invalid system call '-4'" -e trace=-4 +check_e "invalid system call '-5'" -e trace=1,-5 +check_e "invalid system call '2147483647'" -e 2147483647 +check_e "invalid system call '2147483648'" -e 2147483648 +check_e "invalid system call '4294967295'" -e 4294967295 +check_e "invalid system call '4294967296'" -e 4294967296 + +check_e "invalid descriptor '-1'" -eread=-1 +check_e "invalid descriptor '-42'" -ewrite=-42 +check_e "invalid descriptor '2147483648'" -eread=2147483648 +check_e "invalid descriptor '4294967296'" -ewrite=4294967296 +check_e "invalid descriptor 'foo'" -eread=foo +check_e "invalid descriptor ''" -ewrite= +check_e "invalid descriptor ','" -eread=, +check_e "invalid descriptor '!'" -ewrite='!' +check_e "invalid descriptor '!'" -eread='0,!' +check_e "invalid descriptor '!,'" -ewrite='!,' + +check_h 'must have PROG [ARGS] or -p PID' +check_h 'PROG [ARGS] must be specified with -D' -D -p $$ +check_h '-c and -C are mutually exclusive' -c -C true +check_h '-c and -C are mutually exclusive' -C -c true +check_h '(-c or -C) and -ff are mutually exclusive' -c -ff true +check_h '(-c or -C) and -ff are mutually exclusive' -C -ff true +check_h '-w must be given with (-c or -C)' -w true +check_h 'piping the output and -ff are mutually exclusive' -o '|' -ff true +check_h 'piping the output and -ff are mutually exclusive' -o '!' -ff true +check_h "invalid -a argument: '-42'" -a -42 +check_h "invalid -O argument: '-42'" -O -42 +check_h "invalid -s argument: '-42'" -s -42 +check_h "invalid -I argument: '5'" -I 5 + +if [ -n "${UID-}" ]; then + if [ "${UID-}" = 0 ]; then + umsg="Cannot find user ':nosuchuser:'" + else + umsg='You must be root to use the -u option' + fi + + check_e "$umsg" -u :nosuchuser: true + + for c in i r t T y; do + check_e "-$c has no effect with -c +$strace_exp: $umsg" -u :nosuchuser: -c -$c true + done + check_e "-i has no effect with -c +$strace_exp: -r has no effect with -c +$strace_exp: -t has no effect with -c +$strace_exp: -T has no effect with -c +$strace_exp: -y has no effect with -c +$strace_exp: $umsg" -u :nosuchuser: -cirtTy true + + check_e "-tt has no effect with -r +$strace_exp: $umsg" -u :nosuchuser: -r -tt true +fi + +args='-p 2147483647' +$STRACE $args 2> "$LOG" && + dump_log_and_fail_with \ + "strace $args failed to handle the error properly" + +for cmd in PTRACE_SEIZE PTRACE_ATTACH; do + cat > "$EXP" << __EOF__ +$strace_exp: attach: ptrace($cmd, 2147483647): No such process +__EOF__ + diff -- "$EXP" "$LOG" || + continue + args= + break +done + +[ -z "$args" ] || + dump_log_and_fail_with \ + "strace $args failed to print expected diagnostics" + +rm -f "$EXP" diff --git a/tests/overflowuid.c b/tests/overflowuid.c new file mode 100644 index 00000000..a3c742b4 --- /dev/null +++ b/tests/overflowuid.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +read_int_from_file(const char *const fname, int *const pvalue) +{ + const int fd = open(fname, O_RDONLY); + if (fd < 0) + return -1; + + long lval; + char buf[sizeof(lval) * 3]; + int n = read(fd, buf, sizeof(buf) - 1); + int saved_errno = errno; + close(fd); + + if (n < 0) { + errno = saved_errno; + return -1; + } + + buf[n] = '\0'; + char *endptr = 0; + errno = 0; + lval = strtol(buf, &endptr, 10); + if (!endptr || (*endptr && '\n' != *endptr) +#if INT_MAX < LONG_MAX + || lval > INT_MAX || lval < INT_MIN +#endif + || ERANGE == errno) { + if (!errno) + errno = EINVAL; + return -1; + } + + *pvalue = (int) lval; + return 0; +} + +static void +check_overflow_id(const int id, const char *overflowid) +{ + int n; + + if (read_int_from_file(overflowid, &n)) { + if (ENOENT == errno) + return; + perror_msg_and_fail("read_int_from_file: %s", overflowid); + } + + if (id == n) + error_msg_and_skip("%d matches %s", id, overflowid); +} + +void +check_overflowuid(const int uid) +{ + check_overflow_id(uid, "/proc/sys/kernel/overflowuid"); +} + +void +check_overflowgid(const int gid) +{ + check_overflow_id(gid, "/proc/sys/kernel/overflowgid"); +} diff --git a/tests/pause.c b/tests/pause.c new file mode 100644 index 00000000..86873620 --- /dev/null +++ b/tests/pause.c @@ -0,0 +1,79 @@ +/* + * Check decoding of pause syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016 Fei Jie + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pause + +# include +# include +# include +# include +# include + +static void +handler(int sig) +{ +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGALRM, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct itimerval itv = { .it_value.tv_usec = 123456 }; + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_fail("setitimer"); + + syscall(__NR_pause); + if (errno == ENOSYS) + printf("pause() = -1 ENOSYS (%m)\n"); + else + printf("pause() = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pause") + +#endif diff --git a/tests/pause.test b/tests/pause.test new file mode 100755 index 00000000..c5fdacde --- /dev/null +++ b/tests/pause.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pause syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 -esignal=none diff --git a/tests/pc.c b/tests/pc.c new file mode 100644 index 00000000..f53acd45 --- /dev/null +++ b/tests/pc.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + const unsigned long pagesize = get_page_size(); + +#ifdef __s390__ + /* + * The si_addr field is unreliable: + * https://marc.info/?l=linux-s390&m=142515870124248&w=2 + */ + error_msg_and_skip("s390: si_addr is unreliable"); +#endif + + /* write instruction pointer length to the log */ + assert(write(-1, NULL, 2 * sizeof(void *)) < 0); + + /* just a noticeable line in the log */ + assert(munmap(&main, 0) < 0); + + int pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + const unsigned long mask = ~(pagesize - 1); + unsigned long addr = (unsigned long) &main & mask; + unsigned long size = pagesize << 1; + +#ifdef HAVE_DLADDR + Dl_info info; + if (dladdr(&main, &info)) { + const unsigned long base = + (unsigned long) info.dli_fbase & mask; + if (base < addr) { + size += addr - base; + addr = base; + } + } else +#endif + { + addr -= size; + size <<= 1; + } + + /* SIGSEGV is expected */ + (void) munmap((void *) addr, size); + (void) munmap((void *) addr, size); + error_msg_and_skip("SIGSEGV did not happen"); + } + + int status; + assert(wait(&status) == pid); + assert(WIFSIGNALED(status)); + assert(WTERMSIG(status) == SIGSEGV); + + /* dump process map for debug purposes */ + close(0); + if (!open("/proc/self/maps", O_RDONLY)) + (void) sendfile(1, 0, NULL, pagesize); + + return 0; +} diff --git a/tests/pc.test b/tests/pc.test new file mode 100755 index 00000000..beadb7d7 --- /dev/null +++ b/tests/pc.test @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Check -i option. +# +# Copyright (c) 2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +check_prog sed + +run_prog > /dev/null + +args="-if $args" +$STRACE $args 2> "$LOG" || + dump_log_and_fail_with "$STRACE $args failed" + +len="$(sed -r -n 's/^\[[[:xdigit:]]+\] write\(-1, NULL, ([[:digit:]]{1,2})\)[[:space:]]+= -1 .*/\1/p' "$LOG")" && +[ -n "$len" ] && +pid="$(sed -r -n 's/^\[[[:xdigit:]]{'"$len"'}\] --- SIGCHLD \{si_signo=SIGCHLD, si_code=CLD_(KILLED|DUMPED), si_pid=([[:digit:]]+), .*/\2/p' "$LOG")" && +[ -n "$pid" ] && +ip="$(sed -r -n 's/^\[pid +'"$pid"'\] \[([[:xdigit:]]{'"$len"'})] --- SIGSEGV \{.*\} ---$/\1/p' "$LOG")" && +[ -n "$ip" ] && +addr="$(echo "$ip" |sed -r 's/^0+//')" && +[ -n "$addr" ] || + dump_log_and_fail_with + +EXPECTED="$LOG.expected" +cat > "$EXPECTED" << __EOF__ +\\[[[:xdigit:]]{$len}\\] munmap\\(0x[[:xdigit:]]+, 0\\) += -1 .* +\\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr\\} --- +\\[pid +$pid\\] \\[\\?{$len}\\] \\+\\+\\+ killed by SIGSEGV( \\(core dumped\\))? \\+\\+\\+ +\\[\\?{$len}\\] \\+\\+\\+ exited with 0 \\+\\+\\+ +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" + +exit 0 diff --git a/tests/perf_event_open.c b/tests/perf_event_open.c new file mode 100644 index 00000000..0ffea292 --- /dev/null +++ b/tests/perf_event_open.c @@ -0,0 +1,821 @@ +/* + * Check verbose decoding of perf_event_open syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined(__NR_perf_event_open) && defined(HAVE_LINUX_PERF_EVENT_H) + +# include +# include +# include +# include +# include +# include +# include +# include + +# include + +# include "xlat.h" +# include "xlat/perf_event_open_flags.h" +# include "xlat/perf_attr_size.h" + +# if ULONG_MAX > UINT_MAX /* Poor man's "whether long is 8 bytes?" */ +# define LONG_STR_PREFIX "ffffffff" +# else /* !(ULONG_MAX > UINT_MAX) */ +# define LONG_STR_PREFIX "" +# endif /* ULONG_MAX > UINT_MAX */ + +# ifndef PERF_TYPE_BREAKPOINT +# define PERF_TYPE_BREAKPOINT 5 +# endif + +struct s32_val_str { + int32_t val; + const char *str; +}; + +struct u32_val_str { + uint32_t val; + const char *str; +}; + +struct u64_val_str { + uint64_t val; + const char *str; +}; + +/* In order to avoid endianess-specific hackery */ +struct pea_flags { + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + __reserved_1 :36; +}; + +static const char * +printaddr(void *ptr) +{ + static char buf[sizeof("0x") + sizeof(void *) * 2]; + + if (ptr == NULL) + return "NULL"; + + snprintf(buf, sizeof(buf), "%#lx", (unsigned long)ptr); + + return buf; +} + +/* + * Checklist: + * + * type - 8 IDs + * config - 13 IDs (0..11 + random), depends on type + * sample type - bitmask, up to 20 bits + * read_format - 5 IDs + * bp_type - 6, weird semantics (invalid/unknown) + * branch_sample_type - bitmask, 16 bits + * clockid - 13 values + * + * Unions: + * sample_period/sample_freq + * wakeup_event/wakeup_watermark + * bp_addr/config1 + * bp_len/config2 + */ + +/* + * The main idea behind all those numerous ifdefs is checking against version of + * structure provided in kernel headers and not use one defined in strace + * headers (assume the case when suddenly we add flag without proper update of + * __reserved_1 field or something like this). + */ +static void +print_event_attr(struct perf_event_attr *attr_ptr, size_t size, + const char *type, const char *config, const char *sample_type, + const char *read_format, const char *precise_ip_desc, + const char *bp_type, const char *branch_sample_type, + const char *clockid, uint32_t available_size) +{ + /* + * Currently, strace supports version 5 of the structure, which is + * 112 bytes in size. + */ + enum { + STRACE_PEA_ABBREV_SIZE = + offsetof(struct perf_event_attr, config) + + sizeof(attr_ptr->config), + STRACE_PEA_SIZE = 112, + }; + + uint32_t read_size; + struct perf_event_attr *attr; +# if VERBOSE + uint32_t cutoff; + uint64_t val; + uint64_t use_clockid; + union { + struct pea_flags flags; + uint64_t raw; + } flags_data; +# endif + + read_size = +# if !VERBOSE + STRACE_PEA_ABBREV_SIZE; +# else + size < STRACE_PEA_SIZE ? + (size ? size : PERF_ATTR_SIZE_VER0) : STRACE_PEA_SIZE; +# endif + + if (read_size > available_size) { + printf("%s", printaddr(attr_ptr)); + return; + } + + /* + * Replicate kernel's behaviour regarding copying structure from + * userspace. + */ + attr = calloc(1, STRACE_PEA_SIZE); + + if (!attr) + error_msg_and_fail("calloc"); + + + memcpy(attr, attr_ptr, read_size); + + if (size && (size < PERF_ATTR_SIZE_VER0)) { + printf("%s", printaddr(attr_ptr)); + free(attr); + return; + } + + printf("{type=%s, size=", type); + if (size != attr->size) { + printxval(perf_attr_size, size, "PERF_ATTR_SIZE_???"); + printf(" => "); + } + printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???"); + printf(", config=%s, ", config); + + if (!size) + size = PERF_ATTR_SIZE_VER0; + +# if !VERBOSE + printf("...}"); +# else /* !VERBOSE */ + printf("%s=%" PRI__u64", sample_type=%s, read_format=%s", + attr->freq ? "sample_freq" : "sample_period", + attr->freq ? attr->sample_freq : attr->sample_period, + sample_type, read_format); + + printf(", disabled=%u" + ", inherit=%u" + ", pinned=%u" + ", exclusive=%u" + ", exclusive_user=%u" + ", exclude_kernel=%u" + ", exclude_hv=%u" + ", exclude_idle=%u" + ", mmap=%u" + ", comm=%u" + ", freq=%u" + ", inherit_stat=%u" + ", enable_on_exec=%u" + ", task=%u" + ", watermark=%u", + attr->disabled, + attr->inherit, + attr->pinned, + attr->exclusive, + attr->exclude_user, + attr->exclude_kernel, + attr->exclude_hv, + attr->exclude_idle, + attr->mmap, + attr->comm, + attr->freq, + attr->inherit_stat, + attr->enable_on_exec, + attr->task, + attr->watermark); + + flags_data.raw = ((uint64_t *) attr)[5]; + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP + attr->precise_ip; +# else + flags_data.flags.precise_ip; +# endif + printf(", precise_ip=%" PRIu64 " /* %s */", val, precise_ip_desc); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA + attr->mmap_data; +# else + flags_data.flags.mmap_data; +# endif + printf(", mmap_data=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL + attr->sample_id_all; +# else + flags_data.flags.sample_id_all; +# endif + printf(", sample_id_all=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST + attr->exclude_host; +# else + flags_data.flags.exclude_host; +# endif + printf(", exclude_host=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST + attr->exclude_guest; +# else + flags_data.flags.exclude_guest; +# endif + printf(", exclude_guest=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL + attr->exclude_callchain_kernel; +# else + flags_data.flags.exclude_callchain_kernel; +# endif + printf(", exclude_callchain_kernel=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER + attr->exclude_callchain_user; +# else + flags_data.flags.exclude_callchain_user; +# endif + printf(", exclude_callchain_user=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 + attr->mmap2; +# else + flags_data.flags.mmap2; +# endif + printf(", mmap2=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC + attr->comm_exec; +# else + flags_data.flags.comm_exec; +# endif + printf(", comm_exec=%" PRIu64, val); + + use_clockid = val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID + attr->use_clockid; +# else + flags_data.flags.use_clockid; +# endif + printf(", use_clockid=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH + attr->context_switch; +# else + flags_data.flags.context_switch; +# endif + printf(", context_switch=%" PRIu64, val); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD + attr->write_backward; +# else + flags_data.flags.write_backward; +# endif + printf(", write_backward=%" PRIu64, val); + + val = flags_data.flags.__reserved_1; + if (val) + printf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", val); + + printf(", %s=%u", + attr->watermark ? "wakeup_watermark" : "wakeup_events", + attr->watermark ? attr->wakeup_watermark : attr->wakeup_events); + + if (attr->type == PERF_TYPE_BREAKPOINT) + printf(", bp_type=%s", bp_type); + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 + attr->config1; +# else + ((uint64_t *) attr)[56 / sizeof(uint64_t)]; +# endif + printf(", %s=%#" PRIx64, + attr->type == PERF_TYPE_BREAKPOINT ? "bp_addr" : "config1", + val); + + /* End of version 0 of the structure */ + if (size <= 64) { + cutoff = 64; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 + attr->config2; +# else + ((uint64_t *) attr)[64 / sizeof(uint64_t)]; +# endif + if (attr->type == PERF_TYPE_BREAKPOINT) + printf(", bp_len=%" PRIu64, val); + else + printf(", config2=%#" PRIx64, val); + + /* End of version 1 of the structure */ + if (size <= 72) { + cutoff = 72; + goto end; + } + + /* + * Print branch sample type only in case PERF_SAMPLE_BRANCH_STACK + * is set in the sample_type field. + */ + if (attr->sample_type & (1 << 11)) + printf(", branch_sample_type=%s", branch_sample_type); + + /* End of version 2 of the structure */ + if (size <= 80) { + cutoff = 80; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER + attr->sample_regs_user; +# else + ((uint64_t *) attr)[80 / sizeof(uint64_t)]; +# endif + printf(", sample_regs_user=%#" PRIx64, val); + + if (size <= 88) { + cutoff = 88; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER + attr->sample_stack_user; +# else + ((uint32_t *) attr)[88 / sizeof(uint32_t)]; +# endif + /* + * Print branch sample type only in case PERF_SAMPLE_STACK_USER + * is set in the sample_type field. + */ + if (attr->sample_type & (1 << 13)) + printf(", sample_stack_user=%#" PRIx32, (uint32_t) val); + + if (size <= 92) { + cutoff = 92; + goto end; + } + + if (use_clockid) + printf(", clockid=%s", clockid); + + /* End of version 3 of the structure */ + if (size <= 96) { + cutoff = 96; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR + attr->sample_regs_intr; +# else + ((uint64_t *) attr)[96 / sizeof(uint64_t)]; +# endif + printf(", sample_regs_intr=%#" PRIx64, val); + + /* End of version 4 of the structure */ + if (size <= 104) { + cutoff =104; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK + attr->aux_watermark; +# else + ((uint32_t *) attr)[104 / sizeof(uint32_t)]; +# endif + printf(", aux_watermark=%" PRIu32, (uint32_t) val); + + if (size <= 108) { + cutoff =108; + goto end; + } + + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK + attr->sample_max_stack; +# else + ((uint16_t *) attr)[108 / sizeof(uint16_t)]; +# endif + printf(", sample_max_stack=%" PRIu16, (uint16_t) val); + + if (size <= 110) { + cutoff =110; + goto end; + } + + cutoff = STRACE_PEA_SIZE; + +end: + if (size > cutoff) + printf(", ..."); + + printf("}"); +# endif /* !VERBOSE */ + + free(attr); +} + +/* These require aligned access, so no byte-grain checks possible */ +# if defined SPARC || defined SPARC64 || defined POWERPC || defined POWERPC64 +# define ATTR_REC(sz) { tail_alloc((sz + 7) & ~7), sz } +# else +# define ATTR_REC(sz) { tail_alloc(sz), sz } +# endif + +# define BRANCH_TYPE_ALL \ + "PERF_SAMPLE_BRANCH_USER|" \ + "PERF_SAMPLE_BRANCH_KERNEL|" \ + "PERF_SAMPLE_BRANCH_HV|" \ + "PERF_SAMPLE_BRANCH_ANY|" \ + "PERF_SAMPLE_BRANCH_ANY_CALL|" \ + "PERF_SAMPLE_BRANCH_ANY_RETURN|" \ + "PERF_SAMPLE_BRANCH_IND_CALL|" \ + "PERF_SAMPLE_BRANCH_ABORT_TX|" \ + "PERF_SAMPLE_BRANCH_IN_TX|" \ + "PERF_SAMPLE_BRANCH_NO_TX|" \ + "PERF_SAMPLE_BRANCH_COND|" \ + "PERF_SAMPLE_BRANCH_CALL_STACK|" \ + "PERF_SAMPLE_BRANCH_IND_JUMP|" \ + "PERF_SAMPLE_BRANCH_CALL|" \ + "PERF_SAMPLE_BRANCH_NO_FLAGS|" \ + "PERF_SAMPLE_BRANCH_NO_CYCLES" + +int +main(void) +{ + static const size_t attr_small_size = PERF_ATTR_SIZE_VER0 - 8; + static const size_t attr_v0_size = PERF_ATTR_SIZE_VER0; + static const size_t attr_v1_size = PERF_ATTR_SIZE_VER1; + static const size_t attr_v2_size = PERF_ATTR_SIZE_VER2; + static const size_t attr_v2_5_size = PERF_ATTR_SIZE_VER2 + 8; + static const size_t attr_v2_75_size = PERF_ATTR_SIZE_VER2 + 12; + static const size_t attr_v3_size = PERF_ATTR_SIZE_VER3; + static const size_t attr_v4_size = PERF_ATTR_SIZE_VER4; + static const size_t attr_v4_5_size = PERF_ATTR_SIZE_VER4 + 4; + static const size_t attr_v4_625_size = PERF_ATTR_SIZE_VER4 + 5; + static const size_t attr_v4_875_size = PERF_ATTR_SIZE_VER4 + 7; + static const size_t attr_v5_size = PERF_ATTR_SIZE_VER5; + static const size_t attr_big_size = PERF_ATTR_SIZE_VER5 + 32; + + static const struct u64_val_str attr_types[] = { + { ARG_STR(PERF_TYPE_HARDWARE) }, + { ARG_STR(PERF_TYPE_SOFTWARE) }, + { ARG_STR(PERF_TYPE_TRACEPOINT) }, + { ARG_STR(PERF_TYPE_HW_CACHE) }, + { ARG_STR(PERF_TYPE_RAW) }, + { ARG_STR(PERF_TYPE_BREAKPOINT) }, + { ARG_STR(0x6) " /* PERF_TYPE_??? */" }, + { ARG_STR(0xdeadc0de) " /* PERF_TYPE_??? */" }, + }; + static const struct u64_val_str + attr_configs[ARRAY_SIZE(attr_types)][3] = { + /* PERF_TYPE_HARDWARE */ { + { 9, "PERF_COUNT_HW_REF_CPU_CYCLES" }, + { 10, "0xa /* PERF_COUNT_HW_??? */" }, + { ARG_ULL_STR(0xfaceca75deadb0d4) + " /* PERF_COUNT_HW_??? */" }, + }, + /* PERF_TYPE_SOFTWARE */ { + { 10, "PERF_COUNT_SW_BPF_OUTPUT" }, + { 11, "0xb /* PERF_COUNT_SW_??? */" }, + { ARG_ULL_STR(0xdec0ded1dec0ded2) + " /* PERF_COUNT_SW_??? */" }, + }, + /* PERF_TYPE_TRACEPOINT */ { + { ARG_STR(0) }, + { 4207856245U, "4207856245" }, + { ARG_ULL_STR(16051074073505095380) }, + }, + /* PERF_TYPE_HW_CACHE */ { + { 0, "PERF_COUNT_HW_CACHE_L1D|" + "PERF_COUNT_HW_CACHE_OP_READ<<8|" + "PERF_COUNT_HW_CACHE_RESULT_ACCESS<<16" }, + { 0x020207, "0x7 /* PERF_COUNT_HW_CACHE_??? */|" + "PERF_COUNT_HW_CACHE_OP_PREFETCH<<8|" + "0x2 /* PERF_COUNT_HW_CACHE_RESULT_??? */<<16" }, + { 0xdeadf157ed010306ULL, "PERF_COUNT_HW_CACHE_NODE|" + "0x3 /* PERF_COUNT_HW_CACHE_OP_??? */<<8|" + "PERF_COUNT_HW_CACHE_RESULT_MISS<<16|" + "0xdeadf157ed<<24 " + "/* PERF_COUNT_HW_CACHE_??? */" }, + }, + /* PERF_TYPE_RAW */ { + { ARG_STR(0) }, + { ARG_STR(0xda7a1057) }, + { ARG_ULL_STR(0xdec0ded7dec0ded8) }, + }, + /* PERF_TYPE_BREAKPOINT */ { + { ARG_STR(0) }, + { ARG_STR(0xbadc0ded) }, + { ARG_ULL_STR(0xdec0ded9dec0deda) }, + }, + /* invalid 1 */ { + { ARG_STR(0) }, + { ARG_STR(0xbeeff00d) }, + { ARG_ULL_STR(0xdec0dedbdec0dedc) }, + }, + /* invalid 2 */ { + { ARG_STR(0) }, + { ARG_STR(0xca75dead) }, + { ARG_ULL_STR(0xdec0dedddec0dede) }, + }, + }; + static const struct u64_val_str sample_types[] = { + { ARG_STR(0) }, + { 0x800, "PERF_SAMPLE_BRANCH_STACK" }, + { ARG_ULL_STR(0xdeadc0deda780000) " /* PERF_SAMPLE_??? */" }, + { 0xffffffffffffffffULL, + "PERF_SAMPLE_IP|PERF_SAMPLE_TID|PERF_SAMPLE_TIME|" + "PERF_SAMPLE_ADDR|PERF_SAMPLE_READ|" + "PERF_SAMPLE_CALLCHAIN|PERF_SAMPLE_ID|PERF_SAMPLE_CPU|" + "PERF_SAMPLE_PERIOD|PERF_SAMPLE_STREAM_ID|" + "PERF_SAMPLE_RAW|PERF_SAMPLE_BRANCH_STACK|" + "PERF_SAMPLE_REGS_USER|PERF_SAMPLE_STACK_USER|" + "PERF_SAMPLE_WEIGHT|PERF_SAMPLE_DATA_SRC|" + "PERF_SAMPLE_IDENTIFIER|PERF_SAMPLE_TRANSACTION|" + "PERF_SAMPLE_REGS_INTR|0xfffffffffff80000" }, + }; + static const struct u64_val_str read_formats[] = { + { ARG_STR(0) }, + { ARG_STR(PERF_FORMAT_TOTAL_TIME_ENABLED) }, + { 0xf, "PERF_FORMAT_TOTAL_TIME_ENABLED|" + "PERF_FORMAT_TOTAL_TIME_RUNNING|" + "PERF_FORMAT_ID|PERF_FORMAT_GROUP" }, + { ARG_ULL_STR(0xdeadf157dec0ded0) " /* PERF_FORMAT_??? */" }, + { 0xffffffffffffffffULL, + "PERF_FORMAT_TOTAL_TIME_ENABLED|" + "PERF_FORMAT_TOTAL_TIME_RUNNING|" + "PERF_FORMAT_ID|PERF_FORMAT_GROUP|" + "0xfffffffffffffff0" }, + }; + static const char *precise_ip_descs[] = { + "arbitrary skid", + "constant skid", + "requested to have 0 skid", + "must have 0 skid", + }; + static const struct u32_val_str bp_types[] = { + { 0, "HW_BREAKPOINT_EMPTY" }, + { 1, "HW_BREAKPOINT_R" }, + { 3, "HW_BREAKPOINT_RW" }, + { 5, "0x5 /* HW_BREAKPOINT_INVALID */" }, + { 8, "0x8 /* HW_BREAKPOINT_??? */" }, + { ARG_STR(0xface1e55) " /* HW_BREAKPOINT_??? */" }, + }; + static const struct u64_val_str branch_sample_types[] = { + { ARG_STR(0) }, + { 0x80, "PERF_SAMPLE_BRANCH_ABORT_TX" }, + { 0xffff, BRANCH_TYPE_ALL }, + { ARG_ULL_STR(0xdeadcaffeeed0000) + " /* PERF_SAMPLE_BRANCH_??? */" }, + { 0xffffffffffffffffULL, + BRANCH_TYPE_ALL "|0xffffffffffff0000" } + }; + static const struct s32_val_str clockids[] = { + { 11, "CLOCK_TAI" }, + { ARG_STR(0xc) " /* CLOCK_??? */" }, + { ARG_STR(0xbeeffeed) " /* CLOCK_??? */" }, + }; + + + struct { + struct perf_event_attr *ptr; + size_t size; + } attrs[] = { + ATTR_REC(sizeof(struct perf_event_attr)), + ATTR_REC(attr_v0_size), + ATTR_REC(attr_v1_size), + ATTR_REC(attr_v2_size), + ATTR_REC(attr_v2_5_size), + ATTR_REC(attr_v2_75_size), + ATTR_REC(attr_v3_size), + ATTR_REC(attr_v4_size), + ATTR_REC(attr_v4_5_size), + ATTR_REC(attr_v4_625_size), + ATTR_REC(attr_v4_875_size), + ATTR_REC(attr_v5_size), + ATTR_REC(attr_big_size), + }; + + struct perf_event_attr *small_attr = tail_alloc(sizeof(*small_attr)); + + struct { + struct perf_event_attr *attr; + pid_t pid; + int cpu; + int group_fd; + unsigned long flags; + const char *flags_str; + } args[] = { + { NULL, 0xfacef00d, 0xbadabba7, -1, + (unsigned long) 0xFFFFFFFFFFFFFFFFLLU, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC|" + "0x" LONG_STR_PREFIX "fffffff0" + }, + { small_attr + 1, 0, 0, 0, + 0, "0" }, + { small_attr, -1, -1, 1, + PERF_FLAG_FD_NO_GROUP | PERF_FLAG_FD_OUTPUT | + PERF_FLAG_PID_CGROUP | PERF_FLAG_FD_CLOEXEC, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC" }, + { (struct perf_event_attr *) (uintptr_t) 0xfffffacefffffeedULL, + -100, 100, 0xface1e55, + PERF_FLAG_FD_CLOEXEC, "PERF_FLAG_FD_CLOEXEC" }, + }; + + size_t i; + int rc; + + fill_memory(small_attr, sizeof(*small_attr)); + small_attr->size = attr_small_size; + + for (i = 0; i < ARRAY_SIZE(args); i++) { + rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, + args[i].cpu, args[i].group_fd, args[i].flags); + printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", + printaddr(args[i].attr), args[i].pid, args[i].cpu, + args[i].group_fd, args[i].flags_str, sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(attrs) * ARRAY_SIZE(attr_types) * + ARRAY_SIZE(attr_configs[0]) + 1; i++) { + struct perf_event_attr *attr = attrs[i % ARRAY_SIZE(attrs)].ptr; + uint32_t size = attrs[i % ARRAY_SIZE(attrs)].size; + unsigned char fill_start = 0x80 + i; + size_t type_idx = i % ARRAY_SIZE(attr_types); + size_t config_idx = i % ARRAY_SIZE(attr_configs[0]); + size_t sample_type_idx = i % ARRAY_SIZE(sample_types); + size_t read_format_idx = i % ARRAY_SIZE(read_formats); + size_t bp_type_idx = (i / ARRAY_SIZE(attr_configs[0])) % + ARRAY_SIZE(bp_types); + size_t branch_sample_type_idx = (i / ARRAY_SIZE(sample_types)) % + ARRAY_SIZE(branch_sample_types); + size_t clockid_idx = i % ARRAY_SIZE(clockids); + size_t args_idx = i % ARRAY_SIZE(args); + const char *ip_desc_str; + + fill_memory_ex(attr, size, fill_start, 0xff); + + attr->type = attr_types[type_idx].val; + attr->size = size; + attr->config = attr_configs[type_idx][config_idx].val; + attr->sample_type = sample_types[sample_type_idx].val; + attr->read_format = read_formats[read_format_idx].val; + + if ((i % 11) == 5) + attr->__reserved_1 = 0; + +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_BP_TYPE + attr->bp_type = +# else + ((uint32_t *) attr)[52 / sizeof(uint32_t)] = +# endif + bp_types[bp_type_idx].val; + + if (size >= 80) +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_BRANCH_SAMPLE_TYPE + attr->branch_sample_type = +# else + ((uint64_t *) attr)[72 / sizeof(uint64_t)] = +# endif + branch_sample_types[branch_sample_type_idx].val; + + if (size >= 96) +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CLOCKID + attr->clockid = +# else + ((uint32_t *) attr)[92 / sizeof(uint32_t)] = +# endif + clockids[clockid_idx].val; + +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP + ip_desc_str = precise_ip_descs[attr->precise_ip]; +# else + union { + struct pea_flags flags; + uint64_t raw; + } flags_data = { .raw = ((uint64_t *) attr)[5] }; + + ip_desc_str = precise_ip_descs[flags_data.flags.precise_ip]; +# endif + + if (i == 0) + attr->size = size + 8; + + if (i == 1) + attr->size = 0; + + rc = syscall(__NR_perf_event_open, attr, args[args_idx].pid, + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags); + + printf("perf_event_open("); + print_event_attr(attr, i ? ((i == 1) ? 0 : size) : size + 8, + attr_types[type_idx].str, + attr_configs[type_idx][config_idx].str, + sample_types[sample_type_idx].str, + read_formats[read_format_idx].str, + ip_desc_str, + bp_types[bp_type_idx].str, + branch_sample_types[branch_sample_type_idx].str, + clockids[clockid_idx].str, size); + printf(", %d, %d, %d, %s) = %s\n", args[args_idx].pid, + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags_str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_perf_event_open && HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests/perf_event_open.test b/tests/perf_event_open.test new file mode 100755 index 00000000..499134b4 --- /dev/null +++ b/tests/perf_event_open.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check perf_event_open syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a1 diff --git a/tests/perf_event_open_nonverbose.c b/tests/perf_event_open_nonverbose.c new file mode 100644 index 00000000..45d7c8f2 --- /dev/null +++ b/tests/perf_event_open_nonverbose.c @@ -0,0 +1,113 @@ +/* + * Check decoding of perf_event_open syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined(__NR_perf_event_open) && defined(HAVE_LINUX_PERF_EVENT_H) + +# include +# include +# include + +# include + +# include "xlat.h" +# include "xlat/perf_event_open_flags.h" + +#if ULONG_MAX > UINT_MAX +#define LONG_STR_PREFIX "ffffffff" +#else +#define LONG_STR_PREFIX "" +#endif + +static const char *printaddr(void *ptr) +{ + static char buf[sizeof("0x") + sizeof(void *) * 2]; + + if (ptr == NULL) + return "NULL"; + + snprintf(buf, sizeof(buf), "%#lx", (unsigned long)ptr); + + return buf; +} + +int +main(void) +{ + struct perf_event_attr *attr = tail_alloc(sizeof(*attr)); + + attr->type = PERF_TYPE_HARDWARE; + attr->size = sizeof(*attr); + + struct { + struct perf_event_attr *attr; + pid_t pid; + int cpu; + int group_fd; + unsigned long flags; + const char *flags_str; + } args[] = { + { NULL, 0xfacef00d, 0xbadabba7, -1, + (unsigned long) 0xFFFFFFFFFFFFFFFFLLU, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC|" + "0x" LONG_STR_PREFIX "fffffff0" + }, + { attr + 1, 0, 0, 0, + 0, "0" }, + { attr, -1, -1, 1, + PERF_FLAG_FD_CLOEXEC, "PERF_FLAG_FD_CLOEXEC" }, + { attr - 1, -100, 100, 0xface1e55, + PERF_FLAG_FD_NO_GROUP | PERF_FLAG_FD_OUTPUT | + PERF_FLAG_PID_CGROUP | PERF_FLAG_FD_CLOEXEC, + "PERF_FLAG_FD_NO_GROUP|PERF_FLAG_FD_OUTPUT|" + "PERF_FLAG_PID_CGROUP|PERF_FLAG_FD_CLOEXEC" }, + }; + size_t i; + int rc; + + for (i = 0; i < ARRAY_SIZE(args); i++) { + rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, + args[i].cpu, args[i].group_fd, args[i].flags); + printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", + printaddr(args[i].attr), args[i].pid, args[i].cpu, + args[i].group_fd, args[i].flags_str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_perf_event_open && HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests/perf_event_open_nonverbose.test b/tests/perf_event_open_nonverbose.test new file mode 100755 index 00000000..404827fe --- /dev/null +++ b/tests/perf_event_open_nonverbose.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of perf_event_open syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests/perf_event_open_unabbrev.c b/tests/perf_event_open_unabbrev.c new file mode 100644 index 00000000..c2f260de --- /dev/null +++ b/tests/perf_event_open_unabbrev.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "perf_event_open.c" diff --git a/tests/perf_event_open_unabbrev.test b/tests/perf_event_open_unabbrev.test new file mode 100755 index 00000000..f17fd17e --- /dev/null +++ b/tests/perf_event_open_unabbrev.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check perf_event_open syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests/personality.c b/tests/personality.c new file mode 100644 index 00000000..7a279a14 --- /dev/null +++ b/tests/personality.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +int main(void) +{ + const unsigned int good_type = PER_BSD; + const char *good_type_str = "PER_BSD"; + + const unsigned int bad_type = 0x1f; + const char *bad_type_str = "0x1f /\\* PER_\\?\\?\\? \\*/"; + + const unsigned int good_flags = + SHORT_INODE | WHOLE_SECONDS | STICKY_TIMEOUTS; + const char *good_flags_str = + "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS"; + + const unsigned int bad_flags = 0x10000; + const char *bad_flags_str = "0x10000"; + + const unsigned int saved_pers = personality(0xffffffff); + printf("personality\\(0xffffffff\\) = %#x \\([^)]*\\)\n", saved_pers); + + /* PER_LINUX */ + personality(PER_LINUX); + printf("personality\\(PER_LINUX\\) = %#x \\([^)]*\\)\n", saved_pers); + + personality(0xffffffff); + puts("personality\\(0xffffffff\\) = 0 \\(PER_LINUX\\)"); + + personality(good_flags); + printf("personality\\(PER_LINUX\\|%s\\) = 0 \\(PER_LINUX\\)\n", + good_flags_str); + + personality(bad_flags); + printf("personality\\(PER_LINUX\\|%s\\)" + " = %#x \\(PER_LINUX\\|%s\\)\n", + bad_flags_str, good_flags, good_flags_str); + + personality(good_flags | bad_flags); + printf("personality\\(PER_LINUX\\|%s\\|%s\\)" + " = %#x \\(PER_LINUX\\|%s\\)\n", + good_flags_str, bad_flags_str, bad_flags, bad_flags_str); + + /* another valid type */ + personality(good_type); + printf("personality\\(%s\\) = %#x \\(PER_LINUX\\|%s\\|%s\\)\n", + good_type_str, good_flags | bad_flags, + good_flags_str, bad_flags_str); + + personality(good_type | good_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", + good_type_str, good_flags_str, good_type, good_type_str); + + personality(good_type | bad_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, bad_flags_str, good_type | good_flags, + good_type_str, good_flags_str); + + personality(good_type | good_flags | bad_flags); + printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, good_flags_str, bad_flags_str, + good_type | bad_flags, + good_type_str, bad_flags_str); + + /* invalid type */ + personality(bad_type); + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\|%s\\)\n", + bad_type_str, good_type | good_flags | bad_flags, + good_type_str, good_flags_str, bad_flags_str); + + personality(bad_type | good_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", + bad_type_str, good_flags_str, bad_type, bad_type_str); + + personality(bad_type | bad_flags); + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, bad_flags_str, bad_type | good_flags, + bad_type_str, good_flags_str); + + personality(bad_type | good_flags | bad_flags); + printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, good_flags_str, bad_flags_str, + bad_type | bad_flags, bad_type_str, bad_flags_str); + + personality(saved_pers); + printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\|%s\\)\n", + bad_type | good_flags | bad_flags, + bad_type_str, good_flags_str, bad_flags_str); + + return 0; +} diff --git a/tests/personality.test b/tests/personality.test new file mode 100755 index 00000000..8f8c0adb --- /dev/null +++ b/tests/personality.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check personality syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a20 -epersonality $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests/pipe.c b/tests/pipe.c new file mode 100644 index 00000000..41c7f215 --- /dev/null +++ b/tests/pipe.c @@ -0,0 +1,55 @@ +/* + * Check decoding of pipe syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pipe + +# include +# include +# include + +int +main(void) +{ + (void) close(0); + (void) close(1); + int *const fds = tail_alloc(sizeof(*fds) * 2); + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pipe") + +#endif diff --git a/tests/pipe.expected b/tests/pipe.expected new file mode 100644 index 00000000..2e46336c --- /dev/null +++ b/tests/pipe.expected @@ -0,0 +1,2 @@ +pipe([0, 1]) = 0 ++++ exited with 0 +++ diff --git a/tests/pipe.test b/tests/pipe.test new file mode 100755 index 00000000..0ae414d4 --- /dev/null +++ b/tests/pipe.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check decoding of pipe syscall. +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a13 -epipe $args + +check_prog grep +LC_ALL=C grep -x "pipe(.*" "$LOG" > /dev/null || + skip_ 'test executable does not use pipe syscall' + +match_diff diff --git a/tests/pipe2.c b/tests/pipe2.c new file mode 100644 index 00000000..375ae74f --- /dev/null +++ b/tests/pipe2.c @@ -0,0 +1,71 @@ +/* + * Check decoding of pipe2 syscall. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_pipe2 + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_zero = + (kernel_ulong_t) 0xffffffff00000000ULL; + int *const fds = tail_alloc(sizeof(*fds) * 2); + int *const efault = fds + 1; + long rc; + + rc = syscall(__NR_pipe2, fds, bogus_zero | O_NONBLOCK); + if (rc) + perror_msg_and_skip("pipe2"); + printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]); + + rc = syscall(__NR_pipe2, efault, bogus_zero); + printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(fds); + rc = syscall(__NR_pipe2, ill, 0); + printf("pipe2(%#llx, 0) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pipe2") + +#endif diff --git a/tests/pipe2.test b/tests/pipe2.test new file mode 100755 index 00000000..aff6cd44 --- /dev/null +++ b/tests/pipe2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pipe2 syscall. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a15 diff --git a/tests/pipe_maxfd.c b/tests/pipe_maxfd.c new file mode 100644 index 00000000..a1343f91 --- /dev/null +++ b/tests/pipe_maxfd.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +static void +move_fd(int *from, int *to) +{ + for (; *to > *from; --*to) { + if (dup2(*from, *to) != *to) + continue; + close(*from); + *from = *to; + break; + } +} + +void +pipe_maxfd(int pipefd[2]) +{ + struct rlimit rlim; + if (getrlimit(RLIMIT_NOFILE, &rlim)) + perror_msg_and_fail("getrlimit"); + if (rlim.rlim_cur < rlim.rlim_max) { + struct rlimit rlim_new; + rlim_new.rlim_cur = rlim_new.rlim_max = rlim.rlim_max; + if (!setrlimit(RLIMIT_NOFILE, &rlim_new)) + rlim.rlim_cur = rlim.rlim_max; + } + + if (pipe(pipefd)) + perror_msg_and_fail("pipe"); + + int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < INT_MAX) + ? rlim.rlim_cur - 1 : INT_MAX; + + move_fd(&pipefd[1], &max_fd); + --max_fd; + move_fd(&pipefd[0], &max_fd); +} diff --git a/tests/pkey_alloc.c b/tests/pkey_alloc.c new file mode 100644 index 00000000..45772787 --- /dev/null +++ b/tests/pkey_alloc.c @@ -0,0 +1,84 @@ +/* + * Check decoding of pkey_alloc syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_alloc + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t flags[] = { + 0, + (kernel_ulong_t) 0xbadc0ded00000000ULL, + (kernel_ulong_t) 0xffff0000eeee1111ULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + }; + static const struct { + kernel_ulong_t val; + const char *str; + } rights[] = { + { (kernel_ulong_t) 0xbadc0ded00000002ULL, + sizeof(kernel_ulong_t) > sizeof(int) ? + "PKEY_DISABLE_WRITE|0xbadc0ded00000000" : + "PKEY_DISABLE_WRITE" }, + { 0xdec0ded, "PKEY_DISABLE_ACCESS|0xdec0dec" }, + { 0x3, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE" }, + { ARG_STR(0) }, + { 0xbadc0dec, "0xbadc0dec /* PKEY_??? */" }, + }; + + long rc; + unsigned int i; + unsigned int j; + + for (i = 0; i < ARRAY_SIZE(flags); i++) { + for (j = 0; j < ARRAY_SIZE(rights); j++) { + rc = syscall(__NR_pkey_alloc, flags[i], rights[j].val); + printf("pkey_alloc(%#llx, %s) = %s\n", + (unsigned long long) flags[i], rights[j].str, + sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_alloc"); + +#endif diff --git a/tests/pkey_alloc.test b/tests/pkey_alloc.test new file mode 100755 index 00000000..f168c21a --- /dev/null +++ b/tests/pkey_alloc.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_alloc syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/pkey_free.c b/tests/pkey_free.c new file mode 100644 index 00000000..95a2ad26 --- /dev/null +++ b/tests/pkey_free.c @@ -0,0 +1,67 @@ +/* + * Check decoding of pkey_free syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_free + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t keys[] = { + 0, + 3141592653U, + (kernel_ulong_t) 0xbadc0ded00000000ULL, + (kernel_ulong_t) 0xffff00001111eeeeULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + }; + + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(keys); i++) { + rc = syscall(__NR_pkey_free, keys[i]); + printf("pkey_free(%d) = %s\n", (int) keys[i], sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_free"); + +#endif diff --git a/tests/pkey_free.test b/tests/pkey_free.test new file mode 100755 index 00000000..9c01c3e7 --- /dev/null +++ b/tests/pkey_free.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_free syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests/pkey_mprotect.c b/tests/pkey_mprotect.c new file mode 100644 index 00000000..529abd1f --- /dev/null +++ b/tests/pkey_mprotect.c @@ -0,0 +1,120 @@ +/* + * Check decoding of pkey_mprotect syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_pkey_mprotect + +# include +# include +# include + +const char * +sprintptr(kernel_ulong_t ptr) +{ + static char buf[sizeof(ptr) * 2 + sizeof("0x")]; + + if (ptr) + snprintf(buf, sizeof(buf), "%#llx", (unsigned long long) ptr); + else + return "NULL"; + + return buf; +} + +int +main(void) +{ + static const kernel_ulong_t ptrs[] = { + 0, + (kernel_ulong_t) 0xfacebeef00000000ULL, + (kernel_ulong_t) 0xbadc0dedda7a1057ULL, + }; + static const kernel_ulong_t sizes[] = { + 0, + (kernel_ulong_t) 0xfacebeef00000000ULL, + (kernel_ulong_t) 0xfedcba9876543210ULL, + (kernel_ulong_t) 0x123456789abcdef0ULL, + (kernel_ulong_t) 0xbadc0dedda7a1057ULL, + }; + static const struct { + kernel_ulong_t val; + const char *str; + } prots[] = { + { ARG_STR(PROT_READ) }, + /* For now, only 0x0300001f are used */ + { (kernel_ulong_t) 0xdeadfeed00ca7500ULL, + sizeof(kernel_ulong_t) > sizeof(int) ? + "0xdeadfeed00ca7500 /* PROT_??? */" : + "0xca7500 /* PROT_??? */" }, + { ARG_STR(PROT_READ|PROT_WRITE|0xface00) }, + }; + static const kernel_ulong_t pkeys[] = { + 0, + -1LL, + (kernel_ulong_t) 0xface1e55, + (kernel_ulong_t) 0xbadc0ded00000001, + }; + + long rc; + unsigned int i; + unsigned int j; + unsigned int k; + unsigned int l; + + for (i = 0; i < ARRAY_SIZE(ptrs); i++) { + for (j = 0; j < ARRAY_SIZE(sizes); j++) { + for (k = 0; k < ARRAY_SIZE(prots); k++) { + for (l = 0; l < ARRAY_SIZE(pkeys); l++) { + rc = syscall(__NR_pkey_mprotect, + ptrs[i], sizes[j], + prots[k].val, pkeys[l]); + printf("pkey_mprotect(%s, %llu, %s, %d)" + " = %s\n", + sprintptr(ptrs[i]), + (unsigned long long) sizes[j], + prots[k].str, (int) pkeys[l], + sprintrc(rc)); + } + } + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pkey_mprotect"); + +#endif diff --git a/tests/pkey_mprotect.test b/tests/pkey_mprotect.test new file mode 100755 index 00000000..922d4919 --- /dev/null +++ b/tests/pkey_mprotect.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of pkey_mprotect syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests/poll.c b/tests/poll.c new file mode 100644 index 00000000..c47c97e5 --- /dev/null +++ b/tests/poll.c @@ -0,0 +1,259 @@ +/* + * This file is part of poll strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_poll + +# include +# include +# include +# include +# include +# include + +#define PRINT_EVENT(flag, member) \ + if (member & flag) { \ + if (member != pfd->member) \ + tprintf("|"); \ + tprintf(#flag); \ + member &= ~flag; \ + } + +static void +print_pollfd_entering(const struct pollfd *const pfd) +{ + tprintf("{fd=%d", pfd->fd); + if (pfd->fd >= 0) { + tprintf(", events="); + short events = pfd->events; + + if (pfd->events) { + PRINT_EVENT(POLLIN, events) + PRINT_EVENT(POLLPRI, events) + PRINT_EVENT(POLLOUT, events) +#ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, events) +#endif +#ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, events) +#endif +#ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, events) +#endif +#ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, events) +#endif + PRINT_EVENT(POLLERR, events) + PRINT_EVENT(POLLHUP, events) + PRINT_EVENT(POLLNVAL, events) + } else + tprintf("0"); + } + tprintf("}"); +} + +static void +print_pollfd_array_entering(const struct pollfd *const pfd, + const unsigned int size, + const unsigned int valid, + const unsigned int abbrev) +{ + tprintf("["); + unsigned int i; + for (i = 0; i < size; ++i) { + if (i) + tprintf(", "); + if (i >= valid) { + tprintf("%p", &pfd[i]); + break; + } + if (i >= abbrev) { + tprintf("..."); + break; + } + print_pollfd_entering(&pfd[i]); + } + tprintf("]"); +} + +static void +print_pollfd_exiting(const struct pollfd *const pfd, + unsigned int *const seen, + const unsigned int abbrev) +{ + if (!pfd->revents || pfd->fd < 0 || *seen > abbrev) + return; + + if (*seen) + tprintf(", "); + ++(*seen); + + if (*seen > abbrev) { + tprintf("..."); + return; + } + tprintf("{fd=%d, revents=", pfd->fd); + short revents = pfd->revents; + + PRINT_EVENT(POLLIN, revents) + PRINT_EVENT(POLLPRI, revents) + PRINT_EVENT(POLLOUT, revents) +#ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, revents) +#endif +#ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, revents) +#endif +#ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, revents) +#endif +#ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, revents) +#endif + PRINT_EVENT(POLLERR, revents) + PRINT_EVENT(POLLHUP, revents) + PRINT_EVENT(POLLNVAL, revents) + tprintf("}"); +} + +static void +print_pollfd_array_exiting(const struct pollfd *const pfd, + const unsigned int size, + const unsigned int abbrev) +{ + tprintf("["); + unsigned int seen = 0; + unsigned int i; + for (i = 0; i < size; ++i) + print_pollfd_exiting(&pfd[i], &seen, abbrev); + tprintf("]"); +} + +int +main(int ac, char **av) +{ + tprintf("%s", ""); + + assert(syscall(__NR_poll, NULL, 42, 0) == -1); + if (ENOSYS == errno) + perror_msg_and_skip("poll"); + tprintf("poll(NULL, 42, 0) = -1 EFAULT (%m)\n"); + + int fds[2]; + if (pipe(fds) || pipe(fds)) + perror_msg_and_fail("pipe"); + + const unsigned int abbrev = (ac > 1) ? atoi(av[1]) : -1; + const struct pollfd pfds0[] = { + { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = fds[0], .events = POLLIN | POLLPRI }, + { .fd = fds[1], .events = POLLOUT }, + { .fd = 2, .events = POLLOUT | POLLWRBAND } + }; + struct pollfd *const tail_fds0 = tail_memdup(pfds0, sizeof(pfds0)); + const int timeout = 42; + int rc = syscall(__NR_poll, tail_fds0, 0, timeout); + assert(rc == 0); + + tprintf("poll([], 0, %d) = %d (Timeout)\n", timeout, rc); + + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 3); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + tail_fds0[0].fd = -1; + tail_fds0[2].fd = -3; + tail_fds0[4].events = 0; + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 2); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + tail_fds0[1].fd = -2; + tail_fds0[4].fd = -5; + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 1); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + struct pollfd pfds1[] = { + { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } + }; + struct pollfd *const tail_fds1 = tail_memdup(pfds1, sizeof(pfds1)); + rc = syscall(__NR_poll, tail_fds1, ARRAY_SIZE(pfds1), timeout); + assert(rc == 0); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds1, ARRAY_SIZE(pfds1), + ARRAY_SIZE(pfds1), abbrev); + tprintf(", %u, %d) = %d (Timeout)\n", ARRAY_SIZE(pfds1), timeout, rc); + + const void *const efault = tail_fds0 + ARRAY_SIZE(pfds0); + rc = syscall(__NR_poll, efault, 1, 0); + assert(rc == -1); + tprintf("poll(%p, 1, 0) = -1 EFAULT (%m)\n", efault); + + const unsigned int valid = 1; + const void *const epfds = tail_fds0 + ARRAY_SIZE(pfds0) - valid; + rc = syscall(__NR_poll, epfds, valid + 1, 0); + assert(rc == -1); + tprintf("poll("); + print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); + errno = EFAULT; + tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_poll") + +#endif diff --git a/tests/poll.test b/tests/poll.test new file mode 100755 index 00000000..b74be29e --- /dev/null +++ b/tests/poll.test @@ -0,0 +1,17 @@ +#!/bin/sh + +# Check poll syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -vepoll $args > "$OUT" +match_diff "$LOG" "$OUT" + +for abbrev in 0 1 2 3 4 5; do + run_prog "./$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev $args > "$OUT" + match_diff "$LOG" "$OUT" +done + +rm -f "$OUT" diff --git a/tests/ppoll-v.expected b/tests/ppoll-v.expected new file mode 100644 index 00000000..31070ad1 --- /dev/null +++ b/tests/ppoll-v.expected @@ -0,0 +1,3 @@ +ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \{fd=3, events=POLLIN\|POLLPRI\}, \{fd=4, events=POLLOUT\}\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) +ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) +ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests/ppoll.c b/tests/ppoll.c new file mode 100644 index 00000000..46d7e816 --- /dev/null +++ b/tests/ppoll.c @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +static void +test1(void) +{ + const struct timespec timeout = { .tv_sec = 42, .tv_nsec = 999999999 }; + struct pollfd fds[] = { + { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = 3, .events = POLLIN | POLLPRI }, + { .fd = 4, .events = POLLOUT } + }; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGCHLD); + + int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); + if (rc < 0) + perror_msg_and_skip("ppoll"); + assert(rc == 2); +} + +static void +test2(void) +{ + const struct timespec timeout = { .tv_sec = 0, .tv_nsec = 999 }; + struct pollfd fds[] = { + { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } + }; + + sigset_t mask; + sigfillset(&mask); + sigdelset(&mask, SIGHUP); + sigdelset(&mask, SIGKILL); + sigdelset(&mask, SIGSTOP); + + int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); + if (rc < 0) + perror_msg_and_skip("ppoll"); + assert(rc == 0); +} + +int +main(void) +{ + int fds[2]; + + (void) close(0); + (void) close(1); + (void) close(3); + (void) close(4); + if (pipe(fds) || pipe(fds)) + perror_msg_and_fail("pipe"); + + test1(); + test2(); + + assert(ppoll(NULL, 42, NULL, NULL) < 0); + return 0; +} diff --git a/tests/ppoll.expected b/tests/ppoll.expected new file mode 100644 index 00000000..c38a2062 --- /dev/null +++ b/tests/ppoll.expected @@ -0,0 +1,3 @@ +ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \.\.\.\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) +ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) +ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests/ppoll.test b/tests/ppoll.test new file mode 100755 index 00000000..98389ee6 --- /dev/null +++ b/tests/ppoll.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check ppoll syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -a30 -s2 -e ppoll $args +match_grep +run_strace -a30 -v -s2 -e ppoll $args +match_grep "$LOG" "$srcdir/$NAME-v.expected" + +exit 0 diff --git a/tests/prctl-arg2-intptr.c b/tests/prctl-arg2-intptr.c new file mode 100644 index 00000000..ee000ebe --- /dev/null +++ b/tests/prctl-arg2-intptr.c @@ -0,0 +1,120 @@ +/* + * Check decoding of prctl operations which use arg2 as pointer to an integer + * value: PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, and PR_GET_FPEXC. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_prctl + +# include +# include +# include +# include + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_addr1 = + (kernel_ulong_t) 0x1e55c0de00000000ULL; + static const kernel_ulong_t bogus_addr2 = + (kernel_ulong_t) 0xfffffffffffffffdULL; + static const kernel_ulong_t bogus_op_bits = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const struct { + kernel_ulong_t val; + const char *str; + } options[] = { + { 37, "PR_GET_CHILD_SUBREAPER" }, + { 19, "PR_GET_ENDIAN" }, + { 9, "PR_GET_FPEMU" }, + { 11, "PR_GET_FPEXC" }, + }; + + unsigned int *ptr = tail_alloc(sizeof(*ptr)); + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(options); ++i) { + prctl(options[i].val | bogus_op_bits, 0); + printf("prctl(%s, NULL) = %s\n", options[i].str, errstr); + + if (bogus_addr1) { + prctl(options[i].val | bogus_op_bits, bogus_addr1); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr1, errstr); + } + + prctl(options[i].val | bogus_op_bits, bogus_addr2); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr2, errstr); + + prctl(options[i].val | bogus_op_bits, (uintptr_t) (ptr + 1)); + printf("prctl(%s, %p) = %s\n", options[i].str, + ptr + 1, errstr); + + rc = prctl(options[i].val | bogus_op_bits, (uintptr_t) ptr); + if (!rc) { + printf("prctl(%s, [%u]) = %s\n", + options[i].str, *ptr, errstr); + } else { + printf("prctl(%s, %p) = %s\n", + options[i].str, ptr, errstr); + } + + if (F8ILL_KULONG_SUPPORTED) { + kernel_ulong_t bogus_addr3 = f8ill_ptr_to_kulong(ptr); + prctl(options[i].val | bogus_op_bits, bogus_addr3); + printf("prctl(%s, %#llx) = %s\n", options[i].str, + (unsigned long long) bogus_addr3, errstr); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests/prctl-arg2-intptr.test b/tests/prctl-arg2-intptr.test new file mode 100755 index 00000000..bcef8065 --- /dev/null +++ b/tests/prctl-arg2-intptr.test @@ -0,0 +1,14 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, +# and PR_GET_FPEXC operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a25 -eprctl $args > "$EXP" +LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^CEF]|.[^HNP]|..[^DEI])' \ + < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-dumpable.c b/tests/prctl-dumpable.c new file mode 100644 index 00000000..1049bcee --- /dev/null +++ b/tests/prctl-dumpable.c @@ -0,0 +1,106 @@ +/* + * Check decoding of prctl PR_GET_DUMPABLE/PR_SET_DUMPABLE operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE + +# include +# include + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_dumpable1 = + (kernel_ulong_t) 0xdeadc0de00000001ULL; + static const kernel_ulong_t bogus_dumpable2 = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + + static const char * const args[] = { + "SUID_DUMP_DISABLE", + "SUID_DUMP_USER", + "SUID_DUMP_ROOT", + }; + + unsigned int i; + + prctl(PR_SET_DUMPABLE, 3); + printf("prctl(PR_SET_DUMPABLE, 0x3 /* SUID_DUMP_??? */) = %s\n", + errstr); + + prctl(PR_SET_DUMPABLE, bogus_dumpable1); + if (bogus_dumpable1 == 1) { + printf("prctl(PR_SET_DUMPABLE, SUID_DUMP_USER) = %s\n", errstr); + } else { + printf("prctl(PR_SET_DUMPABLE, %#llx /* SUID_DUMP_??? */)" + " = %s\n", + (unsigned long long) bogus_dumpable1, errstr); + } + + prctl(PR_SET_DUMPABLE, bogus_dumpable2); + printf("prctl(PR_SET_DUMPABLE, %#llx /* SUID_DUMP_??? */) = %s\n", + (unsigned long long) bogus_dumpable2, errstr); + + for (i = 0; i < ARRAY_SIZE(args); ++i) { + prctl(PR_SET_DUMPABLE, i); + printf("prctl(PR_SET_DUMPABLE, %s) = %s\n", args[i], errstr); + + long rc = prctl(PR_GET_DUMPABLE, bogus_dumpable2); + if (rc >= 0 && rc < (long) ARRAY_SIZE(args)) { + printf("prctl(PR_GET_DUMPABLE) = %s (%s)\n", + errstr, args[rc]); + } else { + printf("prctl(PR_GET_DUMPABLE) = %s\n", errstr); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE") + +#endif diff --git a/tests/prctl-dumpable.test b/tests/prctl-dumpable.test new file mode 100755 index 00000000..08acb8b9 --- /dev/null +++ b/tests/prctl-dumpable.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_DUMPABLE and PR_SET_DUMPABLE operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^D][^U]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-name.c b/tests/prctl-name.c new file mode 100644 index 00000000..308c275f --- /dev/null +++ b/tests/prctl-name.c @@ -0,0 +1,103 @@ +/* + * Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_GET_NAME && defined PR_SET_NAME + +# include +# include +# include + +int +main(void) +{ + static const char str[] = "0123456789abcdef"; + static const int len = sizeof(str) - 1; + char *name = tail_memdup(str, sizeof(str)); + int i; + int rc; + + rc = prctl(PR_SET_NAME, NULL); + printf("prctl(PR_SET_NAME, NULL) = %s\n", sprintrc(rc)); + + for (i = 0; i <= len; ++i) { + rc = prctl(PR_SET_NAME, name + len - i); + printf("prctl(PR_SET_NAME, \"%.*s\"%s) = %s\n", + i < len - 1 ? i : len - 1, + str + len - i, + i < len - 1 ? "" : "...", + sprintrc(rc)); + } + + *name = -1; + ++name; + memcpy(name, str, len); + + for (i = 0; i <= len; ++i) { + rc = prctl(PR_SET_NAME, name + len - i); + if (i < len - 1) + printf("prctl(PR_SET_NAME, %p) = %s\n", + name + len - i, sprintrc(rc)); + else + printf("prctl(PR_SET_NAME, \"%.*s\"...) = %s\n", + len - 1, str + len - i, sprintrc(rc)); + } + + rc = prctl(PR_GET_NAME, NULL); + printf("prctl(PR_GET_NAME, NULL) = %s\n", sprintrc(rc)); + + for (i = 0; i < len; ++i) { + rc = prctl(PR_GET_NAME, name + len - i); + printf("prctl(PR_GET_NAME, %p) = %s\n", + name + len - i, sprintrc(rc)); + } + + rc = prctl(PR_GET_NAME, name); + if (rc) + printf("prctl(PR_GET_NAME, %p) = %s\n", + name, sprintrc(rc)); + else + printf("prctl(PR_GET_NAME, \"%.*s\") = %s\n", + len - 1, name, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_GET_NAME && PR_SET_NAME") + +#endif diff --git a/tests/prctl-name.test b/tests/prctl-name.test new file mode 100755 index 00000000..071179c5 --- /dev/null +++ b/tests/prctl-name.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +grep -v '^prctl(PR_GET_[^N][^A]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-no-args.c b/tests/prctl-no-args.c new file mode 100644 index 00000000..57e1b733 --- /dev/null +++ b/tests/prctl-no-args.c @@ -0,0 +1,77 @@ +/* + * Check decoding of prctl operations without arguments and return code parsing: + * PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, PR_GET_TIMING, + * PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_prctl + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_op_bits = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xfacefeeddeadbeefULL; + static const struct { + kernel_ulong_t val; + const char *str; + } options[] = { + { 7, "PR_GET_KEEPCAPS" }, + { 13, "PR_GET_TIMING" }, + { 21, "PR_GET_SECCOMP" }, + { 30, "PR_GET_TIMERSLACK" }, + { 31, "PR_TASK_PERF_EVENTS_DISABLE" }, + { 32, "PR_TASK_PERF_EVENTS_ENABLE" }, + }; + + unsigned int *ptr = tail_alloc(sizeof(*ptr)); + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(options); i++) { + long rc = syscall(__NR_prctl, options[i].val | bogus_op_bits, + bogus_arg); + printf("prctl(%s) = %s\n", options[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests/prctl-no-args.test b/tests/prctl-no-args.test new file mode 100755 index 00000000..ce8ca67b --- /dev/null +++ b/tests/prctl-no-args.test @@ -0,0 +1,14 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, +# PR_GET_TIMING, PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE +# operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a21 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^KST][^EI][^CEM]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-pdeathsig.c b/tests/prctl-pdeathsig.c new file mode 100644 index 00000000..c1760307 --- /dev/null +++ b/tests/prctl-pdeathsig.c @@ -0,0 +1,81 @@ +/* + * Check decoding of prctl PR_GET_PDEATHSIG/PR_SET_PDEATHSIG operations. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_PDEATHSIG && defined PR_SET_PDEATHSIG + +# include +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_signal = + (kernel_ulong_t) 0xbadc0deddeadfeedULL; + + int *pdeathsig = tail_alloc(sizeof(*pdeathsig)); + long rc; + + rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, bogus_signal); + printf("prctl(PR_SET_PDEATHSIG, %llu) = %s\n", + (unsigned long long) bogus_signal, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, SIGINT); + printf("prctl(PR_SET_PDEATHSIG, SIGINT) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, NULL); + printf("prctl(PR_GET_PDEATHSIG, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, pdeathsig + 1); + printf("prctl(PR_GET_PDEATHSIG, %p) = %s\n", + pdeathsig + 1, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_PDEATHSIG, pdeathsig); + if (rc) { + printf("prctl(PR_GET_PDEATHSIG, %p) = %s\n", + pdeathsig, sprintrc(rc)); + } else { + printf("prctl(PR_GET_PDEATHSIG, [SIGINT]) = %s\n", + sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_PDEATHSIG && PR_SET_PDEATHSIG") + +#endif diff --git a/tests/prctl-pdeathsig.test b/tests/prctl-pdeathsig.test new file mode 100755 index 00000000..2777503a --- /dev/null +++ b/tests/prctl-pdeathsig.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check prctl PR_GET_PDEATHSIG PR_SET_PDEATHSIG decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a30 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^P][^D]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-seccomp-filter-v.c b/tests/prctl-seccomp-filter-v.c new file mode 100644 index 00000000..69316fbe --- /dev/null +++ b/tests/prctl-seccomp-filter-v.c @@ -0,0 +1,145 @@ +/* + * Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef HAVE_PRCTL +# include +#endif +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined HAVE_PRCTL \ + && defined PR_SET_NO_NEW_PRIVS \ + && defined PR_SET_SECCOMP \ + && defined SECCOMP_MODE_FILTER \ + && defined SECCOMP_RET_ERRNO \ + && defined BPF_JUMP \ + && defined BPF_STMT + +#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) + +#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) + +#define SOCK_FILTER_KILL_PROCESS \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) + +#define PRINT_ALLOW_SYSCALL(nr) \ + printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ + __NR_ ## nr) + +#define PRINT_DENY_SYSCALL(nr, err) \ + printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ + __NR_ ## nr, err) + +static const struct sock_filter filter[] = { + /* load syscall number */ + BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), + + /* allow syscalls */ + SOCK_FILTER_ALLOW_SYSCALL(close), + SOCK_FILTER_ALLOW_SYSCALL(exit), + SOCK_FILTER_ALLOW_SYSCALL(exit_group), + + /* deny syscalls */ + SOCK_FILTER_DENY_SYSCALL(sync, EBUSY), + SOCK_FILTER_DENY_SYSCALL(setsid, EPERM), + + /* kill process */ + SOCK_FILTER_KILL_PROCESS +}; + +static const struct sock_fprog prog = { + .len = ARRAY_SIZE(filter), + .filter = (struct sock_filter *) filter, +}; + +int +main(void) +{ + int fds[2]; + + puts("prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) = 0"); + + printf("prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, {len=%u, filter=[", + prog.len); + + printf("BPF_STMT(BPF_LD|BPF_W|BPF_ABS, %#x), ", + (unsigned) offsetof(struct seccomp_data, nr)); + + PRINT_ALLOW_SYSCALL(close); + PRINT_ALLOW_SYSCALL(exit); + PRINT_ALLOW_SYSCALL(exit_group); + + PRINT_DENY_SYSCALL(sync, EBUSY), + PRINT_DENY_SYSCALL(setsid, EPERM), + + printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"); + + puts("]}) = 0"); + puts("+++ exited with 0 +++"); + + fflush(stdout); + close(0); + close(1); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + perror_msg_and_skip("PR_SET_NO_NEW_PRIVS"); + if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) + perror_msg_and_skip("PR_SET_SECCOMP"); + if (close(0) || close(1)) + _exit(77); + + _exit(0); +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_NO_NEW_PRIVS && PR_SET_SECCOMP" + " && SECCOMP_MODE_FILTER && SECCOMP_RET_ERRNO" + " && BPF_JUMP && BPF_STMT") + +#endif diff --git a/tests/prctl-seccomp-filter-v.test b/tests/prctl-seccomp-filter-v.test new file mode 100755 index 00000000..44e4a782 --- /dev/null +++ b/tests/prctl-seccomp-filter-v.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -v -eprctl $args > "$EXP" +grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-seccomp-strict.c b/tests/prctl-seccomp-strict.c new file mode 100644 index 00000000..a78f8173 --- /dev/null +++ b/tests/prctl-seccomp-strict.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_SECCOMP && defined __NR_exit + +# include +# include + +int +main(void) +{ + static const char text1[] = + "prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT) = 0\n"; + static const char text2[] = "+++ exited with 0 +++\n"; + + int rc = prctl(PR_SET_SECCOMP, -1L, 1, 2, 3); + printf("prctl(PR_SET_SECCOMP, %#lx /* SECCOMP_MODE_??? */, 0x1, 0x2, 0x3)" + " = %d %s (%m)\n", -1L, rc, errno2name()); + fflush(stdout); + + rc = prctl(PR_SET_SECCOMP, 1); + if (rc) { + printf("prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT)" + " = %d %s (%m)\n", rc, errno2name()); + fflush(stdout); + rc = 0; + } else { + /* + * If kernel implementaton of SECCOMP_MODE_STRICT is buggy, + * the following syscall will result to SIGKILL. + */ + rc = write(1, text1, LENGTH_OF(text1)) != LENGTH_OF(text1); + } + + rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2); + return !!syscall(__NR_exit, rc); +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_SECCOMP && __NR_exit") + +#endif diff --git a/tests/prctl-seccomp-strict.test b/tests/prctl-seccomp-strict.test new file mode 100755 index 00000000..1f987df7 --- /dev/null +++ b/tests/prctl-seccomp-strict.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Check how prctl PR_SET_SECCOMP SECCOMP_MODE_STRICT is decoded. + +. "${srcdir=.}/init.sh" + +check_prog grep +set -- "./$NAME" +"$@" > /dev/null || { + case $? in + 77) skip_ "$* exited with code 77" ;; + 137) framework_skip_ "$* killed by SIGKILL, fix your kernel" ;; + *) fail_ "$args failed" ;; + esac +} +run_strace -eprctl "$@" > "$EXP" +grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-securebits.c b/tests/prctl-securebits.c new file mode 100644 index 00000000..741973af --- /dev/null +++ b/tests/prctl-securebits.c @@ -0,0 +1,106 @@ +/* + * Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_SECUREBITS && defined PR_SET_SECUREBITS + +# include +# include + +# include "xlat.h" +# include "xlat/secbits.h" + +static const char *errstr; + +static long +prctl(kernel_ulong_t arg1, kernel_ulong_t arg2) +{ + static const kernel_ulong_t bogus_arg = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + long rc = syscall(__NR_prctl, arg1, arg2, bogus_arg); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bits1 = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + static const kernel_ulong_t bits2 = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + static const kernel_ulong_t bits3 = + (kernel_ulong_t) 0xffULL; + + prctl(PR_SET_SECUREBITS, 0); + printf("prctl(PR_SET_SECUREBITS, 0) = %s\n", errstr); + + prctl(PR_SET_SECUREBITS, bits1); + printf("prctl(PR_SET_SECUREBITS, SECBIT_NOROOT|SECBIT_NOROOT_LOCKED|" + "SECBIT_NO_SETUID_FIXUP|SECBIT_NO_SETUID_FIXUP_LOCKED|" + "SECBIT_KEEP_CAPS_LOCKED|SECBIT_NO_CAP_AMBIENT_RAISE|" + "SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED|%#llx) = %s\n", + (unsigned long long) bits1 & ~0xffULL, errstr); + + if (bits2) { + prctl(PR_SET_SECUREBITS, bits2); + printf("prctl(PR_SET_SECUREBITS, %#llx /* SECBIT_??? */)" + " = %s\n", (unsigned long long) bits2, errstr); + } + + prctl(PR_SET_SECUREBITS, bits3); + printf("prctl(PR_SET_SECUREBITS, SECBIT_NOROOT|SECBIT_NOROOT_LOCKED|" + "SECBIT_NO_SETUID_FIXUP|SECBIT_NO_SETUID_FIXUP_LOCKED|" + "SECBIT_KEEP_CAPS|SECBIT_KEEP_CAPS_LOCKED|" + "SECBIT_NO_CAP_AMBIENT_RAISE|SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED)" + " = %s\n", errstr); + + long rc = prctl(PR_GET_SECUREBITS, bits1); + printf("prctl(PR_GET_SECUREBITS) = %s", errstr); + if (rc > 0) { + printf(" ("); + printflags(secbits, rc, NULL); + printf(")"); + } + + puts(""); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_SECUREBITS && PR_SET_SECUREBITS") + +#endif diff --git a/tests/prctl-securebits.test b/tests/prctl-securebits.test new file mode 100755 index 00000000..c91e62a6 --- /dev/null +++ b/tests/prctl-securebits.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a25 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^S][^E][^C][^U]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-tid_address.c b/tests/prctl-tid_address.c new file mode 100644 index 00000000..24e45031 --- /dev/null +++ b/tests/prctl-tid_address.c @@ -0,0 +1,103 @@ +/* + * Check decoding of prctl PR_GET_TID_ADDRESS operation. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined __NR_set_tid_address && \ + defined PR_GET_TID_ADDRESS + +# include +# include +# include + +static const char * +sprintaddr(kernel_ulong_t addr) +{ + static char buf[sizeof("0x") + sizeof(addr) * 2]; + + if (addr) { + snprintf(buf, sizeof(buf), "%#llx", (unsigned long long) addr); + + return buf; + } + + return "NULL"; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfffffffffffffffdULL; + + /* Note that kernel puts kernel-sized pointer even on x32 */ + kernel_ulong_t *ptr = tail_alloc(sizeof(*ptr)); + long rc; + long set_ok; + + *ptr = (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, NULL); + printf("prctl(PR_GET_TID_ADDRESS, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, bogus_addr); + printf("prctl(PR_GET_TID_ADDRESS, %#llx) = %s\n", + (unsigned long long) bogus_addr, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, ptr); + if (rc) { + printf("prctl(PR_GET_TID_ADDRESS, %p) = %s\n", + ptr, sprintrc(rc)); + } else { + printf("prctl(PR_GET_TID_ADDRESS, [%s]) = %s\n", + sprintaddr(*ptr), sprintrc(rc)); + } + + set_ok = syscall(__NR_set_tid_address, bogus_addr); + + rc = syscall(__NR_prctl, PR_GET_TID_ADDRESS, ptr); + if (rc) { + printf("prctl(PR_GET_TID_ADDRESS, %p) = %s\n", + ptr, sprintrc(rc)); + } else { + printf("prctl(PR_GET_TID_ADDRESS, [%s]) = %s\n", + sprintaddr(set_ok ? bogus_addr : *ptr), sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && __NR_set_tid_address && PR_GET_TID_ADDRESS") + +#endif diff --git a/tests/prctl-tid_address.test b/tests/prctl-tid_address.test new file mode 100755 index 00000000..dc7b7c32 --- /dev/null +++ b/tests/prctl-tid_address.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check decoding of prctl PR_GET_TID_ADDRESS operation. +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a23 -eprctl $args > "$EXP" +LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^T]|.[^I]|..[^D])' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/prctl-tsc.c b/tests/prctl-tsc.c new file mode 100644 index 00000000..fd9362d7 --- /dev/null +++ b/tests/prctl-tsc.c @@ -0,0 +1,80 @@ +/* + * Check decoding of prctl PR_GET_TSC/PR_SET_TSC operations. + * + * Copyright (c) 2016 JingPiao Chen + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_prctl && defined PR_GET_TSC && defined PR_SET_TSC + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_tsc = + (kernel_ulong_t) 0xdeadc0defacebeefULL; + + int *tsc = tail_alloc(sizeof(*tsc)); + long rc; + + rc = syscall(__NR_prctl, PR_SET_TSC, 0); + printf("prctl(PR_SET_TSC, 0 /* PR_TSC_??? */) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_TSC, bogus_tsc); + printf("prctl(PR_SET_TSC, %#x /* PR_TSC_??? */) = %s\n", + (unsigned int) bogus_tsc, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SET_TSC, PR_TSC_SIGSEGV); + printf("prctl(PR_SET_TSC, PR_TSC_SIGSEGV) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, NULL); + printf("prctl(PR_GET_TSC, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, tsc + 1); + printf("prctl(PR_GET_TSC, %p) = %s\n", tsc + 1, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_GET_TSC, tsc); + if (rc) + printf("prctl(PR_GET_TSC, %p) = %s\n", tsc, sprintrc(rc)); + else + printf("prctl(PR_GET_TSC, [PR_TSC_SIGSEGV]) = %s\n", + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_TSC && PR_SET_TSC") + +#endif diff --git a/tests/prctl-tsc.test b/tests/prctl-tsc.test new file mode 100755 index 00000000..a906ba89 --- /dev/null +++ b/tests/prctl-tsc.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check prctl PR_GET_TSC PR_SET_TSC decoding. + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog > /dev/null +run_strace -a24 -eprctl $args > "$EXP" +grep -v '^prctl(PR_[GS]ET_[^T][^S]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" diff --git a/tests/pread64-pwrite64.c b/tests/pread64-pwrite64.c new file mode 100644 index 00000000..4a0932a9 --- /dev/null +++ b/tests/pread64-pwrite64.c @@ -0,0 +1,223 @@ +/* + * Check decoding of pread64 and pwrite64 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +static void +dump_str(const char *str, const unsigned int len) +{ + static const char dots[16] = "................"; + unsigned int i; + + for (i = 0; i < len; i += 16) { + unsigned int n = len - i > 16 ? 16 : len - i; + const char *dump = hexdump_memdup(str + i, n); + + tprintf(" | %05x %-49s %-16.*s |\n", + i, dump, n, dots); + + free((void *) dump); + } +} + +static void +print_hex(const char *str, const unsigned int len) +{ + const unsigned char *ustr = (const unsigned char *) str; + unsigned int i; + + for (i = 0; i < len; ++i) { + unsigned int c = ustr[i]; + + switch (c) { + case '\t': + tprintf("\\t"); break; + case '\n': + tprintf("\\n"); break; + case '\v': + tprintf("\\v"); break; + case '\f': + tprintf("\\f"); break; + case '\r': + tprintf("\\r"); break; + default: + tprintf("\\%o", ustr[i]); + } + } +} + +static void +test_dump(const unsigned int len) +{ + static char *buf; + + if (buf) { + size_t ps1 = get_page_size() - 1; + buf = (void *) (((size_t) buf + ps1) & ~ps1) - len; + } else { + buf = tail_alloc(len); + } + + const off_t offset = 0xdefaceddeadbeefLL + len; + long rc = pread(0, buf, len, offset); + if (rc != (int) len) + perror_msg_and_fail("pread64: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "pread64", 0); + print_hex(buf, len); + tprintf("\", %d, %lld) = %ld\n", len, (long long) offset, rc); + dump_str(buf, len); + + unsigned int i; + for (i = 0; i < len; ++i) + buf[i] = i; + + rc = pwrite(1, buf, len, offset); + if (rc != (int) len) + perror_msg_and_fail("pwrite64: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "pwrite64", 1); + print_hex(buf, len); + tprintf("\", %d, %lld) = %ld\n", len, (long long) offset, rc); + dump_str(buf, len); + + if (!len) + buf = 0; +} + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "pread64-pwrite64-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + + char *nil = tail_alloc(1); + *nil = '\0'; + + static const char w_c[] = "0123456789abcde"; + const unsigned int w_len = LENGTH_OF(w_c); + const char *w_d = hexdump_strdup(w_c); + const void *w = tail_memdup(w_c, w_len); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + const unsigned int r0_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r0_len); + + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + const unsigned int r1_len = w_len - r0_len; + void *r1 = tail_alloc(w_len); + + void *efault = r1 - get_page_size(); + + long rc; + + rc = pwrite(1, w, 0, 0); + if (rc) + perror_msg_and_fail("pwrite64: expected 0, returned %ld", rc); + tprintf("pwrite64(1, \"\", 0, 0) = 0\n"); + + rc = pwrite(1, efault, 1, 0); + if (rc != -1) + perror_msg_and_fail("pwrite64: expected -1 EFAULT" + ", returned %ld", rc); + tprintf("pwrite64(1, %p, 1, 0) = -1 EFAULT (%m)\n", efault); + + rc = pwrite(1, nil, 1, -3); + if (rc != -1) + perror_msg_and_fail("pwrite64: expected -1, returned %ld", rc); + tprintf("pwrite64(1, \"\\0\", 1, -3) = -1 EINVAL (%m)\n"); + + rc = pwrite(1, w, w_len, 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwrite64: expected %u, returned %ld", + w_len, rc); + tprintf("pwrite64(1, \"%s\", %u, 0) = %ld\n" + " | 00000 %-49s %-16s |\n", + w_c, w_len, rc, w_d, w_c); + close(1); + + rc = pread(0, r0, 0, 0); + if (rc) + perror_msg_and_fail("pread64: expected 0, returned %ld", rc); + tprintf("pread64(0, \"\", 0, 0) = 0\n"); + + rc = pread(0, efault, 1, 0); + if (rc != -1) + perror_msg_and_fail("pread64: expected -1, returned %ld", rc); + tprintf("pread64(0, %p, 1, 0) = -1 EFAULT (%m)\n", efault); + + rc = pread(0, efault, 2, -7); + if (rc != -1) + perror_msg_and_fail("pread64: expected -1, returned %ld", rc); + tprintf("pread64(0, %p, 2, -7) = -1 EINVAL (%m)\n", efault); + + rc = pread(0, r0, r0_len, 0); + if (rc != (int) r0_len) + perror_msg_and_fail("pread64: expected %u, returned %ld", + r0_len, rc); + tprintf("pread64(0, \"%s\", %u, 0) = %ld\n" + " | 00000 %-49s %-16s |\n", + r0_c, r0_len, rc, r0_d, r0_c); + + rc = pread(0, r1, w_len, r0_len); + if (rc != (int) r1_len) + perror_msg_and_fail("pread64: expected %u, returned %ld", + r1_len, rc); + tprintf("pread64(0, \"%s\", %u, %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r1_c, w_len, r0_len, rc, r1_d, r1_c); + close(0); + + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 1) + perror_msg_and_fail("open"); + + unsigned int i; + for (i = 0; i <= 32; ++i) + test_dump(i); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/pread64-pwrite64.test b/tests/pread64-pwrite64.test new file mode 100755 index 00000000..e585406d --- /dev/null +++ b/tests/pread64-pwrite64.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check decoding and dumping of pread64 and pwrite64 syscalls. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +tmpfile=pread64-pwrite64-tmpfile +> $tmpfile + +run_strace_match_diff \ + -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 \ + -P $tmpfile -P /dev/zero -P /dev/null + +rm -f $tmpfile diff --git a/tests/preadv-pwritev.c b/tests/preadv-pwritev.c new file mode 100644 index 00000000..b2d2a824 --- /dev/null +++ b/tests/preadv-pwritev.c @@ -0,0 +1,182 @@ +/* + * Check decoding of preadv and pwritev syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#if defined HAVE_PREADV && defined HAVE_PWRITEV + +# include +# include +# include +# include + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "preadv-pwritev-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + if (unlink(tmp)) + perror_msg_and_fail("unlink: %s", tmp); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + const void *efault = w0 + LENGTH_OF(w0_c); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + long rc; + + rc = pwritev(1, efault, 42, 0); + tprintf("pwritev(1, %p, 42, 0) = %ld %s (%m)\n", + efault, rc, errno2name()); + + rc = preadv(0, efault, 42, 0); + tprintf("preadv(0, %p, 42, 0) = %ld %s (%m)\n", + efault, rc, errno2name()); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + rc = pwritev(1, w_iov, 0, 0); + if (rc) + perror_msg_and_fail("pwritev: expected 0, returned %ld", rc); + tprintf("pwritev(1, [], 0, 0) = 0\n"); + + rc = pwritev(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0)" + " = %ld %s (%m)\n", + w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + rc = pwritev(1, w_iov, ARRAY_SIZE(w_iov_), 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwritev: expected %u, returned %ld", + w_len, rc); + close(1); + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + rc = preadv(0, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv: expected %u, returned %ld", + r_len, rc); + tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = preadv(0, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) w_len - (int) r_len) + perror_msg_and_fail("preadv: expected %d, returned %ld", + (int) w_len - r_len, rc); + tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r_len, w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV && HAVE_PWRITEV") + +#endif diff --git a/tests/preadv-pwritev.test b/tests/preadv-pwritev.test new file mode 100755 index 00000000..cb2a0772 --- /dev/null +++ b/tests/preadv-pwritev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding and dumping of preadv and pwritev syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests/preadv.c b/tests/preadv.c new file mode 100644 index 00000000..fb5d3ad7 --- /dev/null +++ b/tests/preadv.c @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PREADV + +# include +# include +# include +# include + +# define LEN 8 + +static void +print_iov(const struct iovec *iov) +{ + unsigned int i; + unsigned char *buf = iov->iov_base; + + fputs("{iov_base=\"", stdout); + for (i = 0; i < iov->iov_len; ++i) + printf("\\%d", (int) buf[i]); + printf("\", iov_len=%u}", (unsigned) iov->iov_len); +} + +static void +print_iovec(const struct iovec *iov, unsigned int cnt) +{ + unsigned int i; + putchar('['); + for (i = 0; i < cnt; ++i) { + if (i) + fputs(", ", stdout); + print_iov(&iov[i]); + } + putchar(']'); +} + +int +main(void) +{ + const off_t offset = 0xdefaceddeadbeefLL; + char *buf = tail_alloc(LEN); + struct iovec *iov = tail_alloc(sizeof(*iov)); + iov->iov_base = buf; + iov->iov_len = LEN; + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (preadv(0, iov, 1, offset) != LEN) + perror_msg_and_fail("preadv"); + printf("preadv(0, "); + print_iovec(iov, 1); + printf(", 1, %lld) = %u\n", (long long) offset, LEN); + + if (preadv(0, iov, 1, -1) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, [{iov_base=%p, iov_len=%zu}], 1, -1) = " + "-1 EINVAL (%m)\n", iov->iov_base, iov->iov_len); + + if (preadv(0, NULL, 1, -2) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, NULL, 1, -2) = -1 EINVAL (%m)\n"); + + if (preadv(0, iov, 0, -3) != -1) + perror_msg_and_fail("preadv"); + printf("preadv(0, [], 0, -3) = -1 EINVAL (%m)\n"); + + static const char tmp[] = "preadv-tmpfile"; + int fd = open(tmp, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd < 0) + perror_msg_and_fail("open"); + if (unlink(tmp)) + perror_msg_and_fail("unlink"); + + static const char w[] = "0123456789abcde"; + if (write(fd, w, LENGTH_OF(w)) != LENGTH_OF(w)) + perror_msg_and_fail("write"); + + static const char r0_c[] = "01234567"; + static const char r1_c[] = "89abcde"; + + const unsigned int r_len = (LENGTH_OF(w) + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + long rc; + + rc = preadv(fd, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv: expected %u, returned %ld", + r_len, rc); + printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n", + fd, r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(LENGTH_OF(w)); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = LENGTH_OF(w) + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = preadv(fd, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) LENGTH_OF(w) - (int) r_len) + perror_msg_and_fail("preadv: expected %d, returned %ld", + (int) LENGTH_OF(w) - r_len, rc); + printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n", + fd, r1_c, r_len, LENGTH_OF(w), ARRAY_SIZE(r1_iov_), + r_len, LENGTH_OF(w) - r_len); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PREADV") + +#endif diff --git a/tests/preadv.test b/tests/preadv.test new file mode 100755 index 00000000..d1abdb7d --- /dev/null +++ b/tests/preadv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check preadv syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/preadv2-pwritev2.c b/tests/preadv2-pwritev2.c new file mode 100644 index 00000000..f7c46c0a --- /dev/null +++ b/tests/preadv2-pwritev2.c @@ -0,0 +1,216 @@ +/* + * Check decoding of preadv2 and pwritev2 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#if defined __NR_preadv2 && defined __NR_pwritev2 + +# include +# include +# include +# include +# include + +static int +pr(const int fd, const struct iovec *const vec, + const unsigned long vlen, const unsigned long pos) +{ + return syscall(__NR_preadv2, fd, vec, vlen, pos, 0L, 0L); +} + +static int +pw(const int fd, const struct iovec *const vec, + const unsigned long vlen, const unsigned long pos) +{ + return syscall(__NR_pwritev2, fd, vec, vlen, pos, 0L, 0L); +} + +static void +dumpio(void) +{ + static char tmp[] = "preadv2-pwritev2-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + if (unlink(tmp)) + perror_msg_and_fail("unlink: %s", tmp); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + long rc; + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + rc = pw(1, w_iov, 0, 0); + if (rc) + perror_msg_and_fail("pwritev2: expected 0, returned %ld", rc); + tprintf("pwritev2(1, [], 0, 0, 0) = 0\n"); + + rc = pw(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0, 0)" + " = %ld %s (%m)\n", + w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + rc = pw(1, w_iov, ARRAY_SIZE(w_iov_), 0); + if (rc != (int) w_len) + perror_msg_and_fail("pwritev2: expected %u, returned %ld", + w_len, rc); + close(1); + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + rc = pr(0, r_iov, ARRAY_SIZE(r0_iov_), 0); + if (rc != (int) r_len) + perror_msg_and_fail("preadv2: expected %u, returned %ld", + r_len, rc); + tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + rc = pr(0, r_iov, ARRAY_SIZE(r1_iov_), r_len); + if (rc != (int) w_len - (int) r_len) + perror_msg_and_fail("preadv2: expected %d, returned %ld", + (int) w_len - r_len, rc); + tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u, %u, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r_len, w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); +} + +int +main(void) +{ + const kernel_ulong_t vlen = (kernel_ulong_t) 0xfac1fed2dad3bef4ULL; + const unsigned long long pos = 0xfac5fed6dad7bef8; + const kernel_ulong_t pos_l = (kernel_ulong_t) pos; + const kernel_ulong_t pos_h = + (sizeof(kernel_ulong_t) == sizeof(long long)) ? + (kernel_ulong_t) 0xbadc0deddeadbeefULL : 0xfac5fed6UL; + int test_dumpio = 1; + + tprintf("%s", ""); + + syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); + if (ENOSYS == errno) + test_dumpio = 0; + tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", + (unsigned long) vlen, pos, errno2name()); + + syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); + if (ENOSYS == errno) + test_dumpio = 0; + tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", + (unsigned long) vlen, pos, errno2name()); + + if (test_dumpio) + dumpio(); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_preadv2 && __NR_pwritev2") + +#endif diff --git a/tests/preadv2-pwritev2.test b/tests/preadv2-pwritev2.test new file mode 100755 index 00000000..5641ef46 --- /dev/null +++ b/tests/preadv2-pwritev2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding and dumping of preadv2 and pwritev2 syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests/print_maxfd.c b/tests/print_maxfd.c new file mode 100644 index 00000000..c3d4ea88 --- /dev/null +++ b/tests/print_maxfd.c @@ -0,0 +1,41 @@ +/* + * Print the maximum descriptor number available. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + int fds[2]; + pipe_maxfd(fds); + printf("%d\n", fds[1]); + return 0; +} diff --git a/tests/print_quoted_string.c b/tests/print_quoted_string.c new file mode 100644 index 00000000..3ad86024 --- /dev/null +++ b/tests/print_quoted_string.c @@ -0,0 +1,75 @@ +#include "tests.h" + +#include +#include +#include + +/* + * Based on string_quote() from util.c. + * Assumes instr is NUL-terminated. + */ + +void +print_quoted_string(const char *instr) +{ + print_quoted_memory(instr, strlen(instr)); +} + +void +print_quoted_memory(const char *instr, const size_t len) +{ + const unsigned char *str = (const unsigned char*) instr; + size_t i; + + for (i = 0; i < len; ++i) { + const int c = str[i]; + switch (c) { + case '\"': + printf("\\\""); + break; + case '\\': + printf("\\\\"); + break; + case '\f': + printf("\\f"); + break; + case '\n': + printf("\\n"); + break; + case '\r': + printf("\\r"); + break; + case '\t': + printf("\\t"); + break; + case '\v': + printf("\\v"); + break; + default: + if (c >= ' ' && c <= 0x7e) + putchar(c); + else { + putchar('\\'); + + char c1 = '0' + (c & 0x7); + char c2 = '0' + ((c >> 3) & 0x7); + char c3 = '0' + (c >> 6); + + if (*str >= '0' && *str <= '9') { + /* Print \octal */ + putchar(c3); + putchar(c2); + } else { + /* Print \[[o]o]o */ + if (c3 != '0') + putchar(c3); + if (c3 != '0' || c2 != '0') + putchar(c2); + } + putchar(c1); + } + break; + } + } + +} diff --git a/tests/printflags.c b/tests/printflags.c new file mode 100644 index 00000000..badc85d3 --- /dev/null +++ b/tests/printflags.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "xlat.h" +#include + +int +printflags(const struct xlat *xlat, unsigned long long flags, + const char *const dflt) +{ + if (flags == 0 && xlat->val == 0 && xlat->str) { + fputs(xlat->str, stdout); + return 1; + } + + int n; + char sep = 0; + for (n = 0; xlat->str; xlat++) { + if (xlat->val && (flags & xlat->val) == xlat->val) { + if (sep) + putc(sep, stdout); + else + sep = '|'; + fputs(xlat->str, stdout); + flags &= ~xlat->val; + n++; + } + } + + if (n) { + if (flags) { + if (sep) + putc(sep, stdout); + printf("%#llx", flags); + n++; + } + } else { + if (flags) { + printf("%#llx", flags); + if (dflt) + printf(" /* %s */", dflt); + } else { + if (dflt) + putc('0', stdout); + } + } + + return n; +} diff --git a/tests/printstr.c b/tests/printstr.c new file mode 100644 index 00000000..330234f1 --- /dev/null +++ b/tests/printstr.c @@ -0,0 +1,69 @@ +/* + * Check decoding of non-NUL-terminated strings when len == -1. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +#define DEFAULT_STRLEN 32 + +int +main(void) +{ + char *const buf = tail_alloc(DEFAULT_STRLEN + 1); + const struct iovec io = { + .iov_base = buf, + .iov_len = -1 + }; + int rc; + + buf[0] = 0; + + tprintf("%s", ""); + + memset(buf + 1, 'X', DEFAULT_STRLEN); + buf[DEFAULT_STRLEN - 1] = 0; + + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=\"\\0%*s\\0\"..., iov_len=%lu}], 1)" + " = %s\n", DEFAULT_STRLEN - 2, buf + 1, -1UL, sprintrc(rc)); + + buf[DEFAULT_STRLEN - 1] = 'X'; + buf[DEFAULT_STRLEN] = 0; + + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=\"\\0%*s\"..., iov_len=%lu}], 1)" + " = %s\n", DEFAULT_STRLEN - 1, buf + 1, -1UL, sprintrc(rc)); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/printstr.test b/tests/printstr.test new file mode 100755 index 00000000..5f164eb7 --- /dev/null +++ b/tests/printstr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of non-NUL-terminated strings when len == -1. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -e trace=writev diff --git a/tests/printxval.c b/tests/printxval.c new file mode 100644 index 00000000..4fb61c84 --- /dev/null +++ b/tests/printxval.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include "xlat.h" +#include + +int +printxval(const struct xlat *xlat, unsigned long long val, + const char *const dflt) +{ + for (; xlat->str; xlat++) { + if (xlat->val == val) { + fputs(xlat->str, stdout); + return 1; + } + } + + printf("%#llx", val); + if (dflt) + printf(" /* %s */", dflt); + return 0; +} diff --git a/tests/prlimit64.c b/tests/prlimit64.c new file mode 100644 index 00000000..1e651161 --- /dev/null +++ b/tests/prlimit64.c @@ -0,0 +1,92 @@ +/* + * Check decoding of prlimit64 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_prlimit64 + +# include +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/resources.h" + +const char * +sprint_rlim(uint64_t lim) +{ + if (lim == -1ULL) + return "RLIM64_INFINITY"; + + static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; + static int i; + i &= 1; + if (lim > 1024 && lim % 1024 == 0) + sprintf(buf[i], "%" PRIu64 "*1024", lim / 1024); + else + sprintf(buf[i], "%" PRIu64, lim); + + return buf[i++]; +} + +int +main(void) +{ + unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + uint64_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(__NR_prlimit64, pid, res, 0, rlimit); + if (rc) + printf("prlimit64(%d, %s, NULL, %p) = %ld %s (%m)\n", + (unsigned) pid, xlat->str, rlimit, + rc, errno2name()); + else + printf("prlimit64(%d, %s, NULL" + ", {rlim_cur=%s, rlim_max=%s}) = 0\n", + (unsigned) pid, xlat->str, + sprint_rlim(rlimit[0]), + sprint_rlim(rlimit[1])); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prlimit64") + +#endif diff --git a/tests/prlimit64.test b/tests/prlimit64.test new file mode 100755 index 00000000..2d2240d7 --- /dev/null +++ b/tests/prlimit64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of prlimit64 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/process_vm_readv.c b/tests/process_vm_readv.c new file mode 100644 index 00000000..cfb8f786 --- /dev/null +++ b/tests/process_vm_readv.c @@ -0,0 +1,18 @@ +#include "tests.h" + +#include + +#ifdef __NR_process_vm_readv + +# define OP process_vm_readv +# define OP_NR __NR_process_vm_readv +# define OP_STR "process_vm_readv" +# define OP_WR 0 + +# include "process_vm_readv_writev.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_process_vm_readv"); + +#endif diff --git a/tests/process_vm_readv.test b/tests/process_vm_readv.test new file mode 100755 index 00000000..c092f5a3 --- /dev/null +++ b/tests/process_vm_readv.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of process_vm_readv syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a37 diff --git a/tests/process_vm_readv_writev.c b/tests/process_vm_readv_writev.c new file mode 100644 index 00000000..2a089395 --- /dev/null +++ b/tests/process_vm_readv_writev.c @@ -0,0 +1,306 @@ +/* + * Check decoding of process_vm_readv/process_vm_writev syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +#if OP_WR +# define in_iovec rmt_iovec +# define out_iovec lcl_iovec +# define in_iov rmt_iov +# define out_iov lcl_iov +#else +# define in_iovec lcl_iovec +# define out_iovec rmt_iovec +# define in_iov lcl_iov +# define out_iov rmt_iov +#endif + +typedef void (*iov_print_fn)(const struct iovec *, const void *, long); + +enum { MAX_SEGM_COUNT = 2, MAX_STR_LEN = 5 }; + +struct print_iov_arg { + uint32_t count; + uint32_t valid :1, + string :1, + addr_term:1, + check_rc :1; + uint32_t str_segms; + uint8_t str_base[MAX_SEGM_COUNT]; + uint8_t str_size[MAX_SEGM_COUNT]; +}; + +static void +print_iov(const struct iovec *iov, const void *arg_ptr, long rc) +{ + const struct print_iov_arg *arg = arg_ptr; + uint32_t i; + uint32_t num_segm = 0; + uint64_t segm_offs = 0; + + if (!arg || !arg->valid) { + if (iov) + printf("%p", iov); + else + printf("NULL"); + + return; + } + + printf("["); + + for (i = 0; i < arg->count; i++) { + if (i) + printf(", "); + + if (i >= MAX_STR_LEN) { + printf("..."); + break; + } + + printf("{iov_base="); + if (arg->string && (!arg->check_rc || (rc != -1))) { + uint64_t str_left = iov[i].iov_len; + uint64_t pr_count = 0; + + printf("\""); + + while (str_left--) { + static const char oct_str[] = "01234567"; + uint8_t c = arg->str_base[num_segm] + segm_offs; + + if ((num_segm >= arg->str_segms) || + (num_segm >= MAX_SEGM_COUNT)) + error_msg_and_fail("print_iov: segment " + "count overrun"); + + if (pr_count++ < MAX_STR_LEN) + printf("\\%.1s%.1s%d", + (c >> 6) ? + oct_str + (c >> 6) : "", + (c >> 3) ? + oct_str + ((c >> 3) & 7) : "", + c & 7); + + segm_offs++; + + if (segm_offs >= arg->str_size[num_segm]) { + num_segm++; + segm_offs = 0; + } + } + + printf("\""); + + if (pr_count > MAX_STR_LEN) + printf("..."); + } else { + if (iov[i].iov_base) + printf("%p", iov[i].iov_base); + else + printf("NULL"); + } + + printf(", iov_len=%zu}", iov[i].iov_len); + } + + if (arg->addr_term) + printf(", %p", iov + arg->count); + + printf("]"); +} + +static void +do_call(kernel_ulong_t pid, + kernel_ulong_t local_iov, const char *local_arg, + kernel_ulong_t liovcnt, + kernel_ulong_t remote_iov, const char *remote_arg, + kernel_ulong_t riovcnt, + kernel_ulong_t flags, iov_print_fn pr_iov) +{ + long rc; + const char *errstr; + + rc = syscall(OP_NR, pid, local_iov, liovcnt, remote_iov, riovcnt, + flags); + errstr = sprintrc(rc); + + printf("%s(%d, ", OP_STR, (int) pid); + + if (pr_iov) + pr_iov((const struct iovec *) (uintptr_t) local_iov, local_arg, + rc); + else + printf("%s", local_arg); + + printf(", %lu, ", (unsigned long) liovcnt); + + if (pr_iov) + pr_iov((const struct iovec *) (uintptr_t) remote_iov, + remote_arg, rc); + else + printf("%s", remote_arg); + + printf(", %lu, %lu) = %s\n", (unsigned long) riovcnt, + (unsigned long) flags, errstr); +} + +kernel_ulong_t +ptr_cast(void *ptr) +{ + return (kernel_ulong_t) (uintptr_t) ptr; +} + +int +main(void) +{ + enum { + SIZE_11 = 2, + SIZE_12 = 3, + SIZE_13 = 4, + SIZE_1 = SIZE_11 + SIZE_12 + SIZE_13, + SIZE_21 = 5, + SIZE_22 = 6, + SIZE_23 = 7, + SIZE_2 = SIZE_21 + SIZE_22 + SIZE_23, + }; + + enum { + SEGM1_BASE = 0x80, + SEGM2_BASE = 0xA0, + }; + + static const kernel_ulong_t bogus_pid = + (kernel_ulong_t) 0xbadfaceddeadca57ULL; + static const kernel_ulong_t bogus_iovcnt1 = + (kernel_ulong_t) 0xdec0ded1defaced2ULL; + static const kernel_ulong_t bogus_iovcnt2 = + (kernel_ulong_t) 0xdec0ded3defaced4ULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xdeadc0deda7adeadULL; + + pid_t my_pid = getpid(); + char *data1_out = tail_alloc(SIZE_1); + char *data2_out = tail_alloc(SIZE_2); + char *data1_in = tail_alloc(SIZE_2); + char *data2_in = tail_alloc(SIZE_1); + + struct iovec bogus_iovec[] = { + { data1_out + SIZE_1, (size_t) 0xdeadfaceca57beefULL }, + { data1_in + SIZE_2, (size_t) 0xbadc0dedda7adeadULL }, + { data2_out + SIZE_2, (size_t) 0xf157facedec0ded1ULL }, + { data2_in + SIZE_1, (size_t) 0xdefaced2bea7be57ULL }, + }; + + struct iovec out_iovec[] = { + { data1_out, SIZE_11 }, + { data1_out + SIZE_11, SIZE_12 }, + { data1_out + SIZE_11 + SIZE_12, SIZE_13 }, + { data2_out, SIZE_21 }, + { data2_out + SIZE_21, SIZE_22 }, + { data2_out + SIZE_21 + SIZE_22, SIZE_23 }, + }; + struct iovec in_iovec[] = { + { data1_in, SIZE_23 }, + { data1_in + SIZE_23, SIZE_22 }, + { data1_in + SIZE_23 + SIZE_22, SIZE_21 }, + { data2_in, SIZE_13 }, + { data2_in + SIZE_13, SIZE_12 }, + { data2_in + SIZE_13 + SIZE_12, SIZE_11 }, + }; + + struct iovec *bogus_iov = tail_memdup(bogus_iovec, sizeof(bogus_iovec)); + struct iovec *lcl_iov = tail_memdup(lcl_iovec, sizeof(lcl_iovec)); + struct iovec *rmt_iov = tail_memdup(rmt_iovec, sizeof(rmt_iovec)); + + struct print_iov_arg bogus_arg = { ARRAY_SIZE(bogus_iovec), 1 }; + struct print_iov_arg lcl_arg = { ARRAY_SIZE(lcl_iovec), 1, 1, 0, 0, + 2, {SEGM1_BASE, SEGM2_BASE}, {SIZE_1, SIZE_2} }; + struct print_iov_arg rmt_arg = { ARRAY_SIZE(rmt_iovec), 1 }; + + struct print_iov_arg bogus_arg_cut = + { ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 }; + struct print_iov_arg lcl_arg_cut = + { ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, + {SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE}, + {SIZE_13, SIZE_2} }; + struct print_iov_arg rmt_arg_cut = + { ARRAY_SIZE(rmt_iovec) - 2, 1 }; + + + fill_memory_ex(data1_out, SIZE_1, SEGM1_BASE, SIZE_1); + fill_memory_ex(data2_out, SIZE_2, SEGM2_BASE, SIZE_2); + + + do_call(bogus_pid, (kernel_ulong_t) (uintptr_t) ARG_STR(NULL), + bogus_iovcnt1, (kernel_ulong_t) (uintptr_t) ARG_STR(NULL), + bogus_iovcnt2, bogus_flags, NULL); + + do_call(my_pid, ptr_cast(bogus_iov + ARRAY_SIZE(bogus_iovec)), + "[]", 0, ptr_cast(in_iov + ARRAY_SIZE(in_iovec)), "[]", + 0, 0, NULL); + do_call(my_pid, ptr_cast(bogus_iov + ARRAY_SIZE(bogus_iovec)), NULL, + bogus_iovcnt1, ptr_cast(in_iov + ARRAY_SIZE(in_iovec)), NULL, + bogus_iovcnt2, 0, print_iov); + + do_call(my_pid, ptr_cast(bogus_iov), (char *) &bogus_arg, + ARRAY_SIZE(bogus_iovec), ptr_cast(rmt_iov + 2), + (char *) &rmt_arg_cut, ARRAY_SIZE(rmt_iovec) - 2, 0, print_iov); + +#if !OP_WR + lcl_arg.check_rc = 1; + lcl_arg_cut.check_rc = 1; +#endif + + do_call(my_pid, ptr_cast(lcl_iov + 2), (char *) &lcl_arg_cut, + ARRAY_SIZE(lcl_iovec) - 1, ptr_cast(bogus_iov + 2), + (char *) &bogus_arg_cut, ARRAY_SIZE(bogus_iovec) - 1, 0, + print_iov); + + lcl_arg_cut.addr_term = 0; + + rmt_arg_cut.addr_term = 1; + rmt_arg_cut.count = 5; + + do_call(my_pid, ptr_cast(lcl_iov + 2), (char *) &lcl_arg_cut, + ARRAY_SIZE(lcl_iovec) - 2, ptr_cast(rmt_iov + 1), + (char *) &rmt_arg_cut, ARRAY_SIZE(rmt_iovec), 0, print_iov); + + /* Correct call */ + do_call(my_pid, ptr_cast(lcl_iov), (char *) &lcl_arg, + ARRAY_SIZE(lcl_iovec), ptr_cast(rmt_iov), (char *) &rmt_arg, + ARRAY_SIZE(rmt_iovec), 0, print_iov); + + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests/process_vm_writev.c b/tests/process_vm_writev.c new file mode 100644 index 00000000..6271c01b --- /dev/null +++ b/tests/process_vm_writev.c @@ -0,0 +1,18 @@ +#include "tests.h" + +#include + +#ifdef __NR_process_vm_writev + +# define OP process_vm_writev +# define OP_NR __NR_process_vm_writev +# define OP_STR "process_vm_writev" +# define OP_WR 1 + +# include "process_vm_readv_writev.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_process_vm_writev"); + +#endif diff --git a/tests/process_vm_writev.test b/tests/process_vm_writev.test new file mode 100755 index 00000000..f690e6a9 --- /dev/null +++ b/tests/process_vm_writev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of process_vm_writev syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a38 diff --git a/tests/pselect6.c b/tests/pselect6.c new file mode 100644 index 00000000..f2644853 --- /dev/null +++ b/tests/pselect6.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Based on test by Dr. David Alan Gilbert + */ + +#include "tests.h" +#include "nsig.h" +#include +#include +#include +#include +#include +#include + +#ifdef __NR_pselect6 + +static fd_set set[3][0x1000000 / sizeof(fd_set)]; + +static void +handler(int signo) +{ +} + +int main(int ac, char **av) +{ + int fds[2]; + struct { + struct timespec ts; + int pad[2]; + } tm_in = { + .ts = { .tv_sec = 0xc0de1, .tv_nsec = 0xc0de2 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, tm = tm_in; + sigset_t mask; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + + sigemptyset(&mask); + sigaddset(&mask, SIGHUP); + sigaddset(&mask, SIGCHLD); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + /* + * Start with a nice simple pselect. + */ + FD_SET(fds[0], set[0]); + FD_SET(fds[1], set[0]); + FD_SET(fds[0], set[1]); + FD_SET(fds[1], set[1]); + FD_SET(1, set[2]); + FD_SET(2, set[2]); + int rc = pselect(fds[1] + 1, set[0], set[1], set[2], NULL, NULL); + if (rc < 0) + perror_msg_and_skip("pselect"); + assert(rc == 1); + printf("pselect6(%d, [%d %d], [%d %d], [1 2], NULL, {NULL, %u}) " + "= 1 (out [%d])\n", + fds[1] + 1, fds[0], fds[1], + fds[0], fds[1], + NSIG_BYTES, fds[1]); + + /* + * Another simple one, with a timeout. + */ + FD_SET(1, set[1]); + FD_SET(2, set[1]); + FD_SET(fds[0], set[1]); + FD_SET(fds[1], set[1]); + assert(syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) == 3); + printf("pselect6(%d, NULL, [1 2 %d %d], NULL, " + "{tv_sec=%lld, tv_nsec=%lld}, NULL) = 3 (out [1 2 %d], left " + "{tv_sec=%lld, tv_nsec=%lld})\n", + fds[1] + 1, fds[0], fds[1], + (long long) tm_in.ts.tv_sec, (long long) tm_in.ts.tv_nsec, + fds[1], + (long long) tm.ts.tv_sec, (long long) tm.ts.tv_nsec); + + /* + * Now the crash case that trinity found, negative nfds + * but with a pointer to a large chunk of valid memory. + */ + FD_ZERO(set[0]); + FD_SET(fds[1],set[0]); + assert(pselect(-1, NULL, set[0], NULL, NULL, &mask) == -1); + printf("pselect6(-1, NULL, %p, NULL, NULL, {[HUP CHLD], %u}) " + "= -1 EINVAL (%m)\n", set[0], NSIG_BYTES); + + /* + * Another variant, with nfds exceeding FD_SETSIZE limit. + */ + FD_ZERO(set[0]); + FD_SET(fds[0],set[0]); + FD_ZERO(set[1]); + tm.ts.tv_sec = 0; + tm.ts.tv_nsec = 123; + assert(pselect(FD_SETSIZE + 1, set[0], set[1], NULL, &tm.ts, &mask) == 0); + printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}, " + "{[HUP CHLD], %u}) = 0 (Timeout)\n", + FD_SETSIZE + 1, fds[0], NSIG_BYTES); + + /* + * See how timeouts are decoded. + */ + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(setitimer(ITIMER_REAL, &itv, NULL) == 0); + + tm.ts.tv_nsec = 222222222; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, &mask) == -1); + printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}, " + "{[HUP CHLD], %u}) = " + "? ERESTARTNOHAND (To be restarted if no handler)\n", + NSIG_BYTES); + puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pselect6") + +#endif diff --git a/tests/pselect6.test b/tests/pselect6.test new file mode 100755 index 00000000..203f8e24 --- /dev/null +++ b/tests/pselect6.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check pselect6 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/ptrace.c b/tests/ptrace.c new file mode 100644 index 00000000..80ce8cbb --- /dev/null +++ b/tests/ptrace.c @@ -0,0 +1,455 @@ +/* + * Check decoding of ptrace syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigprocmask + +# include +# include +# include +# include +# include +# include +# include "ptrace.h" +# include + +static const char *errstr; + +static long +do_ptrace(unsigned long request, unsigned long pid, + unsigned long addr, unsigned long data) +{ + long rc = syscall(__NR_ptrace, request, pid, addr, data); + errstr = sprintrc(rc); + return rc; +} + +static void +test_peeksiginfo(unsigned long pid, const unsigned long bad_request) +{ + do_ptrace(PTRACE_PEEKSIGINFO, pid, 0, bad_request); + printf("ptrace(PTRACE_PEEKSIGINFO, %u, NULL, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + struct { + unsigned long long off; + unsigned int flags, nr; + } *const psi = tail_alloc(sizeof(*psi)); + + psi->off = 0xdeadbeeffacefeedULL; + psi->flags = 1; + psi->nr = 42; + + do_ptrace(PTRACE_PEEKSIGINFO, pid, (unsigned long) psi, bad_request); + printf("ptrace(PTRACE_PEEKSIGINFO, %u, {off=%llu" + ", flags=PTRACE_PEEKSIGINFO_SHARED, nr=%u}, %#lx) = %s\n", + (unsigned) pid, psi->off, psi->nr, bad_request, errstr); + + pid = fork(); + if ((pid_t) pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGALRM); + + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + raise(SIGUSR1); + raise(SIGUSR2); + raise(SIGALRM); + + if (do_ptrace(PTRACE_TRACEME, 0, 0, 0)) + perror_msg_and_fail("child: PTRACE_TRACEME"); + + raise(SIGSTOP); + _exit(0); + } + + const unsigned int nsigs = 4; + const uid_t uid = geteuid(); + siginfo_t *sigs = tail_alloc(sizeof(*sigs) * nsigs); + + psi->off = 0; + psi->flags = 0; + psi->nr = nsigs; + + for (;;) { + int status, tracee, saved; + + errno = 0; + tracee = wait(&status); + if (tracee <= 0) { + if (errno == EINTR) + continue; + saved = errno; + kill (pid, SIGKILL); + errno = saved; + perror_msg_and_fail("wait"); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) + break; + error_msg_and_fail("unexpected exit status %u", + WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) + error_msg_and_fail("unexpected signal %u", + WTERMSIG(status)); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { + kill(pid, SIGKILL); + error_msg_and_fail("unexpected wait status %x", + status); + } + + long rc = do_ptrace(PTRACE_PEEKSIGINFO, pid, + (unsigned long) psi, (unsigned long) sigs); + if (rc < 0) { + printf("ptrace(PTRACE_PEEKSIGINFO, %u" + ", {off=%llu, flags=0, nr=%u}, %p) = %s\n", + (unsigned) pid, psi->off, psi->nr, sigs, + errstr); + } else { + printf("ptrace(PTRACE_PEEKSIGINFO, %u" + ", {off=%llu, flags=0, nr=%u}" + ", [{si_signo=SIGUSR1, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + ", {si_signo=SIGUSR2, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + ", {si_signo=SIGALRM, si_code=SI_TKILL" + ", si_pid=%u, si_uid=%u}" + "]) = %s\n", + (unsigned) pid, psi->off, psi->nr, + (unsigned) pid, (unsigned) uid, + (unsigned) pid, (unsigned) uid, + (unsigned) pid, (unsigned) uid, + errstr); + } + + if (do_ptrace(PTRACE_CONT, pid, 0, 0)) { + saved = errno; + kill (pid, SIGKILL); + errno = saved; + perror_msg_and_fail("ptrace"); + } + printf("ptrace(PTRACE_CONT, %ld, NULL, SIG_0) = 0\n", pid); + } +} + +int +main(void) +{ + const unsigned long bad_request = + (unsigned long) 0xdeadbeeffffffeedULL; + const unsigned long bad_data = + (unsigned long) 0xdeadcafefffff00dULL; + const unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + + unsigned int sigset_size; + + for (sigset_size = 1024 / 8; sigset_size; sigset_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, + SIG_SETMASK, NULL, NULL, sigset_size)) + break; + } + if (!sigset_size) + perror_msg_and_fail("rt_sigprocmask"); + + void *const k_set = tail_alloc(sigset_size); + siginfo_t *const sip = tail_alloc(sizeof(*sip)); + + do_ptrace(bad_request, pid, 0, 0); + printf("ptrace(%#lx /* PTRACE_??? */, %u, NULL, NULL) = %s\n", + bad_request, (unsigned) pid, errstr); + + do_ptrace(PTRACE_PEEKDATA, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKDATA, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKDATA, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_PEEKTEXT, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_PEEKUSER, pid, bad_request, bad_data); +# ifdef IA64 + printf("ptrace(PTRACE_PEEKUSER, %u, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); +# else + printf("ptrace(PTRACE_PEEKUSER, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); +#endif + + do_ptrace(PTRACE_POKEUSER, pid, bad_request, bad_data); + printf("ptrace(PTRACE_POKEUSER, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); + + do_ptrace(PTRACE_ATTACH, pid, 0, 0); + printf("ptrace(PTRACE_ATTACH, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_INTERRUPT, pid, 0, 0); + printf("ptrace(PTRACE_INTERRUPT, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_KILL, pid, 0, 0); + printf("ptrace(PTRACE_KILL, %u) = %s\n", (unsigned) pid, errstr); + + do_ptrace(PTRACE_LISTEN, pid, 0, 0); + printf("ptrace(PTRACE_LISTEN, %u) = %s\n", (unsigned) pid, errstr); + + sigset_t libc_set; + sigemptyset(&libc_set); + sigaddset(&libc_set, SIGUSR1); + memcpy(k_set, &libc_set, sigset_size); + + do_ptrace(PTRACE_SETSIGMASK, pid, sigset_size, (unsigned long) k_set); + printf("ptrace(PTRACE_SETSIGMASK, %u, %u, [USR1]) = %s\n", + (unsigned) pid, sigset_size, errstr); + + do_ptrace(PTRACE_GETSIGMASK, pid, sigset_size, (unsigned long) k_set); + printf("ptrace(PTRACE_GETSIGMASK, %u, %u, %p) = %s\n", + (unsigned) pid, sigset_size, k_set, errstr); + + do_ptrace(PTRACE_SECCOMP_GET_FILTER, pid, 42, 0); + printf("ptrace(PTRACE_SECCOMP_GET_FILTER, %u, 42, NULL) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_GETEVENTMSG, pid, bad_request, bad_data); + printf("ptrace(PTRACE_GETEVENTMSG, %u, %#lx, %#lx) = %s\n", + (unsigned) pid, bad_request, bad_data, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGIO; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_band = -2; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGIO" + ", si_code=POLL_IN, si_errno=ENOENT, si_band=-2}) = %s\n", + (unsigned) pid, bad_request, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGTRAP; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_pid = 2; + sip->si_uid = 3; + sip->si_ptr = (void *) bad_request; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGTRAP" + ", si_code=TRAP_BRKPT, si_errno=ENOENT, si_pid=2, si_uid=3" + ", si_value={int=%d, ptr=%p}}) = %s\n", + (unsigned) pid, bad_request, sip->si_int, sip->si_ptr, + errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGILL; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGILL" + ", si_code=ILL_ILLOPC, si_errno=ENOENT, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_addr, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGFPE; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGFPE" + ", si_code=FPE_INTDIV, si_errno=ENOENT, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_addr, errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGBUS; + sip->si_code = 1; + sip->si_errno = -2; + sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGBUS" + ", si_code=BUS_ADRALN, si_errno=%d, si_addr=%p}) = %s\n", + (unsigned) pid, bad_request, sip->si_errno, sip->si_addr, + errstr); + + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGPROF; + sip->si_code = 0xbadc0ded; + sip->si_errno = -2; + sip->si_pid = 0; + sip->si_uid = 3; + sip->si_ptr = 0; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGPROF" + ", si_code=%#x, si_errno=%d, si_pid=0, si_uid=3}) = %s\n", + (unsigned) pid, bad_request, sip->si_code, sip->si_errno, + errstr); + +#ifdef HAVE_SIGINFO_T_SI_SYSCALL + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGSYS; + sip->si_code = 1; + sip->si_errno = ENOENT; + sip->si_call_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + sip->si_syscall = -1U; + sip->si_arch = AUDIT_ARCH_X86_64; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGSYS" + ", si_code=SYS_SECCOMP, si_errno=ENOENT, si_call_addr=%p" + ", si_syscall=%u, si_arch=AUDIT_ARCH_X86_64})" + " = %s\n", + (unsigned) pid, bad_request, sip->si_call_addr, sip->si_syscall, + errstr); + + sip->si_errno = 3141592653U; + sip->si_call_addr = NULL; + sip->si_syscall = __NR_read; + sip->si_arch = 0xda7a1057; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGSYS" + ", si_code=SYS_SECCOMP, si_errno=%d, si_call_addr=NULL" + ", si_syscall=__NR_read, si_arch=%#x /* AUDIT_ARCH_??? */})" + " = %s\n", + (unsigned) pid, bad_request, sip->si_errno, sip->si_arch, + errstr); +#endif + +#if defined HAVE_SIGINFO_T_SI_TIMERID && defined HAVE_SIGINFO_T_SI_OVERRUN + memset(sip, -1, sizeof(*sip)); + sip->si_signo = SIGHUP; + sip->si_code = SI_TIMER; + sip->si_errno = ENOENT; + sip->si_timerid = 0xdeadbeef; + sip->si_overrun = -1; + sip->si_ptr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; + + do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGHUP" + ", si_code=SI_TIMER, si_errno=ENOENT, si_timerid=%#x" + ", si_overrun=%d, si_value={int=%d, ptr=%p}}) = %s\n", + (unsigned) pid, bad_request, sip->si_timerid, sip->si_overrun, + sip->si_int, sip->si_ptr, errstr); +#endif + + do_ptrace(PTRACE_GETSIGINFO, pid, bad_request, (unsigned long) sip); + printf("ptrace(PTRACE_GETSIGINFO, %u, %#lx, %p)" + " = %s\n", (unsigned) pid, bad_request, sip, errstr); + + do_ptrace(PTRACE_CONT, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_CONT, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_DETACH, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_DETACH, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_SYSCALL, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SYSCALL, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); + +#ifdef PTRACE_SINGLESTEP + do_ptrace(PTRACE_SINGLESTEP, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_SINGLESTEP, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); +#endif + +#ifdef PTRACE_SINGLEBLOCK + do_ptrace(PTRACE_SINGLEBLOCK, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SINGLEBLOCK, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); +#endif + +#ifdef PTRACE_SYSEMU + do_ptrace(PTRACE_SYSEMU, pid, 0, SIGUSR2); + printf("ptrace(PTRACE_SYSEMU, %u, NULL, SIGUSR2) = %s\n", + (unsigned) pid, errstr); +#endif +#ifdef PTRACE_SYSEMU_SINGLESTEP + do_ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, SIGUSR1); + printf("ptrace(PTRACE_SYSEMU_SINGLESTEP, %u, NULL, SIGUSR1) = %s\n", + (unsigned) pid, errstr); +#endif + + do_ptrace(PTRACE_SETOPTIONS, + pid, 0, PTRACE_O_TRACEFORK|PTRACE_O_TRACECLONE); + printf("ptrace(PTRACE_SETOPTIONS, %u, NULL" + ", PTRACE_O_TRACEFORK|PTRACE_O_TRACECLONE) = %s\n", + (unsigned) pid, errstr); + + do_ptrace(PTRACE_SEIZE, pid, bad_request, PTRACE_O_TRACESYSGOOD); + printf("ptrace(PTRACE_SEIZE, %u, %#lx, PTRACE_O_TRACESYSGOOD) = %s\n", + (unsigned) pid, bad_request, errstr); + + do_ptrace(PTRACE_SETREGSET, pid, 1, bad_request); + printf("ptrace(PTRACE_SETREGSET, %u, NT_PRSTATUS, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + do_ptrace(PTRACE_GETREGSET, pid, 3, bad_request); + printf("ptrace(PTRACE_GETREGSET, %u, NT_PRPSINFO, %#lx) = %s\n", + (unsigned) pid, bad_request, errstr); + + test_peeksiginfo(pid, bad_request); + + do_ptrace(PTRACE_TRACEME, 0, 0, 0); + printf("ptrace(PTRACE_TRACEME) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") + +#endif diff --git a/tests/ptrace.test b/tests/ptrace.test new file mode 100755 index 00000000..5add9be4 --- /dev/null +++ b/tests/ptrace.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ptrace syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e signal=none diff --git a/tests/ptrace_setoptions.test b/tests/ptrace_setoptions.test deleted file mode 100755 index e574e24a..00000000 --- a/tests/ptrace_setoptions.test +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# Ensure that strace tests kernel PTRACE_O_TRACECLONE -# and PTRACE_O_TRACESYSGOOD support properly. - -. "${srcdir=.}/init.sh" - -[ "$(uname -s)" = Linux ] || - skip_ 'The kernel is not a Linux kernel' -case "$(uname -r)" in - 2.[6-9]*|2.[1-5][0-9]*|[3-9].*|[12][0-9]*) ;; - *) skip_ 'The kernel is not Linux 2.6.* or newer' ;; -esac - -$STRACE -df -enone / > /dev/null 2> $LOG -grep -F -x 'ptrace_setoptions = 0xe' $LOG > /dev/null || { - cat $LOG - fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACECLONE support' -} - -grep -F -x 'ptrace_setoptions = 0x1f' $LOG > /dev/null || { - cat $LOG - fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support' -} - -$STRACE -d -enone / > /dev/null 2> $LOG -grep -F -x 'ptrace_setoptions = 0x11' $LOG > /dev/null || { - cat $LOG - fail_ 'strace failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support' -} diff --git a/tests/pwritev.c b/tests/pwritev.c new file mode 100644 index 00000000..58e5b41e --- /dev/null +++ b/tests/pwritev.c @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_PWRITEV + +# include +# include +# include +# include + +# define LEN 8 +# define LIM (LEN - 1) + +static void +print_iov(const struct iovec *iov) +{ + unsigned int i; + unsigned char *buf = iov->iov_base; + + fputs("{iov_base=\"", stdout); + for (i = 0; i < iov->iov_len; ++i) { + if (i < LIM) + printf("\\%d", (int) buf[i]); + } + printf("\"%s, iov_len=%u}", + i > LIM ? "..." : "", (unsigned) iov->iov_len); +} + +static void +print_iovec(const struct iovec *iov, unsigned int cnt, unsigned int size) +{ + if (!size) { + printf("%p", iov); + return; + } + unsigned int i; + putchar('['); + for (i = 0; i < cnt; ++i) { + if (i) + fputs(", ", stdout); + if (i == size) { + printf("%p", &iov[i]); + break; + } + if (i == LIM) { + fputs("...", stdout); + break; + } + print_iov(&iov[i]); + } + putchar(']'); +} + +int +main(void) +{ + (void) close(0); + if (open("/dev/null", O_WRONLY)) + perror_msg_and_fail("open"); + + char *buf = tail_alloc(LEN); + unsigned i; + for (i = 0; i < LEN; ++i) + buf[i] = i; + + struct iovec *iov = tail_alloc(sizeof(*iov) * LEN); + for (i = 0; i < LEN; ++i) { + buf[i] = i; + iov[i].iov_base = &buf[i]; + iov[i].iov_len = LEN - i; + } + + const off_t offset = 0xdefaceddeadbeefLL; + long rc; + int written = 0; + for (i = 0; i < LEN; ++i) { + written += iov[i].iov_len; + if (pwritev(0, iov, i + 1, offset + i) != written) + perror_msg_and_fail("pwritev"); + fputs("pwritev(0, ", stdout); + print_iovec(iov, i + 1, LEN); + printf(", %u, %lld) = %d\n", + i + 1, (long long) offset + i, written); + } + + for (i = 0; i <= LEN; ++i) { + unsigned int n = LEN + 1 - i; + fputs("pwritev(0, ", stdout); + print_iovec(iov + i, n, LEN - i); + rc = pwritev(0, iov + i, n, offset + LEN + i); + printf(", %u, %lld) = %ld %s (%m)\n", + n, (long long) offset + LEN + i, rc, errno2name()); + } + + iov->iov_base = iov + LEN * 2; + rc = pwritev(0, iov, 1, -1); + printf("pwritev(0, [{iov_base=%p, iov_len=%d}], 1, -1) = %ld %s (%m)\n", + iov->iov_base, LEN, rc, errno2name()); + + iov += LEN; + rc = pwritev(0, iov, 42, -2); + printf("pwritev(0, %p, 42, -2) = %ld %s (%m)\n", + iov, rc, errno2name()); + + rc = pwritev(0, NULL, 1, -3); + printf("pwritev(0, NULL, 1, -3) = %ld %s (%m)\n", + rc, errno2name()); + + rc = pwritev(0, iov, 0, -4); + printf("pwritev(0, [], 0, -4) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PWRITEV") + +#endif diff --git a/tests/pwritev.test b/tests/pwritev.test new file mode 100755 index 00000000..0aed6835 --- /dev/null +++ b/tests/pwritev.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check pwritev syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s7 diff --git a/tests/qual_fault-exit_group.expected b/tests/qual_fault-exit_group.expected new file mode 100644 index 00000000..dd9d4e46 --- /dev/null +++ b/tests/qual_fault-exit_group.expected @@ -0,0 +1,3 @@ +exit_group(42) = -1 ENOSYS (Function not implemented) (INJECTED) +exit(42) = ? ++++ exited with 42 +++ diff --git a/tests/qual_fault-exit_group.test b/tests/qual_fault-exit_group.test new file mode 100755 index 00000000..c98ffc6e --- /dev/null +++ b/tests/qual_fault-exit_group.test @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Check decoding of fault injected exit_group syscall. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/scno_tampering.sh" + +test_with() +{ + > "$LOG" || fail_ "failed to write $LOG" + + $STRACE -o "$LOG" "$@" + rc=$? + [ $rc -eq 42 ] || + dump_log_and_fail_with "$STRACE $* failed with code $rc" + + match_diff +} + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ./answer + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ + -efault=\!process:error=1 ./answer + +test_with -eexit,exit_group -efault=all:error=ENOSYS \ + -efault=exit:error=1:when=2+ ./answer + +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ + -efault=\!desc,file,memory,process,signal,network,ipc:error=1 ./answer diff --git a/tests/qual_fault-syntax.test b/tests/qual_fault-syntax.test new file mode 100755 index 00000000..85093fc7 --- /dev/null +++ b/tests/qual_fault-syntax.test @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Check -e fault= syntax. +# +# Copyright (c) 2016=2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# +# F +# F+ +# F+S + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e fault=$* failed to handle an argument error properly" +} + +for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ + invalid_syscall_name \ + invalid_syscall_name:when=3 \ + -1 \!-1 \ + -1:when=4 \ + -2 \ + -2:when=5 \ + 32767 \!32767 \ + 32767:when=6 \ + chdir:42 \!chdir:42 \ + chdir:42:when=7 \ + chdir:invalid \ + chdir:invalid:when=8 \ + chdir:error= \ + chdir:error=:when=10 \ + chdir:error=invalid_error_name \ + chdir:error=invalid_error_name:when=11 \ + chdir:error=-1 \ + chdir:error=-1:when=12 \ + chdir:error=-2 \ + chdir:error=-2:when=13 \ + chdir:error=3+ \ + chdir:error=3+:when=14 \ + chdir:error=4096 \ + chdir:error=4096:when=15 \ + chdir:when=7:error=invalid_error_name \ + chdir:when= \ + chdir:when=:error=19 \ + chdir:when=0 \ + chdir:when=0:error=20 \ + chdir:when=-1 \ + chdir:when=-1:error=21 \ + chdir:when=-2+ \ + chdir:when=-2+:error=22 \ + chdir:when=-3+0 \ + chdir:when=-3+0:error=23 \ + chdir:when=4- \ + chdir:when=4-:error=24 \ + chdir:when=5+- \ + chdir:when=5+-:error=25 \ + chdir:when=6++ \ + chdir:when=6++:error=26 \ + chdir:when=7+0 \ + chdir:when=7+0:error=27 \ + chdir:when=8+-1 \ + chdir:when=8+-1:error=28 \ + chdir:when=9+1+ \ + chdir:when=9+1+:error=29 \ + chdir:when=65536 \ + chdir:when=65536:error=30 \ + chdir:when=1+65536 \ + chdir:when=1+65536:error=31 \ + file,nonsense \ + \!desc,nonsense \ + chdir,nonsense \ + \!chdir,nonsense \ + 1,nonsense \ + \!1,nonsense \ + chdir:retval=0 \ + chdir:signal=1 \ + chdir:error=1:error=2 \ + ; do + $STRACE -e fault="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid fault argument' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests/qual_fault.c b/tests/qual_fault.c new file mode 100644 index 00000000..d26dc7ce --- /dev/null +++ b/tests/qual_fault.c @@ -0,0 +1,148 @@ +/* + * Check that fault injection works properly. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static const int expfd = 4; +static const int gotfd = 5; + +#define DEFAULT_ERRNO ENOSYS + +static const char *errstr; +static int is_raw, err, first, step, iter, try; + +static void +invoke(int fail) +{ + static char buf[sizeof(int) * 3 + 3]; + const struct iovec io = { + .iov_base = buf, + .iov_len = sprintf(buf, "%d.", ++try) + }; + int rc; + + if (!fail) { + rc = write(expfd, io.iov_base, io.iov_len); + if (rc != (int) io.iov_len) + perror_msg_and_fail("write"); + } + + errno = 0; + rc = writev(gotfd, &io, 1); + + if (fail) { + if (!(rc == -1 && errno == err)) + perror_msg_and_fail("expected errno %d" + ", got rc == %d, errno == %d", + err, rc, errno); + + if (is_raw) + tprintf("writev(%#x, %p, 0x1) = -1 (errno %d)" + " (INJECTED)\n", gotfd, &io, err); + else + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" + " = -1 %s (%m) (INJECTED)\n", + gotfd, buf, (int) io.iov_len, errstr); + } else { + if (rc != (int) io.iov_len) + perror_msg_and_fail("expected %d" + ", got rc == %d, errno == %d", + (int) io.iov_len, rc, errno); + + if (is_raw) + tprintf("writev(%#x, %p, 0x1) = %#x\n", gotfd, &io, rc); + else + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" + " = %d\n", + gotfd, buf, (int) io.iov_len, (int) io.iov_len); + } +} + +int +main(int argc, char *argv[]) +{ + struct stat st; + + assert(fstat(expfd, &st) == 0); + assert(fstat(gotfd, &st) == 0); + + assert(argc == 6); + + is_raw = !strcmp("raw", argv[1]); + + errstr = argv[2]; + err = atoi(errstr); + assert(err >= 0); + + if (!err) { + if (!*errstr) + err = DEFAULT_ERRNO; + else if (!strcasecmp(errstr, "EINVAL")) + err = EINVAL; + else + err = ENOSYS; + } + + errno = err; + errstr = errno2name(); + + first = atoi(argv[3]); + step = atoi(argv[4]); + iter = atoi(argv[5]); + + assert(first > 0); + assert(step >= 0); + + tprintf("%s", ""); + + int i; + for (i = 1; i <= iter; ++i) { + int fail = 0; + if (first > 0) { + --first; + if (first == 0) { + fail = 1; + first = step; + } + } + invoke(fail); + } + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests/qual_fault.test b/tests/qual_fault.test new file mode 100755 index 00000000..e194a787 --- /dev/null +++ b/tests/qual_fault.test @@ -0,0 +1,104 @@ +#!/bin/sh +# +# Check that fault injection works properly. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/scno_tampering.sh" + +# +# F +# F+ +# F+S + +N=16 + +check_fault_injection() +{ + local trace fault err first step extra + trace=$1; shift + fault=$1; shift + err=$1; shift + first=$1; shift + step=$1; shift + extra="$*" + + local when= + if [ -z "$first$step" ]; then + first=1 + step=1 + else + case "$step" in + '') when=":when=$first"; step=0 ;; + +) when=":when=$first+"; step=1 ;; + *) when=":when=$first+$step" ;; + esac + fi + + local error= + local raw=reg + set -- + case "$err" in + '') ;; + [123456789]*) + error=":error=$err" + raw=raw + set -- -e raw=all + ;; + *) error=":error=$err" ;; + esac + + outexp="$NAME.out.exp" + outgot="$NAME.out.got" + + run_strace -a11 -e trace=$trace \ + "$@" -e fault=$fault$when$error $extra \ + ./$NAME $raw "$err" "$first" "$step" $N \ + > "$EXP" 4> "$outexp" 5> "$outgot" + + match_diff "$EXP" "$LOG" + match_diff "$outexp" "$outgot" + rm -f "$EXP" "$outexp" "$outgot" +} + +for err in '' ENOSYS 22 einval; do + for fault in writev desc,51; do + check_fault_injection \ + writev $fault "$err" '' '' -efault=chdir + check_fault_injection \ + writev $fault "$err" '' '' -efault=chdir -efault=none + for F in 1 2 3 5 7 11; do + check_fault_injection \ + writev $fault "$err" $F '' + check_fault_injection \ + writev $fault "$err" $F + + for S in 1 2 3 5 7 11; do + check_fault_injection \ + writev $fault "$err" $F $S + done + done + done +done diff --git a/tests/qual_inject-error-signal.c b/tests/qual_inject-error-signal.c new file mode 100644 index 00000000..f4ccd824 --- /dev/null +++ b/tests/qual_inject-error-signal.c @@ -0,0 +1,69 @@ +/* + * Check fault injection along with signal injection. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +static struct stat before, after; + +static void +handler(int sig) +{ + if (stat(".", &after)) + syscall(__NR_exit_group, 2); + + if (before.st_dev != after.st_dev || before.st_ino != after.st_ino) + syscall(__NR_exit_group, 3); + + syscall(__NR_exit_group, 0); +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + if (stat(".", &before)) + perror_msg_and_fail("stat"); + + syscall(__NR_chdir, "."); + syscall(__NR_exit_group, 1); + return 1; +} diff --git a/tests/qual_inject-error-signal.expected b/tests/qual_inject-error-signal.expected new file mode 100644 index 00000000..24389b37 --- /dev/null +++ b/tests/qual_inject-error-signal.expected @@ -0,0 +1,4 @@ +chdir(".") = -1 ENOENT (No such file or directory) (INJECTED) +--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_KERNEL} --- +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests/qual_inject-error-signal.test b/tests/qual_inject-error-signal.test new file mode 100755 index 00000000..fcbcc398 --- /dev/null +++ b/tests/qual_inject-error-signal.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check fault injection along with signal injection. +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a12 -echdir,exit_group -einject=chdir:error=ENOENT:signal=USR1 \ + "./$NAME" +match_diff diff --git a/tests/qual_inject-retval.c b/tests/qual_inject-retval.c new file mode 100644 index 00000000..ac9801eb --- /dev/null +++ b/tests/qual_inject-retval.c @@ -0,0 +1,73 @@ +/* + * Check success injection. + * + * Copyright (c) 2017 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_chdir + +# include +# include +# include +# include +# include + +int +main(int argc, char *argv[]) +{ + assert(argc == 2); + + static const char dir[] = ".."; + struct stat before, after; + + if (stat(".", &before)) + perror_msg_and_fail("stat"); + + long rval = syscall(__NR_chdir, dir); + + if (stat(".", &after)) + perror_msg_and_fail("stat"); + + if (before.st_dev != after.st_dev || before.st_ino != after.st_ino) + error_msg_and_fail("syscall succeeded"); + if (atol(argv[1]) != rval) + error_msg_and_fail("expected retval %s, got retval %ld", + argv[1], rval); + + printf("chdir(\"%s\") = %ld (INJECTED)\n", dir, rval); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_chdir") + +#endif diff --git a/tests/qual_inject-retval.test b/tests/qual_inject-retval.test new file mode 100755 index 00000000..419030ad --- /dev/null +++ b/tests/qual_inject-retval.test @@ -0,0 +1,21 @@ +#!/bin/sh + +# Check success injection. + +. "${srcdir=.}/scno_tampering.sh" + +check_injection() +{ + local syscall rval + + syscall=chdir + rval="$1"; shift + + run_strace -a12 -e$syscall -einject="$syscall:retval=$rval" "$@" \ + ./qual_inject-retval "$rval" > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +check_injection 0 +check_injection 42 diff --git a/tests/qual_inject-signal.c b/tests/qual_inject-signal.c new file mode 100644 index 00000000..ff56a286 --- /dev/null +++ b/tests/qual_inject-signal.c @@ -0,0 +1,57 @@ +/* + * Check that signal injection works properly. + * + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +static void +handler(int sig) +{ + syscall(__NR_exit_group, 0); +} + +int +main(void) +{ + const struct sigaction act = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + syscall(__NR_chdir, "."); + syscall(__NR_exit_group, 1); + return 1; +} diff --git a/tests/qual_inject-signal.expected b/tests/qual_inject-signal.expected new file mode 100644 index 00000000..69a1d979 --- /dev/null +++ b/tests/qual_inject-signal.expected @@ -0,0 +1,4 @@ +chdir(".") = 0 +--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_KERNEL} --- +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests/qual_inject-signal.test b/tests/qual_inject-signal.test new file mode 100755 index 00000000..88002ce9 --- /dev/null +++ b/tests/qual_inject-signal.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check signal injection. +. "${srcdir=.}/init.sh" + +run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1 \ + ./$NAME +match_diff diff --git a/tests/qual_inject-syntax.test b/tests/qual_inject-syntax.test new file mode 100755 index 00000000..a9e44d74 --- /dev/null +++ b/tests/qual_inject-syntax.test @@ -0,0 +1,118 @@ +#!/bin/sh +# +# Check -e inject= syntax. +# +# Copyright (c) 2016-2017 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# +# F +# F+ +# F+S + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e inject=$* failed to handle an argument error properly" +} + +for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ + invalid_syscall_name \ + invalid_syscall_name:when=3 \ + -1 \!-1 \ + -1:when=4 \ + -2 \ + -2:when=5 \ + 32767 \!32767 \ + 32767:when=6 \ + 42 \ + chdir \ + chdir:42 \!chdir:42 \ + chdir:42:when=7 \ + chdir:invalid \ + chdir:invalid:when=8 \ + chdir:error= \ + chdir:error=:when=10 \ + chdir:error=invalid_error_name \ + chdir:error=invalid_error_name:when=11 \ + chdir:error=-1 \ + chdir:error=-1:when=12 \ + chdir:error=-2 \ + chdir:error=-2:when=13 \ + chdir:error=3+ \ + chdir:error=3+:when=14 \ + chdir:error=4096 \ + chdir:error=4096:when=15 \ + chdir:when=7:error=invalid_error_name \ + chdir:when= \ + chdir:when=:error=19 \ + chdir:when=0 \ + chdir:when=0:error=20 \ + chdir:when=-1 \ + chdir:when=-1:error=21 \ + chdir:when=-2+ \ + chdir:when=-2+:error=22 \ + chdir:when=-3+0 \ + chdir:when=-3+0:error=23 \ + chdir:when=4- \ + chdir:when=4-:error=24 \ + chdir:when=5+- \ + chdir:when=5+-:error=25 \ + chdir:when=6++ \ + chdir:when=6++:error=26 \ + chdir:when=7+0 \ + chdir:when=7+0:error=27 \ + chdir:when=8+-1 \ + chdir:when=8+-1:error=28 \ + chdir:when=9+1+ \ + chdir:when=9+1+:error=29 \ + chdir:when=65536 \ + chdir:when=65536:error=30 \ + chdir:when=1+65536 \ + chdir:when=1+65536:error=31 \ + file,nonsense \ + \!desc,nonsense \ + chdir,nonsense \ + \!chdir,nonsense \ + 1,nonsense \ + \!1,nonsense \ + chdir:retval=-1 \ + chdir:signal=0 \ + chdir:signal=129 \ + chdir:retval=0:retval=1 \ + chdir:error=1:error=2 \ + chdir:retval=0:error=1 \ + chdir:error=1:retval=0 \ + chdir:retval=0:signal=1:error=1 \ + ; do + $STRACE -e inject="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid inject argument' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests/qual_signal.c b/tests/qual_signal.c new file mode 100644 index 00000000..106dabea --- /dev/null +++ b/tests/qual_signal.c @@ -0,0 +1,82 @@ +/* + * Check how strace -e signal=set works. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static pid_t pid; +static uid_t uid; + +static void +handler(int sig) +{ +} + +static void +test_sig(int signo, const char *name) +{ + const struct sigaction act = { .sa_handler = handler }; + + if (sigaction(signo, &act, NULL)) + perror_msg_and_fail("sigaction: %d", signo); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, signo); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask: %d", signo); + + if (kill(pid, signo)) + perror_msg_and_fail("kill(%d, %d)", pid, signo); + + if (name && *name) + printf("--- %s {si_signo=%s, si_code=SI_USER" + ", si_pid=%d, si_uid=%d} ---\n", + name, name, pid, uid); +} + +int +main(int ac, const char **av) +{ + assert(ac & 1); + + pid = getpid(); + uid = geteuid(); + + int i; + for (i = 1; i < ac; i += 2) + test_sig(atoi(av[i]), av[i + 1]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/qual_signal.test b/tests/qual_signal.test new file mode 100755 index 00000000..54a37a30 --- /dev/null +++ b/tests/qual_signal.test @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Check how strace -e signal=set works. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +test_one_sig() +{ + local sigs + sigs="$1"; shift + + run_prog "./$NAME" "$@" > /dev/null + run_strace -e trace=none -e signal="$sigs" "./$NAME" "$@" > "$EXP" + match_diff "$LOG" "$EXP" + rm -f "$EXP" +} + +test_sigs() +{ + local first second sigs + first="$1"; shift + second="$1"; shift + + for sigs; do + test_one_sig "$sigs" 2 "$first" 15 "$second" + done +} + +test_sigs '' '' \ + none '!all' \ + CHLD SIGCHLD ALRM SIGALRM \ + chld sigchld alrm sigalrm \ + CHLD,SIGALRM ALRM,SIGCHLD \ + chld,sigalrm alrm,sigchld \ + 9 9,4 9,4,11 \ + 4,CHLD,11,ALRM,9 \ + '!2,15' '!INT,TERM' '!SIGINT,TERM' '!INT,SIGTERM' '!SIGTERM,SIGINT' \ + '!2,INT,TERM' '!2,SIGTERM' '!SIGINT,15' '!INT,SIGTERM,15' \ + '!2,4,15' '!15,9,2,11,4' + +test_sigs SIGINT '' \ + 2 INT SIGINT \ + CHLD,SIGINT SIGINT,SIGALRM \ + chld,sigint sigint,sigalrm \ + ALRM,2,SIGCHLD \ + '!15' '!TERM' '!SIGTERM' \ + '!15,TERM' '!SIGTERM,15,TERM' \ + '!SIGALRM,TERM' '!CHLD,SIGTERM' \ + '!ALRM,15' '!SIGCHLD,ALRM,SIGTERM,KILL' \ + '!4,15' '!15,9,11,4' + +test_sigs '' SIGTERM \ + 15 TERM SIGTERM \ + CHLD,SIGTERM SIGTERM,SIGALRM \ + chld,sigterm sigterm,sigalrm \ + ALRM,15,SIGCHLD \ + '!2' '!INT' '!SIGINT' \ + '!2,INT' '!SIGINT,2,INT' \ + '!SIGALRM,INT' '!CHLD,SIGINT' \ + '!ALRM,2' '!SIGCHLD,ALRM,SIGINT,KILL' \ + '!4,2' '!2,9,11,4' + +test_sigs SIGINT SIGTERM \ + all '!none' \ + INT,TERM SIGINT,TERM SIGTERM,INT SIGINT,SIGTERM \ + int,term sigint,term sigterm,int sigint,sigterm \ + 2,15 2,TERM SIGTERM,2 TERM,15,SIGINT,2 \ + '!CHLD' '!SIGCHLD' '!ALRM' '!SIGALRM' \ + '!CHLD,SIGALRM' '!ALRM,SIGCHLD' \ + '!9' '!9,4' '!9,4,11' '!4,CHLD,11,ALRM,9' + +fail_with() +{ + dump_log_and_fail_with \ + "strace -e signal=$* failed to handle an argument error properly" +} + +for arg in ' ' invalid_signal_name SIG -1 256 1-1 \ + 1,2,4,8,16,32,64,128,256,512,1024 9,chdir; do + $STRACE -e signal="$arg" true 2> "$LOG" && + fail_with "$arg" + LC_ALL=C grep -F 'invalid signal' < "$LOG" > /dev/null || + fail_with "$arg" +done + +exit 0 diff --git a/tests/qual_syscall.test b/tests/qual_syscall.test index 652fcdb3..f7eb06d5 100755 --- a/tests/qual_syscall.test +++ b/tests/qual_syscall.test @@ -1,25 +1,59 @@ #!/bin/sh -# Ensure that strace -e trace=set works. +# Check how strace -e abbrev=set, -e raw=set, -e trace=set, +# and -e verbose=set work. . "${srcdir=.}/init.sh" -check_prog ls -check_prog grep - -$STRACE -e execve ls > /dev/null 2> $LOG && -grep '^execve(' $LOG > /dev/null || - { cat $LOG; fail_ 'strace -e execve does not work'; } - -grep -v '^execve(' $LOG | +run_prog ./umovestr +pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0' +pattern_nonabbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' +pattern_nonverbose='execve("\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' +pattern_raw='execve(0x[[:xdigit:]]*, 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' + +check_output_mismatch() +{ + local pattern + pattern="$1"; shift + run_strace "$@" ./umovestr + LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || { + printf '%s\n%s\n' \ + 'Failed patterns of expected output:' "$pattern" + dump_log_and_fail_with "$STRACE $args output mismatch" + } +} + +check_output_mismatch "$pattern_abbrev_verbose" -e execve +LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && - { cat $LOG; fail_ 'strace -e execve does not work properly'; } - -$STRACE -e trace=process ls > /dev/null 2> $LOG && -grep '^execve(' $LOG > /dev/null || - { cat $LOG; fail_ 'strace -e trace=process does not work'; } - -grep '^open' $LOG > /dev/null && - { cat $LOG; fail_ 'strace -e trace=process does not work properly'; } + dump_log_and_fail_with "$STRACE $args unexpected output" + +check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +LC_ALL=C grep '^chdir' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +run_strace -e 42 ./umovestr +LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +for a in execve \!chdir all \!none \ + file process \!desc \!ipc \!memory \!network \!signal; do + check_output_mismatch \ + "$pattern_abbrev_verbose" -e abbrev="$a" -e execve + check_output_mismatch \ + "$pattern_raw" -a22 -e raw="$a" -e execve + check_output_mismatch \ + "$pattern_abbrev_verbose" -e verbose="$a" -e execve +done + +for a in \!execve chdir 42 \!all none \ + \!file \!process desc ipc memory network signal; do + check_output_mismatch \ + "$pattern_nonabbrev_verbose" -e abbrev="$a" -e execve + check_output_mismatch \ + "$pattern_abbrev_verbose" -e raw="$a" -e execve + check_output_mismatch \ + "$pattern_nonverbose" -a31 -e verbose="$a" -e execve +done exit 0 diff --git a/tests/quotactl-v.c b/tests/quotactl-v.c new file mode 100644 index 00000000..00139649 --- /dev/null +++ b/tests/quotactl-v.c @@ -0,0 +1,3 @@ +/* This file is part of quotactl-v strace test. */ +#define VERBOSE 1 +#include "quotactl.c" diff --git a/tests/quotactl-v.test b/tests/quotactl-v.test new file mode 100755 index 00000000..6adaf82c --- /dev/null +++ b/tests/quotactl-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check non-abbreviated decoding of quotactl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests/quotactl-xfs-v.c b/tests/quotactl-xfs-v.c new file mode 100644 index 00000000..21173d63 --- /dev/null +++ b/tests/quotactl-xfs-v.c @@ -0,0 +1,3 @@ +/* This file is part of quotactl-xfs-v strace test. */ +#define VERBOSE 1 +#include "quotactl-xfs.c" diff --git a/tests/quotactl-xfs-v.test b/tests/quotactl-xfs-v.test new file mode 100755 index 00000000..d5ffc7d6 --- /dev/null +++ b/tests/quotactl-xfs-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check non-abbreviated decoding of quotactl xfs subcommands. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests/quotactl-xfs.c b/tests/quotactl-xfs.c new file mode 100644 index 00000000..e420d1c9 --- /dev/null +++ b/tests/quotactl-xfs.c @@ -0,0 +1,354 @@ +/* + * Check decoding of quotactl xfs subcommands. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_quotactl) && \ + (defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_SYS_QUOTA_H)) && \ + defined(HAVE_LINUX_DQBLK_XFS_H) + +# include +# include +# include + +# include + +# include "quotactl.h" + +# ifndef Q_GETNEXTQUOTA +# define Q_XGETNEXTQUOTA XQM_CMD(0x9) +# endif /* !Q_GETNEXTQUOTA */ + +# ifndef Q_XGETQSTATV + +# define Q_XGETQSTATV XQM_CMD(8) +# define FS_QSTATV_VERSION1 1 + +struct fs_qfilestatv { + uint64_t qfs_ino; /* inode number */ + uint64_t qfs_nblks; /* number of BBs 512-byte-blks */ + uint32_t qfs_nextents; /* number of extents */ + uint32_t qfs_pad; /* pad for 8-byte alignment */ +}; + +struct fs_quota_statv { + int8_t qs_version; /* version for future changes */ + uint8_t qs_pad1; /* pad for 16bit alignment */ + uint16_t qs_flags; /* XFS_QUOTA_.* flags */ + uint32_t qs_incoredqs; /* number of dquots incore */ + struct fs_qfilestatv qs_uquota; /* user quota information */ + struct fs_qfilestatv qs_gquota; /* group quota information */ + struct fs_qfilestatv qs_pquota; /* project quota information */ + int32_t qs_btimelimit; /* limit for blks timer */ + int32_t qs_itimelimit; /* limit for inodes timer */ + int32_t qs_rtbtimelimit; /* limit for rt blks timer */ + uint16_t qs_bwarnlimit; /* limit for num warnings */ + uint16_t qs_iwarnlimit; /* limit for num warnings */ + uint64_t qs_pad2[8]; /* for future proofing */ +}; + +# endif /* !Q_XGETQSTATV */ + +# include "xlat.h" +# include "xlat/xfs_dqblk_flags.h" +# if VERBOSE +# include "xlat/xfs_quota_flags.h" +# endif + + +void +print_xdisk_quota(int rc, void *ptr, void *arg) +{ + struct fs_disk_quota *dq = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", dq); + return; + } + + PRINT_FIELD_D("{", dq, d_version); + printf(", d_flags="); + printflags(xfs_dqblk_flags, (uint8_t) dq->d_flags, "XFS_???_QUOTA"); + + PRINT_FIELD_X(", ", dq, d_fieldmask); + PRINT_FIELD_U(", ", dq, d_id); + PRINT_FIELD_U(", ", dq, d_blk_hardlimit); + PRINT_FIELD_U(", ", dq, d_blk_softlimit); + PRINT_FIELD_U(", ", dq, d_ino_hardlimit); + PRINT_FIELD_U(", ", dq, d_ino_softlimit); + PRINT_FIELD_U(", ", dq, d_bcount); + PRINT_FIELD_U(", ", dq, d_icount); + +# if VERBOSE + PRINT_FIELD_D(", ", dq, d_itimer); + PRINT_FIELD_D(", ", dq, d_btimer); + PRINT_FIELD_U(", ", dq, d_iwarns); + PRINT_FIELD_U(", ", dq, d_bwarns); + PRINT_FIELD_U(", ", dq, d_rtb_hardlimit); + PRINT_FIELD_U(", ", dq, d_rtb_softlimit); + PRINT_FIELD_U(", ", dq, d_rtbcount); + PRINT_FIELD_D(", ", dq, d_rtbtimer); + PRINT_FIELD_U(", ", dq, d_rtbwarns); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_xquota_stat(int rc, void *ptr, void *arg) +{ + struct fs_quota_stat *qs = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", qs); + return; + } + + PRINT_FIELD_D("{", qs, qs_version); + +# if VERBOSE + printf(", qs_flags="); + printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, ", qs, qs_incoredqs); + PRINT_FIELD_D(", ", qs, qs_btimelimit); + PRINT_FIELD_D(", ", qs, qs_itimelimit); + PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", qs, qs_iwarnlimit); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_xquota_statv(int rc, void *ptr, void *arg) +{ + struct fs_quota_statv *qs = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", qs); + return; + } + + PRINT_FIELD_D("{", qs, qs_version); + +# if VERBOSE + printf(", qs_flags="); + printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", ", qs, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, qs_pquota={", &qs->qs_pquota, qfs_ino); + PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nblks); + PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nextents); + PRINT_FIELD_D("}, ", qs, qs_btimelimit); + PRINT_FIELD_D(", ", qs, qs_itimelimit); + PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", qs, qs_iwarnlimit); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +int +main(void) +{ + char *bogus_special = (char *) tail_alloc(1) + 1; + void *bogus_addr = (char *) tail_alloc(1) + 1; + + char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; + char bogus_addr_str[sizeof(void *) * 2 + sizeof("0x")]; + char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; + + long rc; + struct fs_disk_quota *xdq = tail_alloc(sizeof(*xdq)); + struct fs_quota_stat *xqstat = tail_alloc(sizeof(*xqstat)); + struct fs_quota_statv *xqstatv = tail_alloc(sizeof(*xqstatv)); + uint32_t *flags = tail_alloc(sizeof(*flags)); + char *unterminated = tail_memdup(unterminated_data, + sizeof(unterminated_data)); + + snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", + bogus_special); + snprintf(bogus_addr_str, sizeof(bogus_addr_str), "%p", + bogus_addr); + snprintf(unterminated_str, sizeof(unterminated_str), "%p", + unterminated); + + + /* Q_XQUOTAON */ + + *flags = 0xdeadbeef; + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), flags, + "[XFS_QUOTA_UDQ_ACCT|XFS_QUOTA_UDQ_ENFD" + "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" + "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); + + rc = syscall(__NR_quotactl, QCMD(Q_XQUOTAON, 0xfacefeed), bogus_dev, + bogus_id, bogus_addr); + printf("quotactl(QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)" + ", %s, %p) = %s\n", + QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed)), + bogus_dev_str, bogus_addr, sprintrc(rc)); + + + /* Q_XQUOTAOFF */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAOFF, USRQUOTA)), + bogus_special, bogus_special_str, + bogus_addr, bogus_addr_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTAOFF, GRPQUOTA)), + ARG_STR("/dev/bogus/"), + ARG_STR(NULL)); + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + QCMD(Q_XQUOTAOFF, 3), + "QCMD(Q_XQUOTAOFF, 0x3 /* ???QUOTA */)", + ARG_STR("/dev/bogus/"), flags, + "[XFS_QUOTA_UDQ_ACCT|XFS_QUOTA_UDQ_ENFD" + "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" + "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); + + + /* Q_XGETQUOTA */ + + /* Trying our best to get successful result */ + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), getuid(), xdq, print_xdisk_quota, + (intptr_t) 1); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 2); + + + /* Q_XGETNEXTQUOTA */ + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETNEXTQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), 0, xdq, print_xdisk_quota, + (intptr_t) 1); + + + /* Q_XSETQLIM */ + + check_quota(CQF_NONE, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), + bogus_special, bogus_special_str, 0, bogus_addr); + + fill_memory_ex(xdq, sizeof(*xdq), 0x8e, 0x80); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), + bogus_dev, bogus_dev_str, 3141592653U, + xdq, print_xdisk_quota, (intptr_t) 0); + + + /* Q_XGETQSTAT */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstat, print_xquota_stat, (intptr_t) 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + unterminated, unterminated_str, + xqstat + 1, print_xquota_stat, (intptr_t) 2); + + + /* Q_XGETQSTATV */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_XGETQSTATV, GRPQUOTA)), + ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 2); + + + /* Q_XQUOTARM */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTARM, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XQUOTARM, USRQUOTA)), + unterminated, unterminated_str, flags + 1); + + *flags = 0xdeadbeef; + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_XQUOTARM, GRPQUOTA)), + ARG_STR(NULL), flags, + "[XFS_USER_QUOTA|XFS_PROJ_QUOTA" + "|XFS_GROUP_QUOTA|0xdeadbee8]"); + + + /* Q_XQUOTASYNC */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_XQUOTASYNC, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_XQUOTASYNC, 0xfff), + "QCMD(Q_XQUOTASYNC, 0xff /* ???QUOTA */)", + ARG_STR(NULL)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_quotactl && " + "(HAVE_LINUX_QUOTA_H || HAVE_SYS_QUOTA_H) && " + "HAVE_LINUX_DQBLK_XFS_H"); + +#endif diff --git a/tests/quotactl-xfs.test b/tests/quotactl-xfs.test new file mode 100755 index 00000000..404a7372 --- /dev/null +++ b/tests/quotactl-xfs.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of quotactl xfs subcommands. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=quotactl diff --git a/tests/quotactl.c b/tests/quotactl.c new file mode 100644 index 00000000..3a7c1132 --- /dev/null +++ b/tests/quotactl.c @@ -0,0 +1,320 @@ +/* + * Check decoding of quotactl syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#if defined(__NR_quotactl) && \ + (defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_SYS_QUOTA_H)) + +# include +# include +# include +# include +# include + +# include "quotactl.h" + +# ifndef HAVE_LINUX_QUOTA_H +/* Some dirty hacks in order to make sys/quota.h usable as a backup */ + +# define if_dqblk dqblk +# define if_nextdqblk nextdqblk +# define if_dqinfo dqinfo + +# endif /* !HAVE_LINUX_QUOTA_H */ + +# ifndef Q_GETNEXTQUOTA + +# define Q_GETNEXTQUOTA 0x800009 + +struct if_nextdqblk { + uint64_t dqb_bhardlimit; + uint64_t dqb_bsoftlimit; + uint64_t dqb_curspace; + uint64_t dqb_ihardlimit; + uint64_t dqb_isoftlimit; + uint64_t dqb_curinodes; + uint64_t dqb_btime; + uint64_t dqb_itime; + uint32_t dqb_valid; + uint32_t dqb_id; +}; +# endif /* !Q_GETNEXTQUOTA */ + +# include "xlat.h" +# include "xlat/quota_formats.h" +# include "xlat/if_dqblk_valid.h" +# include "xlat/if_dqinfo_flags.h" +# include "xlat/if_dqinfo_valid.h" + +void +print_dqblk(long rc, void *ptr, void *arg) +{ + struct if_dqblk *db = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", db); + return; + } + + PRINT_FIELD_U("{", db, dqb_bhardlimit); + PRINT_FIELD_U(", ", db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", db, dqb_curspace); + PRINT_FIELD_U(", ", db, dqb_ihardlimit); + PRINT_FIELD_U(", ", db, dqb_isoftlimit); + PRINT_FIELD_U(", ", db, dqb_curinodes); + +# if VERBOSE + PRINT_FIELD_U(", ", db, dqb_btime); + PRINT_FIELD_U(", ", db, dqb_itime); + + printf(", dqb_valid="); + printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); +# else + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_nextdqblk(long rc, void *ptr, void *arg) +{ + struct if_nextdqblk *db = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", db); + return; + } + + PRINT_FIELD_U("{", db, dqb_bhardlimit); + PRINT_FIELD_U(", ", db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", db, dqb_curspace); + PRINT_FIELD_U(", ", db, dqb_ihardlimit); + PRINT_FIELD_U(", ", db, dqb_isoftlimit); + PRINT_FIELD_U(", ", db, dqb_curinodes); + +# if VERBOSE + PRINT_FIELD_U(", ", db, dqb_btime); + PRINT_FIELD_U(", ", db, dqb_itime); + + printf(", dqb_valid="); + printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); + + PRINT_FIELD_U(", ", db, dqb_id); +# else + PRINT_FIELD_U(", ", db, dqb_id); + printf(", ..."); +# endif /* !VERBOSE */ + printf("}"); +} + +void +print_dqinfo(long rc, void *ptr, void *arg) +{ + struct if_dqinfo *di = ptr; + long out_arg = (long) arg; + + if (((rc != 0) && out_arg) || (out_arg > 1)) { + printf("%p", di); + return; + } + + PRINT_FIELD_U("{", di, dqi_bgrace); + PRINT_FIELD_U(", ", di, dqi_igrace); + + printf(", dqi_flags="); + printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); + printf(", dqi_valid="); + printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); + printf("}"); +} + + +int +main(void) +{ + char *bogus_special = (char *) tail_alloc(1) + 1; + void *bogus_addr = (char *) tail_alloc(1) + 1; + + char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; + char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; + + long rc; + char *unterminated = tail_memdup(unterminated_data, + sizeof(unterminated_data)); + struct if_dqblk *dqblk = tail_alloc(sizeof(*dqblk)); + struct if_dqinfo *dqinfo = tail_alloc(sizeof(*dqinfo)); + uint32_t *fmt = tail_alloc(sizeof(*fmt)); + struct if_nextdqblk *nextdqblk = tail_alloc(sizeof(*nextdqblk)); + + + snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", + bogus_special); + snprintf(unterminated_str, sizeof(unterminated_str), "%p", + unterminated); + + + /* Invalid commands */ + + rc = syscall(__NR_quotactl, bogus_cmd, bogus_special, bogus_id, + bogus_addr); + printf("quotactl(QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)" + ", %p, %u, %p) = %s\n", + QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd), + bogus_special, bogus_id, bogus_addr, sprintrc(rc)); + + rc = syscall(__NR_quotactl, 0, NULL, -1, NULL); + printf("quotactl(QCMD(0 /* Q_??? */, USRQUOTA), NULL, -1, NULL) = %s\n", + sprintrc(rc)); + + + /* Q_QUOTAON */ + + check_quota(CQF_ID_STR | CQF_ADDR_STR, + ARG_STR(QCMD(Q_QUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), ARG_STR(QFMT_VFS_OLD), + ARG_STR("/tmp/bogus/")); + + rc = syscall(__NR_quotactl, QCMD(Q_QUOTAON, 0xfacefeed), bogus_dev, + bogus_id, bogus_addr); + printf("quotactl(QCMD(Q_QUOTAON, %#x /* ???QUOTA */)" + ", %s, %#x /* QFMT_VFS_??? */, %p) = %s\n", + QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed)), + bogus_dev_str, bogus_id, bogus_addr, sprintrc(rc)); + + + /* Q_QUOTAOFF */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), + ARG_STR("/dev/bogus/")); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_QUOTAOFF, 3), "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)", + ARG_STR(NULL)); + + + /* Q_GETQUOTA */ + + /* Trying our best to get successful result */ + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), getuid(), dqblk, print_dqblk, + (intptr_t) 1); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 2); + + + /* Q_GETNEXTQUOTA */ + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), + ARG_STR("/dev/sda1"), 0, nextdqblk, print_nextdqblk, + (intptr_t) 1); + + + /* Q_SETQUOTA */ + + fill_memory(dqblk, sizeof(*dqblk)); + + check_quota(CQF_NONE, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + bogus_special, bogus_special_str, 0, bogus_addr); + + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + ARG_STR("/dev/bogus/"), 3141592653U, dqblk, print_dqblk, + (intptr_t) 0); + + + /* Q_GETINFO */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + ARG_STR("/dev/sda1"), dqinfo, print_dqinfo, (intptr_t) 1); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + bogus_special, bogus_special_str, dqinfo, + print_dqinfo, (intptr_t) 2); + + /* Q_SETINFO */ + + fill_memory(dqinfo, sizeof(*dqinfo)); + /* In order to check flag printing correctness */ + dqinfo->dqi_flags = 0xdeadabcd; + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_SETINFO, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + ARG_STR(QCMD(Q_SETINFO, USRQUOTA)), + ARG_STR("/dev/bogus/"), dqinfo, print_dqinfo, (intptr_t) 0); + + + /* Q_GETFMT */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_STR, + ARG_STR(QCMD(Q_GETFMT, PRJQUOTA)), + bogus_special, bogus_special_str, ARG_STR(NULL)); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_GETFMT, USRQUOTA)), + unterminated, unterminated_str, fmt + 1); + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt); + + + /* Q_SYNC */ + + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + ARG_STR(QCMD(Q_SYNC, USRQUOTA)), + bogus_special, bogus_special_str); + check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, + QCMD(Q_SYNC, 0xfff), "QCMD(Q_SYNC, 0xff /* ???QUOTA */)", + ARG_STR(NULL)); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_quotactl && " + "(HAVE_LINUX_QUOTA_H || HAVE_SYS_QUOTA_H)"); + +#endif diff --git a/tests/quotactl.h b/tests/quotactl.h new file mode 100644 index 00000000..31eaec58 --- /dev/null +++ b/tests/quotactl.h @@ -0,0 +1,166 @@ +/* + * Common definitions for Linux and XFS quota tests. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_QUOTACTL_H +#define STRACE_TESTS_QUOTACTL_H + +# include +# include +# include + +# ifdef HAVE_LINUX_QUOTA_H +/* Broken in CentOS 5: has extern spinlock_t dq_data_lock; declaration */ +# include +# else +# include +/* Broken in some new glibc versions: have Q_GETNEXTQUOTA definition but no + * struct nextdqblk defined. Fixed in glibc-2.24-106-g4d72808. */ +# include +# endif + +# ifndef QCMD_CMD +# define QCMD_CMD(_val) ((unsigned) (_val) >> SUBCMDSHIFT) +# endif /* !QCMD_CMD */ + +# ifndef QCMD_TYPE +# define QCMD_TYPE(_val) ((unsigned) (_val) & SUBCMDMASK) +# endif /* !QCMD_TYPE */ + +# ifndef PRJQUOTA +# define PRJQUOTA 2 +# endif + +# define PRINT_FIELD_D(prefix, where, field) \ + printf("%s%s=%lld", (prefix), #field, \ + sign_extend_unsigned_to_ll((where)->field)) + +# define PRINT_FIELD_U(prefix, where, field) \ + printf("%s%s=%llu", (prefix), #field, \ + zero_extend_signed_to_ull((where)->field)) + +# define PRINT_FIELD_X(prefix, where, field) \ + printf("%s%s=%#llx", (prefix), #field, \ + zero_extend_signed_to_ull((where)->field)) + +typedef void (*print_cb)(long rc, void *addr, void *arg); + +enum check_quotactl_flag_bits { + CQF_ID_SKIP_BIT, + CQF_ID_STR_BIT, + CQF_ADDR_SKIP_BIT, + CQF_ADDR_STR_BIT, + CQF_ADDR_CB_BIT, +}; + +enum check_quotactl_flags { + CQF_NONE, + CQF_ID_SKIP = 1 << CQF_ID_SKIP_BIT, + CQF_ID_STR = 1 << CQF_ID_STR_BIT, + CQF_ADDR_SKIP = 1 << CQF_ADDR_SKIP_BIT, + CQF_ADDR_STR = 1 << CQF_ADDR_STR_BIT, + CQF_ADDR_CB = 1 << CQF_ADDR_CB_BIT, +}; + + +static inline void +check_quota(uint32_t flags, int cmd, const char *cmd_str, + const char *special, const char *special_str, ...) +{ + long rc; + const char *addr_str = NULL; + const char *id_str = NULL; + void *addr = NULL; + print_cb addr_cb = NULL; + void *addr_cb_arg = NULL; + uint32_t id = -1; + + va_list ap; + + va_start(ap, special_str); + + if (!(flags & CQF_ID_SKIP)) { + id = va_arg(ap, uint32_t); + + if (flags & CQF_ID_STR) + id_str = va_arg(ap, const char *); + } + + if (!(flags & CQF_ADDR_SKIP)) { + addr = va_arg(ap, void *); + + if (flags & CQF_ADDR_CB) { + addr_cb = va_arg(ap, print_cb); + addr_cb_arg = va_arg(ap, void *); + } else if (flags & CQF_ADDR_STR) { + addr_str = va_arg(ap, const char *); + } + } + + va_end(ap); + + rc = syscall(__NR_quotactl, cmd, special, id, addr); + printf("quotactl(%s, %s", cmd_str, special_str); + + if (!(flags & CQF_ID_SKIP)) { + if (flags & CQF_ID_STR) { + printf(", %s", id_str); + } else { + if (id == (uint32_t)-1) + printf(", -1"); + else + printf(", %u", id); + } + } + + if (!(flags & CQF_ADDR_SKIP)) { + if (flags & CQF_ADDR_CB) { + printf(", "); + addr_cb(rc, addr, addr_cb_arg); + } else if (flags & CQF_ADDR_STR) { + printf(", %s", addr_str); + } else { + printf(", %p", addr); + } + } + + printf(") = %s\n", sprintrc(rc)); +} + + +static const int bogus_cmd = 0xbadc0ded; +static const int bogus_id = 0xca7faced; + +/* It is invalid anyway due to the slash in the end */ +static const char *bogus_dev = "/dev/bogus/"; +static const char *bogus_dev_str = "\"/dev/bogus/\""; + +static const char unterminated_data[] = { '\1', '\2', '\3' }; + +#endif /* !STRACE_TESTS_QUOTACTL_H */ diff --git a/tests/quotactl.test b/tests/quotactl.test new file mode 100755 index 00000000..d0101f46 --- /dev/null +++ b/tests/quotactl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of quotactl syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/read-write.c b/tests/read-write.c new file mode 100644 index 00000000..262e07b5 --- /dev/null +++ b/tests/read-write.c @@ -0,0 +1,224 @@ +/* + * Check decoding and dumping of read and write syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static void +dump_str(const char *str, const unsigned int len) +{ + static const char dots[16] = "................"; + unsigned int i; + + for (i = 0; i < len; i += 16) { + unsigned int n = len - i > 16 ? 16 : len - i; + const char *dump = hexdump_memdup(str + i, n); + + tprintf(" | %05x %-49s %-16.*s |\n", + i, dump, n, dots); + + free((void *) dump); + } +} + +static void +print_hex(const char *str, const unsigned int len) +{ + const unsigned char *ustr = (const unsigned char *) str; + unsigned int i; + + for (i = 0; i < len; ++i) { + unsigned int c = ustr[i]; + + switch (c) { + case '\t': + tprintf("\\t"); break; + case '\n': + tprintf("\\n"); break; + case '\v': + tprintf("\\v"); break; + case '\f': + tprintf("\\f"); break; + case '\r': + tprintf("\\r"); break; + default: + tprintf("\\%o", ustr[i]); + } + } +} + +static long +k_read(unsigned int fd, void *buf, size_t count) +{ + kernel_ulong_t kfd = (kernel_ulong_t) 0xfacefeed00000000ULL | fd; + return syscall(__NR_read, kfd, buf, count); +} + +static long +k_write(unsigned int fd, const void *buf, size_t count) +{ + kernel_ulong_t kfd = (kernel_ulong_t) 0xfacefeed00000000ULL | fd; + return syscall(__NR_write, kfd, buf, count); +} + +static void +test_dump(const unsigned int len) +{ + static char *buf; + + if (buf) { + size_t ps1 = get_page_size() - 1; + buf = (void *) (((size_t) buf + ps1) & ~ps1) - len; + } else { + buf = tail_alloc(len); + } + + long rc = k_read(0, buf, len); + if (rc != (int) len) + perror_msg_and_fail("read: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "read", 0); + print_hex(buf, len); + tprintf("\", %d) = %ld\n", len, rc); + dump_str(buf, len); + + unsigned int i; + for (i = 0; i < len; ++i) + buf[i] = i; + + rc = k_write(1, buf, len); + if (rc != (int) len) + perror_msg_and_fail("write: expected %d, returned %ld", + len, rc); + + tprintf("%s(%d, \"", "write", 1); + print_hex(buf, len); + tprintf("\", %d) = %ld\n", len, rc); + dump_str(buf, len); + + if (!len) + buf = 0; +} + +int +main(void) +{ + tprintf("%s", ""); + + static char tmp[] = "read-write-tmpfile"; + if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) + perror_msg_and_fail("creat: %s", tmp); + if (open(tmp, O_WRONLY) != 1) + perror_msg_and_fail("open: %s", tmp); + + static const char w_c[] = "0123456789abcde"; + const unsigned int w_len = LENGTH_OF(w_c); + const char *w_d = hexdump_strdup(w_c); + const void *w = tail_memdup(w_c, w_len); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + const unsigned int r0_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r0_len); + + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + const unsigned int r1_len = w_len - r0_len; + void *r1 = tail_alloc(w_len); + + void *efault = r1 - get_page_size(); + + long rc; + + rc = k_write(1, w, 0); + if (rc) + perror_msg_and_fail("write: expected 0, returned %ld", rc); + tprintf("write(1, \"\", 0) = 0\n"); + + rc = k_write(1, efault, 1); + if (rc != -1) + perror_msg_and_fail("write: expected -1 EFAULT" + ", returned %ld", rc); + tprintf("write(1, %p, 1) = -1 EFAULT (%m)\n", efault); + + rc = k_write(1, w, w_len); + if (rc != (int) w_len) + perror_msg_and_fail("write: expected %u, returned %ld", + w_len, rc); + tprintf("write(1, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + w_c, w_len, rc, w_d, w_c); + close(1); + + rc = k_read(0, r0, 0); + if (rc) + perror_msg_and_fail("read: expected 0, returned %ld", rc); + tprintf("read(0, \"\", 0) = 0\n"); + + rc = k_read(0, efault, 1); + if (rc != -1) + perror_msg_and_fail("read: expected -1, returned %ld", rc); + tprintf("read(0, %p, 1) = -1 EFAULT (%m)\n", efault); + + rc = k_read(0, r0, r0_len); + if (rc != (int) r0_len) + perror_msg_and_fail("read: expected %u, returned %ld", + r0_len, rc); + tprintf("read(0, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r0_c, r0_len, rc, r0_d, r0_c); + + rc = k_read(0, r1, w_len); + if (rc != (int) r1_len) + perror_msg_and_fail("read: expected %u, returned %ld", + r1_len, rc); + tprintf("read(0, \"%s\", %u) = %ld\n" + " | 00000 %-49s %-16s |\n", + r1_c, w_len, rc, r1_d, r1_c); + close(0); + + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 1) + perror_msg_and_fail("open"); + + unsigned int i; + for (i = 0; i <= 32; ++i) + test_dump(i); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/read-write.test b/tests/read-write.test new file mode 100755 index 00000000..3700541f --- /dev/null +++ b/tests/read-write.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check decoding and dumping of read and write syscalls. + +. "${srcdir=.}/init.sh" + +# strace -P is implemented using /proc/self/fd +[ -d /proc/self/fd/ ] || + framework_skip_ '/proc/self/fd/ is not available' + +tmpfile=read-write-tmpfile +> $tmpfile + +run_strace_match_diff \ + -a15 -eread=0 -ewrite=1 -e trace=read,write \ + -P $tmpfile -P /dev/zero -P /dev/null + +rm -f $tmpfile diff --git a/tests/readahead.c b/tests/readahead.c new file mode 100644 index 00000000..c11b577d --- /dev/null +++ b/tests/readahead.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef HAVE_READAHEAD +/* Check for glibc readahead argument passing bugs. */ +# ifdef __GLIBC__ +/* + * glibc < 2.8 had an incorrect order of higher and lower parts of offset, + * see https://sourceware.org/bugzilla/show_bug.cgi?id=5208 + */ +# if !(defined __GLIBC_MINOR__ && \ + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) +# undef HAVE_READAHEAD +# endif /* glibc < 2.8 */ +/* + * glibc < 2.25 had an incorrect implementation on mips n64, + * see https://sourceware.org/bugzilla/show_bug.cgi?id=21026 + */ +# if defined LINUX_MIPSN64 && !(defined __GLIBC_MINOR__ && \ + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) +# undef HAVE_READAHEAD +# endif /* LINUX_MIPSN64 && glibc < 2.25 */ +# endif /* __GLIBC__ */ +#endif /* HAVE_READAHEAD */ + +#ifdef HAVE_READAHEAD + +# include +# include + +static const int fds[] = { + -0x80000000, + -100, + -1, + 0, + 1, + 2, + 0x7fffffff, +}; + +static const off64_t offsets[] = { + -0x8000000000000000LL, + -0x5060708090a0b0c0LL, + -1LL, + 0, + 1, + 0xbadfaced, + 0x7fffffffffffffffLL, +}; + +static const unsigned long counts[] = { + 0UL, + 0xdeadca75, + (unsigned long) 0xface1e55beeff00dULL, + (unsigned long) 0xffffffffffffffffULL, +}; + +int +main(void) +{ + unsigned i; + unsigned j; + unsigned k; + ssize_t rc; + + for (i = 0; i < ARRAY_SIZE(fds); i++) + for (j = 0; j < ARRAY_SIZE(offsets); j++) + for (k = 0; k < ARRAY_SIZE(counts); k++) { + rc = readahead(fds[i], offsets[j], counts[k]); + + printf("readahead(%d, %lld, %lu) = %s\n", + fds[i], (long long) offsets[j], + counts[k], sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_READAHEAD") + +#endif diff --git a/tests/readahead.test b/tests/readahead.test new file mode 100755 index 00000000..397c6903 --- /dev/null +++ b/tests/readahead.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check readahead syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests/readdir.c b/tests/readdir.c new file mode 100644 index 00000000..8c483620 --- /dev/null +++ b/tests/readdir.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readdir + +# include +# include +# include +# include +# include +# include +# include + +static const char fname[] = + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" + "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; +static const char qname[] = + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" + "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; + +int +main(int ac, const char **av) +{ + char *dname; + struct { + unsigned long d_ino; + unsigned long d_off; + unsigned short d_reclen; + char d_name[1024]; + } e; + int rc; + + assert(ac == 1); + assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); + assert(!mkdir(dname, 0700)); + assert(!chdir(dname)); + (void) close(0); + assert(!creat(fname, 0600)); + assert(!close(0)); + assert(!open(".", O_RDONLY | O_DIRECTORY)); + while ((rc = syscall(__NR_readdir, 0, &e, 1))) { + if (rc < 0) + perror_msg_and_skip("readdir"); + e.d_name[e.d_reclen] = '\0'; + printf("readdir(0, {d_ino=%lu, d_off=%lu, d_reclen=%u" + ", d_name=\"%s\"}) = %d\n", + e.d_ino, e.d_off, e.d_reclen, + e.d_name[0] == '.' ? e.d_name : qname, rc); + } + printf("readdir(0, %p) = 0\n", &e); + puts("+++ exited with 0 +++"); + assert(!unlink(fname)); + assert(!chdir("..")); + assert(!rmdir(dname)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readdir") + +#endif diff --git a/tests/readdir.test b/tests/readdir.test new file mode 100755 index 00000000..e3132737 --- /dev/null +++ b/tests/readdir.test @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check readdir syscall decoding. + +. "${srcdir=.}/init.sh" + +rm -rf -- "$LOG".dir +run_strace_match_diff -a16 diff --git a/tests/readlink.c b/tests/readlink.c new file mode 100644 index 00000000..4ddf5fac --- /dev/null +++ b/tests/readlink.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readlink + +# include +# include + +# define PREFIX "test.readlink" +# define TARGET (PREFIX ".target") +# define LINKPATH (PREFIX ".link") + +int +main(void) +{ + const char * const fname = tail_memdup(LINKPATH, sizeof(LINKPATH)); + const char * const hex_fname = + hexquote_strndup(fname, sizeof(LINKPATH) - 1); + + const unsigned int size = sizeof(TARGET) - 1; + char * const buf = tail_alloc(size); + + (void) unlink(fname); + + long rc = syscall(__NR_readlink, fname, buf, size); + printf("readlink(\"%s\", %p, %u) = -1 ENOENT (%m)\n", + hex_fname, buf, size); + + if (symlink(TARGET, fname)) + perror_msg_and_fail("symlink"); + + rc = syscall(__NR_readlink, fname, buf, size); + if (rc < 0) { + perror("readlink"); + (void) unlink(fname); + return 77; + } + const char * const hex_buf = hexquote_strndup(buf, size); + printf("readlink(\"%s\", \"%s\", %u) = %u\n", + hex_fname, hex_buf, size, size); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readlink") + +#endif diff --git a/tests/readlink.test b/tests/readlink.test new file mode 100755 index 00000000..c026ecbe --- /dev/null +++ b/tests/readlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check readlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests/readlinkat.c b/tests/readlinkat.c new file mode 100644 index 00000000..4d3b516c --- /dev/null +++ b/tests/readlinkat.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_readlinkat + +# include +# include + +# define PREFIX "test.readlinkat" +# define TARGET (PREFIX ".target") +# define LINKPATH (PREFIX ".link") + +int +main(void) +{ + const char * const fname = tail_memdup(LINKPATH, sizeof(LINKPATH)); + const char * const hex_fname = + hexquote_strndup(fname, sizeof(LINKPATH) - 1); + + const unsigned int size = sizeof(TARGET) - 1; + char * const buf = tail_alloc(size); + + (void) unlink(fname); + + long rc = syscall(__NR_readlinkat, -100, fname, buf, size); + printf("readlinkat(AT_FDCWD, \"%s\", %p, %u) = -1 ENOENT (%m)\n", + hex_fname, buf, size); + + if (symlink(TARGET, fname)) + perror_msg_and_fail("symlink"); + + rc = syscall(__NR_readlinkat, -100, fname, buf, size); + if (rc < 0) { + perror("readlinkat"); + (void) unlink(fname); + return 77; + } + const char * const hex_buf = hexquote_strndup(buf, size); + printf("readlinkat(AT_FDCWD, \"%s\", \"%s\", %u) = %u\n", + hex_fname, hex_buf, size, size); + + if (unlink(fname)) + perror_msg_and_fail("unlink"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_readlink") + +#endif diff --git a/tests/readlinkat.test b/tests/readlinkat.test new file mode 100755 index 00000000..229c8e1e --- /dev/null +++ b/tests/readlinkat.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check readlinkat syscall decoding. + +. "${srcdir=.}/readlink.test" diff --git a/tests/readv.c b/tests/readv.c new file mode 100644 index 00000000..0e5aab65 --- /dev/null +++ b/tests/readv.c @@ -0,0 +1,157 @@ +/* + * Check decoding of readv and writev syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + pipe_maxfd(fds); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + const void *efault = w0 + LENGTH_OF(w0_c); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + long rc; + + rc = writev(fds[1], efault, 42); + tprintf("writev(%d, %p, 42) = %ld %s (%m)\n", + fds[1], efault, rc, errno2name()); + + rc = readv(fds[0], efault, 42); + tprintf("readv(%d, %p, 42) = %ld %s (%m)\n", + fds[0], efault, rc, errno2name()); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + + tprintf("writev(%d, [], 0) = %ld\n", + fds[1], (long) writev(fds[1], w_iov, 0)); + + rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, %p], 2)" + " = %ld %s (%m)\n", + fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), + rc, errno2name()); + + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + assert(writev(fds[1], w_iov, ARRAY_SIZE(w_iov_)) == (int) w_len); + close(fds[1]); + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + fds[1], w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + const struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + assert(readv(fds[0], r_iov, ARRAY_SIZE(r0_iov_)) == (int) r_len); + tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + fds[0], + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + + assert(readv(fds[0], r_iov, ARRAY_SIZE(r1_iov_)) == (int) w_len - (int) r_len); + tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"\", iov_len=%u}], %u) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + fds[0], r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(fds[0]); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/readv.test b/tests/readv.test new file mode 100755 index 00000000..dc187996 --- /dev/null +++ b/tests/readv.test @@ -0,0 +1,65 @@ +#!/bin/sh +# +# Check decoding and dumping of readv and writev syscalls. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread=all -ewrite='!none' +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread='!none' -ewrite=all +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread=none -ewrite='!all' -eread='!0,1,2' -ewrite='!0,1,2' +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread='!all' -ewrite=none -eread='!0,1,2' -ewrite='!0,1,2' + +wfd="$(./print_maxfd)" +rfd="$(($wfd - 1))" +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="$rfd" -ewrite="$wfd" +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="!$rfd" -ewrite="!$wfd" -eread="$rfd" -ewrite="$wfd" + +rfds='!!!0' +[ $rfd -lt 1023 ] || rfd=1023 +i=0 +while [ $i -lt $rfd ]; do + rfds="$rfds,$i" + i=$(($i + 1)) +done + +wfds='!!!0' +[ $wfd -lt 1023 ] || wfd=1023 +i=0 +while [ $i -lt $wfd ]; do + wfds="$wfds,$i" + i=$(($i + 1)) +done + +run_strace_match_diff -a16 -e trace=readv,writev \ + -eread="$rfds" -ewrite="$wfds" diff --git a/tests/reboot.c b/tests/reboot.c new file mode 100644 index 00000000..9b09e647 --- /dev/null +++ b/tests/reboot.c @@ -0,0 +1,37 @@ +#include "tests.h" +#include + +#ifdef __NR_reboot + +# include +# include +# include + +# define INVALID_MAGIC 319887762 +# define INVALID_CMD 0x01234568 + +int +main(void) +{ + static const char buf[] = "reboot"; + long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ + INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); + printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */," + " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n", + INVALID_MAGIC, buf, rc, errno2name()); + + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ + LINUX_REBOOT_MAGIC2, INVALID_CMD); + printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2," + " %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n", + INVALID_CMD, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_reboot") + +#endif diff --git a/tests/reboot.test b/tests/reboot.test new file mode 100755 index 00000000..a97dd21a --- /dev/null +++ b/tests/reboot.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check reboot syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/recvfrom.c b/tests/recvfrom.c new file mode 100644 index 00000000..b12454d2 --- /dev/null +++ b/tests/recvfrom.c @@ -0,0 +1,89 @@ +/* + * Check decoding of sockaddr related arguments of recvfrom syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define TEST_SYSCALL_NAME recvfrom +#define TEST_SYSCALL_PREPARE send_un() +#define PREFIX_S_ARGS , recv_buf, 1, 0 +#define PREFIX_S_STR ", \"A\", 1, 0" +#define PREFIX_F_ARGS , 0, 1, 0 +#define PREFIX_F_STR ", NULL, 1, 0" +static void send_un(void); +static char recv_buf[1]; +#include "sockname.c" + +static int cfd; + +static void +send_un(void) +{ + if (send(cfd, "A", 1, 0) != 1) + perror_msg_and_skip("send"); +} + +int +main(void) +{ + cfd = socket(AF_UNIX, SOCK_STREAM, 0); + int lfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd < 0 || lfd < 0) + perror_msg_and_skip("socket"); + + struct sockaddr_un un = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET ".send" + }; + + (void) unlink(un.sun_path); + if (bind(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + (void) unlink(un.sun_path); + + un.sun_path[sizeof(TEST_SOCKET) - 1] = '\0'; + (void) unlink(un.sun_path); + + if (bind(lfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("bind"); + + if (listen(lfd, 1)) + perror_msg_and_skip("listen"); + + if (connect(cfd, (const void *) &un, sizeof(un))) + perror_msg_and_skip("connect"); + + int afd = accept(lfd, 0, 0); + if (afd < 0) + perror_msg_and_skip("accept"); + + (void) unlink(un.sun_path); + + test_sockname_syscall(afd); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/recvfrom.test b/tests/recvfrom.test new file mode 100755 index 00000000..9dfbc898 --- /dev/null +++ b/tests/recvfrom.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sockaddr related arguments of recvfrom syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/recvmmsg-timeout.c b/tests/recvmmsg-timeout.c new file mode 100644 index 00000000..7cf064db --- /dev/null +++ b/tests/recvmmsg-timeout.c @@ -0,0 +1,71 @@ +/* + * Check decoding of timeout argument of recvmmsg syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#include "msghdr.h" + +int +main(void) +{ + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + + if (send(fds[1], "A", 1, 0) != 1) + perror_msg_and_skip("send"); + + char buf; + struct iovec iov = { .iov_base = &buf, .iov_len = sizeof(buf) }; + struct mmsghdr mh = { + .msg_hdr = { + .msg_iov = &iov, + .msg_iovlen = 1 + } + }; + struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + + int rc = recv_mmsg(-1, &mh, 1, 0, &t); + printf("recvmmsg(-1, %p, 1, 0, {tv_sec=0, tv_nsec=12345678})" + " = %d %s (%m)\n", &mh, rc, errno2name()); + + rc = recv_mmsg(fds[0], &mh, 1, 0, &t); + if (rc < 0) + perror_msg_and_skip("recvmmsg"); + printf("recvmmsg(%d, [{msg_hdr={msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"A\", iov_len=1}], msg_iovlen=1" + ", msg_controllen=0, msg_flags=0}, msg_len=1}], 1, 0" + ", {tv_sec=0, tv_nsec=12345678}) = " + "%d (left {tv_sec=0, tv_nsec=%d})\n", + fds[0], rc, (int) t.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/recvmmsg-timeout.test b/tests/recvmmsg-timeout.test new file mode 100755 index 00000000..36a12221 --- /dev/null +++ b/tests/recvmmsg-timeout.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of timeout argument of recvmmsg syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests/recvmsg.c b/tests/recvmsg.c new file mode 100644 index 00000000..fa41a9d4 --- /dev/null +++ b/tests/recvmsg.c @@ -0,0 +1,160 @@ +/* + * Check decoding of recvmsg and sendmsg syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + perror_msg_and_skip("socketpair"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + static const char r0_c[] = "01234567"; + const char *r0_d = hexdump_strdup(r0_c); + static const char r1_c[] = "89abcde"; + const char *r1_d = hexdump_strdup(r1_c); + + const struct iovec w_iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + struct iovec *w_iov = tail_memdup(w_iov_, sizeof(w_iov_)); + const unsigned int w_len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + const struct msghdr w_mh_ = { + .msg_iov = w_iov, + .msg_iovlen = ARRAY_SIZE(w_iov_) + }; + const struct msghdr *w_mh = tail_memdup(&w_mh_, sizeof(w_mh_)); + + assert(sendmsg(1, w_mh, 0) == (int) w_len); + close(1); + tprintf("sendmsg(1, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}, {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), + w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), + ARRAY_SIZE(w_iov_), w_len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, + LENGTH_OF(w2_c), w2_d, w2_c); + + const unsigned int r_len = (w_len + 1) / 2; + void *r0 = tail_alloc(r_len); + const struct iovec r0_iov_[] = { + { + .iov_base = r0, + .iov_len = r_len + } + }; + struct iovec *r_iov = tail_memdup(r0_iov_, sizeof(r0_iov_)); + + const struct msghdr r_mh_ = { + .msg_iov = r_iov, + .msg_iovlen = ARRAY_SIZE(r0_iov_) + }; + struct msghdr *r_mh = tail_memdup(&r_mh_, sizeof(r_mh_)); + + assert(recvmsg(0, r_mh, 0) == (int) r_len); + tprintf("recvmsg(0, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=%u" + ", msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + + void *r1 = tail_alloc(r_len); + void *r2 = tail_alloc(w_len); + const struct iovec r1_iov_[] = { + { + .iov_base = r1, + .iov_len = r_len + }, + { + .iov_base = r2, + .iov_len = w_len + } + }; + r_iov = tail_memdup(r1_iov_, sizeof(r1_iov_)); + r_mh->msg_iov = r_iov; + r_mh->msg_iovlen = ARRAY_SIZE(r1_iov_); + + assert(recvmsg(0, r_mh, 0) == (int) w_len - (int) r_len); + tprintf("recvmsg(0, {msg_name=NULL, msg_namelen=0, msg_iov=" + "[{iov_base=\"%s\", iov_len=%u}, {iov_base=\"\", iov_len=%u}]" + ", msg_iovlen=%u, msg_controllen=0, msg_flags=0}, 0) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n", + r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, + w_len - r_len, r1_d, r1_c); + close(0); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/recvmsg.test b/tests/recvmsg.test new file mode 100755 index 00000000..e373a20a --- /dev/null +++ b/tests/recvmsg.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of recvmsg and sendmsg syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests/redirect-fds.c b/tests/redirect-fds.c new file mode 100644 index 00000000..fc1073a7 --- /dev/null +++ b/tests/redirect-fds.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +#define N_FDS 3 + +/* + * Do not print any messages, indicate errors with return codes. + */ +static int +check_fd(int fd, const char *fname) +{ + const int should_be_closed = (fname[0] == '\0'); + + struct stat st_fd, st_fn; + + if (fstat(fd, &st_fd)) { + if (!should_be_closed) + return 10 + fd; + } else { + if (should_be_closed) + return 20 + fd; + + if (stat(fname, &st_fn)) + return 30 + fd; + + if (st_fd.st_dev != st_fn.st_dev + || st_fd.st_ino != st_fn.st_ino) + return 40 + fd; + } + + return 0; +} + +int +main(int ac, char **av) +{ + assert(ac == 1 + N_FDS); + + int rc = 0, fd; + for (fd = 1; fd < 1 + N_FDS; ++fd) + if ((rc = check_fd(fd - 1, av[fd]))) + break; + + return rc; +} diff --git a/tests/redirect-fds.test b/tests/redirect-fds.test new file mode 100755 index 00000000..ddef8fab --- /dev/null +++ b/tests/redirect-fds.test @@ -0,0 +1,71 @@ +#!/bin/sh +# +# Check that strace does not leak placeholder descriptors. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +case "$STRACE" in + *valgrind\ *--suppressions=*) + skip_ 'incompatible with valgrind' ;; +esac + +fd0="$LOG.fd0" +fd1="$LOG.fd1" +fd2="$LOG.fd2" + +check_prog touch + +check_fd() +{ + local a1 a2 a3 + a1="$1" + a2="$2" + a3="$3" + + touch "$LOG" "$fd0" || + framework_skip_ 'failed to create files' + + set -- "\"./$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" + eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || + fail_ "$* failed with code $rc" + + set -- "$STRACE" -o"$LOG" -echdir "$@" + eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || + dump_log_and_fail_with "$* failed with code $?" + + rm -f "$LOG" "$fd0" "$fd1" "$fd2" +} + +check_fd "$fd0" "$fd1" "$fd2" +check_fd '' "$fd1" "$fd2" +check_fd "$fd0" '' "$fd2" +check_fd "$fd0" "$fd1" '' +check_fd '' '' "$fd2" +check_fd '' "$fd1" '' +check_fd "$fd0" '' '' +check_fd '' '' '' diff --git a/tests/redirect.test b/tests/redirect.test new file mode 100755 index 00000000..fa0c5369 --- /dev/null +++ b/tests/redirect.test @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Ensure that strace does not retain stdin and stdout descriptors. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +check_prog sleep +check_prog yes + +> "$OUT" +> "$LOG" +( + while [ -f "$LOG" ]; do + : + done + $SLEEP_A_BIT & + yes + if kill -0 $! 2> /dev/null; then + wait + else + echo TIMEOUT >> "$OUT" + fi +) | $STRACE -qq -enone -esignal=none \ + sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT" + +if [ -s "$OUT" ]; then + fail_ "$STRACE failed to redirect standard input" +fi + +> "$LOG" +$STRACE -qq -enone -esignal=none \ + sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT" | +( + while [ -f "$LOG" ]; do + : + done + $SLEEP_A_BIT & + cat > /dev/null + if kill -0 $! 2> /dev/null; then + wait + else + echo TIMEOUT >> "$OUT" + fi +) + +if [ -s "$OUT" ]; then + fail_ "$STRACE failed to redirect standard output" +fi + +rm -f -- "$OUT" diff --git a/tests/remap_file_pages.c b/tests/remap_file_pages.c new file mode 100644 index 00000000..452d2de7 --- /dev/null +++ b/tests/remap_file_pages.c @@ -0,0 +1,61 @@ +/* + * Check decoding of remap_file_pages syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_remap_file_pages + +# include +# include +# include + +int +main(void) +{ + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long size = (unsigned long) 0xdefaced1bad2f00dULL; + const unsigned long prot = PROT_READ|PROT_WRITE|PROT_EXEC; + const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deedULL; + const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS; + + long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags); + printf("remap_file_pages(%#lx, %lu, %s, %lu, %s) = %ld %s (%m)\n", + addr, size, "PROT_READ|PROT_WRITE|PROT_EXEC", pgoff, + "MAP_PRIVATE|MAP_ANONYMOUS", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_remap_file_pages") + +#endif diff --git a/tests/remap_file_pages.test b/tests/remap_file_pages.test new file mode 100755 index 00000000..9d51a9a0 --- /dev/null +++ b/tests/remap_file_pages.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check remap_file_pages syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/rename.c b/tests/rename.c new file mode 100644 index 00000000..2a2a4e01 --- /dev/null +++ b/tests/rename.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_rename + +# include +# include + +# define OLD_FILE "rename_old" +# define NEW_FILE "rename_new" + +int +main(void) +{ + long rc = syscall(__NR_rename, OLD_FILE, NEW_FILE); + printf("rename(\"%s\", \"%s\") = %ld %s (%m)\n", + OLD_FILE, NEW_FILE, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rename") + +#endif diff --git a/tests/rename.test b/tests/rename.test new file mode 100755 index 00000000..9067e4cc --- /dev/null +++ b/tests/rename.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rename syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/renameat.c b/tests/renameat.c new file mode 100644 index 00000000..2b874efa --- /dev/null +++ b/tests/renameat.c @@ -0,0 +1,31 @@ +#include "tests.h" +#include + +#ifdef __NR_renameat + +# include +# include + +# define OLD_FILE "renameat_old" +# define NEW_FILE "renameat_new" + +int +main(void) +{ + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; + + long rc = syscall(__NR_renameat, fd_old, OLD_FILE, fd_new, NEW_FILE); + printf("renameat(%d, \"%s\", %d, \"%s\") = %ld %s (%m)\n", + (int) fd_old, OLD_FILE, (int) fd_new, NEW_FILE, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_renameat") + +#endif diff --git a/tests/renameat.test b/tests/renameat.test new file mode 100755 index 00000000..9b0a61dd --- /dev/null +++ b/tests/renameat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check renameat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/renameat2.c b/tests/renameat2.c new file mode 100644 index 00000000..33f88988 --- /dev/null +++ b/tests/renameat2.c @@ -0,0 +1,63 @@ +/* + * Check decoding of renameat2 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include "scno.h" + +#ifdef __NR_renameat2 + +# include +# include + +int +main(void) +{ + static const char oldpath[] = "renameat2_oldpath"; + static const char newpath[] = "renameat2_newpath"; + const unsigned long olddirfd = + (unsigned long) 0xfacefeedffffffff; + const unsigned long newdirfd = + (unsigned long) 0xfacefeed00000000 | -100U; + + long rc = syscall(__NR_renameat2, + olddirfd, oldpath, newdirfd, newpath, 1); + printf("renameat2(%d, \"%s\", AT_FDCWD, \"%s\", RENAME_NOREPLACE)" + " = %ld %s (%m)\n", + (int) olddirfd, oldpath, newpath, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_renameat2") + +#endif diff --git a/tests/renameat2.test b/tests/renameat2.test new file mode 100755 index 00000000..4c176bbd --- /dev/null +++ b/tests/renameat2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check renameat2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/request_key.c b/tests/request_key.c new file mode 100644 index 00000000..fea977b2 --- /dev/null +++ b/tests/request_key.c @@ -0,0 +1,149 @@ +/* + * Check decoding of request_key syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_request_key + +# include +# include +# include + +void +print_val_str(const void *ptr, const char *str) +{ + if (str) + printf("%s, ", str); + else + printf("%p, ", ptr); +} + +void +do_request_key(const char *type, const char *type_str, const char *desc, + const char *desc_str, const char *info, const char *info_str, + int32_t keyring, const char *keyring_str) +{ + long rc = syscall(__NR_request_key, type, desc, info, keyring); + const char *errstr = sprintrc(rc); + printf("request_key("); + print_val_str(type, type_str); + print_val_str(desc, desc_str); + print_val_str(info, info_str); + if (keyring_str) + printf("%s", keyring_str); + else + printf("%d", keyring); + printf(") = %s\n", errstr); +} + +int +main(void) +{ + static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; + static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; + static const char unterminated3[] = + { '\16', '\17', '\20', '\21', '\22' }; + + char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); + char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); + char *bogus_info = tail_memdup(unterminated3, sizeof(unterminated3)); + + unsigned i; + unsigned j; + unsigned k; + unsigned l; + + struct { + const char *type; + const char *str; + } types[] = { + { ARG_STR(NULL) }, + { bogus_type + sizeof(unterminated1), NULL }, + { bogus_type, NULL }, + { ARG_STR("\20\21\22\23\24") }, + { ARG_STR("user") }, + }; + + struct { + const char *desc; + const char *str; + } descs[] = { + { ARG_STR(NULL) }, + { bogus_desc + sizeof(unterminated2), NULL }, + { bogus_desc, NULL }, + { ARG_STR("\25\26\27\30\31") }, + { ARG_STR("desc") }, + { "overly long description", _STR("overly long ") "..." }, + }; + + struct { + const char *info; + const char *str; + } infos[] = { + { ARG_STR(NULL) }, + { bogus_info + sizeof(unterminated3), NULL }, + { bogus_info, NULL }, + { ARG_STR("\32\33\34\35\36") }, + { ARG_STR("info") }, + { "overly long info", _STR("overly long ") "..." }, + }; + + struct { + uint32_t keyring; + const char *str; + } keyrings[] = { + { ARG_STR(0) }, + { ARG_STR(1234567890) }, + { ARG_STR(-1234567890) }, + { -1, "KEY_SPEC_THREAD_KEYRING" }, + }; + + for (i = 0; i < ARRAY_SIZE(types); i++) + for (j = 0; j < ARRAY_SIZE(descs); j++) + for (k = 0; k < ARRAY_SIZE(infos); k++) + for (l = 0; l < ARRAY_SIZE(keyrings); l++) + do_request_key( + types[i].type, types[i].str, + descs[j].desc, descs[j].str, + infos[k].info, infos[k].str, + keyrings[l].keyring, + keyrings[l].str); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_request_key"); + +#endif diff --git a/tests/request_key.test b/tests/request_key.test new file mode 100755 index 00000000..9812a18e --- /dev/null +++ b/tests/request_key.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of request_key syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -s12 diff --git a/tests/restart_syscall.c b/tests/restart_syscall.c new file mode 100644 index 00000000..e492e62e --- /dev/null +++ b/tests/restart_syscall.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int +main(void) +{ +#if defined __x86_64__ && defined __ILP32__ + /* + * x32 is broken from the beginning: + * https://lkml.org/lkml/2015/11/30/790 + */ + error_msg_and_skip("x32 is broken"); +#else + const sigset_t set = {}; + const struct sigaction act = { .sa_handler = SIG_IGN }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + struct timespec req = { .tv_nsec = 222222222 }, rem; + + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); + if (setitimer(ITIMER_REAL, &itv, NULL)) + perror_msg_and_skip("setitimer"); + if (nanosleep(&req, &rem)) + perror_msg_and_fail("nanosleep"); + + printf("nanosleep\\(\\{tv_sec=%jd, tv_nsec=%jd\\}, " + "\\{tv_sec=%jd, tv_nsec=%jd\\}\\)" + " = \\? ERESTART_RESTARTBLOCK \\(Interrupted by signal\\)\n", + (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, + (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec); + puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---"); +#ifdef __arm__ +/* old kernels used to overwrite ARM_r0 with -EINTR */ +# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|" +#else +# define ALTERNATIVE_NANOSLEEP_REQ "" +#endif + printf("(nanosleep\\((%s\\{tv_sec=%jd, tv_nsec=%jd\\}), " + "%p|restart_syscall\\(<\\.\\.\\." + " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n", + ALTERNATIVE_NANOSLEEP_REQ, + (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem); + + puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); + return 0; +#endif +} diff --git a/tests/restart_syscall.test b/tests/restart_syscall.test new file mode 100755 index 00000000..6dfda168 --- /dev/null +++ b/tests/restart_syscall.test @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check how "resuming interrupted nanosleep" works. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +syscalls=nanosleep,restart_syscall +run_strace -a20 -e trace=$syscalls $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests/rmdir.c b/tests/rmdir.c new file mode 100644 index 00000000..20952d84 --- /dev/null +++ b/tests/rmdir.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_rmdir + +# include +# include + +int +main(void) +{ + static const char sample[] = "rmdir_sample"; + long rc = syscall(__NR_rmdir, sample); + printf("rmdir(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rmdir") + +#endif diff --git a/tests/rmdir.test b/tests/rmdir.test new file mode 100755 index 00000000..81ee66b8 --- /dev/null +++ b/tests/rmdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rmdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/rt_sigpending.c b/tests/rt_sigpending.c new file mode 100644 index 00000000..accf6913 --- /dev/null +++ b/tests/rt_sigpending.c @@ -0,0 +1,128 @@ +/* + * This file is part of rt_sigpending strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigpending + +# include +# include +# include +# include +# include + +static long +k_sigpending(void *const set, const unsigned long size) +{ + return syscall(__NR_rt_sigpending, set, size); +} + +static void +iterate(const char *const text, unsigned int size, void *set) +{ + for (;;) { + if (k_sigpending(set, size)) { + tprintf("rt_sigpending(%p, %u) = -1 EFAULT (%m)\n", + set, size); + break; + } + if (size) { +#if WORDS_BIGENDIAN + if (size < sizeof(long)) + tprintf("rt_sigpending(%s, %u) = 0\n", + "[]", size); + else +#endif + tprintf("rt_sigpending(%s, %u) = 0\n", + text, size); + } else { + tprintf("rt_sigpending(%p, %u) = 0\n", set, size); + break; + } + size >>= 1; + set += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + + sigemptyset(libc_set); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + memset(k_set, 0, big_size); + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + if (!k_sigpending(k_set, set_size)) + break; + tprintf("rt_sigpending(%p, %u) = -1 EINVAL (%m)\n", + k_set, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigpending"); + tprintf("rt_sigpending(%s, %u) = 0\n", "[]", set_size); + + iterate("[]", set_size >> 1, k_set + (set_size >> 1)); + + void *const efault = k_set + (set_size >> 1); + assert(k_sigpending(efault, set_size) == -1); + tprintf("rt_sigpending(%p, %u) = -1 EFAULT (%m)\n", + efault, set_size); + + sigaddset(libc_set, SIGHUP); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGHUP); + + iterate("[HUP]", set_size, k_set); + + sigaddset(libc_set, SIGINT); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGINT); + + iterate("[HUP INT]", set_size, k_set); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigpending") + +#endif diff --git a/tests/rt_sigpending.test b/tests/rt_sigpending.test new file mode 100755 index 00000000..40c83a81 --- /dev/null +++ b/tests/rt_sigpending.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigpending syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/rt_sigprocmask.c b/tests/rt_sigprocmask.c new file mode 100644 index 00000000..27e357fa --- /dev/null +++ b/tests/rt_sigprocmask.c @@ -0,0 +1,174 @@ +/* + * This file is part of rt_sigprocmask strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigprocmask + +# include +# include +# include +# include +# include + +static long +k_sigprocmask(const unsigned long how, void *const new_set, + void *const old_set, const unsigned long size) +{ + return syscall(__NR_rt_sigprocmask, how, new_set, old_set, size); +} + +static void +iterate(const char *const text, void *set, void *old, unsigned int size) +{ + for (;;) { + if (k_sigprocmask(SIG_UNBLOCK, set, old, size)) { + if (size < sizeof(long)) + tprintf("rt_sigprocmask(SIG_UNBLOCK" + ", %p, %p, %u) = -1 EINVAL (%m)\n", + set, old, size); + else + tprintf("rt_sigprocmask(SIG_UNBLOCK" + ", %s, %p, %u) = -1 EINVAL (%m)\n", + text, old, size); + } else { + tprintf("rt_sigprocmask(SIG_UNBLOCK, %s, [], %u)" + " = 0\n", text, size); + } + if (!size) + break; + size >>= 1; + set += size; + old += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + unsigned int set_size; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!k_sigprocmask(SIG_SETMASK, NULL, NULL, set_size)) + break; + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, NULL, %u)" + " = -1 EINVAL (%m)\n", set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, NULL, %u) = 0\n", + set_size); + + void *const k_set = tail_alloc(set_size); + void *const old_set = tail_alloc(set_size); + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + + memset(k_set, 0, set_size); + if (k_sigprocmask(SIG_SETMASK, k_set, NULL, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, [], NULL, %u) = 0\n", set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set - set_size, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[], [], %u) = 0\n", set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set - set_size, + old_set, set_size << 1) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %p, %p, %u) = -1 EINVAL (%m)\n", + k_set - set_size, old_set, set_size << 1); + + iterate("~[]", k_set - set_size, old_set, set_size >> 1); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_BLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_BLOCK, [HUP], [], %u) = 0\n", set_size); + + memset(libc_set, -1, sizeof(sigset_t)); + sigdelset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[HUP], [HUP], %u) = 0\n", + set_size); + + sigdelset(libc_set, SIGKILL); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_UNBLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_UNBLOCK, ~[HUP KILL], [HUP], %u) = 0\n", + set_size); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + sigaddset(libc_set, SIGINT); + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(k_set, libc_set, set_size); + + if (k_sigprocmask(SIG_BLOCK, k_set, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_BLOCK, %s, [HUP], %u) = 0\n", + "[HUP INT QUIT ALRM TERM]", set_size); + + if (k_sigprocmask(SIG_SETMASK, NULL, old_set, set_size)) + perror_msg_and_fail("rt_sigprocmask"); + tprintf("rt_sigprocmask(SIG_SETMASK, NULL, %s, %u) = 0\n", + "[HUP INT QUIT ALRM TERM]", set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set + (set_size >> 1), NULL, + set_size) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %p, NULL, %u) = -1 EFAULT (%m)\n", + k_set + (set_size >> 1), set_size); + + assert(k_sigprocmask(SIG_SETMASK, k_set, old_set + (set_size >> 1), + set_size) == -1); + tprintf("rt_sigprocmask(SIG_SETMASK, %s, %p, %u) = -1 EFAULT (%m)\n", + "[HUP INT QUIT ALRM TERM]", + old_set + (set_size >> 1), set_size); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") + +#endif diff --git a/tests/rt_sigprocmask.test b/tests/rt_sigprocmask.test new file mode 100755 index 00000000..1e60ebde --- /dev/null +++ b/tests/rt_sigprocmask.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigprocmask syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/rt_sigqueueinfo.c b/tests/rt_sigqueueinfo.c new file mode 100644 index 00000000..aba6776c --- /dev/null +++ b/tests/rt_sigqueueinfo.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015 Elvira Khabirova + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main (void) +{ + struct sigaction sa = { + .sa_handler = SIG_IGN + }; + union sigval value = { + .sival_ptr = (void *) (unsigned long) 0xdeadbeefbadc0dedULL + }; + pid_t pid = getpid(); + + assert(sigaction(SIGUSR1, &sa, NULL) == 0); + if (sigqueue(pid, SIGUSR1, value)) + perror_msg_and_skip("sigqueue"); + printf("rt_sigqueueinfo(%u, SIGUSR1, {si_signo=SIGUSR1, " + "si_code=SI_QUEUE, si_pid=%u, si_uid=%u, " + "si_value={int=%d, ptr=%p}}) = 0\n", + pid, pid, getuid(), value.sival_int, value.sival_ptr); + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests/rt_sigqueueinfo.test b/tests/rt_sigqueueinfo.test new file mode 100755 index 00000000..c03c76f2 --- /dev/null +++ b/tests/rt_sigqueueinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of rt_sigqueueinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/rt_sigsuspend.c b/tests/rt_sigsuspend.c new file mode 100644 index 00000000..73e13364 --- /dev/null +++ b/tests/rt_sigsuspend.c @@ -0,0 +1,165 @@ +/* + * This file is part of rt_sigsuspend strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigsuspend + +# include +# include +# include +# include +# include +# include +# include + +static long +k_sigsuspend(const sigset_t *const set, const unsigned long size) +{ + return syscall(__NR_rt_sigsuspend, set, size); +} + +static void +iterate(const char *const text, const int sig, + const void *const set, unsigned int size) +{ + const void *mask; + + for (mask = set;; size >>= 1, mask += size) { + raise(sig); + assert(k_sigsuspend(mask, size) == -1); + if (EINTR == errno) { + tprintf("rt_sigsuspend(%s, %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", + text, size); + } else { + if (size < sizeof(long)) + tprintf("rt_sigsuspend(%p, %u)" + " = -1 EINVAL (%m)\n", + mask, size); + else + tprintf("rt_sigsuspend(%s, %u)" + " = -1 EINVAL (%m)\n", + set == mask ? text : "~[]", size); + } + if (!size) + break; + } +} + +static void +handler(int signo) +{ +} + +int +main(void) +{ + tprintf("%s", ""); + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + memset(k_set, 0, big_size); + + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + sigemptyset(libc_set); + sigaddset(libc_set, SIGUSR1); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct sigaction sa = { + .sa_handler = handler + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGUSR1); + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + assert(k_sigsuspend(k_set, set_size) == -1); + if (EINTR == errno) + break; + tprintf("rt_sigsuspend(%p, %u) = -1 EINVAL (%m)\n", + k_set, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigsuspend"); + tprintf("rt_sigsuspend([], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGUSR2); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([HUP USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + sigaddset(libc_set, SIGINT); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend([HUP INT USR2], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + memset(libc_set, -1, sizeof(*libc_set)); + sigdelset(libc_set, SIGUSR1); + memcpy(k_set, libc_set, set_size); + raise(SIGUSR1); + assert(k_sigsuspend(k_set, set_size) == -1); + assert(EINTR == errno); + tprintf("rt_sigsuspend(~[USR1], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", set_size); + + assert(k_sigsuspend(k_set - set_size, set_size << 1) == -1); + tprintf("rt_sigsuspend(%p, %u) = -1 EINVAL (%m)\n", + k_set - set_size, set_size << 1); + + iterate("~[USR1]", SIGUSR1, k_set, set_size >> 1); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigsuspend") + +#endif diff --git a/tests/rt_sigsuspend.test b/tests/rt_sigsuspend.test new file mode 100755 index 00000000..2e30fd4b --- /dev/null +++ b/tests/rt_sigsuspend.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigsuspend syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -esignal=none diff --git a/tests/rt_sigtimedwait.c b/tests/rt_sigtimedwait.c new file mode 100644 index 00000000..10311e6e --- /dev/null +++ b/tests/rt_sigtimedwait.c @@ -0,0 +1,185 @@ +/* + * This file is part of rt_sigtimedwait strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_sigtimedwait + +# include +# include +# include +# include +# include +# include +# include + +static long +k_sigtimedwait(const sigset_t *const set, siginfo_t *const info, + const struct timespec *const timeout, const unsigned long size) +{ + return syscall(__NR_rt_sigtimedwait, set, info, timeout, size); +} + +static void +iterate(const char *const text, const void *set, + const struct timespec *const timeout, unsigned int size) +{ + for (;;) { + assert(k_sigtimedwait(set, NULL, timeout, size) == -1); + if (EINTR == errno) { + tprintf("rt_sigtimedwait(%s, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EAGAIN (%m)\n", text, + (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, + size); + } else { + if (size < sizeof(long)) + tprintf("rt_sigtimedwait(%p, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}" + ", %u) = -1 EINVAL (%m)\n", + set, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, size); + else + tprintf("rt_sigtimedwait(%s, NULL, " + "{tv_sec=%jd, tv_nsec=%jd}" + ", %u) = -1 EINVAL (%m)\n", + text, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, size); + } + if (!size) + break; + size >>= 1; + set += size; + } +} + +int +main(void) +{ + tprintf("%s", ""); + + siginfo_t *const info = tail_alloc(sizeof(*info)); + struct timespec *const timeout = tail_alloc(sizeof(*timeout)); + timeout->tv_sec = 0; + timeout->tv_nsec = 42; + + const unsigned int big_size = 1024 / 8; + void *k_set = tail_alloc(big_size); + memset(k_set, 0, big_size); + + unsigned int set_size = big_size; + for (; set_size; set_size >>= 1, k_set += set_size) { + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + if (EAGAIN == errno) + break; + tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EINVAL (%m)\n", + k_set, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + } + if (!set_size) + perror_msg_and_fail("rt_sigtimedwait"); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + set_size); + + sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + sigaddset(libc_set, SIGINT); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%jd, tv_nsec=%jd}, %u)" + " = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(k_set, libc_set, set_size); + + assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + "[HUP INT QUIT ALRM TERM]", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + memset(k_set - set_size, -1, set_size); + assert(k_sigtimedwait(k_set - set_size, info, timeout, set_size) == -1); + assert(EAGAIN == errno); + tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + info, (intmax_t) timeout->tv_sec, + (intmax_t) timeout->tv_nsec, set_size); + + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + assert(k_sigtimedwait(k_set - set_size, info, NULL, set_size << 1) == -1); + tprintf("rt_sigtimedwait(%p, %p, NULL, %u) = -1 EINVAL (%m)\n", + k_set - set_size, info, set_size << 1); + + iterate("~[]", k_set - set_size, timeout, set_size >> 1); + + timeout->tv_sec = 1; + raise(SIGALRM); + assert(k_sigtimedwait(k_set, info, timeout, set_size) == SIGALRM); + tprintf("rt_sigtimedwait(%s, {si_signo=%s, si_code=SI_TKILL" + ", si_pid=%d, si_uid=%d}, {tv_sec=%jd, tv_nsec=%jd}, %u) = %d (%s)\n", + "[HUP INT QUIT ALRM TERM]", "SIGALRM", getpid(), getuid(), + (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + set_size, SIGALRM, "SIGALRM"); + + raise(SIGALRM); + assert(k_sigtimedwait(k_set, NULL, NULL, set_size) == SIGALRM); + tprintf("rt_sigtimedwait(%s, NULL, NULL, %u) = %d (%s)\n", + "[HUP INT QUIT ALRM TERM]", set_size, SIGALRM, "SIGALRM"); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigtimedwait") + +#endif diff --git a/tests/rt_sigtimedwait.test b/tests/rt_sigtimedwait.test new file mode 100755 index 00000000..e15fb779 --- /dev/null +++ b/tests/rt_sigtimedwait.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rt_sigtimedwait syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests/rt_tgsigqueueinfo.c b/tests/rt_tgsigqueueinfo.c new file mode 100644 index 00000000..ec093481 --- /dev/null +++ b/tests/rt_tgsigqueueinfo.c @@ -0,0 +1,88 @@ +/* + * This file is part of rt_tgsigqueueinfo strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_rt_tgsigqueueinfo + +# include +# include +# include +# include +# include + +static long +k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info) +{ + return syscall(__NR_rt_tgsigqueueinfo, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | sig, + info); +} + +int +main (void) +{ + const struct sigaction sa = { + .sa_handler = SIG_IGN + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + siginfo_t *const info = tail_alloc(sizeof(*info)); + memset(info, 0, sizeof(*info)); + info->si_signo = SIGUSR1; + info->si_errno = ENOENT; + info->si_code = SI_QUEUE; + info->si_pid = getpid(); + info->si_uid = getuid(); + info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL; + + if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info)) + (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)( + "rt_tgsigqueueinfo"); + + printf("rt_tgsigqueueinfo(%u, %u, %s, {si_signo=%s" + ", si_code=SI_QUEUE, si_errno=ENOENT, si_pid=%u" + ", si_uid=%u, si_value={int=%d, ptr=%p}}) = 0\n", + info->si_pid, info->si_pid, "SIGUSR1", "SIGUSR1", + info->si_pid, info->si_uid, info->si_value.sival_int, + info->si_value.sival_ptr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_tgsigqueueinfo") + +#endif diff --git a/tests/rt_tgsigqueueinfo.test b/tests/rt_tgsigqueueinfo.test new file mode 100755 index 00000000..ab24e2d6 --- /dev/null +++ b/tests/rt_tgsigqueueinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of rt_tgsigqueueinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/sched_get_priority_mxx.c b/tests/sched_get_priority_mxx.c new file mode 100644 index 00000000..fc14b27c --- /dev/null +++ b/tests/sched_get_priority_mxx.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include + +#if defined(__NR_sched_get_priority_min) \ + && defined(__NR_sched_get_priority_max) + +# include +# include +# include + +int +main(void) +{ + int rc = syscall(__NR_sched_get_priority_min, SCHED_FIFO); + printf("sched_get_priority_min(SCHED_FIFO) = %d\n", rc); + + rc = syscall(__NR_sched_get_priority_max, SCHED_RR); + printf("sched_get_priority_max(SCHED_RR) = %d\n", rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min" + " && defined __NR_sched_get_priority_max"); + +#endif diff --git a/tests/sched_get_priority_mxx.test b/tests/sched_get_priority_mxx.test new file mode 100755 index 00000000..0d1a1a78 --- /dev/null +++ b/tests/sched_get_priority_mxx.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_get_priority_min and sched_get_priority_max syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests/sched_rr_get_interval.c b/tests/sched_rr_get_interval.c new file mode 100644 index 00000000..0aacd2b7 --- /dev/null +++ b/tests/sched_rr_get_interval.c @@ -0,0 +1,42 @@ +#include "tests.h" +#include + +#ifdef __NR_sched_rr_get_interval + +# include +# include +# include +# include + +int +main(void) +{ + struct timespec *const tp = tail_alloc(sizeof(struct timespec)); + long rc; + + rc = syscall(__NR_sched_rr_get_interval, 0, NULL); + printf("sched_rr_get_interval(0, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, 0, tp + 1); + printf("sched_rr_get_interval(0, %p) = %s\n", tp + 1, sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, -1, tp); + printf("sched_rr_get_interval(-1, %p) = %s\n", tp, sprintrc(rc)); + + rc = syscall(__NR_sched_rr_get_interval, 0, tp); + if (rc == 0) + printf("sched_rr_get_interval(0, {tv_sec=%jd, tv_nsec=%jd}) = " + "0\n", (intmax_t)tp->tv_sec, (intmax_t)tp->tv_nsec); + else + printf("sched_rr_get_interval(-1, %p) = %s\n", tp, + sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_rr_get_interval") + +#endif diff --git a/tests/sched_rr_get_interval.test b/tests/sched_rr_get_interval.test new file mode 100755 index 00000000..828ba5d0 --- /dev/null +++ b/tests/sched_rr_get_interval.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_rr_get_interval syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests/sched_xetaffinity.c b/tests/sched_xetaffinity.c new file mode 100644 index 00000000..41a18202 --- /dev/null +++ b/tests/sched_xetaffinity.c @@ -0,0 +1,135 @@ +/* + * This file is part of sched_xetaffinity strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_sched_getaffinity && defined __NR_sched_setaffinity \ + && defined CPU_ISSET_S && defined CPU_ZERO_S && defined CPU_SET_S + +# include +# include +# include +# include + +static const char *errstr; + +static int +getaffinity(unsigned long pid, unsigned long size, void *set) +{ + int rc = syscall(__NR_sched_getaffinity, pid, size, set); + errstr = sprintrc(rc); + return rc; +} + +static int +setaffinity(unsigned long pid, unsigned long size, void *set) +{ + int rc = syscall(__NR_sched_setaffinity, pid, size, set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + unsigned int cpuset_size = 1; + const pid_t pid = getpid(); + + while (cpuset_size) { + assert(getaffinity(pid, cpuset_size, NULL) == -1); + if (EFAULT == errno) + break; + if (EINVAL != errno) + perror_msg_and_skip("sched_getaffinity"); + printf("sched_getaffinity(%d, %u, NULL) = %s\n", + pid, cpuset_size, errstr); + cpuset_size <<= 1; + } + assert(cpuset_size); + printf("sched_getaffinity(%d, %u, NULL) = %s\n", + pid, cpuset_size, errstr); + + cpu_set_t *cpuset = tail_alloc(cpuset_size); + getaffinity(pid, cpuset_size, cpuset + 1); + printf("sched_getaffinity(%d, %u, %p) = %s\n", + pid, cpuset_size, cpuset + 1, errstr); + + int ret_size = getaffinity(pid, cpuset_size, cpuset); + if (ret_size < 0) + perror_msg_and_fail("sched_getaffinity(%d, %u, %p) = %s\n", + pid, (unsigned) cpuset_size, cpuset, errstr); + assert(ret_size <= (int) cpuset_size); + + printf("sched_getaffinity(%d, %u, [", pid, cpuset_size); + const char *sep; + unsigned int i, cpu; + for (i = 0, cpu = 0, sep = ""; i < (unsigned) ret_size * 8; ++i) { + if (CPU_ISSET_S(i, (unsigned) ret_size, cpuset)) { + printf("%s%u", sep, i); + sep = ", "; + cpu = i; + } + } + printf("]) = %s\n", errstr); + + CPU_ZERO_S(cpuset_size, cpuset); + CPU_SET_S(cpu, cpuset_size, cpuset); + if (setaffinity(pid, cpuset_size, cpuset)) + perror_msg_and_skip("sched_setaffinity"); + printf("sched_setaffinity(%d, %u, [%u]) = 0\n", + pid, cpuset_size, cpu); + + const unsigned int big_size = cpuset_size < 128 ? 128 : cpuset_size * 2; + cpuset = tail_alloc(big_size); + ret_size = getaffinity(pid, big_size, cpuset); + if (ret_size < 0) + perror_msg_and_fail("sched_getaffinity(%d, %u, %p) = %s\n", + pid, big_size, cpuset, errstr); + assert(ret_size <= (int) big_size); + printf("sched_getaffinity(%d, %u, [", pid, big_size); + for (i = 0, sep = ""; i < (unsigned) ret_size * 8; ++i) { + if (CPU_ISSET_S(i, (unsigned) ret_size, cpuset)) { + printf("%s%u", sep, i); + sep = ", "; + } + } + printf("]) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getaffinity && __NR_sched_setaffinity" + " && CPU_ISSET_S && CPU_ZERO_S && CPU_SET_S") + +#endif diff --git a/tests/sched_xetaffinity.test b/tests/sched_xetaffinity.test new file mode 100755 index 00000000..246ea21a --- /dev/null +++ b/tests/sched_xetaffinity.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getaffinity and sched_setaffinity syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c new file mode 100644 index 00000000..1b484915 --- /dev/null +++ b/tests/sched_xetattr.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_sched_getattr && defined __NR_sched_setattr + +# include +# include +# include + +int +main(void) +{ + struct { + uint32_t size; + uint32_t sched_policy; + uint64_t sched_flags; + int32_t sched_nice; + uint32_t sched_priority; + uint64_t sched_runtime; + uint64_t sched_deadline; + uint64_t sched_period; + } *sched_attr = tail_alloc(sizeof(*sched_attr)); + + long rc = syscall(__NR_sched_getattr, 0xdeadface, NULL, 0, 0); + printf("sched_getattr\\(%d, NULL, 0, 0\\) += %s\n", + 0xdeadface, sprintrc_grep(rc)); + + rc = syscall(__NR_sched_getattr, -1, + sched_attr, 0xbadfaced, 0xc0defeed); + printf("sched_getattr\\(-1, %p, %u, %u\\) += %s\n", + sched_attr, 0xbadfaced, 0xc0defeed, sprintrc_grep(rc)); + + rc = syscall(__NR_sched_getattr, 0, + sched_attr + 1, sizeof(*sched_attr), 0); + printf("sched_getattr\\(0, %p, %u, 0\\) += %s\n", + sched_attr + 1, (unsigned)sizeof(*sched_attr), + sprintrc_grep(rc)); + + if (syscall(__NR_sched_getattr, 0, sched_attr, sizeof(*sched_attr), 0)) + perror_msg_and_skip("sched_getattr"); + + printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" + ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "\\}, %u, 0\\) += 0\n", + sched_attr->size, + sched_attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period, + (unsigned) sizeof(*sched_attr)); + + sched_attr->sched_flags |= 1; + if (syscall(__NR_sched_setattr, 0, sched_attr, 0)) + perror_msg_and_skip("sched_setattr"); + + printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" + ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n", + sched_attr->size, + "SCHED_FLAG_RESET_ON_FORK", + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period); + + sched_attr->size = 0x90807060; + sched_attr->sched_policy = 0xca7faced; + sched_attr->sched_flags = 0xbadc0ded1057da7aULL; + sched_attr->sched_nice = 0xafbfcfdf; + sched_attr->sched_priority = 0xb8c8d8e8; + sched_attr->sched_runtime = 0xbadcaffedeadf157ULL; + sched_attr->sched_deadline = 0xc0de70a57badac75ULL; + sched_attr->sched_period = 0xded1ca7edda7aca7ULL; + + rc = syscall(__NR_sched_setattr, 0xfacec0de, sched_attr, 0xbeeff00d); + + printf("sched_setattr\\(%d, \\{size=%u, " + "sched_policy=%#x /\\* SCHED_\\?\\?\\? \\*/, " + "sched_flags=%#" PRIx64 " /\\* SCHED_FLAG_\\?\\?\\? \\*/, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, " + "%u\\) += %s\n", + 0xfacec0de, sched_attr->size, + sched_attr->sched_policy, + sched_attr->sched_flags, + sched_attr->sched_nice, + sched_attr->sched_priority, + sched_attr->sched_runtime, + sched_attr->sched_deadline, + sched_attr->sched_period, 0xbeeff00d, sprintrc_grep(rc)); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getattr && __NR_sched_setattr") + +#endif diff --git a/tests/sched_xetattr.test b/tests/sched_xetattr.test new file mode 100755 index 00000000..c2c7914c --- /dev/null +++ b/tests/sched_xetattr.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check sched_getattr and sched_setattr syscalls decoding. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e sched_getattr,sched_setattr $args > "$OUT" +match_grep "$LOG" "$OUT" +rm -f "$OUT" + +exit 0 diff --git a/tests/sched_xetparam.c b/tests/sched_xetparam.c new file mode 100644 index 00000000..e761a9d0 --- /dev/null +++ b/tests/sched_xetparam.c @@ -0,0 +1,33 @@ +#include "tests.h" +#include + +#if defined __NR_sched_getparam && defined __NR_sched_setparam + +# include +# include +# include + +int +main(void) +{ + struct sched_param *const param = + tail_alloc(sizeof(struct sched_param)); + + long rc = syscall(__NR_sched_getparam, 0, param); + printf("sched_getparam(0, [%d]) = %ld\n", + param->sched_priority, rc); + + param->sched_priority = -1; + rc = syscall(__NR_sched_setparam, 0, param); + printf("sched_setparam(0, [%d]) = %ld %s (%m)\n", + param->sched_priority, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getparam && __NR_sched_setparam") + +#endif diff --git a/tests/sched_xetparam.test b/tests/sched_xetparam.test new file mode 100755 index 00000000..c9fede13 --- /dev/null +++ b/tests/sched_xetparam.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getparam and sched_setparam syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests/sched_xetscheduler.c b/tests/sched_xetscheduler.c new file mode 100644 index 00000000..7faee8cd --- /dev/null +++ b/tests/sched_xetscheduler.c @@ -0,0 +1,81 @@ +#include "tests.h" +#include + +#if defined __NR_sched_getscheduler && defined __NR_sched_setscheduler + +# include +# include +# include + +int +main(void) +{ + struct sched_param *const param = tail_alloc(sizeof(struct sched_param)); + long rc = syscall(__NR_sched_getscheduler, 0); + const char *scheduler; + switch (rc) { + case SCHED_FIFO: + scheduler = "SCHED_FIFO"; + break; + case SCHED_RR: + scheduler = "SCHED_RR"; + break; +# ifdef SCHED_BATCH + case SCHED_BATCH: + scheduler = "SCHED_BATCH"; + break; +# endif +# ifdef SCHED_IDLE + case SCHED_IDLE: + scheduler = "SCHED_IDLE"; + break; +# endif +# ifdef SCHED_ISO + case SCHED_ISO: + scheduler = "SCHED_ISO"; + break; +# endif +# ifdef SCHED_DEADLINE + case SCHED_DEADLINE: + scheduler = "SCHED_DEADLINE"; + break; +# endif + default: + scheduler = "SCHED_OTHER"; + } + printf("sched_getscheduler(0) = %ld (%s)\n", + rc, scheduler); + + rc = syscall(__NR_sched_getscheduler, -1); + printf("sched_getscheduler(-1) = %s\n", sprintrc(rc)); + + param->sched_priority = -1; + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, NULL); + printf("sched_setscheduler(0, SCHED_FIFO, NULL) = %s\n", sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param + 1); + printf("sched_setscheduler(0, SCHED_FIFO, %p) = %s\n", param + 1, + sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, 0xfaceda7a, param); + printf("sched_setscheduler(0, %#x /* SCHED_??? */, [%d]) = %s\n", + 0xfaceda7a, param->sched_priority, sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, -1, SCHED_FIFO, param); + printf("sched_setscheduler(-1, SCHED_FIFO, [%d]) = %s\n", + param->sched_priority, sprintrc(rc)); + + rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param); + printf("sched_setscheduler(0, SCHED_FIFO, [%d]) = %s\n", + param->sched_priority, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_getscheduler && __NR_sched_setscheduler") + +#endif diff --git a/tests/sched_xetscheduler.test b/tests/sched_xetscheduler.test new file mode 100755 index 00000000..07c93f31 --- /dev/null +++ b/tests/sched_xetscheduler.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_getscheduler and sched_setscheduler syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests/sched_yield.c b/tests/sched_yield.c new file mode 100644 index 00000000..355e7e8d --- /dev/null +++ b/tests/sched_yield.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_sched_yield + +# include +# include + +int +main(void) +{ + printf("sched_yield() = %ld\n", syscall(__NR_sched_yield)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_yield") + +#endif diff --git a/tests/sched_yield.test b/tests/sched_yield.test new file mode 100755 index 00000000..f0c2c303 --- /dev/null +++ b/tests/sched_yield.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_yield syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/scm_rights-fd.test b/tests/scm_rights-fd.test index 5a847dac..8447375f 100755 --- a/tests/scm_rights-fd.test +++ b/tests/scm_rights-fd.test @@ -1,6 +1,31 @@ #!/bin/sh - -# Check how SCM_RIGHTS control messages are decoded in -y mode. +# +# Check how SCM_RIGHTS and SCM_CREDENTIALS control messages are decoded in -y mode. +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . "${srcdir=.}/init.sh" @@ -8,36 +33,48 @@ [ -d /proc/self/fd/ ] || framework_skip_ '/proc/self/fd/ is not available' -check_prog grep +check_prog mkdir check_prog rm +check_prog seq +check_prog touch + +dir="$LOG.dir" +rm -rf -- "$dir" +mkdir -- "$dir" || + framework_skip_ 'failed to create a directory' + +file="$dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" + +touch -- "$file" || + framework_skip_ 'failed to create a file' -rm -f $LOG.* +run_prog ./scm_rights /dev/zero +run_strace -y -x -enetwork $args "$file" -./scm_rights || - fail_ 'scm_rights failed' +hex='[[:xdigit:]]' +n='[1-9][0-9]*' +sample="$(for i in $(seq 1 15); do printf '\\\\xf%x' $i; done)" +socket='' -args="-tt -ff -y -xx -enetwork -o $LOG ./scm_rights" -$STRACE $args || - fail_ "$STRACE $args failed" +path6='(/.*/(A\\n){127}Z|\\x2f(\\x'"$hex$hex"')*\\x2f(\\x41\\x0a){127}\\x5a)' +rights_data='\[4, 5, 6<'"$path6"'>\]' +iov='\[\{iov_base="'"$sample"'", iov_len=15\}\]' +ids='\{pid='"$n"', uid=[0-9]+, gid=[0-9]+\}' -"$srcdir"/../strace-log-merge $LOG > $LOG || { - cat $LOG - fail_ 'strace-log-merge failed' -} -rm -f $LOG.* +msg_head='\{msg_name=NULL, msg_namelen=0, msg_iov='"$iov"', msg_iovlen=1, msg_control=' +msg_tail=', msg_controllen='"$n"', msg_flags=0' +rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data='"$rights_data"'\}' +creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data='"$ids"'\}' -grep_log() -{ - local syscall="$1"; shift - local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +' +EXPECTED="$LOG.expected" - LC_ALL=C grep -E -x "$prefix$syscall$*" $LOG > /dev/null || { - cat $LOG - fail_ "$STRACE $args failed to trace \"$syscall\" properly" - } -} +cat > "$EXPECTED" << __EOF__ +sendmsg\\(3$socket, $msg_head\\[$rights\\]$msg_tail\\}, 0\\) = 15 +recvmsg\\(0$socket, $msg_head\\[$creds, $rights\\]$msg_tail\\}, 0\\) = 15 +__EOF__ -grep_log sendmsg '\(1, \{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"\\x00\\x00\\x00\\x00[^"]*", [1-9][0-9]*\}\], msg_controllen=[1-9][0-9]*, \{cmsg_len=[1-9][0-9]*, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \{3\}\}, msg_flags=0\}, 0\) += [1-9][0-9]*' -grep_log recvmsg '\(0, \{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"\\x00\\x00\\x00\\x00[^"]*", [1-9][0-9]*\}\], msg_controllen=[1-9][0-9]*, \{cmsg_len=[1-9][0-9]*, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \{3\}\}, msg_flags=0\}, 0\) += [1-9][0-9]*' +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" +rm -rf -- "$dir" exit 0 diff --git a/tests/scm_rights.c b/tests/scm_rights.c index 0cced9be..42caed7c 100644 --- a/tests/scm_rights.c +++ b/tests/scm_rights.c @@ -1,71 +1,105 @@ +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" #include -#include +#include #include +#include #include -#include -#include #include -#include -int main(void) +int main(int ac, const char **av) { - union { - struct cmsghdr cmsghdr; - char buf[CMSG_SPACE(sizeof(int))]; - } control = {}; - - int fd; - int data = 0; - struct iovec iov = { - .iov_base = &data, - .iov_len = sizeof(iov) - }; - - struct msghdr mh = { - .msg_iov = &iov, - .msg_iovlen = 1, - .msg_control = &control, - .msg_controllen = sizeof(control) - }; - - while ((fd = open("/dev/null", O_RDWR)) < 3) - assert(fd >= 0); - (void) close(3); + assert(ac > 0); + int fds[ac]; + + static const char sample[] = + "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + const unsigned int data_size = sizeof(sample) - 1; + void *data = tail_alloc(data_size); + memcpy(data, sample, data_size); + + struct iovec *iov = tail_alloc(sizeof(struct iovec)); + iov->iov_base = data; + iov->iov_len = data_size; + + struct msghdr *mh = tail_alloc(sizeof(struct msghdr)); + memset(mh, 0, sizeof(*mh)); + mh->msg_iov = iov; + mh->msg_iovlen = 1; + + int i; + while ((i = open("/dev/null", O_RDWR)) <= ac + 2) + assert(i >= 0); + while (i > 2) + assert(close(i--) == 0); + assert(close(0) == 0); int sv[2]; - assert(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0); - - pid_t pid = fork(); - assert(pid >= 0); - - if (pid) { - assert(close(sv[0]) == 0); - assert(dup2(sv[1], 1) == 1); - assert(close(sv[1]) == 0); - - assert((fd = open("/dev/null", O_RDWR)) == 3); - - struct cmsghdr *cmsg = CMSG_FIRSTHDR(&mh); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - cmsg->cmsg_len = CMSG_LEN(sizeof fd); - memcpy(CMSG_DATA(cmsg), &fd, sizeof fd); - mh.msg_controllen = cmsg->cmsg_len; - - assert(sendmsg(1, &mh, 0) == sizeof(iov)); - assert(close(1) == 0); - - int status; - assert(waitpid(pid, &status, 0) == pid); - assert(status == 0); - } else { - assert(close(sv[1]) == 0); - assert(dup2(sv[0], 0) == 0); - assert(close(sv[0]) == 0); - - assert(recvmsg(0, &mh, 0) == sizeof(iov)); - assert(close(0) == 0); + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + int one = 1; + if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one))) + perror_msg_and_skip("setsockopt"); + + assert((fds[0] = open("/dev/null", O_RDWR)) == 4); + for (i = 1; i < ac; ++i) + assert((fds[i] = open(av[i], O_RDONLY)) == i + 4); + + unsigned int cmsg_size = CMSG_SPACE(sizeof(fds)); + struct cmsghdr *cmsg = tail_alloc(cmsg_size); + memset(cmsg, 0, cmsg_size); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(fds)); + memcpy(CMSG_DATA(cmsg), fds, sizeof(fds)); + + mh->msg_control = cmsg; + mh->msg_controllen = cmsg_size; + + assert(sendmsg(sv[1], mh, 0) == (int) data_size); + + assert(close(sv[1]) == 0); + assert(open("/dev/null", O_RDWR) == sv[1]); + + for (i = 0; i < ac; ++i) { + assert(close(fds[i]) == 0); + fds[i] = 0; } + cmsg_size += CMSG_SPACE(sizeof(struct ucred)); + cmsg = tail_alloc(cmsg_size); + memset(cmsg, 0, cmsg_size); + mh->msg_control = cmsg; + mh->msg_controllen = cmsg_size; + + assert(recvmsg(0, mh, 0) == (int) data_size); + assert(close(0) == 0); + return 0; } diff --git a/tests/scno_tampering.sh b/tests/scno_tampering.sh new file mode 100755 index 00000000..6aa78432 --- /dev/null +++ b/tests/scno_tampering.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Skip the test if arch+kernel combination is not supported. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +uname_r="$(uname -r)" +case "$STRACE_ARCH" in + arm) + # PTRACE_SET_SYSCALL is supported by linux kernel + # starting with commit v2.6.16-rc1~107^2. + require_min_kernel_version_or_skip 2.6.16 ;; + aarch64) + # NT_ARM_SYSTEM_CALL regset is supported by linux kernel + # starting with commit v3.19-rc1~59^2~16. + require_min_kernel_version_or_skip 3.19 ;; + hppa) + # Syscall number and return value modification did not work + # properly before commit v4.5-rc7~31^2~1. + require_min_kernel_version_or_skip 4.5 ;; + sparc*) + # Reloading the syscall number from %g1 register is supported + # by linux kernel starting with commit v4.5-rc7~35^2~3. + require_min_kernel_version_or_skip 4.5 ;; + mips) + # Only the native ABI is supported by the kernel properly, see + # https://sourceforge.net/p/strace/mailman/message/35587571/ + uname_m="$(uname -m)" + case "$MIPS_ABI:$uname_m" in + o32:mips|n64:mips64) ;; + *) skip_ "$MIPS_ABI scno tampering does not work on $uname_m yet" ;; + esac ;; +esac diff --git a/tests/seccomp-filter-v.c b/tests/seccomp-filter-v.c new file mode 100644 index 00000000..dbf686d1 --- /dev/null +++ b/tests/seccomp-filter-v.c @@ -0,0 +1,213 @@ +/* + * Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#ifdef HAVE_PRCTL +# include +#endif +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined __NR_seccomp \ + && defined PR_SET_NO_NEW_PRIVS \ + && defined SECCOMP_SET_MODE_FILTER \ + && defined SECCOMP_RET_ERRNO \ + && defined BPF_JUMP \ + && defined BPF_STMT + +#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) + +#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) + +#define SOCK_FILTER_KILL_PROCESS \ + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) + +#define PRINT_ALLOW_SYSCALL(nr) \ + tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ + __NR_ ## nr) + +#define PRINT_DENY_SYSCALL(nr, err) \ + tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ + __NR_ ## nr, err) + +static const struct sock_filter filter_c[] = { + /* load syscall number */ + BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), + + /* allow syscalls */ + SOCK_FILTER_ALLOW_SYSCALL(close), + SOCK_FILTER_ALLOW_SYSCALL(exit), + SOCK_FILTER_ALLOW_SYSCALL(exit_group), + + /* deny syscalls */ + SOCK_FILTER_DENY_SYSCALL(sync, EBUSY), + SOCK_FILTER_DENY_SYSCALL(setsid, EPERM), + + /* kill process */ + SOCK_FILTER_KILL_PROCESS +}; + +#ifndef BPF_MAXINSNS +# define BPF_MAXINSNS 4096 +#endif + +int +main(void) +{ + tprintf("%s", ""); + + static const char kill_stmt_txt[] = + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"; + struct sock_filter *const filter = + tail_memdup(filter_c, sizeof(filter_c)); + struct sock_filter *const big_filter = + tail_alloc(sizeof(*big_filter) * (BPF_MAXINSNS + 1)); + struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + perror_msg_and_skip("PR_SET_NO_NEW_PRIVS"); + + prog->filter = filter + ARRAY_SIZE(filter_c); + prog->len = 1; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=1, filter=%p})" + " = -1 EFAULT (%m)\n", prog->filter); + + prog->filter = filter + ARRAY_SIZE(filter_c) - 1; + prog->len = 3; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u" + ", filter=[%s, %p]}) = -1 EFAULT (%m)\n", + prog->len, kill_stmt_txt, filter + ARRAY_SIZE(filter_c)); + + prog->len = 0; + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=0, filter=[]})" + " = -1 EINVAL (%m)\n"); + + unsigned int i; + for (i = 0; i <= BPF_MAXINSNS; ++i) { + const struct sock_filter stmt = + BPF_STMT(BPF_CLASS(i), i << 16); + big_filter[i] = stmt; + } + + prog->filter = big_filter; + prog->len = BPF_MAXINSNS + 1; + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=[", + "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", prog->len); + for (i = 0; i < BPF_MAXINSNS; ++i) { + if (i) + tprintf(", "); + switch(BPF_CLASS(i)) { + case BPF_LD: + tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_IMM, %#x)", i << 16); + break; + case BPF_LDX: + tprintf("BPF_STMT(BPF_LDX|BPF_W|BPF_IMM, %#x)", i << 16); + break; + case BPF_ST: + tprintf("BPF_STMT(BPF_ST, %#x)", i << 16); + break; + case BPF_STX: + tprintf("BPF_STMT(BPF_STX, %#x)", i << 16); + break; + case BPF_ALU: + tprintf("BPF_STMT(BPF_ALU|BPF_K|BPF_ADD, %#x)", i << 16); + break; + case BPF_JMP: + tprintf("BPF_STMT(BPF_JMP|BPF_K|BPF_JA, %#x)", i << 16); + break; + case BPF_RET: + tprintf("BPF_STMT(BPF_RET|BPF_K, %#x" + " /* SECCOMP_RET_??? */)", i << 16); + break; + case BPF_MISC: + tprintf("BPF_STMT(BPF_MISC|BPF_TAX, %#x)", i << 16); + break; + } + } + tprintf(", ...]})"); + syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); + tprintf(" = -1 EINVAL (%m)\n"); + + prog->filter = filter; + prog->len = ARRAY_SIZE(filter_c); + + tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u, filter=[", + prog->len); + + tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_ABS, %#x), ", + (unsigned) offsetof(struct seccomp_data, nr)); + + PRINT_ALLOW_SYSCALL(close); + PRINT_ALLOW_SYSCALL(exit); + PRINT_ALLOW_SYSCALL(exit_group); + + PRINT_DENY_SYSCALL(sync, EBUSY), + PRINT_DENY_SYSCALL(setsid, EPERM), + + tprintf("%s]}) = 0\n+++ exited with 0 +++\n", kill_stmt_txt); + + if (syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog)) + perror_msg_and_skip("SECCOMP_SET_MODE_FILTER"); + + if (close(0) || close(1)) + _exit(77); + + _exit(0); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && PR_SET_NO_NEW_PRIVS" + " && SECCOMP_SET_MODE_FILTER && SECCOMP_RET_ERRNO" + " && BPF_JUMP && BPF_STMT") + +#endif diff --git a/tests/seccomp-filter-v.test b/tests/seccomp-filter-v.test new file mode 100755 index 00000000..f873eb6f --- /dev/null +++ b/tests/seccomp-filter-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=seccomp diff --git a/tests/seccomp-filter.c b/tests/seccomp-filter.c new file mode 100644 index 00000000..d4d76dd3 --- /dev/null +++ b/tests/seccomp-filter.c @@ -0,0 +1,75 @@ +/* + * Check decoding of seccomp SECCOMP_SET_MODE_FILTER. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include + +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifdef HAVE_LINUX_FILTER_H +# include +#endif + +#if defined __NR_seccomp && defined SECCOMP_SET_MODE_FILTER + +# define N 7 + +int +main(void) +{ + struct sock_filter *const filter = tail_alloc(sizeof(*filter) * N); + const void *const efault = tail_alloc(1); + struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + long rc; + + prog->filter = filter; + prog->len = N; + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); + printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=%p})" + " = %ld %s (%m)\n", "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", + prog->len, prog->filter, rc, errno2name()); + + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -2L, efault); + printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, %p) = %ld %s (%m)\n", + "0xfffffffe /* SECCOMP_FILTER_FLAG_??? */", + efault, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && SECCOMP_SET_MODE_FILTER") + +#endif diff --git a/tests/seccomp-filter.test b/tests/seccomp-filter.test new file mode 100755 index 00000000..65c6d495 --- /dev/null +++ b/tests/seccomp-filter.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of seccomp SECCOMP_SET_MODE_FILTER. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests/seccomp-strict.c b/tests/seccomp-strict.c new file mode 100644 index 00000000..237b0eca --- /dev/null +++ b/tests/seccomp-strict.c @@ -0,0 +1,74 @@ +/* + * Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_seccomp && defined __NR_exit + +# include +# include + +int +main(void) +{ + static const char text1[] = + "seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = 0\n"; + static const char text2[] = "+++ exited with 0 +++\n"; + const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + long rc; + + rc = syscall(__NR_seccomp, -1L, -1L, addr); + printf("seccomp(%#x /* SECCOMP_SET_MODE_??? */, %u, %#llx)" + " = %s\n", -1, -1, (unsigned long long) addr, sprintrc(rc)); + fflush(stdout); + + rc = syscall(__NR_seccomp, 0, 0, 0); + if (rc) { + printf("seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = %s\n", + sprintrc(rc)); + fflush(stdout); + rc = 0; + } else { + /* + * If kernel implementaton of SECCOMP_MODE_STRICT is buggy, + * the following syscall will result to SIGKILL. + */ + rc = write(1, text1, LENGTH_OF(text1)) != LENGTH_OF(text1); + } + + rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2); + return !!syscall(__NR_exit, rc); +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp && __NR_exit") + +#endif diff --git a/tests/seccomp-strict.test b/tests/seccomp-strict.test new file mode 100755 index 00000000..b354c6a2 --- /dev/null +++ b/tests/seccomp-strict.test @@ -0,0 +1,17 @@ +#!/bin/sh + +# Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. + +. "${srcdir=.}/init.sh" + +set -- "./$NAME" +"$@" > /dev/null || { + case $? in + 77) skip_ "$* exited with code 77" ;; + 137) framework_skip_ "$* killed by SIGKILL, fix your kernel" ;; + *) fail_ "$args failed" ;; + esac +} +run_strace -eseccomp "$@" > "$EXP" +match_diff "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests/select.c b/tests/select.c new file mode 100644 index 00000000..b5ff259d --- /dev/null +++ b/tests/select.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_select && !defined __NR__newselect + +# define TEST_SYSCALL_NR __NR_select +# define TEST_SYSCALL_STR "select" +# include "xselect.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && !__NR__newselect") + +#endif diff --git a/tests/select.test b/tests/select.test new file mode 100755 index 00000000..60b88caf --- /dev/null +++ b/tests/select.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check select syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/semop.c b/tests/semop.c new file mode 100644 index 00000000..a2ff2635 --- /dev/null +++ b/tests/semop.c @@ -0,0 +1,119 @@ +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/semop_flags.h" + +union semun +{ + int val; + struct semid_ds *buf; + unsigned short *array; + struct seminfo *__buf; +}; + +static int id = -1; + +static void +cleanup(void) +{ + semctl(id, 0, IPC_RMID, 0); + id = -1; +} + +int +main(void) +{ + static const int bogus_semid = 0xfdb97531; + static void * const bogus_sops = (void *) -1L; + static const size_t bogus_nsops = (size_t) 0xdefaceddeadbeefULL; + + static const struct timespec ts_data = { 1, 123456789 }; + + struct timespec *ts = tail_memdup(&ts_data, sizeof(*ts)); + int rc; + + id = semget(IPC_PRIVATE, 1, 0600); + if (id < 0) + perror_msg_and_skip("semget"); + atexit(cleanup); + + union semun sem_union = { .val = 0 }; + if (semctl(id, 0, SETVAL, sem_union) == -1) + perror_msg_and_skip("semctl"); + + struct sembuf *const sem_b = tail_alloc(sizeof(*sem_b)); + struct sembuf *const sem_b2 = tail_alloc(sizeof(*sem_b2)); + + rc = semop(bogus_semid, NULL, bogus_nsops); + printf("semop(%d, NULL, %u) = %s\n", + bogus_semid, (unsigned) bogus_nsops, sprintrc(rc)); + + rc = semop(bogus_semid, bogus_sops, 1); + printf("semop(%d, %p, %u) = %s\n", + bogus_semid, bogus_sops, 1, sprintrc(rc)); + + sem_b->sem_num = 0; + sem_b->sem_op = 1; + sem_b->sem_flg = SEM_UNDO; + + sem_b2->sem_num = 0xface; + sem_b2->sem_op = 0xf00d; + sem_b2->sem_flg = 0xbeef; + + rc = semop(bogus_semid, sem_b2, 2); + printf("semop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u) = %s\n", + bogus_semid, sem_b2->sem_num, sem_b2->sem_op, + sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", + sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", + sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + sem_b2 + 1, 2, sprintrc(rc)); + + if (semop(id, sem_b, 1)) + perror_msg_and_skip("semop, 1"); + printf("semop(%d, [{0, 1, SEM_UNDO}], 1) = 0\n", id); + + sem_b->sem_op = -1; + if (semop(id, sem_b, 1)) + perror_msg_and_skip("semop, -1"); + printf("semop(%d, [{0, -1, SEM_UNDO}], 1) = 0\n", id); + + rc = semtimedop(bogus_semid, NULL, bogus_nsops, NULL); + printf("semtimedop(%d, NULL, %u, NULL) = %s\n", + bogus_semid, (unsigned) bogus_nsops, sprintrc(rc)); + + rc = semtimedop(id, sem_b + 1, 1, ts + 1); + printf("semtimedop(%d, %p, 1, %p) = %s\n", + id, sem_b + 1, ts + 1, sprintrc(rc)); + + rc = semtimedop(bogus_semid, sem_b2, 2, ts); + printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u, " + "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", + bogus_semid, sem_b2->sem_num, sem_b2->sem_op, + sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", + sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", + sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + sem_b2 + 1, 2, + (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec, + sprintrc(rc)); + + sem_b->sem_op = 1; + if (semtimedop(id, sem_b, 1, NULL)) + perror_msg_and_skip("semtimedop, 1"); + printf("semtimedop(%d, [{0, 1, SEM_UNDO}], 1, NULL) = 0\n", id); + + sem_b->sem_op = -1; + if (semtimedop(id, sem_b, 1, ts)) + perror_msg_and_skip("semtimedop, -1"); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1, " + "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", id, + (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/semop.test b/tests/semop.test new file mode 100755 index 00000000..3e77d2f9 --- /dev/null +++ b/tests/semop.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check semop syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests/sendfile.c b/tests/sendfile.c new file mode 100644 index 00000000..23f096b6 --- /dev/null +++ b/tests/sendfile.c @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sendfile + +# include +# include +# include +# include +# include +# include +# include +# include + +int +main(int ac, const char **av) +{ + assert(ac == 1); + + (void) close(0); + if (open("/dev/zero", O_RDONLY) != 0) + perror_msg_and_skip("open: %s", "/dev/zero"); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + int reg_in = open(av[0], O_RDONLY); + if (reg_in < 0) + perror_msg_and_fail("open: %s", av[0]); + + struct stat stb; + assert(fstat(reg_in, &stb) == 0); + const size_t blen = stb.st_size / 3; + const size_t alen = stb.st_size - blen; + assert(S_ISREG(stb.st_mode) && blen > 0); + + const size_t page_len = get_page_size(); + assert(syscall(__NR_sendfile, 0, 1, NULL, page_len) == -1); + if (EBADF != errno) + perror_msg_and_skip("sendfile"); + printf("sendfile(0, 1, NULL, %lu) = -1 EBADF (%m)\n", + (unsigned long) page_len); + + uint32_t *p_off = tail_alloc(sizeof(uint32_t)); + void *p = p_off + 1; + *p_off = 0; + + assert(syscall(__NR_sendfile, 0, 1, p, page_len) == -1); + printf("sendfile(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", + (unsigned long) p, (unsigned long) page_len); + + assert(syscall(__NR_sendfile, sv[1], reg_in, NULL, alen) + == (long) alen); + printf("sendfile(%d, %d, NULL, %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen); + + p = p_off; + if (syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) != (long) alen) { + printf("sendfile(%d, %d, %#lx, %lu) = -1 EFAULT (%m)\n", + sv[1], reg_in, (unsigned long) p_off, + (unsigned long) alen); + --p_off; + *p_off = 0; + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) + == (long) alen); + } + printf("sendfile(%d, %d, [0] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen, (unsigned long) alen); + + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, stb.st_size + 1) + == (long) blen); + printf("sendfile(%d, %d, [%lu] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) stb.st_size, + (unsigned long) stb.st_size + 1, + (unsigned long) blen); + + if (p_off != p) { + uint64_t *p_off64 = (uint64_t *) p_off; + *p_off64 = 0xcafef00dfacefeedULL; + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off64, 1) == -1); + printf("sendfile(%d, %d, [14627392582579060461], 1)" + " = -1 EINVAL (%m)\n", sv[1], reg_in); + *p_off64 = 0xdefaced; + } else { + *p_off = 0xdefaced; + } + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, 1) == 0); + printf("sendfile(%d, %d, [233811181], 1) = 0\n", + sv[1], reg_in); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sendfile") + +#endif diff --git a/tests/sendfile.test b/tests/sendfile.test new file mode 100755 index 00000000..48dba585 --- /dev/null +++ b/tests/sendfile.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sendfile syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/sendfile64.c b/tests/sendfile64.c new file mode 100644 index 00000000..7208c300 --- /dev/null +++ b/tests/sendfile64.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sendfile64 + +# include +# include +# include +# include +# include +# include +# include +# include + +int +main(int ac, const char **av) +{ + assert(ac == 1); + + (void) close(0); + if (open("/dev/zero", O_RDONLY) != 0) + perror_msg_and_skip("open: %s", "/dev/zero"); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + int reg_in = open(av[0], O_RDONLY); + if (reg_in < 0) + perror_msg_and_fail("open: %s", av[0]); + + struct stat stb; + assert(fstat(reg_in, &stb) == 0); + const size_t blen = stb.st_size / 3; + const size_t alen = stb.st_size - blen; + assert(S_ISREG(stb.st_mode) && blen > 0); + + const size_t page_len = get_page_size(); + assert(syscall(__NR_sendfile64, 0, 1, NULL, page_len) == -1); + if (EBADF != errno) + perror_msg_and_skip("sendfile64"); + printf("sendfile64(0, 1, NULL, %lu) = -1 EBADF (%m)\n", + (unsigned long) page_len); + + uint64_t *p_off = tail_alloc(sizeof(uint64_t)); + void *p = p_off + 1; + *p_off = 0; + + assert(syscall(__NR_sendfile64, 0, 1, p, page_len) == -1); + printf("sendfile64(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", + (unsigned long) p, (unsigned long) page_len); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, NULL, alen) + == (long) alen); + printf("sendfile64(%d, %d, NULL, %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, alen) + == (long) alen); + printf("sendfile64(%d, %d, [0] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) alen, (unsigned long) alen); + + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, stb.st_size + 1) + == (long) blen); + printf("sendfile64(%d, %d, [%lu] => [%lu], %lu) = %lu\n", + sv[1], reg_in, (unsigned long) alen, + (unsigned long) stb.st_size, + (unsigned long) stb.st_size + 1, + (unsigned long) blen); + + *p_off = 0xcafef00dfacefeedULL; + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1); + printf("sendfile64(%d, %d, [14627392582579060461], 1)" + " = -1 EINVAL (%m)\n", sv[1], reg_in); + + *p_off = 0xfacefeed; + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == 0); + printf("sendfile64(%d, %d, [4207869677], 1) = 0\n", sv[1], reg_in); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sendfile64") + +#endif diff --git a/tests/sendfile64.test b/tests/sendfile64.test new file mode 100755 index 00000000..faa05254 --- /dev/null +++ b/tests/sendfile64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sendfile64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 diff --git a/tests/set_mempolicy.c b/tests/set_mempolicy.c new file mode 100644 index 00000000..f3261a09 --- /dev/null +++ b/tests/set_mempolicy.c @@ -0,0 +1,146 @@ +/* + * Check decoding of set_mempolicy syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_set_mempolicy + +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/policies.h" + +# define MAX_STRLEN 3 +# define NLONGS(n) ((n + 8 * sizeof(long) - 2) \ + / (8 * sizeof(long))) + +static void +print_nodes(const unsigned long maxnode, unsigned int offset) +{ + unsigned int nlongs = NLONGS(maxnode); + if (nlongs <= offset) + nlongs = 0; + else + nlongs -= offset; + const unsigned int size = nlongs * sizeof(long); + unsigned long *const nodemask = + tail_alloc(size ? size : (offset ? 1 : 0)); + memset(nodemask, 0, size); + + long rc = syscall(__NR_set_mempolicy, 0, nodemask, maxnode); + const char *errstr = sprintrc(rc); + + fputs("set_mempolicy(MPOL_DEFAULT, ", stdout); + + if (nlongs) { + putc('[', stdout); + unsigned int i; + for (i = 0; i < nlongs + offset; ++i) { + if (i) + fputs(", ", stdout); + if (i < nlongs) { + if (i >= MAX_STRLEN) { + fputs("...", stdout); + break; + } + printf("%#0*lx", (int) sizeof(long) * 2 + 2, + nodemask[i]); + } else { + printf("%p", nodemask + i); + break; + } + } + putc(']', stdout); + } else { + if (maxnode) + printf("%p", nodemask); + else + printf("[]"); + } + + printf(", %lu) = %s\n", maxnode, errstr); +} + +static void +test_offset(const unsigned int offset) +{ + unsigned long maxnode = get_page_size() * 8; + + print_nodes(maxnode, offset); + print_nodes(maxnode + 1, offset); + print_nodes(maxnode + 2, offset); + + maxnode = sizeof(long) * 8; + print_nodes(0, offset); + print_nodes(1, offset); + print_nodes(2, offset); + print_nodes(maxnode - 1, offset); + print_nodes(maxnode , offset); + print_nodes(maxnode + 1, offset); + print_nodes(maxnode + 2, offset); + print_nodes(maxnode * 2 - 1, offset); + print_nodes(maxnode * 2 , offset); + print_nodes(maxnode * 2 + 1, offset); + print_nodes(maxnode * 2 + 2, offset); + print_nodes(maxnode * 3 - 1, offset); + print_nodes(maxnode * 3 , offset); + print_nodes(maxnode * 3 + 1, offset); + print_nodes(maxnode * 3 + 2, offset); + print_nodes(maxnode * 4 + 2, offset); +} + +int +main(void) +{ + if (syscall(__NR_set_mempolicy, 0, 0, 0)) + perror_msg_and_skip("set_mempolicy"); + puts("set_mempolicy(MPOL_DEFAULT, NULL, 0) = 0"); + + const unsigned long *nodemask = (void *) 0xfacefeedfffffffeULL; + const unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; + long rc = syscall(__NR_set_mempolicy, 1, nodemask, maxnode); + printf("set_mempolicy(MPOL_PREFERRED, %p, %lu) = %s\n", + nodemask, maxnode, sprintrc(rc)); + + test_offset(0); + test_offset(1); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_set_mempolicy") + +#endif diff --git a/tests/set_mempolicy.test b/tests/set_mempolicy.test new file mode 100755 index 00000000..0ed6666c --- /dev/null +++ b/tests/set_mempolicy.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check set_mempolicy syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a35 diff --git a/tests/set_ptracer_any.c b/tests/set_ptracer_any.c index dbd53372..bc2f90ca 100644 --- a/tests/set_ptracer_any.c +++ b/tests/set_ptracer_any.c @@ -1,6 +1,31 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +/* + * Copyright (c) 2013-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" #include #include #ifdef HAVE_PRCTL diff --git a/tests/setdomainname.c b/tests/setdomainname.c new file mode 100644 index 00000000..f3e24840 --- /dev/null +++ b/tests/setdomainname.c @@ -0,0 +1,24 @@ +#include "tests.h" +#include + +#ifdef __NR_setdomainname + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_setdomainname, 0, 63); + printf("setdomainname(NULL, 63) = %ld %s (%m)\n", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setdomainname") + +#endif diff --git a/tests/setdomainname.test b/tests/setdomainname.test new file mode 100755 index 00000000..2159e7c4 --- /dev/null +++ b/tests/setdomainname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setdomainname syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/setfsgid.c b/tests/setfsgid.c new file mode 100644 index 00000000..871f4b35 --- /dev/null +++ b/tests/setfsgid.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsgid + +# define SYSCALL_NR __NR_setfsgid +# define SYSCALL_NAME "setfsgid" + +# if defined __NR_setfsgid32 && __NR_setfsgid != __NR_setfsgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# endif + +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsgid") + +#endif diff --git a/tests/setfsgid.test b/tests/setfsgid.test new file mode 100755 index 00000000..0ae2b0a2 --- /dev/null +++ b/tests/setfsgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/setfsgid32.c b/tests/setfsgid32.c new file mode 100644 index 00000000..6279abd3 --- /dev/null +++ b/tests/setfsgid32.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsgid32 + +# define SYSCALL_NR __NR_setfsgid32 +# define SYSCALL_NAME "setfsgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsgid32") + +#endif diff --git a/tests/setfsgid32.test b/tests/setfsgid32.test new file mode 100755 index 00000000..9b7a2bf8 --- /dev/null +++ b/tests/setfsgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/setfsugid.c b/tests/setfsugid.c new file mode 100644 index 00000000..79ba34d8 --- /dev/null +++ b/tests/setfsugid.c @@ -0,0 +1,76 @@ +/* + * Check decoding of setfsuid/setfsgid/setfsuid32/setfsgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +void +printuid(unsigned UGID_TYPE id) +{ + if (id == (unsigned UGID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + unsigned int ugid = GETUGID; + + const kernel_ulong_t tests[] = { + ugid, + 0xffff0000U | ugid, + (kernel_ulong_t) 0xffffffff00000000ULL | ugid, + 0xffffU, + -1U, + -1L, + 0xc0deffffU, + 0xfacefeedU, + (long) 0xfacefeeddeadbeefULL + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int num = (unsigned UGID_TYPE) tests[i]; + unsigned int rc; + + rc = syscall(SYSCALL_NR, tests[i]); + printf("%s(", SYSCALL_NAME); + printuid(num); + printf(") = %u\n", rc); + + rc = syscall(SYSCALL_NR, ugid); + printf("%s(%u) = %u\n", SYSCALL_NAME, ugid, rc); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/setfsuid.c b/tests/setfsuid.c new file mode 100644 index 00000000..d6faf971 --- /dev/null +++ b/tests/setfsuid.c @@ -0,0 +1,23 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsuid + +# define SYSCALL_NR __NR_setfsuid +# define SYSCALL_NAME "setfsuid" + +# if defined __NR_setfsuid32 && __NR_setfsuid != __NR_setfsuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# endif + +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsuid") + +#endif diff --git a/tests/setfsuid.test b/tests/setfsuid.test new file mode 100755 index 00000000..18a10219 --- /dev/null +++ b/tests/setfsuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/setfsuid32.c b/tests/setfsuid32.c new file mode 100644 index 00000000..b71cf235 --- /dev/null +++ b/tests/setfsuid32.c @@ -0,0 +1,16 @@ +#include "tests.h" +#include + +#ifdef __NR_setfsuid32 + +# define SYSCALL_NR __NR_setfsuid32 +# define SYSCALL_NAME "setfsuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# include "setfsugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setfsuid32") + +#endif diff --git a/tests/setfsuid32.test b/tests/setfsuid32.test new file mode 100755 index 00000000..2dce3cc9 --- /dev/null +++ b/tests/setfsuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setfsuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/setgid.c b/tests/setgid.c new file mode 100644 index 00000000..8794a0a4 --- /dev/null +++ b/tests/setgid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setgid + +# define SYSCALL_NR __NR_setgid +# define SYSCALL_NAME "setgid" + +# if defined __NR_setgid32 && __NR_setgid != __NR_setgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgid") + +#endif diff --git a/tests/setgid.test b/tests/setgid.test new file mode 100755 index 00000000..a3a90041 --- /dev/null +++ b/tests/setgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/setgid32.c b/tests/setgid32.c new file mode 100644 index 00000000..17f43c58 --- /dev/null +++ b/tests/setgid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setgid32 + +# define SYSCALL_NR __NR_setgid32 +# define SYSCALL_NAME "setgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgid32") + +#endif diff --git a/tests/setgid32.test b/tests/setgid32.test new file mode 100755 index 00000000..11a87e12 --- /dev/null +++ b/tests/setgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/setgroups.c b/tests/setgroups.c new file mode 100644 index 00000000..1ec8333f --- /dev/null +++ b/tests/setgroups.c @@ -0,0 +1,190 @@ +/* + * Check decoding of setgroups/setgroups32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef __NR_setgroups32 + +# define SYSCALL_NR __NR_setgroups32 +# define SYSCALL_NAME "setgroups32" +# define GID_TYPE unsigned int + +#else + +# include "tests.h" +# include + +# ifdef __NR_setgroups + +# define SYSCALL_NR __NR_setgroups +# define SYSCALL_NAME "setgroups" +# if defined __NR_setgroups32 && __NR_setgroups != __NR_setgroups32 +# define GID_TYPE unsigned short +# else +# define GID_TYPE unsigned int +# endif + +# endif + +#endif + +#ifdef GID_TYPE + +# include +# include + +void +printuid(GID_TYPE id) +{ + if (id == (GID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + const char *errstr; + + /* check how the first argument is decoded */ + long rc = syscall(SYSCALL_NR, 0, 0); + printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, 0); + printf("%s(1, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, (long) 0xffffffff00000001ULL, 0); + printf("%s(1, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1U, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, -1L, 0); + printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); + + /* check how the second argument is decoded */ + const GID_TYPE *const g1 = tail_alloc(sizeof(*g1)); + GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * 2); + GID_TYPE *const g3 = tail_alloc(sizeof(*g3) * 3); + + rc = syscall(SYSCALL_NR, 0, g1 + 1); + printf("%s(0, []) = %s\n", SYSCALL_NAME, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, g1); + errstr = sprintrc(rc); + printf("%s(1, [", SYSCALL_NAME); + printuid(*g1); + printf("]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 1, g1 + 1); + printf("%s(1, %p) = %s\n", SYSCALL_NAME, g1 + 1, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 1, -1L); + printf("%s(1, %#lx) = %s\n", SYSCALL_NAME, -1L, sprintrc(rc)); + + rc = syscall(SYSCALL_NR, 2, g1); + errstr = sprintrc(rc); + printf("%s(2, [", SYSCALL_NAME); + printuid(*g1); + printf(", %p]) = %s\n", g1 + 1, errstr); + + g2[0] = -2; + g2[1] = -3; + rc = syscall(SYSCALL_NR, 2, g2); + errstr = sprintrc(rc); + printf("%s(2, [", SYSCALL_NAME); + printuid(g2[0]); + printf(", "); + printuid(g2[1]); + printf("]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 3, g2); + errstr = sprintrc(rc); + printf("%s(3, [", SYSCALL_NAME); + printuid(g2[0]); + printf(", "); + printuid(g2[1]); + printf(", %p]) = %s\n", g2 + 2, errstr); + + g3[0] = 0; + g3[1] = 1; + rc = syscall(SYSCALL_NR, 3, g3); + errstr = sprintrc(rc); + printf("%s(3, [", SYSCALL_NAME); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, 4, g3); + errstr = sprintrc(rc); + printf("%s(4, [", SYSCALL_NAME); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = sysconf(_SC_NGROUPS_MAX); + const unsigned ngroups_max = rc; + + if ((unsigned long) rc == ngroups_max && (int) ngroups_max > 0) { + rc = syscall(SYSCALL_NR, ngroups_max, g3); + errstr = sprintrc(rc); + printf("%s(%d, [", SYSCALL_NAME, ngroups_max); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + const unsigned long size = + (unsigned long) 0xffffffff00000000ULL | ngroups_max; + rc = syscall(SYSCALL_NR, size, g3); + errstr = sprintrc(rc); + printf("%s(%d, [", SYSCALL_NAME, ngroups_max); + printuid(g3[0]); + printf(", "); + printuid(g3[1]); + printf(", ...]) = %s\n", errstr); + + rc = syscall(SYSCALL_NR, ngroups_max + 1, g3); + printf("%s(%d, %p) = %s\n", SYSCALL_NAME, + ngroups_max + 1, g3, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgroups") + +#endif diff --git a/tests/setgroups.test b/tests/setgroups.test new file mode 100755 index 00000000..0dcc8f75 --- /dev/null +++ b/tests/setgroups.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgroups syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a17 diff --git a/tests/setgroups32.c b/tests/setgroups32.c new file mode 100644 index 00000000..ecf00bbd --- /dev/null +++ b/tests/setgroups32.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include + +#ifdef __NR_setgroups32 + +# include "setgroups.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setgroups32") + +#endif diff --git a/tests/setgroups32.test b/tests/setgroups32.test new file mode 100755 index 00000000..ee4750d1 --- /dev/null +++ b/tests/setgroups32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setgroups32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a19 diff --git a/tests/sethostname.c b/tests/sethostname.c new file mode 100644 index 00000000..e1b2f069 --- /dev/null +++ b/tests/sethostname.c @@ -0,0 +1,79 @@ +/* + * Check decoding of sethostname syscall. + * + * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_sethostname + +# include +# include + +#ifdef HAVE_LINUX_UTSNAME_H +# include +#endif + +#ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +#endif + +int +main(void) +{ + kernel_ulong_t len; + long rc; + + len = __NEW_UTS_LEN; + rc = syscall(__NR_sethostname, 0, len); + printf("sethostname(NULL, %u) = %s\n", + (unsigned) len, sprintrc(rc)); + + if (F8ILL_KULONG_MASK) { + len |= F8ILL_KULONG_MASK; + rc = syscall(__NR_sethostname, 0, len); + printf("sethostname(NULL, %u) = %s\n", + (unsigned) len, sprintrc(rc)); + } + + len = __NEW_UTS_LEN + 1; + void *const p = tail_alloc(len); + rc = syscall(__NR_sethostname, p, len); + printf("sethostname(%p, %u) = %s\n", + p, (unsigned) len, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sethostname") + +#endif diff --git a/tests/sethostname.test b/tests/sethostname.test new file mode 100755 index 00000000..78f8c58e --- /dev/null +++ b/tests/sethostname.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sethostname syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/setns.c b/tests/setns.c new file mode 100644 index 00000000..54a15317 --- /dev/null +++ b/tests/setns.c @@ -0,0 +1,73 @@ +/* + * Check decoding of setns syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_setns + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xfeedfacedeadc0deULL; + + static struct { + kernel_ulong_t val; + const char *str; + } nstypes[] = { + { (kernel_ulong_t) 0xdefaced100000000ULL, "0" }, + { (kernel_ulong_t) 0xbadc0dedfeedfaceULL, + "0xfeedface /* CLONE_NEW??? */" }, + { (kernel_ulong_t) 0xca75f15702000000ULL, "CLONE_NEWCGROUP" }, + }; + + long rc; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(nstypes); i++) { + rc = syscall(__NR_setns, bogus_fd, nstypes[i].val); + printf("setns(%d, %s) = %s\n", + (int) bogus_fd, nstypes[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setns"); + +#endif diff --git a/tests/setns.test b/tests/setns.test new file mode 100755 index 00000000..e9a905ab --- /dev/null +++ b/tests/setns.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of setns syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/setregid.c b/tests/setregid.c new file mode 100644 index 00000000..e1da7862 --- /dev/null +++ b/tests/setregid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setregid + +# define SYSCALL_NR __NR_setregid +# define SYSCALL_NAME "setregid" + +# if defined __NR_setregid32 && __NR_setregid != __NR_setregid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setregid") + +#endif diff --git a/tests/setregid.test b/tests/setregid.test new file mode 100755 index 00000000..101c7bdf --- /dev/null +++ b/tests/setregid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setregid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/setregid32.c b/tests/setregid32.c new file mode 100644 index 00000000..3cf0daf6 --- /dev/null +++ b/tests/setregid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setregid32 + +# define SYSCALL_NR __NR_setregid32 +# define SYSCALL_NAME "setregid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setregid32") + +#endif diff --git a/tests/setregid32.test b/tests/setregid32.test new file mode 100755 index 00000000..e57e66c4 --- /dev/null +++ b/tests/setregid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setregid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/setresgid.c b/tests/setresgid.c new file mode 100644 index 00000000..8701df8e --- /dev/null +++ b/tests/setresgid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setresgid + +# define SYSCALL_NR __NR_setresgid +# define SYSCALL_NAME "setresgid" + +# if defined __NR_setresgid32 && __NR_setresgid != __NR_setresgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresgid") + +#endif diff --git a/tests/setresgid.test b/tests/setresgid.test new file mode 100755 index 00000000..5a695742 --- /dev/null +++ b/tests/setresgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/setresgid32.c b/tests/setresgid32.c new file mode 100644 index 00000000..dfce4572 --- /dev/null +++ b/tests/setresgid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setresgid32 + +# define SYSCALL_NR __NR_setresgid32 +# define SYSCALL_NAME "setresgid32" +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresgid32") + +#endif diff --git a/tests/setresgid32.test b/tests/setresgid32.test new file mode 100755 index 00000000..528b2c9e --- /dev/null +++ b/tests/setresgid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresgid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/setresugid.c b/tests/setresugid.c new file mode 100644 index 00000000..711bd317 --- /dev/null +++ b/tests/setresugid.c @@ -0,0 +1,113 @@ +/* + * Check decoding of setresuid/setresgid/setresuid32/setresgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +static int +ugid2int(const unsigned UGID_TYPE ugid) +{ + if ((unsigned UGID_TYPE) -1U == ugid) + return -1; + else + return ugid; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf("-1"); + else + printf("%u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int ugid) +{ + return num == ugid || num == -1U; +} + +#define TRIPLE(val) \ + { val, ugid, ugid }, { ugid, val, ugid }, { ugid, ugid, val } + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const struct { + const long r, e, s; + } tests[] = { + { ugid, ugid, ugid }, + TRIPLE((unsigned long) 0xffffffff00000000ULL | ugid), + TRIPLE(-1U), + TRIPLE(-1L), + TRIPLE(0xffff0000U | ugid), + TRIPLE(0xffff), + TRIPLE(0xc0deffffU) + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int rn = ugid2int(tests[i].r); + const unsigned int en = ugid2int(tests[i].e); + const unsigned int sn = ugid2int(tests[i].s); + + if (!num_matches_id(rn, ugid) || + !num_matches_id(en, ugid) || + !num_matches_id(sn, ugid)) + continue; + + if (syscall(SYSCALL_NR, tests[i].r, tests[i].e, tests[i].s)) { + if (!i && ENOSYS == errno) { + printf("%s(%u, %u, %u) = -1 ENOSYS (%m)\n", + SYSCALL_NAME, ugid, ugid, ugid); + break; + } + perror_msg_and_fail("%s(%#lx, %#lx, %#lx)", + SYSCALL_NAME, + tests[i].r, tests[i].e, tests[i].s); + } + + printf("%s(", SYSCALL_NAME); + print_int(rn); + printf(", "); + print_int(en); + printf(", "); + print_int(sn); + printf(") = 0\n"); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/setresuid.c b/tests/setresuid.c new file mode 100644 index 00000000..3a9dbd1f --- /dev/null +++ b/tests/setresuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setresuid + +# define SYSCALL_NR __NR_setresuid +# define SYSCALL_NAME "setresuid" + +# if defined __NR_setresuid32 && __NR_setresuid != __NR_setresuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresuid") + +#endif diff --git a/tests/setresuid.test b/tests/setresuid.test new file mode 100755 index 00000000..f1219e06 --- /dev/null +++ b/tests/setresuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/setresuid32.c b/tests/setresuid32.c new file mode 100644 index 00000000..387268a7 --- /dev/null +++ b/tests/setresuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setresuid32 + +# define SYSCALL_NR __NR_setresuid32 +# define SYSCALL_NAME "setresuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresuid32") + +#endif diff --git a/tests/setresuid32.test b/tests/setresuid32.test new file mode 100755 index 00000000..942a3a65 --- /dev/null +++ b/tests/setresuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/setreugid.c b/tests/setreugid.c new file mode 100644 index 00000000..38c80d57 --- /dev/null +++ b/tests/setreugid.c @@ -0,0 +1,106 @@ +/* + * Check decoding of setreuid/setregid/setreuid32/setregid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +static int +ugid2int(const unsigned UGID_TYPE ugid) +{ + if ((unsigned UGID_TYPE) -1U == ugid) + return -1; + else + return ugid; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf("-1"); + else + printf("%u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int ugid) +{ + return num == ugid || num == -1U; +} + +#define PAIR(val) { val, ugid }, { ugid, val } + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const struct { + const long r, e; + } tests[] = { + { ugid, ugid }, + PAIR((unsigned long) 0xffffffff00000000ULL | ugid), + PAIR(-1U), + PAIR(-1L), + PAIR(0xffff0000U | ugid), + PAIR(0xffff), + PAIR(0xc0deffffU) + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int rn = ugid2int(tests[i].r); + const unsigned int en = ugid2int(tests[i].e); + + if (!num_matches_id(rn, ugid) || !num_matches_id(en, ugid)) + continue; + + if (syscall(SYSCALL_NR, tests[i].r, tests[i].e)) { + if (!i && ENOSYS == errno) { + printf("%s(%u, %u) = -1 ENOSYS (%m)\n", + SYSCALL_NAME, ugid, ugid); + break; + } + perror_msg_and_fail("%s(%#lx, %#lx)", SYSCALL_NAME, + tests[i].r, tests[i].e); + } + + printf("%s(", SYSCALL_NAME); + print_int(rn); + printf(", "); + print_int(en); + printf(") = 0\n"); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/setreuid.c b/tests/setreuid.c new file mode 100644 index 00000000..68e75192 --- /dev/null +++ b/tests/setreuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setreuid + +# define SYSCALL_NR __NR_setreuid +# define SYSCALL_NAME "setreuid" + +# if defined __NR_setreuid32 && __NR_setreuid != __NR_setreuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setreuid") + +#endif diff --git a/tests/setreuid.test b/tests/setreuid.test new file mode 100755 index 00000000..b6db3c1d --- /dev/null +++ b/tests/setreuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setreuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/setreuid32.c b/tests/setreuid32.c new file mode 100644 index 00000000..ba017621 --- /dev/null +++ b/tests/setreuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setreuid32 + +# define SYSCALL_NR __NR_setreuid32 +# define SYSCALL_NAME "setreuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setreugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setreuid32") + +#endif diff --git a/tests/setreuid32.test b/tests/setreuid32.test new file mode 100755 index 00000000..23323d47 --- /dev/null +++ b/tests/setreuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setreuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/setrlimit.c b/tests/setrlimit.c new file mode 100644 index 00000000..e93c8e37 --- /dev/null +++ b/tests/setrlimit.c @@ -0,0 +1,70 @@ +/* + * Check decoding of setrlimit syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_setrlimit + +# include "xgetrlimit.c" + +int +main(void) +{ + kernel_ulong_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(__NR_setrlimit, res, 0); + printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); + + struct rlimit libc_rlim = {}; + if (getrlimit((int) res, &libc_rlim)) + continue; + rlimit[0] = libc_rlim.rlim_cur; + rlimit[1] = libc_rlim.rlim_max; + + rc = syscall(__NR_setrlimit, res, rlimit); + const char *errstr = sprintrc(rc); + printf("setrlimit(%s, {rlim_cur=%s, rlim_max=%s}) = %s\n", + xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_setrlimit") + +#endif diff --git a/tests/setrlimit.test b/tests/setrlimit.test new file mode 100755 index 00000000..79206089 --- /dev/null +++ b/tests/setrlimit.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of getrlimit/ugetrlimit/setrlimit syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/setugid.c b/tests/setugid.c new file mode 100644 index 00000000..aba277c5 --- /dev/null +++ b/tests/setugid.c @@ -0,0 +1,91 @@ +/* + * Check decoding of setuid/setgid/setuid32/setgid32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +void +printuid(unsigned UGID_TYPE id) +{ + if (id == (unsigned UGID_TYPE) -1U) + printf("-1"); + else + printf("%u", id); +} + +int +main(void) +{ + unsigned int ugid = GETUGID; + CHECK_OVERFLOWUGID(ugid); + + const long tests[] = { + ugid, + 0xffff0000U | ugid, + (unsigned long) 0xffffffff00000000ULL | ugid, + 0xffffU, + -1U, + -1L + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int num = (unsigned UGID_TYPE) tests[i]; + long expected; + + if (num == ugid) + expected = 0; + else if ((UGID_TYPE) num == (UGID_TYPE) -1U) + expected = -1; + else + continue; + + const long rc = syscall(SYSCALL_NR, tests[i]); + const char *errstr = sprintrc(rc); + + if (rc != expected) { + if (!i && ENOSYS == errno) { + printf("%s(%u) = %s\n", + SYSCALL_NAME, ugid, errstr); + break; + } + perror_msg_and_fail("%s(%#lx) != %ld", + SYSCALL_NAME, tests[i], expected); + } + + printf("%s(", SYSCALL_NAME); + printuid(num); + printf(") = %s\n", errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/setuid.c b/tests/setuid.c new file mode 100644 index 00000000..df2e46b1 --- /dev/null +++ b/tests/setuid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setuid + +# define SYSCALL_NR __NR_setuid +# define SYSCALL_NAME "setuid" + +# if defined __NR_setuid32 && __NR_setuid != __NR_setuid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_geteuid) +# define CHECK_OVERFLOWUGID(arg) check_overflowuid(arg) +# else +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setuid") + +#endif diff --git a/tests/setuid.test b/tests/setuid.test new file mode 100755 index 00000000..9279233a --- /dev/null +++ b/tests/setuid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setuid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/setuid32.c b/tests/setuid32.c new file mode 100644 index 00000000..c837d547 --- /dev/null +++ b/tests/setuid32.c @@ -0,0 +1,17 @@ +#include "tests.h" +#include + +#ifdef __NR_setuid32 + +# define SYSCALL_NR __NR_setuid32 +# define SYSCALL_NAME "setuid32" +# define UGID_TYPE int +# define GETUGID geteuid() +# define CHECK_OVERFLOWUGID(arg) +# include "setugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setuid32") + +#endif diff --git a/tests/setuid32.test b/tests/setuid32.test new file mode 100755 index 00000000..7998392a --- /dev/null +++ b/tests/setuid32.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setuid32 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/shmxt.c b/tests/shmxt.c new file mode 100644 index 00000000..23cc7ccf --- /dev/null +++ b/tests/shmxt.c @@ -0,0 +1,68 @@ +#include "tests.h" +#include +#include +#include + +static int id = -1; + +static void +cleanup(void) +{ + shmctl(id, IPC_RMID, NULL); + id = -1; +} + +#ifdef __alpha__ +# define SHMAT "osf_shmat" +#else +# define SHMAT "shmat" +#endif + +int +main(void) +{ + static const int bogus_shmid = 0xfdb97531; + static const void * const bogus_shmaddr = + (void *) (unsigned long) 0xdec0ded1dec0ded2ULL; + static const int bogus_shmflg = 0xffffface; + + long rc; + + id = shmget(IPC_PRIVATE, 1, 0600); + if (id < 0) + perror_msg_and_skip("shmget"); + atexit(cleanup); + + rc = (long) shmat(bogus_shmid, bogus_shmaddr, bogus_shmflg); + printf("%s(%d, %p, SHM_REMAP|SHM_RDONLY|SHM_RND|%#x) = %s\n", + SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0x7000, + sprintrc(rc)); + + shmat(id, NULL, SHM_REMAP); + printf("%s(%d, NULL, SHM_REMAP) = -1 %s (%m)\n", + SHMAT, id, errno2name()); + + void *shmaddr = shmat(id, NULL, SHM_RDONLY); + if (shmaddr == (void *)(-1)) + perror_msg_and_skip("shmat SHM_RDONLY"); + printf("%s(%d, NULL, SHM_RDONLY) = %p\n", SHMAT, id, shmaddr); + + rc = shmdt(NULL); + printf("shmdt(NULL) = %s\n", sprintrc(rc)); + + if (shmdt(shmaddr)) + perror_msg_and_skip("shmdt"); + printf("shmdt(%p) = 0\n", shmaddr); + + ++shmaddr; + void *shmaddr2 = shmat(id, shmaddr, SHM_RND); + if (shmaddr2 == (void *)(-1)) + printf("%s(%d, %p, SHM_RND) = -1 %s (%m)\n", + SHMAT, id, shmaddr, errno2name()); + else + printf("%s(%d, %p, SHM_RND) = %p\n", + SHMAT, id, shmaddr, shmaddr2); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/shmxt.test b/tests/shmxt.test new file mode 100755 index 00000000..3757cfa4 --- /dev/null +++ b/tests/shmxt.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check shmat and shmdt syscalls decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha) shmat=osf_shmat ;; + *) shmat=shmat ;; +esac + +run_strace_match_diff -e trace=$shmat,shmdt -a11 diff --git a/tests/shutdown.c b/tests/shutdown.c new file mode 100644 index 00000000..d770c43a --- /dev/null +++ b/tests/shutdown.c @@ -0,0 +1,15 @@ +/* Check decoding of shutdown syscall. */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + int rc = shutdown(-1, SHUT_RDWR); + printf("shutdown(-1, SHUT_RDWR) = %d %s (%m)\n", rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/shutdown.test b/tests/shutdown.test new file mode 100755 index 00000000..22f0d5ab --- /dev/null +++ b/tests/shutdown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of shutdown syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/sigaction.awk b/tests/sigaction.awk index 08f49c3a..9c3a9ed3 100644 --- a/tests/sigaction.awk +++ b/tests/sigaction.awk @@ -1,55 +1,95 @@ -# rt_sigaction on ALPHA has 5 args: sig, act, oact, sigsetsize, restorer. -# rt_sigaction on SPARC has 5 args: sig, act, oact, restorer, sigsetsize. -# rt_sigaction on other architectures has 4 args: sig, act, oact, sigsetsize. -# Some architectures have SA_RESTORER, some don't; -# in particular, SPARC has and ALPHA hasn't. +#!/bin/gawk # -# There are two regexps for each test: -# the 1st is for any architecture with SA_RESTORER, including SPARC; -# the 2nd is for any architecture without SA_RESTORER, including ALPHA; -# the 3rd is for any architecture without SA_RESTORER and swapped args. +# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2016 Elvira Khabirova +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. BEGIN { - lines = 5 - fail = 0 -} + n1[1][1] = n2[1][1] = "SIG_IGN" + n1[1][2] = n2[1][2] = "\\[HUP INT\\]" + n1[1][3] = "SA_RESTORER\\|SA_RESTART" + n2[1][3] = "SA_RESTART" + n1[1][4] = ", sa_restorer=0x[0-9a-f]+" + n2[1][4] = "" -# Test 1. -NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+}, {SIG_DFL, \[\], 0}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next} -NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTART}, {SIG_DFL, \[\], 0}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next} -NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTART}, {SIG_DFL, \[\], 0}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next} + n1[2][1] = n2[2][1] = "0x[0-9a-f]+" + n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" + n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" + n2[2][3] = "SA_SIGINFO" + n1[2][4] = ", sa_restorer=0x[0-9a-f]+" + n2[2][4] = "" -# Test 2. -NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+}, {SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next} -NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, {SIG_IGN, \[HUP INT\], SA_RESTART}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next} -NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, {SIG_IGN, \[HUP INT\], SA_RESTART}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next} + n1[3][1] = n2[3][1] = "SIG_DFL" + n1[3][2] = n2[3][2] = "\\[\\]" + n1[3][3] = "SA_RESTORER" + n2[3][3] = "0" + n1[3][4] = ", sa_restorer=0x[0-9a-f]+" + n2[3][4] = "" -# Test 3. -NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], SA_RESTORER, 0x[0-9a-f]+}, {0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next} -NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], 0}, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next} -NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], 0}, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next} + n1[4][1] = n2[4][1] = "SIG_DFL" + n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" + n1[4][3] = "SA_RESTORER" + n2[4][3] = "0" + n1[4][4] = ", sa_restorer=0x[0-9a-f]+" + n2[4][4] = "" -# Test 4. -NR == 4 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], SA_RESTORER, 0x[0-9a-f]+}, {SIG_DFL, \[\], SA_RESTORER, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next} -NR == 4 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], 0}, {SIG_DFL, \[\], 0}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next} -NR == 4 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], 0}, {SIG_DFL, \[\], 0}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next} + o1[1][1] = o2[1][1] = "SIG_DFL" + o1[1][2] = o2[1][2] = "\\[\\]" + o1[1][3] = o2[1][3] = "0" + o1[1][4] = o2[1][4] = "" -# The last line. -NR == lines && /^\+\+\+ exited with 0 \+\+\+$/ {next} + for (i = 2; i < 5; i++) { + for (j = 1; j < 5; j++) { + o1[i][j] = n1[i - 1][j] + o2[i][j] = n2[i - 1][j] + } + } -{ - print "Line " NR " does not match: " $0 - fail=1 -} + a1 = "(0x[0-9a-f]+, )?(4|8|16)" + a2 = "(4|8|16)(, 0x[0-9a-f]+)?" + a3 = "0x[0-9a-f]+, (4|8|16)" + + for (i = 1; i < 5; i++) { + r[i] = "^rt_sigaction\\(SIGUSR2, (" \ + "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ + ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ + o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ + o1[i][4] "\\}, " a1 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a2 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a3 ")\\) = 0$" + } + s[5] = "+++ exited with 0 +++" -END { - if (NR != lines) { - print "Expected " lines " lines, found " NR " line(s)." - print "" - exit 1 - } - if (fail) { - print "" - exit 1 - } + lines = 5 + fail = 0 } + +@include "match.awk" diff --git a/tests/sigaction.c b/tests/sigaction.c index b5f19b56..1c034ff3 100644 --- a/tests/sigaction.c +++ b/tests/sigaction.c @@ -1,3 +1,30 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include #include #include diff --git a/tests/sigaction.test b/tests/sigaction.test index 33732e02..fcde3baf 100755 --- a/tests/sigaction.test +++ b/tests/sigaction.test @@ -4,16 +4,8 @@ . "${srcdir=.}/init.sh" -check_prog awk - -./sigaction || - fail_ 'sigaction failed' - -args="-o $LOG -ert_sigaction ./sigaction" -$STRACE $args || - fail_ "strace $args failed" - -awk -f "$srcdir"/sigaction.awk $LOG || - { cat $LOG; fail_ 'unexpected output'; } +run_prog +run_strace -ert_sigaction $args +match_awk exit 0 diff --git a/tests/sigaltstack.c b/tests/sigaltstack.c new file mode 100644 index 00000000..884e3c55 --- /dev/null +++ b/tests/sigaltstack.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include + +int +main(void) +{ + stack_t ss = { + .ss_sp = (void *) 0xbaadf00d, + .ss_flags = SS_DISABLE, + .ss_size = 0xdeadbeef + }; + if (sigaltstack(&ss, (stack_t *) 0)) + perror_msg_and_skip("sigaltstack"); + return 0; +} diff --git a/tests/sigaltstack.expected b/tests/sigaltstack.expected new file mode 100644 index 00000000..be8092ba --- /dev/null +++ b/tests/sigaltstack.expected @@ -0,0 +1,2 @@ +sigaltstack({ss_sp=0xbaadf00d, ss_flags=SS_DISABLE, ss_size=3735928559}, NULL) = 0 ++++ exited with 0 +++ diff --git a/tests/sigaltstack.test b/tests/sigaltstack.test new file mode 100755 index 00000000..ff83c2ea --- /dev/null +++ b/tests/sigaltstack.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check sigaltstack syscall decoding. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e sigaltstack $args +match_diff + +exit 0 diff --git a/tests/siginfo.c b/tests/siginfo.c new file mode 100644 index 00000000..2ecb13fd --- /dev/null +++ b/tests/siginfo.c @@ -0,0 +1,175 @@ +/* + * Check SIGCHLD siginfo_t decoding. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static siginfo_t sinfo; + +static void +handler(int no, siginfo_t *si, void *uc) +{ + memcpy(&sinfo, si, sizeof(sinfo)); +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + assert(sigaction(SIGCHLD, &sa, NULL) == 0); + + sigset_t block_mask, unblock_mask; + assert(sigprocmask(SIG_SETMASK, NULL, &block_mask) == 0); + sigaddset(&block_mask, SIGCHLD); + assert(sigprocmask(SIG_SETMASK, &block_mask, NULL) == 0); + + unblock_mask = block_mask; + sigdelset(&unblock_mask, SIGCHLD); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED" + ", si_pid=%d, si_uid=%u, si_status=%d" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, sinfo.si_status, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + int s; + assert(wait(&s) == pid); + assert(WIFEXITED(s) && WEXITSTATUS(s) == 42); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + char c; + assert(read(0, &c, sizeof(c)) == 1); + (void) raise(SIGUSR1); + return 1; + } + + (void) close(0); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED" + ", si_pid=%d, si_uid=%u, si_status=SIGUSR1" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(wait(&s) == pid); + assert(WIFSIGNALED(s) && WTERMSIG(s) == SIGUSR1); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_STOPPED" + ", si_pid=%d, si_uid=%u, si_status=SIGSTOP" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(kill(pid, SIGCONT) == 0); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_CONTINUED" + ", si_pid=%d, si_uid=%u, si_status=SIGCONT" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(write(1, "", 1) == 1); + (void) close(1); + + sigsuspend(&unblock_mask); + tprintf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED" + ", si_pid=%d, si_uid=%u, si_status=0" + ", si_utime=%llu, si_stime=%llu} ---\n", + sinfo.si_pid, sinfo.si_uid, + zero_extend_signed_to_ull(sinfo.si_utime), + zero_extend_signed_to_ull(sinfo.si_stime)); + + assert(wait(&s) == pid && s == 0); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests/siginfo.test b/tests/siginfo.test new file mode 100755 index 00000000..725f714f --- /dev/null +++ b/tests/siginfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check SIGCHLD siginfo_t decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=none diff --git a/tests/signal2name.c b/tests/signal2name.c new file mode 100644 index 00000000..e301f4ee --- /dev/null +++ b/tests/signal2name.c @@ -0,0 +1,55 @@ +#include "tests.h" +#include + +#define CASE(x) case x: return #x + +const char * +signal2name(int sig) +{ + switch (sig) { + CASE(SIGALRM); + CASE(SIGBUS); + CASE(SIGCHLD); + CASE(SIGCONT); + CASE(SIGFPE); + CASE(SIGHUP); + CASE(SIGILL); + CASE(SIGINT); + CASE(SIGIO); + CASE(SIGPIPE); + CASE(SIGPROF); + CASE(SIGQUIT); + CASE(SIGSEGV); + CASE(SIGSYS); + CASE(SIGTERM); + CASE(SIGTRAP); + CASE(SIGTSTP); + CASE(SIGTTIN); + CASE(SIGTTOU); + CASE(SIGURG); + CASE(SIGUSR1); + CASE(SIGUSR2); + CASE(SIGVTALRM); + CASE(SIGWINCH); + CASE(SIGXCPU); + CASE(SIGXFSZ); +#if defined ALPHA + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGINFO); +#elif defined SPARC || defined SPARC64 + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGLOST); +#elif defined MIPS + CASE(SIGEMT); + CASE(SIGIOT); + CASE(SIGPWR); +#else + CASE(SIGABRT); + CASE(SIGPWR); + CASE(SIGSTKFLT); +#endif + default: perror_msg_and_fail("unknown signal number %d", sig); + } +} diff --git a/tests/signal_receive.c b/tests/signal_receive.c new file mode 100644 index 00000000..1c4293e5 --- /dev/null +++ b/tests/signal_receive.c @@ -0,0 +1,45 @@ +#include "tests.h" +#include +#include +#include + +void sig_print(const char *signame, const int pid, const int uid) +{ + printf("kill(%d, %s) = 0\n" + "--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" + ", si_uid=%d} ---\n", + pid, signame, signame, signame, pid, uid); +} + +static void +handler(int sig) +{ +} + +int +main(void) +{ + int sig, pid = getpid(), uid = getuid(); + const struct sigaction act = { .sa_handler = handler }; + sigset_t mask; + sigemptyset(&mask); + + for (sig = 1; sig <= 31; sig++) { + if( sig != SIGKILL && sig != SIGSTOP) { + sigaction(sig, &act, NULL); + sigaddset(&mask, sig); + } + } + sigprocmask(SIG_UNBLOCK, &mask, NULL); + + for (sig = 1; sig <= 31; sig++) { + if(sig != SIGKILL && sig != SIGSTOP) { + if (kill(pid, sig) != 0) + perror_msg_and_fail("kill: %d", sig); + sig_print(signal2name(sig), pid, uid); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/signal_receive.test b/tests/signal_receive.test new file mode 100755 index 00000000..9685b666 --- /dev/null +++ b/tests/signal_receive.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check whether strace traces signals properly. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -e trace=kill diff --git a/tests/signalfd4.c b/tests/signalfd4.c new file mode 100644 index 00000000..47e49b50 --- /dev/null +++ b/tests/signalfd4.c @@ -0,0 +1,86 @@ +/* + * Check decoding of signalfd4 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_rt_sigprocmask \ + && defined HAVE_SYS_SIGNALFD_H \ + && defined HAVE_SIGNALFD \ + && defined O_CLOEXEC + +# include +# include +# include +# include + +static unsigned int +get_sigset_size(void) +{ + const unsigned int big_size = 1024 / 8; + unsigned int set_size; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, + NULL, NULL, set_size)) + break; + } + + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + + return set_size; +} + +int +main(void) +{ + const char *const sigs = SIGUSR2 < SIGCHLD ? "USR2 CHLD" : "CHLD USR2"; + const unsigned int size = get_sigset_size(); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR2); + sigaddset(&mask, SIGCHLD); + + int fd = signalfd(-1, &mask, O_CLOEXEC | O_NONBLOCK); + printf("signalfd4(-1, [%s], %u, SFD_CLOEXEC|SFD_NONBLOCK) = %s\n", + sigs, size, sprintrc(fd)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask && HAVE_SYS_SIGNALFD_H" + " && HAVE_SIGNALFD && O_CLOEXEC") + +#endif diff --git a/tests/signalfd4.test b/tests/signalfd4.test new file mode 100755 index 00000000..a615a5bf --- /dev/null +++ b/tests/signalfd4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of signalfd4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/sigreturn.c b/tests/sigreturn.c new file mode 100644 index 00000000..dace040a --- /dev/null +++ b/tests/sigreturn.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +#else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +#endif + +static void handler(int sig) +{ +} + +int main(void) { + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGCHLD); + sigaddset(&set, RT_0 + 3); + sigaddset(&set, RT_0 + 4); + sigaddset(&set, RT_0 + 5); + sigaddset(&set, RT_0 + 26); + sigaddset(&set, RT_0 + 27); + sigprocmask(SIG_SETMASK, &set, NULL); + signal(SIGUSR1, handler); + raise(SIGUSR1); + return 0; +} diff --git a/tests/sigreturn.test b/tests/sigreturn.test new file mode 100755 index 00000000..f9a612bf --- /dev/null +++ b/tests/sigreturn.test @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Check rt_sigprocmask and sigreturn/rt_sigreturn decoding. +# +# Copyright (c) 2015-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -esignal $args + +mask='\[(USR2 CHLD|CHLD USR2) RT_3 RT_4 RT_5 RT_26 RT_27\]' +rt_sigprocmask='rt_sigprocmask\(SIG_SETMASK, '"$mask"', NULL, [[:digit:]]+\) += 0' +osf_sigprocmask='osf_sigprocmask\(SIG_SETMASK, '"$mask"'\) += 0 +\(old mask \[[^]]*\]\)' +EXPECTED="$LOG.expected" + +cat > "$EXPECTED" << __EOF__ +$rt_sigprocmask|$osf_sigprocmask +(rt_)?sigreturn\\((\\{mask=$mask\\})?\\) += 0 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" + +exit 0 diff --git a/tests/sleep.c b/tests/sleep.c new file mode 100644 index 00000000..f4bce3cd --- /dev/null +++ b/tests/sleep.c @@ -0,0 +1,49 @@ +/* + * A simple nanosleep based sleep(1) replacement. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 2) + error_msg_and_fail("missing operand"); + + if (ac > 2) + error_msg_and_fail("extra operand"); + + struct timespec ts = { atoi(av[1]), 0 }; + + if (nanosleep(&ts, NULL)) + perror_msg_and_fail("nanosleep"); + + return 0; +} diff --git a/tests/socketcall.c b/tests/socketcall.c new file mode 100644 index 00000000..4fe1ea3a --- /dev/null +++ b/tests/socketcall.c @@ -0,0 +1,95 @@ +/* + * Check decoding of socketcall syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_socketcall + +# include +# include +# include + +# include "xlat.h" +# include "xlat/socketcalls.h" + +static const char * +xlookup_uint(const struct xlat *xlat, const unsigned int val) +{ + for (; xlat->str != NULL; xlat++) + if (xlat->val == val) + return xlat->str; + return NULL; +} + +static const int sc_min = 1, sc_max = 20; +static void *efault; + +static void +test_socketcall(const int i, const void *const addr) +{ + const unsigned long call = + (unsigned long) 0xfacefeed00000000ULL | (unsigned int) i; + + long rc = syscall(__NR_socketcall, call, addr); + + if (i < sc_min || i > sc_max) { + printf("socketcall(%d, %p) = %ld %s (%m)\n", + (int) call, addr, rc, errno2name()); + } else if (addr == efault) { + const char *const str = xlookup_uint(socketcalls, i); + assert(str); + printf("socketcall(%s, %p) = %ld %s (%m)\n", + str, addr, rc, errno2name()); + } +} +int +main(void) +{ + assert((unsigned) sc_min == socketcalls[0].val); + assert((unsigned) sc_max == socketcalls[ARRAY_SIZE(socketcalls) - 2].val); + + const unsigned long *const args = tail_alloc(sizeof(*args) * 6); + efault = tail_alloc(1) + 1; + + int i; + for (i = sc_min - 3; i <= sc_max + 3; ++i) { + test_socketcall(i, efault); + test_socketcall(i, args); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_socketcall") + +#endif diff --git a/tests/socketcall.test b/tests/socketcall.test new file mode 100755 index 00000000..959bc83d --- /dev/null +++ b/tests/socketcall.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of socketcall syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/sockname.c b/tests/sockname.c new file mode 100644 index 00000000..c5072cac --- /dev/null +++ b/tests/sockname.c @@ -0,0 +1,156 @@ +/* + * Check decoding of sockname family syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef TEST_SYSCALL_NAME +# error TEST_SYSCALL_NAME must be defined +#endif + +#define TEST_SYSCALL_STR__(a) #a +#define TEST_SYSCALL_STR_(a) TEST_SYSCALL_STR__(a) +#define TEST_SYSCALL_STR TEST_SYSCALL_STR_(TEST_SYSCALL_NAME) +#define TEST_SOCKET TEST_SYSCALL_STR ".socket" + +#ifdef TEST_SYSCALL_PREPARE +# define PREPARE_TEST_SYSCALL_INVOCATION do { TEST_SYSCALL_PREPARE; } while (0) +#else +# define PREPARE_TEST_SYSCALL_INVOCATION do {} while (0) +#endif + +#ifndef PREFIX_S_ARGS +# define PREFIX_S_ARGS +#endif +#ifndef PREFIX_F_ARGS +# define PREFIX_F_ARGS +#endif +#ifndef PREFIX_S_STR +# define PREFIX_S_STR "" +#endif +#ifndef PREFIX_F_STR +# define PREFIX_F_STR "" +#endif +#ifndef SUFFIX_ARGS +# define SUFFIX_ARGS +#endif +#ifndef SUFFIX_STR +# define SUFFIX_STR "" +#endif + +static void +test_sockname_syscall(const int fd) +{ + socklen_t *const plen = tail_alloc(sizeof(*plen)); + *plen = sizeof(struct sockaddr_un); + struct sockaddr_un *addr = tail_alloc(*plen); + + PREPARE_TEST_SYSCALL_INVOCATION; + int rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, addr->sun_path, + (int) sizeof(struct sockaddr_un), (int) *plen, SUFFIX_STR, rc); + + memset(addr, 0, sizeof(*addr)); + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%s\"}" + ", [%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, addr->sun_path, + (int) *plen, SUFFIX_STR, rc); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, 0 SUFFIX_ARGS); + printf("%s(%d%s, %p, NULL%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, SUFFIX_STR, + sprintrc(rc)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, 0, 0 SUFFIX_ARGS); + printf("%s(%d%s, NULL, NULL%s) = %s\n", + TEST_SYSCALL_STR, fd, rc == -1 ? PREFIX_F_STR : PREFIX_S_STR, + SUFFIX_STR, sprintrc(rc)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, + plen + 1 SUFFIX_ARGS); + printf("%s(%d%s, %p, %p%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, + plen + 1, SUFFIX_STR, sprintrc(rc)); + + const size_t offsetof_sun_path = offsetof(struct sockaddr_un, sun_path); + *plen = offsetof_sun_path; + memset(addr->sun_path, 'A', sizeof(addr->sun_path)); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX}, [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, + (int) offsetof_sun_path, (int) *plen, SUFFIX_STR, rc); + + ++addr; + *plen = sizeof(struct sockaddr); + addr = (void *) addr - *plen; + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_S_ARGS, (void *) addr, + plen SUFFIX_ARGS); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + printf("%s(%d%s, {sa_family=AF_UNIX, sun_path=\"%.*s\"}" + ", [%d->%d]%s) = %d\n", + TEST_SYSCALL_STR, fd, PREFIX_S_STR, + (int) (sizeof(struct sockaddr) - offsetof_sun_path), + addr->sun_path, (int) sizeof(struct sockaddr), + (int) *plen, SUFFIX_STR, rc); + + PREPARE_TEST_SYSCALL_INVOCATION; + rc = TEST_SYSCALL_NAME(fd PREFIX_F_ARGS, (void *) addr, + plen SUFFIX_ARGS); + printf("%s(%d%s, %p, [%d]%s) = %s\n", + TEST_SYSCALL_STR, fd, PREFIX_F_STR, addr, + *plen, SUFFIX_STR, sprintrc(rc)); +} diff --git a/tests/splice.c b/tests/splice.c new file mode 100644 index 00000000..b6f25256 --- /dev/null +++ b/tests/splice.c @@ -0,0 +1,65 @@ +/* + * This file is part of splice strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_splice + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; + long long int *const off_in = tail_alloc(sizeof(*off_in)); + long long int *const off_out = tail_alloc(sizeof(*off_out)); + *off_in = 0xdeadbef1facefed1ULL; + *off_out = 0xdeadbef2facefed2ULL; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 15; + + long rc = syscall(__NR_splice, + fd_in, off_in, fd_out, off_out, len, flags); + printf("splice(%d, [%lld], %d, [%lld], %zu, %s) = %ld %s (%m)\n", + (int) fd_in, *off_in, (int) fd_out, *off_out, len, + "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_splice") + +#endif diff --git a/tests/splice.test b/tests/splice.test new file mode 100755 index 00000000..cc5c327e --- /dev/null +++ b/tests/splice.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check splice syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/sprintrc.c b/tests/sprintrc.c new file mode 100644 index 00000000..7423afb6 --- /dev/null +++ b/tests/sprintrc.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +enum sprintrc_fmt { + SPRINTRC_FMT_RAW, + SPRINTRC_FMT_GREP, +}; + +/** + * Provides pointer to static string buffer with printed return code in format + * used by strace - with errno and error message. + * + * @param rc Return code. + * @param fmt Output format. Currently, raw (used for diff matching) and grep + * (for extended POSIX regex-based pattern matching) formats are + * supported. + * @return Pointer to (statically allocated) buffer containing decimal + * representation of return code and errno/error message in case @rc + * is equal to -1. + */ +static inline const char * +sprintrc_ex(long rc, enum sprintrc_fmt fmt) +{ + static const char *formats[] = { + [SPRINTRC_FMT_RAW] = "-1 %s (%m)", + [SPRINTRC_FMT_GREP] = "-1 %s \\(%m\\)", + }; + static char buf[4096]; + + if (fmt >= ARRAY_SIZE(formats)) + perror_msg_and_fail("sprintrc_ex: incorrect format provided"); + + if (rc == 0) + return "0"; + + int ret = (rc == -1) + ? snprintf(buf, sizeof(buf), formats[fmt], errno2name()) + : snprintf(buf, sizeof(buf), "%ld", rc); + + if (ret < 0) + perror_msg_and_fail("snprintf"); + if ((size_t) ret >= sizeof(buf)) + error_msg_and_fail("snprintf overflow: got %d, expected" + " no more than %zu", ret, sizeof(buf)); + + return buf; +} + +const char * +sprintrc(long rc) +{ + return sprintrc_ex(rc, SPRINTRC_FMT_RAW); +} + +const char * +sprintrc_grep(long rc) +{ + return sprintrc_ex(rc, SPRINTRC_FMT_GREP); +} diff --git a/tests/stat.c b/tests/stat.c new file mode 100644 index 00000000..d4ca7b0b --- /dev/null +++ b/tests/stat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_stat + +# define TEST_SYSCALL_NR __NR_stat +# define TEST_SYSCALL_STR "stat" +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_stat") + +#endif diff --git a/tests/stat.test b/tests/stat.test index 4176df0e..ba8938c0 100755 --- a/tests/stat.test +++ b/tests/stat.test @@ -1,35 +1,5 @@ #!/bin/sh -# Check how ftruncate, lseek and stat family syscalls are traced. +# Check stat syscall decoding. -. "${srcdir=.}/init.sh" - -check_prog dd -check_prog find -check_prog grep -check_prog rm - -umask 022 -truncate_cmd='dd seek=46118400000 obs=1 count=0 if=/dev/null of=sample' -$truncate_cmd > $LOG 2>&1 || - { cat $LOG; framework_skip_ 'failed to create a large sparse file'; } -rm -f sample - -$STRACE -edesc $truncate_cmd 2>&1 > /dev/null 2> $LOG && -LC_ALL=C grep -E -x 'ftruncate(64)?\(1, 46118400000\) += 0' $LOG > /dev/null || - { cat $LOG; fail_ 'strace -edesc failed to trace ftruncate/ftruncate64 properly'; } - -LC_ALL=C grep -E -x 'lseek\(1, 46118400000, SEEK_CUR\) += 46118400000|_llseek\(1, 46118400000, \[46118400000\], SEEK_CUR\) += 0' $LOG > /dev/null || - { cat $LOG; fail_ 'strace -edesc failed to trace lseek/_llseek properly'; } - -$STRACE -efile find -L sample > /dev/null 2> $LOG && -LC_ALL=C grep -E -x 'stat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, 0\) += 0' $LOG > /dev/null || - { cat $LOG; fail_ 'strace -efile failed to trace stat/stat64 properly'; } - -$STRACE -efile find sample > /dev/null 2> $LOG && -LC_ALL=C grep -E -x 'lstat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, AT_SYMLINK_NOFOLLOW\) += 0' $LOG > /dev/null || - { cat $LOG; fail_ 'strace -efile failed to trace fstatat/fstatat64 properly'; } - -rm -f sample - -exit 0 +. "${srcdir=.}/statx.sh" diff --git a/tests/stat64.c b/tests/stat64.c new file mode 100644 index 00000000..782de33d --- /dev/null +++ b/tests/stat64.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_stat64 + +# define TEST_SYSCALL_NR __NR_stat64 +# define TEST_SYSCALL_STR "stat64" +# define STRUCT_STAT struct stat64 +# define STRUCT_STAT_STR "struct stat64" +# define STRUCT_STAT_IS_STAT64 1 +# include "lstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_stat64") + +#endif diff --git a/tests/stat64.test b/tests/stat64.test new file mode 100755 index 00000000..abcfb9ec --- /dev/null +++ b/tests/stat64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check stat64 syscall decoding. + +. "${srcdir=.}/statx.sh" diff --git a/tests/statfs.c b/tests/statfs.c new file mode 100644 index 00000000..6032a668 --- /dev/null +++ b/tests/statfs.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_statfs + +# define SYSCALL_ARG_FMT "\"%s\"" +# define SYSCALL_ARG(file, desc) (file) +# define SYSCALL_NR __NR_statfs +# define SYSCALL_NAME "statfs" +# include "xstatfs.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statfs") + +#endif diff --git a/tests/statfs.expected b/tests/statfs.expected new file mode 100644 index 00000000..11e9f0b1 --- /dev/null +++ b/tests/statfs.expected @@ -0,0 +1 @@ +statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type=PROC_SUPER_MAGIC, f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{val=\[[0-9]+, [0-9]+\]\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=ST_VALID(\|ST_[A-Z]+)*)?\}\) += 0 diff --git a/tests/statfs.test b/tests/statfs.test new file mode 100755 index 00000000..6075576f --- /dev/null +++ b/tests/statfs.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check statfs syscall decoding. + +. "${srcdir=.}/init.sh" + +# this test probes /proc/self/status +[ -f /proc/self/status ] || + framework_skip_ '/proc/self/status is not available' + +run_strace_match_diff -a17 diff --git a/tests/statfs64.c b/tests/statfs64.c new file mode 100644 index 00000000..f46e7670 --- /dev/null +++ b/tests/statfs64.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_statfs64 + +# define SYSCALL_ARG_FMT "\"%s\"" +# define SYSCALL_ARG(file, desc) (file) +# define SYSCALL_NR __NR_statfs64 +# define SYSCALL_NAME "statfs64" +# include "xstatfs64.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statfs64") + +#endif diff --git a/tests/statfs64.test b/tests/statfs64.test new file mode 100755 index 00000000..9c0aa278 --- /dev/null +++ b/tests/statfs64.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check statfs64 syscall decoding. + +. "${srcdir=.}/statfs.test" diff --git a/tests/statx.sh b/tests/statx.sh new file mode 100755 index 00000000..a630193d --- /dev/null +++ b/tests/statx.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of stat family syscalls. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -P $NAME.sample -P /dev/full -a32 diff --git a/tests/strace-C.expected b/tests/strace-C.expected new file mode 100644 index 00000000..832af1f3 --- /dev/null +++ b/tests/strace-C.expected @@ -0,0 +1,3 @@ +nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 +\+\+\+ exited with 0 \+\+\+ +[ ]*[0-9][0-9]*[.][0-9][0-9]* *0[.]0[0-9]* *[0-9][0-9]* *1 *nanosleep diff --git a/tests/strace-C.test b/tests/strace-C.test new file mode 100755 index 00000000..ccca9a09 --- /dev/null +++ b/tests/strace-C.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -C option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -a24 -C -enanosleep ./sleep 1 +match_grep diff --git a/tests/strace-E.expected b/tests/strace-E.expected new file mode 100644 index 00000000..d7823b7a --- /dev/null +++ b/tests/strace-E.expected @@ -0,0 +1 @@ +execve\("\./sleep", \["\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 diff --git a/tests/strace-E.test b/tests/strace-E.test new file mode 100755 index 00000000..d76ec3f5 --- /dev/null +++ b/tests/strace-E.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -E option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 > /dev/null +run_strace -E option_E_var=OPTION_E_VAL -v $args +match_grep diff --git a/tests/strace-S.test b/tests/strace-S.test new file mode 100755 index 00000000..3ea315ce --- /dev/null +++ b/tests/strace-S.test @@ -0,0 +1,32 @@ +#!/bin/sh + +# Check -S option. + +. "${srcdir=.}/init.sh" + +run_prog ./readv > /dev/null + +test_c() +{ + local sortby sortopts sedexpr + sortby="$1"; shift + sortopts="$1"; shift + sedexpr="$1"; shift + + run_strace -c -w -S "$sortby" ./readv > /dev/null + sed -r -n -e "$sedexpr" < "$LOG" > "$OUT" + + [ -s "$OUT" ] || + fail_ "$STRACE $args output mismatch" + LC_ALL=C sort -c $sortopts "$OUT" || { + echo 'Actual output:' + cat < "$LOG" + fail_ "$STRACE $args output not sorted properly" + } +} + +c='[[:space:]]+([^[:space:]]+)' +test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p' +test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p' + +rm -f "$OUT" diff --git a/tests/strace-T.expected b/tests/strace-T.expected new file mode 100644 index 00000000..1ea02046 --- /dev/null +++ b/tests/strace-T.expected @@ -0,0 +1 @@ +nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 <(1\.[01]|0\.9)[[:digit:]]{5}> diff --git a/tests/strace-T.test b/tests/strace-T.test new file mode 100755 index 00000000..7ab84a74 --- /dev/null +++ b/tests/strace-T.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -T option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -a24 -T -enanosleep ./sleep 1 +match_grep diff --git a/tests/strace-V.test b/tests/strace-V.test new file mode 100755 index 00000000..9a051e00 --- /dev/null +++ b/tests/strace-V.test @@ -0,0 +1,24 @@ +#!/bin/sh + +# Check -V option. +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%Y > /dev/null +year="$(date +%Y)" + +run_strace -V > "$LOG" + +getval() +{ + sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' ../config.h +} + +cat > "$EXP" << __EOF__ +$(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION) +Copyright (C) 1991-$year The strace developers <$(getval PACKAGE_URL)>. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +__EOF__ + +match_diff "$EXP" "$LOG" +rm -f "$EXP" diff --git a/tests/strace-f.test b/tests/strace-f.test deleted file mode 100755 index 0c4622c5..00000000 --- a/tests/strace-f.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Ensure that strace -f works. - -. "${srcdir=.}/init.sh" - -time=/usr/bin/time -check_prog $time - -$STRACE -f $time /bin/ls > $LOG 2>&1 || - { cat $LOG; fail_ 'strace -f does not work'; } diff --git a/tests/strace-ff.expected b/tests/strace-ff.expected new file mode 100644 index 00000000..627a1b4c --- /dev/null +++ b/tests/strace-ff.expected @@ -0,0 +1,2 @@ +exit_group(0) = ? ++++ exited with 0 +++ diff --git a/tests/strace-ff.test b/tests/strace-ff.test new file mode 100755 index 00000000..2ce06f19 --- /dev/null +++ b/tests/strace-ff.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check -ff option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed \ + kill -0 $$ + +./set_ptracer_any ./sleep 1 > "$OUT" & +tracee_pid=$! + +while ! [ -s "$OUT" ]; do + kill -0 $tracee_pid 2> /dev/null || + fail_ 'set_ptracer_any sleep failed' +done + +rm -f "$LOG".* +run_strace -a14 -eexit_group -ff -p $tracee_pid + +# check that output matches +match_diff "$LOG.$tracee_pid" + +# check that no other output files have been created +set -- "$LOG".* +[ "$LOG.$tracee_pid" = "$*" ] || + fail_ "too many output files: $*" + +rm -f "$OUT" "$LOG.$tracee_pid" diff --git a/tests/strace-k.test b/tests/strace-k.test index f757fb91..d5e8ed2b 100755 --- a/tests/strace-k.test +++ b/tests/strace-k.test @@ -1,6 +1,32 @@ #!/bin/sh - +# # Ensure that strace -k works. +# +# Copyright (c) 2014 Masatake YAMATO +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . "${srcdir=.}/init.sh" @@ -11,27 +37,17 @@ check_prog sed check_prog tr -./stack-fcall || - fail_ 'stack-fcall failed' - -$STRACE -h | grep '^-k' > /dev/null || - skip_ 'strace -k is not available' - -args="-e getpid -k ./stack-fcall" -$STRACE $args > $LOG 2>&1 || { - cat $LOG - fail_ "$STRACE $args failed" -} +run_prog ./stack-fcall +run_strace -e getpid -k $args expected='getpid f3 f2 f1 f0 main ' -result=$(sed -n '1,/(main+0x[a-f0-9]\+) .*/ s/^.*(\([^+]\+\)+0x[a-f0-9]\+) .*/\1/p' $LOG | +result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" | tr '\n' ' ') test "$result" = "$expected" || { - cat $LOG echo "expected: \"$expected\"" echo "result: \"$result\"" - fail_ "unexpected output from $STRACE $args" + dump_log_and_fail_with "$STRACE $args output mismatch" } exit 0 diff --git a/tests/strace-r.expected b/tests/strace-r.expected new file mode 100644 index 00000000..8009c353 --- /dev/null +++ b/tests/strace-r.expected @@ -0,0 +1,2 @@ +[ ]{5}0\.0{6} execve\("\./sleep", \["\./sleep", "1"\], \[/\* [[:digit:]]+ vars \*/\]\) = 0 +[ ]{5}(1\.[01]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+ diff --git a/tests/strace-r.test b/tests/strace-r.test new file mode 100755 index 00000000..4ba01f12 --- /dev/null +++ b/tests/strace-r.test @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check -r option. + +. "${srcdir=.}/init.sh" + +run_prog ./sleep 0 +run_strace -r -eexecve ./sleep 1 +match_grep diff --git a/tests/strace-t.test b/tests/strace-t.test new file mode 100755 index 00000000..1d213e63 --- /dev/null +++ b/tests/strace-t.test @@ -0,0 +1,20 @@ +#!/bin/sh + +# Check -t option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%T > /dev/null +run_prog ./sleep 0 + +t0="$(date +%T)" +run_strace -t -eexecve $args +t1="$(date +%T)" + +EXPECTED="$LOG.expected" +cat > "$EXPECTED" << __EOF__ +($t0|$t1) execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXPECTED" +rm -f "$EXPECTED" diff --git a/tests/strace-tt.test b/tests/strace-tt.test new file mode 100755 index 00000000..3f80001e --- /dev/null +++ b/tests/strace-tt.test @@ -0,0 +1,28 @@ +#!/bin/sh + +# Check -tt option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > "$LOG" +run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null +run_prog ./sleep 0 + +s0="$(date +%s)" +run_strace -tt -eexecve $args +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + t="$(date +%T --date "@$s")" + [ -z "$t_reg" ] && t_reg="$t" || t_reg="$t_reg|$t" + s=$(($s + 1)) +done + +cat > "$EXP" << __EOF__ +($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests/strace-ttt.test b/tests/strace-ttt.test new file mode 100755 index 00000000..4439715b --- /dev/null +++ b/tests/strace-ttt.test @@ -0,0 +1,26 @@ +#!/bin/sh + +# Check -ttt option. + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > /dev/null +run_prog ./sleep 0 + +s0="$(date +%s)" +run_strace -ttt -eexecve $args +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + [ -z "$t_reg" ] && t_reg="$s" || t_reg="$t_reg|$s" + s=$(($s + 1)) +done + +cat > "$EXP" << __EOF__ +($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +__EOF__ + +match_grep "$LOG" "$EXP" +rm -f "$EXP" diff --git a/tests/strace.supp b/tests/strace.supp new file mode 100644 index 00000000..578b0a25 --- /dev/null +++ b/tests/strace.supp @@ -0,0 +1,7 @@ +{ + get_cpuset_size: sched_getaffinity with NULL mask + Memcheck:Param + sched_getaffinity(mask) + fun:sched_getaffinity* + fun:get_cpuset_size +} diff --git a/tests/struct_flock.c b/tests/struct_flock.c new file mode 100644 index 00000000..34cf58e6 --- /dev/null +++ b/tests/struct_flock.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include "flock.h" + +#define FILE_LEN 4096 +#define EINVAL_STR "-1 EINVAL (Invalid argument)" + +#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) + +#ifdef HAVE_TYPEOF +# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) +#else +# define TYPEOF_FLOCK_OFF_T off_t +#endif + +static long +invoke_test_syscall(const unsigned int cmd, void *const p) +{ + const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd; + + return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p); +} + +static void +test_flock_einval(const int cmd, const char *name) +{ + struct_kernel_flock fl = { + .l_type = F_RDLCK, + .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL, + .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL + }; + invoke_test_syscall(cmd, &fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); +} + +static void +test_flock(void) +{ + TEST_FLOCK_EINVAL(F_SETLK); + TEST_FLOCK_EINVAL(F_SETLKW); + + struct_kernel_flock fl = { + .l_type = F_RDLCK, + .l_len = FILE_LEN + }; + long rc = invoke_test_syscall(F_SETLK, &fl); + printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + if (rc) + return; + + invoke_test_syscall(F_GETLK, &fl); + printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(F_SETLK, &fl); + printf("%s(0, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +static void +create_sample(void) +{ + char fname[] = TEST_SYSCALL_STR "_XXXXXX"; + + (void) close(0); + if (mkstemp(fname)) + perror_msg_and_fail("mkstemp: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(0, FILE_LEN)) + perror_msg_and_fail("ftruncate"); +} diff --git a/tests/sun_path.expected b/tests/sun_path.expected new file mode 100644 index 00000000..30a11c03 --- /dev/null +++ b/tests/sun_path.expected @@ -0,0 +1,3 @@ +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, 110\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, \[110->111\]\) += 0 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"\}, 110\) += 0 diff --git a/tests/sun_path.test b/tests/sun_path.test new file mode 100755 index 00000000..728328a8 --- /dev/null +++ b/tests/sun_path.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check how long sun_path addresses are traced. + +. "${srcdir=.}/init.sh" + +run_prog ./net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 +run_strace_merge -ebind,connect,getsockname $args +match_grep + +exit 0 diff --git a/tests/swap.c b/tests/swap.c new file mode 100644 index 00000000..77b25050 --- /dev/null +++ b/tests/swap.c @@ -0,0 +1,51 @@ +#include "tests.h" +#include + +#if defined __NR_swapon && defined __NR_swapoff + +# include +# include +# include + +int +main(void) +{ + static const char sample[] = "swap.sample"; + long rc; + + rc = syscall(__NR_swapon, sample, 0); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "0", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, 42); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "42", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, SWAP_FLAG_PREFER); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "SWAP_FLAG_PREFER|0", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, SWAP_FLAG_PREFER | 42); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, "SWAP_FLAG_PREFER|42", rc, errno2name()); + + rc = syscall(__NR_swapon, sample, -1L); + printf("swapon(\"%s\", %s) = %ld %s (%m)\n", + sample, + "SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|SWAP_FLAG_DISCARD_ONCE" + "|SWAP_FLAG_DISCARD_PAGES|0xfff80000|32767", + rc, errno2name()); + + rc = syscall(__NR_swapoff, sample); + printf("swapoff(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_swapon && __NR_swapoff") + +#endif diff --git a/tests/swap.test b/tests/swap.test new file mode 100755 index 00000000..a30e1fd8 --- /dev/null +++ b/tests/swap.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check swapon and swapoff syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests/symlink.c b/tests/symlink.c new file mode 100644 index 00000000..72cb4908 --- /dev/null +++ b/tests/symlink.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_symlink + +# include +# include + +int +main(void) +{ + static const char sample_1[] = "symlink_new"; + static const char sample_2[] = "symlink"; + + long rc = syscall(__NR_symlink, sample_1, sample_2); + printf("symlink(\"%s\", \"%s\") = %ld %s (%m)\n", + sample_1, sample_2, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_symlink") + +#endif diff --git a/tests/symlink.test b/tests/symlink.test new file mode 100755 index 00000000..79b93baa --- /dev/null +++ b/tests/symlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check symlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests/symlinkat.c b/tests/symlinkat.c new file mode 100644 index 00000000..6e5d617d --- /dev/null +++ b/tests/symlinkat.c @@ -0,0 +1,28 @@ +#include "tests.h" +#include + +#ifdef __NR_symlinkat + +# include +# include + +int +main(void) +{ + const long int fd = (long int) 0xdeadbeefffffffffULL; + static const char oldpath[] = "symlink_old"; + static const char newpath[] = "symlink_new"; + + long rc = syscall(__NR_symlinkat, oldpath, fd, newpath); + printf("symlinkat(\"%s\", %d, \"%s\") = %ld %s (%m)\n", + oldpath, (int) fd, newpath, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_symlinkat") + +#endif diff --git a/tests/symlinkat.test b/tests/symlinkat.test new file mode 100755 index 00000000..d8501ffd --- /dev/null +++ b/tests/symlinkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check symlinkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/sync.c b/tests/sync.c new file mode 100644 index 00000000..e6e7ce37 --- /dev/null +++ b/tests/sync.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_sync + +# include +# include + +int +main(void) +{ + printf("sync() = %ld\n", syscall(__NR_sync)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sync") + +#endif diff --git a/tests/sync.test b/tests/sync.test new file mode 100755 index 00000000..f6bf6c8f --- /dev/null +++ b/tests/sync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a7 diff --git a/tests/sync_file_range.c b/tests/sync_file_range.c new file mode 100644 index 00000000..67d31a89 --- /dev/null +++ b/tests/sync_file_range.c @@ -0,0 +1,63 @@ +/* + * Check decoding of sync_file_range syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined HAVE_SYNC_FILE_RANGE && defined __NR_sync_file_range + +# include + +int +main(void) +{ + const int fd = -1; + const off64_t offset = 0xdeadbeefbadc0dedULL; + const off64_t nbytes = 0xfacefeedcafef00dULL; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); + printf("%s(%d, %lld, %lld, SYNC_FILE_RANGE_WAIT_BEFORE" + "|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER" + "|0xfffffff8) = %d %s (%m)\n", + "sync_file_range", fd, + (long long) offset, + (long long) nbytes, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYNC_FILE_RANGE && __NR_sync_file_range") + +#endif diff --git a/tests/sync_file_range.test b/tests/sync_file_range.test new file mode 100755 index 00000000..6aa86d6c --- /dev/null +++ b/tests/sync_file_range.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync_file_range syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/sync_file_range2.c b/tests/sync_file_range2.c new file mode 100644 index 00000000..6ce7db26 --- /dev/null +++ b/tests/sync_file_range2.c @@ -0,0 +1,63 @@ +/* + * Check decoding of sync_file_range2 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined HAVE_SYNC_FILE_RANGE && defined __NR_sync_file_range2 + +# include + +int +main(void) +{ + const int fd = -1; + const off64_t offset = 0xdeadbeefbadc0ded; + const off64_t nbytes = 0xfacefeedcafef00d; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); + printf("%s(%d, SYNC_FILE_RANGE_WAIT_BEFORE" + "|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER" + "|0xfffffff8, %lld, %lld) = %d %s (%m)\n", + "sync_file_range2", fd, + (long long) offset, + (long long) nbytes, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYNC_FILE_RANGE && __NR_sync_file_range2") + +#endif diff --git a/tests/sync_file_range2.test b/tests/sync_file_range2.test new file mode 100755 index 00000000..0d9945ed --- /dev/null +++ b/tests/sync_file_range2.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync_file_range2 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/sysinfo.c b/tests/sysinfo.c new file mode 100644 index 00000000..377bdc9c --- /dev/null +++ b/tests/sysinfo.c @@ -0,0 +1,76 @@ +/* + * This file is part of sysinfo strace test. + * + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + sysinfo(NULL); + printf("sysinfo(NULL) = -1 EFAULT (%m)\n"); + + struct sysinfo * const si = tail_alloc(sizeof(*si)); + + if (sysinfo(si)) + perror_msg_and_skip("sysinfo"); + printf("sysinfo({uptime=%llu" + ", loads=[%llu, %llu, %llu]" + ", totalram=%llu" + ", freeram=%llu" + ", sharedram=%llu" + ", bufferram=%llu" + ", totalswap=%llu" + ", freeswap=%llu" + ", procs=%u" + ", totalhigh=%llu" + ", freehigh=%llu" + ", mem_unit=%u" + "}) = 0\n" + , (unsigned long long) si->uptime + , (unsigned long long) si->loads[0] + , (unsigned long long) si->loads[1] + , (unsigned long long) si->loads[2] + , (unsigned long long) si->totalram + , (unsigned long long) si->freeram + , (unsigned long long) si->sharedram + , (unsigned long long) si->bufferram + , (unsigned long long) si->totalswap + , (unsigned long long) si->freeswap + , (unsigned) si->procs + , (unsigned long long) si->totalhigh + , (unsigned long long) si->freehigh + , si->mem_unit + ); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/sysinfo.test b/tests/sysinfo.test new file mode 100755 index 00000000..806d8b61 --- /dev/null +++ b/tests/sysinfo.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of sysinfo syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/syslog.c b/tests/syslog.c new file mode 100644 index 00000000..5df96cb8 --- /dev/null +++ b/tests/syslog.c @@ -0,0 +1,27 @@ +#include "tests.h" +#include + +#ifdef __NR_syslog + +# include +# include + +# define SYSLOG_ACTION_READ 2 + +int +main(void) +{ + const long addr = (long) 0xfacefeeddeadbeefULL; + int rc = syscall(__NR_syslog, SYSLOG_ACTION_READ, addr, -1); + printf("syslog(SYSLOG_ACTION_READ, %#lx, -1) = %d %s (%m)\n", + addr, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_syslog") + +#endif diff --git a/tests/syslog.test b/tests/syslog.test new file mode 100755 index 00000000..1c2158e4 --- /dev/null +++ b/tests/syslog.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check syslog syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/tail_alloc.c b/tests/tail_alloc.c new file mode 100644 index 00000000..08081d4f --- /dev/null +++ b/tests/tail_alloc.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +void * +tail_alloc(const size_t size) +{ + const size_t page_size = get_page_size(); + const size_t len = (size + page_size - 1) & -page_size; + const size_t alloc_size = len + 6 * page_size; + + void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (MAP_FAILED == p) + perror_msg_and_fail("mmap(%zu)", alloc_size); + + void *start_work = p + 3 * page_size; + void *tail_guard = start_work + len; + + if (munmap(p, page_size) || + munmap(p + 2 * page_size, page_size) || + munmap(tail_guard, page_size) || + munmap(tail_guard + 2 * page_size, page_size)) + perror_msg_and_fail("munmap"); + + memset(start_work, 0xff, len); + return tail_guard - size; +} + +void * +tail_memdup(const void *p, const size_t size) +{ + void *dest = tail_alloc(size); + memcpy(dest, p, size); + return dest; +} diff --git a/tests/tee.c b/tests/tee.c new file mode 100644 index 00000000..66d1c94f --- /dev/null +++ b/tests/tee.c @@ -0,0 +1,60 @@ +/* + * This file is part of tee strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_tee + +# include +# include + +int +main(void) +{ + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; + const size_t len = (size_t) 0xdeadbef3facefed3ULL; + const unsigned int flags = 15; + + long rc = syscall(__NR_tee, fd_in, fd_out, len, flags); + printf("tee(%d, %d, %zu, %s) = %ld %s (%m)\n", + (int) fd_in, (int) fd_out, len, + "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_tee") + +#endif diff --git a/tests/tee.test b/tests/tee.test new file mode 100755 index 00000000..76b60003 --- /dev/null +++ b/tests/tee.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check tee syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/tests.h b/tests/tests.h new file mode 100644 index 00000000..d4294de9 --- /dev/null +++ b/tests/tests.h @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_TESTS_H +#define STRACE_TESTS_H + +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif + +# include +# include "kernel_types.h" +# include "gcc_compat.h" + +/* Tests of "strace -v" are expected to define VERBOSE to 1. */ +#ifndef VERBOSE +# define VERBOSE 0 +#endif + +/* Cached sysconf(_SC_PAGESIZE). */ +size_t get_page_size(void); + +/* Print message and strerror(errno) to stderr, then exit(1). */ +void perror_msg_and_fail(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message to stderr, then exit(1). */ +void error_msg_and_fail(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message to stderr, then exit(77). */ +void error_msg_and_skip(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +/* Print message and strerror(errno) to stderr, then exit(77). */ +void perror_msg_and_skip(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; + +/* + * Allocate memory that ends on the page boundary. + * Pages allocated by this call are preceeded by an unmapped page + * and followed also by an unmapped page. + */ +void *tail_alloc(const size_t) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)); +/* Allocate memory using tail_alloc, then memcpy. */ +void *tail_memdup(const void *, const size_t) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2)); + +/* + * Fill memory (pointed by ptr, having size bytes) with different bytes (with + * values starting with start and resetting every period) in order to catch + * sign, byte order and/or alignment errors. + */ +void fill_memory_ex(void *ptr, size_t size, unsigned char start, + unsigned char period); +/* Shortcut for fill_memory_ex(ptr, size, 0x80, 0x80) */ +void fill_memory(void *ptr, size_t size); + +/* Close stdin, move stdout to a non-standard descriptor, and print. */ +void tprintf(const char *, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)); + +/* Make a hexdump copy of C string */ +const char *hexdump_strdup(const char *); + +/* Make a hexdump copy of memory */ +const char *hexdump_memdup(const char *, size_t); + +/* Make a hexquoted copy of a string */ +const char *hexquote_strndup(const char *, size_t); + +/* Return inode number of socket descriptor. */ +unsigned long inode_of_sockfd(int); + +/* Print string in a quoted form. */ +void print_quoted_string(const char *); + +/* Print memory in a quoted form. */ +void print_quoted_memory(const char *, size_t); + +/* Read an int from the file. */ +int read_int_from_file(const char *, int *); + +/* Check whether given uid matches kernel overflowuid. */ +void check_overflowuid(const int); + +/* Check whether given gid matches kernel overflowgid. */ +void check_overflowgid(const int); + +/* Translate errno to its name. */ +const char *errno2name(void); + +/* Translate signal number to its name. */ +const char *signal2name(int); + +/* Print return code and, in case return code is -1, errno information. */ +const char *sprintrc(long rc); +/* sprintrc variant suitable for usage as part of grep pattern. */ +const char *sprintrc_grep(long rc); + +struct xlat; + +/* Print flags in symbolic form according to xlat table. */ +int printflags(const struct xlat *, const unsigned long long, const char *); + +/* Print constant in symbolic form according to xlat table. */ +int printxval(const struct xlat *, const unsigned long long, const char *); + +/* Invoke a socket syscall, either directly or via __NR_socketcall. */ +int socketcall(const int nr, const int call, + long a1, long a2, long a3, long a4, long a5); + +/* Wrappers for recvmmsg and sendmmsg syscalls. */ +struct mmsghdr; +struct timespec; +int recv_mmsg(int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); +int send_mmsg(int, struct mmsghdr *, unsigned int, unsigned int); + +/* Create a pipe with maximized descriptor numbers. */ +void pipe_maxfd(int pipefd[2]); + +#define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) +#define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) + +/* + * For 64-bit kernel_ulong_t and 32-bit pointer, + * return a kernel_ulong_t value by filling higher bits. + * For other architertures, return the original pointer. + */ +static inline kernel_ulong_t +f8ill_ptr_to_kulong(const void *const ptr) +{ + const unsigned long uptr = (unsigned long) ptr; + return F8ILL_KULONG_SUPPORTED + ? F8ILL_KULONG_MASK | uptr : (kernel_ulong_t) uptr; +} + +# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0]))) +# define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1) + +/* Zero-extend a signed integer type to unsigned long long. */ +#define zero_extend_signed_to_ull(v) \ + (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ + sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ + sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ + sizeof(v) == sizeof(long) ? (unsigned long long) (unsigned long) (v) : \ + (unsigned long long) (v)) + +/* Sign-extend an unsigned integer type to long long. */ +#define sign_extend_unsigned_to_ll(v) \ + (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ + sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ + sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ + sizeof(v) == sizeof(long) ? (long long) (long) (v) : \ + (long long) (v)) + +# define SKIP_MAIN_UNDEFINED(arg) \ + int main(void) { error_msg_and_skip("undefined: %s", arg); } + +/* + * The kernel used to define 64-bit types on 64-bit systems on a per-arch + * basis. Some architectures would use unsigned long and others would use + * unsigned long long. These types were exported as part of the + * kernel-userspace ABI and now must be maintained forever. This matches + * what the kernel exports for each architecture so we don't need to cast + * every printing of __u64 or __s64 to stdint types. + */ +# if SIZEOF_LONG == 4 +# define PRI__64 "ll" +# elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC +# define PRI__64 "l" +# else +# define PRI__64 "ll" +# endif + +# define PRI__d64 PRI__64"d" +# define PRI__u64 PRI__64"u" +# define PRI__x64 PRI__64"x" + +# if WORDS_BIGENDIAN +# define LL_PAIR(HI, LO) (HI), (LO) +# else +# define LL_PAIR(HI, LO) (LO), (HI) +# endif +# define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval)) + +# define _STR(_arg) #_arg +# define ARG_STR(_arg) (_arg), #_arg +# define ARG_ULL_STR(_arg) _arg##ULL, #_arg + +#endif /* !STRACE_TESTS_H */ diff --git a/tests/threads-execve.c b/tests/threads-execve.c new file mode 100644 index 00000000..853645ff --- /dev/null +++ b/tests/threads-execve.c @@ -0,0 +1,246 @@ +/* + * Check decoding of threads when a non-leader thread invokes execve. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static pid_t leader; +static pid_t tid; + +static void +handler(int signo) +{ +} + +static unsigned int sigsetsize; +static long +k_sigsuspend(const sigset_t *const set) +{ + return syscall(__NR_rt_sigsuspend, set, sigsetsize); +} + +static pid_t +k_gettid(void) +{ + return syscall(__NR_gettid); +} + +static void +get_sigsetsize(void) +{ + static const struct sigaction sa = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + raise(SIGUSR1); + + sigemptyset(&mask); + for (sigsetsize = sizeof(mask) / sizeof(long); + sigsetsize; sigsetsize >>= 1) { + long rc = k_sigsuspend(&mask); + if (!rc) + error_msg_and_fail("rt_sigsuspend"); + if (EINTR == errno) + break; + printf("%-5d rt_sigsuspend(%p, %u) = %s\n", + leader, &mask, sigsetsize, sprintrc(rc)); + } + if (!sigsetsize) + perror_msg_and_fail("rt_sigsuspend"); + printf("%-5d rt_sigsuspend([], %u) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", leader, sigsetsize); +} + +enum { + ACTION_exit = 0, + ACTION_rt_sigsuspend, + ACTION_nanosleep, + NUMBER_OF_ACTIONS +}; + +static const unsigned int NUMBER_OF_ITERATIONS = 1; +static unsigned int action; +static int fds[2]; + +static unsigned int +arglen(char **args) +{ + char **p; + + for (p = args; *p; ++p) + ; + + return p - args; +} + +static void * +thread(void *arg) +{ + tid = k_gettid(); + + static char buf[sizeof(action) * 3]; + sprintf(buf, "%u", action + 1); + + char **argv = arg; + argv[2] = buf; + + if (read(fds[0], fds, sizeof(fds[0]))) + perror_msg_and_fail("execve"); + + struct timespec ts = { .tv_nsec = 100000000 }; + (void) clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL); + + ts.tv_nsec = 12345; + printf("%-5d nanosleep({tv_sec=0, tv_nsec=%u}, NULL) = 0\n", + tid, (unsigned int) ts.tv_nsec); + + switch (action % NUMBER_OF_ACTIONS) { + case ACTION_exit: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), leader); + break; + case ACTION_rt_sigsuspend: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n" + "%-5d <... rt_sigsuspend resumed>) = ?\n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), + leader); + break; + case ACTION_nanosleep: + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */] \n" + "%-5d <... nanosleep resumed> )" + " = ?\n", + tid, argv[0], argv[0], argv[1], argv[2], + arglen(environ), + leader); + break; + } + + printf("%-5d +++ superseded by execve in pid %u +++\n" + "%-5d <... execve resumed> ) = 0\n", + leader, tid, + leader); + + (void) nanosleep(&ts, NULL); + execve(argv[0], argv, environ); + perror_msg_and_fail("execve"); +} + +int +main(int ac, char **av) +{ + setvbuf(stdout, NULL, _IONBF, 0); + leader = getpid(); + + if (ac < 3) { + struct timespec ts = { .tv_nsec = 1 }; + if (clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL)) + perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); + + printf("%-5d execve(\"%s\", [\"%s\"], [/* %u vars */]) = 0\n", + leader, av[0], av[0], arglen(environ)); + + get_sigsetsize(); + static char buf[sizeof(sigsetsize) * 3]; + sprintf(buf, "%u", sigsetsize); + + char *argv[] = { av[0], buf, (char *) "0", NULL }; + printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" + ", [/* %u vars */]) = 0\n", + leader, argv[0], argv[0], argv[1], argv[2], + arglen(environ)); + execve(argv[0], argv, environ); + perror_msg_and_fail("execve"); + } + + sigsetsize = atoi(av[1]); + action = atoi(av[2]); + + if (action >= NUMBER_OF_ACTIONS * NUMBER_OF_ITERATIONS) { + printf("%-5d +++ exited with 0 +++\n", leader); + return 0; + } + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pthread_t t; + errno = pthread_create(&t, NULL, thread, av); + if (errno) + perror_msg_and_fail("pthread_create"); + + struct timespec ts = { .tv_sec = 123 }; + sigset_t mask; + sigemptyset(&mask); + + static char leader_str[sizeof(leader) * 3]; + int leader_str_len = + snprintf(leader_str, sizeof(leader_str), "%-5d", leader); + + switch (action % NUMBER_OF_ACTIONS) { + case ACTION_exit: + printf("%s exit(42)%*s= ?\n", leader_str, + (int) sizeof(leader_str) - leader_str_len, " "); + close(fds[1]); + (void) syscall(__NR_exit, 42); + break; + case ACTION_rt_sigsuspend: + printf("%s rt_sigsuspend([], %u \n", + leader_str, sigsetsize); + close(fds[1]); + (void) k_sigsuspend(&mask); + break; + case ACTION_nanosleep: + printf("%s nanosleep({tv_sec=%u, tv_nsec=0}" + ", \n", + leader_str, (unsigned int) ts.tv_sec); + close(fds[1]); + (void) nanosleep(&ts, 0); + break; + } + + return 1; +} diff --git a/tests/threads-execve.test b/tests/threads-execve.test new file mode 100755 index 00000000..4a771467 --- /dev/null +++ b/tests/threads-execve.test @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Check decoding of threads when a non-leader thread invokes execve. +# +# Copyright (c) 2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. "${srcdir=.}/init.sh" + +# Check that PTRACE_EVENT_EXEC support in kernel is good enough. +# The kernel before commit v3.1-rc1~308^2~7 reported 0 instead of old pid. +require_min_kernel_version_or_skip 3.1 + +check_prog diff +run_prog > /dev/null + +set -- -a21 -f -esignal=none -e trace=execve,exit,nanosleep,rt_sigsuspend $args + +# Due to probabilistic nature of the test, try it several times. +i=0 +while [ $i -le 9 ]; do + run_strace "$@" > "$EXP" + diff -- "$EXP" "$LOG" || continue + rm -f "$EXP" + exit 0 +done + +fail_ "$STRACE $* output mismatch" diff --git a/tests/time.c b/tests/time.c new file mode 100644 index 00000000..4a5cde9c --- /dev/null +++ b/tests/time.c @@ -0,0 +1,61 @@ +/* + * This file is part of time strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_time + +# include +# include +# include +# include + +int +main(void) +{ + time_t *p = tail_alloc(sizeof(time_t)); + + time_t t = syscall(__NR_time, NULL); + if ((time_t) -1 == t) + perror_msg_and_skip("time"); + printf("time(NULL) = %jd\n", (intmax_t) t); + + t = syscall(__NR_time, p); + printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_time") + +#endif diff --git a/tests/time.test b/tests/time.test new file mode 100755 index 00000000..6ab193a4 --- /dev/null +++ b/tests/time.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check time syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/timer_create.c b/tests/timer_create.c new file mode 100644 index 00000000..1a259627 --- /dev/null +++ b/tests/timer_create.c @@ -0,0 +1,125 @@ +/* + * This file is part of timer_create strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_timer_create + +# include +# include +# include +# include +# include "sigevent.h" + +int +main(void) +{ + syscall(__NR_timer_create, CLOCK_REALTIME, NULL, NULL); + printf("timer_create(CLOCK_REALTIME, NULL, NULL) = -1 %s (%m)\n", + errno2name()); + + int tid[4] = {}; + struct_sigevent sev = { + .sigev_notify = 0xdefaced, + .sigev_signo = 0xfacefeed, + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL + }; + + syscall(__NR_timer_create, CLOCK_REALTIME, &sev, NULL); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, " + "sigev_notify=%#x /* SIGEV_??? */}, NULL) = -1 %s (%m)\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_signo, sev.sigev_notify, + errno2name()); + + sev.sigev_notify = SIGEV_NONE; + if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[0])) + perror_msg_and_skip("timer_create CLOCK_REALTIME"); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, sigev_notify=SIGEV_NONE}, " + "[%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_signo, tid[0]); + + sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_signo = SIGALRM; + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[1])) + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_SIGNAL}, [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, tid[1]); + + sev.sigev_notify = SIGEV_THREAD; + sev.sigev_un.sigev_thread.function = + (unsigned long) 0xdeadbeefbadc0dedULL; + sev.sigev_un.sigev_thread.attribute = + (unsigned long) 0xcafef00dfacefeedULL; + if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[2])) + perror_msg_and_skip("timer_create CLOCK_REALTIME"); + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" + ", sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}" + ", [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_un.sigev_thread.function, + sev.sigev_un.sigev_thread.attribute, + tid[2]); + +#ifndef SIGEV_THREAD_ID +# define SIGEV_THREAD_ID 4 +#endif + sev.sigev_notify = SIGEV_THREAD_ID; + sev.sigev_un.tid = getpid(); + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_THREAD_ID, sigev_notify_thread_id=%d}" + ", [%d]) = 0\n", + sev.sigev_value.sival_int, + sev.sigev_value.sival_ptr, + sev.sigev_un.tid, + tid[3]); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timer_create") + +#endif diff --git a/tests/timer_create.test b/tests/timer_create.test new file mode 100755 index 00000000..870a1795 --- /dev/null +++ b/tests/timer_create.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timer_create syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/timer_xettime.c b/tests/timer_xettime.c new file mode 100644 index 00000000..9eabbf08 --- /dev/null +++ b/tests/timer_xettime.c @@ -0,0 +1,112 @@ +/* + * This file is part of timer_xettime strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_timer_create \ + && defined __NR_timer_gettime \ + && defined __NR_timer_settime + +# include +# include +# include +# include +# include + +int +main(void) +{ + syscall(__NR_timer_settime, 0xdefaced, TIMER_ABSTIME, NULL, NULL); + printf("timer_settime(%d, TIMER_ABSTIME, NULL, NULL)" + " = -1 EINVAL (%m)\n", 0xdefaced); + + int tid; + struct sigevent sev = { .sigev_notify = SIGEV_NONE }; + + if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid)) + perror_msg_and_skip("timer_create"); + printf("timer_create(CLOCK_MONOTONIC, {sigev_signo=0" + ", sigev_notify=SIGEV_NONE}, [%d]) = 0\n", tid); + + struct { + struct itimerspec its; + uint32_t pad[4]; + } old = { + .its = { + .it_interval = { 0xdeface5, 0xdeface6 }, + .it_value = { 0xdeface7, 0xdeface8 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .its = { + .it_interval = { 0xdeface1, 0xdeface2 }, + .it_value = { 0xdeface3, 0xdeface4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_timer_settime, tid, 0, &new.its, &old.its)) + perror_msg_and_skip("timer_settime"); + printf("timer_settime(%d, 0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ") = 0\n", + tid, + (intmax_t) new.its.it_interval.tv_sec, + (intmax_t) new.its.it_interval.tv_nsec, + (intmax_t) new.its.it_value.tv_sec, + (intmax_t) new.its.it_value.tv_nsec, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + if (syscall(__NR_timer_gettime, tid, &old.its)) + perror_msg_and_skip("timer_gettime"); + printf("timer_gettime(%d" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + tid, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timer_create && __NR_timer_gettime && __NR_timer_settime") + +#endif diff --git a/tests/timer_xettime.test b/tests/timer_xettime.test new file mode 100755 index 00000000..08bcdd68 --- /dev/null +++ b/tests/timer_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timer_create, timer_settime, and timer_gettime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests/timerfd_xettime.c b/tests/timerfd_xettime.c new file mode 100644 index 00000000..ca7124ec --- /dev/null +++ b/tests/timerfd_xettime.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +#if defined __NR_timerfd_create \ + && defined __NR_timerfd_gettime \ + && defined __NR_timerfd_settime \ + && defined O_CLOEXEC + +# include +# include +# include +# include + +int +main(void) +{ + (void) close(0); + if (syscall(__NR_timerfd_create, CLOCK_MONOTONIC, O_CLOEXEC | O_NONBLOCK)) + perror_msg_and_skip("timerfd_create"); + puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0"); + + struct { + struct itimerspec its; + uint32_t pad[4]; + } old = { + .its = { + .it_interval = { 0xdeface5, 0xdeface6 }, + .it_value = { 0xdeface7, 0xdeface8 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .its = { + .it_interval = { 0xdeface1, 0xdeface2 }, + .it_value = { 0xdeface3, 0xdeface4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its)) + perror_msg_and_skip("timerfd_settime"); + printf("timerfd_settime(0, 0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ") = 0\n", + (intmax_t) new.its.it_interval.tv_sec, + (intmax_t) new.its.it_interval.tv_nsec, + (intmax_t) new.its.it_value.tv_sec, + (intmax_t) new.its.it_value.tv_nsec, + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + if (syscall(__NR_timerfd_gettime, 0, &old.its)) + perror_msg_and_skip("timerfd_gettime"); + printf("timerfd_gettime(0" + ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" + ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + (intmax_t) old.its.it_interval.tv_sec, + (intmax_t) old.its.it_interval.tv_nsec, + (intmax_t) old.its.it_value.tv_sec, + (intmax_t) old.its.it_value.tv_nsec); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_timerfd_create && __NR_timerfd_gettime" + " && __NR_timerfd_settime && O_CLOEXEC") + +#endif diff --git a/tests/timerfd_xettime.test b/tests/timerfd_xettime.test new file mode 100755 index 00000000..75aa21c2 --- /dev/null +++ b/tests/timerfd_xettime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check timerfd_create, timerfd_settime, and timerfd_gettime syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests/times-fail.c b/tests/times-fail.c new file mode 100644 index 00000000..cb69bd43 --- /dev/null +++ b/tests/times-fail.c @@ -0,0 +1,15 @@ +#include "tests.h" +#include +#include +#include +#include + +int +main (void) +{ + assert(syscall(__NR_times, 0x42) == -1); + printf("times(0x42) = -1 EFAULT (%m)\n"); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests/times-fail.test b/tests/times-fail.test new file mode 100755 index 00000000..ee28a060 --- /dev/null +++ b/tests/times-fail.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of failing times syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -e trace=times diff --git a/tests/times.c b/tests/times.c new file mode 100644 index 00000000..2c7b95e5 --- /dev/null +++ b/tests/times.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2015 Eugene Syromyatnikov + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * This test burns some CPU cycles in user space and kernel space in order to + * get some non-zero values returned by times(2). + */ + +#include "tests.h" +#include +#include +#include +#include + +#include +#include +#include + +enum { + NUM_USER_ITERS = 1000000, + PARENT_CPUTIME_LIMIT_NSEC = 200000000, + CHILD_CPUTIME_LIMIT_NSEC = 300000000 +}; + +int +main (void) +{ + struct timespec ts; + volatile int dummy = 0; + int i = 0; + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + const long cputime_limit = + pid ? PARENT_CPUTIME_LIMIT_NSEC : CHILD_CPUTIME_LIMIT_NSEC; + + /* Enjoying my user time */ + while (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { + if (ts.tv_sec || ts.tv_nsec >= cputime_limit) + break; + + if (i && !(ts.tv_sec || ts.tv_nsec)) + error_msg_and_skip("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 0})"); + + for (i = 0; i < NUM_USER_ITERS; ++i) + ++dummy; + } + + /* Enjoying my system time */ + while (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { + if (ts.tv_sec || ts.tv_nsec >= cputime_limit * 2) + break; + + sched_yield(); + } + + if (pid == 0) { + return 0; + } else { + wait(NULL); + } + + struct tms tbuf; + unsigned long long llres; + + /* + * On systems where user's and kernel's long types are the same, + * prefer direct times syscall over libc's times function because + * the latter is more prone to return value truncation. + */ +#undef USE_LIBC_SYSCALL +#if defined __NR_times && \ + !defined(LINUX_MIPSN32) && \ + !(defined __x86_64__ && defined __ILP32__) +# define USE_LIBC_SYSCALL 1 +#endif + +#if defined USE_LIBC_SYSCALL + long res = syscall(__NR_times, &tbuf); + + if (-1L == res) + perror_msg_and_skip("times"); + else + llres = (unsigned long) res; +#elif defined __NR_times && defined __x86_64__ && defined __ILP32__ + register long arg asm("rdi") = (long) &tbuf; + asm volatile("syscall\n\t" + : "=a"(llres) + : "0"(__NR_times), "r"(arg) + : "memory", "cc", "r11", "cx"); + if (llres > 0xfffffffffffff000) + return 77; +#else + clock_t res = times(&tbuf); + + if ((clock_t) -1 == res) + perror_msg_and_skip("times"); + if (sizeof(res) < sizeof(unsigned long long)) + llres = (unsigned long) res; + else + llres = res; +#endif + + printf("times({tms_utime=%llu, tms_stime=%llu, ", + (unsigned long long) tbuf.tms_utime, + (unsigned long long) tbuf.tms_stime); + printf("tms_cutime=%llu, tms_cstime=%llu}) = %llu\n", + (unsigned long long) tbuf.tms_cutime, + (unsigned long long) tbuf.tms_cstime, + llres); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests/times.test b/tests/times.test new file mode 100755 index 00000000..b97e0d33 --- /dev/null +++ b/tests/times.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of times syscall + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/tprintf.c b/tests/tprintf.c new file mode 100644 index 00000000..a759d8af --- /dev/null +++ b/tests/tprintf.c @@ -0,0 +1,90 @@ +/* + * Close stdin, move stdout to a non-standard descriptor, and print. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static ssize_t +write_retry(int fd, const void *buf, size_t count) +{ + ssize_t rc; + + do { + errno = 0; + rc = write(fd, buf, count); + } while (rc == -1 && EINTR == errno); + + if (rc <= 0) + perror_msg_and_fail("write"); + + return rc; +} + +static void +write_loop(int fd, const char *buf, size_t count) +{ + ssize_t offset = 0; + + while (count > 0) { + ssize_t block = write_retry(fd, &buf[offset], count); + + offset += block; + count -= (size_t) block; + } +} + +void +tprintf(const char *fmt, ...) +{ + static int initialized; + if (!initialized) { + assert(dup2(1, 3) == 3); + assert(close(1) == 0); + (void) close(0); + initialized = 1; + } + + va_list p; + va_start(p, fmt); + + static char buf[65536]; + int len = vsnprintf(buf, sizeof(buf), fmt, p); + if (len < 0) + perror_msg_and_fail("vsnprintf"); + assert((unsigned) len < sizeof(buf)); + + write_loop(3, buf, len); + + va_end(p); +} diff --git a/tests/truncate.c b/tests/truncate.c new file mode 100644 index 00000000..d9529334 --- /dev/null +++ b/tests/truncate.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_truncate + +# include +# include + +int +main(void) +{ + static const char fname[] = "truncate\nfilename"; + static const char qname[] = "truncate\\nfilename"; + const kernel_ulong_t len = (kernel_ulong_t) 0xdefaced0badc0deULL; + long rc; + + if (sizeof(len) > sizeof(long)) + rc = truncate(fname, len); + else + rc = syscall(__NR_truncate, fname, len); + + printf("truncate(\"%s\", %llu) = %ld %s (%m)\n", + qname, (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_truncate") + +#endif diff --git a/tests/truncate.test b/tests/truncate.test new file mode 100755 index 00000000..6bf1e702 --- /dev/null +++ b/tests/truncate.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check truncate syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/truncate64.c b/tests/truncate64.c new file mode 100644 index 00000000..8c29ea81 --- /dev/null +++ b/tests/truncate64.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_truncate64 + +# include +# include + +int +main(void) +{ + static const char fname[] = "truncate64\nfilename"; + static const char qname[] = "truncate64\\nfilename"; + const off_t len = 0xdefaceddeadbeefULL; + + int rc = truncate(fname, len); + printf("truncate64(\"%s\", %llu) = %d %s (%m)\n", + qname, (unsigned long long) len, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_truncate64") + +#endif diff --git a/tests/truncate64.test b/tests/truncate64.test new file mode 100755 index 00000000..c4668062 --- /dev/null +++ b/tests/truncate64.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check truncate64 syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/ugetrlimit.c b/tests/ugetrlimit.c new file mode 100644 index 00000000..a99e496d --- /dev/null +++ b/tests/ugetrlimit.c @@ -0,0 +1,14 @@ +#include "tests.h" +#include + +#ifdef __NR_ugetrlimit + +# define NR_GETRLIMIT __NR_ugetrlimit +# define STR_GETRLIMIT "ugetrlimit" +# include "xgetrlimit.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_ugetrlimit") + +#endif diff --git a/tests/ugetrlimit.test b/tests/ugetrlimit.test new file mode 100755 index 00000000..f4648ff1 --- /dev/null +++ b/tests/ugetrlimit.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of ugetrlimit syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/uio.c b/tests/uio.c index aac123a6..6291f972 100644 --- a/tests/uio.c +++ b/tests/uio.c @@ -1,32 +1,62 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include -#include -#include -#include +/* + * Copyright (c) 2014-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#if defined(HAVE_PREADV) && defined(HAVE_PWRITEV) + +# include +# include +# include +# include int main(void) { -#if defined(HAVE_PREADV) && defined(HAVE_PWRITEV) const off_t offset = 0xdefaceddeadbeefLL; - int fd; char buf[4]; struct iovec iov = { buf, sizeof buf }; - assert((fd = open("/dev/zero", O_RDONLY)) >= 0); - assert(pread(fd, buf, sizeof buf, offset) == 4); - assert(preadv(fd, &iov, 1, offset) == 4); - assert(!close(fd)); + (void) close(0); + assert(open("/dev/zero", O_RDONLY) == 0); + assert(pread(0, buf, sizeof buf, offset) == 4); + assert(preadv(0, &iov, 1, offset) == 4); + assert(!close(0)); - assert((fd = open("/dev/null", O_WRONLY)) >= 0); - assert(pwrite(fd, buf, sizeof buf, offset) == 4); - assert(pwritev(fd, &iov, 1, offset) == 4); - assert(!close(fd)); + assert(open("/dev/null", O_WRONLY) == 0); + assert(pwrite(0, buf, sizeof buf, offset) == 4); + assert(pwritev(0, &iov, 1, offset) == 4); + assert(!close(0)); return 0; +} + #else - return 77; + +SKIP_MAIN_UNDEFINED("HAVE_PREADV && HAVE_PWRITEV") + #endif -} diff --git a/tests/uio.expected b/tests/uio.expected new file mode 100644 index 00000000..98d5c06d --- /dev/null +++ b/tests/uio.expected @@ -0,0 +1,4 @@ +pread(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 +preadv\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 +pwrite(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 +pwritev\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 diff --git a/tests/uio.test b/tests/uio.test index 313761f5..020b97e9 100755 --- a/tests/uio.test +++ b/tests/uio.test @@ -4,36 +4,8 @@ . "${srcdir=.}/init.sh" -check_prog grep -check_prog rm - -./uio || { - if [ $? -eq 77 ]; then - framework_skip_ 'preadv/pwritev syscalls are not available' - else - fail_ 'uio failed' - fi -} - -args="-edesc ./uio" -$STRACE $args > $LOG 2>&1 || { - cat $LOG - fail_ "$STRACE $args failed" -} - -grep_log() -{ - local syscall="$1"; shift - - LC_ALL=C grep -E -x "$syscall$*" $LOG > /dev/null || { - cat $LOG - fail_ "$STRACE $args failed to trace \"$syscall\" properly" - } -} - -grep_log 'pread(64)?' '\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4' -grep_log 'preadv' '\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4' -grep_log 'pwrite(64)?' '\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4' -grep_log 'pwritev' '\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4' +run_prog +run_strace -edesc $args +match_grep exit 0 diff --git a/tests/umask.c b/tests/umask.c new file mode 100644 index 00000000..86903a95 --- /dev/null +++ b/tests/umask.c @@ -0,0 +1,24 @@ +#include +#include + +void +test_umask(const mode_t mode) +{ + mode_t rc = umask(0xffff0000 | mode); + printf("umask(%#03ho) = %#03o\n", (unsigned short) mode, rc); +} + +int +main(void) +{ + test_umask(0); + test_umask(06); + test_umask(026); + test_umask(0126); + test_umask(07777); + test_umask(0107777); + test_umask(-1); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/umask.test b/tests/umask.test new file mode 100755 index 00000000..1351721f --- /dev/null +++ b/tests/umask.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check umask syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests/umode_t.c b/tests/umode_t.c new file mode 100644 index 00000000..5041638e --- /dev/null +++ b/tests/umode_t.c @@ -0,0 +1,78 @@ +/* + * Check decoding of umode_t type syscall arguments. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#ifndef TEST_SYSCALL_PREFIX_ARGS +# define TEST_SYSCALL_PREFIX_ARGS +#endif +#ifndef TEST_SYSCALL_PREFIX_STR +# define TEST_SYSCALL_PREFIX_STR "" +#endif + +static const char sample[] = TEST_SYSCALL_STR; + +static void +test_syscall(unsigned short mode) +{ + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; + long rc = syscall(TEST_SYSCALL_NR, TEST_SYSCALL_PREFIX_ARGS + sample, lmode); + + if (mode <= 07) + printf("%s(%s\"%s\", 00%d) = %ld %s (%m)\n", + sample, TEST_SYSCALL_PREFIX_STR, + sample, (int) mode, rc, errno2name()); + else + printf("%s(%s\"%s\", %#03ho) = %ld %s (%m)\n", + sample, TEST_SYSCALL_PREFIX_STR, + sample, mode, rc, errno2name()); +} + +int +main(void) +{ + test_syscall(0); + test_syscall(0xffff); + test_syscall(06); + test_syscall(060); + test_syscall(0600); + test_syscall(024); + test_syscall(S_IFREG); + test_syscall(S_IFDIR | 06); + test_syscall(S_IFLNK | 060); + test_syscall(S_IFIFO | 0600); + test_syscall(S_IFCHR | 024); + test_syscall((0xffff & ~S_IFMT) | S_IFBLK); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/umount.c b/tests/umount.c new file mode 100644 index 00000000..eda7ae5c --- /dev/null +++ b/tests/umount.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef __NR_oldumount +# define TEST_SYSCALL_STR "oldumount" +#else +# if defined __NR_umount && defined __NR_umount2 +# define __NR_oldumount __NR_umount +# define TEST_SYSCALL_STR "umount" +# endif +#endif + +#ifdef __NR_oldumount + +int +main(void) +{ + static const char sample[] = "umount.sample"; + if (mkdir(sample, 0700)) + perror_msg_and_fail("mkdir: %s", sample); + + long rc = syscall(__NR_oldumount, sample); + printf("%s(\"%s\") = %ld %s (%m)\n", + TEST_SYSCALL_STR, sample, rc, errno2name()); + + if (rmdir(sample)) + perror_msg_and_fail("rmdir: %s", sample); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_oldumount") + +#endif diff --git a/tests/umount.test b/tests/umount.test new file mode 100755 index 00000000..a5840d54 --- /dev/null +++ b/tests/umount.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check umount syscall decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha) syscall=oldumount ;; + *) syscall=umount ;; +esac +run_strace_match_diff -a24 -s6 -e trace=$syscall diff --git a/tests/umount2.c b/tests/umount2.c new file mode 100644 index 00000000..1a6d8451 --- /dev/null +++ b/tests/umount2.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +#ifdef __NR_umount2 +# define TEST_SYSCALL_STR "umount2" +#else +# define __NR_umount2 __NR_umount +# define TEST_SYSCALL_STR "umount" +#endif + +int +main(void) +{ + static const char sample[] = "umount2.sample"; + if (mkdir(sample, 0700)) + perror_msg_and_fail("mkdir: %s", sample); + (void) syscall(__NR_umount2, sample, 31); + printf("%s(\"%s\", MNT_FORCE|MNT_DETACH|MNT_EXPIRE|UMOUNT_NOFOLLOW|0x10)" + " = -1 EINVAL (%m)\n", TEST_SYSCALL_STR, sample); + if (rmdir(sample)) + perror_msg_and_fail("rmdir: %s", sample); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/umount2.test b/tests/umount2.test new file mode 100755 index 00000000..c43b38db --- /dev/null +++ b/tests/umount2.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check umount2 syscall decoding. + +. "${srcdir=.}/init.sh" + +case "$STRACE_ARCH" in + alpha|ia64) syscall=umount ;; + *) syscall=umount2 ;; +esac +run_strace_match_diff -s7 -e trace=$syscall diff --git a/tests/umoven-illptr.c b/tests/umoven-illptr.c new file mode 100644 index 00000000..4deee163 --- /dev/null +++ b/tests/umoven-illptr.c @@ -0,0 +1,57 @@ +/* + * Check decoding of invalid pointer by umoven. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(void) +{ + if (F8ILL_KULONG_SUPPORTED) { + struct timespec ts = { 0, 0 }; + const void *const p = tail_memdup(&ts, sizeof(ts)); + + long rc = syscall(__NR_nanosleep, p, NULL); + printf("nanosleep({tv_sec=0, tv_nsec=0}, NULL) = %s\n", + sprintrc(rc)); + + const kernel_ulong_t ill = f8ill_ptr_to_kulong(p); + rc = syscall(__NR_nanosleep, ill, NULL); + printf("nanosleep(%#llx, NULL) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; + } else { + return 77; + } +} diff --git a/tests/umoven-illptr.test b/tests/umoven-illptr.test new file mode 100755 index 00000000..7b8cb314 --- /dev/null +++ b/tests/umoven-illptr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of invalid pointer by umoven. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests/umovestr-illptr.c b/tests/umovestr-illptr.c new file mode 100644 index 00000000..dea6885d --- /dev/null +++ b/tests/umovestr-illptr.c @@ -0,0 +1,53 @@ +/* + * Check decoding of invalid pointer by umovestr. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + if (F8ILL_KULONG_SUPPORTED) { + const void *const p = tail_memdup(".", 2); + long rc = syscall(__NR_chdir, p); + printf("chdir(\".\") = %s\n", sprintrc(rc)); + + const kernel_ulong_t ill = f8ill_ptr_to_kulong(p); + rc = syscall(__NR_chdir, ill); + printf("chdir(%#llx) = %s\n", + (unsigned long long) ill, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; + } else { + return 77; + } +} diff --git a/tests/umovestr-illptr.test b/tests/umovestr-illptr.test new file mode 100755 index 00000000..6f1cc862 --- /dev/null +++ b/tests/umovestr-illptr.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of invalid pointer by umovestr. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a11 -e trace=chdir diff --git a/tests/umovestr.c b/tests/umovestr.c new file mode 100644 index 00000000..95fccb67 --- /dev/null +++ b/tests/umovestr.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include + +int +main(void) +{ + const size_t tail_len = 257; + char *addr = tail_alloc(tail_len); + memset(addr, '/', tail_len - 1); + addr[tail_len - 1] = '\0'; + if (chdir(addr)) + perror_msg_and_skip("chdir"); + return 0; +} diff --git a/tests/umovestr.expected b/tests/umovestr.expected new file mode 100644 index 00000000..c26d877e --- /dev/null +++ b/tests/umovestr.expected @@ -0,0 +1,2 @@ +chdir("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////") = 0 ++++ exited with 0 +++ diff --git a/tests/umovestr.test b/tests/umovestr.test new file mode 100755 index 00000000..5ae8ffa9 --- /dev/null +++ b/tests/umovestr.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# umovestr short read regression test + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -e chdir $args +match_diff + +exit 0 diff --git a/tests/umovestr2.c b/tests/umovestr2.c new file mode 100644 index 00000000..b2c63d80 --- /dev/null +++ b/tests/umovestr2.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const size_t page_len = get_page_size(); + const size_t tail_len = page_len * 2 - 1; + const size_t str_len = tail_len - 1; + + char *addr = tail_alloc(tail_len); + memset(addr, '0', str_len); + addr[str_len] = '\0'; + + char *argv[] = { NULL }; + char *envp[] = { addr, NULL }; + execve("", argv, envp); + + printf("execve(\"\", [], [\"%0*u\"]) = -1 ENOENT (%m)\n", + (int) str_len, 0); + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests/umovestr2.test b/tests/umovestr2.test new file mode 100755 index 00000000..5c5d561f --- /dev/null +++ b/tests/umovestr2.test @@ -0,0 +1,15 @@ +#!/bin/sh + +# umovestr short read regression test + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -veexecve -s262144 $args > "$EXP" +check_prog sed +sed 1d < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" + +rm -f "$EXP" "$OUT" + +exit 0 diff --git a/tests/umovestr3.c b/tests/umovestr3.c new file mode 100644 index 00000000..cf2fa7d4 --- /dev/null +++ b/tests/umovestr3.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const unsigned int size = PATH_MAX - 1; + const char *p = tail_alloc(size); + const char *const efault = p + size; + + for (; p <= efault; ++p) { + int rc = chdir(p); + printf("chdir(%p) = %d %s (%m)\n", p, rc, errno2name()); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/umovestr3.test b/tests/umovestr3.test new file mode 100755 index 00000000..d5be2832 --- /dev/null +++ b/tests/umovestr3.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# yet another umovestr short read test + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=chdir diff --git a/tests/uname.c b/tests/uname.c new file mode 100644 index 00000000..cd6f51cd --- /dev/null +++ b/tests/uname.c @@ -0,0 +1,44 @@ +#include "tests.h" +#include + +#ifdef __NR_uname + +# include +# include +# include + +int main(int ac, char **av) +{ + int abbrev = ac > 1; + struct utsname *const uname = tail_alloc(sizeof(struct utsname)); + int rc = syscall(__NR_uname, uname); + printf("uname({sysname=\""); + print_quoted_string(uname->sysname); + printf("\", nodename=\""); + print_quoted_string(uname->nodename); + if (abbrev) { + printf("\", ..."); + } else { + printf("\", release=\""); + print_quoted_string(uname->release); + printf("\", version=\""); + print_quoted_string(uname->version); + printf("\", machine=\""); + print_quoted_string(uname->machine); +# ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME + printf("\", domainname=\""); + print_quoted_string(uname->domainname); +# endif + printf("\""); + } + printf("}) = %d\n", rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_uname") + +#endif diff --git a/tests/uname.test b/tests/uname.test new file mode 100755 index 00000000..03fe30cd --- /dev/null +++ b/tests/uname.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check uname syscall decoding. + +. "${srcdir=.}/init.sh" + +check_prog uniq + +run_prog > /dev/null +run_strace -v -euname $args > "$EXP" +uniq < "$LOG" > "$OUT" + +run_prog "./$NAME" abbrev > /dev/null +run_strace -euname $args >> "$EXP" +uniq < "$LOG" >> "$OUT" + +match_diff "$OUT" "$EXP" +rm -f "$OUT" "$EXP" diff --git a/tests/unix-pair-send-recv.c b/tests/unix-pair-send-recv.c new file mode 100644 index 00000000..d4ac0d23 --- /dev/null +++ b/tests/unix-pair-send-recv.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include + +#ifndef __NR_send +# define __NR_send -1 +#endif +#define SC_send 9 + +#ifndef __NR_recv +# define __NR_recv -1 +#endif +#define SC_recv 10 + +static int +sys_send(int sockfd, const void *buf, size_t len, int flags) +{ + int rc = socketcall(__NR_send, SC_send, + sockfd, (long) buf, len, flags, 0); + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("send"); + return rc; +} + +static int +sys_recv(int sockfd, const void *buf, size_t len, int flags) +{ + int rc = socketcall(__NR_recv, SC_recv, + sockfd, (long) buf, len, flags, 0); + if (rc < 0 && ENOSYS == errno) + perror_msg_and_skip("recv"); + return rc; +} + +static void +transpose(char *str, const size_t len) +{ + size_t i; + + for (i = 0; i < len / 2; ++i) { + char c = str[i]; + str[i] = str[len - 1 - i]; + str[len - 1 - i] = c; + } +} + +int +main(int ac, char **av) +{ + assert(ac == 2); + const size_t len = strlen(av[1]); + assert(len); + char *const buf0 = tail_alloc(len); + char *const buf1 = tail_alloc(len); + memcpy(buf0, av[1], len); + + (void) close(0); + (void) close(1); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + assert(sys_send(0, buf0, len, MSG_DONTROUTE) == (int) len); + assert(sys_recv(1, buf1, len, MSG_WAITALL) == (int) len); + + transpose(buf1, len); + assert(sys_send(1, buf1, len, MSG_DONTROUTE) == (int) len); + if (close(1)) + perror_msg_and_fail("close(1)"); + + assert(sys_recv(0, buf0, len, MSG_WAITALL) == (int) len); + if (close(0)) + perror_msg_and_fail("close(0)"); + assert(sys_recv(0, NULL, len, MSG_DONTWAIT) == -1); + + return 0; +} diff --git a/tests/unix-pair-send-recv.expected b/tests/unix-pair-send-recv.expected new file mode 100644 index 00000000..39359781 --- /dev/null +++ b/tests/unix-pair-send-recv.expected @@ -0,0 +1,10 @@ +send(0, "abcdefghijklmnopqrstuvwxyz", 26, MSG_DONTROUTE) = 26 + | 00000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop | + | 00010 71 72 73 74 75 76 77 78 79 7a qrstuvwxyz | +recv(1, "abcdefghijklmnopqrstuvwxyz", 26, MSG_WAITALL) = 26 +send(1, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_DONTROUTE) = 26 +recv(0, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_WAITALL) = 26 + | 00000 7a 79 78 77 76 75 74 73 72 71 70 6f 6e 6d 6c 6b zyxwvutsrqponmlk | + | 00010 6a 69 68 67 66 65 64 63 62 61 jihgfedcba | +recv(0, NULL, 26, MSG_DONTWAIT) = -1 EBADF (Bad file descriptor) ++++ exited with 0 +++ diff --git a/tests/unix-pair-send-recv.test b/tests/unix-pair-send-recv.test new file mode 100755 index 00000000..4defdebb --- /dev/null +++ b/tests/unix-pair-send-recv.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding and dumping of send and recv syscalls. + +. "${srcdir=.}/init.sh" + +run_prog ./unix-pair-send-recv abcdefghijklmnopqrstuvwxyz +run_strace -a32 -esignal=none -esend,recv -eread=0 -ewrite=0 $args +match_diff + +exit 0 diff --git a/tests/unix-pair-sendto-recvfrom.c b/tests/unix-pair-sendto-recvfrom.c new file mode 100644 index 00000000..cea382c9 --- /dev/null +++ b/tests/unix-pair-sendto-recvfrom.c @@ -0,0 +1,87 @@ +/* + * Check decoding and dumping of sendto and recvfrom syscalls. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static void +transpose(char *str, int len) +{ + int i; + + for (i = 0; i < len / 2; ++i) { + char c = str[i]; + str[i] = str[len - 1 - i]; + str[len - 1 - i] = c; + } +} + +int +main(int ac, char **av) +{ + assert(ac == 2); + const int len = strlen(av[1]); + assert(len); + + (void) close(0); + (void) close(1); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair"); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (pid) { + assert(close(1) == 0); + transpose(av[1], len); + assert(sendto(0, av[1], len, MSG_DONTROUTE, NULL, 0) == len); + assert(recvfrom(0, av[1], len, MSG_WAITALL, NULL, NULL) == len); + assert(close(0) == 0); + + int status; + assert(waitpid(pid, &status, 0) == pid); + assert(status == 0); + } else { + assert(close(0) == 0); + assert(recvfrom(1, av[1], len, MSG_WAITALL, NULL, NULL) == len); + transpose(av[1], len); + assert(sendto(1, av[1], len, MSG_DONTROUTE, NULL, 0) == len); + assert(recvfrom(1, av[1], len, MSG_WAITALL, NULL, NULL) == 0); + assert(close(1) == 0); + } + + return 0; +} diff --git a/tests/unix-pair-sendto-recvfrom.expected b/tests/unix-pair-sendto-recvfrom.expected new file mode 100644 index 00000000..f8fd2449 --- /dev/null +++ b/tests/unix-pair-sendto-recvfrom.expected @@ -0,0 +1,7 @@ +sendto(0, "zyxwvutsrqponmlkjihgfedcba", 26, MSG_DONTROUTE, NULL, 0) = 26 + | 00000 7a 79 78 77 76 75 74 73 72 71 70 6f 6e 6d 6c 6b zyxwvutsrqponmlk | + | 00010 6a 69 68 67 66 65 64 63 62 61 jihgfedcba | +recvfrom(0, "abcdefghijklmnopqrstuvwxyz", 26, MSG_WAITALL, NULL, NULL) = 26 + | 00000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop | + | 00010 71 72 73 74 75 76 77 78 79 7a qrstuvwxyz | ++++ exited with 0 +++ diff --git a/tests/unix-pair-sendto-recvfrom.test b/tests/unix-pair-sendto-recvfrom.test new file mode 100755 index 00000000..21afe236 --- /dev/null +++ b/tests/unix-pair-sendto-recvfrom.test @@ -0,0 +1,11 @@ +#!/bin/sh + +# Check decoding and dumping of sendto and recvfrom syscalls. + +. "${srcdir=.}/init.sh" + +run_prog ./unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz +run_strace -esignal=none -esendto,recvfrom -eread=0 -ewrite=0 $args +match_diff + +exit 0 diff --git a/tests/unlink.c b/tests/unlink.c new file mode 100644 index 00000000..bbb1de15 --- /dev/null +++ b/tests/unlink.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_unlink + +# include +# include + +int +main(void) +{ + static const char sample[] = "unlink_sample"; + + long rc = syscall(__NR_unlink, sample); + printf("unlink(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unlink") + +#endif diff --git a/tests/unlink.test b/tests/unlink.test new file mode 100755 index 00000000..09bf79a7 --- /dev/null +++ b/tests/unlink.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check unlink syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/unlinkat.c b/tests/unlinkat.c new file mode 100644 index 00000000..22c3de39 --- /dev/null +++ b/tests/unlinkat.c @@ -0,0 +1,34 @@ +#include "tests.h" +#include + +#ifdef __NR_unlinkat + +# include +# include + +int +main(void) +{ + static const char sample[] = "unlinkat_sample"; + const long fd = (long) 0xdeadbeefffffffffULL; + + long rc = syscall(__NR_unlinkat, fd, sample, 0); + printf("unlinkat(%d, \"%s\", 0) = %ld %s (%m)\n", + (int) fd, sample, rc, errno2name()); + + rc = syscall(__NR_unlinkat, -100, sample, -1L); + printf("unlinkat(%s, \"%s\", %s) = %ld %s (%m)\n", + "AT_FDCWD", sample, + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff", + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unlinkat") + +#endif diff --git a/tests/unlinkat.test b/tests/unlinkat.test new file mode 100755 index 00000000..864261f7 --- /dev/null +++ b/tests/unlinkat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check unlinkat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/unshare.c b/tests/unshare.c new file mode 100644 index 00000000..5aedde47 --- /dev/null +++ b/tests/unshare.c @@ -0,0 +1,80 @@ +/* + * Check decoding of unshare syscall. + * + * Copyright (c) 2016 Eugene Syromyatnikov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#include + +#ifdef __NR_unshare + +# include +# include + +int +main(void) +{ + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xbadc0ded0000000fULL; + + static struct { + kernel_ulong_t val; + const char *str; + } unshare_flags[] = { + { ARG_STR(0) }, + { 0xdeadca75, + "CLONE_THREAD|CLONE_FS|CLONE_SIGHAND|CLONE_SYSVSEM|" + "CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET|CLONE_NEWUSER|" + "CLONE_NEWCGROUP|0x80a8c075" }, + { 0x2000000, "CLONE_NEWCGROUP" }, + { ARG_STR(0x81f8f0ff) " /* CLONE_??? */" }, + }; + + long rc; + unsigned int i; + + rc = syscall(__NR_unshare, bogus_flags); + printf("unshare(%#llx /* CLONE_??? */) = %s\n", + (unsigned long long) bogus_flags, sprintrc(rc)); + + for (i = 0; i < ARRAY_SIZE(unshare_flags); i++) { + rc = syscall(__NR_unshare, unshare_flags[i].val); + printf("unshare(%s) = %s\n", + unshare_flags[i].str, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unshare"); + +#endif diff --git a/tests/unshare.test b/tests/unshare.test new file mode 100755 index 00000000..ccb9575e --- /dev/null +++ b/tests/unshare.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of setns syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests/userfaultfd.c b/tests/userfaultfd.c new file mode 100644 index 00000000..60432fa3 --- /dev/null +++ b/tests/userfaultfd.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined __NR_userfaultfd && defined O_CLOEXEC + +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_userfaultfd, 1 | O_NONBLOCK | O_CLOEXEC); + printf("userfaultfd(O_NONBLOCK|O_CLOEXEC|0x1) = %ld %s (%m)\n", + rc, errno2name()); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_userfaultfd && O_CLOEXEC") + +#endif diff --git a/tests/userfaultfd.test b/tests/userfaultfd.test new file mode 100755 index 00000000..af8b6fbe --- /dev/null +++ b/tests/userfaultfd.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check userfaultfd syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 00000000..57bb29c2 --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_ustat + +# include +# include +# include +# include +# ifdef HAVE_USTAT_H +# include +# endif + +int +main(void) +{ + const kernel_ulong_t magic = (kernel_ulong_t) 0xfacefeedffffffff; + unsigned long long buf[4]; + unsigned int dev; + long rc; + +# ifdef HAVE_USTAT_H + struct ustat *const ust = tail_alloc(sizeof(*ust)); + struct stat st; + if (stat(".", &st)) + perror_msg_and_fail("stat"); + + dev = (unsigned int) st.st_dev; + rc = syscall(__NR_ustat, dev, ust); + if (rc) + printf("ustat(makedev(%u, %u), %p) = %s\n", + major(dev), minor(dev), ust, sprintrc(rc)); + else + printf("ustat(makedev(%u, %u)" + ", {f_tfree=%llu, f_tinode=%llu}) = 0\n", + major(dev), minor(dev), + zero_extend_signed_to_ull(ust->f_tfree), + zero_extend_signed_to_ull(ust->f_tinode)); +# endif /* HAVE_USTAT_H */ + + dev = (unsigned int) magic; + rc = syscall(__NR_ustat, magic, 0); + printf("ustat(makedev(%u, %u), NULL) = %s\n", + major(dev), minor(dev), sprintrc(rc)); + + rc = syscall(__NR_ustat, magic, buf); + printf("ustat(makedev(%u, %u), %p) = %s\n", + major(dev), minor(dev), buf, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_ustat") + +#endif diff --git a/tests/ustat.test b/tests/ustat.test new file mode 100755 index 00000000..60a88e0a --- /dev/null +++ b/tests/ustat.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check ustat syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests/utime.c b/tests/utime.c new file mode 100644 index 00000000..8fd594f0 --- /dev/null +++ b/tests/utime.c @@ -0,0 +1,97 @@ +/* + * Check decoding of utime syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_utime + +# include +# include +# include +# include +# include + + +static void +print_tm(const struct tm * const p) +{ + char buf[256]; + + strftime(buf, sizeof(buf), "%FT%T%z", p); + + printf("%s", buf); +} + +static long +k_utime(const void *const filename, const void *const times) +{ + return syscall(__NR_utime, filename, times); +} + +int +main(void) +{ + static const char *const dummy_str = "dummy filename"; + + const time_t t = time(NULL); + const struct tm * const p = localtime(&t); + const struct utimbuf u = { .actime = t, .modtime = t }; + const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u)); + const char *const dummy_filename = + tail_memdup(dummy_str, sizeof(dummy_str) - 1); + + long rc = k_utime("", NULL); + printf("utime(\"\", NULL) = %s\n", sprintrc(rc)); + + rc = k_utime(dummy_filename + sizeof(dummy_str), tail_u + 1); + printf("utime(%p, %p) = %s\n", dummy_filename + sizeof(dummy_str), + tail_u + 1, sprintrc(rc)); + + rc = k_utime(dummy_filename, (struct tm *) tail_u + 1); + printf("utime(%p, %p) = %s\n", + dummy_filename, (struct tm *) tail_u + 1, sprintrc(rc)); + + rc = k_utime("utime\nfilename", tail_u); + const char *errstr = sprintrc(rc); + printf("utime(\"utime\\nfilename\", {actime="); + print_tm(p); + printf(", modtime="); + print_tm(p); + printf("}) = %s\n", errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_utime") + +#endif diff --git a/tests/utime.test b/tests/utime.test new file mode 100755 index 00000000..bd64c532 --- /dev/null +++ b/tests/utime.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of utime syscall. +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a 16 -e trace=utime diff --git a/tests/utimensat.c b/tests/utimensat.c new file mode 100644 index 00000000..6d9faac2 --- /dev/null +++ b/tests/utimensat.c @@ -0,0 +1,101 @@ +/* + * This file is part of utimensat strace test. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include + +#if defined HAVE_UTIMENSAT \ + && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW \ + && defined UTIME_NOW && defined UTIME_OMIT + +static void +print_ts(const struct timespec *ts) +{ + printf("{tv_sec=%ju, tv_nsec=%ju}", (uintmax_t) ts->tv_sec, + (uintmax_t) ts->tv_nsec); +} + +int +main(void) +{ + static const char fname[] = "utimensat\nfilename"; + + assert(utimensat(AT_FDCWD, fname, NULL, 0) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + + #define PREFIX "utimensat(AT_FDCWD, \"utimensat\\nfilename\", " + printf(PREFIX "NULL, 0) = -1 ENOENT (%m)\n"); + + struct timeval tv; + struct timespec ts[2]; + + if (gettimeofday(&tv, NULL)) + perror_msg_and_skip("gettimeofday"); + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_nsec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_nsec = tv.tv_usec + 1; + + printf(PREFIX "["); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], AT_SYMLINK_NOFOLLOW) = -1 ENOENT "); + + assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + printf("(%m)\n"); + + ts[0].tv_nsec = UTIME_NOW; + ts[1].tv_nsec = UTIME_OMIT; + assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); + if (ENOENT != errno) + error_msg_and_skip("utimensat"); + printf(PREFIX "[UTIME_NOW, UTIME_OMIT], AT_SYMLINK_NOFOLLOW)" + " = -1 ENOENT (%m)\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_UTIMENSAT && AT_FDCWD && AT_SYMLINK_NOFOLLOW" + " && UTIME_NOW && UTIME_OMIT") + +#endif diff --git a/tests/utimensat.test b/tests/utimensat.test new file mode 100755 index 00000000..52e3f316 --- /dev/null +++ b/tests/utimensat.test @@ -0,0 +1,20 @@ +#!/bin/sh + +# Check decoding of utimensat syscall. + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -e utimensat $args > "$OUT" + +check_prog grep +LC_ALL=C grep -x "utimensat(.*" "$LOG" > /dev/null || { + rm -f "$OUT" + skip_ 'test executable does not use utimensat syscall' +} + +match_diff "$LOG" "$OUT" + +rm -f "$OUT" + +exit 0 diff --git a/tests/utimes.c b/tests/utimes.c new file mode 100644 index 00000000..bbfa0310 --- /dev/null +++ b/tests/utimes.c @@ -0,0 +1,84 @@ +/* + * Check decoding of utimes syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_utimes + +# include +# include +# include +# include + +int +main(void) +{ + struct timeval tv; + if (gettimeofday(&tv, NULL)) + perror_msg_and_fail("gettimeofday"); + + static const char sample[] = "utimes_sample"; + + long rc = syscall(__NR_utimes, sample, 0); + printf("utimes(\"%s\", NULL) = %ld %s (%m)\n", + sample, rc, errno2name()); + + struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); + + ts[0].tv_sec = tv.tv_sec; + ts[0].tv_usec = tv.tv_usec; + ts[1].tv_sec = tv.tv_sec - 1; + ts[1].tv_usec = tv.tv_usec + 1; + + rc = syscall(__NR_utimes, 0, ts + 2); + printf("utimes(NULL, %p) = %ld %s (%m)\n", ts + 2, rc, errno2name()); + + rc = syscall(__NR_utimes, 0, ts + 1); + printf("utimes(NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " + "%ld %s (%m)\n", + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + ts + 2, rc, errno2name()); + + rc = syscall(__NR_utimes, "", ts); + printf("utimes(\"\", [{tv_sec=%jd, tv_usec=%jd}, " + "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", + (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, + (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, + rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_utimes") + +#endif diff --git a/tests/utimes.test b/tests/utimes.test new file mode 100755 index 00000000..99143a0b --- /dev/null +++ b/tests/utimes.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check utimes syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/vfork-f.c b/tests/vfork-f.c new file mode 100644 index 00000000..b14e4b49 --- /dev/null +++ b/tests/vfork-f.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static inline int +logit_(const char *const str) +{ + return !chdir(str); +} + +#define prefix "vfork-f." +#define logit(arg) logit_(prefix arg) + +int main(int ac, char **av) +{ + if (ac < 1) + return 1; + if (ac > 1) { + if (read(0, &ac, sizeof(int))) + return 2; + return logit("exec"); + } + + logit("start"); + + int child_wait_fds[2]; + (void) close(0); + if (pipe(child_wait_fds)) + perror_msg_and_fail("pipe"); + if (fcntl(child_wait_fds[1], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + + int parent_wait_fds[2]; + if (pipe(parent_wait_fds)) + perror_msg_and_fail("pipe"); + if (fcntl(parent_wait_fds[0], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + if (fcntl(parent_wait_fds[1], F_SETFD, FD_CLOEXEC)) + perror_msg_and_fail("fcntl"); + + char *const args[] = { av[0], (char *) "", NULL }; + pid_t pid = vfork(); + + if (pid < 0) + perror_msg_and_fail("vfork"); + + if (!pid) { + if (logit("child") || execve(args[0], args, args + 1)) + _exit(2); + } + + close(0); + close(parent_wait_fds[1]); + + if (read(parent_wait_fds[0], &parent_wait_fds[1], sizeof(int))) + perror_msg_and_fail("read"); + logit("parent"); + close(child_wait_fds[1]); + + int status; + assert(wait(&status) == pid); + assert(status == 0); + + pid_t ppid = getpid(); + logit("finish"); + + printf("%-5d chdir(\"%sstart\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%schild\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sparent\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sexec\") = -1 ENOENT (%m)\n" + "%-5d chdir(\"%sfinish\") = -1 ENOENT (%m)\n", + ppid, prefix, + pid, prefix, + ppid, prefix, + pid, prefix, + ppid, prefix); + return 0; +} diff --git a/tests/vfork-f.test b/tests/vfork-f.test new file mode 100755 index 00000000..ff4422b2 --- /dev/null +++ b/tests/vfork-f.test @@ -0,0 +1,5 @@ +#!/bin/sh + +# Check how strace -f follows vfork syscall. + +. "${srcdir=.}/fork-f.test" diff --git a/tests/vhangup.c b/tests/vhangup.c new file mode 100644 index 00000000..e7ddabba --- /dev/null +++ b/tests/vhangup.c @@ -0,0 +1,34 @@ +#include "tests.h" +#include + +#ifdef __NR_vhangup + +# include +# include + +int +main(void) +{ + if (setsid() == -1) + perror_msg_and_skip("setsid"); + + long rc = syscall(__NR_vhangup); + + /* + * On setsid() success, the new session has no controlling terminal, + * therefore a subsequent vhangup() has nothing to hangup. + * + * The system call, however, returns 0 iff the calling process + * has CAP_SYS_TTY_CONFIG capability. + */ + printf("vhangup() = %s\n", sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_vhangup") + +#endif diff --git a/tests/vhangup.test b/tests/vhangup.test new file mode 100755 index 00000000..8fe1cacb --- /dev/null +++ b/tests/vhangup.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check vhangup syscall decoding. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a10 diff --git a/tests/vmsplice.c b/tests/vmsplice.c new file mode 100644 index 00000000..f29962e3 --- /dev/null +++ b/tests/vmsplice.c @@ -0,0 +1,107 @@ +/* + * This file is part of vmsplice strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_vmsplice + +# include +# include +# include +# include + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + assert(0 == fds[0]); + assert(1 == fds[1]); + + static const char w0_c[] = "012"; + const char *w0_d = hexdump_strdup(w0_c); + void *w0 = tail_memdup(w0_c, LENGTH_OF(w0_c)); + + static const char w1_c[] = "34567"; + const char *w1_d = hexdump_strdup(w1_c); + void *w1 = tail_memdup(w1_c, LENGTH_OF(w1_c)); + + static const char w2_c[] = "89abcde"; + const char *w2_d = hexdump_strdup(w2_c); + void *w2 = tail_memdup(w2_c, LENGTH_OF(w2_c)); + + const struct iovec iov_[] = { + { + .iov_base = w0, + .iov_len = LENGTH_OF(w0_c) + }, { + .iov_base = w1, + .iov_len = LENGTH_OF(w1_c) + }, { + .iov_base = w2, + .iov_len = LENGTH_OF(w2_c) + } + }; + const struct iovec *iov = tail_memdup(iov_, sizeof(iov_)); + const unsigned int len = + LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); + + tprintf("vmsplice(1, [{iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}" + ", {iov_base=\"%s\", iov_len=%u}], %u, %s) = %u\n" + " * %u bytes in buffer 0\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 1\n" + " | 00000 %-49s %-16s |\n" + " * %u bytes in buffer 2\n" + " | 00000 %-49s %-16s |\n", + w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), + w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(iov_), + "SPLICE_F_NONBLOCK", len, + LENGTH_OF(w0_c), w0_d, w0_c, + LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); + + const long rc = syscall(__NR_vmsplice, 1, iov, ARRAY_SIZE(iov_), 2); + if (rc < 0) + perror_msg_and_skip("vmsplice"); + assert(rc == (int) len); + + tprintf("+++ exited with 0 +++\n"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_vmsplice") + +#endif diff --git a/tests/vmsplice.test b/tests/vmsplice.test new file mode 100755 index 00000000..8a80650e --- /dev/null +++ b/tests/vmsplice.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of vmsplice syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=1 diff --git a/tests/wait4-v.c b/tests/wait4-v.c new file mode 100644 index 00000000..8c0c9f59 --- /dev/null +++ b/tests/wait4-v.c @@ -0,0 +1,3 @@ +/* This file is part of wait4-v strace test. */ +#define VERBOSE 1 +#include "wait4.c" diff --git a/tests/wait4-v.test b/tests/wait4-v.test new file mode 100755 index 00000000..58e55f25 --- /dev/null +++ b/tests/wait4-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of wait4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests/wait4.c b/tests/wait4.c new file mode 100644 index 00000000..ccb3ebb9 --- /dev/null +++ b/tests/wait4.c @@ -0,0 +1,199 @@ +/* + * Check decoding of wait4 syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +static const char * +sprint_rusage(const struct rusage *const ru) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{ru_utime={tv_sec=%lu, tv_usec=%lu}" + ", ru_stime={tv_sec=%lu, tv_usec=%lu}" +#if VERBOSE + ", ru_maxrss=%lu" + ", ru_ixrss=%lu" + ", ru_idrss=%lu" + ", ru_isrss=%lu" + ", ru_minflt=%lu" + ", ru_majflt=%lu" + ", ru_nswap=%lu" + ", ru_inblock=%lu" + ", ru_oublock=%lu" + ", ru_msgsnd=%lu" + ", ru_msgrcv=%lu" + ", ru_nsignals=%lu" + ", ru_nvcsw=%lu" + ", ru_nivcsw=%lu}" +#else + ", ...}" +#endif + , (long) ru->ru_utime.tv_sec + , (long) ru->ru_utime.tv_usec + , (long) ru->ru_stime.tv_sec + , (long) ru->ru_stime.tv_usec +#if VERBOSE + , (long) ru->ru_maxrss + , (long) ru->ru_ixrss + , (long) ru->ru_idrss + , (long) ru->ru_isrss + , (long) ru->ru_minflt + , (long) ru->ru_majflt + , (long) ru->ru_nswap + , (long) ru->ru_inblock + , (long) ru->ru_oublock + , (long) ru->ru_msgsnd + , (long) ru->ru_msgrcv + , (long) ru->ru_nsignals + , (long) ru->ru_nvcsw + , (long) ru->ru_nivcsw +#endif + ); + return buf; +} + +static pid_t +do_wait4(pid_t pid, int *wstatus, int options, struct rusage *ru) +{ + sigset_t mask = {}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); + pid_t rc = wait4(pid, wstatus, options, ru); + assert(sigprocmask(SIG_UNBLOCK, &mask, NULL) == 0); + return rc; +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid; + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + int *const s = tail_alloc(sizeof(*s)); + if (wait4(pid, s, WNOHANG|__WALL, NULL)) + perror_msg_and_fail("wait4 #1"); + tprintf("wait4(%d, %p, WNOHANG|__WALL, NULL) = 0\n", pid, s); + + struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + if (wait4(pid, s, WNOHANG|__WALL, rusage)) + perror_msg_and_fail("wait4 #2"); + tprintf("wait4(%d, %p, WNOHANG|__WALL, %p) = 0\n", pid, s, rusage); + + assert(write(1, "", 1) == 1); + (void) close(1); + + assert(do_wait4(pid, s, 0, rusage) == pid); + assert(WIFEXITED(*s) && WEXITSTATUS(*s) == 42); + tprintf("wait4(%d, [{WIFEXITED(s) && WEXITSTATUS(s) == 42}], 0, %s)" + " = %d\n", pid, sprint_rusage(rusage), pid); + + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) raise(SIGUSR1); + return 1; + } + + assert(do_wait4(pid, s, __WALL, rusage) == pid); + assert(WIFSIGNALED(*s) && WTERMSIG(*s) == SIGUSR1); + tprintf("wait4(%d, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGUSR1}]" + ", __WALL, %s) = %d\n", pid, sprint_rusage(rusage), pid); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + assert(do_wait4(pid, s, WSTOPPED, rusage) == pid); + assert(WIFSTOPPED(*s) && WSTOPSIG(*s) == SIGSTOP); + tprintf("wait4(%d, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSTOP}]" + ", WSTOPPED, %s) = %d\n", pid, sprint_rusage(rusage), pid); + + if (kill(pid, SIGCONT)) + perror_msg_and_fail("kill(SIGCONT)"); + +#if defined WCONTINUED && defined WIFCONTINUED + assert(do_wait4(pid, s, WCONTINUED, rusage) == pid); + assert(WIFCONTINUED(*s)); + tprintf("wait4(%d, [{WIFCONTINUED(s)}], WCONTINUED" + ", %s) = %d\n", pid, sprint_rusage(rusage), pid); +#endif /* WCONTINUED && WIFCONTINUED */ + + assert(write(1, "", 1) == 1); + (void) close(1); + + assert(do_wait4(pid, s, 0, rusage) == pid); + assert(WIFEXITED(*s) && WEXITSTATUS(*s) == 0); + tprintf("wait4(%d, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0" + ", %s) = %d\n", pid, sprint_rusage(rusage), pid); + + assert(wait4(-1, s, WNOHANG|WSTOPPED|__WALL, rusage) == -1); + tprintf("wait4(-1, %p, WNOHANG|WSTOPPED|__WALL, %p) = -1 %s (%m)\n", + s, rusage, errno2name()); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests/wait4.test b/tests/wait4.test new file mode 100755 index 00000000..6338d1f6 --- /dev/null +++ b/tests/wait4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of wait4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/waitid-v.c b/tests/waitid-v.c new file mode 100644 index 00000000..15a8010c --- /dev/null +++ b/tests/waitid-v.c @@ -0,0 +1,3 @@ +/* This file is part of waitid-v strace test. */ +#define VERBOSE 1 +#include "waitid.c" diff --git a/tests/waitid-v.test b/tests/waitid-v.test new file mode 100755 index 00000000..eb498cb0 --- /dev/null +++ b/tests/waitid-v.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check verbose decoding of waitid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests/waitid.c b/tests/waitid.c new file mode 100644 index 00000000..6a102990 --- /dev/null +++ b/tests/waitid.c @@ -0,0 +1,263 @@ +/* + * Check decoding of waitid syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static const char * +sprint_rusage(const struct rusage *const ru) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{ru_utime={tv_sec=%lld, tv_usec=%lld}" + ", ru_stime={tv_sec=%lld, tv_usec=%lld}" +#if VERBOSE + ", ru_maxrss=%llu" + ", ru_ixrss=%llu" + ", ru_idrss=%llu" + ", ru_isrss=%llu" + ", ru_minflt=%llu" + ", ru_majflt=%llu" + ", ru_nswap=%llu" + ", ru_inblock=%llu" + ", ru_oublock=%llu" + ", ru_msgsnd=%llu" + ", ru_msgrcv=%llu" + ", ru_nsignals=%llu" + ", ru_nvcsw=%llu" + ", ru_nivcsw=%llu}" +#else + ", ...}" +#endif + , (long long) ru->ru_utime.tv_sec + , (long long) ru->ru_utime.tv_usec + , (long long) ru->ru_stime.tv_sec + , (long long) ru->ru_stime.tv_usec +#if VERBOSE + , zero_extend_signed_to_ull(ru->ru_maxrss) + , zero_extend_signed_to_ull(ru->ru_ixrss) + , zero_extend_signed_to_ull(ru->ru_idrss) + , zero_extend_signed_to_ull(ru->ru_isrss) + , zero_extend_signed_to_ull(ru->ru_minflt) + , zero_extend_signed_to_ull(ru->ru_majflt) + , zero_extend_signed_to_ull(ru->ru_nswap) + , zero_extend_signed_to_ull(ru->ru_inblock) + , zero_extend_signed_to_ull(ru->ru_oublock) + , zero_extend_signed_to_ull(ru->ru_msgsnd) + , zero_extend_signed_to_ull(ru->ru_msgrcv) + , zero_extend_signed_to_ull(ru->ru_nsignals) + , zero_extend_signed_to_ull(ru->ru_nvcsw) + , zero_extend_signed_to_ull(ru->ru_nivcsw) +#endif + ); + return buf; +} + +#define CASE(x) case x: return #x + +static const char * +si_code_2_name(const int code) +{ + switch (code) { +#ifdef CLD_EXITED + CASE(CLD_EXITED); +#endif +#ifdef CLD_KILLED + CASE(CLD_KILLED); +#endif +#ifdef CLD_DUMPED + CASE(CLD_DUMPED); +#endif +#ifdef CLD_TRAPPED + CASE(CLD_TRAPPED); +#endif +#ifdef CLD_STOPPED + CASE(CLD_STOPPED); +#endif +#ifdef CLD_CONTINUED + CASE(CLD_CONTINUED); +#endif + default: perror_msg_and_fail("unknown si_code %d", code); + } +} + +static const char * +sprint_siginfo(const siginfo_t *const si, const char *const status_text) +{ + static char buf[1024]; + snprintf(buf, sizeof(buf), + "{si_signo=SIGCHLD" + ", si_code=%s" + ", si_pid=%u" + ", si_uid=%u" + ", si_status=%s" + ", si_utime=%llu" + ", si_stime=%llu}", + si_code_2_name(si->si_code), + si->si_pid, + si->si_uid, + status_text, + zero_extend_signed_to_ull(si->si_utime), + zero_extend_signed_to_ull(si->si_stime)); + return buf; +} + +static unsigned long +poison(unsigned int v) +{ + return (unsigned long) 0xfacefeed00000000ULL | v; +} + +static long +do_waitid(const unsigned int idtype, + const unsigned int id, + const siginfo_t *const infop, + const unsigned int options, + const struct rusage *const rusage) +{ + sigset_t mask = {}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); + long rc = syscall(__NR_waitid, poison(idtype), poison(id), + infop, poison(options), rusage); + assert(sigprocmask(SIG_UNBLOCK, &mask, NULL) == 0); + return rc; +} + +int +main(void) +{ + tprintf("%s", ""); + + int fds[2]; + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + pid_t pid; + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + char c; + (void) close(1); + assert(read(0, &c, sizeof(c)) == 1); + return 42; + } + + (void) close(0); + + if (do_waitid(P_PID, pid, 0, WNOHANG|WEXITED, 0)) + perror_msg_and_fail("waitid #1"); + tprintf("waitid(P_PID, %d, NULL, WNOHANG|WEXITED, NULL) = 0\n", pid); + + siginfo_t *const sinfo = tail_alloc(sizeof(*sinfo)); + memset(sinfo, 0, sizeof(*sinfo)); + struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + if (do_waitid(P_PID, pid, sinfo, WNOHANG|WEXITED|WSTOPPED, rusage)) + perror_msg_and_fail("waitid #2"); + tprintf("waitid(P_PID, %d, {}, WNOHANG|WEXITED|WSTOPPED, %s) = 0\n", + pid, sprint_rusage(rusage)); + + assert(write(1, "", 1) == 1); + (void) close(1); + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #3"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "42"), sprint_rusage(rusage)); + + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) raise(SIGUSR1); + return 1; + } + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #4"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGUSR1"), sprint_rusage(rusage)); + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + (void) close(1); + raise(SIGSTOP); + char c; + assert(read(0, &c, sizeof(c)) == 1); + return 0; + } + + (void) close(0); + + if (do_waitid(P_PID, pid, sinfo, WSTOPPED, rusage)) + perror_msg_and_fail("waitid #5"); + tprintf("waitid(P_PID, %d, %s, WSTOPPED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGSTOP"), sprint_rusage(rusage)); + + if (kill(pid, SIGCONT)) + perror_msg_and_fail("kill(SIGCONT)"); + +#if defined WCONTINUED + if (do_waitid(P_PID, pid, sinfo, WCONTINUED, rusage)) + perror_msg_and_fail("waitid #6"); + tprintf("waitid(P_PID, %d, %s, WCONTINUED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "SIGCONT"), sprint_rusage(rusage)); +#endif /* WCONTINUED */ + + assert(write(1, "", 1) == 1); + (void) close(1); + + if (do_waitid(P_PID, pid, sinfo, WEXITED, rusage)) + perror_msg_and_fail("waitid #7"); + tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n", + pid, sprint_siginfo(sinfo, "0"), sprint_rusage(rusage)); + + long rc = do_waitid(P_ALL, -1, sinfo, WEXITED|WSTOPPED, rusage); + tprintf("waitid(P_ALL, -1, %p, WEXITED|WSTOPPED, %p)" + " = %ld %s (%m)\n", sinfo, rusage, rc, errno2name()); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; +} diff --git a/tests/waitid.test b/tests/waitid.test new file mode 100755 index 00000000..3bcba3ab --- /dev/null +++ b/tests/waitid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of waitid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/waitpid.c b/tests/waitpid.c new file mode 100644 index 00000000..2e22e245 --- /dev/null +++ b/tests/waitpid.c @@ -0,0 +1,56 @@ +/* + * Check decoding of waitpid syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#ifdef __NR_waitpid + +# include +# include +# include + +int +main(void) +{ + unsigned long pid = + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); + long rc = syscall(__NR_waitpid, pid, 0L, (unsigned long) WNOHANG); + printf("waitpid(%d, NULL, WNOHANG) = %ld %s (%m)\n", + (int) pid, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_waitpid") + +#endif diff --git a/tests/waitpid.test b/tests/waitpid.test new file mode 100755 index 00000000..93807d1f --- /dev/null +++ b/tests/waitpid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of waitpid syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/xattr-strings.c b/tests/xattr-strings.c new file mode 100644 index 00000000..310929a9 --- /dev/null +++ b/tests/xattr-strings.c @@ -0,0 +1,30 @@ +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include + +int +main(void) +{ + static const char name[] = "strace.test"; + static const char c_value[] = "foobar"; + + const char *const z_value = tail_memdup(c_value, sizeof(c_value)); + long rc; + + rc = fsetxattr(-1, name, z_value, sizeof(c_value), XATTR_REPLACE); + printf("fsetxattr(-1, \"%.*s\"..., \"%.*s\"..., %u, XATTR_REPLACE) = %s\n", + 4, name, 4, c_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests/xattr-strings.test b/tests/xattr-strings.test new file mode 100755 index 00000000..25ef360b --- /dev/null +++ b/tests/xattr-strings.test @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check *xattr syscalls decoding when limiting string size. + +. "${srcdir=.}/init.sh" + +run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests/xattr.c b/tests/xattr.c new file mode 100644 index 00000000..a772eced --- /dev/null +++ b/tests/xattr.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" + +#ifdef HAVE_SYS_XATTR_H + +# include +# include + +# ifndef XATTR_SIZE_MAX +# define XATTR_SIZE_MAX 65536 +# endif + +#define DEFAULT_STRLEN 32 + +int +main(void) +{ + static const char name[] = "strace.test"; + static const char c_value[] = "foo\0bar"; + static const char q_value[] = "foo\\0bar"; + + const char *const z_value = tail_memdup(c_value, sizeof(c_value)); + char *const efault = tail_alloc(1) + 1; + const char *const value = tail_memdup(c_value, sizeof(c_value) - 1); + char *const big = tail_alloc(XATTR_SIZE_MAX + 1); + long rc; + const char *errstr; + + rc = fsetxattr(-1, 0, 0, 0, XATTR_CREATE); + printf("fsetxattr(-1, NULL, NULL, 0, XATTR_CREATE) = %s\n", + sprintrc(rc)); + + rc = fsetxattr(-1, 0, z_value, 0, XATTR_CREATE); + printf("fsetxattr(-1, NULL, \"\", 0, XATTR_CREATE) = %s\n", + sprintrc(rc)); + + rc = fsetxattr(-1, name, big, XATTR_SIZE_MAX + 1, XATTR_CREATE); + printf("fsetxattr(-1, \"%s\", %p, %u, XATTR_CREATE) = %s\n", + name, big, XATTR_SIZE_MAX + 1, sprintrc(rc)); + + rc = fsetxattr(-1, name, value, sizeof(c_value), XATTR_CREATE); + printf("fsetxattr(-1, \"%s\", %p, %u, XATTR_CREATE) = %s\n", + name, value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = fsetxattr(-1, name, z_value, sizeof(c_value), XATTR_REPLACE); + printf("fsetxattr(-1, \"%s\", \"%s\", %u, XATTR_REPLACE) = %s\n", + name, q_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = fsetxattr(-1, name, value, sizeof(c_value) - 1, XATTR_CREATE|XATTR_REPLACE); + printf("fsetxattr(-1, \"%s\", \"%s\", %u, XATTR_CREATE|XATTR_REPLACE)" + " = %s\n", + name, q_value, (unsigned) sizeof(c_value) - 1, sprintrc(rc)); + + rc = setxattr(".", name, z_value, sizeof(c_value), XATTR_CREATE); + printf("setxattr(\".\", \"%s\", \"%s\", %u, XATTR_CREATE) = %s\n", + name, q_value, (unsigned) sizeof(c_value), sprintrc(rc)); + + rc = lsetxattr(".", name, value, sizeof(c_value) - 1, XATTR_CREATE); + printf("lsetxattr(\".\", \"%s\", \"%s\", %u, XATTR_CREATE) = %s\n", + name, q_value, (unsigned) sizeof(c_value) - 1, sprintrc(rc)); + + rc = fgetxattr(-1, name, efault, 4); + printf("fgetxattr(-1, \"%s\", %p, 4) = %s\n", + name, efault, sprintrc(rc)); + + rc = getxattr(".", name, big, XATTR_SIZE_MAX + 1); + printf("getxattr(\".\", \"%s\", %p, %u) = %s\n", + name, big, XATTR_SIZE_MAX + 1, sprintrc(rc)); + + rc = lgetxattr(".", name, big + 1, XATTR_SIZE_MAX); + printf("lgetxattr(\".\", \"%s\", %p, %u) = %s\n", + name, big + 1, XATTR_SIZE_MAX, sprintrc(rc)); + + rc = flistxattr(-1, efault, 4); + printf("flistxattr(-1, %p, 4) = %s\n", efault, sprintrc(rc)); + + rc = llistxattr("", efault + 1, 4); + printf("llistxattr(\"\", %p, 4) = %s\n", efault + 1, sprintrc(rc)); + + rc = listxattr(".", big, 0); + printf("listxattr(\".\", %p, 0) = %s\n", big, sprintrc(rc)); + + rc = listxattr(".", big, XATTR_SIZE_MAX + 1); + errstr = sprintrc(rc); + printf("listxattr(\".\", "); + if (rc < 0) + printf("%p", big); + else { + const int ellipsis = rc > DEFAULT_STRLEN; + + putchar('"'); + print_quoted_memory(big, ellipsis ? DEFAULT_STRLEN : rc); + putchar('"'); + if (ellipsis) + fputs("...", stdout); + } + printf(", %u) = %s\n", XATTR_SIZE_MAX + 1, errstr); + + rc = fremovexattr(-1, name); + printf("fremovexattr(-1, \"%s\") = %s\n", name, sprintrc(rc)); + + rc = removexattr(".", name); + printf("removexattr(\".\", \"%s\") = %s\n", name, sprintrc(rc)); + + rc = lremovexattr(".", name); + printf("lremovexattr(\".\", \"%s\") = %s\n", name, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") + +#endif diff --git a/tests/xattr.test b/tests/xattr.test new file mode 100755 index 00000000..8c7a87b9 --- /dev/null +++ b/tests/xattr.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Check *xattr syscalls decoding. + +. "${srcdir=.}/init.sh" + +syscalls= +for n in getxattr setxattr listxattr removexattr; do + syscalls="$syscalls,${n},f${n},l${n}" +done + +run_strace_match_diff -a22 -e trace=$syscalls diff --git a/tests/xchownx.c b/tests/xchownx.c new file mode 100644 index 00000000..fe582835 --- /dev/null +++ b/tests/xchownx.c @@ -0,0 +1,152 @@ +/* + * Check decoding of chown/chown32/lchown/lchown32/fchown/fchown32 syscalls. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#ifdef UGID_TYPE_IS_SHORT +# define UGID_TYPE short +# define GETEUID syscall(__NR_geteuid) +# define GETEGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUID(arg) check_overflowuid(arg) +# define CHECK_OVERFLOWGID(arg) check_overflowgid(arg) +#else +# define UGID_TYPE int +# define GETEUID geteuid() +# define GETEGID getegid() +# define CHECK_OVERFLOWUID(arg) +# define CHECK_OVERFLOWGID(arg) +#endif + +#define UNLINK_SAMPLE \ + if (unlink(sample)) perror_msg_and_fail("unlink") +#define CLOSE_SAMPLE \ + if (close(fd)) perror_msg_and_fail("close") + +#ifdef ACCESS_BY_DESCRIPTOR +# define SYSCALL_ARG1 fd +# define FMT_ARG1 "%d" +# define EOK_CMD CLOSE_SAMPLE +# define CLEANUP_CMD UNLINK_SAMPLE +#else +# define SYSCALL_ARG1 sample +# define FMT_ARG1 "\"%s\"" +# define EOK_CMD UNLINK_SAMPLE +# define CLEANUP_CMD CLOSE_SAMPLE +#endif + +static int +ugid2int(const unsigned UGID_TYPE id) +{ + if ((unsigned UGID_TYPE) -1U == id) + return -1; + else + return id; +} + +static void +print_int(const unsigned int num) +{ + if (num == -1U) + printf(", -1"); + else + printf(", %u", num); +} + +static int +num_matches_id(const unsigned int num, const unsigned int id) +{ + return num == id || num == -1U; +} + +#define PAIR(val) { val, gid }, { uid, val } + +int +main(void) +{ + static const char sample[] = SYSCALL_NAME "_sample"; + + unsigned int uid = GETEUID; + CHECK_OVERFLOWUID(uid); + unsigned int gid = GETEGID; + CHECK_OVERFLOWUID(gid); + + const struct { + const long uid, gid; + } tests[] = { + { uid, gid }, + { (unsigned long) 0xffffffff00000000ULL | uid, gid }, + { uid, (unsigned long) 0xffffffff00000000ULL | gid }, + PAIR(-1U), + PAIR(-1L), + { 0xffff0000U | uid, gid }, + { uid, 0xffff0000U | gid }, + PAIR(0xffff), + PAIR(0xc0deffffU), + PAIR(0xfacefeedU), + PAIR((long) 0xfacefeeddeadbeefULL) + }; + + int fd = open(sample, O_RDONLY | O_CREAT, 0400); + if (fd < 0) + perror_msg_and_fail("open"); + + CLEANUP_CMD; + + unsigned int i; + long expected = 0; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const unsigned int unum = ugid2int(tests[i].uid); + const unsigned int gnum = ugid2int(tests[i].gid); + + if (num_matches_id(unum, uid) && + num_matches_id(gnum, gid)) { + if (expected) + continue; + } else { + if (!expected) { + expected = -1; + EOK_CMD; + } + } + + const long rc = syscall(SYSCALL_NR, SYSCALL_ARG1, + tests[i].uid, tests[i].gid); + const char *errstr = sprintrc(rc); + printf("%s(" FMT_ARG1, SYSCALL_NAME, SYSCALL_ARG1); + print_int(unum); + print_int(gnum); + printf(") = %s\n", errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/xet_robust_list.c b/tests/xet_robust_list.c new file mode 100644 index 00000000..211dec45 --- /dev/null +++ b/tests/xet_robust_list.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_get_robust_list && defined __NR_set_robust_list + +# include +# include + +static const char * +sprintaddr(void *addr) +{ + static char buf[sizeof(addr) * 2 + sizeof("0x")]; + + if (!addr) + return "NULL"; + else + snprintf(buf, sizeof(buf), "%p", addr); + + return buf; +} + +int +main(void) +{ + const pid_t pid = getpid(); + const long long_pid = (unsigned long) (0xdeadbeef00000000LL | pid); + void **p_head = tail_alloc(sizeof(void *)); + size_t *p_len = tail_alloc(sizeof(size_t)); + + if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) + perror_msg_and_skip("get_robust_list"); + printf("get_robust_list(%d, [%s], [%lu]) = 0\n", + (int) pid, sprintaddr(*p_head), (unsigned long) *p_len); + + void *head = tail_alloc(*p_len); + if (syscall(__NR_set_robust_list, head, *p_len)) + perror_msg_and_skip("set_robust_list"); + printf("set_robust_list(%p, %lu) = 0\n", + head, (unsigned long) *p_len); + + if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) + perror_msg_and_skip("get_robust_list"); + printf("get_robust_list(%d, [%s], [%lu]) = 0\n", + (int) pid, sprintaddr(*p_head), (unsigned long) *p_len); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_robust_list && __NR_set_robust_list") + +#endif diff --git a/tests/xet_robust_list.test b/tests/xet_robust_list.test new file mode 100755 index 00000000..8a3a3820 --- /dev/null +++ b/tests/xet_robust_list.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check get_robust_list and set_robust_list syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests/xetitimer.c b/tests/xetitimer.c new file mode 100644 index 00000000..4b17edd3 --- /dev/null +++ b/tests/xetitimer.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + struct { + struct itimerval itv; + uint32_t pad[4]; + } old = { + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }, new = { + .itv = { + .it_interval = { 0xc0de1, 0xc0de2 }, + .it_value = { 0xc0de3, 0xc0de4 } + }, + .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + }; + + if (setitimer(ITIMER_REAL, &new.itv, &old.itv)) + perror_msg_and_skip("setitimer"); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", + (intmax_t) new.itv.it_interval.tv_sec, + (intmax_t) new.itv.it_interval.tv_usec, + (intmax_t) new.itv.it_value.tv_sec, + (intmax_t) new.itv.it_value.tv_usec, + (intmax_t) old.itv.it_interval.tv_sec, + (intmax_t) old.itv.it_interval.tv_usec, + (intmax_t) old.itv.it_value.tv_sec, + (intmax_t) old.itv.it_value.tv_usec); + + if (getitimer(ITIMER_REAL, &old.itv)) + perror_msg_and_skip("getitimer"); + printf("getitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " + "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", + (intmax_t) old.itv.it_interval.tv_sec, + (intmax_t) old.itv.it_interval.tv_usec, + (intmax_t) old.itv.it_value.tv_sec, + (intmax_t) old.itv.it_value.tv_usec); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/xetitimer.test b/tests/xetitimer.test new file mode 100755 index 00000000..4aa00cce --- /dev/null +++ b/tests/xetitimer.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setitimer and getitimer syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setitimer,getitimer diff --git a/tests/xetpgid.c b/tests/xetpgid.c new file mode 100644 index 00000000..24e0d7f0 --- /dev/null +++ b/tests/xetpgid.c @@ -0,0 +1,59 @@ +/* + * This file is part of xetpgid strace test. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include + +#if defined __NR_getpgid && defined __NR_setpgid + +# include +# include + +int +main(void) +{ + const int pid = getpid(); + long rc = syscall(__NR_getpgid, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("getpgid(%d) = %ld\n", pid, rc); + + rc = syscall(__NR_setpgid, + (unsigned long) 0xffffffff00000000ULL, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("setpgid(0, %d) = %ld\n", pid, rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpgid && __NR_setpgid") + +#endif diff --git a/tests/xetpgid.test b/tests/xetpgid.test new file mode 100755 index 00000000..07f4f9e8 --- /dev/null +++ b/tests/xetpgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpgid and setpgid syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests/xetpriority.c b/tests/xetpriority.c new file mode 100644 index 00000000..ed552598 --- /dev/null +++ b/tests/xetpriority.c @@ -0,0 +1,31 @@ +#include "tests.h" +#include + +#if defined __NR_getpriority && defined __NR_setpriority + +# include +# include +# include + +int +main(void) +{ + const int pid = getpid(); + long rc = syscall(__NR_getpriority, PRIO_PROCESS, + (unsigned long) 0xffffffff00000000ULL | pid); + printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc); + + rc = syscall(__NR_setpriority, PRIO_PROCESS, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL); + printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpriority && _NR_setpriority") + +#endif diff --git a/tests/xetpriority.test b/tests/xetpriority.test new file mode 100755 index 00000000..2c84ba41 --- /dev/null +++ b/tests/xetpriority.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpriority and setpriority syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests/xettimeofday.c b/tests/xettimeofday.c new file mode 100644 index 00000000..d36c57b4 --- /dev/null +++ b/tests/xettimeofday.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + struct { + struct timeval tv; + uint32_t pad0[2]; + struct timezone tz; + uint32_t pad1[2]; + } t = { + .pad0 = { 0xdeadbeef, 0xbadc0ded }, + .pad1 = { 0xdeadbeef, 0xbadc0ded } + }; + + if (syscall(__NR_gettimeofday, &t.tv, NULL)) + perror_msg_and_skip("gettimeofday"); + printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}, NULL) = 0\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec); + + if (syscall(__NR_gettimeofday, &t.tv, &t.tz)) + perror_msg_and_skip("gettimeofday"); + printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = 0\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, + t.tz.tz_minuteswest, t.tz.tz_dsttime); + + t.tv.tv_sec = -1; + t.tv.tv_usec = 1000000000; + assert(syscall(__NR_settimeofday, &t.tv, &t.tz) == -1); + printf("settimeofday({tv_sec=%jd, tv_usec=%jd}" + ", {tz_minuteswest=%d, tz_dsttime=%d})" + " = -1 EINVAL (%m)\n", + (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, + t.tz.tz_minuteswest, t.tz.tz_dsttime); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/xettimeofday.test b/tests/xettimeofday.test new file mode 100755 index 00000000..68764e46 --- /dev/null +++ b/tests/xettimeofday.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check gettimeofday and settimeofday syscalls decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests/xgetrlimit.c b/tests/xgetrlimit.c new file mode 100644 index 00000000..78d9cb99 --- /dev/null +++ b/tests/xgetrlimit.c @@ -0,0 +1,91 @@ +/* + * Check decoding of getrlimit/ugetrlimit syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/resources.h" + +const char * +sprint_rlim(kernel_ulong_t lim) +{ + if (sizeof(lim) == sizeof(uint64_t)) { + if (lim == (kernel_ulong_t) -1ULL) + return "RLIM64_INFINITY"; + } else { + if (lim == (kernel_ulong_t) -1U) + return "RLIM_INFINITY"; + } + + static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; + static int i; + i &= 1; + if (lim > 1024 && lim % 1024 == 0) + sprintf(buf[i], "%llu*1024", (unsigned long long) lim / 1024); + else + sprintf(buf[i], "%llu", (unsigned long long) lim); + + return buf[i++]; +} + +#ifdef NR_GETRLIMIT + +int +main(void) +{ + kernel_ulong_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); + const struct xlat *xlat; + + for (xlat = resources; xlat->str; ++xlat) { + unsigned long res = 0xfacefeed00000000ULL | xlat->val; + long rc = syscall(NR_GETRLIMIT, res, 0); + if (rc && ENOSYS == errno) + perror_msg_and_skip(STR_GETRLIMIT); + printf("%s(%s, NULL) = %ld %s (%m)\n", + STR_GETRLIMIT, xlat->str, rc, errno2name()); + + rc = syscall(NR_GETRLIMIT, res, rlimit); + if (rc) + printf("%s(%s, NULL) = %ld %s (%m)\n", + STR_GETRLIMIT, xlat->str, rc, errno2name()); + else + printf("%s(%s, {rlim_cur=%s, rlim_max=%s})" + " = 0\n", STR_GETRLIMIT, xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1])); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#endif /* NR_GETRLIMIT */ diff --git a/tests/xselect.c b/tests/xselect.c new file mode 100644 index 00000000..39e87ac7 --- /dev/null +++ b/tests/xselect.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Based on test by Dr. David Alan Gilbert + */ + +#include +#include +#include +#include + +static fd_set set[0x1000000 / sizeof(fd_set)]; + +int main(void) +{ + int fds[2]; + struct { + struct timeval tv; + int pad[2]; + } tm_in = { + .tv = { .tv_sec = 0xc0de1, .tv_usec = 0xc0de2 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }, tm = tm_in; + + if (pipe(fds)) + perror_msg_and_fail("pipe"); + + /* + * Start with a nice simple select. + */ + FD_ZERO(set); + FD_SET(fds[0], set); + FD_SET(fds[1], set); + int rc = syscall(TEST_SYSCALL_NR, fds[1] + 1, set, set, set, NULL); + if (rc < 0) + perror_msg_and_skip(TEST_SYSCALL_STR); + assert(rc == 1); + printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", + TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1]); + + /* + * Another simple one, with a timeout. + */ + FD_SET(1, set); + FD_SET(2, set); + FD_SET(fds[0], set); + FD_SET(fds[1], set); + assert(syscall(TEST_SYSCALL_NR, fds[1] + 1, NULL, set, NULL, &tm.tv) == 3); + printf("%s(%d, NULL, [1 2 %d %d], NULL, {tv_sec=%lld, tv_usec=%lld})" + " = 3 (out [1 2 %d], left {tv_sec=%lld, tv_usec=%lld})\n", + TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], + (long long) tm_in.tv.tv_sec, (long long) tm_in.tv.tv_usec, + fds[1], + (long long) tm.tv.tv_sec, (long long) tm.tv.tv_usec); + + /* + * Now the crash case that trinity found, negative nfds + * but with a pointer to a large chunk of valid memory. + */ + FD_ZERO(set); + FD_SET(fds[1],set); + assert(syscall(TEST_SYSCALL_NR, -1, NULL, set, NULL, NULL) == -1); + printf("%s(-1, NULL, %p, NULL, NULL) = -1 EINVAL (%m)\n", + TEST_SYSCALL_STR, set); + + /* + * Another variant, with nfds exceeding FD_SETSIZE limit. + */ + FD_ZERO(set); + FD_SET(fds[0],set); + tm.tv.tv_sec = 0; + tm.tv.tv_usec = 123; + assert(syscall(TEST_SYSCALL_NR, FD_SETSIZE + 1, set, set + 1, NULL, &tm.tv) == 0); + printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=123}) = 0 (Timeout)\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, fds[0]); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/xstatfs.c b/tests/xstatfs.c new file mode 100644 index 00000000..26c43dee --- /dev/null +++ b/tests/xstatfs.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define SYSCALL_INVOKE(file, desc, ptr, size) \ + syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), ptr) +#define PRINT_SYSCALL_HEADER(file, desc, size) \ + printf("%s(" SYSCALL_ARG_FMT ", ", SYSCALL_NAME, SYSCALL_ARG(file, desc)) + +#define STRUCT_STATFS struct statfs +#ifdef HAVE_STRUCT_STATFS_F_FRSIZE +# define PRINT_F_FRSIZE +#endif +#ifdef HAVE_STRUCT_STATFS_F_FLAGS +# define PRINT_F_FLAGS +#endif +#if defined HAVE_STRUCT_STATFS_F_FSID_VAL +# define PRINT_F_FSID f_fsid.val +#elif defined HAVE_STRUCT_STATFS_F_FSID___VAL +# define PRINT_F_FSID f_fsid.__val +#endif + +#include "xstatfsx.c" diff --git a/tests/xstatfs64.c b/tests/xstatfs64.c new file mode 100644 index 00000000..8f50de29 --- /dev/null +++ b/tests/xstatfs64.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define SYSCALL_INVOKE(file, desc, ptr, size) \ + syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), size, ptr) +#define PRINT_SYSCALL_HEADER(file, desc, size) \ + printf("%s(" SYSCALL_ARG_FMT ", %u, ", SYSCALL_NAME, \ + SYSCALL_ARG(file, desc), (unsigned) size) + +#define STRUCT_STATFS struct statfs64 +#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE +# define PRINT_F_FRSIZE +#endif +#ifdef HAVE_STRUCT_STATFS64_F_FLAGS +# define PRINT_F_FLAGS +#endif +#if defined HAVE_STRUCT_STATFS64_F_FSID_VAL +# define PRINT_F_FSID f_fsid.val +#elif defined HAVE_STRUCT_STATFS64_F_FSID___VAL +# define PRINT_F_FSID f_fsid.__val +#endif +#define CHECK_ODD_SIZE + +#include "xstatfsx.c" diff --git a/tests/xstatfsx.c b/tests/xstatfsx.c new file mode 100644 index 00000000..d8288f1f --- /dev/null +++ b/tests/xstatfsx.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include + +#include "xlat.h" +#include "xlat/fsmagic.h" +#include "xlat/statfs_flags.h" + +#define PRINT_NUM(arg) \ + if (sizeof(b->arg) == sizeof(int)) \ + printf(", %s=%u", #arg, (unsigned int) b->arg); \ + else if (sizeof(b->arg) == sizeof(long)) \ + printf(", %s=%lu", #arg, (unsigned long) b->arg); \ + else \ + printf(", %s=%llu", #arg, (unsigned long long) b->arg) + +static void +print_statfs_type(const char *const prefix, const unsigned int magic) +{ + fputs(prefix, stdout); + unsigned int i; + for (i = 0; i < ARRAY_SIZE(fsmagic); ++i) + if (magic == fsmagic[i].val) { + fputs(fsmagic[i].str, stdout); + return; + } + printf("%#x", magic); +} + +static void +print_statfs(const char *const sample, const char *magic_str) +{ + int fd = open(sample, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", sample); + + STRUCT_STATFS *const b = tail_alloc(sizeof(*b)); + long rc = SYSCALL_INVOKE(sample, fd, b, sizeof(*b)); + if (rc) + perror_msg_and_skip(SYSCALL_NAME); + + PRINT_SYSCALL_HEADER(sample, fd, sizeof(*b)); + if (magic_str) + printf("{f_type=%s", magic_str); + else + print_statfs_type("{f_type=", b->f_type); + PRINT_NUM(f_bsize); + PRINT_NUM(f_blocks); + PRINT_NUM(f_bfree); + PRINT_NUM(f_bavail); + PRINT_NUM(f_files); + PRINT_NUM(f_ffree); +#ifdef PRINT_F_FSID + printf(", f_fsid={val=[%u, %u]}", + (unsigned) b->PRINT_F_FSID[0], (unsigned) b->PRINT_F_FSID[1]); +#endif + PRINT_NUM(f_namelen); +#ifdef PRINT_F_FRSIZE + PRINT_NUM(f_frsize); +#endif +#ifdef PRINT_F_FLAGS + if (b->f_flags & ST_VALID) { + printf(", f_flags="); + printflags(statfs_flags, b->f_flags, "ST_???"); + } +#endif + printf("}) = 0\n"); +} + +int +main(void) +{ + print_statfs("/proc/self/status", "PROC_SUPER_MAGIC"); + + print_statfs(".", NULL); + + long rc = SYSCALL_INVOKE("", -1, 0, sizeof(STRUCT_STATFS)); + const char *errstr = sprintrc(rc); + PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS)); + printf("NULL) = %s\n", errstr); + +#ifdef CHECK_ODD_SIZE + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + rc = SYSCALL_INVOKE("", -1, addr, sizeof(STRUCT_STATFS) + 1); + errstr = sprintrc(rc); + PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS) + 1); + printf("%#lx) = %s\n", addr, errstr); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/xstatx.c b/tests/xstatx.c new file mode 100644 index 00000000..0d5fca87 --- /dev/null +++ b/tests/xstatx.c @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if defined HAVE_FTRUNCATE && defined HAVE_FUTIMENS + +# ifndef TEST_SYSCALL_STR +# error TEST_SYSCALL_STR must be defined +# endif +# ifndef TEST_SYSCALL_INVOKE +# error TEST_SYSCALL_INVOKE must be defined +# endif +# ifndef PRINT_SYSCALL_HEADER +# error PRINT_SYSCALL_HEADER must be defined +# endif +# ifndef PRINT_SYSCALL_FOOTER +# error PRINT_SYSCALL_FOOTER must be defined +# endif + +# include +# include +# include +# include +# include +# include + +static void +print_time(const time_t t) +{ + if (!t) { + printf("0"); + return; + } + + struct tm *p = localtime(&t); + + if (p) { + char buf[256]; + + strftime(buf, sizeof(buf), "%FT%T%z", p); + + printf("%s", buf); + } else { + printf("%llu", zero_extend_signed_to_ull(t)); + } +} + +# ifndef STRUCT_STAT +# define STRUCT_STAT struct stat +# define STRUCT_STAT_STR "struct stat" +# define STRUCT_STAT_IS_STAT64 0 +# endif +# ifndef SAMPLE_SIZE +# define SAMPLE_SIZE ((libc_off_t) 43147718418ULL) +# endif + +typedef off_t libc_off_t; + +# define stat libc_stat +# define stat64 libc_stat64 +# include +# include +# undef stat +# undef stat64 + +# undef st_atime +# undef st_mtime +# undef st_ctime +# include "asm_stat.h" + +# if STRUCT_STAT_IS_STAT64 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# if defined MPERS_IS_m32 +# ifdef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined MPERS_IS_mx32 +# ifdef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined HAVE_STRUCT_STAT64_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif /* MPERS_IS_m32 || MPERS_IS_mx32 || HAVE_STRUCT_STAT64_ST_MTIME_NSEC */ +# else /* !STRUCT_STAT_IS_STAT64 */ +# if defined MPERS_IS_m32 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# elif defined MPERS_IS_mx32 +# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +# ifdef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC +# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +# endif +# endif /* MPERS_IS_m32 || MPERS_IS_mx32 */ +# endif /* STRUCT_STAT_IS_STAT64 */ + +# ifndef TEST_BOGUS_STRUCT_STAT +# define TEST_BOGUS_STRUCT_STAT 1 +# endif + +# ifndef IS_FSTAT +# define IS_FSTAT 0 +# endif + +# ifndef OLD_STAT +# define OLD_STAT 0 +# endif + +static void +print_ftype(const unsigned int mode) +{ + if (S_ISREG(mode)) + printf("S_IFREG"); + else if (S_ISDIR(mode)) + printf("S_IFDIR"); + else if (S_ISCHR(mode)) + printf("S_IFCHR"); + else if (S_ISBLK(mode)) + printf("S_IFBLK"); + else + printf("%#o", mode & S_IFMT); +} + +static void +print_perms(const unsigned int mode) +{ + printf("%#o", mode & ~S_IFMT); +} + +static void +print_stat(const STRUCT_STAT *st) +{ + printf("{st_dev=makedev(%u, %u)", + (unsigned int) major(zero_extend_signed_to_ull(st->st_dev)), + (unsigned int) minor(zero_extend_signed_to_ull(st->st_dev))); + printf(", st_ino=%llu", zero_extend_signed_to_ull(st->st_ino)); + printf(", st_mode="); + print_ftype(st->st_mode); + printf("|"); + print_perms(st->st_mode); + printf(", st_nlink=%llu", zero_extend_signed_to_ull(st->st_nlink)); + printf(", st_uid=%llu", zero_extend_signed_to_ull(st->st_uid)); + printf(", st_gid=%llu", zero_extend_signed_to_ull(st->st_gid)); +# if OLD_STAT + printf(", st_blksize=0, st_blocks=0"); +# else /* !OLD_STAT */ + printf(", st_blksize=%llu", zero_extend_signed_to_ull(st->st_blksize)); + printf(", st_blocks=%llu", zero_extend_signed_to_ull(st->st_blocks)); +# endif /* OLD_STAT */ + + switch (st->st_mode & S_IFMT) { + case S_IFCHR: case S_IFBLK: + printf(", st_rdev=makedev(%u, %u)", + (unsigned int) major(zero_extend_signed_to_ull(st->st_rdev)), + (unsigned int) minor(zero_extend_signed_to_ull(st->st_rdev))); + break; + default: + printf(", st_size=%llu", zero_extend_signed_to_ull(st->st_size)); + } + + printf(", st_atime="); + print_time(sign_extend_unsigned_to_ll(st->st_atime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_atime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_atime_nsec)); +# endif + printf(", st_mtime="); + print_time(sign_extend_unsigned_to_ll(st->st_mtime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_mtime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_mtime_nsec)); +# endif + printf(", st_ctime="); + print_time(sign_extend_unsigned_to_ll(st->st_ctime)); +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT + if (st->st_ctime_nsec) + printf(".%09llu", zero_extend_signed_to_ull(st->st_ctime_nsec)); +# endif + printf("}"); +} + +static int +create_sample(const char *fname, const libc_off_t size) +{ + static const struct timespec ts[] = { + {-10843, 135}, {-10841, 246} + }; + + (void) close(0); + if (open(fname, O_RDWR | O_CREAT | O_TRUNC, 0640)) { + perror(fname); + return 77; + } + if (ftruncate(0, size)) { + perror("ftruncate"); + return 77; + } + if (futimens(0, ts)) { + perror("futimens"); + return 77; + } + return 0; +} + +int +main(void) +{ +# if !IS_FSTAT + static const char full[] = "/dev/full"; +# endif + static const char sample[] = TEST_SYSCALL_STR ".sample"; + STRUCT_STAT st[2]; + + int rc; + + rc = create_sample(sample, SAMPLE_SIZE); + if (rc) { + (void) unlink(sample); + return rc; + } + +# if TEST_BOGUS_STRUCT_STAT + STRUCT_STAT *st_cut = tail_alloc(sizeof(long) * 4); + rc = TEST_SYSCALL_INVOKE(sample, st_cut); + PRINT_SYSCALL_HEADER(sample); + printf("%p", st_cut); + PRINT_SYSCALL_FOOTER(rc); +# endif + +# if !IS_FSTAT + rc = TEST_SYSCALL_INVOKE(full, st); + PRINT_SYSCALL_HEADER(full); + if (rc) + printf("%p", st); + else + print_stat(st); + PRINT_SYSCALL_FOOTER(rc); +# endif + + if ((rc = TEST_SYSCALL_INVOKE(sample, st))) { +# if OLD_STAT + if (errno != EOVERFLOW) +# endif + { + perror(TEST_SYSCALL_STR); + (void) unlink(sample); + return 77; + } + } + (void) unlink(sample); + if (!rc && zero_extend_signed_to_ull(SAMPLE_SIZE) != + zero_extend_signed_to_ull(st[0].st_size)) { + fprintf(stderr, "Size mismatch: " + "requested size(%llu) != st_size(%llu)\n", + zero_extend_signed_to_ull(SAMPLE_SIZE), + zero_extend_signed_to_ull(st[0].st_size)); + fprintf(stderr, "The most likely reason for this is incorrect" + " definition of %s.\n" + "Here is some diagnostics that might help:\n", + STRUCT_STAT_STR); + +#define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ + fprintf(stderr, "offsetof(%s, %s) = %zu" \ + ", sizeof(%s) = %zu\n", \ + STRUCT_STAT_STR, #member, \ + offsetof(STRUCT_STAT, member), \ + #member, sizeof((object).member)) + + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_dev); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_ino); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_mode); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_nlink); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_uid); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_gid); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_rdev); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_size); +# if !OLD_STAT + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blksize); + LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blocks); +# endif /* !OLD_STAT */ + + return 1; + } + + PRINT_SYSCALL_HEADER(sample); + if (rc) + printf("%p", st); + else + print_stat(st); + PRINT_SYSCALL_FOOTER(rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_FTRUNCATE && HAVE_FUTIMENS") + +#endif diff --git a/time.c b/time.c index 1ad90d9a..6c542f63 100644 --- a/time.c +++ b/time.c @@ -28,252 +28,83 @@ */ #include "defs.h" -#include +#include +#include #include -#include -#include - -#ifndef UTIME_NOW -#define UTIME_NOW ((1l << 30) - 1l) -#endif -#ifndef UTIME_OMIT -#define UTIME_OMIT ((1l << 30) - 2l) -#endif - -struct timeval32 -{ - u_int32_t tv_sec, tv_usec; -}; static void -tprint_timeval32(struct tcb *tcp, const struct timeval32 *tv) -{ - tprintf("{%u, %u}", tv->tv_sec, tv->tv_usec); -} - -static void -tprint_timeval(struct tcb *tcp, const struct timeval *tv) -{ - tprintf("{%lu, %lu}", - (unsigned long) tv->tv_sec, (unsigned long) tv->tv_usec); -} - -void -printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special) -{ - char buf[TIMEVAL_TEXT_BUFSIZE]; - sprinttv(buf, tcp, addr, bitness, special); - tprints(buf); -} - -char * -sprinttv(char *buf, struct tcb *tcp, long addr, enum bitness_t bitness, int special) +print_timezone(struct tcb *const tcp, const kernel_ulong_t addr) { - int rc; + struct timezone tz; - if (addr == 0) - return stpcpy(buf, "NULL"); - - if (!verbose(tcp)) - return buf + sprintf(buf, "%#lx", addr); - - if (bitness == BITNESS_32 -#if SUPPORTED_PERSONALITIES > 1 - || current_wordsize == 4 -#endif - ) - { - struct timeval32 tv; - - rc = umove(tcp, addr, &tv); - if (rc >= 0) { - if (special && tv.tv_sec == 0) { - if (tv.tv_usec == UTIME_NOW) - return stpcpy(buf, "UTIME_NOW"); - if (tv.tv_usec == UTIME_OMIT) - return stpcpy(buf, "UTIME_OMIT"); - } - return buf + sprintf(buf, "{%u, %u}", - tv.tv_sec, tv.tv_usec); - } - } else { - struct timeval tv; - - rc = umove(tcp, addr, &tv); - if (rc >= 0) { - if (special && tv.tv_sec == 0) { - if (tv.tv_usec == UTIME_NOW) - return stpcpy(buf, "UTIME_NOW"); - if (tv.tv_usec == UTIME_OMIT) - return stpcpy(buf, "UTIME_OMIT"); - } - return buf + sprintf(buf, "{%lu, %lu}", - (unsigned long) tv.tv_sec, - (unsigned long) tv.tv_usec); - } - } - - return stpcpy(buf, "{...}"); -} - -void -print_timespec(struct tcb *tcp, long addr) -{ - char buf[TIMESPEC_TEXT_BUFSIZE]; - sprint_timespec(buf, tcp, addr); - tprints(buf); -} - -void -sprint_timespec(char *buf, struct tcb *tcp, long addr) -{ - if (addr == 0) - strcpy(buf, "NULL"); - else if (!verbose(tcp)) - sprintf(buf, "%#lx", addr); - else { - int rc; - -#if SUPPORTED_PERSONALITIES > 1 - if (current_wordsize == 4) { - struct timeval32 tv; - - rc = umove(tcp, addr, &tv); - if (rc >= 0) - sprintf(buf, "{%u, %u}", - tv.tv_sec, tv.tv_usec); - } else -#endif - { - struct timespec ts; - - rc = umove(tcp, addr, &ts); - if (rc >= 0) - sprintf(buf, "{%lu, %lu}", - (unsigned long) ts.tv_sec, - (unsigned long) ts.tv_nsec); - } - if (rc < 0) - strcpy(buf, "{...}"); - } -} - -int -sys_time(struct tcb *tcp) -{ - if (exiting(tcp)) { - printnum(tcp, tcp->u_arg[0], "%ld"); - } - return 0; -} + if (umove_or_printaddr(tcp, addr, &tz)) + return; -int -sys_stime(struct tcb *tcp) -{ - if (exiting(tcp)) { - printnum(tcp, tcp->u_arg[0], "%ld"); - } - return 0; + tprintf("{tz_minuteswest=%d, tz_dsttime=%d}", + tz.tz_minuteswest, tz.tz_dsttime); } -int -sys_gettimeofday(struct tcb *tcp) +SYS_FUNC(gettimeofday) { if (exiting(tcp)) { - if (syserror(tcp)) { - tprintf("%#lx, %#lx", - tcp->u_arg[0], tcp->u_arg[1]); - return 0; - } - printtv(tcp, tcp->u_arg[0]); + print_timeval(tcp, tcp->u_arg[0]); tprints(", "); - printtv(tcp, tcp->u_arg[1]); + print_timezone(tcp, tcp->u_arg[1]); } return 0; } #ifdef ALPHA -int -sys_osf_gettimeofday(struct tcb *tcp) +SYS_FUNC(osf_gettimeofday) { if (exiting(tcp)) { - if (syserror(tcp)) { - tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]); - return 0; - } - printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0); + print_timeval32(tcp, tcp->u_arg[0]); tprints(", "); - printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0); + print_timezone(tcp, tcp->u_arg[1]); } return 0; } #endif -int -sys_settimeofday(struct tcb *tcp) +SYS_FUNC(settimeofday) { - if (entering(tcp)) { - printtv(tcp, tcp->u_arg[0]); - tprints(", "); - printtv(tcp, tcp->u_arg[1]); - } - return 0; + print_timeval(tcp, tcp->u_arg[0]); + tprints(", "); + print_timezone(tcp, tcp->u_arg[1]); + + return RVAL_DECODED; } #ifdef ALPHA -int -sys_osf_settimeofday(struct tcb *tcp) +SYS_FUNC(osf_settimeofday) { - if (entering(tcp)) { - printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0); - tprints(", "); - printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0); - } - return 0; -} -#endif + print_timeval32(tcp, tcp->u_arg[0]); + tprints(", "); + print_timezone(tcp, tcp->u_arg[1]); -int -sys_adjtime(struct tcb *tcp) -{ - if (entering(tcp)) { - printtv(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printtv(tcp, tcp->u_arg[1]); - } - return 0; + return RVAL_DECODED; } +#endif -int -sys_nanosleep(struct tcb *tcp) +SYS_FUNC(nanosleep) { if (entering(tcp)) { print_timespec(tcp, tcp->u_arg[0]); tprints(", "); } else { - /* Second (returned) timespec is only significant - * if syscall was interrupted. On success, we print - * only its address, since kernel doesn't modify it, + + /* + * Second (returned) timespec is only significant if syscall + * was interrupted. On success and in case of other errors we + * print only its address, since kernel doesn't modify it, * and printing the value may show uninitialized data. */ - switch (tcp->u_error) { - default: - /* Not interrupted (slept entire interval) */ - if (tcp->u_arg[1]) { - tprintf("%#lx", tcp->u_arg[1]); - break; - } - /* Fall through: print_timespec(NULL) prints "NULL" */ - case ERESTARTSYS: - case ERESTARTNOINTR: - case ERESTARTNOHAND: - case ERESTART_RESTARTBLOCK: - /* Interrupted */ + if (is_erestart(tcp)) { + temporarily_clear_syserror(tcp); print_timespec(tcp, tcp->u_arg[1]); + restore_cleared_syserror(tcp); + } else { + printaddr(tcp->u_arg[1]); } } return 0; @@ -281,238 +112,72 @@ sys_nanosleep(struct tcb *tcp) #include "xlat/itimer_which.h" -static void -printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness) -{ - if (addr == 0) - tprints("NULL"); - else if (!verbose(tcp)) - tprintf("%#lx", addr); - else { - int rc; - - if (bitness == BITNESS_32 -#if SUPPORTED_PERSONALITIES > 1 - || current_wordsize == 4 -#endif - ) - { - struct { - struct timeval32 it_interval, it_value; - } itv; - - rc = umove(tcp, addr, &itv); - if (rc >= 0) { - tprints("{it_interval="); - tprint_timeval32(tcp, &itv.it_interval); - tprints(", it_value="); - tprint_timeval32(tcp, &itv.it_value); - tprints("}"); - } - } else { - struct itimerval itv; - - rc = umove(tcp, addr, &itv); - if (rc >= 0) { - tprints("{it_interval="); - tprint_timeval(tcp, &itv.it_interval); - tprints(", it_value="); - tprint_timeval(tcp, &itv.it_value); - tprints("}"); - } - } - if (rc < 0) - tprints("{...}"); - } -} - -#define printitv(tcp, addr) \ - printitv_bitness((tcp), (addr), BITNESS_CURRENT) - -int -sys_getitimer(struct tcb *tcp) +SYS_FUNC(getitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printitv(tcp, tcp->u_arg[1]); + print_itimerval(tcp, tcp->u_arg[1]); } return 0; } #ifdef ALPHA -int -sys_osf_getitimer(struct tcb *tcp) +SYS_FUNC(osf_getitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32); + print_itimerval32(tcp, tcp->u_arg[1]); } return 0; } #endif -int -sys_setitimer(struct tcb *tcp) +SYS_FUNC(setitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); tprints(", "); - printitv(tcp, tcp->u_arg[1]); + print_itimerval(tcp, tcp->u_arg[1]); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[2]); - else - printitv(tcp, tcp->u_arg[2]); + print_itimerval(tcp, tcp->u_arg[2]); } return 0; } #ifdef ALPHA -int -sys_osf_setitimer(struct tcb *tcp) +SYS_FUNC(osf_setitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); tprints(", "); - printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32); + print_itimerval32(tcp, tcp->u_arg[1]); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[2]); - else - printitv_bitness(tcp, tcp->u_arg[2], BITNESS_32); + print_itimerval32(tcp, tcp->u_arg[2]); } return 0; } #endif -#include "xlat/adjtimex_modes.h" -#include "xlat/adjtimex_status.h" #include "xlat/adjtimex_state.h" -#if SUPPORTED_PERSONALITIES > 1 static int -tprint_timex32(struct tcb *tcp, long addr) +do_adjtimex(struct tcb *const tcp, const kernel_ulong_t addr) { - struct { - unsigned int modes; - int offset; - int freq; - int maxerror; - int esterror; - int status; - int constant; - int precision; - int tolerance; - struct timeval32 time; - int tick; - int ppsfreq; - int jitter; - int shift; - int stabil; - int jitcnt; - int calcnt; - int errcnt; - int stbcnt; - } tx; - - if (umove(tcp, addr, &tx) < 0) - return -1; - - tprints("{modes="); - printflags(adjtimex_modes, tx.modes, "ADJ_???"); - tprintf(", offset=%d, freq=%d, maxerror=%d, ", - tx.offset, tx.freq, tx.maxerror); - tprintf("esterror=%u, status=", tx.esterror); - printflags(adjtimex_status, tx.status, "STA_???"); - tprintf(", constant=%d, precision=%u, ", - tx.constant, tx.precision); - tprintf("tolerance=%d, time=", tx.tolerance); - tprint_timeval32(tcp, &tx.time); - tprintf(", tick=%d, ppsfreq=%d, jitter=%d", - tx.tick, tx.ppsfreq, tx.jitter); - tprintf(", shift=%d, stabil=%d, jitcnt=%d", - tx.shift, tx.stabil, tx.jitcnt); - tprintf(", calcnt=%d, errcnt=%d, stbcnt=%d", - tx.calcnt, tx.errcnt, tx.stbcnt); - tprints("}"); - return 0; -} -#endif /* SUPPORTED_PERSONALITIES > 1 */ - -static int -tprint_timex(struct tcb *tcp, long addr) -{ - struct timex tx; - -#if SUPPORTED_PERSONALITIES > 1 - if (current_wordsize == 4) - return tprint_timex32(tcp, addr); -#endif - if (umove(tcp, addr, &tx) < 0) - return -1; - -#if LINUX_VERSION_CODE < 66332 - tprintf("{mode=%d, offset=%ld, frequency=%ld, ", - tx.mode, tx.offset, tx.frequency); - tprintf("maxerror=%ld, esterror=%lu, status=%u, ", - tx.maxerror, tx.esterror, tx.status); - tprintf("time_constant=%ld, precision=%lu, ", - tx.time_constant, tx.precision); - tprintf("tolerance=%ld, time=", tx.tolerance); - tprint_timeval(tcp, &tx.time); -#else - tprints("{modes="); - printflags(adjtimex_modes, tx.modes, "ADJ_???"); - tprintf(", offset=%ld, freq=%ld, maxerror=%ld, ", - (long) tx.offset, (long) tx.freq, (long) tx.maxerror); - tprintf("esterror=%lu, status=", (long) tx.esterror); - printflags(adjtimex_status, tx.status, "STA_???"); - tprintf(", constant=%ld, precision=%lu, ", - (long) tx.constant, (long) tx.precision); - tprintf("tolerance=%ld, time=", (long) tx.tolerance); - tprint_timeval(tcp, &tx.time); - tprintf(", tick=%ld, ppsfreq=%ld, jitter=%ld", - (long) tx.tick, (long) tx.ppsfreq, (long) tx.jitter); - tprintf(", shift=%d, stabil=%ld, jitcnt=%ld", - tx.shift, (long) tx.stabil, (long) tx.jitcnt); - tprintf(", calcnt=%ld, errcnt=%ld, stbcnt=%ld", - (long) tx.calcnt, (long) tx.errcnt, (long) tx.stbcnt); -#endif - tprints("}"); - return 0; -} - -static int -do_adjtimex(struct tcb *tcp, long addr) -{ - if (addr == 0) - tprints("NULL"); - else if (syserror(tcp) || !verbose(tcp)) - tprintf("%#lx", addr); - else if (tprint_timex(tcp, addr) < 0) - tprints("{...}"); - if (syserror(tcp)) + if (print_timex(tcp, addr)) return 0; - tcp->auxstr = xlookup(adjtimex_state, tcp->u_rval); + tcp->auxstr = xlookup(adjtimex_state, (kernel_ulong_t) tcp->u_rval); if (tcp->auxstr) return RVAL_STR; return 0; } -int -sys_adjtimex(struct tcb *tcp) +SYS_FUNC(adjtimex) { if (exiting(tcp)) return do_adjtimex(tcp, tcp->u_arg[0]); @@ -545,53 +210,52 @@ printclockname(int clockid) printxval(clocknames, clockid, "CLOCK_???"); } -int -sys_clock_settime(struct tcb *tcp) +SYS_FUNC(clock_settime) { - if (entering(tcp)) { - printclockname(tcp->u_arg[0]); - tprints(", "); - printtv(tcp, tcp->u_arg[1]); - } - return 0; + printclockname(tcp->u_arg[0]); + tprints(", "); + print_timespec(tcp, tcp->u_arg[1]); + + return RVAL_DECODED; } -int -sys_clock_gettime(struct tcb *tcp) +SYS_FUNC(clock_gettime) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printtv(tcp, tcp->u_arg[1]); + print_timespec(tcp, tcp->u_arg[1]); } return 0; } -int -sys_clock_nanosleep(struct tcb *tcp) +SYS_FUNC(clock_nanosleep) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); tprints(", "); printflags(clockflags, tcp->u_arg[1], "TIMER_???"); tprints(", "); - printtv(tcp, tcp->u_arg[2]); + print_timespec(tcp, tcp->u_arg[2]); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[3]); - else - printtv(tcp, tcp->u_arg[3]); + /* + * Second (returned) timespec is only significant + * if syscall was interrupted and flags is not TIMER_ABSTIME. + */ + if (!tcp->u_arg[1] && is_erestart(tcp)) { + temporarily_clear_syserror(tcp); + print_timespec(tcp, tcp->u_arg[3]); + restore_cleared_syserror(tcp); + } else { + printaddr(tcp->u_arg[3]); + } } return 0; } -int -sys_clock_adjtime(struct tcb *tcp) +SYS_FUNC(clock_adjtime) { if (exiting(tcp)) return do_adjtimex(tcp, tcp->u_arg[1]); @@ -600,284 +264,76 @@ sys_clock_adjtime(struct tcb *tcp) return 0; } -#ifndef SIGEV_THREAD_ID -# define SIGEV_THREAD_ID 4 -#endif -#include "xlat/sigev_value.h" - -#if SUPPORTED_PERSONALITIES > 1 -static void -printsigevent32(struct tcb *tcp, long arg) -{ - struct { - int sigev_value; - int sigev_signo; - int sigev_notify; - - union { - int tid; - struct { - int function, attribute; - } thread; - } un; - } sev; - - if (umove(tcp, arg, &sev) < 0) - tprints("{...}"); - else { - tprintf("{%#x, ", sev.sigev_value); - if (sev.sigev_notify == SIGEV_SIGNAL) - tprintf("%s, ", signame(sev.sigev_signo)); - else - tprintf("%u, ", sev.sigev_signo); - printxval(sigev_value, sev.sigev_notify, "SIGEV_???"); - tprints(", "); - if (sev.sigev_notify == SIGEV_THREAD_ID) - tprintf("{%d}", sev.un.tid); - else if (sev.sigev_notify == SIGEV_THREAD) - tprintf("{%#x, %#x}", - sev.un.thread.function, - sev.un.thread.attribute); - else - tprints("{...}"); - tprints("}"); - } -} -#endif - -void -printsigevent(struct tcb *tcp, long arg) -{ - struct sigevent sev; - -#if SUPPORTED_PERSONALITIES > 1 - if (current_wordsize == 4) { - printsigevent32(tcp, arg); - return; - } -#endif - if (umove(tcp, arg, &sev) < 0) - tprints("{...}"); - else { - tprintf("{%p, ", sev.sigev_value.sival_ptr); - if (sev.sigev_notify == SIGEV_SIGNAL) - tprintf("%s, ", signame(sev.sigev_signo)); - else - tprintf("%u, ", sev.sigev_signo); - printxval(sigev_value, sev.sigev_notify, "SIGEV_???"); - tprints(", "); - if (sev.sigev_notify == SIGEV_THREAD_ID) -#if defined(HAVE_STRUCT_SIGEVENT__SIGEV_UN__PAD) - /* _pad[0] is the _tid field which might not be - present in the userlevel definition of the - struct. */ - tprintf("{%d}", sev._sigev_un._pad[0]); -#elif defined(HAVE_STRUCT_SIGEVENT___PAD) - tprintf("{%d}", sev.__pad[0]); -#else -# warning unfamiliar struct sigevent => incomplete SIGEV_THREAD_ID decoding - tprints("{...}"); -#endif - else if (sev.sigev_notify == SIGEV_THREAD) - tprintf("{%p, %p}", sev.sigev_notify_function, - sev.sigev_notify_attributes); - else - tprints("{...}"); - tprints("}"); - } -} - -int -sys_timer_create(struct tcb *tcp) +SYS_FUNC(timer_create) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); tprints(", "); - printsigevent(tcp, tcp->u_arg[1]); + print_sigevent(tcp, tcp->u_arg[1]); tprints(", "); } else { - int timer_id; - - if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &timer_id) < 0) - tprintf("%#lx", tcp->u_arg[2]); - else - tprintf("{%d}", timer_id); + printnum_int(tcp, tcp->u_arg[2], "%d"); } return 0; } -int -sys_timer_settime(struct tcb *tcp) +SYS_FUNC(timer_settime) { if (entering(tcp)) { - tprintf("%#lx, ", tcp->u_arg[0]); + tprintf("%d, ", (int) tcp->u_arg[0]); printflags(clockflags, tcp->u_arg[1], "TIMER_???"); tprints(", "); - printitv(tcp, tcp->u_arg[2]); + print_itimerspec(tcp, tcp->u_arg[2]); tprints(", "); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[3]); - else - printitv(tcp, tcp->u_arg[3]); + print_itimerspec(tcp, tcp->u_arg[3]); } return 0; } -int -sys_timer_gettime(struct tcb *tcp) +SYS_FUNC(timer_gettime) { if (entering(tcp)) { - tprintf("%#lx, ", tcp->u_arg[0]); + tprintf("%d, ", (int) tcp->u_arg[0]); } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printitv(tcp, tcp->u_arg[1]); + print_itimerspec(tcp, tcp->u_arg[1]); } return 0; } -static void -print_rtc(struct tcb *tcp, const struct rtc_time *rt) -{ - tprintf("{tm_sec=%d, tm_min=%d, tm_hour=%d, " - "tm_mday=%d, tm_mon=%d, tm_year=%d, ", - rt->tm_sec, rt->tm_min, rt->tm_hour, - rt->tm_mday, rt->tm_mon, rt->tm_year); - if (!abbrev(tcp)) - tprintf("tm_wday=%d, tm_yday=%d, tm_isdst=%d}", - rt->tm_wday, rt->tm_yday, rt->tm_isdst); - else - tprints("...}"); -} - -int -rtc_ioctl(struct tcb *tcp, long code, long arg) -{ - switch (code) { - case RTC_ALM_SET: - case RTC_SET_TIME: - if (entering(tcp)) { - struct rtc_time rt; - if (umove(tcp, arg, &rt) < 0) - tprintf(", %#lx", arg); - else { - tprints(", "); - print_rtc(tcp, &rt); - } - } - break; - case RTC_ALM_READ: - case RTC_RD_TIME: - if (exiting(tcp)) { - struct rtc_time rt; - if (syserror(tcp) || umove(tcp, arg, &rt) < 0) - tprintf(", %#lx", arg); - else { - tprints(", "); - print_rtc(tcp, &rt); - } - } - break; - case RTC_IRQP_SET: - case RTC_EPOCH_SET: - if (entering(tcp)) - tprintf(", %lu", arg); - break; - case RTC_IRQP_READ: - case RTC_EPOCH_READ: - if (exiting(tcp)) - tprintf(", %lu", arg); - break; - case RTC_WKALM_SET: - if (entering(tcp)) { - struct rtc_wkalrm wk; - if (umove(tcp, arg, &wk) < 0) - tprintf(", %#lx", arg); - else { - tprintf(", {enabled=%d, pending=%d, ", - wk.enabled, wk.pending); - print_rtc(tcp, &wk.time); - tprints("}"); - } - } - break; - case RTC_WKALM_RD: - if (exiting(tcp)) { - struct rtc_wkalrm wk; - if (syserror(tcp) || umove(tcp, arg, &wk) < 0) - tprintf(", %#lx", arg); - else { - tprintf(", {enabled=%d, pending=%d, ", - wk.enabled, wk.pending); - print_rtc(tcp, &wk.time); - tprints("}"); - } - } - break; - default: - if (entering(tcp)) - tprintf(", %#lx", arg); - break; - } - return 1; -} - -#ifndef TFD_TIMER_ABSTIME -#define TFD_TIMER_ABSTIME (1 << 0) -#endif - #include "xlat/timerfdflags.h" -int -sys_timerfd(struct tcb *tcp) +SYS_FUNC(timerfd_create) { - if (entering(tcp)) { - /* It does not matter that the kernel uses itimerspec. */ - tprintf("%ld, ", tcp->u_arg[0]); - printclockname(tcp->u_arg[0]); - tprints(", "); - printflags(timerfdflags, tcp->u_arg[2], "TFD_???"); - tprints(", "); - printitv(tcp, tcp->u_arg[3]); - } - return 0; -} + printclockname(tcp->u_arg[0]); + tprints(", "); + printflags(timerfdflags, tcp->u_arg[1], "TFD_???"); -int -sys_timerfd_create(struct tcb *tcp) -{ - if (entering(tcp)) { - printclockname(tcp->u_arg[0]); - tprints(", "); - printflags(timerfdflags, tcp->u_arg[1], "TFD_???"); - } - return 0; + return RVAL_DECODED | RVAL_FD; } -int -sys_timerfd_settime(struct tcb *tcp) +SYS_FUNC(timerfd_settime) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); printflags(timerfdflags, tcp->u_arg[1], "TFD_???"); tprints(", "); - printitv(tcp, tcp->u_arg[2]); + print_itimerspec(tcp, tcp->u_arg[2]); tprints(", "); - printitv(tcp, tcp->u_arg[3]); + } else { + print_itimerspec(tcp, tcp->u_arg[3]); } return 0; } -int -sys_timerfd_gettime(struct tcb *tcp) +SYS_FUNC(timerfd_gettime) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - printitv(tcp, tcp->u_arg[1]); + } else { + print_itimerspec(tcp, tcp->u_arg[1]); } return 0; } diff --git a/times.c b/times.c new file mode 100644 index 00000000..b165a2b0 --- /dev/null +++ b/times.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2012 H.J. Lu + * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include DEF_MPERS_TYPE(tms_t) +#include +typedef struct tms tms_t; +#include MPERS_DEFS + +SYS_FUNC(times) +{ + tms_t tbuf; + + if (entering(tcp)) + return 0; + + if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) { + tprintf("{tms_utime=%llu, tms_stime=%llu, ", + zero_extend_signed_to_ull(tbuf.tms_utime), + zero_extend_signed_to_ull(tbuf.tms_stime)); + tprintf("tms_cutime=%llu, tms_cstime=%llu}", + zero_extend_signed_to_ull(tbuf.tms_cutime), + zero_extend_signed_to_ull(tbuf.tms_cstime)); + } + + return syserror(tcp) ? RVAL_DECIMAL : RVAL_UDECIMAL; +} diff --git a/truncate.c b/truncate.c new file mode 100644 index 00000000..f18394d9 --- /dev/null +++ b/truncate.c @@ -0,0 +1,33 @@ +#include "defs.h" + +SYS_FUNC(truncate) +{ + printpath(tcp, tcp->u_arg[0]); + tprintf(", %" PRI_klu, tcp->u_arg[1]); + + return RVAL_DECODED; +} + +SYS_FUNC(truncate64) +{ + printpath(tcp, tcp->u_arg[0]); + printllval(tcp, ", %llu", 1); + + return RVAL_DECODED; +} + +SYS_FUNC(ftruncate) +{ + printfd(tcp, tcp->u_arg[0]); + tprintf(", %" PRI_klu, tcp->u_arg[1]); + + return RVAL_DECODED; +} + +SYS_FUNC(ftruncate64) +{ + printfd(tcp, tcp->u_arg[0]); + printllval(tcp, ", %llu", 1); + + return RVAL_DECODED; +} diff --git a/ubi.c b/ubi.c new file mode 100644 index 00000000..b4706552 --- /dev/null +++ b/ubi.c @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2012 Mike Frysinger + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +/* The UBI api changes, so we have to keep a local copy */ +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) +# include "ubi-user.h" +#else +# include +#endif + +#include "xlat/ubi_volume_types.h" +#include "xlat/ubi_volume_props.h" + +int +ubi_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + if (!verbose(tcp)) + return RVAL_DECODED; + + switch (code) { + case UBI_IOCMKVOL: + if (entering(tcp)) { + struct ubi_mkvol_req mkvol; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &mkvol)) + break; + + tprintf("{vol_id=%" PRIi32 ", alignment=%" PRIi32 + ", bytes=%" PRIi64 ", vol_type=", mkvol.vol_id, + mkvol.alignment, (int64_t)mkvol.bytes); + printxval(ubi_volume_types, + (uint8_t) mkvol.vol_type, "UBI_???_VOLUME"); + tprintf(", name_len=%" PRIi16 ", name=", mkvol.name_len); + if (print_quoted_string(mkvol.name, + CLAMP(mkvol.name_len, 0, UBI_MAX_VOLUME_NAME), + QUOTE_0_TERMINATED) > 0) { + tprints("..."); + } + tprints("}"); + return 1; + } + if (!syserror(tcp)) { + tprints(" => "); + printnum_int(tcp, arg, "%d"); + } + break; + + case UBI_IOCRSVOL: { + struct ubi_rsvol_req rsvol; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &rsvol)) + break; + + tprintf("{vol_id=%" PRIi32 ", bytes=%" PRIi64 "}", + rsvol.vol_id, (int64_t)rsvol.bytes); + break; + } + + case UBI_IOCRNVOL: { + struct ubi_rnvol_req rnvol; + int c; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &rnvol)) + break; + + tprintf("{count=%" PRIi32 ", ents=[", rnvol.count); + for (c = 0; c < CLAMP(rnvol.count, 0, UBI_MAX_RNVOL); ++c) { + if (c) + tprints(", "); + tprintf("{vol_id=%" PRIi32 ", name_len=%" PRIi16 + ", name=", rnvol.ents[c].vol_id, + rnvol.ents[c].name_len); + if (print_quoted_string(rnvol.ents[c].name, + CLAMP(rnvol.ents[c].name_len, 0, UBI_MAX_VOLUME_NAME), + QUOTE_0_TERMINATED) > 0) { + tprints("..."); + } + tprints("}"); + } + tprints("]}"); + break; + } + + case UBI_IOCEBCH: { + struct ubi_leb_change_req leb; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &leb)) + break; + + tprintf("{lnum=%d, bytes=%d}", leb.lnum, leb.bytes); + break; + } + + case UBI_IOCATT: + if (entering(tcp)) { + struct ubi_attach_req attach; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &attach)) + break; + + tprintf("{ubi_num=%" PRIi32 ", mtd_num=%" PRIi32 + ", vid_hdr_offset=%" PRIi32 + ", max_beb_per1024=%" PRIi16 "}", + attach.ubi_num, attach.mtd_num, + attach.vid_hdr_offset, attach.max_beb_per1024); + return 1; + } + if (!syserror(tcp)) { + tprints(" => "); + printnum_int(tcp, arg, "%d"); + } + break; + + case UBI_IOCEBMAP: { + struct ubi_map_req map; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &map)) + break; + + tprintf("{lnum=%" PRIi32 ", dtype=%" PRIi8 "}", + map.lnum, map.dtype); + break; + } + + case UBI_IOCSETVOLPROP: { + struct ubi_set_vol_prop_req prop; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &prop)) + break; + + tprints("{property="); + printxval(ubi_volume_props, prop.property, "UBI_VOL_PROP_???"); + tprintf(", value=%#" PRIx64 "}", (uint64_t)prop.value); + break; + } + + + case UBI_IOCVOLUP: + tprints(", "); + printnum_int64(tcp, arg, "%" PRIi64); + break; + + case UBI_IOCDET: + case UBI_IOCEBER: + case UBI_IOCEBISMAP: + case UBI_IOCEBUNMAP: + case UBI_IOCRMVOL: + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; + +#ifdef UBI_IOCVOLCRBLK + case UBI_IOCVOLCRBLK: +#endif +#ifdef UBI_IOCVOLRMBLK + case UBI_IOCVOLRMBLK: +#endif + /* no arguments */ + break; + + default: + return RVAL_DECODED; + } + + return RVAL_DECODED | 1; +} diff --git a/uid.c b/uid.c new file mode 100644 index 00000000..80d81ce4 --- /dev/null +++ b/uid.c @@ -0,0 +1,203 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2003-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef STRACE_UID_SIZE +# if STRACE_UID_SIZE != 16 +# error invalid STRACE_UID_SIZE +# endif + +# define SIZEIFY(x) SIZEIFY_(x,STRACE_UID_SIZE) +# define SIZEIFY_(x,size) SIZEIFY__(x,size) +# define SIZEIFY__(x,size) x ## size + +# define printuid SIZEIFY(printuid) +# define sys_chown SIZEIFY(sys_chown) +# define sys_fchown SIZEIFY(sys_fchown) +# define sys_getgroups SIZEIFY(sys_getgroups) +# define sys_getresuid SIZEIFY(sys_getresuid) +# define sys_getuid SIZEIFY(sys_getuid) +# define sys_setfsuid SIZEIFY(sys_setfsuid) +# define sys_setgroups SIZEIFY(sys_setgroups) +# define sys_setresuid SIZEIFY(sys_setresuid) +# define sys_setreuid SIZEIFY(sys_setreuid) +# define sys_setuid SIZEIFY(sys_setuid) +#endif /* STRACE_UID_SIZE */ + +#include "defs.h" + +#ifdef STRACE_UID_SIZE +# if !NEED_UID16_PARSERS +# undef STRACE_UID_SIZE +# endif +#else +# define STRACE_UID_SIZE 32 +#endif + +#ifdef STRACE_UID_SIZE + +# undef uid_t +# define uid_t uid_t_(STRACE_UID_SIZE) +# define uid_t_(size) uid_t__(size) +# define uid_t__(size) uint ## size ## _t + +SYS_FUNC(getuid) +{ + return RVAL_UDECIMAL | RVAL_DECODED; +} + +SYS_FUNC(setfsuid) +{ + printuid("", tcp->u_arg[0]); + + return RVAL_UDECIMAL | RVAL_DECODED; +} + +SYS_FUNC(setuid) +{ + printuid("", tcp->u_arg[0]); + + return RVAL_DECODED; +} + +static void +get_print_uid(struct tcb *const tcp, const char *const prefix, + const kernel_ulong_t addr) +{ + uid_t uid; + + tprints(prefix); + if (!umove_or_printaddr(tcp, addr, &uid)) { + printuid("[", uid); + tprints("]"); + } +} + +SYS_FUNC(getresuid) +{ + if (entering(tcp)) + return 0; + + get_print_uid(tcp, "", tcp->u_arg[0]); + get_print_uid(tcp, ", ", tcp->u_arg[1]); + get_print_uid(tcp, ", ", tcp->u_arg[2]); + + return 0; +} + +SYS_FUNC(setreuid) +{ + printuid("", tcp->u_arg[0]); + printuid(", ", tcp->u_arg[1]); + + return RVAL_DECODED; +} + +SYS_FUNC(setresuid) +{ + printuid("", tcp->u_arg[0]); + printuid(", ", tcp->u_arg[1]); + printuid(", ", tcp->u_arg[2]); + + return RVAL_DECODED; +} + +SYS_FUNC(chown) +{ + printpath(tcp, tcp->u_arg[0]); + printuid(", ", tcp->u_arg[1]); + printuid(", ", tcp->u_arg[2]); + + return RVAL_DECODED; +} + +SYS_FUNC(fchown) +{ + printfd(tcp, tcp->u_arg[0]); + printuid(", ", tcp->u_arg[1]); + printuid(", ", tcp->u_arg[2]); + + return RVAL_DECODED; +} + +void +printuid(const char *text, const unsigned int uid) +{ + if ((uid_t) -1U == (uid_t) uid) + tprintf("%s-1", text); + else + tprintf("%s%u", text, (uid_t) uid); +} + +static bool +print_gid(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + printuid("", (* (uid_t *) elem_buf)); + + return true; +} + +static void +print_groups(struct tcb *const tcp, const unsigned int len, + const kernel_ulong_t addr) +{ + static unsigned long ngroups_max; + if (!ngroups_max) + ngroups_max = sysconf(_SC_NGROUPS_MAX); + + if (len > ngroups_max) { + printaddr(addr); + return; + } + + uid_t gid; + print_array(tcp, addr, len, &gid, sizeof(gid), + umoven_or_printaddr, print_gid, 0); +} + +SYS_FUNC(setgroups) +{ + const int len = tcp->u_arg[0]; + + tprintf("%d, ", len); + print_groups(tcp, len, tcp->u_arg[1]); + return RVAL_DECODED; +} + +SYS_FUNC(getgroups) +{ + if (entering(tcp)) + tprintf("%d, ", (int) tcp->u_arg[0]); + else + print_groups(tcp, tcp->u_rval, tcp->u_arg[1]); + return 0; +} + +#endif /* STRACE_UID_SIZE */ diff --git a/uid16.c b/uid16.c new file mode 100644 index 00000000..c6d665df --- /dev/null +++ b/uid16.c @@ -0,0 +1,2 @@ +#define STRACE_UID_SIZE 16 +#include "uid.c" diff --git a/umask.c b/umask.c new file mode 100644 index 00000000..d42258a9 --- /dev/null +++ b/umask.c @@ -0,0 +1,8 @@ +#include "defs.h" + +SYS_FUNC(umask) +{ + print_numeric_umode_t(tcp->u_arg[0]); + + return RVAL_DECODED | RVAL_OCTAL; +} diff --git a/umount.c b/umount.c new file mode 100644 index 00000000..8fafeabe --- /dev/null +++ b/umount.c @@ -0,0 +1,11 @@ +#include "defs.h" +#include "xlat/umount_flags.h" + +SYS_FUNC(umount2) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + printflags(umount_flags, tcp->u_arg[1], "MNT_???"); + + return RVAL_DECODED; +} diff --git a/uname.c b/uname.c new file mode 100644 index 00000000..3df11e8e --- /dev/null +++ b/uname.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2012-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +SYS_FUNC(uname) +{ + struct utsname uname; + + if (entering(tcp)) + return 0; + + if (!umove_or_printaddr(tcp, tcp->u_arg[0], &uname)) { +#define PRINT_UTS_MEMBER(prefix, member) \ + tprints(prefix #member "="); \ + print_quoted_string(uname.member, sizeof(uname.member), \ + QUOTE_0_TERMINATED) + + PRINT_UTS_MEMBER("{", sysname); + PRINT_UTS_MEMBER(", ", nodename); + if (abbrev(tcp)) { + tprints(", ...}"); + return 0; + } + PRINT_UTS_MEMBER(", ", release); + PRINT_UTS_MEMBER(", ", version); + PRINT_UTS_MEMBER(", ", machine); +#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME + PRINT_UTS_MEMBER(", ", domainname); +#endif + tprints("}"); + } + + return 0; +} diff --git a/unwind.c b/unwind.c index 5b060083..326d184e 100644 --- a/unwind.c +++ b/unwind.c @@ -38,7 +38,7 @@ # define fopen_for_input fopen #endif -#define DPRINTF(F, A, ...) if (debug_flag) fprintf(stderr, " [unwind(" A ")] " F "\n", __VA_ARGS__) +#define DPRINTF(F, A, ...) if (debug_flag) error_msg("[unwind(" A ")] " F, __VA_ARGS__) /* * Кeep a sorted array of cache entries, @@ -103,13 +103,14 @@ unwind_init(void) void unwind_tcb_init(struct tcb *tcp) { + if (tcp->libunwind_ui) + return; + tcp->libunwind_ui = _UPT_create(tcp->pid); if (!tcp->libunwind_ui) die_out_of_memory(); - tcp->queue = malloc(sizeof(*tcp->queue)); - if (!tcp->queue) - die_out_of_memory(); + tcp->queue = xmalloc(sizeof(*tcp->queue)); tcp->queue->head = NULL; tcp->queue->tail = NULL; } @@ -152,9 +153,7 @@ build_mmap_cache(struct tcb* tcp) return; } - cache_head = calloc(cur_array_size, sizeof(*cache_head)); - if (!cache_head) - die_out_of_memory(); + cache_head = xcalloc(cur_array_size, sizeof(*cache_head)); while (fgets(buffer, sizeof(buffer), fp) != NULL) { struct mmap_cache_t *entry; @@ -197,19 +196,15 @@ build_mmap_cache(struct tcb* tcp) if (tcp->mmap_cache_size >= cur_array_size) { cur_array_size *= 2; - cache_head = realloc(cache_head, - cur_array_size * sizeof(*cache_head)); - if (!cache_head) - die_out_of_memory(); + cache_head = xreallocarray(cache_head, cur_array_size, + sizeof(*cache_head)); } entry = &cache_head[tcp->mmap_cache_size]; entry->start_addr = start_addr; entry->end_addr = end_addr; entry->mmap_offset = mmap_offset; - entry->binary_filename = strdup(binary_path); - if (!entry->binary_filename) - die_out_of_memory(); + entry->binary_filename = xstrdup(binary_path); tcp->mmap_cache_size++; } fclose(fp); @@ -290,10 +285,8 @@ get_symbol_name(unw_cursor_t *cursor, char **name, *offset = 0; break; } + *name = xreallocarray(*name, 2, *size); *size *= 2; - *name = realloc(*name, *size); - if (!*name) - die_out_of_memory(); } } @@ -372,9 +365,7 @@ stacktrace_walk(struct tcb *tcp, if (tcp->mmap_cache_size == 0) error_msg_and_die("bug: mmap_cache is empty"); - symbol_name = malloc(symbol_name_size); - if (!symbol_name) - die_out_of_memory(); + symbol_name = xmalloc(symbol_name_size); if (unw_init_remote(&cursor, libunwind_as, tcp->libunwind_ui) < 0) perror_msg_and_die("Can't initiate libunwind"); @@ -427,7 +418,7 @@ print_call_cb(void *dummy, unw_word_t function_offset, unsigned long true_offset) { - if (symbol_name) + if (symbol_name && (symbol_name[0] != '\0')) tprintf(STACK_ENTRY_SYMBOL_FMT); else if (binary_filename) tprintf(STACK_ENTRY_NOSYMBOL_FMT); @@ -490,10 +481,7 @@ queue_put(struct queue_t *queue, { struct call_t *call; - call = malloc(sizeof(*call)); - if (!call) - die_out_of_memory(); - + call = xmalloc(sizeof(*call)); call->output_line = sprint_call_or_error(binary_filename, symbol_name, function_offset, diff --git a/upeek.c b/upeek.c new file mode 100644 index 00000000..01a12d35 --- /dev/null +++ b/upeek.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Linux for s390 port by D.J. Barrow + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "ptrace.h" + +int +upeek(int pid, unsigned long off, kernel_ulong_t *res) +{ + long val; + + errno = 0; + val = ptrace(PTRACE_PEEKUSER, (pid_t) pid, (void *) off, 0); + if (val == -1 && errno) { + if (errno != ESRCH) { + perror_msg("upeek: PTRACE_PEEKUSER pid:%d @0x%lx)", pid, off); + } + return -1; + } + *res = (unsigned long) val; + return 0; +} diff --git a/upoke.c b/upoke.c new file mode 100644 index 00000000..dda0b8d7 --- /dev/null +++ b/upoke.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include "ptrace.h" + +int +upoke(int pid, unsigned long off, kernel_ulong_t val) +{ + if (ptrace(PTRACE_POKEUSER, pid, off, val)) { + if (errno != ESRCH) + perror_msg("upoke: PTRACE_POKEUSER pid:%d @%#lx)", pid, off); + return -1; + } + return 0; +} diff --git a/userfaultfd.c b/userfaultfd.c new file mode 100644 index 00000000..aeeb3eab --- /dev/null +++ b/userfaultfd.c @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#include + +#include "xlat/uffd_flags.h" + +SYS_FUNC(userfaultfd) +{ + printflags(uffd_flags, tcp->u_arg[0], "UFFD_???"); + + return RVAL_DECODED | RVAL_FD; +} + +#ifdef HAVE_LINUX_USERFAULTFD_H +# include +# include + +# include "xlat/uffd_api_flags.h" +# include "xlat/uffd_copy_flags.h" +# include "xlat/uffd_register_ioctl_flags.h" +# include "xlat/uffd_register_mode_flags.h" +# include "xlat/uffd_zeropage_flags.h" + +static void +tprintf_uffdio_range(const struct uffdio_range *range) +{ + tprintf("{start=%#" PRI__x64 ", len=%#" PRI__x64 "}", + range->start, range->len); +} + +int +uffdio_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { + case UFFDIO_API: { + struct uffdio_api ua; + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &ua)) + return RVAL_DECODED | 1; + /* Features is intended to contain some flags, but + * there aren't any defined yet. + */ + tprintf("{api=%#" PRI__x64 + ", features=%#" PRI__x64, + ua.api, ua.features); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &ua)) { + tprintf(", features.out=%#" PRI__x64 + ", ioctls=", ua.features); + printflags64(uffd_api_flags, ua.ioctls, + "_UFFDIO_???"); + } + tprints("}"); + } + return 1; + } + + case UFFDIO_COPY: { + struct uffdio_copy uc; + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &uc)) + return RVAL_DECODED | 1; + tprintf("{dst=%#" PRI__x64 ", src=%#" PRI__x64 + ", len=%#" PRI__x64 ", mode=", + uc.dst, uc.src, uc.len); + printflags64(uffd_copy_flags, uc.mode, + "UFFDIO_COPY_???"); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &uc)) + tprintf(", copy=%#" PRI__x64, uc.copy); + tprints("}"); + } + return 1; + } + + case UFFDIO_REGISTER: { + struct uffdio_register ur; + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &ur)) + return RVAL_DECODED | 1; + tprints("{range="); + tprintf_uffdio_range(&ur.range); + tprints(", mode="); + printflags64(uffd_register_mode_flags, ur.mode, + "UFFDIO_REGISTER_MODE_???"); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &ur)) { + tprints(", ioctls="); + printflags64(uffd_register_ioctl_flags, + ur.ioctls, "UFFDIO_???"); + } + tprints("}"); + } + return 1; + } + + case UFFDIO_UNREGISTER: + case UFFDIO_WAKE: { + struct uffdio_range ura; + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &ura)) + tprintf_uffdio_range(&ura); + return RVAL_DECODED | 1; + } + + case UFFDIO_ZEROPAGE: { + struct uffdio_zeropage uz; + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &uz)) + return RVAL_DECODED | 1; + tprints("{range="); + tprintf_uffdio_range(&uz.range); + tprints(", mode="); + printflags64(uffd_zeropage_flags, uz.mode, + "UFFDIO_ZEROPAGE_???"); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &uz)) + tprintf(", zeropage=%#" PRI__x64, uz.zeropage); + tprints("}"); + } + return 1; + } + + default: + return RVAL_DECODED; + } +} +#endif /* HAVE_LINUX_USERFAULTFD_H */ diff --git a/ustat.c b/ustat.c new file mode 100644 index 00000000..76550632 --- /dev/null +++ b/ustat.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" +#ifdef HAVE_USTAT_H +# include DEF_MPERS_TYPE(struct_ustat) +# include +typedef struct ustat struct_ustat; +#endif /* HAVE_USTAT_H */ + +#include MPERS_DEFS + +SYS_FUNC(ustat) +{ + if (entering(tcp)) + print_dev_t((unsigned int) tcp->u_arg[0]); + else { + tprints(", "); +#ifdef HAVE_USTAT_H + struct_ustat ust; + + if (!umove_or_printaddr(tcp, tcp->u_arg[1], &ust)) + tprintf("{f_tfree=%llu, f_tinode=%llu}", + zero_extend_signed_to_ull(ust.f_tfree), + zero_extend_signed_to_ull(ust.f_tinode)); +#else /* !HAVE_USTAT_H */ + printaddr(tcp->u_arg[1]); +#endif /* HAVE_USTAT_H */ + } + + return 0; +} diff --git a/util.c b/util.c index c78e962c..a38f8217 100644 --- a/util.c +++ b/util.c @@ -32,50 +32,49 @@ */ #include "defs.h" -#include #include #include -#if HAVE_SYS_UIO_H -# include +#include +#ifdef HAVE_SYS_XATTR_H +# include #endif +#include +#include -#if defined(IA64) -# include -# include -#endif - -#ifdef HAVE_SYS_REG_H -# include -#elif defined(HAVE_LINUX_PTRACE_H) -# undef PTRACE_SYSCALL -# ifdef HAVE_STRUCT_IA64_FPREG -# define ia64_fpreg XXX_ia64_fpreg -# endif -# ifdef HAVE_STRUCT_PT_ALL_USER_REGS -# define pt_all_user_regs XXX_pt_all_user_regs -# endif -# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS -# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args -# endif -# include -# undef ptrace_peeksiginfo_args -# undef ia64_fpreg -# undef pt_all_user_regs -#endif +#include "scno.h" +#include "regs.h" +#include "ptrace.h" int -string_to_uint(const char *str) +string_to_uint_ex(const char *const str, char **const endptr, + const unsigned int max_val, const char *const accepted_ending) { - char *error; - long value; + char *end; + long val; if (!*str) return -1; + errno = 0; - value = strtol(str, &error, 10); - if (errno || *error || value < 0 || (long)(int)value != value) + val = strtol(str, &end, 10); + + if (str == end || val < 0 || (unsigned long) val > max_val + || (val == LONG_MAX && errno == ERANGE)) return -1; - return (int)value; + + if (*end && (!accepted_ending || !strchr(accepted_ending, *end))) + return -1; + + if (endptr) + *endptr = end; + + return (int) val; +} + +int +string_to_uint(const char *const str) +{ + return string_to_uint_upto(str, INT_MAX); } int @@ -141,7 +140,7 @@ tv_mul(struct timeval *tv, const struct timeval *a, int n) } const char * -xlookup(const struct xlat *xlat, int val) +xlookup(const struct xlat *xlat, const uint64_t val) { for (; xlat->str != NULL; xlat++) if (xlat->val == val) @@ -149,6 +148,24 @@ xlookup(const struct xlat *xlat, int val) return NULL; } +static int +xlat_bsearch_compare(const void *a, const void *b) +{ + const uint64_t val1 = *(const uint64_t *) a; + const uint64_t val2 = ((const struct xlat *) b)->val; + return (val1 > val2) ? 1 : (val1 < val2) ? -1 : 0; +} + +const char * +xlat_search(const struct xlat *xlat, const size_t nmemb, const uint64_t val) +{ + const struct xlat *e = + bsearch((const void*) &val, + xlat, nmemb, sizeof(*xlat), xlat_bsearch_compare); + + return e ? e->str : NULL; +} + #if !defined HAVE_STPCPY char * stpcpy(char *dst, const char *src) @@ -173,7 +190,7 @@ int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits) { const unsigned endian = 1; - int little_endian = *(char*)&endian; + int little_endian = * (char *) (void *) &endian; const uint8_t *array = bit_array; unsigned pos = cur_bit / 8; @@ -206,78 +223,142 @@ next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits) pos++; } } -/* + +/** * Print entry in struct xlat table, if there. + * + * @param val Value to search a literal representation for. + * @param dflt String (abbreviated in comment syntax) which should be emitted + * if no appropriate xlat value has been found. + * @param xlat (And the following arguments) Pointers to arrays of xlat values. + * The last argument should be NULL. + * @return 1 if appropriate xlat value has been found, 0 otherwise. */ -void -printxval(const struct xlat *xlat, int val, const char *dflt) +int +printxvals(const uint64_t val, const char *dflt, const struct xlat *xlat, ...) { - const char *str = xlookup(xlat, val); + va_list args; - if (str) - tprints(str); - else - tprintf("%#x /* %s */", val, dflt); + va_start(args, xlat); + for (; xlat; xlat = va_arg(args, const struct xlat *)) { + const char *str = xlookup(xlat, val); + + if (str) { + tprints(str); + va_end(args); + return 1; + } + } + /* No hits -- print raw # instead. */ + tprintf("%#" PRIx64, val); + if (dflt) + tprintf(" /* %s */", dflt); + + va_end(args); + + return 0; +} + +/** + * Print entry in sorted struct xlat table, if it is there. + * + * @param xlat Pointer to an array of xlat values (not terminated with + * XLAT_END). + * @param xlat_size Number of xlat elements present in array (usually ARRAY_SIZE + * if array is declared in the unit's scope and not + * terminated with XLAT_END). + * @param val Value to search literal representation for. + * @param dflt String (abbreviated in comment syntax) which should be + * emitted if no appropriate xlat value has been found. + * @return 1 if appropriate xlat value has been found, 0 + * otherwise. + */ +int +printxval_searchn(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt) +{ + const char *s = xlat_search(xlat, xlat_size, val); + + if (s) { + tprints(s); + return 1; + } + + tprintf("%#" PRIx64, val); + if (dflt) + tprintf(" /* %s */", dflt); + + return 0; } /* - * Print 64bit argument at position arg_no and return the index of the next - * argument. + * Fetch 64bit argument at position arg_no and + * return the index of the next argument. */ int -printllval(struct tcb *tcp, const char *format, int arg_no) +getllval(struct tcb *tcp, unsigned long long *val, int arg_no) { -#if SIZEOF_LONG > 4 && SIZEOF_LONG == SIZEOF_LONG_LONG -# if SUPPORTED_PERSONALITIES > 1 - if (current_wordsize > 4) { -# endif - tprintf(format, tcp->u_arg[arg_no]); - arg_no++; -# if SUPPORTED_PERSONALITIES > 1 - } else { +#if SIZEOF_KERNEL_LONG_T > 4 +# ifndef current_klongsize + if (current_klongsize < SIZEOF_KERNEL_LONG_T) { # if defined(AARCH64) || defined(POWERPC64) /* Align arg_no to the next even number. */ arg_no = (arg_no + 1) & 0xe; -# endif - tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1])); +# endif /* AARCH64 || POWERPC64 */ + *val = ULONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]); arg_no += 2; - } -# endif /* SUPPORTED_PERSONALITIES */ -#elif SIZEOF_LONG > 4 -# error Unsupported configuration: SIZEOF_LONG > 4 && SIZEOF_LONG_LONG > SIZEOF_LONG -#elif defined LINUX_MIPSN32 - tprintf(format, tcp->ext_arg[arg_no]); - arg_no++; -#elif defined X32 - if (current_personality == 0) { - tprintf(format, tcp->ext_arg[arg_no]); + } else +# endif /* !current_klongsize */ + { + *val = tcp->u_arg[arg_no]; arg_no++; - } else { - tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1])); - arg_no += 2; } -#else +#else /* SIZEOF_KERNEL_LONG_T == 4 */ # if defined __ARM_EABI__ || \ defined LINUX_MIPSO32 || \ defined POWERPC || \ defined XTENSA /* Align arg_no to the next even number. */ arg_no = (arg_no + 1) & 0xe; -# endif - tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1])); +# elif defined SH + /* + * The SH4 ABI does allow long longs in odd-numbered registers, but + * does not allow them to be split between registers and memory - and + * there are only four argument registers for normal functions. As a + * result, pread, for example, takes an extra padding argument before + * the offset. This was changed late in the 2.4 series (around 2.4.20). + */ + if (arg_no == 3) + arg_no++; +# endif /* __ARM_EABI__ || LINUX_MIPSO32 || POWERPC || XTENSA || SH */ + *val = ULONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]); arg_no += 2; #endif return arg_no; } +/* + * Print 64bit argument at position arg_no and + * return the index of the next argument. + */ +int +printllval(struct tcb *tcp, const char *format, int arg_no) +{ + unsigned long long val = 0; + + arg_no = getllval(tcp, &val, arg_no); + tprintf(format, val); + return arg_no; +} + /* * Interpret `xlat' as an array of flags * print the entries whose bits are on in `flags' * return # of flags printed. */ void -addflags(const struct xlat *xlat, int flags) +addflags(const struct xlat *xlat, uint64_t flags) { for (; xlat->str; xlat++) { if (xlat->val && (flags & xlat->val) == xlat->val) { @@ -286,7 +367,7 @@ addflags(const struct xlat *xlat, int flags) } } if (flags) { - tprintf("|%#x", flags); + tprintf("|%#" PRIx64, flags); } } @@ -296,7 +377,7 @@ addflags(const struct xlat *xlat, int flags) * Return static string. */ const char * -sprintflags(const char *prefix, const struct xlat *xlat, int flags) +sprintflags(const char *prefix, const struct xlat *xlat, uint64_t flags) { static char outstr[1024]; char *outptr; @@ -304,8 +385,13 @@ sprintflags(const char *prefix, const struct xlat *xlat, int flags) outptr = stpcpy(outstr, prefix); + if (flags == 0 && xlat->val == 0 && xlat->str) { + strcpy(outptr, xlat->str); + return outstr; + } + for (; xlat->str; xlat++) { - if ((flags & xlat->val) == xlat->val) { + if (xlat->val && (flags & xlat->val) == xlat->val) { if (found) *outptr++ = '|'; outptr = stpcpy(outptr, xlat->str); @@ -318,19 +404,19 @@ sprintflags(const char *prefix, const struct xlat *xlat, int flags) if (flags) { if (found) *outptr++ = '|'; - outptr += sprintf(outptr, "%#x", flags); + outptr += sprintf(outptr, "%#" PRIx64, flags); } return outstr; } int -printflags(const struct xlat *xlat, int flags, const char *dflt) +printflags64(const struct xlat *xlat, uint64_t flags, const char *dflt) { int n; const char *sep; - if (flags == 0 && xlat->val == 0) { + if (flags == 0 && xlat->val == 0 && xlat->str) { tprints(xlat->str); return 1; } @@ -347,12 +433,12 @@ printflags(const struct xlat *xlat, int flags, const char *dflt) if (n) { if (flags) { - tprintf("%s%#x", sep, flags); + tprintf("%s%#" PRIx64, sep, flags); n++; } } else { if (flags) { - tprintf("%#x", flags); + tprintf("%#" PRIx64, flags); if (dflt) tprintf(" /* %s */", dflt); } else { @@ -365,84 +451,212 @@ printflags(const struct xlat *xlat, int flags, const char *dflt) } void -printnum(struct tcb *tcp, long addr, const char *fmt) +printaddr(const kernel_ulong_t addr) { - long num; - - if (!addr) { + if (!addr) tprints("NULL"); - return; - } - if (umove(tcp, addr, &num) < 0) { - tprintf("%#lx", addr); - return; - } - tprints("["); - tprintf(fmt, num); - tprints("]"); + else + tprintf("%#" PRI_klx, addr); } -void -printnum_int(struct tcb *tcp, long addr, const char *fmt) +#define DEF_PRINTNUM(name, type) \ +bool \ +printnum_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \ + const char *const fmt) \ +{ \ + type num; \ + if (umove_or_printaddr(tcp, addr, &num)) \ + return false; \ + tprints("["); \ + tprintf(fmt, num); \ + tprints("]"); \ + return true; \ +} + +#define DEF_PRINTNUM_ADDR(name, type) \ +bool \ +printnum_addr_ ## name(struct tcb *tcp, const kernel_ulong_t addr) \ +{ \ + type num; \ + if (umove_or_printaddr(tcp, addr, &num)) \ + return false; \ + tprints("["); \ + printaddr(num); \ + tprints("]"); \ + return true; \ +} + +#define DEF_PRINTPAIR(name, type) \ +bool \ +printpair_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \ + const char *const fmt) \ +{ \ + type pair[2]; \ + if (umove_or_printaddr(tcp, addr, &pair)) \ + return false; \ + tprints("["); \ + tprintf(fmt, pair[0]); \ + tprints(", "); \ + tprintf(fmt, pair[1]); \ + tprints("]"); \ + return true; \ +} + +DEF_PRINTNUM(int, int) +DEF_PRINTNUM_ADDR(int, unsigned int) +DEF_PRINTPAIR(int, int) +DEF_PRINTNUM(short, short) +DEF_PRINTNUM(int64, uint64_t) +DEF_PRINTNUM_ADDR(int64, uint64_t) +DEF_PRINTPAIR(int64, uint64_t) + +#ifndef current_wordsize +bool +printnum_long_int(struct tcb *const tcp, const kernel_ulong_t addr, + const char *const fmt_long, const char *const fmt_int) { - int num; + if (current_wordsize > sizeof(int)) { + return printnum_int64(tcp, addr, fmt_long); + } else { + return printnum_int(tcp, addr, fmt_int); + } +} - if (!addr) { - tprints("NULL"); - return; +bool +printnum_addr_long_int(struct tcb *tcp, const kernel_ulong_t addr) +{ + if (current_wordsize > sizeof(int)) { + return printnum_addr_int64(tcp, addr); + } else { + return printnum_addr_int(tcp, addr); } - if (umove(tcp, addr, &num) < 0) { - tprintf("%#lx", addr); - return; +} +#endif /* !current_wordsize */ + +#ifndef current_klongsize +bool +printnum_addr_klong_int(struct tcb *tcp, const kernel_ulong_t addr) +{ + if (current_klongsize > sizeof(int)) { + return printnum_addr_int64(tcp, addr); + } else { + return printnum_addr_int(tcp, addr); } - tprints("["); - tprintf(fmt, num); - tprints("]"); } +#endif /* !current_klongsize */ -void -printfd(struct tcb *tcp, int fd) +const char * +sprinttime(time_t t) { - char path[PATH_MAX + 1]; + struct tm *tmp; + static char buf[sizeof(int) * 3 * 6 + sizeof("+0000")]; - if (show_fd_path && getfdpath(tcp, fd, path, sizeof(path)) >= 0) - tprintf("%d<%s>", fd, path); + if (t == 0) { + strcpy(buf, "0"); + return buf; + } + tmp = localtime(&t); + if (tmp) + strftime(buf, sizeof(buf), "%FT%T%z", tmp); else - tprintf("%d", fd); + snprintf(buf, sizeof(buf), "%lu", (unsigned long) t); + + return buf; +} + +enum sock_proto +getfdproto(struct tcb *tcp, int fd) +{ +#ifdef HAVE_SYS_XATTR_H + size_t bufsize = 256; + char buf[bufsize]; + ssize_t r; + char path[sizeof("/proc/%u/fd/%u") + 2 * sizeof(int)*3]; + + if (fd < 0) + return SOCK_PROTO_UNKNOWN; + + sprintf(path, "/proc/%u/fd/%u", tcp->pid, fd); + r = getxattr(path, "system.sockprotoname", buf, bufsize - 1); + if (r <= 0) + return SOCK_PROTO_UNKNOWN; + else { + /* + * This is a protection for the case when the kernel + * side does not append a null byte to the buffer. + */ + buf[r] = '\0'; + + return get_proto_by_name(buf); + } +#else + return SOCK_PROTO_UNKNOWN; +#endif } void -printuid(const char *text, unsigned long uid) +printfd(struct tcb *tcp, int fd) { - tprintf((uid == -1) ? "%s%ld" : "%s%lu", text, uid); + char path[PATH_MAX + 1]; + if (show_fd_path && getfdpath(tcp, fd, path, sizeof(path)) >= 0) { + static const char socket_prefix[] = "socket:["; + const size_t socket_prefix_len = sizeof(socket_prefix) - 1; + const size_t path_len = strlen(path); + + tprintf("%d<", fd); + if (show_fd_path > 1 && + strncmp(path, socket_prefix, socket_prefix_len) == 0 && + path[path_len - 1] == ']') { + unsigned long inode = + strtoul(path + socket_prefix_len, NULL, 10); + + if (!print_sockaddr_by_inode_cached(inode)) { + const enum sock_proto proto = + getfdproto(tcp, fd); + if (!print_sockaddr_by_inode(inode, proto)) + tprints(path); + } + } else { + print_quoted_string(path, path_len, + QUOTE_OMIT_LEADING_TRAILING_QUOTES); + } + tprints(">"); + } else + tprintf("%d", fd); } /* * Quote string `instr' of length `size' * Write up to (3 + `size' * 4) bytes to `outstr' buffer. - * If `len' is -1, treat `instr' as a NUL-terminated string - * and quote at most (`size' - 1) bytes. * - * Returns 0 if len == -1 and NUL was seen, 1 otherwise. - * Note that if len >= 0, always returns 1. + * If QUOTE_0_TERMINATED `style' flag is set, + * treat `instr' as a NUL-terminated string, + * checking up to (`size' + 1) bytes of `instr'. + * + * If QUOTE_OMIT_LEADING_TRAILING_QUOTES `style' flag is set, + * do not add leading and trailing quoting symbols. + * + * Returns 0 if QUOTE_0_TERMINATED is set and NUL was seen, 1 otherwise. + * Note that if QUOTE_0_TERMINATED is not set, always returns 1. */ int -string_quote(const char *instr, char *outstr, long len, int size) +string_quote(const char *instr, char *outstr, const unsigned int size, + const unsigned int style) { const unsigned char *ustr = (const unsigned char *) instr; char *s = outstr; - int usehex, c, i, eol; + unsigned int i; + int usehex, c, eol; - eol = 0x100; /* this can never match a char */ - if (len == -1) { - size--; + if (style & QUOTE_0_TERMINATED) eol = '\0'; - } + else + eol = 0x100; /* this can never match a char */ usehex = 0; - if (xflag > 1) + if ((xflag > 1) || (style & QUOTE_FORCE_HEX)) { usehex = 1; - else if (xflag) { + } else if (xflag) { /* Check for presence of symbol which require to hex-quote the whole string. */ for (i = 0; i < size; ++i) { @@ -466,7 +680,8 @@ string_quote(const char *instr, char *outstr, long len, int size) } } - *s++ = '\"'; + if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) + *s++ = '\"'; if (usehex) { /* Hex-quote the whole string. */ @@ -486,6 +701,9 @@ string_quote(const char *instr, char *outstr, long len, int size) /* Check for NUL-terminated string. */ if (c == eol) goto asciz_ended; + if ((i == (size - 1)) && + (style & QUOTE_OMIT_TRAILING_0) && (c == '\0')) + goto asciz_ended; switch (c) { case '\"': case '\\': *s++ = '\\'; @@ -539,11 +757,12 @@ string_quote(const char *instr, char *outstr, long len, int size) } } - *s++ = '\"'; + if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) + *s++ = '\"'; *s = '\0'; /* Return zero if we printed entire ASCIZ string (didn't truncate it) */ - if (len == -1 && ustr[i] == '\0') { + if (style & QUOTE_0_TERMINATED && ustr[i] == '\0') { /* We didn't see NUL yet (otherwise we'd jump to 'asciz_ended') * but next char is NUL. */ @@ -553,20 +772,78 @@ string_quote(const char *instr, char *outstr, long len, int size) return 1; asciz_ended: - *s++ = '\"'; + if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) + *s++ = '\"'; *s = '\0'; /* Return zero: we printed entire ASCIZ string (didn't truncate it) */ return 0; } +#ifndef ALLOCA_CUTOFF +# define ALLOCA_CUTOFF 4032 +#endif +#define use_alloca(n) ((n) <= ALLOCA_CUTOFF) + +/* + * Quote string `str' of length `size' and print the result. + * + * If QUOTE_0_TERMINATED `style' flag is set, + * treat `str' as a NUL-terminated string and + * quote at most (`size' - 1) bytes. + * + * If QUOTE_OMIT_LEADING_TRAILING_QUOTES `style' flag is set, + * do not add leading and trailing quoting symbols. + * + * Returns 0 if QUOTE_0_TERMINATED is set and NUL was seen, 1 otherwise. + * Note that if QUOTE_0_TERMINATED is not set, always returns 1. + */ +int +print_quoted_string(const char *str, unsigned int size, + const unsigned int style) +{ + char *buf; + char *outstr; + unsigned int alloc_size; + int rc; + + if (size && style & QUOTE_0_TERMINATED) + --size; + + alloc_size = 4 * size; + if (alloc_size / 4 != size) { + error_msg("Out of memory"); + tprints("???"); + return -1; + } + alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2); + + if (use_alloca(alloc_size)) { + outstr = alloca(alloc_size); + buf = NULL; + } else { + outstr = buf = malloc(alloc_size); + if (!buf) { + error_msg("Out of memory"); + tprints("???"); + return -1; + } + } + + rc = string_quote(str, outstr, size, style); + tprints(outstr); + + free(buf); + return rc; +} + /* * Print path string specified by address `addr' and length `n'. * If path length exceeds `n', append `...' to the output. */ void -printpathn(struct tcb *tcp, long addr, int n) +printpathn(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int n) { - char path[MAXPATHLEN + 1]; + char path[PATH_MAX + 1]; int nul_seen; if (!addr) { @@ -581,38 +858,39 @@ printpathn(struct tcb *tcp, long addr, int n) /* Fetch one byte more to find out whether path length > n. */ nul_seen = umovestr(tcp, addr, n + 1, path); if (nul_seen < 0) - tprintf("%#lx", addr); + printaddr(addr); else { - char *outstr; - - path[n] = '\0'; - n++; - outstr = alloca(4 * n); /* 4*(n-1) + 3 for quotes and NUL */ - string_quote(path, outstr, -1, n); - tprints(outstr); + path[n++] = '\0'; + print_quoted_string(path, n, QUOTE_0_TERMINATED); if (!nul_seen) tprints("..."); } } void -printpath(struct tcb *tcp, long addr) +printpath(struct tcb *const tcp, const kernel_ulong_t addr) { /* Size must correspond to char path[] size in printpathn */ - printpathn(tcp, addr, MAXPATHLEN); + printpathn(tcp, addr, PATH_MAX); } /* * Print string specified by address `addr' and length `len'. - * If `len' < 0, treat the string as a NUL-terminated string. - * If string length exceeds `max_strlen', append `...' to the output. + * If `user_style' has QUOTE_0_TERMINATED bit set, treat the string + * as a NUL-terminated string. + * Pass `user_style' on to `string_quote'. + * Append `...' to the output if either the string length exceeds `max_strlen', + * or QUOTE_0_TERMINATED bit is set and the string length exceeds `len'. */ void -printstr(struct tcb *tcp, long addr, long len) +printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len, const unsigned int user_style) { static char *str = NULL; static char *outstr; - int size; + unsigned int size; + unsigned int style = user_style; + int rc; int ellipsis; if (!addr) { @@ -625,54 +903,51 @@ printstr(struct tcb *tcp, long addr, long len) if (outstr_size / 4 != max_strlen) die_out_of_memory(); - str = malloc(max_strlen + 1); - if (!str) - die_out_of_memory(); - outstr = malloc(outstr_size); - if (!outstr) - die_out_of_memory(); + str = xmalloc(max_strlen + 1); + outstr = xmalloc(outstr_size); } - if (len == -1) { - /* - * Treat as a NUL-terminated string: fetch one byte more - * because string_quote() quotes one byte less. - */ - size = max_strlen + 1; - if (umovestr(tcp, addr, size, str) < 0) { - tprintf("%#lx", addr); - return; - } + /* Fetch one byte more because string_quote may look one byte ahead. */ + size = max_strlen + 1; + + if (size > len) + size = len; + if (style & QUOTE_0_TERMINATED) + rc = umovestr(tcp, addr, size, str); + else + rc = umoven(tcp, addr, size, str); + + if (rc < 0) { + printaddr(addr); + return; } - else { + + if (size > max_strlen) size = max_strlen; - if (size > (unsigned long)len) - size = (unsigned long)len; - if (umoven(tcp, addr, size, str) < 0) { - tprintf("%#lx", addr); - return; - } - } + else + str[size] = '\xff'; /* If string_quote didn't see NUL and (it was supposed to be ASCIZ str * or we were requested to print more than -s NUM chars)... */ - ellipsis = (string_quote(str, outstr, len, size) && - (len < 0 || len > max_strlen)); + ellipsis = string_quote(str, outstr, size, style) + && len + && ((style & QUOTE_0_TERMINATED) + || len > max_strlen); tprints(outstr); if (ellipsis) tprints("..."); } -#if HAVE_SYS_UIO_H void -dumpiov(struct tcb *tcp, int len, long addr) +dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ulong_t addr, + kernel_ulong_t data_size) { -#if SUPPORTED_PERSONALITIES > 1 +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG union { - struct { u_int32_t base; u_int32_t len; } *iov32; - struct { u_int64_t base; u_int64_t len; } *iov64; + struct { uint32_t base; uint32_t len; } *iov32; + struct { uint64_t base; uint64_t len; } *iov64; } iovu; #define iov iovu.iov64 #define sizeof_iov \ @@ -684,7 +959,7 @@ dumpiov(struct tcb *tcp, int len, long addr) #else struct iovec *iov; #define sizeof_iov sizeof(*iov) -#define iov_iov_base(i) iov[i].iov_base +#define iov_iov_base(i) ptr_to_kulong(iov[i].iov_base) #define iov_iov_len(i) iov[i].iov_len #endif int i; @@ -694,17 +969,21 @@ dumpiov(struct tcb *tcp, int len, long addr) /* Assuming no sane program has millions of iovs */ if ((unsigned)len > 1024*1024 /* insane or negative size? */ || (iov = malloc(size)) == NULL) { - fprintf(stderr, "Out of memory\n"); + error_msg("Out of memory"); return; } - if (umoven(tcp, addr, size, (char *) iov) >= 0) { + if (umoven(tcp, addr, size, iov) >= 0) { for (i = 0; i < len; i++) { + kernel_ulong_t iov_len = iov_iov_len(i); + if (iov_len > data_size) + iov_len = data_size; + if (!iov_len) + break; + data_size -= iov_len; /* include the buffer number to make it easy to * match up the trace with the source */ - tprintf(" * %lu bytes in buffer %d\n", - (unsigned long)iov_iov_len(i), i); - dumpstr(tcp, (long) iov_iov_base(i), - iov_iov_len(i)); + tprintf(" * %" PRI_klu " bytes in buffer %d\n", iov_len, i); + dumpstr(tcp, iov_iov_base(i), iov_len); } } free(iov); @@ -713,10 +992,9 @@ dumpiov(struct tcb *tcp, int len, long addr) #undef iov_iov_len #undef iov } -#endif void -dumpstr(struct tcb *tcp, long addr, int len) +dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { static int strsize = -1; static unsigned char *str; @@ -738,13 +1016,13 @@ dumpstr(struct tcb *tcp, long addr, int len) str = malloc(len + 16); if (!str) { strsize = -1; - fprintf(stderr, "Out of memory\n"); + error_msg("Out of memory"); return; } strsize = len + 16; } - if (umoven(tcp, addr, len, (char *) str) < 0) + if (umoven(tcp, addr, len, str) < 0) return; /* Space-pad to 16 bytes */ @@ -787,27 +1065,13 @@ dumpstr(struct tcb *tcp, long addr, int len) } } -#ifdef HAVE_PROCESS_VM_READV -/* C library supports this, but the kernel might not. */ static bool process_vm_readv_not_supported = 0; -#else - -/* Need to do this since process_vm_readv() is not yet available in libc. +#ifndef HAVE_PROCESS_VM_READV +/* + * Need to do this since process_vm_readv() is not yet available in libc. * When libc is be updated, only "static bool process_vm_readv_not_supported" * line should remain. */ -#if !defined(__NR_process_vm_readv) -# if defined(I386) -# define __NR_process_vm_readv 347 -# elif defined(X86_64) -# define __NR_process_vm_readv 310 -# elif defined(POWERPC) -# define __NR_process_vm_readv 351 -# endif -#endif - -#if defined(__NR_process_vm_readv) -static bool process_vm_readv_not_supported = 0; /* Have to avoid duplicating with the C library headers. */ static ssize_t strace_process_vm_readv(pid_t pid, const struct iovec *lvec, @@ -818,57 +1082,75 @@ static ssize_t strace_process_vm_readv(pid_t pid, { return syscall(__NR_process_vm_readv, (long)pid, lvec, liovcnt, rvec, riovcnt, flags); } -#define process_vm_readv strace_process_vm_readv -#else -static bool process_vm_readv_not_supported = 1; -# define process_vm_readv(...) (errno = ENOSYS, -1) -#endif +# define process_vm_readv strace_process_vm_readv +#endif /* !HAVE_PROCESS_VM_READV */ + +static ssize_t +vm_read_mem(const pid_t pid, void *const laddr, + const kernel_ulong_t raddr, const size_t len) +{ + const unsigned long truncated_raddr = raddr; + + if (raddr != (kernel_ulong_t) truncated_raddr) { + errno = EIO; + return -1; + } -#endif /* end of hack */ + const struct iovec local = { + .iov_base = laddr, + .iov_len = len + }; + const struct iovec remote = { + .iov_base = (void *) truncated_raddr, + .iov_len = len + }; + + return process_vm_readv(pid, &local, 1, &remote, 1, 0); +} -#define PAGMASK (~(PAGSIZ - 1)) /* * move `len' bytes of data from process `pid' - * at address `addr' to our space at `laddr' + * at address `addr' to our space at `our_addr' */ int -umoven(struct tcb *tcp, long addr, int len, char *laddr) +umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, + void *const our_addr) { + char *laddr = our_addr; int pid = tcp->pid; - int n, m, nread; + unsigned int n, m, nread; union { long val; char x[sizeof(long)]; } u; -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize < sizeof(addr)) - addr &= (1ul << 8 * current_wordsize) - 1; +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + if (current_wordsize < sizeof(addr) + && (addr & (~ (kernel_ulong_t) -1U))) { + return -1; + } #endif if (!process_vm_readv_not_supported) { - struct iovec local[1], remote[1]; - int r; - - local[0].iov_base = laddr; - remote[0].iov_base = (void*)addr; - local[0].iov_len = remote[0].iov_len = len; - r = process_vm_readv(pid, local, 1, remote, 1, 0); - if (r == len) + int r = vm_read_mem(pid, laddr, addr, len); + if ((unsigned int) r == len) return 0; if (r >= 0) { - error_msg("umoven: short read (%d < %d) @0x%lx", - r, len, addr); + error_msg("umoven: short read (%u < %u) @0x%" PRI_klx, + (unsigned int) r, len, addr); return -1; } switch (errno) { case ENOSYS: process_vm_readv_not_supported = 1; break; + case EPERM: + /* operation not permitted, try PTRACE_PEEKDATA */ + break; case ESRCH: /* the process is gone */ return -1; - case EFAULT: case EIO: case EPERM: + case EFAULT: case EIO: /* address space is inaccessible */ return -1; default: @@ -881,10 +1163,10 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr) nread = 0; if (addr & (sizeof(long) - 1)) { /* addr not a multiple of sizeof(long) */ - n = addr - (addr & -sizeof(long)); /* residue */ - addr &= -sizeof(long); /* residue */ + n = addr & (sizeof(long) - 1); /* residue */ + addr &= -sizeof(long); /* aligned address */ errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0); + u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); switch (errno) { case 0: break; @@ -896,7 +1178,7 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr) return -1; default: /* all the rest is strange and should be reported */ - perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%lx", + perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, pid, addr); return -1; } @@ -909,7 +1191,7 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr) } while (len) { errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0); + u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); switch (errno) { case 0: break; @@ -919,13 +1201,13 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr) case EFAULT: case EIO: case EPERM: /* address space is inaccessible */ if (nread) { - perror_msg("umoven: short read (%d < %d) @0x%lx", + perror_msg("umoven: short read (%u < %u) @0x%" PRI_klx, nread, nread + len, addr - nread); } return -1; default: /* all the rest is strange and should be reported */ - perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%lx", + perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, pid, addr); return -1; } @@ -940,6 +1222,31 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr) return 0; } +int +umoven_or_printaddr(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int len, void *const our_addr) +{ + if (!addr || !verbose(tcp) || (exiting(tcp) && syserror(tcp)) || + umoven(tcp, addr, len, our_addr) < 0) { + printaddr(addr); + return -1; + } + return 0; +} + +int +umoven_or_printaddr_ignore_syserror(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + void *const our_addr) +{ + if (!addr || !verbose(tcp) || umoven(tcp, addr, len, our_addr) < 0) { + printaddr(addr); + return -1; + } + return 0; +} + /* * Like `umove' but make the additional effort of looking * for a terminating zero byte. @@ -953,65 +1260,52 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr) * we never write past laddr[len-1]). */ int -umovestr(struct tcb *tcp, long addr, int len, char *laddr) +umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *laddr) { -#if SIZEOF_LONG == 4 - const unsigned long x01010101 = 0x01010101ul; - const unsigned long x80808080 = 0x80808080ul; -#elif SIZEOF_LONG == 8 - const unsigned long x01010101 = 0x0101010101010101ul; - const unsigned long x80808080 = 0x8080808080808080ul; -#else -# error SIZEOF_LONG > 8 -#endif + const unsigned long x01010101 = (unsigned long) 0x0101010101010101ULL; + const unsigned long x80808080 = (unsigned long) 0x8080808080808080ULL; int pid = tcp->pid; - int n, m, nread; + unsigned int n, m, nread; union { unsigned long val; char x[sizeof(long)]; } u; -#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 - if (current_wordsize < sizeof(addr)) - addr &= (1ul << 8 * current_wordsize) - 1; +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + if (current_wordsize < sizeof(addr) + && (addr & (~ (kernel_ulong_t) -1U))) { + return -1; + } #endif nread = 0; if (!process_vm_readv_not_supported) { - struct iovec local[1], remote[1]; - - local[0].iov_base = laddr; - remote[0].iov_base = (void*)addr; + const size_t page_size = get_pagesize(); + const size_t page_mask = page_size - 1; while (len > 0) { - int end_in_page; - int r; - int chunk_len; - - /* Don't read kilobytes: most strings are short */ - chunk_len = len; - if (chunk_len > 256) - chunk_len = 256; - /* Don't cross pages. I guess otherwise we can get EFAULT + unsigned int chunk_len; + unsigned int end_in_page; + + /* + * Don't cross pages, otherwise we can get EFAULT * and fail to notice that terminating NUL lies * in the existing (first) page. - * (I hope there aren't arches with pages < 4K) */ - end_in_page = ((addr + chunk_len) & 4095); - r = chunk_len - end_in_page; - if (r > 0) /* if chunk_len > end_in_page */ - chunk_len = r; /* chunk_len -= end_in_page */ + chunk_len = len > page_size ? page_size : len; + end_in_page = (addr + chunk_len) & page_mask; + if (chunk_len > end_in_page) /* crosses to the next page */ + chunk_len -= end_in_page; - local[0].iov_len = remote[0].iov_len = chunk_len; - r = process_vm_readv(pid, local, 1, remote, 1, 0); + int r = vm_read_mem(pid, laddr, addr, chunk_len); if (r > 0) { - if (memchr(local[0].iov_base, '\0', r)) + if (memchr(laddr, '\0', r)) return 1; - local[0].iov_base += r; - remote[0].iov_base += r; - len -= r; + addr += r; + laddr += r; nread += r; + len -= r; continue; } switch (errno) { @@ -1021,11 +1315,16 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr) case ESRCH: /* the process is gone */ return -1; - case EFAULT: case EIO: case EPERM: + case EPERM: + /* operation not permitted, try PTRACE_PEEKDATA */ + if (!nread) + goto vm_readv_didnt_work; + /* fall through */ + case EFAULT: case EIO: /* address space is inaccessible */ if (nread) { - perror_msg("umovestr: short read (%d < %d) @0x%lx", - nread, nread + len, addr); + perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx, + nread, nread + len, addr - nread); } return -1; default: @@ -1040,10 +1339,10 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr) if (addr & (sizeof(long) - 1)) { /* addr not a multiple of sizeof(long) */ - n = addr - (addr & -sizeof(long)); /* residue */ - addr &= -sizeof(long); /* residue */ + n = addr & (sizeof(long) - 1); /* residue */ + addr &= -sizeof(long); /* aligned address */ errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, (char *)addr, 0); + u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); switch (errno) { case 0: break; @@ -1055,7 +1354,7 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr) return -1; default: /* all the rest is strange and should be reported */ - perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%lx", + perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, pid, addr); return -1; } @@ -1072,7 +1371,7 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr) while (len) { errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, (char *)addr, 0); + u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); switch (errno) { case 0: break; @@ -1082,13 +1381,13 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr) case EFAULT: case EIO: case EPERM: /* address space is inaccessible */ if (nread) { - perror_msg("umovestr: short read (%d < %d) @0x%lx", + perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx, nread, nread + len, addr - nread); } return -1; default: /* all the rest is strange and should be reported */ - perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%lx", + perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, pid, addr); return -1; } @@ -1105,443 +1404,176 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr) return 0; } -int -upeek(int pid, long off, long *res) -{ - long val; - - errno = 0; - val = ptrace(PTRACE_PEEKUSER, (pid_t)pid, (char *) off, 0); - if (val == -1 && errno) { - if (errno != ESRCH) { - perror_msg("upeek: PTRACE_PEEKUSER pid:%d @0x%lx)", pid, off); - } - return -1; - } - *res = val; - return 0; -} - -/* Note! On new kernels (about 2.5.46+), we use PTRACE_O_TRACECLONE - * and PTRACE_O_TRACE[V]FORK for tracing children. - * If you are adding a new arch which is only supported by newer kernels, - * you most likely don't need to add any code below - * beside a dummy "return 0" block in change_syscall(). - */ - /* - * These #if's are huge, please indent them correctly. - * It's easy to get confused otherwise. + * Iteratively fetch and print up to nmemb elements of elem_size size + * from the array that starts at tracee's address start_addr. + * + * Array elements are being fetched to the address specified by elem_buf. + * + * The fetcher callback function specified by umoven_func should follow + * the same semantics as umoven_or_printaddr function. + * + * The printer callback function specified by print_func is expected + * to print something; if it returns false, no more iterations will be made. + * + * The pointer specified by opaque_data is passed to each invocation + * of print_func callback function. + * + * This function prints: + * - "NULL", if start_addr is NULL; + * - "[]", if nmemb is 0; + * - start_addr, if nmemb * elem_size overflows or wraps around; + * - nothing, if the first element cannot be fetched + * (if umoven_func returns non-zero), but it is assumed that + * umoven_func has printed the address it failed to fetch data from; + * - elements of the array, delimited by ", ", with the array itself + * enclosed with [] brackets. + * + * If abbrev(tcp) is true, then + * - the maximum number of elements printed equals to max_strlen; + * - "..." is printed instead of max_strlen+1 element + * and no more iterations will be made. + * + * This function returns true only if + * - umoven_func has been called at least once AND + * - umoven_func has not returned false. */ - -#include "syscall.h" - -#ifndef CLONE_PTRACE -# define CLONE_PTRACE 0x00002000 -#endif -#ifndef CLONE_VFORK -# define CLONE_VFORK 0x00004000 -#endif -#ifndef CLONE_VM -# define CLONE_VM 0x00000100 -#endif - -#ifdef IA64 - -typedef unsigned long *arg_setup_state; - -static int -arg_setup(struct tcb *tcp, arg_setup_state *state) +bool +print_array(struct tcb *const tcp, + const kernel_ulong_t start_addr, + const size_t nmemb, + void *const elem_buf, + const size_t elem_size, + int (*const umoven_func)(struct tcb *, + kernel_ulong_t, + unsigned int, + void *), + bool (*const print_func)(struct tcb *, + void *elem_buf, + size_t elem_size, + void *opaque_data), + void *const opaque_data) { - unsigned long cfm, sof, sol; - long bsp; - - if (ia64_ia32mode) { - /* Satisfy a false GCC warning. */ - *state = NULL; - return 0; + if (!start_addr) { + tprints("NULL"); + return false; } - if (upeek(tcp->pid, PT_AR_BSP, &bsp) < 0) - return -1; - if (upeek(tcp->pid, PT_CFM, (long *) &cfm) < 0) - return -1; + if (!nmemb) { + tprints("[]"); + return false; + } - sof = (cfm >> 0) & 0x7f; - sol = (cfm >> 7) & 0x7f; - bsp = (long) ia64_rse_skip_regs((unsigned long *) bsp, -sof + sol); + const size_t size = nmemb * elem_size; + const kernel_ulong_t end_addr = start_addr + size; - *state = (unsigned long *) bsp; - return 0; -} + if (end_addr <= start_addr || size / elem_size != nmemb) { + printaddr(start_addr); + return false; + } -# define arg_finish_change(tcp, state) 0 + const kernel_ulong_t abbrev_end = + (abbrev(tcp) && max_strlen < nmemb) ? + start_addr + elem_size * max_strlen : end_addr; + kernel_ulong_t cur; -static int -get_arg0(struct tcb *tcp, arg_setup_state *state, long *valp) -{ - int ret; + for (cur = start_addr; cur < end_addr; cur += elem_size) { + if (cur != start_addr) + tprints(", "); - if (ia64_ia32mode) - ret = upeek(tcp->pid, PT_R11, valp); - else - ret = umoven(tcp, - (unsigned long) ia64_rse_skip_regs(*state, 0), - sizeof(long), (void *) valp); - return ret; -} + if (umoven_func(tcp, cur, elem_size, elem_buf)) + break; -static int -get_arg1(struct tcb *tcp, arg_setup_state *state, long *valp) -{ - int ret; + if (cur == start_addr) + tprints("["); - if (ia64_ia32mode) - ret = upeek(tcp->pid, PT_R9, valp); - else - ret = umoven(tcp, - (unsigned long) ia64_rse_skip_regs(*state, 1), - sizeof(long), (void *) valp); - return ret; -} + if (cur >= abbrev_end) { + tprints("..."); + cur = end_addr; + break; + } -static int -set_arg0(struct tcb *tcp, arg_setup_state *state, long val) -{ - int req = PTRACE_POKEDATA; - void *ap; + if (!print_func(tcp, elem_buf, elem_size, opaque_data)) { + cur = end_addr; + break; + } + } + if (cur != start_addr) + tprints("]"); - if (ia64_ia32mode) { - ap = (void *) (intptr_t) PT_R11; /* r11 == EBX */ - req = PTRACE_POKEUSER; - } else - ap = ia64_rse_skip_regs(*state, 0); - errno = 0; - ptrace(req, tcp->pid, ap, val); - return errno ? -1 : 0; + return cur >= end_addr; } -static int -set_arg1(struct tcb *tcp, arg_setup_state *state, long val) +int +printargs(struct tcb *tcp) { - int req = PTRACE_POKEDATA; - void *ap; - - if (ia64_ia32mode) { - ap = (void *) (intptr_t) PT_R9; /* r9 == ECX */ - req = PTRACE_POKEUSER; - } else - ap = ia64_rse_skip_regs(*state, 1); - errno = 0; - ptrace(req, tcp->pid, ap, val); - return errno ? -1 : 0; + const int n = tcp->s_ent->nargs; + int i; + for (i = 0; i < n; ++i) + tprintf("%s%#" PRI_klx, i ? ", " : "", tcp->u_arg[i]); + return RVAL_DECODED; } -/* ia64 does not return the input arguments from functions (and syscalls) - according to ia64 RSE (Register Stack Engine) behavior. */ - -# define restore_arg0(tcp, state, val) ((void) (state), 0) -# define restore_arg1(tcp, state, val) ((void) (state), 0) - -#elif defined(SPARC) || defined(SPARC64) - -# if defined(SPARC64) -# undef PTRACE_GETREGS -# define PTRACE_GETREGS PTRACE_GETREGS64 -# undef PTRACE_SETREGS -# define PTRACE_SETREGS PTRACE_SETREGS64 -# endif - -typedef struct pt_regs arg_setup_state; - -# define arg_setup(tcp, state) \ - (ptrace(PTRACE_GETREGS, (tcp)->pid, (char *) (state), 0)) -# define arg_finish_change(tcp, state) \ - (ptrace(PTRACE_SETREGS, (tcp)->pid, (char *) (state), 0)) - -# define get_arg0(tcp, state, valp) (*(valp) = (state)->u_regs[U_REG_O0], 0) -# define get_arg1(tcp, state, valp) (*(valp) = (state)->u_regs[U_REG_O1], 0) -# define set_arg0(tcp, state, val) ((state)->u_regs[U_REG_O0] = (val), 0) -# define set_arg1(tcp, state, val) ((state)->u_regs[U_REG_O1] = (val), 0) -# define restore_arg0(tcp, state, val) 0 - -#else /* other architectures */ - -# if defined S390 || defined S390X -/* Note: this is only true for the `clone' system call, which handles - arguments specially. We could as well say that its first two arguments - are swapped relative to other architectures, but that would just be - another #ifdef in the calls. */ -# define arg0_offset PT_GPR3 -# define arg1_offset PT_ORIGGPR2 -# define restore_arg0(tcp, state, val) ((void) (state), 0) -# define restore_arg1(tcp, state, val) ((void) (state), 0) -# define arg0_index 1 -# define arg1_index 0 -# elif defined(ALPHA) || defined(MIPS) -# define arg0_offset REG_A0 -# define arg1_offset (REG_A0+1) -# elif defined(POWERPC) -# define arg0_offset (sizeof(unsigned long)*PT_R3) -# define arg1_offset (sizeof(unsigned long)*PT_R4) -# define restore_arg0(tcp, state, val) ((void) (state), 0) -# elif defined(HPPA) -# define arg0_offset PT_GR26 -# define arg1_offset (PT_GR26-4) -# elif defined(X86_64) || defined(X32) -# define arg0_offset ((long)(8*(current_personality ? RBX : RDI))) -# define arg1_offset ((long)(8*(current_personality ? RCX : RSI))) -# elif defined(SH) -# define arg0_offset (4*(REG_REG0+4)) -# define arg1_offset (4*(REG_REG0+5)) -# elif defined(SH64) - /* ABI defines arg0 & 1 in r2 & r3 */ -# define arg0_offset (REG_OFFSET+16) -# define arg1_offset (REG_OFFSET+24) -# define restore_arg0(tcp, state, val) 0 -# elif defined CRISV10 || defined CRISV32 -# define arg0_offset (4*PT_R11) -# define arg1_offset (4*PT_ORIG_R10) -# define restore_arg0(tcp, state, val) 0 -# define restore_arg1(tcp, state, val) 0 -# define arg0_index 1 -# define arg1_index 0 -# else -# define arg0_offset 0 -# define arg1_offset 4 -# if defined ARM -# define restore_arg0(tcp, state, val) 0 -# endif -# endif - -typedef int arg_setup_state; - -# define arg_setup(tcp, state) (0) -# define arg_finish_change(tcp, state) 0 -# define get_arg0(tcp, cookie, valp) (upeek((tcp)->pid, arg0_offset, (valp))) -# define get_arg1(tcp, cookie, valp) (upeek((tcp)->pid, arg1_offset, (valp))) - -static int -set_arg0(struct tcb *tcp, void *cookie, long val) +int +printargs_u(struct tcb *tcp) { - return ptrace(PTRACE_POKEUSER, tcp->pid, (char*)arg0_offset, val); + const int n = tcp->s_ent->nargs; + int i; + for (i = 0; i < n; ++i) + tprintf("%s%u", i ? ", " : "", + (unsigned int) tcp->u_arg[i]); + return RVAL_DECODED; } -static int -set_arg1(struct tcb *tcp, void *cookie, long val) +int +printargs_d(struct tcb *tcp) { - return ptrace(PTRACE_POKEUSER, tcp->pid, (char*)arg1_offset, val); + const int n = tcp->s_ent->nargs; + int i; + for (i = 0; i < n; ++i) + tprintf("%s%d", i ? ", " : "", + (int) tcp->u_arg[i]); + return RVAL_DECODED; } -#endif /* architectures */ - -#ifndef restore_arg0 -# define restore_arg0(tcp, state, val) set_arg0((tcp), (state), (val)) -#endif -#ifndef restore_arg1 -# define restore_arg1(tcp, state, val) set_arg1((tcp), (state), (val)) -#endif - -#ifndef arg0_index -# define arg0_index 0 -# define arg1_index 1 -#endif - -static int -change_syscall(struct tcb *tcp, arg_setup_state *state, int new) -{ -#if defined(I386) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(ORIG_EAX * 4), new) < 0) - return -1; - return 0; -#elif defined(X86_64) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(ORIG_RAX * 8), new) < 0) - return -1; - return 0; -#elif defined(X32) - /* setbpt/clearbpt never used: */ - /* X32 is only supported since about linux-3.0.30 */ -#elif defined(POWERPC) - if (ptrace(PTRACE_POKEUSER, tcp->pid, - (char*)(sizeof(unsigned long)*PT_R0), new) < 0) - return -1; - return 0; -#elif defined(S390) || defined(S390X) - /* s390 linux after 2.4.7 has a hook in entry.S to allow this */ - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GPR2), new) < 0) - return -1; - return 0; -#elif defined(M68K) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_ORIG_D0), new) < 0) - return -1; - return 0; -#elif defined(SPARC) || defined(SPARC64) - state->u_regs[U_REG_G1] = new; - return 0; -#elif defined(MIPS) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_V0), new) < 0) - return -1; - return 0; -#elif defined(ALPHA) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), new) < 0) - return -1; - return 0; -#elif defined(AVR32) - /* setbpt/clearbpt never used: */ - /* AVR32 is only supported since about linux-2.6.19 */ -#elif defined(BFIN) - /* setbpt/clearbpt never used: */ - /* Blackfin is only supported since about linux-2.6.23 */ -#elif defined(IA64) - if (ia64_ia32mode) { - switch (new) { - case 2: - break; /* x86 SYS_fork */ - case SYS_clone: - new = 120; - break; - default: - fprintf(stderr, "%s: unexpected syscall %d\n", - __FUNCTION__, new); - return -1; - } - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_R1), new) < 0) - return -1; - } else if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_R15), new) < 0) - return -1; - return 0; -#elif defined(HPPA) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GR20), new) < 0) - return -1; - return 0; -#elif defined(SH) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*(REG_REG0+3)), new) < 0) - return -1; - return 0; -#elif defined(SH64) - /* Top half of reg encodes the no. of args n as 0x1n. - Assume 0 args as kernel never actually checks... */ - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_SYSCALL), - 0x100000 | new) < 0) - return -1; - return 0; -#elif defined(CRISV10) || defined(CRISV32) - if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_R9), new) < 0) - return -1; - return 0; -#elif defined(ARM) - /* Some kernels support this, some (pre-2.6.16 or so) don't. */ -# ifndef PTRACE_SET_SYSCALL -# define PTRACE_SET_SYSCALL 23 -# endif - if (ptrace(PTRACE_SET_SYSCALL, tcp->pid, 0, new & 0xffff) != 0) - return -1; - return 0; -#elif defined(AARCH64) - /* setbpt/clearbpt never used: */ - /* AARCH64 is only supported since about linux-3.0.31 */ -#elif defined(TILE) - /* setbpt/clearbpt never used: */ - /* Tilera CPUs are only supported since about linux-2.6.34 */ -#elif defined(MICROBLAZE) - /* setbpt/clearbpt never used: */ - /* microblaze is only supported since about linux-2.6.30 */ -#elif defined(OR1K) - /* never reached; OR1K is only supported by kernels since 3.1.0. */ -#elif defined(METAG) - /* setbpt/clearbpt never used: */ - /* Meta is only supported since linux-3.7 */ -#elif defined(XTENSA) - /* setbpt/clearbpt never used: */ - /* Xtensa is only supported since linux 2.6.13 */ -#elif defined(ARC) - /* setbpt/clearbpt never used: */ - /* ARC only supported since 3.9 */ +#if defined _LARGEFILE64_SOURCE && defined HAVE_OPEN64 +# define open_file open64 #else -#warning Do not know how to handle change_syscall for this architecture -#endif /* architecture */ - return -1; -} +# define open_file open +#endif int -setbpt(struct tcb *tcp) +read_int_from_file(const char *const fname, int *const pvalue) { - static int clone_scno[SUPPORTED_PERSONALITIES] = { SYS_clone }; - arg_setup_state state; - - if (tcp->flags & TCB_BPTSET) { - fprintf(stderr, "PANIC: TCB already set in pid %u\n", tcp->pid); + const int fd = open_file(fname, O_RDONLY); + if (fd < 0) return -1; - } - /* - * It's a silly kludge to initialize this with a search at runtime. - * But it's better than maintaining another magic thing in the - * godforsaken tables. - */ - if (clone_scno[current_personality] == 0) { - int i; - for (i = 0; i < nsyscalls; ++i) - if (sysent[i].sys_func == sys_clone) { - clone_scno[current_personality] = i; - break; - } - } + long lval; + char buf[sizeof(lval) * 3]; + int n = read(fd, buf, sizeof(buf) - 1); + int saved_errno = errno; + close(fd); - if (tcp->s_ent->sys_func == sys_fork) { - if (arg_setup(tcp, &state) < 0 - || get_arg0(tcp, &state, &tcp->inst[0]) < 0 - || get_arg1(tcp, &state, &tcp->inst[1]) < 0 - || change_syscall(tcp, &state, - clone_scno[current_personality]) < 0 - || set_arg0(tcp, &state, CLONE_PTRACE|SIGCHLD) < 0 - || set_arg1(tcp, &state, 0) < 0 - || arg_finish_change(tcp, &state) < 0) - return -1; - tcp->u_arg[arg0_index] = CLONE_PTRACE|SIGCHLD; - tcp->u_arg[arg1_index] = 0; - tcp->flags |= TCB_BPTSET; - return 0; + if (n < 0) { + errno = saved_errno; + return -1; } - if (tcp->s_ent->sys_func == sys_clone) { - /* ia64 calls directly `clone (CLONE_VFORK | CLONE_VM)' - contrary to x86 vfork above. Even on x86 we turn the - vfork semantics into plain fork - each application must not - depend on the vfork specifics according to POSIX. We would - hang waiting for the parent resume otherwise. We need to - clear also CLONE_VM but only in the CLONE_VFORK case as - otherwise we would break pthread_create. */ - - long new_arg0 = (tcp->u_arg[arg0_index] | CLONE_PTRACE); - if (new_arg0 & CLONE_VFORK) - new_arg0 &= ~(unsigned long)(CLONE_VFORK | CLONE_VM); - if (arg_setup(tcp, &state) < 0 - || set_arg0(tcp, &state, new_arg0) < 0 - || arg_finish_change(tcp, &state) < 0) - return -1; - tcp->inst[0] = tcp->u_arg[arg0_index]; - tcp->inst[1] = tcp->u_arg[arg1_index]; - tcp->flags |= TCB_BPTSET; - return 0; + buf[n] = '\0'; + char *endptr = 0; + errno = 0; + lval = strtol(buf, &endptr, 10); + if (!endptr || (*endptr && '\n' != *endptr) +#if INT_MAX < LONG_MAX + || lval > INT_MAX || lval < INT_MIN +#endif + || ERANGE == errno) { + if (!errno) + errno = EINVAL; + return -1; } - fprintf(stderr, "PANIC: setbpt for syscall %ld on %u???\n", - tcp->scno, tcp->pid); - return -1; -} - -int -clearbpt(struct tcb *tcp) -{ - arg_setup_state state; - if (arg_setup(tcp, &state) < 0 - || change_syscall(tcp, &state, tcp->scno) < 0 - || restore_arg0(tcp, &state, tcp->inst[0]) < 0 - || restore_arg1(tcp, &state, tcp->inst[1]) < 0 - || arg_finish_change(tcp, &state)) - if (errno != ESRCH) - return -1; - tcp->flags &= ~TCB_BPTSET; + *pvalue = (int) lval; return 0; } diff --git a/utime.c b/utime.c new file mode 100644 index 00000000..8126b350 --- /dev/null +++ b/utime.c @@ -0,0 +1,23 @@ +#include "defs.h" + +#include DEF_MPERS_TYPE(utimbuf_t) + +#include + +typedef struct utimbuf utimbuf_t; + +#include MPERS_DEFS + +SYS_FUNC(utime) +{ + utimbuf_t u; + + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + if (!umove_or_printaddr(tcp, tcp->u_arg[1], &u)) { + tprintf("{actime=%s,", sprinttime(u.actime)); + tprintf(" modtime=%s}", sprinttime(u.modtime)); + } + + return RVAL_DECODED; +} diff --git a/utimes.c b/utimes.c new file mode 100644 index 00000000..2908529b --- /dev/null +++ b/utimes.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2006-2007 Ulrich Drepper + * Copyright (c) 2006 Bernhard Kaindl + * Copyright (c) 2006-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +SYS_FUNC(utimes) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + print_timeval_pair(tcp, tcp->u_arg[1]); + + return RVAL_DECODED; +} + +SYS_FUNC(futimesat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + print_timeval_pair(tcp, tcp->u_arg[2]); + + return RVAL_DECODED; +} + +SYS_FUNC(utimensat) +{ + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + print_timespec_utime_pair(tcp, tcp->u_arg[2]); + tprints(", "); + printflags(at_flags, tcp->u_arg[3], "AT_???"); + + return RVAL_DECODED; +} + +#ifdef ALPHA +SYS_FUNC(osf_utimes) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + print_timeval32_pair(tcp, tcp->u_arg[1]); + + return RVAL_DECODED; +} +#endif /* ALPHA */ diff --git a/v4l2.c b/v4l2.c new file mode 100644 index 00000000..637e8788 --- /dev/null +++ b/v4l2.c @@ -0,0 +1,947 @@ +/* + * Copyright (c) 2014 Philippe De Muyter + * Copyright (c) 2014 William Manley + * Copyright (c) 2011 Peter Zotov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_v4l2_buffer) +#include DEF_MPERS_TYPE(struct_v4l2_create_buffers) +#include DEF_MPERS_TYPE(struct_v4l2_ext_control) +#include DEF_MPERS_TYPE(struct_v4l2_ext_controls) +#include DEF_MPERS_TYPE(struct_v4l2_format) +#include DEF_MPERS_TYPE(struct_v4l2_framebuffer) +#include DEF_MPERS_TYPE(struct_v4l2_input) +#include DEF_MPERS_TYPE(struct_v4l2_standard) + +#include +#include +#include +#include + +typedef struct v4l2_buffer struct_v4l2_buffer; +typedef struct v4l2_create_buffers struct_v4l2_create_buffers; +typedef struct v4l2_ext_control struct_v4l2_ext_control; +typedef struct v4l2_ext_controls struct_v4l2_ext_controls; +typedef struct v4l2_format struct_v4l2_format; +typedef struct v4l2_framebuffer struct_v4l2_framebuffer; +typedef struct v4l2_input struct_v4l2_input; +typedef struct v4l2_standard struct_v4l2_standard; + +#include MPERS_DEFS + +/* some historical constants */ +#ifndef V4L2_CID_HCENTER +#define V4L2_CID_HCENTER (V4L2_CID_BASE+22) +#endif +#ifndef V4L2_CID_VCENTER +#define V4L2_CID_VCENTER (V4L2_CID_BASE+23) +#endif +#ifndef V4L2_CID_BAND_STOP_FILTER +#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) +#endif + +#define FMT_FRACT "%u/%u" +#define ARGS_FRACT(x) ((x).numerator), ((x).denominator) + +#define FMT_RECT "{left=%d, top=%d, width=%u, height=%u}" +#define ARGS_RECT(x) (x).left, (x).top, (x).width, (x).height + +static void +print_pixelformat(uint32_t fourcc) +{ + const union { + uint32_t pixelformat; + unsigned char cc[sizeof(uint32_t)]; + } u = { +#if WORDS_BIGENDIAN + .cc = { + (unsigned char) (fourcc >> 24), + (unsigned char) (fourcc >> 16), + (unsigned char) (fourcc >> 8), + (unsigned char) fourcc + } +#else + .pixelformat = fourcc +#endif + }; + unsigned int i; + + tprints("v4l2_fourcc("); + for (i = 0; i < sizeof(u.cc); ++i) { + unsigned char c = u.cc[i]; + + if (i) + tprints(", "); + if (c == '\'' || c == '\\') { + char sym[] = { + '\'', + '\\', + c, + '\'', + '\0' + }; + tprints(sym); + } else if (c >= ' ' && c <= 0x7e) { + char sym[] = { + '\'', + c, + '\'', + '\0' + }; + tprints(sym); + } else { + char hex[] = { + '\'', + '\\', + 'x', + "0123456789abcdef"[c >> 4], + "0123456789abcdef"[c & 0xf], + '\'', + '\0' + }; + tprints(hex); + } + } + tprints(")"); +} + +#include "xlat/v4l2_device_capabilities_flags.h" + +static int +print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct v4l2_capability caps; + + if (entering(tcp)) + return 0; + tprints(", "); + if (umove_or_printaddr(tcp, arg, &caps)) + return 1; + tprints("{driver="); + print_quoted_string((const char *) caps.driver, + sizeof(caps.driver), QUOTE_0_TERMINATED); + tprints(", card="); + print_quoted_string((const char *) caps.card, + sizeof(caps.card), QUOTE_0_TERMINATED); + tprints(", bus_info="); + print_quoted_string((const char *) caps.bus_info, + sizeof(caps.bus_info), QUOTE_0_TERMINATED); + tprintf(", version=%u.%u.%u, capabilities=", + (caps.version >> 16) & 0xFF, + (caps.version >> 8) & 0xFF, + caps.version & 0xFF); + printflags(v4l2_device_capabilities_flags, caps.capabilities, + "V4L2_CAP_???"); +#ifdef V4L2_CAP_DEVICE_CAPS + tprints(", device_caps="); + printflags(v4l2_device_capabilities_flags, caps.device_caps, + "V4L2_CAP_???"); +#endif + tprints("}"); + return 1; +} + +#include "xlat/v4l2_buf_types.h" +#include "xlat/v4l2_format_description_flags.h" + +static int +print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct v4l2_fmtdesc f; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &f)) + return RVAL_DECODED | 1; + tprintf("{index=%u, type=", f.index); + printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???"); + return 0; + } + + if (!syserror(tcp) && !umove(tcp, arg, &f)) { + tprints(", flags="); + printflags(v4l2_format_description_flags, f.flags, + "V4L2_FMT_FLAG_???"); + tprints(", description="); + print_quoted_string((const char *) f.description, + sizeof(f.description), + QUOTE_0_TERMINATED); + tprints(", pixelformat="); + print_pixelformat(f.pixelformat); + } + tprints("}"); + return 1; +} + +#include "xlat/v4l2_fields.h" +#include "xlat/v4l2_colorspaces.h" + +static void +print_v4l2_format_fmt(const char *prefix, const struct_v4l2_format *f) +{ + switch (f->type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + tprints(prefix); + tprintf("fmt.pix={width=%u, height=%u, pixelformat=", + f->fmt.pix.width, f->fmt.pix.height); + print_pixelformat(f->fmt.pix.pixelformat); + tprints(", field="); + printxval(v4l2_fields, f->fmt.pix.field, "V4L2_FIELD_???"); + tprintf(", bytesperline=%u, sizeimage=%u, colorspace=", + f->fmt.pix.bytesperline, f->fmt.pix.sizeimage); + printxval(v4l2_colorspaces, f->fmt.pix.colorspace, + "V4L2_COLORSPACE_???"); + tprints("}"); + break; +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { + unsigned int i, max; + + tprints(prefix); + tprintf("fmt.pix_mp={width=%u, height=%u, pixelformat=", + f->fmt.pix_mp.width, f->fmt.pix_mp.height); + print_pixelformat(f->fmt.pix_mp.pixelformat); + tprints(", field="); + printxval(v4l2_fields, f->fmt.pix_mp.field, "V4L2_FIELD_???"); + tprints(", colorspace="); + printxval(v4l2_colorspaces, f->fmt.pix_mp.colorspace, + "V4L2_COLORSPACE_???"); + tprints(", plane_fmt=["); + max = f->fmt.pix_mp.num_planes; + if (max > VIDEO_MAX_PLANES) + max = VIDEO_MAX_PLANES; + for (i = 0; i < max; i++) { + if (i > 0) + tprints(", "); + tprintf("{sizeimage=%u, bytesperline=%u}", + f->fmt.pix_mp.plane_fmt[i].sizeimage, + f->fmt.pix_mp.plane_fmt[i].bytesperline); + } + tprintf("], num_planes=%u}", (unsigned) f->fmt.pix_mp.num_planes); + break; + } +#endif + + /* TODO: Complete this switch statement */ +#if 0 + case V4L2_BUF_TYPE_VIDEO_OVERLAY: +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: +#endif + tprints(prefix); + tprints("fmt.win={???}"); + break; + + case V4L2_BUF_TYPE_VBI_CAPTURE: + case V4L2_BUF_TYPE_VBI_OUTPUT: + tprints(prefix); + tprints("fmt.vbi={???}"); + break; + + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: + tprints(prefix); + tprints("fmt.sliced={???}"); + break; + +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + case V4L2_BUF_TYPE_SDR_CAPTURE: + case V4L2_BUF_TYPE_SDR_OUTPUT: + tprints(prefix); + tprints("fmt.sdr={???}"); + break; +#endif +#endif + } +} + +static int +print_v4l2_format(struct tcb *const tcp, const kernel_ulong_t arg, + const bool is_get) +{ + struct_v4l2_format f; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &f)) + return RVAL_DECODED | 1; + tprints("{type="); + printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???"); + if (is_get) + return 0; + print_v4l2_format_fmt(", ", &f); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &f)) { + const char *delim = is_get ? ", " : " => "; + print_v4l2_format_fmt(delim, &f); + } + tprints("}"); + } + return 1; +} + +#include "xlat/v4l2_memories.h" + +static int +print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct v4l2_requestbuffers reqbufs; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &reqbufs)) + return RVAL_DECODED | 1; + tprintf("{count=%u, type=", reqbufs.count); + printxval(v4l2_buf_types, reqbufs.type, "V4L2_BUF_TYPE_???"); + tprints(", memory="); + printxval(v4l2_memories, reqbufs.memory, "V4L2_MEMORY_???"); + tprints("}"); + return 0; + } else { + static char outstr[sizeof("{count=}") + sizeof(int) * 3]; + + if (syserror(tcp) || umove(tcp, arg, &reqbufs) < 0) + return 1; + sprintf(outstr, "{count=%u}", reqbufs.count); + tcp->auxstr = outstr; + return 1 + RVAL_STR; + } +} + +#include "xlat/v4l2_buf_flags.h" + +static int +print_v4l2_buffer(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + struct_v4l2_buffer b; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &b)) + return RVAL_DECODED | 1; + tprints("{type="); + printxval(v4l2_buf_types, b.type, "V4L2_BUF_TYPE_???"); + if (code != VIDIOC_DQBUF) + tprintf(", index=%u", b.index); + } else { + if (!syserror(tcp) && umove(tcp, arg, &b) == 0) { + if (code == VIDIOC_DQBUF) + tprintf(", index=%u", b.index); + tprints(", memory="); + printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???"); + + if (b.memory == V4L2_MEMORY_MMAP) { + tprintf(", m.offset=%#x", b.m.offset); + } else if (b.memory == V4L2_MEMORY_USERPTR) { + tprints(", m.userptr="); + printaddr(b.m.userptr); + } + + tprintf(", length=%u, bytesused=%u, flags=", + b.length, b.bytesused); + printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???"); + if (code == VIDIOC_DQBUF) { + tprints(", timestamp = "); + MPERS_FUNC_NAME(print_struct_timeval)(&b.timestamp); + } + tprints(", ..."); + } + tprints("}"); + } + return 1; +} + +static int +print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct_v4l2_framebuffer b; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &b)) { + tprintf("{capability=%#x, flags=%#x, base=", + b.capability, b.flags); + printaddr(ptr_to_kulong(b.base)); + tprints("}"); + } + + return RVAL_DECODED | 1; +} + +static int +print_v4l2_buf_type(struct tcb *const tcp, const kernel_ulong_t arg) +{ + int type; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &type)) { + tprints("["); + printxval(v4l2_buf_types, type, "V4L2_BUF_TYPE_???"); + tprints("]"); + } + return RVAL_DECODED | 1; +} + +#include "xlat/v4l2_streaming_capabilities.h" +#include "xlat/v4l2_capture_modes.h" + +static int +print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg, + const bool is_get) +{ + struct v4l2_streamparm s; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &s)) + return RVAL_DECODED | 1; + tprints("{type="); + printxval(v4l2_buf_types, s.type, "V4L2_BUF_TYPE_???"); + switch (s.type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + if (is_get) + return 0; + tprints(", "); + break; + default: + tprints("}"); + return RVAL_DECODED | 1; + } + } else { + if (syserror(tcp) || umove(tcp, arg, &s) < 0) { + tprints("}"); + return 1; + } + tprints(is_get ? ", " : " => "); + } + + if (s.type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { + tprints("parm.capture={capability="); + printflags(v4l2_streaming_capabilities, + s.parm.capture.capability, "V4L2_CAP_???"); + + tprints(", capturemode="); + printflags(v4l2_capture_modes, + s.parm.capture.capturemode, "V4L2_MODE_???"); + + tprintf(", timeperframe=" FMT_FRACT, + ARGS_FRACT(s.parm.capture.timeperframe)); + + tprintf(", extendedmode=%u, readbuffers=%u}", + s.parm.capture.extendedmode, + s.parm.capture.readbuffers); + } else { + tprints("parm.output={capability="); + printflags(v4l2_streaming_capabilities, + s.parm.output.capability, "V4L2_CAP_???"); + + tprintf(", outputmode=%u", s.parm.output.outputmode); + + tprintf(", timeperframe=" FMT_FRACT, + ARGS_FRACT(s.parm.output.timeperframe)); + + tprintf(", extendedmode=%u, writebuffers=%u}", + s.parm.output.extendedmode, + s.parm.output.writebuffers); + } + if (exiting(tcp)) + tprints("}"); + return 1; +} + +static int +print_v4l2_standard(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct_v4l2_standard s; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &s)) + return RVAL_DECODED | 1; + tprintf("{index=%u", s.index); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &s)) { + tprints(", name="); + print_quoted_string((const char *) s.name, + sizeof(s.name), + QUOTE_0_TERMINATED); + tprintf(", frameperiod=" FMT_FRACT, + ARGS_FRACT(s.frameperiod)); + tprintf(", framelines=%d", s.framelines); + } + tprints("}"); + } + return 1; +} + +#include "xlat/v4l2_input_types.h" + +static int +print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct_v4l2_input i; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &i)) + return RVAL_DECODED | 1; + tprintf("{index=%u", i.index); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &i)) { + tprints(", name="); + print_quoted_string((const char *) i.name, + sizeof(i.name), + QUOTE_0_TERMINATED); + tprints(", type="); + printxval(v4l2_input_types, i.type, + "V4L2_INPUT_TYPE_???"); + } + tprints("}"); + } + return 1; +} + +#include "xlat/v4l2_control_ids.h" + +static int +print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg, + const bool is_get) +{ + struct v4l2_control c; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &c)) + return RVAL_DECODED | 1; + tprints("{id="); + printxval(v4l2_control_ids, c.id, "V4L2_CID_???"); + if (!is_get) + tprintf(", value=%d", c.value); + return 0; + } + + if (!syserror(tcp) && !umove(tcp, arg, &c)) { + tprints(is_get ? ", " : " => "); + tprintf("value=%d", c.value); + } + + tprints("}"); + return 1; +} + +#include "xlat/v4l2_control_types.h" +#include "xlat/v4l2_control_flags.h" + +static int +print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct v4l2_queryctrl c; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &c)) + return RVAL_DECODED | 1; + tprints("{id="); + } else { + if (syserror(tcp) || umove(tcp, arg, &c) < 0) { + tprints("}"); + return 1; + } + if (get_tcb_priv_ulong(tcp)) + tprints(" => "); + } + + if (entering(tcp) || get_tcb_priv_ulong(tcp)) { +#ifdef V4L2_CTRL_FLAG_NEXT_CTRL + const unsigned long next = c.id & V4L2_CTRL_FLAG_NEXT_CTRL; + set_tcb_priv_ulong(tcp, next); + if (next) { + tprints("V4L2_CTRL_FLAG_NEXT_CTRL|"); + c.id &= ~V4L2_CTRL_FLAG_NEXT_CTRL; + } +#endif + printxval(v4l2_control_ids, c.id, "V4L2_CID_???"); + } + + if (exiting(tcp)) { + tprints(", type="); + printxval(v4l2_control_types, c.type, "V4L2_CTRL_TYPE_???"); + tprints(", name="); + print_quoted_string((const char *) c.name, + sizeof(c.name), + QUOTE_0_TERMINATED); + tprintf(", minimum=%d, maximum=%d, step=%d" + ", default_value=%d, flags=", + c.minimum, c.maximum, c.step, c.default_value); + printflags(v4l2_control_flags, c.flags, "V4L2_CTRL_FLAG_???"); + tprints("}"); + } + return 1; +} + +static int +print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct v4l2_cropcap c; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &c)) + return RVAL_DECODED | 1; + tprints("{type="); + printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???"); + return 0; + } + if (!syserror(tcp) && !umove(tcp, arg, &c)) { + tprintf(", bounds=" FMT_RECT + ", defrect=" FMT_RECT + ", pixelaspect=" FMT_FRACT, + ARGS_RECT(c.bounds), + ARGS_RECT(c.defrect), + ARGS_FRACT(c.pixelaspect)); + } + tprints("}"); + return 1; +} + +static int +print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg, + const bool is_get) +{ + struct v4l2_crop c; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &c)) + return RVAL_DECODED | 1; + tprints("{type="); + printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???"); + if (is_get) + return 0; + tprintf(", c=" FMT_RECT, ARGS_RECT(c.c)); + } else { + if (!syserror(tcp) && !umove(tcp, arg, &c)) + tprintf(", c=" FMT_RECT, ARGS_RECT(c.c)); + } + + tprints("}"); + return RVAL_DECODED | 1; +} + +#ifdef VIDIOC_S_EXT_CTRLS +static bool +print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) +{ + const struct_v4l2_ext_control *p = elem_buf; + + tprints("{id="); + printxval(v4l2_control_ids, p->id, "V4L2_CID_???"); +# if HAVE_DECL_V4L2_CTRL_TYPE_STRING + tprintf(", size=%u", p->size); + if (p->size > 0) { + tprints(", string="); + printstrn(tcp, ptr_to_kulong(p->string), p->size); + } else +# endif + tprintf(", value=%d, value64=%" PRId64, p->value, (int64_t) p->value64); + tprints("}"); + + return true; +} + +#include "xlat/v4l2_control_classes.h" + +static int +print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, + const bool is_get) +{ + struct_v4l2_ext_controls c; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &c)) + return RVAL_DECODED | 1; + tprints("{ctrl_class="); + printxval(v4l2_control_classes, c.ctrl_class, + "V4L2_CTRL_CLASS_???"); + tprintf(", count=%u", c.count); + if (!c.count) { + tprints("}"); + return RVAL_DECODED | 1; + } + if (is_get) + return 0; + tprints(", "); + } else { + if (umove(tcp, arg, &c) < 0) { + tprints("}"); + return 1; + } + tprints(is_get ? ", " : " => "); + } + + tprints("controls="); + struct_v4l2_ext_control ctrl; + bool fail = !print_array(tcp, ptr_to_kulong(c.controls), c.count, + &ctrl, sizeof(ctrl), + umoven_or_printaddr_ignore_syserror, + print_v4l2_ext_control, 0); + + if (exiting(tcp) && syserror(tcp)) + tprintf(", error_idx=%u", c.error_idx); + + if (exiting(tcp) || fail) { + tprints("}"); + return RVAL_DECODED | 1; + } + return 1; +} +#endif /* VIDIOC_S_EXT_CTRLS */ + +#ifdef VIDIOC_ENUM_FRAMESIZES +# include "xlat/v4l2_framesize_types.h" + +static int +print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct v4l2_frmsizeenum s; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &s)) + return RVAL_DECODED | 1; + tprintf("{index=%u, pixel_format=", s.index); + print_pixelformat(s.pixel_format); + return 0; + } + + if (!syserror(tcp) && !umove(tcp, arg, &s)) { + tprints(", type="); + printxval(v4l2_framesize_types, s.type, "V4L2_FRMSIZE_TYPE_???"); + switch (s.type) { + case V4L2_FRMSIZE_TYPE_DISCRETE: + tprintf(", discrete={width=%u, height=%u}", + s.discrete.width, s.discrete.height); + break; + case V4L2_FRMSIZE_TYPE_STEPWISE: + tprintf(", stepwise={min_width=%u, max_width=%u, " + "step_width=%u, min_height=%u, max_height=%u, " + "step_height=%u}", + s.stepwise.min_width, s.stepwise.max_width, + s.stepwise.step_width, s.stepwise.min_height, + s.stepwise.max_height, s.stepwise.step_height); + break; + } + } + tprints("}"); + return 1; +} +#endif /* VIDIOC_ENUM_FRAMESIZES */ + +#ifdef VIDIOC_ENUM_FRAMEINTERVALS +# include "xlat/v4l2_frameinterval_types.h" + +static int +print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct v4l2_frmivalenum f; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &f)) + return RVAL_DECODED | 1; + tprintf("{index=%u, pixel_format=", f.index); + print_pixelformat(f.pixel_format); + tprintf(", width=%u, height=%u", f.width, f.height); + return 0; + } + if (!syserror(tcp) && !umove(tcp, arg, &f)) { + tprints(", type="); + printxval(v4l2_frameinterval_types, f.type, + "V4L2_FRMIVAL_TYPE_???"); + switch (f.type) { + case V4L2_FRMIVAL_TYPE_DISCRETE: + tprintf(", discrete=" FMT_FRACT, + ARGS_FRACT(f.discrete)); + break; + case V4L2_FRMIVAL_TYPE_STEPWISE: + case V4L2_FRMSIZE_TYPE_CONTINUOUS: + tprintf(", stepwise={min=" FMT_FRACT ", max=" + FMT_FRACT ", step=" FMT_FRACT "}", + ARGS_FRACT(f.stepwise.min), + ARGS_FRACT(f.stepwise.max), + ARGS_FRACT(f.stepwise.step)); + break; + } + } + tprints("}"); + return 1; +} +#endif /* VIDIOC_ENUM_FRAMEINTERVALS */ + +#ifdef VIDIOC_CREATE_BUFS +static int +print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct_v4l2_create_buffers b; + + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &b)) + return RVAL_DECODED | 1; + tprintf("{count=%u, memory=", b.count); + printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???"); + tprints(", format={type="); + printxval(v4l2_buf_types, b.format.type, + "V4L2_BUF_TYPE_???"); + print_v4l2_format_fmt(", ", + (struct_v4l2_format *) &b.format); + tprints("}}"); + return 0; + } else { + static const char fmt[] = "{index=%u, count=%u}"; + static char outstr[sizeof(fmt) + sizeof(int) * 6]; + + if (syserror(tcp) || umove(tcp, arg, &b) < 0) + return 1; + sprintf(outstr, fmt, b.index, b.count); + tcp->auxstr = outstr; + return 1 + RVAL_STR; + } +} +#endif /* VIDIOC_CREATE_BUFS */ + +MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) +{ + if (!verbose(tcp)) + return RVAL_DECODED; + + switch (code) { + case VIDIOC_QUERYCAP: /* R */ + return print_v4l2_capability(tcp, arg); + + case VIDIOC_ENUM_FMT: /* RW */ + return print_v4l2_fmtdesc(tcp, arg); + + case VIDIOC_G_FMT: /* RW */ + case VIDIOC_S_FMT: /* RW */ + case VIDIOC_TRY_FMT: /* RW */ + return print_v4l2_format(tcp, arg, code == VIDIOC_G_FMT); + + case VIDIOC_REQBUFS: /* RW */ + return print_v4l2_requestbuffers(tcp, arg); + + case VIDIOC_QUERYBUF: /* RW */ + case VIDIOC_QBUF: /* RW */ + case VIDIOC_DQBUF: /* RW */ + return print_v4l2_buffer(tcp, code, arg); + + case VIDIOC_G_FBUF: /* R */ + if (entering(tcp)) + return 0; + /* fall through */ + case VIDIOC_S_FBUF: /* W */ + return print_v4l2_framebuffer(tcp, arg); + + case VIDIOC_STREAMON: /* W */ + case VIDIOC_STREAMOFF: /* W */ + return print_v4l2_buf_type(tcp, arg); + + case VIDIOC_G_PARM: /* RW */ + case VIDIOC_S_PARM: /* RW */ + return print_v4l2_streamparm(tcp, arg, code == VIDIOC_G_PARM); + + case VIDIOC_G_STD: /* R */ + if (entering(tcp)) + return 0; + /* fall through */ + case VIDIOC_S_STD: /* W */ + tprints(", "); + printnum_int64(tcp, arg, "%#" PRIx64); + return RVAL_DECODED | 1; + + case VIDIOC_ENUMSTD: /* RW */ + return print_v4l2_standard(tcp, arg); + + case VIDIOC_ENUMINPUT: /* RW */ + return print_v4l2_input(tcp, arg); + + case VIDIOC_G_CTRL: /* RW */ + case VIDIOC_S_CTRL: /* RW */ + return print_v4l2_control(tcp, arg, code == VIDIOC_G_CTRL); + + case VIDIOC_QUERYCTRL: /* RW */ + return print_v4l2_queryctrl(tcp, arg); + + case VIDIOC_G_INPUT: /* R */ + if (entering(tcp)) + return 0; + /* fall through */ + case VIDIOC_S_INPUT: /* RW */ + tprints(", "); + printnum_int(tcp, arg, "%u"); + return RVAL_DECODED | 1; + + case VIDIOC_CROPCAP: /* RW */ + return print_v4l2_cropcap(tcp, arg); + + case VIDIOC_G_CROP: /* RW */ + case VIDIOC_S_CROP: /* W */ + return print_v4l2_crop(tcp, arg, code == VIDIOC_G_CROP); + +#ifdef VIDIOC_S_EXT_CTRLS + case VIDIOC_S_EXT_CTRLS: /* RW */ + case VIDIOC_TRY_EXT_CTRLS: /* RW */ + case VIDIOC_G_EXT_CTRLS: /* RW */ + return print_v4l2_ext_controls(tcp, arg, + code == VIDIOC_G_EXT_CTRLS); +#endif /* VIDIOC_S_EXT_CTRLS */ + +#ifdef VIDIOC_ENUM_FRAMESIZES + case VIDIOC_ENUM_FRAMESIZES: /* RW */ + return print_v4l2_frmsizeenum(tcp, arg); +#endif /* VIDIOC_ENUM_FRAMESIZES */ + +#ifdef VIDIOC_ENUM_FRAMEINTERVALS + case VIDIOC_ENUM_FRAMEINTERVALS: /* RW */ + return print_v4l2_frmivalenum(tcp, arg); +#endif /* VIDIOC_ENUM_FRAMEINTERVALS */ + +#ifdef VIDIOC_CREATE_BUFS + case VIDIOC_CREATE_BUFS: /* RW */ + return print_v4l2_create_buffers(tcp, arg); +#endif /* VIDIOC_CREATE_BUFS */ + + default: + return RVAL_DECODED; + } +} diff --git a/vsprintf.c b/vsprintf.c deleted file mode 100644 index 0125e720..00000000 --- a/vsprintf.c +++ /dev/null @@ -1,790 +0,0 @@ -/* - * Taken from Linux kernel's linux/lib/vsprintf.c - * and somewhat simplified. - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ -/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ -/* - * Wirzenius wrote this portably, Torvalds fucked it up :-) - */ - -#include "defs.h" - -#if USE_CUSTOM_PRINTF - -#include -#include - -#ifndef HAVE_FPUTS_UNLOCKED -# define fputs_unlocked fputs -#endif - -#define noinline_for_stack /*nothing*/ -#define likely(expr) (expr) -#define unlikely(expr) (expr) - -#define do_div(n, d) ({ __typeof(num) t = n % d; n /= d; t; }) - -#undef isdigit -#define isdigit(a) ((unsigned char)((a) - '0') <= 9) - -static inline -int skip_atoi(const char **s) -{ - int i = 0; - const char *p = *s; - - while (isdigit(*p)) - i = i*10 + *p++ - '0'; - - *s = p; - return i; -} - -/* Decimal conversion is by far the most typical, and is used - * for /proc and /sys data. This directly impacts e.g. top performance - * with many processes running. We optimize it for speed - * using ideas described at - * (with permission from the author, Douglas W. Jones). - */ - -#if LONG_MAX != 0x7fffffffUL || LLONG_MAX != 0x7fffffffffffffffULL -/* Formats correctly any integer in [0, 999999999] */ -static noinline_for_stack -char *put_dec_full9(char *buf, unsigned q) -{ - unsigned r; - - /* Possible ways to approx. divide by 10 - * (x * 0x1999999a) >> 32 x < 1073741829 (multiply must be 64-bit) - * (x * 0xcccd) >> 19 x < 81920 (x < 262149 when 64-bit mul) - * (x * 0x6667) >> 18 x < 43699 - * (x * 0x3334) >> 17 x < 16389 - * (x * 0x199a) >> 16 x < 16389 - * (x * 0x0ccd) >> 15 x < 16389 - * (x * 0x0667) >> 14 x < 2739 - * (x * 0x0334) >> 13 x < 1029 - * (x * 0x019a) >> 12 x < 1029 - * (x * 0x00cd) >> 11 x < 1029 shorter code than * 0x67 (on i386) - * (x * 0x0067) >> 10 x < 179 - * (x * 0x0034) >> 9 x < 69 same - * (x * 0x001a) >> 8 x < 69 same - * (x * 0x000d) >> 7 x < 69 same, shortest code (on i386) - * (x * 0x0007) >> 6 x < 19 - * See - */ - r = (q * (uint64_t)0x1999999a) >> 32; - *buf++ = (q - 10 * r) + '0'; /* 1 */ - q = (r * (uint64_t)0x1999999a) >> 32; - *buf++ = (r - 10 * q) + '0'; /* 2 */ - r = (q * (uint64_t)0x1999999a) >> 32; - *buf++ = (q - 10 * r) + '0'; /* 3 */ - q = (r * (uint64_t)0x1999999a) >> 32; - *buf++ = (r - 10 * q) + '0'; /* 4 */ - r = (q * (uint64_t)0x1999999a) >> 32; - *buf++ = (q - 10 * r) + '0'; /* 5 */ - /* Now value is under 10000, can avoid 64-bit multiply */ - q = (r * 0x199a) >> 16; - *buf++ = (r - 10 * q) + '0'; /* 6 */ - r = (q * 0xcd) >> 11; - *buf++ = (q - 10 * r) + '0'; /* 7 */ - q = (r * 0xcd) >> 11; - *buf++ = (r - 10 * q) + '0'; /* 8 */ - *buf++ = q + '0'; /* 9 */ - return buf; -} -#endif - -/* Similar to above but do not pad with zeros. - * Code can be easily arranged to print 9 digits too, but our callers - * always call put_dec_full9() instead when the number has 9 decimal digits. - */ -static noinline_for_stack -char *put_dec_trunc8(char *buf, unsigned r) -{ - unsigned q; - - /* Copy of previous function's body with added early returns */ - q = (r * (uint64_t)0x1999999a) >> 32; - *buf++ = (r - 10 * q) + '0'; /* 2 */ - if (q == 0) return buf; - r = (q * (uint64_t)0x1999999a) >> 32; - *buf++ = (q - 10 * r) + '0'; /* 3 */ - if (r == 0) return buf; - q = (r * (uint64_t)0x1999999a) >> 32; - *buf++ = (r - 10 * q) + '0'; /* 4 */ - if (q == 0) return buf; - r = (q * (uint64_t)0x1999999a) >> 32; - *buf++ = (q - 10 * r) + '0'; /* 5 */ - if (r == 0) return buf; - q = (r * 0x199a) >> 16; - *buf++ = (r - 10 * q) + '0'; /* 6 */ - if (q == 0) return buf; - r = (q * 0xcd) >> 11; - *buf++ = (q - 10 * r) + '0'; /* 7 */ - if (r == 0) return buf; - q = (r * 0xcd) >> 11; - *buf++ = (r - 10 * q) + '0'; /* 8 */ - if (q == 0) return buf; - *buf++ = q + '0'; /* 9 */ - return buf; -} - -/* There are two algorithms to print larger numbers. - * One is generic: divide by 1000000000 and repeatedly print - * groups of (up to) 9 digits. It's conceptually simple, - * but requires a (unsigned long long) / 1000000000 division. - * - * Second algorithm splits 64-bit unsigned long long into 16-bit chunks, - * manipulates them cleverly and generates groups of 4 decimal digits. - * It so happens that it does NOT require long long division. - * - * If long is > 32 bits, division of 64-bit values is relatively easy, - * and we will use the first algorithm. - * If long long is > 64 bits (strange architecture with VERY large long long), - * second algorithm can't be used, and we again use the first one. - * - * Else (if long is 32 bits and long long is 64 bits) we use second one. - */ - -#if LONG_MAX != 0x7fffffffUL || LLONG_MAX != 0x7fffffffffffffffULL - -/* First algorithm: generic */ - -static -char *put_dec(char *buf, unsigned long long n) -{ - if (n >= 100*1000*1000) { - while (n >= 1000*1000*1000) - buf = put_dec_full9(buf, do_div(n, 1000*1000*1000)); - if (n >= 100*1000*1000) - return put_dec_full9(buf, n); - } - return put_dec_trunc8(buf, n); -} - -#else - -/* Second algorithm: valid only for 64-bit long longs */ - -static noinline_for_stack -char *put_dec_full4(char *buf, unsigned q) -{ - unsigned r; - r = (q * 0xcccd) >> 19; - *buf++ = (q - 10 * r) + '0'; - q = (r * 0x199a) >> 16; - *buf++ = (r - 10 * q) + '0'; - r = (q * 0xcd) >> 11; - *buf++ = (q - 10 * r) + '0'; - *buf++ = r + '0'; - return buf; -} - -/* Based on code by Douglas W. Jones found at - * - * (with permission from the author). - * Performs no 64-bit division and hence should be fast on 32-bit machines. - */ -static -char *put_dec(char *buf, unsigned long long n) -{ - uint32_t d3, d2, d1, q, h; - - if (n < 100*1000*1000) - return put_dec_trunc8(buf, n); - - d1 = ((uint32_t)n >> 16); /* implicit "& 0xffff" */ - h = (n >> 32); - d2 = (h ) & 0xffff; - d3 = (h >> 16); /* implicit "& 0xffff" */ - - q = 656 * d3 + 7296 * d2 + 5536 * d1 + ((uint32_t)n & 0xffff); - - buf = put_dec_full4(buf, q % 10000); - q = q / 10000; - - d1 = q + 7671 * d3 + 9496 * d2 + 6 * d1; - buf = put_dec_full4(buf, d1 % 10000); - q = d1 / 10000; - - d2 = q + 4749 * d3 + 42 * d2; - buf = put_dec_full4(buf, d2 % 10000); - q = d2 / 10000; - - d3 = q + 281 * d3; - if (!d3) - goto done; - buf = put_dec_full4(buf, d3 % 10000); - q = d3 / 10000; - if (!q) - goto done; - buf = put_dec_full4(buf, q); - done: - while (buf[-1] == '0') - --buf; - - return buf; -} - -#endif - -/* - * For strace, the following formats are not supported: - * %h[h]u, %zu, %tu - use [unsigned] int/long/long long fmt instead - * %8.4u - no precision field for integers allowed (ok for strings) - * %+d, % d - no forced sign or force "space positive" sign - * %-07u - use %-7u instead - * %X - works as %x - */ - -#define ZEROPAD 1 /* pad with zero */ -#define SIGN 2 /* unsigned/signed long */ -//#define PLUS 4 /* show plus */ -//#define SPACE 8 /* space if plus */ -#define LEFT 16 /* left justified */ -//#deefine SMALL 32 /* use lowercase in hex (must be 32 == 0x20) */ -#define SPECIAL 64 /* prefix hex with "0x", octal with "0" */ - -enum format_type { - FORMAT_TYPE_NONE, /* Just a string part */ - FORMAT_TYPE_WIDTH, - FORMAT_TYPE_PRECISION, - FORMAT_TYPE_CHAR, - FORMAT_TYPE_STR, - FORMAT_TYPE_PTR, - FORMAT_TYPE_PERCENT_CHAR, - FORMAT_TYPE_INVALID, - FORMAT_TYPE_LONG_LONG, - FORMAT_TYPE_ULONG, - FORMAT_TYPE_LONG, - FORMAT_TYPE_UINT, - FORMAT_TYPE_INT, -}; - -struct printf_spec { - uint8_t type; /* format_type enum */ - uint8_t flags; /* flags to number() */ - uint8_t base; /* number base, 8, 10 or 16 only */ - uint8_t qualifier; /* number qualifier, one of 'hHlLtzZ' */ - int field_width; /* width of output field */ - int precision; /* # of digits/chars */ -}; - -static noinline_for_stack -char *number(char *buf, char *end, unsigned long long num, - struct printf_spec spec) -{ - /* we are called with base 8, 10 or 16, only, thus don't need "G..." */ - static const char digits[16] = "0123456789abcdef"; /* "GHIJKLMNOPQRSTUVWXYZ"; */ - - char tmp[sizeof(long long)*3 + 4]; - char sign; - int need_pfx = ((spec.flags & SPECIAL) && spec.base != 10); - int i; - - /* We may overflow the buf. Crudely check for it */ - i = sizeof(long long)*3 + 4; - if (i < spec.field_width) - i = spec.field_width; - if ((end - buf) <= i) - return buf + i; - -//we don't use formats like "%-07u" -// if (spec.flags & LEFT) -// spec.flags &= ~ZEROPAD; - sign = 0; - if (spec.flags & SIGN) { - if ((signed long long)num < 0) { - sign = '-'; - num = -(signed long long)num; - spec.field_width--; -// } else if (spec.flags & PLUS) { -// sign = '+'; -// spec.field_width--; -// } else if (spec.flags & SPACE) { -// sign = ' '; -// spec.field_width--; - } - } - if (need_pfx) { - spec.field_width--; - if (spec.base == 16) - spec.field_width--; - } - - /* generate full string in tmp[], in reverse order */ - i = 0; - if (num < spec.base) - tmp[i++] = digits[num]; - /* Generic code, for any base: - else do { - tmp[i++] = (digits[do_div(num,base)]); - } while (num != 0); - */ - else if (spec.base != 10) { /* 8 or 16 */ - int mask = spec.base - 1; - int shift = 3; - - if (spec.base == 16) - shift = 4; - do { - tmp[i++] = digits[((unsigned char)num) & mask]; - num >>= shift; - } while (num); - } else { /* base 10 */ - i = put_dec(tmp, num) - tmp; - } - -//spec.precision is assumed 0 ("not specified") -// /* printing 100 using %2d gives "100", not "00" */ -// if (i > spec.precision) -// spec.precision = i; -// /* leading space padding */ -// spec.field_width -= spec.precision; - spec.field_width -= i; - if (!(spec.flags & (ZEROPAD+LEFT))) { - while (--spec.field_width >= 0) { - ///if (buf < end) - *buf = ' '; - ++buf; - } - } - /* sign */ - if (sign) { - ///if (buf < end) - *buf = sign; - ++buf; - } - /* "0x" / "0" prefix */ - if (need_pfx) { - ///if (buf < end) - *buf = '0'; - ++buf; - if (spec.base == 16) { - ///if (buf < end) - *buf = 'x'; - ++buf; - } - } - /* zero or space padding */ - if (!(spec.flags & LEFT)) { - char c = (spec.flags & ZEROPAD) ? '0' : ' '; - while (--spec.field_width >= 0) { - ///if (buf < end) - *buf = c; - ++buf; - } - } -// /* hmm even more zero padding? */ -// while (i <= --spec.precision) { -// ///if (buf < end) -// *buf = '0'; -// ++buf; -// } - /* actual digits of result */ - while (--i >= 0) { - ///if (buf < end) - *buf = tmp[i]; - ++buf; - } - /* trailing space padding */ - while (--spec.field_width >= 0) { - ///if (buf < end) - *buf = ' '; - ++buf; - } - - return buf; -} - -static noinline_for_stack -char *string(char *buf, char *end, const char *s, struct printf_spec spec) -{ - int len, i; - - if (!s) - s = "(null)"; - - len = strnlen(s, spec.precision); - - /* We may overflow the buf. Crudely check for it */ - i = len; - if (i < spec.field_width) - i = spec.field_width; - if ((end - buf) <= i) - return buf + i; - - if (!(spec.flags & LEFT)) { - while (len < spec.field_width--) { - ///if (buf < end) - *buf = ' '; - ++buf; - } - } - for (i = 0; i < len; ++i) { - ///if (buf < end) - *buf = *s; - ++buf; ++s; - } - while (len < spec.field_width--) { - ///if (buf < end) - *buf = ' '; - ++buf; - } - - return buf; -} - -static noinline_for_stack -char *pointer(const char *fmt, char *buf, char *end, void *ptr, - struct printf_spec spec) -{ -// spec.flags |= SMALL; - if (spec.field_width == -1) { - spec.field_width = 2 * sizeof(void *); - spec.flags |= ZEROPAD; - } - spec.base = 16; - - return number(buf, end, (unsigned long) ptr, spec); -} - -/* - * Helper function to decode printf style format. - * Each call decode a token from the format and return the - * number of characters read (or likely the delta where it wants - * to go on the next call). - * The decoded token is returned through the parameters - * - * 'h', 'l', or 'L' for integer fields - * 'z' support added 23/7/1999 S.H. - * 'z' changed to 'Z' --davidm 1/25/99 - * 't' added for ptrdiff_t - * - * @fmt: the format string - * @type of the token returned - * @flags: various flags such as +, -, # tokens.. - * @field_width: overwritten width - * @base: base of the number (octal, hex, ...) - * @precision: precision of a number - * @qualifier: qualifier of a number (long, size_t, ...) - */ -static noinline_for_stack -int format_decode(const char *fmt, struct printf_spec *spec) -{ - const char *start = fmt; - - /* we finished early by reading the field width */ - if (spec->type == FORMAT_TYPE_WIDTH) { - if (spec->field_width < 0) { - spec->field_width = -spec->field_width; - spec->flags |= LEFT; - } - spec->type = FORMAT_TYPE_NONE; - goto precision; - } - - /* we finished early by reading the precision */ - if (spec->type == FORMAT_TYPE_PRECISION) { - if (spec->precision < 0) - spec->precision = 0; - - spec->type = FORMAT_TYPE_NONE; - goto qualifier; - } - - /* By default */ - spec->type = FORMAT_TYPE_NONE; - - for (;;) { - if (*fmt == '\0') - return fmt - start; - if (*fmt == '%') - break; - ++fmt; - } - - /* Return the current non-format string */ - if (fmt != start) - return fmt - start; - - /* Process flags */ - spec->flags = 0; - - while (1) { /* this also skips first '%' */ - bool found = true; - - ++fmt; - - switch (*fmt) { - case '-': spec->flags |= LEFT; break; -// case '+': spec->flags |= PLUS; break; -// case ' ': spec->flags |= SPACE; break; - case '#': spec->flags |= SPECIAL; break; - case '0': spec->flags |= ZEROPAD; break; - default: found = false; - } - - if (!found) - break; - } - - /* get field width */ - spec->field_width = -1; - - if (isdigit(*fmt)) - spec->field_width = skip_atoi(&fmt); - else if (*fmt == '*') { - /* it's the next argument */ - spec->type = FORMAT_TYPE_WIDTH; - return ++fmt - start; - } - -precision: - /* get the precision */ - spec->precision = -1; - if (*fmt == '.') { - ++fmt; - if (isdigit(*fmt)) { - spec->precision = skip_atoi(&fmt); -// if (spec->precision < 0) -// spec->precision = 0; - } else if (*fmt == '*') { - /* it's the next argument */ - spec->type = FORMAT_TYPE_PRECISION; - return ++fmt - start; - } - } - -qualifier: - /* get the conversion qualifier */ - spec->qualifier = -1; - if (*fmt == 'l') { - spec->qualifier = *fmt++; - if (unlikely(spec->qualifier == *fmt)) { - spec->qualifier = 'L'; - ++fmt; - } - } - - /* default base */ - spec->base = 10; - switch (*fmt) { - case 'c': - spec->type = FORMAT_TYPE_CHAR; - return ++fmt - start; - - case 's': - spec->type = FORMAT_TYPE_STR; - return ++fmt - start; - - case 'p': - spec->type = FORMAT_TYPE_PTR; - return ++fmt - start; - - case '%': - spec->type = FORMAT_TYPE_PERCENT_CHAR; - return ++fmt - start; - - /* integer number formats - set up the flags and "break" */ - case 'o': - spec->base = 8; - break; - - case 'x': -// spec->flags |= SMALL; - - case 'X': - spec->base = 16; - break; - - case 'd': - case 'i': - spec->flags |= SIGN; - case 'u': - break; - - default: - spec->type = FORMAT_TYPE_INVALID; - return fmt - start; - } - - if (spec->qualifier == 'L') - spec->type = FORMAT_TYPE_LONG_LONG; - else if (spec->qualifier == 'l') { - if (spec->flags & SIGN) - spec->type = FORMAT_TYPE_LONG; - else - spec->type = FORMAT_TYPE_ULONG; - } else { - if (spec->flags & SIGN) - spec->type = FORMAT_TYPE_INT; - else - spec->type = FORMAT_TYPE_UINT; - } - - return ++fmt - start; -} - -/** - * vsnprintf - Format a string and place it in a buffer - * @buf: The buffer to place the result into - * @size: The size of the buffer, including the trailing null space - * @fmt: The format string to use - * @args: Arguments for the format string - * - * The return value is the number of characters which would - * be generated for the given input, excluding the trailing - * '\0', as per ISO C99. If you want to have the exact - * number of characters written into @buf as return value - * (not including the trailing '\0'), use vscnprintf(). If the - * return is greater than or equal to @size, the resulting - * string is truncated. - * - * If you're not already dealing with a va_list consider using snprintf(). - */ -static -int kernel_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) -{ - unsigned long long num; - char *str, *end; - struct printf_spec spec = {0}; - - str = buf; - end = buf + size; - - while (*fmt) { - const char *old_fmt = fmt; - int read = format_decode(fmt, &spec); - - fmt += read; - - switch (spec.type) { - case FORMAT_TYPE_NONE: { - int copy = read; - if (str < end) { - if (copy > end - str) - copy = end - str; - memcpy(str, old_fmt, copy); - } - str += read; - break; - } - - case FORMAT_TYPE_WIDTH: - spec.field_width = va_arg(args, int); - break; - - case FORMAT_TYPE_PRECISION: - spec.precision = va_arg(args, int); - break; - - case FORMAT_TYPE_CHAR: { - char c; - - if (!(spec.flags & LEFT)) { - while (--spec.field_width > 0) { - if (str < end) - *str = ' '; - ++str; - - } - } - c = (unsigned char) va_arg(args, int); - if (str < end) - *str = c; - ++str; - while (--spec.field_width > 0) { - if (str < end) - *str = ' '; - ++str; - } - break; - } - - case FORMAT_TYPE_STR: - str = string(str, end, va_arg(args, char *), spec); - break; - - case FORMAT_TYPE_PTR: - str = pointer(fmt+1, str, end, va_arg(args, void *), - spec); -// while (isalnum(*fmt)) -// fmt++; - break; - - case FORMAT_TYPE_PERCENT_CHAR: - if (str < end) - *str = '%'; - ++str; - break; - - case FORMAT_TYPE_INVALID: - if (str < end) - *str = '%'; - ++str; - break; - - default: - switch (spec.type) { - case FORMAT_TYPE_LONG_LONG: - num = va_arg(args, long long); - break; - case FORMAT_TYPE_ULONG: - num = va_arg(args, unsigned long); - break; - case FORMAT_TYPE_LONG: - num = va_arg(args, long); - break; - case FORMAT_TYPE_INT: - num = (int) va_arg(args, int); - break; - default: - num = va_arg(args, unsigned int); - } - - str = number(str, end, num, spec); - } - } - -// if (size > 0) { - if (str < end) - *str = '\0'; -// else -// end[-1] = '\0'; -// } - - /* the trailing null byte doesn't count towards the total */ - return str-buf; - -} - -int strace_vfprintf(FILE *fp, const char *fmt, va_list args) -{ - static char *buf = NULL; - static unsigned buflen = 0; - - int r; - va_list a1; - - va_copy(a1, args); - unsigned len = kernel_vsnprintf(buf, buflen, fmt, a1); - va_end(a1); - - if (len >= buflen) { - buflen = len + 256; - free(buf); - buf = malloc(buflen); - if (!buf) - die_out_of_memory(); - /*len =*/ kernel_vsnprintf(buf, buflen, fmt, args); - } - - r = fputs_unlocked(buf, fp); - if (r < 0) return r; - return len; -} - -#endif /* USE_CUSTOM_PRINTF */ diff --git a/wait.c b/wait.c new file mode 100644 index 00000000..58dba8e4 --- /dev/null +++ b/wait.c @@ -0,0 +1,191 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993-1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 2002-2004 Roland McGrath + * Copyright (c) 2004 Ulrich Drepper + * Copyright (c) 2009-2013 Denys Vlasenko + * Copyright (c) 2014-2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#include + +#include "xlat/wait4_options.h" + +#if !defined WCOREFLAG && defined WCOREFLG +# define WCOREFLAG WCOREFLG +#endif +#ifndef WCOREFLAG +# define WCOREFLAG 0x80 +#endif +#ifndef WCOREDUMP +# define WCOREDUMP(status) ((status) & 0200) +#endif +#ifndef W_STOPCODE +# define W_STOPCODE(sig) ((sig) << 8 | 0x7f) +#endif +#ifndef W_EXITCODE +# define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) +#endif +#ifndef W_CONTINUED +# define W_CONTINUED 0xffff +#endif + +#include "ptrace.h" +#include "xlat/ptrace_events.h" + +static int +printstatus(int status) +{ + int exited = 0; + + /* + * Here is a tricky presentation problem. This solution + * is still not entirely satisfactory but since there + * are no wait status constructors it will have to do. + */ + if (WIFSTOPPED(status)) { + int sig = WSTOPSIG(status); + tprintf("[{WIFSTOPPED(s) && WSTOPSIG(s) == %s%s}", + signame(sig & 0x7f), + sig & 0x80 ? " | 0x80" : ""); + status &= ~W_STOPCODE(sig); + } + else if (WIFSIGNALED(status)) { + tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}", + signame(WTERMSIG(status)), + WCOREDUMP(status) ? " && WCOREDUMP(s)" : ""); + status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG); + } + else if (WIFEXITED(status)) { + tprintf("[{WIFEXITED(s) && WEXITSTATUS(s) == %d}", + WEXITSTATUS(status)); + exited = 1; + status &= ~W_EXITCODE(WEXITSTATUS(status), 0); + } +#ifdef WIFCONTINUED + else if (WIFCONTINUED(status)) { + tprints("[{WIFCONTINUED(s)}"); + status &= ~W_CONTINUED; + } +#endif + else { + tprintf("[%#x]", status); + return 0; + } + + if (status) { + unsigned int event = (unsigned int) status >> 16; + if (event) { + tprints(" | "); + printxval(ptrace_events, event, "PTRACE_EVENT_???"); + tprints(" << 16"); + status &= 0xffff; + } + if (status) + tprintf(" | %#x", status); + } + tprints("]"); + + return exited; +} + +static int +printwaitn(struct tcb *const tcp, + void (*const print_rusage)(struct tcb *, kernel_ulong_t)) +{ + if (entering(tcp)) { + /* On Linux, kernel-side pid_t is typedef'ed to int + * on all arches. Also, glibc-2.8 truncates wait3 and wait4 + * pid argument to int on 64bit arches, producing, + * for example, wait4(4294967295, ...) instead of -1 + * in strace. We have to use int here, not long. + */ + int pid = tcp->u_arg[0]; + tprintf("%d, ", pid); + } else { + int status; + + /* status */ + if (tcp->u_rval == 0) + printaddr(tcp->u_arg[1]); + else if (!umove_or_printaddr(tcp, tcp->u_arg[1], &status)) + printstatus(status); + /* options */ + tprints(", "); + printflags(wait4_options, tcp->u_arg[2], "W???"); + if (print_rusage) { + /* usage */ + tprints(", "); + if (tcp->u_rval > 0) + print_rusage(tcp, tcp->u_arg[3]); + else + printaddr(tcp->u_arg[3]); + } + } + return 0; +} + +SYS_FUNC(waitpid) +{ + return printwaitn(tcp, NULL); +} + +SYS_FUNC(wait4) +{ + return printwaitn(tcp, printrusage); +} + +#ifdef ALPHA +SYS_FUNC(osf_wait4) +{ + return printwaitn(tcp, printrusage32); +} +#endif + +#include "xlat/waitid_types.h" + +SYS_FUNC(waitid) +{ + if (entering(tcp)) { + printxval(waitid_types, tcp->u_arg[0], "P_???"); + int pid = tcp->u_arg[1]; + tprintf(", %d, ", pid); + } else { + /* siginfo */ + printsiginfo_at(tcp, tcp->u_arg[2]); + /* options */ + tprints(", "); + printflags(wait4_options, tcp->u_arg[3], "W???"); + /* usage */ + tprints(", "); + printrusage(tcp, tcp->u_arg[4]); + } + return 0; +} diff --git a/xattr.c b/xattr.c new file mode 100644 index 00000000..e7f550bf --- /dev/null +++ b/xattr.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2002-2005 Roland McGrath + * Copyright (c) 2004 Ulrich Drepper + * Copyright (c) 2005-2016 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#ifdef HAVE_SYS_XATTR_H +# include +#endif + +#include "xlat/xattrflags.h" + +#ifndef XATTR_SIZE_MAX +# define XATTR_SIZE_MAX 65536 +#endif + +static void +print_xattr_val(struct tcb *const tcp, + const kernel_ulong_t addr, + const kernel_ulong_t insize, + const kernel_ulong_t size) +{ + tprints(", "); + + if (size > XATTR_SIZE_MAX) + printaddr(addr); + else + printstr_ex(tcp, addr, size, QUOTE_OMIT_TRAILING_0); + tprintf(", %" PRI_klu, insize); +} + +SYS_FUNC(setxattr) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]); + tprints(", "); + printflags(xattrflags, tcp->u_arg[4], "XATTR_???"); + return RVAL_DECODED; +} + +SYS_FUNC(fsetxattr) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]); + tprints(", "); + printflags(xattrflags, tcp->u_arg[4], "XATTR_???"); + return RVAL_DECODED; +} + +SYS_FUNC(getxattr) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + } else { + print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_rval); + } + return 0; +} + +SYS_FUNC(fgetxattr) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + } else { + print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_rval); + } + return 0; +} + +static void +print_xattr_list(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t size) +{ + if (!size || syserror(tcp)) { + printaddr(addr); + } else { + printstrn(tcp, addr, tcp->u_rval); + } + tprintf(", %" PRI_klu, size); +} + +SYS_FUNC(listxattr) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]); + } + return 0; +} + +SYS_FUNC(flistxattr) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]); + } + return 0; +} + +SYS_FUNC(removexattr) +{ + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + return RVAL_DECODED; +} + +SYS_FUNC(fremovexattr) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printstr(tcp, tcp->u_arg[1]); + return RVAL_DECODED; +} diff --git a/xlat.h b/xlat.h new file mode 100644 index 00000000..aaa7aab0 --- /dev/null +++ b/xlat.h @@ -0,0 +1,17 @@ +#ifndef STRACE_XLAT_H +#define STRACE_XLAT_H + +# include + +struct xlat { + uint64_t val; + const char *str; +}; + +# define XLAT(val) { (unsigned)(val), #val } +# define XLAT_PAIR(val, str) { (unsigned)(val), str } +# define XLAT_TYPE(type, val) { (type)(val), #val } +# define XLAT_TYPE_PAIR(type, val, str) { (type)(val), str } +# define XLAT_END { 0, 0 } + +#endif /* !STRACE_XLAT_H */ diff --git a/xlat/Makemodule.am b/xlat/Makemodule.am index ea6f246a..5ba716a1 100644 --- a/xlat/Makemodule.am +++ b/xlat/Makemodule.am @@ -1,9 +1,7 @@ -XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclcmds.in xlat/aclipc.in xlat/addrfams.in xlat/adjtimex_modes.in xlat/adjtimex_state.in xlat/adjtimex_status.in xlat/advise.in xlat/af_packet_types.in xlat/archvals.in xlat/at_flags.in xlat/atomic_ops.in xlat/baud_options.in xlat/blkpg_ops.in xlat/bootflags1.in xlat/bootflags2.in xlat/bootflags3.in xlat/cacheflush_scope.in xlat/cap_version.in xlat/capabilities.in xlat/clockflags.in xlat/clocknames.in xlat/clone_flags.in xlat/cpuclocknames.in xlat/delete_module_flags.in xlat/direnttypes.in xlat/domains.in xlat/epollctls.in xlat/epollevents.in xlat/epollflags.in xlat/fan_classes.in xlat/fan_event_flags.in xlat/fan_init_flags.in xlat/fan_mark_flags.in xlat/fcntlcmds.in xlat/fdflags.in xlat/fileflags.in xlat/flockcmds.in xlat/fsmagic.in xlat/futexops.in xlat/futexwakecmps.in xlat/futexwakeops.in xlat/icmpfilterflags.in xlat/if_dqblk_valid.in xlat/if_dqinfo_valid.in xlat/iffflags.in xlat/inet_protocols.in xlat/inotify_flags.in xlat/inotify_init_flags.in xlat/ioprio_class.in xlat/ioprio_who.in xlat/ipc_msg_flags.in xlat/itimer_which.in xlat/kexec_arch_values.in xlat/kexec_flags.in xlat/key_perms.in xlat/key_reqkeys.in xlat/key_spec.in xlat/keyctl_commands.in xlat/lockfcmds.in xlat/loop_crypt_type_options.in xlat/loop_flags_options.in xlat/madvise_cmds.in xlat/mbindflags.in xlat/mctl_funcs.in xlat/mctl_lockas.in xlat/mctl_sync.in xlat/mempolicyflags.in xlat/mlockall_flags.in xlat/mmap_flags.in xlat/mmap_prot.in xlat/modem_flags.in xlat/modetypes.in xlat/modflags.in xlat/module_init_flags.in xlat/mount_flags.in xlat/move_pages_flags.in xlat/mremap_flags.in xlat/msg_flags.in xlat/msgctl_flags.in xlat/msgflags.in xlat/mtd_flags_options.in xlat/mtd_mode_options.in xlat/mtd_nandecc_options.in xlat/mtd_otp_options.in xlat/mtd_type_options.in xlat/netlink_protocols.in xlat/notifyflags.in xlat/nt_descriptor_types.in xlat/open_access_modes.in xlat/open_mode_flags.in xlat/openmodessol.in xlat/perf_event_open_flags.in xlat/personality_options.in xlat/pmsgflags.in xlat/policies.in xlat/pollflags.in xlat/prctl_options.in xlat/priorities.in xlat/ptp_flags_options.in xlat/ptrace_cmds.in xlat/ptrace_setoptions_flags.in xlat/qm_which.in xlat/quota_formats.in xlat/quotacmds.in xlat/quotatypes.in xlat/rename_flags.in xlat/resource_flags.in xlat/resources.in xlat/schedulers.in xlat/scmvals.in xlat/semctl_flags.in xlat/semop_flags.in xlat/sg_io_dxfer_direction.in xlat/shm_flags.in xlat/shm_resource_flags.in xlat/shmctl_flags.in xlat/shutdown_modes.in xlat/sigact_flags.in xlat/sigaltstack_flags.in xlat/sigbus_codes.in xlat/sigchld_codes.in xlat/sigemt_codes.in xlat/sigev_value.in xlat/sigfpe_codes.in xlat/sigill_codes.in xlat/siginfo_codes.in xlat/sigpoll_codes.in xlat/sigprocmaskcmds.in xlat/sigprof_codes.in xlat/sigsegv_codes.in xlat/sigsys_codes.in xlat/sigtrap_codes.in xlat/sock_type_flags.in xlat/socketlayers.in xlat/sockipoptions.in xlat/sockipv6options.in xlat/sockipxoptions.in xlat/sockoptions.in xlat/sockpacketoptions.in xlat/sockrawoptions.in xlat/socksctpoptions.in xlat/socktcpoptions.in xlat/socktypes.in xlat/splice_flags.in xlat/sram_alloc_flags.in xlat/swap_flags.in xlat/sync_file_range_flags.in xlat/sysctl_kern.in xlat/sysctl_net.in xlat/sysctl_net_core.in xlat/sysctl_net_ipv4.in xlat/sysctl_net_ipv4_conf.in xlat/sysctl_net_ipv4_route.in xlat/sysctl_net_ipv6.in xlat/sysctl_net_ipv6_route.in xlat/sysctl_net_unix.in xlat/sysctl_root.in xlat/sysctl_vm.in xlat/syslog_action_type.in xlat/sysmips_operations.in xlat/tcflsh_options.in xlat/tcxonc_options.in xlat/timerfdflags.in xlat/ubi_volume_props.in xlat/ubi_volume_types.in xlat/umount_flags.in xlat/usagewho.in xlat/wait4_options.in xlat/waitid_types.in xlat/whence_codes.in xlat/xattrflags.in xlat/xfs_dqblk_flags.in xlat/xfs_quota_flags.in -XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclcmds.h xlat/aclipc.h xlat/addrfams.h xlat/adjtimex_modes.h xlat/adjtimex_state.h xlat/adjtimex_status.h xlat/advise.h xlat/af_packet_types.h xlat/archvals.h xlat/at_flags.h xlat/atomic_ops.h xlat/baud_options.h xlat/blkpg_ops.h xlat/bootflags1.h xlat/bootflags2.h xlat/bootflags3.h xlat/cacheflush_scope.h xlat/cap_version.h xlat/capabilities.h xlat/clockflags.h xlat/clocknames.h xlat/clone_flags.h xlat/cpuclocknames.h xlat/delete_module_flags.h xlat/direnttypes.h xlat/domains.h xlat/epollctls.h xlat/epollevents.h xlat/epollflags.h xlat/fan_classes.h xlat/fan_event_flags.h xlat/fan_init_flags.h xlat/fan_mark_flags.h xlat/fcntlcmds.h xlat/fdflags.h xlat/fileflags.h xlat/flockcmds.h xlat/fsmagic.h xlat/futexops.h xlat/futexwakecmps.h xlat/futexwakeops.h xlat/icmpfilterflags.h xlat/if_dqblk_valid.h xlat/if_dqinfo_valid.h xlat/iffflags.h xlat/inet_protocols.h xlat/inotify_flags.h xlat/inotify_init_flags.h xlat/ioprio_class.h xlat/ioprio_who.h xlat/ipc_msg_flags.h xlat/itimer_which.h xlat/kexec_arch_values.h xlat/kexec_flags.h xlat/key_perms.h xlat/key_reqkeys.h xlat/key_spec.h xlat/keyctl_commands.h xlat/lockfcmds.h xlat/loop_crypt_type_options.h xlat/loop_flags_options.h xlat/madvise_cmds.h xlat/mbindflags.h xlat/mctl_funcs.h xlat/mctl_lockas.h xlat/mctl_sync.h xlat/mempolicyflags.h xlat/mlockall_flags.h xlat/mmap_flags.h xlat/mmap_prot.h xlat/modem_flags.h xlat/modetypes.h xlat/modflags.h xlat/module_init_flags.h xlat/mount_flags.h xlat/move_pages_flags.h xlat/mremap_flags.h xlat/msg_flags.h xlat/msgctl_flags.h xlat/msgflags.h xlat/mtd_flags_options.h xlat/mtd_mode_options.h xlat/mtd_nandecc_options.h xlat/mtd_otp_options.h xlat/mtd_type_options.h xlat/netlink_protocols.h xlat/notifyflags.h xlat/nt_descriptor_types.h xlat/open_access_modes.h xlat/open_mode_flags.h xlat/openmodessol.h xlat/perf_event_open_flags.h xlat/personality_options.h xlat/pmsgflags.h xlat/policies.h xlat/pollflags.h xlat/prctl_options.h xlat/priorities.h xlat/ptp_flags_options.h xlat/ptrace_cmds.h xlat/ptrace_setoptions_flags.h xlat/qm_which.h xlat/quota_formats.h xlat/quotacmds.h xlat/quotatypes.h xlat/rename_flags.h xlat/resource_flags.h xlat/resources.h xlat/schedulers.h xlat/scmvals.h xlat/semctl_flags.h xlat/semop_flags.h xlat/sg_io_dxfer_direction.h xlat/shm_flags.h xlat/shm_resource_flags.h xlat/shmctl_flags.h xlat/shutdown_modes.h xlat/sigact_flags.h xlat/sigaltstack_flags.h xlat/sigbus_codes.h xlat/sigchld_codes.h xlat/sigemt_codes.h xlat/sigev_value.h xlat/sigfpe_codes.h xlat/sigill_codes.h xlat/siginfo_codes.h xlat/sigpoll_codes.h xlat/sigprocmaskcmds.h xlat/sigprof_codes.h xlat/sigsegv_codes.h xlat/sigsys_codes.h xlat/sigtrap_codes.h xlat/sock_type_flags.h xlat/socketlayers.h xlat/sockipoptions.h xlat/sockipv6options.h xlat/sockipxoptions.h xlat/sockoptions.h xlat/sockpacketoptions.h xlat/sockrawoptions.h xlat/socksctpoptions.h xlat/socktcpoptions.h xlat/socktypes.h xlat/splice_flags.h xlat/sram_alloc_flags.h xlat/swap_flags.h xlat/sync_file_range_flags.h xlat/sysctl_kern.h xlat/sysctl_net.h xlat/sysctl_net_core.h xlat/sysctl_net_ipv4.h xlat/sysctl_net_ipv4_conf.h xlat/sysctl_net_ipv4_route.h xlat/sysctl_net_ipv6.h xlat/sysctl_net_ipv6_route.h xlat/sysctl_net_unix.h xlat/sysctl_root.h xlat/sysctl_vm.h xlat/syslog_action_type.h xlat/sysmips_operations.h xlat/tcflsh_options.h xlat/tcxonc_options.h xlat/timerfdflags.h xlat/ubi_volume_props.h xlat/ubi_volume_types.h xlat/umount_flags.h xlat/usagewho.h xlat/wait4_options.h xlat/waitid_types.h xlat/whence_codes.h xlat/xattrflags.h xlat/xfs_dqblk_flags.h xlat/xfs_quota_flags.h +XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclipc.in xlat/addrfams.in xlat/adjtimex_modes.in xlat/adjtimex_state.in xlat/adjtimex_status.in xlat/advise.in xlat/af_packet_types.in xlat/archvals.in xlat/arp_hardware_types.in xlat/at_flags.in xlat/atomic_ops.in xlat/audit_arch.in xlat/baud_options.in xlat/blkpg_ops.in xlat/bootflags1.in xlat/bootflags2.in xlat/bootflags3.in xlat/bpf_attach_type.in xlat/bpf_class.in xlat/bpf_commands.in xlat/bpf_map_types.in xlat/bpf_map_update_elem_flags.in xlat/bpf_miscop.in xlat/bpf_mode.in xlat/bpf_op_alu.in xlat/bpf_op_jmp.in xlat/bpf_prog_types.in xlat/bpf_rval.in xlat/bpf_size.in xlat/bpf_src.in xlat/bsg_flags.in xlat/bsg_protocol.in xlat/bsg_subprotocol.in xlat/bt_protocols.in xlat/btrfs_balance_args.in xlat/btrfs_balance_ctl_cmds.in xlat/btrfs_balance_flags.in xlat/btrfs_balance_state.in xlat/btrfs_compress_types.in xlat/btrfs_defrag_flags.in xlat/btrfs_dev_replace_cmds.in xlat/btrfs_dev_replace_results.in xlat/btrfs_dev_replace_state.in xlat/btrfs_dev_stats_flags.in xlat/btrfs_dev_stats_values.in xlat/btrfs_features_compat.in xlat/btrfs_features_compat_ro.in xlat/btrfs_features_incompat.in xlat/btrfs_key_types.in xlat/btrfs_qgroup_ctl_cmds.in xlat/btrfs_qgroup_inherit_flags.in xlat/btrfs_qgroup_limit_flags.in xlat/btrfs_qgroup_status_flags.in xlat/btrfs_scrub_flags.in xlat/btrfs_send_flags.in xlat/btrfs_snap_flags_v2.in xlat/btrfs_space_info_flags.in xlat/btrfs_tree_objectids.in xlat/cacheflush_scope.in xlat/cap.in xlat/cap_mask0.in xlat/cap_mask1.in xlat/cap_version.in xlat/clockflags.in xlat/clocknames.in xlat/clone_flags.in xlat/cpuclocknames.in xlat/delete_module_flags.in xlat/dirent_types.in xlat/dm_flags.in xlat/efd_flags.in xlat/epollctls.in xlat/epollevents.in xlat/epollflags.in xlat/ethernet_protocols.in xlat/evdev_abs.in xlat/evdev_autorepeat.in xlat/evdev_ev.in xlat/evdev_ff_status.in xlat/evdev_ff_types.in xlat/evdev_keycode.in xlat/evdev_leds.in xlat/evdev_misc.in xlat/evdev_mtslots.in xlat/evdev_prop.in xlat/evdev_relative_axes.in xlat/evdev_snd.in xlat/evdev_switch.in xlat/evdev_sync.in xlat/f_owner_types.in xlat/f_seals.in xlat/falloc_flags.in xlat/fan_classes.in xlat/fan_event_flags.in xlat/fan_init_flags.in xlat/fan_mark_flags.in xlat/fcntl64cmds.in xlat/fcntlcmds.in xlat/fdflags.in xlat/fiemap_extent_flags.in xlat/fiemap_flags.in xlat/flockcmds.in xlat/fsmagic.in xlat/futexops.in xlat/futexwakecmps.in xlat/futexwakeops.in xlat/getrandom_flags.in xlat/getsockipoptions.in xlat/getsockipv6options.in xlat/hci_channels.in xlat/hw_breakpoint_len.in xlat/hw_breakpoint_type.in xlat/icmpfilterflags.in xlat/if_dqblk_valid.in xlat/if_dqinfo_flags.in xlat/if_dqinfo_valid.in xlat/iffflags.in xlat/inet_protocols.in xlat/inotify_flags.in xlat/inotify_init_flags.in xlat/ioctl_dirs.in xlat/ioprio_class.in xlat/ioprio_who.in xlat/ip_cmsg_types.in xlat/ipc_msg_flags.in xlat/ipccalls.in xlat/itimer_which.in xlat/kcmp_types.in xlat/kexec_arch_values.in xlat/kexec_file_load_flags.in xlat/kexec_load_flags.in xlat/key_perms.in xlat/key_reqkeys.in xlat/key_spec.in xlat/keyctl_commands.in xlat/lockfcmds.in xlat/loop_cmds.in xlat/loop_crypt_type_options.in xlat/loop_flags_options.in xlat/madvise_cmds.in xlat/mbindflags.in xlat/mctl_sync.in xlat/membarrier_cmds.in xlat/memfd_create_flags.in xlat/mempolicyflags.in xlat/mlock_flags.in xlat/mlockall_flags.in xlat/mmap_flags.in xlat/mmap_prot.in xlat/modem_flags.in xlat/modetypes.in xlat/module_init_flags.in xlat/mount_flags.in xlat/move_pages_flags.in xlat/mq_attr_flags.in xlat/mremap_flags.in xlat/msg_flags.in xlat/msgctl_flags.in xlat/mtd_file_mode_options.in xlat/mtd_flags_options.in xlat/mtd_mode_options.in xlat/mtd_nandecc_options.in xlat/mtd_otp_options.in xlat/mtd_type_options.in xlat/name_to_handle_at_flags.in xlat/netlink_flags.in xlat/netlink_protocols.in xlat/netlink_types.in xlat/notifyflags.in xlat/nt_descriptor_types.in xlat/open_access_modes.in xlat/open_mode_flags.in xlat/openmodessol.in xlat/packet_mreq_type.in xlat/perf_attr_size.in xlat/perf_branch_sample_type.in xlat/perf_event_open_flags.in xlat/perf_event_read_format.in xlat/perf_event_sample_format.in xlat/perf_hw_cache_id.in xlat/perf_hw_cache_op_id.in xlat/perf_hw_cache_op_result_id.in xlat/perf_hw_id.in xlat/perf_sw_ids.in xlat/perf_type_id.in xlat/personality_flags.in xlat/personality_types.in xlat/pkey_access.in xlat/policies.in xlat/pollflags.in xlat/pr_cap_ambient.in xlat/pr_dumpable.in xlat/pr_fp_mode.in xlat/pr_mce_kill.in xlat/pr_mce_kill_policy.in xlat/pr_set_mm.in xlat/pr_tsc.in xlat/pr_unalign_flags.in xlat/prctl_options.in xlat/priorities.in xlat/ptp_flags_options.in xlat/ptrace_cmds.in xlat/ptrace_events.in xlat/ptrace_peeksiginfo_flags.in xlat/ptrace_setoptions_flags.in xlat/quota_formats.in xlat/quotacmds.in xlat/quotatypes.in xlat/rename_flags.in xlat/resource_flags.in xlat/resources.in xlat/rwf_flags.in xlat/sa_handler_values.in xlat/sched_flags.in xlat/schedulers.in xlat/scmvals.in xlat/scsi_sg_commands.in xlat/secbits.in xlat/seccomp_filter_flags.in xlat/seccomp_mode.in xlat/seccomp_ops.in xlat/seccomp_ret_action.in xlat/semctl_flags.in xlat/semop_flags.in xlat/setns_types.in xlat/setsockipoptions.in xlat/setsockipv6options.in xlat/sfd_flags.in xlat/sg_io_dxfer_direction.in xlat/sg_io_flags.in xlat/sg_io_info.in xlat/sg_scsi_reset.in xlat/shm_flags.in xlat/shm_resource_flags.in xlat/shmctl_flags.in xlat/shutdown_modes.in xlat/sigact_flags.in xlat/sigaltstack_flags.in xlat/sigbus_codes.in xlat/sigchld_codes.in xlat/sigemt_codes.in xlat/sigev_value.in xlat/sigfpe_codes.in xlat/sigill_codes.in xlat/siginfo_codes.in xlat/sigpoll_codes.in xlat/sigprocmaskcmds.in xlat/sigprof_codes.in xlat/sigsegv_codes.in xlat/sigsys_codes.in xlat/sigtrap_codes.in xlat/sock_type_flags.in xlat/socketcalls.in xlat/socketlayers.in xlat/sockipoptions.in xlat/sockipv6options.in xlat/sockipxoptions.in xlat/sockoptions.in xlat/sockpacketoptions.in xlat/sockrawoptions.in xlat/socksctpoptions.in xlat/socktcpoptions.in xlat/socktypes.in xlat/splice_flags.in xlat/sram_alloc_flags.in xlat/statfs_flags.in xlat/swap_flags.in xlat/sync_file_range_flags.in xlat/sysctl_kern.in xlat/sysctl_net.in xlat/sysctl_net_core.in xlat/sysctl_net_ipv4.in xlat/sysctl_net_ipv4_conf.in xlat/sysctl_net_ipv4_route.in xlat/sysctl_net_ipv6.in xlat/sysctl_net_ipv6_route.in xlat/sysctl_net_unix.in xlat/sysctl_root.in xlat/sysctl_vm.in xlat/syslog_action_type.in xlat/sysmips_operations.in xlat/tcflsh_options.in xlat/tcxonc_options.in xlat/timerfdflags.in xlat/ubi_volume_props.in xlat/ubi_volume_types.in xlat/uffd_api_flags.in xlat/uffd_copy_flags.in xlat/uffd_flags.in xlat/uffd_register_ioctl_flags.in xlat/uffd_register_mode_flags.in xlat/uffd_zeropage_flags.in xlat/umount_flags.in xlat/unshare_flags.in xlat/usagewho.in xlat/v4l2_buf_flags.in xlat/v4l2_buf_types.in xlat/v4l2_capture_modes.in xlat/v4l2_colorspaces.in xlat/v4l2_control_classes.in xlat/v4l2_control_flags.in xlat/v4l2_control_ids.in xlat/v4l2_control_types.in xlat/v4l2_device_capabilities_flags.in xlat/v4l2_fields.in xlat/v4l2_format_description_flags.in xlat/v4l2_frameinterval_types.in xlat/v4l2_framesize_types.in xlat/v4l2_input_types.in xlat/v4l2_memories.in xlat/v4l2_streaming_capabilities.in xlat/wait4_options.in xlat/waitid_types.in xlat/whence_codes.in xlat/xattrflags.in xlat/xfs_dqblk_flags.in xlat/xfs_quota_flags.in +XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclipc.h xlat/addrfams.h xlat/adjtimex_modes.h xlat/adjtimex_state.h xlat/adjtimex_status.h xlat/advise.h xlat/af_packet_types.h xlat/archvals.h xlat/arp_hardware_types.h xlat/at_flags.h xlat/atomic_ops.h xlat/audit_arch.h xlat/baud_options.h xlat/blkpg_ops.h xlat/bootflags1.h xlat/bootflags2.h xlat/bootflags3.h xlat/bpf_attach_type.h xlat/bpf_class.h xlat/bpf_commands.h xlat/bpf_map_types.h xlat/bpf_map_update_elem_flags.h xlat/bpf_miscop.h xlat/bpf_mode.h xlat/bpf_op_alu.h xlat/bpf_op_jmp.h xlat/bpf_prog_types.h xlat/bpf_rval.h xlat/bpf_size.h xlat/bpf_src.h xlat/bsg_flags.h xlat/bsg_protocol.h xlat/bsg_subprotocol.h xlat/bt_protocols.h xlat/btrfs_balance_args.h xlat/btrfs_balance_ctl_cmds.h xlat/btrfs_balance_flags.h xlat/btrfs_balance_state.h xlat/btrfs_compress_types.h xlat/btrfs_defrag_flags.h xlat/btrfs_dev_replace_cmds.h xlat/btrfs_dev_replace_results.h xlat/btrfs_dev_replace_state.h xlat/btrfs_dev_stats_flags.h xlat/btrfs_dev_stats_values.h xlat/btrfs_features_compat.h xlat/btrfs_features_compat_ro.h xlat/btrfs_features_incompat.h xlat/btrfs_key_types.h xlat/btrfs_qgroup_ctl_cmds.h xlat/btrfs_qgroup_inherit_flags.h xlat/btrfs_qgroup_limit_flags.h xlat/btrfs_qgroup_status_flags.h xlat/btrfs_scrub_flags.h xlat/btrfs_send_flags.h xlat/btrfs_snap_flags_v2.h xlat/btrfs_space_info_flags.h xlat/btrfs_tree_objectids.h xlat/cacheflush_scope.h xlat/cap.h xlat/cap_mask0.h xlat/cap_mask1.h xlat/cap_version.h xlat/clockflags.h xlat/clocknames.h xlat/clone_flags.h xlat/cpuclocknames.h xlat/delete_module_flags.h xlat/dirent_types.h xlat/dm_flags.h xlat/efd_flags.h xlat/epollctls.h xlat/epollevents.h xlat/epollflags.h xlat/ethernet_protocols.h xlat/evdev_abs.h xlat/evdev_autorepeat.h xlat/evdev_ev.h xlat/evdev_ff_status.h xlat/evdev_ff_types.h xlat/evdev_keycode.h xlat/evdev_leds.h xlat/evdev_misc.h xlat/evdev_mtslots.h xlat/evdev_prop.h xlat/evdev_relative_axes.h xlat/evdev_snd.h xlat/evdev_switch.h xlat/evdev_sync.h xlat/f_owner_types.h xlat/f_seals.h xlat/falloc_flags.h xlat/fan_classes.h xlat/fan_event_flags.h xlat/fan_init_flags.h xlat/fan_mark_flags.h xlat/fcntl64cmds.h xlat/fcntlcmds.h xlat/fdflags.h xlat/fiemap_extent_flags.h xlat/fiemap_flags.h xlat/flockcmds.h xlat/fsmagic.h xlat/futexops.h xlat/futexwakecmps.h xlat/futexwakeops.h xlat/getrandom_flags.h xlat/getsockipoptions.h xlat/getsockipv6options.h xlat/hci_channels.h xlat/hw_breakpoint_len.h xlat/hw_breakpoint_type.h xlat/icmpfilterflags.h xlat/if_dqblk_valid.h xlat/if_dqinfo_flags.h xlat/if_dqinfo_valid.h xlat/iffflags.h xlat/inet_protocols.h xlat/inotify_flags.h xlat/inotify_init_flags.h xlat/ioctl_dirs.h xlat/ioprio_class.h xlat/ioprio_who.h xlat/ip_cmsg_types.h xlat/ipc_msg_flags.h xlat/ipccalls.h xlat/itimer_which.h xlat/kcmp_types.h xlat/kexec_arch_values.h xlat/kexec_file_load_flags.h xlat/kexec_load_flags.h xlat/key_perms.h xlat/key_reqkeys.h xlat/key_spec.h xlat/keyctl_commands.h xlat/lockfcmds.h xlat/loop_cmds.h xlat/loop_crypt_type_options.h xlat/loop_flags_options.h xlat/madvise_cmds.h xlat/mbindflags.h xlat/mctl_sync.h xlat/membarrier_cmds.h xlat/memfd_create_flags.h xlat/mempolicyflags.h xlat/mlock_flags.h xlat/mlockall_flags.h xlat/mmap_flags.h xlat/mmap_prot.h xlat/modem_flags.h xlat/modetypes.h xlat/module_init_flags.h xlat/mount_flags.h xlat/move_pages_flags.h xlat/mq_attr_flags.h xlat/mremap_flags.h xlat/msg_flags.h xlat/msgctl_flags.h xlat/mtd_file_mode_options.h xlat/mtd_flags_options.h xlat/mtd_mode_options.h xlat/mtd_nandecc_options.h xlat/mtd_otp_options.h xlat/mtd_type_options.h xlat/name_to_handle_at_flags.h xlat/netlink_flags.h xlat/netlink_protocols.h xlat/netlink_types.h xlat/notifyflags.h xlat/nt_descriptor_types.h xlat/open_access_modes.h xlat/open_mode_flags.h xlat/openmodessol.h xlat/packet_mreq_type.h xlat/perf_attr_size.h xlat/perf_branch_sample_type.h xlat/perf_event_open_flags.h xlat/perf_event_read_format.h xlat/perf_event_sample_format.h xlat/perf_hw_cache_id.h xlat/perf_hw_cache_op_id.h xlat/perf_hw_cache_op_result_id.h xlat/perf_hw_id.h xlat/perf_sw_ids.h xlat/perf_type_id.h xlat/personality_flags.h xlat/personality_types.h xlat/pkey_access.h xlat/policies.h xlat/pollflags.h xlat/pr_cap_ambient.h xlat/pr_dumpable.h xlat/pr_fp_mode.h xlat/pr_mce_kill.h xlat/pr_mce_kill_policy.h xlat/pr_set_mm.h xlat/pr_tsc.h xlat/pr_unalign_flags.h xlat/prctl_options.h xlat/priorities.h xlat/ptp_flags_options.h xlat/ptrace_cmds.h xlat/ptrace_events.h xlat/ptrace_peeksiginfo_flags.h xlat/ptrace_setoptions_flags.h xlat/quota_formats.h xlat/quotacmds.h xlat/quotatypes.h xlat/rename_flags.h xlat/resource_flags.h xlat/resources.h xlat/rwf_flags.h xlat/sa_handler_values.h xlat/sched_flags.h xlat/schedulers.h xlat/scmvals.h xlat/scsi_sg_commands.h xlat/secbits.h xlat/seccomp_filter_flags.h xlat/seccomp_mode.h xlat/seccomp_ops.h xlat/seccomp_ret_action.h xlat/semctl_flags.h xlat/semop_flags.h xlat/setns_types.h xlat/setsockipoptions.h xlat/setsockipv6options.h xlat/sfd_flags.h xlat/sg_io_dxfer_direction.h xlat/sg_io_flags.h xlat/sg_io_info.h xlat/sg_scsi_reset.h xlat/shm_flags.h xlat/shm_resource_flags.h xlat/shmctl_flags.h xlat/shutdown_modes.h xlat/sigact_flags.h xlat/sigaltstack_flags.h xlat/sigbus_codes.h xlat/sigchld_codes.h xlat/sigemt_codes.h xlat/sigev_value.h xlat/sigfpe_codes.h xlat/sigill_codes.h xlat/siginfo_codes.h xlat/sigpoll_codes.h xlat/sigprocmaskcmds.h xlat/sigprof_codes.h xlat/sigsegv_codes.h xlat/sigsys_codes.h xlat/sigtrap_codes.h xlat/sock_type_flags.h xlat/socketcalls.h xlat/socketlayers.h xlat/sockipoptions.h xlat/sockipv6options.h xlat/sockipxoptions.h xlat/sockoptions.h xlat/sockpacketoptions.h xlat/sockrawoptions.h xlat/socksctpoptions.h xlat/socktcpoptions.h xlat/socktypes.h xlat/splice_flags.h xlat/sram_alloc_flags.h xlat/statfs_flags.h xlat/swap_flags.h xlat/sync_file_range_flags.h xlat/sysctl_kern.h xlat/sysctl_net.h xlat/sysctl_net_core.h xlat/sysctl_net_ipv4.h xlat/sysctl_net_ipv4_conf.h xlat/sysctl_net_ipv4_route.h xlat/sysctl_net_ipv6.h xlat/sysctl_net_ipv6_route.h xlat/sysctl_net_unix.h xlat/sysctl_root.h xlat/sysctl_vm.h xlat/syslog_action_type.h xlat/sysmips_operations.h xlat/tcflsh_options.h xlat/tcxonc_options.h xlat/timerfdflags.h xlat/ubi_volume_props.h xlat/ubi_volume_types.h xlat/uffd_api_flags.h xlat/uffd_copy_flags.h xlat/uffd_flags.h xlat/uffd_register_ioctl_flags.h xlat/uffd_register_mode_flags.h xlat/uffd_zeropage_flags.h xlat/umount_flags.h xlat/unshare_flags.h xlat/usagewho.h xlat/v4l2_buf_flags.h xlat/v4l2_buf_types.h xlat/v4l2_capture_modes.h xlat/v4l2_colorspaces.h xlat/v4l2_control_classes.h xlat/v4l2_control_flags.h xlat/v4l2_control_ids.h xlat/v4l2_control_types.h xlat/v4l2_device_capabilities_flags.h xlat/v4l2_fields.h xlat/v4l2_format_description_flags.h xlat/v4l2_frameinterval_types.h xlat/v4l2_framesize_types.h xlat/v4l2_input_types.h xlat/v4l2_memories.h xlat/v4l2_streaming_capabilities.h xlat/wait4_options.h xlat/waitid_types.h xlat/whence_codes.h xlat/xattrflags.h xlat/xfs_dqblk_flags.h xlat/xfs_quota_flags.h $(top_srcdir)/xlat/access_flags.h: $(top_srcdir)/xlat/access_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/aclcmds.h: $(top_srcdir)/xlat/aclcmds.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/aclipc.h: $(top_srcdir)/xlat/aclipc.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/addrfams.h: $(top_srcdir)/xlat/addrfams.in $(top_srcdir)/xlat/gen.sh @@ -20,10 +18,14 @@ $(top_srcdir)/xlat/af_packet_types.h: $(top_srcdir)/xlat/af_packet_types.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/archvals.h: $(top_srcdir)/xlat/archvals.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/arp_hardware_types.h: $(top_srcdir)/xlat/arp_hardware_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/at_flags.h: $(top_srcdir)/xlat/at_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/atomic_ops.h: $(top_srcdir)/xlat/atomic_ops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/audit_arch.h: $(top_srcdir)/xlat/audit_arch.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/baud_options.h: $(top_srcdir)/xlat/baud_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/blkpg_ops.h: $(top_srcdir)/xlat/blkpg_ops.in $(top_srcdir)/xlat/gen.sh @@ -34,11 +36,97 @@ $(top_srcdir)/xlat/bootflags2.h: $(top_srcdir)/xlat/bootflags2.in $(top_srcdir)/ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags3.h: $(top_srcdir)/xlat/bootflags3.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_attach_type.h: $(top_srcdir)/xlat/bpf_attach_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_class.h: $(top_srcdir)/xlat/bpf_class.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_commands.h: $(top_srcdir)/xlat/bpf_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_map_types.h: $(top_srcdir)/xlat/bpf_map_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_map_update_elem_flags.h: $(top_srcdir)/xlat/bpf_map_update_elem_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_miscop.h: $(top_srcdir)/xlat/bpf_miscop.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_mode.h: $(top_srcdir)/xlat/bpf_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_op_alu.h: $(top_srcdir)/xlat/bpf_op_alu.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_op_jmp.h: $(top_srcdir)/xlat/bpf_op_jmp.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_prog_types.h: $(top_srcdir)/xlat/bpf_prog_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_rval.h: $(top_srcdir)/xlat/bpf_rval.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_size.h: $(top_srcdir)/xlat/bpf_size.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_src.h: $(top_srcdir)/xlat/bpf_src.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bsg_flags.h: $(top_srcdir)/xlat/bsg_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bsg_protocol.h: $(top_srcdir)/xlat/bsg_protocol.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bsg_subprotocol.h: $(top_srcdir)/xlat/bsg_subprotocol.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bt_protocols.h: $(top_srcdir)/xlat/bt_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_args.h: $(top_srcdir)/xlat/btrfs_balance_args.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_ctl_cmds.h: $(top_srcdir)/xlat/btrfs_balance_ctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_flags.h: $(top_srcdir)/xlat/btrfs_balance_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_balance_state.h: $(top_srcdir)/xlat/btrfs_balance_state.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_compress_types.h: $(top_srcdir)/xlat/btrfs_compress_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_defrag_flags.h: $(top_srcdir)/xlat/btrfs_defrag_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_replace_cmds.h: $(top_srcdir)/xlat/btrfs_dev_replace_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_replace_results.h: $(top_srcdir)/xlat/btrfs_dev_replace_results.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_replace_state.h: $(top_srcdir)/xlat/btrfs_dev_replace_state.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_stats_flags.h: $(top_srcdir)/xlat/btrfs_dev_stats_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_dev_stats_values.h: $(top_srcdir)/xlat/btrfs_dev_stats_values.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_features_compat.h: $(top_srcdir)/xlat/btrfs_features_compat.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_features_compat_ro.h: $(top_srcdir)/xlat/btrfs_features_compat_ro.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_features_incompat.h: $(top_srcdir)/xlat/btrfs_features_incompat.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_key_types.h: $(top_srcdir)/xlat/btrfs_key_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.h: $(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_limit_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_limit_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_qgroup_status_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_status_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_scrub_flags.h: $(top_srcdir)/xlat/btrfs_scrub_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_send_flags.h: $(top_srcdir)/xlat/btrfs_send_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_snap_flags_v2.h: $(top_srcdir)/xlat/btrfs_snap_flags_v2.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_space_info_flags.h: $(top_srcdir)/xlat/btrfs_space_info_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_tree_objectids.h: $(top_srcdir)/xlat/btrfs_tree_objectids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cacheflush_scope.h: $(top_srcdir)/xlat/cacheflush_scope.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/cap_version.h: $(top_srcdir)/xlat/cap_version.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/cap.h: $(top_srcdir)/xlat/cap.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/cap_mask0.h: $(top_srcdir)/xlat/cap_mask0.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/capabilities.h: $(top_srcdir)/xlat/capabilities.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/cap_mask1.h: $(top_srcdir)/xlat/cap_mask1.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/cap_version.h: $(top_srcdir)/xlat/cap_version.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/clockflags.h: $(top_srcdir)/xlat/clockflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -50,9 +138,11 @@ $(top_srcdir)/xlat/cpuclocknames.h: $(top_srcdir)/xlat/cpuclocknames.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/delete_module_flags.h: $(top_srcdir)/xlat/delete_module_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/direnttypes.h: $(top_srcdir)/xlat/direnttypes.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/dirent_types.h: $(top_srcdir)/xlat/dirent_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/dm_flags.h: $(top_srcdir)/xlat/dm_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/domains.h: $(top_srcdir)/xlat/domains.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/efd_flags.h: $(top_srcdir)/xlat/efd_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/epollctls.h: $(top_srcdir)/xlat/epollctls.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -60,6 +150,42 @@ $(top_srcdir)/xlat/epollevents.h: $(top_srcdir)/xlat/epollevents.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/epollflags.h: $(top_srcdir)/xlat/epollflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ethernet_protocols.h: $(top_srcdir)/xlat/ethernet_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_abs.h: $(top_srcdir)/xlat/evdev_abs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_autorepeat.h: $(top_srcdir)/xlat/evdev_autorepeat.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_ev.h: $(top_srcdir)/xlat/evdev_ev.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_ff_status.h: $(top_srcdir)/xlat/evdev_ff_status.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_ff_types.h: $(top_srcdir)/xlat/evdev_ff_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_keycode.h: $(top_srcdir)/xlat/evdev_keycode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_leds.h: $(top_srcdir)/xlat/evdev_leds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_misc.h: $(top_srcdir)/xlat/evdev_misc.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_mtslots.h: $(top_srcdir)/xlat/evdev_mtslots.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_prop.h: $(top_srcdir)/xlat/evdev_prop.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_relative_axes.h: $(top_srcdir)/xlat/evdev_relative_axes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_snd.h: $(top_srcdir)/xlat/evdev_snd.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_switch.h: $(top_srcdir)/xlat/evdev_switch.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/evdev_sync.h: $(top_srcdir)/xlat/evdev_sync.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/f_owner_types.h: $(top_srcdir)/xlat/f_owner_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/f_seals.h: $(top_srcdir)/xlat/f_seals.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/falloc_flags.h: $(top_srcdir)/xlat/falloc_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_classes.h: $(top_srcdir)/xlat/fan_classes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_event_flags.h: $(top_srcdir)/xlat/fan_event_flags.in $(top_srcdir)/xlat/gen.sh @@ -68,11 +194,15 @@ $(top_srcdir)/xlat/fan_init_flags.h: $(top_srcdir)/xlat/fan_init_flags.in $(top_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_mark_flags.h: $(top_srcdir)/xlat/fan_mark_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fcntl64cmds.h: $(top_srcdir)/xlat/fcntl64cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fcntlcmds.h: $(top_srcdir)/xlat/fcntlcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fdflags.h: $(top_srcdir)/xlat/fdflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/fileflags.h: $(top_srcdir)/xlat/fileflags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/fiemap_extent_flags.h: $(top_srcdir)/xlat/fiemap_extent_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fiemap_flags.h: $(top_srcdir)/xlat/fiemap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/flockcmds.h: $(top_srcdir)/xlat/flockcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -84,10 +214,24 @@ $(top_srcdir)/xlat/futexwakecmps.h: $(top_srcdir)/xlat/futexwakecmps.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/futexwakeops.h: $(top_srcdir)/xlat/futexwakeops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getrandom_flags.h: $(top_srcdir)/xlat/getrandom_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getsockipoptions.h: $(top_srcdir)/xlat/getsockipoptions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getsockipv6options.h: $(top_srcdir)/xlat/getsockipv6options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/hci_channels.h: $(top_srcdir)/xlat/hci_channels.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/hw_breakpoint_len.h: $(top_srcdir)/xlat/hw_breakpoint_len.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/hw_breakpoint_type.h: $(top_srcdir)/xlat/hw_breakpoint_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/icmpfilterflags.h: $(top_srcdir)/xlat/icmpfilterflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/if_dqblk_valid.h: $(top_srcdir)/xlat/if_dqblk_valid.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/if_dqinfo_flags.h: $(top_srcdir)/xlat/if_dqinfo_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/if_dqinfo_valid.h: $(top_srcdir)/xlat/if_dqinfo_valid.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/iffflags.h: $(top_srcdir)/xlat/iffflags.in $(top_srcdir)/xlat/gen.sh @@ -98,17 +242,27 @@ $(top_srcdir)/xlat/inotify_flags.h: $(top_srcdir)/xlat/inotify_flags.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/inotify_init_flags.h: $(top_srcdir)/xlat/inotify_init_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ioctl_dirs.h: $(top_srcdir)/xlat/ioctl_dirs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ioprio_class.h: $(top_srcdir)/xlat/ioprio_class.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ioprio_who.h: $(top_srcdir)/xlat/ioprio_who.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ip_cmsg_types.h: $(top_srcdir)/xlat/ip_cmsg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ipc_msg_flags.h: $(top_srcdir)/xlat/ipc_msg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ipccalls.h: $(top_srcdir)/xlat/ipccalls.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/itimer_which.h: $(top_srcdir)/xlat/itimer_which.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kcmp_types.h: $(top_srcdir)/xlat/kcmp_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/kexec_arch_values.h: $(top_srcdir)/xlat/kexec_arch_values.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/kexec_flags.h: $(top_srcdir)/xlat/kexec_flags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/kexec_file_load_flags.h: $(top_srcdir)/xlat/kexec_file_load_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kexec_load_flags.h: $(top_srcdir)/xlat/kexec_load_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/key_perms.h: $(top_srcdir)/xlat/key_perms.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -120,6 +274,8 @@ $(top_srcdir)/xlat/keyctl_commands.h: $(top_srcdir)/xlat/keyctl_commands.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/lockfcmds.h: $(top_srcdir)/xlat/lockfcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/loop_cmds.h: $(top_srcdir)/xlat/loop_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_crypt_type_options.h: $(top_srcdir)/xlat/loop_crypt_type_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_flags_options.h: $(top_srcdir)/xlat/loop_flags_options.in $(top_srcdir)/xlat/gen.sh @@ -128,14 +284,16 @@ $(top_srcdir)/xlat/madvise_cmds.h: $(top_srcdir)/xlat/madvise_cmds.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mbindflags.h: $(top_srcdir)/xlat/mbindflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/mctl_funcs.h: $(top_srcdir)/xlat/mctl_funcs.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/mctl_sync.h: $(top_srcdir)/xlat/mctl_sync.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/mctl_lockas.h: $(top_srcdir)/xlat/mctl_lockas.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/membarrier_cmds.h: $(top_srcdir)/xlat/membarrier_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/mctl_sync.h: $(top_srcdir)/xlat/mctl_sync.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/memfd_create_flags.h: $(top_srcdir)/xlat/memfd_create_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mempolicyflags.h: $(top_srcdir)/xlat/mempolicyflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mlock_flags.h: $(top_srcdir)/xlat/mlock_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mlockall_flags.h: $(top_srcdir)/xlat/mlockall_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mmap_flags.h: $(top_srcdir)/xlat/mmap_flags.in $(top_srcdir)/xlat/gen.sh @@ -146,21 +304,21 @@ $(top_srcdir)/xlat/modem_flags.h: $(top_srcdir)/xlat/modem_flags.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/modetypes.h: $(top_srcdir)/xlat/modetypes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/modflags.h: $(top_srcdir)/xlat/modflags.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/module_init_flags.h: $(top_srcdir)/xlat/module_init_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mount_flags.h: $(top_srcdir)/xlat/mount_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/move_pages_flags.h: $(top_srcdir)/xlat/move_pages_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mq_attr_flags.h: $(top_srcdir)/xlat/mq_attr_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mremap_flags.h: $(top_srcdir)/xlat/mremap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/msg_flags.h: $(top_srcdir)/xlat/msg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/msgctl_flags.h: $(top_srcdir)/xlat/msgctl_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/msgflags.h: $(top_srcdir)/xlat/msgflags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/mtd_file_mode_options.h: $(top_srcdir)/xlat/mtd_file_mode_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mtd_flags_options.h: $(top_srcdir)/xlat/mtd_flags_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -172,8 +330,14 @@ $(top_srcdir)/xlat/mtd_otp_options.h: $(top_srcdir)/xlat/mtd_otp_options.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mtd_type_options.h: $(top_srcdir)/xlat/mtd_type_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/name_to_handle_at_flags.h: $(top_srcdir)/xlat/name_to_handle_at_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_flags.h: $(top_srcdir)/xlat/netlink_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_protocols.h: $(top_srcdir)/xlat/netlink_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_types.h: $(top_srcdir)/xlat/netlink_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/notifyflags.h: $(top_srcdir)/xlat/notifyflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/nt_descriptor_types.h: $(top_srcdir)/xlat/nt_descriptor_types.in $(top_srcdir)/xlat/gen.sh @@ -184,16 +348,56 @@ $(top_srcdir)/xlat/open_mode_flags.h: $(top_srcdir)/xlat/open_mode_flags.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/openmodessol.h: $(top_srcdir)/xlat/openmodessol.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/packet_mreq_type.h: $(top_srcdir)/xlat/packet_mreq_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_attr_size.h: $(top_srcdir)/xlat/perf_attr_size.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_branch_sample_type.h: $(top_srcdir)/xlat/perf_branch_sample_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_event_open_flags.h: $(top_srcdir)/xlat/perf_event_open_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/personality_options.h: $(top_srcdir)/xlat/personality_options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/perf_event_read_format.h: $(top_srcdir)/xlat/perf_event_read_format.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_event_sample_format.h: $(top_srcdir)/xlat/perf_event_sample_format.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_hw_cache_id.h: $(top_srcdir)/xlat/perf_hw_cache_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_hw_cache_op_id.h: $(top_srcdir)/xlat/perf_hw_cache_op_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_hw_cache_op_result_id.h: $(top_srcdir)/xlat/perf_hw_cache_op_result_id.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/pmsgflags.h: $(top_srcdir)/xlat/pmsgflags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/perf_hw_id.h: $(top_srcdir)/xlat/perf_hw_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_sw_ids.h: $(top_srcdir)/xlat/perf_sw_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_type_id.h: $(top_srcdir)/xlat/perf_type_id.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/personality_flags.h: $(top_srcdir)/xlat/personality_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/personality_types.h: $(top_srcdir)/xlat/personality_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pkey_access.h: $(top_srcdir)/xlat/pkey_access.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/policies.h: $(top_srcdir)/xlat/policies.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pollflags.h: $(top_srcdir)/xlat/pollflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_cap_ambient.h: $(top_srcdir)/xlat/pr_cap_ambient.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_dumpable.h: $(top_srcdir)/xlat/pr_dumpable.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_fp_mode.h: $(top_srcdir)/xlat/pr_fp_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_mce_kill.h: $(top_srcdir)/xlat/pr_mce_kill.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_mce_kill_policy.h: $(top_srcdir)/xlat/pr_mce_kill_policy.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_set_mm.h: $(top_srcdir)/xlat/pr_set_mm.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_tsc.h: $(top_srcdir)/xlat/pr_tsc.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_unalign_flags.h: $(top_srcdir)/xlat/pr_unalign_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/prctl_options.h: $(top_srcdir)/xlat/prctl_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/priorities.h: $(top_srcdir)/xlat/priorities.in $(top_srcdir)/xlat/gen.sh @@ -202,9 +406,11 @@ $(top_srcdir)/xlat/ptp_flags_options.h: $(top_srcdir)/xlat/ptp_flags_options.in $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ptrace_cmds.h: $(top_srcdir)/xlat/ptrace_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/ptrace_setoptions_flags.h: $(top_srcdir)/xlat/ptrace_setoptions_flags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/ptrace_events.h: $(top_srcdir)/xlat/ptrace_events.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/qm_which.h: $(top_srcdir)/xlat/qm_which.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/ptrace_peeksiginfo_flags.h: $(top_srcdir)/xlat/ptrace_peeksiginfo_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ptrace_setoptions_flags.h: $(top_srcdir)/xlat/ptrace_setoptions_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quota_formats.h: $(top_srcdir)/xlat/quota_formats.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -218,16 +424,48 @@ $(top_srcdir)/xlat/resource_flags.h: $(top_srcdir)/xlat/resource_flags.in $(top_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/resources.h: $(top_srcdir)/xlat/resources.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rwf_flags.h: $(top_srcdir)/xlat/rwf_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sa_handler_values.h: $(top_srcdir)/xlat/sa_handler_values.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sched_flags.h: $(top_srcdir)/xlat/sched_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/schedulers.h: $(top_srcdir)/xlat/schedulers.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/scmvals.h: $(top_srcdir)/xlat/scmvals.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/scsi_sg_commands.h: $(top_srcdir)/xlat/scsi_sg_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/secbits.h: $(top_srcdir)/xlat/secbits.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_filter_flags.h: $(top_srcdir)/xlat/seccomp_filter_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_mode.h: $(top_srcdir)/xlat/seccomp_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_ops.h: $(top_srcdir)/xlat/seccomp_ops.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/seccomp_ret_action.h: $(top_srcdir)/xlat/seccomp_ret_action.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/semctl_flags.h: $(top_srcdir)/xlat/semctl_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/semop_flags.h: $(top_srcdir)/xlat/semop_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setns_types.h: $(top_srcdir)/xlat/setns_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setsockipoptions.h: $(top_srcdir)/xlat/setsockipoptions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setsockipv6options.h: $(top_srcdir)/xlat/setsockipv6options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sfd_flags.h: $(top_srcdir)/xlat/sfd_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sg_io_dxfer_direction.h: $(top_srcdir)/xlat/sg_io_dxfer_direction.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sg_io_flags.h: $(top_srcdir)/xlat/sg_io_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sg_io_info.h: $(top_srcdir)/xlat/sg_io_info.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sg_scsi_reset.h: $(top_srcdir)/xlat/sg_scsi_reset.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/shm_flags.h: $(top_srcdir)/xlat/shm_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/shm_resource_flags.h: $(top_srcdir)/xlat/shm_resource_flags.in $(top_srcdir)/xlat/gen.sh @@ -268,6 +506,8 @@ $(top_srcdir)/xlat/sigtrap_codes.h: $(top_srcdir)/xlat/sigtrap_codes.in $(top_sr $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sock_type_flags.h: $(top_srcdir)/xlat/sock_type_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/socketcalls.h: $(top_srcdir)/xlat/socketcalls.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/socketlayers.h: $(top_srcdir)/xlat/socketlayers.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sockipoptions.h: $(top_srcdir)/xlat/sockipoptions.in $(top_srcdir)/xlat/gen.sh @@ -292,6 +532,8 @@ $(top_srcdir)/xlat/splice_flags.h: $(top_srcdir)/xlat/splice_flags.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sram_alloc_flags.h: $(top_srcdir)/xlat/sram_alloc_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/statfs_flags.h: $(top_srcdir)/xlat/statfs_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/swap_flags.h: $(top_srcdir)/xlat/swap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sync_file_range_flags.h: $(top_srcdir)/xlat/sync_file_range_flags.in $(top_srcdir)/xlat/gen.sh @@ -332,10 +574,56 @@ $(top_srcdir)/xlat/ubi_volume_props.h: $(top_srcdir)/xlat/ubi_volume_props.in $( $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ubi_volume_types.h: $(top_srcdir)/xlat/ubi_volume_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_api_flags.h: $(top_srcdir)/xlat/uffd_api_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_copy_flags.h: $(top_srcdir)/xlat/uffd_copy_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_flags.h: $(top_srcdir)/xlat/uffd_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_register_ioctl_flags.h: $(top_srcdir)/xlat/uffd_register_ioctl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_register_mode_flags.h: $(top_srcdir)/xlat/uffd_register_mode_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_zeropage_flags.h: $(top_srcdir)/xlat/uffd_zeropage_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/umount_flags.h: $(top_srcdir)/xlat/umount_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/unshare_flags.h: $(top_srcdir)/xlat/unshare_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/usagewho.h: $(top_srcdir)/xlat/usagewho.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_buf_flags.h: $(top_srcdir)/xlat/v4l2_buf_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_buf_types.h: $(top_srcdir)/xlat/v4l2_buf_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_capture_modes.h: $(top_srcdir)/xlat/v4l2_capture_modes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_colorspaces.h: $(top_srcdir)/xlat/v4l2_colorspaces.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_classes.h: $(top_srcdir)/xlat/v4l2_control_classes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_flags.h: $(top_srcdir)/xlat/v4l2_control_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_ids.h: $(top_srcdir)/xlat/v4l2_control_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_types.h: $(top_srcdir)/xlat/v4l2_control_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_device_capabilities_flags.h: $(top_srcdir)/xlat/v4l2_device_capabilities_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_fields.h: $(top_srcdir)/xlat/v4l2_fields.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_format_description_flags.h: $(top_srcdir)/xlat/v4l2_format_description_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_frameinterval_types.h: $(top_srcdir)/xlat/v4l2_frameinterval_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_framesize_types.h: $(top_srcdir)/xlat/v4l2_framesize_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_input_types.h: $(top_srcdir)/xlat/v4l2_input_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_memories.h: $(top_srcdir)/xlat/v4l2_memories.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_streaming_capabilities.h: $(top_srcdir)/xlat/v4l2_streaming_capabilities.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/wait4_options.h: $(top_srcdir)/xlat/wait4_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/waitid_types.h: $(top_srcdir)/xlat/waitid_types.in $(top_srcdir)/xlat/gen.sh diff --git a/xlat/access_flags.h b/xlat/access_flags.h index afce1ef0..a30f082d 100644 --- a/xlat/access_flags.h +++ b/xlat/access_flags.h @@ -1,23 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/access_flags.in; do not edit. */ -static const struct xlat access_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat access_flags in mpers mode + +#else + +static +const struct xlat access_flags[] = { #if defined(F_OK) || (defined(HAVE_DECL_F_OK) && HAVE_DECL_F_OK) - XLAT(F_OK), + XLAT(F_OK), #endif #if defined(R_OK) || (defined(HAVE_DECL_R_OK) && HAVE_DECL_R_OK) - XLAT(R_OK), + XLAT(R_OK), #endif #if defined(W_OK) || (defined(HAVE_DECL_W_OK) && HAVE_DECL_W_OK) - XLAT(W_OK), + XLAT(W_OK), #endif #if defined(X_OK) || (defined(HAVE_DECL_X_OK) && HAVE_DECL_X_OK) - XLAT(X_OK), + XLAT(X_OK), #endif #if defined(EFF_ONLY_OK) || (defined(HAVE_DECL_EFF_ONLY_OK) && HAVE_DECL_EFF_ONLY_OK) - XLAT(EFF_ONLY_OK), + XLAT(EFF_ONLY_OK), #endif #if defined(EX_OK) || (defined(HAVE_DECL_EX_OK) && HAVE_DECL_EX_OK) - XLAT(EX_OK), + XLAT(EX_OK), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/aclcmds.h b/xlat/aclcmds.h deleted file mode 100644 index d12302ad..00000000 --- a/xlat/aclcmds.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/aclcmds.in; do not edit. */ - -static const struct xlat aclcmds[] = { -#if defined(SETACL) || (defined(HAVE_DECL_SETACL) && HAVE_DECL_SETACL) - XLAT(SETACL), -#endif -#if defined(GETACL) || (defined(HAVE_DECL_GETACL) && HAVE_DECL_GETACL) - XLAT(GETACL), -#endif -#if defined(GETACLCNT) || (defined(HAVE_DECL_GETACLCNT) && HAVE_DECL_GETACLCNT) - XLAT(GETACLCNT), -#endif -#if defined(ACL_GET) || (defined(HAVE_DECL_ACL_GET) && HAVE_DECL_ACL_GET) - XLAT(ACL_GET), -#endif -#if defined(ACL_SET) || (defined(HAVE_DECL_ACL_SET) && HAVE_DECL_ACL_SET) - XLAT(ACL_SET), -#endif -#if defined(ACL_CNT) || (defined(HAVE_DECL_ACL_CNT) && HAVE_DECL_ACL_CNT) - XLAT(ACL_CNT), -#endif - XLAT_END -}; diff --git a/xlat/aclcmds.in b/xlat/aclcmds.in deleted file mode 100644 index 87559c64..00000000 --- a/xlat/aclcmds.in +++ /dev/null @@ -1,6 +0,0 @@ -SETACL -GETACL -GETACLCNT -ACL_GET -ACL_SET -ACL_CNT diff --git a/xlat/aclipc.h b/xlat/aclipc.h index 82b79491..6dabb837 100644 --- a/xlat/aclipc.h +++ b/xlat/aclipc.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/aclipc.in; do not edit. */ -static const struct xlat aclipc[] = { +#ifdef IN_MPERS + +# error static const struct xlat aclipc in mpers mode + +#else + +static +const struct xlat aclipc[] = { #if defined(IPC_SHM) || (defined(HAVE_DECL_IPC_SHM) && HAVE_DECL_IPC_SHM) - XLAT(IPC_SHM), + XLAT(IPC_SHM), #endif #if defined(IPC_SEM) || (defined(HAVE_DECL_IPC_SEM) && HAVE_DECL_IPC_SEM) - XLAT(IPC_SEM), + XLAT(IPC_SEM), #endif #if defined(IPC_MSG) || (defined(HAVE_DECL_IPC_MSG) && HAVE_DECL_IPC_MSG) - XLAT(IPC_MSG), + XLAT(IPC_MSG), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/addrfams.h b/xlat/addrfams.h index c3489c59..fc437b29 100644 --- a/xlat/addrfams.h +++ b/xlat/addrfams.h @@ -1,128 +1,181 @@ /* Generated by ./xlat/gen.sh from ./xlat/addrfams.in; do not edit. */ - -const struct xlat addrfams[] = { -#if defined(AF_UNSPEC) || (defined(HAVE_DECL_AF_UNSPEC) && HAVE_DECL_AF_UNSPEC) - XLAT(AF_UNSPEC), +#if !(defined(AF_UNSPEC) || (defined(HAVE_DECL_AF_UNSPEC) && HAVE_DECL_AF_UNSPEC)) +# define AF_UNSPEC 0 +#endif +#if !(defined(AF_UNIX) || (defined(HAVE_DECL_AF_UNIX) && HAVE_DECL_AF_UNIX)) +# define AF_UNIX 1 +#endif +#if !(defined(AF_INET) || (defined(HAVE_DECL_AF_INET) && HAVE_DECL_AF_INET)) +# define AF_INET 2 #endif -#if defined(AF_LOCAL) || (defined(HAVE_DECL_AF_LOCAL) && HAVE_DECL_AF_LOCAL) - XLAT(AF_LOCAL), +#if !(defined(AF_AX25) || (defined(HAVE_DECL_AF_AX25) && HAVE_DECL_AF_AX25)) +# define AF_AX25 3 #endif -#if defined(AF_UNIX) || (defined(HAVE_DECL_AF_UNIX) && HAVE_DECL_AF_UNIX) - XLAT(AF_UNIX), +#if !(defined(AF_IPX) || (defined(HAVE_DECL_AF_IPX) && HAVE_DECL_AF_IPX)) +# define AF_IPX 4 #endif -#if defined(AF_INET) || (defined(HAVE_DECL_AF_INET) && HAVE_DECL_AF_INET) - XLAT(AF_INET), +#if !(defined(AF_APPLETALK) || (defined(HAVE_DECL_AF_APPLETALK) && HAVE_DECL_AF_APPLETALK)) +# define AF_APPLETALK 5 #endif -#if defined(AF_AX25) || (defined(HAVE_DECL_AF_AX25) && HAVE_DECL_AF_AX25) - XLAT(AF_AX25), +#if !(defined(AF_NETROM) || (defined(HAVE_DECL_AF_NETROM) && HAVE_DECL_AF_NETROM)) +# define AF_NETROM 6 #endif -#if defined(AF_IPX) || (defined(HAVE_DECL_AF_IPX) && HAVE_DECL_AF_IPX) - XLAT(AF_IPX), +#if !(defined(AF_BRIDGE) || (defined(HAVE_DECL_AF_BRIDGE) && HAVE_DECL_AF_BRIDGE)) +# define AF_BRIDGE 7 #endif -#if defined(AF_APPLETALK) || (defined(HAVE_DECL_AF_APPLETALK) && HAVE_DECL_AF_APPLETALK) - XLAT(AF_APPLETALK), +#if !(defined(AF_ATMPVC) || (defined(HAVE_DECL_AF_ATMPVC) && HAVE_DECL_AF_ATMPVC)) +# define AF_ATMPVC 8 #endif -#if defined(AF_NETROM) || (defined(HAVE_DECL_AF_NETROM) && HAVE_DECL_AF_NETROM) - XLAT(AF_NETROM), +#if !(defined(AF_X25) || (defined(HAVE_DECL_AF_X25) && HAVE_DECL_AF_X25)) +# define AF_X25 9 #endif -#if defined(AF_BRIDGE) || (defined(HAVE_DECL_AF_BRIDGE) && HAVE_DECL_AF_BRIDGE) - XLAT(AF_BRIDGE), +#if !(defined(AF_INET6) || (defined(HAVE_DECL_AF_INET6) && HAVE_DECL_AF_INET6)) +# define AF_INET6 10 #endif -#if defined(AF_ATMPVC) || (defined(HAVE_DECL_AF_ATMPVC) && HAVE_DECL_AF_ATMPVC) - XLAT(AF_ATMPVC), +#if !(defined(AF_ROSE) || (defined(HAVE_DECL_AF_ROSE) && HAVE_DECL_AF_ROSE)) +# define AF_ROSE 11 #endif -#if defined(AF_X25) || (defined(HAVE_DECL_AF_X25) && HAVE_DECL_AF_X25) - XLAT(AF_X25), +#if !(defined(AF_DECnet) || (defined(HAVE_DECL_AF_DECnet) && HAVE_DECL_AF_DECnet)) +# define AF_DECnet 12 #endif -#if defined(AF_INET6) || (defined(HAVE_DECL_AF_INET6) && HAVE_DECL_AF_INET6) - XLAT(AF_INET6), +#if !(defined(AF_NETBEUI) || (defined(HAVE_DECL_AF_NETBEUI) && HAVE_DECL_AF_NETBEUI)) +# define AF_NETBEUI 13 #endif -#if defined(AF_ROSE) || (defined(HAVE_DECL_AF_ROSE) && HAVE_DECL_AF_ROSE) - XLAT(AF_ROSE), +#if !(defined(AF_SECURITY) || (defined(HAVE_DECL_AF_SECURITY) && HAVE_DECL_AF_SECURITY)) +# define AF_SECURITY 14 #endif -#if defined(AF_DECnet) || (defined(HAVE_DECL_AF_DECnet) && HAVE_DECL_AF_DECnet) - XLAT(AF_DECnet), +#if !(defined(AF_KEY) || (defined(HAVE_DECL_AF_KEY) && HAVE_DECL_AF_KEY)) +# define AF_KEY 15 #endif -#if defined(AF_NETBEUI) || (defined(HAVE_DECL_AF_NETBEUI) && HAVE_DECL_AF_NETBEUI) - XLAT(AF_NETBEUI), +#if !(defined(AF_NETLINK) || (defined(HAVE_DECL_AF_NETLINK) && HAVE_DECL_AF_NETLINK)) +# define AF_NETLINK 16 #endif -#if defined(AF_SECURITY) || (defined(HAVE_DECL_AF_SECURITY) && HAVE_DECL_AF_SECURITY) - XLAT(AF_SECURITY), +#if !(defined(AF_PACKET) || (defined(HAVE_DECL_AF_PACKET) && HAVE_DECL_AF_PACKET)) +# define AF_PACKET 17 #endif -#if defined(AF_KEY) || (defined(HAVE_DECL_AF_KEY) && HAVE_DECL_AF_KEY) - XLAT(AF_KEY), +#if !(defined(AF_ASH) || (defined(HAVE_DECL_AF_ASH) && HAVE_DECL_AF_ASH)) +# define AF_ASH 18 #endif -#if defined(AF_NETLINK) || (defined(HAVE_DECL_AF_NETLINK) && HAVE_DECL_AF_NETLINK) - XLAT(AF_NETLINK), +#if !(defined(AF_ECONET) || (defined(HAVE_DECL_AF_ECONET) && HAVE_DECL_AF_ECONET)) +# define AF_ECONET 19 #endif -#if defined(AF_ROUTE) || (defined(HAVE_DECL_AF_ROUTE) && HAVE_DECL_AF_ROUTE) - XLAT(AF_ROUTE), +#if !(defined(AF_ATMSVC) || (defined(HAVE_DECL_AF_ATMSVC) && HAVE_DECL_AF_ATMSVC)) +# define AF_ATMSVC 20 #endif -#if defined(AF_PACKET) || (defined(HAVE_DECL_AF_PACKET) && HAVE_DECL_AF_PACKET) - XLAT(AF_PACKET), +#if !(defined(AF_RDS) || (defined(HAVE_DECL_AF_RDS) && HAVE_DECL_AF_RDS)) +# define AF_RDS 21 #endif -#if defined(AF_ASH) || (defined(HAVE_DECL_AF_ASH) && HAVE_DECL_AF_ASH) - XLAT(AF_ASH), +#if !(defined(AF_SNA) || (defined(HAVE_DECL_AF_SNA) && HAVE_DECL_AF_SNA)) +# define AF_SNA 22 #endif -#if defined(AF_ECONET) || (defined(HAVE_DECL_AF_ECONET) && HAVE_DECL_AF_ECONET) - XLAT(AF_ECONET), +#if !(defined(AF_IRDA) || (defined(HAVE_DECL_AF_IRDA) && HAVE_DECL_AF_IRDA)) +# define AF_IRDA 23 #endif -#if defined(AF_ATMSVC) || (defined(HAVE_DECL_AF_ATMSVC) && HAVE_DECL_AF_ATMSVC) - XLAT(AF_ATMSVC), +#if !(defined(AF_PPPOX) || (defined(HAVE_DECL_AF_PPPOX) && HAVE_DECL_AF_PPPOX)) +# define AF_PPPOX 24 #endif -#if defined(AF_RDS) || (defined(HAVE_DECL_AF_RDS) && HAVE_DECL_AF_RDS) - XLAT(AF_RDS), +#if !(defined(AF_WANPIPE) || (defined(HAVE_DECL_AF_WANPIPE) && HAVE_DECL_AF_WANPIPE)) +# define AF_WANPIPE 25 #endif -#if defined(AF_SNA) || (defined(HAVE_DECL_AF_SNA) && HAVE_DECL_AF_SNA) - XLAT(AF_SNA), +#if !(defined(AF_LLC) || (defined(HAVE_DECL_AF_LLC) && HAVE_DECL_AF_LLC)) +# define AF_LLC 26 #endif -#if defined(AF_IRDA) || (defined(HAVE_DECL_AF_IRDA) && HAVE_DECL_AF_IRDA) - XLAT(AF_IRDA), +#if !(defined(AF_IB) || (defined(HAVE_DECL_AF_IB) && HAVE_DECL_AF_IB)) +# define AF_IB 27 #endif -#if defined(AF_PPPOX) || (defined(HAVE_DECL_AF_PPPOX) && HAVE_DECL_AF_PPPOX) - XLAT(AF_PPPOX), +#if !(defined(AF_MPLS) || (defined(HAVE_DECL_AF_MPLS) && HAVE_DECL_AF_MPLS)) +# define AF_MPLS 28 #endif -#if defined(AF_WANPIPE) || (defined(HAVE_DECL_AF_WANPIPE) && HAVE_DECL_AF_WANPIPE) - XLAT(AF_WANPIPE), +#if !(defined(AF_CAN) || (defined(HAVE_DECL_AF_CAN) && HAVE_DECL_AF_CAN)) +# define AF_CAN 29 #endif -#if defined(AF_LLC) || (defined(HAVE_DECL_AF_LLC) && HAVE_DECL_AF_LLC) - XLAT(AF_LLC), +#if !(defined(AF_TIPC) || (defined(HAVE_DECL_AF_TIPC) && HAVE_DECL_AF_TIPC)) +# define AF_TIPC 30 #endif -#if defined(AF_CAN) || (defined(HAVE_DECL_AF_CAN) && HAVE_DECL_AF_CAN) - XLAT(AF_CAN), +#if !(defined(AF_BLUETOOTH) || (defined(HAVE_DECL_AF_BLUETOOTH) && HAVE_DECL_AF_BLUETOOTH)) +# define AF_BLUETOOTH 31 #endif -#if defined(AF_TIPC) || (defined(HAVE_DECL_AF_TIPC) && HAVE_DECL_AF_TIPC) - XLAT(AF_TIPC), +#if !(defined(AF_IUCV) || (defined(HAVE_DECL_AF_IUCV) && HAVE_DECL_AF_IUCV)) +# define AF_IUCV 32 #endif -#if defined(AF_BLUETOOTH) || (defined(HAVE_DECL_AF_BLUETOOTH) && HAVE_DECL_AF_BLUETOOTH) - XLAT(AF_BLUETOOTH), +#if !(defined(AF_RXRPC) || (defined(HAVE_DECL_AF_RXRPC) && HAVE_DECL_AF_RXRPC)) +# define AF_RXRPC 33 #endif -#if defined(AF_IUCV) || (defined(HAVE_DECL_AF_IUCV) && HAVE_DECL_AF_IUCV) - XLAT(AF_IUCV), +#if !(defined(AF_ISDN) || (defined(HAVE_DECL_AF_ISDN) && HAVE_DECL_AF_ISDN)) +# define AF_ISDN 34 #endif -#if defined(AF_RXRPC) || (defined(HAVE_DECL_AF_RXRPC) && HAVE_DECL_AF_RXRPC) - XLAT(AF_RXRPC), +#if !(defined(AF_PHONET) || (defined(HAVE_DECL_AF_PHONET) && HAVE_DECL_AF_PHONET)) +# define AF_PHONET 35 #endif -#if defined(AF_ISDN) || (defined(HAVE_DECL_AF_ISDN) && HAVE_DECL_AF_ISDN) - XLAT(AF_ISDN), +#if !(defined(AF_IEEE802154) || (defined(HAVE_DECL_AF_IEEE802154) && HAVE_DECL_AF_IEEE802154)) +# define AF_IEEE802154 36 #endif -#if defined(AF_PHONET) || (defined(HAVE_DECL_AF_PHONET) && HAVE_DECL_AF_PHONET) - XLAT(AF_PHONET), +#if !(defined(AF_CAIF) || (defined(HAVE_DECL_AF_CAIF) && HAVE_DECL_AF_CAIF)) +# define AF_CAIF 37 #endif -#if defined(AF_IEEE802154) || (defined(HAVE_DECL_AF_IEEE802154) && HAVE_DECL_AF_IEEE802154) - XLAT(AF_IEEE802154), +#if !(defined(AF_ALG) || (defined(HAVE_DECL_AF_ALG) && HAVE_DECL_AF_ALG)) +# define AF_ALG 38 #endif -#if defined(AF_CAIF) || (defined(HAVE_DECL_AF_CAIF) && HAVE_DECL_AF_CAIF) - XLAT(AF_CAIF), +#if !(defined(AF_NFC) || (defined(HAVE_DECL_AF_NFC) && HAVE_DECL_AF_NFC)) +# define AF_NFC 39 #endif -#if defined(AF_ALG) || (defined(HAVE_DECL_AF_ALG) && HAVE_DECL_AF_ALG) - XLAT(AF_ALG), +#if !(defined(AF_VSOCK) || (defined(HAVE_DECL_AF_VSOCK) && HAVE_DECL_AF_VSOCK)) +# define AF_VSOCK 40 #endif -#if defined(AF_NFC) || (defined(HAVE_DECL_AF_NFC) && HAVE_DECL_AF_NFC) - XLAT(AF_NFC), +#if !(defined(AF_KCM) || (defined(HAVE_DECL_AF_KCM) && HAVE_DECL_AF_KCM)) +# define AF_KCM 41 #endif -#if defined(AF_VSOCK) || (defined(HAVE_DECL_AF_VSOCK) && HAVE_DECL_AF_VSOCK) - XLAT(AF_VSOCK), +#if !(defined(AF_QIPCRTR) || (defined(HAVE_DECL_AF_QIPCRTR) && HAVE_DECL_AF_QIPCRTR)) +# define AF_QIPCRTR 42 #endif - XLAT_END + +#ifndef IN_MPERS + +const struct xlat addrfams[] = { + XLAT(AF_UNSPEC), + XLAT(AF_UNIX), + XLAT(AF_INET), + XLAT(AF_AX25), + XLAT(AF_IPX), + XLAT(AF_APPLETALK), + XLAT(AF_NETROM), + XLAT(AF_BRIDGE), + XLAT(AF_ATMPVC), + XLAT(AF_X25), + XLAT(AF_INET6), + XLAT(AF_ROSE), + XLAT(AF_DECnet), + XLAT(AF_NETBEUI), + XLAT(AF_SECURITY), + XLAT(AF_KEY), + XLAT(AF_NETLINK), + XLAT(AF_PACKET), + XLAT(AF_ASH), + XLAT(AF_ECONET), + XLAT(AF_ATMSVC), + XLAT(AF_RDS), + XLAT(AF_SNA), + XLAT(AF_IRDA), + XLAT(AF_PPPOX), + XLAT(AF_WANPIPE), + XLAT(AF_LLC), + XLAT(AF_IB), + XLAT(AF_MPLS), + XLAT(AF_CAN), + XLAT(AF_TIPC), + XLAT(AF_BLUETOOTH), + XLAT(AF_IUCV), + XLAT(AF_RXRPC), + XLAT(AF_ISDN), + XLAT(AF_PHONET), + XLAT(AF_IEEE802154), + XLAT(AF_CAIF), + XLAT(AF_ALG), + XLAT(AF_NFC), + XLAT(AF_VSOCK), + XLAT(AF_KCM), + XLAT(AF_QIPCRTR), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/addrfams.in b/xlat/addrfams.in index a8695742..315667eb 100644 --- a/xlat/addrfams.in +++ b/xlat/addrfams.in @@ -1,41 +1,43 @@ -AF_UNSPEC -AF_LOCAL -AF_UNIX -AF_INET -AF_AX25 -AF_IPX -AF_APPLETALK -AF_NETROM -AF_BRIDGE -AF_ATMPVC -AF_X25 -AF_INET6 -AF_ROSE -AF_DECnet -AF_NETBEUI -AF_SECURITY -AF_KEY -AF_NETLINK -AF_ROUTE -AF_PACKET -AF_ASH -AF_ECONET -AF_ATMSVC -AF_RDS -AF_SNA -AF_IRDA -AF_PPPOX -AF_WANPIPE -AF_LLC -AF_CAN -AF_TIPC -AF_BLUETOOTH -AF_IUCV -AF_RXRPC -AF_ISDN -AF_PHONET -AF_IEEE802154 -AF_CAIF -AF_ALG -AF_NFC -AF_VSOCK +AF_UNSPEC 0 +AF_UNIX 1 +AF_INET 2 +AF_AX25 3 +AF_IPX 4 +AF_APPLETALK 5 +AF_NETROM 6 +AF_BRIDGE 7 +AF_ATMPVC 8 +AF_X25 9 +AF_INET6 10 +AF_ROSE 11 +AF_DECnet 12 +AF_NETBEUI 13 +AF_SECURITY 14 +AF_KEY 15 +AF_NETLINK 16 +AF_PACKET 17 +AF_ASH 18 +AF_ECONET 19 +AF_ATMSVC 20 +AF_RDS 21 +AF_SNA 22 +AF_IRDA 23 +AF_PPPOX 24 +AF_WANPIPE 25 +AF_LLC 26 +AF_IB 27 +AF_MPLS 28 +AF_CAN 29 +AF_TIPC 30 +AF_BLUETOOTH 31 +AF_IUCV 32 +AF_RXRPC 33 +AF_ISDN 34 +AF_PHONET 35 +AF_IEEE802154 36 +AF_CAIF 37 +AF_ALG 38 +AF_NFC 39 +AF_VSOCK 40 +AF_KCM 41 +AF_QIPCRTR 42 diff --git a/xlat/adjtimex_modes.h b/xlat/adjtimex_modes.h index 37461f8c..7415fe8e 100644 --- a/xlat/adjtimex_modes.h +++ b/xlat/adjtimex_modes.h @@ -1,45 +1,56 @@ /* Generated by ./xlat/gen.sh from ./xlat/adjtimex_modes.in; do not edit. */ -static const struct xlat adjtimex_modes[] = { - XLAT(0), +#ifdef IN_MPERS + +extern const struct xlat adjtimex_modes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat adjtimex_modes[] = { + XLAT(0), #if defined(ADJ_OFFSET) || (defined(HAVE_DECL_ADJ_OFFSET) && HAVE_DECL_ADJ_OFFSET) - XLAT(ADJ_OFFSET), + XLAT(ADJ_OFFSET), #endif #if defined(ADJ_FREQUENCY) || (defined(HAVE_DECL_ADJ_FREQUENCY) && HAVE_DECL_ADJ_FREQUENCY) - XLAT(ADJ_FREQUENCY), + XLAT(ADJ_FREQUENCY), #endif #if defined(ADJ_MAXERROR) || (defined(HAVE_DECL_ADJ_MAXERROR) && HAVE_DECL_ADJ_MAXERROR) - XLAT(ADJ_MAXERROR), + XLAT(ADJ_MAXERROR), #endif #if defined(ADJ_ESTERROR) || (defined(HAVE_DECL_ADJ_ESTERROR) && HAVE_DECL_ADJ_ESTERROR) - XLAT(ADJ_ESTERROR), + XLAT(ADJ_ESTERROR), #endif #if defined(ADJ_STATUS) || (defined(HAVE_DECL_ADJ_STATUS) && HAVE_DECL_ADJ_STATUS) - XLAT(ADJ_STATUS), + XLAT(ADJ_STATUS), #endif #if defined(ADJ_TIMECONST) || (defined(HAVE_DECL_ADJ_TIMECONST) && HAVE_DECL_ADJ_TIMECONST) - XLAT(ADJ_TIMECONST), + XLAT(ADJ_TIMECONST), #endif #if defined(ADJ_TAI) || (defined(HAVE_DECL_ADJ_TAI) && HAVE_DECL_ADJ_TAI) - XLAT(ADJ_TAI), + XLAT(ADJ_TAI), #endif #if defined(ADJ_SETOFFSET) || (defined(HAVE_DECL_ADJ_SETOFFSET) && HAVE_DECL_ADJ_SETOFFSET) - XLAT(ADJ_SETOFFSET), + XLAT(ADJ_SETOFFSET), #endif #if defined(ADJ_MICRO) || (defined(HAVE_DECL_ADJ_MICRO) && HAVE_DECL_ADJ_MICRO) - XLAT(ADJ_MICRO), + XLAT(ADJ_MICRO), #endif #if defined(ADJ_NANO) || (defined(HAVE_DECL_ADJ_NANO) && HAVE_DECL_ADJ_NANO) - XLAT(ADJ_NANO), + XLAT(ADJ_NANO), #endif #if defined(ADJ_TICK) || (defined(HAVE_DECL_ADJ_TICK) && HAVE_DECL_ADJ_TICK) - XLAT(ADJ_TICK), + XLAT(ADJ_TICK), #endif #if defined(ADJ_OFFSET_SINGLESHOT) || (defined(HAVE_DECL_ADJ_OFFSET_SINGLESHOT) && HAVE_DECL_ADJ_OFFSET_SINGLESHOT) - XLAT(ADJ_OFFSET_SINGLESHOT), + XLAT(ADJ_OFFSET_SINGLESHOT), #endif #if defined(ADJ_OFFSET_SS_READ) || (defined(HAVE_DECL_ADJ_OFFSET_SS_READ) && HAVE_DECL_ADJ_OFFSET_SS_READ) - XLAT(ADJ_OFFSET_SS_READ), + XLAT(ADJ_OFFSET_SS_READ), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/adjtimex_state.h b/xlat/adjtimex_state.h index ff314498..888f1b6d 100644 --- a/xlat/adjtimex_state.h +++ b/xlat/adjtimex_state.h @@ -1,23 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/adjtimex_state.in; do not edit. */ -static const struct xlat adjtimex_state[] = { +#ifdef IN_MPERS + +# error static const struct xlat adjtimex_state in mpers mode + +#else + +static +const struct xlat adjtimex_state[] = { #if defined(TIME_OK) || (defined(HAVE_DECL_TIME_OK) && HAVE_DECL_TIME_OK) - XLAT(TIME_OK), + XLAT(TIME_OK), #endif #if defined(TIME_INS) || (defined(HAVE_DECL_TIME_INS) && HAVE_DECL_TIME_INS) - XLAT(TIME_INS), + XLAT(TIME_INS), #endif #if defined(TIME_DEL) || (defined(HAVE_DECL_TIME_DEL) && HAVE_DECL_TIME_DEL) - XLAT(TIME_DEL), + XLAT(TIME_DEL), #endif #if defined(TIME_OOP) || (defined(HAVE_DECL_TIME_OOP) && HAVE_DECL_TIME_OOP) - XLAT(TIME_OOP), + XLAT(TIME_OOP), #endif #if defined(TIME_WAIT) || (defined(HAVE_DECL_TIME_WAIT) && HAVE_DECL_TIME_WAIT) - XLAT(TIME_WAIT), + XLAT(TIME_WAIT), #endif #if defined(TIME_ERROR) || (defined(HAVE_DECL_TIME_ERROR) && HAVE_DECL_TIME_ERROR) - XLAT(TIME_ERROR), + XLAT(TIME_ERROR), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/adjtimex_status.h b/xlat/adjtimex_status.h index f1a7c998..16e7811c 100644 --- a/xlat/adjtimex_status.h +++ b/xlat/adjtimex_status.h @@ -1,53 +1,64 @@ /* Generated by ./xlat/gen.sh from ./xlat/adjtimex_status.in; do not edit. */ -static const struct xlat adjtimex_status[] = { +#ifdef IN_MPERS + +extern const struct xlat adjtimex_status[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat adjtimex_status[] = { #if defined(STA_PLL) || (defined(HAVE_DECL_STA_PLL) && HAVE_DECL_STA_PLL) - XLAT(STA_PLL), + XLAT(STA_PLL), #endif #if defined(STA_PPSFREQ) || (defined(HAVE_DECL_STA_PPSFREQ) && HAVE_DECL_STA_PPSFREQ) - XLAT(STA_PPSFREQ), + XLAT(STA_PPSFREQ), #endif #if defined(STA_PPSTIME) || (defined(HAVE_DECL_STA_PPSTIME) && HAVE_DECL_STA_PPSTIME) - XLAT(STA_PPSTIME), + XLAT(STA_PPSTIME), #endif #if defined(STA_FLL) || (defined(HAVE_DECL_STA_FLL) && HAVE_DECL_STA_FLL) - XLAT(STA_FLL), + XLAT(STA_FLL), #endif #if defined(STA_INS) || (defined(HAVE_DECL_STA_INS) && HAVE_DECL_STA_INS) - XLAT(STA_INS), + XLAT(STA_INS), #endif #if defined(STA_DEL) || (defined(HAVE_DECL_STA_DEL) && HAVE_DECL_STA_DEL) - XLAT(STA_DEL), + XLAT(STA_DEL), #endif #if defined(STA_UNSYNC) || (defined(HAVE_DECL_STA_UNSYNC) && HAVE_DECL_STA_UNSYNC) - XLAT(STA_UNSYNC), + XLAT(STA_UNSYNC), #endif #if defined(STA_FREQHOLD) || (defined(HAVE_DECL_STA_FREQHOLD) && HAVE_DECL_STA_FREQHOLD) - XLAT(STA_FREQHOLD), + XLAT(STA_FREQHOLD), #endif #if defined(STA_PPSSIGNAL) || (defined(HAVE_DECL_STA_PPSSIGNAL) && HAVE_DECL_STA_PPSSIGNAL) - XLAT(STA_PPSSIGNAL), + XLAT(STA_PPSSIGNAL), #endif #if defined(STA_PPSJITTER) || (defined(HAVE_DECL_STA_PPSJITTER) && HAVE_DECL_STA_PPSJITTER) - XLAT(STA_PPSJITTER), + XLAT(STA_PPSJITTER), #endif #if defined(STA_PPSWANDER) || (defined(HAVE_DECL_STA_PPSWANDER) && HAVE_DECL_STA_PPSWANDER) - XLAT(STA_PPSWANDER), + XLAT(STA_PPSWANDER), #endif #if defined(STA_PPSERROR) || (defined(HAVE_DECL_STA_PPSERROR) && HAVE_DECL_STA_PPSERROR) - XLAT(STA_PPSERROR), + XLAT(STA_PPSERROR), #endif #if defined(STA_CLOCKERR) || (defined(HAVE_DECL_STA_CLOCKERR) && HAVE_DECL_STA_CLOCKERR) - XLAT(STA_CLOCKERR), + XLAT(STA_CLOCKERR), #endif #if defined(STA_NANO) || (defined(HAVE_DECL_STA_NANO) && HAVE_DECL_STA_NANO) - XLAT(STA_NANO), + XLAT(STA_NANO), #endif #if defined(STA_MODE) || (defined(HAVE_DECL_STA_MODE) && HAVE_DECL_STA_MODE) - XLAT(STA_MODE), + XLAT(STA_MODE), #endif #if defined(STA_CLK) || (defined(HAVE_DECL_STA_CLK) && HAVE_DECL_STA_CLK) - XLAT(STA_CLK), + XLAT(STA_CLK), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/advise.h b/xlat/advise.h index 58e9bd80..526219d1 100644 --- a/xlat/advise.h +++ b/xlat/advise.h @@ -1,23 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/advise.in; do not edit. */ -static const struct xlat advise[] = { +#ifdef IN_MPERS + +# error static const struct xlat advise in mpers mode + +#else + +static +const struct xlat advise[] = { #if defined(POSIX_FADV_NORMAL) || (defined(HAVE_DECL_POSIX_FADV_NORMAL) && HAVE_DECL_POSIX_FADV_NORMAL) - XLAT(POSIX_FADV_NORMAL), + XLAT(POSIX_FADV_NORMAL), #endif #if defined(POSIX_FADV_RANDOM) || (defined(HAVE_DECL_POSIX_FADV_RANDOM) && HAVE_DECL_POSIX_FADV_RANDOM) - XLAT(POSIX_FADV_RANDOM), + XLAT(POSIX_FADV_RANDOM), #endif #if defined(POSIX_FADV_SEQUENTIAL) || (defined(HAVE_DECL_POSIX_FADV_SEQUENTIAL) && HAVE_DECL_POSIX_FADV_SEQUENTIAL) - XLAT(POSIX_FADV_SEQUENTIAL), + XLAT(POSIX_FADV_SEQUENTIAL), #endif #if defined(POSIX_FADV_WILLNEED) || (defined(HAVE_DECL_POSIX_FADV_WILLNEED) && HAVE_DECL_POSIX_FADV_WILLNEED) - XLAT(POSIX_FADV_WILLNEED), + XLAT(POSIX_FADV_WILLNEED), #endif #if defined(POSIX_FADV_DONTNEED) || (defined(HAVE_DECL_POSIX_FADV_DONTNEED) && HAVE_DECL_POSIX_FADV_DONTNEED) - XLAT(POSIX_FADV_DONTNEED), + XLAT(POSIX_FADV_DONTNEED), #endif #if defined(POSIX_FADV_NOREUSE) || (defined(HAVE_DECL_POSIX_FADV_NOREUSE) && HAVE_DECL_POSIX_FADV_NOREUSE) - XLAT(POSIX_FADV_NOREUSE), + XLAT(POSIX_FADV_NOREUSE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/af_packet_types.h b/xlat/af_packet_types.h index 64eeff20..72bb4192 100644 --- a/xlat/af_packet_types.h +++ b/xlat/af_packet_types.h @@ -1,26 +1,35 @@ /* Generated by ./xlat/gen.sh from ./xlat/af_packet_types.in; do not edit. */ -static const struct xlat af_packet_types[] = { +#ifdef IN_MPERS + +# error static const struct xlat af_packet_types in mpers mode + +#else + +static +const struct xlat af_packet_types[] = { #if defined(PACKET_HOST) || (defined(HAVE_DECL_PACKET_HOST) && HAVE_DECL_PACKET_HOST) - XLAT(PACKET_HOST), + XLAT(PACKET_HOST), #endif #if defined(PACKET_BROADCAST) || (defined(HAVE_DECL_PACKET_BROADCAST) && HAVE_DECL_PACKET_BROADCAST) - XLAT(PACKET_BROADCAST), + XLAT(PACKET_BROADCAST), #endif #if defined(PACKET_MULTICAST) || (defined(HAVE_DECL_PACKET_MULTICAST) && HAVE_DECL_PACKET_MULTICAST) - XLAT(PACKET_MULTICAST), + XLAT(PACKET_MULTICAST), #endif #if defined(PACKET_OTHERHOST) || (defined(HAVE_DECL_PACKET_OTHERHOST) && HAVE_DECL_PACKET_OTHERHOST) - XLAT(PACKET_OTHERHOST), + XLAT(PACKET_OTHERHOST), #endif #if defined(PACKET_OUTGOING) || (defined(HAVE_DECL_PACKET_OUTGOING) && HAVE_DECL_PACKET_OUTGOING) - XLAT(PACKET_OUTGOING), + XLAT(PACKET_OUTGOING), #endif #if defined(PACKET_LOOPBACK) || (defined(HAVE_DECL_PACKET_LOOPBACK) && HAVE_DECL_PACKET_LOOPBACK) - XLAT(PACKET_LOOPBACK), + XLAT(PACKET_LOOPBACK), #endif #if defined(PACKET_FASTROUTE) || (defined(HAVE_DECL_PACKET_FASTROUTE) && HAVE_DECL_PACKET_FASTROUTE) - XLAT(PACKET_FASTROUTE), + XLAT(PACKET_FASTROUTE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/archvals.h b/xlat/archvals.h index 6e17eb8b..1f441d52 100644 --- a/xlat/archvals.h +++ b/xlat/archvals.h @@ -1,17 +1,38 @@ /* Generated by ./xlat/gen.sh from ./xlat/archvals.in; do not edit. */ +#if !(defined(ARCH_MAP_VDSO_X32) || (defined(HAVE_DECL_ARCH_MAP_VDSO_X32) && HAVE_DECL_ARCH_MAP_VDSO_X32)) +# define ARCH_MAP_VDSO_X32 0x2001 +#endif +#if !(defined(ARCH_MAP_VDSO_32) || (defined(HAVE_DECL_ARCH_MAP_VDSO_32) && HAVE_DECL_ARCH_MAP_VDSO_32)) +# define ARCH_MAP_VDSO_32 0x2002 +#endif +#if !(defined(ARCH_MAP_VDSO_64) || (defined(HAVE_DECL_ARCH_MAP_VDSO_64) && HAVE_DECL_ARCH_MAP_VDSO_64)) +# define ARCH_MAP_VDSO_64 0x2003 +#endif + +#ifdef IN_MPERS -static const struct xlat archvals[] = { +# error static const struct xlat archvals in mpers mode + +#else + +static +const struct xlat archvals[] = { #if defined(ARCH_SET_GS) || (defined(HAVE_DECL_ARCH_SET_GS) && HAVE_DECL_ARCH_SET_GS) - XLAT(ARCH_SET_GS), + XLAT(ARCH_SET_GS), #endif #if defined(ARCH_SET_FS) || (defined(HAVE_DECL_ARCH_SET_FS) && HAVE_DECL_ARCH_SET_FS) - XLAT(ARCH_SET_FS), + XLAT(ARCH_SET_FS), #endif #if defined(ARCH_GET_FS) || (defined(HAVE_DECL_ARCH_GET_FS) && HAVE_DECL_ARCH_GET_FS) - XLAT(ARCH_GET_FS), + XLAT(ARCH_GET_FS), #endif #if defined(ARCH_GET_GS) || (defined(HAVE_DECL_ARCH_GET_GS) && HAVE_DECL_ARCH_GET_GS) - XLAT(ARCH_GET_GS), + XLAT(ARCH_GET_GS), #endif - XLAT_END + XLAT(ARCH_MAP_VDSO_X32), + XLAT(ARCH_MAP_VDSO_32), + XLAT(ARCH_MAP_VDSO_64), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/archvals.in b/xlat/archvals.in index 22ad7c1b..def419d0 100644 --- a/xlat/archvals.in +++ b/xlat/archvals.in @@ -2,3 +2,6 @@ ARCH_SET_GS ARCH_SET_FS ARCH_GET_FS ARCH_GET_GS +ARCH_MAP_VDSO_X32 0x2001 +ARCH_MAP_VDSO_32 0x2002 +ARCH_MAP_VDSO_64 0x2003 diff --git a/xlat/arp_hardware_types.h b/xlat/arp_hardware_types.h new file mode 100644 index 00000000..7e669b3d --- /dev/null +++ b/xlat/arp_hardware_types.h @@ -0,0 +1,206 @@ +/* Generated by ./xlat/gen.sh from ./xlat/arp_hardware_types.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat arp_hardware_types in mpers mode + +#else + +static +const struct xlat arp_hardware_types[] = { +#if defined(ARPHRD_NETROM) || (defined(HAVE_DECL_ARPHRD_NETROM) && HAVE_DECL_ARPHRD_NETROM) + XLAT(ARPHRD_NETROM), +#endif +#if defined(ARPHRD_ETHER) || (defined(HAVE_DECL_ARPHRD_ETHER) && HAVE_DECL_ARPHRD_ETHER) + XLAT(ARPHRD_ETHER), +#endif +#if defined(ARPHRD_EETHER) || (defined(HAVE_DECL_ARPHRD_EETHER) && HAVE_DECL_ARPHRD_EETHER) + XLAT(ARPHRD_EETHER), +#endif +#if defined(ARPHRD_AX25) || (defined(HAVE_DECL_ARPHRD_AX25) && HAVE_DECL_ARPHRD_AX25) + XLAT(ARPHRD_AX25), +#endif +#if defined(ARPHRD_PRONET) || (defined(HAVE_DECL_ARPHRD_PRONET) && HAVE_DECL_ARPHRD_PRONET) + XLAT(ARPHRD_PRONET), +#endif +#if defined(ARPHRD_CHAOS) || (defined(HAVE_DECL_ARPHRD_CHAOS) && HAVE_DECL_ARPHRD_CHAOS) + XLAT(ARPHRD_CHAOS), +#endif +#if defined(ARPHRD_IEEE802) || (defined(HAVE_DECL_ARPHRD_IEEE802) && HAVE_DECL_ARPHRD_IEEE802) + XLAT(ARPHRD_IEEE802), +#endif +#if defined(ARPHRD_ARCNET) || (defined(HAVE_DECL_ARPHRD_ARCNET) && HAVE_DECL_ARPHRD_ARCNET) + XLAT(ARPHRD_ARCNET), +#endif +#if defined(ARPHRD_APPLETLK) || (defined(HAVE_DECL_ARPHRD_APPLETLK) && HAVE_DECL_ARPHRD_APPLETLK) + XLAT(ARPHRD_APPLETLK), +#endif +#if defined(ARPHRD_DLCI) || (defined(HAVE_DECL_ARPHRD_DLCI) && HAVE_DECL_ARPHRD_DLCI) + XLAT(ARPHRD_DLCI), +#endif +#if defined(ARPHRD_ATM) || (defined(HAVE_DECL_ARPHRD_ATM) && HAVE_DECL_ARPHRD_ATM) + XLAT(ARPHRD_ATM), +#endif +#if defined(ARPHRD_METRICOM) || (defined(HAVE_DECL_ARPHRD_METRICOM) && HAVE_DECL_ARPHRD_METRICOM) + XLAT(ARPHRD_METRICOM), +#endif +#if defined(ARPHRD_IEEE1394) || (defined(HAVE_DECL_ARPHRD_IEEE1394) && HAVE_DECL_ARPHRD_IEEE1394) + XLAT(ARPHRD_IEEE1394), +#endif +#if defined(ARPHRD_EUI64) || (defined(HAVE_DECL_ARPHRD_EUI64) && HAVE_DECL_ARPHRD_EUI64) + XLAT(ARPHRD_EUI64), +#endif +#if defined(ARPHRD_INFINIBAND) || (defined(HAVE_DECL_ARPHRD_INFINIBAND) && HAVE_DECL_ARPHRD_INFINIBAND) + XLAT(ARPHRD_INFINIBAND), +#endif +#if defined(ARPHRD_SLIP) || (defined(HAVE_DECL_ARPHRD_SLIP) && HAVE_DECL_ARPHRD_SLIP) + XLAT(ARPHRD_SLIP), +#endif +#if defined(ARPHRD_CSLIP) || (defined(HAVE_DECL_ARPHRD_CSLIP) && HAVE_DECL_ARPHRD_CSLIP) + XLAT(ARPHRD_CSLIP), +#endif +#if defined(ARPHRD_SLIP6) || (defined(HAVE_DECL_ARPHRD_SLIP6) && HAVE_DECL_ARPHRD_SLIP6) + XLAT(ARPHRD_SLIP6), +#endif +#if defined(ARPHRD_CSLIP6) || (defined(HAVE_DECL_ARPHRD_CSLIP6) && HAVE_DECL_ARPHRD_CSLIP6) + XLAT(ARPHRD_CSLIP6), +#endif +#if defined(ARPHRD_RSRVD) || (defined(HAVE_DECL_ARPHRD_RSRVD) && HAVE_DECL_ARPHRD_RSRVD) + XLAT(ARPHRD_RSRVD), +#endif +#if defined(ARPHRD_ADAPT) || (defined(HAVE_DECL_ARPHRD_ADAPT) && HAVE_DECL_ARPHRD_ADAPT) + XLAT(ARPHRD_ADAPT), +#endif +#if defined(ARPHRD_ROSE) || (defined(HAVE_DECL_ARPHRD_ROSE) && HAVE_DECL_ARPHRD_ROSE) + XLAT(ARPHRD_ROSE), +#endif +#if defined(ARPHRD_X25) || (defined(HAVE_DECL_ARPHRD_X25) && HAVE_DECL_ARPHRD_X25) + XLAT(ARPHRD_X25), +#endif +#if defined(ARPHRD_HWX25) || (defined(HAVE_DECL_ARPHRD_HWX25) && HAVE_DECL_ARPHRD_HWX25) + XLAT(ARPHRD_HWX25), +#endif +#if defined(ARPHRD_CAN) || (defined(HAVE_DECL_ARPHRD_CAN) && HAVE_DECL_ARPHRD_CAN) + XLAT(ARPHRD_CAN), +#endif +#if defined(ARPHRD_PPP) || (defined(HAVE_DECL_ARPHRD_PPP) && HAVE_DECL_ARPHRD_PPP) + XLAT(ARPHRD_PPP), +#endif +#if defined(ARPHRD_CISCO) || (defined(HAVE_DECL_ARPHRD_CISCO) && HAVE_DECL_ARPHRD_CISCO) + XLAT(ARPHRD_CISCO), +#endif +#if defined(ARPHRD_LAPB) || (defined(HAVE_DECL_ARPHRD_LAPB) && HAVE_DECL_ARPHRD_LAPB) + XLAT(ARPHRD_LAPB), +#endif +#if defined(ARPHRD_DDCMP) || (defined(HAVE_DECL_ARPHRD_DDCMP) && HAVE_DECL_ARPHRD_DDCMP) + XLAT(ARPHRD_DDCMP), +#endif +#if defined(ARPHRD_RAWHDLC) || (defined(HAVE_DECL_ARPHRD_RAWHDLC) && HAVE_DECL_ARPHRD_RAWHDLC) + XLAT(ARPHRD_RAWHDLC), +#endif +#if defined(ARPHRD_TUNNEL) || (defined(HAVE_DECL_ARPHRD_TUNNEL) && HAVE_DECL_ARPHRD_TUNNEL) + XLAT(ARPHRD_TUNNEL), +#endif +#if defined(ARPHRD_TUNNEL6) || (defined(HAVE_DECL_ARPHRD_TUNNEL6) && HAVE_DECL_ARPHRD_TUNNEL6) + XLAT(ARPHRD_TUNNEL6), +#endif +#if defined(ARPHRD_FRAD) || (defined(HAVE_DECL_ARPHRD_FRAD) && HAVE_DECL_ARPHRD_FRAD) + XLAT(ARPHRD_FRAD), +#endif +#if defined(ARPHRD_SKIP) || (defined(HAVE_DECL_ARPHRD_SKIP) && HAVE_DECL_ARPHRD_SKIP) + XLAT(ARPHRD_SKIP), +#endif +#if defined(ARPHRD_LOOPBACK) || (defined(HAVE_DECL_ARPHRD_LOOPBACK) && HAVE_DECL_ARPHRD_LOOPBACK) + XLAT(ARPHRD_LOOPBACK), +#endif +#if defined(ARPHRD_LOCALTLK) || (defined(HAVE_DECL_ARPHRD_LOCALTLK) && HAVE_DECL_ARPHRD_LOCALTLK) + XLAT(ARPHRD_LOCALTLK), +#endif +#if defined(ARPHRD_FDDI) || (defined(HAVE_DECL_ARPHRD_FDDI) && HAVE_DECL_ARPHRD_FDDI) + XLAT(ARPHRD_FDDI), +#endif +#if defined(ARPHRD_BIF) || (defined(HAVE_DECL_ARPHRD_BIF) && HAVE_DECL_ARPHRD_BIF) + XLAT(ARPHRD_BIF), +#endif +#if defined(ARPHRD_SIT) || (defined(HAVE_DECL_ARPHRD_SIT) && HAVE_DECL_ARPHRD_SIT) + XLAT(ARPHRD_SIT), +#endif +#if defined(ARPHRD_IPDDP) || (defined(HAVE_DECL_ARPHRD_IPDDP) && HAVE_DECL_ARPHRD_IPDDP) + XLAT(ARPHRD_IPDDP), +#endif +#if defined(ARPHRD_IPGRE) || (defined(HAVE_DECL_ARPHRD_IPGRE) && HAVE_DECL_ARPHRD_IPGRE) + XLAT(ARPHRD_IPGRE), +#endif +#if defined(ARPHRD_PIMREG) || (defined(HAVE_DECL_ARPHRD_PIMREG) && HAVE_DECL_ARPHRD_PIMREG) + XLAT(ARPHRD_PIMREG), +#endif +#if defined(ARPHRD_HIPPI) || (defined(HAVE_DECL_ARPHRD_HIPPI) && HAVE_DECL_ARPHRD_HIPPI) + XLAT(ARPHRD_HIPPI), +#endif +#if defined(ARPHRD_ASH) || (defined(HAVE_DECL_ARPHRD_ASH) && HAVE_DECL_ARPHRD_ASH) + XLAT(ARPHRD_ASH), +#endif +#if defined(ARPHRD_ECONET) || (defined(HAVE_DECL_ARPHRD_ECONET) && HAVE_DECL_ARPHRD_ECONET) + XLAT(ARPHRD_ECONET), +#endif +#if defined(ARPHRD_IRDA) || (defined(HAVE_DECL_ARPHRD_IRDA) && HAVE_DECL_ARPHRD_IRDA) + XLAT(ARPHRD_IRDA), +#endif +#if defined(ARPHRD_FCPP) || (defined(HAVE_DECL_ARPHRD_FCPP) && HAVE_DECL_ARPHRD_FCPP) + XLAT(ARPHRD_FCPP), +#endif +#if defined(ARPHRD_FCAL) || (defined(HAVE_DECL_ARPHRD_FCAL) && HAVE_DECL_ARPHRD_FCAL) + XLAT(ARPHRD_FCAL), +#endif +#if defined(ARPHRD_FCPL) || (defined(HAVE_DECL_ARPHRD_FCPL) && HAVE_DECL_ARPHRD_FCPL) + XLAT(ARPHRD_FCPL), +#endif +#if defined(ARPHRD_FCFABRIC) || (defined(HAVE_DECL_ARPHRD_FCFABRIC) && HAVE_DECL_ARPHRD_FCFABRIC) + XLAT(ARPHRD_FCFABRIC), +#endif +#if defined(ARPHRD_IEEE802_TR) || (defined(HAVE_DECL_ARPHRD_IEEE802_TR) && HAVE_DECL_ARPHRD_IEEE802_TR) + XLAT(ARPHRD_IEEE802_TR), +#endif +#if defined(ARPHRD_IEEE80211) || (defined(HAVE_DECL_ARPHRD_IEEE80211) && HAVE_DECL_ARPHRD_IEEE80211) + XLAT(ARPHRD_IEEE80211), +#endif +#if defined(ARPHRD_IEEE80211_PRISM) || (defined(HAVE_DECL_ARPHRD_IEEE80211_PRISM) && HAVE_DECL_ARPHRD_IEEE80211_PRISM) + XLAT(ARPHRD_IEEE80211_PRISM), +#endif +#if defined(ARPHRD_IEEE80211_RADIOTAP) || (defined(HAVE_DECL_ARPHRD_IEEE80211_RADIOTAP) && HAVE_DECL_ARPHRD_IEEE80211_RADIOTAP) + XLAT(ARPHRD_IEEE80211_RADIOTAP), +#endif +#if defined(ARPHRD_IEEE802154) || (defined(HAVE_DECL_ARPHRD_IEEE802154) && HAVE_DECL_ARPHRD_IEEE802154) + XLAT(ARPHRD_IEEE802154), +#endif +#if defined(ARPHRD_IEEE802154_MONITOR) || (defined(HAVE_DECL_ARPHRD_IEEE802154_MONITOR) && HAVE_DECL_ARPHRD_IEEE802154_MONITOR) + XLAT(ARPHRD_IEEE802154_MONITOR), +#endif +#if defined(ARPHRD_PHONET) || (defined(HAVE_DECL_ARPHRD_PHONET) && HAVE_DECL_ARPHRD_PHONET) + XLAT(ARPHRD_PHONET), +#endif +#if defined(ARPHRD_PHONET_PIPE) || (defined(HAVE_DECL_ARPHRD_PHONET_PIPE) && HAVE_DECL_ARPHRD_PHONET_PIPE) + XLAT(ARPHRD_PHONET_PIPE), +#endif +#if defined(ARPHRD_CAIF) || (defined(HAVE_DECL_ARPHRD_CAIF) && HAVE_DECL_ARPHRD_CAIF) + XLAT(ARPHRD_CAIF), +#endif +#if defined(ARPHRD_IP6GRE) || (defined(HAVE_DECL_ARPHRD_IP6GRE) && HAVE_DECL_ARPHRD_IP6GRE) + XLAT(ARPHRD_IP6GRE), +#endif +#if defined(ARPHRD_NETLINK) || (defined(HAVE_DECL_ARPHRD_NETLINK) && HAVE_DECL_ARPHRD_NETLINK) + XLAT(ARPHRD_NETLINK), +#endif +#if defined(ARPHRD_6LOWPAN) || (defined(HAVE_DECL_ARPHRD_6LOWPAN) && HAVE_DECL_ARPHRD_6LOWPAN) + XLAT(ARPHRD_6LOWPAN), +#endif +#if defined(ARPHRD_VOID) || (defined(HAVE_DECL_ARPHRD_VOID) && HAVE_DECL_ARPHRD_VOID) + XLAT(ARPHRD_VOID), +#endif +#if defined(ARPHRD_NONE) || (defined(HAVE_DECL_ARPHRD_NONE) && HAVE_DECL_ARPHRD_NONE) + XLAT(ARPHRD_NONE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/arp_hardware_types.in b/xlat/arp_hardware_types.in new file mode 100644 index 00000000..df8b4fcf --- /dev/null +++ b/xlat/arp_hardware_types.in @@ -0,0 +1,64 @@ +ARPHRD_NETROM +ARPHRD_ETHER +ARPHRD_EETHER +ARPHRD_AX25 +ARPHRD_PRONET +ARPHRD_CHAOS +ARPHRD_IEEE802 +ARPHRD_ARCNET +ARPHRD_APPLETLK +ARPHRD_DLCI +ARPHRD_ATM +ARPHRD_METRICOM +ARPHRD_IEEE1394 +ARPHRD_EUI64 +ARPHRD_INFINIBAND +ARPHRD_SLIP +ARPHRD_CSLIP +ARPHRD_SLIP6 +ARPHRD_CSLIP6 +ARPHRD_RSRVD +ARPHRD_ADAPT +ARPHRD_ROSE +ARPHRD_X25 +ARPHRD_HWX25 +ARPHRD_CAN +ARPHRD_PPP +ARPHRD_CISCO +ARPHRD_LAPB +ARPHRD_DDCMP +ARPHRD_RAWHDLC +ARPHRD_TUNNEL +ARPHRD_TUNNEL6 +ARPHRD_FRAD +ARPHRD_SKIP +ARPHRD_LOOPBACK +ARPHRD_LOCALTLK +ARPHRD_FDDI +ARPHRD_BIF +ARPHRD_SIT +ARPHRD_IPDDP +ARPHRD_IPGRE +ARPHRD_PIMREG +ARPHRD_HIPPI +ARPHRD_ASH +ARPHRD_ECONET +ARPHRD_IRDA +ARPHRD_FCPP +ARPHRD_FCAL +ARPHRD_FCPL +ARPHRD_FCFABRIC +ARPHRD_IEEE802_TR +ARPHRD_IEEE80211 +ARPHRD_IEEE80211_PRISM +ARPHRD_IEEE80211_RADIOTAP +ARPHRD_IEEE802154 +ARPHRD_IEEE802154_MONITOR +ARPHRD_PHONET +ARPHRD_PHONET_PIPE +ARPHRD_CAIF +ARPHRD_IP6GRE +ARPHRD_NETLINK +ARPHRD_6LOWPAN +ARPHRD_VOID +ARPHRD_NONE diff --git a/xlat/at_flags.h b/xlat/at_flags.h index cbee3d24..5bebc0bc 100644 --- a/xlat/at_flags.h +++ b/xlat/at_flags.h @@ -1,20 +1,29 @@ /* Generated by ./xlat/gen.sh from ./xlat/at_flags.in; do not edit. */ - -static const struct xlat at_flags[] = { -#if defined(AT_SYMLINK_NOFOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_NOFOLLOW) && HAVE_DECL_AT_SYMLINK_NOFOLLOW) - XLAT(AT_SYMLINK_NOFOLLOW), +#if !(defined(AT_SYMLINK_NOFOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_NOFOLLOW) && HAVE_DECL_AT_SYMLINK_NOFOLLOW)) +# define AT_SYMLINK_NOFOLLOW 0x100 #endif -#if defined(AT_REMOVEDIR) || (defined(HAVE_DECL_AT_REMOVEDIR) && HAVE_DECL_AT_REMOVEDIR) - XLAT(AT_REMOVEDIR), +#if !(defined(AT_REMOVEDIR) || (defined(HAVE_DECL_AT_REMOVEDIR) && HAVE_DECL_AT_REMOVEDIR)) +# define AT_REMOVEDIR 0x200 #endif -#if defined(AT_SYMLINK_FOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_FOLLOW) && HAVE_DECL_AT_SYMLINK_FOLLOW) - XLAT(AT_SYMLINK_FOLLOW), +#if !(defined(AT_SYMLINK_FOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_FOLLOW) && HAVE_DECL_AT_SYMLINK_FOLLOW)) +# define AT_SYMLINK_FOLLOW 0x400 #endif -#if defined(AT_NO_AUTOMOUNT) || (defined(HAVE_DECL_AT_NO_AUTOMOUNT) && HAVE_DECL_AT_NO_AUTOMOUNT) - XLAT(AT_NO_AUTOMOUNT), +#if !(defined(AT_NO_AUTOMOUNT) || (defined(HAVE_DECL_AT_NO_AUTOMOUNT) && HAVE_DECL_AT_NO_AUTOMOUNT)) +# define AT_NO_AUTOMOUNT 0x800 #endif -#if defined(AT_EMPTY_PATH) || (defined(HAVE_DECL_AT_EMPTY_PATH) && HAVE_DECL_AT_EMPTY_PATH) - XLAT(AT_EMPTY_PATH), +#if !(defined(AT_EMPTY_PATH) || (defined(HAVE_DECL_AT_EMPTY_PATH) && HAVE_DECL_AT_EMPTY_PATH)) +# define AT_EMPTY_PATH 0x1000 #endif - XLAT_END + +#ifndef IN_MPERS + +const struct xlat at_flags[] = { + XLAT(AT_SYMLINK_NOFOLLOW), + XLAT(AT_REMOVEDIR), + XLAT(AT_SYMLINK_FOLLOW), + XLAT(AT_NO_AUTOMOUNT), + XLAT(AT_EMPTY_PATH), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/at_flags.in b/xlat/at_flags.in index 1a790d59..77a8de9b 100644 --- a/xlat/at_flags.in +++ b/xlat/at_flags.in @@ -1,5 +1,5 @@ -AT_SYMLINK_NOFOLLOW -AT_REMOVEDIR -AT_SYMLINK_FOLLOW -AT_NO_AUTOMOUNT -AT_EMPTY_PATH +AT_SYMLINK_NOFOLLOW 0x100 +AT_REMOVEDIR 0x200 +AT_SYMLINK_FOLLOW 0x400 +AT_NO_AUTOMOUNT 0x800 +AT_EMPTY_PATH 0x1000 diff --git a/xlat/atomic_ops.h b/xlat/atomic_ops.h index 83c3a609..224dfea1 100644 --- a/xlat/atomic_ops.h +++ b/xlat/atomic_ops.h @@ -1,6 +1,13 @@ /* Generated by ./xlat/gen.sh from ./xlat/atomic_ops.in; do not edit. */ -static const struct xlat atomic_ops[] = { +#ifdef IN_MPERS + +# error static const struct xlat atomic_ops in mpers mode + +#else + +static +const struct xlat atomic_ops[] = { { OR1K_ATOMIC_SWAP, "SWAP" }, { OR1K_ATOMIC_CMPXCHG, "CMPXCHG" }, { OR1K_ATOMIC_XCHG, "XCHG" }, @@ -10,5 +17,7 @@ static const struct xlat atomic_ops[] = { { OR1K_ATOMIC_OR, "OR" }, { OR1K_ATOMIC_UMAX, "UMAX" }, { OR1K_ATOMIC_UMIN, "UMIN" }, - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/audit_arch.h b/xlat/audit_arch.h new file mode 100644 index 00000000..16d39473 --- /dev/null +++ b/xlat/audit_arch.h @@ -0,0 +1,129 @@ +/* Generated by ./xlat/gen.sh from ./xlat/audit_arch.in; do not edit. */ +#ifdef EM_ARM +#endif +#ifdef EM_FRV +#endif +#ifdef EM_MICROBLAZE +#endif +#ifdef EM_OPENRISC +#endif + +#ifdef IN_MPERS + +extern const struct xlat audit_arch[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat audit_arch[] = { +/* linux used to have linux/elf-em.h out of sync with linux/audit.h */ +#if defined(AUDIT_ARCH_AARCH64) || (defined(HAVE_DECL_AUDIT_ARCH_AARCH64) && HAVE_DECL_AUDIT_ARCH_AARCH64) + XLAT(AUDIT_ARCH_AARCH64), +#endif +#if defined(AUDIT_ARCH_ALPHA) || (defined(HAVE_DECL_AUDIT_ARCH_ALPHA) && HAVE_DECL_AUDIT_ARCH_ALPHA) + XLAT(AUDIT_ARCH_ALPHA), +#endif +#ifdef EM_ARM +#if defined(AUDIT_ARCH_ARM) || (defined(HAVE_DECL_AUDIT_ARCH_ARM) && HAVE_DECL_AUDIT_ARCH_ARM) + XLAT(AUDIT_ARCH_ARM), +#endif +#if defined(AUDIT_ARCH_ARMEB) || (defined(HAVE_DECL_AUDIT_ARCH_ARMEB) && HAVE_DECL_AUDIT_ARCH_ARMEB) + XLAT(AUDIT_ARCH_ARMEB), +#endif +#endif +#if defined(AUDIT_ARCH_CRIS) || (defined(HAVE_DECL_AUDIT_ARCH_CRIS) && HAVE_DECL_AUDIT_ARCH_CRIS) + XLAT(AUDIT_ARCH_CRIS), +#endif +#ifdef EM_FRV +#if defined(AUDIT_ARCH_FRV) || (defined(HAVE_DECL_AUDIT_ARCH_FRV) && HAVE_DECL_AUDIT_ARCH_FRV) + XLAT(AUDIT_ARCH_FRV), +#endif +#endif +#if defined(AUDIT_ARCH_I386) || (defined(HAVE_DECL_AUDIT_ARCH_I386) && HAVE_DECL_AUDIT_ARCH_I386) + XLAT(AUDIT_ARCH_I386), +#endif +#if defined(AUDIT_ARCH_IA64) || (defined(HAVE_DECL_AUDIT_ARCH_IA64) && HAVE_DECL_AUDIT_ARCH_IA64) + XLAT(AUDIT_ARCH_IA64), +#endif +#if defined(AUDIT_ARCH_M32R) || (defined(HAVE_DECL_AUDIT_ARCH_M32R) && HAVE_DECL_AUDIT_ARCH_M32R) + XLAT(AUDIT_ARCH_M32R), +#endif +#if defined(AUDIT_ARCH_M68K) || (defined(HAVE_DECL_AUDIT_ARCH_M68K) && HAVE_DECL_AUDIT_ARCH_M68K) + XLAT(AUDIT_ARCH_M68K), +#endif +#ifdef EM_MICROBLAZE +#if defined(AUDIT_ARCH_MICROBLAZE) || (defined(HAVE_DECL_AUDIT_ARCH_MICROBLAZE) && HAVE_DECL_AUDIT_ARCH_MICROBLAZE) + XLAT(AUDIT_ARCH_MICROBLAZE), +#endif +#endif +#if defined(AUDIT_ARCH_MIPS) || (defined(HAVE_DECL_AUDIT_ARCH_MIPS) && HAVE_DECL_AUDIT_ARCH_MIPS) + XLAT(AUDIT_ARCH_MIPS), +#endif +#if defined(AUDIT_ARCH_MIPS64) || (defined(HAVE_DECL_AUDIT_ARCH_MIPS64) && HAVE_DECL_AUDIT_ARCH_MIPS64) + XLAT(AUDIT_ARCH_MIPS64), +#endif +#if defined(AUDIT_ARCH_MIPS64N32) || (defined(HAVE_DECL_AUDIT_ARCH_MIPS64N32) && HAVE_DECL_AUDIT_ARCH_MIPS64N32) + XLAT(AUDIT_ARCH_MIPS64N32), +#endif +#if defined(AUDIT_ARCH_MIPSEL) || (defined(HAVE_DECL_AUDIT_ARCH_MIPSEL) && HAVE_DECL_AUDIT_ARCH_MIPSEL) + XLAT(AUDIT_ARCH_MIPSEL), +#endif +#if defined(AUDIT_ARCH_MIPSEL64) || (defined(HAVE_DECL_AUDIT_ARCH_MIPSEL64) && HAVE_DECL_AUDIT_ARCH_MIPSEL64) + XLAT(AUDIT_ARCH_MIPSEL64), +#endif +#if defined(AUDIT_ARCH_MIPSEL64N32) || (defined(HAVE_DECL_AUDIT_ARCH_MIPSEL64N32) && HAVE_DECL_AUDIT_ARCH_MIPSEL64N32) + XLAT(AUDIT_ARCH_MIPSEL64N32), +#endif +#ifdef EM_OPENRISC +#if defined(AUDIT_ARCH_OPENRISC) || (defined(HAVE_DECL_AUDIT_ARCH_OPENRISC) && HAVE_DECL_AUDIT_ARCH_OPENRISC) + XLAT(AUDIT_ARCH_OPENRISC), +#endif +#endif +#if defined(AUDIT_ARCH_PARISC) || (defined(HAVE_DECL_AUDIT_ARCH_PARISC) && HAVE_DECL_AUDIT_ARCH_PARISC) + XLAT(AUDIT_ARCH_PARISC), +#endif +#if defined(AUDIT_ARCH_PARISC64) || (defined(HAVE_DECL_AUDIT_ARCH_PARISC64) && HAVE_DECL_AUDIT_ARCH_PARISC64) + XLAT(AUDIT_ARCH_PARISC64), +#endif +#if defined(AUDIT_ARCH_PPC) || (defined(HAVE_DECL_AUDIT_ARCH_PPC) && HAVE_DECL_AUDIT_ARCH_PPC) + XLAT(AUDIT_ARCH_PPC), +#endif +#if defined(AUDIT_ARCH_PPC64) || (defined(HAVE_DECL_AUDIT_ARCH_PPC64) && HAVE_DECL_AUDIT_ARCH_PPC64) + XLAT(AUDIT_ARCH_PPC64), +#endif +#if defined(AUDIT_ARCH_PPC64LE) || (defined(HAVE_DECL_AUDIT_ARCH_PPC64LE) && HAVE_DECL_AUDIT_ARCH_PPC64LE) + XLAT(AUDIT_ARCH_PPC64LE), +#endif +#if defined(AUDIT_ARCH_S390) || (defined(HAVE_DECL_AUDIT_ARCH_S390) && HAVE_DECL_AUDIT_ARCH_S390) + XLAT(AUDIT_ARCH_S390), +#endif +#if defined(AUDIT_ARCH_S390X) || (defined(HAVE_DECL_AUDIT_ARCH_S390X) && HAVE_DECL_AUDIT_ARCH_S390X) + XLAT(AUDIT_ARCH_S390X), +#endif +#if defined(AUDIT_ARCH_SH) || (defined(HAVE_DECL_AUDIT_ARCH_SH) && HAVE_DECL_AUDIT_ARCH_SH) + XLAT(AUDIT_ARCH_SH), +#endif +#if defined(AUDIT_ARCH_SH64) || (defined(HAVE_DECL_AUDIT_ARCH_SH64) && HAVE_DECL_AUDIT_ARCH_SH64) + XLAT(AUDIT_ARCH_SH64), +#endif +#if defined(AUDIT_ARCH_SHEL) || (defined(HAVE_DECL_AUDIT_ARCH_SHEL) && HAVE_DECL_AUDIT_ARCH_SHEL) + XLAT(AUDIT_ARCH_SHEL), +#endif +#if defined(AUDIT_ARCH_SHEL64) || (defined(HAVE_DECL_AUDIT_ARCH_SHEL64) && HAVE_DECL_AUDIT_ARCH_SHEL64) + XLAT(AUDIT_ARCH_SHEL64), +#endif +#if defined(AUDIT_ARCH_SPARC) || (defined(HAVE_DECL_AUDIT_ARCH_SPARC) && HAVE_DECL_AUDIT_ARCH_SPARC) + XLAT(AUDIT_ARCH_SPARC), +#endif +#if defined(AUDIT_ARCH_SPARC64) || (defined(HAVE_DECL_AUDIT_ARCH_SPARC64) && HAVE_DECL_AUDIT_ARCH_SPARC64) + XLAT(AUDIT_ARCH_SPARC64), +#endif +#if defined(AUDIT_ARCH_X86_64) || (defined(HAVE_DECL_AUDIT_ARCH_X86_64) && HAVE_DECL_AUDIT_ARCH_X86_64) + XLAT(AUDIT_ARCH_X86_64), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/audit_arch.in b/xlat/audit_arch.in new file mode 100644 index 00000000..e0b3db39 --- /dev/null +++ b/xlat/audit_arch.in @@ -0,0 +1,41 @@ +/* linux used to have linux/elf-em.h out of sync with linux/audit.h */ +AUDIT_ARCH_AARCH64 +AUDIT_ARCH_ALPHA +#ifdef EM_ARM +AUDIT_ARCH_ARM +AUDIT_ARCH_ARMEB +#endif +AUDIT_ARCH_CRIS +#ifdef EM_FRV +AUDIT_ARCH_FRV +#endif +AUDIT_ARCH_I386 +AUDIT_ARCH_IA64 +AUDIT_ARCH_M32R +AUDIT_ARCH_M68K +#ifdef EM_MICROBLAZE +AUDIT_ARCH_MICROBLAZE +#endif +AUDIT_ARCH_MIPS +AUDIT_ARCH_MIPS64 +AUDIT_ARCH_MIPS64N32 +AUDIT_ARCH_MIPSEL +AUDIT_ARCH_MIPSEL64 +AUDIT_ARCH_MIPSEL64N32 +#ifdef EM_OPENRISC +AUDIT_ARCH_OPENRISC +#endif +AUDIT_ARCH_PARISC +AUDIT_ARCH_PARISC64 +AUDIT_ARCH_PPC +AUDIT_ARCH_PPC64 +AUDIT_ARCH_PPC64LE +AUDIT_ARCH_S390 +AUDIT_ARCH_S390X +AUDIT_ARCH_SH +AUDIT_ARCH_SH64 +AUDIT_ARCH_SHEL +AUDIT_ARCH_SHEL64 +AUDIT_ARCH_SPARC +AUDIT_ARCH_SPARC64 +AUDIT_ARCH_X86_64 diff --git a/xlat/baud_options.h b/xlat/baud_options.h index aff9b859..0ea7336f 100644 --- a/xlat/baud_options.h +++ b/xlat/baud_options.h @@ -1,104 +1,113 @@ /* Generated by ./xlat/gen.sh from ./xlat/baud_options.in; do not edit. */ -static const struct xlat baud_options[] = { +#ifdef IN_MPERS + +# error static const struct xlat baud_options in mpers mode + +#else + +static +const struct xlat baud_options[] = { #if defined(B0) || (defined(HAVE_DECL_B0) && HAVE_DECL_B0) - XLAT(B0), + XLAT(B0), #endif #if defined(B50) || (defined(HAVE_DECL_B50) && HAVE_DECL_B50) - XLAT(B50), + XLAT(B50), #endif #if defined(B75) || (defined(HAVE_DECL_B75) && HAVE_DECL_B75) - XLAT(B75), + XLAT(B75), #endif #if defined(B110) || (defined(HAVE_DECL_B110) && HAVE_DECL_B110) - XLAT(B110), + XLAT(B110), #endif #if defined(B134) || (defined(HAVE_DECL_B134) && HAVE_DECL_B134) - XLAT(B134), + XLAT(B134), #endif #if defined(B150) || (defined(HAVE_DECL_B150) && HAVE_DECL_B150) - XLAT(B150), + XLAT(B150), #endif #if defined(B200) || (defined(HAVE_DECL_B200) && HAVE_DECL_B200) - XLAT(B200), + XLAT(B200), #endif #if defined(B300) || (defined(HAVE_DECL_B300) && HAVE_DECL_B300) - XLAT(B300), + XLAT(B300), #endif #if defined(B600) || (defined(HAVE_DECL_B600) && HAVE_DECL_B600) - XLAT(B600), + XLAT(B600), #endif #if defined(B1200) || (defined(HAVE_DECL_B1200) && HAVE_DECL_B1200) - XLAT(B1200), + XLAT(B1200), #endif #if defined(B1800) || (defined(HAVE_DECL_B1800) && HAVE_DECL_B1800) - XLAT(B1800), + XLAT(B1800), #endif #if defined(B2400) || (defined(HAVE_DECL_B2400) && HAVE_DECL_B2400) - XLAT(B2400), + XLAT(B2400), #endif #if defined(B4800) || (defined(HAVE_DECL_B4800) && HAVE_DECL_B4800) - XLAT(B4800), + XLAT(B4800), #endif #if defined(B9600) || (defined(HAVE_DECL_B9600) && HAVE_DECL_B9600) - XLAT(B9600), + XLAT(B9600), #endif #if defined(B19200) || (defined(HAVE_DECL_B19200) && HAVE_DECL_B19200) - XLAT(B19200), + XLAT(B19200), #endif #if defined(B38400) || (defined(HAVE_DECL_B38400) && HAVE_DECL_B38400) - XLAT(B38400), + XLAT(B38400), #endif #if defined(B57600) || (defined(HAVE_DECL_B57600) && HAVE_DECL_B57600) - XLAT(B57600), + XLAT(B57600), #endif #if defined(B115200) || (defined(HAVE_DECL_B115200) && HAVE_DECL_B115200) - XLAT(B115200), + XLAT(B115200), #endif #if defined(B230400) || (defined(HAVE_DECL_B230400) && HAVE_DECL_B230400) - XLAT(B230400), + XLAT(B230400), #endif #if defined(B460800) || (defined(HAVE_DECL_B460800) && HAVE_DECL_B460800) - XLAT(B460800), + XLAT(B460800), #endif #if defined(B500000) || (defined(HAVE_DECL_B500000) && HAVE_DECL_B500000) - XLAT(B500000), + XLAT(B500000), #endif #if defined(B576000) || (defined(HAVE_DECL_B576000) && HAVE_DECL_B576000) - XLAT(B576000), + XLAT(B576000), #endif #if defined(B921600) || (defined(HAVE_DECL_B921600) && HAVE_DECL_B921600) - XLAT(B921600), + XLAT(B921600), #endif #if defined(B1000000) || (defined(HAVE_DECL_B1000000) && HAVE_DECL_B1000000) - XLAT(B1000000), + XLAT(B1000000), #endif #if defined(B1152000) || (defined(HAVE_DECL_B1152000) && HAVE_DECL_B1152000) - XLAT(B1152000), + XLAT(B1152000), #endif #if defined(B1500000) || (defined(HAVE_DECL_B1500000) && HAVE_DECL_B1500000) - XLAT(B1500000), + XLAT(B1500000), #endif #if defined(B2000000) || (defined(HAVE_DECL_B2000000) && HAVE_DECL_B2000000) - XLAT(B2000000), + XLAT(B2000000), #endif #if defined(B2500000) || (defined(HAVE_DECL_B2500000) && HAVE_DECL_B2500000) - XLAT(B2500000), + XLAT(B2500000), #endif #if defined(B3000000) || (defined(HAVE_DECL_B3000000) && HAVE_DECL_B3000000) - XLAT(B3000000), + XLAT(B3000000), #endif #if defined(B3500000) || (defined(HAVE_DECL_B3500000) && HAVE_DECL_B3500000) - XLAT(B3500000), + XLAT(B3500000), #endif #if defined(B4000000) || (defined(HAVE_DECL_B4000000) && HAVE_DECL_B4000000) - XLAT(B4000000), + XLAT(B4000000), #endif #if defined(EXTA) || (defined(HAVE_DECL_EXTA) && HAVE_DECL_EXTA) - XLAT(EXTA), + XLAT(EXTA), #endif #if defined(EXTB) || (defined(HAVE_DECL_EXTB) && HAVE_DECL_EXTB) - XLAT(EXTB), + XLAT(EXTB), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/blkpg_ops.h b/xlat/blkpg_ops.h index cde13154..bc36705e 100644 --- a/xlat/blkpg_ops.h +++ b/xlat/blkpg_ops.h @@ -1,11 +1,28 @@ /* Generated by ./xlat/gen.sh from ./xlat/blkpg_ops.in; do not edit. */ - -static const struct xlat blkpg_ops[] = { -#if defined(BLKPG_ADD_PARTITION) || (defined(HAVE_DECL_BLKPG_ADD_PARTITION) && HAVE_DECL_BLKPG_ADD_PARTITION) - XLAT(BLKPG_ADD_PARTITION), +#if !(defined(BLKPG_ADD_PARTITION) || (defined(HAVE_DECL_BLKPG_ADD_PARTITION) && HAVE_DECL_BLKPG_ADD_PARTITION)) +# define BLKPG_ADD_PARTITION 1 +#endif +#if !(defined(BLKPG_DEL_PARTITION) || (defined(HAVE_DECL_BLKPG_DEL_PARTITION) && HAVE_DECL_BLKPG_DEL_PARTITION)) +# define BLKPG_DEL_PARTITION 2 #endif -#if defined(BLKPG_DEL_PARTITION) || (defined(HAVE_DECL_BLKPG_DEL_PARTITION) && HAVE_DECL_BLKPG_DEL_PARTITION) - XLAT(BLKPG_DEL_PARTITION), +#if !(defined(BLKPG_RESIZE_PARTITION) || (defined(HAVE_DECL_BLKPG_RESIZE_PARTITION) && HAVE_DECL_BLKPG_RESIZE_PARTITION)) +# define BLKPG_RESIZE_PARTITION 3 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat blkpg_ops[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat blkpg_ops[] = { + XLAT(BLKPG_ADD_PARTITION), + XLAT(BLKPG_DEL_PARTITION), + XLAT(BLKPG_RESIZE_PARTITION), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/blkpg_ops.in b/xlat/blkpg_ops.in index 75f6f70d..fb194de5 100644 --- a/xlat/blkpg_ops.in +++ b/xlat/blkpg_ops.in @@ -1,2 +1,3 @@ -BLKPG_ADD_PARTITION -BLKPG_DEL_PARTITION +BLKPG_ADD_PARTITION 1 +BLKPG_DEL_PARTITION 2 +BLKPG_RESIZE_PARTITION 3 diff --git a/xlat/bootflags1.h b/xlat/bootflags1.h index 05a01b28..fb271408 100644 --- a/xlat/bootflags1.h +++ b/xlat/bootflags1.h @@ -1,8 +1,18 @@ /* Generated by ./xlat/gen.sh from ./xlat/bootflags1.in; do not edit. */ - -static const struct xlat bootflags1[] = { -#if defined(LINUX_REBOOT_MAGIC1) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC1) && HAVE_DECL_LINUX_REBOOT_MAGIC1) - XLAT(LINUX_REBOOT_MAGIC1), +#if !(defined(LINUX_REBOOT_MAGIC1) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC1) && HAVE_DECL_LINUX_REBOOT_MAGIC1)) +# define LINUX_REBOOT_MAGIC1 0xfee1dead #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat bootflags1 in mpers mode + +#else + +static +const struct xlat bootflags1[] = { + XLAT(LINUX_REBOOT_MAGIC1), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/bootflags1.in b/xlat/bootflags1.in index d2b5f9f6..42048231 100644 --- a/xlat/bootflags1.in +++ b/xlat/bootflags1.in @@ -1 +1 @@ -LINUX_REBOOT_MAGIC1 +LINUX_REBOOT_MAGIC1 0xfee1dead diff --git a/xlat/bootflags2.h b/xlat/bootflags2.h index f2405109..612aae18 100644 --- a/xlat/bootflags2.h +++ b/xlat/bootflags2.h @@ -1,17 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/bootflags2.in; do not edit. */ - -static const struct xlat bootflags2[] = { -#if defined(LINUX_REBOOT_MAGIC2) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2) && HAVE_DECL_LINUX_REBOOT_MAGIC2) - XLAT(LINUX_REBOOT_MAGIC2), +#if !(defined(LINUX_REBOOT_MAGIC2) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2) && HAVE_DECL_LINUX_REBOOT_MAGIC2)) +# define LINUX_REBOOT_MAGIC2 672274793 #endif -#if defined(LINUX_REBOOT_MAGIC2A) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2A) && HAVE_DECL_LINUX_REBOOT_MAGIC2A) - XLAT(LINUX_REBOOT_MAGIC2A), +#if !(defined(LINUX_REBOOT_MAGIC2A) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2A) && HAVE_DECL_LINUX_REBOOT_MAGIC2A)) +# define LINUX_REBOOT_MAGIC2A 85072278 #endif -#if defined(LINUX_REBOOT_MAGIC2B) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2B) && HAVE_DECL_LINUX_REBOOT_MAGIC2B) - XLAT(LINUX_REBOOT_MAGIC2B), +#if !(defined(LINUX_REBOOT_MAGIC2B) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2B) && HAVE_DECL_LINUX_REBOOT_MAGIC2B)) +# define LINUX_REBOOT_MAGIC2B 369367448 #endif -#if defined(LINUX_REBOOT_MAGIC2C) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2C) && HAVE_DECL_LINUX_REBOOT_MAGIC2C) - XLAT(LINUX_REBOOT_MAGIC2C), +#if !(defined(LINUX_REBOOT_MAGIC2C) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2C) && HAVE_DECL_LINUX_REBOOT_MAGIC2C)) +# define LINUX_REBOOT_MAGIC2C 537993216 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat bootflags2 in mpers mode + +#else + +static +const struct xlat bootflags2[] = { + XLAT(LINUX_REBOOT_MAGIC2), + XLAT(LINUX_REBOOT_MAGIC2A), + XLAT(LINUX_REBOOT_MAGIC2B), + XLAT(LINUX_REBOOT_MAGIC2C), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/bootflags2.in b/xlat/bootflags2.in index 56ad023d..8daa342e 100644 --- a/xlat/bootflags2.in +++ b/xlat/bootflags2.in @@ -1,4 +1,4 @@ -LINUX_REBOOT_MAGIC2 -LINUX_REBOOT_MAGIC2A -LINUX_REBOOT_MAGIC2B -LINUX_REBOOT_MAGIC2C +LINUX_REBOOT_MAGIC2 672274793 +LINUX_REBOOT_MAGIC2A 85072278 +LINUX_REBOOT_MAGIC2B 369367448 +LINUX_REBOOT_MAGIC2C 537993216 diff --git a/xlat/bootflags3.h b/xlat/bootflags3.h index 5f50120a..47ea9cf2 100644 --- a/xlat/bootflags3.h +++ b/xlat/bootflags3.h @@ -1,29 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/bootflags3.in; do not edit. */ - -static const struct xlat bootflags3[] = { -#if defined(LINUX_REBOOT_CMD_RESTART) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART) - XLAT(LINUX_REBOOT_CMD_RESTART), +#if !(defined(LINUX_REBOOT_CMD_RESTART) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART)) +# define LINUX_REBOOT_CMD_RESTART 0x01234567 #endif -#if defined(LINUX_REBOOT_CMD_HALT) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_HALT) && HAVE_DECL_LINUX_REBOOT_CMD_HALT) - XLAT(LINUX_REBOOT_CMD_HALT), +#if !(defined(LINUX_REBOOT_CMD_HALT) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_HALT) && HAVE_DECL_LINUX_REBOOT_CMD_HALT)) +# define LINUX_REBOOT_CMD_HALT 0xCDEF0123 #endif -#if defined(LINUX_REBOOT_CMD_CAD_ON) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON) - XLAT(LINUX_REBOOT_CMD_CAD_ON), +#if !(defined(LINUX_REBOOT_CMD_CAD_ON) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON)) +# define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF #endif -#if defined(LINUX_REBOOT_CMD_CAD_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF) - XLAT(LINUX_REBOOT_CMD_CAD_OFF), +#if !(defined(LINUX_REBOOT_CMD_CAD_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF)) +# define LINUX_REBOOT_CMD_CAD_OFF 0x00000000 #endif -#if defined(LINUX_REBOOT_CMD_POWER_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF) - XLAT(LINUX_REBOOT_CMD_POWER_OFF), +#if !(defined(LINUX_REBOOT_CMD_POWER_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF)) +# define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC #endif -#if defined(LINUX_REBOOT_CMD_RESTART2) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART2) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART2) - XLAT(LINUX_REBOOT_CMD_RESTART2), +#if !(defined(LINUX_REBOOT_CMD_RESTART2) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART2) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART2)) +# define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 #endif -#if defined(LINUX_REBOOT_CMD_SW_SUSPEND) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND) && HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND) - XLAT(LINUX_REBOOT_CMD_SW_SUSPEND), +#if !(defined(LINUX_REBOOT_CMD_SW_SUSPEND) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND) && HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND)) +# define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2 #endif -#if defined(LINUX_REBOOT_CMD_KEXEC) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_KEXEC) && HAVE_DECL_LINUX_REBOOT_CMD_KEXEC) - XLAT(LINUX_REBOOT_CMD_KEXEC), +#if !(defined(LINUX_REBOOT_CMD_KEXEC) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_KEXEC) && HAVE_DECL_LINUX_REBOOT_CMD_KEXEC)) +# define LINUX_REBOOT_CMD_KEXEC 0x45584543 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat bootflags3 in mpers mode + +#else + +static +const struct xlat bootflags3[] = { + XLAT(LINUX_REBOOT_CMD_RESTART), + XLAT(LINUX_REBOOT_CMD_HALT), + XLAT(LINUX_REBOOT_CMD_CAD_ON), + XLAT(LINUX_REBOOT_CMD_CAD_OFF), + XLAT(LINUX_REBOOT_CMD_POWER_OFF), + XLAT(LINUX_REBOOT_CMD_RESTART2), + XLAT(LINUX_REBOOT_CMD_SW_SUSPEND), + XLAT(LINUX_REBOOT_CMD_KEXEC), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/bootflags3.in b/xlat/bootflags3.in index d13ab87d..c0337e89 100644 --- a/xlat/bootflags3.in +++ b/xlat/bootflags3.in @@ -1,8 +1,8 @@ -LINUX_REBOOT_CMD_RESTART -LINUX_REBOOT_CMD_HALT -LINUX_REBOOT_CMD_CAD_ON -LINUX_REBOOT_CMD_CAD_OFF -LINUX_REBOOT_CMD_POWER_OFF -LINUX_REBOOT_CMD_RESTART2 -LINUX_REBOOT_CMD_SW_SUSPEND -LINUX_REBOOT_CMD_KEXEC +LINUX_REBOOT_CMD_RESTART 0x01234567 +LINUX_REBOOT_CMD_HALT 0xCDEF0123 +LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF +LINUX_REBOOT_CMD_CAD_OFF 0x00000000 +LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC +LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 +LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2 +LINUX_REBOOT_CMD_KEXEC 0x45584543 diff --git a/xlat/bpf_attach_type.h b/xlat/bpf_attach_type.h new file mode 100644 index 00000000..26745533 --- /dev/null +++ b/xlat/bpf_attach_type.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_attach_type.in; do not edit. */ +#if !(defined(BPF_CGROUP_INET_INGRESS) || (defined(HAVE_DECL_BPF_CGROUP_INET_INGRESS) && HAVE_DECL_BPF_CGROUP_INET_INGRESS)) +# define BPF_CGROUP_INET_INGRESS 0 +#endif +#if !(defined(BPF_CGROUP_INET_EGRESS) || (defined(HAVE_DECL_BPF_CGROUP_INET_EGRESS) && HAVE_DECL_BPF_CGROUP_INET_EGRESS)) +# define BPF_CGROUP_INET_EGRESS 1 +#endif +#if !(defined(BPF_CGROUP_INET_SOCK_CREATE) || (defined(HAVE_DECL_BPF_CGROUP_INET_SOCK_CREATE) && HAVE_DECL_BPF_CGROUP_INET_SOCK_CREATE)) +# define BPF_CGROUP_INET_SOCK_CREATE 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat bpf_attach_type in mpers mode + +#else + +static +const struct xlat bpf_attach_type[] = { + XLAT(BPF_CGROUP_INET_INGRESS), + XLAT(BPF_CGROUP_INET_EGRESS), + XLAT(BPF_CGROUP_INET_SOCK_CREATE), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_attach_type.in b/xlat/bpf_attach_type.in new file mode 100644 index 00000000..f78bc5be --- /dev/null +++ b/xlat/bpf_attach_type.in @@ -0,0 +1,3 @@ +BPF_CGROUP_INET_INGRESS 0 +BPF_CGROUP_INET_EGRESS 1 +BPF_CGROUP_INET_SOCK_CREATE 2 diff --git a/xlat/bpf_class.h b/xlat/bpf_class.h new file mode 100644 index 00000000..bdabc9a3 --- /dev/null +++ b/xlat/bpf_class.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_class.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_class in mpers mode + +#else + +static +const struct xlat bpf_class[] = { +#if defined(BPF_LD) || (defined(HAVE_DECL_BPF_LD) && HAVE_DECL_BPF_LD) + XLAT(BPF_LD), +#endif +#if defined(BPF_LDX) || (defined(HAVE_DECL_BPF_LDX) && HAVE_DECL_BPF_LDX) + XLAT(BPF_LDX), +#endif +#if defined(BPF_ST) || (defined(HAVE_DECL_BPF_ST) && HAVE_DECL_BPF_ST) + XLAT(BPF_ST), +#endif +#if defined(BPF_STX) || (defined(HAVE_DECL_BPF_STX) && HAVE_DECL_BPF_STX) + XLAT(BPF_STX), +#endif +#if defined(BPF_ALU) || (defined(HAVE_DECL_BPF_ALU) && HAVE_DECL_BPF_ALU) + XLAT(BPF_ALU), +#endif +#if defined(BPF_JMP) || (defined(HAVE_DECL_BPF_JMP) && HAVE_DECL_BPF_JMP) + XLAT(BPF_JMP), +#endif +#if defined(BPF_RET) || (defined(HAVE_DECL_BPF_RET) && HAVE_DECL_BPF_RET) + XLAT(BPF_RET), +#endif +#if defined(BPF_MISC) || (defined(HAVE_DECL_BPF_MISC) && HAVE_DECL_BPF_MISC) + XLAT(BPF_MISC), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_class.in b/xlat/bpf_class.in new file mode 100644 index 00000000..f8bd3d7f --- /dev/null +++ b/xlat/bpf_class.in @@ -0,0 +1,8 @@ +BPF_LD +BPF_LDX +BPF_ST +BPF_STX +BPF_ALU +BPF_JMP +BPF_RET +BPF_MISC diff --git a/xlat/bpf_commands.h b/xlat/bpf_commands.h new file mode 100644 index 00000000..a498ee35 --- /dev/null +++ b/xlat/bpf_commands.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_commands.in; do not edit. */ +#if !(defined(BPF_MAP_CREATE) || (defined(HAVE_DECL_BPF_MAP_CREATE) && HAVE_DECL_BPF_MAP_CREATE)) +# define BPF_MAP_CREATE 0 +#endif +#if !(defined(BPF_MAP_LOOKUP_ELEM) || (defined(HAVE_DECL_BPF_MAP_LOOKUP_ELEM) && HAVE_DECL_BPF_MAP_LOOKUP_ELEM)) +# define BPF_MAP_LOOKUP_ELEM 1 +#endif +#if !(defined(BPF_MAP_UPDATE_ELEM) || (defined(HAVE_DECL_BPF_MAP_UPDATE_ELEM) && HAVE_DECL_BPF_MAP_UPDATE_ELEM)) +# define BPF_MAP_UPDATE_ELEM 2 +#endif +#if !(defined(BPF_MAP_DELETE_ELEM) || (defined(HAVE_DECL_BPF_MAP_DELETE_ELEM) && HAVE_DECL_BPF_MAP_DELETE_ELEM)) +# define BPF_MAP_DELETE_ELEM 3 +#endif +#if !(defined(BPF_MAP_GET_NEXT_KEY) || (defined(HAVE_DECL_BPF_MAP_GET_NEXT_KEY) && HAVE_DECL_BPF_MAP_GET_NEXT_KEY)) +# define BPF_MAP_GET_NEXT_KEY 4 +#endif +#if !(defined(BPF_PROG_LOAD) || (defined(HAVE_DECL_BPF_PROG_LOAD) && HAVE_DECL_BPF_PROG_LOAD)) +# define BPF_PROG_LOAD 5 +#endif +#if !(defined(BPF_OBJ_PIN) || (defined(HAVE_DECL_BPF_OBJ_PIN) && HAVE_DECL_BPF_OBJ_PIN)) +# define BPF_OBJ_PIN 6 +#endif +#if !(defined(BPF_OBJ_GET) || (defined(HAVE_DECL_BPF_OBJ_GET) && HAVE_DECL_BPF_OBJ_GET)) +# define BPF_OBJ_GET 7 +#endif +#if !(defined(BPF_PROG_ATTACH) || (defined(HAVE_DECL_BPF_PROG_ATTACH) && HAVE_DECL_BPF_PROG_ATTACH)) +# define BPF_PROG_ATTACH 8 +#endif +#if !(defined(BPF_PROG_DETACH) || (defined(HAVE_DECL_BPF_PROG_DETACH) && HAVE_DECL_BPF_PROG_DETACH)) +# define BPF_PROG_DETACH 9 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat bpf_commands in mpers mode + +#else + +static +const struct xlat bpf_commands[] = { + XLAT(BPF_MAP_CREATE), + XLAT(BPF_MAP_LOOKUP_ELEM), + XLAT(BPF_MAP_UPDATE_ELEM), + XLAT(BPF_MAP_DELETE_ELEM), + XLAT(BPF_MAP_GET_NEXT_KEY), + XLAT(BPF_PROG_LOAD), + XLAT(BPF_OBJ_PIN), + XLAT(BPF_OBJ_GET), + XLAT(BPF_PROG_ATTACH), + XLAT(BPF_PROG_DETACH), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_commands.in b/xlat/bpf_commands.in new file mode 100644 index 00000000..bcec9a5d --- /dev/null +++ b/xlat/bpf_commands.in @@ -0,0 +1,10 @@ +BPF_MAP_CREATE 0 +BPF_MAP_LOOKUP_ELEM 1 +BPF_MAP_UPDATE_ELEM 2 +BPF_MAP_DELETE_ELEM 3 +BPF_MAP_GET_NEXT_KEY 4 +BPF_PROG_LOAD 5 +BPF_OBJ_PIN 6 +BPF_OBJ_GET 7 +BPF_PROG_ATTACH 8 +BPF_PROG_DETACH 9 diff --git a/xlat/bpf_map_types.h b/xlat/bpf_map_types.h new file mode 100644 index 00000000..2544c89c --- /dev/null +++ b/xlat/bpf_map_types.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_map_types.in; do not edit. */ +#if !(defined(BPF_MAP_TYPE_UNSPEC) || (defined(HAVE_DECL_BPF_MAP_TYPE_UNSPEC) && HAVE_DECL_BPF_MAP_TYPE_UNSPEC)) +# define BPF_MAP_TYPE_UNSPEC 0 +#endif +#if !(defined(BPF_MAP_TYPE_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_HASH) && HAVE_DECL_BPF_MAP_TYPE_HASH)) +# define BPF_MAP_TYPE_HASH 1 +#endif +#if !(defined(BPF_MAP_TYPE_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_ARRAY)) +# define BPF_MAP_TYPE_ARRAY 2 +#endif +#if !(defined(BPF_MAP_TYPE_PROG_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PROG_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PROG_ARRAY)) +# define BPF_MAP_TYPE_PROG_ARRAY 3 +#endif +#if !(defined(BPF_MAP_TYPE_PERF_EVENT_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERF_EVENT_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PERF_EVENT_ARRAY)) +# define BPF_MAP_TYPE_PERF_EVENT_ARRAY 4 +#endif +#if !(defined(BPF_MAP_TYPE_PERCPU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERCPU_HASH) && HAVE_DECL_BPF_MAP_TYPE_PERCPU_HASH)) +# define BPF_MAP_TYPE_PERCPU_HASH 5 +#endif +#if !(defined(BPF_MAP_TYPE_PERCPU_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERCPU_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PERCPU_ARRAY)) +# define BPF_MAP_TYPE_PERCPU_ARRAY 6 +#endif +#if !(defined(BPF_MAP_TYPE_STACK_TRACE) || (defined(HAVE_DECL_BPF_MAP_TYPE_STACK_TRACE) && HAVE_DECL_BPF_MAP_TYPE_STACK_TRACE)) +# define BPF_MAP_TYPE_STACK_TRACE 7 +#endif +#if !(defined(BPF_MAP_TYPE_CGROUP_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_CGROUP_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_CGROUP_ARRAY)) +# define BPF_MAP_TYPE_CGROUP_ARRAY 8 +#endif +#if !(defined(BPF_MAP_TYPE_LRU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_LRU_HASH) && HAVE_DECL_BPF_MAP_TYPE_LRU_HASH)) +# define BPF_MAP_TYPE_LRU_HASH 9 +#endif +#if !(defined(BPF_MAP_TYPE_LRU_PERCPU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_LRU_PERCPU_HASH) && HAVE_DECL_BPF_MAP_TYPE_LRU_PERCPU_HASH)) +# define BPF_MAP_TYPE_LRU_PERCPU_HASH 10 +#endif +#if !(defined(BPF_MAP_TYPE_LPM_TRIE) || (defined(HAVE_DECL_BPF_MAP_TYPE_LPM_TRIE) && HAVE_DECL_BPF_MAP_TYPE_LPM_TRIE)) +# define BPF_MAP_TYPE_LPM_TRIE 11 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat bpf_map_types in mpers mode + +#else + +static +const struct xlat bpf_map_types[] = { + XLAT(BPF_MAP_TYPE_UNSPEC), + XLAT(BPF_MAP_TYPE_HASH), + XLAT(BPF_MAP_TYPE_ARRAY), + XLAT(BPF_MAP_TYPE_PROG_ARRAY), + XLAT(BPF_MAP_TYPE_PERF_EVENT_ARRAY), + XLAT(BPF_MAP_TYPE_PERCPU_HASH), + XLAT(BPF_MAP_TYPE_PERCPU_ARRAY), + XLAT(BPF_MAP_TYPE_STACK_TRACE), + XLAT(BPF_MAP_TYPE_CGROUP_ARRAY), + XLAT(BPF_MAP_TYPE_LRU_HASH), + XLAT(BPF_MAP_TYPE_LRU_PERCPU_HASH), + XLAT(BPF_MAP_TYPE_LPM_TRIE), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_map_types.in b/xlat/bpf_map_types.in new file mode 100644 index 00000000..e3222d38 --- /dev/null +++ b/xlat/bpf_map_types.in @@ -0,0 +1,12 @@ +BPF_MAP_TYPE_UNSPEC 0 +BPF_MAP_TYPE_HASH 1 +BPF_MAP_TYPE_ARRAY 2 +BPF_MAP_TYPE_PROG_ARRAY 3 +BPF_MAP_TYPE_PERF_EVENT_ARRAY 4 +BPF_MAP_TYPE_PERCPU_HASH 5 +BPF_MAP_TYPE_PERCPU_ARRAY 6 +BPF_MAP_TYPE_STACK_TRACE 7 +BPF_MAP_TYPE_CGROUP_ARRAY 8 +BPF_MAP_TYPE_LRU_HASH 9 +BPF_MAP_TYPE_LRU_PERCPU_HASH 10 +BPF_MAP_TYPE_LPM_TRIE 11 diff --git a/xlat/bpf_map_update_elem_flags.h b/xlat/bpf_map_update_elem_flags.h new file mode 100644 index 00000000..038863e6 --- /dev/null +++ b/xlat/bpf_map_update_elem_flags.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_map_update_elem_flags.in; do not edit. */ +#if !(defined(BPF_ANY) || (defined(HAVE_DECL_BPF_ANY) && HAVE_DECL_BPF_ANY)) +# define BPF_ANY 0 +#endif +#if !(defined(BPF_NOEXIST) || (defined(HAVE_DECL_BPF_NOEXIST) && HAVE_DECL_BPF_NOEXIST)) +# define BPF_NOEXIST 1 +#endif +#if !(defined(BPF_EXIST) || (defined(HAVE_DECL_BPF_EXIST) && HAVE_DECL_BPF_EXIST)) +# define BPF_EXIST 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat bpf_map_update_elem_flags in mpers mode + +#else + +static +const struct xlat bpf_map_update_elem_flags[] = { + XLAT(BPF_ANY), + XLAT(BPF_NOEXIST), + XLAT(BPF_EXIST), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_map_update_elem_flags.in b/xlat/bpf_map_update_elem_flags.in new file mode 100644 index 00000000..6b1d61fc --- /dev/null +++ b/xlat/bpf_map_update_elem_flags.in @@ -0,0 +1,3 @@ +BPF_ANY 0 +BPF_NOEXIST 1 +BPF_EXIST 2 diff --git a/xlat/bpf_miscop.h b/xlat/bpf_miscop.h new file mode 100644 index 00000000..bedf35b6 --- /dev/null +++ b/xlat/bpf_miscop.h @@ -0,0 +1,20 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_miscop.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_miscop in mpers mode + +#else + +static +const struct xlat bpf_miscop[] = { +#if defined(BPF_TAX) || (defined(HAVE_DECL_BPF_TAX) && HAVE_DECL_BPF_TAX) + XLAT(BPF_TAX), +#endif +#if defined(BPF_TXA) || (defined(HAVE_DECL_BPF_TXA) && HAVE_DECL_BPF_TXA) + XLAT(BPF_TXA), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_miscop.in b/xlat/bpf_miscop.in new file mode 100644 index 00000000..c9703b1d --- /dev/null +++ b/xlat/bpf_miscop.in @@ -0,0 +1,2 @@ +BPF_TAX +BPF_TXA diff --git a/xlat/bpf_mode.h b/xlat/bpf_mode.h new file mode 100644 index 00000000..0e3c862e --- /dev/null +++ b/xlat/bpf_mode.h @@ -0,0 +1,35 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_mode.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_mode in mpers mode + +#else + +static +const struct xlat bpf_mode[] = { +#if defined(BPF_IMM) || (defined(HAVE_DECL_BPF_IMM) && HAVE_DECL_BPF_IMM) + XLAT(BPF_IMM), +#endif +#if defined(BPF_ABS) || (defined(HAVE_DECL_BPF_ABS) && HAVE_DECL_BPF_ABS) + XLAT(BPF_ABS), +#endif +#if defined(BPF_IND) || (defined(HAVE_DECL_BPF_IND) && HAVE_DECL_BPF_IND) + XLAT(BPF_IND), +#endif +#if defined(BPF_MEM) || (defined(HAVE_DECL_BPF_MEM) && HAVE_DECL_BPF_MEM) + XLAT(BPF_MEM), +#endif +#if defined(BPF_LEN) || (defined(HAVE_DECL_BPF_LEN) && HAVE_DECL_BPF_LEN) + XLAT(BPF_LEN), +#endif +#if defined(BPF_MSH) || (defined(HAVE_DECL_BPF_MSH) && HAVE_DECL_BPF_MSH) + XLAT(BPF_MSH), +#endif +#if defined(BPF_XADD) || (defined(HAVE_DECL_BPF_XADD) && HAVE_DECL_BPF_XADD) + XLAT(BPF_XADD), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_mode.in b/xlat/bpf_mode.in new file mode 100644 index 00000000..10adecdd --- /dev/null +++ b/xlat/bpf_mode.in @@ -0,0 +1,7 @@ +BPF_IMM +BPF_ABS +BPF_IND +BPF_MEM +BPF_LEN +BPF_MSH +BPF_XADD diff --git a/xlat/bpf_op_alu.h b/xlat/bpf_op_alu.h new file mode 100644 index 00000000..d20a8c76 --- /dev/null +++ b/xlat/bpf_op_alu.h @@ -0,0 +1,53 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_op_alu.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_op_alu in mpers mode + +#else + +static +const struct xlat bpf_op_alu[] = { +#if defined(BPF_ADD) || (defined(HAVE_DECL_BPF_ADD) && HAVE_DECL_BPF_ADD) + XLAT(BPF_ADD), +#endif +#if defined(BPF_SUB) || (defined(HAVE_DECL_BPF_SUB) && HAVE_DECL_BPF_SUB) + XLAT(BPF_SUB), +#endif +#if defined(BPF_MUL) || (defined(HAVE_DECL_BPF_MUL) && HAVE_DECL_BPF_MUL) + XLAT(BPF_MUL), +#endif +#if defined(BPF_DIV) || (defined(HAVE_DECL_BPF_DIV) && HAVE_DECL_BPF_DIV) + XLAT(BPF_DIV), +#endif +#if defined(BPF_OR) || (defined(HAVE_DECL_BPF_OR) && HAVE_DECL_BPF_OR) + XLAT(BPF_OR), +#endif +#if defined(BPF_AND) || (defined(HAVE_DECL_BPF_AND) && HAVE_DECL_BPF_AND) + XLAT(BPF_AND), +#endif +#if defined(BPF_LSH) || (defined(HAVE_DECL_BPF_LSH) && HAVE_DECL_BPF_LSH) + XLAT(BPF_LSH), +#endif +#if defined(BPF_RSH) || (defined(HAVE_DECL_BPF_RSH) && HAVE_DECL_BPF_RSH) + XLAT(BPF_RSH), +#endif +#if defined(BPF_NEG) || (defined(HAVE_DECL_BPF_NEG) && HAVE_DECL_BPF_NEG) + XLAT(BPF_NEG), +#endif +#if defined(BPF_MOD) || (defined(HAVE_DECL_BPF_MOD) && HAVE_DECL_BPF_MOD) + XLAT(BPF_MOD), +#endif +#if defined(BPF_XOR) || (defined(HAVE_DECL_BPF_XOR) && HAVE_DECL_BPF_XOR) + XLAT(BPF_XOR), +#endif +#if defined(BPF_MOV) || (defined(HAVE_DECL_BPF_MOV) && HAVE_DECL_BPF_MOV) + XLAT(BPF_MOV), +#endif +#if defined(BPF_ARSH) || (defined(HAVE_DECL_BPF_ARSH) && HAVE_DECL_BPF_ARSH) + XLAT(BPF_ARSH), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_op_alu.in b/xlat/bpf_op_alu.in new file mode 100644 index 00000000..e43aec60 --- /dev/null +++ b/xlat/bpf_op_alu.in @@ -0,0 +1,13 @@ +BPF_ADD +BPF_SUB +BPF_MUL +BPF_DIV +BPF_OR +BPF_AND +BPF_LSH +BPF_RSH +BPF_NEG +BPF_MOD +BPF_XOR +BPF_MOV +BPF_ARSH diff --git a/xlat/bpf_op_jmp.h b/xlat/bpf_op_jmp.h new file mode 100644 index 00000000..d43b30ec --- /dev/null +++ b/xlat/bpf_op_jmp.h @@ -0,0 +1,44 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_op_jmp.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_op_jmp in mpers mode + +#else + +static +const struct xlat bpf_op_jmp[] = { +#if defined(BPF_JA) || (defined(HAVE_DECL_BPF_JA) && HAVE_DECL_BPF_JA) + XLAT(BPF_JA), +#endif +#if defined(BPF_JEQ) || (defined(HAVE_DECL_BPF_JEQ) && HAVE_DECL_BPF_JEQ) + XLAT(BPF_JEQ), +#endif +#if defined(BPF_JGT) || (defined(HAVE_DECL_BPF_JGT) && HAVE_DECL_BPF_JGT) + XLAT(BPF_JGT), +#endif +#if defined(BPF_JGE) || (defined(HAVE_DECL_BPF_JGE) && HAVE_DECL_BPF_JGE) + XLAT(BPF_JGE), +#endif +#if defined(BPF_JSET) || (defined(HAVE_DECL_BPF_JSET) && HAVE_DECL_BPF_JSET) + XLAT(BPF_JSET), +#endif +#if defined(BPF_JNE) || (defined(HAVE_DECL_BPF_JNE) && HAVE_DECL_BPF_JNE) + XLAT(BPF_JNE), +#endif +#if defined(BPF_JSGT) || (defined(HAVE_DECL_BPF_JSGT) && HAVE_DECL_BPF_JSGT) + XLAT(BPF_JSGT), +#endif +#if defined(BPF_JSGE) || (defined(HAVE_DECL_BPF_JSGE) && HAVE_DECL_BPF_JSGE) + XLAT(BPF_JSGE), +#endif +#if defined(BPF_CALL) || (defined(HAVE_DECL_BPF_CALL) && HAVE_DECL_BPF_CALL) + XLAT(BPF_CALL), +#endif +#if defined(BPF_EXIT) || (defined(HAVE_DECL_BPF_EXIT) && HAVE_DECL_BPF_EXIT) + XLAT(BPF_EXIT), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_op_jmp.in b/xlat/bpf_op_jmp.in new file mode 100644 index 00000000..456c0af8 --- /dev/null +++ b/xlat/bpf_op_jmp.in @@ -0,0 +1,10 @@ +BPF_JA +BPF_JEQ +BPF_JGT +BPF_JGE +BPF_JSET +BPF_JNE +BPF_JSGT +BPF_JSGE +BPF_CALL +BPF_EXIT diff --git a/xlat/bpf_prog_types.h b/xlat/bpf_prog_types.h new file mode 100644 index 00000000..9eac9520 --- /dev/null +++ b/xlat/bpf_prog_types.h @@ -0,0 +1,66 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_prog_types.in; do not edit. */ +#if !(defined(BPF_PROG_TYPE_UNSPEC) || (defined(HAVE_DECL_BPF_PROG_TYPE_UNSPEC) && HAVE_DECL_BPF_PROG_TYPE_UNSPEC)) +# define BPF_PROG_TYPE_UNSPEC 0 +#endif +#if !(defined(BPF_PROG_TYPE_SOCKET_FILTER) || (defined(HAVE_DECL_BPF_PROG_TYPE_SOCKET_FILTER) && HAVE_DECL_BPF_PROG_TYPE_SOCKET_FILTER)) +# define BPF_PROG_TYPE_SOCKET_FILTER 1 +#endif +#if !(defined(BPF_PROG_TYPE_KPROBE) || (defined(HAVE_DECL_BPF_PROG_TYPE_KPROBE) && HAVE_DECL_BPF_PROG_TYPE_KPROBE)) +# define BPF_PROG_TYPE_KPROBE 2 +#endif +#if !(defined(BPF_PROG_TYPE_SCHED_CLS) || (defined(HAVE_DECL_BPF_PROG_TYPE_SCHED_CLS) && HAVE_DECL_BPF_PROG_TYPE_SCHED_CLS)) +# define BPF_PROG_TYPE_SCHED_CLS 3 +#endif +#if !(defined(BPF_PROG_TYPE_SCHED_ACT) || (defined(HAVE_DECL_BPF_PROG_TYPE_SCHED_ACT) && HAVE_DECL_BPF_PROG_TYPE_SCHED_ACT)) +# define BPF_PROG_TYPE_SCHED_ACT 4 +#endif +#if !(defined(BPF_PROG_TYPE_TRACEPOINT) || (defined(HAVE_DECL_BPF_PROG_TYPE_TRACEPOINT) && HAVE_DECL_BPF_PROG_TYPE_TRACEPOINT)) +# define BPF_PROG_TYPE_TRACEPOINT 5 +#endif +#if !(defined(BPF_PROG_TYPE_XDP) || (defined(HAVE_DECL_BPF_PROG_TYPE_XDP) && HAVE_DECL_BPF_PROG_TYPE_XDP)) +# define BPF_PROG_TYPE_XDP 6 +#endif +#if !(defined(BPF_PROG_TYPE_PERF_EVENT) || (defined(HAVE_DECL_BPF_PROG_TYPE_PERF_EVENT) && HAVE_DECL_BPF_PROG_TYPE_PERF_EVENT)) +# define BPF_PROG_TYPE_PERF_EVENT 7 +#endif +#if !(defined(BPF_PROG_TYPE_CGROUP_SKB) || (defined(HAVE_DECL_BPF_PROG_TYPE_CGROUP_SKB) && HAVE_DECL_BPF_PROG_TYPE_CGROUP_SKB)) +# define BPF_PROG_TYPE_CGROUP_SKB 8 +#endif +#if !(defined(BPF_PROG_TYPE_CGROUP_SOCK) || (defined(HAVE_DECL_BPF_PROG_TYPE_CGROUP_SOCK) && HAVE_DECL_BPF_PROG_TYPE_CGROUP_SOCK)) +# define BPF_PROG_TYPE_CGROUP_SOCK 9 +#endif +#if !(defined(BPF_PROG_TYPE_LWT_IN) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_IN) && HAVE_DECL_BPF_PROG_TYPE_LWT_IN)) +# define BPF_PROG_TYPE_LWT_IN 10 +#endif +#if !(defined(BPF_PROG_TYPE_LWT_OUT) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_OUT) && HAVE_DECL_BPF_PROG_TYPE_LWT_OUT)) +# define BPF_PROG_TYPE_LWT_OUT 11 +#endif +#if !(defined(BPF_PROG_TYPE_LWT_XMIT) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_XMIT) && HAVE_DECL_BPF_PROG_TYPE_LWT_XMIT)) +# define BPF_PROG_TYPE_LWT_XMIT 12 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat bpf_prog_types in mpers mode + +#else + +static +const struct xlat bpf_prog_types[] = { + XLAT(BPF_PROG_TYPE_UNSPEC), + XLAT(BPF_PROG_TYPE_SOCKET_FILTER), + XLAT(BPF_PROG_TYPE_KPROBE), + XLAT(BPF_PROG_TYPE_SCHED_CLS), + XLAT(BPF_PROG_TYPE_SCHED_ACT), + XLAT(BPF_PROG_TYPE_TRACEPOINT), + XLAT(BPF_PROG_TYPE_XDP), + XLAT(BPF_PROG_TYPE_PERF_EVENT), + XLAT(BPF_PROG_TYPE_CGROUP_SKB), + XLAT(BPF_PROG_TYPE_CGROUP_SOCK), + XLAT(BPF_PROG_TYPE_LWT_IN), + XLAT(BPF_PROG_TYPE_LWT_OUT), + XLAT(BPF_PROG_TYPE_LWT_XMIT), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_prog_types.in b/xlat/bpf_prog_types.in new file mode 100644 index 00000000..bad608ec --- /dev/null +++ b/xlat/bpf_prog_types.in @@ -0,0 +1,13 @@ +BPF_PROG_TYPE_UNSPEC 0 +BPF_PROG_TYPE_SOCKET_FILTER 1 +BPF_PROG_TYPE_KPROBE 2 +BPF_PROG_TYPE_SCHED_CLS 3 +BPF_PROG_TYPE_SCHED_ACT 4 +BPF_PROG_TYPE_TRACEPOINT 5 +BPF_PROG_TYPE_XDP 6 +BPF_PROG_TYPE_PERF_EVENT 7 +BPF_PROG_TYPE_CGROUP_SKB 8 +BPF_PROG_TYPE_CGROUP_SOCK 9 +BPF_PROG_TYPE_LWT_IN 10 +BPF_PROG_TYPE_LWT_OUT 11 +BPF_PROG_TYPE_LWT_XMIT 12 diff --git a/xlat/bpf_rval.h b/xlat/bpf_rval.h new file mode 100644 index 00000000..8f84f03f --- /dev/null +++ b/xlat/bpf_rval.h @@ -0,0 +1,23 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_rval.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_rval in mpers mode + +#else + +static +const struct xlat bpf_rval[] = { +#if defined(BPF_K) || (defined(HAVE_DECL_BPF_K) && HAVE_DECL_BPF_K) + XLAT(BPF_K), +#endif +#if defined(BPF_X) || (defined(HAVE_DECL_BPF_X) && HAVE_DECL_BPF_X) + XLAT(BPF_X), +#endif +#if defined(BPF_A) || (defined(HAVE_DECL_BPF_A) && HAVE_DECL_BPF_A) + XLAT(BPF_A), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_rval.in b/xlat/bpf_rval.in new file mode 100644 index 00000000..44e137ec --- /dev/null +++ b/xlat/bpf_rval.in @@ -0,0 +1,3 @@ +BPF_K +BPF_X +BPF_A diff --git a/xlat/bpf_size.h b/xlat/bpf_size.h new file mode 100644 index 00000000..f07bc9ca --- /dev/null +++ b/xlat/bpf_size.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_size.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_size in mpers mode + +#else + +static +const struct xlat bpf_size[] = { +#if defined(BPF_W) || (defined(HAVE_DECL_BPF_W) && HAVE_DECL_BPF_W) + XLAT(BPF_W), +#endif +#if defined(BPF_H) || (defined(HAVE_DECL_BPF_H) && HAVE_DECL_BPF_H) + XLAT(BPF_H), +#endif +#if defined(BPF_B) || (defined(HAVE_DECL_BPF_B) && HAVE_DECL_BPF_B) + XLAT(BPF_B), +#endif +#if defined(BPF_DW) || (defined(HAVE_DECL_BPF_DW) && HAVE_DECL_BPF_DW) + XLAT(BPF_DW), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_size.in b/xlat/bpf_size.in new file mode 100644 index 00000000..5e0a5085 --- /dev/null +++ b/xlat/bpf_size.in @@ -0,0 +1,4 @@ +BPF_W +BPF_H +BPF_B +BPF_DW diff --git a/xlat/bpf_src.h b/xlat/bpf_src.h new file mode 100644 index 00000000..c063e75d --- /dev/null +++ b/xlat/bpf_src.h @@ -0,0 +1,20 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_src.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bpf_src in mpers mode + +#else + +static +const struct xlat bpf_src[] = { +#if defined(BPF_K) || (defined(HAVE_DECL_BPF_K) && HAVE_DECL_BPF_K) + XLAT(BPF_K), +#endif +#if defined(BPF_X) || (defined(HAVE_DECL_BPF_X) && HAVE_DECL_BPF_X) + XLAT(BPF_X), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bpf_src.in b/xlat/bpf_src.in new file mode 100644 index 00000000..ede6abb9 --- /dev/null +++ b/xlat/bpf_src.in @@ -0,0 +1,2 @@ +BPF_K +BPF_X diff --git a/xlat/bsg_flags.h b/xlat/bsg_flags.h new file mode 100644 index 00000000..c5f28d9a --- /dev/null +++ b/xlat/bsg_flags.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bsg_flags.in; do not edit. */ +#if !(defined(BSG_FLAG_Q_AT_TAIL) || (defined(HAVE_DECL_BSG_FLAG_Q_AT_TAIL) && HAVE_DECL_BSG_FLAG_Q_AT_TAIL)) +# define BSG_FLAG_Q_AT_TAIL 0x10 +#endif +#if !(defined(BSG_FLAG_Q_AT_HEAD) || (defined(HAVE_DECL_BSG_FLAG_Q_AT_HEAD) && HAVE_DECL_BSG_FLAG_Q_AT_HEAD)) +# define BSG_FLAG_Q_AT_HEAD 0x20 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat bsg_flags in mpers mode + +#else + +static +const struct xlat bsg_flags[] = { + XLAT(BSG_FLAG_Q_AT_TAIL), + XLAT(BSG_FLAG_Q_AT_HEAD), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bsg_flags.in b/xlat/bsg_flags.in new file mode 100644 index 00000000..6ef77729 --- /dev/null +++ b/xlat/bsg_flags.in @@ -0,0 +1,2 @@ +BSG_FLAG_Q_AT_TAIL 0x10 +BSG_FLAG_Q_AT_HEAD 0x20 diff --git a/xlat/bsg_protocol.h b/xlat/bsg_protocol.h new file mode 100644 index 00000000..541085da --- /dev/null +++ b/xlat/bsg_protocol.h @@ -0,0 +1,17 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bsg_protocol.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bsg_protocol in mpers mode + +#else + +static +const struct xlat bsg_protocol[] = { +#if defined(BSG_PROTOCOL_SCSI) || (defined(HAVE_DECL_BSG_PROTOCOL_SCSI) && HAVE_DECL_BSG_PROTOCOL_SCSI) + XLAT(BSG_PROTOCOL_SCSI), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bsg_protocol.in b/xlat/bsg_protocol.in new file mode 100644 index 00000000..d47f15b7 --- /dev/null +++ b/xlat/bsg_protocol.in @@ -0,0 +1 @@ +BSG_PROTOCOL_SCSI diff --git a/xlat/bsg_subprotocol.h b/xlat/bsg_subprotocol.h new file mode 100644 index 00000000..80732138 --- /dev/null +++ b/xlat/bsg_subprotocol.h @@ -0,0 +1,23 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bsg_subprotocol.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bsg_subprotocol in mpers mode + +#else + +static +const struct xlat bsg_subprotocol[] = { +#if defined(BSG_SUB_PROTOCOL_SCSI_CMD) || (defined(HAVE_DECL_BSG_SUB_PROTOCOL_SCSI_CMD) && HAVE_DECL_BSG_SUB_PROTOCOL_SCSI_CMD) + XLAT(BSG_SUB_PROTOCOL_SCSI_CMD), +#endif +#if defined(BSG_SUB_PROTOCOL_SCSI_TMF) || (defined(HAVE_DECL_BSG_SUB_PROTOCOL_SCSI_TMF) && HAVE_DECL_BSG_SUB_PROTOCOL_SCSI_TMF) + XLAT(BSG_SUB_PROTOCOL_SCSI_TMF), +#endif +#if defined(BSG_SUB_PROTOCOL_SCSI_TRANSPORT) || (defined(HAVE_DECL_BSG_SUB_PROTOCOL_SCSI_TRANSPORT) && HAVE_DECL_BSG_SUB_PROTOCOL_SCSI_TRANSPORT) + XLAT(BSG_SUB_PROTOCOL_SCSI_TRANSPORT), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bsg_subprotocol.in b/xlat/bsg_subprotocol.in new file mode 100644 index 00000000..5e63cd03 --- /dev/null +++ b/xlat/bsg_subprotocol.in @@ -0,0 +1,3 @@ +BSG_SUB_PROTOCOL_SCSI_CMD +BSG_SUB_PROTOCOL_SCSI_TMF +BSG_SUB_PROTOCOL_SCSI_TRANSPORT diff --git a/xlat/bt_protocols.h b/xlat/bt_protocols.h new file mode 100644 index 00000000..7b0e1645 --- /dev/null +++ b/xlat/bt_protocols.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bt_protocols.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat bt_protocols in mpers mode + +#else + +static +const struct xlat bt_protocols[] = { +#if defined(BTPROTO_L2CAP) || (defined(HAVE_DECL_BTPROTO_L2CAP) && HAVE_DECL_BTPROTO_L2CAP) + XLAT(BTPROTO_L2CAP), +#endif +#if defined(BTPROTO_HCI) || (defined(HAVE_DECL_BTPROTO_HCI) && HAVE_DECL_BTPROTO_HCI) + XLAT(BTPROTO_HCI), +#endif +#if defined(BTPROTO_SCO) || (defined(HAVE_DECL_BTPROTO_SCO) && HAVE_DECL_BTPROTO_SCO) + XLAT(BTPROTO_SCO), +#endif +#if defined(BTPROTO_RFCOMM) || (defined(HAVE_DECL_BTPROTO_RFCOMM) && HAVE_DECL_BTPROTO_RFCOMM) + XLAT(BTPROTO_RFCOMM), +#endif +#if defined(BTPROTO_BNEP) || (defined(HAVE_DECL_BTPROTO_BNEP) && HAVE_DECL_BTPROTO_BNEP) + XLAT(BTPROTO_BNEP), +#endif +#if defined(BTPROTO_CMTP) || (defined(HAVE_DECL_BTPROTO_CMTP) && HAVE_DECL_BTPROTO_CMTP) + XLAT(BTPROTO_CMTP), +#endif +#if defined(BTPROTO_HIDP) || (defined(HAVE_DECL_BTPROTO_HIDP) && HAVE_DECL_BTPROTO_HIDP) + XLAT(BTPROTO_HIDP), +#endif +#if defined(BTPROTO_AVDTP) || (defined(HAVE_DECL_BTPROTO_AVDTP) && HAVE_DECL_BTPROTO_AVDTP) + XLAT(BTPROTO_AVDTP), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/bt_protocols.in b/xlat/bt_protocols.in new file mode 100644 index 00000000..1f7f3485 --- /dev/null +++ b/xlat/bt_protocols.in @@ -0,0 +1,8 @@ +BTPROTO_L2CAP +BTPROTO_HCI +BTPROTO_SCO +BTPROTO_RFCOMM +BTPROTO_BNEP +BTPROTO_CMTP +BTPROTO_HIDP +BTPROTO_AVDTP diff --git a/xlat/btrfs_balance_args.h b/xlat/btrfs_balance_args.h new file mode 100644 index 00000000..d1f10918 --- /dev/null +++ b/xlat/btrfs_balance_args.h @@ -0,0 +1,60 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_args.in; do not edit. */ +#if !(defined(BTRFS_BALANCE_ARGS_PROFILES) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_PROFILES) && HAVE_DECL_BTRFS_BALANCE_ARGS_PROFILES)) +# define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_USAGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE)) +# define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_DEVID) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_DEVID) && HAVE_DECL_BTRFS_BALANCE_ARGS_DEVID)) +# define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_DRANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_DRANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_DRANGE)) +# define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_VRANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_VRANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_VRANGE)) +# define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_LIMIT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT) && HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT)) +# define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_LIMIT_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT_RANGE)) +# define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_STRIPES_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_STRIPES_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_STRIPES_RANGE)) +# define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_CONVERT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_CONVERT) && HAVE_DECL_BTRFS_BALANCE_ARGS_CONVERT)) +# define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_SOFT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_SOFT) && HAVE_DECL_BTRFS_BALANCE_ARGS_SOFT)) +# define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9) +#endif +#if !(defined(BTRFS_BALANCE_ARGS_USAGE_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE_RANGE)) +# define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_balance_args[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_balance_args[] = { + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_PROFILES), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_USAGE), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_DEVID), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_DRANGE), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_VRANGE), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_LIMIT), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_LIMIT_RANGE), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_STRIPES_RANGE), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_CONVERT), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_SOFT), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_USAGE_RANGE), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_balance_args.in b/xlat/btrfs_balance_args.in new file mode 100644 index 00000000..ffeaacc0 --- /dev/null +++ b/xlat/btrfs_balance_args.in @@ -0,0 +1,12 @@ +#val_type uint64_t +BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0) +BTRFS_BALANCE_ARGS_USAGE (1ULL << 1) +BTRFS_BALANCE_ARGS_DEVID (1ULL << 2) +BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3) +BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4) +BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5) +BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6) +BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7) +BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8) +BTRFS_BALANCE_ARGS_SOFT (1ULL << 9) +BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10) diff --git a/xlat/btrfs_balance_ctl_cmds.h b/xlat/btrfs_balance_ctl_cmds.h new file mode 100644 index 00000000..9bdc820e --- /dev/null +++ b/xlat/btrfs_balance_ctl_cmds.h @@ -0,0 +1,24 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_ctl_cmds.in; do not edit. */ +#if !(defined(BTRFS_BALANCE_CTL_PAUSE) || (defined(HAVE_DECL_BTRFS_BALANCE_CTL_PAUSE) && HAVE_DECL_BTRFS_BALANCE_CTL_PAUSE)) +# define BTRFS_BALANCE_CTL_PAUSE 1 +#endif +#if !(defined(BTRFS_BALANCE_CTL_CANCEL) || (defined(HAVE_DECL_BTRFS_BALANCE_CTL_CANCEL) && HAVE_DECL_BTRFS_BALANCE_CTL_CANCEL)) +# define BTRFS_BALANCE_CTL_CANCEL 2 +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_balance_ctl_cmds[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_balance_ctl_cmds[] = { + XLAT(BTRFS_BALANCE_CTL_PAUSE), + XLAT(BTRFS_BALANCE_CTL_CANCEL), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_balance_ctl_cmds.in b/xlat/btrfs_balance_ctl_cmds.in new file mode 100644 index 00000000..5cdd0bc5 --- /dev/null +++ b/xlat/btrfs_balance_ctl_cmds.in @@ -0,0 +1,2 @@ +BTRFS_BALANCE_CTL_PAUSE 1 +BTRFS_BALANCE_CTL_CANCEL 2 diff --git a/xlat/btrfs_balance_flags.h b/xlat/btrfs_balance_flags.h new file mode 100644 index 00000000..c071b6e1 --- /dev/null +++ b/xlat/btrfs_balance_flags.h @@ -0,0 +1,36 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_flags.in; do not edit. */ +#if !(defined(BTRFS_BALANCE_DATA) || (defined(HAVE_DECL_BTRFS_BALANCE_DATA) && HAVE_DECL_BTRFS_BALANCE_DATA)) +# define BTRFS_BALANCE_DATA (1ULL << 0) +#endif +#if !(defined(BTRFS_BALANCE_SYSTEM) || (defined(HAVE_DECL_BTRFS_BALANCE_SYSTEM) && HAVE_DECL_BTRFS_BALANCE_SYSTEM)) +# define BTRFS_BALANCE_SYSTEM (1ULL << 1) +#endif +#if !(defined(BTRFS_BALANCE_METADATA) || (defined(HAVE_DECL_BTRFS_BALANCE_METADATA) && HAVE_DECL_BTRFS_BALANCE_METADATA)) +# define BTRFS_BALANCE_METADATA (1ULL << 2) +#endif +#if !(defined(BTRFS_BALANCE_FORCE) || (defined(HAVE_DECL_BTRFS_BALANCE_FORCE) && HAVE_DECL_BTRFS_BALANCE_FORCE)) +# define BTRFS_BALANCE_FORCE (1ULL << 3) +#endif +#if !(defined(BTRFS_BALANCE_RESUME) || (defined(HAVE_DECL_BTRFS_BALANCE_RESUME) && HAVE_DECL_BTRFS_BALANCE_RESUME)) +# define BTRFS_BALANCE_RESUME (1ULL << 4) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_balance_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_balance_flags[] = { + XLAT_TYPE(uint64_t, BTRFS_BALANCE_DATA), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_SYSTEM), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_METADATA), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_FORCE), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_RESUME), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_balance_flags.in b/xlat/btrfs_balance_flags.in new file mode 100644 index 00000000..00ae0d10 --- /dev/null +++ b/xlat/btrfs_balance_flags.in @@ -0,0 +1,6 @@ +#val_type uint64_t +BTRFS_BALANCE_DATA (1ULL << 0) +BTRFS_BALANCE_SYSTEM (1ULL << 1) +BTRFS_BALANCE_METADATA (1ULL << 2) +BTRFS_BALANCE_FORCE (1ULL << 3) +BTRFS_BALANCE_RESUME (1ULL << 4) diff --git a/xlat/btrfs_balance_state.h b/xlat/btrfs_balance_state.h new file mode 100644 index 00000000..64c8511c --- /dev/null +++ b/xlat/btrfs_balance_state.h @@ -0,0 +1,28 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_state.in; do not edit. */ +#if !(defined(BTRFS_BALANCE_STATE_RUNNING) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_RUNNING) && HAVE_DECL_BTRFS_BALANCE_STATE_RUNNING)) +# define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0) +#endif +#if !(defined(BTRFS_BALANCE_STATE_PAUSE_REQ) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_PAUSE_REQ) && HAVE_DECL_BTRFS_BALANCE_STATE_PAUSE_REQ)) +# define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1) +#endif +#if !(defined(BTRFS_BALANCE_STATE_CANCEL_REQ) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_CANCEL_REQ) && HAVE_DECL_BTRFS_BALANCE_STATE_CANCEL_REQ)) +# define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_balance_state[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_balance_state[] = { + XLAT(BTRFS_BALANCE_STATE_RUNNING), + XLAT(BTRFS_BALANCE_STATE_PAUSE_REQ), + XLAT(BTRFS_BALANCE_STATE_CANCEL_REQ), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_balance_state.in b/xlat/btrfs_balance_state.in new file mode 100644 index 00000000..5dbfca5e --- /dev/null +++ b/xlat/btrfs_balance_state.in @@ -0,0 +1,3 @@ +BTRFS_BALANCE_STATE_RUNNING (1ULL << 0) +BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1) +BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2) diff --git a/xlat/btrfs_compress_types.h b/xlat/btrfs_compress_types.h new file mode 100644 index 00000000..dd89c637 --- /dev/null +++ b/xlat/btrfs_compress_types.h @@ -0,0 +1,28 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_compress_types.in; do not edit. */ +#if !(defined(BTRFS_COMPRESS_NONE) || (defined(HAVE_DECL_BTRFS_COMPRESS_NONE) && HAVE_DECL_BTRFS_COMPRESS_NONE)) +# define BTRFS_COMPRESS_NONE 0 +#endif +#if !(defined(BTRFS_COMPRESS_ZLIB) || (defined(HAVE_DECL_BTRFS_COMPRESS_ZLIB) && HAVE_DECL_BTRFS_COMPRESS_ZLIB)) +# define BTRFS_COMPRESS_ZLIB 1 +#endif +#if !(defined(BTRFS_COMPRESS_LZO) || (defined(HAVE_DECL_BTRFS_COMPRESS_LZO) && HAVE_DECL_BTRFS_COMPRESS_LZO)) +# define BTRFS_COMPRESS_LZO 2 +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_compress_types[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_compress_types[] = { + XLAT(BTRFS_COMPRESS_NONE), + XLAT(BTRFS_COMPRESS_ZLIB), + XLAT(BTRFS_COMPRESS_LZO), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_compress_types.in b/xlat/btrfs_compress_types.in new file mode 100644 index 00000000..c47d59fc --- /dev/null +++ b/xlat/btrfs_compress_types.in @@ -0,0 +1,3 @@ +BTRFS_COMPRESS_NONE 0 +BTRFS_COMPRESS_ZLIB 1 +BTRFS_COMPRESS_LZO 2 diff --git a/xlat/btrfs_defrag_flags.h b/xlat/btrfs_defrag_flags.h new file mode 100644 index 00000000..2990b21d --- /dev/null +++ b/xlat/btrfs_defrag_flags.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_defrag_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_defrag_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_defrag_flags[] = { +#if defined(BTRFS_DEFRAG_RANGE_COMPRESS) || (defined(HAVE_DECL_BTRFS_DEFRAG_RANGE_COMPRESS) && HAVE_DECL_BTRFS_DEFRAG_RANGE_COMPRESS) + XLAT_TYPE(uint64_t, BTRFS_DEFRAG_RANGE_COMPRESS), +#endif +#if defined(BTRFS_DEFRAG_RANGE_START_IO) || (defined(HAVE_DECL_BTRFS_DEFRAG_RANGE_START_IO) && HAVE_DECL_BTRFS_DEFRAG_RANGE_START_IO) + XLAT_TYPE(uint64_t, BTRFS_DEFRAG_RANGE_START_IO), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_defrag_flags.in b/xlat/btrfs_defrag_flags.in new file mode 100644 index 00000000..ae026c84 --- /dev/null +++ b/xlat/btrfs_defrag_flags.in @@ -0,0 +1,3 @@ +#val_type uint64_t +BTRFS_DEFRAG_RANGE_COMPRESS +BTRFS_DEFRAG_RANGE_START_IO diff --git a/xlat/btrfs_dev_replace_cmds.h b/xlat/btrfs_dev_replace_cmds.h new file mode 100644 index 00000000..83bd044e --- /dev/null +++ b/xlat/btrfs_dev_replace_cmds.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_replace_cmds.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_dev_replace_cmds[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_dev_replace_cmds[] = { +#if defined(BTRFS_IOCTL_DEV_REPLACE_CMD_START) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_START) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_START) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_CMD_START), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_dev_replace_cmds.in b/xlat/btrfs_dev_replace_cmds.in new file mode 100644 index 00000000..18600f0f --- /dev/null +++ b/xlat/btrfs_dev_replace_cmds.in @@ -0,0 +1,4 @@ +#val_type uint64_t +BTRFS_IOCTL_DEV_REPLACE_CMD_START +BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS +BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL diff --git a/xlat/btrfs_dev_replace_results.h b/xlat/btrfs_dev_replace_results.h new file mode 100644 index 00000000..62fe4f8e --- /dev/null +++ b/xlat/btrfs_dev_replace_results.h @@ -0,0 +1,28 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_replace_results.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_dev_replace_results[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_dev_replace_results[] = { +#if defined(BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_dev_replace_results.in b/xlat/btrfs_dev_replace_results.in new file mode 100644 index 00000000..bf892823 --- /dev/null +++ b/xlat/btrfs_dev_replace_results.in @@ -0,0 +1,5 @@ +#val_type uint64_t +BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR +BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED +BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED +BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS diff --git a/xlat/btrfs_dev_replace_state.h b/xlat/btrfs_dev_replace_state.h new file mode 100644 index 00000000..7095c1af --- /dev/null +++ b/xlat/btrfs_dev_replace_state.h @@ -0,0 +1,31 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_replace_state.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_dev_replace_state[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_dev_replace_state[] = { +#if defined(BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED), +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED) + XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_dev_replace_state.in b/xlat/btrfs_dev_replace_state.in new file mode 100644 index 00000000..bbc0ba15 --- /dev/null +++ b/xlat/btrfs_dev_replace_state.in @@ -0,0 +1,6 @@ +#val_type uint64_t +BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED +BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED +BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED +BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED +BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED diff --git a/xlat/btrfs_dev_stats_flags.h b/xlat/btrfs_dev_stats_flags.h new file mode 100644 index 00000000..7bfbb092 --- /dev/null +++ b/xlat/btrfs_dev_stats_flags.h @@ -0,0 +1,19 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_stats_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_dev_stats_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_dev_stats_flags[] = { +#if defined(BTRFS_DEV_STATS_RESET) || (defined(HAVE_DECL_BTRFS_DEV_STATS_RESET) && HAVE_DECL_BTRFS_DEV_STATS_RESET) + XLAT_TYPE(uint64_t, BTRFS_DEV_STATS_RESET), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_dev_stats_flags.in b/xlat/btrfs_dev_stats_flags.in new file mode 100644 index 00000000..9ff56c33 --- /dev/null +++ b/xlat/btrfs_dev_stats_flags.in @@ -0,0 +1,2 @@ +#val_type uint64_t +BTRFS_DEV_STATS_RESET diff --git a/xlat/btrfs_dev_stats_values.h b/xlat/btrfs_dev_stats_values.h new file mode 100644 index 00000000..eaaeff0c --- /dev/null +++ b/xlat/btrfs_dev_stats_values.h @@ -0,0 +1,21 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_stats_values.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_dev_stats_values[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_dev_stats_values[] = { + XLAT_TYPE(uint64_t, BTRFS_DEV_STAT_WRITE_ERRS), + XLAT_TYPE(uint64_t, BTRFS_DEV_STAT_READ_ERRS), + XLAT_TYPE(uint64_t, BTRFS_DEV_STAT_FLUSH_ERRS), + XLAT_TYPE(uint64_t, BTRFS_DEV_STAT_CORRUPTION_ERRS), + XLAT_TYPE(uint64_t, BTRFS_DEV_STAT_GENERATION_ERRS), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_dev_stats_values.in b/xlat/btrfs_dev_stats_values.in new file mode 100644 index 00000000..02a37be3 --- /dev/null +++ b/xlat/btrfs_dev_stats_values.in @@ -0,0 +1,7 @@ +#val_type uint64_t +#unconditional +BTRFS_DEV_STAT_WRITE_ERRS +BTRFS_DEV_STAT_READ_ERRS +BTRFS_DEV_STAT_FLUSH_ERRS +BTRFS_DEV_STAT_CORRUPTION_ERRS +BTRFS_DEV_STAT_GENERATION_ERRS diff --git a/xlat/btrfs_features_compat.h b/xlat/btrfs_features_compat.h new file mode 100644 index 00000000..d1e61d8e --- /dev/null +++ b/xlat/btrfs_features_compat.h @@ -0,0 +1,16 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_features_compat.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_features_compat[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_features_compat[] = { + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_features_compat.in b/xlat/btrfs_features_compat.in new file mode 100644 index 00000000..e69de29b diff --git a/xlat/btrfs_features_compat_ro.h b/xlat/btrfs_features_compat_ro.h new file mode 100644 index 00000000..324324a2 --- /dev/null +++ b/xlat/btrfs_features_compat_ro.h @@ -0,0 +1,24 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_features_compat_ro.in; do not edit. */ +#if !(defined(BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) || (defined(HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) && HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE)) +# define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0) +#endif +#if !(defined(BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) || (defined(HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) && HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID)) +# define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_features_compat_ro[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_features_compat_ro[] = { + XLAT_TYPE(uint64_t, BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_features_compat_ro.in b/xlat/btrfs_features_compat_ro.in new file mode 100644 index 00000000..5a745ee3 --- /dev/null +++ b/xlat/btrfs_features_compat_ro.in @@ -0,0 +1,3 @@ +#val_type uint64_t +BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0) +BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1) diff --git a/xlat/btrfs_features_incompat.h b/xlat/btrfs_features_incompat.h new file mode 100644 index 00000000..b012f412 --- /dev/null +++ b/xlat/btrfs_features_incompat.h @@ -0,0 +1,56 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_features_incompat.in; do not edit. */ +#if !(defined(BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF)) +# define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL)) +# define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)) +# define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO)) +# define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2)) +# define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 (1ULL << 4) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_BIG_METADATA) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_BIG_METADATA) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_BIG_METADATA)) +# define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)) +# define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_RAID56) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_RAID56) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_RAID56)) +# define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA)) +# define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) +#endif +#if !(defined(BTRFS_FEATURE_INCOMPAT_NO_HOLES) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_NO_HOLES) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_NO_HOLES)) +# define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_features_incompat[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_features_incompat[] = { + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_BIG_METADATA), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_RAID56), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_NO_HOLES), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_features_incompat.in b/xlat/btrfs_features_incompat.in new file mode 100644 index 00000000..45baacf5 --- /dev/null +++ b/xlat/btrfs_features_incompat.in @@ -0,0 +1,11 @@ +#val_type uint64_t +BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) +BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1) +BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2) +BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3) +BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 (1ULL << 4) +BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5) +BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) +BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) +BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) +BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) diff --git a/xlat/btrfs_key_types.h b/xlat/btrfs_key_types.h new file mode 100644 index 00000000..1a72165e --- /dev/null +++ b/xlat/btrfs_key_types.h @@ -0,0 +1,180 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_key_types.in; do not edit. */ +#if !(defined(BTRFS_INODE_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_INODE_ITEM_KEY) && HAVE_DECL_BTRFS_INODE_ITEM_KEY)) +# define BTRFS_INODE_ITEM_KEY 1 +#endif +#if !(defined(BTRFS_INODE_REF_KEY) || (defined(HAVE_DECL_BTRFS_INODE_REF_KEY) && HAVE_DECL_BTRFS_INODE_REF_KEY)) +# define BTRFS_INODE_REF_KEY 12 +#endif +#if !(defined(BTRFS_INODE_EXTREF_KEY) || (defined(HAVE_DECL_BTRFS_INODE_EXTREF_KEY) && HAVE_DECL_BTRFS_INODE_EXTREF_KEY)) +# define BTRFS_INODE_EXTREF_KEY 13 +#endif +#if !(defined(BTRFS_XATTR_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_XATTR_ITEM_KEY) && HAVE_DECL_BTRFS_XATTR_ITEM_KEY)) +# define BTRFS_XATTR_ITEM_KEY 24 +#endif +#if !(defined(BTRFS_ORPHAN_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_ORPHAN_ITEM_KEY) && HAVE_DECL_BTRFS_ORPHAN_ITEM_KEY)) +# define BTRFS_ORPHAN_ITEM_KEY 48 +#endif +#if !(defined(BTRFS_DIR_LOG_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DIR_LOG_ITEM_KEY) && HAVE_DECL_BTRFS_DIR_LOG_ITEM_KEY)) +# define BTRFS_DIR_LOG_ITEM_KEY 60 +#endif +#if !(defined(BTRFS_DIR_LOG_INDEX_KEY) || (defined(HAVE_DECL_BTRFS_DIR_LOG_INDEX_KEY) && HAVE_DECL_BTRFS_DIR_LOG_INDEX_KEY)) +# define BTRFS_DIR_LOG_INDEX_KEY 72 +#endif +#if !(defined(BTRFS_DIR_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DIR_ITEM_KEY) && HAVE_DECL_BTRFS_DIR_ITEM_KEY)) +# define BTRFS_DIR_ITEM_KEY 84 +#endif +#if !(defined(BTRFS_DIR_INDEX_KEY) || (defined(HAVE_DECL_BTRFS_DIR_INDEX_KEY) && HAVE_DECL_BTRFS_DIR_INDEX_KEY)) +# define BTRFS_DIR_INDEX_KEY 96 +#endif +#if !(defined(BTRFS_EXTENT_DATA_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_DATA_KEY) && HAVE_DECL_BTRFS_EXTENT_DATA_KEY)) +# define BTRFS_EXTENT_DATA_KEY 108 +#endif +#if !(defined(BTRFS_EXTENT_CSUM_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_CSUM_KEY) && HAVE_DECL_BTRFS_EXTENT_CSUM_KEY)) +# define BTRFS_EXTENT_CSUM_KEY 128 +#endif +#if !(defined(BTRFS_ROOT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_ITEM_KEY) && HAVE_DECL_BTRFS_ROOT_ITEM_KEY)) +# define BTRFS_ROOT_ITEM_KEY 132 +#endif +#if !(defined(BTRFS_ROOT_BACKREF_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_BACKREF_KEY) && HAVE_DECL_BTRFS_ROOT_BACKREF_KEY)) +# define BTRFS_ROOT_BACKREF_KEY 144 +#endif +#if !(defined(BTRFS_ROOT_REF_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_REF_KEY) && HAVE_DECL_BTRFS_ROOT_REF_KEY)) +# define BTRFS_ROOT_REF_KEY 156 +#endif +#if !(defined(BTRFS_EXTENT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_ITEM_KEY) && HAVE_DECL_BTRFS_EXTENT_ITEM_KEY)) +# define BTRFS_EXTENT_ITEM_KEY 168 +#endif +#if !(defined(BTRFS_METADATA_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_METADATA_ITEM_KEY) && HAVE_DECL_BTRFS_METADATA_ITEM_KEY)) +# define BTRFS_METADATA_ITEM_KEY 169 +#endif +#if !(defined(BTRFS_TREE_BLOCK_REF_KEY) || (defined(HAVE_DECL_BTRFS_TREE_BLOCK_REF_KEY) && HAVE_DECL_BTRFS_TREE_BLOCK_REF_KEY)) +# define BTRFS_TREE_BLOCK_REF_KEY 176 +#endif +#if !(defined(BTRFS_EXTENT_DATA_REF_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_DATA_REF_KEY) && HAVE_DECL_BTRFS_EXTENT_DATA_REF_KEY)) +# define BTRFS_EXTENT_DATA_REF_KEY 178 +#endif +#if !(defined(BTRFS_EXTENT_REF_V0_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_REF_V0_KEY) && HAVE_DECL_BTRFS_EXTENT_REF_V0_KEY)) +# define BTRFS_EXTENT_REF_V0_KEY 180 +#endif +#if !(defined(BTRFS_SHARED_BLOCK_REF_KEY) || (defined(HAVE_DECL_BTRFS_SHARED_BLOCK_REF_KEY) && HAVE_DECL_BTRFS_SHARED_BLOCK_REF_KEY)) +# define BTRFS_SHARED_BLOCK_REF_KEY 182 +#endif +#if !(defined(BTRFS_SHARED_DATA_REF_KEY) || (defined(HAVE_DECL_BTRFS_SHARED_DATA_REF_KEY) && HAVE_DECL_BTRFS_SHARED_DATA_REF_KEY)) +# define BTRFS_SHARED_DATA_REF_KEY 184 +#endif +#if !(defined(BTRFS_BLOCK_GROUP_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_ITEM_KEY) && HAVE_DECL_BTRFS_BLOCK_GROUP_ITEM_KEY)) +# define BTRFS_BLOCK_GROUP_ITEM_KEY 192 +#endif +#if !(defined(BTRFS_FREE_SPACE_INFO_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_INFO_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_INFO_KEY)) +# define BTRFS_FREE_SPACE_INFO_KEY 198 +#endif +#if !(defined(BTRFS_FREE_SPACE_EXTENT_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_EXTENT_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_EXTENT_KEY)) +# define BTRFS_FREE_SPACE_EXTENT_KEY 199 +#endif +#if !(defined(BTRFS_FREE_SPACE_BITMAP_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_BITMAP_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_BITMAP_KEY)) +# define BTRFS_FREE_SPACE_BITMAP_KEY 200 +#endif +#if !(defined(BTRFS_DEV_EXTENT_KEY) || (defined(HAVE_DECL_BTRFS_DEV_EXTENT_KEY) && HAVE_DECL_BTRFS_DEV_EXTENT_KEY)) +# define BTRFS_DEV_EXTENT_KEY 204 +#endif +#if !(defined(BTRFS_DEV_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DEV_ITEM_KEY) && HAVE_DECL_BTRFS_DEV_ITEM_KEY)) +# define BTRFS_DEV_ITEM_KEY 216 +#endif +#if !(defined(BTRFS_CHUNK_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_CHUNK_ITEM_KEY) && HAVE_DECL_BTRFS_CHUNK_ITEM_KEY)) +# define BTRFS_CHUNK_ITEM_KEY 228 +#endif +#if !(defined(BTRFS_QGROUP_STATUS_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_KEY) && HAVE_DECL_BTRFS_QGROUP_STATUS_KEY)) +# define BTRFS_QGROUP_STATUS_KEY 240 +#endif +#if !(defined(BTRFS_QGROUP_INFO_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_INFO_KEY) && HAVE_DECL_BTRFS_QGROUP_INFO_KEY)) +# define BTRFS_QGROUP_INFO_KEY 242 +#endif +#if !(defined(BTRFS_QGROUP_LIMIT_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_KEY) && HAVE_DECL_BTRFS_QGROUP_LIMIT_KEY)) +# define BTRFS_QGROUP_LIMIT_KEY 244 +#endif +#if !(defined(BTRFS_QGROUP_RELATION_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_RELATION_KEY) && HAVE_DECL_BTRFS_QGROUP_RELATION_KEY)) +# define BTRFS_QGROUP_RELATION_KEY 246 +#endif +#if !(defined(BTRFS_BALANCE_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_BALANCE_ITEM_KEY) && HAVE_DECL_BTRFS_BALANCE_ITEM_KEY)) +# define BTRFS_BALANCE_ITEM_KEY 248 +#endif +#if !(defined(BTRFS_TEMPORARY_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_TEMPORARY_ITEM_KEY) && HAVE_DECL_BTRFS_TEMPORARY_ITEM_KEY)) +# define BTRFS_TEMPORARY_ITEM_KEY 248 +#endif +#if !(defined(BTRFS_DEV_STATS_KEY) || (defined(HAVE_DECL_BTRFS_DEV_STATS_KEY) && HAVE_DECL_BTRFS_DEV_STATS_KEY)) +# define BTRFS_DEV_STATS_KEY 249 +#endif +#if !(defined(BTRFS_PERSISTENT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_PERSISTENT_ITEM_KEY) && HAVE_DECL_BTRFS_PERSISTENT_ITEM_KEY)) +# define BTRFS_PERSISTENT_ITEM_KEY 249 +#endif +#if !(defined(BTRFS_DEV_REPLACE_KEY) || (defined(HAVE_DECL_BTRFS_DEV_REPLACE_KEY) && HAVE_DECL_BTRFS_DEV_REPLACE_KEY)) +# define BTRFS_DEV_REPLACE_KEY 250 +#endif +#if !(defined(BTRFS_UUID_KEY_SUBVOL) || (defined(HAVE_DECL_BTRFS_UUID_KEY_SUBVOL) && HAVE_DECL_BTRFS_UUID_KEY_SUBVOL)) +# define BTRFS_UUID_KEY_SUBVOL 251 +#endif +#if !(defined(BTRFS_UUID_KEY_RECEIVED_SUBVOL) || (defined(HAVE_DECL_BTRFS_UUID_KEY_RECEIVED_SUBVOL) && HAVE_DECL_BTRFS_UUID_KEY_RECEIVED_SUBVOL)) +# define BTRFS_UUID_KEY_RECEIVED_SUBVOL 252 +#endif +#if !(defined(BTRFS_STRING_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_STRING_ITEM_KEY) && HAVE_DECL_BTRFS_STRING_ITEM_KEY)) +# define BTRFS_STRING_ITEM_KEY 253 +#endif +#if !(defined(UINT32_MAX) || (defined(HAVE_DECL_UINT32_MAX) && HAVE_DECL_UINT32_MAX)) +# define UINT32_MAX -1U +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_key_types[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_key_types[] = { + XLAT_TYPE(uint64_t, BTRFS_INODE_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_INODE_REF_KEY), + XLAT_TYPE(uint64_t, BTRFS_INODE_EXTREF_KEY), + XLAT_TYPE(uint64_t, BTRFS_XATTR_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_ORPHAN_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_DIR_LOG_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_DIR_LOG_INDEX_KEY), + XLAT_TYPE(uint64_t, BTRFS_DIR_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_DIR_INDEX_KEY), + XLAT_TYPE(uint64_t, BTRFS_EXTENT_DATA_KEY), + XLAT_TYPE(uint64_t, BTRFS_EXTENT_CSUM_KEY), + XLAT_TYPE(uint64_t, BTRFS_ROOT_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_ROOT_BACKREF_KEY), + XLAT_TYPE(uint64_t, BTRFS_ROOT_REF_KEY), + XLAT_TYPE(uint64_t, BTRFS_EXTENT_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_METADATA_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_TREE_BLOCK_REF_KEY), + XLAT_TYPE(uint64_t, BTRFS_EXTENT_DATA_REF_KEY), + XLAT_TYPE(uint64_t, BTRFS_EXTENT_REF_V0_KEY), + XLAT_TYPE(uint64_t, BTRFS_SHARED_BLOCK_REF_KEY), + XLAT_TYPE(uint64_t, BTRFS_SHARED_DATA_REF_KEY), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_FREE_SPACE_INFO_KEY), + XLAT_TYPE(uint64_t, BTRFS_FREE_SPACE_EXTENT_KEY), + XLAT_TYPE(uint64_t, BTRFS_FREE_SPACE_BITMAP_KEY), + XLAT_TYPE(uint64_t, BTRFS_DEV_EXTENT_KEY), + XLAT_TYPE(uint64_t, BTRFS_DEV_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_CHUNK_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_STATUS_KEY), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_INFO_KEY), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_KEY), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_RELATION_KEY), + XLAT_TYPE(uint64_t, BTRFS_BALANCE_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_TEMPORARY_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_DEV_STATS_KEY), + XLAT_TYPE(uint64_t, BTRFS_PERSISTENT_ITEM_KEY), + XLAT_TYPE(uint64_t, BTRFS_DEV_REPLACE_KEY), + XLAT_TYPE(uint64_t, BTRFS_UUID_KEY_SUBVOL), + XLAT_TYPE(uint64_t, BTRFS_UUID_KEY_RECEIVED_SUBVOL), + XLAT_TYPE(uint64_t, BTRFS_STRING_ITEM_KEY), + XLAT_TYPE(uint64_t, UINT32_MAX), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_key_types.in b/xlat/btrfs_key_types.in new file mode 100644 index 00000000..5721e600 --- /dev/null +++ b/xlat/btrfs_key_types.in @@ -0,0 +1,42 @@ +#val_type uint64_t +BTRFS_INODE_ITEM_KEY 1 +BTRFS_INODE_REF_KEY 12 +BTRFS_INODE_EXTREF_KEY 13 +BTRFS_XATTR_ITEM_KEY 24 +BTRFS_ORPHAN_ITEM_KEY 48 +BTRFS_DIR_LOG_ITEM_KEY 60 +BTRFS_DIR_LOG_INDEX_KEY 72 +BTRFS_DIR_ITEM_KEY 84 +BTRFS_DIR_INDEX_KEY 96 +BTRFS_EXTENT_DATA_KEY 108 +BTRFS_EXTENT_CSUM_KEY 128 +BTRFS_ROOT_ITEM_KEY 132 +BTRFS_ROOT_BACKREF_KEY 144 +BTRFS_ROOT_REF_KEY 156 +BTRFS_EXTENT_ITEM_KEY 168 +BTRFS_METADATA_ITEM_KEY 169 +BTRFS_TREE_BLOCK_REF_KEY 176 +BTRFS_EXTENT_DATA_REF_KEY 178 +BTRFS_EXTENT_REF_V0_KEY 180 +BTRFS_SHARED_BLOCK_REF_KEY 182 +BTRFS_SHARED_DATA_REF_KEY 184 +BTRFS_BLOCK_GROUP_ITEM_KEY 192 +BTRFS_FREE_SPACE_INFO_KEY 198 +BTRFS_FREE_SPACE_EXTENT_KEY 199 +BTRFS_FREE_SPACE_BITMAP_KEY 200 +BTRFS_DEV_EXTENT_KEY 204 +BTRFS_DEV_ITEM_KEY 216 +BTRFS_CHUNK_ITEM_KEY 228 +BTRFS_QGROUP_STATUS_KEY 240 +BTRFS_QGROUP_INFO_KEY 242 +BTRFS_QGROUP_LIMIT_KEY 244 +BTRFS_QGROUP_RELATION_KEY 246 +BTRFS_BALANCE_ITEM_KEY 248 +BTRFS_TEMPORARY_ITEM_KEY 248 +BTRFS_DEV_STATS_KEY 249 +BTRFS_PERSISTENT_ITEM_KEY 249 +BTRFS_DEV_REPLACE_KEY 250 +BTRFS_UUID_KEY_SUBVOL 251 +BTRFS_UUID_KEY_RECEIVED_SUBVOL 252 +BTRFS_STRING_ITEM_KEY 253 +UINT32_MAX -1U diff --git a/xlat/btrfs_qgroup_ctl_cmds.h b/xlat/btrfs_qgroup_ctl_cmds.h new file mode 100644 index 00000000..25bdce2f --- /dev/null +++ b/xlat/btrfs_qgroup_ctl_cmds.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_ctl_cmds.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_qgroup_ctl_cmds[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_qgroup_ctl_cmds[] = { +#if defined(BTRFS_QUOTA_CTL_ENABLE) || (defined(HAVE_DECL_BTRFS_QUOTA_CTL_ENABLE) && HAVE_DECL_BTRFS_QUOTA_CTL_ENABLE) + XLAT_TYPE(uint64_t, BTRFS_QUOTA_CTL_ENABLE), +#endif +#if defined(BTRFS_QUOTA_CTL_DISABLE) || (defined(HAVE_DECL_BTRFS_QUOTA_CTL_DISABLE) && HAVE_DECL_BTRFS_QUOTA_CTL_DISABLE) + XLAT_TYPE(uint64_t, BTRFS_QUOTA_CTL_DISABLE), +#endif +#if defined(BTRFS_QUOTA_CTL_RESCAN__NOTUSED) || (defined(HAVE_DECL_BTRFS_QUOTA_CTL_RESCAN__NOTUSED) && HAVE_DECL_BTRFS_QUOTA_CTL_RESCAN__NOTUSED) + XLAT_TYPE(uint64_t, BTRFS_QUOTA_CTL_RESCAN__NOTUSED), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_qgroup_ctl_cmds.in b/xlat/btrfs_qgroup_ctl_cmds.in new file mode 100644 index 00000000..05e20036 --- /dev/null +++ b/xlat/btrfs_qgroup_ctl_cmds.in @@ -0,0 +1,4 @@ +#val_type uint64_t +BTRFS_QUOTA_CTL_ENABLE +BTRFS_QUOTA_CTL_DISABLE +BTRFS_QUOTA_CTL_RESCAN__NOTUSED diff --git a/xlat/btrfs_qgroup_inherit_flags.h b/xlat/btrfs_qgroup_inherit_flags.h new file mode 100644 index 00000000..ead56ea2 --- /dev/null +++ b/xlat/btrfs_qgroup_inherit_flags.h @@ -0,0 +1,19 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_inherit_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_qgroup_inherit_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_qgroup_inherit_flags[] = { +#if defined(BTRFS_QGROUP_INHERIT_SET_LIMITS) || (defined(HAVE_DECL_BTRFS_QGROUP_INHERIT_SET_LIMITS) && HAVE_DECL_BTRFS_QGROUP_INHERIT_SET_LIMITS) + XLAT_TYPE(uint64_t, BTRFS_QGROUP_INHERIT_SET_LIMITS), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_qgroup_inherit_flags.in b/xlat/btrfs_qgroup_inherit_flags.in new file mode 100644 index 00000000..0e133b9c --- /dev/null +++ b/xlat/btrfs_qgroup_inherit_flags.in @@ -0,0 +1,2 @@ +#val_type uint64_t +BTRFS_QGROUP_INHERIT_SET_LIMITS diff --git a/xlat/btrfs_qgroup_limit_flags.h b/xlat/btrfs_qgroup_limit_flags.h new file mode 100644 index 00000000..114c8760 --- /dev/null +++ b/xlat/btrfs_qgroup_limit_flags.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_limit_flags.in; do not edit. */ +#if !(defined(BTRFS_QGROUP_LIMIT_MAX_RFER) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_RFER) && HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_RFER)) +# define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0) +#endif +#if !(defined(BTRFS_QGROUP_LIMIT_MAX_EXCL) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_EXCL) && HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_EXCL)) +# define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1) +#endif +#if !(defined(BTRFS_QGROUP_LIMIT_RSV_RFER) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_RFER) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_RFER)) +# define BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2) +#endif +#if !(defined(BTRFS_QGROUP_LIMIT_RSV_EXCL) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_EXCL) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_EXCL)) +# define BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3) +#endif +#if !(defined(BTRFS_QGROUP_LIMIT_RFER_CMPR) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RFER_CMPR) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RFER_CMPR)) +# define BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4) +#endif +#if !(defined(BTRFS_QGROUP_LIMIT_EXCL_CMPR) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_EXCL_CMPR) && HAVE_DECL_BTRFS_QGROUP_LIMIT_EXCL_CMPR)) +# define BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_qgroup_limit_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_qgroup_limit_flags[] = { + XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_MAX_RFER), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_MAX_EXCL), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_RSV_RFER), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_RSV_EXCL), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_RFER_CMPR), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_EXCL_CMPR), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_qgroup_limit_flags.in b/xlat/btrfs_qgroup_limit_flags.in new file mode 100644 index 00000000..bac7abed --- /dev/null +++ b/xlat/btrfs_qgroup_limit_flags.in @@ -0,0 +1,7 @@ +#val_type uint64_t +BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0) +BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1) +BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2) +BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3) +BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4) +BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5) diff --git a/xlat/btrfs_qgroup_status_flags.h b/xlat/btrfs_qgroup_status_flags.h new file mode 100644 index 00000000..d02a86bd --- /dev/null +++ b/xlat/btrfs_qgroup_status_flags.h @@ -0,0 +1,24 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_status_flags.in; do not edit. */ +#if !(defined(BTRFS_QGROUP_STATUS_FLAG_ON) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_ON) && HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_ON)) +# define BTRFS_QGROUP_STATUS_FLAG_ON (1ULL << 0) +#endif +#if !(defined(BTRFS_QGROUP_STATUS_FLAG_RESCAN) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_RESCAN) && HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_RESCAN)) +# define BTRFS_QGROUP_STATUS_FLAG_RESCAN (1ULL << 1) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_qgroup_status_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_qgroup_status_flags[] = { + XLAT_TYPE(uint64_t, BTRFS_QGROUP_STATUS_FLAG_ON), + XLAT_TYPE(uint64_t, BTRFS_QGROUP_STATUS_FLAG_RESCAN), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_qgroup_status_flags.in b/xlat/btrfs_qgroup_status_flags.in new file mode 100644 index 00000000..86f60ac5 --- /dev/null +++ b/xlat/btrfs_qgroup_status_flags.in @@ -0,0 +1,3 @@ +#val_type uint64_t +BTRFS_QGROUP_STATUS_FLAG_ON (1ULL << 0) +BTRFS_QGROUP_STATUS_FLAG_RESCAN (1ULL << 1) diff --git a/xlat/btrfs_scrub_flags.h b/xlat/btrfs_scrub_flags.h new file mode 100644 index 00000000..5823e347 --- /dev/null +++ b/xlat/btrfs_scrub_flags.h @@ -0,0 +1,20 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_scrub_flags.in; do not edit. */ +#if !(defined(BTRFS_SCRUB_READONLY) || (defined(HAVE_DECL_BTRFS_SCRUB_READONLY) && HAVE_DECL_BTRFS_SCRUB_READONLY)) +# define BTRFS_SCRUB_READONLY 1 +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_scrub_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_scrub_flags[] = { + XLAT_TYPE(uint64_t, BTRFS_SCRUB_READONLY), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_scrub_flags.in b/xlat/btrfs_scrub_flags.in new file mode 100644 index 00000000..914de3d1 --- /dev/null +++ b/xlat/btrfs_scrub_flags.in @@ -0,0 +1,2 @@ +#val_type uint64_t +BTRFS_SCRUB_READONLY 1 diff --git a/xlat/btrfs_send_flags.h b/xlat/btrfs_send_flags.h new file mode 100644 index 00000000..be2b02a6 --- /dev/null +++ b/xlat/btrfs_send_flags.h @@ -0,0 +1,28 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_send_flags.in; do not edit. */ +#if !(defined(BTRFS_SEND_FLAG_NO_FILE_DATA) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_NO_FILE_DATA) && HAVE_DECL_BTRFS_SEND_FLAG_NO_FILE_DATA)) +# define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1 +#endif +#if !(defined(BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) && HAVE_DECL_BTRFS_SEND_FLAG_OMIT_STREAM_HEADER)) +# define BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2 +#endif +#if !(defined(BTRFS_SEND_FLAG_OMIT_END_CMD) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_OMIT_END_CMD) && HAVE_DECL_BTRFS_SEND_FLAG_OMIT_END_CMD)) +# define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4 +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_send_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_send_flags[] = { + XLAT(BTRFS_SEND_FLAG_NO_FILE_DATA), + XLAT(BTRFS_SEND_FLAG_OMIT_STREAM_HEADER), + XLAT(BTRFS_SEND_FLAG_OMIT_END_CMD), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_send_flags.in b/xlat/btrfs_send_flags.in new file mode 100644 index 00000000..652ef390 --- /dev/null +++ b/xlat/btrfs_send_flags.in @@ -0,0 +1,3 @@ +BTRFS_SEND_FLAG_NO_FILE_DATA 0x1 +BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2 +BTRFS_SEND_FLAG_OMIT_END_CMD 0x4 diff --git a/xlat/btrfs_snap_flags_v2.h b/xlat/btrfs_snap_flags_v2.h new file mode 100644 index 00000000..42088520 --- /dev/null +++ b/xlat/btrfs_snap_flags_v2.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_snap_flags_v2.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat btrfs_snap_flags_v2[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_snap_flags_v2[] = { +#if defined(BTRFS_SUBVOL_CREATE_ASYNC) || (defined(HAVE_DECL_BTRFS_SUBVOL_CREATE_ASYNC) && HAVE_DECL_BTRFS_SUBVOL_CREATE_ASYNC) + XLAT_TYPE(uint64_t, BTRFS_SUBVOL_CREATE_ASYNC), +#endif +#if defined(BTRFS_SUBVOL_RDONLY) || (defined(HAVE_DECL_BTRFS_SUBVOL_RDONLY) && HAVE_DECL_BTRFS_SUBVOL_RDONLY) + XLAT_TYPE(uint64_t, BTRFS_SUBVOL_RDONLY), +#endif +#if defined(BTRFS_SUBVOL_QGROUP_INHERIT) || (defined(HAVE_DECL_BTRFS_SUBVOL_QGROUP_INHERIT) && HAVE_DECL_BTRFS_SUBVOL_QGROUP_INHERIT) + XLAT_TYPE(uint64_t, BTRFS_SUBVOL_QGROUP_INHERIT), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_snap_flags_v2.in b/xlat/btrfs_snap_flags_v2.in new file mode 100644 index 00000000..43ea5749 --- /dev/null +++ b/xlat/btrfs_snap_flags_v2.in @@ -0,0 +1,4 @@ +#val_type uint64_t +BTRFS_SUBVOL_CREATE_ASYNC +BTRFS_SUBVOL_RDONLY +BTRFS_SUBVOL_QGROUP_INHERIT diff --git a/xlat/btrfs_space_info_flags.h b/xlat/btrfs_space_info_flags.h new file mode 100644 index 00000000..7dcf06c4 --- /dev/null +++ b/xlat/btrfs_space_info_flags.h @@ -0,0 +1,60 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_space_info_flags.in; do not edit. */ +#if !(defined(BTRFS_BLOCK_GROUP_DATA) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_DATA) && HAVE_DECL_BTRFS_BLOCK_GROUP_DATA)) +# define BTRFS_BLOCK_GROUP_DATA (1ULL << 0) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_SYSTEM) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_SYSTEM) && HAVE_DECL_BTRFS_BLOCK_GROUP_SYSTEM)) +# define BTRFS_BLOCK_GROUP_SYSTEM (1ULL << 1) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_METADATA) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_METADATA) && HAVE_DECL_BTRFS_BLOCK_GROUP_METADATA)) +# define BTRFS_BLOCK_GROUP_METADATA (1ULL << 2) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_RAID0) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID0) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID0)) +# define BTRFS_BLOCK_GROUP_RAID0 (1ULL << 3) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_RAID1) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID1) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID1)) +# define BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_DUP) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_DUP) && HAVE_DECL_BTRFS_BLOCK_GROUP_DUP)) +# define BTRFS_BLOCK_GROUP_DUP (1ULL << 5) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_RAID10) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID10) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID10)) +# define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_RAID5) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID5) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID5)) +# define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7) +#endif +#if !(defined(BTRFS_BLOCK_GROUP_RAID6) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID6) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID6)) +# define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8) +#endif +#if !(defined(BTRFS_AVAIL_ALLOC_BIT_SINGLE) || (defined(HAVE_DECL_BTRFS_AVAIL_ALLOC_BIT_SINGLE) && HAVE_DECL_BTRFS_AVAIL_ALLOC_BIT_SINGLE)) +# define BTRFS_AVAIL_ALLOC_BIT_SINGLE (1ULL << 48) +#endif +#if !(defined(BTRFS_SPACE_INFO_GLOBAL_RSV) || (defined(HAVE_DECL_BTRFS_SPACE_INFO_GLOBAL_RSV) && HAVE_DECL_BTRFS_SPACE_INFO_GLOBAL_RSV)) +# define BTRFS_SPACE_INFO_GLOBAL_RSV (1ULL << 49) +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_space_info_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_space_info_flags[] = { + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_DATA), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_SYSTEM), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_METADATA), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_RAID0), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_RAID1), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_DUP), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_RAID10), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_RAID5), + XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_RAID6), + XLAT_TYPE(uint64_t, BTRFS_AVAIL_ALLOC_BIT_SINGLE), + XLAT_TYPE(uint64_t, BTRFS_SPACE_INFO_GLOBAL_RSV), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_space_info_flags.in b/xlat/btrfs_space_info_flags.in new file mode 100644 index 00000000..be6d1951 --- /dev/null +++ b/xlat/btrfs_space_info_flags.in @@ -0,0 +1,12 @@ +#val_type uint64_t +BTRFS_BLOCK_GROUP_DATA (1ULL << 0) +BTRFS_BLOCK_GROUP_SYSTEM (1ULL << 1) +BTRFS_BLOCK_GROUP_METADATA (1ULL << 2) +BTRFS_BLOCK_GROUP_RAID0 (1ULL << 3) +BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4) +BTRFS_BLOCK_GROUP_DUP (1ULL << 5) +BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6) +BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7) +BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8) +BTRFS_AVAIL_ALLOC_BIT_SINGLE (1ULL << 48) +BTRFS_SPACE_INFO_GLOBAL_RSV (1ULL << 49) diff --git a/xlat/btrfs_tree_objectids.h b/xlat/btrfs_tree_objectids.h new file mode 100644 index 00000000..f96ee7f0 --- /dev/null +++ b/xlat/btrfs_tree_objectids.h @@ -0,0 +1,68 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_tree_objectids.in; do not edit. */ +#if !(defined(BTRFS_ROOT_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_ROOT_TREE_OBJECTID) && HAVE_DECL_BTRFS_ROOT_TREE_OBJECTID)) +# define BTRFS_ROOT_TREE_OBJECTID 1ULL +#endif +#if !(defined(BTRFS_EXTENT_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_EXTENT_TREE_OBJECTID) && HAVE_DECL_BTRFS_EXTENT_TREE_OBJECTID)) +# define BTRFS_EXTENT_TREE_OBJECTID 2ULL +#endif +#if !(defined(BTRFS_CHUNK_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_CHUNK_TREE_OBJECTID) && HAVE_DECL_BTRFS_CHUNK_TREE_OBJECTID)) +# define BTRFS_CHUNK_TREE_OBJECTID 3ULL +#endif +#if !(defined(BTRFS_DEV_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_DEV_TREE_OBJECTID) && HAVE_DECL_BTRFS_DEV_TREE_OBJECTID)) +# define BTRFS_DEV_TREE_OBJECTID 4ULL +#endif +#if !(defined(BTRFS_FS_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FS_TREE_OBJECTID) && HAVE_DECL_BTRFS_FS_TREE_OBJECTID)) +# define BTRFS_FS_TREE_OBJECTID 5ULL +#endif +#if !(defined(BTRFS_ROOT_TREE_DIR_OBJECTID) || (defined(HAVE_DECL_BTRFS_ROOT_TREE_DIR_OBJECTID) && HAVE_DECL_BTRFS_ROOT_TREE_DIR_OBJECTID)) +# define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL +#endif +#if !(defined(BTRFS_CSUM_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_CSUM_TREE_OBJECTID) && HAVE_DECL_BTRFS_CSUM_TREE_OBJECTID)) +# define BTRFS_CSUM_TREE_OBJECTID 7ULL +#endif +#if !(defined(BTRFS_QUOTA_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_QUOTA_TREE_OBJECTID) && HAVE_DECL_BTRFS_QUOTA_TREE_OBJECTID)) +# define BTRFS_QUOTA_TREE_OBJECTID 8ULL +#endif +#if !(defined(BTRFS_UUID_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_UUID_TREE_OBJECTID) && HAVE_DECL_BTRFS_UUID_TREE_OBJECTID)) +# define BTRFS_UUID_TREE_OBJECTID 9ULL +#endif +#if !(defined(BTRFS_FREE_SPACE_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_TREE_OBJECTID) && HAVE_DECL_BTRFS_FREE_SPACE_TREE_OBJECTID)) +# define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL +#endif +#if !(defined(BTRFS_FIRST_FREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FIRST_FREE_OBJECTID) && HAVE_DECL_BTRFS_FIRST_FREE_OBJECTID)) +# define BTRFS_FIRST_FREE_OBJECTID 256ULL +#endif +#if !(defined(BTRFS_LAST_FREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_LAST_FREE_OBJECTID) && HAVE_DECL_BTRFS_LAST_FREE_OBJECTID)) +# define BTRFS_LAST_FREE_OBJECTID -256ULL +#endif +#if !(defined(UINT64_MAX) || (defined(HAVE_DECL_UINT64_MAX) && HAVE_DECL_UINT64_MAX)) +# define UINT64_MAX -1ULL +#endif + +#ifdef IN_MPERS + +extern const struct xlat btrfs_tree_objectids[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_tree_objectids[] = { + XLAT_TYPE(uint64_t, BTRFS_ROOT_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_EXTENT_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_CHUNK_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_DEV_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_FS_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_ROOT_TREE_DIR_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_CSUM_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_QUOTA_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_UUID_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_FREE_SPACE_TREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_FIRST_FREE_OBJECTID), + XLAT_TYPE(uint64_t, BTRFS_LAST_FREE_OBJECTID), + XLAT_TYPE(uint64_t, UINT64_MAX), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/btrfs_tree_objectids.in b/xlat/btrfs_tree_objectids.in new file mode 100644 index 00000000..0b6e598c --- /dev/null +++ b/xlat/btrfs_tree_objectids.in @@ -0,0 +1,14 @@ +#val_type uint64_t +BTRFS_ROOT_TREE_OBJECTID 1ULL +BTRFS_EXTENT_TREE_OBJECTID 2ULL +BTRFS_CHUNK_TREE_OBJECTID 3ULL +BTRFS_DEV_TREE_OBJECTID 4ULL +BTRFS_FS_TREE_OBJECTID 5ULL +BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL +BTRFS_CSUM_TREE_OBJECTID 7ULL +BTRFS_QUOTA_TREE_OBJECTID 8ULL +BTRFS_UUID_TREE_OBJECTID 9ULL +BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL +BTRFS_FIRST_FREE_OBJECTID 256ULL +BTRFS_LAST_FREE_OBJECTID -256ULL +UINT64_MAX -1ULL diff --git a/xlat/cacheflush_scope.h b/xlat/cacheflush_scope.h index 62459f54..48597741 100644 --- a/xlat/cacheflush_scope.h +++ b/xlat/cacheflush_scope.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/cacheflush_scope.in; do not edit. */ -static const struct xlat cacheflush_scope[] = { +#ifdef IN_MPERS + +# error static const struct xlat cacheflush_scope in mpers mode + +#else + +static +const struct xlat cacheflush_scope[] = { #if defined(FLUSH_SCOPE_LINE) || (defined(HAVE_DECL_FLUSH_SCOPE_LINE) && HAVE_DECL_FLUSH_SCOPE_LINE) - XLAT(FLUSH_SCOPE_LINE), + XLAT(FLUSH_SCOPE_LINE), #endif #if defined(FLUSH_SCOPE_PAGE) || (defined(HAVE_DECL_FLUSH_SCOPE_PAGE) && HAVE_DECL_FLUSH_SCOPE_PAGE) - XLAT(FLUSH_SCOPE_PAGE), + XLAT(FLUSH_SCOPE_PAGE), #endif #if defined(FLUSH_SCOPE_ALL) || (defined(HAVE_DECL_FLUSH_SCOPE_ALL) && HAVE_DECL_FLUSH_SCOPE_ALL) - XLAT(FLUSH_SCOPE_ALL), + XLAT(FLUSH_SCOPE_ALL), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/cap.h b/xlat/cap.h new file mode 100644 index 00000000..fb50990e --- /dev/null +++ b/xlat/cap.h @@ -0,0 +1,52 @@ +/* Generated by ./xlat/gen.sh from ./xlat/cap.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat cap in mpers mode + +#else + +static +const struct xlat cap[] = { + XLAT(CAP_CHOWN), + XLAT(CAP_DAC_OVERRIDE), + XLAT(CAP_DAC_READ_SEARCH), + XLAT(CAP_FOWNER), + XLAT(CAP_FSETID), + XLAT(CAP_KILL), + XLAT(CAP_SETGID), + XLAT(CAP_SETUID), + XLAT(CAP_SETPCAP), + XLAT(CAP_LINUX_IMMUTABLE), + XLAT(CAP_NET_BIND_SERVICE), + XLAT(CAP_NET_BROADCAST), + XLAT(CAP_NET_ADMIN), + XLAT(CAP_NET_RAW), + XLAT(CAP_IPC_LOCK), + XLAT(CAP_IPC_OWNER), + XLAT(CAP_SYS_MODULE), + XLAT(CAP_SYS_RAWIO), + XLAT(CAP_SYS_CHROOT), + XLAT(CAP_SYS_PTRACE), + XLAT(CAP_SYS_PACCT), + XLAT(CAP_SYS_ADMIN), + XLAT(CAP_SYS_BOOT), + XLAT(CAP_SYS_NICE), + XLAT(CAP_SYS_RESOURCE), + XLAT(CAP_SYS_TIME), + XLAT(CAP_SYS_TTY_CONFIG), + XLAT(CAP_MKNOD), + XLAT(CAP_LEASE), + XLAT(CAP_AUDIT_WRITE), + XLAT(CAP_AUDIT_CONTROL), + XLAT(CAP_SETFCAP), + XLAT(CAP_MAC_OVERRIDE), + XLAT(CAP_MAC_ADMIN), + XLAT(CAP_SYSLOG), + XLAT(CAP_WAKE_ALARM), + XLAT(CAP_BLOCK_SUSPEND), + XLAT(CAP_AUDIT_READ), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/cap.in b/xlat/cap.in new file mode 100644 index 00000000..bbac8d31 --- /dev/null +++ b/xlat/cap.in @@ -0,0 +1,39 @@ +#unconditional +CAP_CHOWN +CAP_DAC_OVERRIDE +CAP_DAC_READ_SEARCH +CAP_FOWNER +CAP_FSETID +CAP_KILL +CAP_SETGID +CAP_SETUID +CAP_SETPCAP +CAP_LINUX_IMMUTABLE +CAP_NET_BIND_SERVICE +CAP_NET_BROADCAST +CAP_NET_ADMIN +CAP_NET_RAW +CAP_IPC_LOCK +CAP_IPC_OWNER +CAP_SYS_MODULE +CAP_SYS_RAWIO +CAP_SYS_CHROOT +CAP_SYS_PTRACE +CAP_SYS_PACCT +CAP_SYS_ADMIN +CAP_SYS_BOOT +CAP_SYS_NICE +CAP_SYS_RESOURCE +CAP_SYS_TIME +CAP_SYS_TTY_CONFIG +CAP_MKNOD +CAP_LEASE +CAP_AUDIT_WRITE +CAP_AUDIT_CONTROL +CAP_SETFCAP +CAP_MAC_OVERRIDE +CAP_MAC_ADMIN +CAP_SYSLOG +CAP_WAKE_ALARM +CAP_BLOCK_SUSPEND +CAP_AUDIT_READ diff --git a/xlat/cap_mask0.h b/xlat/cap_mask0.h new file mode 100644 index 00000000..4402dc22 --- /dev/null +++ b/xlat/cap_mask0.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/cap_mask0.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat cap_mask0 in mpers mode + +#else + +static +const struct xlat cap_mask0[] = { + XLAT_PAIR(1ULL< +# Copyright (c) 2014-2015 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -usage() { +usage() +{ cat < @@ -10,51 +37,193 @@ EOF exit 1 } -gen_header() { +cond_def() +{ + local line + line="$1"; shift + + local val + val="$(printf %s "$line" | + sed -r -n 's/^([^[:space:]]+).*$/\1/p')" + + local def + def="$(printf %s "${line}" | + sed -r -n 's/^[^[:space:]]+[[:space:]]+([^[:space:]].*)$/\1/p')" + + if [ -n "$def" ]; then + cat <<-EOF + #if !(defined($val) || (defined(HAVE_DECL_$val) && HAVE_DECL_$val)) + # define $val $def + #endif + EOF + fi +} + +print_xlat() +{ + local val + val="$1"; shift + + if [ -z "${val_type-}" ]; then + echo " XLAT(${val})," + else + echo " XLAT_TYPE(${val_type}, ${val})," + fi +} + +print_xlat_pair() +{ + local val str + val="$1"; shift + str="$1"; shift + + if [ -z "${val_type-}" ]; then + echo " XLAT_PAIR(${val}, \"${str}\")," + else + echo " XLAT_TYPE_PAIR(${val_type}, ${val}, \"${str}\")," + fi +} + +cond_xlat() +{ + local line val m def xlat + line="$1"; shift + + val="$(printf %s "${line}" | sed -r -n 's/^([^[:space:]]+).*$/\1/p')" + m="${val%%|*}" + def="$(printf %s "${line}" | + sed -r -n 's/^[^[:space:]]+[[:space:]]+([^[:space:]].*)$/\1/p')" + + if [ "${m}" = "${m#1<<}" ]; then + xlat="$(print_xlat "${val}")" + else + xlat="$(print_xlat_pair "1ULL<<${val#1<<}" "${val}")" + m="${m#1<<}" + fi + + if [ -z "${def}" ]; then + cat <<-EOF + #if defined(${m}) || (defined(HAVE_DECL_${m}) && HAVE_DECL_${m}) + ${xlat} + #endif + EOF + else + echo "$xlat" + fi +} + +gen_header() +{ local input="$1" output="$2" name="$3" echo "generating ${output}" ( local defs="${0%/*}/../defs.h" - local prefix - if grep -x "extern const struct xlat ${name}\\[\\];" "${defs}" > /dev/null; then - prefix= - else - prefix='static ' + local mpers="${0%/*}/../mpers_xlat.h" + local decl="extern const struct xlat ${name}[];" + local in_defs= in_mpers= + + if grep -F -x "$decl" "$defs" > /dev/null; then + in_defs=1 + elif grep -F -x "$decl" "$mpers" > /dev/null; then + in_mpers=1 fi - cat <<-EOF - /* Generated by $0 from $1; do not edit. */ + echo "/* Generated by $0 from $1; do not edit. */" - ${prefix}const struct xlat ${name}[] = { - EOF local unconditional= unterminated= line + # 1st pass: output directives. while read line; do LC_COLLATE=C - case ${line} in + case $line in + '#stop') + exit 0 + ;; + '#conditional') + unconditional= + ;; '#unconditional') unconditional=1 ;; '#unterminated') unterminated=1 ;; + '#val_type '*) + # to be processed during 2nd pass + ;; + '#'*) + echo "${line}" + ;; + [A-Z_]*) + [ -n "$unconditional" ] || + cond_def "$line" + ;; + esac + done < "$input" + + echo + if [ -n "$in_defs" ]; then + cat <<-EOF + #ifndef IN_MPERS + + EOF + elif [ -n "$in_mpers" ]; then + cat <<-EOF + #ifdef IN_MPERS + + ${decl} + + #else + + # if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) + static + # endif + EOF + else + cat <<-EOF + #ifdef IN_MPERS + + # error static const struct xlat ${name} in mpers mode + + #else + + static + EOF + fi + echo "const struct xlat ${name}[] = {" + + unconditional= val_type= + # 2nd pass: output everything. + while read line; do + LC_COLLATE=C + case ${line} in + '#conditional') + unconditional= + ;; + '#unconditional') + unconditional=1 + ;; + '#unterminated') + # processed during 1st pass + ;; + '#val_type '*) + val_type="${line#\#val_type }" + ;; [A-Z_]*) # symbolic constants - local m="${line%%|*}" - [ -n "${unconditional}" ] || - echo "#if defined(${m}) || (defined(HAVE_DECL_${m}) && HAVE_DECL_${m})" - echo " XLAT(${line})," - [ -n "${unconditional}" ] || - echo "#endif" + if [ -n "${unconditional}" ]; then + print_xlat "${line}" + else + cond_xlat "${line}" + fi ;; '1<<'[A-Z_]*) # symbolic constants with shift - local m="${line#1<<}" - [ -n "${unconditional}" ] || - echo "#if defined(${m}) || (defined(HAVE_DECL_${m}) && HAVE_DECL_${m})" - echo " { ${line}, \"${m}\" }," - [ -n "${unconditional}" ] || - echo "#endif" + if [ -n "${unconditional}" ]; then + print_xlat_pair "1ULL<<${line#1<<}" "${line}" + else + cond_xlat "${line}" + fi ;; [0-9]*) # numeric constants - echo " XLAT(${line})," + print_xlat "${line}" ;; *) # verbatim lines echo "${line}" @@ -62,15 +231,21 @@ gen_header() { esac done < "${input}" if [ -n "${unterminated}" ]; then - echo " /* this array should remain not NULL-terminated */" + echo " /* this array should remain not NULL-terminated */" else - echo " XLAT_END" + echo " XLAT_END" fi - echo "};" + + cat <<-EOF + }; + + #endif /* !IN_MPERS */ + EOF ) >"${output}" } -gen_make() { +gen_make() +{ local output="$1" local name shift @@ -90,7 +265,8 @@ gen_make() { ) >"${output}" } -gen_git() { +gen_git() +{ local output="$1" shift echo "generating ${output}" @@ -100,7 +276,8 @@ gen_git() { ) >"${output}" } -main() { +main() +{ case $# in 0) set -- "${0%/*}" "${0%/*}" ;; 2) ;; @@ -110,6 +287,10 @@ main() { local input="$1" local output="$2" local name + local jobs=0 + local ncpus="$(getconf _NPROCESSORS_ONLN)" + [ "${ncpus}" -ge 1 ] || + ncpus=1 if [ -d "${input}" ]; then local f names= @@ -119,6 +300,11 @@ main() { name=${name%.in} gen_header "${f}" "${output}/${name}.h" "${name}" & names="${names} ${name}" + : $(( jobs += 1 )) + if [ ${jobs} -ge ${ncpus} ]; then + jobs=0 + wait + fi done gen_git "${output}/.gitignore" ${names} gen_make "${output}/Makemodule.am" ${names} diff --git a/xlat/getrandom_flags.h b/xlat/getrandom_flags.h new file mode 100644 index 00000000..6b88199f --- /dev/null +++ b/xlat/getrandom_flags.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/getrandom_flags.in; do not edit. */ +#if !(defined(GRND_NONBLOCK) || (defined(HAVE_DECL_GRND_NONBLOCK) && HAVE_DECL_GRND_NONBLOCK)) +# define GRND_NONBLOCK 1 +#endif +#if !(defined(GRND_RANDOM) || (defined(HAVE_DECL_GRND_RANDOM) && HAVE_DECL_GRND_RANDOM)) +# define GRND_RANDOM 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat getrandom_flags in mpers mode + +#else + +static +const struct xlat getrandom_flags[] = { + XLAT(GRND_NONBLOCK), + XLAT(GRND_RANDOM), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/getrandom_flags.in b/xlat/getrandom_flags.in new file mode 100644 index 00000000..ad1a7580 --- /dev/null +++ b/xlat/getrandom_flags.in @@ -0,0 +1,2 @@ +GRND_NONBLOCK 1 +GRND_RANDOM 2 diff --git a/xlat/getsockipoptions.h b/xlat/getsockipoptions.h new file mode 100644 index 00000000..cd043a1f --- /dev/null +++ b/xlat/getsockipoptions.h @@ -0,0 +1,83 @@ +/* Generated by ./xlat/gen.sh from ./xlat/getsockipoptions.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat getsockipoptions in mpers mode + +#else + +static +const struct xlat getsockipoptions[] = { +/* +* Options specific to getsockopt(SOL_IP). +* Common {g,s}etsockopt(SOL_IP) options +* should be in sockipoptions.in instead. +*/ + +#if defined(ARPT_SO_GET_INFO) || (defined(HAVE_DECL_ARPT_SO_GET_INFO) && HAVE_DECL_ARPT_SO_GET_INFO) + XLAT(ARPT_SO_GET_INFO), +#endif +#if defined(ARPT_SO_GET_ENTRIES) || (defined(HAVE_DECL_ARPT_SO_GET_ENTRIES) && HAVE_DECL_ARPT_SO_GET_ENTRIES) + XLAT(ARPT_SO_GET_ENTRIES), +#endif +#if defined(ARPT_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_ARPT_SO_GET_REVISION_MATCH) && HAVE_DECL_ARPT_SO_GET_REVISION_MATCH) + XLAT(ARPT_SO_GET_REVISION_MATCH), +#endif +#if defined(ARPT_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_ARPT_SO_GET_REVISION_TARGET) && HAVE_DECL_ARPT_SO_GET_REVISION_TARGET) + XLAT(ARPT_SO_GET_REVISION_TARGET), +#endif + +#if defined(EBT_SO_GET_INFO) || (defined(HAVE_DECL_EBT_SO_GET_INFO) && HAVE_DECL_EBT_SO_GET_INFO) + XLAT(EBT_SO_GET_INFO), +#endif +#if defined(EBT_SO_GET_ENTRIES) || (defined(HAVE_DECL_EBT_SO_GET_ENTRIES) && HAVE_DECL_EBT_SO_GET_ENTRIES) + XLAT(EBT_SO_GET_ENTRIES), +#endif +#if defined(EBT_SO_GET_INIT_INFO) || (defined(HAVE_DECL_EBT_SO_GET_INIT_INFO) && HAVE_DECL_EBT_SO_GET_INIT_INFO) + XLAT(EBT_SO_GET_INIT_INFO), +#endif +#if defined(EBT_SO_GET_INIT_ENTRIES) || (defined(HAVE_DECL_EBT_SO_GET_INIT_ENTRIES) && HAVE_DECL_EBT_SO_GET_INIT_ENTRIES) + XLAT(EBT_SO_GET_INIT_ENTRIES), +#endif + +#if defined(IP_VS_SO_GET_VERSION) || (defined(HAVE_DECL_IP_VS_SO_GET_VERSION) && HAVE_DECL_IP_VS_SO_GET_VERSION) + XLAT(IP_VS_SO_GET_VERSION), +#endif +#if defined(IP_VS_SO_GET_INFO) || (defined(HAVE_DECL_IP_VS_SO_GET_INFO) && HAVE_DECL_IP_VS_SO_GET_INFO) + XLAT(IP_VS_SO_GET_INFO), +#endif +#if defined(IP_VS_SO_GET_SERVICES) || (defined(HAVE_DECL_IP_VS_SO_GET_SERVICES) && HAVE_DECL_IP_VS_SO_GET_SERVICES) + XLAT(IP_VS_SO_GET_SERVICES), +#endif +#if defined(IP_VS_SO_GET_SERVICE) || (defined(HAVE_DECL_IP_VS_SO_GET_SERVICE) && HAVE_DECL_IP_VS_SO_GET_SERVICE) + XLAT(IP_VS_SO_GET_SERVICE), +#endif +#if defined(IP_VS_SO_GET_DESTS) || (defined(HAVE_DECL_IP_VS_SO_GET_DESTS) && HAVE_DECL_IP_VS_SO_GET_DESTS) + XLAT(IP_VS_SO_GET_DESTS), +#endif +#if defined(IP_VS_SO_GET_DEST) || (defined(HAVE_DECL_IP_VS_SO_GET_DEST) && HAVE_DECL_IP_VS_SO_GET_DEST) + XLAT(IP_VS_SO_GET_DEST), +#endif +#if defined(IP_VS_SO_GET_TIMEOUT) || (defined(HAVE_DECL_IP_VS_SO_GET_TIMEOUT) && HAVE_DECL_IP_VS_SO_GET_TIMEOUT) + XLAT(IP_VS_SO_GET_TIMEOUT), +#endif +#if defined(IP_VS_SO_GET_DAEMON) || (defined(HAVE_DECL_IP_VS_SO_GET_DAEMON) && HAVE_DECL_IP_VS_SO_GET_DAEMON) + XLAT(IP_VS_SO_GET_DAEMON), +#endif + +#if defined(IPT_SO_GET_INFO) || (defined(HAVE_DECL_IPT_SO_GET_INFO) && HAVE_DECL_IPT_SO_GET_INFO) + XLAT(IPT_SO_GET_INFO), +#endif +#if defined(IPT_SO_GET_ENTRIES) || (defined(HAVE_DECL_IPT_SO_GET_ENTRIES) && HAVE_DECL_IPT_SO_GET_ENTRIES) + XLAT(IPT_SO_GET_ENTRIES), +#endif +#if defined(IPT_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_IPT_SO_GET_REVISION_MATCH) && HAVE_DECL_IPT_SO_GET_REVISION_MATCH) + XLAT(IPT_SO_GET_REVISION_MATCH), +#endif +#if defined(IPT_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_IPT_SO_GET_REVISION_TARGET) && HAVE_DECL_IPT_SO_GET_REVISION_TARGET) + XLAT(IPT_SO_GET_REVISION_TARGET), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/getsockipoptions.in b/xlat/getsockipoptions.in new file mode 100644 index 00000000..847cec2a --- /dev/null +++ b/xlat/getsockipoptions.in @@ -0,0 +1,29 @@ +/* + * Options specific to getsockopt(SOL_IP). + * Common {g,s}etsockopt(SOL_IP) options + * should be in sockipoptions.in instead. + */ + +ARPT_SO_GET_INFO +ARPT_SO_GET_ENTRIES +ARPT_SO_GET_REVISION_MATCH +ARPT_SO_GET_REVISION_TARGET + +EBT_SO_GET_INFO +EBT_SO_GET_ENTRIES +EBT_SO_GET_INIT_INFO +EBT_SO_GET_INIT_ENTRIES + +IP_VS_SO_GET_VERSION +IP_VS_SO_GET_INFO +IP_VS_SO_GET_SERVICES +IP_VS_SO_GET_SERVICE +IP_VS_SO_GET_DESTS +IP_VS_SO_GET_DEST +IP_VS_SO_GET_TIMEOUT +IP_VS_SO_GET_DAEMON + +IPT_SO_GET_INFO +IPT_SO_GET_ENTRIES +IPT_SO_GET_REVISION_MATCH +IPT_SO_GET_REVISION_TARGET diff --git a/xlat/getsockipv6options.h b/xlat/getsockipv6options.h new file mode 100644 index 00000000..402be181 --- /dev/null +++ b/xlat/getsockipv6options.h @@ -0,0 +1,32 @@ +/* Generated by ./xlat/gen.sh from ./xlat/getsockipv6options.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat getsockipv6options in mpers mode + +#else + +static +const struct xlat getsockipv6options[] = { +/* +* Options specific to getsockopt(SOL_IPV6). +* Common {g,s}etsockopt(SOL_IPV6) options +* should be in sockipv6options.in instead. +*/ + +#if defined(IP6T_SO_GET_INFO) || (defined(HAVE_DECL_IP6T_SO_GET_INFO) && HAVE_DECL_IP6T_SO_GET_INFO) + XLAT(IP6T_SO_GET_INFO), +#endif +#if defined(IP6T_SO_GET_ENTRIES) || (defined(HAVE_DECL_IP6T_SO_GET_ENTRIES) && HAVE_DECL_IP6T_SO_GET_ENTRIES) + XLAT(IP6T_SO_GET_ENTRIES), +#endif +#if defined(IP6T_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_IP6T_SO_GET_REVISION_MATCH) && HAVE_DECL_IP6T_SO_GET_REVISION_MATCH) + XLAT(IP6T_SO_GET_REVISION_MATCH), +#endif +#if defined(IP6T_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_IP6T_SO_GET_REVISION_TARGET) && HAVE_DECL_IP6T_SO_GET_REVISION_TARGET) + XLAT(IP6T_SO_GET_REVISION_TARGET), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/getsockipv6options.in b/xlat/getsockipv6options.in new file mode 100644 index 00000000..da44a101 --- /dev/null +++ b/xlat/getsockipv6options.in @@ -0,0 +1,10 @@ +/* + * Options specific to getsockopt(SOL_IPV6). + * Common {g,s}etsockopt(SOL_IPV6) options + * should be in sockipv6options.in instead. + */ + +IP6T_SO_GET_INFO +IP6T_SO_GET_ENTRIES +IP6T_SO_GET_REVISION_MATCH +IP6T_SO_GET_REVISION_TARGET diff --git a/xlat/hci_channels.h b/xlat/hci_channels.h new file mode 100644 index 00000000..ab6d3e35 --- /dev/null +++ b/xlat/hci_channels.h @@ -0,0 +1,29 @@ +/* Generated by ./xlat/gen.sh from ./xlat/hci_channels.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat hci_channels in mpers mode + +#else + +static +const struct xlat hci_channels[] = { +#if defined(HCI_CHANNEL_RAW) || (defined(HAVE_DECL_HCI_CHANNEL_RAW) && HAVE_DECL_HCI_CHANNEL_RAW) + XLAT(HCI_CHANNEL_RAW), +#endif +#if defined(HCI_CHANNEL_USER) || (defined(HAVE_DECL_HCI_CHANNEL_USER) && HAVE_DECL_HCI_CHANNEL_USER) + XLAT(HCI_CHANNEL_USER), +#endif +#if defined(HCI_CHANNEL_MONITOR) || (defined(HAVE_DECL_HCI_CHANNEL_MONITOR) && HAVE_DECL_HCI_CHANNEL_MONITOR) + XLAT(HCI_CHANNEL_MONITOR), +#endif +#if defined(HCI_CHANNEL_CONTROL) || (defined(HAVE_DECL_HCI_CHANNEL_CONTROL) && HAVE_DECL_HCI_CHANNEL_CONTROL) + XLAT(HCI_CHANNEL_CONTROL), +#endif +#if defined(HCI_CHANNEL_LOGGING) || (defined(HAVE_DECL_HCI_CHANNEL_LOGGING) && HAVE_DECL_HCI_CHANNEL_LOGGING) + XLAT(HCI_CHANNEL_LOGGING), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/hci_channels.in b/xlat/hci_channels.in new file mode 100644 index 00000000..1fae39bb --- /dev/null +++ b/xlat/hci_channels.in @@ -0,0 +1,5 @@ +HCI_CHANNEL_RAW +HCI_CHANNEL_USER +HCI_CHANNEL_MONITOR +HCI_CHANNEL_CONTROL +HCI_CHANNEL_LOGGING diff --git a/xlat/hw_breakpoint_len.h b/xlat/hw_breakpoint_len.h new file mode 100644 index 00000000..c1b042d6 --- /dev/null +++ b/xlat/hw_breakpoint_len.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/hw_breakpoint_len.in; do not edit. */ +#if !(defined(HW_BREAKPOINT_LEN_1) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_1) && HAVE_DECL_HW_BREAKPOINT_LEN_1)) +# define HW_BREAKPOINT_LEN_1 1 +#endif +#if !(defined(HW_BREAKPOINT_LEN_2) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_2) && HAVE_DECL_HW_BREAKPOINT_LEN_2)) +# define HW_BREAKPOINT_LEN_2 2 +#endif +#if !(defined(HW_BREAKPOINT_LEN_4) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_4) && HAVE_DECL_HW_BREAKPOINT_LEN_4)) +# define HW_BREAKPOINT_LEN_4 4 +#endif +#if !(defined(HW_BREAKPOINT_LEN_8) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_8) && HAVE_DECL_HW_BREAKPOINT_LEN_8)) +# define HW_BREAKPOINT_LEN_8 8 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat hw_breakpoint_len in mpers mode + +#else + +static +const struct xlat hw_breakpoint_len[] = { + XLAT(HW_BREAKPOINT_LEN_1), + XLAT(HW_BREAKPOINT_LEN_2), + XLAT(HW_BREAKPOINT_LEN_4), + XLAT(HW_BREAKPOINT_LEN_8), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/hw_breakpoint_len.in b/xlat/hw_breakpoint_len.in new file mode 100644 index 00000000..f2b91a03 --- /dev/null +++ b/xlat/hw_breakpoint_len.in @@ -0,0 +1,4 @@ +HW_BREAKPOINT_LEN_1 1 +HW_BREAKPOINT_LEN_2 2 +HW_BREAKPOINT_LEN_4 4 +HW_BREAKPOINT_LEN_8 8 diff --git a/xlat/hw_breakpoint_type.h b/xlat/hw_breakpoint_type.h new file mode 100644 index 00000000..ac48815a --- /dev/null +++ b/xlat/hw_breakpoint_type.h @@ -0,0 +1,34 @@ +/* Generated by ./xlat/gen.sh from ./xlat/hw_breakpoint_type.in; do not edit. */ +#if !(defined(HW_BREAKPOINT_EMPTY) || (defined(HAVE_DECL_HW_BREAKPOINT_EMPTY) && HAVE_DECL_HW_BREAKPOINT_EMPTY)) +# define HW_BREAKPOINT_EMPTY 0 +#endif +#if !(defined(HW_BREAKPOINT_R) || (defined(HAVE_DECL_HW_BREAKPOINT_R) && HAVE_DECL_HW_BREAKPOINT_R)) +# define HW_BREAKPOINT_R 1 +#endif +#if !(defined(HW_BREAKPOINT_W) || (defined(HAVE_DECL_HW_BREAKPOINT_W) && HAVE_DECL_HW_BREAKPOINT_W)) +# define HW_BREAKPOINT_W 2 +#endif +#if !(defined(HW_BREAKPOINT_RW) || (defined(HAVE_DECL_HW_BREAKPOINT_RW) && HAVE_DECL_HW_BREAKPOINT_RW)) +# define HW_BREAKPOINT_RW HW_BREAKPOINT_R | HW_BREAKPOINT_W +#endif +#if !(defined(HW_BREAKPOINT_X) || (defined(HAVE_DECL_HW_BREAKPOINT_X) && HAVE_DECL_HW_BREAKPOINT_X)) +# define HW_BREAKPOINT_X 4 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat hw_breakpoint_type in mpers mode + +#else + +static +const struct xlat hw_breakpoint_type[] = { + XLAT(HW_BREAKPOINT_EMPTY), + XLAT(HW_BREAKPOINT_R), + XLAT(HW_BREAKPOINT_W), + XLAT(HW_BREAKPOINT_RW), + XLAT(HW_BREAKPOINT_X), + /* this array should remain not NULL-terminated */ +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/hw_breakpoint_type.in b/xlat/hw_breakpoint_type.in new file mode 100644 index 00000000..33645d0c --- /dev/null +++ b/xlat/hw_breakpoint_type.in @@ -0,0 +1,6 @@ +HW_BREAKPOINT_EMPTY 0 +HW_BREAKPOINT_R 1 +HW_BREAKPOINT_W 2 +HW_BREAKPOINT_RW HW_BREAKPOINT_R | HW_BREAKPOINT_W +HW_BREAKPOINT_X 4 +#unterminated diff --git a/xlat/icmpfilterflags.h b/xlat/icmpfilterflags.h index 872438c4..1672a19b 100644 --- a/xlat/icmpfilterflags.h +++ b/xlat/icmpfilterflags.h @@ -1,44 +1,53 @@ /* Generated by ./xlat/gen.sh from ./xlat/icmpfilterflags.in; do not edit. */ -static const struct xlat icmpfilterflags[] = { +#ifdef IN_MPERS + +# error static const struct xlat icmpfilterflags in mpers mode + +#else + +static +const struct xlat icmpfilterflags[] = { #if defined(ICMP_ECHOREPLY) || (defined(HAVE_DECL_ICMP_ECHOREPLY) && HAVE_DECL_ICMP_ECHOREPLY) - { 1< 0 +#endif -static const struct xlat mmap_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat mmap_flags in mpers mode + +#else + +static +const struct xlat mmap_flags[] = { #if defined(MAP_SHARED) || (defined(HAVE_DECL_MAP_SHARED) && HAVE_DECL_MAP_SHARED) - XLAT(MAP_SHARED), + XLAT(MAP_SHARED), #endif #if defined(MAP_PRIVATE) || (defined(HAVE_DECL_MAP_PRIVATE) && HAVE_DECL_MAP_PRIVATE) - XLAT(MAP_PRIVATE), + XLAT(MAP_PRIVATE), #endif #if defined(MAP_FIXED) || (defined(HAVE_DECL_MAP_FIXED) && HAVE_DECL_MAP_FIXED) - XLAT(MAP_FIXED), + XLAT(MAP_FIXED), #endif #if defined(MAP_ANONYMOUS) || (defined(HAVE_DECL_MAP_ANONYMOUS) && HAVE_DECL_MAP_ANONYMOUS) - XLAT(MAP_ANONYMOUS), + XLAT(MAP_ANONYMOUS), #endif #if defined(MAP_32BIT) || (defined(HAVE_DECL_MAP_32BIT) && HAVE_DECL_MAP_32BIT) - XLAT(MAP_32BIT), + XLAT(MAP_32BIT), #endif #if defined(MAP_RENAME) || (defined(HAVE_DECL_MAP_RENAME) && HAVE_DECL_MAP_RENAME) - XLAT(MAP_RENAME), + XLAT(MAP_RENAME), #endif #if defined(MAP_NORESERVE) || (defined(HAVE_DECL_MAP_NORESERVE) && HAVE_DECL_MAP_NORESERVE) - XLAT(MAP_NORESERVE), + XLAT(MAP_NORESERVE), #endif #if defined(MAP_POPULATE) || (defined(HAVE_DECL_MAP_POPULATE) && HAVE_DECL_MAP_POPULATE) - XLAT(MAP_POPULATE), + XLAT(MAP_POPULATE), #endif #if defined(MAP_NONBLOCK) || (defined(HAVE_DECL_MAP_NONBLOCK) && HAVE_DECL_MAP_NONBLOCK) - XLAT(MAP_NONBLOCK), + XLAT(MAP_NONBLOCK), #endif /* * XXX - this was introduced in SunOS 4.x to distinguish between @@ -56,51 +67,53 @@ static const struct xlat mmap_flags[] = { * and calls with it as "mmap()". */ #if defined(_MAP_NEW) || (defined(HAVE_DECL__MAP_NEW) && HAVE_DECL__MAP_NEW) - XLAT(_MAP_NEW), + XLAT(_MAP_NEW), #endif #if defined(MAP_GROWSDOWN) || (defined(HAVE_DECL_MAP_GROWSDOWN) && HAVE_DECL_MAP_GROWSDOWN) - XLAT(MAP_GROWSDOWN), + XLAT(MAP_GROWSDOWN), #endif #if defined(MAP_DENYWRITE) || (defined(HAVE_DECL_MAP_DENYWRITE) && HAVE_DECL_MAP_DENYWRITE) - XLAT(MAP_DENYWRITE), + XLAT(MAP_DENYWRITE), #endif #if defined(MAP_EXECUTABLE) || (defined(HAVE_DECL_MAP_EXECUTABLE) && HAVE_DECL_MAP_EXECUTABLE) - XLAT(MAP_EXECUTABLE), + XLAT(MAP_EXECUTABLE), #endif #if defined(MAP_INHERIT) || (defined(HAVE_DECL_MAP_INHERIT) && HAVE_DECL_MAP_INHERIT) - XLAT(MAP_INHERIT), + XLAT(MAP_INHERIT), #endif #if defined(MAP_FILE) || (defined(HAVE_DECL_MAP_FILE) && HAVE_DECL_MAP_FILE) - XLAT(MAP_FILE), + XLAT(MAP_FILE), #endif #if defined(MAP_LOCKED) || (defined(HAVE_DECL_MAP_LOCKED) && HAVE_DECL_MAP_LOCKED) - XLAT(MAP_LOCKED), + XLAT(MAP_LOCKED), #endif /* FreeBSD ones */ #if defined(MAP_ANON) && (!defined(MAP_ANONYMOUS) || MAP_ANON != MAP_ANONYMOUS) #if defined(MAP_ANON) || (defined(HAVE_DECL_MAP_ANON) && HAVE_DECL_MAP_ANON) - XLAT(MAP_ANON), + XLAT(MAP_ANON), #endif #endif #if defined(MAP_HASSEMAPHORE) || (defined(HAVE_DECL_MAP_HASSEMAPHORE) && HAVE_DECL_MAP_HASSEMAPHORE) - XLAT(MAP_HASSEMAPHORE), + XLAT(MAP_HASSEMAPHORE), #endif #if defined(MAP_STACK) || (defined(HAVE_DECL_MAP_STACK) && HAVE_DECL_MAP_STACK) - XLAT(MAP_STACK), + XLAT(MAP_STACK), #endif #if defined(MAP_HUGETLB) || (defined(HAVE_DECL_MAP_HUGETLB) && HAVE_DECL_MAP_HUGETLB) - XLAT(MAP_HUGETLB), + XLAT(MAP_HUGETLB), #endif #if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0 #if defined(MAP_UNINITIALIZED) || (defined(HAVE_DECL_MAP_UNINITIALIZED) && HAVE_DECL_MAP_UNINITIALIZED) - XLAT(MAP_UNINITIALIZED), + XLAT(MAP_UNINITIALIZED), #endif #endif #if defined(MAP_NOSYNC) || (defined(HAVE_DECL_MAP_NOSYNC) && HAVE_DECL_MAP_NOSYNC) - XLAT(MAP_NOSYNC), + XLAT(MAP_NOSYNC), #endif #if defined(MAP_NOCORE) || (defined(HAVE_DECL_MAP_NOCORE) && HAVE_DECL_MAP_NOCORE) - XLAT(MAP_NOCORE), + XLAT(MAP_NOCORE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/mmap_prot.h b/xlat/mmap_prot.h index 8b186906..0ff04eb9 100644 --- a/xlat/mmap_prot.h +++ b/xlat/mmap_prot.h @@ -1,29 +1,38 @@ /* Generated by ./xlat/gen.sh from ./xlat/mmap_prot.in; do not edit. */ -static const struct xlat mmap_prot[] = { +#ifdef IN_MPERS + +# error static const struct xlat mmap_prot in mpers mode + +#else + +static +const struct xlat mmap_prot[] = { #if defined(PROT_NONE) || (defined(HAVE_DECL_PROT_NONE) && HAVE_DECL_PROT_NONE) - XLAT(PROT_NONE), + XLAT(PROT_NONE), #endif #if defined(PROT_READ) || (defined(HAVE_DECL_PROT_READ) && HAVE_DECL_PROT_READ) - XLAT(PROT_READ), + XLAT(PROT_READ), #endif #if defined(PROT_WRITE) || (defined(HAVE_DECL_PROT_WRITE) && HAVE_DECL_PROT_WRITE) - XLAT(PROT_WRITE), + XLAT(PROT_WRITE), #endif #if defined(PROT_EXEC) || (defined(HAVE_DECL_PROT_EXEC) && HAVE_DECL_PROT_EXEC) - XLAT(PROT_EXEC), + XLAT(PROT_EXEC), #endif #if defined(PROT_SEM) || (defined(HAVE_DECL_PROT_SEM) && HAVE_DECL_PROT_SEM) - XLAT(PROT_SEM), + XLAT(PROT_SEM), #endif #if defined(PROT_GROWSDOWN) || (defined(HAVE_DECL_PROT_GROWSDOWN) && HAVE_DECL_PROT_GROWSDOWN) - XLAT(PROT_GROWSDOWN), + XLAT(PROT_GROWSDOWN), #endif #if defined(PROT_GROWSUP) || (defined(HAVE_DECL_PROT_GROWSUP) && HAVE_DECL_PROT_GROWSUP) - XLAT(PROT_GROWSUP), + XLAT(PROT_GROWSUP), #endif #if defined(PROT_SAO) || (defined(HAVE_DECL_PROT_SAO) && HAVE_DECL_PROT_SAO) - XLAT(PROT_SAO), + XLAT(PROT_SAO), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/modem_flags.h b/xlat/modem_flags.h index 8678eb9b..f1719755 100644 --- a/xlat/modem_flags.h +++ b/xlat/modem_flags.h @@ -1,38 +1,47 @@ /* Generated by ./xlat/gen.sh from ./xlat/modem_flags.in; do not edit. */ -static const struct xlat modem_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat modem_flags in mpers mode + +#else + +static +const struct xlat modem_flags[] = { #if defined(TIOCM_LE) || (defined(HAVE_DECL_TIOCM_LE) && HAVE_DECL_TIOCM_LE) - XLAT(TIOCM_LE), + XLAT(TIOCM_LE), #endif #if defined(TIOCM_DTR) || (defined(HAVE_DECL_TIOCM_DTR) && HAVE_DECL_TIOCM_DTR) - XLAT(TIOCM_DTR), + XLAT(TIOCM_DTR), #endif #if defined(TIOCM_RTS) || (defined(HAVE_DECL_TIOCM_RTS) && HAVE_DECL_TIOCM_RTS) - XLAT(TIOCM_RTS), + XLAT(TIOCM_RTS), #endif #if defined(TIOCM_ST) || (defined(HAVE_DECL_TIOCM_ST) && HAVE_DECL_TIOCM_ST) - XLAT(TIOCM_ST), + XLAT(TIOCM_ST), #endif #if defined(TIOCM_SR) || (defined(HAVE_DECL_TIOCM_SR) && HAVE_DECL_TIOCM_SR) - XLAT(TIOCM_SR), + XLAT(TIOCM_SR), #endif #if defined(TIOCM_CTS) || (defined(HAVE_DECL_TIOCM_CTS) && HAVE_DECL_TIOCM_CTS) - XLAT(TIOCM_CTS), + XLAT(TIOCM_CTS), #endif #if defined(TIOCM_CAR) || (defined(HAVE_DECL_TIOCM_CAR) && HAVE_DECL_TIOCM_CAR) - XLAT(TIOCM_CAR), + XLAT(TIOCM_CAR), #endif #if defined(TIOCM_CD) || (defined(HAVE_DECL_TIOCM_CD) && HAVE_DECL_TIOCM_CD) - XLAT(TIOCM_CD), + XLAT(TIOCM_CD), #endif #if defined(TIOCM_RNG) || (defined(HAVE_DECL_TIOCM_RNG) && HAVE_DECL_TIOCM_RNG) - XLAT(TIOCM_RNG), + XLAT(TIOCM_RNG), #endif #if defined(TIOCM_RI) || (defined(HAVE_DECL_TIOCM_RI) && HAVE_DECL_TIOCM_RI) - XLAT(TIOCM_RI), + XLAT(TIOCM_RI), #endif #if defined(TIOCM_DSR) || (defined(HAVE_DECL_TIOCM_DSR) && HAVE_DECL_TIOCM_DSR) - XLAT(TIOCM_DSR), + XLAT(TIOCM_DSR), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/modetypes.h b/xlat/modetypes.h index 1438b02b..70d1868e 100644 --- a/xlat/modetypes.h +++ b/xlat/modetypes.h @@ -1,26 +1,35 @@ /* Generated by ./xlat/gen.sh from ./xlat/modetypes.in; do not edit. */ -static const struct xlat modetypes[] = { +#ifdef IN_MPERS + +# error static const struct xlat modetypes in mpers mode + +#else + +static +const struct xlat modetypes[] = { #if defined(S_IFREG) || (defined(HAVE_DECL_S_IFREG) && HAVE_DECL_S_IFREG) - XLAT(S_IFREG), + XLAT(S_IFREG), #endif #if defined(S_IFSOCK) || (defined(HAVE_DECL_S_IFSOCK) && HAVE_DECL_S_IFSOCK) - XLAT(S_IFSOCK), + XLAT(S_IFSOCK), #endif #if defined(S_IFIFO) || (defined(HAVE_DECL_S_IFIFO) && HAVE_DECL_S_IFIFO) - XLAT(S_IFIFO), + XLAT(S_IFIFO), #endif #if defined(S_IFLNK) || (defined(HAVE_DECL_S_IFLNK) && HAVE_DECL_S_IFLNK) - XLAT(S_IFLNK), + XLAT(S_IFLNK), #endif #if defined(S_IFDIR) || (defined(HAVE_DECL_S_IFDIR) && HAVE_DECL_S_IFDIR) - XLAT(S_IFDIR), + XLAT(S_IFDIR), #endif #if defined(S_IFBLK) || (defined(HAVE_DECL_S_IFBLK) && HAVE_DECL_S_IFBLK) - XLAT(S_IFBLK), + XLAT(S_IFBLK), #endif #if defined(S_IFCHR) || (defined(HAVE_DECL_S_IFCHR) && HAVE_DECL_S_IFCHR) - XLAT(S_IFCHR), + XLAT(S_IFCHR), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/modflags.h b/xlat/modflags.h deleted file mode 100644 index 664e9c16..00000000 --- a/xlat/modflags.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/modflags.in; do not edit. */ - -static const struct xlat modflags[] = { -#if defined(MOD_UNINITIALIZED) || (defined(HAVE_DECL_MOD_UNINITIALIZED) && HAVE_DECL_MOD_UNINITIALIZED) - XLAT(MOD_UNINITIALIZED), -#endif -#if defined(MOD_RUNNING) || (defined(HAVE_DECL_MOD_RUNNING) && HAVE_DECL_MOD_RUNNING) - XLAT(MOD_RUNNING), -#endif -#if defined(MOD_DELETED) || (defined(HAVE_DECL_MOD_DELETED) && HAVE_DECL_MOD_DELETED) - XLAT(MOD_DELETED), -#endif -#if defined(MOD_AUTOCLEAN) || (defined(HAVE_DECL_MOD_AUTOCLEAN) && HAVE_DECL_MOD_AUTOCLEAN) - XLAT(MOD_AUTOCLEAN), -#endif -#if defined(MOD_VISITED) || (defined(HAVE_DECL_MOD_VISITED) && HAVE_DECL_MOD_VISITED) - XLAT(MOD_VISITED), -#endif -#if defined(MOD_USED_ONCE) || (defined(HAVE_DECL_MOD_USED_ONCE) && HAVE_DECL_MOD_USED_ONCE) - XLAT(MOD_USED_ONCE), -#endif -#if defined(MOD_JUST_FREED) || (defined(HAVE_DECL_MOD_JUST_FREED) && HAVE_DECL_MOD_JUST_FREED) - XLAT(MOD_JUST_FREED), -#endif - XLAT_END -}; diff --git a/xlat/modflags.in b/xlat/modflags.in deleted file mode 100644 index 2edf7e94..00000000 --- a/xlat/modflags.in +++ /dev/null @@ -1,7 +0,0 @@ -MOD_UNINITIALIZED -MOD_RUNNING -MOD_DELETED -MOD_AUTOCLEAN -MOD_VISITED -MOD_USED_ONCE -MOD_JUST_FREED diff --git a/xlat/module_init_flags.h b/xlat/module_init_flags.h index 00ae3d60..b3219d19 100644 --- a/xlat/module_init_flags.h +++ b/xlat/module_init_flags.h @@ -1,11 +1,22 @@ /* Generated by ./xlat/gen.sh from ./xlat/module_init_flags.in; do not edit. */ - -static const struct xlat module_init_flags[] = { -#if defined(MODULE_INIT_IGNORE_MODVERSIONS) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS) && HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS) - XLAT(MODULE_INIT_IGNORE_MODVERSIONS), +#if !(defined(MODULE_INIT_IGNORE_MODVERSIONS) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS) && HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS)) +# define MODULE_INIT_IGNORE_MODVERSIONS (1 << 0) #endif -#if defined(MODULE_INIT_IGNORE_VERMAGIC) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC) && HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC) - XLAT(MODULE_INIT_IGNORE_VERMAGIC), +#if !(defined(MODULE_INIT_IGNORE_VERMAGIC) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC) && HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC)) +# define MODULE_INIT_IGNORE_VERMAGIC (1 << 1) #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat module_init_flags in mpers mode + +#else + +static +const struct xlat module_init_flags[] = { + XLAT(MODULE_INIT_IGNORE_MODVERSIONS), + XLAT(MODULE_INIT_IGNORE_VERMAGIC), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/module_init_flags.in b/xlat/module_init_flags.in index e672a59e..1547189c 100644 --- a/xlat/module_init_flags.in +++ b/xlat/module_init_flags.in @@ -1,2 +1,2 @@ -MODULE_INIT_IGNORE_MODVERSIONS -MODULE_INIT_IGNORE_VERMAGIC +MODULE_INIT_IGNORE_MODVERSIONS (1 << 0) +MODULE_INIT_IGNORE_VERMAGIC (1 << 1) diff --git a/xlat/mount_flags.h b/xlat/mount_flags.h index cbd8e763..98f1215e 100644 --- a/xlat/mount_flags.h +++ b/xlat/mount_flags.h @@ -1,86 +1,130 @@ /* Generated by ./xlat/gen.sh from ./xlat/mount_flags.in; do not edit. */ - -static const struct xlat mount_flags[] = { -#if defined(MS_MGC_VAL) || (defined(HAVE_DECL_MS_MGC_VAL) && HAVE_DECL_MS_MGC_VAL) - XLAT(MS_MGC_VAL), +#if !(defined(MS_RDONLY) || (defined(HAVE_DECL_MS_RDONLY) && HAVE_DECL_MS_RDONLY)) +# define MS_RDONLY 1 +#endif +#if !(defined(MS_NOSUID) || (defined(HAVE_DECL_MS_NOSUID) && HAVE_DECL_MS_NOSUID)) +# define MS_NOSUID 2 #endif -#if defined(MS_RDONLY) || (defined(HAVE_DECL_MS_RDONLY) && HAVE_DECL_MS_RDONLY) - XLAT(MS_RDONLY), +#if !(defined(MS_NODEV) || (defined(HAVE_DECL_MS_NODEV) && HAVE_DECL_MS_NODEV)) +# define MS_NODEV 4 #endif -#if defined(MS_NOSUID) || (defined(HAVE_DECL_MS_NOSUID) && HAVE_DECL_MS_NOSUID) - XLAT(MS_NOSUID), +#if !(defined(MS_NOEXEC) || (defined(HAVE_DECL_MS_NOEXEC) && HAVE_DECL_MS_NOEXEC)) +# define MS_NOEXEC 8 #endif -#if defined(MS_NODEV) || (defined(HAVE_DECL_MS_NODEV) && HAVE_DECL_MS_NODEV) - XLAT(MS_NODEV), +#if !(defined(MS_SYNCHRONOUS) || (defined(HAVE_DECL_MS_SYNCHRONOUS) && HAVE_DECL_MS_SYNCHRONOUS)) +# define MS_SYNCHRONOUS 16 #endif -#if defined(MS_NOEXEC) || (defined(HAVE_DECL_MS_NOEXEC) && HAVE_DECL_MS_NOEXEC) - XLAT(MS_NOEXEC), +#if !(defined(MS_REMOUNT) || (defined(HAVE_DECL_MS_REMOUNT) && HAVE_DECL_MS_REMOUNT)) +# define MS_REMOUNT 32 #endif -#if defined(MS_SYNCHRONOUS) || (defined(HAVE_DECL_MS_SYNCHRONOUS) && HAVE_DECL_MS_SYNCHRONOUS) - XLAT(MS_SYNCHRONOUS), +#if !(defined(MS_MANDLOCK) || (defined(HAVE_DECL_MS_MANDLOCK) && HAVE_DECL_MS_MANDLOCK)) +# define MS_MANDLOCK 64 #endif -#if defined(MS_REMOUNT) || (defined(HAVE_DECL_MS_REMOUNT) && HAVE_DECL_MS_REMOUNT) - XLAT(MS_REMOUNT), +#if !(defined(MS_DIRSYNC) || (defined(HAVE_DECL_MS_DIRSYNC) && HAVE_DECL_MS_DIRSYNC)) +# define MS_DIRSYNC 128 #endif -#if defined(MS_RELATIME) || (defined(HAVE_DECL_MS_RELATIME) && HAVE_DECL_MS_RELATIME) - XLAT(MS_RELATIME), +#if !(defined(MS_NOATIME) || (defined(HAVE_DECL_MS_NOATIME) && HAVE_DECL_MS_NOATIME)) +# define MS_NOATIME 1024 #endif -#if defined(MS_KERNMOUNT) || (defined(HAVE_DECL_MS_KERNMOUNT) && HAVE_DECL_MS_KERNMOUNT) - XLAT(MS_KERNMOUNT), +#if !(defined(MS_NODIRATIME) || (defined(HAVE_DECL_MS_NODIRATIME) && HAVE_DECL_MS_NODIRATIME)) +# define MS_NODIRATIME 2048 #endif -#if defined(MS_I_VERSION) || (defined(HAVE_DECL_MS_I_VERSION) && HAVE_DECL_MS_I_VERSION) - XLAT(MS_I_VERSION), +#if !(defined(MS_BIND) || (defined(HAVE_DECL_MS_BIND) && HAVE_DECL_MS_BIND)) +# define MS_BIND 4096 #endif -#if defined(MS_STRICTATIME) || (defined(HAVE_DECL_MS_STRICTATIME) && HAVE_DECL_MS_STRICTATIME) - XLAT(MS_STRICTATIME), +#if !(defined(MS_MOVE) || (defined(HAVE_DECL_MS_MOVE) && HAVE_DECL_MS_MOVE)) +# define MS_MOVE 8192 #endif -#if defined(MS_NOSEC) || (defined(HAVE_DECL_MS_NOSEC) && HAVE_DECL_MS_NOSEC) - XLAT(MS_NOSEC), +#if !(defined(MS_REC) || (defined(HAVE_DECL_MS_REC) && HAVE_DECL_MS_REC)) +# define MS_REC 16384 #endif -#if defined(MS_BORN) || (defined(HAVE_DECL_MS_BORN) && HAVE_DECL_MS_BORN) - XLAT(MS_BORN), +#if !(defined(MS_SILENT) || (defined(HAVE_DECL_MS_SILENT) && HAVE_DECL_MS_SILENT)) +# define MS_SILENT 32768 #endif -#if defined(MS_MANDLOCK) || (defined(HAVE_DECL_MS_MANDLOCK) && HAVE_DECL_MS_MANDLOCK) - XLAT(MS_MANDLOCK), +#if !(defined(MS_POSIXACL) || (defined(HAVE_DECL_MS_POSIXACL) && HAVE_DECL_MS_POSIXACL)) +# define MS_POSIXACL (1<<16) #endif -#if defined(MS_NOATIME) || (defined(HAVE_DECL_MS_NOATIME) && HAVE_DECL_MS_NOATIME) - XLAT(MS_NOATIME), +#if !(defined(MS_UNBINDABLE) || (defined(HAVE_DECL_MS_UNBINDABLE) && HAVE_DECL_MS_UNBINDABLE)) +# define MS_UNBINDABLE (1<<17) #endif -#if defined(MS_NODIRATIME) || (defined(HAVE_DECL_MS_NODIRATIME) && HAVE_DECL_MS_NODIRATIME) - XLAT(MS_NODIRATIME), +#if !(defined(MS_PRIVATE) || (defined(HAVE_DECL_MS_PRIVATE) && HAVE_DECL_MS_PRIVATE)) +# define MS_PRIVATE (1<<18) #endif -#if defined(MS_BIND) || (defined(HAVE_DECL_MS_BIND) && HAVE_DECL_MS_BIND) - XLAT(MS_BIND), +#if !(defined(MS_SLAVE) || (defined(HAVE_DECL_MS_SLAVE) && HAVE_DECL_MS_SLAVE)) +# define MS_SLAVE (1<<19) #endif -#if defined(MS_MOVE) || (defined(HAVE_DECL_MS_MOVE) && HAVE_DECL_MS_MOVE) - XLAT(MS_MOVE), +#if !(defined(MS_SHARED) || (defined(HAVE_DECL_MS_SHARED) && HAVE_DECL_MS_SHARED)) +# define MS_SHARED (1<<20) #endif -#if defined(MS_REC) || (defined(HAVE_DECL_MS_REC) && HAVE_DECL_MS_REC) - XLAT(MS_REC), +#if !(defined(MS_RELATIME) || (defined(HAVE_DECL_MS_RELATIME) && HAVE_DECL_MS_RELATIME)) +# define MS_RELATIME (1<<21) #endif -#if defined(MS_SILENT) || (defined(HAVE_DECL_MS_SILENT) && HAVE_DECL_MS_SILENT) - XLAT(MS_SILENT), +#if !(defined(MS_KERNMOUNT) || (defined(HAVE_DECL_MS_KERNMOUNT) && HAVE_DECL_MS_KERNMOUNT)) +# define MS_KERNMOUNT (1<<22) #endif -#if defined(MS_POSIXACL) || (defined(HAVE_DECL_MS_POSIXACL) && HAVE_DECL_MS_POSIXACL) - XLAT(MS_POSIXACL), +#if !(defined(MS_I_VERSION) || (defined(HAVE_DECL_MS_I_VERSION) && HAVE_DECL_MS_I_VERSION)) +# define MS_I_VERSION (1<<23) #endif -#if defined(MS_UNBINDABLE) || (defined(HAVE_DECL_MS_UNBINDABLE) && HAVE_DECL_MS_UNBINDABLE) - XLAT(MS_UNBINDABLE), +#if !(defined(MS_STRICTATIME) || (defined(HAVE_DECL_MS_STRICTATIME) && HAVE_DECL_MS_STRICTATIME)) +# define MS_STRICTATIME (1<<24) #endif -#if defined(MS_PRIVATE) || (defined(HAVE_DECL_MS_PRIVATE) && HAVE_DECL_MS_PRIVATE) - XLAT(MS_PRIVATE), +#if !(defined(MS_LAZYTIME) || (defined(HAVE_DECL_MS_LAZYTIME) && HAVE_DECL_MS_LAZYTIME)) +# define MS_LAZYTIME (1<<25) #endif -#if defined(MS_SLAVE) || (defined(HAVE_DECL_MS_SLAVE) && HAVE_DECL_MS_SLAVE) - XLAT(MS_SLAVE), +#if !(defined(MS_NOREMOTELOCK) || (defined(HAVE_DECL_MS_NOREMOTELOCK) && HAVE_DECL_MS_NOREMOTELOCK)) +# define MS_NOREMOTELOCK (1<<27) #endif -#if defined(MS_SHARED) || (defined(HAVE_DECL_MS_SHARED) && HAVE_DECL_MS_SHARED) - XLAT(MS_SHARED), +#if !(defined(MS_NOSEC) || (defined(HAVE_DECL_MS_NOSEC) && HAVE_DECL_MS_NOSEC)) +# define MS_NOSEC (1<<28) #endif -#if defined(MS_ACTIVE) || (defined(HAVE_DECL_MS_ACTIVE) && HAVE_DECL_MS_ACTIVE) - XLAT(MS_ACTIVE), +#if !(defined(MS_BORN) || (defined(HAVE_DECL_MS_BORN) && HAVE_DECL_MS_BORN)) +# define MS_BORN (1<<29) #endif -#if defined(MS_NOUSER) || (defined(HAVE_DECL_MS_NOUSER) && HAVE_DECL_MS_NOUSER) - XLAT(MS_NOUSER), +#if !(defined(MS_ACTIVE) || (defined(HAVE_DECL_MS_ACTIVE) && HAVE_DECL_MS_ACTIVE)) +# define MS_ACTIVE (1<<30) #endif - XLAT_END +#if !(defined(MS_NOUSER) || (defined(HAVE_DECL_MS_NOUSER) && HAVE_DECL_MS_NOUSER)) +# define MS_NOUSER (1<<31) +#endif + +#ifdef IN_MPERS + +# error static const struct xlat mount_flags in mpers mode + +#else + +static +const struct xlat mount_flags[] = { + XLAT(MS_RDONLY), + XLAT(MS_NOSUID), + XLAT(MS_NODEV), + XLAT(MS_NOEXEC), + XLAT(MS_SYNCHRONOUS), + XLAT(MS_REMOUNT), + XLAT(MS_MANDLOCK), + XLAT(MS_DIRSYNC), + XLAT(MS_NOATIME), + XLAT(MS_NODIRATIME), + XLAT(MS_BIND), + XLAT(MS_MOVE), + XLAT(MS_REC), + XLAT(MS_SILENT), + XLAT(MS_POSIXACL), + XLAT(MS_UNBINDABLE), + XLAT(MS_PRIVATE), + XLAT(MS_SLAVE), + XLAT(MS_SHARED), + XLAT(MS_RELATIME), + XLAT(MS_KERNMOUNT), + XLAT(MS_I_VERSION), + XLAT(MS_STRICTATIME), + XLAT(MS_LAZYTIME), + XLAT(MS_NOREMOTELOCK), + XLAT(MS_NOSEC), + XLAT(MS_BORN), + XLAT(MS_ACTIVE), + XLAT(MS_NOUSER), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/mount_flags.in b/xlat/mount_flags.in index 8e72e58f..bf903d29 100644 --- a/xlat/mount_flags.in +++ b/xlat/mount_flags.in @@ -1,27 +1,29 @@ -MS_MGC_VAL -MS_RDONLY -MS_NOSUID -MS_NODEV -MS_NOEXEC -MS_SYNCHRONOUS -MS_REMOUNT -MS_RELATIME -MS_KERNMOUNT -MS_I_VERSION -MS_STRICTATIME -MS_NOSEC -MS_BORN -MS_MANDLOCK -MS_NOATIME -MS_NODIRATIME -MS_BIND -MS_MOVE -MS_REC -MS_SILENT -MS_POSIXACL -MS_UNBINDABLE -MS_PRIVATE -MS_SLAVE -MS_SHARED -MS_ACTIVE -MS_NOUSER +MS_RDONLY 1 +MS_NOSUID 2 +MS_NODEV 4 +MS_NOEXEC 8 +MS_SYNCHRONOUS 16 +MS_REMOUNT 32 +MS_MANDLOCK 64 +MS_DIRSYNC 128 +MS_NOATIME 1024 +MS_NODIRATIME 2048 +MS_BIND 4096 +MS_MOVE 8192 +MS_REC 16384 +MS_SILENT 32768 +MS_POSIXACL (1<<16) +MS_UNBINDABLE (1<<17) +MS_PRIVATE (1<<18) +MS_SLAVE (1<<19) +MS_SHARED (1<<20) +MS_RELATIME (1<<21) +MS_KERNMOUNT (1<<22) +MS_I_VERSION (1<<23) +MS_STRICTATIME (1<<24) +MS_LAZYTIME (1<<25) +MS_NOREMOTELOCK (1<<27) +MS_NOSEC (1<<28) +MS_BORN (1<<29) +MS_ACTIVE (1<<30) +MS_NOUSER (1<<31) diff --git a/xlat/move_pages_flags.h b/xlat/move_pages_flags.h index cbdf3bc1..0844fdaa 100644 --- a/xlat/move_pages_flags.h +++ b/xlat/move_pages_flags.h @@ -1,11 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/move_pages_flags.in; do not edit. */ -static const struct xlat move_pages_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat move_pages_flags in mpers mode + +#else + +static +const struct xlat move_pages_flags[] = { #if defined(MPOL_MF_MOVE) || (defined(HAVE_DECL_MPOL_MF_MOVE) && HAVE_DECL_MPOL_MF_MOVE) - XLAT(MPOL_MF_MOVE), + XLAT(MPOL_MF_MOVE), #endif #if defined(MPOL_MF_MOVE_ALL) || (defined(HAVE_DECL_MPOL_MF_MOVE_ALL) && HAVE_DECL_MPOL_MF_MOVE_ALL) - XLAT(MPOL_MF_MOVE_ALL), + XLAT(MPOL_MF_MOVE_ALL), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/mq_attr_flags.h b/xlat/mq_attr_flags.h new file mode 100644 index 00000000..ed2d767f --- /dev/null +++ b/xlat/mq_attr_flags.h @@ -0,0 +1,19 @@ +/* Generated by ./xlat/gen.sh from ./xlat/mq_attr_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat mq_attr_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat mq_attr_flags[] = { +#if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) + XLAT(O_NONBLOCK), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/mq_attr_flags.in b/xlat/mq_attr_flags.in new file mode 100644 index 00000000..06220753 --- /dev/null +++ b/xlat/mq_attr_flags.in @@ -0,0 +1 @@ +O_NONBLOCK diff --git a/xlat/mremap_flags.h b/xlat/mremap_flags.h index 3dac3a54..803cdeb8 100644 --- a/xlat/mremap_flags.h +++ b/xlat/mremap_flags.h @@ -1,11 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mremap_flags.in; do not edit. */ -static const struct xlat mremap_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat mremap_flags in mpers mode + +#else + +static +const struct xlat mremap_flags[] = { #if defined(MREMAP_MAYMOVE) || (defined(HAVE_DECL_MREMAP_MAYMOVE) && HAVE_DECL_MREMAP_MAYMOVE) - XLAT(MREMAP_MAYMOVE), + XLAT(MREMAP_MAYMOVE), #endif #if defined(MREMAP_FIXED) || (defined(HAVE_DECL_MREMAP_FIXED) && HAVE_DECL_MREMAP_FIXED) - XLAT(MREMAP_FIXED), + XLAT(MREMAP_FIXED), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/msg_flags.h b/xlat/msg_flags.h index e842d2de..f4729ba2 100644 --- a/xlat/msg_flags.h +++ b/xlat/msg_flags.h @@ -1,65 +1,73 @@ /* Generated by ./xlat/gen.sh from ./xlat/msg_flags.in; do not edit. */ +#if !(defined(MSG_BATCH) || (defined(HAVE_DECL_MSG_BATCH) && HAVE_DECL_MSG_BATCH)) +# define MSG_BATCH 0x40000 +#endif + +#ifndef IN_MPERS -static const struct xlat msg_flags[] = { +const struct xlat msg_flags[] = { #if defined(MSG_OOB) || (defined(HAVE_DECL_MSG_OOB) && HAVE_DECL_MSG_OOB) - XLAT(MSG_OOB), + XLAT(MSG_OOB), #endif #if defined(MSG_PEEK) || (defined(HAVE_DECL_MSG_PEEK) && HAVE_DECL_MSG_PEEK) - XLAT(MSG_PEEK), + XLAT(MSG_PEEK), #endif #if defined(MSG_DONTROUTE) || (defined(HAVE_DECL_MSG_DONTROUTE) && HAVE_DECL_MSG_DONTROUTE) - XLAT(MSG_DONTROUTE), + XLAT(MSG_DONTROUTE), #endif #if defined(MSG_CTRUNC) || (defined(HAVE_DECL_MSG_CTRUNC) && HAVE_DECL_MSG_CTRUNC) - XLAT(MSG_CTRUNC), + XLAT(MSG_CTRUNC), #endif #if defined(MSG_PROBE) || (defined(HAVE_DECL_MSG_PROBE) && HAVE_DECL_MSG_PROBE) - XLAT(MSG_PROBE), + XLAT(MSG_PROBE), #endif #if defined(MSG_TRUNC) || (defined(HAVE_DECL_MSG_TRUNC) && HAVE_DECL_MSG_TRUNC) - XLAT(MSG_TRUNC), + XLAT(MSG_TRUNC), #endif #if defined(MSG_DONTWAIT) || (defined(HAVE_DECL_MSG_DONTWAIT) && HAVE_DECL_MSG_DONTWAIT) - XLAT(MSG_DONTWAIT), + XLAT(MSG_DONTWAIT), #endif #if defined(MSG_EOR) || (defined(HAVE_DECL_MSG_EOR) && HAVE_DECL_MSG_EOR) - XLAT(MSG_EOR), + XLAT(MSG_EOR), #endif #if defined(MSG_WAITALL) || (defined(HAVE_DECL_MSG_WAITALL) && HAVE_DECL_MSG_WAITALL) - XLAT(MSG_WAITALL), + XLAT(MSG_WAITALL), #endif #if defined(MSG_FIN) || (defined(HAVE_DECL_MSG_FIN) && HAVE_DECL_MSG_FIN) - XLAT(MSG_FIN), + XLAT(MSG_FIN), #endif #if defined(MSG_SYN) || (defined(HAVE_DECL_MSG_SYN) && HAVE_DECL_MSG_SYN) - XLAT(MSG_SYN), + XLAT(MSG_SYN), #endif #if defined(MSG_CONFIRM) || (defined(HAVE_DECL_MSG_CONFIRM) && HAVE_DECL_MSG_CONFIRM) - XLAT(MSG_CONFIRM), + XLAT(MSG_CONFIRM), #endif #if defined(MSG_RST) || (defined(HAVE_DECL_MSG_RST) && HAVE_DECL_MSG_RST) - XLAT(MSG_RST), + XLAT(MSG_RST), #endif #if defined(MSG_ERRQUEUE) || (defined(HAVE_DECL_MSG_ERRQUEUE) && HAVE_DECL_MSG_ERRQUEUE) - XLAT(MSG_ERRQUEUE), + XLAT(MSG_ERRQUEUE), #endif #if defined(MSG_NOSIGNAL) || (defined(HAVE_DECL_MSG_NOSIGNAL) && HAVE_DECL_MSG_NOSIGNAL) - XLAT(MSG_NOSIGNAL), + XLAT(MSG_NOSIGNAL), #endif #if defined(MSG_MORE) || (defined(HAVE_DECL_MSG_MORE) && HAVE_DECL_MSG_MORE) - XLAT(MSG_MORE), + XLAT(MSG_MORE), #endif #if defined(MSG_WAITFORONE) || (defined(HAVE_DECL_MSG_WAITFORONE) && HAVE_DECL_MSG_WAITFORONE) - XLAT(MSG_WAITFORONE), + XLAT(MSG_WAITFORONE), #endif + XLAT(MSG_BATCH), #if defined(MSG_EOF) || (defined(HAVE_DECL_MSG_EOF) && HAVE_DECL_MSG_EOF) - XLAT(MSG_EOF), + XLAT(MSG_EOF), #endif #if defined(MSG_FASTOPEN) || (defined(HAVE_DECL_MSG_FASTOPEN) && HAVE_DECL_MSG_FASTOPEN) - XLAT(MSG_FASTOPEN), + XLAT(MSG_FASTOPEN), #endif #if defined(MSG_CMSG_CLOEXEC) || (defined(HAVE_DECL_MSG_CMSG_CLOEXEC) && HAVE_DECL_MSG_CMSG_CLOEXEC) - XLAT(MSG_CMSG_CLOEXEC), + XLAT(MSG_CMSG_CLOEXEC), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/msg_flags.in b/xlat/msg_flags.in index 93690404..cf6b83ca 100644 --- a/xlat/msg_flags.in +++ b/xlat/msg_flags.in @@ -15,6 +15,7 @@ MSG_ERRQUEUE MSG_NOSIGNAL MSG_MORE MSG_WAITFORONE +MSG_BATCH 0x40000 MSG_EOF MSG_FASTOPEN MSG_CMSG_CLOEXEC diff --git a/xlat/msgctl_flags.h b/xlat/msgctl_flags.h index 72c8f7bd..a78ee14b 100644 --- a/xlat/msgctl_flags.h +++ b/xlat/msgctl_flags.h @@ -1,23 +1,36 @@ /* Generated by ./xlat/gen.sh from ./xlat/msgctl_flags.in; do not edit. */ +#if !(defined(MSG_STAT) || (defined(HAVE_DECL_MSG_STAT) && HAVE_DECL_MSG_STAT)) +# define MSG_STAT 11 +#endif +#if !(defined(MSG_INFO) || (defined(HAVE_DECL_MSG_INFO) && HAVE_DECL_MSG_INFO)) +# define MSG_INFO 12 +#endif + +#ifdef IN_MPERS + +extern const struct xlat msgctl_flags[]; -static const struct xlat msgctl_flags[] = { +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat msgctl_flags[] = { #if defined(IPC_RMID) || (defined(HAVE_DECL_IPC_RMID) && HAVE_DECL_IPC_RMID) - XLAT(IPC_RMID), + XLAT(IPC_RMID), #endif #if defined(IPC_SET) || (defined(HAVE_DECL_IPC_SET) && HAVE_DECL_IPC_SET) - XLAT(IPC_SET), + XLAT(IPC_SET), #endif #if defined(IPC_STAT) || (defined(HAVE_DECL_IPC_STAT) && HAVE_DECL_IPC_STAT) - XLAT(IPC_STAT), + XLAT(IPC_STAT), #endif #if defined(IPC_INFO) || (defined(HAVE_DECL_IPC_INFO) && HAVE_DECL_IPC_INFO) - XLAT(IPC_INFO), -#endif -#if defined(MSG_STAT) || (defined(HAVE_DECL_MSG_STAT) && HAVE_DECL_MSG_STAT) - XLAT(MSG_STAT), + XLAT(IPC_INFO), #endif -#if defined(MSG_INFO) || (defined(HAVE_DECL_MSG_INFO) && HAVE_DECL_MSG_INFO) - XLAT(MSG_INFO), -#endif - XLAT_END + XLAT(MSG_STAT), + XLAT(MSG_INFO), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/msgctl_flags.in b/xlat/msgctl_flags.in index 0d39e9e9..4b54adf6 100644 --- a/xlat/msgctl_flags.in +++ b/xlat/msgctl_flags.in @@ -2,5 +2,5 @@ IPC_RMID IPC_SET IPC_STAT IPC_INFO -MSG_STAT -MSG_INFO +MSG_STAT 11 +MSG_INFO 12 diff --git a/xlat/msgflags.h b/xlat/msgflags.h deleted file mode 100644 index c96a35d9..00000000 --- a/xlat/msgflags.h +++ /dev/null @@ -1,8 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/msgflags.in; do not edit. */ - -static const struct xlat msgflags[] = { -#if defined(RS_HIPRI) || (defined(HAVE_DECL_RS_HIPRI) && HAVE_DECL_RS_HIPRI) - XLAT(RS_HIPRI), -#endif - XLAT_END -}; diff --git a/xlat/msgflags.in b/xlat/msgflags.in deleted file mode 100644 index 62e6bb72..00000000 --- a/xlat/msgflags.in +++ /dev/null @@ -1 +0,0 @@ -RS_HIPRI diff --git a/xlat/mtd_file_mode_options.h b/xlat/mtd_file_mode_options.h new file mode 100644 index 00000000..943919f3 --- /dev/null +++ b/xlat/mtd_file_mode_options.h @@ -0,0 +1,20 @@ +/* Generated by ./xlat/gen.sh from ./xlat/mtd_file_mode_options.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat mtd_file_mode_options[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat mtd_file_mode_options[] = { + XLAT(MTD_FILE_MODE_NORMAL), + XLAT(MTD_FILE_MODE_OTP_FACTORY), + XLAT(MTD_FILE_MODE_OTP_USER), + XLAT(MTD_FILE_MODE_RAW), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/mtd_file_mode_options.in b/xlat/mtd_file_mode_options.in new file mode 100644 index 00000000..d9e21ad1 --- /dev/null +++ b/xlat/mtd_file_mode_options.in @@ -0,0 +1,5 @@ +#unconditional +MTD_FILE_MODE_NORMAL +MTD_FILE_MODE_OTP_FACTORY +MTD_FILE_MODE_OTP_USER +MTD_FILE_MODE_RAW diff --git a/xlat/mtd_flags_options.h b/xlat/mtd_flags_options.h index da4c6a72..87125614 100644 --- a/xlat/mtd_flags_options.h +++ b/xlat/mtd_flags_options.h @@ -1,17 +1,28 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_flags_options.in; do not edit. */ -static const struct xlat mtd_flags_options[] = { +#ifdef IN_MPERS + +extern const struct xlat mtd_flags_options[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat mtd_flags_options[] = { #if defined(MTD_WRITEABLE) || (defined(HAVE_DECL_MTD_WRITEABLE) && HAVE_DECL_MTD_WRITEABLE) - XLAT(MTD_WRITEABLE), + XLAT(MTD_WRITEABLE), #endif #if defined(MTD_BIT_WRITEABLE) || (defined(HAVE_DECL_MTD_BIT_WRITEABLE) && HAVE_DECL_MTD_BIT_WRITEABLE) - XLAT(MTD_BIT_WRITEABLE), + XLAT(MTD_BIT_WRITEABLE), #endif #if defined(MTD_NO_ERASE) || (defined(HAVE_DECL_MTD_NO_ERASE) && HAVE_DECL_MTD_NO_ERASE) - XLAT(MTD_NO_ERASE), + XLAT(MTD_NO_ERASE), #endif #if defined(MTD_POWERUP_LOCK) || (defined(HAVE_DECL_MTD_POWERUP_LOCK) && HAVE_DECL_MTD_POWERUP_LOCK) - XLAT(MTD_POWERUP_LOCK), + XLAT(MTD_POWERUP_LOCK), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/mtd_mode_options.h b/xlat/mtd_mode_options.h index c80f035f..b7e8b4a6 100644 --- a/xlat/mtd_mode_options.h +++ b/xlat/mtd_mode_options.h @@ -1,8 +1,19 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_mode_options.in; do not edit. */ -static const struct xlat mtd_mode_options[] = { - XLAT(MTD_OPS_PLACE_OOB), - XLAT(MTD_OPS_AUTO_OOB), - XLAT(MTD_OPS_RAW), - XLAT_END +#ifdef IN_MPERS + +extern const struct xlat mtd_mode_options[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat mtd_mode_options[] = { + XLAT(MTD_OPS_PLACE_OOB), + XLAT(MTD_OPS_AUTO_OOB), + XLAT(MTD_OPS_RAW), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/mtd_nandecc_options.h b/xlat/mtd_nandecc_options.h index 34647014..21b0166f 100644 --- a/xlat/mtd_nandecc_options.h +++ b/xlat/mtd_nandecc_options.h @@ -1,20 +1,31 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_nandecc_options.in; do not edit. */ -static const struct xlat mtd_nandecc_options[] = { +#ifdef IN_MPERS + +extern const struct xlat mtd_nandecc_options[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat mtd_nandecc_options[] = { #if defined(MTD_NANDECC_OFF) || (defined(HAVE_DECL_MTD_NANDECC_OFF) && HAVE_DECL_MTD_NANDECC_OFF) - XLAT(MTD_NANDECC_OFF), + XLAT(MTD_NANDECC_OFF), #endif #if defined(MTD_NANDECC_PLACE) || (defined(HAVE_DECL_MTD_NANDECC_PLACE) && HAVE_DECL_MTD_NANDECC_PLACE) - XLAT(MTD_NANDECC_PLACE), + XLAT(MTD_NANDECC_PLACE), #endif #if defined(MTD_NANDECC_AUTOPLACE) || (defined(HAVE_DECL_MTD_NANDECC_AUTOPLACE) && HAVE_DECL_MTD_NANDECC_AUTOPLACE) - XLAT(MTD_NANDECC_AUTOPLACE), + XLAT(MTD_NANDECC_AUTOPLACE), #endif #if defined(MTD_NANDECC_PLACEONLY) || (defined(HAVE_DECL_MTD_NANDECC_PLACEONLY) && HAVE_DECL_MTD_NANDECC_PLACEONLY) - XLAT(MTD_NANDECC_PLACEONLY), + XLAT(MTD_NANDECC_PLACEONLY), #endif #if defined(MTD_NANDECC_AUTOPL_USR) || (defined(HAVE_DECL_MTD_NANDECC_AUTOPL_USR) && HAVE_DECL_MTD_NANDECC_AUTOPL_USR) - XLAT(MTD_NANDECC_AUTOPL_USR), + XLAT(MTD_NANDECC_AUTOPL_USR), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/mtd_otp_options.h b/xlat/mtd_otp_options.h index 6cbf7438..2ee7f492 100644 --- a/xlat/mtd_otp_options.h +++ b/xlat/mtd_otp_options.h @@ -1,14 +1,25 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_otp_options.in; do not edit. */ -static const struct xlat mtd_otp_options[] = { +#ifdef IN_MPERS + +extern const struct xlat mtd_otp_options[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat mtd_otp_options[] = { #if defined(MTD_OTP_OFF) || (defined(HAVE_DECL_MTD_OTP_OFF) && HAVE_DECL_MTD_OTP_OFF) - XLAT(MTD_OTP_OFF), + XLAT(MTD_OTP_OFF), #endif #if defined(MTD_OTP_FACTORY) || (defined(HAVE_DECL_MTD_OTP_FACTORY) && HAVE_DECL_MTD_OTP_FACTORY) - XLAT(MTD_OTP_FACTORY), + XLAT(MTD_OTP_FACTORY), #endif #if defined(MTD_OTP_USER) || (defined(HAVE_DECL_MTD_OTP_USER) && HAVE_DECL_MTD_OTP_USER) - XLAT(MTD_OTP_USER), + XLAT(MTD_OTP_USER), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/mtd_type_options.h b/xlat/mtd_type_options.h index 404aca83..46829e8f 100644 --- a/xlat/mtd_type_options.h +++ b/xlat/mtd_type_options.h @@ -1,29 +1,40 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_type_options.in; do not edit. */ -static const struct xlat mtd_type_options[] = { +#ifdef IN_MPERS + +extern const struct xlat mtd_type_options[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat mtd_type_options[] = { #if defined(MTD_ABSENT) || (defined(HAVE_DECL_MTD_ABSENT) && HAVE_DECL_MTD_ABSENT) - XLAT(MTD_ABSENT), + XLAT(MTD_ABSENT), #endif #if defined(MTD_RAM) || (defined(HAVE_DECL_MTD_RAM) && HAVE_DECL_MTD_RAM) - XLAT(MTD_RAM), + XLAT(MTD_RAM), #endif #if defined(MTD_ROM) || (defined(HAVE_DECL_MTD_ROM) && HAVE_DECL_MTD_ROM) - XLAT(MTD_ROM), + XLAT(MTD_ROM), #endif #if defined(MTD_NORFLASH) || (defined(HAVE_DECL_MTD_NORFLASH) && HAVE_DECL_MTD_NORFLASH) - XLAT(MTD_NORFLASH), + XLAT(MTD_NORFLASH), #endif #if defined(MTD_NANDFLASH) || (defined(HAVE_DECL_MTD_NANDFLASH) && HAVE_DECL_MTD_NANDFLASH) - XLAT(MTD_NANDFLASH), + XLAT(MTD_NANDFLASH), #endif #if defined(MTD_DATAFLASH) || (defined(HAVE_DECL_MTD_DATAFLASH) && HAVE_DECL_MTD_DATAFLASH) - XLAT(MTD_DATAFLASH), + XLAT(MTD_DATAFLASH), #endif #if defined(MTD_UBIVOLUME) || (defined(HAVE_DECL_MTD_UBIVOLUME) && HAVE_DECL_MTD_UBIVOLUME) - XLAT(MTD_UBIVOLUME), + XLAT(MTD_UBIVOLUME), #endif #if defined(MTD_MLCNANDFLASH) || (defined(HAVE_DECL_MTD_MLCNANDFLASH) && HAVE_DECL_MTD_MLCNANDFLASH) - XLAT(MTD_MLCNANDFLASH), + XLAT(MTD_MLCNANDFLASH), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/name_to_handle_at_flags.h b/xlat/name_to_handle_at_flags.h new file mode 100644 index 00000000..512889d7 --- /dev/null +++ b/xlat/name_to_handle_at_flags.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/name_to_handle_at_flags.in; do not edit. */ +#if !(defined(AT_SYMLINK_FOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_FOLLOW) && HAVE_DECL_AT_SYMLINK_FOLLOW)) +# define AT_SYMLINK_FOLLOW 0x400 +#endif +#if !(defined(AT_EMPTY_PATH) || (defined(HAVE_DECL_AT_EMPTY_PATH) && HAVE_DECL_AT_EMPTY_PATH)) +# define AT_EMPTY_PATH 0x1000 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat name_to_handle_at_flags in mpers mode + +#else + +static +const struct xlat name_to_handle_at_flags[] = { + XLAT(AT_SYMLINK_FOLLOW), + XLAT(AT_EMPTY_PATH), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/name_to_handle_at_flags.in b/xlat/name_to_handle_at_flags.in new file mode 100644 index 00000000..4522a801 --- /dev/null +++ b/xlat/name_to_handle_at_flags.in @@ -0,0 +1,2 @@ +AT_SYMLINK_FOLLOW 0x400 +AT_EMPTY_PATH 0x1000 diff --git a/xlat/netlink_flags.h b/xlat/netlink_flags.h new file mode 100644 index 00000000..ca1f3a31 --- /dev/null +++ b/xlat/netlink_flags.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_flags.in; do not edit. */ +#if !(defined(NLM_F_REQUEST) || (defined(HAVE_DECL_NLM_F_REQUEST) && HAVE_DECL_NLM_F_REQUEST)) +# define NLM_F_REQUEST 0x1 +#endif +#if !(defined(NLM_F_MULTI) || (defined(HAVE_DECL_NLM_F_MULTI) && HAVE_DECL_NLM_F_MULTI)) +# define NLM_F_MULTI 0x2 +#endif +#if !(defined(NLM_F_ACK) || (defined(HAVE_DECL_NLM_F_ACK) && HAVE_DECL_NLM_F_ACK)) +# define NLM_F_ACK 0x4 +#endif +#if !(defined(NLM_F_ECHO) || (defined(HAVE_DECL_NLM_F_ECHO) && HAVE_DECL_NLM_F_ECHO)) +# define NLM_F_ECHO 0x8 +#endif +#if !(defined(NLM_F_DUMP_INTR) || (defined(HAVE_DECL_NLM_F_DUMP_INTR) && HAVE_DECL_NLM_F_DUMP_INTR)) +# define NLM_F_DUMP_INTR 0x10 +#endif +#if !(defined(NLM_F_DUMP_FILTERED) || (defined(HAVE_DECL_NLM_F_DUMP_FILTERED) && HAVE_DECL_NLM_F_DUMP_FILTERED)) +# define NLM_F_DUMP_FILTERED 0x20 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat netlink_flags in mpers mode + +#else + +static +const struct xlat netlink_flags[] = { + XLAT(NLM_F_REQUEST), + XLAT(NLM_F_MULTI), + XLAT(NLM_F_ACK), + XLAT(NLM_F_ECHO), + XLAT(NLM_F_DUMP_INTR), + XLAT(NLM_F_DUMP_FILTERED), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/netlink_flags.in b/xlat/netlink_flags.in new file mode 100644 index 00000000..d84f4ddb --- /dev/null +++ b/xlat/netlink_flags.in @@ -0,0 +1,6 @@ +NLM_F_REQUEST 0x1 +NLM_F_MULTI 0x2 +NLM_F_ACK 0x4 +NLM_F_ECHO 0x8 +NLM_F_DUMP_INTR 0x10 +NLM_F_DUMP_FILTERED 0x20 diff --git a/xlat/netlink_protocols.h b/xlat/netlink_protocols.h index d5614f92..0e1133fd 100644 --- a/xlat/netlink_protocols.h +++ b/xlat/netlink_protocols.h @@ -1,68 +1,98 @@ /* Generated by ./xlat/gen.sh from ./xlat/netlink_protocols.in; do not edit. */ - -static const struct xlat netlink_protocols[] = { -#if defined(NETLINK_ROUTE) || (defined(HAVE_DECL_NETLINK_ROUTE) && HAVE_DECL_NETLINK_ROUTE) - XLAT(NETLINK_ROUTE), +#if !(defined(NETLINK_ROUTE) || (defined(HAVE_DECL_NETLINK_ROUTE) && HAVE_DECL_NETLINK_ROUTE)) +# define NETLINK_ROUTE 0 #endif -#if defined(NETLINK_UNUSED) || (defined(HAVE_DECL_NETLINK_UNUSED) && HAVE_DECL_NETLINK_UNUSED) - XLAT(NETLINK_UNUSED), +#if !(defined(NETLINK_UNUSED) || (defined(HAVE_DECL_NETLINK_UNUSED) && HAVE_DECL_NETLINK_UNUSED)) +# define NETLINK_UNUSED 1 #endif -#if defined(NETLINK_USERSOCK) || (defined(HAVE_DECL_NETLINK_USERSOCK) && HAVE_DECL_NETLINK_USERSOCK) - XLAT(NETLINK_USERSOCK), +#if !(defined(NETLINK_USERSOCK) || (defined(HAVE_DECL_NETLINK_USERSOCK) && HAVE_DECL_NETLINK_USERSOCK)) +# define NETLINK_USERSOCK 2 #endif -#if defined(NETLINK_FIREWALL) || (defined(HAVE_DECL_NETLINK_FIREWALL) && HAVE_DECL_NETLINK_FIREWALL) - XLAT(NETLINK_FIREWALL), +#if !(defined(NETLINK_FIREWALL) || (defined(HAVE_DECL_NETLINK_FIREWALL) && HAVE_DECL_NETLINK_FIREWALL)) +# define NETLINK_FIREWALL 3 #endif -#if defined(NETLINK_SOCK_DIAG) || (defined(HAVE_DECL_NETLINK_SOCK_DIAG) && HAVE_DECL_NETLINK_SOCK_DIAG) - XLAT(NETLINK_SOCK_DIAG), +#if !(defined(NETLINK_SOCK_DIAG) || (defined(HAVE_DECL_NETLINK_SOCK_DIAG) && HAVE_DECL_NETLINK_SOCK_DIAG)) +# define NETLINK_SOCK_DIAG 4 #endif -#if defined(NETLINK_NFLOG) || (defined(HAVE_DECL_NETLINK_NFLOG) && HAVE_DECL_NETLINK_NFLOG) - XLAT(NETLINK_NFLOG), +#if !(defined(NETLINK_NFLOG) || (defined(HAVE_DECL_NETLINK_NFLOG) && HAVE_DECL_NETLINK_NFLOG)) +# define NETLINK_NFLOG 5 #endif -#if defined(NETLINK_XFRM) || (defined(HAVE_DECL_NETLINK_XFRM) && HAVE_DECL_NETLINK_XFRM) - XLAT(NETLINK_XFRM), +#if !(defined(NETLINK_XFRM) || (defined(HAVE_DECL_NETLINK_XFRM) && HAVE_DECL_NETLINK_XFRM)) +# define NETLINK_XFRM 6 #endif -#if defined(NETLINK_SELINUX) || (defined(HAVE_DECL_NETLINK_SELINUX) && HAVE_DECL_NETLINK_SELINUX) - XLAT(NETLINK_SELINUX), +#if !(defined(NETLINK_SELINUX) || (defined(HAVE_DECL_NETLINK_SELINUX) && HAVE_DECL_NETLINK_SELINUX)) +# define NETLINK_SELINUX 7 #endif -#if defined(NETLINK_ISCSI) || (defined(HAVE_DECL_NETLINK_ISCSI) && HAVE_DECL_NETLINK_ISCSI) - XLAT(NETLINK_ISCSI), +#if !(defined(NETLINK_ISCSI) || (defined(HAVE_DECL_NETLINK_ISCSI) && HAVE_DECL_NETLINK_ISCSI)) +# define NETLINK_ISCSI 8 #endif -#if defined(NETLINK_AUDIT) || (defined(HAVE_DECL_NETLINK_AUDIT) && HAVE_DECL_NETLINK_AUDIT) - XLAT(NETLINK_AUDIT), +#if !(defined(NETLINK_AUDIT) || (defined(HAVE_DECL_NETLINK_AUDIT) && HAVE_DECL_NETLINK_AUDIT)) +# define NETLINK_AUDIT 9 #endif -#if defined(NETLINK_FIB_LOOKUP) || (defined(HAVE_DECL_NETLINK_FIB_LOOKUP) && HAVE_DECL_NETLINK_FIB_LOOKUP) - XLAT(NETLINK_FIB_LOOKUP), +#if !(defined(NETLINK_FIB_LOOKUP) || (defined(HAVE_DECL_NETLINK_FIB_LOOKUP) && HAVE_DECL_NETLINK_FIB_LOOKUP)) +# define NETLINK_FIB_LOOKUP 10 #endif -#if defined(NETLINK_CONNECTOR) || (defined(HAVE_DECL_NETLINK_CONNECTOR) && HAVE_DECL_NETLINK_CONNECTOR) - XLAT(NETLINK_CONNECTOR), +#if !(defined(NETLINK_CONNECTOR) || (defined(HAVE_DECL_NETLINK_CONNECTOR) && HAVE_DECL_NETLINK_CONNECTOR)) +# define NETLINK_CONNECTOR 11 #endif -#if defined(NETLINK_NETFILTER) || (defined(HAVE_DECL_NETLINK_NETFILTER) && HAVE_DECL_NETLINK_NETFILTER) - XLAT(NETLINK_NETFILTER), +#if !(defined(NETLINK_NETFILTER) || (defined(HAVE_DECL_NETLINK_NETFILTER) && HAVE_DECL_NETLINK_NETFILTER)) +# define NETLINK_NETFILTER 12 #endif -#if defined(NETLINK_IP6_FW) || (defined(HAVE_DECL_NETLINK_IP6_FW) && HAVE_DECL_NETLINK_IP6_FW) - XLAT(NETLINK_IP6_FW), +#if !(defined(NETLINK_IP6_FW) || (defined(HAVE_DECL_NETLINK_IP6_FW) && HAVE_DECL_NETLINK_IP6_FW)) +# define NETLINK_IP6_FW 13 #endif -#if defined(NETLINK_DNRTMSG) || (defined(HAVE_DECL_NETLINK_DNRTMSG) && HAVE_DECL_NETLINK_DNRTMSG) - XLAT(NETLINK_DNRTMSG), +#if !(defined(NETLINK_DNRTMSG) || (defined(HAVE_DECL_NETLINK_DNRTMSG) && HAVE_DECL_NETLINK_DNRTMSG)) +# define NETLINK_DNRTMSG 14 #endif -#if defined(NETLINK_KOBJECT_UEVENT) || (defined(HAVE_DECL_NETLINK_KOBJECT_UEVENT) && HAVE_DECL_NETLINK_KOBJECT_UEVENT) - XLAT(NETLINK_KOBJECT_UEVENT), +#if !(defined(NETLINK_KOBJECT_UEVENT) || (defined(HAVE_DECL_NETLINK_KOBJECT_UEVENT) && HAVE_DECL_NETLINK_KOBJECT_UEVENT)) +# define NETLINK_KOBJECT_UEVENT 15 #endif -#if defined(NETLINK_GENERIC) || (defined(HAVE_DECL_NETLINK_GENERIC) && HAVE_DECL_NETLINK_GENERIC) - XLAT(NETLINK_GENERIC), +#if !(defined(NETLINK_GENERIC) || (defined(HAVE_DECL_NETLINK_GENERIC) && HAVE_DECL_NETLINK_GENERIC)) +# define NETLINK_GENERIC 16 #endif -#if defined(NETLINK_SCSITRANSPORT) || (defined(HAVE_DECL_NETLINK_SCSITRANSPORT) && HAVE_DECL_NETLINK_SCSITRANSPORT) - XLAT(NETLINK_SCSITRANSPORT), +#if !(defined(NETLINK_SCSITRANSPORT) || (defined(HAVE_DECL_NETLINK_SCSITRANSPORT) && HAVE_DECL_NETLINK_SCSITRANSPORT)) +# define NETLINK_SCSITRANSPORT 18 #endif -#if defined(NETLINK_ECRYPTFS) || (defined(HAVE_DECL_NETLINK_ECRYPTFS) && HAVE_DECL_NETLINK_ECRYPTFS) - XLAT(NETLINK_ECRYPTFS), +#if !(defined(NETLINK_ECRYPTFS) || (defined(HAVE_DECL_NETLINK_ECRYPTFS) && HAVE_DECL_NETLINK_ECRYPTFS)) +# define NETLINK_ECRYPTFS 19 #endif -#if defined(NETLINK_RDMA) || (defined(HAVE_DECL_NETLINK_RDMA) && HAVE_DECL_NETLINK_RDMA) - XLAT(NETLINK_RDMA), +#if !(defined(NETLINK_RDMA) || (defined(HAVE_DECL_NETLINK_RDMA) && HAVE_DECL_NETLINK_RDMA)) +# define NETLINK_RDMA 20 #endif -#if defined(NETLINK_CRYPTO) || (defined(HAVE_DECL_NETLINK_CRYPTO) && HAVE_DECL_NETLINK_CRYPTO) - XLAT(NETLINK_CRYPTO), +#if !(defined(NETLINK_CRYPTO) || (defined(HAVE_DECL_NETLINK_CRYPTO) && HAVE_DECL_NETLINK_CRYPTO)) +# define NETLINK_CRYPTO 21 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat netlink_protocols in mpers mode + +#else + +static +const struct xlat netlink_protocols[] = { + XLAT(NETLINK_ROUTE), + XLAT(NETLINK_UNUSED), + XLAT(NETLINK_USERSOCK), + XLAT(NETLINK_FIREWALL), + XLAT(NETLINK_SOCK_DIAG), + XLAT(NETLINK_NFLOG), + XLAT(NETLINK_XFRM), + XLAT(NETLINK_SELINUX), + XLAT(NETLINK_ISCSI), + XLAT(NETLINK_AUDIT), + XLAT(NETLINK_FIB_LOOKUP), + XLAT(NETLINK_CONNECTOR), + XLAT(NETLINK_NETFILTER), + XLAT(NETLINK_IP6_FW), + XLAT(NETLINK_DNRTMSG), + XLAT(NETLINK_KOBJECT_UEVENT), + XLAT(NETLINK_GENERIC), + XLAT(NETLINK_SCSITRANSPORT), + XLAT(NETLINK_ECRYPTFS), + XLAT(NETLINK_RDMA), + XLAT(NETLINK_CRYPTO), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/netlink_protocols.in b/xlat/netlink_protocols.in index 76383f3e..45116cf0 100644 --- a/xlat/netlink_protocols.in +++ b/xlat/netlink_protocols.in @@ -1,21 +1,21 @@ -NETLINK_ROUTE -NETLINK_UNUSED -NETLINK_USERSOCK -NETLINK_FIREWALL -NETLINK_SOCK_DIAG -NETLINK_NFLOG -NETLINK_XFRM -NETLINK_SELINUX -NETLINK_ISCSI -NETLINK_AUDIT -NETLINK_FIB_LOOKUP -NETLINK_CONNECTOR -NETLINK_NETFILTER -NETLINK_IP6_FW -NETLINK_DNRTMSG -NETLINK_KOBJECT_UEVENT -NETLINK_GENERIC -NETLINK_SCSITRANSPORT -NETLINK_ECRYPTFS -NETLINK_RDMA -NETLINK_CRYPTO +NETLINK_ROUTE 0 +NETLINK_UNUSED 1 +NETLINK_USERSOCK 2 +NETLINK_FIREWALL 3 +NETLINK_SOCK_DIAG 4 +NETLINK_NFLOG 5 +NETLINK_XFRM 6 +NETLINK_SELINUX 7 +NETLINK_ISCSI 8 +NETLINK_AUDIT 9 +NETLINK_FIB_LOOKUP 10 +NETLINK_CONNECTOR 11 +NETLINK_NETFILTER 12 +NETLINK_IP6_FW 13 +NETLINK_DNRTMSG 14 +NETLINK_KOBJECT_UEVENT 15 +NETLINK_GENERIC 16 +NETLINK_SCSITRANSPORT 18 +NETLINK_ECRYPTFS 19 +NETLINK_RDMA 20 +NETLINK_CRYPTO 21 diff --git a/xlat/netlink_types.h b/xlat/netlink_types.h new file mode 100644 index 00000000..96031f2a --- /dev/null +++ b/xlat/netlink_types.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_types.in; do not edit. */ +#if !(defined(NLMSG_NOOP) || (defined(HAVE_DECL_NLMSG_NOOP) && HAVE_DECL_NLMSG_NOOP)) +# define NLMSG_NOOP 0x1 +#endif +#if !(defined(NLMSG_ERROR) || (defined(HAVE_DECL_NLMSG_ERROR) && HAVE_DECL_NLMSG_ERROR)) +# define NLMSG_ERROR 0x2 +#endif +#if !(defined(NLMSG_DONE) || (defined(HAVE_DECL_NLMSG_DONE) && HAVE_DECL_NLMSG_DONE)) +# define NLMSG_DONE 0x3 +#endif +#if !(defined(NLMSG_OVERRUN) || (defined(HAVE_DECL_NLMSG_OVERRUN) && HAVE_DECL_NLMSG_OVERRUN)) +# define NLMSG_OVERRUN 0x4 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat netlink_types in mpers mode + +#else + +static +const struct xlat netlink_types[] = { + XLAT(NLMSG_NOOP), + XLAT(NLMSG_ERROR), + XLAT(NLMSG_DONE), + XLAT(NLMSG_OVERRUN), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/netlink_types.in b/xlat/netlink_types.in new file mode 100644 index 00000000..9cb52973 --- /dev/null +++ b/xlat/netlink_types.in @@ -0,0 +1,4 @@ +NLMSG_NOOP 0x1 +NLMSG_ERROR 0x2 +NLMSG_DONE 0x3 +NLMSG_OVERRUN 0x4 diff --git a/xlat/notifyflags.h b/xlat/notifyflags.h index fe027284..e496e8cd 100644 --- a/xlat/notifyflags.h +++ b/xlat/notifyflags.h @@ -1,26 +1,35 @@ /* Generated by ./xlat/gen.sh from ./xlat/notifyflags.in; do not edit. */ -static const struct xlat notifyflags[] = { +#ifdef IN_MPERS + +# error static const struct xlat notifyflags in mpers mode + +#else + +static +const struct xlat notifyflags[] = { #if defined(DN_ACCESS) || (defined(HAVE_DECL_DN_ACCESS) && HAVE_DECL_DN_ACCESS) - XLAT(DN_ACCESS), + XLAT(DN_ACCESS), #endif #if defined(DN_MODIFY) || (defined(HAVE_DECL_DN_MODIFY) && HAVE_DECL_DN_MODIFY) - XLAT(DN_MODIFY), + XLAT(DN_MODIFY), #endif #if defined(DN_CREATE) || (defined(HAVE_DECL_DN_CREATE) && HAVE_DECL_DN_CREATE) - XLAT(DN_CREATE), + XLAT(DN_CREATE), #endif #if defined(DN_DELETE) || (defined(HAVE_DECL_DN_DELETE) && HAVE_DECL_DN_DELETE) - XLAT(DN_DELETE), + XLAT(DN_DELETE), #endif #if defined(DN_RENAME) || (defined(HAVE_DECL_DN_RENAME) && HAVE_DECL_DN_RENAME) - XLAT(DN_RENAME), + XLAT(DN_RENAME), #endif #if defined(DN_ATTRIB) || (defined(HAVE_DECL_DN_ATTRIB) && HAVE_DECL_DN_ATTRIB) - XLAT(DN_ATTRIB), + XLAT(DN_ATTRIB), #endif #if defined(DN_MULTISHOT) || (defined(HAVE_DECL_DN_MULTISHOT) && HAVE_DECL_DN_MULTISHOT) - XLAT(DN_MULTISHOT), + XLAT(DN_MULTISHOT), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/nt_descriptor_types.h b/xlat/nt_descriptor_types.h index a928b843..715c2817 100644 --- a/xlat/nt_descriptor_types.h +++ b/xlat/nt_descriptor_types.h @@ -1,74 +1,83 @@ /* Generated by ./xlat/gen.sh from ./xlat/nt_descriptor_types.in; do not edit. */ -static const struct xlat nt_descriptor_types[] = { +#ifdef IN_MPERS + +# error static const struct xlat nt_descriptor_types in mpers mode + +#else + +static +const struct xlat nt_descriptor_types[] = { #if defined(NT_PRSTATUS) || (defined(HAVE_DECL_NT_PRSTATUS) && HAVE_DECL_NT_PRSTATUS) - XLAT(NT_PRSTATUS), + XLAT(NT_PRSTATUS), #endif #if defined(NT_FPREGSET) || (defined(HAVE_DECL_NT_FPREGSET) && HAVE_DECL_NT_FPREGSET) - XLAT(NT_FPREGSET), + XLAT(NT_FPREGSET), #endif #if defined(NT_PRPSINFO) || (defined(HAVE_DECL_NT_PRPSINFO) && HAVE_DECL_NT_PRPSINFO) - XLAT(NT_PRPSINFO), + XLAT(NT_PRPSINFO), #endif #if defined(NT_PRXREG) || (defined(HAVE_DECL_NT_PRXREG) && HAVE_DECL_NT_PRXREG) - XLAT(NT_PRXREG), + XLAT(NT_PRXREG), #endif #if defined(NT_TASKSTRUCT) || (defined(HAVE_DECL_NT_TASKSTRUCT) && HAVE_DECL_NT_TASKSTRUCT) - XLAT(NT_TASKSTRUCT), + XLAT(NT_TASKSTRUCT), #endif #if defined(NT_PLATFORM) || (defined(HAVE_DECL_NT_PLATFORM) && HAVE_DECL_NT_PLATFORM) - XLAT(NT_PLATFORM), + XLAT(NT_PLATFORM), #endif #if defined(NT_AUXV) || (defined(HAVE_DECL_NT_AUXV) && HAVE_DECL_NT_AUXV) - XLAT(NT_AUXV), + XLAT(NT_AUXV), #endif #if defined(NT_GWINDOWS) || (defined(HAVE_DECL_NT_GWINDOWS) && HAVE_DECL_NT_GWINDOWS) - XLAT(NT_GWINDOWS), + XLAT(NT_GWINDOWS), #endif #if defined(NT_ASRS) || (defined(HAVE_DECL_NT_ASRS) && HAVE_DECL_NT_ASRS) - XLAT(NT_ASRS), + XLAT(NT_ASRS), #endif #if defined(NT_PSTATUS) || (defined(HAVE_DECL_NT_PSTATUS) && HAVE_DECL_NT_PSTATUS) - XLAT(NT_PSTATUS), + XLAT(NT_PSTATUS), #endif #if defined(NT_PSINFO) || (defined(HAVE_DECL_NT_PSINFO) && HAVE_DECL_NT_PSINFO) - XLAT(NT_PSINFO), + XLAT(NT_PSINFO), #endif #if defined(NT_PRCRED) || (defined(HAVE_DECL_NT_PRCRED) && HAVE_DECL_NT_PRCRED) - XLAT(NT_PRCRED), + XLAT(NT_PRCRED), #endif #if defined(NT_UTSNAME) || (defined(HAVE_DECL_NT_UTSNAME) && HAVE_DECL_NT_UTSNAME) - XLAT(NT_UTSNAME), + XLAT(NT_UTSNAME), #endif #if defined(NT_LWPSTATUS) || (defined(HAVE_DECL_NT_LWPSTATUS) && HAVE_DECL_NT_LWPSTATUS) - XLAT(NT_LWPSTATUS), + XLAT(NT_LWPSTATUS), #endif #if defined(NT_LWPSINFO) || (defined(HAVE_DECL_NT_LWPSINFO) && HAVE_DECL_NT_LWPSINFO) - XLAT(NT_LWPSINFO), + XLAT(NT_LWPSINFO), #endif #if defined(NT_PRFPXREG) || (defined(HAVE_DECL_NT_PRFPXREG) && HAVE_DECL_NT_PRFPXREG) - XLAT(NT_PRFPXREG), + XLAT(NT_PRFPXREG), #endif #if defined(NT_PRXFPREG) || (defined(HAVE_DECL_NT_PRXFPREG) && HAVE_DECL_NT_PRXFPREG) - XLAT(NT_PRXFPREG), + XLAT(NT_PRXFPREG), #endif #if defined(NT_PPC_VMX) || (defined(HAVE_DECL_NT_PPC_VMX) && HAVE_DECL_NT_PPC_VMX) - XLAT(NT_PPC_VMX), + XLAT(NT_PPC_VMX), #endif #if defined(NT_PPC_SPE) || (defined(HAVE_DECL_NT_PPC_SPE) && HAVE_DECL_NT_PPC_SPE) - XLAT(NT_PPC_SPE), + XLAT(NT_PPC_SPE), #endif #if defined(NT_PPC_VSX) || (defined(HAVE_DECL_NT_PPC_VSX) && HAVE_DECL_NT_PPC_VSX) - XLAT(NT_PPC_VSX), + XLAT(NT_PPC_VSX), #endif #if defined(NT_386_TLS) || (defined(HAVE_DECL_NT_386_TLS) && HAVE_DECL_NT_386_TLS) - XLAT(NT_386_TLS), + XLAT(NT_386_TLS), #endif #if defined(NT_386_IOPERM) || (defined(HAVE_DECL_NT_386_IOPERM) && HAVE_DECL_NT_386_IOPERM) - XLAT(NT_386_IOPERM), + XLAT(NT_386_IOPERM), #endif #if defined(NT_X86_XSTATE) || (defined(HAVE_DECL_NT_X86_XSTATE) && HAVE_DECL_NT_X86_XSTATE) - XLAT(NT_X86_XSTATE), + XLAT(NT_X86_XSTATE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/open_access_modes.h b/xlat/open_access_modes.h index 02deb2eb..8b11517c 100644 --- a/xlat/open_access_modes.h +++ b/xlat/open_access_modes.h @@ -1,17 +1,21 @@ /* Generated by ./xlat/gen.sh from ./xlat/open_access_modes.in; do not edit. */ +#ifndef IN_MPERS + const struct xlat open_access_modes[] = { #if defined(O_RDONLY) || (defined(HAVE_DECL_O_RDONLY) && HAVE_DECL_O_RDONLY) - XLAT(O_RDONLY), + XLAT(O_RDONLY), #endif #if defined(O_WRONLY) || (defined(HAVE_DECL_O_WRONLY) && HAVE_DECL_O_WRONLY) - XLAT(O_WRONLY), + XLAT(O_WRONLY), #endif #if defined(O_RDWR) || (defined(HAVE_DECL_O_RDWR) && HAVE_DECL_O_RDWR) - XLAT(O_RDWR), + XLAT(O_RDWR), #endif #if defined(O_ACCMODE) || (defined(HAVE_DECL_O_ACCMODE) && HAVE_DECL_O_ACCMODE) - XLAT(O_ACCMODE), + XLAT(O_ACCMODE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/open_mode_flags.h b/xlat/open_mode_flags.h index 8d82a61e..f81f16bb 100644 --- a/xlat/open_mode_flags.h +++ b/xlat/open_mode_flags.h @@ -1,109 +1,121 @@ /* Generated by ./xlat/gen.sh from ./xlat/open_mode_flags.in; do not edit. */ +#if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK) +#endif +#if defined(O_TMPFILE) && defined(O_DIRECTORY) +#endif + +#ifndef IN_MPERS const struct xlat open_mode_flags[] = { #if defined(O_CREAT) || (defined(HAVE_DECL_O_CREAT) && HAVE_DECL_O_CREAT) - XLAT(O_CREAT), + XLAT(O_CREAT), #endif #if defined(O_EXCL) || (defined(HAVE_DECL_O_EXCL) && HAVE_DECL_O_EXCL) - XLAT(O_EXCL), + XLAT(O_EXCL), #endif #if defined(O_NOCTTY) || (defined(HAVE_DECL_O_NOCTTY) && HAVE_DECL_O_NOCTTY) - XLAT(O_NOCTTY), + XLAT(O_NOCTTY), #endif #if defined(O_TRUNC) || (defined(HAVE_DECL_O_TRUNC) && HAVE_DECL_O_TRUNC) - XLAT(O_TRUNC), + XLAT(O_TRUNC), #endif #if defined(O_APPEND) || (defined(HAVE_DECL_O_APPEND) && HAVE_DECL_O_APPEND) - XLAT(O_APPEND), + XLAT(O_APPEND), #endif #if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) - XLAT(O_NONBLOCK), + XLAT(O_NONBLOCK), #endif #if defined(O_SYNC) || (defined(HAVE_DECL_O_SYNC) && HAVE_DECL_O_SYNC) - XLAT(O_SYNC), + XLAT(O_SYNC), #endif #if defined(O_ASYNC) || (defined(HAVE_DECL_O_ASYNC) && HAVE_DECL_O_ASYNC) - XLAT(O_ASYNC), + XLAT(O_ASYNC), #endif #if defined(O_DSYNC) || (defined(HAVE_DECL_O_DSYNC) && HAVE_DECL_O_DSYNC) - XLAT(O_DSYNC), + XLAT(O_DSYNC), #endif #if defined(O_RSYNC) || (defined(HAVE_DECL_O_RSYNC) && HAVE_DECL_O_RSYNC) - XLAT(O_RSYNC), + XLAT(O_RSYNC), #endif #if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK) #if defined(O_NDELAY) || (defined(HAVE_DECL_O_NDELAY) && HAVE_DECL_O_NDELAY) - XLAT(O_NDELAY), + XLAT(O_NDELAY), #endif #endif #if defined(O_PRIV) || (defined(HAVE_DECL_O_PRIV) && HAVE_DECL_O_PRIV) - XLAT(O_PRIV), + XLAT(O_PRIV), #endif #if defined(O_DIRECT) || (defined(HAVE_DECL_O_DIRECT) && HAVE_DECL_O_DIRECT) - XLAT(O_DIRECT), + XLAT(O_DIRECT), #endif #if defined(O_LARGEFILE) || (defined(HAVE_DECL_O_LARGEFILE) && HAVE_DECL_O_LARGEFILE) - XLAT(O_LARGEFILE), + XLAT(O_LARGEFILE), #endif #if defined(O_DIRECTORY) || (defined(HAVE_DECL_O_DIRECTORY) && HAVE_DECL_O_DIRECTORY) - XLAT(O_DIRECTORY), + XLAT(O_DIRECTORY), #endif #if defined(O_NOFOLLOW) || (defined(HAVE_DECL_O_NOFOLLOW) && HAVE_DECL_O_NOFOLLOW) - XLAT(O_NOFOLLOW), + XLAT(O_NOFOLLOW), #endif #if defined(O_NOATIME) || (defined(HAVE_DECL_O_NOATIME) && HAVE_DECL_O_NOATIME) - XLAT(O_NOATIME), + XLAT(O_NOATIME), #endif #if defined(O_CLOEXEC) || (defined(HAVE_DECL_O_CLOEXEC) && HAVE_DECL_O_CLOEXEC) - XLAT(O_CLOEXEC), + XLAT(O_CLOEXEC), #endif #if defined(O_PATH) || (defined(HAVE_DECL_O_PATH) && HAVE_DECL_O_PATH) - XLAT(O_PATH), + XLAT(O_PATH), +#endif +#if defined(O_TMPFILE) && defined(O_DIRECTORY) +/* The kernel & C libraries often inline O_DIRECTORY */ +{ O_TMPFILE & ~O_DIRECTORY, "O_TMPFILE" }, #endif #if defined(FNDELAY) || (defined(HAVE_DECL_FNDELAY) && HAVE_DECL_FNDELAY) - XLAT(FNDELAY), + XLAT(FNDELAY), #endif #if defined(FAPPEND) || (defined(HAVE_DECL_FAPPEND) && HAVE_DECL_FAPPEND) - XLAT(FAPPEND), + XLAT(FAPPEND), #endif #if defined(FMARK) || (defined(HAVE_DECL_FMARK) && HAVE_DECL_FMARK) - XLAT(FMARK), + XLAT(FMARK), #endif #if defined(FDEFER) || (defined(HAVE_DECL_FDEFER) && HAVE_DECL_FDEFER) - XLAT(FDEFER), + XLAT(FDEFER), #endif #if defined(FASYNC) || (defined(HAVE_DECL_FASYNC) && HAVE_DECL_FASYNC) - XLAT(FASYNC), + XLAT(FASYNC), #endif #if defined(FSHLOCK) || (defined(HAVE_DECL_FSHLOCK) && HAVE_DECL_FSHLOCK) - XLAT(FSHLOCK), + XLAT(FSHLOCK), #endif #if defined(FEXLOCK) || (defined(HAVE_DECL_FEXLOCK) && HAVE_DECL_FEXLOCK) - XLAT(FEXLOCK), + XLAT(FEXLOCK), #endif #if defined(FCREAT) || (defined(HAVE_DECL_FCREAT) && HAVE_DECL_FCREAT) - XLAT(FCREAT), + XLAT(FCREAT), #endif #if defined(FTRUNC) || (defined(HAVE_DECL_FTRUNC) && HAVE_DECL_FTRUNC) - XLAT(FTRUNC), + XLAT(FTRUNC), #endif #if defined(FEXCL) || (defined(HAVE_DECL_FEXCL) && HAVE_DECL_FEXCL) - XLAT(FEXCL), + XLAT(FEXCL), #endif #if defined(FNBIO) || (defined(HAVE_DECL_FNBIO) && HAVE_DECL_FNBIO) - XLAT(FNBIO), + XLAT(FNBIO), #endif #if defined(FSYNC) || (defined(HAVE_DECL_FSYNC) && HAVE_DECL_FSYNC) - XLAT(FSYNC), + XLAT(FSYNC), #endif #if defined(FNOCTTY) || (defined(HAVE_DECL_FNOCTTY) && HAVE_DECL_FNOCTTY) - XLAT(FNOCTTY), + XLAT(FNOCTTY), #endif #if defined(O_SHLOCK) || (defined(HAVE_DECL_O_SHLOCK) && HAVE_DECL_O_SHLOCK) - XLAT(O_SHLOCK), + XLAT(O_SHLOCK), #endif #if defined(O_EXLOCK) || (defined(HAVE_DECL_O_EXLOCK) && HAVE_DECL_O_EXLOCK) - XLAT(O_EXLOCK), + XLAT(O_EXLOCK), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/open_mode_flags.in b/xlat/open_mode_flags.in index b323f8b7..30bed260 100644 --- a/xlat/open_mode_flags.in +++ b/xlat/open_mode_flags.in @@ -19,6 +19,10 @@ O_NOFOLLOW O_NOATIME O_CLOEXEC O_PATH +#if defined(O_TMPFILE) && defined(O_DIRECTORY) +/* The kernel & C libraries often inline O_DIRECTORY */ +{ O_TMPFILE & ~O_DIRECTORY, "O_TMPFILE" }, +#endif FNDELAY FAPPEND FMARK diff --git a/xlat/openmodessol.h b/xlat/openmodessol.h index 929c6e12..fb6a5533 100644 --- a/xlat/openmodessol.h +++ b/xlat/openmodessol.h @@ -1,6 +1,13 @@ /* Generated by ./xlat/gen.sh from ./xlat/openmodessol.in; do not edit. */ -static const struct xlat openmodessol[] = { +#ifdef IN_MPERS + +# error static const struct xlat openmodessol in mpers mode + +#else + +static +const struct xlat openmodessol[] = { { 0, "O_RDWR" }, { 1, "O_RDONLY" }, { 2, "O_WRONLY" }, @@ -15,5 +22,7 @@ static const struct xlat openmodessol[] = { { 0x8000, "O_RSYNC" }, { 4, "O_NDELAY" }, { 0x1000, "O_PRIV" }, - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/packet_mreq_type.h b/xlat/packet_mreq_type.h new file mode 100644 index 00000000..012d3e78 --- /dev/null +++ b/xlat/packet_mreq_type.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/packet_mreq_type.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat packet_mreq_type in mpers mode + +#else + +static +const struct xlat packet_mreq_type[] = { +#if defined(PACKET_MR_MULTICAST) || (defined(HAVE_DECL_PACKET_MR_MULTICAST) && HAVE_DECL_PACKET_MR_MULTICAST) + XLAT(PACKET_MR_MULTICAST), +#endif +#if defined(PACKET_MR_PROMISC) || (defined(HAVE_DECL_PACKET_MR_PROMISC) && HAVE_DECL_PACKET_MR_PROMISC) + XLAT(PACKET_MR_PROMISC), +#endif +#if defined(PACKET_MR_ALLMULTI) || (defined(HAVE_DECL_PACKET_MR_ALLMULTI) && HAVE_DECL_PACKET_MR_ALLMULTI) + XLAT(PACKET_MR_ALLMULTI), +#endif +#if defined(PACKET_MR_UNICAST) || (defined(HAVE_DECL_PACKET_MR_UNICAST) && HAVE_DECL_PACKET_MR_UNICAST) + XLAT(PACKET_MR_UNICAST), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/packet_mreq_type.in b/xlat/packet_mreq_type.in new file mode 100644 index 00000000..0d6adfe3 --- /dev/null +++ b/xlat/packet_mreq_type.in @@ -0,0 +1,4 @@ +PACKET_MR_MULTICAST +PACKET_MR_PROMISC +PACKET_MR_ALLMULTI +PACKET_MR_UNICAST diff --git a/xlat/perf_attr_size.h b/xlat/perf_attr_size.h new file mode 100644 index 00000000..ecebb4d7 --- /dev/null +++ b/xlat/perf_attr_size.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_attr_size.in; do not edit. */ +#if !(defined(PERF_ATTR_SIZE_VER0) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER0) && HAVE_DECL_PERF_ATTR_SIZE_VER0)) +# define PERF_ATTR_SIZE_VER0 64 +#endif +#if !(defined(PERF_ATTR_SIZE_VER1) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER1) && HAVE_DECL_PERF_ATTR_SIZE_VER1)) +# define PERF_ATTR_SIZE_VER1 72 +#endif +#if !(defined(PERF_ATTR_SIZE_VER2) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER2) && HAVE_DECL_PERF_ATTR_SIZE_VER2)) +# define PERF_ATTR_SIZE_VER2 80 +#endif +#if !(defined(PERF_ATTR_SIZE_VER3) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER3) && HAVE_DECL_PERF_ATTR_SIZE_VER3)) +# define PERF_ATTR_SIZE_VER3 96 +#endif +#if !(defined(PERF_ATTR_SIZE_VER4) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER4) && HAVE_DECL_PERF_ATTR_SIZE_VER4)) +# define PERF_ATTR_SIZE_VER4 104 +#endif +#if !(defined(PERF_ATTR_SIZE_VER5) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER5) && HAVE_DECL_PERF_ATTR_SIZE_VER5)) +# define PERF_ATTR_SIZE_VER5 112 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_attr_size in mpers mode + +#else + +static +const struct xlat perf_attr_size[] = { + XLAT(PERF_ATTR_SIZE_VER0), + XLAT(PERF_ATTR_SIZE_VER1), + XLAT(PERF_ATTR_SIZE_VER2), + XLAT(PERF_ATTR_SIZE_VER3), + XLAT(PERF_ATTR_SIZE_VER4), + XLAT(PERF_ATTR_SIZE_VER5), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_attr_size.in b/xlat/perf_attr_size.in new file mode 100644 index 00000000..d597cd1d --- /dev/null +++ b/xlat/perf_attr_size.in @@ -0,0 +1,6 @@ +PERF_ATTR_SIZE_VER0 64 +PERF_ATTR_SIZE_VER1 72 +PERF_ATTR_SIZE_VER2 80 +PERF_ATTR_SIZE_VER3 96 +PERF_ATTR_SIZE_VER4 104 +PERF_ATTR_SIZE_VER5 112 diff --git a/xlat/perf_branch_sample_type.h b/xlat/perf_branch_sample_type.h new file mode 100644 index 00000000..6d710939 --- /dev/null +++ b/xlat/perf_branch_sample_type.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_branch_sample_type.in; do not edit. */ +#if !(defined(PERF_SAMPLE_BRANCH_USER) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_USER) && HAVE_DECL_PERF_SAMPLE_BRANCH_USER)) +# define PERF_SAMPLE_BRANCH_USER 1 << 0 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_KERNEL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_KERNEL) && HAVE_DECL_PERF_SAMPLE_BRANCH_KERNEL)) +# define PERF_SAMPLE_BRANCH_KERNEL 1 << 1 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_HV) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_HV) && HAVE_DECL_PERF_SAMPLE_BRANCH_HV)) +# define PERF_SAMPLE_BRANCH_HV 1 << 2 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_ANY) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY)) +# define PERF_SAMPLE_BRANCH_ANY 1 << 3 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_ANY_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_CALL)) +# define PERF_SAMPLE_BRANCH_ANY_CALL 1 << 4 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_ANY_RETURN) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_RETURN) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_RETURN)) +# define PERF_SAMPLE_BRANCH_ANY_RETURN 1 << 5 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_IND_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IND_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_IND_CALL)) +# define PERF_SAMPLE_BRANCH_IND_CALL 1 << 6 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_ABORT_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ABORT_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_ABORT_TX)) +# define PERF_SAMPLE_BRANCH_ABORT_TX 1 << 7 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_IN_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IN_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_IN_TX)) +# define PERF_SAMPLE_BRANCH_IN_TX 1 << 8 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_NO_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_TX)) +# define PERF_SAMPLE_BRANCH_NO_TX 1 << 9 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_COND) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_COND) && HAVE_DECL_PERF_SAMPLE_BRANCH_COND)) +# define PERF_SAMPLE_BRANCH_COND 1 << 10 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_CALL_STACK) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_CALL_STACK) && HAVE_DECL_PERF_SAMPLE_BRANCH_CALL_STACK)) +# define PERF_SAMPLE_BRANCH_CALL_STACK 1 << 11 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_IND_JUMP) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IND_JUMP) && HAVE_DECL_PERF_SAMPLE_BRANCH_IND_JUMP)) +# define PERF_SAMPLE_BRANCH_IND_JUMP 1 << 12 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_CALL)) +# define PERF_SAMPLE_BRANCH_CALL 1 << 13 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_NO_FLAGS) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_FLAGS) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_FLAGS)) +# define PERF_SAMPLE_BRANCH_NO_FLAGS 1 << 14 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_NO_CYCLES) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_CYCLES) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_CYCLES)) +# define PERF_SAMPLE_BRANCH_NO_CYCLES 1 << 15 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_branch_sample_type in mpers mode + +#else + +static +const struct xlat perf_branch_sample_type[] = { + XLAT(PERF_SAMPLE_BRANCH_USER), + XLAT(PERF_SAMPLE_BRANCH_KERNEL), + XLAT(PERF_SAMPLE_BRANCH_HV), + XLAT(PERF_SAMPLE_BRANCH_ANY), + XLAT(PERF_SAMPLE_BRANCH_ANY_CALL), + XLAT(PERF_SAMPLE_BRANCH_ANY_RETURN), + XLAT(PERF_SAMPLE_BRANCH_IND_CALL), + XLAT(PERF_SAMPLE_BRANCH_ABORT_TX), + XLAT(PERF_SAMPLE_BRANCH_IN_TX), + XLAT(PERF_SAMPLE_BRANCH_NO_TX), + XLAT(PERF_SAMPLE_BRANCH_COND), + XLAT(PERF_SAMPLE_BRANCH_CALL_STACK), + XLAT(PERF_SAMPLE_BRANCH_IND_JUMP), + XLAT(PERF_SAMPLE_BRANCH_CALL), + XLAT(PERF_SAMPLE_BRANCH_NO_FLAGS), + XLAT(PERF_SAMPLE_BRANCH_NO_CYCLES), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_branch_sample_type.in b/xlat/perf_branch_sample_type.in new file mode 100644 index 00000000..0e33d980 --- /dev/null +++ b/xlat/perf_branch_sample_type.in @@ -0,0 +1,16 @@ +PERF_SAMPLE_BRANCH_USER 1 << 0 +PERF_SAMPLE_BRANCH_KERNEL 1 << 1 +PERF_SAMPLE_BRANCH_HV 1 << 2 +PERF_SAMPLE_BRANCH_ANY 1 << 3 +PERF_SAMPLE_BRANCH_ANY_CALL 1 << 4 +PERF_SAMPLE_BRANCH_ANY_RETURN 1 << 5 +PERF_SAMPLE_BRANCH_IND_CALL 1 << 6 +PERF_SAMPLE_BRANCH_ABORT_TX 1 << 7 +PERF_SAMPLE_BRANCH_IN_TX 1 << 8 +PERF_SAMPLE_BRANCH_NO_TX 1 << 9 +PERF_SAMPLE_BRANCH_COND 1 << 10 +PERF_SAMPLE_BRANCH_CALL_STACK 1 << 11 +PERF_SAMPLE_BRANCH_IND_JUMP 1 << 12 +PERF_SAMPLE_BRANCH_CALL 1 << 13 +PERF_SAMPLE_BRANCH_NO_FLAGS 1 << 14 +PERF_SAMPLE_BRANCH_NO_CYCLES 1 << 15 diff --git a/xlat/perf_event_open_flags.h b/xlat/perf_event_open_flags.h index ee4114cd..922f9c45 100644 --- a/xlat/perf_event_open_flags.h +++ b/xlat/perf_event_open_flags.h @@ -1,14 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_event_open_flags.in; do not edit. */ - -static const struct xlat perf_event_open_flags[] = { -#if defined(PERF_FLAG_FD_NO_GROUP) || (defined(HAVE_DECL_PERF_FLAG_FD_NO_GROUP) && HAVE_DECL_PERF_FLAG_FD_NO_GROUP) - XLAT(PERF_FLAG_FD_NO_GROUP), +#if !(defined(PERF_FLAG_FD_NO_GROUP) || (defined(HAVE_DECL_PERF_FLAG_FD_NO_GROUP) && HAVE_DECL_PERF_FLAG_FD_NO_GROUP)) +# define PERF_FLAG_FD_NO_GROUP 1 +#endif +#if !(defined(PERF_FLAG_FD_OUTPUT) || (defined(HAVE_DECL_PERF_FLAG_FD_OUTPUT) && HAVE_DECL_PERF_FLAG_FD_OUTPUT)) +# define PERF_FLAG_FD_OUTPUT 2 #endif -#if defined(PERF_FLAG_FD_OUTPUT) || (defined(HAVE_DECL_PERF_FLAG_FD_OUTPUT) && HAVE_DECL_PERF_FLAG_FD_OUTPUT) - XLAT(PERF_FLAG_FD_OUTPUT), +#if !(defined(PERF_FLAG_PID_CGROUP) || (defined(HAVE_DECL_PERF_FLAG_PID_CGROUP) && HAVE_DECL_PERF_FLAG_PID_CGROUP)) +# define PERF_FLAG_PID_CGROUP 4 #endif -#if defined(PERF_FLAG_PID_CGROUP) || (defined(HAVE_DECL_PERF_FLAG_PID_CGROUP) && HAVE_DECL_PERF_FLAG_PID_CGROUP) - XLAT(PERF_FLAG_PID_CGROUP), +#if !(defined(PERF_FLAG_FD_CLOEXEC) || (defined(HAVE_DECL_PERF_FLAG_FD_CLOEXEC) && HAVE_DECL_PERF_FLAG_FD_CLOEXEC)) +# define PERF_FLAG_FD_CLOEXEC 8 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat perf_event_open_flags in mpers mode + +#else + +static +const struct xlat perf_event_open_flags[] = { + XLAT(PERF_FLAG_FD_NO_GROUP), + XLAT(PERF_FLAG_FD_OUTPUT), + XLAT(PERF_FLAG_PID_CGROUP), + XLAT(PERF_FLAG_FD_CLOEXEC), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_event_open_flags.in b/xlat/perf_event_open_flags.in index 66aefba1..b2a3450e 100644 --- a/xlat/perf_event_open_flags.in +++ b/xlat/perf_event_open_flags.in @@ -1,3 +1,4 @@ -PERF_FLAG_FD_NO_GROUP -PERF_FLAG_FD_OUTPUT -PERF_FLAG_PID_CGROUP +PERF_FLAG_FD_NO_GROUP 1 +PERF_FLAG_FD_OUTPUT 2 +PERF_FLAG_PID_CGROUP 4 +PERF_FLAG_FD_CLOEXEC 8 diff --git a/xlat/perf_event_read_format.h b/xlat/perf_event_read_format.h new file mode 100644 index 00000000..7b4c71d7 --- /dev/null +++ b/xlat/perf_event_read_format.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_event_read_format.in; do not edit. */ +#if !(defined(PERF_FORMAT_TOTAL_TIME_ENABLED) || (defined(HAVE_DECL_PERF_FORMAT_TOTAL_TIME_ENABLED) && HAVE_DECL_PERF_FORMAT_TOTAL_TIME_ENABLED)) +# define PERF_FORMAT_TOTAL_TIME_ENABLED 1 << 0 +#endif +#if !(defined(PERF_FORMAT_TOTAL_TIME_RUNNING) || (defined(HAVE_DECL_PERF_FORMAT_TOTAL_TIME_RUNNING) && HAVE_DECL_PERF_FORMAT_TOTAL_TIME_RUNNING)) +# define PERF_FORMAT_TOTAL_TIME_RUNNING 1 << 1 +#endif +#if !(defined(PERF_FORMAT_ID) || (defined(HAVE_DECL_PERF_FORMAT_ID) && HAVE_DECL_PERF_FORMAT_ID)) +# define PERF_FORMAT_ID 1 << 2 +#endif +#if !(defined(PERF_FORMAT_GROUP) || (defined(HAVE_DECL_PERF_FORMAT_GROUP) && HAVE_DECL_PERF_FORMAT_GROUP)) +# define PERF_FORMAT_GROUP 1 << 3 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_event_read_format in mpers mode + +#else + +static +const struct xlat perf_event_read_format[] = { + XLAT(PERF_FORMAT_TOTAL_TIME_ENABLED), + XLAT(PERF_FORMAT_TOTAL_TIME_RUNNING), + XLAT(PERF_FORMAT_ID), + XLAT(PERF_FORMAT_GROUP), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_event_read_format.in b/xlat/perf_event_read_format.in new file mode 100644 index 00000000..a270700f --- /dev/null +++ b/xlat/perf_event_read_format.in @@ -0,0 +1,4 @@ +PERF_FORMAT_TOTAL_TIME_ENABLED 1 << 0 +PERF_FORMAT_TOTAL_TIME_RUNNING 1 << 1 +PERF_FORMAT_ID 1 << 2 +PERF_FORMAT_GROUP 1 << 3 diff --git a/xlat/perf_event_sample_format.h b/xlat/perf_event_sample_format.h new file mode 100644 index 00000000..c4b04229 --- /dev/null +++ b/xlat/perf_event_sample_format.h @@ -0,0 +1,90 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_event_sample_format.in; do not edit. */ +#if !(defined(PERF_SAMPLE_IP) || (defined(HAVE_DECL_PERF_SAMPLE_IP) && HAVE_DECL_PERF_SAMPLE_IP)) +# define PERF_SAMPLE_IP 1 << 0 +#endif +#if !(defined(PERF_SAMPLE_TID) || (defined(HAVE_DECL_PERF_SAMPLE_TID) && HAVE_DECL_PERF_SAMPLE_TID)) +# define PERF_SAMPLE_TID 1 << 1 +#endif +#if !(defined(PERF_SAMPLE_TIME) || (defined(HAVE_DECL_PERF_SAMPLE_TIME) && HAVE_DECL_PERF_SAMPLE_TIME)) +# define PERF_SAMPLE_TIME 1 << 2 +#endif +#if !(defined(PERF_SAMPLE_ADDR) || (defined(HAVE_DECL_PERF_SAMPLE_ADDR) && HAVE_DECL_PERF_SAMPLE_ADDR)) +# define PERF_SAMPLE_ADDR 1 << 3 +#endif +#if !(defined(PERF_SAMPLE_READ) || (defined(HAVE_DECL_PERF_SAMPLE_READ) && HAVE_DECL_PERF_SAMPLE_READ)) +# define PERF_SAMPLE_READ 1 << 4 +#endif +#if !(defined(PERF_SAMPLE_CALLCHAIN) || (defined(HAVE_DECL_PERF_SAMPLE_CALLCHAIN) && HAVE_DECL_PERF_SAMPLE_CALLCHAIN)) +# define PERF_SAMPLE_CALLCHAIN 1 << 5 +#endif +#if !(defined(PERF_SAMPLE_ID) || (defined(HAVE_DECL_PERF_SAMPLE_ID) && HAVE_DECL_PERF_SAMPLE_ID)) +# define PERF_SAMPLE_ID 1 << 6 +#endif +#if !(defined(PERF_SAMPLE_CPU) || (defined(HAVE_DECL_PERF_SAMPLE_CPU) && HAVE_DECL_PERF_SAMPLE_CPU)) +# define PERF_SAMPLE_CPU 1 << 7 +#endif +#if !(defined(PERF_SAMPLE_PERIOD) || (defined(HAVE_DECL_PERF_SAMPLE_PERIOD) && HAVE_DECL_PERF_SAMPLE_PERIOD)) +# define PERF_SAMPLE_PERIOD 1 << 8 +#endif +#if !(defined(PERF_SAMPLE_STREAM_ID) || (defined(HAVE_DECL_PERF_SAMPLE_STREAM_ID) && HAVE_DECL_PERF_SAMPLE_STREAM_ID)) +# define PERF_SAMPLE_STREAM_ID 1 << 9 +#endif +#if !(defined(PERF_SAMPLE_RAW) || (defined(HAVE_DECL_PERF_SAMPLE_RAW) && HAVE_DECL_PERF_SAMPLE_RAW)) +# define PERF_SAMPLE_RAW 1 << 10 +#endif +#if !(defined(PERF_SAMPLE_BRANCH_STACK) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_STACK) && HAVE_DECL_PERF_SAMPLE_BRANCH_STACK)) +# define PERF_SAMPLE_BRANCH_STACK 1 << 11 +#endif +#if !(defined(PERF_SAMPLE_REGS_USER) || (defined(HAVE_DECL_PERF_SAMPLE_REGS_USER) && HAVE_DECL_PERF_SAMPLE_REGS_USER)) +# define PERF_SAMPLE_REGS_USER 1 << 12 +#endif +#if !(defined(PERF_SAMPLE_STACK_USER) || (defined(HAVE_DECL_PERF_SAMPLE_STACK_USER) && HAVE_DECL_PERF_SAMPLE_STACK_USER)) +# define PERF_SAMPLE_STACK_USER 1 << 13 +#endif +#if !(defined(PERF_SAMPLE_WEIGHT) || (defined(HAVE_DECL_PERF_SAMPLE_WEIGHT) && HAVE_DECL_PERF_SAMPLE_WEIGHT)) +# define PERF_SAMPLE_WEIGHT 1 << 14 +#endif +#if !(defined(PERF_SAMPLE_DATA_SRC) || (defined(HAVE_DECL_PERF_SAMPLE_DATA_SRC) && HAVE_DECL_PERF_SAMPLE_DATA_SRC)) +# define PERF_SAMPLE_DATA_SRC 1 << 15 +#endif +#if !(defined(PERF_SAMPLE_IDENTIFIER) || (defined(HAVE_DECL_PERF_SAMPLE_IDENTIFIER) && HAVE_DECL_PERF_SAMPLE_IDENTIFIER)) +# define PERF_SAMPLE_IDENTIFIER 1 << 16 +#endif +#if !(defined(PERF_SAMPLE_TRANSACTION) || (defined(HAVE_DECL_PERF_SAMPLE_TRANSACTION) && HAVE_DECL_PERF_SAMPLE_TRANSACTION)) +# define PERF_SAMPLE_TRANSACTION 1 << 17 +#endif +#if !(defined(PERF_SAMPLE_REGS_INTR) || (defined(HAVE_DECL_PERF_SAMPLE_REGS_INTR) && HAVE_DECL_PERF_SAMPLE_REGS_INTR)) +# define PERF_SAMPLE_REGS_INTR 1 << 18 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_event_sample_format in mpers mode + +#else + +static +const struct xlat perf_event_sample_format[] = { + XLAT(PERF_SAMPLE_IP), + XLAT(PERF_SAMPLE_TID), + XLAT(PERF_SAMPLE_TIME), + XLAT(PERF_SAMPLE_ADDR), + XLAT(PERF_SAMPLE_READ), + XLAT(PERF_SAMPLE_CALLCHAIN), + XLAT(PERF_SAMPLE_ID), + XLAT(PERF_SAMPLE_CPU), + XLAT(PERF_SAMPLE_PERIOD), + XLAT(PERF_SAMPLE_STREAM_ID), + XLAT(PERF_SAMPLE_RAW), + XLAT(PERF_SAMPLE_BRANCH_STACK), + XLAT(PERF_SAMPLE_REGS_USER), + XLAT(PERF_SAMPLE_STACK_USER), + XLAT(PERF_SAMPLE_WEIGHT), + XLAT(PERF_SAMPLE_DATA_SRC), + XLAT(PERF_SAMPLE_IDENTIFIER), + XLAT(PERF_SAMPLE_TRANSACTION), + XLAT(PERF_SAMPLE_REGS_INTR), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_event_sample_format.in b/xlat/perf_event_sample_format.in new file mode 100644 index 00000000..6203e174 --- /dev/null +++ b/xlat/perf_event_sample_format.in @@ -0,0 +1,19 @@ +PERF_SAMPLE_IP 1 << 0 +PERF_SAMPLE_TID 1 << 1 +PERF_SAMPLE_TIME 1 << 2 +PERF_SAMPLE_ADDR 1 << 3 +PERF_SAMPLE_READ 1 << 4 +PERF_SAMPLE_CALLCHAIN 1 << 5 +PERF_SAMPLE_ID 1 << 6 +PERF_SAMPLE_CPU 1 << 7 +PERF_SAMPLE_PERIOD 1 << 8 +PERF_SAMPLE_STREAM_ID 1 << 9 +PERF_SAMPLE_RAW 1 << 10 +PERF_SAMPLE_BRANCH_STACK 1 << 11 +PERF_SAMPLE_REGS_USER 1 << 12 +PERF_SAMPLE_STACK_USER 1 << 13 +PERF_SAMPLE_WEIGHT 1 << 14 +PERF_SAMPLE_DATA_SRC 1 << 15 +PERF_SAMPLE_IDENTIFIER 1 << 16 +PERF_SAMPLE_TRANSACTION 1 << 17 +PERF_SAMPLE_REGS_INTR 1 << 18 diff --git a/xlat/perf_hw_cache_id.h b/xlat/perf_hw_cache_id.h new file mode 100644 index 00000000..bfcae9fa --- /dev/null +++ b/xlat/perf_hw_cache_id.h @@ -0,0 +1,42 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_hw_cache_id.in; do not edit. */ +#if !(defined(PERF_COUNT_HW_CACHE_L1D) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_L1D) && HAVE_DECL_PERF_COUNT_HW_CACHE_L1D)) +# define PERF_COUNT_HW_CACHE_L1D 0 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_L1I) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_L1I) && HAVE_DECL_PERF_COUNT_HW_CACHE_L1I)) +# define PERF_COUNT_HW_CACHE_L1I 1 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_LL) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_LL) && HAVE_DECL_PERF_COUNT_HW_CACHE_LL)) +# define PERF_COUNT_HW_CACHE_LL 2 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_DTLB) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_DTLB) && HAVE_DECL_PERF_COUNT_HW_CACHE_DTLB)) +# define PERF_COUNT_HW_CACHE_DTLB 3 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_ITLB) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_ITLB) && HAVE_DECL_PERF_COUNT_HW_CACHE_ITLB)) +# define PERF_COUNT_HW_CACHE_ITLB 4 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_BPU) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_BPU) && HAVE_DECL_PERF_COUNT_HW_CACHE_BPU)) +# define PERF_COUNT_HW_CACHE_BPU 5 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_NODE) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_NODE) && HAVE_DECL_PERF_COUNT_HW_CACHE_NODE)) +# define PERF_COUNT_HW_CACHE_NODE 6 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_hw_cache_id in mpers mode + +#else + +static +const struct xlat perf_hw_cache_id[] = { + XLAT(PERF_COUNT_HW_CACHE_L1D), + XLAT(PERF_COUNT_HW_CACHE_L1I), + XLAT(PERF_COUNT_HW_CACHE_LL), + XLAT(PERF_COUNT_HW_CACHE_DTLB), + XLAT(PERF_COUNT_HW_CACHE_ITLB), + XLAT(PERF_COUNT_HW_CACHE_BPU), + XLAT(PERF_COUNT_HW_CACHE_NODE), + /* this array should remain not NULL-terminated */ +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_hw_cache_id.in b/xlat/perf_hw_cache_id.in new file mode 100644 index 00000000..ecddcb0c --- /dev/null +++ b/xlat/perf_hw_cache_id.in @@ -0,0 +1,8 @@ +PERF_COUNT_HW_CACHE_L1D 0 +PERF_COUNT_HW_CACHE_L1I 1 +PERF_COUNT_HW_CACHE_LL 2 +PERF_COUNT_HW_CACHE_DTLB 3 +PERF_COUNT_HW_CACHE_ITLB 4 +PERF_COUNT_HW_CACHE_BPU 5 +PERF_COUNT_HW_CACHE_NODE 6 +#unterminated diff --git a/xlat/perf_hw_cache_op_id.h b/xlat/perf_hw_cache_op_id.h new file mode 100644 index 00000000..2274bc58 --- /dev/null +++ b/xlat/perf_hw_cache_op_id.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_hw_cache_op_id.in; do not edit. */ +#if !(defined(PERF_COUNT_HW_CACHE_OP_READ) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_READ) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_READ)) +# define PERF_COUNT_HW_CACHE_OP_READ 0 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_OP_WRITE) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_WRITE) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_WRITE)) +# define PERF_COUNT_HW_CACHE_OP_WRITE 1 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_OP_PREFETCH) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_PREFETCH) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_PREFETCH)) +# define PERF_COUNT_HW_CACHE_OP_PREFETCH 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_hw_cache_op_id in mpers mode + +#else + +static +const struct xlat perf_hw_cache_op_id[] = { + XLAT(PERF_COUNT_HW_CACHE_OP_READ), + XLAT(PERF_COUNT_HW_CACHE_OP_WRITE), + XLAT(PERF_COUNT_HW_CACHE_OP_PREFETCH), + /* this array should remain not NULL-terminated */ +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_hw_cache_op_id.in b/xlat/perf_hw_cache_op_id.in new file mode 100644 index 00000000..8a46e0d7 --- /dev/null +++ b/xlat/perf_hw_cache_op_id.in @@ -0,0 +1,4 @@ +PERF_COUNT_HW_CACHE_OP_READ 0 +PERF_COUNT_HW_CACHE_OP_WRITE 1 +PERF_COUNT_HW_CACHE_OP_PREFETCH 2 +#unterminated diff --git a/xlat/perf_hw_cache_op_result_id.h b/xlat/perf_hw_cache_op_result_id.h new file mode 100644 index 00000000..d5457516 --- /dev/null +++ b/xlat/perf_hw_cache_op_result_id.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_hw_cache_op_result_id.in; do not edit. */ +#if !(defined(PERF_COUNT_HW_CACHE_RESULT_ACCESS) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_ACCESS) && HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_ACCESS)) +# define PERF_COUNT_HW_CACHE_RESULT_ACCESS 0 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_RESULT_MISS) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_MISS) && HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_MISS)) +# define PERF_COUNT_HW_CACHE_RESULT_MISS 1 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_hw_cache_op_result_id in mpers mode + +#else + +static +const struct xlat perf_hw_cache_op_result_id[] = { + XLAT(PERF_COUNT_HW_CACHE_RESULT_ACCESS), + XLAT(PERF_COUNT_HW_CACHE_RESULT_MISS), + /* this array should remain not NULL-terminated */ +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_hw_cache_op_result_id.in b/xlat/perf_hw_cache_op_result_id.in new file mode 100644 index 00000000..d2a77f5a --- /dev/null +++ b/xlat/perf_hw_cache_op_result_id.in @@ -0,0 +1,3 @@ +PERF_COUNT_HW_CACHE_RESULT_ACCESS 0 +PERF_COUNT_HW_CACHE_RESULT_MISS 1 +#unterminated diff --git a/xlat/perf_hw_id.h b/xlat/perf_hw_id.h new file mode 100644 index 00000000..52384862 --- /dev/null +++ b/xlat/perf_hw_id.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_hw_id.in; do not edit. */ +#if !(defined(PERF_COUNT_HW_CPU_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_CPU_CYCLES) && HAVE_DECL_PERF_COUNT_HW_CPU_CYCLES)) +# define PERF_COUNT_HW_CPU_CYCLES 0 +#endif +#if !(defined(PERF_COUNT_HW_INSTRUCTIONS) || (defined(HAVE_DECL_PERF_COUNT_HW_INSTRUCTIONS) && HAVE_DECL_PERF_COUNT_HW_INSTRUCTIONS)) +# define PERF_COUNT_HW_INSTRUCTIONS 1 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_REFERENCES) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_REFERENCES) && HAVE_DECL_PERF_COUNT_HW_CACHE_REFERENCES)) +# define PERF_COUNT_HW_CACHE_REFERENCES 2 +#endif +#if !(defined(PERF_COUNT_HW_CACHE_MISSES) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_MISSES) && HAVE_DECL_PERF_COUNT_HW_CACHE_MISSES)) +# define PERF_COUNT_HW_CACHE_MISSES 3 +#endif +#if !(defined(PERF_COUNT_HW_BRANCH_INSTRUCTIONS) || (defined(HAVE_DECL_PERF_COUNT_HW_BRANCH_INSTRUCTIONS) && HAVE_DECL_PERF_COUNT_HW_BRANCH_INSTRUCTIONS)) +# define PERF_COUNT_HW_BRANCH_INSTRUCTIONS 4 +#endif +#if !(defined(PERF_COUNT_HW_BRANCH_MISSES) || (defined(HAVE_DECL_PERF_COUNT_HW_BRANCH_MISSES) && HAVE_DECL_PERF_COUNT_HW_BRANCH_MISSES)) +# define PERF_COUNT_HW_BRANCH_MISSES 5 +#endif +#if !(defined(PERF_COUNT_HW_BUS_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_BUS_CYCLES) && HAVE_DECL_PERF_COUNT_HW_BUS_CYCLES)) +# define PERF_COUNT_HW_BUS_CYCLES 6 +#endif +#if !(defined(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) || (defined(HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) && HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_FRONTEND)) +# define PERF_COUNT_HW_STALLED_CYCLES_FRONTEND 7 +#endif +#if !(defined(PERF_COUNT_HW_STALLED_CYCLES_BACKEND) || (defined(HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_BACKEND) && HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_BACKEND)) +# define PERF_COUNT_HW_STALLED_CYCLES_BACKEND 8 +#endif +#if !(defined(PERF_COUNT_HW_REF_CPU_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_REF_CPU_CYCLES) && HAVE_DECL_PERF_COUNT_HW_REF_CPU_CYCLES)) +# define PERF_COUNT_HW_REF_CPU_CYCLES 9 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_hw_id in mpers mode + +#else + +static +const struct xlat perf_hw_id[] = { + XLAT(PERF_COUNT_HW_CPU_CYCLES), + XLAT(PERF_COUNT_HW_INSTRUCTIONS), + XLAT(PERF_COUNT_HW_CACHE_REFERENCES), + XLAT(PERF_COUNT_HW_CACHE_MISSES), + XLAT(PERF_COUNT_HW_BRANCH_INSTRUCTIONS), + XLAT(PERF_COUNT_HW_BRANCH_MISSES), + XLAT(PERF_COUNT_HW_BUS_CYCLES), + XLAT(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND), + XLAT(PERF_COUNT_HW_STALLED_CYCLES_BACKEND), + XLAT(PERF_COUNT_HW_REF_CPU_CYCLES), + /* this array should remain not NULL-terminated */ +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_hw_id.in b/xlat/perf_hw_id.in new file mode 100644 index 00000000..a642d0b4 --- /dev/null +++ b/xlat/perf_hw_id.in @@ -0,0 +1,11 @@ +PERF_COUNT_HW_CPU_CYCLES 0 +PERF_COUNT_HW_INSTRUCTIONS 1 +PERF_COUNT_HW_CACHE_REFERENCES 2 +PERF_COUNT_HW_CACHE_MISSES 3 +PERF_COUNT_HW_BRANCH_INSTRUCTIONS 4 +PERF_COUNT_HW_BRANCH_MISSES 5 +PERF_COUNT_HW_BUS_CYCLES 6 +PERF_COUNT_HW_STALLED_CYCLES_FRONTEND 7 +PERF_COUNT_HW_STALLED_CYCLES_BACKEND 8 +PERF_COUNT_HW_REF_CPU_CYCLES 9 +#unterminated diff --git a/xlat/perf_sw_ids.h b/xlat/perf_sw_ids.h new file mode 100644 index 00000000..b29b547b --- /dev/null +++ b/xlat/perf_sw_ids.h @@ -0,0 +1,58 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_sw_ids.in; do not edit. */ +#if !(defined(PERF_COUNT_SW_CPU_CLOCK) || (defined(HAVE_DECL_PERF_COUNT_SW_CPU_CLOCK) && HAVE_DECL_PERF_COUNT_SW_CPU_CLOCK)) +# define PERF_COUNT_SW_CPU_CLOCK 0 +#endif +#if !(defined(PERF_COUNT_SW_TASK_CLOCK) || (defined(HAVE_DECL_PERF_COUNT_SW_TASK_CLOCK) && HAVE_DECL_PERF_COUNT_SW_TASK_CLOCK)) +# define PERF_COUNT_SW_TASK_CLOCK 1 +#endif +#if !(defined(PERF_COUNT_SW_PAGE_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS)) +# define PERF_COUNT_SW_PAGE_FAULTS 2 +#endif +#if !(defined(PERF_COUNT_SW_CONTEXT_SWITCHES) || (defined(HAVE_DECL_PERF_COUNT_SW_CONTEXT_SWITCHES) && HAVE_DECL_PERF_COUNT_SW_CONTEXT_SWITCHES)) +# define PERF_COUNT_SW_CONTEXT_SWITCHES 3 +#endif +#if !(defined(PERF_COUNT_SW_CPU_MIGRATIONS) || (defined(HAVE_DECL_PERF_COUNT_SW_CPU_MIGRATIONS) && HAVE_DECL_PERF_COUNT_SW_CPU_MIGRATIONS)) +# define PERF_COUNT_SW_CPU_MIGRATIONS 4 +#endif +#if !(defined(PERF_COUNT_SW_PAGE_FAULTS_MIN) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MIN) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MIN)) +# define PERF_COUNT_SW_PAGE_FAULTS_MIN 5 +#endif +#if !(defined(PERF_COUNT_SW_PAGE_FAULTS_MAJ) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MAJ) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MAJ)) +# define PERF_COUNT_SW_PAGE_FAULTS_MAJ 6 +#endif +#if !(defined(PERF_COUNT_SW_ALIGNMENT_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_ALIGNMENT_FAULTS) && HAVE_DECL_PERF_COUNT_SW_ALIGNMENT_FAULTS)) +# define PERF_COUNT_SW_ALIGNMENT_FAULTS 7 +#endif +#if !(defined(PERF_COUNT_SW_EMULATION_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_EMULATION_FAULTS) && HAVE_DECL_PERF_COUNT_SW_EMULATION_FAULTS)) +# define PERF_COUNT_SW_EMULATION_FAULTS 8 +#endif +#if !(defined(PERF_COUNT_SW_DUMMY) || (defined(HAVE_DECL_PERF_COUNT_SW_DUMMY) && HAVE_DECL_PERF_COUNT_SW_DUMMY)) +# define PERF_COUNT_SW_DUMMY 9 +#endif +#if !(defined(PERF_COUNT_SW_BPF_OUTPUT) || (defined(HAVE_DECL_PERF_COUNT_SW_BPF_OUTPUT) && HAVE_DECL_PERF_COUNT_SW_BPF_OUTPUT)) +# define PERF_COUNT_SW_BPF_OUTPUT 10 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_sw_ids in mpers mode + +#else + +static +const struct xlat perf_sw_ids[] = { + XLAT(PERF_COUNT_SW_CPU_CLOCK), + XLAT(PERF_COUNT_SW_TASK_CLOCK), + XLAT(PERF_COUNT_SW_PAGE_FAULTS), + XLAT(PERF_COUNT_SW_CONTEXT_SWITCHES), + XLAT(PERF_COUNT_SW_CPU_MIGRATIONS), + XLAT(PERF_COUNT_SW_PAGE_FAULTS_MIN), + XLAT(PERF_COUNT_SW_PAGE_FAULTS_MAJ), + XLAT(PERF_COUNT_SW_ALIGNMENT_FAULTS), + XLAT(PERF_COUNT_SW_EMULATION_FAULTS), + XLAT(PERF_COUNT_SW_DUMMY), + XLAT(PERF_COUNT_SW_BPF_OUTPUT), + /* this array should remain not NULL-terminated */ +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_sw_ids.in b/xlat/perf_sw_ids.in new file mode 100644 index 00000000..95ca15c4 --- /dev/null +++ b/xlat/perf_sw_ids.in @@ -0,0 +1,12 @@ +PERF_COUNT_SW_CPU_CLOCK 0 +PERF_COUNT_SW_TASK_CLOCK 1 +PERF_COUNT_SW_PAGE_FAULTS 2 +PERF_COUNT_SW_CONTEXT_SWITCHES 3 +PERF_COUNT_SW_CPU_MIGRATIONS 4 +PERF_COUNT_SW_PAGE_FAULTS_MIN 5 +PERF_COUNT_SW_PAGE_FAULTS_MAJ 6 +PERF_COUNT_SW_ALIGNMENT_FAULTS 7 +PERF_COUNT_SW_EMULATION_FAULTS 8 +PERF_COUNT_SW_DUMMY 9 +PERF_COUNT_SW_BPF_OUTPUT 10 +#unterminated diff --git a/xlat/perf_type_id.h b/xlat/perf_type_id.h new file mode 100644 index 00000000..edf62168 --- /dev/null +++ b/xlat/perf_type_id.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_type_id.in; do not edit. */ +#if !(defined(PERF_TYPE_HARDWARE) || (defined(HAVE_DECL_PERF_TYPE_HARDWARE) && HAVE_DECL_PERF_TYPE_HARDWARE)) +# define PERF_TYPE_HARDWARE 0 +#endif +#if !(defined(PERF_TYPE_SOFTWARE) || (defined(HAVE_DECL_PERF_TYPE_SOFTWARE) && HAVE_DECL_PERF_TYPE_SOFTWARE)) +# define PERF_TYPE_SOFTWARE 1 +#endif +#if !(defined(PERF_TYPE_TRACEPOINT) || (defined(HAVE_DECL_PERF_TYPE_TRACEPOINT) && HAVE_DECL_PERF_TYPE_TRACEPOINT)) +# define PERF_TYPE_TRACEPOINT 2 +#endif +#if !(defined(PERF_TYPE_HW_CACHE) || (defined(HAVE_DECL_PERF_TYPE_HW_CACHE) && HAVE_DECL_PERF_TYPE_HW_CACHE)) +# define PERF_TYPE_HW_CACHE 3 +#endif +#if !(defined(PERF_TYPE_RAW) || (defined(HAVE_DECL_PERF_TYPE_RAW) && HAVE_DECL_PERF_TYPE_RAW)) +# define PERF_TYPE_RAW 4 +#endif +#if !(defined(PERF_TYPE_BREAKPOINT) || (defined(HAVE_DECL_PERF_TYPE_BREAKPOINT) && HAVE_DECL_PERF_TYPE_BREAKPOINT)) +# define PERF_TYPE_BREAKPOINT 5 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat perf_type_id in mpers mode + +#else + +static +const struct xlat perf_type_id[] = { + XLAT(PERF_TYPE_HARDWARE), + XLAT(PERF_TYPE_SOFTWARE), + XLAT(PERF_TYPE_TRACEPOINT), + XLAT(PERF_TYPE_HW_CACHE), + XLAT(PERF_TYPE_RAW), + XLAT(PERF_TYPE_BREAKPOINT), + /* this array should remain not NULL-terminated */ +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/perf_type_id.in b/xlat/perf_type_id.in new file mode 100644 index 00000000..9133e74d --- /dev/null +++ b/xlat/perf_type_id.in @@ -0,0 +1,7 @@ +PERF_TYPE_HARDWARE 0 +PERF_TYPE_SOFTWARE 1 +PERF_TYPE_TRACEPOINT 2 +PERF_TYPE_HW_CACHE 3 +PERF_TYPE_RAW 4 +PERF_TYPE_BREAKPOINT 5 +#unterminated diff --git a/xlat/personality_flags.h b/xlat/personality_flags.h new file mode 100644 index 00000000..1941e146 --- /dev/null +++ b/xlat/personality_flags.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/personality_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat personality_flags in mpers mode + +#else + +static +const struct xlat personality_flags[] = { + XLAT(UNAME26), + XLAT(ADDR_NO_RANDOMIZE), + XLAT(FDPIC_FUNCPTRS), + XLAT(MMAP_PAGE_ZERO), + XLAT(ADDR_COMPAT_LAYOUT), + XLAT(READ_IMPLIES_EXEC), + XLAT(ADDR_LIMIT_32BIT), + XLAT(SHORT_INODE), + XLAT(WHOLE_SECONDS), + XLAT(STICKY_TIMEOUTS), + XLAT(ADDR_LIMIT_3GB), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/personality_flags.in b/xlat/personality_flags.in new file mode 100644 index 00000000..a8715e2f --- /dev/null +++ b/xlat/personality_flags.in @@ -0,0 +1,12 @@ +#unconditional +UNAME26 +ADDR_NO_RANDOMIZE +FDPIC_FUNCPTRS +MMAP_PAGE_ZERO +ADDR_COMPAT_LAYOUT +READ_IMPLIES_EXEC +ADDR_LIMIT_32BIT +SHORT_INODE +WHOLE_SECONDS +STICKY_TIMEOUTS +ADDR_LIMIT_3GB diff --git a/xlat/personality_options.h b/xlat/personality_options.h deleted file mode 100644 index cd5379b9..00000000 --- a/xlat/personality_options.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/personality_options.in; do not edit. */ - -static const struct xlat personality_options[] = { - XLAT(PER_LINUX), - XLAT(PER_LINUX_32BIT), - XLAT(PER_LINUX_FDPIC), - XLAT(PER_SVR4), - XLAT(PER_SVR3), - XLAT(PER_SCOSVR3), - XLAT(PER_OSR5), - XLAT(PER_WYSEV386), - XLAT(PER_ISCR4), - XLAT(PER_BSD), - XLAT(PER_SUNOS), - XLAT(PER_XENIX), - XLAT(PER_LINUX32), - XLAT(PER_LINUX32_3GB), - XLAT(PER_IRIX32), - XLAT(PER_IRIXN32), - XLAT(PER_IRIX64), - XLAT(PER_RISCOS), - XLAT(PER_SOLARIS), - XLAT(PER_UW7), - XLAT(PER_OSF4), - XLAT(PER_HPUX), - XLAT_END -}; diff --git a/xlat/personality_options.in b/xlat/personality_options.in deleted file mode 100644 index 6832c65d..00000000 --- a/xlat/personality_options.in +++ /dev/null @@ -1,23 +0,0 @@ -#unconditional -PER_LINUX -PER_LINUX_32BIT -PER_LINUX_FDPIC -PER_SVR4 -PER_SVR3 -PER_SCOSVR3 -PER_OSR5 -PER_WYSEV386 -PER_ISCR4 -PER_BSD -PER_SUNOS -PER_XENIX -PER_LINUX32 -PER_LINUX32_3GB -PER_IRIX32 -PER_IRIXN32 -PER_IRIX64 -PER_RISCOS -PER_SOLARIS -PER_UW7 -PER_OSF4 -PER_HPUX diff --git a/xlat/personality_types.h b/xlat/personality_types.h new file mode 100644 index 00000000..859ded3d --- /dev/null +++ b/xlat/personality_types.h @@ -0,0 +1,36 @@ +/* Generated by ./xlat/gen.sh from ./xlat/personality_types.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat personality_types in mpers mode + +#else + +static +const struct xlat personality_types[] = { + XLAT(PER_LINUX), + XLAT(PER_LINUX_32BIT), + XLAT(PER_LINUX_FDPIC), + XLAT(PER_SVR4), + XLAT(PER_SVR3), + XLAT(PER_SCOSVR3), + XLAT(PER_OSR5), + XLAT(PER_WYSEV386), + XLAT(PER_ISCR4), + XLAT(PER_BSD), + XLAT(PER_SUNOS), + XLAT(PER_XENIX), + XLAT(PER_LINUX32), + XLAT(PER_LINUX32_3GB), + XLAT(PER_IRIX32), + XLAT(PER_IRIXN32), + XLAT(PER_IRIX64), + XLAT(PER_RISCOS), + XLAT(PER_SOLARIS), + XLAT(PER_UW7), + XLAT(PER_OSF4), + XLAT(PER_HPUX), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/personality_types.in b/xlat/personality_types.in new file mode 100644 index 00000000..6832c65d --- /dev/null +++ b/xlat/personality_types.in @@ -0,0 +1,23 @@ +#unconditional +PER_LINUX +PER_LINUX_32BIT +PER_LINUX_FDPIC +PER_SVR4 +PER_SVR3 +PER_SCOSVR3 +PER_OSR5 +PER_WYSEV386 +PER_ISCR4 +PER_BSD +PER_SUNOS +PER_XENIX +PER_LINUX32 +PER_LINUX32_3GB +PER_IRIX32 +PER_IRIXN32 +PER_IRIX64 +PER_RISCOS +PER_SOLARIS +PER_UW7 +PER_OSF4 +PER_HPUX diff --git a/xlat/pkey_access.h b/xlat/pkey_access.h new file mode 100644 index 00000000..161c9e5d --- /dev/null +++ b/xlat/pkey_access.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pkey_access.in; do not edit. */ +#if !(defined(PKEY_DISABLE_ACCESS) || (defined(HAVE_DECL_PKEY_DISABLE_ACCESS) && HAVE_DECL_PKEY_DISABLE_ACCESS)) +# define PKEY_DISABLE_ACCESS 0x1 +#endif +#if !(defined(PKEY_DISABLE_WRITE) || (defined(HAVE_DECL_PKEY_DISABLE_WRITE) && HAVE_DECL_PKEY_DISABLE_WRITE)) +# define PKEY_DISABLE_WRITE 0x2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pkey_access in mpers mode + +#else + +static +const struct xlat pkey_access[] = { + XLAT(PKEY_DISABLE_ACCESS), + XLAT(PKEY_DISABLE_WRITE), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pkey_access.in b/xlat/pkey_access.in new file mode 100644 index 00000000..37372a88 --- /dev/null +++ b/xlat/pkey_access.in @@ -0,0 +1,2 @@ +PKEY_DISABLE_ACCESS 0x1 +PKEY_DISABLE_WRITE 0x2 diff --git a/xlat/pmsgflags.h b/xlat/pmsgflags.h deleted file mode 100644 index a10254e8..00000000 --- a/xlat/pmsgflags.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/pmsgflags.in; do not edit. */ - -static const struct xlat pmsgflags[] = { -#if defined(MSG_HIPRI) || (defined(HAVE_DECL_MSG_HIPRI) && HAVE_DECL_MSG_HIPRI) - XLAT(MSG_HIPRI), -#endif -#if defined(MSG_ANY) || (defined(HAVE_DECL_MSG_ANY) && HAVE_DECL_MSG_ANY) - XLAT(MSG_ANY), -#endif -#if defined(MSG_BAND) || (defined(HAVE_DECL_MSG_BAND) && HAVE_DECL_MSG_BAND) - XLAT(MSG_BAND), -#endif - XLAT_END -}; diff --git a/xlat/pmsgflags.in b/xlat/pmsgflags.in deleted file mode 100644 index cae7c52d..00000000 --- a/xlat/pmsgflags.in +++ /dev/null @@ -1,3 +0,0 @@ -MSG_HIPRI -MSG_ANY -MSG_BAND diff --git a/xlat/policies.h b/xlat/policies.h index d46eafda..8b44db6d 100644 --- a/xlat/policies.h +++ b/xlat/policies.h @@ -1,17 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/policies.in; do not edit. */ - -static const struct xlat policies[] = { -#if defined(MPOL_DEFAULT) || (defined(HAVE_DECL_MPOL_DEFAULT) && HAVE_DECL_MPOL_DEFAULT) - XLAT(MPOL_DEFAULT), +#if !(defined(MPOL_DEFAULT) || (defined(HAVE_DECL_MPOL_DEFAULT) && HAVE_DECL_MPOL_DEFAULT)) +# define MPOL_DEFAULT 0 #endif -#if defined(MPOL_PREFERRED) || (defined(HAVE_DECL_MPOL_PREFERRED) && HAVE_DECL_MPOL_PREFERRED) - XLAT(MPOL_PREFERRED), +#if !(defined(MPOL_PREFERRED) || (defined(HAVE_DECL_MPOL_PREFERRED) && HAVE_DECL_MPOL_PREFERRED)) +# define MPOL_PREFERRED 1 #endif -#if defined(MPOL_BIND) || (defined(HAVE_DECL_MPOL_BIND) && HAVE_DECL_MPOL_BIND) - XLAT(MPOL_BIND), +#if !(defined(MPOL_BIND) || (defined(HAVE_DECL_MPOL_BIND) && HAVE_DECL_MPOL_BIND)) +# define MPOL_BIND 2 #endif -#if defined(MPOL_INTERLEAVE) || (defined(HAVE_DECL_MPOL_INTERLEAVE) && HAVE_DECL_MPOL_INTERLEAVE) - XLAT(MPOL_INTERLEAVE), +#if !(defined(MPOL_INTERLEAVE) || (defined(HAVE_DECL_MPOL_INTERLEAVE) && HAVE_DECL_MPOL_INTERLEAVE)) +# define MPOL_INTERLEAVE 3 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat policies in mpers mode + +#else + +static +const struct xlat policies[] = { + XLAT(MPOL_DEFAULT), + XLAT(MPOL_PREFERRED), + XLAT(MPOL_BIND), + XLAT(MPOL_INTERLEAVE), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/policies.in b/xlat/policies.in index 22599fd8..fab53962 100644 --- a/xlat/policies.in +++ b/xlat/policies.in @@ -1,4 +1,4 @@ -MPOL_DEFAULT -MPOL_PREFERRED -MPOL_BIND -MPOL_INTERLEAVE +MPOL_DEFAULT 0 +MPOL_PREFERRED 1 +MPOL_BIND 2 +MPOL_INTERLEAVE 3 diff --git a/xlat/pollflags.h b/xlat/pollflags.h index cd1c128c..3c9f24ab 100644 --- a/xlat/pollflags.h +++ b/xlat/pollflags.h @@ -1,35 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/pollflags.in; do not edit. */ -static const struct xlat pollflags[] = { +#ifdef IN_MPERS + +# error static const struct xlat pollflags in mpers mode + +#else + +static +const struct xlat pollflags[] = { #if defined(POLLIN) || (defined(HAVE_DECL_POLLIN) && HAVE_DECL_POLLIN) - XLAT(POLLIN), + XLAT(POLLIN), #endif #if defined(POLLPRI) || (defined(HAVE_DECL_POLLPRI) && HAVE_DECL_POLLPRI) - XLAT(POLLPRI), + XLAT(POLLPRI), #endif #if defined(POLLOUT) || (defined(HAVE_DECL_POLLOUT) && HAVE_DECL_POLLOUT) - XLAT(POLLOUT), + XLAT(POLLOUT), #endif #if defined(POLLRDNORM) || (defined(HAVE_DECL_POLLRDNORM) && HAVE_DECL_POLLRDNORM) - XLAT(POLLRDNORM), + XLAT(POLLRDNORM), #endif #if defined(POLLWRNORM) || (defined(HAVE_DECL_POLLWRNORM) && HAVE_DECL_POLLWRNORM) - XLAT(POLLWRNORM), + XLAT(POLLWRNORM), #endif #if defined(POLLRDBAND) || (defined(HAVE_DECL_POLLRDBAND) && HAVE_DECL_POLLRDBAND) - XLAT(POLLRDBAND), + XLAT(POLLRDBAND), #endif #if defined(POLLWRBAND) || (defined(HAVE_DECL_POLLWRBAND) && HAVE_DECL_POLLWRBAND) - XLAT(POLLWRBAND), + XLAT(POLLWRBAND), #endif #if defined(POLLERR) || (defined(HAVE_DECL_POLLERR) && HAVE_DECL_POLLERR) - XLAT(POLLERR), + XLAT(POLLERR), #endif #if defined(POLLHUP) || (defined(HAVE_DECL_POLLHUP) && HAVE_DECL_POLLHUP) - XLAT(POLLHUP), + XLAT(POLLHUP), #endif #if defined(POLLNVAL) || (defined(HAVE_DECL_POLLNVAL) && HAVE_DECL_POLLNVAL) - XLAT(POLLNVAL), + XLAT(POLLNVAL), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_cap_ambient.h b/xlat/pr_cap_ambient.h new file mode 100644 index 00000000..83fa8822 --- /dev/null +++ b/xlat/pr_cap_ambient.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_cap_ambient.in; do not edit. */ +#if !(defined(PR_CAP_AMBIENT_IS_SET) || (defined(HAVE_DECL_PR_CAP_AMBIENT_IS_SET) && HAVE_DECL_PR_CAP_AMBIENT_IS_SET)) +# define PR_CAP_AMBIENT_IS_SET 1 +#endif +#if !(defined(PR_CAP_AMBIENT_RAISE) || (defined(HAVE_DECL_PR_CAP_AMBIENT_RAISE) && HAVE_DECL_PR_CAP_AMBIENT_RAISE)) +# define PR_CAP_AMBIENT_RAISE 2 +#endif +#if !(defined(PR_CAP_AMBIENT_LOWER) || (defined(HAVE_DECL_PR_CAP_AMBIENT_LOWER) && HAVE_DECL_PR_CAP_AMBIENT_LOWER)) +# define PR_CAP_AMBIENT_LOWER 3 +#endif +#if !(defined(PR_CAP_AMBIENT_CLEAR_ALL) || (defined(HAVE_DECL_PR_CAP_AMBIENT_CLEAR_ALL) && HAVE_DECL_PR_CAP_AMBIENT_CLEAR_ALL)) +# define PR_CAP_AMBIENT_CLEAR_ALL 4 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_cap_ambient in mpers mode + +#else + +static +const struct xlat pr_cap_ambient[] = { + XLAT(PR_CAP_AMBIENT_IS_SET), + XLAT(PR_CAP_AMBIENT_RAISE), + XLAT(PR_CAP_AMBIENT_LOWER), + XLAT(PR_CAP_AMBIENT_CLEAR_ALL), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_cap_ambient.in b/xlat/pr_cap_ambient.in new file mode 100644 index 00000000..0f0d2f26 --- /dev/null +++ b/xlat/pr_cap_ambient.in @@ -0,0 +1,4 @@ +PR_CAP_AMBIENT_IS_SET 1 +PR_CAP_AMBIENT_RAISE 2 +PR_CAP_AMBIENT_LOWER 3 +PR_CAP_AMBIENT_CLEAR_ALL 4 diff --git a/xlat/pr_dumpable.h b/xlat/pr_dumpable.h new file mode 100644 index 00000000..b101482e --- /dev/null +++ b/xlat/pr_dumpable.h @@ -0,0 +1,27 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_dumpable.in; do not edit. */ +#if !(defined(SUID_DUMP_DISABLE) || (defined(HAVE_DECL_SUID_DUMP_DISABLE) && HAVE_DECL_SUID_DUMP_DISABLE)) +# define SUID_DUMP_DISABLE 0 /* No setuid dumping */ +#endif +#if !(defined(SUID_DUMP_USER) || (defined(HAVE_DECL_SUID_DUMP_USER) && HAVE_DECL_SUID_DUMP_USER)) +# define SUID_DUMP_USER 1 /* Dump as user of process */ +#endif +#if !(defined(SUID_DUMP_ROOT) || (defined(HAVE_DECL_SUID_DUMP_ROOT) && HAVE_DECL_SUID_DUMP_ROOT)) +# define SUID_DUMP_ROOT 2 /* Dump as root */ +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_dumpable in mpers mode + +#else + +static +const struct xlat pr_dumpable[] = { +/* Defined in include/linux/sched.h */ + XLAT(SUID_DUMP_DISABLE), + XLAT(SUID_DUMP_USER), + XLAT(SUID_DUMP_ROOT), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_dumpable.in b/xlat/pr_dumpable.in new file mode 100644 index 00000000..0334b0b9 --- /dev/null +++ b/xlat/pr_dumpable.in @@ -0,0 +1,4 @@ +/* Defined in include/linux/sched.h */ +SUID_DUMP_DISABLE 0 /* No setuid dumping */ +SUID_DUMP_USER 1 /* Dump as user of process */ +SUID_DUMP_ROOT 2 /* Dump as root */ diff --git a/xlat/pr_fp_mode.h b/xlat/pr_fp_mode.h new file mode 100644 index 00000000..90275021 --- /dev/null +++ b/xlat/pr_fp_mode.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_fp_mode.in; do not edit. */ +#if !(defined(PR_FP_MODE_FR) || (defined(HAVE_DECL_PR_FP_MODE_FR) && HAVE_DECL_PR_FP_MODE_FR)) +# define PR_FP_MODE_FR (1 << 0) /* 64b FP registers */ +#endif +#if !(defined(PR_FP_MODE_FRE) || (defined(HAVE_DECL_PR_FP_MODE_FRE) && HAVE_DECL_PR_FP_MODE_FRE)) +# define PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */ +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_fp_mode in mpers mode + +#else + +static +const struct xlat pr_fp_mode[] = { + XLAT(PR_FP_MODE_FR), + XLAT(PR_FP_MODE_FRE), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_fp_mode.in b/xlat/pr_fp_mode.in new file mode 100644 index 00000000..8f144546 --- /dev/null +++ b/xlat/pr_fp_mode.in @@ -0,0 +1,2 @@ +PR_FP_MODE_FR (1 << 0) /* 64b FP registers */ +PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */ diff --git a/xlat/pr_mce_kill.h b/xlat/pr_mce_kill.h new file mode 100644 index 00000000..d2839db9 --- /dev/null +++ b/xlat/pr_mce_kill.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_mce_kill.in; do not edit. */ +#if !(defined(PR_MCE_KILL_CLEAR) || (defined(HAVE_DECL_PR_MCE_KILL_CLEAR) && HAVE_DECL_PR_MCE_KILL_CLEAR)) +# define PR_MCE_KILL_CLEAR 0 +#endif +#if !(defined(PR_MCE_KILL_SET) || (defined(HAVE_DECL_PR_MCE_KILL_SET) && HAVE_DECL_PR_MCE_KILL_SET)) +# define PR_MCE_KILL_SET 1 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_mce_kill in mpers mode + +#else + +static +const struct xlat pr_mce_kill[] = { + XLAT(PR_MCE_KILL_CLEAR), + XLAT(PR_MCE_KILL_SET), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_mce_kill.in b/xlat/pr_mce_kill.in new file mode 100644 index 00000000..574e55f2 --- /dev/null +++ b/xlat/pr_mce_kill.in @@ -0,0 +1,2 @@ +PR_MCE_KILL_CLEAR 0 +PR_MCE_KILL_SET 1 diff --git a/xlat/pr_mce_kill_policy.h b/xlat/pr_mce_kill_policy.h new file mode 100644 index 00000000..aee9568d --- /dev/null +++ b/xlat/pr_mce_kill_policy.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_mce_kill_policy.in; do not edit. */ +#if !(defined(PR_MCE_KILL_LATE) || (defined(HAVE_DECL_PR_MCE_KILL_LATE) && HAVE_DECL_PR_MCE_KILL_LATE)) +# define PR_MCE_KILL_LATE 0 +#endif +#if !(defined(PR_MCE_KILL_EARLY) || (defined(HAVE_DECL_PR_MCE_KILL_EARLY) && HAVE_DECL_PR_MCE_KILL_EARLY)) +# define PR_MCE_KILL_EARLY 1 +#endif +#if !(defined(PR_MCE_KILL_DEFAULT) || (defined(HAVE_DECL_PR_MCE_KILL_DEFAULT) && HAVE_DECL_PR_MCE_KILL_DEFAULT)) +# define PR_MCE_KILL_DEFAULT 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_mce_kill_policy in mpers mode + +#else + +static +const struct xlat pr_mce_kill_policy[] = { + XLAT(PR_MCE_KILL_LATE), + XLAT(PR_MCE_KILL_EARLY), + XLAT(PR_MCE_KILL_DEFAULT), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_mce_kill_policy.in b/xlat/pr_mce_kill_policy.in new file mode 100644 index 00000000..510b566b --- /dev/null +++ b/xlat/pr_mce_kill_policy.in @@ -0,0 +1,3 @@ +PR_MCE_KILL_LATE 0 +PR_MCE_KILL_EARLY 1 +PR_MCE_KILL_DEFAULT 2 diff --git a/xlat/pr_set_mm.h b/xlat/pr_set_mm.h new file mode 100644 index 00000000..bc07483c --- /dev/null +++ b/xlat/pr_set_mm.h @@ -0,0 +1,74 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_set_mm.in; do not edit. */ +#if !(defined(PR_SET_MM_START_CODE) || (defined(HAVE_DECL_PR_SET_MM_START_CODE) && HAVE_DECL_PR_SET_MM_START_CODE)) +# define PR_SET_MM_START_CODE 1 +#endif +#if !(defined(PR_SET_MM_END_CODE) || (defined(HAVE_DECL_PR_SET_MM_END_CODE) && HAVE_DECL_PR_SET_MM_END_CODE)) +# define PR_SET_MM_END_CODE 2 +#endif +#if !(defined(PR_SET_MM_START_DATA) || (defined(HAVE_DECL_PR_SET_MM_START_DATA) && HAVE_DECL_PR_SET_MM_START_DATA)) +# define PR_SET_MM_START_DATA 3 +#endif +#if !(defined(PR_SET_MM_END_DATA) || (defined(HAVE_DECL_PR_SET_MM_END_DATA) && HAVE_DECL_PR_SET_MM_END_DATA)) +# define PR_SET_MM_END_DATA 4 +#endif +#if !(defined(PR_SET_MM_START_STACK) || (defined(HAVE_DECL_PR_SET_MM_START_STACK) && HAVE_DECL_PR_SET_MM_START_STACK)) +# define PR_SET_MM_START_STACK 5 +#endif +#if !(defined(PR_SET_MM_START_BRK) || (defined(HAVE_DECL_PR_SET_MM_START_BRK) && HAVE_DECL_PR_SET_MM_START_BRK)) +# define PR_SET_MM_START_BRK 6 +#endif +#if !(defined(PR_SET_MM_BRK) || (defined(HAVE_DECL_PR_SET_MM_BRK) && HAVE_DECL_PR_SET_MM_BRK)) +# define PR_SET_MM_BRK 7 +#endif +#if !(defined(PR_SET_MM_ARG_START) || (defined(HAVE_DECL_PR_SET_MM_ARG_START) && HAVE_DECL_PR_SET_MM_ARG_START)) +# define PR_SET_MM_ARG_START 8 +#endif +#if !(defined(PR_SET_MM_ARG_END) || (defined(HAVE_DECL_PR_SET_MM_ARG_END) && HAVE_DECL_PR_SET_MM_ARG_END)) +# define PR_SET_MM_ARG_END 9 +#endif +#if !(defined(PR_SET_MM_ENV_START) || (defined(HAVE_DECL_PR_SET_MM_ENV_START) && HAVE_DECL_PR_SET_MM_ENV_START)) +# define PR_SET_MM_ENV_START 10 +#endif +#if !(defined(PR_SET_MM_ENV_END) || (defined(HAVE_DECL_PR_SET_MM_ENV_END) && HAVE_DECL_PR_SET_MM_ENV_END)) +# define PR_SET_MM_ENV_END 11 +#endif +#if !(defined(PR_SET_MM_AUXV) || (defined(HAVE_DECL_PR_SET_MM_AUXV) && HAVE_DECL_PR_SET_MM_AUXV)) +# define PR_SET_MM_AUXV 12 +#endif +#if !(defined(PR_SET_MM_EXE_FILE) || (defined(HAVE_DECL_PR_SET_MM_EXE_FILE) && HAVE_DECL_PR_SET_MM_EXE_FILE)) +# define PR_SET_MM_EXE_FILE 13 +#endif +#if !(defined(PR_SET_MM_MAP) || (defined(HAVE_DECL_PR_SET_MM_MAP) && HAVE_DECL_PR_SET_MM_MAP)) +# define PR_SET_MM_MAP 14 +#endif +#if !(defined(PR_SET_MM_MAP_SIZE) || (defined(HAVE_DECL_PR_SET_MM_MAP_SIZE) && HAVE_DECL_PR_SET_MM_MAP_SIZE)) +# define PR_SET_MM_MAP_SIZE 15 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_set_mm in mpers mode + +#else + +static +const struct xlat pr_set_mm[] = { + XLAT(PR_SET_MM_START_CODE), + XLAT(PR_SET_MM_END_CODE), + XLAT(PR_SET_MM_START_DATA), + XLAT(PR_SET_MM_END_DATA), + XLAT(PR_SET_MM_START_STACK), + XLAT(PR_SET_MM_START_BRK), + XLAT(PR_SET_MM_BRK), + XLAT(PR_SET_MM_ARG_START), + XLAT(PR_SET_MM_ARG_END), + XLAT(PR_SET_MM_ENV_START), + XLAT(PR_SET_MM_ENV_END), + XLAT(PR_SET_MM_AUXV), + XLAT(PR_SET_MM_EXE_FILE), + XLAT(PR_SET_MM_MAP), + XLAT(PR_SET_MM_MAP_SIZE), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_set_mm.in b/xlat/pr_set_mm.in new file mode 100644 index 00000000..191ba8db --- /dev/null +++ b/xlat/pr_set_mm.in @@ -0,0 +1,15 @@ +PR_SET_MM_START_CODE 1 +PR_SET_MM_END_CODE 2 +PR_SET_MM_START_DATA 3 +PR_SET_MM_END_DATA 4 +PR_SET_MM_START_STACK 5 +PR_SET_MM_START_BRK 6 +PR_SET_MM_BRK 7 +PR_SET_MM_ARG_START 8 +PR_SET_MM_ARG_END 9 +PR_SET_MM_ENV_START 10 +PR_SET_MM_ENV_END 11 +PR_SET_MM_AUXV 12 +PR_SET_MM_EXE_FILE 13 +PR_SET_MM_MAP 14 +PR_SET_MM_MAP_SIZE 15 diff --git a/xlat/pr_tsc.h b/xlat/pr_tsc.h new file mode 100644 index 00000000..daec871e --- /dev/null +++ b/xlat/pr_tsc.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_tsc.in; do not edit. */ +#if !(defined(PR_TSC_ENABLE) || (defined(HAVE_DECL_PR_TSC_ENABLE) && HAVE_DECL_PR_TSC_ENABLE)) +# define PR_TSC_ENABLE 1 +#endif +#if !(defined(PR_TSC_SIGSEGV) || (defined(HAVE_DECL_PR_TSC_SIGSEGV) && HAVE_DECL_PR_TSC_SIGSEGV)) +# define PR_TSC_SIGSEGV 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_tsc in mpers mode + +#else + +static +const struct xlat pr_tsc[] = { + XLAT(PR_TSC_ENABLE), + XLAT(PR_TSC_SIGSEGV), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_tsc.in b/xlat/pr_tsc.in new file mode 100644 index 00000000..d03aafc7 --- /dev/null +++ b/xlat/pr_tsc.in @@ -0,0 +1,2 @@ +PR_TSC_ENABLE 1 +PR_TSC_SIGSEGV 2 diff --git a/xlat/pr_unalign_flags.h b/xlat/pr_unalign_flags.h new file mode 100644 index 00000000..5a92686e --- /dev/null +++ b/xlat/pr_unalign_flags.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_unalign_flags.in; do not edit. */ +#if !(defined(PR_UNALIGN_NOPRINT) || (defined(HAVE_DECL_PR_UNALIGN_NOPRINT) && HAVE_DECL_PR_UNALIGN_NOPRINT)) +# define PR_UNALIGN_NOPRINT 1 +#endif +#if !(defined(PR_UNALIGN_SIGBUS) || (defined(HAVE_DECL_PR_UNALIGN_SIGBUS) && HAVE_DECL_PR_UNALIGN_SIGBUS)) +# define PR_UNALIGN_SIGBUS 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat pr_unalign_flags in mpers mode + +#else + +static +const struct xlat pr_unalign_flags[] = { + XLAT(PR_UNALIGN_NOPRINT), + XLAT(PR_UNALIGN_SIGBUS), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/pr_unalign_flags.in b/xlat/pr_unalign_flags.in new file mode 100644 index 00000000..0d3f2ff8 --- /dev/null +++ b/xlat/pr_unalign_flags.in @@ -0,0 +1,2 @@ +PR_UNALIGN_NOPRINT 1 +PR_UNALIGN_SIGBUS 2 diff --git a/xlat/prctl_options.h b/xlat/prctl_options.h index ce5f2d55..f1475b4a 100644 --- a/xlat/prctl_options.h +++ b/xlat/prctl_options.h @@ -1,173 +1,202 @@ /* Generated by ./xlat/gen.sh from ./xlat/prctl_options.in; do not edit. */ - -static const struct xlat prctl_options[] = { -#if defined(PR_MAXPROCS) || (defined(HAVE_DECL_PR_MAXPROCS) && HAVE_DECL_PR_MAXPROCS) - XLAT(PR_MAXPROCS), -#endif -#if defined(PR_ISBLOCKED) || (defined(HAVE_DECL_PR_ISBLOCKED) && HAVE_DECL_PR_ISBLOCKED) - XLAT(PR_ISBLOCKED), -#endif -#if defined(PR_SETSTACKSIZE) || (defined(HAVE_DECL_PR_SETSTACKSIZE) && HAVE_DECL_PR_SETSTACKSIZE) - XLAT(PR_SETSTACKSIZE), -#endif -#if defined(PR_GETSTACKSIZE) || (defined(HAVE_DECL_PR_GETSTACKSIZE) && HAVE_DECL_PR_GETSTACKSIZE) - XLAT(PR_GETSTACKSIZE), -#endif -#if defined(PR_MAXPPROCS) || (defined(HAVE_DECL_PR_MAXPPROCS) && HAVE_DECL_PR_MAXPPROCS) - XLAT(PR_MAXPPROCS), -#endif -#if defined(PR_UNBLKONEXEC) || (defined(HAVE_DECL_PR_UNBLKONEXEC) && HAVE_DECL_PR_UNBLKONEXEC) - XLAT(PR_UNBLKONEXEC), -#endif -#if defined(PR_ATOMICSIM) || (defined(HAVE_DECL_PR_ATOMICSIM) && HAVE_DECL_PR_ATOMICSIM) - XLAT(PR_ATOMICSIM), -#endif -#if defined(PR_SETEXITSIG) || (defined(HAVE_DECL_PR_SETEXITSIG) && HAVE_DECL_PR_SETEXITSIG) - XLAT(PR_SETEXITSIG), +#if !(defined(PR_SET_PDEATHSIG) || (defined(HAVE_DECL_PR_SET_PDEATHSIG) && HAVE_DECL_PR_SET_PDEATHSIG)) +# define PR_SET_PDEATHSIG 1 #endif -#if defined(PR_RESIDENT) || (defined(HAVE_DECL_PR_RESIDENT) && HAVE_DECL_PR_RESIDENT) - XLAT(PR_RESIDENT), +#if !(defined(PR_GET_PDEATHSIG) || (defined(HAVE_DECL_PR_GET_PDEATHSIG) && HAVE_DECL_PR_GET_PDEATHSIG)) +# define PR_GET_PDEATHSIG 2 #endif -#if defined(PR_ATTACHADDR) || (defined(HAVE_DECL_PR_ATTACHADDR) && HAVE_DECL_PR_ATTACHADDR) - XLAT(PR_ATTACHADDR), +#if !(defined(PR_GET_DUMPABLE) || (defined(HAVE_DECL_PR_GET_DUMPABLE) && HAVE_DECL_PR_GET_DUMPABLE)) +# define PR_GET_DUMPABLE 3 #endif -#if defined(PR_DETACHADDR) || (defined(HAVE_DECL_PR_DETACHADDR) && HAVE_DECL_PR_DETACHADDR) - XLAT(PR_DETACHADDR), +#if !(defined(PR_SET_DUMPABLE) || (defined(HAVE_DECL_PR_SET_DUMPABLE) && HAVE_DECL_PR_SET_DUMPABLE)) +# define PR_SET_DUMPABLE 4 #endif -#if defined(PR_TERMCHILD) || (defined(HAVE_DECL_PR_TERMCHILD) && HAVE_DECL_PR_TERMCHILD) - XLAT(PR_TERMCHILD), +#if !(defined(PR_GET_UNALIGN) || (defined(HAVE_DECL_PR_GET_UNALIGN) && HAVE_DECL_PR_GET_UNALIGN)) +# define PR_GET_UNALIGN 5 #endif -#if defined(PR_GETSHMASK) || (defined(HAVE_DECL_PR_GETSHMASK) && HAVE_DECL_PR_GETSHMASK) - XLAT(PR_GETSHMASK), +#if !(defined(PR_SET_UNALIGN) || (defined(HAVE_DECL_PR_SET_UNALIGN) && HAVE_DECL_PR_SET_UNALIGN)) +# define PR_SET_UNALIGN 6 #endif -#if defined(PR_GETNSHARE) || (defined(HAVE_DECL_PR_GETNSHARE) && HAVE_DECL_PR_GETNSHARE) - XLAT(PR_GETNSHARE), +#if !(defined(PR_GET_KEEPCAPS) || (defined(HAVE_DECL_PR_GET_KEEPCAPS) && HAVE_DECL_PR_GET_KEEPCAPS)) +# define PR_GET_KEEPCAPS 7 #endif -#if defined(PR_COREPID) || (defined(HAVE_DECL_PR_COREPID) && HAVE_DECL_PR_COREPID) - XLAT(PR_COREPID), +#if !(defined(PR_SET_KEEPCAPS) || (defined(HAVE_DECL_PR_SET_KEEPCAPS) && HAVE_DECL_PR_SET_KEEPCAPS)) +# define PR_SET_KEEPCAPS 8 #endif -#if defined(PR_ATTACHADDRPERM) || (defined(HAVE_DECL_PR_ATTACHADDRPERM) && HAVE_DECL_PR_ATTACHADDRPERM) - XLAT(PR_ATTACHADDRPERM), +#if !(defined(PR_GET_FPEMU) || (defined(HAVE_DECL_PR_GET_FPEMU) && HAVE_DECL_PR_GET_FPEMU)) +# define PR_GET_FPEMU 9 #endif -#if defined(PR_PTHREADEXIT) || (defined(HAVE_DECL_PR_PTHREADEXIT) && HAVE_DECL_PR_PTHREADEXIT) - XLAT(PR_PTHREADEXIT), +#if !(defined(PR_SET_FPEMU) || (defined(HAVE_DECL_PR_SET_FPEMU) && HAVE_DECL_PR_SET_FPEMU)) +# define PR_SET_FPEMU 10 #endif -#if defined(PR_SET_PDEATHSIG) || (defined(HAVE_DECL_PR_SET_PDEATHSIG) && HAVE_DECL_PR_SET_PDEATHSIG) - XLAT(PR_SET_PDEATHSIG), +#if !(defined(PR_GET_FPEXC) || (defined(HAVE_DECL_PR_GET_FPEXC) && HAVE_DECL_PR_GET_FPEXC)) +# define PR_GET_FPEXC 11 #endif -#if defined(PR_GET_PDEATHSIG) || (defined(HAVE_DECL_PR_GET_PDEATHSIG) && HAVE_DECL_PR_GET_PDEATHSIG) - XLAT(PR_GET_PDEATHSIG), +#if !(defined(PR_SET_FPEXC) || (defined(HAVE_DECL_PR_SET_FPEXC) && HAVE_DECL_PR_SET_FPEXC)) +# define PR_SET_FPEXC 12 #endif -#if defined(PR_GET_DUMPABLE) || (defined(HAVE_DECL_PR_GET_DUMPABLE) && HAVE_DECL_PR_GET_DUMPABLE) - XLAT(PR_GET_DUMPABLE), +#if !(defined(PR_GET_TIMING) || (defined(HAVE_DECL_PR_GET_TIMING) && HAVE_DECL_PR_GET_TIMING)) +# define PR_GET_TIMING 13 #endif -#if defined(PR_SET_DUMPABLE) || (defined(HAVE_DECL_PR_SET_DUMPABLE) && HAVE_DECL_PR_SET_DUMPABLE) - XLAT(PR_SET_DUMPABLE), +#if !(defined(PR_SET_TIMING) || (defined(HAVE_DECL_PR_SET_TIMING) && HAVE_DECL_PR_SET_TIMING)) +# define PR_SET_TIMING 14 #endif -#if defined(PR_GET_UNALIGN) || (defined(HAVE_DECL_PR_GET_UNALIGN) && HAVE_DECL_PR_GET_UNALIGN) - XLAT(PR_GET_UNALIGN), +#if !(defined(PR_SET_NAME) || (defined(HAVE_DECL_PR_SET_NAME) && HAVE_DECL_PR_SET_NAME)) +# define PR_SET_NAME 15 #endif -#if defined(PR_SET_UNALIGN) || (defined(HAVE_DECL_PR_SET_UNALIGN) && HAVE_DECL_PR_SET_UNALIGN) - XLAT(PR_SET_UNALIGN), +#if !(defined(PR_GET_NAME) || (defined(HAVE_DECL_PR_GET_NAME) && HAVE_DECL_PR_GET_NAME)) +# define PR_GET_NAME 16 #endif -#if defined(PR_GET_KEEPCAPS) || (defined(HAVE_DECL_PR_GET_KEEPCAPS) && HAVE_DECL_PR_GET_KEEPCAPS) - XLAT(PR_GET_KEEPCAPS), +#if !(defined(PR_GET_ENDIAN) || (defined(HAVE_DECL_PR_GET_ENDIAN) && HAVE_DECL_PR_GET_ENDIAN)) +# define PR_GET_ENDIAN 19 #endif -#if defined(PR_SET_KEEPCAPS) || (defined(HAVE_DECL_PR_SET_KEEPCAPS) && HAVE_DECL_PR_SET_KEEPCAPS) - XLAT(PR_SET_KEEPCAPS), +#if !(defined(PR_SET_ENDIAN) || (defined(HAVE_DECL_PR_SET_ENDIAN) && HAVE_DECL_PR_SET_ENDIAN)) +# define PR_SET_ENDIAN 20 #endif -#if defined(PR_GET_FPEMU) || (defined(HAVE_DECL_PR_GET_FPEMU) && HAVE_DECL_PR_GET_FPEMU) - XLAT(PR_GET_FPEMU), +#if !(defined(PR_GET_SECCOMP) || (defined(HAVE_DECL_PR_GET_SECCOMP) && HAVE_DECL_PR_GET_SECCOMP)) +# define PR_GET_SECCOMP 21 #endif -#if defined(PR_SET_FPEMU) || (defined(HAVE_DECL_PR_SET_FPEMU) && HAVE_DECL_PR_SET_FPEMU) - XLAT(PR_SET_FPEMU), +#if !(defined(PR_SET_SECCOMP) || (defined(HAVE_DECL_PR_SET_SECCOMP) && HAVE_DECL_PR_SET_SECCOMP)) +# define PR_SET_SECCOMP 22 #endif -#if defined(PR_GET_FPEXC) || (defined(HAVE_DECL_PR_GET_FPEXC) && HAVE_DECL_PR_GET_FPEXC) - XLAT(PR_GET_FPEXC), +#if !(defined(PR_CAPBSET_READ) || (defined(HAVE_DECL_PR_CAPBSET_READ) && HAVE_DECL_PR_CAPBSET_READ)) +# define PR_CAPBSET_READ 23 #endif -#if defined(PR_SET_FPEXC) || (defined(HAVE_DECL_PR_SET_FPEXC) && HAVE_DECL_PR_SET_FPEXC) - XLAT(PR_SET_FPEXC), +#if !(defined(PR_CAPBSET_DROP) || (defined(HAVE_DECL_PR_CAPBSET_DROP) && HAVE_DECL_PR_CAPBSET_DROP)) +# define PR_CAPBSET_DROP 24 #endif -#if defined(PR_GET_TIMING) || (defined(HAVE_DECL_PR_GET_TIMING) && HAVE_DECL_PR_GET_TIMING) - XLAT(PR_GET_TIMING), +#if !(defined(PR_GET_TSC) || (defined(HAVE_DECL_PR_GET_TSC) && HAVE_DECL_PR_GET_TSC)) +# define PR_GET_TSC 25 #endif -#if defined(PR_SET_TIMING) || (defined(HAVE_DECL_PR_SET_TIMING) && HAVE_DECL_PR_SET_TIMING) - XLAT(PR_SET_TIMING), +#if !(defined(PR_SET_TSC) || (defined(HAVE_DECL_PR_SET_TSC) && HAVE_DECL_PR_SET_TSC)) +# define PR_SET_TSC 26 #endif -#if defined(PR_SET_NAME) || (defined(HAVE_DECL_PR_SET_NAME) && HAVE_DECL_PR_SET_NAME) - XLAT(PR_SET_NAME), +#if !(defined(PR_GET_SECUREBITS) || (defined(HAVE_DECL_PR_GET_SECUREBITS) && HAVE_DECL_PR_GET_SECUREBITS)) +# define PR_GET_SECUREBITS 27 #endif -#if defined(PR_GET_NAME) || (defined(HAVE_DECL_PR_GET_NAME) && HAVE_DECL_PR_GET_NAME) - XLAT(PR_GET_NAME), +#if !(defined(PR_SET_SECUREBITS) || (defined(HAVE_DECL_PR_SET_SECUREBITS) && HAVE_DECL_PR_SET_SECUREBITS)) +# define PR_SET_SECUREBITS 28 #endif -#if defined(PR_GET_ENDIAN) || (defined(HAVE_DECL_PR_GET_ENDIAN) && HAVE_DECL_PR_GET_ENDIAN) - XLAT(PR_GET_ENDIAN), +#if !(defined(PR_SET_TIMERSLACK) || (defined(HAVE_DECL_PR_SET_TIMERSLACK) && HAVE_DECL_PR_SET_TIMERSLACK)) +# define PR_SET_TIMERSLACK 29 #endif -#if defined(PR_SET_ENDIAN) || (defined(HAVE_DECL_PR_SET_ENDIAN) && HAVE_DECL_PR_SET_ENDIAN) - XLAT(PR_SET_ENDIAN), +#if !(defined(PR_GET_TIMERSLACK) || (defined(HAVE_DECL_PR_GET_TIMERSLACK) && HAVE_DECL_PR_GET_TIMERSLACK)) +# define PR_GET_TIMERSLACK 30 #endif -#if defined(PR_GET_SECCOMP) || (defined(HAVE_DECL_PR_GET_SECCOMP) && HAVE_DECL_PR_GET_SECCOMP) - XLAT(PR_GET_SECCOMP), +#if !(defined(PR_TASK_PERF_EVENTS_DISABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE)) +# define PR_TASK_PERF_EVENTS_DISABLE 31 #endif -#if defined(PR_SET_SECCOMP) || (defined(HAVE_DECL_PR_SET_SECCOMP) && HAVE_DECL_PR_SET_SECCOMP) - XLAT(PR_SET_SECCOMP), +#if !(defined(PR_TASK_PERF_EVENTS_ENABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE)) +# define PR_TASK_PERF_EVENTS_ENABLE 32 #endif -#if defined(PR_CAPBSET_READ) || (defined(HAVE_DECL_PR_CAPBSET_READ) && HAVE_DECL_PR_CAPBSET_READ) - XLAT(PR_CAPBSET_READ), +#if !(defined(PR_MCE_KILL) || (defined(HAVE_DECL_PR_MCE_KILL) && HAVE_DECL_PR_MCE_KILL)) +# define PR_MCE_KILL 33 #endif -#if defined(PR_CAPBSET_DROP) || (defined(HAVE_DECL_PR_CAPBSET_DROP) && HAVE_DECL_PR_CAPBSET_DROP) - XLAT(PR_CAPBSET_DROP), +#if !(defined(PR_MCE_KILL_GET) || (defined(HAVE_DECL_PR_MCE_KILL_GET) && HAVE_DECL_PR_MCE_KILL_GET)) +# define PR_MCE_KILL_GET 34 #endif -#if defined(PR_GET_TSC) || (defined(HAVE_DECL_PR_GET_TSC) && HAVE_DECL_PR_GET_TSC) - XLAT(PR_GET_TSC), +#if !(defined(PR_SET_MM) || (defined(HAVE_DECL_PR_SET_MM) && HAVE_DECL_PR_SET_MM)) +# define PR_SET_MM 35 #endif -#if defined(PR_SET_TSC) || (defined(HAVE_DECL_PR_SET_TSC) && HAVE_DECL_PR_SET_TSC) - XLAT(PR_SET_TSC), +#if !(defined(PR_SET_PTRACER) || (defined(HAVE_DECL_PR_SET_PTRACER) && HAVE_DECL_PR_SET_PTRACER)) +# define PR_SET_PTRACER 0x59616d61 #endif -#if defined(PR_GET_SECUREBITS) || (defined(HAVE_DECL_PR_GET_SECUREBITS) && HAVE_DECL_PR_GET_SECUREBITS) - XLAT(PR_GET_SECUREBITS), +#if !(defined(PR_SET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_SET_CHILD_SUBREAPER) && HAVE_DECL_PR_SET_CHILD_SUBREAPER)) +# define PR_SET_CHILD_SUBREAPER 36 #endif -#if defined(PR_SET_SECUREBITS) || (defined(HAVE_DECL_PR_SET_SECUREBITS) && HAVE_DECL_PR_SET_SECUREBITS) - XLAT(PR_SET_SECUREBITS), +#if !(defined(PR_GET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_GET_CHILD_SUBREAPER) && HAVE_DECL_PR_GET_CHILD_SUBREAPER)) +# define PR_GET_CHILD_SUBREAPER 37 #endif -#if defined(PR_SET_TIMERSLACK) || (defined(HAVE_DECL_PR_SET_TIMERSLACK) && HAVE_DECL_PR_SET_TIMERSLACK) - XLAT(PR_SET_TIMERSLACK), +#if !(defined(PR_SET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_SET_NO_NEW_PRIVS) && HAVE_DECL_PR_SET_NO_NEW_PRIVS)) +# define PR_SET_NO_NEW_PRIVS 38 #endif -#if defined(PR_GET_TIMERSLACK) || (defined(HAVE_DECL_PR_GET_TIMERSLACK) && HAVE_DECL_PR_GET_TIMERSLACK) - XLAT(PR_GET_TIMERSLACK), +#if !(defined(PR_GET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_GET_NO_NEW_PRIVS) && HAVE_DECL_PR_GET_NO_NEW_PRIVS)) +# define PR_GET_NO_NEW_PRIVS 39 #endif -#if defined(PR_TASK_PERF_EVENTS_DISABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE) - XLAT(PR_TASK_PERF_EVENTS_DISABLE), +#if !(defined(PR_GET_TID_ADDRESS) || (defined(HAVE_DECL_PR_GET_TID_ADDRESS) && HAVE_DECL_PR_GET_TID_ADDRESS)) +# define PR_GET_TID_ADDRESS 40 #endif -#if defined(PR_TASK_PERF_EVENTS_ENABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE) - XLAT(PR_TASK_PERF_EVENTS_ENABLE), +#if !(defined(PR_SET_THP_DISABLE) || (defined(HAVE_DECL_PR_SET_THP_DISABLE) && HAVE_DECL_PR_SET_THP_DISABLE)) +# define PR_SET_THP_DISABLE 41 #endif -#if defined(PR_MCE_KILL) || (defined(HAVE_DECL_PR_MCE_KILL) && HAVE_DECL_PR_MCE_KILL) - XLAT(PR_MCE_KILL), +#if !(defined(PR_GET_THP_DISABLE) || (defined(HAVE_DECL_PR_GET_THP_DISABLE) && HAVE_DECL_PR_GET_THP_DISABLE)) +# define PR_GET_THP_DISABLE 42 #endif -#if defined(PR_MCE_KILL_GET) || (defined(HAVE_DECL_PR_MCE_KILL_GET) && HAVE_DECL_PR_MCE_KILL_GET) - XLAT(PR_MCE_KILL_GET), +#if !(defined(PR_MPX_ENABLE_MANAGEMENT) || (defined(HAVE_DECL_PR_MPX_ENABLE_MANAGEMENT) && HAVE_DECL_PR_MPX_ENABLE_MANAGEMENT)) +# define PR_MPX_ENABLE_MANAGEMENT 43 #endif -#if defined(PR_SET_MM) || (defined(HAVE_DECL_PR_SET_MM) && HAVE_DECL_PR_SET_MM) - XLAT(PR_SET_MM), +#if !(defined(PR_MPX_DISABLE_MANAGEMENT) || (defined(HAVE_DECL_PR_MPX_DISABLE_MANAGEMENT) && HAVE_DECL_PR_MPX_DISABLE_MANAGEMENT)) +# define PR_MPX_DISABLE_MANAGEMENT 44 #endif -#if defined(PR_SET_PTRACER) || (defined(HAVE_DECL_PR_SET_PTRACER) && HAVE_DECL_PR_SET_PTRACER) - XLAT(PR_SET_PTRACER), +#if !(defined(PR_SET_FP_MODE) || (defined(HAVE_DECL_PR_SET_FP_MODE) && HAVE_DECL_PR_SET_FP_MODE)) +# define PR_SET_FP_MODE 45 #endif -#if defined(PR_SET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_SET_CHILD_SUBREAPER) && HAVE_DECL_PR_SET_CHILD_SUBREAPER) - XLAT(PR_SET_CHILD_SUBREAPER), +#if !(defined(PR_GET_FP_MODE) || (defined(HAVE_DECL_PR_GET_FP_MODE) && HAVE_DECL_PR_GET_FP_MODE)) +# define PR_GET_FP_MODE 46 #endif -#if defined(PR_GET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_GET_CHILD_SUBREAPER) && HAVE_DECL_PR_GET_CHILD_SUBREAPER) - XLAT(PR_GET_CHILD_SUBREAPER), +#if !(defined(PR_CAP_AMBIENT) || (defined(HAVE_DECL_PR_CAP_AMBIENT) && HAVE_DECL_PR_CAP_AMBIENT)) +# define PR_CAP_AMBIENT 47 #endif -#if defined(PR_SET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_SET_NO_NEW_PRIVS) && HAVE_DECL_PR_SET_NO_NEW_PRIVS) - XLAT(PR_SET_NO_NEW_PRIVS), +#if !(defined(PR_SET_VMA) || (defined(HAVE_DECL_PR_SET_VMA) && HAVE_DECL_PR_SET_VMA)) +# define PR_SET_VMA 0x53564d41 #endif -#if defined(PR_GET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_GET_NO_NEW_PRIVS) && HAVE_DECL_PR_GET_NO_NEW_PRIVS) - XLAT(PR_GET_NO_NEW_PRIVS), -#endif -#if defined(PR_GET_TID_ADDRESS) || (defined(HAVE_DECL_PR_GET_TID_ADDRESS) && HAVE_DECL_PR_GET_TID_ADDRESS) - XLAT(PR_GET_TID_ADDRESS), -#endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat prctl_options in mpers mode + +#else + +static +const struct xlat prctl_options[] = { + XLAT(PR_SET_PDEATHSIG), + XLAT(PR_GET_PDEATHSIG), + XLAT(PR_GET_DUMPABLE), + XLAT(PR_SET_DUMPABLE), + XLAT(PR_GET_UNALIGN), + XLAT(PR_SET_UNALIGN), + XLAT(PR_GET_KEEPCAPS), + XLAT(PR_SET_KEEPCAPS), + XLAT(PR_GET_FPEMU), + XLAT(PR_SET_FPEMU), + XLAT(PR_GET_FPEXC), + XLAT(PR_SET_FPEXC), + XLAT(PR_GET_TIMING), + XLAT(PR_SET_TIMING), + XLAT(PR_SET_NAME), + XLAT(PR_GET_NAME), + XLAT(PR_GET_ENDIAN), + XLAT(PR_SET_ENDIAN), + XLAT(PR_GET_SECCOMP), + XLAT(PR_SET_SECCOMP), + XLAT(PR_CAPBSET_READ), + XLAT(PR_CAPBSET_DROP), + XLAT(PR_GET_TSC), + XLAT(PR_SET_TSC), + XLAT(PR_GET_SECUREBITS), + XLAT(PR_SET_SECUREBITS), + XLAT(PR_SET_TIMERSLACK), + XLAT(PR_GET_TIMERSLACK), + XLAT(PR_TASK_PERF_EVENTS_DISABLE), + XLAT(PR_TASK_PERF_EVENTS_ENABLE), + XLAT(PR_MCE_KILL), + XLAT(PR_MCE_KILL_GET), + XLAT(PR_SET_MM), + XLAT(PR_SET_PTRACER), + XLAT(PR_SET_CHILD_SUBREAPER), + XLAT(PR_GET_CHILD_SUBREAPER), + XLAT(PR_SET_NO_NEW_PRIVS), + XLAT(PR_GET_NO_NEW_PRIVS), + XLAT(PR_GET_TID_ADDRESS), + XLAT(PR_SET_THP_DISABLE), + XLAT(PR_GET_THP_DISABLE), + XLAT(PR_MPX_ENABLE_MANAGEMENT), + XLAT(PR_MPX_DISABLE_MANAGEMENT), + XLAT(PR_SET_FP_MODE), + XLAT(PR_GET_FP_MODE), + XLAT(PR_CAP_AMBIENT), + XLAT(PR_SET_VMA), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/prctl_options.in b/xlat/prctl_options.in index 9eabddd0..8c09ee31 100644 --- a/xlat/prctl_options.in +++ b/xlat/prctl_options.in @@ -1,56 +1,47 @@ -PR_MAXPROCS -PR_ISBLOCKED -PR_SETSTACKSIZE -PR_GETSTACKSIZE -PR_MAXPPROCS -PR_UNBLKONEXEC -PR_ATOMICSIM -PR_SETEXITSIG -PR_RESIDENT -PR_ATTACHADDR -PR_DETACHADDR -PR_TERMCHILD -PR_GETSHMASK -PR_GETNSHARE -PR_COREPID -PR_ATTACHADDRPERM -PR_PTHREADEXIT -PR_SET_PDEATHSIG -PR_GET_PDEATHSIG -PR_GET_DUMPABLE -PR_SET_DUMPABLE -PR_GET_UNALIGN -PR_SET_UNALIGN -PR_GET_KEEPCAPS -PR_SET_KEEPCAPS -PR_GET_FPEMU -PR_SET_FPEMU -PR_GET_FPEXC -PR_SET_FPEXC -PR_GET_TIMING -PR_SET_TIMING -PR_SET_NAME -PR_GET_NAME -PR_GET_ENDIAN -PR_SET_ENDIAN -PR_GET_SECCOMP -PR_SET_SECCOMP -PR_CAPBSET_READ -PR_CAPBSET_DROP -PR_GET_TSC -PR_SET_TSC -PR_GET_SECUREBITS -PR_SET_SECUREBITS -PR_SET_TIMERSLACK -PR_GET_TIMERSLACK -PR_TASK_PERF_EVENTS_DISABLE -PR_TASK_PERF_EVENTS_ENABLE -PR_MCE_KILL -PR_MCE_KILL_GET -PR_SET_MM -PR_SET_PTRACER -PR_SET_CHILD_SUBREAPER -PR_GET_CHILD_SUBREAPER -PR_SET_NO_NEW_PRIVS -PR_GET_NO_NEW_PRIVS -PR_GET_TID_ADDRESS +PR_SET_PDEATHSIG 1 +PR_GET_PDEATHSIG 2 +PR_GET_DUMPABLE 3 +PR_SET_DUMPABLE 4 +PR_GET_UNALIGN 5 +PR_SET_UNALIGN 6 +PR_GET_KEEPCAPS 7 +PR_SET_KEEPCAPS 8 +PR_GET_FPEMU 9 +PR_SET_FPEMU 10 +PR_GET_FPEXC 11 +PR_SET_FPEXC 12 +PR_GET_TIMING 13 +PR_SET_TIMING 14 +PR_SET_NAME 15 +PR_GET_NAME 16 +PR_GET_ENDIAN 19 +PR_SET_ENDIAN 20 +PR_GET_SECCOMP 21 +PR_SET_SECCOMP 22 +PR_CAPBSET_READ 23 +PR_CAPBSET_DROP 24 +PR_GET_TSC 25 +PR_SET_TSC 26 +PR_GET_SECUREBITS 27 +PR_SET_SECUREBITS 28 +PR_SET_TIMERSLACK 29 +PR_GET_TIMERSLACK 30 +PR_TASK_PERF_EVENTS_DISABLE 31 +PR_TASK_PERF_EVENTS_ENABLE 32 +PR_MCE_KILL 33 +PR_MCE_KILL_GET 34 +PR_SET_MM 35 +PR_SET_PTRACER 0x59616d61 +PR_SET_CHILD_SUBREAPER 36 +PR_GET_CHILD_SUBREAPER 37 +PR_SET_NO_NEW_PRIVS 38 +PR_GET_NO_NEW_PRIVS 39 +PR_GET_TID_ADDRESS 40 +PR_SET_THP_DISABLE 41 +PR_GET_THP_DISABLE 42 +PR_MPX_ENABLE_MANAGEMENT 43 +PR_MPX_DISABLE_MANAGEMENT 44 +PR_SET_FP_MODE 45 +PR_GET_FP_MODE 46 +PR_CAP_AMBIENT 47 +PR_SET_VMA 0x53564d41 diff --git a/xlat/priorities.h b/xlat/priorities.h index 6d54326a..72c1a440 100644 --- a/xlat/priorities.h +++ b/xlat/priorities.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/priorities.in; do not edit. */ -static const struct xlat priorities[] = { +#ifdef IN_MPERS + +# error static const struct xlat priorities in mpers mode + +#else + +static +const struct xlat priorities[] = { #if defined(PRIO_PROCESS) || (defined(HAVE_DECL_PRIO_PROCESS) && HAVE_DECL_PRIO_PROCESS) - XLAT(PRIO_PROCESS), + XLAT(PRIO_PROCESS), #endif #if defined(PRIO_PGRP) || (defined(HAVE_DECL_PRIO_PGRP) && HAVE_DECL_PRIO_PGRP) - XLAT(PRIO_PGRP), + XLAT(PRIO_PGRP), #endif #if defined(PRIO_USER) || (defined(HAVE_DECL_PRIO_USER) && HAVE_DECL_PRIO_USER) - XLAT(PRIO_USER), + XLAT(PRIO_USER), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/ptp_flags_options.h b/xlat/ptp_flags_options.h index 87b34033..4ceffa65 100644 --- a/xlat/ptp_flags_options.h +++ b/xlat/ptp_flags_options.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptp_flags_options.in; do not edit. */ -static const struct xlat ptp_flags_options[] = { +#ifdef IN_MPERS + +# error static const struct xlat ptp_flags_options in mpers mode + +#else + +static +const struct xlat ptp_flags_options[] = { #if defined(PTP_ENABLE_FEATURE) || (defined(HAVE_DECL_PTP_ENABLE_FEATURE) && HAVE_DECL_PTP_ENABLE_FEATURE) - XLAT(PTP_ENABLE_FEATURE), + XLAT(PTP_ENABLE_FEATURE), #endif #if defined(PTP_RISING_EDGE) || (defined(HAVE_DECL_PTP_RISING_EDGE) && HAVE_DECL_PTP_RISING_EDGE) - XLAT(PTP_RISING_EDGE), + XLAT(PTP_RISING_EDGE), #endif #if defined(PTP_FALLING_EDGE) || (defined(HAVE_DECL_PTP_FALLING_EDGE) && HAVE_DECL_PTP_FALLING_EDGE) - XLAT(PTP_FALLING_EDGE), + XLAT(PTP_FALLING_EDGE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/ptrace_cmds.h b/xlat/ptrace_cmds.h index 02d6642a..ee9ebe22 100644 --- a/xlat/ptrace_cmds.h +++ b/xlat/ptrace_cmds.h @@ -1,98 +1,312 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptrace_cmds.in; do not edit. */ -static const struct xlat ptrace_cmds[] = { +#ifdef IN_MPERS + +# error static const struct xlat ptrace_cmds in mpers mode + +#else + +static +const struct xlat ptrace_cmds[] = { #if defined(PTRACE_TRACEME) || (defined(HAVE_DECL_PTRACE_TRACEME) && HAVE_DECL_PTRACE_TRACEME) - XLAT(PTRACE_TRACEME), + XLAT(PTRACE_TRACEME), #endif #if defined(PTRACE_PEEKTEXT) || (defined(HAVE_DECL_PTRACE_PEEKTEXT) && HAVE_DECL_PTRACE_PEEKTEXT) - XLAT(PTRACE_PEEKTEXT), + XLAT(PTRACE_PEEKTEXT), #endif #if defined(PTRACE_PEEKDATA) || (defined(HAVE_DECL_PTRACE_PEEKDATA) && HAVE_DECL_PTRACE_PEEKDATA) - XLAT(PTRACE_PEEKDATA), + XLAT(PTRACE_PEEKDATA), #endif #if defined(PTRACE_PEEKUSER) || (defined(HAVE_DECL_PTRACE_PEEKUSER) && HAVE_DECL_PTRACE_PEEKUSER) - XLAT(PTRACE_PEEKUSER), + XLAT(PTRACE_PEEKUSER), #endif #if defined(PTRACE_POKETEXT) || (defined(HAVE_DECL_PTRACE_POKETEXT) && HAVE_DECL_PTRACE_POKETEXT) - XLAT(PTRACE_POKETEXT), + XLAT(PTRACE_POKETEXT), #endif #if defined(PTRACE_POKEDATA) || (defined(HAVE_DECL_PTRACE_POKEDATA) && HAVE_DECL_PTRACE_POKEDATA) - XLAT(PTRACE_POKEDATA), + XLAT(PTRACE_POKEDATA), #endif #if defined(PTRACE_POKEUSER) || (defined(HAVE_DECL_PTRACE_POKEUSER) && HAVE_DECL_PTRACE_POKEUSER) - XLAT(PTRACE_POKEUSER), + XLAT(PTRACE_POKEUSER), #endif #if defined(PTRACE_CONT) || (defined(HAVE_DECL_PTRACE_CONT) && HAVE_DECL_PTRACE_CONT) - XLAT(PTRACE_CONT), + XLAT(PTRACE_CONT), #endif #if defined(PTRACE_KILL) || (defined(HAVE_DECL_PTRACE_KILL) && HAVE_DECL_PTRACE_KILL) - XLAT(PTRACE_KILL), + XLAT(PTRACE_KILL), #endif #if defined(PTRACE_SINGLESTEP) || (defined(HAVE_DECL_PTRACE_SINGLESTEP) && HAVE_DECL_PTRACE_SINGLESTEP) - XLAT(PTRACE_SINGLESTEP), + XLAT(PTRACE_SINGLESTEP), #endif #if defined(PTRACE_ATTACH) || (defined(HAVE_DECL_PTRACE_ATTACH) && HAVE_DECL_PTRACE_ATTACH) - XLAT(PTRACE_ATTACH), + XLAT(PTRACE_ATTACH), #endif #if defined(PTRACE_DETACH) || (defined(HAVE_DECL_PTRACE_DETACH) && HAVE_DECL_PTRACE_DETACH) - XLAT(PTRACE_DETACH), + XLAT(PTRACE_DETACH), +#endif +#if defined(PTRACE_SYSCALL) || (defined(HAVE_DECL_PTRACE_SYSCALL) && HAVE_DECL_PTRACE_SYSCALL) + XLAT(PTRACE_SYSCALL), #endif #if defined(PTRACE_GETREGS) || (defined(HAVE_DECL_PTRACE_GETREGS) && HAVE_DECL_PTRACE_GETREGS) - XLAT(PTRACE_GETREGS), + XLAT(PTRACE_GETREGS), #endif #if defined(PTRACE_SETREGS) || (defined(HAVE_DECL_PTRACE_SETREGS) && HAVE_DECL_PTRACE_SETREGS) - XLAT(PTRACE_SETREGS), + XLAT(PTRACE_SETREGS), #endif #if defined(PTRACE_GETFPREGS) || (defined(HAVE_DECL_PTRACE_GETFPREGS) && HAVE_DECL_PTRACE_GETFPREGS) - XLAT(PTRACE_GETFPREGS), + XLAT(PTRACE_GETFPREGS), #endif #if defined(PTRACE_SETFPREGS) || (defined(HAVE_DECL_PTRACE_SETFPREGS) && HAVE_DECL_PTRACE_SETFPREGS) - XLAT(PTRACE_SETFPREGS), + XLAT(PTRACE_SETFPREGS), #endif #if defined(PTRACE_GETFPXREGS) || (defined(HAVE_DECL_PTRACE_GETFPXREGS) && HAVE_DECL_PTRACE_GETFPXREGS) - XLAT(PTRACE_GETFPXREGS), + XLAT(PTRACE_GETFPXREGS), #endif #if defined(PTRACE_SETFPXREGS) || (defined(HAVE_DECL_PTRACE_SETFPXREGS) && HAVE_DECL_PTRACE_SETFPXREGS) - XLAT(PTRACE_SETFPXREGS), + XLAT(PTRACE_SETFPXREGS), #endif #if defined(PTRACE_GETVRREGS) || (defined(HAVE_DECL_PTRACE_GETVRREGS) && HAVE_DECL_PTRACE_GETVRREGS) - XLAT(PTRACE_GETVRREGS), + XLAT(PTRACE_GETVRREGS), #endif #if defined(PTRACE_SETVRREGS) || (defined(HAVE_DECL_PTRACE_SETVRREGS) && HAVE_DECL_PTRACE_SETVRREGS) - XLAT(PTRACE_SETVRREGS), + XLAT(PTRACE_SETVRREGS), #endif #if defined(PTRACE_SETOPTIONS) || (defined(HAVE_DECL_PTRACE_SETOPTIONS) && HAVE_DECL_PTRACE_SETOPTIONS) - XLAT(PTRACE_SETOPTIONS), + XLAT(PTRACE_SETOPTIONS), #endif #if defined(PTRACE_GETEVENTMSG) || (defined(HAVE_DECL_PTRACE_GETEVENTMSG) && HAVE_DECL_PTRACE_GETEVENTMSG) - XLAT(PTRACE_GETEVENTMSG), + XLAT(PTRACE_GETEVENTMSG), #endif #if defined(PTRACE_GETSIGINFO) || (defined(HAVE_DECL_PTRACE_GETSIGINFO) && HAVE_DECL_PTRACE_GETSIGINFO) - XLAT(PTRACE_GETSIGINFO), + XLAT(PTRACE_GETSIGINFO), #endif #if defined(PTRACE_SETSIGINFO) || (defined(HAVE_DECL_PTRACE_SETSIGINFO) && HAVE_DECL_PTRACE_SETSIGINFO) - XLAT(PTRACE_SETSIGINFO), + XLAT(PTRACE_SETSIGINFO), #endif #if defined(PTRACE_GETREGSET) || (defined(HAVE_DECL_PTRACE_GETREGSET) && HAVE_DECL_PTRACE_GETREGSET) - XLAT(PTRACE_GETREGSET), + XLAT(PTRACE_GETREGSET), #endif #if defined(PTRACE_SETREGSET) || (defined(HAVE_DECL_PTRACE_SETREGSET) && HAVE_DECL_PTRACE_SETREGSET) - XLAT(PTRACE_SETREGSET), + XLAT(PTRACE_SETREGSET), #endif #if defined(PTRACE_SET_SYSCALL) || (defined(HAVE_DECL_PTRACE_SET_SYSCALL) && HAVE_DECL_PTRACE_SET_SYSCALL) - XLAT(PTRACE_SET_SYSCALL), + XLAT(PTRACE_SET_SYSCALL), #endif #if defined(PTRACE_SEIZE) || (defined(HAVE_DECL_PTRACE_SEIZE) && HAVE_DECL_PTRACE_SEIZE) - XLAT(PTRACE_SEIZE), + XLAT(PTRACE_SEIZE), #endif #if defined(PTRACE_INTERRUPT) || (defined(HAVE_DECL_PTRACE_INTERRUPT) && HAVE_DECL_PTRACE_INTERRUPT) - XLAT(PTRACE_INTERRUPT), + XLAT(PTRACE_INTERRUPT), #endif #if defined(PTRACE_LISTEN) || (defined(HAVE_DECL_PTRACE_LISTEN) && HAVE_DECL_PTRACE_LISTEN) - XLAT(PTRACE_LISTEN), + XLAT(PTRACE_LISTEN), #endif -#if defined(PTRACE_SYSCALL) || (defined(HAVE_DECL_PTRACE_SYSCALL) && HAVE_DECL_PTRACE_SYSCALL) - XLAT(PTRACE_SYSCALL), +#if defined(PTRACE_PEEKSIGINFO) || (defined(HAVE_DECL_PTRACE_PEEKSIGINFO) && HAVE_DECL_PTRACE_PEEKSIGINFO) + XLAT(PTRACE_PEEKSIGINFO), +#endif +#if defined(PTRACE_GETSIGMASK) || (defined(HAVE_DECL_PTRACE_GETSIGMASK) && HAVE_DECL_PTRACE_GETSIGMASK) + XLAT(PTRACE_GETSIGMASK), +#endif +#if defined(PTRACE_SETSIGMASK) || (defined(HAVE_DECL_PTRACE_SETSIGMASK) && HAVE_DECL_PTRACE_SETSIGMASK) + XLAT(PTRACE_SETSIGMASK), +#endif +#if defined(PTRACE_SECCOMP_GET_FILTER) || (defined(HAVE_DECL_PTRACE_SECCOMP_GET_FILTER) && HAVE_DECL_PTRACE_SECCOMP_GET_FILTER) + XLAT(PTRACE_SECCOMP_GET_FILTER), +#endif +/* arch-specific */ +#if defined(PTRACE_GET_THREAD_AREA) || (defined(HAVE_DECL_PTRACE_GET_THREAD_AREA) && HAVE_DECL_PTRACE_GET_THREAD_AREA) + XLAT(PTRACE_GET_THREAD_AREA), +#endif +#if defined(PTRACE_SET_THREAD_AREA) || (defined(HAVE_DECL_PTRACE_SET_THREAD_AREA) && HAVE_DECL_PTRACE_SET_THREAD_AREA) + XLAT(PTRACE_SET_THREAD_AREA), +#endif +#if defined(PTRACE_OLDSETOPTIONS) || (defined(HAVE_DECL_PTRACE_OLDSETOPTIONS) && HAVE_DECL_PTRACE_OLDSETOPTIONS) + XLAT(PTRACE_OLDSETOPTIONS), +#endif +#if defined(PTRACE_GETFDPIC) || (defined(HAVE_DECL_PTRACE_GETFDPIC) && HAVE_DECL_PTRACE_GETFDPIC) + XLAT(PTRACE_GETFDPIC), +#endif +#if defined(PTRACE_SINGLEBLOCK) || (defined(HAVE_DECL_PTRACE_SINGLEBLOCK) && HAVE_DECL_PTRACE_SINGLEBLOCK) + XLAT(PTRACE_SINGLEBLOCK), +#endif +/* arm */ +#if defined(PTRACE_GETWMMXREGS) || (defined(HAVE_DECL_PTRACE_GETWMMXREGS) && HAVE_DECL_PTRACE_GETWMMXREGS) + XLAT(PTRACE_GETWMMXREGS), +#endif +#if defined(PTRACE_SETWMMXREGS) || (defined(HAVE_DECL_PTRACE_SETWMMXREGS) && HAVE_DECL_PTRACE_SETWMMXREGS) + XLAT(PTRACE_SETWMMXREGS), +#endif +#if defined(PTRACE_GETCRUNCHREGS) || (defined(HAVE_DECL_PTRACE_GETCRUNCHREGS) && HAVE_DECL_PTRACE_GETCRUNCHREGS) + XLAT(PTRACE_GETCRUNCHREGS), +#endif +#if defined(PTRACE_SETCRUNCHREGS) || (defined(HAVE_DECL_PTRACE_SETCRUNCHREGS) && HAVE_DECL_PTRACE_SETCRUNCHREGS) + XLAT(PTRACE_SETCRUNCHREGS), +#endif +#if defined(PTRACE_GETVFPREGS) || (defined(HAVE_DECL_PTRACE_GETVFPREGS) && HAVE_DECL_PTRACE_GETVFPREGS) + XLAT(PTRACE_GETVFPREGS), +#endif +#if defined(PTRACE_SETVFPREGS) || (defined(HAVE_DECL_PTRACE_SETVFPREGS) && HAVE_DECL_PTRACE_SETVFPREGS) + XLAT(PTRACE_SETVFPREGS), +#endif +#if defined(PTRACE_GETHBPREGS) || (defined(HAVE_DECL_PTRACE_GETHBPREGS) && HAVE_DECL_PTRACE_GETHBPREGS) + XLAT(PTRACE_GETHBPREGS), +#endif +#if defined(PTRACE_SETHBPREGS) || (defined(HAVE_DECL_PTRACE_SETHBPREGS) && HAVE_DECL_PTRACE_SETHBPREGS) + XLAT(PTRACE_SETHBPREGS), +#endif +/* ia64 */ +#if defined(PTRACE_OLD_GETSIGINFO) || (defined(HAVE_DECL_PTRACE_OLD_GETSIGINFO) && HAVE_DECL_PTRACE_OLD_GETSIGINFO) + XLAT(PTRACE_OLD_GETSIGINFO), +#endif +#if defined(PTRACE_OLD_SETSIGINFO) || (defined(HAVE_DECL_PTRACE_OLD_SETSIGINFO) && HAVE_DECL_PTRACE_OLD_SETSIGINFO) + XLAT(PTRACE_OLD_SETSIGINFO), +#endif +/* mips */ +#if defined(PTRACE_PEEKTEXT_3264) || (defined(HAVE_DECL_PTRACE_PEEKTEXT_3264) && HAVE_DECL_PTRACE_PEEKTEXT_3264) + XLAT(PTRACE_PEEKTEXT_3264), +#endif +#if defined(PTRACE_PEEKDATA_3264) || (defined(HAVE_DECL_PTRACE_PEEKDATA_3264) && HAVE_DECL_PTRACE_PEEKDATA_3264) + XLAT(PTRACE_PEEKDATA_3264), +#endif +#if defined(PTRACE_POKETEXT_3264) || (defined(HAVE_DECL_PTRACE_POKETEXT_3264) && HAVE_DECL_PTRACE_POKETEXT_3264) + XLAT(PTRACE_POKETEXT_3264), +#endif +#if defined(PTRACE_POKEDATA_3264) || (defined(HAVE_DECL_PTRACE_POKEDATA_3264) && HAVE_DECL_PTRACE_POKEDATA_3264) + XLAT(PTRACE_POKEDATA_3264), +#endif +#if defined(PTRACE_GET_THREAD_AREA_3264) || (defined(HAVE_DECL_PTRACE_GET_THREAD_AREA_3264) && HAVE_DECL_PTRACE_GET_THREAD_AREA_3264) + XLAT(PTRACE_GET_THREAD_AREA_3264), +#endif +#if defined(PTRACE_GET_WATCH_REGS) || (defined(HAVE_DECL_PTRACE_GET_WATCH_REGS) && HAVE_DECL_PTRACE_GET_WATCH_REGS) + XLAT(PTRACE_GET_WATCH_REGS), +#endif +#if defined(PTRACE_SET_WATCH_REGS) || (defined(HAVE_DECL_PTRACE_SET_WATCH_REGS) && HAVE_DECL_PTRACE_SET_WATCH_REGS) + XLAT(PTRACE_SET_WATCH_REGS), +#endif +/* powerpc */ +#if defined(PTRACE_GETEVRREGS) || (defined(HAVE_DECL_PTRACE_GETEVRREGS) && HAVE_DECL_PTRACE_GETEVRREGS) + XLAT(PTRACE_GETEVRREGS), +#endif +#if defined(PTRACE_SETEVRREGS) || (defined(HAVE_DECL_PTRACE_SETEVRREGS) && HAVE_DECL_PTRACE_SETEVRREGS) + XLAT(PTRACE_SETEVRREGS), +#endif +#if defined(PTRACE_GETVSRREGS) || (defined(HAVE_DECL_PTRACE_GETVSRREGS) && HAVE_DECL_PTRACE_GETVSRREGS) + XLAT(PTRACE_GETVSRREGS), +#endif +#if defined(PTRACE_SETVSRREGS) || (defined(HAVE_DECL_PTRACE_SETVSRREGS) && HAVE_DECL_PTRACE_SETVSRREGS) + XLAT(PTRACE_SETVSRREGS), +#endif +#if defined(PTRACE_GET_DEBUGREG) || (defined(HAVE_DECL_PTRACE_GET_DEBUGREG) && HAVE_DECL_PTRACE_GET_DEBUGREG) + XLAT(PTRACE_GET_DEBUGREG), #endif - XLAT_END +#if defined(PTRACE_SET_DEBUGREG) || (defined(HAVE_DECL_PTRACE_SET_DEBUGREG) && HAVE_DECL_PTRACE_SET_DEBUGREG) + XLAT(PTRACE_SET_DEBUGREG), +#endif +#if defined(PPC_PTRACE_GETHWDBGINFO) || (defined(HAVE_DECL_PPC_PTRACE_GETHWDBGINFO) && HAVE_DECL_PPC_PTRACE_GETHWDBGINFO) + XLAT(PPC_PTRACE_GETHWDBGINFO), +#endif +#if defined(PPC_PTRACE_SETHWDEBUG) || (defined(HAVE_DECL_PPC_PTRACE_SETHWDEBUG) && HAVE_DECL_PPC_PTRACE_SETHWDEBUG) + XLAT(PPC_PTRACE_SETHWDEBUG), +#endif +#if defined(PPC_PTRACE_DELHWDEBUG) || (defined(HAVE_DECL_PPC_PTRACE_DELHWDEBUG) && HAVE_DECL_PPC_PTRACE_DELHWDEBUG) + XLAT(PPC_PTRACE_DELHWDEBUG), +#endif +/* s390 */ +#if defined(PTRACE_PEEKUSR_AREA) || (defined(HAVE_DECL_PTRACE_PEEKUSR_AREA) && HAVE_DECL_PTRACE_PEEKUSR_AREA) + XLAT(PTRACE_PEEKUSR_AREA), +#endif +#if defined(PTRACE_POKEUSR_AREA) || (defined(HAVE_DECL_PTRACE_POKEUSR_AREA) && HAVE_DECL_PTRACE_POKEUSR_AREA) + XLAT(PTRACE_POKEUSR_AREA), +#endif +#if defined(PTRACE_PEEKTEXT_AREA) || (defined(HAVE_DECL_PTRACE_PEEKTEXT_AREA) && HAVE_DECL_PTRACE_PEEKTEXT_AREA) + XLAT(PTRACE_PEEKTEXT_AREA), +#endif +#if defined(PTRACE_PEEKDATA_AREA) || (defined(HAVE_DECL_PTRACE_PEEKDATA_AREA) && HAVE_DECL_PTRACE_PEEKDATA_AREA) + XLAT(PTRACE_PEEKDATA_AREA), +#endif +#if defined(PTRACE_POKETEXT_AREA) || (defined(HAVE_DECL_PTRACE_POKETEXT_AREA) && HAVE_DECL_PTRACE_POKETEXT_AREA) + XLAT(PTRACE_POKETEXT_AREA), +#endif +#if defined(PTRACE_POKEDATA_AREA) || (defined(HAVE_DECL_PTRACE_POKEDATA_AREA) && HAVE_DECL_PTRACE_POKEDATA_AREA) + XLAT(PTRACE_POKEDATA_AREA), +#endif +#if defined(PTRACE_GET_LAST_BREAK) || (defined(HAVE_DECL_PTRACE_GET_LAST_BREAK) && HAVE_DECL_PTRACE_GET_LAST_BREAK) + XLAT(PTRACE_GET_LAST_BREAK), +#endif +#if defined(PTRACE_PEEK_SYSTEM_CALL) || (defined(HAVE_DECL_PTRACE_PEEK_SYSTEM_CALL) && HAVE_DECL_PTRACE_PEEK_SYSTEM_CALL) + XLAT(PTRACE_PEEK_SYSTEM_CALL), +#endif +#if defined(PTRACE_POKE_SYSTEM_CALL) || (defined(HAVE_DECL_PTRACE_POKE_SYSTEM_CALL) && HAVE_DECL_PTRACE_POKE_SYSTEM_CALL) + XLAT(PTRACE_POKE_SYSTEM_CALL), +#endif +#if defined(PTRACE_ENABLE_TE) || (defined(HAVE_DECL_PTRACE_ENABLE_TE) && HAVE_DECL_PTRACE_ENABLE_TE) + XLAT(PTRACE_ENABLE_TE), +#endif +#if defined(PTRACE_DISABLE_TE) || (defined(HAVE_DECL_PTRACE_DISABLE_TE) && HAVE_DECL_PTRACE_DISABLE_TE) + XLAT(PTRACE_DISABLE_TE), +#endif +#if defined(PTRACE_TE_ABORT_RAND) || (defined(HAVE_DECL_PTRACE_TE_ABORT_RAND) && HAVE_DECL_PTRACE_TE_ABORT_RAND) + XLAT(PTRACE_TE_ABORT_RAND), +#endif +/* sh */ +#if defined(PTRACE_GETDSPREGS) || (defined(HAVE_DECL_PTRACE_GETDSPREGS) && HAVE_DECL_PTRACE_GETDSPREGS) + XLAT(PTRACE_GETDSPREGS), +#endif +#if defined(PTRACE_SETDSPREGS) || (defined(HAVE_DECL_PTRACE_SETDSPREGS) && HAVE_DECL_PTRACE_SETDSPREGS) + XLAT(PTRACE_SETDSPREGS), +#endif +/* sparc */ +#if defined(PTRACE_SPARC_DETACH) || (defined(HAVE_DECL_PTRACE_SPARC_DETACH) && HAVE_DECL_PTRACE_SPARC_DETACH) + XLAT(PTRACE_SPARC_DETACH), +#endif +#if defined(PTRACE_READDATA) || (defined(HAVE_DECL_PTRACE_READDATA) && HAVE_DECL_PTRACE_READDATA) + XLAT(PTRACE_READDATA), +#endif +#if defined(PTRACE_WRITEDATA) || (defined(HAVE_DECL_PTRACE_WRITEDATA) && HAVE_DECL_PTRACE_WRITEDATA) + XLAT(PTRACE_WRITEDATA), +#endif +#if defined(PTRACE_READTEXT) || (defined(HAVE_DECL_PTRACE_READTEXT) && HAVE_DECL_PTRACE_READTEXT) + XLAT(PTRACE_READTEXT), +#endif +#if defined(PTRACE_WRITETEXT) || (defined(HAVE_DECL_PTRACE_WRITETEXT) && HAVE_DECL_PTRACE_WRITETEXT) + XLAT(PTRACE_WRITETEXT), +#endif +#if defined(PTRACE_GETFPAREGS) || (defined(HAVE_DECL_PTRACE_GETFPAREGS) && HAVE_DECL_PTRACE_GETFPAREGS) + XLAT(PTRACE_GETFPAREGS), +#endif +#if defined(PTRACE_SETFPAREGS) || (defined(HAVE_DECL_PTRACE_SETFPAREGS) && HAVE_DECL_PTRACE_SETFPAREGS) + XLAT(PTRACE_SETFPAREGS), +#endif +#if defined(PTRACE_GETREGS64) || (defined(HAVE_DECL_PTRACE_GETREGS64) && HAVE_DECL_PTRACE_GETREGS64) + XLAT(PTRACE_GETREGS64), +#endif +#if defined(PTRACE_SETREGS64) || (defined(HAVE_DECL_PTRACE_SETREGS64) && HAVE_DECL_PTRACE_SETREGS64) + XLAT(PTRACE_SETREGS64), +#endif +#if defined(PTRACE_GETFPREGS64) || (defined(HAVE_DECL_PTRACE_GETFPREGS64) && HAVE_DECL_PTRACE_GETFPREGS64) + XLAT(PTRACE_GETFPREGS64), +#endif +#if defined(PTRACE_SETFPREGS64) || (defined(HAVE_DECL_PTRACE_SETFPREGS64) && HAVE_DECL_PTRACE_SETFPREGS64) + XLAT(PTRACE_SETFPREGS64), +#endif +/* x86 */ +#if defined(PTRACE_ARCH_PRCTL) || (defined(HAVE_DECL_PTRACE_ARCH_PRCTL) && HAVE_DECL_PTRACE_ARCH_PRCTL) + XLAT(PTRACE_ARCH_PRCTL), +#endif +#if defined(PTRACE_SYSEMU) || (defined(HAVE_DECL_PTRACE_SYSEMU) && HAVE_DECL_PTRACE_SYSEMU) + XLAT(PTRACE_SYSEMU), +#endif +#if defined(PTRACE_SYSEMU_SINGLESTEP) || (defined(HAVE_DECL_PTRACE_SYSEMU_SINGLESTEP) && HAVE_DECL_PTRACE_SYSEMU_SINGLESTEP) + XLAT(PTRACE_SYSEMU_SINGLESTEP), +#endif +/* xtensa */ +#if defined(PTRACE_GETXTREGS) || (defined(HAVE_DECL_PTRACE_GETXTREGS) && HAVE_DECL_PTRACE_GETXTREGS) + XLAT(PTRACE_GETXTREGS), +#endif +#if defined(PTRACE_SETXTREGS) || (defined(HAVE_DECL_PTRACE_SETXTREGS) && HAVE_DECL_PTRACE_SETXTREGS) + XLAT(PTRACE_SETXTREGS), +#endif + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/ptrace_cmds.in b/xlat/ptrace_cmds.in index bf11ea41..525494da 100644 --- a/xlat/ptrace_cmds.in +++ b/xlat/ptrace_cmds.in @@ -10,6 +10,7 @@ PTRACE_KILL PTRACE_SINGLESTEP PTRACE_ATTACH PTRACE_DETACH +PTRACE_SYSCALL PTRACE_GETREGS PTRACE_SETREGS PTRACE_GETFPREGS @@ -28,4 +29,78 @@ PTRACE_SET_SYSCALL PTRACE_SEIZE PTRACE_INTERRUPT PTRACE_LISTEN -PTRACE_SYSCALL +PTRACE_PEEKSIGINFO +PTRACE_GETSIGMASK +PTRACE_SETSIGMASK +PTRACE_SECCOMP_GET_FILTER +/* arch-specific */ +PTRACE_GET_THREAD_AREA +PTRACE_SET_THREAD_AREA +PTRACE_OLDSETOPTIONS +PTRACE_GETFDPIC +PTRACE_SINGLEBLOCK +/* arm */ +PTRACE_GETWMMXREGS +PTRACE_SETWMMXREGS +PTRACE_GETCRUNCHREGS +PTRACE_SETCRUNCHREGS +PTRACE_GETVFPREGS +PTRACE_SETVFPREGS +PTRACE_GETHBPREGS +PTRACE_SETHBPREGS +/* ia64 */ +PTRACE_OLD_GETSIGINFO +PTRACE_OLD_SETSIGINFO +/* mips */ +PTRACE_PEEKTEXT_3264 +PTRACE_PEEKDATA_3264 +PTRACE_POKETEXT_3264 +PTRACE_POKEDATA_3264 +PTRACE_GET_THREAD_AREA_3264 +PTRACE_GET_WATCH_REGS +PTRACE_SET_WATCH_REGS +/* powerpc */ +PTRACE_GETEVRREGS +PTRACE_SETEVRREGS +PTRACE_GETVSRREGS +PTRACE_SETVSRREGS +PTRACE_GET_DEBUGREG +PTRACE_SET_DEBUGREG +PPC_PTRACE_GETHWDBGINFO +PPC_PTRACE_SETHWDEBUG +PPC_PTRACE_DELHWDEBUG +/* s390 */ +PTRACE_PEEKUSR_AREA +PTRACE_POKEUSR_AREA +PTRACE_PEEKTEXT_AREA +PTRACE_PEEKDATA_AREA +PTRACE_POKETEXT_AREA +PTRACE_POKEDATA_AREA +PTRACE_GET_LAST_BREAK +PTRACE_PEEK_SYSTEM_CALL +PTRACE_POKE_SYSTEM_CALL +PTRACE_ENABLE_TE +PTRACE_DISABLE_TE +PTRACE_TE_ABORT_RAND +/* sh */ +PTRACE_GETDSPREGS +PTRACE_SETDSPREGS +/* sparc */ +PTRACE_SPARC_DETACH +PTRACE_READDATA +PTRACE_WRITEDATA +PTRACE_READTEXT +PTRACE_WRITETEXT +PTRACE_GETFPAREGS +PTRACE_SETFPAREGS +PTRACE_GETREGS64 +PTRACE_SETREGS64 +PTRACE_GETFPREGS64 +PTRACE_SETFPREGS64 +/* x86 */ +PTRACE_ARCH_PRCTL +PTRACE_SYSEMU +PTRACE_SYSEMU_SINGLESTEP +/* xtensa */ +PTRACE_GETXTREGS +PTRACE_SETXTREGS diff --git a/xlat/ptrace_events.h b/xlat/ptrace_events.h new file mode 100644 index 00000000..a466f105 --- /dev/null +++ b/xlat/ptrace_events.h @@ -0,0 +1,42 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ptrace_events.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat ptrace_events in mpers mode + +#else + +static +const struct xlat ptrace_events[] = { +#if defined(PTRACE_EVENT_FORK) || (defined(HAVE_DECL_PTRACE_EVENT_FORK) && HAVE_DECL_PTRACE_EVENT_FORK) + XLAT(PTRACE_EVENT_FORK), +#endif +#if defined(PTRACE_EVENT_VFORK) || (defined(HAVE_DECL_PTRACE_EVENT_VFORK) && HAVE_DECL_PTRACE_EVENT_VFORK) + XLAT(PTRACE_EVENT_VFORK), +#endif +#if defined(PTRACE_EVENT_CLONE) || (defined(HAVE_DECL_PTRACE_EVENT_CLONE) && HAVE_DECL_PTRACE_EVENT_CLONE) + XLAT(PTRACE_EVENT_CLONE), +#endif +#if defined(PTRACE_EVENT_EXEC) || (defined(HAVE_DECL_PTRACE_EVENT_EXEC) && HAVE_DECL_PTRACE_EVENT_EXEC) + XLAT(PTRACE_EVENT_EXEC), +#endif +#if defined(PTRACE_EVENT_VFORK_DONE) || (defined(HAVE_DECL_PTRACE_EVENT_VFORK_DONE) && HAVE_DECL_PTRACE_EVENT_VFORK_DONE) + XLAT(PTRACE_EVENT_VFORK_DONE), +#endif +#if defined(PTRACE_EVENT_EXIT) || (defined(HAVE_DECL_PTRACE_EVENT_EXIT) && HAVE_DECL_PTRACE_EVENT_EXIT) + XLAT(PTRACE_EVENT_EXIT), +#endif +#if defined(PTRACE_EVENT_SECCOMP) || (defined(HAVE_DECL_PTRACE_EVENT_SECCOMP) && HAVE_DECL_PTRACE_EVENT_SECCOMP) + XLAT(PTRACE_EVENT_SECCOMP), +#endif +#if defined(PTRACE_EVENT_STOP) || (defined(HAVE_DECL_PTRACE_EVENT_STOP) && HAVE_DECL_PTRACE_EVENT_STOP) + XLAT(PTRACE_EVENT_STOP), +#endif +/* tile */ +#if defined(PTRACE_EVENT_MIGRATE) || (defined(HAVE_DECL_PTRACE_EVENT_MIGRATE) && HAVE_DECL_PTRACE_EVENT_MIGRATE) + XLAT(PTRACE_EVENT_MIGRATE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/ptrace_events.in b/xlat/ptrace_events.in new file mode 100644 index 00000000..a772e3c1 --- /dev/null +++ b/xlat/ptrace_events.in @@ -0,0 +1,10 @@ +PTRACE_EVENT_FORK +PTRACE_EVENT_VFORK +PTRACE_EVENT_CLONE +PTRACE_EVENT_EXEC +PTRACE_EVENT_VFORK_DONE +PTRACE_EVENT_EXIT +PTRACE_EVENT_SECCOMP +PTRACE_EVENT_STOP +/* tile */ +PTRACE_EVENT_MIGRATE diff --git a/xlat/ptrace_peeksiginfo_flags.h b/xlat/ptrace_peeksiginfo_flags.h new file mode 100644 index 00000000..c6152b77 --- /dev/null +++ b/xlat/ptrace_peeksiginfo_flags.h @@ -0,0 +1,18 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ptrace_peeksiginfo_flags.in; do not edit. */ +#if !(defined(PTRACE_PEEKSIGINFO_SHARED) || (defined(HAVE_DECL_PTRACE_PEEKSIGINFO_SHARED) && HAVE_DECL_PTRACE_PEEKSIGINFO_SHARED)) +# define PTRACE_PEEKSIGINFO_SHARED 1 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat ptrace_peeksiginfo_flags in mpers mode + +#else + +static +const struct xlat ptrace_peeksiginfo_flags[] = { + XLAT(PTRACE_PEEKSIGINFO_SHARED), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/ptrace_peeksiginfo_flags.in b/xlat/ptrace_peeksiginfo_flags.in new file mode 100644 index 00000000..28a4c222 --- /dev/null +++ b/xlat/ptrace_peeksiginfo_flags.in @@ -0,0 +1 @@ +PTRACE_PEEKSIGINFO_SHARED 1 diff --git a/xlat/ptrace_setoptions_flags.h b/xlat/ptrace_setoptions_flags.h index 9ea554e7..4eaca067 100644 --- a/xlat/ptrace_setoptions_flags.h +++ b/xlat/ptrace_setoptions_flags.h @@ -1,32 +1,48 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptrace_setoptions_flags.in; do not edit. */ -static const struct xlat ptrace_setoptions_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat ptrace_setoptions_flags in mpers mode + +#else + +static +const struct xlat ptrace_setoptions_flags[] = { #if defined(PTRACE_O_TRACESYSGOOD) || (defined(HAVE_DECL_PTRACE_O_TRACESYSGOOD) && HAVE_DECL_PTRACE_O_TRACESYSGOOD) - XLAT(PTRACE_O_TRACESYSGOOD), + XLAT(PTRACE_O_TRACESYSGOOD), #endif #if defined(PTRACE_O_TRACEFORK) || (defined(HAVE_DECL_PTRACE_O_TRACEFORK) && HAVE_DECL_PTRACE_O_TRACEFORK) - XLAT(PTRACE_O_TRACEFORK), + XLAT(PTRACE_O_TRACEFORK), #endif #if defined(PTRACE_O_TRACEVFORK) || (defined(HAVE_DECL_PTRACE_O_TRACEVFORK) && HAVE_DECL_PTRACE_O_TRACEVFORK) - XLAT(PTRACE_O_TRACEVFORK), + XLAT(PTRACE_O_TRACEVFORK), #endif #if defined(PTRACE_O_TRACECLONE) || (defined(HAVE_DECL_PTRACE_O_TRACECLONE) && HAVE_DECL_PTRACE_O_TRACECLONE) - XLAT(PTRACE_O_TRACECLONE), + XLAT(PTRACE_O_TRACECLONE), #endif #if defined(PTRACE_O_TRACEEXEC) || (defined(HAVE_DECL_PTRACE_O_TRACEEXEC) && HAVE_DECL_PTRACE_O_TRACEEXEC) - XLAT(PTRACE_O_TRACEEXEC), + XLAT(PTRACE_O_TRACEEXEC), #endif #if defined(PTRACE_O_TRACEVFORKDONE) || (defined(HAVE_DECL_PTRACE_O_TRACEVFORKDONE) && HAVE_DECL_PTRACE_O_TRACEVFORKDONE) - XLAT(PTRACE_O_TRACEVFORKDONE), + XLAT(PTRACE_O_TRACEVFORKDONE), #endif #if defined(PTRACE_O_TRACEEXIT) || (defined(HAVE_DECL_PTRACE_O_TRACEEXIT) && HAVE_DECL_PTRACE_O_TRACEEXIT) - XLAT(PTRACE_O_TRACEEXIT), + XLAT(PTRACE_O_TRACEEXIT), #endif #if defined(PTRACE_O_TRACESECCOMP) || (defined(HAVE_DECL_PTRACE_O_TRACESECCOMP) && HAVE_DECL_PTRACE_O_TRACESECCOMP) - XLAT(PTRACE_O_TRACESECCOMP), + XLAT(PTRACE_O_TRACESECCOMP), #endif #if defined(PTRACE_O_EXITKILL) || (defined(HAVE_DECL_PTRACE_O_EXITKILL) && HAVE_DECL_PTRACE_O_EXITKILL) - XLAT(PTRACE_O_EXITKILL), + XLAT(PTRACE_O_EXITKILL), #endif - XLAT_END +#if defined(PTRACE_O_SUSPEND_SECCOMP) || (defined(HAVE_DECL_PTRACE_O_SUSPEND_SECCOMP) && HAVE_DECL_PTRACE_O_SUSPEND_SECCOMP) + XLAT(PTRACE_O_SUSPEND_SECCOMP), +#endif +/* tile */ +#if defined(PTRACE_O_TRACEMIGRATE) || (defined(HAVE_DECL_PTRACE_O_TRACEMIGRATE) && HAVE_DECL_PTRACE_O_TRACEMIGRATE) + XLAT(PTRACE_O_TRACEMIGRATE), +#endif + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/ptrace_setoptions_flags.in b/xlat/ptrace_setoptions_flags.in index d8cfa2fc..8610c86d 100644 --- a/xlat/ptrace_setoptions_flags.in +++ b/xlat/ptrace_setoptions_flags.in @@ -7,3 +7,6 @@ PTRACE_O_TRACEVFORKDONE PTRACE_O_TRACEEXIT PTRACE_O_TRACESECCOMP PTRACE_O_EXITKILL +PTRACE_O_SUSPEND_SECCOMP +/* tile */ +PTRACE_O_TRACEMIGRATE diff --git a/xlat/qm_which.h b/xlat/qm_which.h deleted file mode 100644 index 8de83b96..00000000 --- a/xlat/qm_which.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/qm_which.in; do not edit. */ - -static const struct xlat qm_which[] = { - XLAT(0), -#if defined(QM_MODULES) || (defined(HAVE_DECL_QM_MODULES) && HAVE_DECL_QM_MODULES) - XLAT(QM_MODULES), -#endif -#if defined(QM_DEPS) || (defined(HAVE_DECL_QM_DEPS) && HAVE_DECL_QM_DEPS) - XLAT(QM_DEPS), -#endif -#if defined(QM_REFS) || (defined(HAVE_DECL_QM_REFS) && HAVE_DECL_QM_REFS) - XLAT(QM_REFS), -#endif -#if defined(QM_SYMBOLS) || (defined(HAVE_DECL_QM_SYMBOLS) && HAVE_DECL_QM_SYMBOLS) - XLAT(QM_SYMBOLS), -#endif -#if defined(QM_INFO) || (defined(HAVE_DECL_QM_INFO) && HAVE_DECL_QM_INFO) - XLAT(QM_INFO), -#endif - XLAT_END -}; diff --git a/xlat/qm_which.in b/xlat/qm_which.in deleted file mode 100644 index b0325546..00000000 --- a/xlat/qm_which.in +++ /dev/null @@ -1,6 +0,0 @@ -0 -QM_MODULES -QM_DEPS -QM_REFS -QM_SYMBOLS -QM_INFO diff --git a/xlat/quota_formats.h b/xlat/quota_formats.h index 998dffc3..37f40271 100644 --- a/xlat/quota_formats.h +++ b/xlat/quota_formats.h @@ -1,11 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/quota_formats.in; do not edit. */ - -static const struct xlat quota_formats[] = { -#if defined(QFMT_VFS_OLD) || (defined(HAVE_DECL_QFMT_VFS_OLD) && HAVE_DECL_QFMT_VFS_OLD) - XLAT(QFMT_VFS_OLD), +#if !(defined(QFMT_VFS_OLD) || (defined(HAVE_DECL_QFMT_VFS_OLD) && HAVE_DECL_QFMT_VFS_OLD)) +# define QFMT_VFS_OLD 1 +#endif +#if !(defined(QFMT_VFS_V0) || (defined(HAVE_DECL_QFMT_VFS_V0) && HAVE_DECL_QFMT_VFS_V0)) +# define QFMT_VFS_V0 2 #endif -#if defined(QFMT_VFS_V0) || (defined(HAVE_DECL_QFMT_VFS_V0) && HAVE_DECL_QFMT_VFS_V0) - XLAT(QFMT_VFS_V0), +#if !(defined(QFMT_OCFS2) || (defined(HAVE_DECL_QFMT_OCFS2) && HAVE_DECL_QFMT_OCFS2)) +# define QFMT_OCFS2 3 #endif - XLAT_END +#if !(defined(QFMT_VFS_V1) || (defined(HAVE_DECL_QFMT_VFS_V1) && HAVE_DECL_QFMT_VFS_V1)) +# define QFMT_VFS_V1 4 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat quota_formats in mpers mode + +#else + +static +const struct xlat quota_formats[] = { + XLAT(QFMT_VFS_OLD), + XLAT(QFMT_VFS_V0), + XLAT(QFMT_OCFS2), + XLAT(QFMT_VFS_V1), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/quota_formats.in b/xlat/quota_formats.in index c02687dc..dcbbb61c 100644 --- a/xlat/quota_formats.in +++ b/xlat/quota_formats.in @@ -1,2 +1,4 @@ -QFMT_VFS_OLD -QFMT_VFS_V0 +QFMT_VFS_OLD 1 +QFMT_VFS_V0 2 +QFMT_OCFS2 3 +QFMT_VFS_V1 4 diff --git a/xlat/quotacmds.h b/xlat/quotacmds.h index 7511402a..675cde9d 100644 --- a/xlat/quotacmds.h +++ b/xlat/quotacmds.h @@ -1,101 +1,157 @@ /* Generated by ./xlat/gen.sh from ./xlat/quotacmds.in; do not edit. */ - -static const struct xlat quotacmds[] = { -#if defined(Q_V1_QUOTAON) || (defined(HAVE_DECL_Q_V1_QUOTAON) && HAVE_DECL_Q_V1_QUOTAON) - XLAT(Q_V1_QUOTAON), +#if !(defined(Q_V1_QUOTAON) || (defined(HAVE_DECL_Q_V1_QUOTAON) && HAVE_DECL_Q_V1_QUOTAON)) +# define Q_V1_QUOTAON OLD_CMD(0x1) +#endif +#if !(defined(Q_V1_QUOTAOFF) || (defined(HAVE_DECL_Q_V1_QUOTAOFF) && HAVE_DECL_Q_V1_QUOTAOFF)) +# define Q_V1_QUOTAOFF OLD_CMD(0x2) +#endif +#if !(defined(Q_V1_GETQUOTA) || (defined(HAVE_DECL_Q_V1_GETQUOTA) && HAVE_DECL_Q_V1_GETQUOTA)) +# define Q_V1_GETQUOTA OLD_CMD(0x3) #endif -#if defined(Q_V1_QUOTAOFF) || (defined(HAVE_DECL_Q_V1_QUOTAOFF) && HAVE_DECL_Q_V1_QUOTAOFF) - XLAT(Q_V1_QUOTAOFF), +#if !(defined(Q_V1_SETQUOTA) || (defined(HAVE_DECL_Q_V1_SETQUOTA) && HAVE_DECL_Q_V1_SETQUOTA)) +# define Q_V1_SETQUOTA OLD_CMD(0x4) #endif -#if defined(Q_V1_GETQUOTA) || (defined(HAVE_DECL_Q_V1_GETQUOTA) && HAVE_DECL_Q_V1_GETQUOTA) - XLAT(Q_V1_GETQUOTA), +#if !(defined(Q_V1_SETUSE) || (defined(HAVE_DECL_Q_V1_SETUSE) && HAVE_DECL_Q_V1_SETUSE)) +# define Q_V1_SETUSE OLD_CMD(0x5) #endif -#if defined(Q_V1_SETQUOTA) || (defined(HAVE_DECL_Q_V1_SETQUOTA) && HAVE_DECL_Q_V1_SETQUOTA) - XLAT(Q_V1_SETQUOTA), +#if !(defined(Q_V1_SYNC) || (defined(HAVE_DECL_Q_V1_SYNC) && HAVE_DECL_Q_V1_SYNC)) +# define Q_V1_SYNC OLD_CMD(0x6) #endif -#if defined(Q_V1_SETUSE) || (defined(HAVE_DECL_Q_V1_SETUSE) && HAVE_DECL_Q_V1_SETUSE) - XLAT(Q_V1_SETUSE), +#if !(defined(Q_SETQLIM) || (defined(HAVE_DECL_Q_SETQLIM) && HAVE_DECL_Q_SETQLIM)) +# define Q_SETQLIM OLD_CMD(0x7) #endif -#if defined(Q_V1_SYNC) || (defined(HAVE_DECL_Q_V1_SYNC) && HAVE_DECL_Q_V1_SYNC) - XLAT(Q_V1_SYNC), +#if !(defined(Q_V1_GETSTATS) || (defined(HAVE_DECL_Q_V1_GETSTATS) && HAVE_DECL_Q_V1_GETSTATS)) +# define Q_V1_GETSTATS OLD_CMD(0x8) #endif -#if defined(Q_SETQLIM) || (defined(HAVE_DECL_Q_SETQLIM) && HAVE_DECL_Q_SETQLIM) - XLAT(Q_SETQLIM), +#if !(defined(Q_V1_RSQUASH) || (defined(HAVE_DECL_Q_V1_RSQUASH) && HAVE_DECL_Q_V1_RSQUASH)) +# define Q_V1_RSQUASH OLD_CMD(0x10) #endif -#if defined(Q_V1_GETSTATS) || (defined(HAVE_DECL_Q_V1_GETSTATS) && HAVE_DECL_Q_V1_GETSTATS) - XLAT(Q_V1_GETSTATS), +#if !(defined(Q_V2_GETQUOTA) || (defined(HAVE_DECL_Q_V2_GETQUOTA) && HAVE_DECL_Q_V2_GETQUOTA)) +# define Q_V2_GETQUOTA OLD_CMD(0xD) #endif -#if defined(Q_V1_RSQUASH) || (defined(HAVE_DECL_Q_V1_RSQUASH) && HAVE_DECL_Q_V1_RSQUASH) - XLAT(Q_V1_RSQUASH), +#if !(defined(Q_V2_SETQUOTA) || (defined(HAVE_DECL_Q_V2_SETQUOTA) && HAVE_DECL_Q_V2_SETQUOTA)) +# define Q_V2_SETQUOTA OLD_CMD(0xE) #endif -#if defined(Q_V2_GETQUOTA) || (defined(HAVE_DECL_Q_V2_GETQUOTA) && HAVE_DECL_Q_V2_GETQUOTA) - XLAT(Q_V2_GETQUOTA), +#if !(defined(Q_V2_SETUSE) || (defined(HAVE_DECL_Q_V2_SETUSE) && HAVE_DECL_Q_V2_SETUSE)) +# define Q_V2_SETUSE OLD_CMD(0xF) #endif -#if defined(Q_V2_SETQUOTA) || (defined(HAVE_DECL_Q_V2_SETQUOTA) && HAVE_DECL_Q_V2_SETQUOTA) - XLAT(Q_V2_SETQUOTA), +#if !(defined(Q_V2_GETINFO) || (defined(HAVE_DECL_Q_V2_GETINFO) && HAVE_DECL_Q_V2_GETINFO)) +# define Q_V2_GETINFO OLD_CMD(0x9) #endif -#if defined(Q_V2_SETUSE) || (defined(HAVE_DECL_Q_V2_SETUSE) && HAVE_DECL_Q_V2_SETUSE) - XLAT(Q_V2_SETUSE), +#if !(defined(Q_V2_SETINFO) || (defined(HAVE_DECL_Q_V2_SETINFO) && HAVE_DECL_Q_V2_SETINFO)) +# define Q_V2_SETINFO OLD_CMD(0xA) #endif -#if defined(Q_V2_GETINFO) || (defined(HAVE_DECL_Q_V2_GETINFO) && HAVE_DECL_Q_V2_GETINFO) - XLAT(Q_V2_GETINFO), +#if !(defined(Q_V2_SETGRACE) || (defined(HAVE_DECL_Q_V2_SETGRACE) && HAVE_DECL_Q_V2_SETGRACE)) +# define Q_V2_SETGRACE OLD_CMD(0xB) #endif -#if defined(Q_V2_SETINFO) || (defined(HAVE_DECL_Q_V2_SETINFO) && HAVE_DECL_Q_V2_SETINFO) - XLAT(Q_V2_SETINFO), +#if !(defined(Q_V2_SETFLAGS) || (defined(HAVE_DECL_Q_V2_SETFLAGS) && HAVE_DECL_Q_V2_SETFLAGS)) +# define Q_V2_SETFLAGS OLD_CMD(0xC) #endif -#if defined(Q_V2_SETGRACE) || (defined(HAVE_DECL_Q_V2_SETGRACE) && HAVE_DECL_Q_V2_SETGRACE) - XLAT(Q_V2_SETGRACE), +#if !(defined(Q_V2_GETSTATS) || (defined(HAVE_DECL_Q_V2_GETSTATS) && HAVE_DECL_Q_V2_GETSTATS)) +# define Q_V2_GETSTATS OLD_CMD(0x11) #endif -#if defined(Q_V2_SETFLAGS) || (defined(HAVE_DECL_Q_V2_SETFLAGS) && HAVE_DECL_Q_V2_SETFLAGS) - XLAT(Q_V2_SETFLAGS), +#if !(defined(Q_SYNC) || (defined(HAVE_DECL_Q_SYNC) && HAVE_DECL_Q_SYNC)) +# define Q_SYNC NEW_CMD(0x1) #endif -#if defined(Q_V2_GETSTATS) || (defined(HAVE_DECL_Q_V2_GETSTATS) && HAVE_DECL_Q_V2_GETSTATS) - XLAT(Q_V2_GETSTATS), +#if !(defined(Q_QUOTAON) || (defined(HAVE_DECL_Q_QUOTAON) && HAVE_DECL_Q_QUOTAON)) +# define Q_QUOTAON NEW_CMD(0x2) #endif -#if defined(Q_SYNC) || (defined(HAVE_DECL_Q_SYNC) && HAVE_DECL_Q_SYNC) - XLAT(Q_SYNC), +#if !(defined(Q_QUOTAOFF) || (defined(HAVE_DECL_Q_QUOTAOFF) && HAVE_DECL_Q_QUOTAOFF)) +# define Q_QUOTAOFF NEW_CMD(0x3) #endif -#if defined(Q_QUOTAON) || (defined(HAVE_DECL_Q_QUOTAON) && HAVE_DECL_Q_QUOTAON) - XLAT(Q_QUOTAON), +#if !(defined(Q_GETFMT) || (defined(HAVE_DECL_Q_GETFMT) && HAVE_DECL_Q_GETFMT)) +# define Q_GETFMT NEW_CMD(0x4) #endif -#if defined(Q_QUOTAOFF) || (defined(HAVE_DECL_Q_QUOTAOFF) && HAVE_DECL_Q_QUOTAOFF) - XLAT(Q_QUOTAOFF), +#if !(defined(Q_GETINFO) || (defined(HAVE_DECL_Q_GETINFO) && HAVE_DECL_Q_GETINFO)) +# define Q_GETINFO NEW_CMD(0x5) #endif -#if defined(Q_GETFMT) || (defined(HAVE_DECL_Q_GETFMT) && HAVE_DECL_Q_GETFMT) - XLAT(Q_GETFMT), +#if !(defined(Q_SETINFO) || (defined(HAVE_DECL_Q_SETINFO) && HAVE_DECL_Q_SETINFO)) +# define Q_SETINFO NEW_CMD(0x6) #endif -#if defined(Q_GETINFO) || (defined(HAVE_DECL_Q_GETINFO) && HAVE_DECL_Q_GETINFO) - XLAT(Q_GETINFO), +#if !(defined(Q_GETQUOTA) || (defined(HAVE_DECL_Q_GETQUOTA) && HAVE_DECL_Q_GETQUOTA)) +# define Q_GETQUOTA NEW_CMD(0x7) #endif -#if defined(Q_SETINFO) || (defined(HAVE_DECL_Q_SETINFO) && HAVE_DECL_Q_SETINFO) - XLAT(Q_SETINFO), +#if !(defined(Q_SETQUOTA) || (defined(HAVE_DECL_Q_SETQUOTA) && HAVE_DECL_Q_SETQUOTA)) +# define Q_SETQUOTA NEW_CMD(0x8) #endif -#if defined(Q_GETQUOTA) || (defined(HAVE_DECL_Q_GETQUOTA) && HAVE_DECL_Q_GETQUOTA) - XLAT(Q_GETQUOTA), +#if !(defined(Q_GETNEXTQUOTA) || (defined(HAVE_DECL_Q_GETNEXTQUOTA) && HAVE_DECL_Q_GETNEXTQUOTA)) +# define Q_GETNEXTQUOTA NEW_CMD(0x9) #endif -#if defined(Q_SETQUOTA) || (defined(HAVE_DECL_Q_SETQUOTA) && HAVE_DECL_Q_SETQUOTA) - XLAT(Q_SETQUOTA), +#if !(defined(Q_XQUOTAON) || (defined(HAVE_DECL_Q_XQUOTAON) && HAVE_DECL_Q_XQUOTAON)) +# define Q_XQUOTAON XQM_CMD(0x1) #endif -#if defined(Q_XQUOTAON) || (defined(HAVE_DECL_Q_XQUOTAON) && HAVE_DECL_Q_XQUOTAON) - XLAT(Q_XQUOTAON), +#if !(defined(Q_XQUOTAOFF) || (defined(HAVE_DECL_Q_XQUOTAOFF) && HAVE_DECL_Q_XQUOTAOFF)) +# define Q_XQUOTAOFF XQM_CMD(0x2) #endif -#if defined(Q_XQUOTAOFF) || (defined(HAVE_DECL_Q_XQUOTAOFF) && HAVE_DECL_Q_XQUOTAOFF) - XLAT(Q_XQUOTAOFF), +#if !(defined(Q_XGETQUOTA) || (defined(HAVE_DECL_Q_XGETQUOTA) && HAVE_DECL_Q_XGETQUOTA)) +# define Q_XGETQUOTA XQM_CMD(0x3) #endif -#if defined(Q_XGETQUOTA) || (defined(HAVE_DECL_Q_XGETQUOTA) && HAVE_DECL_Q_XGETQUOTA) - XLAT(Q_XGETQUOTA), +#if !(defined(Q_XSETQLIM) || (defined(HAVE_DECL_Q_XSETQLIM) && HAVE_DECL_Q_XSETQLIM)) +# define Q_XSETQLIM XQM_CMD(0x4) #endif -#if defined(Q_XSETQLIM) || (defined(HAVE_DECL_Q_XSETQLIM) && HAVE_DECL_Q_XSETQLIM) - XLAT(Q_XSETQLIM), +#if !(defined(Q_XGETQSTAT) || (defined(HAVE_DECL_Q_XGETQSTAT) && HAVE_DECL_Q_XGETQSTAT)) +# define Q_XGETQSTAT XQM_CMD(0x5) #endif -#if defined(Q_XGETQSTAT) || (defined(HAVE_DECL_Q_XGETQSTAT) && HAVE_DECL_Q_XGETQSTAT) - XLAT(Q_XGETQSTAT), +#if !(defined(Q_XQUOTARM) || (defined(HAVE_DECL_Q_XQUOTARM) && HAVE_DECL_Q_XQUOTARM)) +# define Q_XQUOTARM XQM_CMD(0x6) #endif -#if defined(Q_XQUOTARM) || (defined(HAVE_DECL_Q_XQUOTARM) && HAVE_DECL_Q_XQUOTARM) - XLAT(Q_XQUOTARM), +#if !(defined(Q_XQUOTASYNC) || (defined(HAVE_DECL_Q_XQUOTASYNC) && HAVE_DECL_Q_XQUOTASYNC)) +# define Q_XQUOTASYNC XQM_CMD(0x7) #endif -#if defined(Q_XQUOTASYNC) || (defined(HAVE_DECL_Q_XQUOTASYNC) && HAVE_DECL_Q_XQUOTASYNC) - XLAT(Q_XQUOTASYNC), +#if !(defined(Q_XGETQSTATV) || (defined(HAVE_DECL_Q_XGETQSTATV) && HAVE_DECL_Q_XGETQSTATV)) +# define Q_XGETQSTATV XQM_CMD(0x8) #endif - XLAT_END +#if !(defined(Q_XGETNEXTQUOTA) || (defined(HAVE_DECL_Q_XGETNEXTQUOTA) && HAVE_DECL_Q_XGETNEXTQUOTA)) +# define Q_XGETNEXTQUOTA XQM_CMD(0x9) +#endif + +#ifdef IN_MPERS + +# error static const struct xlat quotacmds in mpers mode + +#else + +static +const struct xlat quotacmds[] = { + XLAT(Q_V1_QUOTAON), + XLAT(Q_V1_QUOTAOFF), + XLAT(Q_V1_GETQUOTA), + XLAT(Q_V1_SETQUOTA), + XLAT(Q_V1_SETUSE), + XLAT(Q_V1_SYNC), + XLAT(Q_SETQLIM), + XLAT(Q_V1_GETSTATS), + XLAT(Q_V1_RSQUASH), + + XLAT(Q_V2_GETQUOTA), + XLAT(Q_V2_SETQUOTA), + XLAT(Q_V2_SETUSE), + XLAT(Q_V2_GETINFO), + XLAT(Q_V2_SETINFO), + XLAT(Q_V2_SETGRACE), + XLAT(Q_V2_SETFLAGS), + XLAT(Q_V2_GETSTATS), + + XLAT(Q_SYNC), + XLAT(Q_QUOTAON), + XLAT(Q_QUOTAOFF), + XLAT(Q_GETFMT), + XLAT(Q_GETINFO), + XLAT(Q_SETINFO), + XLAT(Q_GETQUOTA), + XLAT(Q_SETQUOTA), + XLAT(Q_GETNEXTQUOTA), + + XLAT(Q_XQUOTAON), + XLAT(Q_XQUOTAOFF), + XLAT(Q_XGETQUOTA), + XLAT(Q_XSETQLIM), + XLAT(Q_XGETQSTAT), + XLAT(Q_XQUOTARM), + XLAT(Q_XQUOTASYNC), + XLAT(Q_XGETQSTATV), + XLAT(Q_XGETNEXTQUOTA), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/quotacmds.in b/xlat/quotacmds.in index bb5de01f..5ff19937 100644 --- a/xlat/quotacmds.in +++ b/xlat/quotacmds.in @@ -1,32 +1,38 @@ -Q_V1_QUOTAON -Q_V1_QUOTAOFF -Q_V1_GETQUOTA -Q_V1_SETQUOTA -Q_V1_SETUSE -Q_V1_SYNC -Q_SETQLIM -Q_V1_GETSTATS -Q_V1_RSQUASH -Q_V2_GETQUOTA -Q_V2_SETQUOTA -Q_V2_SETUSE -Q_V2_GETINFO -Q_V2_SETINFO -Q_V2_SETGRACE -Q_V2_SETFLAGS -Q_V2_GETSTATS -Q_SYNC -Q_QUOTAON -Q_QUOTAOFF -Q_GETFMT -Q_GETINFO -Q_SETINFO -Q_GETQUOTA -Q_SETQUOTA -Q_XQUOTAON -Q_XQUOTAOFF -Q_XGETQUOTA -Q_XSETQLIM -Q_XGETQSTAT -Q_XQUOTARM -Q_XQUOTASYNC +Q_V1_QUOTAON OLD_CMD(0x1) +Q_V1_QUOTAOFF OLD_CMD(0x2) +Q_V1_GETQUOTA OLD_CMD(0x3) +Q_V1_SETQUOTA OLD_CMD(0x4) +Q_V1_SETUSE OLD_CMD(0x5) +Q_V1_SYNC OLD_CMD(0x6) +Q_SETQLIM OLD_CMD(0x7) +Q_V1_GETSTATS OLD_CMD(0x8) +Q_V1_RSQUASH OLD_CMD(0x10) + +Q_V2_GETQUOTA OLD_CMD(0xD) +Q_V2_SETQUOTA OLD_CMD(0xE) +Q_V2_SETUSE OLD_CMD(0xF) +Q_V2_GETINFO OLD_CMD(0x9) +Q_V2_SETINFO OLD_CMD(0xA) +Q_V2_SETGRACE OLD_CMD(0xB) +Q_V2_SETFLAGS OLD_CMD(0xC) +Q_V2_GETSTATS OLD_CMD(0x11) + +Q_SYNC NEW_CMD(0x1) +Q_QUOTAON NEW_CMD(0x2) +Q_QUOTAOFF NEW_CMD(0x3) +Q_GETFMT NEW_CMD(0x4) +Q_GETINFO NEW_CMD(0x5) +Q_SETINFO NEW_CMD(0x6) +Q_GETQUOTA NEW_CMD(0x7) +Q_SETQUOTA NEW_CMD(0x8) +Q_GETNEXTQUOTA NEW_CMD(0x9) + +Q_XQUOTAON XQM_CMD(0x1) +Q_XQUOTAOFF XQM_CMD(0x2) +Q_XGETQUOTA XQM_CMD(0x3) +Q_XSETQLIM XQM_CMD(0x4) +Q_XGETQSTAT XQM_CMD(0x5) +Q_XQUOTARM XQM_CMD(0x6) +Q_XQUOTASYNC XQM_CMD(0x7) +Q_XGETQSTATV XQM_CMD(0x8) +Q_XGETNEXTQUOTA XQM_CMD(0x9) diff --git a/xlat/quotatypes.h b/xlat/quotatypes.h index be93ed6d..d2231444 100644 --- a/xlat/quotatypes.h +++ b/xlat/quotatypes.h @@ -1,11 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/quotatypes.in; do not edit. */ - -static const struct xlat quotatypes[] = { -#if defined(USRQUOTA) || (defined(HAVE_DECL_USRQUOTA) && HAVE_DECL_USRQUOTA) - XLAT(USRQUOTA), +#if !(defined(USRQUOTA) || (defined(HAVE_DECL_USRQUOTA) && HAVE_DECL_USRQUOTA)) +# define USRQUOTA 0 +#endif +#if !(defined(GRPQUOTA) || (defined(HAVE_DECL_GRPQUOTA) && HAVE_DECL_GRPQUOTA)) +# define GRPQUOTA 1 #endif -#if defined(GRPQUOTA) || (defined(HAVE_DECL_GRPQUOTA) && HAVE_DECL_GRPQUOTA) - XLAT(GRPQUOTA), +#if !(defined(PRJQUOTA) || (defined(HAVE_DECL_PRJQUOTA) && HAVE_DECL_PRJQUOTA)) +# define PRJQUOTA 2 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat quotatypes in mpers mode + +#else + +static +const struct xlat quotatypes[] = { + XLAT(USRQUOTA), + XLAT(GRPQUOTA), + XLAT(PRJQUOTA), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/quotatypes.in b/xlat/quotatypes.in index 26e77bd9..671fe7df 100644 --- a/xlat/quotatypes.in +++ b/xlat/quotatypes.in @@ -1,2 +1,3 @@ -USRQUOTA -GRPQUOTA +USRQUOTA 0 +GRPQUOTA 1 +PRJQUOTA 2 diff --git a/xlat/rename_flags.h b/xlat/rename_flags.h index cc235750..2fc0a76f 100644 --- a/xlat/rename_flags.h +++ b/xlat/rename_flags.h @@ -1,11 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/rename_flags.in; do not edit. */ - -static const struct xlat rename_flags[] = { -#if defined(RENAME_NOREPLACE) || (defined(HAVE_DECL_RENAME_NOREPLACE) && HAVE_DECL_RENAME_NOREPLACE) - XLAT(RENAME_NOREPLACE), +#if !(defined(RENAME_NOREPLACE) || (defined(HAVE_DECL_RENAME_NOREPLACE) && HAVE_DECL_RENAME_NOREPLACE)) +# define RENAME_NOREPLACE 1 +#endif +#if !(defined(RENAME_EXCHANGE) || (defined(HAVE_DECL_RENAME_EXCHANGE) && HAVE_DECL_RENAME_EXCHANGE)) +# define RENAME_EXCHANGE 2 #endif -#if defined(RENAME_EXCHANGE) || (defined(HAVE_DECL_RENAME_EXCHANGE) && HAVE_DECL_RENAME_EXCHANGE) - XLAT(RENAME_EXCHANGE), +#if !(defined(RENAME_WHITEOUT) || (defined(HAVE_DECL_RENAME_WHITEOUT) && HAVE_DECL_RENAME_WHITEOUT)) +# define RENAME_WHITEOUT 4 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat rename_flags in mpers mode + +#else + +static +const struct xlat rename_flags[] = { + XLAT(RENAME_NOREPLACE), + XLAT(RENAME_EXCHANGE), + XLAT(RENAME_WHITEOUT), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/rename_flags.in b/xlat/rename_flags.in index 324bdeda..8d96b9b4 100644 --- a/xlat/rename_flags.in +++ b/xlat/rename_flags.in @@ -1,2 +1,3 @@ -RENAME_NOREPLACE -RENAME_EXCHANGE +RENAME_NOREPLACE 1 +RENAME_EXCHANGE 2 +RENAME_WHITEOUT 4 diff --git a/xlat/resource_flags.h b/xlat/resource_flags.h index 1df440d6..7761ca22 100644 --- a/xlat/resource_flags.h +++ b/xlat/resource_flags.h @@ -1,14 +1,18 @@ /* Generated by ./xlat/gen.sh from ./xlat/resource_flags.in; do not edit. */ -static const struct xlat resource_flags[] = { +#ifndef IN_MPERS + +const struct xlat resource_flags[] = { #if defined(IPC_CREAT) || (defined(HAVE_DECL_IPC_CREAT) && HAVE_DECL_IPC_CREAT) - XLAT(IPC_CREAT), + XLAT(IPC_CREAT), #endif #if defined(IPC_EXCL) || (defined(HAVE_DECL_IPC_EXCL) && HAVE_DECL_IPC_EXCL) - XLAT(IPC_EXCL), + XLAT(IPC_EXCL), #endif #if defined(IPC_NOWAIT) || (defined(HAVE_DECL_IPC_NOWAIT) && HAVE_DECL_IPC_NOWAIT) - XLAT(IPC_NOWAIT), + XLAT(IPC_NOWAIT), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/resources.h b/xlat/resources.h index 95a5fdb7..4493b083 100644 --- a/xlat/resources.h +++ b/xlat/resources.h @@ -1,56 +1,65 @@ /* Generated by ./xlat/gen.sh from ./xlat/resources.in; do not edit. */ -static const struct xlat resources[] = { +#ifdef IN_MPERS + +# error static const struct xlat resources in mpers mode + +#else + +static +const struct xlat resources[] = { #if defined(RLIMIT_AS) || (defined(HAVE_DECL_RLIMIT_AS) && HAVE_DECL_RLIMIT_AS) - XLAT(RLIMIT_AS), + XLAT(RLIMIT_AS), #endif #if defined(RLIMIT_CORE) || (defined(HAVE_DECL_RLIMIT_CORE) && HAVE_DECL_RLIMIT_CORE) - XLAT(RLIMIT_CORE), + XLAT(RLIMIT_CORE), #endif #if defined(RLIMIT_CPU) || (defined(HAVE_DECL_RLIMIT_CPU) && HAVE_DECL_RLIMIT_CPU) - XLAT(RLIMIT_CPU), + XLAT(RLIMIT_CPU), #endif #if defined(RLIMIT_DATA) || (defined(HAVE_DECL_RLIMIT_DATA) && HAVE_DECL_RLIMIT_DATA) - XLAT(RLIMIT_DATA), + XLAT(RLIMIT_DATA), #endif #if defined(RLIMIT_FSIZE) || (defined(HAVE_DECL_RLIMIT_FSIZE) && HAVE_DECL_RLIMIT_FSIZE) - XLAT(RLIMIT_FSIZE), + XLAT(RLIMIT_FSIZE), #endif #if defined(RLIMIT_LOCKS) || (defined(HAVE_DECL_RLIMIT_LOCKS) && HAVE_DECL_RLIMIT_LOCKS) - XLAT(RLIMIT_LOCKS), + XLAT(RLIMIT_LOCKS), #endif #if defined(RLIMIT_MEMLOCK) || (defined(HAVE_DECL_RLIMIT_MEMLOCK) && HAVE_DECL_RLIMIT_MEMLOCK) - XLAT(RLIMIT_MEMLOCK), + XLAT(RLIMIT_MEMLOCK), #endif #if defined(RLIMIT_MSGQUEUE) || (defined(HAVE_DECL_RLIMIT_MSGQUEUE) && HAVE_DECL_RLIMIT_MSGQUEUE) - XLAT(RLIMIT_MSGQUEUE), + XLAT(RLIMIT_MSGQUEUE), #endif #if defined(RLIMIT_NICE) || (defined(HAVE_DECL_RLIMIT_NICE) && HAVE_DECL_RLIMIT_NICE) - XLAT(RLIMIT_NICE), + XLAT(RLIMIT_NICE), #endif #if defined(RLIMIT_NOFILE) || (defined(HAVE_DECL_RLIMIT_NOFILE) && HAVE_DECL_RLIMIT_NOFILE) - XLAT(RLIMIT_NOFILE), + XLAT(RLIMIT_NOFILE), #endif #if defined(RLIMIT_NPROC) || (defined(HAVE_DECL_RLIMIT_NPROC) && HAVE_DECL_RLIMIT_NPROC) - XLAT(RLIMIT_NPROC), + XLAT(RLIMIT_NPROC), #endif #if defined(RLIMIT_RSS) || (defined(HAVE_DECL_RLIMIT_RSS) && HAVE_DECL_RLIMIT_RSS) - XLAT(RLIMIT_RSS), + XLAT(RLIMIT_RSS), #endif #if defined(RLIMIT_RTPRIO) || (defined(HAVE_DECL_RLIMIT_RTPRIO) && HAVE_DECL_RLIMIT_RTPRIO) - XLAT(RLIMIT_RTPRIO), + XLAT(RLIMIT_RTPRIO), #endif #if defined(RLIMIT_RTTIME) || (defined(HAVE_DECL_RLIMIT_RTTIME) && HAVE_DECL_RLIMIT_RTTIME) - XLAT(RLIMIT_RTTIME), + XLAT(RLIMIT_RTTIME), #endif #if defined(RLIMIT_SIGPENDING) || (defined(HAVE_DECL_RLIMIT_SIGPENDING) && HAVE_DECL_RLIMIT_SIGPENDING) - XLAT(RLIMIT_SIGPENDING), + XLAT(RLIMIT_SIGPENDING), #endif #if defined(RLIMIT_STACK) || (defined(HAVE_DECL_RLIMIT_STACK) && HAVE_DECL_RLIMIT_STACK) - XLAT(RLIMIT_STACK), + XLAT(RLIMIT_STACK), #endif #if defined(RLIMIT_VMEM) || (defined(HAVE_DECL_RLIMIT_VMEM) && HAVE_DECL_RLIMIT_VMEM) - XLAT(RLIMIT_VMEM), + XLAT(RLIMIT_VMEM), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/rwf_flags.h b/xlat/rwf_flags.h new file mode 100644 index 00000000..cd5cfdc1 --- /dev/null +++ b/xlat/rwf_flags.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rwf_flags.in; do not edit. */ +#if !(defined(RWF_HIPRI) || (defined(HAVE_DECL_RWF_HIPRI) && HAVE_DECL_RWF_HIPRI)) +# define RWF_HIPRI 1 +#endif +#if !(defined(RWF_DSYNC) || (defined(HAVE_DECL_RWF_DSYNC) && HAVE_DECL_RWF_DSYNC)) +# define RWF_DSYNC 2 +#endif +#if !(defined(RWF_SYNC) || (defined(HAVE_DECL_RWF_SYNC) && HAVE_DECL_RWF_SYNC)) +# define RWF_SYNC 4 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat rwf_flags in mpers mode + +#else + +static +const struct xlat rwf_flags[] = { + XLAT(RWF_HIPRI), + XLAT(RWF_DSYNC), + XLAT(RWF_SYNC), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/rwf_flags.in b/xlat/rwf_flags.in new file mode 100644 index 00000000..2e754459 --- /dev/null +++ b/xlat/rwf_flags.in @@ -0,0 +1,3 @@ +RWF_HIPRI 1 +RWF_DSYNC 2 +RWF_SYNC 4 diff --git a/xlat/sa_handler_values.h b/xlat/sa_handler_values.h new file mode 100644 index 00000000..3d7da047 --- /dev/null +++ b/xlat/sa_handler_values.h @@ -0,0 +1,23 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sa_handler_values.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat sa_handler_values in mpers mode + +#else + +static +const struct xlat sa_handler_values[] = { +#if defined(SIG_ERR) || (defined(HAVE_DECL_SIG_ERR) && HAVE_DECL_SIG_ERR) + XLAT_TYPE(unsigned long, SIG_ERR), +#endif +#if defined(SIG_DFL) || (defined(HAVE_DECL_SIG_DFL) && HAVE_DECL_SIG_DFL) + XLAT_TYPE(unsigned long, SIG_DFL), +#endif +#if defined(SIG_IGN) || (defined(HAVE_DECL_SIG_IGN) && HAVE_DECL_SIG_IGN) + XLAT_TYPE(unsigned long, SIG_IGN), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/sa_handler_values.in b/xlat/sa_handler_values.in new file mode 100644 index 00000000..e9076116 --- /dev/null +++ b/xlat/sa_handler_values.in @@ -0,0 +1,4 @@ +#val_type unsigned long +SIG_ERR +SIG_DFL +SIG_IGN diff --git a/xlat/sched_flags.h b/xlat/sched_flags.h new file mode 100644 index 00000000..78638612 --- /dev/null +++ b/xlat/sched_flags.h @@ -0,0 +1,18 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sched_flags.in; do not edit. */ +#if !(defined(SCHED_FLAG_RESET_ON_FORK) || (defined(HAVE_DECL_SCHED_FLAG_RESET_ON_FORK) && HAVE_DECL_SCHED_FLAG_RESET_ON_FORK)) +# define SCHED_FLAG_RESET_ON_FORK 1 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat sched_flags in mpers mode + +#else + +static +const struct xlat sched_flags[] = { + XLAT(SCHED_FLAG_RESET_ON_FORK), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/sched_flags.in b/xlat/sched_flags.in new file mode 100644 index 00000000..824d91dc --- /dev/null +++ b/xlat/sched_flags.in @@ -0,0 +1 @@ +SCHED_FLAG_RESET_ON_FORK 1 diff --git a/xlat/schedulers.h b/xlat/schedulers.h index 20871a40..099db27d 100644 --- a/xlat/schedulers.h +++ b/xlat/schedulers.h @@ -1,14 +1,35 @@ /* Generated by ./xlat/gen.sh from ./xlat/schedulers.in; do not edit. */ -static const struct xlat schedulers[] = { +#ifdef IN_MPERS + +# error static const struct xlat schedulers in mpers mode + +#else + +static +const struct xlat schedulers[] = { #if defined(SCHED_OTHER) || (defined(HAVE_DECL_SCHED_OTHER) && HAVE_DECL_SCHED_OTHER) - XLAT(SCHED_OTHER), + XLAT(SCHED_OTHER), +#endif +#if defined(SCHED_FIFO) || (defined(HAVE_DECL_SCHED_FIFO) && HAVE_DECL_SCHED_FIFO) + XLAT(SCHED_FIFO), #endif #if defined(SCHED_RR) || (defined(HAVE_DECL_SCHED_RR) && HAVE_DECL_SCHED_RR) - XLAT(SCHED_RR), + XLAT(SCHED_RR), #endif -#if defined(SCHED_FIFO) || (defined(HAVE_DECL_SCHED_FIFO) && HAVE_DECL_SCHED_FIFO) - XLAT(SCHED_FIFO), +#if defined(SCHED_BATCH) || (defined(HAVE_DECL_SCHED_BATCH) && HAVE_DECL_SCHED_BATCH) + XLAT(SCHED_BATCH), +#endif +#if defined(SCHED_ISO) || (defined(HAVE_DECL_SCHED_ISO) && HAVE_DECL_SCHED_ISO) + XLAT(SCHED_ISO), +#endif +#if defined(SCHED_IDLE) || (defined(HAVE_DECL_SCHED_IDLE) && HAVE_DECL_SCHED_IDLE) + XLAT(SCHED_IDLE), #endif - XLAT_END +#if defined(SCHED_DEADLINE) || (defined(HAVE_DECL_SCHED_DEADLINE) && HAVE_DECL_SCHED_DEADLINE) + XLAT(SCHED_DEADLINE), +#endif + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/schedulers.in b/xlat/schedulers.in index f8718f49..4a6e366e 100644 --- a/xlat/schedulers.in +++ b/xlat/schedulers.in @@ -1,3 +1,7 @@ SCHED_OTHER -SCHED_RR SCHED_FIFO +SCHED_RR +SCHED_BATCH +SCHED_ISO +SCHED_IDLE +SCHED_DEADLINE diff --git a/xlat/scmvals.h b/xlat/scmvals.h index ba4629a3..a7ca2f0a 100644 --- a/xlat/scmvals.h +++ b/xlat/scmvals.h @@ -1,11 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/scmvals.in; do not edit. */ - -static const struct xlat scmvals[] = { -#if defined(SCM_RIGHTS) || (defined(HAVE_DECL_SCM_RIGHTS) && HAVE_DECL_SCM_RIGHTS) - XLAT(SCM_RIGHTS), +#if !(defined(SCM_RIGHTS) || (defined(HAVE_DECL_SCM_RIGHTS) && HAVE_DECL_SCM_RIGHTS)) +# define SCM_RIGHTS 1 +#endif +#if !(defined(SCM_CREDENTIALS) || (defined(HAVE_DECL_SCM_CREDENTIALS) && HAVE_DECL_SCM_CREDENTIALS)) +# define SCM_CREDENTIALS 2 #endif -#if defined(SCM_CREDENTIALS) || (defined(HAVE_DECL_SCM_CREDENTIALS) && HAVE_DECL_SCM_CREDENTIALS) - XLAT(SCM_CREDENTIALS), +#if !(defined(SCM_SECURITY) || (defined(HAVE_DECL_SCM_SECURITY) && HAVE_DECL_SCM_SECURITY)) +# define SCM_SECURITY 3 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat scmvals in mpers mode + +#else + +static +const struct xlat scmvals[] = { + XLAT(SCM_RIGHTS), + XLAT(SCM_CREDENTIALS), + XLAT(SCM_SECURITY), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/scmvals.in b/xlat/scmvals.in index 04322e84..3d61f9ef 100644 --- a/xlat/scmvals.in +++ b/xlat/scmvals.in @@ -1,2 +1,3 @@ -SCM_RIGHTS -SCM_CREDENTIALS +SCM_RIGHTS 1 +SCM_CREDENTIALS 2 +SCM_SECURITY 3 diff --git a/xlat/scsi_sg_commands.h b/xlat/scsi_sg_commands.h new file mode 100644 index 00000000..6ccafbc7 --- /dev/null +++ b/xlat/scsi_sg_commands.h @@ -0,0 +1,76 @@ +/* Generated by ./xlat/gen.sh from ./xlat/scsi_sg_commands.in; do not edit. */ +#if !(defined(SG_SET_TIMEOUT) || (defined(HAVE_DECL_SG_SET_TIMEOUT) && HAVE_DECL_SG_SET_TIMEOUT)) +# define SG_SET_TIMEOUT 0x2201 +#endif +#if !(defined(SG_GET_TIMEOUT) || (defined(HAVE_DECL_SG_GET_TIMEOUT) && HAVE_DECL_SG_GET_TIMEOUT)) +# define SG_GET_TIMEOUT 0x2202 +#endif +#if !(defined(SG_EMULATED_HOST) || (defined(HAVE_DECL_SG_EMULATED_HOST) && HAVE_DECL_SG_EMULATED_HOST)) +# define SG_EMULATED_HOST 0x2203 +#endif +#if !(defined(SG_SET_TRANSFORM) || (defined(HAVE_DECL_SG_SET_TRANSFORM) && HAVE_DECL_SG_SET_TRANSFORM)) +# define SG_SET_TRANSFORM 0x2204 +#endif +#if !(defined(SG_GET_TRANSFORM) || (defined(HAVE_DECL_SG_GET_TRANSFORM) && HAVE_DECL_SG_GET_TRANSFORM)) +# define SG_GET_TRANSFORM 0x2205 +#endif +#if !(defined(SG_GET_COMMAND_Q) || (defined(HAVE_DECL_SG_GET_COMMAND_Q) && HAVE_DECL_SG_GET_COMMAND_Q)) +# define SG_GET_COMMAND_Q 0x2270 +#endif +#if !(defined(SG_SET_COMMAND_Q) || (defined(HAVE_DECL_SG_SET_COMMAND_Q) && HAVE_DECL_SG_SET_COMMAND_Q)) +# define SG_SET_COMMAND_Q 0x2271 +#endif +#if !(defined(SG_GET_RESERVED_SIZE) || (defined(HAVE_DECL_SG_GET_RESERVED_SIZE) && HAVE_DECL_SG_GET_RESERVED_SIZE)) +# define SG_GET_RESERVED_SIZE 0x2272 +#endif +#if !(defined(SG_SET_RESERVED_SIZE) || (defined(HAVE_DECL_SG_SET_RESERVED_SIZE) && HAVE_DECL_SG_SET_RESERVED_SIZE)) +# define SG_SET_RESERVED_SIZE 0x2275 +#endif +#if !(defined(SG_GET_SCSI_ID) || (defined(HAVE_DECL_SG_GET_SCSI_ID) && HAVE_DECL_SG_GET_SCSI_ID)) +# define SG_GET_SCSI_ID 0x2276 +#endif +#if !(defined(SG_SET_FORCE_LOW_DMA) || (defined(HAVE_DECL_SG_SET_FORCE_LOW_DMA) && HAVE_DECL_SG_SET_FORCE_LOW_DMA)) +# define SG_SET_FORCE_LOW_DMA 0x2279 +#endif +#if !(defined(SG_GET_LOW_DMA) || (defined(HAVE_DECL_SG_GET_LOW_DMA) && HAVE_DECL_SG_GET_LOW_DMA)) +# define SG_GET_LOW_DMA 0x227a +#endif +#if !(defined(SG_SET_FORCE_PACK_ID) || (defined(HAVE_DECL_SG_SET_FORCE_PACK_ID) && HAVE_DECL_SG_SET_FORCE_PACK_ID)) +# define SG_SET_FORCE_PACK_ID 0x227b +#endif +#if !(defined(SG_GET_PACK_ID) || (defined(HAVE_DECL_SG_GET_PACK_ID) && HAVE_DECL_SG_GET_PACK_ID)) +# define SG_GET_PACK_ID 0x227c +#endif +#if !(defined(SG_GET_NUM_WAITING) || (defined(HAVE_DECL_SG_GET_NUM_WAITING) && HAVE_DECL_SG_GET_NUM_WAITING)) +# define SG_GET_NUM_WAITING 0x227d +#endif +#if !(defined(SG_SET_DEBUG) || (defined(HAVE_DECL_SG_SET_DEBUG) && HAVE_DECL_SG_SET_DEBUG)) +# define SG_SET_DEBUG 0x227e +#endif +#if !(defined(SG_GET_SG_TABLESIZE) || (defined(HAVE_DECL_SG_GET_SG_TABLESIZE) && HAVE_DECL_SG_GET_SG_TABLESIZE)) +# define SG_GET_SG_TABLESIZE 0x227F +#endif +#if !(defined(SG_GET_VERSION_NUM) || (defined(HAVE_DECL_SG_GET_VERSION_NUM) && HAVE_DECL_SG_GET_VERSION_NUM)) +# define SG_GET_VERSION_NUM 0x2282 +#endif +#if !(defined(SG_NEXT_CMD_LEN) || (defined(HAVE_DECL_SG_NEXT_CMD_LEN) && HAVE_DECL_SG_NEXT_CMD_LEN)) +# define SG_NEXT_CMD_LEN 0x2283 +#endif +#if !(defined(SG_SCSI_RESET) || (defined(HAVE_DECL_SG_SCSI_RESET) && HAVE_DECL_SG_SCSI_RESET)) +# define SG_SCSI_RESET 0x2284 +#endif +#if !(defined(SG_IO) || (defined(HAVE_DECL_SG_IO) && HAVE_DECL_SG_IO)) +# define SG_IO 0x2285 +#endif +#if !(defined(SG_GET_REQUEST_TABLE) || (defined(HAVE_DECL_SG_GET_REQUEST_TABLE) && HAVE_DECL_SG_GET_REQUEST_TABLE)) +# define SG_GET_REQUEST_TABLE 0x2286 +#endif +#if !(defined(SG_SET_KEEP_ORPHAN) || (defined(HAVE_DECL_SG_SET_KEEP_ORPHAN) && HAVE_DECL_SG_SET_KEEP_ORPHAN)) +# define SG_SET_KEEP_ORPHAN 0x2287 +#endif +#if !(defined(SG_GET_KEEP_ORPHAN) || (defined(HAVE_DECL_SG_GET_KEEP_ORPHAN) && HAVE_DECL_SG_GET_KEEP_ORPHAN)) +# define SG_GET_KEEP_ORPHAN 0x2288 +#endif +#if !(defined(SG_GET_ACCESS_COUNT) || (defined(HAVE_DECL_SG_GET_ACCESS_COUNT) && HAVE_DECL_SG_GET_ACCESS_COUNT)) +# define SG_GET_ACCESS_COUNT 0x2289 +#endif diff --git a/xlat/scsi_sg_commands.in b/xlat/scsi_sg_commands.in new file mode 100644 index 00000000..e95e0d12 --- /dev/null +++ b/xlat/scsi_sg_commands.in @@ -0,0 +1,26 @@ +SG_SET_TIMEOUT 0x2201 +SG_GET_TIMEOUT 0x2202 +SG_EMULATED_HOST 0x2203 +SG_SET_TRANSFORM 0x2204 +SG_GET_TRANSFORM 0x2205 +SG_GET_COMMAND_Q 0x2270 +SG_SET_COMMAND_Q 0x2271 +SG_GET_RESERVED_SIZE 0x2272 +SG_SET_RESERVED_SIZE 0x2275 +SG_GET_SCSI_ID 0x2276 +SG_SET_FORCE_LOW_DMA 0x2279 +SG_GET_LOW_DMA 0x227a +SG_SET_FORCE_PACK_ID 0x227b +SG_GET_PACK_ID 0x227c +SG_GET_NUM_WAITING 0x227d +SG_SET_DEBUG 0x227e +SG_GET_SG_TABLESIZE 0x227F +SG_GET_VERSION_NUM 0x2282 +SG_NEXT_CMD_LEN 0x2283 +SG_SCSI_RESET 0x2284 +SG_IO 0x2285 +SG_GET_REQUEST_TABLE 0x2286 +SG_SET_KEEP_ORPHAN 0x2287 +SG_GET_KEEP_ORPHAN 0x2288 +SG_GET_ACCESS_COUNT 0x2289 +#stop diff --git a/xlat/secbits.h b/xlat/secbits.h new file mode 100644 index 00000000..d616e1f5 --- /dev/null +++ b/xlat/secbits.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/secbits.in; do not edit. */ +#if !(defined(SECBIT_NOROOT) || (defined(HAVE_DECL_SECBIT_NOROOT) && HAVE_DECL_SECBIT_NOROOT)) +# define SECBIT_NOROOT (1 << 0) +#endif +#if !(defined(SECBIT_NOROOT_LOCKED) || (defined(HAVE_DECL_SECBIT_NOROOT_LOCKED) && HAVE_DECL_SECBIT_NOROOT_LOCKED)) +# define SECBIT_NOROOT_LOCKED (1 << 1) +#endif +#if !(defined(SECBIT_NO_SETUID_FIXUP) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP)) +# define SECBIT_NO_SETUID_FIXUP (1 << 2) +#endif +#if !(defined(SECBIT_NO_SETUID_FIXUP_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED)) +# define SECBIT_NO_SETUID_FIXUP_LOCKED (1 << 3) +#endif +#if !(defined(SECBIT_KEEP_CAPS) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS) && HAVE_DECL_SECBIT_KEEP_CAPS)) +# define SECBIT_KEEP_CAPS (1 << 4) +#endif +#if !(defined(SECBIT_KEEP_CAPS_LOCKED) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED) && HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED)) +# define SECBIT_KEEP_CAPS_LOCKED (1 << 5) +#endif +#if !(defined(SECBIT_NO_CAP_AMBIENT_RAISE) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE)) +# define SECBIT_NO_CAP_AMBIENT_RAISE (1 << 6) +#endif +#if !(defined(SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED)) +# define SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED (1 << 7) +#endif + +#ifdef IN_MPERS + +# error static const struct xlat secbits in mpers mode + +#else + +static +const struct xlat secbits[] = { + XLAT(SECBIT_NOROOT), + XLAT(SECBIT_NOROOT_LOCKED), + XLAT(SECBIT_NO_SETUID_FIXUP), + XLAT(SECBIT_NO_SETUID_FIXUP_LOCKED), + XLAT(SECBIT_KEEP_CAPS), + XLAT(SECBIT_KEEP_CAPS_LOCKED), + XLAT(SECBIT_NO_CAP_AMBIENT_RAISE), + XLAT(SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/secbits.in b/xlat/secbits.in new file mode 100644 index 00000000..975bd830 --- /dev/null +++ b/xlat/secbits.in @@ -0,0 +1,8 @@ +SECBIT_NOROOT (1 << 0) +SECBIT_NOROOT_LOCKED (1 << 1) +SECBIT_NO_SETUID_FIXUP (1 << 2) +SECBIT_NO_SETUID_FIXUP_LOCKED (1 << 3) +SECBIT_KEEP_CAPS (1 << 4) +SECBIT_KEEP_CAPS_LOCKED (1 << 5) +SECBIT_NO_CAP_AMBIENT_RAISE (1 << 6) +SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED (1 << 7) diff --git a/xlat/seccomp_filter_flags.h b/xlat/seccomp_filter_flags.h new file mode 100644 index 00000000..5c0decd5 --- /dev/null +++ b/xlat/seccomp_filter_flags.h @@ -0,0 +1,18 @@ +/* Generated by ./xlat/gen.sh from ./xlat/seccomp_filter_flags.in; do not edit. */ +#if !(defined(SECCOMP_FILTER_FLAG_TSYNC) || (defined(HAVE_DECL_SECCOMP_FILTER_FLAG_TSYNC) && HAVE_DECL_SECCOMP_FILTER_FLAG_TSYNC)) +# define SECCOMP_FILTER_FLAG_TSYNC 1 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat seccomp_filter_flags in mpers mode + +#else + +static +const struct xlat seccomp_filter_flags[] = { + XLAT(SECCOMP_FILTER_FLAG_TSYNC), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/seccomp_filter_flags.in b/xlat/seccomp_filter_flags.in new file mode 100644 index 00000000..83482d00 --- /dev/null +++ b/xlat/seccomp_filter_flags.in @@ -0,0 +1 @@ +SECCOMP_FILTER_FLAG_TSYNC 1 diff --git a/xlat/seccomp_mode.h b/xlat/seccomp_mode.h new file mode 100644 index 00000000..842dd444 --- /dev/null +++ b/xlat/seccomp_mode.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/seccomp_mode.in; do not edit. */ +#if !(defined(SECCOMP_MODE_DISABLED) || (defined(HAVE_DECL_SECCOMP_MODE_DISABLED) && HAVE_DECL_SECCOMP_MODE_DISABLED)) +# define SECCOMP_MODE_DISABLED 0 +#endif +#if !(defined(SECCOMP_MODE_STRICT) || (defined(HAVE_DECL_SECCOMP_MODE_STRICT) && HAVE_DECL_SECCOMP_MODE_STRICT)) +# define SECCOMP_MODE_STRICT 1 +#endif +#if !(defined(SECCOMP_MODE_FILTER) || (defined(HAVE_DECL_SECCOMP_MODE_FILTER) && HAVE_DECL_SECCOMP_MODE_FILTER)) +# define SECCOMP_MODE_FILTER 2 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat seccomp_mode in mpers mode + +#else + +static +const struct xlat seccomp_mode[] = { + XLAT(SECCOMP_MODE_DISABLED), + XLAT(SECCOMP_MODE_STRICT), + XLAT(SECCOMP_MODE_FILTER), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/seccomp_mode.in b/xlat/seccomp_mode.in new file mode 100644 index 00000000..eed9faec --- /dev/null +++ b/xlat/seccomp_mode.in @@ -0,0 +1,3 @@ +SECCOMP_MODE_DISABLED 0 +SECCOMP_MODE_STRICT 1 +SECCOMP_MODE_FILTER 2 diff --git a/xlat/seccomp_ops.h b/xlat/seccomp_ops.h new file mode 100644 index 00000000..3fd0dc66 --- /dev/null +++ b/xlat/seccomp_ops.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/seccomp_ops.in; do not edit. */ +#if !(defined(SECCOMP_SET_MODE_STRICT) || (defined(HAVE_DECL_SECCOMP_SET_MODE_STRICT) && HAVE_DECL_SECCOMP_SET_MODE_STRICT)) +# define SECCOMP_SET_MODE_STRICT 0 +#endif +#if !(defined(SECCOMP_SET_MODE_FILTER) || (defined(HAVE_DECL_SECCOMP_SET_MODE_FILTER) && HAVE_DECL_SECCOMP_SET_MODE_FILTER)) +# define SECCOMP_SET_MODE_FILTER 1 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat seccomp_ops in mpers mode + +#else + +static +const struct xlat seccomp_ops[] = { + XLAT(SECCOMP_SET_MODE_STRICT), + XLAT(SECCOMP_SET_MODE_FILTER), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/seccomp_ops.in b/xlat/seccomp_ops.in new file mode 100644 index 00000000..c3320af7 --- /dev/null +++ b/xlat/seccomp_ops.in @@ -0,0 +1,2 @@ +SECCOMP_SET_MODE_STRICT 0 +SECCOMP_SET_MODE_FILTER 1 diff --git a/xlat/seccomp_ret_action.h b/xlat/seccomp_ret_action.h new file mode 100644 index 00000000..2d416099 --- /dev/null +++ b/xlat/seccomp_ret_action.h @@ -0,0 +1,29 @@ +/* Generated by ./xlat/gen.sh from ./xlat/seccomp_ret_action.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat seccomp_ret_action in mpers mode + +#else + +static +const struct xlat seccomp_ret_action[] = { +#if defined(SECCOMP_RET_KILL) || (defined(HAVE_DECL_SECCOMP_RET_KILL) && HAVE_DECL_SECCOMP_RET_KILL) + XLAT(SECCOMP_RET_KILL), +#endif +#if defined(SECCOMP_RET_TRAP) || (defined(HAVE_DECL_SECCOMP_RET_TRAP) && HAVE_DECL_SECCOMP_RET_TRAP) + XLAT(SECCOMP_RET_TRAP), +#endif +#if defined(SECCOMP_RET_ERRNO) || (defined(HAVE_DECL_SECCOMP_RET_ERRNO) && HAVE_DECL_SECCOMP_RET_ERRNO) + XLAT(SECCOMP_RET_ERRNO), +#endif +#if defined(SECCOMP_RET_TRACE) || (defined(HAVE_DECL_SECCOMP_RET_TRACE) && HAVE_DECL_SECCOMP_RET_TRACE) + XLAT(SECCOMP_RET_TRACE), +#endif +#if defined(SECCOMP_RET_ALLOW) || (defined(HAVE_DECL_SECCOMP_RET_ALLOW) && HAVE_DECL_SECCOMP_RET_ALLOW) + XLAT(SECCOMP_RET_ALLOW), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/seccomp_ret_action.in b/xlat/seccomp_ret_action.in new file mode 100644 index 00000000..6212dcb6 --- /dev/null +++ b/xlat/seccomp_ret_action.in @@ -0,0 +1,5 @@ +SECCOMP_RET_KILL +SECCOMP_RET_TRAP +SECCOMP_RET_ERRNO +SECCOMP_RET_TRACE +SECCOMP_RET_ALLOW diff --git a/xlat/semctl_flags.h b/xlat/semctl_flags.h index e9020080..b8e0c629 100644 --- a/xlat/semctl_flags.h +++ b/xlat/semctl_flags.h @@ -1,44 +1,55 @@ /* Generated by ./xlat/gen.sh from ./xlat/semctl_flags.in; do not edit. */ +#if !(defined(SEM_STAT) || (defined(HAVE_DECL_SEM_STAT) && HAVE_DECL_SEM_STAT)) +# define SEM_STAT 18 +#endif +#if !(defined(SEM_INFO) || (defined(HAVE_DECL_SEM_INFO) && HAVE_DECL_SEM_INFO)) +# define SEM_INFO 19 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat semctl_flags in mpers mode -static const struct xlat semctl_flags[] = { +#else + +static +const struct xlat semctl_flags[] = { #if defined(IPC_RMID) || (defined(HAVE_DECL_IPC_RMID) && HAVE_DECL_IPC_RMID) - XLAT(IPC_RMID), + XLAT(IPC_RMID), #endif #if defined(IPC_SET) || (defined(HAVE_DECL_IPC_SET) && HAVE_DECL_IPC_SET) - XLAT(IPC_SET), + XLAT(IPC_SET), #endif #if defined(IPC_STAT) || (defined(HAVE_DECL_IPC_STAT) && HAVE_DECL_IPC_STAT) - XLAT(IPC_STAT), + XLAT(IPC_STAT), #endif #if defined(IPC_INFO) || (defined(HAVE_DECL_IPC_INFO) && HAVE_DECL_IPC_INFO) - XLAT(IPC_INFO), -#endif -#if defined(SEM_STAT) || (defined(HAVE_DECL_SEM_STAT) && HAVE_DECL_SEM_STAT) - XLAT(SEM_STAT), -#endif -#if defined(SEM_INFO) || (defined(HAVE_DECL_SEM_INFO) && HAVE_DECL_SEM_INFO) - XLAT(SEM_INFO), + XLAT(IPC_INFO), #endif + XLAT(SEM_STAT), + XLAT(SEM_INFO), #if defined(GETPID) || (defined(HAVE_DECL_GETPID) && HAVE_DECL_GETPID) - XLAT(GETPID), + XLAT(GETPID), #endif #if defined(GETVAL) || (defined(HAVE_DECL_GETVAL) && HAVE_DECL_GETVAL) - XLAT(GETVAL), + XLAT(GETVAL), #endif #if defined(GETALL) || (defined(HAVE_DECL_GETALL) && HAVE_DECL_GETALL) - XLAT(GETALL), + XLAT(GETALL), #endif #if defined(GETNCNT) || (defined(HAVE_DECL_GETNCNT) && HAVE_DECL_GETNCNT) - XLAT(GETNCNT), + XLAT(GETNCNT), #endif #if defined(GETZCNT) || (defined(HAVE_DECL_GETZCNT) && HAVE_DECL_GETZCNT) - XLAT(GETZCNT), + XLAT(GETZCNT), #endif #if defined(SETVAL) || (defined(HAVE_DECL_SETVAL) && HAVE_DECL_SETVAL) - XLAT(SETVAL), + XLAT(SETVAL), #endif #if defined(SETALL) || (defined(HAVE_DECL_SETALL) && HAVE_DECL_SETALL) - XLAT(SETALL), + XLAT(SETALL), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/semctl_flags.in b/xlat/semctl_flags.in index e50d6d48..5638adba 100644 --- a/xlat/semctl_flags.in +++ b/xlat/semctl_flags.in @@ -2,8 +2,8 @@ IPC_RMID IPC_SET IPC_STAT IPC_INFO -SEM_STAT -SEM_INFO +SEM_STAT 18 +SEM_INFO 19 GETPID GETVAL GETALL diff --git a/xlat/semop_flags.h b/xlat/semop_flags.h index d861340f..b5ce4a01 100644 --- a/xlat/semop_flags.h +++ b/xlat/semop_flags.h @@ -1,11 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/semop_flags.in; do not edit. */ -static const struct xlat semop_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat semop_flags in mpers mode + +#else + +static +const struct xlat semop_flags[] = { #if defined(SEM_UNDO) || (defined(HAVE_DECL_SEM_UNDO) && HAVE_DECL_SEM_UNDO) - XLAT(SEM_UNDO), + XLAT(SEM_UNDO), #endif #if defined(IPC_NOWAIT) || (defined(HAVE_DECL_IPC_NOWAIT) && HAVE_DECL_IPC_NOWAIT) - XLAT(IPC_NOWAIT), + XLAT(IPC_NOWAIT), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/setns_types.h b/xlat/setns_types.h new file mode 100644 index 00000000..8ed5afa8 --- /dev/null +++ b/xlat/setns_types.h @@ -0,0 +1,43 @@ +/* Generated by ./xlat/gen.sh from ./xlat/setns_types.in; do not edit. */ +#if !(defined(CLONE_NEWNS) || (defined(HAVE_DECL_CLONE_NEWNS) && HAVE_DECL_CLONE_NEWNS)) +# define CLONE_NEWNS 0x00020000 +#endif +#if !(defined(CLONE_NEWCGROUP) || (defined(HAVE_DECL_CLONE_NEWCGROUP) && HAVE_DECL_CLONE_NEWCGROUP)) +# define CLONE_NEWCGROUP 0x02000000 +#endif +#if !(defined(CLONE_NEWUTS) || (defined(HAVE_DECL_CLONE_NEWUTS) && HAVE_DECL_CLONE_NEWUTS)) +# define CLONE_NEWUTS 0x04000000 +#endif +#if !(defined(CLONE_NEWIPC) || (defined(HAVE_DECL_CLONE_NEWIPC) && HAVE_DECL_CLONE_NEWIPC)) +# define CLONE_NEWIPC 0x08000000 +#endif +#if !(defined(CLONE_NEWUSER) || (defined(HAVE_DECL_CLONE_NEWUSER) && HAVE_DECL_CLONE_NEWUSER)) +# define CLONE_NEWUSER 0x10000000 +#endif +#if !(defined(CLONE_NEWPID) || (defined(HAVE_DECL_CLONE_NEWPID) && HAVE_DECL_CLONE_NEWPID)) +# define CLONE_NEWPID 0x20000000 +#endif +#if !(defined(CLONE_NEWNET) || (defined(HAVE_DECL_CLONE_NEWNET) && HAVE_DECL_CLONE_NEWNET)) +# define CLONE_NEWNET 0x40000000 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat setns_types in mpers mode + +#else + +static +const struct xlat setns_types[] = { + XLAT(0), + XLAT(CLONE_NEWNS), + XLAT(CLONE_NEWCGROUP), + XLAT(CLONE_NEWUTS), + XLAT(CLONE_NEWIPC), + XLAT(CLONE_NEWUSER), + XLAT(CLONE_NEWPID), + XLAT(CLONE_NEWNET), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/setns_types.in b/xlat/setns_types.in new file mode 100644 index 00000000..09186f27 --- /dev/null +++ b/xlat/setns_types.in @@ -0,0 +1,8 @@ +0 +CLONE_NEWNS 0x00020000 +CLONE_NEWCGROUP 0x02000000 +CLONE_NEWUTS 0x04000000 +CLONE_NEWIPC 0x08000000 +CLONE_NEWUSER 0x10000000 +CLONE_NEWPID 0x20000000 +CLONE_NEWNET 0x40000000 diff --git a/xlat/setsockipoptions.h b/xlat/setsockipoptions.h new file mode 100644 index 00000000..34ae307f --- /dev/null +++ b/xlat/setsockipoptions.h @@ -0,0 +1,89 @@ +/* Generated by ./xlat/gen.sh from ./xlat/setsockipoptions.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat setsockipoptions in mpers mode + +#else + +static +const struct xlat setsockipoptions[] = { +/* +* Options specific to setsockopt(SOL_IP). +* Common {g,s}etsockopt(SOL_IP) options +* should be in sockipoptions.in instead. +*/ + +#if defined(ARPT_SO_SET_REPLACE) || (defined(HAVE_DECL_ARPT_SO_SET_REPLACE) && HAVE_DECL_ARPT_SO_SET_REPLACE) + XLAT(ARPT_SO_SET_REPLACE), +#endif +#if defined(ARPT_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_ARPT_SO_SET_ADD_COUNTERS) && HAVE_DECL_ARPT_SO_SET_ADD_COUNTERS) + XLAT(ARPT_SO_SET_ADD_COUNTERS), +#endif + +#if defined(EBT_SO_SET_ENTRIES) || (defined(HAVE_DECL_EBT_SO_SET_ENTRIES) && HAVE_DECL_EBT_SO_SET_ENTRIES) + XLAT(EBT_SO_SET_ENTRIES), +#endif +#if defined(EBT_SO_SET_COUNTERS) || (defined(HAVE_DECL_EBT_SO_SET_COUNTERS) && HAVE_DECL_EBT_SO_SET_COUNTERS) + XLAT(EBT_SO_SET_COUNTERS), +#endif + +#if defined(IP_VS_SO_SET_NONE) || (defined(HAVE_DECL_IP_VS_SO_SET_NONE) && HAVE_DECL_IP_VS_SO_SET_NONE) + XLAT(IP_VS_SO_SET_NONE), +#endif +#if defined(IP_VS_SO_SET_INSERT) || (defined(HAVE_DECL_IP_VS_SO_SET_INSERT) && HAVE_DECL_IP_VS_SO_SET_INSERT) + XLAT(IP_VS_SO_SET_INSERT), +#endif +#if defined(IP_VS_SO_SET_ADD) || (defined(HAVE_DECL_IP_VS_SO_SET_ADD) && HAVE_DECL_IP_VS_SO_SET_ADD) + XLAT(IP_VS_SO_SET_ADD), +#endif +#if defined(IP_VS_SO_SET_EDIT) || (defined(HAVE_DECL_IP_VS_SO_SET_EDIT) && HAVE_DECL_IP_VS_SO_SET_EDIT) + XLAT(IP_VS_SO_SET_EDIT), +#endif +#if defined(IP_VS_SO_SET_DEL) || (defined(HAVE_DECL_IP_VS_SO_SET_DEL) && HAVE_DECL_IP_VS_SO_SET_DEL) + XLAT(IP_VS_SO_SET_DEL), +#endif +#if defined(IP_VS_SO_SET_FLUSH) || (defined(HAVE_DECL_IP_VS_SO_SET_FLUSH) && HAVE_DECL_IP_VS_SO_SET_FLUSH) + XLAT(IP_VS_SO_SET_FLUSH), +#endif +#if defined(IP_VS_SO_SET_LIST) || (defined(HAVE_DECL_IP_VS_SO_SET_LIST) && HAVE_DECL_IP_VS_SO_SET_LIST) + XLAT(IP_VS_SO_SET_LIST), +#endif +#if defined(IP_VS_SO_SET_ADDDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_ADDDEST) && HAVE_DECL_IP_VS_SO_SET_ADDDEST) + XLAT(IP_VS_SO_SET_ADDDEST), +#endif +#if defined(IP_VS_SO_SET_DELDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_DELDEST) && HAVE_DECL_IP_VS_SO_SET_DELDEST) + XLAT(IP_VS_SO_SET_DELDEST), +#endif +#if defined(IP_VS_SO_SET_EDITDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_EDITDEST) && HAVE_DECL_IP_VS_SO_SET_EDITDEST) + XLAT(IP_VS_SO_SET_EDITDEST), +#endif +#if defined(IP_VS_SO_SET_TIMEOUT) || (defined(HAVE_DECL_IP_VS_SO_SET_TIMEOUT) && HAVE_DECL_IP_VS_SO_SET_TIMEOUT) + XLAT(IP_VS_SO_SET_TIMEOUT), +#endif +#if defined(IP_VS_SO_SET_STARTDAEMON) || (defined(HAVE_DECL_IP_VS_SO_SET_STARTDAEMON) && HAVE_DECL_IP_VS_SO_SET_STARTDAEMON) + XLAT(IP_VS_SO_SET_STARTDAEMON), +#endif +#if defined(IP_VS_SO_SET_STOPDAEMON) || (defined(HAVE_DECL_IP_VS_SO_SET_STOPDAEMON) && HAVE_DECL_IP_VS_SO_SET_STOPDAEMON) + XLAT(IP_VS_SO_SET_STOPDAEMON), +#endif +#if defined(IP_VS_SO_SET_RESTORE) || (defined(HAVE_DECL_IP_VS_SO_SET_RESTORE) && HAVE_DECL_IP_VS_SO_SET_RESTORE) + XLAT(IP_VS_SO_SET_RESTORE), +#endif +#if defined(IP_VS_SO_SET_SAVE) || (defined(HAVE_DECL_IP_VS_SO_SET_SAVE) && HAVE_DECL_IP_VS_SO_SET_SAVE) + XLAT(IP_VS_SO_SET_SAVE), +#endif +#if defined(IP_VS_SO_SET_ZERO) || (defined(HAVE_DECL_IP_VS_SO_SET_ZERO) && HAVE_DECL_IP_VS_SO_SET_ZERO) + XLAT(IP_VS_SO_SET_ZERO), +#endif + +#if defined(IPT_SO_SET_REPLACE) || (defined(HAVE_DECL_IPT_SO_SET_REPLACE) && HAVE_DECL_IPT_SO_SET_REPLACE) + XLAT(IPT_SO_SET_REPLACE), +#endif +#if defined(IPT_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_IPT_SO_SET_ADD_COUNTERS) && HAVE_DECL_IPT_SO_SET_ADD_COUNTERS) + XLAT(IPT_SO_SET_ADD_COUNTERS), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/setsockipoptions.in b/xlat/setsockipoptions.in new file mode 100644 index 00000000..878a5945 --- /dev/null +++ b/xlat/setsockipoptions.in @@ -0,0 +1,31 @@ +/* + * Options specific to setsockopt(SOL_IP). + * Common {g,s}etsockopt(SOL_IP) options + * should be in sockipoptions.in instead. + */ + +ARPT_SO_SET_REPLACE +ARPT_SO_SET_ADD_COUNTERS + +EBT_SO_SET_ENTRIES +EBT_SO_SET_COUNTERS + +IP_VS_SO_SET_NONE +IP_VS_SO_SET_INSERT +IP_VS_SO_SET_ADD +IP_VS_SO_SET_EDIT +IP_VS_SO_SET_DEL +IP_VS_SO_SET_FLUSH +IP_VS_SO_SET_LIST +IP_VS_SO_SET_ADDDEST +IP_VS_SO_SET_DELDEST +IP_VS_SO_SET_EDITDEST +IP_VS_SO_SET_TIMEOUT +IP_VS_SO_SET_STARTDAEMON +IP_VS_SO_SET_STOPDAEMON +IP_VS_SO_SET_RESTORE +IP_VS_SO_SET_SAVE +IP_VS_SO_SET_ZERO + +IPT_SO_SET_REPLACE +IPT_SO_SET_ADD_COUNTERS diff --git a/xlat/setsockipv6options.h b/xlat/setsockipv6options.h new file mode 100644 index 00000000..4fea6bc2 --- /dev/null +++ b/xlat/setsockipv6options.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/setsockipv6options.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat setsockipv6options in mpers mode + +#else + +static +const struct xlat setsockipv6options[] = { +/* +* Options specific to setsockopt(SOL_IPV6). +* Common {g,s}etsockopt(SOL_IPV6) options +* should be in sockipv6options.in instead. +*/ + +#if defined(IP6T_SO_SET_REPLACE) || (defined(HAVE_DECL_IP6T_SO_SET_REPLACE) && HAVE_DECL_IP6T_SO_SET_REPLACE) + XLAT(IP6T_SO_SET_REPLACE), +#endif +#if defined(IP6T_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_IP6T_SO_SET_ADD_COUNTERS) && HAVE_DECL_IP6T_SO_SET_ADD_COUNTERS) + XLAT(IP6T_SO_SET_ADD_COUNTERS), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/setsockipv6options.in b/xlat/setsockipv6options.in new file mode 100644 index 00000000..a9eff851 --- /dev/null +++ b/xlat/setsockipv6options.in @@ -0,0 +1,8 @@ +/* + * Options specific to setsockopt(SOL_IPV6). + * Common {g,s}etsockopt(SOL_IPV6) options + * should be in sockipv6options.in instead. + */ + +IP6T_SO_SET_REPLACE +IP6T_SO_SET_ADD_COUNTERS diff --git a/xlat/sfd_flags.h b/xlat/sfd_flags.h new file mode 100644 index 00000000..23d08b81 --- /dev/null +++ b/xlat/sfd_flags.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sfd_flags.in; do not edit. */ +#if defined SFD_CLOEXEC || defined O_CLOEXEC +#if !(defined(SFD_CLOEXEC) || (defined(HAVE_DECL_SFD_CLOEXEC) && HAVE_DECL_SFD_CLOEXEC)) +# define SFD_CLOEXEC O_CLOEXEC +#endif +#endif +#if !(defined(SFD_NONBLOCK) || (defined(HAVE_DECL_SFD_NONBLOCK) && HAVE_DECL_SFD_NONBLOCK)) +# define SFD_NONBLOCK O_NONBLOCK +#endif + +#ifdef IN_MPERS + +# error static const struct xlat sfd_flags in mpers mode + +#else + +static +const struct xlat sfd_flags[] = { +#if defined SFD_CLOEXEC || defined O_CLOEXEC + XLAT(SFD_CLOEXEC), +#endif + XLAT(SFD_NONBLOCK), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/sfd_flags.in b/xlat/sfd_flags.in new file mode 100644 index 00000000..20a5d1f8 --- /dev/null +++ b/xlat/sfd_flags.in @@ -0,0 +1,4 @@ +#if defined SFD_CLOEXEC || defined O_CLOEXEC +SFD_CLOEXEC O_CLOEXEC +#endif +SFD_NONBLOCK O_NONBLOCK diff --git a/xlat/sg_io_dxfer_direction.h b/xlat/sg_io_dxfer_direction.h index eae2eacd..4923016d 100644 --- a/xlat/sg_io_dxfer_direction.h +++ b/xlat/sg_io_dxfer_direction.h @@ -1,17 +1,28 @@ /* Generated by ./xlat/gen.sh from ./xlat/sg_io_dxfer_direction.in; do not edit. */ -static const struct xlat sg_io_dxfer_direction[] = { +#ifdef IN_MPERS + +extern const struct xlat sg_io_dxfer_direction[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sg_io_dxfer_direction[] = { #if defined(SG_DXFER_NONE) || (defined(HAVE_DECL_SG_DXFER_NONE) && HAVE_DECL_SG_DXFER_NONE) - XLAT(SG_DXFER_NONE), + XLAT(SG_DXFER_NONE), #endif #if defined(SG_DXFER_TO_DEV) || (defined(HAVE_DECL_SG_DXFER_TO_DEV) && HAVE_DECL_SG_DXFER_TO_DEV) - XLAT(SG_DXFER_TO_DEV), + XLAT(SG_DXFER_TO_DEV), #endif #if defined(SG_DXFER_FROM_DEV) || (defined(HAVE_DECL_SG_DXFER_FROM_DEV) && HAVE_DECL_SG_DXFER_FROM_DEV) - XLAT(SG_DXFER_FROM_DEV), + XLAT(SG_DXFER_FROM_DEV), #endif #if defined(SG_DXFER_TO_FROM_DEV) || (defined(HAVE_DECL_SG_DXFER_TO_FROM_DEV) && HAVE_DECL_SG_DXFER_TO_FROM_DEV) - XLAT(SG_DXFER_TO_FROM_DEV), + XLAT(SG_DXFER_TO_FROM_DEV), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sg_io_flags.h b/xlat/sg_io_flags.h new file mode 100644 index 00000000..5c25ad7e --- /dev/null +++ b/xlat/sg_io_flags.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sg_io_flags.in; do not edit. */ +#if !(defined(SG_FLAG_DIRECT_IO) || (defined(HAVE_DECL_SG_FLAG_DIRECT_IO) && HAVE_DECL_SG_FLAG_DIRECT_IO)) +# define SG_FLAG_DIRECT_IO 1 +#endif +#if !(defined(SG_FLAG_UNUSED_LUN_INHIBIT) || (defined(HAVE_DECL_SG_FLAG_UNUSED_LUN_INHIBIT) && HAVE_DECL_SG_FLAG_UNUSED_LUN_INHIBIT)) +# define SG_FLAG_UNUSED_LUN_INHIBIT 2 +#endif +#if !(defined(SG_FLAG_MMAP_IO) || (defined(HAVE_DECL_SG_FLAG_MMAP_IO) && HAVE_DECL_SG_FLAG_MMAP_IO)) +# define SG_FLAG_MMAP_IO 4 +#endif +#if !(defined(SG_FLAG_NO_DXFER) || (defined(HAVE_DECL_SG_FLAG_NO_DXFER) && HAVE_DECL_SG_FLAG_NO_DXFER)) +# define SG_FLAG_NO_DXFER 0x10000 +#endif +#if !(defined(SG_FLAG_Q_AT_TAIL) || (defined(HAVE_DECL_SG_FLAG_Q_AT_TAIL) && HAVE_DECL_SG_FLAG_Q_AT_TAIL)) +# define SG_FLAG_Q_AT_TAIL 0x10 +#endif +#if !(defined(SG_FLAG_Q_AT_HEAD) || (defined(HAVE_DECL_SG_FLAG_Q_AT_HEAD) && HAVE_DECL_SG_FLAG_Q_AT_HEAD)) +# define SG_FLAG_Q_AT_HEAD 0x20 +#endif + +#ifdef IN_MPERS + +extern const struct xlat sg_io_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sg_io_flags[] = { + XLAT(SG_FLAG_DIRECT_IO), + XLAT(SG_FLAG_UNUSED_LUN_INHIBIT), + XLAT(SG_FLAG_MMAP_IO), + XLAT(SG_FLAG_NO_DXFER), + XLAT(SG_FLAG_Q_AT_TAIL), + XLAT(SG_FLAG_Q_AT_HEAD), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/sg_io_flags.in b/xlat/sg_io_flags.in new file mode 100644 index 00000000..68ed12c8 --- /dev/null +++ b/xlat/sg_io_flags.in @@ -0,0 +1,6 @@ +SG_FLAG_DIRECT_IO 1 +SG_FLAG_UNUSED_LUN_INHIBIT 2 +SG_FLAG_MMAP_IO 4 +SG_FLAG_NO_DXFER 0x10000 +SG_FLAG_Q_AT_TAIL 0x10 +SG_FLAG_Q_AT_HEAD 0x20 diff --git a/xlat/sg_io_info.h b/xlat/sg_io_info.h new file mode 100644 index 00000000..49929be4 --- /dev/null +++ b/xlat/sg_io_info.h @@ -0,0 +1,21 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sg_io_info.in; do not edit. */ +#if !(defined(SG_INFO_CHECK) || (defined(HAVE_DECL_SG_INFO_CHECK) && HAVE_DECL_SG_INFO_CHECK)) +# define SG_INFO_CHECK 1 +#endif +#if !(defined(SG_INFO_DIRECT_IO) || (defined(HAVE_DECL_SG_INFO_DIRECT_IO) && HAVE_DECL_SG_INFO_DIRECT_IO)) +# define SG_INFO_DIRECT_IO 2 +#endif +#if !(defined(SG_INFO_MIXED_IO) || (defined(HAVE_DECL_SG_INFO_MIXED_IO) && HAVE_DECL_SG_INFO_MIXED_IO)) +# define SG_INFO_MIXED_IO 4 +#endif + +#ifndef IN_MPERS + +const struct xlat sg_io_info[] = { + XLAT(SG_INFO_CHECK), + XLAT(SG_INFO_DIRECT_IO), + XLAT(SG_INFO_MIXED_IO), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/sg_io_info.in b/xlat/sg_io_info.in new file mode 100644 index 00000000..afebe4f3 --- /dev/null +++ b/xlat/sg_io_info.in @@ -0,0 +1,3 @@ +SG_INFO_CHECK 1 +SG_INFO_DIRECT_IO 2 +SG_INFO_MIXED_IO 4 diff --git a/xlat/sg_scsi_reset.h b/xlat/sg_scsi_reset.h new file mode 100644 index 00000000..b33ed1d6 --- /dev/null +++ b/xlat/sg_scsi_reset.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sg_scsi_reset.in; do not edit. */ +#if !(defined(SG_SCSI_RESET_NOTHING) || (defined(HAVE_DECL_SG_SCSI_RESET_NOTHING) && HAVE_DECL_SG_SCSI_RESET_NOTHING)) +# define SG_SCSI_RESET_NOTHING 0 +#endif +#if !(defined(SG_SCSI_RESET_DEVICE) || (defined(HAVE_DECL_SG_SCSI_RESET_DEVICE) && HAVE_DECL_SG_SCSI_RESET_DEVICE)) +# define SG_SCSI_RESET_DEVICE 1 +#endif +#if !(defined(SG_SCSI_RESET_BUS) || (defined(HAVE_DECL_SG_SCSI_RESET_BUS) && HAVE_DECL_SG_SCSI_RESET_BUS)) +# define SG_SCSI_RESET_BUS 2 +#endif +#if !(defined(SG_SCSI_RESET_HOST) || (defined(HAVE_DECL_SG_SCSI_RESET_HOST) && HAVE_DECL_SG_SCSI_RESET_HOST)) +# define SG_SCSI_RESET_HOST 3 +#endif +#if !(defined(SG_SCSI_RESET_TARGET) || (defined(HAVE_DECL_SG_SCSI_RESET_TARGET) && HAVE_DECL_SG_SCSI_RESET_TARGET)) +# define SG_SCSI_RESET_TARGET 4 +#endif +#if !(defined(SG_SCSI_RESET_NO_ESCALATE) || (defined(HAVE_DECL_SG_SCSI_RESET_NO_ESCALATE) && HAVE_DECL_SG_SCSI_RESET_NO_ESCALATE)) +# define SG_SCSI_RESET_NO_ESCALATE 0x100 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat sg_scsi_reset in mpers mode + +#else + +static +const struct xlat sg_scsi_reset[] = { + XLAT(SG_SCSI_RESET_NOTHING), + XLAT(SG_SCSI_RESET_DEVICE), + XLAT(SG_SCSI_RESET_BUS), + XLAT(SG_SCSI_RESET_HOST), + XLAT(SG_SCSI_RESET_TARGET), + XLAT(SG_SCSI_RESET_NO_ESCALATE), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/sg_scsi_reset.in b/xlat/sg_scsi_reset.in new file mode 100644 index 00000000..0df4a90d --- /dev/null +++ b/xlat/sg_scsi_reset.in @@ -0,0 +1,6 @@ +SG_SCSI_RESET_NOTHING 0 +SG_SCSI_RESET_DEVICE 1 +SG_SCSI_RESET_BUS 2 +SG_SCSI_RESET_HOST 3 +SG_SCSI_RESET_TARGET 4 +SG_SCSI_RESET_NO_ESCALATE 0x100 diff --git a/xlat/shm_flags.h b/xlat/shm_flags.h index e4845763..79e54073 100644 --- a/xlat/shm_flags.h +++ b/xlat/shm_flags.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/shm_flags.in; do not edit. */ -static const struct xlat shm_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat shm_flags in mpers mode + +#else + +static +const struct xlat shm_flags[] = { #if defined(SHM_REMAP) || (defined(HAVE_DECL_SHM_REMAP) && HAVE_DECL_SHM_REMAP) - XLAT(SHM_REMAP), + XLAT(SHM_REMAP), #endif #if defined(SHM_RDONLY) || (defined(HAVE_DECL_SHM_RDONLY) && HAVE_DECL_SHM_RDONLY) - XLAT(SHM_RDONLY), + XLAT(SHM_RDONLY), #endif #if defined(SHM_RND) || (defined(HAVE_DECL_SHM_RND) && HAVE_DECL_SHM_RND) - XLAT(SHM_RND), + XLAT(SHM_RND), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/shm_resource_flags.h b/xlat/shm_resource_flags.h index 6229774d..b216b45f 100644 --- a/xlat/shm_resource_flags.h +++ b/xlat/shm_resource_flags.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/shm_resource_flags.in; do not edit. */ -static const struct xlat shm_resource_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat shm_resource_flags in mpers mode + +#else + +static +const struct xlat shm_resource_flags[] = { #if defined(IPC_CREAT) || (defined(HAVE_DECL_IPC_CREAT) && HAVE_DECL_IPC_CREAT) - XLAT(IPC_CREAT), + XLAT(IPC_CREAT), #endif #if defined(IPC_EXCL) || (defined(HAVE_DECL_IPC_EXCL) && HAVE_DECL_IPC_EXCL) - XLAT(IPC_EXCL), + XLAT(IPC_EXCL), #endif #if defined(SHM_HUGETLB) || (defined(HAVE_DECL_SHM_HUGETLB) && HAVE_DECL_SHM_HUGETLB) - XLAT(SHM_HUGETLB), + XLAT(SHM_HUGETLB), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/shmctl_flags.h b/xlat/shmctl_flags.h index a67c0157..a5e9f1b8 100644 --- a/xlat/shmctl_flags.h +++ b/xlat/shmctl_flags.h @@ -1,29 +1,42 @@ /* Generated by ./xlat/gen.sh from ./xlat/shmctl_flags.in; do not edit. */ +#if !(defined(SHM_STAT) || (defined(HAVE_DECL_SHM_STAT) && HAVE_DECL_SHM_STAT)) +# define SHM_STAT 13 +#endif +#if !(defined(SHM_INFO) || (defined(HAVE_DECL_SHM_INFO) && HAVE_DECL_SHM_INFO)) +# define SHM_INFO 14 +#endif + +#ifdef IN_MPERS + +extern const struct xlat shmctl_flags[]; -static const struct xlat shmctl_flags[] = { +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat shmctl_flags[] = { #if defined(IPC_RMID) || (defined(HAVE_DECL_IPC_RMID) && HAVE_DECL_IPC_RMID) - XLAT(IPC_RMID), + XLAT(IPC_RMID), #endif #if defined(IPC_SET) || (defined(HAVE_DECL_IPC_SET) && HAVE_DECL_IPC_SET) - XLAT(IPC_SET), + XLAT(IPC_SET), #endif #if defined(IPC_STAT) || (defined(HAVE_DECL_IPC_STAT) && HAVE_DECL_IPC_STAT) - XLAT(IPC_STAT), + XLAT(IPC_STAT), #endif #if defined(IPC_INFO) || (defined(HAVE_DECL_IPC_INFO) && HAVE_DECL_IPC_INFO) - XLAT(IPC_INFO), -#endif -#if defined(SHM_STAT) || (defined(HAVE_DECL_SHM_STAT) && HAVE_DECL_SHM_STAT) - XLAT(SHM_STAT), -#endif -#if defined(SHM_INFO) || (defined(HAVE_DECL_SHM_INFO) && HAVE_DECL_SHM_INFO) - XLAT(SHM_INFO), + XLAT(IPC_INFO), #endif + XLAT(SHM_STAT), + XLAT(SHM_INFO), #if defined(SHM_LOCK) || (defined(HAVE_DECL_SHM_LOCK) && HAVE_DECL_SHM_LOCK) - XLAT(SHM_LOCK), + XLAT(SHM_LOCK), #endif #if defined(SHM_UNLOCK) || (defined(HAVE_DECL_SHM_UNLOCK) && HAVE_DECL_SHM_UNLOCK) - XLAT(SHM_UNLOCK), + XLAT(SHM_UNLOCK), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/shmctl_flags.in b/xlat/shmctl_flags.in index 4a6ff782..08908bb3 100644 --- a/xlat/shmctl_flags.in +++ b/xlat/shmctl_flags.in @@ -2,7 +2,7 @@ IPC_RMID IPC_SET IPC_STAT IPC_INFO -SHM_STAT -SHM_INFO +SHM_STAT 13 +SHM_INFO 14 SHM_LOCK SHM_UNLOCK diff --git a/xlat/shutdown_modes.h b/xlat/shutdown_modes.h index 6e3ab81b..f34cb6b7 100644 --- a/xlat/shutdown_modes.h +++ b/xlat/shutdown_modes.h @@ -1,8 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/shutdown_modes.in; do not edit. */ +#if !(defined(SHUT_RD) || (defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD)) +# define SHUT_RD 0 +#endif +#if !(defined(SHUT_WR) || (defined(HAVE_DECL_SHUT_WR) && HAVE_DECL_SHUT_WR)) +# define SHUT_WR 1 +#endif +#if !(defined(SHUT_RDWR) || (defined(HAVE_DECL_SHUT_RDWR) && HAVE_DECL_SHUT_RDWR)) +# define SHUT_RDWR 2 +#endif -static const struct xlat shutdown_modes[] = { -{ 0, "SHUT_RD" }, -{ 1, "SHUT_WR" }, -{ 2, "SHUT_RDWR" }, - XLAT_END +#ifdef IN_MPERS + +# error static const struct xlat shutdown_modes in mpers mode + +#else + +static +const struct xlat shutdown_modes[] = { + XLAT(SHUT_RD), + XLAT(SHUT_WR), + XLAT(SHUT_RDWR), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/shutdown_modes.in b/xlat/shutdown_modes.in index 8ee550ab..29967116 100644 --- a/xlat/shutdown_modes.in +++ b/xlat/shutdown_modes.in @@ -1,3 +1,3 @@ - { 0, "SHUT_RD" }, - { 1, "SHUT_WR" }, - { 2, "SHUT_RDWR" }, +SHUT_RD 0 +SHUT_WR 1 +SHUT_RDWR 2 diff --git a/xlat/sigact_flags.h b/xlat/sigact_flags.h index 0ee2f2bd..31debc49 100644 --- a/xlat/sigact_flags.h +++ b/xlat/sigact_flags.h @@ -1,57 +1,70 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigact_flags.in; do not edit. */ +#if defined SA_NOMASK && SA_NODEFER != SA_NOMASK +#endif +#if defined SA_ONESHOT && SA_ONESHOT != SA_RESETHAND +#endif -static const struct xlat sigact_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat sigact_flags in mpers mode + +#else + +static +const struct xlat sigact_flags[] = { #if defined(SA_RESTORER) || (defined(HAVE_DECL_SA_RESTORER) && HAVE_DECL_SA_RESTORER) - XLAT(SA_RESTORER), + XLAT(SA_RESTORER), #endif #if defined(SA_STACK) || (defined(HAVE_DECL_SA_STACK) && HAVE_DECL_SA_STACK) - XLAT(SA_STACK), + XLAT(SA_STACK), #endif #if defined(SA_RESTART) || (defined(HAVE_DECL_SA_RESTART) && HAVE_DECL_SA_RESTART) - XLAT(SA_RESTART), + XLAT(SA_RESTART), #endif #if defined(SA_INTERRUPT) || (defined(HAVE_DECL_SA_INTERRUPT) && HAVE_DECL_SA_INTERRUPT) - XLAT(SA_INTERRUPT), + XLAT(SA_INTERRUPT), #endif #if defined(SA_NODEFER) || (defined(HAVE_DECL_SA_NODEFER) && HAVE_DECL_SA_NODEFER) - XLAT(SA_NODEFER), + XLAT(SA_NODEFER), #endif #if defined SA_NOMASK && SA_NODEFER != SA_NOMASK #if defined(SA_NOMASK) || (defined(HAVE_DECL_SA_NOMASK) && HAVE_DECL_SA_NOMASK) - XLAT(SA_NOMASK), + XLAT(SA_NOMASK), #endif #endif #if defined(SA_RESETHAND) || (defined(HAVE_DECL_SA_RESETHAND) && HAVE_DECL_SA_RESETHAND) - XLAT(SA_RESETHAND), + XLAT(SA_RESETHAND), #endif #if defined SA_ONESHOT && SA_ONESHOT != SA_RESETHAND #if defined(SA_ONESHOT) || (defined(HAVE_DECL_SA_ONESHOT) && HAVE_DECL_SA_ONESHOT) - XLAT(SA_ONESHOT), + XLAT(SA_ONESHOT), #endif #endif #if defined(SA_SIGINFO) || (defined(HAVE_DECL_SA_SIGINFO) && HAVE_DECL_SA_SIGINFO) - XLAT(SA_SIGINFO), + XLAT(SA_SIGINFO), #endif #if defined(SA_RESETHAND) || (defined(HAVE_DECL_SA_RESETHAND) && HAVE_DECL_SA_RESETHAND) - XLAT(SA_RESETHAND), + XLAT(SA_RESETHAND), #endif #if defined(SA_ONSTACK) || (defined(HAVE_DECL_SA_ONSTACK) && HAVE_DECL_SA_ONSTACK) - XLAT(SA_ONSTACK), + XLAT(SA_ONSTACK), #endif #if defined(SA_NODEFER) || (defined(HAVE_DECL_SA_NODEFER) && HAVE_DECL_SA_NODEFER) - XLAT(SA_NODEFER), + XLAT(SA_NODEFER), #endif #if defined(SA_NOCLDSTOP) || (defined(HAVE_DECL_SA_NOCLDSTOP) && HAVE_DECL_SA_NOCLDSTOP) - XLAT(SA_NOCLDSTOP), + XLAT(SA_NOCLDSTOP), #endif #if defined(SA_NOCLDWAIT) || (defined(HAVE_DECL_SA_NOCLDWAIT) && HAVE_DECL_SA_NOCLDWAIT) - XLAT(SA_NOCLDWAIT), + XLAT(SA_NOCLDWAIT), #endif #if defined(_SA_BSDCALL) || (defined(HAVE_DECL__SA_BSDCALL) && HAVE_DECL__SA_BSDCALL) - XLAT(_SA_BSDCALL), + XLAT(_SA_BSDCALL), #endif #if defined(SA_NOPTRACE) || (defined(HAVE_DECL_SA_NOPTRACE) && HAVE_DECL_SA_NOPTRACE) - XLAT(SA_NOPTRACE), + XLAT(SA_NOPTRACE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigaltstack_flags.h b/xlat/sigaltstack_flags.h index 8d719ede..76ed327d 100644 --- a/xlat/sigaltstack_flags.h +++ b/xlat/sigaltstack_flags.h @@ -1,11 +1,28 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigaltstack_flags.in; do not edit. */ - -static const struct xlat sigaltstack_flags[] = { -#if defined(SS_ONSTACK) || (defined(HAVE_DECL_SS_ONSTACK) && HAVE_DECL_SS_ONSTACK) - XLAT(SS_ONSTACK), +#if !(defined(SS_ONSTACK) || (defined(HAVE_DECL_SS_ONSTACK) && HAVE_DECL_SS_ONSTACK)) +# define SS_ONSTACK 1 +#endif +#if !(defined(SS_DISABLE) || (defined(HAVE_DECL_SS_DISABLE) && HAVE_DECL_SS_DISABLE)) +# define SS_DISABLE 2 #endif -#if defined(SS_DISABLE) || (defined(HAVE_DECL_SS_DISABLE) && HAVE_DECL_SS_DISABLE) - XLAT(SS_DISABLE), +#if !(defined(SS_AUTODISARM) || (defined(HAVE_DECL_SS_AUTODISARM) && HAVE_DECL_SS_AUTODISARM)) +# define SS_AUTODISARM (1U << 31) #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigaltstack_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigaltstack_flags[] = { + XLAT(SS_ONSTACK), + XLAT(SS_DISABLE), + XLAT(SS_AUTODISARM), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigaltstack_flags.in b/xlat/sigaltstack_flags.in index c27a9310..93137984 100644 --- a/xlat/sigaltstack_flags.in +++ b/xlat/sigaltstack_flags.in @@ -1,2 +1,3 @@ -SS_ONSTACK -SS_DISABLE +SS_ONSTACK 1 +SS_DISABLE 2 +SS_AUTODISARM (1U << 31) diff --git a/xlat/sigbus_codes.h b/xlat/sigbus_codes.h index 8ec67c07..4ad49ab7 100644 --- a/xlat/sigbus_codes.h +++ b/xlat/sigbus_codes.h @@ -1,14 +1,36 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigbus_codes.in; do not edit. */ - -static const struct xlat sigbus_codes[] = { -#if defined(BUS_ADRALN) || (defined(HAVE_DECL_BUS_ADRALN) && HAVE_DECL_BUS_ADRALN) - XLAT(BUS_ADRALN), +#if !(defined(BUS_ADRALN) || (defined(HAVE_DECL_BUS_ADRALN) && HAVE_DECL_BUS_ADRALN)) +# define BUS_ADRALN 1 +#endif +#if !(defined(BUS_ADRERR) || (defined(HAVE_DECL_BUS_ADRERR) && HAVE_DECL_BUS_ADRERR)) +# define BUS_ADRERR 2 #endif -#if defined(BUS_ADRERR) || (defined(HAVE_DECL_BUS_ADRERR) && HAVE_DECL_BUS_ADRERR) - XLAT(BUS_ADRERR), +#if !(defined(BUS_OBJERR) || (defined(HAVE_DECL_BUS_OBJERR) && HAVE_DECL_BUS_OBJERR)) +# define BUS_OBJERR 3 #endif -#if defined(BUS_OBJERR) || (defined(HAVE_DECL_BUS_OBJERR) && HAVE_DECL_BUS_OBJERR) - XLAT(BUS_OBJERR), +#if !(defined(BUS_MCEERR_AR) || (defined(HAVE_DECL_BUS_MCEERR_AR) && HAVE_DECL_BUS_MCEERR_AR)) +# define BUS_MCEERR_AR 4 #endif - XLAT_END +#if !(defined(BUS_MCEERR_AO) || (defined(HAVE_DECL_BUS_MCEERR_AO) && HAVE_DECL_BUS_MCEERR_AO)) +# define BUS_MCEERR_AO 5 +#endif + +#ifdef IN_MPERS + +extern const struct xlat sigbus_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigbus_codes[] = { + XLAT(BUS_ADRALN), + XLAT(BUS_ADRERR), + XLAT(BUS_OBJERR), + XLAT(BUS_MCEERR_AR), + XLAT(BUS_MCEERR_AO), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigbus_codes.in b/xlat/sigbus_codes.in index 8d8a048f..1bce25f2 100644 --- a/xlat/sigbus_codes.in +++ b/xlat/sigbus_codes.in @@ -1,3 +1,5 @@ -BUS_ADRALN -BUS_ADRERR -BUS_OBJERR +BUS_ADRALN 1 +BUS_ADRERR 2 +BUS_OBJERR 3 +BUS_MCEERR_AR 4 +BUS_MCEERR_AO 5 diff --git a/xlat/sigchld_codes.h b/xlat/sigchld_codes.h index 6604db32..e1bf046d 100644 --- a/xlat/sigchld_codes.h +++ b/xlat/sigchld_codes.h @@ -1,23 +1,40 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigchld_codes.in; do not edit. */ - -static const struct xlat sigchld_codes[] = { -#if defined(CLD_EXITED) || (defined(HAVE_DECL_CLD_EXITED) && HAVE_DECL_CLD_EXITED) - XLAT(CLD_EXITED), +#if !(defined(CLD_EXITED) || (defined(HAVE_DECL_CLD_EXITED) && HAVE_DECL_CLD_EXITED)) +# define CLD_EXITED 1 #endif -#if defined(CLD_KILLED) || (defined(HAVE_DECL_CLD_KILLED) && HAVE_DECL_CLD_KILLED) - XLAT(CLD_KILLED), +#if !(defined(CLD_KILLED) || (defined(HAVE_DECL_CLD_KILLED) && HAVE_DECL_CLD_KILLED)) +# define CLD_KILLED 2 #endif -#if defined(CLD_DUMPED) || (defined(HAVE_DECL_CLD_DUMPED) && HAVE_DECL_CLD_DUMPED) - XLAT(CLD_DUMPED), +#if !(defined(CLD_DUMPED) || (defined(HAVE_DECL_CLD_DUMPED) && HAVE_DECL_CLD_DUMPED)) +# define CLD_DUMPED 3 #endif -#if defined(CLD_TRAPPED) || (defined(HAVE_DECL_CLD_TRAPPED) && HAVE_DECL_CLD_TRAPPED) - XLAT(CLD_TRAPPED), +#if !(defined(CLD_TRAPPED) || (defined(HAVE_DECL_CLD_TRAPPED) && HAVE_DECL_CLD_TRAPPED)) +# define CLD_TRAPPED 4 #endif -#if defined(CLD_STOPPED) || (defined(HAVE_DECL_CLD_STOPPED) && HAVE_DECL_CLD_STOPPED) - XLAT(CLD_STOPPED), +#if !(defined(CLD_STOPPED) || (defined(HAVE_DECL_CLD_STOPPED) && HAVE_DECL_CLD_STOPPED)) +# define CLD_STOPPED 5 #endif -#if defined(CLD_CONTINUED) || (defined(HAVE_DECL_CLD_CONTINUED) && HAVE_DECL_CLD_CONTINUED) - XLAT(CLD_CONTINUED), +#if !(defined(CLD_CONTINUED) || (defined(HAVE_DECL_CLD_CONTINUED) && HAVE_DECL_CLD_CONTINUED)) +# define CLD_CONTINUED 6 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigchld_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigchld_codes[] = { + XLAT(CLD_EXITED), + XLAT(CLD_KILLED), + XLAT(CLD_DUMPED), + XLAT(CLD_TRAPPED), + XLAT(CLD_STOPPED), + XLAT(CLD_CONTINUED), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigchld_codes.in b/xlat/sigchld_codes.in index 40c93ce0..202bec44 100644 --- a/xlat/sigchld_codes.in +++ b/xlat/sigchld_codes.in @@ -1,6 +1,6 @@ -CLD_EXITED -CLD_KILLED -CLD_DUMPED -CLD_TRAPPED -CLD_STOPPED -CLD_CONTINUED +CLD_EXITED 1 +CLD_KILLED 2 +CLD_DUMPED 3 +CLD_TRAPPED 4 +CLD_STOPPED 5 +CLD_CONTINUED 6 diff --git a/xlat/sigemt_codes.h b/xlat/sigemt_codes.h index ab87c406..68f6fb4d 100644 --- a/xlat/sigemt_codes.h +++ b/xlat/sigemt_codes.h @@ -1,8 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigemt_codes.in; do not edit. */ - -static const struct xlat sigemt_codes[] = { -#if defined(EMT_TAGOVF) || (defined(HAVE_DECL_EMT_TAGOVF) && HAVE_DECL_EMT_TAGOVF) - XLAT(EMT_TAGOVF), +#if !(defined(EMT_TAGOVF) || (defined(HAVE_DECL_EMT_TAGOVF) && HAVE_DECL_EMT_TAGOVF)) +# define EMT_TAGOVF 1 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigemt_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigemt_codes[] = { + XLAT(EMT_TAGOVF), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigemt_codes.in b/xlat/sigemt_codes.in index 63fe3a3a..eb875616 100644 --- a/xlat/sigemt_codes.in +++ b/xlat/sigemt_codes.in @@ -1 +1 @@ -EMT_TAGOVF +EMT_TAGOVF 1 diff --git a/xlat/sigev_value.h b/xlat/sigev_value.h index da73c058..7c569a5a 100644 --- a/xlat/sigev_value.h +++ b/xlat/sigev_value.h @@ -1,17 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigev_value.in; do not edit. */ - -static const struct xlat sigev_value[] = { -#if defined(SIGEV_SIGNAL) || (defined(HAVE_DECL_SIGEV_SIGNAL) && HAVE_DECL_SIGEV_SIGNAL) - XLAT(SIGEV_SIGNAL), +#if !(defined(SIGEV_SIGNAL) || (defined(HAVE_DECL_SIGEV_SIGNAL) && HAVE_DECL_SIGEV_SIGNAL)) +# define SIGEV_SIGNAL 0 #endif -#if defined(SIGEV_NONE) || (defined(HAVE_DECL_SIGEV_NONE) && HAVE_DECL_SIGEV_NONE) - XLAT(SIGEV_NONE), +#if !(defined(SIGEV_NONE) || (defined(HAVE_DECL_SIGEV_NONE) && HAVE_DECL_SIGEV_NONE)) +# define SIGEV_NONE 1 #endif -#if defined(SIGEV_THREAD) || (defined(HAVE_DECL_SIGEV_THREAD) && HAVE_DECL_SIGEV_THREAD) - XLAT(SIGEV_THREAD), +#if !(defined(SIGEV_THREAD) || (defined(HAVE_DECL_SIGEV_THREAD) && HAVE_DECL_SIGEV_THREAD)) +# define SIGEV_THREAD 2 #endif -#if defined(SIGEV_THREAD_ID) || (defined(HAVE_DECL_SIGEV_THREAD_ID) && HAVE_DECL_SIGEV_THREAD_ID) - XLAT(SIGEV_THREAD_ID), +#if !(defined(SIGEV_THREAD_ID) || (defined(HAVE_DECL_SIGEV_THREAD_ID) && HAVE_DECL_SIGEV_THREAD_ID)) +# define SIGEV_THREAD_ID 4 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigev_value[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigev_value[] = { + XLAT(SIGEV_SIGNAL), + XLAT(SIGEV_NONE), + XLAT(SIGEV_THREAD), + XLAT(SIGEV_THREAD_ID), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigev_value.in b/xlat/sigev_value.in index 8b4c95e1..d09806bb 100644 --- a/xlat/sigev_value.in +++ b/xlat/sigev_value.in @@ -1,4 +1,4 @@ -SIGEV_SIGNAL -SIGEV_NONE -SIGEV_THREAD -SIGEV_THREAD_ID +SIGEV_SIGNAL 0 +SIGEV_NONE 1 +SIGEV_THREAD 2 +SIGEV_THREAD_ID 4 diff --git a/xlat/sigfpe_codes.h b/xlat/sigfpe_codes.h index d69a26ca..c9e29597 100644 --- a/xlat/sigfpe_codes.h +++ b/xlat/sigfpe_codes.h @@ -1,29 +1,48 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigfpe_codes.in; do not edit. */ - -static const struct xlat sigfpe_codes[] = { -#if defined(FPE_INTDIV) || (defined(HAVE_DECL_FPE_INTDIV) && HAVE_DECL_FPE_INTDIV) - XLAT(FPE_INTDIV), +#if !(defined(FPE_INTDIV) || (defined(HAVE_DECL_FPE_INTDIV) && HAVE_DECL_FPE_INTDIV)) +# define FPE_INTDIV 1 #endif -#if defined(FPE_INTOVF) || (defined(HAVE_DECL_FPE_INTOVF) && HAVE_DECL_FPE_INTOVF) - XLAT(FPE_INTOVF), +#if !(defined(FPE_INTOVF) || (defined(HAVE_DECL_FPE_INTOVF) && HAVE_DECL_FPE_INTOVF)) +# define FPE_INTOVF 2 #endif -#if defined(FPE_FLTDIV) || (defined(HAVE_DECL_FPE_FLTDIV) && HAVE_DECL_FPE_FLTDIV) - XLAT(FPE_FLTDIV), +#if !(defined(FPE_FLTDIV) || (defined(HAVE_DECL_FPE_FLTDIV) && HAVE_DECL_FPE_FLTDIV)) +# define FPE_FLTDIV 3 #endif -#if defined(FPE_FLTOVF) || (defined(HAVE_DECL_FPE_FLTOVF) && HAVE_DECL_FPE_FLTOVF) - XLAT(FPE_FLTOVF), +#if !(defined(FPE_FLTOVF) || (defined(HAVE_DECL_FPE_FLTOVF) && HAVE_DECL_FPE_FLTOVF)) +# define FPE_FLTOVF 4 #endif -#if defined(FPE_FLTUND) || (defined(HAVE_DECL_FPE_FLTUND) && HAVE_DECL_FPE_FLTUND) - XLAT(FPE_FLTUND), +#if !(defined(FPE_FLTUND) || (defined(HAVE_DECL_FPE_FLTUND) && HAVE_DECL_FPE_FLTUND)) +# define FPE_FLTUND 5 #endif -#if defined(FPE_FLTRES) || (defined(HAVE_DECL_FPE_FLTRES) && HAVE_DECL_FPE_FLTRES) - XLAT(FPE_FLTRES), +#if !(defined(FPE_FLTRES) || (defined(HAVE_DECL_FPE_FLTRES) && HAVE_DECL_FPE_FLTRES)) +# define FPE_FLTRES 6 #endif -#if defined(FPE_FLTINV) || (defined(HAVE_DECL_FPE_FLTINV) && HAVE_DECL_FPE_FLTINV) - XLAT(FPE_FLTINV), +#if !(defined(FPE_FLTINV) || (defined(HAVE_DECL_FPE_FLTINV) && HAVE_DECL_FPE_FLTINV)) +# define FPE_FLTINV 7 #endif -#if defined(FPE_FLTSUB) || (defined(HAVE_DECL_FPE_FLTSUB) && HAVE_DECL_FPE_FLTSUB) - XLAT(FPE_FLTSUB), +#if !(defined(FPE_FLTSUB) || (defined(HAVE_DECL_FPE_FLTSUB) && HAVE_DECL_FPE_FLTSUB)) +# define FPE_FLTSUB 8 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigfpe_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigfpe_codes[] = { + XLAT(FPE_INTDIV), + XLAT(FPE_INTOVF), + XLAT(FPE_FLTDIV), + XLAT(FPE_FLTOVF), + XLAT(FPE_FLTUND), + XLAT(FPE_FLTRES), + XLAT(FPE_FLTINV), + XLAT(FPE_FLTSUB), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigfpe_codes.in b/xlat/sigfpe_codes.in index ab86b261..4ef0667a 100644 --- a/xlat/sigfpe_codes.in +++ b/xlat/sigfpe_codes.in @@ -1,8 +1,8 @@ -FPE_INTDIV -FPE_INTOVF -FPE_FLTDIV -FPE_FLTOVF -FPE_FLTUND -FPE_FLTRES -FPE_FLTINV -FPE_FLTSUB +FPE_INTDIV 1 +FPE_INTOVF 2 +FPE_FLTDIV 3 +FPE_FLTOVF 4 +FPE_FLTUND 5 +FPE_FLTRES 6 +FPE_FLTINV 7 +FPE_FLTSUB 8 diff --git a/xlat/sigill_codes.h b/xlat/sigill_codes.h index ac6445ab..f16a69c8 100644 --- a/xlat/sigill_codes.h +++ b/xlat/sigill_codes.h @@ -1,29 +1,48 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigill_codes.in; do not edit. */ - -static const struct xlat sigill_codes[] = { -#if defined(ILL_ILLOPC) || (defined(HAVE_DECL_ILL_ILLOPC) && HAVE_DECL_ILL_ILLOPC) - XLAT(ILL_ILLOPC), +#if !(defined(ILL_ILLOPC) || (defined(HAVE_DECL_ILL_ILLOPC) && HAVE_DECL_ILL_ILLOPC)) +# define ILL_ILLOPC 1 #endif -#if defined(ILL_ILLOPN) || (defined(HAVE_DECL_ILL_ILLOPN) && HAVE_DECL_ILL_ILLOPN) - XLAT(ILL_ILLOPN), +#if !(defined(ILL_ILLOPN) || (defined(HAVE_DECL_ILL_ILLOPN) && HAVE_DECL_ILL_ILLOPN)) +# define ILL_ILLOPN 2 #endif -#if defined(ILL_ILLADR) || (defined(HAVE_DECL_ILL_ILLADR) && HAVE_DECL_ILL_ILLADR) - XLAT(ILL_ILLADR), +#if !(defined(ILL_ILLADR) || (defined(HAVE_DECL_ILL_ILLADR) && HAVE_DECL_ILL_ILLADR)) +# define ILL_ILLADR 3 #endif -#if defined(ILL_ILLTRP) || (defined(HAVE_DECL_ILL_ILLTRP) && HAVE_DECL_ILL_ILLTRP) - XLAT(ILL_ILLTRP), +#if !(defined(ILL_ILLTRP) || (defined(HAVE_DECL_ILL_ILLTRP) && HAVE_DECL_ILL_ILLTRP)) +# define ILL_ILLTRP 4 #endif -#if defined(ILL_PRVOPC) || (defined(HAVE_DECL_ILL_PRVOPC) && HAVE_DECL_ILL_PRVOPC) - XLAT(ILL_PRVOPC), +#if !(defined(ILL_PRVOPC) || (defined(HAVE_DECL_ILL_PRVOPC) && HAVE_DECL_ILL_PRVOPC)) +# define ILL_PRVOPC 5 #endif -#if defined(ILL_PRVREG) || (defined(HAVE_DECL_ILL_PRVREG) && HAVE_DECL_ILL_PRVREG) - XLAT(ILL_PRVREG), +#if !(defined(ILL_PRVREG) || (defined(HAVE_DECL_ILL_PRVREG) && HAVE_DECL_ILL_PRVREG)) +# define ILL_PRVREG 6 #endif -#if defined(ILL_COPROC) || (defined(HAVE_DECL_ILL_COPROC) && HAVE_DECL_ILL_COPROC) - XLAT(ILL_COPROC), +#if !(defined(ILL_COPROC) || (defined(HAVE_DECL_ILL_COPROC) && HAVE_DECL_ILL_COPROC)) +# define ILL_COPROC 7 #endif -#if defined(ILL_BADSTK) || (defined(HAVE_DECL_ILL_BADSTK) && HAVE_DECL_ILL_BADSTK) - XLAT(ILL_BADSTK), +#if !(defined(ILL_BADSTK) || (defined(HAVE_DECL_ILL_BADSTK) && HAVE_DECL_ILL_BADSTK)) +# define ILL_BADSTK 8 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigill_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigill_codes[] = { + XLAT(ILL_ILLOPC), + XLAT(ILL_ILLOPN), + XLAT(ILL_ILLADR), + XLAT(ILL_ILLTRP), + XLAT(ILL_PRVOPC), + XLAT(ILL_PRVREG), + XLAT(ILL_COPROC), + XLAT(ILL_BADSTK), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigill_codes.in b/xlat/sigill_codes.in index 6fb994e5..ca111ec8 100644 --- a/xlat/sigill_codes.in +++ b/xlat/sigill_codes.in @@ -1,8 +1,8 @@ -ILL_ILLOPC -ILL_ILLOPN -ILL_ILLADR -ILL_ILLTRP -ILL_PRVOPC -ILL_PRVREG -ILL_COPROC -ILL_BADSTK +ILL_ILLOPC 1 +ILL_ILLOPN 2 +ILL_ILLADR 3 +ILL_ILLTRP 4 +ILL_PRVOPC 5 +ILL_PRVREG 6 +ILL_COPROC 7 +ILL_BADSTK 8 diff --git a/xlat/siginfo_codes.h b/xlat/siginfo_codes.h index e9b41749..faef6c79 100644 --- a/xlat/siginfo_codes.h +++ b/xlat/siginfo_codes.h @@ -1,41 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/siginfo_codes.in; do not edit. */ - -static const struct xlat siginfo_codes[] = { -#if defined(SI_KERNEL) || (defined(HAVE_DECL_SI_KERNEL) && HAVE_DECL_SI_KERNEL) - XLAT(SI_KERNEL), +#if !(defined(SI_USER) || (defined(HAVE_DECL_SI_USER) && HAVE_DECL_SI_USER)) +# define SI_USER 0 #endif -#if defined(SI_USER) || (defined(HAVE_DECL_SI_USER) && HAVE_DECL_SI_USER) - XLAT(SI_USER), +#if !(defined(SI_KERNEL) || (defined(HAVE_DECL_SI_KERNEL) && HAVE_DECL_SI_KERNEL)) +# define SI_KERNEL 0x80 #endif -#if defined(SI_QUEUE) || (defined(HAVE_DECL_SI_QUEUE) && HAVE_DECL_SI_QUEUE) - XLAT(SI_QUEUE), +#if !(defined(SI_QUEUE) || (defined(HAVE_DECL_SI_QUEUE) && HAVE_DECL_SI_QUEUE)) +# define SI_QUEUE -1 #endif -#if defined(SI_TIMER) || (defined(HAVE_DECL_SI_TIMER) && HAVE_DECL_SI_TIMER) - XLAT(SI_TIMER), +#if !(defined(SI_TIMER) || (defined(HAVE_DECL_SI_TIMER) && HAVE_DECL_SI_TIMER)) +# define SI_TIMER -2 #endif -#if defined(SI_MESGQ) || (defined(HAVE_DECL_SI_MESGQ) && HAVE_DECL_SI_MESGQ) - XLAT(SI_MESGQ), +#if !(defined(SI_MESGQ) || (defined(HAVE_DECL_SI_MESGQ) && HAVE_DECL_SI_MESGQ)) +# define SI_MESGQ -3 #endif -#if defined(SI_ASYNCIO) || (defined(HAVE_DECL_SI_ASYNCIO) && HAVE_DECL_SI_ASYNCIO) - XLAT(SI_ASYNCIO), +#if !(defined(SI_ASYNCIO) || (defined(HAVE_DECL_SI_ASYNCIO) && HAVE_DECL_SI_ASYNCIO)) +# define SI_ASYNCIO -4 #endif -#if defined(SI_SIGIO) || (defined(HAVE_DECL_SI_SIGIO) && HAVE_DECL_SI_SIGIO) - XLAT(SI_SIGIO), +#if !(defined(SI_SIGIO) || (defined(HAVE_DECL_SI_SIGIO) && HAVE_DECL_SI_SIGIO)) +# define SI_SIGIO -5 #endif -#if defined(SI_TKILL) || (defined(HAVE_DECL_SI_TKILL) && HAVE_DECL_SI_TKILL) - XLAT(SI_TKILL), +#if !(defined(SI_TKILL) || (defined(HAVE_DECL_SI_TKILL) && HAVE_DECL_SI_TKILL)) +# define SI_TKILL -6 #endif -#if defined(SI_DETHREAD) || (defined(HAVE_DECL_SI_DETHREAD) && HAVE_DECL_SI_DETHREAD) - XLAT(SI_DETHREAD), +#if !(defined(SI_DETHREAD) || (defined(HAVE_DECL_SI_DETHREAD) && HAVE_DECL_SI_DETHREAD)) +# define SI_DETHREAD -7 #endif -#if defined(SI_ASYNCNL) || (defined(HAVE_DECL_SI_ASYNCNL) && HAVE_DECL_SI_ASYNCNL) - XLAT(SI_ASYNCNL), +#if !(defined(SI_ASYNCNL) || (defined(HAVE_DECL_SI_ASYNCNL) && HAVE_DECL_SI_ASYNCNL)) +# define SI_ASYNCNL -60 #endif + +#ifdef IN_MPERS + +extern const struct xlat siginfo_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat siginfo_codes[] = { + XLAT(SI_USER), + XLAT(SI_KERNEL), + XLAT(SI_QUEUE), + XLAT(SI_TIMER), + XLAT(SI_MESGQ), + XLAT(SI_ASYNCIO), + XLAT(SI_SIGIO), + XLAT(SI_TKILL), + XLAT(SI_DETHREAD), + XLAT(SI_ASYNCNL), #if defined(SI_NOINFO) || (defined(HAVE_DECL_SI_NOINFO) && HAVE_DECL_SI_NOINFO) - XLAT(SI_NOINFO), + XLAT(SI_NOINFO), #endif #if defined(SI_LWP) || (defined(HAVE_DECL_SI_LWP) && HAVE_DECL_SI_LWP) - XLAT(SI_LWP), + XLAT(SI_LWP), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/siginfo_codes.in b/xlat/siginfo_codes.in index 115d3ab6..a57c370c 100644 --- a/xlat/siginfo_codes.in +++ b/xlat/siginfo_codes.in @@ -1,12 +1,12 @@ -SI_KERNEL -SI_USER -SI_QUEUE -SI_TIMER -SI_MESGQ -SI_ASYNCIO -SI_SIGIO -SI_TKILL -SI_DETHREAD -SI_ASYNCNL +SI_USER 0 +SI_KERNEL 0x80 +SI_QUEUE -1 +SI_TIMER -2 +SI_MESGQ -3 +SI_ASYNCIO -4 +SI_SIGIO -5 +SI_TKILL -6 +SI_DETHREAD -7 +SI_ASYNCNL -60 SI_NOINFO SI_LWP diff --git a/xlat/sigpoll_codes.h b/xlat/sigpoll_codes.h index c50a5155..55cc1bbf 100644 --- a/xlat/sigpoll_codes.h +++ b/xlat/sigpoll_codes.h @@ -1,23 +1,40 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigpoll_codes.in; do not edit. */ - -static const struct xlat sigpoll_codes[] = { -#if defined(POLL_IN) || (defined(HAVE_DECL_POLL_IN) && HAVE_DECL_POLL_IN) - XLAT(POLL_IN), +#if !(defined(POLL_IN) || (defined(HAVE_DECL_POLL_IN) && HAVE_DECL_POLL_IN)) +# define POLL_IN 1 #endif -#if defined(POLL_OUT) || (defined(HAVE_DECL_POLL_OUT) && HAVE_DECL_POLL_OUT) - XLAT(POLL_OUT), +#if !(defined(POLL_OUT) || (defined(HAVE_DECL_POLL_OUT) && HAVE_DECL_POLL_OUT)) +# define POLL_OUT 2 #endif -#if defined(POLL_MSG) || (defined(HAVE_DECL_POLL_MSG) && HAVE_DECL_POLL_MSG) - XLAT(POLL_MSG), +#if !(defined(POLL_MSG) || (defined(HAVE_DECL_POLL_MSG) && HAVE_DECL_POLL_MSG)) +# define POLL_MSG 3 #endif -#if defined(POLL_ERR) || (defined(HAVE_DECL_POLL_ERR) && HAVE_DECL_POLL_ERR) - XLAT(POLL_ERR), +#if !(defined(POLL_ERR) || (defined(HAVE_DECL_POLL_ERR) && HAVE_DECL_POLL_ERR)) +# define POLL_ERR 4 #endif -#if defined(POLL_PRI) || (defined(HAVE_DECL_POLL_PRI) && HAVE_DECL_POLL_PRI) - XLAT(POLL_PRI), +#if !(defined(POLL_PRI) || (defined(HAVE_DECL_POLL_PRI) && HAVE_DECL_POLL_PRI)) +# define POLL_PRI 5 #endif -#if defined(POLL_HUP) || (defined(HAVE_DECL_POLL_HUP) && HAVE_DECL_POLL_HUP) - XLAT(POLL_HUP), +#if !(defined(POLL_HUP) || (defined(HAVE_DECL_POLL_HUP) && HAVE_DECL_POLL_HUP)) +# define POLL_HUP 6 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigpoll_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigpoll_codes[] = { + XLAT(POLL_IN), + XLAT(POLL_OUT), + XLAT(POLL_MSG), + XLAT(POLL_ERR), + XLAT(POLL_PRI), + XLAT(POLL_HUP), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigpoll_codes.in b/xlat/sigpoll_codes.in index f778fc60..00c2a1b7 100644 --- a/xlat/sigpoll_codes.in +++ b/xlat/sigpoll_codes.in @@ -1,6 +1,6 @@ -POLL_IN -POLL_OUT -POLL_MSG -POLL_ERR -POLL_PRI -POLL_HUP +POLL_IN 1 +POLL_OUT 2 +POLL_MSG 3 +POLL_ERR 4 +POLL_PRI 5 +POLL_HUP 6 diff --git a/xlat/sigprocmaskcmds.h b/xlat/sigprocmaskcmds.h index 18fc2f6c..427680bd 100644 --- a/xlat/sigprocmaskcmds.h +++ b/xlat/sigprocmaskcmds.h @@ -1,17 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigprocmaskcmds.in; do not edit. */ -static const struct xlat sigprocmaskcmds[] = { +#ifdef IN_MPERS + +# error static const struct xlat sigprocmaskcmds in mpers mode + +#else + +static +const struct xlat sigprocmaskcmds[] = { #if defined(SIG_BLOCK) || (defined(HAVE_DECL_SIG_BLOCK) && HAVE_DECL_SIG_BLOCK) - XLAT(SIG_BLOCK), + XLAT(SIG_BLOCK), #endif #if defined(SIG_UNBLOCK) || (defined(HAVE_DECL_SIG_UNBLOCK) && HAVE_DECL_SIG_UNBLOCK) - XLAT(SIG_UNBLOCK), + XLAT(SIG_UNBLOCK), #endif #if defined(SIG_SETMASK) || (defined(HAVE_DECL_SIG_SETMASK) && HAVE_DECL_SIG_SETMASK) - XLAT(SIG_SETMASK), + XLAT(SIG_SETMASK), #endif #if defined(SIG_SETMASK32) || (defined(HAVE_DECL_SIG_SETMASK32) && HAVE_DECL_SIG_SETMASK32) - XLAT(SIG_SETMASK32), + XLAT(SIG_SETMASK32), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigprof_codes.h b/xlat/sigprof_codes.h index 02e98e7a..2323b9e7 100644 --- a/xlat/sigprof_codes.h +++ b/xlat/sigprof_codes.h @@ -1,8 +1,19 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigprof_codes.in; do not edit. */ -static const struct xlat sigprof_codes[] = { +#ifdef IN_MPERS + +extern const struct xlat sigprof_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigprof_codes[] = { #if defined(PROF_SIG) || (defined(HAVE_DECL_PROF_SIG) && HAVE_DECL_PROF_SIG) - XLAT(PROF_SIG), + XLAT(PROF_SIG), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigsegv_codes.h b/xlat/sigsegv_codes.h index 3de5370e..67034cba 100644 --- a/xlat/sigsegv_codes.h +++ b/xlat/sigsegv_codes.h @@ -1,11 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigsegv_codes.in; do not edit. */ - -static const struct xlat sigsegv_codes[] = { -#if defined(SEGV_MAPERR) || (defined(HAVE_DECL_SEGV_MAPERR) && HAVE_DECL_SEGV_MAPERR) - XLAT(SEGV_MAPERR), +#if !(defined(SEGV_MAPERR) || (defined(HAVE_DECL_SEGV_MAPERR) && HAVE_DECL_SEGV_MAPERR)) +# define SEGV_MAPERR 1 +#endif +#if !(defined(SEGV_ACCERR) || (defined(HAVE_DECL_SEGV_ACCERR) && HAVE_DECL_SEGV_ACCERR)) +# define SEGV_ACCERR 2 #endif -#if defined(SEGV_ACCERR) || (defined(HAVE_DECL_SEGV_ACCERR) && HAVE_DECL_SEGV_ACCERR) - XLAT(SEGV_ACCERR), +#if !(defined(SEGV_BNDERR) || (defined(HAVE_DECL_SEGV_BNDERR) && HAVE_DECL_SEGV_BNDERR)) +# define SEGV_BNDERR 3 #endif - XLAT_END +#if !(defined(SEGV_PKUERR) || (defined(HAVE_DECL_SEGV_PKUERR) && HAVE_DECL_SEGV_PKUERR)) +# define SEGV_PKUERR 4 +#endif + +#ifdef IN_MPERS + +extern const struct xlat sigsegv_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigsegv_codes[] = { + XLAT(SEGV_MAPERR), + XLAT(SEGV_ACCERR), + XLAT(SEGV_BNDERR), + XLAT(SEGV_PKUERR), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigsegv_codes.in b/xlat/sigsegv_codes.in index bdf3d7e4..09c16069 100644 --- a/xlat/sigsegv_codes.in +++ b/xlat/sigsegv_codes.in @@ -1,2 +1,4 @@ -SEGV_MAPERR -SEGV_ACCERR +SEGV_MAPERR 1 +SEGV_ACCERR 2 +SEGV_BNDERR 3 +SEGV_PKUERR 4 diff --git a/xlat/sigsys_codes.h b/xlat/sigsys_codes.h index a7ef5e28..6fba1fbb 100644 --- a/xlat/sigsys_codes.h +++ b/xlat/sigsys_codes.h @@ -1,8 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigsys_codes.in; do not edit. */ - -static const struct xlat sigsys_codes[] = { -#if defined(SYS_SECCOMP) || (defined(HAVE_DECL_SYS_SECCOMP) && HAVE_DECL_SYS_SECCOMP) - XLAT(SYS_SECCOMP), +#if !(defined(SYS_SECCOMP) || (defined(HAVE_DECL_SYS_SECCOMP) && HAVE_DECL_SYS_SECCOMP)) +# define SYS_SECCOMP 1 #endif - XLAT_END + +#ifdef IN_MPERS + +extern const struct xlat sigsys_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigsys_codes[] = { + XLAT(SYS_SECCOMP), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigsys_codes.in b/xlat/sigsys_codes.in index 7eaa40a8..a8c48916 100644 --- a/xlat/sigsys_codes.in +++ b/xlat/sigsys_codes.in @@ -1 +1 @@ -SYS_SECCOMP +SYS_SECCOMP 1 diff --git a/xlat/sigtrap_codes.h b/xlat/sigtrap_codes.h index c9101a27..f451dc44 100644 --- a/xlat/sigtrap_codes.h +++ b/xlat/sigtrap_codes.h @@ -1,11 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigtrap_codes.in; do not edit. */ - -static const struct xlat sigtrap_codes[] = { -#if defined(TRAP_BRKPT) || (defined(HAVE_DECL_TRAP_BRKPT) && HAVE_DECL_TRAP_BRKPT) - XLAT(TRAP_BRKPT), +#if !(defined(TRAP_BRKPT) || (defined(HAVE_DECL_TRAP_BRKPT) && HAVE_DECL_TRAP_BRKPT)) +# define TRAP_BRKPT 1 +#endif +#if !(defined(TRAP_TRACE) || (defined(HAVE_DECL_TRAP_TRACE) && HAVE_DECL_TRAP_TRACE)) +# define TRAP_TRACE 2 #endif -#if defined(TRAP_TRACE) || (defined(HAVE_DECL_TRAP_TRACE) && HAVE_DECL_TRAP_TRACE) - XLAT(TRAP_TRACE), +#if !(defined(TRAP_BRANCH) || (defined(HAVE_DECL_TRAP_BRANCH) && HAVE_DECL_TRAP_BRANCH)) +# define TRAP_BRANCH 3 #endif - XLAT_END +#if !(defined(TRAP_HWBKPT) || (defined(HAVE_DECL_TRAP_HWBKPT) && HAVE_DECL_TRAP_HWBKPT)) +# define TRAP_HWBKPT 4 +#endif + +#ifdef IN_MPERS + +extern const struct xlat sigtrap_codes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat sigtrap_codes[] = { + XLAT(TRAP_BRKPT), + XLAT(TRAP_TRACE), + XLAT(TRAP_BRANCH), + XLAT(TRAP_HWBKPT), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sigtrap_codes.in b/xlat/sigtrap_codes.in index 41474fe6..078aec87 100644 --- a/xlat/sigtrap_codes.in +++ b/xlat/sigtrap_codes.in @@ -1,2 +1,4 @@ -TRAP_BRKPT -TRAP_TRACE +TRAP_BRKPT 1 +TRAP_TRACE 2 +TRAP_BRANCH 3 +TRAP_HWBKPT 4 diff --git a/xlat/sock_type_flags.h b/xlat/sock_type_flags.h index 45f193a9..d1af088c 100644 --- a/xlat/sock_type_flags.h +++ b/xlat/sock_type_flags.h @@ -1,11 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/sock_type_flags.in; do not edit. */ -static const struct xlat sock_type_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat sock_type_flags in mpers mode + +#else + +static +const struct xlat sock_type_flags[] = { #if defined(SOCK_CLOEXEC) || (defined(HAVE_DECL_SOCK_CLOEXEC) && HAVE_DECL_SOCK_CLOEXEC) - XLAT(SOCK_CLOEXEC), + XLAT(SOCK_CLOEXEC), #endif #if defined(SOCK_NONBLOCK) || (defined(HAVE_DECL_SOCK_NONBLOCK) && HAVE_DECL_SOCK_NONBLOCK) - XLAT(SOCK_NONBLOCK), + XLAT(SOCK_NONBLOCK), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/socketcalls.h b/xlat/socketcalls.h new file mode 100644 index 00000000..3680446b --- /dev/null +++ b/xlat/socketcalls.h @@ -0,0 +1,94 @@ +/* Generated by ./xlat/gen.sh from ./xlat/socketcalls.in; do not edit. */ +#if !(defined(SYS_SOCKET) || (defined(HAVE_DECL_SYS_SOCKET) && HAVE_DECL_SYS_SOCKET)) +# define SYS_SOCKET 1 +#endif +#if !(defined(SYS_BIND) || (defined(HAVE_DECL_SYS_BIND) && HAVE_DECL_SYS_BIND)) +# define SYS_BIND 2 +#endif +#if !(defined(SYS_CONNECT) || (defined(HAVE_DECL_SYS_CONNECT) && HAVE_DECL_SYS_CONNECT)) +# define SYS_CONNECT 3 +#endif +#if !(defined(SYS_LISTEN) || (defined(HAVE_DECL_SYS_LISTEN) && HAVE_DECL_SYS_LISTEN)) +# define SYS_LISTEN 4 +#endif +#if !(defined(SYS_ACCEPT) || (defined(HAVE_DECL_SYS_ACCEPT) && HAVE_DECL_SYS_ACCEPT)) +# define SYS_ACCEPT 5 +#endif +#if !(defined(SYS_GETSOCKNAME) || (defined(HAVE_DECL_SYS_GETSOCKNAME) && HAVE_DECL_SYS_GETSOCKNAME)) +# define SYS_GETSOCKNAME 6 +#endif +#if !(defined(SYS_GETPEERNAME) || (defined(HAVE_DECL_SYS_GETPEERNAME) && HAVE_DECL_SYS_GETPEERNAME)) +# define SYS_GETPEERNAME 7 +#endif +#if !(defined(SYS_SOCKETPAIR) || (defined(HAVE_DECL_SYS_SOCKETPAIR) && HAVE_DECL_SYS_SOCKETPAIR)) +# define SYS_SOCKETPAIR 8 +#endif +#if !(defined(SYS_SEND) || (defined(HAVE_DECL_SYS_SEND) && HAVE_DECL_SYS_SEND)) +# define SYS_SEND 9 +#endif +#if !(defined(SYS_RECV) || (defined(HAVE_DECL_SYS_RECV) && HAVE_DECL_SYS_RECV)) +# define SYS_RECV 10 +#endif +#if !(defined(SYS_SENDTO) || (defined(HAVE_DECL_SYS_SENDTO) && HAVE_DECL_SYS_SENDTO)) +# define SYS_SENDTO 11 +#endif +#if !(defined(SYS_RECVFROM) || (defined(HAVE_DECL_SYS_RECVFROM) && HAVE_DECL_SYS_RECVFROM)) +# define SYS_RECVFROM 12 +#endif +#if !(defined(SYS_SHUTDOWN) || (defined(HAVE_DECL_SYS_SHUTDOWN) && HAVE_DECL_SYS_SHUTDOWN)) +# define SYS_SHUTDOWN 13 +#endif +#if !(defined(SYS_SETSOCKOPT) || (defined(HAVE_DECL_SYS_SETSOCKOPT) && HAVE_DECL_SYS_SETSOCKOPT)) +# define SYS_SETSOCKOPT 14 +#endif +#if !(defined(SYS_GETSOCKOPT) || (defined(HAVE_DECL_SYS_GETSOCKOPT) && HAVE_DECL_SYS_GETSOCKOPT)) +# define SYS_GETSOCKOPT 15 +#endif +#if !(defined(SYS_SENDMSG) || (defined(HAVE_DECL_SYS_SENDMSG) && HAVE_DECL_SYS_SENDMSG)) +# define SYS_SENDMSG 16 +#endif +#if !(defined(SYS_RECVMSG) || (defined(HAVE_DECL_SYS_RECVMSG) && HAVE_DECL_SYS_RECVMSG)) +# define SYS_RECVMSG 17 +#endif +#if !(defined(SYS_ACCEPT4) || (defined(HAVE_DECL_SYS_ACCEPT4) && HAVE_DECL_SYS_ACCEPT4)) +# define SYS_ACCEPT4 18 +#endif +#if !(defined(SYS_RECVMMSG) || (defined(HAVE_DECL_SYS_RECVMMSG) && HAVE_DECL_SYS_RECVMMSG)) +# define SYS_RECVMMSG 19 +#endif +#if !(defined(SYS_SENDMMSG) || (defined(HAVE_DECL_SYS_SENDMMSG) && HAVE_DECL_SYS_SENDMMSG)) +# define SYS_SENDMMSG 20 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat socketcalls in mpers mode + +#else + +static +const struct xlat socketcalls[] = { + XLAT(SYS_SOCKET), + XLAT(SYS_BIND), + XLAT(SYS_CONNECT), + XLAT(SYS_LISTEN), + XLAT(SYS_ACCEPT), + XLAT(SYS_GETSOCKNAME), + XLAT(SYS_GETPEERNAME), + XLAT(SYS_SOCKETPAIR), + XLAT(SYS_SEND), + XLAT(SYS_RECV), + XLAT(SYS_SENDTO), + XLAT(SYS_RECVFROM), + XLAT(SYS_SHUTDOWN), + XLAT(SYS_SETSOCKOPT), + XLAT(SYS_GETSOCKOPT), + XLAT(SYS_SENDMSG), + XLAT(SYS_RECVMSG), + XLAT(SYS_ACCEPT4), + XLAT(SYS_RECVMMSG), + XLAT(SYS_SENDMMSG), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/socketcalls.in b/xlat/socketcalls.in new file mode 100644 index 00000000..3ffeb6f2 --- /dev/null +++ b/xlat/socketcalls.in @@ -0,0 +1,20 @@ +SYS_SOCKET 1 +SYS_BIND 2 +SYS_CONNECT 3 +SYS_LISTEN 4 +SYS_ACCEPT 5 +SYS_GETSOCKNAME 6 +SYS_GETPEERNAME 7 +SYS_SOCKETPAIR 8 +SYS_SEND 9 +SYS_RECV 10 +SYS_SENDTO 11 +SYS_RECVFROM 12 +SYS_SHUTDOWN 13 +SYS_SETSOCKOPT 14 +SYS_GETSOCKOPT 15 +SYS_SENDMSG 16 +SYS_RECVMSG 17 +SYS_ACCEPT4 18 +SYS_RECVMMSG 19 +SYS_SENDMMSG 20 diff --git a/xlat/socketlayers.h b/xlat/socketlayers.h index 6abbb920..5e486c38 100644 --- a/xlat/socketlayers.h +++ b/xlat/socketlayers.h @@ -1,104 +1,149 @@ /* Generated by ./xlat/gen.sh from ./xlat/socketlayers.in; do not edit. */ - -static const struct xlat socketlayers[] = { -#if defined(SOL_IP) || (defined(HAVE_DECL_SOL_IP) && HAVE_DECL_SOL_IP) - XLAT(SOL_IP), +#if !(defined(SOL_IP) || (defined(HAVE_DECL_SOL_IP) && HAVE_DECL_SOL_IP)) +# define SOL_IP 0 +#endif +#if !(defined(SOL_SOCKET) || (defined(HAVE_DECL_SOL_SOCKET) && HAVE_DECL_SOL_SOCKET)) +# define SOL_SOCKET 1 +#endif +#if !(defined(SOL_TCP) || (defined(HAVE_DECL_SOL_TCP) && HAVE_DECL_SOL_TCP)) +# define SOL_TCP 6 #endif -#if defined(SOL_ICMP) || (defined(HAVE_DECL_SOL_ICMP) && HAVE_DECL_SOL_ICMP) - XLAT(SOL_ICMP), +#if !(defined(SOL_UDP) || (defined(HAVE_DECL_SOL_UDP) && HAVE_DECL_SOL_UDP)) +# define SOL_UDP 17 #endif -#if defined(SOL_TCP) || (defined(HAVE_DECL_SOL_TCP) && HAVE_DECL_SOL_TCP) - XLAT(SOL_TCP), +#if !(defined(SOL_IPV6) || (defined(HAVE_DECL_SOL_IPV6) && HAVE_DECL_SOL_IPV6)) +# define SOL_IPV6 41 #endif -#if defined(SOL_UDP) || (defined(HAVE_DECL_SOL_UDP) && HAVE_DECL_SOL_UDP) - XLAT(SOL_UDP), +#if !(defined(SOL_ICMPV6) || (defined(HAVE_DECL_SOL_ICMPV6) && HAVE_DECL_SOL_ICMPV6)) +# define SOL_ICMPV6 58 #endif -#if defined(SOL_IPV6) || (defined(HAVE_DECL_SOL_IPV6) && HAVE_DECL_SOL_IPV6) - XLAT(SOL_IPV6), +#if !(defined(SOL_SCTP) || (defined(HAVE_DECL_SOL_SCTP) && HAVE_DECL_SOL_SCTP)) +# define SOL_SCTP 132 #endif -#if defined(SOL_ICMPV6) || (defined(HAVE_DECL_SOL_ICMPV6) && HAVE_DECL_SOL_ICMPV6) - XLAT(SOL_ICMPV6), +#if !(defined(SOL_UDPLITE) || (defined(HAVE_DECL_SOL_UDPLITE) && HAVE_DECL_SOL_UDPLITE)) +# define SOL_UDPLITE 136 #endif -#if defined(SOL_SCTP) || (defined(HAVE_DECL_SOL_SCTP) && HAVE_DECL_SOL_SCTP) - XLAT(SOL_SCTP), +#if !(defined(SOL_RAW) || (defined(HAVE_DECL_SOL_RAW) && HAVE_DECL_SOL_RAW)) +# define SOL_RAW 255 #endif -#if defined(SOL_UDPLITE) || (defined(HAVE_DECL_SOL_UDPLITE) && HAVE_DECL_SOL_UDPLITE) - XLAT(SOL_UDPLITE), +#if !(defined(SOL_IPX) || (defined(HAVE_DECL_SOL_IPX) && HAVE_DECL_SOL_IPX)) +# define SOL_IPX 256 #endif -#if defined(SOL_RAW) || (defined(HAVE_DECL_SOL_RAW) && HAVE_DECL_SOL_RAW) - XLAT(SOL_RAW), +#if !(defined(SOL_AX25) || (defined(HAVE_DECL_SOL_AX25) && HAVE_DECL_SOL_AX25)) +# define SOL_AX25 257 #endif -#if defined(SOL_IPX) || (defined(HAVE_DECL_SOL_IPX) && HAVE_DECL_SOL_IPX) - XLAT(SOL_IPX), +#if !(defined(SOL_ATALK) || (defined(HAVE_DECL_SOL_ATALK) && HAVE_DECL_SOL_ATALK)) +# define SOL_ATALK 258 #endif -#if defined(SOL_AX25) || (defined(HAVE_DECL_SOL_AX25) && HAVE_DECL_SOL_AX25) - XLAT(SOL_AX25), +#if !(defined(SOL_NETROM) || (defined(HAVE_DECL_SOL_NETROM) && HAVE_DECL_SOL_NETROM)) +# define SOL_NETROM 259 #endif -#if defined(SOL_ATALK) || (defined(HAVE_DECL_SOL_ATALK) && HAVE_DECL_SOL_ATALK) - XLAT(SOL_ATALK), +#if !(defined(SOL_ROSE) || (defined(HAVE_DECL_SOL_ROSE) && HAVE_DECL_SOL_ROSE)) +# define SOL_ROSE 260 #endif -#if defined(SOL_NETROM) || (defined(HAVE_DECL_SOL_NETROM) && HAVE_DECL_SOL_NETROM) - XLAT(SOL_NETROM), +#if !(defined(SOL_DECNET) || (defined(HAVE_DECL_SOL_DECNET) && HAVE_DECL_SOL_DECNET)) +# define SOL_DECNET 261 #endif -#if defined(SOL_ROSE) || (defined(HAVE_DECL_SOL_ROSE) && HAVE_DECL_SOL_ROSE) - XLAT(SOL_ROSE), +#if !(defined(SOL_X25) || (defined(HAVE_DECL_SOL_X25) && HAVE_DECL_SOL_X25)) +# define SOL_X25 262 #endif -#if defined(SOL_DECNET) || (defined(HAVE_DECL_SOL_DECNET) && HAVE_DECL_SOL_DECNET) - XLAT(SOL_DECNET), +#if !(defined(SOL_PACKET) || (defined(HAVE_DECL_SOL_PACKET) && HAVE_DECL_SOL_PACKET)) +# define SOL_PACKET 263 #endif -#if defined(SOL_X25) || (defined(HAVE_DECL_SOL_X25) && HAVE_DECL_SOL_X25) - XLAT(SOL_X25), +#if !(defined(SOL_ATM) || (defined(HAVE_DECL_SOL_ATM) && HAVE_DECL_SOL_ATM)) +# define SOL_ATM 264 #endif -#if defined(SOL_PACKET) || (defined(HAVE_DECL_SOL_PACKET) && HAVE_DECL_SOL_PACKET) - XLAT(SOL_PACKET), +#if !(defined(SOL_AAL) || (defined(HAVE_DECL_SOL_AAL) && HAVE_DECL_SOL_AAL)) +# define SOL_AAL 265 #endif -#if defined(SOL_ATM) || (defined(HAVE_DECL_SOL_ATM) && HAVE_DECL_SOL_ATM) - XLAT(SOL_ATM), +#if !(defined(SOL_IRDA) || (defined(HAVE_DECL_SOL_IRDA) && HAVE_DECL_SOL_IRDA)) +# define SOL_IRDA 266 #endif -#if defined(SOL_AAL) || (defined(HAVE_DECL_SOL_AAL) && HAVE_DECL_SOL_AAL) - XLAT(SOL_AAL), +#if !(defined(SOL_NETBEUI) || (defined(HAVE_DECL_SOL_NETBEUI) && HAVE_DECL_SOL_NETBEUI)) +# define SOL_NETBEUI 267 #endif -#if defined(SOL_IRDA) || (defined(HAVE_DECL_SOL_IRDA) && HAVE_DECL_SOL_IRDA) - XLAT(SOL_IRDA), +#if !(defined(SOL_LLC) || (defined(HAVE_DECL_SOL_LLC) && HAVE_DECL_SOL_LLC)) +# define SOL_LLC 268 #endif -#if defined(SOL_NETBEUI) || (defined(HAVE_DECL_SOL_NETBEUI) && HAVE_DECL_SOL_NETBEUI) - XLAT(SOL_NETBEUI), +#if !(defined(SOL_DCCP) || (defined(HAVE_DECL_SOL_DCCP) && HAVE_DECL_SOL_DCCP)) +# define SOL_DCCP 269 #endif -#if defined(SOL_LLC) || (defined(HAVE_DECL_SOL_LLC) && HAVE_DECL_SOL_LLC) - XLAT(SOL_LLC), +#if !(defined(SOL_NETLINK) || (defined(HAVE_DECL_SOL_NETLINK) && HAVE_DECL_SOL_NETLINK)) +# define SOL_NETLINK 270 #endif -#if defined(SOL_DCCP) || (defined(HAVE_DECL_SOL_DCCP) && HAVE_DECL_SOL_DCCP) - XLAT(SOL_DCCP), +#if !(defined(SOL_TIPC) || (defined(HAVE_DECL_SOL_TIPC) && HAVE_DECL_SOL_TIPC)) +# define SOL_TIPC 271 #endif -#if defined(SOL_NETLINK) || (defined(HAVE_DECL_SOL_NETLINK) && HAVE_DECL_SOL_NETLINK) - XLAT(SOL_NETLINK), +#if !(defined(SOL_RXRPC) || (defined(HAVE_DECL_SOL_RXRPC) && HAVE_DECL_SOL_RXRPC)) +# define SOL_RXRPC 272 #endif -#if defined(SOL_TIPC) || (defined(HAVE_DECL_SOL_TIPC) && HAVE_DECL_SOL_TIPC) - XLAT(SOL_TIPC), +#if !(defined(SOL_PPPOL2TP) || (defined(HAVE_DECL_SOL_PPPOL2TP) && HAVE_DECL_SOL_PPPOL2TP)) +# define SOL_PPPOL2TP 273 #endif -#if defined(SOL_RXRPC) || (defined(HAVE_DECL_SOL_RXRPC) && HAVE_DECL_SOL_RXRPC) - XLAT(SOL_RXRPC), +#if !(defined(SOL_BLUETOOTH) || (defined(HAVE_DECL_SOL_BLUETOOTH) && HAVE_DECL_SOL_BLUETOOTH)) +# define SOL_BLUETOOTH 274 #endif -#if defined(SOL_PPPOL2TP) || (defined(HAVE_DECL_SOL_PPPOL2TP) && HAVE_DECL_SOL_PPPOL2TP) - XLAT(SOL_PPPOL2TP), +#if !(defined(SOL_PNPIPE) || (defined(HAVE_DECL_SOL_PNPIPE) && HAVE_DECL_SOL_PNPIPE)) +# define SOL_PNPIPE 275 #endif -#if defined(SOL_BLUETOOTH) || (defined(HAVE_DECL_SOL_BLUETOOTH) && HAVE_DECL_SOL_BLUETOOTH) - XLAT(SOL_BLUETOOTH), +#if !(defined(SOL_RDS) || (defined(HAVE_DECL_SOL_RDS) && HAVE_DECL_SOL_RDS)) +# define SOL_RDS 276 #endif -#if defined(SOL_PNPIPE) || (defined(HAVE_DECL_SOL_PNPIPE) && HAVE_DECL_SOL_PNPIPE) - XLAT(SOL_PNPIPE), +#if !(defined(SOL_IUCV) || (defined(HAVE_DECL_SOL_IUCV) && HAVE_DECL_SOL_IUCV)) +# define SOL_IUCV 277 #endif -#if defined(SOL_RDS) || (defined(HAVE_DECL_SOL_RDS) && HAVE_DECL_SOL_RDS) - XLAT(SOL_RDS), +#if !(defined(SOL_CAIF) || (defined(HAVE_DECL_SOL_CAIF) && HAVE_DECL_SOL_CAIF)) +# define SOL_CAIF 278 #endif -#if defined(SOL_IUCV) || (defined(HAVE_DECL_SOL_IUCV) && HAVE_DECL_SOL_IUCV) - XLAT(SOL_IUCV), +#if !(defined(SOL_ALG) || (defined(HAVE_DECL_SOL_ALG) && HAVE_DECL_SOL_ALG)) +# define SOL_ALG 279 #endif -#if defined(SOL_CAIF) || (defined(HAVE_DECL_SOL_CAIF) && HAVE_DECL_SOL_CAIF) - XLAT(SOL_CAIF), +#if !(defined(SOL_NFC) || (defined(HAVE_DECL_SOL_NFC) && HAVE_DECL_SOL_NFC)) +# define SOL_NFC 280 #endif -#if defined(SOL_SOCKET) || (defined(HAVE_DECL_SOL_SOCKET) && HAVE_DECL_SOL_SOCKET) - XLAT(SOL_SOCKET), +#if !(defined(SOL_KCM) || (defined(HAVE_DECL_SOL_KCM) && HAVE_DECL_SOL_KCM)) +# define SOL_KCM 281 #endif - /* this array should remain not NULL-terminated */ + +#ifndef IN_MPERS + +const struct xlat socketlayers[] = { + XLAT(SOL_IP), + XLAT(SOL_SOCKET), + XLAT(SOL_TCP), + XLAT(SOL_UDP), + XLAT(SOL_IPV6), + XLAT(SOL_ICMPV6), + XLAT(SOL_SCTP), + XLAT(SOL_UDPLITE), + XLAT(SOL_RAW), + XLAT(SOL_IPX), + XLAT(SOL_AX25), + XLAT(SOL_ATALK), + XLAT(SOL_NETROM), + XLAT(SOL_ROSE), + XLAT(SOL_DECNET), + XLAT(SOL_X25), + XLAT(SOL_PACKET), + XLAT(SOL_ATM), + XLAT(SOL_AAL), + XLAT(SOL_IRDA), + XLAT(SOL_NETBEUI), + XLAT(SOL_LLC), + XLAT(SOL_DCCP), + XLAT(SOL_NETLINK), + XLAT(SOL_TIPC), + XLAT(SOL_RXRPC), + XLAT(SOL_PPPOL2TP), + XLAT(SOL_BLUETOOTH), + XLAT(SOL_PNPIPE), + XLAT(SOL_RDS), + XLAT(SOL_IUCV), + XLAT(SOL_CAIF), + XLAT(SOL_ALG), + XLAT(SOL_NFC), + XLAT(SOL_KCM), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/socketlayers.in b/xlat/socketlayers.in index 419c3055..7b0b86e3 100644 --- a/xlat/socketlayers.in +++ b/xlat/socketlayers.in @@ -1,34 +1,35 @@ -SOL_IP -SOL_ICMP -SOL_TCP -SOL_UDP -SOL_IPV6 -SOL_ICMPV6 -SOL_SCTP -SOL_UDPLITE -SOL_RAW -SOL_IPX -SOL_AX25 -SOL_ATALK -SOL_NETROM -SOL_ROSE -SOL_DECNET -SOL_X25 -SOL_PACKET -SOL_ATM -SOL_AAL -SOL_IRDA -SOL_NETBEUI -SOL_LLC -SOL_DCCP -SOL_NETLINK -SOL_TIPC -SOL_RXRPC -SOL_PPPOL2TP -SOL_BLUETOOTH -SOL_PNPIPE -SOL_RDS -SOL_IUCV -SOL_CAIF -SOL_SOCKET -#unterminated +SOL_IP 0 +SOL_SOCKET 1 +SOL_TCP 6 +SOL_UDP 17 +SOL_IPV6 41 +SOL_ICMPV6 58 +SOL_SCTP 132 +SOL_UDPLITE 136 +SOL_RAW 255 +SOL_IPX 256 +SOL_AX25 257 +SOL_ATALK 258 +SOL_NETROM 259 +SOL_ROSE 260 +SOL_DECNET 261 +SOL_X25 262 +SOL_PACKET 263 +SOL_ATM 264 +SOL_AAL 265 +SOL_IRDA 266 +SOL_NETBEUI 267 +SOL_LLC 268 +SOL_DCCP 269 +SOL_NETLINK 270 +SOL_TIPC 271 +SOL_RXRPC 272 +SOL_PPPOL2TP 273 +SOL_BLUETOOTH 274 +SOL_PNPIPE 275 +SOL_RDS 276 +SOL_IUCV 277 +SOL_CAIF 278 +SOL_ALG 279 +SOL_NFC 280 +SOL_KCM 281 diff --git a/xlat/sockipoptions.h b/xlat/sockipoptions.h index ca044e08..26d768f9 100644 --- a/xlat/sockipoptions.h +++ b/xlat/sockipoptions.h @@ -1,146 +1,164 @@ /* Generated by ./xlat/gen.sh from ./xlat/sockipoptions.in; do not edit. */ -static const struct xlat sockipoptions[] = { +#ifdef IN_MPERS + +# error static const struct xlat sockipoptions in mpers mode + +#else + +static +const struct xlat sockipoptions[] = { #if defined(IP_TOS) || (defined(HAVE_DECL_IP_TOS) && HAVE_DECL_IP_TOS) - XLAT(IP_TOS), + XLAT(IP_TOS), #endif #if defined(IP_TTL) || (defined(HAVE_DECL_IP_TTL) && HAVE_DECL_IP_TTL) - XLAT(IP_TTL), + XLAT(IP_TTL), #endif #if defined(IP_HDRINCL) || (defined(HAVE_DECL_IP_HDRINCL) && HAVE_DECL_IP_HDRINCL) - XLAT(IP_HDRINCL), + XLAT(IP_HDRINCL), #endif #if defined(IP_OPTIONS) || (defined(HAVE_DECL_IP_OPTIONS) && HAVE_DECL_IP_OPTIONS) - XLAT(IP_OPTIONS), + XLAT(IP_OPTIONS), #endif #if defined(IP_ROUTER_ALERT) || (defined(HAVE_DECL_IP_ROUTER_ALERT) && HAVE_DECL_IP_ROUTER_ALERT) - XLAT(IP_ROUTER_ALERT), + XLAT(IP_ROUTER_ALERT), #endif #if defined(IP_RECVOPTIONS) || (defined(HAVE_DECL_IP_RECVOPTIONS) && HAVE_DECL_IP_RECVOPTIONS) - XLAT(IP_RECVOPTIONS), + XLAT(IP_RECVOPTIONS), #endif #if defined(IP_RECVOPTS) || (defined(HAVE_DECL_IP_RECVOPTS) && HAVE_DECL_IP_RECVOPTS) - XLAT(IP_RECVOPTS), + XLAT(IP_RECVOPTS), +#endif +#if defined(IP_RETOPTS) || (defined(HAVE_DECL_IP_RETOPTS) && HAVE_DECL_IP_RETOPTS) + XLAT(IP_RETOPTS), #endif #if defined(IP_RECVRETOPTS) || (defined(HAVE_DECL_IP_RECVRETOPTS) && HAVE_DECL_IP_RECVRETOPTS) - XLAT(IP_RECVRETOPTS), + XLAT(IP_RECVRETOPTS), #endif #if defined(IP_RECVDSTADDR) || (defined(HAVE_DECL_IP_RECVDSTADDR) && HAVE_DECL_IP_RECVDSTADDR) - XLAT(IP_RECVDSTADDR), -#endif -#if defined(IP_RETOPTS) || (defined(HAVE_DECL_IP_RETOPTS) && HAVE_DECL_IP_RETOPTS) - XLAT(IP_RETOPTS), + XLAT(IP_RECVDSTADDR), #endif #if defined(IP_PKTINFO) || (defined(HAVE_DECL_IP_PKTINFO) && HAVE_DECL_IP_PKTINFO) - XLAT(IP_PKTINFO), + XLAT(IP_PKTINFO), #endif #if defined(IP_PKTOPTIONS) || (defined(HAVE_DECL_IP_PKTOPTIONS) && HAVE_DECL_IP_PKTOPTIONS) - XLAT(IP_PKTOPTIONS), + XLAT(IP_PKTOPTIONS), #endif #if defined(IP_MTU_DISCOVER) || (defined(HAVE_DECL_IP_MTU_DISCOVER) && HAVE_DECL_IP_MTU_DISCOVER) - XLAT(IP_MTU_DISCOVER), + XLAT(IP_MTU_DISCOVER), #endif #if defined(IP_RECVERR) || (defined(HAVE_DECL_IP_RECVERR) && HAVE_DECL_IP_RECVERR) - XLAT(IP_RECVERR), + XLAT(IP_RECVERR), #endif #if defined(IP_RECVTTL) || (defined(HAVE_DECL_IP_RECVTTL) && HAVE_DECL_IP_RECVTTL) - XLAT(IP_RECVTTL), + XLAT(IP_RECVTTL), #endif #if defined(IP_RECVTOS) || (defined(HAVE_DECL_IP_RECVTOS) && HAVE_DECL_IP_RECVTOS) - XLAT(IP_RECVTOS), + XLAT(IP_RECVTOS), #endif #if defined(IP_MTU) || (defined(HAVE_DECL_IP_MTU) && HAVE_DECL_IP_MTU) - XLAT(IP_MTU), + XLAT(IP_MTU), #endif #if defined(IP_MULTICAST_IF) || (defined(HAVE_DECL_IP_MULTICAST_IF) && HAVE_DECL_IP_MULTICAST_IF) - XLAT(IP_MULTICAST_IF), + XLAT(IP_MULTICAST_IF), #endif #if defined(IP_MULTICAST_TTL) || (defined(HAVE_DECL_IP_MULTICAST_TTL) && HAVE_DECL_IP_MULTICAST_TTL) - XLAT(IP_MULTICAST_TTL), + XLAT(IP_MULTICAST_TTL), #endif #if defined(IP_MULTICAST_LOOP) || (defined(HAVE_DECL_IP_MULTICAST_LOOP) && HAVE_DECL_IP_MULTICAST_LOOP) - XLAT(IP_MULTICAST_LOOP), + XLAT(IP_MULTICAST_LOOP), #endif #if defined(IP_ADD_MEMBERSHIP) || (defined(HAVE_DECL_IP_ADD_MEMBERSHIP) && HAVE_DECL_IP_ADD_MEMBERSHIP) - XLAT(IP_ADD_MEMBERSHIP), + XLAT(IP_ADD_MEMBERSHIP), #endif #if defined(IP_DROP_MEMBERSHIP) || (defined(HAVE_DECL_IP_DROP_MEMBERSHIP) && HAVE_DECL_IP_DROP_MEMBERSHIP) - XLAT(IP_DROP_MEMBERSHIP), + XLAT(IP_DROP_MEMBERSHIP), #endif #if defined(IP_BROADCAST_IF) || (defined(HAVE_DECL_IP_BROADCAST_IF) && HAVE_DECL_IP_BROADCAST_IF) - XLAT(IP_BROADCAST_IF), + XLAT(IP_BROADCAST_IF), #endif #if defined(IP_RECVIFINDEX) || (defined(HAVE_DECL_IP_RECVIFINDEX) && HAVE_DECL_IP_RECVIFINDEX) - XLAT(IP_RECVIFINDEX), + XLAT(IP_RECVIFINDEX), #endif #if defined(IP_MSFILTER) || (defined(HAVE_DECL_IP_MSFILTER) && HAVE_DECL_IP_MSFILTER) - XLAT(IP_MSFILTER), -#endif -#if defined(MCAST_MSFILTER) || (defined(HAVE_DECL_MCAST_MSFILTER) && HAVE_DECL_MCAST_MSFILTER) - XLAT(MCAST_MSFILTER), + XLAT(IP_MSFILTER), #endif #if defined(IP_FREEBIND) || (defined(HAVE_DECL_IP_FREEBIND) && HAVE_DECL_IP_FREEBIND) - XLAT(IP_FREEBIND), + XLAT(IP_FREEBIND), #endif #if defined(IP_IPSEC_POLICY) || (defined(HAVE_DECL_IP_IPSEC_POLICY) && HAVE_DECL_IP_IPSEC_POLICY) - XLAT(IP_IPSEC_POLICY), + XLAT(IP_IPSEC_POLICY), #endif #if defined(IP_XFRM_POLICY) || (defined(HAVE_DECL_IP_XFRM_POLICY) && HAVE_DECL_IP_XFRM_POLICY) - XLAT(IP_XFRM_POLICY), + XLAT(IP_XFRM_POLICY), #endif #if defined(IP_PASSSEC) || (defined(HAVE_DECL_IP_PASSSEC) && HAVE_DECL_IP_PASSSEC) - XLAT(IP_PASSSEC), + XLAT(IP_PASSSEC), #endif #if defined(IP_TRANSPARENT) || (defined(HAVE_DECL_IP_TRANSPARENT) && HAVE_DECL_IP_TRANSPARENT) - XLAT(IP_TRANSPARENT), + XLAT(IP_TRANSPARENT), #endif #if defined(IP_ORIGDSTADDR) || (defined(HAVE_DECL_IP_ORIGDSTADDR) && HAVE_DECL_IP_ORIGDSTADDR) - XLAT(IP_ORIGDSTADDR), + XLAT(IP_ORIGDSTADDR), #endif #if defined(IP_RECVORIGDSTADDR) || (defined(HAVE_DECL_IP_RECVORIGDSTADDR) && HAVE_DECL_IP_RECVORIGDSTADDR) - XLAT(IP_RECVORIGDSTADDR), + XLAT(IP_RECVORIGDSTADDR), #endif #if defined(IP_MINTTL) || (defined(HAVE_DECL_IP_MINTTL) && HAVE_DECL_IP_MINTTL) - XLAT(IP_MINTTL), + XLAT(IP_MINTTL), #endif #if defined(IP_NODEFRAG) || (defined(HAVE_DECL_IP_NODEFRAG) && HAVE_DECL_IP_NODEFRAG) - XLAT(IP_NODEFRAG), + XLAT(IP_NODEFRAG), +#endif +#if defined(IP_CHECKSUM) || (defined(HAVE_DECL_IP_CHECKSUM) && HAVE_DECL_IP_CHECKSUM) + XLAT(IP_CHECKSUM), +#endif +#if defined(IP_BIND_ADDRESS_NO_PORT) || (defined(HAVE_DECL_IP_BIND_ADDRESS_NO_PORT) && HAVE_DECL_IP_BIND_ADDRESS_NO_PORT) + XLAT(IP_BIND_ADDRESS_NO_PORT), +#endif +#if defined(IP_RECVFRAGSIZE) || (defined(HAVE_DECL_IP_RECVFRAGSIZE) && HAVE_DECL_IP_RECVFRAGSIZE) + XLAT(IP_RECVFRAGSIZE), #endif #if defined(IP_UNBLOCK_SOURCE) || (defined(HAVE_DECL_IP_UNBLOCK_SOURCE) && HAVE_DECL_IP_UNBLOCK_SOURCE) - XLAT(IP_UNBLOCK_SOURCE), + XLAT(IP_UNBLOCK_SOURCE), #endif #if defined(IP_BLOCK_SOURCE) || (defined(HAVE_DECL_IP_BLOCK_SOURCE) && HAVE_DECL_IP_BLOCK_SOURCE) - XLAT(IP_BLOCK_SOURCE), + XLAT(IP_BLOCK_SOURCE), #endif #if defined(IP_ADD_SOURCE_MEMBERSHIP) || (defined(HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP) && HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP) - XLAT(IP_ADD_SOURCE_MEMBERSHIP), + XLAT(IP_ADD_SOURCE_MEMBERSHIP), #endif #if defined(IP_DROP_SOURCE_MEMBERSHIP) || (defined(HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP) && HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP) - XLAT(IP_DROP_SOURCE_MEMBERSHIP), + XLAT(IP_DROP_SOURCE_MEMBERSHIP), #endif #if defined(MCAST_JOIN_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_GROUP) && HAVE_DECL_MCAST_JOIN_GROUP) - XLAT(MCAST_JOIN_GROUP), + XLAT(MCAST_JOIN_GROUP), #endif #if defined(MCAST_BLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_BLOCK_SOURCE) && HAVE_DECL_MCAST_BLOCK_SOURCE) - XLAT(MCAST_BLOCK_SOURCE), + XLAT(MCAST_BLOCK_SOURCE), #endif #if defined(MCAST_UNBLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_UNBLOCK_SOURCE) && HAVE_DECL_MCAST_UNBLOCK_SOURCE) - XLAT(MCAST_UNBLOCK_SOURCE), + XLAT(MCAST_UNBLOCK_SOURCE), #endif #if defined(MCAST_LEAVE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_GROUP) && HAVE_DECL_MCAST_LEAVE_GROUP) - XLAT(MCAST_LEAVE_GROUP), + XLAT(MCAST_LEAVE_GROUP), #endif #if defined(MCAST_JOIN_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) && HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) - XLAT(MCAST_JOIN_SOURCE_GROUP), + XLAT(MCAST_JOIN_SOURCE_GROUP), #endif #if defined(MCAST_LEAVE_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) && HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) - XLAT(MCAST_LEAVE_SOURCE_GROUP), + XLAT(MCAST_LEAVE_SOURCE_GROUP), +#endif +#if defined(MCAST_MSFILTER) || (defined(HAVE_DECL_MCAST_MSFILTER) && HAVE_DECL_MCAST_MSFILTER) + XLAT(MCAST_MSFILTER), #endif #if defined(IP_MULTICAST_ALL) || (defined(HAVE_DECL_IP_MULTICAST_ALL) && HAVE_DECL_IP_MULTICAST_ALL) - XLAT(IP_MULTICAST_ALL), + XLAT(IP_MULTICAST_ALL), #endif #if defined(IP_UNICAST_IF) || (defined(HAVE_DECL_IP_UNICAST_IF) && HAVE_DECL_IP_UNICAST_IF) - XLAT(IP_UNICAST_IF), + XLAT(IP_UNICAST_IF), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sockipoptions.in b/xlat/sockipoptions.in index 527d8671..51ed1343 100644 --- a/xlat/sockipoptions.in +++ b/xlat/sockipoptions.in @@ -5,9 +5,9 @@ IP_OPTIONS IP_ROUTER_ALERT IP_RECVOPTIONS IP_RECVOPTS +IP_RETOPTS IP_RECVRETOPTS IP_RECVDSTADDR -IP_RETOPTS IP_PKTINFO IP_PKTOPTIONS IP_MTU_DISCOVER @@ -23,7 +23,6 @@ IP_DROP_MEMBERSHIP IP_BROADCAST_IF IP_RECVIFINDEX IP_MSFILTER -MCAST_MSFILTER IP_FREEBIND IP_IPSEC_POLICY IP_XFRM_POLICY @@ -33,6 +32,9 @@ IP_ORIGDSTADDR IP_RECVORIGDSTADDR IP_MINTTL IP_NODEFRAG +IP_CHECKSUM +IP_BIND_ADDRESS_NO_PORT +IP_RECVFRAGSIZE IP_UNBLOCK_SOURCE IP_BLOCK_SOURCE IP_ADD_SOURCE_MEMBERSHIP @@ -43,5 +45,6 @@ MCAST_UNBLOCK_SOURCE MCAST_LEAVE_GROUP MCAST_JOIN_SOURCE_GROUP MCAST_LEAVE_SOURCE_GROUP +MCAST_MSFILTER IP_MULTICAST_ALL IP_UNICAST_IF diff --git a/xlat/sockipv6options.h b/xlat/sockipv6options.h index 40af8a90..dd201a97 100644 --- a/xlat/sockipv6options.h +++ b/xlat/sockipv6options.h @@ -1,68 +1,176 @@ /* Generated by ./xlat/gen.sh from ./xlat/sockipv6options.in; do not edit. */ -static const struct xlat sockipv6options[] = { +#ifdef IN_MPERS + +# error static const struct xlat sockipv6options in mpers mode + +#else + +static +const struct xlat sockipv6options[] = { #if defined(IPV6_ADDRFORM) || (defined(HAVE_DECL_IPV6_ADDRFORM) && HAVE_DECL_IPV6_ADDRFORM) - XLAT(IPV6_ADDRFORM), + XLAT(IPV6_ADDRFORM), #endif -#if defined(MCAST_FILTER) || (defined(HAVE_DECL_MCAST_FILTER) && HAVE_DECL_MCAST_FILTER) - XLAT(MCAST_FILTER), +#if defined(IPV6_2292PKTINFO) || (defined(HAVE_DECL_IPV6_2292PKTINFO) && HAVE_DECL_IPV6_2292PKTINFO) + XLAT(IPV6_2292PKTINFO), #endif -#if defined(IPV6_PKTOPTIONS) || (defined(HAVE_DECL_IPV6_PKTOPTIONS) && HAVE_DECL_IPV6_PKTOPTIONS) - XLAT(IPV6_PKTOPTIONS), +#if defined(IPV6_2292HOPOPTS) || (defined(HAVE_DECL_IPV6_2292HOPOPTS) && HAVE_DECL_IPV6_2292HOPOPTS) + XLAT(IPV6_2292HOPOPTS), #endif -#if defined(IPV6_MTU) || (defined(HAVE_DECL_IPV6_MTU) && HAVE_DECL_IPV6_MTU) - XLAT(IPV6_MTU), +#if defined(IPV6_2292DSTOPTS) || (defined(HAVE_DECL_IPV6_2292DSTOPTS) && HAVE_DECL_IPV6_2292DSTOPTS) + XLAT(IPV6_2292DSTOPTS), #endif -#if defined(IPV6_V6ONLY) || (defined(HAVE_DECL_IPV6_V6ONLY) && HAVE_DECL_IPV6_V6ONLY) - XLAT(IPV6_V6ONLY), +#if defined(IPV6_2292RTHDR) || (defined(HAVE_DECL_IPV6_2292RTHDR) && HAVE_DECL_IPV6_2292RTHDR) + XLAT(IPV6_2292RTHDR), #endif -#if defined(IPV6_PKTINFO) || (defined(HAVE_DECL_IPV6_PKTINFO) && HAVE_DECL_IPV6_PKTINFO) - XLAT(IPV6_PKTINFO), +#if defined(IPV6_2292PKTOPTIONS) || (defined(HAVE_DECL_IPV6_2292PKTOPTIONS) && HAVE_DECL_IPV6_2292PKTOPTIONS) + XLAT(IPV6_2292PKTOPTIONS), #endif -#if defined(IPV6_HOPLIMIT) || (defined(HAVE_DECL_IPV6_HOPLIMIT) && HAVE_DECL_IPV6_HOPLIMIT) - XLAT(IPV6_HOPLIMIT), +#if defined(IPV6_CHECKSUM) || (defined(HAVE_DECL_IPV6_CHECKSUM) && HAVE_DECL_IPV6_CHECKSUM) + XLAT(IPV6_CHECKSUM), #endif -#if defined(IPV6_RTHDR) || (defined(HAVE_DECL_IPV6_RTHDR) && HAVE_DECL_IPV6_RTHDR) - XLAT(IPV6_RTHDR), +#if defined(IPV6_2292HOPLIMIT) || (defined(HAVE_DECL_IPV6_2292HOPLIMIT) && HAVE_DECL_IPV6_2292HOPLIMIT) + XLAT(IPV6_2292HOPLIMIT), #endif -#if defined(IPV6_HOPOPTS) || (defined(HAVE_DECL_IPV6_HOPOPTS) && HAVE_DECL_IPV6_HOPOPTS) - XLAT(IPV6_HOPOPTS), +#if defined(IPV6_NEXTHOP) || (defined(HAVE_DECL_IPV6_NEXTHOP) && HAVE_DECL_IPV6_NEXTHOP) + XLAT(IPV6_NEXTHOP), #endif -#if defined(IPV6_DSTOPTS) || (defined(HAVE_DECL_IPV6_DSTOPTS) && HAVE_DECL_IPV6_DSTOPTS) - XLAT(IPV6_DSTOPTS), +#if defined(IPV6_AUTHHDR) || (defined(HAVE_DECL_IPV6_AUTHHDR) && HAVE_DECL_IPV6_AUTHHDR) + XLAT(IPV6_AUTHHDR), #endif #if defined(IPV6_FLOWINFO) || (defined(HAVE_DECL_IPV6_FLOWINFO) && HAVE_DECL_IPV6_FLOWINFO) - XLAT(IPV6_FLOWINFO), + XLAT(IPV6_FLOWINFO), #endif #if defined(IPV6_UNICAST_HOPS) || (defined(HAVE_DECL_IPV6_UNICAST_HOPS) && HAVE_DECL_IPV6_UNICAST_HOPS) - XLAT(IPV6_UNICAST_HOPS), + XLAT(IPV6_UNICAST_HOPS), +#endif +#if defined(IPV6_MULTICAST_IF) || (defined(HAVE_DECL_IPV6_MULTICAST_IF) && HAVE_DECL_IPV6_MULTICAST_IF) + XLAT(IPV6_MULTICAST_IF), #endif #if defined(IPV6_MULTICAST_HOPS) || (defined(HAVE_DECL_IPV6_MULTICAST_HOPS) && HAVE_DECL_IPV6_MULTICAST_HOPS) - XLAT(IPV6_MULTICAST_HOPS), + XLAT(IPV6_MULTICAST_HOPS), #endif #if defined(IPV6_MULTICAST_LOOP) || (defined(HAVE_DECL_IPV6_MULTICAST_LOOP) && HAVE_DECL_IPV6_MULTICAST_LOOP) - XLAT(IPV6_MULTICAST_LOOP), + XLAT(IPV6_MULTICAST_LOOP), #endif -#if defined(IPV6_MULTICAST_IF) || (defined(HAVE_DECL_IPV6_MULTICAST_IF) && HAVE_DECL_IPV6_MULTICAST_IF) - XLAT(IPV6_MULTICAST_IF), +#if defined(IPV6_ADD_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_ADD_MEMBERSHIP) && HAVE_DECL_IPV6_ADD_MEMBERSHIP) + XLAT(IPV6_ADD_MEMBERSHIP), +#endif +#if defined(IPV6_DROP_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_DROP_MEMBERSHIP) && HAVE_DECL_IPV6_DROP_MEMBERSHIP) + XLAT(IPV6_DROP_MEMBERSHIP), +#endif +#if defined(IPV6_ROUTER_ALERT) || (defined(HAVE_DECL_IPV6_ROUTER_ALERT) && HAVE_DECL_IPV6_ROUTER_ALERT) + XLAT(IPV6_ROUTER_ALERT), #endif #if defined(IPV6_MTU_DISCOVER) || (defined(HAVE_DECL_IPV6_MTU_DISCOVER) && HAVE_DECL_IPV6_MTU_DISCOVER) - XLAT(IPV6_MTU_DISCOVER), + XLAT(IPV6_MTU_DISCOVER), +#endif +#if defined(IPV6_MTU) || (defined(HAVE_DECL_IPV6_MTU) && HAVE_DECL_IPV6_MTU) + XLAT(IPV6_MTU), #endif #if defined(IPV6_RECVERR) || (defined(HAVE_DECL_IPV6_RECVERR) && HAVE_DECL_IPV6_RECVERR) - XLAT(IPV6_RECVERR), + XLAT(IPV6_RECVERR), +#endif +#if defined(IPV6_V6ONLY) || (defined(HAVE_DECL_IPV6_V6ONLY) && HAVE_DECL_IPV6_V6ONLY) + XLAT(IPV6_V6ONLY), +#endif +#if defined(IPV6_JOIN_ANYCAST) || (defined(HAVE_DECL_IPV6_JOIN_ANYCAST) && HAVE_DECL_IPV6_JOIN_ANYCAST) + XLAT(IPV6_JOIN_ANYCAST), +#endif +#if defined(IPV6_LEAVE_ANYCAST) || (defined(HAVE_DECL_IPV6_LEAVE_ANYCAST) && HAVE_DECL_IPV6_LEAVE_ANYCAST) + XLAT(IPV6_LEAVE_ANYCAST), +#endif +#if defined(IPV6_FLOWLABEL_MGR) || (defined(HAVE_DECL_IPV6_FLOWLABEL_MGR) && HAVE_DECL_IPV6_FLOWLABEL_MGR) + XLAT(IPV6_FLOWLABEL_MGR), #endif #if defined(IPV6_FLOWINFO_SEND) || (defined(HAVE_DECL_IPV6_FLOWINFO_SEND) && HAVE_DECL_IPV6_FLOWINFO_SEND) - XLAT(IPV6_FLOWINFO_SEND), + XLAT(IPV6_FLOWINFO_SEND), #endif -#if defined(IPV6_ADD_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_ADD_MEMBERSHIP) && HAVE_DECL_IPV6_ADD_MEMBERSHIP) - XLAT(IPV6_ADD_MEMBERSHIP), +#if defined(IPV6_IPSEC_POLICY) || (defined(HAVE_DECL_IPV6_IPSEC_POLICY) && HAVE_DECL_IPV6_IPSEC_POLICY) + XLAT(IPV6_IPSEC_POLICY), #endif -#if defined(IPV6_DROP_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_DROP_MEMBERSHIP) && HAVE_DECL_IPV6_DROP_MEMBERSHIP) - XLAT(IPV6_DROP_MEMBERSHIP), +#if defined(IPV6_XFRM_POLICY) || (defined(HAVE_DECL_IPV6_XFRM_POLICY) && HAVE_DECL_IPV6_XFRM_POLICY) + XLAT(IPV6_XFRM_POLICY), #endif -#if defined(IPV6_ROUTER_ALERT) || (defined(HAVE_DECL_IPV6_ROUTER_ALERT) && HAVE_DECL_IPV6_ROUTER_ALERT) - XLAT(IPV6_ROUTER_ALERT), +#if defined(IPV6_HDRINCL) || (defined(HAVE_DECL_IPV6_HDRINCL) && HAVE_DECL_IPV6_HDRINCL) + XLAT(IPV6_HDRINCL), +#endif +#if defined(IPV6_RECVPKTINFO) || (defined(HAVE_DECL_IPV6_RECVPKTINFO) && HAVE_DECL_IPV6_RECVPKTINFO) + XLAT(IPV6_RECVPKTINFO), #endif - XLAT_END +#if defined(IPV6_PKTINFO) || (defined(HAVE_DECL_IPV6_PKTINFO) && HAVE_DECL_IPV6_PKTINFO) + XLAT(IPV6_PKTINFO), +#endif +#if defined(IPV6_RECVHOPLIMIT) || (defined(HAVE_DECL_IPV6_RECVHOPLIMIT) && HAVE_DECL_IPV6_RECVHOPLIMIT) + XLAT(IPV6_RECVHOPLIMIT), +#endif +#if defined(IPV6_HOPLIMIT) || (defined(HAVE_DECL_IPV6_HOPLIMIT) && HAVE_DECL_IPV6_HOPLIMIT) + XLAT(IPV6_HOPLIMIT), +#endif +#if defined(IPV6_RECVHOPOPTS) || (defined(HAVE_DECL_IPV6_RECVHOPOPTS) && HAVE_DECL_IPV6_RECVHOPOPTS) + XLAT(IPV6_RECVHOPOPTS), +#endif +#if defined(IPV6_HOPOPTS) || (defined(HAVE_DECL_IPV6_HOPOPTS) && HAVE_DECL_IPV6_HOPOPTS) + XLAT(IPV6_HOPOPTS), +#endif +#if defined(IPV6_RTHDRDSTOPTS) || (defined(HAVE_DECL_IPV6_RTHDRDSTOPTS) && HAVE_DECL_IPV6_RTHDRDSTOPTS) + XLAT(IPV6_RTHDRDSTOPTS), +#endif +#if defined(IPV6_RECVRTHDR) || (defined(HAVE_DECL_IPV6_RECVRTHDR) && HAVE_DECL_IPV6_RECVRTHDR) + XLAT(IPV6_RECVRTHDR), +#endif +#if defined(IPV6_RTHDR) || (defined(HAVE_DECL_IPV6_RTHDR) && HAVE_DECL_IPV6_RTHDR) + XLAT(IPV6_RTHDR), +#endif +#if defined(IPV6_RECVDSTOPTS) || (defined(HAVE_DECL_IPV6_RECVDSTOPTS) && HAVE_DECL_IPV6_RECVDSTOPTS) + XLAT(IPV6_RECVDSTOPTS), +#endif +#if defined(IPV6_DSTOPTS) || (defined(HAVE_DECL_IPV6_DSTOPTS) && HAVE_DECL_IPV6_DSTOPTS) + XLAT(IPV6_DSTOPTS), +#endif +#if defined(IPV6_RECVPATHMTU) || (defined(HAVE_DECL_IPV6_RECVPATHMTU) && HAVE_DECL_IPV6_RECVPATHMTU) + XLAT(IPV6_RECVPATHMTU), +#endif +#if defined(IPV6_PATHMTU) || (defined(HAVE_DECL_IPV6_PATHMTU) && HAVE_DECL_IPV6_PATHMTU) + XLAT(IPV6_PATHMTU), +#endif +#if defined(IPV6_DONTFRAG) || (defined(HAVE_DECL_IPV6_DONTFRAG) && HAVE_DECL_IPV6_DONTFRAG) + XLAT(IPV6_DONTFRAG), +#endif +#if defined(IPV6_USE_MIN_MTU) || (defined(HAVE_DECL_IPV6_USE_MIN_MTU) && HAVE_DECL_IPV6_USE_MIN_MTU) + XLAT(IPV6_USE_MIN_MTU), +#endif +#if defined(IPV6_RECVTCLASS) || (defined(HAVE_DECL_IPV6_RECVTCLASS) && HAVE_DECL_IPV6_RECVTCLASS) + XLAT(IPV6_RECVTCLASS), +#endif +#if defined(IPV6_TCLASS) || (defined(HAVE_DECL_IPV6_TCLASS) && HAVE_DECL_IPV6_TCLASS) + XLAT(IPV6_TCLASS), +#endif +#if defined(IPV6_AUTOFLOWLABEL) || (defined(HAVE_DECL_IPV6_AUTOFLOWLABEL) && HAVE_DECL_IPV6_AUTOFLOWLABEL) + XLAT(IPV6_AUTOFLOWLABEL), +#endif +#if defined(IPV6_ADDR_PREFERENCES) || (defined(HAVE_DECL_IPV6_ADDR_PREFERENCES) && HAVE_DECL_IPV6_ADDR_PREFERENCES) + XLAT(IPV6_ADDR_PREFERENCES), +#endif +#if defined(IPV6_MINHOPCOUNT) || (defined(HAVE_DECL_IPV6_MINHOPCOUNT) && HAVE_DECL_IPV6_MINHOPCOUNT) + XLAT(IPV6_MINHOPCOUNT), +#endif +#if defined(IPV6_ORIGDSTADDR) || (defined(HAVE_DECL_IPV6_ORIGDSTADDR) && HAVE_DECL_IPV6_ORIGDSTADDR) + XLAT(IPV6_ORIGDSTADDR), +#endif +#if defined(IPV6_RECVORIGDSTADDR) || (defined(HAVE_DECL_IPV6_RECVORIGDSTADDR) && HAVE_DECL_IPV6_RECVORIGDSTADDR) + XLAT(IPV6_RECVORIGDSTADDR), +#endif +#if defined(IPV6_TRANSPARENT) || (defined(HAVE_DECL_IPV6_TRANSPARENT) && HAVE_DECL_IPV6_TRANSPARENT) + XLAT(IPV6_TRANSPARENT), +#endif +#if defined(IPV6_UNICAST_IF) || (defined(HAVE_DECL_IPV6_UNICAST_IF) && HAVE_DECL_IPV6_UNICAST_IF) + XLAT(IPV6_UNICAST_IF), +#endif +#if defined(IPV6_RECVFRAGSIZE) || (defined(HAVE_DECL_IPV6_RECVFRAGSIZE) && HAVE_DECL_IPV6_RECVFRAGSIZE) + XLAT(IPV6_RECVFRAGSIZE), +#endif + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sockipv6options.in b/xlat/sockipv6options.in index 7808ae07..56e2721d 100644 --- a/xlat/sockipv6options.in +++ b/xlat/sockipv6options.in @@ -1,21 +1,54 @@ IPV6_ADDRFORM -MCAST_FILTER -IPV6_PKTOPTIONS -IPV6_MTU -IPV6_V6ONLY -IPV6_PKTINFO -IPV6_HOPLIMIT -IPV6_RTHDR -IPV6_HOPOPTS -IPV6_DSTOPTS +IPV6_2292PKTINFO +IPV6_2292HOPOPTS +IPV6_2292DSTOPTS +IPV6_2292RTHDR +IPV6_2292PKTOPTIONS +IPV6_CHECKSUM +IPV6_2292HOPLIMIT +IPV6_NEXTHOP +IPV6_AUTHHDR IPV6_FLOWINFO IPV6_UNICAST_HOPS +IPV6_MULTICAST_IF IPV6_MULTICAST_HOPS IPV6_MULTICAST_LOOP -IPV6_MULTICAST_IF -IPV6_MTU_DISCOVER -IPV6_RECVERR -IPV6_FLOWINFO_SEND IPV6_ADD_MEMBERSHIP IPV6_DROP_MEMBERSHIP IPV6_ROUTER_ALERT +IPV6_MTU_DISCOVER +IPV6_MTU +IPV6_RECVERR +IPV6_V6ONLY +IPV6_JOIN_ANYCAST +IPV6_LEAVE_ANYCAST +IPV6_FLOWLABEL_MGR +IPV6_FLOWINFO_SEND +IPV6_IPSEC_POLICY +IPV6_XFRM_POLICY +IPV6_HDRINCL +IPV6_RECVPKTINFO +IPV6_PKTINFO +IPV6_RECVHOPLIMIT +IPV6_HOPLIMIT +IPV6_RECVHOPOPTS +IPV6_HOPOPTS +IPV6_RTHDRDSTOPTS +IPV6_RECVRTHDR +IPV6_RTHDR +IPV6_RECVDSTOPTS +IPV6_DSTOPTS +IPV6_RECVPATHMTU +IPV6_PATHMTU +IPV6_DONTFRAG +IPV6_USE_MIN_MTU +IPV6_RECVTCLASS +IPV6_TCLASS +IPV6_AUTOFLOWLABEL +IPV6_ADDR_PREFERENCES +IPV6_MINHOPCOUNT +IPV6_ORIGDSTADDR +IPV6_RECVORIGDSTADDR +IPV6_TRANSPARENT +IPV6_UNICAST_IF +IPV6_RECVFRAGSIZE diff --git a/xlat/sockipxoptions.h b/xlat/sockipxoptions.h index 6c47170c..0e92f0ea 100644 --- a/xlat/sockipxoptions.h +++ b/xlat/sockipxoptions.h @@ -1,8 +1,17 @@ /* Generated by ./xlat/gen.sh from ./xlat/sockipxoptions.in; do not edit. */ -static const struct xlat sockipxoptions[] = { +#ifdef IN_MPERS + +# error static const struct xlat sockipxoptions in mpers mode + +#else + +static +const struct xlat sockipxoptions[] = { #if defined(IPX_TYPE) || (defined(HAVE_DECL_IPX_TYPE) && HAVE_DECL_IPX_TYPE) - XLAT(IPX_TYPE), + XLAT(IPX_TYPE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sockoptions.h b/xlat/sockoptions.h index 2ac9d71a..87d570f1 100644 --- a/xlat/sockoptions.h +++ b/xlat/sockoptions.h @@ -1,131 +1,213 @@ /* Generated by ./xlat/gen.sh from ./xlat/sockoptions.in; do not edit. */ -static const struct xlat sockoptions[] = { -#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) - XLAT(SO_ACCEPTCONN), +#ifdef IN_MPERS + +# error static const struct xlat sockoptions in mpers mode + +#else + +static +const struct xlat sockoptions[] = { +#if defined(SO_DEBUG) || (defined(HAVE_DECL_SO_DEBUG) && HAVE_DECL_SO_DEBUG) + XLAT(SO_DEBUG), #endif -#if defined(SO_ALLRAW) || (defined(HAVE_DECL_SO_ALLRAW) && HAVE_DECL_SO_ALLRAW) - XLAT(SO_ALLRAW), +#if defined(SO_REUSEADDR) || (defined(HAVE_DECL_SO_REUSEADDR) && HAVE_DECL_SO_REUSEADDR) + XLAT(SO_REUSEADDR), #endif -#if defined(SO_ATTACH_FILTER) || (defined(HAVE_DECL_SO_ATTACH_FILTER) && HAVE_DECL_SO_ATTACH_FILTER) - XLAT(SO_ATTACH_FILTER), +#if defined(SO_TYPE) || (defined(HAVE_DECL_SO_TYPE) && HAVE_DECL_SO_TYPE) + XLAT(SO_TYPE), #endif -#if defined(SO_BINDTODEVICE) || (defined(HAVE_DECL_SO_BINDTODEVICE) && HAVE_DECL_SO_BINDTODEVICE) - XLAT(SO_BINDTODEVICE), +#if defined(SO_ERROR) || (defined(HAVE_DECL_SO_ERROR) && HAVE_DECL_SO_ERROR) + XLAT(SO_ERROR), +#endif +#if defined(SO_DONTROUTE) || (defined(HAVE_DECL_SO_DONTROUTE) && HAVE_DECL_SO_DONTROUTE) + XLAT(SO_DONTROUTE), #endif #if defined(SO_BROADCAST) || (defined(HAVE_DECL_SO_BROADCAST) && HAVE_DECL_SO_BROADCAST) - XLAT(SO_BROADCAST), + XLAT(SO_BROADCAST), #endif -#if defined(SO_BSDCOMPAT) || (defined(HAVE_DECL_SO_BSDCOMPAT) && HAVE_DECL_SO_BSDCOMPAT) - XLAT(SO_BSDCOMPAT), +#if defined(SO_SNDBUF) || (defined(HAVE_DECL_SO_SNDBUF) && HAVE_DECL_SO_SNDBUF) + XLAT(SO_SNDBUF), #endif -#if defined(SO_DEBUG) || (defined(HAVE_DECL_SO_DEBUG) && HAVE_DECL_SO_DEBUG) - XLAT(SO_DEBUG), +#if defined(SO_RCVBUF) || (defined(HAVE_DECL_SO_RCVBUF) && HAVE_DECL_SO_RCVBUF) + XLAT(SO_RCVBUF), #endif -#if defined(SO_DETACH_FILTER) || (defined(HAVE_DECL_SO_DETACH_FILTER) && HAVE_DECL_SO_DETACH_FILTER) - XLAT(SO_DETACH_FILTER), +#if defined(SO_SNDBUFFORCE) || (defined(HAVE_DECL_SO_SNDBUFFORCE) && HAVE_DECL_SO_SNDBUFFORCE) + XLAT(SO_SNDBUFFORCE), #endif -#if defined(SO_DONTROUTE) || (defined(HAVE_DECL_SO_DONTROUTE) && HAVE_DECL_SO_DONTROUTE) - XLAT(SO_DONTROUTE), +#if defined(SO_RCVBUFFORCE) || (defined(HAVE_DECL_SO_RCVBUFFORCE) && HAVE_DECL_SO_RCVBUFFORCE) + XLAT(SO_RCVBUFFORCE), #endif -#if defined(SO_ERROR) || (defined(HAVE_DECL_SO_ERROR) && HAVE_DECL_SO_ERROR) - XLAT(SO_ERROR), +#if defined(SO_KEEPALIVE) || (defined(HAVE_DECL_SO_KEEPALIVE) && HAVE_DECL_SO_KEEPALIVE) + XLAT(SO_KEEPALIVE), #endif -#if defined(SO_ICS) || (defined(HAVE_DECL_SO_ICS) && HAVE_DECL_SO_ICS) - XLAT(SO_ICS), +#if defined(SO_OOBINLINE) || (defined(HAVE_DECL_SO_OOBINLINE) && HAVE_DECL_SO_OOBINLINE) + XLAT(SO_OOBINLINE), #endif -#if defined(SO_IMASOCKET) || (defined(HAVE_DECL_SO_IMASOCKET) && HAVE_DECL_SO_IMASOCKET) - XLAT(SO_IMASOCKET), +#if defined(SO_NO_CHECK) || (defined(HAVE_DECL_SO_NO_CHECK) && HAVE_DECL_SO_NO_CHECK) + XLAT(SO_NO_CHECK), #endif -#if defined(SO_KEEPALIVE) || (defined(HAVE_DECL_SO_KEEPALIVE) && HAVE_DECL_SO_KEEPALIVE) - XLAT(SO_KEEPALIVE), +#if defined(SO_PRIORITY) || (defined(HAVE_DECL_SO_PRIORITY) && HAVE_DECL_SO_PRIORITY) + XLAT(SO_PRIORITY), #endif #if defined(SO_LINGER) || (defined(HAVE_DECL_SO_LINGER) && HAVE_DECL_SO_LINGER) - XLAT(SO_LINGER), + XLAT(SO_LINGER), #endif -#if defined(SO_LISTENING) || (defined(HAVE_DECL_SO_LISTENING) && HAVE_DECL_SO_LISTENING) - XLAT(SO_LISTENING), +#if defined(SO_BSDCOMPAT) || (defined(HAVE_DECL_SO_BSDCOMPAT) && HAVE_DECL_SO_BSDCOMPAT) + XLAT(SO_BSDCOMPAT), #endif -#if defined(SO_MGMT) || (defined(HAVE_DECL_SO_MGMT) && HAVE_DECL_SO_MGMT) - XLAT(SO_MGMT), +#if defined(SO_REUSEPORT) || (defined(HAVE_DECL_SO_REUSEPORT) && HAVE_DECL_SO_REUSEPORT) + XLAT(SO_REUSEPORT), #endif -#if defined(SO_NO_CHECK) || (defined(HAVE_DECL_SO_NO_CHECK) && HAVE_DECL_SO_NO_CHECK) - XLAT(SO_NO_CHECK), +#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) + XLAT(SO_PASSCRED), #endif -#if defined(SO_OOBINLINE) || (defined(HAVE_DECL_SO_OOBINLINE) && HAVE_DECL_SO_OOBINLINE) - XLAT(SO_OOBINLINE), +#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) + XLAT(SO_PEERCRED), #endif -#if defined(SO_ORDREL) || (defined(HAVE_DECL_SO_ORDREL) && HAVE_DECL_SO_ORDREL) - XLAT(SO_ORDREL), +#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) + XLAT(SO_RCVLOWAT), #endif -#if defined(SO_PARALLELSVR) || (defined(HAVE_DECL_SO_PARALLELSVR) && HAVE_DECL_SO_PARALLELSVR) - XLAT(SO_PARALLELSVR), +#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) + XLAT(SO_SNDLOWAT), #endif -#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) - XLAT(SO_PASSCRED), +#if defined(SO_RCVTIMEO) || (defined(HAVE_DECL_SO_RCVTIMEO) && HAVE_DECL_SO_RCVTIMEO) + XLAT(SO_RCVTIMEO), #endif -#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) - XLAT(SO_PEERCRED), +#if defined(SO_SNDTIMEO) || (defined(HAVE_DECL_SO_SNDTIMEO) && HAVE_DECL_SO_SNDTIMEO) + XLAT(SO_SNDTIMEO), +#endif +#if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) + XLAT(SO_SECURITY_AUTHENTICATION), +#endif +#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) + XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), +#endif +#if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) + XLAT(SO_SECURITY_ENCRYPTION_NETWORK), +#endif +#if defined(SO_BINDTODEVICE) || (defined(HAVE_DECL_SO_BINDTODEVICE) && HAVE_DECL_SO_BINDTODEVICE) + XLAT(SO_BINDTODEVICE), +#endif +#if defined(SO_ATTACH_FILTER) || (defined(HAVE_DECL_SO_ATTACH_FILTER) && HAVE_DECL_SO_ATTACH_FILTER) + XLAT(SO_ATTACH_FILTER), +#endif +#if defined(SO_GET_FILTER) || (defined(HAVE_DECL_SO_GET_FILTER) && HAVE_DECL_SO_GET_FILTER) + XLAT(SO_GET_FILTER), +#endif +#if defined(SO_DETACH_FILTER) || (defined(HAVE_DECL_SO_DETACH_FILTER) && HAVE_DECL_SO_DETACH_FILTER) + XLAT(SO_DETACH_FILTER), +#endif +#if defined(SO_DETACH_BPF) || (defined(HAVE_DECL_SO_DETACH_BPF) && HAVE_DECL_SO_DETACH_BPF) + XLAT(SO_DETACH_BPF), #endif #if defined(SO_PEERNAME) || (defined(HAVE_DECL_SO_PEERNAME) && HAVE_DECL_SO_PEERNAME) - XLAT(SO_PEERNAME), + XLAT(SO_PEERNAME), +#endif +#if defined(SO_TIMESTAMP) || (defined(HAVE_DECL_SO_TIMESTAMP) && HAVE_DECL_SO_TIMESTAMP) + XLAT(SO_TIMESTAMP), +#endif +#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) + XLAT(SO_ACCEPTCONN), #endif #if defined(SO_PEERSEC) || (defined(HAVE_DECL_SO_PEERSEC) && HAVE_DECL_SO_PEERSEC) - XLAT(SO_PEERSEC), + XLAT(SO_PEERSEC), #endif -#if defined(SO_PRIORITY) || (defined(HAVE_DECL_SO_PRIORITY) && HAVE_DECL_SO_PRIORITY) - XLAT(SO_PRIORITY), +#if defined(SO_PASSSEC) || (defined(HAVE_DECL_SO_PASSSEC) && HAVE_DECL_SO_PASSSEC) + XLAT(SO_PASSSEC), #endif -#if defined(SO_PROTOTYPE) || (defined(HAVE_DECL_SO_PROTOTYPE) && HAVE_DECL_SO_PROTOTYPE) - XLAT(SO_PROTOTYPE), +#if defined(SO_TIMESTAMPNS) || (defined(HAVE_DECL_SO_TIMESTAMPNS) && HAVE_DECL_SO_TIMESTAMPNS) + XLAT(SO_TIMESTAMPNS), #endif -#if defined(SO_RCVBUF) || (defined(HAVE_DECL_SO_RCVBUF) && HAVE_DECL_SO_RCVBUF) - XLAT(SO_RCVBUF), +#if defined(SO_MARK) || (defined(HAVE_DECL_SO_MARK) && HAVE_DECL_SO_MARK) + XLAT(SO_MARK), #endif -#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) - XLAT(SO_RCVLOWAT), +#if defined(SO_TIMESTAMPING) || (defined(HAVE_DECL_SO_TIMESTAMPING) && HAVE_DECL_SO_TIMESTAMPING) + XLAT(SO_TIMESTAMPING), #endif -#if defined(SO_RCVTIMEO) || (defined(HAVE_DECL_SO_RCVTIMEO) && HAVE_DECL_SO_RCVTIMEO) - XLAT(SO_RCVTIMEO), +#if defined(SO_PROTOCOL) || (defined(HAVE_DECL_SO_PROTOCOL) && HAVE_DECL_SO_PROTOCOL) + XLAT(SO_PROTOCOL), #endif -#if defined(SO_RDWR) || (defined(HAVE_DECL_SO_RDWR) && HAVE_DECL_SO_RDWR) - XLAT(SO_RDWR), +#if defined(SO_DOMAIN) || (defined(HAVE_DECL_SO_DOMAIN) && HAVE_DECL_SO_DOMAIN) + XLAT(SO_DOMAIN), #endif -#if defined(SO_REUSEADDR) || (defined(HAVE_DECL_SO_REUSEADDR) && HAVE_DECL_SO_REUSEADDR) - XLAT(SO_REUSEADDR), +#if defined(SO_RXQ_OVFL) || (defined(HAVE_DECL_SO_RXQ_OVFL) && HAVE_DECL_SO_RXQ_OVFL) + XLAT(SO_RXQ_OVFL), #endif -#if defined(SO_REUSEPORT) || (defined(HAVE_DECL_SO_REUSEPORT) && HAVE_DECL_SO_REUSEPORT) - XLAT(SO_REUSEPORT), +#if defined(SO_WIFI_STATUS) || (defined(HAVE_DECL_SO_WIFI_STATUS) && HAVE_DECL_SO_WIFI_STATUS) + XLAT(SO_WIFI_STATUS), #endif -#if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) - XLAT(SO_SECURITY_AUTHENTICATION), +#if defined(SO_PEEK_OFF) || (defined(HAVE_DECL_SO_PEEK_OFF) && HAVE_DECL_SO_PEEK_OFF) + XLAT(SO_PEEK_OFF), #endif -#if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) - XLAT(SO_SECURITY_ENCRYPTION_NETWORK), +#if defined(SO_NOFCS) || (defined(HAVE_DECL_SO_NOFCS) && HAVE_DECL_SO_NOFCS) + XLAT(SO_NOFCS), #endif -#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) - XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), +#if defined(SO_LOCK_FILTER) || (defined(HAVE_DECL_SO_LOCK_FILTER) && HAVE_DECL_SO_LOCK_FILTER) + XLAT(SO_LOCK_FILTER), #endif -#if defined(SO_SEMA) || (defined(HAVE_DECL_SO_SEMA) && HAVE_DECL_SO_SEMA) - XLAT(SO_SEMA), +#if defined(SO_SELECT_ERR_QUEUE) || (defined(HAVE_DECL_SO_SELECT_ERR_QUEUE) && HAVE_DECL_SO_SELECT_ERR_QUEUE) + XLAT(SO_SELECT_ERR_QUEUE), #endif -#if defined(SO_SNDBUF) || (defined(HAVE_DECL_SO_SNDBUF) && HAVE_DECL_SO_SNDBUF) - XLAT(SO_SNDBUF), +#if defined(SO_BUSY_POLL) || (defined(HAVE_DECL_SO_BUSY_POLL) && HAVE_DECL_SO_BUSY_POLL) + XLAT(SO_BUSY_POLL), #endif -#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) - XLAT(SO_SNDLOWAT), +#if defined(SO_MAX_PACING_RATE) || (defined(HAVE_DECL_SO_MAX_PACING_RATE) && HAVE_DECL_SO_MAX_PACING_RATE) + XLAT(SO_MAX_PACING_RATE), #endif -#if defined(SO_SNDTIMEO) || (defined(HAVE_DECL_SO_SNDTIMEO) && HAVE_DECL_SO_SNDTIMEO) - XLAT(SO_SNDTIMEO), +#if defined(SO_BPF_EXTENSIONS) || (defined(HAVE_DECL_SO_BPF_EXTENSIONS) && HAVE_DECL_SO_BPF_EXTENSIONS) + XLAT(SO_BPF_EXTENSIONS), #endif -#if defined(SO_TIMESTAMP) || (defined(HAVE_DECL_SO_TIMESTAMP) && HAVE_DECL_SO_TIMESTAMP) - XLAT(SO_TIMESTAMP), +#if defined(SO_INCOMING_CPU) || (defined(HAVE_DECL_SO_INCOMING_CPU) && HAVE_DECL_SO_INCOMING_CPU) + XLAT(SO_INCOMING_CPU), #endif -#if defined(SO_TYPE) || (defined(HAVE_DECL_SO_TYPE) && HAVE_DECL_SO_TYPE) - XLAT(SO_TYPE), +#if defined(SO_ATTACH_BPF) || (defined(HAVE_DECL_SO_ATTACH_BPF) && HAVE_DECL_SO_ATTACH_BPF) + XLAT(SO_ATTACH_BPF), +#endif +#if defined(SO_ATTACH_REUSEPORT_CBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) + XLAT(SO_ATTACH_REUSEPORT_CBPF), +#endif +#if defined(SO_ATTACH_REUSEPORT_EBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) + XLAT(SO_ATTACH_REUSEPORT_EBPF), +#endif +#if defined(SO_CNX_ADVICE) || (defined(HAVE_DECL_SO_CNX_ADVICE) && HAVE_DECL_SO_CNX_ADVICE) + XLAT(SO_CNX_ADVICE), +#endif + +#if defined(SO_ALLRAW) || (defined(HAVE_DECL_SO_ALLRAW) && HAVE_DECL_SO_ALLRAW) + XLAT(SO_ALLRAW), +#endif +#if defined(SO_ICS) || (defined(HAVE_DECL_SO_ICS) && HAVE_DECL_SO_ICS) + XLAT(SO_ICS), +#endif +#if defined(SO_IMASOCKET) || (defined(HAVE_DECL_SO_IMASOCKET) && HAVE_DECL_SO_IMASOCKET) + XLAT(SO_IMASOCKET), +#endif +#if defined(SO_LISTENING) || (defined(HAVE_DECL_SO_LISTENING) && HAVE_DECL_SO_LISTENING) + XLAT(SO_LISTENING), +#endif +#if defined(SO_MGMT) || (defined(HAVE_DECL_SO_MGMT) && HAVE_DECL_SO_MGMT) + XLAT(SO_MGMT), +#endif +#if defined(SO_ORDREL) || (defined(HAVE_DECL_SO_ORDREL) && HAVE_DECL_SO_ORDREL) + XLAT(SO_ORDREL), +#endif +#if defined(SO_PARALLELSVR) || (defined(HAVE_DECL_SO_PARALLELSVR) && HAVE_DECL_SO_PARALLELSVR) + XLAT(SO_PARALLELSVR), +#endif +#if defined(SO_PROTOTYPE) || (defined(HAVE_DECL_SO_PROTOTYPE) && HAVE_DECL_SO_PROTOTYPE) + XLAT(SO_PROTOTYPE), +#endif +#if defined(SO_RDWR) || (defined(HAVE_DECL_SO_RDWR) && HAVE_DECL_SO_RDWR) + XLAT(SO_RDWR), +#endif +#if defined(SO_SEMA) || (defined(HAVE_DECL_SO_SEMA) && HAVE_DECL_SO_SEMA) + XLAT(SO_SEMA), #endif #if defined(SO_USELOOPBACK) || (defined(HAVE_DECL_SO_USELOOPBACK) && HAVE_DECL_SO_USELOOPBACK) - XLAT(SO_USELOOPBACK), + XLAT(SO_USELOOPBACK), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sockoptions.in b/xlat/sockoptions.in index 9778a859..fce851a8 100644 --- a/xlat/sockoptions.in +++ b/xlat/sockoptions.in @@ -1,42 +1,67 @@ -SO_ACCEPTCONN -SO_ALLRAW -SO_ATTACH_FILTER -SO_BINDTODEVICE +SO_DEBUG +SO_REUSEADDR +SO_TYPE +SO_ERROR +SO_DONTROUTE SO_BROADCAST +SO_SNDBUF +SO_RCVBUF +SO_SNDBUFFORCE +SO_RCVBUFFORCE +SO_KEEPALIVE +SO_OOBINLINE +SO_NO_CHECK +SO_PRIORITY +SO_LINGER SO_BSDCOMPAT -SO_DEBUG +SO_REUSEPORT +SO_PASSCRED +SO_PEERCRED +SO_RCVLOWAT +SO_SNDLOWAT +SO_RCVTIMEO +SO_SNDTIMEO +SO_SECURITY_AUTHENTICATION +SO_SECURITY_ENCRYPTION_TRANSPORT +SO_SECURITY_ENCRYPTION_NETWORK +SO_BINDTODEVICE +SO_ATTACH_FILTER +SO_GET_FILTER SO_DETACH_FILTER -SO_DONTROUTE -SO_ERROR +SO_DETACH_BPF +SO_PEERNAME +SO_TIMESTAMP +SO_ACCEPTCONN +SO_PEERSEC +SO_PASSSEC +SO_TIMESTAMPNS +SO_MARK +SO_TIMESTAMPING +SO_PROTOCOL +SO_DOMAIN +SO_RXQ_OVFL +SO_WIFI_STATUS +SO_PEEK_OFF +SO_NOFCS +SO_LOCK_FILTER +SO_SELECT_ERR_QUEUE +SO_BUSY_POLL +SO_MAX_PACING_RATE +SO_BPF_EXTENSIONS +SO_INCOMING_CPU +SO_ATTACH_BPF +SO_ATTACH_REUSEPORT_CBPF +SO_ATTACH_REUSEPORT_EBPF +SO_CNX_ADVICE + +SO_ALLRAW SO_ICS SO_IMASOCKET -SO_KEEPALIVE -SO_LINGER SO_LISTENING SO_MGMT -SO_NO_CHECK -SO_OOBINLINE SO_ORDREL SO_PARALLELSVR -SO_PASSCRED -SO_PEERCRED -SO_PEERNAME -SO_PEERSEC -SO_PRIORITY SO_PROTOTYPE -SO_RCVBUF -SO_RCVLOWAT -SO_RCVTIMEO SO_RDWR -SO_REUSEADDR -SO_REUSEPORT -SO_SECURITY_AUTHENTICATION -SO_SECURITY_ENCRYPTION_NETWORK -SO_SECURITY_ENCRYPTION_TRANSPORT SO_SEMA -SO_SNDBUF -SO_SNDLOWAT -SO_SNDTIMEO -SO_TIMESTAMP -SO_TYPE SO_USELOOPBACK diff --git a/xlat/sockpacketoptions.h b/xlat/sockpacketoptions.h index e7025ebc..ae4c5f40 100644 --- a/xlat/sockpacketoptions.h +++ b/xlat/sockpacketoptions.h @@ -1,44 +1,77 @@ /* Generated by ./xlat/gen.sh from ./xlat/sockpacketoptions.in; do not edit. */ -static const struct xlat sockpacketoptions[] = { +#ifdef IN_MPERS + +# error static const struct xlat sockpacketoptions in mpers mode + +#else + +static +const struct xlat sockpacketoptions[] = { #if defined(PACKET_ADD_MEMBERSHIP) || (defined(HAVE_DECL_PACKET_ADD_MEMBERSHIP) && HAVE_DECL_PACKET_ADD_MEMBERSHIP) - XLAT(PACKET_ADD_MEMBERSHIP), + XLAT(PACKET_ADD_MEMBERSHIP), #endif #if defined(PACKET_DROP_MEMBERSHIP) || (defined(HAVE_DECL_PACKET_DROP_MEMBERSHIP) && HAVE_DECL_PACKET_DROP_MEMBERSHIP) - XLAT(PACKET_DROP_MEMBERSHIP), + XLAT(PACKET_DROP_MEMBERSHIP), #endif #if defined(PACKET_RECV_OUTPUT) || (defined(HAVE_DECL_PACKET_RECV_OUTPUT) && HAVE_DECL_PACKET_RECV_OUTPUT) - XLAT(PACKET_RECV_OUTPUT), + XLAT(PACKET_RECV_OUTPUT), #endif #if defined(PACKET_RX_RING) || (defined(HAVE_DECL_PACKET_RX_RING) && HAVE_DECL_PACKET_RX_RING) - XLAT(PACKET_RX_RING), + XLAT(PACKET_RX_RING), #endif #if defined(PACKET_STATISTICS) || (defined(HAVE_DECL_PACKET_STATISTICS) && HAVE_DECL_PACKET_STATISTICS) - XLAT(PACKET_STATISTICS), + XLAT(PACKET_STATISTICS), #endif #if defined(PACKET_COPY_THRESH) || (defined(HAVE_DECL_PACKET_COPY_THRESH) && HAVE_DECL_PACKET_COPY_THRESH) - XLAT(PACKET_COPY_THRESH), + XLAT(PACKET_COPY_THRESH), #endif #if defined(PACKET_AUXDATA) || (defined(HAVE_DECL_PACKET_AUXDATA) && HAVE_DECL_PACKET_AUXDATA) - XLAT(PACKET_AUXDATA), + XLAT(PACKET_AUXDATA), #endif #if defined(PACKET_ORIGDEV) || (defined(HAVE_DECL_PACKET_ORIGDEV) && HAVE_DECL_PACKET_ORIGDEV) - XLAT(PACKET_ORIGDEV), + XLAT(PACKET_ORIGDEV), #endif #if defined(PACKET_VERSION) || (defined(HAVE_DECL_PACKET_VERSION) && HAVE_DECL_PACKET_VERSION) - XLAT(PACKET_VERSION), + XLAT(PACKET_VERSION), #endif #if defined(PACKET_HDRLEN) || (defined(HAVE_DECL_PACKET_HDRLEN) && HAVE_DECL_PACKET_HDRLEN) - XLAT(PACKET_HDRLEN), + XLAT(PACKET_HDRLEN), #endif #if defined(PACKET_RESERVE) || (defined(HAVE_DECL_PACKET_RESERVE) && HAVE_DECL_PACKET_RESERVE) - XLAT(PACKET_RESERVE), + XLAT(PACKET_RESERVE), #endif #if defined(PACKET_TX_RING) || (defined(HAVE_DECL_PACKET_TX_RING) && HAVE_DECL_PACKET_TX_RING) - XLAT(PACKET_TX_RING), + XLAT(PACKET_TX_RING), #endif #if defined(PACKET_LOSS) || (defined(HAVE_DECL_PACKET_LOSS) && HAVE_DECL_PACKET_LOSS) - XLAT(PACKET_LOSS), + XLAT(PACKET_LOSS), +#endif +#if defined(PACKET_VNET_HDR) || (defined(HAVE_DECL_PACKET_VNET_HDR) && HAVE_DECL_PACKET_VNET_HDR) + XLAT(PACKET_VNET_HDR), +#endif +#if defined(PACKET_TX_TIMESTAMP) || (defined(HAVE_DECL_PACKET_TX_TIMESTAMP) && HAVE_DECL_PACKET_TX_TIMESTAMP) + XLAT(PACKET_TX_TIMESTAMP), +#endif +#if defined(PACKET_TIMESTAMP) || (defined(HAVE_DECL_PACKET_TIMESTAMP) && HAVE_DECL_PACKET_TIMESTAMP) + XLAT(PACKET_TIMESTAMP), #endif - XLAT_END +#if defined(PACKET_FANOUT) || (defined(HAVE_DECL_PACKET_FANOUT) && HAVE_DECL_PACKET_FANOUT) + XLAT(PACKET_FANOUT), +#endif +#if defined(PACKET_TX_HAS_OFF) || (defined(HAVE_DECL_PACKET_TX_HAS_OFF) && HAVE_DECL_PACKET_TX_HAS_OFF) + XLAT(PACKET_TX_HAS_OFF), +#endif +#if defined(PACKET_QDISC_BYPASS) || (defined(HAVE_DECL_PACKET_QDISC_BYPASS) && HAVE_DECL_PACKET_QDISC_BYPASS) + XLAT(PACKET_QDISC_BYPASS), +#endif +#if defined(PACKET_ROLLOVER_STATS) || (defined(HAVE_DECL_PACKET_ROLLOVER_STATS) && HAVE_DECL_PACKET_ROLLOVER_STATS) + XLAT(PACKET_ROLLOVER_STATS), +#endif +#if defined(PACKET_FANOUT_DATA) || (defined(HAVE_DECL_PACKET_FANOUT_DATA) && HAVE_DECL_PACKET_FANOUT_DATA) + XLAT(PACKET_FANOUT_DATA), +#endif + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sockpacketoptions.in b/xlat/sockpacketoptions.in index 734ca10f..d11ad0b4 100644 --- a/xlat/sockpacketoptions.in +++ b/xlat/sockpacketoptions.in @@ -11,3 +11,11 @@ PACKET_HDRLEN PACKET_RESERVE PACKET_TX_RING PACKET_LOSS +PACKET_VNET_HDR +PACKET_TX_TIMESTAMP +PACKET_TIMESTAMP +PACKET_FANOUT +PACKET_TX_HAS_OFF +PACKET_QDISC_BYPASS +PACKET_ROLLOVER_STATS +PACKET_FANOUT_DATA diff --git a/xlat/sockrawoptions.h b/xlat/sockrawoptions.h index 96ebded8..99868c8e 100644 --- a/xlat/sockrawoptions.h +++ b/xlat/sockrawoptions.h @@ -1,8 +1,17 @@ /* Generated by ./xlat/gen.sh from ./xlat/sockrawoptions.in; do not edit. */ -static const struct xlat sockrawoptions[] = { +#ifdef IN_MPERS + +# error static const struct xlat sockrawoptions in mpers mode + +#else + +static +const struct xlat sockrawoptions[] = { #if defined(ICMP_FILTER) || (defined(HAVE_DECL_ICMP_FILTER) && HAVE_DECL_ICMP_FILTER) - XLAT(ICMP_FILTER), + XLAT(ICMP_FILTER), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/socksctpoptions.h b/xlat/socksctpoptions.h index 0b54030e..cb34b9b6 100644 --- a/xlat/socksctpoptions.h +++ b/xlat/socksctpoptions.h @@ -1,123 +1,168 @@ /* Generated by ./xlat/gen.sh from ./xlat/socksctpoptions.in; do not edit. */ -static const struct xlat socksctpoptions[] = { +#ifdef IN_MPERS + +# error static const struct xlat socksctpoptions in mpers mode + +#else + +static +const struct xlat socksctpoptions[] = { #if defined(SCTP_RTOINFO) || (defined(HAVE_DECL_SCTP_RTOINFO) && HAVE_DECL_SCTP_RTOINFO) - XLAT(SCTP_RTOINFO), + XLAT(SCTP_RTOINFO), #endif #if defined(SCTP_ASSOCINFO) || (defined(HAVE_DECL_SCTP_ASSOCINFO) && HAVE_DECL_SCTP_ASSOCINFO) - XLAT(SCTP_ASSOCINFO), + XLAT(SCTP_ASSOCINFO), #endif #if defined(SCTP_INITMSG) || (defined(HAVE_DECL_SCTP_INITMSG) && HAVE_DECL_SCTP_INITMSG) - XLAT(SCTP_INITMSG), + XLAT(SCTP_INITMSG), #endif #if defined(SCTP_NODELAY) || (defined(HAVE_DECL_SCTP_NODELAY) && HAVE_DECL_SCTP_NODELAY) - XLAT(SCTP_NODELAY), + XLAT(SCTP_NODELAY), #endif #if defined(SCTP_AUTOCLOSE) || (defined(HAVE_DECL_SCTP_AUTOCLOSE) && HAVE_DECL_SCTP_AUTOCLOSE) - XLAT(SCTP_AUTOCLOSE), + XLAT(SCTP_AUTOCLOSE), #endif #if defined(SCTP_SET_PEER_PRIMARY_ADDR) || (defined(HAVE_DECL_SCTP_SET_PEER_PRIMARY_ADDR) && HAVE_DECL_SCTP_SET_PEER_PRIMARY_ADDR) - XLAT(SCTP_SET_PEER_PRIMARY_ADDR), + XLAT(SCTP_SET_PEER_PRIMARY_ADDR), #endif #if defined(SCTP_PRIMARY_ADDR) || (defined(HAVE_DECL_SCTP_PRIMARY_ADDR) && HAVE_DECL_SCTP_PRIMARY_ADDR) - XLAT(SCTP_PRIMARY_ADDR), + XLAT(SCTP_PRIMARY_ADDR), #endif #if defined(SCTP_ADAPTATION_LAYER) || (defined(HAVE_DECL_SCTP_ADAPTATION_LAYER) && HAVE_DECL_SCTP_ADAPTATION_LAYER) - XLAT(SCTP_ADAPTATION_LAYER), + XLAT(SCTP_ADAPTATION_LAYER), #endif #if defined(SCTP_DISABLE_FRAGMENTS) || (defined(HAVE_DECL_SCTP_DISABLE_FRAGMENTS) && HAVE_DECL_SCTP_DISABLE_FRAGMENTS) - XLAT(SCTP_DISABLE_FRAGMENTS), + XLAT(SCTP_DISABLE_FRAGMENTS), #endif #if defined(SCTP_PEER_ADDR_PARAMS) || (defined(HAVE_DECL_SCTP_PEER_ADDR_PARAMS) && HAVE_DECL_SCTP_PEER_ADDR_PARAMS) - XLAT(SCTP_PEER_ADDR_PARAMS), + XLAT(SCTP_PEER_ADDR_PARAMS), #endif #if defined(SCTP_DEFAULT_SEND_PARAM) || (defined(HAVE_DECL_SCTP_DEFAULT_SEND_PARAM) && HAVE_DECL_SCTP_DEFAULT_SEND_PARAM) - XLAT(SCTP_DEFAULT_SEND_PARAM), + XLAT(SCTP_DEFAULT_SEND_PARAM), #endif #if defined(SCTP_EVENTS) || (defined(HAVE_DECL_SCTP_EVENTS) && HAVE_DECL_SCTP_EVENTS) - XLAT(SCTP_EVENTS), + XLAT(SCTP_EVENTS), #endif #if defined(SCTP_I_WANT_MAPPED_V4_ADDR) || (defined(HAVE_DECL_SCTP_I_WANT_MAPPED_V4_ADDR) && HAVE_DECL_SCTP_I_WANT_MAPPED_V4_ADDR) - XLAT(SCTP_I_WANT_MAPPED_V4_ADDR), + XLAT(SCTP_I_WANT_MAPPED_V4_ADDR), #endif #if defined(SCTP_MAXSEG) || (defined(HAVE_DECL_SCTP_MAXSEG) && HAVE_DECL_SCTP_MAXSEG) - XLAT(SCTP_MAXSEG), + XLAT(SCTP_MAXSEG), #endif #if defined(SCTP_STATUS) || (defined(HAVE_DECL_SCTP_STATUS) && HAVE_DECL_SCTP_STATUS) - XLAT(SCTP_STATUS), + XLAT(SCTP_STATUS), #endif #if defined(SCTP_GET_PEER_ADDR_INFO) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDR_INFO) && HAVE_DECL_SCTP_GET_PEER_ADDR_INFO) - XLAT(SCTP_GET_PEER_ADDR_INFO), + XLAT(SCTP_GET_PEER_ADDR_INFO), #endif #if defined(SCTP_DELAYED_ACK) || (defined(HAVE_DECL_SCTP_DELAYED_ACK) && HAVE_DECL_SCTP_DELAYED_ACK) - XLAT(SCTP_DELAYED_ACK), + XLAT(SCTP_DELAYED_ACK), #endif #if defined(SCTP_CONTEXT) || (defined(HAVE_DECL_SCTP_CONTEXT) && HAVE_DECL_SCTP_CONTEXT) - XLAT(SCTP_CONTEXT), + XLAT(SCTP_CONTEXT), #endif #if defined(SCTP_FRAGMENT_INTERLEAVE) || (defined(HAVE_DECL_SCTP_FRAGMENT_INTERLEAVE) && HAVE_DECL_SCTP_FRAGMENT_INTERLEAVE) - XLAT(SCTP_FRAGMENT_INTERLEAVE), + XLAT(SCTP_FRAGMENT_INTERLEAVE), #endif #if defined(SCTP_PARTIAL_DELIVERY_POINT) || (defined(HAVE_DECL_SCTP_PARTIAL_DELIVERY_POINT) && HAVE_DECL_SCTP_PARTIAL_DELIVERY_POINT) - XLAT(SCTP_PARTIAL_DELIVERY_POINT), + XLAT(SCTP_PARTIAL_DELIVERY_POINT), #endif #if defined(SCTP_MAX_BURST) || (defined(HAVE_DECL_SCTP_MAX_BURST) && HAVE_DECL_SCTP_MAX_BURST) - XLAT(SCTP_MAX_BURST), + XLAT(SCTP_MAX_BURST), #endif #if defined(SCTP_AUTH_CHUNK) || (defined(HAVE_DECL_SCTP_AUTH_CHUNK) && HAVE_DECL_SCTP_AUTH_CHUNK) - XLAT(SCTP_AUTH_CHUNK), + XLAT(SCTP_AUTH_CHUNK), #endif #if defined(SCTP_HMAC_IDENT) || (defined(HAVE_DECL_SCTP_HMAC_IDENT) && HAVE_DECL_SCTP_HMAC_IDENT) - XLAT(SCTP_HMAC_IDENT), + XLAT(SCTP_HMAC_IDENT), #endif #if defined(SCTP_AUTH_KEY) || (defined(HAVE_DECL_SCTP_AUTH_KEY) && HAVE_DECL_SCTP_AUTH_KEY) - XLAT(SCTP_AUTH_KEY), + XLAT(SCTP_AUTH_KEY), #endif #if defined(SCTP_AUTH_ACTIVE_KEY) || (defined(HAVE_DECL_SCTP_AUTH_ACTIVE_KEY) && HAVE_DECL_SCTP_AUTH_ACTIVE_KEY) - XLAT(SCTP_AUTH_ACTIVE_KEY), + XLAT(SCTP_AUTH_ACTIVE_KEY), #endif #if defined(SCTP_AUTH_DELETE_KEY) || (defined(HAVE_DECL_SCTP_AUTH_DELETE_KEY) && HAVE_DECL_SCTP_AUTH_DELETE_KEY) - XLAT(SCTP_AUTH_DELETE_KEY), + XLAT(SCTP_AUTH_DELETE_KEY), #endif #if defined(SCTP_PEER_AUTH_CHUNKS) || (defined(HAVE_DECL_SCTP_PEER_AUTH_CHUNKS) && HAVE_DECL_SCTP_PEER_AUTH_CHUNKS) - XLAT(SCTP_PEER_AUTH_CHUNKS), + XLAT(SCTP_PEER_AUTH_CHUNKS), #endif #if defined(SCTP_LOCAL_AUTH_CHUNKS) || (defined(HAVE_DECL_SCTP_LOCAL_AUTH_CHUNKS) && HAVE_DECL_SCTP_LOCAL_AUTH_CHUNKS) - XLAT(SCTP_LOCAL_AUTH_CHUNKS), + XLAT(SCTP_LOCAL_AUTH_CHUNKS), #endif #if defined(SCTP_GET_ASSOC_NUMBER) || (defined(HAVE_DECL_SCTP_GET_ASSOC_NUMBER) && HAVE_DECL_SCTP_GET_ASSOC_NUMBER) - XLAT(SCTP_GET_ASSOC_NUMBER), + XLAT(SCTP_GET_ASSOC_NUMBER), +#endif +#if defined(SCTP_GET_ASSOC_ID_LIST) || (defined(HAVE_DECL_SCTP_GET_ASSOC_ID_LIST) && HAVE_DECL_SCTP_GET_ASSOC_ID_LIST) + XLAT(SCTP_GET_ASSOC_ID_LIST), +#endif +#if defined(SCTP_AUTO_ASCONF) || (defined(HAVE_DECL_SCTP_AUTO_ASCONF) && HAVE_DECL_SCTP_AUTO_ASCONF) + XLAT(SCTP_AUTO_ASCONF), +#endif +#if defined(SCTP_PEER_ADDR_THLDS) || (defined(HAVE_DECL_SCTP_PEER_ADDR_THLDS) && HAVE_DECL_SCTP_PEER_ADDR_THLDS) + XLAT(SCTP_PEER_ADDR_THLDS), +#endif +#if defined(SCTP_RECVRCVINFO) || (defined(HAVE_DECL_SCTP_RECVRCVINFO) && HAVE_DECL_SCTP_RECVRCVINFO) + XLAT(SCTP_RECVRCVINFO), +#endif +#if defined(SCTP_RECVNXTINFO) || (defined(HAVE_DECL_SCTP_RECVNXTINFO) && HAVE_DECL_SCTP_RECVNXTINFO) + XLAT(SCTP_RECVNXTINFO), +#endif +#if defined(SCTP_DEFAULT_SNDINFO) || (defined(HAVE_DECL_SCTP_DEFAULT_SNDINFO) && HAVE_DECL_SCTP_DEFAULT_SNDINFO) + XLAT(SCTP_DEFAULT_SNDINFO), #endif /* linux specific things */ #if defined(SCTP_SOCKOPT_BINDX_ADD) || (defined(HAVE_DECL_SCTP_SOCKOPT_BINDX_ADD) && HAVE_DECL_SCTP_SOCKOPT_BINDX_ADD) - XLAT(SCTP_SOCKOPT_BINDX_ADD), + XLAT(SCTP_SOCKOPT_BINDX_ADD), #endif #if defined(SCTP_SOCKOPT_BINDX_REM) || (defined(HAVE_DECL_SCTP_SOCKOPT_BINDX_REM) && HAVE_DECL_SCTP_SOCKOPT_BINDX_REM) - XLAT(SCTP_SOCKOPT_BINDX_REM), + XLAT(SCTP_SOCKOPT_BINDX_REM), #endif #if defined(SCTP_SOCKOPT_PEELOFF) || (defined(HAVE_DECL_SCTP_SOCKOPT_PEELOFF) && HAVE_DECL_SCTP_SOCKOPT_PEELOFF) - XLAT(SCTP_SOCKOPT_PEELOFF), + XLAT(SCTP_SOCKOPT_PEELOFF), #endif #if defined(SCTP_GET_PEER_ADDRS_NUM_OLD) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS_NUM_OLD) && HAVE_DECL_SCTP_GET_PEER_ADDRS_NUM_OLD) - XLAT(SCTP_GET_PEER_ADDRS_NUM_OLD), + XLAT(SCTP_GET_PEER_ADDRS_NUM_OLD), #endif #if defined(SCTP_GET_PEER_ADDRS_OLD) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS_OLD) && HAVE_DECL_SCTP_GET_PEER_ADDRS_OLD) - XLAT(SCTP_GET_PEER_ADDRS_OLD), + XLAT(SCTP_GET_PEER_ADDRS_OLD), #endif #if defined(SCTP_GET_LOCAL_ADDRS_NUM_OLD) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS_NUM_OLD) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS_NUM_OLD) - XLAT(SCTP_GET_LOCAL_ADDRS_NUM_OLD), + XLAT(SCTP_GET_LOCAL_ADDRS_NUM_OLD), #endif #if defined(SCTP_GET_LOCAL_ADDRS_OLD) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS_OLD) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS_OLD) - XLAT(SCTP_GET_LOCAL_ADDRS_OLD), + XLAT(SCTP_GET_LOCAL_ADDRS_OLD), #endif #if defined(SCTP_SOCKOPT_CONNECTX_OLD) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX_OLD) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX_OLD) - XLAT(SCTP_SOCKOPT_CONNECTX_OLD), + XLAT(SCTP_SOCKOPT_CONNECTX_OLD), #endif #if defined(SCTP_GET_PEER_ADDRS) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS) && HAVE_DECL_SCTP_GET_PEER_ADDRS) - XLAT(SCTP_GET_PEER_ADDRS), + XLAT(SCTP_GET_PEER_ADDRS), #endif #if defined(SCTP_GET_LOCAL_ADDRS) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS) - XLAT(SCTP_GET_LOCAL_ADDRS), + XLAT(SCTP_GET_LOCAL_ADDRS), +#endif +#if defined(SCTP_SOCKOPT_CONNECTX) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX) + XLAT(SCTP_SOCKOPT_CONNECTX), +#endif +#if defined(SCTP_SOCKOPT_CONNECTX3) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX3) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX3) + XLAT(SCTP_SOCKOPT_CONNECTX3), +#endif +#if defined(SCTP_GET_ASSOC_STATS) || (defined(HAVE_DECL_SCTP_GET_ASSOC_STATS) && HAVE_DECL_SCTP_GET_ASSOC_STATS) + XLAT(SCTP_GET_ASSOC_STATS), #endif - XLAT_END +#if defined(SCTP_PR_SUPPORTED) || (defined(HAVE_DECL_SCTP_PR_SUPPORTED) && HAVE_DECL_SCTP_PR_SUPPORTED) + XLAT(SCTP_PR_SUPPORTED), +#endif +#if defined(SCTP_DEFAULT_PRINFO) || (defined(HAVE_DECL_SCTP_DEFAULT_PRINFO) && HAVE_DECL_SCTP_DEFAULT_PRINFO) + XLAT(SCTP_DEFAULT_PRINFO), +#endif +#if defined(SCTP_PR_ASSOC_STATUS) || (defined(HAVE_DECL_SCTP_PR_ASSOC_STATUS) && HAVE_DECL_SCTP_PR_ASSOC_STATUS) + XLAT(SCTP_PR_ASSOC_STATUS), +#endif + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/socksctpoptions.in b/xlat/socksctpoptions.in index 5ee7ad02..fa967a23 100644 --- a/xlat/socksctpoptions.in +++ b/xlat/socksctpoptions.in @@ -27,6 +27,12 @@ SCTP_AUTH_DELETE_KEY SCTP_PEER_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS SCTP_GET_ASSOC_NUMBER +SCTP_GET_ASSOC_ID_LIST +SCTP_AUTO_ASCONF +SCTP_PEER_ADDR_THLDS +SCTP_RECVRCVINFO +SCTP_RECVNXTINFO +SCTP_DEFAULT_SNDINFO /* linux specific things */ SCTP_SOCKOPT_BINDX_ADD SCTP_SOCKOPT_BINDX_REM @@ -38,3 +44,9 @@ SCTP_GET_LOCAL_ADDRS_OLD SCTP_SOCKOPT_CONNECTX_OLD SCTP_GET_PEER_ADDRS SCTP_GET_LOCAL_ADDRS +SCTP_SOCKOPT_CONNECTX +SCTP_SOCKOPT_CONNECTX3 +SCTP_GET_ASSOC_STATS +SCTP_PR_SUPPORTED +SCTP_DEFAULT_PRINFO +SCTP_PR_ASSOC_STATUS diff --git a/xlat/socktcpoptions.h b/xlat/socktcpoptions.h index e6a3a287..7dd59239 100644 --- a/xlat/socktcpoptions.h +++ b/xlat/socktcpoptions.h @@ -1,77 +1,101 @@ /* Generated by ./xlat/gen.sh from ./xlat/socktcpoptions.in; do not edit. */ -static const struct xlat socktcpoptions[] = { +#ifdef IN_MPERS + +# error static const struct xlat socktcpoptions in mpers mode + +#else + +static +const struct xlat socktcpoptions[] = { #if defined(TCP_NODELAY) || (defined(HAVE_DECL_TCP_NODELAY) && HAVE_DECL_TCP_NODELAY) - XLAT(TCP_NODELAY), + XLAT(TCP_NODELAY), #endif #if defined(TCP_MAXSEG) || (defined(HAVE_DECL_TCP_MAXSEG) && HAVE_DECL_TCP_MAXSEG) - XLAT(TCP_MAXSEG), + XLAT(TCP_MAXSEG), #endif #if defined(TCP_CORK) || (defined(HAVE_DECL_TCP_CORK) && HAVE_DECL_TCP_CORK) - XLAT(TCP_CORK), + XLAT(TCP_CORK), #endif #if defined(TCP_KEEPIDLE) || (defined(HAVE_DECL_TCP_KEEPIDLE) && HAVE_DECL_TCP_KEEPIDLE) - XLAT(TCP_KEEPIDLE), + XLAT(TCP_KEEPIDLE), #endif #if defined(TCP_KEEPINTVL) || (defined(HAVE_DECL_TCP_KEEPINTVL) && HAVE_DECL_TCP_KEEPINTVL) - XLAT(TCP_KEEPINTVL), + XLAT(TCP_KEEPINTVL), #endif #if defined(TCP_KEEPCNT) || (defined(HAVE_DECL_TCP_KEEPCNT) && HAVE_DECL_TCP_KEEPCNT) - XLAT(TCP_KEEPCNT), + XLAT(TCP_KEEPCNT), #endif #if defined(TCP_SYNCNT) || (defined(HAVE_DECL_TCP_SYNCNT) && HAVE_DECL_TCP_SYNCNT) - XLAT(TCP_SYNCNT), + XLAT(TCP_SYNCNT), #endif #if defined(TCP_LINGER2) || (defined(HAVE_DECL_TCP_LINGER2) && HAVE_DECL_TCP_LINGER2) - XLAT(TCP_LINGER2), + XLAT(TCP_LINGER2), #endif #if defined(TCP_DEFER_ACCEPT) || (defined(HAVE_DECL_TCP_DEFER_ACCEPT) && HAVE_DECL_TCP_DEFER_ACCEPT) - XLAT(TCP_DEFER_ACCEPT), + XLAT(TCP_DEFER_ACCEPT), #endif #if defined(TCP_WINDOW_CLAMP) || (defined(HAVE_DECL_TCP_WINDOW_CLAMP) && HAVE_DECL_TCP_WINDOW_CLAMP) - XLAT(TCP_WINDOW_CLAMP), + XLAT(TCP_WINDOW_CLAMP), #endif #if defined(TCP_INFO) || (defined(HAVE_DECL_TCP_INFO) && HAVE_DECL_TCP_INFO) - XLAT(TCP_INFO), + XLAT(TCP_INFO), #endif #if defined(TCP_QUICKACK) || (defined(HAVE_DECL_TCP_QUICKACK) && HAVE_DECL_TCP_QUICKACK) - XLAT(TCP_QUICKACK), + XLAT(TCP_QUICKACK), #endif #if defined(TCP_CONGESTION) || (defined(HAVE_DECL_TCP_CONGESTION) && HAVE_DECL_TCP_CONGESTION) - XLAT(TCP_CONGESTION), + XLAT(TCP_CONGESTION), #endif #if defined(TCP_MD5SIG) || (defined(HAVE_DECL_TCP_MD5SIG) && HAVE_DECL_TCP_MD5SIG) - XLAT(TCP_MD5SIG), + XLAT(TCP_MD5SIG), #endif #if defined(TCP_COOKIE_TRANSACTIONS) || (defined(HAVE_DECL_TCP_COOKIE_TRANSACTIONS) && HAVE_DECL_TCP_COOKIE_TRANSACTIONS) - XLAT(TCP_COOKIE_TRANSACTIONS), + XLAT(TCP_COOKIE_TRANSACTIONS), #endif #if defined(TCP_THIN_LINEAR_TIMEOUTS) || (defined(HAVE_DECL_TCP_THIN_LINEAR_TIMEOUTS) && HAVE_DECL_TCP_THIN_LINEAR_TIMEOUTS) - XLAT(TCP_THIN_LINEAR_TIMEOUTS), + XLAT(TCP_THIN_LINEAR_TIMEOUTS), #endif #if defined(TCP_THIN_DUPACK) || (defined(HAVE_DECL_TCP_THIN_DUPACK) && HAVE_DECL_TCP_THIN_DUPACK) - XLAT(TCP_THIN_DUPACK), + XLAT(TCP_THIN_DUPACK), #endif #if defined(TCP_USER_TIMEOUT) || (defined(HAVE_DECL_TCP_USER_TIMEOUT) && HAVE_DECL_TCP_USER_TIMEOUT) - XLAT(TCP_USER_TIMEOUT), + XLAT(TCP_USER_TIMEOUT), #endif #if defined(TCP_REPAIR) || (defined(HAVE_DECL_TCP_REPAIR) && HAVE_DECL_TCP_REPAIR) - XLAT(TCP_REPAIR), + XLAT(TCP_REPAIR), #endif #if defined(TCP_REPAIR_QUEUE) || (defined(HAVE_DECL_TCP_REPAIR_QUEUE) && HAVE_DECL_TCP_REPAIR_QUEUE) - XLAT(TCP_REPAIR_QUEUE), + XLAT(TCP_REPAIR_QUEUE), #endif #if defined(TCP_QUEUE_SEQ) || (defined(HAVE_DECL_TCP_QUEUE_SEQ) && HAVE_DECL_TCP_QUEUE_SEQ) - XLAT(TCP_QUEUE_SEQ), + XLAT(TCP_QUEUE_SEQ), #endif #if defined(TCP_REPAIR_OPTIONS) || (defined(HAVE_DECL_TCP_REPAIR_OPTIONS) && HAVE_DECL_TCP_REPAIR_OPTIONS) - XLAT(TCP_REPAIR_OPTIONS), + XLAT(TCP_REPAIR_OPTIONS), #endif #if defined(TCP_FASTOPEN) || (defined(HAVE_DECL_TCP_FASTOPEN) && HAVE_DECL_TCP_FASTOPEN) - XLAT(TCP_FASTOPEN), + XLAT(TCP_FASTOPEN), #endif #if defined(TCP_TIMESTAMP) || (defined(HAVE_DECL_TCP_TIMESTAMP) && HAVE_DECL_TCP_TIMESTAMP) - XLAT(TCP_TIMESTAMP), + XLAT(TCP_TIMESTAMP), +#endif +#if defined(TCP_NOTSENT_LOWAT) || (defined(HAVE_DECL_TCP_NOTSENT_LOWAT) && HAVE_DECL_TCP_NOTSENT_LOWAT) + XLAT(TCP_NOTSENT_LOWAT), +#endif +#if defined(TCP_CC_INFO) || (defined(HAVE_DECL_TCP_CC_INFO) && HAVE_DECL_TCP_CC_INFO) + XLAT(TCP_CC_INFO), #endif - XLAT_END +#if defined(TCP_SAVE_SYN) || (defined(HAVE_DECL_TCP_SAVE_SYN) && HAVE_DECL_TCP_SAVE_SYN) + XLAT(TCP_SAVE_SYN), +#endif +#if defined(TCP_SAVED_SYN) || (defined(HAVE_DECL_TCP_SAVED_SYN) && HAVE_DECL_TCP_SAVED_SYN) + XLAT(TCP_SAVED_SYN), +#endif +#if defined(TCP_REPAIR_WINDOW) || (defined(HAVE_DECL_TCP_REPAIR_WINDOW) && HAVE_DECL_TCP_REPAIR_WINDOW) + XLAT(TCP_REPAIR_WINDOW), +#endif + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/socktcpoptions.in b/xlat/socktcpoptions.in index e83c3824..89bbd7ea 100644 --- a/xlat/socktcpoptions.in +++ b/xlat/socktcpoptions.in @@ -22,3 +22,8 @@ TCP_QUEUE_SEQ TCP_REPAIR_OPTIONS TCP_FASTOPEN TCP_TIMESTAMP +TCP_NOTSENT_LOWAT +TCP_CC_INFO +TCP_SAVE_SYN +TCP_SAVED_SYN +TCP_REPAIR_WINDOW diff --git a/xlat/socktypes.h b/xlat/socktypes.h index 64347599..f9db97bc 100644 --- a/xlat/socktypes.h +++ b/xlat/socktypes.h @@ -1,26 +1,35 @@ /* Generated by ./xlat/gen.sh from ./xlat/socktypes.in; do not edit. */ -static const struct xlat socktypes[] = { +#ifdef IN_MPERS + +# error static const struct xlat socktypes in mpers mode + +#else + +static +const struct xlat socktypes[] = { #if defined(SOCK_STREAM) || (defined(HAVE_DECL_SOCK_STREAM) && HAVE_DECL_SOCK_STREAM) - XLAT(SOCK_STREAM), + XLAT(SOCK_STREAM), #endif #if defined(SOCK_DGRAM) || (defined(HAVE_DECL_SOCK_DGRAM) && HAVE_DECL_SOCK_DGRAM) - XLAT(SOCK_DGRAM), + XLAT(SOCK_DGRAM), #endif #if defined(SOCK_RAW) || (defined(HAVE_DECL_SOCK_RAW) && HAVE_DECL_SOCK_RAW) - XLAT(SOCK_RAW), + XLAT(SOCK_RAW), #endif #if defined(SOCK_RDM) || (defined(HAVE_DECL_SOCK_RDM) && HAVE_DECL_SOCK_RDM) - XLAT(SOCK_RDM), + XLAT(SOCK_RDM), #endif #if defined(SOCK_SEQPACKET) || (defined(HAVE_DECL_SOCK_SEQPACKET) && HAVE_DECL_SOCK_SEQPACKET) - XLAT(SOCK_SEQPACKET), + XLAT(SOCK_SEQPACKET), #endif #if defined(SOCK_DCCP) || (defined(HAVE_DECL_SOCK_DCCP) && HAVE_DECL_SOCK_DCCP) - XLAT(SOCK_DCCP), + XLAT(SOCK_DCCP), #endif #if defined(SOCK_PACKET) || (defined(HAVE_DECL_SOCK_PACKET) && HAVE_DECL_SOCK_PACKET) - XLAT(SOCK_PACKET), + XLAT(SOCK_PACKET), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/splice_flags.h b/xlat/splice_flags.h index 7ae6c841..5d305839 100644 --- a/xlat/splice_flags.h +++ b/xlat/splice_flags.h @@ -1,17 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/splice_flags.in; do not edit. */ -static const struct xlat splice_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat splice_flags in mpers mode + +#else + +static +const struct xlat splice_flags[] = { #if defined(SPLICE_F_MOVE) || (defined(HAVE_DECL_SPLICE_F_MOVE) && HAVE_DECL_SPLICE_F_MOVE) - XLAT(SPLICE_F_MOVE), + XLAT(SPLICE_F_MOVE), #endif #if defined(SPLICE_F_NONBLOCK) || (defined(HAVE_DECL_SPLICE_F_NONBLOCK) && HAVE_DECL_SPLICE_F_NONBLOCK) - XLAT(SPLICE_F_NONBLOCK), + XLAT(SPLICE_F_NONBLOCK), #endif #if defined(SPLICE_F_MORE) || (defined(HAVE_DECL_SPLICE_F_MORE) && HAVE_DECL_SPLICE_F_MORE) - XLAT(SPLICE_F_MORE), + XLAT(SPLICE_F_MORE), #endif #if defined(SPLICE_F_GIFT) || (defined(HAVE_DECL_SPLICE_F_GIFT) && HAVE_DECL_SPLICE_F_GIFT) - XLAT(SPLICE_F_GIFT), + XLAT(SPLICE_F_GIFT), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sram_alloc_flags.h b/xlat/sram_alloc_flags.h index 48dd0f1c..009324fc 100644 --- a/xlat/sram_alloc_flags.h +++ b/xlat/sram_alloc_flags.h @@ -1,20 +1,29 @@ /* Generated by ./xlat/gen.sh from ./xlat/sram_alloc_flags.in; do not edit. */ -static const struct xlat sram_alloc_flags[] = { +#ifdef IN_MPERS + +# error static const struct xlat sram_alloc_flags in mpers mode + +#else + +static +const struct xlat sram_alloc_flags[] = { #if defined(L1_INST_SRAM) || (defined(HAVE_DECL_L1_INST_SRAM) && HAVE_DECL_L1_INST_SRAM) - XLAT(L1_INST_SRAM), + XLAT(L1_INST_SRAM), #endif #if defined(L1_DATA_A_SRAM) || (defined(HAVE_DECL_L1_DATA_A_SRAM) && HAVE_DECL_L1_DATA_A_SRAM) - XLAT(L1_DATA_A_SRAM), + XLAT(L1_DATA_A_SRAM), #endif #if defined(L1_DATA_B_SRAM) || (defined(HAVE_DECL_L1_DATA_B_SRAM) && HAVE_DECL_L1_DATA_B_SRAM) - XLAT(L1_DATA_B_SRAM), + XLAT(L1_DATA_B_SRAM), #endif #if defined(L1_DATA_SRAM) || (defined(HAVE_DECL_L1_DATA_SRAM) && HAVE_DECL_L1_DATA_SRAM) - XLAT(L1_DATA_SRAM), + XLAT(L1_DATA_SRAM), #endif #if defined(L2_SRAM) || (defined(HAVE_DECL_L2_SRAM) && HAVE_DECL_L2_SRAM) - XLAT(L2_SRAM), + XLAT(L2_SRAM), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/statfs_flags.h b/xlat/statfs_flags.h new file mode 100644 index 00000000..149f57fd --- /dev/null +++ b/xlat/statfs_flags.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/statfs_flags.in; do not edit. */ +#if !(defined(ST_VALID) || (defined(HAVE_DECL_ST_VALID) && HAVE_DECL_ST_VALID)) +# define ST_VALID 0x0020 +#endif +#if !(defined(ST_RDONLY) || (defined(HAVE_DECL_ST_RDONLY) && HAVE_DECL_ST_RDONLY)) +# define ST_RDONLY 0x0001 +#endif +#if !(defined(ST_NOSUID) || (defined(HAVE_DECL_ST_NOSUID) && HAVE_DECL_ST_NOSUID)) +# define ST_NOSUID 0x0002 +#endif +#if !(defined(ST_NODEV) || (defined(HAVE_DECL_ST_NODEV) && HAVE_DECL_ST_NODEV)) +# define ST_NODEV 0x0004 +#endif +#if !(defined(ST_NOEXEC) || (defined(HAVE_DECL_ST_NOEXEC) && HAVE_DECL_ST_NOEXEC)) +# define ST_NOEXEC 0x0008 +#endif +#if !(defined(ST_SYNCHRONOUS) || (defined(HAVE_DECL_ST_SYNCHRONOUS) && HAVE_DECL_ST_SYNCHRONOUS)) +# define ST_SYNCHRONOUS 0x0010 +#endif +#if !(defined(ST_MANDLOCK) || (defined(HAVE_DECL_ST_MANDLOCK) && HAVE_DECL_ST_MANDLOCK)) +# define ST_MANDLOCK 0x0040 +#endif +#if !(defined(ST_NOATIME) || (defined(HAVE_DECL_ST_NOATIME) && HAVE_DECL_ST_NOATIME)) +# define ST_NOATIME 0x0400 +#endif +#if !(defined(ST_NODIRATIME) || (defined(HAVE_DECL_ST_NODIRATIME) && HAVE_DECL_ST_NODIRATIME)) +# define ST_NODIRATIME 0x0800 +#endif +#if !(defined(ST_RELATIME) || (defined(HAVE_DECL_ST_RELATIME) && HAVE_DECL_ST_RELATIME)) +# define ST_RELATIME 0x1000 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat statfs_flags in mpers mode + +#else + +static +const struct xlat statfs_flags[] = { + XLAT(ST_VALID), + XLAT(ST_RDONLY), + XLAT(ST_NOSUID), + XLAT(ST_NODEV), + XLAT(ST_NOEXEC), + XLAT(ST_SYNCHRONOUS), + XLAT(ST_MANDLOCK), + XLAT(ST_NOATIME), + XLAT(ST_NODIRATIME), + XLAT(ST_RELATIME), + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/statfs_flags.in b/xlat/statfs_flags.in new file mode 100644 index 00000000..f791a60e --- /dev/null +++ b/xlat/statfs_flags.in @@ -0,0 +1,10 @@ +ST_VALID 0x0020 +ST_RDONLY 0x0001 +ST_NOSUID 0x0002 +ST_NODEV 0x0004 +ST_NOEXEC 0x0008 +ST_SYNCHRONOUS 0x0010 +ST_MANDLOCK 0x0040 +ST_NOATIME 0x0400 +ST_NODIRATIME 0x0800 +ST_RELATIME 0x1000 diff --git a/xlat/swap_flags.h b/xlat/swap_flags.h index 0ffc832d..9baec44e 100644 --- a/xlat/swap_flags.h +++ b/xlat/swap_flags.h @@ -1,11 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/swap_flags.in; do not edit. */ - -static const struct xlat swap_flags[] = { -#if defined(SWAP_FLAG_PREFER) || (defined(HAVE_DECL_SWAP_FLAG_PREFER) && HAVE_DECL_SWAP_FLAG_PREFER) - XLAT(SWAP_FLAG_PREFER), +#if !(defined(SWAP_FLAG_PREFER) || (defined(HAVE_DECL_SWAP_FLAG_PREFER) && HAVE_DECL_SWAP_FLAG_PREFER)) +# define SWAP_FLAG_PREFER 0x8000 +#endif +#if !(defined(SWAP_FLAG_DISCARD) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD) && HAVE_DECL_SWAP_FLAG_DISCARD)) +# define SWAP_FLAG_DISCARD 0x10000 #endif -#if defined(SWAP_FLAG_DISCARD) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD) && HAVE_DECL_SWAP_FLAG_DISCARD) - XLAT(SWAP_FLAG_DISCARD), +#if !(defined(SWAP_FLAG_DISCARD_ONCE) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD_ONCE) && HAVE_DECL_SWAP_FLAG_DISCARD_ONCE)) +# define SWAP_FLAG_DISCARD_ONCE 0x20000 #endif - XLAT_END +#if !(defined(SWAP_FLAG_DISCARD_PAGES) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD_PAGES) && HAVE_DECL_SWAP_FLAG_DISCARD_PAGES)) +# define SWAP_FLAG_DISCARD_PAGES 0x40000 +#endif + +#ifdef IN_MPERS + +# error static const struct xlat swap_flags in mpers mode + +#else + +static +const struct xlat swap_flags[] = { + XLAT(SWAP_FLAG_PREFER), + XLAT(SWAP_FLAG_DISCARD), + XLAT(SWAP_FLAG_DISCARD_ONCE), + XLAT(SWAP_FLAG_DISCARD_PAGES), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/swap_flags.in b/xlat/swap_flags.in index d93e2c1b..8800e301 100644 --- a/xlat/swap_flags.in +++ b/xlat/swap_flags.in @@ -1,2 +1,4 @@ -SWAP_FLAG_PREFER -SWAP_FLAG_DISCARD +SWAP_FLAG_PREFER 0x8000 +SWAP_FLAG_DISCARD 0x10000 +SWAP_FLAG_DISCARD_ONCE 0x20000 +SWAP_FLAG_DISCARD_PAGES 0x40000 diff --git a/xlat/sync_file_range_flags.h b/xlat/sync_file_range_flags.h index 53ee15c1..08d9ac1c 100644 --- a/xlat/sync_file_range_flags.h +++ b/xlat/sync_file_range_flags.h @@ -1,14 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/sync_file_range_flags.in; do not edit. */ - -static const struct xlat sync_file_range_flags[] = { -#if defined(SYNC_FILE_RANGE_WAIT_BEFORE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE) - XLAT(SYNC_FILE_RANGE_WAIT_BEFORE), +#if !(defined(SYNC_FILE_RANGE_WAIT_BEFORE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE)) +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 #endif -#if defined(SYNC_FILE_RANGE_WRITE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WRITE) && HAVE_DECL_SYNC_FILE_RANGE_WRITE) - XLAT(SYNC_FILE_RANGE_WRITE), +#if !(defined(SYNC_FILE_RANGE_WRITE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WRITE) && HAVE_DECL_SYNC_FILE_RANGE_WRITE)) +# define SYNC_FILE_RANGE_WRITE 2 #endif -#if defined(SYNC_FILE_RANGE_WAIT_AFTER) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER) - XLAT(SYNC_FILE_RANGE_WAIT_AFTER), +#if !(defined(SYNC_FILE_RANGE_WAIT_AFTER) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER)) +# define SYNC_FILE_RANGE_WAIT_AFTER 4 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat sync_file_range_flags in mpers mode + +#else + +static +const struct xlat sync_file_range_flags[] = { + XLAT(SYNC_FILE_RANGE_WAIT_BEFORE), + XLAT(SYNC_FILE_RANGE_WRITE), + XLAT(SYNC_FILE_RANGE_WAIT_AFTER), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sync_file_range_flags.in b/xlat/sync_file_range_flags.in index 3a62f29c..0b179a10 100644 --- a/xlat/sync_file_range_flags.in +++ b/xlat/sync_file_range_flags.in @@ -1,3 +1,3 @@ -SYNC_FILE_RANGE_WAIT_BEFORE -SYNC_FILE_RANGE_WRITE -SYNC_FILE_RANGE_WAIT_AFTER +SYNC_FILE_RANGE_WAIT_BEFORE 1 +SYNC_FILE_RANGE_WRITE 2 +SYNC_FILE_RANGE_WAIT_AFTER 4 diff --git a/xlat/sysctl_kern.h b/xlat/sysctl_kern.h index 562f3f0b..b7276da6 100644 --- a/xlat/sysctl_kern.h +++ b/xlat/sysctl_kern.h @@ -1,203 +1,114 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_kern.in; do not edit. */ -static const struct xlat sysctl_kern[] = { -#if defined(KERN_OSTYPE) || (defined(HAVE_DECL_KERN_OSTYPE) && HAVE_DECL_KERN_OSTYPE) - XLAT(KERN_OSTYPE), -#endif -#if defined(KERN_OSRELEASE) || (defined(HAVE_DECL_KERN_OSRELEASE) && HAVE_DECL_KERN_OSRELEASE) - XLAT(KERN_OSRELEASE), -#endif -#if defined(KERN_OSREV) || (defined(HAVE_DECL_KERN_OSREV) && HAVE_DECL_KERN_OSREV) - XLAT(KERN_OSREV), -#endif -#if defined(KERN_VERSION) || (defined(HAVE_DECL_KERN_VERSION) && HAVE_DECL_KERN_VERSION) - XLAT(KERN_VERSION), -#endif -#if defined(KERN_SECUREMASK) || (defined(HAVE_DECL_KERN_SECUREMASK) && HAVE_DECL_KERN_SECUREMASK) - XLAT(KERN_SECUREMASK), -#endif -#if defined(KERN_PROF) || (defined(HAVE_DECL_KERN_PROF) && HAVE_DECL_KERN_PROF) - XLAT(KERN_PROF), -#endif -#if defined(KERN_NODENAME) || (defined(HAVE_DECL_KERN_NODENAME) && HAVE_DECL_KERN_NODENAME) - XLAT(KERN_NODENAME), -#endif -#if defined(KERN_DOMAINNAME) || (defined(HAVE_DECL_KERN_DOMAINNAME) && HAVE_DECL_KERN_DOMAINNAME) - XLAT(KERN_DOMAINNAME), -#endif -#if defined(KERN_PANIC) || (defined(HAVE_DECL_KERN_PANIC) && HAVE_DECL_KERN_PANIC) - XLAT(KERN_PANIC), -#endif -#if defined(KERN_REALROOTDEV) || (defined(HAVE_DECL_KERN_REALROOTDEV) && HAVE_DECL_KERN_REALROOTDEV) - XLAT(KERN_REALROOTDEV), -#endif -#if defined(KERN_SPARC_REBOOT) || (defined(HAVE_DECL_KERN_SPARC_REBOOT) && HAVE_DECL_KERN_SPARC_REBOOT) - XLAT(KERN_SPARC_REBOOT), -#endif -#if defined(KERN_CTLALTDEL) || (defined(HAVE_DECL_KERN_CTLALTDEL) && HAVE_DECL_KERN_CTLALTDEL) - XLAT(KERN_CTLALTDEL), -#endif -#if defined(KERN_PRINTK) || (defined(HAVE_DECL_KERN_PRINTK) && HAVE_DECL_KERN_PRINTK) - XLAT(KERN_PRINTK), -#endif -#if defined(KERN_NAMETRANS) || (defined(HAVE_DECL_KERN_NAMETRANS) && HAVE_DECL_KERN_NAMETRANS) - XLAT(KERN_NAMETRANS), -#endif -#if defined(KERN_PPC_HTABRECLAIM) || (defined(HAVE_DECL_KERN_PPC_HTABRECLAIM) && HAVE_DECL_KERN_PPC_HTABRECLAIM) - XLAT(KERN_PPC_HTABRECLAIM), -#endif -#if defined(KERN_PPC_ZEROPAGED) || (defined(HAVE_DECL_KERN_PPC_ZEROPAGED) && HAVE_DECL_KERN_PPC_ZEROPAGED) - XLAT(KERN_PPC_ZEROPAGED), -#endif -#if defined(KERN_PPC_POWERSAVE_NAP) || (defined(HAVE_DECL_KERN_PPC_POWERSAVE_NAP) && HAVE_DECL_KERN_PPC_POWERSAVE_NAP) - XLAT(KERN_PPC_POWERSAVE_NAP), -#endif -#if defined(KERN_MODPROBE) || (defined(HAVE_DECL_KERN_MODPROBE) && HAVE_DECL_KERN_MODPROBE) - XLAT(KERN_MODPROBE), -#endif -#if defined(KERN_SG_BIG_BUFF) || (defined(HAVE_DECL_KERN_SG_BIG_BUFF) && HAVE_DECL_KERN_SG_BIG_BUFF) - XLAT(KERN_SG_BIG_BUFF), -#endif -#if defined(KERN_ACCT) || (defined(HAVE_DECL_KERN_ACCT) && HAVE_DECL_KERN_ACCT) - XLAT(KERN_ACCT), -#endif -#if defined(KERN_PPC_L2CR) || (defined(HAVE_DECL_KERN_PPC_L2CR) && HAVE_DECL_KERN_PPC_L2CR) - XLAT(KERN_PPC_L2CR), -#endif -#if defined(KERN_RTSIGNR) || (defined(HAVE_DECL_KERN_RTSIGNR) && HAVE_DECL_KERN_RTSIGNR) - XLAT(KERN_RTSIGNR), -#endif -#if defined(KERN_RTSIGMAX) || (defined(HAVE_DECL_KERN_RTSIGMAX) && HAVE_DECL_KERN_RTSIGMAX) - XLAT(KERN_RTSIGMAX), -#endif -#if defined(KERN_SHMMAX) || (defined(HAVE_DECL_KERN_SHMMAX) && HAVE_DECL_KERN_SHMMAX) - XLAT(KERN_SHMMAX), -#endif -#if defined(KERN_MSGMAX) || (defined(HAVE_DECL_KERN_MSGMAX) && HAVE_DECL_KERN_MSGMAX) - XLAT(KERN_MSGMAX), -#endif -#if defined(KERN_MSGMNB) || (defined(HAVE_DECL_KERN_MSGMNB) && HAVE_DECL_KERN_MSGMNB) - XLAT(KERN_MSGMNB), -#endif -#if defined(KERN_MSGPOOL) || (defined(HAVE_DECL_KERN_MSGPOOL) && HAVE_DECL_KERN_MSGPOOL) - XLAT(KERN_MSGPOOL), -#endif -#if defined(KERN_SYSRQ) || (defined(HAVE_DECL_KERN_SYSRQ) && HAVE_DECL_KERN_SYSRQ) - XLAT(KERN_SYSRQ), -#endif -#if defined(KERN_MAX_THREADS) || (defined(HAVE_DECL_KERN_MAX_THREADS) && HAVE_DECL_KERN_MAX_THREADS) - XLAT(KERN_MAX_THREADS), -#endif -#if defined(KERN_RANDOM) || (defined(HAVE_DECL_KERN_RANDOM) && HAVE_DECL_KERN_RANDOM) - XLAT(KERN_RANDOM), -#endif -#if defined(KERN_SHMALL) || (defined(HAVE_DECL_KERN_SHMALL) && HAVE_DECL_KERN_SHMALL) - XLAT(KERN_SHMALL), -#endif -#if defined(KERN_MSGMNI) || (defined(HAVE_DECL_KERN_MSGMNI) && HAVE_DECL_KERN_MSGMNI) - XLAT(KERN_MSGMNI), -#endif -#if defined(KERN_SEM) || (defined(HAVE_DECL_KERN_SEM) && HAVE_DECL_KERN_SEM) - XLAT(KERN_SEM), -#endif -#if defined(KERN_SPARC_STOP_A) || (defined(HAVE_DECL_KERN_SPARC_STOP_A) && HAVE_DECL_KERN_SPARC_STOP_A) - XLAT(KERN_SPARC_STOP_A), -#endif -#if defined(KERN_SHMMNI) || (defined(HAVE_DECL_KERN_SHMMNI) && HAVE_DECL_KERN_SHMMNI) - XLAT(KERN_SHMMNI), -#endif -#if defined(KERN_OVERFLOWUID) || (defined(HAVE_DECL_KERN_OVERFLOWUID) && HAVE_DECL_KERN_OVERFLOWUID) - XLAT(KERN_OVERFLOWUID), -#endif -#if defined(KERN_OVERFLOWGID) || (defined(HAVE_DECL_KERN_OVERFLOWGID) && HAVE_DECL_KERN_OVERFLOWGID) - XLAT(KERN_OVERFLOWGID), -#endif -#if defined(KERN_SHMPATH) || (defined(HAVE_DECL_KERN_SHMPATH) && HAVE_DECL_KERN_SHMPATH) - XLAT(KERN_SHMPATH), -#endif -#if defined(KERN_HOTPLUG) || (defined(HAVE_DECL_KERN_HOTPLUG) && HAVE_DECL_KERN_HOTPLUG) - XLAT(KERN_HOTPLUG), -#endif -#if defined(KERN_IEEE_EMULATION_WARNINGS) || (defined(HAVE_DECL_KERN_IEEE_EMULATION_WARNINGS) && HAVE_DECL_KERN_IEEE_EMULATION_WARNINGS) - XLAT(KERN_IEEE_EMULATION_WARNINGS), -#endif -#if defined(KERN_S390_USER_DEBUG_LOGGING) || (defined(HAVE_DECL_KERN_S390_USER_DEBUG_LOGGING) && HAVE_DECL_KERN_S390_USER_DEBUG_LOGGING) - XLAT(KERN_S390_USER_DEBUG_LOGGING), -#endif -#if defined(KERN_CORE_USES_PID) || (defined(HAVE_DECL_KERN_CORE_USES_PID) && HAVE_DECL_KERN_CORE_USES_PID) - XLAT(KERN_CORE_USES_PID), -#endif -#if defined(KERN_TAINTED) || (defined(HAVE_DECL_KERN_TAINTED) && HAVE_DECL_KERN_TAINTED) - XLAT(KERN_TAINTED), -#endif -#if defined(KERN_CADPID) || (defined(HAVE_DECL_KERN_CADPID) && HAVE_DECL_KERN_CADPID) - XLAT(KERN_CADPID), -#endif -#if defined(KERN_PIDMAX) || (defined(HAVE_DECL_KERN_PIDMAX) && HAVE_DECL_KERN_PIDMAX) - XLAT(KERN_PIDMAX), -#endif -#if defined(KERN_CORE_PATTERN) || (defined(HAVE_DECL_KERN_CORE_PATTERN) && HAVE_DECL_KERN_CORE_PATTERN) - XLAT(KERN_CORE_PATTERN), -#endif -#if defined(KERN_PANIC_ON_OOPS) || (defined(HAVE_DECL_KERN_PANIC_ON_OOPS) && HAVE_DECL_KERN_PANIC_ON_OOPS) - XLAT(KERN_PANIC_ON_OOPS), -#endif -#if defined(KERN_HPPA_PWRSW) || (defined(HAVE_DECL_KERN_HPPA_PWRSW) && HAVE_DECL_KERN_HPPA_PWRSW) - XLAT(KERN_HPPA_PWRSW), -#endif -#if defined(KERN_HPPA_UNALIGNED) || (defined(HAVE_DECL_KERN_HPPA_UNALIGNED) && HAVE_DECL_KERN_HPPA_UNALIGNED) - XLAT(KERN_HPPA_UNALIGNED), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_kern in mpers mode + +#else + +static +const struct xlat sysctl_kern[] = { + XLAT(KERN_OSTYPE), + XLAT(KERN_OSRELEASE), + XLAT(KERN_OSREV), + XLAT(KERN_VERSION), + XLAT(KERN_SECUREMASK), + XLAT(KERN_PROF), + XLAT(KERN_NODENAME), + XLAT(KERN_DOMAINNAME), + XLAT(KERN_PANIC), + XLAT(KERN_REALROOTDEV), + XLAT(KERN_SPARC_REBOOT), + XLAT(KERN_CTLALTDEL), + XLAT(KERN_PRINTK), + XLAT(KERN_NAMETRANS), + XLAT(KERN_PPC_HTABRECLAIM), + XLAT(KERN_PPC_ZEROPAGED), + XLAT(KERN_PPC_POWERSAVE_NAP), + XLAT(KERN_MODPROBE), + XLAT(KERN_SG_BIG_BUFF), + XLAT(KERN_ACCT), + XLAT(KERN_PPC_L2CR), + XLAT(KERN_RTSIGNR), + XLAT(KERN_RTSIGMAX), + XLAT(KERN_SHMMAX), + XLAT(KERN_MSGMAX), + XLAT(KERN_MSGMNB), + XLAT(KERN_MSGPOOL), + XLAT(KERN_SYSRQ), + XLAT(KERN_MAX_THREADS), + XLAT(KERN_RANDOM), + XLAT(KERN_SHMALL), + XLAT(KERN_MSGMNI), + XLAT(KERN_SEM), + XLAT(KERN_SPARC_STOP_A), + XLAT(KERN_SHMMNI), + XLAT(KERN_OVERFLOWUID), + XLAT(KERN_OVERFLOWGID), + XLAT(KERN_SHMPATH), + XLAT(KERN_HOTPLUG), + XLAT(KERN_IEEE_EMULATION_WARNINGS), + XLAT(KERN_S390_USER_DEBUG_LOGGING), + XLAT(KERN_CORE_USES_PID), + XLAT(KERN_TAINTED), + XLAT(KERN_CADPID), + XLAT(KERN_PIDMAX), + XLAT(KERN_CORE_PATTERN), + XLAT(KERN_PANIC_ON_OOPS), + XLAT(KERN_HPPA_PWRSW), + XLAT(KERN_HPPA_UNALIGNED), #if defined(KERN_PRINTK_RATELIMIT) || (defined(HAVE_DECL_KERN_PRINTK_RATELIMIT) && HAVE_DECL_KERN_PRINTK_RATELIMIT) - XLAT(KERN_PRINTK_RATELIMIT), + XLAT(KERN_PRINTK_RATELIMIT), #endif #if defined(KERN_PRINTK_RATELIMIT_BURST) || (defined(HAVE_DECL_KERN_PRINTK_RATELIMIT_BURST) && HAVE_DECL_KERN_PRINTK_RATELIMIT_BURST) - XLAT(KERN_PRINTK_RATELIMIT_BURST), + XLAT(KERN_PRINTK_RATELIMIT_BURST), #endif #if defined(KERN_PTY) || (defined(HAVE_DECL_KERN_PTY) && HAVE_DECL_KERN_PTY) - XLAT(KERN_PTY), + XLAT(KERN_PTY), #endif #if defined(KERN_NGROUPS_MAX) || (defined(HAVE_DECL_KERN_NGROUPS_MAX) && HAVE_DECL_KERN_NGROUPS_MAX) - XLAT(KERN_NGROUPS_MAX), + XLAT(KERN_NGROUPS_MAX), #endif #if defined(KERN_SPARC_SCONS_PWROFF) || (defined(HAVE_DECL_KERN_SPARC_SCONS_PWROFF) && HAVE_DECL_KERN_SPARC_SCONS_PWROFF) - XLAT(KERN_SPARC_SCONS_PWROFF), + XLAT(KERN_SPARC_SCONS_PWROFF), #endif #if defined(KERN_HZ_TIMER) || (defined(HAVE_DECL_KERN_HZ_TIMER) && HAVE_DECL_KERN_HZ_TIMER) - XLAT(KERN_HZ_TIMER), + XLAT(KERN_HZ_TIMER), #endif #if defined(KERN_UNKNOWN_NMI_PANIC) || (defined(HAVE_DECL_KERN_UNKNOWN_NMI_PANIC) && HAVE_DECL_KERN_UNKNOWN_NMI_PANIC) - XLAT(KERN_UNKNOWN_NMI_PANIC), + XLAT(KERN_UNKNOWN_NMI_PANIC), #endif #if defined(KERN_BOOTLOADER_TYPE) || (defined(HAVE_DECL_KERN_BOOTLOADER_TYPE) && HAVE_DECL_KERN_BOOTLOADER_TYPE) - XLAT(KERN_BOOTLOADER_TYPE), + XLAT(KERN_BOOTLOADER_TYPE), #endif #if defined(KERN_RANDOMIZE) || (defined(HAVE_DECL_KERN_RANDOMIZE) && HAVE_DECL_KERN_RANDOMIZE) - XLAT(KERN_RANDOMIZE), + XLAT(KERN_RANDOMIZE), #endif #if defined(KERN_SETUID_DUMPABLE) || (defined(HAVE_DECL_KERN_SETUID_DUMPABLE) && HAVE_DECL_KERN_SETUID_DUMPABLE) - XLAT(KERN_SETUID_DUMPABLE), + XLAT(KERN_SETUID_DUMPABLE), #endif #if defined(KERN_SPIN_RETRY) || (defined(HAVE_DECL_KERN_SPIN_RETRY) && HAVE_DECL_KERN_SPIN_RETRY) - XLAT(KERN_SPIN_RETRY), + XLAT(KERN_SPIN_RETRY), #endif #if defined(KERN_ACPI_VIDEO_FLAGS) || (defined(HAVE_DECL_KERN_ACPI_VIDEO_FLAGS) && HAVE_DECL_KERN_ACPI_VIDEO_FLAGS) - XLAT(KERN_ACPI_VIDEO_FLAGS), + XLAT(KERN_ACPI_VIDEO_FLAGS), #endif #if defined(KERN_IA64_UNALIGNED) || (defined(HAVE_DECL_KERN_IA64_UNALIGNED) && HAVE_DECL_KERN_IA64_UNALIGNED) - XLAT(KERN_IA64_UNALIGNED), + XLAT(KERN_IA64_UNALIGNED), #endif #if defined(KERN_COMPAT_LOG) || (defined(HAVE_DECL_KERN_COMPAT_LOG) && HAVE_DECL_KERN_COMPAT_LOG) - XLAT(KERN_COMPAT_LOG), + XLAT(KERN_COMPAT_LOG), #endif #if defined(KERN_MAX_LOCK_DEPTH) || (defined(HAVE_DECL_KERN_MAX_LOCK_DEPTH) && HAVE_DECL_KERN_MAX_LOCK_DEPTH) - XLAT(KERN_MAX_LOCK_DEPTH), + XLAT(KERN_MAX_LOCK_DEPTH), #endif #if defined(KERN_NMI_WATCHDOG) || (defined(HAVE_DECL_KERN_NMI_WATCHDOG) && HAVE_DECL_KERN_NMI_WATCHDOG) - XLAT(KERN_NMI_WATCHDOG), + XLAT(KERN_NMI_WATCHDOG), #endif #if defined(KERN_PANIC_ON_NMI) || (defined(HAVE_DECL_KERN_PANIC_ON_NMI) && HAVE_DECL_KERN_PANIC_ON_NMI) - XLAT(KERN_PANIC_ON_NMI), + XLAT(KERN_PANIC_ON_NMI), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_kern.in b/xlat/sysctl_kern.in index 93ebfe28..b0568cea 100644 --- a/xlat/sysctl_kern.in +++ b/xlat/sysctl_kern.in @@ -1,3 +1,4 @@ +#unconditional KERN_OSTYPE KERN_OSRELEASE KERN_OSREV @@ -47,6 +48,7 @@ KERN_CORE_PATTERN KERN_PANIC_ON_OOPS KERN_HPPA_PWRSW KERN_HPPA_UNALIGNED +#conditional KERN_PRINTK_RATELIMIT KERN_PRINTK_RATELIMIT_BURST KERN_PTY diff --git a/xlat/sysctl_net.h b/xlat/sysctl_net.h index 675c4bdc..864c548b 100644 --- a/xlat/sysctl_net.h +++ b/xlat/sysctl_net.h @@ -1,68 +1,43 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net.in; do not edit. */ -static const struct xlat sysctl_net[] = { -#if defined(NET_CORE) || (defined(HAVE_DECL_NET_CORE) && HAVE_DECL_NET_CORE) - XLAT(NET_CORE), -#endif -#if defined(NET_ETHER) || (defined(HAVE_DECL_NET_ETHER) && HAVE_DECL_NET_ETHER) - XLAT(NET_ETHER), -#endif -#if defined(NET_802) || (defined(HAVE_DECL_NET_802) && HAVE_DECL_NET_802) - XLAT(NET_802), -#endif -#if defined(NET_UNIX) || (defined(HAVE_DECL_NET_UNIX) && HAVE_DECL_NET_UNIX) - XLAT(NET_UNIX), -#endif -#if defined(NET_IPV4) || (defined(HAVE_DECL_NET_IPV4) && HAVE_DECL_NET_IPV4) - XLAT(NET_IPV4), -#endif -#if defined(NET_IPX) || (defined(HAVE_DECL_NET_IPX) && HAVE_DECL_NET_IPX) - XLAT(NET_IPX), -#endif -#if defined(NET_ATALK) || (defined(HAVE_DECL_NET_ATALK) && HAVE_DECL_NET_ATALK) - XLAT(NET_ATALK), -#endif -#if defined(NET_NETROM) || (defined(HAVE_DECL_NET_NETROM) && HAVE_DECL_NET_NETROM) - XLAT(NET_NETROM), -#endif -#if defined(NET_AX25) || (defined(HAVE_DECL_NET_AX25) && HAVE_DECL_NET_AX25) - XLAT(NET_AX25), -#endif -#if defined(NET_BRIDGE) || (defined(HAVE_DECL_NET_BRIDGE) && HAVE_DECL_NET_BRIDGE) - XLAT(NET_BRIDGE), -#endif -#if defined(NET_ROSE) || (defined(HAVE_DECL_NET_ROSE) && HAVE_DECL_NET_ROSE) - XLAT(NET_ROSE), -#endif -#if defined(NET_IPV6) || (defined(HAVE_DECL_NET_IPV6) && HAVE_DECL_NET_IPV6) - XLAT(NET_IPV6), -#endif -#if defined(NET_X25) || (defined(HAVE_DECL_NET_X25) && HAVE_DECL_NET_X25) - XLAT(NET_X25), -#endif -#if defined(NET_TR) || (defined(HAVE_DECL_NET_TR) && HAVE_DECL_NET_TR) - XLAT(NET_TR), -#endif -#if defined(NET_DECNET) || (defined(HAVE_DECL_NET_DECNET) && HAVE_DECL_NET_DECNET) - XLAT(NET_DECNET), -#endif -#if defined(NET_ECONET) || (defined(HAVE_DECL_NET_ECONET) && HAVE_DECL_NET_ECONET) - XLAT(NET_ECONET), -#endif -#if defined(NET_SCTP) || (defined(HAVE_DECL_NET_SCTP) && HAVE_DECL_NET_SCTP) - XLAT(NET_SCTP), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net in mpers mode + +#else + +static +const struct xlat sysctl_net[] = { + XLAT(NET_CORE), + XLAT(NET_ETHER), + XLAT(NET_802), + XLAT(NET_UNIX), + XLAT(NET_IPV4), + XLAT(NET_IPX), + XLAT(NET_ATALK), + XLAT(NET_NETROM), + XLAT(NET_AX25), + XLAT(NET_BRIDGE), + XLAT(NET_ROSE), + XLAT(NET_IPV6), + XLAT(NET_X25), + XLAT(NET_TR), + XLAT(NET_DECNET), + XLAT(NET_ECONET), + XLAT(NET_SCTP), #if defined(NET_LLC) || (defined(HAVE_DECL_NET_LLC) && HAVE_DECL_NET_LLC) - XLAT(NET_LLC), + XLAT(NET_LLC), #endif #if defined(NET_NETFILTER) || (defined(HAVE_DECL_NET_NETFILTER) && HAVE_DECL_NET_NETFILTER) - XLAT(NET_NETFILTER), + XLAT(NET_NETFILTER), #endif #if defined(NET_DCCP) || (defined(HAVE_DECL_NET_DCCP) && HAVE_DECL_NET_DCCP) - XLAT(NET_DCCP), + XLAT(NET_DCCP), #endif #if defined(NET_IRDA) || (defined(HAVE_DECL_NET_IRDA) && HAVE_DECL_NET_IRDA) - XLAT(NET_IRDA), + XLAT(NET_IRDA), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net.in b/xlat/sysctl_net.in index 4e64a46c..cb08d919 100644 --- a/xlat/sysctl_net.in +++ b/xlat/sysctl_net.in @@ -1,3 +1,4 @@ +#unconditional NET_CORE NET_ETHER NET_802 @@ -15,6 +16,7 @@ NET_TR NET_DECNET NET_ECONET NET_SCTP +#conditional NET_LLC NET_NETFILTER NET_DCCP diff --git a/xlat/sysctl_net_core.h b/xlat/sysctl_net_core.h index 5a5d627c..d3db06cd 100644 --- a/xlat/sysctl_net_core.h +++ b/xlat/sysctl_net_core.h @@ -1,71 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_core.in; do not edit. */ -static const struct xlat sysctl_net_core[] = { -#if defined(NET_CORE_WMEM_MAX) || (defined(HAVE_DECL_NET_CORE_WMEM_MAX) && HAVE_DECL_NET_CORE_WMEM_MAX) - XLAT(NET_CORE_WMEM_MAX), -#endif -#if defined(NET_CORE_RMEM_MAX) || (defined(HAVE_DECL_NET_CORE_RMEM_MAX) && HAVE_DECL_NET_CORE_RMEM_MAX) - XLAT(NET_CORE_RMEM_MAX), -#endif -#if defined(NET_CORE_WMEM_DEFAULT) || (defined(HAVE_DECL_NET_CORE_WMEM_DEFAULT) && HAVE_DECL_NET_CORE_WMEM_DEFAULT) - XLAT(NET_CORE_WMEM_DEFAULT), -#endif -#if defined(NET_CORE_RMEM_DEFAULT) || (defined(HAVE_DECL_NET_CORE_RMEM_DEFAULT) && HAVE_DECL_NET_CORE_RMEM_DEFAULT) - XLAT(NET_CORE_RMEM_DEFAULT), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net_core in mpers mode + +#else + +static +const struct xlat sysctl_net_core[] = { + XLAT(NET_CORE_WMEM_MAX), + XLAT(NET_CORE_RMEM_MAX), + XLAT(NET_CORE_WMEM_DEFAULT), + XLAT(NET_CORE_RMEM_DEFAULT), + XLAT(NET_CORE_MAX_BACKLOG), + XLAT(NET_CORE_FASTROUTE), + XLAT(NET_CORE_MSG_COST), + XLAT(NET_CORE_MSG_BURST), + XLAT(NET_CORE_OPTMEM_MAX), + XLAT(NET_CORE_HOT_LIST_LENGTH), + XLAT(NET_CORE_DIVERT_VERSION), + XLAT(NET_CORE_NO_CONG_THRESH), + XLAT(NET_CORE_NO_CONG), + XLAT(NET_CORE_LO_CONG), + XLAT(NET_CORE_MOD_CONG), + XLAT(NET_CORE_DEV_WEIGHT), + XLAT(NET_CORE_SOMAXCONN), #if defined(NET_CORE_DESTROY_DELAY) || (defined(HAVE_DECL_NET_CORE_DESTROY_DELAY) && HAVE_DECL_NET_CORE_DESTROY_DELAY) - XLAT(NET_CORE_DESTROY_DELAY), -#endif -#if defined(NET_CORE_MAX_BACKLOG) || (defined(HAVE_DECL_NET_CORE_MAX_BACKLOG) && HAVE_DECL_NET_CORE_MAX_BACKLOG) - XLAT(NET_CORE_MAX_BACKLOG), -#endif -#if defined(NET_CORE_FASTROUTE) || (defined(HAVE_DECL_NET_CORE_FASTROUTE) && HAVE_DECL_NET_CORE_FASTROUTE) - XLAT(NET_CORE_FASTROUTE), -#endif -#if defined(NET_CORE_MSG_COST) || (defined(HAVE_DECL_NET_CORE_MSG_COST) && HAVE_DECL_NET_CORE_MSG_COST) - XLAT(NET_CORE_MSG_COST), -#endif -#if defined(NET_CORE_MSG_BURST) || (defined(HAVE_DECL_NET_CORE_MSG_BURST) && HAVE_DECL_NET_CORE_MSG_BURST) - XLAT(NET_CORE_MSG_BURST), -#endif -#if defined(NET_CORE_OPTMEM_MAX) || (defined(HAVE_DECL_NET_CORE_OPTMEM_MAX) && HAVE_DECL_NET_CORE_OPTMEM_MAX) - XLAT(NET_CORE_OPTMEM_MAX), -#endif -#if defined(NET_CORE_HOT_LIST_LENGTH) || (defined(HAVE_DECL_NET_CORE_HOT_LIST_LENGTH) && HAVE_DECL_NET_CORE_HOT_LIST_LENGTH) - XLAT(NET_CORE_HOT_LIST_LENGTH), -#endif -#if defined(NET_CORE_DIVERT_VERSION) || (defined(HAVE_DECL_NET_CORE_DIVERT_VERSION) && HAVE_DECL_NET_CORE_DIVERT_VERSION) - XLAT(NET_CORE_DIVERT_VERSION), -#endif -#if defined(NET_CORE_NO_CONG_THRESH) || (defined(HAVE_DECL_NET_CORE_NO_CONG_THRESH) && HAVE_DECL_NET_CORE_NO_CONG_THRESH) - XLAT(NET_CORE_NO_CONG_THRESH), -#endif -#if defined(NET_CORE_NO_CONG) || (defined(HAVE_DECL_NET_CORE_NO_CONG) && HAVE_DECL_NET_CORE_NO_CONG) - XLAT(NET_CORE_NO_CONG), -#endif -#if defined(NET_CORE_LO_CONG) || (defined(HAVE_DECL_NET_CORE_LO_CONG) && HAVE_DECL_NET_CORE_LO_CONG) - XLAT(NET_CORE_LO_CONG), -#endif -#if defined(NET_CORE_MOD_CONG) || (defined(HAVE_DECL_NET_CORE_MOD_CONG) && HAVE_DECL_NET_CORE_MOD_CONG) - XLAT(NET_CORE_MOD_CONG), -#endif -#if defined(NET_CORE_DEV_WEIGHT) || (defined(HAVE_DECL_NET_CORE_DEV_WEIGHT) && HAVE_DECL_NET_CORE_DEV_WEIGHT) - XLAT(NET_CORE_DEV_WEIGHT), -#endif -#if defined(NET_CORE_SOMAXCONN) || (defined(HAVE_DECL_NET_CORE_SOMAXCONN) && HAVE_DECL_NET_CORE_SOMAXCONN) - XLAT(NET_CORE_SOMAXCONN), + XLAT(NET_CORE_DESTROY_DELAY), #endif #if defined(NET_CORE_BUDGET) || (defined(HAVE_DECL_NET_CORE_BUDGET) && HAVE_DECL_NET_CORE_BUDGET) - XLAT(NET_CORE_BUDGET), + XLAT(NET_CORE_BUDGET), #endif #if defined(NET_CORE_AEVENT_ETIME) || (defined(HAVE_DECL_NET_CORE_AEVENT_ETIME) && HAVE_DECL_NET_CORE_AEVENT_ETIME) - XLAT(NET_CORE_AEVENT_ETIME), + XLAT(NET_CORE_AEVENT_ETIME), #endif #if defined(NET_CORE_AEVENT_RSEQTH) || (defined(HAVE_DECL_NET_CORE_AEVENT_RSEQTH) && HAVE_DECL_NET_CORE_AEVENT_RSEQTH) - XLAT(NET_CORE_AEVENT_RSEQTH), + XLAT(NET_CORE_AEVENT_RSEQTH), #endif #if defined(NET_CORE_WARNINGS) || (defined(HAVE_DECL_NET_CORE_WARNINGS) && HAVE_DECL_NET_CORE_WARNINGS) - XLAT(NET_CORE_WARNINGS), + XLAT(NET_CORE_WARNINGS), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net_core.in b/xlat/sysctl_net_core.in index d29dc502..054fd9fa 100644 --- a/xlat/sysctl_net_core.in +++ b/xlat/sysctl_net_core.in @@ -1,8 +1,8 @@ +#unconditional NET_CORE_WMEM_MAX NET_CORE_RMEM_MAX NET_CORE_WMEM_DEFAULT NET_CORE_RMEM_DEFAULT -NET_CORE_DESTROY_DELAY NET_CORE_MAX_BACKLOG NET_CORE_FASTROUTE NET_CORE_MSG_COST @@ -16,6 +16,8 @@ NET_CORE_LO_CONG NET_CORE_MOD_CONG NET_CORE_DEV_WEIGHT NET_CORE_SOMAXCONN +#conditional +NET_CORE_DESTROY_DELAY NET_CORE_BUDGET NET_CORE_AEVENT_ETIME NET_CORE_AEVENT_RSEQTH diff --git a/xlat/sysctl_net_ipv4.h b/xlat/sysctl_net_ipv4.h index addd87bf..cd0a005c 100644 --- a/xlat/sysctl_net_ipv4.h +++ b/xlat/sysctl_net_ipv4.h @@ -1,281 +1,152 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv4.in; do not edit. */ -static const struct xlat sysctl_net_ipv4[] = { -#if defined(NET_IPV4_FORWARD) || (defined(HAVE_DECL_NET_IPV4_FORWARD) && HAVE_DECL_NET_IPV4_FORWARD) - XLAT(NET_IPV4_FORWARD), -#endif -#if defined(NET_IPV4_DYNADDR) || (defined(HAVE_DECL_NET_IPV4_DYNADDR) && HAVE_DECL_NET_IPV4_DYNADDR) - XLAT(NET_IPV4_DYNADDR), -#endif -#if defined(NET_IPV4_CONF) || (defined(HAVE_DECL_NET_IPV4_CONF) && HAVE_DECL_NET_IPV4_CONF) - XLAT(NET_IPV4_CONF), -#endif -#if defined(NET_IPV4_NEIGH) || (defined(HAVE_DECL_NET_IPV4_NEIGH) && HAVE_DECL_NET_IPV4_NEIGH) - XLAT(NET_IPV4_NEIGH), -#endif -#if defined(NET_IPV4_ROUTE) || (defined(HAVE_DECL_NET_IPV4_ROUTE) && HAVE_DECL_NET_IPV4_ROUTE) - XLAT(NET_IPV4_ROUTE), -#endif -#if defined(NET_IPV4_FIB_HASH) || (defined(HAVE_DECL_NET_IPV4_FIB_HASH) && HAVE_DECL_NET_IPV4_FIB_HASH) - XLAT(NET_IPV4_FIB_HASH), -#endif -#if defined(NET_IPV4_NETFILTER) || (defined(HAVE_DECL_NET_IPV4_NETFILTER) && HAVE_DECL_NET_IPV4_NETFILTER) - XLAT(NET_IPV4_NETFILTER), -#endif -#if defined(NET_IPV4_TCP_TIMESTAMPS) || (defined(HAVE_DECL_NET_IPV4_TCP_TIMESTAMPS) && HAVE_DECL_NET_IPV4_TCP_TIMESTAMPS) - XLAT(NET_IPV4_TCP_TIMESTAMPS), -#endif -#if defined(NET_IPV4_TCP_WINDOW_SCALING) || (defined(HAVE_DECL_NET_IPV4_TCP_WINDOW_SCALING) && HAVE_DECL_NET_IPV4_TCP_WINDOW_SCALING) - XLAT(NET_IPV4_TCP_WINDOW_SCALING), -#endif -#if defined(NET_IPV4_TCP_SACK) || (defined(HAVE_DECL_NET_IPV4_TCP_SACK) && HAVE_DECL_NET_IPV4_TCP_SACK) - XLAT(NET_IPV4_TCP_SACK), -#endif -#if defined(NET_IPV4_TCP_RETRANS_COLLAPSE) || (defined(HAVE_DECL_NET_IPV4_TCP_RETRANS_COLLAPSE) && HAVE_DECL_NET_IPV4_TCP_RETRANS_COLLAPSE) - XLAT(NET_IPV4_TCP_RETRANS_COLLAPSE), -#endif -#if defined(NET_IPV4_DEFAULT_TTL) || (defined(HAVE_DECL_NET_IPV4_DEFAULT_TTL) && HAVE_DECL_NET_IPV4_DEFAULT_TTL) - XLAT(NET_IPV4_DEFAULT_TTL), -#endif -#if defined(NET_IPV4_AUTOCONFIG) || (defined(HAVE_DECL_NET_IPV4_AUTOCONFIG) && HAVE_DECL_NET_IPV4_AUTOCONFIG) - XLAT(NET_IPV4_AUTOCONFIG), -#endif -#if defined(NET_IPV4_NO_PMTU_DISC) || (defined(HAVE_DECL_NET_IPV4_NO_PMTU_DISC) && HAVE_DECL_NET_IPV4_NO_PMTU_DISC) - XLAT(NET_IPV4_NO_PMTU_DISC), -#endif -#if defined(NET_IPV4_TCP_SYN_RETRIES) || (defined(HAVE_DECL_NET_IPV4_TCP_SYN_RETRIES) && HAVE_DECL_NET_IPV4_TCP_SYN_RETRIES) - XLAT(NET_IPV4_TCP_SYN_RETRIES), -#endif -#if defined(NET_IPV4_IPFRAG_HIGH_THRESH) || (defined(HAVE_DECL_NET_IPV4_IPFRAG_HIGH_THRESH) && HAVE_DECL_NET_IPV4_IPFRAG_HIGH_THRESH) - XLAT(NET_IPV4_IPFRAG_HIGH_THRESH), -#endif -#if defined(NET_IPV4_IPFRAG_LOW_THRESH) || (defined(HAVE_DECL_NET_IPV4_IPFRAG_LOW_THRESH) && HAVE_DECL_NET_IPV4_IPFRAG_LOW_THRESH) - XLAT(NET_IPV4_IPFRAG_LOW_THRESH), -#endif -#if defined(NET_IPV4_IPFRAG_TIME) || (defined(HAVE_DECL_NET_IPV4_IPFRAG_TIME) && HAVE_DECL_NET_IPV4_IPFRAG_TIME) - XLAT(NET_IPV4_IPFRAG_TIME), -#endif -#if defined(NET_IPV4_TCP_MAX_KA_PROBES) || (defined(HAVE_DECL_NET_IPV4_TCP_MAX_KA_PROBES) && HAVE_DECL_NET_IPV4_TCP_MAX_KA_PROBES) - XLAT(NET_IPV4_TCP_MAX_KA_PROBES), -#endif -#if defined(NET_IPV4_TCP_KEEPALIVE_TIME) || (defined(HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_TIME) && HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_TIME) - XLAT(NET_IPV4_TCP_KEEPALIVE_TIME), -#endif -#if defined(NET_IPV4_TCP_KEEPALIVE_PROBES) || (defined(HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_PROBES) && HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_PROBES) - XLAT(NET_IPV4_TCP_KEEPALIVE_PROBES), -#endif -#if defined(NET_IPV4_TCP_RETRIES1) || (defined(HAVE_DECL_NET_IPV4_TCP_RETRIES1) && HAVE_DECL_NET_IPV4_TCP_RETRIES1) - XLAT(NET_IPV4_TCP_RETRIES1), -#endif -#if defined(NET_IPV4_TCP_RETRIES2) || (defined(HAVE_DECL_NET_IPV4_TCP_RETRIES2) && HAVE_DECL_NET_IPV4_TCP_RETRIES2) - XLAT(NET_IPV4_TCP_RETRIES2), -#endif -#if defined(NET_IPV4_TCP_FIN_TIMEOUT) || (defined(HAVE_DECL_NET_IPV4_TCP_FIN_TIMEOUT) && HAVE_DECL_NET_IPV4_TCP_FIN_TIMEOUT) - XLAT(NET_IPV4_TCP_FIN_TIMEOUT), -#endif -#if defined(NET_IPV4_IP_MASQ_DEBUG) || (defined(HAVE_DECL_NET_IPV4_IP_MASQ_DEBUG) && HAVE_DECL_NET_IPV4_IP_MASQ_DEBUG) - XLAT(NET_IPV4_IP_MASQ_DEBUG), -#endif -#if defined(NET_TCP_SYNCOOKIES) || (defined(HAVE_DECL_NET_TCP_SYNCOOKIES) && HAVE_DECL_NET_TCP_SYNCOOKIES) - XLAT(NET_TCP_SYNCOOKIES), -#endif -#if defined(NET_TCP_STDURG) || (defined(HAVE_DECL_NET_TCP_STDURG) && HAVE_DECL_NET_TCP_STDURG) - XLAT(NET_TCP_STDURG), -#endif -#if defined(NET_TCP_RFC1337) || (defined(HAVE_DECL_NET_TCP_RFC1337) && HAVE_DECL_NET_TCP_RFC1337) - XLAT(NET_TCP_RFC1337), -#endif -#if defined(NET_TCP_SYN_TAILDROP) || (defined(HAVE_DECL_NET_TCP_SYN_TAILDROP) && HAVE_DECL_NET_TCP_SYN_TAILDROP) - XLAT(NET_TCP_SYN_TAILDROP), -#endif -#if defined(NET_TCP_MAX_SYN_BACKLOG) || (defined(HAVE_DECL_NET_TCP_MAX_SYN_BACKLOG) && HAVE_DECL_NET_TCP_MAX_SYN_BACKLOG) - XLAT(NET_TCP_MAX_SYN_BACKLOG), -#endif -#if defined(NET_IPV4_LOCAL_PORT_RANGE) || (defined(HAVE_DECL_NET_IPV4_LOCAL_PORT_RANGE) && HAVE_DECL_NET_IPV4_LOCAL_PORT_RANGE) - XLAT(NET_IPV4_LOCAL_PORT_RANGE), -#endif -#if defined(NET_IPV4_ICMP_ECHO_IGNORE_ALL) || (defined(HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_ALL) && HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_ALL) - XLAT(NET_IPV4_ICMP_ECHO_IGNORE_ALL), -#endif -#if defined(NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS) || (defined(HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS) && HAVE_DECL_NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS) - XLAT(NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS), -#endif -#if defined(NET_IPV4_ICMP_SOURCEQUENCH_RATE) || (defined(HAVE_DECL_NET_IPV4_ICMP_SOURCEQUENCH_RATE) && HAVE_DECL_NET_IPV4_ICMP_SOURCEQUENCH_RATE) - XLAT(NET_IPV4_ICMP_SOURCEQUENCH_RATE), -#endif -#if defined(NET_IPV4_ICMP_DESTUNREACH_RATE) || (defined(HAVE_DECL_NET_IPV4_ICMP_DESTUNREACH_RATE) && HAVE_DECL_NET_IPV4_ICMP_DESTUNREACH_RATE) - XLAT(NET_IPV4_ICMP_DESTUNREACH_RATE), -#endif -#if defined(NET_IPV4_ICMP_TIMEEXCEED_RATE) || (defined(HAVE_DECL_NET_IPV4_ICMP_TIMEEXCEED_RATE) && HAVE_DECL_NET_IPV4_ICMP_TIMEEXCEED_RATE) - XLAT(NET_IPV4_ICMP_TIMEEXCEED_RATE), -#endif -#if defined(NET_IPV4_ICMP_PARAMPROB_RATE) || (defined(HAVE_DECL_NET_IPV4_ICMP_PARAMPROB_RATE) && HAVE_DECL_NET_IPV4_ICMP_PARAMPROB_RATE) - XLAT(NET_IPV4_ICMP_PARAMPROB_RATE), -#endif -#if defined(NET_IPV4_ICMP_ECHOREPLY_RATE) || (defined(HAVE_DECL_NET_IPV4_ICMP_ECHOREPLY_RATE) && HAVE_DECL_NET_IPV4_ICMP_ECHOREPLY_RATE) - XLAT(NET_IPV4_ICMP_ECHOREPLY_RATE), -#endif -#if defined(NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES) || (defined(HAVE_DECL_NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES) && HAVE_DECL_NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES) - XLAT(NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES), -#endif -#if defined(NET_IPV4_IGMP_MAX_MEMBERSHIPS) || (defined(HAVE_DECL_NET_IPV4_IGMP_MAX_MEMBERSHIPS) && HAVE_DECL_NET_IPV4_IGMP_MAX_MEMBERSHIPS) - XLAT(NET_IPV4_IGMP_MAX_MEMBERSHIPS), -#endif -#if defined(NET_TCP_TW_RECYCLE) || (defined(HAVE_DECL_NET_TCP_TW_RECYCLE) && HAVE_DECL_NET_TCP_TW_RECYCLE) - XLAT(NET_TCP_TW_RECYCLE), -#endif -#if defined(NET_IPV4_ALWAYS_DEFRAG) || (defined(HAVE_DECL_NET_IPV4_ALWAYS_DEFRAG) && HAVE_DECL_NET_IPV4_ALWAYS_DEFRAG) - XLAT(NET_IPV4_ALWAYS_DEFRAG), -#endif -#if defined(NET_IPV4_TCP_KEEPALIVE_INTVL) || (defined(HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_INTVL) && HAVE_DECL_NET_IPV4_TCP_KEEPALIVE_INTVL) - XLAT(NET_IPV4_TCP_KEEPALIVE_INTVL), -#endif -#if defined(NET_IPV4_INET_PEER_THRESHOLD) || (defined(HAVE_DECL_NET_IPV4_INET_PEER_THRESHOLD) && HAVE_DECL_NET_IPV4_INET_PEER_THRESHOLD) - XLAT(NET_IPV4_INET_PEER_THRESHOLD), -#endif -#if defined(NET_IPV4_INET_PEER_MINTTL) || (defined(HAVE_DECL_NET_IPV4_INET_PEER_MINTTL) && HAVE_DECL_NET_IPV4_INET_PEER_MINTTL) - XLAT(NET_IPV4_INET_PEER_MINTTL), -#endif -#if defined(NET_IPV4_INET_PEER_MAXTTL) || (defined(HAVE_DECL_NET_IPV4_INET_PEER_MAXTTL) && HAVE_DECL_NET_IPV4_INET_PEER_MAXTTL) - XLAT(NET_IPV4_INET_PEER_MAXTTL), -#endif -#if defined(NET_IPV4_INET_PEER_GC_MINTIME) || (defined(HAVE_DECL_NET_IPV4_INET_PEER_GC_MINTIME) && HAVE_DECL_NET_IPV4_INET_PEER_GC_MINTIME) - XLAT(NET_IPV4_INET_PEER_GC_MINTIME), -#endif -#if defined(NET_IPV4_INET_PEER_GC_MAXTIME) || (defined(HAVE_DECL_NET_IPV4_INET_PEER_GC_MAXTIME) && HAVE_DECL_NET_IPV4_INET_PEER_GC_MAXTIME) - XLAT(NET_IPV4_INET_PEER_GC_MAXTIME), -#endif -#if defined(NET_TCP_ORPHAN_RETRIES) || (defined(HAVE_DECL_NET_TCP_ORPHAN_RETRIES) && HAVE_DECL_NET_TCP_ORPHAN_RETRIES) - XLAT(NET_TCP_ORPHAN_RETRIES), -#endif -#if defined(NET_TCP_ABORT_ON_OVERFLOW) || (defined(HAVE_DECL_NET_TCP_ABORT_ON_OVERFLOW) && HAVE_DECL_NET_TCP_ABORT_ON_OVERFLOW) - XLAT(NET_TCP_ABORT_ON_OVERFLOW), -#endif -#if defined(NET_TCP_SYNACK_RETRIES) || (defined(HAVE_DECL_NET_TCP_SYNACK_RETRIES) && HAVE_DECL_NET_TCP_SYNACK_RETRIES) - XLAT(NET_TCP_SYNACK_RETRIES), -#endif -#if defined(NET_TCP_MAX_ORPHANS) || (defined(HAVE_DECL_NET_TCP_MAX_ORPHANS) && HAVE_DECL_NET_TCP_MAX_ORPHANS) - XLAT(NET_TCP_MAX_ORPHANS), -#endif -#if defined(NET_TCP_MAX_TW_BUCKETS) || (defined(HAVE_DECL_NET_TCP_MAX_TW_BUCKETS) && HAVE_DECL_NET_TCP_MAX_TW_BUCKETS) - XLAT(NET_TCP_MAX_TW_BUCKETS), -#endif -#if defined(NET_TCP_FACK) || (defined(HAVE_DECL_NET_TCP_FACK) && HAVE_DECL_NET_TCP_FACK) - XLAT(NET_TCP_FACK), -#endif -#if defined(NET_TCP_REORDERING) || (defined(HAVE_DECL_NET_TCP_REORDERING) && HAVE_DECL_NET_TCP_REORDERING) - XLAT(NET_TCP_REORDERING), -#endif -#if defined(NET_TCP_ECN) || (defined(HAVE_DECL_NET_TCP_ECN) && HAVE_DECL_NET_TCP_ECN) - XLAT(NET_TCP_ECN), -#endif -#if defined(NET_TCP_DSACK) || (defined(HAVE_DECL_NET_TCP_DSACK) && HAVE_DECL_NET_TCP_DSACK) - XLAT(NET_TCP_DSACK), -#endif -#if defined(NET_TCP_MEM) || (defined(HAVE_DECL_NET_TCP_MEM) && HAVE_DECL_NET_TCP_MEM) - XLAT(NET_TCP_MEM), -#endif -#if defined(NET_TCP_WMEM) || (defined(HAVE_DECL_NET_TCP_WMEM) && HAVE_DECL_NET_TCP_WMEM) - XLAT(NET_TCP_WMEM), -#endif -#if defined(NET_TCP_RMEM) || (defined(HAVE_DECL_NET_TCP_RMEM) && HAVE_DECL_NET_TCP_RMEM) - XLAT(NET_TCP_RMEM), -#endif -#if defined(NET_TCP_APP_WIN) || (defined(HAVE_DECL_NET_TCP_APP_WIN) && HAVE_DECL_NET_TCP_APP_WIN) - XLAT(NET_TCP_APP_WIN), -#endif -#if defined(NET_TCP_ADV_WIN_SCALE) || (defined(HAVE_DECL_NET_TCP_ADV_WIN_SCALE) && HAVE_DECL_NET_TCP_ADV_WIN_SCALE) - XLAT(NET_TCP_ADV_WIN_SCALE), -#endif -#if defined(NET_IPV4_NONLOCAL_BIND) || (defined(HAVE_DECL_NET_IPV4_NONLOCAL_BIND) && HAVE_DECL_NET_IPV4_NONLOCAL_BIND) - XLAT(NET_IPV4_NONLOCAL_BIND), -#endif -#if defined(NET_IPV4_ICMP_RATELIMIT) || (defined(HAVE_DECL_NET_IPV4_ICMP_RATELIMIT) && HAVE_DECL_NET_IPV4_ICMP_RATELIMIT) - XLAT(NET_IPV4_ICMP_RATELIMIT), -#endif -#if defined(NET_IPV4_ICMP_RATEMASK) || (defined(HAVE_DECL_NET_IPV4_ICMP_RATEMASK) && HAVE_DECL_NET_IPV4_ICMP_RATEMASK) - XLAT(NET_IPV4_ICMP_RATEMASK), -#endif -#if defined(NET_TCP_TW_REUSE) || (defined(HAVE_DECL_NET_TCP_TW_REUSE) && HAVE_DECL_NET_TCP_TW_REUSE) - XLAT(NET_TCP_TW_REUSE), -#endif -#if defined(NET_TCP_FRTO) || (defined(HAVE_DECL_NET_TCP_FRTO) && HAVE_DECL_NET_TCP_FRTO) - XLAT(NET_TCP_FRTO), -#endif -#if defined(NET_TCP_LOW_LATENCY) || (defined(HAVE_DECL_NET_TCP_LOW_LATENCY) && HAVE_DECL_NET_TCP_LOW_LATENCY) - XLAT(NET_TCP_LOW_LATENCY), -#endif -#if defined(NET_IPV4_IPFRAG_SECRET_INTERVAL) || (defined(HAVE_DECL_NET_IPV4_IPFRAG_SECRET_INTERVAL) && HAVE_DECL_NET_IPV4_IPFRAG_SECRET_INTERVAL) - XLAT(NET_IPV4_IPFRAG_SECRET_INTERVAL), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv4 in mpers mode + +#else + +static +const struct xlat sysctl_net_ipv4[] = { + XLAT(NET_IPV4_FORWARD), + XLAT(NET_IPV4_DYNADDR), + XLAT(NET_IPV4_CONF), + XLAT(NET_IPV4_NEIGH), + XLAT(NET_IPV4_ROUTE), + XLAT(NET_IPV4_FIB_HASH), + XLAT(NET_IPV4_NETFILTER), + XLAT(NET_IPV4_TCP_TIMESTAMPS), + XLAT(NET_IPV4_TCP_WINDOW_SCALING), + XLAT(NET_IPV4_TCP_SACK), + XLAT(NET_IPV4_TCP_RETRANS_COLLAPSE), + XLAT(NET_IPV4_DEFAULT_TTL), + XLAT(NET_IPV4_AUTOCONFIG), + XLAT(NET_IPV4_NO_PMTU_DISC), + XLAT(NET_IPV4_TCP_SYN_RETRIES), + XLAT(NET_IPV4_IPFRAG_HIGH_THRESH), + XLAT(NET_IPV4_IPFRAG_LOW_THRESH), + XLAT(NET_IPV4_IPFRAG_TIME), + XLAT(NET_IPV4_TCP_MAX_KA_PROBES), + XLAT(NET_IPV4_TCP_KEEPALIVE_TIME), + XLAT(NET_IPV4_TCP_KEEPALIVE_PROBES), + XLAT(NET_IPV4_TCP_RETRIES1), + XLAT(NET_IPV4_TCP_RETRIES2), + XLAT(NET_IPV4_TCP_FIN_TIMEOUT), + XLAT(NET_IPV4_IP_MASQ_DEBUG), + XLAT(NET_TCP_SYNCOOKIES), + XLAT(NET_TCP_STDURG), + XLAT(NET_TCP_RFC1337), + XLAT(NET_TCP_SYN_TAILDROP), + XLAT(NET_TCP_MAX_SYN_BACKLOG), + XLAT(NET_IPV4_LOCAL_PORT_RANGE), + XLAT(NET_IPV4_ICMP_ECHO_IGNORE_ALL), + XLAT(NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS), + XLAT(NET_IPV4_ICMP_SOURCEQUENCH_RATE), + XLAT(NET_IPV4_ICMP_DESTUNREACH_RATE), + XLAT(NET_IPV4_ICMP_TIMEEXCEED_RATE), + XLAT(NET_IPV4_ICMP_PARAMPROB_RATE), + XLAT(NET_IPV4_ICMP_ECHOREPLY_RATE), + XLAT(NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES), + XLAT(NET_IPV4_IGMP_MAX_MEMBERSHIPS), + XLAT(NET_TCP_TW_RECYCLE), + XLAT(NET_IPV4_ALWAYS_DEFRAG), + XLAT(NET_IPV4_TCP_KEEPALIVE_INTVL), + XLAT(NET_IPV4_INET_PEER_THRESHOLD), + XLAT(NET_IPV4_INET_PEER_MINTTL), + XLAT(NET_IPV4_INET_PEER_MAXTTL), + XLAT(NET_IPV4_INET_PEER_GC_MINTIME), + XLAT(NET_IPV4_INET_PEER_GC_MAXTIME), + XLAT(NET_TCP_ORPHAN_RETRIES), + XLAT(NET_TCP_ABORT_ON_OVERFLOW), + XLAT(NET_TCP_SYNACK_RETRIES), + XLAT(NET_TCP_MAX_ORPHANS), + XLAT(NET_TCP_MAX_TW_BUCKETS), + XLAT(NET_TCP_FACK), + XLAT(NET_TCP_REORDERING), + XLAT(NET_TCP_ECN), + XLAT(NET_TCP_DSACK), + XLAT(NET_TCP_MEM), + XLAT(NET_TCP_WMEM), + XLAT(NET_TCP_RMEM), + XLAT(NET_TCP_APP_WIN), + XLAT(NET_TCP_ADV_WIN_SCALE), + XLAT(NET_IPV4_NONLOCAL_BIND), + XLAT(NET_IPV4_ICMP_RATELIMIT), + XLAT(NET_IPV4_ICMP_RATEMASK), + XLAT(NET_TCP_TW_REUSE), + XLAT(NET_TCP_FRTO), + XLAT(NET_TCP_LOW_LATENCY), + XLAT(NET_IPV4_IPFRAG_SECRET_INTERVAL), #if defined(NET_IPV4_IGMP_MAX_MSF) || (defined(HAVE_DECL_NET_IPV4_IGMP_MAX_MSF) && HAVE_DECL_NET_IPV4_IGMP_MAX_MSF) - XLAT(NET_IPV4_IGMP_MAX_MSF), + XLAT(NET_IPV4_IGMP_MAX_MSF), #endif #if defined(NET_TCP_NO_METRICS_SAVE) || (defined(HAVE_DECL_NET_TCP_NO_METRICS_SAVE) && HAVE_DECL_NET_TCP_NO_METRICS_SAVE) - XLAT(NET_TCP_NO_METRICS_SAVE), + XLAT(NET_TCP_NO_METRICS_SAVE), #endif #if defined(NET_TCP_DEFAULT_WIN_SCALE) || (defined(HAVE_DECL_NET_TCP_DEFAULT_WIN_SCALE) && HAVE_DECL_NET_TCP_DEFAULT_WIN_SCALE) - XLAT(NET_TCP_DEFAULT_WIN_SCALE), + XLAT(NET_TCP_DEFAULT_WIN_SCALE), #endif #if defined(NET_TCP_MODERATE_RCVBUF) || (defined(HAVE_DECL_NET_TCP_MODERATE_RCVBUF) && HAVE_DECL_NET_TCP_MODERATE_RCVBUF) - XLAT(NET_TCP_MODERATE_RCVBUF), + XLAT(NET_TCP_MODERATE_RCVBUF), #endif #if defined(NET_TCP_TSO_WIN_DIVISOR) || (defined(HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR) && HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR) - XLAT(NET_TCP_TSO_WIN_DIVISOR), + XLAT(NET_TCP_TSO_WIN_DIVISOR), #endif #if defined(NET_TCP_BIC_BETA) || (defined(HAVE_DECL_NET_TCP_BIC_BETA) && HAVE_DECL_NET_TCP_BIC_BETA) - XLAT(NET_TCP_BIC_BETA), + XLAT(NET_TCP_BIC_BETA), #endif #if defined(NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR) || (defined(HAVE_DECL_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR) && HAVE_DECL_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR) - XLAT(NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR), + XLAT(NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR), #endif #if defined(NET_TCP_CONG_CONTROL) || (defined(HAVE_DECL_NET_TCP_CONG_CONTROL) && HAVE_DECL_NET_TCP_CONG_CONTROL) - XLAT(NET_TCP_CONG_CONTROL), + XLAT(NET_TCP_CONG_CONTROL), #endif #if defined(NET_TCP_ABC) || (defined(HAVE_DECL_NET_TCP_ABC) && HAVE_DECL_NET_TCP_ABC) - XLAT(NET_TCP_ABC), + XLAT(NET_TCP_ABC), #endif #if defined(NET_IPV4_IPFRAG_MAX_DIST) || (defined(HAVE_DECL_NET_IPV4_IPFRAG_MAX_DIST) && HAVE_DECL_NET_IPV4_IPFRAG_MAX_DIST) - XLAT(NET_IPV4_IPFRAG_MAX_DIST), + XLAT(NET_IPV4_IPFRAG_MAX_DIST), #endif #if defined(NET_TCP_MTU_PROBING) || (defined(HAVE_DECL_NET_TCP_MTU_PROBING) && HAVE_DECL_NET_TCP_MTU_PROBING) - XLAT(NET_TCP_MTU_PROBING), + XLAT(NET_TCP_MTU_PROBING), #endif #if defined(NET_TCP_BASE_MSS) || (defined(HAVE_DECL_NET_TCP_BASE_MSS) && HAVE_DECL_NET_TCP_BASE_MSS) - XLAT(NET_TCP_BASE_MSS), + XLAT(NET_TCP_BASE_MSS), #endif #if defined(NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS) || (defined(HAVE_DECL_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS) && HAVE_DECL_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS) - XLAT(NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS), + XLAT(NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS), #endif #if defined(NET_TCP_DMA_COPYBREAK) || (defined(HAVE_DECL_NET_TCP_DMA_COPYBREAK) && HAVE_DECL_NET_TCP_DMA_COPYBREAK) - XLAT(NET_TCP_DMA_COPYBREAK), + XLAT(NET_TCP_DMA_COPYBREAK), #endif #if defined(NET_TCP_SLOW_START_AFTER_IDLE) || (defined(HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE) && HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE) - XLAT(NET_TCP_SLOW_START_AFTER_IDLE), + XLAT(NET_TCP_SLOW_START_AFTER_IDLE), #endif #if defined(NET_CIPSOV4_CACHE_ENABLE) || (defined(HAVE_DECL_NET_CIPSOV4_CACHE_ENABLE) && HAVE_DECL_NET_CIPSOV4_CACHE_ENABLE) - XLAT(NET_CIPSOV4_CACHE_ENABLE), + XLAT(NET_CIPSOV4_CACHE_ENABLE), #endif #if defined(NET_CIPSOV4_CACHE_BUCKET_SIZE) || (defined(HAVE_DECL_NET_CIPSOV4_CACHE_BUCKET_SIZE) && HAVE_DECL_NET_CIPSOV4_CACHE_BUCKET_SIZE) - XLAT(NET_CIPSOV4_CACHE_BUCKET_SIZE), + XLAT(NET_CIPSOV4_CACHE_BUCKET_SIZE), #endif #if defined(NET_CIPSOV4_RBM_OPTFMT) || (defined(HAVE_DECL_NET_CIPSOV4_RBM_OPTFMT) && HAVE_DECL_NET_CIPSOV4_RBM_OPTFMT) - XLAT(NET_CIPSOV4_RBM_OPTFMT), + XLAT(NET_CIPSOV4_RBM_OPTFMT), #endif #if defined(NET_CIPSOV4_RBM_STRICTVALID) || (defined(HAVE_DECL_NET_CIPSOV4_RBM_STRICTVALID) && HAVE_DECL_NET_CIPSOV4_RBM_STRICTVALID) - XLAT(NET_CIPSOV4_RBM_STRICTVALID), + XLAT(NET_CIPSOV4_RBM_STRICTVALID), #endif #if defined(NET_TCP_AVAIL_CONG_CONTROL) || (defined(HAVE_DECL_NET_TCP_AVAIL_CONG_CONTROL) && HAVE_DECL_NET_TCP_AVAIL_CONG_CONTROL) - XLAT(NET_TCP_AVAIL_CONG_CONTROL), + XLAT(NET_TCP_AVAIL_CONG_CONTROL), #endif #if defined(NET_TCP_ALLOWED_CONG_CONTROL) || (defined(HAVE_DECL_NET_TCP_ALLOWED_CONG_CONTROL) && HAVE_DECL_NET_TCP_ALLOWED_CONG_CONTROL) - XLAT(NET_TCP_ALLOWED_CONG_CONTROL), + XLAT(NET_TCP_ALLOWED_CONG_CONTROL), #endif #if defined(NET_TCP_MAX_SSTHRESH) || (defined(HAVE_DECL_NET_TCP_MAX_SSTHRESH) && HAVE_DECL_NET_TCP_MAX_SSTHRESH) - XLAT(NET_TCP_MAX_SSTHRESH), + XLAT(NET_TCP_MAX_SSTHRESH), #endif #if defined(NET_TCP_FRTO_RESPONSE) || (defined(HAVE_DECL_NET_TCP_FRTO_RESPONSE) && HAVE_DECL_NET_TCP_FRTO_RESPONSE) - XLAT(NET_TCP_FRTO_RESPONSE), + XLAT(NET_TCP_FRTO_RESPONSE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net_ipv4.in b/xlat/sysctl_net_ipv4.in index d700cc9b..8f452e85 100644 --- a/xlat/sysctl_net_ipv4.in +++ b/xlat/sysctl_net_ipv4.in @@ -1,3 +1,4 @@ +#unconditional NET_IPV4_FORWARD NET_IPV4_DYNADDR NET_IPV4_CONF @@ -67,6 +68,7 @@ NET_TCP_TW_REUSE NET_TCP_FRTO NET_TCP_LOW_LATENCY NET_IPV4_IPFRAG_SECRET_INTERVAL +#conditional NET_IPV4_IGMP_MAX_MSF NET_TCP_NO_METRICS_SAVE NET_TCP_DEFAULT_WIN_SCALE diff --git a/xlat/sysctl_net_ipv4_conf.h b/xlat/sysctl_net_ipv4_conf.h index dde6230e..c9cd4dcb 100644 --- a/xlat/sysctl_net_ipv4_conf.h +++ b/xlat/sysctl_net_ipv4_conf.h @@ -1,71 +1,48 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv4_conf.in; do not edit. */ -static const struct xlat sysctl_net_ipv4_conf[] = { -#if defined(NET_IPV4_CONF_FORWARDING) || (defined(HAVE_DECL_NET_IPV4_CONF_FORWARDING) && HAVE_DECL_NET_IPV4_CONF_FORWARDING) - XLAT(NET_IPV4_CONF_FORWARDING), -#endif -#if defined(NET_IPV4_CONF_MC_FORWARDING) || (defined(HAVE_DECL_NET_IPV4_CONF_MC_FORWARDING) && HAVE_DECL_NET_IPV4_CONF_MC_FORWARDING) - XLAT(NET_IPV4_CONF_MC_FORWARDING), -#endif -#if defined(NET_IPV4_CONF_PROXY_ARP) || (defined(HAVE_DECL_NET_IPV4_CONF_PROXY_ARP) && HAVE_DECL_NET_IPV4_CONF_PROXY_ARP) - XLAT(NET_IPV4_CONF_PROXY_ARP), -#endif -#if defined(NET_IPV4_CONF_ACCEPT_REDIRECTS) || (defined(HAVE_DECL_NET_IPV4_CONF_ACCEPT_REDIRECTS) && HAVE_DECL_NET_IPV4_CONF_ACCEPT_REDIRECTS) - XLAT(NET_IPV4_CONF_ACCEPT_REDIRECTS), -#endif -#if defined(NET_IPV4_CONF_SECURE_REDIRECTS) || (defined(HAVE_DECL_NET_IPV4_CONF_SECURE_REDIRECTS) && HAVE_DECL_NET_IPV4_CONF_SECURE_REDIRECTS) - XLAT(NET_IPV4_CONF_SECURE_REDIRECTS), -#endif -#if defined(NET_IPV4_CONF_SEND_REDIRECTS) || (defined(HAVE_DECL_NET_IPV4_CONF_SEND_REDIRECTS) && HAVE_DECL_NET_IPV4_CONF_SEND_REDIRECTS) - XLAT(NET_IPV4_CONF_SEND_REDIRECTS), -#endif -#if defined(NET_IPV4_CONF_SHARED_MEDIA) || (defined(HAVE_DECL_NET_IPV4_CONF_SHARED_MEDIA) && HAVE_DECL_NET_IPV4_CONF_SHARED_MEDIA) - XLAT(NET_IPV4_CONF_SHARED_MEDIA), -#endif -#if defined(NET_IPV4_CONF_RP_FILTER) || (defined(HAVE_DECL_NET_IPV4_CONF_RP_FILTER) && HAVE_DECL_NET_IPV4_CONF_RP_FILTER) - XLAT(NET_IPV4_CONF_RP_FILTER), -#endif -#if defined(NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE) || (defined(HAVE_DECL_NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE) && HAVE_DECL_NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE) - XLAT(NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE), -#endif -#if defined(NET_IPV4_CONF_BOOTP_RELAY) || (defined(HAVE_DECL_NET_IPV4_CONF_BOOTP_RELAY) && HAVE_DECL_NET_IPV4_CONF_BOOTP_RELAY) - XLAT(NET_IPV4_CONF_BOOTP_RELAY), -#endif -#if defined(NET_IPV4_CONF_LOG_MARTIANS) || (defined(HAVE_DECL_NET_IPV4_CONF_LOG_MARTIANS) && HAVE_DECL_NET_IPV4_CONF_LOG_MARTIANS) - XLAT(NET_IPV4_CONF_LOG_MARTIANS), -#endif -#if defined(NET_IPV4_CONF_TAG) || (defined(HAVE_DECL_NET_IPV4_CONF_TAG) && HAVE_DECL_NET_IPV4_CONF_TAG) - XLAT(NET_IPV4_CONF_TAG), -#endif -#if defined(NET_IPV4_CONF_ARPFILTER) || (defined(HAVE_DECL_NET_IPV4_CONF_ARPFILTER) && HAVE_DECL_NET_IPV4_CONF_ARPFILTER) - XLAT(NET_IPV4_CONF_ARPFILTER), -#endif -#if defined(NET_IPV4_CONF_MEDIUM_ID) || (defined(HAVE_DECL_NET_IPV4_CONF_MEDIUM_ID) && HAVE_DECL_NET_IPV4_CONF_MEDIUM_ID) - XLAT(NET_IPV4_CONF_MEDIUM_ID), -#endif -#if defined(NET_IPV4_CONF_NOXFRM) || (defined(HAVE_DECL_NET_IPV4_CONF_NOXFRM) && HAVE_DECL_NET_IPV4_CONF_NOXFRM) - XLAT(NET_IPV4_CONF_NOXFRM), -#endif -#if defined(NET_IPV4_CONF_NOPOLICY) || (defined(HAVE_DECL_NET_IPV4_CONF_NOPOLICY) && HAVE_DECL_NET_IPV4_CONF_NOPOLICY) - XLAT(NET_IPV4_CONF_NOPOLICY), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv4_conf in mpers mode + +#else + +static +const struct xlat sysctl_net_ipv4_conf[] = { + XLAT(NET_IPV4_CONF_FORWARDING), + XLAT(NET_IPV4_CONF_MC_FORWARDING), + XLAT(NET_IPV4_CONF_PROXY_ARP), + XLAT(NET_IPV4_CONF_ACCEPT_REDIRECTS), + XLAT(NET_IPV4_CONF_SECURE_REDIRECTS), + XLAT(NET_IPV4_CONF_SEND_REDIRECTS), + XLAT(NET_IPV4_CONF_SHARED_MEDIA), + XLAT(NET_IPV4_CONF_RP_FILTER), + XLAT(NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE), + XLAT(NET_IPV4_CONF_BOOTP_RELAY), + XLAT(NET_IPV4_CONF_LOG_MARTIANS), + XLAT(NET_IPV4_CONF_TAG), + XLAT(NET_IPV4_CONF_ARPFILTER), + XLAT(NET_IPV4_CONF_MEDIUM_ID), + XLAT(NET_IPV4_CONF_NOXFRM), + XLAT(NET_IPV4_CONF_NOPOLICY), #if defined(NET_IPV4_CONF_FORCE_IGMP_VERSION) || (defined(HAVE_DECL_NET_IPV4_CONF_FORCE_IGMP_VERSION) && HAVE_DECL_NET_IPV4_CONF_FORCE_IGMP_VERSION) - XLAT(NET_IPV4_CONF_FORCE_IGMP_VERSION), + XLAT(NET_IPV4_CONF_FORCE_IGMP_VERSION), #endif #if defined(NET_IPV4_CONF_ARP_ANNOUNCE) || (defined(HAVE_DECL_NET_IPV4_CONF_ARP_ANNOUNCE) && HAVE_DECL_NET_IPV4_CONF_ARP_ANNOUNCE) - XLAT(NET_IPV4_CONF_ARP_ANNOUNCE), + XLAT(NET_IPV4_CONF_ARP_ANNOUNCE), #endif #if defined(NET_IPV4_CONF_ARP_IGNORE) || (defined(HAVE_DECL_NET_IPV4_CONF_ARP_IGNORE) && HAVE_DECL_NET_IPV4_CONF_ARP_IGNORE) - XLAT(NET_IPV4_CONF_ARP_IGNORE), + XLAT(NET_IPV4_CONF_ARP_IGNORE), #endif #if defined(NET_IPV4_CONF_PROMOTE_SECONDARIES) || (defined(HAVE_DECL_NET_IPV4_CONF_PROMOTE_SECONDARIES) && HAVE_DECL_NET_IPV4_CONF_PROMOTE_SECONDARIES) - XLAT(NET_IPV4_CONF_PROMOTE_SECONDARIES), + XLAT(NET_IPV4_CONF_PROMOTE_SECONDARIES), #endif #if defined(NET_IPV4_CONF_ARP_ACCEPT) || (defined(HAVE_DECL_NET_IPV4_CONF_ARP_ACCEPT) && HAVE_DECL_NET_IPV4_CONF_ARP_ACCEPT) - XLAT(NET_IPV4_CONF_ARP_ACCEPT), + XLAT(NET_IPV4_CONF_ARP_ACCEPT), #endif #if defined(NET_IPV4_CONF_ARP_NOTIFY) || (defined(HAVE_DECL_NET_IPV4_CONF_ARP_NOTIFY) && HAVE_DECL_NET_IPV4_CONF_ARP_NOTIFY) - XLAT(NET_IPV4_CONF_ARP_NOTIFY), + XLAT(NET_IPV4_CONF_ARP_NOTIFY), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net_ipv4_conf.in b/xlat/sysctl_net_ipv4_conf.in index 03ce5279..be94bd22 100644 --- a/xlat/sysctl_net_ipv4_conf.in +++ b/xlat/sysctl_net_ipv4_conf.in @@ -1,3 +1,4 @@ +#unconditional NET_IPV4_CONF_FORWARDING NET_IPV4_CONF_MC_FORWARDING NET_IPV4_CONF_PROXY_ARP @@ -14,6 +15,7 @@ NET_IPV4_CONF_ARPFILTER NET_IPV4_CONF_MEDIUM_ID NET_IPV4_CONF_NOXFRM NET_IPV4_CONF_NOPOLICY +#conditional NET_IPV4_CONF_FORCE_IGMP_VERSION NET_IPV4_CONF_ARP_ANNOUNCE NET_IPV4_CONF_ARP_IGNORE diff --git a/xlat/sysctl_net_ipv4_route.h b/xlat/sysctl_net_ipv4_route.h index 63820d6a..91983e40 100644 --- a/xlat/sysctl_net_ipv4_route.h +++ b/xlat/sysctl_net_ipv4_route.h @@ -1,62 +1,35 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv4_route.in; do not edit. */ -static const struct xlat sysctl_net_ipv4_route[] = { -#if defined(NET_IPV4_ROUTE_FLUSH) || (defined(HAVE_DECL_NET_IPV4_ROUTE_FLUSH) && HAVE_DECL_NET_IPV4_ROUTE_FLUSH) - XLAT(NET_IPV4_ROUTE_FLUSH), -#endif -#if defined(NET_IPV4_ROUTE_MIN_DELAY) || (defined(HAVE_DECL_NET_IPV4_ROUTE_MIN_DELAY) && HAVE_DECL_NET_IPV4_ROUTE_MIN_DELAY) - XLAT(NET_IPV4_ROUTE_MIN_DELAY), -#endif -#if defined(NET_IPV4_ROUTE_MAX_DELAY) || (defined(HAVE_DECL_NET_IPV4_ROUTE_MAX_DELAY) && HAVE_DECL_NET_IPV4_ROUTE_MAX_DELAY) - XLAT(NET_IPV4_ROUTE_MAX_DELAY), -#endif -#if defined(NET_IPV4_ROUTE_GC_THRESH) || (defined(HAVE_DECL_NET_IPV4_ROUTE_GC_THRESH) && HAVE_DECL_NET_IPV4_ROUTE_GC_THRESH) - XLAT(NET_IPV4_ROUTE_GC_THRESH), -#endif -#if defined(NET_IPV4_ROUTE_MAX_SIZE) || (defined(HAVE_DECL_NET_IPV4_ROUTE_MAX_SIZE) && HAVE_DECL_NET_IPV4_ROUTE_MAX_SIZE) - XLAT(NET_IPV4_ROUTE_MAX_SIZE), -#endif -#if defined(NET_IPV4_ROUTE_GC_MIN_INTERVAL) || (defined(HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL) && HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL) - XLAT(NET_IPV4_ROUTE_GC_MIN_INTERVAL), -#endif -#if defined(NET_IPV4_ROUTE_GC_TIMEOUT) || (defined(HAVE_DECL_NET_IPV4_ROUTE_GC_TIMEOUT) && HAVE_DECL_NET_IPV4_ROUTE_GC_TIMEOUT) - XLAT(NET_IPV4_ROUTE_GC_TIMEOUT), -#endif -#if defined(NET_IPV4_ROUTE_GC_INTERVAL) || (defined(HAVE_DECL_NET_IPV4_ROUTE_GC_INTERVAL) && HAVE_DECL_NET_IPV4_ROUTE_GC_INTERVAL) - XLAT(NET_IPV4_ROUTE_GC_INTERVAL), -#endif -#if defined(NET_IPV4_ROUTE_REDIRECT_LOAD) || (defined(HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_LOAD) && HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_LOAD) - XLAT(NET_IPV4_ROUTE_REDIRECT_LOAD), -#endif -#if defined(NET_IPV4_ROUTE_REDIRECT_NUMBER) || (defined(HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_NUMBER) && HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_NUMBER) - XLAT(NET_IPV4_ROUTE_REDIRECT_NUMBER), -#endif -#if defined(NET_IPV4_ROUTE_REDIRECT_SILENCE) || (defined(HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_SILENCE) && HAVE_DECL_NET_IPV4_ROUTE_REDIRECT_SILENCE) - XLAT(NET_IPV4_ROUTE_REDIRECT_SILENCE), -#endif -#if defined(NET_IPV4_ROUTE_ERROR_COST) || (defined(HAVE_DECL_NET_IPV4_ROUTE_ERROR_COST) && HAVE_DECL_NET_IPV4_ROUTE_ERROR_COST) - XLAT(NET_IPV4_ROUTE_ERROR_COST), -#endif -#if defined(NET_IPV4_ROUTE_ERROR_BURST) || (defined(HAVE_DECL_NET_IPV4_ROUTE_ERROR_BURST) && HAVE_DECL_NET_IPV4_ROUTE_ERROR_BURST) - XLAT(NET_IPV4_ROUTE_ERROR_BURST), -#endif -#if defined(NET_IPV4_ROUTE_GC_ELASTICITY) || (defined(HAVE_DECL_NET_IPV4_ROUTE_GC_ELASTICITY) && HAVE_DECL_NET_IPV4_ROUTE_GC_ELASTICITY) - XLAT(NET_IPV4_ROUTE_GC_ELASTICITY), -#endif -#if defined(NET_IPV4_ROUTE_MTU_EXPIRES) || (defined(HAVE_DECL_NET_IPV4_ROUTE_MTU_EXPIRES) && HAVE_DECL_NET_IPV4_ROUTE_MTU_EXPIRES) - XLAT(NET_IPV4_ROUTE_MTU_EXPIRES), -#endif -#if defined(NET_IPV4_ROUTE_MIN_PMTU) || (defined(HAVE_DECL_NET_IPV4_ROUTE_MIN_PMTU) && HAVE_DECL_NET_IPV4_ROUTE_MIN_PMTU) - XLAT(NET_IPV4_ROUTE_MIN_PMTU), -#endif -#if defined(NET_IPV4_ROUTE_MIN_ADVMSS) || (defined(HAVE_DECL_NET_IPV4_ROUTE_MIN_ADVMSS) && HAVE_DECL_NET_IPV4_ROUTE_MIN_ADVMSS) - XLAT(NET_IPV4_ROUTE_MIN_ADVMSS), -#endif -#if defined(NET_IPV4_ROUTE_SECRET_INTERVAL) || (defined(HAVE_DECL_NET_IPV4_ROUTE_SECRET_INTERVAL) && HAVE_DECL_NET_IPV4_ROUTE_SECRET_INTERVAL) - XLAT(NET_IPV4_ROUTE_SECRET_INTERVAL), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv4_route in mpers mode + +#else + +static +const struct xlat sysctl_net_ipv4_route[] = { + XLAT(NET_IPV4_ROUTE_FLUSH), + XLAT(NET_IPV4_ROUTE_MIN_DELAY), + XLAT(NET_IPV4_ROUTE_MAX_DELAY), + XLAT(NET_IPV4_ROUTE_GC_THRESH), + XLAT(NET_IPV4_ROUTE_MAX_SIZE), + XLAT(NET_IPV4_ROUTE_GC_MIN_INTERVAL), + XLAT(NET_IPV4_ROUTE_GC_TIMEOUT), + XLAT(NET_IPV4_ROUTE_GC_INTERVAL), + XLAT(NET_IPV4_ROUTE_REDIRECT_LOAD), + XLAT(NET_IPV4_ROUTE_REDIRECT_NUMBER), + XLAT(NET_IPV4_ROUTE_REDIRECT_SILENCE), + XLAT(NET_IPV4_ROUTE_ERROR_COST), + XLAT(NET_IPV4_ROUTE_ERROR_BURST), + XLAT(NET_IPV4_ROUTE_GC_ELASTICITY), + XLAT(NET_IPV4_ROUTE_MTU_EXPIRES), + XLAT(NET_IPV4_ROUTE_MIN_PMTU), + XLAT(NET_IPV4_ROUTE_MIN_ADVMSS), + XLAT(NET_IPV4_ROUTE_SECRET_INTERVAL), #if defined(NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS) || (defined(HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS) && HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS) - XLAT(NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS), + XLAT(NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net_ipv4_route.in b/xlat/sysctl_net_ipv4_route.in index fb06e9cb..a77cf417 100644 --- a/xlat/sysctl_net_ipv4_route.in +++ b/xlat/sysctl_net_ipv4_route.in @@ -1,3 +1,4 @@ +#unconditional NET_IPV4_ROUTE_FLUSH NET_IPV4_ROUTE_MIN_DELAY NET_IPV4_ROUTE_MAX_DELAY @@ -16,4 +17,5 @@ NET_IPV4_ROUTE_MTU_EXPIRES NET_IPV4_ROUTE_MIN_PMTU NET_IPV4_ROUTE_MIN_ADVMSS NET_IPV4_ROUTE_SECRET_INTERVAL +#conditional NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS diff --git a/xlat/sysctl_net_ipv6.h b/xlat/sysctl_net_ipv6.h index 514e2dde..c92a16cb 100644 --- a/xlat/sysctl_net_ipv6.h +++ b/xlat/sysctl_net_ipv6.h @@ -1,35 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv6.in; do not edit. */ -static const struct xlat sysctl_net_ipv6[] = { -#if defined(NET_IPV6_CONF) || (defined(HAVE_DECL_NET_IPV6_CONF) && HAVE_DECL_NET_IPV6_CONF) - XLAT(NET_IPV6_CONF), -#endif -#if defined(NET_IPV6_NEIGH) || (defined(HAVE_DECL_NET_IPV6_NEIGH) && HAVE_DECL_NET_IPV6_NEIGH) - XLAT(NET_IPV6_NEIGH), -#endif -#if defined(NET_IPV6_ROUTE) || (defined(HAVE_DECL_NET_IPV6_ROUTE) && HAVE_DECL_NET_IPV6_ROUTE) - XLAT(NET_IPV6_ROUTE), -#endif -#if defined(NET_IPV6_ICMP) || (defined(HAVE_DECL_NET_IPV6_ICMP) && HAVE_DECL_NET_IPV6_ICMP) - XLAT(NET_IPV6_ICMP), -#endif -#if defined(NET_IPV6_BINDV6ONLY) || (defined(HAVE_DECL_NET_IPV6_BINDV6ONLY) && HAVE_DECL_NET_IPV6_BINDV6ONLY) - XLAT(NET_IPV6_BINDV6ONLY), -#endif -#if defined(NET_IPV6_IP6FRAG_HIGH_THRESH) || (defined(HAVE_DECL_NET_IPV6_IP6FRAG_HIGH_THRESH) && HAVE_DECL_NET_IPV6_IP6FRAG_HIGH_THRESH) - XLAT(NET_IPV6_IP6FRAG_HIGH_THRESH), -#endif -#if defined(NET_IPV6_IP6FRAG_LOW_THRESH) || (defined(HAVE_DECL_NET_IPV6_IP6FRAG_LOW_THRESH) && HAVE_DECL_NET_IPV6_IP6FRAG_LOW_THRESH) - XLAT(NET_IPV6_IP6FRAG_LOW_THRESH), -#endif -#if defined(NET_IPV6_IP6FRAG_TIME) || (defined(HAVE_DECL_NET_IPV6_IP6FRAG_TIME) && HAVE_DECL_NET_IPV6_IP6FRAG_TIME) - XLAT(NET_IPV6_IP6FRAG_TIME), -#endif -#if defined(NET_IPV6_IP6FRAG_SECRET_INTERVAL) || (defined(HAVE_DECL_NET_IPV6_IP6FRAG_SECRET_INTERVAL) && HAVE_DECL_NET_IPV6_IP6FRAG_SECRET_INTERVAL) - XLAT(NET_IPV6_IP6FRAG_SECRET_INTERVAL), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv6 in mpers mode + +#else + +static +const struct xlat sysctl_net_ipv6[] = { + XLAT(NET_IPV6_CONF), + XLAT(NET_IPV6_NEIGH), + XLAT(NET_IPV6_ROUTE), + XLAT(NET_IPV6_ICMP), + XLAT(NET_IPV6_BINDV6ONLY), + XLAT(NET_IPV6_IP6FRAG_HIGH_THRESH), + XLAT(NET_IPV6_IP6FRAG_LOW_THRESH), + XLAT(NET_IPV6_IP6FRAG_TIME), + XLAT(NET_IPV6_IP6FRAG_SECRET_INTERVAL), #if defined(NET_IPV6_MLD_MAX_MSF) || (defined(HAVE_DECL_NET_IPV6_MLD_MAX_MSF) && HAVE_DECL_NET_IPV6_MLD_MAX_MSF) - XLAT(NET_IPV6_MLD_MAX_MSF), + XLAT(NET_IPV6_MLD_MAX_MSF), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net_ipv6.in b/xlat/sysctl_net_ipv6.in index 75e64ec1..711dbb52 100644 --- a/xlat/sysctl_net_ipv6.in +++ b/xlat/sysctl_net_ipv6.in @@ -1,3 +1,4 @@ +#unconditional NET_IPV6_CONF NET_IPV6_NEIGH NET_IPV6_ROUTE @@ -7,4 +8,5 @@ NET_IPV6_IP6FRAG_HIGH_THRESH NET_IPV6_IP6FRAG_LOW_THRESH NET_IPV6_IP6FRAG_TIME NET_IPV6_IP6FRAG_SECRET_INTERVAL +#conditional NET_IPV6_MLD_MAX_MSF diff --git a/xlat/sysctl_net_ipv6_route.h b/xlat/sysctl_net_ipv6_route.h index 1f363a51..cc976ff3 100644 --- a/xlat/sysctl_net_ipv6_route.h +++ b/xlat/sysctl_net_ipv6_route.h @@ -1,35 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv6_route.in; do not edit. */ -static const struct xlat sysctl_net_ipv6_route[] = { -#if defined(NET_IPV6_ROUTE_FLUSH) || (defined(HAVE_DECL_NET_IPV6_ROUTE_FLUSH) && HAVE_DECL_NET_IPV6_ROUTE_FLUSH) - XLAT(NET_IPV6_ROUTE_FLUSH), -#endif -#if defined(NET_IPV6_ROUTE_GC_THRESH) || (defined(HAVE_DECL_NET_IPV6_ROUTE_GC_THRESH) && HAVE_DECL_NET_IPV6_ROUTE_GC_THRESH) - XLAT(NET_IPV6_ROUTE_GC_THRESH), -#endif -#if defined(NET_IPV6_ROUTE_MAX_SIZE) || (defined(HAVE_DECL_NET_IPV6_ROUTE_MAX_SIZE) && HAVE_DECL_NET_IPV6_ROUTE_MAX_SIZE) - XLAT(NET_IPV6_ROUTE_MAX_SIZE), -#endif -#if defined(NET_IPV6_ROUTE_GC_MIN_INTERVAL) || (defined(HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL) && HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL) - XLAT(NET_IPV6_ROUTE_GC_MIN_INTERVAL), -#endif -#if defined(NET_IPV6_ROUTE_GC_TIMEOUT) || (defined(HAVE_DECL_NET_IPV6_ROUTE_GC_TIMEOUT) && HAVE_DECL_NET_IPV6_ROUTE_GC_TIMEOUT) - XLAT(NET_IPV6_ROUTE_GC_TIMEOUT), -#endif -#if defined(NET_IPV6_ROUTE_GC_INTERVAL) || (defined(HAVE_DECL_NET_IPV6_ROUTE_GC_INTERVAL) && HAVE_DECL_NET_IPV6_ROUTE_GC_INTERVAL) - XLAT(NET_IPV6_ROUTE_GC_INTERVAL), -#endif -#if defined(NET_IPV6_ROUTE_GC_ELASTICITY) || (defined(HAVE_DECL_NET_IPV6_ROUTE_GC_ELASTICITY) && HAVE_DECL_NET_IPV6_ROUTE_GC_ELASTICITY) - XLAT(NET_IPV6_ROUTE_GC_ELASTICITY), -#endif -#if defined(NET_IPV6_ROUTE_MTU_EXPIRES) || (defined(HAVE_DECL_NET_IPV6_ROUTE_MTU_EXPIRES) && HAVE_DECL_NET_IPV6_ROUTE_MTU_EXPIRES) - XLAT(NET_IPV6_ROUTE_MTU_EXPIRES), -#endif -#if defined(NET_IPV6_ROUTE_MIN_ADVMSS) || (defined(HAVE_DECL_NET_IPV6_ROUTE_MIN_ADVMSS) && HAVE_DECL_NET_IPV6_ROUTE_MIN_ADVMSS) - XLAT(NET_IPV6_ROUTE_MIN_ADVMSS), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv6_route in mpers mode + +#else + +static +const struct xlat sysctl_net_ipv6_route[] = { + XLAT(NET_IPV6_ROUTE_FLUSH), + XLAT(NET_IPV6_ROUTE_GC_THRESH), + XLAT(NET_IPV6_ROUTE_MAX_SIZE), + XLAT(NET_IPV6_ROUTE_GC_MIN_INTERVAL), + XLAT(NET_IPV6_ROUTE_GC_TIMEOUT), + XLAT(NET_IPV6_ROUTE_GC_INTERVAL), + XLAT(NET_IPV6_ROUTE_GC_ELASTICITY), + XLAT(NET_IPV6_ROUTE_MTU_EXPIRES), + XLAT(NET_IPV6_ROUTE_MIN_ADVMSS), #if defined(NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS) || (defined(HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS) && HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS) - XLAT(NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS), + XLAT(NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net_ipv6_route.in b/xlat/sysctl_net_ipv6_route.in index 6395edd6..53e3800c 100644 --- a/xlat/sysctl_net_ipv6_route.in +++ b/xlat/sysctl_net_ipv6_route.in @@ -1,3 +1,4 @@ +#unconditional NET_IPV6_ROUTE_FLUSH NET_IPV6_ROUTE_GC_THRESH NET_IPV6_ROUTE_MAX_SIZE @@ -7,4 +8,5 @@ NET_IPV6_ROUTE_GC_INTERVAL NET_IPV6_ROUTE_GC_ELASTICITY NET_IPV6_ROUTE_MTU_EXPIRES NET_IPV6_ROUTE_MIN_ADVMSS +#conditional NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS diff --git a/xlat/sysctl_net_unix.h b/xlat/sysctl_net_unix.h index cd660e79..c940dab6 100644 --- a/xlat/sysctl_net_unix.h +++ b/xlat/sysctl_net_unix.h @@ -1,14 +1,17 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_unix.in; do not edit. */ -static const struct xlat sysctl_net_unix[] = { -#if defined(NET_UNIX_DESTROY_DELAY) || (defined(HAVE_DECL_NET_UNIX_DESTROY_DELAY) && HAVE_DECL_NET_UNIX_DESTROY_DELAY) - XLAT(NET_UNIX_DESTROY_DELAY), -#endif -#if defined(NET_UNIX_DELETE_DELAY) || (defined(HAVE_DECL_NET_UNIX_DELETE_DELAY) && HAVE_DECL_NET_UNIX_DELETE_DELAY) - XLAT(NET_UNIX_DELETE_DELAY), -#endif -#if defined(NET_UNIX_MAX_DGRAM_QLEN) || (defined(HAVE_DECL_NET_UNIX_MAX_DGRAM_QLEN) && HAVE_DECL_NET_UNIX_MAX_DGRAM_QLEN) - XLAT(NET_UNIX_MAX_DGRAM_QLEN), -#endif - XLAT_END +#ifdef IN_MPERS + +# error static const struct xlat sysctl_net_unix in mpers mode + +#else + +static +const struct xlat sysctl_net_unix[] = { + XLAT(NET_UNIX_DESTROY_DELAY), + XLAT(NET_UNIX_DELETE_DELAY), + XLAT(NET_UNIX_MAX_DGRAM_QLEN), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_net_unix.in b/xlat/sysctl_net_unix.in index a442feea..7440a928 100644 --- a/xlat/sysctl_net_unix.in +++ b/xlat/sysctl_net_unix.in @@ -1,3 +1,4 @@ +#unconditional NET_UNIX_DESTROY_DELAY NET_UNIX_DELETE_DELAY NET_UNIX_MAX_DGRAM_QLEN diff --git a/xlat/sysctl_root.h b/xlat/sysctl_root.h index 71d90c3b..0d4b0398 100644 --- a/xlat/sysctl_root.h +++ b/xlat/sysctl_root.h @@ -1,50 +1,41 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_root.in; do not edit. */ -static const struct xlat sysctl_root[] = { -#if defined(CTL_KERN) || (defined(HAVE_DECL_CTL_KERN) && HAVE_DECL_CTL_KERN) - XLAT(CTL_KERN), -#endif -#if defined(CTL_VM) || (defined(HAVE_DECL_CTL_VM) && HAVE_DECL_CTL_VM) - XLAT(CTL_VM), -#endif -#if defined(CTL_NET) || (defined(HAVE_DECL_CTL_NET) && HAVE_DECL_CTL_NET) - XLAT(CTL_NET), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_root in mpers mode + +#else + +static +const struct xlat sysctl_root[] = { + XLAT(CTL_KERN), + XLAT(CTL_VM), + XLAT(CTL_NET), + XLAT(CTL_FS), + XLAT(CTL_DEBUG), + XLAT(CTL_DEV), + XLAT(CTL_BUS), + XLAT(CTL_ABI), + XLAT(CTL_CPU), #if defined(CTL_PROC) || (defined(HAVE_DECL_CTL_PROC) && HAVE_DECL_CTL_PROC) - XLAT(CTL_PROC), -#endif -#if defined(CTL_FS) || (defined(HAVE_DECL_CTL_FS) && HAVE_DECL_CTL_FS) - XLAT(CTL_FS), -#endif -#if defined(CTL_DEBUG) || (defined(HAVE_DECL_CTL_DEBUG) && HAVE_DECL_CTL_DEBUG) - XLAT(CTL_DEBUG), -#endif -#if defined(CTL_DEV) || (defined(HAVE_DECL_CTL_DEV) && HAVE_DECL_CTL_DEV) - XLAT(CTL_DEV), -#endif -#if defined(CTL_BUS) || (defined(HAVE_DECL_CTL_BUS) && HAVE_DECL_CTL_BUS) - XLAT(CTL_BUS), -#endif -#if defined(CTL_ABI) || (defined(HAVE_DECL_CTL_ABI) && HAVE_DECL_CTL_ABI) - XLAT(CTL_ABI), -#endif -#if defined(CTL_CPU) || (defined(HAVE_DECL_CTL_CPU) && HAVE_DECL_CTL_CPU) - XLAT(CTL_CPU), + XLAT(CTL_PROC), #endif #if defined(CTL_ARLAN) || (defined(HAVE_DECL_CTL_ARLAN) && HAVE_DECL_CTL_ARLAN) - XLAT(CTL_ARLAN), + XLAT(CTL_ARLAN), #endif #if defined(CTL_S390DBF) || (defined(HAVE_DECL_CTL_S390DBF) && HAVE_DECL_CTL_S390DBF) - XLAT(CTL_S390DBF), + XLAT(CTL_S390DBF), #endif #if defined(CTL_SUNRPC) || (defined(HAVE_DECL_CTL_SUNRPC) && HAVE_DECL_CTL_SUNRPC) - XLAT(CTL_SUNRPC), + XLAT(CTL_SUNRPC), #endif #if defined(CTL_PM) || (defined(HAVE_DECL_CTL_PM) && HAVE_DECL_CTL_PM) - XLAT(CTL_PM), + XLAT(CTL_PM), #endif #if defined(CTL_FRV) || (defined(HAVE_DECL_CTL_FRV) && HAVE_DECL_CTL_FRV) - XLAT(CTL_FRV), + XLAT(CTL_FRV), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_root.in b/xlat/sysctl_root.in index 28bd49ac..670670cc 100644 --- a/xlat/sysctl_root.in +++ b/xlat/sysctl_root.in @@ -1,13 +1,15 @@ +#unconditional CTL_KERN CTL_VM CTL_NET -CTL_PROC CTL_FS CTL_DEBUG CTL_DEV CTL_BUS CTL_ABI CTL_CPU +#conditional +CTL_PROC CTL_ARLAN CTL_S390DBF CTL_SUNRPC diff --git a/xlat/sysctl_vm.h b/xlat/sysctl_vm.h index e2926ae0..36896a20 100644 --- a/xlat/sysctl_vm.h +++ b/xlat/sysctl_vm.h @@ -1,65 +1,48 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_vm.in; do not edit. */ -static const struct xlat sysctl_vm[] = { -#if defined(VM_OVERCOMMIT_MEMORY) || (defined(HAVE_DECL_VM_OVERCOMMIT_MEMORY) && HAVE_DECL_VM_OVERCOMMIT_MEMORY) - XLAT(VM_OVERCOMMIT_MEMORY), -#endif -#if defined(VM_PAGE_CLUSTER) || (defined(HAVE_DECL_VM_PAGE_CLUSTER) && HAVE_DECL_VM_PAGE_CLUSTER) - XLAT(VM_PAGE_CLUSTER), -#endif -#if defined(VM_DIRTY_BACKGROUND) || (defined(HAVE_DECL_VM_DIRTY_BACKGROUND) && HAVE_DECL_VM_DIRTY_BACKGROUND) - XLAT(VM_DIRTY_BACKGROUND), -#endif -#if defined(VM_DIRTY_RATIO) || (defined(HAVE_DECL_VM_DIRTY_RATIO) && HAVE_DECL_VM_DIRTY_RATIO) - XLAT(VM_DIRTY_RATIO), -#endif -#if defined(VM_DIRTY_WB_CS) || (defined(HAVE_DECL_VM_DIRTY_WB_CS) && HAVE_DECL_VM_DIRTY_WB_CS) - XLAT(VM_DIRTY_WB_CS), -#endif -#if defined(VM_DIRTY_EXPIRE_CS) || (defined(HAVE_DECL_VM_DIRTY_EXPIRE_CS) && HAVE_DECL_VM_DIRTY_EXPIRE_CS) - XLAT(VM_DIRTY_EXPIRE_CS), -#endif -#if defined(VM_NR_PDFLUSH_THREADS) || (defined(HAVE_DECL_VM_NR_PDFLUSH_THREADS) && HAVE_DECL_VM_NR_PDFLUSH_THREADS) - XLAT(VM_NR_PDFLUSH_THREADS), -#endif -#if defined(VM_OVERCOMMIT_RATIO) || (defined(HAVE_DECL_VM_OVERCOMMIT_RATIO) && HAVE_DECL_VM_OVERCOMMIT_RATIO) - XLAT(VM_OVERCOMMIT_RATIO), -#endif -#if defined(VM_PAGEBUF) || (defined(HAVE_DECL_VM_PAGEBUF) && HAVE_DECL_VM_PAGEBUF) - XLAT(VM_PAGEBUF), -#endif -#if defined(VM_HUGETLB_PAGES) || (defined(HAVE_DECL_VM_HUGETLB_PAGES) && HAVE_DECL_VM_HUGETLB_PAGES) - XLAT(VM_HUGETLB_PAGES), -#endif -#if defined(VM_SWAPPINESS) || (defined(HAVE_DECL_VM_SWAPPINESS) && HAVE_DECL_VM_SWAPPINESS) - XLAT(VM_SWAPPINESS), -#endif -#if defined(VM_LOWMEM_RESERVE_RATIO) || (defined(HAVE_DECL_VM_LOWMEM_RESERVE_RATIO) && HAVE_DECL_VM_LOWMEM_RESERVE_RATIO) - XLAT(VM_LOWMEM_RESERVE_RATIO), -#endif -#if defined(VM_MIN_FREE_KBYTES) || (defined(HAVE_DECL_VM_MIN_FREE_KBYTES) && HAVE_DECL_VM_MIN_FREE_KBYTES) - XLAT(VM_MIN_FREE_KBYTES), -#endif +#ifdef IN_MPERS + +# error static const struct xlat sysctl_vm in mpers mode + +#else + +static +const struct xlat sysctl_vm[] = { + XLAT(VM_OVERCOMMIT_MEMORY), + XLAT(VM_PAGE_CLUSTER), + XLAT(VM_DIRTY_BACKGROUND), + XLAT(VM_DIRTY_RATIO), + XLAT(VM_DIRTY_WB_CS), + XLAT(VM_DIRTY_EXPIRE_CS), + XLAT(VM_NR_PDFLUSH_THREADS), + XLAT(VM_OVERCOMMIT_RATIO), + XLAT(VM_PAGEBUF), + XLAT(VM_HUGETLB_PAGES), + XLAT(VM_SWAPPINESS), + XLAT(VM_LOWMEM_RESERVE_RATIO), + XLAT(VM_MIN_FREE_KBYTES), #if defined(VM_MAX_MAP_COUNT) || (defined(HAVE_DECL_VM_MAX_MAP_COUNT) && HAVE_DECL_VM_MAX_MAP_COUNT) - XLAT(VM_MAX_MAP_COUNT), + XLAT(VM_MAX_MAP_COUNT), #endif #if defined(VM_LAPTOP_MODE) || (defined(HAVE_DECL_VM_LAPTOP_MODE) && HAVE_DECL_VM_LAPTOP_MODE) - XLAT(VM_LAPTOP_MODE), + XLAT(VM_LAPTOP_MODE), #endif #if defined(VM_BLOCK_DUMP) || (defined(HAVE_DECL_VM_BLOCK_DUMP) && HAVE_DECL_VM_BLOCK_DUMP) - XLAT(VM_BLOCK_DUMP), + XLAT(VM_BLOCK_DUMP), #endif #if defined(VM_HUGETLB_GROUP) || (defined(HAVE_DECL_VM_HUGETLB_GROUP) && HAVE_DECL_VM_HUGETLB_GROUP) - XLAT(VM_HUGETLB_GROUP), + XLAT(VM_HUGETLB_GROUP), #endif #if defined(VM_VFS_CACHE_PRESSURE) || (defined(HAVE_DECL_VM_VFS_CACHE_PRESSURE) && HAVE_DECL_VM_VFS_CACHE_PRESSURE) - XLAT(VM_VFS_CACHE_PRESSURE), + XLAT(VM_VFS_CACHE_PRESSURE), #endif #if defined(VM_LEGACY_VA_LAYOUT) || (defined(HAVE_DECL_VM_LEGACY_VA_LAYOUT) && HAVE_DECL_VM_LEGACY_VA_LAYOUT) - XLAT(VM_LEGACY_VA_LAYOUT), + XLAT(VM_LEGACY_VA_LAYOUT), #endif #if defined(VM_SWAP_TOKEN_TIMEOUT) || (defined(HAVE_DECL_VM_SWAP_TOKEN_TIMEOUT) && HAVE_DECL_VM_SWAP_TOKEN_TIMEOUT) - XLAT(VM_SWAP_TOKEN_TIMEOUT), + XLAT(VM_SWAP_TOKEN_TIMEOUT), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysctl_vm.in b/xlat/sysctl_vm.in index 6d476af9..3c2b4739 100644 --- a/xlat/sysctl_vm.in +++ b/xlat/sysctl_vm.in @@ -1,3 +1,4 @@ +#unconditional VM_OVERCOMMIT_MEMORY VM_PAGE_CLUSTER VM_DIRTY_BACKGROUND @@ -11,6 +12,7 @@ VM_HUGETLB_PAGES VM_SWAPPINESS VM_LOWMEM_RESERVE_RATIO VM_MIN_FREE_KBYTES +#conditional VM_MAX_MAP_COUNT VM_LAPTOP_MODE VM_BLOCK_DUMP diff --git a/xlat/syslog_action_type.h b/xlat/syslog_action_type.h index 1083d35e..b4f543fe 100644 --- a/xlat/syslog_action_type.h +++ b/xlat/syslog_action_type.h @@ -1,16 +1,25 @@ /* Generated by ./xlat/gen.sh from ./xlat/syslog_action_type.in; do not edit. */ -static const struct xlat syslog_action_type[] = { - XLAT(SYSLOG_ACTION_CLOSE), - XLAT(SYSLOG_ACTION_OPEN), - XLAT(SYSLOG_ACTION_READ), - XLAT(SYSLOG_ACTION_READ_ALL), - XLAT(SYSLOG_ACTION_READ_CLEAR), - XLAT(SYSLOG_ACTION_CLEAR), - XLAT(SYSLOG_ACTION_CONSOLE_OFF), - XLAT(SYSLOG_ACTION_CONSOLE_ON), - XLAT(SYSLOG_ACTION_CONSOLE_LEVEL), - XLAT(SYSLOG_ACTION_SIZE_UNREAD), - XLAT(SYSLOG_ACTION_SIZE_BUFFER), - XLAT_END +#ifdef IN_MPERS + +# error static const struct xlat syslog_action_type in mpers mode + +#else + +static +const struct xlat syslog_action_type[] = { + XLAT(SYSLOG_ACTION_CLOSE), + XLAT(SYSLOG_ACTION_OPEN), + XLAT(SYSLOG_ACTION_READ), + XLAT(SYSLOG_ACTION_READ_ALL), + XLAT(SYSLOG_ACTION_READ_CLEAR), + XLAT(SYSLOG_ACTION_CLEAR), + XLAT(SYSLOG_ACTION_CONSOLE_OFF), + XLAT(SYSLOG_ACTION_CONSOLE_ON), + XLAT(SYSLOG_ACTION_CONSOLE_LEVEL), + XLAT(SYSLOG_ACTION_SIZE_UNREAD), + XLAT(SYSLOG_ACTION_SIZE_BUFFER), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/sysmips_operations.h b/xlat/sysmips_operations.h index 61381078..107caa2b 100644 --- a/xlat/sysmips_operations.h +++ b/xlat/sysmips_operations.h @@ -1,20 +1,29 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysmips_operations.in; do not edit. */ -static const struct xlat sysmips_operations[] = { +#ifdef IN_MPERS + +# error static const struct xlat sysmips_operations in mpers mode + +#else + +static +const struct xlat sysmips_operations[] = { #if defined(SETNAME) || (defined(HAVE_DECL_SETNAME) && HAVE_DECL_SETNAME) - XLAT(SETNAME), + XLAT(SETNAME), #endif #if defined(FLUSH_CACHE) || (defined(HAVE_DECL_FLUSH_CACHE) && HAVE_DECL_FLUSH_CACHE) - XLAT(FLUSH_CACHE), + XLAT(FLUSH_CACHE), #endif #if defined(MIPS_FIXADE) || (defined(HAVE_DECL_MIPS_FIXADE) && HAVE_DECL_MIPS_FIXADE) - XLAT(MIPS_FIXADE), + XLAT(MIPS_FIXADE), #endif #if defined(MIPS_RDNVRAM) || (defined(HAVE_DECL_MIPS_RDNVRAM) && HAVE_DECL_MIPS_RDNVRAM) - XLAT(MIPS_RDNVRAM), + XLAT(MIPS_RDNVRAM), #endif #if defined(MIPS_ATOMIC_SET) || (defined(HAVE_DECL_MIPS_ATOMIC_SET) && HAVE_DECL_MIPS_ATOMIC_SET) - XLAT(MIPS_ATOMIC_SET), + XLAT(MIPS_ATOMIC_SET), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/tcflsh_options.h b/xlat/tcflsh_options.h index 83f77bfe..5d67bb73 100644 --- a/xlat/tcflsh_options.h +++ b/xlat/tcflsh_options.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/tcflsh_options.in; do not edit. */ -static const struct xlat tcflsh_options[] = { +#ifdef IN_MPERS + +# error static const struct xlat tcflsh_options in mpers mode + +#else + +static +const struct xlat tcflsh_options[] = { #if defined(TCIFLUSH) || (defined(HAVE_DECL_TCIFLUSH) && HAVE_DECL_TCIFLUSH) - XLAT(TCIFLUSH), + XLAT(TCIFLUSH), #endif #if defined(TCOFLUSH) || (defined(HAVE_DECL_TCOFLUSH) && HAVE_DECL_TCOFLUSH) - XLAT(TCOFLUSH), + XLAT(TCOFLUSH), #endif #if defined(TCIOFLUSH) || (defined(HAVE_DECL_TCIOFLUSH) && HAVE_DECL_TCIOFLUSH) - XLAT(TCIOFLUSH), + XLAT(TCIOFLUSH), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/tcxonc_options.h b/xlat/tcxonc_options.h index a84f0ef0..83aae83e 100644 --- a/xlat/tcxonc_options.h +++ b/xlat/tcxonc_options.h @@ -1,17 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/tcxonc_options.in; do not edit. */ -static const struct xlat tcxonc_options[] = { +#ifdef IN_MPERS + +# error static const struct xlat tcxonc_options in mpers mode + +#else + +static +const struct xlat tcxonc_options[] = { #if defined(TCOOFF) || (defined(HAVE_DECL_TCOOFF) && HAVE_DECL_TCOOFF) - XLAT(TCOOFF), + XLAT(TCOOFF), #endif #if defined(TCOON) || (defined(HAVE_DECL_TCOON) && HAVE_DECL_TCOON) - XLAT(TCOON), + XLAT(TCOON), #endif #if defined(TCIOFF) || (defined(HAVE_DECL_TCIOFF) && HAVE_DECL_TCIOFF) - XLAT(TCIOFF), + XLAT(TCIOFF), #endif #if defined(TCION) || (defined(HAVE_DECL_TCION) && HAVE_DECL_TCION) - XLAT(TCION), + XLAT(TCION), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/timerfdflags.h b/xlat/timerfdflags.h index 4fadfc46..2483df89 100644 --- a/xlat/timerfdflags.h +++ b/xlat/timerfdflags.h @@ -1,8 +1,36 @@ /* Generated by ./xlat/gen.sh from ./xlat/timerfdflags.in; do not edit. */ +#if !(defined(TFD_TIMER_ABSTIME) || (defined(HAVE_DECL_TFD_TIMER_ABSTIME) && HAVE_DECL_TFD_TIMER_ABSTIME)) +# define TFD_TIMER_ABSTIME (1 << 0) +#endif +#if !(defined(TFD_TIMER_CANCEL_ON_SET) || (defined(HAVE_DECL_TFD_TIMER_CANCEL_ON_SET) && HAVE_DECL_TFD_TIMER_CANCEL_ON_SET)) +# define TFD_TIMER_CANCEL_ON_SET (1 << 1) +#endif +#if defined TFD_CLOEXEC || defined O_CLOEXEC +#if !(defined(TFD_CLOEXEC) || (defined(HAVE_DECL_TFD_CLOEXEC) && HAVE_DECL_TFD_CLOEXEC)) +# define TFD_CLOEXEC O_CLOEXEC +#endif +#endif +#if !(defined(TFD_NONBLOCK) || (defined(HAVE_DECL_TFD_NONBLOCK) && HAVE_DECL_TFD_NONBLOCK)) +# define TFD_NONBLOCK O_NONBLOCK +#endif -static const struct xlat timerfdflags[] = { -#if defined(TFD_TIMER_ABSTIME) || (defined(HAVE_DECL_TFD_TIMER_ABSTIME) && HAVE_DECL_TFD_TIMER_ABSTIME) - XLAT(TFD_TIMER_ABSTIME), +#ifdef IN_MPERS + +# error static const struct xlat timerfdflags in mpers mode + +#else + +static +const struct xlat timerfdflags[] = { +/* The Linux userspace headers didn't export these for a long time. */ + + XLAT(TFD_TIMER_ABSTIME), + XLAT(TFD_TIMER_CANCEL_ON_SET), +#if defined TFD_CLOEXEC || defined O_CLOEXEC + XLAT(TFD_CLOEXEC), #endif - XLAT_END + XLAT(TFD_NONBLOCK), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/timerfdflags.in b/xlat/timerfdflags.in index cfd506d7..bf767e3f 100644 --- a/xlat/timerfdflags.in +++ b/xlat/timerfdflags.in @@ -1 +1,8 @@ -TFD_TIMER_ABSTIME +/* The Linux userspace headers didn't export these for a long time. */ + +TFD_TIMER_ABSTIME (1 << 0) +TFD_TIMER_CANCEL_ON_SET (1 << 1) +#if defined TFD_CLOEXEC || defined O_CLOEXEC +TFD_CLOEXEC O_CLOEXEC +#endif +TFD_NONBLOCK O_NONBLOCK diff --git a/xlat/ubi_volume_props.h b/xlat/ubi_volume_props.h index 7aa90c66..cfae600b 100644 --- a/xlat/ubi_volume_props.h +++ b/xlat/ubi_volume_props.h @@ -1,6 +1,15 @@ /* Generated by ./xlat/gen.sh from ./xlat/ubi_volume_props.in; do not edit. */ -static const struct xlat ubi_volume_props[] = { - XLAT(UBI_VOL_PROP_DIRECT_WRITE), - XLAT_END +#ifdef IN_MPERS + +# error static const struct xlat ubi_volume_props in mpers mode + +#else + +static +const struct xlat ubi_volume_props[] = { + XLAT(UBI_VOL_PROP_DIRECT_WRITE), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/ubi_volume_types.h b/xlat/ubi_volume_types.h index 36a2f079..0facbf2f 100644 --- a/xlat/ubi_volume_types.h +++ b/xlat/ubi_volume_types.h @@ -1,7 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/ubi_volume_types.in; do not edit. */ -static const struct xlat ubi_volume_types[] = { - XLAT(UBI_DYNAMIC_VOLUME), - XLAT(UBI_STATIC_VOLUME), - XLAT_END +#ifdef IN_MPERS + +# error static const struct xlat ubi_volume_types in mpers mode + +#else + +static +const struct xlat ubi_volume_types[] = { + XLAT(UBI_DYNAMIC_VOLUME), + XLAT(UBI_STATIC_VOLUME), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/uffd_api_flags.h b/xlat/uffd_api_flags.h new file mode 100644 index 00000000..4963ec46 --- /dev/null +++ b/xlat/uffd_api_flags.h @@ -0,0 +1,23 @@ +/* Generated by ./xlat/gen.sh from ./xlat/uffd_api_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat uffd_api_flags in mpers mode + +#else + +static +const struct xlat uffd_api_flags[] = { +#if defined(_UFFDIO_REGISTER) || (defined(HAVE_DECL__UFFDIO_REGISTER) && HAVE_DECL__UFFDIO_REGISTER) + XLAT_TYPE_PAIR(uint64_t, 1ULL<<_UFFDIO_REGISTER, "1<<_UFFDIO_REGISTER"), +#endif +#if defined(_UFFDIO_UNREGISTER) || (defined(HAVE_DECL__UFFDIO_UNREGISTER) && HAVE_DECL__UFFDIO_UNREGISTER) + XLAT_TYPE_PAIR(uint64_t, 1ULL<<_UFFDIO_UNREGISTER, "1<<_UFFDIO_UNREGISTER"), +#endif +#if defined(_UFFDIO_API) || (defined(HAVE_DECL__UFFDIO_API) && HAVE_DECL__UFFDIO_API) + XLAT_TYPE_PAIR(uint64_t, 1ULL<<_UFFDIO_API, "1<<_UFFDIO_API"), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/uffd_api_flags.in b/xlat/uffd_api_flags.in new file mode 100644 index 00000000..fd210872 --- /dev/null +++ b/xlat/uffd_api_flags.in @@ -0,0 +1,4 @@ +#val_type uint64_t +1<<_UFFDIO_REGISTER +1<<_UFFDIO_UNREGISTER +1<<_UFFDIO_API diff --git a/xlat/uffd_copy_flags.h b/xlat/uffd_copy_flags.h new file mode 100644 index 00000000..669c1bbc --- /dev/null +++ b/xlat/uffd_copy_flags.h @@ -0,0 +1,17 @@ +/* Generated by ./xlat/gen.sh from ./xlat/uffd_copy_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat uffd_copy_flags in mpers mode + +#else + +static +const struct xlat uffd_copy_flags[] = { +#if defined(UFFDIO_COPY_MODE_DONTWAKE) || (defined(HAVE_DECL_UFFDIO_COPY_MODE_DONTWAKE) && HAVE_DECL_UFFDIO_COPY_MODE_DONTWAKE) + XLAT_TYPE(uint64_t, UFFDIO_COPY_MODE_DONTWAKE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/uffd_copy_flags.in b/xlat/uffd_copy_flags.in new file mode 100644 index 00000000..02d6b19c --- /dev/null +++ b/xlat/uffd_copy_flags.in @@ -0,0 +1,2 @@ +#val_type uint64_t +UFFDIO_COPY_MODE_DONTWAKE diff --git a/xlat/uffd_flags.h b/xlat/uffd_flags.h new file mode 100644 index 00000000..5fd260e8 --- /dev/null +++ b/xlat/uffd_flags.h @@ -0,0 +1,20 @@ +/* Generated by ./xlat/gen.sh from ./xlat/uffd_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat uffd_flags in mpers mode + +#else + +static +const struct xlat uffd_flags[] = { +#if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) + XLAT(O_NONBLOCK), +#endif +#if defined(O_CLOEXEC) || (defined(HAVE_DECL_O_CLOEXEC) && HAVE_DECL_O_CLOEXEC) + XLAT(O_CLOEXEC), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/uffd_flags.in b/xlat/uffd_flags.in new file mode 100644 index 00000000..fb0338bc --- /dev/null +++ b/xlat/uffd_flags.in @@ -0,0 +1,2 @@ +O_NONBLOCK +O_CLOEXEC diff --git a/xlat/uffd_register_ioctl_flags.h b/xlat/uffd_register_ioctl_flags.h new file mode 100644 index 00000000..0c90f3cc --- /dev/null +++ b/xlat/uffd_register_ioctl_flags.h @@ -0,0 +1,23 @@ +/* Generated by ./xlat/gen.sh from ./xlat/uffd_register_ioctl_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat uffd_register_ioctl_flags in mpers mode + +#else + +static +const struct xlat uffd_register_ioctl_flags[] = { +#if defined(_UFFDIO_WAKE) || (defined(HAVE_DECL__UFFDIO_WAKE) && HAVE_DECL__UFFDIO_WAKE) + XLAT_TYPE_PAIR(uint64_t, 1ULL<<_UFFDIO_WAKE, "1<<_UFFDIO_WAKE"), +#endif +#if defined(_UFFDIO_COPY) || (defined(HAVE_DECL__UFFDIO_COPY) && HAVE_DECL__UFFDIO_COPY) + XLAT_TYPE_PAIR(uint64_t, 1ULL<<_UFFDIO_COPY, "1<<_UFFDIO_COPY"), +#endif +#if defined(_UFFDIO_ZEROPAGE) || (defined(HAVE_DECL__UFFDIO_ZEROPAGE) && HAVE_DECL__UFFDIO_ZEROPAGE) + XLAT_TYPE_PAIR(uint64_t, 1ULL<<_UFFDIO_ZEROPAGE, "1<<_UFFDIO_ZEROPAGE"), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/uffd_register_ioctl_flags.in b/xlat/uffd_register_ioctl_flags.in new file mode 100644 index 00000000..f4e3b943 --- /dev/null +++ b/xlat/uffd_register_ioctl_flags.in @@ -0,0 +1,4 @@ +#val_type uint64_t +1<<_UFFDIO_WAKE +1<<_UFFDIO_COPY +1<<_UFFDIO_ZEROPAGE diff --git a/xlat/uffd_register_mode_flags.h b/xlat/uffd_register_mode_flags.h new file mode 100644 index 00000000..bfcae875 --- /dev/null +++ b/xlat/uffd_register_mode_flags.h @@ -0,0 +1,20 @@ +/* Generated by ./xlat/gen.sh from ./xlat/uffd_register_mode_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat uffd_register_mode_flags in mpers mode + +#else + +static +const struct xlat uffd_register_mode_flags[] = { +#if defined(UFFDIO_REGISTER_MODE_MISSING) || (defined(HAVE_DECL_UFFDIO_REGISTER_MODE_MISSING) && HAVE_DECL_UFFDIO_REGISTER_MODE_MISSING) + XLAT_TYPE(uint64_t, UFFDIO_REGISTER_MODE_MISSING), +#endif +#if defined(UFFDIO_REGISTER_MODE_WP) || (defined(HAVE_DECL_UFFDIO_REGISTER_MODE_WP) && HAVE_DECL_UFFDIO_REGISTER_MODE_WP) + XLAT_TYPE(uint64_t, UFFDIO_REGISTER_MODE_WP), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/uffd_register_mode_flags.in b/xlat/uffd_register_mode_flags.in new file mode 100644 index 00000000..996b1f32 --- /dev/null +++ b/xlat/uffd_register_mode_flags.in @@ -0,0 +1,3 @@ +#val_type uint64_t +UFFDIO_REGISTER_MODE_MISSING +UFFDIO_REGISTER_MODE_WP diff --git a/xlat/uffd_zeropage_flags.h b/xlat/uffd_zeropage_flags.h new file mode 100644 index 00000000..8367ff6f --- /dev/null +++ b/xlat/uffd_zeropage_flags.h @@ -0,0 +1,17 @@ +/* Generated by ./xlat/gen.sh from ./xlat/uffd_zeropage_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat uffd_zeropage_flags in mpers mode + +#else + +static +const struct xlat uffd_zeropage_flags[] = { +#if defined(UFFDIO_ZEROPAGE_MODE_DONTWAKE) || (defined(HAVE_DECL_UFFDIO_ZEROPAGE_MODE_DONTWAKE) && HAVE_DECL_UFFDIO_ZEROPAGE_MODE_DONTWAKE) + XLAT_TYPE(uint64_t, UFFDIO_ZEROPAGE_MODE_DONTWAKE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/uffd_zeropage_flags.in b/xlat/uffd_zeropage_flags.in new file mode 100644 index 00000000..6d48a040 --- /dev/null +++ b/xlat/uffd_zeropage_flags.in @@ -0,0 +1,2 @@ +#val_type uint64_t +UFFDIO_ZEROPAGE_MODE_DONTWAKE diff --git a/xlat/umount_flags.h b/xlat/umount_flags.h index 304c1a6a..32197824 100644 --- a/xlat/umount_flags.h +++ b/xlat/umount_flags.h @@ -1,14 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/umount_flags.in; do not edit. */ - -static const struct xlat umount_flags[] = { -#if defined(MNT_FORCE) || (defined(HAVE_DECL_MNT_FORCE) && HAVE_DECL_MNT_FORCE) - XLAT(MNT_FORCE), +#if !(defined(MNT_FORCE) || (defined(HAVE_DECL_MNT_FORCE) && HAVE_DECL_MNT_FORCE)) +# define MNT_FORCE 1 +#endif +#if !(defined(MNT_DETACH) || (defined(HAVE_DECL_MNT_DETACH) && HAVE_DECL_MNT_DETACH)) +# define MNT_DETACH 2 #endif -#if defined(MNT_DETACH) || (defined(HAVE_DECL_MNT_DETACH) && HAVE_DECL_MNT_DETACH) - XLAT(MNT_DETACH), +#if !(defined(MNT_EXPIRE) || (defined(HAVE_DECL_MNT_EXPIRE) && HAVE_DECL_MNT_EXPIRE)) +# define MNT_EXPIRE 4 #endif -#if defined(MNT_EXPIRE) || (defined(HAVE_DECL_MNT_EXPIRE) && HAVE_DECL_MNT_EXPIRE) - XLAT(MNT_EXPIRE), +#if !(defined(UMOUNT_NOFOLLOW) || (defined(HAVE_DECL_UMOUNT_NOFOLLOW) && HAVE_DECL_UMOUNT_NOFOLLOW)) +# define UMOUNT_NOFOLLOW 8 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat umount_flags in mpers mode + +#else + +static +const struct xlat umount_flags[] = { + XLAT(MNT_FORCE), + XLAT(MNT_DETACH), + XLAT(MNT_EXPIRE), + XLAT(UMOUNT_NOFOLLOW), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/umount_flags.in b/xlat/umount_flags.in index 4a7e366a..2edabcdb 100644 --- a/xlat/umount_flags.in +++ b/xlat/umount_flags.in @@ -1,3 +1,4 @@ -MNT_FORCE -MNT_DETACH -MNT_EXPIRE +MNT_FORCE 1 +MNT_DETACH 2 +MNT_EXPIRE 4 +UMOUNT_NOFOLLOW 8 diff --git a/xlat/unshare_flags.h b/xlat/unshare_flags.h new file mode 100644 index 00000000..5c43ebc7 --- /dev/null +++ b/xlat/unshare_flags.h @@ -0,0 +1,53 @@ +/* Generated by ./xlat/gen.sh from ./xlat/unshare_flags.in; do not edit. */ + +#ifdef IN_MPERS + +# error static const struct xlat unshare_flags in mpers mode + +#else + +static +const struct xlat unshare_flags[] = { +#if defined(CLONE_THREAD) || (defined(HAVE_DECL_CLONE_THREAD) && HAVE_DECL_CLONE_THREAD) + XLAT(CLONE_THREAD), +#endif +#if defined(CLONE_FS) || (defined(HAVE_DECL_CLONE_FS) && HAVE_DECL_CLONE_FS) + XLAT(CLONE_FS), +#endif +#if defined(CLONE_NEWNS) || (defined(HAVE_DECL_CLONE_NEWNS) && HAVE_DECL_CLONE_NEWNS) + XLAT(CLONE_NEWNS), +#endif +#if defined(CLONE_SIGHAND) || (defined(HAVE_DECL_CLONE_SIGHAND) && HAVE_DECL_CLONE_SIGHAND) + XLAT(CLONE_SIGHAND), +#endif +#if defined(CLONE_VM) || (defined(HAVE_DECL_CLONE_VM) && HAVE_DECL_CLONE_VM) + XLAT(CLONE_VM), +#endif +#if defined(CLONE_FILES) || (defined(HAVE_DECL_CLONE_FILES) && HAVE_DECL_CLONE_FILES) + XLAT(CLONE_FILES), +#endif +#if defined(CLONE_SYSVSEM) || (defined(HAVE_DECL_CLONE_SYSVSEM) && HAVE_DECL_CLONE_SYSVSEM) + XLAT(CLONE_SYSVSEM), +#endif +#if defined(CLONE_NEWUTS) || (defined(HAVE_DECL_CLONE_NEWUTS) && HAVE_DECL_CLONE_NEWUTS) + XLAT(CLONE_NEWUTS), +#endif +#if defined(CLONE_NEWIPC) || (defined(HAVE_DECL_CLONE_NEWIPC) && HAVE_DECL_CLONE_NEWIPC) + XLAT(CLONE_NEWIPC), +#endif +#if defined(CLONE_NEWNET) || (defined(HAVE_DECL_CLONE_NEWNET) && HAVE_DECL_CLONE_NEWNET) + XLAT(CLONE_NEWNET), +#endif +#if defined(CLONE_NEWUSER) || (defined(HAVE_DECL_CLONE_NEWUSER) && HAVE_DECL_CLONE_NEWUSER) + XLAT(CLONE_NEWUSER), +#endif +#if defined(CLONE_NEWPID) || (defined(HAVE_DECL_CLONE_NEWPID) && HAVE_DECL_CLONE_NEWPID) + XLAT(CLONE_NEWPID), +#endif +#if defined(CLONE_NEWCGROUP) || (defined(HAVE_DECL_CLONE_NEWCGROUP) && HAVE_DECL_CLONE_NEWCGROUP) + XLAT(CLONE_NEWCGROUP), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/unshare_flags.in b/xlat/unshare_flags.in new file mode 100644 index 00000000..4b289a7a --- /dev/null +++ b/xlat/unshare_flags.in @@ -0,0 +1,13 @@ +CLONE_THREAD +CLONE_FS +CLONE_NEWNS +CLONE_SIGHAND +CLONE_VM +CLONE_FILES +CLONE_SYSVSEM +CLONE_NEWUTS +CLONE_NEWIPC +CLONE_NEWNET +CLONE_NEWUSER +CLONE_NEWPID +CLONE_NEWCGROUP diff --git a/xlat/usagewho.h b/xlat/usagewho.h index 860e0a0b..810f04cb 100644 --- a/xlat/usagewho.h +++ b/xlat/usagewho.h @@ -1,14 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/usagewho.in; do not edit. */ -static const struct xlat usagewho[] = { +#ifdef IN_MPERS + +# error static const struct xlat usagewho in mpers mode + +#else + +static +const struct xlat usagewho[] = { #if defined(RUSAGE_SELF) || (defined(HAVE_DECL_RUSAGE_SELF) && HAVE_DECL_RUSAGE_SELF) - XLAT(RUSAGE_SELF), + XLAT(RUSAGE_SELF), #endif #if defined(RUSAGE_CHILDREN) || (defined(HAVE_DECL_RUSAGE_CHILDREN) && HAVE_DECL_RUSAGE_CHILDREN) - XLAT(RUSAGE_CHILDREN), + XLAT(RUSAGE_CHILDREN), #endif #if defined(RUSAGE_BOTH) || (defined(HAVE_DECL_RUSAGE_BOTH) && HAVE_DECL_RUSAGE_BOTH) - XLAT(RUSAGE_BOTH), + XLAT(RUSAGE_BOTH), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_buf_flags.h b/xlat/v4l2_buf_flags.h new file mode 100644 index 00000000..63f0b475 --- /dev/null +++ b/xlat/v4l2_buf_flags.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_buf_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_buf_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_buf_flags[] = { +#if defined(V4L2_BUF_FLAG_MAPPED) || (defined(HAVE_DECL_V4L2_BUF_FLAG_MAPPED) && HAVE_DECL_V4L2_BUF_FLAG_MAPPED) + XLAT(V4L2_BUF_FLAG_MAPPED), +#endif +#if defined(V4L2_BUF_FLAG_QUEUED) || (defined(HAVE_DECL_V4L2_BUF_FLAG_QUEUED) && HAVE_DECL_V4L2_BUF_FLAG_QUEUED) + XLAT(V4L2_BUF_FLAG_QUEUED), +#endif +#if defined(V4L2_BUF_FLAG_DONE) || (defined(HAVE_DECL_V4L2_BUF_FLAG_DONE) && HAVE_DECL_V4L2_BUF_FLAG_DONE) + XLAT(V4L2_BUF_FLAG_DONE), +#endif +#if defined(V4L2_BUF_FLAG_KEYFRAME) || (defined(HAVE_DECL_V4L2_BUF_FLAG_KEYFRAME) && HAVE_DECL_V4L2_BUF_FLAG_KEYFRAME) + XLAT(V4L2_BUF_FLAG_KEYFRAME), +#endif +#if defined(V4L2_BUF_FLAG_PFRAME) || (defined(HAVE_DECL_V4L2_BUF_FLAG_PFRAME) && HAVE_DECL_V4L2_BUF_FLAG_PFRAME) + XLAT(V4L2_BUF_FLAG_PFRAME), +#endif +#if defined(V4L2_BUF_FLAG_BFRAME) || (defined(HAVE_DECL_V4L2_BUF_FLAG_BFRAME) && HAVE_DECL_V4L2_BUF_FLAG_BFRAME) + XLAT(V4L2_BUF_FLAG_BFRAME), +#endif +#if defined(V4L2_BUF_FLAG_TIMECODE) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMECODE) && HAVE_DECL_V4L2_BUF_FLAG_TIMECODE) + XLAT(V4L2_BUF_FLAG_TIMECODE), +#endif +#if defined(V4L2_BUF_FLAG_INPUT) || (defined(HAVE_DECL_V4L2_BUF_FLAG_INPUT) && HAVE_DECL_V4L2_BUF_FLAG_INPUT) + XLAT(V4L2_BUF_FLAG_INPUT), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_buf_flags.in b/xlat/v4l2_buf_flags.in new file mode 100644 index 00000000..ba7e86e9 --- /dev/null +++ b/xlat/v4l2_buf_flags.in @@ -0,0 +1,8 @@ +V4L2_BUF_FLAG_MAPPED +V4L2_BUF_FLAG_QUEUED +V4L2_BUF_FLAG_DONE +V4L2_BUF_FLAG_KEYFRAME +V4L2_BUF_FLAG_PFRAME +V4L2_BUF_FLAG_BFRAME +V4L2_BUF_FLAG_TIMECODE +V4L2_BUF_FLAG_INPUT diff --git a/xlat/v4l2_buf_types.h b/xlat/v4l2_buf_types.h new file mode 100644 index 00000000..c5966a95 --- /dev/null +++ b/xlat/v4l2_buf_types.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_buf_types.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_buf_types[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_buf_types[] = { +#if defined(V4L2_BUF_TYPE_VIDEO_CAPTURE) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE) && HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE) + XLAT(V4L2_BUF_TYPE_VIDEO_CAPTURE), +#endif +#if defined(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) && HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + XLAT(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE), +#endif +#if defined(V4L2_BUF_TYPE_VIDEO_OUTPUT) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT) && HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT) + XLAT(V4L2_BUF_TYPE_VIDEO_OUTPUT), +#endif +#if defined(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) && HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + XLAT(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE), +#endif +#if defined(V4L2_BUF_TYPE_VIDEO_OVERLAY) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OVERLAY) && HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OVERLAY) + XLAT(V4L2_BUF_TYPE_VIDEO_OVERLAY), +#endif +#if defined(V4L2_BUF_TYPE_VBI_CAPTURE) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VBI_CAPTURE) && HAVE_DECL_V4L2_BUF_TYPE_VBI_CAPTURE) + XLAT(V4L2_BUF_TYPE_VBI_CAPTURE), +#endif +#if defined(V4L2_BUF_TYPE_VBI_OUTPUT) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VBI_OUTPUT) && HAVE_DECL_V4L2_BUF_TYPE_VBI_OUTPUT) + XLAT(V4L2_BUF_TYPE_VBI_OUTPUT), +#endif +#if defined(V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) || (defined(HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) && HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) + XLAT(V4L2_BUF_TYPE_SLICED_VBI_CAPTURE), +#endif +#if defined(V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) || (defined(HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) && HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) + XLAT(V4L2_BUF_TYPE_SLICED_VBI_OUTPUT), +#endif +#if defined(V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY) || (defined(HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY) && HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY) + XLAT(V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_buf_types.in b/xlat/v4l2_buf_types.in new file mode 100644 index 00000000..431cb598 --- /dev/null +++ b/xlat/v4l2_buf_types.in @@ -0,0 +1,10 @@ +V4L2_BUF_TYPE_VIDEO_CAPTURE +V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE +V4L2_BUF_TYPE_VIDEO_OUTPUT +V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE +V4L2_BUF_TYPE_VIDEO_OVERLAY +V4L2_BUF_TYPE_VBI_CAPTURE +V4L2_BUF_TYPE_VBI_OUTPUT +V4L2_BUF_TYPE_SLICED_VBI_CAPTURE +V4L2_BUF_TYPE_SLICED_VBI_OUTPUT +V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY diff --git a/xlat/v4l2_capture_modes.h b/xlat/v4l2_capture_modes.h new file mode 100644 index 00000000..ea21949f --- /dev/null +++ b/xlat/v4l2_capture_modes.h @@ -0,0 +1,19 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_capture_modes.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_capture_modes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_capture_modes[] = { +#if defined(V4L2_MODE_HIGHQUALITY) || (defined(HAVE_DECL_V4L2_MODE_HIGHQUALITY) && HAVE_DECL_V4L2_MODE_HIGHQUALITY) + XLAT(V4L2_MODE_HIGHQUALITY), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_capture_modes.in b/xlat/v4l2_capture_modes.in new file mode 100644 index 00000000..47307640 --- /dev/null +++ b/xlat/v4l2_capture_modes.in @@ -0,0 +1 @@ +V4L2_MODE_HIGHQUALITY diff --git a/xlat/v4l2_colorspaces.h b/xlat/v4l2_colorspaces.h new file mode 100644 index 00000000..857baf96 --- /dev/null +++ b/xlat/v4l2_colorspaces.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_colorspaces.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_colorspaces[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_colorspaces[] = { +#if defined(V4L2_COLORSPACE_SMPTE170M) || (defined(HAVE_DECL_V4L2_COLORSPACE_SMPTE170M) && HAVE_DECL_V4L2_COLORSPACE_SMPTE170M) + XLAT(V4L2_COLORSPACE_SMPTE170M), +#endif +#if defined(V4L2_COLORSPACE_SMPTE240M) || (defined(HAVE_DECL_V4L2_COLORSPACE_SMPTE240M) && HAVE_DECL_V4L2_COLORSPACE_SMPTE240M) + XLAT(V4L2_COLORSPACE_SMPTE240M), +#endif +#if defined(V4L2_COLORSPACE_REC709) || (defined(HAVE_DECL_V4L2_COLORSPACE_REC709) && HAVE_DECL_V4L2_COLORSPACE_REC709) + XLAT(V4L2_COLORSPACE_REC709), +#endif +#if defined(V4L2_COLORSPACE_BT878) || (defined(HAVE_DECL_V4L2_COLORSPACE_BT878) && HAVE_DECL_V4L2_COLORSPACE_BT878) + XLAT(V4L2_COLORSPACE_BT878), +#endif +#if defined(V4L2_COLORSPACE_470_SYSTEM_M) || (defined(HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_M) && HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_M) + XLAT(V4L2_COLORSPACE_470_SYSTEM_M), +#endif +#if defined(V4L2_COLORSPACE_470_SYSTEM_BG) || (defined(HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_BG) && HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_BG) + XLAT(V4L2_COLORSPACE_470_SYSTEM_BG), +#endif +#if defined(V4L2_COLORSPACE_JPEG) || (defined(HAVE_DECL_V4L2_COLORSPACE_JPEG) && HAVE_DECL_V4L2_COLORSPACE_JPEG) + XLAT(V4L2_COLORSPACE_JPEG), +#endif +#if defined(V4L2_COLORSPACE_SRGB) || (defined(HAVE_DECL_V4L2_COLORSPACE_SRGB) && HAVE_DECL_V4L2_COLORSPACE_SRGB) + XLAT(V4L2_COLORSPACE_SRGB), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_colorspaces.in b/xlat/v4l2_colorspaces.in new file mode 100644 index 00000000..961e71c8 --- /dev/null +++ b/xlat/v4l2_colorspaces.in @@ -0,0 +1,8 @@ +V4L2_COLORSPACE_SMPTE170M +V4L2_COLORSPACE_SMPTE240M +V4L2_COLORSPACE_REC709 +V4L2_COLORSPACE_BT878 +V4L2_COLORSPACE_470_SYSTEM_M +V4L2_COLORSPACE_470_SYSTEM_BG +V4L2_COLORSPACE_JPEG +V4L2_COLORSPACE_SRGB diff --git a/xlat/v4l2_control_classes.h b/xlat/v4l2_control_classes.h new file mode 100644 index 00000000..9ceb9c4d --- /dev/null +++ b/xlat/v4l2_control_classes.h @@ -0,0 +1,43 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_control_classes.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_control_classes[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_control_classes[] = { +#if defined(V4L2_CTRL_CLASS_USER) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_USER) && HAVE_DECL_V4L2_CTRL_CLASS_USER) + XLAT(V4L2_CTRL_CLASS_USER), +#endif +#if defined(V4L2_CTRL_CLASS_MPEG) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_MPEG) && HAVE_DECL_V4L2_CTRL_CLASS_MPEG) + XLAT(V4L2_CTRL_CLASS_MPEG), +#endif +#if defined(V4L2_CTRL_CLASS_CAMERA) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_CAMERA) && HAVE_DECL_V4L2_CTRL_CLASS_CAMERA) + XLAT(V4L2_CTRL_CLASS_CAMERA), +#endif +#if defined(V4L2_CTRL_CLASS_FM_TX) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_FM_TX) && HAVE_DECL_V4L2_CTRL_CLASS_FM_TX) + XLAT(V4L2_CTRL_CLASS_FM_TX), +#endif +#if defined(V4L2_CTRL_CLASS_FLASH) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_FLASH) && HAVE_DECL_V4L2_CTRL_CLASS_FLASH) + XLAT(V4L2_CTRL_CLASS_FLASH), +#endif +#if defined(V4L2_CTRL_CLASS_JPEG) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_JPEG) && HAVE_DECL_V4L2_CTRL_CLASS_JPEG) + XLAT(V4L2_CTRL_CLASS_JPEG), +#endif +#if defined(V4L2_CTRL_CLASS_IMAGE_SOURCE) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_IMAGE_SOURCE) && HAVE_DECL_V4L2_CTRL_CLASS_IMAGE_SOURCE) + XLAT(V4L2_CTRL_CLASS_IMAGE_SOURCE), +#endif +#if defined(V4L2_CTRL_CLASS_IMAGE_PROC) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_IMAGE_PROC) && HAVE_DECL_V4L2_CTRL_CLASS_IMAGE_PROC) + XLAT(V4L2_CTRL_CLASS_IMAGE_PROC), +#endif +#if defined(V4L2_CTRL_CLASS_FM_RX) || (defined(HAVE_DECL_V4L2_CTRL_CLASS_FM_RX) && HAVE_DECL_V4L2_CTRL_CLASS_FM_RX) + XLAT(V4L2_CTRL_CLASS_FM_RX), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_control_classes.in b/xlat/v4l2_control_classes.in new file mode 100644 index 00000000..5666a06b --- /dev/null +++ b/xlat/v4l2_control_classes.in @@ -0,0 +1,9 @@ +V4L2_CTRL_CLASS_USER +V4L2_CTRL_CLASS_MPEG +V4L2_CTRL_CLASS_CAMERA +V4L2_CTRL_CLASS_FM_TX +V4L2_CTRL_CLASS_FLASH +V4L2_CTRL_CLASS_JPEG +V4L2_CTRL_CLASS_IMAGE_SOURCE +V4L2_CTRL_CLASS_IMAGE_PROC +V4L2_CTRL_CLASS_FM_RX diff --git a/xlat/v4l2_control_flags.h b/xlat/v4l2_control_flags.h new file mode 100644 index 00000000..a4c8a535 --- /dev/null +++ b/xlat/v4l2_control_flags.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_control_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_control_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_control_flags[] = { +#if defined(V4L2_CTRL_FLAG_DISABLED) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_DISABLED) && HAVE_DECL_V4L2_CTRL_FLAG_DISABLED) + XLAT(V4L2_CTRL_FLAG_DISABLED), +#endif +#if defined(V4L2_CTRL_FLAG_GRABBED) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_GRABBED) && HAVE_DECL_V4L2_CTRL_FLAG_GRABBED) + XLAT(V4L2_CTRL_FLAG_GRABBED), +#endif +#if defined(V4L2_CTRL_FLAG_READ_ONLY) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_READ_ONLY) && HAVE_DECL_V4L2_CTRL_FLAG_READ_ONLY) + XLAT(V4L2_CTRL_FLAG_READ_ONLY), +#endif +#if defined(V4L2_CTRL_FLAG_UPDATE) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_UPDATE) && HAVE_DECL_V4L2_CTRL_FLAG_UPDATE) + XLAT(V4L2_CTRL_FLAG_UPDATE), +#endif +#if defined(V4L2_CTRL_FLAG_INACTIVE) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_INACTIVE) && HAVE_DECL_V4L2_CTRL_FLAG_INACTIVE) + XLAT(V4L2_CTRL_FLAG_INACTIVE), +#endif +#if defined(V4L2_CTRL_FLAG_SLIDER) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_SLIDER) && HAVE_DECL_V4L2_CTRL_FLAG_SLIDER) + XLAT(V4L2_CTRL_FLAG_SLIDER), +#endif +#if defined(V4L2_CTRL_FLAG_WRITE_ONLY) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_WRITE_ONLY) && HAVE_DECL_V4L2_CTRL_FLAG_WRITE_ONLY) + XLAT(V4L2_CTRL_FLAG_WRITE_ONLY), +#endif +#if defined(V4L2_CTRL_FLAG_VOLATILE) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_VOLATILE) && HAVE_DECL_V4L2_CTRL_FLAG_VOLATILE) + XLAT(V4L2_CTRL_FLAG_VOLATILE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_control_flags.in b/xlat/v4l2_control_flags.in new file mode 100644 index 00000000..18654de6 --- /dev/null +++ b/xlat/v4l2_control_flags.in @@ -0,0 +1,8 @@ +V4L2_CTRL_FLAG_DISABLED +V4L2_CTRL_FLAG_GRABBED +V4L2_CTRL_FLAG_READ_ONLY +V4L2_CTRL_FLAG_UPDATE +V4L2_CTRL_FLAG_INACTIVE +V4L2_CTRL_FLAG_SLIDER +V4L2_CTRL_FLAG_WRITE_ONLY +V4L2_CTRL_FLAG_VOLATILE diff --git a/xlat/v4l2_control_ids.h b/xlat/v4l2_control_ids.h new file mode 100644 index 00000000..2f740db9 --- /dev/null +++ b/xlat/v4l2_control_ids.h @@ -0,0 +1,243 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_control_ids.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_control_ids[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_control_ids[] = { + XLAT(0), +#if defined(V4L2_CID_BRIGHTNESS) || (defined(HAVE_DECL_V4L2_CID_BRIGHTNESS) && HAVE_DECL_V4L2_CID_BRIGHTNESS) + XLAT(V4L2_CID_BRIGHTNESS), +#endif +#if defined(V4L2_CID_CONTRAST) || (defined(HAVE_DECL_V4L2_CID_CONTRAST) && HAVE_DECL_V4L2_CID_CONTRAST) + XLAT(V4L2_CID_CONTRAST), +#endif +#if defined(V4L2_CID_SATURATION) || (defined(HAVE_DECL_V4L2_CID_SATURATION) && HAVE_DECL_V4L2_CID_SATURATION) + XLAT(V4L2_CID_SATURATION), +#endif +#if defined(V4L2_CID_HUE) || (defined(HAVE_DECL_V4L2_CID_HUE) && HAVE_DECL_V4L2_CID_HUE) + XLAT(V4L2_CID_HUE), +#endif +#if defined(V4L2_CID_AUDIO_VOLUME) || (defined(HAVE_DECL_V4L2_CID_AUDIO_VOLUME) && HAVE_DECL_V4L2_CID_AUDIO_VOLUME) + XLAT(V4L2_CID_AUDIO_VOLUME), +#endif +#if defined(V4L2_CID_AUDIO_BALANCE) || (defined(HAVE_DECL_V4L2_CID_AUDIO_BALANCE) && HAVE_DECL_V4L2_CID_AUDIO_BALANCE) + XLAT(V4L2_CID_AUDIO_BALANCE), +#endif +#if defined(V4L2_CID_AUDIO_BASS) || (defined(HAVE_DECL_V4L2_CID_AUDIO_BASS) && HAVE_DECL_V4L2_CID_AUDIO_BASS) + XLAT(V4L2_CID_AUDIO_BASS), +#endif +#if defined(V4L2_CID_AUDIO_TREBLE) || (defined(HAVE_DECL_V4L2_CID_AUDIO_TREBLE) && HAVE_DECL_V4L2_CID_AUDIO_TREBLE) + XLAT(V4L2_CID_AUDIO_TREBLE), +#endif +#if defined(V4L2_CID_AUDIO_MUTE) || (defined(HAVE_DECL_V4L2_CID_AUDIO_MUTE) && HAVE_DECL_V4L2_CID_AUDIO_MUTE) + XLAT(V4L2_CID_AUDIO_MUTE), +#endif +#if defined(V4L2_CID_AUDIO_LOUDNESS) || (defined(HAVE_DECL_V4L2_CID_AUDIO_LOUDNESS) && HAVE_DECL_V4L2_CID_AUDIO_LOUDNESS) + XLAT(V4L2_CID_AUDIO_LOUDNESS), +#endif +#if defined(V4L2_CID_BLACK_LEVEL) || (defined(HAVE_DECL_V4L2_CID_BLACK_LEVEL) && HAVE_DECL_V4L2_CID_BLACK_LEVEL) + XLAT(V4L2_CID_BLACK_LEVEL), +#endif +#if defined(V4L2_CID_AUTO_WHITE_BALANCE) || (defined(HAVE_DECL_V4L2_CID_AUTO_WHITE_BALANCE) && HAVE_DECL_V4L2_CID_AUTO_WHITE_BALANCE) + XLAT(V4L2_CID_AUTO_WHITE_BALANCE), +#endif +#if defined(V4L2_CID_DO_WHITE_BALANCE) || (defined(HAVE_DECL_V4L2_CID_DO_WHITE_BALANCE) && HAVE_DECL_V4L2_CID_DO_WHITE_BALANCE) + XLAT(V4L2_CID_DO_WHITE_BALANCE), +#endif +#if defined(V4L2_CID_RED_BALANCE) || (defined(HAVE_DECL_V4L2_CID_RED_BALANCE) && HAVE_DECL_V4L2_CID_RED_BALANCE) + XLAT(V4L2_CID_RED_BALANCE), +#endif +#if defined(V4L2_CID_BLUE_BALANCE) || (defined(HAVE_DECL_V4L2_CID_BLUE_BALANCE) && HAVE_DECL_V4L2_CID_BLUE_BALANCE) + XLAT(V4L2_CID_BLUE_BALANCE), +#endif +#if defined(V4L2_CID_GAMMA) || (defined(HAVE_DECL_V4L2_CID_GAMMA) && HAVE_DECL_V4L2_CID_GAMMA) + XLAT(V4L2_CID_GAMMA), +#endif +#if defined(V4L2_CID_WHITENESS) || (defined(HAVE_DECL_V4L2_CID_WHITENESS) && HAVE_DECL_V4L2_CID_WHITENESS) + XLAT(V4L2_CID_WHITENESS), +#endif +#if defined(V4L2_CID_EXPOSURE) || (defined(HAVE_DECL_V4L2_CID_EXPOSURE) && HAVE_DECL_V4L2_CID_EXPOSURE) + XLAT(V4L2_CID_EXPOSURE), +#endif +#if defined(V4L2_CID_AUTOGAIN) || (defined(HAVE_DECL_V4L2_CID_AUTOGAIN) && HAVE_DECL_V4L2_CID_AUTOGAIN) + XLAT(V4L2_CID_AUTOGAIN), +#endif +#if defined(V4L2_CID_GAIN) || (defined(HAVE_DECL_V4L2_CID_GAIN) && HAVE_DECL_V4L2_CID_GAIN) + XLAT(V4L2_CID_GAIN), +#endif +#if defined(V4L2_CID_HFLIP) || (defined(HAVE_DECL_V4L2_CID_HFLIP) && HAVE_DECL_V4L2_CID_HFLIP) + XLAT(V4L2_CID_HFLIP), +#endif +#if defined(V4L2_CID_VFLIP) || (defined(HAVE_DECL_V4L2_CID_VFLIP) && HAVE_DECL_V4L2_CID_VFLIP) + XLAT(V4L2_CID_VFLIP), +#endif +#if defined(V4L2_CID_HCENTER) || (defined(HAVE_DECL_V4L2_CID_HCENTER) && HAVE_DECL_V4L2_CID_HCENTER) + XLAT(V4L2_CID_HCENTER), +#endif +#if defined(V4L2_CID_VCENTER) || (defined(HAVE_DECL_V4L2_CID_VCENTER) && HAVE_DECL_V4L2_CID_VCENTER) + XLAT(V4L2_CID_VCENTER), +#endif +#if defined(V4L2_CID_POWER_LINE_FREQUENCY) || (defined(HAVE_DECL_V4L2_CID_POWER_LINE_FREQUENCY) && HAVE_DECL_V4L2_CID_POWER_LINE_FREQUENCY) + XLAT(V4L2_CID_POWER_LINE_FREQUENCY), +#endif +#if defined(V4L2_CID_HUE_AUTO) || (defined(HAVE_DECL_V4L2_CID_HUE_AUTO) && HAVE_DECL_V4L2_CID_HUE_AUTO) + XLAT(V4L2_CID_HUE_AUTO), +#endif +#if defined(V4L2_CID_WHITE_BALANCE_TEMPERATURE) || (defined(HAVE_DECL_V4L2_CID_WHITE_BALANCE_TEMPERATURE) && HAVE_DECL_V4L2_CID_WHITE_BALANCE_TEMPERATURE) + XLAT(V4L2_CID_WHITE_BALANCE_TEMPERATURE), +#endif +#if defined(V4L2_CID_SHARPNESS) || (defined(HAVE_DECL_V4L2_CID_SHARPNESS) && HAVE_DECL_V4L2_CID_SHARPNESS) + XLAT(V4L2_CID_SHARPNESS), +#endif +#if defined(V4L2_CID_BACKLIGHT_COMPENSATION) || (defined(HAVE_DECL_V4L2_CID_BACKLIGHT_COMPENSATION) && HAVE_DECL_V4L2_CID_BACKLIGHT_COMPENSATION) + XLAT(V4L2_CID_BACKLIGHT_COMPENSATION), +#endif +#if defined(V4L2_CID_CHROMA_AGC) || (defined(HAVE_DECL_V4L2_CID_CHROMA_AGC) && HAVE_DECL_V4L2_CID_CHROMA_AGC) + XLAT(V4L2_CID_CHROMA_AGC), +#endif +#if defined(V4L2_CID_CHROMA_GAIN) || (defined(HAVE_DECL_V4L2_CID_CHROMA_GAIN) && HAVE_DECL_V4L2_CID_CHROMA_GAIN) + XLAT(V4L2_CID_CHROMA_GAIN), +#endif +#if defined(V4L2_CID_COLOR_KILLER) || (defined(HAVE_DECL_V4L2_CID_COLOR_KILLER) && HAVE_DECL_V4L2_CID_COLOR_KILLER) + XLAT(V4L2_CID_COLOR_KILLER), +#endif +#if defined(V4L2_CID_COLORFX) || (defined(HAVE_DECL_V4L2_CID_COLORFX) && HAVE_DECL_V4L2_CID_COLORFX) + XLAT(V4L2_CID_COLORFX), +#endif +#if defined(V4L2_CID_COLORFX_CBCR) || (defined(HAVE_DECL_V4L2_CID_COLORFX_CBCR) && HAVE_DECL_V4L2_CID_COLORFX_CBCR) + XLAT(V4L2_CID_COLORFX_CBCR), +#endif +#if defined(V4L2_CID_AUTOBRIGHTNESS) || (defined(HAVE_DECL_V4L2_CID_AUTOBRIGHTNESS) && HAVE_DECL_V4L2_CID_AUTOBRIGHTNESS) + XLAT(V4L2_CID_AUTOBRIGHTNESS), +#endif +#if defined(V4L2_CID_BAND_STOP_FILTER) || (defined(HAVE_DECL_V4L2_CID_BAND_STOP_FILTER) && HAVE_DECL_V4L2_CID_BAND_STOP_FILTER) + XLAT(V4L2_CID_BAND_STOP_FILTER), +#endif +#if defined(V4L2_CID_ROTATE) || (defined(HAVE_DECL_V4L2_CID_ROTATE) && HAVE_DECL_V4L2_CID_ROTATE) + XLAT(V4L2_CID_ROTATE), +#endif +#if defined(V4L2_CID_BG_COLOR) || (defined(HAVE_DECL_V4L2_CID_BG_COLOR) && HAVE_DECL_V4L2_CID_BG_COLOR) + XLAT(V4L2_CID_BG_COLOR), +#endif +#if defined(V4L2_CID_ILLUMINATORS_1) || (defined(HAVE_DECL_V4L2_CID_ILLUMINATORS_1) && HAVE_DECL_V4L2_CID_ILLUMINATORS_1) + XLAT(V4L2_CID_ILLUMINATORS_1), +#endif +#if defined(V4L2_CID_ILLUMINATORS_2) || (defined(HAVE_DECL_V4L2_CID_ILLUMINATORS_2) && HAVE_DECL_V4L2_CID_ILLUMINATORS_2) + XLAT(V4L2_CID_ILLUMINATORS_2), +#endif +#if defined(V4L2_CID_MIN_BUFFERS_FOR_CAPTURE) || (defined(HAVE_DECL_V4L2_CID_MIN_BUFFERS_FOR_CAPTURE) && HAVE_DECL_V4L2_CID_MIN_BUFFERS_FOR_CAPTURE) + XLAT(V4L2_CID_MIN_BUFFERS_FOR_CAPTURE), +#endif +#if defined(V4L2_CID_MIN_BUFFERS_FOR_OUTPUT) || (defined(HAVE_DECL_V4L2_CID_MIN_BUFFERS_FOR_OUTPUT) && HAVE_DECL_V4L2_CID_MIN_BUFFERS_FOR_OUTPUT) + XLAT(V4L2_CID_MIN_BUFFERS_FOR_OUTPUT), +#endif +#if defined(V4L2_CID_ALPHA_COMPONENT) || (defined(HAVE_DECL_V4L2_CID_ALPHA_COMPONENT) && HAVE_DECL_V4L2_CID_ALPHA_COMPONENT) + XLAT(V4L2_CID_ALPHA_COMPONENT), +#endif +/* Camera class control IDs */ +#if defined(V4L2_CID_EXPOSURE_AUTO) || (defined(HAVE_DECL_V4L2_CID_EXPOSURE_AUTO) && HAVE_DECL_V4L2_CID_EXPOSURE_AUTO) + XLAT(V4L2_CID_EXPOSURE_AUTO), +#endif +#if defined(V4L2_CID_EXPOSURE_ABSOLUTE) || (defined(HAVE_DECL_V4L2_CID_EXPOSURE_ABSOLUTE) && HAVE_DECL_V4L2_CID_EXPOSURE_ABSOLUTE) + XLAT(V4L2_CID_EXPOSURE_ABSOLUTE), +#endif +#if defined(V4L2_CID_EXPOSURE_AUTO_PRIORITY) || (defined(HAVE_DECL_V4L2_CID_EXPOSURE_AUTO_PRIORITY) && HAVE_DECL_V4L2_CID_EXPOSURE_AUTO_PRIORITY) + XLAT(V4L2_CID_EXPOSURE_AUTO_PRIORITY), +#endif +#if defined(V4L2_CID_PAN_RELATIVE) || (defined(HAVE_DECL_V4L2_CID_PAN_RELATIVE) && HAVE_DECL_V4L2_CID_PAN_RELATIVE) + XLAT(V4L2_CID_PAN_RELATIVE), +#endif +#if defined(V4L2_CID_TILT_RELATIVE) || (defined(HAVE_DECL_V4L2_CID_TILT_RELATIVE) && HAVE_DECL_V4L2_CID_TILT_RELATIVE) + XLAT(V4L2_CID_TILT_RELATIVE), +#endif +#if defined(V4L2_CID_PAN_RESET) || (defined(HAVE_DECL_V4L2_CID_PAN_RESET) && HAVE_DECL_V4L2_CID_PAN_RESET) + XLAT(V4L2_CID_PAN_RESET), +#endif +#if defined(V4L2_CID_TILT_RESET) || (defined(HAVE_DECL_V4L2_CID_TILT_RESET) && HAVE_DECL_V4L2_CID_TILT_RESET) + XLAT(V4L2_CID_TILT_RESET), +#endif +#if defined(V4L2_CID_PAN_ABSOLUTE) || (defined(HAVE_DECL_V4L2_CID_PAN_ABSOLUTE) && HAVE_DECL_V4L2_CID_PAN_ABSOLUTE) + XLAT(V4L2_CID_PAN_ABSOLUTE), +#endif +#if defined(V4L2_CID_TILT_ABSOLUTE) || (defined(HAVE_DECL_V4L2_CID_TILT_ABSOLUTE) && HAVE_DECL_V4L2_CID_TILT_ABSOLUTE) + XLAT(V4L2_CID_TILT_ABSOLUTE), +#endif +#if defined(V4L2_CID_FOCUS_ABSOLUTE) || (defined(HAVE_DECL_V4L2_CID_FOCUS_ABSOLUTE) && HAVE_DECL_V4L2_CID_FOCUS_ABSOLUTE) + XLAT(V4L2_CID_FOCUS_ABSOLUTE), +#endif +#if defined(V4L2_CID_FOCUS_RELATIVE) || (defined(HAVE_DECL_V4L2_CID_FOCUS_RELATIVE) && HAVE_DECL_V4L2_CID_FOCUS_RELATIVE) + XLAT(V4L2_CID_FOCUS_RELATIVE), +#endif +#if defined(V4L2_CID_FOCUS_AUTO) || (defined(HAVE_DECL_V4L2_CID_FOCUS_AUTO) && HAVE_DECL_V4L2_CID_FOCUS_AUTO) + XLAT(V4L2_CID_FOCUS_AUTO), +#endif +#if defined(V4L2_CID_ZOOM_ABSOLUTE) || (defined(HAVE_DECL_V4L2_CID_ZOOM_ABSOLUTE) && HAVE_DECL_V4L2_CID_ZOOM_ABSOLUTE) + XLAT(V4L2_CID_ZOOM_ABSOLUTE), +#endif +#if defined(V4L2_CID_ZOOM_RELATIVE) || (defined(HAVE_DECL_V4L2_CID_ZOOM_RELATIVE) && HAVE_DECL_V4L2_CID_ZOOM_RELATIVE) + XLAT(V4L2_CID_ZOOM_RELATIVE), +#endif +#if defined(V4L2_CID_ZOOM_CONTINUOUS) || (defined(HAVE_DECL_V4L2_CID_ZOOM_CONTINUOUS) && HAVE_DECL_V4L2_CID_ZOOM_CONTINUOUS) + XLAT(V4L2_CID_ZOOM_CONTINUOUS), +#endif +#if defined(V4L2_CID_PRIVACY) || (defined(HAVE_DECL_V4L2_CID_PRIVACY) && HAVE_DECL_V4L2_CID_PRIVACY) + XLAT(V4L2_CID_PRIVACY), +#endif +#if defined(V4L2_CID_IRIS_ABSOLUTE) || (defined(HAVE_DECL_V4L2_CID_IRIS_ABSOLUTE) && HAVE_DECL_V4L2_CID_IRIS_ABSOLUTE) + XLAT(V4L2_CID_IRIS_ABSOLUTE), +#endif +#if defined(V4L2_CID_IRIS_RELATIVE) || (defined(HAVE_DECL_V4L2_CID_IRIS_RELATIVE) && HAVE_DECL_V4L2_CID_IRIS_RELATIVE) + XLAT(V4L2_CID_IRIS_RELATIVE), +#endif +#if defined(V4L2_CID_AUTO_EXPOSURE_BIAS) || (defined(HAVE_DECL_V4L2_CID_AUTO_EXPOSURE_BIAS) && HAVE_DECL_V4L2_CID_AUTO_EXPOSURE_BIAS) + XLAT(V4L2_CID_AUTO_EXPOSURE_BIAS), +#endif +#if defined(V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE) || (defined(HAVE_DECL_V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE) && HAVE_DECL_V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE) + XLAT(V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE), +#endif +#if defined(V4L2_CID_WIDE_DYNAMIC_RANGE) || (defined(HAVE_DECL_V4L2_CID_WIDE_DYNAMIC_RANGE) && HAVE_DECL_V4L2_CID_WIDE_DYNAMIC_RANGE) + XLAT(V4L2_CID_WIDE_DYNAMIC_RANGE), +#endif +#if defined(V4L2_CID_IMAGE_STABILIZATION) || (defined(HAVE_DECL_V4L2_CID_IMAGE_STABILIZATION) && HAVE_DECL_V4L2_CID_IMAGE_STABILIZATION) + XLAT(V4L2_CID_IMAGE_STABILIZATION), +#endif +#if defined(V4L2_CID_ISO_SENSITIVITY) || (defined(HAVE_DECL_V4L2_CID_ISO_SENSITIVITY) && HAVE_DECL_V4L2_CID_ISO_SENSITIVITY) + XLAT(V4L2_CID_ISO_SENSITIVITY), +#endif +#if defined(V4L2_CID_ISO_SENSITIVITY_AUTO) || (defined(HAVE_DECL_V4L2_CID_ISO_SENSITIVITY_AUTO) && HAVE_DECL_V4L2_CID_ISO_SENSITIVITY_AUTO) + XLAT(V4L2_CID_ISO_SENSITIVITY_AUTO), +#endif +#if defined(V4L2_CID_EXPOSURE_METERING) || (defined(HAVE_DECL_V4L2_CID_EXPOSURE_METERING) && HAVE_DECL_V4L2_CID_EXPOSURE_METERING) + XLAT(V4L2_CID_EXPOSURE_METERING), +#endif +#if defined(V4L2_CID_SCENE_MODE) || (defined(HAVE_DECL_V4L2_CID_SCENE_MODE) && HAVE_DECL_V4L2_CID_SCENE_MODE) + XLAT(V4L2_CID_SCENE_MODE), +#endif +#if defined(V4L2_CID_3A_LOCK) || (defined(HAVE_DECL_V4L2_CID_3A_LOCK) && HAVE_DECL_V4L2_CID_3A_LOCK) + XLAT(V4L2_CID_3A_LOCK), +#endif +#if defined(V4L2_CID_AUTO_FOCUS_START) || (defined(HAVE_DECL_V4L2_CID_AUTO_FOCUS_START) && HAVE_DECL_V4L2_CID_AUTO_FOCUS_START) + XLAT(V4L2_CID_AUTO_FOCUS_START), +#endif +#if defined(V4L2_CID_AUTO_FOCUS_STOP) || (defined(HAVE_DECL_V4L2_CID_AUTO_FOCUS_STOP) && HAVE_DECL_V4L2_CID_AUTO_FOCUS_STOP) + XLAT(V4L2_CID_AUTO_FOCUS_STOP), +#endif +#if defined(V4L2_CID_AUTO_FOCUS_STATUS) || (defined(HAVE_DECL_V4L2_CID_AUTO_FOCUS_STATUS) && HAVE_DECL_V4L2_CID_AUTO_FOCUS_STATUS) + XLAT(V4L2_CID_AUTO_FOCUS_STATUS), +#endif +#if defined(V4L2_CID_AUTO_FOCUS_RANGE) || (defined(HAVE_DECL_V4L2_CID_AUTO_FOCUS_RANGE) && HAVE_DECL_V4L2_CID_AUTO_FOCUS_RANGE) + XLAT(V4L2_CID_AUTO_FOCUS_RANGE), +#endif +#if defined(V4L2_CID_PRIVATE_BASE) || (defined(HAVE_DECL_V4L2_CID_PRIVATE_BASE) && HAVE_DECL_V4L2_CID_PRIVATE_BASE) + XLAT(V4L2_CID_PRIVATE_BASE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_control_ids.in b/xlat/v4l2_control_ids.in new file mode 100644 index 00000000..3dee9330 --- /dev/null +++ b/xlat/v4l2_control_ids.in @@ -0,0 +1,77 @@ +0 +V4L2_CID_BRIGHTNESS +V4L2_CID_CONTRAST +V4L2_CID_SATURATION +V4L2_CID_HUE +V4L2_CID_AUDIO_VOLUME +V4L2_CID_AUDIO_BALANCE +V4L2_CID_AUDIO_BASS +V4L2_CID_AUDIO_TREBLE +V4L2_CID_AUDIO_MUTE +V4L2_CID_AUDIO_LOUDNESS +V4L2_CID_BLACK_LEVEL +V4L2_CID_AUTO_WHITE_BALANCE +V4L2_CID_DO_WHITE_BALANCE +V4L2_CID_RED_BALANCE +V4L2_CID_BLUE_BALANCE +V4L2_CID_GAMMA +V4L2_CID_WHITENESS +V4L2_CID_EXPOSURE +V4L2_CID_AUTOGAIN +V4L2_CID_GAIN +V4L2_CID_HFLIP +V4L2_CID_VFLIP +V4L2_CID_HCENTER +V4L2_CID_VCENTER +V4L2_CID_POWER_LINE_FREQUENCY +V4L2_CID_HUE_AUTO +V4L2_CID_WHITE_BALANCE_TEMPERATURE +V4L2_CID_SHARPNESS +V4L2_CID_BACKLIGHT_COMPENSATION +V4L2_CID_CHROMA_AGC +V4L2_CID_CHROMA_GAIN +V4L2_CID_COLOR_KILLER +V4L2_CID_COLORFX +V4L2_CID_COLORFX_CBCR +V4L2_CID_AUTOBRIGHTNESS +V4L2_CID_BAND_STOP_FILTER +V4L2_CID_ROTATE +V4L2_CID_BG_COLOR +V4L2_CID_ILLUMINATORS_1 +V4L2_CID_ILLUMINATORS_2 +V4L2_CID_MIN_BUFFERS_FOR_CAPTURE +V4L2_CID_MIN_BUFFERS_FOR_OUTPUT +V4L2_CID_ALPHA_COMPONENT +/* Camera class control IDs */ +V4L2_CID_EXPOSURE_AUTO +V4L2_CID_EXPOSURE_ABSOLUTE +V4L2_CID_EXPOSURE_AUTO_PRIORITY +V4L2_CID_PAN_RELATIVE +V4L2_CID_TILT_RELATIVE +V4L2_CID_PAN_RESET +V4L2_CID_TILT_RESET +V4L2_CID_PAN_ABSOLUTE +V4L2_CID_TILT_ABSOLUTE +V4L2_CID_FOCUS_ABSOLUTE +V4L2_CID_FOCUS_RELATIVE +V4L2_CID_FOCUS_AUTO +V4L2_CID_ZOOM_ABSOLUTE +V4L2_CID_ZOOM_RELATIVE +V4L2_CID_ZOOM_CONTINUOUS +V4L2_CID_PRIVACY +V4L2_CID_IRIS_ABSOLUTE +V4L2_CID_IRIS_RELATIVE +V4L2_CID_AUTO_EXPOSURE_BIAS +V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE +V4L2_CID_WIDE_DYNAMIC_RANGE +V4L2_CID_IMAGE_STABILIZATION +V4L2_CID_ISO_SENSITIVITY +V4L2_CID_ISO_SENSITIVITY_AUTO +V4L2_CID_EXPOSURE_METERING +V4L2_CID_SCENE_MODE +V4L2_CID_3A_LOCK +V4L2_CID_AUTO_FOCUS_START +V4L2_CID_AUTO_FOCUS_STOP +V4L2_CID_AUTO_FOCUS_STATUS +V4L2_CID_AUTO_FOCUS_RANGE +V4L2_CID_PRIVATE_BASE diff --git a/xlat/v4l2_control_types.h b/xlat/v4l2_control_types.h new file mode 100644 index 00000000..37ac812a --- /dev/null +++ b/xlat/v4l2_control_types.h @@ -0,0 +1,43 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_control_types.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_control_types[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_control_types[] = { +#if defined(V4L2_CTRL_TYPE_INTEGER) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_INTEGER) && HAVE_DECL_V4L2_CTRL_TYPE_INTEGER) + XLAT(V4L2_CTRL_TYPE_INTEGER), +#endif +#if defined(V4L2_CTRL_TYPE_BOOLEAN) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_BOOLEAN) && HAVE_DECL_V4L2_CTRL_TYPE_BOOLEAN) + XLAT(V4L2_CTRL_TYPE_BOOLEAN), +#endif +#if defined(V4L2_CTRL_TYPE_MENU) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_MENU) && HAVE_DECL_V4L2_CTRL_TYPE_MENU) + XLAT(V4L2_CTRL_TYPE_MENU), +#endif +#if defined(V4L2_CTRL_TYPE_INTEGER_MENU) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_INTEGER_MENU) && HAVE_DECL_V4L2_CTRL_TYPE_INTEGER_MENU) + XLAT(V4L2_CTRL_TYPE_INTEGER_MENU), +#endif +#if defined(V4L2_CTRL_TYPE_BITMASK) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_BITMASK) && HAVE_DECL_V4L2_CTRL_TYPE_BITMASK) + XLAT(V4L2_CTRL_TYPE_BITMASK), +#endif +#if defined(V4L2_CTRL_TYPE_BUTTON) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_BUTTON) && HAVE_DECL_V4L2_CTRL_TYPE_BUTTON) + XLAT(V4L2_CTRL_TYPE_BUTTON), +#endif +#if defined(V4L2_CTRL_TYPE_INTEGER64) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_INTEGER64) && HAVE_DECL_V4L2_CTRL_TYPE_INTEGER64) + XLAT(V4L2_CTRL_TYPE_INTEGER64), +#endif +#if defined(V4L2_CTRL_TYPE_STRING) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_STRING) && HAVE_DECL_V4L2_CTRL_TYPE_STRING) + XLAT(V4L2_CTRL_TYPE_STRING), +#endif +#if defined(V4L2_CTRL_TYPE_CTRL_CLASS) || (defined(HAVE_DECL_V4L2_CTRL_TYPE_CTRL_CLASS) && HAVE_DECL_V4L2_CTRL_TYPE_CTRL_CLASS) + XLAT(V4L2_CTRL_TYPE_CTRL_CLASS), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_control_types.in b/xlat/v4l2_control_types.in new file mode 100644 index 00000000..26c587eb --- /dev/null +++ b/xlat/v4l2_control_types.in @@ -0,0 +1,9 @@ +V4L2_CTRL_TYPE_INTEGER +V4L2_CTRL_TYPE_BOOLEAN +V4L2_CTRL_TYPE_MENU +V4L2_CTRL_TYPE_INTEGER_MENU +V4L2_CTRL_TYPE_BITMASK +V4L2_CTRL_TYPE_BUTTON +V4L2_CTRL_TYPE_INTEGER64 +V4L2_CTRL_TYPE_STRING +V4L2_CTRL_TYPE_CTRL_CLASS diff --git a/xlat/v4l2_device_capabilities_flags.h b/xlat/v4l2_device_capabilities_flags.h new file mode 100644 index 00000000..73928e16 --- /dev/null +++ b/xlat/v4l2_device_capabilities_flags.h @@ -0,0 +1,88 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_device_capabilities_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_device_capabilities_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_device_capabilities_flags[] = { +#if defined(V4L2_CAP_VIDEO_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE) && HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE) + XLAT(V4L2_CAP_VIDEO_CAPTURE), +#endif +#if defined(V4L2_CAP_VIDEO_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT) && HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT) + XLAT(V4L2_CAP_VIDEO_OUTPUT), +#endif +#if defined(V4L2_CAP_VIDEO_OVERLAY) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OVERLAY) && HAVE_DECL_V4L2_CAP_VIDEO_OVERLAY) + XLAT(V4L2_CAP_VIDEO_OVERLAY), +#endif +#if defined(V4L2_CAP_VBI_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_VBI_CAPTURE) && HAVE_DECL_V4L2_CAP_VBI_CAPTURE) + XLAT(V4L2_CAP_VBI_CAPTURE), +#endif +#if defined(V4L2_CAP_VBI_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_VBI_OUTPUT) && HAVE_DECL_V4L2_CAP_VBI_OUTPUT) + XLAT(V4L2_CAP_VBI_OUTPUT), +#endif +#if defined(V4L2_CAP_SLICED_VBI_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_SLICED_VBI_CAPTURE) && HAVE_DECL_V4L2_CAP_SLICED_VBI_CAPTURE) + XLAT(V4L2_CAP_SLICED_VBI_CAPTURE), +#endif +#if defined(V4L2_CAP_SLICED_VBI_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_SLICED_VBI_OUTPUT) && HAVE_DECL_V4L2_CAP_SLICED_VBI_OUTPUT) + XLAT(V4L2_CAP_SLICED_VBI_OUTPUT), +#endif +#if defined(V4L2_CAP_RDS_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_RDS_CAPTURE) && HAVE_DECL_V4L2_CAP_RDS_CAPTURE) + XLAT(V4L2_CAP_RDS_CAPTURE), +#endif +#if defined(V4L2_CAP_VIDEO_OUTPUT_OVERLAY) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_OVERLAY) && HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_OVERLAY) + XLAT(V4L2_CAP_VIDEO_OUTPUT_OVERLAY), +#endif +#if defined(V4L2_CAP_HW_FREQ_SEEK) || (defined(HAVE_DECL_V4L2_CAP_HW_FREQ_SEEK) && HAVE_DECL_V4L2_CAP_HW_FREQ_SEEK) + XLAT(V4L2_CAP_HW_FREQ_SEEK), +#endif +#if defined(V4L2_CAP_RDS_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_RDS_OUTPUT) && HAVE_DECL_V4L2_CAP_RDS_OUTPUT) + XLAT(V4L2_CAP_RDS_OUTPUT), +#endif +#if defined(V4L2_CAP_VIDEO_CAPTURE_MPLANE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE_MPLANE) && HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE_MPLANE) + XLAT(V4L2_CAP_VIDEO_CAPTURE_MPLANE), +#endif +#if defined(V4L2_CAP_VIDEO_OUTPUT_MPLANE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_MPLANE) && HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_MPLANE) + XLAT(V4L2_CAP_VIDEO_OUTPUT_MPLANE), +#endif +#if defined(V4L2_CAP_VIDEO_M2M) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_M2M) && HAVE_DECL_V4L2_CAP_VIDEO_M2M) + XLAT(V4L2_CAP_VIDEO_M2M), +#endif +#if defined(V4L2_CAP_VIDEO_M2M_MPLANE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_M2M_MPLANE) && HAVE_DECL_V4L2_CAP_VIDEO_M2M_MPLANE) + XLAT(V4L2_CAP_VIDEO_M2M_MPLANE), +#endif +#if defined(V4L2_CAP_TUNER) || (defined(HAVE_DECL_V4L2_CAP_TUNER) && HAVE_DECL_V4L2_CAP_TUNER) + XLAT(V4L2_CAP_TUNER), +#endif +#if defined(V4L2_CAP_AUDIO) || (defined(HAVE_DECL_V4L2_CAP_AUDIO) && HAVE_DECL_V4L2_CAP_AUDIO) + XLAT(V4L2_CAP_AUDIO), +#endif +#if defined(V4L2_CAP_RADIO) || (defined(HAVE_DECL_V4L2_CAP_RADIO) && HAVE_DECL_V4L2_CAP_RADIO) + XLAT(V4L2_CAP_RADIO), +#endif +#if defined(V4L2_CAP_MODULATOR) || (defined(HAVE_DECL_V4L2_CAP_MODULATOR) && HAVE_DECL_V4L2_CAP_MODULATOR) + XLAT(V4L2_CAP_MODULATOR), +#endif +#if defined(V4L2_CAP_READWRITE) || (defined(HAVE_DECL_V4L2_CAP_READWRITE) && HAVE_DECL_V4L2_CAP_READWRITE) + XLAT(V4L2_CAP_READWRITE), +#endif +#if defined(V4L2_CAP_ASYNCIO) || (defined(HAVE_DECL_V4L2_CAP_ASYNCIO) && HAVE_DECL_V4L2_CAP_ASYNCIO) + XLAT(V4L2_CAP_ASYNCIO), +#endif +#if defined(V4L2_CAP_STREAMING) || (defined(HAVE_DECL_V4L2_CAP_STREAMING) && HAVE_DECL_V4L2_CAP_STREAMING) + XLAT(V4L2_CAP_STREAMING), +#endif +#if defined(V4L2_CAP_TOUCH) || (defined(HAVE_DECL_V4L2_CAP_TOUCH) && HAVE_DECL_V4L2_CAP_TOUCH) + XLAT(V4L2_CAP_TOUCH), +#endif +#if defined(V4L2_CAP_DEVICE_CAPS) || (defined(HAVE_DECL_V4L2_CAP_DEVICE_CAPS) && HAVE_DECL_V4L2_CAP_DEVICE_CAPS) + XLAT(V4L2_CAP_DEVICE_CAPS), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_device_capabilities_flags.in b/xlat/v4l2_device_capabilities_flags.in new file mode 100644 index 00000000..9380eb44 --- /dev/null +++ b/xlat/v4l2_device_capabilities_flags.in @@ -0,0 +1,24 @@ +V4L2_CAP_VIDEO_CAPTURE +V4L2_CAP_VIDEO_OUTPUT +V4L2_CAP_VIDEO_OVERLAY +V4L2_CAP_VBI_CAPTURE +V4L2_CAP_VBI_OUTPUT +V4L2_CAP_SLICED_VBI_CAPTURE +V4L2_CAP_SLICED_VBI_OUTPUT +V4L2_CAP_RDS_CAPTURE +V4L2_CAP_VIDEO_OUTPUT_OVERLAY +V4L2_CAP_HW_FREQ_SEEK +V4L2_CAP_RDS_OUTPUT +V4L2_CAP_VIDEO_CAPTURE_MPLANE +V4L2_CAP_VIDEO_OUTPUT_MPLANE +V4L2_CAP_VIDEO_M2M +V4L2_CAP_VIDEO_M2M_MPLANE +V4L2_CAP_TUNER +V4L2_CAP_AUDIO +V4L2_CAP_RADIO +V4L2_CAP_MODULATOR +V4L2_CAP_READWRITE +V4L2_CAP_ASYNCIO +V4L2_CAP_STREAMING +V4L2_CAP_TOUCH +V4L2_CAP_DEVICE_CAPS diff --git a/xlat/v4l2_fields.h b/xlat/v4l2_fields.h new file mode 100644 index 00000000..a6c78db0 --- /dev/null +++ b/xlat/v4l2_fields.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_fields.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_fields[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_fields[] = { +#if defined(V4L2_FIELD_ANY) || (defined(HAVE_DECL_V4L2_FIELD_ANY) && HAVE_DECL_V4L2_FIELD_ANY) + XLAT(V4L2_FIELD_ANY), +#endif +#if defined(V4L2_FIELD_NONE) || (defined(HAVE_DECL_V4L2_FIELD_NONE) && HAVE_DECL_V4L2_FIELD_NONE) + XLAT(V4L2_FIELD_NONE), +#endif +#if defined(V4L2_FIELD_TOP) || (defined(HAVE_DECL_V4L2_FIELD_TOP) && HAVE_DECL_V4L2_FIELD_TOP) + XLAT(V4L2_FIELD_TOP), +#endif +#if defined(V4L2_FIELD_BOTTOM) || (defined(HAVE_DECL_V4L2_FIELD_BOTTOM) && HAVE_DECL_V4L2_FIELD_BOTTOM) + XLAT(V4L2_FIELD_BOTTOM), +#endif +#if defined(V4L2_FIELD_INTERLACED) || (defined(HAVE_DECL_V4L2_FIELD_INTERLACED) && HAVE_DECL_V4L2_FIELD_INTERLACED) + XLAT(V4L2_FIELD_INTERLACED), +#endif +#if defined(V4L2_FIELD_SEQ_TB) || (defined(HAVE_DECL_V4L2_FIELD_SEQ_TB) && HAVE_DECL_V4L2_FIELD_SEQ_TB) + XLAT(V4L2_FIELD_SEQ_TB), +#endif +#if defined(V4L2_FIELD_SEQ_BT) || (defined(HAVE_DECL_V4L2_FIELD_SEQ_BT) && HAVE_DECL_V4L2_FIELD_SEQ_BT) + XLAT(V4L2_FIELD_SEQ_BT), +#endif +#if defined(V4L2_FIELD_ALTERNATE) || (defined(HAVE_DECL_V4L2_FIELD_ALTERNATE) && HAVE_DECL_V4L2_FIELD_ALTERNATE) + XLAT(V4L2_FIELD_ALTERNATE), +#endif +#if defined(V4L2_FIELD_INTERLACED_TB) || (defined(HAVE_DECL_V4L2_FIELD_INTERLACED_TB) && HAVE_DECL_V4L2_FIELD_INTERLACED_TB) + XLAT(V4L2_FIELD_INTERLACED_TB), +#endif +#if defined(V4L2_FIELD_INTERLACED_BT) || (defined(HAVE_DECL_V4L2_FIELD_INTERLACED_BT) && HAVE_DECL_V4L2_FIELD_INTERLACED_BT) + XLAT(V4L2_FIELD_INTERLACED_BT), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_fields.in b/xlat/v4l2_fields.in new file mode 100644 index 00000000..60d00e11 --- /dev/null +++ b/xlat/v4l2_fields.in @@ -0,0 +1,10 @@ +V4L2_FIELD_ANY +V4L2_FIELD_NONE +V4L2_FIELD_TOP +V4L2_FIELD_BOTTOM +V4L2_FIELD_INTERLACED +V4L2_FIELD_SEQ_TB +V4L2_FIELD_SEQ_BT +V4L2_FIELD_ALTERNATE +V4L2_FIELD_INTERLACED_TB +V4L2_FIELD_INTERLACED_BT diff --git a/xlat/v4l2_format_description_flags.h b/xlat/v4l2_format_description_flags.h new file mode 100644 index 00000000..d82236d7 --- /dev/null +++ b/xlat/v4l2_format_description_flags.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_format_description_flags.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_format_description_flags[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_format_description_flags[] = { +#if defined(V4L2_FMT_FLAG_COMPRESSED) || (defined(HAVE_DECL_V4L2_FMT_FLAG_COMPRESSED) && HAVE_DECL_V4L2_FMT_FLAG_COMPRESSED) + XLAT(V4L2_FMT_FLAG_COMPRESSED), +#endif +#if defined(V4L2_FMT_FLAG_EMULATED) || (defined(HAVE_DECL_V4L2_FMT_FLAG_EMULATED) && HAVE_DECL_V4L2_FMT_FLAG_EMULATED) + XLAT(V4L2_FMT_FLAG_EMULATED), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_format_description_flags.in b/xlat/v4l2_format_description_flags.in new file mode 100644 index 00000000..ed5a3d38 --- /dev/null +++ b/xlat/v4l2_format_description_flags.in @@ -0,0 +1,2 @@ +V4L2_FMT_FLAG_COMPRESSED +V4L2_FMT_FLAG_EMULATED diff --git a/xlat/v4l2_frameinterval_types.h b/xlat/v4l2_frameinterval_types.h new file mode 100644 index 00000000..728c3c7d --- /dev/null +++ b/xlat/v4l2_frameinterval_types.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_frameinterval_types.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_frameinterval_types[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_frameinterval_types[] = { +#if defined(V4L2_FRMIVAL_TYPE_DISCRETE) || (defined(HAVE_DECL_V4L2_FRMIVAL_TYPE_DISCRETE) && HAVE_DECL_V4L2_FRMIVAL_TYPE_DISCRETE) + XLAT(V4L2_FRMIVAL_TYPE_DISCRETE), +#endif +#if defined(V4L2_FRMIVAL_TYPE_CONTINUOUS) || (defined(HAVE_DECL_V4L2_FRMIVAL_TYPE_CONTINUOUS) && HAVE_DECL_V4L2_FRMIVAL_TYPE_CONTINUOUS) + XLAT(V4L2_FRMIVAL_TYPE_CONTINUOUS), +#endif +#if defined(V4L2_FRMIVAL_TYPE_STEPWISE) || (defined(HAVE_DECL_V4L2_FRMIVAL_TYPE_STEPWISE) && HAVE_DECL_V4L2_FRMIVAL_TYPE_STEPWISE) + XLAT(V4L2_FRMIVAL_TYPE_STEPWISE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_frameinterval_types.in b/xlat/v4l2_frameinterval_types.in new file mode 100644 index 00000000..30d46d6e --- /dev/null +++ b/xlat/v4l2_frameinterval_types.in @@ -0,0 +1,3 @@ +V4L2_FRMIVAL_TYPE_DISCRETE +V4L2_FRMIVAL_TYPE_CONTINUOUS +V4L2_FRMIVAL_TYPE_STEPWISE diff --git a/xlat/v4l2_framesize_types.h b/xlat/v4l2_framesize_types.h new file mode 100644 index 00000000..28a77c2b --- /dev/null +++ b/xlat/v4l2_framesize_types.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_framesize_types.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_framesize_types[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_framesize_types[] = { +#if defined(V4L2_FRMSIZE_TYPE_DISCRETE) || (defined(HAVE_DECL_V4L2_FRMSIZE_TYPE_DISCRETE) && HAVE_DECL_V4L2_FRMSIZE_TYPE_DISCRETE) + XLAT(V4L2_FRMSIZE_TYPE_DISCRETE), +#endif +#if defined(V4L2_FRMSIZE_TYPE_CONTINUOUS) || (defined(HAVE_DECL_V4L2_FRMSIZE_TYPE_CONTINUOUS) && HAVE_DECL_V4L2_FRMSIZE_TYPE_CONTINUOUS) + XLAT(V4L2_FRMSIZE_TYPE_CONTINUOUS), +#endif +#if defined(V4L2_FRMSIZE_TYPE_STEPWISE) || (defined(HAVE_DECL_V4L2_FRMSIZE_TYPE_STEPWISE) && HAVE_DECL_V4L2_FRMSIZE_TYPE_STEPWISE) + XLAT(V4L2_FRMSIZE_TYPE_STEPWISE), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_framesize_types.in b/xlat/v4l2_framesize_types.in new file mode 100644 index 00000000..5eb2b83e --- /dev/null +++ b/xlat/v4l2_framesize_types.in @@ -0,0 +1,3 @@ +V4L2_FRMSIZE_TYPE_DISCRETE +V4L2_FRMSIZE_TYPE_CONTINUOUS +V4L2_FRMSIZE_TYPE_STEPWISE diff --git a/xlat/v4l2_input_types.h b/xlat/v4l2_input_types.h new file mode 100644 index 00000000..0b1ce6c7 --- /dev/null +++ b/xlat/v4l2_input_types.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_input_types.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_input_types[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_input_types[] = { +#if defined(V4L2_INPUT_TYPE_TUNER) || (defined(HAVE_DECL_V4L2_INPUT_TYPE_TUNER) && HAVE_DECL_V4L2_INPUT_TYPE_TUNER) + XLAT(V4L2_INPUT_TYPE_TUNER), +#endif +#if defined(V4L2_INPUT_TYPE_CAMERA) || (defined(HAVE_DECL_V4L2_INPUT_TYPE_CAMERA) && HAVE_DECL_V4L2_INPUT_TYPE_CAMERA) + XLAT(V4L2_INPUT_TYPE_CAMERA), +#endif +#if defined(V4L2_INPUT_TYPE_TOUCH) || (defined(HAVE_DECL_V4L2_INPUT_TYPE_TOUCH) && HAVE_DECL_V4L2_INPUT_TYPE_TOUCH) + XLAT(V4L2_INPUT_TYPE_TOUCH), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_input_types.in b/xlat/v4l2_input_types.in new file mode 100644 index 00000000..1991d502 --- /dev/null +++ b/xlat/v4l2_input_types.in @@ -0,0 +1,3 @@ +V4L2_INPUT_TYPE_TUNER +V4L2_INPUT_TYPE_CAMERA +V4L2_INPUT_TYPE_TOUCH diff --git a/xlat/v4l2_memories.h b/xlat/v4l2_memories.h new file mode 100644 index 00000000..eda2ff9a --- /dev/null +++ b/xlat/v4l2_memories.h @@ -0,0 +1,22 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_memories.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_memories[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_memories[] = { +#if defined(V4L2_MEMORY_MMAP) || (defined(HAVE_DECL_V4L2_MEMORY_MMAP) && HAVE_DECL_V4L2_MEMORY_MMAP) + XLAT(V4L2_MEMORY_MMAP), +#endif +#if defined(V4L2_MEMORY_USERPTR) || (defined(HAVE_DECL_V4L2_MEMORY_USERPTR) && HAVE_DECL_V4L2_MEMORY_USERPTR) + XLAT(V4L2_MEMORY_USERPTR), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_memories.in b/xlat/v4l2_memories.in new file mode 100644 index 00000000..e592d57f --- /dev/null +++ b/xlat/v4l2_memories.in @@ -0,0 +1,2 @@ +V4L2_MEMORY_MMAP +V4L2_MEMORY_USERPTR diff --git a/xlat/v4l2_streaming_capabilities.h b/xlat/v4l2_streaming_capabilities.h new file mode 100644 index 00000000..839146aa --- /dev/null +++ b/xlat/v4l2_streaming_capabilities.h @@ -0,0 +1,19 @@ +/* Generated by ./xlat/gen.sh from ./xlat/v4l2_streaming_capabilities.in; do not edit. */ + +#ifdef IN_MPERS + +extern const struct xlat v4l2_streaming_capabilities[]; + +#else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat v4l2_streaming_capabilities[] = { +#if defined(V4L2_CAP_TIMEPERFRAME) || (defined(HAVE_DECL_V4L2_CAP_TIMEPERFRAME) && HAVE_DECL_V4L2_CAP_TIMEPERFRAME) + XLAT(V4L2_CAP_TIMEPERFRAME), +#endif + XLAT_END +}; + +#endif /* !IN_MPERS */ diff --git a/xlat/v4l2_streaming_capabilities.in b/xlat/v4l2_streaming_capabilities.in new file mode 100644 index 00000000..1ae5e155 --- /dev/null +++ b/xlat/v4l2_streaming_capabilities.in @@ -0,0 +1 @@ +V4L2_CAP_TIMEPERFRAME diff --git a/xlat/wait4_options.h b/xlat/wait4_options.h index 86df1191..49602006 100644 --- a/xlat/wait4_options.h +++ b/xlat/wait4_options.h @@ -1,37 +1,51 @@ /* Generated by ./xlat/gen.sh from ./xlat/wait4_options.in; do not edit. */ +#ifndef WSTOPPED +#endif +#if !(defined(__WCLONE) || (defined(HAVE_DECL___WCLONE) && HAVE_DECL___WCLONE)) +# define __WCLONE 0x80000000 +#endif +#if !(defined(__WALL) || (defined(HAVE_DECL___WALL) && HAVE_DECL___WALL)) +# define __WALL 0x40000000 +#endif +#if !(defined(__WNOTHREAD) || (defined(HAVE_DECL___WNOTHREAD) && HAVE_DECL___WNOTHREAD)) +# define __WNOTHREAD 0x20000000 +#endif + +#ifdef IN_MPERS -static const struct xlat wait4_options[] = { +# error static const struct xlat wait4_options in mpers mode + +#else + +static +const struct xlat wait4_options[] = { #if defined(WNOHANG) || (defined(HAVE_DECL_WNOHANG) && HAVE_DECL_WNOHANG) - XLAT(WNOHANG), + XLAT(WNOHANG), #endif #ifndef WSTOPPED #if defined(WUNTRACED) || (defined(HAVE_DECL_WUNTRACED) && HAVE_DECL_WUNTRACED) - XLAT(WUNTRACED), + XLAT(WUNTRACED), #endif #endif #if defined(WEXITED) || (defined(HAVE_DECL_WEXITED) && HAVE_DECL_WEXITED) - XLAT(WEXITED), + XLAT(WEXITED), #endif #if defined(WTRAPPED) || (defined(HAVE_DECL_WTRAPPED) && HAVE_DECL_WTRAPPED) - XLAT(WTRAPPED), + XLAT(WTRAPPED), #endif #if defined(WSTOPPED) || (defined(HAVE_DECL_WSTOPPED) && HAVE_DECL_WSTOPPED) - XLAT(WSTOPPED), + XLAT(WSTOPPED), #endif #if defined(WCONTINUED) || (defined(HAVE_DECL_WCONTINUED) && HAVE_DECL_WCONTINUED) - XLAT(WCONTINUED), + XLAT(WCONTINUED), #endif #if defined(WNOWAIT) || (defined(HAVE_DECL_WNOWAIT) && HAVE_DECL_WNOWAIT) - XLAT(WNOWAIT), -#endif -#if defined(__WCLONE) || (defined(HAVE_DECL___WCLONE) && HAVE_DECL___WCLONE) - XLAT(__WCLONE), + XLAT(WNOWAIT), #endif -#if defined(__WALL) || (defined(HAVE_DECL___WALL) && HAVE_DECL___WALL) - XLAT(__WALL), -#endif -#if defined(__WNOTHREAD) || (defined(HAVE_DECL___WNOTHREAD) && HAVE_DECL___WNOTHREAD) - XLAT(__WNOTHREAD), -#endif - XLAT_END + XLAT(__WCLONE), + XLAT(__WALL), + XLAT(__WNOTHREAD), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/wait4_options.in b/xlat/wait4_options.in index 61219d33..df9f085a 100644 --- a/xlat/wait4_options.in +++ b/xlat/wait4_options.in @@ -7,6 +7,6 @@ WTRAPPED WSTOPPED WCONTINUED WNOWAIT -__WCLONE -__WALL -__WNOTHREAD +__WCLONE 0x80000000 +__WALL 0x40000000 +__WNOTHREAD 0x20000000 diff --git a/xlat/waitid_types.h b/xlat/waitid_types.h index 333ecc22..ddee8efc 100644 --- a/xlat/waitid_types.h +++ b/xlat/waitid_types.h @@ -1,32 +1,41 @@ /* Generated by ./xlat/gen.sh from ./xlat/waitid_types.in; do not edit. */ -static const struct xlat waitid_types[] = { +#ifdef IN_MPERS + +# error static const struct xlat waitid_types in mpers mode + +#else + +static +const struct xlat waitid_types[] = { #if defined(P_PID) || (defined(HAVE_DECL_P_PID) && HAVE_DECL_P_PID) - XLAT(P_PID), + XLAT(P_PID), #endif #if defined(P_PPID) || (defined(HAVE_DECL_P_PPID) && HAVE_DECL_P_PPID) - XLAT(P_PPID), + XLAT(P_PPID), #endif #if defined(P_PGID) || (defined(HAVE_DECL_P_PGID) && HAVE_DECL_P_PGID) - XLAT(P_PGID), + XLAT(P_PGID), #endif #if defined(P_SID) || (defined(HAVE_DECL_P_SID) && HAVE_DECL_P_SID) - XLAT(P_SID), + XLAT(P_SID), #endif #if defined(P_CID) || (defined(HAVE_DECL_P_CID) && HAVE_DECL_P_CID) - XLAT(P_CID), + XLAT(P_CID), #endif #if defined(P_UID) || (defined(HAVE_DECL_P_UID) && HAVE_DECL_P_UID) - XLAT(P_UID), + XLAT(P_UID), #endif #if defined(P_GID) || (defined(HAVE_DECL_P_GID) && HAVE_DECL_P_GID) - XLAT(P_GID), + XLAT(P_GID), #endif #if defined(P_ALL) || (defined(HAVE_DECL_P_ALL) && HAVE_DECL_P_ALL) - XLAT(P_ALL), + XLAT(P_ALL), #endif #if defined(P_LWPID) || (defined(HAVE_DECL_P_LWPID) && HAVE_DECL_P_LWPID) - XLAT(P_LWPID), + XLAT(P_LWPID), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/whence_codes.h b/xlat/whence_codes.h index 2576b78d..aa3f8624 100644 --- a/xlat/whence_codes.h +++ b/xlat/whence_codes.h @@ -1,20 +1,24 @@ /* Generated by ./xlat/gen.sh from ./xlat/whence_codes.in; do not edit. */ +#ifndef IN_MPERS + const struct xlat whence_codes[] = { #if defined(SEEK_SET) || (defined(HAVE_DECL_SEEK_SET) && HAVE_DECL_SEEK_SET) - XLAT(SEEK_SET), + XLAT(SEEK_SET), #endif #if defined(SEEK_CUR) || (defined(HAVE_DECL_SEEK_CUR) && HAVE_DECL_SEEK_CUR) - XLAT(SEEK_CUR), + XLAT(SEEK_CUR), #endif #if defined(SEEK_END) || (defined(HAVE_DECL_SEEK_END) && HAVE_DECL_SEEK_END) - XLAT(SEEK_END), + XLAT(SEEK_END), #endif #if defined(SEEK_DATA) || (defined(HAVE_DECL_SEEK_DATA) && HAVE_DECL_SEEK_DATA) - XLAT(SEEK_DATA), + XLAT(SEEK_DATA), #endif #if defined(SEEK_HOLE) || (defined(HAVE_DECL_SEEK_HOLE) && HAVE_DECL_SEEK_HOLE) - XLAT(SEEK_HOLE), + XLAT(SEEK_HOLE), #endif - XLAT_END + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/xattrflags.h b/xlat/xattrflags.h index 33622c45..36adfd0d 100644 --- a/xlat/xattrflags.h +++ b/xlat/xattrflags.h @@ -1,11 +1,22 @@ /* Generated by ./xlat/gen.sh from ./xlat/xattrflags.in; do not edit. */ - -static const struct xlat xattrflags[] = { -#if defined(XATTR_CREATE) || (defined(HAVE_DECL_XATTR_CREATE) && HAVE_DECL_XATTR_CREATE) - XLAT(XATTR_CREATE), +#if !(defined(XATTR_CREATE) || (defined(HAVE_DECL_XATTR_CREATE) && HAVE_DECL_XATTR_CREATE)) +# define XATTR_CREATE 1 #endif -#if defined(XATTR_REPLACE) || (defined(HAVE_DECL_XATTR_REPLACE) && HAVE_DECL_XATTR_REPLACE) - XLAT(XATTR_REPLACE), +#if !(defined(XATTR_REPLACE) || (defined(HAVE_DECL_XATTR_REPLACE) && HAVE_DECL_XATTR_REPLACE)) +# define XATTR_REPLACE 2 #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat xattrflags in mpers mode + +#else + +static +const struct xlat xattrflags[] = { + XLAT(XATTR_CREATE), + XLAT(XATTR_REPLACE), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/xattrflags.in b/xlat/xattrflags.in index 41d1896d..37488ee5 100644 --- a/xlat/xattrflags.in +++ b/xlat/xattrflags.in @@ -1,2 +1,2 @@ -XATTR_CREATE -XATTR_REPLACE +XATTR_CREATE 1 +XATTR_REPLACE 2 diff --git a/xlat/xfs_dqblk_flags.h b/xlat/xfs_dqblk_flags.h index 049bb347..b0a91847 100644 --- a/xlat/xfs_dqblk_flags.h +++ b/xlat/xfs_dqblk_flags.h @@ -1,14 +1,26 @@ /* Generated by ./xlat/gen.sh from ./xlat/xfs_dqblk_flags.in; do not edit. */ - -static const struct xlat xfs_dqblk_flags[] = { -#if defined(XFS_USER_QUOTA) || (defined(HAVE_DECL_XFS_USER_QUOTA) && HAVE_DECL_XFS_USER_QUOTA) - XLAT(XFS_USER_QUOTA), +#if !(defined(XFS_USER_QUOTA) || (defined(HAVE_DECL_XFS_USER_QUOTA) && HAVE_DECL_XFS_USER_QUOTA)) +# define XFS_USER_QUOTA (1<<0) #endif -#if defined(XFS_PROJ_QUOTA) || (defined(HAVE_DECL_XFS_PROJ_QUOTA) && HAVE_DECL_XFS_PROJ_QUOTA) - XLAT(XFS_PROJ_QUOTA), +#if !(defined(XFS_PROJ_QUOTA) || (defined(HAVE_DECL_XFS_PROJ_QUOTA) && HAVE_DECL_XFS_PROJ_QUOTA)) +# define XFS_PROJ_QUOTA (1<<1) #endif -#if defined(XFS_GROUP_QUOTA) || (defined(HAVE_DECL_XFS_GROUP_QUOTA) && HAVE_DECL_XFS_GROUP_QUOTA) - XLAT(XFS_GROUP_QUOTA), +#if !(defined(XFS_GROUP_QUOTA) || (defined(HAVE_DECL_XFS_GROUP_QUOTA) && HAVE_DECL_XFS_GROUP_QUOTA)) +# define XFS_GROUP_QUOTA (1<<2) #endif - XLAT_END + +#ifdef IN_MPERS + +# error static const struct xlat xfs_dqblk_flags in mpers mode + +#else + +static +const struct xlat xfs_dqblk_flags[] = { + XLAT(XFS_USER_QUOTA), + XLAT(XFS_PROJ_QUOTA), + XLAT(XFS_GROUP_QUOTA), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/xfs_dqblk_flags.in b/xlat/xfs_dqblk_flags.in index 3128e171..c3277bb1 100644 --- a/xlat/xfs_dqblk_flags.in +++ b/xlat/xfs_dqblk_flags.in @@ -1,3 +1,3 @@ -XFS_USER_QUOTA -XFS_PROJ_QUOTA -XFS_GROUP_QUOTA +XFS_USER_QUOTA (1<<0) +XFS_PROJ_QUOTA (1<<1) +XFS_GROUP_QUOTA (1<<2) diff --git a/xlat/xfs_quota_flags.h b/xlat/xfs_quota_flags.h index a43321da..f635b960 100644 --- a/xlat/xfs_quota_flags.h +++ b/xlat/xfs_quota_flags.h @@ -1,17 +1,38 @@ /* Generated by ./xlat/gen.sh from ./xlat/xfs_quota_flags.in; do not edit. */ - -static const struct xlat xfs_quota_flags[] = { -#if defined(XFS_QUOTA_UDQ_ACCT) || (defined(HAVE_DECL_XFS_QUOTA_UDQ_ACCT) && HAVE_DECL_XFS_QUOTA_UDQ_ACCT) - XLAT(XFS_QUOTA_UDQ_ACCT), +#if !(defined(XFS_QUOTA_UDQ_ACCT) || (defined(HAVE_DECL_XFS_QUOTA_UDQ_ACCT) && HAVE_DECL_XFS_QUOTA_UDQ_ACCT)) +# define XFS_QUOTA_UDQ_ACCT (1<<0) +#endif +#if !(defined(XFS_QUOTA_UDQ_ENFD) || (defined(HAVE_DECL_XFS_QUOTA_UDQ_ENFD) && HAVE_DECL_XFS_QUOTA_UDQ_ENFD)) +# define XFS_QUOTA_UDQ_ENFD (1<<1) #endif -#if defined(XFS_QUOTA_UDQ_ENFD) || (defined(HAVE_DECL_XFS_QUOTA_UDQ_ENFD) && HAVE_DECL_XFS_QUOTA_UDQ_ENFD) - XLAT(XFS_QUOTA_UDQ_ENFD), +#if !(defined(XFS_QUOTA_GDQ_ACCT) || (defined(HAVE_DECL_XFS_QUOTA_GDQ_ACCT) && HAVE_DECL_XFS_QUOTA_GDQ_ACCT)) +# define XFS_QUOTA_GDQ_ACCT (1<<2) #endif -#if defined(XFS_QUOTA_GDQ_ACCT) || (defined(HAVE_DECL_XFS_QUOTA_GDQ_ACCT) && HAVE_DECL_XFS_QUOTA_GDQ_ACCT) - XLAT(XFS_QUOTA_GDQ_ACCT), +#if !(defined(XFS_QUOTA_GDQ_ENFD) || (defined(HAVE_DECL_XFS_QUOTA_GDQ_ENFD) && HAVE_DECL_XFS_QUOTA_GDQ_ENFD)) +# define XFS_QUOTA_GDQ_ENFD (1<<3) #endif -#if defined(XFS_QUOTA_GDQ_ENFD) || (defined(HAVE_DECL_XFS_QUOTA_GDQ_ENFD) && HAVE_DECL_XFS_QUOTA_GDQ_ENFD) - XLAT(XFS_QUOTA_GDQ_ENFD), +#if !(defined(XFS_QUOTA_PDQ_ACCT) || (defined(HAVE_DECL_XFS_QUOTA_PDQ_ACCT) && HAVE_DECL_XFS_QUOTA_PDQ_ACCT)) +# define XFS_QUOTA_PDQ_ACCT (1<<4) #endif - XLAT_END +#if !(defined(XFS_QUOTA_PDQ_ENFD) || (defined(HAVE_DECL_XFS_QUOTA_PDQ_ENFD) && HAVE_DECL_XFS_QUOTA_PDQ_ENFD)) +# define XFS_QUOTA_PDQ_ENFD (1<<5) +#endif + +#ifdef IN_MPERS + +# error static const struct xlat xfs_quota_flags in mpers mode + +#else + +static +const struct xlat xfs_quota_flags[] = { + XLAT(XFS_QUOTA_UDQ_ACCT), + XLAT(XFS_QUOTA_UDQ_ENFD), + XLAT(XFS_QUOTA_GDQ_ACCT), + XLAT(XFS_QUOTA_GDQ_ENFD), + XLAT(XFS_QUOTA_PDQ_ACCT), + XLAT(XFS_QUOTA_PDQ_ENFD), + XLAT_END }; + +#endif /* !IN_MPERS */ diff --git a/xlat/xfs_quota_flags.in b/xlat/xfs_quota_flags.in index b9a53f05..cf44da51 100644 --- a/xlat/xfs_quota_flags.in +++ b/xlat/xfs_quota_flags.in @@ -1,4 +1,6 @@ -XFS_QUOTA_UDQ_ACCT -XFS_QUOTA_UDQ_ENFD -XFS_QUOTA_GDQ_ACCT -XFS_QUOTA_GDQ_ENFD +XFS_QUOTA_UDQ_ACCT (1<<0) +XFS_QUOTA_UDQ_ENFD (1<<1) +XFS_QUOTA_GDQ_ACCT (1<<2) +XFS_QUOTA_GDQ_ENFD (1<<3) +XFS_QUOTA_PDQ_ACCT (1<<4) +XFS_QUOTA_PDQ_ENFD (1<<5) diff --git a/xmalloc.c b/xmalloc.c new file mode 100644 index 00000000..11589270 --- /dev/null +++ b/xmalloc.c @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2015 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +void die_out_of_memory(void) +{ + static bool recursed = false; + + if (recursed) + exit(1); + recursed = 1; + + error_msg_and_die("Out of memory"); +} + +void *xmalloc(size_t size) +{ + void *p = malloc(size); + + if (!p) + die_out_of_memory(); + + return p; +} + +void *xcalloc(size_t nmemb, size_t size) +{ + void *p = calloc(nmemb, size); + + if (!p) + die_out_of_memory(); + + return p; +} + +#define HALF_SIZE_T (((size_t) 1) << (sizeof(size_t) * 4)) + +void *xreallocarray(void *ptr, size_t nmemb, size_t size) +{ + size_t bytes = nmemb * size; + + if ((nmemb | size) >= HALF_SIZE_T && + size && bytes / size != nmemb) + die_out_of_memory(); + + void *p = realloc(ptr, bytes); + + if (!p) + die_out_of_memory(); + + return p; +} + +char *xstrdup(const char *str) +{ + char *p = strdup(str); + + if (!p) + die_out_of_memory(); + + return p; +}